/* ============================================================
   龙宫探宝 — Dragon Palace Treasure
   Top-Down Survival Roguelike — DOM Overlay Styles
   ============================================================ */

/* ---- Hide site nav on game page ---- */
body.game-active .site-nav { display: none !important; }
body.game-active { background: #061020; overflow: hidden; margin: 0; padding: 0; }

/* ---- Canvas Container ---- */
#game-wrapper {
  position: fixed;
  inset: 0;
  z-index: 1;
}
#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ---- HUD (above canvas) ---- */
#game-hud {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}
.hud-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 12px 16px;
}
.hud-left { display: flex; flex-direction: column; gap: 6px; }
.hud-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }

/* HP Bar */
.hp-bar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.hp-inner {
  height: 100%;
  border-radius: 5px;
  background: linear-gradient(90deg, #2060c0, #40a0e0);
  transition: width 0.3s ease;
}
.hp-outer {
  width: 160px;
  height: 12px;
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(32,96,192,0.4);
  border-radius: 6px;
  overflow: hidden;
}
.hp-label-text {
  font-family: var(--font-display);
  font-size: 0.7rem;
  color: #80c0e0;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.hp-num {
  font-size: 0.75rem;
  color: rgba(232,220,200,0.8);
  font-family: monospace;
  min-width: 55px;
}

/* O2 Bar */
.o2-bar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.o2-label-text {
  font-family: var(--font-display);
  font-size: 0.7rem;
  color: #80e0c0;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.o2-outer {
  width: 160px;
  height: 10px;
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(32,160,160,0.4);
  border-radius: 5px;
  overflow: hidden;
}
.o2-inner {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #20a0a0, #40e0e0);
  transition: width 0.3s ease;
}

/* Level + Wave */
.hud-stat {
  font-family: var(--font-display);
  font-size: 0.7rem;
  color: rgba(232,220,200,0.7);
  letter-spacing: 2px;
}
.hud-stat span { color: #40c0c0; }

/* ---- Death Screen ---- */
#death-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(10,6,4,0.9);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
}
#death-overlay.active { display: flex; }
.death-title {
  font-family: var(--font-chinese-display);
  font-size: 2.4rem;
  color: #c44d34;
  margin-bottom: 12px;
  text-shadow: 0 0 30px rgba(196,77,52,0.3);
}
.death-stats {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 20px;
}
.death-stat {
  text-align: center;
}
.death-stat-val {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: #e8d5b0;
}
.death-stat-label {
  font-size: 0.7rem;
  color: rgba(200,180,140,0.5);
  letter-spacing: 2px;
  text-transform: uppercase;
}
.death-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 24px;
}
.death-links a {
  font-size: 0.82rem;
  color: #40c0c0;
  text-decoration: none;
  padding: 8px 18px;
  border: 1px solid rgba(64,192,192,0.3);
  border-radius: 20px;
  transition: all 0.25s;
}
.death-links a:hover {
  border-color: #40c0c0;
  background: rgba(64,192,192,0.08);
}

/* ---- Mobile Controls ---- */
#mobile-controls {
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  display: none;
}
@media (max-width: 767px) {
  #mobile-controls { display: block; }
}
.mobile-joystick {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  width: 173px;
  height: 173px;
  background: rgba(32,160,160,0.1);
  border: 2px solid rgba(32,160,160,0.4);
  border-radius: 50%;
  pointer-events: auto;
  box-shadow: 0 0 30px rgba(32,160,160,0.08);
}
.mobile-joystick-knob {
  position: absolute;
  width: 48px;
  height: 48px;
  background-image: url(../../../images/white-dragon-horse/wlh-hero.jpg);
  background-size: cover;
  background-position: center 20%;
  border: 3px solid rgba(32,160,160,0.8);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: none;
  box-shadow: 0 0 18px rgba(32,160,160,0.3);
}
/* ---- Pause Hint ---- */
.pause-hint {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  font-size: 0.7rem;
  color: rgba(64,192,192,0.25);
  letter-spacing: 2px;
  pointer-events: none;
}

/* ---- Death Screen Enhanced ---- */
.death-img {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 20%;
  border: 3px solid rgba(64,176,192,0.6);
  box-shadow: 0 0 40px rgba(64,176,192,0.3);
  margin-bottom: 16px;
  animation: death-img-pulse 2s ease-in-out infinite;
}
@keyframes death-img-pulse {
  0%, 100% { box-shadow: 0 0 40px rgba(64,176,192,0.3); }
  50% { box-shadow: 0 0 60px rgba(64,176,192,0.5); }
}
.death-title-main {
  font-family: var(--font-chinese-display);
  font-size: 2.6rem;
  color: #40b0c0;
  text-shadow: 0 0 30px rgba(64,176,192,0.4);
  margin-bottom: 6px;
  animation: death-title-shake 0.6s ease-out;
}
@keyframes death-title-shake {
  0% { transform: translateX(-20px); opacity: 0; }
  30% { transform: translateX(12px); }
  60% { transform: translateX(-6px); }
  100% { transform: translateX(0); opacity: 1; }
}
.death-title-sub {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--accent-gold);
  text-shadow: 0 0 12px rgba(184,160,110,0.3);
  letter-spacing: 2px;
  margin-bottom: 24px;
}

/* ---- Pause hint update ---- */
.pause-hint {
  bottom: 16px;
  left: 50%;
  z-index: 15;
  font-size: 0.65rem;
  color: rgba(64,192,192,0.25);
  letter-spacing: 2px;
  pointer-events: none;
}
