.defence-station {
  --station-scene-image: url('assets/defence-station-scenes.jpg');
  min-inline-size: 0;
  overflow: hidden;
  scroll-margin-block-start: 126px;
}
.defence-station[data-species='reptilian'] { --station-scene-image: url('assets/defence-station-scenes-reptilian.jpg'); }
.defence-station[data-species='insectoid'] { --station-scene-image: url('assets/defence-station-scenes-insectoid.jpg'); }
.defence-station[data-species='grey'] { --station-scene-image: url('assets/defence-station-scenes-grey.jpg'); }
.defence-station[data-species='biomechanical'] { --station-scene-image: url('assets/defence-station-scenes-biomechanical.jpg'); }
.defence-station-hero {
  display: grid;
  align-items: end;
  position: relative;
  isolation: isolate;
  min-block-size: clamp(166px, 24vw, 310px);
  padding: clamp(11px, 2vw, 22px);
  background: #142231;
}
.defence-station-art {
  position: absolute;
  inset: 0;
  z-index: -1;
  container-type: size;
  overflow: hidden;
  pointer-events: none;
}
.defence-station-art::before {
  position: absolute;
  top: 50%;
  left: 50%;
  width: max(calc(100cqw + 16px), calc(200cqh + 24px));
  aspect-ratio: 2;
  transform: translate(-50%, -50%);
  background: var(--station-scene-image) center var(--station-scene-row, 0%) / 100% 200% no-repeat;
  content: '';
}
.defence-station[data-defence-station='ground'] { --station-scene-row: 100%; }
.defence-station-art::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, #091320e0, #09132028 78%);
  content: '';
}

.defence-station-summary, .defence-station-unit-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 13px;
  min-inline-size: 0;
}
.defence-station-summary { align-items: end; }
.defence-station-unit-identity { display: flex; align-items: center; gap: 8px; min-inline-size: 0; }
.defence-fighter-portrait { inline-size: 48px; flex: none; aspect-ratio: 1; border-radius: 5px; }
.defence-station-summary h2, .defence-station-unit h3 {
  margin: 0;
  overflow-wrap: anywhere;
  font: 650 1.05rem / 1.2 var(--heading);
}
.defence-station-summary h2 { font-size: clamp(1.48rem, 3vw, 2.3rem); }
.defence-station-summary .eyebrow { margin-block-end: 3px; }
.defence-station-summary p:not(.eyebrow), .defence-station-unit-heading p {
  margin: 4px 0 0;
  color: #c0cede;
  font-size: .83rem;
  font-variant-numeric: tabular-nums;
}
.defence-station-summary .button-secondary { background: #15263be8; }
.defence-station-content { padding: clamp(10px, 1.6vw, 18px); border-block-start: 1px solid #425873; }
.defence-station-intro { margin-block-end: 9px; color: var(--muted); font-size: .86rem; }
.defence-station-units { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 295px), 1fr)); gap: 9px; }
.defence-station-unit {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 9px;
  min-inline-size: 0;
  padding: 12px;
  border: 1px solid #354861;
  border-radius: 8px;
  background: #151f30;
}
.defence-station-counts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  align-items: start;
  margin: 0;
}
.defence-station-counts > div { padding: 6px 8px; border: 1px solid #344560; border-radius: 5px; background: #0f1a28; }
.defence-station-counts dt { color: #b4c4d8; font-size: .79rem; }
.defence-station-counts dd { margin: 3px 0 0; color: #f3d5a8; font-size: .98rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.defence-station-order {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  justify-content: space-between;
  margin: 0;
  color: var(--cyan);
  font-size: .81rem;
  font-variant-numeric: tabular-nums;
}
.defence-station-actions { display: flex; flex-wrap: wrap; align-items: end; gap: 6px; }
.defence-station-actions label { display: grid; gap: 3px; min-inline-size: 0; color: #bdcddd; font-size: .78rem; }
.defence-station-actions input {
  width: 70px;
  min-block-size: 44px;
  padding: 4px 8px;
  border: 1px solid #485d77;
  border-radius: 5px;
  background: #0f1927;
  color: inherit;
  font: inherit;
  font-variant-numeric: tabular-nums;
}
.defence-station-actions input:focus-visible { outline: 2px solid var(--cyan); outline-offset: 1px; }
.defence-station-actions input:disabled { opacity: .53; }
.defence-station button { min-block-size: 44px; }
.defence-station-unit-heading button, .defence-station-actions button { padding-inline: 8px; font-size: .8rem; }

@media (orientation: landscape) and (max-height: 600px) {
  .defence-station { scroll-margin-block-start: 4px; }
  .defence-station-hero { min-block-size: clamp(144px, 46dvh, 212px); }
}
