body{overflow-y:auto}#app-container{min-height:100dvh;height:auto;overflow:visible}.screen{position:relative;height:auto;min-height:100dvh;padding:max(20px,env(safe-area-inset-top)) max(20px,env(safe-area-inset-right)) max(20px,env(safe-area-inset-bottom)) max(20px,env(safe-area-inset-left));gap:16px}.screen[hidden]{display:none}#main-menu{padding-top:max(28px,env(safe-area-inset-top));padding-bottom:max(32px,env(safe-area-inset-bottom))}.header-bar{width:min(100%,520px);align-self:center;flex-shrink:0;margin:0}.arcade-label{color:var(--text-muted);font-size:11px;letter-spacing:2px;font-weight:600}.logo-avatar .icon{width:40px;height:40px;color:#fff}.game-subtitle{margin-top:8px;line-height:1.5}.personal-best{color:var(--text-muted);font-size:13px;margin-top:12px}.personal-best strong{color:var(--text-color)}.menu-bottom{align-self:center}.game-heading{text-align:center}.game-heading h1{font-size:21px}.game-heading p{font-size:11px;color:var(--text-muted);margin-top:4px}#game-screen{justify-content:flex-start;gap:12px}.play-area{display:flex;justify-content:center;width:100%;margin:auto 0}.arena{width:min(100%,440px,max(200px,calc(100dvh - 340px)));aspect-ratio:1;position:relative;background:#171e2c;border:8px solid #171e2c;border-radius:20px;touch-action:none}.arena *{touch-action:none}.tiles{height:100%;display:grid;grid-template-columns:repeat(var(--cols),1fr);grid-template-rows:repeat(var(--rows),1fr)}.tile{margin:2px;border-radius:5px;background:#232d3e;display:grid;place-items:center;color:#7d8a9e;font-size:22px}.tile.wall{background:#546073;border:2px solid #667387}.tile.spent{background:#1b2433}.tile.exit{background:#164b3e;color:#7ce6b1;font-weight:700}.actor{position:absolute;width:calc(100% / var(--cols));height:calc(100% / var(--rows));display:grid;place-items:center;pointer-events:none;transition:left .14s ease,top .14s ease}.actor>span{width:65%;height:65%;display:flex;align-items:center;justify-content:center}.player{z-index:3}.player>span{border-radius:50%;background:#6bafff;color:#132d50;font-size:14px;border:2px solid #c4dfff}.ghost{z-index:2}.ghost>span{background:#f4b36c;opacity:.85;border-radius:45% 45% 15% 15%;clip-path:polygon(0 0,100% 0,100% 100%,75% 80%,50% 100%,25% 80%,0 100%);gap:15%}.ghost i{width:13%;height:20%;background:#492c18;border-radius:50%}.player-key{color:#3784dd}.ghost-key{color:#b77532}.exit-key{color:#158260}.direction-pad{align-self:center;display:grid;grid-template-columns:repeat(3,52px);grid-template-rows:repeat(2,48px);gap:6px}.direction{font-size:24px}.direction.up{grid-column:2}.direction.left{grid-column:1;grid-row:2}.direction.down{grid-column:2;grid-row:2}.direction.right{grid-column:3;grid-row:2}.direction[data-blocked=true]{color:var(--text-muted)}button:disabled{opacity:.45;cursor:default}.invalid{animation:nudge .18s ease}@keyframes nudge{25%{transform:translate(-3px)}75%{transform:translate(3px)}}.result-panel{text-align:center;align-self:center;width:min(100%,440px)}.result-panel h2{font-size:20px}.result-panel p{margin:6px 0 14px;font-size:13px;color:var(--text-muted)}.result-actions{display:flex;gap:10px}.result-actions button{min-height:48px;flex:1;font-size:14px}.instructions{line-height:1.9;font-size:16px}.help-note{color:var(--text-muted);font-size:13px;line-height:1.6;margin:18px 0}.full-button{width:100%;min-height:48px}.storage-warning{position:fixed;bottom:8px;left:12px;right:12px;background:var(--surface);color:var(--text-muted);border:1px solid var(--line);border-radius:12px;padding:10px;font-size:12px;z-index:5}@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important}}@media(max-width:350px){.screen{padding-left:12px;padding-right:12px}.game-title{font-size:40px}}.hazard{z-index:4}.hazard>span{width:44%;height:44%;background:#f77681;color:#491a24;border:2px solid #ffc2c8;transform:rotate(45deg);font-size:12px;font-weight:900}.hazard-next{z-index:1}.hazard-next>span{width:42%;height:42%;border:2px dashed #ff9aa4;transform:rotate(45deg)}.hazard-route{pointer-events:none}.route-mark{position:absolute;width:calc(100% / var(--cols));height:calc(100% / var(--rows));display:flex;align-items:flex-end;justify-content:flex-end;padding:3px 5px;color:#d58b96;font-size:11px}.hazard-key{color:#bc4257}#main-menu>.header-bar{justify-content:space-between}.ghost-next{z-index:1;transition:none}.ghost-next>span{width:70%;height:70%;border:2px dashed #f4b36c;border-radius:40% 40% 15% 15%;opacity:.7}.hazard-next{transition:none}.hazard b{transform:rotate(-45deg);font-size:12px}.offline-status{color:var(--text-muted);font-size:11px;min-height:16px;text-align:center}.update-button{min-height:44px;font-size:13px;padding:10px}#game-screen{padding-bottom:max(12px,env(safe-area-inset-bottom))}.tile.spent{border:1px solid #384255;color:#94a3b8}.arena:focus:not(:focus-visible){outline:none}@media(max-height:650px){.screen{gap:8px;padding-top:max(12px,env(safe-area-inset-top))}#game-screen{gap:8px}.arena{width:min(100%,440px,max(200px,calc(100dvh - 305px)))}.menu-bottom{gap:4px}}.undo-button{min-height:44px;min-width:150px;gap:10px;align-self:center;font-size:13px;padding:8px 16px}.undo-button>span:first-child{font-size:22px}.undo-count{font-variant-numeric:tabular-nums;color:var(--text-muted);font-size:12px}.ghost-arrows{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;pointer-events:none;z-index:5;overflow:visible}.ghost-arrows line{stroke:#f4b36c;stroke-width:.055;stroke-linecap:round}.ghost-arrows .finishing{opacity:.6}.arena{width:min(100%,440px,max(200px,calc(100dvh - 390px)))}@media(max-height:650px){.arena{width:min(100%,440px,max(200px,calc(100dvh - 355px)))}}#main-menu>.header-bar{justify-content:flex-end;gap:12px}#main-menu{padding-top:max(24px,env(safe-area-inset-top));padding-bottom:max(28px,env(safe-area-inset-bottom))}.record-total{font-size:42px;font-weight:800;letter-spacing:-1px}.record-total span{font-size:13px;font-weight:500;letter-spacing:0;color:var(--text-muted)}#player-nickname{user-select:text;-webkit-user-select:text}[hidden]{display:none!important}.menu-bottom .offline-status:empty{display:none}[data-theme=dark] .player-key{color:#6bafff}[data-theme=dark] .ghost-key{color:#f4b36c}[data-theme=dark] .exit-key{color:#7ce6b1}[data-theme=dark] .hazard-key{color:#ff9aa4}.header-bar{width:100%;align-self:stretch}.game-heading{flex:1;min-width:0}#main-menu>.header-bar{width:100%}.undo-button{position:relative;min-width:0;width:48px;height:48px;padding:0;border-radius:14px}.undo-count{position:absolute;right:-3px;top:-3px;border-radius:50%;background:var(--primary);color:#fff;width:20px;height:20px;font-size:11px;display:grid;place-items:center}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}@media(min-width:760px){.screen{padding:32px 48px}#main-menu{padding:36px 48px}}*:focus,*:focus-visible{outline:none!important;box-shadow:none!important}*{-webkit-tap-highlight-color:transparent}.tile.exit{background:#123c32;border:1px solid #387f64;color:#8ce8b9}.goal-icon{width:74%;height:82%}#game-screen>.header-bar{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:8px}#game-screen>.header-bar>button{justify-self:start}.escape-counter{display:flex;align-items:baseline;justify-content:center;gap:6px;white-space:nowrap}.escape-counter strong{font-size:24px;font-weight:800;font-variant-numeric:tabular-nums}.escape-counter span{font-size:12px;color:var(--text-muted)}.stage-actions{display:flex;justify-self:end;align-items:center;gap:8px}.arena{width:min(100%,440px,max(200px,calc(100dvh - 220px)))}#game-screen>.direction-pad{margin-bottom:8px}.neu-btn:not(.neu-btn-primary):focus{border-color:var(--line)}.board-zone{width:min(100%,440px,max(200px,calc(100dvh - 285px)));display:flex;flex-direction:column;align-items:center;gap:16px}.board-zone .arena{width:100%}.board-zone .undo-button{flex-shrink:0}.tutorial-dialog{width:min(420px,calc(100% - 32px));text-align:center}.tutorial-progress{font-size:11px;color:var(--text-muted);margin-bottom:6px}.tutorial-dialog h3{font-size:20px;margin-bottom:8px}.tutorial-copy{font-size:13px;line-height:1.5;color:var(--text-muted);margin-bottom:14px}.tutorial-board{display:flex;justify-content:center}.tutorial-board .arena{width:min(100%,250px,max(170px,calc(100dvh - 350px)))}.tutorial-feedback{min-height:24px;margin:10px 0;font-size:12px;color:var(--text-muted)}.tutorial-controls{display:flex;justify-content:center;gap:8px}.tutorial-controls button{font-size:24px}.tutorial-actions{display:flex;flex-direction:column;gap:6px;margin-top:12px}.tutorial-actions .neu-btn{min-height:44px}
