/* Test page styles */
.test-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 180px);
  gap: var(--space-lg);
}

.test-arena {
  width: 100%;
  max-width: 600px;
  min-height: 400px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
  position: relative;
}

.test-stimulus {
  font-size: 72px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-primary);
  user-select: none;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.test-countdown {
  font-size: 96px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--accent-primary);
  animation: pulse 1s ease infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.1); }
}

.test-instructions {
  max-width: 500px;
  text-align: center;
  line-height: 1.8;
}

.test-instructions h3 {
  margin-bottom: var(--space-md);
}

.test-instructions p {
  margin-bottom: var(--space-md);
}

.test-instructions .key-hint {
  display: inline-block;
  padding: var(--space-xs) var(--space-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  font-family: var(--font-mono);
  margin: var(--space-xs);
}

/* Stroop color classes */
.stroop-red { color: #ef4444; }
.stroop-blue { color: #3b82f6; }
.stroop-green { color: #22c55e; }
.stroop-yellow { color: #eab308; }

/* N-back grid */
.nback-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  width: 200px;
  height: 200px;
}

.nback-cell {
  background: var(--bg-tertiary);
  border-radius: 4px;
  transition: background var(--transition-fast);
}

.nback-cell.active {
  background: var(--accent-primary);
  box-shadow: 0 0 12px var(--accent-glow);
}

/* Digit span display */
.digit-display {
  font-size: 48px;
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.3em;
  color: var(--accent-primary);
  min-height: 60px;
}

.digit-input {
  font-size: var(--text-xl);
  font-family: var(--font-mono);
  text-align: center;
  width: 200px;
  letter-spacing: 0.2em;
}

/* Reaction time target */
.rt-target {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--accent-primary);
  opacity: 0;
  transition: opacity 0.05s;
  cursor: pointer;
}

.rt-target.visible {
  opacity: 1;
  box-shadow: 0 0 20px var(--accent-glow);
}

.rt-target.choice-1 { background: #ef4444; }
.rt-target.choice-2 { background: #3b82f6; }
.rt-target.choice-3 { background: #22c55e; }
.rt-target.choice-4 { background: #f59e0b; }

/* Pattern grid */
.pattern-grid {
  display: grid;
  gap: 4px;
}

.pattern-cell {
  width: 50px;
  height: 50px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  transition: background var(--transition-fast);
}

.pattern-cell.filled {
  background: var(--accent-primary);
}

.pattern-cell.missing {
  background: var(--bg-hover);
  border: 2px dashed var(--border-color);
}

.pattern-options {
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.pattern-option {
  cursor: pointer;
  padding: var(--space-sm);
  border: 2px solid transparent;
  border-radius: var(--border-radius);
  transition: all var(--transition-fast);
}

.pattern-option:hover {
  border-color: var(--accent-primary);
}

/* Test results */
.test-results {
  width: 100%;
  max-width: 500px;
}

.test-score {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.test-score-value {
  font-size: 72px;
  font-weight: 700;
  font-family: var(--font-mono);
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.test-score-label {
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-transform: uppercase;
}

.test-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

.test-metric {
  padding: var(--space-md);
  background: var(--bg-secondary);
  border-radius: var(--border-radius);
  text-align: center;
}

.test-metric-value {
  font-size: var(--text-xl);
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.test-metric-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

.test-actions {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  margin-top: var(--space-xl);
}

/* Feedback flash */
.feedback-correct {
  animation: flashGreen 0.3s ease;
}

.feedback-incorrect {
  animation: flashRed 0.3s ease;
}

@keyframes flashGreen {
  0%, 100% { background: var(--bg-secondary); }
  50% { background: rgba(16, 185, 129, 0.2); }
}

@keyframes flashRed {
  0%, 100% { background: var(--bg-secondary); }
  50% { background: rgba(239, 68, 68, 0.2); }
}

/* Answer buttons, for touch screens (the keyboard keys keep working) */
.touch-pad { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 20px; }
.touch-key { min-width: 72px; min-height: 48px; touch-action: manipulation; user-select: none; }
.touch-key.pressed { border-color: var(--accent-primary); color: var(--accent-primary); }
.test-arena { touch-action: manipulation; }
