/* Outlier (clipsie.app/play). One engine, two editions:
     europe  paper and ink, a night train across Europe: stops, kilometres, a stamp per answer
     gaming  Clipsie dark, a live stream: viewers, loot rarities, chat showing what others said
   Layout, spacing and restraint follow the Mercury rebuild (Dokumentation/Design-Research/Mercury/
   SPEC.md): hairlines, radii 8/12/999, pills, no shadows except the sheet. Fonts: Manrope and Space
   Grotesk from /assets/fonts, Fraunces (OFL, play/fonts) for the Europe edition. */

@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 300 900; font-display: swap;
  src: url(fonts/fraunces-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; }
@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 300 900; font-display: swap;
  src: url(fonts/fraunces-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --font-body: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Space Grotesk', 'Manrope', system-ui, sans-serif;
  --font-head: var(--font-display);
  /* base = Clipsie dark (also the review view and the not-found page) */
  --bg: #17151F; --surface: #1E1C28; --surface-2: #282534;
  --line: rgba(190, 182, 214, .12); --line-2: rgba(190, 182, 214, .32);
  --text: #FFFFFF; --t2: #DEDBE6; --t3: #C4C0CE; --muted: #B1ADBC; --faint: #8E8A9B;
  --link: #FF7D9B; --accent: #FF3D6E; --btn: #C8194A; --btn-h: #B01540; --btn-text: #fff;
  --fill: rgba(180, 183, 200, .12); --fill-h: rgba(175, 178, 206, .20); --hover: rgba(175, 178, 206, .08);
  --bar: #FF3D6E; --bar-low: #C9FF4D;
  --t-t10: #9C98A8; --t-clever: #E8A25B; --t-t30: #EBCF5E; --t-t60: #5BC48D; --t-t85: #7FB2FF; --t-first: #2DD4BF; --t-t100: #FF3D6E;
  --t-miss: #716D7E; --t-pending: #B1ADBC; --t-timeout: #716D7E;
  --on-tier: #17151F;
  color-scheme: dark;
}

/* ---------- Europe: warm paper, navy ink, stamp red ---------- */
body[data-edition="europe"] {
  --font-head: 'Fraunces', Georgia, serif;
  --bg: #F3EEE4; --surface: #FBF8F2; --surface-2: #EAE3D6;
  --line: rgba(29, 34, 64, .12); --line-2: rgba(29, 34, 64, .28);
  --text: #1D2240; --t2: #2E3352; --t3: #474A63; --muted: #6B6455; --faint: #8F8676;
  --link: #B02A33; --accent: #C8323C; --btn: #1D2240; --btn-h: #2C3360; --btn-text: #F3EEE4;
  --fill: rgba(29, 34, 64, .07); --fill-h: rgba(29, 34, 64, .12); --hover: rgba(29, 34, 64, .05);
  --bar: #C8323C; --bar-low: #C8323C;
  --t-t10: #8F8676; --t-clever: #C27A2C; --t-t30: #2E6E9E; --t-t60: #2F7D53; --t-t85: #6A3FA0; --t-first: #0E8A8C; --t-t100: #C8323C;
  --t-miss: #A39A89; --t-pending: #8F8676; --t-timeout: #A39A89;
  --on-tier: #FBF8F2;
  color-scheme: light;
}

/* ---------- Gaming & Streaming: Clipsie dark, loot rarities ---------- */
body[data-edition="gaming"] {
  --bg: #0F0E15; --surface: #18161F; --surface-2: #221F2C;
  --bar: #FF3D6E; --bar-low: #C9FF4D;
  --t-t10: #A7A3B3; --t-clever: #FFC53D; --t-t30: #4ADE80; --t-t60: #4DA3FF; --t-t85: #B57BFF; --t-first: #22D3EE; --t-t100: #FF3B4E;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100dvh; background: var(--bg); color: var(--text);
  font: 500 16px/1.5 var(--font-body); -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column;
  transition: background-color .3s ease-out, color .3s ease-out;
}
body.is-booting .top, body.is-booting .app { visibility: hidden; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--font-head); font-weight: 500; letter-spacing: -.02em; margin: 0; }
.num { font-family: var(--font-head); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- top bar ---------- */
.top { height: 64px; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; flex: none; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-size: 19px; font-weight: 600; letter-spacing: -.01em; }
.brand .mark { width: 28px; height: 28px; }
.top-l { display: flex; align-items: center; gap: 8px; }
.by { font-size: 13px; font-weight: 500; color: var(--faint); text-decoration: none; padding-top: 4px; }
.by:hover { color: var(--text); }
.top-r { display: flex; align-items: center; gap: 4px; }
.tbtn { height: 32px; padding: 0 12px; border: 0; border-radius: 999px; background: none; color: var(--t2); font-size: 15px; cursor: pointer; transition: background-color .16s ease-out, color .16s ease-out; }
.tbtn:hover { background: var(--hover); color: var(--text); }
.tbtn.on { background: var(--fill); color: var(--text); }
.ibtn { width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 999px; background: none; color: var(--t2); cursor: pointer; transition: background-color .16s ease-out; }
.ibtn:hover { background: var(--hover); color: var(--text); }
.ibtn svg { width: 18px; height: 18px; }
.ibtn .snd-on { display: none; }
.ibtn[aria-pressed="true"] .snd-on { display: inline; }
.ibtn[aria-pressed="true"] .snd-off { display: none; }

/* ---------- scene layer (themes draw here, behind the UI) ---------- */
/* The scene is sized to the LARGEST viewport (lvh) and pinned to the top, so the phone's URL bar
   coming and going never resizes or moves it (that made the train and the vault twitch on scroll). */
#scene { position: fixed; left: 0; top: 0; width: 100%; height: 100vh; height: 100lvh; z-index: 0; pointer-events: none; overflow: hidden; contain: strict; }
.top { position: relative; z-index: 2; }
.app { position: relative; z-index: 1; }

/* ---------- reveal climb (engine; themes restyle) ---------- */
.stage { position: relative; }
.climb-meter { display: flex; align-items: baseline; justify-content: center; gap: 12px; margin: 8px 0 4px; font-variant-numeric: tabular-nums; }
.climb-meter .cm-tier { font: 600 22px/28px var(--font-head); color: var(--tc); transition: color .12s linear; }
.climb-meter .cm-share { font-size: 15px; color: var(--t2); min-width: 9em; text-align: left; }
.reveal.is-climbing .stage { cursor: pointer; }
.rarest { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: -16px 0 24px; font-size: 14px; color: var(--t2); }
.rarest b { color: var(--text); font-weight: 600; }
.est { font-size: 11px; color: var(--faint); letter-spacing: .2px; }

/* ---------- layout ---------- */
.app { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 16px 24px 72px; display: flex; flex-direction: column; }
.app.wide { max-width: 1040px; }
.screen { animation: rise .32s ease-out both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
/* an edition switch is a cut, not a fade from nothing: the new screen and scene start at full strength */
.screen.still { animation: none; }
#scene.swap, #scene.swap * { transition: none !important; }

/* ---------- buttons ---------- */
.btn { height: 40px; padding: 0 20px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; font-size: 16px; font-weight: 500; line-height: 1; white-space: nowrap; cursor: pointer;
  text-decoration: none; transition: background-color .16s ease-out, color .16s ease-out; }
.btn-primary { background: var(--btn); color: var(--btn-text); font-weight: 600; }
.btn-primary:hover { background: var(--btn-h); }
.btn-ghost { background: var(--fill); color: var(--t2); }
.btn-ghost:hover { background: var(--fill-h); color: var(--text); }
.btn-lg { height: 48px; padding: 0 28px; }
.btn-sm { height: 32px; padding: 0 14px; font-size: 14px; }
.btn[disabled] { background: var(--fill); color: var(--muted); cursor: default; }
.kbd { font-size: 12px; font-weight: 600; opacity: .75; border: 1px solid currentColor; border-radius: 4px; padding: 0 5px; line-height: 16px; }
.link { color: var(--link); text-decoration: none; font-size: 15px; cursor: pointer; background: none; border: 0; padding: 0; }
.link:hover { color: var(--text); }

.seg { display: inline-flex; gap: 4px; }
.seg button { height: 32px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 8px; background: none; color: var(--t2); font-size: 15px; cursor: pointer; transition: background-color .16s ease-out; }
.seg button:hover { background: var(--hover); }
.seg button[aria-pressed="true"] { background: var(--fill); border-color: transparent; color: var(--text); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px 24px; }
.label { font-size: 13px; color: var(--muted); }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: 4px; border: 1px solid color-mix(in srgb, var(--tc) 45%, transparent); color: var(--tc); font-size: 12px; font-weight: 600; white-space: nowrap; }

/* ---------- home ---------- */
.home { text-align: center; padding-top: 4vh; display: flex; flex-direction: column; align-items: center; }
.home h1 { font-size: clamp(38px, 6.4vw, 56px); line-height: 1.06; max-width: 12em; margin: 28px 0 12px; letter-spacing: -.035em; text-wrap: balance; }
body[data-edition="europe"] .home h1 { font-weight: 450; letter-spacing: -.025em; }
.home .lede { font-size: 19px; line-height: 28px; color: var(--t2); margin: 0 0 28px; max-width: 30em; }
.home .cta { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.home .meta { font-size: 13px; color: var(--muted); }
.home .alt { display: flex; gap: 4px; margin-top: 8px; }
.btn-play { min-width: 220px; height: 64px; font-size: 22px; letter-spacing: -.01em; }
.played { display: flex; align-items: baseline; gap: 10px; justify-content: center; border: 0; background: none; color: var(--text); cursor: pointer; font: inherit; padding: 8px 16px; border-radius: 16px; }
.played:hover { background: var(--fill); }
.played .num { font-size: 32px; }
.played small { color: var(--muted); font-size: 15px; }
.streak { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--t2); }
.streak b { font-family: var(--font-head); font-weight: 500; font-size: 15px; color: var(--text); }
.example { margin-top: 48px; width: 100%; text-align: left; }
.example .ex-q { font: 500 19px/28px var(--font-head); letter-spacing: -.01em; margin: 4px 0 12px; }
.ex-row { display: grid; grid-template-columns: 1fr auto 52px; align-items: center; gap: 8px; height: 44px; border-top: 1px solid var(--line); font-size: 15px; color: var(--t2); }
.ex-row .pts { text-align: right; color: var(--text); font-family: var(--font-head); }

/* ---------- play: shared ---------- */
.hud { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 28px; min-height: 44px; }
.hud-score { text-align: right; flex: none; }
.hud-score small { display: block; font-size: 12px; font-weight: 600; letter-spacing: .2px; color: var(--muted); line-height: 18px; }
.hud-score .num { font-size: 26px; line-height: 30px; }
.q-label { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.clock { margin: 24px 0 16px; display: flex; align-items: center; gap: 12px; }
.clock .num { width: 2.2em; text-align: right; font-size: 19px; color: var(--t2); }
.field { display: flex; align-items: center; height: 56px; padding: 0 6px 0 22px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); transition: border-color .16s ease-out, opacity .2s; }
.field:focus-within { border-color: var(--accent); }
.field input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; color: var(--text); font: 500 19px var(--font-body); }
.field input::placeholder { color: var(--faint); }
.field.busy { opacity: .85; }
.field .btn.checking .lbl { opacity: .35; }
/* the answer flow on Send: a near miss shakes and swaps the correction in, a wrong try shakes red */
.field.shake { animation: field-shake .38s cubic-bezier(.36, .07, .19, .97); }
.field.wrong { border-color: var(--bad, #FF5470); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad, #FF5470) 22%, transparent); }
.field.wiggle { animation: field-wiggle .34s ease-in-out; }
.field.fixed { border-color: var(--hint, #7FB2FF); box-shadow: 0 0 0 3px color-mix(in srgb, var(--hint, #7FB2FF) 22%, transparent); }
@keyframes field-wiggle { 25% { transform: translate3d(-3px, 0, 0); } 50% { transform: translate3d(3px, 0, 0); } 75% { transform: translate3d(-2px, 0, 0); } }
.field.flash.wrong { animation: field-flash .42s ease-out; }
.field.flash.fixed { animation: field-flash-ok .42s ease-out; }
@keyframes field-shake { 10%, 90% { transform: translate3d(-2px, 0, 0); } 20%, 80% { transform: translate3d(4px, 0, 0); } 30%, 50%, 70% { transform: translate3d(-7px, 0, 0); } 40%, 60% { transform: translate3d(7px, 0, 0); } }
@keyframes field-flash { 0% { background-color: color-mix(in srgb, var(--bad, #FF5470) 30%, var(--surface)); } }
@keyframes field-flash-ok { 0% { background-color: color-mix(in srgb, var(--hint, #7FB2FF) 22%, var(--surface)); } }
.hint { margin-top: 12px; font-size: 15px; color: var(--t2); text-align: center; min-height: 24px; }
.hint b { color: var(--text); font-weight: 700; }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.bar { flex: 1; height: 8px; border-radius: 999px; background: var(--fill); overflow: hidden; }
.bar > i { display: block; height: 100%; width: 100%; background: var(--bar); border-radius: inherit; transform-origin: left; }
.bar.low > i { background: var(--bar-low); }

/* ---------- Europe: route + departure board + stamp ---------- */
.route { flex: 1; min-width: 0; }
.route svg { display: block; width: 100%; height: 56px; overflow: visible; }
.route .rail { fill: none; stroke: var(--line-2); stroke-width: 2; stroke-dasharray: 3 5; }
.route .done { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; }
.route .stop { fill: var(--bg); stroke: var(--line-2); stroke-width: 2; }
.route .stop.passed { stroke: none; }
.route .stop.here { fill: var(--accent); stroke: var(--bg); stroke-width: 3; }
.route text { font: 500 10px var(--font-body); fill: var(--faint); }
.route text.here { fill: var(--text); font-weight: 700; }
.board { display: flex; flex-wrap: wrap; gap: 6px 10px; padding: 18px; border-radius: 12px; background: #1D2240; min-height: 104px; align-content: center; }
.board .w { display: inline-flex; gap: 2px; }
.board .c { width: 22px; height: 32px; display: grid; place-items: center; border-radius: 3px; background: #272D52; color: #F3EEE4;
  font: 600 18px/1 var(--font-display); position: relative; overflow: hidden; }
.board .c::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: rgba(0, 0, 0, .45); }
.board .c.flip { color: #C9C2B2; }
.board.idle .c { color: #6E7499; }
.board-sub { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12px; color: var(--muted); letter-spacing: .2px; }
.stamp { width: 132px; height: 132px; margin: 4px auto 12px; border-radius: 50%; border: 3px solid var(--tc); color: var(--tc);
  display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative;
  transform: rotate(-9deg); animation: stamp .42s cubic-bezier(.2, 1.6, .4, 1) both; }
.stamp::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; border: 1px dashed var(--tc); opacity: .6; }
.stamp b { font: 600 44px/1 'Fraunces', Georgia, serif; letter-spacing: -.03em; }
.stamp span { font-size: 11px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; margin-top: 4px; max-width: 96px; text-align: center; line-height: 13px; }
@keyframes stamp { 0% { transform: rotate(-9deg) scale(1.9); opacity: 0; } 60% { transform: rotate(-9deg) scale(.94); opacity: 1; } 100% { transform: rotate(-9deg) scale(1); } }

/* ---------- Gaming: live HUD + alert + loot + chat ---------- */
.live { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.live-badge { height: 22px; padding: 0 8px; border-radius: 4px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .6px; display: inline-flex; align-items: center; gap: 6px; }
.live-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: blink 1.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .25; } }
.viewers { font-size: 14px; color: var(--t2); display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.viewers svg { width: 16px; height: 16px; }
.segs { display: flex; gap: 3px; margin-left: auto; margin-right: 8px; }
.segs i { width: 18px; height: 4px; border-radius: 999px; background: var(--fill); }
.segs i.done { background: var(--t3); }
.segs i.now { background: var(--accent); }
.alert { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 20px 22px; position: relative; overflow: hidden; }
.alert::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); }
.alert .q { font: 500 clamp(26px, 4.6vw, 36px)/1.15 var(--font-display); letter-spacing: -.025em; }
.alert.idle .q { color: var(--faint); }
.alert-in { animation: alertin .38s cubic-bezier(.2, 1.2, .4, 1) both; }
@keyframes alertin { from { transform: translateX(-16px); opacity: 0; } to { transform: none; opacity: 1; } }
.wave { flex: 1; height: 36px; }
.wave svg { display: block; width: 100%; height: 36px; overflow: visible; }
.wave .trace { fill: none; stroke: var(--bar-low); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.wave .rest { fill: none; stroke: var(--fill-h); stroke-width: 2; }
.wave.low .trace { stroke: var(--accent); }
.loot-wrap { display: grid; grid-template-columns: 1fr 240px; gap: 24px; align-items: start; }
.loot { text-align: center; padding: 28px 16px 20px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--tc) 55%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--tc) 16%, transparent), transparent 70%); position: relative; overflow: hidden;
  animation: loot .5s cubic-bezier(.2, 1.3, .4, 1) both; }
.loot::before { content: ""; position: absolute; left: 50%; top: -40%; width: 46%; height: 120%; transform: translateX(-50%);
  background: linear-gradient(180deg, color-mix(in srgb, var(--tc) 30%, transparent), transparent); filter: blur(18px); opacity: .8; pointer-events: none; }
@keyframes loot { 0% { transform: translateY(18px) scale(.94); opacity: 0; } 100% { transform: none; opacity: 1; } }
.loot .bracket { position: relative; display: inline-block; padding: 10px 26px; }
.loot .bracket::before, .loot .bracket::after { content: ""; position: absolute; inset: 0; border: 3px solid #FF3D6E; border-radius: 4px;
  -webkit-mask: linear-gradient(#000 0 0) top left / 14px 14px no-repeat, linear-gradient(#000 0 0) top right / 14px 14px no-repeat,
                linear-gradient(#000 0 0) bottom left / 14px 14px no-repeat, linear-gradient(#000 0 0) bottom right / 14px 14px no-repeat;
          mask: linear-gradient(#000 0 0) top left / 14px 14px no-repeat, linear-gradient(#000 0 0) top right / 14px 14px no-repeat,
                linear-gradient(#000 0 0) bottom left / 14px 14px no-repeat, linear-gradient(#000 0 0) bottom right / 14px 14px no-repeat; }
.loot .bracket::after { display: none; }
.loot .pts { font: 600 clamp(56px, 10vw, 84px)/1 var(--font-display); letter-spacing: -.05em; color: var(--tc); position: relative; }
.loot .rarity { font-size: 13px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; color: var(--tc); margin-top: 10px; position: relative; }
.chat { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 12px 14px; font-size: 13px; line-height: 20px; min-height: 240px; display: flex; flex-direction: column; }
.chat-h { display: flex; justify-content: space-between; color: var(--faint); font-size: 12px; margin-bottom: 6px; }
.chat-lines { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 3px; overflow: hidden; }
.chat-line { animation: chatin .22s ease-out both; color: var(--t2); overflow-wrap: anywhere; }
.chat-line b { font-weight: 700; margin-right: 6px; }
.chat-line.me { background: color-mix(in srgb, var(--accent) 14%, transparent); border-radius: 6px; padding: 2px 6px; margin: 0 -6px; }
@keyframes chatin { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- reveal (shared) ---------- */
.reveal { text-align: center; }
.reveal .your { font-size: 15px; color: var(--t2); margin: 6px 0 0; }
.reveal .your .as { display: block; font-size: 13px; font-style: normal; color: var(--faint); }
.reveal-tier { font: 500 26px/32px var(--font-head); color: var(--tc); margin-top: 4px; }
.reveal-line { color: var(--muted); font-size: 15px; margin: 4px 0 24px; }
.tiers { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin: 0 0 28px; }
.tier-cell { border-radius: 8px; background: var(--fill); padding: 10px 4px 8px; text-align: center; transition: background-color .2s ease-out; }
.tier-cell b { display: block; font: 500 19px/1 var(--font-head); font-variant-numeric: tabular-nums; color: var(--muted); }
.tier-cell span { display: block; margin-top: 6px; font-size: 11px; line-height: 14px; color: var(--faint); }
.tier-cell.is-hit { background: var(--tc); }
.tier-cell.is-hit b, .tier-cell.is-hit span { color: var(--on-tier); }
.crowd { text-align: left; margin-bottom: 28px; }
.crowd-h { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); padding: 0 0 8px; }
.crowd-row { display: grid; grid-template-columns: 1fr 120px 52px; align-items: center; gap: 12px; min-height: 40px; padding: 4px 0; border-top: 1px solid var(--line); font-size: 15px; }
.crowd-row .nm { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: break-word; line-height: 1.25; color: var(--t2); }
/* fitWords(): a single word too long for its box even at the smallest size */
.fit-cut { display: block !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal !important; }
.crowd-row .pc { text-align: right; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.crowd-row .mini { height: 6px; border-radius: 999px; background: var(--fill); overflow: hidden; }
.crowd-row .mini i { display: block; height: 100%; background: var(--t3); border-radius: inherit; }
.crowd-row.me .nm { color: var(--text); }
.crowd-row.me .nm::after { content: "you"; margin-left: 8px; font-size: 11px; font-weight: 700; color: var(--accent); vertical-align: 1px; }
.crowd-row.me .mini i { background: var(--accent); }
.crowd-row.gap { min-height: 24px; padding: 0; border-top: 0; color: var(--faint); font-size: 13px; }
.crowd-foot { font-size: 12px; color: var(--faint); padding-top: 6px; border-top: 1px solid var(--line); }
.next { display: flex; justify-content: center; }

/* ---------- results ---------- */
.res-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.res-label { font-size: 15px; color: var(--t2); }
.res-score { display: flex; align-items: baseline; gap: 10px; margin-top: 4px; }
.res-score .num { font-size: clamp(56px, 10vw, 84px); line-height: 1; letter-spacing: -.045em; }
.res-score small { font-size: 19px; color: var(--muted); font-family: var(--font-head); }
.rank { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border-radius: 999px; background: var(--fill); font-size: 14px; color: var(--t2); }
.rank i { width: 8px; height: 8px; border-radius: 999px; background: var(--rc); }
.res-vis { margin: 24px 0 8px; }
.res-vis .route svg { height: 72px; }
.lootrow { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.lootrow div { aspect-ratio: 3 / 4; border-radius: 8px; border: 1px solid color-mix(in srgb, var(--tc) 55%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--tc) 22%, transparent), transparent); display: grid; place-items: center;
  font: 600 19px var(--font-display); color: var(--tc); animation: loot .4s ease-out both; }
.daystats { margin: 24px 0 8px; }
/* the score-distribution line (curveHtml) */
.curve { position: relative; padding-bottom: 22px; }
.curve-h { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.curve-h b { font: 500 22px/28px var(--font-head); color: var(--text); margin-right: 4px; }
.curve svg { display: block; width: 100%; height: 132px; overflow: visible; }
.curve-line { fill: none; stroke: var(--curve, var(--accent)); stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.curve-fill { fill: var(--curve, var(--accent)); opacity: .12; }
.curve-avgl { stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; }
.curve-me { stroke: var(--text); stroke-width: 2; vector-effect: non-scaling-stroke; }
.curve-dot { fill: var(--text); stroke: var(--bg, #000); stroke-width: 2; vector-effect: non-scaling-stroke; }
.curve text { font: 600 10px var(--font-body); fill: var(--faint); }
.curve-you { position: absolute; bottom: 0; transform: translateX(-50%); font-size: 12px; font-weight: 700; color: var(--text); letter-spacing: .04em; text-transform: uppercase; }
/* All answers */
.aa-open { margin: -8px auto 20px; display: flex; }
.aa-row { display: block; margin-top: 4px; padding: 0; border: 0; background: none; color: var(--link); font: 600 12px var(--font-body); cursor: pointer; }
.aa { width: min(520px, calc(100vw - 24px)); max-height: min(86vh, 760px); display: none; flex-direction: column; padding: 22px 0 0; }
.aa[open] { display: flex; }
.aa h2 { font-size: 22px; line-height: 28px; margin: 0 24px 2px; }
.aa .aa-q { margin: 0 64px 12px 24px; color: var(--muted); font-size: 14px; }
.aa-tools { display: flex; gap: 8px; padding: 0 24px 12px; border-bottom: 1px solid var(--line); }
.aa-search { flex: 1; min-width: 0; height: 40px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--fill); color: var(--text); font: 500 15px var(--font-body); outline: 0; }
.aa-search:focus { border-color: var(--accent); }
.aa-sort { flex: none; }
.aa-list { overflow: auto; padding: 4px 24px 24px; overscroll-behavior: contain; }
.aa-g h3 { position: sticky; top: 0; display: flex; align-items: baseline; gap: 8px; margin: 0; padding: 14px 0 6px; background: var(--surface); font: 600 15px var(--font-head); color: var(--tc); }
.aa-g h3 b { font-size: 13px; }
.aa-g h3 small { margin-left: auto; font: 600 12px var(--font-body); color: var(--faint); }
.aa-g ul { list-style: none; margin: 0; padding: 0; }
.aa-g li { display: flex; align-items: baseline; gap: 8px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 15px; color: var(--t2); }
.aa-g li .nm { flex: 1; min-width: 0; overflow-wrap: break-word; }
.aa-g li em { font-style: normal; font-size: 11px; font-weight: 800; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; }
.aa-g li .pc { flex: none; color: var(--muted); font-size: 13px; }
.aa-g li.me { color: var(--text); font-weight: 600; }
.aa-g[data-t="t100"] li { color: var(--text); }
.aa-you { display: flex; align-items: baseline; gap: 8px; margin: 12px 0 2px; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--tc) 14%, transparent); box-shadow: inset 3px 0 0 var(--tc); font-size: 15px; }
.aa-you em { font-style: normal; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.aa-you b { flex: 1; min-width: 0; overflow-wrap: break-word; color: var(--text); }
.aa-you span { flex: none; font-weight: 700; color: var(--tc); }
.aa-wait, .aa-empty { padding: 32px 0; text-align: center; color: var(--muted); }
.aa-more { padding: 14px 0 6px; text-align: center; color: var(--muted); font-size: 13px; }
.daystats .label { margin-bottom: 2px; }
.daystats .v { font: 500 22px/28px var(--font-head); font-variant-numeric: tabular-nums; }
.hist { display: flex; align-items: flex-end; gap: 3px; height: 28px; }
.hist i { flex: 1; background: var(--fill-h); border-radius: 2px 2px 0 0; min-height: 2px; }
.hist i.me { background: var(--accent); }
.res-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 24px 0 36px; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { font-size: 13px; font-weight: 500; color: var(--muted); text-align: left; padding: 8px 16px 8px 0; }
.tbl td { border-top: 1px solid var(--line); padding: 12px 16px 12px 0; font-size: 15px; vertical-align: top; }
.tbl td.q-cell { color: var(--t3); font-size: 14px; }
.tbl td.a-cell small { display: block; color: var(--faint); font-size: 13px; }
.tbl .q-sm { display: block; color: var(--faint); font-size: 12px; margin-bottom: 2px; }
.tbl th:last-child, .tbl td:last-child { text-align: right; padding-right: 0; white-space: nowrap; }
.tbl .pts { font-family: var(--font-head); font-variant-numeric: tabular-nums; margin-left: 8px; display: inline-block; min-width: 28px; }
.countdown { margin-top: 28px; font-size: 13px; color: var(--muted); text-align: center; }
.countdown .num { color: var(--t2); font-size: 15px; letter-spacing: 0; }

/* ---------- archive ---------- */
.page-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }
.page-h h1 { font-size: 28px; line-height: 36px; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--t2); font-size: 15px; background: none; border: 0; padding: 0; cursor: pointer; margin-bottom: 16px; }
.back:hover { color: var(--text); }
.arch-row { display: grid; grid-template-columns: 72px 1fr auto; align-items: center; gap: 16px; height: 52px; border-top: 1px solid var(--line); font-size: 15px; }
.arch-row .d { color: var(--muted); font-size: 14px; }

/* ---------- review (operator) ---------- */
.rv-stats { display: flex; gap: 32px; flex-wrap: wrap; margin: 4px 0 20px; }
.rv-stats div { font-size: 13px; color: var(--muted); }
.rv-stats b { display: block; font: 500 22px/28px var(--font-display); color: var(--text); }
.rv-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 16px; padding: 14px 0; border-top: 1px solid var(--line); align-items: center; }
.rv-row .a { font-size: 16px; color: var(--text); }
.rv-row .a small { color: var(--faint); font-size: 13px; margin-left: 6px; }
.rv-row .p { font-size: 13px; color: var(--muted); margin-top: 2px; }
.rv-row .n { font-size: 13px; color: var(--faint); margin-top: 2px; }
.rv-row .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.rv-merge { position: relative; }
.rv-merge input { height: 32px; width: 180px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); padding: 0 10px; font: inherit; font-size: 14px; }
.rv-opts { position: absolute; right: 0; top: 36px; z-index: 5; min-width: 220px; max-width: 320px; background: var(--surface-2); border-radius: 8px; padding: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,.25), 0 0 1px rgba(175,178,206,.6); display: flex; flex-direction: column; }
.rv-opts button { text-align: left; border: 0; background: none; color: var(--t2); font-size: 14px; padding: 8px 10px; border-radius: 4px; cursor: pointer; }
.rv-opts button:hover { background: var(--hover); color: var(--text); }
.rv-opts button.arm { background: var(--btn); color: #fff; }
.rv-opts .label { padding: 8px 10px; }
.rv-pager { display: flex; align-items: center; gap: 8px; justify-content: flex-end; padding: 16px 0; border-top: 1px solid var(--line); }
.rv-pager .label { margin-right: auto; }

/* ---------- not found ---------- */
.nf { margin: 18vh auto 0; text-align: center; }
.nf h1 { font-size: 40px; margin-bottom: 8px; }
.nf p { color: var(--muted); margin: 0 0 24px; }

/* Turnstile shows itself only when it needs a click (interaction-only) */
/* the bot check: invisible until Cloudflare asks for a tap, then a centred card (it sat squeezed at the
   bottom edge with no explanation). Kept in layout while hidden so the widget can run. */
.ts-card { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 16px; visibility: hidden; opacity: 0; pointer-events: none; background: rgba(8, 10, 30, .62); transition: opacity .16s ease-out; }
.ts-card.on { visibility: visible; opacity: 1; pointer-events: auto; }
.ts-in { width: min(340px, 100%); padding: 20px 14px 16px; border-radius: 14px; background: var(--surface); color: var(--text); text-align: center; box-shadow: 0 12px 40px rgba(0, 0, 0, .35); }
.ts-in p { margin: 0 0 14px; font-size: 16px; font-weight: 600; }
.ts-box { min-height: 65px; display: grid; place-items: center; }
.ts-act { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 14px; min-height: 40px; font-size: 15px; color: var(--t2); }
.ts-act .lnk { position: relative; }
.ts-act .lnk::after { content: ''; position: absolute; left: -8px; right: -8px; top: 50%; height: 40px; transform: translateY(-50%); }
@media (prefers-reduced-motion: reduce) { .ts-card { transition: none; } }

/* ---------- toast + sheet ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 16px); opacity: 0; background: var(--surface-2); color: var(--text); padding: 10px 16px; border-radius: 8px; font-size: 15px; pointer-events: none; transition: opacity .2s, transform .2s; box-shadow: 0 1px 4px rgba(0,0,0,.18), 0 0 1px rgba(120,120,140,.9); z-index: 10; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.sheet { width: min(500px, calc(100vw - 32px)); padding: 24px; overflow: hidden auto; border: 0; border-radius: 24px; background: var(--surface); color: var(--text);
  box-shadow: 0 0 2px rgba(120,120,140,.5), 0 14px 40px rgba(4,4,20,.35); }
.sheet::backdrop { background: rgba(8, 7, 14, .55); }
.sheet h2 { font-size: 28px; line-height: 36px; margin-bottom: 16px; }
.sheet-x { position: absolute; top: 16px; right: 16px; }
.sheet-sm { width: min(360px, calc(100vw - 32px)); }
.sheet-sm h2 { font-size: 22px; line-height: 28px; margin-bottom: 4px; }
.sheet-p { color: var(--muted); margin: 0 0 20px; font-size: 15px; }
.sheet-acts { display: flex; gap: 8px; justify-content: flex-end; }
.rules { margin: 0 0 24px; padding: 0; list-style: none; counter-reset: r; }
.rules li { counter-increment: r; display: grid; grid-template-columns: 28px 1fr; padding: 10px 0; border-top: 1px solid var(--line); color: var(--t3); font-size: 15px; }
.rules li::before { content: counter(r); color: var(--faint); font-family: var(--font-head); }
.rules b { color: var(--text); font-weight: 600; }
.ladder-key { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.ladder-key div { display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: 8px; background: var(--fill); font-size: 13px; color: var(--t2); white-space: nowrap; min-width: 0; }
.ladder-key i { width: 8px; height: 8px; border-radius: 999px; background: var(--tc); flex: none; }
.ladder-key b { margin-left: auto; font-family: var(--font-head); font-weight: 500; color: var(--text); }

@media (prefers-reduced-motion: reduce) {
  .screen, .stamp, .loot, .lootrow div, .alert-in, .chat-line, .live-badge::before { animation: none !important; }
}

/* ---------- phone ---------- */
@media (max-width: 720px) {
  .top { padding: 0 16px; }
  .top-r .tbtn[data-act="howto"] { padding: 0 10px; }
  .app { padding: 12px 16px 48px; }
  .home { padding-top: 1vh; }
  .home .lede { font-size: 17px; line-height: 26px; }
  .tiers { grid-template-columns: repeat(3, 1fr); }
  .crowd-row { grid-template-columns: 1fr 64px 48px; }
  .tbl td.q-cell, .tbl th.q-cell { display: none; }
  .ladder-key { grid-template-columns: repeat(2, 1fr); }
  .field { height: 52px; }
  .field .btn .lbl { display: none; }
  .board { padding: 12px; gap: 5px 8px; min-height: 88px; }
  .board .c { width: 17px; height: 26px; font-size: 14px; }
  .route text { display: none; }
  .loot-wrap { grid-template-columns: 1fr; }
  .chat { min-height: 0; }
  .segs { display: none; }
  .daystats { grid-template-columns: 1fr 1fr; }
  .daystats > div:last-child { grid-column: 1 / -1; }
  .rv-row { grid-template-columns: 1fr; }
  .rv-row .acts { justify-content: flex-start; }
}

/* ---------- share card (?og=…, 1200x630, screenshotted into play/og-*.png) ---------- */
body.og { min-height: 0; width: 1200px; height: 630px; overflow: hidden; }
.app.og-app { max-width: none; width: 1200px; height: 630px; padding: 0; margin: 0; }
.og-card { position: relative; width: 1200px; height: 630px; padding: 64px 72px; display: grid; grid-template-columns: 1fr 380px;
  grid-template-rows: auto auto auto 1fr auto; column-gap: 48px; }
.og-brand { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; font-size: 26px; font-weight: 600; letter-spacing: -.01em; }
.og-brand .mark { width: 40px; height: 40px; }
.og-brand small { font-size: 20px; font-weight: 500; color: var(--muted); }
.og-brand .live-badge { margin-left: 4px; }
.og-card h1 { grid-column: 1; margin-top: 56px; font-size: 76px; line-height: 1.02; letter-spacing: -.035em; }
body[data-edition="europe"] .og-card h1 { font-weight: 450; letter-spacing: -.025em; }
.og-card p { grid-column: 1; margin: 20px 0 0; font-size: 24px; color: var(--t2); text-wrap: balance; }
.og-vis { grid-column: 2; grid-row: 2 / 5; align-self: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.og-vis .route { width: 380px; }
.og-vis .stamp { width: 200px; height: 200px; animation: none; }
.og-vis .stamp b { font-size: 64px; }
.og-vis .stamp span { font-size: 15px; max-width: 150px; }
.og-vis .loot { width: 360px; padding: 48px 16px 36px; animation: none; }
.og-tiers { grid-column: 1 / -1; align-self: end; display: flex; gap: 8px; flex-wrap: wrap; }
.og-tiers span { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 999px; background: var(--fill); font-size: 18px; color: var(--t2); }
.og-tiers i { width: 10px; height: 10px; border-radius: 999px; background: var(--tc); }
.og-tiers b { font-family: var(--font-head); font-weight: 500; color: var(--text); }
.og-url { position: absolute; right: 72px; top: 72px; font-size: 20px; color: var(--muted); }

/* Unlimited paywall */
.pw p { margin-bottom: 18px; color: var(--t2); }
.pw-ok { display: flex; gap: 10px; align-items: flex-start; max-width: 360px; margin: 0 auto 16px; text-align: left; font-size: 14px; color: var(--t2); }
.pw-ok input { margin-top: 2px; flex: none; width: 18px; height: 18px; accent-color: var(--btn); }
.pw-ok a { color: inherit; text-decoration: underline; }
.pw-links { margin-top: 14px; font-size: 14px; color: var(--t3); }
.lnk { background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; }
.pw-restore { display: grid; gap: 8px; max-width: 320px; margin: 16px auto 0; }
.pw-restore input { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line, rgba(127,127,127,.35)); background: transparent; color: inherit; font: inherit; }
/* next question: the previous question fades out before the between animation */
#app.is-leaving #q-text,#app.is-leaving [data-prompt]{opacity:0;transition:opacity .12s ease-out}
@media (prefers-reduced-motion:reduce){#app.is-leaving #q-text,#app.is-leaving [data-prompt]{transition:none}}

/* buy screen: the heading in full text colour; the button clearly off while the box is unticked, the same in
   both editions (a theme's .btn-primary look must not win over the disabled state) */
.pw h1 { color: var(--text); }
.pw .btn[disabled], #scene ~ #app .pw .btn[disabled] { background: var(--fill-h); background-image: none; color: var(--t3); box-shadow: none; cursor: default; }
#scene ~ #app .pw .btn[disabled]::before, #scene ~ #app .pw .btn[disabled]::after { display: none; }
/* tap targets: at least 40px tall without changing the look (an invisible extension of the element) */
.back, .pw-links .lnk, .arch-row .link, .home-s .tbtn, .pw-ok a { position: relative; }
.back::after, .pw-links .lnk::after, .arch-row .link::after, .home-s .tbtn::after { content: ''; position: absolute; left: -6px; right: -6px; top: 50%; height: 40px; transform: translateY(-50%); }
.pw-ok a::after { content: ''; position: absolute; left: -8px; right: -8px; top: -6px; bottom: -14px; }

/* ---------- light mode + hardware acceleration hint ---------- */
body.lite .loot::before { filter: none; opacity: .45; }
body.lite .live-badge::before { animation: none; }
.hw-hint { position: fixed; left: 50%; top: 72px; transform: translate(-50%, -16px); opacity: 0; z-index: 11; display: flex; align-items: center; gap: 12px;
  max-width: calc(100vw - 32px); background: var(--surface-2); color: var(--text); padding: 10px 8px 10px 16px; border-radius: 8px; font-size: 15px;
  box-shadow: 0 1px 4px rgba(0,0,0,.18), 0 0 1px rgba(120,120,140,.9); transition: opacity .25s, transform .25s; }
.hw-hint.show { opacity: 1; transform: translate(-50%, 0); }
.hw-hint button { flex: none; width: 32px; height: 32px; border: 0; border-radius: 6px; background: transparent; color: inherit; font-size: 20px; line-height: 1; cursor: pointer; }
.hw-hint button:hover, .hw-hint button:focus-visible { background: color-mix(in srgb, currentColor 12%, transparent); }
