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

/* ── Site nav ─────────────────────────────────────────── */

.site-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 0 1.5rem;
  height: 44px;
  background: #13131a;
  border-bottom: 1px solid #2a2a38;
  position: relative;
  z-index: 200;
  flex-shrink: 0;
}

.site-nav__brand {
  font-weight: 700;
  font-size: 0.95rem;
  color: #e8e8f0;
  text-decoration: none;
  font-family: system-ui, sans-serif;
}

.site-nav__brand:hover { color: #fff; }

.site-nav__links {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

.site-nav__links a {
  color: #999;
  text-decoration: none;
  font-size: 0.85rem;
  font-family: system-ui, sans-serif;
}

.site-nav__links a:hover { color: #e8e8f0; }

/* ── Game body ─────────────────────────────────────────── */

body {
  background: #0a0a0f;
  margin: 0;
  font-family: 'Courier New', monospace;
  color: #e8e8e8;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

#game-wrap {
  position: relative;
}

#canvas {
  display: block;
  background: #111118;
}

/* ── HUD ─────────────────────────────────────────────────────────────────── */

#hud {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 8px 12px;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(0,0,0,0.6), transparent);
}

#hud-left, #hud-center, #hud-right {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.8rem;
}
#hud-center { align-items: center; }
#hud-right  { align-items: flex-end; }

#hud-lives  { display: flex; flex-wrap: wrap; gap: 3px; align-items: center; }
#hud-combo  { color: #f5a623; font-weight: bold; }
#hud-score  { font-size: 1rem; }
#hud-timer  { font-size: 1.4rem; font-weight: bold; }
#hud-round  { font-size: 0.75rem; color: #aaa; }
#hud-ammo   { display: flex; flex-wrap: wrap; gap: 2px; align-items: flex-end; }

/* ── Reload bar ──────────────────────────────────────────────────────────── */

#reload-bar-wrap {
  position: absolute;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  color: #7ec8e3;
  pointer-events: none;
}

#reload-bar {
  width: 120px;
  height: 6px;
  background: #333;
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

#reload-bar::after {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0;
  background: #7ec8e3;
  width: var(--progress, 0%);
  transition: width 0.05s linear;
}

/* ── Splash screen ───────────────────────────────────────────────────────── */

#overlay-splash {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 8%;
  background: transparent;
  cursor: pointer;
}

#overlay-splash p {
  font-family: 'Courier New', monospace;
  font-size: 1rem;
  color: rgba(255,255,255,0.75);
  letter-spacing: 3px;
  text-transform: uppercase;
  animation: splash-pulse 1.4s ease-in-out infinite;
}

@keyframes splash-pulse {
  0%, 100% { opacity: 0.4; }
  50%       { opacity: 1;   }
}

/* ── Overlays ────────────────────────────────────────────────────────────── */

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: rgba(0,0,0,0.82);
  text-align: center;
  padding: 24px;
}

#overlay-menu {
  background:
    linear-gradient(to top, rgba(0,0,0,0.88) 0%, rgba(0,0,0,0.35) 55%, rgba(0,0,0,0.15) 100%),
    url('assets/menu-bg.png') center / cover no-repeat;
  justify-content: flex-end;
  padding-bottom: 10%;
}

.overlay.hidden { display: none; }

.overlay h1 { font-size: 2.5rem; color: #f5a623; letter-spacing: 4px; }
.overlay h2 { font-size: 1.8rem; color: #f5a623; }

.overlay p, .controls-hint { color: #aaa; font-size: 0.85rem; }
.controls-hint kbd {
  background: #333;
  border: 1px solid #555;
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 0.8rem;
}

table { border-collapse: collapse; min-width: 260px; }
td { padding: 4px 12px; font-size: 0.9rem; }
td:first-child { color: #aaa; text-align: left; }
td:last-child  { text-align: right; font-weight: bold; color: #fff; }

button {
  background: #f5a623;
  color: #0a0a0f;
  border: none;
  border-radius: 4px;
  padding: 10px 28px;
  font-size: 1rem;
  font-family: inherit;
  font-weight: bold;
  cursor: pointer;
  letter-spacing: 1px;
  margin-top: 8px;
}
button:hover { background: #ffc04a; }

.btn-secondary {
  background: transparent;
  color: #aaa;
  border: 1px solid #555;
  margin-top: 0;
}
.btn-secondary:hover { background: rgba(255,255,255,0.08); color: #e8e8e8; }

/* ── Mobile controls ─────────────────────────────────────────────────────── */

#mobile-controls {
  position: absolute;
  bottom: 8px;
  left: 0; right: 0;
  display: none;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 12px;
}

@media (pointer: coarse) {
  #mobile-controls { display: flex; }
}

#mobile-left, #mobile-aim {
  display: flex;
  gap: 8px;
}

.mob-btn {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 8px;
  width: 56px;
  height: 56px;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  padding: 0;
}

#mob-fire {
  width: 80px;
  background: rgba(245,166,35,0.4);
  border-color: #f5a623;
  color: #f5a623;
  font-size: 0.75rem;
  font-weight: bold;
  letter-spacing: 1px;
}

.hidden { display: none !important; }
