/* ===================================================================== fonts (self-hosted Inter, OFL) */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 800; font-display: swap; src: url(../fonts/inter-cyrillic.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 800; font-display: swap; src: url(../fonts/inter-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ===================================================================== theme tokens
   Dark is the default; [data-theme="light"] is set on <html> by an inline script before first paint. */
:root {
  color-scheme: dark;
  --bg: #0B0D1F; --glow1: #1C1650; --glow2: #0B2A4A;
  --blob1: rgba(109, 40, 217, .5); --blob2: rgba(14, 116, 144, .5); --blob3: rgba(190, 24, 93, .22); --grain: rgba(255, 255, 255, .035);
  --card: rgba(22, 26, 56, .72); --card-m: rgba(20, 24, 52, .94); --card-solid: #161A38; --card-hi: rgba(28, 32, 70, .85);
  --line: rgba(160, 170, 255, .14); --line2: rgba(160, 170, 255, .24); --line3: rgba(160, 170, 255, .36);
  --ink: #E8EBFF; --ink2: #C9CDEE; --muted: #A3A9D1; --faint: #8A90BA;
  --acc: #8B5CF6; --acc-ink: #C4B5FD; --acc-ink2: #DDD6FE; --acc2: #22D3EE; --acc2-ink: #67E8F9; --acc3: #F472B6;
  --ok: #34D399; --ok-ink: #6EE7B7; --bad: #F87171; --bad-ink: #FCA5A5; --warn: #FBBF24; --warn-ink: #FCD34D; --pink-ink: #F9A8D4;
  --soft0: rgba(255, 255, 255, .035); --soft: rgba(255, 255, 255, .06); --soft2: rgba(255, 255, 255, .1); --track: rgba(255, 255, 255, .07);
  --well: #12152E; --well-line: #2A3066; --well-hover: #171B3C; --well-hover-line: #5B54C9; --sel-bg: #1A1E44; --placeholder: #4A5088;
  --stim-bg: rgba(5, 7, 20, .45); --bar-bg: rgba(15, 17, 40, .84);
  --shadow: 0 20px 60px -30px rgba(0, 0, 0, .7); --shadow-bar: rgba(0, 0, 0, .95); --inset: inset 0 1px 0 rgba(255, 255, 255, .05);
  --scrim: rgba(5, 6, 16, .66); --toast-bg: #1E2350; --toast-ink: #E8EBFF;
  --grad: linear-gradient(135deg, #8B5CF6 0%, #6366F1 45%, #22D3EE 100%);
  --grad-num: linear-gradient(180deg, #FFFFFF, #C4B5FD); --g1: #8B5CF6; --g2: #22D3EE; --glow: rgba(139, 92, 246, .7);
  --lvl-grad: linear-gradient(0deg, #6D28D9, #22D3EE); --fp-grad: linear-gradient(90deg, #4C1D95, #8B5CF6);
  /* question figures (items.js emits these literal colours; see the attribute map below) */
  --f-ink: #E8EBFF; --f-cell: #141833; --f-cell-line: #2C3269; --f-faint: #3B4282; --f-sep: #12152E; --f-gray: #8C93C9;
  --f-acc: #A78BFA; --f-acc-soft: rgba(167, 139, 250, .08); --f-tile: #252A5A; --f-tile-hi: #4B3A9A;
  --f-die1: #3A3F7E; --f-die2: #232853; --f-die3: #2D3266; --f-cyan: #22D3EE; --f-pink: #F472B6;
  /* charts */
  --c-grid: #2A2F63; --c-curve: #5B61A8; --c-axis: #4B5194; --c-tick: #A3A9D1; --c-band: #8288B4; --c-area: rgba(255, 255, 255, .04);
  --c-f1: rgba(139, 92, 246, .25); --c-f2: rgba(34, 211, 238, .7); --c-marker: #FFFFFF; --c-pill: #22D3EE; --c-pill-ink: #06131F;
  --r-ring: rgba(160, 170, 255, .14); --r-area: rgba(139, 92, 246, .32); --r-line: #A78BFA; --r-dot: #22D3EE; --r-dot-line: #0B0D1F;
  --radius: 22px; --ease: cubic-bezier(.22, .9, .3, 1); --spring: cubic-bezier(.34, 1.56, .64, 1);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px); --sab: env(safe-area-inset-bottom, 0px); --sat: env(safe-area-inset-top, 0px);
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #F4F3FA; --glow1: #E7E0FF; --glow2: #D7F1F7;
  --blob1: rgba(167, 139, 250, .34); --blob2: rgba(34, 211, 238, .22); --blob3: rgba(244, 114, 182, .14); --grain: rgba(40, 30, 110, .028);
  --card: rgba(255, 255, 255, .8); --card-m: rgba(255, 255, 255, .95); --card-solid: #FFFFFF; --card-hi: #FFFFFF;
  --line: rgba(48, 40, 120, .1); --line2: rgba(48, 40, 120, .17); --line3: rgba(124, 58, 237, .35);
  --ink: #16173A; --ink2: #383B62; --muted: #5C6086; --faint: #676B8F;
  --acc: #7C3AED; --acc-ink: #6D28D9; --acc-ink2: #5B21B6; --acc2: #0891B2; --acc2-ink: #0E7490; --acc3: #DB2777;
  --ok: #059669; --ok-ink: #047857; --bad: #DC2626; --bad-ink: #B91C1C; --warn: #D97706; --warn-ink: #B45309; --pink-ink: #BE185D;
  --soft0: rgba(40, 30, 120, .025); --soft: rgba(40, 30, 120, .05); --soft2: rgba(40, 30, 120, .09); --track: rgba(40, 30, 120, .08);
  --well: #FFFFFF; --well-line: #DADBEE; --well-hover: #FBFAFF; --well-hover-line: #A78BFA; --sel-bg: #F6F2FF; --placeholder: #A9ACC8;
  --stim-bg: #F8F7FD; --bar-bg: rgba(255, 255, 255, .86);
  --shadow: 0 18px 50px -28px rgba(46, 30, 120, .28), 0 2px 6px -2px rgba(46, 30, 120, .06); --shadow-bar: rgba(46, 30, 120, .35); --inset: inset 0 1px 0 rgba(255, 255, 255, .9);
  --scrim: rgba(28, 24, 64, .36); --toast-bg: #1F2047; --toast-ink: #FFFFFF;
  --grad: linear-gradient(135deg, #7C3AED 0%, #4F46E5 50%, #0891B2 100%);
  --grad-num: linear-gradient(180deg, #1E1B4B, #6D28D9); --g1: #7C3AED; --g2: #06B6D4; --glow: rgba(124, 58, 237, .35);
  --lvl-grad: linear-gradient(0deg, #7C3AED, #22D3EE); --fp-grad: linear-gradient(90deg, #C4B5FD, #7C3AED);
  --f-ink: #1C1E45; --f-cell: #FFFFFF; --f-cell-line: #DCDEF0; --f-faint: #C5C9E6; --f-sep: #FFFFFF; --f-gray: #A2A7CB;
  --f-acc: #7C3AED; --f-acc-soft: rgba(124, 58, 237, .06); --f-tile: #EEF0FA; --f-tile-hi: #DCD2FF;
  --f-die1: #E6E8F8; --f-die2: #C8CDEA; --f-die3: #D7DBF2; --f-cyan: #0891B2; --f-pink: #DB2777;
  --c-grid: #DCDDF0; --c-curve: #8B8FC4; --c-axis: #B9BCDD; --c-tick: #5C6086; --c-band: #74789C; --c-area: rgba(124, 58, 237, .035);
  --c-f1: rgba(124, 58, 237, .18); --c-f2: rgba(8, 145, 178, .55); --c-marker: #16173A; --c-pill: #0E7490; --c-pill-ink: #FFFFFF;
  --r-ring: rgba(48, 40, 120, .12); --r-area: rgba(124, 58, 237, .18); --r-line: #7C3AED; --r-dot: #0891B2; --r-dot-line: #FFFFFF;
}

/* question figure colours → theme tokens (CSS beats SVG presentation attributes) */
:is(.stim, .opt) [fill="#E8EBFF"] { fill: var(--f-ink); }
:is(.stim, .opt) [stroke="#E8EBFF"] { stroke: var(--f-ink); }
:is(.stim, .opt) [fill="#141833"] { fill: var(--f-cell); }
:is(.stim, .opt) [stroke="#2C3269"] { stroke: var(--f-cell-line); }
:is(.stim, .opt) [fill="#3B4282"] { fill: var(--f-faint); }
:is(.stim, .opt) [stroke="#3B4282"] { stroke: var(--f-faint); }
:is(.stim, .opt) [stroke="#12152E"] { stroke: var(--f-sep); }
:is(.stim, .opt) [fill="#8C93C9"] { fill: var(--f-gray); }
:is(.stim, .opt) [stroke="#8C93C9"] { stroke: var(--f-gray); }
:is(.stim, .opt) [fill="#A78BFA"] { fill: var(--f-acc); }
:is(.stim, .opt) [stroke="#A78BFA"] { stroke: var(--f-acc); }
:is(.stim, .opt) [fill="rgba(167,139,250,0.08)"] { fill: var(--f-acc-soft); }
:is(.stim, .opt) [fill="#252A5A"] { fill: var(--f-tile); }
:is(.stim, .opt) [fill="#4B3A9A"] { fill: var(--f-tile-hi); }
:is(.stim, .opt) [fill="#3A3F7E"] { fill: var(--f-die1); }
:is(.stim, .opt) [fill="#232853"] { fill: var(--f-die2); }
:is(.stim, .opt) [fill="#2D3266"] { fill: var(--f-die3); }
:is(.stim, .opt) [stroke="#22D3EE"] { stroke: var(--f-cyan); }
:is(.stim, .opt) [fill="#22D3EE"] { fill: var(--f-cyan); }
:is(.stim, .opt) [fill="#F472B6"] { fill: var(--f-pink); }
:is(.stim, .opt) [stroke="#F472B6"] { stroke: var(--f-pink); }
#iq-hatch line { stroke: var(--f-ink); }
.ga-1 { stop-color: var(--g1); } .ga-2 { stop-color: var(--g2); }

/* smooth theme switch (class is set for ~0.5 s by app.js when the View Transitions API is unavailable) */
html.theme-anim, html.theme-anim *, html.theme-anim *::before, html.theme-anim *::after {
  transition: background-color .45s ease, border-color .45s ease, color .45s ease, fill .45s ease, stroke .45s ease, stop-color .45s ease, box-shadow .45s ease !important;
}
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

/* ===================================================================== base */
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scrollbar-color: var(--well-line) transparent; background: var(--bg); }
body { background: transparent; color: var(--ink); font-family: var(--font); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; line-height: 1.5; overflow-x: hidden; overflow-x: clip; font-feature-settings: "cv11", "ss01"; }
html[data-screen="test"] { scroll-padding-top: calc(132px + var(--sat)); scroll-padding-bottom: calc(92px + var(--sab)); }
@media (orientation: landscape) and (max-height: 560px) { html[data-screen="test"] { scroll-padding-top: calc(74px + var(--sat)); scroll-padding-bottom: calc(64px + var(--sab)); } }
body.modal-open { overflow: hidden; }
button { font: inherit; color: inherit; touch-action: manipulation; }
[hidden] { display: none !important; }
::selection { background: rgba(139, 92, 246, .38); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--acc2); outline-offset: 3px; border-radius: 10px; }
h1[tabindex]:focus-visible, h2[tabindex]:focus-visible, h3[tabindex]:focus-visible { outline: none; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
kbd { font: 600 12px/1 var(--font); padding: 3px 6px; border-radius: 6px; background: var(--soft2); border: 1px solid var(--line2); border-bottom-width: 2px; }
.noscript { max-width: 520px; margin: 60px auto; padding: 20px; text-align: center; border: 1px solid var(--line); border-radius: 16px; }

/* ===================================================================== background (no CSS blur filters: soft radial gradients are cheap to composite) */
.bg { position: fixed; inset: 0; bottom: auto; height: 100vh; height: 100lvh; z-index: -1; overflow: hidden; background: radial-gradient(1200px 800px at 80% -10%, var(--glow1) 0%, transparent 60%), radial-gradient(900px 700px at -10% 110%, var(--glow2) 0%, transparent 60%), var(--bg); pointer-events: none; }
.blob { position: absolute; border-radius: 50%; animation: float 26s ease-in-out infinite; will-change: transform; }
.b1 { width: 760px; height: 760px; background: radial-gradient(closest-side, var(--blob1), transparent); top: -280px; left: -260px; }
.b2 { width: 700px; height: 700px; background: radial-gradient(closest-side, var(--blob2), transparent); bottom: -300px; right: -240px; animation-delay: -9s; }
.b3 { width: 520px; height: 520px; background: radial-gradient(closest-side, var(--blob3), transparent); top: 34%; left: 48%; animation-delay: -17s; }
.grain { position: absolute; inset: 0; background-image: radial-gradient(var(--grain) 1px, transparent 1px); background-size: 3px 3px; }
@keyframes float { 0%,100% { transform: translate3d(0,0,0) scale(1); } 33% { transform: translate3d(60px,40px,0) scale(1.08); } 66% { transform: translate3d(-40px,30px,0) scale(.95); } }

/* ===================================================================== top bar + theme toggle */
.topbar { max-width: 960px; margin: 0 auto; padding: calc(14px + var(--sat)) max(20px, calc(var(--sar) + 12px)) 0 max(20px, calc(var(--sal) + 12px)); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
body.res .topbar { max-width: 960px; }
body[data-screen="test"] .topbar { display: none; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 750; font-size: 16px; letter-spacing: -.01em; color: var(--ink); user-select: none; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--grad); color: #fff; font-weight: 800; font-size: 14px; box-shadow: 0 8px 20px -8px var(--glow), inset 0 1px 0 rgba(255,255,255,.3); }
.theme-toggle { position: relative; width: 44px; height: 44px; flex: 0 0 44px; border-radius: 14px; border: 1px solid var(--line2); background: var(--soft); color: var(--ink); cursor: pointer; display: grid; place-items: center; overflow: hidden; -webkit-tap-highlight-color: transparent; transition: background .2s, border-color .2s, transform .2s var(--ease); }
.theme-toggle:hover { background: var(--soft2); border-color: var(--line3); }
.theme-toggle:active { transform: scale(.92); }
.theme-toggle .ic { position: absolute; width: 21px; height: 21px; transition: transform .5s var(--spring), opacity .3s; }
.theme-toggle .tt-sun { color: #F59E0B; }
.theme-toggle .tt-moon { color: var(--acc-ink); }
:root:not([data-theme="light"]) .theme-toggle .tt-moon { transform: rotate(-90deg) scale(.3); opacity: 0; }
:root[data-theme="light"] .theme-toggle .tt-sun { transform: rotate(90deg) scale(.3); opacity: 0; }

#app { max-width: 960px; margin: 0 auto; padding: 18px max(20px, calc(var(--sar) + 12px)) 20px max(20px, calc(var(--sal) + 12px)); min-height: calc(100vh - 150px); min-height: calc(100dvh - 150px); }
#app.wide { max-width: 1000px; padding-top: 28px; }
.screen { animation: screenIn .55s var(--ease) both; }
@keyframes screenIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: var(--shadow), var(--inset); margin-bottom: 18px; }
h1, h2, h3, h4 { margin: 0 0 10px; line-height: 1.2; letter-spacing: -.01em; }
h3 { font-size: 19px; font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.section-title { font-size: 22px; font-weight: 750; margin-bottom: 16px; }

/* ===================================================================== buttons */
.btn { position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 14px; padding: 12px 20px; min-height: 46px; font-weight: 650; font-size: 15px; cursor: pointer; text-decoration: none; color: var(--ink); transition: transform .2s var(--ease), box-shadow .25s, background .25s, opacity .2s, border-color .2s; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.btn:active { transform: scale(.96); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 10px 30px -10px var(--glow), inset 0 1px 0 rgba(255,255,255,.25); background-size: 160% 160%; animation: gradShift 8s ease infinite; }
.btn-primary::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.28) 50%, transparent 70%); transform: translateX(-120%); transition: transform .8s var(--ease); pointer-events: none; }
@media (hover: hover) {
  .btn-primary:hover { box-shadow: 0 14px 38px -10px var(--acc), inset 0 1px 0 rgba(255,255,255,.25); transform: translateY(-1px); }
  .btn-primary:hover::after { transform: translateX(120%); }
  .btn-ghost:hover { background: var(--soft2); border-color: var(--line3); }
  .btn:hover .ic { transform: translateX(2px); }
}
.btn-ghost { background: var(--soft); border: 1px solid var(--line2); }
:root[data-theme="light"] .btn-ghost { background: rgba(255,255,255,.8); box-shadow: 0 1px 2px rgba(46,30,120,.06); }
.btn-xl { padding: 16px 28px; font-size: 17px; border-radius: 16px; }
.btn:disabled { opacity: .38; pointer-events: none; }
@keyframes gradShift { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s var(--ease); flex-shrink: 0; }
.ic.sm { width: 16px; height: 16px; }
.link-btn { background: none; border: 0; color: var(--acc2-ink); cursor: pointer; display: inline-flex; align-items: center; gap: 4px; font-size: 13.5px; font-weight: 600; padding: 0 4px; min-height: 44px; margin: -8px -4px; -webkit-tap-highlight-color: transparent; }
:root[data-theme="light"] .link-btn { color: var(--acc2-ink); }
.link-btn[aria-expanded="true"] .ic { transform: rotate(180deg); }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--line); background: var(--soft); cursor: pointer; color: var(--ink); }
.icon-btn:hover { background: var(--soft2); }
.ripple { position: absolute; border-radius: 50%; background: radial-gradient(circle, rgba(167,139,250,.45) 0%, rgba(34,211,238,.18) 45%, transparent 70%); transform: scale(0); animation: ripple .6s var(--ease) forwards; pointer-events: none; }
@keyframes ripple { to { transform: scale(1); opacity: 0; } }

/* ===================================================================== start */
.hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: 36px; align-items: center; padding: 18px 0 40px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--acc-ink2); background: rgba(139,92,246,.12); border: 1px solid rgba(139,92,246,.32); margin-bottom: 20px; }
:root[data-theme="light"] .eyebrow { background: rgba(124,58,237,.08); border-color: rgba(124,58,237,.22); color: #5B21B6; }
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); animation: livedot 2.4s infinite; }
@keyframes livedot { 0% { box-shadow: 0 0 0 0 rgba(52,211,153,.55); } 70%,100% { box-shadow: 0 0 0 8px rgba(52,211,153,0); } }
.hero h1 { font-size: clamp(36px, 6vw, 60px); letter-spacing: -.035em; font-weight: 800; line-height: 1.04; margin-bottom: 18px; }
.lead { color: var(--ink2); font-size: clamp(16px, 2.2vw, 18.5px); max-width: 560px; margin: 0 0 28px; line-height: 1.6; }
.start-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.resume-note { margin: 4px 0 0; max-width: 480px; }
.chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; max-width: 520px; margin: 26px 0 0; }
.chip { margin: 0; padding: 12px 10px; border-radius: 16px; background: var(--soft0); border: 1px solid var(--line); animation: screenIn .7s var(--ease) both; }
:root[data-theme="light"] .chip { background: rgba(255,255,255,.7); }
.chip:nth-child(2) { animation-delay: .06s; } .chip:nth-child(3) { animation-delay: .12s; } .chip:nth-child(4) { animation-delay: .18s; }
.chip dt { font-size: 24px; font-weight: 800; line-height: 1.1; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.chip dd { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }

.hero-art { position: relative; aspect-ratio: 1; max-width: 400px; width: 100%; justify-self: center; }
.hero-matrix { width: 100%; height: auto; display: block; position: relative; z-index: 1; filter: drop-shadow(0 30px 60px rgba(76, 29, 149, .5)); animation: heroFloat 7s ease-in-out infinite; }
:root[data-theme="light"] .hero-matrix { filter: drop-shadow(0 26px 40px rgba(91, 33, 182, .2)); }
@keyframes heroFloat { 0%,100% { transform: translateY(0) rotate(-1.5deg); } 50% { transform: translateY(-10px) rotate(1deg); } }
.hm-frame { fill: var(--stim-bg); stroke: var(--line2); }
:root[data-theme="light"] .hm-frame { fill: rgba(255,255,255,.75); }
.hm-c rect, .hm-q rect { fill: var(--well); stroke: var(--well-line); stroke-width: 1.5; }
.hm-c { animation: cellIn .7s var(--spring) both; animation-delay: calc(var(--d) * 90ms + 200ms); transform-box: fill-box; transform-origin: center; }
@keyframes cellIn { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
.hm-c .f0 { fill: none; stroke: url(#hm-g); stroke-width: 4; }
.hm-c .f1 { fill: url(#hm-g); opacity: .55; }
.hm-c .f2 { fill: url(#hm-g); }
.hm-q { animation: cellIn .7s var(--spring) both; animation-delay: 1.05s; transform-box: fill-box; transform-origin: center; }
.hm-q rect { fill: var(--f-acc-soft); stroke: var(--f-acc); stroke-width: 2.5; stroke-dasharray: 8 6; animation: dash 14s linear infinite; }
.hm-q text { font: 800 52px var(--font); fill: var(--acc-ink); }
@keyframes dash { to { stroke-dashoffset: -280; } }
.orb { position: absolute; border-radius: 50%; z-index: 0; }
.o1 { width: 80%; height: 80%; left: -16%; top: -4%; background: radial-gradient(closest-side, rgba(139,92,246,.5), transparent); animation: float 16s ease-in-out infinite; }
.o2 { width: 70%; height: 70%; right: -16%; bottom: -10%; background: radial-gradient(closest-side, rgba(34,211,238,.36), transparent); animation: float 18s ease-in-out infinite reverse; }
:root[data-theme="light"] .o1 { background: radial-gradient(closest-side, rgba(167,139,250,.42), transparent); }
:root[data-theme="light"] .o2 { background: radial-gradient(closest-side, rgba(34,211,238,.3), transparent); }

.abilities { margin-bottom: 26px; }
.ab-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.ab-card { display: flex; gap: 14px; padding: 18px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--inset); transition: transform .25s var(--ease), border-color .25s, background .25s; animation: screenIn .6s var(--ease) both; animation-delay: calc(var(--i) * 60ms + 200ms); }
@media (hover: hover) { .ab-card:hover { transform: translateY(-3px); border-color: var(--line3); background: var(--card-hi); } }
.ab-ic { flex: 0 0 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: linear-gradient(135deg, rgba(139,92,246,.28), rgba(34,211,238,.18)); border: 1px solid rgba(139,92,246,.35); color: var(--acc-ink2); }
:root[data-theme="light"] .ab-ic { background: linear-gradient(135deg, rgba(124,58,237,.12), rgba(8,145,178,.1)); border-color: rgba(124,58,237,.2); color: #6D28D9; }
.ab-ic .ic { width: 22px; height: 22px; stroke-width: 1.9; }
.ab-card b { display: block; font-size: 15.5px; }
.ab-n { display: inline-block; font-size: 12px; font-weight: 600; color: var(--acc2-ink); margin: 1px 0 4px; }
:root[data-theme="light"] .ab-n { color: var(--acc2-ink); }
.ab-card p { margin: 0; font-size: 13.5px; color: var(--muted); line-height: 1.45; }
.steps { list-style: none; counter-reset: s; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.steps li { counter-increment: s; position: relative; padding-left: 50px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; font-weight: 800; background: var(--grad); color: #fff; box-shadow: 0 8px 20px -8px var(--glow); }
.steps b { display: block; margin-bottom: 2px; }
.steps span { font-size: 14px; color: var(--muted); }

/* ===================================================================== intro / practice */
.intro-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.intro-grid .card { margin-bottom: 0; }
.rules h2 { font-size: 26px; margin-bottom: 16px; }
.rule-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.rule-list li { display: flex; gap: 12px; color: var(--ink2); font-size: 15px; line-height: 1.5; }
.ri { flex: 0 0 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(139,92,246,.14); border: 1px solid rgba(139,92,246,.3); font-size: 16px; color: var(--acc-ink2); }
:root[data-theme="light"] .ri { background: rgba(124,58,237,.08); border-color: rgba(124,58,237,.2); color: #6D28D9; }
.practice-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.badge { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 99px; background: rgba(34,211,238,.14); color: var(--acc2-ink); border: 1px solid rgba(34,211,238,.35); text-transform: uppercase; letter-spacing: .06em; }
:root[data-theme="light"] .badge { background: rgba(8,145,178,.08); border-color: rgba(8,145,178,.3); }
.practice .q-stim svg.matrix { width: min(100%, 260px); }
.practice .options.n6 { grid-template-columns: repeat(6, 1fr); gap: 8px; }
.practice .opt { padding: 16px 4px 4px; border-radius: 14px; }
.ex-feedback { margin-top: 14px; padding: 0 14px; border-radius: 14px; font-size: 14.5px; max-height: 0; opacity: 0; overflow: hidden; transition: max-height .45s var(--ease), opacity .35s, padding .35s; }
.ex-feedback.show { max-height: 260px; opacity: 1; padding: 12px 14px; }
.ex-feedback.ok { background: rgba(52,211,153,.1); border: 1px solid rgba(52,211,153,.35); }
.ex-feedback.ok b { color: var(--ok-ink); }
.ex-feedback.bad { background: rgba(248,113,113,.08); border: 1px solid rgba(248,113,113,.32); }
.ex-feedback.bad b { color: var(--bad-ink); }
.opt.right { border-color: var(--ok) !important; background: rgba(52,211,153,.12) !important; box-shadow: 0 0 0 4px rgba(52,211,153,.15) !important; }
.opt.wrong { border-color: var(--bad) !important; background: rgba(248,113,113,.08) !important; box-shadow: none !important; animation: shake .4s; }
.intro-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 20px; flex-wrap: wrap; }

/* ===================================================================== test header */
.test-head { position: sticky; top: calc(8px + var(--sat)); z-index: 5; margin: 0 0 14px; padding: 12px 14px 10px 16px; background: var(--bar-bg); -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 18px 40px -26px var(--shadow-bar); }
.th-row { display: flex; align-items: center; gap: 12px; }
.q-counter { font-weight: 800; font-size: 26px; letter-spacing: -.5px; min-width: 74px; font-variant-numeric: tabular-nums; }
.q-counter small { font-size: 14px; color: var(--muted); font-weight: 600; margin-left: 3px; }
.q-type { flex: 1; min-width: 0; font-size: 13.5px; color: var(--acc-ink2); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
:root[data-theme="light"] .q-type { color: #4C1D95; }
.q-type > span:first-child::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--grad); margin-right: 8px; vertical-align: 1px; }
.pips { display: inline-flex; gap: 3px; }
.pips i { width: 6px; height: 6px; border-radius: 2px; background: var(--soft2); }
:root[data-theme="light"] .pips i { background: rgba(40,30,120,.13); }
.pips i.on { background: linear-gradient(135deg, var(--g1), var(--g2)); }
.th-tools { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.timer { display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 8px; min-height: 44px; border-radius: 999px; background: var(--soft); border: 1px solid var(--line); font-variant-numeric: tabular-nums; font-weight: 700; font-size: 18px; transition: color .3s, background .3s, border-color .3s; }
.timer-ring { width: 28px; height: 28px; transform: rotate(-90deg); }
.tr-bg { fill: none; stroke: var(--soft2); stroke-width: 3.5; }
.tr-fg { fill: none; stroke: url(#g-accent); stroke-width: 3.5; stroke-linecap: round; stroke-dasharray: 97.4; stroke-dashoffset: 0; transition: stroke-dashoffset .3s linear; }
.timer.warn { color: var(--warn-ink); border-color: rgba(251,191,36,.45); }
.timer.warn .tr-fg { stroke: var(--warn); }
.timer.danger { color: var(--bad-ink); border-color: rgba(248,113,113,.5); background: rgba(248,113,113,.1); animation: beat 1s ease-in-out infinite; }
.timer.danger .tr-fg { stroke: var(--bad); }
@keyframes beat { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }
.progress { height: 6px; background: var(--track); border-radius: 99px; margin-top: 12px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: var(--grad); border-radius: 99px; transition: width .6s var(--ease); box-shadow: 0 0 16px var(--glow); }
.th-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; font-size: 13.5px; color: var(--muted); }
.navigator { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; margin-top: 8px; padding: 10px; background: var(--card-solid); border: 1px solid var(--line); border-radius: 16px; animation: dropIn .35s var(--ease); max-height: 50vh; max-height: 52dvh; overflow: auto; overscroll-behavior: contain; }
@keyframes dropIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.nav-q { height: 44px; border-radius: 10px; border: 1px solid var(--line2); background: var(--soft0); font-size: 13.5px; font-weight: 650; cursor: pointer; transition: background .2s, border-color .2s, color .2s; color: var(--muted); padding: 0; font-variant-numeric: tabular-nums; -webkit-tap-highlight-color: transparent; }
@media (hover: hover) { .nav-q:hover { border-color: var(--acc); color: var(--ink); } }
.nav-q.done { background: rgba(139,92,246,.3); border-color: rgba(139,92,246,.65); color: #fff; }
:root[data-theme="light"] .nav-q.done { background: rgba(124,58,237,.14); border-color: rgba(124,58,237,.45); color: #4C1D95; }
.nav-q.cur { box-shadow: 0 0 0 2px var(--acc2); color: var(--ink); }

/* ===================================================================== question */
.stage { position: relative; touch-action: pan-y; }
#app.wide { touch-action: pan-y; }
.q-card { padding: 24px 24px 26px; }
.q-card.dragging { transition: none !important; }
.q-card.settle { transition: transform .28s var(--ease), opacity .28s; }
.q-card.leave-l { animation: leaveL .19s ease-in forwards; } .q-card.leave-r { animation: leaveR .19s ease-in forwards; }
.q-card.enter-l { animation: enterL .42s var(--ease) both; } .q-card.enter-r { animation: enterR .42s var(--ease) both; }
@keyframes leaveL { to { opacity: 0; transform: translateX(-34px); } }
@keyframes leaveR { to { opacity: 0; transform: translateX(34px); } }
@keyframes enterR { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes enterL { from { opacity: 0; transform: translateX(-40px); } to { opacity: 1; transform: none; } }
.q-prompt { font-size: clamp(16.5px, 2.4vw, 20px); font-weight: 650; margin: 0 0 18px; line-height: 1.4; }
.q-stim { display: flex; justify-content: center; margin-bottom: 20px; }
.q-stim:empty { display: none; }
.stim { width: 100%; display: flex; justify-content: center; }
.stim svg { shape-rendering: geometricPrecision; }
.stim-matrix svg.matrix { width: min(100%, 380px); height: auto; padding: 12px; background: var(--stim-bg); border-radius: 22px; border: 1px solid var(--line); }
.stim-seq { gap: 10px; flex-wrap: nowrap; }
.seq-cell { flex: 0 1 100px; min-width: 0; }
.seq-cell svg { width: 100%; height: auto; display: block; }
.stim-single svg { width: min(100%, 300px); height: auto; padding: 10px; background: var(--stim-bg); border-radius: 18px; border: 1px solid var(--line); }
.stim-single svg.wide { width: min(100%, 420px); }
.stim-single svg.net { width: min(100%, 300px); }
.stim-svgtiles svg { display: block; height: auto; }
.stim-svgtiles svg.tiles { width: 100%; max-width: 560px; }
.stim-svgtiles svg.tiles.n5 { max-width: 380px; } .stim-svgtiles svg.tiles.n6 { max-width: 450px; }
.stim-svgtiles svg.tiles.n7 { max-width: 520px; } .stim-svgtiles svg.tiles.n8 { max-width: 560px; }
.stim-svgtiles svg.numgrid { width: min(100%, 320px); background: var(--stim-bg); border-radius: 22px; border: 1px solid var(--line); }
.stim-svgtiles svg.analogy { width: min(100%, 380px); }
.stim-logic { flex-direction: column; align-items: center; gap: 10px; }
.stim-logic svg.people { width: min(100%, 360px); height: auto; }
.facts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; width: min(100%, 480px); }
.facts li { padding: 12px 16px; border-radius: 14px; background: var(--f-cell); border: 1px solid var(--f-cell-line); font-weight: 600; }
.facts li::before { content: "•"; color: var(--acc2); margin-right: 10px; }
.facts.big li { font-size: 18px; }
.note { font-size: 13.5px; color: var(--muted); margin: 2px 0 0; text-align: center; }
.qmark-box { animation: qglow 2.2s ease-in-out infinite; }
@keyframes qglow { 0%,100% { stroke-opacity: 1; } 50% { stroke-opacity: .45; } }
svg.critters { width: min(100%, 300px); height: auto; display: block; margin: 0 auto 4px; }
.critter { animation: bob 2.6s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }

/* options */
.options { display: grid; gap: 12px; grid-template-columns: repeat(4, 1fr); }
.options.n6, .options.n5 { grid-template-columns: repeat(3, 1fr); }
.options.text { grid-template-columns: repeat(3, 1fr); }
.options.text.long { grid-template-columns: repeat(2, 1fr); }
.opt { position: relative; overflow: hidden; background: var(--well); border: 1.5px solid var(--well-line); border-radius: 18px; padding: 18px 10px 10px; cursor: pointer; transition: transform .22s var(--ease), border-color .2s, background .2s, box-shadow .25s; display: flex; align-items: center; justify-content: center; min-height: 60px; animation: optIn .42s var(--ease) both; -webkit-tap-highlight-color: transparent; color: var(--ink); user-select: none; -webkit-user-select: none; }
:root[data-theme="light"] .opt { box-shadow: 0 1px 2px rgba(46,30,120,.05); }
.opt svg { width: 100%; max-width: 124px; max-height: 100%; height: auto; display: block; position: relative; }
@media (hover: hover) { .opt:hover { transform: translateY(-3px); border-color: var(--well-hover-line); background: var(--well-hover); box-shadow: 0 12px 30px -14px var(--glow); } }
.opt:active { transform: scale(.97); }
.opt:focus-visible { outline: 2px solid var(--acc2); outline-offset: 2px; border-radius: 18px; }
.opt .letter { position: absolute; top: 7px; left: 9px; font-size: 11.5px; font-weight: 700; color: var(--muted); z-index: 1; }
.opt.text { font-weight: 600; font-size: 16px; padding: 16px 34px 14px 32px; text-align: left; justify-content: flex-start; line-height: 1.3; }
.opt.text .letter { top: 50%; transform: translateY(-50%); left: 12px; }
.opt .otext { position: relative; }
.opt.sel { background: linear-gradient(var(--sel-bg), var(--sel-bg)) padding-box, var(--grad) border-box; border: 2px solid transparent; box-shadow: 0 0 0 4px rgba(139,92,246,.2), 0 14px 34px -12px var(--glow); }
.opt.sel .letter { color: var(--ink); }
.opt .check { position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; border-radius: 50%; background: var(--grad); display: grid; place-items: center; transform: scale(0); opacity: 0; transition: transform .35s var(--spring), opacity .2s; z-index: 1; }
.opt.text .check { top: 50%; right: 10px; margin-top: -10px; }
.opt .check svg { width: 12px; height: 12px; fill: none; stroke: #fff; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; max-width: none; }
.opt.sel .check { transform: scale(1); opacity: 1; }
.opt.pop { animation: pop .38s var(--ease); }
@keyframes pop { 0% { transform: scale(1); } 35% { transform: scale(.95); } 100% { transform: scale(1); } }
@keyframes optIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.test-foot { display: flex; justify-content: space-between; gap: 10px; position: sticky; bottom: calc(8px + var(--sab)); margin-top: 4px; padding: 10px; align-items: center; background: var(--bar-bg); -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 -10px 40px -26px var(--shadow-bar); z-index: 4; }
.test-foot .btn { flex: 0 0 auto; }
.test-foot .btn.gone { display: none; }
#btn-finish { margin: 0 auto; }
body[data-screen="test"] #app { padding-bottom: calc(14px + var(--sab)); }
.swipe-hint { display: none; }

@media (min-width: 900px) {
  .options:not(.text).n5 { grid-template-columns: repeat(5, 1fr); }
  .options:not(.text).n6 { grid-template-columns: repeat(6, 1fr); }
  .options:not(.text).n5 .opt, .options:not(.text).n6 .opt { aspect-ratio: 1; }
  .options:not(.text).n8 { max-width: 660px; margin: 0 auto; }
  .options:not(.text).n8 .opt { aspect-ratio: 1.2; }
  .options.text:not(.long) { max-width: 660px; margin: 0 auto; }
}
/* two-column question layout: wide desktop, and phones/tablets in landscape */
@media (min-width: 1000px), (orientation: landscape) and (min-width: 640px) and (max-height: 560px) {
  #app.wide { max-width: 1140px; }
  .q-card.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); column-gap: 34px; align-items: center; padding: 28px 30px 30px; }
  .q-card.split .q-prompt { grid-column: 1 / -1; }
  .q-card.split .q-stim { margin-bottom: 0; }
  .q-card.split .options { max-width: none; margin: 0; gap: 14px; }
  .q-card.split .options:not(.text).n8 { grid-template-columns: repeat(4, 1fr); }
  .q-card.split .options:not(.text) .opt { aspect-ratio: 1; padding: 22px 12px 12px; }
  .q-card.split .options:not(.text) .opt svg { max-width: 150px; }
  .q-card.split .options:not(.text).n6, .q-card.split .options:not(.text).n5 { grid-template-columns: repeat(3, 1fr); }
  .q-card.split .options.text { grid-template-columns: repeat(2, 1fr); }
  .q-card.split .options.text.long { grid-template-columns: 1fr; }
  .q-card.split .stim-matrix svg.matrix { width: min(100%, 440px); }
  .q-card.split .stim-single svg { width: min(100%, 380px); }
}

/* ===================================================================== age */
.age-card { max-width: 500px; margin: 40px auto; text-align: center; padding: 36px 28px; }
.age-icon { width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 16px; background: var(--grad); color: #fff; display: grid; place-items: center; font-size: 32px; font-weight: 800; box-shadow: 0 16px 40px -14px var(--glow); animation: popIn .6s var(--spring) both; }
.age-icon.timeup { background: linear-gradient(135deg, #F59E0B, #EF4444); }
@keyframes popIn { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.age-input { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 24px 0 8px; }
.age-input input { width: 140px; height: 78px; text-align: center; font-size: 40px; font-weight: 800; color: var(--ink); background: var(--well); border: 2px solid var(--well-line); border-radius: 18px; outline: none; transition: border-color .2s, box-shadow .2s; -moz-appearance: textfield; appearance: textfield; font-family: inherit; font-variant-numeric: tabular-nums; }
.age-input input::placeholder { color: var(--placeholder); }
.age-input input::-webkit-outer-spin-button, .age-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.age-input input:focus { border-color: var(--acc); box-shadow: 0 0 0 5px rgba(139,92,246,.22); }
.age-input input[aria-invalid="true"] { border-color: var(--bad); }
.age-step { width: 52px; height: 52px; border-radius: 14px; border: 1px solid var(--line2); background: var(--soft); font-size: 24px; cursor: pointer; transition: background .2s, transform .15s; -webkit-tap-highlight-color: transparent; }
.age-step:hover { background: var(--soft2); }
.age-step:active { transform: scale(.9); }
.age-hint { font-size: 13.5px; color: var(--muted); }
.age-err { min-height: 22px; color: var(--bad-ink); font-size: 14px; margin: 8px 0 12px; }
.shake { animation: shake .4s; }
@keyframes shake { 20%,60% { transform: translateX(-7px); } 40%,80% { transform: translateX(7px); } }

/* ===================================================================== result */
.result-hero { text-align: center; padding: 30px 20px 28px; position: relative; overflow: hidden; }
.result-hero::before { content: ""; position: absolute; inset: -40% -20% auto; height: 120%; background: radial-gradient(closest-side, rgba(139,92,246,.35), transparent); pointer-events: none; }
:root[data-theme="light"] .result-hero::before { background: radial-gradient(closest-side, rgba(167,139,250,.28), transparent); }
.rh-label { text-transform: uppercase; letter-spacing: 3px; font-size: 13px; font-weight: 700; color: var(--muted); position: relative; }
.iq-gauge { position: relative; width: 230px; height: 230px; margin: 6px auto 4px; }
.gauge { width: 100%; height: 100%; transform: rotate(135deg); }
.g-bg, .g-fg { fill: none; stroke-width: 14; stroke-linecap: round; stroke-dasharray: 443 591; }
.g-bg { stroke: var(--track); }
.g-fg { stroke: url(#g-accent); stroke-dashoffset: 443; filter: drop-shadow(0 0 10px var(--glow)); }
.iq-number { position: absolute; inset: 0; display: grid; place-items: center; font-size: 82px; font-weight: 800; letter-spacing: -3px; font-variant-numeric: tabular-nums; background: var(--grad-num); -webkit-background-clip: text; background-clip: text; color: transparent; }
.gauge-scale { position: absolute; left: 0; right: 0; bottom: 18px; display: flex; justify-content: space-between; padding: 0 34px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.iq-cat { display: inline-block; padding: 8px 18px; border-radius: 999px; font-weight: 700; border: 1px solid; opacity: 0; transform: translateY(10px) scale(.96); transition: opacity .6s var(--ease), transform .6s var(--spring); position: relative; max-width: 100%; }
.iq-pct { color: var(--ink2); margin: 14px 0 0; opacity: 0; transition: opacity .8s .15s; position: relative; font-size: 16px; }
.share-actions { margin-top: 20px; position: relative; opacity: 0; transition: opacity .8s .3s; }
.revealed .iq-cat { opacity: 1; transform: none; } .revealed .iq-pct, .revealed .share-actions { opacity: 1; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px 10px; text-align: center; animation: screenIn .6s var(--ease) both; box-shadow: var(--inset); }
.stat b { display: block; font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.25; }
.stat b small { font-size: 14px; font-weight: 600; color: var(--muted); }
.stat span { font-size: 12.5px; color: var(--muted); }
.bell svg { width: 100%; height: auto; display: block; }
.bell .b-grid { stroke: var(--c-grid); } .bell .b-curve { fill: var(--c-area); stroke: var(--c-curve); } .bell .b-axis { stroke: var(--c-axis); }
.bell .b-tick { fill: var(--c-tick); } .bell .b-band { fill: var(--c-band); } .bell .b-f1 { stop-color: var(--c-f1); } .bell .b-f2 { stop-color: var(--c-f2); }
.bell .b-line { stroke: var(--c-marker); } .bell .b-dot { fill: var(--c-marker); stroke: var(--g1); } .bell .b-pill { fill: var(--c-pill); } .bell .b-pill-t { fill: var(--c-pill-ink); }
:root[data-theme="light"] .bell .b-dot { fill: #fff; }

.profile-text { color: var(--ink2); font-size: 15.5px; line-height: 1.6; margin: 0 0 14px; }
.profile-grid { display: grid; grid-template-columns: 360px 1fr; gap: 26px; align-items: center; }
.radar svg { width: 100%; height: auto; display: block; overflow: visible; }
.radar .ring { fill: none; stroke: var(--r-ring); }
.radar .axis { stroke: var(--r-ring); }
.radar .area { fill: var(--r-area); stroke: var(--r-line); stroke-width: 2.2; stroke-linejoin: round; }
.radar .vdot { fill: var(--r-dot); stroke: var(--r-dot-line); stroke-width: 2; }
.radar .lbl { font-size: 13px; font-weight: 600; fill: var(--ink2); }
.radar .lv { fill: var(--muted); font-weight: 600; font-size: 12px; }
.radar .shape { transform-origin: 150px 142px; transform: scale(.2); opacity: 0; transition: transform 1.1s var(--spring), opacity .6s; }
.radar.in .shape { transform: none; opacity: 1; }
.breakdown .row { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin-bottom: 14px; align-items: center; }
.breakdown .rn { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14.5px; flex-wrap: wrap; }
.breakdown .rn .ic { color: var(--acc-ink); }
.breakdown .row .bar { grid-column: 1 / -1; height: 10px; background: var(--track); border-radius: 99px; overflow: hidden; }
.breakdown .row .bar i { display: block; height: 100%; width: 0; background: var(--grad); border-radius: 99px; transition: width 1.4s var(--ease); }
.breakdown .row .val { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 14px; }
.tag { display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 99px; font-weight: 600; vertical-align: 1px; }
.tag.up, .tag.meas { background: rgba(52,211,153,.15); color: var(--ok-ink); } .tag.down, .tag.est { background: rgba(251,191,36,.15); color: var(--warn-ink); }
.tag.claim { background: rgba(244,114,182,.15); color: var(--pink-ink); }
h4.sub { font-size: 15px; margin: 22px 0 12px; color: var(--ink2); }
.levels { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.lvl { text-align: center; }
.lbar { height: 74px; border-radius: 12px; background: var(--soft0); border: 1px solid var(--line); position: relative; overflow: hidden; margin-bottom: 6px; }
.lbar i { position: absolute; left: 0; right: 0; bottom: 0; width: auto !important; height: 0; background: var(--lvl-grad); transition: height 1.3s var(--ease); }
.lbar i[style*="width"] { height: var(--h); }
.lvl b { display: block; font-variant-numeric: tabular-nums; }
.lvl span { font-size: 12px; color: var(--muted); }

.closest { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 16px; background: linear-gradient(135deg, rgba(139,92,246,.18), rgba(34,211,238,.12)); border: 1px solid rgba(139,92,246,.35); margin-bottom: 16px; }
:root[data-theme="light"] .closest { background: linear-gradient(135deg, rgba(124,58,237,.08), rgba(8,145,178,.07)); border-color: rgba(124,58,237,.22); }
.av-stack { display: flex; flex: 0 0 auto; }
.av-stack .avatar { width: 48px; height: 48px; font-size: 16px; border: 2px solid var(--card-solid); }
.av-stack .avatar + .avatar { margin-left: -14px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13.5px; color: #fff; flex: 0 0 auto; letter-spacing: .02em; text-shadow: 0 1px 2px rgba(0,0,0,.3); box-shadow: inset 0 1px 0 rgba(255,255,255,.25); }
.avatar.you { background: #fff; color: #4C1D95; text-shadow: none; font-size: 12.5px; }
:root[data-theme="light"] .avatar.you { background: var(--grad); color: #fff; }
.avatar.avg { background: var(--soft2); border: 1px solid var(--line2); }
.avatar.avg svg { width: 22px; height: 22px; fill: none; stroke: var(--ink2); stroke-width: 1.8; stroke-linecap: round; }
.famous { display: flex; flex-direction: column; gap: 6px; }
.fp { display: grid; grid-template-columns: 38px minmax(140px, 1.2fr) 2fr 52px; align-items: center; gap: 12px; padding: 7px 8px; border-radius: 14px; border: 1px solid transparent; transition: background .2s; }
@media (hover: hover) { .fp:hover { background: var(--soft0); } }
.fp .nm { font-size: 14px; font-weight: 600; line-height: 1.25; min-width: 0; }
.fp .nm .tag { margin-left: 6px; }
.fp .nm small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; margin-top: 1px; }
.fp .tr { height: 10px; background: var(--track); border-radius: 99px; overflow: hidden; }
.fp .tr i { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--fp-grad); transition: width 1.4s var(--ease); }
.fp .iqv { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.fp.you { background: linear-gradient(90deg, rgba(34,211,238,.16), rgba(139,92,246,.12)); border-color: rgba(34,211,238,.4); }
:root[data-theme="light"] .fp.you { background: linear-gradient(90deg, rgba(8,145,178,.09), rgba(124,58,237,.07)); border-color: rgba(8,145,178,.35); }
.fp.you .tr i { background: linear-gradient(90deg, var(--g2), var(--g1)); }
.fp.near { box-shadow: inset 3px 0 0 var(--acc2); }
.famous-note { margin-top: 14px; }

/* review */
.review-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.review-head h3 { margin: 0; }
.seg { display: inline-flex; padding: 4px; border-radius: 12px; background: var(--soft); border: 1px solid var(--line); gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 7px 12px; min-height: 36px; border-radius: 9px; font-size: 13.5px; font-weight: 600; color: var(--muted); cursor: pointer; transition: background .2s, color .2s; -webkit-tap-highlight-color: transparent; }
.seg button span { font-size: 12px; opacity: .8; margin-left: 2px; font-variant-numeric: tabular-nums; }
@media (pointer: coarse) { .seg button { min-height: 44px; } }
.seg button[aria-selected="true"] { background: rgba(139,92,246,.3); color: var(--ink); }
:root[data-theme="light"] .seg button[aria-selected="true"] { background: #fff; color: #4C1D95; box-shadow: 0 1px 3px rgba(46,30,120,.14); }
.review { margin-top: 10px; }
.rv { border-bottom: 1px solid var(--line); }
.rv:last-child { border-bottom: 0; }
.rv-head { width: 100%; min-height: 52px; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto auto 18px; gap: 12px; align-items: center; padding: 10px 6px; background: none; border: 0; cursor: pointer; text-align: left; border-radius: 12px; transition: background .2s; -webkit-tap-highlight-color: transparent; }
@media (hover: hover) { .rv-head:hover { background: var(--soft0); } }
.rv .num { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }
.rv.ok .num { background: rgba(52,211,153,.18); color: var(--ok-ink); } .rv.bad .num { background: rgba(248,113,113,.16); color: var(--bad-ink); } .rv.skip .num { background: var(--soft2); color: var(--muted); }
.rv-t { min-width: 0; }
.rv-t b { display: block; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; hyphens: auto; }
.rv-t small { color: var(--muted); font-size: 12px; }
.rv-st { font-size: 13px; color: var(--muted); white-space: nowrap; }
.rv-st b { color: var(--ink); }
.chip-st { font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 99px; white-space: nowrap; }
.chip-st.ok { background: rgba(52,211,153,.15); color: var(--ok-ink); } .chip-st.bad { background: rgba(248,113,113,.14); color: var(--bad-ink); } .chip-st.skip { background: var(--soft2); color: var(--muted); }
.rv .chev { color: var(--muted); transition: transform .25s var(--ease); }
.rv.open .chev { transform: rotate(180deg); }
.rv-body { padding: 4px 6px 18px 52px; animation: dropIn .3s var(--ease); }
.rv-prompt { margin: 0 0 12px; font-weight: 600; }
.rv-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.rv-stim .stim-matrix svg.matrix { width: min(100%, 300px); }
.rv-stim .stim-single svg { width: min(100%, 260px); }
.rv-stim .facts.big li { font-size: 16px; }
.rv-stim:empty { display: none; }
.rv-answers { display: flex; flex-wrap: wrap; gap: 12px; }
.rv-opt { flex: 0 1 140px; }
.rv-l { display: block; font-size: 12px; font-weight: 600; margin-bottom: 5px; color: var(--muted); }
.rv-opt .opt { cursor: default; animation: none; padding: 10px; min-height: 0; }
.rv-opt .opt svg { max-width: 96px; }
.rv-opt .opt:hover, .rv-opt .opt:active { transform: none; box-shadow: none; }
.rv-opt.right .opt { border-color: var(--ok); background: rgba(52,211,153,.08); }
.rv-opt.right .rv-l { color: var(--ok-ink); }
.rv-opt.yours .opt { border-color: var(--bad); background: rgba(248,113,113,.07); }
.rv-opt.yours .rv-l { color: var(--bad-ink); }
.rv-opt .opt.text { padding: 12px; }
.rv-opt .opt.empty { color: var(--muted); font-size: 13.5px; border-style: dashed; padding: 14px; }
.rv-ex { margin: 14px 0 0; padding: 12px 14px; border-radius: 12px; background: rgba(139,92,246,.08); border: 1px solid rgba(139,92,246,.22); color: var(--ink2); font-size: 14.5px; }
:root[data-theme="light"] .rv-ex { background: rgba(124,58,237,.05); border-color: rgba(124,58,237,.16); }
.rv-ex b { color: var(--acc-ink2); }

details summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 12px; min-height: 44px; -webkit-tap-highlight-color: transparent; }
details summary::-webkit-details-marker { display: none; }
details summary h3 { margin: 0; }
details summary h3::after { content: " ▾"; color: var(--muted); font-size: 14px; }
details[open] summary h3::after { content: " ▴"; }
.method-body p { color: var(--ink2); margin: 10px 0; font-size: 14.5px; }
.result-actions { text-align: center; margin: 8px 0 20px; }

/* ===================================================================== modal / share / toast / footer */
.modal { position: fixed; inset: 0; z-index: 50; background: var(--scrim); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); display: grid; place-items: center; padding: max(20px, var(--sat)) max(16px, var(--sar)) max(20px, var(--sab)) max(16px, var(--sal)); animation: fade .25s; overflow-y: auto; overscroll-behavior: contain; }
.modal-box { max-width: 440px; width: 100%; animation: popIn .35s var(--ease); background: var(--card-solid); margin: 0; position: relative; box-shadow: 0 30px 80px -30px rgba(0,0,0,.6); }
:root[data-theme="light"] .modal-box { box-shadow: 0 30px 80px -30px rgba(46,30,120,.45); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
.share-box { max-width: 640px; }
.share-box .close { position: absolute; top: 12px; right: 12px; }
.share-box h3 { padding-right: 48px; min-height: 30px; display: flex; align-items: center; }
.share-preview { margin: 14px 0 16px; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); aspect-ratio: 1200 / 630; background: var(--stim-bg); position: relative; }
.share-preview img { width: 100%; height: 100%; display: block; }
.share-preview.loading::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, var(--soft2) 50%, transparent 70%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { from { background-position: 150% 0; } to { background-position: -50% 0; } }
.share-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.share-btns .btn { flex: 1 1 160px; }
.toast { position: fixed; left: 50%; bottom: calc(96px + var(--sab)); transform: translateX(-50%); max-width: calc(100vw - 32px); width: max-content; background: var(--toast-bg); color: var(--toast-ink); border: 1px solid var(--line2); padding: 11px 18px; border-radius: 14px; font-size: 14px; z-index: 60; animation: toastIn .35s var(--ease); box-shadow: 0 14px 34px rgba(0,0,0,.35); transition: opacity .3s, transform .3s; text-align: center; pointer-events: none; }
.toast.out { opacity: 0; transform: translate(-50%, 8px); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
.disclaimer { max-width: 760px; margin: 0 auto; padding: 14px max(20px, calc(var(--sar) + 12px)) calc(26px + var(--sab)) max(20px, calc(var(--sal) + 12px)); text-align: center; font-size: 12.5px; color: var(--faint); line-height: 1.55; }
body[data-screen="test"] .disclaimer { display: none; }

/* ===================================================================== responsive */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; text-align: center; gap: 10px; padding-top: 0; }
  .hero-art { max-width: 280px; order: -1; }
  .lead { margin-left: auto; margin-right: auto; }
  .start-actions { justify-content: center; }
  .resume-note { margin: 4px auto 0; }
  .chips { margin: 22px auto 0; }
  .ab-grid { grid-template-columns: repeat(2, 1fr); }
  .intro-grid { grid-template-columns: 1fr; }
  .profile-grid { grid-template-columns: 1fr; }
  .radar { max-width: 400px; margin: 0 auto; width: 100%; }
}
/* touch devices / small screens: drop expensive effects so scrolling stays at 60 fps */
@media (pointer: coarse), (max-width: 640px) {
  .card, .ab-card, .stat { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--card-m); }
  .modal { backdrop-filter: none; -webkit-backdrop-filter: none; }
  /* no live blur while scrolling on phones: near-opaque bars are cheaper and keep 60fps */
  .test-head, .test-foot { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--card-solid); }
  .btn-primary { animation: none; }
  .hero-matrix { filter: none; }
  .g-fg { filter: none; }
  .b3 { display: none; }
}
@media (max-width: 640px) {
  .topbar { padding-top: calc(10px + var(--sat)); padding-left: max(12px, calc(var(--sal) + 8px)); padding-right: max(12px, calc(var(--sar) + 8px)); }
  .brand { font-size: 15px; } .brand-mark { width: 30px; height: 30px; font-size: 13px; border-radius: 9px; }
  #app { padding: 10px max(12px, calc(var(--sar) + 8px)) 10px max(12px, calc(var(--sal) + 8px)); }
  #app.wide { padding-top: 10px; }
  .card { padding: 18px 16px; border-radius: 18px; }
  .hero-art { max-width: 210px; }
  .eyebrow { font-size: 12px; padding: 5px 12px; margin-bottom: 14px; }
  .hero h1 { margin-bottom: 14px; }
  .lead { margin-bottom: 22px; }
  .chips { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .chip { padding: 10px 4px; border-radius: 14px; }
  .chip dt { font-size: 20px; } .chip dd { font-size: 11.5px; }
  .start-actions .btn { flex: 1 1 100%; }
  .ab-grid { grid-template-columns: 1fr; gap: 10px; }
  .ab-card { padding: 14px; }
  .steps { grid-template-columns: 1fr; gap: 14px; }
  .rules h2 { font-size: 22px; }
  .rule-list li { font-size: 14.5px; }
  .practice .options.n6 { grid-template-columns: repeat(3, 1fr); }
  .intro-actions .btn-xl { flex: 1 1 auto; padding: 15px 18px; font-size: 16px; }
  .q-card { padding: 16px 14px 18px; }
  .q-prompt { margin-bottom: 14px; }
  .q-stim { margin-bottom: 16px; }
  .stim-matrix svg.matrix { padding: 8px; border-radius: 18px; }
  .options { gap: 8px; }
  .options.text { grid-template-columns: repeat(2, 1fr); }
  .options.text.long { grid-template-columns: 1fr; }
  .opt { border-radius: 14px; padding: 16px 6px 6px; }
  .opt.text { padding: 13px 32px 12px 28px; font-size: 15px; min-height: 52px; }
  .opt .check { width: 18px; height: 18px; top: 4px; right: 4px; }
  .options:not(.text).n8 .opt { padding: 16px 5px 5px; }
  .options:not(.text).n8 .opt .letter { top: 4px; left: 7px; font-size: 10.5px; }
  .q-counter { font-size: 22px; min-width: 0; }
  .q-type { font-size: 12.5px; gap: 6px; }
  .th-row { gap: 10px; }
  .th-tools { gap: 6px; }
  .timer { font-size: 16px; padding: 4px 10px 4px 6px; }
  .timer-ring { width: 24px; height: 24px; }
  .test-head .theme-toggle { width: 44px; height: 44px; border-radius: 12px; }
  .navigator { gap: 4px; padding: 6px; }
  .test-head { top: calc(6px + var(--sat)); padding: 8px 10px 8px 12px; border-radius: 16px; }
  .progress { margin-top: 8px; }
  .test-foot { bottom: calc(6px + var(--sab)); padding: 8px; border-radius: 16px; gap: 8px; }
  .test-foot .btn { flex: 1 1 0; min-width: 0; justify-content: center; padding: 11px 8px; white-space: nowrap; }
  .test-foot #btn-prev { flex: 0 0 52px; padding: 11px 0; }
  .test-foot #btn-prev span { display: none; }
  .test-foot #btn-next { flex: 1.4 1 0; }
  .stim-seq { gap: 6px; }
  .age-card { margin: 12px auto 24px; padding: 28px 18px; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .iq-number { font-size: 70px; }
  .levels { gap: 6px; }
  .lvl span { font-size: 11px; line-height: 1.2; display: block; }
  .radar .lbl { font-size: 16px; } .radar .lv { font-size: 14px; }
  .fp { grid-template-columns: 34px 1fr 46px; grid-template-areas: "av nm v" "av tr tr"; row-gap: 6px; column-gap: 10px; }
  .fp .avatar { grid-area: av; width: 34px; height: 34px; font-size: 12px; align-self: start; }
  .fp .nm { grid-area: nm; } .fp .tr { grid-area: tr; height: 8px; } .fp .iqv { grid-area: v; align-self: start; }
  .closest { padding: 12px; gap: 12px; }
  .review-head { flex-direction: column; align-items: stretch; }
  .seg { display: grid; grid-template-columns: repeat(4, auto); }
  .seg button { padding: 7px 6px; font-size: 12.5px; min-height: 44px; }
  .rv-head { grid-template-columns: 32px minmax(0, 1fr) auto 16px; gap: 10px; }
  .rv-head .rv-st { display: none; }
  .rv-body { padding: 4px 2px 16px; }
  .rv-grid { grid-template-columns: 1fr; }
  .rv-opt { flex: 1 1 40%; max-width: 180px; }
  .modal-actions .btn { flex: 1 1 auto; }
  .modal-box.card { padding: 20px 16px; }
  .share-box .close { top: 8px; right: 8px; }
  .toast { bottom: calc(84px + var(--sab)); }
}
@media (max-width: 380px) {
  .options:not(.text) { grid-template-columns: repeat(3, 1fr); }
  .test-foot .btn { font-size: 14px; gap: 6px; }
  .q-type { font-size: 11.5px; line-height: 1.3; gap: 4px 6px; }
  .q-type > span:first-child::before { display: none; }
  .q-counter { font-size: 20px; }
  .q-counter small { font-size: 12px; }
  .timer { font-size: 15px; padding: 4px 8px 4px 5px; gap: 5px; }
  .chips { grid-template-columns: repeat(2, 1fr); }
  .seg { grid-template-columns: 1fr 1fr; }
  .hero h1 { font-size: 34px; }
  .iq-gauge { width: 210px; height: 210px; }
  .iq-number { font-size: 64px; }
  .stat b { font-size: 22px; }
  .rv-opt { flex: 1 1 100%; max-width: none; }
}
/* phones in landscape: compact chrome so the question keeps most of the height */
@media (orientation: landscape) and (max-height: 560px) {
  #app.wide { padding-top: 6px; }
  .test-head { top: calc(4px + var(--sat)); padding: 4px 8px 6px 14px; margin-bottom: 8px; border-radius: 14px; display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 10px; align-items: center; }
  .th-row { grid-column: 1; grid-row: 1; }
  .th-meta { grid-column: 2; grid-row: 1; margin: 0; }
  .th-meta #answered-count { display: none; }
  .progress { grid-column: 1 / -1; margin-top: 4px; height: 4px; }
  .navigator { grid-column: 1 / -1; }
  .q-counter { font-size: 20px; }
  .q-prompt { font-size: 16px; margin-bottom: 10px; }
  .navigator { max-height: 46dvh; }
  .q-card.split, .q-card { padding: 12px 18px 14px; }
  .q-card.split { column-gap: 22px; }
  .q-card.split .stim-matrix svg.matrix { width: min(100%, calc(100dvh - 200px), 340px); }
  .q-card.split .stim-single svg { width: min(100%, calc(100dvh - 210px)); }
  .q-card.split .options { gap: 8px; }
  .q-card.split .options:not(.text) .opt { aspect-ratio: auto; min-height: 0; padding: 16px 6px 4px; }
  .q-card.split .options:not(.text) .opt svg { max-width: min(110px, calc((100dvh - 250px) / 2)); }
  .test-foot { padding: 5px; bottom: calc(4px + var(--sab)); }
  .test-foot .btn { min-height: 44px; padding-top: 8px; padding-bottom: 8px; }
  .age-card { margin: 10px auto; padding: 20px 18px; }
  .age-icon { width: 52px; height: 52px; font-size: 24px; margin-bottom: 10px; }
  .hero-art { max-width: 200px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; animation-delay: 0ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .blob, .orb { animation: none !important; }
}
