/* ==========================================================================
   SOLARIS BASTION — Minimalist Orbital Command HUD & Shell Styles
   >90% unobstructed live space battlefield · Frosted obsidian sci-fi glass
   ========================================================================== */

:root {
  --font-sans: "Inter", "SF Pro Display", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", "Cascadia Code", ui-monospace, Menlo, Consolas, monospace;

  --void: #040811;
  --glass-bg: rgba(7, 13, 24, 0.62);
  --glass-bg-strong: rgba(8, 15, 28, 0.78);
  --glass-border: rgba(150, 209, 215, 0.17);
  --glass-border-hi: rgba(150, 209, 215, 0.34);
  --glass-inset: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --glass-shadow: 0 10px 30px rgba(0, 0, 0, 0.48);

  --text-primary: #eef6fa;
  --text-secondary: rgba(206, 224, 234, 0.72);
  --text-dim: rgba(176, 198, 214, 0.46);

  --gold: #f5d07a;
  --gold-soft: #c7b592;
  --gold-hi: #f8ecc5;
  --gold-rgb: 245, 208, 122;

  --cyan: #4be8f2;
  --cyan-rgb: 75, 232, 242;
  --danger: #ff5864;
  --danger-rgb: 255, 88, 100;
  --violet: #c084fc;
  --violet-rgb: 192, 132, 252;
  --amber: #ff9e44;
  --amber-rgb: 255, 158, 68;
  --emerald: #4ade80;

  /* Sector dynamic accent (updated via data-sector) */
  --sector-accent: #4be8f2;
  --sector-accent-rgb: 75, 232, 242;

  /* Station signature colors (synced with src/config.js) */
  --st-pulse: #4be8f2;
  --st-beam: #6fa8ff;
  --st-missile: #ff8a4c;
  --st-hangar: #f5b841;
  --st-railgun: #c074ff;
  --st-relay: #4ef2a1;
}

html[data-sector="1"] {
  --sector-accent: #ff6b5a;
  --sector-accent-rgb: 255, 107, 90;
}

html[data-sector="2"] {
  --sector-accent: #6fa8ff;
  --sector-accent-rgb: 111, 168, 255;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--void);
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   Full-Bleed Live Deep-Space Canvas
   ========================================================================== */

#game-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: block;
  z-index: 1;
  background: var(--void);
  cursor: default;
}

#game-canvas.cursor-pointer {
  cursor: pointer;
}

#game-canvas.cursor-aim {
  cursor: crosshair;
}

#game-canvas.cursor-pan {
  cursor: grabbing;
}

/* ==========================================================================
   Shared Frosted Glass Primitives
   ========================================================================== */

.glass-pill {
  background: linear-gradient(180deg, rgba(11, 20, 36, 0.88), rgba(6, 12, 22, 0.92));
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-inset), var(--glass-shadow);
  border-radius: 999px;
  contain: layout style;
}

.glass-panel {
  background: linear-gradient(180deg, rgba(10, 18, 34, 0.92), rgba(6, 11, 22, 0.95));
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-inset), 0 18px 48px rgba(0, 0, 0, 0.62);
  border-radius: 14px;
  contain: layout style;
}

.pill-sep {
  width: 1px;
  height: 16px;
  background: linear-gradient(180deg, transparent, rgba(206, 224, 234, 0.22), transparent);
  flex: 0 0 1px;
}

kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 17px;
  padding: 0 5px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

/* ==========================================================================
   Title Overlay (Translucent, dissolves cleanly on launch)
   ========================================================================== */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.title-overlay {
  background: radial-gradient(
    ellipse 58% 58% at 50% 48%,
    rgba(4, 8, 17, 0.56) 0%,
    rgba(4, 8, 17, 0.24) 55%,
    rgba(4, 8, 17, 0.44) 100%
  );
  transition: opacity 520ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

.title-overlay.dissolving {
  opacity: 0;
  transform: scale(1.035);
  pointer-events: none;
}

.title-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 560px;
}

.emblem-wrap {
  position: relative;
  width: 144px;
  height: 144px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: emblemFloat 5.6s ease-in-out infinite;
}

.emblem-halo {
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(94, 212, 217, 0.24) 0%,
    rgba(199, 181, 146, 0.13) 44%,
    transparent 70%
  );
  filter: blur(12px);
  pointer-events: none;
}

.title-emblem {
  position: relative;
  width: 144px;
  height: 144px;
  object-fit: contain;
  clip-path: polygon(50% 5.5%, 88% 27.5%, 88% 72.5%, 50% 94.5%, 12% 72.5%, 12% 27.5%);
  mix-blend-mode: screen;
  pointer-events: none;
}

.title-emblem-fallback {
  position: relative;
  width: 120px;
  height: 120px;
  filter: drop-shadow(0 0 16px rgba(94, 212, 217, 0.35));
}

.title-heading {
  margin: 0;
  font-size: clamp(32px, 4.8vw, 52px);
  font-weight: 600;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  line-height: 1.1;
  background: linear-gradient(180deg, #ffffff 0%, var(--gold-hi) 52%, var(--gold-soft) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 36px rgba(75, 232, 242, 0.16);
}

.title-tagline {
  margin: 12px 0 32px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-indent: 0.28em;
  color: rgba(182, 224, 232, 0.78);
  text-transform: uppercase;
}

.title-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.btn-primary {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  padding: 0 34px;
  border-radius: 999px;
  border: 1px solid rgba(94, 212, 217, 0.62);
  background: linear-gradient(
    180deg,
    rgba(28, 72, 90, 0.72) 0%,
    rgba(11, 30, 44, 0.86) 100%
  );
  color: #f4fcff;
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-indent: 0.24em;
  cursor: pointer;
  box-shadow:
    0 0 28px rgba(75, 232, 242, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform 160ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  border-color: rgba(248, 236, 197, 0.85);
  box-shadow:
    0 0 38px rgba(75, 232, 242, 0.42),
    0 0 14px rgba(245, 208, 122, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.btn-primary:active {
  transform: translateY(0) scale(0.985);
}

.btn-glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 22%, rgba(255, 255, 255, 0.18) 50%, transparent 78%);
  transform: translateX(-110%);
  animation: btnSweep 4.2s ease-in-out infinite;
  pointer-events: none;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  padding: 0 24px;
  border-radius: 999px;
  border: 1px solid rgba(245, 208, 122, 0.34);
  background: rgba(12, 18, 30, 0.62);
  backdrop-filter: blur(12px);
  color: var(--gold-hi);
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-indent: 0.18em;
  cursor: pointer;
  transition: transform 150ms ease, border-color 160ms ease, background 160ms ease;
}

.btn-secondary:hover {
  transform: translateY(-1px);
  border-color: rgba(245, 208, 122, 0.72);
  background: rgba(26, 30, 44, 0.76);
}

.title-meta {
  margin-top: 16px;
  min-height: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: rgba(245, 208, 122, 0.72);
}

.title-foot-hint {
  position: absolute;
  bottom: 22px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: rgba(186, 212, 224, 0.44);
  text-align: center;
  pointer-events: none;
}

/* ==========================================================================
   HUD Layer (Pointer-Events None Everywhere Except Interactive Pills)
   ========================================================================== */

.hud {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  opacity: 1;
  transition: opacity 320ms ease;
}

/* ==========================================================================
   Whisper-Thin Floating Top Bar (<= 44px)
   ========================================================================== */

.hud-top {
  position: fixed;
  top: 12px;
  left: 14px;
  right: 14px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 12px;
  pointer-events: none;
}

.pill-telemetry {
  justify-self: start;
  height: 40px;
  padding: 0 15px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  pointer-events: auto;
}

.metric {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.metric-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.icon-citadel {
  color: var(--cyan);
}

.icon-credits {
  color: var(--gold);
  filter: drop-shadow(0 0 6px rgba(var(--gold-rgb), 0.45));
}

.icon-kills {
  color: var(--text-secondary);
}

.num-val {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: var(--text-primary);
}

.num-credits {
  color: var(--gold-hi);
  text-shadow: 0 0 12px rgba(var(--gold-rgb), 0.45);
  transition: transform 140ms ease, color 140ms ease;
}

.num-credits.pulse {
  transform: scale(1.1);
}

.citadel-readout {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 58px;
}

.citadel-nums {
  display: flex;
  align-items: baseline;
  gap: 5px;
  line-height: 1;
}

.num-shield {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--cyan);
}

.citadel-bars {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 64px;
}

.bar-track {
  width: 100%;
  height: 3px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.bar-shield-track {
  height: 2px;
}

.bar-fill {
  width: 100%;
  height: 100%;
  border-radius: 99px;
  transform-origin: left center;
  transform: scaleX(1);
}

.bar-shield-fill {
  background: linear-gradient(90deg, #38bdf8, #4be8f2);
  box-shadow: 0 0 6px rgba(75, 232, 242, 0.6);
}

.bar-hull-fill {
  background: linear-gradient(90deg, #eab308, #4ade80);
}

.metric-citadel.critical .icon-citadel,
.metric-citadel.critical #hud-core-hp {
  color: var(--danger);
  animation: criticalPulse 900ms ease-in-out infinite;
}

.metric-citadel.critical .bar-hull-fill {
  background: linear-gradient(90deg, #ff3850, #ff7a59);
  box-shadow: 0 0 8px rgba(255, 56, 80, 0.7);
}

/* Center Pill + Boss Bar Stack */

.hud-center-group {
  justify-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.pill-sector {
  position: relative;
  overflow: hidden;
  min-height: 40px;
  max-height: 44px;
  padding: 0 16px;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  pointer-events: auto;
  border-color: rgba(var(--sector-accent-rgb), 0.26);
}

.sector-row {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  white-space: nowrap;
}

.sector-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--sector-accent);
  text-transform: uppercase;
  text-shadow: 0 0 14px rgba(var(--sector-accent-rgb), 0.35);
}

.wave-label {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.1em;
  color: var(--text-primary);
}

.icon-doctrines {
  color: var(--gold);
  filter: drop-shadow(0 0 6px rgba(var(--gold-rgb), 0.45));
}

.num-doctrines {
  color: var(--gold-hi);
}

.hud-sub-cues {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  pointer-events: auto;
}

.mutator-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 19px;
  padding: 0 9px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--gold-hi);
  background: rgba(22, 13, 20, 0.88);
  border: 1px solid rgba(var(--gold-rgb), 0.5);
  box-shadow: 0 0 14px rgba(var(--gold-rgb), 0.24);
  text-transform: uppercase;
}

.mutator-chip::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 6px var(--gold);
}

.prep-threats {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.threat-pill {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 7px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  background: rgba(7, 13, 24, 0.88);
  border: 1px solid color-mix(in srgb, var(--threat-col, #96d1d7) 48%, transparent);
  color: var(--threat-col, #d8eef4);
  text-transform: uppercase;
}

.btn-call-wave {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  margin-left: 2px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid rgba(var(--sector-accent-rgb), 0.65);
  background: rgba(var(--sector-accent-rgb), 0.15);
  color: #f3fdff;
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  cursor: pointer;
  box-shadow: 0 0 16px rgba(var(--sector-accent-rgb), 0.28);
  transition: transform 130ms ease, background 150ms ease, box-shadow 150ms ease;
}

.btn-call-wave:hover {
  background: rgba(var(--sector-accent-rgb), 0.28);
  box-shadow: 0 0 22px rgba(var(--sector-accent-rgb), 0.48);
  transform: translateY(-0.5px);
}

.btn-call-wave:active {
  transform: scale(0.97);
}

.call-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sector-accent);
  box-shadow: 0 0 8px var(--sector-accent);
  animation: dotPulse 1.4s ease-in-out infinite;
}

.call-bonus {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--gold-hi);
}

.wave-progress-track {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 99px;
  overflow: hidden;
}

.wave-progress-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, rgba(var(--sector-accent-rgb), 0.65), var(--sector-accent));
  box-shadow: 0 0 8px rgba(var(--sector-accent-rgb), 0.75);
  transform-origin: left center;
  transform: scaleX(0);
}

/* Sleek Boss Dreadnought Bar (ONLY during boss waves) */

.boss-bar {
  width: min(410px, 56vw);
  padding: 7px 14px 8px;
  border-radius: 12px;
  border-color: rgba(255, 88, 100, 0.38);
  background: linear-gradient(180deg, rgba(22, 9, 18, 0.88), rgba(14, 6, 12, 0.92));
  box-shadow:
    inset 0 1px 0 rgba(255, 160, 160, 0.08),
    0 10px 28px rgba(0, 0, 0, 0.55),
    0 0 24px rgba(255, 72, 92, 0.16);
  pointer-events: none;
  animation: fadeSlideDown 260ms cubic-bezier(0.16, 1, 0.3, 1);
}

.boss-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 5px;
}

.boss-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: #ffe2e4;
  text-transform: uppercase;
}

.boss-diamond {
  width: 7px;
  height: 7px;
  transform: rotate(45deg);
  background: var(--danger);
  box-shadow: 0 0 10px var(--danger);
}

.boss-status {
  font-family: var(--font-mono);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 206, 210, 0.78);
}

.boss-bars {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.boss-track {
  width: 100%;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.09);
  overflow: hidden;
}

.boss-shield-track {
  height: 4px;
}

.boss-hull-track {
  height: 6px;
}

.boss-fill {
  width: 100%;
  height: 100%;
  border-radius: 99px;
  transform-origin: left center;
  transform: scaleX(1);
}

.boss-shield-fill {
  background: linear-gradient(90deg, #38bdf8, #67f5ff);
  box-shadow: 0 0 10px rgba(75, 232, 242, 0.7);
}

.boss-hull-fill {
  background: linear-gradient(90deg, #dc2626, #ff5864 60%, #fbbf24);
  box-shadow: 0 0 10px rgba(255, 88, 100, 0.65);
}

/* Right Pill: Speed, Pause, AI Co-Pilot, Mute, Help */

.hud-right-group {
  justify-self: end;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  pointer-events: none;
}

.pill-controls {
  height: 40px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  pointer-events: auto;
}

.ctrl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 28px;
  min-width: 30px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: color 130ms ease, background 130ms ease, border-color 130ms ease, box-shadow 130ms ease;
}

.ctrl-btn svg {
  width: 15px;
  height: 15px;
}

.ctrl-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

.ctrl-btn.active {
  color: var(--cyan);
  background: rgba(var(--cyan-rgb), 0.14);
  border-color: rgba(var(--cyan-rgb), 0.42);
  box-shadow: 0 0 14px rgba(var(--cyan-rgb), 0.25);
}

.ctrl-speed.fast {
  color: var(--gold-hi);
  background: rgba(var(--gold-rgb), 0.12);
  border-color: rgba(var(--gold-rgb), 0.34);
}

.ctrl-ai {
  padding: 0 10px;
  letter-spacing: 0.08em;
}

.ai-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(206, 224, 234, 0.3);
  transition: background 150ms ease, box-shadow 150ms ease;
}

.ctrl-ai.active {
  color: #e6fdff;
  background: rgba(var(--cyan-rgb), 0.18);
  border-color: rgba(var(--cyan-rgb), 0.62);
  box-shadow: 0 0 16px rgba(var(--cyan-rgb), 0.36);
}

.ctrl-ai.active .ai-dot {
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
  animation: dotPulse 1.5s ease-in-out infinite;
}

/* Compact Floating Hotkeys Popover */

.help-popover {
  position: absolute;
  top: 48px;
  right: 0;
  width: 286px;
  padding: 13px 15px 14px;
  pointer-events: auto;
  animation: fadeSlideDown 160ms cubic-bezier(0.16, 1, 0.3, 1);
}

.help-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--sector-accent);
  margin-bottom: 10px;
}

.help-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.help-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
  color: var(--text-secondary);
}

/* ==========================================================================
   Sector Shift / Wave Banner (Brief 2.5s Dramatic Translucent Pulse)
   ========================================================================== */

.sector-banner {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  pointer-events: none;
  z-index: 9;
  opacity: 0;
  transition: opacity 140ms ease;
}

.sector-banner.boss-offset {
  top: 124px;
}

.sector-banner.show {
  animation: bannerPulse 2.05s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.banner-rule {
  width: min(290px, 46vw);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(var(--sector-accent-rgb), 0.68), transparent);
}

.banner-kicker {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-indent: 0.32em;
  color: rgba(var(--gold-rgb), 0.85);
}

.banner-title {
  margin: 3px 0 2px;
  font-size: clamp(16px, 2.2vw, 22px);
  font-weight: 600;
  letter-spacing: 0.24em;
  text-indent: 0.24em;
  color: #f6fbff;
  text-shadow: 0 0 22px rgba(var(--sector-accent-rgb), 0.48);
  white-space: nowrap;
}

.banner-sub {
  margin-bottom: 6px;
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-indent: 0.2em;
  color: rgba(206, 224, 234, 0.74);
}

/* ==========================================================================
   Armed Mode Hint & Whisper-Thin Tactical Comms Subtitle Strip
   ========================================================================== */

.armed-hint {
  position: fixed;
  left: 50%;
  bottom: 118px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(7, 14, 26, 0.9);
  border: 1px solid rgba(var(--sector-accent-rgb), 0.42);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: #ebfaff;
  pointer-events: none;
  z-index: 14;
  white-space: nowrap;
}

.armed-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sector-accent);
  box-shadow: 0 0 8px var(--sector-accent);
  animation: dotPulse 1.1s ease-in-out infinite;
}

.comms-strip {
  position: fixed;
  left: 50%;
  bottom: 84px;
  transform: translate(-50%, 8px);
  max-width: min(640px, 86vw);
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(6, 12, 22, 0.9);
  border: 1px solid rgba(150, 209, 215, 0.18);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  line-height: 1.3;
  color: rgba(232, 244, 250, 0.9);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  z-index: 12;
  transition: opacity 260ms ease, transform 280ms cubic-bezier(0.16, 1, 0.3, 1), visibility 0s linear 260ms;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.comms-strip.visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  transition: opacity 260ms ease, transform 280ms cubic-bezier(0.16, 1, 0.3, 1), visibility 0s linear 0s;
}

.comms-eq {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 10px;
  flex-shrink: 0;
}

.comms-eq i {
  display: block;
  width: 2px;
  height: 10px;
  border-radius: 2px;
  background: var(--sector-accent);
  transform-origin: bottom center;
  transform: scaleY(0.3);
}

.comms-strip.visible .comms-eq i {
  animation: eqBounce 850ms ease-in-out infinite;
}

.comms-strip.visible .comms-eq i:nth-child(2) {
  animation-delay: 160ms;
}

.comms-strip.visible .comms-eq i:nth-child(3) {
  animation-delay: 320ms;
}

.comms-speaker {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--sector-accent);
  flex-shrink: 0;
}

.comms-slash {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  flex-shrink: 0;
}

.comms-text {
  font-style: italic;
  color: rgba(236, 245, 252, 0.92);
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   Compact Bottom Tactical Dock (54px Centered Floating Glass Pill)
   ========================================================================== */

.hud-dock {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  height: 54px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
  z-index: 15;
}

.dock-group {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.dock-divider {
  width: 1px;
  height: 30px;
  margin: 0 2px;
  background: linear-gradient(180deg, transparent, rgba(206, 224, 234, 0.24), transparent);
}

.dock-chip {
  position: relative;
  width: 48px;
  height: 42px;
  padding: 2px 0 3px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(14, 23, 38, 0.56);
  color: var(--chip-color, var(--text-primary));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  cursor: pointer;
  transition: transform 130ms ease, border-color 140ms ease, background 140ms ease, box-shadow 150ms ease, opacity 140ms ease;
}

.station-chip[data-station="pulse"] { --chip-color: var(--st-pulse); }
.station-chip[data-station="beam"] { --chip-color: var(--st-beam); }
.station-chip[data-station="missile"] { --chip-color: var(--st-missile); }
.station-chip[data-station="hangar"] { --chip-color: var(--st-hangar); }
.station-chip[data-station="railgun"] { --chip-color: var(--st-railgun); }
.station-chip[data-station="relay"] { --chip-color: var(--st-relay); }

.ability-mine { --chip-color: var(--amber); }
.ability-mine.mode-emp { --chip-color: var(--violet); }
.ability-scramble { --chip-color: #60a5fa; }
.ability-lance { --chip-color: var(--gold); }

.dock-chip:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(22, 36, 56, 0.78);
}

.dock-chip.armed {
  border-color: var(--chip-color);
  background: rgba(24, 42, 64, 0.88);
  box-shadow: 0 0 18px color-mix(in srgb, var(--chip-color) 45%, transparent);
  transform: translateY(-2px);
}

.dock-chip.unaffordable,
.dock-chip.on-cooldown {
  opacity: 0.44;
}

.dock-chip.unaffordable:hover {
  opacity: 0.65;
}

.chip-key {
  position: absolute;
  top: 2px;
  left: 4px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 700;
  color: rgba(220, 236, 244, 0.62);
  line-height: 1;
}

.chip-svg {
  width: 21px;
  height: 21px;
  position: relative;
  z-index: 2;
}

.chip-cost {
  position: relative;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: rgba(235, 244, 250, 0.88);
}

.station-chip.unaffordable .chip-cost {
  color: rgba(255, 130, 140, 0.85);
}

/* Hover micro tooltip above dock chips */

.chip-tip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translate(-50%, 4px);
  padding: 4px 9px;
  border-radius: 6px;
  background: rgba(6, 12, 22, 0.92);
  border: 1px solid rgba(150, 209, 215, 0.22);
  color: var(--text-secondary);
  font-size: 10px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 130ms ease, transform 130ms ease;
  z-index: 40;
}

.chip-tip strong {
  color: var(--text-primary);
  font-weight: 600;
  letter-spacing: 0.08em;
}

.dock-chip:hover .chip-tip {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Mine Toggle Badge */

.ability-wrap {
  position: relative;
  display: inline-flex;
}

.mine-mode-badge {
  position: absolute;
  top: -8px;
  right: -4px;
  height: 14px;
  padding: 0 4.5px;
  border-radius: 999px;
  border: 1px solid rgba(var(--amber-rgb), 0.62);
  background: rgba(24, 15, 10, 0.94);
  color: #ffd19b;
  font-family: var(--font-mono);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  z-index: 4;
  transition: border-color 140ms ease, color 140ms ease, background 140ms ease, transform 120ms ease;
}

.mine-mode-badge:hover {
  transform: scale(1.07);
}

.mine-mode-badge.mode-emp {
  border-color: rgba(var(--violet-rgb), 0.65);
  background: rgba(22, 12, 34, 0.92);
  color: #e4c4ff;
}

.mine-pips {
  display: inline-flex;
  align-items: center;
  gap: 2.5px;
}

.mine-pip {
  width: 4.5px;
  height: 4.5px;
  border-radius: 50%;
  background: var(--chip-color);
  box-shadow: 0 0 5px var(--chip-color);
}

/* Scramble Cooldown Overlay */

.ability-scramble {
  overflow: hidden;
}

.ability-cd-fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 100%;
  background: rgba(4, 10, 20, 0.72);
  border-top: 1px solid rgba(96, 165, 250, 0.4);
  pointer-events: none;
  z-index: 1;
  transform-origin: bottom center;
  transform: scaleY(0);
}

/* Solaris Lance Circular Progress Arc + Pulsing Golden Ready State */

.ability-lance {
  width: 50px;
}

.lance-arc-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  pointer-events: none;
}

.lance-arc-bg {
  fill: none;
  stroke: rgba(245, 208, 122, 0.12);
  stroke-width: 2;
}

.lance-arc-fg {
  fill: none;
  stroke: var(--gold);
  stroke-width: 2.2;
  stroke-linecap: round;
}

.ability-lance.ready {
  opacity: 1 !important;
  border-color: rgba(var(--gold-rgb), 0.88);
  background: radial-gradient(circle at 50% 45%, rgba(245, 208, 122, 0.28), rgba(26, 22, 14, 0.84));
  color: #fff6db;
  box-shadow: 0 0 14px rgba(var(--gold-rgb), 0.45), inset 0 0 10px rgba(var(--gold-rgb), 0.22);
}

.ability-lance.ready::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: 0 0 28px rgba(var(--gold-rgb), 0.85), inset 0 0 16px rgba(var(--gold-rgb), 0.4);
  opacity: 0;
  animation: lanceReadyPulse 1.6s ease-in-out infinite;
}

.ability-lance.ready .chip-cost {
  color: var(--gold-hi);
}

/* ==========================================================================
   Anchored Radial Context Wheel (Dynamic World-to-Screen Node Menu)
   ========================================================================== */

.radial-wheel {
  position: fixed;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  z-index: 20;
  pointer-events: none;
}

.radial-wheel.open .radial-items {
  animation: radialPop 150ms cubic-bezier(0.16, 1, 0.3, 1);
}

.radial-ring-halo {
  position: absolute;
  left: 0;
  top: 0;
  width: 152px;
  height: 152px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px dashed rgba(var(--sector-accent-rgb), 0.24);
  background: radial-gradient(circle, rgba(6, 12, 22, 0.08) 38%, rgba(6, 12, 22, 0.36) 72%, transparent 74%);
  pointer-events: none;
}

.radial-items {
  position: absolute;
  left: 0;
  top: 0;
}

.radial-node-btn {
  position: absolute;
  left: 0;
  top: 0;
  width: 50px;
  height: 50px;
  margin-left: -25px;
  margin-top: -25px;
  border-radius: 50%;
  border: 1px solid rgba(150, 209, 215, 0.28);
  background: linear-gradient(180deg, rgba(12, 23, 42, 0.92), rgba(7, 14, 26, 0.95));
  color: var(--btn-accent, var(--text-primary));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: transform 130ms ease, border-color 140ms ease, background 140ms ease, box-shadow 140ms ease, opacity 130ms ease;
}

.radial-node-btn:hover {
  transform: translate(var(--rx), var(--ry)) scale(1.1);
  border-color: var(--btn-accent, var(--cyan));
  background: rgba(14, 28, 46, 0.94);
  box-shadow: 0 0 22px color-mix(in srgb, var(--btn-accent, var(--cyan)) 48%, transparent);
  z-index: 3;
}

.radial-node-btn {
  transform: translate(var(--rx), var(--ry));
}

.radial-node-btn.unaffordable {
  opacity: 0.54;
  border-color: rgba(150, 209, 215, 0.22);
}

.radial-node-btn.unaffordable .radial-sub {
  color: #ff9c8a;
}

.radial-node-btn.confirm-sell {
  border-color: var(--danger);
  background: rgba(68, 12, 22, 0.92);
  color: #ffd5da;
  box-shadow: 0 0 22px rgba(255, 88, 100, 0.55);
  animation: criticalPulse 750ms ease-in-out infinite;
}

.radial-node-btn.branch-btn {
  width: 62px;
  height: 62px;
  margin-left: -31px;
  margin-top: -31px;
  gap: 1.5px;
  border-color: rgba(var(--gold-rgb), 0.52);
}

.radial-node-btn.branch-btn .radial-svg {
  width: 16px;
  height: 16px;
}

.radial-branch-lbl {
  font-family: var(--font-mono);
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1;
  color: var(--text-primary);
  text-transform: uppercase;
}

.radial-svg {
  width: 20px;
  height: 20px;
}

.radial-sub {
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: rgba(235, 245, 252, 0.9);
}

.radial-key {
  position: absolute;
  top: -3px;
  right: -2px;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  border-radius: 999px;
  background: rgba(7, 13, 24, 0.96);
  border: 1px solid rgba(150, 209, 215, 0.34);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.radial-stat-pill {
  position: absolute;
  left: 0;
  top: -126px;
  transform: translateX(-50%);
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(7, 14, 26, 0.92);
  border: 1px solid rgba(150, 209, 215, 0.24);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.48);
}

.radial-stat-pill .stat-tier {
  color: var(--gold-hi);
}

.radial-stat-pill .stat-nexus {
  color: var(--cyan);
}

.radial-caption {
  position: absolute;
  left: 0;
  top: 112px;
  transform: translateX(-50%);
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(6, 12, 22, 0.94);
  border: 1px solid rgba(150, 209, 215, 0.24);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: rgba(232, 244, 250, 0.92);
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.52);
}

.radial-caption strong {
  color: var(--gold-hi);
  font-weight: 600;
  letter-spacing: 0.08em;
}

/* ==========================================================================
   Doctrine Selection Strip (Every 10 Waves After Boss Kill)
   ========================================================================== */

.doctrine-overlay {
  background: radial-gradient(circle at 50% 45%, rgba(6, 12, 24, 0.62), rgba(4, 8, 17, 0.78));
  backdrop-filter: blur(5px);
  z-index: 25;
}

.doctrine-shell {
  width: min(860px, 92vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  animation: fadeSlideDown 260ms cubic-bezier(0.16, 1, 0.3, 1);
}

.doctrine-header {
  text-align: center;
}

.doctrine-kicker {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-indent: 0.28em;
  color: var(--gold);
  margin-bottom: 6px;
}

.doctrine-title {
  margin: 0;
  font-size: clamp(18px, 2.6vw, 26px);
  font-weight: 600;
  letter-spacing: 0.22em;
  text-indent: 0.22em;
  color: #f6fbff;
}

.doctrine-cards {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.doctrine-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 8px;
  padding: 18px 18px 16px;
  border-radius: 14px;
  border: 1px solid rgba(var(--gold-rgb), 0.26);
  background: linear-gradient(180deg, rgba(13, 22, 38, 0.82), rgba(7, 13, 24, 0.9));
  backdrop-filter: blur(16px);
  color: var(--text-primary);
  cursor: pointer;
  box-shadow: var(--glass-inset), 0 14px 36px rgba(0, 0, 0, 0.5);
  transition: transform 150ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.doctrine-card:hover {
  transform: translateY(-4px);
  border-color: rgba(var(--gold-rgb), 0.82);
  background: linear-gradient(180deg, rgba(22, 36, 58, 0.88), rgba(10, 18, 32, 0.94));
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.6),
    0 0 28px rgba(var(--gold-rgb), 0.22);
}

.doctrine-card-top {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.doctrine-card-head {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.doctrine-card-icon {
  width: 24px;
  height: 24px;
  padding: 4px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.doctrine-card-icon svg {
  width: 15px;
  height: 15px;
}

.doctrine-card-tag {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--sector-accent);
  text-transform: uppercase;
}

.doctrine-card-name {
  margin: 0;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--gold-hi);
}

.doctrine-card-desc {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-secondary);
}

/* ==========================================================================
   Defeat Overlay
   ========================================================================== */

.defeat-overlay {
  background: radial-gradient(circle at 50% 45%, rgba(28, 6, 12, 0.54), rgba(4, 8, 17, 0.84));
  backdrop-filter: blur(6px);
  z-index: 35;
}

.defeat-card {
  width: min(460px, 92vw);
  padding: 28px 28px 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border-color: rgba(255, 88, 100, 0.34);
  animation: fadeSlideDown 280ms cubic-bezier(0.16, 1, 0.3, 1);
}

.defeat-kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  color: var(--danger);
  margin-bottom: 6px;
}

.defeat-title {
  margin: 0 0 22px;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-indent: 0.24em;
  color: #fff2f3;
}

.defeat-stats {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 24px;
  padding: 14px 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.defeat-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.stat-lbl {
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--text-dim);
}

.stat-num {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

/* ==========================================================================
   Animations & Responsive Refinements
   ========================================================================== */

@keyframes emblemFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes btnSweep {
  0%, 62% { transform: translateX(-120%); }
  100% { transform: translateX(130%); }
}

@keyframes dotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.8); }
}

@keyframes criticalPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.52; }
}

@keyframes lanceReadyPulse {
  0%, 100% { opacity: 0; }
  50% { opacity: 1; }
}

@keyframes eqBounce {
  0%, 100% { transform: scaleY(0.3); }
  50% { transform: scaleY(1); }
}

@keyframes fadeSlideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes radialPop {
  from { opacity: 0; transform: scale(0.82); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes bannerPulse {
  0% { opacity: 0; transform: translate(-50%, -6px) scale(0.97); }
  14% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  78% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -4px) scale(1.01); }
}

@media (max-width: 960px) {
  .hud-top {
    top: 8px;
    left: 8px;
    right: 8px;
    gap: 6px;
  }
  .pill-telemetry,
  .pill-sector,
  .pill-controls {
    height: 36px;
    padding: 0 10px;
  }
  .sector-label {
    display: none;
  }
  .hud-dock {
    height: 50px;
    bottom: 10px;
    padding: 0 8px;
    gap: 5px;
  }
  .dock-chip {
    width: 42px;
    height: 38px;
  }
  .doctrine-cards {
    grid-template-columns: 1fr;
  }
  .defeat-stats {
    grid-template-columns: repeat(3, 1fr);
  }
}
