/* ============================================
   PROJECT RETRO-CRISP — Global Styles
   Aesthetic: Retro-Modern 2026
   Stack: Tailwind CDN + custom glow overrides
   ============================================ */

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

html {
  overflow: hidden;
  height: 100%;
}

body {
  font-family: 'Space Grotesk', sans-serif;
  background-color: #0f172a;   /* slate-900 */
  color: #f8fafc;              /* slate-50  */
  touch-action: manipulation;
  overscroll-behavior: none;   /* no bounce / pull-to-refresh on mobile */
  overflow: hidden;
  height: 100%;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
img, svg { display: block; max-width: 100%; }

/* --- Neon Glow Utilities --- */
.neon-text-cyan {
  text-shadow:
    0 0 8px  rgba(34, 211, 238, 0.8),
    0 0 20px rgba(34, 211, 238, 0.5);
}
.neon-text-pink {
  text-shadow:
    0 0 8px  rgba(236, 72, 153, 0.8),
    0 0 20px rgba(236, 72, 153, 0.5);
}
.neon-text-emerald {
  text-shadow:
    0 0 8px  rgba(52, 211, 153, 0.8),
    0 0 20px rgba(52, 211, 153, 0.5);
}
.neon-text-purple {
  text-shadow:
    0 0 8px  rgba(167, 139, 250, 0.8),
    0 0 20px rgba(167, 139, 250, 0.5);
}
.neon-text-orange {
  text-shadow:
    0 0 8px  rgba(251, 146, 60, 0.8),
    0 0 20px rgba(251, 146, 60, 0.5);
}

.neon-border-cyan {
  box-shadow:
    0 0 15px rgba(34, 211, 238, 0.2),
    inset 0 0 15px rgba(34, 211, 238, 0.05);
}
.neon-border-emerald {
  box-shadow:
    0 0 15px rgba(52, 211, 153, 0.2),
    inset 0 0 15px rgba(52, 211, 153, 0.05);
}
.neon-border-purple {
  box-shadow:
    0 0 15px rgba(167, 139, 250, 0.2),
    inset 0 0 15px rgba(167, 139, 250, 0.05);
}

/* --- Navigation --- */
.nav-link-active {
  background-color: #1e293b;   /* slate-800 */
  color: #22d3ee;              /* cyan-400  */
  border: 1px solid rgba(34, 211, 238, 0.3);
}
.nav-link-idle {
  color: #94a3b8;              /* slate-400 */
}
.nav-link-idle:hover {
  color: #f8fafc;
  background-color: #1e293b;
}

/* Hamburger lines */
.ham-line {
  display: block;
  height: 2px;
  background: #f8fafc;
  border-radius: 2px;
  transition: transform 250ms ease, opacity 250ms ease;
}
.hamburger.open .ham-line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open .ham-line:nth-child(2) { opacity: 0; }
.hamburger.open .ham-line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile drawer */
@media (max-width: 640px) {
  #nav-links {
    display: none;
    position: fixed;
    top: 64px;
    left: 0; right: 0;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.97);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(51, 65, 85, 0.6);
    z-index: 99;
  }
  #nav-links.open { display: flex; }
  #nav-links a { width: 100%; padding: 0.75rem 1rem; border-radius: 0.5rem; }
}

/* --- Canvas (shared across all game pages) --- */
canvas {
  display: block;
  width: 100%;
  max-width: 800px;
  height: auto;
  margin: 0 auto;
  border-radius: 1rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* --- Game overlay (start / game-over) --- */
.game-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(4px);
  border-radius: 1rem;
  transition: opacity 300ms ease;
}

/* --- Key badge (controls display) --- */
.key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  background: #1e293b;
  border: 1px solid #334155;
  border-bottom-width: 3px;
  border-radius: 5px;
  font-family: 'Space Grotesk', monospace;
  font-size: 0.7rem;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.03em;
}

/* --- Fade-in animation (tab switch) --- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.3s ease-in-out; }

/* --- Accessibility --- */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}
