/* Reaction Time — only test-specific overrides */
:root {
  --test-accent: #f5a623;
  --rt-arena-bg-0: color-mix(in srgb, var(--test-accent) 2%, rgba(0,0,0,0.35));
  --rt-arena-shadow: inset 0 0 40px rgba(46, 204, 113, 0.4);
  --rt-arena-bg-100: rgba(46, 204, 113, 0.1);
}
html.light {
  --rt-arena-bg-0: color-mix(in srgb, var(--test-accent) 4%, rgba(0,0,0,0.04));
  --rt-arena-shadow: none;
  --rt-arena-bg-100: #edfaf4;
}

.t-intro-icon::before {
  content: 'bolt';
}

/* ── REACTION BOX ── */
.rt-box {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.12s ease, box-shadow 0.12s ease, transform 0.12s ease;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  overflow: hidden;
}

.rt-box[data-state="idle"],
.rt-box[data-state="countdown"],
.rt-box[data-state="wait"]      { background: var(--color-surface-container-low); }
.rt-box[data-state="go"]        {
  background: #2ecc71;
  box-shadow: 0 0 0 8px rgba(35,193,107,0.15), 0 0 60px rgba(35,193,107,0.3);
  transform: scale(1.01);
  cursor: pointer;
}
.rt-box[data-state="hit"]       { background: #edfaf4; cursor: default; }
.rt-box[data-state="miss"]      { background: #fef2f1; cursor: default; }
.rt-box[data-state="early"]     { background: #fef2f1; cursor: default; }

.rt-box-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  pointer-events: none;
}

.rt-status {
  font-family: 'Manrope', sans-serif;
  font-size: 54px;
  font-weight: 900;
  color: var(--text);
  line-height: 1;
  transition: color 0.1s;
}
.rt-box[data-state="countdown"] .rt-status,
.rt-box[data-state="wait"] .rt-status { color: var(--text); }
.rt-box[data-state="go"] .rt-status { color: #fff; font-size: 64px; letter-spacing: -0.02em; }
.rt-box[data-state="hit"] .rt-status { color: #2ecc71; }
.rt-box[data-state="miss"] .rt-status { color: #e74c3c; }
.rt-box[data-state="early"] .rt-status { color: #e74c3c; }

.rt-sub {
  font-family: 'Lexend', sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-faint);
  transition: color 0.1s;
}
.rt-box[data-state="countdown"] .rt-sub,
.rt-box[data-state="wait"] .rt-sub { color: var(--text-muted); }
.rt-box[data-state="go"] .rt-sub { color: rgba(255,255,255,0.8); }

@media (max-width: 480px) {
  .rt-status { font-size: 38px; }
  .rt-box[data-state="go"] .rt-status { font-size: 44px; }
  .rt-sub { font-size: 13.5px; }
}

/* Ripple on go state */
.rt-box[data-state="go"]::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--r-md, 8px);
  animation: rtRipple 0.8s ease-out infinite;
  background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 70%);
}
@keyframes rtRipple {
  0%   { opacity: 0.6; transform: scale(0.95); }
  100% { opacity: 0; transform: scale(1.05); }
}

.rt-hint {
  font-family: 'Lexend', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-faint);
  text-align: center;
  margin-top: -8px;
}


/* ── INTRO VISUAL MAPPING ── */
/* ── INTRO VISUAL EXAMPLE ── */
.rt-preview-arena {
  position: relative;
  width: 280px;
  height: 120px;
  background: color-mix(in srgb, var(--test-accent) 2%, rgba(0,0,0,0.35));
  border: 1.5px solid var(--color-outline);
  border-radius: 12px;
  overflow: hidden;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: rtArenaColor 4.5s infinite steps(1);
}

html.light .rt-preview-arena {
  background: var(--rt-arena-bg-0);
}

@keyframes rtArenaColor {
  0%, 40% { background: var(--rt-arena-bg-0); }
  41%, 47% { background: #2ecc71; box-shadow: var(--rt-arena-shadow); }
  48%, 100% { background: var(--rt-arena-bg-100); }
}

.rt-preview-box {
  display: flex;
  align-items: center;
  justify-content: center;
}

.rt-preview-status {
  font-family: var(--font-h);
  font-size: 20px;
  font-weight: 900;
  color: var(--text);
}

.rt-preview-status::after {
  content: 'Wait...';
  animation: rtStatusContent 4.5s infinite steps(1);
}

@keyframes rtStatusContent {
  0%, 40% { content: 'Wait...'; color: var(--text-muted); }
  41%, 47% { content: 'Go!'; color: #ffffff; }
  48%, 100% { content: '182ms'; color: #2ecc71; }
}

.rt-preview-click {
  position: absolute;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  pointer-events: none;
  z-index: 10;
  animation: rtClickAnimate 4.5s infinite linear;
}

.rt-preview-click span {
  font-size: 20px;
  line-height: 1;
  display: block;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

@keyframes rtClickAnimate {
  0% { left: 140px; top: 90px; opacity: 0; transform: translate(-35%, -15%) scale(1.2); }
  40% { left: 140px; top: 90px; opacity: 0; transform: translate(-35%, -15%) scale(1.2); }
  44% { left: 140px; top: 60px; opacity: 1; transform: translate(-35%, -15%) scale(1.2); }
  46% { left: 140px; top: 60px; opacity: 1; transform: translate(-35%, -15%) scale(0.8); }
  48% { left: 140px; top: 60px; opacity: 1; transform: translate(-35%, -15%) scale(1.1); }
  56% { left: 140px; top: 90px; opacity: 0; transform: translate(-35%, -15%) scale(1.2); }
  100% { left: 140px; top: 90px; opacity: 0; }
}

.rt-preview-caption {
  font-family: var(--font-b);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
  width: 100%;
  line-height: 1.4;
  margin-top: 10px;
}

.rt-preview-caption .rt-highlight {
  color: #2ecc71;
  font-weight: 700;
}
