@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600;700&display=swap');

:root {
  --bg: #0a0a0a;
  --bg-secondary: #111111;
  --green: #00ff41;
  --green-dim: #00cc33;
  --green-dark: #004d1a;
  --cyan: #00d4ff;
  --amber: #ffb000;
  --red: #ff3333;
  --magenta: #ff00ff;
  --white: #e0e0e0;
  --gray: #555555;
  --gray-light: #888888;
  --border: #1a3a1a;
  --font: 'IBM Plex Mono', 'Courier New', monospace;
  --glow: 0 0 10px rgba(0, 255, 65, 0.3);
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--green);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  overflow-x: hidden;
}

::selection {
  background: var(--green);
  color: var(--bg);
}

/* CRT Scanline Overlay */
.crt-overlay {
  pointer-events: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.15) 0px,
    rgba(0, 0, 0, 0.15) 1px,
    transparent 1px,
    transparent 3px
  );
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--green-dark); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--green-dim); }

/* ─── NAVIGATION ─── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 10, 10, 0.95);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
  padding: 0.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  color: var(--green);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  text-shadow: var(--glow);
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.nav-links a {
  color: var(--gray-light);
  text-decoration: none;
  font-size: 0.8rem;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--green);
  text-shadow: var(--glow);
}

/* ─── HERO ─── */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  position: relative;
}

.hero-ascii {
  color: var(--green);
  font-size: clamp(0.35rem, 1.2vw, 0.85rem);
  line-height: 1.2;
  white-space: pre;
  text-shadow: var(--glow);
  margin-bottom: 1rem;
  animation: flicker 4s infinite;
}

@keyframes flicker {
  0%, 97%, 100% { opacity: 1; }
  98% { opacity: 0.85; }
  99% { opacity: 0.95; }
}

.hero-subtitle {
  color: var(--gray-light);
  font-size: clamp(0.7rem, 1.5vw, 1rem);
  margin-bottom: 0.5rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.hero-tagline {
  color: var(--cyan);
  font-size: clamp(0.9rem, 2vw, 1.3rem);
  margin-bottom: 2rem;
  min-height: 1.6em;
}

.hero-tagline .cursor {
  display: inline-block;
  width: 0.6em;
  height: 1.1em;
  background: var(--green);
  margin-left: 2px;
  vertical-align: middle;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.hero-buttons {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.btn {
  display: inline-block;
  padding: 0.6rem 1.8rem;
  border: 1px solid var(--green);
  color: var(--green);
  text-decoration: none;
  font-family: var(--font);
  font-size: 0.85rem;
  cursor: pointer;
  background: transparent;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.btn:hover {
  background: var(--green);
  color: var(--bg);
  text-shadow: none;
  box-shadow: var(--glow);
}

.btn-secondary {
  border-color: var(--gray);
  color: var(--gray-light);
}

.btn-secondary:hover {
  background: var(--gray-light);
  color: var(--bg);
  border-color: var(--gray-light);
}

/* ─── SECTIONS ─── */
section {
  padding: 5rem 2rem;
  max-width: 1100px;
  margin: 0 auto;
}

.section-title {
  color: var(--cyan);
  font-size: 1.1rem;
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

.section-border {
  border: 1px solid var(--border);
  margin-bottom: 2rem;
  padding-bottom: 0.5rem;
}

.section-border::after {
  content: '';
  display: block;
  width: 100%;
  height: 1px;
  background: var(--border);
  margin-top: 0.5rem;
}

/* ─── LIVE STATS ─── */
.stats-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  padding: 2rem;
  max-width: 700px;
  margin: 0 auto 3rem;
}

.stats-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

.live-dot {
  width: 8px;
  height: 8px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 255, 65, 0.5); }
  50% { box-shadow: 0 0 0 6px rgba(0, 255, 65, 0); }
}

.stats-header span {
  color: var(--green);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.15em;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(0, 255, 65, 0.05);
}

.stat-label {
  color: var(--gray-light);
  font-size: 0.8rem;
}

.stat-value {
  color: var(--green);
  font-weight: 600;
  font-size: 0.9rem;
  text-shadow: var(--glow);
}

.stat-value.amber { color: var(--amber); text-shadow: 0 0 10px rgba(255, 176, 0, 0.3); }
.stat-value.cyan { color: var(--cyan); text-shadow: 0 0 10px rgba(0, 212, 255, 0.3); }
.stat-value.red { color: var(--red); text-shadow: 0 0 10px rgba(255, 51, 51, 0.3); }

/* ─── LORE ─── */
.lore-section {
  text-align: center;
  max-width: 700px;
  margin: 0 auto;
}

.lore-ascii {
  color: var(--green-dim);
  font-size: 0.7rem;
  line-height: 1.2;
  white-space: pre;
  margin-bottom: 1.5rem;
}

.lore-text {
  color: var(--white);
  font-size: 0.9rem;
  line-height: 1.8;
  font-style: italic;
}

.lore-text em {
  color: var(--cyan);
  font-style: normal;
}

/* ─── FEATURES ─── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.feature-card {
  border: 1px solid var(--border);
  padding: 1.5rem;
  background: var(--bg-secondary);
  transition: border-color 0.3s, box-shadow 0.3s;
}

.feature-card:hover {
  border-color: var(--green-dark);
  box-shadow: 0 0 20px rgba(0, 255, 65, 0.05);
}

.feature-icon {
  color: var(--green-dim);
  font-size: 0.65rem;
  line-height: 1.2;
  white-space: pre;
  margin-bottom: 0.8rem;
}

.feature-name {
  color: var(--cyan);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}

.feature-desc {
  color: var(--gray-light);
  font-size: 0.8rem;
  line-height: 1.5;
}

/* ─── TERMINAL PREVIEW ─── */
.terminal {
  background: #0c0c0c;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  max-width: 750px;
  margin: 1.5rem auto 0;
}

.terminal-bar {
  background: #1a1a1a;
  padding: 0.4rem 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  border-bottom: 1px solid var(--border);
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.terminal-dot.red { background: #ff5f56; }
.terminal-dot.yellow { background: #ffbd2e; }
.terminal-dot.green { background: #27c93f; }

.terminal-title {
  color: var(--gray);
  font-size: 0.7rem;
  margin-left: 0.5rem;
}

.terminal-body {
  padding: 1.2rem;
  height: 520px;
  overflow-y: auto;
  overflow-x: hidden;
  font-size: 0.8rem;
  line-height: 1.6;
  position: relative;
  scroll-behavior: smooth;
}

.terminal-body::-webkit-scrollbar { width: 4px; }
.terminal-body::-webkit-scrollbar-track { background: #0c0c0c; }
.terminal-body::-webkit-scrollbar-thumb { background: var(--green-dark); }

.terminal-body .prompt {
  color: var(--cyan);
}

.terminal-body .command {
  color: var(--white);
}

.terminal-body .output {
  color: var(--green);
}

.terminal-body .loot {
  color: var(--amber);
}

.terminal-body .enemy {
  color: var(--red);
}

.terminal-body .info {
  color: var(--gray-light);
}

.terminal-body .sector-art {
  color: var(--cyan);
  opacity: 0.6;
}

.terminal-line {
  min-height: 1.3em;
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 0.3s, transform 0.3s;
}

.terminal-line.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── LEADERBOARD ─── */
.leaderboard-table {
  width: 100%;
  max-width: 600px;
  margin: 1.5rem auto 0;
  border-collapse: collapse;
}

.leaderboard-table th {
  color: var(--cyan);
  text-align: left;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--green-dark);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.leaderboard-table td {
  padding: 0.4rem 1rem;
  border-bottom: 1px solid rgba(0, 255, 65, 0.05);
  font-size: 0.8rem;
}

.leaderboard-table tr:hover td {
  background: rgba(0, 255, 65, 0.03);
}

.lb-rank { color: var(--amber); font-weight: 600; }
.lb-name { color: var(--white); }
.lb-value { color: var(--green); text-shadow: var(--glow); }

.leaderboard-empty {
  color: var(--gray);
  text-align: center;
  padding: 2rem;
  font-style: italic;
}

/* ─── INSTALL ─── */
.install-steps {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  padding: 1.5rem;
  max-width: 650px;
  margin: 1.5rem auto 0;
}

.install-step {
  display: flex;
  align-items: flex-start;
  margin-bottom: 0.6rem;
}

.install-step .dollar {
  color: var(--cyan);
  margin-right: 0.5rem;
  user-select: none;
}

.install-step .cmd {
  color: var(--green);
}

.install-step .comment {
  color: var(--gray);
  margin-left: 1rem;
}

.commands-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.5rem;
  margin-top: 1.5rem;
  max-width: 650px;
  margin-left: auto;
  margin-right: auto;
}

.command-item {
  display: flex;
  gap: 0.8rem;
  padding: 0.3rem 0;
}

.command-item .cmd-name {
  color: var(--cyan);
  min-width: 100px;
}

.command-item .cmd-desc {
  color: var(--gray-light);
  font-size: 0.75rem;
}

/* ─── NPC GALLERY ─── */
.npc-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.2rem;
  margin-top: 1.5rem;
}

.npc-card {
  border: 1px solid var(--border);
  padding: 1.2rem;
  text-align: center;
  background: var(--bg-secondary);
  transition: border-color 0.3s;
}

.npc-card:hover {
  border-color: var(--cyan);
}

.npc-ascii {
  color: var(--cyan);
  font-size: 0.7rem;
  line-height: 1.2;
  white-space: pre;
  margin-bottom: 0.6rem;
}

.npc-name {
  color: var(--amber);
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.3rem;
}

.npc-quote {
  color: var(--gray-light);
  font-size: 0.75rem;
  font-style: italic;
}

/* ─── DEVELOPER ─── */
.dev-section {
  text-align: center;
}

.dev-avatar {
  color: var(--green);
  font-size: 0.65rem;
  line-height: 1.2;
  white-space: pre;
  margin-bottom: 1rem;
}

.dev-name {
  color: var(--white);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.dev-links {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  margin: 1rem 0;
}

.dev-links a {
  color: var(--cyan);
  text-decoration: none;
  font-size: 0.8rem;
  transition: color 0.2s;
}

.dev-links a:hover {
  color: var(--green);
  text-shadow: var(--glow);
}

.tech-stack {
  color: var(--gray-light);
  font-size: 0.75rem;
  margin-top: 1rem;
}

.tech-stack span {
  color: var(--green-dim);
  margin: 0 0.3rem;
}

/* ─── FOOTER ─── */
.footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
}

.footer-tagline {
  color: var(--green-dim);
  font-size: 0.85rem;
  margin-bottom: 1rem;
  text-shadow: var(--glow);
}

.footer-links {
  display: flex;
  gap: 2rem;
  justify-content: center;
  margin-bottom: 1rem;
}

.footer-links a {
  color: var(--gray-light);
  text-decoration: none;
  font-size: 0.75rem;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--green);
}

.footer-copy {
  color: var(--gray);
  font-size: 0.7rem;
}

/* ─── SCROLL ANIMATIONS ─── */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  .nav { padding: 0.5rem 1rem; }
  .nav-links { gap: 0.8rem; }
  .nav-links a { font-size: 0.7rem; }
  section { padding: 3rem 1rem; }
  .hero-ascii { font-size: clamp(0.25rem, 2.5vw, 0.6rem); }
  .features-grid { grid-template-columns: 1fr; }
  .npc-gallery { grid-template-columns: repeat(2, 1fr); }
  .hero-buttons { flex-direction: column; align-items: center; }
}

@media (max-width: 480px) {
  .npc-gallery { grid-template-columns: 1fr; }
  .commands-grid { grid-template-columns: 1fr; }
}
