﻿/* v63 mobile key layout / touch priority */
@media (pointer: coarse){
  #lookZone{left:38%!important;right:0!important;top:12%!important;bottom:136px!important;z-index:20!important;touch-action:none!important;}
  #joystick{width:148px!important;height:148px!important;left:max(18px,env(safe-area-inset-left))!important;bottom:max(16px,env(safe-area-inset-bottom))!important;z-index:80!important;opacity:.82!important;touch-action:none!important;}
  #joystick:before{box-shadow:0 0 34px rgba(66,231,202,.36)!important;border-color:rgba(66,231,202,.58)!important;}
  .joystick-knob{box-shadow:0 0 26px rgba(66,231,202,.62)!important;background:rgba(66,231,202,.30)!important;}
  .action-buttons{right:max(14px,env(safe-area-inset-right))!important;bottom:max(16px,env(safe-area-inset-bottom))!important;z-index:90!important;gap:10px!important;pointer-events:auto!important;touch-action:none!important;}
  #fireButton{width:106px!important;height:106px!important;box-shadow:0 0 38px rgba(239,79,100,.5)!important;}
  #adsButton,#reloadButton{width:68px!important;height:68px!important;opacity:.96!important;}
  #abilityBar{z-index:82!important;bottom:max(18px,env(safe-area-inset-bottom))!important;left:50%!important;pointer-events:auto!important;}
  #zfLayoutEditV63{position:fixed;right:max(12px,env(safe-area-inset-right));top:88px;z-index:180;border:1px solid rgba(66,231,202,.55);background:rgba(7,14,22,.72);color:#dff;border-radius:999px;padding:9px 13px;font-weight:800;box-shadow:0 0 20px rgba(66,231,202,.22)}
  body.zf-layout-editing #joystick,body.zf-layout-editing #fireButton,body.zf-layout-editing #adsButton,body.zf-layout-editing #reloadButton,body.zf-layout-editing #abilityBar{outline:2px dashed #f7d17a!important;outline-offset:4px;}
}
.zf-skill-burst-v63{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);z-index:170;color:#8ffff2;font:900 28px/1 'Microsoft YaHei',sans-serif;letter-spacing:.12em;text-shadow:0 0 16px #42e7ca,0 0 38px #62b7ff;pointer-events:none;animation:zfSkillV63 .85s ease-out forwards;}
.zf-skill-burst-v63:before,.zf-skill-burst-v63:after{content:'';position:absolute;inset:-34px;border:2px solid rgba(66,231,202,.62);border-radius:50%;animation:zfSkillRingV63 .85s ease-out forwards}.zf-skill-burst-v63:after{inset:-58px;border-color:rgba(247,209,122,.42);animation-delay:.08s}
@keyframes zfSkillV63{0%{opacity:0;transform:translate(-50%,-50%) scale(.55)}18%{opacity:1}100%{opacity:0;transform:translate(-50%,-50%) scale(1.18)}}
@keyframes zfSkillRingV63{to{opacity:0;transform:scale(1.9) rotate(24deg)}}
@media (pointer:fine){#zfLayoutEditV63{display:none!important}}

/* v69: keep ammo/readout clear of custom mobile key cluster */
@media (pointer: coarse) and (orientation: landscape){
  .weapon-readout{
    position:fixed!important;
    right:max(14px,env(safe-area-inset-right))!important;
    bottom:calc(max(16px,env(safe-area-inset-bottom)) + 124px)!important;
    z-index:9960!important;
    min-width:190px!important;
    max-width:min(34vw,260px)!important;
    pointer-events:none!important;
    transform:none!important;
    padding:9px 12px!important;
    border:1px solid rgba(255,255,255,.18)!important;
    background:linear-gradient(135deg,rgba(6,12,20,.88),rgba(18,25,36,.74))!important;
    box-shadow:0 10px 28px rgba(0,0,0,.34),0 0 18px rgba(66,231,202,.12)!important;
  }
  .weapon-readout .ammo strong{
    font-size:clamp(28px,5.6vh,44px)!important;
    line-height:1!important;
  }
  .weapon-readout .ammo span{
    font-size:clamp(15px,2.8vh,22px)!important;
  }
  .action-buttons{
    right:max(14px,env(safe-area-inset-right))!important;
    bottom:max(14px,env(safe-area-inset-bottom))!important;
    z-index:9920!important;
  }
  #fireButton{
    width:min(18vh,104px)!important;
    height:min(18vh,104px)!important;
  }
  #adsButton,#reloadButton{
    width:min(12vh,66px)!important;
    height:min(12vh,66px)!important;
  }
  #joystick{
    bottom:max(18px,env(safe-area-inset-bottom))!important;
  }
  #zfLayoutEditV63{
    top:calc(max(8px,env(safe-area-inset-top)) + 74px)!important;
  }
}
/* v64 overlap cleanup */
@media (pointer: coarse){
  #zfMusicButtonV59,.quality-badge,.debug-badge,[class*="music" i][class*="badge" i]{display:none!important;}
  #zfLayoutEditV63{right:max(10px,env(safe-area-inset-right))!important;top:128px!important;z-index:220!important;}
  .weapon-readout{right:max(104px,env(safe-area-inset-right))!important;bottom:max(12px,env(safe-area-inset-bottom))!important;max-width:230px!important;}
  .action-buttons{bottom:max(16px,env(safe-area-inset-bottom))!important;}
  body.zf-map-snow #gameCanvas{filter:brightness(1.12) saturate(1.05) contrast(1.12)!important;background:#8daab8!important;}
}
/* v65 stronger mobile input fixes */
@media (pointer: coarse){
  #zfLayoutEditV63{display:block!important;pointer-events:auto!important;top:96px!important;right:max(8px,env(safe-area-inset-right))!important;z-index:9999!important;min-width:68px;min-height:44px;background:rgba(10,20,28,.92)!important;color:#fff!important;}
  #fireButton,#fireButton *{touch-action:none!important;}
  #fireButton span,#fireButton small{pointer-events:none!important;}
  #reloadButton,#adsButton{z-index:9990!important;pointer-events:auto!important;touch-action:manipulation!important;}
  .action-buttons{z-index:9980!important;pointer-events:auto!important;}
  #joystick{z-index:300!important;touch-action:none!important;}
  #lookZone{pointer-events:auto!important;}
body.zf-v65-snow-readable #gameCanvas{filter:brightness(.82) contrast(1.38) saturate(1.18)!important;background:#6f8998!important;}
}

/* v69 final override: this must stay after v64/v65 cleanup rules */
@media (pointer: coarse) and (orientation: landscape){
  .weapon-readout{
    position:fixed!important;
    right:max(14px,env(safe-area-inset-right))!important;
    bottom:calc(max(16px,env(safe-area-inset-bottom)) + 124px)!important;
    z-index:9960!important;
    min-width:190px!important;
    max-width:min(34vw,260px)!important;
    pointer-events:none!important;
    transform:none!important;
    padding:9px 12px!important;
  }
  .action-buttons{
    right:max(14px,env(safe-area-inset-right))!important;
    bottom:max(14px,env(safe-area-inset-bottom))!important;
    z-index:9920!important;
  }
}
