/* ============================================
   EL CASTILLO DEL CONDE — Sections
   ============================================ */

/* =========================================
   HOME — Sin scroll
   ========================================= */
body[data-hide-nav][data-hide-inventory],
html:has(body[data-hide-nav][data-hide-inventory]) {
  overflow: hidden;
  height: 100%;
  overscroll-behavior: none;
  touch-action: none;
}

/* =========================================
   VESTÍBULO — Click & Go
   ========================================= */

/* Ocultar footer en el vestíbulo (pantalla completa) */
.vestibulo-body { overflow: hidden; }
.vestibulo-body #site-footer {
  display: none;
}

.vestibulo-wrap {
  position: fixed;
  inset: 0;
  z-index: var(--z-content);
  overflow: hidden;
  cursor: crosshair;
}

.vestibulo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  user-select: none;
  pointer-events: none;
}

.vestibulo-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center,
    transparent 30%,
    var(--overlay-mid) 70%,
    var(--overlay-dark) 100%
  );
  pointer-events: none;
}

/* ── Hotspots ── */
.vestibulo-hotspot {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 72px;
  height: 72px;
  min-width: 72px;
  min-height: 72px;
  display: block;
  text-decoration: none;
  z-index: 10;
}

@media (max-width: 768px) {
  .vestibulo-hotspot {
    width: 96px;
    height: 96px;
    min-width: 96px;
    min-height: 96px;
  }
}

.hotspot-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--blood-bright);
  box-shadow: 0 0 8px var(--blood-glow);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  transition: transform var(--duration-fast) var(--ease-dark),
              box-shadow var(--duration-fast) var(--ease-dark);
}

.hotspot-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border-radius: 50%;
  border: 1px solid var(--blood-core);
  opacity: 0.6;
  animation: hotspot-pulse 2.4s ease-out infinite;
}

@keyframes hotspot-pulse {
  0%   { transform: scale(0.6); opacity: 0.7; }
  100% { transform: scale(2);   opacity: 0; }
}

/* Etiqueta flotante */
.hotspot-label {
  position: absolute;
  white-space: nowrap;
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--parchment);
  background: var(--overlay-dark);
  border: 1px solid var(--blood-core);
  padding: 6px 14px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity var(--duration-fast) var(--ease-dark),
              transform var(--duration-fast) var(--ease-dark);
  backdrop-filter: blur(4px);
}

.hotspot-label--top    { bottom: calc(100% + 14px); left: 50%; transform: translateX(-50%) translateY(4px); }
.hotspot-label--right  { left:  calc(100% + 14px); top: 50%;  transform: translateY(-50%) translateX(-4px); }
.hotspot-label--left   { right: calc(100% + 14px); top: 50%;  transform: translateY(-50%) translateX(4px); }

.vestibulo-hotspot:hover .hotspot-label {
  opacity: 1;
}
.vestibulo-hotspot:hover .hotspot-label--top   { transform: translateX(-50%) translateY(0); }
.vestibulo-hotspot:hover .hotspot-label--right { transform: translateY(-50%) translateX(0); }
.vestibulo-hotspot:hover .hotspot-label--left  { transform: translateY(-50%) translateX(0); }

.vestibulo-hotspot:hover .hotspot-dot {
  transform: translate(-50%, -50%) scale(1.4);
  box-shadow: 0 0 16px var(--blood-glow);
}

/* En móvil: etiquetas ocultas — el punto rojo es suficiente indicación */
@media (hover: none) {
  .hotspot-label {
    display: none;
  }
}


/* =========================================
   LAS SALAS — Index de salas
   ========================================= */

/* Closeup overlay dormitorio — fade + zoom approach */
#dorm-closeup-overlay {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}
#dorm-closeup-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
#dorm-closeup-overlay > img {
  transform: scale(1.08);
  transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
#dorm-closeup-overlay.open > img {
  transform: scale(1);
}

/* Closeup overlay libro biblioteca — fade + zoom approach */
#bib-book-closeup {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
  cursor: default;
}
#bib-book-closeup.open {
  opacity: 1;
  pointer-events: auto;
}
#bib-book-closeup > img.bib-closeup-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.08);
  transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
#bib-book-closeup.open > img.bib-closeup-bg {
  transform: scale(1);
}
#bib-book-closeup .bib-closeup-back {
  position: absolute;
  bottom: 3rem;
  left: 50%;
  transform: translateX(-50%);
  width: 54px;
  height: 54px;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.8));
  transition: filter 0.1s;
}
#bib-book-closeup .bib-closeup-back > img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
  transform: rotate(180deg);
}
#bib-book-closeup .bib-closeup-back:hover {
  filter: drop-shadow(0 4px 18px var(--border-blood)) brightness(1.2);
}
#bib-book-closeup .bib-closeup-back:active {
  transform: translateX(-50%) translateY(1px);
  filter: drop-shadow(0 2px 8px var(--border-blood)) brightness(0.9);
}

/* Ocultar hotspot principal cuando el closeup está abierto */
#bib-book-closeup.open ~ #bib-book-trigger,
.bib-trigger-hidden { opacity: 0; pointer-events: none; }

.salas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 28px;
  margin-top: 50px;
}

.sala-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  border: 1px solid var(--stone-mid);
  overflow: hidden;
  transition: border-color var(--duration-fast) var(--ease-dark),
              transform var(--duration-fast) var(--ease-dark);
  background: var(--stone-dark);
}

.sala-card:hover {
  border-color: var(--blood-core);
  transform: translateY(-4px);
}

.sala-card-img {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
}

.sala-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--duration-med) var(--ease-dark),
              filter var(--duration-med) var(--ease-dark);
  filter: grayscale(0.3) brightness(0.75);
}

.sala-card:hover .sala-card-img img {
  transform: scale(1.05);
  filter: grayscale(0) brightness(0.9);
}

.sala-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 60%);
  pointer-events: none;
}

.sala-card-body {
  padding: 20px 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sala-card-title {
  font-family: var(--font-display);
  font-size: var(--fs-base);
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--parchment);
}

.sala-card-desc {
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  color: var(--bone);
  line-height: 1.6;
  font-style: italic;
  opacity: 0.8;
}

.sala-card-cta {
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--blood-core);
  margin-top: 6px;
  transition: color var(--duration-fast) ease;
}

.sala-card:hover .sala-card-cta {
  color: var(--blood-bright);
}

@media (max-width: 600px) {
  .salas-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}


/* ---- GENERIC SECTION ---- */
.section {
  position: relative;
  padding: var(--section-pad) var(--gutter);
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Primera sección de páginas interiores: compensa el navbar fijo */
.section--page {
  min-height: 100vh;
  padding-top: calc(var(--navbar-height) + var(--section-pad));
}

@media (max-height: 500px) and (orientation: landscape) {
  .section--page {
    padding-top: calc(var(--navbar-height) + 40px);
  }
}

.section-inner {
  max-width: var(--content-max);
  width: 100%;
  position: relative;
  z-index: var(--z-content);
}

.section-number {
  font-family: var(--font-accent);
  font-size: var(--fs-display);
  color: var(--blood-dark);
  opacity: 0.15;
  position: absolute;
  top: -20px;
  left: -10px;
  line-height: 1;
  pointer-events: none;
  user-select: none;
}

.section-title {
  font-size: var(--fs-2xl);
  letter-spacing: 6px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

@media (max-width: 768px) {
  .section-title {
    text-align: center;
  }
}

.section-subtitle {
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  color: var(--ash);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 40px;
}

.section-text {
  font-size: var(--fs-md);
  line-height: 1.9;
  color: var(--bone);
  max-width: 720px;
  opacity: 0.85;
}

.section-text p + p {
  margin-top: 24px;
}

/* Section background tint */
.section--dark {
  background: var(--crypt);
}

.section--blood {
  background: linear-gradient(180deg, var(--void) 0%, var(--blood-deep) 50%, var(--void) 100%);
}

.section--purple {
  background: linear-gradient(180deg, var(--void) 0%, var(--purple-abyss) 50%, var(--void) 100%);
}

/* =========================================
   6.1 HERO — EL CASTILLO DEL CONDE
   ========================================= */

.hero {
  height: 100vh;
  height: 100dvh;
  min-height: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-video-wrap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: var(--z-bg);
  overflow: hidden;
}

/*.hero-video-wrap::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg,
    var(--overlay-mid) 0%,
    var(--overlay-soft) 40%,
    var(--overlay-mid) 80%,
    var(--void) 100%
  );
  z-index: 2;
}*/

.hero-desktop-video,
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-desktop-video {
  /*opacity: 0.5;
  filter: saturate(0.3) brightness(0.6);
  */
  display: block;
}

/* Mobile landscape: video completo (contain), anclado al viewport */
@media (orientation: landscape) and (max-height: 500px) {
  .hero {
    min-height: 0;
  }
  .hero-video-wrap {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--vw-real, 100vw);
    height: var(--vh-real, 100dvh);
    background: var(--void);
  }
  .hero-desktop-video {
    object-fit: cover;
  }

  /* iOS Safari arranca en landscape con un viewport mal calculado en el
     primer paint (rotar a portrait y volver lo arregla porque fuerza un
     recalc). 100dvh no es fiable. Usamos --vh-real / --vw-real que un
     script setea desde visualViewport con reintentos a 50/200/500ms.
     Scopeado al index con data-hero-phase para no afectar al resto. */
  body[data-hero-phase] {
    overflow: hidden;
  }
  body[data-hero-phase] .hero {
    position: fixed;
    inset: 0;
    width: var(--vw-real, 100vw);
    height: var(--vh-real, 100dvh);
    min-height: 0;
  }
}

.hero-video-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--void) 0%, var(--blood-deep) 30%, var(--purple-abyss) 60%, var(--void) 100%);
  animation: hero-bg-shift 20s infinite ease-in-out;
}

@keyframes hero-bg-shift {
  0%, 100% { filter: hue-rotate(0deg) brightness(0.4); }
  50%      { filter: hue-rotate(10deg) brightness(0.5); }
}

.hero-content {
  position: relative;
  z-index: var(--z-content);
  padding: 0 var(--gutter);
}

.hero-crest {
  width: clamp(140px, 20vw, 240px);
  height: auto;
  margin: 0 auto 30px;
  opacity: 0;
  animation: fade-down 1.5s var(--ease-dark) 0.5s forwards;
}

.hero-crest img {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 0 30px var(--border-blood));
}

.hero-title {
  font-size: var(--fs-3xl);
  letter-spacing: clamp(8px, 1.5vw, 20px);
  text-transform: uppercase;  
  text-shadow:
    0 0 40px var(--border-blood),
    0 0 80px var(--border-blood-soft);
  opacity: 0;
  animation: fade-up 1.5s var(--ease-dark) 0.8s forwards;
}

.hero-subtitle {
  font-family: var(--font-body);
  font-size: var(--fs-md);
  letter-spacing: clamp(4px, 1vw, 12px);
  color: var(--bone);
  margin-top: 20px;
  opacity: 0;
  animation: fade-up 1.5s var(--ease-dark) 1.3s forwards;
}

/* Mobile layout: ocultar logo y título, posicionar botón */
@media (max-width: 768px) {
  .hero-crest,
  .hero-title {
    display: none;
  }

  .hero-content {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 60px;
  }

  .hero-cta {
    margin-top: 0;
  }
}

/* Mobile portrait: ocultar video desktop */
@media (max-width: 768px) and (orientation: portrait) {
  .hero-desktop-video {
    display: none;
  }
}


/* Desktop: ocultar logo y título; botón en zona inferior */
@media (min-width: 769px) {
  .hero-crest,
  .hero-title {
    display: none;
  }

  .hero-content {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 80px;
  }

  .hero-cta {
    margin-top: 0;
  }
}

/* Mobile landscape: reducir padding-bottom (después del bloque desktop para ganar la cascada) */
@media (orientation: landscape) and (max-height: 500px) {
  .hero-content {
    padding-bottom: 30px;
  }
}

.hero-door-hitbox {
  position: absolute;
  top: 60%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 33%;
  height: 33%;
  border: 0;
  background: transparent;
  cursor: pointer;
  z-index: 15;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.hero-door-hitbox:focus-visible {
  outline: 2px solid var(--overlay-blood-strong);
}

@media (max-width: 768px),
(orientation: landscape) and (max-height: 500px) {
  .hero-door-hitbox {
    inset: 0;
    top: auto;
    left: auto;
    transform: none;
    width: 100%;
    height: 100%;
  }
}

@keyframes knock-ripple {
  0%   { box-shadow: 0 0 0 0 var(--border-blood-soft); }
  100% { box-shadow: 0 0 0 90px rgba(139,0,0,0); }
}

.hero-door-hitbox.knocking {
  animation: knock-ripple 0.55s ease-out;
}

/* ── Hotspot de la puerta principal ── */
.door-hotspot-anchor {
  position: absolute;
  top: 66%;
  left: 50%;
  transform: translate(-50%, -50%);
}


.hero-cta {
  margin-top: 50px;
  opacity: 0;
  pointer-events: none;
}

.hero-cta--revealed {
  animation: fade-up 1.2s var(--ease-dark) forwards;
  pointer-events: auto;
}

/* Icono de rotación — solo visible en móvil vertical */
.rotate-hint {
  display: none;
  position: fixed;
  top: 25px;
  right: 14px;
  z-index: 500;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,0.5);
  font-family: var(--font-display);
  font-size: var(--fs-micro);
  letter-spacing: 2px;
  text-transform: uppercase;
  pointer-events: none;
  white-space: nowrap;
}

@media (max-width: 768px) and (orientation: portrait) {
  .rotate-hint {
    display: flex;
  }
}

@keyframes phone-tilt {
  0%, 15%  { transform: rotate(0deg); }
  55%, 70% { transform: rotate(-90deg); }
  100%     { transform: rotate(0deg); }
}

.rotate-hint-icon {
  display: flex;
  color: var(--blood-bright);
  animation: phone-tilt 3.5s ease-in-out infinite;
}

.btn-enter {
  display: inline-block;
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  letter-spacing: 5px;
  text-transform: uppercase;
  color: var(--parchment);
  border: 1px solid var(--blood-core);
  padding: 18px 50px;
  position: relative;
  overflow: hidden;
  transition: color var(--duration-fast) ease,
              border-color var(--duration-fast) ease;
}

.btn-enter::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--blood-core);
  transition: left var(--duration-med) var(--ease-dark);
  z-index: -1;
}

.btn-enter:hover::before {
  left: 0;
}

.btn-enter:hover {
  border-color: var(--blood-bright);
  color: var(--text-inverse);
}

.hero-scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-content);
  opacity: 0;
  animation: fade-up 1s var(--ease-dark) 2.5s forwards;
}

.scroll-line {
  width: 1px;
  height: 60px;
  background: linear-gradient(180deg, var(--blood-core), transparent);
  margin: 0 auto 10px;
  position: relative;
  overflow: hidden;
}

.scroll-line::after {
  content: '';
  position: absolute;
  top: -100%;
  width: 100%;
  height: 40%;
  background: var(--blood-bright);
  animation: scroll-drop 2s infinite;
}

@keyframes scroll-drop {
  0%   { top: -40%; }
  100% { top: 120%; }
}

.scroll-text {
  font-family: var(--font-display);
  font-size: var(--fs-micro);
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--ash);
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fade-down {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}


/* =========================================
   6.2 HISTORIA DEL CONDE
   ========================================= */

.historia {
  background: linear-gradient(180deg, var(--void) 0%, var(--blood-deep) 40%, var(--blood-deep) 60%, var(--void) 100%);
}

.historia-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  margin-top: 40px;
}

.historia-image {
  width: 100%;
  aspect-ratio: 3/4;
  background: linear-gradient(145deg, var(--stone) 0%, var(--blood-deep) 100%);
  position: relative;
  overflow: hidden;
}

.historia-image::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 1px solid var(--blood-dark);
  transform: translate(10px, 10px);
  pointer-events: none;
}

.historia-image::after {
  content: 'PLACEHOLDER';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  letter-spacing: 4px;
  color: var(--stone-light);
  opacity: 0.4;
}

@media (max-width: 768px) {
  .historia-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}


/* =========================================
   6.3 CUSTODIOS DEL CASTILLO
   ========================================= */

/* Índice de anclas */
.custodios-index {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 40px;
  padding: 20px 24px;
  background: var(--stone-dark);
  border: 1px solid var(--stone-mid);
  border-left: 3px solid var(--blood-core);
}

.custodio-index-link {
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--bone);
  text-decoration: none;
  padding: 6px 14px;
  border: 1px solid var(--stone-mid);
  transition: color var(--duration-fast) ease,
              border-color var(--duration-fast) ease,
              background var(--duration-fast) ease;
}

.custodio-index-link:hover {
  color: var(--parchment);
  border-color: var(--blood-core);
  background: var(--blood-dark);
}

/* Lista de custodios */
.custodios-list {
  display: flex;
  flex-direction: column;
  gap: 48px;
  margin-top: 48px;
}

/* Card individual */
.custodio-card {
  display: grid;
  grid-template-columns: 280px 1fr;
  background: linear-gradient(135deg, var(--stone-dark) 0%, var(--void) 100%);
  border: 1px solid var(--stone-mid);
  position: relative;
  overflow: hidden;
  transition: border-color var(--duration-med) ease;
}

.custodio-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--blood-core), transparent);
  opacity: 0;
  transition: opacity var(--duration-med) ease;
}

.custodio-card:hover {
  border-color: var(--blood-core);
}

.custodio-card:hover::before {
  opacity: 1;
}

/* Imagen */
.custodio-portrait {
  position: relative;
  overflow: hidden;
  background: var(--crypt);
  /* altura mínima por si el texto es muy corto */
  min-height: 320px;
}

.custodio-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  filter: grayscale(20%) contrast(1.05);
  transition: filter var(--duration-med) ease, transform var(--duration-slow) ease;
}

.custodio-card:hover .custodio-portrait img {
  filter: grayscale(0%) contrast(1.1);
  transform: scale(1.03);
}

/* Degradado inferior sobre la imagen */
.custodio-portrait::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 40%;
  background: linear-gradient(180deg, transparent, var(--void));
  pointer-events: none;
}

/* Columna de texto */
.custodio-body {
  display: flex;
  flex-direction: column;
  padding: 0;
}

.custodio-info {
  padding: 32px 32px 24px;
  flex: 1;
}

.custodio-name {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--parchment);
  margin-bottom: 8px;
}

.custodio-role {
  display: block;
  font-family: var(--font-accent);
  font-size: var(--fs-base);
  color: var(--blood-bright);
  margin-bottom: 20px;
  letter-spacing: 1px;
}

.custodio-lore {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  color: var(--ash);
  line-height: 1.8;
}

/* Sección de encuentro */
.custodio-encounter {
  margin: 0 32px 32px;
  padding: 20px 24px;
  background: linear-gradient(135deg, var(--blood-deep) 0%, var(--stone-dark) 100%);
  border-left: 3px solid var(--blood-core);
  border-bottom: 1px solid var(--blood-dark);
}

/* Etiqueta de sección reutilizable (lugares, encuentro…) */
.custodio-section-label {
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--ash);
  margin-bottom: 12px;
}

/* Lugares que frecuenta */
.custodio-lugares {
  margin: 0 32px 24px;
  padding: 18px 24px;
  background: var(--stone-dark);
  border: 1px solid var(--stone-mid);
}

.custodio-lugares-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.custodio-lugares-list li {
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--bone);
  padding: 4px 12px;
  border: 1px solid var(--stone-mid);
}

/* Encuentro */
.custodio-encounter-label {
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--blood-bright);
  margin-bottom: 10px;
}

.custodio-encounter-text {
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  color: var(--bone);
  line-height: 1.8;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .custodio-card {
    grid-template-columns: 1fr;
  }

  .custodio-portrait {
    min-height: 260px;
    max-height: 320px;
  }

  .custodio-info {
    padding: 24px 20px 16px;
  }

  .custodio-lugares {
    margin: 0 20px 20px;
  }

  .custodio-encounter {
    margin: 0 20px 24px;
  }
}


/* =========================================
   6.4–6.8 ROOM SECTIONS
   ========================================= */

.room-section {
  text-align: center;
}

.room-section .section-text {
  margin: 0 auto;
}

.room-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 30px;
  opacity: 0.7;
  color: var(--blood-core);
}

.room-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  filter: drop-shadow(0 0 10px var(--overlay-blood));
}

.room-atmosphere {
  margin-top: 40px;
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.atmo-tag {
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--blood-core);
  border: 1px solid var(--blood-dark);
  padding: 8px 20px;
  opacity: 0.7;
}

/* =========================================
   6.9 GALERIA
   ========================================= */

.galeria-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-top: 50px;
}

.galeria-item {
  aspect-ratio: 1;
  background: linear-gradient(145deg, var(--stone) 0%, var(--crypt) 100%);
  position: relative;
  overflow: hidden;
  transition: transform var(--duration-med) var(--ease-dark);
}

.galeria-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--blood-core);
  opacity: 0;
  transition: opacity var(--duration-med) ease;
  z-index: 2;
  mix-blend-mode: multiply;
}

.galeria-item::after {
  content: attr(data-caption);
  position: absolute;
  bottom: 20px;
  left: 20px;
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--parchment);
  z-index: 3;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity var(--duration-med) ease,
              transform var(--duration-med) var(--ease-dark);
}

.galeria-item:hover {
  transform: scale(1.02);
  z-index: 5;
}

.galeria-item:hover::before {
  opacity: 0.5;
}

.galeria-item:hover::after {
  opacity: 1;
  transform: translateY(0);
}

.galeria-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  letter-spacing: 3px;
  color: var(--stone-mid);
}

@media (max-width: 768px) {
  .galeria-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .galeria-grid {
    grid-template-columns: 1fr;
  }
}


/* =========================================
   6.10 CONTACTO
   ========================================= */

.contacto-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  margin-top: 50px;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  position: relative;
}

.form-group label {
  display: block;
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--parchment-dim);
  margin-bottom: 8px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  background: var(--stone-dark);
  border: 1px solid var(--stone-mid);
  padding: 14px 18px;
  color: var(--parchment);
  font-size: var(--fs-base);
  transition: border-color var(--duration-fast) ease,
              box-shadow var(--duration-fast) ease;
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--blood-core);
  box-shadow: 0 0 20px var(--overlay-blood-soft);
}

.form-group textarea {
  min-height: 140px;
  resize: vertical;
}

.btn-submit {
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  letter-spacing: 5px;
  text-transform: uppercase;
  color: var(--parchment);
  background: none;
  border: 1px solid var(--blood-core);
  padding: 16px 40px;
  position: relative;
  overflow: hidden;
  transition: color var(--duration-fast) ease;
  align-self: flex-start;
}

.btn-submit::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--blood-core);
  transition: left var(--duration-med) var(--ease-dark);
  z-index: -1;
}

.btn-submit:hover::before {
  left: 0;
}

.btn-submit:hover {
  color: var(--text-inverse);
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.info-block h3 {
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--blood-core);
  margin-bottom: 10px;
}

.info-block p {
  color: var(--bone);
  line-height: 1.8;
}

.map-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  background: linear-gradient(145deg, var(--stone) 0%, var(--crypt) 100%);
  border: 1px solid var(--stone-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  letter-spacing: 4px;
  color: var(--stone-light);
  margin-top: 30px;
}

@media (max-width: 768px) {
  .contacto-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}


/* =========================================
   6.11 RESERVAR — Calendario de disponibilidad
   ========================================= */

.reservar-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  margin-top: 50px;
}

.reservar-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.reservar-info {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

/* Calendar container */
.reservar-calendar {
  display: flex;
  flex-direction: column;
  gap: 28px;
  margin-top: 10px;
  padding: 20px;
  background: var(--stone-dark);
  border: 1px solid var(--stone-mid);
}

/* Barra de navegación mes anterior / siguiente */
.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 8px;
}

.cal-nav-btn {
  background: none;
  border: 1px solid var(--stone-mid);
  color: var(--bone);
  font-size: var(--fs-base);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color var(--duration-fast) ease, color var(--duration-fast) ease;
  flex-shrink: 0;
}

.cal-nav-btn:not(:disabled):hover {
  border-color: var(--blood-core);
  color: var(--parchment);
}

.cal-nav-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.cal-month-header {
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--parchment);
  text-align: center;
  flex: 1;
}

.cal-week-labels {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  margin-bottom: 6px;
}

.cal-week-labels span {
  text-align: center;
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  letter-spacing: 2px;
  color: var(--ash);
  text-transform: uppercase;
  padding: 4px 0;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  color: var(--bone);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-dark);
  border-radius: 1px;
  user-select: none;
}

.cal-day:not(.cal-day--past):not(.cal-day--empty):hover {
  border-color: var(--blood-core);
  color: var(--parchment);
  background: var(--overlay-blood-soft);
}

.cal-day--today {
  border-color: var(--stone-mid);
  color: var(--parchment);
}

.cal-day--selected {
  background: var(--blood-core) !important;
  border-color: var(--blood-bright) !important;
  color: var(--text-inverse) !important;
  box-shadow: 0 0 10px var(--border-blood);
}

.cal-day--past {
  color: var(--stone-mid);
  cursor: not-allowed;
  opacity: 0.45;
}

.cal-day--blocked {
  color: var(--stone-light);
  cursor: not-allowed;
  opacity: 0.35;
  text-decoration: line-through;
}

.cal-day--empty {
  cursor: default;
}

.cal-selection-info {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 20px;
}

.cal-count {
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  letter-spacing: 2px;
  color: var(--bone);
  transition: color var(--duration-fast);
  text-transform: uppercase;
}

.cal-warning {
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  color: var(--blood-bright);
  font-style: italic;
  display: none;
}

.cal-label-note {
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  color: var(--bone);
  text-transform: none;
  letter-spacing: 0;
}

/* Map button */
.btn-map {
  display: inline-block;
  margin-top: 14px;
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--ash);
  border: 1px solid var(--stone-mid);
  padding: 10px 20px;
  text-decoration: none;
  transition: all var(--duration-fast) var(--ease-dark);
}

.btn-map:hover {
  color: var(--parchment);
  border-color: var(--blood-core);
  background: var(--overlay-blood-soft);
}

/* Header minimalista de reservar.html */
.reservar-header {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem 1rem 1.5rem;
  background: var(--crypt);
}

.reservar-header__logo {
  width: clamp(180px, 40vw, 320px);
  height: auto;
  opacity: 0.88;
  transition: opacity 0.2s ease;
}

.reservar-header__logo:hover {
  opacity: 1;
}

/* Leaflet map container */
.reservar-map {
  width: 100%;
  height: 280px;
  margin-top: 12px;
  border: 1px solid var(--stone-mid);
  border-radius: 3px;
  overflow: hidden;
}

/* Neutralizar estilos por defecto de Leaflet que rompen con el tema */
.reservar-map .leaflet-control-zoom a {
  background: var(--stone-dark);
  color: var(--bone);
  border-color: var(--stone-mid);
}
.reservar-map .leaflet-control-zoom a:hover {
  background: var(--stone);
  color: var(--parchment);
}
.reservar-map .leaflet-bar {
  border: 1px solid var(--stone-mid) !important;
  box-shadow: none !important;
}

/* Popup sin decoración de Leaflet (flecha, fondo blanco, borde) */
.castillo-popup .leaflet-popup-content-wrapper,
.castillo-popup .leaflet-popup-tip {
  background: transparent;
  box-shadow: none;
  padding: 0;
}
.castillo-popup .leaflet-popup-content {
  margin: 0;
}

/* Confirmation overlay */
.reserva-confirm {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.94);
  z-index: calc(var(--z-menu) + 10);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.reserva-confirm-inner {
  max-width: 440px;
  width: 100%;
  text-align: center;
  padding: 60px 40px;
  border: 1px solid var(--blood-core);
  background: var(--crypt);
  box-shadow: 0 0 60px var(--border-blood-soft);
}

.reserva-confirm-icon {
  font-size: var(--fs-2xl);
  color: var(--blood-core);
  display: block;
  margin-bottom: 24px;
}

.reserva-confirm-inner h3 {
  font-family: var(--font-display);
  font-size: var(--fs-md);
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--parchment);
  margin-bottom: 18px;
}

.reserva-confirm-inner p {
  font-family: var(--font-body);
  color: var(--bone);
  line-height: 1.8;
  margin-bottom: 24px;
}

.reserva-confirm--final {
  background-image: url('/public/assets/images/documents/document-end.webp');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  background-color: #000;
  cursor: pointer;
}

@media (max-width: 768px) {
  .reservar-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .reservar-map {
    height: 220px;
    margin-top: 10px;
  }
}


/* =========================================
   FOOTER
   ========================================= */

.footer {
  padding: 40px var(--gutter);
  text-align: center;
  border-top: 1px solid var(--stone-mid);
  background: var(--void);
}

.footer-logo {
  display: block;
  margin: 0 auto 20px;
  width: 120px;
  opacity: 0.8;
}

.footer-text {
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--bone);
}

.footer-text .blood {
  color: var(--blood-bright);
}

/* ---- CCTV FRAME ---- */
.cctv-container {
  width: 100%;
  max-width: 850px;
  margin: 50px auto;
  position: relative;
  z-index: 1;
}

.cctv-frame {
  position: relative;
  background: var(--crypt);
  padding: 12px;
  border: 3px solid var(--stone);
  box-shadow: 
    0 0 0 2px var(--crypt),
    inset 0 0 30px var(--overlay-dark),
    0 0 60px var(--overlay-mid);
  overflow: hidden;
}

.cctv-image {
  position: relative;
  overflow: hidden;
}

.cctv-image::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
  opacity: var(--cctv-grain-opacity, 0.1);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
  background-size: 300px 300px;
  animation: cctv-grain var(--cctv-grain-duration, 0.2s) steps(4) infinite;
}

.cctv-frame.glitching .cctv-image::before,
.cctv-frame.phantom .cctv-image::before {
  opacity: calc(var(--cctv-grain-opacity, 0.15) * 1.3);
  animation: cctv-grain-intense var(--cctv-grain-duration, 0.2s) steps(3) infinite;
}

.cctv-image::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 11;
  opacity: var(--cctv-static-opacity, 0.4);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='turbulence' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
  background-size: 400px 400px;
  animation: cctv-static var(--cctv-static-duration, 0.1s) steps(4) infinite;
}

.cctv-frame.glitching .cctv-image::after,
.cctv-frame.phantom .cctv-image::after {
  opacity: var(--cctv-static-opacity, 0.6);
  animation: cctv-static-intense var(--cctv-static-duration, 0.1s) steps(3) infinite;
}

@keyframes cctv-grain {
  0%   { background-position: 0 0; }
  25%  { background-position: -10px -10px; }
  50%  { background-position: 8px 8px; }
  75%  { background-position: -8px 8px; }
  100% { background-position: 0 0; }
}

@keyframes cctv-grain-intense {
  0% { background-position: 0 0; }
  33% { background-position: -15px -15px; }
  66% { background-position: 15px 10px; }
  100% { background-position: 0 0; }
}

@keyframes cctv-static {
  0%   { background-position: 0 0; }
  16%  { background-position: -20px 10px; }
  33%  { background-position: 15px -20px; }
  50%  { background-position: -10px 25px; }
  66%  { background-position: 25px 5px; }
  83%  { background-position: -5px -15px; }
  100% { background-position: 0 0; }
}

@keyframes cctv-static-intense {
  0%   { background-position: 0 0; filter: brightness(1.2); }
  25%  { background-position: -30px 15px; filter: brightness(0.8); }
  50%  { background-position: 20px -25px; filter: brightness(1.3); }
  75%  { background-position: -15px 20px; filter: brightness(0.9); }
  100% { background-position: 0 0; filter: brightness(1.2); }
}

.cctv-overlay {
  position: absolute;
  top: 20px;
  left: 20px;
  right: 20px;
  display: flex;
  justify-content: space-between;
  z-index: 50;
  pointer-events: none;
}

.cctv-timestamp {
  font-family: 'Courier New', monospace;
  font-size: var(--fs-base);
  color: var(--blood-flare);
  text-shadow: 0 0 10px var(--blood-flare);
  letter-spacing: 2px;
}

@media (max-width: 768px) {
  .cctv-timestamp {
    font-size: var(--fs-xs);
  }
}

@media (orientation: landscape) and (max-height: 500px) {
  .cctv-container {
    width: 65%;
  }
}

.cctv-label {
  font-family: 'Courier New', monospace;
  font-size: var(--fs-sm);
  color: var(--blood-flare);
  text-shadow: 0 0 10px var(--blood-flare);
  letter-spacing: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.live-dot {
  width: 8px;
  height: 8px;
  background: var(--blood-flare);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--blood-flare), 0 0 12px var(--blood-flare);
  animation: pulse-dot 1.2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0.3; }
}

.cctv-scanlines {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  bottom: 12px;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.15) 2px,
    rgba(0, 0, 0, 0.15) 4px
  );
  pointer-events: none;
  z-index: 5;
}

.cctv-scanlines-moving {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0, 0, 0, 0.12) 3px,
    rgba(0, 0, 0, 0.12) 4px
  );
  pointer-events: none;
  z-index: 8;
  animation: scanline-scroll 8s linear infinite;
}

@keyframes scanline-scroll {
  0% { background-position: 0 0; }
  100% { background-position: 0 100px; }
}

.cctv-corner {
  position: absolute;
  width: 20px;
  height: 20px;
  border-color: var(--stone-light);
  border-style: solid;
  z-index: 6;
}

.cctv-corner--tl { top: 8px; left: 8px; border-width: 2px 0 0 2px; }
.cctv-corner--tr { top: 8px; right: 8px; border-width: 2px 2px 0 0; }
.cctv-corner--bl { bottom: 8px; left: 8px; border-width: 0 0 2px 2px; }
.cctv-corner--br { bottom: 8px; right: 8px; border-width: 0 2px 2px 0; }

.cctv-image {
  position: relative;
  overflow: hidden;
}

.cctv-image img {
  width: 100%;
  height: auto;
  display: block;
  filter: grayscale(1) sepia(1) hue-rotate(70deg) saturate(2.5) brightness(0.8) contrast(2) blur(0.5px);
}

.cctv-vignette {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.99) 100%);
  pointer-events: none;
  z-index: 20;
}

.cctv-frame.glitching {
  animation: frame-jitter 0.15s steps(3) infinite;
}

.cctv-frame.glitching .cctv-image {
  animation: static-noise 0.15s steps(4) infinite;
}

.cctv-frame.glitching .cctv-scanlines {
  opacity: 0.3;
}

.cctv-frame.glitching::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    var(--fog-white) 2px,
    var(--fog-white) 4px
  );
  z-index: 15;
  pointer-events: none;
  animation: noise-scan 0.08s steps(2) infinite;
}

.cctv-frame.phantom .cctv-image img {
  animation: phantom-cross 0.5s ease-in-out;
}

@keyframes frame-jitter {
  0% { transform: translate(0, 0); }
  33% { transform: translate(-1px, 0); }
  66% { transform: translate(1px, 0); }
  100% { transform: translate(0, 0); }
}

@keyframes static-noise {
  0% { opacity: 1; }
  25% { opacity: 0.7; }
  50% { opacity: 0.9; }
  75% { opacity: 0.6; }
  100% { opacity: 1; }
}

@keyframes noise-scan {
  0% { background-position: 0 0; }
  100% { background-position: 0 10px; }
}

@keyframes phantom-cross {
  0% { opacity: 1; filter: contrast(1.3) brightness(0.75) saturate(0.6) sepia(0.3) blur(0.3px); }
  15% { opacity: 0; }
  20% { opacity: 0.3; }
  25% { opacity: 0; }
  30% { opacity: 0.5; }
  40% { opacity: 0; }
  50% { opacity: 0.4; }
  60% { opacity: 0; }
  70% { opacity: 1; filter: contrast(1.3) brightness(0.75) saturate(0.6) sepia(0.3) blur(0.3px); }
  100% { opacity: 1; filter: contrast(1.3) brightness(0.75) saturate(0.6) sepia(0.3) blur(0.3px); }
}

.cctv-caption {
  text-align: center;
  font-family: 'Courier New', monospace;
  font-size: var(--fs-xs);
  color: var(--stone-light);
  margin-top: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
}


/* =========================================
   LAS SALAS — Carousel fullscreen
   ========================================= */

.salas-body #site-footer { display: none; }
.salas-body { overflow: hidden; }

.salas-carousel {
  position: fixed;
  inset: 0;
  z-index: var(--z-content);
  overflow: hidden;
  cursor: crosshair;
}

.salas-track {
  display: flex;
  height: 100%;
  transition: transform 0.8s cubic-bezier(0.77, 0, 0.175, 1);
  will-change: transform;
}

.salas-slide {
  position: relative;
  width: 100vw;
  min-width: 100vw;
  height: 100%;
  flex-shrink: 0;
  overflow: hidden;
}

.salas-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  user-select: none;
  pointer-events: none;
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              opacity 0.5s ease;
}

.salas-bg--zoom {
  transform: scale(1.12);
  opacity: 0;
}

.rit-baphomet-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
  display: none;
  z-index: 1;
}

/* ── Arrows ── */
.salas-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  background: var(--overlay-dark);
  border: 1px solid var(--border-blood);
  border-bottom: 3px solid var(--overlay-blood-deep);
  color: var(--blood-bright);
  font-size: 0; /* ocultamos el carácter HTML; lo mostramos vía ::before con \FE0E para evitar que iOS lo renderice como emoji */
  width: 54px;
  height: 54px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px var(--overlay-dark);
  transition: all 0.1s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none;
  appearance: none;
}

.salas-arrow:focus {
  outline: none;
  box-shadow: 0 4px 14px var(--overlay-dark);
}

.salas-arrow:active:not(:disabled) {
  transform: translateY(1px);
  border-bottom-width: 1px;
  box-shadow: 0 1px 6px var(--overlay-dark);
}

.salas-arrow--prev { left: 1.5rem; }
.salas-arrow--prev::before { content: '◀\FE0E'; font-size: var(--fs-md); color: var(--blood-bright); }
.salas-arrow--next { right: 1.5rem; }
.salas-arrow--next::before { content: '▶\FE0E'; font-size: var(--fs-md); color: var(--blood-bright); }
.salas-arrow--down {
  top: auto;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
}
.salas-arrow--down::before { content: '▼\FE0E'; font-size: var(--fs-md); color: var(--blood-bright); }
.salas-arrow--down:active:not(:disabled) { transform: translateX(-50%) translateY(1px); }

/* ── Variante con imagen: aplanar recuadro y rotar según dirección ── */
.salas-arrow:has(img),
.ala-nav-btn:has(img) {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.8));
}
/* salas-arrow: solo cambio de filtro, sin transform (preserva el translateY(-50%) de centrado) */
.salas-arrow:has(img):hover {
  background: transparent;
  border: none;
  box-shadow: none;
  filter: drop-shadow(0 4px 18px var(--border-blood)) brightness(1.2);
}
.salas-arrow:has(img):active:not(:disabled) {
  filter: drop-shadow(0 2px 8px var(--border-blood)) brightness(0.9);
  transform: translateY(-50%); /* anula el translateY(1px) de la regla base, preserva el centrado */
}
.salas-arrow--down:has(img):active:not(:disabled) {
  transform: translateX(-50%); /* --down se centra horizontalmente, no verticalmente */
}
/* ala-nav-btn: puede usar transform porque está en grid (sin translateY de centrado) */
.ala-nav-btn:has(img):hover:not(:disabled) {
  background: transparent;
  border: none;
  box-shadow: none;
  transform: translateY(-1px);
  filter: drop-shadow(0 4px 14px var(--border-blood)) brightness(1.2);
}
.salas-arrow:has(img)::before,
.ala-nav-btn:has(img)::before {
  content: none;
}
.salas-arrow > img,
.ala-nav-btn > img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}
/* Rotaciones ala-nav-btn — imagen base apunta hacia arriba */
.ala-nav-btn--left > img  { transform: rotate(-90deg); }
.ala-nav-btn--right > img { transform: rotate(90deg); }
.ala-nav-btn--down > img  { transform: rotate(180deg); }
/* --up: sin rotación */

/* salas-arrow: btn-turn.webp (giro derecha) para prev/next, flecha para down */
.salas-arrow--prev > img  { transform: scaleX(-1); }   /* espejo horizontal = giro izquierda */
/* --next: sin transform, la imagen ya apunta a la derecha */
.salas-arrow--down > img  { transform: rotate(180deg); }

/* ── Room title (always visible, bottom) ── */
.salas-room-title {
  position: absolute;
  bottom: 2.8rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  letter-spacing: 5px;
  text-transform: uppercase;
  color: var(--parchment);
  opacity: 1;
  pointer-events: none;
  white-space: nowrap;
  text-shadow: 0 0 20px rgba(0, 0, 0, 0.95);
}


/* ── Enlarged hotspot for the door ── */
.salas-door-hotspot {
  width: 64px;
  height: 64px;
}


/* ── Navigation dots ── */
.salas-dots {
  display: none;
}

.salas-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid var(--border-blood);
  cursor: pointer;
  transition: background 0.3s, box-shadow 0.3s, transform 0.3s;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.salas-dot.active {
  background: var(--blood-bright);
  box-shadow: 0 0 8px var(--blood-glow);
  transform: scale(1.3);
}

/* ── Mobile adjustments ── */
@media (max-width: 600px) {
  .salas-arrow {
    width: 44px;
    height: 44px;
  }
  .salas-arrow--prev { left: 0.6rem; }
  .salas-arrow--prev::before { font-size: var(--fs-base); }
  .salas-arrow--next { right: 0.6rem; }
  .salas-arrow--next::before { font-size: var(--fs-base); }


}



/* =========================================
   CLOSED-DOOR — Criptex puzzle
   ========================================= */

.closed-door-body { overflow: hidden; }
.closed-door-body #site-footer { display: none; }

.criptex-wrap {
  position: fixed;
  inset: 0;
  z-index: var(--z-content);
  cursor: pointer;
}

.criptex-wrap.no-click { cursor: default; }

.criptex-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  user-select: none;
  pointer-events: none;
}

.criptex-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center,
    transparent 20%,
    rgba(0,0,0,0.45) 58%,
    var(--overlay-deep) 100%
  );
  pointer-events: none;
}

/* Subtle initial hint */
.criptex-initial-hint {
  position: absolute;
  bottom: 12%;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-display);
  font-size: var(--fs-base);
  font-weight: 700;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: rgba(200,180,160,0.85);
  text-shadow: 0 1px 6px var(--overlay-deep);
  white-space: nowrap;
  animation: criptex-blink 2.8s ease-in-out infinite;
  pointer-events: none;
  z-index: 10;
}

@keyframes criptex-blink {
  0%, 100% { opacity: 0.15; }
  50% { opacity: 0.65; }
}

/* ── Gothic panel (shared by message & result) ── */
.gothic-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(550px, 92vw);
  background: rgba(4, 1, 1, 0.8) url('/public/assets/images/ui/ui-text-box-2.webp') center/100% 100% no-repeat;  
  box-shadow:
    0 0 0 1px var(--overlay-deep),
    0 0 0 -1px var(--overlay-blood-soft),
    0 0 60px var(--border-blood-soft);
  padding: 3rem 3.2rem 2.4rem;
  text-align: center;
  z-index: 25;
  display: none;
}

/*.gothic-panel::before { content: '✦'; position: absolute; top: 12px; left: 16px;  color: var(--border-blood); font-size: var(--fs-xs); }
.gothic-panel::after  { content: '✦'; position: absolute; bottom: 12px; right: 16px; color: var(--border-blood); font-size: var(--fs-xs); }
*/
.gothic-panel-eyebrow {
  font-family: var(--font-display);
  font-size: var(--fs-micro);
  letter-spacing: 5px;
  text-transform: uppercase;
  color: var(--blood-bright);
  text-shadow: 0 0 8px var(--blood-glow);
  margin-bottom: 1.4rem;
}

.gothic-panel-text {
  font-family: var(--font-body);
  font-size: var(--fs-md);
  color: var(--parchment);
  line-height: 1.8;
  min-height: 1.8em;
}

.gothic-panel-sub {
  font-family: var(--font-display);
  font-size: var(--fs-micro);
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(200, 180, 180, 0.7);
  margin-top: 1.8rem;
  opacity: 0;
  transition: opacity 0.7s;
  text-shadow: 0 0 10px var(--overlay-dark);
}

.gothic-panel-sub.visible { opacity: 1; }

/* Spinner que reemplaza "toca para continuar" cuando una acción del panel
   está redirigiendo a otra página y no debemos esperar al click del jugador
   (p.ej. salida del castillo desde el vestíbulo). */
.exit-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 1.5px solid rgba(204, 0, 0, 0.25);
  border-top-color: var(--blood-core);
  border-radius: 50%;
  vertical-align: middle;
  animation: exit-spinner-rotate 1.1s linear infinite;
}
@keyframes exit-spinner-rotate {
  to { transform: rotate(360deg); }
}

/* ── Confirm buttons inside gothic-panel ── */
.gothic-panel-confirm {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  align-items: center;
  margin-top: 1.4rem;
}

.gothic-confirm-btn {
  font-family: var(--font-display);
  font-size: var(--fs-micro);
  letter-spacing: 3px;
  width: 100%;
  text-transform: uppercase;
  padding: 0.65rem 1.4rem;
  border: none;
  background: url('/public/assets/images/ui/ui-action-btn-bar.webp') center/100% 100% no-repeat;
  color: var(--parchment);
  cursor: pointer;
  transition: filter 0.2s;
}

.gothic-confirm-btn:hover {
  filter: sepia(1) saturate(4) hue-rotate(-20deg) brightness(1.1);
}

.gothic-confirm-btn--no {
  color: rgba(200,180,150,0.8);
  filter: brightness(0.6);
}

.gothic-confirm-btn--no:hover {
  filter: brightness(0.9);
  color: rgba(200,180,150,1);
}

/* ── Gothic overlay (fullscreen backdrop con gothic-panel dentro) ── */
.gothic-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-deep);
  z-index: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.gothic-overlay.open {
  opacity: 1;
  pointer-events: all;
  cursor: pointer;
}

.gothic-overlay .gothic-panel {
  display: block;
}

@keyframes gothic-img-appear {
  from { opacity: 0; transform: scale(0.82); }
  to   { opacity: 1; transform: scale(1); }
}

.gothic-panel-img {
  display: block;
  width: clamp(80px, 14vw, 180px);
  height: auto;
  margin: 0 auto 1.5rem;
  animation: gothic-img-appear 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
  filter: drop-shadow(0 0 24px var(--overlay-blood-strong));
}

/* ── Criptex puzzle ── */
.criptex-puzzle {
  --dial-w: clamp(54px, calc(13.125vw - 72px), 264px);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: none;
  flex-direction: column;
  align-items: center;
  gap: clamp(1.4rem, 2.5vw, 3.5rem);
  z-index: 25;
}

.criptex-dials {
  display: flex;
  gap: clamp(5px, 0.6vw, 18px);
}

.criptex-dial {
  display: flex;
  flex-direction: column;
  align-items: center;
  user-select: none;
}

.dial-btn {
  width: var(--dial-w);
  height: calc(var(--dial-w) * 0.56);
  background: var(--overlay-dark);
  border: 1px solid var(--overlay-blood);
  color: rgba(160,130,90,0.5);
  font-size: var(--fs-xl);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.dial-btn:hover, .dial-btn:active {
  background: var(--border-blood-soft);
  color: var(--parchment);
}

.dial-display {
  width: var(--dial-w);
  background: rgba(5, 2, 0, 0.92);
  border-left: 1px solid var(--blood-core);
  border-right: 1px solid var(--blood-core);
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
}

.dial-adj {
  width: 100%;
  height: calc(var(--dial-w) * 0.44);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  color: rgba(180,140,60,0.25);
}

.dial-face {
  width: 100%;
  height: var(--dial-w);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: var(--fs-display);
  font-weight: 700;
  color: var(--gold);
  text-shadow: 0 0 14px rgba(201,168,76,0.65);
  border-top: 1px solid var(--border-blood);
  border-bottom: 1px solid var(--border-blood);
  transition: color 0.12s, text-shadow 0.12s;
}

.dial-face.flash {
  color: var(--gold-bright);
  text-shadow: 0 0 24px rgba(240,208,112,1);
}

.criptex-open-btn {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  letter-spacing: 5px;
  text-transform: uppercase;
  color: var(--parchment);
  background: url('/public/assets/images/ui/ui-action-btn-bar.webp') center / 100% 100% no-repeat;
  border: none;
  padding: clamp(14px, 1.1vw, 36px) clamp(48px, 4.5vw, 140px);
  cursor: pointer;
  transition: filter 0.2s, transform 0.15s;
  text-shadow: 0 1px 3px rgba(0,0,0,0.85);
  -webkit-tap-highlight-color: transparent;
}

.criptex-open-btn:hover {
  filter: brightness(1.2) drop-shadow(0 0 6px var(--blood-glow));
  transform: translateY(-1px);
}

.criptex-open-btn:active {
  transform: translateY(0);
}

/* ── Result / error panel ── */
.criptex-result {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(500px, 92vw);
  background: rgba(4, 1, 1, 0.8) url('/public/assets/images/ui/ui-text-box-2.webp') center/100% 100% no-repeat;
  border: 1px solid var(--blood-core);
  box-shadow:
    0 0 0 1px var(--overlay-deep),
    0 0 0 2px var(--overlay-blood-soft),
    0 0 60px var(--border-blood-soft);
  padding: 3rem 3.2rem 2.4rem;
  text-align: center;
  cursor: pointer;
  z-index: 30;
  display: none;
}

.criptex-result::before { content: '✦'; position: absolute; top: 12px; left: 16px;  color: var(--border-blood); font-size: var(--fs-xs); }
.criptex-result::after  { content: '✦'; position: absolute; bottom: 12px; right: 16px; color: var(--border-blood); font-size: var(--fs-xs); }

.criptex-result-title {
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  letter-spacing: 5px;
  text-transform: uppercase;
  color: var(--blood-bright);
  margin-bottom: 1.2rem;
}

.criptex-result-body {
  font-family: var(--font-body);
  font-size: var(--fs-md);
  color: var(--parchment);
  line-height: 1.8;
}

.criptex-result-body em {
  display: block;
  font-style: italic;
  font-size: var(--fs-base);
  opacity: 0.7;
  margin-top: 0.8rem;
}

.criptex-result-hint {
  font-family: var(--font-display);
  font-size: var(--fs-micro);
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--border-blood);
  margin-top: 1.8rem;
}

/* ── Mobile ── */

@media (max-width: 600px) {
  .dial-btn     { width: 46px; height: 34px; }
  .dial-display { width: 46px; }
  .dial-adj     { height: 20px; font-size: var(--fs-sm); }
  .dial-face    { height: 48px; font-size: var(--fs-xl); }
  .criptex-dials { gap: 3px; }
  .gothic-panel,
  .criptex-result { padding: 2.2rem 1.8rem 2rem; }
  .gothic-panel-text { font-size: var(--fs-base); }
}

/* ── Mobile landscape ── */
@media (orientation: landscape) and (max-height: 500px) {
  .dial-btn     { width: 80px; }
  .dial-display { width: 80px; }
}


/* =========================================
   BIBLIOTECA — PDF OVERLAY
   ========================================= */

.pdf-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 0, 0, 0.97);
  z-index: 500;
  display: none;
  flex-direction: column;
  align-items: center;
}

.pdf-overlay.open {
  display: flex;
}

.pdf-topbar {
  position: relative;
  width: 100%;
  max-width: 900px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  flex-shrink: 0;
}

.pdf-page-counter {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-body);
  font-style: normal;
  font-size: 1.15rem;
  color: rgba(224, 200, 160, 0.65);
  letter-spacing: 0.14em;
  min-width: 4rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.2rem 0.6rem;
  text-align: center;
  transition: color 0.15s;
}

.pdf-page-counter:hover {
  color: rgba(224, 200, 160, 0.85);
}

/* ── Jump-to-page panel ── */
.pdf-jump-overlay {
  position: fixed;
  inset: 0;
  z-index: 501;
  background: rgba(2, 0, 0, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.pdf-jump-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.pdf-jump-panel {
  width: min(360px, 92vw);
  background: rgba(4, 1, 1, 0.9) url('/public/assets/images/ui/ui-text-box-2.webp') center/100% 100% no-repeat;
  box-shadow: 0 0 60px rgba(139, 0, 0, 0.4);
  padding: 2.4rem 2.6rem 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
}

.pdf-jump-title {
  font-family: var(--font-body);
  font-size: var(--fs-md);
  color: var(--parchment);
  line-height: 1.6;
}

.pdf-jump-input {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: 0.2em;
  color: var(--blood-glow);
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid var(--blood-core);
  border-radius: 2px;
  padding: 0.35rem 0.8rem;
  width: 6rem;
  text-align: center;
  -moz-appearance: textfield;
}

.pdf-jump-input::-webkit-outer-spin-button,
.pdf-jump-input::-webkit-inner-spin-button { -webkit-appearance: none; }

.pdf-jump-input:focus {
  outline: none;
  border-color: var(--blood-glow);
  box-shadow: 0 0 12px rgba(204, 0, 0, 0.35);
}

.pdf-jump-actions {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  width: 100%;
}

.pdf-audio-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  line-height: 1;
  transition: opacity 0.2s, transform 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pdf-audio-btn:hover {
  opacity: 0.75;
  transform: scale(1.1);
}

.pdf-volume-btn img {
  width: 2rem;
  height: 2rem;
  display: block;
}

@media (hover: none) {
  .pdf-volume-btn img { width: 2.4rem; height: 2.4rem; }
}

.pdf-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  margin-left: auto;
  transition: opacity 0.2s, transform 0.2s;
  flex-shrink: 0;
}

.pdf-close img {
  width: 2rem;
  height: 2rem;
  display: block;
}

.pdf-close:hover {
  opacity: 0.75;
  transform: scale(1.1);
}

.pdf-canvas-container {
  width: 100%;
  max-width: 900px;
  flex: 1;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.5rem;
  box-sizing: border-box;
}

.pdf-canvas-container canvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
}

.pdf-nav-buttons {
  width: 100%;
  max-width: 900px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 1rem;
  flex-shrink: 0;
}

.pdf-nav-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  transition: opacity 0.2s, transform 0.2s;
}

.pdf-nav-btn img {
  width: 2.2rem;
  height: auto;
  display: block;
}

.pdf-nav-btn--prev img { transform: rotate(-90deg); }
.pdf-nav-btn--next img { transform: rotate(90deg);  }

.pdf-nav-btn:hover { opacity: 0.7; }

.pdf-nav-btn:disabled {
  opacity: 0.15;
  cursor: default;
  pointer-events: none;
}

@media (hover: none) {
  .pdf-nav-btn img { width: 3rem; }
}

.pdf-loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2, 0, 0, 0.97);
  pointer-events: none;
}

.pdf-loader-text {
  font-family: var(--font-body);
  font-size: 1rem;
  color: rgba(224, 200, 160, 0.65);
  letter-spacing: 0.12em;
}

/* ── Botón volver a Biblioteca ── */
.btn-back-biblioteca {
  display: inline-block;
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--blood-bright);
  border: 1px solid var(--blood-core);
  padding: 0.75rem 2rem;
  text-decoration: none;
  transition: color 0.3s, border-color 0.3s, box-shadow 0.3s;
  margin-bottom: 2rem;
}

.btn-back-biblioteca:hover {
  color: var(--blood-glow);
  border-color: var(--blood-bright);
  box-shadow: 0 0 18px var(--border-blood-soft);
}

/* =========================================
   COFFIN OVERLAY (dormitorio — ataúd bloqueado)
   ========================================= */

.coffin-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  cursor: pointer;
  transition: opacity 0.5s ease;
}
.coffin-overlay.open     { opacity: 1; pointer-events: auto; }
.coffin-overlay.no-click { cursor: default; }

.coffin-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  transform: scale(1.08);
  transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.coffin-overlay.open .coffin-bg { transform: scale(1); }

.coffin-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center,
    transparent 20%,
    rgba(0,0,0,0.45) 58%,
    var(--overlay-deep) 100%
  );
  pointer-events: none;
}

.coffin-result {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(500px, 92vw);
  background: rgba(4, 1, 1, 0.8) url('/public/assets/images/ui/ui-text-box-2.webp') center/100% 100% no-repeat;
  border: 1px solid var(--blood-core);
  box-shadow:
    0 0 0 1px var(--overlay-deep),
    0 0 0 2px var(--overlay-blood-soft),
    0 0 60px var(--border-blood-soft);
  padding: 3rem 3.2rem 2.4rem;
  text-align: center;
  cursor: pointer;
  z-index: 30;
  display: none;
}
.coffin-result::before { content: '✦'; position: absolute; top: 12px; left: 16px;  color: var(--border-blood); font-size: var(--fs-xs); }
.coffin-result::after  { content: '✦'; position: absolute; bottom: 12px; right: 16px; color: var(--border-blood); font-size: var(--fs-xs); }

.coffin-result-title {
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  letter-spacing: 5px;
  text-transform: uppercase;
  color: var(--blood-bright);
  margin-bottom: 1.2rem;
}
.coffin-result-body {
  font-family: var(--font-body);
  font-size: var(--fs-md);
  color: var(--parchment);
  line-height: 1.8;
}
.coffin-result-body em {
  display: block;
  font-style: italic;
  font-size: var(--fs-base);
  opacity: 0.7;
  margin-top: 0.8rem;
}
.coffin-result-hint {
  font-family: var(--font-display);
  font-size: var(--fs-micro);
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--border-blood);
  margin-top: 1.8rem;
}

/* =========================================
   CLOCK OVERLAY (close-up puzzle)
   ========================================= */

.clock-overlay {
  position: fixed;
  inset: 0;
  background: var(--void);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
}
.clock-overlay.open {
  display: flex;
}
.clock-close {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 510;
  background: none;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.clock-close img { width: 64px; height: 64px; object-fit: contain; }

/* =========================================
   CLOCK PUZZLE
   ========================================= */

.clock-puzzle-wrap {
  width: 100%;
  height: 100%;
}

.clock-img-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.clock-img-container > picture,
.clock-img-container > picture img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

.clock-hands-svg {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  overflow: visible;
}

.clock-hand-img {
  position: absolute;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  opacity: 0;
  transition: none;
}

.clock-controls {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 2rem;
  background: rgba(2, 0, 0, 0.75);
  border: 1px solid var(--blood-core);
  padding: 0.6rem 1.8rem;
  backdrop-filter: blur(6px);
  z-index: 10;
}

.clock-btn {
  width: 56px;
  height: 56px;
  background: var(--overlay-dark);
  border: 1px solid var(--blood-core);
  color: var(--parchment);
  font-size: var(--fs-xl);
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.clock-btn:hover, .clock-btn:active {
  background: var(--border-blood);
  border-color: var(--blood-bright);
}

.clock-time-display {
  font-family: var(--font-display);
  font-size: var(--fs-md);
  letter-spacing: 6px;
  color: var(--gold);
  min-width: 80px;
  text-align: center;
}


/* =========================================
   DORMITORIO — hotspot reloj
   ========================================= */

#dorm-clock-trigger { top: 27%; } /* mobile + 1920 */

@media (min-width: 2560px) {
  #dorm-clock-trigger { top: 24%; }
}

/* =========================================
   ORLOK SECRET ROOM
   ========================================= */

.orlok-body #site-footer { display: none; }

.orlok-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6rem 2rem 4rem;
  position: relative;
  z-index: var(--z-content);
}

.orlok-seal {
  width: 80px;
  height: 80px;
  border: 1px solid var(--blood-core);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-2xl);
  color: var(--blood-core);
  margin-bottom: 2.5rem;
  box-shadow: 0 0 30px var(--overlay-blood);
  animation: orlok-seal-pulse 4s ease-in-out infinite;
}

@keyframes orlok-seal-pulse {
  0%, 100% { box-shadow: 0 0 20px var(--border-blood-soft); }
  50%       { box-shadow: 0 0 50px var(--border-blood); }
}

.orlok-eyebrow {
  font-family: var(--font-display);
  font-size: var(--fs-micro);
  letter-spacing: 6px;
  text-transform: uppercase;
  color: var(--overlay-blood-strong);
  margin-bottom: 1.2rem;
  text-align: center;
}

.orlok-title {
  font-family: var(--font-display);
  font-size: var(--fs-3xl);
  letter-spacing: 6px;
  text-transform: uppercase;
  color: var(--parchment);
  text-align: center;
  margin-bottom: 0.5rem;
  text-shadow: 0 0 40px var(--border-blood);
}

.orlok-subtitle {
  font-family: var(--font-body);
  font-style: italic;
  font-size: var(--fs-base);
  color: var(--blood-bright);
  text-align: center;
  margin-bottom: 3rem;
  opacity: 0.8;
}

.orlok-divider {
  width: 120px;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--blood-core), transparent);
  margin: 0 auto 3rem;
}

.orlok-text {
  max-width: 640px;
  width: 100%;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  color: var(--parchment);
  line-height: 1.85;
  text-align: center;
  opacity: 0.82;
}

.orlok-text p + p { margin-top: 1.4rem; }

.orlok-back {
  margin-top: 3.5rem;
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--border-blood);
  text-decoration: none;
  border-bottom: 1px solid var(--border-blood-soft);
  padding-bottom: 2px;
  transition: color 0.3s, border-color 0.3s;
}

.orlok-back:hover {
  color: var(--blood-bright);
  border-color: var(--blood-bright);
}


/* =========================================
   GALERÍA SECRETA
   ========================================= */

.galeria-body { overflow: hidden; }
.galeria-body #site-footer { display: none; }

.galeria-bg-wrap {
  position: fixed;
  inset: 0;
  z-index: var(--z-content);
}

.galeria-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  user-select: none;
  pointer-events: none;
}

/* ── Gallery overlay ── */
.galeria-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.97);
  overflow-y: auto;
  display: none;
  padding: 5rem 3rem 4rem;
}

.galeria-overlay-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2.5rem;
  background: var(--overlay-deep);
  border-bottom: 1px solid var(--overlay-blood);
  z-index: 10;
  backdrop-filter: blur(6px);
}

.galeria-overlay-title {
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  letter-spacing: 5px;
  text-transform: uppercase;
  color: var(--parchment);
  opacity: 0.5;
}

.galeria-close-btn {
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(139, 0, 0, 0.65);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 0;
  transition: color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.galeria-close-btn:hover { color: var(--blood-bright); }

.galeria-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 1200px;
  margin: 0 auto;
}

.galeria-card {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid rgba(139, 0, 0, 0.18);
  aspect-ratio: 16/9;
  transition: border-color 0.3s, transform 0.3s;
}

.galeria-card:hover {
  border-color: var(--blood-core);
  transform: scale(1.02);
  z-index: 1;
}

.galeria-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(0.75);
  transition: filter 0.3s, transform 0.3s;
}

.galeria-card:hover img {
  filter: brightness(0.95);
  transform: scale(1.05);
}

.galeria-card-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px 14px 8px;
  background: linear-gradient(to top, var(--overlay-dark) 0%, transparent 100%);
  font-family: var(--font-display);
  font-size: var(--fs-micro);
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--parchment);
  opacity: 0;
  transition: opacity 0.3s;
}

.galeria-card:hover .galeria-card-caption { opacity: 1; }

/* ── Lightbox ── */
.galeria-lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.97);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}

.galeria-lightbox.open { display: flex; }

.galeria-lightbox img {
  max-width: 94vw;
  max-height: 90vh;
  object-fit: contain;
  pointer-events: none;
  border: 1px solid var(--border-blood-soft);
}

.galeria-lightbox-caption {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-display);
  font-size: var(--fs-micro);
  letter-spacing: 4px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.3);
  white-space: nowrap;
  pointer-events: none;
}

/* ── Mobile ── */
@media (max-width: 768px) {
  .galeria-grid { grid-template-columns: repeat(2, 1fr); }
  .galeria-overlay { padding: 5rem 1rem 3rem; }
  .galeria-card-caption { opacity: 1; }
}

@media (max-width: 480px) {
  .galeria-grid { grid-template-columns: 1fr; }
}


/* =========================================
   CRIPTEX OVERLAY (en vestibulo, inline)
   ========================================= */

.criptex-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  cursor: pointer;
  transition: opacity 0.5s ease;
}

.criptex-overlay.open     { opacity: 1; pointer-events: auto; }
.criptex-overlay.no-click { cursor: default; }

.criptex-bg {
  transform: scale(1.08);
  transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.criptex-overlay.open .criptex-bg {
  transform: scale(1);
}

/* Dormitorio — HUD oculto mientras el ataúd del Conde está abierto */
body:has(.coffin-overlay.open) .sanity-widget,
body:has(.coffin-overlay.open) .player-profile-btn,
body:has(.coffin-overlay.open) .portal-btn {
  display: none !important;
}

/* Biblioteca — HUD oculto en el plano cercano del libro */
body:has(#bib-book-closeup.open) .sanity-widget,
body:has(#bib-book-closeup.open) .player-profile-btn,
body:has(#bib-book-closeup.open) .portal-btn {
  display: none !important;
}

/* Pasaje Secreto — HUD oculto en mobile-landscape mientras el criptex está abierto */
@media (orientation: landscape) and (max-height: 500px) {
  body:has(.criptex-overlay.open) .sanity-widget,
  body:has(.criptex-overlay.open) #inv-btn,
  body:has(.criptex-overlay.open) .inv-btn,
  body:has(.criptex-overlay.open) .player-profile-btn,
  body:has(.criptex-overlay.open) .portal-btn,
  body:has(.criptex-overlay.open) #noise-hud-row,
  body:has(.criptex-overlay.open) .pain-stone-hud,
  body:has(.criptex-overlay.open) .pain-stone-hud-wrap,
  body:has(.criptex-overlay.open) .audio-toggle {
    display: none !important;
  }
}


/* =========================================
   ALA LABERINTO — mini-juego exploración
   ========================================= */

.ala-bg-img {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  transition: opacity 0.35s ease;
  user-select: none;
  pointer-events: none;
}

/* Navegación tipo teclado */
.ala-nav {
  position: fixed;
  bottom: 3rem;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(3, 54px);
  grid-template-rows: repeat(3, 54px);
  gap: 5px;
  z-index: 60;
  pointer-events: none; /* el contenedor es transparente a clicks; solo los botones los capturan */
}

.ala-nav-btn {
  pointer-events: auto; /* cada botón visible captura sus propios eventos */
  width: 54px;
  height: 54px;
  background: var(--overlay-dark);
  border: 1px solid var(--border-blood);
  border-bottom: 3px solid var(--overlay-blood-deep);
  color: var(--blood-bright);
  font-size: var(--fs-md);
  border-radius: 7px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.1s;
  box-shadow: 0 4px 14px var(--overlay-dark);
}

.ala-nav-btn:hover:not(:disabled) {
  background: var(--overlay-blood-deep-soft);
  border-color: var(--blood-bright);
  transform: translateY(-1px);
}

.ala-nav-btn:active:not(:disabled) {
  transform: translateY(1px);
  border-bottom-width: 1px;
  box-shadow: 0 1px 6px var(--overlay-dark);
}

.ala-nav-btn:disabled {
  opacity: 0;
  pointer-events: none;
}

.ala-nav-btn--up    { grid-column: 2; grid-row: 1; }
.ala-nav-btn--left  { grid-column: 1; grid-row: 2; }
.ala-nav-btn--right { grid-column: 3; grid-row: 2; }
.ala-nav-btn--down  { grid-column: 2; grid-row: 3; }

/* Botón mapa */
.ala-map-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 60;
  background: var(--overlay-dark);
  border: 1px solid var(--border-blood);
  border-bottom: 3px solid var(--overlay-blood-deep);
  border-radius: 7px;
  width: 3.5rem;
  height: 3.5rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blood-bright);
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 4px 14px var(--overlay-dark);
}

.ala-map-btn:hover {
  background: var(--overlay-blood-deep-soft);
  border-color: var(--blood-bright);
}

/* Overlay mapa */
.ala-map-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-deep);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.ala-map-overlay.open {
  opacity: 1;
  pointer-events: all;
}

/* Contenedor que agrupa papel + etiqueta */
.ala-map-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

/* El "papel" envejecido con la imagen de fondo */
.ala-map-paper {
  position: relative;
  background: url('/public/assets/images/map/map-background.webp') center / cover no-repeat;
  box-shadow:
    0 0 0 2px var(--overlay-mid),
    0 10px 40px rgba(0, 0, 0, 0.95),
    inset 0 0 50px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

/* Canvas transparente — dibuja sobre el papel */
.ala-map-title {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--blood-bright);
  text-shadow: 0 0 12px var(--blood-glow);
  margin: 0.5rem 0 0.3rem;
  text-align: center;
}

/* Todos los mapas del juego: canvas 960×540 (16:9).
   Triple min: máximo 960 px, ancho viewport menos margen,
   o derivado de la altura viewport dejando 3rem para respirar. */
.ala-map-canvas {
  display: block;
  background: transparent;
  width: min(1200px, calc(100vw - 2.5rem), calc((100svh - 3rem) * 16 / 9));
  aspect-ratio: 16 / 9;
}

/* Estatua superpuesta sobre el fondo de los nodos 38 y 83 */
.corridor-statue-img {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-height: 70vh;
  max-width: 35vw;
  z-index: 15;
  pointer-events: none;
  transition: opacity 0.3s;
  object-fit: contain;
}

/* Botón cerrar mapa — dentro del .ala-map-paper, esquina superior derecha */
.ala-map-close-btn {
  position: absolute;
  right: 0.6rem;
  top: 0.6rem;
  z-index: 10;
  background: none;
  border: none;
  padding: 0;
  width: 3rem;
  height: 3rem;
  cursor: pointer;
  transition: filter 0.18s ease, transform 0.18s ease;
}

.ala-map-close-btn img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.55));
}

.ala-map-close-btn:hover {
  filter: brightness(1.2) drop-shadow(0 0 8px var(--blood-glow));
  transform: scale(1.06);
}

.ala-map-close-btn:active {
  transform: scale(0.96);
}

/* Etiqueta de zona debajo del mapa */
.ala-map-zone-label {
  font-family: var(--font-display);
  font-size: var(--fs-micro);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(80, 20, 5, 0.65);
  text-shadow: none;
  user-select: none;
}


/* ============================================================
   SISTEMA DE INVENTARIO
   ============================================================ */

/* Botón flotante inferior izquierda */
.inv-btn {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: 60;
  background: var(--overlay-dark);
  border: 1px solid var(--border-blood);
  border-bottom: 3px solid var(--overlay-blood-deep);
  border-radius: 7px;
  width: 3.5rem;
  height: 3.5rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blood-bright);
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 4px 14px var(--overlay-dark);
}

.inv-btn:hover {
  background: var(--overlay-blood-deep-soft);
  border-color: var(--blood-bright);
  box-shadow: 0 4px 20px var(--border-blood);
}

/* Variante con imagen decorativa: el propio png trae marco, así que
   eliminamos recuadro/borde y dejamos que la imagen sea el botón. */
.inv-btn:has(img),
.ala-map-btn:has(img) {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.7));
}

.inv-btn:has(img):hover,
.ala-map-btn:has(img):hover {
  background: transparent;
  border: none;
  box-shadow: none;
  filter: drop-shadow(0 4px 14px var(--border-blood)) brightness(1.15);
}

.inv-btn > img,
.ala-map-btn > img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

/* Botón volver */
.back-btn {
  left: 1.5rem !important;
}
.back-btn > img {
  transform: rotate(-90deg);
}

/* Overlay de inventario */
.inv-overlay {
  position: fixed;
  inset: 0;
  z-index: 600;
  background: var(--overlay-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.inv-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* Panel principal — marco rúnico de piedra integrado en la imagen */
.inv-panel {
  position: relative;
  /* Mobile/tablet: fullscreen — el background ocupa toda la pantalla */
  width: 100vw;
  height: 100dvh;
  background: url('/public/assets/images/ui/ui-inventory-background.webp') center/100% 100% no-repeat;
  border: none;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  /* Padding generoso para que el contenido no choque con el marco rúnico */
  padding: clamp(40px, 8vh, 80px) clamp(28px, 10vw, 80px);
  overflow: hidden;
  transform: translateY(8px) scale(0.98);
  transition: transform 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* Grid no se estira; el detalle absorbe el espacio vertical sobrante.
   El contador de calaveras (.inv-skulls) es absolute, fuera del flow. */
.inv-grid   { flex: 0 0 auto; }
.inv-detail { flex: 1; min-height: 0; }

.inv-overlay.open .inv-panel {
  transform: translateY(0) scale(1);
}

.inv-close {
  position: absolute;
  right: clamp(14px, 3%, 32px);
  top: clamp(14px, 3%, 32px);
  z-index: 2;
  background: none;
  border: none;
  padding: 0;
  width: clamp(56px, 9vw, 80px);
  height: clamp(56px, 9vw, 80px);
  cursor: pointer;
  transition: filter 0.18s ease, transform 0.18s ease;
}

.inv-close img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.55));
}

.inv-close:hover {
  filter: brightness(1.2) drop-shadow(0 0 8px var(--blood-glow));
  transform: scale(1.06);
}

.inv-close:active {
  transform: scale(0.96);
}

/* ═══════════════════════════════════════════════════════════════
   CLOUD SAVE PANEL
   ═══════════════════════════════════════════════════════════════ */
.cloud-panel {
  position: relative;
  width: min(680px, 88vw);
  min-height: min(clamp(340px, 62vw, 500px), 88vh);
  max-height: 88vh;
  background: url('/public/assets/images/ui/ui-inventory-background.webp') center/100% 100% no-repeat;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(3rem, 9vw, 5rem) clamp(2rem, 8vw, 4rem) clamp(2.5rem, 8vw, 4rem);
  transform: translateY(8px) scale(0.98);
  transition: transform 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
  overflow: hidden;
}

.inv-overlay.open .cloud-panel {
  transform: translateY(0) scale(1);
}

.cloud-close {
  position: absolute;
  right: clamp(14px, 3%, 32px);
  top: clamp(14px, 3%, 32px);
  z-index: 2;
  background: none;
  border: none;
  padding: 0;
  width: clamp(48px, 8vw, 68px);
  height: clamp(48px, 8vw, 68px);
  cursor: pointer;
  transition: filter 0.18s ease, transform 0.18s ease;
}

.cloud-close img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.55));
}

.cloud-close:hover {
  filter: brightness(1.2) drop-shadow(0 0 8px var(--blood-glow));
  transform: scale(1.06);
}

.cloud-close:active {
  transform: scale(0.96);
}

.cloud-panel__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
  width: 100%;
  text-align: center;
  overflow-y: auto;
  max-height: 100%;
}

.cloud-panel__title {
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--blood-bright);
  font-weight: 700;
}

.cloud-panel__text {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: #e0c8a0;
  opacity: 0.85;
  margin: 0;
}

.cloud-panel__text--lead {
  font-size: clamp(0.9rem, 2.2vw, 1rem);
  opacity: 1;
}

.cloud-uuid-section { width: 100%; }

.cloud-uuid-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.cloud-uuid-code {
  font-family: monospace;
  font-size: 0.78rem;
  color: var(--blood-bright);
  background: rgba(139, 0, 0, 0.12);
  border: 1px solid rgba(139, 0, 0, 0.35);
  padding: 0.35rem 0.8rem;
  border-radius: 4px;
  letter-spacing: 0.04em;
  word-break: break-all;
}

.cloud-load-row {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  width: 100%;
}

.cloud-input {
  font-family: var(--font-body);
  font-size: 0.85rem;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(139, 0, 0, 0.4);
  color: #e0c8a0;
  padding: 0.5rem 0.8rem;
  border-radius: 4px;
  width: min(240px, 65vw);
  outline: none;
}

.cloud-btn {
  font-family: var(--font-display);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 6px;
  cursor: pointer;
  padding: 0.5rem 1.1rem;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.cloud-btn--primary {
  background: rgba(139, 0, 0, 0.8);
  border: 1px solid #cc0000;
  color: #fff;
}

.cloud-btn--primary:hover { background: rgba(180, 0, 0, 0.9); }

.cloud-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(139, 0, 0, 0.4);
  border-radius: 5px;
  padding: 0;
  width: 28px;
  height: 28px;
  cursor: pointer;
  color: rgba(139, 0, 0, 1);
  transition: color 0.18s, border-color 0.18s, transform 0.15s;
  flex-shrink: 0;
}

.cloud-copy-btn:hover {
  color: var(--blood-bright);
  border-color: var(--blood-bright);
  transform: scale(1.12);
}

.cloud-copy-btn:active { transform: scale(0.92); }

.cloud-copy-btn--ok {
  color: #7ecf7e;
  border-color: rgba(126, 207, 126, 0.45);
}

.cloud-copy-icon { display: block; pointer-events: none; }

.cloud-status {
  font-family: var(--font-body);
  font-size: 0.85rem;
  min-height: 1.3em;
  color: #e0c8a0;
  margin: 0;
}

/* Divisor */
.inv-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-blood) 30%, rgba(200, 0, 0, 0.6) 50%, var(--border-blood) 70%, transparent);
  margin: 0 1.2rem;
}

/* Grid de objetos */
.inv-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.6rem;
  padding: 1.2rem;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  min-height: 5rem;
  /* Ocultar scrollbar visualmente pero mantener funcionalidad */
  scrollbar-width: thin;
  scrollbar-color: var(--border-blood) transparent;
}

.inv-grid::-webkit-scrollbar {
  height: 4px;
}

.inv-grid::-webkit-scrollbar-track {
  background: transparent;
}

.inv-grid::-webkit-scrollbar-thumb {
  background: var(--border-blood);
  border-radius: 2px;
}

.inv-slot {
  position: relative;
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  background: rgba(6, 0, 0, 0.95);
  border: 1px solid rgba(100, 0, 0, 0.45);
  border-bottom: 2px solid var(--overlay-blood-deep);
  border-radius: 5px;
  cursor: pointer;
  padding: 0;
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.inv-slot:hover {
  border-color: rgba(180, 0, 0, 0.7);
  box-shadow: 0 0 12px var(--overlay-blood);
}

.inv-slot--active {
  border-color: var(--blood-bright) !important;
  box-shadow: 0 0 18px var(--border-blood), inset 0 0 10px var(--overlay-blood-soft);
}

.inv-slot--equipped::after {
  content: 'E';
  position: absolute;
  bottom: 4px;
  right: 5px;
  font-family: var(--font-display, 'Cinzel', serif);
  font-size: var(--fs-micro);
  font-weight: 700;
  color: var(--blood-glow, var(--blood-glow));
  text-shadow: 0 0 6px var(--blood-bright, var(--blood-bright));
  line-height: 1;
}


/* Badge de cantidad para ítems consumibles apilables */
.inv-slot-qty {
  position: absolute;
  bottom: 4px;
  right: 5px;
  font-family: var(--font-display, 'Cinzel', serif);
  font-size: var(--fs-micro);
  font-weight: 700;
  color: var(--gold-bright);
  text-shadow: 0 0 6px rgba(232, 201, 107, 0.7), 0 1px 2px var(--overlay-deep);
  line-height: 1;
  pointer-events: none;
}

.inv-slot-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
  filter: drop-shadow(0 2px 4px var(--overlay-deep));
  transition: transform 0.2s;
}

.inv-slot:hover .inv-slot-img,
.inv-slot--active .inv-slot-img {
  transform: scale(1.08);
}

.inv-slot-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 120%, var(--overlay-blood-soft) 0%, transparent 70%);
  pointer-events: none;
}

/* Panel de detalle */
.inv-detail {
  min-height: 120px;
  padding: 1rem 1.2rem 1.2rem;
  display: flex;
  align-items: center;
}

.inv-detail-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  color: rgba(180, 120, 80, 0.25);
  font-family: var(--font-body);
  font-style: italic;
  font-size: var(--fs-sm);
  text-align: center;
}

.inv-detail-placeholder-icon {
  font-size: var(--fs-xl);
  opacity: 0.3;
}

.inv-detail-content {
  display: flex;
  gap: 1.2rem;
  align-items: flex-start;
  width: 100%;
}

.inv-detail-img-wrap {
  flex-shrink: 0;
  width: clamp(110px, 18vw, 190px);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.45rem;
}

.inv-detail-img-inner {
  position: relative;
  width: clamp(110px, 18vw, 190px);
  height: clamp(110px, 18vw, 190px);    
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
}

.inv-action-btn {
  margin-top: 0 !important;
  width: 100%;
  font-size: var(--fs-xs) !important;
  padding: 0.38rem 0.3rem !important;
  letter-spacing: 0.06em !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inv-detail-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 10px;
  filter: drop-shadow(0 2px 8px var(--overlay-deep));
}

/* Efecto scanline en la imagen de detalle */
@keyframes inv-scan {
  from { transform: translateY(-100%); }
  to   { transform: translateY(100%); }
}

.inv-detail-img-scan {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(204, 0, 0, 0.06) 50%, transparent 60%);
  animation: inv-scan 3s linear infinite;
  pointer-events: none;
}

.inv-detail-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.inv-detail-rarity-label {
  font-family: var(--font-display);
  font-size: var(--fs-micro);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 0;
  font-weight: 700;
}

.inv-detail-rarity-label--common    { color: rgba(160, 160, 160, 1); }
.inv-detail-rarity-label--uncommon  { color: #2ecc2e; }
.inv-detail-rarity-label--rare      { color: #3a6aff; }
.inv-detail-rarity-label--epic      { color: var(--accent-purple); }

.inv-detail-name {
  font-family: var(--font-display);
  font-size: var(--fs-base);
  letter-spacing: 0.08em;
  color: var(--parchment-dim);
  margin: 0;
}

.inv-detail-desc {
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  color: rgba(200, 170, 130, 0.7);
  line-height: 1.6;
  margin: 0;
}

.inv-weapon-stats {
  display: flex;
  align-items: stretch;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-blood-soft);
  border-radius: 4px;
  margin: 0.5rem 0 0;
  overflow: hidden;
}

.inv-ws-sep {
  width: 1px;
  background: var(--border-blood-soft);
  flex-shrink: 0;
}

.inv-ws-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.18rem;
  padding: 0.32rem 0.65rem;
  flex-shrink: 0;
}

.inv-ws-item--dur {
  flex: 1;
  align-items: flex-start;
  min-width: 0;
}

.inv-ws-label {
  font-size: var(--fs-micro);
  color: rgba(160, 160, 160, 1);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  font-family: var(--font-display);
  white-space: nowrap;
}

.inv-ws-val {
  font-size: var(--fs-sm);
  color: var(--bone);
  font-family: var(--font-display);
  white-space: nowrap;
}

.inv-ws-val--type  { font-size: var(--fs-xs); }
.inv-ws-val--atk   { color: var(--status-attack); font-weight: 600; }
.inv-ws-val--curse { color: var(--blood-bright); }
.inv-ws-val--empty { color: var(--stone-light); }

.inv-ws-dur-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
}

.inv-ws-dur-bar {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.07);
  border-radius: 2px;
  overflow: hidden;
  min-width: 30px;
}

.inv-ws-dur-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s ease;
}

.inv-ws-dur-fill--good { background: var(--status-success); }
.inv-ws-dur-fill--warn { background: var(--status-warning); }
.inv-ws-dur-fill--crit { background: var(--blood-bright); }

/* legacy — mantenidas por compatibilidad, ya no se generan */
.inv-weapon-info {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-top: 0.4rem;
}

.inv-weapon-type {
  font-size: var(--fs-xs);
  color: var(--bone);
  letter-spacing: 0.06em;
}

.inv-weapon-atk {
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  color: var(--status-attack);
  letter-spacing: 0.08em;
}

.inv-weapon-ammo {
  font-size: var(--fs-sm);
  color: rgba(200, 170, 130, 0.65);
  margin: 0.25rem 0 0;
}

.inv-weapon-dur {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.35rem 0 0;
}

.inv-weapon-dur-label {
  font-size: var(--fs-xs);
  color: var(--ash);
  white-space: nowrap;
  flex-shrink: 0;
}

.inv-weapon-dur-bar {
  flex: 1;
  height: 5px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
}

.inv-weapon-dur-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.inv-weapon-dur-fill--good { background: var(--status-success); }
.inv-weapon-dur-fill--warn { background: var(--status-warning); }
.inv-weapon-dur-fill--crit { background: var(--blood-bright); }

.inv-weapon-dur-count {
  font-size: var(--fs-xs);
  color: var(--ash);
  white-space: nowrap;
  flex-shrink: 0;
}

.inv-weapon-sanity-cost {
  font-size: var(--fs-xs);
  color: var(--blood-bright);
  margin: 0.3rem 0 0;
  opacity: 0.85;
}

.inv-equip-btn {
  margin-top: 0.6rem;
  background: rgba(30, 0, 0, 0.8);
  border: 1px solid var(--overlay-blood-strong);
  color: var(--parchment);
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.4rem 1rem;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}

.inv-equip-btn:hover {
  background: var(--overlay-blood);
  border-color: var(--blood-bright);
}

.inv-equip-btn--equipped {
  border-color: var(--overlay-blood-strong);
  color: rgba(200, 80, 60, 0.8);
  cursor: pointer;
  background: rgba(60, 0, 0, 0.4);
}

.inv-equip-btn--equipped:hover {
  background: var(--overlay-blood-deep-soft);
  border-color: var(--blood-core);
  color: var(--status-attack);
}

.inv-use-qty {
  font-size: 0.75em;
  opacity: 0.65;
  font-weight: 400;
}

/* ── Contador de calaveras — medallón en esquina inferior derecha ── */
.inv-skulls {
  position: absolute;
  bottom: clamp(14px, 3%, 32px);
  right: clamp(14px, 3%, 32px);
  z-index: 2;
  width: clamp(72px, 11vw, 120px);
  aspect-ratio: 1 / 1;
  background: url('/public/assets/images/ui/ui-skulls.webp') center/contain no-repeat;
  pointer-events: none;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.6));
}

.inv-skull-count {
  position: absolute;
  /* Centrado dentro de la "boca" abierta de la calavera (~64% del alto) */
  left: 51%;
  top: 62%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display, 'Cinzel', serif);
  font-weight: 700;
  font-size: clamp(0.95rem, 2.4vw, 1.6rem);
  color: rgba(255, 230, 195, 0.95);
  text-shadow: 0 0 6px var(--blood-glow), 0 1px 2px rgba(0, 0, 0, 0.95);
  letter-spacing: 0.04em;
  white-space: nowrap;
  pointer-events: none;
}

.inv-skulls[data-big] .inv-skull-count {
  font-size: clamp(0.6rem, 1.5vw, 1rem);
  letter-spacing: 0;
}

/* Contador de crucifijos (cartas) — píldoras estilo banner de cartas
   (.cards-cur), ancladas a la IZQUIERDA del medallón de calaveras en la esquina
   inferior derecha. El contenedor comparte bottom y height con .inv-skulls y
   usa align-items:center, así las píldoras quedan centradas con el medallón en
   cualquier breakpoint sin hacer cálculos de altura. */
.inv-crucis {
  position: absolute;
  bottom: clamp(11px, 3%, 32px);
  /* Justo a la izquierda del medallón: su offset + su ancho + un hueco. */
  right: calc(clamp(14px, 3%, 32px) + clamp(72px, 11vw, 120px) + clamp(6px, 1.2vw, 16px));
  height: clamp(72px, 11vw, 120px);
  z-index: 2;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: clamp(5px, 1vw, 12px);
  /* El medallón centra su cifra más abajo (en la boca). Bajamos las píldoras una
     fracción de la ALTURA del medallón (no de la ventana), para que la alineación
     sea idéntica en desktop y en móvil-landscape, donde el medallón escala con vw. */
  transform: translateY(calc(clamp(72px, 11vw, 120px) * 0.20));
  pointer-events: none;
}
.inv-cruci {
  display: inline-flex;
  align-items: center;
  gap: clamp(3px, 0.6vw, 7px);
  padding: clamp(3px, 0.7vh, 7px) clamp(7px, 1.1vw, 14px);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.6));
}
.inv-cruci img {
  width: clamp(20px, 3vw, 30px);
  height: clamp(20px, 3vw, 30px);
  object-fit: contain;
  display: block;
}
.inv-cruci-count {
  font-family: var(--font-display, 'Cinzel', serif);
  font-weight: 700;
  font-size: clamp(0.85rem, 1.9vw, 1.3rem);
  line-height: 1;
  letter-spacing: 0.02em;
  color: #f5e7c6;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95);
}
.inv-cruci--gold   { border-color: rgba(230, 184, 64, 0.55); }
.inv-cruci--silver { border-color: rgba(200, 200, 200, 0.40); }
.inv-cruci--gold   .inv-cruci-count { color: #f0d27a; }
.inv-cruci--silver .inv-cruci-count { color: #dde2e8; }

/* ── Desktop: layout de dos columnas ── */
@media (min-width: 960px) {
  .inv-panel {
    width: min(92vw, 960px);
    height: auto;
    min-height: clamp(380px, 80dvh, 620px);
    max-height: 88dvh;
    display: grid;
    grid-template-columns: 1fr 320px;
    grid-template-rows: 1fr;
    padding: clamp(40px, 9vh, 80px) clamp(28px, 8vw, 90px);
  }

  /* Grid: columna izquierda */
  .inv-grid {
    grid-column: 1;
    grid-row: 1;
    flex-wrap: wrap;
    overflow-x: hidden;
    overflow-y: auto;
    align-content: flex-start;
    align-items: flex-start;
  }

  /* Divisor entre grid y detalle: desaparece (sustituido por border-left del detalle) */
  .inv-grid + .inv-divider { display: none; }

  /* Detalle: columna derecha */
  .inv-detail {
    grid-column: 2;
    grid-row: 1;
    border-left: 1px solid var(--blood-shadow);
    align-items: flex-start;
    min-height: unset;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 1.2rem 1.4rem;
  }

  /* Slots más grandes en desktop */
  .inv-slot { width: 96px; height: 96px; }

  /* En columna estrecha, apilar imagen e info verticalmente */
  .inv-detail-content {
    flex-direction: column;
    align-items: center;
    gap: 0.9rem;
  }
  /* Tamaño de imagen: lo gestiona el clamp base; sin override aquí */

  .inv-detail-info { width: 100%; text-align: left; }
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .inv-slot { width: 62px; height: 62px; }
  .inv-detail-content { flex-direction: column; align-items: center; }
  .inv-detail-img-wrap { width: 80px; }
  .inv-detail-img-inner { width: 80px; height: 80px; }
  .inv-detail-info { text-align: center; }
}

@media (orientation: landscape) and (max-height: 500px) {
  .inv-panel { max-height: 95dvh; }
  .inv-detail { min-height: 90px; padding: 0rem 1.2rem 1.2rem;}
  .inv-detail-img-wrap { width: 80px; }
  .inv-detail-img-inner { width: 80px; height: 80px; }
}

/* ── Botón Inspeccionar ── */
.inv-inspect-btn {
  margin-top: 0.55rem;
}

/* ============================================================
   LECTOR DE DOCUMENTOS — Overlay de inspección
   ============================================================ */

.inv-doc-reader {
  position: fixed;
  inset: 0;
  z-index: 700;
  background: var(--overlay-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.inv-doc-reader.open {
  opacity: 1;
  pointer-events: auto;
}

/* Paper */
.inv-doc-reader__paper {
  position: relative;
  width: min(92vw, 560px);
  max-height: 82dvh;
  background:
    url('../../public/assets/images/documents/document-background.webp') center/cover no-repeat;
  border-radius: 3px;
  box-shadow:
    0 8px 40px var(--overlay-deep),
    0 0 0 1px rgba(180, 140, 90, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.97) translateY(6px);
  transition: transform 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.inv-doc-reader.open .inv-doc-reader__paper {
  transform: scale(1) translateY(0);
}

/* Tint overlay so text stays legible over the paper texture */
.inv-doc-reader__paper::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--overlay-parchment-strong);
  pointer-events: none;
  z-index: 0;
}

/* Close button */
.inv-doc-reader__close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 2;
  background: none;
  border: none;
  padding: 0;
  width: clamp(32px, 5%, 52px);
  height: clamp(32px, 5%, 52px);
  cursor: pointer;
  transition: filter 0.18s ease, transform 0.18s ease;
}

.inv-doc-reader__close img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.55));
}

.inv-doc-reader__close:hover {
  filter: brightness(1.2) drop-shadow(0 0 8px var(--blood-glow));
  transform: scale(1.06);
}

.inv-doc-reader__close:active {
  transform: scale(0.96);
}

/* Scrollable content area */
.inv-doc-reader__scroll {
  position: relative;
  z-index: 1;
  overflow-y: auto;
  padding: 2rem 2.2rem 1.8rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 60, 20, 0.35) transparent;
}
.inv-doc-reader__scroll::-webkit-scrollbar { width: 5px; }
.inv-doc-reader__scroll::-webkit-scrollbar-track { background: transparent; }
.inv-doc-reader__scroll::-webkit-scrollbar-thumb { background: rgba(100, 60, 20, 0.35); border-radius: 3px; }

/* Document title */
.inv-doc-reader__title {
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(40, 15, 5, 0.85);
  text-align: center;
  margin: 0 0 0.7rem;
  line-height: 1.5;
  white-space: pre-line;
}

.inv-doc-reader__divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(80, 40, 10, 0.45) 30%, rgba(80, 40, 10, 0.6) 50%, rgba(80, 40, 10, 0.45) 70%, transparent);
  margin: 0 1rem 1.2rem;
}

/* Section headings inside the document */
.inv-doc-reader__heading {
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(40, 15, 5, 0.7);
  margin: 1.1rem 0 0.4rem;
}

/* Centered variant (e.g. Radu letter) */
.inv-doc-reader__body--centered .inv-doc-reader__para,
.inv-doc-reader__body--centered .inv-doc-reader__heading {
  text-align: center;
}

/* Body paragraphs */
.inv-doc-reader__para {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.75;
  color: rgba(25, 10, 3, 0.82);
  margin: 0 0 0.4rem;
}

/* Rotate prompt — hidden by default, visible only on mobile landscape */
.inv-doc-reader__rotate {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  color: rgba(200, 170, 130, 0.85);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  text-align: center;
  padding: 2rem;
}

.inv-doc-reader__rotate-icon {
  font-size: var(--fs-3xl);
  animation: doc-rotate-hint 1.8s ease-in-out infinite;
}

@keyframes doc-rotate-hint {
  0%, 100% { transform: rotate(0deg); }
  40%       { transform: rotate(90deg); }
  60%       { transform: rotate(90deg); }
}

/* Desktop: documento más grande y cómodo de leer */
@media (min-width: 960px) {
  .inv-doc-reader__paper {
    width: min(88vw, 780px);
    max-height: 86dvh;
  }

  .inv-doc-reader__scroll { padding: 2.4rem 2.8rem 2.2rem; }

  .inv-doc-reader__title { font-size: var(--fs-base); }
  .inv-doc-reader__para  { font-size: var(--fs-base); line-height: 1.85; }
}

/* On mobile landscape: show paper adapted to horizontal space */
@media (max-width: 900px) and (orientation: landscape) {
  .inv-doc-reader__paper {
    width: min(70vw, 560px);
    max-height: 92dvh;
  }
  .inv-doc-reader__scroll {
    padding: 1.2rem 1.4rem 1rem;
  }
  .inv-doc-reader__title { font-size: var(--fs-xs); }
  .inv-doc-reader__para  { font-size: var(--fs-sm); line-height: 1.7; }
}

/* Sello de lacre al final del documento */
.inv-doc-reader__seal {
  display: block;
  width: clamp(60px, 12vw, 96px);
  height: auto;
  margin: 1.2rem auto 0.4rem;
  opacity: 0.88;
  filter: drop-shadow(0 2px 8px rgba(80, 10, 10, 0.55));
}

/* On mobile portrait: allow the paper to go taller */
@media (max-width: 768px) and (orientation: portrait) {
  .inv-doc-reader__paper {
    width: 96vw;
    max-height: 88dvh;
  }
  .inv-doc-reader__scroll {
    padding: 1.6rem 1.4rem 1.4rem;
  }
  .inv-doc-reader__title {
    font-size: var(--fs-xs);
  }
  .inv-doc-reader__para {
    font-size: var(--fs-sm);
  }
}

/* ============================================================
   TERMINAL DE ACCESO — Asylum
   ============================================================ */
.terminal-overlay {
  position: fixed;
  inset: 0;
  background: var(--void) url(/public/assets/images/places/asylum/asylum-terminal-closeup.webp) center/cover no-repeat;
  z-index: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s;
}
.terminal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.terminal-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}
.terminal-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.55) 100%);
  pointer-events: none;
  z-index: 1;
}
/* ── CRT retro effects ───────────────────────────────────── */
@keyframes crt-scan {
  from { transform: translateY(-100%); }
  to   { transform: translateY(110%); }
}
@keyframes crt-flicker {
  0%, 91%, 93%, 95%, 100% { filter: brightness(1); }
  92% { filter: brightness(0.88); }
  94% { filter: brightness(0.95); }
}

/* Scanlines — solo dentro de la pantalla del terminal */
.terminal-content::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.18) 2px,
    rgba(0, 0, 0, 0.18) 4px
  );
  pointer-events: none;
  z-index: 20;
}
/* Rolling scan band */
.terminal-content::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 120px;
  background: linear-gradient(
    transparent,
    rgba(51, 255, 51, 0.07) 50%,
    transparent
  );
  animation: crt-scan 10s linear infinite;
  pointer-events: none;
  z-index: 20;
}
/* Flicker — solo sobre el área de texto */
.terminal-overlay.open .terminal-screen {
  animation: crt-flicker 8s step-end infinite;
}

/* Inner CRT screen glow */
.terminal-screen {
  box-shadow: inset 0 0 40px rgba(0, 15, 0, 0.6),
              inset 0 0 2px rgba(51, 255, 51, 0.08);
}

/* Phosphor glow reforzado en el texto */
.terminal-output {
  text-shadow: 0 0 6px rgba(51, 255, 51, 0.55),
               0 0 14px rgba(51, 255, 51, 0.2);
}

.terminal-content {
  position: absolute;
  z-index: 2;
  display: flex;
  flex-direction: column;
  top: 9%;
  bottom: 18%;
  left: 7%;
  right: 7%;
}
.terminal-screen {
  flex: 1;
  overflow-y: hidden;
  padding: 1.5rem 2rem 0.5rem;
  display: flex;
  justify-content: center;
}
.terminal-output {
  color: var(--cctv-green);
  font-family: 'Courier New', Courier, monospace;
  font-size: var(--fs-sm);
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  width: 100%;
  max-width: 860px;
  text-align: center;
  overflow-y: auto;
  scrollbar-color: var(--cctv-green-dim) transparent;
  scrollbar-width: thin;
}
.terminal-output::-webkit-scrollbar {
  width: 5px;
}
.terminal-output::-webkit-scrollbar-track {
  background: transparent;
}
.terminal-output::-webkit-scrollbar-thumb {
  background: var(--cctv-green-dim);
  border-radius: 3px;
}
.terminal-output::-webkit-scrollbar-thumb:hover {
  background: var(--cctv-green);
}
.t-dim    { color: var(--cctv-green-dim); }
.t-bright { color: #88ff88; }
.t-yellow { color: var(--gold-bright); }
.t-red    { color: var(--blood-pale); }
.t-cyan   { color: var(--accent-cyan); }
.t-center { display: block; text-align: center; }
.terminal-input-row {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 2rem;
  border-top: 1px solid #0d3a0d;
  background: #030a03;
}
.terminal-input-inner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  max-width: 860px;
}
.terminal-prompt {
  color: var(--cctv-green);
  font-family: 'Courier New', Courier, monospace;
  font-size: var(--fs-sm);
  white-space: nowrap;
  user-select: none;
}
.terminal-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--cctv-green);
  font-family: 'Courier New', Courier, monospace;
  font-size: var(--fs-sm);
  caret-color: var(--cctv-green);
}
.terminal-enter-btn {
  flex-shrink: 0;
  background: rgba(0, 60, 0, 0.5);
  border: 1px solid rgba(51, 255, 51, 0.35);
  border-radius: 4px;
  color: var(--cctv-green);
  width: 2.2rem;
  height: 2.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.terminal-enter-btn:hover,
.terminal-enter-btn:active {
  background: rgba(51, 255, 51, 0.18);
  border-color: var(--cctv-green);
}
.terminal-close {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 510;
  flex-shrink: 0;
  background: rgba(0, 60, 0, 0.5);
  border: 1px solid rgba(51, 255, 51, 0.35);
  border-radius: 4px;
  color: var(--cctv-green);
  width: 2.2rem;
  height: 2.2rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.terminal-close:hover,
.terminal-close:active {
  background: rgba(51, 255, 51, 0.18);
  border-color: var(--cctv-green);
}
.terminal-banner-ascii {
  /* ASCII art — tamaño fijo pequeño para preservar la rejilla monospace.
     No usa --fs-* porque el tamaño depende del ancho de glifo, no de legibilidad. */
  color: #00cc00;
  font-family: 'Courier New', Courier, monospace;
  font-size: 10px;
  line-height: 1.1;
  text-align: center;
  padding: 0.8rem 0 0.3rem;
  white-space: pre;
  display: block;
}
@media (max-width: 900px) {
  .terminal-banner-ascii { font-size: 9px; }
}
@media (max-width: 600px) {
  .terminal-banner-ascii { font-size: 0.28rem; }
  .terminal-screen { padding: 1rem 1rem 0.5rem; }
  .terminal-input-row { padding: 0.6rem 1rem; }
  .terminal-output { font-size: var(--fs-sm); }
}
/* ── Desktop: botones de juego y flechas más grandes ── */
@media (min-width: 1024px) {
  /* Botones flotantes de inventario y mapa */
  .inv-btn,
  .ala-map-btn {
    width: 6rem;
    height: 6rem;
  }

  /* Flechas de sala (salas-arrow) */
  .salas-arrow {
    width: 96px;
    height: 96px;
  }
  .salas-arrow--prev::before,
  .salas-arrow--next::before,
  .salas-arrow--down::before {
    font-size: var(--fs-lg);
  }

  /* Flechas de nodo (ala-nav-btn) + contenedor grid */
  .ala-nav {
    grid-template-columns: repeat(3, 96px);
    grid-template-rows: repeat(3, 96px);
  }
  .ala-nav-btn {
    width: 96px;
    height: 96px;
  }

  /* Flecha de regreso del plano cercano (biblioteca) */
  #bib-book-closeup .bib-closeup-back {
    width: 96px;
    height: 96px;
  }
}

/* ── Resoluciones grandes ── */
@media (min-width: 1440px) {
  .terminal-content { top: 8%; bottom: 17%; left: 14%; right: 14%; }
}
@media (min-width: 1920px) {
  .terminal-content { top: 7%; bottom: 16%; left: 22%; right: 22%; }
}
@media (min-width: 2560px) {
  .terminal-content { top: 4%; bottom: 11%; left: 22%; right: 22%; }
}
@media (max-height: 480px) and (orientation: landscape) {
  .terminal-content {
    top: 10%;
    bottom: 15%;
    left: 23%;
    right: 23%;
  }
  .terminal-screen {
    padding: 0.4rem 0.75rem 0.25rem;
  }
  .terminal-output {
    font-size: var(--fs-xs);
    line-height: 1.5;
  }
  .terminal-input-row { padding: 0.35rem 0.75rem; }
  .terminal-prompt,
  .terminal-input { font-size: var(--fs-xs); }
}
/* Evitar zoom automático en iOS al pulsar el input (requiere ≥16px).
   Debe ir DESPUÉS del rule de landscape para ganar en la cascada. */
@media (hover: none) {
  .terminal-input { font-size: var(--fs-base); }

  /* Indicar visualmente que la fila es tappable */
  .terminal-input-row {
    cursor: pointer;
    border-top-color: rgba(51, 255, 51, 0.25);
  }
  .terminal-input-row:active {
    background: rgba(0, 30, 0, 0.8);
  }
}


/* =========================================
   ENTRANCE INPUT (home door mechanic)
   ========================================= */

.entrance-input-wrap {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
}

.entrance-input {
  width: 100%;  
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid var(--border-blood);
  color: var(--parchment, var(--parchment));
  font-family: var(--font-body);
  font-size: var(--fs-base);
  padding: 0.6rem 1rem;
  border-radius: 4px;
  text-align: center;
  outline: none;
  letter-spacing: 0.06em;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.entrance-input:focus {
  border-color: var(--blood-bright, var(--blood-bright));
  box-shadow: 0 0 12px var(--border-blood-soft);
}

.entrance-input::placeholder {
  color: rgba(200, 180, 150, 0.35);
  font-style: italic;
}

.entrance-textarea {
  min-height: 80px;
  resize: none;
  text-align: left;
}

.entrance-submit-btn {
  min-width: 120px;
}



/* ── Hero approach hotspot (phase-0) ── */
.hero-approach-hitbox {
  position: absolute;
  top: 65%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 22%;
  height: 26%;
  border: 0;
  background: transparent;
  cursor: pointer;
  z-index: 15;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.hero-approach-hitbox:focus-visible {
  outline: 2px solid var(--overlay-blood-strong);
}

@media (max-width: 768px),
(orientation: landscape) and (max-height: 500px) {
  .hero-approach-hitbox {
    width: 55%;
    height: 55%;
    top: 60%;
    left: 50%;
    transform: translate(-50%, -50%);
  }
}

/* ── Hero phase 0 — vista lejana: mostrar logo y título ── */
body[data-hero-phase="0"] .hero-crest,
body[data-hero-phase="0"] .hero-title {
  display: block !important;
}

body[data-hero-phase="0"] .hero-door-hitbox {
  display: none;
}

/* ── Hero phase 1 — close-up: solo vídeo y puerta ── */
body[data-hero-phase="1"] #site-header,
body[data-hero-phase="1"] .hero-content,
body[data-hero-phase="1"] .hero-dev-credit,
body[data-hero-phase="1"] .hero-approach-hitbox,
body[data-hero-phase="1"] #cloud-save-btn,
body[data-hero-phase="1"] #home-volume-btn,
body[data-hero-phase="1"] #reset-progress-btn {
  display: none;
}

/* ── Crossfade de vídeo al cambiar de fase ── */
.hero-video-wrap {
  transition: opacity 0.65s ease;
}

.hero-video-wrap.hero-video-fading {
  opacity: 0;
}

/* ── Flecha retroceso (fase 1 → fase 0) ── */
.hero-back-arrow {
  display: none;
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  border: none;
  background: transparent;
  cursor: pointer;
  color: rgba(224, 200, 160, 0.75);
  padding: 0.6rem;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  transition: color 0.2s;
}

body[data-hero-phase="1"] .hero-back-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: hero-arrow-drift 2.2s ease-in-out infinite;
}

.hero-back-arrow:hover {
  color: var(--blood-bright, #cc0000);
}

.hero-back-arrow svg {
  width: 2.8rem;
  height: 2.8rem;
  filter: drop-shadow(0 0 6px rgba(139, 0, 0, 0.5));
}

@keyframes hero-arrow-drift {
  0%, 100% { transform: translateX(-50%) translateY(0);   opacity: 0.7; }
  50%       { transform: translateX(-50%) translateY(8px); opacity: 1;   }
}

/* ── Crédito desarrollador (hero) ────────────────────────── */
.hero-dev-credit {
  position: absolute;
  bottom: 1rem;
  left: 0;
  width: 100%;
  text-align: center;
  font-family: var(--font-display, 'Cinzel', serif);
  font-size: var(--fs-micro);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 1);
  text-shadow:
    0 1px 4px rgba(0,0,0,0.9),
    0 0 12px rgba(0,0,0,0.7);
  pointer-events: none;
  z-index: 12;
}

/* ═══════════════════════════════════════════════════════════════
   PIEDRA DEL DOLOR — HUD fijo
   ═══════════════════════════════════════════════════════════════ */
.pain-stone-hud {
  position: fixed;
  /* Justo debajo de la barra de cordura (.sanity-widget en top:1.5rem, alto ≈ ancho*256/1160).
     Ancho cordura = clamp(270px, 32vw, 415px) → alto ≈ clamp(60px, 7.06vw, 92px) */
  top: calc(1.5rem + clamp(60px, 7.06vw, 92px) + .4rem);
  left: 1.5rem;
  right: auto;
  z-index: 180;
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .45rem .7rem .45rem .5rem;
  background: linear-gradient(135deg, rgba(30,0,0,.85), rgba(10,0,0,.9));
  border: 1px solid rgba(204, 0, 0, 0.55);
  border-radius: 10px;
  box-shadow: 0 0 18px var(--border-blood-soft), inset 0 0 10px rgba(204, 0, 0, 0.15);
  color: var(--blood-pale);
  font-family: 'Cinzel', serif;
  font-size: var(--fs-sm);
  letter-spacing: .05em;
  pointer-events: none;
  animation: painStonePulse 1.8s ease-in-out infinite;
}
.pain-stone-hud__icon {
  width: 30px;
  height: 30px;
  filter: drop-shadow(0 0 6px rgba(255, 40, 40, 0.75));
}
.pain-stone-hud__time {
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 6px rgba(255, 40, 40, 0.65);
  min-width: 3.2ch;
  text-align: center;
}
@keyframes painStonePulse {
  0%, 100% { box-shadow: 0 0 18px var(--border-blood-soft), inset 0 0 10px rgba(204, 0, 0, 0.15); }
  50%      { box-shadow: 0 0 28px rgba(255, 20, 20, 0.65), inset 0 0 14px rgba(255, 20, 20, 0.25); }
}
@media (max-width: 640px) {
  .pain-stone-hud { top: calc(.75rem + clamp(60px, 7.06vw, 92px) + .3rem); left: .75rem; right: auto; font-size: var(--fs-xs); padding: .35rem .55rem; }
  .pain-stone-hud__icon { width: 24px; height: 24px; }
}

/* ═══════════════════════════════════════════════════════════════
   TIENDA TROGLYNN — Shop overlay (modo escena en mazmorra-underground)
   ═══════════════════════════════════════════════════════════════ */
.troglyn-shop {
  position: fixed;
  inset: 0;
  z-index: 190;
  display: flex;
  pointer-events: none;
  opacity: 0;
  transition: opacity .35s ease;
}
.troglyn-shop.open {
  pointer-events: auto;
  opacity: 1;
}
.troglyn-shop__bg {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}
.troglyn-shop__panel {
  position: relative;
  margin: auto 0 auto 0;
  width: clamp(320px, 45vw, 560px);
  height: 100vh;
  padding: 2.2rem 1.6rem 1.6rem 1.6rem;
  background: linear-gradient(135deg, rgba(12, 6, 4, 0.92), rgba(20, 4, 4, 0.88));
  border-right: 2px solid var(--border-blood);
  box-shadow: 0 0 40px var(--overlay-deep);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  color: var(--bone);
  overflow: hidden;
  backdrop-filter: blur(2px);
}
.troglyn-shop__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: .6rem;
  border-bottom: 1px solid rgba(204, 0, 0, 0.28);
}
.troglyn-shop__title {
  font-family: 'Cinzel', serif;
  font-size: var(--fs-lg);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--blood-pale);
  text-shadow: 0 0 10px rgba(255, 40, 40, 0.4);
}
.troglyn-shop__skulls {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .3rem .6rem;
  border-radius: 6px;
  font-family: 'Cinzel', serif;
  font-size: var(--fs-lg);
  color: var(--blood-pale);
}
.troglyn-shop__skulls img { width: 30px; height: 30px; }
.troglyn-shop__close {
  position: absolute;
  top: 1.1rem;
  right: 1.1rem;
  padding: .45rem 1.1rem;
  background: rgba(18, 4, 4, 0.88);
  border: 1.5px solid var(--border-blood);
  color: var(--blood-pale);
  border-radius: 6px;
  cursor: pointer;
  font-family: 'Cinzel', serif;
  font-size: var(--fs-sm);
  letter-spacing: .18em;
  text-transform: uppercase;
  transition: background .2s, color .2s;
  z-index: 2;
}
.troglyn-shop__close:hover { background: rgba(204, 0, 0, 0.22); color: var(--text-inverse); }

.troglyn-shop__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .7rem;
  overflow-y: auto;
  padding: .4rem .25rem .4rem 0;
  flex: 1;
  align-content: start;
}
.troglyn-shop__slot {
  position: relative;
  background: linear-gradient(160deg, rgba(40, 15, 10, 0.55), rgba(18, 6, 6, 0.85));
  border: 1px solid rgba(150, 40, 40, 0.35);
  border-radius: 8px;
  padding: .6rem .5rem .45rem .5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  cursor: pointer;
  transition: transform .18s, border-color .18s, box-shadow .18s;
  color: var(--bone);
  font-family: 'IM Fell English', serif;
  text-align: center;
}
.troglyn-shop__slot:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 80, 80, 0.7);
  box-shadow: 0 0 16px var(--border-blood-soft);
}
.troglyn-shop__slot[data-sold="true"] {
  opacity: 0.35;
  pointer-events: none;
  filter: grayscale(0.7);
}
/* Cupo semanal agotado (Crucifijo Dorado): atenuado pero clicable, para que el
   diálogo de compra pueda explicar que vuelve la próxima semana. */
.troglyn-shop__slot--out {
  opacity: 0.5;
  filter: grayscale(0.6);
}
.troglyn-shop__slot--out:hover {
  transform: none;
  border-color: rgba(150, 40, 40, 0.35);
  box-shadow: none;
}
.troglyn-shop__slot-img {
  width: 62px;
  height: 62px;
  object-fit: contain;
  filter: drop-shadow(0 0 6px var(--overlay-mid));
}
.troglyn-shop__slot-name {
  font-size: var(--fs-sm);
  color: var(--parchment-bright);
  line-height: 1.15;
  min-height: 2.1em;
}
.troglyn-shop__slot-cost {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  font-family: 'Cinzel', serif;
  font-size: var(--fs-sm);
  color: var(--blood-pale);
}
.troglyn-shop__slot-cost img { width: 16px; height: 16px; }
/* Precio original tachado cuando hay oferta */
.troglyn-shop__slot-orig {
  color: var(--bone);
  opacity: 0.55;
  font-size: 0.85em;
  margin-right: .15rem;
}
/* Etiqueta "OFERTA" en la esquina del slot */
.troglyn-shop__badge {
  position: absolute;
  top: -6px;
  left: -6px;
  background: linear-gradient(135deg, #d4a017, #8a6400);
  color: #1a0d05;
  font-family: 'Cinzel', serif;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 5px;
  box-shadow: 0 0 8px rgba(212, 160, 23, 0.6);
  z-index: 2;
  pointer-events: none;
}

.troglyn-shop__empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--ash);
  padding: 2rem 1rem;
  font-style: italic;
}

/* ── Diálogo de confirmación de compra ── */
.troglyn-buy {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--overlay-dark);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s;
  z-index: 2;
}
.troglyn-buy.open { opacity: 1; pointer-events: auto; }
.troglyn-buy__card {
  width: min(88%, 380px);
  background: linear-gradient(135deg, #140405, #0a0202);
  border: 1px solid rgba(204, 0, 0, 0.55);
  border-radius: 12px;
  padding: 1.3rem 1.1rem 1.1rem 1.1rem;
  color: var(--bone);
  text-align: center;
  font-family: 'IM Fell English', serif;
  box-shadow: 0 0 40px var(--border-blood-soft);
}
.troglyn-buy__img {
  width: 96px;
  height: 96px;
  object-fit: contain;
  margin: 0 auto .7rem auto;
  display: block;
  filter: drop-shadow(0 0 10px var(--border-blood));
}
.troglyn-buy__name {
  font-family: 'Cinzel', serif;
  font-size: var(--fs-md);
  letter-spacing: .08em;
  color: var(--blood-pale);
  margin-bottom: .4rem;
}
.troglyn-buy__desc {
  font-size: var(--fs-sm);
  color: #bfa8a8;
  line-height: 1.35;
  margin-bottom: .9rem;
}
.troglyn-buy__cost {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .35rem .7rem;
  background: rgba(40, 0, 0, 0.6);
  border: 1px solid var(--border-blood);
  border-radius: 6px;
  font-family: 'Cinzel', serif;
  color: var(--blood-pale);
  margin-bottom: 1rem;
}
.troglyn-buy__cost img { width: 18px; height: 18px; }
.troglyn-buy__actions {
  display: flex;
  gap: .7rem;
  justify-content: center;
}
.troglyn-buy__btn {
  min-width: 110px;
  padding: .55rem 1rem;
  background: rgba(204, 0, 0, 0.2);
  border: 1px solid var(--border-blood-strong);
  color: var(--blood-pale);
  font-family: 'Cinzel', serif;
  font-size: var(--fs-sm);
  letter-spacing: .1em;
  text-transform: uppercase;
  border-radius: 6px;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.troglyn-buy__btn:hover:not(:disabled) {
  background: var(--border-blood);
  color: var(--text-inverse);
}
.troglyn-buy__btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.troglyn-buy__btn--dim {
  background: transparent;
  color: var(--bone);
  border-color: var(--stone-light);
}
.troglyn-buy__btn--dim:hover:not(:disabled) {
  background: rgba(60, 60, 60, 0.3);
  color: var(--bone);
}
.troglyn-buy__hint {
  margin-top: .6rem;
  font-size: var(--fs-sm);
  color: #a66;
  min-height: 1.1em;
}

@media (max-width: 720px) {
  .troglyn-shop__panel {
    width: 72vw;
    padding: 1.2rem 1rem 1rem 1rem;
  }
  .troglyn-shop__grid { grid-template-columns: repeat(2, 1fr); }
  .troglyn-shop__title { font-size: var(--fs-md); }
  .troglyn-shop__slot-img { width: 48px; height: 48px; }
}

/* Landscape con altura muy reducida (ej. 667×375) — umbral justo bajo 390px */
@media (max-height: 383px) {
  .troglyn-shop__panel {
    width: 52vw;
    padding: .7rem .9rem .6rem .9rem;
    gap: .35rem;
  }
  .troglyn-shop__header { padding-bottom: .25rem; }
  .troglyn-shop__title { font-size: var(--fs-sm); }
  .troglyn-shop__skulls { font-size: var(--fs-sm); }
  .troglyn-shop__skulls img { width: 20px; height: 20px; }
  .troglyn-shop__slot {
    padding: .35rem .4rem .28rem .4rem;
    gap: .18rem;
  }
  .troglyn-shop__slot-name { min-height: unset; }

  .troglyn-buy__card { padding: .6rem .8rem .65rem .8rem; }
  .troglyn-buy__img { width: 52px; height: 52px; margin-bottom: .25rem; }
  .troglyn-buy__name { font-size: var(--fs-sm); margin-bottom: .18rem; }
  .troglyn-buy__desc { margin-bottom: .4rem; font-size: .68rem; }
  .troglyn-buy__cost { padding: .18rem .4rem; margin-bottom: .45rem; }
  .troglyn-buy__btn { padding: .32rem .7rem; min-width: 80px; }
}

/* ═══════════════════════════════════════════════════════════
   DAILY LOGIN PANEL
═══════════════════════════════════════════════════════════ */
.daily-login-overlay {
  position: fixed;
  inset: 0;
  z-index: 600;
  background: var(--overlay-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.daily-login-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.daily-login-overlay.open .wp-panel {
  transform: translateY(0) scale(1);
}
.dl-grid {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin: 0.8rem 0;
}
.dl-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  width: 88px;
  flex-shrink: 0;
}
.dl-cell-day {
  font-family: var(--font-display);
  font-size: var(--fs-micro);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--overlay-parchment);
}
.dl-cell--today .dl-cell-day,
.dl-cell--claimed-today .dl-cell-day {
  color: var(--blood-bright);
}
.dl-cell-img-wrap {
  position: relative;
  width: 64px;
  height: 64px;
  border: 1px solid var(--overlay-blood);
  border-radius: 4px;
  background: var(--overlay-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.dl-cell--today .dl-cell-img-wrap {
  border-color: var(--blood-bright);
  box-shadow: 0 0 12px var(--border-blood), inset 0 0 12px var(--overlay-blood-soft);
  animation: dl-pulse 2s ease-in-out infinite;
}
.dl-cell--claimed-today .dl-cell-img-wrap {
  border-color: var(--border-blood);
}
.dl-cell--locked .dl-cell-img-wrap {
  border-color: rgba(80, 80, 80, 0.3);
}
@keyframes dl-pulse {
  0%, 100% { box-shadow: 0 0 10px var(--border-blood), inset 0 0 10px var(--overlay-blood-soft); }
  50%       { box-shadow: 0 0 20px var(--border-blood-strong), inset 0 0 16px var(--border-blood-soft); }
}
.dl-cell-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  transition: opacity 0.35s ease;
}
.dl-cell--locked .dl-cell-img {
  filter: grayscale(1) brightness(0.3);
}
.dl-cell--claimed .dl-cell-img,
.dl-cell--claimed-today .dl-cell-img {
  filter: grayscale(0.5) brightness(0.6);
}
.dl-cell-qty {
  position: absolute;
  bottom: 2px;
  right: 3px;
  font-family: var(--font-display);
  font-size: var(--fs-micro);
  color: var(--parchment);
  background: var(--overlay-dark);
  padding: 0 3px;
  border-radius: 2px;
  line-height: 1.4;
}
.dl-cell-check {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-lg);
  color: rgba(139, 0, 0, 0.85);
  background: var(--overlay-soft);
}
.dl-cell-label {
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  color: var(--overlay-parchment-strong);
  text-align: center;
  line-height: 1.3;
  max-width: 80px;
}
.dl-cell--today .dl-cell-label {
  color: rgba(224, 200, 160, 0.9);
}
.dl-footer {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}
.dl-btn {
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: url('/public/assets/images/ui/ui-action-btn-bar.webp') center / 100% 100% no-repeat;
  border: none;
  color: var(--parchment);
  padding: 0.55rem 2rem;
  cursor: pointer;
  transition: filter 0.2s, transform 0.15s;
}
.dl-btn:hover:not(:disabled) {
  filter: brightness(1.2);
  transform: scale(1.03);
}
.dl-btn--claimed,
.dl-btn:disabled {
  opacity: 0.4;
  cursor: default;
  filter: none;
  transform: none;
}
@media (orientation: landscape) and (max-height: 500px) {
  .daily-login-overlay .dl-cell { width: 70px; }
}

/* Rarity label — Legendario */
.inv-detail-rarity-label--legendary {
  background: linear-gradient(90deg, #7c4a00, #c8860a, #7c4a00);
  background-size: 200% auto;
  animation: inv-legendary-shimmer 3s linear infinite;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
@keyframes inv-legendary-shimmer {
  0%   { background-position: 200% center; }
  100% { background-position: -200% center; }
}

/* ── Animaciones de feedback de flechas ── */
@keyframes nav-anim-up {
  0%, 100% { transform: translateY(0);    opacity: 1; }
  45%       { transform: translateY(-7px); opacity: 0.25; }
}
@keyframes nav-anim-down {
  0%, 100% { transform: translateY(0);   opacity: 1; }
  45%       { transform: translateY(7px); opacity: 0.25; }
}
@keyframes nav-anim-left {
  0%, 100% { transform: translateX(0);    opacity: 1; }
  45%       { transform: translateX(-7px); opacity: 0.25; }
}
@keyframes nav-anim-right {
  0%, 100% { transform: translateX(0);   opacity: 1; }
  45%       { transform: translateX(7px); opacity: 0.25; }
}
@keyframes turn-anim-right {
  0%, 100% { transform: translateY(-50%) rotate(0);     opacity: 1; }
  45%       { transform: translateY(-50%) rotate(22deg); opacity: 0.25; }
}
@keyframes turn-anim-left {
  0%, 100% { transform: translateY(-50%) rotate(0);      opacity: 1; }
  45%       { transform: translateY(-50%) rotate(-22deg); opacity: 0.25; }
}
@keyframes salas-down-anim {
  0%, 100% { transform: translateX(-50%) translateY(0);   opacity: 1; }
  45%       { transform: translateX(-50%) translateY(7px); opacity: 0.25; }
}

.ala-nav-btn--up.nav-clicked    { animation: nav-anim-up    0.28s ease-out forwards; pointer-events: none; opacity: 1; }
.ala-nav-btn--down.nav-clicked  { animation: nav-anim-down  0.28s ease-out forwards; pointer-events: none; opacity: 1; }
.ala-nav-btn--left.nav-clicked  { animation: nav-anim-left  0.28s ease-out forwards; pointer-events: none; opacity: 1; }
.ala-nav-btn--right.nav-clicked { animation: nav-anim-right 0.28s ease-out forwards; pointer-events: none; opacity: 1; }
.salas-arrow--next.arrow-clicked { animation: turn-anim-right 0.28s ease-out forwards; pointer-events: none; }
.salas-arrow--prev.arrow-clicked { animation: turn-anim-left  0.28s ease-out forwards; pointer-events: none; }
.salas-arrow--down.arrow-clicked { animation: salas-down-anim 0.28s ease-out forwards; pointer-events: none; }

/* ============================================================
   Crematorium — Caja fuerte (puzzle de combinación)
   ============================================================ */
.crem-safe-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.96);
  z-index: 9000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.crem-safe-overlay.open { display: flex; }
.crem-safe-overlay.crem-safe-reveal .crem-safe-panel,
.crem-safe-overlay.crem-safe-reveal .crem-safe-close { display: none; }
.crem-safe-overlay.crem-safe-reveal .crem-safe-bg { opacity: 1; filter: none; }

.crem-safe-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.35;
  filter: brightness(0.55) contrast(1.1);
  pointer-events: none;
}
.crem-safe-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 30%, rgba(0,0,0,0.85) 100%);
  pointer-events: none;
}

.crem-safe-close {
  position: absolute;
  top: 18px;
  right: 18px;
  background: none;
  border: none;
  /*width: 38px;
  height: 38px;  */
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.crem-safe-close img { width: 64px; height: 64px; object-fit: contain; }
.crem-safe-close:hover { border-color: #cc0000; }

.crem-safe-panel {
  position: relative;
  z-index: 1;
  background: rgba(15, 8, 5, 0.92);
  border: 1px solid rgba(180,140,90,0.45);
  border-radius: 6px;
  padding: 28px 32px;
  max-width: 460px;
  width: 100%;
  text-align: center;
  box-shadow: 0 0 60px rgba(120,40,10,0.4), inset 0 0 30px rgba(0,0,0,0.6);
}

.crem-safe-eyebrow {
  font-family: 'Cinzel', serif;
  font-size: 13px;
  letter-spacing: 0.3em;
  color: #b89060;
  text-transform: uppercase;
  margin: 0 0 6px;
}
.crem-safe-step {
  font-family: 'IM Fell English', serif;
  font-size: 16px;
  color: #cfc0a8;
  margin: 0 0 22px;
}

.crem-safe-dial {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 24px;
}
.crem-safe-step-btn {
  background: url('/public/assets/images/ui/ui-empty-btn.webp') no-repeat center / 100% 100%;
  color: #cfc0a8;
  border: none;
  padding: 10px 24px;
  font-family: 'Cinzel', serif;
  font-size: 40px;
  font-weight: 900;
  cursor: pointer;
  min-width: 80px;
  transition: all 0.15s;
}
.crem-safe-step-btn:hover {
  color: #fff;
  filter: brightness(1.2);
}
.crem-safe-step-btn:active { transform: scale(0.95); }

.crem-safe-num {
  font-family: 'Cinzel', serif;
  font-weight: 900;
  font-size: 44px;
  color: #ff3a1a;
  background: url('/public/assets/images/ui/ui-empty-btn.webp') no-repeat center / 100% 100%;
  border: none;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 130px;
  height: 130px;
  text-shadow: 0 0 12px rgba(255,30,10,0.7);
  letter-spacing: 0.05em;
}

.crem-safe-dirs {
  display: flex;
  gap: 6px;
  justify-content: center;  
}
.crem-safe-dir {
  background: none;
  border: none;
  border-radius: 4px;
  /*padding: 12px 14px;*/
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.crem-safe-turn-icon {
  width: 80px;
  height: 80px;
  object-fit: contain;
}
.crem-safe-turn-icon--flip { transform: scaleX(-1); }

.crem-safe-dir:active { transform: scale(0.98); }

@keyframes crem-spin-cw  { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes crem-spin-ccw { from { transform: rotate(0deg); } to { transform: rotate(-360deg); } }
.crem-safe-dir.crem-spin-cw  { animation: crem-spin-cw  0.45s ease-out; }
.crem-safe-dir.crem-spin-ccw { animation: crem-spin-ccw 0.45s ease-out; }

.crem-safe-hint {
  font-family: 'IM Fell English', serif;
  font-size: 17px;
  color: #8a7858;
  margin: 0;
}

@media (max-width: 480px) {
  .crem-safe-panel { padding: 22px 18px; }
  .crem-safe-num   { font-size: 36px; width: 120px; height: 64px; }
  .crem-safe-step-btn { padding: 4px 12px; min-width: 60px; font-size: 32px; }
  .crem-safe-dir   { padding: 10px 8px; }
  .crem-safe-turn-icon { width: 36px; height: 36px; }
}

/* =========================================
   SALA DE RITUALES — Ceremonia de Baphomet
   ========================================= */

/* Modo ritual: oculta todo el HUD (mismas reglas que body.hallucinating, sin
   los efectos visuales). Se activa con body.ritual-active durante la ceremonia. */
body.ritual-active .nav-bar,
body.ritual-active .burger,
body.ritual-active .menu-overlay,
body.ritual-active .player-profile-btn,
body.ritual-active .portal-btn,
body.ritual-active #inv-btn,
body.ritual-active .inv-btn,
body.ritual-active #site-footer,
body.ritual-active .pain-stone-hud,
body.ritual-active .pain-stone-hud-wrap,
body.ritual-active #noise-hud-row,
body.ritual-active .salas-arrow,
body.ritual-active .salas-dots,
body.ritual-active .salas-room-title,
body.ritual-active .vestibulo-hotspot,
body.ritual-active .hotspot-ring,
body.ritual-active .hotspot-dot,
body.ritual-active .sanity-widget,
body.ritual-active .audio-toggle {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Vibración ligera (3 s) */
@keyframes rit-vibrate {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-2px, 1px); }
  20% { transform: translate(2px, -1px); }
  30% { transform: translate(-1px, 2px); }
  40% { transform: translate(1px, -2px); }
  50% { transform: translate(-2px, -1px); }
  60% { transform: translate(2px, 1px); }
  70% { transform: translate(-1px, -2px); }
  80% { transform: translate(1px, 2px); }
  90% { transform: translate(-2px, 1px); }
}
.rit-vibrate { animation: rit-vibrate 0.08s linear infinite; }

/* Vibración intensa */
@keyframes rit-vibrate-strong {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-6px, 3px); }
  20% { transform: translate(6px, -3px); }
  30% { transform: translate(-4px, 5px); }
  40% { transform: translate(5px, -4px); }
  50% { transform: translate(-6px, -2px); }
  60% { transform: translate(6px, 2px); }
  70% { transform: translate(-3px, -5px); }
  80% { transform: translate(4px, 5px); }
  90% { transform: translate(-5px, 2px); }
}
.rit-vibrate-strong { animation: rit-vibrate-strong 0.06s linear infinite; }

/* Plano negro a pantalla completa */
#rit-blackout {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}
#rit-blackout.active {
  opacity: 1;
  pointer-events: auto;
}

/* Botones de frase del puzzle: tamaño cómodo, una línea en mobile-landscape */
.rit-phrase-btn {
  text-transform: none !important;
  letter-spacing: 1px !important;
  font-family: var(--font-body) !important;
  font-size: var(--fs-base) !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Input de petición a Baphomet */
#rit-petition-input {
  width: 100%;
  margin-top: 0.6rem;
  padding: 0.7rem 1rem;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  color: var(--parchment);
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid var(--blood-core);
  border-radius: 2px;
  text-align: center;
  letter-spacing: 1px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
#rit-petition-input:focus {
  border-color: var(--blood-bright);
  box-shadow: 0 0 12px var(--border-blood-soft);
}

@keyframes rit-input-shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}
.rit-input-shake {
  animation: rit-input-shake 0.35s ease-in-out;
  border-color: var(--blood-bright) !important;
}

/* ═══════════════════════════════════════════════════════
   RECOVERY POPUP — Bienvenida tras salida segura
   ═══════════════════════════════════════════════════════ */

#recovery-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
}
#recovery-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

#recovery-panel {
  position: relative;
  width: clamp(260px, 62vw, 460px);
  padding: clamp(2rem, 5vh, 3.2rem) clamp(1.6rem, 5vw, 3rem);
  text-align: center;
  background: url('/public/assets/images/ui/ui-text-box-2.webp') center / 100% 100% no-repeat;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  transform: scale(0.88);
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
#recovery-overlay.open #recovery-panel {
  transform: scale(1);
}

.recovery-title {
  font-family: var(--font-display);
  font-size: clamp(0.82rem, 2.6vw, 1.1rem);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(224, 200, 160, 0.85);
}
.recovery-subtitle {
  font-family: var(--font-body);
  font-size: clamp(0.7rem, 1.8vw, 0.82rem);
  color: rgba(224, 200, 160, 0.45);
  letter-spacing: 0.05em;
}

/* Barra de cordura */
.recovery-bar-wrap {
  position: relative;
  width: clamp(160px, 42vw, 300px);
  aspect-ratio: 1160 / 256;
  margin: 0.3rem auto;
}
.recovery-bar-track {
  position: absolute;
  left: 18%; right: 11%;
  top: 30%;  bottom: 32%;
  z-index: 1;
  background: rgba(139, 0, 0, 0.12);
  overflow: hidden;
}
.recovery-bar-fill {
  height: 100%;
  background: linear-gradient(to right, var(--blood-core, #8b0000), var(--blood-bright, #cc0000));
}
.recovery-bar-fill.filling {
  transition: width 1.6s ease-out;
  box-shadow: 0 0 14px var(--blood-glow, #ff1a1a), 0 0 28px rgba(204, 0, 0, 0.35);
  animation: rec-bar-pulse 0.7s ease-in-out 2 1.6s;
}
@keyframes rec-bar-pulse {
  0%, 100% { filter: brightness(1); }
  50%       { filter: brightness(1.7) drop-shadow(0 0 8px #ff1a1a); }
}
.recovery-bar-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

/* Texto +pts */
.recovery-pts {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 4vw, 1.7rem);
  color: var(--blood-bright, #cc0000);
  text-shadow: 0 0 12px var(--blood-glow, #ff1a1a), 0 0 24px rgba(204, 0, 0, 0.4);
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.recovery-pts.visible {
  opacity: 1;
  transform: scale(1);
}
.recovery-pts-sub {
  font-family: var(--font-body);
  font-size: clamp(0.7rem, 1.8vw, 0.82rem);
  color: rgba(224, 200, 160, 0.55);
  opacity: 0;
  transition: opacity 0.35s ease;
}
.recovery-pts-sub.visible {
  opacity: 1;
}

/* Hint */
.recovery-hint {
  font-family: var(--font-body);
  font-size: clamp(0.65rem, 1.5vw, 0.75rem);
  color: rgba(224, 200, 160, 0.25);
  letter-spacing: 0.12em;
  margin-top: 0.3rem;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.recovery-hint.visible {
  opacity: 1;
  animation: rec-hint-blink 2.2s ease-in-out infinite;
}
@keyframes rec-hint-blink {
  0%, 100% { opacity: 0.25; }
  50%       { opacity: 0.65; }
}

/* Partículas flotantes */
.recovery-particle {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  pointer-events: none;
  animation: rec-particle-rise 1s ease-out forwards;
}
@keyframes rec-particle-rise {
  0%   { transform: translateY(0)   scale(1);   opacity: 0.9; }
  100% { transform: translateY(-55px) scale(0); opacity: 0; }
}

