/* ═══════════════════════════════════════════════════════════
   NEON BLITZ — Styles
   Palette: Volcanic Glass (#1A1A1A, #333, #FF6B2B, #FFB088)
   Fonts: Syne (display) + Space Mono (mono/HUD)
═══════════════════════════════════════════════════════════ */

:root {
  --bg-deep:    #0D0D0D;
  --bg-dark:    #1A1A1A;
  --bg-mid:     #242424;
  --bg-card:    #2A2A2A;
  --border:     #333333;
  --border-glow:#FF6B2B44;
  --orange:     #FF6B2B;
  --orange-lt:  #FFB088;
  --orange-dim: #FF6B2B88;
  --text-hi:    #F5F0EB;
  --text-mid:   #A89880;
  --text-lo:    #5A5040;
  --font-display: 'Syne', sans-serif;
  --font-mono:    'Space Mono', monospace;
  --radius:     4px;
  --glow:       0 0 20px #FF6B2B55, 0 0 60px #FF6B2B22;
  --glow-sm:    0 0 10px #FF6B2B66;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg-deep);
  color: var(--text-hi);
  font-family: var(--font-display);
  overflow-x: hidden;
  cursor: default;
}

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

/* ── Utility ── */
.accent { color: var(--orange); }
.hidden { display: none !important; }

/* ═══════════════════════════════════════════════════════════
   HEADER
═══════════════════════════════════════════════════════════ */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2rem;
  height: 60px;
  background: rgba(13,13,13,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.logo {
  display: flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 800; font-size: 1.3rem; letter-spacing: 0.05em;
  text-decoration: none; color: var(--text-hi);
}
.logo-icon { font-size: 1.4rem; filter: drop-shadow(0 0 8px var(--orange)); }
.logo-text .accent { color: var(--orange); }

.header-nav { display: flex; gap: 2rem; }
.nav-link {
  font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.1em;
  color: var(--text-mid); text-decoration: none; text-transform: uppercase;
  transition: color 0.2s;
}
.nav-link:hover { color: var(--orange); }

.header-coins {
  display: flex; align-items: center; gap: 0.4rem;
  font-family: var(--font-mono); font-size: 0.9rem; font-weight: 700;
  color: var(--orange-lt);
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 0.3rem 0.8rem; border-radius: 20px;
}

/* ═══════════════════════════════════════════════════════════
   HERO
═══════════════════════════════════════════════════════════ */
.hero {
  position: relative; min-height: 100vh;
  display: flex; align-items: center;
  padding: 100px 4rem 4rem;
  overflow: hidden;
}

.hero-bg-grid {
  position: absolute; inset: 0; z-index: 0;
  background-image:
    linear-gradient(rgba(255,107,43,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,107,43,0.06) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 40%, transparent 100%);
}

.hero-particles {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
}
.particle {
  position: absolute; width: 2px; height: 2px;
  background: var(--orange); border-radius: 50%;
  animation: float-particle linear infinite;
  opacity: 0;
}
@keyframes float-particle {
  0%   { transform: translateY(100vh) translateX(0); opacity: 0; }
  10%  { opacity: 0.8; }
  90%  { opacity: 0.4; }
  100% { transform: translateY(-10vh) translateX(var(--drift)); opacity: 0; }
}

.hero-content {
  position: relative; z-index: 2;
  max-width: 620px;
}

.hero-badge {
  display: inline-block;
  font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.15em;
  color: var(--orange); border: 1px solid var(--orange-dim);
  padding: 0.35rem 0.9rem; border-radius: 2px;
  margin-bottom: 1.5rem;
  background: rgba(255,107,43,0.08);
}

.hero-title {
  font-size: clamp(3rem, 7vw, 5.5rem);
  font-weight: 800; line-height: 1.0;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}
.hero-title-accent {
  color: var(--orange);
  text-shadow: var(--glow);
  display: block;
}

.hero-sub {
  font-size: 1.1rem; color: var(--text-mid); line-height: 1.7;
  margin-bottom: 2.5rem; max-width: 480px;
}

.hero-cta-group {
  display: flex; gap: 1rem; align-items: center;
  flex-wrap: wrap; margin-bottom: 3rem;
}

/* ── Buttons ── */
.btn-primary {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--orange); color: #0D0D0D;
  font-family: var(--font-display); font-weight: 800;
  font-size: 0.9rem; letter-spacing: 0.08em;
  padding: 0.85rem 2rem; border-radius: var(--radius);
  border: none; cursor: pointer; text-decoration: none;
  transition: all 0.2s; text-transform: uppercase;
  box-shadow: var(--glow-sm);
}
.btn-primary:hover {
  background: var(--orange-lt);
  transform: translateY(-2px);
  box-shadow: var(--glow);
}
.btn-primary.btn-large { font-size: 1.1rem; padding: 1rem 2.5rem; }

.btn-ghost {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: transparent; color: var(--text-mid);
  font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.05em;
  padding: 0.85rem 1.5rem; border-radius: var(--radius);
  border: 1px solid var(--border); cursor: pointer; text-decoration: none;
  transition: all 0.2s;
}
.btn-ghost:hover { border-color: var(--orange); color: var(--orange); }
.btn-ghost.btn-sm { padding: 0.5rem 1rem; font-size: 0.75rem; }

.btn-reward {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: transparent; color: var(--orange-lt);
  font-family: var(--font-display); font-weight: 700;
  font-size: 0.9rem; letter-spacing: 0.05em;
  padding: 0.85rem 1.8rem; border-radius: var(--radius);
  border: 2px solid var(--orange-dim); cursor: pointer;
  transition: all 0.2s; text-transform: uppercase;
}
.btn-reward:hover {
  background: rgba(255,107,43,0.15);
  border-color: var(--orange);
  box-shadow: var(--glow-sm);
}

.hero-stats {
  display: flex; align-items: center; gap: 2rem;
}
.stat { display: flex; flex-direction: column; gap: 0.2rem; }
.stat-num {
  font-family: var(--font-mono); font-size: 1.6rem; font-weight: 700;
  color: var(--orange-lt);
}
.stat-label {
  font-family: var(--font-mono); font-size: 0.65rem; letter-spacing: 0.12em;
  color: var(--text-lo); text-transform: uppercase;
}
.stat-divider { width: 1px; height: 40px; background: var(--border); }

/* Hero ship decoration */
.hero-ship-wrap {
  position: absolute; right: 8%; top: 50%; transform: translateY(-50%);
  z-index: 1; display: flex; align-items: center; justify-content: center;
  width: 300px; height: 300px;
}
.hero-ship {
  font-size: 5rem; z-index: 2; position: relative;
  animation: ship-hover 3s ease-in-out infinite;
  filter: drop-shadow(0 0 20px var(--orange));
}
@keyframes ship-hover {
  0%, 100% { transform: translateY(0) rotate(-10deg); }
  50%       { transform: translateY(-20px) rotate(-10deg); }
}
.hero-ring {
  position: absolute; border-radius: 50%;
  border: 1px solid var(--orange-dim);
  animation: ring-pulse 3s ease-in-out infinite;
}
.ring-1 { width: 160px; height: 160px; animation-delay: 0s; }
.ring-2 { width: 230px; height: 230px; animation-delay: 0.5s; opacity: 0.6; }
.ring-3 { width: 300px; height: 300px; animation-delay: 1s; opacity: 0.3; }
@keyframes ring-pulse {
  0%, 100% { transform: scale(1); opacity: 0.4; }
  50%       { transform: scale(1.05); opacity: 0.8; }
}

/* ═══════════════════════════════════════════════════════════
   AD BANNERS
═══════════════════════════════════════════════════════════ */
.ad-banner {
  display: flex; flex-direction: column; align-items: center;
  padding: 0.75rem 1rem;
  background: var(--bg-mid);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.ad-label {
  font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.1em;
  color: var(--text-lo); text-transform: uppercase; margin-bottom: 0.4rem;
}
.ad-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.3rem; padding: 1rem 2rem;
  background: var(--bg-card); border: 1px dashed var(--border);
  border-radius: var(--radius); min-height: 90px; width: 100%; max-width: 728px;
  color: var(--text-mid); font-size: 0.85rem; text-align: center;
}
.ad-placeholder small { color: var(--text-lo); font-family: var(--font-mono); font-size: 0.65rem; }
.ad-placeholder--tall {
  min-height: 300px; max-width: 160px; width: 160px;
  writing-mode: horizontal-tb;
}
.ad-slot--rectangle .ad-placeholder { max-width: 300px; min-height: 250px; }

.ad-inline {
  display: flex; flex-direction: column; align-items: center;
  margin: 3rem auto; gap: 0.4rem;
}

/* ═══════════════════════════════════════════════════════════
   SECTION COMMON
═══════════════════════════════════════════════════════════ */
.section-label {
  font-family: var(--font-mono); font-size: 0.65rem; letter-spacing: 0.2em;
  color: var(--orange); text-transform: uppercase; margin-bottom: 0.75rem;
}
.section-title {
  font-size: clamp(2rem, 4vw, 3rem); font-weight: 800;
  letter-spacing: -0.02em; margin-bottom: 2.5rem;
}

/* ═══════════════════════════════════════════════════════════
   GAME SECTION
═══════════════════════════════════════════════════════════ */
.game-section {
  padding: 5rem 2rem 4rem;
  text-align: center;
}

.game-layout {
  display: flex; align-items: flex-start; justify-content: center;
  gap: 1.5rem; margin-top: 1rem;
}

.ad-sidebar {
  display: flex; flex-direction: column; align-items: center;
  padding-top: 60px; /* align with canvas */
}

.game-wrap {
  position: relative; flex-shrink: 0;
}

.game-hud {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--bg-card); border: 1px solid var(--border);
  border-bottom: none; padding: 0.6rem 1.2rem;
  border-radius: var(--radius) var(--radius) 0 0;
}
.hud-item { display: flex; flex-direction: column; align-items: center; gap: 0.1rem; }
.hud-label {
  font-family: var(--font-mono); font-size: 0.55rem; letter-spacing: 0.15em;
  color: var(--text-lo); text-transform: uppercase;
}
.hud-value {
  font-family: var(--font-mono); font-size: 1rem; font-weight: 700;
  color: var(--orange-lt);
}

#gameCanvas {
  display: block;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  image-rendering: pixelated;
}

/* ── Overlays ── */
.game-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(13,13,13,0.92);
  backdrop-filter: blur(4px);
  border-radius: 0 0 var(--radius) var(--radius);
  z-index: 10;
}
.overlay-content {
  display: flex; flex-direction: column; align-items: center;
  gap: 1rem; padding: 2rem; text-align: center; max-width: 380px;
}
.overlay-icon { font-size: 3rem; }
.overlay-title {
  font-size: 2rem; font-weight: 800; letter-spacing: 0.05em;
  color: var(--text-hi);
}
.overlay-sub { color: var(--text-mid); font-size: 0.9rem; line-height: 1.6; }

.controls-hint {
  display: flex; gap: 1.5rem;
  font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-lo);
}
.overlay-earn-note {
  font-family: var(--font-mono); font-size: 0.75rem; color: var(--orange-lt);
}

.final-stats {
  display: flex; gap: 1.5rem; margin: 0.5rem 0;
}
.final-stat {
  display: flex; flex-direction: column; align-items: center; gap: 0.2rem;
}
.final-stat span { font-family: var(--font-mono); font-size: 0.65rem; color: var(--text-lo); text-transform: uppercase; }
.final-stat strong { font-family: var(--font-mono); font-size: 1.2rem; color: var(--text-hi); }
.accent-stat strong { color: var(--orange-lt); }

.gameover-actions { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; }

.name-entry {
  display: flex; gap: 0.5rem; width: 100%;
}
.name-entry input {
  flex: 1; background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-hi); font-family: var(--font-mono); font-size: 0.8rem;
  padding: 0.5rem 0.8rem; border-radius: var(--radius); outline: none;
}
.name-entry input:focus { border-color: var(--orange); }
.name-entry input::placeholder { color: var(--text-lo); }

/* ── Mobile controls ── */
.mobile-controls {
  display: none; justify-content: center; gap: 1rem;
  margin-top: 1.5rem;
}
.mobile-btn {
  width: 70px; height: 70px; border-radius: 50%;
  background: var(--bg-card); border: 2px solid var(--border);
  color: var(--text-hi); font-size: 1.4rem; cursor: pointer;
  transition: all 0.15s; user-select: none;
}
.mobile-btn:active, .mobile-btn--shoot:active {
  background: var(--orange); border-color: var(--orange); color: #0D0D0D;
  transform: scale(0.92);
}
.mobile-btn--shoot { background: rgba(255,107,43,0.15); border-color: var(--orange-dim); }

/* ═══════════════════════════════════════════════════════════
   EARN SECTION
═══════════════════════════════════════════════════════════ */
.earn-section {
  padding: 5rem 4rem;
  background: var(--bg-mid);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.earn-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.earn-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 2rem 1.5rem;
  position: relative; transition: all 0.25s;
}
.earn-card:hover {
  border-color: var(--orange-dim);
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(255,107,43,0.12);
}
.earn-card--highlight {
  border-color: var(--orange);
  background: linear-gradient(135deg, var(--bg-card), rgba(255,107,43,0.08));
  box-shadow: var(--glow-sm);
}
.earn-icon { font-size: 2.2rem; margin-bottom: 1rem; }
.earn-card h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.6rem; }
.earn-card p { color: var(--text-mid); font-size: 0.88rem; line-height: 1.6; }
.earn-card strong { color: var(--orange-lt); }
.earn-badge {
  position: absolute; top: -10px; right: 1rem;
  background: var(--orange); color: #0D0D0D;
  font-family: var(--font-mono); font-size: 0.6rem; font-weight: 700;
  letter-spacing: 0.1em; padding: 0.2rem 0.6rem; border-radius: 2px;
}

/* ═══════════════════════════════════════════════════════════
   LEADERBOARD
═══════════════════════════════════════════════════════════ */
.leaderboard-section {
  padding: 5rem 4rem;
  max-width: 900px; margin: 0 auto;
}

.leaderboard-tabs {
  display: flex; gap: 0.5rem; margin-bottom: 1.5rem;
}
.lb-tab {
  font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.1em;
  text-transform: uppercase; padding: 0.5rem 1.2rem;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-mid); cursor: pointer; border-radius: var(--radius);
  transition: all 0.2s;
}
.lb-tab.active, .lb-tab:hover {
  background: var(--orange); color: #0D0D0D; border-color: var(--orange);
}

.leaderboard-wrap {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.leaderboard-header {
  display: grid; grid-template-columns: 60px 1fr 120px 80px 100px;
  padding: 0.75rem 1.5rem;
  background: var(--bg-mid); border-bottom: 1px solid var(--border);
  font-family: var(--font-mono); font-size: 0.65rem; letter-spacing: 0.12em;
  color: var(--text-lo); text-transform: uppercase;
}
.lb-row {
  display: grid; grid-template-columns: 60px 1fr 120px 80px 100px;
  padding: 0.9rem 1.5rem; border-bottom: 1px solid var(--border);
  align-items: center; transition: background 0.15s;
}
.lb-row:last-child { border-bottom: none; }
.lb-row:hover { background: rgba(255,107,43,0.05); }
.lb-row.rank-1 { background: rgba(255,107,43,0.1); }
.lb-row.rank-2 { background: rgba(255,107,43,0.06); }
.lb-row.rank-3 { background: rgba(255,107,43,0.03); }
.lb-rank {
  font-family: var(--font-mono); font-weight: 700; font-size: 1rem;
  color: var(--text-lo);
}
.lb-rank.gold   { color: #FFD700; text-shadow: 0 0 10px #FFD70066; }
.lb-rank.silver { color: #C0C0C0; }
.lb-rank.bronze { color: #CD7F32; }
.lb-name { font-weight: 600; font-size: 0.95rem; }
.lb-score, .lb-wave, .lb-coins {
  font-family: var(--font-mono); font-size: 0.85rem; color: var(--text-mid);
}
.lb-coins { color: var(--orange-lt); }

/* ═══════════════════════════════════════════════════════════
   SHOP
═══════════════════════════════════════════════════════════ */
.shop-section {
  padding: 5rem 4rem;
  background: var(--bg-mid);
  border-top: 1px solid var(--border);
}

.shop-balance {
  display: flex; align-items: center; gap: 1rem;
  font-family: var(--font-mono); font-size: 0.85rem; color: var(--text-mid);
  margin-bottom: 2rem;
}
.balance-amount {
  font-size: 1.4rem; font-weight: 700; color: var(--orange-lt);
}

.shop-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem; margin-bottom: 3rem;
}

.shop-item {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem; text-align: center;
  transition: all 0.25s; cursor: pointer;
}
.shop-item:hover {
  border-color: var(--orange-dim);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(255,107,43,0.1);
}
.shop-item.owned { border-color: #4CAF50; opacity: 0.7; }
.shop-item-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.shop-item-name { font-weight: 700; font-size: 0.95rem; margin-bottom: 0.4rem; }
.shop-item-desc { color: var(--text-mid); font-size: 0.78rem; line-height: 1.5; margin-bottom: 1rem; }
.shop-item-price {
  font-family: var(--font-mono); font-size: 0.9rem; font-weight: 700;
  color: var(--orange-lt);
}
.shop-item-price.owned-label { color: #4CAF50; }

/* ═══════════════════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════════════════ */
.site-footer {
  background: var(--bg-dark); border-top: 1px solid var(--border);
  padding: 3rem 4rem;
}
.footer-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; flex-direction: column; align-items: center; gap: 1.5rem;
  text-align: center;
}
.footer-logo {
  font-family: var(--font-display); font-weight: 800; font-size: 1.2rem;
  letter-spacing: 0.1em; color: var(--orange);
}
.footer-links {
  display: flex; gap: 2rem; flex-wrap: wrap; justify-content: center;
}
.footer-links a {
  font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-lo);
  text-decoration: none; transition: color 0.2s;
}
.footer-links a:hover { color: var(--orange); }
.footer-note {
  font-family: var(--font-mono); font-size: 0.65rem; color: var(--text-lo);
  max-width: 600px; line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════
   TOAST
═══════════════════════════════════════════════════════════ */
.toast {
  position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%) translateY(100px);
  background: var(--bg-card); border: 1px solid var(--orange);
  color: var(--text-hi); font-family: var(--font-mono); font-size: 0.85rem;
  padding: 0.75rem 1.5rem; border-radius: var(--radius);
  box-shadow: var(--glow-sm); z-index: 999;
  transition: transform 0.3s ease;
  pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .hero { padding: 100px 2rem 4rem; }
  .hero-ship-wrap { display: none; }
  .game-layout { flex-direction: column; align-items: center; }
  .ad-sidebar { display: none; }
  #gameCanvas { width: 100%; max-width: 600px; height: auto; }
  .mobile-controls { display: flex; }
  .earn-section, .leaderboard-section, .shop-section { padding: 4rem 1.5rem; }
  .leaderboard-header, .lb-row { grid-template-columns: 50px 1fr 100px 60px; }
  .leaderboard-header span:last-child, .lb-coins { display: none; }
}

@media (max-width: 600px) {
  .site-header { padding: 0 1rem; }
  .header-nav { display: none; }
  .hero-stats { gap: 1rem; }
  .stat-num { font-size: 1.2rem; }
  .hero-cta-group { flex-direction: column; align-items: flex-start; }
  .final-stats { gap: 1rem; }
  .gameover-actions { flex-direction: column; }
}

/* ═══════════════════════════════════════════════════════════
   ENTRANCE ANIMATIONS
═══════════════════════════════════════════════════════════ */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero-badge    { animation: fade-up 0.6s ease 0.1s both; }
.hero-title    { animation: fade-up 0.6s ease 0.2s both; }
.hero-sub      { animation: fade-up 0.6s ease 0.35s both; }
.hero-cta-group{ animation: fade-up 0.6s ease 0.45s both; }
.hero-stats    { animation: fade-up 0.6s ease 0.55s both; }

/* Scan line effect on canvas */
#gameCanvas::after {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    0deg, transparent, transparent 2px,
    rgba(0,0,0,0.03) 2px, rgba(0,0,0,0.03) 4px
  );
  pointer-events: none;
}