/* table.css, owner: track D1. Holds: .table-app, the bar and its Menu, the stage and the felt, seats, the trick, the hand dock, the spectator's hands, and the phone on its side.
   Load order 8 of 15: base, primitives, frame, home, room, friends, center, table, rails, chat, coach, meld, peek, results, dialogs.
   The deck's cards.css (injected by deck-style.js) loads after this file and is unlayered, so a rule here that sets a card property the deck also sets carries one class more.
   Sizes come from the stage's own box (DESIGN_SPEC.md 7.2). The phone and the phone on its side keep their old geometry (7.8), written as N * var(--px): 1 px, so the shared
   vectors and web-build24-layout still hold to the pixel. */

/* ---- 7.1 the shell: bar on top, a rail either side, the stage between; outside the table it takes no room ---- */
.table-app, .stage { display: contents; }
.stage[hidden] { display: none; }   /* framed pages have their own main (nav.js frameOn) */
.table-app > .top-chrome, .table-app > .rail { display: none; }
body.at-table .table-app {
  --r: clamp(16px, calc(16px + (100vw - 1440px) * 0.00357), 20px);   /* the root size, as a length that does not follow Larger Text (a card and the phone's pinned sizes must not) */
  --px: calc(var(--r) / 16);   /* one design pixel of a fixed size: 1 px up to 1440 wide, 1.25 px at 2560; the phone and the phone on its side are 1 px */
  --rail-l: 0px; --rail-r: 0px;
  display: grid; grid-template-columns: var(--rail-l) minmax(0, 1fr) var(--rail-r); grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas: "bar bar bar" "left stage right"; height: 100vh; height: 100dvh; overflow: hidden;
}
body.at-table .table-app > .top-chrome { display: block; grid-area: bar; position: relative; z-index: var(--z-bar); min-width: 0; }
body.at-table.menu-open .table-app > .top-chrome { z-index: calc(var(--z-panel) + 1); }   /* an open Menu is above both rails and the speech bubbles (#bubble-layer is --z-panel less 1, chat.css), which the bar's own 30 would put under it; track D2 brings the bubbles under the drawers, and this becomes var(--z-menu) */
@media (min-width: 1024px) { body.at-table .table-app { --rail-l: 15rem; --rail-r: 3.75rem; } body.at-table .table-app > .rail { display: block; } }
@media (min-width: 1440px) { body.at-table .table-app { --rail-l: clamp(16rem, 18vw, 21rem); --rail-r: clamp(18rem, 20vw, 24rem); } }
body.at-table.rail-closed .table-app { --rail-r: 3.75rem; }
@media (min-width: 1024px) { body.at-table.large-text .table-app { --rail-l: 0px; --rail-r: 3.75rem; } body.at-table.large-text .rail--left { display: none; } }   /* 7.12 */
.rail { min-width: 0; min-height: 0; overflow: hidden; background: var(--ink-0); border: 0 solid var(--hair); z-index: var(--z-rail); }
.rail--left { grid-area: left; border-right-width: 1px; container: rail / size; }
.rail--right { grid-area: right; border-left-width: 1px; container: rail-r / size; }
.rail__scroll { height: 100%; overflow-y: auto; padding: var(--sp-4); }

/* The stage is the felt, full bleed to the bar, the rails, and the window's bottom; it is the size container every table measure is taken from (7.2). */
body.at-table .stage {
  --u: max(0.62px, min(calc(100cqw / 900), calc(100cqh / 640)));
  --span: 9.4; --pad: calc(4.5 * var(--r)); --lo: calc(3.25 * var(--r));
  --hand-cw: clamp(var(--lo), min(calc((100cqw - var(--pad)) / var(--span)), calc(100cqh * 0.135)), calc(11 * var(--r)));
  --trick-cw: clamp(var(--lo), min(calc(100cqw * 0.14), calc(100cqh * 0.14)), calc(12 * var(--r)));
  --stage-type: clamp(0.9375rem, calc(15 * var(--u)), 1.4rem);
  --felt-max: calc(920 * var(--u));
  display: grid; grid-area: stage; grid-template-rows: minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr);
  position: relative; overflow: hidden; container: stage / size;
  background: radial-gradient(ellipse 78% 68% at 50% 38%, var(--felt) 0%, var(--table) 48%, var(--felt-edge) 100%);
}
@media (max-height: 800px) { body.at-table .table-app { --r: 16px; } }   /* base.css keeps the root at the user's size on a short window */
.stage > #phase-root { grid-row: 1; min-height: 0; min-width: 0; }
.stage > #hand-slot { grid-row: 2; position: relative; z-index: 3; }
.game-content { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.stage:focus { outline: none; }
body.at-table .table-app :is(.card, button, summary, #hand-slot, .seat-plate) { -webkit-user-select: none; user-select: none; }
/* The old text link and the disclosure row are on every screen (Home, the lobby, the dialogs, the Meld Chart link in the bid panel). They were px blocks at the top of this file;
   here they are rem, and primitives.css (track A) should take them (needs). */
.link-btn { display: inline-flex; align-items: center; justify-content: center; min-height: var(--hit); padding: 0 var(--sp-2); background: none; border: 0; color: var(--text-dim); text-decoration: underline; font-size: max(0.8rem, 12px); cursor: pointer; }
details > summary { min-height: var(--hit); padding-block: var(--sp-3); cursor: pointer; }
/* Every disclosure that has no icon of its own draws the chevron icon, not a text triangle (fix round 3 m11): down when closed, turned over when open; a row that opens right turns it a quarter. */
:is(.landing-more > summary, .summary-manage > summary, .options-note > summary, .rules-glossary > summary, .meld-summary-head, .trick-history-title, .meld-board.fit-compact .meld-seat:not(.is-open) button.meld-seat-head)::after {
  content: ""; display: inline-block; flex: none; width: 1.1em; height: 1.1em; margin-left: var(--sp-2); vertical-align: -0.2em; background: currentcolor;
  -webkit-mask: var(--chevron) center / contain no-repeat; mask: var(--chevron) center / contain no-repeat; transition: rotate var(--dur-fast);
}
:is(.landing-more, .summary-manage, .options-note, .rules-glossary, .meld-summary-line)[open] > :is(summary, .meld-summary-head)::after { rotate: 180deg; }
:is(.summary-manage, .options-note, .rules-glossary) > summary { list-style: none; }
:is(.summary-manage, .options-note, .rules-glossary) > summary::-webkit-details-marker { display: none; }
.meld-summary-head::after, .trick-history-title[aria-expanded="false"]::after { rotate: -90deg; }
.meld-summary-line[open] > .meld-summary-head::after { rotate: 0deg; }

/* ---- 6.5 the bar ---- */
.bar { container: bar / inline-size; position: relative; display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-1) var(--sp-4); padding-top: calc(var(--sp-1) + env(safe-area-inset-top, 0px)); min-height: 56px; background: var(--ink-0); border-bottom: 1px solid var(--hair); }
.bar__left { flex: none; }   /* the Menu's popover is placed against the bar (position: relative above), so its own height can be the window less the bar: a phone's bar is three rows tall */
.menu-btn { gap: var(--sp-2); padding: 0 var(--sp-3) 0 var(--sp-2); color: var(--text); font: var(--t-label); }
.menu-btn__mark { width: 2rem; height: 2rem; border-radius: var(--r-sm); }
.menu-btn__caret { width: 1rem; height: 1rem; color: var(--text-dim); }
.menu-btn[aria-expanded="true"] { background-color: var(--gold-wash); }
.top-menu { position: absolute; top: calc(100% + var(--sp-2)); left: var(--sp-4); z-index: var(--z-menu); max-height: calc(100dvh - 100% - var(--sp-2) - var(--sp-4)); overflow-y: auto; overscroll-behavior: contain; }
.top-menu[hidden] { display: none; }
.menu__group + .menu__group { margin-top: var(--sp-2); padding-top: var(--sp-1); border-top: 1px solid var(--hair); }
.menu__item .i { width: 1.125rem; height: 1.125rem; color: var(--text-dim); }
.menu__item:focus-visible { background: var(--wash-hover); }
.menu__item--danger .i { color: currentcolor; }
.menu__hint { margin-left: auto; color: var(--text-dim); }
.menu__item .menu-state { margin-left: auto; font: var(--t-caption); font-weight: 700; color: var(--text-faint); }
.menu__item .menu-state.is-on { color: var(--good); }
.bar__mid { display: flex; flex: 1; align-items: center; justify-content: center; gap: var(--sp-3); min-width: 0; overflow: hidden; }
.bar__table { display: none; flex: none; font: var(--t-small); color: var(--text-dim); white-space: nowrap; }
.bar__code { min-height: calc(36 * var(--px)); padding: 0 var(--sp-1); border: 0; border-radius: var(--r-sm); background: none; color: var(--text); font-family: var(--font-mono); font-size: 1em; font-weight: 700; cursor: pointer; }
@media (any-pointer: coarse) { .bar__code { min-height: calc(44 * var(--px)); } }
@container bar (max-width: 359.98px) { .toolbar-guide { display: none; } }   /* a 360 wide phone's bar (344) holds Menu, Chat, and both scores whole (review round 2 M2: "Them" and the DOWNS marker need 95 px); the Meld Chart is in the Menu */
@container bar (max-width: 329.98px) { .menu-btn__caret { display: none; } .bar .score-pill { padding-inline: var(--sp-1); column-gap: 0.1875em; } }   /* the smallest phone: Menu loses its caret and the pills their padding so both scores stay one row */   /* the smallest phone (the bar's own width 304 at 320): Menu, both scores, and Chat fill the row; the Meld Chart is in the Menu, and a link in the bid panel */
@media (min-width: 1024px) { .bar__table { display: block; } }   /* 6.5: laptop and up */
.hand-context { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); min-width: 0; max-height: 1.8125rem; overflow: hidden; }   /* a chip that does not fit goes to a hidden second row, not half out of the bar */
@media (min-width: 600px) { .hand-context { display: none; } }   /* 6.5: the chips are a phone's second row; a tablet has no room for them in the bar */
@media (min-width: 1024px) { .hand-context { display: flex; } }
@container bar (min-width: 600px) and (max-width: 1149.98px) { .hand-context { display: none; } }   /* the table's line (from 1024) takes the room first; a chip is whole or not drawn */
.ctx-chip { flex: none; display: inline-block; padding: 0 var(--sp-3); border: 1px solid var(--hair); border-radius: var(--r-full); background: var(--white-04); color: var(--text-dim); font: var(--t-caption); line-height: 1.625rem; white-space: nowrap; }
.ctx-chip b { color: var(--text); }
.ctx-chip.is-quiet { opacity: 0.8; }
.ctx-chip.is-hands { font-weight: 700; }
.ctx-chip.is-options { white-space: normal; }
.trump-glyph { display: inline-block; font-size: 1.1em; line-height: 1; color: var(--suit-on-dark-white); vertical-align: -0.1em; }
.trump-glyph.suit-H, .trump-glyph.suit-D { color: var(--suit-on-dark-red); }
body.four-color-deck .trump-glyph.suit-C { color: #7ee08f; }
body.four-color-deck .trump-glyph.suit-D { color: #82b8ff; }
.score-pills { display: flex; flex: none; gap: var(--sp-2); min-width: 0; }
.score-pill { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto 0.25rem; align-items: center; column-gap: var(--sp-3); row-gap: var(--sp-1); min-width: 0; max-width: 12rem; padding: var(--sp-1) var(--sp-3) var(--sp-2); border: 1px solid var(--hair); border-radius: var(--r-lg); background: var(--white-04); }
.score-pill.is-mine { background: var(--wash-hover); border-color: var(--line); }
.score-pill.no-target { grid-template-rows: auto; }
.score-pill.team-ns { color: var(--team-ns); }
.score-pill.team-ew { color: var(--team-ew); }
.pill-names { min-width: 0; overflow: hidden; font: var(--t-caption); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.pill-score { color: var(--text); font-size: max(1.375rem, 12px); font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; text-align: right; }
.pill-end { display: inline-flex; align-items: center; gap: var(--sp-2); justify-self: end; }
.pill-downs { display: inline-flex; align-items: center; gap: 0.1875rem; color: var(--text-dim); font: var(--t-eyebrow); letter-spacing: 0.03em; text-transform: uppercase; white-space: nowrap; }
.pill-downs.has-used { color: var(--gold); }
.pill-downs-label { display: none; }   /* fix round 1 M2: the words "Misses allowed" cut "Them" to "Th..." at 1440 and the table name at 1024; the pips keep their title and spoken text, and the words are gone at every width (at 1920 they clipped \"Them\" again) */
@media (min-width: 1024px) { .score-pill { max-width: 16rem; } }   /* review R8: "Them" and the DOWNS marker fit one pill (the name was cut to "Th..." at 12rem) */
.pill-pip { width: 0.5rem; height: 0.5rem; border: 1.5px solid currentcolor; border-radius: 50%; }
.pill-pip.is-used { background: var(--gold); border-color: var(--gold); }
.pill-bar { grid-column: 1 / -1; height: 0.25rem; overflow: hidden; border-radius: var(--r-xs); background: var(--track); }
.pill-bar > span { display: block; height: 100%; border-radius: var(--r-xs); background: currentcolor; transition: width 0.6s var(--ease-out); }
.top-actions { display: flex; flex: none; gap: var(--sp-1); margin-left: auto; }
.bar__btn { position: relative; padding: 0 var(--sp-3); }
.bar__btn.is-active { background-color: var(--gold-wash); color: var(--gold-strong); }
.bar__text { display: none; }
@media (min-width: 1024px) { .bar__text { display: inline-flex; } }
.bar__btn .badge { position: absolute; top: calc(var(--sp-1) * -1); right: calc(var(--sp-1) * -1); }
body.talk-waiting .toolbar-chat .badge { box-shadow: 0 0 0 2px var(--white); }
.toolbar-undo { font-weight: 600; }
.btn-sub-bot { min-height: calc(44 * var(--px)); padding: var(--sp-1) var(--sp-3); border: 1px solid var(--gold-line); border-radius: var(--r-md); background: var(--gold-wash); color: var(--gold-strong); font-size: max(0.75rem, 12px); white-space: nowrap; cursor: pointer; }
.btn-sub-bot:hover { background: var(--gold-line); }

/* ---- 7.5 the felt: four seats round a center, you at the bottom ---- */
.game-table {
  position: relative; display: grid; flex: 1 1 auto; min-height: 0; width: 100%; max-width: var(--felt-max); margin-inline: auto;
  grid-template-areas: ". top ." "left center right" ". bottom .";
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto;
  gap: calc(8 * var(--u)) calc(14 * var(--u)); padding: calc(14 * var(--u)) calc(18 * var(--u)) calc(10 * var(--u));
  font-size: max(0.75rem, var(--stage-type));
}
.player-top { grid-area: top; justify-self: center; }
.player-left { grid-area: left; align-self: center; justify-self: start; }
.player-right { grid-area: right; align-self: center; justify-self: end; }
.player-bottom, .player-undefined { grid-area: bottom; justify-self: center; }
.player-zone { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 0.4em; min-width: 0; max-width: 100%; }
.seat-plate { display: flex; align-items: center; gap: 0.6em; min-width: 0; max-width: 100%; padding: 0.5em 0.75em 0.5em 0.5em; border: 1px solid var(--hair); border-radius: var(--r-xl); background: var(--plate-fill); box-shadow: var(--e-1); transition: border-color 0.2s, box-shadow 0.2s; }
.seat-plate.is-empty { padding: 0.6em 1em; color: var(--text-dim); font-size: max(0.75rem, 0.85em); }
.seat-avatar { flex: none; display: grid; place-items: center; width: 2.4em; height: 2.4em; border-radius: 50%; background: var(--team-ew); color: var(--ink-0); font-weight: 800; font-size: 1em; }
.team-ns .seat-avatar { background: var(--team-ns); }
.seat-info { display: flex; flex-direction: column; gap: 0.2em; min-width: 0; }
.player-bottom .seat-info { flex-shrink: 0; }
.player-name-row { display: flex; align-items: center; gap: 0.4em; min-width: 0; }
.player-zone .player-name { min-width: 2.6em; overflow: hidden; font-size: 1em; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.player-bottom .player-name { min-width: 0; overflow: visible; }
.player-zone .trump-symbol { flex: none; font-size: 1.5em; line-height: 1; color: var(--suit-on-dark-white); }
.player-zone .trump-symbol.suit-H, .player-zone .trump-symbol.suit-D { color: var(--suit-on-dark-red); }
.seat-tags { display: flex; flex-wrap: wrap; gap: 0.25em; }
.seat-chip { padding: 0.1em 0.4em; border-radius: var(--r-xs); background: none; box-shadow: inset 0 0 0 1px var(--line); color: var(--text-dim); font-size: max(0.75rem, 0.7em); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.seat-chip.dealer-caption { color: var(--gold-strong); box-shadow: inset 0 0 0 1px var(--gold-line); }
.seat-chip.presence-idle-dot { color: var(--gold-strong); }
.seat-status { margin-left: 0.3em; padding: 0.25em 0.7em; border-radius: var(--r-full); background: var(--white-08); font-size: max(0.75rem, 0.82em); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.seat-status.is-high { background: var(--gold); color: var(--ink-on-gold); }
.seat-status.is-pass { background: none; color: var(--text-dim); border: 1px dashed var(--line); }
.seat-status.is-thinking { background: var(--gold-wash); color: var(--gold-strong); }
.seat-status.is-ready::after { content: " \2713"; color: var(--good); }
.player-left .seat-plate, .player-right .seat-plate { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 0.6em; row-gap: 0.2em; width: 12em; }
.player-left .seat-avatar, .player-right .seat-avatar { grid-row: 1 / span 2; }
.player-left .seat-status, .player-right .seat-status { grid-column: 2; justify-self: start; margin-left: 0; padding: 0.1em 0.6em; }
.player-zone.teammate .seat-plate { border-color: var(--line); }
.seat-plate[role="button"] { min-height: calc(44 * var(--px)); cursor: pointer; }
@media (any-pointer: coarse) { .seat-plate.is-meld-tap { min-height: calc(44 * var(--px)); } }   /* a plate you press to see a hand's meld is a touch target (12.4; your plate on a phone on its side was 42) */
.player-zone.current-player .seat-plate { position: relative; background: var(--plate-fill-on); border-color: var(--gold); box-shadow: var(--glow-gold); }
.player-zone.current-player .player-name { color: var(--gold-strong); }
.player-zone.current-player .seat-avatar { box-shadow: 0 0 0 3px var(--gold-strong); }
.player-zone.current-player .seat-plate::after { content: ""; position: absolute; inset: calc(var(--sp-1) * -0.25); border-radius: inherit; box-shadow: 0 0 0 5px var(--gold-wash); pointer-events: none; animation: seat-turn 1.6s ease-in-out infinite alternate; }
@keyframes seat-turn { from { opacity: 0.15; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .player-zone.current-player .seat-plate::after { animation: none; opacity: 0.6; } }
.player-zone.presence-dropped .seat-plate, .player-zone.presence-away .seat-plate { opacity: 0.6; border-style: dashed; }
.standin-banner { display: flex; flex-direction: column; align-items: center; gap: 0.15em; min-height: calc(44 * var(--px)); padding: 0.5em 1.4em; border: 1.5px solid var(--gold); border-radius: var(--r-full); background: var(--panel); box-shadow: var(--e-2); color: var(--text); font: inherit; cursor: pointer; }
.standin-banner .standin-sub { font-size: max(0.75rem, 0.8em); font-weight: 600; color: var(--text-dim); }
.standin-banner .standin-main { font-size: 1em; font-weight: 700; }
.spec-hand { max-width: 100%; }
.spec-glyph-line { padding: 0.1em 0.4em; border-radius: var(--r-sm); background: var(--plate-fill-on); }   /* suit colors are for a dark panel (3.7), not the felt */
.spec-glyph-suit.suit-H, .spec-glyph-suit.suit-D { color: var(--suit-on-dark-red); }
body.four-color-deck .spec-glyph-suit.suit-C { color: #7ee08f; }
body.four-color-deck .spec-glyph-suit.suit-D { color: #82b8ff; }

/* A stage under 60rem (a tablet upright, W6, W7, 1440 and 1536 wide with both rails) stacks the side seats into narrow plates, in every phase (a plate never changes width, PLA-48),
   so the trick and the meld board between them keep their room: at 1440 the board has 604 px, not 470. The phone and the phone on its side have their own rules below. */
@container stage (min-width: 600px) and (max-width: 60rem) {
  .player-left .seat-plate, .player-right .seat-plate { display: flex; flex-direction: column; align-items: center; gap: 0.2em; width: 7.5em; padding: 0.5em 0.4em; text-align: center; }
  .player-left .player-name-row, .player-right .player-name-row { flex-wrap: wrap; justify-content: center; row-gap: 0; max-width: 100%; }
  .player-left .seat-info, .player-right .seat-info { align-items: center; }
  .player-left .seat-status, .player-right .seat-status { margin: 0; padding: 0.1em 0.6em; }
  .player-left .seat-tags, .player-right .seat-tags { justify-content: center; }
}

/* ---- the center: the panel, or the trick, in the middle of the seats ---- */
.meld-board.fit-paged .meld-teams { grid-template-columns: minmax(0, 1fr); }   /* one team at a time takes the board's width, on any window (meld.css only did it under 600) */
/* Fix round 3 M1: the meld board takes the middle of the felt. The seat cards are size containers, so they add nothing to the board's natural width and the old `auto` middle column
   shrank to the header's words (364 px in the 893 px stage of a 1440 window, then the names clipped and the board folded to tabs). On a stage 54rem wide or more the two team columns fill the
   middle, up to 70rem (7.5); a landscape phone keeps its own grid below. */
@media (min-width: 600px) {
  @container stage (min-width: 54rem) and (min-height: 25rem) {
    .game-table.phase-meld:has(.meld-board) { grid-template-columns: minmax(0, 6.5rem) minmax(0, 1fr) minmax(0, 6.5rem); }   /* (the plates are as wide as they were squeezed to, 98 to 113 px: the board takes the rest) */
    .game-table.phase-meld .meld-board { width: min(70rem, 100%); }
  }
}

.center-zone { grid-area: center; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: safe center; gap: calc(12 * var(--u)); min-height: 0; min-width: 0; overflow: clip; overflow-clip-margin: 1.5rem; padding: var(--sp-1); }   /* the margin lets the panel's shadow out; a browser without it clips at the box, as before */
.center-zone > * { flex-shrink: 0; }
/* A stage 600 px tall or less, on a tablet or wider (W8 1280 x 600 gives 539, W10 1366 x 650 gives 589): the clear gaps are 4 px (7.2), not 8, so the trick's cross keeps
   the room it needs to be as wide as a card of the hand (AC-21) with its two-line status under it. A phone and a phone on its side have their own rules below. */
@container stage (min-width: 601px) and (min-height: 421px) and (max-height: 600px) {
  .game-table { gap: calc(5 * var(--u)) calc(14 * var(--u)); padding-block: calc(8 * var(--u)) calc(7 * var(--u)); }
  .game-table:where(.phase-bidding, .phase-meld) { max-width: max(var(--felt-max), 62rem); }   /* the bid panel laid out side by side is 600 px wide: the 920u cap (782 at W8) would leave the side plates 96 px each, their names cut to "Ela..."; the meld board is up to 760 wide and left the plates 22 px at 1280 x 600 (AC-03) */
  .center-zone { gap: calc(3 * var(--u)); padding: 0; }
}
.center-zone.is-large-text, .center-zone.is-scroll { overflow-y: auto; justify-content: flex-start; overscroll-behavior: contain; }
.center-zone.is-scroll.has-more-below { --fade-end: calc(100% - var(--pin-h, 0px)); mask-image: linear-gradient(to bottom, var(--ink-0) calc(var(--fade-end) - 1.75rem), var(--scrim) var(--fade-end), var(--ink-0) var(--fade-end)); }
.center-zone.is-scroll.has-more-below::after { content: "\2304"; position: sticky; bottom: calc(var(--pin-h, 0px) * 1); align-self: center; flex: none; margin-top: calc(var(--sp-1) * -4.5); height: 1.125rem; line-height: 0.75rem; color: var(--gold-strong); font-size: max(1.1rem, 12px); pointer-events: none; }
:is(.center-zone.is-scroll, .center-zone.is-large-text) :is(.bid-actions, .trump-actions, .meld-actions) { position: sticky; bottom: 0; z-index: 2; background: var(--panel); box-shadow: 0 -0.5rem 0.75rem var(--panel); }
.table-message { color: var(--text-dim); font-size: max(1.05rem, 12px); }
.center-zone > .trick-area { --cw0: var(--trick-cw); --card-width: calc(var(--cw0) * var(--fit, 1)); --card-height: calc(var(--card-width) * 108 / 76); position: relative; z-index: 2; flex-shrink: 0; width: calc(var(--card-width) * 3.4); height: calc(var(--card-height) * 2.2); }
.trick-card { position: absolute; }
.trick-card .card { transition: transform 0.2s var(--ease-out), box-shadow 0.2s ease; }
.trick-card-0, .trick-card-undefined { bottom: 0; left: 50%; transform: translateX(-50%); }
.trick-card-1 { left: 0; top: 50%; transform: translateY(-50%); }
.trick-card-2 { top: 0; left: 50%; transform: translateX(-50%); }
.trick-card-3 { right: 0; top: 50%; transform: translateY(-50%); }
.trick-slot { width: var(--card-width); height: var(--card-height); border: 1.5px dashed var(--line); border-radius: var(--r-md); }
.trick-lead-badge { position: absolute; top: calc(var(--card-height) * -0.03 - 0.0625rem); left: 50%; z-index: 3; padding: 0.05em 0.5em; border-radius: var(--r-xs); background: var(--ink-0); color: var(--team-ew); font-size: max(0.75rem, 0.7em); font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; transform: translate(-50%, -100%); }
.trick-lead-badge { white-space: nowrap; }
.trick-card:has(> .trick-lead-badge) { z-index: 4; }   /* the tab is wider than its card on a phone: the neighbours do not cut it ("TAKES IT" read "TAKES I") */
.trick-lead-badge.is-takes { background: var(--gold-strong); color: var(--ink-on-gold); }
@media (max-width: 599.98px), (max-height: 500px) { .trick-lead-badge { padding: 0 0.3em; letter-spacing: 0.02em; line-height: 1; } }   /* review round 2 m1: on a phone the tab stands above its card and is no wider than the card and the gaps beside it, so it covers no neighbour's face (12 px tall: over the 8 px gap above the lowest card it takes 4 px of the card above) */
.trick-card.is-winner .card { box-shadow: 0 0 0 2px var(--gold-strong), 0 0 1.125rem var(--gold-line); }
.player-zone.is-trick-winner .seat-plate { border-color: var(--gold-strong); box-shadow: 0 0 0 1px var(--gold-strong), 0 0 1.375rem var(--gold-line); }
.st-brief { display: none; }
@media (max-width: 599.98px), (max-height: 500px) { .st-full { display: none; } .st-brief { display: inline; } }
.st-cap-full { display: none; }
@container stage (min-width: 600px) and (min-height: 421px) {
  .trick-status.is-caption { display: flex; align-items: center; justify-content: center; align-self: center; padding: 0 0.9em; border: 1px solid var(--gold-line); border-radius: var(--r-full); background: var(--ink-0); color: var(--gold-strong); font-weight: 700; line-height: 1.15; }
  .st-cap-full { display: inline; }
  .st-cap-brief { display: none; }
}
.trick-status { min-height: 1.3em; color: var(--text); font-size: max(0.9rem, 12px); text-align: center; }
.trick-status.is-you { color: var(--gold-strong); font-weight: 700; }
@media (min-width: 600px) { .center-zone > .trick-status { max-width: calc(3.4 * var(--trick-cw)); text-wrap: balance; } }   /* the line wraps under the cross and does not widen the middle column */
/* The line always has two rows of room, so that "Your turn. Click a card, then click it again to play." (two rows under the cross) and "Dan's turn" (one) do not move the cross up and down between plays
   (web-motion: the felt holds still). The phone on its side has its own line, beside the cross. */
@container stage (min-width: 601px) and (min-height: 421px) { .center-zone > .trick-status { min-height: 2.4em; } }
.running-score { display: flex; justify-content: center; gap: var(--sp-5); font-size: max(0.85rem, 12px); font-weight: 700; }
.trick-history { grid-column: 1 / -1; display: flex; flex-direction: column; max-height: 10rem; overflow: hidden; border: 1px solid var(--hair); border-radius: var(--r-lg); background: var(--plate-fill); }
.trick-history-title { min-height: calc(44 * var(--px)); padding: var(--sp-2) var(--sp-3); border: 0; background: none; color: var(--text-dim); font: var(--t-eyebrow); letter-spacing: 0.06em; text-align: left; text-transform: uppercase; cursor: pointer; }
.trick-history-entries { overflow-y: auto; padding: 0 var(--sp-2) var(--sp-2); }
.trick-history-entry { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-1); border-top: 1px solid var(--hair); font-size: max(0.75rem, 12px); }
.trick-history-entry .trick-number { min-width: 1.125rem; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.trick-history-entry .trick-cards { display: flex; gap: 0.1875rem; }
.trick-history-winner { max-width: 4rem; margin-left: auto; overflow: hidden; font-size: max(0.75rem, 12px); text-overflow: ellipsis; white-space: nowrap; }
.trick-history-entry.team-ns .trick-history-winner { color: var(--team-ns); }
.trick-history-entry.team-ew .trick-history-winner { color: var(--team-ew); }
.trick-hist-card, .mini-card { display: inline-block; min-width: 1.5rem; padding: 0 var(--sp-1); border-radius: var(--r-xs); background: var(--paper); color: var(--suit-black); font-size: max(0.75rem, 12px); font-weight: 800; line-height: 1.45; text-align: center; white-space: nowrap; box-shadow: var(--e-1); }
.trick-hist-card.red, .mini-card.red { color: var(--suit-red); }
.trick-hist-card.winner { box-shadow: 0 0 0 2px var(--gold); }
body.four-color-deck .mini-card.suit-C, body.four-color-deck .trick-hist-card.suit-C { color: #1b7a2b; }
body.four-color-deck .mini-card.suit-D, body.four-color-deck .trick-hist-card.suit-D { color: #1565c0; }
/* The tricks needed and the tricks played stand in the felt's lower corners while the rails are empty (D2 gives them their place in the rails); a raised card and its Play button rise over the lower left for a moment and stay above them. */
@media (min-width: 1024px) { .trick-history { position: absolute; right: calc(18 * var(--u)); bottom: calc(18 * var(--u)); z-index: 2; width: 13.5rem; max-height: 42%; } .center-zone > .bid-progress { position: absolute; left: calc(18 * var(--u)); bottom: calc(10 * var(--u)); z-index: 2; width: min(21.25rem, 30%); } }
/* Larger Text (7.12): the two corner panels leave the felt's corners (they are sized in rem, and at a 28 px root they covered a side plate and your plate). The tricks needed are the one line the phone uses, in the center's scroll; the tricks played are a row of the felt's grid, under your plate. */
@media (min-width: 1024px) {
  body.large-text .center-zone > .bid-progress { display: none; }
  body.large-text .center-zone > .bid-progress-line { display: block; }
  body.large-text .trick-history { position: static; right: auto; bottom: auto; width: auto; max-height: 5.25rem; }
}
.trick-animation-overlay, .card-flight-layer { position: fixed; inset: 0; z-index: var(--z-rail); pointer-events: none; }

/* The key-hint row (7.4, 12.2, render/hand-dock.js): a mouse only, and only where the stage is 700 px tall or more and not on a short laptop. It stands in the dock's bottom padding (.35 of a card),
   under the middle of the fan, so it adds no height to the dock: the hand, the felt, and the 11.5 to 28 px from your plate to your cards (web-build24-layout) are what they were. */
.hand-hint { display: none; position: absolute; inset: auto 0 var(--safe-b, 0px); align-items: flex-end; justify-content: center; height: calc(var(--hand-cw) * 0.35); margin: 0; padding-bottom: calc(var(--sp-1) * 1.5); color: var(--text); font-size: max(0.8125rem, 12px); line-height: 1.2; text-align: center; pointer-events: none; }   /* the text sits on the dock's lower edge: the fan's tips (at 1440 x 900 the cards end at 878) keep 4 px or more of clear felt above it */   /* --text, not --text-dim: the lightest stop of the felt is 3.95:1 for the dim text (AC-04) */
@media (hover: hover) and (pointer: fine) { @container stage (min-height: 700px) { .hand-hint { display: flex; } } }
@media (min-width: 1024px) and (max-height: 800px) { .hand-hint { display: none; } }
@media (max-width: 599.98px) { .hand-hint { display: none; } }   /* a narrow window with a mouse: the hand covers the row, only "shortcuts." showed (fix round 3 L2-6) */
body.large-text .hand-hint { display: none; }   /* 7.12: at a 28 px root the line is taller than the dock's bottom padding and would sit over the cards */
body.large-text :is(.bar__table, .bar__text) { display: none; }   /* review round 2 M3: the table's line and its code button (it stood 62 px under the Menu and the score pills in a zero-width box), and Rules and Settings (both are in the Menu; Meld Chart was cut by the window's edge at 1280 wide) */
body.large-text .bar__btn-label { display: none; }   /* review round 2 M3: Meld Chart and Chat are icons at this text size (the row ran 111 px past a 1280 window) */
@media (min-width: 600px) { body.large-text .bar { flex-wrap: wrap; } body.large-text .score-pills { flex: 1 1 100%; order: 3; } }   /* and under 1180 wide the scores take a row of their own under the Menu and the buttons (they ran 367 px past a 1024 window); the next two blocks put the one-row bar back */
@media (min-width: 1180px) { body.large-text .bar { flex-wrap: nowrap; } body.large-text .score-pills { flex: none; order: 0; } }
@media (max-height: 500px) and (orientation: landscape) { body.large-text .bar { flex-wrap: nowrap; } body.large-text .score-pills { flex: none; order: 0; } }   /* a window 500 px tall or less keeps the phone's one-row bar (the same values as the phone-on-its-side block) */
body.large-text .continue-btn kbd { display: none; }   /* the key chip is for a keyboard; at this size it wrapped "Deal Next Hand" onto a second line (264 x 91 at 320 x 568, root 28) */
body.large-text .result__foot .review-links { flex-wrap: wrap; }   /* the three review buttons were a nowrap row 339 px wide in a 320 px foot, which pushed Deal Next Hand 37 px right, past the window's edge (AC-07 at root 28) */
body.large-text .result__foot .continue-btn { align-self: stretch; }
body.large-text .bar__mid .hand-context { display: none; }   /* (the contract is in the center's tricks-needed line and the bid panel; a chip cut at the bar's edge says nothing) */
/* ---- 7.4 the hand dock: the stage's last row; its card from the stage's own box, in an arc of individual properties (spike S1) ---- */
#hand-slot { --card-width: var(--hand-cw); --card-height: calc(var(--hand-cw) * 108 / 76); }
.stage .hand-area { padding: calc(var(--hand-cw) * 0.1) var(--sp-5) max(calc(var(--hand-cw) * 0.35), var(--safe-b)); background: linear-gradient(to top, color-mix(in srgb, var(--ink-0) 38%, transparent), color-mix(in srgb, var(--ink-0) 12%, transparent) 60%, transparent); overflow: visible; }
.stage #hand-slot .hand { touch-action: none; }
.for-touch { display: none; }   /* 13.2: a mouse reads "click", a touch screen reads "tap" */
@media (any-pointer: coarse) { .for-mouse { display: none; } .for-touch { display: inline; } }
body.is-offline .stage .hand-area .hand, .stage:has(.game-table.phase-dealing) .hand-area .hand { opacity: 0.55; pointer-events: none; }   /* 14: connection lost, and while the cards are being dealt */
/* 14: the notice bar (frame.css, shown by app.js) stands OVER the table's bar, the width of the window and the bar's own height (rails.js writes --rail-top: the bar's bottom edge,
   whatever its height). It used to sit under the bar and pad the stage by 2.5 rem so the felt started below it; that padding shrank the felt, and with a trick on it the cross came
   out narrower than a hand card (AC-21 and AC-23 at 1280 x 600, fix round 2 M4). The bar is not used while the link is down (the hand is dimmed and every card says it cannot be used), so
   covering it for those seconds takes nothing away, and the felt keeps its size. */
body.at-table .reconnecting-banner { animation: none; }   /* (the whole bar pulsing let the table's bar show through it: the words and the icon pulse instead, the bar stays solid) */
body.at-table .reconnecting-banner > * { animation: pulse 1s ease-in-out infinite alternate; }
body.at-table .reconnecting-banner, body.at-table .error-banner { top: var(--moved-banner-h, 0px); left: 0; box-sizing: border-box; min-height: max(2.5rem, calc(var(--rail-top, calc(var(--moved-banner-h, 0px) + 2.5rem)) - var(--moved-banner-h, 0px))); }
.stage .hand, .stage .hand-row { --vis: min(0.62, calc((var(--span) - 1) / max(calc(var(--n, 20) - 1), 1))); --slot-min: calc(var(--card-width) * 0.4); }
.stage .hand.hand-two-rows { --card-width: var(--hand-cw); --card-height: calc(var(--hand-cw) * 108 / 76); }
.stage .card-slot:not(:last-child) { flex: 0 1 calc(var(--card-width) * var(--vis)); min-width: var(--slot-min); }
.stage .hand-two-rows .hand-row + .hand-row { margin-top: calc(var(--card-height) * -0.42); }
.stage .hand .card { transform-origin: 50% 150%; rotate: calc(var(--d, 0) * 0.55deg); top: calc(var(--card-width) * 0.001 * var(--d, 0) * var(--d, 0)); }
.stage .card-slot { pointer-events: none; }
.stage .card-slot > .card, .stage .card-slot > .hand-play-btn, .stage .hand .card.disabled { pointer-events: auto; }
.stage .hand .card.disabled { filter: brightness(0.72); }
.stage .hand-area .hand .card.selected, .stage .hand-area .hand .card.selectable.selected { transform: translateY(-22px); }
@media (hover: hover) and (pointer: fine) { .stage .hand-area .hand .card.playable:hover { transform: translateY(-16%); filter: var(--glow-card); z-index: 5; } }
.hand .card, .trick-area .card { --ix: calc(var(--card-width) / 76); }
.suit-gap { flex: 0 1 var(--sp-3); min-width: var(--sp-2); }
.suit-gap.same-color { flex: 0 1 var(--sp-6); min-width: var(--sp-4); }
.hand .card.holdable { cursor: pointer; touch-action: manipulation; }
.hand .card.held:not(.selected) { transform: translateY(-9px); outline: 1.5px solid var(--gold); outline-offset: -1.5px; transition: transform 0.15s var(--ease-out), outline-color 0.15s; }
.hand .card.is-flicking, .hand .card.is-launched { z-index: calc(var(--z-drawer) + 5); }
.hand .card.is-armed { scale: 1.06; box-shadow: 0 0 0 2px var(--gold), 0 0 18px var(--gold-line); }
.hand .card.is-refused { outline: 3px solid var(--bad); outline-offset: -1px; }
@media (prefers-reduced-motion: reduce) { .hand .card.is-armed { scale: none; } .hand .card.held { transition: none !important; } }
/* Meld review (build 25, render/hand-dock.js): the hand slides down behind a handle (a 32 px peek), so the meld gets the room. */
.hand-area.is-docked .hand-handle { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.1875rem; width: 100%; min-height: calc(36 * var(--px)); margin: 0; padding: 0; border: 0; background: none; color: var(--text); font: var(--t-caption); touch-action: none; cursor: pointer; }
.hand-area.is-docked .hand-handle::before { content: ""; position: absolute; inset: calc(var(--sp-1) * -1) 0; }
.hand-handle-pill { width: 2.5rem; height: 0.3125rem; border-radius: var(--r-xs); background: var(--white-30); }
.hand-area.is-docked .hand-handle:focus-visible { border-radius: var(--r-md); }
.hand-area.is-docked .hand { max-height: 25rem; }
.hand-area.is-docked.is-down .hand { max-height: 32px; overflow: hidden; pointer-events: none; }
@media (prefers-reduced-motion: no-preference) { .hand-area.is-docked .hand { transition: max-height 0.28s ease; } }
.hand-play-btn { position: absolute; left: calc(var(--card-width) / 2); bottom: calc(100% + 30 * var(--px)); z-index: var(--z-drawer); min-width: 4.5rem; min-height: calc(36 * var(--px)); padding: var(--sp-1) var(--sp-4); border: 0; border-radius: var(--r-full); background: var(--gold); box-shadow: var(--e-1); color: var(--ink-on-gold); font-size: max(0.95rem, 12px); font-weight: 800; white-space: nowrap; transform: translateX(-50%); cursor: pointer; }
.card-slot:first-child .hand-play-btn { left: 0; transform: none; }
.card-slot:last-child .hand-play-btn { left: auto; right: 0; transform: none; }
@media (any-pointer: coarse) { .hand-play-btn { min-height: calc(44 * var(--px)); } }


/* ---- the phone, held upright or on its side: the old table's geometry, to the pixel (7.8) ---- */
@media (max-width: 599.98px), (max-height: 500px) {
  .bar { flex-wrap: wrap; gap: calc(6 * var(--px)); padding: calc(6 * var(--px)) calc(8 * var(--px)); padding-top: calc(6 * var(--px) + env(safe-area-inset-top, 0px)); min-height: 0; }
  .bar__btn-label { display: none; }
  .bar .btn, .bar .menu-btn, .bar__code { min-height: calc(44 * var(--px)); }
  .bar__btn:not(.toolbar-undo) { width: 44px; min-width: 44px; padding: 0; }
  .bar .btn.menu-btn { width: auto; }
  .menu-btn__mark { display: none; }
  .score-pills { flex: 1 1 9rem; flex-wrap: wrap; order: 1; }   /* review round 2 M2: a pill is as wide as its label, its score, and its DOWNS marker need; two that do not fit one row wrap, never cut "Them" to "T" */
  .score-pill { flex: 1 1 0; column-gap: calc(4 * var(--px)); padding: calc(4 * var(--px)) calc(6 * var(--px)) calc(5 * var(--px)); }   /* "Them" and "-100" fit side by side at 360 wide */
  .pill-names { font-size: max(0.75rem, 12px); }
  .pill-score { font-size: max(1rem, 12px); }
  .pill-downs-label { display: none; }
  .score-pill.is-seated { flex: 1 1 auto; min-width: max-content; }   /* "Us" and "Them" are whole; a spectator's long team names still end in an ellipsis */
  .score-pill:has(.pill-downs) { grid-template-rows: auto auto; }   /* the DOWNS marker stands under the name, not beside the score (it left "Them" 9 px: "T"): the pill is as wide as the name and the score */
  .score-pill:has(.pill-downs):not(.no-target) { grid-template-rows: auto auto 0.25rem; }
  .score-pill:has(.pill-downs) .pill-end { display: contents; }
  .score-pill:has(.pill-downs) .pill-downs { grid-column: 1; grid-row: 2; justify-self: start; }
  .score-pill:has(.pill-downs) .pill-score { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .bar__mid { order: 3; flex: 1 1 100%; justify-content: flex-start; }
  .hand-context { display: flex; }
  .center-zone { overflow: hidden; }
  .ctx-chip { padding: 0 var(--sp-2); font-size: max(0.75rem, 12px); }
  .top-actions { order: 2; }
  .top-menu { left: 0; right: 0; top: 100%; max-height: calc(100dvh - 100% - 128 * var(--px)); border-radius: 0 0 var(--r-xl) var(--r-xl); }
  /* Fix round 1 M5: all rows of the Menu showed at 393 x 852 only after scrolling (713 px of rows in 632). The two one-line notes go on a phone (the leave question says the same words), tighter group gaps bring the rest to 625 px, so all eleven rows show at 393 x 852; a shorter phone scrolls, and a row cut by the edge is the cue (a background gradient for a scroll shadow made AC-04 read the felt as the backdrop). */
  .top-menu .menu-note { display: none; }
  .top-menu { padding-block: var(--sp-1); }
  .top-menu .menu__group + .menu__group { margin-top: var(--sp-1); }
  .game-table { grid-template-columns: clamp(66px, var(--side-name-w, 0px), 84px) minmax(0, 1fr) clamp(66px, var(--side-name-w, 0px), 84px); gap: calc(6 * var(--px)); padding: calc(10 * var(--px)) calc(6 * var(--px)) calc(2 * var(--px)); margin: calc(6 * var(--px)) auto 0; width: calc(100% - 8px); max-width: none; font-size: inherit; }
  .player-zone { gap: calc(6 * var(--px)); }
  .player-left, .player-right { justify-self: stretch; }   /* the zone fills its column (66 px), as before; on its side the seats are placed below */
  .player-bottom .player-name { min-width: 2.6em; overflow: hidden; }
  .center-zone { gap: calc(12 * var(--px)); }
  .trick-history { margin-top: calc(4 * var(--px)); }
  .bid-progress-sub { gap: calc(6 * var(--px)); }   /* "Meld 30 + tricks 5 = 35" and its chip fit on one row at 12 px type */
  .seat-plate { gap: calc(8 * var(--px)); padding: calc(6 * var(--px)) calc(10 * var(--px)) calc(6 * var(--px)) calc(6 * var(--px)); box-shadow: none; }
  .seat-avatar { width: 28px; height: 28px; font-size: max(0.85rem, 12px); }
  .player-zone .player-name { font-size: max(0.85rem, 12px); }
  .player-zone .trump-symbol { font-size: max(1.2rem, 12px); }
  .seat-chip { padding: calc(1 * var(--px)) calc(4 * var(--px)); font-size: max(0.75rem, 12px); line-height: 1; }
  .seat-status { padding: calc(3 * var(--px)) calc(8 * var(--px)); font-size: max(0.75rem, 12px); }
  .player-bottom .seat-plate { gap: calc(6 * var(--px)); }
  .player-left .seat-plate, .player-right .seat-plate { display: flex; flex-direction: column; gap: calc(4 * var(--px)); padding: calc(6 * var(--px)) calc(4 * var(--px)); width: clamp(64px, max(4em, var(--side-name-w, 0px)), clamp(84px, 4em, 104px)); text-align: center; }
  .player-left .player-name-row, .player-right .player-name-row { flex-wrap: wrap; justify-content: center; row-gap: 0; max-width: 100%; }
  .player-left .player-name-row .player-name, .player-right .player-name-row .player-name { min-width: 0; }
  .player-left .seat-info, .player-right .seat-info { align-items: center; }
  .player-left .player-name, .player-right .player-name { max-width: 100%; line-height: 1.15; white-space: normal; overflow-wrap: anywhere; hyphens: none; }
  .player-left .seat-status, .player-right .seat-status { max-width: 100%; margin: 0; padding: calc(2 * var(--px)) calc(3 * var(--px)); white-space: normal; text-align: center; }
  /* The word is wider than a 66 px plate (it ran past the border, fix round 3 m4): the side seats of a phone say it with three dots; the text stays for a screen reader. */
  .player-left .seat-status.is-thinking, .player-right .seat-status.is-thinking { position: relative; min-width: 3em; min-height: 1.6em; overflow: hidden; text-indent: 120%; white-space: nowrap; }   /* (the word is pushed out of the box, not made transparent: AC-04 reads a transparent word as 1:1) */
  .player-left .seat-status.is-thinking::after, .player-right .seat-status.is-thinking::after { content: "\2022 \2022 \2022"; position: absolute; inset: 0; display: grid; place-items: center; text-indent: 0; color: var(--gold-strong); }
  .player-left .seat-tags, .player-right .seat-tags { justify-content: center; }
  .player-left .btn-sub-bot, .player-right .btn-sub-bot { max-width: 100%; padding: calc(4 * var(--px)); line-height: 1.15; text-align: center; white-space: normal; }
  .center-zone > .trick-area { --cw0: 58px; --ch0: 84px; --card-height: calc(var(--ch0) * var(--fit, 1)); width: calc((var(--cw0) * 3 + 12 * var(--px)) * var(--fit, 1)); height: calc((var(--cw0) * 216 / 76 + 36 * var(--px)) * var(--fit, 1)); }
  .trick-history { max-height: 7.5rem; }
  .suit-gap.same-color { flex-basis: var(--sp-2); min-width: 0.375rem; }   /* the gaps between suits are small on a phone: 20 cards at 28 percent each need the width (AC-24) */
  .suit-gap { flex-basis: 4px; min-width: 2px; }
}
/* A phone held upright (7.3, build 31, ISSUES row 132, the app's TableMetrics.trickCardWidth): the biggest card whose cross, three cards and two gaps of 0.2 of a card (3.4 cards), fills the
   column the side seats leave: the stage less the two side columns (66 to 84 px, as fitSideNames sets them) and 32 px of padding, gaps, and margin. 70 px on an iPhone 17 Pro (402 wide), 81 on a Pro Max
   (440). The second term keeps the cross, its line, and the bars inside a shorter window; it never goes under the 46 px a short phone had (the two container rules after this one, for a stage under 611 and 511 px tall, set 46 and 40). */
@media (max-width: 599.98px) {
  .center-zone { padding-inline: 0; margin-inline: calc(-1 * 0.125rem); }   /* the cross is as wide as the column; the zone reaches 2 px under each side column's gutter so the 71 and 82 px cards (cross up to 3 px past the grid's column) sit whole inside it */
  .center-zone > .trick-area {
    --cw0: max(46px, min(88px, calc((100cqw - 2 * clamp(66px, var(--side-name-w, 0px), 84px) - 29px) / 3.4), calc((100dvh - 557px) / 2.842)));
    --ch0: calc(var(--cw0) * 108 / 76);
    width: calc(var(--cw0) * 3.4 * var(--fit, 1));
  }
}
/* Short phones (an SE and smaller): the window less the bar and the hand, as a container query on the stage. */
@container stage (max-width: 599.98px) and (max-height: 610px) {
  .center-zone > .trick-area { --cw0: 46px; --ch0: 66px; height: calc((var(--cw0) * 216 / 76 + 8 * var(--px)) * var(--fit, 1)); }   /* two cards and 8 px between them (36 on a taller phone): the card keeps its 46 px (7.3) */
  .game-table { padding: calc(6 * var(--px)) calc(4 * var(--px)); row-gap: calc(4 * var(--px)); }
  .center-zone { gap: calc(3 * var(--px)); overflow: visible; clip-path: inset(0 -90px); }   /* the tricks-needed bars are as wide as the felt, under the side plates (below), so they read on one line a row: the zone clips top and bottom only */
  .center-zone > .bid-progress { width: calc(100% + 2 * (clamp(66px, var(--side-name-w, 0px), 84px) + 2 * var(--px))); }
}
@container stage (max-width: 599.98px) and (max-height: 510px) {
  .game-table { padding: calc(4 * var(--px)); row-gap: calc(2 * var(--px)); }
  .seat-plate { padding: calc(4 * var(--px)) calc(8 * var(--px)) calc(4 * var(--px)) calc(4 * var(--px)); }
  .player-left .seat-plate, .player-right .seat-plate { padding: calc(4 * var(--px)); }
  .seat-avatar { width: 24px; height: 24px; font-size: max(0.75rem, 12px); }
  .trick-history { max-height: 2.75rem; }
}

/* The hand on a phone held upright: one row of cards 0.28 of a card apart at least, or two rows (the app's option, 7.4). */
@media (max-width: 599.98px) {
  body.at-table .stage { --span: 6.85; --lo: calc(2.5 * var(--r)); --hand-cw: clamp(var(--lo), min(calc(100cqw / (var(--span) + 0.38)), calc(100cqh * 0.135)), calc(11 * var(--r))); }   /* the row has .19 of a card of padding each side, so the card is the width over (span + .38): 44 x 63 at 320, 50 at 360, 55 at 393 (7.3), and the fan's end card keeps its 8 to 12 px of room for the tilt */   /* 6.7 plus the three suit gaps, which --span does not count: 20 cards at 320 wide showed 27.6 percent each, 6.85 shows 28 or more (AC-24) */
  body.at-table .stage:has(.hand-two-rows) { --span: 6.2; }
  .stage .hand, .stage .hand-row { --slot-min: calc(var(--card-width) * 0.28); }
  .stage .hand-area { padding-inline: calc(var(--hand-cw) * 0.19); }   /* 12.4 asks 63 px of height for a hand card */
  .stage .hand .card { rotate: calc(var(--d, 0) * 0.42deg); }   /* 4 degrees at the ends, not 5: a raised end card stays inside the dock's 12 px at 440 wide (10.7 px) */
  .trick-status.is-you { visibility: hidden; height: 1.3em; overflow: hidden; }   /* upright only: on its side the line shows, as before */
}

/* The Classic deck's phone index divides by 58, the Alternate's and the Large Print's by 76 (deck-style.js sets html[data-deck]; build 32 renamed jumbo to alternate); the deck's own phone query is this one. */
@media (max-width: 599.98px), (max-height: 500px) { html[data-deck="classic"] .hand .card, html[data-deck="classic"] .trick-area .card { --ix: calc(var(--card-width) / 58); } }

/* A phone on its side (build 24, as the app's TableLayout "landscape"): one bar row, the partner's one-line plate on top, the opponents level with the trick and brought in to it,
   your one-line plate just over one fanned row of cards. The side seats take the felt's full height, capped to it (--side-cap), so no font can take one to the hand or the bar. */
@media (max-height: 500px) and (orientation: landscape) {
  .bar { flex-wrap: nowrap; padding: calc(3 * var(--px)) calc(8 * var(--px)); padding-top: calc(3 * var(--px) + env(safe-area-inset-top, 0px)); }
  .score-pills { flex: none; }   /* review round 2 M3: the pills keep their own width (120 px each); the middle gives way, not the pills under it */
  .score-pill { flex: 0 1 auto; min-width: 120px; }
  .bar__mid { order: 2; flex: 1 1 auto; justify-content: flex-end; }
  @container bar (max-width: 599.98px) { .hand-context { display: none; } }   /* review round 2 M3: a chip is whole or not drawn; the bar of a zoomed window (427 to 599 wide) has no room for the context chips (the contract is in the center's line) */
  @container bar (max-width: 479.98px) { .toolbar-guide { display: none; } }   /* and at 300 percent zoom the Meld Chart (in the Menu) gives way to the scores */
  .game-table {
    grid-template-areas: ". . top . ." ". left center right ." "bottom bottom bottom bottom bottom";
    grid-template-columns: minmax(0, 1fr) auto minmax(0, max-content) auto minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto;
    column-gap: calc(14 * var(--px)); row-gap: calc(2 * var(--px)); padding: calc(4 * var(--px)) calc(6 * var(--px)) calc(2 * var(--px)); margin: calc(2 * var(--px)) auto calc(4 * var(--px));
    container: felt / size;   /* the felt's height is the grid row's (definite), so the cap below is a length the seats cannot push past: a percentage of a row that the seats themselves stretch caps nothing */
    --side-cap: calc(100cqh - 12px);   /* the seats are capped to the felt: its height less 12 px (it was the window less the bar, the hand, and 12 px) */
  }
  .player-left { justify-self: end; }
  .player-right { justify-self: start; }
  .player-left, .player-right { grid-row: 1 / -1; min-height: 0; max-height: var(--side-cap); }
  .player-left .seat-plate, .player-right .seat-plate { flex-shrink: 0; min-height: 0; max-height: var(--side-cap); }
  .player-left .seat-info, .player-right .seat-info { min-height: 0; overflow: hidden; }
  .player-left .seat-status, .player-right .seat-status { flex-shrink: 0; }
  .player-left .peek-hand, .player-right .peek-hand, .player-left .spec-hand, .player-right .spec-hand { min-height: 0; overflow: hidden; }
  /* A computer is playing your seat: the seats take only the rows above your zone, and the plate gives way inside the cap (the avatar first). */
  .game-table:where(:has(.player-bottom .standin-banner, .player-bottom .btn-sub-bot)) :is(.player-left, .player-right) { grid-row: 1 / 3; max-height: calc(100% - 6px); }
  .game-table:where(:has(.player-bottom .standin-banner, .player-bottom .btn-sub-bot)) :is(.player-left, .player-right) .seat-plate { flex-shrink: 1; max-height: none; }
  .game-table:where(:has(.player-bottom .standin-banner, .player-bottom .btn-sub-bot)) :is(.player-left, .player-right) .seat-avatar { flex-shrink: 20; min-height: 0; overflow: hidden; }
  /* The partner's plate stops 6 px inside the middle column and cannot widen it (contain): a long name shortens first. */
  .player-top { contain: inline-size; justify-self: stretch; margin-inline: calc(6 * var(--px)); align-items: center; min-width: 0; }
  .center-zone { min-width: 0; max-width: min(600px, calc(100vw - 200px)); }
  .player-top .seat-plate, .player-bottom .seat-plate { padding: calc(2 * var(--px)) calc(8 * var(--px)) calc(2 * var(--px)) calc(2 * var(--px)); }
  @media (any-pointer: coarse) { @container stage (min-width: 750px) { .player-bottom .seat-plate { min-height: calc(44 * var(--px)); } } }   /* your plate is a touch target (AC-03; it was 43.2 at 852 x 393). Not on the narrower phones on their side (an SE is 568 x 320, an 8 is 667 x 375): web-build24-layout keeps their 200 percent text clear of the seats with the plate as it was */
  .player-bottom:has(.standin-banner) { gap: calc(2 * var(--px)); }
  .standin-banner { flex-direction: row; flex-wrap: nowrap; gap: var(--sp-2); max-width: 100%; padding: calc(4 * var(--px)) var(--sp-4); }
  .standin-banner .standin-sub { min-width: 0; overflow: hidden; font-size: max(0.75rem, 12px); text-overflow: ellipsis; white-space: nowrap; }
  .standin-banner .standin-main { flex-shrink: 0; font-size: max(1rem, 12px); white-space: nowrap; }
  .player-bottom:has(.standin-banner) > .btn-sub-bot { display: none; }
  .player-top .seat-avatar, .player-bottom .seat-avatar { width: 24px; height: 24px; }
  .stage .hand-area { padding-top: calc(2 * var(--px)); padding-bottom: calc(2 * var(--px) + env(safe-area-inset-bottom, 0px)); }
  .trick-history { grid-row: 3; grid-column: 4 / 6; justify-self: end; align-self: end; width: 12rem; max-height: 3.75rem; margin: 0 calc(6 * var(--px)) 0 0; }   /* in the plate's row, at the right, not a row of its own: the cross keeps that room (7.8, the 49 px card) */
  .center-zone > .trick-area { --cw0: clamp(44px, 12.5vh, 58px); --card-height: calc(var(--card-width) * 108 / 76); width: calc((var(--cw0) * 3 + 12 * var(--px)) * var(--fit, 1)); height: calc((var(--cw0) * 216 / 76 + 6 * var(--px)) * var(--fit, 1)); }   /* two cards and 6 px between them (it was 36): the cross is the card's 49 px, not shrunk to 29 */   /* (a phone 599 wide or less on its side: the old cross, not the upright one's 3.4 cards) */
  .center-zone { padding-inline: var(--sp-1); margin-inline: 0; }
  .center-zone { padding-top: 0; }
  .center-zone:has(> .trick-area) { flex-direction: row; align-items: safe center; justify-content: center; gap: calc(10 * var(--px) * var(--fit, 1)); }
  .center-zone:has(> .trick-area) > .trick-status { max-width: min(calc(160 * var(--px) * var(--fit, 1)), 108px); font-size: max(0.75rem, calc(0.9rem * var(--fit, 1))); text-align: start; }   /* the old center was zoomed by the fit: the line took its width, down to the 12 px floor; the card is no longer shrunk to a 0.6 fit (7.8), so the lines keep the widths the zoomed center gave them (web-bar-live: 116 and 165) and wrap */
  .center-zone.is-large-text { font-size: max(12px, min(1rem, 4.9vh)); }
  /* The hand on its side is the old one: the 58 px card of the phone, flat, in the deck's own slots. */
  #hand-slot { --card-width: var(--card-w); --card-height: var(--card-h); }
  .stage .hand.hand-two-rows { --card-width: calc(var(--card-w) * 1.2); --card-height: calc(var(--card-h) * 1.2); }
  .stage .hand, .stage .hand-row { --slot-min: 15px; }
  .stage .card-slot:not(:last-child) { flex: 0 1 calc(var(--card-width) + 4px); min-width: var(--slot-min); }
  .stage .hand .card { rotate: none; top: 0; transform-origin: 50% 50%; }
  .stage .hand-area { padding-inline: calc(6 * var(--px)); border-top: 1px solid var(--hair); background: linear-gradient(to top, var(--scrim), var(--track-dark)); }
}

/* Larger Text on a laptop window zoomed to 200 percent (640 x 360), tricking (review R2; a phone on its side (touch, no hover) keeps the old geometry, 7.8: web-build24-layout). At a 28 px root the felt is 213 px tall: the tricks-played bar (a row of the grid under the
   middle) stood over your plate, the status line was cut, the lead tab was cut at the zone's edge, and the cross was 134 px in an 81 px zone. The bar is dropped (the hands played are in the Menu's history, and the
   rail on a wider window), the lines stand under the cross in the center's own scroll, and the felt scrolls inside the stage above the hand, so no part covers another. */
@media (max-height: 500px) and (orientation: landscape) { @media (hover: hover) and (pointer: fine) {
  body.large-text .trick-history { display: none; }
  body.large-text .center-zone:has(> .trick-area) { flex-direction: column; align-items: center; justify-content: flex-start; gap: var(--sp-1); padding-inline: var(--sp-5); }
  body.large-text .center-zone:has(> .trick-area) > :is(.trick-status, .bid-progress-line) { flex: none; width: 100%; min-width: 0; max-width: 100%; text-align: center; font-size: max(12px, 0.9rem); }
} }
/* A stage under 320 px tall (640 x 360 at 200 percent: 302): the two lines are dropped too, and the felt scrolls inside the stage above the hand (the cross is 134 px and the plates 112 in 213), so the cross is whole when scrolled and the lead tab is inside it. */
@container stage (max-height: 320px) {
  @media (max-height: 500px) and (orientation: landscape) { @media (hover: hover) and (pointer: fine) {
    body.large-text .center-zone:has(> .trick-area) > :is(.trick-status, .bid-progress-line) { display: none; }
    body.large-text .game-table { overflow-y: auto; overscroll-behavior: contain; grid-template-rows: max-content max-content max-content; }
    body.large-text .game-table .center-zone { overflow: visible; }
    body.large-text .game-table .center-zone > .trick-area { --fit: 0.75; }   /* the cross at three quarters (34 px cards) and your plate on one line (no dealer tag) so the felt holds without a scroll at 640 x 360 */
    body.large-text .game-table .player-bottom .seat-tags { display: none; }
  } }
}
@container stage (max-height: 320px) {
  @media (max-height: 500px) and (orientation: landscape) { @media (hover: hover) and (pointer: fine) { .game-table .trick-lead-badge { left: 0; transform: translateY(-100%); } } }   /* the tab starts at its card's left edge (centered, it stood 5 px past the felt's edge at 640 x 360: review R2) */
}
/* A stage under 260 px tall (a phone's width at 300 percent: 427 x 240 gives 180, 91 of it above the hand): no row can hold its plate, so the felt scrolls inside the stage above the hand and the three bars give way, whatever the text size. Nothing stands over the hand or under a plate. */
@container stage (max-height: 260px) {
  @media (max-height: 500px) and (orientation: landscape) { @media (hover: hover) and (pointer: fine) {
    .trick-history, .center-zone:has(> .trick-area) > :is(.trick-status, .bid-progress-line) { display: none; }
    .game-table { overflow-y: auto; overscroll-behavior: contain; grid-template-rows: max-content max-content max-content; }
    .game-table .center-zone { overflow: visible; min-width: 9.5rem; }   /* (the partner's plate is as wide as the middle column: the bars gone, it would be the cross's 87 px) */
    .game-table .center-zone > .trick-area { --fit: 0.6; }
  } }
}

/* Review R5: a stage under 260 px tall on ANY pointer (a phone on its side at 200 percent zoom is 426 x 196 css px, an iPhone SE at 200 percent is 160 x 284; the rule above is for a mouse on a short laptop window): the felt had 4 px between the plates, and Concede and Confirm Meld were under the stage. The felt of the bidding, trump, and meld screens scrolls inside the stage above the hand, with its panel whole (fix round 1 also measured the Pass and Bid and the trump confirm). */
@container stage (max-height: 260px) {
  .game-table:is(.phase-meld, .phase-bidding, .phase-declaring) { overflow-y: auto; overscroll-behavior: contain; grid-template-rows: max-content max-content max-content; }
  .game-table:is(.phase-meld, .phase-bidding, .phase-declaring) .center-zone { overflow: visible; }
}

/* The focus ring of the table's gold buttons (Bid, Confirm, Deal Next Hand, Play Again, Close History, Play; review R3). Spec 12.3: the page's text color as the outline with the dark inner ring, so the ring is
   light against the felt and the panel (3:1 or better: AC-05) and dark against the gold (ring vs ink 14+:1). The framed pages keep base.css's ring (the button's own text color, with a light band outside). */
body.at-table .table-app .btn.btn-primary:focus-visible, body.at-table .table-app .btn.btn--primary:focus-visible, body.at-table .table-app .hand-play-btn:focus-visible { outline-color: var(--text); box-shadow: 0 0 0 2px var(--ink-0); }
/* A menu row with a one-line note under its name (Save for Later, Quit Without Saving; topbar.js withNote). */
.menu__item .menu__text { display: flex; flex-direction: column; min-width: 0; }
.menu__item:has(.menu-note) { padding-block: var(--sp-2); }
/* Build 32's longer words in the bars ("17 more to keep their 24 meld") must not widen the middle column (and squeeze the side plates) at Larger Text:
   the box takes its width from the column, and its phrases wrap inside it. */
.center-zone > .bid-progress { contain: inline-size; }
