/* Hallmark · v2.0.0 · theme: custom (HIGH ORBIT house system) · idea: "a trading-desk board game: the coin market laid out as a tilted 3D board" · vibe: "orbital trading floor, plasma and ion light, candle green and red" · shape: app screen · paper: dark space navy · accent: plasma orange (lead) + ion cyan (support) · faces: Tektur (display), Noto Sans KR (Korean body) · posture: dark/geometric-heavy/chromatic-orange · signature: the tilted 3D board with minted coin marks, a live candle chart in its centre, real 3D dice and standing pawns */
/* Hallmark · pre-emit critique: P4 H4 E4 S4 R4 V4 · weakest: E, 32 cells at 375px are tight; cells sized from the board's own width (container units), detail goes in the cell sheet */
/* Hallmark · waive 2b · single-hue ramp from --ink to --plasma tokens · the HODL OR DIE title is the game's wordmark, like the HIGH ORBIT logo */
/* Hallmark · waive 38iii · OR is the wordmark's fixed connective, shown in the bar and the start hero only · it is the game name, not an accented word */
/* Hallmark · dismissed 3 · the coloured edge on the dock coin and the final standings is the tier / pawn colour key the board uses */
/* Hallmark · dismissed 29 · modal backdrops blur the board behind them, the same as the site's other dialogs */
/* Hallmark · dismissed F5 · the HISTORY card's emblem is the card face, not a decorated list icon */
/* Hallmark · dismissed 41 · ink and card-face are both near white by design (text vs. die face) */
/* Hallmark · dismissed 67 hbar__title · HODL OR DIE in the bar is the wordmark */
/* HODL OR DIE: the crypto board game page (/crypto). Shares HIGH ORBIT's tokens, base and components;
   adds the tilted 3D board, dice, pawns and the trading-desk side panel. */
@import url("tokens.css");
@import url("base.css");
@import url("components.css");

:root {
  --gain: oklch(80% 0.18 150);
  --gain-deep: oklch(52% 0.14 152);
  --gain-glow: oklch(80% 0.18 150 / 0.35);
  --hurt: var(--danger);
  --hurt-glow: var(--danger-glow);
  --ice: oklch(88% 0.08 215);
  --ice-glow: oklch(88% 0.08 215 / 0.45);

  /* pawn / seat colours */
  --p0: var(--plasma);
  --p1: var(--ion);
  --p2: oklch(86% 0.19 128);
  --p3: oklch(72% 0.22 345);
  --p4: oklch(74% 0.17 295);

  /* coin mark discs (CoinMark picks one per symbol) */
  --c0: oklch(62% 0.2 28);
  --c1: oklch(74% 0.17 58);
  --c2: oklch(84% 0.16 92);
  --c3: oklch(80% 0.17 128);
  --c4: oklch(76% 0.15 160);
  --c5: oklch(78% 0.12 190);
  --c6: oklch(78% 0.13 205);
  --c7: oklch(74% 0.13 230);
  --c8: oklch(66% 0.15 265);
  --c9: oklch(68% 0.16 300);
  --c10: oklch(72% 0.03 250);
  --c11: oklch(70% 0.18 340);

  /* coin tiers, cheapest (1) to BTC + ETH (8): eight hues far apart, lightness varied too, so
     neighbours stay apart on a phone and for colour-weak eyes */
  --t0: oklch(50% 0.12 40);   /* brown */
  --t1: oklch(80% 0.12 225);  /* sky blue */
  --t2: oklch(68% 0.22 350);  /* magenta */
  --t3: oklch(78% 0.17 68);   /* orange */
  --t4: oklch(60% 0.23 25);   /* red */
  --t5: oklch(90% 0.17 102);  /* yellow */
  --t6: oklch(70% 0.19 150);  /* green */
  --t7: oklch(60% 0.2 285);  /* royal blue */

  --slab: oklch(16% 0.035 262);
  --slab-hi: oklch(22% 0.045 258);
  --slab-edge: oklch(9% 0.02 266);
  --tile: oklch(20% 0.04 260);
  --tile-hi: oklch(26% 0.05 256);
  --tile-line: oklch(85% 0.13 205 / 0.16);
  --die: oklch(97% 0.01 90);
  --die-2: oklch(86% 0.02 80);
  --pip: oklch(18% 0.03 262);
  --pip-one: oklch(56% 0.21 25);

  --sky-glow-a: oklch(74% 0.19 52 / 0.16);
  --sky-glow-b: oklch(85% 0.13 205 / 0.12);
  --slab-foot: oklch(6% 0.02 266);
  --centre-hatch: oklch(85% 0.13 205 / 0.03);
  --centre-stroke: oklch(85% 0.13 205 / 0.28);
  --die-edge: oklch(70% 0.02 80);
  --die-shade: oklch(60% 0.02 80 / 0.45);
  --pip-hi: oklch(40% 0.03 262);
  --pip-hole: oklch(0% 0 0 / 0.6);
  --pip-one-hi: oklch(70% 0.2 25);
  --pawn-shadow: oklch(0% 0 0 / 0.55);
  --pawn-gloss: oklch(98% 0.01 250);
  --veil: oklch(6% 0.02 266 / 0.55);
  --veil-strong: oklch(6% 0.02 266 / 0.6);
  --usdt: oklch(76% 0.14 168);
  --usdt-edge: oklch(76% 0.14 168 / 0.45);
  --usdt-glow: oklch(76% 0.14 168 / 0.5);
  --tilt: 34deg;
  --bar-h: 56px;
}

[data-color="0"], .tile[data-owner="0"] { --pc: var(--p0); }
[data-color="1"], .tile[data-owner="1"] { --pc: var(--p1); }
[data-color="2"], .tile[data-owner="2"] { --pc: var(--p2); }
[data-color="3"], .tile[data-owner="3"] { --pc: var(--p3); }
[data-color="4"], .tile[data-owner="4"] { --pc: var(--p4); }
[data-group="0"] { --tier: var(--t0); }
[data-group="1"] { --tier: var(--t1); }
[data-group="2"] { --tier: var(--t2); }
[data-group="3"] { --tier: var(--t3); }
[data-group="4"] { --tier: var(--t4); }
[data-group="5"] { --tier: var(--t5); }
[data-group="6"] { --tier: var(--t6); }
[data-group="7"] { --tier: var(--t7); }

/* ---------------------------------------------------------------- page */

body.hodl { min-height: 100dvh; background: var(--space-0); overflow-x: clip; }

.hodl-sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60% 45% at 78% 12%, var(--sky-glow-a), transparent 70%),
    radial-gradient(55% 50% at 12% 88%, var(--sky-glow-b), transparent 70%),
    linear-gradient(180deg, var(--space-1), var(--space-0) 60%);
}

.hodl-sky::after {
  content: "";
  position: absolute;
  inset: 40% -20% -10%;
  background:
    repeating-linear-gradient(90deg, var(--tile-line) 0 1px, transparent 1px 64px),
    repeating-linear-gradient(0deg, var(--tile-line) 0 1px, transparent 1px 64px);
  transform: perspective(600px) rotateX(62deg);
  transform-origin: 50% 0;
  mask-image: linear-gradient(180deg, transparent, black 30%, transparent 95%);
  opacity: 0.6;
}

body[data-phase="waiting"] .book,
body[data-phase="waiting"] .log,
body[data-phase="waiting"] .dock__actions,
body:not([data-phase="waiting"]) .lobby,
body[data-view="setup"] .play,
body[data-view="play"] .setup { display: none; }

/* ---------------------------------------------------------------- top bar + ticker */

.hbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: var(--gap-3);
  min-height: var(--bar-h);
  padding: var(--gap-2) max(var(--gap-4), env(safe-area-inset-right)) var(--gap-2) max(var(--gap-4), env(safe-area-inset-left));
  background: linear-gradient(180deg, var(--glass-strong), var(--glass));
  border-bottom: 1px solid var(--glass-edge);
  backdrop-filter: blur(14px);
}

.hbar__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--step-1);
    white-space: nowrap;
}


.hbar__tools { display: flex; align-items: center; gap: var(--gap-2); margin-left: auto; }

.hbar__btn {
  min-width: 44px;
  min-height: 44px;
  padding: 0 var(--gap-3);
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius-m);
  background: var(--glass-strong);
  color: var(--ink-dim);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--step--1);
  transition: color var(--dur-short) var(--ease-out), border-color var(--dur-short) var(--ease-out);
}

.hbar__btn:hover { color: var(--ink); border-color: var(--ion); }
.hbar__btn[aria-pressed="true"] { color: var(--ion); border-color: var(--ion-deep); }
body[data-view="setup"] .hbar__btn { display: none; }

.ticker {
  position: sticky;
  top: var(--bar-h);
  z-index: 19;
  overflow: hidden;
  height: 30px;
  border-bottom: 1px solid var(--glass-edge);
  background: var(--shade-deep);
  mask-image: linear-gradient(90deg, transparent, black 6%, black 94%, transparent);
}

.ticker__track {
  display: flex;
  gap: var(--gap-5);
  width: max-content;
  height: 100%;
  align-items: center;
  animation: tape 70s linear infinite;
}

.tick { display: inline-flex; gap: var(--gap-2); font-size: var(--step--1); color: var(--ink-dim); white-space: nowrap; }
.tick b { font-family: var(--font-display); color: var(--ink); font-weight: 700; }
.tick [data-tone="gain"], .sheet__meta [data-tone="gain"] { color: var(--gain); }
.tick [data-tone="hurt"], .sheet__meta [data-tone="hurt"] { color: var(--hurt); }

.ticker:hover .ticker__track { animation-play-state: paused; }

@keyframes tape { to { transform: translateX(-50%); } }

/* ---------------------------------------------------------------- setup */

.setup {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: var(--gap-6);
  align-items: start;
  width: min(var(--container), 100%);
  margin: 0 auto;
  padding: clamp(var(--gap-5), 6vw, 88px) var(--gap-4) var(--gap-6);
}


.setup__title {
  position: relative;
  z-index: 1;
  display: grid;
  margin: calc(var(--gap-6) * -1) 0 var(--gap-4);
  font-family: var(--font-display);
  font-weight: 900;
  font-stretch: 85%;
  font-size: clamp(3rem, 8.5vw, 6.8rem);
  line-height: 0.88;
  color: var(--ink);
  text-shadow: 0 0.06em 0.3em var(--bg);
  overflow-wrap: break-word;
  min-width: 0;
}
.setup__title-line:last-child { padding-left: 0.5em; }

/* Three 3D cast renders, the lead in front: key art in the game's own characters. */
.setup__cast {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr) minmax(0, 1fr);
  align-items: end;
  max-width: 680px;
  margin-top: calc(var(--gap-4) * -1);
}
.setup__char {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  mask-image: radial-gradient(ellipse 48% 50% at 50% 46%, black 45%, transparent 98%);
}
.setup__char--side { margin-inline: -18%; opacity: 0.7; filter: saturate(0.8) brightness(0.85); transform: translateY(6%); }
.setup__char--lead { position: relative; z-index: 1; }

.setup__or {
  display: inline-block;
  margin: 0 0.12em;
  font-size: 0.32em;
  font-weight: 600;
    vertical-align: 0.9em;
  background: none;
  -webkit-text-fill-color: var(--ion);
  color: var(--ion);
}

.setup__sub { margin: calc(var(--gap-2) * -1) 0 var(--gap-4); font-size: var(--step-1); font-weight: 700; color: var(--ion); }

.setup__lead { max-width: 34em; color: var(--ink-dim); font-size: var(--step-1); line-height: 1.65; text-wrap: pretty; word-break: keep-all; }

.setup__rules { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--gap-2) var(--gap-4); margin: var(--gap-5) 0 0; padding: 0; list-style: none; color: var(--ink-dim); font-size: var(--step--1); word-break: keep-all; }
.setup__rules li { display: contents; }
.setup__rules b { font-family: var(--font-display); color: var(--ink); font-weight: 700; }

.setup__feed { margin-top: var(--gap-5); color: var(--ink-mute); font-size: var(--step--1); }
.setup__feed[data-live="true"] { color: var(--gain); }

.setup__panel {
  display: grid;
  gap: var(--gap-3);
  padding: var(--gap-5);
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius-l);
  background: linear-gradient(180deg, var(--glass-sheen), transparent 30%), var(--glass-strong);
  box-shadow: inset 0 1px 0 var(--glass-shine), 0 30px 80px var(--shade);
}

.setup__label { font-family: var(--font-display); font-size: var(--step--1); color: var(--ink-mute); margin-top: var(--gap-2); }

.seg { display: inline-flex; padding: 4px; border-radius: var(--radius-m); background: var(--space-0); border: 1px solid var(--glass-edge); }

.seg__opt {
  min-height: 40px;
  padding: 0 var(--gap-3);
  border: 0;
  border-radius: calc(var(--radius-m) - 4px);
  background: transparent;
  color: var(--ink-mute);
  font-size: var(--step--1);
  font-weight: 600;
  white-space: nowrap;
  transition: background var(--dur-short) var(--ease-out), color var(--dur-short) var(--ease-out);
}

.seg__opt:hover { color: var(--ink); }
.seg__opt.is-on { background: var(--space-3); color: var(--ink); box-shadow: inset 0 1px 0 var(--glass-shine); }

.setup__hint { min-height: 1.4em; color: var(--hurt); font-size: var(--step--1); }
.setup__go { display: flex; gap: var(--gap-3); justify-content: flex-end; flex-wrap: wrap; }
.setup__go .btn--xl { min-width: 12rem; }
.setup__notice { color: var(--ink-mute); font-size: var(--step--1); line-height: 1.6; word-break: keep-all; }

/* ---------------------------------------------------------------- play layout */

.play {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(300px, 22vw, 380px);
  gap: var(--gap-4);
  width: min(2200px, 100%);
  margin: 0 auto;
  padding: var(--gap-4);
  align-items: start;
}

.stage {
  container-type: inline-size;
  display: grid;
  justify-items: center;
  perspective: 1500px;
  perspective-origin: 50% 10%;
  padding-bottom: var(--gap-4);
}

body.is-flat { --tilt: 0deg; }

/* ---------------------------------------------------------------- the board */

.board {
  --cw: min(100cqi, calc(100dvh - 150px));
  container-type: size;
  position: relative;
  display: grid;
  grid-template-columns: 1.32fr repeat(9, 1fr) 1.32fr;
  grid-template-rows: 1.32fr repeat(9, 1fr) 1.32fr;
  gap: 4px;
  width: var(--cw);
  aspect-ratio: 1;
  padding: 1.1%;
  border-radius: 2.2%;
  background:
    radial-gradient(70% 70% at 50% 45%, var(--slab-hi), var(--slab) 70%),
    var(--slab);
  box-shadow:
    inset 0 0 0 1px var(--glass-edge),
    inset 0 2px 0 var(--glass-shine),
    0 1.4cqi 0 var(--slab-edge),
    0 2.4cqi 0 var(--slab-foot),
    0 6cqi 10cqi var(--shade-deep);
  transform: translate(var(--cam-x, 0px), var(--cam-y, 0px)) scale(var(--cam-z, 1)) rotateX(var(--tilt));
  transform-origin: 50% 50%;
  transform-style: preserve-3d;
  transition: transform 520ms var(--ease-out);
}

.tile {
  position: relative;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 0.3cqmin;
  min-width: 0;
  min-height: 0;
  padding: 0.6cqmin 0.3cqmin;
  border: 0;
  border-radius: 0.9cqmin;
  background: linear-gradient(180deg, var(--tile-hi), var(--tile));
  box-shadow: inset 0 0 0 1px var(--tile-line), 0 0.5cqmin 0 var(--slab-edge);
  color: var(--ink);
  text-align: center;
  overflow: hidden;
  transition: box-shadow var(--dur-short) var(--ease-out), transform var(--dur-short) var(--ease-out);
}

.tile:hover { box-shadow: inset 0 0 0 1px var(--ion), 0 0.5cqmin 0 var(--slab-edge); }

.tile__band {
  position: absolute;
  inset: 0 0 auto;
  height: 26%;
  background: linear-gradient(180deg, var(--tier), color-mix(in oklch, var(--tier) 60%, black));
  box-shadow: 0 0 1.4cqmin color-mix(in oklch, var(--tier) 60%, transparent);
}

[data-side="left"] .tile__band { inset: 0 0 0 auto; width: 20%; height: auto; }
[data-side="right"] .tile__band { inset: 0 auto 0 0; width: 20%; height: auto; }
/* the colour group also tints the whole coin cell, so the group reads even where the band is small */
.tile[data-kind="coin"] { background: linear-gradient(180deg, color-mix(in oklch, var(--tier) 22%, var(--tile-hi)), color-mix(in oklch, var(--tier) 10%, var(--tile))); }
[data-side="bottom"] .tile__band { inset: auto 0 0; }

.tile__sym {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: max(9px, 2.1cqmin);
  line-height: 1;
  letter-spacing: 0.01em;
}

.tile.is-long .tile__sym { font-stretch: 75%; font-size: max(8px, 1.8cqmin); }

.tile__price { font-size: max(8px, 1.45cqmin); line-height: 1; color: var(--ink-dim); }

.tile__lv { display: flex; gap: 0.35cqmin; height: 0.8cqmin; }
.tile__lv i { width: 1.3cqmin; height: 100%; border-radius: 1px; background: var(--space-3); opacity: 0; }

/* owned: a thick frame and a badge (initial) in the owner's pawn colour; the group tint stays */
.tile[data-owner]:not([data-owner=""]) {
  box-shadow: inset 0 0 0 max(3px, 0.55cqmin) var(--pc), 0 0.5cqmin 0 var(--slab-edge), 0 0 2.4cqmin color-mix(in oklch, var(--pc) 55%, transparent);
}
.tile__owner { display: none; }
.tile[data-owner]:not([data-owner=""]) .tile__owner {
  position: absolute;
  top: 3px;
  left: 3px;
  display: grid;
  place-items: center;
  width: max(13px, 2.3cqmin);
  height: max(13px, 2.3cqmin);
  border-radius: 50%;
  background: var(--pc);
  color: var(--space-0);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: max(8px, 1.4cqmin);
  line-height: 1;
  box-shadow: 0 0 0 1.5px var(--space-0);
  z-index: 1;
}
[data-side="right"] .tile__owner { left: auto !important; right: 3px; }

.tile[data-owner]:not([data-owner=""]) .tile__price { color: var(--pc); font-weight: 700; }
.tile[data-owner]:not([data-owner=""]) .tile__lv i { opacity: 1; }
.tile[data-level="1"] .tile__lv i:nth-child(1),
.tile[data-level="2"] .tile__lv i:nth-child(-n + 2),
.tile[data-level="3"] .tile__lv i { background: var(--pc); box-shadow: 0 0 1cqmin var(--pc); }

.tile[data-level="3"]::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(115deg, transparent 30%, var(--gloss-soft) 48%, transparent 62%);
  animation: sheen 3.6s var(--ease-in-out) infinite;
  pointer-events: none;
}

@keyframes sheen { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* special cells */
.tile:not([data-kind="coin"]) { background: linear-gradient(180deg, var(--space-2), var(--space-1)); }
.tile__icon { width: max(12px, 2.8cqmin); height: max(12px, 2.8cqmin); fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tile__title { font-family: var(--font-display); font-weight: 800; font-size: max(7px, 1.25cqmin); line-height: 1; }
.tile__ko { font-size: max(7px, 1.4cqmin); color: var(--ink-mute); line-height: 1.1; word-break: keep-all; }
.tile[data-kind="start"], .tile[data-kind="jail"], .tile[data-kind="treasury"], .tile[data-kind="bridge"] { gap: 0.6cqmin; }
.tile[data-kind="start"] .tile__title { font-size: max(8px, 1.9cqmin); }
.tile[data-kind="jail"] .tile__title, .tile[data-kind="treasury"] .tile__title, .tile[data-kind="bridge"] .tile__title { font-size: max(8px, 1.8cqmin); }
.tile[data-kind="start"] { color: var(--gain); box-shadow: inset 0 0 0 1px var(--gain-deep), 0 0.5cqmin 0 var(--slab-edge), 0 0 3cqmin var(--gain-glow); }
.tile[data-kind="jail"] { color: var(--ice); box-shadow: inset 0 0 0 1px var(--ice-glow), 0 0.5cqmin 0 var(--slab-edge); }
.tile[data-kind="treasury"] { color: var(--win); }
.tile[data-kind="bridge"] { color: var(--ion); }
.tile[data-kind="chance"] { color: var(--plasma-hi); }
.tile[data-kind="chance"] .tile__icon { filter: drop-shadow(0 0 1cqmin var(--plasma-glow)); }
.tile[data-kind="tax"] { color: var(--hurt); }

/* hit flashes */
.tile.is-hit { animation: hit 700ms var(--ease-out); }
.tile.is-gain { animation: gainflash 800ms var(--ease-out); }
.tile.is-hurt { animation: hurtflash 800ms var(--ease-out); }
@keyframes hit { 30% { transform: translateY(-0.6cqmin); box-shadow: inset 0 0 0 2px var(--ink), 0 1.1cqmin 0 var(--slab-edge); } }
@keyframes gainflash { 30% { transform: translateY(-0.6cqmin); box-shadow: inset 0 0 0 2px var(--gain), 0 0 4cqmin var(--gain-glow); } }
@keyframes hurtflash { 30% { transform: translateY(-0.6cqmin); box-shadow: inset 0 0 0 2px var(--hurt), 0 0 4cqmin var(--hurt-glow); } }

/* bridge destination picking */
.board.is-picking .tile { opacity: 0.45; }
.board.is-picking .tile.is-target { opacity: 1; cursor: crosshair; animation: target 1.4s var(--ease-in-out) infinite; }
.board.is-picking .tile.is-target:hover { box-shadow: inset 0 0 0 2px var(--ion), 0 0 3cqmin var(--ion-glow); }
@keyframes target { 50% { box-shadow: inset 0 0 0 1px var(--ion), 0 0 2cqmin var(--ion-glow); } }

/* ---------------------------------------------------------------- centre */

.centre {
  grid-area: 2 / 2 / 11 / 11;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  justify-items: center;
  align-items: center;
  gap: 1cqmin;
  padding: 3cqmin;
  border-radius: 2cqmin;
  background:
    radial-gradient(50% 45% at 50% 50%, color-mix(in oklch, var(--pc, var(--ion)) 14%, transparent), transparent 70%),
    repeating-linear-gradient(45deg, var(--centre-hatch) 0 2px, transparent 2px 14px);
  box-shadow: inset 0 0 0 1px var(--tile-line);
  transform-style: preserve-3d;
  pointer-events: none;
}

.centre__who {
  min-height: 1.2em;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: max(12px, 3.2cqmin);
  color: var(--pc, var(--ink));
  text-shadow: 0 0 2cqmin var(--pc, transparent);
}

.centre__stats { display: flex; gap: 5cqmin; margin: 0; }
.centre__stats div { display: grid; justify-items: center; }
.centre__stats dt { font-family: var(--font-display); font-size: max(8px, 1.5cqmin); color: var(--ink-mute); }
.centre__stats dd { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: max(11px, 2.6cqmin); color: var(--win); }

/* ---------------------------------------------------------------- dice */

.dice { display: flex; gap: 4cqmin; transform-style: preserve-3d; }

.die {
  --s: 8cqmin;
  width: var(--s);
  height: var(--s);
  transform-style: preserve-3d;
  transform: translateZ(calc(var(--s) / 2));
}

.die__cube { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform var(--roll, 900ms) cubic-bezier(0.18, 0.75, 0.22, 1); }

.die__face {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template: repeat(3, 1fr) / repeat(3, 1fr);
  place-items: center;
  padding: 14%;
  border-radius: 9%;
  background: radial-gradient(circle at 30% 25%, var(--die), var(--die-2) 90%);
  box-shadow: inset 0 0 0 1px var(--die-edge), inset 0 0 1.2cqmin var(--die-shade);
  backface-visibility: hidden;
}

.die__face i { width: 64%; aspect-ratio: 1; border-radius: 50%; }
.die__face i[data-on] { background: radial-gradient(circle at 40% 35%, var(--pip-hi), var(--pip)); box-shadow: inset 0 1px 1px var(--pip-hole); }
.die__face[data-face="1"] i[data-on] { width: 92%; background: radial-gradient(circle at 40% 35%, var(--pip-one-hi), var(--pip-one)); }
.die__face[data-face="1"] { transform: translateZ(calc(var(--s) / 2)); }
.die__face[data-face="6"] { transform: rotateY(180deg) translateZ(calc(var(--s) / 2)); }
.die__face[data-face="2"] { transform: rotateY(90deg) translateZ(calc(var(--s) / 2)); }
.die__face[data-face="5"] { transform: rotateY(-90deg) translateZ(calc(var(--s) / 2)); }
.die__face[data-face="3"] { transform: rotateX(90deg) translateZ(calc(var(--s) / 2)); }
.die__face[data-face="4"] { transform: rotateX(-90deg) translateZ(calc(var(--s) / 2)); }
.dice.is-double .die__face { box-shadow: inset 0 0 0 2px var(--win), 0 0 2cqmin var(--win-glow); }

/* ---------------------------------------------------------------- pawns */

.pawns { grid-area: 1 / 1 / -1 / -1; position: relative; container-type: size; pointer-events: none; transform-style: preserve-3d; }

.pawn {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  translate: calc(var(--x, 50) * 1cqw) calc(var(--y, 50) * 1cqh);
  transform-style: preserve-3d;
  transition: translate var(--step, 160ms) var(--ease-out);
}

.pawn__shadow {
  position: absolute;
  left: -1.9cqmin;
  top: -0.9cqmin;
  width: 3.8cqmin;
  height: 1.8cqmin;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--pawn-shadow), transparent);
}

.pawn__stand {
  position: absolute;
  left: -1.6cqmin;
  bottom: 0;
  width: 3.2cqmin;
  height: 5.2cqmin;
  transform-origin: 50% 100%;
  transform: rotateX(calc(var(--tilt) * -1));
  transform-style: preserve-3d;
}



.pawn.is-active .pawn__shadow { background: radial-gradient(closest-side, var(--pc), transparent); opacity: 0.9; animation: ring 1.2s var(--ease-in-out) infinite; }
@keyframes ring { 50% { transform: scale(1.35); opacity: 0.5; } }
.pawn.is-hop .pawn__stand { animation: hop var(--step, 160ms) var(--ease-out); }
@keyframes hop { 45% { translate: 0 -2.6cqmin; } }
.pawn.is-fly { transition-timing-function: var(--ease-in-out); }
.pawn.is-fly .pawn__stand { animation: fly var(--step) var(--ease-in-out); }
@keyframes fly { 50% { translate: 0 -9cqmin; scale: 1.2; } }

.pop {
  position: absolute;
  left: 0;
  bottom: 5cqmin;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: max(11px, 2.4cqmin);
  white-space: nowrap;
  transform: rotateX(calc(var(--tilt) * -1));
  text-shadow: 0 1px 0 black, 0 0 1.5cqmin currentColor;
  translate: -50% 0;
  animation: pop 1.4s var(--ease-out) forwards;
}
.pop[data-tone="buy"] { color: var(--plasma-hi); }
@keyframes pop { from { opacity: 0; translate: -50% 1cqmin; } 15% { opacity: 1; } 75% { opacity: 1; } to { opacity: 0; translate: -50% -5cqmin; } }

/* ---------------------------------------------------------------- side panel */

.side { display: grid; gap: var(--gap-4); align-content: start; position: sticky; top: calc(var(--bar-h) + 46px); }

.dock {
  display: grid;
  gap: var(--gap-3);
  padding: var(--gap-4);
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius-l);
  background: linear-gradient(180deg, var(--glass-sheen), transparent 40%), var(--glass-strong);
  box-shadow: inset 0 1px 0 var(--glass-shine), 0 20px 50px var(--shade);
}

.dock__status { min-height: 1.5em; font-weight: 600; color: var(--ink); word-break: keep-all; }
.dock__status[data-tone="hurt"] { color: var(--hurt); }
.dock__status[data-tone="gain"] { color: var(--gain); }
.dock__status[data-tone="ice"] { color: var(--ice); }
.dock__status[data-tone="ion"] { color: var(--ion); }
.dock__actions { display: grid; gap: var(--gap-3); }
.dock__actions:empty { display: none; }
.dock__row { display: flex; gap: var(--gap-2); flex-wrap: wrap; }
.dock__row .btn { flex: 1 1 8rem; }
.btn--roll { min-height: 60px; font-size: var(--step-2); letter-spacing: 0.08em; }
.dock__note { color: var(--ink-dim); font-size: var(--step--1); line-height: 1.55; word-break: keep-all; }

.dock__coin { display: flex; align-items: baseline; gap: var(--gap-3); padding-left: var(--gap-3); border-left: 4px solid var(--tier); }
.dock__sym { font-family: var(--font-display); font-weight: 900; font-size: var(--step-3); line-height: 1; }
.dock__name { color: var(--ink-dim); font-size: var(--step--1); }

.levels { display: grid; grid-template-columns: repeat(auto-fit, minmax(5.2rem, 1fr)); gap: var(--gap-2); }

.level {
  display: grid;
  gap: 2px;
  min-height: 54px;
  padding: var(--gap-2);
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius-m);
  background: var(--space-1);
  text-align: left;
  transition: border-color var(--dur-short) var(--ease-out), background var(--dur-short) var(--ease-out);
}

.level__name { font-size: var(--step--1); font-weight: 700; }
.level__cost { font-family: var(--font-display); color: var(--ink-dim); }
.level:hover:not(:disabled) { border-color: var(--ion); }
.level.is-on { border-color: var(--plasma); background: color-mix(in oklch, var(--plasma) 14%, var(--space-1)); box-shadow: 0 0 18px var(--plasma-glow); }
.level.is-on .level__cost { color: var(--plasma-hi); }
.level:disabled { background: var(--space-0); border-color: transparent; color: var(--ink-mute); cursor: not-allowed; }
.level:disabled .level__cost { color: var(--ink-mute); text-decoration: line-through; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--space-2);
  font-size: 0.72rem;
  color: var(--ink-dim);
}

.badge[data-tone="ice"] { color: var(--ice); }
.badge[data-tone="ion"] { color: var(--ion); }
.badge__icon { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.log {
  display: grid;
  gap: 2px;
  max-height: 260px;
  margin: 0;
  padding: var(--gap-3);
  overflow: auto;
  list-style: none;
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius-m);
  background: var(--shade-deep);
  font-size: var(--step--1);
  color: var(--ink-dim);
  mask-image: linear-gradient(180deg, black 70%, transparent);
}

.log__line { word-break: keep-all; }
.log__line:first-child { color: var(--ink); }
.log__line[data-tone="hurt"] { color: var(--hurt); }
.log__line[data-tone="gain"] { color: var(--gain); }
.log__line[data-tone="ice"] { color: var(--ice); }
.log__line[data-tone="card"] { color: var(--plasma-hi); }

/* ---------------------------------------------------------------- HISTORY card */

.event {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: var(--gap-4);
  background: var(--veil);
  backdrop-filter: blur(4px);
  perspective: 1200px;
}

.event__card {
  --tone: var(--plasma);
  display: grid;
  justify-items: center;
  gap: var(--gap-3);
  width: min(380px, 100%);
  padding: var(--gap-6) var(--gap-5) var(--gap-5);
  border: 1px solid var(--tone);
  border-radius: var(--radius-l);
  background:
    radial-gradient(90% 60% at 50% 0%, color-mix(in oklch, var(--tone) 28%, transparent), transparent 70%),
    linear-gradient(180deg, var(--space-2), var(--space-0));
  box-shadow: 0 0 0 1px var(--shade), 0 0 60px color-mix(in oklch, var(--tone) 40%, transparent), 0 30px 80px var(--shade-deep);
  text-align: center;
}

.event[data-tone="hurt"] .event__card { --tone: var(--hurt); }
.event[data-tone="gain"] .event__card { --tone: var(--gain); }
.event[data-tone="shield"] .event__card { --tone: var(--ion); }
.event.is-in .event__card { animation: cardin 620ms var(--ease-out); }
@keyframes cardin { from { transform: rotateY(-100deg) translateY(30px) scale(0.85); opacity: 0; } 60% { opacity: 1; } }

.event__icon { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 50%; background: color-mix(in oklch, var(--tone) 18%, var(--space-1)); box-shadow: 0 0 30px color-mix(in oklch, var(--tone) 45%, transparent); color: var(--tone); }
.card__glyph { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.event__year { font-family: var(--font-display); font-size: var(--step--1); color: var(--tone); }
.event__title { font-size: var(--step-3); font-weight: 800; line-height: 1.2; word-break: keep-all; text-wrap: balance; }
.event__text { color: var(--ink-dim); line-height: 1.6; word-break: keep-all; text-wrap: pretty; }
.event__who { font-family: var(--font-display); font-size: var(--step--1); color: var(--ink-mute); }
.event__ok { width: 100%; margin-top: var(--gap-2); }

/* ---------------------------------------------------------------- dialogs */

.sheet, .over, .quit {
  width: min(440px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  padding: var(--gap-5);
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius-l);
  background: linear-gradient(180deg, var(--space-2), var(--space-0));
  color: var(--ink);
  box-shadow: 0 30px 90px var(--shade-deep);
}

.sheet::backdrop, .over::backdrop, .quit::backdrop { background: var(--veil-strong); backdrop-filter: blur(3px); }
.sheet[open] { animation: rise var(--dur-medium) var(--ease-out); border-top: 4px solid var(--tier, var(--ion)); }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }

.sheet__close {
  position: absolute;
  top: var(--gap-2);
  right: var(--gap-2);
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-dim);
  font-size: 1.6rem;
  line-height: 1;
}

.sheet__close:hover { color: var(--ink); background: var(--space-2); }
.sheet__head { display: grid; gap: var(--gap-1); margin-bottom: var(--gap-4); padding-right: 40px; }
.sheet__sym { font-family: var(--font-display); font-weight: 900; font-size: var(--step-4); line-height: 1; color: var(--tier, var(--ion)); }
.sheet__name { font-size: var(--step-1); font-weight: 700; }
.sheet__meta { display: flex; flex-wrap: wrap; gap: var(--gap-1) var(--gap-3); color: var(--ink-dim); font-size: var(--step--1); }
.sheet__icon { width: 40px; height: 40px; fill: none; stroke: var(--ion); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.sheet__owner { margin-bottom: var(--gap-3); font-weight: 600; color: var(--pc, var(--ink-dim)); }
.sheet__text { color: var(--ink-dim); line-height: 1.6; }
.sheet__note { margin-top: var(--gap-3); font-size: 0.75rem; color: var(--ink-mute); }

.fees { width: 100%; border-collapse: collapse; font-size: var(--step--1); }
.fees th, .fees td { padding: var(--gap-2) var(--gap-1); border-bottom: 1px solid var(--glass-edge); text-align: right; }
.fees th:first-child { text-align: left; }
.fees thead th { color: var(--ink-mute); font-weight: 600; }
.fees tr[data-on="yes"] { color: var(--plasma-hi); }

.over { text-align: center; }
.over[open] { animation: rise var(--dur-medium) var(--ease-out); }
.over__kicker { color: var(--win); font-size: var(--step--1); font-weight: 700; }
.over__name { margin: var(--gap-2) 0; font-family: var(--font-display); font-weight: 900; font-size: var(--step-4); color: var(--pc, var(--ink)); text-shadow: 0 0 30px var(--pc, transparent); }
.over__reason { color: var(--ink-dim); }
.over__list { display: grid; gap: var(--gap-2); margin: var(--gap-5) 0; padding: 0; list-style: none; text-align: left; }
.over__row { display: grid; grid-template-columns: 2em minmax(0, 1fr) auto; gap: var(--gap-3); align-items: center; padding: var(--gap-2) var(--gap-3); border-radius: var(--radius-m); background: var(--space-1); border-left: 4px solid var(--pc); }
.over__rank { font-family: var(--font-display); color: var(--ink-mute); }
.over__who { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.over__worth { font-family: var(--font-display); }
.over__go { display: flex; gap: var(--gap-3); justify-content: flex-end; flex-wrap: wrap; }
.over__go .btn { flex: 1 1 8rem; }
.quit__title { font-size: var(--step-2); margin-bottom: var(--gap-2); }
.quit__text { color: var(--ink-dim); margin-bottom: var(--gap-5); }

.notice { padding: var(--gap-4); text-align: center; color: var(--ink-dim); }

/* ---------------------------------------------------------------- big screens: the board fills the height */

@media (min-width: 961px) {
  :root { --tilt: 28deg; }
  .stage { perspective: 2500px; }
  /* tilted, the board shows about 95% of its width as height and leaves a band above it: size it to
     the height under the bars and pull it up into that band */
  .board { --cw: min(100cqi, calc((100dvh - var(--bar-h) - 64px) / 0.95)); margin-top: calc(var(--cw) * -0.06); }
  body.is-flat .board { --cw: min(100cqi, calc(100dvh - var(--bar-h) - 64px)); margin-top: 0; }
}

/* ---------------------------------------------------------------- phones and tablets */

@media (max-width: 960px) {
  :root { --tilt: 22deg; --bar-h: 52px; }
  .setup { grid-template-columns: minmax(0, 1fr); gap: var(--gap-5); }
  .play { grid-template-columns: minmax(0, 1fr); gap: var(--gap-3); padding: var(--gap-2) var(--gap-2) var(--gap-4); }
  .board { --cw: min(100cqi, 640px); }
  .side { position: static; }
  .dock { position: sticky; bottom: max(var(--gap-2), env(safe-area-inset-bottom)); z-index: 10; order: -1; }
  .log { max-height: 140px; }
}

@media (max-width: 560px) {
  .hbar { gap: var(--gap-2); padding-inline: var(--gap-2); }
  .hbar__title { font-size: var(--step-0); }
  .hbar .logo--small { display: none; }
  .hbar__btn { padding: 0 var(--gap-2); }
  .setup { padding-inline: var(--gap-4); }
  .setup__panel { padding: var(--gap-4); }
  .pos { grid-template-columns: 4px minmax(0, 1fr) auto 4.2rem; padding-block: 4px; }
  .pos__cash { font-size: var(--step--1); }
  .invite__code { font-size: var(--step-4); }
  .board { padding: 0.8%; }
  .tile { border-radius: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  .ticker__track { animation: none; }
  .board { transition: none; }
}

.coinmark[data-hue="0"] { --coin: var(--c0); }
.coinmark[data-hue="1"] { --coin: var(--c1); }
.coinmark[data-hue="2"] { --coin: var(--c2); }
.coinmark[data-hue="3"] { --coin: var(--c3); }
.coinmark[data-hue="4"] { --coin: var(--c4); }
.coinmark[data-hue="5"] { --coin: var(--c5); }
.coinmark[data-hue="6"] { --coin: var(--c6); }
.coinmark[data-hue="7"] { --coin: var(--c7); }
.coinmark[data-hue="8"] { --coin: var(--c8); }
.coinmark[data-hue="9"] { --coin: var(--c9); }
.coinmark[data-hue="10"] { --coin: var(--c10); }
.coinmark[data-hue="11"] { --coin: var(--c11); }

/* ---------------------------------------------------------------- USDT mark */

.hbar__pair { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border: 1px solid var(--usdt-edge); border-radius: 999px; color: var(--usdt); font-family: var(--font-display); font-weight: 700; font-size: var(--step--1); }
.usdt { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--usdt); color: var(--space-0); font-weight: 900; box-shadow: 0 0 12px var(--usdt-glow); }

/* ---------------------------------------------------------------- start screen */

.setup__hero { position: relative; isolation: isolate; }
.setup__chart { position: absolute; inset: 26% -6% auto; height: 46%; z-index: -1; opacity: 0.3; mask-image: linear-gradient(180deg, black 40%, transparent); }
.setup__panel { align-content: start; }
.field {
  width: 100%;
  min-height: 52px;
  padding: 0 var(--gap-4);
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius-m);
  background: var(--space-0);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--step-1);
  transition: border-color var(--dur-short) var(--ease-out);
}
.field:focus { outline: none; border-color: var(--ion); box-shadow: 0 0 0 3px var(--ion-glow); }
.field--code { text-transform: uppercase; text-align: center; font-size: var(--step-2); }
.setup__create { width: 100%; margin-top: var(--gap-2); }
.setup__or-line { margin-top: var(--gap-3); color: var(--ink-mute); font-size: var(--step--1); }
.setup__join { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--gap-2); }
.setup.is-invited .setup__join { order: -1; }
.open-rooms { display: grid; gap: var(--gap-2); margin-top: var(--gap-2); }
.open-rooms__head { display: flex; align-items: center; justify-content: space-between; gap: var(--gap-2); }
.open-rooms__title { font-size: var(--step-0); font-weight: 700; }
.open-rooms__refresh { min-height: 36px; padding: 0 var(--gap-3); font-size: var(--step--1); }
.open-rooms__list { display: grid; gap: var(--gap-1); max-height: 15rem; margin: 0; padding: 0; overflow-y: auto; list-style: none; }
.open-rooms__empty { padding: var(--gap-2) 0; color: var(--ink-mute); font-size: var(--step--1); word-break: keep-all; }
.open-room { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: var(--gap-3); min-height: 52px; padding: 0 var(--gap-2) 0 var(--gap-3); border-radius: var(--radius-m); background: var(--space-1); }
.open-room__host { overflow: hidden; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.open-room__count { color: var(--ink-dim); font-size: var(--step--1); }
.open-rooms__go { min-height: 40px; padding: 0 var(--gap-3); }
/* an invite on a phone: the nickname and join button come before the game intro */
@media (max-width: 960px) { .setup.is-invited .setup__panel { order: -1; } }

/* ---------------------------------------------------------------- waiting room */

.lobby { display: grid; gap: var(--gap-3); padding: var(--gap-4); border: 1px solid var(--glass-edge); border-radius: var(--radius-l); background: linear-gradient(180deg, var(--glass-sheen), transparent 40%), var(--glass-strong); }
.invite { display: grid; gap: var(--gap-2); justify-items: start; }
.invite__label { color: var(--ink-mute); font-size: var(--step--1); font-weight: 600; }
.invite__code { font-family: var(--font-display); font-weight: 900; font-size: var(--step-5); line-height: 1; color: var(--ion); text-shadow: 0 0 24px var(--ion-glow); }
.invite__link { color: var(--ink-dim); font-size: var(--step--1); overflow-wrap: anywhere; }
.invite__go { display: flex; flex-wrap: wrap; gap: var(--gap-2); }
.invite__status { min-height: 1.2em; color: var(--gain); font-size: var(--step--1); }
.members { display: grid; gap: var(--gap-1); margin: 0; padding: 0; list-style: none; }
.member { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--gap-3); min-height: 40px; padding: 0 var(--gap-3); border-radius: var(--radius-s); background: var(--space-1); }
.member__pawn { width: 14px; height: 14px; border-radius: 50%; background: var(--pc); box-shadow: 0 0 10px var(--pc); }
.member__name { font-family: var(--font-display); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member__tag { color: var(--ink-mute); font-size: var(--step--1); }
.member--ai .member__name { color: var(--ink-dim); }
.lobby__host { display: grid; gap: var(--gap-3); }
.lobby-chat { display: grid; gap: var(--gap-2); }
.lobby-chat__list { display: grid; align-content: start; gap: var(--gap-1); height: 9.5rem; margin: 0; padding: var(--gap-2) var(--gap-3); overflow-y: auto; border-radius: var(--radius-s); background: var(--space-1); font-size: var(--step--1); list-style: none; }
.lobby-chat__list:empty::before { content: '아직 대화가 없어요. 먼저 인사해 봐요.'; color: var(--ink-mute); }
.lobby-chat__line { overflow-wrap: anywhere; line-height: 1.5; }
.lobby-chat__line.is-system { color: var(--ink-mute); }
.lobby-chat__who { color: var(--ion); font-weight: 700; }
.lobby-chat__form { display: flex; gap: var(--gap-2); }
.lobby-chat__input { flex: 1; min-width: 0; min-height: 44px; }
.lobby-chat__send { min-height: 44px; }
.ai-step { display: flex; align-items: center; gap: var(--gap-3); }
.ai-step__label { color: var(--ink-dim); font-weight: 600; margin-right: auto; }
.ai-step__n { min-width: 2ch; text-align: center; font-family: var(--font-display); font-weight: 800; font-size: var(--step-2); }
.lobby__start { width: 100%; }
.lobby__hint { color: var(--ink-dim); font-size: var(--step--1); }

/* ---------------------------------------------------------------- turn timer */

.dock__timer { height: 4px; border-radius: 999px; background: var(--space-2); overflow: hidden; }
.dock__timer::before { content: ""; display: block; height: 100%; background: linear-gradient(90deg, var(--gain), var(--win) 60%, var(--hurt)); transform-origin: 0 50%; }
.dock__timer.is-running::before { animation: drain var(--secs, 30s) linear forwards; }
@keyframes drain { to { transform: scaleX(0); } }
.btn--loan { white-space: normal; line-height: 1.2; }

/* ---------------------------------------------------------------- positions (players as an order book) */

.book { border: 1px solid var(--glass-edge); border-radius: var(--radius-m); background: var(--shade-deep); overflow: hidden; }
.book__head, .pos { display: grid; grid-template-columns: 4px minmax(0, 1fr) auto 4.6rem; gap: var(--gap-3); align-items: center; }
.book__head { padding: 8px var(--gap-3) 8px 0; border-bottom: 1px solid var(--glass-edge); color: var(--ink-mute); font-size: 0.75rem; }
.book__head span:first-child { grid-column: 2; }
.book__head span:last-child { text-align: right; }
.players { margin: 0; padding: 0; list-style: none; }
.pos { position: relative; padding: var(--gap-2) var(--gap-3) var(--gap-2) 0; border-bottom: 1px solid var(--tile-line); transition: background var(--dur-short) var(--ease-out); }
.pos:last-child { border-bottom: 0; }
.pos__chip { align-self: stretch; background: var(--pc); box-shadow: 0 0 10px var(--pc); }
.pos__name { display: flex; align-items: baseline; gap: var(--gap-2); min-width: 0; }
.pos__handle { font-family: var(--font-display); font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pos__kind { color: var(--ink-mute); font-size: 0.72rem; }
.pos.is-me .pos__kind { color: var(--pc); }
.pos__cash { font-family: var(--font-display); font-weight: 700; color: var(--pc); text-align: right; white-space: nowrap; }
.pos__pnl { font-family: var(--font-display); text-align: right; }
.pos__pnl[data-tone="gain"] { color: var(--gain); }
.pos__pnl[data-tone="hurt"] { color: var(--hurt); }
.pos__badges { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 4px; }
.pos__badges:empty { display: none; }
.pos.is-turn { background: color-mix(in oklch, var(--pc) 12%, transparent); }
.pos.is-turn .pos__chip { box-shadow: 0 0 18px var(--pc); }
.pos.is-out { opacity: 0.45; }
.pos.is-out .pos__handle { text-decoration: line-through; }
.badge[data-tone="debt"] { color: var(--win); background: color-mix(in oklch, var(--win) 14%, var(--space-2)); }

/* ---------------------------------------------------------------- coin marks */

.coinmark { --coin: var(--c10); flex: none; }
.coinmark__rim { fill: color-mix(in oklch, var(--coin) 55%, black); stroke: var(--coin); stroke-width: 1.2; }
.coinmark__face { fill: var(--coin); }
.coinmark__shine { fill: none; stroke: var(--gloss); stroke-width: 1.6; stroke-linecap: round; }
.coinmark__text { fill: var(--space-0); font-family: var(--font-display); font-weight: 900; font-size: 15px; }
.coinmark__glyph { fill: var(--space-0); }
.coinmark__glyph--low { opacity: 0.7; }
.tile__mark { width: max(11px, 2.8cqmin); height: max(11px, 2.8cqmin); filter: drop-shadow(0 0 0.8cqmin color-mix(in oklch, var(--coin) 60%, transparent)); }
.coinmark--dock { width: 30px; height: 30px; align-self: center; }
.dock__coin { align-items: center; }

/* ---------------------------------------------------------------- candle chart */

.chart__svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart__wick { stroke-width: 1; }
.chart__up { stroke: var(--gain); fill: var(--gain); }
.chart__down { stroke: var(--hurt); fill: var(--hurt); }
.chart__body { filter: drop-shadow(0 0 3px currentColor); }
.chart__body.chart__up { color: var(--gain); }
.chart__body.chart__down { color: var(--hurt); }
.chart__ma { fill: none; stroke: var(--ion); stroke-width: 1.4; filter: drop-shadow(0 0 4px var(--ion)); }
.chart__last { stroke-width: 0.8; stroke-dasharray: 3 3; fill: none; }
.centre__chart { position: absolute; inset: 14% 6% 30%; opacity: 0.85; }
.centre { position: relative; }
.centre__pair { position: absolute; top: 4%; left: 6%; font-family: var(--font-display); font-weight: 800; font-size: max(10px, 2.2cqmin); color: var(--ink); }
.centre__pair span { color: var(--usdt); }
.centre__who, .centre__stats, .dice { position: relative; }

/* ---------------------------------------------------------------- ad placeholder */

.ad { width: min(360px, calc(100% - 32px)); padding: var(--gap-5); border: 1px dashed var(--glass-edge); border-radius: var(--radius-l); background: var(--space-1); color: var(--ink); text-align: center; }
.ad::backdrop { background: var(--veil-strong); }
.ad__label { color: var(--ink-mute); font-size: var(--step--1); }
.ad__title { margin: var(--gap-2) 0; font-size: var(--step-2); }
.ad__text { color: var(--ink-dim); font-size: var(--step--1); line-height: 1.6; }
.ad__count { margin-top: var(--gap-4); font-family: var(--font-display); font-weight: 900; font-size: var(--step-4); color: var(--ion); }
.over__note { margin-bottom: var(--gap-3); color: var(--ink-dim); font-size: var(--step--1); }

/* ---------------------------------------------------------------- building rules */

.tile.is-set .tile__band { box-shadow: 0 0 2.4cqmin var(--tier), inset 0 0 0 1px var(--gloss-soft); }
.tile.is-set::before { content: ""; position: absolute; inset: 2px; border-radius: inherit; box-shadow: inset 0 0 1.6cqmin color-mix(in oklch, var(--tier) 55%, transparent); pointer-events: none; }
.dock__group, .sheet__set { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap-2); color: var(--ink-dim); font-size: var(--step--1); }
.dock__dot { width: 12px; height: 12px; border-radius: 3px; border: 1px solid var(--tier, var(--ion)); background: transparent; }
.dock__dot[data-on="yes"] { background: var(--tier, var(--ion)); box-shadow: 0 0 8px var(--tier, var(--ion)); }
.sheet__set { margin-bottom: var(--gap-2); }
.sheet__set[data-full="yes"] { color: var(--gain); }
.sheet__next { margin-bottom: var(--gap-3); font-weight: 600; color: var(--ink); }
.sheet__next[data-tone="hurt"] { color: var(--hurt); font-weight: 500; }
.next-level { display: grid; grid-template-columns: auto auto auto 1fr; align-items: baseline; gap: var(--gap-2); padding: var(--gap-3); border: 1px solid var(--plasma); border-radius: var(--radius-m); background: color-mix(in oklch, var(--plasma) 10%, var(--space-1)); }
.next-level__from { color: var(--ink-mute); }
.next-level__arrow { color: var(--plasma); }
.next-level__to { font-weight: 800; }
.next-level__cost { justify-self: end; font-family: var(--font-display); font-weight: 800; color: var(--plasma-hi); }
.centre__stats { flex-wrap: wrap; justify-content: center; row-gap: 1cqmin; }

/* ---------------------------------------------------------------- avatars */

.avatar { display: block; overflow: visible; }
.avatar__body { fill: var(--pc); stroke: color-mix(in oklch, var(--pc) 45%, black); stroke-width: 1; stroke-linejoin: round; }
.avatar__detail { fill: color-mix(in oklch, var(--pc) 40%, black); stroke: color-mix(in oklch, var(--pc) 40%, black); stroke-width: 1.2; stroke-linecap: round; }
.avatar__light { fill: var(--ink); stroke: none; }
.avatar[data-avatar="diamond"] .avatar__detail { fill: none; }
.avatar[data-avatar="whale"] .avatar__detail { fill: none; }
.avatar[data-avatar="whale"] .avatar__light:not(:first-of-type) { fill: none; stroke: var(--ink); stroke-width: 1.2; stroke-linecap: round; }

.pawn__stand { left: -2cqmin; width: 4cqmin; height: 4.5cqmin; }
.pawn__avatar { width: 100%; height: 100%; filter: drop-shadow(0 0 1.2cqmin color-mix(in oklch, var(--pc) 70%, transparent)) drop-shadow(0 0.4cqmin 0 color-mix(in oklch, var(--pc) 35%, black)); }
.pawn.is-frozen .pawn__avatar { filter: saturate(0.3) brightness(1.4) drop-shadow(0 0 1.6cqmin var(--ice)); }
.pawn.is-locked .pawn__avatar { filter: grayscale(0.7); }
.pawn.is-active .pawn__stand { scale: 1.15; transform-origin: 50% 100%; }

.book__head, .pos { grid-template-columns: 34px minmax(0, 1fr) auto 4.6rem; }
.pos { padding-left: var(--gap-2); }
.pos__chip { display: grid; place-items: center; align-self: center; width: 34px; height: 34px; border-radius: var(--radius-s); background: color-mix(in oklch, var(--pc) 16%, var(--space-1)); box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--pc) 60%, transparent); }
.pos__avatar { width: 24px; height: 26px; }
.pos.is-turn .pos__chip { box-shadow: inset 0 0 0 2px var(--pc), 0 0 16px var(--pc); }
.member__avatar { width: 22px; height: 24px; }

/* ---------------------------------------------------------------- camera */

.stage { position: relative; }
.cam-toggle {
  position: absolute;
  top: var(--gap-2);
  right: var(--gap-2);
  z-index: 6;
  min-height: 40px;
  padding: 0 var(--gap-3);
  border: 1px solid var(--glass-edge);
  border-radius: 999px;
  background: var(--glass-strong);
  color: var(--ink-dim);
  font-size: var(--step--1);
  font-weight: 600;
  transition: color var(--dur-short) var(--ease-out), border-color var(--dur-short) var(--ease-out);
}
.cam-toggle:hover { color: var(--ink); border-color: var(--ion); }
.cam-toggle[aria-pressed="true"] { color: var(--ion); border-color: var(--ion-deep); }
body[data-phase="waiting"] .cam-toggle { display: none; }

/* ---------------------------------------------------------------- phones: bigger, calmer */

@media (max-width: 960px) {
  .stage { overflow: clip; padding: var(--gap-2) 0 var(--gap-4); border-radius: var(--radius-l); }
  .die { --s: 11cqmin; }
  .btn--roll { min-height: 64px; font-size: var(--step-3); }
  .dock { padding: var(--gap-3); }
  .dock__status { font-size: var(--step-1); }
  .dock__row .btn { min-height: 54px; font-size: var(--step-1); }
  .pos__handle, .pos__cash { font-size: var(--step-0); }
  .pos__pnl { font-size: var(--step--1); }
  .log { max-height: 96px; font-size: 0.8rem; }
  .ticker { height: 26px; }
  .centre__chart { inset: 16% 4% 34%; }
  .centre__stats dt { font-size: max(9px, 1.9cqmin); }
  .centre__stats dd { font-size: max(12px, 3.2cqmin); }
  .tile__sym { font-size: max(10px, 2.9cqmin); }
  .tile__price { font-size: max(9px, 2.2cqmin); }
}

@media (prefers-reduced-motion: reduce) {
  .board { transition: none; }
}

.tile.is-here { box-shadow: inset 0 0 0 2px var(--here), 0 0.5cqmin 0 var(--slab-edge), 0 0 2.6cqmin var(--here); }
.tile.is-here::after { content: ""; position: absolute; inset: auto 12% 6% 12%; height: 0.5cqmin; border-radius: 999px; background: var(--here); box-shadow: 0 0 1.2cqmin var(--here); }

/* ---------------------------------------------------------------- 40-cell board: cell kinds */

.tile[data-kind="coldwallet"] { color: var(--win); }
.tile[data-kind="raid"] { color: var(--hurt); box-shadow: inset 0 0 0 1px var(--hurt-glow), 0 0.5cqmin 0 var(--slab-edge); }
.tile[data-kind="airdrop"] { color: var(--gain); }
.tile[data-kind="exchange"], .tile[data-kind="utility"] { background: linear-gradient(180deg, var(--tile-hi), var(--tile)); color: var(--ion); }
.tile[data-kind="utility"] { color: var(--usdt); }
.tile[data-kind="exchange"] .tile__title, .tile[data-kind="utility"] .tile__title { color: var(--ink); }
.tile[data-kind="coldwallet"] .tile__title, .tile[data-kind="raid"] .tile__title { font-size: max(8px, 1.6cqmin); }
.tile__stamp { display: none; }
/* mortgaged: the cell's content fades, the owner's frame and badge stay readable */
.tile.is-mortgaged > :not(.tile__owner):not(.tile__stamp) { filter: saturate(0.3); opacity: 0.55; }
.tile.is-mortgaged .tile__stamp {
  display: block;
  position: absolute;
  inset: 40% -6% auto;
  rotate: -18deg;
  padding: 0.2cqmin 0;
  border-block: 1px solid var(--hurt);
  background: color-mix(in oklch, var(--hurt) 22%, transparent);
  color: var(--ink);
  font-size: max(7px, 1.2cqmin);
  font-weight: 800;
  text-align: center;
}
.dock__icon, .deal__icon { width: 26px; height: 26px; fill: none; stroke: var(--ion); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------------------------------------------------------------- deals: trades, mortgages, bids */

.deal {
  width: min(520px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  padding: var(--gap-5);
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius-l);
  background: linear-gradient(180deg, var(--space-2), var(--space-0));
  color: var(--ink);
  box-shadow: 0 30px 90px var(--shade-deep);
  overflow: auto;
}
.deal[open] { animation: rise var(--dur-medium) var(--ease-out); }
.deal[data-tone="ion"] { border-color: var(--ion); box-shadow: 0 0 40px var(--ion-glow), 0 30px 90px var(--shade-deep); }
.deal[data-tone="hurt"] { border-color: var(--hurt); box-shadow: 0 0 40px var(--hurt-glow), 0 30px 90px var(--shade-deep); }
.deal::backdrop { background: var(--veil-strong); backdrop-filter: blur(3px); }
/* Trade answers float over the board without stopping it (the game goes on while you decide). */
.deal--sheet {
  position: fixed;
  inset: auto 0 calc(12px + env(safe-area-inset-bottom, 0px)) 0;
  z-index: 55;
  margin: 0 auto;
  max-height: min(64dvh, 560px);
}
.deal > div { display: grid; gap: var(--gap-3); }
.deal__title { font-size: var(--step-2); font-weight: 800; }
.deal__line { color: var(--ink-dim); font-size: var(--step--1); line-height: 1.6; word-break: keep-all; }
.deal__label { color: var(--ink-mute); font-size: var(--step--1); font-weight: 600; }
.deal__side { display: grid; gap: var(--gap-2); }
.deal__cells { display: flex; flex-wrap: wrap; gap: var(--gap-2); }
.deal__cell {
  display: inline-flex;
  align-items: center;
  gap: var(--gap-2);
  min-height: 40px;
  padding: 0 var(--gap-3);
  border: 1px solid var(--glass-edge);
  border-radius: 999px;
  background: var(--space-1);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--step--1);
  transition: border-color var(--dur-short) var(--ease-out), background var(--dur-short) var(--ease-out);
}
.deal__cell[aria-pressed="true"] { border-color: var(--plasma); background: color-mix(in oklch, var(--plasma) 16%, var(--space-1)); }
.deal__price { color: var(--ink-mute); font-weight: 500; }
.deal__mark { width: 20px; height: 20px; }
.deal__empty { color: var(--ink-mute); font-size: var(--step--1); }
.deal__money { display: grid; gap: var(--gap-1); color: var(--ink-dim); font-size: var(--step--1); }
.deal__amount { min-height: 46px; font-size: var(--step-1); }
.deal__hint { min-height: 1.2em; color: var(--hurt); font-size: var(--step--1); }
.deal__sides { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--gap-2); }
.deal__box { display: grid; gap: var(--gap-1); padding: var(--gap-3); border-radius: var(--radius-m); background: var(--space-1); border: 1px solid var(--glass-edge); }
.deal__box[data-tone="gain"] { border-color: var(--gain-deep); }
.deal__box[data-tone="hurt"] { border-color: var(--hurt); }
.deal__what { font-family: var(--font-display); font-weight: 800; font-size: var(--step-1); word-break: keep-all; }
.deal__go { display: flex; flex-wrap: wrap; gap: var(--gap-2); justify-content: flex-end; }
.deal__go .btn { flex: 1 1 7rem; }
.deal__compare { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--gap-2); align-items: start; }
.deal__col-head { padding-bottom: var(--gap-1); border-bottom: 1px solid var(--glass-edge); color: var(--ink-dim); font-size: var(--step--1); font-weight: 700; }
.deal__col-head[data-tone="ion"] { color: var(--ion); border-color: var(--ion); }
.deal__row-label { grid-column: 1 / -1; margin-top: var(--gap-1); color: var(--ink-mute); font-size: var(--step--1); font-weight: 600; }
.deal__chips { display: grid; gap: var(--gap-1); margin: 0; padding: 0; list-style: none; }
.deal__chip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--gap-2);
  min-height: 36px;
  padding: 0 var(--gap-2);
  border-radius: var(--radius-m);
  border-left: 4px solid var(--tier, var(--glass-edge));
  background: var(--space-1);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--step--1);
}
.deal__chip-mark { width: 18px; height: 18px; }
.deal__chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deal__chip-price { color: var(--ink-mute); font-weight: 500; }
.deal__chip--cash { grid-template-columns: minmax(0, 1fr); border-left-color: var(--gain-deep); }
.deal__chip--none { grid-template-columns: minmax(0, 1fr); color: var(--ink-mute); font-weight: 500; border-left-color: transparent; }
.deal__chip[data-change="new"] { outline: 1px solid var(--ion); background: color-mix(in oklch, var(--ion) 16%, var(--space-1)); }
.deal__chip[data-change="gone"] { opacity: 0.55; text-decoration: line-through; }
.seg__avatar { width: 18px; height: 20px; }
.seg__opt { display: inline-flex; align-items: center; gap: var(--gap-1); }
.assets { display: grid; gap: var(--gap-2); margin: 0; padding: 0; list-style: none; }
.asset { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--gap-3); padding: var(--gap-2) var(--gap-3); border-radius: var(--radius-m); background: var(--space-1); border-left: 4px solid var(--tier, var(--ion)); }
.asset__name { font-weight: 600; overflow-wrap: anywhere; }
.asset .btn { min-height: 40px; padding: 0 var(--gap-3); font-size: var(--step--1); }
.asset .deal__amount { width: 7.5rem; }

.toasts { position: fixed; top: calc(var(--bar-h) + 36px); left: 50%; z-index: 60; display: grid; gap: var(--gap-2); width: min(460px, calc(100% - 24px)); translate: -50% 0; pointer-events: none; }
.toast { padding: var(--gap-3) var(--gap-4); border: 1px solid var(--glass-edge); border-radius: var(--radius-m); background: var(--glass-strong); box-shadow: 0 12px 30px var(--shade-deep); font-weight: 600; word-break: keep-all; animation: rise var(--dur-medium) var(--ease-out); transition: opacity 400ms var(--ease-out); }
.toast[data-tone="gain"] { border-color: var(--gain-deep); }
.toast[data-tone="hurt"] { border-color: var(--hurt); }
.toast[data-tone="ion"] { border-color: var(--ion); }
.toast.is-out { opacity: 0; }
.event[data-deck="airdrop"] .event__card { --tone: var(--gain); }
.event[data-deck="airdrop"][data-tone="hurt"] .event__card { --tone: var(--hurt); }

@media (max-width: 560px) {
  .deal { padding: var(--gap-4); }
  .deal__sides { grid-template-columns: minmax(0, 1fr); }
}

/* ---------------------------------------------------------------- trading */

.dock__top { display: flex; align-items: center; gap: var(--gap-3); }
.dock__top .dock__status { flex: 1; min-width: 0; }
.trade-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--gap-2);
  min-height: 48px;
  padding: 0 var(--gap-4);
  border: 1px solid var(--hodl-up);
  border-radius: var(--radius-m);
  background: color-mix(in oklch, var(--hodl-up) 16%, var(--space-1));
  color: var(--ink);
  font-weight: 800;
  font-size: var(--step-0);
  box-shadow: 0 0 18px var(--gain-glow), 0 3px 0 var(--gain-deep);
  transition: box-shadow var(--dur-short) var(--ease-out), background var(--dur-short) var(--ease-out);
}
.trade-btn:hover { background: color-mix(in oklch, var(--hodl-up) 26%, var(--space-1)); box-shadow: 0 0 28px var(--gain-glow), 0 3px 0 var(--gain-deep); }
.trade-btn svg { width: 20px; height: 20px; fill: none; stroke: var(--hodl-up); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.trade-btn__badge { position: absolute; top: -8px; right: -8px; display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 8px; border-radius: 999px; background: var(--hurt); color: var(--space-0); font-size: 0.75rem; font-weight: 800; box-shadow: 0 0 12px var(--hurt-glow); }
.dock__trade { padding: var(--gap-2) var(--gap-3); border-radius: var(--radius-s); background: var(--space-1); font-size: var(--step--1); font-weight: 600; }
.dock__trade[data-tone="gain"] { color: var(--gain); }
.dock__trade[data-tone="hurt"] { color: var(--hurt); }
.dock__trade[data-tone="ion"] { color: var(--ion); }

.trade {
  width: min(980px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 1px solid var(--hodl-up);
  border-radius: var(--radius-l);
  background: linear-gradient(180deg, var(--space-2), var(--space-0));
  color: var(--ink);
  box-shadow: 0 0 50px var(--gain-glow), 0 30px 90px var(--shade-deep);
  overflow: hidden;
}
.trade[open] { display: grid; animation: rise var(--dur-medium) var(--ease-out); }
.trade::backdrop { background: var(--veil-strong); backdrop-filter: blur(3px); }
.trade > div { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; max-height: calc(100dvh - 26px); min-height: 0; }
.trade__head { display: flex; align-items: center; gap: var(--gap-3); padding: var(--gap-4) var(--gap-5); border-bottom: 1px solid var(--glass-edge); }
.trade__head > div { flex: 1; min-width: 0; }
.trade__title { font-size: var(--step-2); font-weight: 800; }
.trade__line { color: var(--ink-dim); font-size: var(--step--1); word-break: keep-all; }
.trade__back, .trade__close { min-height: 44px; padding: 0 var(--gap-3); font-size: var(--step--1); }
.trade__players { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--gap-3); padding: var(--gap-5); overflow: auto; }
.trade__who { display: grid; justify-items: center; gap: var(--gap-2); padding: var(--gap-5) var(--gap-3); border: 1px solid var(--glass-edge); border-radius: var(--radius-l); background: var(--space-1); color: var(--ink); transition: border-color var(--dur-short) var(--ease-out), box-shadow var(--dur-short) var(--ease-out); }
.trade__who:hover { border-color: var(--pc); box-shadow: 0 0 24px color-mix(in oklch, var(--pc) 40%, transparent); }
.trade__avatar { width: 64px; height: 72px; filter: drop-shadow(0 0 12px color-mix(in oklch, var(--pc) 60%, transparent)); }
.trade__name { font-family: var(--font-display); font-weight: 800; font-size: var(--step-1); }
.trade__meta { color: var(--ink-dim); font-size: var(--step--1); }
.trade__cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--gap-4); padding: var(--gap-4) var(--gap-5); overflow: auto; min-height: 0; }
.trade__col { display: grid; align-content: start; gap: var(--gap-3); padding: var(--gap-3); border: 1px solid var(--glass-edge); border-radius: var(--radius-l); background: var(--shade-deep); }
.trade__col-title { display: flex; align-items: center; gap: var(--gap-2); font-size: var(--step-1); font-weight: 800; }
.trade__col-avatar { width: 26px; height: 29px; }
.trade__cells { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: var(--gap-2); }
.trade__cell {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 4px;
  min-height: 112px;
  padding: var(--gap-3) var(--gap-2) var(--gap-2);
  overflow: hidden;
  border: 2px solid var(--glass-edge);
  border-radius: var(--radius-m);
  background: var(--space-1);
  color: var(--ink);
  transition: border-color var(--dur-short) var(--ease-out), background var(--dur-short) var(--ease-out), translate var(--dur-short) var(--ease-out);
}
.trade__band { position: absolute; inset: 0 0 auto; height: 6px; background: var(--tier, var(--ion)); }
.trade__mark { width: 30px; height: 30px; }
.trade__icon { width: 28px; height: 28px; fill: none; stroke: var(--ion); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.trade__sym { font-family: var(--font-display); font-weight: 800; font-size: var(--step-0); }
.trade__price { color: var(--ink-dim); font-size: var(--step--1); }
.trade__tag { padding: 1px 8px; border-radius: 999px; background: var(--space-3); font-size: 0.72rem; font-weight: 700; }
.trade__tag[data-tone="hurt"] { background: color-mix(in oklch, var(--hurt) 30%, var(--space-2)); }
.trade__cell[aria-pressed="true"] { border-color: var(--hodl-up); background: color-mix(in oklch, var(--hodl-up) 18%, var(--space-1)); translate: 0 -2px; box-shadow: 0 0 18px var(--gain-glow); }
.trade__cell:disabled { opacity: 0.45; cursor: not-allowed; }
.trade__empty { color: var(--ink-mute); font-size: var(--step--1); }
.trade__money { display: grid; gap: var(--gap-1); }
.trade__money-label { color: var(--ink-dim); font-size: var(--step--1); font-weight: 600; }
.trade__stepper { display: grid; grid-template-columns: 52px minmax(0, 1fr) 52px; gap: var(--gap-2); }
.trade__step { min-height: 52px; padding: 0; font-size: var(--step-2); }
.trade__amount { min-height: 52px; text-align: center; font-size: var(--step-1); }
.trade__bar { display: flex; align-items: center; gap: var(--gap-3); padding: var(--gap-3) var(--gap-5); border-top: 1px solid var(--glass-edge); background: var(--glass-strong); }
.trade__summary { flex: 1; min-width: 0; font-family: var(--font-display); font-weight: 800; font-size: var(--step-1); word-break: keep-all; }
.trade__send { min-width: 9rem; min-height: 56px; font-size: var(--step-1); }

.sheet__actions { display: flex; flex-wrap: wrap; gap: var(--gap-2); margin-top: var(--gap-4); }
.sheet__actions .btn { flex: 1 1 10rem; }

.tile.is-traded { animation: traded 1.6s var(--ease-out); }
@keyframes traded {
  0% { transform: translateY(0) scale(1); }
  25% { transform: translateY(-1cqmin) scale(1.12); box-shadow: inset 0 0 0 3px var(--pc, var(--ink)), 0 0 4cqmin var(--pc, var(--ink)); }
  60% { transform: translateY(-0.4cqmin) scale(1.04); box-shadow: inset 0 0 0 2px var(--pc, var(--ink)), 0 0 3cqmin var(--pc, var(--ink)); }
}

@media (max-width: 760px) {
  .trade { width: 100%; max-width: 100%; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
  .trade > div { max-height: 100dvh; height: 100dvh; }
  .trade__cols { grid-template-columns: minmax(0, 1fr); padding: var(--gap-3); }
  .trade__head { padding: var(--gap-3); }
  .trade__players { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: var(--gap-3); }
  .trade__bar { padding: var(--gap-3); padding-bottom: max(var(--gap-3), env(safe-area-inset-bottom)); }
  .trade__cells { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .trade-btn { padding: 0 var(--gap-3); }
}

@media (prefers-reduced-motion: reduce) {
  .tile.is-traded { animation: none; }
}

.setup__inapp { color: var(--ink-dim); font-size: var(--step--1); }
.setup__inapp a { color: var(--ion); text-underline-offset: 3px; }

.member--me { grid-template-columns: auto minmax(0, 1fr) auto auto; }
.member__edit { min-height: 40px; padding: 0 var(--gap-2); font-size: var(--step-0); }
.member__save { min-height: 40px; padding: 0 var(--gap-3); font-size: var(--step--1); }
.setup.is-invited .setup__create { order: 5; }

/* ---------------------------------------------------------------- character pieces and faces */

.face { display: block; object-fit: cover; border-radius: 50%; background: var(--space-2); }
.pawn__stand { left: -2.3cqmin; width: 4.6cqmin; height: 5.8cqmin; }
.piece { position: absolute; inset: 0; display: block; }
.piece__head {
  position: absolute;
  left: 0;
  top: 0;
  width: 4.6cqmin;
  height: 4.6cqmin;
  overflow: hidden;
  border-radius: 50%;
  border: 0.45cqmin solid var(--pc);
  background: var(--space-1);
  box-shadow: 0 0 1.4cqmin color-mix(in oklch, var(--pc) 70%, transparent), inset 0 0 0 0.15cqmin var(--gloss-soft);
}
.piece__face { width: 100%; height: 100%; }
.piece__neck { position: absolute; left: 1.55cqmin; top: 4.3cqmin; width: 1.5cqmin; height: 0.9cqmin; background: linear-gradient(90deg, color-mix(in oklch, var(--pc) 45%, black), var(--pc), color-mix(in oklch, var(--pc) 45%, black)); clip-path: polygon(20% 0, 80% 0, 100% 100%, 0 100%); }
.piece__base { position: absolute; left: 0.5cqmin; top: 5cqmin; width: 3.6cqmin; height: 0.8cqmin; border-radius: 50%; background: radial-gradient(closest-side, var(--pc), color-mix(in oklch, var(--pc) 40%, black)); box-shadow: 0 0.2cqmin 0 color-mix(in oklch, var(--pc) 30%, black); }
.pawn.is-active .piece__head { border-color: var(--ink); box-shadow: 0 0 2.2cqmin var(--pc), 0 0 0 0.3cqmin var(--pc); }
.pawn.is-frozen .piece__head { filter: saturate(0.3) brightness(1.3); box-shadow: 0 0 2cqmin var(--ice); }
.pawn.is-locked .piece__head { filter: grayscale(0.8); }
.pawn.is-win .pawn__stand { animation: piece-win 1.1s var(--ease-out); }
.pawn.is-win .piece__head { box-shadow: 0 0 2.6cqmin var(--win), 0 0 0 0.3cqmin var(--win); }
.pawn.is-rekt .pawn__stand { animation: piece-rekt 0.9s var(--ease-out); }
.pawn.is-rekt .piece__head { filter: grayscale(1) brightness(0.8); }
@keyframes piece-win { 30% { translate: 0 -3cqmin; scale: 1.15; } 60% { translate: 0 0; } 75% { translate: 0 -1cqmin; } }
@keyframes piece-rekt { 15%, 45%, 75% { translate: -0.6cqmin 0; rotate: -6deg; } 30%, 60%, 90% { translate: 0.6cqmin 0; rotate: 6deg; } }
.pos__chip { overflow: hidden; border-radius: 50%; padding: 0; }
.pos__avatar.face { width: 100%; height: 100%; }
.member__avatar.face { width: 28px; height: 28px; box-shadow: 0 0 0 2px var(--pc); }
.trade__avatar.face { width: 72px; height: 72px; box-shadow: 0 0 0 3px var(--pc), 0 0 18px color-mix(in oklch, var(--pc) 50%, transparent); }
.trade__col-avatar.face { width: 30px; height: 30px; box-shadow: 0 0 0 2px var(--pc); }
.over__row { grid-template-columns: 2em 36px minmax(0, 1fr) auto; }
.over__face { width: 36px; height: 36px; box-shadow: 0 0 0 2px var(--pc); }
.deal__face { justify-self: start; width: 64px; height: 64px; box-shadow: 0 0 0 3px var(--ion); }
.cast { border: 1px solid var(--glass-edge); border-radius: var(--radius-m); background: var(--space-1); }
.cast__toggle { min-height: 44px; display: flex; align-items: center; padding: 0 var(--gap-3); font-weight: 700; cursor: pointer; }
.cast-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: var(--gap-2); padding: var(--gap-2) var(--gap-3) var(--gap-3); }
.cast__pick { display: grid; justify-items: center; gap: 4px; padding: var(--gap-2) 4px; border: 2px solid transparent; border-radius: var(--radius-m); background: var(--space-0); color: var(--ink); }
.cast__pick.is-on { border-color: var(--plasma); box-shadow: 0 0 14px var(--plasma-glow); }
.cast__pick:disabled { opacity: 0.35; cursor: not-allowed; }
.cast__face { width: 52px; height: 52px; }
.cast__name { font-family: var(--font-display); font-weight: 700; font-size: 0.7rem; text-align: center; word-break: keep-all; }
@media (prefers-reduced-motion: reduce) { .pawn.is-win .pawn__stand, .pawn.is-rekt .pawn__stand { animation: none; } }

/* positions list: names keep room next to the balance (the side panel is narrow on desktop) */
.book__head, .pos { grid-template-columns: 34px minmax(5.5rem, 1fr) auto 3.8rem; gap: var(--gap-2); }
.pos__cash { font-size: var(--step-0); }
.pos__pnl { font-size: var(--step--1); }

/* phones: calmer type (it read as bursting): smaller cell labels, dock, balances; the camera zooms less */
@media (max-width: 960px) {
  .tile__sym { font-size: max(9px, 2.2cqmin); }
  .tile.is-long .tile__sym { font-size: max(8px, 1.9cqmin); }
  .tile__price { font-size: max(8px, 1.6cqmin); }
  .tile__title { font-size: max(7px, 1.25cqmin); }
  .tile__mark { width: max(10px, 2.5cqmin); height: max(10px, 2.5cqmin); }
  .centre__stats dd { font-size: max(11px, 2.4cqmin); }
  .centre__stats dt { font-size: max(8px, 1.5cqmin); }
  .centre__who { font-size: max(11px, 2.6cqmin); }
  .dock__status { font-size: var(--step-0); }
  .btn--roll { min-height: 54px; font-size: var(--step-2); }
  .dock__row .btn { min-height: 48px; font-size: var(--step-0); }
  .trade-btn { min-height: 44px; font-size: var(--step--1); }
  .pos__handle { font-size: var(--step--1); }
  .pos__cash { font-size: var(--step--1); }
  .pos__pnl { font-size: 0.75rem; }
  .pos__chip { width: 30px; height: 30px; }
  .log { font-size: 0.75rem; }
  .hbar__title { font-size: var(--step-0); }
}

/* colour groups read at a glance: a strong band plus a tint of the group colour across the cell */
.tile[data-kind="coin"] { background: linear-gradient(180deg, color-mix(in oklch, var(--tier) 22%, var(--tile-hi)), color-mix(in oklch, var(--tier) 10%, var(--tile))); }
.tile__band { height: 26%; }
[data-side="left"] .tile__band, [data-side="right"] .tile__band { width: 22%; height: auto; }
.tile[data-kind="coin"][data-owner]:not([data-owner=""]) { background: linear-gradient(180deg, color-mix(in oklch, var(--tier) 22%, var(--tile-hi)), color-mix(in oklch, var(--tier) 10%, var(--tile))); }
.trade__band { height: 10px; }

/* wide screens: the board takes the free width (the tilt makes it shorter than it is wide) */
@media (min-width: 961px) {
  .play { width: min(1860px, 100%); grid-template-columns: minmax(0, 1fr) minmax(340px, 400px); }
  :root { --tilt: 40deg; }
  /* A wide board on wide screens: the same height as before, and up to half again as wide when there is
     room. Everything inside sizes by the board's shorter side (cqmin), so cells widen, text does not. */
  .board { --bh: calc((100dvh - 126px) * 1.12); --cw: min(calc(100cqi * 0.86), calc(var(--bh) * 1.5)); height: min(var(--bh), var(--cw)); aspect-ratio: auto; }
  body.is-flat .board { --bh: calc(100dvh - var(--bar-h) - 64px); --cw: min(100cqi, calc(var(--bh) * 1.35)); }
}

/* waiting room: AI seats as a clear action; picker close button */
.ai-step { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap-2); }
.ai-step__label { margin-right: auto; font-weight: 700; color: var(--ink); }
.ai-step__add { flex: 1 1 9rem; min-height: 48px; }
.ai-step__less { min-height: 48px; }
.member--ai { grid-template-columns: auto minmax(0, 1fr) auto auto; }
.member__remove { width: 36px; height: 36px; border: 1px solid var(--glass-edge); border-radius: 50%; background: var(--space-0); color: var(--ink-dim); font-weight: 800; }
.member__remove:hover { color: var(--hurt); border-color: var(--hurt); }
.cast { position: relative; }
.cast__close { position: absolute; top: 6px; right: 8px; display: none; width: 36px; height: 36px; border: 1px solid var(--glass-edge); border-radius: 50%; background: var(--space-0); color: var(--ink); font-weight: 800; }
.cast[open] .cast__close { display: block; }

.asset--build { grid-template-columns: auto minmax(0, 1fr) auto auto; }
.asset__why { display: block; color: var(--hurt); font-size: 0.75rem; font-weight: 500; }
@media (max-width: 560px) {
  .asset--build { grid-template-columns: auto minmax(0, 1fr); }
  .asset--build .btn { grid-column: span 1; }
}
.asset--build .asset__name { justify-self: start; text-align: start; }

.trade-cancel { justify-self: start; }
.badge--kick { cursor: pointer; border: 1px solid var(--hurt); background: transparent; color: var(--hurt); font: inherit; }
.badge--kick:focus-visible { outline: 2px solid var(--ion); outline-offset: 2px; }

.member__kick { width: auto; padding: 0 var(--gap-2); font-size: var(--step--1); color: var(--hurt); }
.notify-btn { justify-self: start; }
.kakao-tip a { color: var(--ion); }

/* 오송금 roulette */
.roulette { position: fixed; inset: 50% auto auto 50%; z-index: 60; translate: -50% -50%; display: grid; gap: var(--gap-3); width: min(92vw, 520px); padding: var(--gap-4); border: 1px solid var(--glass-edge); border-radius: var(--radius-l); background: var(--space-1); box-shadow: 0 30px 60px var(--shade-deep); }
.roulette[hidden] { display: none; }
.roulette__title { margin: 0; font-weight: 800; text-align: center; color: var(--ink); }
.roulette__row { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--gap-3); margin: 0; padding: 0; list-style: none; }
.roulette__cell { display: grid; justify-items: center; gap: 4px; padding: var(--gap-2); border: 2px solid transparent; border-radius: 14px; opacity: 0.55; transition: opacity 120ms, border-color 120ms; }
.roulette__cell.is-on { opacity: 1; border-color: var(--ion); }
.roulette__cell.is-picked { opacity: 1; border-color: var(--plasma); box-shadow: 0 0 24px var(--plasma-glow); }
.roulette__face { width: 56px; height: 56px; }
.roulette__name { font-size: var(--step--1); font-weight: 700; }
@media (prefers-reduced-motion: reduce) { .roulette__cell { transition: none; } }
