/* ============================================================
   SIXTY — production stylesheet
   Neo-brutalist design system: chunky borders, hard shadows,
   loud accents. Six color themes via [data-theme] on <html>.
   ============================================================ */

/* ---------- Themes ---------- */
:root,
[data-theme="paper"] {
  --canvas: #D8E2DA; --ink: #12100E; --slab: #FBFAF7;
  --border: #12100E; --shadow: #12100E;
  --grid: rgba(0, 0, 0, .06); --accent: #FFC42E;
}
[data-theme="sand"] {
  --canvas: #E7DCC5; --ink: #2A2113; --slab: #FCF9F1;
  --border: #2A2113; --shadow: #2A2113;
  --grid: rgba(0, 0, 0, .06); --accent: #FF5A46;
}
[data-theme="mint"] {
  --canvas: #CDEBDC; --ink: #0F241B; --slab: #F5FBF7;
  --border: #0F241B; --shadow: #0F241B;
  --grid: rgba(0, 0, 0, .055); --accent: #2B54FF;
}
[data-theme="dusk"] {
  --canvas: #C9D2E8; --ink: #151B2E; --slab: #F6F8FD;
  --border: #151B2E; --shadow: #151B2E;
  --grid: rgba(0, 0, 0, .05); --accent: #F361B0;
}
[data-theme="coral"] {
  --canvas: #F3D9CE; --ink: #2E1712; --slab: #FDF6F3;
  --border: #2E1712; --shadow: #2E1712;
  --grid: rgba(0, 0, 0, .05); --accent: #C4F03C;
}
[data-theme="carbon"] {
  --canvas: #171613; --ink: #F3EFE4; --slab: #262420;
  --border: #F3EFE4; --shadow: rgba(0, 0, 0, .5);
  --grid: rgba(255, 255, 255, .06); --accent: #FFC42E;
}

/* While a test is running, the page floods with that test's accent
   color. --bg/--fg are set here; #bg and screen text read them. */
body            { --bg: var(--canvas); --fg: var(--ink); --gridline: var(--grid); }
body[data-test="type"]   { --bg: #FFC42E; --fg: #12100E; --gridline: rgba(0,0,0,.06); }
body[data-test="react"]  { --bg: #FF5A46; --fg: #12100E; --gridline: rgba(0,0,0,.06); }
body[data-test="math"]   { --bg: #C4F03C; --fg: #12100E; --gridline: rgba(0,0,0,.06); }
body[data-test="recall"] { --bg: #2B54FF; --fg: #FBFAF7; --gridline: rgba(255,255,255,.11); }
body[data-test="aim"]    { --bg: #F361B0; --fg: #12100E; --gridline: rgba(0,0,0,.06); }
body[data-test="flick"]  { --bg: #22D3C5; --fg: #12100E; --gridline: rgba(0,0,0,.06); }
body[data-test="chimp"]  { --bg: #A78BFA; --fg: #12100E; --gridline: rgba(0,0,0,.06); }
body[data-test="stroop"] { --bg: #FF9838; --fg: #12100E; --gridline: rgba(0,0,0,.06); }

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Space Grotesk', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: #2B54FF; }
a:hover { color: var(--ink); }
button { font-family: inherit; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

.mono   { font-family: 'JetBrains Mono', ui-monospace, monospace; }
.display{ font-family: 'Archivo Black', Impact, sans-serif; }

/* Fixed backdrop. The flood colour comes from --bg; the pattern/animation is
   chosen per test via [data-scene] (see applyLook() in app.js). All motion is
   slow + low-contrast and is killed by prefers-reduced-motion (global rule
   above), leaving a clean static gradient. */
#bg {
  position: fixed; inset: 0; z-index: 0; overflow: hidden;
  background-color: var(--bg);
  transition: background-color .35s ease;
}
#bg::before, #bg::after { content: ''; position: absolute; pointer-events: none; }

/* grid — the original look, now just one scene (default on hub) */
#bg[data-scene="grid"] {
  background-image:
    linear-gradient(var(--gridline) 1px, transparent 1px),
    linear-gradient(90deg, var(--gridline) 1px, transparent 1px);
  background-size: 28px 28px;
}

/* aurora — two soft blobs drifting behind the flood */
#bg[data-scene="aurora"]::before,
#bg[data-scene="aurora"]::after {
  border-radius: 50%; filter: blur(64px); opacity: .55;
}
#bg[data-scene="aurora"]::before {
  width: 62vmax; height: 62vmax; left: -12vmax; top: -16vmax;
  background: radial-gradient(circle, color-mix(in srgb, var(--fg) 20%, transparent), transparent 70%);
  animation: driftA 28s ease-in-out infinite;
}
#bg[data-scene="aurora"]::after {
  width: 56vmax; height: 56vmax; right: -14vmax; bottom: -16vmax;
  background: radial-gradient(circle, color-mix(in srgb, var(--fg) 13%, transparent), transparent 70%);
  animation: driftB 34s ease-in-out infinite;
}

/* waves — fine diagonal weave that pans forever */
#bg[data-scene="waves"] {
  background-image: repeating-linear-gradient(45deg,
    color-mix(in srgb, var(--fg) 8%, transparent) 0 2px, transparent 2px 24px);
  background-size: 34px 34px;
  animation: bgPan 7s linear infinite;
}

/* orbs — a few soft dots slowly floating */
#bg[data-scene="orbs"] {
  background-image:
    radial-gradient(circle at 20% 30%, color-mix(in srgb, var(--fg) 15%, transparent) 0 8px, transparent 9px),
    radial-gradient(circle at 72% 62%, color-mix(in srgb, var(--fg) 11%, transparent) 0 13px, transparent 14px),
    radial-gradient(circle at 46% 84%, color-mix(in srgb, var(--fg) 13%, transparent) 0 6px, transparent 7px);
  background-size: 240px 240px, 320px 320px, 200px 200px;
  animation: orbFloat 32s ease-in-out infinite alternate;
}

/* mesh — a blurred gradient mesh that turns slowly */
#bg[data-scene="mesh"]::before {
  inset: -30%;
  background:
    radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--fg) 13%, transparent), transparent 45%),
    radial-gradient(circle at 75% 66%, color-mix(in srgb, var(--fg) 11%, transparent), transparent 45%);
  filter: blur(34px);
  animation: meshRot 44s linear infinite;
}

/* rain — a soft diagonal drizzle drifting down */
#bg[data-scene="rain"] {
  background-image: repeating-linear-gradient(80deg,
    color-mix(in srgb, var(--fg) 9%, transparent) 0 2px, transparent 2px 18px);
  background-size: 90px 90px;
  animation: bgPanY 3s linear infinite;
}

/* none — flat flood, no pattern */

@keyframes bgPan   { to { background-position: 34px 34px; } }
@keyframes bgPanY  { to { background-position: 0 90px; } }
@keyframes orbFloat{ to { background-position: 40px -30px, -50px 40px, 30px 30px; } }
@keyframes meshRot { to { transform: rotate(360deg); } }
#app { position: relative; z-index: 1; min-height: 100vh; }
#screen { color: var(--fg); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.hidden-input {
  position: absolute; opacity: 0; left: -1px; top: 0;
  width: 1px; height: 1px; border: 0; padding: 0;
}

/* ---------- Animations ---------- */
@keyframes slam    { 0%{transform:translateY(28px) rotate(-3deg) scale(.94);opacity:0} 70%{transform:translateY(-6px) rotate(1.2deg) scale(1.02);opacity:1} 100%{transform:translateY(0) rotate(0) scale(1)} }
@keyframes shake   { 0%,100%{transform:translateX(0)} 20%{transform:translateX(-8px)} 40%{transform:translateX(8px)} 60%{transform:translateX(-5px)} 80%{transform:translateX(5px)} }
@keyframes pop     { 0%{transform:scale(.55);opacity:0} 70%{transform:scale(1.09)} 100%{transform:scale(1);opacity:1} }
@keyframes popBig  { 0%{transform:scale(.88)} 60%{transform:scale(1.05)} 100%{transform:scale(1)} }
@keyframes breathe { 0%,100%{transform:scale(1)} 50%{transform:scale(1.025)} }
@keyframes charPop { 0%{transform:scale(1.4)} 100%{transform:scale(1)} }
@keyframes blink   { 0%,100%{border-left-color:#12100E} 50%{border-left-color:transparent} }
@keyframes flash   { 0%{background:#C4F03C;transform:scale(1.05)} 100%{background:#FBFAF7;transform:scale(1)} }
@keyframes ripple  { 0%{transform:translate(-50%,-50%) scale(.35);opacity:.55} 100%{transform:translate(-50%,-50%) scale(2.6);opacity:0} }
@keyframes fadeUp  { 0%{transform:translateY(16px);opacity:0} 100%{transform:translateY(0);opacity:1} }
@keyframes modalIn { 0%{transform:translateY(20px) scale(.96);opacity:0} 100%{transform:translateY(0) scale(1);opacity:1} }
@keyframes driftA  { 0%,100%{transform:translate(0,0) rotate(0)} 50%{transform:translate(26px,-34px) rotate(10deg)} }
@keyframes driftB  { 0%,100%{transform:translate(0,0) rotate(0)} 50%{transform:translate(-30px,28px) rotate(-12deg)} }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- 3·2·1·GO countdown pre-roll ---------- */
.countdown { position: fixed; inset: 0; z-index: 25; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.cd-num {
  font-family: 'Archivo Black', Impact, sans-serif; color: var(--ink);
  font-size: clamp(96px, 26vw, 220px); line-height: 1; letter-spacing: -.02em;
  animation: cdPop .5s cubic-bezier(.2, .9, .3, 1.15) both;
}
.cd-num.go { color: var(--accent); }
@keyframes cdPop { 0% { transform: scale(.55); opacity: 0; } 32% { transform: scale(1.06); opacity: 1; } 100% { transform: scale(1); opacity: .96; } }

/* ---------- Shared components ---------- */
.chip {
  font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink); background: var(--slab);
  border: 3px solid var(--border); border-radius: 6px;
  padding: 7px 12px; box-shadow: 4px 4px 0 var(--shadow);
  cursor: pointer; transition: transform .08s ease, box-shadow .08s ease;
  max-width: 42vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chip:hover  { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--shadow); }
.chip:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--shadow); }

.chip-static {
  font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink); background: var(--slab);
  border: 3px solid var(--border); border-radius: 6px;
  padding: 7px 11px; box-shadow: 4px 4px 0 var(--shadow);
}

.btn-ghost {
  flex: 1; font-family: 'Archivo Black', Impact, sans-serif; font-size: 15px;
  text-transform: uppercase; letter-spacing: .02em;
  background: var(--slab); color: var(--ink);
  border: 3px solid var(--border); border-radius: 6px;
  box-shadow: 4px 4px 0 var(--shadow); padding: 13px; cursor: pointer;
  transition: transform .08s ease, box-shadow .08s ease;
}
.btn-ghost:hover  { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--shadow); }
.btn-ghost:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--shadow); }

.btn-accent {
  width: 100%; font-family: 'Archivo Black', Impact, sans-serif; font-size: 17px;
  text-transform: uppercase; letter-spacing: .02em;
  background: var(--accent); color: #12100E;
  border: 3px solid var(--border); border-radius: 6px;
  box-shadow: 5px 5px 0 var(--shadow); padding: 14px; cursor: pointer;
  transition: transform .08s ease, box-shadow .08s ease;
}
.btn-accent:hover  { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--shadow); }
.btn-accent:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--shadow); }

.big-input {
  font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 40px;
  text-align: center; width: min(72vw, 300px); padding: 12px 14px;
  background: #FBFAF7; color: #12100E;
  border: 3px solid #12100E; border-radius: 6px;
  box-shadow: 6px 6px 0 #12100E; outline: none;
}
.big-input.shake { animation: shake .42s; }
.big-input.flash { animation: flash .34s ease-out; }

/* ---------- Hub ---------- */
.hub-wrap { position: relative; z-index: 1; max-width: 1120px; margin: 0 auto; padding: 26px 20px 40px; }
.hub-shapes { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
/* wrapper carries JS parallax/repulsion; inner shape carries CSS drift */
.hub-shape-w { position: absolute; will-change: transform; }
.hub-shape {
  border: 3px solid var(--border);
  box-shadow: 5px 5px 0 var(--shadow); opacity: .5;
}
.hub-header { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 32px; position: relative; z-index: 1; }
.hub-logo { font-family: 'Archivo Black', Impact, sans-serif; font-size: 30px; letter-spacing: -.02em; color: var(--ink); }
.hub-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.hub-title {
  position: relative; z-index: 1;
  font-family: 'Archivo Black', Impact, sans-serif; text-transform: uppercase;
  color: var(--ink); font-size: clamp(38px, 7vw, 74px);
  line-height: .92; letter-spacing: -.02em; margin: 0 0 12px;
  max-width: 14ch; text-wrap: balance;
}
.hub-sub { position: relative; z-index: 1; font-size: 17px; color: var(--ink); opacity: .75; margin: 0 0 32px; max-width: 48ch; }

.card-grid { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }
.test-card {
  display: flex; flex-direction: column; text-align: left; min-height: 172px;
  cursor: pointer; border: 3px solid #12100E; border-radius: 6px;
  box-shadow: 7px 7px 0 #12100E; padding: 20px; outline-color: var(--ink);
  transition: transform .08s ease, box-shadow .08s ease;
  font-family: 'Space Grotesk', sans-serif;
  animation: fadeUp .4s ease both;
}
.test-card:hover  { transform: translate(-3px, -3px); box-shadow: 11px 11px 0 #12100E; }
.test-card:active { transform: translate(5px, 5px); box-shadow: 1px 1px 0 #12100E; }
.test-card .tc-top { display: flex; justify-content: space-between; align-items: center; font-family: 'JetBrains Mono', monospace; font-size: 13px; font-weight: 700; letter-spacing: .1em; }
.test-card .tc-name { font-family: 'Archivo Black', Impact, sans-serif; font-size: 36px; line-height: .9; letter-spacing: -.01em; margin-top: 14px; }
.test-card .tc-blurb { font-size: 15px; opacity: .85; margin-top: 6px; }
.test-card .tc-foot { margin-top: auto; padding-top: 20px; display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 26px; font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.test-card .tc-top-right { display: flex; align-items: center; gap: 8px; }
/* subtle, config-toggled NEW tag (adapts to each card's ink colour) */
.tc-new { font-size: 9px; font-weight: 800; letter-spacing: .1em; border: 1.5px solid currentColor; border-radius: 4px; padding: 1px 5px; opacity: .92; }
.test-card .tc-pb { opacity: .78; }
.test-card .tc-mode { opacity: .5; }
/* PB percentile badge — small pill, adapts to the card's ink colour */
.test-card .tc-pct { font-size: 11px; letter-spacing: .03em; border: 1.5px solid currentColor; border-radius: 20px; padding: 2px 8px; opacity: .85; white-space: nowrap; }

/* gentle rotating suggestion row */
.hub-nudge {
  position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 14px;
  width: 100%; margin: 20px 0 0; padding: 13px 18px 13px 20px; min-height: 48px; text-align: left;
  background: var(--slab); color: var(--ink); border: 3px solid var(--border); border-radius: 6px;
  box-shadow: 5px 5px 0 var(--shadow); font-family: 'JetBrains Mono', monospace; font-size: 14px; font-weight: 700; letter-spacing: .01em;
}
.hub-nudge::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 5px; border-radius: 3px; background: var(--accent); }
.hub-nudge.clickable { cursor: pointer; transition: transform .08s ease, box-shadow .08s ease; }
.hub-nudge.clickable:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--shadow); }
.hub-nudge .nudge-text { flex: 1; }
.hub-nudge .nudge-go { flex: none; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; opacity: .6; }

/* footer mute toggle (styled like the footer links) */
.footer-link-btn { background: none; border: 0; padding: 0; cursor: pointer; color: inherit; font: inherit; text-decoration: underline; }

.card-soon {
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  gap: 8px; min-height: 172px; border: 3px dashed var(--border); border-radius: 6px;
  padding: 20px; color: var(--ink); opacity: .55; text-align: center;
}
.card-soon .cs-big { font-family: 'Archivo Black', Impact, sans-serif; font-size: 24px; line-height: .95; }
.card-soon .cs-small { font-family: 'JetBrains Mono', monospace; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }

.hub-note { position: relative; z-index: 1; margin-top: 24px; font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: .04em; color: var(--ink); opacity: .55; max-width: 60ch; }

.site-footer {
  position: relative; z-index: 1; margin-top: 36px; padding-top: 20px;
  border-top: 3px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  font-family: 'JetBrains Mono', monospace; font-size: 12px; letter-spacing: .04em;
  color: var(--ink);
}
.site-footer nav { display: flex; gap: 16px; flex-wrap: wrap; }
.site-footer a { color: var(--ink); opacity: .7; text-decoration: none; font-weight: 700; text-transform: uppercase; }
.site-footer a:hover { opacity: 1; text-decoration: underline; }

/* ---------- Ads ---------- */
.ad-box { position: relative; z-index: 1; margin-top: 26px; min-height: 96px; border: 3px dashed var(--border); border-radius: 6px; display: flex; align-items: center; justify-content: center; font-family: 'JetBrains Mono', monospace; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink); opacity: .5; overflow: hidden; }
.ad-box.ad-live { border-style: solid; opacity: 1; display: block; }
.ad-box .adsbygoogle { display: block; width: 100%; }

/* ---------- Test chrome (top bar) ---------- */
.test-top { max-width: 820px; margin: 0 auto; padding: 22px 20px 4px; color: var(--fg); }
.test-topline { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-family: 'JetBrains Mono', monospace; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 16px; }
.test-logo {
  font-family: 'Archivo Black', Impact, sans-serif; font-size: 19px; letter-spacing: -.02em;
  background: transparent; color: inherit; border: 0; cursor: pointer; padding: 4px 6px 4px 0;
  transition: transform .08s ease;
}
.test-logo:hover { transform: rotate(-2deg) scale(1.06); }
.topline-btns { display: flex; gap: 4px; }
.btn-quit { font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; background: transparent; color: inherit; border: 0; cursor: pointer; padding: 6px; opacity: .85; }
.btn-quit:hover { opacity: 1; text-decoration: underline; }
.cfg-row { display: flex; flex-wrap: wrap; gap: 16px 22px; justify-content: center; }
.cfg-group { display: flex; align-items: center; gap: 8px; }
.cfg-label { font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .6; }
.cfg-chips { display: flex; gap: 5px; }
.cfg-chip {
  font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase; border-radius: 5px;
  padding: 6px 10px; cursor: pointer; border: 2px solid var(--fg);
  background: transparent; color: var(--fg); transition: transform .06s ease;
}
.cfg-chip:active { transform: scale(.95); }
.cfg-chip.on { background: var(--fg); color: var(--bg); }

/* Per-test look picker (background scene chips reuse .cfg-chip; colours are
   swatches). Sits in the config row, so it inherits the zen fade while playing. */
.cfg-look { flex-wrap: wrap; }
.look-swatches { display: flex; gap: 5px; flex-wrap: wrap; }
.look-swatch {
  width: 22px; height: 22px; border-radius: 5px; padding: 0; cursor: pointer;
  border: 2px solid var(--fg); transition: transform .06s ease;
}
.look-swatch:hover  { transform: translateY(-2px); }
.look-swatch:active { transform: scale(.9); }
.look-swatch.on { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--fg); }
/* the "theme" swatch is a live preview of the current canvas colour */
.look-swatch-theme { background: var(--canvas); }

/* ---------- Stages ---------- */
.stage { color: var(--fg); }
.stage-center { max-width: 640px; margin: 0 auto; padding: 24px 20px 30px; display: flex; flex-direction: column; align-items: center; gap: 26px; }
.stage-hint { font-size: 15px; opacity: .85; }

/* React */
.react-pad {
  width: min(88vw, 520px); height: min(44vh, 260px);
  display: grid; place-items: center; cursor: pointer;
  background: #26221E; color: #FBFAF7;
  border: 3px solid #12100E; border-radius: 6px; box-shadow: 7px 7px 0 #12100E;
  font-family: 'Archivo Black', Impact, sans-serif;
  font-size: clamp(40px, 9vw, 68px); letter-spacing: -.01em;
  user-select: none; -webkit-user-select: none;
  animation: breathe 1.7s ease-in-out infinite;
}
.react-pad.now     { background: #38D66B; color: #12100E; animation: popBig .22s ease-out; }
.react-pad.tooSoon { background: #12100E; color: #FF5A46; animation: shake .42s; }
.react-pad.decoy   { background: #2B54FF; color: #FBFAF7; animation: popBig .18s ease-out; }
.react-pad.no      { background: #FF5A46; color: #12100E; animation: popBig .18s ease-out; }
.react-dots { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.react-dot { width: 14px; height: 14px; border-radius: 50%; border: 3px solid var(--fg); background: transparent; transition: background .2s ease; }
.react-dot.done { background: var(--fg); }

/* Math + Recall */
.math-problem { font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: clamp(44px, 10vw, 78px); letter-spacing: -.02em; animation: pop .24s cubic-bezier(.2,.9,.3,1.2) both; }
.math-stats { display: flex; gap: 26px; font-family: 'JetBrains Mono', monospace; font-size: 14px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; opacity: .85; }
.recall-number { font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: clamp(52px, 13vw, 104px); letter-spacing: .06em; }
.recall-number .rdigit { display: inline-block; animation: pop .3s cubic-bezier(.2,.9,.3,1.2) both; }

/* Chimp */
.chimp-tile {
  position: absolute; width: clamp(46px, 8vw, 62px); height: clamp(46px, 8vw, 62px);
  display: grid; place-items: center; cursor: pointer;
  font-family: 'Archivo Black', Impact, sans-serif; font-size: clamp(18px, 3vw, 26px);
  background: #FBFAF7; color: #12100E;
  border: 4px solid #12100E; border-radius: 6px; box-shadow: 4px 4px 0 #12100E;
  animation: pop .2s ease-out both;
  transition: transform .06s ease;
}
.chimp-tile:active { transform: scale(.92); }
.chimp-tile.masked { background: #12100E; color: transparent; }
.chimp-tile.wrong { background: #FF5A46; color: #12100E; animation: shake .4s; }

/* Stroop */
.stroop-panel {
  background: #FBFAF7; border: 3px solid #12100E; border-radius: 6px;
  box-shadow: 7px 7px 0 #12100E; padding: 34px 44px;
  min-width: min(80vw, 420px); text-align: center;
}
.stroop-panel.shake { animation: shake .42s; }
.stroop-word {
  font-family: 'Archivo Black', Impact, sans-serif;
  font-size: clamp(44px, 9vw, 76px); letter-spacing: .01em;
  text-shadow: 3px 3px 0 rgba(18, 16, 14, .18);
  animation: pop .18s cubic-bezier(.2,.9,.3,1.2) both;
}
.stroop-btns { display: flex; gap: 14px; width: min(88vw, 460px); }
.stroop-btn {
  flex: 1; font-family: 'Archivo Black', Impact, sans-serif; font-size: 17px;
  text-transform: uppercase; letter-spacing: .02em; padding: 16px;
  border: 3px solid #12100E; border-radius: 6px; box-shadow: 5px 5px 0 #12100E;
  cursor: pointer; transition: transform .08s ease, box-shadow .08s ease;
}
.stroop-btn.yes { background: #C4F03C; color: #12100E; }
.stroop-btn.no  { background: #FBFAF7; color: #12100E; }
.stroop-btn:hover  { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 #12100E; }
.stroop-btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 #12100E; }

/* Shade Sniper — the grid fills the width for large touch targets on mobile */
.shade-arena {
  display: grid; gap: clamp(4px, 1.4vw, 10px);
  width: min(92vw, 520px); aspect-ratio: 1 / 1; margin: 0 auto;
  border: 3px solid var(--border); border-radius: 12px; box-shadow: 7px 7px 0 var(--shadow);
  padding: clamp(4px, 1.4vw, 10px); background: var(--slab);
}
.shade-cell {
  width: 100%; height: 100%; border: 0; border-radius: 8px; padding: 0; cursor: pointer;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  transition: transform .06s ease;
}
.shade-cell:active { transform: scale(.94); }
.shade-cell.bad { animation: shake .4s; }

/* ---------- Time Lord (calm, minimal) ---------- */
.time-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; min-height: 56vh; text-align: center; padding: 20px; }
.time-target { font-family: 'Space Grotesk', sans-serif; font-size: clamp(20px, 4vw, 26px); font-weight: 600; color: var(--ink); opacity: .9; }
.time-display { font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: clamp(56px, 15vw, 110px); letter-spacing: -.02em; color: var(--ink); min-height: 1.1em; transition: opacity .6s ease, font-size .6s ease; }
.time-display.reveal-off { opacity: .25; font-size: clamp(40px, 10vw, 72px); }
.time-feedback { font-family: 'JetBrains Mono', monospace; font-size: 14px; letter-spacing: .03em; opacity: .6; min-height: 1.4em; }
.time-stop {
  font-family: 'Archivo Black', Impact, sans-serif; font-size: 22px; letter-spacing: .04em;
  padding: 20px 54px; border: 3px solid var(--border); border-radius: 10px; box-shadow: 6px 6px 0 var(--shadow);
  background: var(--slab); color: var(--ink); cursor: pointer; transition: transform .08s ease, box-shadow .08s ease;
}
.time-stop:hover  { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--shadow); }
.time-stop:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--shadow); }
.time-stop:disabled { opacity: .4; cursor: default; transform: none; box-shadow: 3px 3px 0 var(--shadow); }

/* ---------- Breathe Sixty (soft, sage) ---------- */
.breathe-wrap { position: relative; min-height: calc(100vh - 40px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 30px; padding: 24px; color: var(--ink); }
.breathe-back { position: absolute; top: 18px; left: 18px; background: none; border: 0; cursor: pointer; font-family: 'JetBrains Mono', monospace; font-size: 13px; font-weight: 700; letter-spacing: .04em; color: var(--ink); opacity: .5; }
.breathe-back:hover { opacity: .85; }
.breathe-stage { position: relative; width: min(74vw, 300px); height: min(74vw, 300px); display: flex; align-items: center; justify-content: center; }
.breathe-circle {
  position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 50% 42%, #EAF3EC, #A9CDB8 62%, #8FB89F);
  border: 3px solid var(--border); box-shadow: 0 0 70px rgba(127, 179, 152, .35);
}
.breathe-core { position: relative; z-index: 1; }
.breathe-label { font-family: 'Space Grotesk', sans-serif; font-size: clamp(20px, 5vw, 28px); font-weight: 600; letter-spacing: .01em; color: #16311F; }
.breathe-tone { background: none; border: 2px solid var(--border); border-radius: 22px; padding: 8px 16px; cursor: pointer; font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--ink); opacity: .7; }
.breathe-tone:hover { opacity: 1; }
.breathe-hint { font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; opacity: .4; }
.breathe-done { text-align: center; animation: fadeUp .8s ease both; }
.breathe-done-text { font-family: 'Archivo Black', Impact, sans-serif; font-size: clamp(34px, 8vw, 54px); color: var(--ink); }

/* ---------- Relax section on the hub (softer than test games) ---------- */
.relax-section { position: relative; z-index: 1; margin-top: 26px; }
.relax-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.relax-title { font-family: 'Archivo Black', Impact, sans-serif; font-size: 22px; color: var(--ink); }
.relax-sub { font-family: 'JetBrains Mono', monospace; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; opacity: .5; }
.relax-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.relax-card {
  text-align: left; cursor: pointer; padding: 20px; min-height: 150px; display: flex; flex-direction: column;
  border-radius: 16px; border: 2px solid var(--border); color: var(--ink);
  background: linear-gradient(160deg, var(--slab), var(--canvas));
  box-shadow: 3px 3px 0 var(--shadow); transition: transform .1s ease, box-shadow .1s ease;
}
.relax-card:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--shadow); }
.relax-card .rc-icon { font-size: 30px; }
.relax-card .rc-name { font-family: 'Archivo Black', Impact, sans-serif; font-size: 24px; margin-top: 10px; }
.relax-card .rc-blurb { font-size: 14px; opacity: .8; margin-top: 4px; }
.relax-card .rc-foot { margin-top: auto; padding-top: 16px; font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; opacity: .55; }

/* Aim + Flick */
.arena-wrap { max-width: 780px; margin: 0 auto; padding: 12px 20px 30px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.arena {
  position: relative; width: min(92vw, 720px); height: min(56vh, 480px);
  cursor: crosshair; overflow: hidden;
  background: rgba(251, 250, 247, .4);
  border: 3px solid #12100E; border-radius: 6px; box-shadow: 7px 7px 0 #12100E;
}
.aim-target {
  position: absolute; transform: translate(-50%, -50%); border-radius: 50%;
  background: #FBFAF7; border: 5px solid #12100E; cursor: pointer;
  box-shadow: 0 0 0 4px rgba(18, 16, 14, .15); animation: pop .16s ease-out;
}
/* Flick targets shrink over their lifetime (--life) — visible urgency */
@keyframes flickShrink { 0% { transform: translate(-50%, -50%) scale(1); } 100% { transform: translate(-50%, -50%) scale(.45); } }
.flick-target {
  position: absolute; transform: translate(-50%, -50%); border-radius: 50%;
  background: #12100E; border: 5px solid #FBFAF7; cursor: crosshair;
  box-shadow: 0 0 0 4px rgba(18, 16, 14, .2);
  animation: flickShrink var(--life, 900ms) linear forwards;
}

/* GO target — aim/flick wait for you */
.go-target {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 96px; height: 96px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  background: var(--accent, #FFC42E); color: #12100E;
  border: 5px solid #12100E; box-shadow: 6px 6px 0 #12100E;
  font-family: 'Archivo Black', Impact, sans-serif; font-size: 28px;
  animation: breathe 1.4s ease-in-out infinite;
  user-select: none; -webkit-user-select: none;
}
.go-target:hover { background: #FBFAF7; }
.ripple {
  position: absolute; width: 80px; height: 80px; border-radius: 50%;
  border: 4px solid #12100E; pointer-events: none;
  transform: translate(-50%, -50%); animation: ripple .45s ease-out forwards;
}
.ripple.light { border-color: #FBFAF7; }

/* hit debris */
@keyframes sparkFly {
  0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(160deg) scale(.25); opacity: 0; }
}
.spark {
  position: absolute; width: 10px; height: 10px; pointer-events: none;
  background: #FBFAF7; border: 2px solid #12100E; border-radius: 2px;
  animation: sparkFly .5s ease-out forwards;
}
.spark.light { background: #12100E; border-color: #FBFAF7; }

/* floating "PERFECT" label */
@keyframes floatUp {
  0% { transform: translate(-50%, -90%) scale(.6); opacity: 0; }
  25% { transform: translate(-50%, -130%) scale(1.05); opacity: 1; }
  100% { transform: translate(-50%, -220%) scale(1); opacity: 0; }
}
.float-label {
  position: absolute; pointer-events: none;
  font-family: 'Archivo Black', Impact, sans-serif; font-size: 13px; letter-spacing: .05em;
  background: #12100E; color: #FBFAF7; padding: 4px 8px; border-radius: 4px;
  animation: floatUp .7s ease-out forwards;
}

/* flick endgame panic */
@keyframes frenzyPulse {
  0%, 100% { border-color: #12100E; box-shadow: 7px 7px 0 #12100E; }
  50% { border-color: #FF5A46; box-shadow: 7px 7px 0 #FF5A46; }
}
.arena.frenzy { animation: frenzyPulse .5s ease-in-out infinite; }

/* Type — distraction-free: no box, the words own the stage.
   Three lines visible, active line held on the middle row,
   smooth gliding caret, big live timer above. */
.type-wrap {
  max-width: 1120px; margin: 0 auto; padding: 40px 24px 34px;
  display: flex; flex-direction: column; gap: 18px; width: 100%;
}
.type-live {
  font-family: 'JetBrains Mono', monospace; font-weight: 700;
  font-size: clamp(22px, 3vw, 30px); color: #12100E;
  min-height: 1.3em; transition: opacity .3s ease;
}
.type-live.off { opacity: 0; }
.type-area { position: relative; cursor: text; }
.type-window {
  overflow: hidden; position: relative;
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(27px, 4.3vw, 46px); line-height: 1.7;
  height: 5.1em; /* three lines — scales with the bigger font */
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 88%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0, #000 88%, transparent 100%);
}
.type-text {
  position: relative; transition: transform .18s ease-out;
  white-space: pre-wrap; word-break: break-word;
  letter-spacing: .01em; color: rgba(18, 16, 14, .38);
}
.tchar.ok    { color: #12100E; }
.tchar.ok.pop{ display: inline-block; animation: charPop .14s ease-out; }
.tchar.bad   { color: #FBFAF7; background: #FF5A46; border-radius: 3px; }
.caret {
  position: absolute; width: 3px; border-radius: 2px; background: #12100E;
  transition: left .08s ease-out, top .12s ease-out;
  animation: caretBlink 1.1s step-end infinite;
}
@keyframes caretBlink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
.caret.moving { animation: none; }
.refocus-note {
  position: absolute; inset: 0; display: none; place-items: center;
  font-family: 'JetBrains Mono', monospace; font-size: 15px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: #12100E;
}
.type-area.unfocused .refocus-note { display: grid; }
.type-area.unfocused .type-window { filter: blur(4px); opacity: .5; }
.type-area.unfocused .caret { display: none; }
.type-meta { display: flex; align-items: center; justify-content: center; gap: 16px; min-height: 34px; }
body.zen .zen-dim { opacity: .05; }
.zen-dim { transition: opacity .45s ease; }

/* ---------- Result ---------- */
.result-wrap { min-height: calc(100vh - 110px); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 14px 20px 40px; gap: 20px; color: var(--ink); }
.result-card {
  position: relative; width: 100%; max-width: 440px;
  background: var(--slab); color: var(--ink);
  border: 3px solid var(--border); border-radius: 6px;
  box-shadow: 9px 9px 0 var(--shadow); padding: 32px 28px;
  animation: slam .55s cubic-bezier(.18, .9, .32, 1.15) both;
}
.newbest-sticker {
  position: absolute; top: -16px; left: -12px; transform: rotate(-7deg);
  background: var(--ink); color: var(--slab);
  font-family: 'Archivo Black', Impact, sans-serif; font-size: 15px;
  letter-spacing: .06em; padding: 7px 12px;
  border: 3px solid var(--border); box-shadow: 3px 3px 0 var(--shadow);
}
.result-label { font-family: 'JetBrains Mono', monospace; font-size: 13px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; opacity: .7; }
.result-score { font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: clamp(84px, 22vw, 132px); line-height: .92; letter-spacing: -.03em; margin-top: 6px; }
.result-unit  { font-family: 'JetBrains Mono', monospace; font-size: 16px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; opacity: .7; margin-top: 2px; }
.result-verdict {
  display: inline-block; margin-top: 12px; transform: rotate(-1.5deg);
  font-family: 'Archivo Black', Impact, sans-serif; font-size: 14px; letter-spacing: .05em;
  padding: 5px 11px; border: 3px solid var(--border); border-radius: 5px;
  box-shadow: 3px 3px 0 var(--shadow);
}
.result-subs  { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 24px; }
.result-sub   { border: 3px solid var(--border); border-radius: 6px; padding: 11px 10px; }
.result-sub .rs-val   { font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 20px; }
.result-sub .rs-label { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; opacity: .7; margin-top: 3px; }
.pct-row { display: flex; justify-content: space-between; font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; opacity: .75; margin-bottom: 7px; }
.pct-track { height: 22px; border: 3px solid var(--border); border-radius: 5px; background: var(--canvas); overflow: hidden; }
.pct-fill { height: 100%; width: 0%; transition: width .9s cubic-bezier(.2, .8, .2, 1); }
.result-best-line { margin-top: 14px; font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; opacity: .6; }
/* personal-best comparison line (shared ResultScreen) */
.result-pb { margin-top: 18px; font-family: 'JetBrains Mono', monospace; font-size: 14px; font-weight: 700; letter-spacing: .02em; min-height: 18px; }
.result-pb.is-best { animation: popBig .5s cubic-bezier(.2, .9, .3, 1.1) both; }
/* percentile line + bar */
.result-pctwrap { margin-top: 18px; }
.result-pct { font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; opacity: .78; margin-bottom: 8px; }
/* secondary detail below the card (stats, charts, support, ad) */
.result-extras { width: 100%; max-width: 440px; display: flex; flex-direction: column; align-items: center; gap: 20px; }
.result-extras:empty { display: none; }
.result-btns { display: flex; flex-direction: column; gap: 10px; margin-top: 26px; }
.result-btns .row2 { display: flex; gap: 10px; }
.btn-play {
  font-family: 'Archivo Black', Impact, sans-serif; font-size: 18px;
  text-transform: uppercase; letter-spacing: .02em;
  border: 3px solid #12100E; border-radius: 6px; box-shadow: 5px 5px 0 #12100E;
  padding: 15px; cursor: pointer; transition: transform .08s ease, box-shadow .08s ease;
}
.btn-play:hover  { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 #12100E; }
.btn-play:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 #12100E; }
.result-support { width: 100%; max-width: 440px; text-align: center; font-family: 'JetBrains Mono', monospace; font-size: 12px; letter-spacing: .04em; color: var(--ink); opacity: .75; }
.result-support button { background: none; border: 0; cursor: pointer; color: inherit; font: inherit; font-weight: 700; text-decoration: underline; padding: 0; }
.result-wrap .ad-box { width: 100%; max-width: 440px; margin-top: 0; }

/* ResultScreen sparkline (last 10 attempts) */
.result-spark { margin-top: 16px; }
.result-spark .sparkline { display: block; width: 100%; height: 46px; }
.result-spark-cap { font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: .04em; text-transform: uppercase; opacity: .55; margin-top: 4px; }

/* ---------- Stats page ---------- */
.stats-wrap { max-width: 820px; margin: 0 auto; padding: 8px 20px 64px; color: var(--ink); }
.stats-head { margin: 6px 0 22px; }
.stats-title { font-family: 'Archivo Black', Impact, sans-serif; font-size: clamp(30px, 7vw, 46px); letter-spacing: -.01em; }
.stats-sub { font-family: 'JetBrains Mono', monospace; font-size: 12px; letter-spacing: .03em; opacity: .7; margin-top: 6px; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.stats-card { background: var(--slab); border: 3px solid var(--border); border-radius: 6px; box-shadow: 6px 6px 0 var(--shadow); padding: 16px 18px; }
.stats-card-head { display: flex; align-items: center; gap: 10px; }
.stats-swatch { width: 16px; height: 16px; border: 2px solid var(--border); border-radius: 4px; flex: none; }
.stats-name { font-family: 'Archivo Black', Impact, sans-serif; font-size: 18px; letter-spacing: .01em; flex: 1; }
.stats-play { font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; border: 2px solid var(--border); border-radius: 5px; box-shadow: 2px 2px 0 var(--shadow); padding: 5px 12px; cursor: pointer; }
.stats-play:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--shadow); }
.stats-nums { display: flex; gap: 16px; margin: 14px 0 12px; }
.stat-num .v { font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 18px; }
.stat-num .l { font-size: 10px; letter-spacing: .04em; text-transform: uppercase; opacity: .65; margin-top: 2px; }
.stats-chart-wrap { border-top: 2px solid var(--border); padding-top: 12px; }
.statchart { display: block; width: 100%; height: auto; }
.stats-empty { font-family: 'JetBrains Mono', monospace; font-size: 12px; letter-spacing: .03em; opacity: .55; padding: 18px 0; text-align: center; }
.stats-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 8px; }
.stats-actions > * { flex: 1; min-width: 200px; margin-top: 0 !important; }
.stats-note { font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: .02em; opacity: .55; line-height: 1.5; margin-top: 14px; }

/* ---------- The Daily Sixty ---------- */
/* Prominent homepage card (first thing on the hub) */
.daily-card {
  position: relative; z-index: 1; display: block; width: 100%; text-align: left; cursor: pointer;
  margin: 0 0 20px; padding: 20px 24px; color: #12100E; background: var(--accent);
  border: 3px solid #12100E; border-radius: 8px; box-shadow: 9px 9px 0 #12100E;
  transition: transform .09s ease, box-shadow .09s ease;
}
.daily-card:hover  { transform: translate(-3px, -3px); box-shadow: 12px 12px 0 #12100E; }
.daily-card:active { transform: translate(4px, 4px); box-shadow: 2px 2px 0 #12100E; }
.daily-card.done { background: var(--slab); color: var(--ink); }
.dc-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.dc-kicker { font-family: 'JetBrains Mono', monospace; font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.dc-new { font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 700; letter-spacing: .1em; background: #12100E; color: var(--accent); padding: 4px 9px; border-radius: 4px; }
.dc-score { font-family: 'JetBrains Mono', monospace; font-size: 20px; font-weight: 700; }
.dc-title { font-family: 'Archivo Black', Impact, sans-serif; font-size: clamp(40px, 10vw, 64px); line-height: .95; margin-top: 6px; }
.dc-sub { font-family: 'JetBrains Mono', monospace; font-size: 13px; font-weight: 700; letter-spacing: .04em; margin-top: 4px; opacity: .8; }
.dc-play { display: inline-block; margin-top: 14px; font-family: 'Archivo Black', Impact, sans-serif; font-size: 18px; letter-spacing: .04em; }
.dc-grid { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 14px 0 12px; font-size: 22px; letter-spacing: .04em; }
.dc-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; opacity: .75; }
.dc-foot-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; }
.dc-streak { font-family: 'JetBrains Mono', monospace; font-size: 13px; font-weight: 700; letter-spacing: .03em; text-transform: none; }

/* Daily-streak UI — always calm & positive (no guilt, warnings or pressure) */
.daily-streak { max-width: 440px; margin: 0 auto 16px; }
.streak-flame { font-family: 'JetBrains Mono', monospace; font-size: 16px; font-weight: 700; letter-spacing: .02em; }
.streak-reset { font-family: 'JetBrains Mono', monospace; font-size: 13px; line-height: 1.55; opacity: .85; max-width: 40ch; margin: 0 auto; }
.stats-streak { display: flex; flex-wrap: wrap; gap: 14px 26px; align-items: flex-start; background: var(--slab); border: 3px solid var(--border); border-radius: 6px; box-shadow: 6px 6px 0 var(--shadow); padding: 16px 18px; margin: 0 0 18px; }
.ss-item .ss-v { font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 22px; }
.ss-item .ss-l { font-size: 10px; letter-spacing: .04em; text-transform: uppercase; opacity: .65; margin-top: 3px; }

/* Daily play chrome */
.daily-wrap { max-width: 640px; margin: 0 auto; padding: 12px 20px 48px; color: var(--ink); min-height: calc(100vh - 60px); }
.daily-top { display: flex; align-items: center; gap: 14px; padding: 6px 0 16px; }
.daily-tag { font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; opacity: .7; }
.daily-progress { display: flex; gap: 8px; justify-content: center; margin-bottom: 12px; }
.dp-cell { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; font-size: 17px; border: 2px solid var(--border); border-radius: 6px; background: var(--slab); opacity: .5; }
.dp-cell.active { opacity: 1; box-shadow: 3px 3px 0 var(--shadow); }
.dp-cell.done { opacity: 1; }
.daily-clock { height: 10px; border: 2px solid var(--border); border-radius: 5px; overflow: hidden; background: var(--slab); margin-bottom: 20px; }
.daily-clockfill { height: 100%; width: 100%; background: var(--accent); transition: width .1s linear; }
.daily-stage { min-height: 52vh; }
.daily-center { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; min-height: 52vh; text-align: center; }
.daily-sub { font-family: 'JetBrains Mono', monospace; font-size: 13px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; opacity: .7; }
.daily-problem { font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: clamp(40px, 11vw, 64px); }
.daily-arena-wrap { width: 100%; }
.daily-arena { position: relative; width: 100%; height: 46vh; max-height: 420px; border: 3px solid var(--border); border-radius: 8px; background: var(--slab); overflow: hidden; }
.daily-react-pad {
  width: min(80vw, 320px); height: 200px; display: flex; align-items: center; justify-content: center;
  font-family: 'Archivo Black', Impact, sans-serif; font-size: 34px; cursor: pointer; user-select: none;
  border: 3px solid var(--border); border-radius: 10px; box-shadow: 6px 6px 0 var(--shadow);
  background: var(--slab); color: var(--ink);
}
.daily-react-pad.go { background: #22C55E; color: #06210f; }
.daily-dots { display: flex; gap: 10px; }
.daily-dot { width: 12px; height: 12px; border: 2px solid var(--border); border-radius: 3px; }
.daily-dot.done { background: var(--accent); }

/* Round transition card */
.daily-transition { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 52vh; text-align: center; }
.dt-round { font-family: 'JetBrains Mono', monospace; font-size: 13px; font-weight: 700; letter-spacing: .18em; opacity: .6; }
.dt-name { font-family: 'Archivo Black', Impact, sans-serif; font-size: clamp(34px, 9vw, 56px); animation: cdPop .45s cubic-bezier(.2,.9,.3,1.15) both; }
.dt-hint { font-family: 'JetBrains Mono', monospace; font-size: 13px; opacity: .7; }

/* Intro */
.daily-intro { text-align: center; padding: 20px 0; }
.daily-kicker { font-family: 'JetBrains Mono', monospace; font-size: 13px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; opacity: .7; }
.daily-h1 { font-family: 'Archivo Black', Impact, sans-serif; font-size: clamp(56px, 16vw, 120px); line-height: .95; margin: 6px 0; }
.daily-lead { font-size: 16px; opacity: .8; max-width: 46ch; margin: 0 auto 20px; line-height: 1.5; }
.daily-rounds-preview { display: flex; gap: 14px; justify-content: center; font-size: 30px; margin-bottom: 26px; }
.daily-start { width: 100%; max-width: 360px; margin: 0 auto 12px; display: block; }
.daily-intro .btn-ghost { width: 100%; max-width: 360px; margin: 0 auto; display: block; }

/* Result */
.daily-result { text-align: center; }
.daily-total { display: flex; align-items: baseline; justify-content: center; gap: 10px; margin: 10px 0 20px; }
.daily-total .dt-num { font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: clamp(72px, 20vw, 120px); line-height: 1; }
.daily-total .dt-max { font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 22px; opacity: .55; }
.daily-breakdown { display: flex; flex-direction: column; gap: 8px; max-width: 440px; margin: 0 auto 20px; text-align: left; }
.dbrow { display: flex; align-items: center; gap: 12px; }
.db-emoji { font-size: 20px; width: 26px; text-align: center; }
.db-name { font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; width: 78px; }
.db-bar { flex: 1; height: 16px; border: 2px solid var(--border); border-radius: 4px; background: var(--canvas); overflow: hidden; }
.db-fill { display: block; height: 100%; }
.db-score { font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 15px; width: 34px; text-align: right; }
.daily-lock { max-width: 440px; margin: 0 auto 18px; }
.daily-lock-line { font-family: 'JetBrains Mono', monospace; font-size: 13px; font-weight: 700; letter-spacing: .03em; }
.daily-next { font-family: 'JetBrains Mono', monospace; font-size: 13px; margin-top: 8px; opacity: .8; }
.daily-next strong { font-variant-numeric: tabular-nums; }
.daily-result .result-btns { max-width: 440px; margin: 0 auto; }

/* Daily leaderboard */
.daily-lb { max-width: 440px; margin: 0 auto 20px; text-align: left; }
.daily-lb-load { font-family: 'JetBrains Mono', monospace; font-size: 12px; opacity: .55; text-align: center; padding: 10px 0; }
.daily-lb-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.lb-title { font-family: 'Archivo Black', Impact, sans-serif; font-size: 16px; }
.lb-meta { font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 700; letter-spacing: .03em; opacity: .65; }
.lb-rows { display: flex; flex-direction: column; gap: 4px; }
.lb-row { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border: 2px solid var(--border); border-radius: 6px; background: var(--slab); }
.lb-row.me { background: var(--accent); color: #12100E; box-shadow: 3px 3px 0 var(--shadow); }
.lb-rank { font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 12px; width: 42px; opacity: .7; }
.lb-row.me .lb-rank { opacity: .9; }
.lb-name { flex: 1; font-family: 'Space Grotesk', sans-serif; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-score { font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 15px; }
.lb-gap { text-align: center; opacity: .4; font-size: 16px; line-height: 1; padding: 2px 0; letter-spacing: .2em; }

/* ---------- Modals ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, .4);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
  width: 100%; max-width: 460px; max-height: 88vh; overflow: auto;
  background: var(--slab); color: var(--ink);
  border: 3px solid var(--border); border-radius: 6px;
  box-shadow: 9px 9px 0 var(--shadow); padding: 26px;
  animation: modalIn .3s cubic-bezier(.2, .9, .3, 1.1) both;
}
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; gap: 12px; }
.modal-title { font-family: 'Archivo Black', Impact, sans-serif; font-size: 26px; letter-spacing: -.01em; }
.modal-section { font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; opacity: .7; margin: 18px 0 12px; }
.modal-section:first-of-type { margin-top: 0; }
.modal-note { font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: .02em; opacity: .6; margin: 18px 0 0; line-height: 1.5; }
.modal .btn-ghost { flex: initial; padding: 9px 14px; font-size: 13px; }

.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.theme-card {
  display: flex; flex-direction: column; gap: 10px; text-align: left; cursor: pointer;
  border-radius: 6px; padding: 12px; border: 3px solid var(--border);
  transition: transform .08s ease, box-shadow .08s ease;
}
.theme-card:hover { transform: translate(-2px, -2px); }
.theme-card.on { border-width: 4px; box-shadow: 5px 5px 0 var(--shadow); }
.theme-dots { display: flex; gap: 6px; }
.theme-dot { width: 16px; height: 16px; border-radius: 4px; border: 2px solid var(--border); display: inline-block; }
.theme-name { display: flex; justify-content: space-between; align-items: center; font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }

.text-input {
  font-family: 'Space Grotesk', sans-serif; font-size: 16px; padding: 12px 14px;
  width: 100%; background: var(--slab); color: var(--ink);
  border: 3px solid var(--border); border-radius: 6px; outline: none;
}
.form-error { font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 700; color: #FF5A46; }

.stats-table { width: 100%; border-collapse: collapse; font-family: 'JetBrains Mono', monospace; font-size: 13px; }
.stats-table td { padding: 7px 4px; border-bottom: 2px solid var(--border); }
.stats-table td:last-child { text-align: right; font-weight: 700; }

.support-links { display: flex; flex-direction: column; gap: 10px; }
.support-link {
  display: block; text-align: center; text-decoration: none;
  font-family: 'Archivo Black', Impact, sans-serif; font-size: 16px;
  text-transform: uppercase; letter-spacing: .02em;
  border: 3px solid var(--border); border-radius: 6px;
  box-shadow: 4px 4px 0 var(--shadow); padding: 13px; cursor: pointer;
  transition: transform .08s ease, box-shadow .08s ease;
  color: #12100E !important;
}
.support-link:hover  { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--shadow); }
.support-link:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--shadow); }
.support-link.patreon { background: #FF5A46; }
.support-link.kofi    { background: #22D3C5; }
.support-link.paypal  { background: #FFC42E; }
.support-link.share   { background: var(--slab); color: var(--ink) !important; }

.danger-btn { background: #FF5A46 !important; color: #12100E !important; }

/* ---------- Toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  z-index: 40; background: var(--ink); color: var(--slab);
  border: 3px solid var(--border); border-radius: 6px;
  box-shadow: 5px 5px 0 var(--shadow); padding: 12px 18px;
  font-family: 'JetBrains Mono', monospace; font-size: 13px; font-weight: 700;
  letter-spacing: .03em; max-width: 90vw; text-align: center;
  animation: modalIn .28s ease both;
}
#toast[hidden] { display: none; }

/* ---------- Consent banner ---------- */
#consent {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%);
  z-index: 50; width: min(94vw, 560px);
  background: var(--slab); color: var(--ink);
  border: 3px solid var(--border); border-radius: 6px;
  box-shadow: 6px 6px 0 var(--shadow); padding: 16px 18px;
  font-size: 14px; line-height: 1.5;
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
}
#consent[hidden] { display: none; }
#consent .btn-accent { width: auto; padding: 10px 18px; font-size: 14px; }
.consent-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.consent-btns .btn-ghost { flex: initial; padding: 10px 16px; font-size: 13px; }

/* ---------- Static pages (about / privacy / terms) ---------- */
.page { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; padding: 26px 20px 60px; color: var(--ink); }
.page-card {
  background: var(--slab); border: 3px solid var(--border); border-radius: 6px;
  box-shadow: 9px 9px 0 var(--shadow); padding: 34px 30px; margin-top: 22px;
}
.page h1 { font-family: 'Archivo Black', Impact, sans-serif; text-transform: uppercase; font-size: clamp(30px, 6vw, 48px); line-height: .95; letter-spacing: -.02em; margin: 0 0 18px; }
.page h2 { font-family: 'Archivo Black', Impact, sans-serif; font-size: 20px; margin: 28px 0 8px; }
.page p, .page li { font-size: 16px; line-height: 1.65; }
.page .meta { font-family: 'JetBrains Mono', monospace; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; opacity: .6; }
.back-link { font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; text-decoration: none; color: var(--ink) !important; }
.page h3 { font-family: 'Space Grotesk', sans-serif; font-size: 17px; font-weight: 700; margin: 18px 0 4px; }
.page a { color: var(--ink); font-weight: 700; }
/* content-page CTA button + sections */
.page-cta-wrap { text-align: center; margin: 26px 0; }
.page-cta {
  display: inline-block; text-decoration: none; color: #12100E !important;
  font-family: 'Archivo Black', Impact, sans-serif; font-size: 17px; letter-spacing: .01em;
  background: var(--accent); border: 3px solid #12100E; border-radius: 6px; box-shadow: 5px 5px 0 #12100E;
  padding: 14px 26px; transition: transform .08s ease, box-shadow .08s ease;
}
.page-cta:hover  { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 #12100E; }
.page-cta:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 #12100E; }
.page-faq { margin-top: 34px; border-top: 3px solid var(--border); padding-top: 8px; }
.related-tests { margin-top: 30px; padding: 18px 20px; border: 2px dashed var(--border); border-radius: 8px; }
.related-tests h2 { margin-top: 0; }
.page-sources { margin-top: 28px; padding-top: 14px; border-top: 2px solid var(--border); font-size: 13px; line-height: 1.6; opacity: .7; }

/* Prerendered SEO content (crawlers + no-JS); the app replaces it on boot */
.prerender { position: relative; z-index: 1; max-width: 720px; margin: 0 auto; padding: 44px 22px; color: var(--ink); }
.prerender h1 { font-family: 'Archivo Black', Impact, sans-serif; font-size: clamp(30px, 7vw, 52px); line-height: .95; letter-spacing: -.01em; margin: 0 0 16px; }
.prerender p { font-size: 17px; line-height: 1.6; }
.prerender ul { font-size: 16px; line-height: 1.95; padding-left: 20px; }
.prerender a { color: var(--ink); font-weight: 700; }
.prerender-guide a { text-decoration: none; border-bottom: 2px solid currentColor; }
.prerender-links { font-size: 14px; opacity: .85; margin-top: 16px; }
.prerender-note { opacity: .5; font-family: 'JetBrains Mono', monospace; font-size: 13px; margin-top: 18px; }

/* in-game "What's a good score?" link */
.cfg-guide { font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; text-decoration: none; color: var(--ink); opacity: .7; align-self: center; border-bottom: 2px solid currentColor; }
.cfg-guide:hover { opacity: 1; }

/* ---------- Focus mode (zen) — chrome melts away while you play ---------- */
.test-topline, .cfg-row, .stage-hint { transition: opacity .45s ease; }
body.zen .cfg-row { opacity: .05; }
body.zen .stage-hint { opacity: 0; }
body.zen .test-topline .key-hints, body.zen .test-topline .btn-quit, body.zen .test-logo { opacity: .08; }
.key-hints {
  font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 700;
  letter-spacing: .06em; text-transform: lowercase; opacity: .5;
}
.test-topline .key-hints { display: none; }
@media (min-width: 700px) { .test-topline .key-hints { display: inline; } }

/* ---------- Charts ---------- */
.chart-card {
  width: 100%; max-width: 560px;
  background: var(--slab); color: var(--ink);
  border: 3px solid var(--border); border-radius: 6px;
  box-shadow: 7px 7px 0 var(--shadow); padding: 16px 18px;
  animation: fadeUp .4s ease both;
}
.chart-title {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
  font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; margin-bottom: 10px;
}
.chart-legend { display: inline-flex; align-items: center; gap: 4px; opacity: .8; text-transform: none; letter-spacing: .02em; }
.legend-swatch { width: 12px; height: 12px; border: 2px solid var(--border); border-radius: 3px; display: inline-block; }
.legend-swatch.dim { background: color-mix(in srgb, var(--ink) 35%, transparent); }
canvas.chart { display: block; width: 100%; }

/* ---------- Confetti ---------- */
.confetti-canvas { position: fixed; inset: 0; z-index: 60; pointer-events: none; }

/* ---------- Math combo badge ---------- */
.combo-badge {
  position: absolute; top: -14px; right: -14px;
  background: var(--ink, #12100E); color: #C4F03C;
  font-family: 'Archivo Black', Impact, sans-serif; font-size: 15px;
  padding: 6px 10px; border: 3px solid #12100E; border-radius: 6px;
  box-shadow: 3px 3px 0 rgba(18, 16, 14, .35); transform: rotate(6deg);
}
.combo-badge.pulse { animation: popBig .25s ease-out; }

/* ---------- Auth tabs ---------- */
.auth-tab {
  flex: 1; font-family: 'JetBrains Mono', monospace; font-size: 13px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; padding: 11px; cursor: pointer;
  border-radius: 6px; border: 3px solid var(--border);
  background: var(--slab); color: var(--ink);
}
.auth-tab.on { background: var(--ink); color: var(--slab); }

/* ---------- Stats table charts ---------- */
.row-chartable { cursor: pointer; }
.row-chartable:hover td { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.chart-row td { padding: 10px 0 14px; }

/* ---------- Per-test ad ---------- */
.test-ad-wrap { max-width: 760px; margin: 18px auto 30px; padding: 0 20px; }
.test-ad-wrap .ad-box { margin-top: 0; min-height: 90px; }

@media (max-width: 560px) {
  .result-subs { gap: 8px; }
  .math-stats { gap: 16px; }
  .site-footer { flex-direction: column; align-items: flex-start; }
}

/* text-style button (e.g. "Forgot your password?") */
.link-btn {
  background: none; border: 0; padding: 0; margin-top: 12px; cursor: pointer;
  font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 700;
  color: var(--ink); opacity: .7; text-decoration: underline; letter-spacing: .03em;
}
.link-btn:hover { opacity: 1; }

/* ---------- House interstitial (blurred-backdrop dialog) ---------- */
#interstitial {
  position: fixed; inset: 0; z-index: 55;
  background: rgba(18, 16, 14, .45);
  -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: modalIn .3s ease both;
}
.inter-card {
  position: relative; width: 100%; max-width: 430px; text-align: center;
  background: var(--slab); color: var(--ink);
  border: 3px solid var(--border); border-radius: 6px;
  box-shadow: 10px 10px 0 var(--shadow); padding: 40px 30px 26px;
  animation: slam .5s cubic-bezier(.18, .9, .32, 1.15) both;
}
.inter-close {
  position: absolute; top: -16px; right: -14px;
  width: 44px; height: 44px; display: grid; place-items: center;
  font-family: 'Archivo Black', Impact, sans-serif; font-size: 18px;
  background: var(--slab); color: var(--ink);
  border: 3px solid var(--border); border-radius: 50%;
  box-shadow: 4px 4px 0 var(--shadow); cursor: pointer;
  transition: transform .08s ease;
}
.inter-close:hover { transform: rotate(8deg) scale(1.08); }
.inter-kicker {
  font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; opacity: .6; margin-bottom: 10px;
}
.inter-title {
  font-family: 'Archivo Black', Impact, sans-serif; font-size: clamp(22px, 5vw, 30px);
  line-height: 1.05; letter-spacing: -.01em; margin: 0 0 12px;
}
.inter-text { font-size: 15px; line-height: 1.6; opacity: .85; margin: 0 0 20px; }

/* "or" divider in the auth modal (between Google and email) */
.auth-or {
  display: flex; align-items: center; text-align: center; gap: 10px;
  margin: 16px 0; font-family: 'JetBrains Mono', monospace; font-size: 11px;
  font-weight: 700; letter-spacing: .1em; text-transform: uppercase; opacity: .5;
}
.auth-or::before, .auth-or::after { content: ''; flex: 1; height: 2px; background: var(--border); opacity: .3; }
