*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden;background:#14140d;color:#e9e4bd;font-family:Consolas,monospace}#view{display:block;width:100%;height:100%}[hidden]{display:none!important}.vignette{position:fixed;inset:0;pointer-events:none;background:radial-gradient(ellipse,transparent 32%,#08090485);box-shadow:inset 0 0 100px #0006}header{position:fixed;top:30px;left:32px;pointer-events:none;text-shadow:0 2px 8px #000}.tag{font-size:12px;letter-spacing:.2em;color:#c0ba87}h1{font-size:22px;letter-spacing:.14em;margin:10px 0}.subtitle{font-size:12px;letter-spacing:.18em;opacity:.65}#crosshair{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);font:20px monospace;color:#fff6;pointer-events:none}footer{position:fixed;bottom:24px;left:32px;right:32px;display:flex;justify-content:space-between;gap:24px;font-size:12px;text-shadow:0 2px 5px #000;pointer-events:none}#overlay{position:fixed;inset:0;display:grid;place-items:center;background:#0d100dc9;backdrop-filter:blur(5px);padding:28px}section{max-width:600px;width:100%;border-left:2px solid #aaa16c;padding:12px 0 12px 36px}h2{font-family:Georgia,serif;font-size:clamp(40px,7vw,72px);font-weight:400;line-height:1.02;margin:24px 0;color:#f1edcb}p{font-family:system-ui,sans-serif;color:#c6c4aa;line-height:1.7;font-size:16px}button{background:#d4cc93;color:#22251c;border:1px solid #eee3ac;padding:16px 24px;font:700 16px Consolas,monospace;cursor:pointer;margin:12px 0}button:hover{background:#f3e9b0}button:focus-visible{outline:3px solid white;outline-offset:4px}.controls,#message{font-size:14px;color:#a6a58b}#debug{position:fixed;top:30px;right:24px;background:#10130fe8;border:1px solid #777b54;padding:14px;font-size:14px}#map{display:block}pre{line-height:1.5;margin:12px 0}.legend{font-size:12px;color:#b5b592;line-height:1.5}@media(max-width:650px){header{top:20px;left:20px}footer{left:20px;right:20px;font-size:10px}footer span:last-child{max-width:150px}#debug{top:110px;right:16px}section{padding-left:20px}}
label{display:block;font-size:14px;margin-top:18px}#playerName{display:block;width:min(100%,320px);font:16px Consolas,monospace;padding:12px;margin:8px 0;color:#f1edcb;background:#161c14;border:1px solid #777b54}#connection{font-size:12px;margin-top:12px;color:#d4cc93}button:disabled{opacity:.6;cursor:wait}
#settingsButton{position:fixed;top:22px;right:24px;margin:0;padding:10px 14px;background:#141a13db;color:#e9e4bd;border-color:#777b54;font-size:14px;z-index:3}#debug{top:84px}#settings{position:fixed;z-index:10;inset:50% auto auto 50%;transform:translate(-50%,-50%);width:min(540px,calc(100vw - 28px));max-height:90vh;overflow:auto;background:#11180ff5;border:1px solid #888c60;padding:24px;box-shadow:0 0 0 100vmax #050904b8}#settings h2{font:26px Georgia,serif;margin:0}#settings p{font-size:14px}#settings label{margin:12px 0;font-size:15px}#settings select{font:15px Consolas,monospace;color:#f1edcb;background:#20291d;padding:8px;border:1px solid #777b54;max-width:100%}#settings .check{display:flex;gap:12px;align-items:center}#settings input[type=checkbox]{width:18px;height:18px;accent-color:#d4cc93}#settings input[type=range]{width:65%;accent-color:#d4cc93}.settingsHead{display:flex;justify-content:space-between;align-items:center;gap:12px}#closeSettings{margin:0;padding:8px 12px;font-size:14px}#settings:focus-within{outline:1px solid #b6b47b}

#interaction{position:fixed;bottom:80px;left:50%;transform:translateX(-50%);background:#10180dda;color:#f1edcb;padding:10px 16px;font:16px Consolas,monospace;pointer-events:none}#interaction:empty{display:none}

#subtitle{position:fixed;bottom:125px;left:50%;transform:translateX(-50%);background:#10180ded;color:#f3eed0;padding:12px 20px;font:18px system-ui,sans-serif;text-align:center;max-width:85vw;pointer-events:none}#subtitle:empty{display:none}

/* Touch HUD: only interactive islands intercept the scene's look gestures. */
#view{touch-action:none}#touchControls{position:fixed;inset:0;z-index:4;pointer-events:none;user-select:none;-webkit-user-select:none}#touchControls button,#joystick{pointer-events:auto;touch-action:none;-webkit-tap-highlight-color:transparent}#touchControls button{margin:0;padding:10px 12px;min-height:44px;background:#141a13cc;color:#eee6b5;border:1px solid #aaa16c88;border-radius:8px;font-size:13px}#touchControls button:active,#touchRun[aria-pressed=true]{background:#d4cc93;color:#22251c}#touchMenu{position:absolute;top:calc(env(safe-area-inset-top) + 58px);right:calc(env(safe-area-inset-right) + 12px);display:flex;gap:5px;flex-wrap:wrap;justify-content:flex-end;max-width:65%}#joystick{position:absolute;left:calc(env(safe-area-inset-left) + 22px);bottom:calc(env(safe-area-inset-bottom) + 36px);width:clamp(100px,25vmin,150px);aspect-ratio:1;border:2px solid #d4cc9380;border-radius:50%;background:#11180f70}#stick{position:absolute;left:50%;top:50%;width:43%;height:43%;border-radius:50%;background:#d4cc93a0;border:1px solid #eee3ac;transform:translate(-50%,-50%);pointer-events:none}#touchActions{position:absolute;right:calc(env(safe-area-inset-right) + 22px);bottom:calc(env(safe-area-inset-bottom) + 36px);display:flex;flex-direction:column;gap:12px;align-items:flex-end}#touchActions button{min-width:72px;min-height:56px}.touch-device #settingsButton{top:calc(env(safe-area-inset-top) + 10px);right:calc(env(safe-area-inset-right) + 12px);min-height:44px}.touch-device header{top:calc(env(safe-area-inset-top) + 10px);left:calc(env(safe-area-inset-left) + 12px);max-width:55%}.touch-device h1{font-size:16px;margin:5px 0}.touch-device header .tag,.touch-device header .subtitle{font-size:9px}.touch-device #connection{font-size:10px;margin-top:5px}.touch-device footer{bottom:calc(env(safe-area-inset-bottom) + 8px);left:calc(env(safe-area-inset-left) + 12px)}.touch-device footer span:last-child{display:none}.touch-device #debug{top:calc(env(safe-area-inset-top) + 110px);right:calc(env(safe-area-inset-right) + 12px);padding:8px;max-height:45dvh;overflow:auto;pointer-events:none;font-size:10px}.touch-device #map{width:120px;height:120px}.touch-device #subtitle{bottom:calc(env(safe-area-inset-bottom) + 180px);font-size:14px;width:max-content;max-width:80vw}.touch-device #overlay{overflow:auto;place-items:safe center;padding: max(16px,env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) max(16px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left));z-index:5}.touch-device #settingsButton{z-index:6}.touch-device #settings{max-height:85dvh;overscroll-behavior:contain}.touch-device #overlay h2{font-size:clamp(30px,7vmin,54px);margin:12px 0}.touch-device #overlay p{font-size:13px;line-height:1.4;margin:8px 0}.touch-device #overlay label{margin-top:8px}.touch-device #overlay section{padding-top:40px}.touch-device #overlay button{margin:6px 0;padding:12px 18px}@media(max-height:450px){.touch-device #overlay section{padding-top:32px}.touch-device #subtitle{bottom:75px;max-width:45vw}.touch-device #debug{max-height:38dvh}.touch-device #touchMenu{max-width:75%}}

.engineering-panel{position:fixed;z-index:12;left:50%;top:50%;transform:translate(-50%,-50%);width:min(720px,calc(100vw - 24px));max-height:85dvh;overflow:auto;background:#11190ff5;border:1px solid #888c60;padding:22px;box-shadow:0 0 0 100vmax #050904b8;overscroll-behavior:contain}.engineering-panel h2{font:28px Georgia,serif;margin:0}.engineering-panel button{font-size:14px;padding:10px 14px;margin:4px;min-height:44px}.engineering-panel input,.engineering-panel select{font:16px Consolas,monospace;padding:10px;background:#20291d;color:#eee6b5;border:1px solid #777b54;max-width:100%}.inventory-row{padding:10px 0;border-bottom:1px solid #596143;display:flex;gap:6px;align-items:center;flex-wrap:wrap}.inventory-row span{flex:1 1 220px}#inventoryButton{position:fixed;right:24px;top:70px;font-size:14px;padding:10px 14px;background:#141a13db;color:#eee6b5;z-index:6;margin:0;min-height:44px}#equipmentReadout{position:fixed;right:24px;bottom:60px;white-space:pre-line;background:#11190fd9;padding:12px;line-height:1.6;font-size:14px;pointer-events:none}#equipmentReadout:empty{display:none}.touch-device #inventoryButton{right:12px;top:auto;bottom:calc(env(safe-area-inset-bottom) + 175px);font-size:13px}.touch-device #equipmentReadout{right:12px;bottom:calc(env(safe-area-inset-bottom) + 235px);max-width:60vw;font-size:12px}.engineering-panel p{font-size:15px}.touch-device .engineering-panel{padding:14px}

.terminal-output{height:40dvh;min-height:160px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;background:#020805;color:#90b88c;padding:16px;font:15px/1.5 Consolas,monospace}.terminal-panel input{width:100%}.terminal-panel form{display:flex;gap:8px;align-items:end}.terminal-panel label{flex:1}

.camera-feed{display:block;width:100%;height:auto;max-height:55dvh;object-fit:contain;image-rendering:auto;background:#020604}.engineering-panel pre{max-width:100%}

/* WebXR entry stays reachable before joining; immersive menus use a scene panel. */
#vrButton{position:fixed;bottom:18px;left:50%;transform:translateX(-50%);z-index:7;margin:0;padding:12px 20px;min-height:44px;background:#162011ed;color:#eee6b5;border-color:#aaa16c;font-size:15px}#vrStatus{position:fixed;bottom:68px;left:50%;transform:translateX(-50%);z-index:7;margin:0;max-width:min(80vw,600px);width:max-content;background:#11190fde;padding:5px 10px;font-size:12px;line-height:1.4;pointer-events:none;text-align:center}#vrStatus:empty{display:none}.vr-playing #touchControls,.vr-playing #vrButton,.vr-playing #vrStatus{display:none!important}.touch-device #vrButton{bottom:calc(env(safe-area-inset-bottom) + 14px)}.touch-device #vrStatus{bottom:calc(env(safe-area-inset-bottom) + 66px);max-width:48vw;font-size:10px}

#chatButton{position:fixed;right:24px;top:122px;z-index:6;margin:0;padding:10px 14px;min-height:44px;font-size:14px;background:#141a13db;color:#eee6b5}#chatLog{min-height:120px;max-height:35dvh;overflow:auto;border:1px solid #596143;padding:12px;background:#080f07;overflow-wrap:anywhere}.chat-message{padding:6px 0;border-bottom:1px solid #ffffff12}.chat-message p{margin:0;white-space:pre-wrap}.chat-message button{font-size:11px;padding:4px 8px;min-height:32px;margin:4px 0}#chatForm{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-top:16px}#chatForm label{flex:1 0 100%}#chatInput{flex:1;min-width:0}#exitPanel .outside-picture{display:block;width:100%;height:auto;border:1px solid #8a9670;margin:16px 0}#exitPanel h2{font-size:36px}#developmentStory p{line-height:1.65}.touch-device #chatButton{top:auto;right:12px;bottom:calc(env(safe-area-inset-bottom) + 225px);font-size:13px}.touch-device #equipmentReadout{bottom:calc(env(safe-area-inset-bottom) + 285px)}
