.touch-look{display:none;pointer-events:none}
.touch-btn.utility,.orientation-gate{display:none}
.orientation-gate[hidden]{display:none!important}

/* Touch display settings belong on touch/coarse-pointer devices only. */
.touch-settings{display:none;pointer-events:auto;position:absolute;z-index:10;left:calc(2.6vw + env(safe-area-inset-left));top:23%;width:38px;height:38px;border:1px solid rgba(99,216,255,.72);border-radius:8px;background:rgba(0,0,0,.52);color:#63d8ff;font-family:inherit;font-size:18px;line-height:1;text-shadow:0 0 6px currentColor;box-shadow:0 0 8px rgba(99,216,255,.3);touch-action:manipulation}
.touch-settings-panel{display:none;pointer-events:auto;position:absolute;z-index:11;left:calc(2.6vw + 46px + env(safe-area-inset-left));top:23%;gap:7px;padding:7px;border:1px solid rgba(99,216,255,.35);background:rgba(0,0,0,.72);box-shadow:0 0 12px rgba(99,216,255,.18)}
.touch-settings-panel.open{display:none}
.touch-settings-panel button{pointer-events:auto;min-width:58px;height:38px;padding:0 8px;border:1px solid currentColor;background:rgba(0,0,0,.48);font-family:inherit;font-size:8px;letter-spacing:.04em;text-shadow:0 0 6px currentColor;touch-action:manipulation}
#settingsViewBtn{color:#63d8ff}#settingsBrightBtn{color:#e8ffe9}#settingsPerfBtn{color:#72ff8c}
#settingsPerfBtn[aria-pressed="true"]{background:rgba(114,255,140,.14);box-shadow:0 0 8px rgba(114,255,140,.24)}

/* The game is an application surface: suppress browser gestures on aiming and
   movement, while keeping button taps fast without affecting the landing page. */
#game,#game canvas,.touch-look,.stick,.stick-knob{touch-action:none;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}
.touch-btn,.touch-settings,.touch-settings-panel button{touch-action:manipulation;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}

@media (pointer:coarse){
  .touch-look{display:block;position:absolute;z-index:4;left:42%;right:0;top:18%;bottom:27%;pointer-events:auto;touch-action:none}
  .touch-btn{z-index:8;touch-action:manipulation;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}
  .touch-btn.utility{display:block;width:54px;height:54px;font-size:8px;letter-spacing:.03em;bottom:auto;background:rgba(0,0,0,.5)}
  .touch-btn.utility.pressed,.touch-btn:active{background:rgba(110,255,140,.18);filter:brightness(1.35)}

  /* Combat actions stay visible. Less-frequent display controls live in SETTINGS. */
  .missile{right:calc(4vw + env(safe-area-inset-right));top:calc(24% + env(safe-area-inset-top));color:#ffb45a}
  .nos{right:calc(4vw + env(safe-area-inset-right));top:calc(24% + 62px + env(safe-area-inset-top));color:#ffd45a}
  .view,.bright{display:none!important}

  .touch-settings{display:block;left:calc(4vw + env(safe-area-inset-left));top:calc(23% + env(safe-area-inset-top))}
  .touch-settings-panel{left:calc(4vw + 46px + env(safe-area-inset-left));top:calc(23% + env(safe-area-inset-top))}
  .touch-settings-panel.open{display:flex}

  .orientation-gate{position:fixed;inset:0;z-index:1000;display:flex;align-items:center;justify-content:center;padding:24px;background:radial-gradient(circle at 50% 45%,rgba(18,70,48,.28),#000 62%);color:#7dff8c;text-align:center;pointer-events:auto}
  .orientation-gate-card{max-width:330px}
  .orientation-gate-brand{font-size:clamp(24px,8vw,42px);letter-spacing:.34em;padding-left:.34em;text-shadow:0 0 12px #72ff8c,0 0 28px rgba(114,255,140,.45);margin-bottom:30px}
  .orientation-gate-icon{width:78px;height:48px;border:1px solid #63d8ff;border-radius:8px;margin:0 auto 25px;box-shadow:0 0 12px rgba(99,216,255,.45);transform:rotate(-90deg);animation:niterangeRotateHint 1.8s ease-in-out infinite alternate}
  .orientation-gate-icon span{display:block;width:6px;height:6px;border:1px solid #63d8ff;border-radius:50%;margin:20px 5px}
  .orientation-gate-title{font-size:18px;letter-spacing:.22em;color:#eaffed;text-shadow:0 0 8px #72ff8c;margin-bottom:12px}
  .orientation-gate-copy{font-size:10px;line-height:1.7;letter-spacing:.12em;color:#78b99a}
  @keyframes niterangeRotateHint{to{transform:rotate(0deg)}}

  body.mobile-portrait-blocked #game,
  body.mobile-portrait-blocked #hud,
  body.mobile-portrait-blocked #crt{visibility:hidden}
  body.mobile-portrait-blocked .orientation-gate{visibility:visible}
}

@media (orientation:landscape) and (pointer:coarse){
  .touch-btn.utility{width:52px;height:52px}
  .missile{top:calc(20% + env(safe-area-inset-top))}
  .nos{top:calc(20% + 60px + env(safe-area-inset-top))}
  .touch-settings{top:calc(20% + env(safe-area-inset-top))}
  .touch-settings-panel{top:calc(20% + env(safe-area-inset-top))}
}

@media (prefers-reduced-motion:reduce){.orientation-gate-icon{animation:none;transform:rotate(0)}}
