/* 心脈奇境：暗黑聖殿 (Vascular Odyssey) — Diablo-Style Bio-Cathedral ARPG HUD & UI */
:root {
  --gold: #ffd166;
  --gold-soft: rgba(255, 209, 102, 0.38);
  --cyan: #00f5d4;
  --cyan-soft: rgba(0, 245, 212, 0.32);
  --crimson: #ff2a55;
  --panel-bg: rgba(16, 6, 18, 0.84);
  --panel-border: rgba(255, 209, 102, 0.45);
  --text-main: #f8f9fa;
  --text-muted: #d0bdd0;
  font-family: system-ui, -apple-system, "Noto Sans TC", "PingFang TC", sans-serif;
}

* {
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0d040a;
  color: var(--text-main);
}

#game-container {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  cursor: crosshair;
}

#game-container canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

/* Top Navigation & Realm Switcher Bar */
.vo-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  background: linear-gradient(180deg, rgba(12, 4, 14, 0.94), rgba(12, 4, 14, 0.0));
  pointer-events: none;
}

.vo-topbar > * {
  pointer-events: auto;
}

.vo-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text-main);
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  padding: 7px 14px;
  border-radius: 999px;
  backdrop-filter: blur(12px);
  font-weight: 700;
  font-size: 0.86rem;
  white-space: nowrap;
}

.vo-brand:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.vo-brand-heart {
  color: var(--crimson);
  font-size: 1rem;
}

.vo-realm-tabs {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  padding: 4px;
  border-radius: 999px;
  backdrop-filter: blur(12px);
}

.vo-realm-tabs button {
  background: transparent;
  border: 0;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 999px;
  font: 700 0.8rem inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s;
}

.vo-realm-tabs button:hover {
  color: #fff;
}

.vo-realm-tabs button.active {
  background: linear-gradient(135deg, #c9184a, #7209b7);
  color: #fff;
  box-shadow: 0 2px 12px rgba(201, 24, 74, 0.55);
}

.vo-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.vo-pill-btn {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  color: var(--gold);
  padding: 7px 13px;
  border-radius: 999px;
  font: 700 0.82rem inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  backdrop-filter: blur(12px);
  white-space: nowrap;
}

.vo-pill-btn:hover {
  background: rgba(255, 209, 102, 0.18);
}

/* Top-Left Quest Panel */
.vo-status-panel {
  position: fixed;
  top: 58px;
  left: 16px;
  z-index: 25;
  width: min(335px, calc(100vw - 32px));
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 10px 14px;
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
  pointer-events: none;
}

.realm-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

#realm-code {
  font-size: 0.7rem;
  font-weight: 900;
  color: var(--cyan);
  letter-spacing: 0.08em;
}

#realm-name {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--gold);
  flex: 1;
}

.score-badge {
  font-size: 0.78rem;
  font-weight: 800;
  color: #fff;
  background: rgba(255, 209, 102, 0.16);
  border: 1px solid rgba(255, 209, 102, 0.4);
  padding: 2px 8px;
  border-radius: 999px;
}

#quest-title {
  margin: 2px 0;
  font-size: 0.78rem;
  color: #f1faee;
  line-height: 1.4;
}

#quest-progress {
  margin: 4px 0 0;
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--gold);
}

/* Top-Center Diablo Monster / Boss Target Bar */
#target-hud {
  position: fixed;
  top: 58px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 28;
  width: min(470px, calc(100vw - 40px));
  background: rgba(22, 5, 14, 0.92);
  border: 2px solid #ff2a55;
  border-radius: 14px;
  padding: 8px 16px;
  text-align: center;
  box-shadow: 0 10px 36px rgba(255, 42, 85, 0.4);
  pointer-events: none;
}

.target-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 4px;
}

.target-rank {
  font-size: 0.66rem;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 999px;
  background: #ff2a55;
  color: #fff;
  letter-spacing: 0.08em;
}

.target-rank.boss {
  background: linear-gradient(135deg, #ffd166, #ff0055);
  color: #1a030c;
}

#target-name {
  font-family: Georgia, "Noto Serif TC", serif;
  font-size: 1rem;
  font-weight: 800;
  color: #ffd166;
}

.target-hp-track {
  position: relative;
  width: 100%;
  height: 15px;
  background: rgba(0, 0, 0, 0.65);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(255, 209, 102, 0.55);
}

#target-hp-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #9b0a28, #ff1e42, #ffbe0b);
  transition: width 0.12s;
}

#target-hp-text {
  position: absolute;
  inset: 0;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 14px;
  color: #fff;
  text-shadow: 0 1px 4px #000;
}

#target-weakness {
  display: block;
  margin-top: 4px;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--cyan);
}

/* Top-Right High-Detail Radar Minimap */
.vo-minimap-panel {
  position: fixed;
  top: 58px;
  right: 16px;
  z-index: 25;
  background: var(--panel-bg);
  border: 1.5px solid var(--panel-border);
  border-radius: 14px;
  padding: 8px 10px;
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
  pointer-events: none;
}

.minimap-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--gold);
}

#hud-location {
  color: var(--cyan);
  font-weight: 700;
  font-size: 0.7rem;
}

#minimap-canvas {
  display: block;
  border-radius: 9px;
  border: 1px solid rgba(255, 209, 102, 0.35);
  background: rgba(8, 3, 12, 0.9);
}

.minimap-legend {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  font-size: 0.66rem;
  color: var(--text-muted);
}

.minimap-legend span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.minimap-legend i {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.dot-switch { background: #00f5d4; }
.dot-enemy { background: #ff4d6d; }
.dot-hp { background: #38bdf8; }
.dot-boss { background: #ffd166; }

/* ========================================================================== */
/* DIABLO-STYLE BOTTOM HUD: RED HP GLOBE + CENTER SKILL BAR + BLUE MP GLOBE   */
/* ========================================================================== */
.diablo-hud {
  position: fixed;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 27;
  display: flex;
  align-items: flex-end;
  gap: 14px;
  pointer-events: none;
}

.diablo-hud > * {
  pointer-events: auto;
}

/* Glass HP & MP Orbs */
.globe-wrap {
  position: relative;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  padding: 5px;
  background: radial-gradient(circle at 30% 30%, #ffd166, #5c3a00 75%, #1f1105);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 18px rgba(255, 209, 102, 0.25);
  flex-shrink: 0;
}

.globe-sphere {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: #14040a;
  border: 2px solid rgba(255, 255, 255, 0.22);
}

.globe-liquid {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100%;
  transition: height 0.16s ease-out;
}

.hp-sphere .globe-liquid {
  background: linear-gradient(180deg, #ff5c77 0%, #d90429 45%, #690011 100%);
  box-shadow: 0 0 22px #ff1e42 inset;
}

.mp-sphere .globe-liquid {
  background: linear-gradient(180deg, #72efdd 0%, #0096c7 45%, #03045e 100%);
  box-shadow: 0 0 22px #00f5d4 inset;
}

.globe-shine {
  position: absolute;
  top: 8%;
  left: 14%;
  width: 36%;
  height: 24%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0));
  transform: rotate(-28deg);
  pointer-events: none;
}

.globe-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.95);
  pointer-events: none;
}

.globe-text strong {
  font-size: 0.88rem;
  font-weight: 900;
  color: #fff;
}

.globe-text small {
  font-size: 0.66rem;
  font-weight: 800;
  color: var(--gold);
  margin-top: 2px;
}

/* Center Potion Belt + 6 Skill Slots */
.diablo-bar-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.potion-belt {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 6, 20, 0.88);
  border: 1px solid rgba(255, 209, 102, 0.4);
  padding: 4px 10px;
  border-radius: 999px;
  backdrop-filter: blur(10px);
}

.belt-slot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 209, 102, 0.3);
  color: #fff;
  padding: 4px 10px;
  border-radius: 999px;
  font: 700 0.74rem inherit;
  cursor: pointer;
  transition: all 0.14s;
}

.belt-slot:hover {
  transform: translateY(-1px);
  border-color: var(--gold);
  background: rgba(255, 209, 102, 0.18);
}

.belt-slot.hp-belt b { color: #ff4d6d; font-size: 0.84rem; }
.belt-slot.mp-belt b { color: #4cc9f0; font-size: 0.84rem; }
.belt-slot.mode-switch-belt b { color: var(--gold); }

.belt-slot kbd {
  font-size: 0.64rem;
  color: var(--gold);
  background: rgba(0, 0, 0, 0.45);
  padding: 1px 5px;
  border-radius: 4px;
}

.vo-action-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--panel-bg);
  border: 1.5px solid var(--panel-border);
  padding: 7px 11px;
  border-radius: 16px;
  backdrop-filter: blur(14px);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.7);
}

.act-slot {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 6px 9px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 209, 102, 0.32);
  border-radius: 11px;
  color: #fff;
  cursor: pointer;
  transition: transform 0.12s, border-color 0.15s, background 0.15s;
}

.act-slot:hover, .act-slot:active {
  transform: translateY(-3px);
  border-color: var(--cyan);
  background: rgba(0, 245, 212, 0.18);
}

.act-slot.active-cast {
  border-color: var(--gold);
  box-shadow: 0 0 16px rgba(255, 209, 102, 0.65);
}

.act-icon {
  font-size: 1.28rem;
  line-height: 1.1;
}

.act-name {
  font-size: 0.72rem;
  font-weight: 800;
  margin-top: 2px;
  white-space: nowrap;
}

.act-cost {
  font-size: 0.62rem;
  color: #4cc9f0;
  font-weight: 700;
}

.act-cost.free {
  color: #00f5d4;
}

.act-key {
  font-size: 0.6rem;
  color: var(--gold);
  font-weight: 800;
  margin-top: 1px;
}

/* Center Realm Intro Banner */
#realm-banner {
  position: fixed;
  top: 23%;
  left: 50%;
  transform: translate(-50%, -12px);
  z-index: 35;
  width: min(650px, calc(100vw - 36px));
  background: radial-gradient(circle at center, rgba(32, 10, 26, 0.95), rgba(12, 4, 14, 0.94));
  border-top: 2px solid var(--gold);
  border-bottom: 2px solid var(--gold);
  padding: 18px 24px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s, transform 0.4s;
}

#realm-banner.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

#banner-code {
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: var(--cyan);
}

#banner-title {
  margin: 5px 0 8px;
  font-family: Georgia, "Noto Serif TC", serif;
  font-size: clamp(1.4rem, 3vw, 2.05rem);
  color: var(--gold);
}

#banner-desc {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.55;
  color: #f1faee;
}

/* Interact Prompt & Dialogue Box */
#interact-prompt {
  position: fixed;
  bottom: 138px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 28;
  background: linear-gradient(135deg, #ffd166, #f4a261);
  color: #1d0c18;
  font: 800 0.9rem inherit;
  padding: 8px 18px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(255, 209, 102, 0.5);
}

#dialogue-box {
  position: fixed;
  bottom: 134px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 38;
  width: min(660px, calc(100vw - 32px));
  background: rgba(18, 7, 22, 0.96);
  border: 2px solid var(--gold);
  border-radius: 18px;
  padding: 16px 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.75);
}

#dialogue-speaker {
  display: block;
  font-size: 0.94rem;
  font-weight: 800;
  color: var(--gold);
  margin-bottom: 5px;
}

#dialogue-text {
  margin: 0 0 12px;
  font-size: 0.92rem;
  line-height: 1.6;
  color: #fff;
}

#dialogue-next {
  background: var(--gold);
  color: #1f0d1d;
  border: 0;
  padding: 6px 15px;
  border-radius: 999px;
  font: 800 0.8rem inherit;
  cursor: pointer;
  float: right;
}

/* Floating Combat Damage Numbers & Loot Labels */
#float-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 29;
}

.float-dmg {
  position: absolute;
  transform: translate(-50%, -50%);
  font-weight: 900;
  font-size: 0.96rem;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.95);
  white-space: nowrap;
  animation: floatUp 0.9s ease-out forwards;
}

@keyframes floatUp {
  0% { opacity: 1; transform: translate(-50%, 0) scale(0.92); }
  35% { opacity: 1; transform: translate(-50%, -16px) scale(1.12); }
  100% { opacity: 0; transform: translate(-50%, -42px) scale(1.0); }
}

#game-toast {
  position: fixed;
  top: 136px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  background: rgba(16, 8, 22, 0.94);
  border: 1.5px solid var(--cyan);
  color: #fff;
  padding: 8px 18px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.86rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

#game-toast.show {
  opacity: 1;
}

/* Modals (Medical Codex & Victory) */
.vo-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(10, 4, 14, 0.84);
  backdrop-filter: blur(10px);
  display: grid;
  place-items: center;
  padding: 20px;
}

.vo-modal[hidden] {
  display: none !important;
}

.vo-modal-card {
  width: min(760px, 100%);
  max-height: 86vh;
  overflow-y: auto;
  background: #1c0b21;
  border: 2px solid var(--gold);
  border-radius: 22px;
  padding: 24px 28px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.78);
}

.vo-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.vo-modal-head h2 {
  margin: 0;
  font-family: Georgia, "Noto Serif TC", serif;
  color: var(--gold);
}

.codex-grid {
  display: grid;
  gap: 12px;
}

.codex-card {
  display: flex;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 209, 102, 0.25);
}

.codex-card.locked {
  opacity: 0.55;
}

.codex-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.codex-cat {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--cyan);
}

.codex-body h3 {
  margin: 2px 0 6px;
  font-size: 1rem;
  color: var(--gold);
}

.codex-body p {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.55;
  color: #e9ecef;
}

.vic-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.vic-btn {
  padding: 11px 20px;
  border-radius: 999px;
  border: 0;
  font: 800 0.92rem inherit;
  cursor: pointer;
}

.vic-btn.primary {
  background: linear-gradient(135deg, #ffd166, #f4a261);
  color: #1f0c19;
}

.vic-btn.secondary {
  background: rgba(0, 245, 212, 0.16);
  border: 1px solid var(--cyan);
  color: var(--cyan);
}

/* Mobile Touch Virtual Joystick */
#touch-joystick {
  position: fixed;
  bottom: 132px;
  left: 18px;
  z-index: 26;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(255, 209, 102, 0.38);
  display: none;
  place-items: center;
  touch-action: none;
}

#touch-knob {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--gold), #e76f51);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

@media (max-width: 920px), (pointer: coarse) {
  #touch-joystick {
    display: grid;
  }
  .globe-wrap {
    width: 74px;
    height: 74px;
  }
  .vo-minimap-panel {
    transform: scale(0.82);
    transform-origin: top right;
  }
  .vo-topbar {
    flex-wrap: wrap;
    padding: 6px 10px;
  }
  .vo-status-panel {
    top: 92px;
    left: 10px;
    width: 245px;
    padding: 8px 10px;
  }
  .act-slot {
    min-width: 54px;
    padding: 4px 5px;
  }
}
