/* Full-bleed play, with controls designed for two thumbs. */
:root{--app-height:100vh;--safe-top:env(safe-area-inset-top,0px);--safe-bottom:env(safe-area-inset-bottom,0px)}
@supports(height:100dvh){:root{--app-height:100dvh}}
#world{width:100%;height:var(--app-height);inset:0;touch-action:none}
#controlDeck{display:none}.nav #brief,.nav #cameraMode{width:auto;padding:0 12px;font-size:13px;font-weight:800}.nav #brief.active{background:#d26c4f}.nav #cameraMode[aria-pressed="true"]{background:#b7ecdc;color:#19283f}
#hudStats{display:flex;align-items:center;gap:8px;min-height:20px}#hudStats small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#hudStats #missionTime{font-size:12px;padding:2px 5px;background:#263d54;color:#ffdc99;white-space:nowrap}#hudCount{font-size:12px;color:#99e0cc;white-space:nowrap;font-weight:800}#hudStats #missionTime.urgent{background:#ab3f40;color:white}
#loading{text-align:center;padding:24px;gap:12px}#loading p{max-width:420px;line-height:1.6}#loading button{min-height:46px;padding:12px 20px;border:1px solid #e7be79;border-radius:10px;font-size:16px;font-weight:700}#loading details{max-width:90%;overflow-wrap:anywhere}#loading summary{padding:12px;cursor:pointer}#loading small{display:block;margin:10px 0}
#modal{max-height:calc(var(--app-height) - 32px)}#overlay:not(.title) #modal.profilePanel{max-height:calc(var(--app-height) - 28px)}
#waypoint{position:fixed;transform:translate(-50%,-100%);padding:5px 9px;background:#0c2d2bd9;border:1px solid #9ce0b7;border-radius:7px;color:#f0ffd4;font-size:11px;font-weight:800;white-space:nowrap;pointer-events:none;text-shadow:0 1px #000}#waypoint b{display:inline-block;margin-right:5px}#waypoint.offscreen{border-color:#ffce8c;color:#ffe3ac;background:#293445eb}
#missionStrip,#controlHints{display:none}#cameraReset{position:fixed;right:26px;top:162px;width:44px;height:44px;border:1px solid #ffffff70;background:#132c37b8;color:#fff5df;border-radius:50%;font-size:30px}
#touchUse .actionIcon{font-size:23px;font-weight:500;line-height:1.2}#touchUse.ready{border-color:#ffe9a4!important;background:#e1a63aef!important;color:#142e32!important;box-shadow:0 0 20px #ffc86055!important}.touchActions button:active{transform:scale(.92)}#joystick.engaged{border-color:#ffdf97!important;background:#182e44d9!important}
@media(max-width:700px),(pointer:coarse),(max-height:520px){
 :root{--hud-top:calc(54px + var(--safe-top));--deck:calc(80px + var(--safe-bottom))}
 #world{inset:0;width:100%;height:var(--app-height)}
 header{inset:0 0 auto;height:var(--hud-top);padding:calc(6px + var(--safe-top)) max(10px,env(safe-area-inset-right)) 6px max(10px,env(safe-area-inset-left));background:linear-gradient(#102833f0,#102833d9);gap:6px;border-bottom:1px solid #ffffff1a}header .brand{display:none}
 #missionName{background:transparent;color:#fff5df;text-align:left;padding:0;border:0;box-shadow:none;flex:1;min-width:0}#missionName strong{font-size:13px;line-height:1.25;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:2px}
 #hudStats{justify-content:flex-start;gap:5px;min-height:16px}#hudStats small{color:#b7d0db;font-size:10px;letter-spacing:1px}#hudCount{font-size:10px}.nav{gap:5px}.nav button,.nav #playerProfile{width:36px;height:40px;min-width:36px;border-radius:10px;font-size:18px;background:#26434dcc;border:1px solid #adc3c242;color:#f8f2df}.nav #brief,.nav #cameraMode{min-width:40px;padding:0 7px;font-size:12px}.nav #brief{background:#f6d48d;color:#19283f}.nav #sound{display:none}
 #guide,#score,#keyboardHelp{display:none}#missionStrip{display:block;position:fixed;left:12px;right:12px;top:calc(var(--hud-top) + 8px);padding:8px 11px;background:#102833c9;color:#fff4d7;border-left:3px solid #efc774;border-radius:5px;font-size:12px;line-height:1.4;max-height:52px;overflow:hidden;pointer-events:none}
 #controlDeck{display:block;position:fixed;inset:auto 0 0;height:calc(130px + var(--safe-bottom));background:linear-gradient(transparent,#0f273acd);pointer-events:none}
 body.touch #console,#console{bottom:calc(14px + var(--safe-bottom));left:max(14px,env(safe-area-inset-left));right:max(14px,env(safe-area-inset-right));transform:none;width:auto;padding:8px 9px;background:#132a3de8;box-shadow:0 3px 15px #0003;border:1px solid #abc6cd3d;backdrop-filter:none;border-radius:13px}
 .copyRow{height:17px;font-size:10px;gap:6px}.copyRow>span:not(:last-child),body.touch .copyRow>span:not(:last-child){padding:1px 5px}.copyRow #recordTime{font-size:10px}#timeline,body.touch #timeline{margin:4px 0 6px;height:2px}.actions{gap:6px}.actions kbd{display:none}.actions button,body.touch .actions button{min-height:40px;padding:7px 5px;font-size:12px;gap:4px;border-radius:8px}.actions button span{white-space:nowrap}
 #touchControls,body.touch #touchControls{display:block;pointer-events:none}#touchControls>*{pointer-events:auto}
 #joystick,body.touch #joystick{width:98px;height:98px;left:max(24px,env(safe-area-inset-left));bottom:calc(124px + var(--safe-bottom));background:#16324370;border:2px solid #d1e9e999;box-shadow:inset 0 0 0 17px #bedcdb19,0 4px 16px #0002}
 #stick,body.touch #stick{width:44px;height:44px;left:25px;top:25px;background:linear-gradient(145deg,#faf3d8,#a5bebd);box-shadow:0 3px 8px #09212d66;border:2px solid #f5f4df}
 .touchActions,body.touch .touchActions{right:max(21px,env(safe-area-inset-right));bottom:calc(127px + var(--safe-bottom));gap:13px;align-items:flex-end}
 .touchActions button,body.touch .touchActions button{width:64px;height:64px;font-size:23px;background:#203848b8;border:2px solid #d6eeedaa;box-shadow:0 3px 14px #10283c33}
 .touchActions button:last-child,body.touch .touchActions button:last-child{width:68px;height:68px;margin-bottom:34px;background:#f5ebd7df;color:#25344b}.touchActions button span{font-size:11px;white-space:nowrap}.touchActions button:disabled{opacity:.65}
 #context,body.touch #context{bottom:calc(240px + var(--safe-bottom));left:auto;right:14px;transform:none;max-width:155px;padding:6px 10px;background:#142e3bdf;border:1px solid #ffffff33;border-radius:7px;box-shadow:none;font-size:12px;color:#ffdd96;line-height:1.3;pointer-events:none}
 #cameraReset{right:max(14px,env(safe-area-inset-right));top:calc(var(--hud-top) + 76px);width:42px;height:42px;font-size:28px}
 #controlHints{display:flex;justify-content:space-between;position:fixed;left:24px;right:24px;bottom:calc(111px + var(--safe-bottom));font-size:9px;font-weight:800;letter-spacing:1px;color:white;text-shadow:0 1px 4px #102533;pointer-events:none;opacity:.8}
 #toast{top:calc(var(--hud-top) + 68px);bottom:auto;left:50%;right:auto;transform:translateX(-50%);width:max-content;max-width:calc(100% - 105px);padding:7px 10px;max-height:64px;overflow:hidden;font-size:12px;line-height:1.4;background:#19283ff0;color:#fff0ca;border-radius:8px;pointer-events:none}
 #modal{max-height:calc(var(--app-height) - 24px);padding:24px}#overlay{padding:12px}#modal p{font-size:16px}#modal .fine{font-size:13px}.levelGrid{grid-template-columns:1fr}
}
@media(max-height:520px) and (min-width:601px){
 :root{--hud-top:calc(46px + var(--safe-top))}
 #missionStrip{right:auto;width:220px;max-height:50px;font-size:11px;padding:5px 9px;top:calc(var(--hud-top) + 5px)}#console,body.touch #console{left:26%;right:26%;bottom:calc(10px + var(--safe-bottom));padding:5px 7px}.copyRow{height:13px}.actions button,body.touch .actions button{min-height:38px;font-size:11px}
 #joystick,body.touch #joystick{width:92px;height:92px;left:max(30px,env(safe-area-inset-left));bottom:calc(36px + var(--safe-bottom))}#stick,body.touch #stick{left:22px;top:22px}
 .touchActions,body.touch .touchActions{bottom:calc(32px + var(--safe-bottom));right:max(26px,env(safe-area-inset-right))}.touchActions button:last-child,body.touch .touchActions button:last-child{margin-bottom:26px}
 #context,body.touch #context{bottom:calc(158px + var(--safe-bottom));max-width:145px}#controlHints{bottom:calc(16px + var(--safe-bottom));left:30px;right:26px}#cameraReset{top:calc(var(--hud-top) + 12px);right:24px}#toast{top:calc(var(--hud-top) + 48px)}.nav button,.nav #playerProfile{height:36px}
}
@media(max-width:350px){#joystick,body.touch #joystick{left:16px;width:88px;height:88px}#stick,body.touch #stick{left:20px;top:20px}.touchActions,body.touch .touchActions{right:14px;gap:10px}.touchActions button,body.touch .touchActions button{width:58px;height:58px}.touchActions button:last-child,body.touch .touchActions button:last-child{width:60px;height:60px}}
