.touch-game{--safe-top:max(10px,env(safe-area-inset-top));--safe-bottom:max(10px,env(safe-area-inset-bottom));user-select:none;-webkit-user-select:none}
#touch-controls{position:fixed;inset:0;z-index:30;pointer-events:none}#touch-controls[hidden]{display:none}
#touch-utilities{display:none}.touch-menu-open #touch-utilities{display:flex;gap:10px;max-width:550px;margin:16px auto;pointer-events:auto}#touch-utilities button{min-height:44px;padding:10px 16px;background:#335659;border:1px solid #76928c;color:#f5eed8;border-radius:7px}
.touch-blocked #touch-actions,.touch-blocked #touch-stick,.touch-blocked #touch-zoom,.touch-blocked #touch-tip{display:none}
#touch-voyage-summary{position:absolute;top:calc(var(--safe-top) + 86px);left:12px;max-width:calc(100vw - 130px);white-space:pre-line;font-size:11px;line-height:1.7;background:#12363bd9;border-radius:7px;padding:7px;color:#eee9d3}.touch-menu-open #touch-voyage-summary{display:none}
.touch-game #protocol-panel{top:60px;bottom:12px;left:12px;width:calc(100vw - 24px);max-width:440px;z-index:31}
#touch-controls button,#touch-stick{pointer-events:auto;touch-action:none;color:#edf5e7;background:#153c40dc;border:1px solid #93b8ac90;border-radius:12px;font:600 13px system-ui;min-height:44px}
#touch-stick{position:absolute;left:max(18px,env(safe-area-inset-left));bottom:calc(var(--safe-bottom) + 52px);width:120px;height:120px;border-radius:50%;background:#14383b70;display:grid;place-items:center}
#touch-stick span{width:48px;height:48px;border-radius:50%;background:#9bddce90;border:1px solid #daf5e1}#touch-stick small{position:absolute;bottom:8px;font-size:10px;pointer-events:none}
#touch-actions{position:absolute;right:max(12px,env(safe-area-inset-right));bottom:calc(var(--safe-bottom) + 50px);display:grid;grid-template-columns:repeat(2,56px);gap:7px}#touch-actions button{height:46px}
#touch-menu{position:absolute;right:12px;top:var(--safe-top);padding:0 14px}#touch-zoom{position:absolute;right:12px;top:calc(var(--safe-top) + 53px);display:flex;gap:6px}#touch-zoom button{width:44px;font-size:20px}
#touch-tip{position:absolute;bottom:calc(var(--safe-bottom) + 180px);left:50%;transform:translateX(-50%);width:90%;text-align:center;font-size:10px;color:#e1ece1;pointer-events:none;text-shadow:0 1px 3px #000}
#touch-actions [data-combat]{display:none}#touch-controls[data-mode="island"] [data-combat],#touch-controls[data-mode="cave"] [data-combat]{display:block}#touch-controls:not([data-mode="home"]) [data-edit],#touch-controls[data-mode="sea"] [data-key="Space"],#touch-controls[data-mode="sea"] [data-key="ShiftLeft"]{display:none}
.touch-game #brand{left:12px;top:var(--safe-top);padding:10px 12px;max-width:calc(100vw - 115px)}.touch-game #brand strong{font-size:14px;letter-spacing:.06em}.touch-game #brand span,.touch-game .art-edition{display:none}
.touch-game #help,.touch-game #status,.touch-game #ability,.touch-game #settlement-sign,.touch-game #voyage-marker{display:none!important}
.touch-game #hotbar{bottom:var(--safe-bottom);width:min(96vw,500px);gap:4px}.touch-game .slot{flex:1;min-width:0;width:auto;min-height:44px;font-size:10px;padding:2px}.touch-game .slot i{display:none}
.touch-game #interact{bottom:calc(var(--safe-bottom) + 212px);max-width:90vw;width:max-content;font-size:11px;padding:7px 10px;white-space:normal;text-align:center}
.touch-game #voyage-wallet{left:12px;top:calc(var(--safe-top) + 44px);bottom:auto;padding:6px 9px;font-size:11px}
.touch-game #sea-map-button{right:12px;top:calc(var(--safe-top) + 105px);bottom:auto;padding:10px;min-height:44px;font-size:12px}
.touch-game #quest,.touch-game #defense-status,.touch-game #environment-controls,.touch-game #progression-actions,.touch-game #voyage-hud,.touch-game #share{display:none!important}
.touch-game.touch-menu-open #touch-stick,.touch-game.touch-menu-open #touch-actions,.touch-game.touch-menu-open #touch-tip{display:none}
.touch-game.touch-menu-open #touch-zoom,.touch-game.touch-menu-open #waypoint,.touch-game.touch-menu-open #voyage-wallet,.touch-game.touch-menu-open #sea-map-button{display:none!important}
.touch-game.touch-menu-open #ui{overflow-y:auto;pointer-events:auto;background:#102b31f5;padding:calc(var(--safe-top) + 60px) 16px calc(var(--safe-bottom) + 80px)}
.touch-game.touch-menu-open #quest,.touch-game.touch-menu-open #defense-status,.touch-game.touch-menu-open #environment-controls,.touch-game.touch-menu-open #progression-actions,.touch-game.touch-menu-open #share{display:block!important;position:relative;inset:auto;transform:none;width:100%;max-width:550px;margin:10px auto}
.touch-game.touch-menu-open #voyage-hud:not([hidden]){display:block!important;position:relative;inset:auto;width:100%;max-width:550px;margin:10px auto;max-height:none;z-index:2;pointer-events:auto}
.touch-game.touch-menu-open #hotbar,.touch-game.touch-menu-open #brand,.touch-game.touch-menu-open #interact{display:none!important}
.touch-game #environment-panel{max-width:100%;position:relative;inset:auto}.touch-game #npc-dialogue{bottom:var(--safe-bottom);max-height:65dvh;overflow:auto;width:calc(100vw - 24px);padding:16px}
.touch-game #sea-map,.touch-game #progression-dialog{width:calc(100vw - 16px);max-height:calc(100dvh - 24px);padding:14px}.touch-game #sea-map svg{position:static;max-height:55dvh;touch-action:manipulation}
.touch-game #reward{top:65px;min-width:0;width:90vw;padding:12px}.touch-game #reward strong{font-size:18px}
@media(orientation:landscape) and (max-height:550px){.touch-game #touch-stick{bottom:calc(var(--safe-bottom) + 15px);width:104px;height:104px}.touch-game #touch-actions{bottom:calc(var(--safe-bottom) + 10px);grid-template-columns:repeat(3,50px)}.touch-game #touch-tip{display:none}.touch-game #hotbar{width:44vw}.touch-game #interact{bottom:65px;max-width:45vw}.touch-game #start-card{padding:14px;max-height:95dvh;overflow:auto}.touch-game #start-card p{margin:8px 0;font-size:12px}}
