/* ═══════════════════════════════════════════════════════════════════════════
   GLACIERUN — POLAR NIGHT · HAIRLINE · RACE BOARD

   A deep blue ground with almost nothing on it. No cards, no plates, no glass:
   content sits directly on the night and is separated by hairlines and space,
   the way a ski-race board is set. The only lifted surfaces in the whole app
   are the ones that float over content (nav, sheets, modals).

   Rules this sheet keeps, without exception:
     · Radius is 10 (buttons, chips, tiles), 16 (sheets, modals, the stage) or
       999 (pills). Nothing else.
     · Figures are Archivo at width 115, tabular, tight. Prose is Manrope.
       Micro-labels are 10.5px caps tracked to 0.14em. That contrast IS the
       typography, so neither face is ever used for the other's job.
     · The accent is a fill, a hairline or a large glyph. Small accent TEXT is
       --accent-d. On an accent FILL, text is --bg.
     · The fall line is the motif: every accent marker is skewed -14deg, the
       same lean as the slope in the canvas. Nothing else is ever skewed.
     · Motion is 200ms cubic-bezier(.2,.8,.3,1); press is scale(.97).
   ═══════════════════════════════════════════════════════════════════════════ */

: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:       #060E1A;
  --surface:  #0B1727;
  --tint:     #102439;
  --tint-2:   #17334D;
  --line:     #1E3A57;
  --ink:      #EAF3FC;
  --ink-2:    #9DB6D0;
  --ink-3:    #6C88A6;
  --accent:   #93C5FD;
  --accent-d: #BEDCFF;
  --good:     #5FE3C0;
  --warn:     #FF8A93;

  /* The daylight the canvas is painted in, borrowed by the stage box so the
     playfield never flashes dark before the first frame lands. */
  --sky:      #CBE0F6;

  --f-display: "Archivo", "Archivo Expanded", "Helvetica Neue", Arial, sans-serif;
  --f-text: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --r: 10px;          /* buttons, chips, tiles */
  --r-lg: 16px;       /* sheets, modals, the stage */
  --edge: 1px solid var(--line);
  --sh: 0 1px 2px rgba(2, 8, 18, .55), 0 18px 36px -20px rgba(2, 8, 18, .95);
  --t: 200ms cubic-bezier(.2, .8, .3, 1);
  --slope: -14deg;    /* the fall line, the one skew in the app */
}

*, *::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;
}

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; }

/* Every figure in the app: expanded, tight, tabular. Digits must not jitter
   when a score ticks over. */
.num {
  font-family: var(--f-display);
  font-stretch: 115%;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.015em;
}

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

.ic {
  display: block; flex: none;
  width: 24px; height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ic-s { width: 18px; height: 18px; stroke-width: 1.85; }

/* 38px tinted chip: the icon on every header. */
.chip {
  width: 38px; height: 38px; flex: none;
  display: grid; place-items: center;
  background: var(--tint);
  border-radius: var(--r);
  color: var(--accent);
}
.chip--sm { width: 32px; height: 32px; }
.chip--lg { width: 52px; height: 52px; border-radius: 14px; }
.chip--lg .ic { width: 28px; height: 28px; }

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

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

.bignum {
  font-family: var(--f-display);
  font-stretch: 115%;
  font-size: clamp(66px, 22vw, 82px);
  font-weight: 700;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  margin: 12px 0 2px;
}
.bignum--mid { font-size: 62px; margin: 6px 0 2px; }

.lede {
  margin: 2px 2px 16px;
  font-size: 14.5px; line-height: 1.5;
  color: var(--ink-2);
}
.note { margin: 12px 0; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.sub  { margin: 6px 0 0; font-size: 13.5px; color: var(--ink-2); }
.footnote {
  margin: 4px 4px 6px;
  font-size: 12px; line-height: 1.5;
  color: var(--ink-3);
}
/* With no ad surfaces in this build every screen ends early, so the closing
   line is dropped to the foot of the column instead of floating in a void. */
.screen > .footnote:last-child { margin-top: auto; padding-top: 20px; }

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

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--tint-2);
  color: var(--accent-d);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 11.5px; font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.pill--quiet { background: none; color: var(--ink-2); padding: 5px 0; }
.pill--quiet:empty { display: none; }
.pill--big { font-size: 12.5px; padding: 6px 14px; margin-top: 10px; letter-spacing: 0.06em; text-transform: uppercase; }
.pill.is-done { background: rgba(95, 227, 192, .13); color: var(--good); }

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

.track {
  height: 8px;
  background: var(--tint);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 14px;
}
.track .fill {
  display: block; height: 100%; width: 0;
  border-radius: 999px;
  background: var(--accent);
  transition: width 140ms linear, background var(--t);
}
/* The run bar counts DOWN to the flags: the last quarter is the moment the
   brake has to already be on, so it goes warm there. */
.track .fill.is-low { background: var(--warn); }

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

.btn {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%;
  border-radius: var(--r);
  padding: 14px 16px;
  font-size: 14.5px; font-weight: 700;
  letter-spacing: -0.005em;
  text-align: left;
}
/* Night-ground type on the pale ice fill: --bg on --accent clears ~10:1. */
.btn--accent { background: var(--accent); color: var(--bg); }
.btn--soft { background: var(--tint); color: var(--accent-d); border: var(--edge); }
.btn--outline { background: none; color: var(--ink); border: var(--edge); }
.btn:disabled { opacity: .5; }

.press { transition: transform var(--t), background var(--t), border-color var(--t); }
.press:active { transform: scale(.97); }

.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: 600; color: var(--ink-2); }
.ad-tx i:empty { display: none; }

.iconbtn {
  width: 38px; height: 38px; flex: none;
  display: grid; place-items: center;
  background: none;
  border: var(--edge);
  border-radius: var(--r);
  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 220ms cubic-bezier(.2, .8, .3, 1);
}
#splash.out { opacity: 0; }
.sp-mark {
  width: 72px; height: 72px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--accent);
  margin-bottom: 18px;
}
.sp-mark .ic { width: 36px; height: 36px; }
.sp-name {
  font-family: var(--f-display);
  font-stretch: 115%;
  font-size: 32px; font-weight: 700; letter-spacing: 0.02em;
  text-transform: uppercase;
}
.sp-sub {
  font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-3);
}

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

#app {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  background: var(--bg);
}

/* 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));
}
[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;
}
.mark {
  width: 28px; height: 28px; flex: none;
  display: grid; place-items: center;
  color: var(--accent);
}
.mark .ic { width: 22px; height: 22px; }
.wordmark {
  font-family: var(--f-display);
  font-stretch: 115%;
  font-size: 17px; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase;
}
.brand-rank {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--ink-3);
  font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
}
.brand-rank .ic { color: var(--accent); }

/* ── bottom nav bar ──────────────────────────────────────────────────────────
   The four tabs pinned to the bottom of the fixed viewport. The active tab is
   marked by a gate flag skewed to the fall line, not by a filled pill. */
.navbar {
  flex: none;
  display: flex;
  padding: 6px 8px;
  padding-bottom: calc(6px + 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 6px;
  border-radius: var(--r);
  color: var(--ink-3);
  font-size: 9.5px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  transition: color var(--t);
}
.navtab .ic { width: 22px; height: 22px; }
.navtab::after {
  content: ""; position: absolute; top: 1px;
  width: 18px; height: 3px; border-radius: 1px;
  background: var(--accent);
  transform: skewX(var(--slope)) scaleX(0);
  transition: transform var(--t);
}
.navtab.is-on { color: var(--accent); }
.navtab.is-on::after { transform: skewX(var(--slope)) scaleX(1); }

/* Play is the game and nothing else. */
[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: 8px 16px 20px;
}
.screen.is-active { display: flex; }
.screen.play { overflow: hidden; padding: 4px 12px 10px; }

/* ── home ────────────────────────────────────────────────────────────────── */

.rule { height: 1px; background: var(--line); margin: 18px 2px; }

.hero { margin: 6px 2px 0; }
.hero-num {
  font-family: var(--f-display);
  font-stretch: 115%;
  font-size: clamp(70px, 24vw, 96px);
  font-weight: 700; letter-spacing: -0.04em; line-height: 0.88;
  font-variant-numeric: tabular-nums;
}
.hero-meta { display: flex; align-items: baseline; gap: 10px; margin-top: 10px; }
.hero-meta .lbl { margin-right: auto; }
.rankline {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--accent);
  font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
}

/* Primary action: a full-width ice block, marked on its trailing edge with the
   piste hatching the flags in the canvas wear. */
.playcta {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  margin: 18px 2px 0;
  background: var(--accent); color: var(--bg);
  padding: 15px 18px;
  border-radius: var(--r);
}
.playcta::after {
  content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 58px;
  background: repeating-linear-gradient(104deg,
    rgba(6, 14, 26, .17) 0 5px, transparent 5px 11px);
  pointer-events: none;
}
.playcta-tx { display: flex; flex-direction: column; margin-right: auto; text-align: left; }
.playcta-tx b {
  font-family: var(--f-display); font-stretch: 115%;
  font-size: 22px; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase;
  line-height: 1.05;
}
.playcta-tx i {
  font-style: normal; font-size: 11px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  opacity: .72; margin-top: 3px;
}
.playcta-ar { width: 22px; height: 22px; opacity: .75; position: relative; z-index: 1; }

/* Stats as one inline row, hairlines between figures. */
.figrow { display: flex; margin: 0 2px; }
.fig {
  flex: 1; position: relative;
  display: flex; flex-direction: column; gap: 3px;
  padding: 0 14px;
}
.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-stretch: 115%;
  font-size: 26px; font-weight: 700; line-height: 1;
  font-variant-numeric: tabular-nums; letter-spacing: -0.02em;
}
.fig span {
  font-size: 9.5px; font-weight: 700;
  letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--ink-3);
}

/* Daily challenge: one slim strip. */
.daily { display: flex; align-items: center; gap: 10px; margin: 0 2px; }
.daily-l {
  min-width: 0; flex-shrink: 1;
  font-size: 12.5px; font-weight: 600; 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); border-radius: 999px; overflow: hidden;
}
.daily-bar i {
  display: block; height: 100%; width: 0;
  background: var(--accent);
  transition: width var(--t), background var(--t);
}
.daily-v {
  flex: none;
  font-family: var(--f-display); font-stretch: 115%;
  font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums;
}

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

.hud {
  flex: none;
  display: flex; align-items: center; gap: 9px;
  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-stretch: 115%;
  font-size: 38px; font-weight: 700; letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
}
.hud-score .lbl { margin-top: 5px; color: var(--ink-3); }

/* The pause control is the player's only way out of a round, so it stays lit. */
.hud .iconbtn { border-color: var(--tint-2); color: var(--accent); }

.pill--combo {
  opacity: 0; transition: opacity var(--t);
  background: var(--accent); color: var(--bg);
  font-family: var(--f-display); font-stretch: 115%;
  font-size: 15px; letter-spacing: 0;
}
.pill--combo.is-on { opacity: 1; }
.pill--shield { background: var(--tint); }

.meter { flex: none; margin: 14px 2px 12px; }
.meter .track { margin-top: 7px; }
.meter .lbl { color: var(--ink-3); }

.stagewrap {
  flex: 1; min-height: 0; position: relative;
  border-radius: var(--r-lg);
  background: var(--sky);
  overflow: hidden;
  margin-bottom: 4px;
}
#stage { display: block; width: 100%; height: 100%; touch-action: none; }

.startover {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  border-radius: var(--r-lg);
  border: var(--edge);
  padding: 18px;
  overflow-y: auto;
}
.start-in { width: 100%; max-width: 330px; text-align: left; }
.start-t {
  display: block;
  font-family: var(--f-display); font-stretch: 115%;
  font-size: 26px; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase;
  margin: 0 0 4px;
}
.start-s { display: block; margin-bottom: 18px; color: var(--ink-3); }
.steps { list-style: none; margin: 0 0 20px; padding: 0; display: flex; flex-direction: column; }
.step {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 13px 2px;
}
.step + .step::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px;
  background: var(--line);
}
.step-n {
  width: 3px; height: 26px; flex: none;
  background: var(--accent);
  border-radius: 1px;
  transform: skewX(var(--slope));
  font-size: 0;
}
.step-tx { display: flex; flex-direction: column; min-width: 0; }
.step-tx b {
  font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.13em; text-transform: uppercase;
}
.step-tx i { font-style: normal; font-size: 13px; color: var(--ink-2); line-height: 1.4; margin-top: 3px; }

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

.seg {
  display: flex; gap: 6px;
  margin: 4px 0 16px;
}
.seg-btn {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 8px;
  border-radius: var(--r);
  border: var(--edge);
  font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-3);
  transition: background var(--t), color var(--t), border-color var(--t);
}
.seg-btn.is-on { background: var(--tint); color: var(--accent); border-color: var(--tint-2); }

.board { display: flex; flex-direction: column; margin-top: 2px; }
.rw {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 11px 4px;
  border-radius: var(--r);
}
/* The divider is a pseudo-element, not a border-top: a 1px border on a rounded
   box curves up at both ends and reads as a wobble. */
.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-stretch: 115%;
  font-size: 14px; 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;
  border-radius: 999px;
  /* shell.js hands each name a hue; keep it quiet so the ice blue stays the one
     loud colour on the screen. */
  background: hsl(var(--h) 30% 18%);
  color: hsl(var(--h) 48% 74%);
  font-size: 12.5px; font-weight: 700;
}
.rw-nm { flex: 1; font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em; }
.rw-sc {
  font-family: var(--f-display); font-stretch: 115%;
  font-size: 18px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.rw--top .rw-pos { color: var(--accent); }
.rw--me {
  background: var(--tint);
  padding-left: 8px; padding-right: 8px;
  margin: 4px 0;
}
.rw--me .rw-nm { font-weight: 700; }
.rw--me .rw-sc { color: var(--accent); }

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

.rows { margin-top: 2px; }
.row {
  position: relative;
  display: flex; width: 100%; align-items: center; gap: 13px;
  padding: 14px 2px;
  font-size: 14.5px; font-weight: 600; text-align: left;
  color: var(--ink);
  border-radius: var(--r);
}
.row > span { flex: 1; min-width: 0; }
.row > .ic { color: var(--accent); }
.rowbtn { transition: opacity var(--t); }
.rowbtn:active { opacity: .6; }
.chev { width: 18px; height: 18px; color: var(--ink-3); }
.row.is-danger, .row.is-danger > .ic, .row.is-danger .chev { color: var(--warn); }

.sw {
  appearance: none; -webkit-appearance: none;
  width: 44px; height: 26px; flex: none;
  background: var(--tint-2);
  border-radius: 999px;
  position: relative; margin: 0;
  transition: background var(--t);
}
.sw::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px;
  background: var(--ink);
  border-radius: 999px;
  transition: transform var(--t);
}
.sw:checked { background: var(--accent); }
.sw:checked::after { background: var(--bg); transform: translateX(18px); }

/* ── section header: a gate flag on the fall line, then the label ────────── */

.sect-h {
  display: flex; align-items: center; gap: 9px;
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3);
  margin: 6px 2px 10px;
}
.sect-h::before {
  content: ""; flex: none;
  width: 3px; height: 12px;
  background: var(--accent);
  border-radius: 1px;
  transform: skewX(var(--slope));
}

/* Squared small button, the "interface" variant. */
.btn--sq {
  width: auto; flex: none; border-radius: 8px; padding: 9px 13px;
  font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; gap: 6px;
}

/* Boost offer: a slim inline strip. */
.offer-row { display: flex; align-items: center; gap: 12px; margin: 0 2px; }
.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: 600; color: var(--ink-2); }
.offer-tx i span:empty { display: none; }

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

.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(2, 8, 18, .72); }

.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);
  border-radius: var(--r-lg);
  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. */
}
.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-stretch: 115%;
  font-size: 19px; font-weight: 700; letter-spacing: 0.02em; 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: 3px; height: 11px;
  background: var(--accent);
  border-radius: 1px;
  transform: skewX(var(--slope));
}
.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;
  width: 100%; max-width: 330px;
  background: var(--surface);
  border: var(--edge);
  border-radius: var(--r-lg);
  box-shadow: var(--sh);
  padding: 22px 18px 18px;
  text-align: center;
  animation: rise 220ms cubic-bezier(.2, .8, .3, 1);
}
@keyframes rise { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-card .chip--lg { margin: 0 auto; }
.modal-card .btn { justify-content: center; }
.modal-t {
  display: block;
  font-family: var(--f-display); font-stretch: 115%;
  font-size: 24px; font-weight: 700; letter-spacing: 0.02em; 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: 13.5px; 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: 128px; height: 128px;
  background: var(--surface);
  border: 1px solid var(--tint-2);
  border-radius: 999px;
  box-shadow: var(--sh);
  font-family: var(--f-display); font-stretch: 115%;
  font-size: 66px; font-weight: 700; color: var(--accent);
  animation: pop 220ms cubic-bezier(.2, .8, .3, 1);
}
@keyframes pop { from { transform: scale(.86); 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);
  border-radius: var(--r);
  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 figures and the step list give first. */
@media (max-height: 690px) {
  .bignum { font-size: 60px; }
  .lede { margin-bottom: 12px; }
  .step { padding: 10px 2px; }
  .start-t { font-size: 23px; }
  .meter { margin: 10px 2px 8px; }
}
