/* Height-aware mobile table. Desktop V3.1.3 is intentionally outside this query. */
@media (min-width:521px) and (max-width:1100px) and (min-height:501px) {
 .game-screen .console-footer .action-button { min-height:32px;padding:4px 12px;font-size:14px; }
}
@media (max-width:520px), (max-height:500px) and (max-width:1100px) {
 .game-screen { height:100vh;height:100dvh;min-height:0;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
 .game-screen .gamebar { flex:0 0 48px;min-height:48px;width:calc(100% - 12px);gap:4px; }
 .game-screen .game-layout { flex:1;min-height:0;max-height:none;height:auto;width:calc(100% - 8px);padding:0;margin:0 auto; }
 .game-screen .game-layout::before,.game-screen .game-layout::after { inset:75px -8px 0; }
 .game-screen .game-table { inset:0;height:100%;grid-template-columns:60px minmax(0,1fr) 60px;grid-template-rows:100px minmax(0,1fr) 20px; }
 .game-screen .player-console { left:4px;right:4px;top:auto;bottom:4px;height:120px; }
 .game-screen .hand-heading { top:0; }
 .game-screen .hand-scroll { top:22px; }
 .game-screen .player-hand { min-height:62px;padding:4px 0 6px;gap:1px; }
 .game-screen .player-hand .tile-button { flex:0 0 auto;width:calc((100vw - 42px) / 14);max-width:28px;height:48px;touch-action:manipulation; }
 .game-screen .tile-button.is-drawn { margin-left:4px; }
 .game-screen .console-footer { top:84px;min-height:28px;padding-top:0; }
 .game-screen .action-area { min-height:28px; }
 .game-screen .console-footer .action-button { min-height:28px;padding:2px 10px;font-size:12px;border-radius:14px; }
 .game-screen .console-footer .action-list { gap:5px; }
 .game-screen .human-seat { position:absolute;left:8px;bottom:128px;top:auto;width:auto; }
 .game-screen .console-footer button { min-height:28px; }
 .game-screen .player-meld-zone { right:2px;bottom:calc(100% + 6px);height:30px;gap:4px; }
 .game-screen .player-meld-zone .tile-art { --tile-width:18px; }
 .game-screen .player-meld-zone > small { font-size:9px; }
 .game-screen .river--0 { margin-bottom:0; }
 .game-screen .rivers { grid-template-columns:minmax(0,1fr) 62px minmax(0,1fr);grid-template-rows:minmax(48px,1fr) 88px minmax(48px,1fr);gap:6px; }
 .game-screen .river { padding:12px 2px 8px;overscroll-behavior:contain;transform:none; }
 .game-screen .river-label { font-size:9px; }
 .game-screen .reaction-panel { left:0;right:0;bottom:calc(100% + 42px);padding:6px;gap:5px; }
 .game-screen button { touch-action:manipulation; }
 .game-screen .seat-copy { height:auto;padding:2px 3px; }
 .game-screen .seat-copy b { font-size:10px; }
 .game-screen .seat-copy > span { font-size:8px; }
 .game-screen .seat--1 .seat-copy,.game-screen .seat--3 .seat-copy { width:40px;max-width:40px; }
 .game-screen .seat-copy b,.game-screen .seat-copy > span { white-space:normal;overflow-wrap:anywhere; }
 .game-screen .back-row { min-height:0; }
 .game-screen .seat--2 .back-row > .tile-back { --tile-width:18px;margin:0; }
 .game-screen .seat--1 .back-row > .tile-back,.game-screen .seat--3 .back-row > .tile-back { --tile-width:9px;margin:0; }
 .game-screen .table-message { top:calc(50% + 28px);font-size:8px; }
 .game-screen .table-seal { width:54px;height:48px; }
 .game-screen .round-readout { font-size:9px;gap:3px; }
 .game-screen .game-tools { gap:4px; }
 .game-screen .game-tools button { min-height:32px; }
 .modal { max-height:calc(100dvh - 24px);overflow:auto; }
}
@media (max-height:500px) and (max-width:1100px) and (orientation:landscape) {
 .game-screen .gamebar { flex-basis:40px;min-height:40px; }
 .game-screen .game-layout::before,.game-screen .game-layout::after { inset:0 30px 65px; }
 .game-screen .game-table { grid-template-columns:100px minmax(0,1fr) 100px;grid-template-rows:50px minmax(0,1fr) 20px; }
 .game-screen .player-console { left:12%;right:12%;height:96px;bottom:3px; }
 .game-screen .hand-scroll { top:18px; }
 .game-screen .player-hand { min-height:46px;padding:0 0 4px;gap:2px; }
 .game-screen .player-hand .tile-button { width:32px;max-width:32px;height:42px; }
 .game-screen .console-footer { top:66px; }
 .game-screen .player-meld-zone { height:26px;bottom:calc(100% + 3px); }
 .game-screen .player-meld-zone .tile-art { --tile-width:17px; }
 .game-screen .rivers { grid-template-columns:minmax(0,1fr) 64px minmax(0,1fr);grid-template-rows:46px minmax(54px,1fr) 46px;gap:4px; }
 .game-screen .seat--2 .back-row > .tile-back { --tile-width:11px; }
 .game-screen .seat--1 .seat-copy,.game-screen .seat--3 .seat-copy { width:75px;max-width:75px; }
 .game-screen .seat--1 .back-row > .tile-back,.game-screen .seat--3 .back-row > .tile-back { --tile-width:8px; }
 .game-screen .reaction-panel { left:5%;right:5%;bottom:calc(100% + 34px);grid-template-columns:42px minmax(0,1fr) 34px;padding:4px 8px; }
 .game-screen .reaction-panel .action-button { min-height:38px;min-width:48px;font-size:16px; }
 .game-screen .reaction-heading { display:none; }
 .game-screen .reaction-tile .tile-art { --tile-width:24px; }
 .game-screen .reaction-clock { width:32px;height:32px; }
}
@media (max-height:350px) and (max-width:1100px) and (orientation:landscape) {
 .game-screen .rivers { grid-template-rows:40px 46px 40px; }
 .game-screen .river { padding:8px 2px 6px; }
}
