/* ═══════════════════════════════════════════════════════════════════════════
   QUARTZINE · DARK · COLD · CUT

   A deep violet-black ground with faceted panels standing on it, one bright
   violet accent, and off-white ink with a violet tilt.

   Rules this sheet keeps, without exception:
     · Nothing is rounded. Corners are CHAMFERED, always on the same diagonal
       (top-left and bottom-right), at 6 / 11 / 18px. Radius is 3px only where
       a chamfer would be smaller than the stroke that draws it.
     · ONE shadow, --sh, violet-tinted, used everywhere and never varied.
       Chamfered surfaces carry no shadow at all: clip-path would slice it.
     · Violet is a fill or a large glyph. Small violet TEXT is --accent-d.
       On violet FILLS the only legal ink is --on-accent.
     · Motion is 170ms cubic-bezier(.2,.8,.3,1); press is scale(.97).
       Entrances are a 380ms staggered cut-in, once, on screen change.
   ═══════════════════════════════════════════════════════════════════════════ */

: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:        #0E0B1A;
  --surface:   #17122B;
  --tint:      #1F1840;
  --tint-2:    #2B2159;
  --line:      #372C68;
  --ink:       #ECE8FB;
  --ink-2:     #A9A0D2;
  --ink-3:     #7E76A6;
  --accent:    #7C5CFF;
  --accent-d:  #A78BFF;
  --on-accent: #08050F;
  --good:      #4BE3AC;
  --warn:      #FF6B8A;

  --f-display: "Chakra Petch", "Avenir Next Condensed", "Segoe UI", sans-serif;
  --f-text: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* The signature. One diagonal, three sizes, on every surface in the app. */
  --cut-s: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
  --cut-m: polygon(11px 0, 100% 0, 100% calc(100% - 11px), calc(100% - 11px) 100%, 0 100%, 0 11px);
  --cut-l: polygon(18px 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%, 0 18px);
  --cut-tag: polygon(9px 0, 100% 0, calc(100% - 9px) 100%, 0 100%);
  --cut-hex: polygon(50% 0, 100% 26%, 100% 74%, 50% 100%, 0 74%, 0 26%);

  /* Depth is a FILTER, not a box-shadow: clip-path slices a box-shadow off at
     the chamfer, while drop-shadow follows the cut exactly. Violet-tinted, so
     lifted surfaces glow with their own light instead of sitting on grey. */
  --sh: drop-shadow(0 2px 3px rgba(4, 2, 12, .55)) drop-shadow(0 16px 26px rgba(48, 20, 140, .40));
  --t: 170ms cubic-bezier(.2, .8, .3, 1);
  --ease-cut: cubic-bezier(.16, .86, .28, 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;
}

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 ───────────────────────────────────────────────────────────────── */

/* Mitre, not round: the icon family is cut from the same stone as the boxes. */
.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 tinted facet: the icon on every card header. */
.chip {
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  background: var(--tint);
  clip-path: var(--cut-s);
  color: var(--accent-d);
}
.chip--sm { width: 34px; height: 34px; }
.chip--lg {
  width: 54px; height: 54px;
  clip-path: var(--cut-m);
  background: linear-gradient(150deg, var(--tint-2), var(--tint) 62%);
}
.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(64px, 21vw, 78px);
  font-weight: 700;
  letter-spacing: -0.02em;
  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 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: 4px 4px 6px;
  font-size: 12px; line-height: 1.5;
  color: var(--ink-3);
}
/* The console reads top-down and the small print sits on the floor of the
   screen, so Home never ends in a hanging block of dead space. */
.screen > .footnote:last-child { margin-top: auto; padding-top: 20px; }

/* ── pills: cut on the diagonal at both ends, like a sawn crystal ────────── */

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--tint-2);
  color: var(--accent-d);
  clip-path: var(--cut-tag);
  padding: 5px 15px;
  font-size: 11.5px; font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.pill--big {
  font-family: var(--f-display);
  font-size: 12.5px; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 7px 18px; margin-top: 10px;
}
.pill.is-done { background: rgba(75, 227, 172, .14); color: var(--good); }

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

.track {
  height: 9px;
  background: var(--tint);
  clip-path: var(--cut-tag);
  margin-top: 14px;
}
.track .fill {
  display: block; height: 100%; width: 0;
  background: var(--accent);
  transition: width var(--t), background var(--t);
}
.track .fill.is-low { background: var(--warn); }

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

.btn {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%;
  clip-path: var(--cut-s);
  padding: 14px 16px;
  font-size: 14.5px; font-weight: 700;
  letter-spacing: -0.005em;
  text-align: left;
}
/* Violet sits mid-luminance: neither white nor the ground clears 4.5:1 on it,
   so the fill gets its own near-black ink and nothing else. */
.btn--accent {
  background: linear-gradient(160deg, #8E72FF, var(--accent) 58%);
  color: var(--on-accent);
}
.btn--soft { background: var(--tint); color: var(--accent-d); }
.btn--outline { background: var(--tint-2); color: var(--ink); }
.btn:disabled { opacity: .5; }

.press { transition: transform var(--t), filter var(--t), background 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: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  background: var(--tint);
  clip-path: var(--cut-s);
  color: var(--ink);
}

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

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

#splash {
  position: fixed; inset: 0; z-index: 90;
  background: var(--bg);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4px;
  transition: opacity 200ms var(--ease-cut);
}
#splash.out { opacity: 0; }
.sp-mark {
  position: relative;
  width: 78px; height: 78px;
  display: grid; place-items: center;
  background: linear-gradient(150deg, var(--tint-2), var(--tint) 64%);
  clip-path: var(--cut-m);
  color: var(--accent-d);
  margin-bottom: 18px;
}
/* Breathing glow halo: the one looping element on this screen. */
.sp-mark::before {
  content: ""; position: absolute; inset: -34px; z-index: -1;
  background: radial-gradient(circle, rgba(124, 92, 255, .40), transparent 66%);
  animation: breathe 3.4s ease-in-out infinite;
}
.sp-mark .ic { width: 38px; height: 38px; }
@keyframes breathe {
  0%, 100% { opacity: .45; transform: scale(.9); }
  50%      { opacity: 1;   transform: scale(1.08); }
}
.sp-name {
  font-family: var(--f-display);
  font-size: 30px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.22em;
  text-indent: 0.22em;
}
.sp-sub {
  font-size: 11px; font-weight: 600; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: 0.24em; text-indent: 0.24em;
  margin-top: 4px;
}

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

#app {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  background: var(--bg);
}
/* Atmosphere, not a flat fill: two soft violet glows and a faint lattice of
   parallel cut lines running on the same diagonal as every chamfer. */
#app::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(120% 56% at 50% -12%, rgba(124, 92, 255, .17), transparent 62%),
    radial-gradient(86% 42% at 112% 106%, rgba(124, 92, 255, .12), transparent 70%),
    repeating-linear-gradient(122deg, rgba(167, 139, 255, .05) 0 1px, transparent 1px 44px);
}
.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));
}
/* 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 9px;
}
.mark {
  width: 28px; height: 28px; flex: none;
  display: grid; place-items: center;
  background: var(--tint-2);
  clip-path: var(--cut-hex);
  color: var(--accent-d);
}
.mark .ic { width: 17px; height: 17px; }
.wordmark {
  font-family: var(--f-display);
  font-size: 16px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.2em; text-indent: 0.2em;
}
/* 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: 5px;
  color: var(--accent-d);
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
}

/* ── 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. Active tab wears a cut violet facet. */
.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: 3px;
  padding: 7px 4px 6px;
  clip-path: var(--cut-s);
  color: var(--ink-3);
  font-size: 9.5px; font-weight: 700;
  letter-spacing: 0.13em; text-transform: uppercase;
  transition: color var(--t), background var(--t);
}
.navtab .ic { width: 22px; height: 22px; }
.navtab.is-on { color: var(--accent-d); background: var(--tint); }

/* Play is the game and nothing else, so the chrome steps aside entirely. */
[data-screen="play"] .topbar,
[data-screen="play"] .navbar { display: none; }

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

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

/* Staggered cut-in: one orchestrated entrance per screen change, nothing else
   on the page loops. Translate and opacity only, so the canvas box never
   changes size mid-animation and the ResizeObserver stays quiet. */
@keyframes cut-in { from { opacity: 0; transform: translateY(12px); } }
.screen.is-active > * {
  animation: cut-in 380ms var(--ease-cut) backwards;
}
.screen.is-active > *:nth-child(1) { animation-delay: 20ms; }
.screen.is-active > *:nth-child(2) { animation-delay: 65ms; }
.screen.is-active > *:nth-child(3) { animation-delay: 105ms; }
.screen.is-active > *:nth-child(4) { animation-delay: 140ms; }
.screen.is-active > *:nth-child(5) { animation-delay: 170ms; }
.screen.is-active > *:nth-child(6) { animation-delay: 195ms; }
.screen.is-active > *:nth-child(n+7) { animation-delay: 215ms; }

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

/* The section divider is a scored line with a cut mark at its head. */
.rule { position: relative; height: 1px; background: var(--line); margin: 16px 2px; }
.rule::before {
  content: ""; position: absolute; left: 0; top: -1px;
  width: 26px; height: 3px;
  background: var(--accent);
  clip-path: polygon(0 0, 100% 0, calc(100% - 3px) 100%, 0 100%);
}

.hero { margin: 8px 2px 0; }
.hero-num {
  font-family: var(--f-display);
  font-size: clamp(66px, 23vw, 92px);
  font-weight: 700; letter-spacing: -0.025em; line-height: 0.9;
  font-variant-numeric: tabular-nums;
}
.hero-meta { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.hero-meta .lbl { margin-right: auto; }
.rankline {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--accent-d);
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
}

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

/* 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: 40px; height: 5px;
  background: var(--tint);
  clip-path: var(--cut-tag);
}
.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-size: 14px; 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; 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; }

/* ── primary action: the one violet block on Home ─────────────────────────── */

.playcta {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  margin: 16px 2px 0;
  background: linear-gradient(160deg, #8E72FF, var(--accent) 58%);
  color: var(--on-accent);
  padding: 15px 18px;
  clip-path: var(--cut-m);
  /* A colour-matched glow, not a grey shadow: the block reads as lit stone. */
  filter: drop-shadow(0 10px 22px rgba(124, 92, 255, .34));
}
/* Diagonal sheen sweep: light crossing a polished face, once every 5s. */
.playcta::after {
  content: ""; position: absolute; top: -60%; left: 0;
  width: 45%; height: 220%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .34), transparent);
  transform: translateX(-180%) rotate(18deg);
  animation: sheen 5s var(--ease-cut) 1.2s infinite;
}
@keyframes sheen {
  0%       { transform: translateX(-180%) rotate(18deg); }
  22%, 100%{ transform: translateX(340%) rotate(18deg); }
}
.playcta-tx { display: flex; flex-direction: column; margin-right: auto; text-align: left; line-height: 1.1; }
.playcta-tx b {
  font-family: var(--f-display);
  font-size: 19px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.14em;
}
.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: 42px; font-weight: 700; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.hud-score .lbl { margin-top: 4px; }

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

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

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

/* The stage is a cut window: a 1.25px violet frame drawn as the parent's own
   fill, with the canvas clipped to the same chamfer inside it. --cut resolves
   per element, so both boxes take the identical shape at their own size. */
.stagewrap {
  --c: 20px;
  --cut: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, 0 100%, 0 var(--c));
  flex: 1; min-height: 0; position: relative;
  clip-path: var(--cut);
  background: var(--line);
  padding: 1.25px;
  margin-bottom: 6px;
}
#stage {
  display: block; width: 100%; height: 100%;
  clip-path: var(--cut);
  background: var(--bg);
  touch-action: none;
}

.startover {
  position: absolute; inset: 1.25px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface);
  clip-path: var(--cut);
  padding: 18px;
  overflow-y: auto;
}
.start-in { width: 100%; max-width: 320px; 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: 15px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.22em; text-indent: 0.22em;
  color: var(--accent-d);
  margin-bottom: 18px;
}
.steps { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.step {
  display: flex; align-items: center; gap: 11px;
  background: var(--tint);
  clip-path: var(--cut-s);
  padding: 11px 13px;
}
/* The step number is a rotated square, and the digit is rotated back. */
.step-n {
  width: 20px; height: 20px; flex: none;
  display: grid; place-items: center;
  transform: rotate(45deg);
  background: var(--accent);
}
.step-n i {
  transform: rotate(-45deg);
  font-style: normal; font-size: 11px; font-weight: 700;
  color: var(--on-accent);
}
.step-tx { display: flex; flex-direction: column; min-width: 0; }
.step-tx b { font-size: 13.5px; font-weight: 700; }
.step-tx i { font-style: normal; font-size: 12px; color: var(--ink-2); line-height: 1.35; margin-top: 2px; }

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

.seg {
  display: flex; gap: 4px;
  background: var(--tint);
  clip-path: var(--cut-s);
  padding: 4px;
  margin: 4px 0 14px;
}
.seg-btn {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 8px;
  clip-path: var(--cut-s);
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--ink-2);
  transition: background var(--t), color var(--t);
}
.seg-btn.is-on { background: var(--surface); color: var(--accent-d); }

.board { display: flex; flex-direction: column; margin-top: 2px; }
.rw {
  position: relative;
  display: flex; align-items: center; gap: 11px;
  padding: 10px 4px;
}
/* The divider is a pseudo-element, not a border-top: a border on a clipped box
   gets sliced by the chamfer 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-size: 13px; font-weight: 700;
  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;
  clip-path: var(--cut-hex);
  /* shell.js hands each name a hue; keep it quiet so the violet stays the one
     loud colour on the screen. */
  background: hsl(var(--h) 32% 22%);
  color: hsl(var(--h) 52% 76%);
  font-size: 13px; 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-size: 18px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.rw--top .rw-pos { color: var(--accent-d); }
.rw--me {
  background: var(--tint);
  clip-path: var(--cut-s);
  padding-left: 8px; 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: 12px;
  padding: 13px 2px;
  font-size: 14.5px; font-weight: 600; 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);
  clip-path: var(--cut-s);
  position: relative; margin: 0;
  transition: background var(--t);
}
.sw::after {
  content: ""; position: absolute; top: 4px; left: 4px;
  width: 18px; height: 18px;
  background: var(--ink);
  clip-path: polygon(4px 0, 100% 0, 100% calc(100% - 4px), calc(100% - 4px) 100%, 0 100%, 0 4px);
  transition: transform var(--t), background var(--t);
}
.sw:checked { background: var(--accent); }
.sw:checked::after { transform: translateX(20px); background: var(--on-accent); }

.sect-h {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-3);
  margin: 4px 2px 8px;
}
.screen[data-screen="more"] .sect-h:not(:first-child) { margin-top: 4px; }

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

.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(6, 3, 16, .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);
  clip-path: var(--cut-m);
  filter: 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: 15px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.14em;
}
.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);
  transform: rotate(45deg);
}
.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);
  clip-path: var(--cut-l);
  filter: var(--sh);
  padding: 22px 18px;
  text-align: center;
  animation: rise 220ms var(--ease-cut);
}
@keyframes rise { from { transform: translateY(12px) scale(.97); opacity: 0; } }
.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: 17px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.16em;
  margin-top: 12px;
}
.modal-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.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: 136px; height: 136px;
  background: var(--tint);
  clip-path: var(--cut-hex);
  font-family: var(--f-display);
  font-size: 66px; font-weight: 700; color: var(--accent-d);
  animation: pop 220ms var(--ease-cut);
}
@keyframes pop { from { transform: scale(.84) rotate(-8deg); opacity: 0; } }

.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(--tint-2);
  clip-path: var(--cut-s);
  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 number and the step list give first. */
@media (max-height: 690px) {
  .bignum { font-size: 56px; }
  .lede { margin-bottom: 10px; }
  .step { padding: 8px 11px; }
  .steps { gap: 7px; margin-bottom: 14px; }
  .hud-score b { font-size: 36px; }
}
