:root {
  --ink: oklch(0.34 0.11 248);
  --deep: oklch(0.26 0.09 250);
  --deeper: oklch(0.21 0.075 252);
  --fresh: oklch(0.42 0.11 246);
  --chalk: oklch(0.96 0.015 230);
  --faded: oklch(0.80 0.06 235);
  --line: oklch(0.80 0.06 235 / 0.35);
  --line-soft: oklch(0.80 0.06 235 / 0.16);
  --red: oklch(0.70 0.18 30);
  --red-soft: oklch(0.78 0.13 30);
  --hi: oklch(0.90 0.16 100);
  --hi-deep: oklch(0.80 0.16 95);
  --good: oklch(0.85 0.14 160);
  --display: "Architects Daughter", "Barlow Semi Condensed", sans-serif;
  --text: "Barlow Semi Condensed", system-ui, sans-serif;
  --bar: 58px;
  --tab: 0px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100svh;
  font-family: var(--text); font-size: 17px; line-height: 1.5; color: var(--chalk);
  background:
    linear-gradient(var(--line-soft) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px) 0 0 / 24px 24px,
    radial-gradient(120% 80% at 30% 0%, oklch(0.38 0.115 247), var(--ink) 55%, oklch(0.30 0.10 250));
  background-attachment: fixed;
}
.num { font-variant-numeric: tabular-nums; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.1; margin: 0; text-wrap: balance; letter-spacing: 0.01em; }
p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px dashed var(--hi); outline-offset: 3px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--hi); color: var(--deeper); padding: 8px 12px; z-index: 99; }
.skip:focus { left: 8px; }
[hidden] { display: none !important; }
.muted { color: var(--faded); }

/* ---------- bar ---------- */
.bar {
  position: sticky; top: 0; z-index: 30; height: var(--bar);
  display: flex; align-items: center; gap: 20px; padding: 0 20px;
  background: oklch(0.26 0.09 250 / 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-size: 22px; white-space: nowrap; }
.brand img { display: block; }
.routes { display: flex; gap: 4px; }
.routes a { text-decoration: none; padding: 6px 12px; font-weight: 600; font-size: 16px; color: var(--faded); border-bottom: 2px solid transparent; }
.routes a:hover { color: var(--chalk); }
.routes a[aria-current="page"] { color: var(--chalk); border-bottom-color: var(--hi); }
.bar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.chip {
  display: flex; align-items: baseline; gap: 8px; height: 38px; padding: 0 12px;
  background: var(--deeper); border: 1px solid var(--line); border-radius: 4px; cursor: pointer;
  font-size: 15px; transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.chip:hover { border-color: var(--faded); }
.chip-sym { font-weight: 700; }
.chip-chg.up { color: var(--good); }
.chip-chg.down { color: var(--red-soft); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 4px; cursor: pointer;
  font-family: var(--text); font-weight: 700; font-size: 17px; text-decoration: none; letter-spacing: 0.01em;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), background-color .18s var(--ease), opacity .18s;
}
.btn:active { transform: translateY(2px); }
.btn[disabled], .btn[aria-busy="true"] { opacity: .7; cursor: progress; }
.btn-hi { background: var(--hi); color: var(--deeper); border: 0; box-shadow: 0 3px 0 var(--hi-deep), 0 0 0 1px oklch(0.2 0.08 252 / .3); }
.btn-hi:hover { box-shadow: 0 5px 0 var(--hi-deep); transform: translateY(-2px); }
.btn-hi:active { box-shadow: 0 1px 0 var(--hi-deep); transform: translateY(2px); }
.btn-line { background: transparent; color: var(--chalk); border: 1.5px solid var(--chalk); }
.btn-line:hover { background: oklch(0.96 0.015 230 / 0.08); }
.bar .btn { min-height: 38px; font-size: 15px; padding: 0 14px; }
.wide { width: 100%; }
.linkish { background: none; border: 0; padding: 4px 0; color: var(--faded); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: 15px; }
.linkish:hover { color: var(--chalk); }
.copy {
  border: 1px solid var(--line); background: transparent; border-radius: 3px; padding: 2px 8px; min-height: 28px;
  font-size: 13px; font-weight: 600; cursor: pointer; color: var(--faded);
}
.copy:hover { color: var(--chalk); border-color: var(--faded); }
.copy.ok { color: var(--good); border-color: var(--good); }
.kbd { display: inline-block; min-width: 24px; padding: 0 5px; margin: 0 2px; text-align: center; border: 1px solid var(--faded); border-bottom-width: 2px; border-radius: 3px; font-size: 13px; line-height: 20px; }

/* ---------- stage band ---------- */
.stage-band {
  display: grid; grid-template-columns: minmax(250px, 1fr) auto minmax(250px, 1fr); gap: 28px;
  align-items: start; padding: 20px 28px 40px; max-width: 1480px; margin: 0 auto;
}
.stage {
  --h: min(calc(100svh - var(--bar) - 40px), 900px);
  position: relative; height: var(--h); width: calc(var(--h) * 0.5625);
  border: 1.5px solid var(--chalk); outline: 1px solid var(--line); outline-offset: 5px;
  overflow: hidden; background: var(--ink); touch-action: none; user-select: none; -webkit-user-select: none;
}
#tower { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.touchpad { position: absolute; inset: 0; z-index: 2; }
.hud { position: absolute; inset: 0 0 auto 0; z-index: 4; display: flex; align-items: flex-start; padding: 10px 12px; pointer-events: none; }
.hud-score { font-family: var(--display); font-size: 40px; line-height: 1; text-shadow: 0 2px 0 var(--deep); }
.hud-next { margin: 12px 0 0 14px; font-family: var(--display); font-size: 14px; color: var(--red-soft); }
.hud-pause {
  pointer-events: auto; margin-left: auto; width: 40px; height: 40px; display: grid; place-items: center;
  background: oklch(0.26 0.09 250 / 0.8); border: 1.5px solid var(--chalk); border-radius: 4px; cursor: pointer;
}
.passed {
  position: absolute; left: 50%; top: 64px; z-index: 4; transform: translate(-50%, -8px); opacity: 0;
  font-family: var(--display); font-size: 20px; color: var(--deeper); background: var(--red-soft); padding: 2px 12px; pointer-events: none;
  transition: opacity .25s var(--ease), transform .35s var(--ease);
}
.passed.on { opacity: 1; transform: translate(-50%, 0) rotate(-2deg); }

/* sheets inside the stage */
.sheet {
  position: absolute; inset: 0; z-index: 6; display: flex; align-items: flex-end; padding: 14px;
  background: linear-gradient(to top, oklch(0.21 0.075 252 / 0.9), oklch(0.21 0.075 252 / 0.2) 70%, transparent);
  animation: sheetIn .45s var(--ease) both;
}
@keyframes sheetIn { from { opacity: 0; } to { opacity: 1; } }
.sheet-inner {
  width: 100%; background: var(--deep); border: 1.5px solid var(--chalk); padding: 20px 20px 18px;
  box-shadow: 0 0 0 5px oklch(0.26 0.09 250), 0 0 0 6px var(--line);
  animation: slideUp .5s var(--ease) both;
}
@keyframes slideUp { from { transform: translateY(24px); } to { transform: none; } }
.sheet-small { margin-bottom: 30%; }
.sheet-kicker { font-size: 15px; color: var(--faded); font-weight: 600; }
.sheet-title { font-size: 28px; margin: 4px 0 14px; }
.sheet-copy { color: var(--faded); margin-bottom: 14px; }
.steps { list-style: none; padding: 0; margin: 0 0 14px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.steps li { display: grid; gap: 4px; font-size: 14px; line-height: 1.3; color: var(--faded); }
.steps svg { width: 100%; height: 40px; border-bottom: 1px dashed var(--line); }
.s-line { fill: none; stroke: var(--chalk); stroke-width: 2; }
.s-dash { fill: none; stroke: var(--hi); stroke-width: 1.6; stroke-dasharray: 3 3; }
.s-red { fill: none; stroke: var(--red); stroke-width: 4; }
.s-txt { fill: var(--chalk); font-family: var(--display); font-size: 13px; text-anchor: middle; }
.sheet-status { min-height: 0; font-size: 15px; margin-bottom: 12px; color: var(--faded); }
.sheet-status:empty { display: none; }
.sheet-status.err, .res-status.err { color: var(--red-soft); }
.sheet-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.sheet-actions .btn { flex: 1 1 auto; }
#tiltBtn { margin-top: 10px; }

.res-score { display: flex; align-items: center; gap: 16px; margin: 2px 0 10px; }
.res-score .num { font-family: var(--display); font-size: 64px; line-height: 1; }
.stamp {
  font-family: var(--display); font-size: 22px; color: var(--good); border: 2.5px solid var(--good); padding: 2px 10px;
  transform: rotate(-8deg); animation: stamp .5s var(--ease) both;
}
.stamp.practice { color: var(--faded); border-color: var(--faded); }
@keyframes stamp { from { transform: rotate(-8deg) scale(1.8); opacity: 0; } to { transform: rotate(-8deg) scale(1); opacity: 1; } }
.res-status { font-size: 15px; color: var(--faded); margin-bottom: 10px; }
.res-status:empty { display: none; }
.res-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin: 0 0 14px; border-top: 1px solid var(--line); }
.res-grid div { padding: 8px 0; border-bottom: 1px solid var(--line); }
.res-grid div:nth-child(odd) { padding-right: 10px; border-right: 1px solid var(--line); }
.res-grid div:nth-child(even) { padding-left: 12px; }
.res-grid dt { font-size: 13px; color: var(--faded); }
.res-grid dd { margin: 0; font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- title block ---------- */
.titleblock { border: 1.5px solid var(--chalk); background: oklch(0.26 0.09 250 / 0.7); position: sticky; top: calc(var(--bar) + 20px); }
.tb-row { padding: 18px 18px 16px; border-bottom: 1px solid var(--line); }
.tb-title h1 { font-size: clamp(40px, 4vw, 60px); line-height: .95; margin-bottom: 12px; }
.rule { font-size: 17px; }
.tb-grid { display: grid; grid-template-columns: 1fr 1fr; }
.tb-cell { padding: 10px 18px; border-bottom: 1px solid var(--line); display: grid; }
.tb-cell:nth-child(odd) { border-right: 1px solid var(--line); }
.tb-k { font-size: 13px; color: var(--faded); font-weight: 500; }
.tb-v { font-size: 24px; font-weight: 700; line-height: 1.2; }
.tb-pot .tb-v { color: var(--hi); }
.tb-split { padding: 12px 18px; font-size: 15px; color: var(--faded); border-bottom: 1px solid var(--line); }
.tb-keys { padding: 12px 18px; font-size: 14px; color: var(--faded); }

/* ---------- marks ---------- */
.marks { position: sticky; top: calc(var(--bar) + 20px); }
.marks-head { display: flex; align-items: baseline; justify-content: space-between; border-bottom: 1.5px solid var(--chalk); padding-bottom: 8px; margin-bottom: 4px; }
.marks-head h2 { font-size: 26px; }
.board { list-style: none; margin: 0; padding: 0; }
.board li {
  display: grid; grid-template-columns: 30px 1fr auto; align-items: baseline; gap: 10px;
  padding: 8px 2px; border-bottom: 1px dashed var(--line); font-size: 16px;
}
.board li .rk { font-family: var(--display); color: var(--red-soft); font-size: 18px; }
.board li .w { font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board li .sc { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.board li .sh { grid-column: 2 / 4; font-size: 13px; color: var(--faded); margin-top: -4px; }
.board li.me { background: oklch(0.96 0.015 230 / 0.08); }
.board li.me .rk { color: var(--chalk); }
.board li.fresh { animation: flash 1.2s var(--ease); }
@keyframes flash { from { background: oklch(0.90 0.16 100 / 0.3); } to { background: transparent; } }
.tag { display: inline-block; font-size: 12px; font-weight: 600; color: var(--faded); border: 1px solid var(--line); padding: 0 5px; border-radius: 3px; margin-left: 6px; }
.me-row { margin-top: 12px; padding: 10px 12px; border: 1.5px solid var(--chalk); font-size: 15px; }
.me-row strong { font-size: 18px; }
.empty { padding: 18px 4px; color: var(--faded); font-size: 15px; }
.empty strong { display: block; color: var(--chalk); font-family: var(--display); font-weight: 400; font-size: 20px; margin-bottom: 4px; }
.skel { height: 18px; margin: 12px 0; background: linear-gradient(90deg, var(--line-soft), var(--line), var(--line-soft)); background-size: 200% 100%; animation: sk 1.4s linear infinite; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- mechanism ---------- */
.mech {
  background: var(--deeper); border-block: 1.5px solid var(--chalk);
  display: grid; grid-template-columns: minmax(280px, 0.8fr) 1.6fr; gap: 40px; padding: 72px max(28px, calc((100vw - 1400px) / 2));
}
.mech h2 { font-size: clamp(36px, 4vw, 56px); margin-bottom: 18px; }
.mech-copy p { max-width: 46ch; color: var(--faded); margin-bottom: 14px; }
.mech-eg { color: var(--chalk) !important; font-size: 16px; border-left: 0; padding-top: 12px; border-top: 1px dashed var(--line); }
.mech-draw svg { width: 100%; height: auto; display: block; }
.m-box { fill: url(#hatch); stroke: var(--chalk); stroke-width: 1.8; }
.m-hatch { stroke: oklch(0.80 0.06 235 / 0.25); stroke-width: 1.5; }
.m-pipe { fill: none; stroke: var(--chalk); stroke-width: 2; }
.m-thin { stroke: var(--red); stroke-dasharray: 6 4; }
.m-fat { stroke: var(--hi); stroke-width: 3.5; }
.m-arrow { fill: none; stroke: var(--chalk); stroke-width: 1.6; }
.m-fill { fill: oklch(0.90 0.16 100 / 0.35); transition: y .8s var(--ease), height .8s var(--ease); }
.m-hand { fill: none; stroke: var(--hi); stroke-width: 2.5; stroke-linecap: round; }
.m-lbl { fill: var(--chalk); font-family: var(--display); font-size: 17px; text-anchor: middle; }
.m-sub { fill: var(--faded); font-family: var(--text); font-size: 13px; text-anchor: middle; }
.m-left { text-anchor: start; }
.m-big { fill: var(--hi); font-family: var(--display); font-size: 30px; text-anchor: middle; }
.m-bar { fill: var(--red); }
.m-bar.ghost { fill: none; stroke: var(--line); stroke-dasharray: 3 3; }
.m-barlbl { fill: var(--chalk); font-size: 11px; font-family: var(--text); text-anchor: end; }

/* ---------- ledger ---------- */
.ledger { padding: 72px 28px; max-width: 1400px; margin: 0 auto; display: grid; grid-template-columns: minmax(240px, 0.6fr) 1.6fr; gap: 40px; }
.ledger-head h2 { font-size: clamp(34px, 3.4vw, 48px); margin-bottom: 10px; }
.ledger-head p { color: var(--faded); }
.ledger-body { display: grid; grid-template-columns: 1.2fr 1fr; gap: 28px; }
.ledger-list { list-style: none; margin: 0; padding: 0; border-top: 1.5px solid var(--chalk); }
.ledger-list li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.ledger-list .amt { font-weight: 700; font-size: 20px; color: var(--hi); font-variant-numeric: tabular-nums; }
.ledger-list .meta { font-size: 14px; color: var(--faded); }
.ledger-list a { font-size: 14px; color: var(--faded); }
.lastround { border: 1.5px solid var(--chalk); padding: 16px 18px; background: oklch(0.26 0.09 250 / 0.6); align-self: start; }
.lastround h3 { font-size: 22px; margin-bottom: 8px; }
.lastround ol { margin: 0; padding: 0; list-style: none; }
.lastround li { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px dashed var(--line); font-size: 15px; font-variant-numeric: tabular-nums; }

/* ---------- notes ---------- */
.notes { padding: 20px 28px 80px; max-width: 1400px; margin: 0 auto; }
.notes h2 { font-size: clamp(30px, 3vw, 42px); margin-bottom: 16px; }
.notes-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 28px; }
.notes details { border-top: 1px solid var(--line); padding: 12px 0; }
.notes summary { cursor: pointer; font-weight: 700; font-size: 18px; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
.notes summary::-webkit-details-marker { display: none; }
.notes summary::after { content: "+"; font-family: var(--display); color: var(--faded); }
.notes details[open] summary::after { content: "\2212"; }
.notes details p { margin-top: 6px; color: var(--faded); font-size: 16px; max-width: 60ch; }

/* ---------- pages ---------- */
.page { padding: 36px 28px 80px; max-width: 1200px; margin: 0 auto; }
.page-head { border-bottom: 1.5px solid var(--chalk); padding-bottom: 16px; margin-bottom: 20px; }
.page-head h1 { font-size: clamp(44px, 6vw, 80px); }
.page-head p { color: var(--faded); margin-top: 6px; }
.board-tools { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between; margin-bottom: 16px; }
.field { display: grid; gap: 4px; flex: 1 1 280px; max-width: 460px; }
.field-label { font-size: 14px; color: var(--faded); font-weight: 600; }
.field input {
  height: 44px; padding: 0 12px; background: var(--deeper); color: var(--chalk); border: 1.5px solid var(--line); border-radius: 4px; font: inherit; font-size: 16px;
}
.field input::placeholder { color: oklch(0.72 0.05 235); }
.field input:focus { border-color: var(--chalk); outline: none; }
.seg { display: inline-flex; border: 1.5px solid var(--chalk); border-radius: 4px; overflow: hidden; }
.seg button { background: transparent; border: 0; padding: 0 14px; min-height: 40px; cursor: pointer; font-weight: 600; color: var(--faded); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-selected="true"], .seg button[aria-checked="true"] { background: var(--chalk); color: var(--deeper); }
.table-wrap { overflow-x: auto; border: 1.5px solid var(--chalk); background: oklch(0.26 0.09 250 / 0.5); }
.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 16px; }
.table th { position: sticky; top: 0; background: var(--deep); text-align: left; font-weight: 600; font-size: 14px; color: var(--faded); padding: 10px 14px; border-bottom: 1.5px solid var(--chalk); }
.table td { padding: 10px 14px; border-bottom: 1px dashed var(--line); }
.table .r { text-align: right; }
.table tr.me td { background: oklch(0.96 0.015 230 / 0.08); }
.table td.rk { font-family: var(--display); color: var(--red-soft); font-size: 18px; }
.table a { color: var(--faded); }
.table .empty-cell { padding: 28px 16px; color: var(--faded); }
.rounds { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.rounds > li { border: 1.5px solid var(--chalk); padding: 14px 16px; background: oklch(0.26 0.09 250 / 0.5); }
.rounds .rh { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.rounds .rh strong { font-family: var(--display); font-weight: 400; font-size: 22px; }
.rounds .ws { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 4px 20px; font-size: 15px; font-variant-numeric: tabular-nums; }
.rounds .ws span { display: flex; justify-content: space-between; border-bottom: 1px dashed var(--line); padding: 3px 0; }
.pot-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; margin-bottom: 36px; }
.split-draw { border: 1.5px solid var(--chalk); padding: 18px; background: oklch(0.26 0.09 250 / 0.5); }
.split-draw h2, .vault h2 { font-size: 26px; margin-bottom: 12px; }
.splitbar { display: flex; height: 56px; border: 1.5px solid var(--chalk); margin: 8px 0 12px; }
.splitbar span { display: grid; place-items: center; font-weight: 700; font-size: 15px; }
.splitbar .s-burn { background: repeating-linear-gradient(45deg, oklch(0.70 0.18 30 / .5) 0 4px, transparent 4px 9px); border-right: 1.5px solid var(--chalk); }
.splitbar .s-pot { background: repeating-linear-gradient(45deg, oklch(0.90 0.16 100 / .35) 0 4px, transparent 4px 9px); }
.split-rows { display: grid; gap: 0; }
.split-rows div { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-variant-numeric: tabular-nums; }
.vault { border: 1.5px solid var(--chalk); padding: 18px; background: var(--deep); }
.vault .big { font-family: var(--display); font-size: 54px; color: var(--hi); line-height: 1; }
.vault dl { display: grid; grid-template-columns: 1fr 1fr; margin: 16px 0 0; }
.vault dl div { padding: 8px 0; border-top: 1px solid var(--line); }
.vault dt { font-size: 13px; color: var(--faded); }
.vault dd { margin: 0; font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; }
.sub-h { font-size: 30px; margin: 0 0 12px; }

/* ---------- footer ---------- */
.foot { padding: 0 28px calc(28px + var(--tab)); max-width: 1400px; margin: 0 auto; }
.foot-block { display: grid; grid-template-columns: 1.3fr repeat(4, 1fr); border: 1.5px solid var(--chalk); outline: 1px solid var(--line); outline-offset: 4px; }
.foot-cell { padding: 12px 14px; border-right: 1px solid var(--line); display: grid; align-content: start; gap: 2px; font-size: 15px; }
.foot-cell:last-child { border-right: 0; }
.foot-cell a { margin-right: 10px; }
.foot-name { display: flex; align-items: center; gap: 12px; }
.foot-name strong { font-family: var(--display); font-weight: 400; font-size: 22px; display: block; }
.foot-name span { font-size: 13px; color: var(--faded); }
.ca { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.ca .num { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- tab bar ---------- */
.tabbar { display: none; }

/* ---------- coin sheet ---------- */
.scrim { position: fixed; inset: 0; background: oklch(0.15 0.06 252 / 0.5); z-index: 40; }
.coinsheet {
  position: fixed; z-index: 41; top: calc(var(--bar) + 8px); right: 16px; width: min(380px, calc(100vw - 24px));
  background: var(--deep); border: 1.5px solid var(--chalk); box-shadow: 0 0 0 5px var(--deeper), 0 0 0 6px var(--line);
  padding: 16px; animation: slideDown .3s var(--ease) both;
}
@keyframes slideDown { from { transform: translateY(-10px); opacity: 0; } to { transform: none; opacity: 1; } }
.cs-head { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; }
.cs-head img { border-radius: 4px; background: var(--ink); object-fit: cover; }
.cs-head h2 { font-size: 22px; }
.x { width: 36px; height: 36px; background: none; border: 1px solid var(--line); border-radius: 4px; cursor: pointer; font-size: 22px; line-height: 1; }
.spark { width: 100%; height: 70px; margin: 12px 0 4px; display: block; border-bottom: 1px dashed var(--line); }
.cs-stats { display: grid; grid-template-columns: 1fr 1fr; margin: 8px 0; }
.cs-stats div { padding: 6px 0; border-bottom: 1px dashed var(--line); }
.cs-stats dt { font-size: 13px; color: var(--faded); }
.cs-stats dd { margin: 0; font-weight: 700; }
.cs-ca { width: 100%; justify-content: space-between; padding: 8px 0; }
.cs-buy { display: grid; gap: 8px; margin-top: 6px; }
.seg-amt { width: 100%; }
.seg-amt button { flex: 1; }
.cs-status { font-size: 14px; color: var(--faded); }
.cs-status:empty { display: none; }
.cs-status.err { color: var(--red-soft); }
.cs-status a { color: var(--chalk); }

/* ---------- toasts ---------- */
.toasts { position: fixed; z-index: 60; left: 50%; transform: translateX(-50%); bottom: calc(20px + var(--tab)); display: grid; gap: 8px; width: min(420px, calc(100vw - 24px)); pointer-events: none; }
.toast { pointer-events: auto; background: var(--chalk); color: var(--deeper); padding: 10px 14px; border-radius: 3px; font-weight: 600; font-size: 15px; box-shadow: 0 4px 0 oklch(0.2 0.08 252 / .4); animation: toastIn .3s var(--ease) both; }
.toast.err { background: var(--red-soft); }
.toast a { color: inherit; margin-left: 6px; }
@keyframes toastIn { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .stage-band { grid-template-columns: 1fr auto; }
  .marks { grid-column: 1 / -1; position: static; }
  .notes-grid { grid-template-columns: 1fr 1fr; }
  .foot-block { grid-template-columns: 1fr 1fr; }
  .foot-cell { border-bottom: 1px solid var(--line); }
}
@media (max-width: 860px) {
  :root { --bar: 54px; --tab: 62px; }
  body { font-size: 16px; }
  .bar { padding: 0 12px; gap: 10px; }
  .routes { display: none; }
  .brand span { display: none; }
  .chip { padding: 0 9px; gap: 6px; font-size: 14px; }
  .stage-band { display: flex; flex-direction: column; align-items: stretch; padding: 0 0 28px; gap: 0; }
  .sheet-title { display: none; }
  .steps svg { height: 30px; }
  .sheet-inner { padding: 12px 12px 12px; }
  .marks-head { gap: 12px; flex-wrap: wrap; }
  .stage { order: 1; --h: calc(100svh - var(--bar) - var(--tab)); width: 100%; height: var(--h); border: 0; outline: 0; border-bottom: 1.5px solid var(--chalk); }
  .titleblock { order: 2; position: static; margin: 20px 14px 0; }
  .marks { order: 3; margin: 24px 14px 0; }
  .steps li { font-size: 13px; }
  .sheet { padding: 10px; }
  .sheet-inner { padding: 16px 14px 14px; }
  .sheet-title { font-size: 24px; }
  .mech { grid-template-columns: 1fr; padding: 48px 16px; gap: 20px; }
  .ledger { grid-template-columns: 1fr; padding: 48px 16px; gap: 20px; }
  .ledger-body { grid-template-columns: 1fr; }
  .notes { padding: 0 16px 48px; }
  .notes-grid { grid-template-columns: 1fr; }
  .page { padding: 24px 14px 48px; }
  .pot-grid { grid-template-columns: 1fr; }
  .table { font-size: 15px; }
  .table th, .table td { padding: 9px 10px; }
  .hide-sm { display: none; }
  .foot { padding: 0 14px calc(20px + var(--tab)); }
  .foot-block { grid-template-columns: 1fr; }
  .foot-cell { border-right: 0; }
  .tabbar {
    display: grid; grid-template-columns: repeat(3, 1fr); position: fixed; z-index: 35; left: 0; right: 0; bottom: 0;
    height: calc(var(--tab) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: oklch(0.21 0.075 252 / 0.97); border-top: 1.5px solid var(--chalk);
  }
  .tabbar a { display: grid; place-items: center; align-content: center; gap: 2px; text-decoration: none; font-weight: 600; font-size: 13px; color: var(--faded); }
  .tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
  .tabbar a[aria-current="page"] { color: var(--hi); }
  .coinsheet { top: auto; bottom: calc(var(--tab) + 8px); right: 12px; left: 12px; width: auto; }
  body.playing .tabbar { display: none; }
  body.playing .stage { --h: calc(100svh - var(--bar)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
