/* Poker table: felt, seats (positioned by script for 2–10 players), cards, controls and live odds. */
/* Table colours come from the chosen design (see shared/designs.js); these are the house defaults. */
:root { --tfelt-hi: #8a2a3b; --tfelt: #6e2130; --tfelt-deep: #3f0f19; --trail-hi: #5b3526; --trail-lo: #2a1610; --tline: #d4ab5e3a; --tpattern: none; }
.table-layout { display: grid; gap: 18px; align-items: start; }
@media (min-width: 1180px) { .table-layout { grid-template-columns: minmax(0, 1fr) 320px; } }
.table-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.table-head h1 { font-size: clamp(20px, 2.4vw, 26px); }
.table-head .sub { color: var(--muted); font-size: 13.5px; font-variant-numeric: tabular-nums; }

.table-wrap { container: table / inline-size; padding-block: 22px 8px; }
.stage { position: relative; width: 100%; max-width: 100%; aspect-ratio: 16 / 9; }
.stage.portrait { aspect-ratio: 3 / 4.4; }
.rail {
  position: absolute; inset: 7% 2.5%; border-radius: 999px;
  background: radial-gradient(ellipse at 50% 0%, var(--trail-hi), var(--trail-lo) 72%);
  box-shadow: 0 30px 70px -20px #000, inset 0 1px 0 #ffffff1f, inset 0 -2px 0 #0006;
}
.portrait .rail { inset: 5% 4%; }
.felt {
  position: absolute; inset: clamp(10px, 2.2cqw, 24px); border-radius: 999px; overflow: hidden;
  background: var(--tpattern), radial-gradient(ellipse 70% 62% at 50% 42%, var(--tfelt-hi), var(--tfelt) 52%, var(--tfelt-deep) 100%);
  box-shadow: inset 0 0 0 2px var(--tline), inset 0 12px 44px #0008;
}
.felt::before {
  content: ""; position: absolute; inset: 0; opacity: .35; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
.felt::after { content: ""; position: absolute; inset: 9% 6%; border: 1px solid var(--tline); border-radius: 999px; }
.felt-mark {
  position: absolute; left: 50%; top: 66%; transform: translate(-50%, -50%); text-align: center; pointer-events: none;
  font-family: var(--display); color: #f5efe2; opacity: .16; line-height: 1.1; white-space: nowrap; font-size: clamp(14px, 2.6cqw, 28px);
}
.felt-mark small { display: block; font-family: var(--sans); font-size: .42em; letter-spacing: .32em; margin-top: 4px; }
.felt-mark img { display: block; height: clamp(26px, 6cqw, 62px); width: auto; margin: 0 auto 4px; }
.portrait .felt-mark { top: 69%; }

/* Cards */
.card {
  position: relative; flex: none; overflow: hidden;
  width: var(--cw); height: calc(var(--cw) * 1.4); border-radius: calc(var(--cw) * .09);
  background: linear-gradient(160deg, var(--face-hi), var(--face) 60%, var(--face-lo));
  color: var(--suit-s); box-shadow: 0 2px 7px #0008, inset 0 0 0 1px var(--face-edge);
  font-family: var(--serif); text-shadow: var(--card-glow, none);
  animation: flip .38s cubic-bezier(.2,.7,.3,1) both;
  transition: translate .25s ease, filter .25s ease, box-shadow .25s ease;
}
.card.s1 { color: var(--suit-h); }
.card.s2 { color: var(--suit-d); }
.card.s3 { color: var(--suit-c); }
.card.joker { color: var(--suit-j); }
.card .ix { position: absolute; left: 8%; top: 3%; display: flex; flex-direction: column; align-items: center; line-height: .95; }
.card .ix b { font-size: calc(var(--cw) * .38); font-weight: 700; letter-spacing: -.05em; }
.card .ix i, .card .pip { font-style: normal; font-family: "Segoe UI Symbol", "Apple Symbols", "Noto Sans Symbols 2", "DejaVu Sans", sans-serif; }
.card .ix i { font-size: calc(var(--cw) * .27); }
.card.joker .ix i { font-family: var(--sans); font-weight: 700; font-size: calc(var(--cw) * .15); letter-spacing: .04em; margin-top: 1px; }
.card .pip { position: absolute; right: 8%; bottom: 3%; font-size: calc(var(--cw) * .6); line-height: 1; }
.card.back {
  background:
    var(--back-pattern),
    radial-gradient(circle at 50% 50%, var(--back-1), var(--back-2));
  border: calc(var(--cw) * .07) solid var(--back-edge);
  animation-name: deal;
}
.card.win { translate: 0 -5px; box-shadow: 0 0 0 2px var(--win), 0 0 20px #ecc874aa; }
.dim .card:not(.win) { filter: brightness(.55) saturate(.7); }
/* Live odds: the cards that make your current hand */
.card.live { box-shadow: 0 0 0 2px #7cc495, 0 0 14px #7cc49577; }
@keyframes deal { from { opacity: 0; transform: translateY(-18px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes flip { from { opacity: 0; transform: rotateY(80deg) scale(.95); } to { opacity: 1; transform: none; } }

.board { position: absolute; left: 50%; top: 49%; transform: translate(-50%, -50%); display: flex; gap: calc(var(--cw) * .13); --cw: clamp(30px, 6.8cqw, 78px); z-index: 1; }
.portrait .board { --cw: clamp(28px, 12.4cqw, 62px); top: 51%; }
.slot { width: var(--cw); height: calc(var(--cw) * 1.4); border-radius: calc(var(--cw) * .09); border: 1px dashed #f5efe226; display: grid; }
.pot {
  position: absolute; left: 50%; top: 31%; transform: translate(-50%, -50%); z-index: 1;
  display: flex; align-items: center; gap: 8px; padding: 4px 13px 4px 5px; border-radius: 999px;
  background: #0000004d; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; font-size: clamp(12px, 1.6cqw, 16px);
}
.portrait .pot { top: 34%; }
.pot .lbl { color: var(--muted); font-weight: 500; letter-spacing: .1em; text-transform: uppercase; font-size: .75em; }
.result {
  position: absolute; left: 50%; top: 66%; transform: translate(-50%, -50%); z-index: 4; text-align: center;
  width: max-content; max-width: 62%; padding: 6px 14px; border-radius: 12px; background: #140a0bcc;
  font-size: clamp(12px, 1.5cqw, 15px); line-height: 1.35;
}
.portrait .result { top: 69%; max-width: 86%; }
.result .main { color: var(--win); font-weight: 600; }
.result .sub { color: var(--ivory-2); font-size: .9em; }
.waiting { position: absolute; left: 50%; top: 66%; transform: translate(-50%, -50%); z-index: 3; color: var(--ivory-2); font-weight: 600; text-align: center; font-size: clamp(13px, 1.6cqw, 16px); }

/* Seats */
.seat {
  position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%); z-index: 2;
  display: flex; flex-direction: column; align-items: center; --cw: clamp(24px, 4.8cqw, 54px); transition: opacity .3s ease;
}
.many .seat { --cw: clamp(22px, 4.2cqw, 46px); }
.portrait .seat { --cw: clamp(22px, 9cqw, 42px); }
.seat.me { --cw: clamp(42px, 7.4cqw, 84px); z-index: 3; }
.portrait .seat.me { --cw: clamp(38px, 14cqw, 70px); }
.hole { display: flex; position: relative; z-index: 0; min-height: calc(var(--cw) * 1.4); margin-bottom: calc(var(--cw) * -.6); transition: opacity .3s ease; }
.seat.me .hole { margin-bottom: calc(var(--cw) * -.22); }
.hole .card + .card { margin-left: calc(var(--cw) * -.36); }
.hole .card:first-child { rotate: -5deg; }
.hole .card:last-child { rotate: 5deg; }
.hole[data-n="4"] .card + .card, .hole[data-n="5"] .card + .card { margin-left: calc(var(--cw) * -.56); }
.seat.me .hole[data-n="4"] .card + .card, .seat.me .hole[data-n="5"] .card + .card { margin-left: calc(var(--cw) * -.5); }
.hole[data-n="4"] .card:nth-child(1) { rotate: -8deg; }
.hole[data-n="4"] .card:nth-child(2) { rotate: -3deg; }
.hole[data-n="4"] .card:nth-child(3) { rotate: 3deg; }
.hole[data-n="4"] .card:nth-child(4) { rotate: 8deg; }
.hole[data-n="5"] .card:nth-child(1) { rotate: -9deg; }
.hole[data-n="5"] .card:nth-child(2) { rotate: -4.5deg; }
.hole[data-n="5"] .card:nth-child(3) { rotate: 0deg; }
.hole[data-n="5"] .card:nth-child(4) { rotate: 4.5deg; }
.hole[data-n="5"] .card:nth-child(5) { rotate: 9deg; }
/* Avatar busts: above other players' cards, beside your own so they never cover your bet or the board */
.table-wrap.with-busts { padding-top: clamp(56px, 8.5cqw, 104px); }
.seat .bust {
  position: absolute; left: 50%; bottom: calc(100% - var(--cw) * .12); transform: translateX(-50%);
  width: calc(var(--cw) * 2); height: auto; pointer-events: none; filter: drop-shadow(0 6px 8px #0009);
}
.seat.me .bust { left: auto; right: calc(100% + 4px); bottom: 0; transform: none; width: calc(var(--cw) * 1.45); }
.portrait .seat.me .bust { width: calc(var(--cw) * 1.15); }
.seat.folded .bust, .seat.away .bust { opacity: .45; filter: grayscale(.6) drop-shadow(0 6px 8px #0009); }
.seat.acting .bust { filter: drop-shadow(0 0 10px #d4ab5e88) drop-shadow(0 6px 8px #0009); }
.plate {
  position: relative; z-index: 1; text-align: center; min-width: clamp(80px, 13cqw, 148px); padding: 6px 12px 8px; border-radius: 12px;
  background: linear-gradient(#2d1e19, #190f0c); border: 1px solid #ffffff17; box-shadow: 0 10px 22px -8px #000d;
  transition: border-color .2s ease, box-shadow .2s ease, opacity .3s ease;
}
.many .plate { min-width: clamp(74px, 11cqw, 128px); padding: 5px 9px 7px; }
.portrait .plate { min-width: clamp(70px, 23cqw, 116px); padding: 5px 8px 7px; }
.row1 { display: flex; gap: 6px; align-items: center; justify-content: center; white-space: nowrap; }
.row1 .avatar { --s: 18px; font-size: 10px; }
.seat .name { font-weight: 600; font-size: clamp(12px, 1.4cqw, 15px); max-width: 12ch; overflow: hidden; text-overflow: ellipsis; }
.seat .tag { font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.seat .stack { color: var(--brass); font-weight: 600; font-variant-numeric: tabular-nums; font-size: clamp(12px, 1.55cqw, 16px); }
.dbtn {
  position: absolute; right: -9px; top: -9px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--ivory); color: var(--ink); font: 700 11px/22px var(--sans); text-align: center; box-shadow: 0 2px 4px #000a, inset 0 0 0 2px #00000014;
}
.badge {
  position: absolute; left: 50%; bottom: -11px; transform: translateX(-50%); white-space: nowrap;
  padding: 2px 9px; border-radius: 999px; background: #0d0807; border: 1px solid #ffffff2a;
  font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; font-variant-numeric: tabular-nums;
}
.badge.allin { background: var(--chip-red); border-color: transparent; color: #fff; }
.badge.win { background: var(--win); border-color: transparent; color: var(--ink); }
.badge.thinking { display: flex; gap: 3px; padding: 5px 9px; }
.badge.thinking i { width: 4px; height: 4px; border-radius: 50%; background: var(--brass); animation: blink 1s infinite both; }
.badge.thinking i:nth-child(2) { animation-delay: .15s; }
.badge.thinking i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
.hand-label {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 15px; white-space: nowrap; z-index: 5;
  padding: 2px 8px; border-radius: 6px; background: #0d0807d9; color: var(--ivory-2); font-size: 11px;
}
.seat.me .hand-label { top: auto; bottom: 8px; left: 100%; transform: none; margin: 0 0 0 10px; }
.portrait .seat.me .hand-label { left: 50%; bottom: auto; top: 100%; transform: translateX(-50%); margin: 12px 0 0; }
/* All-in equity shown on each player whose cards are face up */
.equity {
  position: absolute; top: -8px; left: -10px; z-index: 6; padding: 2px 7px; border-radius: 8px; font-size: 12px; font-weight: 700;
  font-variant-numeric: tabular-nums; background: #0d0807; border: 1px solid #7cc49599; color: var(--good);
}
.seat.acting .plate { border-color: var(--brass); box-shadow: 0 0 0 1px var(--brass), 0 0 26px #d4ab5e55, 0 10px 22px -8px #000d; }
.seat.folded .plate { background: linear-gradient(#2d1e1999, #190f0c99); border-color: #ffffff0d; }
.seat.folded .plate > :not(.chipstack), .seat.folded .chipstack .piles { opacity: .55; }
.seat.folded .hole { opacity: .3; }
.seat.away .plate > :not(.chipstack) { opacity: .5; }
.seat.winner .plate { border-color: var(--win); box-shadow: 0 0 0 2px var(--win), 0 0 40px #ecc87466; }
.clock-bar { position: absolute; left: 10px; right: 10px; bottom: 3px; height: 3px; border-radius: 3px; background: #ffffff1a; overflow: hidden; }
.clock-bar i { position: absolute; inset: 0; background: var(--brass); transform-origin: left center; transition: transform .1s linear; }
.clock-bar.low i { background: #e0565b; }
.empty-seat {
  position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%); z-index: 2;
  width: clamp(54px, 8cqw, 76px); aspect-ratio: 1; border-radius: 50%; border: 1.5px dashed #d4ab5e66; background: #0000004d;
  color: var(--ivory-2); font-size: clamp(9px, 1.1cqw, 11px); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; cursor: pointer;
}
.empty-seat:hover:not(:disabled) { border-color: var(--brass); color: var(--brass); background: #d4ab5e14; }
.empty-seat:disabled { cursor: default; opacity: .35; }
.portrait .empty-seat { width: clamp(48px, 15cqw, 64px); }

.bet {
  position: absolute; left: var(--bx); top: var(--by); transform: translate(-50%, -50%); z-index: 1;
  display: flex; align-items: center; gap: 6px; padding: 2px 9px 2px 3px; border-radius: 999px; background: #00000047;
  font-weight: 600; font-variant-numeric: tabular-nums; font-size: clamp(11px, 1.3cqw, 14px); white-space: nowrap; animation: slide .3s ease both;
}
@keyframes slide { from { opacity: 0; scale: .7; } to { opacity: 1; scale: 1; } }
.chip {
  --c: var(--chip-red); flex: none; width: 18px; height: 18px; border-radius: 50%;
  background: radial-gradient(circle, var(--c) 0 40%, #f5efe2 41% 46%, var(--c) 47% 62%, transparent 63%), repeating-conic-gradient(#f5efe2 0 14deg, var(--c) 14deg 45deg);
  box-shadow: 0 0 0 1px #0009, 0 2px 3px #0009;
}
.chip.blue { --c: var(--chip-blue); }
.chip.black { --c: var(--chip-black); }
.chip.brass { --c: #a8822f; }

.overlay { position: absolute; inset: 0; z-index: 10; display: grid; place-items: center; padding: 16px; background: #0d0807b8; backdrop-filter: blur(3px); border-radius: 28px; }
.overlay .panel { text-align: center; max-width: 360px; display: grid; gap: 10px; justify-items: center; }
.overlay h2 { font-family: var(--display); font-weight: 400; font-size: 30px; color: var(--brass); }

/* Controls */
.controls { display: grid; gap: 12px; padding: 14px 16px; margin-top: 6px; border-radius: 16px; background: linear-gradient(#24171380, #1a110ecc); border: 1px solid var(--line); }
.status { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 14px; min-height: 1.5em; color: var(--muted); }
.status b { color: var(--text); font-weight: 600; }
.clock { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); }
.clock.low { color: #ff7a7e; animation: blink 1s infinite; }
.actions { display: grid; grid-template-columns: 1fr 1.25fr 1.45fr; gap: 10px; }
.actions .btn { min-height: 50px; font-size: 16px; font-variant-numeric: tabular-nums; }
.actions .fold { background: transparent; border-color: #ffffff33; color: var(--text); }
kbd { font: 600 10px/1 var(--sans); padding: 3px 5px; border: 1px solid currentColor; border-radius: 4px; opacity: .5; }
@media (hover: none) { kbd { display: none; } }
.sizing { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; }
.presets button { background: #ffffff0d; border: 1px solid #ffffff21; border-radius: 999px; padding: 6px 11px; font-size: 12.5px; cursor: pointer; }
.presets button:hover:not(:disabled) { border-color: var(--brass-dim); }
.presets button:disabled { opacity: .35; cursor: not-allowed; }
.slider-row { display: flex; align-items: center; gap: 10px; flex: 1 1 220px; min-width: 0; }
.slider-row input[type="range"] { flex: 1; min-width: 0; accent-color: var(--brass); }
.slider-row input[type="number"] { width: 110px; padding: 8px 10px; border-radius: 8px; border: 1px solid #ffffff2a; background: #0d0807; font-weight: 600; font-variant-numeric: tabular-nums; }
.table-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
@media (max-width: 520px) {
  .actions { grid-template-columns: 1fr 1fr; }
  .actions .raise { grid-column: 1 / -1; order: -1; }
}

/* Live odds panel */
.odds-panel { display: grid; gap: 10px; padding: 14px 16px; border-radius: 16px; border: 1px solid #7cc49540; background: linear-gradient(#162019cc, #111612cc); }
.odds-panel .hand-now { font-size: 17px; font-weight: 700; }
.odds-meter { position: relative; height: 10px; border-radius: 999px; background: #ffffff14; overflow: hidden; }
.odds-meter i { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: linear-gradient(90deg, #4f8f66, #7cc495); transition: width .4s ease; }
.odds-meter .avg { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ivory-2); opacity: .6; }
.odds-figs { display: flex; flex-wrap: wrap; gap: 6px 18px; font-variant-numeric: tabular-nums; color: var(--ivory-2); font-size: 14px; }
.odds-figs b { color: var(--text); font-size: 20px; }
.outs { display: flex; flex-wrap: wrap; gap: 6px; }
.odds-panel .eyebrow + .outlook { margin-top: -4px; }
/* After-the-hand review */
.seg.mini { display: inline-grid; }
.seg.mini label { padding: 6px 10px; }
.seg.mini label b { font-size: 13px; }
.outlook { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.outlook li { display: grid; grid-template-columns: minmax(0, 8.5em) minmax(40px, 1fr) 3.2em; align-items: center; gap: 4px 10px; }
.outlook li:has(.sub) { grid-template-columns: minmax(0, 7.6em) minmax(44px, 1fr) 2.9em 4.9em; gap: 4px 8px; }
.outlook .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.outlook .bar { position: relative; height: 6px; border-radius: 999px; background: #ffffff12; overflow: hidden; }
.outlook .bar i { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: #7cc495; }
.outlook .pc { text-align: right; font-weight: 600; color: var(--text); }
.outlook .sub { color: var(--muted); font-size: 12.5px; }
.outlook .other .nm, .outlook .other .pc { color: var(--muted); font-weight: 400; }
.outlook .other .bar i { background: #ffffff40; }
.outs .pill { color: var(--good); border-color: #7cc49555; }

/* Side column: hand history and table chat */
.side-col { display: grid; gap: 14px; }
@media (min-width: 1180px) { .side-col { position: sticky; top: calc(var(--top-h) + 16px); } }
.history { display: flex; flex-direction: column; max-height: 360px; padding: 14px 14px 10px; border-radius: 16px; background: #00000030; border: 1px solid var(--line); }
@media (min-width: 1180px) { .history { max-height: 44vh; } }
.history ol { list-style: none; margin: 0; padding: 0 4px 0 0; overflow-y: auto; flex: 1; font-size: 13px; line-height: 1.5; }
.history li.hand { margin-top: 12px; padding-top: 8px; border-top: 1px solid var(--line); color: var(--brass); font-weight: 600; }
.history li.hand:first-child { margin-top: 0; border-top: 0; padding-top: 0; }
.history li.street { margin-top: 4px; color: var(--muted); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; }
.history li.win { color: var(--win); }
.history li.note { color: var(--muted); font-style: italic; }
.table-chat { display: flex; flex-direction: column; max-height: 300px; padding: 12px; border-radius: 16px; background: #00000030; border: 1px solid var(--line); }
.table-chat ol { list-style: none; margin: 0 0 8px; padding: 0; overflow-y: auto; flex: 1; font-size: 13.5px; display: grid; gap: 4px; align-content: start; min-height: 60px; }
.table-chat li b { color: var(--brass); margin-right: 6px; }
.table-chat form { display: flex; gap: 6px; }
.table-chat .input { padding: 8px 10px; font-size: 14px; }

/* Speech bubbles for table chat */
.say {
  position: absolute; left: 50%; bottom: calc(100% - var(--cw) * .75); transform: translateX(-50%); z-index: 8;
  width: max-content; max-width: 190px; padding: 6px 11px; border-radius: 12px; background: var(--ivory); color: var(--ink);
  font: 600 13px/1.3 var(--sans); text-align: center; overflow-wrap: anywhere; box-shadow: 0 8px 18px -6px #000c; pointer-events: none;
}
.say::after { content: ""; position: absolute; left: 50%; top: calc(100% - 1px); transform: translateX(-50%); width: 14px; height: 8px;
  background: var(--ivory); clip-path: polygon(0 0, 100% 0, 50% 100%); } /* overlaps the bubble by a pixel, so no seam shows */
.seat.me .say { bottom: calc(100% + 8px); }
.say.pop { animation: say-pop .3s cubic-bezier(.2, .9, .3, 1.3) both; }
@keyframes say-pop { from { opacity: 0; transform: translateX(-50%) translateY(6px) scale(.7); } to { opacity: 1; transform: translateX(-50%); } }

/* Side column: chat and hand history tabs */
.side-tabs { display: grid; gap: 10px; padding: 12px; border-radius: 16px; background: #00000030; border: 1px solid var(--line); }
.side-tabs .tabs { justify-self: start; }
.side-tabs .count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 4px; border-radius: 999px; background: var(--chip-red); color: #fff; font-size: 11px; font-weight: 700; }
.side-tabs .pane { min-height: 0; }
.history-pane ol { list-style: none; margin: 0; padding: 0 4px 0 0; max-height: 340px; overflow-y: auto; font-size: 13px; line-height: 1.5; }
@media (min-width: 1180px) { .history-pane ol, .gchat-list { max-height: 38vh; } }
.history-pane li.hand { margin-top: 12px; padding-top: 8px; border-top: 1px solid var(--line); color: var(--brass); font-weight: 600; }
.history-pane li.hand:first-child { margin-top: 0; border-top: 0; padding-top: 0; }
.history-pane li.street { margin-top: 4px; color: var(--muted); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; }
.history-pane li.win { color: var(--win); }
.history-pane li.note { color: var(--muted); font-style: italic; }
.gchat { display: grid; gap: 8px; }
.gchat-list { list-style: none; margin: 0; padding: 0 4px 0 0; display: grid; gap: 8px; align-content: start; max-height: 320px; min-height: 120px; overflow-y: auto; font-size: 13.5px; }
.gchat-list li { display: flex; gap: 8px; align-items: flex-start; }
.gchat-list li > div { display: grid; min-width: 0; }
.gchat-list li b { font-size: 12px; color: var(--brass); }
.gchat-list li span { overflow-wrap: anywhere; }
.gchat-list li.mine b { color: var(--good); }
.gchat-list li.sys { color: var(--muted); font-style: italic; font-size: 12.5px; }
.gchat-list .gchat-empty { color: var(--muted); font-size: 13px; }
.gchat-quick { display: flex; flex-wrap: wrap; gap: 5px; }
.gchat-quick button { padding: 4px 9px; border-radius: 999px; border: 1px solid #ffffff21; background: #ffffff0d; font-size: 12.5px; cursor: pointer; }
.gchat-quick button:hover { border-color: var(--brass-dim); }
.gchat-form { display: flex; gap: 6px; }
.gchat-form .input { padding: 8px 10px; font-size: 14px; }

/* ---------- Game lobby, standings and results ---------- */
.lobby-layout { display: grid; gap: 18px; align-items: start; }
@media (min-width: 1100px) { .lobby-layout { grid-template-columns: minmax(0, 1fr) 340px; } }
.lobby-layout > .panel:first-child { display: grid; gap: 16px; }
.lobby-layout > .panel:first-child .panel-head { margin-bottom: 0; }
.lobby-layout p { margin: 0; }
.lobby-facts { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); font-size: 13.5px; }
.lobby-facts b { color: var(--ivory-2); font-weight: 600; }
.lobby-default { align-items: end; }
.chip-input { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.chip-input .input { width: 112px; padding: 7px 10px; text-align: right; font-variant-numeric: tabular-nums; }
.lobby-actions { padding-top: 6px; border-top: 1px solid var(--line); }
.standings h2 { font-size: 15px; }
.standings .panel-head { margin-bottom: 8px; }
.standings-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13.5px; }
.standings-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto 44px; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 8px; }
.standings-list li.me { background: #d4ab5e14; }
.standings-list li.out { opacity: .55; }
.standings-list .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.standings-list small { display: block; font-size: 11.5px; color: var(--muted); }
.standings-list .ch { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.standings-list .ch small.good { color: var(--good); }
.standings-list .ch small.bad { color: var(--bad); }
.standings-list .elo { text-align: right; color: var(--brass); font-variant-numeric: tabular-nums; }
.place-badge { display: inline-grid; place-items: center; min-width: 40px; padding: 3px 8px; border-radius: 999px; font-size: 12.5px; font-weight: 700; border: 1px solid var(--line-2); color: var(--ivory-2); }
.place-badge.p1 { background: var(--brass); border-color: transparent; color: #1f1613; }
.place-badge.p2 { border-color: #d9d4ca88; }
.place-badge.p3 { border-color: #c48a5a88; }
.result-line { margin: 0 0 14px; font-size: 15px; }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th { text-align: left; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.data-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table tr.me td { background: #d4ab5e10; }
.hand-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13.5px; max-height: 360px; overflow-y: auto; }
.hand-list li { display: flex; gap: 10px; }
.hand-list b { color: var(--brass); min-width: 34px; }
/* Live odds without Poncler Pro */
.seg label.locked { opacity: .6; cursor: pointer; }
.seg label.locked b { display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.seg label.locked svg { width: 12px; height: 12px; }

/* ---------- Pro HUD on opponents ---------- */
.hud-read { --hud-c: var(--muted); }
.t-aggressive { --hud-c: #e0565b; }
.t-wild { --hud-c: #ff8a3d; }
.t-passive { --hud-c: #6fa8dc; }
.hud-read b { color: var(--hud-c); }
.hud-read { display: grid; gap: 4px; padding: 12px 14px; margin-bottom: 14px; border-radius: 12px; background: #ffffff08; border-left: 3px solid var(--hud-c); }
.hud-read b { font-size: 18px; }
.hud-table th small { display: block; font-size: 10.5px; letter-spacing: 0; text-transform: none; font-weight: 400; }
.hud-table tr.grp td { padding-top: 14px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--brass); border-bottom-color: var(--line-2); }
.locked-btn { opacity: .7; }
.locked-btn svg { width: 13px; height: 13px; }

/* ---------- Paused by the host ---------- */
.waiting.paused { padding: 10px 18px; border-radius: 12px; background: #0d0807d9; border: 1px solid var(--brass); color: var(--brass); font-size: clamp(14px, 1.9cqw, 19px); letter-spacing: .04em; }
.table-wrap:has(.waiting.paused) .seat { filter: saturate(.6); }

/* ---------- Minimized game while you browse other pages ---------- */
.mini-games { position: fixed; z-index: 150; right: 24px; bottom: 24px; display: grid; gap: 10px; align-content: end; width: min(300px, calc(100vw - 32px)); }
/* Toasts move aside so they never cover a game window. */
@media (min-width: 960px) { body:has(.mini-games:not([hidden])) #toasts { right: 340px; } }
@media (max-width: 959px) { body:has(.mini-games:not([hidden])) #toasts { bottom: auto; top: calc(var(--top-h) + 8px); } }
.mini-games[hidden] { display: none; }
.mini-game {
  display: grid; gap: 10px; padding: 12px 12px 14px; border-radius: 16px; background: linear-gradient(#2d1e19f7, #190f0cf7);
  border: 1px solid #d4ab5e55; box-shadow: 0 18px 40px -12px #000; backdrop-filter: blur(6px);
  animation: mg-in .25s ease both;
}
@keyframes mg-in { from { opacity: 0; transform: translateY(-8px); } }
.mg-head { display: flex; align-items: center; gap: 8px; }
.mg-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; color: inherit; text-decoration: none; }
.mg-title svg { flex: none; width: 18px; height: 18px; color: var(--brass); }
.mg-title span { display: grid; min-width: 0; }
.mg-title b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mg-title small { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mg-collapse { width: 30px; height: 30px; font-size: 18px; line-height: 1; }
.mini-game.collapsed { padding-block: 8px; }
.mini-game.collapsed .mg-body { display: none; }
.mg-body { display: grid; gap: 9px; }
.mg-cards { display: flex; align-items: center; gap: 10px; --cw: 30px; }
.mg-cards .card { animation: none; }
.mg-hole, .mg-board { display: flex; gap: 3px; }
.mg-hole .card + .card { margin-left: -6px; }
.mg-board { --cw: 24px; }
.mg-board i { width: 24px; height: 33.6px; border-radius: 3px; border: 1px dashed #ffffff22; }
.mg-status { font-size: 13.5px; color: var(--ivory-2); }
.mg-clock { position: relative; height: 4px; border-radius: 4px; background: #ffffff1a; overflow: hidden; }
.mg-clock i { position: absolute; inset: 0; background: var(--brass); transform-origin: left center; transition: transform .2s linear; }
.mg-clock.low i { background: #e0565b; }
.mg-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.mg-actions .btn { flex: 1; justify-content: center; }
.mini-game.paused .mg-status { color: var(--brass); }
/* Your turn: a pulsing brass glow you can't miss */
.mini-game.turn { border-color: var(--brass); animation: mg-in .25s ease both, mg-flash 1.1s ease-in-out infinite; }
.mini-game.turn .mg-status { color: var(--brass); font-weight: 700; font-size: 15px; }
.mini-game.turn .mg-title svg { animation: blink .9s infinite both; }
@keyframes mg-flash {
  0%, 100% { box-shadow: 0 0 0 2px var(--brass), 0 0 22px #d4ab5e55, 0 18px 40px -12px #000; transform: scale(1); }
  50% { box-shadow: 0 0 0 4px #ecc874, 0 0 46px #ecc874aa, 0 18px 40px -12px #000; transform: scale(1.025); }
}
@media (prefers-reduced-motion: reduce) {
  .mini-game.turn { animation: none; box-shadow: 0 0 0 3px var(--brass), 0 18px 40px -12px #000; }
  .mini-game.turn .mg-title svg { animation: none; }
}
@media (max-width: 959px) { .mini-games { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); right: 12px; width: min(300px, calc(100vw - 24px)); } }
.mini-games, .mini-game .card { -webkit-user-select: none; user-select: none; }

/* ---------- Live odds after the hand ---------- */
.odds-panel.stale { border-color: #ffffff22; background: linear-gradient(#1b1a17cc, #121110cc); }
.odds-panel.stale .odds-meter i { background: linear-gradient(90deg, #6d7f72, #9fb5a6); }

/* ---------- After-hand review carousel ---------- */
.odds-panel.reviewing { gap: 8px; }
.rv-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; overscroll-behavior-x: contain; scrollbar-width: none; border-radius: 14px; }
.rv-track::-webkit-scrollbar { display: none; }
.rv-track:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.rv-slide {
  flex: 0 0 100%; scroll-snap-align: start; display: grid; gap: 9px; align-content: start; padding: 12px 14px 14px; border-radius: 14px;
  background: #00000030; border: 1px solid #ffffff14; border-top: 3px solid #ffffff2a; min-width: 0;
}
.rv-slide.good { border-top-color: #7cc495; }
.rv-slide.bad { border-top-color: #ef7b80; }
.rv-slide.warn { border-top-color: #e8b04f; }
.rv-slide.final { border-top-color: var(--brass); }
.rv-cards { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; --cw: 34px; }
.rv-cards .card { animation: none; }
.rv-hole, .rv-board { display: flex; gap: 3px; }
.rv-hole .card + .card { margin-left: -8px; }
.rv-board { --cw: 28px; }
.rv-note { font-size: 12px; margin: -4px 0 0; }
.odds-meter.short i { background: linear-gradient(90deg, #a5454a, #ef7b80); }
.rv-verdict { display: grid; gap: 2px; padding-top: 8px; border-top: 1px solid #ffffff14; font-size: 13.5px; }
.rv-verdict p { margin: 0; color: var(--ivory-2); }
.rv-slide.good .rv-verdict b { color: var(--good); }
.rv-slide.bad .rv-verdict b { color: var(--bad); }
.rv-slide.warn .rv-verdict b { color: var(--warn); }
.rv-nav { display: flex; align-items: center; justify-content: center; gap: 10px; }
.rv-nav .icon-btn { width: 32px; height: 32px; font-size: 20px; line-height: 1; }
.rv-nav .icon-btn:disabled { opacity: .35; cursor: default; }
.rv-dots { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.rv-dots button { width: 8px; height: 8px; padding: 0; border-radius: 50%; border: 0; background: #ffffff33; cursor: pointer; transition: width .2s ease, background .2s ease; }
.rv-dots button[aria-current] { width: 20px; border-radius: 4px; background: var(--brass); }
@media (prefers-reduced-motion: reduce) { .rv-track { scroll-behavior: auto; } }

/* HUD figures: blue for tight or passive, ivory in between, red for loose or aggressive */
.n-lo { color: #7fb6e8; }
.n-mid { color: var(--ivory-2); }
.n-hi { color: #ff8a80; }
.n-none { color: var(--muted); }

/* ---------- Seat extras: flag and lifetime Elo in competitive games ---------- */
.row1 .flag { width: 15px; height: 11px; }
.seat-elo { font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 6px; color: var(--brass); border: 1px solid #d4ab5e55; font-variant-numeric: tabular-nums; }
.standings-list .flag { width: 13px; height: 10px; }

/* ---------- Replays ---------- */
.replay-layout { display: grid; gap: 18px; align-items: start; }
@media (min-width: 1100px) { .replay-layout { grid-template-columns: 340px minmax(0, 1fr); } .replay-list { position: sticky; top: calc(var(--top-h) + 16px); } }
.replay-list { display: grid; gap: 12px; }
.rp-items { display: grid; gap: 4px; max-height: 64vh; overflow-y: auto; margin: 0 -8px; padding: 0 8px; }
.rp-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 10px;
  border: 1px solid transparent; background: none; color: inherit; text-align: left; cursor: pointer; font: inherit; }
.rp-item:hover { background: #ffffff08; }
.rp-item.on { background: #d4ab5e14; border-color: #d4ab5e55; }
.rp-cards { font-size: 15px; white-space: nowrap; }
.rp-main { display: grid; min-width: 0; }
.rp-main b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-main small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-main .rp-board { color: var(--ivory-2); }
.replay-view { display: grid; gap: 12px; min-width: 0; }
.rp-head h2 { font-size: 19px; }
.rp-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-radius: 14px; background: #ffffff06; border: 1px solid var(--line); }
.rp-controls .icon-btn { width: 36px; height: 36px; font-size: 14px; }
.rp-streets { display: flex; gap: 6px; flex-wrap: wrap; }
.rp-streets .pill { cursor: pointer; background: none; font: inherit; font-size: 12px; font-weight: 600; }
.rp-streets .pill.on { background: var(--brass); color: var(--ink); border-color: transparent; }
.rp-bottom { display: grid; gap: 12px; align-items: start; }
@media (min-width: 1280px) { .rp-bottom { grid-template-columns: minmax(0, 1fr) 320px; } }
.rp-steps { position: relative; list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: 260px; overflow-y: auto; border-radius: 12px; border: 1px solid var(--line); padding: 6px; }
.rp-steps button { width: 100%; text-align: left; padding: 6px 10px; border-radius: 8px; border: 0; background: none; color: var(--ivory-2); font: inherit; font-size: 13.5px; cursor: pointer; }
.rp-steps button:hover { background: #ffffff08; }
.rp-steps li.on button { background: #d4ab5e1f; color: var(--text); }
.rp-steps .muted { display: inline-block; min-width: 56px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.rp-link { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; margin-left: auto; white-space: nowrap; }
.rp-link svg { width: 14px; height: 14px; }
.hand-list li { align-items: baseline; }

/* ---------- HUD inside the name plate (Pro) ---------- */
/* Left: VPIP, right: aggression. Blue tight/passive, green normal, yellow loose/aggressive, red maniac. */
.plate .hud[hidden] { display: none; }
.plate .hud { position: relative; display: flex; align-items: stretch; gap: 2px; margin: 5px -4px 0; height: 19px; }
.hud-seg { flex: 1; display: flex; align-items: center; justify-content: center; gap: 3px; min-width: 0;
  font: 800 12px/1 var(--sans); font-variant-numeric: tabular-nums; color: #10120f; background: #ffffff1f; }
.hud-seg:first-child { border-radius: 6px 0 0 6px; }
.hud-seg:last-child { border-radius: 0 6px 6px 0; }
.hud-seg small { font-size: 7.5px; font-weight: 800; letter-spacing: .06em; opacity: .7; }
.hud-seg.b0 { background: #5b9bd5; }
.hud-seg.b1 { background: #5fb878; }
.hud-seg.b2 { background: #e8c547; }
.hud-seg.b3 { background: #e0565b; color: #fff; }
.hud-seg.bx { color: var(--muted); }
.hud.few .hud-seg { opacity: .7; background-image: repeating-linear-gradient(135deg, #ffffff22 0 4px, transparent 4px 8px); }
/* The run icon: a round badge sitting on the seam between the two halves */
.hud.has-run .hud-seg:first-child { justify-content: flex-start; padding: 0 15px 0 6px; }
.hud.has-run .hud-seg:last-child { justify-content: flex-end; padding: 0 6px 0 15px; }
.hud.has-run .hud-seg small { display: none; }
.hud-run { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 1; display: grid; place-items: center;
  width: 25px; height: 25px; border-radius: 50%; background: #0d0807; box-shadow: 0 0 0 2px #2d1e19, 0 2px 6px #000a; }
.hud-run svg { width: 15px; height: 15px; }
.run-cold { color: #9fd4ff; }
.run-hot { color: #ff8a3d; }
.run-blaze { color: #ffd23f; }
.hud-run.run-blaze, .hud-run.run-hot { box-shadow: 0 0 0 2px #2d1e19, 0 0 10px currentColor; }
.hud-run.run-cold { box-shadow: 0 0 0 2px #2d1e19, 0 0 8px #9fd4ff88; }
.many .hud-seg small, .portrait .hud-seg small { display: none; }
.plate.clickable { cursor: pointer; }
.plate.clickable:hover { border-color: #d4ab5e88; }
.plate.clickable:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- Player card pop-up (compact, tabbed) ---------- */
.pc-modal .modal-body { gap: 12px; }
.player-card { display: grid; gap: 12px; }
.pc-facts { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.pc-facts div { display: grid; padding: 5px 10px; border-radius: 9px; background: #ffffff08; border: 1px solid var(--line); }
.pc-facts small { font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.pc-facts b { font-size: 14px; font-variant-numeric: tabular-nums; }
.pc-style { display: grid; gap: 10px; }
.pc-bands { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.band { display: grid; gap: 1px; padding: 8px 12px; border-radius: 10px; color: #10120f; background: #ffffff1f; }
.band small { font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; opacity: .75; }
.band b { font-size: 20px; font-variant-numeric: tabular-nums; }
.band em { font-style: normal; font-weight: 700; font-size: 12.5px; }
.band.b0 { background: #5b9bd5; } .band.b1 { background: #5fb878; } .band.b2 { background: #e8c547; } .band.b3 { background: #e0565b; color: #fff; }
.band.bx { color: var(--muted); }
.run-line { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
.run-line svg { width: 18px; height: 18px; }
.pc-foot { margin: 0; font-size: 12px; }
.pc-upsell { display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 12px 14px; border-radius: 12px; background: #d4ab5e12; border: 1px solid #d4ab5e44; font-size: 13.5px; }
.pc-upsell svg { flex: none; width: 16px; height: 16px; color: var(--brass); margin-top: 2px; }

/* ---------- Hand rankings ---------- */
.rank-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.rank-list li { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; }
.rank-list li:nth-child(odd) { background: #ffffff06; }
.rank-list .n { color: var(--brass); font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.rank-list .t { display: grid; min-width: 0; }
.rank-list .t small { color: var(--muted); font-size: 12.5px; }
.rank-list .ex { font-size: 15px; white-space: nowrap; letter-spacing: 1px; }
.rank-tips { display: grid; gap: 6px; margin-top: 12px; font-size: 13.5px; color: var(--ivory-2); }
.rank-tips p { margin: 0; }

/* Hand rankings with real cards */
.rank-list .ex { display: flex; gap: 3px; --cw: 30px; letter-spacing: 0; }
.rank-list .ex .card { animation: none; }
@media (max-width: 560px) {
  .rank-list li { grid-template-columns: 24px minmax(0, 1fr); }
  .rank-list .ex { grid-column: 2; --cw: 26px; }
}
@media (min-width: 900px) { .rank-list { display: block; columns: 2; column-gap: 16px; } .rank-list li { break-inside: avoid; margin-bottom: 4px; } }

/* ---------- Show my cards, and a player's hands in this game ---------- */
.ph-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ph-no { color: var(--brass); font-weight: 700; font-variant-numeric: tabular-nums; font-size: 13px; }
.ph-cards { display: flex; --cw: 24px; }
.ph-cards .card { animation: none; }
.ph-cards .card + .card { margin-left: -6px; }
.ph-what { display: grid; min-width: 0; font-size: 13.5px; }
.ph-what small { color: var(--muted); font-size: 12px; }
.ph-what .ph-showed { color: var(--brass); }

/* ---------- Best possible hands on the river (live odds and review) ---------- */
.best-hands { display: grid; gap: 6px; padding: 10px 12px; border-radius: 12px; background: #00000038; border: 1px solid #d4ab5e44; }
.best-hands ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.best-hands li { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 8px; font-size: 13px; padding: 2px 4px; border-radius: 6px; }
.best-hands li.mine { background: #7cc4951f; }
.best-hands .bh-rank { font-size: 11px; font-weight: 700; color: var(--muted); }
.best-hands li:first-child .bh-rank { color: var(--brass); }
.best-hands .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.best-hands .nm .pill { font-size: 10px; padding: 0 6px; }
.best-hands .bar { height: 6px; border-radius: 6px; background: #ffffff14; overflow: hidden; }
.best-hands .bar i { display: block; height: 100%; background: linear-gradient(90deg, #a5454a, #ef7b80); }
.best-hands .pc { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.best-hands .bh-who { grid-column: 3 / -1; text-align: right; font-size: 12.5px; color: var(--ivory-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.best-hands .bh-yours { margin: 2px 0 0; font-size: 12.5px; }

/* ---------- Player card carousel: Overview · Hands · Style ---------- */
.pc-nav { display: flex; align-items: center; gap: 8px; }
.pc-nav .icon-btn { width: 32px; height: 32px; font-size: 18px; flex: none; }
.pc-nav .icon-btn:disabled { opacity: .35; cursor: default; }
.pc-pos { flex: 1; display: flex; gap: 4px; padding: 3px; border-radius: 10px; background: #00000033; }
.pc-pos button { flex: 1; padding: 6px 10px; border: 0; border-radius: 8px; background: none; color: var(--muted); font: 600 13px var(--sans); cursor: pointer; }
.pc-pos button[aria-selected="true"] { background: var(--panel-2); color: var(--brass); box-shadow: inset 0 0 0 1px #d4ab5e33; }
.pc-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; overscroll-behavior-x: contain; scrollbar-width: none; height: min(300px, 42vh); }
.pc-track::-webkit-scrollbar { display: none; }
.pc-track:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 10px; }
.pc-slide { flex: 0 0 100%; scroll-snap-align: start; display: grid; gap: 10px; align-content: start; overflow-y: auto; min-width: 0; padding: 2px; }
.pc-slide .hud-read { margin: 0; padding: 9px 12px; }
.pc-slide .hud-read b { font-size: 16px; }
.pc-latest { display: grid; gap: 6px; width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid #d4ab5e44; background: #d4ab5e0d; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.pc-latest:hover { border-color: var(--brass); }
.pc-more { font-size: 12.5px; color: var(--brass); font-weight: 600; }
.ph-row { display: grid; grid-template-columns: 38px auto minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.ph-list li.ph-row { padding: 7px 10px; border-radius: 10px; background: #ffffff06; }
.pc-streets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pc-street { padding: 10px 12px; border-radius: 12px; background: #ffffff08; border: 1px solid var(--line); }
.pc-street h4 { margin: 0 0 6px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--brass); }
.pc-street ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.pc-street li { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.pc-street b { font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .pc-streets { grid-template-columns: 1fr; } }

/* Show my cards: beside your own name plate once the hand is over */

/* Player card header: centred avatar, name and the HUD bar */
.pc-head { display: grid; justify-items: center; gap: 3px; text-align: center; }
.pc-head > .avatar { margin-bottom: 4px; box-shadow: 0 0 0 2px #d4ab5e55, 0 10px 24px -10px #000; }
.pc-name { display: flex; align-items: center; justify-content: center; gap: 7px; flex-wrap: wrap; font-size: 19px; }
.pc-bio { margin: 2px 0 0; max-width: 46ch; font-size: 13px; color: var(--ivory-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-hud { display: flex; align-items: stretch; gap: 2px; position: relative; width: min(280px, 100%); height: 26px; margin-top: 8px; }
.pc-hud .hud-seg { font-size: 14px; }
.pc-hud .hud-seg small { font-size: 9px; }
.pc-hud .hud-run { width: 30px; height: 30px; }
.pc-hud .hud-run svg { width: 18px; height: 18px; }
.pc-slide .run-line { margin-top: -2px; }

/* Each player's chips: piles sorted by colour, with the amount, to the right of the name plate */
.chipstack { position: absolute; left: 100%; top: 50%; transform: translateY(-50%); margin-left: 6px; display: grid; justify-items: center; gap: 2px; pointer-events: none; z-index: 2; cursor: default; }
.piles { display: flex; align-items: flex-end; gap: 3px; padding-bottom: 4px; }
.pile { display: flex; flex-direction: column-reverse; align-items: center; }
/* Each chip is a small cylinder: a striped edge (::after) under a top face with white edge spots.
   Every chip is its own stacking layer, so the one above covers the one below and only its edge shows. */
.c3 {
  --w: clamp(16px, 2.1cqw, 22px); --h: calc(var(--w) * .4);
  --hi: color-mix(in srgb, var(--face) 70%, white); --side: color-mix(in srgb, var(--face) 62%, black);
  position: relative; z-index: 0; display: block; width: var(--w); height: var(--h); border-radius: 50%;
  background:
    radial-gradient(closest-side, var(--hi) 0 30%, var(--face) 32% 62%, transparent 64%),
    repeating-conic-gradient(var(--face) 0 24deg, #f5efe2 24deg 36deg);
  box-shadow: inset 0 0 0 1px #0000004d;
}
.c3::after {
  content: ""; position: absolute; z-index: -1; left: 0; right: 0; top: 50%; height: calc(var(--h) / 2 + 3px);
  border-radius: 0 0 50% 50% / 0 0 100% 100%;
  background:
    linear-gradient(90deg, #00000066, #0000 28%, #ffffff1f 50%, #0000 72%, #00000066),
    repeating-linear-gradient(90deg, var(--side) 0 4px, #e8e2d6 4px 6px);
  box-shadow: 0 2px 2px #0007;
}
/* Each value's colour, changeable on the Design page */
.c3.v5000 { --face: var(--chip-5000, #e07a2e); }
.c3.v1000 { --face: var(--chip-1000, #d4ab5e); }
.c3.v500 { --face: var(--chip-500, #6b3fa0); }
.c3.v100 { --face: var(--chip-100, #2a2a2a); }
.c3.v25 { --face: var(--chip-25, #2e8b57); }
.c3.v5 { --face: var(--chip-5, #b4232c); }
.c3.v1 { --face: var(--chip-1, #e8e2d6); }
.pile .c3:not(:first-child) { margin-bottom: calc(3px - var(--h)); }
/* Seats on the right half of the table keep their chips on the felt side, to the left of the plate */
.seat.right .chipstack { left: auto; right: 100%; margin: 0 6px 0 0; }
.chipstack .stack { font-size: clamp(11px, 1.35cqw, 14px); padding: 1px 6px; border-radius: 6px; background: #0d0807cc; white-space: nowrap; }
.plate-stack { display: none; }
.seat.me .chipstack { margin-left: 8px; }
/* Your seat: Show my cards and the hand name move out past the chips */
.seat.me .hand-label { margin-left: 96px; }
/* Phones (narrow tables): the old look, with the amount inside the plate and no piles */
.portrait .seat:not(.me) .chipstack { display: none; }
.portrait .seat:not(.me) .plate-stack { display: block; }
.portrait .seat.me .hand-label { margin: 12px 0 0; }
.pc-hud.has-run .hud-seg small { display: inline; }

/* Show: a closed eye until your cards are face up, then an open one */
.seat .show-btn { display: inline-flex; align-items: center; gap: 6px; }
.seat .show-btn svg { width: 16px; height: 16px; }
.seat .show-btn.shown, .seat .show-btn.shown:disabled { opacity: 1; background: #0d0807e6; color: var(--good); border-color: #7cc49588; cursor: default; }

/* Show: just above your chip pile, outside the dimming of a folded seat */
.chipstack .show-btn { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); margin-bottom: 4px; pointer-events: auto; z-index: 6;
  white-space: nowrap; padding: 5px 11px; border-radius: 999px; font-size: 12.5px; animation: mg-in .25s ease both; }

/* Bets and the pot use the same 3D chips as the stacks, a little smaller */
.bet { gap: 5px; padding: 2px 9px 2px 5px; }
.bet .piles, .pot .piles { padding-bottom: 3px; gap: 2px; }
.bet .c3 { --w: clamp(12px, 1.55cqw, 17px); }
.pot .c3 { --w: clamp(13px, 1.75cqw, 19px); }
.pot { padding-left: 8px; }

/* The HUD's run badge stays underneath the plate's action badge (Fold, Call, Raise…), the dealer button and the clock */
.plate .hud-run { z-index: 1; }
.plate .badge, .plate .dbtn, .plate .clock-bar { z-index: 3; }

/* Opponents keep their chips inside the name plate: a compact row of small piles with the amount.
   Your own pile stays beside your plate (with Show above it). */
.seat:not(.me) .chipstack { position: static; transform: none; margin: 3px 0 0; display: flex; align-items: flex-end; justify-content: center; gap: 6px; }
.seat:not(.me) .chipstack .piles { padding-bottom: 2px; gap: 2px; }
.seat:not(.me) .chipstack .c3 { --w: clamp(11px, 1.35cqw, 14px); }
.seat:not(.me) .chipstack .stack { padding: 0; background: none; font-size: clamp(12px, 1.5cqw, 15px); }
.seat.folded:not(.me) .chipstack { opacity: .55; }

/* Design page: chip colours */

/* ---------- History: games, each opening into its hands ---------- */
.replay-list { align-content: start; }
.rp-games { display: grid; gap: 6px; max-height: 70vh; overflow-y: auto; margin: 0 -8px; padding: 0 8px; }
.rp-game { border-radius: 12px; border: 1px solid var(--line); background: #ffffff05; }
.rp-game.open { border-color: #d4ab5e55; }
.rp-game-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto 14px; align-items: center; gap: 10px; width: 100%; padding: 10px 12px;
  border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; border-radius: 12px; }
.rp-game-head:hover { background: #ffffff08; }
.rp-result { display: grid; justify-items: end; }
.rp-result small { font-size: 12px; }
.rp-chev { color: var(--muted); font-size: 18px; transition: transform .2s ease; }
.rp-game.open .rp-chev { transform: rotate(90deg); }
.rp-hands { display: grid; gap: 2px; padding: 0 6px 8px; border-top: 1px solid var(--line); }
.rp-loading { margin: 8px 6px; font-size: 13px; }
.rp-locked { display: flex; align-items: center; gap: 8px; margin: 8px 6px 2px; font-size: 13px; color: var(--ivory-2); }
.rp-locked svg { width: 15px; height: 15px; color: var(--brass); flex: none; }
.rp-locked .btn { margin-left: auto; }

/* No cards in front of an opponent (folded, or not dealt in): their bust drops down onto the plate instead of floating */
.seat:not(.me) .bust { transition: bottom .3s ease, opacity .3s ease, filter .3s ease; }
.seat:not(.me):has(> .hole:empty) .bust { bottom: calc(100% - var(--cw) * .8); }

/* ---------- Play page: start cards ---------- */
.start-cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.start-cards .table-card h3 { display: flex; align-items: center; gap: 8px; }
.start-cards .table-card h3 svg { width: 20px; height: 20px; color: var(--brass); }
.quick-card { background: radial-gradient(ellipse 90% 100% at 0% 0%, #3a2a10, #1a110e 70%); border-color: #d4ab5e55; }
.quick-card.highlight { box-shadow: 0 0 0 2px var(--brass), 0 0 30px #d4ab5e44; }
.quick-seats label { padding: 7px 6px; }
.empty-inline { color: var(--muted); font-size: 14px; }

/* ---------- New game dialog: two columns on desktop ---------- */
.new-game { gap: 14px; }
@media (min-width: 860px) { .new-game { grid-template-columns: 1fr 1fr; gap: 0 22px; align-items: start; } }
.ng-col { display: grid; gap: 12px; align-content: start; }
.new-game .seg label { padding-block: 7px; }
.ng-friends { display: grid; gap: 6px; max-height: 130px; overflow-y: auto; }

/* Design page: chip colours as swatches */
.chip-rows { display: grid; gap: 8px; }
.chip-row { display: grid; grid-template-columns: 40px 64px minmax(0, 1fr); align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; background: #ffffff06; border: 1px solid var(--line); }
.chip-row .c3 { --w: 28px; }
.chip-row b { font-variant-numeric: tabular-nums; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #0008; background: var(--s); cursor: pointer; padding: 0;
  box-shadow: inset 0 0 0 2px #ffffff40; transition: transform .12s ease; }
.swatch:hover { transform: scale(1.12); }
.swatch.on { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--brass); }
.swatch:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

/* Stats card designs: a small card for the Design page and the shop */
.sc-preview { position: relative; display: grid; align-content: start; gap: 2px; aspect-ratio: 16 / 9; width: 100%; padding: 10% 9%; border-radius: 12px; overflow: hidden;
  background: radial-gradient(ellipse 120% 110% at 30% 25%, var(--sc-1), var(--sc-2) 50%, var(--sc-3)); color: var(--sc-ink);
  box-shadow: inset 0 0 0 1px #0004, 0 8px 18px -10px #000; text-align: left; }
.sc-preview::before { content: ""; position: absolute; inset: 6%; border: 1px solid color-mix(in srgb, var(--sc-accent) 55%, transparent); border-radius: 8px; pointer-events: none; }
.sc-preview .sc-brand { font-family: Limelight, serif; font-size: 13px; color: var(--sc-accent); }
.sc-preview .sc-label { font-size: 7px; letter-spacing: .18em; opacity: .7; margin-top: 4px; }
.sc-preview .sc-elo { font-size: 22px; line-height: 1; }
.sc-preview .sc-line { height: 2px; margin-top: 6px; width: 70%; background: linear-gradient(90deg, transparent, var(--sc-accent)); border-radius: 2px; }
.sc-preview .sc-figs { display: flex; gap: 6px; margin-top: 6px; }
.sc-preview .sc-figs i { width: 18%; height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--sc-ink) 30%, transparent); }
.sc-preview.orn-foil::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 30%, #ffe9a855 45%, transparent 60%); pointer-events: none; }
.sc-preview.orn-deco::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-conic-gradient(from 0deg at 0 100%, color-mix(in srgb, var(--sc-accent) 40%, transparent) 0 3deg, transparent 3deg 10deg) left bottom / 32% 52% no-repeat,
    repeating-conic-gradient(from 270deg at 100% 100%, color-mix(in srgb, var(--sc-accent) 40%, transparent) 0 3deg, transparent 3deg 10deg) right bottom / 32% 52% no-repeat; }
.sc-preview.orn-marble::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(28deg, transparent 0 18px, #0000000f 18px 19px, transparent 19px 34px), repeating-linear-gradient(-52deg, transparent 0 26px, #00000012 26px 27px, transparent 27px 44px); }
.sc-preview.orn-stars::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle, #fff 0 1px, transparent 1.5px) 0 0 / 23px 19px, radial-gradient(circle, #ffffffaa 0 1px, transparent 1.5px) 11px 9px / 31px 27px; opacity: .7; }
.sc-preview.orn-corners::before { inset: 6%; border-width: 1px; }
.sc-preview.orn-corners::after { content: ""; position: absolute; inset: 10%; pointer-events: none;
  background: linear-gradient(var(--sc-accent), var(--sc-accent)) 0 0 / 14% 2px no-repeat, linear-gradient(var(--sc-accent), var(--sc-accent)) 0 0 / 2px 22% no-repeat,
    linear-gradient(var(--sc-accent), var(--sc-accent)) 100% 0 / 14% 2px no-repeat, linear-gradient(var(--sc-accent), var(--sc-accent)) 100% 0 / 2px 22% no-repeat,
    linear-gradient(var(--sc-accent), var(--sc-accent)) 0 100% / 14% 2px no-repeat, linear-gradient(var(--sc-accent), var(--sc-accent)) 0 100% / 2px 22% no-repeat,
    linear-gradient(var(--sc-accent), var(--sc-accent)) 100% 100% / 14% 2px no-repeat, linear-gradient(var(--sc-accent), var(--sc-accent)) 100% 100% / 2px 22% no-repeat; }
.shop-item .sc-preview { margin-bottom: 4px; }

/* ---------- My stats: the card with its design picker beside it ---------- */
.stats-card-row { display: grid; gap: 18px; align-items: start; }
@media (min-width: 1100px) { .stats-card-row { grid-template-columns: minmax(0, 1fr) 300px; } }
.card-side { display: grid; gap: 10px; }
.card-designs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (min-width: 640px) and (max-width: 1099px) { .card-designs { grid-template-columns: repeat(4, 1fr); } }
.card-design { display: grid; gap: 4px; padding: 4px; border-radius: 12px; border: 1px solid var(--line); background: none; color: inherit; font: 600 12px var(--sans); cursor: pointer; text-align: left; }
.card-design span { display: flex; align-items: center; gap: 4px; padding: 0 2px 2px; }
.card-design span svg { width: 11px; height: 11px; }
.card-design.on { border-color: var(--brass); box-shadow: 0 0 0 1px var(--brass); }
.card-design.locked { opacity: .75; }
.card-design .sc-preview { border-radius: 9px; padding: 8% 8%; }
.card-design .sc-preview .sc-brand { font-size: 9px; }
.card-design .sc-preview .sc-elo { font-size: 13px; }
.card-design .sc-preview .sc-label, .card-design .sc-preview .sc-figs { display: none; }
.invite-list { display: grid; gap: 4px; max-height: 260px; overflow-y: auto; }
.invite-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; cursor: pointer; }
.invite-row:hover { background: #ffffff08; }
.invite-row .grow { display: grid; flex: 1; min-width: 0; }
.invite-row small { font-size: 12px; }

.card-design .cd-name { padding: 0 2px; }
.card-design .cd-price { font-size: 11px; font-weight: 600; color: var(--brass); padding: 0 2px 3px; }
.card-design span { display: block; }
.card-design .cd-price svg { width: 10px; height: 10px; vertical-align: -1px; }

/* ---------- Quick match: searching for players ---------- */
.search-box { display: grid; justify-items: center; gap: 10px; padding: 18px 8px 8px; text-align: center; }
.search-box h2 { margin: 0; font-size: 22px; }
.search-box p { margin: 0; }
.search-radar { position: relative; width: 120px; height: 120px; display: grid; place-items: center; margin-bottom: 6px; }
.search-radar svg { width: 34px; height: 34px; color: var(--brass); position: relative; z-index: 1; }
.search-radar i { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--brass); opacity: 0; animation: radar 2.4s ease-out infinite; }
.search-radar i:nth-child(2) { animation-delay: .8s; }
.search-radar i:nth-child(3) { animation-delay: 1.6s; }
@keyframes radar { 0% { transform: scale(.25); opacity: .9; } 100% { transform: scale(1); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .search-radar i { animation: none; opacity: .35; } .search-radar i:nth-child(2) { transform: scale(.66); } .search-radar i:nth-child(3) { transform: scale(.33); } }
.search-seats { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 6px; }
.search-seat { display: grid; justify-items: center; gap: 4px; width: 64px; }
.search-seat small { font-size: 12px; color: var(--muted); max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-seat.found small { color: var(--text); }
.search-empty { width: 44px; height: 44px; border-radius: 50%; border: 2px dashed #d4ab5e66; animation: blink 1.6s infinite both; }
.search-count { font-size: 15px; }


.pc-avatar { flex: none; display: block; line-height: 0; border-radius: 50%; }
.pc-avatar .avatar { box-shadow: 0 0 0 2px #d4ab5e66; transition: box-shadow .15s ease; }
.pc-avatar:hover .avatar { box-shadow: 0 0 0 2px var(--brass); }


.pc-head .pc-name a { display: inline-flex; align-items: center; gap: 7px; color: var(--text); text-decoration: none; }
.pc-head .pc-name a:hover b { text-decoration: underline; text-decoration-color: var(--brass); text-underline-offset: 3px; }
.pc-head > .pc-avatar { margin-bottom: 4px; }
.pc-head > .pc-avatar .avatar { box-shadow: 0 0 0 2px #d4ab5e55, 0 10px 24px -10px #000; }

.pc-head > a.pc-avatar { display: block; line-height: 0; border-radius: 50%; margin-bottom: 4px; }
.pc-elo { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; padding: 3px 12px; border-radius: 999px; border: 1px solid #d4ab5e55; color: var(--ivory-2); font-size: 13px; }
.pc-elo svg { width: 15px; height: 15px; color: var(--brass); }
.pc-elo b { color: var(--brass); font-size: 15px; font-variant-numeric: tabular-nums; }

/* ---------- Votes ---------- */
.vote-panel { border-color: #d4ab5e66; box-shadow: 0 0 0 1px #d4ab5e22 inset; }
.vote-panel h2 { display: inline-flex; align-items: center; gap: 8px; }
.vote-panel h2 svg { width: 18px; height: 18px; color: var(--brass); }
.vote-q { margin: 0 0 10px; }
.vote-bar { position: relative; display: flex; height: 10px; border-radius: 6px; background: #ffffff10; overflow: visible; }
.vote-bar i { display: block; height: 100%; transition: width .25s ease; }
.vote-bar i.y { background: var(--good, #5fb27c); border-radius: 6px 0 0 6px; }
.vote-bar i.n { background: var(--bad, #d0605a); margin-left: auto; border-radius: 0 6px 6px 0; }
.vote-bar .need { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--text); border-radius: 1px; }
.vote-count { font-size: 13px; margin: 8px 0 10px; }
.vote-btns .btn { flex: 1; justify-content: center; }
.vote-fields { margin-top: 12px; }

.seat-elo { display: inline-flex; align-items: center; gap: 3px; }
.seat-elo .rank-ic { filter: none; }

/* Rank member cards: metal sheen and the rank's shield */
.sc-preview.orn-rank::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(115deg, transparent 25%, #ffffff3d 46%, transparent 62%); }
.sc-preview .sc-shield { position: absolute; right: 7%; top: 50%; transform: translateY(-50%); width: 42%; opacity: .32; pointer-events: none; }
.sc-preview .sc-shield svg { width: 100%; height: auto; filter: none; }

/* Player pop-up: the friend icon beside the name */
.pc-friend { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--line); color: var(--muted); background: transparent; }
.pc-friend svg { width: 16px; height: 16px; }
.pc-friend.on { color: var(--good); border-color: #7cc49555; }
.pc-friend.add { cursor: pointer; color: var(--brass); border-color: #d4ab5e66; }
.pc-friend.add:hover { background: #d4ab5e1a; }
.pc-street b small { display: block; font-size: 10.5px; font-weight: 500; color: var(--muted); text-align: right; }

/* Side column: chat and hand history, minimized to the message box by default */
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.side-toggle { position: relative; flex: none; }
.side-toggle .count { position: absolute; top: -6px; right: -6px; margin: 0; }
.side-tabs.collapsed { grid-template-columns: minmax(0, 1fr) auto; align-items: center; padding: 8px; }
.side-tabs.collapsed .side-head { order: 2; }
.side-tabs.collapsed .tabs, .side-tabs.collapsed .gchat-list, .side-tabs.collapsed .gchat-quick, .side-tabs.collapsed [data-pane="history"] { display: none; }
.side-tabs.collapsed [data-pane="chat"] { order: 1; min-width: 0; }
.side-tabs.collapsed .gchat { gap: 0; }
/* The side column scrolls inside the window, so an open chat never runs into the odds */
@media (min-width: 1180px) { .side-col { max-height: calc(100vh - var(--top-h) - 32px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; } }

/* Desktop: a running game fits the window. The table scales to the space left by the header and the
   controls; the side column scrolls inside itself. Phones and narrow windows keep the scrolling layout. */
@media (min-width: 1180px) and (min-height: 600px) {
  .game-page:has(.table-layout) { height: calc(100vh - var(--top-h)); padding-block: 14px 14px; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 12px; overflow: hidden; }
  .game-page > [data-body]:has(.table-layout) { min-height: 0; height: 100%; }
  .game-page .table-layout { height: 100%; min-height: 0; align-items: stretch; }
  .game-page .table-layout > [data-table] { display: flex; flex-direction: column; min-height: 0; }
  .game-page .table-wrap { flex: 1 1 auto; min-height: 0; container: fit / size; padding-block: 8px 4px; display: grid; place-items: center; }
  .game-page .table-wrap.with-busts { padding-top: clamp(40px, 6vh, 90px); }
  .game-page .stage { container: table / inline-size; width: min(100cqw, calc(100cqh * 16 / 9)); }
  .game-page .controls { flex: none; }
  .game-page .side-col { position: static; max-height: 100%; min-height: 0; overflow-y: auto; }
}
.best-hands .pc { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.best-hands li:has(.bh-who) { grid-template-columns: 36px minmax(0, 1fr) auto; }

/* Desktop: the side column fills the height; an open chat takes the space left and only its messages scroll */
@media (min-width: 1180px) and (min-height: 600px) {
  .game-page .side-col { display: flex; flex-direction: column; gap: 12px; height: 100%; max-height: none; overflow: hidden; }
  .game-page .side-col > * { flex: none; }
  .game-page .side-col > .odds-panel, .game-page .side-col > .standings, .game-page .side-col > .vote-panel { flex: 0 1 auto; min-height: 0; overflow-y: auto; }
  .game-page .side-col > .standings { min-height: 90px; }
  .game-page .side-col > .side-tabs { margin-top: auto; }
  .game-page .side-col > .side-tabs:not(.collapsed) { flex: 1 1 0; min-height: 230px; display: flex; flex-direction: column; }
  .game-page .side-tabs:not(.collapsed) > .pane:not([hidden]) { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .game-page .side-tabs:not(.collapsed) .gchat { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .game-page .side-tabs:not(.collapsed) .gchat-list, .game-page .side-tabs:not(.collapsed) .history-pane ol { flex: 1; min-height: 0; max-height: none; }
}
/* Sheets and their buttons exist for phones only */
.m-only, .sheet-head, .odds-empty { display: none; }

/* Phones and small tablets: during a game there's no header or bottom menu; the game fits the screen, and
   Chat, Hand history and Odds open as sheets */
@media (max-width: 959px) {
  .m-only { display: inline-flex; }
  .m-only .count { position: absolute; top: -6px; right: -6px; }
  .tool-btn.m-only { position: relative; }
  body.in-game .top, body.in-game .tabbar { display: none; }
  body.in-game #view { min-height: 0; }
  .game-page:has(.table-layout) { height: 100dvh; padding: calc(10px + env(safe-area-inset-top, 0px)) 10px calc(10px + env(safe-area-inset-bottom, 0px));
    display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 8px; overflow: hidden; }
  .game-page > [data-body]:has(.table-layout) { min-height: 0; height: 100%; }
  .game-page:has(.table-layout) .table-head { flex-wrap: nowrap; gap: 8px; }
  .game-page:has(.table-layout) .table-head > .row { min-width: 0; gap: 8px !important; }
  .game-page:has(.table-layout) .table-head h1 { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .game-page:has(.table-layout) .table-head .sub { display: none; }
  .game-page:has(.table-layout) .table-head [data-back] span, .game-page:has(.table-layout) .table-head a.btn span { display: none; }
  .game-page:has(.table-layout) .table-tools { flex-wrap: nowrap; gap: 5px; }
  .game-page:has(.table-layout) .table-tools .tool-btn span:not(.count) { display: none; }
  .game-page:has(.table-layout) .table-tools .tool-btn { padding-inline: 9px; }
  .game-page .table-layout { height: 100%; min-height: 0; display: flex; flex-direction: column; }
  .game-page .table-layout > [data-table] { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .game-page .table-wrap { flex: 1 1 auto; min-height: 0; container: fit / size; padding-block: 6px 2px; display: grid; place-items: center; }
  .game-page .table-wrap.with-busts { padding-top: clamp(30px, 5vh, 60px); }
  .game-page .stage { container: table / inline-size; width: min(100cqw, calc(100cqh * 16 / 9)); }
  .game-page .stage.portrait { width: min(100cqw, calc(100cqh * 3 / 4.4)); }
  .game-page .controls { flex: none; padding: 10px 12px; gap: 8px; }
  .game-page .side-col { display: none; }
  /* The sheet: the side column, full screen, showing one thing */
  .game-page[data-sheet] .side-col { display: flex; flex-direction: column; gap: 12px; position: fixed; inset: 0; z-index: 70; padding: calc(12px + env(safe-area-inset-top, 0px)) 14px calc(12px + env(safe-area-inset-bottom, 0px));
    background: var(--room, #170f0c); overflow: hidden; }
  .game-page[data-sheet] .side-col > * { display: none; }
  .game-page[data-sheet] .side-col > .sheet-head { display: flex; align-items: center; justify-content: space-between; flex: none; }
  .sheet-head b { font-size: 18px; }
  .game-page[data-sheet="odds"] .side-col { overflow-y: auto; }
  .game-page[data-sheet="odds"] .side-col > .odds-panel:not([hidden]), .game-page[data-sheet="odds"] .side-col > .standings, .game-page[data-sheet="odds"] .side-col > .vote-panel:not([hidden]) { display: grid; flex: none; }
  .game-page[data-sheet="odds"] .side-col > .odds-panel[hidden] + .odds-empty { display: block; }
  .game-page[data-sheet="chat"] .side-col > .side-tabs, .game-page[data-sheet="history"] .side-col > .side-tabs { display: flex; flex-direction: column; flex: 1; min-height: 0; padding: 0; border: 0; background: none; }
  .game-page[data-sheet] .side-tabs .side-head { display: none; }
  .game-page[data-sheet] .side-tabs > .pane:not([hidden]) { display: flex !important; flex-direction: column; flex: 1; min-height: 0; order: 0; }
  .game-page[data-sheet] .side-tabs .gchat { display: flex; flex-direction: column; flex: 1; min-height: 0; gap: 8px; }
  .game-page[data-sheet] .side-tabs .gchat-list { display: grid; flex: 1; min-height: 0; max-height: none; }
  .game-page[data-sheet] .side-tabs .gchat-quick { display: flex; }
  .game-page[data-sheet="history"] .side-tabs [data-pane="history"]:not([hidden]) { display: flex !important; }
  .game-page[data-sheet] .side-tabs .history-pane ol { flex: 1; min-height: 0; max-height: none; }
}

@media (max-width: 959px) {
  /* The table column keeps the full width (it used to shrink to its content once a game ended). */
  .game-page .table-layout { align-items: stretch; }
  .game-page .table-layout > [data-table] { width: 100%; }
  /* Two lines: back and title, then the toolbar. */
  .game-page:has(.table-layout) .table-head { flex-wrap: wrap; row-gap: 6px; }
  .game-page:has(.table-layout) .table-head > .row { flex: 1 1 100%; flex-wrap: nowrap; }
  .game-page:has(.table-layout) .table-head > .row > div { min-width: 0; }
  .game-page:has(.table-layout) .table-tools { width: 100%; justify-content: flex-end; }
}

/* Desktop: an open chat gets at least about half the side column; the odds and standings scroll in the rest */
@media (min-width: 1180px) and (min-height: 600px) {
  .game-page .side-col > .side-tabs:not(.collapsed) { min-height: max(230px, 48%); }
  .game-page .side-col:has(> .side-tabs:not(.collapsed)) > .standings { max-height: 22%; }
}

/* Phones: no keyboard hints on the action buttons */
@media (max-width: 959px) { .controls kbd, .actions kbd { display: none; } }

/* Quick match: how long the search has been running */
.search-time { display: inline-flex; align-items: center; gap: 7px; margin: -2px 0 0; padding: 4px 12px; border-radius: 999px; background: #ffffff0a; border: 1px solid var(--line);
  font-size: 15px; font-variant-numeric: tabular-nums; }
.search-time svg { width: 16px; height: 16px; color: var(--brass); }

/* Practice, between hands: "Deal next hand" over the (invisible) betting buttons, same height as during a hand */
.controls { grid-template-columns: minmax(0, 1fr); }
.controls.show-next .actions, .controls.show-next .sizing { visibility: hidden; }
.controls.show-next [data-next-row] { grid-row: 2 / span 2; grid-column: 1; align-self: center; z-index: 1; }
.controls > .status { grid-row: 1; grid-column: 1; }
.controls > .actions { grid-row: 2; grid-column: 1; }
.controls > .sizing { grid-row: 3; grid-column: 1; }

/* Mini window for a lobby or a competitive search */
.mg-faces { display: flex; flex-wrap: wrap; gap: 4px; }
.mg-faces > i { width: 28px; height: 28px; border-radius: 50%; border: 1.5px dashed #d4ab5e66; }
.mini-game.lobby [data-mg-search] { font-variant-numeric: tabular-nums; }
.mg-title small [data-mg-search] { display: inline; }

/* Phones in a game: the table area fills the space between the header and the controls; the felt is smaller
   and the seats sit out toward the edges, using the room around the table. */
@media (max-width: 959px) {
  .game-page .stage.portrait.roomy { width: 100cqw; height: 100cqh; aspect-ratio: auto; }
  .stage.roomy .rail { inset: 12% 13%; }
  .stage.roomy .board { --cw: clamp(24px, 9.6cqw, 52px); }
  .stage.roomy .pot { top: 37%; }
  .stage.roomy .result { top: 64%; max-width: 70%; }
  .stage.roomy .felt-mark { top: 64%; }
  .stage.roomy .seat:not(.me) .plate { min-width: clamp(66px, 21cqw, 108px); }
}
/* Phones in a game: seats are sized by the table area's width or height, whichever is tighter, so short
   screens don't overcrowd. */
@media (max-width: 959px) {
  .game-page .stage.portrait.roomy { container: table / size; }
  .stage.roomy .seat { --cw: clamp(20px, min(9cqw, 7.2cqh), 42px); }
  .stage.roomy .seat.me { --cw: clamp(32px, min(14cqw, 10.5cqh), 70px); }
  .stage.roomy .seat:not(.me) .plate { min-width: clamp(60px, min(21cqw, 17cqh), 108px); }
}

/* Phones: Fold, Call and Raise in one row (shorter), leaving more room for the table */
@media (max-width: 959px) {
  .game-page .actions { grid-template-columns: 1fr 1fr 1.25fr; gap: 8px; }
  .game-page .actions .raise { grid-column: auto; order: 0; }
  .game-page .actions .btn { min-height: 44px; font-size: 15px; padding-inline: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .game-page .controls { gap: 8px; padding: 8px 10px; }
  .game-page .sizing { gap: 6px 10px; }
  .game-page .presets button { padding: 5px 9px; }
  .game-page .slider-row input[type="number"] { width: 90px; padding: 6px 8px; }
}
/* Phones in a game: smaller avatars, to leave more room for the table */
@media (max-width: 959px) {
  .stage.roomy .seat .bust { width: calc(var(--cw) * 1.4); }
  .stage.roomy .seat.me .bust { width: calc(var(--cw) * .82); }
  .game-page .table-wrap.with-busts { padding-top: clamp(20px, 3.5vh, 40px); }
}
/* Speech bubbles sit above the player's avatar (the avatar's width, kept in --bw, is also its height) */
.seat { --bw: calc(var(--cw) * 2); }
@media (max-width: 959px) { .stage.roomy .seat { --bw: calc(var(--cw) * 1.4); } }
.seat:not(.me) .bust { width: var(--bw); }
.seat:not(.me):has(> .bust:not([hidden])) .say { bottom: calc(100% - var(--cw) * .12 + var(--bw) + 2px); }
.seat:not(.me):has(> .hole:empty):has(> .bust:not([hidden])) .say { bottom: calc(100% - var(--cw) * .8 + var(--bw) + 2px); }
/* Smaller avatars on wider screens too (phones have their own size above) */
@media (min-width: 960px) {
  .seat { --bw: calc(var(--cw) * 1.5); }
  .seat.me .bust { width: calc(var(--cw) * 1.15); }
  .table-wrap.with-busts { padding-top: clamp(40px, 6.5cqw, 80px); }
  .game-page .table-wrap.with-busts { padding-top: clamp(30px, 4.5vh, 64px); }
}
/* A seat with a speech bubble showing comes to the front, so the bubble is never hidden behind a neighbour's plate */
.seat:has(> .say:not([hidden])) { z-index: 6; }
