:root{font:14px/1.5 system-ui,"Microsoft YaHei",sans-serif;color:#fff;background:#111214;color-scheme:dark}*{box-sizing:border-box}html,body{width:100%;height:100%;margin:0;overflow:hidden;overscroll-behavior:none;touch-action:none}body{position:fixed;inset:0}#handheld,#console-face{touch-action:none}button{font:inherit;cursor:pointer;touch-action:none;-webkit-tap-highlight-color:transparent}button:focus-visible{outline:2px solid #54c838;outline-offset:3px}[hidden]{display:none!important}
/* One measured portrait console. All mounts stay at the reference coordinates. */
#handheld{--viewport-height:100dvh;--console-width:min(calc(100vw - env(safe-area-inset-left) - env(safe-area-inset-right)),calc((var(--viewport-height) - env(safe-area-inset-top) - env(safe-area-inset-bottom))*.627921668));width:100%;height:var(--viewport-height);display:grid;place-items:center;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);overflow:hidden;background:#111214}
#console-face{position:relative;width:var(--console-width);height:calc(var(--console-width)*1.592555332);max-width:100%;max-height:100%;background:var(--fixed-shell) center/100% 100% no-repeat;isolation:isolate;user-select:none;-webkit-user-select:none}
#play-area{position:absolute;left:7.7475%;top:12.6342%;width:83.6016%;height:39.1029%;overflow:hidden;border-radius:2%;background:#000;z-index:1}
#unity-canvas{position:absolute;left:50%;top:50%;display:block;width:var(--canvas-width,100%)!important;height:var(--canvas-height,100%)!important;transform:translate(-50%,-50%);touch-action:none;outline:none;padding:0!important;margin:0!important}
#launch{position:absolute;inset:0;display:grid;place-items:center;background:#101113}.launch-content{padding:12px;text-align:center;max-width:95%;color:#eee}#status{font-size:clamp(12px,2.4vw,18px);margin:0 0 10px}#start{border:1px solid #8a8c8d;background:#303235;color:#fff;border-radius:6px;padding:8px 18px}#compatibility{font-size:clamp(10px,1.8vw,12px);color:#aaa;max-width:220px;margin:12px auto 0}progress{display:block;width:min(180px,55vw);height:7px;accent-color:#3bcc34;margin:12px auto}
/* Normal startup shows only the original green bar; retain live status for accessibility. */
#launch .game-name,#launch #start,#launch #compatibility{display:none}
#launch #status{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;margin:0}
#launch[data-state="failed"] #status{position:static;width:auto;height:auto;overflow:visible;clip-path:none;white-space:normal;margin:0 0 10px}
#launch[data-state="failed"] #start{display:inline-block}
.fixed-controls{position:absolute;inset:0;pointer-events:none;z-index:2}.fixed-controls button,.movement-pad,.aim-pad{pointer-events:auto}.control-item,.movement-pad{position:absolute;transform:translate(-50%,-50%);border:0;padding:0;background:transparent;touch-action:none;perspective:400px}
.button-surface,.touch-knob{display:block;position:absolute;inset:0;background:transparent none center/contain no-repeat;pointer-events:none;transition:transform 110ms cubic-bezier(.2,.7,.3,1.2),filter 110ms;will-change:transform;transform-style:preserve-3d}
#touch-fire{left:50.7042%;top:66.9615%;width:17%;height:10.6747%}#touch-weapon{left:67.6056%;top:66.0139%;width:17%;height:10.6747%}#touch-fire .button-surface{background-image:var(--white-a)}#touch-weapon .button-surface{background-image:var(--white-b)}
#touch-move-zone{left:20.1207%;top:68.0985%;width:32%;height:20.093%}#touch-move{position:absolute;inset:0;pointer-events:none}.joystick-base{position:absolute;inset:0;background:var(--joystick-base) center/contain no-repeat;pointer-events:none}.touch-knob{inset:24%;background-image:var(--joystick-cap);transform:translate3d(var(--move-shift-x,0px),var(--move-shift-y,0px),0) rotateX(var(--move-tilt-x,0deg)) rotateY(var(--move-tilt-y,0deg))}
#touch-move-zone[data-active="true"] .touch-knob{filter:brightness(1.13);transition:none}.aim-pad{position:fixed;inset:0;width:100%;height:100%;z-index:0;touch-action:none;pointer-events:none}.fixed-controls[data-state="playing"] .aim-pad{pointer-events:auto}.control-item,.movement-pad{z-index:2}#fullscreen-shortcut{left:87%;top:5.7%;width:10.2%;height:6.405%}#fullscreen-shortcut .button-surface{background-image:var(--fullscreen-button)}
.control-item[data-pressed="true"] .button-surface{transform:translateY(2px) scale(.95);filter:brightness(.8)}#touch-fire[data-held="true"] .button-surface{animation:fire-feedback 180ms ease-in-out infinite}@keyframes fire-feedback{0%,100%{transform:translateY(2px) scale(.95);filter:brightness(.85)}50%{transform:translateY(3px) scale(.93);filter:brightness(1.1)}}
#feedback-status{position:absolute;z-index:20;left:8%;right:8%;bottom:3%;margin:0;padding:7px 10px;border-radius:6px;background:#24262af5;color:#fff;font-size:11px;pointer-events:none}#feedback-status:empty{display:none}
#handheld:fullscreen,#handheld:-webkit-full-screen{width:100vw;height:100dvh;margin:0}
@media(prefers-reduced-motion:reduce){.button-surface,.touch-knob{transition:none}#touch-fire[data-held="true"] .button-surface{animation:none;transform:translateY(2px) scale(.95);filter:brightness(.85)}}

/* Native fullscreen: corner HUD remains clear, thumbs sit inward and above items. */
.fullscreen-label{display:none}
#handheld[data-fullscreen="true"]{padding:0;--frame-size:clamp(7px,2vmin,12px);--frame-left:max(var(--frame-size),env(safe-area-inset-left));--frame-right:max(var(--frame-size),env(safe-area-inset-right));--frame-top:max(var(--frame-size),env(safe-area-inset-top));--frame-bottom:max(var(--frame-size),env(safe-area-inset-bottom));--pad-size:clamp(104px,34vmin,156px);--action-size:clamp(64px,20vmin,92px);--toolbar-bottom:max(10px,env(safe-area-inset-bottom))}
#handheld[data-fullscreen="true"] #console-face{width:100%;height:100%;max-width:none;max-height:none;background:linear-gradient(145deg,#f4f1eb,#9e9d99 35%,#dfdcd5 65%,#777975);box-shadow:inset 0 0 0 2px #ffffff70,inset 0 0 0 5px #101113}
#handheld[data-fullscreen="true"] #play-area{inset:var(--frame-top) var(--frame-right) var(--frame-bottom) var(--frame-left);width:auto;height:auto;border-radius:10px;outline:3px solid #17191b;box-shadow:0 0 0 4px #777875}
#handheld[data-fullscreen="true"] .fullscreen-label{position:absolute;inset:0;display:grid;place-items:center;color:#eee;font-size:11px;pointer-events:none;text-shadow:0 1px 3px #000}
#handheld[data-fullscreen="true"] #touch-move-zone{left:max(calc(env(safe-area-inset-left) + var(--pad-size)*.5 + 12px),16%);top:69%;bottom:auto;width:var(--pad-size);height:var(--pad-size);transform:translate(-50%,-50%);opacity:.78}
#handheld[data-fullscreen="true"] #touch-fire{left:min(calc(100% - env(safe-area-inset-right) - var(--action-size)*.5 - 12px),82%);top:62%;right:auto;bottom:auto;width:var(--action-size);height:var(--action-size);transform:translate(-50%,-50%);opacity:.88}
#handheld[data-fullscreen="true"] #touch-weapon{left:calc(82% - var(--action-size)*1.08);top:51%;right:auto;bottom:auto;width:calc(var(--action-size)*.78);height:calc(var(--action-size)*.78);transform:translate(-50%,-50%);opacity:.83}
#handheld[data-fullscreen="true"] .face-button .fullscreen-label{top:100%;bottom:auto;height:17px}
#handheld[data-fullscreen="true"] #fullscreen-shortcut{left:calc(50% + 102px)}
#handheld[data-fullscreen="true"] .system-key .button-surface{background:none}
#handheld[data-fullscreen="true"] #fullscreen-shortcut .button-surface{inset:8px}
@media (orientation:portrait){#handheld[data-fullscreen="true"] #touch-move-zone{left:21%}#handheld[data-fullscreen="true"] #touch-fire{left:81%}#handheld[data-fullscreen="true"] #touch-weapon{left:calc(81% - var(--action-size)*1.05);top:54%}}


#handheld[data-fullscreen="true"] .fixed-controls{inset:var(--frame-top) var(--frame-right) var(--frame-bottom) var(--frame-left)}

/* Fullscreen controls leave smoothly, but all hit targets stop immediately. */
#handheld[data-fullscreen="true"] .fixed-controls{opacity:1;visibility:visible;transition:opacity .28s ease,visibility 0s}
#handheld[data-fullscreen="true"] .fixed-controls[data-state="idle"]{opacity:0;visibility:hidden;transition:opacity .28s ease,visibility 0s .28s;pointer-events:none}
#handheld[data-fullscreen="true"] .fixed-controls[data-state="idle"] *{pointer-events:none!important}
/* Mouse has direct access to Unity HUD; touch keeps swipe-to-aim. */
.fixed-controls[data-input-mode="keyboard"] .aim-pad{pointer-events:none}
#handheld[data-fullscreen="true"][data-input-mode="keyboard"] .fixed-controls{opacity:0;visibility:hidden;pointer-events:none;transition:none}

.keyboard-help{font-size:11px;line-height:1.7;margin:10px 0;color:#555}


#content-download{position:absolute;left:50%;transform:translateX(-50%);top:12px;white-space:nowrap;z-index:40;pointer-events:none;background:#111c;color:#eee;font:11px sans-serif;padding:5px 8px;border-radius:6px}#content-download[hidden],#content-transition[hidden]{display:none}#content-transition{position:absolute;inset:0;z-index:120;display:flex;flex-direction:column;justify-content:center;align-items:center;background:#101115eb;color:#fff;padding:24px;text-align:center}#content-transition button{font:inherit;padding:12px 24px}
/* Bezel controls stay on the handheld; fullscreen uses the game's pause UI. */
#touch-pause{left:37.9276%;top:85.913%;width:15%;height:5.9%}
#touch-start{left:59.9598%;top:85.913%;width:15%;height:5.9%}
.system-key .button-surface{background-image:var(--white-pill)}
#handheld[data-fullscreen="true"] #touch-pause,#handheld[data-fullscreen="true"] #touch-start,#handheld[data-fullscreen="true"] #fullscreen-shortcut{display:none}

.asset-credit{position:absolute;right:6%;bottom:2%;font-size:9px;color:#555;text-decoration:none;z-index:3}
#handheld[data-fullscreen="true"] .asset-credit{display:none}

/* Cinematics release pointer lock; hide the cursor across their entire surface. */
#handheld[data-cinematic="true"],#handheld[data-cinematic="true"] *{cursor:none!important}

/* Layout editing uses the same controls and coordinate system, never game input. */
#handheld[data-layout-editing="true"] #touch-controls{opacity:1!important;visibility:visible!important;transition:none;pointer-events:none}
#handheld[data-layout-editing="true"] #touch-controls *{pointer-events:none!important}
#handheld[data-layout-editing="true"] #touch-controls #touch-move-zone,#handheld[data-layout-editing="true"] #touch-controls #touch-fire,#handheld[data-layout-editing="true"] #touch-controls #touch-weapon{pointer-events:auto!important;cursor:grab;outline:2px dashed #ffd34d;outline-offset:5px}
#layout-editor{position:absolute;z-index:200;left:50%;top:max(12px,env(safe-area-inset-top));transform:translateX(-50%);max-width:94%;padding:8px 14px;background:#17191bef;border:2px solid #c89623;border-radius:8px;text-align:center;box-shadow:0 3px 20px #0009}
#layout-editor p{margin:3px 0 7px;white-space:nowrap;font-size:clamp(11px,2.6vmin,16px)}#layout-editor [role="status"]:empty{display:none}
#layout-editor div{display:flex;justify-content:center;gap:8px}#layout-editor button{border:1px solid #d7a82c;border-radius:5px;padding:7px 16px;background:#34312b;color:#ffe298;transition:transform .08s,filter .08s}#layout-editor button:active{transform:scale(.94);filter:brightness(.75)}
