/* style.css - Undersea Diablo Gothic UI & HUD */
:root {
  --diablo-gold: #eab308;
  --diablo-gold-glow: rgba(234, 179, 8, 0.4);
  --diablo-red: #ef4444;
  --diablo-blue: #0ea5e9;
  --panel-bg: rgba(6, 18, 30, 0.88);
  --panel-border: #334155;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #030a10;
  font-family: 'Cinzel', 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  color: #f1f5f9;
}

#game-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
}

/* Vignette Dark Corners */
.vignette-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  box-shadow: inset 0 0 140px rgba(0, 5, 12, 0.85);
}

/* HUD Layer */
#hud-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Top Bar: Stats & Minimap */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 16px 24px;
}

.top-left-stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stat-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel-bg);
  border: 1px solid #1e293b;
  border-left: 3px solid var(--diablo-gold);
  border-radius: 4px;
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
}

.wave-title {
  color: #38bdf8;
  font-size: 16px;
}

.pearl-badge {
  border-left-color: #38bdf8;
  color: #f0fdf4;
}

.pearl-icon {
  font-size: 16px;
  filter: drop-shadow(0 0 4px #38bdf8);
}

/* Boss Health Bar (Top Center) */
#boss-bar-container {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 480px;
  display: none;
  flex-direction: column;
  align-items: center;
  z-index: 15;
}

.boss-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 700;
  color: #f87171;
  text-shadow: 0 0 10px rgba(239, 68, 68, 0.8);
  margin-bottom: 6px;
}

.boss-bar-outer {
  width: 100%;
  height: 18px;
  background: rgba(15, 23, 42, 0.9);
  border: 2px solid #ef4444;
  border-radius: 9px;
  overflow: hidden;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.4);
  position: relative;
}

.boss-bar-inner {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #991b1b, #ef4444);
  transition: width 0.15s ease-out;
}

.boss-hp-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 11px;
  font-weight: bold;
  color: #ffffff;
  text-shadow: 0 1px 2px #000;
}

/* Minimap (Top Right) */
.minimap-container {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

#minimap-canvas {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: radial-gradient(circle, #092032 0%, #030d14 100%);
  border: 2px solid var(--diablo-gold);
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.8), inset 0 0 10px rgba(56, 189, 248, 0.3);
}

.hud-buttons {
  display: flex;
  gap: 6px;
  pointer-events: auto;
}

.btn-icon {
  background: var(--panel-bg);
  border: 1px solid #334155;
  color: #94a3b8;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-icon:hover {
  color: #fff;
  border-color: var(--diablo-gold);
}

/* Center Notifications & Prompts */
#prompt-f {
  position: absolute;
  top: 60%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(15, 23, 42, 0.95);
  border: 2px solid var(--diablo-gold);
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 16px;
  font-weight: 700;
  color: var(--diablo-gold);
  box-shadow: 0 0 20px var(--diablo-gold-glow);
  display: none;
  animation: pulsePrompt 1.2s infinite;
}

@keyframes pulsePrompt {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.06); }
}

#banner-notify {
  position: absolute;
  top: 25%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 28px;
  font-weight: 800;
  color: var(--diablo-gold);
  text-shadow: 0 0 16px rgba(234, 179, 8, 0.8);
  opacity: 0;
  transition: opacity 0.4s ease-out;
  pointer-events: none;
  text-align: center;
}

/* Combat Log (Bottom Left) */
#combat-log-container {
  position: absolute;
  bottom: 140px;
  left: 24px;
  width: 320px;
  height: 125px;
  background: rgba(3, 10, 18, 0.82);
  border: 1px solid #1e293b;
  border-radius: 6px;
  padding: 8px 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  pointer-events: auto;
  box-shadow: 0 4px 16px rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
}

.log-entry {
  font-size: 12px;
  line-height: 1.4;
  margin-bottom: 4px;
  opacity: 0.92;
  animation: fadeInLog 0.2s;
}

@keyframes fadeInLog {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 0.92; transform: translateY(0); }
}

.log-time { color: #64748b; margin-right: 4px; }
.log-system { color: #38bdf8; }
.log-combat { color: #cbd5e1; }
.log-loot { color: #facc15; font-weight: 600; }
.log-levelup { color: #4ade80; font-weight: bold; }
.log-ocean { color: #22d3ee; }
.log-alert { color: #f87171; font-weight: bold; }

/* Bottom Diablo Action Bar & Orbs */
.bottom-bar {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding-bottom: 12px;
}

/* Diablo Orbs (Red Health Left, Blue Mana Right) */
.orb-wrapper {
  position: absolute;
  bottom: 10px;
  width: 120px;
  height: 120px;
  pointer-events: auto;
}

.orb-left { left: 30px; }
.orb-right { right: 30px; }

.orb-frame {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 4px solid #1e293b;
  background: #020617;
  overflow: hidden;
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.9), inset 0 0 15px rgba(0, 0, 0, 0.9);
}

.orb-liquid {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transition: height 0.2s ease-out;
}

.hp-liquid {
  background: linear-gradient(180deg, #f87171 0%, #b91c1c 45%, #450a0a 100%);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.6);
}

.mana-liquid {
  background: linear-gradient(180deg, #38bdf8 0%, #0369a1 45%, #082f49 100%);
  box-shadow: 0 0 20px rgba(14, 165, 233, 0.6);
}

.orb-glass-reflection {
  position: absolute;
  top: 8px;
  left: 18px;
  width: 50px;
  height: 25px;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0) 100%);
  transform: rotate(-25deg);
  pointer-events: none;
}

.orb-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 14px;
  font-weight: 800;
  color: #ffffff;
  text-shadow: 0 2px 4px #000, 0 0 8px rgba(0,0,0,0.9);
  pointer-events: none;
  z-index: 5;
  text-align: center;
}

.orb-label {
  font-size: 11px;
  color: #cbd5e1;
  display: block;
}

/* Action Skills Bar (Center Bottom) */
.skills-container {
  display: flex;
  gap: 14px;
  background: var(--panel-bg);
  border: 2px solid #334155;
  border-bottom: none;
  border-radius: 12px 12px 0 0;
  padding: 10px 24px;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.7);
  pointer-events: auto;
  z-index: 5;
}

.skill-slot {
  position: relative;
  width: 58px;
  height: 58px;
  background: #091a29;
  border: 2px solid #475569;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.1s;
}

.skill-slot:hover {
  border-color: var(--diablo-gold);
  transform: translateY(-2px);
}

.skill-slot.skill-active-press {
  transform: scale(0.91) !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.8) !important;
}

.skill-icon {
  font-size: 22px;
}

.skill-key {
  position: absolute;
  bottom: 2px;
  right: 4px;
  font-size: 10px;
  font-weight: 800;
  color: #94a3b8;
  background: rgba(0, 0, 0, 0.6);
  padding: 1px 4px;
  border-radius: 3px;
}

.skill-mana {
  position: absolute;
  top: 2px;
  left: 4px;
  font-size: 9px;
  font-weight: 700;
  color: #38bdf8;
}

/* Skill CD Radial Sweep Overlay */
.skill-cd-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 15px;
  font-weight: bold;
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.1s;
}

.skill-slot.on-cd .skill-cd-overlay {
  opacity: 1;
}

/* Experience Bar Across Bottom */
.xp-bar-container {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 8px;
  background: #09121c;
  border-top: 1px solid #1e293b;
  overflow: hidden;
}

.xp-bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #b45309, #facc15);
  box-shadow: 0 0 10px var(--diablo-gold-glow);
  transition: width 0.2s ease-out;
}

.xp-bar-text {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: #fde047;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 3px #000;
  pointer-events: none;
  z-index: 6;
}

/* Modals: Start & Game Over */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(2, 6, 12, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  backdrop-filter: blur(6px);
}

.modal-card {
  width: 500px;
  background: #071524;
  border: 2px solid var(--diablo-gold);
  border-radius: 12px;
  padding: 32px;
  text-align: center;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.9), 0 0 20px var(--diablo-gold-glow);
  animation: popModal 0.3s ease-out;
}

@keyframes popModal {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.modal-title {
  font-size: 28px;
  color: var(--diablo-gold);
  margin-bottom: 12px;
  letter-spacing: 1px;
  text-shadow: 0 0 12px var(--diablo-gold-glow);
}

.modal-desc {
  font-size: 14px;
  color: #cbd5e1;
  line-height: 1.6;
  margin-bottom: 24px;
}

.controls-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 24px;
  text-align: left;
  background: rgba(15, 23, 42, 0.6);
  padding: 14px;
  border-radius: 8px;
  font-size: 13px;
}

.control-item b {
  color: var(--diablo-gold);
}

.btn-primary {
  display: inline-block;
  background: linear-gradient(180deg, #d97706 0%, #b45309 100%);
  color: #ffffff;
  font-size: 18px;
  font-weight: 700;
  border: 2px solid #fde047;
  border-radius: 6px;
  padding: 12px 36px;
  cursor: pointer;
  letter-spacing: 1px;
  box-shadow: 0 4px 15px rgba(217, 119, 6, 0.5);
  transition: all 0.2s;
}

.btn-primary:hover {
  background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.7);
}

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