/* Landscape controls use CSS pixels: phone DPR never shrinks a touch target. */
.tw-touch { --touch-size:1; --touch-opacity:.75; --pad:calc(108px * var(--touch-size)); --button:calc(58px * var(--touch-size)); }
.tw-touch > .movement,.tw-touch > .combat { position:absolute; bottom:max(12px,env(safe-area-inset-bottom)); width:calc(184px * var(--touch-size)); height:calc(126px * var(--touch-size)); }
.tw-touch .movement { left:max(12px,env(safe-area-inset-left)); }
.tw-touch .combat { right:max(12px,env(safe-area-inset-right)); }
.tw-touch.swap .movement { right:max(12px,env(safe-area-inset-right)); left:auto; transform:scaleX(-1); }
.tw-touch.swap .combat { left:max(12px,env(safe-area-inset-left)); right:auto; transform:scaleX(-1); }
.tw-touch.swap .movement button,.tw-touch.swap .combat button { transform:scaleX(-1); }
.tw-touch button { position:absolute; display:flex; flex-direction:column; align-items:center; justify-content:center; box-sizing:border-box; width:var(--button); height:var(--button); background:#142938; opacity:var(--touch-opacity); font:700 24px Rubik,sans-serif; border:2px solid #e6f4ff; box-shadow:0 2px 5px #0005; padding:2px; }
.tw-touch button.held { background:#4d6537; opacity:1; border-color:#ffd24a; }
.tw-touch button small { font:600 10px/1.15 Rubik,sans-serif; max-width:100%; overflow-wrap:anywhere; z-index:1; }
.tw-touch button span { z-index:1; }
.tw-touch .move,.tw-touch .aim { width:var(--pad); height:var(--pad); bottom:0; }
.tw-touch .move { left:0; right:auto; }.tw-touch .aim { right:0; left:auto; }
.tw-touch .move i,.tw-touch .aim i { position:absolute; width:40%; height:40%; border:1px solid #fff7; border-radius:50%; background:#fff2; transform:translate(var(--dx,0px),var(--dy,0px)); pointer-events:none; }
.tw-touch .jump { right:0; bottom:0; }.tw-touch .next { left:auto; right:0; bottom:calc(66px * var(--touch-size)); }
.tw-touch .hook { right:auto; left:0; bottom:calc(66px * var(--touch-size)); }.tw-touch .fire { left:0; bottom:0; }
.tw-touch .utilities { position:absolute; right:max(10px,env(safe-area-inset-right)); top:max(8px,env(safe-area-inset-top)); display:flex; gap:6px; }
.tw-touch .utilities button { position:static; width:48px; height:48px; border-radius:12px; font-size:20px; }
.tw-touch .utilities .aimmode { width:96px; }
.tw-touch .utilities .scoreboard small,.tw-touch .utilities .voice small { display:none; }
body.touch-device .tw-padhint { display:none; }
body.touch-device #app { touch-action:none; }
body.touch-device .tw-screen { padding:max(10px,env(safe-area-inset-top)) max(14px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left)); }
body.touch-device .tw-btn,body.touch-device .tw-btn.small,body.touch-device .tw-tab,body.touch-device .tw-seg button,body.touch-device .tw-key { min-height:44px; }
body.touch-device .tw-panel > .tw-card { max-height:calc(100dvh - 20px); max-width:100%; overflow:auto; }
body.touch-device .tw-panel .body { min-height:70px; flex:1 1 auto; }
body.touch-device .tw-panel h2 { margin:2px 0 8px; font-size:1.25em; }
body.touch-device .tw-tabs { flex-wrap:nowrap; overflow-x:auto; flex-shrink:0; padding-bottom:3px; }
body.touch-device .tw-tab { white-space:nowrap; padding:6px 12px; }
body.touch-device .tw-panel .foot { flex-shrink:0; margin-top:8px; }
body.touch-device .tw-range input { max-width:100%; width:180px; min-height:44px; }
body.touch-device .tw-hud .safe { left:max(10px,env(safe-area-inset-left)); right:max(10px,env(safe-area-inset-right)); top:max(8px,env(safe-area-inset-top)); bottom:max(8px,env(safe-area-inset-bottom)); }
body.touch-device .tw-hud.classic { --u:1.4px; font-size:12px; }
body.touch-device .tw-hud .health { top:0; left:0; transform:none; }
body.touch-device .tw-hud .icons i,body.touch-device .tw-hud .ammo i { width:14px; height:14px; }
body.touch-device .tw-hud .icons,body.touch-device .tw-hud .ammo { min-height:14px; gap:2px; }
body.touch-device .tw-hud .weapons { display:none; }
body.touch-device .tw-hud .top { top:0; max-width:36%; font-size:12px; }
body.touch-device .tw-hud .timer { font-size:22px; }
body.touch-device .tw-hud .scorebox,body.touch-device .tw-hud.classic .teams { top:60px; bottom:auto; right:0; font-size:12px; }
body.touch-device .tw-hud .feed { top:112px; right:0; max-width:35%; font-size:11px; }
body.touch-device .tw-hud .feed div:nth-child(n+3) { display:none; }
body.touch-device .tw-hud .chat { bottom:6px; left:50%; transform:translateX(-50%); width:36%; }
body.touch-device .tw-hud .chat .line { font-size:12px; overflow-wrap:anywhere; }
body.touch-device .tw-hud .chat .line:nth-last-child(n+3) { display:none; }
body.touch-device .tw-hud .hint { bottom:40px; font-size:12px; max-width:38%; }
body.touch-device .tw-hud .announce { white-space:normal; max-width:45%; font-size:22px; }
body.touch-device .tw-hud .station { max-width:50%; font-size:12px; top:52px; padding:6px; }
body.touch-device .tw-hud .station h4 { font-size:15px; }
body.touch-device .tw-hud .tw-score { max-width:94vw; max-height:68dvh; overflow:auto; gap:5px; pointer-events:auto; }
body.touch-device .tw-score table { min-width:0; font-size:12px; }.touch-device .tw-score th,.touch-device .tw-score td { padding:4px; }
body.touch-device .tw-toasts { max-width:70%; bottom:auto; top:64px; font-size:13px; }
@media (max-height:540px) and (orientation:landscape) {
  body.touch-device .tw-main { overflow:auto; align-items:flex-start; }
  body.touch-device .tw-main .left { width:54%; min-width:0; gap:7px; }
  body.touch-device .tw-main .logo .tw-word { font-size:34px; }
  body.touch-device .tw-menuitem { min-height:50px; padding:4px 10px; }
  body.touch-device .tw-menuitem .ico { width:38px; height:38px; }
  body.touch-device .tw-main .tw-news { display:none; }
  body.touch-device .tw-hub,body.touch-device .tw-lobby,body.touch-device .tw-ward,body.touch-device .tw-results { overflow:auto; }
  body.touch-device .tw-hub .side,body.touch-device .tw-lobby .lcol { width:42%; flex-shrink:0; }
  body.touch-device .tw-lobby .tw-stage { display:none; }
  body.touch-device .tw-lobby .lcol { top:10px; bottom:110px; width:calc(50% - 24px); overflow:auto; padding:0 2px 8px; }
  body.touch-device .tw-lobby .lcol .tw-card { flex:0 0 auto; min-height:0; }
  body.touch-device .tw-lobby .lcol .tw-card.grow { flex:none; }
  body.touch-device .tw-lobby .lcol .tw-card.grow > div[style] { flex:none !important; }
  body.touch-device .tw-lobby .bar { left:14px; right:14px; bottom:10px; width:auto; max-width:none; transform:none; gap:8px; }
  body.touch-device .tw-lobby .bar .hint { width:100%; font-size:12px; }
  body.touch-device .tw-lobby .tw-chatlog { flex:none; height:100px; }
  body.touch-device .tw-card { padding:12px; }
  body.touch-device .tw-hud .big { font-size:30px; }
}
@media (orientation:portrait) and (max-width:900px) {
  body.touch-device .tw-screen { overflow:auto; }
  body.touch-device .tw-panel > .tw-card { max-height:calc(100dvh - 20px); }
  body.touch-device .tw-opt { grid-template-columns:1fr; }
  body.touch-device .tw-opt > * { min-width:0; }
  body.touch-device .tw-main .left,body.touch-device .tw-hub .side { width:100%; }
  body.touch-device .tw-profile,body.touch-device .tw-main .right { display:none; }
  body.touch-device .tw-hud .top { top:44px; }
  body.touch-device .tw-touch { --touch-size:.85 !important; }
  body.touch-device .tw-touch .utilities { top:52px; }
  body.touch-device .tw-lobby { flex-direction:column; gap:12px; }
  body.touch-device .tw-lobby .tw-stage { display:none; }
  body.touch-device .tw-lobby .lcol { position:static; width:100%; flex:none; }
  body.touch-device .tw-lobby .bar { position:sticky; bottom:0; left:auto; transform:none; max-width:none; flex:none; background:#142938ed; padding:8px; border-radius:12px; }
  body.touch-device .tw-lobby .tw-chatlog { flex:none; height:100px; }
}
