/* ========================================================
   NETRUN: CYBERGRID — STYLESHEET
   Cyberpunk Netrunner, Terminal & Matrix Aesthetics
   ======================================================== */

:root {
  --bg-deep: #05070e;
  --bg-panel: rgba(12, 16, 28, 0.9);
  --bg-card: rgba(18, 24, 42, 0.75);
  --bg-card-hover: rgba(25, 34, 60, 0.95);

  --neon-cyan: #00f0ff;
  --neon-cyan-glow: rgba(0, 240, 255, 0.35);
  --matrix-green: #10b981;
  --neon-pink: #ff007f;
  --crypto-gold: #f59e0b;
  --quantum-purple: #a855f7;
  --alert-red: #ef4444;

  --border-subtle: rgba(255, 255, 255, 0.1);
  --border-glow: rgba(0, 240, 255, 0.35);

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --font-heading: 'Orbitron', -apple-system, sans-serif;
  --font-data: 'Rajdhani', -apple-system, sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;
}

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

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

/* ================= TOP HUD BAR ================= */
#top-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 16px;
  background: rgba(8, 11, 20, 0.96);
  border-bottom: 1px solid var(--border-subtle);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 14px;
}

.hud-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-hud {
  background: rgba(18, 24, 42, 0.8);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: normal;
}

.btn-hud:hover {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--neon-cyan);
  color: #fff;
  box-shadow: 0 0 10px var(--neon-cyan-glow);
}

.brand-title-wrap {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: 1.5px;
  background: linear-gradient(135deg, #fff 30%, var(--neon-cyan) 80%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-badge {
  font-family: var(--font-heading);
  font-size: 0.62rem;
  letter-spacing: 1px;
  color: var(--neon-cyan);
}

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

.hud-stat-box {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hud-stat-label {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}

.hud-stat-val {
  font-family: var(--font-data);
  font-size: 1.2rem;
  font-weight: 700;
}

.val-cred { color: var(--neon-cyan); }
.val-crypto { color: var(--crypto-gold); }
.val-cores { color: var(--quantum-purple); }
.val-rate { color: var(--matrix-green); font-family: var(--font-heading); font-size: 0.95rem; }

.hud-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ================= MAIN LAYOUT ================= */
#main-layout {
  display: grid;
  grid-template-columns: 520px 1fr;
  height: calc(100vh - 64px);
  overflow: hidden;
}

/* LEFT COLUMN: NETWORK VIEWPORT */
#network-column {
  position: relative;
  background: #03040a;
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#network-canvas {
  width: 100%;
  flex: 1;
  display: block;
  cursor: crosshair;
}

.network-overlay-hint {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(6, 8, 14, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 0.72rem;
  color: var(--text-dim);
  pointer-events: none;
  white-space: nowrap;
}

.network-overlay-hint span {
  color: var(--neon-cyan);
  font-weight: bold;
}

/* Black ICE Intrusion Banner */
#black-ice-banner {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid var(--alert-red);
  border-radius: 8px;
  padding: 10px 14px;
  display: none;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(8px);
  animation: icePulse 1s infinite alternate;
  z-index: 20;
}

@keyframes icePulse {
  0% { box-shadow: 0 0 10px rgba(239, 68, 68, 0.3); }
  100% { box-shadow: 0 0 20px rgba(239, 68, 68, 0.7); }
}

.ice-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ice-icon { font-size: 1.8rem; }
.ice-title { font-family: var(--font-heading); font-size: 0.85rem; font-weight: 800; color: #fff; }
.ice-sub { font-size: 0.72rem; color: #fca5a5; }

.ice-bar-wrap {
  width: 140px;
  height: 8px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--alert-red);
  border-radius: 4px;
  overflow: hidden;
}

.ice-bar-fill {
  height: 100%;
  width: 100%;
  background: var(--alert-red);
  transition: width 0.15s;
}

.btn-ice-attack {
  background: var(--alert-red);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 6px 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-ice-attack:hover {
  background: #ff0055;
  box-shadow: 0 0 12px #ff0055;
}

/* RIGHT COLUMN: TABS DECK */
#deck-column {
  display: flex;
  flex-direction: column;
  background: var(--bg-deep);
  overflow: hidden;
}

/* NAVIGATION TABS */
#deck-nav {
  display: flex;
  background: rgba(8, 11, 20, 0.95);
  border-bottom: 1px solid var(--border-subtle);
  overflow-x: auto;
}

.nav-tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 14px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-dim);
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.nav-tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.02);
}

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

/* TAB PANELS */
.tab-content-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
}

.tab-panel {
  display: none;
}

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

.tab-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.tab-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 1px;
}

.mult-group {
  display: inline-flex;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 2px;
}

.btn-mult {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-family: var(--font-heading);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
}

.btn-mult.active {
  background: var(--neon-cyan);
  color: #000;
}

/* ================= UPGRADES & BOTNETS GRID ================= */
.upgrades-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.upgrade-card {
  display: flex;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 12px;
  transition: all 0.2s ease;
}

.upgrade-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glow);
  transform: translateY(-2px);
}

.upgrade-card.locked { opacity: 0.65; }

.upgrade-icon-wrap {
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
}

.upgrade-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.upgrade-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.upgrade-name {
  font-family: var(--font-data);
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}

.upgrade-lvl {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  color: var(--neon-cyan);
  font-weight: 800;
}

.upgrade-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin-bottom: 8px;
}

.upgrade-bottom {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.upgrade-cost {
  font-family: var(--font-data);
  font-size: 0.95rem;
  font-weight: 700;
}

.upgrade-cost.affordable { color: var(--crypto-gold); }
.upgrade-cost.unaffordable { color: var(--alert-red); }

.btn-buy {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(168, 85, 247, 0.2));
  border: 1px solid var(--neon-cyan);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-buy:hover:not(.disabled) {
  background: var(--neon-cyan);
  color: #000;
  box-shadow: 0 0 10px var(--neon-cyan-glow);
}

.btn-buy.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  border-color: var(--border-subtle);
}

/* ================= TARGET NODES TAB ================= */
.nodes-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.node-target-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s;
}

.node-target-card.active-target {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 16px var(--neon-cyan-glow);
}

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

.node-target-name {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 800;
}

.node-target-status {
  font-size: 0.7rem;
  color: var(--text-dim);
  display: block;
}

.node-target-details {
  display: flex;
  gap: 16px;
  background: rgba(0, 0, 0, 0.35);
  padding: 6px 12px;
  border-radius: 4px;
  font-family: var(--font-data);
  font-size: 0.85rem;
}

.node-target-details b { color: var(--neon-cyan); }

.btn-node-target {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 4px;
  cursor: pointer;
}

.btn-node-target.current {
  background: var(--neon-cyan);
  color: #000;
  border-color: var(--neon-cyan);
}

.btn-node-target.affordable {
  border-color: var(--crypto-gold);
  color: var(--crypto-gold);
}

.btn-node-target.disabled { opacity: 0.4; cursor: not-allowed; }

/* ================= SINGULARITY TAB ================= */
.singularity-hero-banner {
  background: radial-gradient(circle at 50% 50%, rgba(168, 85, 247, 0.2) 0%, rgba(8, 11, 20, 0.95) 75%);
  border: 1px solid var(--quantum-purple);
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  margin-bottom: 24px;
  box-shadow: 0 0 25px rgba(168, 85, 247, 0.2);
}

.singularity-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: 1.5px;
  color: #fff;
  margin-bottom: 6px;
}

.singularity-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 650px;
  margin: 0 auto 16px auto;
  line-height: 1.5;
}

.singularity-stats-row {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 16px;
}

.singularity-stat-item {
  display: flex;
  flex-direction: column;
}

.singularity-stat-lbl { font-size: 0.7rem; color: var(--text-dim); }
.singularity-stat-val { font-family: var(--font-data); font-size: 1.3rem; font-weight: 800; color: var(--quantum-purple); }

.singularity-req-hint {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  margin-bottom: 16px;
}

.btn-initiate-transcend {
  background: linear-gradient(135deg, var(--neon-cyan), var(--quantum-purple));
  border: none;
  color: #000;
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 900;
  letter-spacing: 1px;
  padding: 12px 28px;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.5);
  transition: all 0.25s;
}

.btn-initiate-transcend:hover:not(.disabled) {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.8);
}

.btn-initiate-transcend.disabled {
  opacity: 0.35;
  cursor: not-allowed;
  box-shadow: none;
}

.perks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 12px;
}

.perk-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  gap: 12px;
}

.perk-card.locked { opacity: 0.55; }
.perk-card.maxed { border-color: var(--quantum-purple); }
.perk-icon { font-size: 1.8rem; }
.perk-info { flex: 1; display: flex; flex-direction: column; }
.perk-title-wrap { display: flex; justify-content: space-between; margin-bottom: 4px; }
.perk-name { font-family: var(--font-heading); font-size: 0.85rem; font-weight: 700; color: #fff; }
.perk-rank { font-family: var(--font-data); font-size: 0.75rem; color: var(--quantum-purple); font-weight: 700; }
.perk-desc { font-size: 0.74rem; color: var(--text-muted); margin-bottom: 8px; line-height: 1.3; }
.perk-bottom { margin-top: auto; display: flex; justify-content: space-between; align-items: center; }
.perk-cost { font-family: var(--font-data); font-size: 0.85rem; font-weight: 700; color: var(--quantum-purple); }

.btn-buy-perk {
  background: rgba(168, 85, 247, 0.2);
  border: 1px solid var(--quantum-purple);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
}

.btn-buy-perk:hover:not(.disabled) {
  background: var(--quantum-purple);
  color: #000;
}

.btn-buy-perk.disabled { opacity: 0.4; cursor: not-allowed; }

/* ================= STATS & SETTINGS TAB ================= */
.stats-box, .settings-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 18px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.85rem;
}
.stat-row:last-child { border-bottom: none; }
.stat-row b { font-family: var(--font-data); color: var(--neon-cyan); font-size: 1rem; }

.save-controls-row {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

.btn-danger {
  color: var(--alert-red) !important;
  border-color: rgba(239, 68, 68, 0.4) !important;
}

/* ================= TOAST NOTIFICATIONS ================= */
#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: rgba(12, 16, 28, 0.95);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--neon-cyan);
  color: #fff;
  padding: 10px 14px;
  border-radius: 4px;
  font-size: 0.78rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
  animation: toastEnter 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  transition: opacity 0.3s, transform 0.3s;
}

.toast-success { border-left-color: var(--matrix-green); }
.toast-error { border-left-color: var(--alert-red); }
.toast-info { border-left-color: var(--neon-cyan); }

@keyframes toastEnter {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.toast-exit {
  opacity: 0;
  transform: translateY(-8px);
}

/* ================= RESPONSIVE ================= */
@media (max-width: 1000px) {
  #main-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 350px 1fr;
    height: auto;
  }
}

/* ========================================================
   CYBERPUNK HOLOGRAPHIC TOOLTIP (DESCRIPTOR BOX)
   ======================================================== */
.cyber-tooltip {
  position: fixed;
  top: 0;
  left: 0;
  width: 320px;
  background: linear-gradient(150deg, rgba(8, 14, 24, 0.98) 0%, rgba(4, 7, 12, 0.99) 100%);
  border: 1px solid #00f0ff;
  border-radius: 6px;
  padding: 14px 16px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.85), 0 0 25px rgba(0, 240, 255, 0.25);
  backdrop-filter: blur(14px);
  z-index: 10000;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.15s ease, transform 0.05s ease-out;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cyber-tooltip.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translate3d(-9999px, -9999px, 0) !important;
}

.ct-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ct-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid #00f0ff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  flex-shrink: 0;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

.ct-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ct-title {
  font-family: var(--font-heading);
  font-size: 0.98rem;
  font-weight: 800;
  color: #00f0ff;
  letter-spacing: 0.5px;
  line-height: 1.25;
}

.ct-category {
  font-family: var(--font-data);
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--text-dim);
  letter-spacing: 1.2px;
}

.ct-divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 240, 255, 0.4), transparent);
}

.ct-body {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.ct-stats {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(0, 240, 255, 0.15);
  border-radius: 4px;
  padding: 8px 10px;
}

.ct-stat-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-data);
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
}

.ct-stat-bullet {
  color: #00f0ff;
  font-size: 0.8rem;
}

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

.ct-cost-lbl {
  color: var(--text-dim);
  font-weight: 700;
  font-size: 0.65rem;
  letter-spacing: 0.8px;
}

.ct-cost-val {
  font-family: var(--font-data);
  font-size: 0.95rem;
  color: #10b981;
}

.ct-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.68rem;
  font-weight: 600;
  color: #00f0ff;
  padding-top: 4px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
}


