/* Hallmark · shape: app screen · genre: atmospheric · theme: custom · idea: "The market is a live wire you hold, the screen lights up only as hard as you're exposed." · vibe: "neon club, wet glass, held breath, explosive tape"
 * nav: per-screen top bar (ticker wheel, balance, account chip) and a four-tab bar on the sessions home · signature: friends' entries as ghost lines on your chart, each tagged by their avatar ring in their direction colour, beside the held glass lever · states: full, empty (no live sessions), waiting (a player not ready in the lobby), liquidated (a player out), read-only (spectating), battle royale (top-N plus you pinned)
 * axes: dark/grotesk-heavy/chromatic-yellow · posture: committed, two neons carry direction on a carbon ground · contrast: pass · v2.0.0 */
/* Hallmark · pre-emit critique: P4 H4 E5 S5 R4 V4 · weakest: H, eight phones read as one product only if the chrome is identical, so the top bar, lever and chart are one set of classes reused on every trade-like frame and glow is driven by one --heat variable per phone */
/* Hallmark · waive 29 · glow is set by data-heat on each phone, 0 flat, 0.5 at one detent, 1 at max · the brief's own idea: the screen lights up only as hard as you are exposed, so the glow is the position size, not decoration */
/* Hallmark · waive 39b · the ticker wheel is a 64px drum and the scoreboard rows are 24px · the wheel shows three symbols as one control, and six rail rows must fit under the lever on an 844px phone; each row is a full-width tap strip */
@import url("./tokens.css");
@import url("./base.css");

:root {
  color-scheme: dark;
  --color-loss: color-mix(in oklab, var(--color-liq) 62%, var(--color-ink-2));
  --color-scrim: color-mix(in oklch, var(--color-paper) 72%, transparent);
  --color-seat: color-mix(in oklch, var(--color-rule) 70%, transparent);
  --phone-radius: 48px;
  --lever-w: 76px;
  --lever-h: 440px;
  --detent-gap: 95px;
}

/* Page */
.page { padding-block: var(--space-xl) var(--space-2xl); }
.page-head { display: grid; gap: var(--space-xs); margin-bottom: var(--space-xl); max-width: 60ch; }
.wordmark { font-family: var(--font-display); font-weight: 800; font-size: var(--text-display-s); letter-spacing: var(--tracking-display); line-height: 1; color: var(--color-ink); }
.page-head p { color: var(--color-muted); font-size: var(--text-md); }
.strip { display: flex; flex-wrap: wrap; gap: var(--space-xl) var(--space-lg); justify-content: center; margin: 0; padding: 0; list-style: none; }
.shot { margin: 0; display: grid; gap: var(--space-sm); width: var(--phone-w); }
@media (max-width: 27rem) { .shot { zoom: 0.86; } }
.shot figcaption { font-size: var(--text-sm); color: var(--color-muted); max-width: 44ch; line-height: 1.45; }

/* Phone */
.phone {
  --heat: 0; --dir: var(--color-ink-2); --dir-glow: transparent; --dir-ink: var(--color-paper);
  position: relative; width: var(--phone-w); height: var(--phone-h); overflow: hidden;
  border-radius: var(--phone-radius); border: var(--rule-hair) solid var(--color-rule);
  background: var(--color-paper); isolation: isolate;
}
.phone[data-dir="long"] { --dir: var(--color-long); --dir-glow: var(--color-long-glow); --dir-ink: var(--color-long-ink); }
.phone[data-dir="short"] { --dir: var(--color-short); --dir-glow: var(--color-short-glow); --dir-ink: var(--color-short-ink); }
.phone[data-heat="1"] { --heat: 0.5; }
.phone[data-heat="2"] { --heat: 1; }
.phone::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 30;
  box-shadow: inset 0 0 0 1px var(--dir-glow), inset 0 0 calc(var(--heat) * 90px) var(--dir-glow);
  opacity: var(--heat);
}
.phone[data-heat="2"]::after { animation: held 1.6s var(--ease-in-out) infinite alternate; }
@keyframes held { from { opacity: 0.75; } to { opacity: 1; } }

/* Shared: avatars */
.av {
  --ring: var(--color-rule);
  display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%;
  background: var(--color-paper-3); border: 2px solid var(--ring); color: var(--color-ink);
  font: 600 var(--text-xs)/1 var(--font-body);
}
.av--lg { width: 44px; height: 44px; font-size: var(--text-md); }
.av--sm { width: 20px; height: 20px; border-width: 1.5px; font-size: 0.625rem; }
.av--long { --ring: var(--color-long); }
.av--short { --ring: var(--color-short); }
.av--liq { --ring: var(--color-liq); color: var(--color-muted); }
.stack { display: flex; }
.stack .av + .av { margin-left: calc(var(--space-xs) * -1); }

/* Shared: figures */
.fig { font-family: var(--font-outlier); font-variant-numeric: tabular-nums; }
.up { color: var(--color-cleared); }
.down { color: var(--color-loss); }

/* Shared: buttons and controls */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-xs);
  min-height: 48px; padding: 0 var(--space-lg); border-radius: var(--radius-card); border: 0; cursor: pointer;
  background: var(--color-long); color: var(--color-long-ink); font-weight: 600; font-size: var(--text-md);
  transition: transform var(--dur-micro) var(--ease-out), background-color var(--dur-short) var(--ease-out);
}
.btn:hover { background: color-mix(in oklch, var(--color-long) 88%, var(--color-ink)); }
.btn:active { transform: scale(0.98); }
.btn:disabled { background: var(--color-paper-3); color: var(--color-muted); cursor: not-allowed; }
.btn--block { width: 100%; }
.btn-line {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-xs);
  min-height: 44px; padding: 0 var(--space-md); border-radius: var(--radius-card); cursor: pointer;
  background: transparent; color: var(--color-ink); border: 1px solid var(--color-rule); font-size: var(--text-sm); font-weight: 600;
  transition: border-color var(--dur-short) var(--ease-out), transform var(--dur-micro) var(--ease-out);
}
.btn-line:hover { border-color: var(--color-ink-2); }
.btn-line:active { transform: scale(0.98); }
.btn-line:disabled { color: var(--color-muted); cursor: not-allowed; }
.btn-line svg, .btn svg { width: 18px; height: 18px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; cursor: pointer;
  background: transparent; border: 1px solid var(--color-rule); color: var(--color-ink);
  transition: border-color var(--dur-short) var(--ease-out);
}
.icon-btn:hover { border-color: var(--color-ink-2); }
.icon-btn svg { width: 18px; height: 18px; }
:is(.btn, .btn-line, .icon-btn, .row-btn, .chip, .tab):focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; transition: none; }

/* App screens (non-trade) */
.app { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 56px var(--space-md) 0; }
.app-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); min-height: 44px; }
.app-head .wordmark { font-size: var(--text-2xl); }
.app-title { font: 800 var(--text-xl)/1.15 var(--font-display); letter-spacing: var(--tracking-display); }
.app-sub { color: var(--color-muted); font-size: var(--text-sm); }
.app-title--page { margin-top: var(--space-md); }
.app-sub--center { text-align: center; margin-top: var(--space-2xs); }
.head-spacer { width: 40px; flex: none; }
.section-h { font: 600 var(--text-md)/1.3 var(--font-body); color: var(--color-ink); margin: var(--space-lg) 0 var(--space-xs); }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.btn-line--sm { min-height: 32px; padding: 0 var(--space-sm); }

/* Sessions home */
.cta-row { display: grid; gap: var(--space-sm); margin-top: var(--space-lg); }
.code-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-xs); }
.input {
  min-height: 44px; width: 100%; padding: 0 var(--space-md); border-radius: var(--radius-card);
  background: var(--color-paper-2); border: 1px solid var(--color-muted); color: var(--color-ink);
  transition: border-color var(--dur-short) var(--ease-out);
}
.input::placeholder { color: var(--color-muted); }
.input:hover { border-color: var(--color-ink); }
.input:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 1px; transition: none; }
.input.fig { letter-spacing: 0.04em; }
.sessions { list-style: none; margin: 0; padding: 0; }
.session { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-2xs) var(--space-sm); padding: var(--space-sm) 0; border-bottom: 1px solid var(--color-rule); align-items: center; }
.session-name { font-weight: 600; font-size: var(--text-md); line-height: 1.3; }
.session-meta { display: flex; gap: var(--space-sm); color: var(--color-muted); font-size: var(--text-xs); align-items: center; }
.session-lead { grid-column: 1 / -1; display: flex; align-items: center; gap: var(--space-xs); font-size: var(--text-xs); color: var(--color-ink-2); }
.session-lead .fig { margin-left: auto; }
.tag { display: inline-flex; align-items: center; min-height: 20px; padding: 0 var(--space-xs); border-radius: 6px; border: 1px solid var(--color-rule); font-size: var(--text-xs); color: var(--color-ink-2); }
.tag--live { border-color: var(--color-cleared); color: var(--color-cleared); }
.tabbar { margin-top: auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--color-rule); padding: var(--space-xs) 0 28px; margin-inline: calc(var(--space-md) * -1); background: var(--color-paper); }
.tab { display: grid; justify-items: center; gap: var(--space-3xs); min-height: 48px; padding-top: var(--space-xs); background: none; border: 0; color: var(--color-muted); font-size: var(--text-xs); cursor: pointer; transition: color var(--dur-short) var(--ease-out); }
.tab svg { width: 22px; height: 22px; }
.tab:hover { color: var(--color-ink-2); }
.tab[aria-current="page"] { color: var(--color-ink); }
.empty { margin-top: var(--space-xl); display: grid; justify-items: start; gap: var(--space-sm); padding: var(--space-lg) 0; border-top: 1px solid var(--color-rule); border-bottom: 1px solid var(--color-rule); }
.empty .wire { width: 100%; height: 56px; color: var(--color-rule); }
.empty h3 { font: 600 var(--text-lg)/1.3 var(--font-body); }
.empty p { color: var(--color-muted); font-size: var(--text-sm); }

/* Create session */
.form { display: grid; gap: var(--space-md); margin-top: var(--space-sm); }
.field { display: grid; gap: var(--space-2xs); border: 0; margin: 0; padding: 0; min-width: 0; }
.field > label, .field > legend { font-size: var(--text-sm); color: var(--color-ink-2); padding: 0; margin-bottom: var(--space-2xs); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: var(--space-3xs); padding: var(--space-3xs); border-radius: 12px; background: var(--color-paper-2); border: 1px solid var(--color-rule); }
.seg label { position: relative; display: grid; place-items: center; min-height: 36px; border-radius: 10px; font-size: var(--text-sm); color: var(--color-ink-2); cursor: pointer; transition: background-color var(--dur-short) var(--ease-out), color var(--dur-short) var(--ease-out); }
.seg label:hover { color: var(--color-ink); }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg label:has(:checked) { background: var(--color-paper-3); color: var(--color-ink); box-shadow: inset 0 0 0 1px var(--color-long); }
.seg label:has(:focus-visible) { outline: 2px solid var(--color-focus); outline-offset: 1px; }
.seg label:has(:disabled) { color: var(--color-muted); cursor: not-allowed; }
.packs { display: grid; gap: 0; border-top: 1px solid var(--color-rule); }
.pack { position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr) 72px; align-items: center; gap: var(--space-sm); min-height: 48px; border-bottom: 1px solid var(--color-rule); cursor: pointer; }
.pack input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.pack .play { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--color-rule); color: var(--color-ink-2); }
.pack .play svg { width: 12px; height: 12px; }
.pack-name { font-size: var(--text-sm); font-weight: 600; }
.pack-name small { display: block; color: var(--color-muted); font-size: var(--text-xs); font-weight: 400; }
.pack .bars { width: 72px; height: 22px; color: var(--color-rule); }
.pack:has(:checked) .play { border-color: var(--color-long); color: var(--color-long); }
.pack:has(:checked) .bars { color: var(--color-long); }
.pack:has(:focus-visible) { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.pack:hover .pack-name { color: var(--color-ink); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); font-size: var(--text-sm); }
.switch-row small { display: block; color: var(--color-muted); font-size: var(--text-xs); }
.switch { appearance: none; flex: none; width: 48px; height: 28px; border-radius: 14px; margin: 0; background: var(--color-paper-3); border: 1px solid var(--color-rule); position: relative; cursor: pointer; transition: background-color var(--dur-short) var(--ease-out); }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--color-ink-2); transition: transform var(--dur-short) var(--ease-out); }
.switch:checked { background: var(--color-long); border-color: var(--color-long); }
.switch:checked::after { transform: translateX(20px); background: var(--color-long-ink); }
.switch:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.switch:disabled { opacity: 0.5; cursor: not-allowed; }
.invite { display: flex; gap: var(--space-xs); overflow-x: auto; scrollbar-width: none; }
.chip { display: inline-flex; align-items: center; gap: var(--space-xs); flex: none; min-height: 36px; padding: 0 var(--space-sm) 0 var(--space-2xs); border-radius: 18px; border: 1px solid var(--color-rule); background: transparent; color: var(--color-ink-2); font-size: var(--text-sm); cursor: pointer; transition: border-color var(--dur-short) var(--ease-out); }
.chip:hover { border-color: var(--color-ink-2); }
.chip[aria-pressed="true"] { border-color: var(--color-long); color: var(--color-ink); }
.chip svg { width: 14px; height: 14px; color: var(--color-long); }
.sticky-foot { margin-top: auto; padding: var(--space-sm) 0 32px; }

/* Lobby */
.lobby-meta { display: flex; flex-wrap: wrap; gap: var(--space-xs); margin-top: var(--space-sm); }
.code-chip { display: inline-flex; align-items: center; gap: var(--space-xs); min-height: 36px; padding: 0 var(--space-sm); border-radius: 10px; border: 1px dashed var(--color-rule); background: none; color: var(--color-ink); cursor: pointer; transition: border-color var(--dur-short) var(--ease-out); }
.code-chip:hover { border-color: var(--color-ink-2); }
.code-chip:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.code-chip svg { width: 14px; height: 14px; color: var(--color-muted); }
.countdown { display: grid; justify-items: center; gap: 0; margin: var(--space-lg) 0 var(--space-md); }
.countdown .big { font: 800 5rem/1 var(--font-display); font-variant-numeric: tabular-nums; letter-spacing: var(--tracking-display); color: var(--color-ink); }
.countdown p { color: var(--color-muted); font-size: var(--text-sm); text-align: center; }
.players { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--color-rule); }
.player { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto auto; gap: var(--space-sm); align-items: center; min-height: 52px; border-bottom: 1px solid var(--color-rule); }
.handle { font-weight: 600; font-size: var(--text-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.handle small { font-weight: 400; color: var(--color-muted); }
.state { display: inline-flex; align-items: center; gap: var(--space-2xs); font-size: var(--text-xs); color: var(--color-ink-2); min-width: 64px; justify-content: flex-end; }
.state svg { width: 14px; height: 14px; }
.state--ready { color: var(--color-cleared); }
.state--wait { color: var(--color-muted); }
.player--open .av { --ring: var(--color-seat); border-style: dashed; background: none; color: var(--color-muted); }
.player--open .handle { color: var(--color-muted); font-weight: 400; }

/* Trade chrome: top bar */
.top { position: absolute; inset: 0 0 auto; z-index: 20; height: 118px; padding: 48px var(--space-md) 0; display: grid; grid-template-columns: 76px minmax(0, 1fr) 108px; align-items: center; gap: var(--space-xs); }
.wheel {
  display: grid; justify-items: start; align-content: center; height: 64px; padding: 0; background: none; border: 0; color: var(--color-ink); cursor: pointer; text-align: left;
  mask-image: linear-gradient(to bottom, transparent, var(--color-ink) 22%, var(--color-ink) 78%, transparent);
}
.wheel span { display: block; font-family: var(--font-display); line-height: 1; }
.wheel .near { font-size: var(--text-sm); font-weight: 600; color: var(--color-muted); padding: var(--space-3xs) 0; transform: perspective(60px) rotateX(28deg) scaleY(0.8); }
.wheel .near:last-child { transform: perspective(60px) rotateX(-28deg) scaleY(0.8); }
.wheel .cur { font-size: var(--text-3xl); font-weight: 800; letter-spacing: var(--tracking-display); }
.wheel:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.wheel:disabled { cursor: default; }
.bal { display: grid; justify-items: center; gap: var(--space-3xs); line-height: 1.1; }
.bal b { font: 600 var(--text-xl)/1 var(--font-outlier); font-variant-numeric: tabular-nums; }
.bal small { font: 400 var(--text-xs)/1 var(--font-outlier); font-variant-numeric: tabular-nums; }
.acct { justify-self: end; display: inline-flex; align-items: center; gap: var(--space-2xs); min-height: 32px; padding: 0 var(--space-sm); border-radius: 16px; border: 1px solid var(--glass-edge); background: var(--glass-fill); color: var(--color-ink); font-size: var(--text-xs); cursor: pointer; transition: border-color var(--dur-short) var(--ease-out); }
.acct:hover { border-color: var(--color-ink-2); }
.acct:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.acct svg { width: 12px; height: 12px; color: var(--color-muted); }
.acct:disabled { cursor: default; }

/* Session strip under the top bar */
.sess { position: absolute; top: 120px; left: var(--space-md); right: var(--space-md); z-index: 20; display: flex; align-items: center; gap: var(--space-sm); font-size: var(--text-xs); color: var(--color-ink-2); min-height: 28px; }
.sess .name { font-weight: 600; color: var(--color-ink); }
.sess .fig { color: var(--color-ink); }
.sess .push { margin-left: auto; }
.sess .back { display: inline-flex; align-items: center; gap: var(--space-3xs); min-height: 28px; padding: 0 var(--space-xs) 0 var(--space-3xs); border-radius: 8px; border: 1px solid var(--color-rule); background: none; color: var(--color-ink); font-size: var(--text-xs); cursor: pointer; }
.sess .back svg { width: 14px; height: 14px; }
.sess .back:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }

/* Trade chrome: chart */
.chart { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; }
.chart text { font-family: var(--font-body); font-size: 10.5px; }
.chart .mono { font-family: var(--font-outlier); font-variant-numeric: tabular-nums; }
.grid-ln { stroke: var(--color-rule); stroke-width: 1; opacity: 0.45; }
.axis { fill: var(--color-muted); }
.px { fill: none; stroke: var(--color-ink); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.phone[data-heat="1"] .px { filter: drop-shadow(0 0 3px var(--dir-glow)); }
.phone[data-heat="2"] .px { filter: drop-shadow(0 0 6px var(--dir-glow)); }
.ln-entry { stroke: var(--dir); stroke-width: 1.25; }
.ln-be { stroke: var(--color-cleared); stroke-width: 1; stroke-dasharray: 5 4; }
.ln-liq { stroke: var(--color-liq); stroke-width: 1.25; stroke-dasharray: 2 3; }
.t-entry { fill: var(--dir); }
.t-be { fill: var(--color-cleared); }
.t-liq { fill: var(--color-liq); }
.t-ink { fill: var(--color-ink); }
.t-muted { fill: var(--color-muted); }
.entry-dot { fill: var(--dir); }
.now-tag { fill: var(--color-cleared); }
.now-tag-text { fill: var(--color-paper); font-weight: 600; }
.now-dot { fill: var(--color-ink); }
.now-ring { fill: none; stroke: var(--color-cleared); stroke-width: 1.5; transform-box: fill-box; transform-origin: center; animation: ping 1.4s var(--ease-out) infinite; }
@keyframes ping { from { transform: scale(0.6); opacity: 0.9; } to { transform: scale(2.4); opacity: 0; } }
.cleared-flash { fill: var(--color-cleared-glow); }
.print-buy { fill: var(--color-long); opacity: 0.55; }
.print-sell { fill: var(--color-short); opacity: 0.6; }
.burst line { stroke: var(--color-long); stroke-width: 1.5; stroke-linecap: round; }
.burst circle { fill: none; stroke: var(--color-long); stroke-width: 1; opacity: 0.7; }
.burst--sell line, .burst--sell circle { stroke: var(--color-short); }
.liq-burst circle { fill: none; stroke: var(--color-liq); }
.liq-burst line { stroke: var(--color-liq); stroke-width: 1.5; stroke-linecap: round; }
.ghost { stroke-width: 1.25; stroke-dasharray: 1 4; stroke-linecap: round; opacity: 0.85; }
.ghost--long { stroke: var(--color-long); }
.ghost--short { stroke: var(--color-short); }
.ghost-av circle { fill: var(--color-paper-3); stroke-width: 2; }
.ghost-av text { fill: var(--color-ink); font-family: var(--font-body); font-weight: 600; font-size: 10px; }
.ghost-av--long circle { stroke: var(--color-long); }
.ghost-av--short circle { stroke: var(--color-short); }
.off-chart { fill: var(--color-liq); }

/* Trade chrome: lever */
.lever {
  --d: 0;
  position: absolute; right: 10px; top: calc((var(--phone-h) - var(--lever-h)) / 2); z-index: 15;
  width: var(--lever-w); height: var(--lever-h); border-radius: var(--radius-lever);
  background: var(--glass-fill); border: 1px solid var(--glass-edge);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.4); backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
  box-shadow: inset 0 1px 0 var(--glass-shine), 0 18px 40px -18px var(--color-paper);
}
.lever::before { content: ""; position: absolute; inset: 1px 1px auto; height: 38%; border-radius: var(--radius-lever) var(--radius-lever) 40% 40%; background: linear-gradient(to bottom, var(--glass-shine), transparent); opacity: 0.35; pointer-events: none; }
.lever[data-detent="2"] { --d: 2; }
.lever[data-detent="1"] { --d: 1; }
.lever[data-detent="-1"] { --d: -1; }
.lever[data-detent="-2"] { --d: -2; }
.detents { position: absolute; inset: 30px 0; margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; justify-content: space-between; }
.detents li { height: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 var(--space-sm); font-size: var(--text-xs); color: var(--color-muted); line-height: 1; }
.detents li::after { content: ""; width: 10px; height: 1px; background: var(--glass-edge); }
.puck {
  position: absolute; left: 5px; right: 5px; top: 8px; height: 44px; z-index: 2;
  display: grid; place-items: center; border-radius: 22px; padding: 0;
  transform: translateY(calc((2 - var(--d)) * var(--detent-gap)));
  background: var(--dir);
  border: 1px solid color-mix(in oklab, var(--dir) 70%, var(--glass-edge));
  color: var(--dir-ink); font-size: var(--text-sm); font-weight: 600; cursor: grab;
  box-shadow: inset 0 1px 0 var(--glass-shine), 0 0 calc(8px + var(--heat) * 34px) calc(var(--heat) * 8px) var(--dir-glow);
  transition: transform var(--dur-short) var(--ease-out);
}
.puck::before { content: ""; position: absolute; inset: 2px 6px auto; height: 40%; border-radius: 20px 20px 10px 10px; background: linear-gradient(to bottom, var(--glass-shine), transparent); opacity: 0.6; }
.puck:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 3px; transition: none; }
.phone[data-heat="0"] .puck { background: var(--color-paper-3); color: var(--color-ink); border-color: var(--glass-edge); }
.lever--readonly { opacity: 0.92; }
.lever--readonly .puck { cursor: default; }
.lever--readonly::after { content: "Read only"; position: absolute; left: 0; right: 0; bottom: -22px; text-align: center; font-size: var(--text-xs); color: var(--color-muted); }

/* Toasts */
.toasts { position: absolute; bottom: 236px; left: var(--space-md); right: 96px; z-index: 25; display: grid; gap: var(--space-2xs); justify-items: start; margin: 0; padding: 0; list-style: none; }
.open-pnl { position: absolute; top: 150px; left: var(--space-md); z-index: 20; display: grid; line-height: 1; }
.open-pnl b { font: 800 var(--text-display-s)/1 var(--font-display); font-variant-numeric: tabular-nums; letter-spacing: var(--tracking-display); color: var(--color-cleared); text-shadow: 0 0 calc(6px + var(--heat) * 18px) var(--color-cleared-glow); }
.open-pnl span { font-size: var(--text-xs); color: var(--color-muted); margin-top: var(--space-2xs); }
.t-muted-ln { stroke: var(--color-muted); stroke-width: 1; stroke-dasharray: 1 3; }
.best { font-size: var(--text-xs); color: var(--color-muted); margin-top: var(--space-sm); }
.seg--market { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.7fr); }
.toast {
  display: inline-flex; align-items: center; gap: var(--space-xs); min-height: 32px; padding: var(--space-2xs) var(--space-sm) var(--space-2xs) var(--space-2xs); border-radius: 16px;
  background: var(--color-scrim); border: 1px solid var(--glass-edge);
  -webkit-backdrop-filter: blur(var(--glass-blur)); backdrop-filter: blur(var(--glass-blur));
  font-size: var(--text-xs); color: var(--color-ink);
  animation: toast-in var(--dur-long) var(--ease-out) both;
}
.toast:nth-child(2) { animation-delay: 160ms; opacity: 0.8; }
.toast--short { border-color: color-mix(in oklch, var(--color-short) 60%, transparent); }
.toast--liq { border-color: color-mix(in oklch, var(--color-liq) 70%, transparent); }
.toast--liq b { color: var(--color-liq); }
.toast b { font-weight: 600; }
@keyframes toast-in { from { transform: translateY(-8px) scale(0.96); opacity: 0; } to { transform: none; } }

/* Scoreboard rail */
.rail {
  position: absolute; left: 12px; right: 12px; bottom: 22px; z-index: 18; margin: 0; padding: var(--space-xs) var(--space-2xs); list-style: none;
  border-radius: 18px; background: var(--color-scrim); border: 1px solid var(--glass-edge);
  -webkit-backdrop-filter: blur(var(--glass-blur)); backdrop-filter: blur(var(--glass-blur));
}
.rail li + li { border-top: 1px solid color-mix(in oklch, var(--color-rule) 60%, transparent); }
.rail li.gap { border-top: 1px dashed var(--color-rule); margin-top: var(--space-3xs); padding-top: var(--space-3xs); }
.row-btn {
  display: grid; grid-template-columns: 18px 20px minmax(0, 1fr) auto 12px; gap: var(--space-xs); align-items: center;
  width: 100%; min-height: 24px; padding: 0 var(--space-xs); border: 0; border-radius: 8px; background: none; color: var(--color-ink-2); font-size: var(--text-xs); text-align: left; cursor: pointer;
  transition: background-color var(--dur-short) var(--ease-out);
}
.row-btn:hover { background: var(--glass-fill); }
.row-btn .rank { font-family: var(--font-outlier); color: var(--color-muted); text-align: right; }
.row-btn .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-btn .fig { text-align: right; }
.rail .me .row-btn { background: var(--glass-fill); color: var(--color-ink); }
.rail .me .who { font-weight: 600; }
.rail .out .row-btn { color: var(--color-muted); }
.rail .out .who { text-decoration: line-through; text-decoration-color: var(--color-liq); }

/* Mini lever glyph: five detents, the lit one is the player's exposure */
.glyph { --d: 0; --g: var(--color-muted); position: relative; display: block; width: 8px; height: 20px; border-radius: 3px; border: 1px solid var(--color-rule); }
.glyph::after { content: ""; position: absolute; left: 1px; right: 1px; top: 1px; height: 4px; border-radius: 2px; background: var(--g); transform: translateY(calc((2 - var(--d)) * 3.5px)); }
.glyph[data-d="2"] { --d: 2; --g: var(--color-long); box-shadow: 0 0 6px var(--color-long-glow); }
.glyph[data-d="1"] { --d: 1; --g: var(--color-long); }
.glyph[data-d="-1"] { --d: -1; --g: var(--color-short); }
.glyph[data-d="-2"] { --d: -2; --g: var(--color-short); box-shadow: 0 0 6px var(--color-short-glow); }
.glyph--out { border-color: var(--color-liq); }
.glyph--out::after { background: var(--color-liq); height: 1px; top: 8px; transform: rotate(-60deg); left: -2px; right: -2px; }

/* Spectator panel */
.facts { position: absolute; left: 12px; right: 12px; bottom: 22px; z-index: 18; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--space-md); margin: 0; padding: var(--space-sm) var(--space-md); border-radius: 18px; background: var(--color-scrim); border: 1px solid var(--glass-edge); -webkit-backdrop-filter: blur(var(--glass-blur)); backdrop-filter: blur(var(--glass-blur)); }
.facts div { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-xs); padding: var(--space-xs) 0; border-bottom: 1px solid color-mix(in oklch, var(--color-rule) 60%, transparent); }
.facts div:nth-last-child(-n + 2) { border-bottom: 0; }
.facts dt { font-size: var(--text-xs); color: var(--color-muted); }
.facts dd { margin: 0; font-family: var(--font-outlier); font-variant-numeric: tabular-nums; font-size: var(--text-sm); }
.facts .wide { grid-column: 1 / -1; border-bottom: 0; padding-top: var(--space-xs); }
.facts .wide dd { font: 700 var(--text-display-s)/1 var(--font-display); font-variant-numeric: tabular-nums; color: var(--color-cleared); text-shadow: 0 0 18px var(--color-cleared-glow); }
.facts .wide dt small { display: block; }
.short-ink { color: var(--color-short); }

/* Results */
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: var(--space-xs); margin-top: var(--space-lg); }
.step { display: grid; justify-items: center; gap: var(--space-xs); }
.step .handle { font-size: var(--text-sm); }
.step .fig { font-size: var(--text-sm); }
.block { width: 100%; display: grid; place-items: start center; padding-top: var(--space-md); border-radius: 12px 12px 0 0; background: var(--color-paper-2); border: 1px solid var(--color-rule); border-bottom: 0; font: 800 var(--text-display-s)/1 var(--font-display); color: var(--color-muted); }
.step--1 .block { height: 116px; color: var(--color-cleared); border-color: color-mix(in oklch, var(--color-cleared) 50%, var(--color-rule)); text-shadow: 0 0 20px var(--color-cleared-glow); }
.step--2 .block { height: 88px; }
.step--3 .block { height: 68px; }
.step--1 .fig.up { font-size: var(--text-lg); text-shadow: 0 0 14px var(--color-cleared-glow); }
.results { width: 100%; border-collapse: collapse; font-size: var(--text-xs); margin-top: 0; }
.results th { font-weight: 400; color: var(--color-muted); text-align: right; padding: var(--space-xs) 0 var(--space-xs) var(--space-xs); border-bottom: 1px solid var(--color-rule); }
.results th:first-child, .results td:first-child { text-align: left; padding-left: 0; }
.results td { padding: var(--space-xs) 0 var(--space-xs) var(--space-xs); border-bottom: 1px solid color-mix(in oklch, var(--color-rule) 60%, transparent); text-align: right; font-family: var(--font-outlier); font-variant-numeric: tabular-nums; white-space: nowrap; }
.results td:first-child { font-family: var(--font-body); }
.results .p { display: inline-flex; align-items: center; gap: var(--space-xs); }
.results tr.me td { color: var(--color-ink); }
.results tr.me td:first-child { font-weight: 600; }
.foot-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-xs); margin-top: auto; padding: var(--space-sm) 0 32px; }

@media (prefers-reduced-motion: reduce) {
  .phone[data-heat="2"]::after, .now-ring, .toast { animation: none; }
  .now-ring { opacity: 0; }
  .puck, .switch::after, .btn, .btn-line { transition: none; }
}
