/* ════════════════════════════════════════════════════
   NEON VOID — Style Sheet
   Cyberpunk / Dark Neon Aesthetic
════════════════════════════════════════════════════ */

:root {
  --neon-cyan:    #00f5ff;
  --neon-pink:    #ff2d78;
  --neon-purple:  #a020f0;
  --neon-yellow:  #ffe600;
  --dark-bg:      #010a0f;
  --dark-panel:   #040d14;
  --grid-color:   rgba(0, 245, 255, 0.07);
  --font-display: 'Orbitron', sans-serif;
  --font-mono:    'Share Tech Mono', monospace;
  --transition:   0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── RESET ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--dark-bg);
  color: #fff;
  font-family: var(--font-mono);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

/* ── CANVAS ──────────────────────────────────────── */
#game-canvas {
  position: fixed;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

/* ── SCREEN OVERLAYS ─────────────────────────────── */
.screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  background: rgba(1, 10, 15, 0.92);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.screen.active {
  opacity: 1;
  pointer-events: all;
}

/* ── SCANLINE EFFECT ─────────────────────────────── */
.scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 3px,
    rgba(0, 0, 0, 0.15) 3px,
    rgba(0, 0, 0, 0.15) 4px
  );
  pointer-events: none;
  z-index: 1;
}

/* ── ANIMATED BG GRID ────────────────────────────── */
.menu-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
  background-size: 50px 50px;
  animation: gridScroll 12s linear infinite;
  pointer-events: none;
}
@keyframes gridScroll {
  from { background-position: 0 0; }
  to   { background-position: 50px 50px; }
}

/* ── MAIN MENU CONTENT ───────────────────────────── */
.menu-content {
  position: relative;
  z-index: 2;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  padding: 2rem;
  max-width: 480px;
  width: 100%;
}

/* ── LOGO ────────────────────────────────────────── */
.logo-wrap { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; }

.logo-sub {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.5em;
  color: var(--neon-cyan);
  opacity: 0.7;
}

.logo-title {
  font-family: var(--font-display);
  font-size: clamp(4rem, 15vw, 7rem);
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #fff;
  text-shadow:
    0 0 10px var(--neon-cyan),
    0 0 30px var(--neon-cyan),
    0 0 80px rgba(0, 245, 255, 0.4);
  animation: titlePulse 3s ease-in-out infinite;
}
@keyframes titlePulse {
  0%, 100% { text-shadow: 0 0 10px var(--neon-cyan), 0 0 30px var(--neon-cyan), 0 0 80px rgba(0,245,255,0.4); }
  50% { text-shadow: 0 0 20px var(--neon-cyan), 0 0 60px var(--neon-cyan), 0 0 120px rgba(0,245,255,0.6); }
}

.logo-tagline {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.4em;
  color: var(--neon-pink);
  text-shadow: 0 0 8px var(--neon-pink);
}

/* ── HIGH SCORE DISPLAY ──────────────────────────── */
.hiscore-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  border: 1px solid rgba(0, 245, 255, 0.2);
  padding: 0.6rem 2rem;
  background: rgba(0, 245, 255, 0.03);
}
.hs-label {
  font-size: 0.6rem;
  letter-spacing: 0.4em;
  color: rgba(255,255,255,0.4);
}
.hs-value {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--neon-yellow);
  text-shadow: 0 0 10px var(--neon-yellow), 0 0 30px rgba(255,230,0,0.5);
  letter-spacing: 0.1em;
}

/* ── BUTTONS ─────────────────────────────────────── */
.menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  max-width: 260px;
}

.btn-primary {
  position: relative;
  padding: 1rem 2rem;
  background: transparent;
  border: 2px solid var(--neon-cyan);
  color: var(--neon-cyan);
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  cursor: pointer;
  overflow: hidden;
  transition: color var(--transition), background var(--transition);
  clip-path: polygon(8px 0%, 100% 0%, calc(100% - 8px) 100%, 0% 100%);
}
.btn-primary:hover {
  background: var(--neon-cyan);
  color: var(--dark-bg);
  box-shadow: 0 0 30px rgba(0, 245, 255, 0.6);
}
.btn-primary:active { transform: scale(0.97); }
.btn-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(0,245,255,0.2), transparent 70%);
  animation: btnPulse 2s ease-in-out infinite;
}
@keyframes btnPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

.btn-secondary {
  padding: 0.75rem 2rem;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.5);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition);
}
.btn-secondary:hover {
  border-color: rgba(255,255,255,0.4);
  color: rgba(255,255,255,0.85);
}

/* ── HOW TO PLAY ─────────────────────────────────── */
.controls-hint {
  background: rgba(0, 245, 255, 0.04);
  border: 1px solid rgba(0, 245, 255, 0.15);
  padding: 1rem 1.5rem;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.ctrl-row {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.6);
  letter-spacing: 0.05em;
}
kbd {
  display: inline-block;
  background: rgba(0,245,255,0.12);
  border: 1px solid rgba(0,245,255,0.3);
  border-radius: 3px;
  padding: 0.1em 0.4em;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--neon-cyan);
}

.version-tag {
  font-size: 0.55rem;
  letter-spacing: 0.3em;
  color: rgba(255,255,255,0.15);
}

/* ── GAME OVER SCREEN ────────────────────────────── */
.go-content {
  position: relative;
  z-index: 2;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  padding: 2rem;
  max-width: 420px;
  width: 100%;
}

.go-title-wrap { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; }
.go-subtitle {
  font-size: 0.65rem;
  letter-spacing: 0.5em;
  color: var(--neon-pink);
  text-shadow: 0 0 8px var(--neon-pink);
}
.go-title {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 12vw, 5.5rem);
  font-weight: 900;
  line-height: 0.9;
  color: var(--neon-pink);
  text-shadow:
    0 0 10px var(--neon-pink),
    0 0 40px rgba(255, 45, 120, 0.5);
  animation: glitch 4s infinite;
}

@keyframes glitch {
  0%, 90%, 100% { transform: none; filter: none; }
  91% { transform: translateX(-3px); filter: hue-rotate(90deg); }
  92% { transform: translateX(3px); filter: hue-rotate(-90deg); }
  93% { transform: translateX(-2px); }
  94% { transform: none; }
}

.go-stats {
  display: flex;
  align-items: center;
  gap: 2rem;
  width: 100%;
  justify-content: center;
}
.stat-block { display: flex; flex-direction: column; gap: 0.3rem; align-items: center; }
.stat-label {
  font-size: 0.55rem;
  letter-spacing: 0.4em;
  color: rgba(255,255,255,0.4);
}
.stat-value {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.1em;
}
.stat-value.hi {
  color: var(--neon-yellow);
  text-shadow: 0 0 15px var(--neon-yellow);
}
.stat-divider {
  width: 1px;
  height: 40px;
  background: rgba(255,255,255,0.15);
}

.new-record {
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  color: var(--neon-yellow);
  text-shadow: 0 0 15px var(--neon-yellow);
  animation: recordBlink 0.8s ease-in-out infinite;
}
@keyframes recordBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.go-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  max-width: 260px;
}

/* ── HUD ─────────────────────────────────────────── */
#hud {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: linear-gradient(to bottom, rgba(1,10,15,0.85) 0%, transparent 100%);
  pointer-events: none;
}
.hud-left, .hud-center, .hud-right {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.hud-center { align-items: center; }
.hud-right  { align-items: flex-end; }
.hud-label {
  font-size: 0.5rem;
  letter-spacing: 0.4em;
  color: rgba(255,255,255,0.35);
}
.hud-value {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.08em;
  text-shadow: 0 0 10px rgba(0,245,255,0.5);
}
.hud-lives {
  font-size: 1rem;
  letter-spacing: 0.3em;
  color: var(--neon-pink);
  text-shadow: 0 0 8px var(--neon-pink);
}

/* ── TOUCH CONTROLS ──────────────────────────────── */
#touch-controls {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 1.5rem 2rem 2rem;
  pointer-events: none;
}

#touch-joystick-area {
  pointer-events: all;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}
#touch-joystick-base {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 2px solid rgba(0, 245, 255, 0.3);
  background: rgba(0, 245, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
#touch-joystick-thumb {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 245, 255, 0.5);
  border: 2px solid var(--neon-cyan);
  box-shadow: 0 0 15px rgba(0, 245, 255, 0.6);
  position: absolute;
  transition: transform 0.05s;
}

#touch-fire-btn {
  pointer-events: all;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255, 45, 120, 0.15);
  border: 2px solid var(--neon-pink);
  color: var(--neon-pink);
  font-family: var(--font-display);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(255, 45, 120, 0.4);
  transition: background var(--transition), transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
#touch-fire-btn:active {
  background: rgba(255, 45, 120, 0.4);
  transform: scale(0.93);
}

/* ── RESPONSIVE ──────────────────────────────────── */
@media (max-width: 480px) {
  .logo-title { font-size: 4.5rem; }
  .go-title { font-size: 3.5rem; }
  #hud { padding: 0.75rem 1rem; }
  .hud-value { font-size: 0.9rem; }
}