:root {
  color-scheme: dark;
  --bg: #050913;
  --panel: rgba(7, 14, 28, 0.88);
  --panel-solid: #091329;
  --ink: #f3f8ff;
  --muted: #94a6c4;
  --cyan: #25e7ff;
  --blue: #2d76ff;
  --violet: #8d5cff;
  --lime: #b8ff59;
  --orange: #ff9d3b;
  --red: #ff496c;
  --line: rgba(117, 189, 255, 0.2);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
}

button,
kbd { font: inherit; }

button { color: inherit; }

#game-shell {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 540px;
  isolation: isolate;
  background:
    radial-gradient(circle at 18% 18%, rgba(37, 231, 255, 0.12), transparent 28%),
    radial-gradient(circle at 82% 72%, rgba(141, 92, 255, 0.12), transparent 30%),
    #050913;
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #060a14;
  cursor: crosshair;
  image-rendering: auto;
}

.screen {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(18px, 4vw, 56px);
}

.screen.active { display: flex; }

#start-screen {
  background:
    linear-gradient(90deg, rgba(3, 7, 16, 0.97) 0%, rgba(3, 7, 16, 0.9) 48%, rgba(3, 7, 16, 0.72) 100%),
    repeating-linear-gradient(0deg, transparent 0 39px, rgba(55, 210, 255, 0.055) 40px),
    repeating-linear-gradient(90deg, transparent 0 39px, rgba(55, 210, 255, 0.055) 40px);
}

#start-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(135deg, transparent 0 62%, rgba(37, 231, 255, 0.1) 62.1% 62.4%, transparent 62.5%);
  pointer-events: none;
}

.start-panel {
  width: min(1180px, 100%);
  max-height: 100%;
  overflow: auto;
  padding: clamp(20px, 3vw, 40px);
  border: 1px solid var(--line);
  border-radius: 24px 6px 24px 6px;
  background: linear-gradient(145deg, rgba(9, 19, 41, 0.88), rgba(5, 10, 23, 0.72));
  box-shadow: var(--shadow), inset 0 1px rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(18px);
}

.site-back,
.lab-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  transition: color 150ms ease;
}

.site-back {
  display: inline-block;
  margin-bottom: 18px;
}

.site-back:hover,
.lab-link:hover { color: var(--cyan); }

.lab-link {
  display: inline-block;
  margin-top: 8px;
  padding: 6px 10px;
}

.brand-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  color: #03121b;
  background: var(--cyan);
  border-radius: 16px 3px 16px 3px;
  font-weight: 950;
  font-size: 1.35rem;
  letter-spacing: -0.08em;
  box-shadow: 0 0 32px rgba(37, 231, 255, 0.4);
  transform: skew(-4deg);
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--cyan);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

h1,
h2,
p { margin-top: 0; }

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 5vw, 4.5rem);
  line-height: 0.86;
  letter-spacing: -0.075em;
  font-style: italic;
  text-transform: uppercase;
}

.safety-badge {
  padding: 9px 13px;
  border: 1px solid rgba(184, 255, 89, 0.35);
  border-radius: 999px;
  color: var(--lime);
  background: rgba(184, 255, 89, 0.08);
  font-size: 0.8rem;
  font-weight: 700;
}

.selection-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.8fr;
  gap: 32px;
  padding: 28px 0 24px;
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.section-heading span {
  color: var(--cyan);
  font: 800 0.78rem ui-monospace, SFMono-Regular, Menlo, monospace;
}

.section-heading h2 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0.05em;
}

.card-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.hero-card,
.map-card {
  position: relative;
  min-height: 96px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 13px 3px 13px 3px;
  background: rgba(255, 255, 255, 0.025);
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.hero-card:hover,
.map-card:hover { transform: translateY(-2px); border-color: rgba(37, 231, 255, 0.55); }

.hero-card.selected,
.map-card.selected {
  border-color: var(--cyan);
  background: linear-gradient(135deg, rgba(37, 231, 255, 0.14), rgba(45, 118, 255, 0.05));
  box-shadow: inset 3px 0 var(--cyan), 0 0 22px rgba(37, 231, 255, 0.09);
}

.hero-card strong,
.map-card strong {
  display: block;
  margin-bottom: 5px;
  font-size: 1rem;
}

.hero-card small,
.map-card small {
  display: block;
  color: var(--muted);
  font-size: 0.77rem;
  line-height: 1.45;
}

.stat-dots {
  display: flex;
  gap: 4px;
  margin-top: 10px;
}

.stat-dots i {
  width: 18px;
  height: 3px;
  background: rgba(148, 166, 196, 0.2);
}

.stat-dots i.on { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }

.map-list {
  display: grid;
  gap: 10px;
}

.loadout-selector { grid-column: 1 / -1; }

.loadout-selector .section-heading em {
  margin-left: auto;
  color: var(--lime);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.loadout-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.menu-loadout,
.armory-loadout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.loadout-slot {
  position: relative;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px 2px 9px 2px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.035);
  text-align: left;
  cursor: pointer;
}

.loadout-slot::before {
  content: attr(data-slot);
  display: block;
  margin-bottom: 3px;
  color: var(--slot-color, var(--cyan));
  font: 800 0.68rem ui-monospace, monospace;
  letter-spacing: 0.1em;
}

.loadout-slot strong,
.loadout-slot small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.loadout-slot strong { font-size: 0.85rem; }
.loadout-slot small { margin-top: 2px; color: var(--muted); font-size: 0.68rem; }
.loadout-slot.selected { border-color: var(--slot-color, var(--cyan)); box-shadow: inset 3px 0 var(--slot-color, var(--cyan)); }

.armory-button {
  min-width: 172px;
  padding: 9px 14px;
  border: 1px solid rgba(141, 92, 255, 0.55);
  border-radius: 9px 2px 9px 2px;
  color: var(--ink);
  background: linear-gradient(135deg, rgba(141, 92, 255, 0.2), rgba(37, 231, 255, 0.09));
  text-align: left;
  cursor: pointer;
}

.armory-button span,
.armory-button small { display: block; }
.armory-button span { font-weight: 900; }
.armory-button small { margin-top: 2px; color: var(--muted); font-size: 0.68rem; }
.armory-button:hover { border-color: var(--cyan); }

.map-card {
  min-height: 66px;
  padding: 12px 14px 12px 52px;
}

.map-card::before {
  content: attr(data-index);
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--map-color, var(--cyan));
  font: 900 1.15rem ui-monospace, monospace;
}

.launch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.controls-copy {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 17px;
  color: var(--muted);
  font-size: 0.78rem;
}

kbd {
  padding: 3px 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-bottom-color: rgba(255, 255, 255, 0.28);
  border-radius: 4px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.07);
  font-size: 0.72rem;
}

.primary-button,
.secondary-button,
.text-button,
.icon-button {
  border: 0;
  cursor: pointer;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  min-width: 190px;
  padding: 15px 20px;
  border-radius: 11px 3px 11px 3px;
  color: #031017;
  background: var(--cyan);
  box-shadow: 0 0 30px rgba(37, 231, 255, 0.25);
  font-weight: 900;
  font-size: 1rem;
  transition: filter 150ms ease, transform 150ms ease;
}

.primary-button:hover { filter: brightness(1.12); transform: translateY(-2px); }

.hud {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: none;
  pointer-events: none;
}

.hud.active { display: block; }

.hud-top,
.hud-bottom {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: max(18px, env(safe-area-inset-top)) max(22px, env(safe-area-inset-right)) 0 max(22px, env(safe-area-inset-left));
  text-shadow: 0 2px 10px #000;
}

.hud-bottom {
  top: auto;
  bottom: 0;
  align-items: flex-end;
  padding: 0 max(22px, env(safe-area-inset-right)) max(22px, env(safe-area-inset-bottom)) max(22px, env(safe-area-inset-left));
}

.mission-block,
.score-block,
.weapon-block {
  display: flex;
  flex-direction: column;
}

.hud-label,
.score-block span,
.weapon-block > span {
  color: var(--cyan);
  font: 700 0.76rem ui-monospace, SFMono-Regular, monospace;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.mission-block strong {
  margin-top: 3px;
  font-size: 1.45rem;
  font-style: italic;
}

.mission-block > span:last-child {
  color: var(--muted);
  font-size: 0.78rem;
}

.score-block { align-items: center; }
.score-block strong { font: 900 1.4rem ui-monospace, monospace; letter-spacing: 0.06em; }
.score-block em { color: var(--orange); font-size: 0.76rem; font-weight: 800; font-style: normal; }

.action-buttons {
  display: flex;
  gap: 7px;
  pointer-events: auto;
}

.icon-button {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px 2px 7px 2px;
  color: var(--muted);
  background: rgba(5, 10, 22, 0.62);
  font-size: 0.73rem;
  font-weight: 700;
  backdrop-filter: blur(10px);
}

.icon-button:hover { color: var(--ink); border-color: rgba(37, 231, 255, 0.6); }

.crosshair {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 42px;
  height: 42px;
  transform: translate(-50%, -50%);
  transition: transform 70ms ease;
}

.crosshair i,
.crosshair b {
  position: absolute;
  display: block;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 5px var(--cyan);
}

.crosshair i { width: 8px; height: 2px; top: 20px; }
.crosshair i:first-child { left: 3px; }
.crosshair i:nth-child(3) { right: 3px; }
.crosshair b { width: 2px; height: 8px; left: 20px; }
.crosshair b:nth-child(2) { top: 3px; }
.crosshair b:last-child { bottom: 3px; }
.crosshair.firing { transform: translate(-50%, -50%) scale(1.2); }

#damage-flash {
  position: absolute;
  inset: 0;
  opacity: 0;
  background: radial-gradient(circle, transparent 45%, rgba(255, 45, 90, 0.55));
  transition: opacity 180ms ease;
}

#damage-flash.active { opacity: 1; }

#hit-marker {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 28px;
  height: 28px;
  opacity: 0;
  transform: translate(-50%, -50%) scale(1.4);
}

#hit-marker span {
  position: absolute;
  left: 13px;
  top: 2px;
  width: 2px;
  height: 24px;
  background: var(--orange);
  transform: rotate(45deg);
  box-shadow: 0 0 8px var(--orange);
}

#hit-marker span:last-child { transform: rotate(-45deg); }
#hit-marker.active { animation: hit 180ms ease-out; }

@keyframes hit {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(0.6); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.5); }
}

#announcement {
  position: absolute;
  left: 50%;
  top: 27%;
  min-width: min(420px, 80vw);
  padding: 10px 18px;
  opacity: 0;
  transform: translate(-50%, -12px);
  border-top: 1px solid rgba(37, 231, 255, 0.6);
  border-bottom: 1px solid rgba(37, 231, 255, 0.6);
  background: linear-gradient(90deg, transparent, rgba(5, 15, 31, 0.82), transparent);
  text-align: center;
  font-weight: 900;
  letter-spacing: 0.08em;
  transition: opacity 220ms ease, transform 220ms ease;
}

#announcement.active { opacity: 1; transform: translate(-50%, 0); }

.vitals {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.hero-chip {
  display: flex;
  align-items: center;
  gap: 10px;
}

#hero-monogram {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--cyan);
  border-radius: 12px 3px 12px 3px;
  color: var(--cyan);
  background: rgba(4, 15, 27, 0.7);
  font-weight: 950;
  font-size: 1.3rem;
  box-shadow: 0 0 22px rgba(37, 231, 255, 0.15);
}

.hero-chip div { display: flex; flex-direction: column; }
.hero-chip small { color: var(--muted); font-size: 0.7rem; }
.hero-chip strong { font: 900 1.25rem ui-monospace, monospace; }
.meters { width: 180px; }

.meter {
  width: 100%;
  height: 7px;
  margin-top: 5px;
  overflow: hidden;
  transform: skew(-12deg);
  background: rgba(255, 255, 255, 0.12);
}

.meter i { display: block; width: 100%; height: 100%; transform-origin: left; }
.meter.health i { background: linear-gradient(90deg, var(--lime), #eaff75); box-shadow: 0 0 10px var(--lime); }
.meter.shield i { background: linear-gradient(90deg, var(--blue), var(--cyan)); box-shadow: 0 0 10px var(--cyan); }
.meters small { display: flex; justify-content: space-between; margin-top: 4px; color: var(--muted); font-size: 0.63rem; }

#minimap {
  width: 124px;
  height: 124px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(4, 9, 20, 0.68);
  box-shadow: inset 0 0 30px #000, 0 0 22px rgba(37, 231, 255, 0.06);
}

.weapon-block { align-items: flex-end; min-width: 220px; }
.weapon-block strong { line-height: 1; }
.weapon-block strong b { font: 950 2.1rem ui-monospace, monospace; }
.weapon-block strong small { color: var(--muted); font: 700 0.92rem ui-monospace, monospace; }

.weapon-slots { display: flex; gap: 5px; margin-top: 8px; }

.weapon-slot {
  width: 37px;
  height: 22px;
  border: 1px solid rgba(148, 166, 196, 0.25);
  border-radius: 4px 1px 4px 1px;
  color: var(--muted);
  background: rgba(5, 10, 22, 0.62);
  font: 700 0.7rem ui-monospace, monospace;
  pointer-events: auto;
  cursor: pointer;
}

.weapon-slot.active { color: #031017; border-color: var(--slot-color, var(--cyan)); background: var(--slot-color, var(--cyan)); }

.overlay {
  background: rgba(2, 5, 12, 0.62);
  backdrop-filter: blur(12px);
}

.armory-screen { z-index: 32; padding: clamp(12px, 2.5vw, 34px); }

.armory-panel {
  display: flex;
  flex-direction: column;
  width: min(1180px, 100%);
  max-height: 94vh;
  overflow: hidden;
  border: 1px solid rgba(37, 231, 255, 0.3);
  border-radius: 22px 5px 22px 5px;
  background: linear-gradient(145deg, rgba(9, 20, 43, 0.985), rgba(4, 9, 21, 0.985));
  box-shadow: var(--shadow), inset 0 1px rgba(255,255,255,.05);
}

.armory-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px 14px;
  border-bottom: 1px solid var(--line);
}

.armory-header h2 { margin: 0; font-size: clamp(1.6rem, 4vw, 2.5rem); letter-spacing: -0.04em; }
.armory-header p:last-child { margin: 5px 0 0; color: var(--muted); font-size: 0.82rem; }

.close-button {
  flex: 0 0 auto;
  padding: 10px 14px;
  border: 1px solid rgba(37,231,255,.48);
  border-radius: 8px 2px 8px 2px;
  color: #031017;
  background: var(--cyan);
  font-weight: 900;
  cursor: pointer;
}

.armory-loadout { padding: 12px 24px; background: rgba(37,231,255,.035); }
.armory-loadout .loadout-slot { padding: 11px 14px; }

.armory-tools {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  padding: 11px 24px 8px;
}

.weapon-search { display: grid; gap: 4px; flex: 0 0 230px; }
.weapon-search span { color: var(--muted); font-size: 0.68rem; font-weight: 800; letter-spacing: .1em; }
.weapon-search input {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 7px 2px 7px 2px;
  outline: none;
  color: var(--ink);
  background: rgba(255,255,255,.04);
  font-size: 0.83rem;
}
.weapon-search input:focus { border-color: var(--cyan); box-shadow: 0 0 0 2px rgba(37,231,255,.1); }

.family-filters { display: flex; flex-wrap: wrap; gap: 5px; }
.family-filter {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255,255,255,.025);
  font-size: 0.7rem;
  font-weight: 800;
  cursor: pointer;
}
.family-filter.active { color: #031017; border-color: var(--cyan); background: var(--cyan); }

.armory-summary {
  display: flex;
  justify-content: space-between;
  padding: 4px 24px 8px;
  color: var(--muted);
  font-size: 0.72rem;
}
.armory-summary strong { color: var(--lime); }

.armory-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  min-height: 0;
  overflow: auto;
  padding: 4px 24px 24px;
  scrollbar-color: rgba(37,231,255,.45) rgba(255,255,255,.04);
}

.weapon-card {
  position: relative;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px 2px 10px 2px;
  color: var(--ink);
  background: linear-gradient(145deg, rgba(255,255,255,.045), rgba(255,255,255,.018));
  text-align: left;
  cursor: pointer;
}
.weapon-card:hover { border-color: var(--weapon-color, var(--cyan)); transform: translateY(-1px); }
.weapon-card.equipped { border-color: var(--weapon-color, var(--cyan)); box-shadow: inset 3px 0 var(--weapon-color, var(--cyan)); }
.weapon-card .weapon-top { display: flex; align-items: center; justify-content: space-between; gap: 7px; }
.weapon-card .weapon-code { color: var(--weapon-color, var(--cyan)); font: 800 .68rem ui-monospace, monospace; }
.weapon-card .rarity { color: var(--rarity-color, var(--muted)); font-size: .64rem; font-weight: 900; }
.weapon-card strong { display: block; overflow: hidden; margin-top: 5px; font-size: .84rem; text-overflow: ellipsis; white-space: nowrap; }
.weapon-card > small { display: block; margin-top: 2px; color: var(--muted); font-size: .67rem; }
.weapon-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 8px; margin-top: 9px; }
.weapon-stat { display: flex; justify-content: space-between; gap: 4px; color: var(--muted); font-size: .62rem; }
.weapon-stat b { color: var(--ink); font-family: ui-monospace, monospace; }
.equipped-tag { display: block; margin-top: 7px; color: var(--weapon-color, var(--cyan)); font-size: .63rem; font-weight: 900; }

.modal-panel {
  width: min(410px, 100%);
  padding: 34px;
  border: 1px solid rgba(37, 231, 255, 0.28);
  border-radius: 20px 4px 20px 4px;
  background: linear-gradient(145deg, rgba(10, 22, 46, 0.96), rgba(5, 11, 25, 0.96));
  box-shadow: var(--shadow);
  text-align: center;
}

.modal-panel h2 { margin-bottom: 8px; font-size: 2rem; }
.modal-panel > p:not(.eyebrow) { color: var(--muted); }
.modal-panel .primary-button,
.modal-panel .secondary-button,
.modal-panel .text-button { width: 100%; justify-content: center; margin-top: 10px; }

.secondary-button {
  padding: 13px 18px;
  border: 1px solid var(--line);
  border-radius: 9px 3px 9px 3px;
  background: rgba(255, 255, 255, 0.04);
  font-weight: 800;
}

.text-button { padding: 10px; color: var(--muted); background: none; }
.text-button:hover { color: var(--cyan); }

.result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 22px 0 10px;
}

.result-stats div {
  padding: 13px 6px;
  border: 1px solid var(--line);
  border-radius: 8px 2px 8px 2px;
  background: rgba(255, 255, 255, 0.025);
}

.result-stats span { display: block; color: var(--muted); font-size: 0.68rem; }
.result-stats strong { display: block; margin-top: 5px; font: 900 1.15rem ui-monospace, monospace; }

#touch-controls { display: none; }

@media (max-width: 800px) {
  #game-shell { min-height: 460px; }
  .start-panel { padding: 18px; border-radius: 16px 4px 16px 4px; }
  .brand-row { grid-template-columns: auto 1fr; padding-bottom: 16px; }
  .brand-mark { width: 48px; height: 48px; }
  .safety-badge { display: none; }
  h1 { font-size: 2.5rem; }
  .selection-grid { grid-template-columns: 1fr; gap: 19px; padding: 20px 0; }
  .card-list { grid-template-columns: repeat(2, 1fr); }
  .hero-card { min-height: 82px; padding: 12px; }
  .hero-card small { display: none; }
  .map-list { grid-template-columns: repeat(2, 1fr); }
  .map-card { min-height: 58px; }
  .loadout-row { grid-template-columns: 1fr; }
  .armory-button { width: 100%; }
  .launch-row { align-items: stretch; flex-direction: column; gap: 14px; }
  .controls-copy { display: none; }
  .primary-button { width: 100%; }
  .score-block { display: none; }
  .action-buttons .icon-button:not(#pause-button) { display: none; }
  .hud-top, .hud-bottom { padding-left: 12px; padding-right: 12px; }
  .meters { width: 110px; }
  #minimap { width: 82px; height: 82px; }
  .weapon-block { min-width: 120px; }
  .weapon-block strong b { font-size: 1.5rem; }
  .weapon-slots { display: none; }
}

@media (max-width: 900px) {
  .armory-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .armory-tools { align-items: stretch; flex-direction: column; gap: 9px; }
  .weapon-search { flex-basis: auto; }
}

@media (max-width: 560px) {
  .menu-loadout { grid-template-columns: 1fr; }
  .menu-loadout .loadout-slot { padding: 7px 10px; }
  .armory-screen { padding: 0; }
  .armory-panel { max-height: 100%; height: 100%; border: 0; border-radius: 0; }
  .armory-header { padding: 15px 14px 10px; }
  .armory-header p:last-child { display: none; }
  .close-button { padding: 9px 10px; font-size: .75rem; }
  .armory-loadout { padding: 8px 14px; gap: 5px; }
  .armory-loadout .loadout-slot { padding: 8px; }
  .armory-loadout .loadout-slot small { display: none; }
  .armory-tools { padding: 8px 14px 5px; }
  .family-filters { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .family-filter { flex: 0 0 auto; }
  .armory-summary { padding: 3px 14px 7px; }
  .armory-grid { grid-template-columns: 1fr; padding: 3px 14px 18px; }
}

@media (pointer: coarse), (max-width: 720px) {
  #touch-controls.active {
    position: absolute;
    inset: 0;
    z-index: 11;
    display: block;
    pointer-events: none;
  }
  .touch-pad {
    position: absolute;
    left: max(24px, env(safe-area-inset-left));
    bottom: max(110px, calc(env(safe-area-inset-bottom) + 100px));
    width: 104px;
    height: 104px;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 50%;
    background: rgba(5, 10, 22, 0.3);
    pointer-events: auto;
    touch-action: none;
  }
  .touch-pad span {
    position: absolute;
    left: 32px;
    top: 32px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(37, 231, 255, 0.38);
    box-shadow: 0 0 16px rgba(37, 231, 255, 0.32);
  }
  .touch-actions {
    position: absolute;
    right: max(22px, env(safe-area-inset-right));
    bottom: max(108px, calc(env(safe-area-inset-bottom) + 98px));
    display: grid;
    grid-template-columns: auto auto;
    gap: 8px;
    pointer-events: auto;
  }
  .touch-actions button {
    width: 58px;
    height: 44px;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 12px 4px 12px 4px;
    color: var(--ink);
    background: rgba(5,10,22,.62);
    font-size: .7rem;
    font-weight: 800;
    touch-action: none;
  }
  .touch-actions #touch-fire {
    grid-row: span 2;
    width: 76px;
    height: 96px;
    color: #041018;
    border-color: var(--cyan);
    background: rgba(37, 231, 255, 0.78);
  }
}

@media (max-height: 700px) and (min-width: 801px) {
  .start-panel { padding: 20px 28px; }
  .brand-row { padding-bottom: 16px; }
  h1 { font-size: 2.8rem; }
  .selection-grid { padding: 17px 0; }
  .hero-card { min-height: 76px; padding: 11px; }
  .hero-card small { display: none; }
  .map-card { min-height: 58px; }
  .launch-row { padding-top: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
