/* Some mobile browsers cannot rotate the window. Rotate the game surface on
   portrait phones and use genuine landscape coordinates as soon as they turn. */
html.game-landscape-compact{
 overflow:hidden;overscroll-behavior:none;background:#281913;
}
.game-landscape-compact body.immersive{
 --safe-l:env(safe-area-inset-left,0px);--safe-r:env(safe-area-inset-right,0px);
 --safe-t:env(safe-area-inset-top,0px);--safe-b:env(safe-area-inset-bottom,0px);
 position:fixed;top:0;left:0;inline-size:var(--game-view-w);block-size:var(--game-view-h);
 padding:var(--safe-t) var(--safe-r) var(--safe-b) var(--safe-l);
 display:grid;grid-template-rows:auto minmax(0,1fr);overflow:hidden;
}
.game-landscape-rotated body.immersive{
 --safe-l:env(safe-area-inset-top,0px);--safe-r:env(safe-area-inset-bottom,0px);
 --safe-t:env(safe-area-inset-right,0px);--safe-b:env(safe-area-inset-left,0px);
 transform-origin:top left;
 /* Translate by the same box height that is rotated, not a separate
    visualViewport width that Safari may report in the old orientation. */
 box-sizing:border-box;
 transform:rotate(90deg) translateY(-100%);
}
.game-landscape-compact .immersive .heading{display:none}
.game-landscape-compact .immersive .top{padding:2px 6px;gap:4px;min-width:0}
.game-landscape-compact .immersive .top .ghost{
 display:inline-flex;align-items:center;min-height:28px;padding:2px 7px;
 font-size:.76rem;white-space:nowrap;
}
.game-landscape-compact .immersive .brand{white-space:nowrap;font-size:.66rem;gap:5px}
.game-landscape-compact .immersive .brand b{padding:3px 5px}
.game-landscape-compact .immersive .nav{gap:4px;min-width:0}
.game-landscape-compact .immersive main{
 display:flex;flex-direction:column;min-height:0;width:100%;max-width:1560px;
 padding:2px 4px 3px;
}
.game-landscape-compact .immersive #notice{flex:0 0 auto;margin:0 auto 2px;padding:1px 6px;font-size:.72rem}
.game-landscape-compact .immersive .scene-3d{
 --wall-h:clamp(8px,calc(var(--game-view-h)*.033),16px);
 --edge-col:12%;--wall-col:3.5%;
 --back-w:clamp(9px,calc(var(--game-view-w)*.018),17px);
 --op-meld:clamp(11px,calc(var(--game-view-h)*.036),18px);
 width:100%;min-height:0;height:auto;flex:1 1 0;aspect-ratio:auto;
 grid-template-rows:auto var(--wall-h) minmax(0,1fr) var(--wall-h) auto;
 gap:2px 3px;border-radius:9px;padding:4px 3.2% 5px;
}
.game-landscape-compact .scene-3d .center{padding:0}
.game-landscape-compact .scene-3d .center .plaque{margin:0 0 2px;font-size:.69rem;padding:0 6px 0 1px}
.game-landscape-compact .scene-3d .center .plaque .mark{padding:0 3px}
.game-landscape-compact .scene-3d .bot b{font-size:.74rem;line-height:1.1}
.game-landscape-compact .scene-3d .bot small{font-size:.62rem;line-height:1.1}
.game-landscape-compact .scene-3d .bot-2 b,.game-landscape-compact .scene-3d .bot-2 small{display:inline;margin-inline:2px}
.game-landscape-compact .scene-3d .backs{gap:2px;margin:1px 0;padding:1px 2px 3px}
.game-landscape-compact .scene-3d .bot-2 .backs i{height:clamp(8px,calc(var(--game-view-h)*.033),14px)}
.game-landscape-compact .scene-3d .bot-1 .backs i,.game-landscape-compact .scene-3d .bot-3 .backs i{flex-basis:5px;height:5px}
.game-landscape-compact .scene-3d .bot-1 .backs,.game-landscape-compact .scene-3d .bot-3 .backs{max-width:100%;padding-inline:3px}
.game-landscape-compact .scene-3d .player{padding:1px 2px 0}
.game-landscape-compact .scene-3d .player-head{margin:0;font-size:.74rem;min-height:0}
.game-landscape-compact .scene-3d .seat-title{font-size:.74rem;line-height:1.15}
.game-landscape-compact .scene-3d .player-head .flowers-tray{position:absolute;left:3px;top:0;margin:0}
.game-landscape-compact .scene-3d .flowers-tray{margin-block:0;padding:0 2px}
.game-landscape-compact .scene-3d .flowers-tray .flower-tile{
 --w:clamp(10px,calc(var(--game-view-h)*.039),17px);
 --side:2px;--base:2px;
}
.game-landscape-compact .scene-3d .bot-2 .flowers-tray{display:inline-flex;margin-inline:5px;vertical-align:middle}
.game-landscape-compact .scene-3d .player .hand{flex-wrap:nowrap;gap:2px;padding:2px 0 3px}
.game-landscape-compact .scene-3d .player .hand .tile{
 --w:clamp(19px,min(calc(var(--game-view-w)*.043),calc(var(--game-view-h)*.105)),42px);
}
.game-landscape-compact .scene-3d .player .melds{margin:1px 0 0;gap:4px}
.game-landscape-compact .scene-3d .move{min-height:23px;gap:1px 4px}
.game-landscape-compact .scene-3d .move #status{font-size:.71rem;line-height:1.1}
.game-landscape-compact .scene-3d .actions .action{min-height:25px;padding:2px 6px;font-size:.74rem}
.game-landscape-compact .turn-clock{font-size:.74rem;min-width:45px;padding:2px 4px}
.game-landscape-compact .immersive footer{flex:0 0 auto;padding:2px 2px 0;gap:4px;font-size:.71rem;min-width:0}
.game-landscape-compact .immersive footer #log{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.game-landscape-compact .immersive footer .ghost{min-height:25px;padding:2px 6px;font-size:.72rem}

/* Native modal dialogs live in the top layer, outside the rotated body. */
.game-landscape-compact dialog{
 width:min(calc(var(--game-view-w) - 36px),530px);max-height:calc(var(--game-view-h) - 24px);
 padding:12px 16px;overscroll-behavior:contain;
}
.game-landscape-rotated dialog[open]{
 position:fixed;inset:auto;
 left:calc(var(--game-physical-w)*.5);top:calc(var(--game-physical-h)*.5);
 margin:0;transform:translate(-50%,-50%) rotate(90deg);
}
.game-landscape-compact .immersive .scene-3d{
 --wall-h:clamp(7px,calc(var(--game-view-h)*.024),13px);
}
.game-landscape-compact .immersive .scene-3d .player .hand .tile{
 --w:clamp(15px,min(calc(var(--game-view-w)*.040),calc(var(--game-view-h)*.081)),38px);
 height:calc(var(--w)*1.28);
}
.game-landscape-compact .scene-3d .player-head .flowers-tray{position:static;margin:0 5px}
.game-landscape-compact .scene-3d .player .move{min-height:23px}
