:root {
  --bg: #0b1f18;
  --panel: #12301f;
  --felt: #17603f;
  --felt-edge: #0e3d28;
  --text: #f1f5f2;
  --muted: #a9bdb2;
  --accent: #f2c14e;
  --danger: #d9534f;
  --card: #fbfbf8;
  --red: #c62828;
  --black: #1b1b1b;
}

/* Theme colours. The green felt is the default; black and grey, red and purple are
   choices in the settings (html[data-theme="..."]). */
:root {
  --t0: #2c5a45;
  --t1: rgba(15, 42, 32, 0.85);
  --t2: #0a2b1c;
  --t3: #dbe6df;
  --t4: #e6efe9;
  --t5: #dfe8e3;
  --t6: #cfdcd4;
  --t7: #17603f;
  --t8: #24875b;
  --t9: #0d4129;
  --t10: #0f2a20;
  --t11: rgba(10, 28, 21, 0.96);
  --t12: #6f4829;
  --t13: #5c3b21;
  --t14: #3a2312;
  --t15: #ffd98a;
  --t16: #3a3210;
  --t17: #1c1503;
  --r0: 255, 217, 138;
  --r1: 242, 193, 78;
}
html[data-theme="black"] {
  --bg: #09090a;
  --panel: #18191b;
  --felt: #2b2d31;
  --felt-edge: #141517;
  --text: #f3f3f4;
  --muted: #a4a7ad;
  --accent: #dfe2e6;
  --t0: #3b3e43;
  --t1: rgba(24, 25, 27, 0.9);
  --t2: #050506;
  --t3: #dcdde0;
  --t4: #e8e9eb;
  --t5: #e2e3e6;
  --t6: #cfd1d5;
  --t7: #2b2d31;
  --t8: #44474d;
  --t9: #111214;
  --t10: #131416;
  --t11: rgba(14, 14, 16, 0.96);
  --t12: #5a5d63;
  --t13: #3f4146;
  --t14: #1b1c1f;
  --t15: #dfe2e6;
  --t16: #34363b;
  --t17: #111213;
  --r0: 223, 226, 230;
  --r1: 223, 226, 230;
}
/* Red: burgundy felt, black rail, gold highlights. Card backs go black so they stand out. */
html[data-theme="red"] {
  --bg: #0d0507;
  --panel: #230b10;
  --felt: #7a1422;
  --felt-edge: #3d0810;
  --text: #f6f1f1;
  --muted: #c2a9ab;
  --accent: #e8c26a;
  --t0: #5c2630;
  --t1: rgba(36, 10, 14, 0.9);
  --t2: #1a0408;
  --t3: #eadcdc;
  --t4: #f0e6e6;
  --t5: #e9dede;
  --t6: #dccbcb;
  --t7: #7a1422;
  --t8: #a51f33;
  --t9: #45090f;
  --t10: #1c080b;
  --t11: rgba(22, 6, 9, 0.96);
  --t12: #3a3a3e;
  --t13: #26262a;
  --t14: #0e0e10;
  --t15: #f0d08a;
  --t16: #3a2d10;
  --t17: #1a1203;
  --r0: 240, 208, 138;
  --r1: 232, 194, 106;
}
html[data-theme="red"] .card.back { background: repeating-linear-gradient(45deg, #17181a, #17181a 5px, #2e3035 5px, #2e3035 10px); }
/* Gold: a golden felt on a near-black background, black rail, pale gold highlights. */
html[data-theme="gold"] {
  --bg: #0e0a03;
  --panel: #2a200c;
  --felt: #a67c1c;
  --felt-edge: #5a4310;
  --text: #fbf6ea;
  --muted: #cdbf9c;
  --accent: #fff1c4;
  --t0: #6b5520;
  --t1: rgba(38, 29, 10, 0.9);
  --t2: #241a05;
  --t3: #efe6d0;
  --t4: #f5eedc;
  --t5: #efe7d2;
  --t6: #e0d5b8;
  --t7: #a67c1c;
  --t8: #cfa53c;
  --t9: #5e450f;
  --t10: #1c1507;
  --t11: rgba(22, 17, 6, 0.96);
  --t12: #3a3a3e;
  --t13: #26262a;
  --t14: #0e0e10;
  --t15: #fff1c4;
  --t16: #3d3110;
  --t17: #1a1203;
  --r0: 255, 241, 196;
  --r1: 255, 241, 196;
}


* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  padding: calc(12px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom));
  min-height: 100dvh;
}

h1 { font-size: 1.5rem; margin: 0 0 4px; }
h2 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 20px 0 6px; }
.muted { color: var(--muted); }
.error { color: #ffb4a9; min-height: 1.4em; margin: 6px 0; }

.panel { margin-top: 18vh; text-align: center; }

/* Landing page: who you are, then the tables */
#lobby { padding-top: 6vh; }
#lobby h1 { text-align: center; }
#lobby > .muted { text-align: center; margin-top: 0; }
#lobby form { display: grid; gap: 10px; margin: 18px 0 4px; }
#tables { display: grid; gap: 14px; margin-top: 8px; }
.table-card {
  background: radial-gradient(ellipse at top, var(--felt), var(--felt-edge));
  border: 3px solid var(--t2); border-radius: 20px; padding: 16px;
}
.table-card h2 { font-size: 1.25rem; text-transform: none; letter-spacing: 0; color: var(--text); margin: 0 0 4px; }
.table-card p { margin: 0 0 6px; }
.table-card .blurb { color: var(--t3); font-size: 0.92rem; }
.table-card .status { font-weight: 700; color: var(--accent); }
.table-card .counts { color: var(--t3); font-size: 0.85rem; }
.table-card .row { margin-top: 10px; }
#table-info { text-align: center; font-weight: 700; font-size: 0.9rem; padding: 0 48px; }
#table-info .watching { color: var(--accent); }
#password-row { display: grid; gap: 10px; }
.panel form { display: grid; gap: 10px; margin-top: 20px; text-align: left; }

input, button {
  font: inherit;
  color: inherit;
  border-radius: 10px;
  border: 1px solid var(--t0);
  background: var(--t10);
  min-height: 48px;
  padding: 0 14px;
}
button { cursor: pointer; font-weight: 600; touch-action: manipulation; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--t17); }
button.danger { background: transparent; border-color: var(--danger); color: #ffb4a9; }
button:disabled { opacity: 0.35; cursor: default; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Seats */
.seat { display: grid; justify-items: center; gap: 4px; padding: 8px 0; border-radius: 14px; }
.seat.turn { background: rgba(var(--r1), 0.1); box-shadow: inset 0 0 0 2px var(--accent); }
.who { display: flex; align-items: center; gap: 8px; }
.name { font-weight: 700; max-width: 12em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chips { color: var(--muted); font-variant-numeric: tabular-nums; }
.bet { min-height: 1.4em; color: var(--accent); font-weight: 600; font-variant-numeric: tabular-nums; }
.tag { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
#score { text-align: center; color: var(--muted); font-size: 0.85rem; min-height: 1.4em; padding-right: 44px; padding-left: 44px; }
.pct {
  background: #fff; color: #111; font-weight: 800; font-size: 0.95rem;
  padding: 2px 10px; border-radius: 999px; font-variant-numeric: tabular-nums;
}
.btn-chip {
  display: inline-grid; place-items: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: #fff; color: #111; font-size: 0.75rem; font-weight: 800;
}

/* Table */
.felt {
  background: radial-gradient(ellipse at center, var(--felt), var(--felt-edge));
  border: 3px solid var(--t2);
  border-radius: 28px;
  padding: 16px 8px 10px;
  text-align: center;
}
.pot { margin-top: 10px; font-variant-numeric: tabular-nums; }
.pot strong { color: var(--accent); font-size: 1.2rem; }
.handno { font-size: 0.75rem; color: rgba(255, 255, 255, 0.6); }

.cards { display: flex; justify-content: center; gap: 6px; min-height: 64px; }
.card {
  width: 46px; height: 64px; border-radius: 7px;
  background: var(--card); color: var(--black);
  display: grid; place-items: center; align-content: center;
  font-weight: 800; font-size: 1.15rem; line-height: 1.05;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}
/* Four-colour deck with the whole card filled: spades black, hearts red,
   diamonds blue, clubs green. White rank and suit on top. */
.card.suit-s, .card.suit-h, .card.suit-d, .card.suit-c {
  color: #fff; border: 1px solid rgba(255, 255, 255, 0.45);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
}
.card.suit-s { background: #23262b; }
.card.suit-h { background: #c62828; }
.card.suit-d { background: #1556c0; }
.card.suit-c { background: #1a7f37; }
.card .suit { font-size: 1.25rem; }
.card.back {
  background: repeating-linear-gradient(45deg, #7b1e2b, #7b1e2b 5px, #932838 5px, #932838 10px);
  border: 3px solid var(--card);
}
.card.empty { background: rgba(0, 0, 0, 0.18); box-shadow: none; }
#me .card { width: 58px; height: 80px; font-size: 1.4rem; }
#me .card .suit { font-size: 1.5rem; }
#me .cards { min-height: 80px; }

#status { text-align: center; font-weight: 700; margin: 12px 0 4px; min-height: 1.4em; }
#error { text-align: center; }

/* Actions */
.row { display: flex; gap: 8px; margin-top: 8px; }
.row > button { flex: 1; padding: 0 6px; }
#amount-range { flex: 1; padding: 0; min-height: 48px; accent-color: var(--accent); border: 0; background: transparent; }
#amount { width: 6.5em; text-align: center; }
.presets button { min-height: 44px; font-weight: 500; font-size: 0.9rem; }
#between { display: grid; margin-top: 8px; }

#log, #rp-log {
  margin: 0; padding: 10px 12px 10px 34px;
  background: var(--panel); border-radius: 12px;
  max-height: 14em; overflow-y: auto;
  font-size: 0.9rem; color: var(--t3);
}
#log li, #rp-log li { padding: 1px 0; }

/* Turn clock */
#turn-timer { text-align: center; font-size: 0.85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
#turn-timer .bar { height: 6px; margin-top: 4px; background: rgba(255, 255, 255, 0.12); border-radius: 3px; overflow: hidden; }
#turn-timer-fill { height: 100%; width: 100%; background: var(--accent); transition: width 0.2s linear; }
#turn-timer.bank { color: #ffb4a9; font-weight: 700; }
#turn-timer.bank #turn-timer-fill, #turn-timer.low #turn-timer-fill { background: var(--danger); }

/* Runout cards shown after a fold: what would have come */
.card.ghost { opacity: 0.55; outline: 2px dashed rgba(255, 255, 255, 0.7); outline-offset: -2px; }
#between { gap: 8px; }

/* The river of an all-in: covered, then peeled up slowly from the bottom */
.card { position: relative; }
.card.peel { transform: scale(1.12); z-index: 1; overflow: hidden; box-shadow: 0 0 0 3px var(--accent), 0 6px 14px rgba(0, 0, 0, 0.6); }
.card.peel::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: repeating-linear-gradient(45deg, #7b1e2b, #7b1e2b 5px, #932838 5px, #932838 10px);
  border: 3px solid var(--card);
  animation: peel var(--peel-ms, 3500ms) cubic-bezier(0.6, 0, 0.9, 0.6) var(--peel-skip, 0ms) forwards;
}
@keyframes peel {
  0% { clip-path: inset(0 0 0 0); }
  15% { clip-path: inset(0 0 0 0); }
  100% { clip-path: inset(0 0 100% 0); }
}
@media (prefers-reduced-motion: reduce) { .card.peel::after { animation: none; display: none; } }

/* Betting panel: sits right under the hand and stays pinned to the bottom of
   the screen, so there is never a need to scroll to act. */
#actions {
  position: sticky; bottom: 0; z-index: 5;
  margin: 6px -16px 0; padding: 2px 16px calc(8px + env(safe-area-inset-bottom));
  background: var(--bg); box-shadow: 0 -8px 12px -6px rgba(0, 0, 0, 0.6);
}
#actions .row { margin-top: 6px; }
#actions .presets button { min-height: 40px; padding: 0 2px; font-size: 0.9rem; }
#actions #amount-range, #actions #amount { min-height: 40px; }
#actions .row > button { min-height: 50px; }

/* Bomb pot: second board, four hole cards */
#board2 { margin-top: 6px; }
#bomb-next { margin-top: 4px; font-weight: 800; color: var(--accent); }
.seat.four .card { width: 44px; height: 62px; font-size: 1.1rem; }
.seat.four .card .suit { font-size: 1.2rem; }
#me.four .cards { min-height: 62px; }
#opp.four .card { width: 36px; height: 50px; font-size: 0.95rem; }
#opp.four .card .suit { font-size: 1rem; }
#opp.four .cards { min-height: 50px; }
.felt.double .card { width: 42px; height: 56px; font-size: 1.05rem; }
.felt.double .card .suit { font-size: 1.1rem; }
.felt.double .cards { min-height: 56px; }
#bomb-toggle[aria-pressed="false"], #seven2-toggle[aria-pressed="false"] { opacity: 0.7; }

/* Made hand: its name under the cards, and a glow on the cards that form it */
.made-label { min-height: 1.3em; font-weight: 800; color: var(--accent); font-size: 0.95rem; }
.card.made { box-shadow: 0 0 0 3px var(--accent), 0 0 12px 2px rgba(var(--r1), 0.75); transform: translateY(-4px); }
.card.peel.made { transform: scale(1.12); }

/* Game paused because somebody dropped */
#paused {
  margin-top: 10px; padding: 10px 12px; border-radius: 12px; text-align: center;
  background: #4a1c1a; border: 1px solid var(--danger); font-weight: 700;
}

/* Outs during an all-in: the cards the player who is behind needs */
#outs { margin-top: 8px; font-size: 0.85rem; }
#outs .mini-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; margin-top: 4px; }
.mini {
  min-width: 27px; padding: 1px 3px; border-radius: 5px; text-align: center;
  font-weight: 800; font-size: 0.8rem; color: #fff; border: 1px solid rgba(255, 255, 255, 0.4);
}
.mini.suit-s { background: #23262b; }
.mini.suit-h { background: #c62828; }
.mini.suit-d { background: #1556c0; }
.mini.suit-c { background: #1a7f37; }
.mini.chop { opacity: 0.6; }

/* Commentator */
#commentary {
  margin: 10px 0 0; padding: 8px 12px; min-height: 4.6em;
  background: var(--panel); border-radius: 12px; border-left: 3px solid var(--accent);
  font-size: 0.92rem; display: flex; flex-direction: column; justify-content: flex-end;
}
#commentary p { margin: 0; }
#comment-prev { color: var(--muted); font-size: 0.8rem; opacity: 0.75; }
#comment-now::before { content: "🎙 "; }
#comment-now:empty::before { content: ""; }

/* Showing one card (cash game) */
/* Cards that can be held up to show: no text selection or long-press menu on them */
#me-cards.holdable .card { cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: none; }
.card.shown { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Last-hand replay */
dialog#replay {
  background: var(--bg); color: var(--text);
  border: 1px solid var(--t0); border-radius: 16px;
  width: min(440px, calc(100vw - 24px)); max-height: calc(100dvh - 24px);
  padding: 16px;
}
dialog#replay::backdrop { background: rgba(0, 0, 0, 0.7); }
dialog#replay h2 { margin-top: 0; text-align: center; }
dialog#replay .felt { padding: 12px 6px; }
#rp-log { margin-top: 10px; max-height: 9em; min-height: 9em; }

/* Fruit throwing */
.small { font-size: 0.8rem; text-align: center; margin: 6px 0 0; }
#throwables { margin-top: 16px; }
#throwables button { min-height: 44px; font-size: 1.3rem; padding: 0; }
.flying {
  position: fixed; left: 0; top: 0; z-index: 10; pointer-events: none;
  font-size: 2.6rem; line-height: 1; margin: -1.3rem 0 0 -1.3rem;
}
.hit { animation: hit 0.45s ease-out; }
@keyframes hit {
  20% { transform: translate(-6px, 3px) rotate(-3deg); }
  45% { transform: translate(5px, -2px) rotate(2deg); }
  70% { transform: translate(-3px, 1px) rotate(-1deg); }
}
@media (prefers-reduced-motion: reduce) { .hit { animation: none; } }

#voice-picker select {
  flex: 1; min-width: 0; min-height: 48px; padding: 0 10px; font: inherit; color: inherit;
  background: var(--t10); border: 1px solid var(--t0); border-radius: 10px;
}
#voice-picker #voice-test { flex: 0 0 5.5em; }
/* Make it obvious when sound or the voice is switched off. */
#mute[aria-pressed="true"], #voice[aria-pressed="true"] { border-color: var(--danger); background: #4a1c1a; }

/* Camera pictures: the other player's by their cards, mine small and mirrored */
.seat { position: relative; }
.cam {
  position: absolute; left: 6px; top: 6px; width: 92px; height: 69px;
  object-fit: cover; border-radius: 10px; background: #000;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35);
}
.cam.mine { width: 60px; height: 45px; transform: none; /* my own picture is shown as the others see it, not mirrored */ }
.seat.four .cam { width: 70px; height: 52px; }
/* Phones: people watching who are in the call are small boxes down the right
   edge, the same size as the sound, voice, camera and microphone buttons and
   directly under them. */
@media (max-width: 699px) {
  #guests {
    position: fixed; right: 8px; top: calc(216px + env(safe-area-inset-top)); z-index: 4;
    flex-direction: column; flex-wrap: nowrap; gap: 8px; margin: 0;
  }
  #guests .guest { width: 44px; height: 44px; border-radius: 10px; }
  #guests .guest span { font-size: 0.55rem; padding: 0 2px; }
  #guests .guest button { width: 20px; min-height: 20px; font-size: 0.6rem; top: 1px; right: 1px; }
}

/* Wider screens: the pictures sit right beside each player's cards, and larger */
@media (min-width: 700px) {
  .cam { left: auto; top: 10px; right: calc(50% + 62px); width: 150px; height: 112px; }
  #me .cam { right: calc(50% + 76px); }
  .cam.mine { width: 150px; height: 112px; }
  .seat.four .cam { width: 122px; height: 92px; right: calc(50% + 94px); }
  #me.four .cam { right: calc(50% + 110px); }
  .seat:has(.cam:not([hidden])) { min-height: 132px; }

  /* People watching who are in the call: a column beside the table, level with
     its middle, one under the other. */
  .felt { position: relative; }
  #guests {
    position: absolute; left: calc(100% + 18px); top: 50%; transform: translateY(-50%);
    flex-direction: column; flex-wrap: nowrap; margin: 0; gap: 10px;
  }
  #guests .guest { width: 132px; height: 99px; }
  #guests .guest span { font-size: 0.8rem; padding: 2px 4px; }
}

/* People watching who were let into the call: a strip of small pictures */
#guests { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0 0 10px; }
.guest { position: relative; width: 92px; height: 69px; border-radius: 10px; overflow: hidden; background: #000; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35); }
.guest video { width: 100%; height: 100%; object-fit: cover; display: block; }
.guest video.blank { visibility: hidden; }
.guest video.mirror { transform: none; /* my own picture is shown as the others see it, not mirrored */ }
.guest span {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 1px 4px; font-size: 0.7rem; text-align: center;
  background: rgba(0, 0, 0, 0.6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.guest button { position: absolute; top: 2px; right: 2px; width: 28px; min-height: 28px; padding: 0; font-size: 0.8rem; border-radius: 50%; background: rgba(0, 0, 0, 0.7); }
.request { margin: 8px 0; padding: 10px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--accent); }
.request p { margin: 0; font-weight: 600; }
#call-join:not([hidden]) { margin-top: 8px; }

#cam, #mic {
  position: fixed; top: calc(112px + env(safe-area-inset-top)); right: 8px;
  width: 44px; min-height: 44px; padding: 0; font-size: 1.2rem;
  background: var(--t1);
}
#mic { top: calc(164px + env(safe-area-inset-top)); }
#cam[aria-pressed="true"], #mic[aria-pressed="true"] { border-color: var(--accent); background: var(--t16); }

#voice {
  position: fixed; top: calc(60px + env(safe-area-inset-top)); right: 8px;
  width: 44px; min-height: 44px; padding: 0; font-size: 1.2rem;
  background: var(--t1);
}
#mute {
  position: fixed; top: calc(8px + env(safe-area-inset-top)); right: 8px;
  width: 44px; min-height: 44px; padding: 0; font-size: 1.2rem;
  background: var(--t1);
}

#offline {
  position: fixed; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom));
  background: var(--danger); color: #fff; padding: 12px 14px; border-radius: 12px; text-align: center; font-weight: 600;
}


/* =====================================================================
   The table: a small heads-up poker table. A wooden rail around green
   felt, one player at each end, the board and the pot in the middle.
   These rules come last so they take over from the plain layout above.
   ===================================================================== */
.poker-table {
  position: relative; margin: 8px 0 4px; padding: 13px;
  border-radius: min(118px, 31vw);
  background: linear-gradient(160deg, var(--t12) 0%, var(--t14) 45%, var(--t13) 100%); /* the rail */
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.55), inset 0 2px 3px rgba(255, 255, 255, 0.2), inset 0 -3px 6px rgba(0, 0, 0, 0.5);
}
.table-felt {
  position: relative; padding: 12px 10px;
  border-radius: min(105px, 27.5vw);
  background: radial-gradient(ellipse at 50% 45%, var(--t8) 0%, var(--t7) 50%, var(--t9) 100%);
  box-shadow: inset 0 0 0 3px var(--t2), inset 0 0 34px rgba(0, 0, 0, 0.5);
}
/* The betting line painted on the felt. */
.table-felt::before {
  content: ""; position: absolute; inset: 13px; pointer-events: none;
  border: 2px solid rgba(255, 255, 255, 0.09); border-radius: min(92px, 24vw);
}
.poker-table .felt { background: none; border: 0; border-radius: 0; padding: 2px 0 4px; position: static; }
.poker-table .seat { padding: 6px 0; border-radius: 0; gap: 3px; }
.poker-table .seat.turn { background: none; box-shadow: none; }

/* Each player's name plate, at their end of the table. It lights up on their turn. */
.plate {
  display: grid; justify-items: center; min-width: 150px; max-width: 100%;
  padding: 4px 14px 5px; border-radius: 14px;
  background: rgba(0, 0, 0, 0.52); border: 1px solid rgba(255, 255, 255, 0.16);
}
.plate .name { max-width: 9em; }
.plate .chips { font-size: 0.8rem; color: var(--t6); white-space: nowrap; }
.seat.turn .plate { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent), 0 0 18px rgba(var(--r1), 0.55); }

/* Chips on the felt: a player's bet in front of them, the pot in the middle. */
.poker-table .bet:not(:empty), .poker-table .pot {
  display: inline-flex; align-items: center; justify-self: center;
  padding: 1px 12px 1px 6px; border-radius: 999px; background: rgba(0, 0, 0, 0.34); color: #fff;
}
.poker-table .pot { margin-top: 8px; }
.poker-table .pot strong { margin-left: 5px; }
.poker-table .bet:not(:empty)::before, .poker-table .pot::before {
  content: ""; width: 15px; height: 15px; border-radius: 50%; margin-right: 6px; flex: none;
  background: radial-gradient(circle, #fff 0 22%, #c62828 24% 58%, #fff 60% 68%, #c62828 70%);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.poker-table .pot::before { background: radial-gradient(circle, #fff 0 22%, #1556c0 24% 58%, #fff 60% 68%, #1556c0 70%); }
.poker-table .card.empty { background: rgba(0, 0, 0, 0.16); border: 1px dashed rgba(255, 255, 255, 0.14); }
.poker-table .handno { color: rgba(255, 255, 255, 0.66); }
.poker-table .felt > .pot { display: flex; width: max-content; margin-left: auto; margin-right: auto; }

/* Camera pictures: beside each player's cards, inside the rail. */
.poker-table .cam, .poker-table .cam.mine { left: auto; top: 58px; right: calc(50% + 58px); width: 76px; height: 57px; }
.poker-table #me .cam { top: 30px; right: calc(50% + 70px); }
/* Four cards (bomb pot) leave no room beside them on a phone: tuck the picture
   into the corner of the seat that faces the middle of the table. */
.poker-table .seat.four .cam { width: 48px; height: 36px; right: auto; left: 0; top: auto; bottom: 2px; }
.poker-table #me.four .cam { bottom: auto; top: 2px; }

@media (min-width: 700px) {
  .poker-table .cam, .poker-table .cam.mine { width: 124px; height: 93px; top: 46px; right: calc(50% + 62px); }
  .poker-table #me .cam { top: 22px; right: calc(50% + 76px); }
  .poker-table .seat.four .cam { width: 100px; height: 75px; left: auto; bottom: auto; top: 50px; right: calc(50% + 94px); }
  .poker-table #me.four .cam { top: 24px; right: calc(50% + 110px); }
  .poker-table .seat:has(.cam:not([hidden])) { min-height: 0; }
}

/* The turn clock rides on top of the betting panel, so it is always in view. */
#actions #turn-timer { margin: 2px 0 2px; }
#actions.watching > .row, #actions.watching #sizing { display: none; }

/* Phones: the four round buttons go in a row along the top, clear of the
   table, and the lines above the table move to the left to make room. The
   table itself is drawn a little tighter so it fits above the betting panel. */
@media (max-width: 699px) {
  #mute, #voice, #cam, #mic { top: calc(6px + env(safe-area-inset-top)); width: 40px; min-height: 40px; }
  #mute { right: 8px; }
  #voice { right: 54px; }
  #cam { right: 100px; }
  #mic { right: 146px; }
  #table-info, #score { text-align: left; padding: 0 186px 0 2px; }
  #score { font-size: 0.8rem; min-height: 0; }
  #score .score-label { display: none; }
  #table-info { min-height: 1.3em; }
  .poker-table { margin-top: 12px; padding: 11px; }
  .table-felt { padding: 9px 10px; }
  .poker-table .seat { padding: 3px 0; gap: 2px; }
  .poker-table #opp .card { width: 40px; height: 56px; font-size: 1rem; }
  .poker-table #opp .cards { min-height: 56px; }
  .poker-table #me .card { width: 52px; height: 72px; font-size: 1.3rem; }
  .poker-table #me .cards { min-height: 72px; }
  .poker-table .board .card { width: 44px; height: 60px; }
  .poker-table .board { min-height: 60px; }
  .poker-table .seat.four .card { width: 42px; height: 54px; font-size: 1.05rem; }
  .poker-table #me.four .cards { min-height: 54px; }
  .poker-table #opp.four .card { width: 34px; height: 44px; font-size: 0.9rem; }
  .poker-table #opp.four .cards { min-height: 44px; }
  .poker-table .felt.double .card { width: 40px; height: 48px; font-size: 1rem; }
  .poker-table .felt.double .cards { min-height: 48px; }
  .poker-table .seat.four .made-label { font-size: 0.74rem; line-height: 1.2; text-align: center; }
  .poker-table .pot { margin-top: 5px; }
  .poker-table .made-label { min-height: 1.15em; font-size: 0.9rem; }
  .poker-table .bet { min-height: 1.3em; }
  .poker-table .cam, .poker-table .cam.mine { top: 50px; right: calc(50% + 52px); width: 72px; height: 54px; }
  .poker-table #me .cam { top: 26px; right: calc(50% + 64px); }
  #lobby { padding-top: 52px; }
  /* People watching who are in the call: still small boxes down the right
     edge, now starting just under the row of buttons. */
  #guests { top: calc(54px + env(safe-area-inset-top)); }
}

/* Camera pictures line up with the cards. Each picture now lives in the same
   box as that player's cards and is centred on them, so it stays level with
   them at every screen size and card size. */
.poker-table .hand { position: relative; justify-self: center; }
.poker-table .hand .cam, .poker-table #me .hand .cam, .poker-table .seat.four .hand .cam, .poker-table #me.four .hand .cam {
  left: auto; bottom: auto; right: calc(100% + 8px); top: 50%; transform: translateY(-50%);
  width: 72px; height: 54px;
}
.poker-table .hand .cam.mine { transform: translateY(-50%); /* my own picture is shown as the others see it, not mirrored */ }
.poker-table .seat.four .hand .cam, .poker-table #me.four .hand .cam { width: 44px; height: 33px; right: calc(100% + 6px); }
@media (min-width: 700px) {
  .poker-table .hand .cam, .poker-table #me .hand .cam { width: 124px; height: 93px; right: calc(100% + 12px); }
  .poker-table .seat.four .hand .cam, .poker-table #me.four .hand .cam { width: 100px; height: 75px; right: calc(100% + 10px); }
}

/* Wider screens: both players' pictures are the same size, each centred on
   the cards it sits beside. */
@media (min-width: 700px) {
  .poker-table .hand .cam, .poker-table #me .hand .cam,
  .poker-table .seat.four .hand .cam, .poker-table #me.four .hand .cam {
    width: 104px; height: 78px; aspect-ratio: auto;
    top: 50%; transform: translateY(-50%); right: calc(100% + 10px);
  }
  .poker-table .hand .cam.mine { transform: translateY(-50%); /* my own picture is shown as the others see it, not mirrored */ }
  /* A picture is taller than the opponent's cards. While one is showing, the
     row is made as tall as the picture so it cannot poke into the name plate
     above or the chips below. */
  .poker-table .hand:has(.cam:not([hidden])) { min-height: 80px; display: flex; align-items: center; }
}

/* Where people watching (who are in the call) sit. They belong to the middle
   of the table, next to the board.
   Phones: small boxes at the right edge of the screen, level with the board,
   stacking downwards from there.
   Wider screens: a column beside the table, level with its middle. */
@media (max-width: 699px) {
  .poker-table .felt { position: relative; }
  #guests {
    position: absolute; top: 8px; right: -29px; left: auto; transform: none; z-index: 4;
    flex-direction: column; flex-wrap: nowrap; gap: 8px; margin: 0;
  }
}
@media (min-width: 700px) {
  #guests { left: calc(100% + 31px); }
}

/* A player taps a guest's box for a small menu: camera off, microphone off, remove. */
.guest.tappable { cursor: pointer; }
.guest.tappable:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.guest i { position: absolute; top: 1px; left: 2px; font-style: normal; font-size: 0.7rem; line-height: 1.2; text-shadow: 0 0 3px #000; }
#guest-menu {
  position: fixed; z-index: 30; width: 216px; padding: 6px; display: grid; gap: 4px;
  background: var(--panel); border: 1px solid var(--t0); border-radius: 12px; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
}
#guest-menu p { margin: 2px 6px 4px; font-weight: 700; font-size: 0.85rem; color: var(--muted); }
#guest-menu button { min-height: 44px; padding: 0 10px; text-align: left; font-weight: 500; font-size: 0.88rem; }

/* Stack and pot numbers: tap to switch between chips and big blinds. */
.units { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.plate .chips .units { color: #fff; font-weight: 600; padding: 4px 2px; margin: -4px -2px; }

/* Which optional rules are on: small badges under the blinds line. */
#rules-on { display: flex; gap: 6px; justify-content: center; margin-top: 4px; }
#rules-on span { font-size: 0.62rem; letter-spacing: 0.03em; padding: 1px 7px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14); color: rgba(255, 255, 255, 0.3); text-decoration: line-through; white-space: nowrap; }
#rules-on span.add-chips, #ring-rules span.add-chips { color: var(--t15); border-color: rgba(var(--r0), 0.55); background: rgba(0, 0, 0, 0.22); text-decoration: none; cursor: pointer; font-weight: 700; }
#rules-on span.on { color: var(--t15); border-color: rgba(var(--r0), 0.55); background: rgba(0, 0, 0, 0.22); text-decoration: none; }

/* Choosing which cards set off a bomb pot. */
dialog#bomb-picker {
  background: var(--bg); color: var(--text);
  border: 1px solid var(--t0); border-radius: 16px;
  width: min(460px, calc(100vw - 24px)); max-height: calc(100dvh - 24px);
  padding: 16px;
}
dialog#bomb-picker::backdrop { background: rgba(0, 0, 0, 0.7); }
dialog#bomb-picker h2 { margin-top: 0; text-align: center; }
#bomb-grid { display: grid; grid-template-columns: repeat(13, 1fr); gap: 3px; margin: 12px 0; }
#bomb-grid .pick { padding: 7px 0; min-width: 0; font-size: 0.68rem; font-weight: 700; border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12); background: rgba(255, 255, 255, 0.05); color: var(--t5); letter-spacing: -0.03em; }
#bomb-grid .pick.suit-h { color: #ff8d8d; }
#bomb-grid .pick.suit-d { color: #8db8ff; }
#bomb-grid .pick.suit-c { color: #8fe0a0; }
#bomb-grid .pick.on { background: var(--t15); color: #1b1b1b; border-color: var(--t15); }
#rules-on { flex-wrap: wrap; }

#rules-on.tappable span { cursor: pointer; -webkit-tap-highlight-color: transparent; padding: 3px 9px; }
#rules-on span.asked { border-style: dashed; border-color: var(--t15); color: var(--t15); text-decoration: none; animation: rule-asked 1.1s ease-in-out infinite; }
@keyframes rule-asked { 50% { opacity: 0.45; } }

#bomb-picker-toggle { display: block; width: 100%; margin: 0 0 10px; }

/* Rule badges sit at the lower right of the felt, one above the other. */
.table-felt { position: relative; }
#rules-on { position: absolute; right: 26px; bottom: 96px; margin: 0; flex-direction: column; align-items: flex-end; gap: 5px; z-index: 2; }
@media (max-width: 699px) {
  /* On a phone the felt area is the anchor: put them beside my cards. */
  #rules-on { right: 2px; bottom: -74px; }
}
/* A little further in from the rail. */
#rules-on { right: 44px; }
@media (max-width: 699px) { #rules-on { right: 16px; } }

/* The red/black flop side bet window. */
dialog#side-picker {
  background: var(--bg); color: var(--text);
  border: 1px solid var(--t0); border-radius: 16px;
  width: min(420px, calc(100vw - 24px)); max-height: calc(100dvh - 24px);
  padding: 16px;
}
dialog#side-picker::backdrop { background: rgba(0, 0, 0, 0.7); }
dialog#side-picker h2 { margin-top: 0; text-align: center; }
#side-picker .row { margin-bottom: 10px; }
#side-picker .row button { flex: 1; }
#side-picker button.picked { background: var(--t15); color: #1b1b1b; border-color: var(--t15); }
#side-off { display: block; width: 100%; margin: 0 0 10px; }

/* Table name, watcher count and score now sit below the table, not above it. */
#table-info, #score { text-align: center; padding: 0 8px; }
#table-info { margin-top: 12px; }
#score .score-label { display: inline; }
@media (max-width: 699px) {
  /* Phones: the sound, voice, camera and microphone buttons in a column down
     the right edge, like on a wide screen. */
  #mute, #voice, #cam, #mic { right: 4px; width: 38px; min-height: 38px; }
  #mute { top: calc(6px + env(safe-area-inset-top)); }
  #voice { top: calc(48px + env(safe-area-inset-top)); }
  #cam { top: calc(90px + env(safe-area-inset-top)); }
  #mic { top: calc(132px + env(safe-area-inset-top)); }
}

/* The settings and info button and its window. */
#gear {
  position: fixed; top: calc(112px + env(safe-area-inset-top)); right: 8px; z-index: 5;
  width: 44px; min-height: 44px; padding: 0; font-size: 1.2rem;
  background: var(--t1);
}
#cam { top: calc(164px + env(safe-area-inset-top)); }
#mic { top: calc(216px + env(safe-area-inset-top)); }
@media (max-width: 699px) {
  #gear { right: 4px; width: 38px; min-height: 38px; top: calc(90px + env(safe-area-inset-top)); }
  #cam { top: calc(132px + env(safe-area-inset-top)); }
  #mic { top: calc(174px + env(safe-area-inset-top)); }
}
dialog#settings {
  background: var(--bg); color: var(--text);
  border: 1px solid var(--t0); border-radius: 16px;
  width: min(460px, calc(100vw - 24px)); max-height: calc(100dvh - 24px);
  padding: 16px; overflow-y: auto;
}
dialog#settings::backdrop { background: rgba(0, 0, 0, 0.7); }
dialog#settings h2 { margin: 14px 0 8px; }
dialog#settings h2:first-child { margin-top: 0; text-align: center; }
dialog#settings .row { flex-wrap: wrap; }
dialog#settings label.check { display: flex; gap: 8px; align-items: center; font-size: 0.9rem; margin: 8px 0 14px; }

/* "Are you sure?" before a card is shown: a small strip under the table. */
#show-confirm {
  display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; justify-content: center;
  margin: 6px auto 0; padding: 8px 10px; max-width: 420px; font-size: 0.85rem;
  border: 1px solid rgba(var(--r0), 0.45); border-radius: 12px; background: rgba(0, 0, 0, 0.3);
}
#show-confirm[hidden] { display: none; }
#show-confirm .row { margin: 0; gap: 6px; }
#show-confirm button { min-height: 32px; padding: 4px 14px; }
#show-confirm label { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 0.8rem; }
/* Settings: two rule buttons per row. The show-a-card question floats over
   the table so the betting panel never covers it. */
dialog#settings #settings-rules .row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
#show-confirm {
  position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 20;
  width: min(330px, calc(100vw - 32px)); margin: 0; background: var(--t11);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
#show-confirm { top: 35%; }

/* Replay: a small round button under the rule badges, lower right of the table. */
#rules-on #replay-open {
  width: 30px; min-height: 30px; height: 30px; padding: 0; border-radius: 50%; font-size: 1rem; line-height: 1;
  background: rgba(0, 0, 0, 0.25); border: 1px solid rgba(255, 255, 255, 0.25); color: var(--t4);
}
#rules-on #replay-open:disabled { opacity: 0.35; }
dialog#replay .row #rp-older, dialog#replay .row #rp-newer { flex: 0 0 48px; }
/* One more item in the stack (replay): sit it lower so the top stays clear of the pot text. */
#rules-on { bottom: 62px; }
@media (max-width: 699px) { #rules-on { bottom: -108px; } }

/* Replay button: a little lower and further in than the badges above it. */
#rules-on #replay-open { position: relative; top: 14px; right: 22px; }
#rules-on #replay-open.empty { opacity: 0.55; }

dialog#replay .row #rp-fast { flex: 0 0 48px; }
#rp-fast[aria-pressed="true"] { border-color: var(--accent); background: var(--t16); }
dialog#replay .row { gap: 6px; }
dialog#replay .row button { padding-left: 6px; padding-right: 6px; }

#rules-on #rule-side { white-space: pre-line; text-align: center; line-height: 1.25; border-radius: 10px; }

/* Replay button: off the felt, in the lower right corner just outside the table. */
.poker-table { position: relative; }
#replay-open {
  position: absolute; right: 0; bottom: 0; top: auto; z-index: 3;
  width: 34px; min-height: 34px; height: 34px; padding: 0; border-radius: 50%; font-size: 1.05rem; line-height: 1;
  background: var(--t1); border: 1px solid rgba(255, 255, 255, 0.25); color: var(--t4);
}
#replay-open.empty { opacity: 0.55; }
#replay-open:disabled { opacity: 0.35; }
#rules-on { bottom: 96px; }
@media (max-width: 699px) { #rules-on { bottom: -74px; } }

/* Custom table: the settings the first player picks, in the lobby. */
.custom-form { margin: 8px 0 10px; display: grid; gap: 6px; }
.custom-row { display: grid; grid-template-columns: 78px 1fr; gap: 8px; align-items: center; font-size: 0.85rem; color: var(--muted); }
.custom-options { display: flex; flex-wrap: wrap; gap: 5px; }
.custom-options button { min-height: 34px; padding: 4px 10px; font-size: 0.85rem; flex: 0 0 auto; }
.custom-options button.picked { background: var(--t15); color: #1b1b1b; border-color: var(--t15); }
@media (max-width: 699px) {
  /* Four hole cards (Omaha, bomb pots) fill the width on a phone: the rule
     badges go in a row under the cards, and the name box moves down a little. */
  .table-felt:has(#me.four) #rules-on {
    flex-direction: row; align-items: center; right: 50%; transform: translateX(50%);
    bottom: -140px; flex-wrap: nowrap; gap: 6px;
  }
  .poker-table #me.four .hand { margin-bottom: 34px; }
}
#rules-on span { flex-shrink: 0; }

#twice-toggle[aria-pressed="false"] { opacity: 0.7; }
#rules-on span[hidden] { display: none; }

/* Pineapple: choosing the card to throw away. */
#actions.discarding #sizing, #actions.discarding #fold, #actions.discarding #call, #actions.discarding #raise { display: none; }
#me-cards.discard .card { cursor: pointer; box-shadow: 0 0 0 2px var(--t15), 0 4px 10px rgba(0, 0, 0, 0.4); }
/* Five hole cards (5-card Omaha): smaller again so they fit on a phone. */
.seat.five .card { width: 40px; height: 56px; font-size: 1rem; }
.seat.five .card .suit { font-size: 1.05rem; }
#opp.five .card { width: 32px; height: 44px; font-size: 0.85rem; }
@media (max-width: 699px) {
  .poker-table #me.five .card { width: 46px; height: 64px; font-size: 1.1rem; }
  .poker-table #opp.five .card { width: 32px; height: 44px; font-size: 0.85rem; }
}

/* Wide screens: the lobby spreads out, tables side by side, so they are all
   in view without scrolling. */
@media (min-width: 900px) {
  main:has(#lobby:not([hidden])), body > :has(> #lobby:not([hidden])) { max-width: 1180px; }
  #lobby { padding-top: 3vh; }
  #lobby h1 { margin-bottom: 4px; }
  #lobby form { grid-template-columns: auto 220px auto 220px auto; align-items: center; justify-content: center; gap: 10px 12px; margin: 12px 0 2px; }
  #lobby form #password-row { display: contents; }
  #lobby form #password-row[hidden] { display: none; }
  #lobby form #leaderboard-open { margin-left: 8px; padding: 0 18px; white-space: nowrap; }
  #tables { grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: start; gap: 14px; }
  #tables .table-card { padding: 14px; }
  #tables .table-card h2 { font-size: 1.1rem; }
  #tables .table-card .blurb { font-size: 0.85rem; min-height: 4.6em; }
  /* The custom table has a form in it: give it the full width underneath. */
  #tables .table-card:has(.custom-form) { grid-column: 1 / -1; }
  #tables .table-card:has(.custom-form) .blurb { min-height: 0; }
  #tables .custom-form { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 22px; }
  #tables .table-card:has(.custom-form) .row { max-width: 420px; }
}
@media (min-width: 900px) {
  /* Custom table: two tables wide, centred under the others, settings in one list. */
  #tables .table-card:has(.custom-form) { grid-column: 2 / span 2; }
  #tables .custom-form { grid-template-columns: 1fr; gap: 6px; }
  #tables .table-card:has(.custom-form) .row { max-width: none; }
}
@media (min-width: 900px) {
  /* All table boxes in a row are the same height, with the buttons along the bottom. */
  #tables { align-items: stretch; }
  #tables .table-card { display: flex; flex-direction: column; }
  #tables .table-card .blurb { min-height: 0; flex: 1 0 auto; }
  #tables .table-card > .row { margin-top: auto; }
}
@media (min-width: 900px) {
  /* Four tables in a two-by-two block on the left, the custom table beside them on the right. */
  #tables { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.35fr); }
  #tables .table-card:last-child, #tables .table-card:has(.custom-form) { grid-column: 3; grid-row: 1 / span 2; }
}

#theme-pick button { flex: 1; }
#theme-pick button.picked { background: var(--t15); color: #1b1b1b; border-color: var(--t15); }

/* Speech bubbles: table talk from a player (Mr.GTO has a lot to say). */
/* (Placed against the felt, which is the positioned box around both seats.) */
.bubble {
  position: absolute; z-index: 6; left: 50%; transform: translateX(-50%);
  width: max-content; max-width: min(300px, 82vw); padding: 7px 12px;
  background: #fbfbf8; color: #17181a; border-radius: 14px; font-size: 0.88rem; font-weight: 600; line-height: 1.25;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5); text-align: center; pointer-events: none;
}
.bubble::after { content: ""; position: absolute; left: 50%; margin-left: -7px; border: 7px solid transparent; }
#opp-bubble { top: 72px; }
#opp-bubble::after { bottom: 100%; border-bottom-color: #fbfbf8; }
#me-bubble { bottom: 72px; }
#me-bubble::after { top: 100%; border-top-color: #fbfbf8; }
.bubble.pop { animation: bubble-pop 0.22s ease-out; }
@keyframes bubble-pop { from { transform: translateX(-50%) scale(0.7); opacity: 0; } }

#lobby-bot-note { text-align: center; margin: 14px 0 0; }

/* ---- The 5-max table: a ring of seats around the felt ---- */
#ring-title { text-align: center; font-weight: 700; font-size: 0.9rem; padding: 0 48px; min-height: 1.3em; }
.ring-table {
  position: relative; margin: 8px 0 4px; padding: 13px;
  border-radius: min(150px, 38vw);
  background: linear-gradient(160deg, var(--t12) 0%, var(--t14) 45%, var(--t13) 100%);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.55), inset 0 2px 3px rgba(255, 255, 255, 0.2), inset 0 -3px 6px rgba(0, 0, 0, 0.5);
}
.ring-felt {
  position: relative; height: min(560px, 132vw); border-radius: min(137px, 35vw);
  background: radial-gradient(ellipse at 50% 45%, var(--t8) 0%, var(--t7) 50%, var(--t9) 100%);
  box-shadow: inset 0 0 0 3px var(--t2), inset 0 0 34px rgba(0, 0, 0, 0.5);
}
#ring-center { position: absolute; left: 50%; top: 47%; transform: translate(-50%, -50%); text-align: center; width: 78%; }
#ring-center .card { width: 40px; height: 56px; font-size: 1rem; }
#ring-center .card .suit { font-size: 1.05rem; }
#ring-center .cards { justify-content: center; gap: 4px; min-height: 56px; }
#ring-center .pot { margin-top: 6px; font-weight: 700; }
#ring-center .pot strong { color: var(--accent); cursor: pointer; }
#ring-center .handno { font-size: 0.72rem; color: rgba(255, 255, 255, 0.66); }
.rseat { position: absolute; width: 108px; transform: translate(-50%, -50%); text-align: center; z-index: 2; }
.rseat.pos0 { left: 50%; top: 86%; width: 150px; }
.rseat.pos1 { left: 15%; top: 66%; }
.rseat.pos2 { left: 22%; top: 16%; }
.rseat.pos3 { left: 78%; top: 16%; }
.rseat.pos4 { left: 85%; top: 66%; }
.rplate {
  background: rgba(0, 0, 0, 0.62); border: 2px solid rgba(255, 255, 255, 0.16); border-radius: 12px;
  padding: 3px 6px; font-size: 0.8rem; line-height: 1.2;
}
.rseat.empty .rplate { opacity: 0.45; border-style: dashed; font-size: 0.72rem; padding: 8px 6px; }
.rseat.turn .rplate { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(var(--r1), 0.35), 0 0 14px rgba(var(--r1), 0.5); }
.rseat.winner .rplate { border-color: var(--t15); }
.rseat.out { opacity: 0.55; }
.rwho { display: flex; gap: 4px; justify-content: center; align-items: center; }
.rname { font-weight: 700; max-width: 7.5em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rdealer { background: #fff; color: #111; border-radius: 50%; width: 16px; height: 16px; font-size: 0.62rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.rstack { font-variant-numeric: tabular-nums; cursor: pointer; }
.rtag { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--t6); }
.rcards { display: flex; justify-content: center; gap: 3px; min-height: 40px; margin-bottom: 2px; }
.rcards .card { width: 28px; height: 40px; font-size: 0.78rem; border-radius: 5px; }
.rcards .card .suit { font-size: 0.8rem; }
.rseat.me .rcards { min-height: 66px; }
.rseat.me .rcards .card { width: 46px; height: 64px; font-size: 1.15rem; border-radius: 7px; }
.rseat.me .rcards .card .suit { font-size: 1.2rem; }
.rmade { font-size: 0.7rem; font-weight: 800; color: var(--accent); margin-top: 1px; }
.rbet, .rwon {
  position: absolute; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 0.74rem; font-weight: 700;
  background: rgba(0, 0, 0, 0.5); border-radius: 999px; padding: 1px 8px;
}
.rseat.pos0 .rbet, .rseat.pos0 .rwon { top: -20px; }
.rseat.pos1 .rbet, .rseat.pos1 .rwon { top: 6px; left: 118%; }
.rseat.pos4 .rbet, .rseat.pos4 .rwon { top: 6px; left: -18%; }
.rseat.pos2 .rbet, .rseat.pos2 .rwon, .rseat.pos3 .rbet, .rseat.pos3 .rwon { top: 100%; margin-top: 3px; }
.rwon { color: var(--t15); background: rgba(0, 0, 0, 0.7); }
#ring-status { text-align: center; font-weight: 700; min-height: 1.4em; margin-top: 6px; }
#ring-next { text-align: center; color: var(--muted); font-size: 0.85rem; }
#ring-actions { position: sticky; bottom: 0; z-index: 5; background: var(--bg); padding: 8px 0 calc(8px + env(safe-area-inset-bottom)); }
#ring-timer-text { text-align: center; font-size: 0.85rem; color: var(--muted); }
#ring-timer .bar { height: 5px; background: rgba(255, 255, 255, 0.12); border-radius: 3px; overflow: hidden; margin: 4px 0 8px; }
#ring-timer-fill { height: 100%; background: var(--accent); }
#ring-timer.bank #ring-timer-fill { background: var(--danger); }
#ring-sizing .row { margin-bottom: 8px; }
#ring-presets button { flex: 1; padding-left: 4px; padding-right: 4px; }
#ring-range { flex: 1; }
#ring-amount { flex: 0 0 96px; min-width: 0; }
#ring-buttons > .row > button { flex: 1; }
#ring-log { max-height: 180px; overflow-y: auto; }
@media (min-width: 700px) {
  .ring-felt { height: 440px; }
  .rseat { width: 130px; }
  .rseat.pos0 { top: 84%; }
  .rseat.pos1 { left: 12%; top: 62%; }
  .rseat.pos4 { left: 88%; top: 62%; }
  #ring-center .card { width: 48px; height: 66px; font-size: 1.15rem; }
  #ring-center .cards { min-height: 66px; }
  main:has(#ring:not([hidden])), body > :has(> #ring:not([hidden])) { max-width: 760px; }
}

/* 5-max: cameras as small round pictures on the name boxes, and guests above the table. */
.rplate { position: relative; }
.rcam { position: absolute; left: -22px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: #000; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.6); }
.rcam.mirror { transform: translateY(-50%); /* my own picture is shown as the others see it, not mirrored */ }
.rcam.blank { visibility: hidden; }
.rseat.hascam .rplate { padding-left: 22px; }
.rseat.me .rcam { width: 48px; height: 48px; left: -26px; }
.rseat.me.hascam .rplate { padding-left: 26px; }
.rseat.pos1 .rcam { left: auto; right: -22px; }
.rseat.pos1.hascam .rplate { padding-left: 6px; padding-right: 22px; }
#ring-guests { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 6px 0 2px; }
.rguest { position: relative; width: 52px; text-align: center; font-size: 0.62rem; color: var(--muted); }
.rguest .rcam { position: static; transform: none; width: 46px; height: 46px; display: block; margin: 0 auto 2px; }
.rguest .rcam.mirror { transform: none; /* my own picture is shown as the others see it, not mirrored */ }
.rguest.tappable { cursor: pointer; }
.rguest span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#ring-requests .request { border: 1px solid var(--t0); border-radius: 12px; padding: 8px 10px; margin: 6px 0; font-size: 0.85rem; }
#ring-requests .request p { margin: 0 0 6px; }
#ring-call-row button { flex: 1; }
#ring-call-status { text-align: center; margin: 2px 0; }
/* 5-max replay */
#ring-replay-open {
  position: absolute; right: 0; bottom: 0; z-index: 3; width: 34px; min-height: 34px; height: 34px; padding: 0; border-radius: 50%;
  font-size: 1.05rem; line-height: 1; background: var(--t1); border: 1px solid rgba(255, 255, 255, 0.25); color: var(--t4);
}
#ring-replay-open.empty { opacity: 0.55; }
dialog#ring-replay { background: var(--bg); color: var(--text); border: 1px solid var(--t0); border-radius: 16px; width: min(460px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 16px; }
dialog#ring-replay::backdrop { background: rgba(0, 0, 0, 0.7); }
dialog#ring-replay h2 { margin-top: 0; text-align: center; }
#ring-replay-board { justify-content: center; gap: 4px; margin-bottom: 10px; }
#ring-replay-board .card { width: 42px; height: 58px; font-size: 1.05rem; }
#ring-replay-hands { display: grid; gap: 4px; margin-bottom: 8px; }
.rhand { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; }
.rhand .rname { flex: 1; text-align: left; max-width: none; }
.rhand .rcards { min-height: 0; margin: 0; }
.rwon-note { color: var(--accent); font-weight: 700; }
#ring-replay-log { max-height: 190px; overflow-y: auto; }
dialog#ring-replay .row { gap: 6px; }
dialog#ring-replay .row button { padding-left: 6px; padding-right: 6px; }
#ring-replay-older, #ring-replay-newer, #ring-replay-fast { flex: 0 0 44px; }
#ring-replay-fast[aria-pressed="true"] { border-color: var(--accent); }

/* 5-max: rules, bomb pots (two boards, four cards) and the commentator. */
#ring-rules { display: flex; gap: 6px; justify-content: center; margin-top: 4px; flex-wrap: wrap; }
#ring-rules span { font-size: 0.62rem; padding: 2px 8px; border-radius: 999px; cursor: pointer; white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.14); color: rgba(255, 255, 255, 0.3); text-decoration: line-through; }
#ring-rules span.on { color: var(--t15); border-color: rgba(var(--r0), 0.55); background: rgba(0, 0, 0, 0.22); text-decoration: none; }
#ring-rules span.asked { border-style: dashed; border-color: var(--t15); color: var(--t15); text-decoration: none; animation: rule-asked 1.1s ease-in-out infinite; }
#ring-bomb-next { margin-top: 3px; font-weight: 800; font-size: 0.8rem; color: var(--accent); }
#ring-center.double .card { width: 34px; height: 46px; font-size: 0.9rem; }
#ring-center.double .cards { min-height: 46px; margin-bottom: 3px; }
.rcards.four { gap: 1px; }
.rcards.four .card { width: 22px; height: 32px; font-size: 0.66rem; }
.rcards.four .card .suit { font-size: 0.68rem; }
.rseat.me .rcards.four .card { width: 36px; height: 52px; font-size: 0.95rem; }
.rseat.me .rcards.four .card .suit { font-size: 1rem; }
#ring-commentary { margin: 8px 0; padding: 8px 12px; border-left: 3px solid var(--accent); background: var(--panel); border-radius: 0 10px 10px 0; min-height: 3.2em; }
#ring-commentary p { margin: 0; }
#ring-comment-prev { color: var(--muted); font-size: 0.8rem; opacity: 0.75; }
#ring-comment-now::before { content: "🎙 "; }
#ring-comment-now:empty::before { content: ""; }
#ring-rules-note { margin: 6px 0; }
@media (max-width: 699px) {
  /* Keep the side seats clear of the middle of the table. */
  .rseat.pos1, .rseat.pos4 { top: 70%; }
  #ring-center { top: 43%; }
}

/* ---- The private stats page (/stats) ---- */
#stats { max-width: 980px; margin: 0 auto; padding: 16px 16px 40px; }
#stats h1 { text-align: center; }
#stats h2 { margin: 26px 0 8px; }
#stats h3 { margin: 0 0 6px; font-size: 0.85rem; color: var(--muted); font-weight: 600; }
#stats-login { display: grid; gap: 8px; max-width: 320px; margin: 24px auto; }
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.stat-tile { background: var(--panel); border: 1px solid var(--t0); border-radius: 12px; padding: 12px; display: grid; gap: 2px; }
.stat-tile strong { font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.stat-tile span { color: var(--muted); font-size: 0.8rem; }
.stat-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.stat-bar { display: grid; grid-template-columns: 130px 1fr 52px; gap: 8px; align-items: center; font-size: 0.85rem; margin-bottom: 5px; }
.stat-bar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-bar-track { background: rgba(255, 255, 255, 0.08); border-radius: 4px; height: 10px; overflow: hidden; }
.stat-bar-fill { height: 100%; background: var(--accent); border-radius: 4px; }
.stat-bar-count { text-align: right; font-variant-numeric: tabular-nums; }
.stat-scroll { overflow-x: auto; }
#stats table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
#stats th { text-align: left; color: var(--muted); font-weight: 600; padding: 6px 10px 6px 0; border-bottom: 1px solid var(--t0); white-space: nowrap; }
#stats td { padding: 6px 10px 6px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.06); font-variant-numeric: tabular-nums; }
#stats-recent { padding-left: 1.2em; font-size: 0.85rem; display: grid; gap: 3px; }
#stats-now p { margin: 2px 0; }

/* 5-max Pineapple: choosing a card to throw away; and five hole cards. */
#ring.discarding #ring-buttons { display: none; }
#ring.my-discard .rseat.me .rcards .card { cursor: pointer; box-shadow: 0 0 0 2px var(--t15), 0 4px 10px rgba(0, 0, 0, 0.4); }
.rseat.me .rcards.four .card:nth-last-child(5), .rseat.me .rcards.four:has(.card:nth-child(5)) .card { width: 30px; height: 44px; font-size: 0.82rem; }
.rcards.four:has(.card:nth-child(5)) .card { width: 18px; height: 27px; font-size: 0.58rem; }

/* On the landing page only the settings wheel is shown, at the top; the sound
   and voice buttons appear once you are at a table. */
body:has(#lobby:not([hidden])) #mute, body:has(#lobby:not([hidden])) #voice { display: none; }
body:has(#lobby:not([hidden])) #gear { top: calc(8px + env(safe-area-inset-top)); }
@media (max-width: 699px) { body:has(#lobby:not([hidden])) #gear { top: calc(6px + env(safe-area-inset-top)); } }
#lobby-bot-note { margin-top: 30px; }

/* An empty seat: the words centred in the box, and tappable for somebody watching. */
.seat.vacant .plate { cursor: pointer; display: flex; align-items: center; justify-content: center; min-height: 52px; border-style: dashed; opacity: 0.8; }
.seat.vacant .plate .chips, .seat.vacant .plate .tag { display: none; }
.seat.vacant .plate .who { margin: 0; }
.seat.vacant .plate .name { max-width: none; font-weight: 600; }
.rseat.empty .rplate { display: flex; align-items: center; justify-content: center; min-height: 34px; }
.rseat.empty.tappable .rplate { cursor: pointer; opacity: 0.75; }

.seat.vacant.no-tap .plate { cursor: default; }
#table-bot-row { margin-top: 8px; }
#table-bot-row button { flex: 1; }

/* "‹ Tables": the way back to the landing page, top left while at a table. */
#back {
  position: fixed; top: calc(8px + env(safe-area-inset-top)); left: 8px; z-index: 5; display: none;
  min-height: 34px; padding: 4px 12px; font-size: 0.85rem; border-radius: 999px; background: var(--t1);
}
body:has(#table:not([hidden])) #back, body:has(#ring:not([hidden])) #back, body:has(#chess:not([hidden])) #back,
body:has(#ofc:not([hidden])) #back, body:has(#olsen:not([hidden])) #back, body:has(#backgammon:not([hidden])) #back, body:has(#blackjack:not([hidden])) #back, body:has(#snakes:not([hidden])) #back, body:has(#four:not([hidden])) #back, body:has(#yatzy:not([hidden])) #back, body:has(#roulette:not([hidden])) #back, body:has(#sea:not([hidden])) #back, body:has(#baccarat:not([hidden])) #back, body:has(#craps:not([hidden])) #back, body:has(#threecard:not([hidden])) #back, body:has(#casinoholdem:not([hidden])) #back, body:has(#paigow:not([hidden])) #back { display: block; }
@media (max-width: 699px) { #back { top: calc(6px + env(safe-area-inset-top)); left: 4px; padding: 3px 10px; font-size: 0.78rem; min-height: 30px; } }

/* 5-max: my cards can be pressed and held to show one. */
#ring.can-hold .rseat.me .rcards .card { cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: none; }
#ring-showhand-row { margin-top: 6px; }
#ring-showhand-row button { flex: 1; }

/* ---- Card styles, chosen per player in the settings ---- */
#cards-pick { flex-wrap: wrap; }
#cards-pick button { flex: 1 1 30%; font-size: 0.82rem; padding: 6px 6px; }
#cards-pick button.picked { background: var(--t15); color: #1b1b1b; border-color: var(--t15); }
/* White cards with one colour per suit. */
html[data-cards="white4"] .card.suit-s, html[data-cards="white4"] .card.suit-h, html[data-cards="white4"] .card.suit-d, html[data-cards="white4"] .card.suit-c,
html[data-cards="classic"] .card.suit-s, html[data-cards="classic"] .card.suit-h, html[data-cards="classic"] .card.suit-d, html[data-cards="classic"] .card.suit-c,
html[data-cards="white4"] .mini, html[data-cards="classic"] .mini { background: #fbfbf8; text-shadow: none; border: 1px solid rgba(0, 0, 0, 0.18); }
html[data-cards="white4"] .suit-s { color: #17181a; }
html[data-cards="white4"] .suit-h { color: #c62828; }
html[data-cards="white4"] .suit-d { color: #1556c0; }
html[data-cards="white4"] .suit-c { color: #1a7f37; }
/* Classic: hearts and diamonds red, spades and clubs black. */
html[data-cards="classic"] .suit-s, html[data-cards="classic"] .suit-c { color: #17181a; }
html[data-cards="classic"] .suit-h, html[data-cards="classic"] .suit-d { color: #c62828; }

/* Samples on the card-style buttons. Each is drawn in its own style whatever is chosen for the page. */
#cards-pick button { display: grid; gap: 6px; justify-items: center; padding: 8px 4px; }
.cards-preview { display: flex; gap: 3px; pointer-events: none; }
.cards-preview .card { width: 24px; height: 34px; font-size: 0.72rem; border-radius: 4px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); }
.cards-preview .card .suit { font-size: 0.74rem; }
.cards-preview.pv-colour4 .card { color: #fff; border: 1px solid rgba(255, 255, 255, 0.45); text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35); }
.cards-preview.pv-colour4 .card.suit-s { background: #23262b; }
.cards-preview.pv-colour4 .card.suit-h { background: #c62828; }
.cards-preview.pv-colour4 .card.suit-d { background: #1556c0; }
.cards-preview.pv-colour4 .card.suit-c { background: #1a7f37; }
.cards-preview.pv-white4 .card, .cards-preview.pv-classic .card { background: #fbfbf8; text-shadow: none; border: 1px solid rgba(0, 0, 0, 0.18); }
.cards-preview.pv-white4 .card.suit-s { color: #17181a; }
.cards-preview.pv-white4 .card.suit-h { color: #c62828; }
.cards-preview.pv-white4 .card.suit-d { color: #1556c0; }
.cards-preview.pv-white4 .card.suit-c { color: #1a7f37; }
.cards-preview.pv-classic .card.suit-s, .cards-preview.pv-classic .card.suit-c { color: #17181a; }
.cards-preview.pv-classic .card.suit-h, .cards-preview.pv-classic .card.suit-d { color: #c62828; }
#cards-pick button.picked .cards-preview .card { box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35); }

/* A proposed rule change: a clear box above the table with Accept / No. */
#rule-requests .request, #ring-rule-requests .request {
  border: 2px solid var(--accent); border-radius: 12px; padding: 10px 12px; margin: 6px 0 8px; background: var(--panel);
  box-shadow: 0 0 0 3px rgba(var(--r1), 0.18); font-size: 0.92rem; text-align: center;
}
.rule-request p { margin: 0 0 8px; font-weight: 600; }
.rule-request .row { margin: 0; }
.rule-request .row button { flex: 1; }
/* Keep the box clear of the buttons in the top corners. */
#rule-requests .request, #ring-rule-requests .request { margin: 40px 46px 8px 4px; }
@media (min-width: 700px) { #rule-requests .request, #ring-rule-requests .request { margin: 6px 0 8px; } }

#table-ready-row, #ring-ready-row { margin-top: 8px; }
#table-ready-row button, #ring-ready-row button { flex: 1; }

/* Top centre seat, used at tables for two or four. */
.rseat.posT { left: 50%; top: 14%; }
.rseat.posT .rbet, .rseat.posT .rwon { top: 100%; margin-top: 3px; }

/* ---- The leaderboard against Mr.GTO ---- */
/* The leaderboards button sits up top with the name and password, where it is easy to spot. */
dialog#buyin { background: var(--bg); color: var(--text); border: 1px solid var(--t0); border-radius: 16px; width: min(420px, calc(100vw - 20px)); padding: 16px; text-align: center; }
dialog#buyin::backdrop { background: rgba(0, 0, 0, 0.7); }
dialog#buyin h2 { margin-top: 0; }
#buyin-options { flex-wrap: wrap; justify-content: center; gap: 8px; margin: 12px 0 6px; }
#buyin-options button { flex: 1 1 100px; font-weight: 700; font-size: 0.85rem; font-variant-numeric: tabular-nums; min-height: 36px; padding: 4px 8px; }
#buyin-options button.picked { background: var(--t15); color: #1b1b1b; border-color: var(--t15); }
#buyin-pick { margin: 6px 0 12px; }
#buyin-slider { width: 100%; height: 34px; accent-color: var(--accent); touch-action: pan-y; }
#buyin-number { justify-content: center; align-items: center; gap: 10px; }
#buyin-amount { flex: 0 1 170px; text-align: center; font-size: 1.4rem; font-weight: 800; font-variant-numeric: tabular-nums; padding: 6px 8px; }
#buyin-range { margin: 6px 0 0; }
#buyin-ok { flex: 2; }
.buyin-change { flex: 0 0 auto !important; font-size: 0.85rem; padding: 0 14px; }
#leaderboard-open { border-color: var(--accent); font-weight: 700; }
dialog#leaderboard { background: var(--bg); color: var(--text); border: 1px solid var(--t0); border-radius: 16px; width: min(640px, calc(100vw - 20px)); max-height: calc(100dvh - 24px); padding: 16px; }
dialog#leaderboard::backdrop { background: rgba(0, 0, 0, 0.7); }
dialog#leaderboard h2 { margin-top: 0; text-align: center; }
#leaderboard-note { text-align: center; margin: 0 0 10px; }
#leaderboard-sort, #leaderboard-sort-bj { margin-bottom: 8px; }
#leaderboard-games { flex-wrap: wrap; gap: 6px; margin-bottom: 8px; justify-content: center; }
#leaderboard-games button { flex: 0 0 auto; white-space: nowrap; font-size: 0.8rem; padding: 5px 12px; min-height: 32px; border-radius: 999px; }
#leaderboard-games button.picked { background: var(--t15); color: #1b1b1b; border-color: var(--t15); }
#leaderboard-games button.lb-none:not(.picked) { opacity: 0.5; }
#leaderboard-table .lb-up { color: #58c98a; font-weight: 700; }
#leaderboard-table .lb-down { color: #e0705f; font-weight: 700; }
#leaderboard-tabs { margin-bottom: 10px; }
#leaderboard-tabs button { flex: 1; font-weight: 700; }
#leaderboard-tabs button.picked { background: var(--t15); color: #1b1b1b; border-color: var(--t15); }
#leaderboard-sort button, #leaderboard-sort-bj button { flex: 1; font-size: 0.8rem; padding: 5px 4px; min-height: 34px; }
#leaderboard-sort button.picked, #leaderboard-sort-bj button.picked { background: var(--t15); color: #1b1b1b; border-color: var(--t15); }
#leaderboard-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
#leaderboard-table th { text-align: left; color: var(--muted); font-weight: 600; padding: 5px 8px 5px 0; border-bottom: 1px solid var(--t0); white-space: nowrap; }
#leaderboard-table td { padding: 6px 8px 6px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.06); font-variant-numeric: tabular-nums; white-space: nowrap; }
#leaderboard-table .lb-name { font-weight: 700; }
#leaderboard-table tr.lb-unranked { opacity: 0.6; }
.stat-scroll { overflow-x: auto; }

/* ---- The chess table ---- */
#chess { max-width: 620px; margin: 0 auto; }
#chess-title { text-align: center; font-weight: 700; font-size: 0.9rem; padding: 0 48px; min-height: 1.3em; margin-bottom: 6px; }
#chess-board-wrap { width: min(100%, calc(100dvh - 300px)); min-width: 260px; margin: 0 auto; }
#chess-board { display: grid; grid-template-columns: repeat(8, 1fr); aspect-ratio: 1; border-radius: 8px; overflow: hidden; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5), 0 0 0 3px var(--t0); container-type: inline-size; }
.csq { position: relative; padding: 0; margin: 0; border: 0; border-radius: 0; min-height: 0; min-width: 0; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.csq.light { background: #e9dcc3; }
.csq.dark { background: #a57f5b; }
.csq.last.light { background: #e6d96f; }
.csq.last.dark { background: #c4a83f; }
.csq.picked { background: #7fb069 !important; }
.csq.check { background: radial-gradient(circle, #ff5a4d 0%, #d93025 45%, transparent 75%), #a57f5b; }
.csq.target::after { content: ''; position: absolute; width: 30%; height: 30%; border-radius: 50%; background: rgba(20, 20, 20, 0.28); }
.csq.capture::after { content: ''; position: absolute; inset: 4%; border-radius: 50%; border: 0.6cqw solid rgba(20, 20, 20, 0.32); }
.cpiece { font-size: 10cqw; line-height: 1; font-family: 'Apple Symbols', 'Segoe UI Symbol', 'Noto Sans Symbols 2', 'DejaVu Sans', sans-serif; pointer-events: none; user-select: none; }
.cpiece.white { color: #fdfdfd; text-shadow: 0 0 1px #000, 0 0 1px #000, 0 1px 2px rgba(0, 0, 0, 0.9), 1px 0 0 #222, -1px 0 0 #222, 0 -1px 0 #222; }
.cpiece.black { color: #1c1c1c; text-shadow: 0 0 1px rgba(255, 255, 255, 0.7), 0 1px 1px rgba(255, 255, 255, 0.35); }
.crank, .cfile { position: absolute; font-size: 2.3cqw; font-weight: 700; pointer-events: none; opacity: 0.75; }
.crank { top: 3%; left: 5%; }
.cfile { bottom: 2%; right: 6%; }
.csq.light .crank, .csq.light .cfile { color: #8a6a4a; }
.csq.dark .crank, .csq.dark .cfile { color: #f0e4cf; }
.cbar { display: flex; align-items: center; gap: 8px; width: min(100%, calc(100dvh - 300px)); min-width: 260px; margin: 6px auto; padding: 4px 6px; border-radius: 10px; min-height: 46px; border: 1px solid transparent; }
.cbar.turn { border-color: var(--accent); background: rgba(255, 255, 255, 0.05); }
.ccam { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; background: #000; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.6); flex: none; }
.ccam.mirror { transform: none; /* my own picture is shown as the others see it, not mirrored */ }
.ccam.blank { display: none; }
.cdot { width: 14px; height: 14px; border-radius: 50%; flex: none; border: 1px solid #777; }
.cdot.white { background: #fdfdfd; }
.cdot.black { background: #1c1c1c; }
.cname { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cready { font-size: 0.72rem; color: #1b1b1b; background: var(--t15); border-radius: 999px; padding: 1px 8px; font-weight: 700; }
.cwon { flex: 1; min-width: 0; display: flex; align-items: center; flex-wrap: wrap; }
.cwon .cpiece { font-size: 1rem; margin-right: -3px; }
.clead { font-size: 0.75rem; color: var(--muted); margin-left: 8px; }
.cclock { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1.25rem; padding: 3px 10px; border-radius: 8px; background: rgba(0, 0, 0, 0.45); color: var(--muted); flex: none; }
.cclock.running { background: #f4f4f4; color: #111; }
.cclock.low.running { background: #d93025; color: #fff; }
#chess-status { text-align: center; font-weight: 700; min-height: 1.5em; margin: 6px 0 2px; }
#chess-error { text-align: center; min-height: 1.2em; margin: 0; }
#chess-time-now { text-align: center; }
.cbar.vacant { cursor: pointer; }
.cbar.vacant .cname { text-decoration: underline; }
#chess-setup p { text-align: center; margin: 6px 0; }
#chess-times { flex-wrap: wrap; justify-content: center; }
#chess-times button { flex: 0 1 auto; font-size: 0.8rem; padding: 5px 10px; min-height: 34px; }
#chess-times button.picked { background: var(--t15); color: #1b1b1b; border-color: var(--t15); }
#chess-moves { list-style: decimal inside; margin: 10px auto; padding: 6px 10px; max-height: 132px; overflow-y: auto; background: rgba(0, 0, 0, 0.25); border-radius: 8px; font-variant-numeric: tabular-nums; font-size: 0.9rem; columns: 2; column-gap: 18px; }
#chess-moves:empty { display: none; }
#chess-moves li { break-inside: avoid; white-space: nowrap; }
.cmove { display: inline-block; min-width: 4.2em; padding-left: 6px; }
dialog#chess-promo { background: var(--bg); color: var(--text); border: 1px solid var(--t0); border-radius: 14px; padding: 14px; text-align: center; }
dialog#chess-promo::backdrop { background: rgba(0, 0, 0, 0.6); }
#chess-promo-row button { width: 60px; height: 60px; padding: 0; background: #a57f5b; }
#chess-promo-row .cpiece { font-size: 2.4rem; }
@media (max-width: 699px) {
  /* Room on the right for the column of round buttons. */
  #chess { padding-top: 46px; } /* room for the row of round buttons along the top */
  #chess-title { padding: 0; }
  #chess-board-wrap, .cbar { width: min(100%, calc(100dvh - 336px)); }
  .cclock { font-size: 1.1rem; }
}

/* Mr.GTO at the chess table: his speech bubble, and the buttons to invite him. */
.cbar { position: relative; }
.cbubble { position: absolute; left: 8px; top: calc(100% + 4px); z-index: 5; max-width: min(320px, 86%); background: #fdfdfd; color: #161616; border-radius: 12px; padding: 7px 11px; font-size: 0.88rem; font-weight: 600; line-height: 1.25; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5); pointer-events: none; }
.cbubble::after { content: ''; position: absolute; left: 18px; top: -12px; border: 6px solid transparent; border-bottom-color: #fdfdfd; }
.cbubble.up { top: auto; bottom: calc(100% + 4px); }
.cbubble.up::after { top: auto; bottom: -12px; border-bottom-color: transparent; border-top-color: #fdfdfd; }
.cbubble.pop { animation: bubble-pop 0.22s ease-out; }
#chess-bot { margin-top: 10px; }
#chess-bot-levels { flex-wrap: wrap; justify-content: center; }
#chess-bot-levels button { flex: 1 1 150px; }

@media (max-width: 699px) { .ccam { width: 56px; height: 56px; } }

/* Phones, at chess and the other board and card games: the round buttons go in
   a row along the top instead of down the right edge, so the table sits in the
   middle of the screen. */
@media (max-width: 699px) {
  body:has(:is(#chess, #ofc, #olsen, #backgammon, #blackjack, #snakes, #four, #yatzy, #roulette, #sea, #baccarat, #craps, #threecard, #casinoholdem, #paigow):not([hidden])) :is(#mute, #voice, #gear, #cam, #mic) {
    top: calc(6px + env(safe-area-inset-top)); width: 36px; min-height: 36px; font-size: 1.05rem;
  }
  body:has(:is(#chess, #ofc, #olsen, #backgammon, #blackjack, #snakes, #four, #yatzy, #roulette, #sea, #baccarat, #craps, #threecard, #casinoholdem, #paigow):not([hidden])) #mute { right: 4px; }
  body:has(:is(#chess, #ofc, #olsen, #backgammon, #blackjack, #snakes, #four, #yatzy, #roulette, #sea, #baccarat, #craps, #threecard, #casinoholdem, #paigow):not([hidden])) #voice { right: 44px; }
  body:has(:is(#chess, #ofc, #olsen, #backgammon, #blackjack, #snakes, #four, #yatzy, #roulette, #sea, #baccarat, #craps, #threecard, #casinoholdem, #paigow):not([hidden])) #gear { right: 84px; }
  body:has(:is(#chess, #ofc, #olsen, #backgammon, #blackjack, #snakes, #four, #yatzy, #roulette, #sea, #baccarat, #craps, #threecard, #casinoholdem, #paigow):not([hidden])) #cam { right: 124px; }
  body:has(:is(#chess, #ofc, #olsen, #backgammon, #blackjack, #snakes, #four, #yatzy, #roulette, #sea, #baccarat, #craps, #threecard, #casinoholdem, #paigow):not([hidden])) #mic { right: 164px; }
}

/* Watchers who joined the call at chess and the other board and card games:
   small pictures down the right edge under the round buttons, and on a phone
   in the row along the top beside them. */
#gc-strip { position: fixed; z-index: 4; right: 8px; top: calc(268px + env(safe-area-inset-top)); display: flex; flex-direction: column; gap: 8px; }
.gc-tile { position: relative; flex: none; width: 44px; height: 44px; border-radius: 10px; overflow: hidden; background: #000; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35); }
.gc-tile b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 1rem; }
.gc-tile video { position: relative; width: 100%; height: 100%; object-fit: cover; display: block; }
.gc-tile video.blank { visibility: hidden; }
.gc-tile video.mirror { transform: none; /* my own picture is shown as the others see it, not mirrored */ }
.gc-tile i { position: absolute; top: 0; left: 1px; font-style: normal; font-size: 0.62rem; line-height: 1.2; text-shadow: 0 0 3px #000; }
.gc-tile.tappable { cursor: pointer; }
.gc-tile.tappable:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#gc-box { max-width: 560px; margin: 0 auto 8px; }
#gc-box .row button { flex: 1; }
#gc-box .gc-join { border-color: var(--accent); font-weight: 700; min-height: 52px; }
#gc-box { margin-top: 8px; }
@media (max-width: 699px) {
  #gc-strip { top: calc(6px + env(safe-area-inset-top)); left: 86px; right: 206px; flex-direction: row-reverse; gap: 5px; overflow-x: auto; padding: 2px; }
  body:has(#cam[hidden]) #gc-strip { right: 126px; } /* no camera and microphone buttons: more room */
  .gc-tile { width: 34px; height: 34px; border-radius: 8px; }
}

/* The link button at a table (invite somebody), its window, and the note in
   the lobby for somebody who came in by such a link. The button is the last
   of the round buttons; at chess and the other board and card games it takes
   the place of the commentator's voice button, which only poker has. */
#invite {
  position: fixed; top: calc(268px + env(safe-area-inset-top)); right: 8px; z-index: 5;
  width: 44px; min-height: 44px; padding: 0; font-size: 1.2rem; background: var(--t1);
}
body:has(#lobby:not([hidden])) #invite { display: none; }
body:has(:is(#chess, #ofc, #olsen, #backgammon, #blackjack, #snakes, #four, #yatzy, #roulette, #sea, #baccarat, #craps, #threecard, #casinoholdem, #paigow):not([hidden])) #voice { display: none; }
body:has(:is(#chess, #ofc, #olsen, #backgammon, #blackjack, #snakes, #four, #yatzy, #roulette, #sea, #baccarat, #craps, #threecard, #casinoholdem, #paigow):not([hidden])) #invite { top: calc(60px + env(safe-area-inset-top)); }
@media (max-width: 699px) {
  #invite { right: 4px; width: 38px; min-height: 38px; top: calc(216px + env(safe-area-inset-top)); }
  body:has(:is(#chess, #ofc, #olsen, #backgammon, #blackjack, #snakes, #four, #yatzy, #roulette, #sea, #baccarat, #craps, #threecard, #casinoholdem, #paigow):not([hidden])) #invite {
    top: calc(6px + env(safe-area-inset-top)); right: 44px; width: 36px; min-height: 36px; font-size: 1.05rem;
  }
}
dialog#invite-box, dialog#invite-join {
  background: var(--bg); color: var(--text); border: 1px solid var(--t0); border-radius: 16px;
  width: min(380px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 16px; text-align: center;
}
dialog#invite-box::backdrop { background: rgba(0, 0, 0, 0.7); }
dialog#invite-join::backdrop { background: rgba(0, 0, 0, 0.85); }
#invite-box h2 { margin: 0 0 6px; font-size: 1.1rem; }
#invite-qr { display: block; width: min(264px, 70vw); height: auto; margin: 10px auto; border-radius: 10px; image-rendering: pixelated; }
#invite-link { width: 100%; margin-bottom: 10px; text-align: center; font-size: 0.85rem; }
#invite-box .row button { flex: 1; }
#invite-note { min-height: 1.3em; margin: 8px 0; }
#invited { max-width: 640px; margin: 10px auto; text-align: center; }
#invited .row { justify-content: center; margin-top: 8px; }

/* The invitation somebody sees when they open a link to a table. */
#invite-join h2 { margin: 0 0 4px; font-size: 1.25rem; }
#invite-join form { display: grid; gap: 10px; text-align: center; }
#invite-join label { text-align: left; font-weight: 600; margin-bottom: -4px; }
#invite-join input { width: 100%; font-size: 1.1rem; }
#invite-join #invite-join-key-row { display: grid; gap: 6px; }
#invite-join #invite-join-key-row[hidden], #invite-join-media[hidden] { display: none; }
#invite-join p { margin: 0; }
#invite-join .row { margin: 0; }
#invite-join .row button { flex: 1; }
#invite-join-go { min-height: 52px; font-size: 1.1rem; }
#invite-join-media { display: grid; gap: 8px; padding: 10px; border-radius: 12px; background: var(--panel); }
#invite-join-media button[aria-pressed="true"] { border-color: var(--accent); background: var(--t16); }
#invite-join-error:empty { display: none; }

/* Round camera pictures at the heads-up poker tables too, like at every other
   table: the two players' by their cards, and the watchers who were let in. */
.poker-table .hand .cam, .poker-table #me .hand .cam,
.poker-table .seat.four .hand .cam, .poker-table #me.four .hand .cam {
  width: 64px; height: 64px; aspect-ratio: auto; border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.6);
}
.poker-table .seat.four .hand .cam, .poker-table #me.four .hand .cam { width: 48px; height: 48px; } /* four cards leave less room beside them */
@media (min-width: 700px) {
  .poker-table .hand .cam, .poker-table #me .hand .cam { width: 88px; height: 88px; }
  .poker-table .seat.four .hand .cam, .poker-table #me.four .hand .cam { width: 76px; height: 76px; }
  .poker-table .hand:has(.cam:not([hidden])) { min-height: 92px; }
}
.guest, #guests .guest { width: 72px; height: 72px; border-radius: 50%; }
.guest span { text-align: center; }
@media (min-width: 700px) { #guests .guest { width: 96px; height: 96px; } }
@media (max-width: 699px) { #guests .guest { width: 44px; height: 44px; } }
.gc-tile { border-radius: 50%; }
@media (max-width: 699px) { .gc-tile { border-radius: 50%; } }
/* Phones: the watchers' pictures start below the link button, which is the last of the round buttons down the right edge. */
@media (max-width: 699px) { .poker-table #guests { top: 56px; } }

/* The lobby's two tabs: poker first, the other games one tap away. */
#lobby-tabs { justify-content: center; margin: 10px auto 12px; max-width: 520px; }
#lobby-tabs button { flex: 1; font-weight: 700; min-height: 46px; }
#lobby-tabs button.picked { background: var(--t15); color: #1b1b1b; border-color: var(--t15); }
@media (min-width: 900px) {
  #tables.other { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #tables.other .table-card:last-child { grid-column: auto; grid-row: auto; }
}

/* My own camera picture, mirrored, at every table. "scale" is used (not
   "transform") so that it adds to whatever places the picture where it is. */
video.own-cam { scale: -1 1; }
/* Blackjack and baccarat have a dealer who speaks: the voice button is there too,
   under the others (on phones: at the end of the row along the top). */
body:has(:is(#blackjack, #baccarat):not([hidden])) #voice { display: revert; top: calc(268px + env(safe-area-inset-top)); }
@media (max-width: 699px) {
  body:has(:is(#blackjack, #baccarat):not([hidden])) #voice { top: calc(6px + env(safe-area-inset-top)); right: 204px; }
}

/* Add to home screen: a quiet button under the name box, and its explanation. */
#install-open { margin-top: 10px; width: 100%; }
#install-note { margin: 8px 0 0; font-size: 14px; line-height: 1.4; }

/* Bet sliders handle the finger themselves (tap = half a big blind), so the page must not scroll or zoom from them. */
#amount-range, #ring-range { touch-action: none; }

/* The small "i" on a casino table and the explanation it opens. */
.game-info {
  position: absolute; top: 7px; left: 7px; z-index: 6; box-sizing: border-box;
  width: 22px; height: 22px; min-width: 0; min-height: 0; padding: 0; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.4); background: rgba(0, 0, 0, 0.18); color: rgba(255, 255, 255, 0.7);
  font: italic 700 13px/1 Georgia, 'Times New Roman', serif; cursor: pointer;
}
/* a bigger area to tap than the eye sees */
.game-info::after { content: ''; position: absolute; inset: -9px; }
.game-info:hover, .game-info:focus-visible { background: rgba(0, 0, 0, 0.45); border-color: #fff; color: #fff; }
/* craps has the house's name in that corner: it moves over for the i */
#craps #cr-house, #baccarat #bc-house { padding-left: 26px; }
dialog#game-help {
  width: min(520px, calc(100vw - 24px)); max-height: min(86vh, 86dvh); overflow-y: auto;
  border: 1px solid #3a4a44; border-radius: 14px; background: #16211d; color: inherit; padding: 16px;
}
dialog#game-help::backdrop { background: rgba(0, 0, 0, 0.7); }
dialog#game-help h2 { margin-top: 0; text-align: center; }
dialog#game-help h3 { margin: 14px 0 4px; font-size: 0.95rem; }
dialog#game-help p { margin: 6px 0; font-size: 0.92rem; line-height: 1.4; }
dialog#game-help ul { margin: 6px 0; padding-left: 20px; font-size: 0.92rem; line-height: 1.45; }
/* blackjack has the discard tray in that corner: the i goes just under it */
#blackjack .game-info { top: 54px; }

/* 6- and 7-card PLO: the hands are wider than the table, so the cards get smaller. */
#me.four .cards:has(.card:nth-child(6)), #opp.four .cards:has(.card:nth-child(6)) { gap: 3px; }
#me.four .cards:has(.card:nth-child(6)) .card, .poker-table #me.four .cards:has(.card:nth-child(6)) .card { width: 36px; height: 52px; font-size: 0.98rem; }
#me.four .cards:has(.card:nth-child(6)) .card .suit { font-size: 1.02rem; }
#opp.four .cards:has(.card:nth-child(6)) .card, .poker-table #opp.four .cards:has(.card:nth-child(6)) .card { width: 30px; height: 42px; font-size: 0.85rem; }
@media (min-width: 700px) {
  #me.four .cards:has(.card:nth-child(6)) .card, .poker-table #me.four .cards:has(.card:nth-child(6)) .card { width: 44px; height: 62px; font-size: 1.1rem; }
}
.rseat.me .rcards.four:has(.card:nth-child(6)) { gap: 1px; }
.rseat.me .rcards.four:has(.card:nth-child(6)) .card { width: 26px; height: 38px; font-size: 0.74rem; }
.rseat.me .rcards.four:has(.card:nth-child(6)) .card .suit { font-size: 0.76rem; }
.rseat.me .rcards.four:has(.card:nth-child(7)) .card { width: 23px; height: 34px; font-size: 0.68rem; }
.rseat:not(.me) .rcards.four:has(.card:nth-child(6)) .card + .card { margin-left: -9px; }

/* "Be the house": drawn like an empty seat, where the house sits. */
.house-seat {
  display: inline-flex; flex-direction: column; align-items: center; gap: 1px; margin: 4px 0 2px; padding: 5px 12px; min-height: 0;
  border: 1.5px dashed rgba(255, 255, 255, 0.55); border-radius: 10px; background: rgba(0, 0, 0, 0.22); color: #fff; cursor: pointer;
}
.house-seat[hidden] { display: none; }
.house-seat b { font-size: 0.8rem; text-decoration: underline; }
.house-seat b, .house-seat span { white-space: nowrap; }
.house-seat span { font-size: 0.66rem; font-weight: 600; color: rgba(255, 255, 255, 0.7); }
.house-seat:hover:not(:disabled), .house-seat:focus-visible { background: rgba(0, 0, 0, 0.45); border-color: #fff; }
.house-seat:disabled { opacity: 0.6; cursor: default; }
.house-seat:disabled b { text-decoration: none; }

/* Bomb pot: the "next hand" line on the felt is a glowing pill, and a big
   banner drops over the table when the bomb card lands and when the hand starts. */
#bomb-next, #ring-bomb-next {
  display: inline-block; margin-top: 6px; padding: 5px 14px; border-radius: 999px;
  font-size: 0.95rem; font-weight: 900; letter-spacing: 0.06em; text-transform: uppercase;
  color: #1b1b1b; background: linear-gradient(180deg, #ffd34d, #ff8a1f);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35);
  animation: bomb-pulse 1.1s ease-in-out infinite;
}
#bomb-next[hidden], #ring-bomb-next[hidden] { display: none; }
@keyframes bomb-pulse { 50% { transform: scale(1.07); } }

/* Kept light to draw (no screen-sized shadow, no glow): it must never slow a phone
   down while somebody has a decision to make. It sits over the felt, clear of the buttons. */
#bomb-banner {
  position: fixed; left: 50%; top: 30%; z-index: 60; pointer-events: none;
  display: none; flex-direction: column; align-items: center; text-align: center;
  width: max-content; max-width: 94vw; padding: 14px 26px 16px; border-radius: 20px;
  color: #fff; background: radial-gradient(ellipse at 50% 30%, #ff9a2e, #c42a10 70%, #7a1206);
  border: 3px solid #ffd34d;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.6);
  transform: translate(-50%, -50%);
}
#bomb-banner.show { display: flex; animation: bomb-drop 2.2s cubic-bezier(0.2, 0.9, 0.3, 1) both; }
#bomb-banner i { font-style: normal; font-size: 3.4rem; line-height: 1; animation: bomb-shake 0.5s linear 0.25s 3; }
#bomb-banner b { font-size: clamp(2.4rem, 12vw, 4.6rem); font-weight: 900; line-height: 1; letter-spacing: 0.04em;
  text-shadow: 0 3px 0 #5a0d04; }
#bomb-banner span { margin-top: 6px; font-size: clamp(1.1rem, 5vw, 1.7rem); font-weight: 800; letter-spacing: 0.18em;
  text-transform: uppercase; color: #ffe08a; }
#bomb-banner.live span { letter-spacing: 0.06em; font-size: clamp(0.9rem, 4vw, 1.2rem); }
@keyframes bomb-drop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(1.35) rotate(-4deg); }
  9% { opacity: 1; transform: translate(-50%, -50%) scale(0.92) rotate(2deg); }
  14% { transform: translate(-50%, -50%) scale(1.06) rotate(-1deg); }
  19%, 84% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(0.85); }
}
@keyframes bomb-shake { 25% { transform: rotate(-14deg); } 75% { transform: rotate(14deg); } }
@media (prefers-reduced-motion: reduce) {
  #bomb-next, #ring-bomb-next, #bomb-banner i { animation: none; }
  #bomb-banner.show { animation: bomb-fade 2.2s linear both; }
}
@keyframes bomb-fade { 0%, 100% { opacity: 0; } 8%, 88% { opacity: 1; } }

/* 5-seat tables: each player's chances at their seat while an all-in runs out. */
.rpct { display: inline-block; margin-top: 2px; padding: 1px 8px; border-radius: 999px; font-size: 0.82rem; font-weight: 900;
  color: #1b1b1b; background: var(--accent); }

/* Fold asked for while checking is free: the button asks once more. */
button.asking { font-size: 0.78rem; line-height: 1.1; }


/* The bug button (report a bug or suggest an idea) and its box. */
/* It is one of the buttons down the right edge: the same size and shape as the others, and the last in the column. */
#report-open {
  position: fixed; top: calc(320px + env(safe-area-inset-top)); right: 8px; z-index: 5;
  width: 44px; min-height: 44px; padding: 0; font-size: 1.2rem; line-height: 1;
  background: var(--t1);
}
/* In the lobby only the settings wheel is above it; at the board and casino tables the column is one shorter. */
body:has(#lobby:not([hidden])) #report-open { top: calc(60px + env(safe-area-inset-top)); }
body:has(:is(#chess, #ofc, #olsen, #backgammon, #blackjack, #snakes, #four, #yatzy, #roulette, #sea, #baccarat, #craps, #threecard, #casinoholdem, #paigow):not([hidden])) #report-open { top: calc(268px + env(safe-area-inset-top)); }
@media (max-width: 699px) {
  #report-open { right: 4px; width: 38px; min-height: 38px; top: calc(258px + env(safe-area-inset-top)); }
  body:has(#lobby:not([hidden])) #report-open { top: calc(48px + env(safe-area-inset-top)); }
}
dialog#report-box {
  background: var(--bg); color: var(--text);
  border: 1px solid var(--t0); border-radius: 16px;
  width: min(440px, calc(100vw - 24px)); max-height: calc(100dvh - 24px);
  padding: 16px;
}
dialog#report-box::backdrop { background: rgba(0, 0, 0, 0.7); }
dialog#report-box h2 { margin-top: 0; text-align: center; }
dialog#report-box .row button[aria-pressed="true"] { border-color: var(--accent); background: var(--t16); }
#report-text {
  width: 100%; box-sizing: border-box; margin-top: 10px; padding: 10px; border-radius: 12px; resize: vertical;
  background: var(--panel); color: var(--text); border: 1px solid var(--t0); font: inherit; font-size: 16px;
}
#stats-reports { padding-left: 1.2em; font-size: 0.85rem; display: grid; gap: 10px; }
#stats-reports .report-text { margin: 3px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }

/* The round buttons at the edges (sound, voice, camera, microphone, settings, invite, back, report)
   stay on top of whatever table scrolls under them: the roulette layout and the chips and speech
   bubbles of the casino tables are layered up to 8. */
#mute, #voice, #cam, #mic, #gear, #invite, #back, #report-open, #gc-strip, #guests { z-index: 12; }
/* Phones, at those tables: the bug button takes the next place in that row, instead of sitting on top of its neighbours. */
@media (max-width: 699px) {
  body:has(:is(#chess, #ofc, #olsen, #backgammon, #blackjack, #snakes, #four, #yatzy, #roulette, #sea, #baccarat, #craps, #threecard, #casinoholdem, #paigow):not([hidden])) #report-open {
    top: calc(6px + env(safe-area-inset-top)); right: 204px; width: 36px; min-height: 36px; font-size: 1.05rem;
  }
}

/* The red/black flop side bet at a table for more than two: a small mark by the name of everybody in it. */
.rside { font-size: 0.7rem; line-height: 1; flex: 0 0 auto; }
.rside-red { color: #ff5a5a; }
.rside-black { color: #d9d9d9; }

/* ---- at the door: no password given yet. What is behind the blur is a stand-in, not the real tables. ---- */
#lobby.locked #lobby-tabs, #lobby.locked #tables, #lobby.locked #lobby-bot-note { filter: blur(7px); opacity: 0.55; pointer-events: none; user-select: none; }
#lobby.locked #tables { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
#lobby.locked #enter { width: 100%; }
#lobby.locked #join-form { display: flex; flex-direction: column; align-items: stretch; gap: 8px; max-width: 420px; margin: 0 auto 18px; }
#lobby.locked #join-form #password-row { display: flex; flex-direction: column; gap: 8px; }
#lobby.locked #gate-text { order: -1; text-align: center; margin: 0 0 4px; font-size: 0.9rem; }
#lobby.locked #enter { margin-top: 6px; }
