/* ═══════════════════════════════════════════════════════════════════════════
   HALO MIST — NIGHT FOG · ONE GREEN LIGHT · CIRCLES

   A pine-black ground with fog gathered into soft panels, a single mint light,
   and cool off-white ink. The shape language is the halo: every chip, avatar
   and badge is a true circle, cards are 24px, the primary action is a pill.

   Rules this sheet keeps, without exception:
     · Radius is 999 (chips, avatars, pills, the play button), 18 (buttons,
       tiles) or 24 (cards, sheets, the stage). Nothing else, and never 0.
     · Dividers are mist rules: a hairline that fades out at both ends.
     · Mint is light. It is a fill, a glow, or large glyphs. Small mint TEXT is
       --accent-d. On a mint FILL, text is --bg.
     · ONE ambient loop on screen at a time (the halo behind the record).
     · Motion is 220ms cubic-bezier(.22,.68,.24,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:       #04140F;
  --surface:  #0A2018;
  --tint:     #0F2C21;
  --tint-2:   #153B2C;
  --line:     #1E4C39;
  --ink:      #E6F4EC;
  --ink-2:    #9EBBAE;
  --ink-3:    #759185;
  --accent:   #34D399;
  --accent-d: #6EE7B7;
  --good:     #5EEAD4;
  --warn:     #FB7185;

  --f-display: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --f-text: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --r: 18px;          /* buttons, tiles, small panels */
  --r-lg: 24px;       /* cards, sheets, the stage */
  --edge: 1px solid var(--line);
  --sh: 0 1px 1px rgba(0, 0, 0, .5), 0 18px 40px -22px rgba(0, 0, 0, .9);
  --glow: 0 0 0 1px rgba(52, 211, 153, .22), 0 10px 30px -12px rgba(52, 211, 153, .45);
  --t: 220ms cubic-bezier(.22, .68, .24, 1);

  /* the fading hairline used for every divider in the app */
  --mist-rule: linear-gradient(90deg, transparent, var(--line) 14%, var(--line) 86%, transparent);
}

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

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

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

/* The halo chip: a true circle of gathered fog with a mint glyph inside. It is
   the app's one repeated shape, so it is never squared off. */
.chip {
  width: 42px; height: 42px; flex: none;
  display: grid; place-items: center;
  background: var(--tint);
  border: var(--edge);
  border-radius: 999px;
  color: var(--accent-d);
}
.chip--lg {
  width: 60px; height: 60px;
  box-shadow: 0 0 26px -6px rgba(52, 211, 153, .5);
}
.chip--lg .ic { width: 28px; height: 28px; }

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

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

.bignum {
  font-family: var(--f-display);
  font-size: clamp(66px, 22vw, 82px);
  font-weight: 400;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  margin: 10px 0 2px;
}
.bignum--mid { font-size: 66px; margin: 4px 0 2px; }

.lede {
  margin: 4px 4px 16px;
  font-size: 14.5px; line-height: 1.55;
  color: var(--ink-2);
}
.sub  { margin: 6px 0 0; font-size: 13.5px; color: var(--ink-2); }
.footnote {
  margin: 6px 4px 8px;
  font-size: 11.5px; line-height: 1.55;
  color: var(--ink-3);
}

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

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--tint);
  border: var(--edge);
  color: var(--accent-d);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 11.5px; font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.pill--big { font-size: 12px; padding: 6px 15px; margin-top: 12px; letter-spacing: 0.1em; text-transform: uppercase; }

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

.track {
  position: relative;
  height: 8px;
  background: var(--tint);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 12px;
}
.track .fill {
  display: block; height: 100%; width: 0;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 14px rgba(52, 211, 153, .6);
  transition: width var(--t), background var(--t);
}
.track .fill.is-low { background: var(--warn); box-shadow: 0 0 14px rgba(251, 113, 133, .55); }

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

.btn {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%;
  border-radius: 999px;
  padding: 14px 18px;
  font-size: 14.5px; font-weight: 600;
  letter-spacing: -0.005em;
  text-align: left;
}
/* Ground-colour type on the mint fill clears ~11:1. The fill is the light in
   the room, so what sits on it is the dark. */
.btn--accent { background: var(--accent); color: var(--bg); box-shadow: var(--glow); }
.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), box-shadow var(--t), background var(--t), opacity var(--t); }
.press:active { transform: scale(.97); }

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

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

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

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

#splash {
  position: fixed; inset: 0; z-index: 90;
  background:
    radial-gradient(120% 70% at 50% 38%, rgba(52, 211, 153, .13), transparent 62%),
    var(--bg);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 6px;
  transition: opacity 260ms cubic-bezier(.22, .68, .24, 1);
}
#splash.out { opacity: 0; }
.sp-mark {
  width: 82px; height: 82px;
  display: grid; place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(52, 211, 153, .35);
  color: var(--accent);
  margin-bottom: 18px;
  box-shadow: 0 0 46px -8px rgba(52, 211, 153, .55), inset 0 0 26px -8px rgba(52, 211, 153, .5);
  animation: haloBreathe 5.2s ease-in-out infinite;
}
.sp-mark .ic { width: 38px; height: 38px; }
.sp-name {
  font-family: var(--f-display);
  font-size: 40px; font-weight: 400; letter-spacing: -0.01em;
}
.sp-sub {
  font-size: 10.5px; font-weight: 500; color: var(--ink-2);
  letter-spacing: 0.2em; text-transform: uppercase;
}

@keyframes haloBreathe {
  0%, 100% { transform: scale(1);    opacity: .9; }
  50%      { transform: scale(1.045); opacity: 1; }
}

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

#app {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  background: var(--bg);
}
/* The fog itself: one large soft bloom hanging over the top of the app, plus a
   barely-there weave so the ground is never a flat fill. Static, painted once. */
#app::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(130% 52% at 50% -8%, rgba(52, 211, 153, .16), transparent 64%),
    radial-gradient(90% 40% at 12% 22%, rgba(94, 234, 212, .06), transparent 70%),
    repeating-linear-gradient(58deg, rgba(230, 244, 236, .014) 0 1px, transparent 1px 4px);
}
/* Only the three in-flow bands are lifted over the fog layer. Naming the
   elements matters: a blanket `#app > *` would out-specify the overlays' own
   `position: fixed` and drop every modal, sheet and toast into the page flow. */
.topbar, main, .navbar { position: relative; z-index: 1; }

/* 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: 12px 18px 10px;
}
.mark {
  width: 30px; height: 30px; flex: none;
  display: grid; place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(52, 211, 153, .3);
  color: var(--accent);
  box-shadow: 0 0 16px -4px rgba(52, 211, 153, .55);
}
.mark .ic { width: 18px; height: 18px; }
.wordmark {
  font-family: var(--f-display);
  font-size: 22px; font-weight: 400; letter-spacing: -0.01em;
}
.brand-rank {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--accent-d);
  font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
}

/* ── bottom nav: four tabs, standard mobile position ──────────────────────── */

.navbar {
  flex: none;
  display: flex;
  padding: 6px 10px;
  padding-bottom: calc(6px + max(var(--tg-safe-bottom), env(safe-area-inset-bottom, 0px)));
  background: linear-gradient(180deg, rgba(10, 32, 24, 0), rgba(10, 32, 24, .92) 42%);
  border-top: 1px solid rgba(30, 76, 57, .7);
}
.navtab {
  flex: 1; position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px 4px 6px;
  border-radius: var(--r);
  color: var(--ink-3);
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  transition: color var(--t);
}
.navtab .ic { width: 22px; height: 22px; }
/* The active tab is lit rather than filled: the icon takes the light and a
   small halo sits behind it. No pill, no block of colour. */
.navtab::before {
  content: ""; position: absolute; top: 2px; left: 50%;
  width: 38px; height: 38px; margin-left: -19px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(52, 211, 153, .3), transparent 68%);
  opacity: 0; transition: opacity var(--t);
}
.navtab.is-on { color: var(--accent-d); }
.navtab.is-on::before { opacity: 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: 6px 16px 22px;
}
.screen.is-active { display: flex; }
.screen.play { overflow: hidden; padding: 2px 12px 8px; }

/* The fog settling: content lifts in on arrival, each element a beat later. */
.screen.is-active[data-screen="home"] > *,
.screen.is-active[data-screen="rank"] > *,
.screen.is-active[data-screen="more"] > * {
  animation: settle 320ms cubic-bezier(.22, .68, .24, 1) both;
}
.screen.is-active > *:nth-child(2) { animation-delay: 40ms; }
.screen.is-active > *:nth-child(3) { animation-delay: 80ms; }
.screen.is-active > *:nth-child(4) { animation-delay: 110ms; }
.screen.is-active > *:nth-child(5) { animation-delay: 135ms; }
.screen.is-active > *:nth-child(n+6) { animation-delay: 155ms; }
@keyframes settle { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }

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

/* Every divider is a hairline that dissolves at both ends. */
.rule { height: 1px; background: var(--mist-rule); margin: 18px 0; border: 0; }

/* The record, sitting inside the same halo the game is played on. The one
   looping element in the app. */
.hero { position: relative; margin: 12px 2px 0; }
.hero::before {
  content: ""; position: absolute; z-index: -1;
  left: -20px; top: 50%; width: 224px; height: 224px; margin-top: -128px;
  border-radius: 999px;
  background:
    radial-gradient(circle, transparent 41%, rgba(52, 211, 153, .3) 48%, transparent 56%),
    radial-gradient(circle, rgba(52, 211, 153, .16), transparent 62%);
  animation: haloBreathe 6.5s ease-in-out infinite;
}
.hero-num {
  font-family: var(--f-display);
  font-size: clamp(76px, 26vw, 104px);
  font-weight: 400; letter-spacing: -0.03em; line-height: 0.88;
  font-variant-numeric: tabular-nums;
}
.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: 10.5px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
}

/* Primary action: a mint pill, the brightest object on the screen. */
.playcta {
  display: flex; align-items: center; gap: 14px;
  width: 100%;
  /* The auto bottom margin hands every spare pixel on a tall phone to the gap
     under the play pill, so the console below settles onto the nav bar instead
     of leaving a dead field at the foot of the screen. */
  margin: 22px 0 auto;
  background: var(--accent); color: var(--bg);
  padding: 13px 16px 13px 22px;
  border-radius: 999px;
  box-shadow: var(--glow);
}
.playcta-tx { display: flex; flex-direction: column; margin-right: auto; text-align: left; line-height: 1.15; }
.playcta-tx b { font-family: var(--f-display); font-size: 26px; font-weight: 400; letter-spacing: -0.01em; }
.playcta-tx i { font-style: normal; font-size: 11.5px; font-weight: 500; opacity: .74; margin-top: 1px; }
.playcta-ar {
  width: 40px; height: 40px; padding: 8px;
  border-radius: 999px;
  background: rgba(4, 20, 15, .16);
}

/* Stats: one inline row, figures separated by hairlines. */
.figrow { display: flex; }
.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: 4px; bottom: 4px; width: 1px;
  background: linear-gradient(180deg, transparent, var(--line), transparent);
}
.fig b {
  font-family: var(--f-display);
  font-size: 30px; font-weight: 400; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.fig span {
  font-size: 9.5px; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-3);
}

/* Daily challenge: one slim strip. */
.daily { display: flex; align-items: center; gap: 10px; }
.daily-l {
  min-width: 0; flex-shrink: 1;
  font-size: 12.5px; color: var(--ink-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.daily-state {
  flex: none;
  font-size: 9.5px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3);
}
.daily-state.is-done { color: var(--good); }
.daily-bar {
  flex: 1; min-width: 40px; height: 5px;
  background: var(--tint); border-radius: 999px; overflow: hidden;
}
.daily-bar i {
  display: block; height: 100%; width: 0;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(52, 211, 153, .7);
  transition: width var(--t);
}
.daily-v {
  flex: none;
  font-family: var(--f-display);
  font-size: 15px; font-variant-numeric: tabular-nums;
}

/* Ad offer strip. Rendered only when a block id exists, which it does not. */
.offer-row { display: flex; align-items: center; gap: 12px; }
.offer-tx { display: flex; flex-direction: column; margin-right: auto; min-width: 0; }
.offer-tx b { font-size: 14px; font-weight: 600; }
.offer-tx i { font-style: normal; font-size: 11.5px; color: var(--ink-2); }
.offer-tx i span:empty { display: none; }

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

.hud {
  flex: none;
  display: flex; align-items: center; gap: 10px;
  padding: 4px 4px 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; }
/* The live score is the one number that changes while you watch, so it is set
   in the sans at tabular width: serif figures would jitter on every tick. */
.hud-score b {
  font-size: 34px; font-weight: 600; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.hud-score .lbl { margin-top: 5px; }

.hud .iconbtn {
  width: 38px; height: 38px;
  background: rgba(15, 44, 33, .8);
  border-color: rgba(52, 211, 153, .34);
  color: var(--accent-d);
}
.hud .iconbtn .ic { width: 20px; height: 20px; }

.pill--combo {
  opacity: 0; transform: scale(.86);
  transition: opacity var(--t), transform var(--t);
  background: var(--accent); border-color: transparent; color: var(--bg);
  font-size: 15px; font-weight: 600; padding: 4px 13px;
  box-shadow: 0 0 22px -4px rgba(52, 211, 153, .8);
}
.pill--combo.is-on { opacity: 1; transform: none; }

.meter { flex: none; margin: 12px 4px 10px; }
.meter .track { margin-top: 7px; }
/* Two rings can drift past before the round ends, so the track is notched at
   the halfway mark: the fill sitting on the notch means one left. */
.meter .track::after {
  content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px;
  background: var(--bg); opacity: .85;
}

.stagewrap {
  flex: 1; min-height: 0; position: relative;
  border: 1px solid rgba(30, 76, 57, .8);
  border-radius: var(--r-lg);
  background: var(--bg);
  overflow: hidden;
  margin-bottom: 6px;
  box-shadow: inset 0 0 70px -18px rgba(52, 211, 153, .16), var(--sh);
}
#stage { display: block; width: 100%; height: 100%; touch-action: none; }

.startover {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(120% 60% at 50% 8%, rgba(52, 211, 153, .1), transparent 66%),
    var(--surface);
  border-radius: var(--r-lg);
  padding: 20px 18px;
  overflow-y: auto;
}
.start-in { width: 100%; max-width: 330px; text-align: left; }
.start-in .chip--lg { margin: 0 auto 14px; }
.start-t {
  display: block; text-align: center;
  font-family: var(--f-display);
  font-size: 30px; font-weight: 400; letter-spacing: -0.015em;
  margin-bottom: 18px;
}
.steps { list-style: none; margin: 0 0 20px; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.step { display: flex; align-items: flex-start; gap: 13px; }
.step-n {
  width: 26px; height: 26px; flex: none;
  display: grid; place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(52, 211, 153, .4);
  color: var(--accent-d);
  font-size: 12px; font-weight: 600;
  box-shadow: 0 0 16px -6px rgba(52, 211, 153, .8);
}
.step-tx { display: flex; flex-direction: column; min-width: 0; padding-top: 2px; }
.step-tx b { font-size: 14.5px; font-weight: 600; }
.step-tx i { font-style: normal; font-size: 12.5px; color: var(--ink-2); line-height: 1.45; margin-top: 2px; }

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

.seg {
  display: flex; gap: 6px;
  margin: 6px 0 16px;
}
.seg-btn {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 8px;
  border-radius: 999px;
  border: var(--edge);
  font-size: 12.5px; font-weight: 600;
  color: var(--ink-3);
  transition: color var(--t), border-color var(--t), background var(--t);
}
.seg-btn.is-on { background: var(--tint); color: var(--accent-d); border-color: rgba(52, 211, 153, .34); }

.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);
}
.rw + .rw::before, .row + .row::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px;
  background: var(--mist-rule);
}
.rw--me::before, .rw--me + .rw::before { display: none; }
.rw-pos {
  min-width: 20px;
  font-family: var(--f-display);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
  text-align: center;
}
.rw-av {
  width: 32px; height: 32px; flex: none;
  display: grid; place-items: center;
  border-radius: 999px;
  /* shell.js hands each name a hue. Keep it dim so the mint stays the only
     real light on the screen. */
  background: hsl(var(--h) 16% 15%);
  color: hsl(var(--h) 24% 66%);
  font-size: 12.5px; font-weight: 600;
}
.rw-nm { flex: 1; font-size: 14.5px; font-weight: 500; letter-spacing: -0.005em; }
.rw-sc {
  font-family: var(--f-display);
  font-size: 19px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.rw--top .rw-pos { color: var(--accent-d); }
.rw--me {
  background: var(--tint);
  border: var(--edge);
  padding-left: 10px; padding-right: 10px;
  margin: 5px 0;
}
.rw--me .rw-nm { font-weight: 600; }
.rw--me .rw-sc { color: var(--accent-d); }

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

.rows { margin-top: 4px; }
.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);
  border-radius: var(--r);
}
.row > span { flex: 1; min-width: 0; }
.row > .ic { color: var(--accent-d); }
.rowbtn { transition: opacity var(--t); }
.rowbtn:active { opacity: .6; }
.chev { width: 18px; height: 18px; color: var(--ink-3); }

.sw {
  appearance: none; -webkit-appearance: none;
  width: 46px; height: 27px; flex: none;
  background: var(--tint-2);
  border: var(--edge);
  border-radius: 999px;
  position: relative; margin: 0;
  transition: background var(--t), border-color var(--t), box-shadow var(--t);
}
.sw::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 19px; height: 19px;
  background: var(--ink-2);
  border-radius: 999px;
  transition: transform var(--t), background var(--t);
}
.sw:checked { background: var(--accent); border-color: transparent; box-shadow: 0 0 18px -5px rgba(52, 211, 153, .8); }
.sw:checked::after { transform: translateX(19px); background: var(--bg); }

.sect-h {
  font-size: 9.5px; font-weight: 600;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--ink-3);
  margin: 8px 2px 6px;
}

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

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

.sheet {
  position: fixed; z-index: 50;
  left: 12px; right: 12px;
  bottom: calc(12px + 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 up sits with its own Close
     button under the fold for the length of the animation. It 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: 22px; font-weight: 400; letter-spacing: -0.01em;
}
.sheet-body {
  flex: 1; min-height: 0;
  overflow-y: auto;
  padding: 14px 18px 4px;
  font-size: 14px; line-height: 1.6;
  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: 8px;
  width: 7px; height: 7px;
  background: var(--accent);
  border-radius: 999px;
  box-shadow: 0 0 10px rgba(52, 211, 153, .9);
}
.sheet-body b { font-weight: 600; color: var(--ink); }
.sheet-foot { flex: none; padding: 12px 18px 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: 340px;
  background:
    radial-gradient(110% 50% at 50% 0%, rgba(52, 211, 153, .12), transparent 62%),
    var(--surface);
  border: var(--edge);
  border-radius: var(--r-lg);
  box-shadow: var(--sh);
  padding: 22px 20px;
  text-align: center;
  animation: rise 240ms cubic-bezier(.22, .68, .24, 1);
}
@keyframes rise { from { transform: translateY(12px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-card .chip--lg { margin: 0 auto 4px; }
.modal-card .btn { justify-content: center; }
.modal-t { display: block; font-family: var(--f-display); font-size: 26px; font-weight: 400; 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: 18px; height: 18px; }

.revive {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center;
  pointer-events: none;
}
.revive span {
  display: grid; place-items: center;
  width: 136px; height: 136px;
  border-radius: 999px;
  border: 1px solid rgba(52, 211, 153, .4);
  background: radial-gradient(circle, rgba(52, 211, 153, .14), rgba(4, 20, 15, .9) 70%);
  box-shadow: 0 0 60px -10px rgba(52, 211, 153, .7);
  font-family: var(--f-display);
  font-size: 74px; color: var(--accent-d);
  animation: pop 220ms cubic-bezier(.22, .68, .24, 1);
}
@keyframes pop { from { transform: scale(.84); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.toast {
  position: fixed; z-index: 70;
  left: 18px; right: 18px;
  bottom: calc(96px + max(var(--tg-safe-bottom), env(safe-area-inset-bottom, 0px)));
  background: var(--surface);
  border: var(--edge);
  border-radius: 999px;
  box-shadow: var(--sh);
  padding: 13px 20px;
  font-size: 13.5px; font-weight: 500;
  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 number and the intro panel give first. */
@media (max-height: 690px) {
  .hero-num { font-size: 74px; }
  .bignum--mid { font-size: 56px; }
  .playcta-tx b { font-size: 22px; }
  .lede { margin-bottom: 12px; }
  .rule { margin: 13px 0; }
  .steps { gap: 11px; margin-bottom: 16px; }
  .start-t { font-size: 25px; margin-bottom: 14px; }
}
