/* Mobile table only: reserve the same stage and action space for every hand state.
   Loaded after shared palette/feedback rules so desktop keeps its existing UI. */
body.mobile-room, .mobile-room .app-shell { height:100svh; }
.mobile-room .mobile-header { height:calc(48px + env(safe-area-inset-top)); }
.mobile-room .mobile-brand { font-size:14px; }
.mobile-room .mobile-brand img { width:27px; height:27px; }
.mobile-room main.in-table { overflow:hidden; padding:4px max(8px,env(safe-area-inset-right)) max(4px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left)); }
.mobile-room .mobile-game { grid-template-rows:minmax(0,1fr) 116px 42px; gap:4px; }
.mobile-room .game-board { grid-row:1; overflow:hidden; border-radius:16px; }
.mobile-room .table-topline { min-height:38px; padding:2px 6px; }
.mobile-room .table-topline .game-type { max-width:125px; }
.mobile-room .table-utilities { gap:2px; }
.mobile-room .table-utilities .icon-button { width:32px; }
.mobile-room .table-sound-button .sound-label { display:none; }
.mobile-room .mobile-control-dock { grid-row:2; min-height:0; overflow:auto; scrollbar-width:thin; overscroll-behavior:contain; }
.mobile-room .mobile-room-tools { grid-row:3; }
.mobile-room .mobile-room-tools>button { font-size:11px; border:0; background:transparent; color:var(--muted); border-radius:8px; }
.mobile-room .mobile-actions { height:100%; min-height:0; padding:4px 0; border:0; background:transparent; box-shadow:none; box-sizing:border-box; }
/* The turn is already indicated at the seat; do not repeat it above the buttons. */
.mobile-room .mobile-actions .action-top { display:none; }
.mobile-room .bet-controls { height:100%; justify-content:flex-end; gap:6px; }
.mobile-room .raise-controls { flex:none; grid-template-columns:minmax(0,1fr) minmax(0,1.25fr); grid-template-rows:18px 26px; gap:0 12px; }
.mobile-room .raise-input { font-size:11px; line-height:18px; }
.mobile-room .raise-input strong { font-size:12px; }
.mobile-room .raise-controls input[type=range] { height:26px; margin:0; }
.mobile-room .bet-presets { gap:4px; }
.mobile-room .bet-presets button { height:44px; min-height:44px; font-size:11px; padding:0; }
.mobile-room .action-panel .action-buttons { flex:none; gap:6px; }
.mobile-room .action-panel .action-buttons>button { height:52px; min-height:52px; padding:5px 4px; font-size:16px; line-height:1.15; border-radius:9px; }
.mobile-room .action-panel .action-buttons>button>span { font-size:11px; line-height:1.15; margin-top:3px; }
.mobile-room .action-panel .fold-button>span, .mobile-room .action-panel .call-button[data-action=check]>span { display:none; }
.mobile-room .action-panel .raise-button svg { display:none; }
.mobile-room .pre-actions { height:100%; min-height:0; display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); grid-template-rows:1fr 52px; gap:6px; padding:0; }
.mobile-room .pre-actions>span { grid-column:1/-1; width:auto; align-self:end; text-align:left; padding-bottom:2px; font-size:11px; }
.mobile-room .pre-actions button { min-width:0; min-height:52px; padding:4px; font-size:12px; line-height:1.25; }
.mobile-room .join-strip, .mobile-room .waiting-hand-notice { height:100%; display:flex; align-items:center; justify-content:space-between; }
.mobile-room .waiting-hand-notice { flex-direction:column; justify-content:center; text-align:center; }
.mobile-room .join-strip .primary-button { min-height:48px; }
.mobile-room .tournament-return-notice, .mobile-room .tournament-next-round, .mobile-control-dock .table-fairness { padding:8px; font-size:12px; }
.mobile-room .tournament-return-notice p { margin:4px 0; }
/* A tall felt uses the phone's portrait canvas; cards do not depend on action height. */
@media (orientation:portrait) {
 .mobile-room .poker-stage { --room-card-width:clamp(36px,11cqw,48px); --room-card-height:clamp(52px,16cqw,68px); }
 .mobile-room .poker-table { top:12%; bottom:10%; left:7%; right:7%; border-width:6px; border-radius:50% / 46%; }
 .mobile-room .felt-line { inset:9px; border-radius:50% / 46%; }
 .mobile-room .table-shadow { top:14%; height:76%; left:7%; right:7%; width:auto; border-radius:50% / 46%; }
 .mobile-room .seat { width:88px; max-width:26%; }
 .mobile-room .seat-top { top:calc(12% - 20px); }
 .mobile-room .seat-left-top, .mobile-room .seat-right-top { top:29%; }
 .mobile-room .seat-left-bottom, .mobile-room .seat-right-bottom { top:65%; }
 .mobile-room .seat-left-top, .mobile-room .seat-left-bottom { left:13%; }
 .mobile-room .seat-right-top, .mobile-room .seat-right-bottom { left:87%; }
 .mobile-room .avatar { width:36px; height:36px; }
 .mobile-room .seat-info { padding:6px 3px 5px; }
 .mobile-room .seat-info>strong { font-size:11px; }
 .mobile-room .seat-info>span { font-size:12px; }
 .mobile-room .seat-hero { bottom:5%; width:132px; max-width:42%; }
 .mobile-room .hero-cards { bottom:calc(5% + 42px); }
 .mobile-room .hero-cards .card { width:44px; height:62px; }
 .mobile-room .felt-brand { top:20%; font-size:11px; opacity:.25; }
 .mobile-room .felt-caption { display:none; }
 .mobile-room .pot { top:40%; }
 .mobile-room .pot strong { font-size:23px; margin-top:3px; }
 .mobile-room .community-cards { top:49%; gap:4px; }
 .mobile-room .hand-status { top:calc(49% + var(--room-card-height) + 8px); font-size:8px; }
 .mobile-room .card-corner { font-size:24px; }
 .mobile-room .card-suit { font-size:30px; }
 .mobile-room .seat-hero .hero-hand-description { top:calc(100% + 5px); font-size:10px; }
 .mobile-room .seat-hero.is-winner .hero-hand-description { top:calc(100% + 27px); }
}
/* Short landscape screens keep a fixed side dock instead of stealing felt height. */
@media (orientation:landscape) and (max-height:560px) {
 .mobile-room .mobile-game { grid-template-columns:minmax(0,1fr) 230px; grid-template-rows:minmax(0,1fr) 42px; gap:4px 8px; }
 .mobile-room .game-board { grid-column:1; grid-row:1 / 3; }
 .mobile-room .mobile-control-dock { grid-column:2; grid-row:1; }
 .mobile-room .mobile-room-tools { grid-column:2; grid-row:2; }
 .mobile-room .mobile-actions { display:flex; flex-direction:column; justify-content:flex-end; }
 .mobile-room .bet-controls { height:auto; }
 .mobile-room .raise-controls { grid-template-columns:1fr; grid-template-rows:18px 28px 44px; gap:4px; }
 .mobile-room .bet-presets { grid-column:1; grid-row:3; }
}
/* Bet sizing is opt-in and overlays the stage instead of resizing it. */
.mobile-room .mobile-game { grid-template-rows:minmax(0,1fr) 80px 42px; }
 .mobile-room .action-panel .action-buttons { grid-template-columns:repeat(3,minmax(0,1fr)) 44px; }
.mobile-room .action-panel .action-buttons>.mobile-bet-size { display:grid; place-items:center; width:44px; padding:8px; border:1px solid var(--line); background:var(--surface-raised); color:var(--cream); }
.mobile-room .mobile-bet-size svg { width:20px; height:20px; }
.mobile-room .mobile-bet-sheet { width:calc(100% - 16px); max-width:480px; max-height:80svh; box-sizing:border-box; margin:auto auto max(8px,env(safe-area-inset-bottom)); padding:18px; border:1px solid var(--line); border-radius:18px; background:var(--surface,#1b2024); color:var(--cream); overflow:auto; }
.mobile-room .mobile-bet-sheet::backdrop { background:#080b10aa; }
.mobile-room .mobile-bet-sheet .raise-controls { display:grid; grid-template-columns:1fr; grid-template-rows:auto 44px 44px; gap:12px; }
.mobile-room .mobile-bet-sheet .raise-input { grid-column:1; grid-row:1; font-size:14px; }
.mobile-room .mobile-bet-sheet .raise-input strong { font-size:22px; }
.mobile-room .mobile-bet-sheet input[type=range] { grid-column:1; grid-row:2; width:100%; height:44px; }
.mobile-room .mobile-bet-sheet .bet-presets { grid-column:1; grid-row:3; }
.mobile-room .mobile-bet-sheet .bet-presets button { font-size:13px; }
.mobile-room .mobile-bet-sheet>.primary-button { width:100%; min-height:46px; margin:16px 0 0; justify-content:center; }
@media (orientation:landscape) and (max-height:560px) {
 .mobile-room .mobile-game { grid-template-rows:minmax(0,1fr) 42px; }
}
/* Reset the old landscape grid before applying the side-dock breakpoint. */
.mobile-room .mobile-game { grid-template-columns:minmax(0,1fr); }
.mobile-room .game-board, .mobile-room .mobile-control-dock, .mobile-room .mobile-room-tools { grid-column:1; }
@media (orientation:landscape) and (max-height:560px) {
 .mobile-room .mobile-game { grid-template-columns:minmax(0,1fr) 230px; }
 .mobile-room .game-board { grid-row:1 / 3; }
 .mobile-room .mobile-control-dock, .mobile-room .mobile-room-tools { grid-column:2; }
}
@media (orientation:portrait) {
 .mobile-room .seat-hero { bottom:44px; }
 .mobile-room .hero-cards { bottom:86px; }
 .mobile-room .seat-hero.is-winner .hero-hand-description { top:calc(100% + 27px); }
}
@container (max-height:400px) {
 .mobile-room .poker-stage .hero-cards .card { width:34px; height:46px; }
 .mobile-room .poker-stage .hero-cards { bottom:79px; }
 .mobile-room .poker-stage .seat-hero { bottom:38px; }
 .mobile-room .poker-stage .community-cards { top:40%; gap:3px; }
 .mobile-room .poker-stage .community-cards .card { width:32px; height:44px; }
 .mobile-room .poker-stage .hand-status { top:calc(40% + 48px); font-size:7px; }
 .mobile-room .poker-stage .pot { top:28%; }
 .mobile-room .poker-stage .pot strong { font-size:19px; }
 .mobile-room .poker-stage .card-corner { font-size:20px; }
 .mobile-room .poker-stage .card-suit { font-size:24px; }
 .mobile-room .poker-stage .seat-left-bottom, .mobile-room .poker-stage .seat-right-bottom { top:62%; }
 .mobile-room .poker-stage .seat-info>strong { font-size:10px; }
 .mobile-room .poker-stage .seat-info>span { font-size:11px; }
 .mobile-room .poker-stage .avatar { width:28px; height:28px; }
 .mobile-room .poker-stage .felt-brand { display:none; }
}
@container (max-height:400px) {
 .mobile-room .poker-stage .seat-top { top:0; }
 .mobile-room .poker-stage .seat-left-top, .mobile-room .poker-stage .seat-right-top { top:20%; }
 .mobile-room .poker-stage .community-cards { top:42%; }
 .mobile-room .poker-stage .hand-status { top:calc(42% + 48px); }
}
/* Spectators need only the entry action; buy-in details remain in the seat dialog. */
.mobile-room .join-strip>p { display:none; }
.mobile-room .join-strip { justify-content:flex-end; align-items:flex-end; }
.mobile-room .join-strip .primary-button { width:100%; justify-content:center; }
/* Expanded mobile table also works without the browser Fullscreen API. */
body.mobile-room.table-expanded, .mobile-room.table-expanded .app-shell { height:100dvh; }
.mobile-room.table-expanded .mobile-header { display:none; }
.mobile-room.table-expanded main.in-table { padding-top:max(4px,env(safe-area-inset-top)); }
.mobile-room [data-ui=fullscreen][aria-pressed=true] { color:var(--gold); background:var(--surface-raised); }
