@font-face{font-family:"Source Serif 4";src:url(fonts/sourceserif4-normal-400_700-latin.woff2) format("woff2");font-weight:400 700;font-display:swap;unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Source Serif 4";src:url(fonts/sourceserif4-normal-400_700-latin-ext.woff2) format("woff2");font-weight:400 700;font-display:swap;unicode-range:U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:"Source Serif 4";src:url(fonts/sourceserif4-italic-400_600-latin.woff2) format("woff2");font-weight:400 600;font-style:italic;font-display:swap;unicode-range:U+0000-00FF,U+2000-206F,U+2212}
@font-face{font-family:"Source Serif 4";src:url(fonts/sourceserif4-italic-400_600-latin-ext.woff2) format("woff2");font-weight:400 600;font-style:italic;font-display:swap;unicode-range:U+0100-02AF,U+1E00-1EFF}
@font-face{font-family:"Barlow SC";src:url(fonts/barlowsemicondensed-normal-500-latin.woff2) format("woff2");font-weight:500;font-display:swap;unicode-range:U+0000-00FF,U+2000-206F,U+2212}
@font-face{font-family:"Barlow SC";src:url(fonts/barlowsemicondensed-normal-500-latin-ext.woff2) format("woff2");font-weight:500;font-display:swap;unicode-range:U+0100-02AF,U+1E00-1EFF}
@font-face{font-family:"Barlow SC";src:url(fonts/barlowsemicondensed-normal-600-latin.woff2) format("woff2");font-weight:600;font-display:swap;unicode-range:U+0000-00FF,U+2000-206F,U+2212}
@font-face{font-family:"Barlow SC";src:url(fonts/barlowsemicondensed-normal-600-latin-ext.woff2) format("woff2");font-weight:600;font-display:swap;unicode-range:U+0100-02AF,U+1E00-1EFF}

:root{
  --serif:"Source Serif 4",Georgia,serif;--label:"Barlow SC","Arial Narrow",system-ui,sans-serif;
  --bg:#e9ecef;--card:#f6f7f8;--fg:#14171b;--mut:#565e69;--line:#c4cbd3;--line-soft:#d5dbe1;
  --acc:#c2412a;--field:#777c82;--field-dot:#ffffff;--kid:#3c4652;--med:#14171b;--chance:#8a6d1e;
  --better:#2f7d6b;--same:#9aa3ad;--worse:#b8643f;
  --col:64rem;--measure:40rem;color-scheme:light;
}
html[data-theme="dark"]{
  --bg:#101317;--card:#181c21;--fg:#e6e9ec;--mut:#9aa3ae;--line:#323942;--line-soft:#283039;
  --acc:#ff7a5c;--field:#6f747a;--kid:#b9c4d0;--med:#f2f4f6;--chance:#e2bf5b;
  --better:#5cbfa6;--same:#6c7580;--worse:#e08a62;color-scheme:dark;
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;scroll-padding-top:56px}
body{margin:0;background:var(--bg);color:var(--fg);font:1.0625rem/1.6 var(--serif);text-rendering:optimizeLegibility}
a{color:inherit;text-decoration-thickness:1px;text-underline-offset:.18em}
a:hover{color:var(--acc)}
:focus-visible{outline:2px solid var(--acc);outline-offset:2px}
.skip{position:absolute;left:-999px;top:0;background:var(--fg);color:var(--bg);padding:.5rem 1rem;z-index:99}
.skip:focus{left:.5rem;top:.5rem}

.topbar{position:sticky;top:0;z-index:50;display:flex;align-items:center;gap:1rem;height:48px;padding:0 max(1rem,env(safe-area-inset-right)) 0 max(1rem,env(safe-area-inset-left));
  background:color-mix(in srgb,var(--bg) 92%,transparent);border-bottom:1px solid var(--line-soft);font:500 .92rem/1 var(--label);letter-spacing:.02em}
.topbar .home{display:flex;align-items:center;gap:.5rem;text-decoration:none;font-weight:600}
.topbar .home svg{width:22px;height:22px}
.topbar nav{display:flex;gap:1.1rem}
.topbar nav a{text-decoration:none;color:var(--mut)}
.topbar nav a:hover{color:var(--acc)}
.topbar .sp{flex:1}
.icon-btn{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:50%;border:1px solid transparent;background:none;color:inherit;cursor:pointer;text-decoration:none;font:600 .8rem var(--label)}
.icon-btn:hover{border-color:var(--line)}
.icon-btn svg{width:19px;height:19px}
@media (max-width:760px){.topbar nav{display:none}}

main{display:block}
section{padding:3.2rem 1.25rem}
.prose,.wide>h2,.wide>.prose{max-width:var(--measure);margin-left:auto;margin-right:auto}
section.prose{max-width:calc(var(--measure) + 2.5rem)}
.wide{max-width:calc(var(--col) + 2.5rem);margin:0 auto}
h1,h2,h3{font-weight:650;line-height:1.15;letter-spacing:-.01em}
h1{font-size:clamp(1.9rem,1.3rem + 2.6vw,3.05rem);margin:.2rem 0 .9rem;text-wrap:balance}
h2{font-size:clamp(1.45rem,1.2rem + 1vw,1.95rem);margin:0 0 1rem;text-wrap:balance}
h3{font-size:1.1rem;margin:2rem 0 .6rem}
p{margin:0 0 1rem}
.kicker{font:600 .85rem/1 var(--label);letter-spacing:.12em;text-transform:uppercase;color:var(--acc);margin:0}
.deck{font-size:1.14rem;color:var(--fg);max-width:38rem}
.cap,.small{font:500 .88rem/1.45 var(--label);color:var(--mut);letter-spacing:.01em}
.cap{max-width:var(--measure);margin:.8rem auto 0}

/* hero + test */
.hero{max-width:calc(var(--col) + 2.5rem);margin:0 auto;padding-top:2rem;display:grid;grid-template-columns:1fr;gap:1.4rem}
.play{display:grid;grid-template-columns:minmax(0,1fr);gap:1.4rem;align-items:start}
@media (min-width:980px){
  .hero{grid-template-columns:minmax(0,1fr) minmax(0,27rem);grid-template-areas:"intro stage" "answer stage";column-gap:2.6rem;row-gap:1.2rem;padding-top:2.2rem;align-items:start}
  .intro{grid-area:intro}
  .play{display:contents}
  .stage{grid-area:stage;position:sticky;top:64px}
  .answer{grid-area:answer}
  .deck{font-size:1.08rem}
}
.stage{background:var(--card);border:1px solid var(--line-soft);border-radius:14px;padding:1rem;display:flex;flex-direction:column;gap:.8rem}
.ringbox{aspect-ratio:1/1;width:100%;max-width:min(26rem,62svh);margin:0 auto;border-radius:10px;overflow:hidden;touch-action:manipulation}
.ring{display:block;width:100%;height:100%}
.ring .field{fill:var(--field)}
.ring .fix{fill:#e7d34a}
.ring .ring-o{fill:none;stroke:var(--field-dot);stroke-width:1.6;opacity:.85}
.ring .fill{fill:var(--field-dot);opacity:0;transition:opacity 90ms linear}
.ring .hit{fill:transparent}
.ring .dot.on .fill{opacity:1;transition:none}
.ringbox.input .dot{cursor:pointer}
.ringbox.input .dot:hover .ring-o{stroke-width:3}
.ringbox.input .dot:focus{outline:none}
.ringbox.input .dot:focus-visible .ring-o{stroke:var(--acc);stroke-width:3.5}
.ring .dot.tap .fill{opacity:.55;transition:none}
.status{min-height:3em;margin:0;font:500 1rem/1.4 var(--label);text-align:center;color:var(--fg)}
.controls{display:flex;flex-wrap:wrap;gap:.5rem .7rem;align-items:center;justify-content:center}
.controls label{font:500 .9rem var(--label);color:var(--mut);width:100%;text-align:center}
.controls select{font:500 .98rem var(--label);padding:.55rem .7rem;border-radius:8px;border:1px solid var(--line);background:var(--bg);color:var(--fg);max-width:100%;min-height:44px}
.go{font:600 1rem var(--label);letter-spacing:.02em;padding:.65rem 1.3rem;min-height:44px;border-radius:999px;border:0;background:var(--acc);color:#fff;cursor:pointer}
.go:hover{filter:brightness(1.08)}
html[data-theme="dark"] .go{color:#1a0d09}
.play.running .controls label,.play.running select{display:none}
.ghost{font:500 .92rem var(--label);padding:.5rem .9rem;min-height:44px;border-radius:999px;border:1px solid var(--line);background:none;color:var(--fg);cursor:pointer}
.ghost:hover{border-color:var(--acc);color:var(--acc)}
.answer{display:flex;flex-direction:column;gap:1rem;min-width:0}
.teaser,.result{margin:0}
.teaser-svg,.res-svg{display:block;width:100%;height:auto;max-width:34rem}
.teaser figcaption{font:500 .92rem/1.45 var(--label);color:var(--mut);max-width:32rem}
.rh{font-size:1.3rem;margin:0 0 .4rem}
#resText p{margin:.5rem 0}
#resText .lead{font-size:1.12rem;font-weight:600}
.resbtns{display:flex;gap:.5rem;flex-wrap:wrap;margin-top:.8rem}
.share-row{margin-top:.2rem}
.share-btn svg{width:18px;height:18px}
.share-status{font:500 .85rem var(--label);color:var(--mut)}

/* charts */
svg text{font-family:var(--label);fill:var(--mut)}
.grid{stroke:var(--line-soft);stroke-width:1}
.ax{font-size:10.5px}
.kid{fill:none;stroke:var(--kid);stroke-width:1;stroke-linejoin:round}
.med{fill:none;stroke:var(--med);stroke-width:3;stroke-linejoin:round;stroke-linecap:round}
.chance{stroke:var(--chance);stroke-width:1.6;stroke-dasharray:3 4}
.you{fill:none;stroke:var(--acc);stroke-width:3.4;stroke-linejoin:round;stroke-linecap:round}
.you-p{fill:var(--acc);stroke:var(--card);stroke-width:1.5}
.lab{font-size:12px;font-weight:600}
.you-l{fill:var(--acc)}
.tl{fill:none;stroke-width:3;stroke-linejoin:round}
.tl.young{stroke:var(--med)}.tp.young{fill:var(--med)}
.tl.old{stroke:var(--better)}.tp.old{fill:var(--better)}
.tlab{font-size:12px;font-weight:600}
.tlab.young{fill:var(--med)}.tlab.old{fill:var(--better)}
.mt{font-size:13px;font-weight:600;fill:var(--fg)}
.mn{font-size:11px}
.legend{display:flex;flex-wrap:wrap;gap:.4rem 1.1rem;font:500 .85rem var(--label);color:var(--mut);max-width:var(--col);margin:1.2rem auto .6rem}
.legend span{display:inline-flex;align-items:center;gap:.35rem}
.legend i{display:inline-block;width:18px;height:0;border-top:3px solid}
.legend .lk{border-top:1px solid var(--kid);opacity:.7}
.legend .lm{border-color:var(--med)}
.legend .ly{border-color:var(--acc)}
.legend .lc{border-top:2px dashed var(--chance)}
.legend .lvfkey i{width:12px;height:12px;border:0;border-radius:2px;margin-left:.4rem}
.legend .lvfkey i:first-child{margin-left:0}
i.better{background:var(--better)}i.same{background:var(--same)}i.worse{background:var(--worse)}
.multi{display:grid;grid-template-columns:repeat(auto-fill,minmax(15.5rem,1fr));gap:1.3rem 1.6rem}
.cell{margin:0;min-width:0}
.mini{display:block;width:100%;height:auto}
.lvf{display:flex;height:22px;border-radius:4px;overflow:hidden;margin:.3rem 0 0 30px;font:600 .74rem/22px var(--label);color:#fff;text-align:center}
.lvf .seg{min-width:2px;white-space:nowrap;overflow:hidden}
.lvf .better{background:var(--better)}.lvf .same{background:var(--same);color:#14171b}.lvf .worse{background:var(--worse)}
html[data-theme="dark"] .lvf .better,html[data-theme="dark"] .lvf .worse{color:#101317}
html[data-theme="dark"] .lvf .same{color:#e6e9ec}
.lvf.res{margin:1rem 0 0;height:30px;line-height:30px;font-size:.8rem}
.lvf.res .seg:not(.mine){opacity:.45}
.lvf.res .mine{box-shadow:inset 0 0 0 2px var(--fg)}

/* table */
.tablewrap{overflow-x:auto;border:1px solid var(--line-soft);border-radius:10px;background:var(--card)}
table{border-collapse:collapse;width:100%;font:500 .9rem/1.35 var(--label);min-width:44rem}
th,td{padding:.6rem .7rem;text-align:left;border-bottom:1px solid var(--line-soft);vertical-align:top}
thead th{font-weight:600;color:var(--mut);font-size:.82rem}
tbody th{font-weight:600}
td.n{font-variant-numeric:tabular-nums;white-space:nowrap}
.vs{color:var(--mut)}
tbody tr:last-child th,tbody tr:last-child td{border-bottom:0}

.licence{font-size:.95rem;border-left:3px solid var(--line);padding-left:.9rem}
.sources{padding-left:1.2rem;font-size:.92rem}
.sources li{margin:.4rem 0;overflow-wrap:anywhere}
.related{padding-left:1.2rem}
footer{display:flex;flex-wrap:wrap;gap:.5rem 1.4rem;justify-content:center;padding:2rem 1rem calc(2rem + env(safe-area-inset-bottom));border-top:1px solid var(--line-soft);font:500 .88rem var(--label);color:var(--mut)}

@media (prefers-reduced-motion:reduce){*{transition:none!important;scroll-behavior:auto!important}}
@media print{.topbar,.rail,.play .stage,.share-row,footer{display:none}}

/* rail sits beside the widest column (64rem + padding), hidden where that gutter is missing */
@media (min-width:1100px){html .rail{--col:66.5rem;--gut:1rem}}
@media (max-width:1259px){html .rail{display:none}}

/* with a result on screen the deck folds away so the answer sits beside the ring */
.hero.has-result .deck{display:none}
.hero.has-result h1{font-size:clamp(1.5rem,1.1rem + 1.6vw,2.2rem)}
.icon-btn .ic-sun,.icon-btn .ic-moon{display:inline-flex}
@media (max-width:979px){.hero{padding-top:1.2rem}.deck{font-size:1rem;line-height:1.55}}
@media (max-width:979px){.hero.has-result .answer{order:-1}.hero.has-result .intro .kicker{display:none}}
.tsub{font-size:10.5px}.tsub.young{fill:var(--med)}.tsub.old{fill:var(--better)}
.legend .sep{display:none}
