/* The player uses the visible browser area, including Safari's expanded bars.
   Keep this after the legacy/theme styles: no game may impose a minimum iframe height. */
html:has(body.pg-game){height:100%;overflow:hidden;scroll-behavior:auto}
body.pg-game.redesign-legacy{display:flex;flex-direction:column;height:100vh;height:var(--player-height,100dvh);min-height:0;max-height:var(--player-height,100dvh);overflow:hidden;overscroll-behavior:none}
body.pg-game.redesign-legacy .site-header{flex:0 0 auto;padding-top:env(safe-area-inset-top)}
body.pg-game.redesign-legacy .main{display:flex;flex-direction:column;flex:1 1 0;height:auto;min-height:0;max-height:none;width:100%;max-width:none;margin:0;padding:6px max(8px,env(safe-area-inset-right)) max(6px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left))}
body.pg-game.redesign-legacy .game-layout{display:flex;flex:1 1 0;flex-wrap:nowrap;min-height:0;width:100%}
body.pg-game.redesign-legacy .game-stage{display:flex;flex-direction:column;flex:1 1 0;min-width:0;min-height:0;padding:0;border:0;border-radius:0;overflow:hidden}
body.pg-game.redesign-legacy .game-frame-wrap{position:relative;flex:1 1 0;min-width:0;min-height:0;width:100%;height:auto;max-height:none;margin:5px 0 0;border:0;overflow:hidden;order:0}
body.pg-game.redesign-legacy .game-frame{position:absolute;inset:0;display:block;width:100%;height:100%;min-width:0;min-height:0;max-width:100%;max-height:100%;border:0}
body.pg-game.redesign-legacy .game-actions{display:flex;align-items:center;flex-wrap:wrap;flex:0 0 auto;gap:6px;margin:0;padding:0}
body.pg-game.redesign-legacy .game-actions button{min-height:34px;padding:5px 11px;line-height:1.2;font-size:12px}
body.pg-game.redesign-legacy #g-title,body.pg-game.redesign-legacy .g-desc,body.pg-game.redesign-legacy .g-review,body.pg-game.redesign-legacy .g-tip{display:none}
body.pg-game.redesign-legacy .g-ext-note{flex:0 0 auto;max-height:64px;overflow:auto;font-size:11px;margin:4px 0 0}
body.pg-game.redesign-legacy .site-footer{display:none}
body.pg-game.redesign-legacy .play-help{max-height:calc(var(--player-height,100dvh) - 24px);overflow:auto;overscroll-behavior:contain}
.player-status{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
/* Use the actual available height rather than a device-width assumption. */
body.pg-game.player-compact .header-inner{height:34px;min-height:0;width:100%;padding:0 max(12px,env(safe-area-inset-right)) 0 max(12px,env(safe-area-inset-left))}
body.pg-game.player-compact .header-nav>a,body.pg-game.player-compact .nav-burger{display:none}
body.pg-game.player-compact .brand-text{font-size:17px}
body.pg-game.player-compact .logo svg{width:22px;height:22px}
body.pg-game.player-compact .main{padding-top:2px;padding-bottom:max(3px,env(safe-area-inset-bottom))}
body.pg-game.player-compact .game-actions button{min-height:30px;padding:4px 11px}
body.pg-game.player-compact .game-side{display:none}
@media(max-width:1100px){body.pg-game.redesign-legacy .game-side{display:none}}
/* Fullscreen the stage, not only the iframe, so Exit/Help/Restart remain reachable.
   The CSS mode is also used if native fullscreen is missing or rejected. */
body.pg-game.player-expanded .site-header{display:none}
body.pg-game.player-expanded .game-side{display:none}
body.pg-game.player-expanded .game-stage{position:fixed;z-index:1000;left:var(--player-left,0px);top:var(--player-top,0px);width:var(--player-width,100vw);height:var(--player-height,100dvh);max-width:none;max-height:none;margin:0;background:#101b24;padding:max(3px,env(safe-area-inset-top)) max(4px,env(safe-area-inset-right)) max(4px,env(safe-area-inset-bottom)) max(4px,env(safe-area-inset-left))}
body.pg-game.player-expanded .game-frame-wrap{border-radius:0;margin-top:3px}
body.pg-game.player-expanded .g-ext-note{display:none}
body.pg-game.player-expanded .game-actions button{background:#eef2e7;color:#18382f;border:1px solid #c6d1bd;min-height:30px}
body.pg-game.redesign-legacy .game-stage:fullscreen{position:fixed;inset:0;width:100%;height:100%;max-height:none;background:#101b24}
body.pg-game.redesign-legacy .game-stage:-webkit-full-screen{position:fixed;inset:0;width:100%;height:100%;max-height:none;background:#101b24}
