#touch-controls,#rotate-hint,.touch-help{display:none}
body.touch{overscroll-behavior:none;-webkit-text-size-adjust:100%;overflow:auto}
body.touch #world{height:100dvh}
body.touch .touch-help{display:block;color:#c6d5b5;font-size:12px;line-height:1.7}
body.touch .desktop-help{display:none}
body.touch .screen{display:flex;flex-direction:column;gap:12px;min-height:100svh;padding:0 max(18px,env(safe-area-inset-right)) 30px max(18px,env(safe-area-inset-left))}
body.touch header{min-height:48px;flex-shrink:0}
body.touch .intro{align-self:stretch;padding:0}
body.touch .intro h1{font-size:28px;letter-spacing:-1px;margin:8px 0;line-height:1.25}
body.touch .intro h1 br{display:none}
body.touch .intro p,body.touch .terrain-tag,body.touch .specs,body.touch .intro .eyebrow{display:none}
body.touch .loadout{align-self:center;max-width:680px;width:100%;padding:16px}
body.touch footer{flex-wrap:wrap;padding:12px 0;min-height:45px}
body.touch footer>span{display:none}
body.touch footer:before{content:'左下で移動 · 左右で視点 · 射撃をなぞって狙う';font-size:11px}
body.touch .edition{font-size:9px;letter-spacing:1px}
body.touch button{touch-action:manipulation;min-height:44px}
body.touch .segmented button{font-size:12px}
body.touch .weapons button{min-height:82px}
body.touch #sound{min-height:36px;bottom:max(4px,env(safe-area-inset-bottom));right:max(10px,env(safe-area-inset-right));font-size:12px;z-index:5}
body.touch.playing{overflow:hidden;height:100dvh;position:fixed;width:100%;touch-action:none;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
body.touch.playing #touch-controls{display:block;position:fixed;inset:0;z-index:2;pointer-events:none;touch-action:none}
body.touch.playing #touch-controls[hidden]{display:none}
#touch-controls button,#move-stick,#look-pad{touch-action:none;pointer-events:auto;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
#look-pad{position:absolute;left:0;right:0;top:60px;bottom:0;background:transparent}
#look-pad span{position:absolute;left:38%;top:30%;font-size:10px;letter-spacing:1px;color:#e4edcf75;pointer-events:none}
#move-stick{position:absolute;left:max(24px,calc(env(safe-area-inset-left) + 12px));bottom:max(35px,calc(env(safe-area-inset-bottom) + 16px));width:120px;height:120px;border:1px solid #e8f7d254;border-radius:50%;background:#0d201d38;display:grid;place-items:center}
#move-stick:after{content:'移動';position:absolute;bottom:-22px;font-size:10px;color:#e5eed1a8}
#move-knob{width:48px;height:48px;background:#d8f49a55;border:1px solid #e5ffc0a0;border-radius:50%;pointer-events:none}
.touch-actions{position:absolute;right:max(20px,calc(env(safe-area-inset-right) + 8px));bottom:max(35px,calc(env(safe-area-inset-bottom) + 16px));display:grid;grid-template-columns:58px 58px 72px;grid-template-rows:52px 64px;gap:9px;pointer-events:none}
.touch-actions button,#touch-run{border:1px solid #d6e8bf80;border-radius:15px;background:#10271bb8;color:#f1f7e7;font-size:11px;font-weight:bold;box-shadow:0 2px 12px #0002}
.touch-actions button.pressed,#touch-run.pressed,.touch-actions button[aria-pressed=true]{background:#cde79fc7;color:#173219}
#touch-fire{grid-column:3;grid-row:1/3;background:#ccdf9bd4;color:#20351c;font-size:16px;border-radius:32px}
#touch-run{position:absolute;bottom:max(167px,calc(env(safe-area-inset-bottom) + 148px));left:max(54px,calc(env(safe-area-inset-left) + 42px));width:60px;height:44px}
body.touch .top-hud{top:max(8px,env(safe-area-inset-top));left:max(14px,env(safe-area-inset-left));right:max(14px,env(safe-area-inset-right));z-index:3;pointer-events:none}
body.touch #pause-button{pointer-events:auto;min-height:44px;border-radius:10px}
body.touch .match-name{display:none}
body.touch .score{gap:10px;padding:3px 12px;border-radius:10px}
body.touch .score b{font-size:26px}
body.touch .bottom-hud{top:66px;bottom:auto;left:max(16px,env(safe-area-inset-left));right:max(16px,env(safe-area-inset-right));pointer-events:none}
body.touch .health,body.touch .ammo{min-width:90px}
body.touch .health strong,body.touch .ammo strong{font-size:26px}
body.touch .health small,body.touch .ammo small{font-size:8px;letter-spacing:0}
body.touch .health em,body.touch .ammo em{font-size:12px}
body.touch .combat-guide{display:none}
body.touch #kill-feed{top:55px;left:35%;right:auto;max-width:40%;font-size:10px;z-index:1}
body.touch #center-message{font-size:17px;top:40%}
body.touch .modal{z-index:10}
body.touch .dialog{padding:20px;max-height:95dvh;overflow:auto}
body.touch .dialog h2{font-size:22px;margin:12px 0}
body.touch dialog{max-height:90dvh;max-width:92vw;overflow:auto;padding:24px}
body.touch #error{z-index:30;inset:10%;overflow:auto}
@media(orientation:landscape) and (max-height:540px){body.touch .screen{gap:5px}body.touch .intro{display:none}body.touch .loadout{padding:12px 16px}body.touch .panel-title{padding-bottom:8px;font-size:16px}body.touch fieldset{margin:9px 0}body.touch legend{margin-bottom:6px}body.touch .weapons{grid-template-columns:repeat(4,1fr)}body.touch .weapons button{padding:6px;min-height:72px}body.touch .weapons svg{height:25px}body.touch .field-note{margin-top:5px}body.touch .primary{padding:12px}body.touch .bottom-note{margin-top:6px}}
@media(orientation:portrait){body.touch.playing #rotate-hint{display:grid;position:fixed;inset:0;z-index:20;background:#10271bf5;place-content:center;text-align:center;padding:24px;gap:14px}#rotate-hint b{font-size:28px}#rotate-hint span{font-size:14px;color:#c8d6b9}body.touch.playing #touch-controls{display:none}}
@media(orientation:landscape) and (max-height:350px){body.touch .bottom-hud{top:54px}body.touch .health strong,body.touch .ammo strong{font-size:22px}#move-stick{width:100px;height:100px;bottom:26px}#touch-run{bottom:138px;left:max(44px,calc(env(safe-area-inset-left) + 32px))}.touch-actions{bottom:26px;grid-template-rows:44px 52px;gap:7px}body.touch .score b{font-size:22px}body.touch .top-hud{top:4px}body.touch .health-track{margin-top:2px}}
/* Separate left fire pad stays clear of the movement stick and run button. */
#touch-fire-left{position:absolute;left:max(166px,calc(env(safe-area-inset-left) + 154px));bottom:max(110px,calc(env(safe-area-inset-bottom) + 92px));width:68px;height:68px;min-height:44px;border:1px solid #d6e8bf80;border-radius:50%;background:#10271bb8;color:#f1f7e7;font-size:14px;font-weight:bold;}
#touch-fire-left.pressed{background:#cde79fc7;color:#173219}
#touch-fire small,#touch-fire-left small{display:block;font-size:8px;font-weight:normal;line-height:1.8;white-space:nowrap;pointer-events:none}
@media(orientation:landscape) and (max-height:350px){#touch-fire-left{left:max(146px,calc(env(safe-area-inset-left) + 134px));bottom:95px;width:62px;height:62px}}
