/* Touch controls use their own pointer state; menus remain scrollable. */
#game,.touch{touch-action:none;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
.touch-guest{display:none}
@media(any-pointer:coarse){
  body{overscroll-behavior:none}
  .arena{height:100%;height:100dvh}
  .touch{position:absolute;display:flex;align-items:end;gap:10px;left:max(16px,env(safe-area-inset-left));right:max(16px,env(safe-area-inset-right));bottom:max(16px,env(safe-area-inset-bottom));z-index:3;pointer-events:none}
  .touch button{display:flex;flex-direction:column;justify-content:center;align-items:center;min-width:64px;width:70px;height:70px;padding:4px;border:2px solid #90cee5;border-radius:20px;background:linear-gradient(#387ca9ed,#183f6aed);box-shadow:0 5px 0 #08253b,inset 0 2px #ffffff55;font:bold 27px Arial;touch-action:none;pointer-events:auto}
  .touch button small{font:800 10px Arial;margin-top:4px;white-space:nowrap}
  .touch button:nth-child(3){margin-left:auto}
  .touch button.touch-attack{width:90px;color:#fff5c0;border-color:#ffdd83;background:linear-gradient(#e9a137,#a74b25);box-shadow:0 5px 0 #6a301e,inset 0 2px #fff8}
  .touch button.pressed{transform:translateY(4px) scale(.96);filter:brightness(1.35);box-shadow:0 1px 0 #08253b,inset 0 3px 8px #0004}
  .touch-guest{display:none}
  .local-touch .touch{right:calc(50% + 8px);gap:5px}
  .local-touch .touch-guest{display:flex;left:calc(50% + 8px);right:max(12px,env(safe-area-inset-right))}
  .local-touch .touch button{width:52px;min-width:44px;height:58px;border-radius:14px}
  .local-touch .touch button small{font-size:8px}
  .overlay:not(.hidden)~.touch{display:none}
  .fire-meter{bottom:calc(98px + env(safe-area-inset-bottom))}
  .fire-meter kbd{font-size:0}
  .fire-meter kbd::after{content:'2× ATAK';font-size:10px}
  .fire-touch-hint{display:none}
  #sound,#restart,#fullscreen,#pause{top:max(8px,env(safe-area-inset-top));width:44px;height:44px}
  #restart{left:max(8px,env(safe-area-inset-left))}
  #pause{right:max(8px,env(safe-area-inset-right))}
  #fullscreen{right:calc(58px + env(safe-area-inset-right))}
  #sound{right:calc(108px + env(safe-area-inset-right))}
  .wallet{top:58px;left:max(8px,env(safe-area-inset-left));transform:scale(.8);transform-origin:left top}
  .menu-controls{font-size:0!important}
  .menu-controls>*{display:none}
  .menu-controls::after{content:'◀ ▶ RUCH · ↑ SKOK · ⚡ ATAK · 2× ⚡ OGNISTY ATAK';font-size:11px;display:block}
  .arena:after{display:none}
  .career-panel,.overlay,#fun-panel{touch-action:pan-y;overscroll-behavior:contain}
  .career-tabs button,.career-heading button,.modes button{min-height:44px}
}
@media(any-pointer:coarse) and (orientation:portrait){
  .scoreboard{top:calc(64px + env(safe-area-inset-top));gap:10px;padding:0 12px;max-width:100%;transform:translateX(-50%) scale(.85)}
  .team{font-size:14px}.flag{display:none}
  .announcement{top:24%;font-size:25px}
  .arena:after{content:'W poziomie boisko jest większe ↻';display:block;bottom:calc(205px + env(safe-area-inset-bottom));font-size:11px;color:#bddde8;text-align:center;pointer-events:none}
  .arena:has(.overlay:not(.hidden)):after{display:none}
  .local-touch .touch{right:max(16px,env(safe-area-inset-right));bottom:calc(90px + env(safe-area-inset-bottom))}
  .local-touch .touch-guest{left:max(16px,env(safe-area-inset-left));bottom:max(16px,env(safe-area-inset-bottom))}
  .local-touch .fire-meter{bottom:calc(160px + env(safe-area-inset-bottom))}
}
@media(any-pointer:coarse) and (orientation:landscape) and (max-height:500px){
  .scoreboard{top:max(5px,env(safe-area-inset-top));transform:translateX(-50%) scale(.65)}
  .touch button{height:58px;width:62px;min-width:54px;border-radius:16px}
  .touch button.touch-attack{width:78px}
  .fire-meter{bottom:calc(86px + env(safe-area-inset-bottom));transform:scale(.8);transform-origin:bottom left}
  .fire-meter.guest{transform-origin:bottom right}
  .overlay{overflow-y:auto;padding:12px max(12px,env(safe-area-inset-left)) max(12px,env(safe-area-inset-bottom))}
}
