:root {
  --bg: #060914;
  --panel: rgba(8, 13, 28, 0.88);
  --panel-border: #2d4b8f;
  --text: #d9e7ff;
  --accent: #4bd7ff;
  --warn: #ff6f5e;
  --ok: #82f2b2;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 50% 40%, #0e1d3d, #05070d 60%);
}

#game-canvas {
  width: 100vw;
  height: 100vh;
  display: block;
}

#titleScreen {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 38%, rgba(30, 69, 138, 0.32), rgba(3, 5, 10, 0.84) 58%, rgba(1, 2, 5, 0.92));
}

#titleScreen.hidden {
  display: none;
}

#titleCard {
  width: min(560px, 92vw);
  padding: 22px 22px 18px;
  border-radius: 14px;
  border: 1px solid rgba(93, 185, 255, 0.46);
  background: linear-gradient(180deg, rgba(8, 18, 37, 0.9), rgba(5, 11, 24, 0.95));
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
  text-align: center;
}

#titleGameName {
  margin: 0;
  font-size: clamp(1.9rem, 5.2vw, 2.8rem);
  line-height: 1.05;
  letter-spacing: 0.02em;
  color: #e3f1ff;
  margin-bottom: 24px;
}

#titleTagline {
  margin: 10px 0 14px;
  color: #b9d8ff;
  font-size: 0.95rem;
}

.title-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

#titleOptionsPanel {
  border-top: 1px solid rgba(112, 173, 230, 0.35);
  padding-top: 10px;
  text-align: left;
}

.title-options-hint {
  margin: 8px 2px 0;
  font-size: 0.78rem;
  color: #9db6d8;
}

body.title-screen #hud,
body.title-screen #vitalBars,
body.title-screen #enemyIndicators,
body.title-screen #resourceFeed,
body.title-screen #shipQuickPanel,
body.title-screen #lastHitEnemyLabel,
body.title-screen #baseDockTimer,
body.title-screen #combatNotice,
body.title-screen #pauseOverlay,
body.title-screen #damageOverlay,
body.title-screen #bossBarWrap,
body.title-screen #intermissionPanel,
body.title-screen #dockPanel,
body.title-screen #npcStandee,
body.title-screen #endPanel {
  display: none !important;
}

#vitalBars {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: min(78vw, 980px);
  z-index: 34;
  display: grid;
  grid-template-columns: 1fr 130px;
  gap: 8px 12px;
  align-items: center;
}

.vital-line {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  font-size: 0.84rem;
  font-weight: 700;
  color: #d9ecff;
}

#baseVitalText,
#shipVitalText {
  text-align: center;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

#baseVitalLine {
  grid-column: 1;
  grid-row: 1;
}

#shipVitalLine {
  grid-column: 1;
  grid-row: 2;
}

#secondaryStatus {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

#secondaryIcon {
  width: 54px;
  height: 54px;
  border-radius: 10px;
  border: 1px solid rgba(136, 177, 230, 0.8);
  background: rgba(9, 16, 33, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #d8e9ff;
  font-size: 1rem;
}

#secondaryIcon.ready {
  color: #7cffb6;
  border-color: #7cffb6;
}

#secondaryIcon.active {
  color: #9098a9;
  border-color: #73809b;
}

#secondaryText {
  font-size: 0.74rem;
  letter-spacing: 0.02em;
  color: #d1e4ff;
}

.price-inline {
  color: #ffd95f;
  font-weight: 800;
  display: inline-block;
  margin-top: 2px;
}

.vital-track {
  width: 100%;
  height: 14px;
  border: 1px solid rgba(136, 177, 230, 0.7);
  border-radius: 999px;
  background: rgba(5, 10, 20, 0.75);
  overflow: hidden;
}

.vital-fill {
  width: 100%;
  height: 100%;
  background: #4ddf8f;
  transition: width 0.1s linear, background-color 0.15s linear;
}

#dangerFlash {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  background: rgba(255, 18, 18, 0.14);
  animation: dangerPulse 0.75s ease-in-out infinite;
}

#readyFlash {
  position: fixed;
  inset: 0;
  z-index: 49;
  pointer-events: none;
  background: rgba(78, 255, 147, 0.22);
  animation: readyPulse 0.45s ease-out 1;
}

#criticalWarning {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 51;
  color: rgba(255, 47, 47, 0.72);
  font-size: clamp(72px, 14vw, 180px);
  font-weight: 900;
  text-shadow: 0 0 14px rgba(255, 56, 56, 0.55);
  pointer-events: none;
  animation: criticalPulse 0.72s ease-in-out infinite;
}

@keyframes dangerPulse {
  0% { opacity: 0.15; }
  50% { opacity: 0.7; }
  100% { opacity: 0.15; }
}

@keyframes readyPulse {
  0% { opacity: 0.72; }
  100% { opacity: 0; }
}

@keyframes criticalPulse {
  0% { opacity: 0.22; }
  50% { opacity: 0.68; }
  100% { opacity: 0.22; }
}

body.aim-locked #game-canvas {
  cursor: none;
}

#hud {
  position: fixed;
  top: 12px;
  left: 12px;
  min-width: 220px;
  padding: 10px 12px;
  border: 1px solid rgba(75, 215, 255, 0.45);
  background: rgba(0, 0, 0, 0.44);
  backdrop-filter: blur(3px);
  border-radius: 10px;
  z-index: 20;
}

#shipQuickPanel {
  position: fixed;
  top: 12px;
  right: 14px;
  z-index: 35;
  display: grid;
  grid-template-columns: 36px auto 36px;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(86, 207, 255, 0.52);
  background: rgba(4, 12, 26, 0.86);
}

body.combat #shipQuickPanel {
  display: none !important;
}

#quickPrevShipBtn,
#quickNextShipBtn {
  margin: 0;
  padding: 7px 0;
}

#quickShipLabel {
  font-size: 0.84rem;
  font-weight: 800;
  color: #e0efff;
  min-width: 170px;
  text-align: center;
  white-space: nowrap;
}

#lastHitEnemyLabel {
  position: fixed;
  top: 96px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 36;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 209, 119, 0.7);
  background: rgba(10, 14, 25, 0.8);
  color: #ffd99a;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

#hangarShipBanner {
  position: fixed;
  z-index: 41;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 4px 14px 5px;
  border: 1px solid rgba(117, 199, 255, 0.45);
  border-radius: 10px;
  background: rgba(8, 15, 31, 0.78);
  color: #eaf4ff;
  font-size: clamp(1.05rem, 2.1vw, 1.55rem);
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-shadow: 0 0 12px rgba(102, 200, 255, 0.34);
  pointer-events: none;
  white-space: nowrap;
}

.hud-row {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 0.96rem;
  font-weight: 700;
}

#audioPanel {
  margin-top: 8px;
  border-top: 1px solid rgba(97, 158, 211, 0.35);
  padding-top: 6px;
  display: none;
  gap: 6px;
}

.audio-line {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 8px;
  align-items: center;
}

#musicMuteBtn,
#sfxMuteBtn {
  margin: 0;
  padding: 5px 6px;
  font-size: 0.74rem;
}

#musicVolume,
#sfxVolume {
  width: 100%;
  margin: 0;
}

.panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(92vw, 580px);
  padding: 20px;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 0 32px rgba(75, 215, 255, 0.12);
  z-index: 40;
}

#intermissionPanel {
  top: auto;
  bottom: 6px;
  transform: translateX(-50%);
  width: min(97vw, 1140px);
  max-height: none;
  overflow: visible;
  padding: 14px;
  transition: left 260ms ease, border-color 260ms ease;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  grid-template-areas:
    "title title"
    "summary summary"
    "credits credits"
    "tabs modeTitle"
    "tabs modeHint"
    "tabs meta"
    "tabs carousel"
    "tabs section"
    "tabs start";
  column-gap: 12px;
  align-items: start;
}

#intermissionPanel.hidden {
  display: none;
}

.panel h1,
.panel h2 {
  margin-top: 0;
}

.ship-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.mode-tabs {
  grid-area: tabs;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 0 4px 0 0;
  align-self: stretch;
  padding: 10px;
  border: 1px solid rgba(86, 207, 255, 0.45);
  border-radius: 10px;
  background: rgba(7, 16, 34, 0.9);
}

.mode-title {
  grid-area: modeTitle;
  font-size: 1.25rem;
  font-weight: 800;
  color: #dff1ff;
  margin: 0 0 4px;
}

.mode-hint {
  font-size: 0.85rem;
  color: #a8c4ea;
  margin-bottom: 8px;
}

#modeHint {
  grid-area: modeHint;
}

#hangarShipMeta {
  grid-area: meta;
}

.ship-carousel {
  grid-area: carousel;
  display: grid;
  grid-template-columns: 54px 1fr 54px;
  gap: 8px;
  margin-bottom: 10px;
  align-items: center;
}

#selectedShipCard {
  border: 1px solid #4f6fb4;
  border-radius: 8px;
  background: #0f1a36;
  padding: 10px 10px;
  min-height: 96px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  text-align: left;
  line-height: 1.28;
}

.merchant-preview {
  border: 1px solid #4f6fb4;
  border-radius: 8px;
  background: #0f1a36;
  padding: 10px;
  margin-bottom: 8px;
  min-height: 64px;
}

.info-thanks-panel {
  min-height: 110px;
  font-size: 1rem;
  line-height: 1.42;
  color: #e8f5ff;
}

.info-thanks-panel strong {
  display: inline-block;
  margin-bottom: 4px;
  font-size: 1.15rem;
  color: #ffd95f;
}

#npcStandee {
  position: fixed;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  z-index: 45;
  pointer-events: none;
}

#npcStandee img {
  width: auto;
  height: min(56vh, 580px);
  object-fit: contain;
}

.npc-standee-quote {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -110%);
  width: 300px;
  border: 1px solid #56cfff;
  border-radius: 12px;
  background: rgba(6, 17, 36, 0.88);
  padding: 10px;
  font-size: 0.9rem;
  color: #d8f3ff;
  box-shadow: 0 0 18px rgba(50, 170, 230, 0.24);
  z-index: 46;
}

.npc-standee-quote::after {
  content: "";
  position: absolute;
  left: 42px;
  bottom: -10px;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 10px solid #56cfff;
}

.shop-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

#intermissionPanel > #panelTitle {
  grid-area: title;
}

#intermissionPanel > #panelSummary {
  grid-area: summary;
  margin: 0 0 8px;
}

#intermissionPanel > #intermissionCredits {
  grid-area: credits;
}

#intermissionPanel > #panelSummary:empty {
  display: none;
}

#waveBriefing {
  grid-column: 1 / -1;
  margin: 2px 0 8px;
  border: 1px solid rgba(86, 207, 255, 0.45);
  border-radius: 10px;
  background: rgba(7, 16, 34, 0.9);
  padding: 10px;
}

.wave-brief-title {
  font-size: 1rem;
  font-weight: 800;
  color: #dff1ff;
}

.wave-brief-summary {
  margin-top: 3px;
  color: #b7d7ff;
  font-size: 0.86rem;
}

.wave-brief-types {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  gap: 6px;
}

.wave-brief-card {
  border: 1px solid rgba(86, 130, 200, 0.6);
  border-radius: 8px;
  background: rgba(11, 23, 48, 0.92);
  padding: 6px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.wave-brief-icon {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.wave-brief-icon.basic { background: #ff5e1f; transform: rotate(45deg); border-radius: 2px; }
.wave-brief-icon.missile { background: #ff2f2f; border-radius: 999px; }
.wave-brief-icon.shieldram { background: #ffd23f; border-radius: 1px; }
.wave-brief-icon.agile { background: #39d7ff; clip-path: polygon(50% 0%, 0% 100%, 100% 100%); border: none; }
.wave-brief-icon.hunter { background: #ff6f3a; border-radius: 50%; box-shadow: 0 0 0 2px rgba(255, 207, 131, 0.6) inset; }
.wave-brief-icon.tank { background: #ff3f92; border-radius: 50%; }
.wave-brief-icon.boss { background: #ffda5e; width: 16px; height: 16px; border-radius: 50%; }

.wave-brief-label {
  font-size: 0.82rem;
  color: #d9ecff;
  line-height: 1.2;
}

.wave-brief-new {
  margin-top: 8px;
  color: #ffe09b;
  font-size: 0.82rem;
}

#hangarSection,
#merchantSection,
#commanderSection,
#infoSection {
  grid-area: section;
}

#startWaveBtn {
  grid-area: start;
  margin-bottom: 0;
}

@media (max-width: 900px) {
  #intermissionPanel {
    grid-template-columns: 1fr;
    grid-template-areas:
      "title"
      "summary"
      "credits"
      "tabs"
      "modeTitle"
      "modeHint"
      "meta"
      "carousel"
      "section"
      "start";
    width: min(96vw, 980px);
  }

  .mode-tabs {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

button,
select {
  width: 100%;
  margin-bottom: 8px;
  border-radius: 8px;
  border: 1px solid #4f6fb4;
  padding: 10px 8px;
  color: var(--text);
  background: #111c39;
}

#invertYBtn {
  width: auto;
  min-width: 110px;
  margin: 0;
  padding: 6px 8px;
}

button:hover {
  background: #1a2a54;
  cursor: pointer;
}

button:disabled {
  opacity: 0.44;
  border-color: #3a4c78;
  background: #0d1730;
  color: #8da1c7;
  cursor: not-allowed;
}

.current-ship-accent {
  color: #ffd95f;
  font-weight: 900;
  text-shadow: 0 0 12px rgba(255, 228, 120, 0.6);
}

.primary {
  border-color: #37c6f2;
  background: #1d5084;
  font-weight: 600;
}

button.danger {
  border-color: rgba(255, 82, 82, 0.7);
  background: linear-gradient(180deg, rgba(85, 16, 16, 0.92), rgba(50, 10, 10, 0.95));
  color: #ffd7d7;
}

.hidden {
  display: none;
}

#resourceFeed {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 35;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}

.gain-popup {
  font-weight: 700;
  color: #ffdb58;
  text-shadow: 0 0 10px rgba(255, 219, 88, 0.5);
  animation: fadeUp 0.9s ease-out forwards;
}

@keyframes fadeUp {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-12px);
  }
}

#enemyIndicators {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 30;
}

.enemy-arrow {
  position: absolute;
  width: 0;
  height: 0;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-bottom: 18px solid #ff6f5e;
  transform-origin: 50% 80%;
  filter: drop-shadow(0 0 6px rgba(255, 111, 94, 0.7));
}

.enemy-arrow::before {
  content: attr(data-role);
  position: absolute;
  left: -4px;
  top: -13px;
  font-size: 8px;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.85);
}

.enemy-arrow.shooter {
  border-left-width: 8px;
  border-right-width: 8px;
  border-bottom-width: 16px;
}

.enemy-arrow.rammer {
  border-left-width: 11px;
  border-right-width: 11px;
  border-bottom-width: 23px;
  animation: rammerPulse 0.8s ease-in-out infinite;
}

.enemy-arrow.rammer::after {
  content: "!";
  position: absolute;
  left: -3px;
  top: -18px;
  font-size: 10px;
  font-weight: 900;
  color: #fff3cb;
  text-shadow: 0 0 8px rgba(255, 90, 90, 0.8);
}

.enemy-arrow.missile {
  border-bottom-color: #ff3058;
  filter: drop-shadow(0 0 11px rgba(255, 48, 88, 0.95));
}

.enemy-arrow.shieldram {
  border-bottom-color: #ffc950;
  filter: drop-shadow(0 0 11px rgba(255, 201, 80, 0.95));
}

.enemy-arrow.playerram {
  border-bottom-color: #ff2b9e;
  filter: drop-shadow(0 0 12px rgba(255, 43, 158, 0.95));
}

.enemy-arrow.playerram {
  border-left-width: 13px;
  border-right-width: 13px;
  border-bottom-width: 28px;
  animation: rammerPulse 0.45s ease-in-out infinite;
}

.enemy-arrow.playerram.imminent {
  border-left-width: 16px;
  border-right-width: 16px;
  border-bottom-width: 34px;
  filter: drop-shadow(0 0 16px rgba(255, 82, 140, 1));
  animation: rammerPulse 0.3s ease-in-out infinite;
}

.enemy-arrow.agile {
  border-bottom-color: #ff8f2a;
}

.enemy-arrow.hunter {
  border-bottom-color: #ff4f86;
}

.enemy-arrow.tank {
  border-bottom-color: #ff6fa5;
}

@keyframes rammerPulse {
  0% { opacity: 0.72; filter: brightness(0.9) drop-shadow(0 0 8px rgba(255, 88, 64, 0.8)); }
  50% { opacity: 1; filter: brightness(1.22) drop-shadow(0 0 13px rgba(255, 88, 64, 1)); }
  100% { opacity: 0.72; filter: brightness(0.9) drop-shadow(0 0 8px rgba(255, 88, 64, 0.8)); }
}

.enemy-arrow.boss {
  border-bottom-color: #ffea86;
  border-left-width: 14px;
  border-right-width: 14px;
  border-bottom-width: 30px;
  filter: drop-shadow(0 0 16px rgba(255, 234, 134, 1));
}

#combatNotice {
  position: fixed;
  top: 84px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 38;
  padding: 10px 14px;
  border: 1px solid rgba(124, 222, 255, 0.6);
  border-radius: 10px;
  background: rgba(4, 13, 28, 0.85);
  color: #d9f6ff;
  font-weight: 700;
  letter-spacing: 0.02em;
}

#combatNotice.wave-clear {
  top: 76px;
  font-size: 1.05rem;
  border-color: rgba(255, 232, 145, 0.92);
  color: #fff4bf;
  box-shadow: 0 0 26px rgba(255, 224, 117, 0.42);
}

#baseDockTimer {
  position: fixed;
  z-index: 37;
  transform: translate(-50%, -120%);
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid rgba(124, 222, 255, 0.65);
  background: rgba(4, 13, 28, 0.86);
  color: #d9f6ff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  pointer-events: none;
  white-space: nowrap;
}

#dockPanel {
  width: min(90vw, 560px);
  z-index: 46;
}

#dockShipInfo {
  border: 1px solid #4f6fb4;
  border-radius: 8px;
  background: #0f1a36;
  padding: 10px;
  min-height: 78px;
  line-height: 1.3;
}

.dock-transfer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: end;
  margin: 10px 0;
}

.dock-transfer label {
  grid-column: 1 / span 2;
  font-size: 0.9rem;
  color: #c7dfff;
}

.dock-transfer input {
  width: 100%;
  border-radius: 8px;
  border: 1px solid #4f6fb4;
  background: #101b36;
  color: #dff0ff;
  padding: 10px 8px;
}

#pauseOverlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(2, 6, 14, 0.84);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #e1efff;
  text-align: left;
}

#pauseOverlay > * {
  position: relative;
  z-index: 2;
}

#pauseOverlay.hidden {
  display: none;
}

#pauseOverlay h2 {
  margin: 0 0 8px;
}

#pauseOverlay p {
  margin: 0 0 14px;
  opacity: 0.9;
}

.pause-actions {
  display: flex;
  gap: 10px;
  margin: 0 0 10px;
}

#pauseResumeBtn {
  min-width: 220px;
  padding: 14px 18px;
  font-size: 1.06rem;
  font-weight: 800;
}

.pause-actions.hidden {
  display: none !important;
}

#pauseRadarTitle {
  max-width: min(92vw, 1160px);
  margin: 0 0 8px;
  color: #ffdfa0;
  font-weight: 700;
  font-size: 0.95rem;
}

#pauseRadarTitle.hidden {
  display: none !important;
}

#pauseCommanderLine {
  max-width: min(92vw, 1160px);
  margin: 0 0 4px;
  padding-right: min(22vw, 250px);
  color: #d8ecff;
  font-size: 1.02rem;
  line-height: 1.36;
}

#pauseCommanderImg {
  position: absolute;
  right: min(4vw, 56px);
  bottom: 2px;
  width: auto;
  height: min(74vh, 680px);
  object-fit: contain;
  margin: 0;
  filter: drop-shadow(0 0 16px rgba(86, 207, 255, 0.28));
  pointer-events: none;
  z-index: 1 !important;
}

#pauseNewContactLine {
  max-width: min(92vw, 1160px);
  margin: 0 0 10px;
  padding-right: min(22vw, 250px);
  color: #ffb35f;
  font-weight: 800;
  font-size: 0.98rem;
  line-height: 1.3;
}

.pause-enemy-list {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
  width: min(92vw, 1160px);
  padding-right: min(22vw, 250px);
  margin: 0 0 12px;
}

.pause-enemy-card {
  border: 1px solid rgba(86, 207, 255, 0.45);
  border-radius: 9px;
  background: rgba(8, 18, 38, 0.86);
  padding: 8px 9px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pause-enemy-icon {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  flex: 0 0 auto;
}

.pause-enemy-icon.basic { background: #ff7a1c; transform: rotate(45deg); border-radius: 2px; border-color: rgba(255,255,255,0.4); }
.pause-enemy-icon.missile { background: #ff3058; border-radius: 999px; }
.pause-enemy-icon.shieldram { background: #ffc950; border-radius: 1px; }
.pause-enemy-icon.agile { background: #39d7ff; clip-path: polygon(50% 0%, 0% 100%, 100% 100%); border: none; }
.pause-enemy-card { cursor: help; }
.pause-enemy-icon.hunter { background: #ffb14a; border-radius: 50%; box-shadow: 0 0 0 2px rgba(255, 207, 131, 0.6) inset; }
.pause-enemy-icon.tank { background: #ff6fa5; border-radius: 50%; }
.pause-enemy-icon.boss { background: #ffea86; border-radius: 50%; width: 18px; height: 18px; }
.pause-enemy-icon.playerram { background: #ff2b9e; border-radius: 999px; }

.pause-enemy-icon.new {
  animation: enemySpin 2.2s linear infinite;
}

@keyframes enemySpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.pause-grid {
  display: grid;
  grid-template-columns: 130px 260px;
  gap: 6px 12px;
  background: rgba(10, 19, 40, 0.78);
  border: 1px solid rgba(86, 207, 255, 0.55);
  border-radius: 10px;
  padding: 12px;
}

.pause-grid.hidden {
  display: none !important;
}

#damageOverlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 36;
}

.damage-popup {
  position: absolute;
  transform: translate(-50%, -50%);
  color: #ffd88f;
  font-weight: 800;
  font-size: 0.92rem;
  text-shadow: 0 0 10px rgba(255, 132, 86, 0.7);
  white-space: nowrap;
  animation: damageRise 0.55s ease-out forwards;
}

@keyframes damageRise {
  from { opacity: 0.1; transform: translate(-50%, -50%) scale(0.9); }
  to { opacity: 1; transform: translate(-50%, -125%) scale(1.03); }
}

#intermissionCredits {
  margin: 0 0 10px;
  color: #ffd95f;
  font-weight: 700;
}

#bossBarWrap {
  position: fixed;
  top: 124px;
  left: 50%;
  transform: translateX(-50%);
  width: min(80vw, 760px);
  z-index: 39;
}

#bossBarLabel {
  text-align: center;
  font-weight: 800;
  font-size: 1.04rem;
  margin-bottom: 6px;
  color: #ffe88e;
  text-shadow: 0 0 10px rgba(255, 187, 87, 0.45);
}

#bossBarTrack {
  width: 100%;
  height: 22px;
  border: 1px solid #a36c1f;
  border-radius: 999px;
  background: rgba(25, 14, 5, 0.8);
  overflow: hidden;
}

#bossBarFill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #f39b2c, #ffe08d);
}

#victoryImage {
  width: min(92%, 520px);
  max-height: 36vh;
  object-fit: contain;
  display: block;
  margin: 8px auto 10px;
}

#victoryImage.hidden {
  display: none;
}

@media (max-width: 1220px) {
  #npcStandee {
    left: calc(50% + 360px);
  }
}
