:root {
  --bg: #0f1419;
  --panel: #1a2129;
  --panel2: #26303b;
  --border: #33404d;
  --text: #e6edf3;
  --muted: #8b98a5;
  --green: #2ea043;
  --blue: #1f6feb;
  --red: #da3633;
  --gold: #f0c000;
  --felt: #12305c;
  --rail: #3b2614;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: 'Quattrocento Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: inherit; }
.muted { color: var(--muted); }
.small { font-size: 0.85em; }
[hidden] { display: none !important; }

button {
  font: inherit;
  cursor: pointer;
  border: 0;
  border-radius: 8px;
  padding: 0.5em 0.95em;
  background: var(--panel2);
  color: var(--text);
}
button:hover { filter: brightness(1.2); }
button.primary { background: var(--green); }
button.blue { background: var(--blue); }
button.danger { background: var(--red); }
button.big { font-size: 1.15em; padding: 0.7em 1.4em; }

input {
  font: inherit;
  background: #0d1117;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.45em 0.6em;
  width: 100%;
}
label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.9em; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.75rem; align-items: end; }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } /* always one line, also on phones */
.row { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; margin-top: 1rem; }

#toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translate(-50%, 200%);
  background: var(--panel2);
  border: 1px solid var(--border);
  padding: 0.7rem 1.2rem;
  border-radius: 10px;
  transition: transform 0.25s;
  z-index: 100;
}
#toast.show { transform: translate(-50%, 0); }

/* ---- start page: a table (table page styles) with Create game and Join in the middle ---- */
/* the middle panel: two boxes side by side, Create game and Join a game */
/* solid and on top: the made-up game's board and pot lie under it, as in a game */
.start-overlay.home-overlay { width: min(36em, calc(100% - 4em)); box-sizing: border-box; background: #0a1220; z-index: 20; }
.home-boxes { display: flex; gap: 1.2em; width: 100%; }
.home-box {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  padding: 1em;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(120, 180, 255, 0.2);
  border-radius: 0.7em;
}
.home-box-title { font-size: 0.8em; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255, 255, 255, 0.55); }
.home-box .start-hint { white-space: normal; text-align: center; }
.home-overlay .copy-btn { font-size: 1.35em; font-weight: 700; padding: 0.6em 0; width: 100%; border-radius: 0.6em; }
.home-join #home-join { width: 100%; }
.home-join .join-row input { font-size: 16px; padding: 0.25em 0.5em; min-width: 0; } /* 16px: iPhone doesn't zoom in on the box */
.home-join .join-row button { padding: 0.25em 0.7em; font-size: 0.85em; }
/* the PokerLM chip at the top left of the header */
.home-logo { display: flex; }
.home-logo img { width: 40px; height: 40px; display: block; }

/* no betting buttons on the right, so the table stays centred on a sideways phone */
body.home-table.phone-landscape .table-area { padding-right: env(safe-area-inset-right); }
/* upright phone: the panel fits between the side seats, with the two boxes stacked */
body.home-table.phone-portrait .home-overlay { width: calc(100% - 15em); padding: 1em 0.8em; }
body.home-table.phone-portrait .home-overlay .start-title { white-space: normal; text-align: center; }
body.home-table.phone-portrait .home-boxes { flex-direction: column; gap: 0.7em; }
body.home-table.phone-portrait .home-box { padding: 0.7em 0.6em; }
body.home-table.phone-portrait .home-overlay .copy-btn { font-size: 1.2em; }
/* the made-up hand on the start page's table: only for looks, nothing reacts to the mouse, and dimmed
   so it doesn't look like a live game */
.home-player, .home-bit { pointer-events: none; user-select: none; }
body.home-table .felt { filter: brightness(0.6) saturate(0.7); }
.home-player, .home-bit, .seat.home-seat { filter: brightness(0.5) saturate(0.6); }
/* sideways phone: a more compact middle panel, so it clears the bottom seat's cards */
body.home-table.phone-landscape .home-overlay { gap: 0.4em; padding: 0.7em 1em; transform: translate(-50%, calc(-50% - 0.8em)); }
body.home-table.phone-landscape .home-box { padding: 0.6em; gap: 0.4em; }
/* the empty seats around the start page's table: greyed out, only for looks */
.seat.home-seat {
  width: 7em;
  padding: 0.8em 0;
  justify-content: center;
  background: rgba(20, 26, 36, 0.55);
  border: 1px dashed rgba(160, 170, 185, 0.3);
  border-radius: 0.7em;
  color: rgba(180, 190, 205, 0.45);
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
}
/* the game setup pop-up: the long form scrolls inside it on small screens */
dialog.create-dialog {
  width: min(560px, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem);
  overflow: auto;
}
.create-dialog form { margin: 0.5rem 0 1rem; display: flex; flex-direction: column; gap: 1rem; }

/* ---- table page ---- */
body.table-page { position: relative; display: flex; flex-direction: column; overflow: hidden; }
header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
header .title { font-weight: 700; text-decoration: none; display: flex; flex: none; }
/* the PokerLM chip logo, with the game (Pot-Limit Omaha...) and hand / host next to it */
header .title img { width: 34px; height: 34px; display: block; }


header .game-mode { font-weight: 700; color: var(--text); }
header .gm-short { display: none; }

/* before the game starts: on the table, white */
.not-started { color: #fff; font-weight: 700; }
 /* fits between the side seats */
header .header-info { display: flex; flex-direction: column; margin-right: auto; line-height: 1.3; }
.badge { background: var(--red); border-radius: 999px; padding: 0 0.45em; font-size: 0.8em; margin-left: 0.2em; }
#banner { background: var(--red); text-align: center; padding: 0.4rem; }

.layout { flex: 1; display: flex; min-height: 0; }
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
/* The table fits the space left between the top bar and the bottom row (cq units = this box). */
.table-area { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0; padding: 0 0.5rem; container-type: size; }

#table {
  position: relative;
  /* Seats stick out above (cards) and below the table box, so keep 8.2em free vertically. */
  width: min(100cqw, calc((100cqh - 8.2em) * 1.75));
  aspect-ratio: 1.75 / 1;
  margin: 5.6em 0 2.6em;
  /* everything on the table scales with the space the table gets (so short screens shrink the cards too) */
  font-size: clamp(9px, min(100cqw / 66, 100cqh * 1.75 / 76), 26px);
}
.felt {
  position: absolute;
  inset: 12% 9%;
  border-radius: 999px;
  background: radial-gradient(ellipse at center, #1c4680 0%, var(--felt) 60%, #0b1f3d 100%);
  border: 0.9em solid var(--rail);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.5), 0 10px 30px rgba(0, 0, 0, 0.6);
}
.felt {
  display: grid;
  place-items: center;
}
.felt-logo {
  font-family: 'Quattrocento Sans', system-ui, sans-serif;
  font-weight: 700;
  font-size: 3.6em;
  letter-spacing: 0.14em;
  /* solid colour so the outline that thickens the letters doesn't leave darker edges */
  color: #3f6fae;
  -webkit-text-stroke: 0.04em #3f6fae;
  padding-left: 0.14em; /* balance the trailing letter-spacing so it stays centred */
  user-select: none;
  pointer-events: none;
}
.center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, calc(-50% + var(--center-dy, 0em))); /* table.js nudges it off a seat */
  text-align: center;
}
/* Pot above and messages below the board, positioned so they never move the cards. */
.above-board, .below-board {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4em;
  width: max-content;
  max-width: 60vw;
}
.above-board { bottom: calc(100% + 0.5em); }
.below-board { top: calc(100% + 0.5em); }
/* Host's start panel in the middle of the table. */
.start-overlay {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7em;
  padding: 1.2em 1.8em;
  background: rgba(10, 20, 40, 0.75);
  border: 1px solid rgba(120, 180, 255, 0.3);
  border-radius: 1em;
  box-shadow: 0 0.6em 2em rgba(0, 0, 0, 0.5);
  text-align: center;
}
.start-title { font-weight: 700; color: var(--text); }
/* Top bar buttons (Away, Leave Table, Pause...) and Start game: one outlined look and size. */
.top-bar button,
.start-slot .start-btn {
  min-width: 9.5em;
  font-size: 1em;
  font-weight: 700;
  padding: 0.55em 1.3em;
  white-space: nowrap;
  background: transparent;
  color: var(--text);
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-radius: 6px;
}
.top-bar button:hover,
.start-slot .start-btn:hover { background: rgba(255, 255, 255, 0.08); filter: none; }
.copy-btn { background: var(--blue); font-size: 0.9em; white-space: nowrap; }
.start-hint { font-size: 0.85em; color: rgba(255, 255, 255, 0.7); white-space: nowrap; }
button:disabled { cursor: not-allowed; }
#game-controls:empty { display: none; }
.board {
  --card-scale: 2; /* board card size; hole cards stay at 1.65 */
  display: flex;
  gap: 0.5em;
  width: calc(5 * 3.2em * var(--card-scale) + 4 * 0.5em); /* five fixed card spots */
  height: calc(4.5em * var(--card-scale));
}
.board .card { font-size: calc(1em * var(--card-scale)); }
.pot { background: rgba(0, 0, 0, 0.35); padding: 0.2em 0.8em; border-radius: 999px; font-weight: 600; }
.results { background: rgba(0, 0, 0, 0.45); padding: 0.3em 0.8em; border-radius: 8px; font-weight: 600; color: #7ee787; }
.paused-label { font-weight: 700; color: var(--gold); letter-spacing: 0.1em; }

.card {
  width: 3.2em;
  height: 4.5em;
  background: #fff;
  color: #111;
  border-radius: 0.35em;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  line-height: 1;
  font-size: 1.65em; /* 1.5x the original 1.1em */
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}
.card .r { font-size: 1.3em; }
.card .s { font-size: 1.5em; }
.card.suit-h { color: #d0161b; }
.card.suit-d { color: #d0161b; } /* classic two-color deck: red diamonds */
.card.suit-c { color: #111; } /* and black clubs */
/* Bee-style back: diamond lattice inside a white margin. Colour (or picture) picked by the host, red by default. */
.card.back { --back: #b3141c; --back-edge: #7d0d13; }
.back-green .card.back { --back: #17713a; --back-edge: #0c4523; }
.back-purple .card.back { --back: #5d2a94; --back-edge: #38175c; }
/* the picker shows each colour whatever is chosen */
.card.back.back-red { --back: #b3141c; --back-edge: #7d0d13; }
.card.back.back-green { --back: #17713a; --back-edge: #0c4523; }
.card.back.back-purple { --back: #5d2a94; --back-edge: #38175c; }
.card.back {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 12'%3E%3Cpath d='M5 0L10 6L5 12L0 6Z' fill='none' stroke='%23f7e9e6' stroke-width='0.9'/%3E%3Cpath d='M5 3.4L7.2 6L5 8.6L2.8 6Z' fill='%23f7e9e6' fill-opacity='0.55'/%3E%3C/svg%3E")
      center / 0.42em 0.5em padding-box,
    var(--back) padding-box;
  border: 0.16em solid #fbfaf7;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5), inset 0 0 0 0.05em var(--back-edge);
}
/* the host's picture, filling the card inside the white margin */
body.back-image .card.back:not(.back-red, .back-green, .back-purple), .card.back.back-image {
  --back-edge: rgba(0, 0, 0, 0.35);
  background: var(--back-image) center / cover padding-box, #333 padding-box;
}
/* the picker before a picture is uploaded: a dashed "+" tile */
.card.back.back-image.empty {
  background: none;
  border: 0.1em dashed var(--muted);
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card.back.back-image.empty::after { content: '+'; color: var(--muted); font-size: 1.3em; }
.card.small { width: 2.5em; height: 3.5em; font-size: 1.425em; /* 1.5x the original 0.95em */ }

/* Hole cards slide from the middle of the table to the seat. */
.card.deal { animation: deal 0.4s ease-out backwards; }
@keyframes deal {
  from { transform: translate(var(--from-x, 0), var(--from-y, 0)) rotate(-25deg) scale(0.6); opacity: 0; }
  30% { opacity: 1; }
  to { transform: none; opacity: 1; }
}
/* Board cards drop in and flip face up. */
.card.flip { animation: flip 0.45s ease-out backwards; }
@keyframes flip {
  from { transform: translateY(-0.25em) rotateY(90deg); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.seat {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 9.5em;
}
/* Always the height of a hole card (2.5 x 3.5em at 1.425em), even with no cards, so the seat never moves. */
.seat .cards { display: flex; align-items: flex-end; gap: 0.2em; margin-bottom: -1.3em; height: calc(3.5em * 1.425); }
.plate {
  position: relative;
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 0.6em;
  padding: 0.25em 0.5em 0.55em; /* bottom room for the timer bar */
  width: 100%;
  text-align: center;
}
.seat.me .plate { border-color: #4b6584; }
/* whose turn it is: the name box lights up bright blue */
.seat.turn .plate { background: #1f6feb; border-color: #8cc1ff; box-shadow: 0 0 0.9em rgba(56, 139, 253, 0.7); color: #fff; }
.seat.turn .plate .timer { background: rgba(9, 25, 60, 0.55); }
.seat.winner .plate { border-color: rgba(46, 160, 67, 0.6); box-shadow: 0 0 0.6em rgba(46, 160, 67, 0.25); }
/* Folded / away seats are dimmed, except cards the player chose to show. */
/* darkened rather than see-through, so shown cards never show through the name plate */
.seat.dim .plate, .seat.dim .seat-tags, .seat.dim .card:not(.shown) { filter: brightness(0.5) saturate(0.6); }
.name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 0.9em; }
.stack { font-weight: 700; }
.timer { position: absolute; left: 0.5em; right: 0.5em; bottom: 0.18em; height: 0.3em; background: var(--border); border-radius: 2px; overflow: hidden; }
.timer i { display: block; height: 100%; width: 100%; background: var(--gold); transition: width 0.1s linear; }
/* Time Bank in use: the extra time is a purple part at the left end of the same bar */
.timer b { position: absolute; left: 0; top: 0; height: 100%; width: 0; background: #a371f7; transition: width 0.1s linear; }
/* Labels under a seat (action, +amount, hand name, win %): solid pills, easy to read. */
.tag, .hand-name, .equity {
  margin-top: 0.22em;
  font-size: 0.8em;
  background: #161d25;
  border: 1px solid #3a4756;
  color: var(--text);
  padding: 0.05em 0.6em;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 0.1em 0.3em rgba(0, 0, 0, 0.4);
}
.seat.winner .hand-name { background: #13201a; border-color: rgba(46, 160, 67, 0.5); color: #a9d8b0; font-weight: 700; }
.seat.winner .tag { color: #7ee787; font-weight: 700; }

/* Empty seat: a see-through box with a thin blue-grey edge, its seat number small in the top-right corner */
button.seat.empty {
  width: 7em;
  padding: 0.8em 0;
  background: transparent;
  border: 1px solid rgba(140, 175, 230, 0.35);
  border-radius: 0.7em;
  box-shadow: none;
  color: #b4c3d6;
  font-weight: 600;
  letter-spacing: 0.04em;
  overflow: visible;
}
button.seat.empty:hover { color: #fff; border-color: var(--blue); background: transparent; filter: none; }
button.seat.empty::after {
  content: attr(data-num);
  position: absolute;
  top: 0.3em;
  right: 0.5em;
  font-size: 0.7em;
  font-weight: 700;
  line-height: 1;
  color: #b4c3d6;
  opacity: 0.8;
  pointer-events: none;
}
button.seat.empty:hover::after { color: #fff; }

.bet {
  position: absolute;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--gold);
  padding: 0.1em 0.6em;
  border-radius: 999px;
  font-size: 0.9em;
  font-weight: 700;
}
.dealer {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 1.6em;
  height: 1.6em;
  border-radius: 50%;
  background: #fff;
  color: #000;
  font-weight: 800;
  display: grid;
  place-items: center;
  font-size: 0.85em;
}

.action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
  padding: 0.6rem;
}
.action-bar > button { min-width: 6.5em; font-weight: 600; }
.raise { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; justify-content: center; }
.presets { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.25rem; }
.presets button { padding: 0.35em 0.6em; font-size: 0.85em; white-space: nowrap; }
#raise-slider { width: 160px; padding: 0; }
/* the slider with a − and + button on either side (one big blind per press) */
.slider-row { display: flex; align-items: center; gap: 0.3rem; }
.slider-row #raise-slider { flex: 1; width: auto; min-width: 0; }
.slider-row .step { flex: none; width: 2em; height: 2em; padding: 0; border-radius: 50%; font-size: 1.05em; font-weight: 700; line-height: 1; display: grid; place-items: center; }
#raise-input { width: 7em; }
#raise-btn { font-weight: 600; }

/* Your own controls: a narrow stack in the top-left corner, floating beside the table. */
.top-bar {
  position: absolute;
  top: calc(var(--header-h, 52px) + 0.6rem);
  left: 0.75rem;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
  max-width: 14rem;
  color: var(--muted);
  font-size: 0.9em;
}
.top-bar button {
  width: 8.5em;
  min-width: 0;
  padding: 0.5em 0.6em;
  /* slightly see-through text and border */
  color: rgba(255, 255, 255, 0.72);
  border-color: rgba(255, 255, 255, 0.28);
}
.top-bar button:hover { color: var(--text); }
/* Icon above the label */
.top-bar .icon-btn,
.start-slot .icon-btn { display: flex; flex-direction: column; align-items: center; gap: 0.3em; padding: 0.55em 0.6em 0.45em; }
.icon-btn svg { width: 1.9em; height: 1.9em; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* Bottom row: chat (left) · action bar (middle) · Start game (right). */
.bottom-row {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr) auto; /* right column only as wide as the Start button */
  gap: 0.75rem;
  align-items: end;
  padding: 0 0.75rem 0.6rem;
}
.bottom-row .chat { grid-column: 1; }
.bottom-row .action-bar { grid-column: 2; }
.start-slot { grid-column: 3; display: flex; justify-content: flex-end; }

.chat {
  position: relative;
  background: rgba(26, 33, 41, 0.85);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.4rem 0.5rem 0.5rem;
  font-size: 0.9em;
}
/* Shows the last 3 lines; scroll up for older messages. */
.chat-messages { height: calc(3 * 1.45em); overflow-y: auto; line-height: 1.45; padding-right: 0.25rem; }
.chat-line { overflow-wrap: anywhere; }
.chat-form { display: flex; gap: 0.35rem; margin-top: 0.35rem; }
.chat-form input { flex: 1; min-width: 0; padding: 0.35em 0.5em; }
.chat-form button { padding: 0.35em 0.7em; }
.emoji-btn { background: transparent; font-size: 1.1em; padding: 0.2em 0.35em !important; }
.emoji-picker {
  position: absolute;
  bottom: calc(100% + 0.4rem);
  left: 0;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.15rem;
  padding: 0.4rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  z-index: 30;
}
.emoji-picker button { background: transparent; font-size: 1.3em; padding: 0.15em; line-height: 1; }
.emoji-picker button:hover { background: var(--panel2); }

/* Floats over the table (below the header) instead of pushing it aside. */
.log-panel {
  position: fixed;
  top: var(--header-h, 52px);
  right: 0;
  bottom: 0;
  z-index: 40;
  width: min(320px, 100%);
  background: rgba(26, 33, 41, 0.85);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.4);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.log-panel h3 { margin: 0; padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--border); }
#log { overflow-y: auto; padding: 0.5rem 0.8rem; font-size: 0.85em; flex: 1; }
.log-line { padding: 0.1rem 0; }
.log-line.hand-start { margin-top: 0.5rem; font-weight: 700; }

.drawer {
  position: fixed;
  top: var(--header-h, 52px);
  right: 0;
  bottom: 0;
  width: min(380px, 100%);
  background: rgba(26, 33, 41, 0.85);
  border-left: 1px solid var(--border);
  overflow-y: auto;
  padding: 0 1rem 1rem;
  z-index: 50;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
}
.drawer-head { display: flex; justify-content: space-between; align-items: center; }
.drawer section { border-top: 1px solid var(--border); padding: 0.5rem 0 0.8rem; }
.drawer h4 { margin: 0.4rem 0 0.6rem; }
.list-row { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; padding: 0.3rem 0; }
.list-row button { padding: 0.3em 0.7em; font-size: 0.85em; }

dialog {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  min-width: min(340px, 90vw);
}
dialog::backdrop { background: rgba(0, 0, 0, 0.6); }
dialog h3 { margin-top: 0; }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.dialog-x { background: none; color: var(--muted); padding: 0.1em 0.4em; font-size: 1.1em; margin: -0.3rem -0.6rem 0 0; }
.dialog-x:hover { color: var(--text); }
dialog form label { margin-bottom: 0.75rem; }
table.ledger { border-collapse: collapse; width: 100%; }
table.ledger th, table.ledger td { padding: 0.4rem 0.6rem; text-align: right; border-bottom: 1px solid var(--border); }
table.ledger th:first-child, table.ledger td:first-child { text-align: left; }
.pos { color: #7ee787; }
.neg { color: #ff7b72; }



/* Ledger pop-up: see-through, with Ledger / Pay out tabs. */
dialog.ledger-dialog {
  background: rgba(26, 33, 41, 0.85);
  width: min(640px, 94vw);
}
dialog.ledger-dialog::backdrop { background: rgba(0, 0, 0, 0.35); }
.tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--border); margin-bottom: 0.8rem; }
.tab {
  background: transparent;
  border-radius: 6px 6px 0 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-weight: 700;
}
.tab.active { color: var(--text); border-bottom-color: var(--green); }
.tab-page { overflow-x: auto; }
table.payout { border-collapse: collapse; width: 100%; font-size: 1.05em; }
table.payout td { padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--border); }
table.payout .arrow { color: var(--muted); text-align: center; width: 2em; }
table.payout .amount { text-align: right; font-weight: 700; }

/* ---- Ledger page (/t/<id>/ledger, and the table link once the game has ended) ---- */
.ledger-card { width: min(640px, 100%); min-width: 0; } /* (a grid item would otherwise grow with its table) */
.ledger-card h1 { margin-bottom: 0.2rem; }
.ledger-card h2 { font-size: 1.1em; margin: 1.6rem 0 0.6rem; }
.ledger-brand { color: var(--muted); text-decoration: none; font-weight: 700; }
.lp-scroll { overflow-x: auto; }
@media (max-width: 480px) {
  .ledger-card { padding: 1.25rem 1rem; }
  .lp-scroll table.ledger th, .lp-scroll table.ledger td { padding: 0.4rem 0.3rem; }
  .lp-resume::after { left: 0; right: auto; } /* the button wraps to the left here */
}
.lp-seated { display: block; font-size: 0.75em; color: var(--muted); }
.lp-live { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; }
.lp-back { color: #fff; background: var(--blue); padding: 0.45em 1em; border-radius: 8px; text-decoration: none; font-weight: 700; }
.lp-ended { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; padding: 0.8rem 1rem; border: 1px solid var(--border); border-radius: 10px; background: rgba(255, 255, 255, 0.03); }
.lp-ended p { margin: 0; flex: 1 1 14rem; }
/* The greyed-out Resume button; a disabled button gets no hover, so the tip hangs on its wrapper. */
.lp-resume { position: relative; display: inline-block; outline: none; }
.lp-resume button:disabled { opacity: 0.45; pointer-events: none; }
.lp-resume::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 0.5rem);
  right: 0;
  width: max-content;
  max-width: 16rem;
  padding: 0.45em 0.7em;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #0f151c;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
  font-size: 0.85em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s;
}
.lp-resume:hover::after, .lp-resume:focus::after { opacity: 1; }

/* Rabbit hunt: "would have come" cards are faded with a dashed outline so nobody mistakes them for the real board. */
.card.rabbit { background: #aeb6c2; filter: saturate(0.55); }
/* Before the hunt: a thin outline where each missing card goes, the label across their middle. */
.rabbit-btn {
  --line: rgba(255, 255, 255, 0.35);
  position: relative;
  width: calc(var(--slots) * 3.2em * var(--card-scale) + (var(--slots) - 1) * 0.5em);
  height: calc(4.5em * var(--card-scale));
  display: flex;
  gap: 0.5em;
  background: none;
  border: 0;
  padding: 0;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 700;
}
.rabbit-btn:hover { --line: rgba(255, 255, 255, 0.7); background: none; filter: none; }
.rabbit-slot {
  flex: none;
  width: calc(3.2em * var(--card-scale));
  height: 100%;
  border: 1px solid var(--line);
  border-radius: calc(0.35em * var(--card-scale)); /* same corners as the cards */
}
.rabbit-band {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  line-height: 1.2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
}
/* only the river is missing: the rabbit above the words, all inside that one card's outline */
.rabbit-btn.one .rabbit-band { flex-direction: column; gap: 0.15em; padding: 0 0.15em; text-align: center; line-height: 1.1; font-size: min(1em, calc(0.85em * var(--card-scale))); }
.rabbit-icon { width: 1.6em; height: 1.6em; flex: none; fill: currentColor; }
.rabbit-icon .pink { fill: #f4a3b6; }
.rabbit-icon .eye { fill: #0a1428; }
label.checkbox { flex-direction: row; align-items: center; gap: 0.5rem; }
label.checkbox input { width: auto; }
 /* five big cards wouldn't fit across the phone table */


/* Host controls: gear icon button in the header, with the join-request badge on its corner. */
.gear-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; padding: 0.4em 0.55em; }
.gear-btn svg { width: 1.5em; height: 1.5em; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.gear-btn .badge { position: absolute; top: -0.35em; right: -0.35em; margin: 0; }

/* Sound control: speaker icon in the header with a small volume pop-up under it. */
.sound-wrap { position: relative; }
/* Gear menu: Host controls (host only) and Preferences */
.gear-wrap { position: relative; }
.gear-menu {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  min-width: 11rem;
  padding: 0.35rem;
  background: rgba(26, 33, 41, 0.97);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
.gear-menu[hidden] { display: none; }
.gear-menu button, .gear-menu a { display: flex; align-items: center; gap: 0.5rem; background: transparent; text-align: left; white-space: nowrap; padding: 0.55em 0.75em; border-radius: 8px; text-decoration: none; }
.gear-menu button:hover, .gear-menu a:hover { background: var(--panel2); filter: none; }
.gear-menu .badge { margin-left: auto; }
/* Preferences: card back colour picker */
.back-picker { display: flex; gap: 0.75rem; }
.back-picker label { flex: 1; align-items: center; gap: 0.4rem; padding: 0.6rem 0.4rem; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.back-picker input { position: absolute; opacity: 0; width: 0; }
.back-picker .card { font-size: 17px; }
.back-upload { margin-top: 0.6rem; width: 100%; }
.back-picker label:has(input:checked) { border-color: var(--blue); background: rgba(31, 111, 235, 0.15); font-weight: 700; }
.back-picker label:has(input:focus-visible) { outline: 2px solid #fff; outline-offset: 2px; }
/* Verify your email pop-up (from the voice chat button) */
.verify-dialog { width: min(26rem, calc(100vw - 2rem)); }
/* My stats: label left, value right; ⓘ shows the hand's details (hover, or tap on phones) */
.stats-dialog { width: min(26rem, calc(100vw - 2rem)); }
.stats-list { margin-bottom: 0.6rem; }
.stats-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.2rem 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}
.stats-row:last-child { border-bottom: none; }
.stats-value { font-weight: 700; display: flex; align-items: center; gap: 0.35rem; }
.stats-info { background: none; border: none; padding: 0 0.15rem; color: var(--muted); font-size: 1rem; line-height: 1; cursor: pointer; }
.stats-info:hover { color: var(--text, #fff); }
.stats-detail { grid-column: 1 / -1; color: var(--muted); }
.verify-why { margin: 0 0 0.8rem; font-weight: 700; line-height: 1.4; }
.account p { margin: 0 0 0.6rem; line-height: 1.4; }
.account-form { display: flex; gap: 0.5rem; }
.account-form input { flex: 1; min-width: 0; }
.account-form button { flex: none; }
.account-msg { color: #ff9b9b; font-size: 0.9em; min-height: 1.2em; margin-top: 0.5rem !important; }
.link-btn { background: none; padding: 0.3rem 0; color: var(--muted); text-decoration: underline; font-size: 0.9em; }
.sound-pop {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.9rem;
  background: rgba(26, 33, 41, 0.95);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
}
.sound-pop input[type=range] { width: 140px; padding: 0; }
/* Speaker pop-up: a row for voice chat (headset) and one for game sounds (speaker), each with Mute */
#sound-pop { flex-direction: column; align-items: stretch; gap: 0.55rem; }
.volume-row { display: flex; align-items: center; gap: 0.6rem; }
.volume-icon { display: inline-flex; color: var(--muted); }
.volume-icon svg { width: 1.35em; height: 1.35em; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.small-mute { padding: 0.2em 0.5em; font-size: 0.85em; min-width: 4.6em; }

/* Voice chat: headset button left of the speaker (on phones the mic button joins it once you are in).
   The headset opens the list of who is in, with Leave. A seat lights up green while that player talks. */
.voice-wrap { position: relative; display: flex; gap: 0.4rem; }

#voice-btn.on { border-color: var(--green); color: #7ee787; }
/* Your mic: above Send in the chat box, on phones in the header; always there, greyed out until you join */
#mic-btn, .chat-mic { border-color: var(--green); color: #7ee787; }
#mic-btn.muted, .chat-mic.muted { border-color: rgba(248, 81, 73, 0.6); color: #ff9b9b; }

.chat-top { display: flex; align-items: flex-end; gap: 0.35rem; }
.chat-top .chat-messages { flex: 1; min-width: 0; }
.chat-mic, .chat-form button[type=submit] { width: 4.4em; flex: none; }
.chat-mic { display: inline-flex; align-items: center; justify-content: center; padding: 0.3em 0; background: transparent; border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 6px; }
#mic-btn.off, .chat-mic.off { border-color: rgba(255, 255, 255, 0.3); color: var(--muted); opacity: 0.45; }
.chat-mic svg { width: 1.3em; height: 1.3em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.voice-pop { flex-direction: column; align-items: stretch; gap: 0.5rem; min-width: 13rem; }
.voice-pop .voice-title { font-weight: 700; color: var(--muted); font-size: 0.9em; }
.voice-pop ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.voice-pop li { display: flex; align-items: center; gap: 0.5rem; }
.voice-pop li svg { width: 1.1em; height: 1.1em; margin-left: auto; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.voice-pop .voice-name { overflow: hidden; text-overflow: ellipsis; }
.voice-pop .voice-dot { width: 0.55em; height: 0.55em; flex: none; border-radius: 50%; background: #3a434d; }
.voice-pop li.speaking .voice-dot { background: #3fb950; box-shadow: 0 0 0.4em #3fb950; }
.voice-pop li.speaking .voice-name { color: #7ee787; }
/* in the list: green mic on, red muted (like the seat badges) */
.voice-pop .voice-mic { margin-left: auto; display: flex; }
.voice-pop .voice-mic.on svg { stroke: #3fb950; }
.voice-pop .voice-mic.muted svg { stroke: #f85149; }
/* how many are in voice, on the headset button */
#voice-btn { position: relative; }
#voice-btn .voice-count { position: absolute; top: -0.35em; right: -0.35em; margin: 0; background: #2ea043; font-size: 0.7rem; line-height: 1.35; min-width: 1.35em; text-align: center; }
.seat.speaking .plate { outline: 2px solid #3fb950; outline-offset: 2px; }

/* Labels under a seat (Fold, +3.00, hand name) hang below the plate without resizing the seat. */
.seat-tags {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}

/* ---- chips: piles of discs beside bets and the pot (they never move the amounts) ---- */
.bet .chips, .pot .chips {
  position: absolute;
  right: calc(100% + 0.35em);
  bottom: 0;
}
.pot { position: relative; }
.chips { display: flex; align-items: flex-end; gap: 0.15em; pointer-events: none; }
/* One pile = a stack of real-looking casino chips seen from the side, a little from above:
   - the side: one thin band per chip with a dark seam between chips, white edge inserts that alternate
     from chip to chip (so they never line up into stripes), and shading that makes the stack round;
   - the top chip's face: a coloured rim with 8 narrow white inserts, a white inlay ring and a solid
     centre, with a soft highlight. */
.pile {
  --edge: 0.2em; /* thickness of one chip */
  --face: 0.74em; /* height of the (tilted) top face */
  position: relative;
  width: 1.6em;
  height: calc(var(--n) * var(--edge) + var(--face));
  filter: drop-shadow(0 0.08em 0.06em rgba(0, 0, 0, 0.55));
}
.pile::after { /* side of the stack */
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--n) * var(--edge) + var(--face) / 2);
  border-radius: 0 0 50% 50% / 0 0 calc(var(--face) / 2) calc(var(--face) / 2);
  background:
    /* round: dark at both sides, a soft light just left of the middle */
    linear-gradient(90deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0) 24%, rgba(255, 255, 255, 0.2) 42%, rgba(255, 255, 255, 0) 60%, rgba(0, 0, 0, 0.45)),
    /* two chips per tile: white edge inserts (shifted on every other chip) and the seam under each chip */
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 10' preserveAspectRatio='none'%3E%3Cg fill='white' fill-opacity='0.9'%3E%3Crect x='2' y='0.9' width='4.5' height='3.2'/%3E%3Crect x='17.5' y='0.9' width='4.5' height='3.2'/%3E%3Crect x='33' y='0.9' width='4.5' height='3.2'/%3E%3Crect x='9.5' y='5.9' width='4.5' height='3.2'/%3E%3Crect x='25' y='5.9' width='4.5' height='3.2'/%3E%3C/g%3E%3Cg fill='black' fill-opacity='0.5'%3E%3Crect y='4.4' width='40' height='0.6'/%3E%3Crect y='9.4' width='40' height='0.6'/%3E%3C/g%3E%3C/svg%3E") left bottom / 100% calc(2 * var(--edge)) repeat-y,
    var(--chip);
}
.pile::before { /* top chip face */
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: var(--face);
  z-index: 1;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.4);
  box-sizing: border-box;
  background:
    radial-gradient(ellipse at 38% 30%, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0) 50%),
    radial-gradient(ellipse at center, var(--chip) 0 36%, transparent 37%),
    radial-gradient(ellipse at center, transparent 0 39%, rgba(255, 255, 255, 0.9) 40% 46%, transparent 47%),
    radial-gradient(ellipse at center, transparent 0 46%, var(--chip) 47% 68%, transparent 69%),
    repeating-conic-gradient(var(--chip) 0 33deg, rgba(255, 255, 255, 0.95) 33deg 45deg);
}
.chip-red { --chip: #c62828; }
.chip-green { --chip: #2e7d32; }
.chip-blue { --chip: #1565c0; }
.chip-black { --chip: #262626; }
.chip-purple { --chip: #6a1b9a; }

/* Create-game form: settings grouped in framed sections with a title. */
fieldset.section {
  margin: 0;
  padding: 0.6rem 1rem 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}
fieldset.section legend { padding: 0 0.4rem; font-weight: 700; font-size: 1.05em; }

/* ---- 7-2 bonus settings ---- */
.sd-section { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 0.7rem; }
.sd-options { margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: 0.6rem; min-width: 0; }
.sd-options:disabled { opacity: 0.4; }
.field-title { font-size: 0.9em; }

/* ---- Features box in host controls: one small box per feature, with an "i" tooltip ---- */
fieldset.features { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 0.6rem; min-width: 0; }
.feature {
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  position: relative;
}
.feature.sd-section, .feature.bp-section { gap: 0.6rem; }
.feature-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.info {
  flex: none;
  width: 1.4em;
  height: 1.4em;
  padding: 0;
  border: 1.5px solid var(--muted);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font: italic 700 0.85em/1 Georgia, serif;
  display: grid;
  place-items: center;
  cursor: help;
}
.info:hover, .info:focus-visible { border-color: var(--text); color: var(--text); filter: none; } /* a filter would trap the tip inside the button */
/* The tip opens under the feature's title row and spans the feature box. */
.info .tip {
  display: none;
  position: absolute;
  top: 2.6rem;
  left: 0.5rem;
  right: 0.5rem;
  z-index: 5;
  padding: 0.6em 0.75em;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #0f151c;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
  color: var(--text);
  font: 400 0.82rem/1.45 system-ui, sans-serif;
  text-align: left;
  pointer-events: none; /* taps go through to the switch or the next i */
}
.info:hover .tip, .info:focus .tip { display: block; }
.tip-mode { display: block; margin-top: 0.5em; }
.tip-mode b { display: block; font-weight: 700; }

/* On/off switch (a checkbox drawn as a sliding toggle) */
.switch-row { flex-direction: row; align-items: center; gap: 0.6rem; cursor: pointer; font-weight: 600; }
input.switch {
  appearance: none;
  width: 2.6em;
  height: 1.45em;
  padding: 0;
  border-radius: 999px;
  background: var(--panel2);
  border: 1px solid var(--border);
  position: relative;
  cursor: pointer;
  flex: none;
  transition: background 0.15s;
}
input.switch::after {
  content: '';
  position: absolute;
  top: 0.15em;
  left: 0.15em;
  width: 1.05em;
  height: 1.05em;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.15s, background 0.15s;
}
input.switch:checked { background: var(--green); border-color: var(--green); }
input.switch:checked::after { transform: translateX(1.15em); background: #fff; }

/* Two-choice toggle (radio buttons drawn as a segmented control) */
.segmented { display: flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.segmented label { flex: 1; flex-direction: row; margin: 0; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; width: 0; }
.segmented span { flex: 1; text-align: center; padding: 0.45em 0.6em; background: var(--panel2); color: var(--muted); }
.segmented label + label span { border-left: 1px solid var(--border); }
.segmented input:checked + span { background: var(--blue); color: #fff; font-weight: 700; }
.segmented input:focus-visible + span { outline: 2px solid #fff; outline-offset: -2px; }
/* create game: Texas Hold'em / Omaha, and for Omaha Pot-Limit / No-Limit under it */
.game-section .segmented + .segmented { margin-top: 0.5rem; }
.game-choice span { padding: 0.6em; font-size: 1.05em; }
#settings-form .game-name { grid-column: 1 / -1; } /* host controls: the game, on its own row */

/* Table: 7-2 bonus banner and the winner's Show 7-2 button */
.sd-banner {
  background: linear-gradient(90deg, #b8860b, #f0c000, #b8860b);
  color: #1a1200;
  font-weight: 800;
  padding: 0.25em 0.9em;
  border-radius: 999px;
  box-shadow: 0 0 1em rgba(240, 192, 0, 0.5);
}
.sd-btn { background: var(--gold); color: #1a1200; font-weight: 800; }

/* After a hand: "Show both" on top, one button per card below (just the card symbol).
   Outlined and see-through like the other buttons. */
.show-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 0.45rem; width: 15rem; }
.show-panel button {
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 6px;
  font-weight: 700;
}
.show-panel button:hover:not(:disabled) { background: rgba(255, 255, 255, 0.08); filter: none; }
.show-panel .show-both { grid-column: 1 / -1; }
.show-panel .show-one { font-size: 1.35em; font-weight: 800; padding: 0.25em 0; }
.show-panel button:disabled { cursor: default; filter: none; }
.show-panel .show-one:disabled:not(.used) { opacity: 0.35; }
/* suit colors that read well on the dark background */
.show-panel .suit-s { color: #f0f3f6; }
.show-panel .suit-h { color: #ff6b6b; }
.show-panel .suit-d { color: #ff6b6b; }
.show-panel .suit-c { color: #f0f3f6; }
/* "Show 7-2" (Player shows mode): light gold */
.show-panel .show-both.sd { color: #f5d76e; border-color: rgba(240, 192, 0, 0.7); background: rgba(240, 192, 0, 0.1); }
/* Buttons you already pressed: subtle highlight */
.show-panel .used { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.75); }

/* A card turning face up flips over */
.card.reveal { animation: reveal 0.28s ease-out; }
@keyframes reveal {
  0% { transform: rotateY(90deg) scale(1.1); }
  60% { transform: rotateY(0deg) scale(1.12); }
  100% { transform: none; }
}

/* ---- all-in run-out: win %, outs panel, out hit, slow flip ---- */
.equity { font-weight: 800; font-size: 0.9em; }
.equity.fav { background: #10261a; border-color: var(--green); color: #7ee787; }
.equity .tie { font-weight: 600; color: var(--muted); font-size: 0.85em; }

.outs-panel {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 15;
  width: min(17rem, 42vw);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.65rem 0.75rem;
  background: rgba(26, 33, 41, 0.92);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}
.outs-title { font-weight: 700; margin-bottom: 0.35rem; }
.outs-cards { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.outs-cards .card.mini { font-size: 0.85em; width: 2.1em; height: 2.9em; border-radius: 0.3em; }
.outs-hit { color: #f5d76e; font-weight: 800; }
.outs-hit .suit-s, .outs-hit .suit-c { color: #f0f3f6; }
.outs-hit .suit-h, .outs-hit .suit-d { color: #ff6b6b; }

/* the board card that hit someone's outs: a soft gold glow */
.card.out-hit { box-shadow: 0 0 0 0.07em rgba(240, 192, 0, 0.75), 0 0 0.8em rgba(240, 192, 0, 0.35); }

/* all-in run-out: cards turn over slowly for suspense */
.card.slow-flip { animation: slow-flip 1.2s ease-in-out backwards; }
@keyframes slow-flip {
  0% { transform: translateY(-0.25em) rotateY(90deg); opacity: 0.3; }
  35% { transform: translateY(-0.25em) rotateY(90deg); opacity: 1; }
  100% { transform: none; opacity: 1; }
}
.outs-note { color: var(--muted); font-size: 0.8em; margin: -0.15rem 0 0.4rem; line-height: 1.3; }

/* ======================================================================
   Phones (iPhone Safari / Chrome / Android). Desktop is unchanged.
   ====================================================================== */

/* Touch: no grey tap flash, no double-tap zoom on buttons, no pull-to-refresh. */
button, a, label, input { -webkit-tap-highlight-color: transparent; }
button { touch-action: manipulation; }
html, body { overscroll-behavior: none; }
body.table-page { height: 100vh; height: 100dvh; } /* dvh follows Safari's moving address bar */
@media (hover: none) { button:hover { filter: none; } } /* no "stuck" hover after a tap */
/* iPhones zoom into text boxes with text smaller than 16px */
@media (pointer: coarse) { input, select, textarea { font-size: 16px !important; } }

.phone-only { display: none !important; }


  

  
  
  
  
  
  
  

  
  
  
  
  
  
  
  

  
  
  
  
  
  
  
  
  
  

  
  
  
  
  
  
  
  
  
  
  
  

  
  
  
  
  
  
  
  
  
  
  
  






  
  
  





  
  
  



  
  
  


/* Hand log title bar with a close button, like Host controls */
.log-head { display: flex; justify-content: space-between; align-items: center; padding: 0.4rem 0.6rem 0.4rem 0.8rem; border-bottom: 1px solid var(--border); }
.log-head h3 { margin: 0; padding: 0; border: 0; }






/* Offline players: plate and cards greyed out with an "Offline" label over the plate */
.seat.offline .card, .seat.offline .plate > :not(.offline-badge), .seat.offline .seat-tags { filter: grayscale(1) brightness(0.55) !important; }
.seat.offline .plate { background: #12171d; border-color: #2a323b; box-shadow: none; }
.offline-badge {
  position: absolute;
  top: 0; /* on the top edge of the plate, so name and stack stay readable */
  left: 50%;
  transform: translate(-50%, -90%) rotate(-6deg); /* sits over the cards, just above the name */
  z-index: 3;
  padding: 0.1em 0.6em;
  border-radius: 6px;
  background: rgba(10, 12, 16, 0.92);
  border: 1px solid #6e7681;
  color: #e6edf3;
  font-weight: 800;
  font-size: 0.85em;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.list-row .row { gap: 0.35rem; flex-wrap: nowrap; }

/* Show-card buttons live in the middle of the table now: solid enough to read over the felt */
.below-board .show-panel { width: 13em; gap: 0.35em; margin-top: 0.2em; }
.below-board .show-panel button { background: rgba(10, 20, 40, 0.75); font-size: 1em; }
.below-board .show-panel .show-one { font-size: 1.25em; }

.below-board .show-panel .used { background: rgba(255, 255, 255, 0.18); border-color: rgba(255, 255, 255, 0.75); }
.below-board .show-panel .show-both.sd { background: rgba(240, 192, 0, 0.18); }





/* Hand name on the bottom-left corner of the name plate */
.plate .hand-name {
  position: absolute;
  left: 0.7em;
  bottom: 0;
  transform: translateY(55%);
  z-index: 2;
  margin: 0;
  font-size: 0.7em;
  max-width: 13em;
  overflow: hidden;
  text-overflow: ellipsis;
}
.seat-tags { padding-top: 0.6em; } /* room for the hand name hanging off the plate */

/* Showdown: cards not in the winning five */
.card.unused { filter: brightness(0.45) grayscale(0.7); scale: 0.95; }
.card.unused-anim { animation: dim-card 0.25s ease 0.3s both; }
.card.reveal.unused-anim { animation: reveal 0.28s ease-out, dim-card 0.25s ease 0.3s both; }
.card.slow-flip.unused-anim { animation: slow-flip 1.2s ease-in-out backwards, dim-card 0.25s ease 1.25s both; }
@keyframes dim-card {
  from { filter: none; scale: 1; }
  to { filter: brightness(0.45) grayscale(0.7); scale: 0.95; }
}

/* Chat message bubble above a player's seat */
.chat-bubble {
  position: absolute;
  bottom: calc(100% + 0.45em);
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  max-width: 13em;
  width: max-content;
  padding: 0.35em 0.65em;
  border-radius: 0.8em;
  background: #f0f3f6;
  color: #111;
  font-size: 0.85em;
  font-weight: 600;
  line-height: 1.25;
  box-shadow: 0 0.2em 0.6em rgba(0, 0, 0, 0.45);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  animation: bubble-in 0.2s ease-out;
  pointer-events: none;
}
@keyframes bubble-in { from { opacity: 0; transform: translateX(-50%) translateY(0.6em) scale(0.6); } }
.chat-bubble { overflow: visible; display: block; white-space: normal; }
.chat-bubble::after { /* tail pointing down at the name plate */
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 0.4em solid transparent;
  border-top-color: #f0f3f6;
}
.chat-bubble { max-height: 2.6em; text-overflow: ellipsis; }

/* ---- Card faces in the Poker Now style: big serif rank top-left, small suit under it,
   large suit in the bottom-right corner ---- */
.card:not(.back) { position: relative; display: block; overflow: hidden; }
.card:not(.back) .r {
  position: absolute;
  top: 0.06em;
  left: 0.14em;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 800;
  font-size: 1.32em;
  line-height: 1;
  letter-spacing: -0.03em;
}
.card:not(.back) .r i { font-style: normal; font-family: system-ui, sans-serif; font-size: 0.48em; margin-top: 0.08em; }
.card:not(.back) .s {
  position: absolute;
  right: -0.06em;
  bottom: -0.12em;
  font-size: 2.05em;
  line-height: 1;
}
.card { border-radius: 0.3em; box-shadow: 0 0.06em 0.3em rgba(0, 0, 0, 0.45); }
/* the two cards in front of a player are fanned slightly */
.seat .cards { gap: 0; }
.seat .cards .card:first-child { rotate: -5deg; margin-right: -0.35em; }
.seat .cards .card:last-child { rotate: 6deg; translate: 0 0.08em; }
/* Omaha: four cards overlap in a fan, each still showing its rank and suit in the corner */
.seat .cards.four .card { margin: 0 0 0 -1.3em; }
.seat .cards.four .card:first-child { margin-left: 0; rotate: -9deg; translate: 0 0.2em; }
.seat .cards.four .card:nth-child(2) { rotate: -3deg; }
.seat .cards.four .card:nth-child(3) { rotate: 3deg; }
.seat .cards.four .card:last-child { rotate: 9deg; translate: 0 0.2em; }

/* tiny cards (outs list): keep it simple, rank and suit centered */
.card.mini .r { position: static; flex-direction: row; justify-content: center; padding-top: 0.15em; font-size: 1.1em; }
.card.mini .r i { display: none; }
.card.mini .s { position: static; display: block; text-align: center; font-size: 1.1em; }

/* ---- Hand label: short category on the top-right edge of the name plate ---- */
.plate .hand-name {
  left: auto;
  right: 0.45em;
  top: 0;
  bottom: auto;
  transform: translateY(-85%); /* sits on the top edge, clear of the name */
  padding: 0.1em 0.55em;
  border: 0;
  border-radius: 0.35em;
  background: #4a5563;
  color: #fff;
  font-size: 0.66em;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: 0 0.1em 0.3em rgba(0, 0, 0, 0.4);
}
.plate .hand-name.win, .seat.winner .plate .hand-name { background: #2ea043; color: #fff; border: 0; }
.plate .hand-name.lose { background: #da3633; color: #fff; }
.seat-tags { padding-top: 0.15em; }

/* Card faces, refined:
   - every rank the same height (lining figures, so 2, 7, 9, 10 all line up)
   - table cards: rank top-left, one big suit in the middle
   - cards in a player's hand: rank top-left with one suit under it, a little smaller than the rank */
.card:not(.back) .r { font-variant-numeric: lining-nums; font-feature-settings: 'lnum' 1; }
.card:not(.back) .r i { display: none; }
.board .card:not(.back) .s {
  right: auto;
  bottom: auto;
  left: 50%;
  top: 58%;
  transform: translate(-50%, -50%);
  font-size: 1.9em;
}
.seat .card:not(.back) .s { display: none; }
.seat .card:not(.back) .r i { display: block; font-size: 0.8em; margin-top: 0.05em; }

/* "Waiting for the host to approve Sam's re-buy…" under the board */
.rebuy-wait { color: #f5d76e; font-weight: 700; background: rgba(0, 0, 0, 0.35); padding: 0.2em 0.8em; border-radius: 999px; }

/* ---- Bomb pot ---- */
.bp-section { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 0.7rem; }
.bp-options { margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: 0.6rem; min-width: 0; }
.bp-options:disabled { opacity: 0.4; }
.bomb-badge {
  background: linear-gradient(90deg, #8b1e1e, #da3633, #8b1e1e);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 0.2em 0.9em;
  border-radius: 999px;
  box-shadow: 0 0 1em rgba(218, 54, 51, 0.45);
}




/* re-buy pop-up: 5 second countdown bar */
.bust-timer { height: 0.3rem; background: var(--border); border-radius: 2px; overflow: hidden; margin: 0.4rem 0 0.2rem; }
.bust-timer i { display: block; height: 100%; width: 100%; background: var(--gold); }
#bust-countdown { margin: 0 0 0.6rem; }

/* Short red message at the top of the screen (e.g. buy-in denied) */
#alert-top {
  position: fixed;
  top: calc(0.6rem + env(safe-area-inset-top));
  left: 50%;
  transform: translate(-50%, -200%);
  z-index: 200;
  max-width: calc(100vw - 2rem);
  white-space: nowrap; /* one line, even on phones */
  padding: 0.6rem 1.2rem;
  border-radius: 10px;
  background: var(--red);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  transition: transform 0.25s ease;
  pointer-events: none;
}
#alert-top.show { transform: translate(-50%, 0); }

/* Change host pop-up */
.host-change-list { display: flex; flex-direction: column; gap: 0.35rem; margin: 0.5rem 0; max-height: 50vh; overflow-y: auto; }
.host-pick { text-align: left; background: var(--panel2); border: 2px solid transparent; }
.host-pick.picked { border-color: var(--green); background: #13201a; }
.host-pick:disabled { opacity: 0.5; cursor: default; }
#game-controls { gap: 0.5rem; }
#alert-top.green { background: var(--green); }









/* Table shape: like a real poker table, straight sides with fully round ends (upright phones: round at the
   top and bottom); colors unchanged */
.felt { border-radius: 999px; }

/* Raise options stay hidden until Raise / Bet is pressed */
#actions:not(.raise-open) .raise .presets,
#actions:not(.raise-open) #raise-slide,
#actions:not(.raise-open) #raise-input,
#actions:not(.raise-open) #raise-btn { display: none; }
#actions.raise-open #raise-open { display: none; }
#raise-open { min-width: 6.5em; font-weight: 600; }








































/* ======= Betting buttons: see-through glass, act before your turn =======
   As on Poker Now: Call | Bet/Raise | Check | Fold in capitals, always all four (the ones that can't be used
   greyed out, so none ever moves), with Check/Fold above Fold (the slot stays reserved so the bar never
   changes height). Phones held sideways: one column, Check/Fold, Call, Bet, Check, Fold. */
#actions { --bw: 108px; --bh: 48px; --gap: 0.5rem; align-items: flex-end; }
#actions .fold-col { display: flex; flex-direction: column; gap: var(--gap); }
#actions .cf-slot { display: block; height: var(--bh); }
/* every button in the bar has the same fixed size */
#actions > button, #actions .fold-col > button, #actions #raise-btn {
  width: var(--bw); min-width: var(--bw); height: var(--bh); min-height: var(--bh);
  padding: 0 0.3rem; font-size: 15px; font-weight: 700; line-height: 1.1; white-space: normal; flex: none;
  text-transform: uppercase; letter-spacing: 0.03em;
}
#actions > button, #actions .fold-col > button, #actions #raise-btn, #actions .presets button {
  --c: var(--panel2);
  background: transparent; /* just the coloured edge, no tint */
  border: 1px solid var(--c);
  color: #fff;
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
#actions#actions button.danger { --c: var(--red); }
#actions#actions button.primary { --c: var(--green); }
#actions#actions button.blue { --c: var(--blue); }
#actions#actions button.white { --c: #e6edf3; }
#actions > button:not(:disabled):hover, #actions .fold-col > button:not(:disabled):hover { background: color-mix(in srgb, var(--c) 18%, transparent); }
#actions .presets button { --c: #8b98a5; }
/* the action chosen in advance is filled in */
#actions#actions button.selected { background: var(--c); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.55); }
#actions#actions button.white.selected { color: #0d1117; }
/* buttons that can't be used right now (Check after a bet, Raise while waiting) */
#actions#actions button:disabled { --c: #59636e; color: #7d8590; background: transparent; filter: none; opacity: 1; }
#actions button:disabled:hover { filter: none; }
/* seated before the game starts: the buttons keep their space (the table keeps its size) but aren't shown */
#actions.idle-hidden { visibility: hidden; }

















/* Thin player frames (like the betting buttons) */
.plate { border-width: 1px; }

/* Table style: built like a real poker table, in our colors. From the outside in:
   - a padded armrest in dark navy (the .felt border): rounded like a cushion, lit on its upper side,
     with a faint stitch line around its middle (.rail-stitch);
   - a polished wood racetrack (the .felt padding);
   - the dark blue felt (content box) with a soft centre light and a barely visible diamond pattern, set a
     little lower than the wood, and a thin line marking the betting area. */
.felt {
  --felt-light: #1c4680;
  --felt-edge: #0b1f3d;
  --armrest: 1.3em;
  --track: 0.75em;
  border: var(--armrest) solid transparent;
  padding: var(--track);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Cpath d='M12 0L24 12L12 24L0 12Z' fill='none' stroke='white' stroke-opacity='0.035' stroke-width='0.8'/%3E%3Ccircle cx='12' cy='12' r='0.9' fill='white' fill-opacity='0.05'/%3E%3C/svg%3E") center / 1.9em 1.9em repeat content-box,
    radial-gradient(ellipse at center, var(--felt-light) 0%, var(--felt) 55%, var(--felt-edge) 100%) content-box,
    /* the wood: fine grain rings that follow the table's shape, over a mahogany gradient */
    repeating-radial-gradient(ellipse at center, rgba(0, 0, 0, 0.12) 0 1px, transparent 1px 3px, rgba(255, 210, 170, 0.04) 3px 4px, transparent 4px 6px) padding-box,
    linear-gradient(180deg, #5c2d18 0%, #4a2416 40%, #2b130b 100%) padding-box,
    /* the armrest */
    linear-gradient(180deg, #2a3954 0%, #141d2e 45%, #090d16 100%) border-box;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.7),          /* the groove where the armrest meets the wood */
    inset 0 0.35em 0.5em rgba(0, 0, 0, 0.55),    /* the armrest casts a shadow onto the wood (light from above) */
    0 0 0 1px rgba(0, 0, 0, 0.7),                /* crisp outer edge */
    0 0.35em 0.5em rgba(0, 0, 0, 0.5),           /* the table stands off the floor */
    0 1.2em 2.8em rgba(0, 0, 0, 0.6),
    0 0 2.2em rgba(40, 100, 200, 0.12);          /* faint blue glow around the table */
}

/* the felt's edge: the wood's polished lip, and the shadow it casts onto the lower felt */
.felt::before {
  content: '';
  position: absolute;
  inset: var(--track);
  border-radius: 999px;
  pointer-events: none;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.6),
    0 0 0 2px rgba(255, 200, 150, 0.12),
    inset 0 0.4em 0.8em rgba(0, 0, 0, 0.5),
    inset 0 0 1.2em rgba(0, 0, 0, 0.4);
}
/* the armrest's cushion: a bright rim along its outer edge, light on its upper half, shade underneath */
.felt::after {
  content: '';
  position: absolute;
  inset: calc(-1 * var(--armrest));
  border-radius: inherit;
  pointer-events: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    inset 0 0 0.3em rgba(0, 0, 0, 0.45),
    inset 0 0.35em 0.45em -0.15em rgba(255, 255, 255, 0.13),
    inset 0 -0.35em 0.45em -0.1em rgba(0, 0, 0, 0.6);
}
/* stitching around the middle of the armrest, and the cushion rounding down to the wood on its inner side */
.rail-stitch {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  pointer-events: none;
  outline: 1px dashed rgba(255, 255, 255, 0.11);
  outline-offset: calc(var(--armrest) / 2 - 0.5px);
  box-shadow: 0 0 0.3em 0.1em rgba(0, 0, 0, 0.45);
}

/* the betting line: one faint hairline inside the felt */
.felt-line {
  position: absolute;
  inset: calc(var(--track) + 1.4em);
  border: 1px solid rgba(150, 190, 255, 0.1);
  border-radius: 999px;
  pointer-events: none;
}


/* Wide desktop screens: chat (bottom left) and the betting buttons (bottom right) float in the corners like
   Poker Now, so the table gets the full height. */
/* (body.corners is set by table.js only when the floating chat and buttons cover no seat) */
body.corners:not(.phone) .main { position: relative; }
body.corners:not(.phone) .bottom-row { position: absolute; left: 0; right: 0; bottom: 0; z-index: 20; pointer-events: none; }
body.corners:not(.phone) .bottom-row > * { pointer-events: auto; }
body.corners:not(.phone) .bottom-row .action-bar { justify-content: flex-end; justify-self: end; padding-right: 0; }

/* the hidden raise options take no room, so every gap between the buttons is the same */
#actions:not(.raise-open) .raise { display: none; }

/* Seats are placed by the middle of the name box, so every box sits right on the table edge.
   The hole cards hang above the box without taking room in the seat. */
.seat { --cards-overlap: 1.3em; }

.seat .cards.cards {
  position: absolute;
  left: 50%;
  bottom: calc(100% - var(--cards-overlap));
  transform: translateX(-50%);
  margin-bottom: 0;
}













  /* bottom edge level with the buttons */
/* no free spot for the raise options: the row under the table grows while they're open */
body.raise-grow:not(.phone) .bottom-row { padding-top: calc(84px + 12px - 48px - 0.5rem); } /* the empty Check/Fold row above the buttons is already free */

/* ======= Desktop table: fills the space it has, so it grows and shrinks with the window =======
   The table box takes the whole table area (between 1:1 and 2.1:1), the felt sits inside it with
   room for the seats that stick out (in em, so it scales with the seats), and everything on the
   table is sized from the box. table.js places seats on the felt's real edge. */




/* Paused: the text sits in the middle of the table, over the board cards, which are greyed out */
.board { position: relative; }
.board .paused-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 1.6em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  z-index: 2;
  pointer-events: none;
}
.board.paused .card, .board.paused .rabbit-btn { filter: grayscale(1) brightness(0.45); }


header .top-bar {
  position: static;
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  max-width: none;
  margin-right: auto; /* pushes Copy invite link, Ledger, Log... to the right */
  font-size: 0.85em;
}
header .top-bar:empty { display: none; }

header .top-bar button, header .top-bar .icon-btn {
  width: auto;
  min-width: 0;
  flex-direction: row;
  gap: 0.4em;
  padding: 0.4em 0.75em;
  border-width: 1px;
  font-size: 1em;
}
header .top-bar .icon-btn svg { width: 1.3em; height: 1.3em; }
header .top-bar > span { color: var(--muted); }

/* No header bar on the table page: the buttons stay where they were, clear (outlined, no fill) */
body.table-page header { background: transparent; border-bottom: 0; }
body.table-page header > button, body.table-page header .gear-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 6px;
}
body.table-page header > button.blue { border-color: var(--blue); color: #79b8ff; }
body.table-page header > button:hover, body.table-page header .gear-btn:hover { background: rgba(255, 255, 255, 0.08); filter: none; }



/* Show-card buttons after a hand: in the bottom-right corner where the betting buttons are, never
   over the chat. "Show both" on top at full width, the two single cards below, half as wide each. */
.action-bar .show-panel { grid-template-columns: 1fr 1fr; }
.action-bar .show-panel .show-both { grid-column: 1 / -1; }



 

 



 /* as tall as the betting buttons: the table keeps its size */

/* Keyboard letter on a button's border, top right (desktop only: phones have no keyboard) */
#actions button[data-key], .rabbit-btn[data-key] { position: relative; overflow: visible; }
#actions button[data-key]::after, .rabbit-btn[data-key]::after {
  content: attr(data-key);
  position: absolute;
  top: -0.6em;
  right: 0.45em;
  padding: 0 0.3em;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.85);
  background: #0f1419; /* page background, so it sits "in" the border */
  border-radius: 3px;
  pointer-events: none;
}
#actions button[data-key]:disabled::after { color: #59636e; }


/* Time Bank button (purple), in the spot above Fold on your turn */
#actions#actions button.purple { --c: #8957e5; }

/* Re-buy count: a line-drawn dollar sign and the number in a small purple frame on the top edge of a
   player's box, right of the middle; only shown once they have re-bought at least once.
   While the box shows a hand label (which sits top-right), the badge moves to the bottom edge. */
.plate .rebuy-badge {
  position: absolute;
  top: -0.95em; /* sits on the top border, over the corner of the right card like the hand label */
  right: 1.4em;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 0.05em;
  padding: 0 0.3em 0 0.15em;
  font-size: 0.8em;
  font-weight: 700;
  line-height: 1.3;
  color: #fff;
  background: #0f1419;
  border: 1px solid #8957e5;
  border-radius: 4px;
  white-space: nowrap;
}
.plate .rebuy-badge svg { width: 1.05em; height: 1.05em; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.plate:has(.hand-name) .rebuy-badge { top: auto; bottom: -0.95em; }
/* In the voice chat: a small mic on the top-left corner of the name box, green with the mic on, red when muted;
   it pulses while the player talks (the box glows too) */
.plate .voice-badge {
  position: absolute;
  top: -0.6em;
  left: -0.55em;
  z-index: 3;
  width: 1.45em;
  height: 1.45em;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 0 0 2px #0b1220, 0 1px 3px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
}
.plate .voice-badge.on { background: #2ea043; }
.plate .voice-badge.muted { background: #da3633; }
.plate .voice-badge svg { width: 0.95em; height: 0.95em; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.seat.speaking .voice-badge.on { animation: voice-talk 0.8s ease-in-out infinite alternate; }
@keyframes voice-talk {
  from { transform: scale(1); box-shadow: 0 0 0 2px #0b1220, 0 0 0 0 rgba(46, 160, 67, 0.6); }
  to { transform: scale(1.15); box-shadow: 0 0 0 2px #0b1220, 0 0 0.5em 0.15em rgba(46, 160, 67, 0.6); }
}



/* "Join another game" row: paste an invite link (start page, Host controls, phone menu) */
.join-row { display: flex; gap: 0.4rem; align-items: stretch; }
.join-row input { flex: 1; width: 0; min-width: 0; }
.join-row button { white-space: nowrap; }
.host-join { display: grid; gap: 0.3rem; margin-top: 0.5rem; }
.host-join:empty { display: none; }
.menu-join { display: grid; gap: 0.3rem; padding: 0.6rem 0.2rem 0.2rem; border-top: 1px solid var(--border); margin-top: 0.3rem; }
















/* "Your turn": a yellow dot and gold text, softly pulsing, as on Poker Now on the right, right above
   Call..Check (table.js sets --rp-left / --rp-width), so it never covers a button, the Time Bank slot or
   a seat. The raise options take its place when open. */
#actions .your-turn {
  position: absolute;
  top: 0;
  left: var(--rp-left, 0);
  width: var(--rp-width, auto);
  height: calc(var(--bh) - 0.45rem);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4em;
  color: var(--gold);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-shadow: 0 0 10px rgba(240, 192, 0, 0.55);
  pointer-events: none;
  animation: your-turn-pulse 1.1s ease-in-out infinite alternate;
}
#actions .your-turn::before { content: ''; width: 0.8em; height: 0.8em; border-radius: 50%; background: #f5e500; box-shadow: 0 0 8px rgba(245, 229, 0, 0.7); }
#actions.raise-open .your-turn { display: none; }
@keyframes your-turn-pulse { from { opacity: 0.55; } to { opacity: 1; } }







/* Buy-in request pop-up (host): floats at the top, doesn't block the table, closes after 6 s */
#buyin-popup[open] {
  position: fixed;
  top: calc(var(--header-h, 56px) + 0.6rem);
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  z-index: 60;
  width: min(360px, calc(100vw - 1.5rem));
  min-width: 0;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
  border-color: rgba(31, 111, 235, 0.6);
  animation: buyin-in 0.2s ease-out;
}
#buyin-popup p { margin: 0 0 0.6rem; }
@keyframes buyin-in { from { opacity: 0; transform: translate(-50%, -0.6rem); } }






/* Blinds, quietly in the middle of the table under the board (not in the top bar) */
.blinds-label { color: rgba(214, 228, 248, 0.5); font-size: 0.85em; font-weight: 600; letter-spacing: 0.08em; white-space: nowrap; }
.start-overlay .blinds-label { margin-top: 0.4em; }

/* ---- Privacy page (/privacy) and the small footer link to it ---- */
body.doc-page { position: relative; min-height: 100vh; padding: 2rem 1rem 3rem; box-sizing: border-box; }
.doc-card { max-width: 680px; margin: 0 auto; line-height: 1.55; }
.doc-card h1 { margin: 1.2rem 0 0.2rem; }
.doc-card h2 { font-size: 1.15em; margin: 1.8rem 0 0.4rem; }
.doc-card ul { padding-left: 1.2rem; margin: 0.4rem 0; }
.doc-card li { margin: 0.35rem 0; }
.doc-card a { color: #7fb2ff; }
.doc-brand { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--muted) !important; text-decoration: none; font-weight: 700; }
.doc-brand img { width: 28px; height: 28px; }
.doc-top { display: flex; align-items: center; min-height: 2.4rem; }
/* top-right corner of the screen (scrolls away with the page) */
.doc-back { position: absolute; top: calc(1.6rem + env(safe-area-inset-top)); right: calc(1rem + env(safe-area-inset-right)); color: #fff !important; background: var(--blue); padding: 0.45em 1em; border-radius: 8px; text-decoration: none; font-weight: 700; white-space: nowrap; }
.doc-back:hover { filter: brightness(1.15); }
.site-footer { font-size: 0.8rem; color: var(--muted); text-align: center; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); text-decoration: underline; }
/* start page: in the bottom-right corner, over nothing */
body.home-table .site-footer { position: fixed; right: calc(0.8rem + env(safe-area-inset-right)); bottom: calc(0.5rem + env(safe-area-inset-bottom)); z-index: 30; }
.ledger-page .site-footer { margin-top: 2rem; }
