.touch-controls,.mobile-hud,.mobile-only,.reload-button{display:none}
@media (pointer:coarse),(max-width:900px){
  html:has(.game-shell),body:has(.game-shell){width:100%;height:100%;overflow:hidden;overscroll-behavior:none;touch-action:none}
  .game-shell,.game-grid,.canvas-wrap,#game{touch-action:none!important;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
  body:has(.game-shell) nav,body:has(.game-shell) footer{display:none}
  body:has(.game-shell) main{max-width:none;padding:0}
  .game-shell{position:fixed;left:var(--vv-left,0);top:var(--vv-top,0);padding:0;width:var(--vv-width,100vw);height:var(--game-vh,100dvh);overflow:hidden}
  .game-top{height:50px;padding:6px 10px;background:#090b16;gap:8px;justify-content:space-between}
  .game-top>.match-name,.game-top>#ping,.game-top>.leave-match{display:none!important}
  .game-top .timer{font-size:20px;margin-right:auto}
  .game-top .btn{width:auto;padding:8px 11px;font-size:11px}.mobile-only{display:inline-flex}
  .game-grid{display:block;width:100%;height:calc(100dvh - 50px);min-height:0}
  .game-grid aside{display:none}
  .canvas-wrap{width:100%;height:100%;min-height:0}
  .canvas-wrap{border:0;border-radius:0}
  .mobile-hud{display:grid;grid-template-columns:repeat(4,minmax(0,1fr)) 52px;position:absolute;z-index:7;top:8px;left:8px;right:8px;transform:none;gap:5px;padding:5px;background:#090b16e8;border:1px solid #303853;border-radius:8px;pointer-events:auto;box-shadow:0 5px 20px #0008}
  .mobile-hud span{display:flex;min-width:0;align-items:center;justify-content:center;padding:6px 4px;background:#171c31;border:1px solid #303853;border-radius:5px;font:700 9px Space Mono;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .mobile-hud #mobilePing{display:none}
  .mobile-hud .hud-stat{transition:color .2s,border-color .2s,background .2s,box-shadow .2s}
  .mobile-hud .hud-stat.healthy{color:#8effb5;border-color:#2ed57388;background:#123024;box-shadow:inset 0 0 12px #2ed57320}
  .mobile-hud #mobileArmor.healthy{color:#79e9ff;border-color:#00d2ff88;background:#102d38;box-shadow:inset 0 0 12px #00d2ff20}
  .mobile-hud #mobileAmmo.healthy{color:#fff2a3;border-color:#ffe66d88;background:#332f18;box-shadow:inset 0 0 12px #ffe66d1c}
  .mobile-hud .hud-stat.warning{color:#ffd18a;border-color:#ff9f1a99;background:#392615}
  .mobile-hud .hud-stat.critical{color:#ffd1dc;border-color:#ff4776;background:#451827;animation:hud-critical .55s infinite alternate}
  .mobile-hud .hud-stat.empty{color:#ff9baa;border-color:#773444;background:#28151c}
  .mobile-hud .hud-stat.neutral{color:#d9dded}
  .mobile-weapon-info{grid-column:1/-1;display:flex;align-items:center;gap:8px;min-width:0;padding:6px 9px;background:linear-gradient(90deg,#171d34,#101524);border:1px solid #343d60;border-radius:5px}
  .mobile-weapon-info b{flex:0 0 auto;font:700 10px Space Mono;color:#fff}
  .mobile-weapon-info small{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:600 9px Inter;color:#aeb7cd}
  .mobile-hud .reload-button{display:flex!important;align-items:center;justify-content:center;gap:2px;position:static;width:52px;height:40px;padding:0;border-radius:6px;border:2px solid #00d2ff;background:#10283a;color:#fff;box-shadow:0 0 14px #00d2ff66;touch-action:manipulation;pointer-events:auto}
  .reload-button b{font-size:22px;line-height:1}.reload-button small{font:800 9px Space Mono;color:var(--cyan)}
  .reload-button.reloading{animation:reload-mobile .55s infinite alternate;color:var(--cyan)}
  .touch-controls{display:flex;position:absolute;z-index:5;inset:0;align-items:flex-end;justify-content:space-between;padding:0 18px 24px;pointer-events:none}
  .stick-zone{width:clamp(88px,24vw,112px);aspect-ratio:1;border-radius:50%;border:1px solid #cfd5ff55;background:radial-gradient(circle,#20294499 0 38%,#10162b99 40% 67%,#090d1970 69%);position:relative;pointer-events:auto;touch-action:none;box-shadow:inset 0 0 14px #0009,0 4px 14px #0007;backdrop-filter:blur(3px)}
  .stick-zone:before{content:"";position:absolute;inset:13%;border-radius:50%;background:linear-gradient(90deg,transparent 49%,#ffffff18 50% 51%,transparent 52%),linear-gradient(transparent 49%,#ffffff18 50% 51%,transparent 52%);pointer-events:none}
  .stick-zone i{position:absolute;width:36%;height:36%;left:32%;top:32%;border-radius:50%;background:linear-gradient(145deg,#9a86ff,#6142dc);border:1px solid #c9beff;box-shadow:0 3px 9px #0008,0 0 10px #7c5cff88;will-change:transform}
  .fire-stick{border-color:#ff8b9666;background:radial-gradient(circle,#44202a99 0 38%,#29121c99 40% 67%,#090d1970 69%)}
  .fire-stick i{background:linear-gradient(145deg,#ff7b88,#d72d40);border-color:#ffc0c6;box-shadow:0 3px 9px #0008,0 0 10px #ff475788}
  .stick-zone span{position:absolute;left:15%;right:15%;bottom:8px;text-align:center;font:700 6px Space Mono;color:#ffffff88;letter-spacing:.7px;overflow:hidden;white-space:nowrap}
  .dead,.results{z-index:8;font-size:18px;padding:20px}
  .control-hud{top:96px;padding:5px 8px;gap:7px}.control-hud>b{font-size:13px}.point-badge{width:22px;height:22px}
  .control-hud.crown-mode{z-index:8;top:104px;min-width:190px;justify-content:center;border-color:#ffe66d88;background:linear-gradient(90deg,#211b0aee,#0c0e18ee);box-shadow:0 5px 18px #0009,0 0 16px #ffe66d33}
  .control-hud.crown-mode>span{max-width:115px;font-size:9px}.control-hud.crown-mode>strong{font-size:13px}
}
@keyframes reload-mobile{to{transform:rotate(35deg);box-shadow:0 0 28px #00d2ffaa}}
@keyframes hud-critical{to{color:#fff;background:#713047;box-shadow:0 0 13px #ff477688}}
@media (pointer:coarse) and (orientation:portrait){
  .stick-zone{width:clamp(92px,26vw,108px)}
  .touch-controls{padding:0 16px max(22px,4vh)}
}
@media (max-width:420px){
  .stick-zone{width:96px}
  .touch-controls{padding-left:14px;padding-right:14px}
}
@media (max-height:560px){
  .game-top{height:42px}.game-grid{height:calc(100dvh - 42px)}
  .stick-zone{width:84px}
  .touch-controls{padding:0 14px 12px}
  .mobile-hud{top:4px}.mobile-hud .reload-button{width:46px;height:36px}
}
@media (orientation:landscape) and (max-height:600px) and (max-width:1000px){
  .game-shell{position:fixed;left:var(--vv-left,0);top:var(--vv-top,0);width:var(--vv-width,100vw);height:var(--game-vh,100dvh)}
  .game-top{position:absolute;z-index:9;top:5px;left:max(7px,env(safe-area-inset-left));width:64px;height:42px;padding:0;background:transparent;pointer-events:none}
  .game-top .timer{display:flex;align-items:center;justify-content:center;width:64px;height:40px;margin:0;border:1px solid #25445c;border-radius:7px;background:#090b16e8;font-size:15px}
  .game-top .mobile-only{display:none}
  .game-grid{width:100%;height:100%}
  .canvas-wrap{width:100%;height:100%}
  .mobile-hud{grid-template-columns:repeat(4,minmax(58px,76px)) 44px minmax(135px,1fr);top:5px;left:max(78px,calc(env(safe-area-inset-left) + 78px));right:max(7px,env(safe-area-inset-right));gap:4px;padding:4px}
  .mobile-hud span{height:34px;padding:4px 3px;font-size:8px}
  .mobile-hud .reload-button{width:44px;height:34px}
  .mobile-weapon-info{grid-column:auto;height:34px;padding:4px 7px;gap:6px}
  .mobile-weapon-info b{font-size:9px}.mobile-weapon-info small{font-size:8px}
  .touch-controls{padding:max(8px,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))}
  .stick-zone{width:78px}
  .stick-zone span{bottom:6px;font-size:5px}
  .control-hud{position:absolute;top:54px;left:50%;transform:translateX(-50%)}
  .control-hud.crown-mode{top:54px}
}
@media (orientation:landscape) and (min-aspect-ratio:2/1) and (max-height:600px){
  .mobile-hud{grid-template-columns:1fr 1fr;top:52px;left:max(8px,env(safe-area-inset-left));right:auto;width:clamp(132px,18vw,205px);gap:5px;padding:5px}
  .mobile-hud span{width:auto;height:34px}
  .mobile-hud .reload-button{grid-column:1;width:100%;height:34px}
  .mobile-weapon-info{grid-column:2;height:34px;justify-content:center;padding:4px}
  .mobile-weapon-info b{font-size:8px;text-align:center}
  .mobile-weapon-info small{display:none}
  .control-hud{top:7px}
  .control-hud.crown-mode{top:7px;left:50%;width:auto}
}
@media (pointer:coarse),(max-width:900px){
  .game-top>.control-hud{display:none!important}
  .mobile-hud>.control-hud{position:static!important;grid-column:1/-1;top:auto!important;left:auto!important;right:auto!important;transform:none!important;width:100%!important;min-width:0;min-height:30px;margin:0;padding:4px 7px;justify-content:center;box-shadow:none}
  .mobile-hud>.control-hud.crown-mode{background:linear-gradient(90deg,#211b0a,#12111a)}
}
