/* ── Texas Hold'em — Luxe Casino theme ────────────────────
   Ported from the Mongol Poker (13-phi-ten) design: deep felt
   green + near-black, gold accents. Montserrat everywhere (full
   Mongolian Cyrillic, Ө Ү included); Unbounded only for the home title,
   the chip count and the win line — it has no Ө/Ү, so never on names. */
:root {
  --bg-0: #06100b;
  --felt-hi: #1a6b46;
  --felt-mid: #0f4e32;
  --felt-lo: #082f1f;
  --felt-edge: #062316;
  --gold: #d4af37;
  --gold-hi: #f4e3a1;
  --gold-deep: #8a6d1c;
  --cream: #f7f2e4;
  --ink: #1a1409;
  --suit-red: #b3202e;
  --panel: rgba(8, 30, 21, .72);
  --panel-2: rgba(13, 42, 30, .9);
  --line: rgba(212, 175, 55, .28);
  --text: #f3ead2;
  --text-dim: rgba(243, 234, 210, .62);
  --danger: #ff8a94;
  --good: #7fe3a6;
  --back-1: #155740;   /* card-back gradient (felt-toned) */
  --back-2: #0a2c1d;
}
/* Red-velvet skin — same gold/cream accents over a crimson table */
body.skin-red {
  --bg-0: #160407;
  --felt-hi: #8a2433;
  --felt-mid: #5e1722;
  --felt-lo: #380b13;
  --felt-edge: #2a0810;
  --panel: rgba(42, 8, 14, .72);
  --panel-2: rgba(60, 14, 22, .9);
  --back-1: #6e1a26;
  --back-2: #2a0a0f;
}

/* Table-colour toggle (green ↔ red velvet) */
.skin-toggle {
  position: fixed; top: 8px; left: 8px; z-index: 70;
  width: 30px; height: 30px; border-radius: 50%; padding: 0;
  border: 2px solid var(--gold); cursor: pointer;
  background: linear-gradient(135deg, #1a6b46 0 50%, #8a2433 50% 100%);
  box-shadow: 0 2px 8px rgba(0,0,0,.5);
}
.skin-toggle:active { transform: scale(.94); }

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Form controls don't inherit the body font by default — without this,
   buttons fall back to Arial, which renders Mongolian Ү/Ө poorly. */
button, input, select, textarea { font-family: inherit; }

body {
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(212,175,55,.10) 0%, rgba(0,0,0,0) 42%),
    radial-gradient(circle at 50% 38%, var(--felt-hi) 0%, var(--felt-mid) 40%, var(--felt-lo) 74%, var(--bg-0) 100%);
  font-family: 'Montserrat', system-ui, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  overflow: hidden;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

.game-container {
  width: 100%;
  max-width: 460px;
  height: 100vh;
  height: 100dvh;
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 10px 10px max(10px, env(safe-area-inset-bottom));
  overflow: hidden;
}

/* ── Opponents (seated around the table, shown as hole-card backs) ── */
.opponents { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.opp {
  position: absolute; pointer-events: auto;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  width: 124px;
}
/* The hold'em board is five cards wide, so side seats sit HIGHER than in the
   source game (16% vs 22%) to stay clear of it, and the four-opponent case
   puts a pair side by side at the top instead of pushing anyone down. */
.opp--top   { top: 6px; left: 50%; transform: translateX(-50%); }
.opp--tl    { top: 6px; left: 50%; transform: translateX(-104%); width: 116px; }
.opp--tr    { top: 6px; left: 50%; transform: translateX(4%);    width: 116px; }
.opp--left  { top: 16%; left: 2px;  width: 110px; }
.opp--right { top: 16%; right: 2px; width: 110px; }
.opp-name {
  display: flex; align-items: center; gap: 5px;
  max-width: 100%; font-size: 11px; font-weight: 700; letter-spacing: .2px;
}
/* per-seat turn clock — solid pie countdown: a filled wedge that depletes as
   the turn elapses (a thick stroke on a small-radius circle paints a full disc;
   pathLength=100 drives the wedge with a 0–100 dashoffset). */
.seat-timer { position: relative; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.seat-timer svg { display: block; width: 100%; height: 100%; transform: rotate(-90deg); }
/* The ring's shadow, drawn once. A drop-shadow filter on the svg re-rasterised
   on every tick of the countdown. */
.seat-timer::before { content: ''; position: absolute; inset: 2%; border-radius: 50%; box-shadow: 0 1px 2px rgba(0,0,0,.45); pointer-events: none; }
.seat-timer .ring-bg { fill: rgba(0,0,0,.42); stroke: rgba(255,255,255,.22); stroke-width: 1; }
.seat-timer .ring-fg {
  fill: none; stroke: rgba(247,242,228,.32); stroke-width: 15.5;
  stroke-dasharray: 100; stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear, stroke .3s;
}
.seat-timer.live .ring-fg { stroke: var(--gold); }
.seat-timer.warn { animation: pulseTime 1s ease-in-out infinite; }
.seat-timer.warn .ring-fg { stroke: var(--suit-red); }
@keyframes pulseTime { 50% { opacity: .62; } }

.opp-timer { width: 18px; height: 18px; }
.opp-pname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opp-score { margin-left: 2px; font-family: 'Montserrat', sans-serif; font-weight: 800; color: var(--gold-hi); }
/* dealer / blind marker */
.seat-tag {
  flex-shrink: 0;
  font-size: 9px; font-weight: 800; letter-spacing: .3px;
  padding: 1px 5px; border-radius: 999px;
  border: 1px solid var(--gold-deep); color: var(--gold-hi);
  background: rgba(212,175,55,.14);
}
.opp-fan {
  display: flex; justify-content: center; align-items: center; padding: 4px;
  min-height: 52px;
  border: 2px solid transparent; border-radius: 8px;
  transition: box-shadow .25s, border-color .25s;
}
.opp.turn .opp-fan { border-color: var(--gold); box-shadow: 0 0 16px rgba(212,175,55,.5); }
.opp.done { opacity: .5; }
.mini-back {
  width: 28px; height: 40px; border-radius: 4px; flex: 0 0 auto;
  margin-left: -12px;
  background:
    repeating-linear-gradient(45deg, rgba(212,175,55,.5) 0 2px, rgba(212,175,55,0) 2px 5px),
    linear-gradient(160deg, var(--back-1), var(--back-2));
  border: 1px solid var(--gold-deep);
  box-shadow: 0 1px 2px rgba(0,0,0,.4);
}
.opp-fan .mini-back:first-child { margin-left: 0; }
/* revealed at showdown */
.opp-fan .card { width: 36px; height: auto; aspect-ratio: 5 / 7; font-size: 9px; margin-left: -8px; }
.opp-fan .card:first-child { margin-left: 0; }
.opp-fold { font-size: 11px; font-weight: 700; color: var(--text-dim); padding: 12px 0; }
.opp-action {
  font-size: 10px; font-weight: 700;
  padding: 2px 8px; border-radius: 999px;
  background: rgba(255,255,255,.08); color: var(--text-dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 110px;
  min-height: 17px;
}
.opp-action.pass { background: rgba(179,32,46,.28); color: #ffc4c9; }
.opp-action.play { background: rgba(212,175,55,.18); color: var(--gold-hi); }
.opp-action.win  { background: linear-gradient(180deg, var(--gold-hi), var(--gold)); color: #3c2f06; }

/* ── Table ── */
.table-area {
  flex: 1; min-height: 0; position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
}
.turn-line {
  position: relative;
  font-family: 'Montserrat', sans-serif;
  font-size: 16px; font-weight: 800; letter-spacing: .3px;
  color: var(--text);
  padding: 7px 18px; border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  /* Holds its slot even while it says nothing: dropping out of the layout
     let the board ride up into the seats above it on a phone. */
  min-height: 38px; box-sizing: border-box;
  max-width: 96%;
  text-align: center;
}
.turn-line.blank { visibility: hidden; }
.turn-line.mine {
  color: #2a210a;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold));
  border-color: var(--gold-hi);
  box-shadow: 0 4px 16px rgba(212,175,55,.4);
}
/* community cards */
.table-combo {
  position: relative;
  display: flex; gap: 6px; justify-content: center; align-items: center;
  min-height: clamp(90px, 18vh, 116px); max-width: 96%;
}
/* pot — the number the whole table plays for */
.table-label {
  position: relative;
  font-family: 'Montserrat', sans-serif;
  font-size: 16px; font-weight: 800; letter-spacing: .4px;
  color: var(--gold-hi); min-height: 22px;
}
.table-label small { font-size: 11px; font-weight: 700; color: var(--text-dim); letter-spacing: 1.5px; margin-right: 7px; }

/* The card that broke a tie, on its own line under the hand name. */
.kicker {
  display: block; margin-top: 3px;
  font-family: 'Montserrat', sans-serif;
  font-size: 11px; font-weight: 700; letter-spacing: .6px;
  color: var(--text-dim);
}
.kicker b {
  font-family: 'Montserrat', sans-serif;
  font-size: 13px; color: var(--cream); margin-right: 3px;
}
.kicker b.kick-red { color: #e8697a; }

/* ── Playing cards ── */
.card {
  position: relative;
  font-family: 'Montserrat', sans-serif;   /* ranks are Latin-only */
  font-size: 12px;                 /* base; children use em */
  border-radius: 9px;
  background: linear-gradient(158deg, #ffffff 0%, var(--cream) 70%, #ece3cc 100%);
  color: var(--ink);
  box-shadow: 0 3px 8px rgba(0,0,0,.45), inset 0 0 0 1px rgba(0,0,0,.06);
  border: 1.5px solid transparent;
  overflow: hidden;
}
.card.red { color: var(--suit-red); }
.card .corner { position: absolute; display: flex; flex-direction: column; align-items: center; line-height: .82; font-weight: 800; }
.card .corner.tl { top: .35em; left: .42em; }
.card .corner.br { bottom: .35em; right: .42em; transform: rotate(180deg); }
.card .corner b { font-size: 1.18em; letter-spacing: -.5px; }
.card .corner i { font-style: normal; font-size: 1em; }
.card .pip { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 2.5em; opacity: .9; }

.table-combo .card { width: clamp(58px, 15vw, 72px); height: auto; aspect-ratio: 5 / 7; font-size: clamp(14px, 3.6vw, 17px); }

/* showdown: the five cards that won stay lit, the rest recede */
/* The five that actually won. They lift out of the row and keep a slow pulse
   going for the whole showdown, so the winning hand is legible at a glance
   rather than something you have to work out from the description. The lift
   is per-context: the opponent fan is only 52px tall and would clip. */
.card { transition: transform .35s ease, filter .35s ease; }
.card.lit {
  border-color: var(--gold);
  position: relative; z-index: 2;
  overflow: visible; /* let the glow layer below out */
}
.card.lit, .hand .card.lit { box-shadow: 0 0 12px rgba(212,175,55,.45), 0 6px 12px rgba(0,0,0,.5); }
/* The pulse lives on a layer of its own and only its opacity animates, so the
   compositor runs it — an animated box-shadow repainted every frame. */
.card.lit::after {
  content: ''; position: absolute; inset: -1.5px; border-radius: inherit; pointer-events: none;
  box-shadow: 0 0 26px rgba(212,175,55,.9);
  opacity: 0;
  animation: winpulse 1.6s ease-in-out infinite;
}
.table-combo .card.lit, .hand .card.lit { transform: translateY(-9px); }
.opp-fan .card.lit { transform: translateY(-3px); }
@keyframes winpulse { 50% { opacity: 1; } }
.card.faded { filter: grayscale(0.75) brightness(0.62); transform: scale(.94); }

/* ── My hand ── */
.me-area { margin-top: 8px; }
.me-bar { display: flex; align-items: center; gap: 8px; padding: 0 6px 6px; }
.me-name { font-family: 'Montserrat', sans-serif; font-size: 14px; font-weight: 800; color: var(--gold-hi); }
.me-score { font-family: 'Montserrat', sans-serif; font-size: 14px; font-weight: 800; color: var(--gold-hi); }
.me-status { font-size: 11px; font-weight: 600; color: var(--text-dim); text-align: right; margin-left: auto; }
.me-status.good { color: var(--good); }
.me-status.bad { color: var(--danger); }
.me-timer { width: 24px; height: 24px; }

.hand { display: flex; justify-content: center; align-items: center; gap: 10px; height: 118px; padding: 4px 6px 0; }
.hand .card { width: 74px; height: auto; aspect-ratio: 5 / 7; font-size: 18px; flex: 0 0 auto; }
.hand .card.faded, .hand.folded .card { filter: grayscale(0.6) brightness(0.82); }

/* ── Controls ── */
.controls { display: flex; gap: 9px; margin-top: 8px; }
/* display:flex on .controls would otherwise defeat the hidden attribute */
[hidden] { display: none !important; }
.ctrl-btn {
  flex: 1 1 0;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 0;
  font-family: 'Montserrat', sans-serif;
  font-size: 14px; font-weight: 700; letter-spacing: .3px;
  cursor: pointer;
  transition: transform .1s, box-shadow .2s, filter .2s;
}
.ctrl-btn:active { transform: scale(.97); }
.ctrl-btn.primary {
  background: linear-gradient(180deg, var(--gold-hi), var(--gold));
  color: #2a210a; border-color: var(--gold-hi);
  box-shadow: 0 4px 14px rgba(212,175,55,.35);
}
.ctrl-btn:disabled { background: rgba(255,255,255,.06); color: rgba(243,234,210,.32); border-color: rgba(255,255,255,.08); box-shadow: none; cursor: default; }
.ctrl-btn.small { padding: 8px 0; font-size: 12px; border-radius: 10px; }
.ctrl-btn.block { width: 100%; margin-top: 9px; }

.controls.secondary { margin-top: 7px; }

/* waiting room — private table, before the first hand */
.wait-room {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(300px, 78%);
  display: flex; flex-direction: column; gap: 8px;
  text-align: center;
}
.wait-title {
  font-family: 'Montserrat', sans-serif; font-size: 15px; font-weight: 800;
  color: var(--gold-hi); margin-bottom: 2px;
}
.wait-list { display: flex; flex-direction: column; gap: 5px; margin-bottom: 4px; }
.wait-row {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 11px;
  background: rgba(0,0,0,.28); border: 1px solid var(--line); border-radius: 10px;
  font-family: 'Montserrat', sans-serif; font-size: 13px; font-weight: 600;
  color: var(--text);
}
.wait-row .who { flex: 1 1 auto; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wait-row .tick { font-size: 12px; font-weight: 700; color: var(--text-dim); }
.wait-row.on { border-color: var(--gold); }
.wait-row.on .tick { color: var(--gold-hi); }
#readyBtn.on { filter: none; opacity: .75; }

/* raise panel — presets, nudge, slider, confirm */
.raise-panel { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.raise-panel .controls { margin-top: 0; }

.preset-row { display: flex; gap: 6px; }
.preset-btn {
  flex: 1 1 0;
  background: var(--panel-2); color: var(--text-dim);
  border: 1px solid var(--line); border-radius: 9px;
  padding: 8px 0;
  font-family: 'Montserrat', sans-serif;
  font-size: 12px; font-weight: 700; letter-spacing: .3px;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.preset-btn.on {
  color: var(--gold-hi); border-color: var(--gold);
  background: rgba(212,175,55,.14);
}
.raise-mid { display: flex; align-items: center; gap: 10px; }
.step-btn {
  flex: 0 0 40px; height: 40px;
  background: var(--panel-2); color: var(--gold-hi);
  border: 1px solid var(--line); border-radius: 10px;
  font-size: 20px; font-weight: 700; line-height: 1;
  cursor: pointer;
}
.step-btn:disabled { opacity: .3; cursor: default; }
.step-btn:active:not(:disabled) { transform: scale(.94); }
input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 4px; border-radius: 2px;
  background: rgba(212,175,55,.25);
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold));
  border: 1px solid var(--gold-deep);
  box-shadow: 0 2px 6px rgba(0,0,0,.5);
  cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold));
  border: 1px solid var(--gold-deep);
  box-shadow: 0 2px 6px rgba(0,0,0,.5);
  cursor: pointer;
}

/* ── Overlays ── */
.overlay {
  position: fixed; inset: 0;
  background: rgba(3, 10, 7, .68);
  display: none; align-items: center; justify-content: center;
  z-index: 50; padding: 16px;
  backdrop-filter: blur(4px);
}
.overlay.show { display: flex; }
/* Same scrim as .overlay, but driven by [hidden] rather than .show so the
   table's constant showOverlay(null) cannot dismiss it. */
.leave-ask {
  position: fixed; inset: 0;
  background: rgba(3, 10, 7, .68);
  display: flex; align-items: center; justify-content: center;
  z-index: 60; padding: 16px;
  backdrop-filter: blur(4px);
}
.overlay-card {
  position: relative;
  background:
    radial-gradient(140% 90% at 50% 0%, rgba(212,175,55,.12), rgba(0,0,0,0) 55%),
    linear-gradient(180deg, var(--felt-mid), var(--felt-lo));
  background-color: var(--felt-lo);
  border: 1px solid var(--gold-deep);
  border-radius: 20px;
  padding: 26px 22px;
  width: 100%; max-width: 380px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0,0,0,.6), inset 0 0 0 1px rgba(212,175,55,.18);
  max-height: 94vh; overflow-y: auto;
}
/* ── Home scene ──
   A full-bleed felt still-life stands in for the panel: the artwork's lower
   third carries the cards and chips, so the UI floats in the empty upper
   half. No card chrome, no backdrop blur — the photo IS the screen. */
.overlay.home-scene {
  /* Dark felt vignette flanks the poster column on wide screens. */
  background: radial-gradient(circle at 50% 32%, #0b3a27 0%, #06100b 78%);
  backdrop-filter: none;
  align-items: stretch;
  justify-content: center;
  padding: 0;
}

/* The artwork is portrait: full-bleed it only inside a phone-shaped column
   (same 460px as the game itself). Stretched across a desktop window the
   cover-crop threw away the frame, the cards and the chips — everything that
   made it worth having. */
.home-col {
  width: min(460px, 100%);
  background: #06100b url("bg-home.jpg") center top / cover no-repeat;
  box-shadow: 0 0 90px rgba(0, 0, 0, .85);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(28px, 9vh, 90px) 16px 16px;
  overflow-y: auto;
}

.home-float {
  width: 100%;
  max-width: 340px;
  text-align: center;
}

.home-title {
  font-family: 'Unbounded', sans-serif;
  font-size: clamp(34px, 9vw, 44px);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: 2px;
  color: var(--gold-hi);
  text-shadow: 0 2px 6px rgba(0, 0, 0, .8), 0 0 40px rgba(212, 175, 55, .25);
  margin-bottom: clamp(16px, 4vh, 34px);
}

.home-scene .big-chips { text-shadow: 0 2px 8px rgba(0, 0, 0, .85); }
.home-scene .count-label,
.home-scene .setup-foot { text-shadow: 0 1px 4px rgba(0, 0, 0, .8); }
.home-scene .ctrl-btn.block { background: rgba(8, 30, 21, .78); }

.setup-head { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 16px; }
.setup-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 27px; font-weight: 900; line-height: 1.05; letter-spacing: .5px;
  color: var(--gold-hi);
  text-shadow: 0 2px 10px rgba(0,0,0,.4);
}
.title-ace {
  position: relative; display: inline-block;
  width: 50px; height: 68px;
  border-radius: 9px; border: 1.5px solid var(--gold);
  background: linear-gradient(158deg, #fff, var(--cream));
  color: var(--ink); text-shadow: none;
  box-shadow: 0 5px 14px rgba(0,0,0,.45), 0 0 16px rgba(212,175,55,.3);
}
.title-ace b { position: absolute; top: 5px; left: 7px; font-family: 'Montserrat', sans-serif; font-size: 14px; font-weight: 800; line-height: 1; }
.title-ace i { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-style: normal; font-size: 32px; }
.setup-sub { font-size: 12.5px; color: var(--text-dim); margin-bottom: 20px; line-height: 1.5; }
.count-label { font-size: 11px; font-weight: 700; color: var(--gold); letter-spacing: 2px; margin-bottom: 9px; }
.big-chips {
  font-family: 'Montserrat', sans-serif;
  font-size: 40px; font-weight: 900; line-height: 1.1;
  color: var(--gold-hi);
  text-shadow: 0 2px 10px rgba(0,0,0,.4);
  /* Sits directly above the buttons now, carrying the gap the removed
     hands/wins line used to hold. */
  margin-bottom: 20px;
}
.btn-confirm {
  width: 100%;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold));
  color: #2a210a; border: 1px solid var(--gold-hi); border-radius: 13px;
  padding: 14px; font-size: 16px; font-weight: 800; letter-spacing: 1px; cursor: pointer;
  box-shadow: 0 6px 20px rgba(212,175,55,.4);
}
.btn-confirm:active { transform: scale(.98); }
.setup-foot { font-size: 11px; color: var(--text-dim); margin-top: 14px; }

/* Table list (lobby) */
.lobby-card { text-align: center; }
.lobby-title { font-family: 'Montserrat', sans-serif; font-size: 22px; font-weight: 800; color: var(--gold-hi); margin: 4px 0 2px; }

.overlay-sub { font-size: 12px; color: var(--text-dim); margin: 4px 0 2px; }
.overlay-sub b { color: var(--gold-hi); font-family: 'Montserrat', sans-serif; }
.overlay-text { font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: 800; margin-top: 12px; color: var(--gold-hi); }
.spinner {
  width: 46px; height: 46px; margin: 0 auto;
  border: 3px solid rgba(212,175,55,.2); border-top-color: var(--gold);
  border-radius: 50%; animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Leaderboard / scoreboard */
.result-card { text-align: center; }
.result-title { font-family: 'Montserrat', sans-serif; font-size: 22px; font-weight: 800; color: var(--gold-hi); margin-bottom: 16px; }
.scoreboard { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; text-align: left; }
.sb-row {
  display: flex; align-items: center; gap: 9px;
  background: rgba(0,0,0,.28); border: 1px solid rgba(255,255,255,.05);
  border-radius: 11px; padding: 10px 13px;
}
.sb-row.lead { background: linear-gradient(90deg, rgba(212,175,55,.22), rgba(212,175,55,.06)); border-color: var(--line); }
.sb-rank { font-size: 12px; font-weight: 700; color: var(--text-dim); width: 20px; text-align: center; }
.sb-name { flex: 1; font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-tag { font-size: 9px; font-weight: 800; color: var(--gold); letter-spacing: .5px; margin-left: 4px; }
/* The board ranks on profit, so profit is the big number and the balance is
   the quiet one beside it. */
.sb-score {
  font-family: 'Montserrat', sans-serif; font-size: 17px; font-weight: 800;
  text-align: right; color: var(--text-dim);
  font-variant-numeric: tabular-nums; min-width: 62px;
}
.sb-score.delta-pos { color: var(--good); }
.sb-score.delta-neg { color: var(--danger); }

/* ── Bet chips ──
   The wager in front of a player, read by colour before anyone reads the
   number. The stacks overlap so three discs still fit a narrow seat. */
.bchip {
  height: 22px; width: auto;
  flex: 0 0 auto;
  margin-left: -9px;
}
.bchip:first-child { margin-left: 0; }

/* The stack a player is sitting behind, beside their number. Smaller and
   tighter than a bet: this reads at a glance, it is not being counted. */
.schip {
  height: 15px; width: auto;
  vertical-align: -3px;
  margin-left: -7px;
}
.schip:first-child { margin-left: 0; }
.schip:last-of-type { margin-right: 4px; }

.opp-action.chips, .me-status.chips {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 1px 8px 1px 5px;
  max-width: none;
}
.bamt {
  font-weight: 800;
  color: var(--gold-hi);
  font-variant-numeric: tabular-nums;
}
.me-status.chips { margin-left: auto; }

/* ── Pot pile ──
   Not a neat row: the discs overlap hard and sit at slightly different
   heights so the middle of the table reads as a heap of chips rather than a
   ruler of them. Fixed offsets, not random, so a re-render never reshuffles
   the pile under the player's eye. */
.pot-pile {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 30px;
}
.pot-pile .bchip {
  height: 30px;
  margin-left: -15px;
}
.pot-pile .bchip:first-child { margin-left: 0; }
.pot-pile .bchip:nth-child(2n) { margin-bottom: 5px; }
.pot-pile .bchip:nth-child(3n) { margin-bottom: 9px; }

/* Chips in flight: bets collecting into the pot at the end of a street, and
   the pot going out to whoever won it. Transform and opacity only, so the
   flight never touches layout. */
.flychips {
  position: fixed;
  display: flex;
  transform: translate(-50%, -50%);
  transition: transform .62s cubic-bezier(.35, .05, .25, 1), opacity .62s ease-in;
  will-change: transform, opacity;
}
/* Larger in flight than at rest: a 20px cluster crossing the felt in half a
   second is too small to register as movement. */
.flychips .bchip { height: 28px; margin-left: -11px; }
.flychips .bchip:first-child { margin-left: 0; }

/* ── Action call-outs ──
   A dealer announcing the move: pops over the seat, lingers, fades. Lives on
   its own fixed layer so a seat re-render cannot tear it away mid-animation. */
.act-layer { position: fixed; inset: 0; z-index: 62; pointer-events: none; }

.callout {
  position: fixed;
  padding: 4px 11px;
  border-radius: 999px;
  font-family: 'Montserrat', sans-serif;
  font-size: 12px; font-weight: 800; white-space: nowrap;
  color: var(--gold-hi);
  background: #13251f;
  border: 1px solid var(--gold-deep);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .5);
  opacity: 0;
  transform: translateY(6px) scale(.7);
  transition: opacity .18s ease, transform .22s cubic-bezier(.2, 1.4, .5, 1);
  will-change: transform, opacity;
}
.callout.pop { opacity: 1; transform: translateY(0) scale(1); }
.callout.out { opacity: 0; transform: translateY(-8px) scale(.94); transition: opacity .4s, transform .4s; }
/* Folding is the one move worth colouring — it takes a player out. */
.callout.fold {
  color: #ffe1e4;
  background: linear-gradient(180deg, #a3202c, #7a141e);
  border-color: #d4646e;
}

@media (prefers-reduced-motion: reduce) {
  .callout { transition: opacity .18s ease; transform: none; }
  .callout.pop, .callout.out { transform: none; }
}

/* ── Phones ──
   A five-card board is 314px wide on a 375px screen, which leaves 31px a side
   — nowhere near the 110px a seat needs. So the side seats stop being SIDE
   seats here and drop into a second row above the board, and every opponent
   gets more compact so two rows still clear it. The board itself is never
   shrunk: it is the thing everyone is looking at. */
.opp { width: 104px; gap: 2px; }
.opp--tl { transform: translateX(-102%); width: 104px; }
.opp--tr { transform: translateX(2%);    width: 104px; }
.opp--left  { top: 94px; left: 0;  width: 104px; }
.opp--right { top: 94px; right: 0; width: 104px; }

/* Two seat rows are absolutely positioned and end just above this line, so the
   felt stops centring its column and starts below them. Centring cannot work
   here: the column's height changes between a hand and its showdown, which
   would slide the board up under the seats exactly when there are cards on it.
   The offset is measured against the rows at their TALLEST — showdown, when
   face-up fans replace the card backs. */
.table-area { justify-content: flex-start; padding-top: 196px; }

.opp-name { font-size: 10px; gap: 3px; }
.opp-score { margin-left: 0; }
.opp-fan { min-height: 32px; padding: 1px; border-width: 1px; }
.opp-fan .card { width: 25px; font-size: 6px; margin-left: -6px; }
.mini-back { width: 20px; height: 28px; margin-left: -8px; }
.opp-action { font-size: 9px; padding: 1px 6px; min-height: 14px; max-width: 100%; }
.opp-timer { width: 15px; height: 15px; }
.seat-tag { font-size: 8px; padding: 0 4px; }

/* The winner line is wide and centred, and the second seat row reaches to both
   edges — above the board they cannot both fit. .table-area is a flex column,
   so ordering it last drops the result into the empty felt under the pot,
   where nothing else is. */
.turn-line { order: 1; }

.schip { height: 12px; margin-left: -6px; }
.schip:last-of-type { margin-right: 3px; }
/* Two chips is enough to say how rich a seat is; past that they only eat into
   the name, which is already down to "Тогл…". */
.opp-score .schip:nth-of-type(n+3) { display: none; }
.bchip { height: 18px; margin-left: -7px; }

/* Short viewports (iPhone SE / 8, a small laptop window). Same two seat rows,
   far less felt beneath them — and the winner line, which sits at the BOTTOM
   of the column, was spilling into the player's own cards. Claw the space back
   from the fixed offsets instead of letting the column overflow. */
@media (max-height: 720px) {
  .opp--top, .opp--tl, .opp--tr { top: 2px; }
  .opp--left, .opp--right { top: 88px; }
  .table-area { padding-top: 176px; gap: 8px; }
  .table-combo { min-height: 96px; }
  .hand { height: 96px; }
}

/* Toast */
.toast {
  position: fixed; top: 24%; left: 50%;
  transform: translate(-50%, -50%) scale(.8);
  background: var(--panel-2); border: 1px solid var(--gold-deep);
  border-radius: 14px; padding: 12px 26px;
  font-family: 'Montserrat', sans-serif; font-size: 16px; font-weight: 800; color: var(--gold-hi);
  opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s; z-index: 60;
  max-width: 92vw; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
