/* ── Reaction Time Test ── */

.reaction-container {
  border-radius: var(--radius-lg, 16px);
  padding: 20px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  background: #f8f9fa;
}

/* ── Click Zone ── */
.rt-zone {
  width: 100%;
  max-width: 520px;
  min-height: 320px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: background 0.15s ease;
  padding: 32px 20px;
  text-align: center;
  gap: 12px;
}

.rt-zone.state-idle {
  background: #3b82f6;
}

.rt-zone.state-waiting {
  background: #ef4444;
}

.rt-zone.state-ready {
  background: #22c55e;
}

.rt-zone.state-result {
  background: #3b82f6;
}

.rt-zone.state-early {
  background: #f59e0b;
}

.rt-zone-icon {
  font-size: 3rem;
  line-height: 1;
}

.rt-zone-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.rt-zone-desc {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.8);
  margin: 0;
  max-width: 320px;
  line-height: 1.5;
}

.rt-zone-ms {
  font-size: 3.5rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}

.rt-zone-ms-label {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 600;
}

/* ── Round Indicators ── */
.rt-rounds {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.rt-round-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.5);
  transition: background 0.2s ease, color 0.2s ease;
}

.rt-round-dot.completed {
  background: rgba(255, 255, 255, 0.35);
  color: #fff;
}

.rt-round-dot.active {
  background: rgba(255, 255, 255, 0.5);
  color: #fff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

/* ── Results Panel ── */
.rt-results {
  width: 100%;
  max-width: 520px;
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  display: none;
}

.rt-results.visible { display: block; }

.rt-results-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-text, #1a1a2e);
  margin: 0 0 12px;
  text-align: center;
}

.rt-results-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.rt-result-box {
  text-align: center;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 8px;
}

.rt-result-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted, #888);
  margin-bottom: 2px;
}

.rt-result-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-text, #1a1a2e);
}

.rt-result-value.fast { color: #22c55e; }
.rt-result-value.medium { color: #f59e0b; }
.rt-result-value.slow { color: #ef4444; }

/* Attempt list */
.rt-attempts {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.rt-attempt {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  background: #e8f5e9;
  color: #2e7d32;
}

.rt-attempt.early {
  background: #fff3e0;
  color: #e65100;
  text-decoration: line-through;
}

/* Rating */
.rt-rating {
  text-align: center;
  padding: 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
}

.rt-rating.excellent { background: #e8f5e9; color: #1b5e20; }
.rt-rating.great { background: #e3f2fd; color: #1565c0; }
.rt-rating.average { background: #fff8e1; color: #f57f17; }
.rt-rating.below-average { background: #fce4ec; color: #c62828; }

/* Controls */
.rt-controls {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.rt-btn {
  padding: 8px 20px;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  background: #3b82f6;
  color: #fff;
  transition: background 0.15s ease;
}

.rt-btn:hover { background: #2563eb; }

.rt-btn-secondary {
  background: var(--color-border-light, #e0e0e0);
  color: var(--color-text, #333);
}

.rt-btn-secondary:hover { background: #d0d0d0; }

/* Best stats */
.rt-best-row {
  display: flex;
  gap: 16px;
  color: var(--color-text-muted, #888);
  font-size: 0.72rem;
  justify-content: center;
}

.rt-best-row span {
  color: var(--color-text, #333);
  font-weight: 600;
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .reaction-container { padding: 12px 8px; border-radius: 12px; }
  .rt-zone { min-height: 260px; padding: 24px 16px; }
  .rt-zone-icon { font-size: 2.4rem; }
  .rt-zone-title { font-size: 1.2rem; }
  .rt-zone-desc { font-size: 0.85rem; }
  .rt-zone-ms { font-size: 2.8rem; }
  .rt-round-dot { width: 30px; height: 30px; font-size: 0.65rem; }
  .rt-results-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .rt-result-value { font-size: 1.1rem; }
}
