/* El Camino del Espíritu: RPG del Espíritu Santo.
   Acento de fuego de Pentecostés sobre los estilos base del sitio. */
:root {
  --q-accent: #ffb35c;
  --q-accent-border: rgba(255, 179, 92, .45);
  --q-accent-text: #ffd9a0;
}

/* Barra de HUD: llamas de los dones, libro y pausa */
.rpg-hudbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px 16px;
  margin-bottom: 14px;
}

.flames-hud {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  min-width: 0;
}

.flame-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 62px;
  min-width: 0;
}

.flame-glyph {
  font-size: 1.3rem;
  line-height: 1.1;
  filter: grayscale(1);
  opacity: .32;
}

.flame-slot.is-lit .flame-glyph {
  filter: none;
  opacity: 1;
  text-shadow: 0 0 12px rgba(255, 150, 50, .85), 0 0 26px rgba(255, 90, 30, .45);
  animation: rpg-flicker 1.6s ease-in-out infinite;
}

.flame-name {
  margin-top: 2px;
  color: #aeb9c9;
  font-size: .56rem;
  line-height: 1.15;
  text-align: center;
  overflow-wrap: anywhere;
}

.flame-slot.is-lit .flame-name { color: var(--q-accent-text); }

.hud-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hud-button {
  border: 1px solid rgba(225, 233, 244, .26);
  border-radius: 999px;
  background: rgba(15, 25, 45, .68);
  padding: 8px 14px;
  color: #f7f4e9;
  font-size: .8rem;
  cursor: pointer;
}

.hud-button:hover { border-color: var(--q-accent); }
.hud-button:disabled { opacity: .45; cursor: default; }

@keyframes rpg-flicker {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

/* Objetivo actual: va sobre el marco para no tapar la caja de
   diálogo ni los avisos flotantes del juego. */
.objective-banner {
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 12px;
  padding: 8px 16px;
  border: 1px solid var(--q-accent-border);
  border-radius: 999px;
  background: rgba(24, 16, 8, .78);
  color: #ffe9c4;
  font-size: .85rem;
  text-align: center;
}

/* Caja de diálogo y elecciones */
.choice-box {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 10px;
}

.choice-box[hidden] { display: none; }

.choice-button {
  border: 1px solid var(--q-accent-border);
  border-radius: 12px;
  background: rgba(255, 179, 92, .12);
  padding: 9px 12px;
  color: #fff6e3;
  font: .8rem/1.45 var(--font-sans, sans-serif);
  text-align: left;
  cursor: pointer;
}

.choice-button:hover { background: rgba(255, 179, 92, .28); }

.dialogue-next { margin-left: 0; }

/* Tarjeta de paso del tutorial */
.step-card {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(430px, calc(100% - 28px));
  max-height: calc(100% - 28px);
  overflow-y: auto;
  padding: 22px 24px 24px;
  border: 1px solid var(--q-accent-border);
  border-radius: 20px;
  background: rgba(26, 18, 10, .93);
  text-align: center;
  box-shadow: 0 18px 55px rgba(0, 0, 0, .4);
  backdrop-filter: blur(5px);
}

.step-card[hidden] { display: none; }

.step-count {
  margin: 0 0 6px;
  color: var(--q-accent-text);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.step-card h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.5rem;
  font-weight: 400;
  color: #fff3d6;
}

.step-line {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, .78);
  font-size: .85rem;
  line-height: 1.5;
}

.step-phrase {
  margin: 16px 0 20px;
  padding: 14px 16px;
  border-left: 3px solid var(--q-accent);
  border-radius: 0 12px 12px 0;
  background: rgba(255, 179, 92, .1);
  color: #ffe9c4;
  font: italic 1rem/1.6 Georgia, "Times New Roman", serif;
  text-align: left;
  white-space: pre-line;
}

/* Tarjeta de anuncio (ceremonia del don, oración de cierre) */
.banner-card {
  position: absolute;
  z-index: 4;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(480px, calc(100% - 28px));
  max-height: calc(100% - 28px);
  padding: 24px 26px;
  border: 1px solid var(--q-accent-border);
  border-radius: 20px;
  background: rgba(26, 18, 10, .94);
  text-align: center;
  box-shadow: 0 18px 55px rgba(0, 0, 0, .42);
  backdrop-filter: blur(5px);
}

.banner-card[hidden] { display: none; }

.banner-inner {
  overflow-y: auto;
  width: 100%;
  margin-bottom: 18px;
  color: #f3e9d4;
  line-height: 1.6;
}

.banner-inner .banner-glyph {
  font-size: 2.4rem;
  text-shadow: 0 0 24px rgba(255, 150, 50, .8);
}

.banner-inner h3 {
  margin: 8px 0 6px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.6rem;
  font-weight: 400;
  color: #fff3d6;
}

.banner-inner .banner-line {
  margin: 12px 0 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 179, 92, .12);
  color: #ffe9c4;
  font-style: italic;
  white-space: pre-line;
}

.banner-inner .banner-prayer {
  text-align: left;
  white-space: pre-line;
  font-size: .92rem;
}

/* Botón secundario de los overlays */
.secondary-button {
  display: block;
  margin: 12px auto 0;
  border: 1px solid rgba(225, 233, 244, .35);
  border-radius: 999px;
  background: transparent;
  padding: 10px 22px;
  color: #e8eef7;
  cursor: pointer;
  font-weight: 700;
}

.secondary-button:hover { border-color: var(--q-accent); }
.secondary-button[hidden] { display: none; }

.overlay-note {
  margin-top: 16px !important;
  font-size: .78rem;
  color: #93a5bb !important;
}

/* Libro de oración */
.book-card { width: min(580px, 100%); }

.book-intro {
  font-size: .82rem;
  color: #b9c7d8 !important;
}

.book-content {
  max-height: 44vh;
  overflow-y: auto;
  margin: 0 0 18px;
  padding-right: 4px;
  text-align: left;
}

.book-section-title {
  margin: 16px 0 8px;
  color: var(--q-accent-text);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.book-section-title:first-child { margin-top: 0; }

.book-entry {
  margin-bottom: 10px;
  padding: 11px 13px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 13px;
  background: rgba(255, 255, 255, .045);
}

.book-entry h4 {
  margin: 0 0 4px;
  color: #fff3d6;
  font-size: .9rem;
}

.book-entry .book-phrase {
  margin: 0;
  color: rgba(255, 255, 255, .87);
  font-size: .85rem;
  line-height: 1.55;
  white-space: pre-line;
}

.book-entry .book-sub {
  margin: 3px 0 0;
  color: #9fb0c4;
  font-size: .78rem;
  font-style: italic;
  white-space: pre-line;
}

.read-button {
  margin-top: 8px;
  border: 1px solid var(--q-accent-border);
  border-radius: 999px;
  background: var(--q-accent);
  padding: 6px 14px;
  color: #2c1c08;
  font-size: .75rem;
  font-weight: 800;
  cursor: pointer;
}

.read-button:hover { filter: brightness(1.08); }

.book-entry.is-read { border-color: var(--q-accent-border); }
.book-entry.is-read .read-button {
  background: transparent;
  color: var(--q-accent-text);
}

/* La caja de diálogo del RPG puede crecer con las elecciones */
.quest-hud { max-height: calc(100% - 120px); overflow-y: auto; }

@media (max-width: 640px) {
  .flame-slot { width: 42px; }
  .flame-glyph { font-size: 1.05rem; }
  .flame-name { font-size: .48rem; }
  .hud-button { padding: 7px 10px; font-size: .72rem; }
  .objective-banner { font-size: .74rem; padding: 6px 12px; }
  .step-card { padding: 16px 16px 18px; }
  .step-card h3 { font-size: 1.25rem; }
  .banner-card { padding: 18px 16px; }
  .book-content { max-height: 38vh; }
}

@media (prefers-reduced-motion: reduce) {
  .flame-slot.is-lit .flame-glyph { animation: none; }
}

/* Las tarjetas de los overlays nunca superan el alto del marco: si una
   tarjeta quedara más alta, el navegador desplazaría el contenido del
   marco al enfocar un botón y la escena se vería cortada. La tarjeta
   se desplaza por dentro en su lugar. */
.game-overlay .overlay-card {
  max-height: 100%;
  overflow-y: auto;
}

.book-card {
  display: flex;
  flex-direction: column;
}

.book-card .book-content {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
}
