.combat-panel {
  width: min(100%, 440px);
}

.combat-panel h2 {
  margin-bottom: 8px;
}

.combat-stage {
  position: relative;
  width: 100%;
  height: clamp(240px, 38vh, 390px);
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid rgba(111, 224, 255, 0.22);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(8, 25, 36, 0.92), rgba(3, 10, 16, 0.96));
  box-shadow: inset 0 0 55px rgba(71, 203, 240, 0.04);
}

.combat-stage::before {
  content: "SPAWN";
  position: absolute;
  top: 6px;
  left: 10px;
  z-index: 2;
  color: rgba(164, 224, 239, 0.35);
  font-size: 0.52rem;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.combat-stage::after {
  content: "DEFENSE LINE";
  position: absolute;
  bottom: 6px;
  right: 10px;
  z-index: 2;
  color: rgba(164, 224, 239, 0.35);
  font-size: 0.52rem;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.combat-stage__grid,
.combat-stage__entities {
  position: absolute;
  inset: 0;
}

.combat-stage__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.combat-stage__grid span {
  border-left: 1px dashed rgba(102, 231, 255, 0.14);
  background: linear-gradient(180deg, transparent, rgba(102, 231, 255, 0.025), transparent);
}

.combat-stage__grid span:last-child {
  border-right: 1px dashed rgba(102, 231, 255, 0.14);
}

.combat-stage__entities {
  pointer-events: none;
}

.combat-projectile {
  position: absolute;
  width: 7px;
  height: 16px;
  border-radius: 999px;
  background: #b9f8ff;
  box-shadow: 0 0 12px #66e7ff, 0 0 24px rgba(102, 231, 255, 0.45);
  transform: translate(-50%, -50%);
  transform-origin: center;
}

.combat-projectile--pulse {
  width: 3px;
  height: 24px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff 0 18%, #b9f8ff 35%, #66e7ff 100%);
  box-shadow: 0 0 8px #66e7ff, 0 0 18px rgba(102,231,255,.52);
}

.combat-projectile--pulse::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 70%;
  width: 1px;
  height: 18px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(102,231,255,.72), transparent);
}

.combat-projectile--nova {
  width: 13px;
  height: 13px;
  border: 2px solid rgba(255,243,193,.86);
  border-radius: 50%;
  background: radial-gradient(circle, #fff6cf 0 18%, #ffb85c 35%, #e66f2b 72%, #6b2a0c 100%);
  box-shadow: 0 0 10px #ffb85c, 0 0 24px rgba(255,132,60,.48);
}

.combat-projectile--nova::after {
  content: "";
  position: absolute;
  inset: -6px;
  border: 1px solid rgba(255,184,92,.48);
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(255,184,92,.28);
}

.combat-projectile--cryo {
  width: 11px;
  height: 17px;
  border-radius: 2px;
  clip-path: polygon(50% 0, 100% 36%, 82% 100%, 18% 100%, 0 36%);
  background: linear-gradient(180deg, #f3f6ff 0 10%, #b7c6ff 24%, #8097ff 58%, #4b5fba 100%);
  box-shadow: 0 0 9px #8fa9ff, 0 0 22px rgba(143,169,255,.46);
}

.combat-projectile--cryo::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 74%;
  width: 7px;
  height: 15px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(143,169,255,.48), transparent);
  filter: blur(2px);
}

.combat-controls {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(90px, 0.42fr);
  gap: 9px;
}

.pause-action {
  min-height: 52px;
  border: 1px solid rgba(157, 123, 255, 0.28);
  border-radius: 14px;
  background: rgba(65, 44, 110, 0.22);
  color: #ddd2ff;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.pause-action:disabled,
.primary-action:disabled {
  opacity: 0.48;
}

.primary-action:not(:disabled) {
  cursor: pointer;
  border-color: rgba(102, 231, 255, 0.42);
  background: linear-gradient(180deg, rgba(47, 150, 171, 0.33), rgba(23, 83, 98, 0.38));
  color: #e8fcff;
}

.core-node--hit {
  animation: core-hit-pulse 220ms ease-out;
}

@keyframes core-hit-pulse {
  0% { transform: translateX(-50%) scale(1); filter: none; }
  35% { transform: translateX(-50%) scale(1.16); filter: brightness(1.8); }
  100% { transform: translateX(-50%) scale(1); filter: none; }
}

@media (max-width: 720px) {
  .combat-panel {
    max-width: 360px;
    justify-self: center;
    text-align: center;
  }

  .combat-panel > p,
  .combat-panel .unit-legend {
    display: none;
  }

  .combat-stage {
    height: clamp(170px, 27vh, 245px);
    margin-top: 10px;
  }

  .combat-controls {
    grid-template-columns: 1fr 0.38fr;
  }

  .pause-action {
    min-height: 48px;
  }

  .combat-projectile--pulse { height: 20px; }
  .combat-projectile--nova { width: 11px; height: 11px; }
  .combat-projectile--cryo { width: 9px; height: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .core-node--hit { animation: none; }
}
