/* VYTHERIS: Last Signal — Core Styles */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Share+Tech+Mono&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --cyan:    #4fc3f7;
  --red:     #e84040;
  --green:   #4caf80;
  --gold:    #f0a840;
  --purple:  #9c4dcc;
  --dark-bg: rgba(0, 4, 12, 0.92);
  --panel:   rgba(4, 12, 24, 0.88);
  --border:  rgba(79, 195, 247, 0.25);
}

body {
  background: #000;
  overflow: hidden;
  font-family: 'Share Tech Mono', 'Courier New', Courier, monospace;
  color: #c8d8e8;
  user-select: none;
}

#game-container {
  position: relative;
  width: 100vw;
  height: 100vh;
}

/* Global scanline overlay for atmosphere */
#game-container::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.07) 2px,
    rgba(0, 0, 0, 0.07) 4px
  );
  pointer-events: none;
  z-index: 999;
}

#game-canvas {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  image-rendering: pixelated;
  cursor: none;
}

/* ── HUD ─────────────────────────────────────────── */
#hud {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Health Bar */
#hud-top-left {
  position: absolute;
  top: 14px;
  left: 14px;
  min-width: 200px;
  max-width: 280px;
  z-index: 10;
}

#health-bar-container {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 2px solid var(--green);
  padding: 5px 8px;
  border-radius: 2px;
  box-shadow: 0 0 12px rgba(76, 175, 128, 0.2), inset 0 0 8px rgba(0,0,0,0.5);
}

#health-bar-label {
  font-family: 'Orbitron', monospace;
  font-size: 9px;
  font-weight: 700;
  color: var(--green);
  letter-spacing: 3px;
  min-width: 20px;
  text-shadow: 0 0 8px var(--green);
}

#health-bar-bg {
  flex: 1;
  height: 10px;
  background: rgba(0, 10, 5, 0.8);
  border: 1px solid rgba(76, 175, 128, 0.3);
  border-radius: 1px;
  overflow: hidden;
  min-width: 100px;
  position: relative;
}

#health-bar-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #1a6b3a, #4caf80, #7dffbb);
  transition: width 0.15s ease, background 0.3s ease;
  border-radius: 1px;
  box-shadow: 0 0 6px rgba(76, 175, 128, 0.5);
  position: relative;
}

/* Segmented dividers on health bar */
#health-bar-fill::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(
    90deg,
    transparent 0%,
    transparent calc(10% - 1px),
    rgba(0,0,0,0.4) calc(10% - 1px),
    rgba(0,0,0,0.4) 10%
  );
}

#health-bar-fill.critical {
  background: linear-gradient(90deg, #5a0a0a, #e84040, #ff6060);
  animation: pulse-critical 0.7s infinite alternate;
  box-shadow: 0 0 12px rgba(232, 64, 64, 0.7);
}

@keyframes pulse-critical {
  from { opacity: 0.7; box-shadow: 0 0 8px rgba(232, 64, 64, 0.5); }
  to   { opacity: 1.0; box-shadow: 0 0 16px rgba(232, 64, 64, 0.9); }
}

#health-bar-text {
  font-size: 9px;
  color: #aaccaa;
  min-width: 52px;
  text-align: right;
  letter-spacing: 1px;
  font-family: 'Orbitron', monospace;
}

/* Revive Charges */
#revive-charges {
  display: flex;
  gap: 5px;
  margin-bottom: 5px;
  padding: 3px 6px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 2px;
  width: fit-content;
}

.revive-icon {
  font-size: 14px;
  color: var(--cyan);
  text-shadow: 0 0 10px var(--cyan);
  transition: color 0.3s, text-shadow 0.3s;
}

.revive-icon.consumed {
  color: #1a1a2a;
  text-shadow: none;
}

.revive-icon.last {
  color: var(--red);
  text-shadow: 0 0 10px var(--red);
  animation: pulse-critical 0.6s infinite alternate;
}

/* Status effects */
#status-effects {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  max-width: 200px;
}

.status-icon {
  font-size: 13px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 2px;
  padding: 2px 5px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

/* Minimap */
#hud-top-right {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

#minimap-container {
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 3px;
  box-shadow: 0 0 14px rgba(79, 195, 247, 0.15), inset 0 0 6px rgba(0,0,0,0.6);
}

#minimap-canvas {
  display: block;
}

/* Center top — wave / objectives */
#hud-top-center {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  z-index: 10;
}

#wave-counter {
  font-family: 'Orbitron', monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 4px;
  text-transform: uppercase;
  background: var(--panel);
  padding: 5px 14px;
  border: 1px solid rgba(240, 168, 64, 0.3);
  border-radius: 1px;
  text-shadow: 0 0 12px var(--gold);
  box-shadow: 0 0 16px rgba(240, 168, 64, 0.2);
}

#objective-tracker {
  margin-top: 5px;
  font-size: 9px;
  color: #c8d8e8;
  letter-spacing: 0.5px;
  width: 166px;
  max-height: 160px;
  overflow: hidden;
  text-align: left;
}

.objective-item {
  background: rgba(4, 12, 24, 0.85);
  border-left: 2px solid var(--cyan);
  padding: 5px 10px;
  margin-bottom: 3px;
  font-size: 10px;
  letter-spacing: 1px;
  box-shadow: 0 0 8px rgba(79, 195, 247, 0.1);
  backdrop-filter: blur(2px);
}

.objective-item.complete {
  border-left-color: var(--green);
  color: #7ec8a0;
  text-decoration: line-through;
}

/* Bottom HUD */
#hud-bottom {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: flex-end;
  gap: 14px;
  z-index: 10;
}

#weapon-slots {
  display: flex;
  gap: 5px;
}

.weapon-slot {
  background: var(--panel);
  border: 1px solid rgba(79, 195, 247, 0.2);
  border-radius: 2px;
  padding: 6px 10px;
  min-width: 74px;
  text-align: center;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-shadow: inset 0 0 8px rgba(0,0,0,0.5);
}

.weapon-slot.active {
  border-color: var(--cyan);
  background: rgba(0, 50, 80, 0.85);
  box-shadow: 0 0 12px rgba(79, 195, 247, 0.3), inset 0 0 8px rgba(0,0,0,0.5);
}

.weapon-slot.melee {
  border-color: rgba(200, 120, 64, 0.3);
  min-width: 56px;
}

.weapon-slot.melee.active {
  border-color: #c87840;
  box-shadow: 0 0 12px rgba(200, 120, 64, 0.3);
}

.weapon-slot-key {
  font-family: 'Orbitron', monospace;
  font-size: 8px;
  color: rgba(79, 195, 247, 0.5);
  margin-bottom: 1px;
  letter-spacing: 1px;
}

.weapon-slot-type {
  font-family: 'Orbitron', monospace;
  font-size: 7px;
  font-weight: 700;
  color: rgba(79, 195, 247, 0.4);
  letter-spacing: 2px;
  margin-bottom: 2px;
  min-height: 9px;
}

.weapon-slot-name {
  font-size: 10px;
  color: #c8d8e8;
  font-weight: bold;
  margin-bottom: 2px;
  letter-spacing: 1px;
}

.weapon-slot-ammo {
  font-size: 9px;
  color: #6a8aaa;
  letter-spacing: 1px;
}

/* Reload state — amber border + subtle pulse on non-active slots */
.weapon-slot.reloading:not(.active) {
  border-color: rgba(240, 168, 64, 0.45);
  animation: slotReloadPulse 0.75s ease-in-out infinite alternate;
}
.weapon-slot.reloading:not(.active) .weapon-slot-ammo {
  color: #f0a840;
  letter-spacing: 1px;
}
.weapon-slot.reloading.active .weapon-slot-ammo {
  color: #f0a840;
}
@keyframes slotReloadPulse {
  from { box-shadow: inset 0 0 8px rgba(0,0,0,0.5); }
  to   { box-shadow: 0 0 10px rgba(240,168,64,0.22), inset 0 0 8px rgba(0,0,0,0.5); }
}

/* Low-ammo warning on inactive slots */
.weapon-slot.low-ammo:not(.active):not(.reloading) {
  animation: slotLowAmmoPulse 0.55s ease-in-out infinite alternate;
}
.weapon-slot.low-ammo:not(.active):not(.reloading) .weapon-slot-ammo {
  color: #ff5500;
}
@keyframes slotLowAmmoPulse {
  from { border-color: rgba(255, 80, 0, 0.28); box-shadow: inset 0 0 8px rgba(0,0,0,0.5); }
  to   { border-color: rgba(255, 80, 0, 0.65); box-shadow: 0 0 9px rgba(255,70,0,0.28), inset 0 0 8px rgba(0,0,0,0.5); }
}

#grenade-count {
  background: var(--panel);
  border: 1px solid rgba(240, 168, 64, 0.3);
  border-radius: 2px;
  padding: 6px 10px;
  font-size: 14px;
  color: var(--gold);
  text-align: center;
  text-shadow: 0 0 8px var(--gold);
  box-shadow: 0 0 10px rgba(240, 168, 64, 0.15);
  transition: border-color 0.3s, box-shadow 0.3s;
}

@keyframes grenadeEmptyPulse {
  0%   { border-color: rgba(255, 68, 68, 0.25); box-shadow: 0 0 6px rgba(255,68,68,0.12); }
  50%  { border-color: rgba(255, 68, 68, 0.75); box-shadow: 0 0 12px rgba(255,68,68,0.45); }
  100% { border-color: rgba(255, 68, 68, 0.25); box-shadow: 0 0 6px rgba(255,68,68,0.12); }
}

#grenade-count.grenade-empty {
  border-color: rgba(255, 68, 68, 0.5);
  animation: grenadeEmptyPulse 1.4s ease-in-out infinite;
  text-shadow: none;
}

#ammo-counter {
  background: var(--panel);
  border: 1px solid rgba(79, 195, 247, 0.2);
  border-radius: 2px;
  padding: 6px 14px;
  font-size: 22px;
  font-weight: bold;
  color: #e8f0ff;
  text-align: center;
  min-width: 90px;
  font-family: 'Orbitron', monospace;
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(255,255,255,0.3);
  box-shadow: 0 0 10px rgba(79, 195, 247, 0.1);
}

#ammo-sep {
  color: #2a4a6a;
  font-size: 14px;
  letter-spacing: 0;
}

#ammo-reserve {
  color: #6a8aaa;
  font-size: 13px;
  letter-spacing: 0;
}

/* Buy Ammo Button */
#buy-ammo-btn {
  background: rgba(10, 30, 15, 0.88);
  border: 1px solid rgba(68, 200, 100, 0.5);
  border-radius: 4px;
  padding: 6px 10px;
  font-family: 'Orbitron', monospace;
  font-size: 9px;
  font-weight: bold;
  color: #66dd99;
  cursor: pointer;
  letter-spacing: 1px;
  text-shadow: 0 0 6px #44cc66;
  box-shadow: 0 0 8px rgba(68, 200, 100, 0.15);
  transition: opacity 0.15s, border-color 0.15s;
  white-space: nowrap;
}
#buy-ammo-btn:hover:not(:disabled) {
  border-color: rgba(100, 255, 140, 0.8);
  background: rgba(15, 50, 25, 0.9);
}
#buy-ammo-btn:disabled {
  opacity: 0.35;
  cursor: default;
  color: #446655;
  text-shadow: none;
  border-color: rgba(68, 200, 100, 0.15);
}

/* XP Bar */
#xp-bar-container {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: rgba(10, 10, 24, 0.9);
  border-top: 1px solid rgba(64, 128, 208, 0.2);
}

#xp-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #0e2560, #2060c0, #4fc3f7);
  transition: width 0.4s ease;
  box-shadow: 0 0 6px rgba(79, 195, 247, 0.6);
}

/* Reload indicator */
#reload-indicator {
  position: absolute;
  bottom: 148px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Orbitron', monospace;
  font-size: 11px;
  letter-spacing: 4px;
  color: var(--gold);
  background: var(--panel);
  padding: 5px 16px;
  border: 1px solid rgba(240, 168, 64, 0.4);
  border-radius: 1px;
  animation: reload-blink 0.45s infinite alternate;
  text-shadow: 0 0 10px var(--gold);
  box-shadow: 0 0 14px rgba(240, 168, 64, 0.2);
}

@keyframes reload-blink {
  from { opacity: 0.5; }
  to   { opacity: 1.0; }
}

/* Overlay screens */
#overlay-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent; /* canvas provides all background art */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

/* Very subtle scanlines over the canvas art */
#overlay-screen::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0, 0, 0, 0.06) 3px,
    rgba(0, 0, 0, 0.06) 6px
  );
  pointer-events: none;
}

#overlay-content {
  max-width: 520px;
  width: 90%;
  text-align: center;
  position: relative;
  z-index: 1;
}

#overlay-content.scrollable {
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(60,100,140,0.5) transparent;
}

/* Down state overlay */
.down-state-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  border-radius: 0;
}

/* Utility */
.hidden {
  display: none !important;
}

/* Damage flash */
.damage-flash {
  animation: dmg-flash 0.12s ease-out;
}

@keyframes dmg-flash {
  0%   { opacity: 1; }
  50%  { opacity: 0.35; }
  100% { opacity: 1; }
}

/* ── Menu / Overlay Text Styles ─────────────────────────────── */
.menu-title {
  font-family: 'Orbitron', monospace;
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 6px;
  text-transform: uppercase;
  color: #d8ecff;
  text-shadow:
    0 0 18px #4fc3f7,
    0 0 42px rgba(79, 195, 247, 0.55),
    0 0 90px rgba(40, 140, 220, 0.25);
  margin-bottom: 6px;
  animation: title-flicker 8s infinite;
}

/* Gentle slow shimmer — the old rapid double-dip flicker was a
   photosensitivity hazard; keep any opacity change slow and shallow. */
@keyframes title-flicker {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.9; }
}

.menu-subtitle {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  color: rgba(110, 180, 230, 0.6);
  letter-spacing: 5px;
  margin-bottom: 36px;
  text-transform: uppercase;
}

.menu-btn {
  display: block;
  width: 260px;
  margin: 8px auto;
  padding: 12px 16px;
  background: linear-gradient(180deg, rgba(6, 16, 30, 0.92), rgba(3, 9, 20, 0.92));
  border: 1px solid rgba(79, 195, 247, 0.28);
  border-left: 3px solid #4fc3f7;
  color: #a9c8e2;
  font-family: 'Orbitron', monospace;
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  cursor: pointer;
  pointer-events: all;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, color 0.15s, transform 0.15s;
  position: relative;
  overflow: hidden;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}

.menu-btn::before {
  content: '';
  position: absolute;
  left: 0; top: 0;
  width: 3px; height: 100%;
  background: #4fc3f7;
  box-shadow: 0 0 8px #4fc3f7;
}

/* scan sweep on hover */
.menu-btn::after {
  content: '';
  position: absolute;
  top: 0; left: -80%;
  width: 55%; height: 100%;
  background: linear-gradient(105deg, transparent, rgba(140, 215, 255, 0.14), transparent);
  transition: left 0.45s ease;
  pointer-events: none;
}

.menu-btn:hover {
  background: linear-gradient(180deg, rgba(12, 30, 52, 0.95), rgba(6, 18, 36, 0.95));
  border-color: #74d4ff;
  color: #e6f5ff;
  box-shadow: 0 0 20px rgba(79, 195, 247, 0.3), inset 0 0 14px rgba(79, 195, 247, 0.07);
  text-shadow: 0 0 10px rgba(120, 210, 255, 0.75);
  transform: translateX(2px);
}
.menu-btn:hover::after { left: 110%; }

/* PLAY button — extra prominent */
#btn-play {
  width: 280px;
  padding: 15px 20px;
  font-size: 13px;
  border-left-width: 4px;
  color: #7fd7ff;
  box-shadow: 0 0 24px rgba(79, 195, 247, 0.22);
  margin-bottom: 14px;
}
#btn-play:hover {
  box-shadow: 0 0 36px rgba(100, 205, 255, 0.42), inset 0 0 18px rgba(100, 205, 255, 0.1);
  color: #c8ecff;
}

.menu-btn.danger {
  border-left-color: var(--red);
  color: #e8aaaa;
  background: rgba(10, 0, 0, 0.88);
}

.menu-btn.danger::before { background: var(--red); box-shadow: 0 0 8px var(--red); }
.menu-btn.danger:hover   { border-color: var(--red); box-shadow: 0 0 18px rgba(232,64,64,0.2); }

/* Menu decorative divider */
.menu-divider {
  width: 200px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  margin: 20px auto;
  opacity: 0.4;
}

/* Menu corner brackets */
#overlay-content::before, #overlay-content::after {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  border-color: rgba(79, 195, 247, 0.45);
  border-style: solid;
}
#overlay-content::before {
  top: -8px; left: -8px;
  border-width: 2px 0 0 2px;
}
#overlay-content::after {
  bottom: -8px; right: -8px;
  border-width: 0 2px 2px 0;
}

/* ── Boss Health Bar ───────────────────────────────── */
#boss-bar {
  position: absolute;
  bottom: 64px;
  left: 50%;
  transform: translateX(-50%);
  width: 520px;
  max-width: 90vw;
  text-align: center;
  pointer-events: none;
  background: rgba(4,0,0,0.92);
  border: 1px solid rgba(204,68,68,0.5);
  border-top: 2px solid rgba(204,68,68,0.8);
  padding: 8px 14px 10px;
  border-radius: 2px;
  box-shadow: 0 0 32px rgba(204,68,68,0.25), inset 0 0 24px rgba(80,0,0,0.4);
  transition: border-color 0.4s, box-shadow 0.4s;
}
#boss-bar.is-phase-2 {
  border-color: rgba(204,136,34,0.6);
  border-top-color: rgba(204,136,34,0.9);
  box-shadow: 0 0 32px rgba(204,136,34,0.25), inset 0 0 24px rgba(60,30,0,0.4);
}
#boss-bar.is-phase-3 {
  border-color: rgba(220,60,0,0.7);
  border-top-color: rgba(220,60,0,1.0);
  box-shadow: 0 0 40px rgba(220,60,0,0.35), inset 0 0 24px rgba(80,20,0,0.5);
}
#boss-bar.is-enraged {
  border-color: rgba(255,100,0,0.8);
  border-top-color: #ff6400;
  box-shadow: 0 0 50px rgba(255,100,0,0.4), inset 0 0 30px rgba(100,30,0,0.5);
  animation: bossBarEnrageGlow 0.8s ease-in-out infinite alternate;
}
@keyframes bossBarEnrageGlow {
  from { box-shadow: 0 0 40px rgba(255,80,0,0.4), inset 0 0 24px rgba(100,30,0,0.5); }
  to   { box-shadow: 0 0 65px rgba(255,120,0,0.6), inset 0 0 36px rgba(140,50,0,0.6); }
}

#boss-bar-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 7px;
}

#boss-name {
  font-family: 'Orbitron', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: #dd5555;
  text-shadow: 0 0 14px #cc4444;
  transition: color 0.4s, text-shadow 0.4s;
}
#boss-bar.is-phase-2 #boss-name { color: #dd9933; text-shadow: 0 0 14px #cc8822; }
#boss-bar.is-phase-3 #boss-name { color: #ff5522; text-shadow: 0 0 18px #ff4400; }
#boss-bar.is-enraged  #boss-name { color: #ff7700; text-shadow: 0 0 22px #ff6600; }

#boss-phase-label {
  font-family: 'Orbitron', monospace;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(180,80,80,0.7);
  transition: color 0.4s;
}
#boss-bar.is-phase-2 #boss-phase-label { color: rgba(200,140,50,0.8); }
#boss-bar.is-phase-3 #boss-phase-label { color: rgba(220,90,40,0.9); }
#boss-bar.is-enraged  #boss-phase-label { color: #ff8800; }

#boss-bar-bg {
  width: 100%;
  height: 14px;
  background: rgba(8,0,0,0.95);
  border: 1px solid rgba(80,20,20,0.9);
  border-radius: 1px;
  overflow: visible;
  position: relative;
}

#boss-bar-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #6a0000, #cc3333, #ff5555);
  transition: width 0.12s ease, background 0.4s;
  border-radius: 1px 0 0 1px;
  box-shadow: 0 0 12px rgba(204,68,68,0.6);
  position: relative;
  overflow: hidden;
}
#boss-bar.is-phase-2 #boss-bar-fill {
  background: linear-gradient(90deg, #6a3000, #cc7722, #ffaa44);
  box-shadow: 0 0 12px rgba(204,136,34,0.6);
}
#boss-bar.is-phase-3 #boss-bar-fill {
  background: linear-gradient(90deg, #6a1400, #cc3300, #ff5500);
  box-shadow: 0 0 16px rgba(255,60,0,0.7);
}
#boss-bar.is-enraged #boss-bar-fill {
  background: linear-gradient(90deg, #7a2200, #dd5500, #ff8800);
  box-shadow: 0 0 20px rgba(255,100,0,0.8);
  animation: bossBarFillPulse 0.6s ease-in-out infinite alternate;
}
@keyframes bossBarFillPulse {
  from { filter: brightness(1.0); }
  to   { filter: brightness(1.3); }
}

#boss-bar-fill::after {
  content: '';
  position: absolute;
  top: 0; left: -100%; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent 40%, rgba(255,255,255,0.08) 60%, transparent 70%);
  animation: bossShimmer 2.4s linear infinite;
}
@keyframes bossShimmer {
  from { transform: translateX(0%); }
  to   { transform: translateX(200%); }
}

.boss-phase-marker {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 2px;
  z-index: 2;
  pointer-events: none;
}
#boss-phase2-marker {
  left: 60%;
  background: rgba(204,136,34,0.9);
  box-shadow: 0 0 4px rgba(204,136,34,0.7);
}
#boss-phase3-marker {
  left: 30%;
  background: rgba(220,60,0,0.9);
  box-shadow: 0 0 4px rgba(220,60,0,0.7);
}

#boss-enrage-indicator {
  margin-top: 5px;
  font-family: 'Orbitron', monospace;
  font-size: 7px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #ff8800;
  text-shadow: 0 0 10px #ff6600;
  animation: enrageFlash 0.5s step-end infinite;
}
@keyframes enrageFlash {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0.35; }
}

/* ── SENTINEL Log Popup ───────────────────────────────── */
#sentinel-log-popup {
  position: absolute;
  bottom: 120px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 480px;
  width: 90%;
  background: rgba(2, 6, 14, 0.97);
  border: 1px solid rgba(79, 195, 247, 0.25);
  border-left: 3px solid var(--cyan);
  padding: 12px 16px;
  font-size: 10px;
  color: var(--cyan);
  letter-spacing: 1px;
  line-height: 1.7;
  pointer-events: none;
  z-index: 80;
  opacity: 0;
  transition: opacity 0.4s ease;
  box-shadow: 0 0 20px rgba(79, 195, 247, 0.1);
}

#sentinel-log-popup.visible  { opacity: 1; }
#sentinel-log-popup.fade-out { opacity: 0; }

/* ── Objective Toast ───────────────────────────────────── */
#objective-toast {
  position: absolute;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(2, 12, 6, 0.97);
  border: 1px solid rgba(76, 175, 128, 0.35);
  border-left: 3px solid var(--green);
  padding: 8px 22px;
  font-family: 'Orbitron', monospace;
  font-size: 10px;
  color: var(--green);
  letter-spacing: 3px;
  pointer-events: none;
  z-index: 80;
  opacity: 0;
  transition: opacity 0.3s ease;
  text-shadow: 0 0 8px var(--green);
  box-shadow: 0 0 14px rgba(76, 175, 128, 0.15);
}

#objective-toast.visible  { opacity: 1; }
#objective-toast.fade-out { opacity: 0; }

/* ── Objective Arrow Overlay ───────────────────────────── */
#objective-arrow-canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 50;
}

/* ── Inventory Sidebar ─────────────────────────────────── */
#inventory-sidebar {
  margin-top: 6px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 6px 8px;
  min-width: 166px;
  max-width: 166px;
  box-shadow: 0 0 10px rgba(79, 195, 247, 0.1), inset 0 0 6px rgba(0,0,0,0.5);
  pointer-events: none;
}

#inventory-sidebar .inv-title {
  font-family: 'Orbitron', monospace;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 3px;
  color: rgba(79, 195, 247, 0.6);
  text-transform: uppercase;
  border-bottom: 1px solid rgba(79, 195, 247, 0.15);
  padding-bottom: 4px;
  margin-bottom: 5px;
}

#inventory-sidebar .inv-row {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 3px;
  font-size: 9px;
  color: #c8d8e8;
  letter-spacing: 1px;
}

#inventory-sidebar .inv-icon {
  width: 14px;
  height: 14px;
  border-radius: 2px;
  background: rgba(153, 68, 204, 0.3);
  border: 1px solid rgba(153, 68, 204, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  flex-shrink: 0;
}

#inventory-sidebar .inv-icon.key   { background: rgba(255, 204, 0, 0.2); border-color: rgba(255,204,0,0.5); }
#inventory-sidebar .inv-icon.shard { background: rgba(79, 195, 247, 0.2); border-color: rgba(79,195,247,0.5); }

#inventory-sidebar .inv-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #aabccc;
}

#inventory-sidebar .inv-count {
  color: var(--cyan);
  font-family: 'Orbitron', monospace;
  font-size: 8px;
}

/* ── Settings Panel ────────────────────────────────────── */
#settings-panel {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: radial-gradient(ellipse at center, rgba(0,8,24,0.96) 0%, rgba(0,0,0,0.99) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  pointer-events: all;
}

#settings-panel.hidden { display: none !important; }

#settings-panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(0,0,0,0.1) 3px, rgba(0,0,0,0.1) 6px);
  pointer-events: none;
}

#settings-content {
  max-width: 480px;
  width: 90%;
  position: relative;
  z-index: 1;
  pointer-events: all;
}

.settings-section {
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--cyan);
  padding: 12px 16px;
  margin-bottom: 10px;
  border-radius: 2px;
}

.settings-section-title {
  font-family: 'Orbitron', monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--cyan);
  text-transform: uppercase;
  margin-bottom: 10px;
  text-shadow: 0 0 8px var(--cyan);
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 10px;
  color: #c8d8e8;
  letter-spacing: 1px;
}

.settings-row:last-child { margin-bottom: 0; }

.settings-label {
  font-size: 10px;
  color: #8a9ab0;
  letter-spacing: 1px;
  flex: 1;
}

.settings-value {
  font-family: 'Orbitron', monospace;
  font-size: 9px;
  color: var(--cyan);
  margin-left: 10px;
  min-width: 36px;
  text-align: right;
}

input[type='range'].settings-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 130px;
  height: 4px;
  background: rgba(79, 195, 247, 0.15);
  border: 1px solid rgba(79, 195, 247, 0.25);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

input[type='range'].settings-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  background: var(--cyan);
  border-radius: 2px;
  box-shadow: 0 0 6px var(--cyan);
  cursor: pointer;
}

input[type='range'].settings-slider::-moz-range-thumb {
  width: 14px; height: 14px;
  background: var(--cyan);
  border: none;
  border-radius: 2px;
  box-shadow: 0 0 6px var(--cyan);
  cursor: pointer;
}

.settings-toggle {
  background: rgba(0, 20, 40, 0.9);
  border: 1px solid rgba(79, 195, 247, 0.3);
  border-radius: 2px;
  color: #6a8aaa;
  font-family: 'Orbitron', monospace;
  font-size: 9px;
  letter-spacing: 2px;
  padding: 4px 10px;
  cursor: pointer;
  pointer-events: all;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.settings-toggle.on {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(0, 50, 80, 0.9);
  box-shadow: 0 0 8px rgba(79, 195, 247, 0.2);
}

.settings-toggle:hover { border-color: var(--cyan); }

.keybind-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 16px;
  font-size: 9px;
}

.keybind-entry {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #8a9ab0;
}

.keybind-key {
  font-family: 'Orbitron', monospace;
  font-size: 8px;
  background: rgba(79, 195, 247, 0.1);
  border: 1px solid rgba(79, 195, 247, 0.3);
  border-radius: 2px;
  padding: 2px 5px;
  color: var(--cyan);
  min-width: 28px;
  text-align: center;
}

/* Pause confirm sub-panel */
.pause-confirm {
  margin-top: 12px;
  background: rgba(40, 0, 0, 0.8);
  border: 1px solid rgba(232, 64, 64, 0.4);
  border-left: 3px solid var(--red);
  padding: 12px 16px;
  border-radius: 2px;
  text-align: center;
}

.pause-confirm p {
  font-size: 10px;
  color: #cc9999;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.pause-confirm-btns {
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* Scanlines disabled via body class */
body.no-scanlines #game-container::after { display: none; }

/* ── Responsive / Mobile ───────────────────────────────── */
/* Canvas draws the fancy health bar at top-left; hide the DOM duplicate */
#health-bar-container { display: none !important; }
/* Shift hud-top-left down slightly to leave space for canvas health bar */
#hud-top-left { padding-top: 28px; }
/* Canvas draws polished ammo counter above weapon slots; hide DOM duplicate */
#ammo-counter { display: none !important; }

@media (max-width: 640px) {
  #hud-top-left {
    max-width: 160px;
  }

  #health-bar-container {
    padding: 4px 6px;
    gap: 5px;
  }

  #health-bar-bg { min-width: 70px; }

  #health-bar-text {
    font-size: 8px;
    min-width: 40px;
  }

  #hud-top-right { top: 8px; right: 8px; }
  #minimap-canvas { width: 100px !important; height: 80px !important; }

  #hud-bottom {
    bottom: 10px;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 100vw;
    padding: 0 6px;
  }

  .weapon-slot {
    min-width: 58px;
    padding: 4px 7px;
  }

  .weapon-slot.melee { min-width: 44px; }

  .weapon-slot-name { font-size: 9px; }
  .weapon-slot-ammo { font-size: 8px; }

  #ammo-counter { font-size: 16px; min-width: 70px; padding: 4px 10px; }

  #grenade-count { font-size: 12px; padding: 4px 8px; }

  #boss-bar { width: 90vw; }

  .menu-title { font-size: 22px; letter-spacing: 3px; }
  .menu-btn   { width: 200px; font-size: 9px; }
}

@media (max-height: 500px) {
  /* Landscape mobile: health stays top-left, weapon slots go bottom-right */
  #hud-top-left { top: 6px; left: 6px; }
  #hud-bottom   { bottom: 6px; }

  #minimap-container { display: none; }

  .weapon-slot { min-width: 50px; padding: 3px 6px; }
  .weapon-slot-name { font-size: 8px; }
}

/* ══════════════════════════════════════════════════════════════
   VYTHERIS v2 — Main Menu / Hub Animations & Layout
   ══════════════════════════════════════════════════════════════ */

@keyframes vyth-title-in {
  from { opacity: 0; transform: translateY(-36px) scale(0.9); filter: blur(10px); }
  to   { opacity: 1; transform: translateY(0)     scale(1);   filter: blur(0); }
}

@keyframes vyth-glow-pulse {
  0%, 100% {
    text-shadow: 0 0 22px #4fc3f7, 0 0 46px rgba(79,195,247,0.5), 0 0 90px rgba(40,140,220,0.22);
  }
  50% {
    text-shadow: 0 0 40px #8adcff, 0 0 80px rgba(120,210,255,0.65), 0 0 140px rgba(60,170,240,0.32);
  }
}

@keyframes vyth-chroma {
  0%   { text-shadow: -2px 0 rgba(255,60,80,0.5),  2px 0 rgba(60,220,255,0.55), 0 0 30px #4fc3f7; }
  25%  { text-shadow:  2px 0 rgba(255,60,80,0.4), -2px 0 rgba(60,220,255,0.45), 0 0 26px #4fc3f7; }
  50%  { text-shadow:  0   0 rgba(0,0,0,0),         0   0 rgba(0,0,0,0),         0 0 46px #8adcff; }
  75%  { text-shadow: -1px 0 rgba(255,90,80,0.32), 1px 0 rgba(60,225,255,0.35), 0 0 28px #4fc3f7; }
  100% { text-shadow: -2px 0 rgba(255,60,80,0.5),  2px 0 rgba(60,220,255,0.55), 0 0 30px #4fc3f7; }
}

@keyframes vyth-fade-up {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes vyth-slide-in {
  from { opacity: 0; transform: translateX(-28px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes hub-panel-in {
  from { opacity: 0; transform: scale(0.97) translateY(14px); }
  to   { opacity: 1; transform: scale(1)    translateY(0); }
}

@keyframes scanner-line {
  0%   { top: -4px; opacity: 0.85; }
  100% { top: 100%; opacity: 0; }
}

/* ── Main Menu Layout ──────────────────────────────────── */
.vyth-menu {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.vyth-title-block {
  margin-bottom: 10px;
  text-align: center;
  animation: vyth-title-in 0.95s cubic-bezier(0.22,1,0.36,1) both;
}

.vyth-title-main {
  font-family: 'Orbitron', monospace;
  font-size: 52px;
  font-weight: 900;
  letter-spacing: 10px;
  text-transform: uppercase;
  color: #eaf6ff;
  line-height: 1;
  animation: vyth-chroma 3.5s ease-in-out infinite, vyth-glow-pulse 2.8s ease-in-out infinite;
}

.vyth-title-sub {
  font-family: 'Orbitron', monospace;
  font-size: 17px;
  font-weight: 400;
  letter-spacing: 13px;
  text-transform: uppercase;
  color: #4fc3f7;
  text-shadow: 0 0 16px #4fc3f7, 0 0 34px rgba(79,195,247,0.4);
  margin-top: 6px;
  animation: vyth-fade-up 1.1s 0.3s cubic-bezier(0.22,1,0.36,1) both;
}

.vyth-lore-text {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  color: rgba(130, 190, 235, 0.62);
  letter-spacing: 1.5px;
  line-height: 1.85;
  margin-bottom: 8px;
  animation: vyth-fade-up 1s 0.55s ease both;
}

/* Signal-strength divider between lore and buttons */
.vyth-signal-divider {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 14px;
  margin: 0 auto 20px;
  animation: vyth-fade-up 1s 0.62s ease both;
}
.vyth-signal-divider span {
  width: 3px;
  background: #4fc3f7;
  box-shadow: 0 0 6px rgba(79,195,247,0.8);
  animation: vyth-signal-bar 1.6s ease-in-out infinite;
}
.vyth-signal-divider span:nth-child(1) { height: 30%; animation-delay: 0s;    }
.vyth-signal-divider span:nth-child(2) { height: 55%; animation-delay: 0.12s; }
.vyth-signal-divider span:nth-child(3) { height: 80%; animation-delay: 0.24s; }
.vyth-signal-divider span:nth-child(4) { height: 100%;animation-delay: 0.36s; }
.vyth-signal-divider span:nth-child(5) { height: 65%; animation-delay: 0.48s; }
@keyframes vyth-signal-bar {
  0%, 100% { opacity: 0.35; transform: scaleY(0.55); transform-origin: bottom; }
  50%      { opacity: 1;    transform: scaleY(1);    transform-origin: bottom; }
}

.vyth-btn-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.vyth-btn-stack .menu-btn:nth-child(1) { animation: vyth-fade-up 0.65s 0.7s  ease both; }
.vyth-btn-stack .menu-btn:nth-child(2) { animation: vyth-fade-up 0.65s 0.82s ease both; }
.vyth-btn-stack .menu-btn:nth-child(3) { animation: vyth-fade-up 0.65s 0.94s ease both; }
.vyth-btn-stack .menu-btn:nth-child(4) { animation: vyth-fade-up 0.65s 1.06s ease both; }

/* ── Class Select Cards ──────────────────────────────── */
.vyth-class-grid {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 12px 0 4px;
}

.vyth-class-card {
  width: 196px;
  padding: 22px 16px 20px;
  background: rgba(0,10,6,0.92);
  border: 1px solid rgba(0,160,50,0.22);
  border-top: 3px solid #44cc66;
  color: #a8d8b8;
  font-family: 'Orbitron', monospace;
  font-size: 13px;
  letter-spacing: 3px;
  text-transform: uppercase;
  cursor: pointer;
  pointer-events: all;
  transition: background 0.18s, border-color 0.18s, box-shadow 0.18s, transform 0.18s;
  position: relative;
  overflow: hidden;
  text-align: center;
  animation: vyth-fade-up 0.65s ease both;
}

.vyth-class-card:nth-child(1) { animation-delay: 0.5s;  border-top-color: #44cc66; }
.vyth-class-card:nth-child(2) { animation-delay: 0.65s; border-top-color: #4fc3f7; }
.vyth-class-card:nth-child(3) { animation-delay: 0.8s;  border-top-color: #ffcc44; }

.vyth-class-card:hover {
  background: rgba(0,25,12,0.96);
  border-color: rgba(0,200,80,0.45);
  box-shadow: 0 0 26px rgba(0,200,60,0.28), inset 0 0 18px rgba(0,200,60,0.06);
  transform: translateY(-4px);
  color: #ccffdd;
}

.vyth-class-card .card-name {
  font-size: 14px;
  font-weight: 700;
  color: #66ff88;
  margin-bottom: 12px;
  letter-spacing: 3px;
}

.vyth-class-card.bastion   .card-name { color: #4fc3f7; }
.vyth-class-card.scavenger .card-name { color: #ffcc44; }

.vyth-class-card:nth-child(2):hover { border-color: rgba(79,195,247,0.45); box-shadow: 0 0 26px rgba(79,195,247,0.22), inset 0 0 18px rgba(79,195,247,0.05); }
.vyth-class-card:nth-child(3):hover { border-color: rgba(255,200,60,0.45); box-shadow: 0 0 26px rgba(255,200,60,0.22), inset 0 0 18px rgba(255,200,60,0.05); }

.vyth-class-card .card-desc {
  font-size: 9px;
  color: #6a8aaa;
  letter-spacing: 1px;
  line-height: 1.65;
  font-family: 'Share Tech Mono', monospace;
  text-transform: none;
}

/* ── Hub v2 ─────────────────────────────────────────── */
#hub-overlay.hub-v2 {
  background: rgba(2,5,10,0.97) !important;
  padding: 0 !important;
  font-family: 'Share Tech Mono', 'Courier New', monospace !important;
  overflow-y: auto !important;
}

#hub-overlay.hub-v2::before {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(0,255,80,0.12), transparent);
  animation: scanner-line 5s linear infinite;
  pointer-events: none;
  z-index: 1;
}

.hub-v2-inner {
  max-width: 740px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 20px 44px;
  animation: hub-panel-in 0.5s ease both;
  position: relative;
  z-index: 2;
}

.hub-header {
  text-align: center;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(0,180,60,0.13);
}

.hub-header-title {
  font-family: 'Orbitron', monospace;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 6px;
  color: #44ee66;
  text-shadow: 0 0 20px #00cc44, 0 0 40px rgba(0,200,60,0.35);
}

.hub-header-sub {
  font-size: 9px;
  letter-spacing: 4px;
  color: rgba(79,195,247,0.5);
  margin-top: 5px;
  text-transform: uppercase;
}

.hub-stats-bar {
  display: flex;
  gap: 0;
  margin-bottom: 16px;
  border: 1px solid rgba(0,160,50,0.18);
  border-left: 3px solid #00cc44;
  background: rgba(0,8,4,0.88);
  animation: vyth-slide-in 0.5s 0.1s ease both;
}

.hub-stat {
  flex: 1;
  padding: 10px 12px;
  border-right: 1px solid rgba(0,100,30,0.18);
}

.hub-stat:last-child { border-right: none; }

.hub-stat-label {
  font-size: 7px;
  color: rgba(79,195,247,0.45);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.hub-stat-value {
  font-size: 14px;
  color: #c8e8d8;
  margin-top: 3px;
  font-family: 'Orbitron', monospace;
}

.hub-nav-v2 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  margin-bottom: 16px;
  animation: vyth-fade-up 0.5s 0.15s ease both;
}

.hub-nav-btn-v2 {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 14px 8px 10px;
  background: rgba(0,10,5,0.9);
  border: 1px solid rgba(0,100,40,0.22);
  border-top: 2px solid rgba(0,160,60,0.35);
  color: #5a9a7a;
  font-family: 'Orbitron', monospace;
  font-size: 9px;
  letter-spacing: 1px;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.15s;
  position: relative;
  overflow: hidden;
  pointer-events: all;
}

.hub-nav-btn-v2:hover {
  background: rgba(0,22,12,0.96);
  border-top-color: #00cc44;
  border-color: rgba(0,160,60,0.4);
  color: #88ffaa;
  box-shadow: 0 0 14px rgba(0,200,60,0.18), inset 0 0 10px rgba(0,200,60,0.05);
}

.hub-nav-btn-v2 .nav-sub {
  display: block;
  font-size: 7px;
  color: rgba(79,195,247,0.4);
  margin-top: 4px;
  font-family: 'Share Tech Mono', monospace;
  letter-spacing: 0;
  text-transform: none;
}

.hub-nav-btn-v2.lockbox {
  border-top-color: rgba(180,140,0,0.55);
  color: #ccaa22;
  background: rgba(10,8,0,0.9);
}

.hub-nav-btn-v2.lockbox:hover {
  border-top-color: #ffcc22;
  color: #ffee66;
  box-shadow: 0 0 14px rgba(200,160,0,0.18);
}

.hub-bestiary-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.hub-bestiary-btn {
  padding: 5px 14px;
  background: transparent;
  border: 1px solid rgba(0,80,30,0.32);
  color: rgba(0,140,60,0.5);
  font-family: 'Share Tech Mono', monospace;
  font-size: 9px;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.15s;
  text-transform: uppercase;
  pointer-events: all;
}

.hub-bestiary-btn:hover {
  border-color: rgba(0,180,60,0.5);
  color: #44cc88;
}

.hub-deploy-section {
  animation: vyth-fade-up 0.5s 0.2s ease both;
}

.hub-section-label {
  font-size: 9px;
  letter-spacing: 3px;
  color: rgba(79,195,247,0.4);
  margin-bottom: 10px;
  text-transform: uppercase;
}

.hub-mission-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  margin-bottom: 5px;
  background: rgba(0,8,4,0.85);
  border: 1px solid rgba(0,80,30,0.22);
  color: #4a8a6a;
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  position: relative;
  pointer-events: all;
}

.hub-mission-item::before {
  content: '';
  position: absolute;
  left: 0; top: 0;
  width: 2px; height: 100%;
  background: transparent;
  transition: background 0.15s, box-shadow 0.15s;
}

.hub-mission-item:hover:not([disabled]) {
  background: rgba(0,18,9,0.95);
  border-color: rgba(0,160,70,0.38);
  color: #88ddaa;
}

.hub-mission-item:hover:not([disabled])::before {
  background: #00cc44;
  box-shadow: 0 0 6px #00cc44;
}

.hub-mission-item[disabled] {
  opacity: 0.28;
  cursor: default;
  pointer-events: none;
}

.hub-mission-item.selected {
  border-color: rgba(79,195,247,0.5);
  color: #c8e8ff;
  background: rgba(0,18,28,0.9);
}

.hub-mission-item.selected::before {
  background: #4fc3f7;
  box-shadow: 0 0 6px #4fc3f7;
}

.hub-mission-desc {
  font-size: 9px;
  color: rgba(80,140,100,0.55);
  margin-top: 2px;
}

.hub-deploy-btn {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 14px;
  background: rgba(0,18,36,0.9);
  border: 1px solid rgba(0,100,160,0.3);
  border-left: 4px solid #4fc3f7;
  color: #4fc3f7;
  font-family: 'Orbitron', monospace;
  font-size: 13px;
  letter-spacing: 4px;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.18s;
  position: relative;
  overflow: hidden;
  pointer-events: all;
}

.hub-deploy-btn:hover:not([disabled]) {
  background: rgba(0,36,66,0.95);
  border-color: rgba(79,195,247,0.6);
  box-shadow: 0 0 28px rgba(79,195,247,0.3), inset 0 0 16px rgba(79,195,247,0.07);
  color: #a8e8ff;
  transform: translateY(-1px);
}

.hub-deploy-btn[disabled] {
  opacity: 0.28;
  cursor: default;
  pointer-events: none;
}

.hub-deploy-btn.green {
  border-left-color: #44cc66;
  color: #44cc66;
  background: rgba(0,18,9,0.9);
  border-color: rgba(0,140,50,0.3);
}

.hub-deploy-btn.green:hover:not([disabled]) {
  background: rgba(0,36,18,0.95);
  border-color: rgba(68,204,102,0.6);
  box-shadow: 0 0 28px rgba(68,204,102,0.3), inset 0 0 16px rgba(68,204,102,0.07);
  color: #88ffaa;
}

.hub-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 14px;
}

.hub-divider-line {
  flex: 1;
  height: 1px;
  background: rgba(0,60,30,0.38);
}

.hub-divider-text {
  font-size: 9px;
  color: rgba(0,120,50,0.4);
  letter-spacing: 2px;
}

.hub-infinite-panel {
  border: 1px solid rgba(0,100,40,0.22);
  padding: 16px;
  background: rgba(0,8,4,0.85);
}

.hub-infinite-panel.locked { opacity: 0.32; }

.hub-infinite-title {
  font-family: 'Orbitron', monospace;
  font-size: 11px;
  letter-spacing: 3px;
  color: #44cc88;
  margin-bottom: 4px;
}

.hub-inf-best {
  font-size: 9px;
  letter-spacing: 2px;
  color: #ffcc44;
  margin-bottom: 6px;
}

.hub-infinite-desc {
  font-size: 9px;
  color: rgba(80,140,100,0.55);
  margin-bottom: 10px;
}

.hub-inf-mods-label {
  font-size: 8px;
  letter-spacing: 2px;
  color: rgba(200,200,200,0.45);
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hub-inf-pp-mul {
  font-size: 9px;
  color: #cc88ff;
  letter-spacing: 1px;
}

.hub-inf-mods-grid {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.hub-inf-mod-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 7px 4px;
  background: rgba(10,20,12,0.9);
  border: 1px solid rgba(40,80,50,0.5);
  color: rgba(100,140,110,0.65);
  font-family: 'Share Tech Mono', monospace;
  cursor: pointer;
  transition: all 0.12s;
  pointer-events: all;
}

.hub-inf-mod-btn:hover:not([disabled]) {
  border-color: rgba(68,200,120,0.55);
  color: #66dd99;
  background: rgba(0,30,15,0.95);
}

.hub-inf-mod-btn[disabled] {
  opacity: 0.3;
  cursor: default;
}

.hub-inf-mod-btn.active {
  border-color: rgba(68,220,100,0.75);
  background: rgba(0,40,20,0.95);
  color: #55ff88;
  box-shadow: 0 0 8px rgba(50,200,80,0.25);
}

.hub-inf-mod-icon { font-size: 13px; line-height: 1; }

.hub-inf-mod-label {
  font-size: 8px;
  letter-spacing: 1px;
  font-weight: bold;
}

.hub-inf-mod-desc {
  font-size: 7px;
  color: rgba(140,180,150,0.55);
  text-align: center;
}

.hub-quit-btn {
  display: block;
  margin: 22px auto 0;
  padding: 8px 26px;
  background: transparent;
  border: 1px solid rgba(80,20,20,0.45);
  color: rgba(140,60,60,0.55);
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  letter-spacing: 2px;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.15s;
  pointer-events: all;
}

.hub-quit-btn:hover {
  border-color: rgba(200,40,40,0.6);
  color: #ee6666;
  box-shadow: 0 0 12px rgba(200,40,40,0.18);
}

/* ── Hub extended ──────────────────────────────────────── */
.hub-nav-btn-v2 .nav-icon {
  font-size: 18px;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.15s;
}
.hub-nav-btn-v2:hover .nav-icon { opacity: 1; }

.hub-badge {
  position: absolute;
  top: 5px; right: 5px;
  min-width: 16px; height: 16px;
  border-radius: 8px;
  font-size: 8px;
  font-family: 'Orbitron', monospace;
  font-weight: 700;
  color: #000;
  display: flex;
  align-items: center; justify-content: center;
  padding: 0 3px;
  pointer-events: none;
  line-height: 1;
}

.hub-nav-btn-v2.has-alert {
  border-top-color: rgba(255,200,50,0.75);
  animation: hub-alert-pulse 2.4s ease-in-out infinite;
}
@keyframes hub-alert-pulse {
  0%, 100% { box-shadow: none; }
  50% { box-shadow: 0 0 12px rgba(255,200,50,0.15), inset 0 0 8px rgba(255,200,50,0.05); }
}

.hub-act-label {
  font-size: 7px;
  letter-spacing: 2px;
  color: rgba(79,195,247,0.28);
  text-transform: uppercase;
  padding: 8px 2px 3px;
  border-top: 1px solid rgba(0,60,30,0.18);
  margin-top: 2px;
}
.hub-act-label:first-child { border-top: none; padding-top: 2px; }

.hub-mission-item.done {
  color: rgba(60,160,80,0.5);
  background: rgba(0,10,4,0.7);
  border-color: rgba(0,50,15,0.18);
}
.hub-mission-item.done::before { background: rgba(30,120,50,0.35); }
.hub-mission-item.done .hub-mission-desc { color: rgba(40,80,50,0.4); }
.hub-mission-item.done:hover:not([disabled]) { color: rgba(80,200,100,0.65); }

.hub-mission-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.hub-mission-status {
  font-size: 10px;
  min-width: 14px;
  flex-shrink: 0;
}
.hub-mission-name {
  flex: 1;
  letter-spacing: 2px;
}
.hub-mission-boss {
  font-size: 8px;
  color: rgba(79,195,247,0.3);
  letter-spacing: 1px;
  font-family: 'Share Tech Mono', monospace;
  text-align: right;
}
.hub-mission-item.done .hub-mission-boss { color: rgba(40,140,60,0.45); }
.hub-mission-item.selected .hub-mission-boss { color: rgba(79,195,247,0.5); }

.hub-deploy-body {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.hub-deploy-left { flex: 3; min-width: 0; }
.hub-deploy-right { flex: 2; min-width: 0; }

.hub-mission-list {
  max-height: 200px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,140,50,0.25) transparent;
  margin-bottom: 8px;
}

.hub-campaign-progress {
  background: rgba(0,8,4,0.85);
  border: 1px solid rgba(0,80,30,0.2);
  padding: 12px 14px;
  margin-top: 10px;
}
.hub-progress-bar {
  height: 4px;
  background: rgba(0,30,10,0.8);
  border-radius: 2px;
  overflow: hidden;
  margin: 6px 0;
}
.hub-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #1a6b3a, #44cc88);
  border-radius: 2px;
  box-shadow: 0 0 6px rgba(68,200,100,0.35);
}

.hub-xp-mini {
  height: 4px;
  background: rgba(0,20,40,0.8);
  border-radius: 2px;
  overflow: hidden;
  margin: 5px 0 2px;
  border: 1px solid rgba(10,40,80,0.4);
}
.hub-xp-mini-fill {
  height: 100%;
  background: linear-gradient(90deg, #1155bb, #44aaff);
  border-radius: 2px;
  box-shadow: 0 0 4px rgba(68,170,255,0.4);
}

.hub-prestige-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 8px 12px;
  background: rgba(16,0,30,0.5);
  border: 1px solid rgba(80,20,120,0.22);
  border-left: 3px solid rgba(100,30,180,0.4);
}
.hub-prestige-shop-btn {
  padding: 6px 14px;
  background: rgba(25,0,45,0.9);
  border: 1px solid rgba(90,25,140,0.5);
  color: #aa66dd;
  font-family: 'Orbitron', 'Courier New', monospace;
  font-size: 8.5px;
  letter-spacing: 2px;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.15s;
  pointer-events: all;
  position: relative;
}
.hub-prestige-shop-btn:hover {
  background: rgba(40,0,70,0.95);
  border-color: rgba(140,50,210,0.65);
  color: #cc88ff;
  box-shadow: 0 0 12px rgba(120,40,200,0.18);
}
.hub-prestige-btn-main {
  padding: 7px 16px;
  background: rgba(30,0,60,0.9);
  border: 1px solid rgba(100,30,180,0.5);
  color: #bb77ee;
  font-family: 'Orbitron', 'Courier New', monospace;
  font-size: 9px;
  letter-spacing: 2px;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.15s;
  pointer-events: all;
}
.hub-prestige-btn-main:hover:not([disabled]) {
  background: rgba(50,0,90,0.95);
  border-color: rgba(160,60,240,0.65);
  color: #dd99ff;
  box-shadow: 0 0 16px rgba(140,50,220,0.22);
}
.hub-prestige-btn-main[disabled] {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

/* ── Prestige tier diamonds & progress ────────────────────────────── */
.prestige-tier-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.prestige-tier-top {
  display: flex;
  align-items: center;
  gap: 14px;
}
.prestige-tier-diamonds {
  display: flex;
  align-items: center;
  gap: 5px;
}
.prestige-diamond {
  font-size: 13px;
  color: rgba(70,25,110,0.4);
  transition: color 0.25s, text-shadow 0.25s;
}
.prestige-diamond.earned {
  color: #cc88ff;
  text-shadow: 0 0 8px rgba(180,80,255,0.55);
}
.prestige-tier-label {
  font-size: 8px;
  letter-spacing: 2px;
  color: rgba(150,80,220,0.55);
  margin-left: 6px;
}
.prestige-pts-label {
  font-size: 9px;
  color: rgba(180,100,240,0.45);
  letter-spacing: 1px;
  white-space: nowrap;
}
.prestige-active-bonuses {
  font-size: 8px;
  color: rgba(160,80,220,0.5);
  letter-spacing: 0.5px;
}
.prestige-lvl-progress {
  display: flex;
  align-items: center;
  gap: 8px;
}
.prestige-lvl-bar {
  width: 72px;
  height: 3px;
  background: rgba(50,15,90,0.45);
  border-radius: 2px;
  overflow: hidden;
  flex-shrink: 0;
}
.prestige-lvl-fill {
  height: 100%;
  background: linear-gradient(90deg, #6622bb, #cc44ff);
  border-radius: 2px;
  transition: width 0.3s ease;
}
.prestige-lvl-label {
  font-size: 8px;
  color: rgba(130,65,195,0.6);
  letter-spacing: 1px;
  white-space: nowrap;
}

/* ── Prestige shop token badge ────────────────────────────────────── */
.prestige-token-badge {
  display: inline-block;
  background: rgba(100,20,155,0.7);
  color: #ff88ff;
  border-radius: 10px;
  padding: 1px 6px;
  font-size: 8.5px;
  margin-left: 4px;
  vertical-align: middle;
}

/* ── Prestige button ready-state & reward badge ───────────────────── */
.hub-prestige-btn-main.ready {
  border-color: rgba(160,60,240,0.65);
  animation: prestigeReadyPulse 2.8s ease-in-out infinite;
}
.hub-prestige-btn-main.ready:hover {
  border-color: rgba(200,90,255,0.85);
  box-shadow: 0 0 20px rgba(140,50,220,0.3);
}
.prestige-reward-badge {
  font-size: 8px;
  color: #ee99ff;
  background: rgba(80,0,140,0.5);
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 6px;
  letter-spacing: 0.5px;
  vertical-align: middle;
}
.prestige-lock-hint {
  font-size: 8px;
  color: rgba(70,25,110,0.5);
  margin-left: 4px;
  letter-spacing: 1px;
  vertical-align: middle;
}
@keyframes prestigeReadyPulse {
  0%, 100% { box-shadow: 0 0 0 rgba(140,50,220,0); }
  50%       { box-shadow: 0 0 18px rgba(140,50,220,0.28), 0 0 36px rgba(100,20,180,0.12); }
}

/* ── Prestige confirm modal ──────────────────────────────────────── */
.prestige-confirm-modal {
  position: absolute;
  inset: 0;
  background: rgba(4,0,12,0.82);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  pointer-events: all;
}
.prestige-confirm-content {
  background: rgba(10,0,22,0.98);
  border: 1px solid rgba(140,50,220,0.45);
  border-top: 3px solid rgba(160,65,255,0.65);
  padding: 28px 30px;
  max-width: 480px;
  width: 90%;
  box-shadow: 0 0 70px rgba(90,15,180,0.2);
}
.prestige-confirm-title {
  font-family: 'Orbitron', 'Courier New', monospace;
  font-size: 15px;
  color: #cc88ff;
  letter-spacing: 5px;
  text-align: center;
  margin-bottom: 20px;
}
.prestige-confirm-cols {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}
.prestige-confirm-section {
  padding: 10px 14px;
  background: rgba(18,0,36,0.6);
  border-left: 2px solid rgba(100,50,140,0.35);
  margin-bottom: 10px;
}
.prestige-confirm-cols .prestige-confirm-section {
  flex: 1;
  margin-bottom: 0;
}
.prestige-confirm-section.reset { border-left-color: rgba(200,65,65,0.45); }
.prestige-confirm-section.keep  { border-left-color: rgba(55,165,80,0.45); }
.prestige-confirm-section.reward{ border-left-color: rgba(160,80,255,0.6); }
.prestige-confirm-label {
  font-family: 'Orbitron', 'Courier New', monospace;
  font-size: 7.5px;
  letter-spacing: 3px;
  margin-bottom: 7px;
  color: rgba(120,80,160,0.65);
}
.prestige-confirm-section.reset .prestige-confirm-label { color: rgba(185,75,75,0.7); }
.prestige-confirm-section.keep .prestige-confirm-label  { color: rgba(75,165,95,0.7); }
.prestige-confirm-section.reward .prestige-confirm-label{ color: rgba(165,80,255,0.8); }
.prestige-confirm-section ul {
  margin: 0;
  padding-left: 14px;
  font-size: 9.5px;
  color: rgba(155,130,175,0.72);
  letter-spacing: 0.3px;
  line-height: 1.7;
  list-style: disc;
}
.prestige-reward-line {
  font-size: 12px;
  color: #dd99ff;
  letter-spacing: 1px;
  margin-bottom: 5px;
}
.prestige-new-bonuses {
  font-size: 9.5px;
  color: rgba(180,120,230,0.8);
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.prestige-stacking-note {
  font-size: 8.5px;
  color: rgba(100,55,150,0.6);
  letter-spacing: 0.5px;
}
.prestige-confirm-btns {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 20px;
}
.prestige-modal-btn {
  font-family: 'Orbitron', 'Courier New', monospace;
  font-size: 9px;
  letter-spacing: 2px;
  padding: 9px 20px;
  cursor: pointer;
  border: 1px solid;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.prestige-modal-btn.cancel {
  background: transparent;
  border-color: rgba(75,38,100,0.4);
  color: rgba(130,90,155,0.65);
}
.prestige-modal-btn.cancel:hover {
  border-color: rgba(110,55,150,0.6);
  color: rgba(175,120,200,0.9);
}
.prestige-modal-btn.confirm {
  background: rgba(55,0,105,0.9);
  border-color: rgba(155,60,235,0.6);
  color: #cc88ff;
}
.prestige-modal-btn.confirm:hover {
  background: rgba(78,0,145,0.95);
  border-color: rgba(200,80,255,0.8);
  color: #eeccff;
  box-shadow: 0 0 22px rgba(140,50,220,0.28);
}

.hub-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(0,40,20,0.18);
}
.hub-footer-btn {
  padding: 7px 20px;
  background: transparent;
  border: 1px solid rgba(80,20,20,0.38);
  color: rgba(130,55,55,0.5);
  font-family: 'Share Tech Mono', monospace;
  font-size: 9.5px;
  letter-spacing: 2px;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.15s;
  pointer-events: all;
}
.hub-footer-btn:hover {
  border-color: rgba(200,40,40,0.55);
  color: #dd5555;
  box-shadow: 0 0 10px rgba(200,40,40,0.1);
}
.hub-footer-btn.secondary {
  border-color: rgba(20,40,60,0.35);
  color: rgba(50,90,120,0.45);
}
.hub-footer-btn.secondary:hover {
  border-color: rgba(40,80,120,0.55);
  color: #5a8aaa;
}

@media (max-width: 600px) {
  .hub-deploy-body { flex-direction: column; }
  .hub-nav-v2 { grid-template-columns: repeat(2, 1fr); }
}
