/* FastX — shared design system */

:root {
  --bg: #0a0a0a;
  --surface: #141414;
  --surface-2: #1f1f1f;
  --border: #2a2a2a;
  --text: #f5f5f5;
  --text-dim: #8a8a8a;
  --text-faint: #555;
  --accent: #facc15;        /* yellow — "fast" energy */
  --accent-dim: #a98a00;
  --success: #22c55e;
  --error: #ef4444;
  --info: #3b82f6;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 4px 24px rgba(0,0,0,0.35);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --transition: 150ms cubic-bezier(.4,0,.2,1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body { display: flex; flex-direction: column; }

a {
  color: var(--text);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--accent); }

button {
  font-family: inherit;
  font-size: inherit;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}
button:hover:not(:disabled) {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}
button:disabled { opacity: 0.4; cursor: not-allowed; }

button.primary {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
  font-weight: 600;
}
button.primary:hover:not(:disabled) {
  background: #fde047;
  border-color: #fde047;
}

/* Header — sticky with subtle backdrop blur once scrolled */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.logo .x { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 1.5rem;
  font-size: 0.9rem;
  list-style: none;
}
.nav-links a { color: var(--text-dim); }
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--accent); }

/* Main — comfortable wide max for modern displays */
main {
  flex: 1;
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
  padding: 3rem 2rem;
}

/* Hero */
.hero {
  text-align: center;
  margin-bottom: 4rem;
}
.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin-bottom: 1rem;
}
.hero h1 .x { color: var(--accent); }
.hero p {
  font-size: 1.15rem;
  color: var(--text-dim);
  max-width: 540px;
  margin: 0 auto;
}

/* Test grid */
.test-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 3rem;
}

.test-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: all var(--transition);
  display: block;
  color: var(--text);
}
.test-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  color: var(--text);
}
.test-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  font-weight: 700;
}
.test-card p {
  color: var(--text-dim);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}
.test-card .meta {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Test page layout — outer is unconstrained so .results-mode can be wider than play-mode */
.test-page {
  max-width: none;
  margin: 0 auto;
  text-align: center;
}
/* Centered narrow column for title/subtitle/play area */
.test-page > h1,
.test-page > .subtitle,
.test-page > .play-mode,
.test-page > .ad-slot,
.test-page > .content-block {
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}
.test-page > .content-block { max-width: 720px; }
.test-page > .ad-slot { max-width: 728px; }
.test-page h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}
.test-page .subtitle {
  color: var(--text-dim);
  margin-bottom: 2rem;
}

/* Test stage — the actual play area */
.stage {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: clamp(440px, 64vh, 720px);
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  -webkit-user-select: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: background var(--transition);
}
.stage.state-waiting { background: var(--info); }
.stage.state-ready { background: var(--success); }
.stage.state-fail { background: var(--error); }
.stage.state-done { background: var(--surface); }

.stage-message {
  font-size: 1.5rem;
  font-weight: 600;
  color: #fff;
  text-align: center;
  padding: 2rem;
}
.stage-message .big {
  display: block;
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-family: var(--font-mono);
  font-weight: 800;
  margin: 0.5rem 0;
  letter-spacing: -0.03em;
}
.stage-message .hint {
  display: block;
  font-size: 0.95rem;
  opacity: 0.85;
  font-weight: 400;
  margin-top: 0.5rem;
}

/* Result card */
.result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  margin-top: 1.5rem;
  text-align: center;
}
.result-card .score {
  font-family: var(--font-mono);
  font-size: 3rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.03em;
}
.result-card .label {
  color: var(--text-dim);
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
}
.result-card .rank {
  margin-top: 1rem;
  font-size: 0.95rem;
  color: var(--text-dim);
}
.result-card .rank strong { color: var(--text); }
.result-card .actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

/* Stats row above stage */
.stats-row {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.stat {
  text-align: center;
}
.stat .value {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}
.stat .label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-top: 0.25rem;
}

/* Mode selector */
.mode-selector {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.mode-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}
.mode-btn.active {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--text-dim);
}
.mode-btn:hover:not(.active) {
  color: var(--text);
  background: transparent;
  border-color: var(--text-dim);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-faint);
}
.site-footer a { color: var(--text-dim); margin: 0 0.5rem; }

/* Ad slot — placeholder until AdSense is wired */
.ad-slot {
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 2rem auto;
  max-width: 728px;
}
.ad-slot::before { content: "advertisement"; }

/* Article-style content blocks (great for SEO on each test page) */
.content-block {
  max-width: 720px;
  margin: 4rem auto 0;
  color: var(--text-dim);
  line-height: 1.7;
}
.content-block h2 {
  color: var(--text);
  font-size: 1.4rem;
  margin: 2rem 0 0.75rem;
  font-weight: 700;
}
.content-block p { margin-bottom: 1rem; }
.content-block ul { padding-left: 1.5rem; margin-bottom: 1rem; }
.content-block li { margin-bottom: 0.5rem; }

/* Aim trainer canvas */
canvas.aim-canvas {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 800px;
  height: auto;
  cursor: crosshair;
  touch-action: none;
}

/* ── Results screen (rich end screen, replaces the small result-card pattern) ── */

/* When results are shown, we hide the play area (.play-mode) and reveal .results-mode */
.play-mode[hidden],
.results-mode[hidden] { display: none !important; }

/* Results-mode is wider than the play area — uses the horizontal space.
 * Grid layout: hero spans full width; dist + history sit side-by-side. */
.results-mode {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 1.25rem;
  text-align: left;
}
.results-mode > .results-hero,
.results-mode > #feedback-slot,
.results-mode > .info-grid,
.results-mode > .results-actions {
  grid-column: 1 / -1;
}
.results-mode > #dist-slot   { grid-column: 1; min-width: 0; }
.results-mode > #history-slot{ grid-column: 2; min-width: 0; align-self: stretch; }

/* Hero — 2-column internal layout: score on left, grade + percentile on right */
.results-hero {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 2.25rem;
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  grid-template-rows: auto auto auto auto;
  gap: 0.5rem 2.5rem;
  align-items: start;
}
.results-hero > .eyebrow    { grid-column: 1; grid-row: 1; margin: 0; }
.results-hero > .hero-score { grid-column: 1; grid-row: 2; }
.results-hero > .hero-sub   { grid-column: 1; grid-row: 3; margin: 0; }
.results-hero > .grade-badge { grid-column: 2; grid-row: 1 / 3; justify-self: center; align-self: center; margin: 0; }
.results-hero > .grade-label { grid-column: 2; grid-row: 3; justify-self: center; margin-bottom: 0; }
.results-hero > .percentile-row { grid-column: 1 / -1; grid-row: 4; max-width: none; margin: 1.25rem 0 0; }

.results-hero .eyebrow {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-faint);
  font-weight: 600;
}

.results-hero .hero-score {
  font-family: var(--font-mono);
  font-size: clamp(2.75rem, 7vw, 5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--accent);
  line-height: 1;
}

.results-hero .hero-sub {
  color: var(--text-dim);
  font-size: 0.95rem;
  line-height: 1.55;
}

.results-hero .hero-sub strong { color: var(--text); font-weight: 600; }

/* Letter grade badge — bold focal point */
.grade-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 5.5rem;
  height: 5.5rem;
  padding: 0 1rem;
  background: rgba(0,0,0,0.4);
  border: 2px solid currentColor;
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.grade-label {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

/* Mobile / narrow: collapse the 2-col grid back to single column */
@media (max-width: 820px) {
  .results-mode {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .results-mode > #dist-slot,
  .results-mode > #history-slot { grid-column: 1 / -1; }
  .results-hero {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 2rem 1.5rem;
  }
  .results-hero > .eyebrow    { grid-row: 1; grid-column: 1; }
  .results-hero > .grade-badge{ grid-row: 2; grid-column: 1; justify-self: center; margin: 0.5rem auto; }
  .results-hero > .grade-label{ grid-row: 3; grid-column: 1; }
  .results-hero > .hero-score { grid-row: 4; grid-column: 1; text-align: center; }
  .results-hero > .hero-sub   { grid-row: 5; grid-column: 1; }
  .results-hero > .percentile-row { grid-row: 6; grid-column: 1; }
}

/* Percentile bar */
.percentile-row {
  margin: 2rem auto 0;
  max-width: 480px;
}
.percentile-track {
  position: relative;
  height: 10px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: visible;
}
.percentile-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, #ef4444 0%, #f59e0b 25%, #3b82f6 50%, #22c55e 75%, #facc15 100%);
  border-radius: 999px;
  transition: width 800ms cubic-bezier(.2,.8,.2,1);
}
.percentile-marker {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 22px;
  height: 22px;
  background: var(--text);
  border: 3px solid var(--bg);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  transition: left 800ms cubic-bezier(.2,.8,.2,1);
}
.percentile-labels {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-faint);
  margin-top: 0.5rem;
  letter-spacing: 0.05em;
}
.percentile-caption {
  text-align: center;
  font-size: 0.95rem;
  color: var(--text-dim);
  margin-top: 0.75rem;
}
.percentile-caption strong { color: var(--text); }

/* Info sections (3 stacked cards: what you measured, what it means, how to improve) */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.info-card .info-icon {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin-bottom: 0.5rem;
}
.info-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.6rem;
  color: var(--text);
  font-weight: 700;
}
.info-card p, .info-card ul {
  color: var(--text-dim);
  font-size: 0.92rem;
  line-height: 1.6;
}
.info-card ul {
  padding-left: 1.2rem;
  margin: 0;
}
.info-card li { margin-bottom: 0.3rem; }
.info-card li:last-child { margin-bottom: 0; }

/* Action row at the bottom of results */
.results-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 2rem;
  flex-wrap: wrap;
}

/* ── Composite FastX Score (homepage) — 3-column with radar on the right ── */
.composite {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  margin-bottom: 2rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.5rem;
  align-items: center;
}
.composite-radar {
  flex-shrink: 0;
  width: 240px;
}
.composite-radar svg { display: block; width: 100%; height: auto; overflow: visible; }

/* Progress bar inside the composite (X/N tests) */
.composite-progress {
  margin-top: 0.6rem;
}
.composite-progress .cp-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 0.3rem;
}
.composite-progress .cp-bar {
  height: 6px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
}
.composite-progress .cp-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  border-radius: 999px;
  transition: width 600ms cubic-bezier(.2,.8,.2,1);
}

/* Quick Start button at the bottom of the composite body */
.composite .quick-start-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 0.6rem 1.25rem;
  background: var(--accent);
  color: #000;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  transition: all var(--transition);
}
.composite .quick-start-btn:hover {
  background: #fde047;
  color: #000;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(250,204,21,0.3);
}
.composite .grade-badge {
  margin: 0;
  width: 6rem;
  min-width: 6rem;
  height: 6rem;
}
.composite-body .eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: var(--text-faint);
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}
.composite-body .title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.4rem;
}
.composite-body .sub {
  color: var(--text-dim);
  font-size: 0.9rem;
}
.composite-tests {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
}
.composite-test-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.55rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-dim);
}
.composite-test-chip .pill {
  display: inline-block;
  min-width: 1.4rem;
  text-align: center;
  font-weight: 700;
  padding: 0 0.25rem;
  border-radius: 4px;
  color: var(--bg);
}

/* Per-test card score badges on homepage */
.test-card .best-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.82rem;
}
.test-card .best-line .best-val { color: var(--text); }
.test-card .best-line .best-val.empty { color: var(--text-faint); }
.test-card .best-line .grade-pill {
  display: inline-block;
  min-width: 1.6rem;
  text-align: center;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  color: #000;  /* default — overridden by inline style for dark badges */
  font-size: 0.8rem;
}

/* Quick-strip cards — icon top-aligned for visual cleanliness */
.quick-link { align-items: flex-start; }
.quick-link .quick-icon { margin-top: 0.1rem; line-height: 1; }

/* Increased spacing below the quick-strip for breathing room */
.quick-strip { margin-bottom: 2.5rem; }
.composite { margin-top: 0; }

/* Reduce-motion mode (when settings toggle off) */
.no-animations *, .no-animations *::before, .no-animations *::after {
  transition: none !important;
  animation: none !important;
}

@media (max-width: 820px) {
  .composite { grid-template-columns: 1fr; text-align: center; gap: 1rem; }
  .composite .grade-badge { margin: 0 auto; }
  .composite-radar { margin: 0 auto; width: 180px; }
  .composite-tests { justify-content: center; }
  .composite .quick-start-btn { margin-left: auto; margin-right: auto; }
}

/* ── Sequence Memory — 3x3 grid ── */
.seq-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  max-width: 420px;
  margin: 0 auto;
  aspect-ratio: 1;
}
.seq-cell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 80ms linear, transform 80ms linear, border-color 80ms linear;
  user-select: none;
  -webkit-user-select: none;
}
.seq-cell.flash {
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.03);
}
.seq-cell.correct {
  background: var(--success);
  border-color: var(--success);
}
.seq-cell.wrong {
  background: var(--error);
  border-color: var(--error);
}
.seq-cell.locked {
  cursor: not-allowed;
  opacity: 0.85;
}

/* ── Number Memory ── */
.num-display {
  font-family: var(--font-mono);
  font-size: clamp(2rem, 9vw, 4.5rem);
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-align: center;
  padding: 2rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.num-display.hidden { color: transparent; user-select: none; -webkit-user-select: none; }
.num-input {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  text-align: center;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  width: 100%;
  max-width: 360px;
  margin: 1rem auto 0;
  display: block;
  letter-spacing: 0.1em;
}
.num-input:focus {
  outline: none;
  border-color: var(--accent);
}

/* ── Typing test ── */
.typing-passage {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  line-height: 1.8;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  min-height: 200px;
  text-align: left;
  white-space: pre-wrap;
  word-break: break-word;
  user-select: none;
  -webkit-user-select: none;
}
.typing-passage span { color: var(--text-faint); transition: color 80ms linear; }
.typing-passage span.done    { color: var(--text); }
.typing-passage span.wrong   { color: var(--error); background: rgba(239,68,68,0.15); }
.typing-passage span.current {
  color: var(--text);
  background: var(--accent);
  border-radius: 2px;
  padding: 0 1px;
  animation: caret-pulse 1s ease-in-out infinite;
}
@keyframes caret-pulse {
  0%, 100% { background: var(--accent); }
  50% { background: rgba(250,204,21,0.5); }
}

/* ── Choice Reaction — color buttons ── */
.choice-stage {
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.choice-prompt {
  font-size: 1.25rem;
  color: var(--text-dim);
  text-align: center;
  padding: 2rem;
}
.choice-prompt .big-color {
  display: block;
  width: 180px;
  height: 180px;
  border-radius: var(--radius);
  margin: 1rem auto;
}
.choice-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-top: 1.5rem;
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
}
.choice-btn {
  height: 80px;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: rgba(0,0,0,0.7);
  transition: transform 80ms linear, border-color 80ms linear;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.choice-btn:hover { border-color: var(--text); }
.choice-btn:active { transform: scale(0.97); }
.choice-btn .key {
  font-size: 0.75rem;
  opacity: 0.7;
  margin-top: 0.25rem;
}

/* ── Lab page ── */
.lab-categories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}
.lab-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  cursor: pointer;
  transition: all var(--transition);
  display: block;
  color: var(--text);
}
.lab-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  color: var(--text);
}
.lab-card .lab-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: var(--accent);
}
.lab-card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.4rem;
  font-weight: 700;
}
.lab-card p {
  color: var(--text-dim);
  font-size: 0.92rem;
  margin-bottom: 0.75rem;
}
.lab-card .lab-progress {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-faint);
  display: flex;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.lab-card .lab-progress .grade-pill {
  font-size: 0.78rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  color: var(--bg);
  font-weight: 700;
  background: #333;
}

/* Lab — chosen-goal detail panel */
.lab-detail {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  margin-top: 2rem;
}
.lab-detail h2 {
  margin-bottom: 0.5rem;
  font-size: 1.5rem;
}
.lab-detail .lab-sub { color: var(--text-dim); margin-bottom: 1.5rem; }

.lab-routine {
  display: grid;
  gap: 0.75rem;
  margin: 1rem 0 2rem;
}
.lab-step {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  align-items: center;
  text-decoration: none;
  color: var(--text);
  transition: border-color var(--transition);
}
.lab-step:hover {
  border-color: var(--accent);
  color: var(--text);
}
.lab-step .step-num {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--accent);
  width: 2.5rem;
  text-align: center;
}
.lab-step .step-body .step-title { font-weight: 700; }
.lab-step .step-body .step-detail { color: var(--text-dim); font-size: 0.88rem; margin-top: 0.2rem; }
.lab-step .step-go {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ── Article (intro page) ── */
.article-hero {
  text-align: center;
  margin-bottom: 3rem;
}
.article-hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 0.75rem;
}
.article-hero .article-sub {
  color: var(--text-dim);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}
.article {
  max-width: 720px;
  margin: 0 auto;
  color: var(--text-dim);
  line-height: 1.75;
  font-size: 1.05rem;
}
.article p { margin-bottom: 1.25rem; }
.article h2 {
  color: var(--text);
  font-size: 1.6rem;
  margin: 3rem 0 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.article h3 {
  color: var(--text);
  font-size: 1.2rem;
  margin: 2rem 0 0.75rem;
  font-weight: 700;
}
.article ul { padding-left: 1.5rem; margin-bottom: 1.5rem; }
.article li { margin-bottom: 0.5rem; }
.article blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.75rem 1.25rem;
  margin: 2rem 0;
  background: var(--surface);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text);
  font-style: italic;
}
.article .callout {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
}
.article .callout .callout-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.article a { color: var(--accent); border-bottom: 1px solid transparent; transition: border-color var(--transition); }
.article a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* Section divider in test grid (categorized homepage) */
.section-heading {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-faint);
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Quick-link strip (Lab + Learn) above the test grid */
.quick-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.quick-link {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  color: var(--text);
  transition: all var(--transition);
}
.quick-link:hover {
  border-color: var(--accent);
  color: var(--text);
  transform: translateY(-2px);
}
.quick-link .quick-icon {
  font-size: 1.75rem;
  color: var(--accent);
  flex-shrink: 0;
}
.quick-link .quick-body .quick-title {
  font-weight: 700;
  font-size: 1.05rem;
}
.quick-link .quick-body .quick-sub {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-top: 0.15rem;
}

/* ── Tools: shared form/input styles ── */
.tool-page {
  max-width: 880px;
  margin: 0 auto;
}
.tool-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}
.tool-block h3 {
  font-size: 1.05rem;
  margin-bottom: 1rem;
  color: var(--text);
  font-weight: 700;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem 1rem;
  align-items: end;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.field label {
  font-size: 0.78rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.field input[type="number"],
.field input[type="text"],
.field select {
  font-family: var(--font-mono);
  font-size: 1rem;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  width: 100%;
  appearance: none;
}
.field input[type="number"]:focus,
.field input[type="text"]:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
}
.field input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}
.field .field-readout {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-dim);
  text-align: right;
}

/* Sens converter results grid */
.sens-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.6rem;
  margin-top: 1rem;
}
.sens-row {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
}
.sens-row.source { border-color: var(--accent); }
.sens-row .game {
  font-size: 0.78rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.sens-row .game .badge {
  font-size: 0.65rem;
  background: var(--accent);
  color: var(--bg);
  padding: 0.05rem 0.4rem;
  border-radius: 3px;
  letter-spacing: 0.05em;
}
.sens-row .val {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 0.25rem;
}
.sens-row .copy-hint {
  font-size: 0.7rem;
  color: var(--text-faint);
  margin-top: 0.15rem;
}

/* DPI calc / cm-360 hero summary */
.cm360-hero {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  margin-bottom: 1.25rem;
}
.cm360-hero .label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  color: var(--text-faint);
}
.cm360-hero .big {
  font-family: var(--font-mono);
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.02em;
  margin: 0.25rem 0;
}
.cm360-hero .small {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--text-dim);
}

/* Crosshair preview */
.crosshair-stage {
  background:
    repeating-conic-gradient(#1a1a1a 0deg 90deg, #181818 90deg 180deg) 0 0 / 32px 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  height: 320px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.crosshair-stage svg {
  display: block;
}
.crosshair-code {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text);
  word-break: break-all;
  margin-top: 0.5rem;
  white-space: pre-wrap;
}
.copy-btn {
  font-size: 0.78rem;
  padding: 0.4rem 0.85rem;
  margin-top: 0.5rem;
}

/* Sparkline (score history) — vertical layout so it works in narrow column */
.history-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  height: 100%;
}
.history-block .h-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.history-block .h-label {
  font-size: 0.72rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
}
.history-block .h-count {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
}
.history-sparkline {
  width: 100%;
  height: 64px;
  display: block;
  flex: 1;
  min-height: 50px;
}
.history-sparkline .spark-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.history-sparkline .spark-area {
  fill: rgba(250,204,21,0.12);
}
.history-sparkline .spark-dot {
  fill: var(--accent);
}
.history-sparkline .spark-baseline {
  stroke: var(--border);
  stroke-width: 1;
  stroke-dasharray: 2 3;
}

/* Tools quick-link styling overrides */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

/* ── Profile chip (header) ── */
.profile-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.82rem;
  color: var(--text);
  text-decoration: none;
  transition: all var(--transition);
}
.profile-chip:hover { border-color: var(--accent); color: var(--text); }
.profile-chip.chip-empty {
  color: var(--text-dim);
  border-style: dashed;
}
.profile-chip.chip-empty:hover { color: var(--accent); border-color: var(--accent); }
.profile-chip .chip-icon {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1;
}
.profile-chip .chip-text {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Testing mode (immersive takeover for reaction + choice tests) ── */
body.testing {
  overflow: hidden;
}
body.testing .site-header,
body.testing .site-footer,
body.testing main > .test-page > h1,
body.testing main > .test-page > .subtitle,
body.testing main > .test-page > .ad-slot,
body.testing main > .test-page > .content-block {
  display: none !important;
}
body.testing main {
  max-width: none;
  padding: 0;
  margin: 0;
}
body.testing .test-page {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  padding: 0;
}
body.testing .play-mode {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
/* Windowed (no-crosshair) tests opt into filling the viewport via the `roomy`
   marker class on their .play-mode (reaction, choice, clickspeed, typing,
   sequence, number). The base `.test-page > .play-mode` rule caps width at
   800px with auto side margins, and those auto margins also defeat the
   column-flex stretch — so reset all three to span the full viewport width.
   The aim-family canvas tests (aim/horizontal/flick/tracking/placement)
   deliberately OMIT `roomy`: a bigger canvas forces more mouse travel in
   cursor-fallback aiming, which throws off the flick distance. */
body.testing .play-mode.roomy {
  max-width: none;
  margin: 0;
  width: 100%;
}
/* Aim-family tests (no `roomy`) must NOT collapse and must NOT fill the
   viewport. Without this, the base auto side-margins defeat the column-flex
   stretch and .play-mode shrinks to the stats-row width — then the
   `canvas { width:100%; height:100% }` rule below stretches the canvas into a
   thin vertical strip. Pin the play area to its normal 800px centered box so
   the canvas keeps its natural 800×500 size — identical cursor feel to the
   regular page (a viewport-filling canvas slows cursor-fallback aiming). */
body.testing .play-mode:not(.roomy) {
  width: min(800px, 100%);
  max-width: 800px;
  margin: 0;
  align-self: center;
  justify-content: center;
}
body.testing .play-mode:not(.roomy) .crosshair-overlay-container {
  flex: 0 0 auto;
}
body.testing .play-mode:not(.roomy) canvas.aim-canvas {
  width: 100%;
  max-width: 800px;
  height: auto;
}
body.testing .stats-row {
  padding: 0.75rem 1rem;
  margin-bottom: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  gap: 1.5rem;
  flex-shrink: 0;
}
body.testing .stats-row .stat .value {
  font-size: 1.1rem;
}
body.testing .stats-row .stat .label {
  font-size: 0.65rem;
}
body.testing .stage {
  flex: 1;
  min-height: 0;
  border: none;
  border-radius: 0;
  margin: 0;
}
body.testing .stage .stage-message {
  font-size: clamp(2rem, 6vw, 5rem);
  line-height: 1.05;
  padding: 0 2rem;
  font-weight: 700;
}
body.testing .stage .stage-message .big {
  font-size: clamp(4rem, 14vw, 10rem);
  margin: 1rem 0;
}
body.testing .stage .stage-message .hint {
  font-size: clamp(1rem, 2vw, 1.5rem);
  margin-top: 1rem;
  opacity: 0.85;
}
/* The choice-stage variant */
body.testing .choice-stage {
  flex: 1;
  border: none;
  border-radius: 0;
}
body.testing .choice-prompt {
  font-size: clamp(1.5rem, 4vw, 3rem);
}
body.testing .choice-prompt .big-color {
  width: clamp(240px, 30vw, 380px);
  height: clamp(240px, 30vw, 380px);
}
body.testing .choice-buttons {
  max-width: 760px;
  margin: 1rem auto;
  padding: 0 1rem 1rem;
  flex-shrink: 0;
}

/* Canvas-based arena tests (aim / horizontal / flick / tracking): the canvas
   wrapper grows to fill the viewport so the play area is genuinely fullscreen.
   The test's fitCanvas() re-measures via FastXImmersive's resize relay. */
body.testing .crosshair-overlay-container {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: none;
  margin: 0;
}
body.testing canvas.aim-canvas {
  width: 100%;
  height: 100%;
  max-width: none;
  border: none;
  border-radius: 0;
}
/* Hide pre-game chrome while playing fullscreen */
body.testing .mode-selector,
body.testing .sens-badge,
body.testing #start-btn {
  display: none !important;
}

/* Windowed tests in immersive mode. Click-speed reuses the .stage rules above;
   these center/scale the typing, sequence and number play areas to fill the
   viewport between the top stats bar and the bottom of the screen. */
body.testing .typing-passage {
  flex: 1 1 auto;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  border: none;
  border-radius: 0;
  background: transparent;
  font-size: clamp(1.4rem, 2.6vw, 2.2rem);
  line-height: 1.9;
  padding: clamp(2rem, 8vh, 5rem) clamp(1rem, 4vw, 3rem);
  overflow-y: auto;
}
body.testing .seq-grid {
  margin: auto;             /* centers the square grid in the flex column */
  width: min(72vh, 90vw, 560px);
  max-width: min(72vh, 90vw, 560px);
}
body.testing .num-display {
  margin-top: auto;         /* with the trailing div's margin-bottom:auto, */
  border: none;             /* sandwiches display+input+button centered */
  background: transparent;
  font-size: clamp(3rem, 13vw, 8rem);
}
body.testing .num-input {
  margin: 1.5rem auto 0;
  max-width: 480px;
  font-size: clamp(1.4rem, 4vw, 2.4rem);
}
body.testing .num-display ~ div {
  margin-bottom: auto;
}

/* Crosshair Placement (Three.js): the stage carries inline sizing styles, so
   the immersive overrides must use !important to fill the viewport. The
   renderer re-fits via FastXImmersive's resize relay → resizeRenderer(). */
body.testing .three-stage {
  flex: 1 !important;
  min-height: 0;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  aspect-ratio: auto !important;
  border: none !important;
  border-radius: 0 !important;
}
body.testing #scene-hint {
  flex-shrink: 0;
  padding: 0.5rem 1rem;
  margin: 0;
}

/* Exit-testing button (top-right pill) */
.exit-testing {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1001;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  font-size: 0.82rem;
  cursor: pointer;
  display: none;
  transition: all var(--transition);
}
body.testing .exit-testing { display: inline-flex; align-items: center; gap: 0.4rem; }
.exit-testing:hover { color: var(--text); border-color: var(--text-dim); background: var(--surface-2); }

/* ── Profile page ── */
.profile-form {
  display: grid;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

/* Archetype badge — bigger version for the profile page */
.archetype-card {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.25rem;
  align-items: center;
}
.archetype-card .arch-icon {
  font-size: 2.5rem;
  width: 4rem;
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--bg);
  border: 2px solid currentColor;
}
.archetype-card .arch-body .arch-eyebrow {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-faint);
  font-weight: 600;
  margin-bottom: 0.3rem;
}
.archetype-card .arch-body .arch-name {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
}
.archetype-card .arch-body .arch-desc {
  color: var(--text-dim);
  font-size: 0.95rem;
}

/* Per-category bar chart */
.category-bars {
  display: grid;
  gap: 0.85rem;
}
.cat-bar {
  display: grid;
  grid-template-columns: 110px 1fr 80px;
  gap: 1rem;
  align-items: center;
}
.cat-bar .cat-name {
  font-weight: 600;
  color: var(--text);
}
.cat-bar .cat-track {
  background: var(--surface-2);
  border-radius: 999px;
  height: 14px;
  position: relative;
  overflow: hidden;
}
.cat-bar .cat-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 999px;
  transition: width 600ms cubic-bezier(.2,.8,.2,1);
}
.cat-bar .cat-pct {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-align: right;
  color: var(--text-dim);
}
.cat-bar .cat-grade {
  display: inline-block;
  min-width: 1.6rem;
  text-align: center;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  color: var(--bg);
  font-size: 0.78rem;
  font-family: var(--font-mono);
}

/* Strengths/weaknesses row on composite hero */
.composite-strengths {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}
.composite-strengths .strength,
.composite-strengths .weakness {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.composite-strengths .label {
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ── Custom crosshair overlay (aim trainer + tracking) ── */
.crosshair-overlay {
  position: absolute;
  pointer-events: none;
  transform: translate(-50%, -50%);
  will-change: left, top;
  z-index: 5;
}
.crosshair-overlay-container {
  position: relative;
}
.crosshair-overlay-container canvas.aim-canvas {
  cursor: none;
}

/* "Your sens" badge above aim canvas */
.sens-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
}
.sens-badge .sens-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
}
.sens-badge .sens-val { color: var(--text); }
.sens-badge a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.75rem;
  margin-left: 0.5rem;
}

/* First-time hint (lightweight toast on test pages) */
.first-time-hint {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 0.85rem 1.25rem;
  font-size: 0.9rem;
  color: var(--text);
  box-shadow: var(--shadow);
  z-index: 100;
  max-width: 360px;
  animation: hint-in 250ms ease-out;
}
.first-time-hint button {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  margin-left: 0.5rem;
  border-radius: 4px;
}
@keyframes hint-in {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ── Distribution chart (population density) ── */
.dist-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem 0.85rem;
  margin-top: 1.25rem;
}
.dist-block .dist-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-faint);
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.dist-chart {
  width: 100%;
  height: auto;
  display: block;
}
.dist-caption {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-top: 0.5rem;
}
.dist-caption strong { color: var(--text); }

/* Honest "where this data comes from" footer under each distribution */
.dist-source {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 0.6rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--border);
  font-size: 0.72rem;
  color: var(--text-faint);
  line-height: 1.4;
}
.dist-chip {
  display: inline-block;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  white-space: nowrap;
  cursor: help;
}
.dist-chip-measured {
  background: rgba(34, 197, 94, 0.16);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.35);
}
.dist-chip-est {
  background: rgba(245, 158, 11, 0.14);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

/* ── Personal feedback block ── */
.feedback-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-top: 1.25rem;
}
.feedback-block .feedback-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 0.65rem;
}
.feedback-block p {
  color: var(--text-dim);
  line-height: 1.65;
  font-size: 0.95rem;
  margin: 0 0 0.6rem;
}
.feedback-block p:last-child { margin-bottom: 0; }
.feedback-block p strong { color: var(--text); font-weight: 600; }
.feedback-block p a { color: var(--accent); border-bottom: 1px solid transparent; transition: border-color var(--transition); }
.feedback-block p a:hover { border-bottom-color: var(--accent); }

/* ── Pro player cards ── */
.pros-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}
.pro-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.pro-card .pro-head {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.pro-card .pro-name {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text);
}
.pro-card .pro-meta {
  font-size: 0.8rem;
  color: var(--text-faint);
  font-family: var(--font-mono);
}
.pro-card .pro-crosshair {
  background:
    repeating-conic-gradient(#1a1a1a 0deg 90deg, #181818 90deg 180deg) 0 0 / 16px 16px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.pro-card .pro-crosshair-empty {
  color: var(--text-faint);
  font-family: var(--font-mono);
  background: var(--bg);
  font-size: 0.8rem;
}
.pro-card .pro-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  padding: 0.6rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.pro-card .pro-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}
.pro-card .pro-stat .ps-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
}
.pro-card .pro-stat .ps-val {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}
.pro-card .pro-gear,
.pro-card .pro-note {
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.5;
}
.pro-card .pro-gear { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-faint); }
.pro-card .pro-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: auto;
}
.pro-card .pro-actions a {
  flex: 1;
  text-align: center;
  padding: 0.55rem 0.75rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  text-decoration: none;
  color: var(--text);
  transition: all var(--transition);
}
.pro-card .pro-actions a.primary {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
  font-weight: 600;
}
.pro-card .pro-actions a:hover { border-color: var(--accent); }
.pro-card .pro-actions a.primary:hover { background: #fde047; }
.pro-card .pro-actions a.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Daily challenge banner (homepage) ── */
.daily-banner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem;
  align-items: center;
  background: linear-gradient(135deg, #1f1d12 0%, var(--surface) 100%);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  text-decoration: none;
  color: var(--text);
  transition: border-color var(--transition);
}
.daily-banner:hover { border-color: var(--accent); color: var(--text); }
.daily-banner.done { border-left-color: var(--success); }
.daily-banner .daily-eyebrow {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  font-weight: 700;
}
.daily-banner.done .daily-eyebrow { color: var(--success); }
.daily-banner .daily-test {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0.2rem 0;
}
.daily-banner .daily-sub {
  font-size: 0.88rem;
  color: var(--text-dim);
}
.daily-banner .daily-right {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}
.daily-banner .daily-streak {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text);
}
.daily-banner .streak-icon { font-size: 1.5rem; }
.daily-banner .daily-streak-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
}
.daily-banner .daily-cta {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.65rem 1.5rem;
  background: var(--accent);
  color: #000;
  font-weight: 700;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  border: none;
  transition: all var(--transition);
}
.daily-banner:hover .daily-cta { background: #fde047; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(250,204,21,0.3); }
.daily-banner.done .daily-cta { background: var(--success); color: #fff; }

/* ── Baseline CTA (homepage) ── */
.baseline-cta {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.25rem;
  align-items: center;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  text-decoration: none;
  color: var(--text);
  transition: transform var(--transition);
}
.baseline-cta:hover {
  transform: translateY(-2px);
  color: var(--text);
}
.baseline-cta.resume { border-color: var(--info); }
.baseline-cta .bl-cta-icon {
  font-size: 2rem;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--accent);
  color: #000;
  font-weight: 800;
}
.baseline-cta.resume .bl-cta-icon { background: var(--info); color: #fff; }
.baseline-cta .bl-cta-title {
  font-size: 1.15rem;
  font-weight: 700;
}
.baseline-cta .bl-cta-sub {
  font-size: 0.88rem;
  color: var(--text-dim);
  margin-top: 0.2rem;
}
.baseline-cta .bl-cta-go {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
}
.baseline-cta.resume .bl-cta-go { color: var(--info); }

/* ── Baseline banner (top of test pages when active) ── */
.baseline-banner {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 1rem;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--info);
  border-radius: var(--radius);
  padding: 0.85rem 1.25rem;
  margin-bottom: 1.5rem;
}
.baseline-banner .bl-eyebrow {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--info);
  font-weight: 700;
}
.baseline-banner .bl-headline {
  font-size: 0.95rem;
  color: var(--text);
  margin-top: 0.15rem;
}
.baseline-banner .bl-cta {
  padding: 0.5rem 1rem;
  background: var(--info);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  text-decoration: none;
  font-weight: 600;
}
.baseline-banner .bl-close {
  background: transparent;
  border: none;
  color: var(--text-faint);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
}
.baseline-banner .bl-close:hover { color: var(--text); background: transparent; }

/* ── XP / level chip + bar ── */
.profile-chip .chip-level {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  background: var(--accent);
  color: #000;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  font-weight: 700;
  margin-left: 0.35rem;
}
.xp-block {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.25rem;
  align-items: center;
}
.xp-block .xp-level {
  font-family: var(--font-mono);
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  text-align: center;
  min-width: 4rem;
}
.xp-block .xp-level-sub {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-faint);
  text-align: center;
  margin-top: 0.2rem;
}
.xp-block .xp-body { display: flex; flex-direction: column; gap: 0.4rem; }
.xp-block .xp-row { display: flex; justify-content: space-between; font-size: 0.85rem; color: var(--text-dim); }
.xp-block .xp-row strong { color: var(--text); }
.xp-bar {
  position: relative;
  height: 10px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
}
.xp-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  border-radius: 999px;
  transition: width 600ms cubic-bezier(.2,.8,.2,1);
}

/* ── Achievements gallery ── */
.ach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.75rem;
}
.ach-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  text-align: center;
  transition: all var(--transition);
}
.ach-card.locked { opacity: 0.35; filter: grayscale(0.8); }
.ach-card.unlocked { border-color: var(--accent); }
.ach-card .ach-icon {
  font-size: 1.5rem;
  margin-bottom: 0.3rem;
}
.ach-card .ach-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
}
.ach-card .ach-desc {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 0.2rem;
  line-height: 1.3;
}
.ach-summary {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 1rem;
}

/* Achievement toast — pops in bottom-right when unlocked */
.ach-toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 2000;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  max-width: 360px;
  animation: ach-toast-in 350ms cubic-bezier(.2,.8,.2,1);
}
.ach-toast.leaving { animation: ach-toast-out 250ms forwards; }
@keyframes ach-toast-in {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes ach-toast-out {
  to { opacity: 0; transform: translateY(20px); }
}
.ach-toast .toast-icon { font-size: 2rem; }
.ach-toast .toast-eyebrow {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  font-weight: 700;
}
.ach-toast .toast-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 0.15rem;
}
.ach-toast .toast-desc {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 0.1rem;
}

/* ── Activity heatmap ── */
.heatmap-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}
.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(30, 1fr);
  gap: 3px;
  margin-top: 0.75rem;
}
.heatmap-cell {
  aspect-ratio: 1;
  border-radius: 2px;
  background: var(--surface-2);
}
.heatmap-cell[data-level="1"] { background: rgba(250,204,21,0.25); }
.heatmap-cell[data-level="2"] { background: rgba(250,204,21,0.50); }
.heatmap-cell[data-level="3"] { background: rgba(250,204,21,0.75); }
.heatmap-cell[data-level="4"] { background: var(--accent); }
.heatmap-cell.today { outline: 2px solid var(--text); outline-offset: 1px; }
.heatmap-legend {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
  margin-top: 0.6rem;
  justify-content: flex-end;
}
.heatmap-legend .leg-cell {
  width: 10px; height: 10px;
  border-radius: 2px;
  background: var(--surface-2);
}

/* ── Goals ── */
.goal-row {
  display: grid;
  grid-template-columns: 120px 1fr auto auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}
.goal-row:last-child { border-bottom: none; }
.goal-row .goal-name { font-weight: 600; color: var(--text); font-size: 0.92rem; }
.goal-row .goal-bar {
  position: relative;
  height: 8px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
}
.goal-row .goal-fill {
  position: absolute; inset: 0 auto 0 0;
  background: var(--accent);
  border-radius: 999px;
  transition: width 500ms ease-out;
}
.goal-row .goal-fill.done { background: var(--success); }
.goal-row .goal-val {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text);
  text-align: right;
}
.goal-row input.goal-target {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.5rem;
  width: 90px;
  text-align: right;
}

/* ── Share / download button on results ── */
.share-card-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
}
.share-card-btn:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--text-dim);
}

/* ── Settings page ── */
.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  gap: 1rem;
}
.settings-row:last-child { border-bottom: none; }
.settings-row .setting-label {
  font-weight: 600;
  color: var(--text);
}
.settings-row .setting-desc {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 0.2rem;
}
.settings-row .setting-body { flex: 1; min-width: 0; }

/* Toggle switch */
.toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  background: var(--surface-2);
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--transition);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.toggle::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  background: var(--text-dim);
  border-radius: 50%;
  transition: all var(--transition);
}
.toggle[aria-checked="true"] {
  background: var(--accent);
  border-color: var(--accent);
}
.toggle[aria-checked="true"]::after {
  left: 22px;
  background: #000;
}

/* Settings nav icon (header gear) */
.settings-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  color: var(--text-dim);
  font-size: 1.1rem;
  text-decoration: none;
  transition: all var(--transition);
}
.settings-icon:hover { color: var(--accent); background: var(--surface-2); }

/* Theme accent picker swatches */
.theme-swatches {
  display: flex;
  gap: 0.5rem;
}
.theme-swatch {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border);
  cursor: pointer;
  background: var(--swatch-color, #facc15);
}
.theme-swatch.active { border-color: var(--text); transform: scale(1.1); }

/* Responsive */
@media (max-width: 640px) {
  .site-header { padding: 0.75rem 1rem; }
  .nav-links { gap: 0.85rem; font-size: 0.8rem; }
  main { padding: 2rem 1rem; }
  .stats-row { gap: 1.25rem; }
  .choice-buttons { grid-template-columns: repeat(2, 1fr); }
  .archetype-card { grid-template-columns: 1fr; text-align: center; }
  .archetype-card .arch-icon { margin: 0 auto; }
  .cat-bar { grid-template-columns: 90px 1fr 60px; gap: 0.5rem; }
  .profile-chip .chip-text { max-width: 70px; }
  .dist-block { padding: 1rem 1rem 0.75rem; }
  .feedback-block { padding: 1rem 1.25rem; }
  .daily-banner, .baseline-cta { grid-template-columns: 1fr; text-align: center; gap: 0.75rem; }
  .daily-banner .daily-right { flex-direction: row; justify-content: center; gap: 0.6rem; }
  .baseline-cta .bl-cta-icon { margin: 0 auto; }
  .baseline-banner { grid-template-columns: 1fr; text-align: center; gap: 0.5rem; }
  .pro-card .pro-actions { flex-direction: column; }
  .xp-block { grid-template-columns: 1fr; text-align: center; }
  .goal-row { grid-template-columns: 1fr; text-align: center; gap: 0.4rem; }
  .ach-toast { left: 1rem; right: 1rem; max-width: none; }
  .heatmap-grid { grid-template-columns: repeat(15, 1fr); }
}

/* ─── FastX Toasts (fastx-toast-container) ─────────────────────────── */
.toast-container {
  position: fixed;
  top: 5rem;
  right: 1rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  pointer-events: none;
  max-width: 360px;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: linear-gradient(135deg, #1a1a1a, #0f0f0f);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  transform: translateX(140%);
  opacity: 0;
  transition: transform 280ms cubic-bezier(0.2, 0.9, 0.3, 1.15), opacity 220ms ease-out;
  cursor: pointer;
  min-width: 240px;
}
.toast.toast-in  { transform: translateX(0); opacity: 1; }
.toast.toast-out { transform: translateX(140%); opacity: 0; }
.toast-icon {
  font-size: 1.4rem;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(250, 204, 21, 0.15);
  color: var(--accent);
  flex-shrink: 0;
}
.toast-body { flex: 1; min-width: 0; }
.toast-title {
  color: var(--text);
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.2;
}
.toast-subtitle {
  color: var(--text-dim);
  font-size: 0.78rem;
  margin-top: 0.15rem;
  line-height: 1.3;
}
/* Per-kind accent colors */
.toast.toast-pb         { border-left-color: #facc15; }
.toast.toast-pb         .toast-icon { background: rgba(250, 204, 21, 0.18); color: #facc15; }
.toast.toast-level      { border-left-color: #a3e635; }
.toast.toast-level      .toast-icon { background: rgba(163, 230, 53, 0.18); color: #a3e635; }
.toast.toast-achievement{ border-left-color: #14e0c8; }
.toast.toast-achievement .toast-icon { background: rgba(20, 224, 200, 0.18); color: #14e0c8; }

@media (max-width: 640px) {
  .toast-container { left: 1rem; right: 1rem; max-width: none; top: 4rem; }
}

/* ─── Hero-score ticker + PB pulse ─────────────────────────────────── */
@keyframes fastx-pb-pulse {
  0%   { text-shadow: 0 0 0 rgba(250, 204, 21, 0); }
  40%  { text-shadow: 0 0 28px rgba(250, 204, 21, 0.75); }
  100% { text-shadow: 0 0 0 rgba(250, 204, 21, 0); }
}
.hero-score.is-pb { animation: fastx-pb-pulse 1500ms ease-out; }
.hero-score.is-ticking { will-change: contents; }

/* "NEW PB" inline badge in the hero-sub area */
.pb-badge {
  display: inline-block;
  background: linear-gradient(135deg, #facc15, #f59e0b);
  color: #0a0a0a;
  font-weight: 800;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  margin-left: 0.4rem;
  vertical-align: middle;
  animation: fastx-pb-pulse 1500ms ease-out;
}

/* ─── Continue-training hero card on homepage ──────────────────────── */
.continue-cta {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.08), rgba(20, 224, 200, 0.04));
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
  text-decoration: none;
  color: var(--text);
  transition: transform 180ms ease-out, border-color 180ms;
  margin-bottom: 1rem;
}
.continue-cta:hover { transform: translateY(-2px); border-color: var(--accent); }
.continue-cta .cta-icon {
  font-size: 1.8rem;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(250, 204, 21, 0.15);
  color: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
}
.continue-cta .cta-body { flex: 1; min-width: 0; }
.continue-cta .cta-eyebrow {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.continue-cta .cta-title { font-size: 1.15rem; font-weight: 700; margin-top: 0.15rem; }
.continue-cta .cta-sub { color: var(--text-dim); font-size: 0.85rem; margin-top: 0.15rem; }
.continue-cta .cta-go {
  color: var(--accent);
  font-weight: 700;
  white-space: nowrap;
  font-size: 0.95rem;
}

/* ─── Aim-family quick-switch pill nav ─────────────────────────────── */
.aim-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  margin: 0 auto 1rem;
  max-width: 720px;
}
.aim-switcher a {
  text-decoration: none;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  transition: color 140ms, border-color 140ms, background 140ms;
}
.aim-switcher a:hover { color: var(--text); border-color: var(--accent); }
.aim-switcher a.current {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(250, 204, 21, 0.06);
}
