:root {
  color-scheme: light;
  --navy: #163b4a;
  --navy-soft: #3e6470;
  --teal: #207f78;
  --mint: #9edfc2;
  --coral: #f47f66;
  --sun: #f5bf55;
  --paper: #fffdf4;
  --line: rgba(22, 59, 74, 0.18);
  font-family: 'Segoe UI', 'Microsoft JhengHei', 'Noto Sans TC', sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #c9eddf;
}
/* Only active touch gameplay suppresses page gestures. Menus remain zoomable. */
html.touch-playing,
html.touch-playing body,
html.touch-playing body * {
  touch-action: none !important;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
#zoom-recovery {
  max-width: 36em;
  color: #8a4d20;
  font-size: 14px;
  line-height: 1.5;
}
@media (orientation: landscape) and (max-height: 500px) {
  body.touch-mode .screen-pause {
    overflow-y: auto;
    align-items: start;
    padding: 8px 0;
  }
  body.touch-mode .pause-panel {
    width: min(600px, calc(100% - 32px));
    padding: 12px 20px;
  }
  body.touch-mode .pause-panel h2 {
    font-size: 27px;
    margin: 5px 0 7px;
  }
  body.touch-mode .pause-panel > p:not(.eyebrow) {
    font-size: 11px;
    margin-bottom: 8px;
    line-height: 1.5;
  }
  body.touch-mode .pause-panel .button-primary {
    height: 40px;
  }
  body.touch-mode .pause-panel .pause-hint {
    margin-top: 7px;
  }
}
body {
  color: var(--navy);
  position: relative;
  -webkit-font-smoothing: antialiased;
}
[hidden] {
  display: none !important;
}
button {
  font: inherit;
}
#game {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}
.scene-glow {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    135deg,
    rgba(255, 244, 195, 0.055),
    rgba(211, 248, 225, 0.02) 54%,
    rgba(255, 221, 186, 0.045)
  );
}
.masthead,
.control-strip {
  position: fixed;
  z-index: 5;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  pointer-events: none;
}
.masthead {
  top: 0;
  height: 68px;
  padding: 0 clamp(20px, 4.2vw, 68px);
  border-bottom: 1px solid rgba(22, 59, 74, 0.12);
  justify-content: space-between;
  background: rgba(255, 253, 244, 0.57);
  backdrop-filter: blur(12px);
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--navy);
  font-size: 11px;
  letter-spacing: 0.09em;
  font-weight: 750;
}
.wordmark i,
.version span,
.controls-note span {
  color: var(--teal);
  font-style: normal;
  margin: 0 3px;
}
.mark-icon {
  display: inline-grid;
  place-items: center;
  width: 27px;
  height: 27px;
  color: #fff;
  border-radius: 9px 9px 9px 3px;
  background: var(--coral);
  font-size: 15px;
  transform: rotate(-7deg);
  box-shadow: 0 3px 0 rgba(163, 69, 53, 0.18);
}
.build-label,
.version,
.eyebrow,
.card-topline,
.signal-label,
.card-footer,
.hud-kicker,
.controls-label,
.controls-note {
  font-family: 'Segoe UI', 'Arial', sans-serif;
  letter-spacing: 0.12em;
  font-size: 9px;
  font-weight: 700;
}
.build-label {
  color: var(--navy-soft);
  display: flex;
  gap: 8px;
  align-items: center;
}
.build-label b {
  color: var(--coral);
}
.live-dot,
.controls-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4aae83;
  box-shadow: 0 0 0 3px rgba(74, 174, 131, 0.16);
}
.version {
  color: var(--navy-soft);
}
main {
  position: fixed;
  z-index: 2;
  inset: 68px 0 62px;
  pointer-events: none;
}
.screen {
  position: absolute;
  inset: 0;
  pointer-events: auto;
}
.screen-menu {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 294px;
  align-items: center;
  gap: clamp(28px, 6.4vw, 104px);
  padding: 26px clamp(24px, 10vw, 158px) 20px clamp(28px, 10.8vw, 172px);
}
.hero-copy {
  max-width: 610px;
}
.eyebrow {
  color: var(--teal);
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 0 17px;
}
.eyebrow-rule {
  display: inline-block;
  width: 29px;
  height: 2px;
  border-radius: 3px;
  background: var(--coral);
}
h1 {
  margin: 0;
  display: flex;
  flex-direction: column;
  font-family: 'Arial Narrow', 'Segoe UI', sans-serif;
  font-size: clamp(82px, 10.4vw, 142px);
  line-height: 0.76;
  letter-spacing: -0.075em;
  font-weight: 850;
  color: var(--navy);
  text-shadow: 0 3px rgba(255, 255, 255, 0.44);
}
h1 span + span {
  margin-top: 11px;
}
h1 .title-light {
  color: var(--teal);
}
.title-period {
  color: var(--coral);
}
.subtitle {
  margin: 15px 0 0 5px;
  color: var(--coral);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.12em;
}
.hero-lower {
  display: flex;
  align-items: flex-start;
  gap: clamp(17px, 2.6vw, 40px);
  margin-top: 19px;
}
.chinese-lead {
  font-size: clamp(16px, 1.5vw, 21px);
  letter-spacing: 0.08em;
  font-weight: 750;
  line-height: 1.75;
  white-space: nowrap;
  margin: 0;
  color: var(--navy);
}
.hero-description {
  margin: 4px 0 0;
  padding-left: clamp(14px, 1.8vw, 25px);
  border-left: 2px solid var(--mint);
  color: var(--navy-soft);
  font-size: 12px;
  font-weight: 550;
  line-height: 2;
  letter-spacing: 0.035em;
}
.hero-actions {
  margin-top: 23px;
  display: flex;
  align-items: center;
  gap: 17px;
}
.button-primary {
  height: 51px;
  min-width: 220px;
  border: 0;
  border-radius: 15px;
  color: #fff;
  background: var(--teal);
  box-shadow:
    0 5px 0 #155e59,
    0 8px 17px rgba(32, 127, 120, 0.18);
  display: inline-flex;
  align-items: center;
  gap: 13px;
  padding: 0 17px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.06em;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
}
.button-primary:hover {
  background: #29958b;
  transform: translateY(-2px);
  box-shadow:
    0 7px 0 #155e59,
    0 10px 20px rgba(32, 127, 120, 0.22);
}
.button-primary:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #155e59;
}
.button-primary:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 4px;
}
.button-icon {
  font-size: 14px;
}
.button-en {
  margin-left: auto;
  font:
    800 8px 'Segoe UI',
    sans-serif;
  letter-spacing: 0.13em;
  color: #c4f0df;
}
.action-note {
  color: var(--navy-soft);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.keycap {
  border: 1px solid rgba(22, 59, 74, 0.3);
  color: var(--navy);
  border-radius: 5px;
  font:
    700 8px 'Segoe UI',
    sans-serif;
  letter-spacing: 0.08em;
  padding: 4px 6px;
  margin-right: 5px;
  background: rgba(255, 255, 255, 0.35);
}
.mission-card {
  align-self: center;
  width: 100%;
  min-height: 286px;
  padding: 20px 20px 0;
  border-radius: 18px;
  background: rgba(255, 253, 244, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow:
    0 14px 36px rgba(53, 108, 95, 0.12),
    inset 0 1px rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
}
.card-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--navy);
  font-size: 10px;
}
.card-index {
  color: var(--navy-soft);
  font-size: 8px;
}
.card-index i {
  color: var(--coral);
  font-style: normal;
}
.signal-block {
  padding: 20px 0 15px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.signal-label {
  color: var(--teal);
  font-size: 8px;
}
.signal-reading {
  font:
    800 40px/1 'Segoe UI',
    sans-serif;
  letter-spacing: 0.01em;
  color: var(--navy);
}
.signal-unit {
  color: var(--coral);
  font:
    800 13px 'Segoe UI',
    sans-serif;
  letter-spacing: 0.08em;
  margin-left: 5px;
}
.card-divider {
  height: 1px;
  background: var(--line);
  margin-bottom: 8px;
}
.mission-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(22, 59, 74, 0.09);
  font-size: 10px;
}
.row-label {
  color: var(--navy-soft);
  letter-spacing: 0.025em;
  font-weight: 600;
}
.row-value {
  color: var(--navy);
  letter-spacing: 0.02em;
  font-weight: 750;
}
.row-value.friendly {
  color: var(--teal);
}
.threat-mark {
  font-size: 10px;
  margin-right: 3px;
  color: var(--coral);
}
.card-footer {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: #648076;
  font-size: 7px;
}
.card-emblem {
  color: var(--coral);
  font-size: 17px;
}
.control-strip {
  bottom: 0;
  height: 62px;
  padding: 0 clamp(18px, 4.2vw, 68px);
  border-top: 1px solid rgba(22, 59, 74, 0.1);
  gap: clamp(11px, 1.9vw, 29px);
  background: rgba(255, 253, 244, 0.75);
  backdrop-filter: blur(12px);
}
.controls-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--navy);
  font-size: 8px;
  white-space: nowrap;
}
.manual-divider {
  color: var(--coral);
}
.control-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--navy-soft);
  font-size: 9px;
  font-weight: 600;
  white-space: nowrap;
}
.keygroup {
  display: flex;
  gap: 2px;
}
kbd {
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(22, 59, 74, 0.22);
  border-radius: 5px;
  color: var(--navy);
  font:
    750 7px 'Segoe UI',
    sans-serif;
  letter-spacing: 0.035em;
  background: rgba(255, 255, 255, 0.65);
  box-shadow: 0 1px 0 rgba(22, 59, 74, 0.11);
}
.controls-note {
  margin-left: auto;
  color: #57776f;
  font-size: 8px;
  white-space: nowrap;
}
.screen-pause,
.screen-result {
  display: grid;
  place-items: center;
  background: rgba(244, 250, 231, 0.38);
  backdrop-filter: blur(3px);
}
.pause-panel,
.result-panel {
  width: min(440px, calc(100% - 40px));
  padding: 29px 34px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 21px;
  background: rgba(255, 253, 244, 0.95);
  box-shadow: 0 16px 48px rgba(34, 89, 78, 0.2);
}
.pause-panel h2,
.result-panel h2 {
  font-size: 48px;
  line-height: 1.1;
  letter-spacing: -0.04em;
  margin: 9px 0 12px;
  color: var(--navy);
}
.pause-panel h2 span,
.result-panel h2 span {
  color: var(--coral);
}
.pause-panel > p:not(.eyebrow),
.result-detail {
  color: var(--navy-soft);
  font-size: 13px;
  line-height: 1.8;
  margin: 0 0 21px;
}
.pause-panel .button-primary,
.result-panel .button-primary {
  width: 100%;
}
.pause-hint {
  margin-top: 18px;
  color: var(--navy-soft);
  font-size: 10px;
  font-weight: 600;
}
.result-score {
  padding: 13px 0 16px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.result-score span {
  color: var(--navy-soft);
  font:
    700 10px 'Segoe UI',
    'Microsoft JhengHei',
    sans-serif;
  letter-spacing: 0.07em;
}
.result-score strong {
  color: var(--teal);
  font:
    750 clamp(16px, 2vw, 22px) 'Segoe UI',
    'Microsoft JhengHei',
    sans-serif;
  letter-spacing: 0.025em;
  text-align: right;
}
.hud {
  position: fixed;
  z-index: 4;
  inset: 0;
  pointer-events: none;
}
.hud-top {
  position: absolute;
  top: 84px;
  left: clamp(20px, 4.2vw, 68px);
  right: clamp(20px, 4.2vw, 68px);
  display: flex;
  align-items: flex-start;
  gap: 38px;
  padding: 11px 16px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 18px;
  background: rgba(255, 253, 244, 0.78);
  box-shadow: 0 5px 18px rgba(35, 91, 79, 0.09);
  backdrop-filter: blur(9px);
}
.hud-mission {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-right: auto;
}
.hud-symbol {
  color: var(--coral);
  font-size: 25px;
}
.hud-mission > div,
.wave-readout,
.timer-readout,
.vitals,
.combat-readout,
.ammo-readout,
.best-readout {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.hud-kicker {
  color: #285e61;
  font-size: 8px;
  letter-spacing: 0.04em;
}
.hud-kicker i {
  color: var(--coral);
  font-style: normal;
}
.hud-mission strong,
.wave-readout strong,
.timer-readout strong,
.health-line strong,
.combat-readout strong,
.ammo-readout strong,
.best-readout strong {
  color: var(--navy);
  font:
    800 13px 'Segoe UI',
    'Microsoft JhengHei',
    sans-serif;
  letter-spacing: 0.025em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}
.hud-mission strong i,
.wave-readout strong i,
.ammo-readout strong i {
  color: var(--teal);
  font-style: normal;
  font-weight: 700;
}
.wave-readout strong {
  font-size: 19px;
}
.wave-readout strong i,
.ammo-readout strong i {
  font-size: 11px;
}
.timer-readout strong {
  font-size: 18px;
}
.hud-bottom {
  position: absolute;
  bottom: 81px;
  left: clamp(20px, 4.2vw, 68px);
  right: clamp(20px, 4.2vw, 68px);
  display: flex;
  align-items: end;
  gap: clamp(17px, 3vw, 46px);
  padding: 11px 16px 15px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 18px;
  background: rgba(255, 253, 244, 0.8);
  box-shadow: 0 5px 18px rgba(35, 91, 79, 0.1);
  backdrop-filter: blur(9px);
}
.health-line {
  display: flex;
  align-items: center;
  gap: 4px;
}
.health-icon {
  color: var(--coral);
  font-size: 16px;
  margin-right: 3px;
}
.health-line strong {
  font-size: 22px;
}
.health-line .unit {
  color: var(--navy-soft);
  font-size: 10px;
  font-weight: 700;
}
.combat-readout strong {
  font-size: 20px;
}
.combat-readout small {
  font-size: 8px;
  color: var(--navy-soft);
}
.ammo-readout {
  margin-left: auto;
}
.ammo-readout strong {
  font-size: 24px;
}
.best-readout strong {
  font-size: 13px;
}
.status-readout {
  position: absolute;
  left: 50%;
  bottom: -8px;
  transform: translateX(-50%);
  color: #165f66;
  font:
    750 10px 'Segoe UI',
    'Microsoft JhengHei',
    sans-serif;
  letter-spacing: 0.03em;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.9);
  white-space: nowrap;
}
.crosshair {
  position: fixed;
  z-index: 3;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  filter: drop-shadow(0 1px 2px rgba(255, 255, 255, 0.8));
}
.crosshair i {
  position: absolute;
  background: rgba(22, 59, 74, 0.84);
  display: block;
  border-radius: 2px;
}
.crosshair i:nth-child(1),
.crosshair i:nth-child(2) {
  width: 2px;
  height: 6px;
  left: 11px;
}
.crosshair i:nth-child(1) {
  top: 0;
}
.crosshair i:nth-child(2) {
  bottom: 0;
}
.crosshair i:nth-child(3),
.crosshair i:nth-child(4) {
  height: 2px;
  width: 6px;
  top: 11px;
}
.crosshair i:nth-child(3) {
  left: 0;
}
.crosshair i:nth-child(4) {
  right: 0;
}
.damage-flash {
  position: fixed;
  z-index: 6;
  inset: 0;
  pointer-events: none;
  opacity: 0;
}
.damage-flash.active {
  animation: damage-pulse 0.35s ease-out both;
}
.hitmarker {
  opacity: 0;
  position: fixed;
  z-index: 4;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.hitmarker i {
  position: absolute;
  width: 6px;
  height: 1px;
  background: var(--teal);
  top: 8px;
  left: 6px;
  transform-origin: center;
}
.hitmarker i:nth-child(1) {
  transform: translate(-5px, -5px) rotate(45deg);
}
.hitmarker i:nth-child(2) {
  transform: translate(5px, -5px) rotate(-45deg);
}
.hitmarker i:nth-child(3) {
  transform: translate(-5px, 5px) rotate(-45deg);
}
.hitmarker i:nth-child(4) {
  transform: translate(5px, 5px) rotate(45deg);
}
.hitmarker.active {
  animation: hit-confirm 0.14s ease-out both;
}
@keyframes damage-pulse {
  0% {
    opacity: 0.9;
    background: radial-gradient(ellipse, transparent 55%, rgba(244, 191, 85, 0.65));
  }
  100% {
    opacity: 0;
    background: radial-gradient(ellipse, transparent 55%, rgba(244, 191, 85, 0.65));
  }
}
@keyframes hit-confirm {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.6);
  }
  35% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.25);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1);
  }
}
.no-js,
.startup-error {
  position: fixed;
  z-index: 10;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(420px, calc(100% - 32px));
  padding: 24px;
  background: var(--paper);
  border: 2px solid var(--coral);
  border-radius: 18px;
  text-align: center;
  color: var(--navy);
  box-shadow: 0 12px 40px rgba(22, 59, 74, 0.18);
}
.no-js {
  display: block;
}
.no-js > span,
.startup-error > span {
  color: var(--coral);
  font:
    800 11px 'Segoe UI',
    'Microsoft JhengHei',
    sans-serif;
  letter-spacing: 0.08em;
}
.no-js p,
.startup-error p {
  font-size: 12px;
  color: var(--navy-soft);
  line-height: 1.8;
}
@media (max-width: 940px) {
  .screen-menu {
    grid-template-columns: minmax(0, 1fr) 270px;
    gap: 28px;
    padding-left: 6vw;
    padding-right: 6vw;
  }
  .control-strip {
    gap: 14px;
  }
  .controls-note {
    display: none;
  }
  .hero-description {
    font-size: 11px;
  }
}
@media (max-width: 680px) {
  .masthead {
    height: 58px;
    padding: 0 17px;
  }
  .build-label {
    display: none;
  }
  .version {
    font-size: 8px;
  }
  main {
    inset: 58px 0 56px;
  }
  .screen-menu {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 17px;
    overflow-y: auto;
    padding: 20px 23px;
  }
  .eyebrow {
    margin-bottom: 13px;
    font-size: 8px;
  }
  h1 {
    font-size: clamp(69px, 16vw, 98px);
  }
  h1 span + span {
    margin-top: 7px;
  }
  .subtitle {
    margin-top: 10px;
    font-size: 15px;
  }
  .hero-lower {
    margin-top: 13px;
    gap: 13px;
  }
  .chinese-lead {
    font-size: 15px;
  }
  .hero-description {
    font-size: 10px;
    padding-left: 12px;
    margin-top: 2px;
  }
  .hero-actions {
    margin-top: 17px;
    gap: 12px;
  }
  .button-primary {
    min-width: 190px;
    height: 47px;
  }
  .action-note {
    font-size: 9px;
  }
  .mission-card {
    min-height: 0;
    max-width: 430px;
    padding: 13px 15px 0;
  }
  .signal-block {
    padding: 12px 0 10px;
  }
  .signal-reading {
    font-size: 29px;
  }
  .mission-row {
    padding: 6px 0;
  }
  .card-footer {
    min-height: 30px;
  }
  .control-strip {
    height: 56px;
    padding: 0 11px;
    gap: 10px;
    overflow-x: auto;
  }
  .controls-label {
    flex-shrink: 0;
    font-size: 7px;
  }
  .control-item {
    gap: 5px;
    font-size: 8px;
  }
  kbd {
    min-width: 16px;
    height: 16px;
    font-size: 6px;
  }
  .hud-top {
    top: 65px;
    left: 14px;
    right: 14px;
    gap: 13px;
    padding: 9px 10px;
  }
  .hud-mission strong {
    font-size: 10px;
  }
  .hud-symbol {
    font-size: 18px;
  }
  .wave-readout strong {
    font-size: 16px;
  }
  .timer-readout strong {
    font-size: 15px;
  }
  .hud-bottom {
    left: 14px;
    right: 14px;
    bottom: 76px;
    gap: 13px;
    padding: 9px 10px 13px;
  }
  .best-readout {
    display: none;
  }
  .status-readout {
    bottom: -8px;
    font-size: 9px;
  }
  .hud-kicker {
    font-size: 7px;
  }
}
@media (max-width: 390px) {
  .screen-menu {
    padding-left: 18px;
    padding-right: 18px;
    gap: 13px;
  }
  .hero-lower {
    gap: 9px;
  }
  .chinese-lead {
    font-size: 13px;
  }
  .hero-description {
    font-size: 9px;
  }
  .action-note {
    display: none;
  }
  .controls-label {
    display: none;
  }
  .hud-mission strong {
    max-width: 160px;
  }
  .hud-top {
    gap: 10px;
  }
  .hud-bottom {
    gap: 10px;
  }
}

.button-keyboard {
  margin-top: 16px;
  padding: 12px;
  width: 100%;
  color: var(--teal);
  background: var(--paper);
  border: 1px solid var(--teal);
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
}

/* Touch controls are layered above the game while their empty areas pass through. */
.minimap-panel {
  position: absolute;
  top: 84px;
  right: clamp(20px, 4.2vw, 68px);
  width: 216px;
  padding: 11px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 17px;
  background: rgba(255, 253, 244, 0.9);
  box-shadow: 0 7px 22px rgba(35, 91, 79, 0.13);
  pointer-events: none;
}
#minimap {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  border-radius: 10px;
  background: #d7efe2;
}
.minimap-legend {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  color: var(--navy);
  font-size: 8px;
  font-weight: 700;
  white-space: nowrap;
}
.minimap-legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.minimap-legend i {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #277ccb;
}
.minimap-legend .legend-robot {
  background: #f49a42;
}
.minimap-legend .legend-spawn {
  background: var(--sun);
  border: 1px dashed #a36b15;
}
.hud-top {
  right: calc(clamp(20px, 4.2vw, 68px) + 236px);
}
.spawn-warning {
  position: fixed;
  z-index: 8;
  top: 286px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 18px;
  border: 2px solid #e4a33d;
  border-radius: 999px;
  color: #69420c;
  background: rgba(255, 239, 181, 0.95);
  box-shadow: 0 5px 18px rgba(80, 65, 28, 0.14);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  pointer-events: none;
}
.touch-instructions {
  display: none;
  margin: 10px 0 0;
  color: var(--teal);
  font-size: 11px;
  font-weight: 700;
}
.touch-controls {
  position: fixed;
  z-index: 9;
  inset: 0;
  display: block;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}
.touch-controls *,
.touch-controls {
  -webkit-tap-highlight-color: transparent;
}
.look-zone {
  position: fixed;
  top: 0;
  right: 0;
  width: 50vw;
  height: 100dvh;
  pointer-events: auto;
  touch-action: none;
  background: transparent;
}
.touch-button,
.move-stick {
  position: fixed;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.touch-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 19px;
  color: #fff;
  background: rgba(32, 127, 120, 0.92);
  box-shadow:
    0 4px 0 rgba(21, 94, 89, 0.8),
    0 5px 15px rgba(31, 71, 72, 0.2);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.1;
  cursor: pointer;
}
.touch-button:active,
.touch-button.is-pressed,
.touch-button.pressed {
  transform: scale(0.94);
  background: #155e59;
}
.touch-button {
  padding: 3px;
}
.touch-button > span {
  white-space: nowrap;
}
.touch-button > span:first-child {
  font-size: 18px;
}
.touch-fire {
  width: 76px;
  height: 76px;
  right: max(17px, env(safe-area-inset-right));
  bottom: max(19px, env(safe-area-inset-bottom));
  border-radius: 50%;
  background: var(--coral);
  box-shadow:
    0 5px 0 #be5845,
    0 5px 15px rgba(31, 71, 72, 0.2);
}
.touch-fire:active,
.touch-fire.is-pressed {
  background: #d56750;
}
.touch-fire .fire-icon {
  font-size: 20px;
}
.touch-sprint {
  width: 58px;
  height: 58px;
  right: max(107px, calc(env(safe-area-inset-right) + 100px));
  bottom: max(24px, env(safe-area-inset-bottom));
  border-radius: 18px;
  background: #e5a93e;
  box-shadow:
    0 4px 0 #b27a20,
    0 5px 15px rgba(31, 71, 72, 0.18);
}
.touch-reload {
  width: 58px;
  height: 58px;
  right: max(22px, env(safe-area-inset-right));
  bottom: max(108px, calc(env(safe-area-inset-bottom) + 96px));
  border-radius: 18px;
  background: var(--teal);
}
.touch-pause {
  width: 48px;
  height: 48px;
  top: max(10px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  border-radius: 15px;
  font-size: 15px;
}
.touch-pause span {
  font-size: 9px;
}
.move-stick {
  width: 112px;
  height: 112px;
  left: max(18px, env(safe-area-inset-left));
  bottom: max(18px, env(safe-area-inset-bottom));
  border: 2px solid rgba(255, 255, 255, 0.83);
  border-radius: 50%;
  background: rgba(255, 253, 244, 0.43);
  box-shadow:
    inset 0 0 0 1px rgba(32, 127, 120, 0.18),
    0 5px 18px rgba(31, 71, 72, 0.13);
  touch-action: none;
}
.move-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 49px;
  height: 49px;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(255, 255, 255, 0.93);
  border-radius: 50%;
  background: rgba(32, 127, 120, 0.86);
  box-shadow: 0 3px 9px rgba(22, 59, 74, 0.22);
  pointer-events: none;
}
.stick-label {
  position: absolute;
  left: 50%;
  bottom: 11px;
  transform: translateX(-50%);
  color: var(--navy);
  font-size: 9px;
  font-weight: 800;
  text-shadow: 0 1px 2px #fff;
}
body.touch-mode .masthead {
  height: 52px;
  padding-top: env(safe-area-inset-top);
}
body.touch-mode .build-label,
body.touch-mode .control-strip {
  display: none;
}
body.touch-mode main {
  inset: calc(52px + env(safe-area-inset-top)) 0 0;
}
body.touch-mode .touch-instructions {
  display: block;
}
body.touch-mode .minimap-panel {
  top: calc(62px + env(safe-area-inset-top));
  left: max(10px, env(safe-area-inset-left));
  right: auto;
  width: 122px;
  padding: 7px;
  border-radius: 13px;
}
body.touch-mode .minimap-legend {
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 4px 8px;
  margin-top: 6px;
  font-size: 7px;
}
body.touch-mode .minimap-legend i {
  width: 6px;
  height: 6px;
}
body.touch-mode .hud-top {
  top: calc(62px + env(safe-area-inset-top));
  left: 144px;
  right: max(68px, calc(env(safe-area-inset-right) + 62px));
  gap: 12px;
  padding: 8px 10px;
  border-radius: 14px;
}
body.touch-mode .hud-mission {
  display: none;
}
body.touch-mode .wave-readout,
body.touch-mode .timer-readout {
  gap: 3px;
}
body.touch-mode .hud-kicker {
  font-size: 7px;
}
body.touch-mode .wave-readout strong,
body.touch-mode .timer-readout strong {
  font-size: 15px;
}
body.touch-mode .hud-bottom {
  left: 145px;
  right: max(68px, calc(env(safe-area-inset-right) + 62px));
  bottom: auto;
  top: calc(116px + env(safe-area-inset-top));
  gap: 12px;
  padding: 7px 10px;
  border-radius: 13px;
}
body.touch-mode .health-line strong,
body.touch-mode .combat-readout strong,
body.touch-mode .ammo-readout strong {
  font-size: 17px;
}
body.touch-mode .hud-bottom .best-readout {
  display: none;
}
body.touch-mode .status-readout {
  display: none;
}
body.touch-mode .spawn-warning {
  top: calc(180px + env(safe-area-inset-top));
  font-size: 12px;
}
body.touch-mode .touch-controls:not([hidden]) .look-zone {
  display: block;
}
body.touch-mode .touch-controls:not([hidden]) .touch-button,
body.touch-mode .touch-controls:not([hidden]) .move-stick {
  display: flex;
}
body.touch-mode .touch-controls:not([hidden]) .move-stick {
  display: block;
}
body.touch-mode:has(#pause:not([hidden])) #touch-controls,
body.touch-mode:has(#result:not([hidden])) #touch-controls {
  display: none;
}
@media (max-width: 680px) {
  .minimap-panel {
    width: 164px;
    top: 72px;
    right: 12px;
    padding: 8px;
  }
  .minimap-legend {
    gap: 4px;
    font-size: 7px;
  }
  .hud-top {
    top: 65px;
    left: 12px;
    right: 186px;
    gap: 9px;
    padding: 8px;
  }
}
@media (orientation: landscape) and (max-height: 500px) {
  body.touch-mode .masthead {
    height: 40px;
  }
  body.touch-mode main {
    inset: calc(40px + env(safe-area-inset-top)) 0 0;
  }
  body.touch-mode .screen-menu {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 18px;
    padding: 7px 24px 6px;
  }
  body.touch-mode .hero-copy {
    max-width: none;
  }
  body.touch-mode .eyebrow {
    margin-bottom: 8px;
    font-size: 7px;
  }
  body.touch-mode h1 {
    flex-direction: row;
    align-items: baseline;
    gap: 13px;
    font-size: clamp(46px, 8vw, 69px);
    line-height: 0.9;
    letter-spacing: -0.07em;
  }
  body.touch-mode h1 span + span {
    margin-top: 0;
  }
  body.touch-mode .subtitle {
    margin: 5px 0 0 2px;
    font-size: 13px;
  }
  body.touch-mode .hero-lower {
    margin-top: 7px;
    gap: 12px;
  }
  body.touch-mode .chinese-lead {
    font-size: 13px;
    line-height: 1.5;
  }
  body.touch-mode .hero-description {
    font-size: 9px;
    line-height: 1.5;
  }
  body.touch-mode .hero-actions {
    margin-top: 10px;
    gap: 10px;
  }
  body.touch-mode .hero-actions .button-primary {
    height: 40px;
    min-width: 170px;
    border-radius: 12px;
  }
  body.touch-mode .mission-card {
    min-height: 0;
    padding: 12px 14px 0;
    border-radius: 14px;
  }
  body.touch-mode .signal-block {
    padding: 8px 0;
  }
  body.touch-mode .signal-reading {
    font-size: 27px;
  }
  body.touch-mode .mission-row {
    padding: 5px 0;
    font-size: 9px;
  }
  body.touch-mode .card-footer {
    min-height: 26px;
  }
  body.touch-mode .touch-instructions {
    margin-top: 5px;
    font-size: 9px;
  }
  body.touch-mode .minimap-panel {
    top: calc(48px + env(safe-area-inset-top));
    width: 100px;
  }
  body.touch-mode .minimap-legend {
    font-size: 6px;
  }
  body.touch-mode .hud-top {
    top: calc(48px + env(safe-area-inset-top));
    left: 116px;
    right: 68px;
  }
  body.touch-mode .hud-bottom {
    top: calc(100px + env(safe-area-inset-top));
    left: 116px;
    right: 68px;
  }
  body.touch-mode .move-stick {
    width: 100px;
    height: 100px;
    bottom: max(12px, env(safe-area-inset-bottom));
  }
  body.touch-mode .touch-fire {
    width: 63px;
    height: 63px;
    bottom: max(12px, env(safe-area-inset-bottom));
  }
  body.touch-mode .touch-sprint {
    width: 51px;
    height: 51px;
    right: max(91px, calc(env(safe-area-inset-right) + 84px));
    bottom: max(17px, env(safe-area-inset-bottom));
  }
  body.touch-mode .touch-reload {
    width: 51px;
    height: 51px;
    bottom: max(85px, calc(env(safe-area-inset-bottom) + 75px));
  }
}
@media (max-width: 420px) and (orientation: portrait) {
  body.touch-mode .minimap-panel {
    width: 104px;
  }
  body.touch-mode .hud-top {
    left: 120px;
    right: 66px;
    gap: 8px;
  }
  body.touch-mode .hud-bottom {
    left: 120px;
    right: 12px;
    gap: 4px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: center;
  }
  body.touch-mode .hud-bottom > div {
    min-width: 0;
  }
  body.touch-mode .hud-bottom .hud-kicker {
    white-space: nowrap;
    letter-spacing: 0;
  }
  body.touch-mode .hud-bottom .ammo-readout {
    margin-left: 0;
  }
  body.touch-mode .hud-bottom .combat-readout small {
    display: none;
  }
  body.touch-mode .hud-mission {
    display: none;
  }
  body.touch-mode .hud-kicker {
    font-size: 6px;
  }
  body.touch-mode .health-line strong,
  body.touch-mode .combat-readout strong,
  body.touch-mode .ammo-readout strong {
    font-size: 15px;
  }
  body.touch-mode .touch-fire {
    width: 70px;
    height: 70px;
  }
  body.touch-mode .touch-sprint {
    right: max(96px, calc(env(safe-area-inset-right) + 88px));
    width: 54px;
    height: 54px;
  }
  body.touch-mode .touch-reload {
    width: 54px;
    height: 54px;
  }
}

/* Map picker, weapon label and optional clear-center scope. */
.map-row select {
  max-width: 155px;
  min-width: 0;
  padding: 5px 22px 5px 8px;
  border: 1px solid rgba(22, 59, 74, 0.23);
  border-radius: 8px;
  color: var(--navy);
  background: rgba(255, 255, 255, 0.8);
  font:
    750 10px 'Segoe UI',
    'Microsoft JhengHei',
    sans-serif;
  cursor: pointer;
}
.map-row select:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 2px;
}
.map-row select option {
  color: var(--navy);
  background: var(--paper);
}
.weapon-name {
  display: block;
  margin-top: 2px;
  color: var(--teal);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.035em;
}
.scope-overlay {
  position: fixed;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    circle at 50% 50%,
    transparent 0 36vmin,
    rgba(22, 59, 74, 0.14) 36.5vmin,
    rgba(22, 59, 74, 0.56) 48vmin,
    rgba(22, 59, 74, 0.86) 100vmax
  );
}
.scope-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 76vmin;
  height: 76vmin;
  max-width: 78vh;
  max-height: 78vh;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(236, 255, 245, 0.95);
  border-radius: 50%;
  box-shadow:
    0 0 0 1px rgba(22, 59, 74, 0.7),
    inset 0 0 0 1px rgba(22, 59, 74, 0.36),
    0 0 24px rgba(15, 53, 65, 0.2);
}
.scope-ring b {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 7px;
  height: 7px;
  transform: translate(-50%, -50%);
  border: 1px solid #fff;
  border-radius: 50%;
  background: rgba(244, 127, 102, 0.75);
}
.scope-v,
.scope-h {
  position: absolute;
  display: block;
  background: rgba(242, 255, 248, 0.72);
  box-shadow: 0 0 2px rgba(22, 59, 74, 0.8);
}
.scope-v {
  left: 50%;
  top: 0;
  width: 1px;
  height: 100%;
}
.scope-h {
  top: 50%;
  left: 0;
  width: 100%;
  height: 1px;
}
.scope-label {
  position: absolute;
  top: max(18px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 11px;
  border-radius: 999px;
  color: #f4fff9;
  background: rgba(22, 59, 74, 0.7);
  font:
    800 8px 'Segoe UI',
    sans-serif;
  letter-spacing: 0.18em;
}
.touch-sniper {
  width: 52px;
  height: 52px;
  right: max(22px, env(safe-area-inset-right));
  bottom: max(177px, calc(env(safe-area-inset-bottom) + 165px));
  border-radius: 17px;
  background: #456f8d;
  box-shadow:
    0 4px 0 #31546c,
    0 5px 15px rgba(31, 71, 72, 0.2);
}
.touch-sniper:active,
.touch-sniper.is-pressed,
.touch-sniper.pressed {
  background: #31546c;
}
body.touch-mode .touch-sniper {
  display: flex;
}
@media (max-width: 680px) {
  .map-row select {
    font-size: 9px;
    max-width: 146px;
  }
  .weapon-name {
    font-size: 8px;
  }
}
@media (orientation: landscape) and (max-height: 500px) {
  body.touch-mode .touch-sniper {
    right: max(22px, env(safe-area-inset-right));
    width: 50px;
    height: 50px;
    bottom: max(145px, calc(env(safe-area-inset-bottom) + 135px));
  }
}
@media (max-width: 420px) and (orientation: portrait) {
  body.touch-mode .touch-sniper {
    right: max(22px, env(safe-area-inset-right));
    width: 50px;
    height: 50px;
    bottom: max(177px, calc(env(safe-area-inset-bottom) + 165px));
  }
  body.touch-mode .weapon-name {
    font-size: 7px;
  }
}

.button-secondary {
  width: 100%;
  min-height: 45px;
  margin-top: 10px;
  padding: 0 15px;
  border: 2px solid var(--teal);
  border-radius: 14px;
  color: var(--teal);
  background: rgba(255, 255, 255, 0.76);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition:
    background 0.16s ease,
    transform 0.16s ease;
}
.button-secondary:hover {
  background: #dff5e8;
  transform: translateY(-1px);
}
.button-secondary:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 3px;
}
body:has(#scope-overlay:not([hidden])) #crosshair {
  visibility: hidden;
}

/* v0.5: keep the central play view open on mobile, especially in landscape. */
@media (orientation: landscape) {
  body.touch-mode:has(#hud:not([hidden])) .masthead {
    display: none;
  }
  body.touch-mode:has(#hud:not([hidden])) .minimap-panel {
    top: max(7px, env(safe-area-inset-top));
    left: max(8px, env(safe-area-inset-left));
    right: auto;
    width: 92px;
    padding: 5px;
    border-radius: 12px;
    background: rgba(255, 253, 244, 0.76);
    box-shadow: 0 2px 9px rgba(35, 91, 79, 0.1);
    backdrop-filter: blur(5px);
  }
  body.touch-mode:has(#hud:not([hidden])) .minimap-legend {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 2px 5px;
    margin-top: 4px;
    font-size: 6px;
    line-height: 1.1;
  }
  body.touch-mode:has(#hud:not([hidden])) .minimap-legend span {
    gap: 3px;
  }
  body.touch-mode:has(#hud:not([hidden])) .minimap-legend i {
    width: 5px;
    height: 5px;
  }
  body.touch-mode:has(#hud:not([hidden])) .hud-top {
    top: max(8px, env(safe-area-inset-top));
    left: calc(max(8px, env(safe-area-inset-left)) + 101px);
    right: max(62px, calc(env(safe-area-inset-right) + 58px));
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 11px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }
  body.touch-mode:has(#hud:not([hidden])) .hud-mission {
    display: none;
  }
  body.touch-mode:has(#hud:not([hidden])) .wave-readout,
  body.touch-mode:has(#hud:not([hidden])) .timer-readout {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
  }
  body.touch-mode:has(#hud:not([hidden])) .wave-readout .hud-kicker,
  body.touch-mode:has(#hud:not([hidden])) .timer-readout .hud-kicker {
    color: #173f4b;
    font-size: 8px;
    letter-spacing: 0;
  }
  body.touch-mode:has(#hud:not([hidden])) .wave-readout strong,
  body.touch-mode:has(#hud:not([hidden])) .timer-readout strong {
    color: #173f4b;
    font-size: 12px;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.85);
  }
  body.touch-mode:has(#hud:not([hidden])) .timer-readout::before {
    content: '·';
    color: var(--coral);
    font-weight: 900;
  }
  body.touch-mode:has(#hud:not([hidden])) .wave-readout strong i {
    font-size: 9px;
  }
  body.touch-mode:has(#hud:not([hidden])) .hud-bottom {
    top: auto;
    left: 50%;
    right: auto;
    bottom: max(8px, env(safe-area-inset-bottom));
    width: min(360px, calc(100vw - 250px));
    min-width: 260px;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 5px 13px;
    border: 1px solid rgba(255, 255, 255, 0.42);
    border-radius: 999px;
    background: rgba(255, 253, 244, 0.38);
    box-shadow: none;
    backdrop-filter: blur(4px);
  }
  body.touch-mode:has(#hud:not([hidden])) .hud-bottom .vitals,
  body.touch-mode:has(#hud:not([hidden])) .hud-bottom .ammo-readout {
    flex-direction: row;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
  }
  body.touch-mode:has(#hud:not([hidden])) .hud-bottom .hud-kicker {
    color: #163b4a;
    font-size: 8px;
    letter-spacing: 0;
  }
  body.touch-mode:has(#hud:not([hidden])) .hud-bottom .health-line strong,
  body.touch-mode:has(#hud:not([hidden])) .hud-bottom .ammo-readout strong {
    color: #163b4a;
    font-size: 13px;
  }
  body.touch-mode:has(#hud:not([hidden])) .hud-bottom .health-icon {
    font-size: 12px;
  }
  body.touch-mode:has(#hud:not([hidden])) .hud-bottom .weapon-name {
    margin: 0;
    color: #176f67;
    font-size: 8px;
  }
  body.touch-mode:has(#hud:not([hidden])) .hud-bottom .combat-readout,
  body.touch-mode:has(#hud:not([hidden])) .hud-bottom .best-readout,
  body.touch-mode:has(#hud:not([hidden])) .hud-bottom .status-readout {
    display: none;
  }
  body.touch-mode:has(#hud:not([hidden])) .hud-bottom .ammo-readout {
    margin: 0;
  }
  body.touch-mode:has(#hud:not([hidden])) .spawn-warning {
    top: max(122px, calc(env(safe-area-inset-top) + 114px));
    left: max(8px, env(safe-area-inset-left));
    transform: none;
    padding: 4px 7px;
    border-width: 1px;
    font-size: 8px;
    box-shadow: 0 2px 7px rgba(80, 65, 28, 0.1);
  }
}
@media (max-width: 420px) and (orientation: portrait) {
  body.touch-mode:has(#hud:not([hidden])) .masthead {
    display: none;
  }
  body.touch-mode:has(#hud:not([hidden])) .minimap-panel {
    top: max(8px, env(safe-area-inset-top));
  }
  body.touch-mode:has(#hud:not([hidden])) .hud-top {
    top: max(8px, env(safe-area-inset-top));
  }
  body.touch-mode:has(#hud:not([hidden])) .hud-bottom {
    top: calc(63px + env(safe-area-inset-top));
  }
  body.touch-mode:has(#hud:not([hidden])) .spawn-warning {
    top: calc(155px + env(safe-area-inset-top));
    left: 12px;
    right: 12px;
    transform: none;
    width: fit-content;
    max-width: calc(100vw - 24px);
    white-space: normal;
    padding: 6px 9px;
    font-size: 10px;
  }
}

body.touch-mode:has(#hud:not([hidden])) .masthead {
  display: none;
}
body.touch-mode #scope-overlay .scope-label {
  display: none;
}

/* v0.11 touch HUD: enlarge the nearby radar and keep controls in separate thumb lanes. */
.boss-panel {
  position: fixed;
  z-index: 6;
  top: 74px;
  left: 50%;
  width: min(210px, 38vw);
  padding: 6px 9px 8px;
  transform: translateX(-50%);
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 10px;
  color: #fff;
  background: rgba(22, 59, 74, 0.66);
  box-shadow: 0 3px 12px rgba(22, 59, 74, 0.14);
  pointer-events: none;
}
.boss-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
  font-size: 9px;
  line-height: 1.2;
}
.boss-heading strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.boss-health-track {
  height: 6px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 99px;
  background: rgba(10, 27, 35, 0.55);
}
.boss-health {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff956d, #f5bf55);
  transition: width 0.16s linear;
}
body.touch-mode:has(#hud:not([hidden])) .boss-panel {
  top: max(37px, calc(env(safe-area-inset-top) + 29px));
  width: min(170px, 34vw);
  padding: 4px 7px 6px;
}
body.touch-mode:has(#hud:not([hidden])) .boss-heading {
  margin-bottom: 3px;
  font-size: 8px;
}
body.touch-mode:has(#hud:not([hidden])) .boss-heading strong {
  font-size: 9px;
}
body.touch-mode:has(#hud:not([hidden])) .boss-health-track {
  height: 5px;
}
/* v0.6 touch sizing: keep the main controls well inside the safe-area edges. */
body.touch-mode {
  --touch-edge-left: max(56.7px, env(safe-area-inset-left));
  --touch-edge-right: max(56.7px, env(safe-area-inset-right));
  --touch-edge-bottom: max(56.7px, env(safe-area-inset-bottom));
}
body.touch-mode .move-stick {
  width: 150px;
  height: 150px;
  left: var(--touch-edge-left);
  bottom: var(--touch-edge-bottom);
}
body.touch-mode .move-knob {
  width: 74px;
  height: 74px;
}
body.touch-mode .touch-fire {
  width: 95px;
  height: 95px;
  right: var(--touch-edge-right);
  bottom: var(--touch-edge-bottom);
}
body.touch-mode .touch-sprint {
  width: 52px;
  height: 52px;
  right: calc(var(--touch-edge-right) + 107px);
  bottom: var(--touch-edge-bottom);
}
body.touch-mode .touch-reload {
  width: 52px;
  height: 52px;
  right: var(--touch-edge-right);
  bottom: calc(var(--touch-edge-bottom) + 107px);
}

.weapon-picker {
  position: fixed;
  z-index: 8;
  top: 340px;
  right: clamp(22px, 4.4vw, 68px);
  display: grid;
  grid-template-columns: repeat(4, minmax(48px, 62px));
  gap: 7px;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 16px;
  background: rgba(255, 253, 244, 0.74);
  box-shadow: 0 5px 14px rgba(35, 91, 79, 0.1);
  backdrop-filter: blur(6px);
}
.weapon-option {
  min-width: 48px;
  min-height: 58px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px 3px;
  border: 1px solid rgba(22, 59, 74, 0.16);
  border-radius: 11px;
  color: #476f7b;
  background: rgba(255, 255, 255, 0.78);
  font:
    750 9px 'Segoe UI',
    'Microsoft JhengHei',
    sans-serif;
  cursor: pointer;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    transform 0.15s ease,
    border-color 0.15s ease;
}
.weapon-option svg {
  width: 29px;
  height: 21px;
  color: currentColor;
}
.weapon-option:hover {
  color: var(--teal);
  border-color: var(--teal);
  transform: translateY(-1px);
}
.weapon-option.selected,
.weapon-option[aria-pressed='true'] {
  color: #fff;
  border-color: #176f67;
  background: var(--teal);
  box-shadow: 0 2px 0 #155e59;
}
.weapon-option:disabled {
  color: #809299;
  border-color: rgba(22, 59, 74, 0.12);
  background: rgba(238, 242, 237, 0.65);
  box-shadow: none;
  opacity: 0.42;
  cursor: not-allowed;
}
.weapon-option:disabled:hover,
.weapon-option:disabled:active {
  transform: none;
}
.weapon-option:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 2px;
}
#touch-reload:disabled {
  opacity: 0.42;
  filter: saturate(0.45);
  box-shadow: none;
  cursor: not-allowed;
}
#touch-reload:disabled:active,
#touch-reload:disabled.pressed,
#touch-reload:disabled.is-pressed {
  transform: none;
  background: var(--teal);
}

@media (orientation: landscape) and (max-height: 500px) {
  body.touch-mode .move-stick {
    width: 150px;
    height: 150px;
  }
  body.touch-mode .touch-fire {
    width: 95px;
    height: 95px;
  }
  body.touch-mode .touch-sprint {
    right: calc(var(--touch-edge-right) + 107px);
    bottom: var(--touch-edge-bottom);
  }
  body.touch-mode .touch-reload {
    right: var(--touch-edge-right);
    bottom: calc(var(--touch-edge-bottom) + 107px);
  }
}
@media (orientation: landscape) and (min-height: 501px) {
  body.touch-mode .move-stick {
    width: 168px;
    height: 168px;
  }
  body.touch-mode .touch-fire {
    width: 114px;
    height: 114px;
  }
  body.touch-mode .touch-sprint {
    right: calc(var(--touch-edge-right) + 126px);
    bottom: var(--touch-edge-bottom);
  }
  body.touch-mode .touch-reload {
    right: var(--touch-edge-right);
    bottom: calc(var(--touch-edge-bottom) + 126px);
  }
}
@media (max-width: 375px) and (orientation: portrait) {
  body.touch-mode .move-stick {
    width: 140px;
    height: 140px;
  }
  body.touch-mode .move-knob {
    width: 70px;
    height: 70px;
  }
}
@media (max-width: 340px) and (orientation: portrait) {
  body.touch-mode .move-stick {
    width: 104px;
    height: 104px;
  }
  body.touch-mode .move-knob {
    width: 62px;
    height: 62px;
  }
}

body.touch-mode .weapon-picker:not([hidden]) {
  top: max(64px, calc(env(safe-area-inset-top) + 56px));
  right: max(8px, env(safe-area-inset-right));
  width: 44px;
  grid-template-columns: 44px;
  gap: 4px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}
body.touch-mode .weapon-option {
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  height: 44px;
  gap: 0;
  padding: 2px 0;
  border-radius: 10px;
  font-size: 8px;
}
body.touch-mode .weapon-option svg {
  width: 26px;
  height: 22px;
}

/* Keep the selector above the right-hand look surface. */
.weapon-picker {
  z-index: 10;
  touch-action: manipulation;
}
@media (orientation: portrait) {
  body.touch-mode .touch-sprint {
    right: var(--touch-edge-right);
    bottom: calc(var(--touch-edge-bottom) + 171px);
  }
  body.touch-mode .weapon-picker:not([hidden]) {
    top: max(204px, calc(env(safe-area-inset-top) + 196px));
  }
}

/* v0.7: separate bottom weapon row from the main thumb controls. */
body.touch-mode {
  --touch-edge-left: calc(56.7px + env(safe-area-inset-left));
  --touch-edge-right: calc(56.7px + env(safe-area-inset-right));
  --touch-edge-bottom: calc(56.7px + env(safe-area-inset-bottom));
}
@media (orientation: landscape) {
  body.touch-mode {
    --touch-fire-size: 95px;
    --action-bottom: calc(68px + env(safe-area-inset-bottom));
  }
  body.touch-mode .touch-fire {
    width: var(--touch-fire-size);
    height: var(--touch-fire-size);
    bottom: var(--action-bottom);
  }
  body.touch-mode .touch-sprint {
    right: calc(var(--touch-edge-right) + var(--touch-fire-size) + 12px);
    bottom: var(--action-bottom);
  }
  body.touch-mode .touch-reload {
    right: calc(var(--touch-edge-right) + var(--touch-fire-size) + 12px);
    bottom: calc(var(--action-bottom) + 64px);
  }
  body.touch-mode .weapon-picker:not([hidden]) {
    top: auto;
    right: var(--touch-edge-right);
    bottom: calc(12px + env(safe-area-inset-bottom));
    width: 188px;
    grid-template-columns: repeat(4, 44px);
    gap: 4px;
  }
  body.touch-mode:has(#hud:not([hidden])) .hud-bottom {
    left: var(--touch-edge-left);
    right: calc(var(--touch-edge-right) + 204px);
    bottom: calc(16px + env(safe-area-inset-bottom));
    width: auto;
    max-width: 400px;
    min-width: 0;
    transform: none;
    gap: 10px;
    padding: 5px 8px;
  }
  body.touch-mode:has(#hud:not([hidden])) .hud-bottom .hud-kicker {
    display: none;
  }
}
@media (orientation: landscape) and (min-height: 501px) {
  body.touch-mode {
    --touch-fire-size: 114px;
  }
}
@media (orientation: landscape) and (max-height: 350px) {
  body.touch-mode .move-stick {
    width: 132px;
    height: 132px;
  }
  body.touch-mode .move-knob {
    width: 66px;
    height: 66px;
  }
  body.touch-mode:has(#hud:not([hidden])) .minimap-panel {
    width: 76px;
  }
  body.touch-mode:has(#hud:not([hidden])) .minimap-legend {
    display: none;
  }
  body.touch-mode:has(#hud:not([hidden])) .spawn-warning {
    top: 92px;
    max-width: 230px;
  }
}

/* v0.9 persistent settings, kept outside active-play HUD. */
.game-settings {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 14px 0;
  text-align: left;
}
.game-settings label {
  display: grid;
  gap: 5px;
  font-size: 13px;
  font-weight: 700;
  color: #30586a;
}
.game-settings select {
  width: 100%;
  min-height: 40px;
  border: 1px solid #a7cbbd;
  border-radius: 9px;
  padding: 6px;
  background: #f6fff8;
  color: #30586a;
  font: inherit;
  font-size: 16px;
}
.game-settings small {
  grid-column: 1/-1;
  font-size: 11px;
  line-height: 1.5;
  color: #52766d;
}
.pause-panel {
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
}
.screen-menu {
  overflow-y: auto;
}
@media (orientation: landscape) and (max-height: 500px) {
  .game-settings {
    margin: 8px 0;
    gap: 6px;
  }
  .game-settings select {
    min-height: 34px;
  }
  .game-settings small {
    display: none;
  }
  .pause-panel .game-settings {
    max-width: 420px;
    margin: 8px auto;
  }
  .mission-card .signal-block {
    display: none;
  }
}
.screen-pause {
  position: fixed;
  inset: 0;
}
@media (max-width: 680px) and (orientation: portrait) {
  .screen-menu {
    justify-content: flex-start;
  }
}

/* Keep the v0.11 touch layout overrides after the legacy responsive rules. */
@media (orientation: landscape) {
  body.touch-mode:has(#hud:not([hidden])) .minimap-panel {
    width: 148px;
  }
  body.touch-mode:has(#hud:not([hidden])) .minimap-legend {
    font-size: 7px;
  }
  body.touch-mode:has(#hud:not([hidden])) .hud-top {
    left: calc(max(8px, env(safe-area-inset-left)) + 157px);
  }
  body.touch-mode .touch-fire {
    right: calc(var(--touch-edge-right) + 24px);
    bottom: calc(var(--action-bottom) + 59px);
  }
  body.touch-mode .touch-reload {
    right: max(8px, env(safe-area-inset-right));
    bottom: calc(var(--action-bottom) + 70px);
  }
  body.touch-mode .touch-sniper:not([hidden]) {
    display: flex !important;
    right: max(8px, env(safe-area-inset-right));
    bottom: calc(var(--action-bottom) + 132px);
  }
}
@media (orientation: landscape) and (max-height: 350px) {
  body.touch-mode:has(#hud:not([hidden])) .minimap-panel {
    width: 124px;
  }
  body.touch-mode:has(#hud:not([hidden])) .minimap-legend {
    display: none;
  }
  body.touch-mode:has(#hud:not([hidden])) .hud-top {
    left: calc(max(8px, env(safe-area-inset-left)) + 133px);
  }
  body.touch-mode .touch-fire {
    right: calc(var(--touch-edge-right) + 24px);
    bottom: max(10px, min(calc(var(--action-bottom) + 59px), calc(100dvh - 100px)));
  }
  body.touch-mode .touch-reload {
    right: max(8px, env(safe-area-inset-right));
    bottom: max(10px, min(calc(var(--action-bottom) + 70px), calc(100dvh - 62px)));
  }
  body.touch-mode .touch-sniper:not([hidden]) {
    right: max(8px, env(safe-area-inset-right));
    bottom: max(10px, min(calc(var(--action-bottom) + 132px), calc(100dvh - 52px)));
  }
}
@media (orientation: portrait) {
  body.touch-mode:has(#hud:not([hidden])) .minimap-panel {
    width: 140px;
  }
  body.touch-mode:has(#hud:not([hidden])) .hud-top {
    left: 148px;
  }
  body.touch-mode .touch-sniper:not([hidden]) {
    display: flex !important;
    right: calc(var(--touch-edge-right) + 104px);
    bottom: calc(var(--touch-edge-bottom) + 154px);
  }
}
#touch-sniper[hidden] {
  display: none !important;
}
@media (orientation: landscape) and (min-height: 501px) {
  body.touch-mode:has(#hud:not([hidden])) .minimap-panel {
    width: 168px;
  }
  body.touch-mode:has(#hud:not([hidden])) .hud-top {
    left: calc(max(8px, env(safe-area-inset-left)) + 177px);
  }
}
@media (orientation: landscape) {
  body.touch-mode:has(#hud:not([hidden])) .spawn-warning {
    top: calc(76px + env(safe-area-inset-top));
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    max-width: 300px;
  }
}
@media (orientation: portrait) {
  body.touch-mode:has(#hud:not([hidden])) .hud-top {
    left: 160px;
  }
  body.touch-mode:has(#hud:not([hidden])) .spawn-warning {
    top: calc(172px + env(safe-area-inset-top));
  }
}
@media (orientation: portrait) and (min-width: 380px) {
  body.touch-mode .touch-fire {
    right: calc(var(--touch-edge-right) + 24px);
  }
}
/* v0.11.1: thumb attack sits farther inside the landscape look area. */
@media (orientation: landscape) {
  body.touch-mode .touch-fire {
    right: calc(var(--touch-edge-right) + 72px);
  }
}
@media (orientation: portrait) and (min-width: 600px) {
  body.touch-mode .touch-fire {
    right: calc(var(--touch-edge-right) + 72px);
  }
}

/* v0.12: defend-the-beacon HUD, upgrade cards, stars, crit marker. */
.row-value.infected {
  color: #c4472f;
}
.objective-stack {
  position: absolute;
  top: 168px;
  left: clamp(20px, 4.2vw, 68px);
  width: min(300px, calc(100vw - 280px));
  min-width: 190px;
  display: grid;
  gap: 8px;
  pointer-events: none;
}
.objective,
.beacon-panel {
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 14px;
  background: rgba(255, 253, 244, 0.82);
  box-shadow: 0 4px 14px rgba(35, 91, 79, 0.1);
  backdrop-filter: blur(8px);
}
.objective {
  display: grid;
  gap: 3px;
  border-left: 5px solid var(--sun);
}
.objective-title {
  color: var(--navy);
  font:
    800 16px 'Segoe UI',
    'Microsoft JhengHei',
    sans-serif;
  letter-spacing: 0.03em;
}
.objective-detail {
  color: var(--navy-soft);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
}
.beacon-panel {
  display: grid;
  gap: 5px;
}
.beacon-label {
  color: #285e61;
  font:
    800 10px 'Segoe UI',
    'Microsoft JhengHei',
    sans-serif;
  letter-spacing: 0.05em;
}
.beacon-track {
  height: 10px;
  overflow: hidden;
  border: 1px solid rgba(22, 59, 74, 0.28);
  border-radius: 99px;
  background: rgba(22, 59, 74, 0.16);
}
.beacon-health {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f5bf55, #fff0a8);
  transition: width 0.2s linear;
}
.beacon-panel.danger {
  border-color: #e0472f;
  animation: beacon-alert 0.8s ease-in-out infinite;
}
.beacon-panel.danger .beacon-label {
  color: #b5301c;
}
.beacon-panel.danger .beacon-health {
  background: linear-gradient(90deg, #d8301f, #f47f66);
}
@keyframes beacon-alert {
  0%,
  100% {
    background: rgba(255, 253, 244, 0.82);
    box-shadow: 0 0 0 0 rgba(224, 71, 47, 0);
  }
  50% {
    background: rgba(255, 215, 205, 0.95);
    box-shadow: 0 0 0 4px rgba(224, 71, 47, 0.4);
  }
}
.hitmarker.crit {
  width: 26px;
  height: 26px;
  filter: drop-shadow(0 0 3px rgba(255, 190, 40, 0.9));
}
.hitmarker.crit i {
  width: 10px;
  height: 3px;
  top: 11px;
  left: 8px;
  background: #ffb800;
}
.hitmarker.crit.active {
  animation: crit-confirm 0.22s ease-out both;
}
@keyframes crit-confirm {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.6);
  }
  30% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.5);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.15);
  }
}
.final-stars {
  margin: 4px 0 8px;
  color: #f2a900;
  font-size: 56px;
  line-height: 1;
  letter-spacing: 0.08em;
  text-align: center;
  text-shadow:
    0 3px 0 #b87a00,
    0 6px 14px rgba(184, 122, 0, 0.3);
}
.final-stars:empty {
  display: none;
}

/* The upgrade overlay sits above the HUD and touch layer. */
.screen-upgrade {
  position: fixed;
  z-index: 12;
  inset: 0;
  display: grid;
  place-items: center;
  overflow-y: auto;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: rgba(22, 59, 74, 0.5);
  backdrop-filter: blur(4px);
  pointer-events: auto;
}
.upgrade-panel {
  width: min(860px, 100%);
  margin: auto;
  padding: 24px 26px 18px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 22px;
  background: rgba(255, 253, 244, 0.96);
  box-shadow: 0 18px 54px rgba(22, 59, 74, 0.34);
}
.upgrade-panel .eyebrow {
  margin-bottom: 6px;
}
.upgrade-panel h2 {
  margin: 0 0 4px;
  color: var(--navy);
  font-size: 32px;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.upgrade-subtitle {
  margin: 0 0 16px;
  color: var(--navy-soft);
  font-size: 13px;
  line-height: 1.6;
}
.upgrade-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.upgrade-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-height: 150px;
  padding: 14px 15px;
  border: 2px solid rgba(22, 59, 74, 0.16);
  border-radius: 16px;
  color: var(--navy);
  background: #fff;
  box-shadow: 0 4px 0 rgba(22, 59, 74, 0.12);
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  transition:
    transform 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}
.upgrade-option:hover,
.upgrade-option:focus-visible {
  border-color: var(--teal);
  background: #f1fff8;
  transform: translateY(-3px);
  box-shadow:
    0 7px 0 rgba(32, 127, 120, 0.35),
    0 10px 20px rgba(32, 127, 120, 0.16);
}
.upgrade-option:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 3px;
}
.upgrade-option:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 rgba(32, 127, 120, 0.35);
}
.upgrade-tag {
  padding: 2px 9px;
  border-radius: 99px;
  color: #fff;
  background: var(--teal);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}
.upgrade-option strong {
  font-size: 18px;
  line-height: 1.25;
}
.upgrade-desc {
  flex: 1;
  color: var(--navy-soft);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.55;
}
.upgrade-level {
  color: #b87a00;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
}
.upgrade-hint {
  margin: 14px 0 0;
  color: var(--navy-soft);
  font-size: 11px;
  font-weight: 600;
  text-align: center;
}
.upgrade-hint kbd {
  margin: 0 1px;
  font-size: 10px;
}
body.touch-mode .upgrade-hint {
  display: none;
}
body.touch-mode:has(#upgrade:not([hidden])) #touch-controls,
body.touch-mode:has(#upgrade:not([hidden])) #weapon-picker {
  display: none;
}
@media (max-width: 680px), (orientation: portrait) {
  .upgrade-options {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .upgrade-option {
    min-height: 0;
    padding: 12px 14px;
    gap: 4px;
  }
  .upgrade-panel {
    padding: 18px 16px 14px;
  }
  .upgrade-panel h2 {
    font-size: 26px;
  }
}
@media (orientation: landscape) and (max-height: 500px) {
  .upgrade-panel {
    padding: 12px 18px 10px;
  }
  .upgrade-panel .eyebrow {
    display: none;
  }
  .upgrade-panel h2 {
    font-size: 22px;
  }
  .upgrade-subtitle {
    margin-bottom: 8px;
    font-size: 11px;
  }
  .upgrade-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }
  .upgrade-option {
    min-height: 0;
    padding: 9px 11px;
    gap: 3px;
  }
  .upgrade-option strong {
    font-size: 15px;
  }
  .upgrade-desc {
    font-size: 11px;
    line-height: 1.4;
  }
  .upgrade-hint {
    margin-top: 8px;
  }
}

/* Weapon picker: hidden (locked) buttons must not leave gaps; 2-4 buttons fit. */
.weapon-option[hidden] {
  display: none !important;
}
.weapon-picker {
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: minmax(48px, 62px);
}
@media (orientation: landscape) {
  body.touch-mode .weapon-picker:not([hidden]) {
    width: auto;
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 44px;
    justify-content: end;
  }
}
@media (orientation: portrait) {
  body.touch-mode .weapon-picker:not([hidden]) {
    grid-template-columns: 44px;
    grid-auto-flow: row;
  }
}

/* Objective and beacon: small-screen placement per orientation. */
@media (max-width: 940px) {
  .objective-stack {
    width: min(300px, calc(100vw - 250px));
  }
}
@media (orientation: landscape) {
  body.touch-mode:has(#hud:not([hidden])) .objective-stack {
    top: max(8px, env(safe-area-inset-top));
    left: auto;
    right: calc(70px + env(safe-area-inset-right));
    width: min(250px, calc(50vw - 165px));
    min-width: 130px;
    gap: 4px;
  }
  body.touch-mode:has(#hud:not([hidden])) .objective,
  body.touch-mode:has(#hud:not([hidden])) .beacon-panel {
    padding: 4px 8px;
    border-radius: 10px;
    background: rgba(255, 253, 244, 0.72);
    backdrop-filter: blur(4px);
  }
  body.touch-mode:has(#hud:not([hidden])) .objective {
    gap: 1px;
    border-left-width: 4px;
  }
  body.touch-mode:has(#hud:not([hidden])) .objective-title {
    font-size: 12px;
  }
  body.touch-mode:has(#hud:not([hidden])) .objective-detail {
    overflow: hidden;
    font-size: 9px;
    line-height: 1.25;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  body.touch-mode:has(#hud:not([hidden])) .beacon-panel {
    display: flex;
    align-items: center;
    gap: 6px;
  }
  body.touch-mode:has(#hud:not([hidden])) .beacon-label {
    font-size: 9px;
    white-space: nowrap;
  }
  body.touch-mode:has(#hud:not([hidden])) .beacon-track {
    flex: 1;
    height: 7px;
  }
}
@media (orientation: portrait) {
  body.touch-mode:has(#hud:not([hidden])) .objective-stack {
    top: calc(138px + env(safe-area-inset-top));
    left: 160px;
    right: 60px;
    width: auto;
    min-width: 0;
    gap: 4px;
  }
  body.touch-mode:has(#hud:not([hidden])) .objective,
  body.touch-mode:has(#hud:not([hidden])) .beacon-panel {
    padding: 5px 9px;
    border-radius: 11px;
  }
  body.touch-mode:has(#hud:not([hidden])) .objective-title {
    font-size: 13px;
  }
  body.touch-mode:has(#hud:not([hidden])) .objective-detail {
    font-size: 9px;
  }
  body.touch-mode:has(#hud:not([hidden])) .beacon-track {
    height: 7px;
  }
  body.touch-mode:has(#hud:not([hidden])) .spawn-warning {
    top: calc(226px + env(safe-area-inset-top));
    max-width: calc(100vw - 80px);
  }
}
