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

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: #0b1a2e;
  font-family: Lato, "Helvetica Neue", -apple-system, "Segoe UI", sans-serif;
  -webkit-user-select: none; user-select: none;
}

#app, #c { position: fixed; inset: 0; }
#c { display: block; }

.hidden { display: none !important; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; color: #f5f2ec; z-index: 10; }

.stat-label {
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  opacity: 0.75; font-weight: 700;
}
.stat-value { font-size: 30px; font-weight: 800; line-height: 1.1; text-shadow: 0 2px 8px rgba(5,10,20,0.8); }

#hud-topleft { position: absolute; top: 18px; left: 22px; display: flex; gap: 28px; }
#hud-topleft .stat { display: flex; flex-direction: column; }

#hud-topright { position: absolute; top: 18px; right: 22px; display: flex; align-items: center; gap: 12px; }
#hud-best { font-size: 12px; opacity: 0.85; text-shadow: 0 1px 4px rgba(5,10,20,0.8); }
#mute-btn {
  pointer-events: auto; cursor: pointer;
  width: 34px; height: 34px; border-radius: 8px;
  border: 1px solid rgba(245,242,236,0.4);
  background: rgba(11,26,46,0.45); color: #f5f2ec; font-size: 16px;
}
#mute-btn:hover { border-color: #d63a30; }
#mute-btn.off { opacity: 0.45; text-decoration: line-through; }

#hud-bottomleft { position: absolute; bottom: 20px; left: 22px; width: 280px; }
#hp-row { display: flex; align-items: center; gap: 10px; }
#hp-bar {
  flex: 1; height: 14px; border-radius: 7px;
  border: 1px solid rgba(245,242,236,0.45);
  background: rgba(11,26,46,0.5); overflow: hidden;
}
#hp-fill {
  height: 100%; width: 100%;
  background: linear-gradient(90deg, #7fae5a, #a8c87f);
  transition: width 0.15s ease;
}
#hp-fill.low { background: linear-gradient(90deg, #b8452f, #d63a30); }

#hud-bottomright { position: absolute; bottom: 20px; right: 22px; text-align: right; }
#hud-ammo-label { display: block; margin-bottom: 6px; }
#weapon-slots { display: flex; gap: 8px; justify-content: flex-end; }
.slot {
  min-width: 96px; padding: 7px 10px 8px;
  border: 1px solid rgba(245,242,236,0.3);
  background: rgba(11,26,46,0.45);
  border-radius: 10px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  transition: border-color 0.15s, background 0.15s;
}
.slot .slot-key {
  font-size: 10px; font-weight: 800; opacity: 0.6;
  border: 1px solid rgba(245,242,236,0.35); border-radius: 4px;
  padding: 0 5px; line-height: 14px;
}
.slot .slot-name { font-size: 12px; font-weight: 700; white-space: nowrap; }
.slot .slot-ammo { font-size: 11px; opacity: 0.8; font-variant-numeric: tabular-nums; }
.slot.active {
  border-color: #d63a30;
  background: rgba(64,20,20,0.55);
  box-shadow: 0 0 14px rgba(214,58,48,0.35);
}
#weapon-status {
  margin-top: 8px; font-size: 12px; opacity: 0.9;
  text-shadow: 0 1px 4px rgba(5,10,20,0.8);
  max-width: 340px;
}
#weapon-status.busy { color: #ffd9a0; }

/* ---------- crosshair ---------- */
#crosshair {
  position: absolute; left: 50%; top: 50%;
  width: 0; height: 0;
  --gap: 9px; --len: 9px;
}
#crosshair i { position: absolute; background: #f5f2ec; box-shadow: 0 0 3px rgba(5,10,20,0.9); }
.ch-t { width: 2px; height: var(--len); left: -1px; top: calc(-1 * var(--gap) - var(--len)); }
.ch-b { width: 2px; height: var(--len); left: -1px; top: var(--gap); }
.ch-l { height: 2px; width: var(--len); top: -1px; left: calc(-1 * var(--gap) - var(--len)); }
.ch-r { height: 2px; width: var(--len); top: -1px; left: var(--gap); }

/* ---------- fx ---------- */
#vignette {
  position: absolute; inset: 0; opacity: 0; pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(214,58,48,0) 48%, rgba(180,25,18,0.6) 100%);
  transition: opacity 0.5s ease;
}
#vignette.hit { opacity: 1; transition: opacity 0.05s; }

#banner {
  position: absolute; left: 50%; top: 30%;
  transform: translate(-50%, -50%);
  font-size: 54px; font-weight: 800; letter-spacing: 0.06em;
  color: #f5f2ec; text-shadow: 0 3px 18px rgba(5,10,20,0.9);
  opacity: 0; white-space: nowrap;
}
#banner.show { animation: bannerIn 1.7s ease forwards; }
@keyframes bannerIn {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.7); }
  18%  { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
  28%  { transform: translate(-50%, -50%) scale(1); }
  75%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.02); }
}

#popups { position: absolute; inset: 0; overflow: hidden; }
.pop {
  position: absolute; font-weight: 800; font-size: 17px;
  color: #fffbe8; text-shadow: 0 2px 6px rgba(5,10,20,0.95);
  transform: translate(-50%, -50%);
  animation: popUp 0.9s ease-out forwards;
  white-space: nowrap;
}
.pop.score { color: #ffe9a8; }
.pop.baa { font-size: 20px; color: #fff; }
@keyframes popUp {
  0%   { opacity: 0; margin-top: 6px; }
  15%  { opacity: 1; }
  100% { opacity: 0; margin-top: -52px; }
}

/* ---------- overlays ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 20;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, rgba(11,26,46,0.55), rgba(11,26,46,0.82));
  backdrop-filter: blur(3px);
}
.panel {
  max-width: 620px; width: calc(100% - 48px);
  text-align: center; color: #f5f2ec;
  padding: 40px 44px;
}
.panel h1 {
  font-size: 58px; font-weight: 800; letter-spacing: 0.02em; line-height: 1.05;
}
.panel h1::after, .panel h2::after {
  content: ""; display: block; width: 64px; height: 4px;
  background: #4fb6d9; margin: 14px auto 0;
}
.panel h2 { font-size: 40px; font-weight: 800; }
.panel p { margin-top: 14px; font-size: 16px; opacity: 0.92; }
.panel .tag { font-size: 18px; font-style: italic; opacity: 0.85; }

#menu-controls {
  list-style: none; margin: 22px auto 0; display: inline-block; text-align: left;
}
#menu-controls li {
  font-size: 14px; padding: 3px 0; opacity: 0.9;
  font-variant-numeric: tabular-nums;
}
#menu-weapons {
  margin: 22px auto 0; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
}
.mw {
  border: 1px solid rgba(245,242,236,0.25); border-radius: 10px;
  padding: 9px 13px; min-width: 132px; text-align: left;
  background: rgba(5,10,20,0.35);
}
.mw b { display: block; font-size: 13px; color: #ffe9a8; }
.mw span { display: block; font-size: 11px; opacity: 0.75; margin-top: 3px; line-height: 1.35; }

.btn {
  margin-top: 28px;
  font: inherit; font-size: 18px; font-weight: 800; letter-spacing: 0.04em;
  color: #0b1a2e; background: #f5f2ec;
  border: none; border-radius: 10px;
  padding: 14px 46px; cursor: pointer;
  box-shadow: 0 4px 0 #b8b2a4;
  transition: transform 0.08s, box-shadow 0.08s, background 0.15s;
}
.btn:hover { background: #fff; transform: translateY(1px); box-shadow: 0 3px 0 #b8b2a4; }
.btn:active { transform: translateY(4px); box-shadow: 0 0 0 #b8b2a4; }

#menu-best, #go-best { font-size: 13px; opacity: 0.7; margin-top: 18px; }
#go-score {
  margin-top: 22px; font-size: 56px; font-weight: 800; color: #ffe9a8;
  text-shadow: 0 3px 14px rgba(5,10,20,0.8);
}
#go-score small { display: block; font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.7; margin-top: 4px; }
