@font-face { font-family: "Chango"; src: url("fonts/chango-latin-400-normal.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 400; src: url("fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 700; src: url("fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2"); font-display: swap; }
:root {
  --tape: #ffcb05; --ink: #2b1055; --paper: #ffffff; --needle: #e8173f; --truth: #00806e; --lilac: #e6dcff; --mint: #6be0c6; --peach: #ffb1a8;
  --display: "Chango", "Arial Black", sans-serif; --body: "Atkinson Hyperlegible", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--tape); color: var(--ink); font: 400 17px/1.45 var(--body); min-height: 100dvh; overscroll-behavior-y: none; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--needle); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.noscript { padding: 24px; }
.app { max-width: 720px; margin: 0 auto; padding: max(10px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); min-height: 100dvh; display: flex; flex-direction: column; }

/* home */
.screen-home .hero { text-align: center; padding-top: clamp(14px, 4vh, 44px); }
.logo { font: 400 clamp(48px, 15vw, 104px)/1 var(--display); margin: 0; letter-spacing: -.01em; }
.tag { font-size: clamp(19px, 3.4vw, 24px); font-weight: 700; margin: 4px 0 clamp(10px, 2.4vh, 22px); }
.big-number { display: block; font: 400 clamp(26px, 8.2vw, 60px)/1.05 var(--display); text-align: center; font-variant-numeric: tabular-nums; }
.big-number.small { font-size: clamp(25px, 7.4vw, 44px); min-height: 1.5em; line-height: 1.5; }
.big-number.small.long { font-size: clamp(18px, 5.4vw, 34px); line-height: 2; }
.screen-home .big-number { min-height: 1.1em; margin-bottom: 10px; }
.tape-wrap { margin: 0 -16px; flex: 1 1 auto; min-width: 0; }
.tape { display: block; width: 100%; height: 84px; background: var(--paper); border-block: 3px solid var(--ink); touch-action: pan-y; cursor: grab; user-select: none; }
.tape.dragging { cursor: grabbing; }
.tape:focus-visible { outline-offset: -5px; }
.menu { display: grid; gap: 12px; margin-top: clamp(14px, 3vh, 26px); }
.cta { display: block; width: 100%; text-align: center; background: var(--ink); color: var(--tape); border: 3px solid var(--ink); border-radius: 16px; padding: 14px 16px; }
.cta span { display: block; font: 400 clamp(19px, 5vw, 24px)/1.2 var(--display); }
.cta small { display: block; color: #fff; font-size: 15px; margin-top: 3px; }
.cta.alt { background: transparent; color: var(--ink); }
.cta.alt small { color: var(--ink); }
.cta:hover { filter: brightness(1.25); }
.cta.alt:hover { background: rgba(43,16,85,.08); filter: none; }
.cta:active { transform: translateY(2px); }
.stats { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 22px; margin: 2px 0 0; padding: 0; font-size: 15px; }
.stats b { font: 400 18px var(--display); margin-right: 3px; }
.foot { margin-top: auto; padding-top: 18px; text-align: center; }
.foot nav { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 18px; }
.link { background: none; border: 0; padding: 8px 2px; text-decoration: underline; text-underline-offset: 3px; font-size: 16px; }
.fine { font-size: 14px; margin: 6px 0 0; }
.icon { width: 44px; height: 44px; flex: none; background: transparent; border: 0; border-radius: 12px; display: grid; place-items: center; padding: 0; }
.icon svg { width: 26px; height: 26px; fill: var(--ink); }
.icon svg .ln { fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; }
.icon:hover { background: rgba(43,16,85,.1); }

/* top bar */
.bar { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.pips { flex: 1; display: flex; gap: 4px; justify-content: center; }
.pips i { display: block; flex: 0 1 22px; height: 12px; min-width: 8px; border: 2px solid var(--ink); border-radius: 4px; }
.pips i.now { background: var(--paper); }
.pips i.g-right, .pips i.g-bull, .pips i.g-close { background: var(--truth); }
.pips i.g-near { background: var(--mint); }
.pips i.g-miss { background: var(--ink); }
.hearts { flex: 1; display: flex; gap: 2px; justify-content: center; }
.hearts span { width: 26px; height: 26px; }
.hearts svg { width: 100%; height: 100%; fill: var(--needle); stroke: var(--ink); stroke-width: 1.6; }
.hearts .gone svg { fill: transparent; }
.score { font: 400 25px var(--display); min-width: 2.4em; text-align: right; }

/* question */
.q { font-size: clamp(23px, 6vw, 34px); line-height: 1.22; font-weight: 700; margin: clamp(8px, 2.4vh, 26px) 0 clamp(12px, 2.4vh, 24px); text-wrap: balance; }
.seg { display: flex; border: 3px solid var(--ink); border-radius: 12px; overflow: hidden; margin-bottom: 14px; }
.seg button { flex: 1; background: transparent; border: 0; padding: 8px 6px; font-weight: 700; font-size: 16px; min-height: 42px; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--tape); }
.ladder { display: grid; gap: 8px; }
.choice { display: flex; align-items: center; gap: 10px; background: var(--paper); border: 3px solid var(--ink); border-radius: 12px; padding: 8px 12px; font: 400 clamp(15px, 4.3vw, 20px)/1.2 var(--display); text-align: left; min-height: clamp(54px, 8.4vh, 72px); }
/* wider rung = bigger number: the answer buttons form a staircase */
.choice.s0 { width: 66%; } .choice.s1 { width: 77%; } .choice.s2 { width: 88%; } .choice.s3 { width: 100%; }
.choice kbd { font: 700 13px var(--body); }
@media (pointer: coarse) { .choice kbd { display: none; } }
.choice:hover { background: var(--lilac); }
.choice.on { background: var(--ink); color: var(--tape); }
.tape-row { display: flex; align-items: center; margin: 0 -16px; }
.tape-row .tape-wrap { margin: 0; }
.step { flex: none; width: 54px; height: 84px; background: var(--ink); color: var(--tape); border: 0; font-weight: 700; font-size: 17px; }
.hint { text-align: center; font-size: 15px; margin: 8px 0 0; }
.stake { margin-top: 14px; }
.sure { font-weight: 700; margin: 0 0 8px; text-align: center; }
.stakes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.st { background: var(--paper); border: 3px solid var(--ink); border-radius: 12px; padding: 8px 4px; display: flex; flex-direction: column; align-items: center; line-height: 1.2; min-height: 96px; justify-content: center; }
.st b { font: 400 24px var(--display); }
.st span { font-weight: 700; font-size: 15px; text-align: center; }
.st small { font-size: 13px; }
.st:hover { background: var(--lilac); }
.st3 { background: var(--ink); color: var(--tape); }
.st3 small { color: #fff; }
.st3:hover { background: #43207a; }
.stake.open { animation: rise .16s ease-out; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* after an answer */
.q-small { font-size: 16px; font-weight: 700; margin: 6px 0 10px; }
.revealed .tape-wrap { flex: none; }
.verdict { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 12px 0 8px; }
.verdict h1 { font: 400 clamp(25px, 7vw, 38px)/1.1 var(--display); margin: 0; }
.pts { font: 400 clamp(21px, 5.6vw, 28px) var(--display); white-space: nowrap; }
.pts { background: var(--ink); color: var(--tape); padding: 2px 10px; border-radius: 10px; }
.revealed.g-miss .pts { color: #fff; background: var(--needle); }
.facts { margin: 0 0 10px; display: grid; gap: 6px; }
.facts div { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; border-bottom: 2px solid rgba(43,16,85,.25); padding-bottom: 4px; }
.facts dt { font-size: 15px; flex: none; }
.facts dd { margin: 0; font-weight: 700; text-align: right; }
.yr, .off { font-weight: 400; font-size: 15px; display: inline-block; }
.why { font-size: clamp(18px, 4.6vw, 20px); line-height: 1.35; margin: 4px 0 8px; }
.src { font-size: 15px; margin: 0 0 14px; }
.revealed .cta { position: sticky; bottom: max(12px, env(safe-area-inset-bottom)); margin-top: 6px; }

/* free play */
.h { font: 400 clamp(26px, 7vw, 38px)/1.1 var(--display); margin: 8px 0 14px; text-align: center; }
.topics { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.topic { background: var(--paper); border: 3px solid var(--ink); border-radius: 14px; padding: 14px 12px; min-height: 76px; display: flex; flex-direction: column; justify-content: center; font-weight: 700; font-size: 18px; line-height: 1.2; text-align: left; }
.topic small { font-weight: 400; font-size: 14px; }
.topic:hover { background: var(--lilac); }
.topic:first-child { grid-column: 1 / -1; background: var(--ink); color: var(--tape); }
.topic:first-child small { color: #fff; }
.check { display: flex; align-items: center; gap: 10px; margin: 16px 0; font-size: 16px; min-height: 44px; }
.check input { width: 24px; height: 24px; accent-color: var(--ink); }

/* end */
.screen-end { text-align: center; }
.end-score { font-size: clamp(60px, 22vw, 120px); margin: 2px 0; }
.sub { margin: 0 0 12px; font-size: 18px; }
.result-row { display: flex; justify-content: center; gap: 5px; margin-bottom: 8px; }
.result-row i { width: min(8vw, 34px); height: min(8vw, 34px); border: 2px solid var(--ink); border-radius: 6px; }
.result-row .g-right, .result-row .g-close { background: var(--truth); }
.result-row .g-bull { background: var(--truth); box-shadow: inset 0 0 0 4px var(--paper); }
.result-row .g-near { background: var(--mint); }
.result-row .g-miss { background: var(--ink); }
.legend { font-size: 14px; margin: 0 0 10px; }
.screen-end .stats { margin-bottom: 14px; }
.screen-end .cta { margin-top: 8px; }
.copied { min-height: 1.4em; margin: 6px 0; font-size: 15px; font-weight: 700; }
.sharebox { background: var(--paper); border: 2px solid var(--ink); padding: 8px; border-radius: 8px; text-align: left; white-space: pre-wrap; user-select: all; }

/* how to */
.sheet-back { position: fixed; inset: 0; background: rgba(43,16,85,.55); display: grid; place-items: end center; padding: 12px; z-index: 5; overflow: auto; }
.sheet { background: var(--paper); border: 3px solid var(--ink); border-radius: 18px; padding: 18px; max-width: 520px; width: 100%; animation: rise .18s ease-out; }
.sheet h2 { font: 400 26px/1.1 var(--display); margin: 0 0 8px; }
.sheet ol { margin: 0 0 8px; padding-left: 22px; display: grid; gap: 8px; }
.sheet p { margin: 0 0 12px; }

/* sources page */
.page { max-width: 760px; margin: 0 auto; padding: 16px; }
.page h1 { font: 400 clamp(32px, 9vw, 54px)/1 var(--display); margin: 6px 0; }
.page h2 { font: 400 26px/1.1 var(--display); margin: 28px 0 8px; }
.page .item { background: var(--paper); border: 2px solid var(--ink); border-radius: 12px; padding: 10px 12px; margin: 10px 0; overflow-wrap: anywhere; }
.page .item:target { outline: 4px solid var(--needle); }
.page .item p { margin: 0 0 4px; }
.page .item .ans { font-weight: 700; }
.page .item ul { margin: 2px 0 0; padding-left: 18px; font-size: 15px; }
.page .note { font-size: 14px; margin: 4px 0 0; }
.page .back { display: inline-block; padding: 8px 0; font-weight: 700; }
.page details { margin: 10px 0; }
html[lang="en"] [data-l="fr"], html[lang="fr"] [data-l="en"] { display: none; }

@media (min-width: 760px) and (min-height: 501px) {
  .tape { height: 96px; }
  .step { height: 96px; }
  .sheet-back { place-items: center; }
  .app { padding-left: 24px; padding-right: 24px; }
  .tape-wrap, .tape-row { margin-left: calc(50% - 50vw + 8px); margin-right: calc(50% - 50vw + 8px); }
  .tape-row .tape-wrap { margin: 0; }
}
@media (max-height: 640px) {
  .q { font-size: 20px; margin: 4px 0 8px; }
  .screen-home .hero { padding-top: 4px; }
  .logo { font-size: 44px; }
  .seg { margin-bottom: 8px; }
  .choice { min-height: 46px; padding: 6px 10px; }
  .st { min-height: 78px; }
}
@media (max-height: 500px) {
  .revealed .cta { position: static; }
  .ladder { grid-template-columns: 1fr 1fr; }
  .choice.s0, .choice.s1, .choice.s2, .choice.s3 { width: 100%; }
  .stake { margin-top: 8px; }
  .sure { display: none; }
  .st { min-height: 56px; flex-direction: row; gap: 6px; flex-wrap: wrap; }
  .st small { display: none; }
  .tape, .step { height: 70px; }
  .screen-home .hero { padding-top: 0; }
  .logo { font-size: 38px; }
  .tag { margin-bottom: 4px; }
  .menu { grid-template-columns: 1fr 1fr; margin-top: 10px; }
  .menu .stats { grid-column: 1 / -1; }
  .foot { padding-top: 6px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
