/* ═══════════════════════════════════════════════════════════════
   LOVE HARD KILL HARDER — style.css
   Dark cinematic action theme
═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Oswald:wght@400;600;700&family=Inter:wght@400;500;600&display=swap');

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

/* ── Online dot pulse animation ────────────────────────────── */
@keyframes pulse-dot {
  0%, 100% { opacity: 1;   transform: scale(1);    }
  50%       { opacity: 0.4; transform: scale(0.75); }
}

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: #000;
  font-family: 'Inter', sans-serif;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

/* ── Canvas ────────────────────────────────────────────────── */
#gameCanvas {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 0;
}

/* ── Utility ───────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ═══════════════════════════════════════════════════════════
   OVERLAYS (screens layered above canvas)
═══════════════════════════════════════════════════════════ */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.overlay-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  width: min(92vw, 480px);
}

/* On game over, allow scrolling if too tall */
#gameOverScreen {
  align-items: flex-start;
  overflow-y: auto;
  padding: 20px 0;
}
#gameOverScreen .overlay-inner {
  margin: auto;
}

/* ── Start Screen ──────────────────────────────────────────── */
#startScreen {
  background: radial-gradient(ellipse at 50% 30%,
    rgba(180,20,20,0.35) 0%,
    rgba(0,0,0,0.88) 65%
  );
}

.logo-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: clamp(28px, 6vw, 48px);
}

.main-logo {
  max-width: 350px;
  width: 100%;
  height: auto;
  margin-bottom: 12px;
  filter: drop-shadow(0 0 20px rgba(230,57,70,0.5));
}

.hud-logo {
  max-width: 80px;
  height: auto;
  margin-bottom: 8px;
  filter: drop-shadow(0 0 10px rgba(230,57,70,0.4));
}


.game-badge {
  font-family: 'Oswald', sans-serif;
  font-size: clamp(11px, 2.5vw, 15px);
  font-weight: 600;
  letter-spacing: 5px;
  color: rgba(255,255,255,0.45);
}

.hint-text {
  margin-top: 22px;
  font-size: clamp(10px, 2vw, 13px);
  color: rgba(255,255,255,0.3);
  letter-spacing: 1px;
  text-align: center;
  line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════════════════ */
.btn {
  font-family: 'Oswald', sans-serif;
  font-size: clamp(15px, 3vw, 20px);
  font-weight: 700;
  letter-spacing: 3px;
  padding: clamp(12px,3vw,16px) clamp(32px,8vw,56px);
  border: none;
  border-radius: 3px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
  white-space: nowrap;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background 0.12s;
}
.btn:active::after { background: rgba(255,255,255,0.12); }

.btn-play {
  background: linear-gradient(135deg, #e63946 0%, #b01020 100%);
  color: #fff;
  box-shadow: 0 4px 24px rgba(230,57,70,0.55), 0 0 0 1px rgba(255,100,100,0.2) inset;
  font-size: clamp(18px, 4vw, 24px);
}
.btn-play:hover { transform: translateY(-3px); box-shadow: 0 8px 36px rgba(230,57,70,0.75); }
.btn-play:active { transform: translateY(0); }

.btn-arrow { font-size: 0.9em; }

.btn-primary {
  background: linear-gradient(135deg, #e63946 0%, #b01020 100%);
  color: #fff;
  box-shadow: 0 4px 20px rgba(230,57,70,0.45);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 28px rgba(230,57,70,0.65); }

.btn-secondary {
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.8);
  border: 1px solid rgba(255,255,255,0.18);
}
.btn-secondary:hover { background: rgba(255,255,255,0.14); color: #fff; }

.btn-ghost {
  background: transparent;
  color: rgba(255,255,255,0.45);
  border: 1px solid rgba(255,255,255,0.1);
  font-size: clamp(12px, 2.5vw, 15px);
  letter-spacing: 2px;
}
.btn-ghost:hover { color: rgba(255,255,255,0.7); border-color: rgba(255,255,255,0.25); }

.btn-watch {
  display: inline-block;
  background: linear-gradient(135deg, #ffd60a 0%, #e8a000 100%);
  color: #0a0a0f;
  font-family: 'Oswald', sans-serif;
  font-size: clamp(14px, 3vw, 18px);
  font-weight: 700;
  letter-spacing: 2px;
  padding: 10px 32px;
  border-radius: 3px;
  text-decoration: none;
  text-transform: uppercase;
  box-shadow: 0 4px 20px rgba(255,214,10,0.45);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn-watch:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(255,214,10,0.65); }

.btn-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
}

/* ═══════════════════════════════════════════════════════════
   HUD
═══════════════════════════════════════════════════════════ */
#hud {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: clamp(8px,2vw,14px) clamp(10px,2.5vw,18px);
  background: linear-gradient(to bottom, rgba(0,0,0,0.72) 0%, rgba(0,0,0,0) 100%);
  pointer-events: none;
}

.hud-left, .hud-right {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hud-right { align-items: flex-end; }

.hud-center {
  display: flex;
  flex-direction: row;
  gap: 8px;
  align-items: flex-start;
  pointer-events: all;
}

.hud-block { display: flex; flex-direction: column; }
.hud-block-r { align-items: flex-end; }

.hud-lbl {
  font-family: 'Oswald', sans-serif;
  font-size: clamp(8px, 1.6vw, 11px);
  color: rgba(255,255,255,0.45);
  letter-spacing: 2px;
  font-weight: 600;
}

.hud-val {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(26px, 5.5vw, 40px);
  color: #fff;
  line-height: 1;
  text-shadow: 0 0 12px rgba(255,255,255,0.25);
}

.hud-hs { color: #ffd60a; font-size: clamp(18px, 3.5vw, 26px); }

.hearts {
  display: flex;
  gap: 2px;
  font-size: clamp(14px, 3vw, 22px);
  line-height: 1;
}

/* Ammo HUD */
.hud-ammo {
  color: #00f0ff;
  font-size: clamp(22px, 4.5vw, 32px);
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

.hud-ammo.ammo-low {
  color: #e63946;
  text-shadow: 0 0 12px rgba(230, 57, 70, 0.8);
  animation: ammoPulse 0.4s infinite alternate;
}

@keyframes ammoPulse {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0.5; transform: scale(1.08); }
}



/* HUD icon buttons */
.icon-btn {
  background: rgba(0,0,0,0.45);
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.75);
  font-size: clamp(14px, 3vw, 18px);
  width: clamp(34px, 7vw, 44px);
  height: clamp(34px, 7vw, 44px);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  backdrop-filter: blur(6px);
}
.icon-btn:hover { background: rgba(255,255,255,0.15); color: #fff; }
.icon-btn:active { transform: scale(0.92); }

/* ═══════════════════════════════════════════════════════════
   MOBILE CONTROLS
═══════════════════════════════════════════════════════════ */
#mobileControls {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px max(20px, env(safe-area-inset-bottom, 20px));
  background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, transparent 100%);
  pointer-events: none;
}

.ctrl-btn {
  pointer-events: all;
  width: clamp(62px, 16vw, 82px);
  height: clamp(62px, 16vw, 82px);
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.22);
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: clamp(22px, 5.5vw, 30px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.09s, background 0.09s, border-color 0.09s;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.ctrl-btn:active {
  transform: scale(0.88);
  background: rgba(230,57,70,0.35);
  border-color: rgba(230,57,70,0.8);
}

.ctrl-fire {
  width: clamp(76px, 20vw, 100px);
  height: clamp(76px, 20vw, 100px);
  background: radial-gradient(circle at 40% 38%, rgba(230,57,70,0.5), rgba(120,0,10,0.4));
  border: 2px solid rgba(230,57,70,0.65);
  box-shadow: 0 0 20px rgba(230,57,70,0.35), 0 0 40px rgba(230,57,70,0.15);
  font-size: clamp(26px, 7vw, 36px);
}
.ctrl-fire:active {
  background: radial-gradient(circle at 40% 38%, rgba(255,100,100,0.75), rgba(230,57,70,0.55));
  box-shadow: 0 0 32px rgba(230,57,70,0.7);
}

/* ═══════════════════════════════════════════════════════════
   PAUSE & GAME OVER SCREENS
═══════════════════════════════════════════════════════════ */
.screen-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(52px, 12vw, 88px);
  letter-spacing: 4px;
  color: #e63946;
  text-shadow: 0 0 30px rgba(230,57,70,0.8), 0 0 70px rgba(230,57,70,0.35);
  margin-bottom: clamp(20px, 5vw, 36px);
  text-align: center;
}

.go-title {
  color: #ffd60a;
  text-shadow: 0 0 30px rgba(255,214,10,0.75), 0 0 70px rgba(255,100,0,0.4);
  /* Smaller on game over screen so everything fits */
  font-size: clamp(36px, 9vw, 60px);
  margin-bottom: 10px;
}

/* ── Scoreboard ───────────────────────────────────────────── */
.scoreboard {
  width: min(90vw, 340px);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: clamp(16px,4vw,24px) clamp(20px,5vw,36px);
  margin-bottom: clamp(20px,5vw,30px);
}

.sb-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: clamp(8px,2vw,12px) 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sb-row:last-child { border-bottom: none; }

.sb-lbl {
  font-family: 'Oswald', sans-serif;
  font-size: clamp(13px, 2.5vw, 16px);
  color: rgba(255,255,255,0.5);
  letter-spacing: 2px;
}

.sb-val {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(22px, 5vw, 32px);
  color: #fff;
}

.sb-gold .sb-lbl { color: #ffd60a; }
.sb-gold .sb-val { color: #ffd60a; text-shadow: 0 0 15px rgba(255,214,10,0.6); }

/* ═══════════════════════════════════════════════════════════
   WAVE BANNER
═══════════════════════════════════════════════════════════ */
.wave-banner {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.5);
  z-index: 30;
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(44px, 12vw, 80px);
  color: #ffd60a;
  letter-spacing: 6px;
  text-shadow:
    0 0 25px rgba(255,214,10,0.9),
    0 0 60px rgba(255,120,0,0.6),
    0 0 100px rgba(255,50,0,0.3);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.175,0.885,0.32,1.275);
}

.wave-banner.wb-show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.wave-banner.wb-hide {
  opacity: 0;
  transform: translate(-50%, -50%) scale(1.25);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

/* ═══════════════════════════════════════════════════════════
   COMBO DISPLAY
═══════════════════════════════════════════════════════════ */
.combo-display {
  position: fixed;
  top: 50%;
  right: clamp(12px, 3vw, 24px);
  transform: translateY(-50%);
  z-index: 10;
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(28px, 7vw, 50px);
  color: #ffd60a;
  text-shadow: 0 0 20px rgba(255,214,10,0.8);
  pointer-events: none;
  text-align: right;
  opacity: 0;
  transition: opacity 0.25s;
}
.combo-display.show { opacity: 1; }

/* ═══════════════════════════════════════════════════════════
   SCREEN ANIMATIONS (entry)
═══════════════════════════════════════════════════════════ */
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.overlay:not(.hidden) .overlay-inner {
  animation: fadeSlideIn 0.4s ease both;
}

/* Subtle pulse on the play button */
@keyframes pulseBorder {
  0%, 100% { box-shadow: 0 4px 24px rgba(230,57,70,0.55), 0 0 0 0 rgba(230,57,70,0.5); }
  50%       { box-shadow: 0 4px 24px rgba(230,57,70,0.55), 0 0 0 8px rgba(230,57,70,0); }
}
.btn-play { animation: pulseBorder 2.2s ease-in-out infinite; }
.btn-play:hover { animation: none; }

/* Heart pop animation */
@keyframes heartPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.4); }
  100% { transform: scale(1); }
}
.heart-pop { animation: heartPop 0.3s ease; }

/* ═══════════════════════════════════════════════════════════
   LEADERBOARD
═══════════════════════════════════════════════════════════ */
.leaderboard-section {
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 12px;
  text-align: center;
  width: 100%;
  max-width: 350px;
}
.leaderboard-start {
  margin-top: 10px;
  margin-bottom: 20px;
  background: rgba(0,0,0,0.6);
}
.lb-title {
  font-family: 'Oswald', sans-serif;
  font-size: 13px;
  color: #ffd60a;
  letter-spacing: 2px;
  margin-top: 0;
  margin-bottom: 8px;
}
.lb-message {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  margin-bottom: 6px;
}
.lb-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.lb-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 10px;
  background: rgba(255,255,255,0.05);
  margin-bottom: 4px;
  border-radius: 4px;
}
.lb-item:nth-child(1) { background: rgba(255,214,10,0.15); border-left: 3px solid #ffd60a; }
.lb-item:nth-child(2) { background: rgba(192,192,192,0.15); border-left: 3px solid #c0c0c0; }
.lb-item:nth-child(3) { background: rgba(205,127,50,0.15); border-left: 3px solid #cd7f32; }

.lb-name {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-align: left;
  text-overflow: ellipsis;
  padding-right: 10px;
}
.lb-score {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 15px;
  color: #fff;
  flex-shrink: 0;
}
.lb-item:nth-child(1) .lb-score { color: #ffd60a; }

.hud-lb-list {
  list-style: none;
  padding: 0;
  margin: 0;
  text-align: right;
}
.hud-lb-list li {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(14px, 3.5vw, 18px);
  color: #fff;
  opacity: 0.8;
}
.hud-lb-list li:nth-child(1) { color: #ffd60a; opacity: 1; text-shadow: 0 0 10px rgba(255,214,10,0.4); }
.hud-lb-list li:nth-child(2) { color: #c0c0c0; }
.hud-lb-list li:nth-child(3) { color: #cd7f32; }

/* ── Game Over single-row stats ──────────────────────────── */
.go-stats-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 8px 16px;
  margin-bottom: 12px;
  width: 100%;
  max-width: 350px;
}
.go-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  padding: 2px 8px;
}
.go-stat-lbl {
  font-family: 'Oswald', sans-serif;
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 2px;
}
.go-stat-val {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(20px, 5vw, 28px);
  color: #fff;
  line-height: 1;
}
.go-stat-divider {
  width: 1px;
  height: 36px;
  background: rgba(255,255,255,0.12);
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════
   FLOATING ACTOR BUBBLES
═══════════════════════════════════════════════════════════ */
#actorBubbles {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  overflow: hidden;
}

.actor-bubble {
  position: absolute;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.5),
    0 0 0 2px rgba(255, 255, 255, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  opacity: 0;
  will-change: transform, opacity;
  animation: bubbleFloat linear infinite;
}

.actor-bubble img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

@keyframes bubbleFloat {
  0% {
    opacity: 0;
    transform: translateY(0px) rotate(0deg) scale(0.85);
  }
  8% {
    opacity: 0.55;
    transform: translateY(-8px) rotate(2deg) scale(1);
  }
  25% {
    opacity: 0.55;
    transform: translateY(-18px) translateX(12px) rotate(-3deg) scale(1.02);
  }
  50% {
    opacity: 0.5;
    transform: translateY(-10px) translateX(-10px) rotate(5deg) scale(0.98);
  }
  75% {
    opacity: 0.55;
    transform: translateY(-22px) translateX(8px) rotate(-2deg) scale(1.01);
  }
  92% {
    opacity: 0.55;
    transform: translateY(-6px) rotate(1deg) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(0px) rotate(0deg) scale(0.85);
  }
}
