/* Full-viewport play mode within the installed app/browser. No OS fullscreen required. */
.game-exit{display:none}
.game-mode-toggle[hidden]{display:none!important}
.retro-titlebar .game-mode-toggle{padding:5px 10px;min-height:28px;white-space:nowrap;margin:0;flex:none}
body.immersive-game{overflow:hidden}
body.immersive-game>.top,body.immersive-game>.retro-menubar,body.immersive-game>.conhya-toolbar,body.immersive-game>.footer{display:none!important}
body.immersive-game #portal-view:not([hidden]){position:fixed!important;inset:0!important;z-index:900;width:100%!important;height:100vh!important;height:100dvh!important;min-height:0!important;max-height:none!important;border:0!important;margin:0!important;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)!important;background:#151f2e!important;display:flex!important;flex-direction:column!important;box-sizing:border-box}
body.immersive-game #portal-view>.content,body.immersive-game #desktop-icons,body.immersive-game #kids-quickbar{display:none!important}
body.immersive-game #retro-desktop{position:relative!important;inset:auto!important;flex:1 1 0!important;width:100%!important;min-height:0!important;overflow:hidden!important}
body.immersive-game #retro-desktop>.retro-window:not(.immersive-frame){display:none!important}
body.immersive-game #retro-desktop>.immersive-frame{inset:0!important;left:0!important;top:0!important;width:100%!important;height:100%!important;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;border:0!important;border-radius:0!important;resize:none!important;box-shadow:none!important;display:flex!important}
body.immersive-game .immersive-frame>.retro-titlebar{height:auto;min-height:48px;padding:5px 12px;gap:10px;cursor:default;background:linear-gradient(#334a66,#192d45);border-bottom:1px solid #6b86a3}
body.immersive-game .immersive-frame .retro-window-title{font-size:clamp(15px,2vw,22px);color:#f1f6ff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
body.immersive-game .immersive-frame .retro-window-controls,body.immersive-game .immersive-frame .retro-window-foot,body.immersive-game .immersive-frame .channel-back{display:none!important}
body.immersive-game .immersive-frame .game-exit{display:inline-flex;align-items:center;justify-content:center;flex:none;min-height:42px;padding:8px 16px;margin:0;border:1px solid #a9bcd5;border-radius:8px;background:#324e71;color:#fff;font-size:16px;font-weight:bold}
body.immersive-game .immersive-frame .game-mode-toggle{min-height:42px;font-size:14px}
body.immersive-game .immersive-frame>.retro-window-content{flex:1 1 0;min-height:0;min-width:0;overflow:auto;overscroll-behavior:contain;padding:clamp(5px,1vw,14px);background:#182536}
body.immersive-game .immersive-frame .tile{min-width:0;width:100%;max-width:none;margin:0;border:0;box-shadow:none;box-sizing:border-box}
body.immersive-game .immersive-frame .arcade-channel{background:#182536;color:#f0f5ff;padding:clamp(6px,1.3vw,16px)!important}
body.immersive-game .immersive-frame .arcade-channel :is(#game-name,.arcade-player-top span,.arcade-player-controls span,.arcade-instructions,.arcade-section-heading h3){color:#e0edff}
body.immersive-game .immersive-frame .arcade-player-top button{min-height:40px}
body.immersive-game .immersive-frame .arcade-board{max-width:var(--board-limit,1120px)}
body.immersive-game .immersive-frame #game-canvas{max-width:100%}
body.immersive-game .immersive-frame .arcade-card{min-height:150px}
body.immersive-game .immersive-frame .arcade-cards,body.immersive-game .immersive-frame .learning-cards{grid-template-columns:repeat(auto-fit,minmax(min(100%,180px),1fr))}
body.immersive-game .immersive-frame .game-readable{margin:4px 0;padding:7px 10px}
body.immersive-game .immersive-frame .arcade-player-controls{margin:4px 0}
body.immersive-game .immersive-frame #game-start{background:#3265a6;color:#fff;font-weight:bold;min-height:44px}
body.immersive-game .immersive-frame .realm-shell{max-width:1400px;margin:auto}
body.immersive-game .immersive-frame .color-paper{max-width:min(100%,1000px)}
@media(max-height:500px) and (orientation:landscape){
 body.immersive-game .immersive-frame>.retro-titlebar{min-height:36px;padding:2px 8px}
 body.immersive-game .immersive-frame .game-exit,body.immersive-game .immersive-frame .game-mode-toggle{min-height:34px;padding:5px 10px}
 body.immersive-game .immersive-frame .arcade-board{max-width:var(--board-limit,860px)}
}

/* Maximize the shell, not the typography or every channel's reading surface.
   Native Navigator's dock must remain the entire available viewport. */
@media(min-width:701px) and (pointer:fine){
 html:not(.touch-device) .retro-window.maximized:not(.immersive-frame):not(.navigator-docked)>.retro-window-content>:is(.view,.tile,#welcome-workspace){
   width:100%;max-width:var(--channel-reading-width,1024px);margin-inline:auto;min-width:0;box-sizing:border-box;
 }
 html:not(.touch-device) .retro-window.maximized:not(.immersive-frame)>.retro-window-content>.view>.tile{max-width:100%;min-width:0;box-sizing:border-box}
 /* Game play can use the same larger viewport as full screen, but
    Discover retains a normal storefront width. */
 html:not(.touch-device) .retro-window.maximized:not(.immersive-frame)[data-window-id="games"]>.retro-window-content>.view{max-width:1100px}
 html:not(.touch-device) .retro-window.maximized:not(.immersive-frame)[data-window-id="games"]>.retro-window-content>.view:has(#arcade-play:not([hidden])){max-width:1200px}
 html:not(.touch-device) .retro-window.maximized:not(.immersive-frame)[data-window-id="games"] .arcade-board{max-width:min(100%,var(--board-limit,1120px))}
 html:not(.touch-device) .retro-window.maximized:not(.immersive-frame)[data-window-id="games"] #game-canvas{height:auto;max-width:100%}
 html:not(.touch-device) .retro-window.maximized:not(.immersive-frame)[data-window-id="realm"]>.retro-window-content>.view{max-width:1400px}
 html:not(.touch-device) .retro-window.maximized:not(.immersive-frame):is([data-window-id="racing"],[data-window-id="homestead"],[data-window-id="aquarium"],[data-window-id="color-studio"],[data-window-id="world-detective"])>.retro-window-content>.view{max-width:1100px}
}
