/* cards — the room is ink, the table is felt. Ember is kept for the mark and the one filled button per view. */
:root {
  color-scheme: dark;
  --ink: #05070b;
  --s1: #090d14;
  --s2: #0e141e;
  --s3: #151d2a;
  --line: rgba(232, 237, 245, .1);
  --line-2: rgba(232, 237, 245, .18);
  --text: #e8edf5;
  --text-2: #a3afc2;
  --text-3: #8290a8;
  --pulse: #f23d26;
  --action: #d12c1e;
  --action-hover: #bd2417;
  --brass: #c9962e;
  --brass-hi: #f3d995;
  --gain: #7dffb0;
  --loss: #ff6a5c;
  --timer: #ffb347;

  /* felt (emerald by default) and the ink printed on it */
  --felt: #0d6a42;
  --felt-hi: #1c8e5b;
  --felt-lo: #053a23;
  --print: #ecd18f;
  --print-red: #e2475a;

  --suit-s: #16181d;
  --suit-c: #16181d;
  --suit-h: #c8102e;
  --suit-d: #c8102e;

  --display: Syne, 'Arial Black', system-ui, sans-serif;
  --sans: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Instrument Serif', Georgia, serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --pop: cubic-bezier(.34, 1.56, .64, 1);
}
:root[data-felt="sapphire"] { --felt: #0f4f86; --felt-hi: #1d6fb0; --felt-lo: #062a4c; }
:root[data-felt="claret"] { --felt: #7a1a2b; --felt-hi: #9c2b3e; --felt-lo: #420a16; --print-red: #f0c36a; }
:root[data-felt="slate"] { --felt: #2b3542; --felt-hi: #3c4859; --felt-lo: #141a22; }
:root.four-color { --suit-d: #1d55d8; --suit-c: #13804a; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--ink);
  color: var(--text);
  font: 400 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.at-table { overflow: hidden; }
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--pulse); outline-offset: 2px; }
kbd { font: 600 10px/1 var(--mono); padding: 3px 4px; border-radius: 4px; border: 1px solid currentColor; opacity: .55; margin-left: 8px; }
@media (pointer: coarse) { kbd { display: none; } }

/* ── buttons ─────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 18px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--s2); color: var(--text); font-weight: 600; letter-spacing: .01em;
  transition: background .2s var(--ease), border-color .2s var(--ease), transform .15s var(--ease);
}
.btn:hover:not(:disabled) { border-color: rgba(232, 237, 245, .35); background: var(--s3); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.primary { background: var(--action); border-color: var(--action); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--action-hover); border-color: var(--action-hover); }
.btn.ghost { background: transparent; }
.btn.outline { background: transparent; border-color: var(--brass); color: var(--brass-hi); }
.btn.outline:hover:not(:disabled) { background: rgba(201, 150, 46, .12); border-color: var(--brass-hi); }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 14px; }
.icon-btn {
  position: relative; display: grid; place-items: center; width: 40px; height: 40px;
  border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--text-2);
}
.icon-btn:hover { color: var(--text); background: var(--s2); border-color: var(--line); }
.icon-btn svg { width: 22px; height: 22px; }
.badge {
  position: absolute; top: 2px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: var(--pulse); color: #fff; font: 700 10px/17px var(--mono); text-align: center;
}

/* ── brand ───────────────────────────────────────────── */
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-glyph { width: 26px; height: 26px; }
.wordmark { font: 800 26px/1 var(--display); letter-spacing: -.03em; text-transform: lowercase; }
.brand.small .brand-glyph { width: 20px; height: 20px; }
.brand.small .wordmark { font-size: 21px; }
.ip-credit {
  display: inline-flex; align-items: center; gap: 6px; font: 400 11px/1 var(--mono);
  color: var(--text-3); text-decoration: none; transition: color .2s;
}
.ip-credit:hover { color: var(--text); }

/* ── landing ─────────────────────────────────────────── */
.landing { position: relative; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; isolation: isolate; }
.room-light {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60vw 50vw at 72% 38%, rgba(28, 142, 91, .2), transparent 70%),
    radial-gradient(40vw 30vw at 72% 0%, rgba(243, 217, 149, .08), transparent 70%),
    var(--ink);
}
.masthead { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: min(1240px, 92vw); margin: 0 auto; padding: 22px 0; }
.mast-label { font-size: 11px; letter-spacing: .16em; color: var(--text-3); }
.landing-main {
  flex: 1; width: min(1240px, 92vw); margin: 0 auto; display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(24px, 4vw, 64px); align-items: center;
  padding: clamp(16px, 4vh, 48px) 0 clamp(32px, 6vh, 72px);
}
.eyebrow { font: 600 11px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--brass-hi); margin: 0 0 18px; }
h1 {
  font: 800 clamp(48px, 7.2vw, 108px)/.92 var(--display); letter-spacing: -.04em; margin: 0 0 22px;
}
.felt-word {
  font-family: var(--serif); font-weight: 400; font-style: italic; letter-spacing: -.01em;
  background: linear-gradient(120deg, #7be3ae, #1c8e5b 60%, #0d6a42); -webkit-background-clip: text; background-clip: text; color: transparent;
  padding-right: .06em;
}
.lead { font-size: clamp(16px, 1.35vw, 19px); color: var(--text-2); max-width: 54ch; margin: 0 0 28px; }
.field { display: grid; gap: 7px; }
.field-label { font: 600 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.field input, .field select {
  height: 46px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--s1);
  font-size: 16px; transition: border-color .2s;
}
.field input:focus, .field select:focus { border-color: var(--brass); outline: none; }
.name-field { max-width: 340px; margin-bottom: 26px; }
.shake { animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-6px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }

.games { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 26px; }
.game-tile {
  display: grid; grid-template-rows: auto 1fr; gap: 10px; padding: 12px; border-radius: 16px; text-align: left; color: inherit; font: inherit; cursor: pointer;
  background: linear-gradient(180deg, var(--s2), var(--s1)); border: 1px solid var(--line);
  transition: transform .3s var(--ease), border-color .3s var(--ease);
}
.game-tile:hover { transform: translateY(-3px); border-color: rgba(201, 150, 46, .45); }
.mini { aspect-ratio: 220 / 120; border-radius: 10px; background: radial-gradient(circle at 50% 30%, #16202e, #0a0e15); display: grid; place-items: center; padding: 8px; }
.mini svg { width: 100%; height: 100%; }
.tile-body { display: grid; gap: 4px; }
.tile-title { font: 700 20px/1.1 var(--display); letter-spacing: -.02em; }
.tile-text { color: var(--text-2); font-size: 14px; line-height: 1.4; }
.game-tile:focus-visible { outline: 2px solid var(--pulse); outline-offset: 3px; }
.game-tile .mini { transition: transform .4s var(--ease); }
.game-tile:hover .mini { transform: scale(1.03); }
.game-root { position: absolute; inset: 0; }

.join { display: grid; gap: 9px; }
.join-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.code-boxes { display: flex; gap: 6px; }
.code-box {
  width: 46px; height: 54px; text-align: center; font-size: 24px; font-weight: 600; text-transform: uppercase;
  border-radius: 10px; border: 1px solid var(--line-2); background: var(--s1); caret-color: var(--pulse);
}
.code-box:focus { border-color: var(--brass); outline: none; box-shadow: 0 0 0 3px rgba(201, 150, 46, .2); }

.hero-art { position: relative; aspect-ratio: 1; display: grid; place-items: center; }
.hero-felt {
  position: absolute; inset: 6%; border-radius: 50%;
  background: radial-gradient(circle at 50% 38%, var(--felt-hi), var(--felt) 45%, var(--felt-lo) 78%, transparent 79%);
  box-shadow: inset 0 0 0 14px #1d1410, inset 0 0 0 18px var(--brass), inset 0 0 60px 30px rgba(0, 0, 0, .55);
}
.hero-felt::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 50% 30%, rgba(255, 245, 220, .18), transparent 55%);
}
.fan { position: relative; width: 38%; aspect-ratio: 250 / 350; translate: 0 6%; }
.fan-card {
  position: absolute; inset: 0; transform-origin: 50% 118%;
  transform: rotate(calc(var(--i) * 12deg)) translateY(calc(var(--i) * var(--i) * 1.2%));
  animation: breathe 6s var(--ease) infinite alternate;
  perspective: 900px;
}
.fan-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .9s var(--ease); }
.fan-inner > svg, .fan-back { position: absolute; inset: 0; width: 100%; height: 100%; backface-visibility: hidden; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .45)); }
.fan-back { transform: rotateY(180deg); }
.fan-back svg { width: 100%; height: 100%; display: block; }
.fan-card.turn .fan-inner { transform: rotateY(180deg); }
.hero-knight { position: absolute; left: 6%; bottom: 9%; width: 27%; z-index: 2; aspect-ratio: 1; filter: drop-shadow(0 14px 14px rgba(0, 0, 0, .55)); animation: knightHop 9s var(--ease) infinite; }
.hero-knight svg { width: 100%; height: 100%; display: block; }
@keyframes knightHop { 0%, 70%, 100% { transform: none; } 76% { transform: translate(6%, -16%) rotate(-6deg); } 84% { transform: translate(12%, 0); } 92% { transform: translate(12%, 0); } }
.hero-token { position: absolute; right: 5%; bottom: 13%; width: 16%; z-index: 2; filter: drop-shadow(0 10px 10px rgba(0, 0, 0, .5)); animation: tokenBob 6s ease-in-out infinite; }
@keyframes tokenBob { 50% { transform: translateY(-6%); } }
@media (prefers-reduced-motion: reduce) { .hero-knight, .hero-token { animation: none; } }
@keyframes breathe {
  from { transform: rotate(calc(var(--i) * 9deg)) translateY(calc(var(--i) * var(--i) * 1%)); }
  to { transform: rotate(calc(var(--i) * 14deg)) translateY(calc(var(--i) * var(--i) * 1.5%)); }
}
.landing-foot {
  width: min(1240px, 92vw); margin: 0 auto; padding: 18px 0 26px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 16px; align-items: center; color: var(--text-3); font-size: 13px;
}
.landing-foot p { margin: 0; }

/* ── table screen ────────────────────────────────────── */
.table-screen { height: 100vh; height: 100dvh; display: grid; grid-template-rows: auto 1fr auto; background: radial-gradient(120% 90% at 50% 40%, #0d1420 0%, var(--ink) 70%); }
.topbar {
  display: flex; align-items: center; gap: 14px; padding: 8px max(14px, env(safe-area-inset-right)) 8px max(14px, env(safe-area-inset-left));
  border-bottom: 1px solid var(--line); background: rgba(5, 7, 11, .7); backdrop-filter: blur(10px); z-index: 20;
}
.tb-info { display: grid; line-height: 1.15; min-width: 0; }
.tb-game { font: 700 15px/1.1 var(--display); letter-spacing: -.01em; }
.tb-sub { font-size: 11px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.code-chip {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: 9px;
  border: 1px dashed rgba(201, 150, 46, .6); background: rgba(201, 150, 46, .08); color: var(--brass-hi);
  font: 600 15px/1 var(--mono); letter-spacing: .14em;
}
.code-chip:hover { background: rgba(201, 150, 46, .16); }
.code-label { font: 600 10px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.code-chip svg { width: 15px; height: 15px; }
.tb-people { display: flex; margin-left: auto; }
.mini-av {
  width: 28px; height: 28px; margin-left: -6px; border-radius: 50%; display: grid; place-items: center;
  background: var(--c, #333); color: #fff; font: 700 12px/1 var(--display); border: 2px solid var(--ink);
}
.mini-av.away { filter: grayscale(1) brightness(.6); }
.mini-av.more { background: var(--s3); font-family: var(--mono); font-size: 10px; }
.net-status { font-size: 11px; color: var(--timer); }
.menu-wrap { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); width: 236px; padding: 12px; border-radius: 12px;
  background: var(--s2); border: 1px solid var(--line-2); box-shadow: 0 18px 40px rgba(0, 0, 0, .55); display: grid; gap: 8px; z-index: 40;
}
.menu-label { font: 600 10px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; width: 100%; }
.swatches { display: flex; gap: 8px; }
.swatches button { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--line-2); }
.swatches [data-felt="emerald"] { background: radial-gradient(#1c8e5b, #053a23); }
.swatches [data-felt="sapphire"] { background: radial-gradient(#1d6fb0, #062a4c); }
.swatches [data-felt="claret"] { background: radial-gradient(#9c2b3e, #420a16); }
.swatches [data-felt="slate"] { background: radial-gradient(#3c4859, #141a22); }
.swatches [aria-pressed="true"] { border-color: var(--brass-hi); box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px var(--brass); }
.menu-item { text-align: left; padding: 9px 10px; border-radius: 8px; background: transparent; border: 0; }
.menu-item:hover { background: var(--s3); }
.menu-item.danger { color: var(--loss); }
.menu-credit { padding: 6px 10px 2px; }
.toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; color: var(--text-2); user-select: none; }
.toggle input { appearance: none; width: 34px; height: 20px; border-radius: 10px; background: var(--s3); border: 1px solid var(--line-2); position: relative; transition: background .2s; margin: 0; flex: none; }
.toggle input::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--text-2); transition: transform .2s var(--ease), background .2s; }
.toggle input:checked { background: #1c6b46; border-color: #2a9d66; }
.toggle input:checked::after { transform: translateX(14px); background: #fff; }

.table-main { position: relative; min-height: 0; overflow: hidden; }
.stage-wrap { position: absolute; inset: 0; }
.stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.felt-wrap, .felt-wrap svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.print { fill: var(--print); font-family: var(--serif); }
.print-bj { fill: var(--print-red); }
.print-rule { font-style: italic; }
.layer { position: absolute; inset: 0; pointer-events: none; }
.chips-layer { z-index: 1; }
.cards-layer { z-index: 2; }
.plates-layer { z-index: 3; }
.fx-layer { z-index: 4; }
.layer > * { pointer-events: auto; }
.ticker {
  position: absolute; left: 14px; bottom: 8px; margin: 0; max-width: min(60ch, 70%); font-size: 11.5px; color: var(--text-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none;
}

/* cards */
.card { position: absolute; left: 0; top: 0; transform-origin: 50% 50%; will-change: transform; pointer-events: none; }
.card-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .5s var(--ease), translate .4s var(--ease); }
.card-inner.down { transform: rotateY(180deg); }
.face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 7px; box-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 16px rgba(0, 0, 0, .28); }
.face svg { width: 100%; height: 100%; display: block; }
.face.back { transform: rotateY(180deg); }
.card.win .card-inner { translate: 0 -12px; }
.card.win .face.front { box-shadow: 0 0 0 3px var(--brass-hi), 0 0 26px rgba(243, 217, 149, .65), 0 10px 20px rgba(0, 0, 0, .35); }
.card.dim .face { filter: brightness(.5) saturate(.6); transition: filter .5s; }
.card.folded { opacity: .4; }
.card.active-hand .face { box-shadow: 0 0 0 2px var(--timer), 0 8px 16px rgba(0, 0, 0, .3); }

/* chips */
.stack { position: absolute; transform: translate(-50%, -68%); display: flex; flex-direction: column; align-items: center; gap: 3px; pointer-events: none; }
.stack svg { display: block; overflow: visible; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .45)); }
.stack-label {
  font: 600 13px/1 var(--mono); font-variant-numeric: tabular-nums; color: #fff; padding: 4px 8px; border-radius: 999px;
  background: rgba(5, 7, 11, .78); border: 1px solid rgba(243, 217, 149, .3); white-space: nowrap;
}
.stack.flying { transform: none; z-index: 50; }

/* player plates */
.plate { position: absolute; transform: translate(-50%, -50%); display: flex; align-items: center; z-index: 30; transition: opacity .4s; }
.plate .avatar {
  position: relative; z-index: 2; width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--c) 70%, #fff), var(--c) 55%, color-mix(in srgb, var(--c) 60%, #000));
  box-shadow: 0 0 0 3px #0b0e14, 0 0 0 4.5px rgba(201, 150, 46, .55), 0 8px 18px rgba(0, 0, 0, .5);
  font: 800 26px/1 var(--display); color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .4);
}
.plate .ring { position: absolute; inset: -9px; width: calc(100% + 18px); height: calc(100% + 18px); transform: rotate(-90deg); opacity: 0; transition: opacity .3s; }
.ring-bg { fill: none; stroke: rgba(255, 255, 255, .1); stroke-width: 3.5; }
.ring-fg { fill: none; stroke: var(--timer); stroke-width: 3.5; stroke-dasharray: 100 100; stroke-linecap: round; }
.plate.turn .ring { opacity: 1; }
.plate.turn .avatar { box-shadow: 0 0 0 3px #0b0e14, 0 0 0 4.5px var(--timer), 0 0 26px rgba(255, 179, 71, .45); }
.plate .meta {
  margin-left: -16px; padding: 7px 14px 7px 24px; min-width: 128px; border-radius: 0 12px 12px 0;
  background: linear-gradient(180deg, rgba(14, 20, 30, .95), rgba(5, 7, 11, .95)); border: 1px solid rgba(201, 150, 46, .35);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .45);
}
.plate.mine .meta { border-color: var(--brass-hi); }
.pname { font: 600 14px/1.2 var(--sans); max-width: 140px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pstack { font: 600 15px/1.25 var(--mono); font-variant-numeric: tabular-nums; color: var(--brass-hi); }
.plate .tag {
  position: absolute; left: 50%; top: -14px; transform: translateX(-30%); padding: 3px 9px; border-radius: 999px;
  background: #f5f0e6; color: #14171c; font: 700 11px/1.2 var(--sans); letter-spacing: .04em; text-transform: uppercase; white-space: nowrap;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .4); z-index: 3; animation: tagIn .35s var(--pop);
}
@keyframes tagIn { from { transform: translateX(-30%) scale(.6); opacity: 0; } }
.plate.allin .tag { background: var(--action); color: #fff; }
.plate .hand-name {
  position: absolute; left: 50%; top: calc(100% + 6px); transform: translateX(-50%); white-space: nowrap;
  font: italic 400 19px/1 var(--serif); color: var(--brass-hi); text-shadow: 0 2px 6px rgba(0, 0, 0, .8);
}
.plate.folded { opacity: .5; }
.plate.away .avatar { filter: grayscale(1) brightness(.7); }
.plate.winner .avatar { animation: winGlow 1.2s var(--ease) 3; }
.plate.winner .meta { border-color: var(--brass-hi); box-shadow: 0 0 24px rgba(243, 217, 149, .45); }
@keyframes winGlow { 50% { box-shadow: 0 0 0 3px #0b0e14, 0 0 0 5px var(--brass-hi), 0 0 40px 10px rgba(243, 217, 149, .55); } }
.plate.empty { z-index: 10; }
.sit {
  padding: 10px 18px; border-radius: 999px; border: 1.5px dashed rgba(236, 209, 143, .7); background: rgba(5, 7, 11, .55);
  color: var(--print); font: 600 14px/1 var(--sans); letter-spacing: .04em; backdrop-filter: blur(4px); transition: background .2s, transform .2s var(--pop);
}
.sit:hover { background: rgba(5, 7, 11, .8); transform: scale(1.05); }
.seat-dot { display: block; width: 46px; height: 46px; border-radius: 50%; border: 1.5px dashed rgba(236, 209, 143, .25); }

.dealer-btn {
  position: absolute; left: 0; top: 0; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 40% 35%, #fff, #e9e4da 60%, #bdb6a8); color: #14171c; font: 800 8.5px/1 var(--display); letter-spacing: .08em;
  box-shadow: 0 0 0 2px #14171c inset, 0 0 0 4px #e9e4da inset, 0 4px 8px rgba(0, 0, 0, .5); transition: transform .7s var(--ease); z-index: 25; pointer-events: none;
}

.center-panel {
  position: absolute; transform: translate(-50%, -50%); width: 470px; max-width: 80%; text-align: center; padding: 22px 26px;
  border-radius: 16px; background: rgba(5, 7, 11, .72); border: 1px solid rgba(236, 209, 143, .25); backdrop-filter: blur(6px); z-index: 40;
  animation: rise .5s var(--ease);
}
.cp-eyebrow { font: 600 13px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--print); margin-bottom: 10px; }
.cp-eyebrow .mono { font-size: 15px; color: #fff; }
.cp-title { font: 800 34px/1.05 var(--display); letter-spacing: -.03em; margin-bottom: 8px; }
.cp-title.small { font-size: 26px; }
.center-panel p { margin: 0 0 14px; color: var(--text-2); font-size: 17px; }
.center-panel p.countdown { color: var(--timer); font-size: 18px; margin: 0; }
.cp-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.cp-actions .btn { min-height: 48px; font-size: 16px; }
@keyframes rise { from { opacity: 0; transform: translate(-50%, -40%); } }

/* floating results */
.burst {
  position: absolute; transform: translate(-50%, -50%); font: 800 34px/1 var(--display); letter-spacing: -.02em; white-space: nowrap;
  color: #fff; text-shadow: 0 2px 10px rgba(0, 0, 0, .8); animation: burst 2.6s var(--ease) forwards; z-index: 60; pointer-events: none;
}
.burst.gain { color: var(--gain); }
.burst.loss { color: var(--loss); }
.burst.push { color: #e8edf5; }
.burst.bj { font: italic 400 56px/1 var(--serif); color: var(--brass-hi); text-shadow: 0 0 22px rgba(243, 217, 149, .6), 0 2px 8px #000; }
@keyframes burst {
  0% { opacity: 0; transform: translate(-50%, -20%) scale(.6); }
  12% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
  20% { transform: translate(-50%, -50%) scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -110%); }
}
.banner {
  position: absolute; left: 50%; top: 34%; transform: translate(-50%, -50%); padding: 14px 28px; border-radius: 999px; z-index: 70;
  background: rgba(5, 7, 11, .82); border: 1px solid rgba(243, 217, 149, .45); box-shadow: 0 16px 40px rgba(0, 0, 0, .5);
  font: 500 24px/1.2 var(--sans); white-space: nowrap; animation: bannerIn .5s var(--pop); pointer-events: none;
}
.banner b { font-weight: 700; }
.banner i { font: italic 400 30px/1 var(--serif); color: var(--brass-hi); margin-left: 4px; }
.banner .mono { color: var(--gain); font-weight: 700; }
.banner.out { opacity: 0; transition: opacity .4s; }
@keyframes bannerIn { from { opacity: 0; transform: translate(-50%, -30%) scale(.9); } }
.react { position: absolute; transform: translate(-50%, -50%); font-size: 46px; animation: floatUp 2.4s var(--ease) forwards; pointer-events: none; z-index: 65; }
@keyframes floatUp { 0% { opacity: 0; transform: translate(-50%, 0) scale(.4); } 15% { opacity: 1; transform: translate(-50%, -30%) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -260%) scale(1); } }

/* blackjack furniture */
.hand-badge, .dealer-total {
  position: absolute; transform: translate(-50%, -50%); padding: 5px 11px; border-radius: 999px; z-index: 45; white-space: nowrap;
  background: rgba(5, 7, 11, .88); border: 1.5px solid rgba(243, 217, 149, .55); color: #fff; font: 700 17px/1 var(--mono); font-variant-numeric: tabular-nums;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .5); pointer-events: none;
}
.hand-badge.active { border-color: var(--timer); box-shadow: 0 0 0 3px rgba(255, 179, 71, .25), 0 4px 12px rgba(0, 0, 0, .5); }
.hand-badge.bust, .dealer-total.bust { border-color: var(--loss); color: var(--loss); }
.hand-badge.bj { border-color: var(--brass-hi); color: var(--brass-hi); }
.dealer-total { font-size: 18px; }
.shoe { position: absolute; transform: translate(-50%, -50%); width: 150px; pointer-events: auto; z-index: 4; }
.shoe svg { width: 100%; display: block; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .55)); }
.shoe-label { display: block; text-align: center; font-size: 12px; color: rgba(236, 209, 143, .8); margin-top: 2px; }
.shoe.shuffling svg { animation: riffle .3s ease-in-out 7; }
@keyframes riffle { 50% { transform: translateY(-3px) rotate(-2deg); } }
.discard { position: absolute; transform: translate(-50%, -50%); width: 120px; height: 90px; display: flex; align-items: flex-end; justify-content: center; pointer-events: auto; z-index: 4; }
.discard::before { content: ''; position: absolute; inset: 0; border-radius: 10px; background: rgba(0, 0, 0, .3); border: 1.5px solid rgba(201, 150, 46, .5); }
.discard-pile {
  position: relative; width: 66px; margin-bottom: 10px; transform: skewX(-8deg); border-radius: 4px; transition: height .6s var(--ease);
  background: repeating-linear-gradient(180deg, #f3efe6 0 1.6px, #b9b2a4 1.6px 2.6px); box-shadow: 0 4px 8px rgba(0, 0, 0, .45);
}

/* ── dock ────────────────────────────────────────────── */
.dock {
  position: relative; z-index: 15; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 16px;
  min-height: 76px; padding: 12px max(16px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: linear-gradient(180deg, rgba(9, 13, 20, .92), var(--ink)); border-top: 1px solid var(--line);
}
.dock-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.dock-status { color: var(--text-2); font-size: 15px; display: flex; align-items: center; gap: 10px; }
.dock-status b { color: var(--text); font-family: var(--mono); }
.best { font: italic 400 20px/1 var(--serif); color: var(--brass-hi); }
.pip-live { width: 8px; height: 8px; border-radius: 50%; background: var(--gain); box-shadow: 0 0 10px var(--gain); }
.btn.act { min-height: 52px; min-width: 132px; font-size: 16px; border-radius: 12px; }
.btn.act b { font-weight: 700; margin-left: 4px; }
.btn.fold { border-color: rgba(255, 106, 92, .45); }
.btn.raise { border-color: var(--brass); color: var(--brass-hi); background: rgba(201, 150, 46, .08); }
.btn.raise.allin { border-color: var(--pulse); color: #fff; }
.raise-box { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; }
.presets { display: flex; gap: 6px; }
.chip-btn { height: 34px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--s2); font-size: 13px; color: var(--text-2); }
.chip-btn:hover { color: var(--text); border-color: var(--brass); }
.slider { width: 200px; accent-color: var(--brass); }
.amt { width: 104px; height: 38px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--s1); }
.balance {
  display: inline-flex; align-items: baseline; gap: 10px; padding: 10px 16px; border-radius: 10px;
  background: var(--s1); border: 1px solid rgba(201, 150, 46, .45);
}
.balance span { font: 600 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.balance b { font-size: 18px; color: var(--brass-hi); }
.chip-rack { display: flex; gap: 8px; }
.rack-chip { width: 58px; height: 58px; padding: 0; border: 0; background: none; border-radius: 50%; transition: transform .2s var(--pop), filter .2s; filter: drop-shadow(0 5px 6px rgba(0, 0, 0, .55)); }
.rack-chip svg { width: 100%; height: 100%; display: block; }
.rack-chip:hover:not(:disabled) { transform: translateY(-5px) rotate(-8deg); }
.rack-chip:active:not(:disabled) { transform: translateY(-1px) scale(.95); }
.rack-chip:disabled { opacity: .3; cursor: not-allowed; }
.round-acts { display: flex; gap: 14px; }
.round {
  position: relative; width: 78px; display: grid; justify-items: center; gap: 6px; padding: 0; border: 0; background: none;
  font: 700 12px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--text);
}
.round svg {
  width: 62px; height: 62px; padding: 13px; border-radius: 50%; color: var(--brass-hi);
  background: radial-gradient(circle at 40% 30%, #2a3240, #0b0e14 70%);
  box-shadow: 0 0 0 2px var(--brass), 0 0 0 5px #0b0e14, 0 0 0 6px rgba(201, 150, 46, .4), 0 10px 20px rgba(0, 0, 0, .5);
  transition: transform .2s var(--pop), box-shadow .2s;
}
.round:hover:not(:disabled) svg { transform: translateY(-3px); box-shadow: 0 0 0 2px var(--brass-hi), 0 0 0 5px #0b0e14, 0 0 0 6px var(--brass), 0 14px 24px rgba(0, 0, 0, .55); }
.round.hit svg { background: radial-gradient(circle at 40% 30%, #e03a2a, var(--action) 60%, #8f1a10); color: #fff; }
.round:disabled { opacity: .35; cursor: not-allowed; }
.round kbd { position: absolute; top: 0; right: 0; margin: 0; background: var(--ink); }

/* on wide screens the blackjack decisions stand in a rail to the right of the table */
@media (min-width: 1100px) and (min-aspect-ratio: 4/3) {
  .round-acts { position: fixed; right: 26px; top: 50%; transform: translateY(-50%); flex-direction: column-reverse; gap: 18px; z-index: 30; transition: right .32s var(--ease); }
  /* table talk open (docked or overlaid): the rail steps left of it, never under it */
  body.feed-open .round-acts { right: calc(min(340px, 100vw) + 26px); }
  /* blackjack keeps a column clear for that rail, so it never sits on the felt */
  body.game-blackjack .stage-wrap { right: 118px; }
}
@media (min-width: 1280px) and (min-aspect-ratio: 4/3) {
  body.game-blackjack .table-main.docked .stage-wrap { right: 458px; }
}

/* ── feed ────────────────────────────────────────────── */
.feed {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(340px, 100%); z-index: 35; display: grid; grid-template-rows: auto 1fr auto auto;
  background: rgba(9, 13, 20, .96); border-left: 1px solid var(--line); backdrop-filter: blur(12px);
  transform: translateX(102%); transition: transform .32s var(--ease); visibility: hidden;
}
.feed.open { transform: none; visibility: visible; }
.feed-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 10px 10px 16px; border-bottom: 1px solid var(--line); font: 700 15px/1 var(--display); }
.feed-list { list-style: none; margin: 0; padding: 12px 16px; overflow-y: auto; display: grid; align-content: start; gap: 7px; font-size: 14px; }
.feed-list .log { color: var(--text-3); font: 400 12.5px/1.45 var(--mono); }
.feed-list .chat { color: var(--text); }
.reacts { display: flex; justify-content: space-around; padding: 6px 10px; border-top: 1px solid var(--line); }
.reacts button { width: 42px; height: 42px; font-size: 22px; border: 0; background: none; border-radius: 10px; transition: transform .2s var(--pop); }
.reacts button:hover { transform: scale(1.2); background: var(--s2); }
.chat-form { display: flex; gap: 8px; padding: 10px 12px max(12px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.chat-form input { flex: 1; min-width: 0; height: 38px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--s1); }

/* ── dialogs & toast ─────────────────────────────────── */
.sheet {
  width: min(460px, calc(100vw - 32px)); padding: 0; border-radius: 18px; border: 1px solid var(--line-2);
  background: linear-gradient(180deg, var(--s2), var(--s1)); color: var(--text); box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
}
.sheet[open] { animation: sheetIn .35s var(--pop); }
@keyframes sheetIn { from { opacity: 0; transform: translateY(16px) scale(.97); } }
.sheet::backdrop { background: rgba(2, 3, 6, .65); backdrop-filter: blur(4px); }
.sheet form { padding: 24px; display: grid; gap: 16px; }
.sheet h2 { font: 800 28px/1.05 var(--display); letter-spacing: -.03em; margin: 0; }
.sheet .eyebrow { margin: 0; }
.opts { display: grid; gap: 14px; }
.seg { border: 0; padding: 0; margin: 0; display: flex; gap: 6px; flex-wrap: wrap; }
.seg legend { font: 600 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); margin-bottom: 8px; padding: 0; }
.seg label { flex: 1; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: grid; place-items: center; height: 42px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--s1); font-weight: 600; cursor: pointer; transition: all .2s; }
.seg input:checked + span { border-color: var(--brass); background: rgba(201, 150, 46, .14); color: var(--brass-hi); }
.seg input:focus-visible + span { outline: 2px solid var(--pulse); outline-offset: 2px; }
.sheet-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.toast {
  position: fixed; left: 50%; bottom: 110px; transform: translate(-50%, 20px); opacity: 0; z-index: 100; pointer-events: none;
  padding: 11px 18px; border-radius: 12px; background: #f5f0e6; color: #14171c; font-weight: 600; font-size: 15px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .5); transition: opacity .25s, transform .3s var(--pop); max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── small screens ───────────────────────────────────── */
@media (max-width: 900px) {
  .landing-main { grid-template-columns: 1fr; }
  .hero-art { order: -1; width: min(420px, 80vw); margin: -10px auto -30px; }
  .mast-label { display: none; }
}
@media (max-width: 640px) {
  .games { grid-template-columns: 1fr; }
  .game-tile { grid-template-columns: 104px 1fr; grid-template-rows: auto; align-items: center; }
  .code-box { width: 42px; height: 50px; }
  .landing-foot { flex-direction: column; align-items: flex-start; }
  .topbar { gap: 8px; }
  .topbar .wordmark, .tb-sub, .code-label, .tb-people { display: none; }
  .tb-info { margin-right: auto; }
  .dock { gap: 10px; min-height: 68px; }
  .btn.act { min-width: 0; flex: 1; padding: 0 12px; }
  .dock-row { width: 100%; }
  .raise-box { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
  .raise-box .presets { grid-column: 1 / -1; }
  .slider { width: 100%; }
  .amt { width: 92px; }
  .presets { width: 100%; justify-content: space-between; }
  .rack-chip { width: 50px; height: 50px; }
  .round-acts { width: 100%; justify-content: space-around; gap: 6px; }
  .round svg { width: 56px; height: 56px; }
  .balance { padding: 8px 12px; }
  .toast { bottom: 150px; }
}


/* ── CPU seats, chat bubbles, pre-actions, hints ─────── */
.plate.empty { display: flex; gap: 8px; }
.add-cpu {
  padding: 9px 14px; border-radius: 999px; border: 1.5px solid rgba(236, 209, 143, .45); background: rgba(5, 7, 11, .7);
  color: var(--text-2); font: 600 13px/1 var(--mono); letter-spacing: .06em; transition: color .2s, border-color .2s, transform .2s var(--pop);
}
.add-cpu:hover { color: var(--print); border-color: var(--print); transform: scale(1.05); }
.cpu-badge {
  position: absolute; left: 44px; bottom: -6px; z-index: 4; padding: 2px 6px; border-radius: 5px; background: #e8edf5; color: #0b0e14;
  font: 700 10px/1.2 var(--mono); letter-spacing: .1em; pointer-events: none;
}
.cpu-x {
  position: absolute; right: -10px; top: -10px; z-index: 5; width: 26px; height: 26px; border-radius: 50%; padding: 0;
  border: 1px solid var(--line-2); background: var(--s3); color: var(--text-2); font: 600 17px/1 var(--sans); opacity: 0; transition: opacity .2s;
}
.plate:hover .cpu-x, .cpu-x:focus-visible { opacity: 1; }
@media (pointer: coarse) { .cpu-x { opacity: .85; } }
.cpu-x:hover { color: #fff; border-color: var(--loss); background: #3a1512; }
.plate.hurry .ring-fg { stroke: var(--pulse); }
.plate.hurry.turn .avatar { box-shadow: 0 0 0 3px #0b0e14, 0 0 0 4.5px var(--pulse), 0 0 26px rgba(242, 61, 38, .55); }
.bubble {
  position: absolute; transform: translate(0, -100%); max-width: 260px; padding: 9px 14px; border-radius: 14px 14px 14px 4px;
  background: #f5f0e6; color: #14171c; font: 500 17px/1.3 var(--sans); box-shadow: 0 8px 22px rgba(0, 0, 0, .45); z-index: 66;
  animation: bubbleIn .35s var(--pop); pointer-events: none; overflow-wrap: anywhere;
}
.bubble.out { opacity: 0; transition: opacity .4s; }
.bubble.left { transform: translate(-100%, -100%); border-radius: 14px 14px 4px 14px; }
@keyframes bubbleIn { from { opacity: 0; scale: .85; } }

/* wide screens: table talk docks beside the table instead of over it */
@media (min-width: 1280px) and (min-aspect-ratio: 4/3) {
  .table-main.docked .feed { transform: none; visibility: visible; box-shadow: none; }
  .table-main.docked .stage-wrap, .table-main.docked .game-root { right: 340px; }
  .table-main.docked .feed { width: 340px; }
  .table-main.docked .ticker { display: none; }
}
.pre-acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.pre {
  min-height: 40px; padding: 0 14px; border-radius: 10px; border: 1px dashed var(--line-2); background: transparent; color: var(--text-2);
  font-size: 14px; font-weight: 600; transition: all .2s;
}
.pre:hover { color: var(--text); border-color: rgba(232, 237, 245, .4); }
.pre.on { border-style: solid; border-color: var(--brass); background: rgba(201, 150, 46, .16); color: var(--brass-hi); }
.pre.on::before { content: '✓ '; }
.tip { margin-left: 10px; padding: 4px 10px; border-radius: 999px; border: 1px solid rgba(201, 150, 46, .45); color: var(--brass-hi); font-size: 13px; }
.tip b { font-family: var(--sans); text-transform: capitalize; color: var(--brass-hi); }
.round.tip-on svg { box-shadow: 0 0 0 2px var(--brass-hi), 0 0 0 5px #0b0e14, 0 0 0 7px var(--brass-hi), 0 0 22px rgba(243, 217, 149, .5); }
.rejoin {
  display: inline-grid; gap: 6px; margin-top: 22px; padding: 12px 16px; border-radius: 12px; text-decoration: none;
  border: 1px solid rgba(201, 150, 46, .45); background: rgba(201, 150, 46, .07); color: var(--text); transition: background .2s;
}
.rejoin:hover { background: rgba(201, 150, 46, .15); }
.rejoin b { color: var(--brass-hi); letter-spacing: .1em; }


/* ── portrait phones: the stage is scaled hard, so the people and numbers on it are drawn larger ── */
.stage.portrait { --ui: 1.75; }
.stage.portrait .plate { flex-direction: column; transform: translate(-50%, -50%) scale(var(--ui)); }
.stage.portrait .plate .meta { margin: -12px 0 0; padding: 14px 10px 6px; min-width: 104px; border-radius: 10px; text-align: center; }
.stage.portrait .pname { max-width: 110px; font-size: 13px; }
.stage.portrait .pstack { font-size: 14px; }
.stage.portrait .plate .tag { top: -12px; left: 70%; }
.stage.portrait .cpu-badge { left: 50%; bottom: auto; top: 50px; transform: translateX(-50%); }
.stage.portrait .plate .hand-name { font-size: 16px; }
.stage.portrait .stack { transform: translate(-50%, -68%) scale(1.45); }
.stage.portrait .hand-badge, .stage.portrait .dealer-total { transform: translate(-50%, -50%) scale(1.5); }
.stage.portrait .burst { font-size: 54px; }
.stage.portrait .burst.bj { font-size: 80px; }
.stage.portrait .banner { font-size: 36px; padding: 18px 34px; max-width: 92%; white-space: normal; text-align: center; }
.stage.portrait .banner i { font-size: 44px; }
.stage.portrait .bubble { font-size: 28px; max-width: 420px; }
.stage.portrait .center-panel { width: 760px; max-width: 90%; padding: 34px 36px; }
.stage.portrait .cp-title { font-size: 52px; }
.stage.portrait .cp-title.small { font-size: 42px; }
.stage.portrait .center-panel p, .stage.portrait .cp-eyebrow { font-size: 26px; }
.stage.portrait .cp-actions .btn { min-height: 72px; font-size: 26px; padding: 0 28px; border-radius: 14px; }
.stage.portrait .sit, .stage.portrait .add-cpu { font-size: 24px; padding: 16px 24px; }
.stage.portrait .shoe { width: 200px; }
.stage.portrait .shoe-label { font-size: 20px; }


/* ── chess ───────────────────────────────────────────── */
.chess-room { position: absolute; inset: 0; display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 18px; padding: 14px 18px; }
.chess-main { position: relative; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.board { position: relative; flex: none; border-radius: 2.2%; box-shadow: 0 30px 60px rgba(0, 0, 0, .6), 0 0 0 1px rgba(201, 150, 46, .25); touch-action: none; user-select: none; }
.board-art, .board-art svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.coord { fill: #e9c77a; font: 400 30px var(--serif); text-anchor: middle; opacity: .85; }
.hl-layer, .piece-layer, .hint-layer { position: absolute; inset: 0; pointer-events: none; }
.hl { position: absolute; width: 11%; height: 11%; }
.hl.last { background: rgba(243, 200, 90, .32); box-shadow: inset 0 0 0 2px rgba(243, 217, 149, .35); }
.hl.sel { background: rgba(243, 217, 149, .3); box-shadow: inset 0 0 0 3px var(--brass-hi); }
.hl.check { background: radial-gradient(circle, rgba(255, 60, 40, .85) 0%, rgba(229, 16, 46, .45) 40%, transparent 72%); animation: checkPulse 1.1s ease-in-out infinite; }
@keyframes checkPulse { 50% { opacity: .55; } }
.piece { position: absolute; width: 11%; height: 11%; z-index: 2; cursor: grab; will-change: transform; filter: drop-shadow(0 3px 2px rgba(0, 0, 0, .45)); transition: filter .2s; }
.piece svg { width: 100%; height: 100%; display: block; }
.piece.lifted { z-index: 30; cursor: grabbing; filter: drop-shadow(0 14px 10px rgba(0, 0, 0, .5)); }
.piece.taken { z-index: 25; }
.piece.toppled { transform-origin: 50% 90%; animation: topple 1.1s cubic-bezier(.55, 0, .3, 1.3) .3s forwards; }
.piece.bowed { transform-origin: 50% 90%; animation: bow 1.4s ease .3s forwards; }
.piece.still { animation-duration: .01ms; animation-delay: 0s; }
@keyframes topple { 0% { transform: rotate(0); } 30% { transform: rotate(-12deg); } 100% { transform: rotate(84deg) translate(4%, 22%); filter: drop-shadow(0 2px 1px rgba(0, 0, 0, .4)) brightness(.85); } }
@keyframes bow { 100% { transform: rotate(-9deg); } }
.hint { position: absolute; width: 11%; height: 11%; display: grid; place-items: center; }
.hint::after { content: ''; width: 26%; height: 26%; border-radius: 50%; background: rgba(20, 14, 8, .45); box-shadow: 0 0 0 2px rgba(243, 217, 149, .55); animation: hintIn .25s var(--pop); }
.hint.cap::after { width: 86%; height: 86%; background: transparent; box-shadow: inset 0 0 0 5px rgba(243, 217, 149, .7); }
@keyframes hintIn { from { transform: scale(.2); opacity: 0; } }
.dust { position: absolute; width: 0; height: 0; z-index: 26; pointer-events: none; }
.dust span { position: absolute; width: 7px; height: 7px; margin: -3px; border-radius: 50%; box-shadow: 0 0 6px currentColor; }
.board-overlay { position: absolute; inset: 0; display: grid; place-items: center; z-index: 40; background: radial-gradient(circle, rgba(5, 7, 11, .45), rgba(5, 7, 11, .15)); animation: fadeIn .4s; }
@keyframes fadeIn { from { opacity: 0; } }
.ov-card { width: min(78%, 460px); padding: 26px 28px; text-align: center; border-radius: 16px; background: rgba(5, 7, 11, .86); border: 1px solid rgba(236, 209, 143, .35); box-shadow: 0 24px 60px rgba(0, 0, 0, .6); animation: rise2 .5s var(--pop); }
@keyframes rise2 { from { transform: translateY(14px) scale(.96); opacity: 0; } }
.ov-title { font: 800 30px/1.05 var(--display); letter-spacing: -.03em; margin: 4px 0 8px; }
.ov-card p { color: var(--text-2); margin: 0 0 16px; }
.ov-card.result p { margin: 0; }
.ov-score { font-size: 15px; letter-spacing: .3em; color: var(--brass-hi); }
.promo { position: absolute; z-index: 50; width: 11%; display: grid; gap: 4px; padding: 4px; transform: translateY(-4px); border-radius: 10px; background: rgba(5, 7, 11, .92); border: 1px solid var(--brass); box-shadow: 0 16px 40px rgba(0, 0, 0, .6); }
.promo button { aspect-ratio: 1; border: 0; border-radius: 8px; background: #2a1d12; padding: 6%; }
.promo button:hover, .promo button:focus-visible { background: #4a3420; }
.promo svg { width: 100%; height: 100%; display: block; }
.pbar { width: 100%; max-width: var(--board-w, 100%); display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 6px 4px; }
.pbar .who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pav { width: 38px; height: 38px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--c, #3a4252); color: #fff; font: 800 17px/1 var(--display); box-shadow: 0 0 0 2px #0b0e14, 0 0 0 3.5px rgba(201, 150, 46, .55); }
.pav.empty { background: transparent; box-shadow: inset 0 0 0 1.5px rgba(236, 209, 143, .35); }
.pinfo { display: grid; line-height: 1.2; min-width: 0; }
.pinfo b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pinfo b i { font-style: normal; color: var(--text-3); font-weight: 400; }
.pinfo .mono { font-size: 11px; color: var(--text-3); letter-spacing: .06em; }
.pbar.to-move .pav { box-shadow: 0 0 0 2px #0b0e14, 0 0 0 3.5px var(--timer), 0 0 18px rgba(255, 179, 71, .45); }
.caps { display: flex; align-items: center; margin-left: 6px; flex: 1; min-width: 0; overflow: hidden; }
.caps .cap { width: 22px; height: 22px; margin-right: -7px; flex: none; }
.caps .cap svg { width: 100%; height: 100%; }
.caps .lead { margin-left: 12px; font-size: 13px; color: var(--text-2); }
.clock { margin-left: auto; display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 8px; border-radius: 10px; background: #0b0d10; border: 1px solid rgba(201, 150, 46, .35); }
.clock.none { display: none; }
.clock svg { width: 30px; height: 30px; }
.dial-bg { fill: #1a1510; stroke: rgba(201, 150, 46, .35); stroke-width: 2; }
.dial { fill: none; stroke: var(--brass); stroke-width: 3.2; stroke-dasharray: 100 100; transform: rotate(-90deg); transform-origin: 20px 20px; transition: stroke .3s; }
.hand { stroke: #f3d995; stroke-width: 1.6; stroke-linecap: round; }
.clock .time { font-size: 22px; font-weight: 600; min-width: 4.2ch; text-align: right; color: var(--text-2); }
.pbar.running .clock { border-color: var(--timer); box-shadow: 0 0 18px rgba(255, 179, 71, .25); }
.pbar.running .clock .time { color: #fff; }
.clock.low .time { color: var(--loss); }
.clock.low .dial { stroke: var(--pulse); }
.chess-side { min-height: 0; display: grid; grid-template-rows: auto 1fr; border-radius: 14px; background: linear-gradient(180deg, var(--s2), var(--s1)); border: 1px solid var(--line); overflow: hidden; align-self: center; max-height: 100%; height: min(100%, 640px); }
.side-head { display: flex; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); font: 700 15px/1 var(--display); }
.movelist { list-style: none; margin: 0; padding: 8px 6px; overflow-y: auto; font-size: 14px; }
.movelist li { display: grid; grid-template-columns: 3ch 1fr 1fr; gap: 6px; padding: 4px 8px; border-radius: 6px; }
.movelist li:nth-child(odd) { background: rgba(255, 255, 255, .025); }
.movelist .n { color: var(--text-3); }
.movelist .cur { color: var(--brass-hi); font-weight: 700; }
.movelist .empty { display: block; color: var(--text-3); font-family: var(--sans); padding: 10px; }
.btn.danger { border-color: var(--loss); color: var(--loss); }
@media (max-width: 900px) {
  .chess-room { grid-template-columns: 1fr; padding: 8px; }
  .chess-side { display: none; }
  .pbar { min-height: 46px; }
  .clock .time { font-size: 19px; }
}


/* ── conquest ────────────────────────────────────────── */
.conquest-room { position: absolute; inset: 0; display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 16px; padding: 12px 16px; }
.map-wrap { position: relative; min-height: 0; min-width: 0; }
.map-scroll { position: absolute; inset: 0; overflow: auto; display: grid; place-items: center; overscroll-behavior: contain; }
.map-host { border-radius: 14px; overflow: hidden; box-shadow: 0 30px 70px rgba(0, 0, 0, .6), 0 0 0 1px rgba(201, 150, 46, .45), 0 0 0 7px #120c08, 0 0 0 8px rgba(201, 150, 46, .35); }
.world { width: 100%; height: 100%; display: block; }
.waves { animation: drift 40s linear infinite; }
@keyframes drift { to { transform: translateX(120px); } }
.lane { fill: none; stroke: #ecd18f; stroke-width: 2; stroke-dasharray: 2 9; stroke-linecap: round; opacity: .75; animation: sail 3.5s linear infinite; }
@keyframes sail { to { stroke-dashoffset: -44; } }
.wash { fill: #8a8578; opacity: .58; mix-blend-mode: multiply; transition: fill .6s var(--ease), opacity .2s; }
.wash.hover { opacity: .78; }
.spread { opacity: .58; mix-blend-mode: multiply; }
.borders path { fill: none; stroke: #4a3520; stroke-width: 1.1; stroke-opacity: .55; }
.region-lines path { fill: none; stroke: #2a1a0c; stroke-width: 2.2; stroke-opacity: .55; stroke-dasharray: 7 4; }
.coast-ink { fill: none; stroke: #2a1a0c; stroke-width: 2.4; stroke-linejoin: round; }
.region-label { font: italic 400 25px var(--serif); fill: #2a1a0c; opacity: .62; letter-spacing: .04em; pointer-events: none; paint-order: stroke; stroke: rgba(240, 225, 190, .55); stroke-width: 4px; }
.region-bonus { font: 600 15px var(--mono); font-style: normal; fill: #6b2410; }
.rose-n { font: 600 13px var(--mono); fill: #e8d6a8; }
.hit { fill: transparent; cursor: default; }
.hit.can { cursor: pointer; }
.token { cursor: pointer; transition: transform .3s var(--ease); }
.tk-shadow { fill: #000; opacity: .35; }
.tk-body { fill: #8a8578; stroke: #1b130b; stroke-width: 1.5; transition: fill .6s; }
.tk-ring { fill: none; stroke: #e9c77a; stroke-width: 2.4; stroke-dasharray: 3 2.2; }
.tk-inner { fill: rgba(0, 0, 0, .18); stroke: rgba(255, 255, 255, .35); stroke-width: 1; }
.tk-n { font: 700 15px var(--mono); fill: #fff; text-anchor: middle; pointer-events: none; paint-order: stroke; stroke: rgba(0, 0, 0, .45); stroke-width: 2px; }
.token.big .tk-n { font-size: 13px; }
.tk-name { font: 600 10px var(--sans); fill: #2a1a0c; text-anchor: middle; letter-spacing: .04em; pointer-events: none; paint-order: stroke; stroke: rgba(240, 225, 190, .85); stroke-width: 3px; opacity: .85; }
.mark { fill: none; stroke-width: 3; pointer-events: none; }
.mark.can { stroke: rgba(243, 217, 149, .55); stroke-dasharray: 4 4; animation: spin 8s linear infinite; transform-box: fill-box; transform-origin: center; }
.mark.sel { stroke: #f3d995; stroke-width: 4; filter: drop-shadow(0 0 6px rgba(243, 217, 149, .9)); }
.mark.enemy { stroke: #ff5a3c; stroke-dasharray: 6 4; animation: spin 6s linear infinite reverse; transform-box: fill-box; transform-origin: center; }
.mark.friend { stroke: #7dffb0; stroke-dasharray: 5 4; }
.mark.tgt { stroke: #ff5a3c; stroke-width: 4; filter: drop-shadow(0 0 8px rgba(255, 90, 60, .9)); }
@keyframes spin { to { transform: rotate(360deg); } }
.aim { fill: none; stroke: #ff5a3c; stroke-width: 3; stroke-dasharray: 8 6; stroke-linecap: round; animation: sail 1s linear infinite; pointer-events: none; }
.aim.move { stroke: #7dffb0; }
.strike { fill: none; stroke: #ffcf6a; stroke-width: 4; stroke-linecap: round; stroke-dasharray: 100; filter: drop-shadow(0 0 6px #ff7a2a); pointer-events: none; }
.burst-ring { fill: none; stroke: #ffcf6a; stroke-width: 3; pointer-events: none; }
.marcher { fill: #f3d995; filter: drop-shadow(0 0 3px #000); pointer-events: none; }
.float { font: 800 18px var(--display); text-anchor: middle; paint-order: stroke; stroke: rgba(0, 0, 0, .65); stroke-width: 3px; pointer-events: none; }
.dice-tray { position: absolute; left: 50%; top: 14px; transform: translate(-50%, -20px); opacity: 0; pointer-events: none; transition: opacity .25s, transform .35s var(--pop); z-index: 20; }
.dice-tray.show { opacity: 1; transform: translate(-50%, 0); }
.roll { display: flex; align-items: center; gap: 16px; padding: 10px 18px; border-radius: 14px; background: rgba(5, 7, 11, .88); border: 1px solid rgba(236, 209, 143, .4); box-shadow: 0 16px 40px rgba(0, 0, 0, .55); }
.roll .side { display: grid; justify-items: center; gap: 4px; }
.roll .who { font: 600 11px var(--mono); letter-spacing: .08em; color: var(--text-2); text-transform: uppercase; }
.roll .dice { display: flex; gap: 6px; }
.roll .loss { font: 700 13px var(--mono); color: var(--loss); min-height: 16px; }
.roll .vs { color: var(--text-3); font-size: 12px; }
.die { width: 38px; height: 38px; display: block; animation: tumble .55s cubic-bezier(.2, .8, .3, 1.2) both; animation-delay: calc(var(--i) * 70ms); }
.die svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .5)); }
@keyframes tumble { 0% { transform: translateY(-30px) rotate(-260deg) scale(.6); opacity: 0; } 60% { transform: translateY(4px) rotate(14deg) scale(1.05); opacity: 1; } 100% { transform: none; } }
.map-overlay { position: absolute; inset: 0; display: grid; place-items: center; z-index: 30; background: radial-gradient(circle, rgba(5, 7, 11, .4), rgba(5, 7, 11, .15)); }
.map-banner { top: 50%; z-index: 40; }
.map-banner .dot, .gdot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 8px; flex: none; box-shadow: 0 0 0 2px rgba(0, 0, 0, .4), 0 0 0 3px rgba(243, 217, 149, .5); }
.conquest-side { min-height: 0; display: grid; grid-template-rows: auto auto 1fr; border-radius: 14px; background: linear-gradient(180deg, var(--s2), var(--s1)); border: 1px solid var(--line); overflow: hidden; align-self: start; max-height: 100%; }
.generals { list-style: none; margin: 0; padding: 8px; display: grid; gap: 4px; }
.gen { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 10px; border: 1px solid transparent; transition: background .3s, border-color .3s; }
.gen.on { background: rgba(243, 217, 149, .08); border-color: rgba(243, 217, 149, .45); }
.gen.out { opacity: .45; text-decoration: line-through; }
.gen.open .gname { color: var(--text-3); }
.gname { flex: 1; min-width: 0; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gname i { font-style: normal; font-weight: 400; font-size: 11px; color: var(--text-3); margin-left: 4px; font-family: var(--mono); }
.gstat { font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.gstat small { font-size: 9.5px; color: var(--text-3); margin: 0 3px 0 1px; }
.legend { border-top: 1px solid var(--line); padding: 10px 14px; overflow-y: auto; display: grid; gap: 5px; align-content: start; }
.lg { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--text-2); }
.lg-name { font: italic 400 15px var(--serif); color: var(--text); }
.big-n { font: 800 22px var(--display); color: var(--brass-hi); }
.turn-clock { padding: 6px 10px; border-radius: 8px; border: 1px solid rgba(201, 150, 46, .45); color: var(--text-2); font-size: 15px; }
.turn-clock.low { color: var(--loss); border-color: var(--loss); }
.hand-cards { display: flex; align-items: center; gap: 6px; }
.ccard { width: 48px; height: 64px; padding: 4px 2px; display: grid; justify-items: center; align-content: center; gap: 2px; border-radius: 6px; border: 1px solid #b9a77f; background: linear-gradient(160deg, #f6eedb, #ddcca6); color: #2a1a0c; font: 600 8.5px/1 var(--sans); cursor: pointer; transition: transform .2s var(--pop), box-shadow .2s; }
.ccard svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.ccard.wild { background: linear-gradient(160deg, #f3d995, #b8862f); }
.ccard.on { transform: translateY(-8px); box-shadow: 0 0 0 2px var(--brass-hi), 0 8px 16px rgba(0, 0, 0, .5); }
@media (max-width: 900px) {
  .conquest-room { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); padding: 6px; gap: 6px; }
  .conquest-side { order: -1; grid-template-rows: auto; }
  .conquest-side .side-head, .conquest-side .legend { display: none; }
  .generals { display: flex; overflow-x: auto; padding: 2px; }
  .gen { flex: none; padding: 6px 8px; }
  .gstat { display: none; }
  .hand-cards { width: 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) { .waves, .lane, .mark, .aim { animation: none !important; } }

/* ── reduced motion: everything lands in its final place ─ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .fan-card { animation: none; }
  .burst, .react { animation: none; }
  .banner { animation: none; }
}
