/* Two-thumb controls live over the arena, leaving the middle clear. */
.touch-controls{display:none;position:absolute;inset:0;z-index:4;pointer-events:none;background:none;border:0;margin:0;padding:0;user-select:none;-webkit-user-select:none}
.touch-controls>.touch-left{display:block;position:absolute;left:max(18px,env(safe-area-inset-left));bottom:max(18px,env(safe-area-inset-bottom));width:150px}
.touch-controls>.touch-right{position:absolute;right:max(18px,env(safe-area-inset-right));bottom:max(18px,env(safe-area-inset-bottom));display:grid;gap:12px;justify-items:center}
.touch-controls button,.touch-stick{pointer-events:auto;touch-action:none;-webkit-touch-callout:none;border:1px solid #e1edf677;color:#f4f7fa;background:#101b2c66;box-shadow:inset 0 0 14px #ffffff0a,0 2px 6px #0003;text-shadow:0 1px 3px #000}
.touch-controls button{padding:0;border-radius:50%;font-weight:650;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:2px;min-width:44px;min-height:44px;line-height:1.1}
.touch-controls button:disabled{opacity:.35}
.touch-controls button.pressed,.touch-stick.pressed{border-color:#ddffad;background:#99cb6266;box-shadow:0 0 16px #b5f57844}
.touch-actions{display:grid;grid-template-columns:repeat(2,66px);gap:10px}
.touch-actions button{width:66px;height:66px;font-size:11px}
.touch-actions svg{width:24px;height:24px}
.touch-actions [data-key=heavy]{border-color:#f8ce9388;background:#38241766}
.touch-actions [data-key=dodge]{border-color:#b0d9ff99;background:#172e4266}
.touch-skills{display:flex;gap:9px}
.touch-skills button{width:46px;height:46px;font-size:12px}
.touch-skills b{font-size:14px;color:#d9f5b7}
.touch-skill-charge{font-size:9px;color:#eee}
.touch-skill-name{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.touch-skills .cooling{border-color:#aaa6;background:#151b2466;color:#b0b9c1}
.touch-stick{position:relative;width:120px;height:120px;border-radius:50%;margin:auto;cursor:grab}
.stick-thumb{position:absolute;left:50%;top:50%;width:48px;height:48px;margin:-24px;border-radius:50%;background:#d7e5f033;border:1px solid #edf6ff99;transform:translate(var(--stick-x,0px),var(--stick-y,0px));pointer-events:none}
.stick-up,.stick-down{position:absolute;left:0;width:100%;text-align:center;font-size:13px;color:#edf4f799;pointer-events:none}
.stick-up{top:6px}.stick-down{bottom:6px}
#touch-controls-hint{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);margin:0}
.touch-weapon{position:absolute;left:-54px;bottom:11px;width:44px;height:44px;font-size:10px}
.touch-weapon>span:first-child{font-size:18px}
.touch-rotate{display:none}
.arena-card:fullscreen{display:flex;flex-direction:column;width:100vw;height:100dvh;border:0;border-radius:0;background:#101218;overflow:hidden}
.arena-card:fullscreen .arena-toolbar{flex-shrink:0;height:38px}
.arena-card:fullscreen .game-stage{flex:1;min-height:0;aspect-ratio:auto}
.arena-card:fullscreen canvas{object-fit:fill}
.arena-card:fullscreen .arena-footer{flex-shrink:0}
#arena-training{display:none}
.arena-card:fullscreen #arena-training{display:inline-flex;align-items:center;min-height:32px;padding:6px 12px;font-size:11px;white-space:nowrap}
@media(any-pointer:coarse),(max-width:600px),(max-width:1000px) and (max-height:500px){
  .touch-controls:not([hidden]){display:block}
  .controls-strip{display:none}
  #animation-lab-link{display:none}
  body.mobile-battle{overflow:hidden}
  body.mobile-battle .arena-card{position:fixed;inset:0;z-index:60;margin:0;width:100%;height:100dvh;display:flex;flex-direction:column;border:0;border-radius:0;background:#101218}
  body.mobile-battle .arena-toolbar{height:34px;min-height:34px;padding:0 max(10px,env(safe-area-inset-right)) 0 max(10px,env(safe-area-inset-left));padding-top:env(safe-area-inset-top);box-sizing:content-box;flex-shrink:0}
  body.mobile-battle .arena-location strong{font-size:10px}
  body.mobile-battle .arena-location>span,body.mobile-battle #arena-room-label{display:none}
  body.mobile-battle .game-stage{flex:1;min-height:0;aspect-ratio:auto;background:#101218}
  body.mobile-battle .game-stage canvas{object-fit:contain}
  body.mobile-battle .arena-footer{min-height:30px;height:30px;padding:0 max(10px,env(safe-area-inset-right)) 0 max(10px,env(safe-area-inset-left));flex-shrink:0}
  body.mobile-battle .arena-hint,body.mobile-battle .server-tick,body.mobile-battle #ability-hud{display:none}
  body.mobile-battle .arena-footer-actions{width:100%;margin:0}
  body.mobile-battle #cancel-match{margin-right:auto}
  body.mobile-battle .match-hud{top:6px;left:12px;right:12px}
  body.mobile-battle .fighter-hud{max-width:34%}
}
@media(orientation:portrait){
  .touch-rotate{display:block;position:absolute;top:80px;left:0;right:0;text-align:center;font-size:12px;color:#ecf5d9;text-shadow:0 1px 4px #000}
  .touch-controls>.touch-left{left:max(8px,env(safe-area-inset-left));width:130px}
  .touch-controls>.touch-right{right:max(8px,env(safe-area-inset-right))}
}
@media(max-height:360px) and (orientation:landscape){
  .touch-controls>.touch-left,.touch-controls>.touch-right{bottom:max(8px,env(safe-area-inset-bottom))}
  .touch-controls>.touch-right{gap:8px}
  .touch-actions{grid-template-columns:repeat(2,58px);gap:8px}
  .touch-actions button{width:58px;height:58px}
  .touch-stick{width:104px;height:104px}
}
.arena-footer{height:auto;min-height:46px}
.arena-footer-actions{min-width:0;max-width:100%;flex-wrap:wrap}
.free-shooting-toggle{display:inline-flex;align-items:center;gap:6px;min-height:28px;margin:0;font-size:10px;white-space:nowrap;cursor:pointer}
.free-shooting-toggle input{appearance:none;width:30px;height:18px;flex:0 0 30px;border:1px solid #536457;border-radius:12px;padding:2px;background:#202b32;cursor:pointer}
.free-shooting-toggle input::before{content:"";display:block;width:12px;height:12px;border-radius:50%;background:#9aaab2;transition:transform .12s}
.free-shooting-toggle input:checked{background:#36522c;border-color:#b5f578}
.free-shooting-toggle input:checked::before{transform:translateX(12px);background:#b5f578}
body.mobile-battle .game-stage.free-shooting{touch-action:none}
