:root {
  --void: #05070d;
  --void-2: #090d16;
  --panel: rgba(13, 18, 29, 0.84);
  --panel-strong: rgba(17, 24, 38, 0.94);
  --line: rgba(103, 205, 255, 0.24);
  --line-strong: rgba(120, 220, 255, 0.52);
  --gold: #f5c451;
  --cyan: #4edcff;
  --blue: #5f85ff;
  --green: #57f0a8;
  --red: #ff5f7e;
  --violet: #a981ff;
  --amber: #ff965a;
  --text: #edf5ff;
  --muted: #8ba2b8;
  --dim: rgba(139, 162, 184, 0.72);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  --font-ui: "Rajdhani", system-ui, sans-serif;
  --font-title: "Oxanium", system-ui, sans-serif;
  --font-mono: "Share Tech Mono", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: radial-gradient(circle at 50% 12%, #132033 0, var(--void) 46%, #030409 100%);
  color: var(--text);
  font-family: var(--font-ui);
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

button,
input {
  font: inherit;
}

button {
  border: 1px solid rgba(95, 133, 255, 0.36);
  background:
    linear-gradient(180deg, rgba(85, 131, 186, 0.18), rgba(10, 17, 29, 0.82)),
    rgba(11, 16, 26, 0.86);
  color: var(--text);
  min-height: 38px;
  border-radius: 6px;
  padding: 9px 12px;
  text-transform: uppercase;
  letter-spacing: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.16s ease, color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

button:hover:not(:disabled),
button.active {
  border-color: var(--cyan);
  color: #ffffff;
  background:
    linear-gradient(180deg, rgba(78, 220, 255, 0.22), rgba(17, 25, 39, 0.92)),
    rgba(11, 16, 26, 0.92);
}

button:active:not(:disabled) {
  transform: translateY(1px);
}

button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

#game-shell,
#game-canvas {
  position: fixed;
  inset: 0;
}

#game-canvas {
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
}

.glass-panel {
  position: fixed;
  z-index: 3;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(21, 30, 47, 0.94), rgba(8, 12, 21, 0.82)),
    var(--panel);
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(16px);
}

.eyebrow {
  color: var(--gold);
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  margin-bottom: 7px;
  text-transform: uppercase;
}

.hud-panel {
  top: 12px;
  left: 12px;
  right: 12px;
  min-height: 72px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  align-items: center;
  gap: 16px;
}

.hud-title strong {
  display: block;
  font-family: var(--font-title);
  font-size: 24px;
  line-height: 1;
  color: #f5f8ff;
}

.hud-title span:last-child {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}

.hud-meters {
  display: grid;
  grid-template-columns: repeat(4, minmax(88px, 1fr));
  gap: 8px;
  min-width: min(560px, 48vw);
}

.meter-chip,
.run-card,
.stat-grid > div,
.mission-node,
.tower-card,
.support-card {
  border: 1px solid rgba(93, 203, 255, 0.18);
  background: linear-gradient(180deg, rgba(11, 22, 36, 0.88), rgba(7, 10, 18, 0.72));
}

.meter-chip {
  min-height: 48px;
  padding: 8px 10px;
}

.meter-chip span,
.section-label span,
.stat-grid span {
  display: block;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
}

.meter-chip strong {
  display: block;
  color: var(--text);
  font-family: var(--font-title);
  font-size: 18px;
  line-height: 1.1;
  margin-top: 3px;
}

.hud-actions {
  display: flex;
  gap: 8px;
}

.icon-btn {
  width: 42px;
  min-width: 42px;
  height: 42px;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 14px;
}

.icon-btn-small {
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
}

.right-hud-stack {
  position: fixed;
  z-index: 3;
  right: 12px;
  top: 100px;
  bottom: clamp(188px, 30vh, 244px);
  width: 320px;
  display: grid;
  gap: 12px;
  align-content: start;
  overflow: auto;
  padding-right: 4px;
  scrollbar-color: rgba(78, 220, 255, 0.5) rgba(7, 12, 20, 0.72);
}

.right-hud-stack .glass-panel {
  position: static;
  width: 100%;
}

.mission-tracker {
  padding: 14px;
}

.mission-tracker h2,
.tower-inspector h2,
.run-card h2,
.modal h2,
.modal h1 {
  margin: 0;
  font-family: var(--font-title);
}

.directive-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.directive-item {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 8px;
  align-items: start;
  color: var(--muted);
  font-size: 13px;
}

.directive-box {
  width: 14px;
  height: 14px;
  border: 1px solid rgba(78, 220, 255, 0.48);
  margin-top: 3px;
}

.directive-item.complete {
  color: rgba(237, 245, 255, 0.54);
}

.directive-item.complete .directive-box {
  background: var(--green);
  border-color: var(--green);
  box-shadow: 0 0 12px rgba(87, 240, 168, 0.7);
}

.objective-panel {
  margin-top: 14px;
  border-top: 1px solid rgba(93, 203, 255, 0.12);
  padding-top: 12px;
}

.objective-heading {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: end;
}

.objective-heading strong {
  color: var(--gold);
  font-family: var(--font-title);
  font-size: 13px;
  text-align: right;
}

.objective-meter {
  height: 8px;
  border: 1px solid rgba(93, 203, 255, 0.18);
  background: rgba(5, 9, 16, 0.82);
  margin-top: 9px;
  overflow: hidden;
}

.objective-meter span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--green));
  box-shadow: 0 0 18px rgba(78, 220, 255, 0.3);
}

.objective-meter.warn span {
  background: linear-gradient(90deg, var(--gold), var(--red));
  box-shadow: 0 0 18px rgba(255, 95, 126, 0.34);
}

.objective-meter.compact {
  height: 6px;
  margin-top: 6px;
}

.objective-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 9px;
}

.objective-meta div {
  border: 1px solid rgba(93, 203, 255, 0.13);
  background: rgba(6, 13, 23, 0.56);
  padding: 6px 7px;
}

.objective-meta span,
.objective-summary-row span {
  display: block;
  color: var(--dim);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.objective-meta strong,
.objective-summary-row strong {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 11px;
}

.objective-summary {
  margin-top: 10px;
}

.objective-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.hazard-summary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.hazard-summary-row span {
  border: 1px solid color-mix(in srgb, var(--hazard-color, var(--gold)) 38%, transparent);
  background: color-mix(in srgb, var(--hazard-color, var(--gold)) 10%, rgba(6, 13, 23, 0.74));
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 9px;
  padding: 3px 5px;
}

.tactical-map {
  padding: 12px;
}

#minimap-canvas {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid rgba(78, 220, 255, 0.16);
  background: rgba(3, 5, 10, 0.62);
}

.tower-inspector {
  left: 12px;
  top: 100px;
  bottom: clamp(188px, 30vh, 244px);
  width: 300px;
  padding: 14px;
  overflow: auto;
  scrollbar-color: rgba(78, 220, 255, 0.5) rgba(7, 12, 20, 0.72);
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.tower-inspector p,
.run-card p,
.modal p,
#wave-preview-copy {
  color: var(--muted);
  line-height: 1.45;
  margin: 8px 0 0;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.stat-grid > div {
  padding: 9px 10px;
}

.stat-grid strong {
  display: block;
  color: var(--text);
  font-family: var(--font-title);
  margin-top: 3px;
}

.inspector-actions {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.inspector-actions-secondary {
  grid-template-columns: 1fr;
}

.branch-grid {
  display: grid;
  gap: 8px;
}

.branch-grid-preview {
  margin-top: 7px;
}

.branch-preview-heading {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 10px;
  margin-top: 10px;
  text-transform: uppercase;
}

.branch-choice {
  display: grid;
  gap: 5px;
  text-align: left;
  border-color: rgba(245, 196, 81, 0.28);
  background:
    linear-gradient(135deg, rgba(245, 196, 81, 0.12), transparent 42%),
    rgba(6, 13, 23, 0.78);
}

.branch-preview {
  cursor: default;
  opacity: 0.78;
}

.branch-choice.branch-fit-prime,
.installed-branch.branch-fit-prime {
  border-color: rgba(87, 240, 168, 0.44);
}

.branch-choice.branch-fit-strong,
.installed-branch.branch-fit-strong {
  border-color: rgba(245, 196, 81, 0.42);
}

.branch-choice strong,
.branch-choice span,
.branch-choice em {
  display: block;
}

.branch-choice strong {
  color: #fff1c6;
  font-family: var(--font-title);
  font-size: 14px;
}

.branch-choice span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.branch-choice em {
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 11px;
  font-style: normal;
}

.branch-fit-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.branch-fit-row .branch-fit {
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
}

.branch-fit-row .branch-fit-prime {
  color: var(--green);
}

.branch-fit-row .branch-fit-strong {
  color: var(--gold);
}

.branch-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.branch-tag-list span {
  border: 1px solid rgba(93, 203, 255, 0.16);
  background: rgba(6, 13, 23, 0.56);
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 9px;
  padding: 3px 5px;
  text-transform: uppercase;
}

.installed-branch {
  border: 1px solid rgba(245, 196, 81, 0.28);
  background:
    radial-gradient(circle at 15% 20%, rgba(245, 196, 81, 0.12), transparent 45%),
    rgba(6, 13, 23, 0.74);
  padding: 9px;
}

.installed-branch strong {
  display: block;
  color: #fff1c6;
  font-family: var(--font-title);
  font-size: 15px;
  margin-top: 4px;
}

.installed-branch p {
  margin: 6px 0 8px;
}

.command-deck {
  left: 12px;
  right: 12px;
  bottom: 12px;
  min-height: 116px;
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(360px, 1.55fr) minmax(240px, 0.7fr) minmax(190px, 0.45fr) minmax(230px, 0.7fr);
  gap: 12px;
  align-items: stretch;
}

.deck-section {
  min-width: 0;
}

.section-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
  min-height: 22px;
}

.section-label strong {
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 12px;
  white-space: nowrap;
}

.tower-bar,
.support-bar,
.loadout-picker {
  display: grid;
  gap: 8px;
}

.tower-bar {
  grid-template-columns: repeat(4, minmax(118px, 1fr));
  margin-top: 8px;
}

.tower-card,
.support-card {
  position: relative;
  min-height: 64px;
  padding: 9px 10px;
  text-align: left;
  overflow: hidden;
}

.tower-card::before,
.support-card::before,
.mission-node::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, rgba(255, 255, 255, 0.08), transparent 42%);
  opacity: 0;
  transition: opacity 0.18s ease;
  pointer-events: none;
}

.tower-card:hover::before,
.support-card:hover::before,
.mission-node:hover::before,
.tower-card.active::before,
.support-card.targeting::before {
  opacity: 1;
}

.tower-card .tower-name,
.support-card .support-name {
  color: var(--text);
  display: block;
  font-family: var(--font-title);
  font-size: 14px;
  line-height: 1.1;
}

.tower-card .tower-meta,
.support-card .support-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}

.tower-swatch {
  width: 8px;
  height: 100%;
  min-height: 48px;
  border-radius: 999px;
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
}

.deck-controls {
  display: grid;
  gap: 8px;
}

.primary-action {
  border-color: rgba(87, 240, 168, 0.58);
  background:
    linear-gradient(180deg, rgba(87, 240, 168, 0.24), rgba(12, 30, 25, 0.94)),
    rgba(10, 24, 22, 0.92);
  color: #e9fff5;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.support-bar {
  grid-template-columns: repeat(3, minmax(72px, 1fr));
  margin-top: 8px;
}

.commander-bar {
  grid-template-columns: repeat(3, minmax(64px, 1fr));
  margin-top: 8px;
}

.support-card {
  min-height: 58px;
  padding: 8px;
}

.commander-card {
  border-color: rgba(245, 196, 81, 0.26);
}

.toast-feed {
  position: fixed;
  z-index: 6;
  left: 24px;
  bottom: 150px;
  width: min(380px, calc(100vw - 48px));
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.toast {
  border-left: 2px solid var(--cyan);
  background: rgba(6, 10, 18, 0.86);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.32);
  padding: 9px 12px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  animation: toast-in 0.18s ease-out;
}

.toast-danger {
  border-color: var(--red);
}

.toast-success {
  border-color: var(--green);
}

.toast-warn {
  border-color: var(--gold);
}

.boss-banner {
  position: fixed;
  z-index: 7;
  left: 50%;
  top: 22%;
  width: min(520px, calc(100vw - 32px));
  transform: translate(-50%, -18px);
  border: 1px solid rgba(255, 95, 126, 0.42);
  background:
    linear-gradient(90deg, rgba(255, 95, 126, 0.18), rgba(5, 9, 16, 0.96)),
    rgba(6, 9, 16, 0.95);
  box-shadow: 0 28px 80px rgba(255, 95, 126, 0.18), 0 24px 80px rgba(0, 0, 0, 0.5);
  padding: 18px 20px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

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

.boss-banner strong {
  display: block;
  color: #fff1f5;
  font-family: var(--font-title);
  font-size: 28px;
  line-height: 1;
  margin-top: 5px;
}

.boss-banner p {
  color: var(--muted);
  margin: 8px 0 0;
}

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

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 12;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(2, 4, 9, 0.72);
  backdrop-filter: blur(10px);
}

.modal-backdrop.active {
  display: flex;
}

.modal {
  width: min(720px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  border: 1px solid rgba(93, 203, 255, 0.25);
  background:
    linear-gradient(145deg, rgba(18, 25, 39, 0.98), rgba(6, 9, 16, 0.96)),
    var(--panel-strong);
  box-shadow: 0 36px 120px rgba(0, 0, 0, 0.58), inset 0 0 0 1px rgba(255, 255, 255, 0.035);
  padding: 22px;
}

.modal-wide {
  width: min(1480px, calc(100vw - 32px));
  height: min(900px, calc(100vh - 32px));
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 18px;
}

.modal-wide .modal-title {
  flex: 0 0 auto;
}

.modal-title h1 {
  margin: 0;
  font-size: clamp(34px, 4vw, 56px);
  line-height: 1;
}

.campaign-layout {
  display: grid;
  grid-template-columns: minmax(520px, 1fr) minmax(620px, 720px);
  align-items: stretch;
  flex: 1 1 auto;
  min-height: 0;
  gap: 12px;
  margin-top: 14px;
}

.campaign-map,
.campaign-side,
.run-card {
  min-width: 0;
}

.campaign-map {
  min-height: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(93, 203, 255, 0.16);
  background:
    radial-gradient(circle at 30% 20%, rgba(78, 220, 255, 0.13), transparent 32%),
    radial-gradient(circle at 70% 70%, rgba(169, 129, 255, 0.12), transparent 34%),
    rgba(5, 9, 16, 0.58);
  padding: 12px;
}

.mission-map {
  position: relative;
  flex: 1 1 auto;
  min-height: 340px;
  margin-top: 12px;
  border: 1px solid rgba(78, 220, 255, 0.12);
  overflow: hidden;
  background:
    linear-gradient(rgba(78, 220, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(78, 220, 255, 0.04) 1px, transparent 1px),
    rgba(3, 7, 13, 0.56);
  background-size: 44px 44px;
}

.mission-map::before {
  content: "";
  position: absolute;
  inset: 12%;
  border: 1px solid rgba(245, 196, 81, 0.16);
  transform: rotate(-18deg);
}

.mission-node {
  position: absolute;
  width: 168px;
  min-height: 74px;
  padding: 10px;
  text-align: left;
  transform: translate(-50%, -50%);
}

.mission-node.locked {
  opacity: 0.42;
}

.mission-node.complete {
  border-color: rgba(87, 240, 168, 0.48);
}

.mission-node.active {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px rgba(245, 196, 81, 0.3), 0 0 24px rgba(245, 196, 81, 0.12);
}

.mission-node strong {
  display: block;
  font-family: var(--font-title);
  font-size: 14px;
  line-height: 1.12;
}

.mission-node span {
  color: var(--muted);
  display: block;
  font-size: 11px;
  margin-top: 5px;
  text-transform: none;
}

.campaign-side {
  display: grid;
  gap: 9px;
  align-content: start;
  min-height: 0;
  overflow: hidden;
  scrollbar-color: rgba(78, 220, 255, 0.5) rgba(7, 12, 20, 0.72);
}

.campaign-intel-column,
.campaign-ops-column {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.campaign-intel-column {
  overflow: auto;
  scrollbar-color: rgba(78, 220, 255, 0.5) rgba(7, 12, 20, 0.72);
}

.campaign-ops-column {
  overflow: auto;
  padding-right: 4px;
  scrollbar-color: rgba(78, 220, 255, 0.5) rgba(7, 12, 20, 0.72);
}

.campaign-ops-column > * {
  flex: 0 0 auto;
}

.run-card {
  padding: 10px;
}

.campaign-detail {
  padding: 0;
  overflow: hidden;
  min-height: 0;
  scrollbar-color: rgba(78, 220, 255, 0.5) rgba(7, 12, 20, 0.72);
}

.campaign-detail summary {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  min-height: 44px;
  padding: 10px;
  cursor: pointer;
  list-style: none;
  outline: none;
  background: linear-gradient(180deg, rgba(11, 22, 36, 0.88), rgba(7, 10, 18, 0.72));
}

.campaign-detail summary::-webkit-details-marker {
  display: none;
}

.campaign-detail summary:focus-visible {
  box-shadow: inset 0 0 0 1px rgba(78, 220, 255, 0.58);
}

.campaign-detail summary::after {
  content: "+";
  border: 1px solid rgba(93, 203, 255, 0.2);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1;
  padding: 3px 7px;
}

.campaign-detail[open] summary {
  position: sticky;
  z-index: 1;
  top: 0;
  border-bottom: 1px solid rgba(93, 203, 255, 0.12);
}

.campaign-detail[open] summary::after {
  content: "-";
}

.campaign-detail[open] {
  max-height: min(360px, 48vh);
  overflow: auto;
}

.campaign-detail summary strong {
  color: var(--text);
  font-family: var(--font-title);
  font-size: 14px;
  text-align: right;
}

.campaign-detail > :not(summary) {
  margin-left: 10px;
  margin-right: 10px;
}

.campaign-detail > :last-child {
  margin-bottom: 10px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.chip {
  border: 1px solid rgba(93, 203, 255, 0.2);
  background: rgba(6, 13, 23, 0.68);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 5px 8px;
}

.chip-accent,
.grade-secure,
.grade-perfect {
  border-color: rgba(245, 196, 81, 0.34);
}

.grade-hold {
  border-color: rgba(255, 141, 90, 0.35);
}

.grade-secure {
  color: #fff1c6;
}

.grade-perfect {
  color: #dfffee;
  border-color: rgba(87, 240, 168, 0.5);
}

.wave-intel,
.mission-intel,
.priority-control {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.wave-intel-row,
.mission-intel-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.25;
}

.wave-intel-row strong,
.mission-intel-row strong {
  color: var(--text);
  text-align: right;
  max-width: 68%;
  overflow-wrap: anywhere;
}

.enemy-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.counter-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.hazard-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.enemy-chip,
.counter-chip,
.hazard-chip {
  border: 1px solid rgba(93, 203, 255, 0.2);
  background: rgba(6, 13, 23, 0.7);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 4px 6px;
}

.enemy-chip::before,
.counter-chip::before,
.hazard-chip::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 5px;
  border-radius: 50%;
  background: var(--enemy-color, var(--cyan));
  box-shadow: 0 0 10px var(--enemy-color, var(--cyan));
}

.counter-chip::before {
  background: var(--tower-color, var(--green));
  box-shadow: 0 0 10px var(--tower-color, var(--green));
}

.hazard-chip::before {
  background: var(--hazard-color, var(--gold));
  box-shadow: 0 0 10px var(--hazard-color, var(--gold));
}

.hazard-status-list {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.hazard-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid color-mix(in srgb, var(--hazard-color, var(--gold)) 42%, transparent);
  background: color-mix(in srgb, var(--hazard-color, var(--gold)) 10%, rgba(6, 13, 23, 0.78));
  padding: 6px 7px;
  font-family: var(--font-mono);
  font-size: 10px;
}

.hazard-status span {
  color: var(--text);
}

.hazard-status strong {
  color: var(--hazard-color, var(--gold));
  text-align: right;
  white-space: nowrap;
}

.colony-status,
.commander-panel,
.commander-ability-list,
.commander-perk-list {
  display: grid;
  gap: 7px;
  margin-top: 8px;
}

.colony-status {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.commander-ability-list,
.commander-perk-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.commander-xp {
  display: grid;
  gap: 6px;
}

.commander-xp > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.colony-resource {
  display: grid;
  gap: 6px;
}

.colony-resource > div:first-child,
.commander-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.colony-resource span,
.commander-header span,
.commander-ability-list span,
.commander-perk-list span,
.commander-xp span {
  color: var(--muted);
  font-size: 11px;
}

.colony-resource strong,
.commander-header strong,
.commander-level,
.commander-xp strong {
  color: var(--text);
  font-family: var(--font-title);
}

.commander-perk-list span {
  border: 1px solid rgba(93, 203, 255, 0.12);
  background: rgba(6, 13, 23, 0.5);
  padding: 5px 6px;
}

.commander-perk-list span.unlocked {
  border-color: rgba(87, 240, 168, 0.28);
  color: #dfffee;
}

.resource-track {
  height: 6px;
  border: 1px solid rgba(93, 203, 255, 0.16);
  background: rgba(6, 13, 23, 0.74);
  overflow: hidden;
}

.resource-track span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--green));
  box-shadow: 0 0 16px rgba(78, 220, 255, 0.28);
}

.commander-header {
  border-bottom: 1px solid rgba(93, 203, 255, 0.12);
  padding-bottom: 8px;
}

.commander-header strong,
.commander-header span {
  display: block;
}

.commander-level {
  border: 1px solid rgba(245, 196, 81, 0.28);
  padding: 4px 7px;
}

.priority-control {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.priority-control button {
  min-height: 32px;
  padding: 6px 5px;
  font-size: 10px;
}

.corporate-upgrades {
  display: grid;
  gap: 7px;
  margin-top: 8px;
}

.corporate-upgrade {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(93, 203, 255, 0.18);
  background: linear-gradient(180deg, rgba(11, 22, 36, 0.82), rgba(7, 10, 18, 0.66));
  padding: 8px;
}

.corporate-upgrade strong,
.corporate-upgrade span {
  display: block;
}

.corporate-upgrade strong {
  color: var(--text);
  font-family: var(--font-title);
  font-size: 14px;
}

.corporate-upgrade span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  margin-top: 3px;
}

.corporate-upgrade.maxed {
  border-color: rgba(87, 240, 168, 0.32);
}

.upgrade-buy-zone {
  min-width: 86px;
  display: grid;
  gap: 5px;
  text-align: right;
}

.upgrade-buy-zone span {
  color: var(--gold);
  font-family: var(--font-mono);
}

.upgrade-buy-zone button {
  min-height: 30px;
  padding: 6px 8px;
  font-size: 10px;
}

.loadout-picker {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 8px;
}

.loadout-advisor {
  grid-column: 1 / -1;
  border: 1px solid rgba(93, 203, 255, 0.18);
  background: rgba(6, 13, 23, 0.66);
  padding: 9px;
}

.advisor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.advisor-header strong {
  color: var(--text);
  font-family: var(--font-title);
  font-size: 14px;
  text-align: right;
}

.advisor-meter {
  height: 7px;
  border: 1px solid rgba(93, 203, 255, 0.18);
  background: rgba(4, 8, 15, 0.78);
  margin-top: 7px;
}

.advisor-meter span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--red), var(--gold));
}

.loadout-fit-prepared .advisor-meter span {
  background: linear-gradient(90deg, var(--cyan), var(--green));
}

.loadout-fit-thin .advisor-meter span {
  background: linear-gradient(90deg, var(--gold), var(--green));
}

.advisor-copy {
  color: var(--muted);
  font-size: 12px;
  margin-top: 7px;
}

.advisor-apply {
  min-height: 32px;
  margin-top: 8px;
  width: 100%;
}

.loadout-choice {
  min-height: 48px;
  text-align: left;
}

.loadout-choice.selected {
  border-color: var(--green);
  color: var(--green);
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 16px;
}

.campaign-ops-column > .modal-actions {
  position: sticky;
  z-index: 2;
  bottom: 0;
  margin-top: 6px;
  padding: 12px 0 0;
  background: linear-gradient(180deg, rgba(7, 12, 20, 0), rgba(7, 12, 20, 0.96) 38%);
}

.modal-actions button {
  flex: 1 1 150px;
}

.settings-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  margin-top: 14px;
  color: var(--muted);
}

.settings-row input[type="range"] {
  width: 220px;
  accent-color: var(--cyan);
}

.briefing-details {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.briefing-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid rgba(93, 203, 255, 0.11);
  padding: 7px 0;
  color: var(--muted);
}

.briefing-row strong {
  color: var(--text);
  max-width: 62%;
  text-align: right;
  overflow-wrap: anywhere;
}

@media (min-width: 1121px) {
  .campaign-side {
    grid-template-columns: minmax(290px, 1fr) minmax(300px, 1fr);
    overflow: hidden;
    padding-right: 0;
  }

  .campaign-intel-column > .run-card {
    flex: 1 1 auto;
    height: 100%;
    min-height: 0;
    overflow: auto;
    scrollbar-color: rgba(78, 220, 255, 0.5) rgba(7, 12, 20, 0.72);
  }

  .campaign-ops-column > .modal-actions {
    position: static;
    margin-top: 0;
    padding: 0;
    background: none;
  }
}

@media (max-width: 1120px) {
  .hud-panel {
    grid-template-columns: 1fr auto;
  }

  .hud-actions {
    grid-column: 2;
    grid-row: 1;
  }

  .hud-meters {
    grid-column: 1 / -1;
    grid-row: 2;
    min-width: 0;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .command-deck {
    grid-template-columns: 1fr 1fr;
  }

  .deck-section-wide {
    grid-column: 1 / -1;
  }

  .right-hud-stack {
    display: none;
  }

  .campaign-layout {
    grid-template-columns: 1fr;
    align-items: start;
    overflow: auto;
    padding-right: 4px;
  }

  .campaign-map {
    min-height: auto;
  }

  .mission-map {
    flex: none;
    min-height: 360px;
  }

  .campaign-side {
    overflow: visible;
    padding-right: 0;
  }

  .campaign-intel-column,
  .campaign-ops-column {
    overflow: visible;
    padding-right: 0;
  }
}

@media (min-width: 721px) and (max-width: 1120px) {
  .command-deck {
    max-height: 250px;
    overflow: auto;
  }

  .tower-bar {
    grid-template-columns: repeat(4, minmax(120px, 1fr));
  }
}

@media (max-width: 720px) {
  .glass-panel {
    backdrop-filter: blur(10px);
  }

  .hud-panel {
    top: 8px;
    left: 8px;
    right: 8px;
    padding: 10px;
    gap: 8px;
    min-height: 102px;
  }

  .hud-title strong {
    font-size: 19px;
  }

  .hud-title span:last-child {
    font-size: 12px;
  }

  .hud-actions {
    align-self: start;
  }

  .hud-meters {
    grid-template-columns: repeat(4, minmax(64px, 1fr));
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .meter-chip {
    min-width: 70px;
    padding: 7px 8px;
  }

  .meter-chip strong {
    font-size: 15px;
  }

  .command-deck {
    left: 8px;
    right: 8px;
    bottom: 8px;
    grid-template-columns: 1fr;
    max-height: 44vh;
    min-height: 0;
    overflow: auto;
    padding: 10px;
  }

  .tower-bar {
    grid-template-columns: repeat(2, minmax(128px, 1fr));
  }

  .priority-control {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .support-bar {
    grid-template-columns: repeat(3, minmax(92px, 1fr));
    overflow-x: auto;
  }

  .commander-bar {
    grid-template-columns: repeat(3, minmax(108px, 1fr));
  }

  .deck-section {
    min-width: 0;
  }

  .tower-inspector {
    left: 8px;
    right: 8px;
    top: 116px;
    bottom: calc(44vh + 18px);
    width: auto;
    max-height: calc(100vh - 116px - 46vh);
    overflow: auto;
  }

  .toast-feed {
    left: 12px;
    bottom: calc(44vh + 18px);
    width: calc(100vw - 24px);
  }

  .modal-backdrop {
    padding: 10px;
  }

  .modal {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
    padding: 16px;
  }

  .modal-wide {
    height: calc(100vh - 20px);
    max-height: calc(100vh - 20px);
    padding: 14px;
  }

  .modal-title h1 {
    font-size: 34px;
  }

  .mission-map {
    min-height: 320px;
  }

  .mission-node {
    width: 132px;
    min-height: 70px;
    padding: 8px;
  }

  .loadout-picker {
    grid-template-columns: 1fr;
  }

  .colony-status,
  .commander-ability-list,
  .commander-perk-list {
    grid-template-columns: 1fr;
  }

  .corporate-upgrade {
    grid-template-columns: 1fr;
  }

  .upgrade-buy-zone {
    grid-template-columns: 1fr auto;
    align-items: center;
    text-align: left;
  }

  .settings-row {
    grid-template-columns: 1fr;
  }

  .settings-row input[type="range"] {
    width: 100%;
  }
}

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