
:root {
  
  --bg-slate: #030816;
  --bg-baseplate: #01040b;
  --bg-hud: rgba(2, 6, 18, 0.75);
  --bg-hud-hover: rgba(3, 10, 30, 0.85);
  --border-steel: rgba(0, 240, 255, 0.15);
  --border-steel-hover: rgba(0, 240, 255, 0.35);
  --border-blueprint-major: rgba(0, 240, 255, 0.04);
  --border-blueprint-minor: rgba(0, 240, 255, 0.012);
  --text-main: #93c5fd;
  --text-muted: #4b6b94;
  --text-white: #ffffff;
  --accent-color: #00f0ff;
  --accent-glow: rgba(0, 240, 255, 0.25);
  --accent-iron: #cbd5e1;
  --node-glow: 0 0 15px rgba(0, 240, 255, 0.3);
  --font-sans: 'Inter', sans-serif;
  --font-heading: 'Outfit', sans-serif;
  --font-mono: 'Space Mono', monospace;
  --transition-fast: all 0.15s ease;
  --transition-normal: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

body.theme-matrix {
  --bg-slate: #020a02;
  --bg-baseplate: #010401;
  --bg-hud: rgba(2, 10, 2, 0.75);
  --bg-hud-hover: rgba(3, 15, 3, 0.85);
  --border-steel: rgba(0, 255, 70, 0.15);
  --border-steel-hover: rgba(0, 255, 70, 0.35);
  --border-blueprint-major: rgba(0, 255, 70, 0.04);
  --border-blueprint-minor: rgba(0, 255, 70, 0.012);
  --text-main: #86efac;
  --text-muted: #3f623f;
  --accent-color: #00ff46;
  --accent-glow: rgba(0, 255, 70, 0.25);
  --accent-iron: #d1fae5;
  --node-glow: 0 0 15px rgba(0, 255, 70, 0.3);
}

body.theme-crimson {
  --bg-slate: #0c0204;
  --bg-baseplate: #060102;
  --bg-hud: rgba(12, 2, 4, 0.75);
  --bg-hud-hover: rgba(18, 3, 6, 0.85);
  --border-steel: rgba(255, 40, 80, 0.15);
  --border-steel-hover: rgba(255, 40, 80, 0.35);
  --border-blueprint-major: rgba(255, 40, 80, 0.04);
  --border-blueprint-minor: rgba(255, 40, 80, 0.012);
  --text-main: #fca5a5;
  --text-muted: #7f3b43;
  --accent-color: #ff2850;
  --accent-glow: rgba(255, 40, 80, 0.25);
  --accent-iron: #ffe4e6;
  --node-glow: 0 0 15px rgba(255, 40, 80, 0.3);
}

body.theme-slate {
  --bg-slate: #0b0c0f;
  --bg-baseplate: #07080a;
  --bg-hud: rgba(10, 11, 14, 0.85);
  --bg-hud-hover: rgba(15, 16, 20, 0.95);
  --border-steel: rgba(255, 255, 255, 0.08);
  --border-steel-hover: rgba(255, 255, 255, 0.2);
  --border-blueprint-major: rgba(255, 255, 255, 0.025);
  --border-blueprint-minor: rgba(255, 255, 255, 0.008);
  --text-main: #d1d5db;
  --text-muted: #6b7280;
  --accent-color: #8e95a0;
  --accent-glow: rgba(142, 149, 160, 0.15);
  --accent-iron: #e5e7eb;
  --node-glow: 0 0 15px rgba(255, 255, 255, 0.15);
}

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

body {
  font-family: var(--font-sans);
  background: linear-gradient(135deg, #02040a, #050f26, #010307, #081635);
  background-size: 400% 400%;
  animation: bgGradientShift 30s ease infinite;
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;
  position: relative;
}

body.theme-matrix {
  background: linear-gradient(135deg, #010501, #020c02, #000200, #031403);
}

body.theme-crimson {
  background: linear-gradient(135deg, #050102, #100204, #020001, #1a0307);
}

body.theme-slate {
  background: linear-gradient(135deg, #040507, #0f1115, #06070a, #0b0c10);
}

@keyframes bgGradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ── Mobile performance: disable heavy animations ── */
body.is-mobile {
  animation: none !important;
  background-size: 100% 100% !important;
}

body.is-mobile .grid-tunnel-container {
  display: none !important;
}

body.is-mobile .crt-overlay {
  display: none !important;
}

body.is-mobile::after {
  animation: none !important;
  display: none !important;
}

body.is-mobile .plexus-canvas {
  opacity: 0.18 !important;
}

body.is-mobile .grid-tunnel-container::before {
  display: none !important;
}

.grid-tunnel-container {
  position: fixed;
  inset: 0;
  perspective: 320px;
  perspective-origin: 50% 50%;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
  background: #02040a;
}

.grid-tunnel-container::before {
  content: " ";
  display: block;
  position: absolute;
  top: 0; left: 0; right: 0; height: 220px;
  background: linear-gradient(to bottom, transparent, rgba(0, 240, 255, 0.04) 50%, rgba(0, 240, 255, 0.09) 85%, transparent);
  animation: scanBar 15s linear infinite;
  pointer-events: none;
  z-index: 2;
}

.grid-tunnel-wall {
  position: absolute;
  background-image:
    linear-gradient(rgba(0, 240, 255, 0.20) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.20) 1px, transparent 1px);
  background-size: 80px 80px;
  opacity: 1;
  backface-visibility: hidden;
}

.grid-tunnel-floor {
  width: 100vw;
  height: 260vh;
  left: 0;
  bottom: 0;
  transform-origin: bottom center;
  transform: rotateX(90deg);
  animation: tunnelScrollFloor 20s linear infinite;
}

.grid-tunnel-ceiling {
  width: 100vw;
  height: 260vh;
  left: 0;
  top: 0;
  transform-origin: top center;
  transform: rotateX(-90deg);
  animation: tunnelScrollCeiling 20s linear infinite;
}

.grid-tunnel-left {
  width: 260vh;
  height: 100vh;
  left: 0;
  top: 0;
  transform-origin: left center;
  transform: rotateY(90deg);
  animation: tunnelScrollLeft 20s linear infinite;
}

.grid-tunnel-right {
  width: 260vh;
  height: 100vh;
  right: 0;
  top: 0;
  transform-origin: right center;
  transform: rotateY(-90deg);
  animation: tunnelScrollRight 20s linear infinite;
}

.grid-tunnel-mask {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 58% 58% at 50% 50%, transparent 22%, rgba(2, 4, 10, 0.45) 55%, rgba(2, 4, 10, 0.88) 100%);
  z-index: 1;
}

body.theme-matrix .grid-tunnel-wall {
  background-image:
    linear-gradient(rgba(0, 255, 70, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 70, 0.18) 1px, transparent 1px);
  background-size: 80px 80px;
}
body.theme-matrix .grid-tunnel-container::before {
  background: linear-gradient(to bottom, transparent, rgba(0, 255, 70, 0.03) 50%, rgba(0, 255, 70, 0.08) 85%, transparent);
}

body.theme-crimson .grid-tunnel-wall {
  background-image:
    linear-gradient(rgba(255, 40, 80, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 40, 80, 0.18) 1px, transparent 1px);
  background-size: 80px 80px;
}
body.theme-crimson .grid-tunnel-container::before {
  background: linear-gradient(to bottom, transparent, rgba(255, 40, 80, 0.03) 50%, rgba(255, 40, 80, 0.08) 85%, transparent);
}

body.theme-slate .grid-tunnel-wall {
  background-image:
    linear-gradient(rgba(200, 220, 255, 0.15) 1px, transparent 1px),
    linear-gradient(90deg, rgba(200, 220, 255, 0.15) 1px, transparent 1px);
  background-size: 80px 80px;
}
body.theme-slate .grid-tunnel-container::before {
  background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.03) 50%, rgba(255, 255, 255, 0.07) 85%, transparent);
}

@keyframes tunnelScrollFloor {
  from { background-position: 0 0; }
  to { background-position: 0 240px; }
}

@keyframes tunnelScrollCeiling {
  from { background-position: 0 0; }
  to { background-position: 0 -240px; }
}

@keyframes tunnelScrollLeft {
  from { background-position: 0 0; }
  to { background-position: -240px 0; }
}

@keyframes tunnelScrollRight {
  from { background-position: 0 0; }
  to { background-position: 240px 0; }
}

@keyframes scanBar {
  0% { transform: translateY(-180px); }
  100% { transform: translateY(120vh); }
}

.network-viewport {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  overflow: hidden;
  cursor: default;
  touch-action: none;
}

.network-viewport:active {
  cursor: default;
}

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

.network-space {
  position: absolute;
  top: 0;
  left: 0;
  width: 10000px;
  height: 10000px;
  z-index: 2;
  transform-origin: 0 0;
  pointer-events: none;
}

.hud-panel {
  position: absolute;
  background: var(--bg-hud);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-steel);
  border-radius: 0 !important;
  padding: 1.1rem;
  z-index: 10;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  transition: var(--transition-normal);
  display: flex;
  flex-direction: column;
}

.hud-panel:hover {
  background: var(--bg-hud-hover);
  border-color: var(--border-steel-hover);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5);
}

.console-hud {
  top: 1.5rem;
  left: 1.5rem;
  width: 24vw;
  min-width: 320px;
  max-width: 450px;
  height: auto;
  max-height: 380px;
}

.hud-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  padding-bottom: 0.5rem;
  margin-bottom: 0.75rem;
}

.hud-title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-color);
}

.chatbox-status {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  padding: 0.1rem 0.35rem;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border-radius: 0 !important;
}

.chatbox-status.connected {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-white);
}

.chatbox-body {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding-right: 0.25rem;
  margin-bottom: 0.75rem;
}

.chat-line {
  line-height: 1.5;
  word-break: normal;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  min-width: 0;
}

.chat-line.system { color: #6e7682; }
.chat-line.peer { color: #a1a8b8; }
.chat-line.success { color: #93c5fd; }
.chat-line.info { color: #cbd5e1; }

.terminal-link {
  color: var(--text-white);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
  transition: var(--transition-fast);
}

.terminal-link:hover {
  color: var(--accent-color);
}

.hud-telemetry {
  display: flex;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  padding-top: 0.5rem;
  gap: 0.5rem;
  justify-content: space-between;
}

.network-controls-container {
  position: absolute;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}

.network-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--bg-hud);
  border: 1px solid var(--border-steel);
  border-radius: 0 !important;
  padding: 0.35rem 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}

.system-tips {
  background: var(--bg-hud);
  border: 1px solid var(--border-steel);
  padding: 0.4rem 0.8rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  max-width: 320px;
  text-align: right;
  opacity: 0.85;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: opacity 0.5s ease;
  pointer-events: auto;
}

.ctrl-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0 !important;
  color: var(--text-white);
  padding: 0.15rem 0.4rem;
  font-size: 0.65rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.ctrl-btn:hover {
  background: var(--text-white);
  color: var(--bg-baseplate);
  border-color: var(--text-white);
}

.network-node {
  position: absolute;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 0 !important;
  cursor: default;
  z-index: 5;
  transition: box-shadow 0.2s ease, opacity 0.3s ease;
  user-select: none;
  transform: translate(-50%, -50%);
  touch-action: none;
  will-change: transform, left, top;
}

.network-node:hover {
  transform: translate(-50%, -50%) scale(1.06);
}

.network-node.dragging {
  cursor: default;
  z-index: 100;
}

/* Suppress sticky hover states on touch devices — prevents flicker after tap */
@media (hover: none) {
  .network-node:hover {
    transform: translate(-50%, -50%);
  }
  .network-node:hover .node-avatar-box,
  .network-node:hover .node-icon-box,
  .network-node:hover .crypto-icon-box {
    border-color: var(--border-steel);
    box-shadow: none;
  }
  .hud-panel:hover {
    background: var(--bg-hud);
    border-color: var(--border-steel);
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  }
}


.node-avatar-box {
  width: 100%;
  height: 100%;
  border-radius: 0 !important;
  padding: 2px;
  background: var(--bg-slate);
  overflow: hidden;
  border: 1px solid var(--border-steel);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: var(--transition-fast);
}

.network-node:hover .node-avatar-box {
  border-color: var(--accent-color);
  box-shadow: var(--node-glow);
}

.node-avatar {
  width: 100%;
  height: 100%;
  border-radius: 0 !important;
  object-fit: cover;
  background-color: var(--bg-slate);
  pointer-events: none;
  user-select: none;
}

.node-label {
  position: absolute;
  bottom: -22px;
  white-space: nowrap;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--text-white);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
  pointer-events: none;
}

.node-desc {
  position: absolute;
  bottom: -32px;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-muted);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
  pointer-events: none;
}

.host-node {
  width: 76px;
  height: 76px;
}

.host-node .node-avatar-box {
  background: linear-gradient(135deg, var(--accent-color), var(--bg-slate));
  padding: 3px;
  border: 1px solid var(--accent-color);
  box-shadow: var(--node-glow);
}

.category-node {
  width: 58px;
  height: 58px;
}

.node-icon-box {
  width: 100%;
  height: 100%;
  border-radius: 0 !important;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-steel);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--text-white);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
  transition: var(--transition-fast);
}

.network-node:hover .node-icon-box {
  border-color: var(--accent-color);
  color: var(--accent-color);
  box-shadow: var(--node-glow);
}

.friend-node {
  width: 54px;
  height: 54px;
}

.interest-node {
  width: 46px;
  height: 46px;
}

.node-badge {
  width: 100%;
  height: 100%;
  border-radius: 0 !important;
  background: rgba(32, 35, 41, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
}

.crypto-node {
  width: 50px;
  height: 50px;
}

.crypto-icon-box {
  width: 100%;
  height: 100%;
  border-radius: 0 !important;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-steel);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.72rem;
  color: var(--text-muted);
  transition: var(--transition-fast);
}

.crypto-icon-box svg {
  display: block;
  width: 22px;
  height: 22px;
}

.crypto-node[data-symbol="ETH"]:hover .crypto-icon-box {
  border-color: #627ee9;
  box-shadow: 0 0 15px rgba(98, 126, 233, 0.5);
  color: #627ee9;
}

.crypto-node[data-symbol="BTC"]:hover .crypto-icon-box {
  border-color: #f7931a;
  box-shadow: 0 0 15px rgba(247, 147, 26, 0.5);
  color: #f7931a;
}

.crypto-node[data-symbol="SOL"]:hover .crypto-icon-box {
  border-color: #14f195;
  box-shadow: 0 0 15px rgba(20, 241, 149, 0.5);
  color: #14f195;
}

#node-friends:hover .node-icon-box {
  border-color: #ffffff;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
}
#node-cat-1781756302089:hover .node-icon-box {
  border-color: #f59e0b;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.5);
}
#node-cat-1781756511954:hover .node-icon-box {
  border-color: #10b981;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.5);
}
#node-projects:hover .node-icon-box {
  border-color: #8b5cf6;
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.5);
}
#node-sub-1781756519399:hover .node-icon-box {
  border-color: #ffffff;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
}
#node-sub-1781756710228:hover .node-icon-box {
  border-color: #9146ff;
  box-shadow: 0 0 15px rgba(145, 70, 255, 0.5);
}
#node-sub-1781756715032:hover .node-icon-box {
  border-color: #ff0000;
  box-shadow: 0 0 15px rgba(255, 0, 0, 0.5);
}
#node-sub-1781756519399:hover .node-icon-box {
  border-color: #e7e7e7;
  box-shadow: 0 0 15px rgba(231, 231, 231, 0.5);
}

#node-sub-github:hover .node-icon-box {
  border-color: #8b949e;
  box-shadow: 0 0 15px rgba(139, 148, 158, 0.5);
}

#node-project-tsunami:hover .node-icon-box,
#node-project-aether:hover .node-icon-box,
#node-project-spectra:hover .node-icon-box {
  border-color: #8b5cf6;
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.5);
}

#node-games:hover .node-icon-box,
#node-game-snake:hover .node-icon-box,
#node-game-tetris:hover .node-icon-box,
#node-game-breakout:hover .node-icon-box {
  border-color: #ec4899;
  box-shadow: 0 0 15px rgba(236, 72, 153, 0.5);
}

.network-node:hover .crypto-icon-box {
  border-color: var(--accent-color);
  box-shadow: var(--node-glow);
}

.node-icon-box svg, .node-badge svg {
  display: block;
  width: 22px;
  height: 22px;
  fill: currentColor;
  stroke: none;
}

.font-mono { font-family: var(--font-mono); }

.chatbox-body::-webkit-scrollbar {
  width: 4px;
}
.chatbox-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.06);
}

@media (max-width: 640px) {
  .console-hud {
    width: calc(100% - 2rem);
    left: 1rem;
    top: 1rem;
    padding: 0.75rem;
  }
  .chatbox-body {
    font-size: 0.7rem;
    max-height: 120px;
  }
  .hud-telemetry {
    font-size: 0.6rem;
  }
  .network-controls-container { display: none; }
  .music-hud { display: none; }
  .boot-screen {
    padding: 1rem;
    font-size: 0.65rem;
  }
  .power-btn {
    width: 70px;
    height: 70px;
    padding: 0;
  }
  .power-btn svg {
    width: 24px;
    height: 24px;
  }
  .terminal-popup-container {
    width: 95%;
    height: 55vh;
    max-height: 400px;
    padding: 1rem;
  }
  .terminal-close-btn {
    bottom: -30px;
    font-size: 0.65rem;
  }
}

.crt-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.2) 50%),
              linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
  background-size: 100% 3px, 3px 100%;
  z-index: 20000;
  pointer-events: none;
  opacity: 0.95;
  transition: opacity 0.5s ease;
}

.crt-overlay::after {
  content: " ";
  display: block;
  position: absolute;
  top: 0; left: 0; bottom: 0; right: 0;
  background: radial-gradient(circle, rgba(18, 16, 16, 0) 65%, rgba(0, 0, 0, 0.45) 120%);
  z-index: 20001;
  pointer-events: none;
}

body.crt-off .crt-overlay {
  display: none !important;
}

body::after {
  content: " ";
  display: block;
  position: fixed;
  top: 0; left: 0; bottom: 0; right: 0;
  background: rgba(18, 16, 16, 0.1);
  opacity: 0;
  z-index: 19999; 
  pointer-events: none;
  animation: crtFlicker 0.15s infinite;
}

body.crt-off::after {
  animation: none !important;
}

@keyframes crtFlicker {
  0% { opacity: 0.015; }
  50% { opacity: 0.025; }
  100% { opacity: 0.015; }
}

.terminal-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(2, 6, 18, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.terminal-popup-overlay.active {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.terminal-popup-container {
  background: var(--bg-hud);
  border: 1px solid var(--border-steel);
  padding: 1.5rem;
  width: 520px;
  max-width: 90%;
  height: 360px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 240, 255, 0.08);
  display: flex;
  flex-direction: column;
  position: relative;
}

.terminal-popup-container::before {
  content: " ";
  position: absolute;
  top: 0; left: 0; right: 0; height: 1.5px;
  background: var(--accent-color);
  box-shadow: 0 0 8px var(--accent-color);
}

.terminal-popup-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  padding-bottom: 0.5rem;
  margin-bottom: 0.75rem;
}

.terminal-popup-body {
  flex: 1;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
  padding-right: 0.25rem;
}

.terminal-popup-body::-webkit-scrollbar {
  width: 4px;
}
.terminal-popup-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.06);
}

.terminal-popup-input-container {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-steel);
  padding: 0.4rem 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.terminal-prompt {
  color: var(--accent-color);
  margin-right: 0.5rem;
  font-weight: bold;
  animation: promptPulse 1.5s infinite;
}

@keyframes promptPulse {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}

#popup-terminal-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-white);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  width: 100%;
}

#popup-terminal-input::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

.terminal-close-btn {
  position: absolute;
  bottom: -32px;
  left: 0;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  cursor: pointer;
  transition: var(--transition-fast);
  padding: 0;
  display: flex;
  align-items: center;
}

.terminal-close-btn::before {
  content: "[";
}
.terminal-close-btn::after {
  content: " × ] CLOSE_TERMINAL";
}

.terminal-close-btn:hover {
  color: var(--accent-color);
  text-shadow: 0 0 5px var(--accent-color);
}

.lain-quote-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(1, 4, 11, 0.95);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.lain-quote-overlay.active {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.lain-quote-text {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  color: var(--accent-color);
  text-shadow: 0 0 10px var(--accent-color), 0 0 20px var(--accent-glow);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  text-align: center;
  padding: 2rem;
  border: 1px solid var(--border-steel);
  background: rgba(2, 6, 18, 0.9);
  animation: lainGlitch 2s infinite;
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.1);
}

@keyframes lainGlitch {
  0% { transform: skew(0deg); opacity: 1; }
  10% { transform: skew(3deg); opacity: 0.8; }
  11% { transform: skew(0deg); opacity: 1; }
  45% { transform: skew(0deg); }
  46% { transform: skew(-5deg); opacity: 0.9; }
  47% { transform: skew(0deg); opacity: 1; }
  80% { transform: skew(0deg); }
  81% { transform: skew(2deg); }
  82% { transform: skew(0deg); }
}

.music-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: bold;
  cursor: pointer;
  padding: 0 0.15rem;
  transition: var(--transition-fast);
  line-height: 1;
}

.music-close-btn:hover {
  color: var(--accent-color);
  text-shadow: 0 0 5px var(--accent-color);
}

.plexus-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  opacity: 0.35;
  transition: opacity 0.5s ease;
}

.matrix-rain-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.matrix-rain-canvas.active {
  opacity: 0.16;
}

.music-hud {
  top: 1.5rem;
  right: 1.5rem;
  width: 280px;
  height: auto;
}

.music-body {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.track-info {
  display: flex;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.03);
  padding: 0.4rem 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  gap: 0.2rem;
}

.track-title {
  color: var(--text-white);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-time {
  color: var(--accent-color);
}

.track-select {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-steel);
  color: var(--text-white);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  padding: 0.25rem 0.4rem;
  outline: none;
  cursor: default;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  height: 26px;
  box-sizing: border-box;
}

.track-select:hover, .track-select:focus {
  border-color: var(--accent-color);
  box-shadow: var(--node-glow);
}

.track-select option {
  background: #02050c;
  color: var(--text-white);
}

.music-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}

.music-btn {
  flex: 1;
  font-size: 0.62rem;
  padding: 0.3rem 0;
  text-align: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-steel);
  display: flex;
  align-items: center;
  justify-content: center;
}

.music-btn svg {
  width: 10px;
  height: 10px;
  stroke: currentColor;
  stroke-width: 2.5;
  fill: none;
  display: block;
}

.volume-container svg {
  width: 11px;
  height: 11px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  display: block;
  opacity: 0.7;
}

.music-btn:hover {
  background: var(--accent-color);
  color: var(--bg-baseplate);
  border-color: var(--accent-color);
  box-shadow: 0 0 8px var(--accent-glow);
}

.volume-container {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex: 1.5;
  padding-left: 0.2rem;
}

.volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  border-radius: 0;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 8px;
  height: 12px;
  background: var(--accent-color);
  cursor: pointer;
  border: none;
}

.volume-slider::-moz-range-thumb {
  width: 8px;
  height: 12px;
  background: var(--accent-color);
  cursor: pointer;
  border: none;
}

.music-status {
  font-size: 0.65rem;
  padding: 0.1rem 0.35rem;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}

.music-status.playing {
  background: var(--accent-glow);
  color: var(--accent-color);
  text-shadow: 0 0 5px var(--accent-color);
  box-shadow: 0 0 8px var(--accent-glow);
}

.boot-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #02040a;
  color: #c5d1e8;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  z-index: 11000;
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  transition: opacity 0.5s ease;
}

.power-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  margin: auto;
}

.power-btn {
  background: transparent;
  border: 2px solid var(--accent-color);
  border-radius: 50%;
  width: 86px;
  height: 86px;
  color: var(--accent-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
  transition: var(--transition-fast);
  box-shadow: 0 0 15px var(--accent-glow), inset 0 0 10px var(--accent-glow);
  outline: none;
}

.power-btn svg {
  width: 32px;
  height: 32px;
  stroke: currentColor;
  stroke-width: 2.2;
  fill: none;
  display: block;
}

.power-btn:hover {
  background: var(--accent-glow);
  box-shadow: 0 0 30px var(--accent-color), inset 0 0 20px var(--accent-color);
  transform: scale(1.04);
}

.power-btn:active {
  transform: scale(0.96);
}

.oldsite-hud {
  position: absolute;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: 10;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.oldsite-hud button {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  padding: 0.4rem 1rem;
  letter-spacing: 0.05em;
  font-weight: bold;
  border: 1px solid var(--border-steel);
}

.power-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  animation: promptPulse 2s infinite;
}

.boot-logs {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  width: 100%;
}

.boot-line {
  line-height: 1.4;
  white-space: pre-wrap;
}

.boot-line.ok::before {
  content: "[  OK  ] ";
  color: #00ff46;
  font-weight: bold;
}

.boot-line.info::before {
  content: "[ INFO ] ";
  color: var(--accent-color);
}

.boot-line.warn::before {
  content: "[ WARN ] ";
  color: #ff9900;
}

body {
  transition: background 0.8s ease, background-image 0.8s ease;
}

body.hovering-oldsite {
  background: linear-gradient(to bottom, #1a3c78 0%, #64b5f6 100%) !important;
  background-size: 100% 100% !important;
  animation: none !important;
}

body.hovering-oldsite .grid-tunnel-container {
  opacity: 0.15; 
}

#btn-goto-oldsite {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#btn-goto-oldsite:hover {
  background: #0d244d !important;
  color: #facc15 !important;
  border: 3px double #60a5fa !important;
  box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.6) !important;
  font-family: var(--font-mono) !important;
  font-size: 0.72rem !important;
  text-shadow: none !important;
  letter-spacing: 0.05em !important;
  transform: translate(-2px, -2px);
}
