/* HUD Overlay Styles — Clean Game UI */

@import url('https://fonts.googleapis.com/css2?family=Hanken+Grotesk:wght@300;400;500;600;700;800&display=swap');

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

body {
  overflow: hidden;
  background: #0d0d0d;
  font-family: 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #e0e0e0;
  cursor: crosshair;
}

canvas#gameCanvas {
  display: block;
  width: 100vw;
  height: 100vh;
}

.hidden { display: none !important; }

/* ── HUD Layout ──────────────────────────── */

#hud {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

#hud * {
  pointer-events: auto;
}

.hud-top-left {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 260px;
}

.hud-top-right {
  position: absolute;
  top: 16px;
  right: 16px;
  text-align: right;
}

.hud-bottom-center {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
}

/* ── Player Info ─────────────────────────── */

.hud-player-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}

.hud-name {
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

.hud-level {
  color: #a0a0a0;
  font-size: 13px;
  font-weight: 600;
}

/* ── Bars ─────────────────────────────────── */

.hud-bar {
  position: relative;
  height: 22px;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  margin-bottom: 3px;
  overflow: hidden;
  backdrop-filter: blur(4px);
}

.hud-bar-fill {
  height: 100%;
  transition: width 0.25s ease-out;
  border-radius: 3px;
}

.hp-bar .hud-bar-fill {
  background: linear-gradient(180deg, #e63946 0%, #a3222b 100%);
  box-shadow: 0 0 8px rgba(230, 57, 70, 0.3);
}

.mana-bar .hud-bar-fill {
  background: linear-gradient(180deg, #4895ef 0%, #2a6bc2 100%);
  box-shadow: 0 0 8px rgba(72, 149, 239, 0.3);
}

.xp-bar {
  height: 14px;
}

.xp-bar .hud-bar-fill {
  background: linear-gradient(180deg, #f4a261 0%, #c27a3a 100%);
  box-shadow: 0 0 6px rgba(244, 162, 97, 0.25);
}

.hud-bar-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  pointer-events: none;
  letter-spacing: 0.02em;
}

/* ── Skill Bar ───────────────────────────── */

.skill-slot {
  position: relative;
  width: 56px;
  height: 56px;
  background: rgba(0, 0, 0, 0.75);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  backdrop-filter: blur(4px);
}

.skill-slot:hover {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
}

.skill-slot.on-cooldown {
  opacity: 0.65;
}

.skill-icon {
  font-size: 22px;
  line-height: 1;
  z-index: 1;
}

.skill-cd-sweep {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 5px;
  pointer-events: none;
  z-index: 2;
  display: none;
}

.skill-cd-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9), 0 0 2px rgba(0, 0, 0, 0.7);
  pointer-events: none;
  z-index: 3;
  display: none;
}

.skill-key {
  position: absolute;
  top: 3px;
  right: 5px;
  font-size: 10px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.35);
}

.skill-name {
  font-size: 8px;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 2px;
  text-align: center;
  font-weight: 500;
}

/* ── Minimap ─────────────────────────────── */

#minimap-container {
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
  backdrop-filter: blur(4px);
}

#minimap {
  display: block;
}

.hud-online {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ── Chat ────────────────────────────────── */

.chat-container, #chat {
  position: fixed;
  bottom: 96px;
  left: 16px;
  width: 360px;
  z-index: 15;
}

.chat-messages {
  max-height: 200px;
  overflow-y: auto;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  margin-bottom: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
  backdrop-filter: blur(4px);
}

.chat-message {
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 2px;
  word-wrap: break-word;
  font-weight: 400;
}

.chat-input-wrapper {
  display: flex;
}

.chat-input {
  width: 100%;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #e0e0e0;
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 400;
  outline: none;
  transition: border-color 0.15s;
}

.chat-input:focus {
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

/* ── Death Screen ────────────────────────── */

.death-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 20;
  pointer-events: auto;
}

.death-screen h2 {
  font-size: 52px;
  font-weight: 800;
  color: #e63946;
  letter-spacing: -0.02em;
  text-shadow: 0 0 40px rgba(230, 57, 70, 0.4);
  margin-bottom: 12px;
}

.death-screen p {
  font-size: 16px;
  font-weight: 400;
  color: #888;
}

.death-screen strong {
  color: #fff;
  font-weight: 600;
}

/* ── Notifications ───────────────────────── */

.hud-notifications {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  z-index: 18;
}

.hud-notification {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9);
  margin-bottom: 8px;
  transition: opacity 0.5s;
}

/* ── Loading Screen ──────────────────────── */

#loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #0d0d0d;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

#loading-screen h1 {
  font-size: 42px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.loading-bar {
  width: 280px;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
}

.loading-bar-fill {
  height: 100%;
  background: #ffffff;
  width: 0%;
  transition: width 0.3s;
  border-radius: 2px;
}

#loading-text {
  margin-top: 14px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.35);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ── Stat box (used in GameMenus character panel) ── */
.stat-box {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 10px;
  font-size: 13px;
  font-weight: 500;
  color: #ccc;
}

.stat-box b {
  color: #fff;
  font-weight: 700;
}
