/* 🔒 Base Layout */
body {
  background-color: black;
  color: #00ff00;
  font-family: 'Courier New', monospace;
  margin: 0;
  padding: 1rem;
  overflow: hidden;
  position: relative;
}

/* 🖥 Terminal */
#terminal {
  white-space: pre-wrap;
  z-index: 2;
  position: relative;
  margin-top: 60px;
  line-height: 1.4;
}

/* ⌨️ Input Field */
input {
  background: black;
  color: #00ff00;
  border: none;
  font-family: inherit;
  font-size: 16px;
  outline: none;
  width: 90%;
  z-index: 2;
}

/* 🎯 Mission HUD */
#objective {
  position: fixed;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(0, 255, 0, 0.1);
  color: #00ff00;
  padding: 6px 18px;
  border: 1px solid #00ff00;
  font-size: 14px;
  font-weight: bold;
  z-index: 10;
  animation: pulse 4s infinite;
  text-shadow: 0 0 5px #00ff00;
}

/* 🟢 Animation Pulse */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.hidden {
  display: none;
}

/* 🌈 Glow Background FX */
#glow-bg {
  position: fixed;
  width: 100vw;
  height: 100vh;
  top: 0; left: 0;
  background: radial-gradient(circle, rgba(0,255,0,0.05) 0%, transparent 70%);
  animation: glowPulse 6s infinite alternate;
  z-index: 0;
  pointer-events: none;
}

@keyframes glowPulse {
  0% { background-color: rgba(0,255,0,0.05); }
  100% { background-color: rgba(0,255,0,0.12); }
}

/* 🕸 CRT Overlay FX */
#crt-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 255, 0, 0.04),
    rgba(0, 255, 0, 0.04) 1px,
    transparent 1px,
    transparent 2px
  );
  pointer-events: none;
  z-index: 3;
  mix-blend-mode: overlay;
  animation: scanFlicker 2.5s infinite alternate;
}

@keyframes scanFlicker {
  0% { opacity: 0.08; }
  100% { opacity: 0.18; }
}

/* 💥 Flash Effect */
#flash-burst {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(255,255,255,0.1);
  z-index: 5;
  display: none;
  pointer-events: none;
}

.flash-now {
  display: block !important;
  animation: whiteFlash 0.2s ease-in-out forwards;
}

@keyframes whiteFlash {
  0%   { opacity: 0.7; }
  100% { opacity: 0; }
}

/* ⚠️ Shake Alert */
.shake {
  animation: screenShake 0.4s ease-in-out;
}

@keyframes screenShake {
  0%   { transform: translate(0px, 0px); }
  20%  { transform: translate(-2px, 2px); }
  40%  { transform: translate(2px, -2px); }
  60%  { transform: translate(-1px, 1px); }
  80%  { transform: translate(1px, -1px); }
  100% { transform: translate(0px, 0px); }
}

/* 👾 Glitch Text */
.glitch {
  text-shadow: 1px 0 red, -1px 0 blue;
  animation: textGlitch 0.3s infinite;
}

@keyframes textGlitch {
  0%, 100% { text-shadow: 1px 0 red, -1px 0 blue; }
  50% { text-shadow: -1px 0 red, 1px 0 blue; }
}

/* 🗺 Network Map Base */
#network-map {
  position: fixed;
  top: 70px;
  right: 200px;
  left: 200px;
  bottom: 20px;
  overflow: hidden;
  background: rgba(3, 83, 3, 0.8);
  border: 1px solid #00ff00;
  padding: 200px;
  z-index: 12;
  font-size: 12px;
  font-family: 'Courier New', monospace;
  box-shadow: 0 0 8px #00ff00;
  cursor: grab;
}
#map-content {
  position: relative;
  width: 4000px;
  height: 4000px;
  transform: translate(0px, 0px); /* default */
}

.node {
  position: absolute;
  padding: 4px 6px;
  z-index: 5; /* Higher than .link */
  background: rgba(0, 255, 0, 0.1);
  border: 1px solid #00ff00;
  border-radius: 4px;
  font-size: 11px;
  transition: transform 0.2s;
  text-align: center;
  white-space: nowrap;
  user-select: none;
}
.node:hover {
  background: rgba(0, 255, 0, 0.2);
  cursor: pointer;
}
.link {
  position: absolute;
  height: 2px;
  background: #00ff00;
  z-index: 0; /* really behind everything */
}


.overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: black;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

#title-box {
  text-align: center;
  color: #00ff00;
  font-family: monospace;
  animation: fadeIn 2s ease-in-out;
}

.subtitle {
  font-size: 14px;
  margin-bottom: 20px;
  color: #00dd00;
}

#enter-btn {
  padding: 10px 24px;
  background: #000;
  border: 1px solid #00ff00;
  color: #00ff00;
  font-family: monospace;
  cursor: pointer;
}

@keyframes fadeIn {
  0% { opacity: 0 }
  100% { opacity: 1 }
}
#help-cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 30px;
}

.card {
  background: rgba(0,255,0,0.07);
  border: 1px solid #00ff00;
  border-radius: 4px;
  padding: 10px 14px;
  width: 160px;
  font-family: monospace;
  font-size: 13px;
  color: #00ff00;
  text-align: left;
}
#button-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 14px;
}

#tutorial-btn,
#enter-btn {
  background: black;
  border: 1px solid #00ff00;
  color: #00ff00;
  padding: 10px 24px;
  font-family: monospace;
  cursor: pointer;
}

#tutorial-panel {
  max-height: none;
  overflow-x: hidden;
  overflow-y: visible;
  margin-top: 10px;
  scroll-behavior: smooth;
  transition: all 0.4s ease;

}

#tutorial-panel.hidden {
  max-height: 0;
  overflow: hidden;
}

#card-container {
  display: flex;
  gap: 14px;
  padding: 5px 10px;
}

.card {
  background: rgba(0,255,0,0.07);
  border: 1px solid #00ff00;
  border-radius: 4px;
  padding: 10px;
  width: 160px;
  font-family: monospace;
  font-size: 13px;
  color: #00ff00;
  flex-shrink: 0;
  animation: fadeInUp 0.4s ease-in;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.section {
  color: #00ff00;
  font-family: monospace;
  margin-top: 12px;
  cursor: pointer;
  border-top: 1px solid #0f0;
  padding-top: 8px;
}

.card-content {
  display: none;
  font-family: monospace;
  color: #00ff00;
  font-size: 13px;
  background: rgba(0,255,0,0.05);
  padding: 16px;
  overflow-y: auto;
  max-height: 60vh; /* ⬅ ensures scroll if it gets tall */

  margin-bottom: 8px;
  border-left: 2px solid #0f0;
  animation: fadeInSlide 0.3s ease;
  box-sizing: border-box;
  word-wrap: break-word;
  overflow-wrap: break-word;

}

.card-content pre {
  background: black;
  padding: 6px;
  border: 1px solid #0f0;
  overflow-x: auto;
}

@keyframes fadeInSlide {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideOutDown {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(20px); }
}
#credits-panel {
  background: rgba(0, 255, 0, 0.05);
  border-left: 2px solid #00ff00;
  padding: 16px;
  margin-top: 16px;
  font-family: monospace;
  font-size: 13px;
  color: #00ff00;
  animation: none;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
  text-align: left;
  line-height: 1.6;
  box-shadow: 0 0 8px rgba(0, 255, 0, 0.2);
  z-index: 10;
  position: relative;
}
#credits-btn {
  background: black;
  border: 1px solid #00ff00;
  color: #00ff00;
  padding: 10px 24px;
  font-family: monospace;
  cursor: pointer;
}