/* Clean-room geometry from visible reference measurements; no external assets. */
html:has(body[data-screen=game]){scrollbar-width:none}
body[data-screen=game] #root{container-type:inline-size}
body[data-screen=game]::before{background:#202722 url('/lodge.jpg') center/cover no-repeat;filter:brightness(.56) saturate(.8)}
body[data-screen=game]::after{content:'';background:linear-gradient(#14191386,#14191329 44%,#111711bb)}
.game{--surface:min(100cqw,177.778svh);--surface-height:calc(var(--surface)*.4725);--felt-seat:calc(var(--surface)*.1814);--seat-height:calc(var(--surface)*.0652);--felt-pocket:calc(var(--surface)*.0412);--card-width:calc(var(--surface)*.079);--layout-top:max(45px,calc((100svh - var(--surface)*.5625)/2));position:relative;width:100%;max-width:none;padding-top:var(--layout-top);padding-inline:0;justify-items:center;align-content:start;gap:0}
.game .table[data-phase]{--board-y:47.8%;width:var(--surface);height:var(--surface-height);min-height:0;margin:0;border:0;border-radius:0;box-shadow:none;background:none;isolation:isolate;overflow:visible}
.game .table[data-phase]::before{inset:7% 4.7% 7%;border:clamp(6px,1.1vw,21px) solid #292b28;border-radius:34% / 50%;background:radial-gradient(ellipse at 50% 40%,#2a9158,#1d783f 78%,#15582f);box-shadow:inset 0 0 14px #10291b,0 6px 16px #1416129c;z-index:-1}
.game .table[data-phase] .board{max-width:none;width:100%;pointer-events:none;transform:translate(-50%,-50%)}
.game .table[data-phase] .table-outcome{pointer-events:auto}
.game .table[data-phase] .pot{position:absolute;top:auto;bottom:calc(100% + var(--surface)*.018);left:50%;transform:translateX(-50%);margin:0;width:calc(var(--surface)*.13);min-height:calc(var(--surface)*.0342);padding:3px 6px}
.game .table[data-phase] .pot-center{font-size:clamp(14px,calc(var(--surface)*.022),42px)}
.game .table[data-phase] .board-cards{gap:calc(var(--surface)*.009)}
.game .table[data-phase] .seat:is([data-seat],.vacant){width:var(--felt-seat);min-width:0;height:var(--seat-height);min-height:0;box-sizing:border-box;border-radius:calc(var(--surface)*.0054);margin:0}
.game .table[data-phase] .seat.vacant{position:absolute;display:grid;place-items:center;opacity:1;gap:0;padding:0;background:#151a168c;color:#a8ada7;border:1px solid #ffffff24;box-shadow:none;line-height:1}
.game .table[data-phase] .seat.vacant[data-sit]{cursor:pointer;color:#c6cac5}
.game .table[data-phase] .seat.vacant[data-sit]:is(:hover,:focus-visible){background:#4d584ce6;border-color:#d8ebcc;color:white;outline-offset:1px;z-index:5}
.game .table[data-phase] .seat.vacant .vacant-index{position:absolute;top:13%;left:5%;color:#a5afa399;font:600 calc(var(--surface)*.0144)/1 var(--sans)}
.game .table[data-phase] .seat.vacant .vacant-label{position:static;transform:none;font:650 clamp(10px,calc(var(--surface)*.0108),22px)/1 var(--sans);color:inherit}
.game .table[data-phase] .seat.vacant.occupied-preview{background:#303632e8;color:#c7cdc6}
.game .table[data-phase] .seat[data-seat] .seat-identity{padding:3px 6px;gap:2px}
.game .table[data-phase] .seat[data-seat] .player-name{font-size:clamp(10px,calc(var(--surface)*.012),21px)}
.game .table[data-phase] .seat[data-seat] .stack{font-size:clamp(11px,calc(var(--surface)*.013),24px)}
.game .table[data-phase] :is(.seat,.seat-wager).pos0{--seat-x:62.08%;--seat-y:88.90%;--wager-x:61%;--wager-y:74%}
.game .table[data-phase] :is(.seat,.seat-wager).pos1{--seat-x:38.08%;--seat-y:88.90%;--wager-x:38%;--wager-y:74%}
.game .table[data-phase] :is(.seat,.seat-wager).pos2{--seat-x:17.07%;--seat-y:72.90%;--wager-x:28%;--wager-y:63%}
.game .table[data-phase] :is(.seat,.seat-wager).pos3{--seat-x:11.57%;--seat-y:46.90%;--wager-x:24%;--wager-y:47%}
.game .table[data-phase] :is(.seat,.seat-wager).pos4{--seat-x:17.07%;--seat-y:20.90%;--wager-x:28%;--wager-y:30%}
.game .table[data-phase] :is(.seat,.seat-wager).pos5{--seat-x:38.08%;--seat-y:8.90%;--wager-x:37%;--wager-y:23%}
.game .table[data-phase] :is(.seat,.seat-wager).pos6{--seat-x:62.08%;--seat-y:8.90%;--wager-x:62%;--wager-y:23%}
.game .table[data-phase] :is(.seat,.seat-wager).pos7{--seat-x:83.07%;--seat-y:20.90%;--wager-x:72%;--wager-y:30%}
.game .table[data-phase] :is(.seat,.seat-wager).pos8{--seat-x:89.57%;--seat-y:46.90%;--wager-x:76%;--wager-y:47%}
.game .table[data-phase] :is(.seat,.seat-wager).pos9{--seat-x:84.07%;--seat-y:72.90%;--wager-x:73%;--wager-y:63%}
.game .controls{width:min(100%,var(--surface));margin:0;padding:0 max(9px,calc(var(--surface)*.013)) 0;justify-self:center;justify-items:end;box-sizing:border-box}
.game .controls .btn{min-height:clamp(39px,calc(var(--surface)*.036),60px)}
.game .controls .decision-heading{justify-content:flex-end}
.game .controls .action-row{justify-content:flex-end}
.game .poker-tools{top:0}
.game .table-meta{top:0}
.game .sit-dialog{width:min(350px,calc(100% - 28px));max-width:none;border:1px solid #b1beab57;padding:22px;border-radius:10px;background:#242d25;color:#f1eeea;box-shadow:0 16px 65px #10170ecc}
.game .sit-dialog::backdrop{background:#10160d9c}
.game .sit-dialog h2{margin:0 0 3px;font-size:21px}
.game .sit-dialog form{display:grid;gap:13px}
.game .sit-dialog input{width:100%;min-height:44px}
.game .sit-dialog .sit-error{margin:0;color:#ffc9aa;font-size:13px}
.game .sit-dialog .sit-error:empty{display:none}
.game .sit-dialog .lobby-actions{margin:0;display:flex;justify-content:flex-end;gap:7px}
@media (min-width:601px), (orientation:landscape){
  body[data-screen=game] .site-header{position:absolute;inset:0 0 auto;z-index:10}
  .game .poker-tools,.game .table-meta{top:56px}
}
@media(max-width:600px) and (orientation:portrait){
  .game{--surface:min(100cqw,510px);--surface-height:min(calc(var(--surface)*1.61),max(430px,calc(100svh - 143px)));--felt-seat:calc(var(--surface)*.2923);--seat-height:min(calc(var(--surface)*.229),calc(var(--surface-height)*.143));--felt-pocket:calc(var(--surface)*.076);--card-width:calc(var(--surface)*.13);--layout-top:16px}
  .game .table[data-phase]{--board-y:47%;}
  .game .table[data-phase]::before{inset:2.5% 10% 3%;border-width:6px;border-radius:48% / 30%}
  .game .table[data-phase] .board-cards{gap:calc(var(--surface)*.02)}
  .game .table[data-phase] .pot{min-height:26px;width:calc(var(--surface)*.223)}
  .game .table[data-phase] .pot-total{top:-2px;right:0;left:auto}
  .game .table[data-phase] .seat:is([data-seat],.vacant){border-radius:6px}
  .game .table[data-phase] .seat.vacant .vacant-index{font-size:15px}
  .game .table[data-phase] .seat.vacant .vacant-label{font-size:12px}
  .game .table[data-phase] .seat[data-seat]{grid-template-columns:minmax(0,1fr);grid-template-rows:55% 45%;justify-items:center}
  .game .table[data-phase] .seat[data-seat] .pocket{position:relative;inset:auto;grid-area:1/1;transform:none;align-self:center}
  .game .table[data-phase] .seat[data-seat] .seat-identity{grid-area:2/1;align-self:center;justify-items:center;text-align:center;padding:1px 4px}
  .game .table[data-phase] .seat[data-seat] .player-name{min-height:0;font-size:clamp(10px,3vw,16px);line-height:1.02;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
  .game .table[data-phase] .seat[data-seat] .stack{font-size:clamp(11px,3.3vw,17px)}
  .game .table[data-phase] .seat[data-seat]:not(:has(.pocket .card)) .seat-identity{grid-row:1 / -1}
  .game .table[data-phase] .seat[data-seat].own{--felt-pocket:calc(var(--surface)*.092);width:var(--felt-seat)}
  .game .table[data-phase] :is(.seat,.seat-wager).pos0{--seat-x:50.25%;--seat-y:92.72%;--wager-x:50%;--wager-y:82%}
  .game .table[data-phase] :is(.seat,.seat-wager).pos1{--seat-x:15.2%;--seat-y:78.64%;--wager-x:35%;--wager-y:77%}
  .game .table[data-phase] :is(.seat,.seat-wager).pos2{--seat-x:15.2%;--seat-y:62.58%;--wager-x:35%;--wager-y:63%}
  .game .table[data-phase] :is(.seat,.seat-wager).pos3{--seat-x:15.2%;--seat-y:34.71%;--wager-x:35%;--wager-y:34%}
  .game .table[data-phase] :is(.seat,.seat-wager).pos4{--seat-x:15.2%;--seat-y:17.93%;--wager-x:35%;--wager-y:20%}
  .game .table[data-phase] :is(.seat,.seat-wager).pos5{--seat-x:50.25%;--seat-y:7.2%;--wager-x:50%;--wager-y:19%}
  .game .table[data-phase] :is(.seat,.seat-wager).pos6{--seat-x:84.8%;--seat-y:17.93%;--wager-x:65%;--wager-y:20%}
  .game .table[data-phase] :is(.seat,.seat-wager).pos7{--seat-x:84.8%;--seat-y:34.71%;--wager-x:65%;--wager-y:34%}
  .game .table[data-phase] :is(.seat,.seat-wager).pos8{--seat-x:84.8%;--seat-y:62.58%;--wager-x:65%;--wager-y:63%}
  .game .table[data-phase] :is(.seat,.seat-wager).pos9{--seat-x:84.8%;--seat-y:78.64%;--wager-x:65%;--wager-y:77%}
  .game .poker-tools,.game .table-meta{top:-11px}
  .game .controls{margin-top:6px}
  .game .table[data-phase] .seat-wager{min-width:21px;min-height:21px;font-size:10px;padding:1px 4px}
}
@media(min-width:601px) and (max-width:900px), (max-width:600px) and (orientation:landscape){
  .game .table[data-phase] .seat[data-seat] .pocket{position:relative;inset:auto;transform:none;grid-area:1/1;}
  .game .table[data-phase] .seat[data-seat]{grid-template-columns:48% minmax(0,1fr)}
  .game .table[data-phase] .seat[data-seat].own{width:var(--felt-seat);--felt-pocket:calc(var(--surface)*.045)}
  .game .table[data-phase] .seat[data-seat] .player-name{min-height:0;text-align:left}
  .game .table[data-phase] .seat[data-seat] .seat-identity{grid-area:1/2;justify-items:start}
}

/* Match the observed result: the board holds still while only the made hand rises. */
.game .table[data-phase] .card{--win-lift:clamp(7px,calc(var(--surface)*.0115),22px)}
.game .table[data-phase] .pocket .card{--win-lift:clamp(3px,calc(var(--surface)*.0035),9px)}
.game .table[data-phase=settled] .card.best-five:not(.back,.empty){translate:0 calc(-1 * var(--win-lift));filter:none;box-shadow:0 3px 8px #07170bb8}
.game .table[data-phase=settled] .card.not-best:not(.back,.empty){opacity:.6;filter:none}
.game .table[data-phase=settled] .card.best-five.motion-win-on{animation:reference-lift 450ms cubic-bezier(.25,.56,.25,1) var(--win-delay,0ms) both}
.game .table[data-phase=settled] .card.not-best.motion-win-on{animation:reference-dim 230ms ease-out var(--win-delay,0ms) both}
.game .table[data-phase] .card.motion-board-on{animation:reference-board-flip 250ms cubic-bezier(.25,.58,.34,1) var(--board-delay,0ms) both}
.game .table[data-phase] .card.motion-board-on::after{animation:table-back 250ms steps(1,end) var(--board-delay,0ms) both}
.game .table[data-phase] .seat.seat-winner{z-index:5}
.game .table[data-phase] .seat.seat-winner::before{background:#333a2d;border:1px solid #edce82b0;box-shadow:0 0 13px #f0cc674f}
.game .table[data-phase] .seat-result{display:contents;font:760 clamp(10px,calc(var(--surface)*.010),18px)/1 var(--sans);white-space:nowrap}
.game .table[data-phase] .seat-combo,.game .table[data-phase] .seat-award{position:absolute;z-index:2;display:block;border-radius:4px;background:#282d23;color:#f4e9ca;box-shadow:0 2px 5px #10180ca0;padding:3px 5px;max-width:100%;overflow:hidden;text-overflow:ellipsis}
.game .table[data-phase] .seat-combo{top:0;left:50%;translate:-50% -62%}
.game .table[data-phase] .seat-award{right:4px;bottom:0;translate:0 55%;color:#fbda78;background:#261f15}
.game .table[data-phase] .seat-result.motion-win-on .seat-combo,.game .table[data-phase] .seat-award.motion-win-on{animation:reference-award 250ms ease-out var(--win-delay,0ms) both}
.game .table[data-phase] .settled-pot.motion-win-on{animation:reference-award 200ms ease-out var(--win-delay,0ms) both}
.game .hand-breakdown{max-width:min(100%,340px);margin-top:4px;color:#ebe4d5;font-size:12px;line-height:1.32;background:#191f19db;border:1px solid #e2d8b935;border-radius:6px}
.game .hand-breakdown>summary{cursor:pointer;padding:6px 9px}
.game .hand-breakdown .hu-result{padding:4px 10px 9px}
.game .controls:has(.hand-breakdown){position:relative;z-index:6}
@keyframes reference-board-flip{0%{opacity:0;transform:perspective(480px) rotateY(-178deg)}8%{opacity:1}50%{transform:perspective(480px) rotateY(-90deg)}100%{transform:perspective(480px) rotateY(0deg)}}
@keyframes reference-lift{from{translate:0 0}to{translate:0 calc(-1 * var(--win-lift))}}
@keyframes reference-dim{from{opacity:1}to{opacity:.6}}
@keyframes reference-award{from{opacity:.15}to{opacity:1}}
@media(max-width:600px) and (orientation:portrait){
  .game .table[data-phase] .seat-combo{font-size:10px;left:50%;max-width:calc(100% - 2px);translate:-50% -32%;padding:2px 4px}
  .game .table[data-phase] .seat-award{font-size:10px;padding:2px 4px;translate:0 27%}
}
@media(prefers-reduced-motion:reduce){.game .table[data-phase] :is(.motion-board-on,.motion-win-on),.game .table[data-phase] .seat-result.motion-win-on :is(.seat-combo,.seat-award){animation:none}}

/* Two silhouettes from the measured desktop and portrait reference views. */
.game .table[data-phase]::before{inset:13.6% 17% 11.7%;border:0;border-radius:50%;background:radial-gradient(ellipse at 50% 43%,#3b9f69 0%,#328b59 66%,#2c7950 95%);box-shadow:inset 0 0 0 4px #e2ffe729,inset 0 0 18px #123e2a75,0 0 0 calc(var(--surface)*.010) #232423,0 calc(var(--surface)*.024) 0 calc(var(--surface)*.011) #272927,0 calc(var(--surface)*.026) calc(var(--surface)*.024) calc(var(--surface)*.012) #1015109c}
.game .table[data-phase] .pot{bottom:calc(100% + var(--surface)*.017);background:#1f774f8c;border:0;box-shadow:inset 0 1px 1px #123b253a}
.game .table[data-phase] .board{--board-y:48.4%;}
.game .table[data-phase] .board-cards{gap:calc(var(--surface)*.0088)}
.game .table[data-phase] .seat.vacant{border-style:dashed;background:#2326235c}
.game .table[data-phase] .seat.vacant .vacant-label{place-self:center;text-align:center;width:100%;letter-spacing:.22em;text-indent:.22em}
.game .table[data-phase] .seat.seat-winner::before{background:#f5ffc9;border-color:#e9f8b2;box-shadow:0 0 clamp(14px,2.6vw,44px) #e9fa7280}
.game .table[data-phase] .seat.seat-winner :is(.seat-identity,.stack,.player-name){color:#354218}
.game .table[data-phase] .seat-combo{background:#4946a2;color:#fff}
.game .table[data-phase] .seat-award{position:static;display:inline-block;translate:none;max-width:60%;background:#61733c;color:#fff;font:700 clamp(10px,calc(var(--surface)*.0125),18px)/1 var(--sans);white-space:nowrap;padding:2px 4px}
@media(max-width:600px) and (orientation:portrait){
  .game .table[data-phase]::before{inset:10.8% 10.8% 7.4%;border-radius:21.5% / 15%;box-shadow:inset 0 0 0 4px #d5ffdb23,inset 0 0 14px #123e2a8c,0 0 0 max(4px,calc(var(--surface)*.016)) #232423,0 calc(var(--surface)*.018) 0 max(5px,calc(var(--surface)*.019)) #303130,0 calc(var(--surface)*.017) calc(var(--surface)*.053) calc(var(--surface)*.016) #0b0f0bbc}
  .game .table[data-phase] .board{--board-y:51.3%}
  .game .table[data-phase] .pot{bottom:calc(100% + var(--surface)*.017)}
  .game .table[data-phase] .board-cards{gap:calc(var(--surface)*.0105)}
  .game .table[data-phase] .seat[data-seat]{--occupied-h:max(34px,calc(var(--surface)*.109));height:var(--occupied-h);top:calc(var(--seat-y) + (var(--seat-height) - var(--occupied-h))/2);grid-template-rows:1fr}
  .game .table[data-phase] .seat[data-seat] .pocket{position:absolute;inset:auto auto 91% 50%;transform:translateX(-50%);grid-area:auto;--felt-pocket:calc(var(--surface)*.115)}
  .game .table[data-phase] .seat[data-seat].own .pocket{--felt-pocket:calc(var(--surface)*.123)}
  .game .table[data-phase] .seat[data-seat] .pocket>.card.back{--w:calc(var(--surface)*.059)}
  .game .table[data-phase] .seat[data-seat] .seat-identity{grid-area:1/1;justify-items:start;align-content:center;min-width:0;gap:2px;padding:2px 7px;text-align:left}
  .game .table[data-phase] .seat[data-seat] .player-name{white-space:nowrap;text-overflow:ellipsis;text-align:left;display:block}
  .game .table[data-phase] .seat[data-seat] .seat-money{justify-content:start}
  .game .table[data-phase] .seat[data-seat] .seat-combo{left:auto;right:2px;translate:0 -62%}
  .game .table[data-phase] .seat[data-seat] .seat-award{font-size:10px}
  .game .table[data-phase] .seat.seat-winner .stack{max-width:50%;overflow:hidden;text-overflow:ellipsis}
}
@media(max-width:360px) and (orientation:portrait){
  .game .table[data-phase] .seat[data-seat] .pocket{bottom:110%}
  .game .table[data-phase] .seat[data-seat] .seat-money{gap:2px;flex-wrap:nowrap}
  .game .table[data-phase] .seat[data-seat] .seat-award{padding-inline:2px}
}

/* All phases share one table track. The editor floats in a reserved gap,
   so starting a hand or opening the editor cannot recenter or resize the felt. */
.game{
  --rack-button-h:44px;
  --rack-inset:16px;
  --rack-width:304px;
  --rack-clearance:24px;
  /* Keep the felt centered at the existing height after removing the rack header. */
  --rack-stack:calc(var(--rack-clearance) + 8px + var(--rack-button-h));
  --editor-room:84px;
  --scene-gap:10px;
  --scene-header:0px;
  --scene-dock:10px;
  --scene-bottom:max(8px,env(safe-area-inset-bottom));
  --available-felt:calc(100dvh - var(--layout-top) - var(--scene-header) - var(--scene-dock) - var(--scene-bottom) - var(--scene-gap) - var(--editor-room) - var(--rack-stack));
  grid-template-rows:var(--surface-height) auto;
  padding-bottom:var(--scene-bottom);
  row-gap:calc(var(--scene-gap) + var(--editor-room));
}
.game .table[data-phase]{grid-row:1;height:var(--surface-height);align-self:start}
.game .controls{grid-row:2;align-self:start;margin-top:0}
.game .controls.turn-rack{position:relative;grid-template-columns:minmax(0,1fr);grid-template-rows:var(--rack-button-h);justify-self:center;justify-items:stretch;width:min(var(--rack-width),calc(100% - 2 * var(--rack-inset)));margin:0;padding:0;gap:8px;text-align:left;z-index:6}
.game .turn-rack .action-row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;width:100%}
.game .turn-rack.rebuy-rack{align-items:center;justify-items:center;text-align:center}
.game .rebuy-rack .action-row{grid-template-columns:minmax(0,1fr);width:min(100%,12rem)}
.game .rebuy-rack [role=status]{color:#eee3c6;font-size:13px}
.game .controls.turn-rack .action-row>.btn{height:var(--rack-button-h);min-height:var(--rack-button-h);width:100%;min-width:0;padding:3px 4px;font-size:14px;line-height:1.1;white-space:normal;display:flex;gap:3px;flex-wrap:wrap;align-content:center;justify-content:center;background:#282c28;color:#f5f5f1;border-color:#686f65;border-radius:7px;box-shadow:none}
.game .controls.turn-rack .action-row>.btn:not(:disabled):is(:hover,:focus-visible,[aria-expanded=true]){background:#3b5041;border-color:#90b69a}
.game .controls.turn-rack .action-row>.btn[data-action=toggleRaise][aria-expanded=true]{background:#38553f;border-color:#94c59f}
.game .controls.turn-rack .action-row>.btn:disabled{opacity:.46}
.game .turn-rack .call-amount{max-width:100%;overflow-wrap:anywhere}
.game .controls.turn-rack .bet-editor{position:absolute;left:50%;bottom:calc(100% + 8px);transform:translateX(-50%);width:100%;min-width:0;padding:7px 8px;gap:3px;background:#242b24;border-color:#667961;box-shadow:none}
.game .turn-rack .bet-stepper label{justify-content:flex-start}
.game .turn-rack .bet-stepper input{flex:1 1 0;font-size:16px}
.game .turn-rack .bet-editor .bet-back{margin-top:0;align-self:end;min-height:42px}
.game .controls.turn-rack .bet-summary .btn{min-height:42px;padding:5px 7px;font-size:14px}
.game .turn-rack .bet-editor input[type=range]{height:22px;min-height:22px}
@media(max-width:600px) and (orientation:portrait){
  .game{--rack-button-h:48px;--rack-width:360px;--scene-header:55px;--scene-dock:48px;--editor-room:156px;--scene-gap:16px;--surface-height:min(calc(var(--surface)*1.61),max(214px,var(--available-felt)))}
  .game .controls.turn-rack .action-row>.btn{font-size:13px}
  .game .turn-rack .bet-stepper button,.game .turn-rack .bet-presets button,.game .turn-rack .bet-editor .bet-back,.game .controls.turn-rack .bet-summary .btn{min-height:44px}
}
@media(orientation:landscape) and (max-height:540px){
  .game{--scene-dock:2px;--editor-room:76px;--scene-gap:8px;--layout-top:48px;--surface:min(100cqw,calc(max(136px,var(--available-felt)) / .4725));--surface-height:calc(var(--surface)*.4725);--felt-seat:calc(var(--surface)*.1814);--seat-height:calc(var(--surface)*.077);--felt-pocket:calc(var(--surface)*.052);--card-width:calc(var(--surface)*.081)}
  .game .controls.turn-rack .bet-editor:has(.bet-sizing){grid-template-columns:minmax(0,1fr) minmax(175px,auto);width:min(520px,calc(100cqw - 32px));padding:5px 7px;column-gap:8px;row-gap:2px}
  .game .turn-rack .bet-editor .bet-sizing{grid-column:1;grid-row:1}
  .game .turn-rack .bet-editor #raise-range{grid-column:1;grid-row:2}
  .game .turn-rack .bet-editor:has(.bet-sizing) .bet-commit{grid-column:2;grid-row:1 / span 2}
  .game .turn-rack .bet-editor :is(.bet-presets button,.bet-stepper button,.bet-stepper input,.bet-back){min-height:32px}
  .game .controls.turn-rack .bet-summary .btn{min-height:36px}
}
/* On short portrait screens keep side hold cards clear of the plaque above. */
@media(max-width:600px) and (max-height:748px) and (orientation:portrait){
  .game .table[data-phase] .seat.own:not(.pos0,.pos5) .pocket{inset:50% auto auto calc(100% + 6px);transform:translateY(-50%);--felt-pocket:clamp(25px,calc(var(--surface)*.089),42px)}
  .game .table[data-phase] .seat.own:is(.pos6,.pos7,.pos8,.pos9) .pocket{left:auto;right:calc(100% + 6px)}
}

/* Restore the original desktop table center. On short windows, keep the
   buttons visible and limit how much the table can shrink to reach that center. */
@media (min-width:601px) and (min-height:541px){
  .game{
    --rack-width:480px;
    --rack-clearance:34px;
    --rack-button-h:56px;
    --editor-room:86px;
    --scene-bottom:26px;
    --preferred-felt-width:min(100cqw,177.778svh);
    --preferred-felt-height:calc(var(--preferred-felt-width) * .4725);
    --preferred-felt-top:max(45px,calc((100svh - var(--preferred-felt-width) * .5625) / 2));
    --preferred-felt-center:calc(var(--preferred-felt-top) + var(--preferred-felt-height) / 2);
    --felt-bottom-limit:calc(100dvh - var(--scene-dock) - var(--scene-bottom) - var(--scene-gap) - var(--editor-room) - var(--rack-stack));
    --compact-felt-height:min(var(--preferred-felt-height),calc(var(--felt-bottom-limit) - min(124px,var(--preferred-felt-top))));
    --felt-center:min(var(--preferred-felt-center),calc(var(--felt-bottom-limit) - var(--compact-felt-height) * .45));
    --surface:min(var(--preferred-felt-width),calc((var(--felt-bottom-limit) - var(--felt-center)) / .23625));
    --layout-top:max(45px,calc(var(--felt-center) - var(--surface-height) / 2));
  }
  .game .turn-rack .action-row{gap:10px}
  .game .controls.turn-rack .action-row>.btn{
    gap:5px;
    border-radius:8px;
    font-size:17px;
    font-weight:790;
    box-shadow:0 2px #111611;
  }
  .game .controls.turn-rack .action-row>.btn[data-action=fold]{background:#333a37;border-color:#88948c;color:#fff}
  .game .controls.turn-rack .action-row>.btn:is([data-action=check],[data-action=call]){background:#d9f2dc;border-color:#f0fff0;color:#192f21}
  .game .controls.turn-rack .action-row>.btn[data-action=toggleRaise]{background:#f4d686;border-color:#fff0ad;color:#33250f}
  .game .controls.turn-rack .action-row>.btn:not(:disabled):is(:hover,:focus-visible){filter:brightness(1.12)}
  .game .controls.turn-rack .action-row>.btn[data-action=toggleRaise][aria-expanded=true]{outline:2px solid #fff0ad;outline-offset:-5px}
  .game .controls.turn-rack .bet-editor:has(.bet-sizing){
    grid-template-columns:minmax(0,1fr) minmax(182px,auto);
    width:min(570px,calc(100cqw - 32px));
    column-gap:10px;
  }
  .game .turn-rack .bet-editor .bet-sizing{grid-column:1;grid-row:1}
  .game .turn-rack .bet-editor #raise-range{grid-column:1;grid-row:2}
  .game .turn-rack .bet-editor:has(.bet-sizing) .bet-commit{grid-column:2;grid-row:1 / span 2}
}

/* On very short landscape screens use the spare width, not the table's height. */
@media(max-width:600px) and (orientation:landscape) and (max-height:540px){
  .game{
    --editor-lane:200px;
    --editor-room:0px;
    --scene-dock:18px;
    --scene-gap:8px;
    --layout-top:54px;
    --surface:min(calc(100cqw - var(--editor-lane) - 8px),calc(max(100px,var(--available-felt)) / .4725));
    grid-template-columns:minmax(0,1fr) var(--editor-lane);
  }
  .game :is(.table[data-phase],.controls){grid-column:1}
  .game .poker-tools,.game .table-meta{top:49px}
  .game .controls.turn-rack .bet-editor{
    left:calc(50% + (100cqw - var(--editor-lane)) / 2 + 4px);
    width:calc(var(--editor-lane) - 12px);
    bottom:0;
    transform:none;
  }
  .game .controls.turn-rack .bet-editor:has(.bet-sizing){width:calc(var(--editor-lane) - 12px);grid-template-columns:minmax(0,1fr);gap:3px}
  .game .turn-rack .bet-editor .bet-sizing{grid-column:1;grid-row:1;grid-template-columns:minmax(0,1fr);gap:3px}
  .game .turn-rack .bet-editor:has(.bet-sizing) .bet-commit{grid-column:1;grid-row:3}
}

/* Six-handed layout: one seat at each end and two along each side. */
.game .table[data-phase][data-seat-layout="6"] :is(.seat,.seat-wager).pos0{--seat-x:50%;--seat-y:89%;--wager-x:50%;--wager-y:73%}
.game .table[data-phase][data-seat-layout="6"] :is(.seat,.seat-wager).pos1{--seat-x:16%;--seat-y:72%;--wager-x:29%;--wager-y:64%}
.game .table[data-phase][data-seat-layout="6"] :is(.seat,.seat-wager).pos2{--seat-x:16%;--seat-y:26%;--wager-x:29%;--wager-y:34%}
.game .table[data-phase][data-seat-layout="6"] :is(.seat,.seat-wager).pos3{--seat-x:50%;--seat-y:9%;--wager-x:50%;--wager-y:24%}
.game .table[data-phase][data-seat-layout="6"] :is(.seat,.seat-wager).pos4{--seat-x:84%;--seat-y:26%;--wager-x:71%;--wager-y:34%}
.game .table[data-phase][data-seat-layout="6"] :is(.seat,.seat-wager).pos5{--seat-x:84%;--seat-y:72%;--wager-x:71%;--wager-y:64%}
@media(max-width:600px) and (orientation:portrait){
  .game .table[data-phase][data-seat-layout="6"] :is(.seat,.seat-wager).pos0{--seat-y:92%;--wager-y:79%}
  .game .table[data-phase][data-seat-layout="6"] :is(.seat,.seat-wager).pos1{--seat-y:72%;--wager-x:36%;--wager-y:72%}
  .game .table[data-phase][data-seat-layout="6"] :is(.seat,.seat-wager).pos2{--seat-y:29%;--wager-x:36%;--wager-y:29%}
  .game .table[data-phase][data-seat-layout="6"] :is(.seat,.seat-wager).pos3{--seat-y:7%;--wager-y:21%}
  .game .table[data-phase][data-seat-layout="6"] .seat[data-seat].pos3 .pocket{inset:50% auto auto calc(100% + 5px);transform:translateY(-50%);--felt-pocket:clamp(24px,calc(var(--surface)*.093),40px)}
  .game .table[data-phase][data-seat-layout="6"] :is(.seat,.seat-wager).pos4{--seat-y:29%;--wager-x:64%;--wager-y:29%}
  .game .table[data-phase][data-seat-layout="6"] :is(.seat,.seat-wager).pos5{--seat-y:72%;--wager-x:64%;--wager-y:72%}
}
@media(max-width:600px) and (max-height:748px) and (orientation:portrait){
  .game .table[data-phase][data-seat-layout="6"] .seat.own:is(.pos0,.pos3){--felt-pocket:calc(var(--surface)*.092)}
  .game .table[data-phase][data-seat-layout="6"] .seat.own:is(.pos4,.pos5) .pocket{inset:50% calc(100% + 6px) auto auto;transform:translateY(-50%);--felt-pocket:clamp(25px,calc(var(--surface)*.089),42px)}
}
@media(orientation:landscape) and (max-height:540px){
  .game .table[data-phase][data-seat-layout="6"] .seat.pos3{--seat-y:calc(9% + 7px)}
}

/* Keep the community row above seats and clear of the lower pockets. The
   rightmost card stays readable even during a flip or a showdown lift. */
@media (max-width:900px) and (orientation:portrait), (max-height:540px) and (orientation:landscape){
  .game .table[data-phase] .board{z-index:6}
}
@media (max-width:600px) and (orientation:portrait){
  .game .table[data-phase][data-seat-layout="6"] .seat[data-seat]:is(.pos1,.pos5) .pocket{
    inset:calc(100% + 2px) auto auto 50%;
    transform:translateX(-50%);
    --felt-pocket:clamp(24px,calc(var(--surface)*.092),46px);
  }
}
@media (max-width:600px) and (max-height:748px) and (orientation:portrait){
  .game .table[data-phase][data-seat-layout="6"] .seat[data-seat]:is(.pos2,.pos4) .pocket{
    inset:auto auto calc(100% + 2px) 50%;
    transform:translateX(-50%);
    --felt-pocket:clamp(24px,calc(var(--surface)*.090),42px);
  }
  .game .table[data-phase][data-seat-layout="6"] .seat[data-seat].pos0 .pocket{
    inset:50% auto auto calc(100% + 7px);
    transform:translateY(-50%);
    --felt-pocket:clamp(23px,calc(var(--surface)*.077),38px);
  }
}

/* Share the showdown badge style without covering the cards on compact tables. */
.game .table[data-phase] .seat[data-seat] .seat-own-hand{
  font:760 clamp(11px,calc(var(--surface)*.010),18px)/1.1 var(--sans);
  white-space:nowrap;
}
@media(max-width:600px) and (orientation:portrait){
  .game .table[data-phase] .seat[data-seat] .seat-own-hand{font-size:clamp(10px,2.8vw,13px)}
}
@media(max-width:360px) and (orientation:portrait){
  .game .table[data-phase][data-seat-layout="6"] .seat.pos1 .seat-own-hand{left:2px;right:auto;translate:0 -24%}
  .game .table[data-phase][data-seat-layout="6"] .seat.pos5 .seat-own-hand{translate:0 -24%}
}
@media (max-height:540px) and (orientation:landscape){
  .game .table[data-phase] .seat[data-seat] .seat-own-hand{top:auto;bottom:-2px;translate:-50% 100%}
  .game .table[data-phase][data-seat-layout="6"] .seat.pos3 .seat-own-hand{top:50%;bottom:auto;left:calc(100% + 3px);translate:0 -50%}
}

/* Only the active seat shows the countdown. */
.game .table[data-phase] .seat[data-seat].acting .turn-track{height:clamp(6px,1.65vw,9px);background:#d5dfd8}
.game .table[data-phase] .seat[data-seat].acting .dealer-mark{right:auto;left:3px}
.game .table[data-phase] .seat[data-seat] .seat-clock{
  position:absolute;right:2px;bottom:-1px;translate:0 100%;z-index:3;padding:2px 5px;border-radius:5px;
  color:#fff;background:#226544;box-shadow:0 1px 3px #15372366;
  font:850 clamp(15px,1.4vw,22px)/1.05 var(--sans);font-variant-numeric:tabular-nums;white-space:nowrap;
  pointer-events:none;
}
.game .table[data-phase] .seat[data-seat] .seat-clock.urgent{background:#a82727}
@media (max-width:600px) and (orientation:portrait){
  .game .table[data-phase] .seat[data-seat] .seat-clock{font-size:14px;padding-inline:4px}
  .game .table[data-phase][data-seat-layout="6"] .seat:is(.pos1,.pos5) .seat-clock{
    top:0;right:0;bottom:auto;translate:0 -100%;
  }
  .game .table[data-phase][data-seat-layout="6"] .seat.pos1 .seat-clock{left:0;right:auto}
}
@media (max-height:540px) and (orientation:landscape){
  /* Use the outside edge so the timer doesn't cover compact seat details. */
  .game .table[data-phase] .seat[data-seat] .seat-clock{
    top:50%;left:calc(100% + 3px);right:auto;bottom:auto;translate:0 -50%;font-size:14px;padding-inline:4px;
  }
  .game .table[data-phase][data-seat-layout="6"] .seat:is(.pos1,.pos3) .seat-clock,
  .game .table[data-phase]:not([data-seat-layout="6"]) .seat:is(.pos2,.pos3,.pos4,.pos5) .seat-clock{
    left:auto;right:calc(100% + 3px);
  }
  .game .table[data-phase][data-seat-layout="6"] .seat.pos2 .seat-clock{
    top:calc(100% + 9px);left:-32px;translate:none;
  }
}
@media (max-width:600px) and (max-height:540px) and (orientation:landscape){
  .game .table[data-phase][data-seat-layout="6"] .seat.pos1 .seat-clock{
    top:calc(100% + 4px);left:-32px;right:auto;translate:none;
  }
  .game .table[data-phase][data-seat-layout="6"] .seat.pos3 .seat-clock{
    left:calc(100% + 3px);right:auto;
  }
  .game .table[data-phase][data-seat-layout="6"] .seat.pos3.own.acting .seat-clock{
    top:calc(50% + 6px);
  }
  .game .table[data-phase][data-seat-layout="6"] .seat.pos3.own.acting .seat-own-hand{
    top:calc(50% - 13px);
  }
}
@media (prefers-reduced-motion:reduce){
  .game .table[data-phase] .seat[data-seat].acting .turn-track i{transition:none}
}

/* The first display slot of an occupied table anchors the current viewer. */
.game:not(.table-entry) .table[data-phase]:not([data-seat-layout="6"]) :is(.seat,.seat-wager).pos0{--seat-x:50%;--wager-x:50%}
@media (min-width:601px), (orientation:landscape){
  .game:not(.table-entry) .table[data-phase]:not([data-seat-layout="6"]) :is(.seat,.seat-wager).pos1{--seat-x:28%;--wager-x:32%}
}

/* Keep rank capsules clear of other players’ face-up cards. */
.game .table[data-phase] .seat[data-seat] .seat-visible-hand,
.game .table[data-phase] .seat[data-seat]:has(.seat-result .seat-combo) .seat-own-hand{
  inset:auto auto 0 50%;translate:-50% calc(100% + 2px);width:max-content;max-width:calc(100% + 14px);
  white-space:nowrap;font:760 clamp(10px,calc(var(--surface)*.010),17px)/1.1 var(--sans);
}
@media(max-width:600px) and (orientation:portrait){
  .game .table[data-phase] .seat[data-seat] .seat-visible-hand{font-size:clamp(9px,2.5vw,12px)}
}
.game .table[data-phase] .seat[data-seat] .seat-own-hand{max-width:calc(100% + 14px)}

@media(max-width:360px) and (orientation:portrait){
  .game .table[data-phase] .seat[data-seat] .seat-own-hand{font-size:10px}
}
