:root {
  --bg-dark: #070913;
  --panel-bg: rgba(16, 22, 38, 0.75);
  --panel-border: rgba(0, 255, 178, 0.25);
  --primary: #00ffb2;
  --primary-glow: rgba(0, 255, 178, 0.4);
  --secondary: #ff007f;
  --secondary-glow: rgba(255, 0, 127, 0.4);
  --accent-purple: #7928ca;
  --accent-cyan: #00e5ff;
  --text-main: #f3f4f6;
  --text-muted: #94a3b8;
  --grid-line: rgba(255, 255, 255, 0.04);
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: 'Space Grotesk', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(0, 255, 178, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(255, 0, 127, 0.08) 0%, transparent 40%),
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 40px 40px, 40px 40px;
}

/* Scanline effect */
body::before {
  content: " ";
  display: block;
  position: fixed;
  top: 0; left: 0; bottom: 0; right: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%);
  background-size: 100% 4px;
  z-index: 999;
  pointer-events: none;
  opacity: 0.6;
}

.pixel-text {
  font-family: 'Press Start 2P', monospace;
  letter-spacing: -1px;
}

header {
  padding: 24px 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.1rem;
  color: var(--primary);
  text-shadow: 0 0 10px var(--primary-glow);
  text-decoration: none;
}

.logo-badge {
  width: 14px;
  height: 14px;
  background: var(--primary);
  box-shadow: 0 0 8px var(--primary);
  border-radius: 2px;
}

nav {
  display: flex;
  gap: 32px;
  align-items: center;
}

nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

nav a:hover {
  color: var(--text-main);
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.btn-nav {
  padding: 10px 20px;
  border: 1px solid var(--primary);
  color: var(--primary);
  background: transparent;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  font-family: 'Press Start 2P', monospace;
  transition: all 0.2s ease;
  text-shadow: 0 0 6px var(--primary-glow);
}

.btn-nav:hover {
  background: var(--primary);
  color: #070913;
  box-shadow: 0 0 18px var(--primary-glow);
}

main {
  max-width: 1300px;
  margin: 0 auto;
  padding: 40px 24px;
}

/* Hero Section */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
  padding: 40px 0 80px;
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.tagline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(0, 255, 178, 0.08);
  border: 1px solid var(--primary-glow);
  color: var(--primary);
  font-size: 0.75rem;
  width: fit-content;
}

.tagline-dot {
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--primary);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

h1 {
  font-size: 2.8rem;
  line-height: 1.3;
  letter-spacing: -1px;
}

h1 span.neon-green {
  color: var(--primary);
  text-shadow: 0 0 20px var(--primary-glow);
}

h1 span.neon-pink {
  color: var(--secondary);
  text-shadow: 0 0 20px var(--secondary-glow);
}

.hero-desc {
  font-size: 1.15rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  margin-top: 8px;
}

.btn-primary {
  padding: 16px 32px;
  background: linear-gradient(135deg, var(--primary), #00c78b);
  color: #070913;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 0 25px var(--primary-glow);
  transition: all 0.25s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 35px rgba(0, 255, 178, 0.65);
}

.btn-secondary {
  padding: 16px 28px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Live Game Box */
.game-showcase {
  position: relative;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), inset 0 0 20px rgba(0, 255, 178, 0.05);
  backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.game-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  font-size: 0.75rem;
}

.game-stat {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-val {
  color: var(--primary);
  font-size: 0.9rem;
}

.canvas-wrapper {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid rgba(0, 255, 178, 0.2);
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.8);
  background: #03060c;
}

canvas {
  display: block;
  image-rendering: pixelated;
}

.overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(7, 9, 19, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  backdrop-filter: blur(4px);
  transition: opacity 0.2s ease;
}

.overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.overlay-title {
  font-size: 1.1rem;
  color: var(--primary);
  text-shadow: 0 0 12px var(--primary-glow);
}

.game-controls-hint {
  margin-top: 14px;
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  gap: 16px;
  align-items: center;
}

.key-badge {
  padding: 3px 6px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  font-size: 0.7rem;
  color: var(--text-main);
}

/* Features Section */
.section-title {
  text-align: center;
  margin: 80px 0 40px;
}

.section-title h2 {
  font-size: 1.8rem;
  margin-bottom: 12px;
}

.section-title p {
  color: var(--text-muted);
  max-width: 550px;
  margin: 0 auto;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.feature-card {
  background: var(--panel-bg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 30px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--panel-border), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 255, 178, 0.3);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.feature-card:hover::before {
  opacity: 1;
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: 20px;
  display: inline-block;
}

.feature-card h3 {
  font-size: 1.2rem;
  margin-bottom: 12px;
}

.feature-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Leaderboard preview */
.leaderboard-section {
  margin-top: 80px;
  background: linear-gradient(180deg, rgba(16, 22, 38, 0.9), rgba(7, 9, 19, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 40px;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 24px;
  font-size: 0.9rem;
}

.leaderboard-table th {
  text-align: left;
  padding: 12px 16px;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.75rem;
}

.leaderboard-table td {
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

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

.rank-1 { color: #ffd700; font-weight: bold; }
.rank-2 { color: #c0c0c0; font-weight: bold; }
.rank-3 { color: #cd7f32; font-weight: bold; }

footer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 40px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 80px;
}

/* Responsive */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-content {
    align-items: center;
  }
  .hero-actions {
    justify-content: center;
  }
  header {
    padding: 20px;
  }
  nav a {
    display: none;
  }
}
