/* ══════════════════════════════════════════════════════════════════════
   Arcade Corner HUD (Score & Health)
   ══════════════════════════════════════════════════════════════════════
   Arcade HUD layout:
   - Silver beveled metallic portrait frame with player avatar
   - Light recessed badge with bold red stencil label
   - 3-slot vertical metal radiator grille / ammo vent
   - 8-digit zero-padded golden score readout with 3D outline
   - Multi-tier glossy golden-amber health meter (pulses danger red <= 30%) */

.game-hud {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  pointer-events: none;
  user-select: none;
  font-family:
    "Chakra Petch",
    "VT323",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  line-height: 1;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.65));
}

/* ─── Portrait Frame ──────────────────────────────────────────────────────── */
.game-hud-portrait-frame {
  flex-shrink: 0;
  padding: 2px;
  background: linear-gradient(135deg, #e6e6e6 0%, #999999 45%, #444444 100%);
  border: 2px solid #000000;
  border-radius: 4px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    inset 0 -1px 0 rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
}

.game-hud-portrait {
  width: 36px;
  height: 36px;
  border-radius: 2px;
  border: 1px solid #111111;
  background: #080808;
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.9);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.game-hud-portrait img,
.game-hud-portrait .pixel-icon {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

/* ─── Main Content (Fixed width to prevent score shifts from resizing health bar) ─ */
.game-hud-main {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 3px;
  width: 230px;
  flex-shrink: 0;
}

/* ─── Top Row: Badge + Grille + Score ─────────────────────────────────────── */
.game-hud-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
}

/* Recessed Light Cream "HEALTH × 9" Badge */
.game-hud-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: linear-gradient(180deg, #f8f5ee 0%, #ebe5d8 55%, #dfd7c8 100%);
  border: 1.5px solid #111111;
  border-radius: 2px;
  padding: 1px 5px;
  height: 18px;
  box-sizing: border-box;
  flex-shrink: 0;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -1px 0 rgba(0, 0, 0, 0.15),
    0 1px 2px rgba(0, 0, 0, 0.35);
}

.game-hud-badge-label {
  font-family: "Chakra Petch", "Impact", sans-serif;
  font-size: 13px;
  font-weight: 900;
  color: #d12215;
  letter-spacing: 0.5px;
  line-height: 1;
  text-transform: uppercase;
  text-shadow: 0.5px 0.5px 0 rgba(0, 0, 0, 0.2);
}

.game-hud-badge-cross {
  font-family: "Chakra Petch", sans-serif;
  font-size: 11px;
  font-weight: 900;
  color: #d12215;
  line-height: 1;
  margin: 0 1px;
  display: inline-block;
  transform: scale(0.9);
}

.game-hud-badge-count {
  font-family: "Chakra Petch", "Impact", sans-serif;
  font-size: 14px;
  font-weight: 900;
  color: #d12215;
  line-height: 1;
  text-shadow: 0.5px 0.5px 0 rgba(0, 0, 0, 0.2);
}

/* 3-Slot Vertical Metallic Grille / Ammo Vent */
.game-hud-grille {
  display: flex;
  gap: 2px;
  align-items: center;
  height: 16px;
  margin-left: 1px;
  margin-right: auto;
  flex-shrink: 0;
}

.game-hud-grille-bar {
  display: block;
  width: 4px;
  height: 15px;
  background: #151515;
  border: 1px solid #333333;
  border-radius: 1px;
  background-image: repeating-linear-gradient(
    180deg,
    #777777 0px,
    #777777 1px,
    #151515 1px,
    #151515 4px
  );
  box-shadow: inset 0 0 1px #000000;
}

/* Golden Amber Gradient Score Readout (00000400) */
.game-hud-score-display {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-left: auto;
  flex-shrink: 0;
}

.game-hud-score-digits {
  font-family: "Chakra Petch", "VT323", monospace;
  font-size: 20px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  letter-spacing: 2px;
  line-height: 1;
  display: inline-block;
  text-align: right;
  white-space: nowrap;
  background: linear-gradient(
    180deg,
    #fff799 0%,
    #ffc620 24%,
    #f58406 58%,
    #b84300 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 1px 0 #000000) drop-shadow(0 -1px 0 #000000)
    drop-shadow(1px 0 0 #000000) drop-shadow(-1px 0 0 #000000)
    drop-shadow(1px 1px 0 #000000) drop-shadow(-1px -1px 0 #000000)
    drop-shadow(1px -1px 0 #000000) drop-shadow(-1px 1px 0 #000000)
    drop-shadow(0 2px 1px rgba(0, 0, 0, 0.7));
}

/* ─── Bottom Row: Metallic Health Bar Track ───────────────────────────────── */
.game-hud-bar-container {
  width: 100%;
  flex-shrink: 0;
}

.game-hud-health-track {
  width: 100%;
  height: 13px;
  background: #15100a;
  border: 2px solid #000000;
  border-radius: 3px;
  padding: 1px;
  box-sizing: border-box;
  overflow: hidden;
  box-shadow:
    inset 0 0 0 1px #d6d6d6,
    inset 0 0 0 2px #5a5a5a,
    0 1px 3px rgba(0, 0, 0, 0.6);
}

.game-hud-health-fill {
  height: 100%;
  width: 100%;
  border-radius: 1px;
  background: linear-gradient(
    180deg,
    #fffbc2 0%,
    #ffd033 18%,
    #f8960e 50%,
    #d85400 80%,
    #9e2a00 100%
  );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -1px 0 rgba(0, 0, 0, 0.45);
  transition:
    width 0.25s cubic-bezier(0.4, 0, 0.2, 1),
    background 0.2s;
}

/* Danger Pulsing Red when Health is Low (<= 30%) */
.game-hud-health-fill.is-low {
  background: linear-gradient(
    180deg,
    #ffe0e0 0%,
    #ff4d4d 20%,
    #d81414 55%,
    #8b0808 100%
  );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(0, 0, 0, 0.5);
  animation: game-hud-pulse 0.6s ease-in-out infinite;
}

@keyframes game-hud-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}

/* ─── Mode-specific variations ────────────────────────────────────────────── */
.game-hud-score-only .game-hud-badge-cross,
.game-hud-score-only .game-hud-badge-count {
  display: none;
}

/* ─── Mobile Responsiveness ───────────────────────────────────────────────── */
@media (max-width: 480px) {
  .game-hud {
    top: 6px;
    left: 6px;
    gap: 3px;
  }
  .game-hud-portrait-frame {
    padding: 1px;
  }
  .game-hud-portrait {
    width: 28px;
    height: 28px;
  }
  .game-hud-main {
    width: 175px;
    gap: 2px;
  }
  .game-hud-badge {
    height: 15px;
    padding: 0 4px;
  }
  .game-hud-badge-label {
    font-size: 10px;
  }
  .game-hud-badge-cross {
    font-size: 9px;
  }
  .game-hud-badge-count {
    font-size: 11px;
  }
  .game-hud-grille-bar {
    width: 3px;
    height: 13px;
  }
  .game-hud-score-digits {
    font-size: 15px;
    letter-spacing: 1px;
  }
  .game-hud-health-track {
    height: 10px;
  }
}
