html.game-viewport, html.game-viewport body {
 width:100%; height:100%; margin:0; overflow:hidden; overscroll-behavior:none;
}
.game-viewport #app {
 display:flex; flex-direction:column; align-items:stretch; width:100%; max-width:none;
 height:100vh; height:100dvh; min-height:0; margin:0; overflow:hidden;
}
.game-viewport #app > #main { flex:1 1 0; min-width:0; min-height:0; }
.game-viewport #app > :is(.site-header,.footer,footer) { display:none; }
.game-viewport #app > #main.wrap {
 width:100%; max-width:none; margin:0; overflow:auto; overscroll-behavior:contain;
 padding:max(6px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left));
}
.game-viewport :is(#roomPage:not([data-mj-screen]),#reelPK) > .rb-page {
 width:100%; max-width:none; min-height:100%; margin:0 auto;
}
.game-viewport :is(#roomPage,#reelPK) .rb-page > nav,
.game-viewport :is(#gameSwitch,#admission) > nav { display:flex; align-items:center; justify-content:space-between; }
.game-viewport :is(#gameSwitch,#admission) { min-height:100%; display:flex; flex-direction:column; gap:8px; }
.game-viewport :is(#gameSwitch,#admission) .game-switch-card { flex:1; width:100%; max-width:none; margin:0; }
.game-viewport :is(#gameSwitch,#admission) .game-switch-card > img { align-self:stretch; object-fit:cover; }
.game-viewport button[data-game-fullscreen] {
 display:inline-grid; flex:0 0 auto; place-items:center; box-sizing:border-box; width:44px; height:44px; min-width:44px;
 padding:0; border:1px solid #6d806f; border-radius:9px; background:#172e27; color:#f8efd7; cursor:pointer; touch-action:manipulation;
}
.game-viewport button[data-game-fullscreen] svg { width:19px; height:19px; }
.game-viewport button[data-game-fullscreen]:focus-visible { outline:2px solid #ffdb89; outline-offset:2px; }
.game-viewport [data-mj-screen] [data-game-fullscreen] { display:none; }

/* On browsers without an orientation lock, turn the whole interface, including dialogs.
   All pointer targets stay in the same transformed tree as their painted controls. */
html[data-table-orientation="landscape"] #app {container:game-screen / size;}
/* Rotate only when the physical viewport is strictly taller than it is wide. */
@media not all and (min-aspect-ratio: 1/1) {
 html[data-table-orientation="landscape"] body {
  position:absolute; left:0; top:0; width:100vh; width:100dvh; height:100vw; height:100dvw;
  transform-origin:0 0; transform:translateX(100vw) rotate(90deg); transform:translateX(100dvw) rotate(90deg);
 }
 html[data-table-orientation="landscape"] #app {width:100%;height:100%;}
 html[data-table-orientation="landscape"] #overlay .modal-cover {
  align-items:center; justify-content:center; box-sizing:border-box; width:100%; height:100%;
  padding:max(6px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(6px,env(safe-area-inset-left)) max(8px,env(safe-area-inset-top));
 }
 html[data-table-orientation="landscape"] #overlay .modal {
  width:min(100%,650px); max-height:100%; margin:0; border-radius:14px; overflow:auto; overscroll-behavior:contain;
 }
 html[data-table-orientation="landscape"] #toast {max-width:90%;bottom:max(10px,env(safe-area-inset-left));}
}

/* Safari keeps the document anchored; long player screens scroll inside the app. */
html.ios-player:not(.game-viewport):not(.in-fishery) #app:not([hidden]):not(:has(> .pavilion-lobby)) {
 max-height:100%; overflow:auto; overscroll-behavior:none;
}
html.ios-player:not(.game-viewport) #app:has(> .pavilion-lobby) {
 height:100%; min-height:0; overflow:hidden;
}
html.ios-player :is(.pv-gallery,.pv-tabs,.pv-menu-panel,#overlay .modal) { overscroll-behavior:none; }

.game-viewport #gameSheet > [data-game-fullscreen] {display:none;}
.game-viewport.in-fishery #gameSheet > [data-game-fullscreen] {
 display:grid; position:absolute; z-index:2; top:17%; left:max(3px,.55%); width:clamp(32px,4vw,44px); min-width:0; height:auto; aspect-ratio:1;
 border-color:#b4dbcf65; background:#06292bd9; color:#e2f8eb;
}
.game-viewport.in-fishery #roomBar { display:none; }
.game-viewport.in-fishery #gameSheet:has([data-act="fishLeave"]) > [data-game-fullscreen] {
 top:auto; left:auto; right:1%; bottom:51%;
}
