* { margin: 0; padding: 0; box-sizing: border-box; }
body { overflow: hidden; background: #000; font-family: 'Segoe UI', sans-serif; color: #c8b68e; cursor: crosshair; }
#game-container { position: relative; width: 100vw; height: 100vh; }
#game-canvas { width: 100%; height: 100%; display: block; }

/* HUD Bottom Bar */
#hud {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: flex-end;
  padding: 0 10px 10px; pointer-events: none; z-index: 10;
}

/* Orbs */
.orb {
  width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle, #1a0a0a 0%, #0a0505 100%);
  border: 3px solid #3a2a1a; position: relative; overflow: hidden;
  pointer-events: auto;
}
.orb-fill {
  position: absolute; bottom: 0; left: 0; right: 0;
  transition: height 0.3s;
}
#health-fill { background: linear-gradient(to top, #8b0000, #ff2020); height: 100%; }
#mana-fill { background: linear-gradient(to top, #00008b, #4040ff); height: 100%; }
.orb-text {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  font-size: 14px; font-weight: bold; text-shadow: 0 0 4px #000, 0 0 4px #000;
  color: #fff; z-index: 1;
}
.orb-label {
  position: absolute; bottom: 8px; width: 100%; text-align: center;
  font-size: 10px; color: #888; z-index: 1;
}

/* Center HUD */
#center-hud { flex: 1; max-width: 600px; margin: 0 20px; }
#skill-bar {
  display: flex; justify-content: center; gap: 8px; margin-bottom: 6px;
}
.skill-slot {
  width: 50px; height: 50px; background: rgba(30,20,10,0.9);
  border: 2px solid #3a2a1a; border-radius: 6px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  pointer-events: auto; cursor: pointer;
}
.skill-slot.active { border-color: #c8b68e; box-shadow: 0 0 10px rgba(200,182,142,0.3); }
.skill-icon { font-size: 22px; }
.skill-name { font-size: 7px; color: #888; }

/* XP Bar */
#xp-bar-container {
  height: 20px; background: #1a1008; border: 1px solid #3a2a1a;
  border-radius: 3px; position: relative; overflow: hidden;
}
#xp-bar-fill {
  height: 100%; width: 0%; background: linear-gradient(to right, #4a0, #8f0);
  transition: width 0.3s;
}
#xp-bar-text {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  font-size: 11px; color: #fff; text-shadow: 0 0 3px #000;
}

/* Flask Bar */
#flask-bar {
  position: fixed; bottom: 140px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 4px; z-index: 10;
}
.flask-slot {
  width: 36px; height: 60px; background: rgba(20,15,10,0.9);
  border: 1px solid #3a2a1a; border-radius: 4px;
  position: relative; overflow: hidden;
  display: flex; align-items: flex-end; justify-content: center;
}
.flask-slot span { position: relative; z-index: 1; font-size: 10px; padding-bottom: 2px; color: #888; }
.flask-fill {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, #2a6a2a, #4ad04a); height: 100%;
  transition: height 0.3s;
}

/* Headhunter Buffs */
#hh-buffs {
  position: fixed; top: 10px; right: 10px;
  display: flex; flex-wrap: wrap; gap: 4px; max-width: 300px; z-index: 10;
}
.hh-buff {
  padding: 3px 8px; background: rgba(180,150,50,0.8);
  border: 1px solid #ffd700; border-radius: 3px;
  font-size: 10px; color: #fff; white-space: nowrap;
  animation: buffPulse 2s infinite;
}
@keyframes buffPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Soul Eater Display */
#soul-eater-display {
  position: fixed; top: 10px; left: 10px;
  background: rgba(80,0,120,0.8); border: 1px solid #a040ff;
  padding: 6px 12px; border-radius: 4px; font-size: 14px; z-index: 10;
}
#soul-eater-display.hidden { display: none; }

/* Monster Info */
#monster-info {
  position: fixed; top: 50px; left: 50%; transform: translateX(-50%);
  background: rgba(10,8,5,0.9); border: 1px solid #3a2a1a;
  padding: 8px 16px; border-radius: 4px; text-align: center;
  min-width: 200px; z-index: 10;
}
#monster-info.hidden { display: none; }
#monster-name { font-size: 16px; font-weight: bold; margin-bottom: 4px; }
#monster-name.normal { color: #ccc; }
#monster-name.magic { color: #4488ff; }
#monster-name.rare { color: #ffcc00; }
#monster-hp-bar {
  height: 6px; background: #1a0808; border-radius: 3px; overflow: hidden;
  margin-bottom: 4px;
}
#monster-hp-fill { height: 100%; background: #c00; transition: width 0.15s; }
#monster-mods { font-size: 10px; color: #8888ff; }

/* Inventory Panel */
#inventory-panel {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 700px; max-height: 80vh; background: rgba(15,12,8,0.95);
  border: 2px solid #3a2a1a; border-radius: 6px; z-index: 100;
  overflow-y: auto;
}
#inventory-panel.hidden { display: none; }
#inv-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px; border-bottom: 1px solid #3a2a1a;
}
#inv-header h2 { font-size: 18px; }
#inv-close {
  background: none; border: none; color: #c8b68e; font-size: 24px;
  cursor: pointer;
}
#inv-content { display: flex; padding: 16px; gap: 16px; }

/* Equipment Grid */
#equipment-panel { flex: 0 0 280px; }
#equipment-panel h3 { font-size: 14px; margin-bottom: 8px; color: #888; }
#equipment-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px;
}
.equip-slot {
  background: rgba(30,25,15,0.9); border: 1px solid #2a2010;
  padding: 8px; border-radius: 4px; min-height: 60px;
  cursor: pointer; position: relative;
}
.equip-slot:hover { border-color: #c8b68e; }
.equip-slot.has-item { border-color: #555; }
.equip-slot.has-item.unique-item { border-color: #af6025; }
.equip-slot.has-item.rare-item { border-color: #ff0; }
.equip-slot.has-item.magic-item { border-color: #44f; }
.slot-label { font-size: 10px; color: #555; margin-bottom: 4px; }
.slot-item { font-size: 11px; color: #c8b68e; }
.slot-item .item-name { font-weight: bold; }

/* Bag Grid */
#bag-panel { flex: 1; }
#bag-panel h3 { font-size: 14px; margin-bottom: 8px; color: #888; }
#bag-grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px;
}
.bag-cell {
  width: 55px; height: 55px; background: rgba(25,20,12,0.9);
  border: 1px solid #2a2010; border-radius: 3px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; text-align: center; cursor: pointer; padding: 2px;
  word-break: break-word; line-height: 1.2;
}
.bag-cell:hover { border-color: #c8b68e; }
.bag-cell.has-item { border-color: #555; }
.bag-cell.normal-item { color: #ccc; }
.bag-cell.magic-item { color: #4488ff; border-color: #224488; }
.bag-cell.rare-item { color: #ffcc00; border-color: #886600; }
.bag-cell.unique-item { color: #af6025; border-color: #af6025; }
.bag-cell.currency-item { color: #aa9e82; border-color: #aa9e82; }

/* Item Tooltip */
#item-tooltip {
  position: fixed; z-index: 200; pointer-events: none;
  background: rgba(10,8,5,0.95); border: 1px solid #3a2a1a;
  padding: 10px 14px; border-radius: 4px; max-width: 320px;
  font-size: 12px; line-height: 1.5;
}
#item-tooltip.hidden { display: none; }
#tooltip-name { font-size: 16px; font-weight: bold; }
#tooltip-name.normal { color: #ccc; }
#tooltip-name.magic { color: #4488ff; }
#tooltip-name.rare { color: #ffcc00; }
#tooltip-name.unique { color: #af6025; }
#tooltip-type { color: #888; font-size: 11px; margin-bottom: 6px; }
#tooltip-separator { border-top: 1px solid #3a2a1a; margin: 6px 0; }
#tooltip-stats { color: #888; }
#tooltip-stats .stat-line { margin: 2px 0; }
#tooltip-mods { color: #4488ff; margin-top: 6px; }
#tooltip-mods .mod-line { margin: 2px 0; }
#tooltip-mods .mod-line.crafted { color: #b4b4ff; }
#tooltip-mods .mod-line.unique-mod { color: #af6025; }
#tooltip-mods .mod-line.splode { color: #ff4444; font-weight: bold; }
#tooltip-flavor { color: #af6025; font-style: italic; margin-top: 8px; font-size: 11px; }

/* Character Stats Panel */
#char-stats {
  position: fixed; top: 50px; left: 10px;
  background: rgba(15,12,8,0.9); border: 1px solid #3a2a1a;
  padding: 10px; border-radius: 4px; z-index: 10; min-width: 180px;
}
#char-stats.hidden { display: none; }
#char-stats h3 { font-size: 14px; margin-bottom: 8px; }
#stats-list { font-size: 11px; }
#stats-list .stat-row { display: flex; justify-content: space-between; margin: 2px 0; }
#stats-list .stat-val { color: #8f8; }

/* Ground Loot Labels */
#loot-labels { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 5; }
.loot-label {
  position: absolute; padding: 2px 8px; border-radius: 2px;
  font-size: 11px; font-weight: bold; cursor: pointer; pointer-events: auto;
  text-shadow: 0 0 3px #000; white-space: nowrap;
  border: 1px solid; transform: translate(-50%, -50%);
}
.loot-label.normal { color: #ccc; background: rgba(40,40,40,0.8); border-color: #555; }
.loot-label.magic { color: #4488ff; background: rgba(20,20,60,0.8); border-color: #3366cc; }
.loot-label.rare { color: #ffcc00; background: rgba(60,50,10,0.8); border-color: #cc9900; }
.loot-label.unique { color: #af6025; background: rgba(60,30,10,0.8); border-color: #af6025; }
.loot-label.currency { color: #aa9e82; background: rgba(50,45,35,0.8); border-color: #aa9e82; }

/* Kill Counter */
#kill-counter {
  position: fixed; top: 10px; left: 50%; transform: translateX(-50%);
  font-size: 14px; color: #888; z-index: 10;
}

/* Loading Screen */
#loading-screen {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: #0a0806; display: flex; align-items: center; justify-content: center;
  z-index: 1000; transition: opacity 0.5s;
}
#loading-screen.fade-out { opacity: 0; pointer-events: none; }
#loading-content { text-align: center; }
#loading-content h1 { font-size: 48px; color: #c8b68e; letter-spacing: 8px; margin-bottom: 10px; }
#loading-content p { color: #888; margin-bottom: 20px; }
#loading-bar { width: 300px; height: 4px; background: #1a1008; border-radius: 2px; overflow: hidden; margin: 0 auto; }
#loading-bar-fill { height: 100%; width: 0%; background: #c8b68e; transition: width 0.3s; }

/* Damage Numbers */
.damage-number {
  position: absolute; pointer-events: none; font-weight: bold;
  text-shadow: 0 0 4px #000, 0 0 4px #000; animation: floatUp 0.8s forwards;
  z-index: 5;
}
.damage-number.physical { color: #fff; }
.damage-number.lightning { color: #ffee44; }
.damage-number.fire { color: #ff4422; }
.damage-number.cold { color: #44aaff; }
.damage-number.chaos { color: #d040ff; }
.damage-number.crit { font-size: 20px !important; color: #ff8800; }

@keyframes floatUp {
  0% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-60px); }
}

/* Level Up Flash */
.level-up-flash {
  position: fixed; top: 40%; left: 50%; transform: translate(-50%, -50%);
  font-size: 36px; color: #ffd700; font-weight: bold; text-shadow: 0 0 20px #ffd700;
  animation: levelUp 2s forwards; z-index: 50; pointer-events: none;
}
@keyframes levelUp {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
  20% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}
