@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600&family=EB+Garamond:ital@0;1&display=swap');

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

body {
  background: #0a0605;
  background-image: radial-gradient(ellipse at center, #1a1410 0%, #050302 80%);
  color: #c9a86a;
  font-family: 'EB Garamond', serif;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

#game {
  width: 100%;
  max-width: 720px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid #3a2e1f;
  padding: 32px;
  box-shadow: 0 0 80px rgba(0, 0, 0, 0.9), inset 0 0 100px rgba(0, 0, 0, 0.6);
  position: relative;
}

h1, h2 {
  font-family: 'Cinzel', serif;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h2 {
  font-size: 1.5rem;
  color: #c9a86a;
  text-shadow: 0 0 14px rgba(201, 168, 106, 0.4);
  margin-bottom: 14px;
  text-align: center;
  font-weight: 600;
}

#boss-menu {
  padding: 30px 0 12px;
  text-align: center;
}

#boss-menu h1 {
  color: #c9a86a;
  font-size: clamp(1.7rem, 5vw, 3rem);
  font-weight: 600;
  text-shadow: 0 0 30px rgba(201, 168, 106, 0.45);
}

.menu-prompt {
  color: #8a7048;
  font-style: italic;
  font-size: 1.1rem;
  margin: 16px 0 28px;
}

#boss-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.boss-card {
  min-height: 132px;
  background: linear-gradient(180deg, rgba(42, 31, 19, 0.76), rgba(12, 7, 4, 0.86));
  border: 1px solid #5a4828;
  color: #c9a86a;
  padding: 18px 10px;
  font-family: 'EB Garamond', serif;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: border-color 0.18s, color 0.18s, background 0.18s, transform 0.18s;
}

.boss-card-name {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  letter-spacing: 0.08em;
  line-height: 1.3;
}

.boss-card-status {
  min-height: 34px;
  color: #8a7048;
  font-size: 0.88rem;
  font-style: italic;
  line-height: 1.35;
}

.boss-card:hover:not(:disabled) {
  background: linear-gradient(180deg, rgba(80, 60, 32, 0.72), rgba(24, 14, 8, 0.9));
  border-color: #c9a86a;
  color: #f0deb6;
  text-shadow: 0 0 8px rgba(201, 168, 106, 0.5);
  transform: translateY(-1px);
}

.boss-card:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.boss-card.is-unready {
  opacity: 0.55;
}

#hud-controls {
  position: absolute;
  top: 14px;
  right: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

#deaths-counter {
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  color: #5a4828;
}

#mute-toggle {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  background: rgba(20, 12, 6, 0.72);
  border: 1px solid #3a2e1f;
  color: #8a7048;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  transition: border-color 0.18s, color 0.18s, background 0.18s;
}

#mute-toggle:hover {
  background: rgba(40, 30, 18, 0.8);
  border-color: #8a7048;
  color: #c9a86a;
}

#mute-toggle.is-muted {
  color: #5a4828;
  opacity: 0.82;
}

.bar {
  width: 100%;
  height: 20px;
  background: #110a04;
  border: 1px solid #3a2e1f;
  position: relative;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  transition: width 0.5s ease;
}

.boss-fill {
  background: linear-gradient(to right, #4a0808, #921818);
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.boss-bar.riposte-ready {
  border-color: #e3bd58;
  box-shadow: 0 0 16px rgba(227, 189, 88, 0.55);
  animation: ripostePulse 1.1s ease-in-out infinite alternate;
}

.boss-bar.riposte-ready .boss-fill {
  background: linear-gradient(to right, #6d4511, #d7a642);
  box-shadow: 0 0 18px rgba(227, 189, 88, 0.45), inset 0 0 10px rgba(0, 0, 0, 0.45);
}

.hp-fill {
  background: linear-gradient(to right, #6a1212, #b03030);
}

.stamina-fill {
  background: linear-gradient(to right, #4a5a18, #88a040);
}

.bar-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: #e6d9b8;
  text-shadow: 1px 1px 2px black;
  pointer-events: none;
}

#boss-area {
  margin-bottom: 22px;
  padding-bottom: 20px;
  border-bottom: 1px solid #3a2e1f;
}

#boss-telegraph {
  margin-top: 14px;
  padding: 12px 16px;
  background: rgba(168, 50, 50, 0.08);
  border: 1px solid #6a1a1a;
  text-align: center;
  font-style: italic;
  color: #e6a060;
  font-size: 1rem;
}

.echo-area {
  margin-top: 12px;
}

.echo-name {
  font-family: 'Cinzel', serif;
  font-size: 0.64rem;
  letter-spacing: 0.16em;
  color: #7f9ad0;
  margin-bottom: 4px;
  text-align: center;
}

.echo-bar {
  height: 16px;
  border-color: #283d5a;
  background: #050a12;
}

.echo-fill {
  background: linear-gradient(to right, #2e558c, #8bb8ff);
  box-shadow: 0 0 12px rgba(139, 184, 255, 0.28);
}

#combat-log {
  height: 130px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid #2a2010;
  padding: 12px 16px;
  margin: 18px 0;
  font-style: italic;
  font-size: 0.95rem;
  line-height: 1.55;
}

#combat-log div {
  padding: 1px 0;
  opacity: 0.6;
}

#combat-log div:nth-child(1) {
  opacity: 1;
  color: #e6d9b8;
}

#combat-log div:nth-child(2) {
  opacity: 0.85;
  color: #c9a86a;
}

.stat-row {
  margin: 10px 0;
}

.stat-label {
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  color: #8a7048;
  margin-bottom: 4px;
}

.estus {
  text-align: center;
  font-family: 'Cinzel', serif;
  letter-spacing: 0.15em;
  color: #ffa030;
  margin: 16px 0 18px;
  font-size: 1rem;
  text-shadow: 0 0 10px rgba(255, 160, 48, 0.3);
}

#actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

#actions button {
  background: rgba(40, 30, 18, 0.5);
  border: 1px solid #5a4828;
  color: #c9a86a;
  padding: 12px 6px;
  font-family: 'EB Garamond', serif;
  cursor: pointer;
  transition: all 0.18s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-height: 84px;
}

#actions button .ico {
  font-size: 1.5rem;
  filter: grayscale(0.15);
}

#actions button .lbl {
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
}

#actions button .cost {
  font-size: 0.7rem;
  color: #8a7048;
  font-style: italic;
}

#actions button:hover:not(:disabled) {
  background: rgba(80, 60, 32, 0.7);
  border-color: #c9a86a;
  color: #f0deb6;
  text-shadow: 0 0 8px rgba(201, 168, 106, 0.5);
  transform: translateY(-1px);
}

#actions button:active:not(:disabled) {
  transform: translateY(1px);
}

#actions button:disabled {
  opacity: 0.32;
  cursor: not-allowed;
}

#actions button.is-locked {
  background: rgba(18, 14, 10, 0.55);
  border-color: #3a2e1f;
  color: #6b5a3a;
}

#actions button.is-locked .ico {
  filter: grayscale(1);
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.96);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fadeIn 1.4s ease-in;
  padding: 20px;
}

#death-screen h1 {
  font-size: clamp(2.6rem, 8vw, 5rem);
  color: #6a0808;
  text-shadow: 0 0 30px rgba(168, 30, 30, 0.6);
  margin-bottom: 50px;
  animation: deathGlow 2.4s ease-in-out infinite alternate;
  font-weight: 600;
}

#victory-screen h1 {
  font-size: clamp(2.2rem, 7vw, 4rem);
  color: #c9a86a;
  text-shadow: 0 0 40px rgba(255, 200, 100, 0.7);
  margin-bottom: 30px;
  animation: victoryGlow 3s ease-in-out infinite alternate;
  font-weight: 600;
}

.overlay button {
  background: transparent;
  border: 1px solid #6a4a28;
  color: #8a7048;
  padding: 14px 44px;
  font-family: 'Cinzel', serif;
  letter-spacing: 0.22em;
  cursor: pointer;
  transition: all 0.3s;
  margin-top: 20px;
}

.overlay button:hover {
  color: #c9a86a;
  border-color: #c9a86a;
  text-shadow: 0 0 8px rgba(201, 168, 106, 0.5);
}

.overlay .lore {
  text-align: center;
  font-style: italic;
  color: #8a7048;
  font-size: 0.95rem;
  max-width: 460px;
  line-height: 1.7;
  margin-top: 10px;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes deathGlow {
  from { text-shadow: 0 0 18px rgba(168, 30, 30, 0.4); }
  to   { text-shadow: 0 0 42px rgba(255, 60, 60, 0.75); }
}
@keyframes victoryGlow {
  from { text-shadow: 0 0 22px rgba(201, 168, 106, 0.4); }
  to   { text-shadow: 0 0 50px rgba(255, 220, 120, 0.85); }
}
@keyframes ripostePulse {
  from { box-shadow: 0 0 10px rgba(227, 189, 88, 0.35); }
  to   { box-shadow: 0 0 22px rgba(255, 223, 112, 0.7); }
}

@media (max-width: 520px) {
  body { padding: 12px; }

  #game { padding: 24px 16px; }

  #actions {
    gap: 6px;
  }

  #actions button {
    min-height: 76px;
    padding: 10px 4px;
  }

  #actions button .ico {
    font-size: 1.25rem;
  }

  #actions button .lbl {
    font-size: 0.72rem;
  }

  #actions button .cost {
    font-size: 0.62rem;
  }
}

.hidden { display: none !important; }

@media (max-width: 640px) {
  #game {
    padding: 56px 18px 24px;
  }

  #boss-options {
    grid-template-columns: 1fr;
  }
}
