:root {
  color-scheme: dark;
  --bg: #071117;
  --panel: rgba(11, 25, 33, 0.9);
  --panel-edge: #2e6671;
  --text: #e8fbff;
  --muted: #8fb4bd;
  --accent: #41d9c7;
  --accent-2: #9af5db;
  --signal: #6ee7ff;
  --success: #5ae4a3;
  --packet: #f8d05c;
  --warning: #ff9b54;
  --danger: #ff6262;
  --tile: #10242a;
  --tile-path: #17424b;
  --tile-pad: #11333a;
  --tile-core: #147e69;
  --tile-barricade: #8c6f33;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(65, 217, 199, 0.18), transparent 28%),
    radial-gradient(circle at 84% 18%, rgba(255, 155, 84, 0.08), transparent 18%),
    linear-gradient(180deg, #0d2028 0%, var(--bg) 45%, #03080c 100%);
}

.mobile-nav {
  display: none;
}

button {
  font: inherit;
  color: inherit;
}

.shell {
  height: 100vh;
  padding: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}

.topbar,
.panel {
  border: 1px solid var(--panel-edge);
  background: var(--panel);
  border-radius: 10px;
  box-shadow: 0 18px 36px rgba(1, 6, 12, 0.34);
}

.topbar {
  display: block;
  padding: 8px 12px;
  margin-bottom: 8px;
  flex: 0 0 auto;
}

.topbar__title h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.1rem;
  line-height: 1.05;
}

.topbar__subtitle {
  margin-top: 4px;
  margin-bottom: 0;
  font-size: 0.98rem;
}

.topbar h1,
.panel h2,
.panel h3 {
  margin: 0;
}

.topbar__subtitle,
.muted,
.operator-card small,
.selection-card p {
  color: var(--muted);
}

.topbar__stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(96px, 1fr));
  gap: 8px;
}

.board-panel__stats {
  justify-self: end;
  width: min(100%, 560px);
}

.stat-card {
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(16, 39, 55, 0.8);
  border: 1px solid rgba(111, 203, 255, 0.2);
}

.stat-card--core.is-warning {
  border-color: rgba(255, 155, 84, 0.48);
  box-shadow: inset 0 0 0 1px rgba(255, 155, 84, 0.08), 0 0 18px rgba(255, 155, 84, 0.12);
}

.stat-card--core.is-critical {
  border-color: rgba(255, 98, 98, 0.62);
  background:
    linear-gradient(180deg, rgba(82, 28, 35, 0.74), rgba(20, 31, 43, 0.82)),
    rgba(16, 39, 55, 0.8);
  box-shadow: inset 0 0 0 1px rgba(255, 98, 98, 0.12), 0 0 22px rgba(255, 98, 98, 0.18);
}

.stat-card strong,
.list-button strong,
.operator-card strong {
  display: block;
}

.stat-card__label {
  color: var(--muted);
  font-size: 0.76rem;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) 286px;
  gap: 12px;
  align-items: stretch;
  flex: 1 1 auto;
  min-height: 0;
}

.sidebar {
  display: grid;
  gap: 12px;
  align-content: start;
  min-height: 0;
}

.sidebar--right {
  grid-auto-rows: min-content;
  overflow: auto;
  padding-right: 2px;
}

.sidebar--right::-webkit-scrollbar {
  width: 8px;
}

.sidebar--right::-webkit-scrollbar-thumb {
  background: rgba(111, 203, 255, 0.22);
  border-radius: 999px;
}

.panel {
  padding: 12px;
}

.panel--compact {
  padding: 10px;
}

.panel--actions {
  display: grid;
  gap: 10px;
  position: sticky;
  bottom: 0;
  background: linear-gradient(180deg, rgba(18, 38, 54, 0.96), rgba(12, 28, 42, 0.96));
}

.panel--actions > button {
  width: 100%;
  min-height: 38px;
  border: 1px solid rgba(111, 203, 255, 0.24);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(17, 35, 49, 0.96), rgba(11, 25, 37, 0.96)),
    rgba(18, 38, 54, 0.78);
  color: var(--text);
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(197, 233, 255, 0.06);
}

.panel--actions > button:not(:disabled):hover {
  border-color: rgba(111, 203, 255, 0.38);
  background:
    linear-gradient(180deg, rgba(28, 52, 72, 0.96), rgba(15, 33, 47, 0.96)),
    rgba(32, 60, 83, 0.9);
}

.sound-button.is-muted {
  color: var(--warning);
  border-color: rgba(255, 155, 84, 0.34);
}

.board-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.board-wrapper {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  container-type: size;
}

.board-panel__header,
.board-panel__footer,
.build-list,
.operator-list,
.wave-intel,
.selection-panel,
.tower-upgrades {
  display: grid;
  gap: 8px;
}

.board-panel__footer {
  margin-top: 8px;
}

.board-panel__header {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 560px);
  margin-bottom: 6px;
  align-items: start;
  gap: 12px;
}

.board {
  position: relative;
  padding: 8px;
  background: linear-gradient(180deg, rgba(35, 57, 73, 0.35), rgba(8, 18, 28, 0.6));
  border-radius: 10px;
  border: 1px solid rgba(111, 203, 255, 0.18);
  overflow: hidden;
  
  /* Container Query aspect ratio lock */
  aspect-ratio: 16 / 12;
  width: 100%;
  max-width: calc(100cqh * 16 / 12);
  max-height: 100cqh;
}

.board::before,
.board::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 8px;
  pointer-events: none;
}

.board::before {
  z-index: 1;
  background:
    linear-gradient(90deg, transparent 0 12%, rgba(110, 231, 255, 0.08) 12% 12.4%, transparent 12.4% 36%, rgba(90, 228, 163, 0.06) 36% 36.4%, transparent 36.4% 100%),
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 10px);
  opacity: 0.34;
  mix-blend-mode: screen;
}

.board::after {
  z-index: 6;
  background: linear-gradient(90deg, transparent, rgba(110, 231, 255, 0.2), rgba(248, 208, 92, 0.1), transparent);
  opacity: 0;
  transform: translateX(-120%);
}

.board--alert {
  box-shadow: inset 0 0 28px rgba(255, 98, 98, 0.32);
}

.board--running::after {
  opacity: 0.5;
  animation: boardScan 2.8s linear infinite;
}

.board--checkpoint {
  box-shadow: inset 0 0 26px rgba(248, 208, 92, 0.18), 0 0 18px rgba(248, 208, 92, 0.1);
}

.board--critical {
  border-color: rgba(255, 98, 98, 0.38);
}

.board--alert {
  animation: coreDamageShake 0.22s steps(2, end) infinite;
}

.board--victory {
  border-color: rgba(90, 228, 163, 0.54);
  box-shadow: inset 0 0 30px rgba(90, 228, 163, 0.2), 0 0 26px rgba(90, 228, 163, 0.1);
}

.board--game-over {
  border-color: rgba(255, 98, 98, 0.54);
  filter: saturate(0.75);
}

.tile {
  border: 0;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  position: absolute;
  padding: 0;
  box-shadow: none;
  z-index: 2;
  pointer-events: auto;
}

.tile--passive {
  pointer-events: none;
}

.board-hotspots,
.board-actors,
.round-overlay {
  position: absolute;
  inset: 8px;
}

.board-hotspots {
  display: block;
  z-index: 2;
  pointer-events: none;
}

.board-actors {
  z-index: 4;
  pointer-events: none;
}

.round-overlay {
  z-index: 8;
  display: grid;
  place-items: center;
  padding: 18px;
  background: linear-gradient(180deg, rgba(4, 12, 19, 0.34), rgba(4, 12, 19, 0.58));
  backdrop-filter: blur(8px);
  pointer-events: auto;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.round-overlay[hidden] {
  display: none;
}

.round-overlay__card {
  width: min(520px, 100%);
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(154, 245, 219, 0.24);
  background: linear-gradient(180deg, rgba(9, 24, 34, 0.9), rgba(9, 20, 29, 0.82));
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.28);
  max-height: 100%;
  overflow-y: auto;
}

.round-overlay__eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-2);
}

.round-overlay__card p,
.round-overlay__card h3 {
  margin: 0;
}

.tile--field {
  background: transparent;
}

.tile--perimeter {
  background: transparent;
}

.tile--base {
  background: transparent;
}

.tile--path {
  background: transparent;
}

.tile--path.tile--field {
  background: transparent;
}

.tile--path.tile--base,
.tile--path.tile--perimeter {
  background: transparent;
}

.tile--pad {
  background: transparent;
}

.tile--pad.tile--field {
  background: transparent;
}

.tile--barricade {
  background: transparent;
}

.tile--core {
  background: transparent;
}

.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}

.tile--pad::after {
  inset: 12%;
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 52%, transparent 0 28%, rgba(245, 203, 87, 0.95) 28% 35%, transparent 35% 100%),
    radial-gradient(circle at 26% 22%, rgba(255, 255, 255, 0.12), transparent 22%),
    radial-gradient(circle at 74% 70%, rgba(0, 0, 0, 0.08), transparent 24%),
    linear-gradient(180deg, #b6b9b7 0%, #959a98 48%, #7b817f 100%);
  border: 1px solid rgba(205, 209, 208, 0.44);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -6px 12px rgba(76, 82, 82, 0.16),
    0 4px 10px rgba(0, 0, 0, 0.16);
  opacity: 0.96;
}

.tile--pad:hover::after,
.tile--pad:focus-visible::after {
  opacity: 1;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.18), 0 0 18px rgba(248, 208, 92, 0.32), 0 4px 10px rgba(0, 0, 0, 0.18);
}

.tile--drag-ready::after {
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.18), 0 0 10px rgba(248, 208, 92, 0.16), 0 4px 10px rgba(0, 0, 0, 0.18);
}

.tile--pad,
.tile--core {
  pointer-events: auto;
}

.tile--core {
  z-index: 4;
}

.tile--drop-target::after {
  opacity: 1;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.18), 0 0 22px rgba(248, 208, 92, 0.55), 0 4px 12px rgba(0, 0, 0, 0.2);
  transform: scale(1.03);
}

.tile--selected::after {
  opacity: 1;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.18),
    0 0 0 2px rgba(110, 231, 255, 0.22),
    0 0 18px rgba(110, 231, 255, 0.26);
}

.tile--core::after,
.tile--core::before {
  display: none;
}

.tile--barricade::after {
  inset: 10% 14%;
  border-radius: 6px;
  background:
    repeating-linear-gradient(135deg, rgba(255, 205, 112, 0.8) 0 10px, rgba(105, 80, 43, 0.9) 10px 20px),
    linear-gradient(180deg, #8b6a36, #5f4a2c);
  border: 1px solid rgba(255, 226, 159, 0.4);
}

.map-scene {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(70, 138, 154, 0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(70, 138, 154, 0.14) 1px, transparent 1px),
    linear-gradient(180deg, rgba(176, 232, 255, 0.06), transparent 18%),
    radial-gradient(circle at 18% 14%, rgba(101, 239, 222, 0.12), transparent 18%),
    radial-gradient(circle at 82% 16%, rgba(80, 166, 255, 0.11), transparent 16%),
    linear-gradient(180deg, #1c3038 0%, #13252d 42%, #0d161d 100%);
  background-size: 7.5% 7.5%, 7.5% 7.5%, auto, auto, auto;
}

.map-scene__snow,
.map-scene__aurora,
.map-scene__wind,
.map-scene__snowbank,
.map-scene__ice,
.map-scene__rock,
.map-scene__beacon,
.map-scene__steam,
.map-scene__route,
.map-scene__base,
.map-scene__gate,
.map-scene__core {
  position: absolute;
}

.map-scene__aurora {
  inset: -2% 6% auto;
  height: 24%;
  background:
    linear-gradient(90deg, transparent 0 8%, rgba(89, 243, 216, 0.12) 8% 10%, transparent 10% 24%, rgba(103, 198, 255, 0.1) 24% 26%, transparent 26% 48%, rgba(89, 243, 216, 0.12) 48% 50%, transparent 50% 74%, rgba(103, 198, 255, 0.1) 74% 76%, transparent 76% 100%),
    linear-gradient(180deg, rgba(178, 229, 255, 0.16), rgba(178, 229, 255, 0));
  opacity: 0.68;
  transform: perspective(300px) rotateX(58deg);
  animation: auroraShift 18s ease-in-out infinite;
  z-index: 0;
}

.map-scene__wind {
  border-radius: 999px;
  background: linear-gradient(90deg, transparent 0%, rgba(104, 228, 255, 0.1) 30%, rgba(154, 245, 219, 0.28) 50%, rgba(104, 228, 255, 0.06) 70%, transparent 100%);
  opacity: 0.55;
  z-index: 0;
  animation: windSweep 9s linear infinite;
}

.map-scene__wind--one {
  left: -14%;
  top: 31%;
  width: 34%;
  height: 3.5%;
}

.map-scene__wind--two {
  left: 52%;
  top: 70%;
  width: 25%;
  height: 3.2%;
  animation-duration: 11s;
  animation-delay: -4s;
}

.map-scene__snow {
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(20, 33, 42, 0.92), rgba(12, 20, 28, 0.82)),
    linear-gradient(90deg, transparent 0 12%, rgba(105, 190, 255, 0.16) 12% 14%, transparent 14% 32%, rgba(105, 190, 255, 0.16) 32% 34%, transparent 34% 52%, rgba(105, 190, 255, 0.16) 52% 54%, transparent 54% 72%, rgba(105, 190, 255, 0.16) 72% 74%, transparent 74% 100%);
  border: 1px solid rgba(111, 203, 255, 0.12);
  z-index: 0;
}

.map-scene__snow--one {
  left: 4%;
  top: 12%;
  width: 34%;
  height: 24%;
  transform: rotate(-10deg);
}

.map-scene__snow--two {
  left: 12%;
  bottom: 8%;
  width: 28%;
  height: 18%;
  transform: rotate(8deg);
}

.map-scene__snowbank {
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(47, 73, 86, 0.92), rgba(20, 31, 39, 0.84)),
    linear-gradient(90deg, transparent 0 10%, rgba(109, 199, 255, 0.14) 10% 12%, transparent 12% 48%, rgba(109, 199, 255, 0.14) 48% 50%, transparent 50% 88%, rgba(109, 199, 255, 0.14) 88% 90%, transparent 90% 100%);
  box-shadow: inset 0 1px 0 rgba(191, 233, 255, 0.16), 0 10px 18px rgba(8, 17, 24, 0.2);
  z-index: 0;
}

.map-scene__snowbank--one {
  left: 5%;
  top: 9%;
  width: 22%;
  height: 11%;
  transform: rotate(-6deg);
}

.map-scene__snowbank--two {
  right: 7%;
  top: 72%;
  width: 18%;
  height: 10%;
  transform: rotate(8deg);
}

.map-scene__snowbank--three {
  left: 58%;
  top: 66%;
  width: 15%;
  height: 8%;
  transform: rotate(-10deg);
}

.map-scene__ice {
  border-radius: 32px;
  background:
    linear-gradient(145deg, rgba(60, 120, 155, 0.2), rgba(24, 45, 60, 0.1)),
    linear-gradient(180deg, rgba(130, 220, 255, 0.16), rgba(31, 67, 79, 0.05));
  border: 1px solid rgba(136, 232, 214, 0.12);
  box-shadow: inset 0 0 18px rgba(154, 245, 219, 0.05);
  z-index: 0;
}

.map-scene__ice--one {
  left: 3%;
  top: 18%;
  width: 33%;
  height: 20%;
  transform: rotate(-12deg);
}

.map-scene__ice--two {
  left: 2%;
  bottom: 6%;
  width: 37%;
  height: 14%;
  transform: rotate(9deg);
}

.map-scene__ice--three {
  right: 4%;
  top: 18%;
  width: 16%;
  height: 20%;
  transform: rotate(7deg);
}

.map-scene__rock {
  border-radius: 24px;
  background:
    linear-gradient(180deg, #4e6773, #263743 62%, #16232c 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 8px 16px rgba(9, 17, 23, 0.18);
  z-index: 1;
}

.map-scene__rock--one {
  left: 7%;
  top: 58%;
  width: 9%;
  height: 7%;
  transform: rotate(-8deg);
}

.map-scene__rock--two {
  right: 12%;
  top: 48%;
  width: 7%;
  height: 6%;
  transform: rotate(11deg);
}

.map-scene__rock--three {
  left: 79%;
  top: 10%;
  width: 6%;
  height: 5%;
  transform: rotate(-14deg);
}

.map-scene__beacon {
  width: 1.3%;
  height: 7%;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(113, 130, 144, 0.96), rgba(39, 49, 57, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
  z-index: 1;
}

.map-scene__beacon::before,
.map-scene__beacon::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 999px;
}

.map-scene__beacon::before {
  top: -18%;
  width: 78%;
  height: 26%;
  background: radial-gradient(circle, rgba(154, 245, 219, 0.98), rgba(65, 217, 199, 0.76) 58%, transparent 72%);
  box-shadow: 0 0 10px rgba(255, 153, 92, 0.42);
  animation: beaconBlink 2.8s ease-in-out infinite;
}

.map-scene__beacon::after {
  top: 0;
  width: 380%;
  height: 160%;
  background: radial-gradient(circle, rgba(65, 217, 199, 0.12), transparent 70%);
}

.map-scene__beacon--north { left: 58.8%; top: 12.8%; }
.map-scene__beacon--west { left: 16.6%; top: 46.4%; animation-delay: -1s; }
.map-scene__beacon--south { left: 72.8%; top: 75.2%; animation-delay: -1.8s; }

.map-scene__steam {
  border-radius: 999px;
  background:
    radial-gradient(circle at 40% 40%, rgba(154, 245, 219, 0.24), transparent 52%),
    radial-gradient(circle at 68% 55%, rgba(154, 245, 219, 0.12), transparent 60%);
  opacity: 0.5;
  z-index: 2;
  animation: steamRise 5s ease-in-out infinite;
}

.map-scene__steam--one {
  left: 53.8%;
  top: 47%;
  width: 6.8%;
  height: 10%;
}

.map-scene__steam--two {
  left: 49.6%;
  top: 43.8%;
  width: 5.5%;
  height: 8.2%;
  animation-delay: -2.4s;
}

.map-scene__route {
  inset: 0;
  z-index: 2;
}

.map-route__svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.map-route__shadow,
.map-route__stroke,
.map-route__highlight {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.map-route__shadow {
  stroke: rgba(8, 12, 15, 0.42);
  stroke-width: 8.4;
}

.map-route__stroke {
  stroke: #5f7880;
  stroke-width: 5.2;
}

.map-route__highlight {
  stroke: rgba(126, 236, 255, 0.4);
  stroke-width: 2.2;
  stroke-dasharray: 1.2 4.6;
  animation: routePacketFlow 3.2s linear infinite;
}

.map-scene__route--breach {
  opacity: 0;
}

.board--breached .map-scene__route--breach {
  opacity: 1;
}

.board--breached .map-scene__route--breach .map-route__stroke {
  stroke: rgba(255, 155, 84, 0.78);
}

.board--breached .map-scene__route--breach .map-route__highlight {
  stroke: rgba(255, 197, 120, 0.72);
}

.map-scene__base {
  left: 28%;
  top: 16%;
  width: 40%;
  height: 40%;
  border-radius: 30px;
  background:
    linear-gradient(90deg, transparent 0 8%, rgba(112, 203, 255, 0.14) 8% 10%, transparent 10% 24%, rgba(112, 203, 255, 0.14) 24% 26%, transparent 26% 74%, rgba(112, 203, 255, 0.14) 74% 76%, transparent 76% 90%, rgba(112, 203, 255, 0.14) 90% 92%, transparent 92% 100%),
    linear-gradient(180deg, #2b3f48 0%, #18262d 58%, #0e171d 100%);
  border: 1px solid rgba(154, 245, 219, 0.14);
  box-shadow: inset 0 0 22px rgba(0, 0, 0, 0.24), 0 12px 30px rgba(2, 8, 16, 0.24);
  z-index: 1;
}

.map-scene__base::after {
  content: "";
  position: absolute;
  inset: 8%;
  border-radius: 22px;
  border: 1px solid rgba(164, 219, 255, 0.12);
  background:
    linear-gradient(180deg, rgba(174, 226, 255, 0.05), transparent 22%),
    linear-gradient(90deg, transparent 0 20%, rgba(92, 178, 255, 0.1) 20% 21%, transparent 21% 50%, rgba(92, 178, 255, 0.1) 50% 51%, transparent 51% 80%, rgba(92, 178, 255, 0.1) 80% 81%, transparent 81% 100%);
}

.map-scene__base::before {
  content: "";
  position: absolute;
  left: 28%;
  top: 15%;
  width: 44%;
  height: 48%;
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(103, 199, 255, 0.08), rgba(103, 199, 255, 0.02)),
    radial-gradient(circle at center, rgba(65, 217, 199, 0.08), rgba(65, 217, 199, 0.02) 58%, transparent 78%);
  border: 1px solid rgba(154, 245, 219, 0.08);
}

.map-scene__core {
  z-index: 3;
  border-radius: 999px;
  background:
    radial-gradient(circle at center, rgba(239, 255, 250, 0.98) 0 10%, rgba(126, 255, 216, 0.92) 10% 22%, rgba(70, 204, 255, 0.9) 22% 36%, rgba(17, 125, 154, 0.92) 36% 54%, rgba(5, 42, 52, 0.2) 54% 100%);
  border: 2px solid rgba(186, 255, 232, 0.42);
  box-shadow:
    0 0 22px rgba(65, 217, 199, 0.34),
    0 0 42px rgba(65, 217, 199, 0.12),
    inset 0 0 18px rgba(231, 255, 247, 0.22);
  animation: corePulse 2.8s ease-in-out infinite;
}

.map-scene__core::before,
.map-scene__core::after {
  content: "";
  position: absolute;
  border-radius: 999px;
}

.map-scene__core::before {
  inset: -9%;
  border-radius: 10px;
  background:
    linear-gradient(90deg, transparent 0 18%, rgba(78, 100, 114, 0.72) 18% 21%, transparent 21% 31%, rgba(78, 100, 114, 0.72) 31% 34%, transparent 34% 66%, rgba(78, 100, 114, 0.72) 66% 69%, transparent 69% 79%, rgba(78, 100, 114, 0.72) 79% 82%, transparent 82% 100%),
    linear-gradient(180deg, transparent 0 20%, rgba(78, 100, 114, 0.66) 20% 23%, transparent 23% 33%, rgba(78, 100, 114, 0.66) 33% 36%, transparent 36% 64%, rgba(78, 100, 114, 0.66) 64% 67%, transparent 67% 77%, rgba(78, 100, 114, 0.66) 77% 80%, transparent 80% 100%);
  box-shadow: 0 0 8px rgba(65, 217, 199, 0.08);
}

.map-scene__core::after {
  inset: 24%;
  border: 1px solid rgba(219, 255, 246, 0.34);
  background: radial-gradient(circle at center, rgba(224, 255, 243, 0.16), transparent 68%);
}

.map-scene__gate {
  border-radius: 10px;
  background:
    repeating-linear-gradient(135deg, rgba(255, 177, 102, 0.66) 0 9px, rgba(105, 74, 37, 0.88) 9px 18px),
    linear-gradient(180deg, #5e4b36, #2f251b);
  border: 1px solid rgba(255, 209, 149, 0.28);
  box-shadow: 0 0 10px rgba(255, 169, 88, 0.12);
  z-index: 3;
}

.board--breached .map-scene__gate {
  opacity: 0.2;
  filter: blur(1px);
}

.tower-range {
  position: absolute;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  border: 2px solid rgba(111, 203, 255, 0.5);
  background: radial-gradient(circle at center, rgba(111, 203, 255, 0.08), rgba(111, 203, 255, 0.02) 58%, transparent 74%);
  box-shadow: 0 0 20px rgba(111, 203, 255, 0.16), inset 0 0 14px rgba(111, 203, 255, 0.1);
  z-index: 3;
  pointer-events: none;
  aspect-ratio: 1 / 1;
}

.tower {
  position: absolute;
  inset: 10%;
  border-radius: 12px;
  pointer-events: none;
  z-index: 3;
  --tower-fire-progress: 0;
  filter: drop-shadow(0 8px 8px rgba(0, 0, 0, 0.18));
}

.tower::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 9%;
  width: 28%;
  height: 28%;
  border-radius: 999px;
  background: radial-gradient(circle, color-mix(in srgb, currentColor 72%, white 28%) 0 16%, currentColor 18% 34%, transparent 68%);
  box-shadow: 0 0 16px currentColor;
  opacity: calc(var(--tower-fire-progress) * 0.82);
  transform: translate(-50%, -50%) scale(calc(0.58 + var(--tower-fire-progress) * 0.72));
}

.tower--selected {
  filter: drop-shadow(0 0 12px color-mix(in srgb, currentColor 60%, transparent)) drop-shadow(0 8px 8px rgba(0, 0, 0, 0.18));
}

.tower--firing .tower__barrel {
  transform: translateY(calc(var(--tower-fire-progress) * 3px)) scaleY(calc(1 + var(--tower-fire-progress) * 0.08));
  filter: brightness(calc(1 + var(--tower-fire-progress) * 0.28));
}

.tower--firing .tower__glow {
  opacity: calc(0.32 + var(--tower-fire-progress) * 0.68);
}

.tower--aura .tower__glow {
  inset: 20%;
  border: 1px solid rgba(215, 184, 255, 0.16);
  background: radial-gradient(circle, rgba(215, 184, 255, 0.14), transparent 64%);
  animation: auraHeartbeat 2.2s ease-in-out infinite;
}

.tower__shadow,
.tower__base,
.tower__body,
.tower__barrel,
.tower__detail,
.tower__accent,
.tower__antenna,
.tower__glow,
.enemy__shadow,
.enemy__legs,
.enemy__body,
.enemy__core,
.enemy__hp {
  position: absolute;
}

.tower__shadow {
  inset: 20% 16% 8%;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
  filter: blur(4px);
}

.tower__base {
  inset: 28% 18% 12%;
  border-radius: 10px;
  background: linear-gradient(180deg, #41586b, #1d2d3b);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.tower__body {
  inset: 22% 28% 26%;
  border-radius: 9px;
  background: linear-gradient(180deg, #c8d6e0, #5a6d7d);
}

.tower__barrel {
  top: 16%;
  left: 47%;
  width: 8%;
  height: 34%;
  border-radius: 999px;
  background: linear-gradient(180deg, #dce7f0, #5d6870);
  transform-origin: center bottom;
}

.tower__glow {
  inset: 34% 38% 34%;
  border-radius: 999px;
  box-shadow: 0 0 14px currentColor;
}

.tower__detail {
  inset: 0;
}

.tower__accent,
.tower__antenna {
  inset: 0;
  pointer-events: none;
}

.tower--bolt { color: #d9e5ff; }
.tower--cannon { color: #ffc18c; }
.tower--pulse { color: #8ff7ff; }
.tower--rail { color: #ff9a8f; }
.tower--emp { color: #90bcff; }
.tower--scrambler { color: #9ef0bd; }
.tower--uplink { color: #d7b8ff; }

.tower--bolt .tower__base {
  inset: 34% 18% 12%;
  clip-path: polygon(10% 100%, 22% 28%, 78% 28%, 90% 100%);
  background: linear-gradient(180deg, #263644, #101a25);
}

.tower--bolt .tower__body {
  inset: 18% 22% 22%;
  clip-path: polygon(50% 0, 80% 22%, 94% 58%, 70% 100%, 30% 100%, 6% 58%, 20% 22%);
  background:
    linear-gradient(180deg, #f0f8ff 0 26%, #a5bcd0 26% 52%, #506476 52% 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.tower--bolt .tower__barrel {
  left: 46%;
  top: 8%;
  width: 8%;
  height: 52%;
  border-radius: 999px 999px 14px 14px;
  background: linear-gradient(180deg, #edf7ff, #72879a 58%, #425667 100%);
}

.tower--bolt .tower__detail {
  left: 26%;
  top: 38%;
  width: 48%;
  height: 18%;
  clip-path: polygon(0 100%, 22% 0, 50% 78%, 78% 0, 100% 100%, 76% 92%, 50% 100%, 24% 92%);
  background: linear-gradient(180deg, rgba(226, 241, 255, 0.95), rgba(104, 129, 149, 0.3));
}

.tower--bolt .tower__accent {
  left: 33%;
  top: 56%;
  width: 34%;
  height: 16%;
  border-radius: 999px;
  border: 2px solid rgba(217, 229, 255, 0.34);
  box-shadow: inset 0 0 10px rgba(217, 229, 255, 0.1);
}

.tower--bolt .tower__antenna {
  left: 42%;
  top: 10%;
  width: 16%;
  height: 12%;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  background: linear-gradient(180deg, rgba(244, 250, 255, 0.98), rgba(136, 157, 176, 0.5));
}

.tower--cannon .tower__base {
  inset: 42% 10% 10%;
  border-radius: 10px;
  background: linear-gradient(180deg, #473220, #17110d);
}

.tower--cannon .tower__body {
  inset: 24% 18% 26%;
  border-radius: 12px 12px 18px 18px;
  background:
    linear-gradient(90deg, rgba(80, 54, 35, 0.9) 0 16%, transparent 16% 84%, rgba(80, 54, 35, 0.9) 84% 100%),
    linear-gradient(180deg, #f1d5b2 0 30%, #b2875d 30% 64%, #6f533d 64% 100%);
}

.tower--cannon .tower__barrel {
  left: 28%;
  top: 10%;
  width: 44%;
  height: 28%;
  border-radius: 999px 999px 10px 10px;
  background:
    radial-gradient(circle at 26% 50%, rgba(60, 44, 33, 0.95) 0 12%, transparent 14%),
    radial-gradient(circle at 74% 50%, rgba(60, 44, 33, 0.95) 0 12%, transparent 14%),
    linear-gradient(180deg, #f4d8b7, #8f6d51 58%, #5f4938);
}

.tower--cannon .tower__detail {
  left: 20%;
  top: 54%;
  width: 60%;
  height: 18%;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(99, 74, 51, 0.94) 0 10%, rgba(255, 204, 145, 0.84) 10% 22%, rgba(99, 74, 51, 0.94) 22% 34%, rgba(255, 204, 145, 0.84) 34% 46%, rgba(99, 74, 51, 0.94) 46% 58%, rgba(255, 204, 145, 0.84) 58% 70%, rgba(99, 74, 51, 0.94) 70% 82%, rgba(255, 204, 145, 0.84) 82% 90%, rgba(99, 74, 51, 0.94) 90% 100%);
}

.tower--cannon .tower__accent {
  inset: 18% 14% 32%;
  border-radius: 16px;
  border: 2px solid rgba(255, 193, 140, 0.24);
}

.tower--cannon .tower__antenna {
  left: 18%;
  top: 22%;
  width: 64%;
  height: 12%;
  border-radius: 999px;
  box-shadow:
    0 0 0 2px rgba(94, 74, 54, 0.75) inset,
    0 -2px 0 rgba(248, 214, 177, 0.25) inset;
}

.tower--pulse .tower__base {
  inset: 32% 16% 12%;
  border-radius: 999px;
  background: radial-gradient(circle at center, #375a67, #13262e 72%);
}

.tower--pulse .tower__body {
  inset: 20% 20% 20%;
  border-radius: 999px;
  background:
    radial-gradient(circle at center, #efffff 0 14%, #86f2ff 14% 32%, #2d7788 32% 56%, #16343f 56% 100%);
}

.tower--pulse .tower__barrel {
  left: 44%;
  top: 6%;
  width: 12%;
  height: 22%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(225, 255, 255, 0.96), rgba(111, 221, 235, 0.65), rgba(59, 95, 108, 0.84));
}

.tower--pulse .tower__detail {
  inset: 12%;
  border-radius: 999px;
  border: 2px solid rgba(143, 247, 255, 0.34);
  box-shadow:
    inset 0 0 16px rgba(143, 247, 255, 0.14),
    0 0 14px rgba(143, 247, 255, 0.12);
}

.tower--pulse .tower__accent {
  inset: 4%;
  border-radius: 999px;
  border: 2px dashed rgba(143, 247, 255, 0.28);
}

.tower--pulse .tower__antenna {
  left: 24%;
  top: 24%;
  width: 52%;
  height: 52%;
  border-radius: 999px;
  border: 1px solid rgba(195, 252, 255, 0.2);
}

.tower--pulse .tower__glow {
  inset: 30%;
  box-shadow: 0 0 18px currentColor, inset 0 0 12px rgba(255, 255, 255, 0.18);
}

.tower--rail .tower__base {
  inset: 42% 12% 10%;
  clip-path: polygon(0 100%, 8% 56%, 92% 56%, 100% 100%);
  background: linear-gradient(180deg, #49343a, #181013);
}

.tower--rail .tower__body {
  inset: 18% 34% 18%;
  clip-path: polygon(50% 0, 78% 8%, 78% 84%, 100% 84%, 100% 100%, 0 100%, 0 84%, 22% 84%, 22% 8%);
  background: linear-gradient(180deg, #ffe4e0, #b48b8e 46%, #624950 100%);
}

.tower--rail .tower__barrel {
  left: 47%;
  top: 2%;
  width: 6%;
  height: 66%;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff1ef 0 18%, #f2b5ab 18% 36%, #8d6569 36% 100%);
}

.tower--rail .tower__detail {
  left: 38%;
  top: 58%;
  width: 24%;
  height: 14%;
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(255, 164, 150, 0.85), rgba(122, 84, 90, 0.42));
  box-shadow: 0 0 8px rgba(255, 154, 143, 0.2);
}

.tower--rail .tower__accent {
  left: 22%;
  top: 54%;
  width: 56%;
  height: 10%;
  border-radius: 4px;
  background:
    linear-gradient(90deg, rgba(82, 59, 66, 0.96) 0 12%, rgba(255, 189, 179, 0.98) 12% 88%, rgba(82, 59, 66, 0.96) 88% 100%);
}

.tower--rail .tower__antenna {
  left: 40%;
  top: 8%;
  width: 20%;
  height: 10%;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  background: linear-gradient(180deg, rgba(255, 241, 239, 0.98), rgba(137, 105, 111, 0.5));
}

.tower--emp .tower__base {
  inset: 34% 18% 12%;
  border-radius: 12px 12px 16px 16px;
  background: linear-gradient(180deg, #20334a, #0c1724);
}

.tower--emp .tower__body {
  inset: 22% 22% 22%;
  border-radius: 999px 999px 16px 16px;
  background: linear-gradient(180deg, #edf4ff, #8eabd4 42%, #37506f 100%);
}

.tower--emp .tower__barrel {
  left: 46%;
  top: 16%;
  width: 8%;
  height: 24%;
  border-radius: 999px;
  background: linear-gradient(180deg, #f1f6ff, #7ea1d6 58%, #324d6c 100%);
}

.tower--emp .tower__detail {
  inset: 14% 18% 22%;
  border-radius: 999px 999px 18px 18px;
  border: 2px solid rgba(144, 188, 255, 0.34);
  border-bottom-width: 1px;
}

.tower--emp .tower__accent {
  left: 20%;
  top: 48%;
  width: 60%;
  height: 18%;
  border-radius: 999px;
  background:
    radial-gradient(circle at 18% 50%, rgba(179, 217, 255, 0.96) 0 10%, transparent 12%),
    radial-gradient(circle at 50% 50%, rgba(179, 217, 255, 0.96) 0 10%, transparent 12%),
    radial-gradient(circle at 82% 50%, rgba(179, 217, 255, 0.96) 0 10%, transparent 12%),
    linear-gradient(90deg, rgba(84, 114, 158, 0.94), rgba(208, 227, 255, 0.95), rgba(84, 114, 158, 0.94));
}

.tower--emp .tower__antenna {
  left: 16%;
  top: 12%;
  width: 68%;
  height: 22%;
  border-radius: 999px 999px 0 0;
  border: 2px solid rgba(144, 188, 255, 0.34);
  border-bottom: none;
}

.tower--scrambler .tower__base {
  inset: 38% 18% 12%;
  border-radius: 8px;
  background: linear-gradient(180deg, #203126, #0b1610);
}

.tower--scrambler .tower__body {
  inset: 18% 32% 18%;
  border-radius: 8px 8px 14px 14px;
  background: linear-gradient(180deg, #effff3, #8bc8a1 42%, #3a5f49 100%);
}

.tower--scrambler .tower__barrel {
  left: 47%;
  top: 10%;
  width: 6%;
  height: 34%;
  border-radius: 999px;
  background: linear-gradient(180deg, #f3fff5, #9adbaf 56%, #486b53 100%);
}

.tower--scrambler .tower__detail {
  left: 18%;
  top: 44%;
  width: 64%;
  height: 10%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(84, 124, 96, 0.92), rgba(222, 255, 233, 0.98), rgba(84, 124, 96, 0.92));
  box-shadow: 0 0 10px rgba(158, 240, 189, 0.16);
}

.tower--scrambler .tower__accent {
  left: 26%;
  top: 16%;
  width: 48%;
  height: 28%;
  border-radius: 999px 999px 4px 4px;
  border: 2px solid rgba(158, 240, 189, 0.3);
  border-bottom: none;
}

.tower--scrambler .tower__antenna {
  left: 22%;
  top: 8%;
  width: 56%;
  height: 22%;
  background:
    linear-gradient(90deg, transparent 0 10%, rgba(158, 240, 189, 0.72) 10% 12%, transparent 12% 48%, rgba(158, 240, 189, 0.72) 48% 52%, transparent 52% 88%, rgba(158, 240, 189, 0.72) 88% 90%, transparent 90% 100%);
}

.tower--uplink .tower__base {
  inset: 40% 18% 10%;
  border-radius: 10px;
  background: linear-gradient(180deg, #322843, #120f1b);
}

.tower--uplink .tower__body {
  inset: 22% 38% 18%;
  border-radius: 10px 10px 14px 14px;
  background: linear-gradient(180deg, #f4ebff, #bda4ef 42%, #5a4a78 100%);
}

.tower--uplink .tower__barrel {
  left: 47%;
  top: 8%;
  width: 6%;
  height: 44%;
  border-radius: 999px;
  background: linear-gradient(180deg, #f5ecff, #b89bea 58%, #66537f);
}

.tower--uplink .tower__detail {
  left: 18%;
  top: 16%;
  width: 64%;
  height: 22%;
  border-radius: 999px 999px 4px 4px;
  border: 2px solid rgba(215, 184, 255, 0.34);
  border-bottom: none;
}

.tower--uplink .tower__accent {
  left: 16%;
  top: 46%;
  width: 68%;
  height: 16%;
  background:
    linear-gradient(90deg, transparent 0 8%, rgba(215, 184, 255, 0.9) 8% 10%, transparent 10% 28%, rgba(215, 184, 255, 0.9) 28% 30%, transparent 30% 48%, rgba(215, 184, 255, 0.9) 48% 52%, transparent 52% 70%, rgba(215, 184, 255, 0.9) 70% 72%, transparent 72% 90%, rgba(215, 184, 255, 0.9) 90% 92%, transparent 92% 100%);
  border-radius: 999px;
}

.tower--uplink .tower__antenna {
  left: 8%;
  top: 8%;
  width: 84%;
  height: 28%;
  background:
    radial-gradient(circle at 12% 90%, rgba(215, 184, 255, 0.34) 0 8%, transparent 10%),
    radial-gradient(circle at 88% 90%, rgba(215, 184, 255, 0.34) 0 8%, transparent 10%);
}

.tower--uplink .tower__antenna::before,
.tower--uplink .tower__antenna::after {
  content: "";
  position: absolute;
  top: 0;
  width: 34%;
  height: 100%;
  border: 2px solid rgba(215, 184, 255, 0.28);
  border-bottom: none;
  border-radius: 999px 999px 0 0;
}

.tower--uplink .tower__antenna::before {
  left: 0;
}

.tower--uplink .tower__antenna::after {
  right: 0;
}

.tower__operator {
  position: absolute;
  bottom: 5px;
  right: 5px;
  font-size: 0.58rem;
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.enemy,
.projectile {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.enemy {
  pointer-events: none;
  z-index: 4;
  animation: mechHover 1.8s ease-in-out infinite;
  animation-delay: var(--enemy-drift, 0s);
  --enemy-health: 1;
  --enemy-hit: 0;
}

.enemy--small { width: 18px; height: 18px; }
.enemy--medium { width: 22px; height: 22px; }
.enemy--large { width: 28px; height: 28px; }
.enemy--boss,
.enemy--breach { width: 36px; height: 36px; }

.enemy__shadow {
  inset: 64% 18% 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.26);
  filter: blur(4px);
  animation: shadowPulse 1.8s ease-in-out infinite;
  animation-delay: inherit;
}

.enemy__legs {
  inset: 58% 22% 1%;
  background:
    linear-gradient(90deg, transparent 0 10%, rgba(10, 18, 26, 0.7) 10% 20%, transparent 20% 34%, rgba(10, 18, 26, 0.7) 34% 44%, transparent 44% 58%, rgba(10, 18, 26, 0.7) 58% 68%, transparent 68% 82%, rgba(10, 18, 26, 0.7) 82% 92%, transparent 92% 100%);
  opacity: 0.92;
}

.enemy__body {
  inset: 14% 16% 22%;
  border-radius: 6px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--enemy-color) 84%, white 16%), color-mix(in srgb, var(--enemy-color) 72%, black 28%));
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow:
    0 0 16px var(--enemy-glow),
    0 0 calc(var(--enemy-hit) * 22px) rgba(255, 255, 255, 0.58);
  filter: brightness(calc(1 + var(--enemy-hit) * 0.65));
}

.enemy__core {
  inset: 33% 34% 31%;
  border-radius: 999px;
  background: var(--enemy-glow);
  box-shadow: 0 0 12px var(--enemy-glow);
  animation: coreFlicker 1.6s ease-in-out infinite;
}

.enemy__armor,
.enemy__weapon,
.enemy__antenna,
.enemy__thrusters {
  position: absolute;
  pointer-events: none;
}

.enemy__armor {
  inset: 18% 20% 28%;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(0, 0, 0, 0.08)),
    linear-gradient(90deg, transparent 0 18%, rgba(10, 18, 26, 0.18) 18% 20%, transparent 20% 80%, rgba(10, 18, 26, 0.18) 80% 82%, transparent 82% 100%);
  mix-blend-mode: screen;
}

.enemy__weapon {
  top: 28%;
  left: 49%;
  width: 8%;
  height: 30%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(239, 245, 250, 0.78), rgba(51, 63, 74, 0.88));
  transform-origin: center 85%;
}

.enemy__antenna {
  left: 47%;
  top: 6%;
  width: 6%;
  height: 20%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(218, 232, 241, 0.72), rgba(56, 69, 80, 0.8));
  opacity: 0.75;
}

.enemy__thrusters {
  inset: 48% 18% 16%;
  background:
    radial-gradient(circle at 20% 50%, rgba(255, 179, 109, 0.18), transparent 35%),
    radial-gradient(circle at 80% 50%, rgba(255, 179, 109, 0.18), transparent 35%);
  opacity: 0;
}

.enemy__hp {
  left: 6%;
  right: 6%;
  bottom: -7px;
  height: 4px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.enemy__hp i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #9ef0bd, #d9fff1);
}

.enemy--damaged .enemy__hp i {
  background: linear-gradient(90deg, var(--warning), #ffe0b8);
}

.enemy--critical .enemy__hp i {
  background: linear-gradient(90deg, var(--danger), #ffd0d0);
}

.enemy--hit .enemy__body {
  border-color: rgba(255, 255, 255, 0.34);
}

.enemy--hit .enemy__core {
  background: radial-gradient(circle, rgba(255, 255, 255, 0.96), var(--enemy-glow) 48%, transparent 78%);
}

.enemy--slowed::after,
.enemy--emp::after,
.enemy--marked::after,
.enemy--rooted::after {
  content: "";
  position: absolute;
  inset: -18%;
  border-radius: 999px;
  pointer-events: none;
}

.enemy--slowed::after {
  border: 1px solid rgba(110, 231, 255, 0.38);
  box-shadow: 0 0 10px rgba(110, 231, 255, 0.16);
}

.enemy--emp::after {
  border: 1px dashed rgba(121, 165, 255, 0.58);
  box-shadow: 0 0 14px rgba(121, 165, 255, 0.18);
}

.enemy--marked::after {
  border: 1px solid rgba(90, 228, 163, 0.45);
  box-shadow: 0 0 14px rgba(90, 228, 163, 0.18);
}

.enemy--rooted .enemy__legs {
  opacity: 0.35;
}

.enemy--boss .enemy__body,
.enemy--breach .enemy__body {
  border-radius: 8px;
}

.enemy--small .enemy__body {
  clip-path: polygon(30% 0%, 70% 0%, 100% 28%, 82% 100%, 18% 100%, 0% 28%);
}

.enemy--medium .enemy__body {
  clip-path: polygon(18% 0%, 82% 0%, 100% 22%, 88% 100%, 12% 100%, 0% 22%);
}

.enemy--large .enemy__body {
  clip-path: polygon(10% 0%, 90% 0%, 100% 20%, 94% 100%, 6% 100%, 0% 20%);
}

.enemy--breach .enemy__body {
  clip-path: polygon(6% 6%, 88% 6%, 100% 28%, 100% 70%, 84% 100%, 14% 100%, 0% 76%, 0% 26%);
}

.enemy--breach .enemy__legs {
  inset: 62% 18% 0;
}

.enemy--breach .enemy__core {
  inset: 26% 26% 26%;
}

.enemy--scout .enemy__legs,
.enemy--dash .enemy__legs {
  inset: 60% 18% 0;
}

.enemy--scout .enemy__weapon,
.enemy--dash .enemy__weapon {
  width: 5%;
  height: 22%;
  top: 34%;
}

.enemy--scout .enemy__antenna {
  opacity: 0.35;
}

.enemy--dash .enemy__thrusters {
  opacity: 1;
  animation: thrusterPulse 0.45s ease-in-out infinite alternate;
}

.enemy--assault .enemy__weapon,
.enemy--aegis .enemy__weapon {
  width: 14%;
  left: 43%;
  top: 24%;
  height: 34%;
  border-radius: 8px;
}

.enemy--aegis .enemy__armor {
  inset: 12% 14% 22%;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(127, 200, 255, 0.28), 0 0 14px rgba(127, 200, 255, 0.18);
}

.enemy--jammer .enemy__antenna,
.enemy--ghost .enemy__antenna {
  left: 24%;
  top: 8%;
  width: 52%;
  height: 18%;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(230, 220, 255, 0.74), transparent);
  box-shadow: 0 0 10px rgba(181, 122, 255, 0.22);
  opacity: 1;
}

.enemy--jammer .enemy__weapon,
.enemy--ghost .enemy__weapon {
  opacity: 0.45;
}

.enemy--bulwark .enemy__armor,
.enemy--repair .enemy__armor,
.enemy--siege .enemy__armor,
.enemy--breach .enemy__armor {
  inset: 10% 12% 20%;
  border-radius: 9px;
}

.enemy--bulwark .enemy__weapon,
.enemy--repair .enemy__weapon,
.enemy--siege .enemy__weapon,
.enemy--breach .enemy__weapon {
  width: 18%;
  left: 41%;
  top: 18%;
  height: 36%;
  border-radius: 9px 9px 999px 999px;
}

.enemy--repair .enemy__thrusters {
  opacity: 1;
  background:
    radial-gradient(circle at 22% 50%, rgba(99, 223, 147, 0.26), transparent 35%),
    radial-gradient(circle at 78% 50%, rgba(99, 223, 147, 0.26), transparent 35%);
}

.enemy--breach .enemy__antenna {
  left: 17%;
  top: 16%;
  width: 66%;
  height: 12%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 203, 132, 0.2), rgba(255, 171, 94, 0.76), rgba(255, 203, 132, 0.2));
  box-shadow: 0 0 12px rgba(255, 165, 90, 0.18);
}

.projectile {
  height: 5px;
  border-radius: 999px;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.2), 0 0 18px var(--projectile-color);
  z-index: 5;
  transform-origin: center;
  opacity: calc(0.35 + var(--projectile-life, 1) * 0.6);
  animation: tracerPulse 0.14s linear infinite;
}

.projectile::before,
.projectile::after,
.projectile__packet {
  content: "";
  position: absolute;
  pointer-events: none;
}

.projectile::before {
  inset: -5px 8%;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--projectile-color) 44%, transparent), transparent);
  filter: blur(3px);
}

.projectile::after {
  right: -3px;
  top: 50%;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: radial-gradient(circle, #fff 0 14%, var(--projectile-color) 16% 46%, transparent 70%);
  box-shadow: 0 0 14px var(--projectile-color);
  transform: translateY(-50%);
}

.projectile__packet {
  left: 16%;
  right: 20%;
  top: -3px;
  height: 11px;
  border-radius: 999px;
  background:
    repeating-linear-gradient(90deg, transparent 0 10px, color-mix(in srgb, var(--projectile-color) 38%, transparent) 10px 14px, transparent 14px 24px);
  opacity: 0.68;
}

.projectile--emp,
.projectile--scrambler {
  height: 6px;
  border-style: dashed;
}

.projectile--rail {
  height: 3px;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.34), 0 0 24px var(--projectile-color);
}

.list-button,
.primary-button,
.operator-card {
  width: 100%;
  border: 1px solid rgba(111, 203, 255, 0.25);
  background: rgba(18, 38, 54, 0.78);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 0.92rem;
}

.list-button,
.primary-button {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.list-button.is-selected,
.list-button:hover,
.primary-button:hover {
  background: rgba(32, 60, 83, 0.9);
}

.list-button--draggable {
  cursor: grab;
  touch-action: none;
  user-select: none;
  border-color: rgba(248, 208, 92, 0.34);
  background:
    linear-gradient(180deg, rgba(40, 58, 72, 0.92), rgba(18, 38, 54, 0.9)),
    rgba(18, 38, 54, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 239, 191, 0.08), 0 8px 18px rgba(0, 0, 0, 0.16);
}

.list-button--draggable:active {
  cursor: grabbing;
}

.list-button--draggable:hover {
  background:
    linear-gradient(180deg, rgba(58, 78, 95, 0.96), rgba(24, 45, 61, 0.94)),
    rgba(32, 60, 83, 0.9);
  border-color: rgba(248, 208, 92, 0.5);
}

.list-button--control {
  cursor: pointer;
  border-color: rgba(111, 203, 255, 0.22);
  background:
    linear-gradient(180deg, rgba(17, 35, 49, 0.96), rgba(11, 25, 37, 0.96)),
    rgba(18, 38, 54, 0.78);
  box-shadow: inset 0 1px 0 rgba(197, 233, 255, 0.06);
}

.list-button--control:hover {
  background:
    linear-gradient(180deg, rgba(28, 52, 72, 0.96), rgba(15, 33, 47, 0.96)),
    rgba(32, 60, 83, 0.9);
  border-color: rgba(111, 203, 255, 0.36);
}

.list-button--danger {
  border-color: rgba(255, 124, 124, 0.28);
}

.list-button--danger:hover {
  background:
    linear-gradient(180deg, rgba(79, 34, 40, 0.96), rgba(45, 18, 23, 0.96)),
    rgba(66, 27, 32, 0.92);
  border-color: rgba(255, 124, 124, 0.5);
}

.drag-ghost {
  position: fixed;
  z-index: 1000;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(248, 208, 92, 0.5);
  background: rgba(18, 38, 54, 0.94);
  color: var(--text);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28), 0 0 18px rgba(248, 208, 92, 0.2);
  pointer-events: none;
  white-space: nowrap;
  font-size: 0.9rem;
}

.primary-button {
  background: linear-gradient(180deg, #2d6d94, #1a516f);
}

.list-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.selection-card,
.upgrade-list,
.operator-card {
  display: grid;
  gap: 4px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(111, 203, 255, 0.2);
  background: rgba(20, 43, 60, 0.72);
  font-size: 0.8rem;
  color: var(--accent-2);
}

.build-list {
  grid-template-columns: 1fr;
}

.quiz-shell {
  display: grid;
  gap: 8px;
}

.quiz-card {
  display: grid;
  gap: 6px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(65, 217, 199, 0.16);
  background: rgba(10, 23, 30, 0.88);
}

.quiz-card--correct {
  border-color: rgba(90, 228, 163, 0.34);
  box-shadow: inset 0 0 0 1px rgba(90, 228, 163, 0.08);
}

.quiz-card--incorrect {
  border-color: rgba(255, 155, 84, 0.34);
  box-shadow: inset 0 0 0 1px rgba(255, 155, 84, 0.08);
}

.quiz-choice {
  align-items: flex-start;
}

.quiz-choice span {
  text-align: left;
  flex: 1;
}

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

.operator-card.is-locked {
  opacity: 0.45;
}

@media (max-width: 1180px) {
  .shell {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .layout {
    grid-template-columns: 1fr;
    flex: none;
  }

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

  .sidebar--right {
    overflow: visible;
    padding-right: 0;
  }

  .board-panel__header {
    grid-template-columns: 1fr;
  }

  .board-panel__stats {
    justify-self: stretch;
    width: 100%;
  }

  .board {
    min-height: 56vh;
  }
}

@media (max-width: 760px) {
  body {
    overflow-y: auto;
    overflow-x: hidden;
  }

  .shell {
    padding: 8px;
    height: auto;
    min-height: 100dvh;
    overflow: visible;
    gap: 8px;
  }

  .layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 8px;
    display: grid;
  }

  .topbar,
  .topbar__stats,
  .sidebar {
    grid-template-columns: 1fr;
    display: grid;
  }

  .topbar {
    display: grid;
  }

  .board-panel__header {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .operator-list,
  .sidebar {
    grid-template-columns: 1fr;
  }

  .topbar {
    padding: 12px;
  }

  .topbar__title h1 {
    font-size: 1.45rem;
  }

  .topbar__subtitle,
  .board-panel__footer {
    font-size: 0.9rem;
  }

  .panel,
  .panel--compact {
    padding: 12px;
    border-radius: 16px;
  }

  .stat-card,
  .list-button,
  .primary-button,
  .operator-card {
    min-height: 52px;
    padding: 10px 12px;
  }

  .board {
    min-height: 43vh;
    border-radius: 16px;
    padding: 6px;
  }

  .board-hotspots,
  .board-actors,
  .round-overlay {
    inset: 6px;
    place-items: start stretch;
    padding: 8px;
  }

  .round-overlay__card {
    width: 100%;
    max-height: 100%;
    gap: 10px;
    padding: 12px;
    border-radius: 14px;
  }

  .round-overlay__card h3 {
    font-size: 1rem;
  }

  .round-overlay__card p,
  .round-overlay__card .list-button {
    font-size: 0.92rem;
  }

  .tile {
    border-radius: 14px;
  }

  .tile--pad::after {
    inset: 7%;
    border-radius: 10px;
  }

  .tower__operator {
    font-size: 0.5rem;
    right: 2px;
    bottom: 2px;
  }

  .mobile-nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 6px;
    border: 1px solid rgba(111, 203, 255, 0.18);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(10, 24, 35, 0.96), rgba(8, 19, 29, 0.94));
    backdrop-filter: blur(10px);
  }

  .mobile-nav__button {
    min-height: 44px;
    padding: 8px 6px;
    border-radius: 12px;
    border: 1px solid rgba(111, 203, 255, 0.16);
    background: rgba(18, 38, 54, 0.82);
    font-size: 0.8rem;
  }

  .mobile-nav__button.is-active {
    border-color: rgba(154, 245, 219, 0.34);
    background: linear-gradient(180deg, rgba(49, 104, 118, 0.94), rgba(20, 57, 70, 0.94));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 8px 16px rgba(0, 0, 0, 0.18);
  }

  .sidebar--right {
    gap: 10px;
  }

  .panel[hidden] {
    display: none !important;
  }

  .operator-list {
    grid-template-columns: 1fr;
  }

  .quiz-choice {
    align-items: center;
  }

  .quiz-choice strong {
    min-width: 1.5rem;
  }

  .selection-card p,
  .wave-intel p,
  .quiz-card p {
    line-height: 1.4;
  }
}

@keyframes corePulse {
  0%, 100% {
    transform: scale(0.96);
    opacity: 0.75;
  }

  50% {
    transform: scale(1.03);
    opacity: 1;
  }
}

@keyframes auroraShift {
  0%, 100% {
    transform: skewX(-16deg) translateX(0);
    opacity: 0.68;
  }

  50% {
    transform: skewX(-10deg) translateX(2%);
    opacity: 0.86;
  }
}

@keyframes windSweep {
  0% {
    transform: translateX(0) scaleX(0.92);
    opacity: 0;
  }

  15%, 75% {
    opacity: 0.58;
  }

  100% {
    transform: translateX(26%) scaleX(1.08);
    opacity: 0;
  }
}

@keyframes beaconBlink {
  0%, 100% {
    opacity: 0.45;
    transform: translateX(-50%) scale(0.92);
  }

  50% {
    opacity: 1;
    transform: translateX(-50%) scale(1.06);
  }
}

@keyframes steamRise {
  0%, 100% {
    transform: translateY(4px) scale(0.94);
    opacity: 0.24;
  }

  50% {
    transform: translateY(-8px) scale(1.06);
    opacity: 0.52;
  }
}

@keyframes mechHover {
  0%, 100% {
    margin-top: 0;
  }

  50% {
    margin-top: -1.5px;
  }
}

@keyframes shadowPulse {
  0%, 100% {
    transform: scale(0.92);
    opacity: 0.22;
  }

  50% {
    transform: scale(1.02);
    opacity: 0.32;
  }
}

@keyframes coreFlicker {
  0%, 100% {
    opacity: 0.82;
  }

  45% {
    opacity: 1;
  }

  55% {
    opacity: 0.72;
  }
}

@keyframes thrusterPulse {
  from {
    transform: scale(0.92);
    opacity: 0.72;
  }

  to {
    transform: scale(1.06);
    opacity: 1;
  }
}

@keyframes tracerPulse {
  from {
    opacity: 0.72;
  }

  to {
    opacity: 1;
  }
}

@keyframes boardScan {
  from {
    transform: translateX(-120%);
  }

  to {
    transform: translateX(120%);
  }
}

@keyframes routePacketFlow {
  from {
    stroke-dashoffset: 0;
  }

  to {
    stroke-dashoffset: -34;
  }
}

@keyframes auraHeartbeat {
  0%, 100% {
    opacity: 0.38;
    transform: scale(0.92);
  }

  50% {
    opacity: 0.88;
    transform: scale(1.12);
  }
}

@keyframes coreDamageShake {
  0%, 100% {
    transform: translate(0, 0);
  }

  50% {
    transform: translate(1px, -1px);
  }
}

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

  .board--alert {
    animation: none;
  }
}
/* ==========================================================================
   PREMIUM UI & UX OVERHAUL
   ========================================================================== */

/* 1. Typography Overhaul */
body {
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  letter-spacing: -0.01em;
}

.topbar__title h1, .panel h2, .panel h3 {
  font-family: "Outfit", "Inter", sans-serif;
  letter-spacing: -0.02em;
  font-weight: 700;
}

/* 2. Glassmorphism & Panel Styling */
:root {
  --panel: rgba(11, 25, 33, 0.65);
  --panel-edge: rgba(65, 217, 199, 0.15);
  --glow-cyan: rgba(65, 217, 199, 0.3);
}

.topbar, .panel, .stat-card {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--panel-edge);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* 3. Hover States & Interactivity */
button:hover:not(:disabled), .list-button:hover:not(:disabled), .appliance-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px var(--glow-cyan);
  border-color: var(--accent);
}

.primary-button {
  background: linear-gradient(135deg, #1f6b62, #147e69);
  border: 1px solid var(--accent);
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  transition: all 0.2s ease;
}

.primary-button:hover:not(:disabled) {
  background: linear-gradient(135deg, #258176, #199c82);
  box-shadow: 0 0 20px var(--glow-cyan);
}

/* 4. Core Router Stress Pulse */
@keyframes core-stress {
  0% { box-shadow: inset 0 0 0 1px rgba(255, 98, 98, 0.12), 0 0 22px rgba(255, 98, 98, 0.18); }
  50% { box-shadow: inset 0 0 0 1px rgba(255, 98, 98, 0.4), 0 0 40px rgba(255, 98, 98, 0.5); border-color: rgba(255, 98, 98, 0.8); }
  100% { box-shadow: inset 0 0 0 1px rgba(255, 98, 98, 0.12), 0 0 22px rgba(255, 98, 98, 0.18); }
}

.stat-card--core.is-critical {
  animation: core-stress 1.5s infinite ease-in-out;
}

/* 5. Micro-Animations */
/* Tower Placement Drop */
@keyframes tower-drop {
  0% { transform: scale(1.4) translateY(-20px); opacity: 0; filter: drop-shadow(0 0 20px var(--accent)); }
  50% { transform: scale(0.9) translateY(2px); opacity: 1; filter: drop-shadow(0 0 10px var(--accent)); }
  100% { transform: scale(1) translateY(0); filter: drop-shadow(0 0 0 transparent); }
}

.tower-placed-anim {
  animation: tower-drop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Floating Combat Text for Quiz */
@keyframes float-up-fade {
  0% { opacity: 0; transform: translateY(10px) scale(0.8); }
  20% { opacity: 1; transform: translateY(-5px) scale(1.1); text-shadow: 0 0 10px var(--success); }
  80% { opacity: 1; transform: translateY(-20px) scale(1); text-shadow: 0 0 5px var(--success); }
  100% { opacity: 0; transform: translateY(-30px) scale(0.9); }
}

.floating-text {
  position: absolute;
  color: var(--success);
  font-family: "Outfit", sans-serif;
  font-weight: 800;
  font-size: 1.5rem;
  pointer-events: none;
  animation: float-up-fade 1.5s ease-out forwards;
  z-index: 100;
}

/* 6. Projectile Polish */
.projectile {
  filter: drop-shadow(0 0 6px var(--signal));
}
.projectile--splash {
  filter: drop-shadow(0 0 8px var(--warning));
}

/* ==========================================================================
   GAME FEEL & UX POLISH
   ========================================================================== */

/* 1. Sweet Spot Ring */
.tower-range--sweet {
  border: 2px dashed rgba(65, 217, 199, 0.6);
  background: rgba(65, 217, 199, 0.05);
  box-shadow: inset 0 0 10px rgba(65, 217, 199, 0.1);
  animation: slow-spin 10s linear infinite;
  z-index: 10;
}
@keyframes slow-spin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* 2. Enemy Hit Flash */
.enemy--hit {
  filter: brightness(2.5) contrast(1.2) drop-shadow(0 0 12px white) !important;
  transition: filter 0.05s ease-out;
}

/* 3. Enemy Tooltip */
.enemy-tooltip {
  position: fixed;
  background: rgba(11, 25, 33, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 10px 14px;
  color: var(--text);
  font-family: "Inter", sans-serif;
  font-size: 0.85rem;
  z-index: 9999;
  pointer-events: none;
  display: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}
.enemy-tooltip strong {
  font-family: "Outfit", sans-serif;
  font-size: 1.1rem;
  color: var(--accent-2);
}
.tag--enemy {
  background: rgba(255, 98, 98, 0.15);
  color: var(--danger);
  border: 1px solid rgba(255, 98, 98, 0.3);
  font-size: 0.7rem;
  padding: 2px 6px;
  margin-right: 4px;
}

/* 4. Wave Countdown Overlay */
.countdown-text {
  font-family: "Outfit", sans-serif;
  font-size: 8rem;
  font-weight: 800;
  color: var(--text);
  text-shadow: 0 0 40px var(--accent), 0 0 10px var(--accent);
  animation: pulse-countdown 1s ease-out infinite;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}
@keyframes pulse-countdown {
  0% { transform: scale(1.5); opacity: 0; }
  20% { transform: scale(1); opacity: 1; }
  80% { transform: scale(0.9); opacity: 1; }
  100% { transform: scale(0.8); opacity: 0; }
}

/* ==========================================================================
   FOUNDATIONAL MECHANICS CSS
   ========================================================================== */

/* Hazard Tiles */
.tile--fiber {
  box-shadow: inset 0 0 25px rgba(0, 200, 255, 0.4);
  background: rgba(0, 200, 255, 0.05);
  border: 1px solid rgba(0, 200, 255, 0.2);
}
.tile--congested {
  background: repeating-linear-gradient(
    45deg,
    rgba(255, 165, 0, 0.05),
    rgba(255, 165, 0, 0.05) 15px,
    rgba(0, 0, 0, 0.2) 15px,
    rgba(0, 0, 0, 0.2) 30px
  );
  box-shadow: inset 0 0 15px rgba(255, 100, 0, 0.3);
}

/* Enemy Tagged Status */
.enemy--tagged::before {
  content: "";
  position: absolute;
  top: -8px; left: -8px; right: -8px; bottom: -8px;
  border: 2px dashed rgba(255, 60, 60, 0.8);
  border-radius: 50%;
  animation: slow-spin 4s linear infinite;
  pointer-events: none;
  z-index: -1;
}

/* Tower Overclock Status */
.tower--overclocked {
  filter: drop-shadow(0 0 15px var(--danger));
}
.tower--overclocked .tower__glow {
  opacity: 1;
  background: radial-gradient(circle, rgba(255,50,50,0.8) 0%, transparent 70%);
}
.tower--overheated {
  filter: grayscale(100%) opacity(0.5);
}

/* New Abilities Buttons Layout */
.panel--actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.panel--actions .primary-button {
  flex: 1 1 45%;
}

/* ==========================================================================
   MAP EXPANSION CSS
   ========================================================================== */

/* Update board grid to 16x12 */
.board-grid {
  display: grid;
  grid-template-columns: repeat(16, 1fr);
  grid-template-rows: repeat(12, 1fr);
  gap: 0;
  width: 100%;
  height: 100%;
}

/* Adjust zoom for wider board by forcing a wider aspect ratio container */


@media (max-width: 760px) {
  .board {
    min-height: 35vh; /* slightly shorter to fit 16/12 ratio on mobile */
  }
}

/* ==========================================================================
   MAP DECORATION CLEANUP
   ========================================================================== */

/* Hide the legacy static background elements that don't fit the 16x12 grid */
.map-scene__base,
.map-scene__rock,
.map-scene__ice,
.map-scene__snowbank,
.map-scene__steam,
.map-scene__beacon {
  display: none !important;
}

/* Ensure the SVG path is rendered above the background gradients but below the clickable tiles */
.map-scene__route {
  z-index: 3;
}

/* ==========================================================================
   FINAL VISUAL POLISH
   ========================================================================== */

/* 1. Glowing Network Path */
.map-route__shadow {
  stroke: rgba(126, 236, 255, 0.25);
  stroke-width: 10;
  filter: blur(4px);
}

.map-route__stroke {
  stroke: rgba(164, 255, 245, 0.55);
  stroke-width: 4;
}

.map-route__highlight {
  stroke: #ffffff;
  stroke-width: 2.5;
  stroke-dasharray: 2 6;
  animation: routePacketFlow 2s linear infinite;
  filter: drop-shadow(0 0 6px rgba(164, 255, 245, 0.8));
}

.board--breached .map-scene__route--breach .map-route__shadow {
  stroke: rgba(255, 102, 0, 0.4);
}

.board--breached .map-scene__route--breach .map-route__stroke {
  stroke: rgba(255, 155, 84, 0.8);
}

.board--breached .map-scene__route--breach .map-route__highlight {
  stroke: #ffffff;
  filter: drop-shadow(0 0 6px rgba(255, 155, 84, 0.8));
}

/* 2. Appliance Rack Pads */
.tile--pad::after {
  background: linear-gradient(90deg, #18232c 0%, #202b33 10%, #202b33 90%, #18232c 100%) !important;
  border: 2px solid #3c4c59 !important;
  border-radius: 4px !important;
  box-shadow: 
    inset 0 6px 0 rgba(11, 16, 21, 0.6),
    inset 0 -6px 0 rgba(11, 16, 21, 0.6),
    inset 4px 0 0 rgba(255, 255, 255, 0.05),
    inset -4px 0 0 rgba(255, 255, 255, 0.05) !important;
}

.tile--pad::before {
  content: "";
  position: absolute;
  inset: 15%;
  background: repeating-linear-gradient(180deg, transparent 0, transparent 4px, rgba(0, 0, 0, 0.25) 4px, rgba(0, 0, 0, 0.25) 6px);
  z-index: 1;
  border-radius: 2px;
}

/* Hover state for racks */
.tile--pad:hover::after {
  border-color: #5ab1b8 !important;
  box-shadow: 
    inset 0 6px 0 rgba(11, 16, 21, 0.6),
    inset 0 -6px 0 rgba(11, 16, 21, 0.6),
    inset 4px 0 0 rgba(90, 177, 184, 0.3),
    inset -4px 0 0 rgba(90, 177, 184, 0.3),
    0 0 12px rgba(90, 177, 184, 0.3) !important;
}

/* 3. UI Balance */
.layout {
  grid-template-columns: minmax(0, 1fr) 240px !important;
}

@media (max-width: 860px) {
  .layout {
    grid-template-columns: 1fr !important;
  }
}

