/* Ashen Souls — HUD & overlay styling, Dark Souls 1 flavor */

@font-face {
  font-family: 'EB Garamond';
  src: url('../fonts/ebgaramond-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'EB Garamond';
  src: url('../fonts/ebgaramond-500.woff2') format('woff2');
  font-weight: 500 600; font-style: normal; font-display: swap;
}

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

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: #060606;
  font-family: 'EB Garamond', Garamond, 'Times New Roman', serif;
  user-select: none;
  cursor: default;
}

#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

/* ---------- full-screen fx overlays ---------- */
.fx-overlay { position: fixed; inset: 0; pointer-events: none; opacity: 0; }

#vignette {
  opacity: 1;
  background: radial-gradient(ellipse at center, transparent 52%, rgba(0,0,0,0.42) 100%);
}
#hitflash {
  background: radial-gradient(ellipse at center, rgba(160,10,10,0.18) 30%, rgba(140,0,0,0.55) 100%);
  transition: opacity 0.45s ease-out;
}
#healflash {
  background: radial-gradient(ellipse at center, transparent 40%, rgba(255,170,60,0.28) 100%);
  transition: opacity 0.8s ease-out;
}
#lowhp {
  background: radial-gradient(ellipse at center, transparent 45%, rgba(120,0,0,0.5) 100%);
  transition: opacity 0.6s;
}
#whiteout { background: #f4f1e8; transition: opacity 0.65s ease-in-out; }
#fadeblack { background: #000; transition: opacity 0.9s ease-in-out; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.5s; }
#hud.visible { opacity: 1; }

#status-bars { position: absolute; top: 22px; left: 24px; }

.bar { position: relative; height: 13px; margin-bottom: 7px; }
.bar-fill, .bar-ghost {
  position: absolute; top: 2px; bottom: 2px; left: 2px;
  transform-origin: left center;
}
.bar-ghost { background: #c8b04a; width: calc(100% - 4px); transform: scaleX(0); }
.bar-frame {
  position: absolute; inset: 0;
  border: 1px solid #000;
  outline: 1px solid rgba(210,200,170,0.55);
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.25), inset 0 -1px 2px rgba(0,0,0,0.7), 0 1px 3px rgba(0,0,0,0.8);
  background: linear-gradient(to bottom, rgba(255,255,255,0.16), transparent 40%, rgba(0,0,0,0.35));
  pointer-events: none;
}
.hp-bar { width: 340px; }
.hp-bar .bar-fill { background: linear-gradient(to bottom, #c33 0%, #a01616 45%, #6e0d0d 100%); width: calc(100% - 4px); }
.st-bar { width: 262px; height: 11px; }
.st-bar .bar-fill { background: linear-gradient(to bottom, #4d8f3a 0%, #33702a 45%, #1d4a18 100%); width: calc(100% - 4px); }
.st-bar.exhausted .bar-fill { background: linear-gradient(to bottom, #b04028 0%, #8c2c1a 45%, #5c1a0e 100%); }

.boss-bar { width: min(46vw, 660px); height: 12px; }
.boss-bar .bar-fill { background: linear-gradient(to bottom, #c33 0%, #a01616 45%, #6e0d0d 100%); width: calc(100% - 4px); }
.boss-bar .bar-ghost { background: #d8d0c0; }

/* ---------- equipment panel ---------- */
#equip-panel { position: absolute; left: 24px; bottom: 22px; }
.equip-row { display: flex; gap: 8px; margin-bottom: 8px; }
.slot {
  position: relative;
  width: 52px; height: 52px;
  background: rgba(12,11,9,0.72);
  border: 1px solid rgba(200,190,160,0.5);
  box-shadow: inset 0 0 8px rgba(0,0,0,0.8), 0 1px 3px rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
}
.slot svg { width: 40px; height: 40px; }
.slot.dim { opacity: 0.35; }
#estus-count {
  position: absolute; right: 2px; bottom: 0px;
  color: #f0e8d8; font-size: 19px; font-weight: 500;
  text-shadow: 0 0 4px #000, 0 1px 2px #000;
}
#slot-estus.empty svg { filter: grayscale(1) brightness(0.55); }

/* ---------- souls ---------- */
#souls-panel {
  position: absolute; right: 26px; bottom: 20px;
  display: flex; align-items: center; gap: 8px;
  background: linear-gradient(to right, transparent, rgba(10,10,8,0.78) 22%);
  padding: 5px 10px 5px 34px;
  border-right: 2px solid rgba(200,190,160,0.55);
}
#soul-icon { width: 22px; height: 22px; filter: drop-shadow(0 0 4px rgba(140,230,210,0.7)); }
#souls-count {
  color: #e8e2d2; font-size: 22px; letter-spacing: 1px; min-width: 90px; text-align: right;
  text-shadow: 0 0 5px #000, 0 1px 2px #000;
}
#souls-panel.pulse #souls-count { animation: soulsPulse 0.6s ease-out; }
@keyframes soulsPulse { 0% { color: #bfffe9; transform: scale(1.18); } 100% { transform: scale(1); } }

/* ---------- boss bar ---------- */
#boss-bar-wrap {
  position: absolute; bottom: 60px; left: 50%;
  transform: translateX(-8%);
  opacity: 0;
  transition: opacity 0.5s, transform 1.1s cubic-bezier(0.16, 0.8, 0.3, 1);
}
#boss-bar-wrap.visible { opacity: 1; transform: translateX(-50%); }
#boss-name {
  color: #e6ddc8; font-size: 27px; font-weight: 500; letter-spacing: 2px;
  text-shadow: 0 0 8px rgba(0,0,0,0.9), 0 2px 3px #000;
  margin-bottom: 3px;
}

/* ---------- prompts & toasts ---------- */
#prompt {
  position: absolute; bottom: 130px; left: 50%; transform: translateX(-50%);
  color: #efe8d5; font-size: 24px; letter-spacing: 1.5px;
  text-shadow: 0 0 8px #000, 0 2px 3px #000;
  background: linear-gradient(to right, transparent, rgba(8,8,6,0.66) 18%, rgba(8,8,6,0.66) 82%, transparent);
  padding: 4px 40px;
  opacity: 0; transition: opacity 0.3s;
}
#prompt.visible { opacity: 1; }
#prompt .key {
  display: inline-block; border: 1px solid rgba(220,210,180,0.8); border-radius: 3px;
  padding: 0 7px; margin-left: 10px; font-size: 19px; color: #d8cfae;
}

#toast {
  position: absolute; bottom: 190px; left: 50%; transform: translateX(-50%);
  color: #cfe8dd; font-size: 21px; letter-spacing: 1px;
  text-shadow: 0 0 6px #000;
  opacity: 0; transition: opacity 0.4s;
}
#toast.visible { opacity: 1; }

/* ---------- controls hint ---------- */
#controls-hint {
  position: absolute; top: 22px; right: 26px;
  display: flex; flex-direction: column; gap: 2px;
  color: rgba(225,215,190,0.62); font-size: 15.5px; text-align: right;
  text-shadow: 0 1px 2px #000;
  opacity: 0; transition: opacity 1s;
}
#controls-hint.visible { opacity: 1; }
#controls-hint b { color: rgba(240,230,200,0.85); font-weight: 500; }

/* ---------- banners (YOU DIED / VICTORY) ---------- */
#banner {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  pointer-events: none; opacity: 0;
}
.banner-text {
  font-size: clamp(48px, 9vw, 118px); letter-spacing: 0.14em; font-weight: 500;
  transform: scale(1.28); opacity: 0;
}
.banner-text.show { transition: transform 2.6s cubic-bezier(0.1, 0.7, 0.2, 1), opacity 1.3s ease-in; transform: scale(1); opacity: 1; }
.banner-text.hide { transition: opacity 1.4s ease-out; opacity: 0; }
.banner-died { color: #8e1210; text-shadow: 0 0 34px rgba(150,20,10,0.65), 0 0 6px rgba(0,0,0,0.8); }
.banner-victory { color: #c8a23a; text-shadow: 0 0 40px rgba(220,170,60,0.5), 0 0 6px rgba(0,0,0,0.9); }
.banner-lit { color: #d8cfae; font-size: clamp(30px, 4.6vw, 56px); text-shadow: 0 0 22px rgba(255,180,80,0.45), 0 2px 4px #000; }

/* ---------- area name ---------- */
#area-name {
  position: fixed; left: 0; right: 0; bottom: 16%;
  text-align: center; pointer-events: none;
  color: #e8dfc8; font-size: clamp(34px, 5.4vw, 64px); letter-spacing: 0.22em; font-weight: 500;
  text-shadow: 0 0 26px rgba(0,0,0,0.95), 0 2px 4px #000;
  opacity: 0; transition: opacity 1.6s ease-in-out;
}

/* ---------- title screen ---------- */
#title-screen {
  position: fixed; inset: 0; z-index: 40;
  background: radial-gradient(ellipse at 50% 38%, #17150f 0%, #0a0908 55%, #050505 100%);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 1.6s ease-out; cursor: pointer;
}
#title-screen.hidden { opacity: 0; pointer-events: none; }
#title-inner { text-align: center; }
#title-logo {
  color: #cfc4a4; font-size: clamp(52px, 9vw, 110px); letter-spacing: 0.22em; font-weight: 500;
  text-shadow: 0 0 46px rgba(255, 158, 64, 0.22), 0 0 10px rgba(0,0,0,0.9);
  animation: logoEmber 6s ease-in-out infinite;
}
@keyframes logoEmber {
  0%, 100% { text-shadow: 0 0 46px rgba(255,158,64,0.16), 0 0 10px rgba(0,0,0,0.9); }
  50% { text-shadow: 0 0 60px rgba(255,158,64,0.34), 0 0 10px rgba(0,0,0,0.9); }
}
#title-sub { color: #8f8570; font-size: clamp(17px, 2vw, 24px); letter-spacing: 0.34em; margin-top: 10px; }
#title-begin {
  color: #b7ab8c; font-size: 21px; letter-spacing: 0.3em; margin-top: 12vh;
  animation: blink 2.4s ease-in-out infinite;
}
@keyframes blink { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
#title-note { color: #59544a; font-size: 15px; letter-spacing: 0.08em; margin-top: 4vh; line-height: 1.7; }
