/* ============================================================
   games.css — Canvas / Game Container & HUD Styles
   ============================================================ */

/* ── Game Canvas Container ── */
.game-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Full-screen canvas */
.game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: auto;
  image-rendering: crisp-edges;    /* pixel art fallback */
  image-rendering: pixelated;
}

/* ── Game HUD Overlay (positioned over canvas) ── */
.game-hud {
  position: absolute;
  inset: 0;
  pointer-events: none;  /* allow clicks to pass through to canvas */
}

/* HUD top bar */
.game-hud__top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.5) 0%, transparent 100%);
}

/* HUD bottom bar */
.game-hud__bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(to top, rgba(0,0,0,0.5) 0%, transparent 100%);
}

/* Score display */
.game-score {
  font-family: "SF Mono", "Fira Code", "Courier New", monospace;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
  letter-spacing: 1px;
}

.game-score__label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  opacity: 0.6;
  margin-right: 6px;
}

/* Lives / Health bar */
.game-health {
  display: flex;
  align-items: center;
  gap: 6px;
}

.game-health__heart {
  width: 20px;
  height: 20px;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.4));
}

.game-health__heart--full {
  color: #ff3b30;
}

.game-health__heart--empty {
  color: rgba(255, 255, 255, 0.2);
}

/* Health bar (alternative) */
.game-health-bar {
  width: 120px;
  height: 8px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  overflow: hidden;
}

.game-health-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, #30d158 0%, #ffd60a 60%, #ff453a 100%);
  border-radius: 4px;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Level / wave indicator */
.game-level {
  font-family: "SF Mono", "Courier New", monospace;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
  letter-spacing: 0.5px;
}

/* Combo / multiplier */
.game-combo {
  font-family: "SF Display", "Helvetica Neue", sans-serif;
  font-size: 32px;
  font-weight: 800;
  color: #ffd60a;
  text-shadow: 0 0 12px rgba(255, 214, 10, 0.5), 0 2px 4px rgba(0,0,0,0.5);
  animation: comboPulse 0.4s ease;
}

@keyframes comboPulse {
  0%   { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* ── Game Over / Overlay Screens ── */
.game-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10;
  animation: overlayFadeIn 0.3s ease;
}

@keyframes overlayFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.game-overlay__title {
  font-size: 48px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
  text-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.game-overlay__subtitle {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 24px;
}

.game-overlay__score {
  font-size: 24px;
  font-weight: 700;
  color: #ffd60a;
  margin-bottom: 32px;
}

.game-overlay__btn {
  padding: 12px 32px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: var(--border-radius-lg);
  cursor: pointer;
  pointer-events: auto;
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.2s ease;
}

.game-overlay__btn:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 20px var(--accent-glow);
}

.game-overlay__btn:active {
  transform: scale(0.95);
}

/* ── Mini-game sidebar / status panel ── */
.game-sidebar {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 200px;
  padding: 16px;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  pointer-events: auto;
  overflow-y: auto;
}

.game-sidebar__title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 12px;
}

.game-sidebar__stat {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.game-sidebar__stat-value {
  font-weight: 600;
  color: #fff;
}

/* ── Mobile / small screen adjustments ── */
@media (max-width: 480px) {
  .game-hud__top,
  .game-hud__bottom {
    padding: 8px 10px;
  }

  .game-score {
    font-size: 16px;
  }

  .game-overlay__title {
    font-size: 32px;
  }

  .game-sidebar {
    width: 140px;
    padding: 10px;
  }
}
