/* Two-thumb touch layout (src/ui/touch.js). CSS pixels: phone DPR never shrinks a target. --u follows the screen
   height on phones (54-66 px at 100 %) and stays compact and low on tablets. Left: a zone for the floating move stick
   plus the jump button. Right: the big Fire stick in the thumb's resting spot, Hook and weapon on the arc around it. */
.tw-touch { --touch-size:1; --touch-opacity:.75; --u:calc(clamp(54px, 15vh, 66px) * var(--touch-size));
  --gl:max(14px, env(safe-area-inset-left)); --gr:max(14px, env(safe-area-inset-right)); --gb:max(10px, env(safe-area-inset-bottom)); --gt:max(6px, env(safe-area-inset-top));
  --stick:calc(var(--u) * 1.7); --fire:calc(var(--u) * 1.3); --hook:calc(var(--u) * 1.05); --small:max(44px, calc(var(--u) * .76));
  --hd:calc((var(--fire) + var(--hook)) / 2 + 12px); --wd:calc((var(--fire) + var(--small)) / 2 + 10px);
  --fx0:calc(var(--gr) + 8px + var(--fire) / 2); --fy0:calc(var(--gb) + 6px + var(--fire) / 2); }
.tw-touch.swap { --fx0:calc(var(--gl) + 8px + var(--fire) / 2); }
@media (min-width:900px) and (min-height:600px) { .tw-touch { --u:calc(56px * var(--touch-size)); --gb:max(14px, env(safe-area-inset-bottom)); } }
.tw-touch button { display:flex; flex-direction:column; align-items:center; justify-content:center; box-sizing:border-box; padding:2px; background:#14293899; border:2px solid #e6f4ffcc; box-shadow:0 2px 6px #0006; opacity:var(--touch-opacity); font:700 calc(var(--u) * .4) Rubik,sans-serif; }
.tw-touch button.held { background:#4d6537cc; opacity:1; border-color:#ffd24a; }
.tw-touch button small { font:600 10px/1.1 Rubik,sans-serif; max-width:100%; overflow-wrap:anywhere; z-index:1; text-shadow:0 1px 2px #000; }
.tw-touch button span { z-index:1; line-height:1; }
.tw-touch button > i { position:absolute; left:29%; top:29%; width:42%; height:42%; box-sizing:border-box; border-radius:50%; border:1px solid #fff9; background:#fff3; transform:translate(var(--dx,0px),var(--dy,0px)); pointer-events:none; }
.tw-touch .movement { position:absolute; left:0; bottom:0; width:min(42vw, 400px); height:64%; pointer-events:auto; touch-action:none; }
.tw-touch .move { left:var(--gl); bottom:var(--gb); width:var(--stick); height:var(--stick); pointer-events:none; background:#14293855; border-style:dashed; transform:translate(var(--fx,0px),var(--fy,0px)); }
.tw-touch .move.held { border-style:solid; background:#14293899; }
.tw-touch .move span { opacity:.55; }
.tw-touch .jump { left:calc(var(--gl) + var(--stick) + 14px); bottom:calc(var(--gb) + 4px); width:var(--u); height:var(--u); }
.tw-touch .fire { right:calc(var(--fx0) - var(--fire) / 2); bottom:calc(var(--fy0) - var(--fire) / 2); width:var(--fire); height:var(--fire); background:#5c242099; font-size:calc(var(--u) * .5); }
.tw-touch .hook { right:calc(var(--fx0) + var(--hd) * .94 - var(--hook) / 2); bottom:calc(var(--fy0) + var(--hd) * .34 - var(--hook) / 2); width:var(--hook); height:var(--hook); }
.tw-touch .hook.latched { opacity:1; background:#6b5a1cdd; border:3px solid #ffd24a; box-shadow:0 0 0 3px #ffd24a55,0 2px 6px #0006; }
.tw-touch .next { right:calc(var(--fx0) - var(--small) / 2); bottom:calc(var(--fy0) + var(--wd) - var(--small) / 2); width:var(--small); height:var(--small); }
.tw-touch .next span { width:80%; height:62%; background:center/contain no-repeat; }
.tw-touch .next small { display:none; }
.tw-touch.swap .movement { left:auto; right:0; }
.tw-touch.swap .move { left:auto; right:var(--gr); }
.tw-touch.swap .jump { left:auto; right:calc(var(--gr) + var(--stick) + 14px); }
.tw-touch.swap .fire { right:auto; left:calc(var(--fx0) - var(--fire) / 2); }
.tw-touch.swap .hook { right:auto; left:calc(var(--fx0) + var(--hd) * .94 - var(--hook) / 2); }
.tw-touch.swap .next { right:auto; left:calc(var(--fx0) - var(--small) / 2); }
.tw-touch .utilities { position:absolute; right:var(--gr); top:var(--gt); display:flex; gap:8px; }
.tw-touch .utilities button { position:static; width:44px; height:44px; border-radius:12px; font-size:19px; }
.tw-touch .utilities small { display:none; }
.tw-touchhelp ul { margin:4px 0 10px; padding-left:18px; line-height:1.4; }
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; }
}
