:root {
  --bg-primary: #070913;
  --bg-secondary: #0d1224;
  --bg-card: rgba(18, 24, 48, 0.75);
  --bg-card-hover: rgba(28, 38, 75, 0.9);
  
  --neon-cyan: #00f0ff;
  --neon-pink: #ff0055;
  --neon-amber: #ffaa00;
  --neon-lime: #00ff88;
  --neon-purple: #a855f7;
  
  --text-primary: #e2e8f0;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --border-glow: rgba(0, 240, 255, 0.25);
  --border-card: 1px solid rgba(0, 240, 255, 0.2);
  --font-heading: 'Orbitron', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Rajdhani', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
}

#game-container {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  position: relative;
  background: radial-gradient(circle at 50% 20%, #111a38 0%, #070913 80%);
}

/* TOP HUD BAR */
#top-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: rgba(7, 9, 19, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-glow);
  z-index: 20;
  flex-shrink: 0;
  height: 54px;
}

.hud-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.sector-indicator {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--font-heading);
  letter-spacing: 1px;
}

.hud-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: 700;
}

.hud-value {
  font-size: 1.15rem;
  font-weight: 900;
}

.hud-separator {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin: 0 4px;
}

.neon-cyan {
  color: var(--neon-cyan);
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

.neon-amber {
  color: var(--neon-amber);
  text-shadow: 0 0 10px rgba(255, 170, 0, 0.5);
}

.neon-pink {
  color: var(--neon-pink);
  text-shadow: 0 0 10px rgba(255, 0, 85, 0.5);
}

.neon-lime {
  color: var(--neon-lime);
  text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

/* Boss warning in HUD */
.boss-warning {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 0, 85, 0.15);
  border: 1px solid var(--neon-pink);
  border-radius: 4px;
  padding: 2px 8px;
  animation: pulse-border 1.5s infinite alternate;
}

.boss-pulse {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  color: var(--neon-pink);
  font-weight: 700;
  letter-spacing: 1px;
}

.boss-timer-bar {
  width: 90px;
  height: 8px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(255, 0, 85, 0.5);
}

.boss-timer-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #ffaa00, #ff0055);
  transition: width 0.1s linear;
}

.boss-timer-text {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  color: #fff;
  min-width: 38px;
}

@keyframes pulse-border {
  from { box-shadow: 0 0 4px rgba(255, 0, 85, 0.2); }
  to { box-shadow: 0 0 12px rgba(255, 0, 85, 0.6); }
}

/* Currencies */
.currency-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.currency-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(13, 18, 36, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 4px 10px;
  border-radius: 6px;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  transition: border-color 0.2s;
}

.currency-badge:hover {
  border-color: rgba(255, 255, 255, 0.3);
}

.scrap-badge .curr-icon { color: var(--neon-amber); }
.scrap-badge .curr-val { color: #fff; }

.core-badge .curr-icon { color: var(--neon-cyan); }
.core-badge .curr-val { color: #fff; }

.dm-badge .curr-icon { color: var(--neon-purple); }
.dm-badge .curr-val { color: #f3e8ff; }

/* Quick buttons */
.quick-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hud-btn {
  background: rgba(18, 24, 48, 0.9);
  border: 1px solid rgba(0, 240, 255, 0.3);
  color: var(--neon-cyan);
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hud-btn:hover {
  background: rgba(0, 240, 255, 0.2);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.4);
}

/* CANVAS WRAPPER */
#canvas-wrapper {
  position: relative;
  flex: 1 1 50%;
  min-height: 200px;
  overflow: hidden;
  background-color: #05070d;
}

#gameCanvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

#dps-meter {
  position: absolute;
  top: 10px;
  left: 14px;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.5);
  padding: 3px 8px;
  border-radius: 4px;
  border-left: 2px solid var(--neon-cyan);
  pointer-events: none;
}

#dps-meter span {
  color: #fff;
  font-weight: 700;
}

.wave-banner {
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  animation: banner-float 1.8s ease-out forwards;
  z-index: 10;
}

.wave-banner h2 {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  letter-spacing: 4px;
  color: var(--neon-cyan);
  text-shadow: 0 0 20px rgba(0, 240, 255, 0.8);
}

.wave-banner p {
  font-size: 1rem;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-top: 4px;
}

@keyframes banner-float {
  0% { opacity: 0; transform: translate(-50%, -40%) scale(0.9); }
  20% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
  80% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -60%) scale(1.1); }
}

.frenzy-indicator {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 170, 0, 0.2);
  border: 1px solid var(--neon-amber);
  color: var(--neon-amber);
  font-family: var(--font-heading);
  font-size: 0.8rem;
  padding: 5px 16px;
  border-radius: 20px;
  letter-spacing: 1px;
  animation: frenzy-glow 0.8s infinite alternate;
  pointer-events: none;
}

@keyframes frenzy-glow {
  from { box-shadow: 0 0 6px rgba(255, 170, 0, 0.3); }
  to { box-shadow: 0 0 16px rgba(255, 170, 0, 0.8); }
}

/* CONTROL DECK & UPGRADES */
#control-deck {
  flex: 1 1 50%;
  max-height: 52%;
  display: flex;
  flex-direction: column;
  background: rgba(9, 13, 27, 0.95);
  border-top: 1px solid var(--border-glow);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.6);
  z-index: 15;
}

#deck-tabs {
  display: flex;
  align-items: center;
  background: rgba(6, 8, 18, 0.95);
  border-bottom: 1px solid rgba(0, 240, 255, 0.15);
  padding: 0 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
#deck-tabs::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-dim);
  font-family: var(--font-heading);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 8px 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}

.tab-btn.active {
  color: var(--neon-cyan);
  border-bottom-color: var(--neon-cyan);
  background: rgba(0, 240, 255, 0.06);
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.4);
}

.buy-mult-container {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding-right: 8px;
}

.auto-buy-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-right: 12px;
  cursor: pointer;
  font-family: var(--font-heading);
  font-size: 0.72rem;
  color: var(--neon-cyan);
}

.auto-buy-toggle input[type="checkbox"] {
  accent-color: var(--neon-cyan);
  width: 14px;
  height: 14px;
  cursor: pointer;
}

.auto-buy-label {
  letter-spacing: 0.5px;
  font-weight: 700;
}

.buy-mult-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-family: var(--font-heading);
}

.buy-mult-btn {
  background: rgba(255, 170, 0, 0.15);
  border: 1px solid var(--neon-amber);
  color: var(--neon-amber);
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  min-width: 48px;
  transition: all 0.2s;
}

.buy-mult-btn:hover {
  background: rgba(255, 170, 0, 0.3);
  box-shadow: 0 0 8px rgba(255, 170, 0, 0.4);
}

#tab-content-container {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

#tab-talents.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

/* UPGRADE GRID & CARDS */
.upgrade-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}

.upgrade-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  border: var(--border-card);
  border-radius: 6px;
  padding: 10px 12px;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.upgrade-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(0, 240, 255, 0.4);
  transform: translateY(-1px);
}

.upgrade-card.locked {
  opacity: 0.5;
  filter: grayscale(0.8);
  pointer-events: none;
}

.upgrade-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.upgrade-card-title {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.upgrade-level {
  font-size: 0.75rem;
  color: var(--neon-cyan);
  background: rgba(0, 240, 255, 0.1);
  padding: 1px 5px;
  border-radius: 3px;
}

.upgrade-card-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.upgrade-current-stat {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--neon-lime);
  margin-top: 2px;
}

.upgrade-card-action {
  margin-left: 12px;
}

.upgrade-buy-btn {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(0, 240, 255, 0.05));
  border: 1px solid var(--neon-cyan);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  min-width: 95px;
  text-align: center;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.upgrade-buy-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.4), rgba(0, 240, 255, 0.15));
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
  transform: scale(1.02);
}

.upgrade-buy-btn:disabled {
  opacity: 0.4;
  border-color: rgba(255, 255, 255, 0.15);
  cursor: not-allowed;
  box-shadow: none;
}

.upgrade-buy-btn.tech-btn {
  border-color: var(--neon-purple);
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.25), rgba(168, 85, 247, 0.05));
}
.upgrade-buy-btn.tech-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.45), rgba(168, 85, 247, 0.15));
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
}

.upgrade-buy-btn.prestige-btn {
  border-color: var(--neon-pink);
  background: linear-gradient(135deg, rgba(255, 0, 85, 0.25), rgba(255, 0, 85, 0.05));
}
.upgrade-buy-btn.prestige-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(255, 0, 85, 0.45), rgba(255, 0, 85, 0.15));
  box-shadow: 0 0 10px rgba(255, 0, 85, 0.5);
}

.btn-cost-sub {
  font-size: 0.65rem;
  color: var(--text-dim);
}

/* TECH & PRESTIGE HEADERS */
.tech-header {
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 12px;
}

.tech-header h3 {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  color: var(--neon-purple);
  margin-bottom: 4px;
}

.tech-header p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.prestige-banner {
  background: radial-gradient(circle at 50% 50%, rgba(255, 0, 85, 0.15), rgba(7, 9, 19, 0.9));
  border: 1px solid rgba(255, 0, 85, 0.4);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 14px;
  text-align: center;
}

.prestige-info h2 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--neon-pink);
  letter-spacing: 2px;
  margin-bottom: 6px;
}

.prestige-info p {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 650px;
  margin: 0 auto 12px auto;
  line-height: 1.35;
}

.prestige-payout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.dm-gain-val {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--neon-pink);
  text-shadow: 0 0 12px rgba(255, 0, 85, 0.7);
}

.prestige-req-hint {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.prestige-action-btn {
  background: linear-gradient(135deg, #ff0055, #9333ea);
  color: #fff;
  border: none;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 900;
  letter-spacing: 1px;
  padding: 10px 24px;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 0 15px rgba(255, 0, 85, 0.5);
  transition: all 0.2s;
}

.prestige-action-btn:hover {
  transform: scale(1.03);
  box-shadow: 0 0 25px rgba(255, 0, 85, 0.8);
}

.meta-section-title {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  color: var(--neon-cyan);
  letter-spacing: 1px;
  margin-bottom: 10px;
}

/* STATS & SETTINGS */
.stats-panel-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.stats-column, .settings-column {
  background: var(--bg-card);
  border: var(--border-card);
  border-radius: 6px;
  padding: 14px;
}

.stats-column h3, .settings-column h3 {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  color: var(--neon-cyan);
  letter-spacing: 1px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(0, 240, 255, 0.15);
  padding-bottom: 6px;
}

.stats-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stats-list li {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.stats-list li strong {
  color: #fff;
  font-family: var(--font-heading);
}

.settings-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.toggle-setting {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-primary);
  cursor: pointer;
}

.toggle-setting input[type="checkbox"] {
  accent-color: var(--neon-cyan);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.save-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.utility-btn {
  background: rgba(18, 24, 48, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
  font-family: var(--font-heading);
  font-size: 0.75rem;
  padding: 8px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.utility-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.4);
}

.utility-btn.danger {
  border-color: rgba(255, 0, 85, 0.4);
  color: #ff88a3;
}
.utility-btn.danger:hover {
  background: rgba(255, 0, 85, 0.2);
  border-color: var(--neon-pink);
}

/* MODALS */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fadeIn 0.2s ease-out;
}

.modal-box {
  background: var(--bg-secondary);
  border: 1px solid var(--neon-cyan);
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.3);
  border-radius: 8px;
  padding: 24px;
  max-width: 480px;
  width: 90%;
  text-align: center;
}

.modal-box h2 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  letter-spacing: 2px;
  margin-bottom: 8px;
}

.modal-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.offline-stats {
  background: rgba(0, 0, 0, 0.4);
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.offline-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.95rem;
}

.modal-btn {
  background: linear-gradient(135deg, #00f0ff, #0088ff);
  color: #000;
  border: none;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 900;
  padding: 10px 24px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.modal-btn:hover {
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.6);
  transform: scale(1.02);
}

.modal-btn-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

#modal-prompt-input {
  width: 100%;
  background: #000;
  border: 1px solid var(--border-glow);
  color: var(--neon-lime);
  font-family: monospace;
  font-size: 0.8rem;
  padding: 8px;
  border-radius: 4px;
  resize: vertical;
}

.hidden {
  display: none !important;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* RESPONSIVE DESIGN (Mobile & Landscape) */
@media (max-width: 768px) {
  #top-hud {
    padding: 6px 10px;
    height: auto;
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .currency-group {
    order: 3;
    width: 100%;
    justify-content: space-between;
  }
  
  #canvas-wrapper {
    flex: 1 1 45%;
  }
  
  #control-deck {
    flex: 1 1 55%;
    max-height: 55%;
  }

  .stats-panel-content {
    grid-template-columns: 1fr;
  }
}

/* ========================================================
   TALENT TREE, BADGES & SUPERWEAPON STYLES
   ======================================================== */

.tp-badge .curr-icon {
  color: #00ffaa;
  text-shadow: 0 0 8px rgba(0, 255, 170, 0.6);
}
.tp-badge .curr-val {
  color: #a7f3d0;
}

.tab-badge {
  background: var(--neon-pink);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 0.62rem;
  font-weight: 900;
  padding: 1px 6px;
  border-radius: 10px;
  margin-left: 4px;
  box-shadow: 0 0 8px rgba(255, 0, 85, 0.6);
  animation: pulseBadge 1.2s infinite alternate;
}

@keyframes pulseBadge {
  from { transform: scale(0.95); opacity: 0.85; }
  to { transform: scale(1.1); opacity: 1; box-shadow: 0 0 12px var(--neon-pink); }
}

/* Superweapon Quick Button */
.superweapon-btn {
  background: linear-gradient(135deg, rgba(255, 0, 85, 0.2), rgba(0, 240, 255, 0.2));
  border: 1px solid var(--neon-cyan);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.superweapon-btn:not(.disabled):hover {
  background: linear-gradient(135deg, var(--neon-pink), var(--neon-cyan));
  box-shadow: 0 0 14px var(--neon-cyan);
  transform: translateY(-1px);
}

.superweapon-btn.disabled {
  opacity: 0.45;
  border-color: rgba(255, 255, 255, 0.15);
  cursor: not-allowed;
  filter: grayscale(0.6);
}

.superweapon-btn.ready {
  background: linear-gradient(135deg, #ff0055, #00f0ff);
  border-color: #fff;
  color: #fff;
  animation: superPulse 0.9s infinite alternate;
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.8);
}

@keyframes superPulse {
  0% { transform: scale(1.0); box-shadow: 0 0 8px #00f0ff; }
  100% { transform: scale(1.05); box-shadow: 0 0 18px #ff0055; }
}

.auto-super-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-heading);
  font-size: 0.65rem;
  color: var(--neon-cyan);
  cursor: pointer;
  white-space: nowrap;
}

.auto-super-label {
  font-weight: 700;
}

/* TALENTS TAB PANEL */
#tab-talents {
  display: none;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: rgba(7, 9, 19, 0.7);
}

#tab-talents.active {
  display: flex;
}

.talents-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: rgba(11, 16, 36, 0.95);
  border-bottom: 1px solid rgba(0, 240, 255, 0.2);
  flex-shrink: 0;
  gap: 10px;
}

.tp-summary {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--font-heading);
}

.tp-icon {
  font-size: 1.1rem;
}

.tp-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: 700;
}

.tp-count {
  font-size: 1.3rem;
  font-weight: 900;
  color: #00ffaa;
  text-shadow: 0 0 10px rgba(0, 255, 170, 0.6);
}

.tp-sub {
  font-size: 0.7rem;
  color: #a7f3d0;
  font-weight: 600;
}

.talent-branch-points {
  display: flex;
  align-items: center;
  gap: 10px;
}

.branch-pill {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 4px;
}

.pill-ballistics {
  border-color: rgba(255, 0, 85, 0.35);
  color: #ff99aa;
}
.pill-ballistics strong { color: #ff0055; }

.pill-fleet {
  border-color: rgba(168, 85, 247, 0.35);
  color: #e9d5ff;
}
.pill-fleet strong { color: #c084fc; }

.pill-entropy {
  border-color: rgba(0, 240, 255, 0.35);
  color: #a5f3fc;
}
.pill-entropy strong { color: #00f0ff; }

.respec-btn {
  background: rgba(255, 0, 85, 0.12);
  border: 1px solid rgba(255, 0, 85, 0.4);
  color: #ff99aa;
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.respec-btn:hover {
  background: rgba(255, 0, 85, 0.25);
  border-color: var(--neon-pink);
  box-shadow: 0 0 10px rgba(255, 0, 85, 0.4);
  color: #fff;
}

/* WORKSPACE & BRANCH COLUMNS */
.talent-workspace {
  display: flex;
  flex-direction: row;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
  gap: 12px;
  padding: 4px;
}

.talent-branches-wrapper {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 6px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  position: relative;
}

.talent-svg-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.talent-branch-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(13, 18, 36, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px 6px 12px 6px;
  position: relative;
  z-index: 2;
  transition: border-color 0.2s;
}

.branch-ballistics { border-top: 3px solid #ff0055; }
.branch-fleet { border-top: 3px solid #a855f7; }
.branch-entropy { border-top: 3px solid #00f0ff; }

.branch-col-header {
  text-align: center;
  margin-bottom: 12px;
  user-select: none;
}

.branch-col-header .col-icon {
  font-size: 1.3rem;
  display: block;
  margin-bottom: 2px;
}

.branch-col-header h4 {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 1px;
}

.branch-ballistics h4 { color: #ff0055; text-shadow: 0 0 8px rgba(255, 0, 85, 0.4); }
.branch-fleet h4 { color: #c084fc; text-shadow: 0 0 8px rgba(168, 85, 247, 0.4); }
.branch-entropy h4 { color: #00f0ff; text-shadow: 0 0 8px rgba(0, 240, 255, 0.4); }

.branch-col-header .col-sub {
  font-size: 0.68rem;
  color: var(--text-dim);
  font-weight: 600;
}

/* NODES CONTAINER */
.branch-nodes {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.talent-tier-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  width: 100%;
}

.talent-tier-label {
  font-family: var(--font-heading);
  font-size: 0.62rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: -10px;
}

/* INDIVIDUAL TALENT NODE */
.talent-node {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #090d19;
  border: 2px solid rgba(255, 255, 255, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  transition: all 0.22s ease-out;
  user-select: none;
}

.talent-node .node-icon {
  font-size: 1.2rem;
  pointer-events: none;
  transition: transform 0.2s;
}

.talent-node:hover .node-icon {
  transform: scale(1.15);
}

.talent-node .node-rank {
  position: absolute;
  bottom: -4px;
  right: -4px;
  background: #060914;
  border: 1px solid rgba(255, 255, 255, 0.3);
  font-family: var(--font-heading);
  font-size: 0.58rem;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 5px;
  color: #fff;
}

/* NODE STATES */
.talent-node.state-locked {
  opacity: 0.35;
  filter: grayscale(0.85);
  border: 1px dashed rgba(255, 255, 255, 0.25);
  cursor: not-allowed;
}

.talent-node.state-available {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.35);
  animation: availGlow 1.8s infinite alternate ease-in-out;
}

@keyframes availGlow {
  from { box-shadow: 0 0 6px rgba(0, 240, 255, 0.3); border-color: rgba(0, 240, 255, 0.6); }
  to { box-shadow: 0 0 14px rgba(0, 240, 255, 0.8); border-color: #fff; }
}

.talent-node.state-allocated {
  background: rgba(16, 185, 129, 0.15);
  border-color: #10b981;
}
.talent-node.state-allocated .node-rank {
  border-color: #10b981;
  color: #a7f3d0;
}

.talent-node.state-mastered {
  background: rgba(255, 170, 0, 0.18);
  border-color: var(--neon-amber);
  box-shadow: 0 0 12px rgba(255, 170, 0, 0.5);
}
.talent-node.state-mastered .node-rank {
  border-color: var(--neon-amber);
  color: var(--neon-amber);
  background: #110d00;
}

.talent-node.state-selected {
  outline: 2px solid #fff;
  outline-offset: 3px;
  transform: scale(1.1);
  z-index: 10;
}

/* KEYSTONE ULTIMATE NODE */
.talent-node.keystone-node {
  width: 58px;
  height: 58px;
  border-radius: 12px;
  transform: rotate(45deg);
  border-width: 2.5px;
}

.talent-node.keystone-node .node-icon {
  transform: rotate(-45deg);
  font-size: 1.45rem;
}
.talent-node.keystone-node:hover .node-icon {
  transform: rotate(-45deg) scale(1.2);
}

.talent-node.keystone-node .node-rank {
  transform: rotate(-45deg);
  bottom: 0px;
  right: -2px;
}

.talent-node.keystone-node.state-mastered {
  box-shadow: 0 0 20px rgba(255, 170, 0, 0.8), inset 0 0 10px rgba(255, 170, 0, 0.4);
}

/* TALENT INSPECTOR PANE */
.talent-inspector {
  width: 290px;
  background: rgba(9, 12, 26, 0.95);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 6px;
  padding: 10px 14px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow-y: auto;
}

@media (max-width: 900px) {
  .talent-workspace {
    flex-direction: column;
  }
  .talent-inspector {
    width: 100%;
    min-height: 95px;
  }
}

.inspector-empty {
  text-align: center;
  color: var(--text-dim);
  font-family: var(--font-heading);
  font-size: 0.8rem;
  letter-spacing: 0.5px;
  padding: 14px 0;
}

.inspector-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.inspector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.inspector-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.inspect-icon {
  font-size: 1.6rem;
}

.inspector-title-group h4 {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.5px;
}

.inspect-sub {
  font-size: 0.72rem;
  color: var(--neon-cyan);
  font-weight: 600;
  text-transform: uppercase;
}

.inspect-badge {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(0, 240, 255, 0.15);
  border: 1px solid var(--neon-cyan);
  color: #fff;
}

.inspect-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.inspect-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.inspect-stat-box {
  background: rgba(14, 20, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.inspect-stat-box.next {
  border-color: rgba(0, 240, 255, 0.25);
  background: rgba(0, 240, 255, 0.05);
}

.stat-box-label {
  font-family: var(--font-heading);
  font-size: 0.62rem;
  color: var(--text-dim);
  font-weight: 700;
  text-transform: uppercase;
}

.stat-box-val {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 800;
  color: #fff;
}

.inspect-stat-box.next .stat-box-val {
  color: #00ffaa;
}

.inspector-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  gap: 12px;
}

.inspect-reqs {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-weight: 600;
}

.inspect-reqs.unmet {
  color: #ff5577;
}
.inspect-reqs.met {
  color: #00ffaa;
}

.learn-talent-btn {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(0, 255, 170, 0.3));
  border: 1px solid #00ffaa;
  color: #fff;
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 7px 16px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.learn-talent-btn:not(:disabled):hover {
  background: linear-gradient(135deg, var(--neon-cyan), #00ffaa);
  color: #000;
  box-shadow: 0 0 14px rgba(0, 255, 170, 0.6);
  transform: translateY(-1px);
}

.learn-talent-btn:disabled {
  opacity: 0.4;
  border-color: rgba(255, 255, 255, 0.2);
  cursor: not-allowed;
  filter: grayscale(0.7);
}

/* ================= NEON TARGETING HUD TOOLTIP ================= */
.neon-tooltip {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10000;
  width: 320px;
  max-width: calc(100vw - 32px);
  background: rgba(8, 12, 22, 0.96);
  border: 1px solid var(--neon-cyan);
  border-radius: 6px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.9), 0 0 20px rgba(0, 240, 255, 0.25);
  padding: 12px 14px;
  color: #fff;
  pointer-events: none;
  font-family: var(--font-body, 'Rajdhani', sans-serif);
  backdrop-filter: blur(10px);
  transition: opacity 0.12s ease;
}

.neon-tooltip.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.nt-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nt-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid var(--neon-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nt-icon {
  font-size: 1.25rem;
}

.nt-title-group {
  flex: 1;
  min-width: 0;
}

.nt-title {
  font-family: var(--font-heading, 'Orbitron', monospace);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--neon-cyan);
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nt-category {
  font-size: 0.72rem;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 1px;
}

.nt-divider {
  height: 1px;
  background: linear-gradient(90deg, rgba(0, 240, 255, 0.5), transparent);
  margin: 9px 0 8px 0;
}

.nt-body {
  font-size: 0.8rem;
  line-height: 1.4;
  color: #cbd5e1;
  margin-bottom: 8px;
}

.nt-stats {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
  background: rgba(0, 0, 0, 0.45);
  padding: 6px 8px;
  border-radius: 4px;
  border-left: 2px solid var(--neon-cyan);
}

.nt-stat-item {
  font-size: 0.75rem;
  color: #e2e8f0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nt-stat-bullet {
  font-size: 0.7rem;
  color: var(--neon-cyan);
}

.nt-cost-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 4px;
  padding: 5px 8px;
  font-size: 0.78rem;
  margin-bottom: 6px;
}

.nt-cost-lbl {
  color: #94a3b8;
  font-size: 0.7rem;
  letter-spacing: 0.5px;
}

.nt-cost-val {
  color: #00ffaa;
  font-family: var(--font-heading, 'Orbitron', monospace);
  font-weight: 700;
}

.nt-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: #94a3b8;
  font-style: italic;
  padding-top: 4px;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
}

.nt-hint-icon {
  font-size: 0.8rem;
  color: var(--neon-cyan);
}

