/* ═══════════════════════════════════════════════════════════════════════════
   FROSTVEIN — DEEP ICE · CUT · LIT FROM WITHIN

   A frozen blue-black ground with plates of ice lifted off it. Ice is cut, so
   nothing here is rounded: every filled surface loses two opposite corners to
   a 10px bevel, and every outlined surface is a hard square box drawn with a
   1px hairline crack.

   Rules this sheet keeps, without exception:
     · Radius is 0. Filled surfaces take the bevel (--cutp), pills take 999.
       No other shape exists.
     · ONE shadow, --sh, cold and tight, used everywhere and never varied.
     · Cyan is LIGHT, not paint: hairlines, the meter, one filled button per
       screen, and the vein down the active tab. Small cyan text is --accent-d.
       On the cyan fill, text is --bg.
     · Motion is 200ms cubic-bezier(.2,.85,.25,1); press is scale(.985).
       Exactly one looping animation exists in the app: the sheen on Play.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  /* Written from JS by applySafeArea(). 0 outside Telegram fullscreen, so
     every utility that reads them collapses on its own. */
  --tg-safe-top: 0px;
  --tg-safe-bottom: 0px;

  /* Duplicated from brand.js so the splash paints correctly on frame one,
     before shell.js has stamped the palette onto <html>. */
  --bg:       #04141A;
  --surface:  #08202A;
  --tint:     #0C2C39;
  --tint-2:   #113B4C;
  --line:     #17495C;
  --ink:      #ECFBFF;
  --ink-2:    #9FC0CC;
  --ink-3:    #6F919E;
  --accent:   #67E8F9;
  --accent-d: #A5F3FC;
  --good:     #5EEAD4;
  --warn:     #FB7185;

  --f-display: "Big Shoulders Display", "Haettenschweiler", "Impact", sans-serif;
  --f-text: "Schibsted Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* The one shape: a plate of ice with two corners cleaved off. */
  --cutp: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
  --cutp-s: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 6px 100%, 0 calc(100% - 6px));

  --edge: 1px solid var(--line);
  --sh: 0 1px 0 rgba(0, 0, 0, .5), 0 18px 34px -26px #000;
  --glow: 0 0 22px -6px rgba(103, 232, 249, .55);
  --t: 200ms cubic-bezier(.2, .85, .25, 1);
}

*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* Overlays set their own display, which outranks the UA rule for [hidden]. */
[hidden] { display: none !important; }

html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--bg);
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
}

body {
  font-family: var(--f-text);
  font-weight: 500;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

/* Atmosphere, painted once behind everything: two cold light pools deep in the
   ice and a faint set of striations running through it. Fixed and inert, so it
   costs one composite and never repaints. */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 62% at 78% -8%, rgba(103, 232, 249, .11), transparent 62%),
    radial-gradient(90% 48% at 6% 104%, rgba(103, 232, 249, .07), transparent 60%),
    repeating-linear-gradient(72deg, rgba(165, 243, 252, .035) 0 1px, transparent 1px 46px);
}

button, input { font: inherit; color: inherit; }
button { border: 0; background: none; padding: 0; cursor: pointer; }

/* The icon sprite itself never renders. */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ── icons ───────────────────────────────────────────────────────────────── */

.ic {
  display: block; flex: none;
  width: 24px; height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: square;
  stroke-linejoin: miter;
}
.ic-s { width: 18px; height: 18px; stroke-width: 1.8; }

/* 40px cleaved chip: the icon on every card header. */
.chip {
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  background: var(--tint);
  clip-path: var(--cutp-s);
  color: var(--accent-d);
}
.chip--sm { width: 34px; height: 34px; }
.chip--lg { width: 52px; height: 52px; clip-path: var(--cutp); }
.chip--lg .ic { width: 28px; height: 28px; }

/* ── type ────────────────────────────────────────────────────────────────── */

.lbl {
  display: block;
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-2);
  font-style: normal;
}

.bignum {
  font-family: var(--f-display);
  font-size: clamp(76px, 25vw, 96px);
  font-weight: 700;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
  line-height: .9;
  margin: 14px 0 4px;
}
.bignum--mid { font-size: 72px; margin: 8px 0 4px; }

.lede {
  margin: 2px 2px 14px;
  font-size: 14.5px; line-height: 1.5;
  color: var(--ink-2);
}
.sub  { margin: 6px 0 0; font-size: 13.5px; color: var(--ink-2); }
.footnote {
  margin: 6px 4px;
  font-size: 12px; line-height: 1.5;
  color: var(--ink-3);
}

/* ── pills ───────────────────────────────────────────────────────────────── */

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--tint-2);
  color: var(--accent-d);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  white-space: nowrap;
}
.pill--big { font-size: 11.5px; padding: 6px 15px; margin-top: 12px; }
.pill.is-done { background: rgba(94, 234, 212, .13); color: var(--good); }

/* ── progress track ──────────────────────────────────────────────────────── */

.track {
  height: 8px;
  background: var(--tint-2);
  overflow: hidden;
  margin-top: 14px;
}
.track .fill {
  display: block; height: 100%; width: 0;
  background: var(--accent);
  box-shadow: var(--glow);
  transition: width 120ms linear, background var(--t);
}
.track .fill.is-low { background: var(--warn); box-shadow: none; }

/* ── buttons ─────────────────────────────────────────────────────────────── */

.btn {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%;
  padding: 14px 16px;
  font-size: 14.5px; font-weight: 600;
  letter-spacing: -0.005em;
  text-align: left;
}
/* Deep-ice type on the pale cyan fill: --bg on --accent clears ~13:1. The fill
   is light, so its text is dark. */
.btn--accent {
  background: var(--accent); color: var(--bg);
  clip-path: var(--cutp);
  font-weight: 700;
  box-shadow: var(--sh);
}
.btn--soft { background: var(--tint); color: var(--accent-d); border: var(--edge); }
.btn--outline { background: var(--surface); color: var(--ink); border: var(--edge); }
.btn:disabled { opacity: .5; }

.press { transition: transform var(--t), filter var(--t), background var(--t); }
.press:active { transform: scale(.985); filter: brightness(1.12); }

.btn--ad { align-items: flex-start; text-align: left; margin-top: 10px; }
.ad-tx { display: flex; flex-direction: column; gap: 3px; }
.ad-tx b { font-size: 14px; font-weight: 700; }
.ad-tx i { font-style: normal; font-size: 11.5px; font-weight: 500; color: var(--ink-2); }
.ad-tx i:empty { display: none; }

/* Squared small button, the "interface" variant. */
.btn--sq { width: auto; flex: none; padding: 9px 13px; font-size: 12.5px; gap: 6px; }

.iconbtn {
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  background: var(--surface);
  border: var(--edge);
  color: var(--ink);
}

/* ── splash ──────────────────────────────────────────────────────────────── */

#splash {
  position: fixed; inset: 0; z-index: 90;
  background: var(--bg);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 6px;
  transition: opacity 200ms cubic-bezier(.2, .85, .25, 1);
}
#splash.out { opacity: 0; }
.sp-mark {
  width: 76px; height: 76px;
  display: grid; place-items: center;
  background: var(--tint);
  clip-path: var(--cutp);
  color: var(--accent);
  margin-bottom: 18px;
  animation: cleave 520ms cubic-bezier(.2, .85, .25, 1) both;
}
.sp-mark .ic { width: 38px; height: 38px; stroke-width: 1.5; }
@keyframes cleave { from { opacity: 0; transform: translateY(6px) scale(.9); } to { opacity: 1; transform: none; } }
.sp-name {
  font-family: var(--f-display);
  font-size: 46px; font-weight: 700; letter-spacing: 0.06em;
  line-height: 1;
}
.sp-sub {
  font-size: 11px; font-weight: 600; color: var(--ink-2);
  letter-spacing: 0.2em; text-transform: uppercase;
}

/* ── frame ───────────────────────────────────────────────────────────────── */

#app {
  position: fixed; inset: 0; z-index: 1;
  display: flex; flex-direction: column;
}

/* The top element carries the fullscreen top inset, so the brand line clears
   Telegram's floating Close / ⋯ row. */
.topbar {
  flex: none;
  padding-top: max(var(--tg-safe-top), env(safe-area-inset-top, 0px));
}
/* Fullscreen already reserves the chrome inset; trim a cosmetic sliver so the
   brand line does not read as a gap, floored at the inset itself. */
[data-fullscreen="1"] .topbar {
  padding-top: max(var(--tg-safe-top),
    calc(max(var(--tg-safe-top), env(safe-area-inset-top, 0px)) - 1.4vh));
}
.brandline {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px 10px;
  border-bottom: 1px solid rgba(23, 73, 92, .55);
}
.mark {
  width: 28px; height: 28px; flex: none;
  display: grid; place-items: center;
  background: var(--tint);
  clip-path: var(--cutp-s);
  color: var(--accent);
}
.mark .ic { width: 17px; height: 17px; }
.wordmark {
  font-family: var(--f-display);
  font-size: 25px; font-weight: 700; letter-spacing: 0.07em;
  line-height: 1;
}
/* Rank badge on the right of the brand bar. shell.js writes every
   [data-rank-badge], so this stays in sync with the home hero. */
.brand-rank {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--accent-d);
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
}

/* ── bottom nav bar: the four tabs, standard mobile position ──────────────────
   A flex-column child of #app, so it pins to the bottom of the fixed viewport
   above the scrolling content. The active tab is marked by a vein of accent
   running along its top edge, not by a filled pill. */
.navbar {
  flex: none;
  display: flex;
  padding: 4px 6px;
  padding-bottom: calc(4px + max(var(--tg-safe-bottom), env(safe-area-inset-bottom, 0px)));
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.navtab {
  flex: 1; position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 9px 4px 7px;
  color: var(--ink-3);
  font-size: 9.5px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  transition: color var(--t), background var(--t);
}
.navtab .ic { width: 21px; height: 21px; }
.navtab::before {
  content: ""; position: absolute; left: 22%; right: 22%; top: 0; height: 2px;
  background: var(--accent);
  box-shadow: var(--glow);
  transform: scaleX(0);
  transition: transform var(--t);
}
.navtab.is-on { color: var(--accent-d); background: var(--tint); }
.navtab.is-on::before { transform: scaleX(1); }

/* Play is the game and nothing else: the brand bar and the nav both step
   aside so the stage owns the screen. */
[data-screen="play"] .topbar,
[data-screen="play"] .navbar { display: none; }

main { flex: 1; min-height: 0; position: relative; }

.screen {
  position: absolute; inset: 0;
  display: none;
  flex-direction: column;
  overflow-y: auto;
  padding: 10px 16px 20px;
}
.screen.is-active { display: flex; }
.screen.play { overflow: hidden; padding: 4px 12px 8px; }

/* One orchestrated entrance per screen: the sections rise in sequence, like a
   fracture propagating down the page. Never on Play, which must be instant. */
@keyframes riseIn { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }
.screen.is-active:not(.play) > * { animation: riseIn 360ms cubic-bezier(.2, .85, .25, 1) both; }
.screen.is-active:not(.play) > *:nth-child(1) { animation-delay: 10ms; }
.screen.is-active:not(.play) > *:nth-child(2) { animation-delay: 45ms; }
.screen.is-active:not(.play) > *:nth-child(3) { animation-delay: 80ms; }
.screen.is-active:not(.play) > *:nth-child(4) { animation-delay: 115ms; }
.screen.is-active:not(.play) > *:nth-child(5) { animation-delay: 150ms; }
.screen.is-active:not(.play) > *:nth-child(6) { animation-delay: 185ms; }
.screen.is-active:not(.play) > *:nth-child(n+7) { animation-delay: 220ms; }

/* ── home (HUD) ────────────────────────────────────────────────────────────── */

/* The divider is a hairline crack, brightest in the middle where it opens. */
.rule {
  height: 1px; margin: 18px 0;
  background: linear-gradient(90deg, var(--line), rgba(103, 232, 249, .34) 46%, var(--line));
}

.hero { margin: 10px 0 0; }
.hero-num {
  font-family: var(--f-display);
  font-size: clamp(88px, 30vw, 128px);
  font-weight: 700; letter-spacing: 0.01em; line-height: .82;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  text-shadow: 0 0 40px rgba(103, 232, 249, .18);
}
.hero-meta { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.hero-meta .lbl { margin-right: auto; }
.rankline {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--accent-d);
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
}

/* Stats as one inline row, hairline dividers between figures. */
.figrow { display: flex; }
.fig {
  flex: 1; position: relative;
  display: flex; flex-direction: column; gap: 3px;
  padding: 0 12px;
}
.fig:first-child { padding-left: 0; }
.fig:last-child { padding-right: 0; }
.fig + .fig::before {
  content: ""; position: absolute; left: 0; top: 2px; bottom: 2px; width: 1px;
  background: var(--line);
}
.fig b {
  font-family: var(--f-display);
  font-size: 32px; font-weight: 700; line-height: .95;
  font-variant-numeric: tabular-nums;
}
.fig span {
  font-size: 9.5px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-2);
}

/* Daily challenge: one slim strip, label + state + inline bar + value. */
.daily { display: flex; align-items: center; gap: 10px; }
.daily-l {
  min-width: 0; flex-shrink: 1;
  font-size: 12.5px; font-weight: 500; color: var(--ink-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.daily-state {
  flex: none;
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-3);
}
.daily-state.is-done { color: var(--good); }
.daily-bar { flex: 1; min-width: 36px; height: 4px; background: var(--tint-2); overflow: hidden; }
.daily-bar i {
  display: block; height: 100%; width: 0;
  background: var(--accent);
  transition: width var(--t);
}
.daily-v {
  flex: none;
  font-family: var(--f-display);
  font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums;
}

/* Boost offer: a slim inline strip, not a padded card. */
.offer-row { display: flex; align-items: center; gap: 11px; }
.offer-tx { display: flex; flex-direction: column; margin-right: auto; min-width: 0; }
.offer-tx b { font-size: 14px; font-weight: 700; }
.offer-tx i { font-style: normal; font-size: 11.5px; font-weight: 500; color: var(--ink-2); }
.offer-tx i span:empty { display: none; }

/* ── the primary action: Play ────────────────────────────────────────────────
   The one bright plate in the app. A single looping sheen travels down it, the
   way light travels down a vein of ice. */
.playcta {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  margin: 18px 0 0;
  background: var(--accent); color: var(--bg);
  clip-path: var(--cutp);
  padding: 15px 18px;
  box-shadow: 0 18px 40px -22px rgba(103, 232, 249, .75);
}
.playcta::after {
  content: ""; position: absolute; inset: -40% -10%;
  background: linear-gradient(104deg, transparent 42%, rgba(255, 255, 255, .55) 50%, transparent 58%);
  transform: translateY(-120%);
  animation: sheen 4.6s cubic-bezier(.5, 0, .5, 1) infinite;
}
@keyframes sheen {
  0%, 62% { transform: translateY(-130%); }
  84%, 100% { transform: translateY(130%); }
}
.playcta-tx { display: flex; flex-direction: column; margin-right: auto; text-align: left; }
.playcta-tx b {
  font-family: var(--f-display);
  font-size: 30px; font-weight: 700; letter-spacing: 0.05em; line-height: .95;
  text-transform: uppercase;
}
.playcta-tx i { font-style: normal; font-size: 12px; font-weight: 600; opacity: .78; margin-top: 3px; }
.playcta-ar { width: 24px; height: 24px; opacity: .75; }

/* ── play ────────────────────────────────────────────────────────────────── */

.hud {
  flex: none;
  display: flex; align-items: center; gap: 10px;
  padding: 4px 2px 0;
  padding-top: calc(max(var(--tg-safe-top), env(safe-area-inset-top, 0px)) + 8px);
}
.hud-score { display: flex; flex-direction: column; margin-right: auto; line-height: 1; }
.hud-score b {
  font-family: var(--f-display);
  font-size: 52px; font-weight: 700; letter-spacing: 0.01em; line-height: .86;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 28px rgba(103, 232, 249, .25);
}
.hud-score .lbl { margin-top: 5px; }

/* The pause control is the player's only way out of a round, so it is an
   obvious accent-edged button, never blended into the dark HUD. */
.hud .iconbtn { background: var(--tint-2); border-color: var(--accent); color: var(--accent-d); }

.pill--combo {
  opacity: 0; transition: opacity var(--t);
  background: var(--accent); color: var(--bg);
  font-size: 13px; letter-spacing: 0.02em;
}
.pill--combo.is-on { opacity: 1; }
.pill--shield { background: var(--tint); border: var(--edge); }

.meter { flex: none; margin: 12px 2px 10px; }
.meter .track { margin-top: 6px; }

/* The stage is a plate of ice: the 1px background showing through the padding
   is its edge, and both plate and canvas are cleaved by the same bevel. */
.stagewrap {
  flex: 1; min-height: 0; position: relative;
  padding: 1px;
  background: var(--line);
  clip-path: var(--cutp);
  margin-bottom: 6px;
}
#stage {
  display: block; width: 100%; height: 100%;
  background: var(--bg);
  clip-path: var(--cutp);
  touch-action: none;
}

.startover {
  position: absolute; inset: 1px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface);
  clip-path: var(--cutp);
  padding: 18px;
  overflow-y: auto;
}
.start-in { width: 100%; max-width: 330px; text-align: left; }
.start-in .chip--lg { margin: 0 auto 14px; color: var(--accent); }
.start-t {
  display: block; text-align: center;
  font-family: var(--f-display);
  font-size: 34px; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.steps { list-style: none; margin: 0 0 20px; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.step { display: flex; align-items: flex-start; gap: 12px; }
.step-n {
  width: 24px; height: 24px; flex: none;
  display: grid; place-items: center;
  background: var(--tint-2);
  clip-path: var(--cutp-s);
  color: var(--accent-d);
  font-family: var(--f-display);
  font-size: 16px; font-weight: 700;
  margin-top: 1px;
}
.step-tx { display: flex; flex-direction: column; min-width: 0; }
.step-tx b { font-size: 14px; font-weight: 700; }
.step-tx i { font-style: normal; font-size: 12.5px; color: var(--ink-2); line-height: 1.4; margin-top: 2px; }

/* ── rank ────────────────────────────────────────────────────────────────── */

.seg {
  display: flex; gap: 2px;
  background: var(--tint);
  padding: 3px;
  margin: 4px 0 16px;
}
.seg-btn {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 8px;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-2);
  transition: background var(--t), color var(--t);
}
.seg-btn.is-on { background: var(--surface); color: var(--accent-d); box-shadow: inset 0 -2px 0 var(--accent); }

.board { display: flex; flex-direction: column; margin-top: 2px; }
.rw {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 11px 4px;
}
/* The divider is a pseudo-element, not a border-top, so it stays a single
   uninterrupted hairline across a row that carries its own background. */
.rw + .rw::before, .row + .row::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px;
  background: var(--line);
}
.rw--me::before, .rw--me + .rw::before { display: none; }
.rw-pos {
  min-width: 22px;
  font-family: var(--f-display);
  font-size: 17px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
  text-align: center;
}
.rw-av {
  width: 30px; height: 30px; flex: none;
  display: grid; place-items: center;
  clip-path: var(--cutp-s);
  /* shell.js hands each name a hue; hold the saturation right down so the
     board stays frozen and the cyan is still the one colour on the screen. */
  background: hsl(var(--h) 16% 16%);
  color: hsl(var(--h) 20% 72%);
  font-size: 12.5px; font-weight: 700;
}
.rw-nm { flex: 1; font-size: 14.5px; font-weight: 500; }
.rw-sc {
  font-family: var(--f-display);
  font-size: 24px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}
.rw--top .rw-pos { color: var(--accent-d); }
.rw--me {
  background: var(--tint);
  box-shadow: inset 2px 0 0 var(--accent);
  padding-left: 10px; padding-right: 8px;
  margin: 4px 0;
}
.rw--me .rw-nm { font-weight: 700; }
.rw--me .rw-sc { color: var(--accent-d); }

/* ── more ────────────────────────────────────────────────────────────────── */

.rows { margin-top: 6px; }
.row {
  position: relative;
  display: flex; width: 100%; align-items: center; gap: 14px;
  padding: 14px 2px;
  font-size: 14.5px; font-weight: 500; text-align: left;
  color: var(--ink);
}
.row > span { flex: 1; min-width: 0; }
.row > .ic { color: var(--accent-d); }
.rowbtn { transition: background var(--t); }
.rowbtn:active { background: var(--tint); }
.chev { width: 18px; height: 18px; color: var(--ink-3); }

.sw {
  appearance: none; -webkit-appearance: none;
  width: 46px; height: 26px; flex: none;
  background: var(--tint-2);
  border: 1px solid var(--line);
  position: relative; margin: 0;
  transition: background var(--t), border-color var(--t);
}
.sw::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px;
  background: var(--ink-2);
  transition: transform var(--t), background var(--t);
}
.sw:checked { background: rgba(103, 232, 249, .22); border-color: var(--accent); }
.sw:checked::after { transform: translateX(20px); background: var(--accent); box-shadow: var(--glow); }

.sect-h {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-3);
  margin: 4px 0 8px;
}

/* ── overlays ────────────────────────────────────────────────────────────── */

.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(2, 10, 13, .74); }

.sheet {
  position: fixed; z-index: 50;
  left: 10px; right: 10px;
  bottom: calc(10px + max(var(--tg-safe-bottom), env(safe-area-inset-bottom, 0px)));
  background: var(--surface);
  border: var(--edge);
  box-shadow: var(--sh);
  display: flex; flex-direction: column;
  max-height: calc(100dvh - max(var(--tg-safe-top), env(safe-area-inset-top, 0px)) - 24px);
  /* Deliberately NOT animated. A sheet that slides in from below sits, for the
     length of the animation, with its own Close button under the fold, and if
     a client throttles animations it stays there. The sheet just appears. */
}
.sheet-head {
  flex: none;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 14px 12px;
  border-bottom: 1px solid var(--line);
}
.sheet-head b {
  flex: 1; min-width: 0;
  font-family: var(--f-display);
  font-size: 26px; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase;
}
.sheet-body {
  flex: 1; min-height: 0;
  overflow-y: auto;
  padding: 14px 16px 4px;
  font-size: 14px; line-height: 1.55;
  color: var(--ink-2);
}
.sheet-body p { margin: 0 0 12px; }
.sheet-body ul { margin: 0 0 12px; padding-left: 0; list-style: none; }
.sheet-body li { position: relative; padding-left: 20px; margin-bottom: 10px; }
.sheet-body li::before {
  content: ""; position: absolute; left: 2px; top: 7px;
  width: 8px; height: 8px;
  background: var(--accent);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}
.sheet-body b { font-weight: 700; color: var(--ink); }
.sheet-foot { flex: none; padding: 12px 16px 16px; border-top: 1px solid var(--line); }

.modal {
  position: fixed; inset: 0; z-index: 55;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  pointer-events: none;
}
.modal-card {
  pointer-events: auto;
  position: relative;
  width: 100%; max-width: 330px;
  background: var(--surface);
  border: var(--edge);
  box-shadow: var(--sh);
  padding: 22px 18px 20px;
  text-align: center;
  animation: rise 220ms cubic-bezier(.2, .85, .25, 1);
}
/* A vein of light along the top edge of every decision surface. */
.modal-card::before {
  content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent) 30%, var(--accent) 70%, transparent);
  box-shadow: var(--glow);
}
@keyframes rise { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-card .chip--lg { margin: 0 auto 4px; color: var(--accent); }
.modal-card .btn { justify-content: center; }
.modal-t {
  display: block; font-family: var(--f-display);
  font-size: 30px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  margin-top: 12px;
}
.modal-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.modal-btns .btn { padding: 13px 10px; font-size: 13px; gap: 7px; }
.modal-btns .ic { width: 19px; height: 19px; }

.revive {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center;
  pointer-events: none;
}
.revive span {
  display: grid; place-items: center;
  width: 130px; height: 130px;
  background: var(--tint);
  border: 1px solid var(--accent);
  clip-path: var(--cutp);
  font-family: var(--f-display);
  font-size: 88px; font-weight: 700; color: var(--accent);
  animation: pop 220ms cubic-bezier(.2, .85, .25, 1);
}
@keyframes pop { from { transform: scale(.84); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.toast {
  position: fixed; z-index: 70;
  left: 16px; right: 16px;
  bottom: calc(96px + max(var(--tg-safe-bottom), env(safe-area-inset-bottom, 0px)));
  background: var(--surface);
  border: var(--edge);
  clip-path: var(--cutp-s);
  box-shadow: var(--sh);
  padding: 13px 18px;
  font-size: 13.5px; font-weight: 600;
  text-align: center;
}

/* ── reduce motion: kill all of it ───────────────────────────────────────── */

[data-reduce-motion="1"] *,
[data-reduce-motion="1"] *::before,
[data-reduce-motion="1"] *::after {
  animation: none !important;
  transition: none !important;
}

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

/* Short phones: the big numbers and the start panel give first. */
@media (max-height: 690px) {
  .hero-num { font-size: 84px; }
  .bignum--mid { font-size: 62px; }
  .playcta-tx b { font-size: 26px; }
  .lede { margin-bottom: 10px; }
  .start-t { font-size: 28px; margin-bottom: 14px; }
  .steps { gap: 9px; margin-bottom: 16px; }
  .hud-score b { font-size: 44px; }
}
