:root{color-scheme:dark;font:14px/1.5 system-ui,sans-serif;background:#090b0f;color:#eae5d9}
*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden;overscroll-behavior:none}
body{height:100dvh;padding:0}
#game{position:fixed;inset:0}
body[data-play-mode="desktop"] #game canvas{cursor:none!important;caret-color:transparent}
@media(display-mode:standalone){#fullscreen{display:none}}
/* iPhone uses Safari/PWA viewport sizing. This desktop fullscreen control
   overlaps the mobile 1/2 skill-page button at the lower right. */
body[data-play-mode="mobile"] #fullscreen{display:none}
#game{width:100%;height:100%;background:#000}#canvas{display:block;width:100%;height:100%;outline:none;touch-action:none;-webkit-user-select:none;user-select:none}
#startup{position:fixed;inset:0;display:grid;place-items:center;background:#090b0f;z-index:10;padding:24px}
#startup[hidden],#download[hidden]{display:none}.panel{max-width:420px;text-align:center}h1{font-size:24px;color:#d6b778;margin:0 0 18px}.hint{font-size:13px;color:#a9a398}
#game:has(#canvas[data-scene="5"]) ~ #download{display:none}
button{min-height:44px;padding:10px 26px;color:#fff5d8;background:#104d59;border:1px solid #8a9e98;border-radius:4px;font:inherit;cursor:pointer}button:disabled{opacity:.5;cursor:wait}
#download{position:fixed;left:calc(env(safe-area-inset-left) + 12px);bottom:calc(env(safe-area-inset-bottom) + 8px);background:#000b;border:1px solid #74634b;color:#e4d9c0;padding:4px 10px;max-width:65%;font-size:11px;pointer-events:none}
#fullscreen{position:fixed;right:calc(env(safe-area-inset-right) + 8px);bottom:calc(env(safe-area-inset-bottom) + 8px);min-width:36px;min-height:32px;padding:2px 7px;background:#0008;border-color:#74634b;font-size:21px;opacity:.65}
#rotate{display:none;position:fixed;inset:0;place-items:center;text-align:center;background:#090b0fee;padding:28px;z-index:11}
@media(orientation:portrait) and (pointer:coarse){#rotate{display:grid}}
#keyboard-dock{position:fixed;display:flex;gap:8px;align-items:center;padding:6px max(10px,env(safe-area-inset-right)) 6px max(10px,env(safe-area-inset-left));background:#0a121ff5;border-top:1px solid #aab5bf;z-index:30;height:54px}
#keyboard-dock[hidden]{display:none}
#native-keyboard{flex:1;min-width:0;height:40px;padding:7px 12px;background:#152335;color:#fff;border:1px solid #7189a8;border-radius:6px;font:16px/24px system-ui;outline:none;touch-action:manipulation}
#keyboard-dock button{height:40px;min-width:66px;padding:6px 12px;touch-action:manipulation}
/* The native chat strip already draws the input/Send/Close controls above the
   keyboard. Keep only an invisible iOS input bridge, never a second blue box. */
#keyboard-dock.native-chat-bridge{width:1px;height:1px;padding:0;border:0;background:transparent;opacity:0;overflow:hidden;pointer-events:none}
#keyboard-dock.native-chat-bridge #native-keyboard{flex:none;width:1px;height:1px;min-width:0;padding:0;border:0;opacity:0}
#keyboard-dock.native-chat-bridge button{display:none}
#music-toggle{position:fixed;right:calc(env(safe-area-inset-right) + 10px);top:calc(env(safe-area-inset-top) + 34px);font-size:11px;min-height:28px;padding:3px 8px;background:#0b101bba;border-color:#736447;z-index:3}
#music-toggle[hidden]{display:none}
/* The new mobile Menu lives at the upper right. Keep the audio toggle away
   from its native touch target and the combat buttons. */
body[data-play-mode="mobile"] #music-toggle{right:calc(env(safe-area-inset-right) + 12px);top:calc(env(safe-area-inset-top) + 12px);min-height:36px;padding:5px 12px;font-size:12px}
.panel label{display:block;color:#a9a398;font-size:12px}.panel select{display:block;margin:6px auto 20px;min-height:44px;padding:8px 12px;background:#111923;border:1px solid #74634b;color:#eae5d9;font:inherit}
