/* ============================================================
   table.css: the table's geometry, in one unit.

   --u is the design unit: the phone-landscape table (844 x 390) is drawn
   at --u = 1px, and the table works --u out from its own box, so the same
   drawing fits a 300px-tall phone (--u ~ 0.8) and a 1280 x 800 window
   (--u = 1.35, the cap). Every size below is N * --u. The felt takes the
   height the furniture leaves; extra height on a window opens a gap
   between the felt and the hand for the player's own seat.

   The old sheets are loaded into the "base" cascade layer, so a rule here
   wins on every property it sets, whatever the old selector's specificity.
   Geometry lives here; colours, borders and shadows stay in the old sheets.
   ============================================================ */

#game-screen { container-type: size; }

#game-screen .game-container {
  --u: min(calc(100cqh / 380), calc(100cqw / 700), 1.35px);
  --H: min(100cqh, calc(620 * var(--u)));
  /* Felt-to-hand gap: the hand rides the felt's rim on a phone (-13), and
     a window opens up to 44 for the seat to sit in. */
  --gap: clamp(calc(-13 * var(--u)), calc((var(--H) - calc(390 * var(--u))) * 0.35 - calc(13 * var(--u))), calc(56 * var(--u)));
  /* Extra height also lifts the felt's top, so the head seat's name clears
     the table title in the header. */
  /* The top bar: 34 units, never so thin that its 32px buttons spill out. */
  --bar-btn: max(32px, calc(30 * var(--u)));
  --bar-h: max(calc(34 * var(--u)), calc(var(--bar-btn) + 2px));
  --hand-h: calc(90 * var(--u));
  --act-h: calc(40 * var(--u));
  /* The felt starts just under the thin bar (the head seat's avatar rises
     into the bar's empty middle; the bar's buttons sit at its ends, clear of
     the oval); extra height lifts it further. */
  --felt-top: calc(calc(44 * var(--u)) + clamp(0px, calc((var(--H) - calc(390 * var(--u))) * 0.12), calc(30 * var(--u))));
  --felt-bottom: calc(calc(130 * var(--u)) + var(--gap));
  --felt-radius: 50% / 46%;
  --felt-h: calc(var(--H) - var(--felt-top) - var(--felt-bottom));
  /* A phone's felt is wide (3.6:1); every extra pixel of height on a window brings it back to a table's 1.95:1. */
  --felt-max-w: max(calc(var(--felt-h) * 1.95), calc(var(--felt-h) * 3.6 - (var(--H) - calc(390 * var(--u))) * 2.7));
  --felt-x: max(7%, calc((100% - var(--felt-max-w)) / 2));
  --seat-avatar: calc(38 * var(--u));
  --hand-card-w: calc(53 * var(--u));
  width: 100%; height: var(--H); margin: auto 0;
  display: flex; flex-direction: column; position: relative;
}
#game-screen .game-container::before { left: var(--felt-x); right: var(--felt-x); top: var(--felt-top); bottom: var(--felt-bottom); border-radius: var(--felt-radius); }
#game-screen .game-container::after {
  left: calc(var(--felt-x) + calc(10 * var(--u))); right: calc(var(--felt-x) + calc(10 * var(--u)));
  top: calc(var(--felt-top) + calc(10 * var(--u))); bottom: calc(var(--felt-bottom) + calc(10 * var(--u)));
  border-radius: var(--felt-radius); border-width: 2px;
}

/* ---- header (round 2, 22 Oct 2026: the GG / PokerStars top bar) ----
   A thin bar: the menu on the left, the table's name and stake with the
   hand reference small under it, and only the mid-hand tools on the right
   (last hand, settings, add cash; the lobby on a desk). The head seat's
   avatar may rise into the bar's empty middle. */
#game-screen .game-topbar {
  height: var(--bar-h); min-height: var(--bar-h); box-sizing: border-box;
  padding: 0 calc(8 * var(--u)); gap: calc(8 * var(--u)); align-items: center;
}
#game-screen .game-info-left { gap: calc(6 * var(--u)); flex: 0 0 auto; }
#game-screen .game-info-right { gap: calc(6 * var(--u)); flex: 0 0 auto; align-items: center; }
/* Never under 32px, so a thumb can hit them on the smallest phones (WebKit sweep, iPhone SE, 25 Sep). */
#game-screen .game-topbar .btn-icon {
  width: var(--bar-btn); height: var(--bar-btn); min-width: var(--bar-btn); min-height: 0; padding: 0;
  border-radius: var(--r-ctl, 12px); display: inline-flex; align-items: center; justify-content: center;
}
#game-screen .game-topbar .btn-icon .ico, #game-screen .game-topbar .btn-icon svg { width: max(16px, calc(17 * var(--u))); height: max(16px, calc(17 * var(--u))); }
#game-screen .game-topbar .table-cash { width: var(--bar-btn); height: var(--bar-btn); min-width: var(--bar-btn); padding: 0; }
/* Back to lobby sits first in the bar on every screen; a popped-out table has no lobby behind it. */
#game-screen .btn-icon.game-lobby-btn { display: inline-flex; background: rgba(0,0,0,0.28); border: 1px solid rgba(255,255,255,0.12); color: #fff; }
body.pinned-table #game-screen .btn-icon.game-lobby-btn { display: none; }
/* The title: "Points Rummy · ₹10/point", the hand reference and the round under it. */
#game-screen .table-head {
  flex: 1 1 auto; min-width: 0; max-width: calc(50% - 2 * var(--bar-btn) - 42 * var(--u)); margin-right: auto;
  display: flex; flex-direction: column; justify-content: center; gap: calc(1 * var(--u)); line-height: 1.15;
}
#game-screen .th-line1, #game-screen .th-line2 { display: flex; align-items: baseline; min-width: 0; white-space: nowrap; overflow: hidden; }
#game-screen .th-line1 > *, #game-screen .th-line2 > * {
  all: unset; display: inline; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
#game-screen .th-line1 > * { font-size: max(11px, calc(13 * var(--u))); font-weight: 700; color: #fff; letter-spacing: .2px; }
#game-screen .th-line1 > .practice-badge { color: #E9D5FF; font-size: max(9px, calc(10 * var(--u))); font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; }
#game-screen .th-line2 > * { font-size: max(9px, calc(9.5 * var(--u))); font-weight: 600; color: rgba(255,255,255,0.62); }
#game-screen .th-line2 > .hand-ref { font-family: 'JetBrains Mono', ui-monospace, Consolas, monospace; cursor: pointer; letter-spacing: .4px; }
#game-screen .th-line2 > .hand-ref:hover { color: var(--gold-light); }
#game-screen .th-line2 > .hand-ref[hidden], #game-screen .th-line1 > :empty, #game-screen .th-line2 > :empty, #game-screen .th-line2 > [style*="display: none"], #game-screen .th-line2 > .wild-joker-badge { display: none; }
#game-screen .th-line1 > * + *:not(:empty)::before, #game-screen .th-line2 > * + *:not(:empty)::before { content: '\00b7'; padding: 0 .45em; color: rgba(255,255,255,0.5); }

/* Chat and reactions: a small cluster at the bottom-left, on the button row. */
#game-screen .table-cluster {
  position: absolute; z-index: 7; left: calc(8 * var(--u)); bottom: calc((var(--act-h) - var(--bar-btn)) / 2);
  display: flex; gap: calc(6 * var(--u));
}
#game-screen .table-cluster .btn-icon {
  width: var(--bar-btn); height: var(--bar-btn); min-width: var(--bar-btn); padding: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(10, 6, 20, 0.72); border: 1px solid rgba(255, 255, 255, 0.16); color: #fff;
}
#game-screen .table-cluster .btn-icon .ico { width: max(16px, calc(17 * var(--u))); height: max(16px, calc(17 * var(--u))); }
/* The chat and emoji buttons move past the table chips only where the chips sit beside them, at
   the bottom left of a phone held (or turned) sideways. On a tablet or desk the chips run along the
   top, and the full strip's width pushed these buttons off the right edge (UI sweep, 17 Nov 2026). */
@media (orientation: landscape) and (max-height: 520px) {
  body.has-tray #game-screen .table-cluster { left: calc(var(--tray-w, 0px) + 12px); }
}
body.force-landscape.has-tray #game-screen .table-cluster { left: calc(var(--tray-w, 0px) + 12px); }
/* The reaction tray opens over the cluster. */
#game-screen .emoji-tray { left: calc(8 * var(--u)); right: auto; bottom: calc(var(--act-h) + 6 * var(--u)); transform-origin: bottom left; }

/* The table menu: a sheet over a dimmed table, centred on a desk. */
#game-screen .table-sheet { position: absolute; inset: 0; z-index: 90; }
#game-screen .table-sheet.hidden { display: none; }
#game-screen .sheet-scrim { position: absolute; inset: 0; background: rgba(6, 3, 12, 0.62); }
#game-screen .sheet-card {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(440px, calc(100% - 16px)); max-height: calc(100% - 12px); overflow-y: auto; box-sizing: border-box;
  padding: 12px 12px 14px; background: #1E0B2E; color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12); border-bottom: 0; border-radius: var(--r-sheet, 20px) var(--r-sheet, 20px) 0 0;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.55); animation: sheetUp .2s ease-out both;
}
@keyframes sheetUp { from { transform: translate(-50%, 24px); opacity: 0; } to { transform: translateX(-50%); opacity: 1; } }
@container (min-width: 900px) and (min-height: 560px) {
  #game-screen .sheet-card { bottom: auto; top: 50%; transform: translate(-50%, -50%); border-bottom: 1px solid rgba(255, 255, 255, 0.12); border-radius: var(--r-sheet, 20px); animation: none; }
}
#game-screen .sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 8px; font-size: 15px; }
#game-screen .sheet-x { width: 32px; height: 32px; border: 0; border-radius: var(--r-ctl, 12px); background: rgba(255, 255, 255, 0.08); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
#game-screen .sheet-x .ico { width: 16px; height: 16px; }
#game-screen .sheet-info { padding: 8px 10px; margin-bottom: 8px; border-radius: var(--r-ctl, 12px); background: rgba(255, 255, 255, 0.05); font-size: 12px; }
#game-screen .si-row { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; }
#game-screen .si-row span { color: rgba(255, 255, 255, 0.6); }
#game-screen .si-row code { font-family: 'JetBrains Mono', ui-monospace, Consolas, monospace; cursor: pointer; }
#game-screen .si-rules { margin: 6px 0 0; color: rgba(255, 255, 255, 0.72); line-height: 1.4; font-size: 11.5px; }
#game-screen .si-rules:empty { display: none; }
#game-screen .sheet-list { display: grid; grid-template-columns: 1fr; gap: 4px; }
#game-screen .sheet-item {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 8px 12px; box-sizing: border-box;
  border: 0; border-radius: var(--r-ctl, 12px); background: rgba(255, 255, 255, 0.04); color: #fff; text-align: left;
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
#game-screen .sheet-item[hidden] { display: none; }
#game-screen .sheet-item .ico { width: 18px; height: 18px; flex: 0 0 auto; color: var(--gold-light, #F6D78A); }
#game-screen .sheet-item span { display: flex; flex-direction: column; min-width: 0; }
#game-screen .sheet-item small { font-size: 11px; font-weight: 500; color: rgba(255, 255, 255, 0.55); }
#game-screen .sheet-item small:empty { display: none; }
#game-screen .sheet-item:active { scale: .98; }
@media (hover: hover) { #game-screen .sheet-item:hover { background: rgba(255, 255, 255, 0.09); } }
#game-screen .sheet-item.popout-btn { display: none; }
@container (min-width: 900px) and (min-height: 560px) { #game-screen .sheet-item.popout-btn { display: flex; } }
body.pinned-table #game-screen .sheet-item.popout-btn { display: none; }
/* A short screen gets the list in two columns so it fits without scrolling. */
@container (max-height: 460px) {
  #game-screen .sheet-card { width: min(680px, calc(100% - 16px)); padding: 8px 10px 10px; }
  #game-screen .sheet-head { padding: 0 2px 6px; font-size: 14px; }
  #game-screen .sheet-info { display: grid; grid-template-columns: repeat(3, auto); gap: 2px 16px; padding: 6px 10px; margin-bottom: 6px; font-size: 11px; }
  #game-screen .si-row { flex-direction: column; gap: 0; padding: 0; }
  #game-screen .si-rules { grid-column: 1 / -1; margin-top: 2px; font-size: 10.5px; line-height: 1.3; }
  #game-screen .sheet-list { grid-template-columns: 1fr 1fr; gap: 3px; }
  #game-screen .sheet-item { min-height: 36px; padding: 5px 10px; font-size: 13px; }
  #game-screen .sheet-item small { font-size: 10px; }
}

/* ---- the felt and the seats on its rail (22 Oct 2026, GG/Stars pattern) ----
   Every seat is an avatar whose centre sits on the rail, with one plate
   under it (name, then the seat's number) that tucks over the avatar's
   bottom edge. Seats stand at clock positions on the oval: 9, 10:30, 12,
   1:30 and 3 o'clock for the opponents, 6 o'clock for the player. The seat
   box is anchored by its avatar's centre, so left/top below are points on
   the rail (the felt's border-radius is 50% / 46%: the 10:30 point is the
   top-left arc at 55 degrees, x = 50 - 50 cos 55, y = 46 - 46 sin 55). */
#game-screen .game-container {
  --opp-avatar: calc(38 * var(--u));
  --plate-tuck: calc(7 * var(--u));
  /* The plate is two lines of type with their floors, so its height is
     worked out once and the board band below is measured from it. */
  --plate-name: max(8px, calc(8.5 * var(--u)));
  --plate-num: max(8px, calc(9 * var(--u)));
  --plate-h: calc(var(--plate-name) * 1.12 + var(--plate-num) * 1.04 + 3 * var(--u) + 2px);
  /* The player's seat: its plate's bottom stands just clear of the hand on a
     phone, and on a window, where the felt ends above the hand, its avatar
     centre lands on the bottom rail. */
  --seat-b: max(calc(var(--hand-h) + var(--act-h) + 7 * var(--u)), calc(var(--felt-bottom) - var(--my-av) / 2 - var(--plate-h) + var(--plate-tuck)));
  /* The head seat sits 5 units higher on the rail (still across it), for air over the board. */
  --head-lift: calc(5 * var(--u));
  --my-av: calc(44 * var(--u));
}
#game-screen .opponents-area {
  left: calc(var(--felt-x) + 2 * var(--u)); right: calc(var(--felt-x) + 2 * var(--u));
  top: calc(var(--felt-top) + 2 * var(--u)); bottom: calc(var(--felt-bottom) + 2 * var(--u));
  padding: 0; min-height: 0;
}
#game-screen .opponent {
  width: calc(76 * var(--u)); gap: 0;
  transform: translate(-50%, calc(var(--opp-avatar) / -2));
  opacity: .78; transition: opacity .2s ease;
}
#game-screen .opponent.active { opacity: 1; }
/* Out of the hand: the avatar and plate fade further; the badge across the
   avatar stays readable. */
#game-screen .opponent.dropped { opacity: 1; }
#game-screen .opponent.dropped > .opponent-avatar, #game-screen .opponent.dropped > .seat-plate { opacity: .4; }
#game-screen .opponent-avatar { width: var(--opp-avatar); height: var(--opp-avatar); font-size: calc(16 * var(--u)); border-width: 2px; flex: 0 0 auto; }
#game-screen .opponent-timer-ring { inset: calc(-4 * var(--u)); }
/* The seconds sit on the avatar's shoulder, as on the player's own seat:
   under the avatar is the plate's place. */
#game-screen .opponent-timer-text {
  top: calc(-8 * var(--u)); left: calc(-13 * var(--u)); bottom: auto; transform: none; z-index: 4;
  min-width: calc(20 * var(--u)); height: calc(18 * var(--u)); line-height: calc(16 * var(--u));
  padding: 0 calc(4 * var(--u)); border-radius: calc(9 * var(--u)); font-size: max(8px, calc(9.5 * var(--u))); box-sizing: border-box;
}

/* The plate: name on top, number under it. */
#game-screen .seat-plate {
  position: relative; z-index: 3; box-sizing: border-box;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  margin-top: calc(var(--plate-tuck) * -1);
  min-width: calc(58 * var(--u)); max-width: calc(76 * var(--u));
  height: var(--plate-h); padding: calc(1.5 * var(--u)) calc(7 * var(--u));
  border-radius: min(var(--r-ctl, 12px), calc(9 * var(--u)));
  background: rgba(10, 6, 20, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 calc(2 * var(--u)) calc(6 * var(--u)) rgba(0, 0, 0, 0.45);
  transition: background .2s ease, border-color .2s ease, box-shadow .2s ease;
}
#game-screen .seat-plate .opponent-name, #game-screen .seat-plate .plate-name {
  order: 0; display: block; max-width: 100%; margin: 0;
  font-size: var(--plate-name); line-height: 1.12; font-weight: 700; color: #fff;
  text-shadow: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#game-screen .seat-plate .opponent-score, #game-screen .seat-plate .my-seat-score {
  position: static; display: block; min-width: 0; height: auto; margin: 0; padding: 0;
  background: none; border: 0; box-shadow: none; border-radius: 0;
  font-size: var(--plate-num); line-height: 1.04; font-weight: 800; color: var(--gold, #F0B840);
  font-variant-numeric: tabular-nums; text-align: center;
}
#game-screen .seat-plate .my-seat-score[hidden] { display: none; }
/* The player to act: a lit plate (the ring drains around the avatar). */
#game-screen .opponent.active .seat-plate, #game-screen .my-seat.my-turn .seat-plate {
  background: linear-gradient(180deg, rgba(var(--gold-rgb, 240,184,64), 0.34), rgba(58, 30, 6, 0.92));
  border-color: var(--gold, #F0B840);
  box-shadow: 0 0 calc(10 * var(--u)) rgba(var(--gold-rgb, 240,184,64), 0.55), 0 calc(2 * var(--u)) calc(6 * var(--u)) rgba(0, 0, 0, 0.45);
}
#game-screen .opponent.active .seat-plate .opponent-score, #game-screen .my-seat.my-turn .seat-plate .my-seat-score { color: #FFE3A3; }

/* Dealer chip on the seat's inner side, towards the centre. */
#game-screen .seat-dealer { width: calc(15 * var(--u)); height: calc(15 * var(--u)); font-size: max(7px, calc(8 * var(--u))); border-width: 1.5px; left: auto; right: calc(-9 * var(--u)); top: calc(50% - 7.5 * var(--u)); }
#game-screen .opponent.side-r .seat-dealer { right: auto; left: calc(-9 * var(--u)); }
#game-screen .opponent.side-t .seat-dealer { top: calc(50% - 3 * var(--u)); right: calc(-10 * var(--u)); }
/* Dropped, out, eliminated: a small badge across the avatar. */
#game-screen .opponent > .seat-out {
  position: absolute; left: 50%; top: calc(var(--opp-avatar) / 2); transform: translate(-50%, -50%); z-index: 5; margin: 0;
  padding: calc(1 * var(--u)) calc(4 * var(--u)); border-radius: var(--r-ctl, 12px);
  background: rgba(8, 4, 14, 0.86); color: #fff; border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: max(7px, calc(7.5 * var(--u))); line-height: 1.2; font-weight: 800; letter-spacing: .3px; white-space: nowrap; text-transform: uppercase;
}

/* Clock positions on the rail. */
#game-screen .opponents-area .opponent { left: 50%; top: calc(0% - var(--head-lift)); }
#game-screen .opponents-area.seats-2 .opponent:nth-child(1) { left: 21.3%; top: 8.3%; }
#game-screen .opponents-area.seats-2 .opponent:nth-child(2) { left: 78.7%; top: 8.3%; }
#game-screen .opponents-area.seats-3 .opponent:nth-child(1) { left: 0%;   top: 50%; }
#game-screen .opponents-area.seats-3 .opponent:nth-child(2) { left: 50%;  top: calc(0% - var(--head-lift)); }
#game-screen .opponents-area.seats-3 .opponent:nth-child(3) { left: 100%; top: 50%; }
#game-screen .opponents-area.seats-4 .opponent:nth-child(1) { left: 0%;    top: 50%; }
#game-screen .opponents-area.seats-4 .opponent:nth-child(2) { left: 21.3%; top: 8.3%; }
#game-screen .opponents-area.seats-4 .opponent:nth-child(3) { left: 78.7%; top: 8.3%; }
#game-screen .opponents-area.seats-4 .opponent:nth-child(4) { left: 100%;  top: 50%; }
#game-screen .opponents-area.seats-5 .opponent:nth-child(1) { left: 0%;    top: 50%; }
#game-screen .opponents-area.seats-5 .opponent:nth-child(2) { left: 21.3%; top: 8.3%; }
#game-screen .opponents-area.seats-5 .opponent:nth-child(3) { left: 50%;   top: calc(0% - var(--head-lift)); }
#game-screen .opponents-area.seats-5 .opponent:nth-child(4) { left: 78.7%; top: 8.3%; }
#game-screen .opponents-area.seats-5 .opponent:nth-child(5) { left: 100%;  top: 50%; }

/* Under 300px of height the plates' type floors (8px) cost a few units, so
   the head seat rides 4 units higher and the player's avatar is 42. */
@container (max-height: 300px) {
  #game-screen .game-container { --head-lift: calc(9 * var(--u)); --my-av: calc(42 * var(--u)); }
}

/* ---- the board: the value pill over the piles, in the band of felt
   between the head seat's plate and the player's own seat. The column runs
   from the header (44) to the hand (130 from the bottom); the paddings put
   the band's edges at the head seat's plate (felt top + 40) and the top of
   the player's seat (its bottom + 61). ---- */
#game-screen .table-center {
  flex: 1 1 auto; min-height: 0;
  flex-wrap: wrap; align-content: center; justify-content: center;
  gap: calc(9 * var(--u)) calc(12 * var(--u));
  padding: calc(var(--felt-top) + 21 * var(--u) - var(--head-lift) - var(--plate-tuck) + var(--plate-h) - var(--bar-h)) calc(6 * var(--u)) max(0px, calc(var(--seat-b) + var(--my-av) - var(--plate-tuck) + var(--plate-h) - var(--hand-h) - var(--act-h)));
}
#game-screen .board-pill-row { flex: 0 0 100%; display: flex; justify-content: center; height: calc(14 * var(--u)); pointer-events: none; }
#game-screen .table-center:has(.toss-felt:not([hidden])) .board-pill-row { display: none; }
#game-screen .board-pill {
  display: inline-block; box-sizing: border-box; height: calc(14 * var(--u)); line-height: calc(14 * var(--u) - 2px);
  padding: 0 calc(9 * var(--u)); border-radius: var(--r-ctl, 12px);
  background: rgba(8, 4, 14, 0.62); border: 1px solid rgba(255, 255, 255, 0.16); color: #fff;
  font-size: max(8px, calc(8.5 * var(--u))); font-weight: 700; letter-spacing: .3px; white-space: nowrap;
  font-variant-numeric: tabular-nums; box-shadow: 0 calc(2 * var(--u)) calc(6 * var(--u)) rgba(0, 0, 0, 0.3);
}
#game-screen .board-pill[hidden] { display: none; }
#game-screen .table-center .card, #game-screen .table-center .pile .card { width: calc(44 * var(--u)); height: calc(62 * var(--u)); border-radius: calc(5 * var(--u)); }
#game-screen .pile { gap: calc(8 * var(--u)); }
#game-screen .wild-pile .pile-label { font-size: max(7px, calc(8 * var(--u))); padding: calc(1 * var(--u)) calc(6 * var(--u)); letter-spacing: calc(1 * var(--u)); top: calc(-9 * var(--u)); }
#game-screen .pile-count { top: calc(-9 * var(--u)); right: calc(-12 * var(--u)); min-width: calc(24 * var(--u)); height: calc(20 * var(--u)); line-height: calc(18 * var(--u)); padding: 0 calc(6 * var(--u)); font-size: max(9px, calc(10 * var(--u))); }
#game-screen .pile-view-btn { padding: calc(7 * var(--u)) calc(10 * var(--u)) calc(7 * var(--u)) calc(12 * var(--u)); gap: calc(5 * var(--u)); font-size: max(9px, calc(11 * var(--u))); }
#game-screen .pile-view-btn svg { width: calc(12 * var(--u)); height: calc(12 * var(--u)); }
#game-screen .finish-slot { width: calc(46 * var(--u)); height: calc(64 * var(--u)); border-radius: calc(7 * var(--u)); font-size: max(7px, calc(8 * var(--u))); letter-spacing: calc(1 * var(--u)); border-width: 2px; }
#game-screen .finish-slot.holds-card { padding: calc(2 * var(--u)); }
/* The result line says what happened, so the toss needs no title: it keeps the toss clear of the head seat on short screens. */
#game-screen .toss-felt .toss-title { display: none; }
#game-screen .toss-felt .toss-draws { gap: calc(10 * var(--u)); }
#game-screen .toss-felt .toss-draw .card { width: calc(44 * var(--u)); height: calc(62 * var(--u)); }
#game-screen .toss-felt .toss-result { padding: calc(5 * var(--u)) calc(12 * var(--u)); font-size: max(10px, calc(12 * var(--u))); }

/* ---- the player's own seat: 6 o'clock, avatar and plate like every seat ---- */
#game-screen #turn-indicator.my-seat { left: 50%; bottom: var(--seat-b); top: auto; transform: translateX(-50%); gap: 0; opacity: .9; transition: opacity .2s ease; }
#game-screen #turn-indicator.my-seat.my-turn { opacity: 1; }
#game-screen #turn-indicator.my-seat.out { opacity: .5; }
#game-screen .my-seat-avatar, #game-screen .my-seat.tight .my-seat-avatar { width: var(--my-av); height: var(--my-av); font-size: calc(17 * var(--u)); border-width: 3px; flex: 0 0 auto; }
#game-screen .my-seat .turn-ring, #game-screen .my-seat.tight .turn-ring { inset: calc(-6 * var(--u)); width: calc(100% + calc(12 * var(--u))); height: calc(100% + calc(12 * var(--u))); }
#game-screen .my-seat .turn-timer-display, #game-screen .my-seat.tight .turn-timer-display { left: auto; right: calc(100% + 6 * var(--u)); top: calc(50% - 12 * var(--u)); min-width: calc(24 * var(--u)); height: calc(24 * var(--u)); line-height: calc(20 * var(--u)); padding: 0 calc(5 * var(--u)); border-radius: calc(12 * var(--u)); font-size: max(10px, calc(11 * var(--u))); border-width: 2px; }
#game-screen .my-seat .seat-plate { min-width: calc(62 * var(--u)); max-width: calc(84 * var(--u)); }
#game-screen .my-seat.improved .seat-plate .my-seat-score { color: #2BD98A; }
/* Every line of text on the table is centred on it (27 Oct 2026). The step prompt sits
   centred just inside the felt's bottom edge, above the player's own seat. */
#game-screen #action-prompt, #game-screen .action-prompt {
  left: 50%; right: auto; top: auto; transform: translateX(-50%);
  bottom: max(calc(var(--felt-bottom) + 16 * var(--u)), calc(var(--seat-b) + var(--plate-h) - var(--plate-tuck) + var(--my-av) + 6 * var(--u)));
  padding: calc(4 * var(--u)) calc(14 * var(--u)); font-size: max(10px, calc(11 * var(--u))); line-height: 1.3; border-radius: calc(16 * var(--u));
  max-width: calc(100% - 2 * var(--felt-x) - 80 * var(--u)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center;
  transition: opacity .2s ease, transform .25s ease;
}
#game-screen.has-lifted #action-prompt, #game-screen.has-lifted .action-prompt { margin-bottom: 0; }
@media (orientation: landscape) and (max-height: 520px) {
  #game-screen #action-prompt, #game-screen .action-prompt { left: calc(50% + var(--my-av) / 2 + 12 * var(--u)); transform: none; bottom: calc(var(--seat-b) + var(--plate-h) - var(--plate-tuck) + var(--my-av) / 2 - 11 * var(--u)); max-width: calc(50% - var(--my-av) - 24 * var(--u)); }
}
body.force-landscape #game-screen #action-prompt, body.force-landscape #game-screen .action-prompt { left: calc(50% + var(--my-av) / 2 + 12 * var(--u)); transform: none; bottom: calc(var(--seat-b) + var(--plate-h) - var(--plate-tuck) + var(--my-av) / 2 - 11 * var(--u)); max-width: calc(50% - var(--my-av) - 24 * var(--u)); }

/* ---- the hand ---- */
#game-screen .player-hand-area { height: var(--hand-h); box-sizing: border-box; padding: calc(2 * var(--u)) calc(8 * var(--u)) 0; flex: 0 0 auto; }
#game-screen .hand-container { height: calc(88 * var(--u)); min-height: 0; box-sizing: border-box; padding: 0; gap: calc(2 * var(--u)); align-items: flex-start; }
#game-screen .hand-container .card, #game-screen .hand-card { width: var(--hand-card-w); height: calc(var(--hand-card-w) * 1.4); border-radius: calc(5 * var(--u)); }
#game-screen .hand-group, #game-screen .hand-loose { padding: calc(12 * var(--u)) calc(4 * var(--u)) calc(2 * var(--u)); border-radius: calc(7 * var(--u)); }
#game-screen .hand-group { margin: 0 calc(4 * var(--u)); }
#game-screen .hand-group-label { font-size: max(6px, calc(7 * var(--u))); line-height: calc(9 * var(--u)); padding: 0 calc(4 * var(--u)); letter-spacing: calc(1 * var(--u)); }
#game-screen .hand-card.selected { transform: translateY(calc(-10 * var(--u))); }
#game-screen .hand-card.wild-joker::after, #game-screen .hand-card.joker::after { left: calc(12 * var(--u)); height: calc(10 * var(--u)); line-height: calc(10 * var(--u)); padding: 0 calc(4 * var(--u)); font-size: max(6px, calc(7 * var(--u))); }

/* ---- the buttons ---- */
#game-screen .game-actions { height: var(--act-h); min-height: var(--act-h); box-sizing: border-box; padding: calc(3 * var(--u)) calc(8 * var(--u)) calc(4 * var(--u)); gap: calc(12 * var(--u)); flex: 0 0 auto; }
#game-screen .game-actions button, #game-screen .game-actions .btn-action, #game-screen .game-actions .btn-declare, #game-screen .game-actions .btn-drop, #game-screen .game-actions .btn-discard {
  height: calc(34 * var(--u)); min-height: calc(34 * var(--u)); padding: 0 calc(14 * var(--u)); font-size: max(10px, calc(12 * var(--u))); gap: calc(6 * var(--u)); border-radius: 999px;
}
#game-screen .btn-action svg { width: calc(15 * var(--u)); height: calc(15 * var(--u)); }

/* The table chips (two or more tables) sit bottom-left on a phone held
   sideways: the action bar starts after them (report F02, WebKit sweep 25 Sep). */
@media (orientation: landscape) and (max-height: 520px) {
  body.has-tray #game-screen .game-actions { padding-left: calc(var(--tray-w, 0px) + 12px + 2 * var(--bar-btn) + 12px); }
}
body.force-landscape.has-tray #game-screen .game-actions { padding-left: calc(var(--tray-w, 0px) + 12px + 2 * var(--bar-btn) + 12px); }

/* An operator's logo on the felt (27 Oct 2026): faint on the felt above
   the piles. Screen blending drops a dark logo background, so a white-on-black
   wordmark reads as a light mark on the cloth. Hidden unless the brand has a logo. */
#game-screen .felt-brand {
  position: absolute; z-index: 1; pointer-events: none;
  left: 50%; top: calc(var(--felt-top) + var(--felt-h) * 0.3); transform: translate(-50%, -50%);
  width: calc(120 * var(--u)); max-width: 34%; height: auto;
  opacity: .22; mix-blend-mode: screen;
}
#game-screen .felt-brand[hidden] { display: none; }

/* The toss: alone in the middle of the felt, the piles out of the way until the deal. */
#game-screen.tossing .table-center > :not(.toss-felt) { display: none; }
#game-screen .toss-felt {
  position: absolute; z-index: 3; left: 50%; top: calc(var(--felt-top) + var(--felt-h) / 2); translate: -50% -50%;
  width: max-content; max-width: calc(100% - 2 * var(--felt-x) - 40 * var(--u)); gap: calc(8 * var(--u));
}
#game-screen .toss-felt .toss-draws { justify-content: center; }
@media (orientation: landscape) and (max-height: 520px) { #game-screen .toss-felt { flex-direction: row; justify-content: center; gap: calc(16 * var(--u)); } }
body.force-landscape #game-screen .toss-felt { flex-direction: row; justify-content: center; gap: calc(16 * var(--u)); }
/* The toss cards stay on one line (tester, 26 Nov 2026: at a six-seat table on a phone turned
   sideways the row wrapped after four cards and ran under the head seats). Names fit the card
   width, and with five or six cards the result line goes under the cards instead of beside them. */
#game-screen .toss-felt .toss-draws { flex-wrap: nowrap; gap: calc(8 * var(--u)); }
#game-screen .toss-felt .toss-name { max-width: calc(58 * var(--u)); font-size: max(9px, calc(11 * var(--u))); }
#game-screen .toss-felt:has(.toss-draw:nth-child(5)) { flex-direction: column; gap: calc(6 * var(--u)); }
#game-screen .toss-felt:has(.toss-draw:nth-child(5)) .toss-draws { margin: 0; }
#game-screen .toss-felt .toss-result {
  background: rgba(0, 0, 0, 0.55); border: 1px solid rgba(var(--gold-rgb, 240,184,64), 0.5); color: var(--gold-light, #FFD97A);
  border-radius: calc(16 * var(--u)); text-align: center; white-space: nowrap;
}

/* Messages at the table sit beside the player's own seat, on the side opposite the step
   prompt (left of the seconds), level with the seat and growing upwards. The felt's upper
   half, where they used to be, is the piles' row on a phone and the board pill on a tablet,
   and a message there hid the cards (tester, 27 Nov 2026). One message at a time, and a
   message never takes a tap, so a card or pile under one still works. */
#game-screen .table-toasts {
  position: absolute; z-index: 30; left: auto; top: auto; transform: none;
  right: calc(50% + var(--my-av) / 2 + 40 * var(--u)); bottom: calc(var(--seat-b) + 2 * var(--u));
  display: flex; flex-direction: column; align-items: flex-end; gap: calc(6 * var(--u));
  width: max-content; max-width: calc(50% - var(--my-av) / 2 - 100 * var(--u) - var(--felt-x)); pointer-events: none;
}
#game-screen .table-toasts .toast {
  max-width: 100%; text-align: center; font-size: max(11px, calc(12 * var(--u))); padding: calc(6 * var(--u)) calc(14 * var(--u));
  border-radius: calc(14 * var(--u)); pointer-events: none;
}
#game-screen .table-toasts .toast:not(:last-child) { display: none; }
/* A taller table has its side seats well up the rail: the lane can be wider, so a long
   message keeps to two lines and stays under the step prompt. */
@media (min-height: 521px) {
  body:not(.force-landscape) #game-screen .table-toasts { max-width: calc(50% - var(--my-av) / 2 - 50 * var(--u) - var(--felt-x)); }
}

/* The action bar and its buttons keep a thumb-sized floor (UI sweep, 17 Nov 2026: 27 px on a small
   phone with the table turned sideways). Not on a table under 300 px tall, where the extra height
   pushed the seats into the board (scripts/table-check.js, phone-shortest). */
@container (min-height: 300px) {
  #game-screen .game-container { --act-h: max(36px, calc(40 * var(--u))); }
  #game-screen .game-actions button, #game-screen .game-actions .btn-action, #game-screen .game-actions .btn-declare, #game-screen .game-actions .btn-drop, #game-screen .game-actions .btn-discard {
    height: max(30px, calc(34 * var(--u))); min-height: max(30px, calc(34 * var(--u)));
  }
}

/* The server update notice (28 Nov 2026, app.js showMaintenance): stays up, no fade-out. This
   sheet is outside the layers, so it wins over the toast animation in darbar.css. */
#toast-container .toast.toast-persist, #game-screen .table-toasts .toast.toast-persist { animation: toastIn 0.22s ease-out; font-weight: 600; }
