/* Lifecycle and orientation guard. Visual lobby styles live in maze-comic.css. */
[hidden],#opening-screen[hidden],#rotate-screen[hidden],#game-stage[hidden]{display:none!important}
#game-stage{height:100vh;height:100dvh}
#opening-screen,#rotate-screen{position:fixed;inset:0;width:100%;height:100vh;height:100dvh;font-family:"Avenir Next","PingFang SC","Microsoft YaHei",sans-serif;-webkit-tap-highlight-color:transparent}
#opening-screen{z-index:20;display:flex;flex-direction:column;overflow:auto;overscroll-behavior:contain}
.opening-scenery{position:fixed;inset:0;overflow:hidden;pointer-events:none}
.opening-shell{position:relative;z-index:1;margin:auto}
#enter-game{touch-action:manipulation}#enter-game:disabled{cursor:wait;opacity:.72}
#opening-retry{touch-action:manipulation}#opening-error,.opening-noscript{overflow-wrap:anywhere}
body.game-loading #enter-game::after{content:"";width:20px;height:20px;flex-shrink:0;border:3px solid currentColor;border-right-color:transparent;border-radius:50%;animation:opening-spin .9s linear infinite}
body.game-loading .enter-arrow{display:none}body.game-running #opening-screen{display:none}
#rotate-screen{z-index:10000;display:grid;place-items:center;padding:max(28px,env(safe-area-inset-top)) max(28px,env(safe-area-inset-right)) max(28px,env(safe-area-inset-bottom)) max(28px,env(safe-area-inset-left));text-align:center;overflow-y:auto;outline:none}
body.needs-landscape dialog[open],body.needs-landscape dialog[open]::backdrop{visibility:hidden}
body.needs-landscape #opening-screen,body.needs-landscape #game-stage{visibility:hidden}
@keyframes opening-spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){body.game-loading #enter-game::after{animation:none}}
/* A native dialog must not obscure the orientation gate from its top layer. */
body.needs-landscape dialog,body.needs-landscape dialog::backdrop{visibility:hidden!important}
body.needs-landscape dialog::backdrop{background:transparent!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
/* v8: fullscreen needs a real user gesture; this gate never fabricates success. */
#landscape-resume{min-width:160px;min-height:48px;margin:20px auto 0;padding:10px 22px;border:2px solid #11101b;border-radius:7px;background:#ffe337;color:#11101b;font-size:15px;box-shadow:3px 4px 0 #11101b;touch-action:manipulation}
#landscape-resume:focus-visible{outline:3px solid #f04d91;outline-offset:4px}
@media(max-height:430px){#landscape-resume{margin-top:12px;min-height:44px}.rotate-content .rotate-symbol{margin-bottom:10px}}
