/* Miku Deck.
   Concept: stage light. The page is a concert: a dark stage with two spotlights and an LED
   marquee up top, a tracklist for the guide, tickets for the combos, a piano roll and LED
   meters for the numbers, concert posters for the bots. By day it prints like the programme,
   on warm paper; the stage blocks stay dark in both themes.
   Type: Unbounded for the big type, Instrument Sans for reading, Martian Mono for numbers and
   labels. Miku teal (#39C5BB) is the voice, pink is the spotlight, gold is the house lights.
   Layout: an app for one thumb. Five tabs at the bottom on phones (along the top on wide
   screens), segments under the header so no page is one long scroll, a card sheet you drag
   and swipe, a full-screen reader for the guide. */

:root {
  color-scheme: light;
  --bg: #f2efe7;
  --bg-2: #e9e4d8;
  --surface: #fffdf8;
  --surface-2: #f6f2e8;
  --surface-3: #ebe5d8;
  --ink: #0f1a1a;
  --ink-soft: #2c3938;
  --muted: #5f6b69;
  --line: #ddd5c6;
  --line-strong: #c5baa6;
  --teal: #00756c;
  --teal-fill: #39c5bb;
  --teal-soft: #d3eee9;
  --on-fill: #04201e;
  --pink: #bd1c5a;
  --pink-fill: #ff3d8b;
  --pink-soft: #ffe2ed;
  --gold: #8a6000;
  --gold-fill: #ffc84a;
  --leaf: #3d9a4c;
  --sky: #3b8fd8;
  --violet: #8a6ae0;
  --coral: #f0784c;
  --mint: #4fcf9f;
  --stage: #07090c;
  --stage-2: #10151b;
  --stage-ink: #eef3f4;
  --stage-soft: #9fb0b8;
  --shadow-1: 0 1px 0 rgba(15, 26, 26, .04), 0 1px 3px rgba(15, 26, 26, .07);
  --shadow-2: 0 2px 6px rgba(15, 26, 26, .06), 0 18px 40px -14px rgba(15, 26, 26, .25);
  --scrim: rgba(7, 10, 12, .5);
  --glass: color-mix(in srgb, var(--bg) 82%, transparent);
  --mana-w: #f7efcf; --mana-w-ink: #5c4a0c;
  --mana-g: #cfe9cf; --mana-g-ink: #164820;
  --mana-u: #d0e4f6; --mana-u-ink: #0f3d66;
  --mana-b: #dcd5d2; --mana-b-ink: #2b2422;
  --mana-r: #f7d5c8; --mana-r-ink: #6b200d;
  --mana-c: #e2ded6; --mana-c-ink: #3b3e3c;
  --grain: .07;

  --f-display: "Unbounded", "Arial Black", "Helvetica Neue", system-ui, sans-serif;
  --f-body: "Instrument Sans", "Helvetica Neue", "Segoe UI", system-ui, sans-serif;
  --f-mono: "Martian Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --r: 20px;
  --r-m: 14px;
  --r-s: 10px;
  --gutter: 16px;
  --top-h: 56px;
  --seg-h: 50px;
  --tab-h: 66px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.32, .72, 0, 1);
  --bounce: cubic-bezier(.34, 1.56, .64, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #07090c; --bg-2: #0b0f13; --surface: #0f141a; --surface-2: #141a21; --surface-3: #1b232c;
    --ink: #eef3f4; --ink-soft: #c5cfd4; --muted: #8b99a4; --line: #1e2730; --line-strong: #2e3a47;
    --teal: #58ddd0; --teal-soft: #0c2f2c; --on-fill: #04201e; --pink: #ff72a9; --pink-soft: #36111f;
    --gold: #ffd166; --leaf: #7fd28a;
    --shadow-1: 0 1px 0 rgba(0, 0, 0, .3); --shadow-2: 0 2px 6px rgba(0, 0, 0, .35), 0 22px 50px -14px rgba(0, 0, 0, .75);
    --scrim: rgba(0, 0, 0, .66);
    --mana-w: #3a3520; --mana-w-ink: #f5e8b3; --mana-g: #183822; --mana-g-ink: #bfeac7;
    --mana-u: #13324d; --mana-u-ink: #bfe0ff; --mana-b: #2c2726; --mana-b-ink: #e5dcd9;
    --mana-r: #4a1e13; --mana-r-ink: #ffcbb8; --mana-c: #283034; --mana-c-ink: #d6dddc;
    --grain: .05;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #07090c; --bg-2: #0b0f13; --surface: #0f141a; --surface-2: #141a21; --surface-3: #1b232c;
  --ink: #eef3f4; --ink-soft: #c5cfd4; --muted: #8b99a4; --line: #1e2730; --line-strong: #2e3a47;
  --teal: #58ddd0; --teal-soft: #0c2f2c; --on-fill: #04201e; --pink: #ff72a9; --pink-soft: #36111f;
  --gold: #ffd166; --leaf: #7fd28a;
  --shadow-1: 0 1px 0 rgba(0, 0, 0, .3); --shadow-2: 0 2px 6px rgba(0, 0, 0, .35), 0 22px 50px -14px rgba(0, 0, 0, .75);
  --scrim: rgba(0, 0, 0, .66);
  --mana-w: #3a3520; --mana-w-ink: #f5e8b3; --mana-g: #183822; --mana-g-ink: #bfeac7;
  --mana-u: #13324d; --mana-u-ink: #bfe0ff; --mana-b: #2c2726; --mana-b-ink: #e5dcd9;
  --mana-r: #4a1e13; --mana-r-ink: #ffcbb8; --mana-c: #283034; --mana-c-ink: #d6dddc;
  --grain: .05;
}

/* ================================================================ base */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); }
html.theme-anim, html.theme-anim * { transition: background-color .4s, color .4s, border-color .4s !important; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.55 var(--f-body);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  min-height: 100vh; min-height: 100dvh;
  overflow-x: hidden;
  padding-bottom: calc(var(--tab-h) + var(--safe-b) + 28px);
  -webkit-tap-highlight-color: transparent;
}
/* paper grain behind everything */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: var(--grain);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .5  0 0 0 0 .5  0 0 0 0 .5  0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
body.reading, body.sheet-open { overflow: hidden; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.15; letter-spacing: -.01em; }
p { margin: 0; }
a { color: var(--teal); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
img { max-width: 100%; }
:focus-visible { outline: 2.5px solid var(--teal-fill); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--pink-fill); color: #fff; }
mark { background: color-mix(in srgb, var(--gold-fill) 55%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.muted { color: var(--muted); }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 200; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; }
.skip:focus { left: 8px; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter); }
:where(main, .sheet, .reader, .foot) .small { font-size: 13px; line-height: 1.5; }
.linkish { background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: inherit; opacity: .8; }

/* mana symbols: used by the page and the game table */
.ms {
  display: inline-grid; grid-template-columns: minmax(0, 1fr); place-items: center; width: 1.32em; height: 1.32em; border-radius: 50%;
  font: 700 .7em/1 var(--f-mono); letter-spacing: 0; vertical-align: -.24em; margin: 0 1px;
  background: var(--mana-c); color: var(--mana-c-ink); box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .18);
}
.ms.w { background: var(--mana-w); color: var(--mana-w-ink); }
.ms.g { background: var(--mana-g); color: var(--mana-g-ink); }
.ms.u { background: var(--mana-u); color: var(--mana-u-ink); }
.ms.b { background: var(--mana-b); color: var(--mana-b-ink); }
.ms.r { background: var(--mana-r); color: var(--mana-r-ink); }
.ms.t { background: var(--ink); color: var(--bg); }
.ms.phy { font-size: .62em; width: 2.1em; height: 2.1em; vertical-align: -.5em; letter-spacing: -.06em; }
.ms.hy { font-size: .5em; width: 2.2em; height: 2.2em; vertical-align: -.5em; background: linear-gradient(135deg, var(--mana-c) 50%, var(--surface-3) 50%); }
.ms.hy.gw, .ms.hy.wg { background: linear-gradient(135deg, var(--mana-g) 50%, var(--mana-w) 50%); color: var(--ink); }
.ms.hy.rw, .ms.hy.wr { background: linear-gradient(135deg, var(--mana-r) 50%, var(--mana-w) 50%); color: var(--ink); }
.ms.hy.wb, .ms.hy.bw { background: linear-gradient(135deg, var(--mana-w) 50%, var(--mana-b) 50%); color: var(--ink); }
.ms.hy.rg, .ms.hy.gr { background: linear-gradient(135deg, var(--mana-r) 50%, var(--mana-g) 50%); color: var(--ink); }
.ms.hy.ub, .ms.hy.bu, .ms.hy.ur, .ms.hy.ru, .ms.hy.gu, .ms.hy.ug, .ms.hy.wu, .ms.hy.uw { background: linear-gradient(135deg, var(--mana-u) 50%, var(--mana-c) 50%); color: var(--ink); }
.ms.hy.br, .ms.hy.rb, .ms.hy.bg, .ms.hy.gb { background: linear-gradient(135deg, var(--mana-b) 50%, var(--mana-c) 50%); color: var(--ink); }

/* ================================================================ header */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: var(--glass);
  -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px);
  border-bottom: 1px solid var(--line);
  transition: transform .38s var(--spring);
}
body.hdr-up .topbar { transform: translateY(calc(-1 * var(--top-h))); }
.topbar .bar { height: var(--top-h); display: flex; align-items: center; gap: 10px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; min-width: 0; margin-right: auto; }
.brand-mark { width: 32px; height: 32px; flex: none; transition: transform .5s var(--bounce); }
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.05); }
.bm-bg { fill: var(--ink); }
.bm-m { stroke: var(--teal-fill); }
.bm-dot { fill: var(--pink-fill); }
.brand-txt { display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; min-width: 0; }
.brand-txt b { font: 800 15px/1 var(--f-display); letter-spacing: -.02em; }
.brand-txt small { font: 500 9.5px/1.2 var(--f-mono); color: var(--muted); text-transform: uppercase; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-actions { display: flex; gap: 6px; }
.icon-btn {
  width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 0;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer;
  transition: transform .15s var(--ease), background .2s, border-color .2s;
}
.icon-btn:active { transform: scale(.92); }
.icon-btn svg { width: 20px; height: 20px; }
#themeBtn .i-moon { display: none; }
:root[data-theme="light"] #themeBtn .i-sun { display: none; }
:root[data-theme="light"] #themeBtn .i-moon { display: block; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) #themeBtn .i-sun { display: none; } :root:not([data-theme="dark"]) #themeBtn .i-moon { display: block; } }
.topnav { display: none; }

/* segment bar: the second row of the header */
.segbar { border-top: 1px solid var(--line); }
body.no-seg .segbar { display: none; }
.seg-track {
  position: relative; display: flex; gap: 2px; align-items: center; height: var(--seg-h);
  overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter);
}
.seg-track::-webkit-scrollbar { display: none; }
.seg-link {
  position: relative; z-index: 1; flex: none; display: inline-flex; align-items: center; height: 34px; padding: 0 15px;
  border-radius: 999px; font: 600 14px/1 var(--f-body); color: var(--muted); text-decoration: none; white-space: nowrap;
  transition: color .25s;
}
.seg-link:hover { color: var(--ink); }
.seg-link[aria-selected="true"] { color: var(--bg); }
.seg-ind {
  position: absolute; z-index: 0; left: 0; top: 50%; height: 34px; margin-top: -17px;
  width: var(--w, 0); transform: translateX(var(--x, 0)); border-radius: 999px; background: var(--ink);
  transition: transform .5s var(--spring), width .5s var(--spring);
}
.seg-ind.no-anim { transition: none; }

/* bottom tab bar */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  padding: 4px 8px calc(4px + var(--safe-b));
  background: var(--glass);
  -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px);
  border-top: 1px solid var(--line);
}
.tabs { display: grid; grid-template-columns: repeat(var(--tabs, 5), minmax(0, 1fr)); max-width: calc(var(--tabs, 5) * 104px); margin: 0 auto; align-items: end; }
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0 4px; min-width: 0;
  color: var(--muted); text-decoration: none; font: 600 11px/1.1 var(--f-body); position: relative;
}
.tab-ic { width: 46px; height: 30px; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; border-radius: 999px; transition: background .25s, color .25s, transform .35s var(--bounce); }
.tab-ic svg { width: 22px; height: 22px; }
.tab[aria-current] { color: var(--ink); }
.tab[aria-current] .tab-ic { background: var(--teal-soft); color: var(--teal); }
.tab:active .tab-ic { transform: scale(.88); }
.tab-play .tab-ic {
  position: relative; width: 58px; height: 58px; margin-top: -30px; margin-bottom: -2px; border-radius: 50%;
  background: conic-gradient(from 210deg, var(--teal-fill), #8ff5ec, var(--pink-fill), var(--gold-fill), var(--teal-fill));
  color: #07090c; box-shadow: 0 10px 26px -8px rgba(255, 61, 139, .65), 0 0 0 5px var(--bg);
}
.tab-play .tab-ic svg { width: 24px; height: 24px; margin-left: 3px; }
.tab-play[aria-current] .tab-ic { background: conic-gradient(from 210deg, var(--teal-fill), #8ff5ec, var(--pink-fill), var(--gold-fill), var(--teal-fill)); color: #07090c; }
.tab-play .tab-ic::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid var(--pink-fill); opacity: 0; animation: ring-out 3.2s var(--ease) infinite 1s; }
.tab-play[aria-current] .tab-ic::after { animation: none; }
@keyframes ring-out { 0% { transform: scale(.9); opacity: .7; } 60%, 100% { transform: scale(1.45); opacity: 0; } }

/* ================================================================ views and segments */
.view, .segment { display: none; }
.view.active, .segment.on { display: block; }
.enter-fwd { animation: enter-fwd .45s var(--ease) both; }
.enter-back { animation: enter-back .45s var(--ease) both; }
@keyframes enter-fwd { from { opacity: 0; transform: translate3d(26px, 0, 0); } }
@keyframes enter-back { from { opacity: 0; transform: translate3d(-26px, 0, 0); } }
@keyframes fade-up { from { opacity: 0; transform: translateY(10px); } }
@keyframes bump { 40% { transform: scale(1.18); } }
@keyframes shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
@keyframes live { 0% { box-shadow: 0 0 0 0 rgba(255, 61, 139, .6); } 70%, 100% { box-shadow: 0 0 0 10px rgba(255, 61, 139, 0); } }
@keyframes eqb { from { transform: scaleY(.25); } to { transform: scaleY(1); } }
:where(main, .sheet, .reader) .bump { display: inline-block; animation: bump .35s var(--bounce); }
:where(main, .sheet, .reader) .meter.bump { display: grid; grid-template-columns: minmax(0, 1fr); animation: none; }
.block { padding: 36px 0 8px; }
.block.rv { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.block.rv.in { opacity: 1; transform: none; }
.section-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin-bottom: 20px; }
:where(main, .sheet, .reader) .eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin: 0;
  font: 600 11px/1.2 var(--f-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--teal);
}
.section-head .eyebrow::before { content: ""; width: 16px; height: 3px; border-radius: 2px; background: var(--pink-fill); }
.section-head h2 { font: 800 clamp(25px, 7vw, 42px)/1.04 var(--f-display); letter-spacing: -.035em; text-wrap: balance; }
.section-head > .muted { max-width: 44em; font-size: 15px; }
.prose { font-size: 16.5px; line-height: 1.62; color: var(--ink-soft); max-width: 44em; }
:where(main, .sheet, .reader) .panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow-1); display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-content: start; }
.grid-2, .grid-3, .split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 14px; }

/* buttons, chips, tags */
:where(main, .sheet, .reader) .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border-radius: 999px; border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font: 600 15px/1.1 var(--f-body); text-decoration: none; cursor: pointer; text-align: center;
  transition: transform .15s var(--ease), background .2s, border-color .2s, box-shadow .25s, opacity .2s;
}
:where(main, .sheet, .reader) .btn:hover { border-color: var(--ink); }
:where(main, .sheet, .reader) .btn:active { transform: scale(.97); }
:where(main, .sheet, .reader) .btn.primary { background: var(--teal-fill); border-color: transparent; color: var(--on-fill); box-shadow: 0 8px 22px -10px rgba(57, 197, 187, .9); }
:where(main, .sheet, .reader) .btn.pink { background: var(--pink-fill); border-color: transparent; color: #fff; box-shadow: 0 8px 22px -10px rgba(255, 61, 139, .9); }
:where(main, .sheet, .reader) .btn.ghost { background: transparent; }
:where(main, .sheet, .reader) .btn:disabled { opacity: .42; cursor: default; transform: none; box-shadow: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 13px; flex: none;
  border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font: 600 13.5px/1 var(--f-body); cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background .2s, color .2s, border-color .2s, transform .15s var(--ease);
}
.chip:active { transform: scale(.95); }
.chip .n { font: 500 10.5px/1 var(--f-mono); color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip[aria-pressed="true"] .n { color: color-mix(in srgb, var(--bg) 65%, transparent); }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.tag {
  display: inline-flex; align-items: center; min-height: 22px; padding: 4px 8px; border-radius: 6px; max-width: 100%;
  font: 600 10px/1.25 var(--f-mono); text-transform: uppercase; letter-spacing: .02em;
  background: var(--surface-2); color: var(--ink-soft); border: 1px solid var(--line);
}
.tag.new { background: var(--pink-fill); color: #fff; border-color: transparent; }
.tag.miku { background: var(--teal-soft); color: var(--teal); border-color: transparent; }
.tag.when { background: transparent; }
.inline-card {
  display: inline; padding: 0; border: 0; background: none; cursor: pointer; font: inherit; font-weight: 600; color: var(--teal);
  text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--teal) 35%, transparent);
  text-decoration-thickness: 1.5px; text-underline-offset: 3px; text-align: left;
}
.inline-card:hover { text-decoration-color: currentColor; }
.nw { white-space: nowrap; }
.nw .inline-card { white-space: normal; }
.new-dot { display: inline-block; font: 700 9px/1 var(--f-mono); color: #fff; background: var(--pink-fill); padding: 3px 5px; border-radius: 4px; vertical-align: 2px; }
.syn { display: flex; flex-wrap: wrap; gap: 6px; }

/* the VU meter used for card ratings */
.vu { display: inline-flex; gap: 2px; align-items: end; height: 13px; flex: none; }
.vu i { width: 4px; border-radius: 1px; background: var(--line-strong); }
.vu i:nth-child(1) { height: 36%; } .vu i:nth-child(2) { height: 52%; } .vu i:nth-child(3) { height: 68%; } .vu i:nth-child(4) { height: 84%; } .vu i:nth-child(5) { height: 100%; }
.vu i.on { background: var(--teal-fill); }
.vu i.on:nth-child(4) { background: var(--gold-fill); }
.vu i.on:nth-child(5) { background: var(--pink-fill); }

/* ================================================================ card art */
.mini-card { position: relative; display: block; aspect-ratio: 63 / 88; border-radius: 4.75% / 3.4%; overflow: hidden; background: var(--surface-3); box-shadow: var(--shadow-1); }
.mini-card img { display: block; width: 100%; height: 100%; object-fit: cover; animation: img-in .5s var(--ease); }
@keyframes img-in { from { opacity: 0; } }
.mini-card .frame {
  position: absolute; inset: 0; display: flex; flex-direction: column; gap: 6px; padding: 11% 9%;
  background: linear-gradient(160deg, var(--surface-2), var(--surface-3)); border: 1px solid var(--line); border-radius: inherit;
  font-size: 11.5px; line-height: 1.25; text-align: left; color: var(--ink);
}
.mini-card .frame b { font-weight: 700; font-size: 12px; }
.mini-card .fr-cost { font-size: 13px; }
.mini-card .fr-type { margin-top: auto; font-size: 10px; color: var(--muted); }
.foil { position: relative; display: block; border-radius: 4.75% / 3.4%; transform: perspective(800px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .6s var(--ease); will-change: transform; }
.foil.tracking { transition: transform .08s linear; }
.foil .mini-card { box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .6); }
.shine {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none; mix-blend-mode: color-dodge; opacity: .35;
  background:
    radial-gradient(circle at var(--mx, 30%) var(--my, 20%), rgba(255, 255, 255, .55), transparent 42%),
    linear-gradient(115deg, transparent 22%, rgba(57, 197, 187, .45) 40%, rgba(255, 61, 139, .4) 55%, rgba(255, 200, 74, .3) 66%, transparent 80%);
  background-size: 100% 100%, 250% 250%;
  animation: foil-drift 7s ease-in-out infinite alternate;
}
.foil.tracking .shine { opacity: .85; animation: none; background-position: 0 0, var(--mx) var(--my); }
@keyframes foil-drift { from { background-position: 0 0, 0% 0%; } to { background-position: 0 0, 100% 100%; } }

/* ================================================================ Guide: the stage */
.hero { position: relative; isolation: isolate; overflow: hidden; background: var(--stage); color: var(--stage-ink); padding-bottom: 86px; }
.hero::before, .hero::after { content: ""; position: absolute; top: -8%; height: 125%; width: 150%; z-index: -1; pointer-events: none; filter: blur(12px); }
.hero::before { left: -25%; background: conic-gradient(from 132deg at 24% 0%, transparent 0deg, rgba(57, 197, 187, .34) 10deg, rgba(57, 197, 187, .06) 22deg, transparent 32deg); transform-origin: 24% 0%; animation: sway 9s ease-in-out infinite alternate; }
.hero::after { left: -25%; background: conic-gradient(from 196deg at 76% 0%, transparent 0deg, rgba(255, 61, 139, .07) 8deg, rgba(255, 61, 139, .3) 21deg, transparent 32deg); transform-origin: 76% 0%; animation: sway 12s ease-in-out infinite alternate-reverse; }
@keyframes sway { from { transform: rotate(-6deg); } to { transform: rotate(7deg); } }
.marquee { position: relative; height: 34px; display: flex; align-items: center; overflow: hidden; background: #020304; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.marquee::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle, transparent 0 .7px, #020304 1px) 0 0 / 3px 3px; opacity: .6; }
.marquee-track { display: flex; flex: none; white-space: nowrap; animation: marquee 42s linear infinite; font: 600 12px/1 var(--f-mono); text-transform: uppercase; letter-spacing: .06em; }
.marquee-track > * { padding-right: 18px; }
.marquee-track > *::after { content: "◆"; padding-left: 18px; color: #ffd166; text-shadow: 0 0 8px rgba(255, 209, 102, .9); }
.marquee-track span { color: #ff8fbd; text-shadow: 0 0 8px rgba(255, 61, 139, .85); }
.marquee-track b { color: #7ff0e6; font-weight: 600; text-shadow: 0 0 8px rgba(57, 197, 187, .95); }
@keyframes marquee { to { transform: translateX(-50%); } }
.hero-grid { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 26px; padding-top: 26px; }
.hero-copy { position: relative; min-width: 0; container-type: inline-size; }
.kicker { display: inline-flex; align-items: center; gap: 9px; margin: 0; font: 600 10.5px/1.3 var(--f-mono); text-transform: uppercase; letter-spacing: .07em; color: #9feae3; }
.live-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--pink-fill); animation: live 1.8s infinite; }
.hero-title { display: grid; grid-template-columns: minmax(0, 1fr); margin: 12px 0 0; font-family: var(--f-display); line-height: .84; letter-spacing: -.045em; }
.ht-1 { font-size: clamp(30px, 10.5vw, 76px); font-size: min(13cqi, 76px); font-weight: 700; letter-spacing: -.03em; color: var(--stage-ink); }
.ht-2 { position: relative; z-index: 0; width: fit-content; font-size: clamp(72px, 27vw, 236px); font-size: min(30cqi, 236px); font-weight: 900; color: var(--teal-fill); }
.ht-2::after { content: attr(data-t); position: absolute; inset: 0; z-index: -1; color: transparent; -webkit-text-stroke: 2px var(--pink-fill); transform: translate(.045em, .04em); animation: echo 5s ease-in-out infinite alternate; }
@keyframes echo { to { transform: translate(.075em, .02em); } }
.jp { position: absolute; top: 8px; right: 0; writing-mode: vertical-rl; font: 700 13px/1 var(--f-body); letter-spacing: .45em; color: rgba(238, 243, 244, .38); }
.hero-lede { margin-top: 18px; max-width: 36em; font-size: 16.5px; line-height: 1.6; color: #c3ced3; }
.ticket-strip { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 20px 0 0; }
.ticket-strip li { padding: 8px 12px; border-radius: 7px; border: 1px dashed rgba(238, 243, 244, .3); background: rgba(255, 255, 255, .04); font: 600 11px/1 var(--f-mono); text-transform: uppercase; letter-spacing: .02em; color: var(--stage-ink); }
.ticket-strip li.teal { border-color: var(--teal-fill); color: #8ff5ec; }
.ticket-strip li.pink { border-color: var(--pink-fill); color: #ff9cc4; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.hero .btn.ghost { color: var(--stage-ink); border-color: rgba(238, 243, 244, .3); }
.hero .btn.ghost:hover { border-color: var(--stage-ink); }
.cmdr {
  display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 16px; align-items: center; width: 100%; padding: 12px; text-align: left; cursor: pointer;
  border-radius: var(--r); border: 1px solid rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .045); color: var(--stage-ink);
  transition: background .25s, border-color .25s;
}
.cmdr:hover { background: rgba(255, 255, 255, .08); border-color: rgba(57, 197, 187, .5); }
.cmdr-copy { display: grid; grid-template-columns: minmax(0, 1fr); gap: 5px; min-width: 0; }
.cmdr .label { font: 600 10px/1 var(--f-mono); text-transform: uppercase; letter-spacing: .08em; color: #ff8fbd; }
.cmdr-name { font: 800 17px/1.15 var(--f-display); letter-spacing: -.02em; }
.cmdr-desc { font-size: 13.5px; line-height: 1.45; color: var(--stage-soft); }
.wave { position: absolute; left: 0; right: 0; bottom: 0; height: 76px; display: flex; align-items: flex-end; justify-content: center; gap: 3px; padding: 0 var(--gutter); pointer-events: none; }
.wave i { flex: 1 1 0; max-width: 9px; height: 100%; border-radius: 3px 3px 0 0; transform-origin: bottom; transform: scaleY(var(--h)); background: linear-gradient(to top, var(--teal-fill), rgba(57, 197, 187, .15)); opacity: .75; }
.wave i:nth-child(3n) { background: linear-gradient(to top, var(--pink-fill), rgba(255, 61, 139, .1)); }
.wave.live i { animation: sing 1.3s ease-in-out infinite alternate; animation-delay: var(--d); }
@keyframes sing { from { transform: scaleY(var(--h)); } to { transform: scaleY(var(--h2)); } }
.hero-stats { position: relative; z-index: 2; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin: -46px 0 0; }
.hero-stats .stat { padding: 14px 14px 13px; border-radius: var(--r-m); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-2); }
.hero-stats dt b { font: 800 29px/1 var(--f-display); letter-spacing: -.04em; }
.hero-stats .stat:nth-child(1) dt b { color: var(--teal); }
.hero-stats .stat:nth-child(3) dt b { color: var(--pink); }
.hero-stats dd { margin: 6px 0 0; font-size: 12.5px; line-height: 1.35; color: var(--muted); }

/* the engine in four beats */
.flow { --fill: 0; position: relative; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.flow::before, .flow::after { content: ""; position: absolute; left: 21px; top: 24px; bottom: 24px; width: 2px; border-radius: 1px; }
.flow::before { background: var(--line); }
.flow::after { background: linear-gradient(var(--teal-fill), var(--pink-fill)); transform-origin: top; transform: scaleY(var(--fill)); }
.flow li { position: relative; z-index: 1; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 14px; }
.beat { width: 44px; height: 44px; border-radius: 50%; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; background: var(--surface); border: 2px solid var(--teal-fill); color: var(--teal); font: 800 16px/1 var(--f-display); }
.flow li:last-child .beat { border-color: var(--pink-fill); color: var(--pink); }
.flow b { display: block; padding-top: 4px; font: 700 17px/1.2 var(--f-display); letter-spacing: -.02em; }
.flow p { margin-top: 5px; color: var(--ink-soft); font-size: 15px; }

/* resume the guide */
.resume { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.resume-card {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 16px;
  border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1);
  color: var(--ink); text-decoration: none; transition: transform .25s var(--ease), box-shadow .25s, border-color .25s;
}
.resume-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: var(--line-strong); }
.rc-ring { --p: 0; position: relative; width: 64px; height: 64px; border-radius: 50%; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; background: conic-gradient(var(--teal-fill) calc(var(--p) * 360deg), var(--surface-3) 0); }
.rc-ring::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--surface); }
.rc-ring b, .rc-ring small { position: relative; }
.rc-ring b { font: 800 20px/1 var(--f-display); }
.rc-ring small { position: absolute; bottom: 13px; font: 500 9px/1 var(--f-mono); color: var(--muted); }
.rc-ring b { transform: translateY(-4px); }
.rc-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; min-width: 0; }
.rc-lead { font-size: 10.5px; text-transform: uppercase; color: var(--pink); letter-spacing: .02em; }
.rc-body b { font: 700 17px/1.2 var(--f-display); letter-spacing: -.02em; }
.rc-body .muted { font-size: 14px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rc-go { width: 44px; height: 44px; border-radius: 50%; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; background: var(--ink); color: var(--bg); transition: transform .3s var(--bounce); }
.resume-card:hover .rc-go { transform: scale(1.08); }
.rc-go svg { margin-left: 2px; }
.all-tracks { justify-self: start; font-weight: 600; font-size: 15px; padding: 4px 2px; }

/* the play promo, a small stage */
.play-promo {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 18px;
  border-radius: var(--r); color: var(--stage-ink); text-decoration: none;
  background: radial-gradient(120% 150% at 0% 0%, rgba(57, 197, 187, .32), transparent 55%), radial-gradient(120% 150% at 100% 100%, rgba(255, 61, 139, .34), transparent 55%), var(--stage);
  box-shadow: var(--shadow-2); transition: transform .25s var(--ease);
}
.play-promo:hover { transform: translateY(-2px); }
.pp-eq { display: flex; gap: 3px; align-items: end; height: 36px; }
.pp-eq i { width: 5px; height: 100%; border-radius: 3px; background: var(--teal-fill); transform-origin: bottom; animation: eqb .9s ease-in-out infinite alternate; }
.pp-eq i:nth-child(2) { background: var(--pink-fill); animation-delay: -.3s; animation-duration: .7s; }
.pp-eq i:nth-child(3) { background: var(--gold-fill); animation-delay: -.5s; animation-duration: 1.1s; }
.pp-eq i:nth-child(4) { animation-delay: -.2s; animation-duration: .8s; }
.pp-eq i:nth-child(5) { background: var(--pink-fill); animation-delay: -.7s; }
.pp-copy { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; min-width: 0; }
.pp-copy .eyebrow, .pp-k { font: 600 10.5px/1 var(--f-mono); text-transform: uppercase; letter-spacing: .08em; color: #ff8fbd; }
.pp-copy b { font: 800 18px/1.15 var(--f-display); letter-spacing: -.02em; }
.pp-copy .muted { color: var(--stage-soft); font-size: 14px; line-height: 1.4; }
.pp-go { width: 48px; height: 48px; border-radius: 50%; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; background: var(--pink-fill); color: #fff; animation: live 2.2s infinite; }
.pp-go svg { margin-left: 3px; }

/* ================================================================ Guide: tracklist */
.tracklist { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.track a { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 16px 2px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; transition: background .2s; }
.track a:hover { background: var(--surface-2); }
.tr-no { font: 800 30px/1 var(--f-display); letter-spacing: -.05em; color: transparent; -webkit-text-stroke: 1.3px var(--line-strong); transition: color .3s; }
.track.read .tr-no { -webkit-text-stroke-color: var(--teal); }
.track.now .tr-no { color: var(--pink-fill); -webkit-text-stroke-color: var(--pink-fill); }
.track a:hover .tr-no { -webkit-text-stroke-color: var(--ink); }
.tr-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; min-width: 0; }
.tr-kicker { font: 600 10px/1.2 var(--f-mono); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.tr-title { font: 700 16px/1.25 var(--f-display); letter-spacing: -.02em; }
.tr-sum { font-size: 14px; line-height: 1.4; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tr-side { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: end; gap: 8px; padding-top: 2px; }
.tr-time { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.tr-state { display: flex; align-items: center; gap: 5px; font: 700 11px/1 var(--f-body); color: var(--pink); white-space: nowrap; }
.tr-state .tick { display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--teal-soft); color: var(--teal); font-size: 12px; }
.eq-ic { display: inline-flex; gap: 2px; align-items: end; height: 12px; }
.eq-ic i { width: 3px; height: 100%; background: currentColor; border-radius: 1px; transform-origin: bottom; animation: eqb .8s ease-in-out infinite alternate; }
.eq-ic i:nth-child(2) { animation-delay: -.3s; } .eq-ic i:nth-child(3) { animation-delay: -.55s; }
#guideMeta b { color: var(--ink); }

/* ================================================================ Guide: the reader */
.reader {
  position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; background: var(--bg);
  transform: translate3d(0, 100%, 0); visibility: hidden;
  transition: transform .5s var(--spring), visibility 0s .5s;
}
.reader.open { transform: none; visibility: visible; transition: transform .5s var(--spring), visibility 0s; }
.reader-bar {
  position: relative; flex: none; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 8px; align-items: center;
  min-height: 58px; padding: env(safe-area-inset-top, 0px) 12px 0;
  background: var(--glass); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border-bottom: 1px solid var(--line);
}
.reader-bar .icon-btn { border-radius: 50%; }
.reader-now { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; min-width: 0; }
.reader-now .mono { font-size: 10px; text-transform: uppercase; color: var(--pink); letter-spacing: .02em; }
.reader-now b { font: 700 14.5px/1.2 var(--f-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader-time { font-size: 10.5px; color: var(--muted); padding-right: 4px; }
.scrubber { position: absolute; left: 0; right: 0; bottom: -2px; height: 3px; }
.scrubber i { display: block; height: 100%; transform-origin: left; transform: scaleX(0); background: linear-gradient(90deg, var(--teal-fill), var(--pink-fill)); }
.reader-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.chapter { max-width: 700px; margin: 0 auto; padding: 26px var(--gutter) calc(56px + var(--safe-b)); }
.chapter.turn { animation: fade-up .45s var(--ease); }
.ch-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding-bottom: 22px; margin-bottom: 26px; border-bottom: 1px solid var(--line); }
.ch-kicker { display: flex; flex-wrap: wrap; gap: 6px 12px; font: 600 10.5px/1.2 var(--f-mono); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.ch-kicker .mono { color: var(--pink); }
.ch-head h1 { font: 800 clamp(29px, 8.4vw, 48px)/1.03 var(--f-display); letter-spacing: -.04em; text-wrap: balance; }
.ch-sum { font-size: 18.5px; line-height: 1.5; color: var(--ink-soft); }
.ch-meta { display: flex; gap: 16px; font-size: 10.5px; color: var(--muted); text-transform: uppercase; }
.ch-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; font-size: 17px; line-height: 1.7; }
.ch-body > p { color: var(--ink); }
.r-h { display: flex; gap: 10px; align-items: baseline; margin-top: 16px; font: 700 21px/1.2 var(--f-display); letter-spacing: -.025em; }
.r-h::before { content: ""; flex: none; width: 10px; height: 10px; border-radius: 3px; background: var(--pink-fill); transform: translateY(-2px); }
.r-steps { list-style: none; margin: 0 0 0 17px; padding: 0; border-left: 2px solid var(--line); }
.r-steps li { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; margin-left: -19px; padding-bottom: 18px; }
.r-steps li:last-child { padding-bottom: 2px; }
.r-n { width: 36px; height: 36px; border-radius: 50%; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; background: var(--ink); color: var(--bg); font-size: 11.5px; }
.r-steps b { display: block; padding-top: 5px; font-size: 17px; line-height: 1.4; }
.r-steps p { margin-top: 4px; color: var(--ink-soft); font-size: 16px; line-height: 1.6; }
.r-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.r-list li { position: relative; padding-left: 24px; }
.r-list li::before { content: ""; position: absolute; left: 5px; top: .68em; width: 8px; height: 8px; border-radius: 50%; background: var(--teal-fill); }
.r-call { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 16px 16px 16px 18px; border-radius: var(--r-m); background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--teal-fill); }
.r-call.key { border-left-color: var(--gold-fill); background: color-mix(in srgb, var(--gold-fill) 9%, var(--surface)); }
.r-call.warn { border-left-color: var(--pink-fill); background: color-mix(in srgb, var(--pink-soft) 55%, var(--surface)); }
.r-call .r-call-k { font-size: 10px; line-height: 1.3; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.r-call h4 { font: 700 17px/1.3 var(--f-body); }
.r-call p { font-size: 16px; line-height: 1.6; }
.r-cards { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.r-cards-row { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 2px 10px; scrollbar-width: thin; }
.r-card { flex: 0 0 clamp(118px, 34vw, 176px); scroll-snap-align: start; padding: 0; border: 0; background: none; cursor: pointer; transition: transform .25s var(--ease); }
.r-card:hover { transform: translateY(-4px) rotate(-1deg); }
.r-cards figcaption { font-size: 14px; line-height: 1.5; color: var(--muted); }
.r-qa { display: grid; grid-template-columns: minmax(0, 1fr); }
.r-math { border-radius: var(--r-m); background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.r-math ol { list-style: none; margin: 0; padding: 0; }
.r-math li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 11px 14px; border-bottom: 1px dashed var(--line-strong); font-size: 15px; line-height: 1.45; }
.r-math li b { align-self: center; white-space: nowrap; font: 600 12.5px/1.2 var(--f-mono); color: var(--teal); text-align: right; }
.r-total { padding: 12px 14px; background: var(--surface-2); font-size: 15px; line-height: 1.5; }
.r-widget { margin: 4px 0; }
.ch-end { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 44px; }
.ch-endmark { display: flex; align-items: center; gap: 12px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.ch-endmark::before, .ch-endmark::after { content: ""; flex: 1; height: 1px; background: var(--line-strong); }
.next-track {
  position: relative; isolation: isolate; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 14px; padding: 20px;
  border-radius: var(--r); color: var(--stage-ink); text-decoration: none;
  background: radial-gradient(120% 160% at 100% 0%, rgba(255, 61, 139, .32), transparent 55%), radial-gradient(100% 140% at 0% 100%, rgba(57, 197, 187, .28), transparent 60%), var(--stage);
}
.nt-k { grid-column: 1; font-size: 10.5px; text-transform: uppercase; color: #ff8fbd; }
.next-track b { grid-column: 1; font: 800 22px/1.12 var(--f-display); letter-spacing: -.03em; }
.nt-s { grid-column: 1; color: var(--stage-soft); font-size: 14.5px; line-height: 1.45; }
.nt-go { grid-column: 2; grid-row: 1 / span 3; align-self: center; width: 54px; height: 54px; border-radius: 50%; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; background: var(--teal-fill); color: #07090c; font-size: 20px; transition: transform .3s var(--bounce); }
.next-track:hover .nt-go { transform: scale(1.1); }
.fin { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; justify-items: center; text-align: center; padding: 26px 18px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.fin b { font: 800 20px/1.2 var(--f-display); }
.ch-nav { justify-content: space-between; }
.ch-nav .btn.ghost { max-width: 60%; overflow: hidden; }

/* ================================================================ shared content pieces */
details.faq, details.gl, details.ruling { border-bottom: 1px solid var(--line); }
details.faq > summary, details.gl > summary, details.ruling > summary, details.mu > summary, details.set-group > summary, details.simp > summary, .w-logbox > summary, details.vs-row > summary, .assumptions > summary {
  list-style: none; cursor: pointer; position: relative;
}
summary::-webkit-details-marker { display: none; }
details.faq > summary, details.gl > summary, details.ruling > summary { padding: 14px 34px 14px 0; font-weight: 650; font-size: 15.5px; line-height: 1.4; }
details.faq > summary::after, details.gl > summary::after, details.ruling > summary::after, details.mu > summary::after, details.simp > summary::after, .w-logbox > summary::after, .assumptions > summary::after {
  content: ""; position: absolute; right: 6px; top: 50%; width: 9px; height: 9px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: translateY(-70%) rotate(45deg); transition: transform .3s var(--spring);
}
details.faq[open] > summary::after, details.gl[open] > summary::after, details.ruling[open] > summary::after, details.mu[open] > summary::after, details.simp[open] > summary::after, .w-logbox[open] > summary::after, .assumptions[open] > summary::after { transform: translateY(-25%) rotate(-135deg); }
details.faq > div, details.gl > div, details.ruling > div { padding: 0 0 16px; color: var(--ink-soft); font-size: 15px; line-height: 1.6; animation: fade-up .3s var(--ease); }
.faq-list { border-top: 2px solid var(--ink); }
.faqs { display: grid; grid-template-columns: minmax(0, 1fr); }
.note-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
:where(main, .sheet, .reader) .note { padding: 12px 14px; border-radius: var(--r-m); background: var(--surface-2); border-left: 3px solid var(--teal-fill); }
:where(main, .sheet, .reader) .note h4 { margin-bottom: 6px; font: 600 10.5px/1.2 var(--f-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
:where(main, .sheet, .reader) .note p, :where(main, .sheet, .reader) .note li { font-size: 15px; line-height: 1.55; }
:where(main, .sheet, .reader) .note ul { margin: 0; padding-left: 18px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
:where(main, .sheet, .reader) .note.warn { border-left-color: var(--pink-fill); background: color-mix(in srgb, var(--pink-soft) 55%, var(--surface)); }
:where(main, .sheet, .reader) .note.tip { border-left-color: var(--gold-fill); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font: 600 10.5px/1.3 var(--f-mono); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-family: var(--f-mono); font-size: 13px; white-space: nowrap; }
@media (max-width: 699px) {
  .table-wrap:has(table.stack) { border: 0; background: none; overflow: visible; }
  table.stack, table.stack tbody { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
  table.stack thead { display: none; }
  table.stack tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 12px 14px; border-radius: var(--r-m); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
  table.stack td { padding: 0; border: 0; text-align: left; }
  table.stack td:first-child { grid-column: 1 / -1; font-weight: 700; }
  table.stack td::before { content: attr(data-label); display: block; font: 600 9.5px/1.5 var(--f-mono); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
  table.stack td:first-child::before { display: none; }
  table.stack td.num { text-align: left; }
  table.stack td:last-child:not(.num) { grid-column: 1 / -1; color: var(--ink-soft); }
}

/* ================================================================ Guide: combos as tickets */
.ticket { border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-2); overflow: hidden; }
.ticket > summary {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 12px; padding: 18px 18px 24px;
  grid-template-areas: "admit open" "title title" "kind serial";
  background: radial-gradient(130% 160% at 0% 0%, rgba(57, 197, 187, .38), transparent 55%), var(--stage);
  color: var(--stage-ink); cursor: pointer;
}
.ticket.pinkish > summary { background: radial-gradient(130% 160% at 0% 0%, rgba(255, 61, 139, .42), transparent 55%), var(--stage); }
.ticket.plain > summary { background: radial-gradient(130% 160% at 0% 0%, rgba(255, 200, 74, .34), transparent 55%), var(--stage); }
.ticket > summary::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 12px;
  background: radial-gradient(circle at 8px 6px, var(--surface) 0 5px, transparent 5.6px) 0 0 / 16px 12px repeat-x;
}
.admit { grid-area: admit; align-self: center; font: 700 11px/1 var(--f-mono); text-transform: uppercase; letter-spacing: .14em; color: #8ff5ec; }
.ticket.pinkish .admit { color: #ff9cc4; }
.ticket.plain .admit { color: #ffd98a; }
.t-title { grid-area: title; font: 800 clamp(21px, 6vw, 30px)/1.08 var(--f-display); letter-spacing: -.03em; text-wrap: balance; }
.kind { grid-area: kind; justify-self: start; padding: 6px 10px; border-radius: 999px; background: var(--teal-fill); color: #07090c; font: 700 10.5px/1 var(--f-mono); text-transform: uppercase; letter-spacing: .02em; }
.ticket.pinkish .kind { background: var(--pink-fill); color: #fff; }
.ticket.plain .kind { background: var(--gold-fill); }
.serial { grid-area: serial; align-self: center; font-size: 10px; color: #8b99a4; text-transform: uppercase; }
.t-open { grid-area: open; justify-self: end; position: relative; width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(238, 243, 244, .28); }
.t-open::before, .t-open::after { content: ""; position: absolute; left: 50%; top: 50%; width: 12px; height: 2px; margin: -1px 0 0 -6px; border-radius: 1px; background: var(--stage-ink); transition: transform .35s var(--spring); }
.t-open::after { transform: rotate(90deg); }
.ticket[open] .t-open::after { transform: rotate(0deg); }
.ticket-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 24px 18px 18px; }
.pieces { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.plus { font: 700 20px/1 var(--f-body); color: var(--pink); }
.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 14px; margin: 0; font-size: 15px; }
.kv dt { font: 600 10.5px/1.9 var(--f-mono); text-transform: uppercase; color: var(--muted); }
.kv dd { margin: 0; line-height: 1.5; }
:where(main, .sheet, .reader) .steps { list-style: none; counter-reset: s; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
:where(main, .sheet, .reader) .steps li { counter-increment: s; display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; font-size: 15.5px; line-height: 1.5; }
:where(main, .sheet, .reader) .steps li::before { content: counter(s); width: 30px; height: 30px; border-radius: 50%; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; background: var(--teal-soft); color: var(--teal); font: 700 12px/1 var(--f-mono); }

/* combo simulators */
.sim { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 14px; border-radius: var(--r-m); background: var(--surface-2); border: 1px solid var(--line); }
.sim-top { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 14px; align-items: center; }
.ring { position: relative; width: 116px; height: 116px; color: var(--ink); }
.ring svg { width: 100%; height: 100%; overflow: visible; }
.ring text { font-family: var(--f-mono); }
.ring .track { fill: none; stroke: var(--line-strong); stroke-width: 2; stroke-dasharray: 3 5; }
.ring .orbit { transform-origin: 66px 66px; }
.ring .orbit circle { fill: var(--pink-fill); }
.ring.spin .orbit { animation: orbit .8s var(--ease); }
.ring.spinning .orbit { animation: orbit .7s linear infinite; }
@keyframes orbit { to { transform: rotate(360deg); } }
.ring .node { fill: var(--surface); stroke: var(--line-strong); stroke-width: 1.5; transition: fill .15s, stroke .15s; }
.ring .node.hot { fill: var(--teal-fill); stroke: var(--teal-fill); }
.ring .center { position: absolute; inset: 0; display: grid; grid-template-columns: minmax(0, 1fr); place-content: center; text-align: center; pointer-events: none; }
.ring .center b { font: 800 24px/1 var(--f-display); }
.ring .center span { font-size: 10.5px; color: var(--muted); }
.ring-legend { margin: 0; padding-left: 18px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; font-size: 13.5px; line-height: 1.35; }
.ring-legend li { transition: color .15s; }
.ring-legend li.hot { color: var(--teal); font-weight: 700; }
.sim-meters { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 8px; }
.meter { display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; padding: 8px 10px; border-radius: var(--r-s); background: var(--surface); border: 1px solid var(--line); }
.meter span:first-child { font-size: 11px; color: var(--muted); line-height: 1.2; }
.meter b { font: 700 18px/1.1 var(--f-mono); }
.meter .hp { height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.meter .hp i { display: block; height: 100%; width: 100%; background: var(--leaf); transition: width .2s; }
.meter.low .hp i { background: var(--gold-fill); }
.meter.dead { opacity: .55; }
.meter.dead b { color: var(--pink); text-decoration: line-through; }
.meter.bump b { animation: bump .35s var(--bounce); }
.meter.hit { animation: shake .3s; }
.sim-log { min-height: 3em; padding: 10px 12px; border-radius: var(--r-s); background: var(--surface); border: 1px dashed var(--line-strong); font: 12.5px/1.5 var(--f-mono); color: var(--ink-soft); letter-spacing: -.03em; }
.sim .chips { flex-wrap: wrap; }
.sim .btn-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sim .btn { min-height: 44px; padding: 6px 12px; font-size: 14px; line-height: 1.2; }

/* lethal calculator and steppers */
.calc, .w-fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.calc-inputs, .w-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.field { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: 1fr auto; gap: 6px; }
.field-l { font-size: 12.5px; line-height: 1.25; font-weight: 600; color: var(--muted); }
.stepper { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; height: 46px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line-strong); background: var(--surface); }
.stepper button { border: 0; background: var(--surface-2); color: var(--ink); font: 600 20px/1 var(--f-body); cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.stepper button:active { background: var(--teal-soft); }
.stepper input { width: 100%; min-width: 0; border: 0; background: transparent; text-align: center; font: 700 16px/1 var(--f-mono); color: var(--ink); -moz-appearance: textfield; appearance: textfield; }
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.lethal { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.lethal-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 12px; border-radius: var(--r-m); background: var(--surface); border: 1px solid var(--line); transition: border-color .25s, background .25s; }
.lethal-row.win { border-color: color-mix(in srgb, var(--teal-fill) 60%, var(--line)); }
.lethal-row.all { background: color-mix(in srgb, var(--teal-soft) 65%, var(--surface)); }
.lr-top { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: baseline; }
.lr-name { font-weight: 700; font-size: 15px; min-width: 0; }
.lr-mana { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.lr-dmg { font-weight: 700; font-size: 16px; }
.lr-bar { position: relative; height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.lr-bar i { position: absolute; left: 0; top: 0; bottom: 0; width: var(--w, 0); border-radius: 4px; background: linear-gradient(90deg, var(--teal-fill), var(--pink-fill)); transition: width .4s var(--ease); }
.lr-bar .tick { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--surface); }
.lr-foot { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; }
.lr-note { color: var(--muted); }
.verdict { font: 700 10.5px/1.3 var(--f-mono); text-transform: uppercase; white-space: nowrap; }
.verdict.win { color: var(--teal); }
.verdict.no { color: var(--muted); }

/* the engine calculator */
.widget { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.w-engineCalc, .w-drawOdds, .w-handTrainer, .w-lethalCalc { padding: 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.w-head { display: flex; align-items: center; gap: 10px; }
.w-head b { font: 700 16px/1.25 var(--f-display); letter-spacing: -.02em; }
.w-tag { flex: none; padding: 5px 8px; border-radius: 6px; background: var(--pink-fill); color: #fff; font-size: 9.5px; text-transform: uppercase; }
.w-out { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.w-out > div { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; align-content: start; padding: 12px; border-radius: var(--r-m); background: var(--surface-2); border: 1px solid var(--line); }
.w-out b { font: 800 24px/1 var(--f-display); letter-spacing: -.03em; color: var(--teal); overflow-wrap: anywhere; }
.w-out > div:nth-child(2) b { color: var(--pink); }
.w-out span { font-size: 12.5px; line-height: 1.3; color: var(--muted); }
.w-logbox > summary { padding: 10px 28px 10px 0; font-weight: 650; font-size: 14.5px; }
.w-log { margin: 0; padding-left: 20px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; font: 12px/1.5 var(--f-mono); letter-spacing: -.03em; color: var(--ink-soft); max-height: 260px; overflow: auto; }

/* draw odds */
.odds { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.odds-controls { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.select-wrap { position: relative; display: block; }
.select-wrap::after { content: ""; position: absolute; right: 16px; top: 50%; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.select-wrap select { width: 100%; height: 46px; padding: 0 40px 0 14px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: 600 15px/1 var(--f-body); appearance: none; -webkit-appearance: none; cursor: pointer; }
.odds-big { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: center; padding: 14px; border-radius: var(--r-m); background: var(--stage); color: var(--stage-ink); }
.odds-big b { font: 900 44px/1 var(--f-display); letter-spacing: -.05em; color: #7ff0e6; min-width: 2.4em; }
.odds-big span { font-size: 14px; line-height: 1.4; color: var(--stage-soft); }
.odds-big span b { font: 700 14px/1.4 var(--f-body); color: var(--stage-ink); letter-spacing: 0; min-width: 0; }
.odds-bars { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; height: 150px; }
.ob { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: 18px 1fr 22px; gap: 3px; padding: 0; border: 0; background: none; cursor: pointer; min-width: 0; }
.ob-v { font-size: 9.5px; text-align: center; color: var(--muted); }
.ob-bar { position: relative; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.ob-bar i { position: absolute; left: 0; right: 0; bottom: 0; height: var(--h); background: color-mix(in srgb, var(--teal-fill) 55%, var(--surface-3)); border-radius: 4px 4px 0 0; transition: height .45s var(--ease), background .2s; }
.ob-t { font-size: 9.5px; text-align: center; color: var(--muted); align-self: center; }
.ob.on .ob-bar i { background: var(--pink-fill); }
.ob.on .ob-v, .ob.on .ob-t { color: var(--ink); font-weight: 700; }

/* opening hand trainer */
.trainer { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.hand-verdict { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 14px; row-gap: 2px; align-items: center; padding: 12px 14px; border-radius: var(--r-m); background: var(--surface-2); border: 1px solid var(--line); min-height: 76px; }
.hand-verdict > :not(.stamp) { grid-column: 2; }
.hand-verdict b { font: 700 16px/1.2 var(--f-display); }
.hand-verdict span:not(.stamp) { font-size: 14px; line-height: 1.4; color: var(--ink-soft); }
.hand-verdict .stamp { grid-row: 1 / span 3; padding: 8px 10px; border: 2.5px solid currentColor; border-radius: 8px; font: 800 13px/1 var(--f-display); letter-spacing: .02em; transform: rotate(-7deg); }
.hand-verdict.keep .stamp { color: var(--leaf); }
.hand-verdict.mull .stamp { color: var(--pink); }
.hand-verdict.stamped .stamp { animation: stamp .45s var(--bounce); }
@keyframes stamp { from { transform: rotate(-7deg) scale(1.9); opacity: 0; } }
.trainer-hand { display: flex; overflow-x: auto; padding: 14px 6px 12px; scrollbar-width: none; }
.trainer-hand::-webkit-scrollbar { display: none; }
.slot { position: relative; flex: 0 0 24%; max-width: 150px; margin-right: -11%; padding: 0; border: 0; background: none; cursor: pointer; transform: rotate(calc((var(--i) - 3) * 1.6deg)); transform-origin: 50% 120%; transition: transform .3s var(--ease); }
.slot:last-child { margin-right: 0; }
.slot:hover, .slot:focus-visible { z-index: 3; transform: translateY(-12px) rotate(0deg); }
.slot.deal { animation: deal .5s var(--ease) both; animation-delay: calc(var(--i) * 55ms); }
.slot.drawn { animation: drawn .5s var(--bounce) both; }
@keyframes deal { from { opacity: 0; transform: translate(-60px, 50px) rotate(-14deg); } }
@keyframes drawn { from { opacity: 0; transform: translateY(-60px) scale(.8); } }
.trainer-hand.more .slot { flex-basis: 23%; }
.trainer-btns .btn { flex: 1 1 auto; }

/* ================================================================ Guide: game plan */
.snap-row { display: grid; grid-auto-flow: column; grid-auto-columns: 84%; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px var(--gutter) 14px; margin: 0 calc(-1 * var(--gutter)); scroll-padding: 0 var(--gutter); scrollbar-width: none; }
.snap-row::-webkit-scrollbar { display: none; }
.snap-row > * { scroll-snap-align: start; }
.phase { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; align-content: start; padding: 18px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.turns-lbl { font: 600 10.5px/1 var(--f-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--pink); }
.phase .when { font: 800 25px/1 var(--f-display); letter-spacing: -.04em; }
.phase ul { margin: 6px 0 0; padding-left: 18px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; font-size: 15px; line-height: 1.5; color: var(--ink-soft); }
.rule h3 { font: 800 18px/1.1 var(--f-display); letter-spacing: -.02em; display: flex; align-items: center; gap: 8px; }
.rule h3::before { content: ""; width: 10px; height: 10px; border-radius: 50%; }
.rule.keep h3::before { background: var(--leaf); }
.rule.mull h3::before { background: var(--pink-fill); }
.rule ul { margin: 0; padding-left: 18px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; font-size: 15px; }
.turns { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); }
.turns li { display: grid; grid-template-columns: 50px minmax(0, 1fr); gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.turns li:first-child { border-top: 2px solid var(--ink); }
.turns .tn { font: 800 21px/1.2 var(--f-display); letter-spacing: -.03em; color: var(--teal); }
.turns li:last-child .tn { color: var(--pink); }
.turns p { font-size: 15.5px; line-height: 1.55; }
.turns .after { display: inline-block; margin-top: 6px; padding: 4px 8px; border-radius: 6px; background: var(--surface-2); font: 500 11.5px/1.35 var(--f-mono); letter-spacing: -.02em; color: var(--muted); }
.habits { list-style: none; margin: 0; padding: 0; counter-reset: habit; border-top: 2px solid var(--ink); }
.habits li { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 12px; padding: 15px 0; border-bottom: 1px solid var(--line); font-size: 15.5px; line-height: 1.5; }
.habits li::before { counter-increment: habit; content: counter(habit, decimal-leading-zero); font: 800 24px/1.1 var(--f-display); letter-spacing: -.05em; color: transparent; -webkit-text-stroke: 1.2px var(--teal); }
.habits b { display: block; margin-bottom: 2px; }
.matchups { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
details.mu { border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
details.mu > summary { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 12px 44px 12px 14px; font-weight: 700; font-size: 15.5px; }
details.mu > summary::after { right: 18px; }
.mu-ic { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; background: var(--teal-soft); color: var(--teal); font-size: 16px; }
details.mu > div { padding: 0 16px 16px; color: var(--ink-soft); font-size: 15px; line-height: 1.6; animation: fade-up .3s var(--ease); }

/* ================================================================ Cards: browse */
.toolbar {
  position: sticky; top: calc(var(--top-h) + var(--seg-h) + 1px); z-index: 30; padding: 10px 0 8px;
  background: var(--glass); -webkit-backdrop-filter: saturate(1.5) blur(16px); backdrop-filter: saturate(1.5) blur(16px);
  border-bottom: 1px solid var(--line); transition: top .38s var(--spring);
}
body.hdr-up .toolbar { top: calc(var(--seg-h) + 1px); }
.tool-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.search { position: relative; display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 6px 0 12px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); transition: border-color .2s, box-shadow .2s; }
.search:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
.search svg { width: 18px; height: 18px; flex: none; color: var(--muted); }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; color: var(--ink); font: 500 16px/1 var(--f-body); outline: none; }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search .clear { width: 30px; height: 30px; flex: none; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 0; border: 0; border-radius: 50%; background: var(--surface-3); color: var(--ink); cursor: pointer; }
.small-search { margin-bottom: 12px; }
.sort-wrap { position: relative; width: 44px; height: 44px; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); }
.sort-wrap svg { width: 20px; height: 20px; pointer-events: none; }
.sort { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 16px; }
.view-toggle { width: 44px; height: 44px; border-color: var(--line-strong); }
.view-toggle .i-grid { display: none; }
.view-toggle[aria-pressed="true"] .i-grid { display: block; }
.view-toggle[aria-pressed="true"] .i-list { display: none; }
:where(main) .count { padding: 14px 0 2px; font-size: 13px; color: var(--muted); }
:where(main) .count b { color: var(--ink); }
.card-list { padding-bottom: 12px; }
.shelf { padding: 14px 0 4px; }
.shelf-h { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; font: 700 15px/1 var(--f-display); letter-spacing: -.02em; }
.shelf-h .n { font-size: 11px; font-weight: 500; color: var(--muted); }
.shelf-row { display: grid; grid-auto-flow: column; grid-auto-columns: 29%; gap: 10px; overflow-x: auto; scroll-snap-type: x proximity; padding: 2px var(--gutter) 12px; margin: 0 calc(-1 * var(--gutter)); scroll-padding: 0 var(--gutter); scrollbar-width: none; overscroll-behavior-x: contain; }
.shelf-row::-webkit-scrollbar { display: none; }
.shelf-row > * { scroll-snap-align: start; }
.tile-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding-top: 12px; }
.c-tile { position: relative; display: block; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 4.75% / 3.4%; transition: transform .25s var(--ease); }
.c-tile:hover { transform: translateY(-3px); }
.c-tile:active { transform: scale(.96); }
.c-tile .badge { position: absolute; top: 6px; left: 6px; padding: 4px 5px; border-radius: 4px; background: var(--pink-fill); color: #fff; font: 700 8.5px/1 var(--f-mono); box-shadow: 0 2px 8px rgba(0, 0, 0, .35); }
.c-tile .qty { position: absolute; top: 6px; right: 6px; padding: 4px 6px; border-radius: 999px; background: rgba(7, 9, 12, .82); color: #fff; font: 700 10px/1 var(--f-mono); }
.rows { display: grid; grid-template-columns: minmax(0, 1fr); }
.shelf .rows { border-top: 1px solid var(--line); }
.c-row { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%; padding: 10px 0; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--ink); text-align: left; font: inherit; cursor: pointer; transition: background .2s; }
.c-row:hover { background: var(--surface-2); }
.c-row .thumb { width: 48px; height: 48px; border-radius: 12px; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; overflow: hidden; background: var(--surface-3) center / cover no-repeat; font: 700 13px/1 var(--f-display); color: var(--muted); }
.c-row .thumb.has-art span { display: none; }
.c-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; min-width: 0; }
.c-title { font-weight: 700; font-size: 15.5px; line-height: 1.25; }
.c-sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.c-side { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: end; gap: 7px; }
.c-cost { white-space: nowrap; }
:where(main) .empty { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; justify-items: center; padding: 48px 12px; text-align: center; color: var(--muted); }

/* setlist, cuts, glossary */
.setlist { columns: 1; column-gap: 28px; margin-top: 16px; }
.set-group { break-inside: avoid; margin-bottom: 14px; }
.set-group > summary { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 0 8px; border-bottom: 2px solid var(--ink); font: 700 14px/1 var(--f-display); letter-spacing: -.01em; }
.set-group > summary .n { font-size: 11px; font-weight: 500; color: var(--muted); }
.setlist .set-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; width: 100%; padding: 8px 0; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--ink); text-align: left; font: 500 15px/1.3 var(--f-body); cursor: pointer; }
.setlist .set-row:hover .nm { color: var(--teal); }
.setlist .set-row .q { font-size: 11px; color: var(--muted); }
.setlist .set-row .sc { white-space: nowrap; font-size: 14px; }
.cuts { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.cut-row { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.cut-n { font-size: 11px; color: var(--muted); padding-top: 4px; }
.cut-swap { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; font-weight: 650; font-size: 15.5px; margin-bottom: 4px; }
.cut-swap s { color: var(--muted); text-decoration-color: var(--pink-fill); text-decoration-thickness: 2px; }
.cut-swap .arrow { color: var(--pink); font-weight: 800; }
.cut-row .muted { font-size: 14.5px; line-height: 1.5; }
.gloss { border-top: 2px solid var(--ink); }
details.gl > summary { display: flex; align-items: baseline; gap: 10px; }
.gl-term { font-weight: 700; }
.gl-n { font-size: 10px; color: var(--muted); font-weight: 500; }
.gl-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.empty-note { padding: 20px 0; }

/* ================================================================ card sheet */
.scrim { position: fixed; inset: 0; z-index: 70; background: var(--scrim); opacity: 0; pointer-events: none; transition: opacity .3s; }
.scrim.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; z-index: 80; left: 0; right: 0; bottom: 0; max-height: 92vh; max-height: 92dvh;
  display: flex; flex-direction: column; border-radius: 24px 24px 0 0; background: var(--surface); box-shadow: 0 -14px 44px rgba(0, 0, 0, .28);
  transform: translate3d(0, calc(100% + 24px), 0); visibility: hidden;
  transition: transform .5s var(--spring), visibility 0s .5s;
}
.sheet.open { transform: translate3d(0, var(--drag, 0px), 0); visibility: visible; transition: transform .5s var(--spring), visibility 0s; }
.sheet.dragging { transition: none; }
.sheet-bar { position: relative; flex: none; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 20px 12px 10px 18px; border-bottom: 1px solid var(--line); touch-action: none; }
.sheet .grab { position: absolute; top: 8px; left: 50%; width: 42px; height: 5px; margin-left: -21px; border-radius: 3px; background: var(--line-strong); }
.sheet-eyebrow { font: 600 10px/1.3 var(--f-mono); text-transform: uppercase; letter-spacing: .04em; color: var(--teal); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-pos { font-size: 10.5px; color: var(--muted); }
.sheet .close { border-radius: 50%; width: 36px; height: 36px; }
.sheet-body { overflow-y: auto; overscroll-behavior: contain; padding: 16px 18px calc(26px + var(--safe-b)); }
.detail { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.detail.swipe-next { animation: swipe-next .38s var(--ease); }
.detail.swipe-prev { animation: swipe-prev .38s var(--ease); }
@keyframes swipe-next { from { opacity: 0; transform: translateX(46px); } }
@keyframes swipe-prev { from { opacity: 0; transform: translateX(-46px); } }
.d-top { display: grid; grid-template-columns: 40% minmax(0, 1fr); gap: 14px; align-items: start; }
.detail.no-art .d-top { grid-template-columns: minmax(0, 1fr); }
.detail.no-art .d-art { display: none; }
.d-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 9px; min-width: 0; }
.d-head h2 { font: 800 21px/1.1 var(--f-display); letter-spacing: -.03em; overflow-wrap: anywhere; }
.typeline { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: 13.5px; line-height: 1.35; color: var(--ink-soft); }
.tl-pt { padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line-strong); font-size: 11.5px; }
.d-rating { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 5px; }
.oracle { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 12px 14px; border-radius: var(--r-m); background: var(--surface-2); border: 1px solid var(--line); font-size: 15px; line-height: 1.5; }
.face-name { font-weight: 700; }
.face-name .fc, .tl-cost { white-space: nowrap; }
.swapbox { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; padding: 10px 14px; border-radius: var(--r-m); background: var(--pink-soft); font-size: 14px; }
.d-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; padding: 4px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.d-tabs button { padding: 9px 4px; border: 0; border-radius: 10px; background: none; color: var(--muted); font: 600 13px/1.1 var(--f-body); cursor: pointer; transition: background .2s, color .2s; }
.d-tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.d-tabs button:disabled { opacity: .4; cursor: default; }
.d-tabs .n { font: 500 10px/1 var(--f-mono); color: var(--pink); }
.d-panel { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; animation: fade-up .3s var(--ease); }
.d-panel[hidden] { display: none; }
.d-chapters { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.d-ch { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 14px; line-height: 1.3; }
.d-ch .mono { font-size: 10.5px; color: var(--pink); }
.d-kw { display: flex; flex-wrap: wrap; gap: 4px 10px; font: 500 11px/1.4 var(--f-mono); color: var(--muted); }
.ext { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 14px; font-weight: 600; }
.sheet-nav { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.sheet-nav .btn { min-width: 0; padding: 0 12px; }
.sheet-nav .btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.swipe-hint { text-align: center; font-size: 12px; color: var(--muted); }
.peek { position: fixed; z-index: 95; width: 220px; pointer-events: none; opacity: 0; transform: translateY(6px) scale(.97); transition: opacity .18s, transform .18s var(--ease); }
.peek.show { opacity: 1; transform: none; }
.peek .mini-card { box-shadow: 0 24px 50px -12px rgba(0, 0, 0, .55); }
.toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + var(--safe-b) + 18px); z-index: 99; padding: 11px 18px; border-radius: 999px; background: var(--ink); color: var(--bg); font-weight: 600; font-size: 14px; box-shadow: var(--shadow-2); transform: translate(-50%, 16px); opacity: 0; pointer-events: none; transition: opacity .25s, transform .3s var(--spring); max-width: calc(100% - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ================================================================ Stats */
.eq-card { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-content: start; padding: 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); min-width: 0; }
.eq-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }
.eq-head b { font: 700 15px/1.2 var(--f-display); letter-spacing: -.02em; }
.eq-head .small { font-size: 10.5px; }

/* the piano roll */
.roll { padding: 14px 12px 12px; border-radius: var(--r); background: var(--stage); color: var(--stage-ink); box-shadow: var(--shadow-2); overflow: hidden; }
.roll-grid { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.lane { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
.lane-l { display: flex; justify-content: space-between; align-items: baseline; font: 600 10px/1.2 var(--f-mono); text-transform: uppercase; letter-spacing: .03em; color: var(--stage-soft); }
.lane-l b { font-weight: 500; color: var(--lc); }
.lane-row { position: relative; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 3px; padding: 3px 0; background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .05) 0 1px, transparent 1px calc(12.5%)); border-top: 1px solid rgba(255, 255, 255, .06); }
.cell { display: flex; flex-wrap: wrap; gap: 3px; align-content: flex-start; min-height: 12px; }
.note-key { flex: 1 1 100%; height: 12px; min-width: 0; padding: 0; border: 0; border-radius: 3px; cursor: pointer; background: var(--lc); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .25), 0 0 10px -2px var(--lc); transition: transform .15s, filter .15s; }
.note-key:hover, .note-key:focus-visible { filter: brightness(1.25); transform: scaleY(1.3); }
.roll-grid[data-reveal] .note-key { opacity: 0; }
.roll-grid.in .note-key, .roll .in .note-key { animation: note-on .45s var(--ease) both; animation-delay: calc(var(--v) * 120ms + 150ms); }
@keyframes note-on { from { opacity: 0; transform: scaleX(.2); } 60% { opacity: 1; filter: brightness(1.8); } to { opacity: 1; } }
.roll-axis { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
.roll-axis .lane-row { background: none; border-top: 1px solid rgba(255, 255, 255, .15); }
.roll-axis .lane-row span { font: 500 10px/1.8 var(--f-mono); color: var(--stage-soft); text-align: center; }
.playhead { position: absolute; top: 0; bottom: 20px; left: 0; width: 2px; background: #ffd166; box-shadow: 0 0 12px 2px rgba(255, 209, 102, .7); opacity: 0; pointer-events: none; }
.roll-chart.in .playhead, #roll-chart.in .playhead { animation: sweep 1.3s cubic-bezier(.45, 0, .55, 1) .1s both; }
@keyframes sweep { 0% { left: 0; opacity: 1; } 92% { opacity: 1; } 100% { left: 100%; opacity: 0; } }
#roll-chart .note-key { opacity: 1; }
#roll-chart:not(.in) .note-key { opacity: 0; }
#roll-chart.in .note-key { animation: note-on .45s var(--ease) both; animation-delay: calc(var(--v) * 150ms + 120ms); }
.roll-cap { margin-top: 10px; color: var(--stage-soft); }

/* the LED curve */
.eq { position: relative; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; height: 210px; align-items: end; }
.eq-col { position: relative; height: 100%; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) 26px; gap: 6px; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 8px; min-width: 0; }
.eq-stack { display: flex; flex-direction: column-reverse; gap: 2px; height: 100%; padding: 0 2px; }
.eq-seg { display: block; flex: 1 1 0; min-height: 0; border-radius: 2px; background: var(--teal-fill); opacity: .14; transition: opacity .25s, background .25s; }
.eq-seg.on { opacity: .95; }
.eq-seg.top.on { background: var(--pink-fill); }
.eq[data-reveal]:not(.in) .eq-seg.on { opacity: .14; }
.eq.in .eq-seg.on { animation: led .5s var(--ease) both; animation-delay: calc(var(--k) * 34ms + var(--c) * 46ms); }
@keyframes led { from { opacity: .14; } 50% { opacity: 1; filter: brightness(1.5); } }
.eq-col .val { order: 99; display: block; height: 20px; text-align: center; font-size: 12px; line-height: 20px; color: var(--ink); flex: none; }
.eq-col .lab { font-size: 12px; line-height: 26px; text-align: center; color: var(--muted); border-radius: 6px; transition: background .2s, color .2s; }
.eq-col[aria-pressed="true"] .lab { background: var(--ink); color: var(--bg); }
.eq-col[aria-pressed="false"] .eq-seg.on { opacity: .55; }
.eq-readout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; min-height: 84px; padding-top: 12px; border-top: 1px dashed var(--line-strong); }
.eq-readout b { font-size: 14.5px; }
.eq-readout .syn, .speed-readout { animation: fade-up .3s var(--ease); }
.typebars { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.typebar { display: grid; grid-template-columns: minmax(0, 118px) minmax(0, 1fr) 3.4em; gap: 10px; align-items: center; font-size: 14px; }
.tb-l { min-width: 0; line-height: 1.25; }
.typebar .bar { position: relative; height: 12px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.typebar .bar i { position: absolute; left: 0; top: 0; bottom: 0; width: var(--w); border-radius: 3px; background: repeating-linear-gradient(90deg, var(--teal-fill) 0 8px, color-mix(in srgb, var(--teal-fill) 55%, transparent) 8px 10px); transform-origin: left; transition: transform 1s var(--ease); }
.typebars[data-reveal]:not(.in) .bar i { transform: scaleX(0); }
.typebar .num { font-size: 12px; text-align: right; white-space: nowrap; }
.tb-x { grid-column: 3; font: 500 10px/1 var(--f-mono); color: var(--muted); text-align: right; margin-top: -6px; }
.typebars.prices .typebar, .endings .typebar { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 4.6em; }
.typebars.prices .bar i { background: repeating-linear-gradient(90deg, var(--pink-fill) 0 8px, color-mix(in srgb, var(--pink-fill) 55%, transparent) 8px 10px); }
.roles-bars .typebar:nth-child(-n+3) .bar i { background: repeating-linear-gradient(90deg, var(--pink-fill) 0 8px, color-mix(in srgb, var(--pink-fill) 55%, transparent) 8px 10px); }
.color-card .tug { display: flex; height: 44px; border-radius: 12px; overflow: hidden; gap: 3px; }
.tug i { position: relative; display: flex; align-items: center; width: var(--w); font-style: normal; font: 700 13px/1 var(--f-mono); padding: 0 12px; white-space: nowrap; transition: width 1s var(--ease); }
.tug i.g { background: var(--mana-g); color: var(--mana-g-ink); }
.tug i.w { background: var(--mana-w); color: var(--mana-w-ink); justify-content: flex-end; }
.src-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px 14px; font-size: 13.5px; color: var(--ink-soft); }
.src-list b { color: var(--ink); margin-right: 4px; }
.bands { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.band { display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; padding: 10px 8px; border-radius: var(--r-s); background: var(--surface-2); text-align: center; }
.band b { font: 800 24px/1 var(--f-display); }
.band span { font-size: 11.5px; line-height: 1.2; color: var(--muted); }
.band em { font-style: normal; font-size: 11px; color: var(--pink); }

/* speed test */
.speed { position: relative; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; height: 220px; }
.sp-grid { position: absolute; inset: 22px 0 28px; pointer-events: none; }
.sp-grid span { position: absolute; left: 0; right: 0; bottom: var(--y); border-top: 1px dashed var(--line); font-size: 0; }
.sp-col { position: relative; height: 100%; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) 28px; align-items: end; padding: 0; border: 0; background: none; cursor: pointer; min-width: 0; }
.sp-stack { height: 100%; padding-top: 18px; display: flex; flex-direction: column; justify-content: flex-end; }
.sp-bar-v { position: relative; display: block; height: var(--h); margin: 0 2px; border-radius: 5px 5px 0 0; background: var(--teal-fill); opacity: .5; transform-origin: bottom; transition: opacity .2s, box-shadow .2s; }
.sp-col.key .sp-bar-v { opacity: .85; }
.sp-col[aria-pressed="true"] .sp-bar-v { opacity: 1; background: var(--pink-fill); }
.speed[data-reveal]:not(.in) .sp-bar-v { transform: scaleY(0); }
.speed.in .sp-bar-v { animation: grow .8s var(--ease) both; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes grow { from { transform: scaleY(0); } }
.sp-val { position: absolute; left: -6px; right: -6px; bottom: calc(100% + 4px); font-size: 10.5px; text-align: center; color: var(--ink); }
.sp-lab { text-align: center; font-size: 11px; line-height: 28px; color: var(--muted); }
.sp-col.key .sp-lab { color: var(--ink); font-weight: 700; }
.speed-readout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; min-height: 64px; padding-top: 12px; border-top: 1px dashed var(--line-strong); font-size: 14px; }
.assumptions { margin-top: 12px; border-radius: var(--r-m); background: var(--surface); border: 1px solid var(--line); }
.assumptions > summary { padding: 14px 40px 14px 16px; font-weight: 650; }
.assumptions > summary::after { right: 18px; }
.assumptions > div { padding: 0 16px 16px; color: var(--ink-soft); font-size: 14.5px; }
.big-trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.big-trio > div { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; align-content: start; }
.big-trio b { font: 800 26px/1 var(--f-display); letter-spacing: -.04em; color: var(--teal); }
.big-trio span { font-size: 12px; line-height: 1.3; color: var(--muted); }
.bs-tier { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding-top: 12px; border-top: 1px dashed var(--line); }
.bs-label { font: 600 10.5px/1.3 var(--f-mono); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.tb-tag { margin-left: 4px; font-size: 9.5px; color: var(--muted); }

/* land odds */
.land-odds { padding: 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.lo-bars { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; height: 170px; }
.lo { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: 18px minmax(0, 1fr) 24px; gap: 3px; min-width: 0; }
.lo-v { font-size: 10px; text-align: center; color: var(--muted); white-space: nowrap; }
.lo-bar { position: relative; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.lo-bar i { position: absolute; left: 0; right: 0; bottom: 0; height: var(--h); border-radius: 5px 5px 0 0; background: var(--line-strong); transform-origin: bottom; transition: transform .8s var(--ease); }
.lo.keep .lo-bar i { background: var(--teal-fill); }
.lo.keep .lo-v { color: var(--ink); font-weight: 700; }
.lo-k { font: 700 12px/24px var(--f-mono); text-align: center; }
.land-odds[data-reveal]:not(.in) .lo-bar i { transform: scaleY(0); }
.lo-note { font-size: 14.5px; }

/* power scale and versus */
.power { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin: 34px 0 8px; }
.power-track { position: relative; height: 12px; border-radius: 6px; border: 1px solid var(--line); background: linear-gradient(90deg, var(--surface-2), var(--teal-soft) 55%, var(--pink-soft)); }
.power-track i { position: absolute; top: -6px; bottom: -6px; left: var(--from); width: calc(var(--to) - var(--from)); border-radius: 5px; background: var(--ink); }
.power-track i::after { content: "you"; position: absolute; top: -20px; left: 50%; transform: translateX(-50%); font: 600 9.5px/1 var(--f-mono); text-transform: uppercase; color: var(--ink); }
.power-scale { display: flex; justify-content: space-between; font: 500 9px/1 var(--f-mono); text-transform: uppercase; color: var(--muted); }
.power.duo { margin: 22px 0 10px; }
.power.duo .power-track i::after { content: none; }
.power.duo .power-track i.etr { background: var(--violet); }
.power.duo .power-track i em { position: absolute; top: -20px; left: 50%; transform: translateX(-50%); font: 600 9.5px/1 var(--f-mono); text-transform: uppercase; font-style: normal; white-space: nowrap; color: var(--ink); }
.power.duo .power-track i.etr em { top: auto; bottom: -20px; color: var(--violet); }
.power.duo .power-scale { margin-top: 26px; }
:where(main) .callout { margin-top: 12px; border-left: 4px solid var(--gold-fill); }
.callout h3, .later h3, .verdict-card h3 { font: 700 17px/1.2 var(--f-display); letter-spacing: -.02em; }
.vs { margin-top: 14px; padding: 6px 14px 4px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.vs-head { display: flex; justify-content: space-between; padding: 8px 0 6px; font: 700 13px/1 var(--f-display); }
.vs-head .m { color: var(--teal); }
.vs-head .e { color: var(--violet); }
details.vs-row { border-top: 1px solid var(--line); }
details.vs-row > summary { display: grid; grid-template-columns: minmax(0, 1fr) 46%; gap: 12px; align-items: center; padding: 12px 0; }
.vs-cat { font-weight: 650; font-size: 14.5px; }
.vs-meter { position: relative; height: 10px; border-radius: 5px; background: var(--surface-3); }
.vs-meter::before { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 2px; background: var(--line-strong); }
.vs-meter i { position: absolute; top: 0; bottom: 0; border-radius: 5px; }
.vs-row[data-lean="m"] .vs-meter i { right: 50%; width: 42%; background: var(--teal-fill); }
.vs-row[data-lean="e"] .vs-meter i { left: 50%; width: 42%; background: var(--violet); }
.vs-row[data-lean="even"] .vs-meter i { left: 40%; width: 20%; background: var(--gold-fill); }
details.vs-row > p { padding: 0 0 12px; font-size: 14.5px; color: var(--ink-soft); animation: fade-up .3s var(--ease); }
.vs-verdict { margin-top: 12px; }
.verdict-card .label { font: 600 10px/1 var(--f-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.verdict-card.m { border-top: 4px solid var(--teal-fill); }
.verdict-card.e { border-top: 4px solid var(--violet); }

/* your record */
.rec-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.rec-tiles > div { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 12px 10px; border-radius: var(--r-m); background: var(--surface); border: 1px solid var(--line); }
.rec-tiles b { font: 800 22px/1 var(--f-display); letter-spacing: -.03em; }
.rec-tiles span { font-size: 11.5px; line-height: 1.25; color: var(--muted); }
#myStats { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.recent { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); }
.recent li { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 2px 10px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.recent .res { font-size: 10.5px; font-weight: 700; }
.recent li.w .res { color: var(--teal); }
.recent li.l .res { color: var(--pink); }
.recent .vs { margin: 0; padding: 0; border: 0; background: none; box-shadow: none; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent .rd { font-size: 11px; color: var(--muted); }
.recent .nums { grid-column: 2 / -1; font-size: 10.5px; color: var(--muted); }
.empty-state { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; justify-items: center; text-align: center; padding: 34px 20px; border-radius: var(--r); background: var(--surface); border: 1px dashed var(--line-strong); }
.empty-state b { font: 800 19px/1.2 var(--f-display); }
.empty-state p { max-width: 30em; }
.empty-state .pp-eq i { background: var(--line-strong); }

/* ================================================================ Shop */
.budget-num { display: flex; align-items: baseline; gap: 8px; }
.budget-num b { font: 900 38px/1 var(--f-display); letter-spacing: -.05em; }
.budget-bar { display: flex; gap: 2px; height: 16px; border-radius: 8px; overflow: hidden; background: var(--surface-3); }
.budget-bar i { display: block; height: 100%; width: var(--w); transform-origin: left; transition: transform 1.1s var(--ease); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13.5px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.swap-progress {
  position: sticky; top: calc(var(--top-h) + var(--seg-h) + 10px); z-index: 5; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 12px 14px; margin-bottom: 6px;
  border-radius: var(--r-m); background: var(--stage); color: var(--stage-ink); box-shadow: var(--shadow-2); transition: top .38s var(--spring);
}
body.hdr-up .swap-progress { top: calc(var(--seg-h) + 10px); }
.sp-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 13.5px; }
.swap-progress b { font: 800 17px/1 var(--f-display); }
.sp-bar { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .14); overflow: hidden; }
.sp-bar i { display: block; height: 100%; width: var(--w, 0%); background: linear-gradient(90deg, var(--teal-fill), var(--pink-fill)); transition: width .5s var(--ease); }
.sp-bar.over i { background: var(--pink-fill); }
.swap-progress .linkish { font-size: 12.5px; }
.sp-all { padding-top: 8px; border-top: 1px dashed rgba(255, 255, 255, .22); font-size: 12.5px; opacity: .85; }
.swaps { display: grid; grid-template-columns: minmax(0, 1fr); }
.swaps.swap-in { animation: fade-up .35s var(--ease); }
.tier { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 22px 2px 8px; border-bottom: 2px solid var(--ink); font: 600 10.5px/1.2 var(--f-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--pink); }
.swap { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.swap .tick { width: 44px; height: 44px; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 0; border: 0; background: none; cursor: pointer; }
.swap .tick span { width: 27px; height: 27px; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; border-radius: 8px; border: 2px solid var(--line-strong); font: 700 10.5px/1 var(--f-mono); color: var(--muted); transition: background .2s, border-color .2s, transform .35s var(--bounce); }
.swap .tick em { font-style: normal; }
.swap .tick svg { display: none; width: 16px; height: 16px; }
.swap .tick svg path { stroke-dasharray: 24; }
.swap.done .tick span { background: var(--teal-fill); border-color: var(--teal-fill); color: var(--on-fill); transform: scale(1.08); }
.swap.done .tick em { display: none; }
.swap.done .tick svg { display: block; animation: draw .35s var(--ease); }
@keyframes draw { from { stroke-dashoffset: 24; } }
.swap .who { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; min-width: 0; }
.swap .cut { font-size: 13px; color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--pink) 60%, transparent); }
.swap .add { font-size: 15.5px; line-height: 1.3; }
.swap .add::before { content: "+ "; color: var(--teal); font-weight: 800; }
.swap.plain .add::before { content: none; }
.swap.done .add .inline-card { color: var(--muted); }
.swap .sub-note { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; font-size: 12.5px; line-height: 1.35; color: var(--muted); }
.swap .eur { padding: 8px 10px; border-radius: 8px; background: var(--surface-2); color: var(--ink); font-size: 12.5px; text-decoration: none; white-space: nowrap; }
.swap-total { display: flex; justify-content: space-between; padding: 16px 2px; font-weight: 700; }
.later .panel { position: relative; }
.step-n { font: 800 38px/1 var(--f-display); letter-spacing: -.05em; color: transparent; -webkit-text-stroke: 1.5px var(--teal); }
.stages { position: relative; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); }
.stages::before { content: ""; position: absolute; left: 21px; top: 24px; bottom: 24px; width: 2px; background: repeating-linear-gradient(var(--line-strong) 0 6px, transparent 6px 10px); }
.stages li { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 0 0 24px 60px; }
.st-head { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.st-n { position: absolute; left: 0; top: 0; z-index: 1; width: 44px; height: 44px; border-radius: 50%; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; background: var(--surface); border: 2px solid var(--teal-fill); color: var(--teal); font: 800 17px/1 var(--f-display); }
.stages li.now .st-n { background: var(--teal-fill); color: var(--on-fill); }
.stages li:last-child .st-n { border-color: var(--pink-fill); color: var(--pink); }
.st-tag { padding: 4px 7px; border-radius: 5px; background: var(--teal-soft); color: var(--teal); font: 600 9.5px/1 var(--f-mono); text-transform: uppercase; }
.st-eur { margin-left: auto; font-size: 14px; font-weight: 600; }
.stages p { font-size: 15px; line-height: 1.55; color: var(--ink-soft); }
.st-res { justify-self: start; padding: 4px 11px; border-radius: 999px; border: 1px solid var(--line-strong); font-weight: 700; font-size: 13px; }
.stages li:last-child .st-res { background: var(--pink-soft); border-color: transparent; color: var(--pink); }
:where(main) .seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); max-width: 100%; }
:where(main) .seg button { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; align-content: center; gap: 2px; min-height: 38px; padding: 7px 13px; border: 0; border-radius: 9px; background: none; color: var(--muted); font: 600 14px/1.1 var(--f-body); cursor: pointer; transition: background .2s, color .2s; }
:where(main) .seg button[aria-checked="true"], :where(main) .seg button[aria-selected="true"] { background: var(--ink); color: var(--bg); }
:where(main) .seg button small { font-size: 10.5px; font-weight: 500; opacity: .75; }
#azSeg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; margin-bottom: 12px; }
.az-note { margin: 10px 0 4px; }

/* ================================================================ Play: the lobby (the table itself is game/game.css) */
.view-play .wrap { padding-top: 14px; }
.play-host { min-height: 60vh; }
.play-loading { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 14px; padding: 80px 0; color: var(--muted); }
.play-loading .pp-eq { height: 44px; }
.lobby { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; padding-bottom: 12px; }
.lobby-hero {
  position: relative; isolation: isolate; overflow: hidden; padding: 26px 20px 24px; border-radius: var(--r);
  background: radial-gradient(120% 120% at 100% 0%, rgba(255, 61, 139, .3), transparent 55%), radial-gradient(120% 120% at 0% 100%, rgba(57, 197, 187, .3), transparent 60%), var(--stage);
  color: var(--stage-ink); box-shadow: var(--shadow-2);
}
.lobby-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .03) 0 1px, transparent 1px 22px); }
.lobby-hero .eyebrow { color: #8ff5ec; }
.lobby-title { margin: 10px 0 12px; font: 900 clamp(29px, 8.8vw, 56px)/.96 var(--f-display); letter-spacing: -.045em; }
.lobby-title span { color: var(--pink-fill); }
.lobby-hero .lede { max-width: 36em; color: #b9c6cc; font-size: 15.5px; line-height: 1.55; }
.lobby-setup { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.lobby-setup .set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.lobby-setup .set-row.col { flex-direction: column; align-items: stretch; }
.set-check { display: flex; gap: 10px; align-items: flex-start; font: 400 13.5px/1.45 var(--f-body); color: var(--ink-2, var(--ink)); cursor: pointer; }
.set-check input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--teal-fill, #39c5bb); }
.set-check b { color: var(--ink); }
.set-label { font: 600 10.5px/1.3 var(--f-mono); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.set-label small { margin-left: 6px; font: 600 12px/1 var(--f-body); text-transform: none; letter-spacing: 0; color: var(--pink); }
.bot-picks { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; }
.bot-picks::-webkit-scrollbar { display: none; }
.bot-pick { flex: none; width: 108px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 6px 6px 8px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface-2); color: var(--ink); text-align: left; cursor: pointer; transition: border-color .2s, background .2s, transform .15s; }
.bot-pick:active { transform: scale(.96); }
.bot-pick.on { border-color: var(--pink-fill); background: var(--pink-soft); }
.bp-art { height: 58px; border-radius: 9px; background: var(--surface-3) center 22% / cover no-repeat; }
.bp-name { font: 700 13px/1.15 var(--f-body); }
.bp-dots { display: flex; gap: 3px; }
.pip { display: inline-block; width: 10px; height: 10px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .25); }
.pip.w { background: #f6eec9; } .pip.u { background: #4a90d9; } .pip.b { background: #3b3331; } .pip.r { background: #e2573b; } .pip.g { background: #3fa35a; }
:where(main) .btn.big.start { min-height: 58px; border: 0; font: 800 17px/1 var(--f-display); letter-spacing: -.02em; color: #07090c; background: linear-gradient(100deg, var(--teal-fill), #8ff5ec 45%, var(--pink-fill)); background-size: 200% 100%; box-shadow: 0 12px 30px -12px rgba(255, 61, 139, .7); animation: start-glow 4s ease-in-out infinite alternate; }
@keyframes start-glow { to { background-position: 100% 0; } }
.lobby-record { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.rec { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 12px 6px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); text-align: center; }
.rec b { font: 800 21px/1 var(--f-display); letter-spacing: -.03em; }
.rec span { font-size: 11px; line-height: 1.2; color: var(--muted); }
.bot-pool { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; min-width: 0; }
.pool-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.pool-head b { font: 800 17px/1.2 var(--f-display); letter-spacing: -.02em; }
.pool-head span { flex: none; font-size: 11px; }
/* phones: the decks sit in a row you swipe, so the lobby stays short */
.bot-gallery { display: grid; grid-auto-flow: column; grid-auto-columns: 86%; gap: 12px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; margin: 0 calc(var(--gutter) * -1); padding: 2px var(--gutter) 10px; scroll-padding: 0 var(--gutter); scrollbar-width: none; }
.bot-gallery::-webkit-scrollbar { display: none; }
.bot-card { scroll-snap-align: start; position: relative; isolation: isolate; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr); align-content: end; min-height: 240px; border-radius: var(--r); background: var(--stage); color: var(--stage-ink); box-shadow: var(--shadow-2); }
.bc-art { position: absolute; inset: 0; z-index: -1; background: var(--stage-2) center 18% / cover no-repeat; transition: transform 6s var(--ease); }
.bot-card:hover .bc-art { transform: scale(1.06); }
.bc-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(7, 9, 12, .05) 0%, rgba(7, 9, 12, .5) 42%, rgba(7, 9, 12, .96) 100%); }
.bc-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 18px; }
.bc-body > .eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; color: #8ff5ec; font-size: 10.5px; }
.bc-br { padding: 3px 6px 2px; border-radius: 6px; background: var(--pink-fill); color: #07090c; font: 700 10px/1 var(--f-mono); letter-spacing: .04em; }
.bc-br.soft { background: #8ff5ec; }
.bc-body > .bc-precon { font-size: 12.5px; line-height: 1.35; color: #9fb0b7; }
.bc-precon b { font-weight: 650; color: var(--stage-ink); }
.bc-body h3 { font: 800 22px/1.05 var(--f-display); letter-spacing: -.03em; }
.bc-body > p { color: #c3ced3; font-size: 14.5px; line-height: 1.45; }
.bc-body > .watch { font-size: 13.5px; }
.watch span { margin-right: 4px; font: 600 10px/1 var(--f-mono); text-transform: uppercase; color: #ff8fbd; }
.watch b { font-weight: 600; color: var(--stage-ink); }
.bc-body > .bc-rec { font: 600 11.5px/1.3 var(--f-mono); color: #ffd166; }
details.simp { display: block; padding: 0; }
details.simp > summary { padding: 16px 44px 16px 16px; font-weight: 650; }
details.simp > summary::after { right: 18px; }
details.simp ol { margin: 0; padding: 0 16px 16px 34px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; font-size: 14.5px; color: var(--ink-soft); }
html.mg-open body { overflow: hidden; }
html.mg-open .tabbar, html.mg-open .topbar { visibility: hidden; }

/* ================================================================ footer */
.foot { margin-top: 48px; padding: 24px 0; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.foot p + p { margin-top: 6px; }
body[data-view="play"] .foot { display: none; }

/* ================================================================ small phones */
@media (max-width: 374px) {
  :root { --gutter: 14px; }
  .brand-txt small { display: none; }
  .seg-link { padding: 0 12px; font-size: 13.5px; }
  .calc-inputs, .w-fields { grid-template-columns: minmax(0, 1fr); }
  .sim-top { grid-template-columns: 100px minmax(0, 1fr); }
  .ring { width: 100px; height: 100px; }
  .lobby-record { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .shelf-row { grid-auto-columns: 38%; }
}
@media (min-width: 560px) {
  .grid-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .w-out { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tile-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .shelf-row { grid-auto-columns: 22%; }
  .setlist { columns: 2; }
  .odds-controls { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
  .rec-tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .bot-gallery { grid-auto-flow: row; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); overflow: visible; margin: 0; padding: 0; }
}

/* ================================================================ wide screens */
@media (min-width: 900px) {
  :root { --gutter: 28px; --top-h: 64px; }
  body { padding-bottom: 0; }
  .tabbar { display: none; }
  .toast { bottom: 28px; }
  .topnav { display: flex; }
  .topnav { gap: 4px; margin: 0 auto; }
  .topnav .tab { flex-direction: row; gap: 7px; padding: 0 14px 0 8px; height: 40px; border-radius: 999px; font-size: 14px; color: var(--muted); transition: background .2s, color .2s; }
  .topnav .tab-ic { width: 26px; height: 26px; background: none !important; }
  .topnav .tab-ic svg { width: 19px; height: 19px; }
  .topnav .tab:hover { color: var(--ink); background: var(--surface-2); }
  .topnav .tab[aria-current] { color: var(--bg); background: var(--ink); }
  .topnav .tab[aria-current] .tab-ic { color: var(--teal-fill); }
  .topnav .tab-play .tab-ic { width: 26px; height: 26px; margin: 0; box-shadow: none; background: conic-gradient(from 210deg, var(--teal-fill), #8ff5ec, var(--pink-fill), var(--gold-fill), var(--teal-fill)) !important; color: #07090c; }
  .topnav .tab-play .tab-ic svg { width: 13px; height: 13px; margin-left: 2px; }
  .topnav .tab-play .tab-ic::after { display: none; }
  .topnav .tab-play[aria-current] .tab-ic { color: #07090c; }
  .brand { margin-right: 0; }
  .bar-actions { margin-left: 0; }
  .segbar .wrap { display: flex; justify-content: center; }
  .seg-track { margin: 0; padding: 0; }

  .hero { padding-bottom: 120px; }
  .hero-grid { grid-template-columns: minmax(0, 1.35fr) minmax(0, .65fr); align-items: end; gap: 48px; padding-top: 48px; }
  .cmdr { grid-template-columns: minmax(0, 1fr); padding: 18px; gap: 16px; max-width: 330px; justify-self: end; }
  .cmdr .foil { width: 100%; }
  .hero-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: -60px; }
  .hero-stats .stat { padding: 18px; }
  .hero-stats dt b { font-size: 36px; }
  .block { padding-top: 56px; }
  .flow { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
  .flow::before, .flow::after { left: 22px; right: 22px; top: 21px; bottom: auto; width: auto; height: 2px; }
  .flow::after { transform-origin: left; transform: scaleX(var(--fill)); }
  .flow li { grid-template-columns: minmax(0, 1fr); gap: 12px; align-content: start; }
  #continue { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1fr); gap: 32px; align-items: center; }
  #continue .section-head { margin: 0; }
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
  .tracklist { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 36px; border-top: 0; }
  .track { border-top: 2px solid transparent; }
  .track:nth-child(1), .track:nth-child(2) { border-top-color: var(--ink); }
  .snap-row { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: visible; margin: 0; padding: 0; }
  .habits { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 36px; border-top: 0; }
  .habits li:nth-child(1), .habits li:nth-child(2) { border-top: 2px solid var(--ink); }
  .matchups { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .ticket-body:has(> .sim) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 32px; align-items: start; }
  .ticket-body:has(> .sim) > :not(.sim) { grid-column: 1; }
  .ticket-body:has(> .sim) > .sim { grid-column: 2; grid-row: 1 / span 4; position: sticky; top: calc(var(--top-h) + var(--seg-h) + 16px); }
  .ticket-body { padding: 28px 26px 24px; }
  .ticket > summary { padding: 22px 26px 28px; }
  .shelf-row { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); overflow: visible; margin: 0; padding: 2px 0 12px; }
  .tile-grid { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); }
  .toolbar { top: calc(var(--top-h) + var(--seg-h) + 1px) !important; }
  .tool-row { grid-template-columns: minmax(0, 420px) auto auto; justify-content: start; }
  .toolbar .chips { flex-wrap: wrap; overflow: visible; }
  .setlist { columns: 3; }
  .rows { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 32px; }
  .shelf .rows { border-top: 0; }
  .gloss, .faq-list { columns: 2; column-gap: 36px; border-top: 0; }
  .gloss details, .faq-list details { break-inside: avoid; }
  .cuts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 36px; border-top: 0; }

  .sheet { left: auto; top: 0; bottom: 0; width: min(500px, 100%); max-height: none; border-radius: 24px 0 0 24px; transform: translate3d(calc(100% + 30px), 0, 0); }
  .sheet.open { transform: none; }
  .sheet .grab, .swipe-hint { display: none; }
  .sheet-bar { padding-top: 14px; }

  .reader-bar { padding: 0 20px; }
  .chapter { padding-top: 46px; }
  .ch-body { font-size: 18px; }

  .swap-progress { top: calc(var(--top-h) + var(--seg-h) + 12px) !important; }
  .lobby { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto auto 1fr auto; align-items: start; gap: 20px; }
  .lobby-hero { grid-column: 1 / -1; padding: 40px 36px 34px; }
  .lobby-setup { grid-column: 1; grid-row: 2 / span 2; }
  .bot-picks { flex-wrap: wrap; overflow: visible; }
  .lobby-record { grid-column: 2; grid-row: 2; align-self: start; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .bot-pool { grid-column: 1 / -1; grid-row: 4; }
  .bot-gallery { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
  .lobby > .simp { grid-column: 2; grid-row: 3; align-self: start; }
  .foot { margin-top: 64px; }
}
@media (hover: hover) {
  .c-tile:hover .mini-card { box-shadow: 0 16px 34px -14px rgba(0, 0, 0, .5); }
}

/* ================================================================ motion off */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .hero::before, .hero::after { animation: none; }
  .block.rv { opacity: 1; transform: none; }
  #roll-chart:not(.in) .note-key, .roll-grid[data-reveal] .note-key { opacity: 1; }
  .typebars[data-reveal]:not(.in) .bar i, .speed[data-reveal]:not(.in) .sp-bar-v, .land-odds[data-reveal]:not(.in) .lo-bar i { transform: none; }
  .eq[data-reveal]:not(.in) .eq-seg.on { opacity: .95; }
}

/* the Play tab's deck picker (precon, budget, full upgrades, Bracket 4) */
.hero-seg { flex-wrap: wrap; }
.hero-blurb { margin: 8px 0 0; font-size: .82rem; line-height: 1.45; color: var(--ink-soft); }
.hero-blurb .bc-br { vertical-align: 1px; margin-right: 2px; }
/* cards never offer the browser's "save image" menu: press and hold shows the card instead */
.mini-card, .mini-card img, .inline-card, [data-art], [data-thumb] { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.mini-card img { -webkit-user-drag: none; }

/* ---------------------------------------------------------------- deck switcher (header) */
.deck-menu {
  position: fixed; z-index: 120; width: min(300px, calc(100vw - 16px)); padding: 8px;
  border-radius: 18px; border: 1px solid var(--line); background: var(--surface);
  box-shadow: 0 24px 48px -16px rgba(0, 0, 0, .35), 0 2px 6px rgba(0, 0, 0, .08);
  display: flex; flex-direction: column; gap: 2px; animation: dm-in .22s var(--ease) both;
}
.deck-menu[hidden] { display: none; }
@keyframes dm-in { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
.deck-menu .dm-h { margin: 4px 10px 6px; font: 600 10px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.deck-menu a { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px; color: var(--ink); text-decoration: none; transition: background .15s; }
.deck-menu a:hover, .deck-menu a:focus-visible { background: var(--surface-2); }
.deck-menu img { width: 32px; height: 32px; border-radius: 9px; flex: none; }
.deck-menu span { display: grid; gap: 2px; min-width: 0; flex: 1; }
.deck-menu b { font: 700 14px/1.15 var(--f-display); letter-spacing: -.01em; }
.deck-menu small { font: 500 9.5px/1.2 var(--f-mono); color: var(--muted); text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deck-menu .on { background: var(--teal-soft); }
.deck-menu i { font: 600 9.5px/1 var(--f-mono); font-style: normal; text-transform: uppercase; letter-spacing: .08em; color: var(--teal); }
.deck-menu .dm-all { margin-top: 4px; border-top: 1px solid var(--line); border-radius: 0 0 12px 12px; padding-top: 12px; font: 600 13px/1 var(--f-body); color: var(--muted); gap: 8px; }
@media (hover: hover) { .icon-btn:hover { border-color: var(--line-strong); background: var(--surface-2); } }

/* ---------------------------------------------------------------- the reader on wide screens:
   every track on the left, the chapter in the middle, its outline and cards on the right */
.rd-toc, .rd-side { display: none; }
@media (min-width: 1100px) {
  .rd-grid { display: grid; grid-template-columns: 236px minmax(0, 700px); justify-content: center; column-gap: 44px; padding: 0 28px; }
  .rd-grid > .chapter { margin: 0; padding-left: 0; padding-right: 0; min-width: 0; }
  .rd-toc, .rd-side { display: block; position: sticky; top: 0; align-self: start; max-height: calc(100vh - 60px); overflow-y: auto; padding: 46px 4px 32px 0; scrollbar-width: thin; }
  .rd-k { margin: 0 0 10px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
  .rd-toc ol, .rd-out { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 2px; }
  .rd-toc a { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 6px; padding: 7px 10px; border-radius: 10px; font-size: 13.5px; line-height: 1.3; color: var(--ink-soft); text-decoration: none; transition: background .15s, color .15s; }
  .rd-toc a .mono { font-size: 11px; color: var(--muted); padding-top: 1px; }
  .rd-toc a:hover { background: var(--surface-2); color: var(--ink); }
  .rd-toc a.read .mono { color: var(--teal); }
  .rd-toc a.read .mono::after { content: " ✓"; }
  .rd-toc a.on { background: var(--ink); color: var(--bg); font-weight: 600; }
  .rd-toc a.on .mono { color: var(--teal-fill); }
  .rd-out a { display: block; padding: 5px 0 5px 12px; border-left: 2px solid var(--line); font-size: 13px; line-height: 1.35; color: var(--muted); text-decoration: none; transition: color .15s, border-color .15s; }
  .rd-out a:hover { color: var(--ink); }
  .rd-out a.on { color: var(--ink); border-left-color: var(--pink-fill); font-weight: 600; }
  .rd-cards { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 24px; font-size: 13px; }
  .rd-cards a { white-space: nowrap; }
  .rd-time { margin: -4px 0 0; font-size: 13px; color: var(--ink-soft); }
  .r-h { scroll-margin-top: 16px; }
}
@media (min-width: 1100px) and (max-width: 1379px) { .rd-side { display: none; } }
@media (min-width: 1380px) { .rd-grid { grid-template-columns: 236px minmax(0, 700px) 210px; } }
/* big monitors: use the room */
@media (min-width: 1440px) { .wrap { max-width: 1260px; } }
