/* ═══════════════════════════════════════════════════════════
   LAS AVENTURAS DE ANDRÉS & DANI — estética de mapa antiguo
   ═══════════════════════════════════════════════════════════ */

:root {
  --acento: #b25a6d;            /* lo sobreescribe el color elegido */
  --tinta: #4a3826;
  --tinta-suave: #6b5844;
  --pergamino: #f3e5c2;
  --pergamino-claro: #f9f0d8;
  --pergamino-oscuro: #e6d3aa;
  --madera: #2e2015;
  --madera-clara: #45311f;
  --exito: #4e7248;
  --error: #a53f2e;
  --sombra: 0 10px 30px rgba(30, 18, 5, 0.45);
}

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

html, body { height: 100%; }

body {
  font-family: 'Lora', 'Georgia', serif;
  color: var(--tinta);
  background:
    radial-gradient(ellipse at 30% 20%, rgba(255, 220, 160, 0.06), transparent 60%),
    repeating-linear-gradient(90deg, var(--madera) 0 90px, var(--madera-clara) 90px 92px, var(--madera) 92px 180px);
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}

/* ─── Pantallas ─── */
.pantalla {
  display: none;
  min-height: 100vh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  animation: aparecer 0.5s ease;
}
.pantalla.activa { display: flex; }
@keyframes aparecer { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.oculto { display: none !important; }

/* ─── Botones ─── */
.btn {
  font-family: 'IM Fell English', serif;
  font-size: 1.15rem;
  color: var(--pergamino-claro);
  background: linear-gradient(180deg, var(--acento), color-mix(in srgb, var(--acento) 70%, #000));
  border: 2px solid rgba(0,0,0,0.25);
  border-radius: 10px;
  padding: 12px 28px;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(0,0,0,0.3), var(--sombra);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.2s;
}
.btn:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.08); }
.btn:active:not(:disabled) { transform: translateY(1px); box-shadow: 0 2px 0 rgba(0,0,0,0.3); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; filter: grayscale(0.5); }
.btn-grande { font-size: 1.45rem; padding: 16px 40px; }
.btn-chico { font-size: 1rem; padding: 8px 18px; }

.btn-fantasma {
  font-family: 'Quicksand', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--pergamino-oscuro);
  background: rgba(255,255,255,0.06);
  border: 1.5px solid rgba(243, 229, 194, 0.35);
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-fantasma:hover { background: rgba(255,255,255,0.14); }

/* ═══════════ TÍTULO ═══════════ */
.pergamino-titulo {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(120, 85, 40, 0.14), transparent 55%),
    var(--pergamino);
  border-radius: 6px;
  padding: 48px 42px;
  max-width: 620px;
  width: 100%;
  text-align: center;
  box-shadow: var(--sombra), inset 0 0 60px rgba(120, 85, 40, 0.25);
  border: 2px solid var(--tinta-suave);
  outline: 1px solid rgba(74, 56, 38, 0.4);
  outline-offset: 6px;
  position: relative;
}
.titulo-juego {
  font-family: 'Pirata One', 'IM Fell English', serif;
  font-size: clamp(2.4rem, 8vw, 4rem);
  line-height: 1.06;
  margin: 18px 0 10px;
  color: var(--tinta);
  text-shadow: 2px 2px 0 rgba(120, 85, 40, 0.2);
}
.titulo-juego .amp { color: var(--acento); font-family: 'IM Fell English', serif; font-style: italic; }
.subtitulo-juego {
  font-family: 'IM Fell English', serif;
  font-style: italic;
  color: var(--tinta-suave);
  margin-bottom: 30px;
  font-size: 1.05rem;
}
.ornamento { color: var(--tinta-suave); font-size: 1.3rem; letter-spacing: 8px; }
.ornamento-arriba {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  letter-spacing: 0;
}
.ornamento-arriba .ancla {
  width: 58px;
  height: auto;
  color: var(--tinta-suave);
  filter: drop-shadow(1px 2px 0 rgba(120, 85, 40, 0.25));
}
.ornamento-arriba .hoja { font-size: 1.5rem; }
.ornamento-abajo { margin-top: 26px; }

/* ═══════════ SELECCIÓN DE JUGADOR ═══════════ */
.titulo-seccion {
  font-family: 'IM Fell English', serif;
  font-size: clamp(1.7rem, 5vw, 2.4rem);
  color: var(--pergamino);
  text-align: center;
  margin-bottom: 8px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
.texto-seccion { color: var(--pergamino-oscuro); margin-bottom: 20px; text-align: center; }

.tarjetas-jugador { display: flex; gap: 34px; flex-wrap: wrap; justify-content: center; margin-top: 30px; }
.tarjeta-jugador {
  background: var(--pergamino);
  border: 2px solid var(--tinta-suave);
  border-radius: 12px;
  padding: 32px 34px 24px;
  width: 300px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  box-shadow: var(--sombra);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.tarjeta-jugador:hover { transform: translateY(-6px) rotate(-0.5deg); box-shadow: 0 18px 40px rgba(0,0,0,0.5); }
.marco-avatar { width: 195px; height: 195px; }
.marco-avatar svg { width: 100%; height: 100%; }
.nombre-jugador { font-family: 'Pirata One', serif; font-size: 2.4rem; color: var(--tinta); }
.rol-jugador { font-size: 1.02rem; font-weight: 600; color: var(--tinta-suave); font-style: italic; }

/* ═══════════ ELECCIÓN DE COLOR ═══════════ */
.paleta-colores {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin: 24px 0 30px;
  max-width: 480px;
}
.muestra-color {
  background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.muestra-circulo {
  width: 62px; height: 62px; border-radius: 50%;
  background: var(--muestra);
  border: 3px solid var(--pergamino);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  transition: transform 0.15s ease, box-shadow 0.15s;
}
.muestra-color:hover .muestra-circulo { transform: scale(1.12); }
.muestra-color.activa .muestra-circulo {
  transform: scale(1.18);
  box-shadow: 0 0 0 4px var(--pergamino), 0 0 0 7px var(--muestra), 0 6px 16px rgba(0,0,0,0.5);
}
.muestra-nombre { color: var(--pergamino-oscuro); font-size: 0.8rem; font-weight: 600; }
.muestra-color.activa .muestra-nombre { color: var(--pergamino-claro); }

/* ═══════════ PRÓLOGO — libro abierto de dos páginas ═══════════ */
.libro-abierto {
  position: relative;
  display: flex;
  width: 100%;
  max-width: 980px;
  margin-top: 64px;
  perspective: 2200px;
  background: linear-gradient(180deg, #4a3320, #33220e);
  border: 1px solid rgba(0, 0, 0, 0.4);
  border-radius: 14px;
  padding: 14px;
  box-shadow: var(--sombra), 0 3px 0 2px rgba(0, 0, 0, 0.3);
}
.pagina-libro {
  flex: 1 1 50%;
  min-width: 0;
  min-height: 470px;
  padding: 30px 30px 22px;
  display: flex;
  flex-direction: column;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0.40 0 0 0 0 0.31 0 0 0 0 0.18 0 0 0 0.07 0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23p)'/%3E%3C/svg%3E"),
    radial-gradient(ellipse at 20% 10%, rgba(120, 85, 40, 0.10), transparent 55%),
    radial-gradient(ellipse at 85% 92%, rgba(120, 85, 40, 0.12), transparent 50%);
  background-color: var(--pergamino);
}
.pagina-izq {
  border-radius: 8px 2px 2px 8px;
  box-shadow: inset -22px 0 30px -20px rgba(74, 56, 38, 0.6);
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.pagina-der {
  border-radius: 2px 8px 8px 2px;
  box-shadow: inset 22px 0 30px -20px rgba(74, 56, 38, 0.6);
}
.lomo {
  position: absolute;
  top: 14px; bottom: 14px; left: 50%;
  width: 6px;
  transform: translateX(-3px);
  background: linear-gradient(90deg, rgba(51, 34, 14, 0) 0%, rgba(51, 34, 14, 0.45) 50%, rgba(51, 34, 14, 0) 100%);
  z-index: 2;
  pointer-events: none;
}
.pagina-ornamento { color: var(--tinta-suave); letter-spacing: 12px; opacity: 0.65; font-size: 1.05rem; }
.pagina-ilustracion { display: flex; justify-content: center; }
.pagina-ilustracion svg { width: min(320px, 90%); height: auto; }
.ilu-mazapan svg, .ilu-mazapan img { width: min(210px, 70%); height: auto; }
.pagina-capitulo {
  font-family: 'IM Fell English', serif;
  font-size: 1.4rem;
  text-align: center;
  margin-bottom: 14px;
  color: var(--tinta);
}
.pagina-texto {
  font-size: 1.12rem;
  line-height: 1.8;
  flex: 1;
  min-height: 110px;
  font-weight: 500;
}
.pagina-pie {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 16px; color: var(--tinta-suave);
  font-family: 'IM Fell English', serif;
}

/* Hoja que se voltea: la página derecha gira sobre el lomo y cae a la izquierda */
.hoja-flip {
  position: absolute;
  top: 14px; bottom: 14px; left: 50%; right: 14px;
  transform-origin: left center;
  transform-style: preserve-3d;
  z-index: 5;
  pointer-events: none;
}
.hoja-flip.girando { animation: girarHoja 1.1s cubic-bezier(0.4, 0.12, 0.28, 0.96) forwards; }
@keyframes girarHoja {
  0%   { transform: rotateY(0deg); }
  100% { transform: rotateY(-180deg); }
}
.hoja-cara {
  position: absolute;
  inset: 0;
  min-height: 0;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.hoja-frente {
  border-radius: 2px 8px 8px 2px;
  box-shadow: inset 22px 0 30px -20px rgba(74, 56, 38, 0.6);
}
.hoja-frente::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(100deg, rgba(74, 56, 38, 0) 55%, rgba(74, 56, 38, 0.2));
  opacity: 0;
  animation: sombraHoja 1.1s ease forwards;
}
@keyframes sombraHoja { 0% { opacity: 0; } 45% { opacity: 1; } 100% { opacity: 1; } }
.hoja-atras {
  transform: rotateY(180deg);
  border-radius: 8px 2px 2px 8px;
  box-shadow: inset -22px 0 30px -20px rgba(74, 56, 38, 0.6);
  align-items: center;
  justify-content: center;
  gap: 16px;
  filter: brightness(0.985);
}

/* ─── Portada del libro (cerrado) ─── */
.libro-portada {
  position: absolute;
  inset: 0;
  z-index: 7;
  transform-origin: left center;
  transform-style: preserve-3d;
  cursor: pointer;
}
.portada-cara {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.portada-frente {
  background:
    radial-gradient(ellipse at 30% 20%, rgba(255, 214, 140, 0.08), transparent 55%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='c'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.55' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.10 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23c)'/%3E%3C/svg%3E"),
    linear-gradient(150deg, #5a3f22, #3a2810 55%, #2c1d0a);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  transition: filter 0.25s;
}
.libro-portada:hover .portada-frente { filter: brightness(1.1); }
.portada-marco {
  width: 100%;
  height: 100%;
  border: 2.5px solid #c9a55f;
  outline: 1px solid rgba(201, 165, 95, 0.45);
  outline-offset: 6px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  position: relative;
  color: #d9b878;
  text-align: center;
  padding: 18px;
  box-shadow: inset 0 0 26px rgba(0, 0, 0, 0.35);
}
.portada-esquina { position: absolute; font-size: 1.25rem; color: #c9a55f; opacity: 0.85; }
.esq-a { top: 8px; left: 14px; }
.esq-b { top: 8px; right: 14px; transform: scaleX(-1); }
.esq-c { bottom: 8px; left: 14px; transform: scaleY(-1); }
.esq-d { bottom: 8px; right: 14px; transform: scale(-1); }
.portada-ancla { width: 54px; color: #c9a55f; filter: drop-shadow(0 2px 2px rgba(0,0,0,0.5)); }
.portada-titulo {
  font-family: 'Pirata One', 'IM Fell English', serif;
  font-size: clamp(1.9rem, 4.5vw, 2.9rem);
  line-height: 1.08;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.55), 0 0 22px rgba(217, 184, 120, 0.25);
}
.portada-titulo .amp { color: #e8cd93; font-family: 'IM Fell English', serif; font-style: italic; }
.portada-linea { letter-spacing: 14px; color: #c9a55f; font-size: 0.85rem; }
.portada-sub {
  font-family: 'IM Fell English', serif;
  font-style: italic;
  font-size: 1.02rem;
  color: #c9a55f;
}
.portada-hint {
  margin-top: 14px;
  font-family: 'Quicksand', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(217, 184, 120, 0.75);
  animation: parpadeoHint 2.4s ease-in-out infinite;
}
@keyframes parpadeoHint { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }
.portada-reverso {
  transform: rotateY(180deg);
  background: linear-gradient(30deg, #4a3320, #33220e);
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.5);
}
.libro-portada.abriendo {
  animation: abrirPortada 1.15s cubic-bezier(0.5, 0.08, 0.3, 0.94) forwards;
  pointer-events: none;
}
@keyframes abrirPortada {
  0%   { transform: rotateY(0deg); }
  100% { transform: rotateY(-180deg); }
}

/* cambio de página en pantallas chicas: fundido suave */
.libro-abierto.cambiando { animation: fundidoPagina 0.55s ease; }
@keyframes fundidoPagina {
  0% { opacity: 1; }
  40% { opacity: 0.05; }
  60% { opacity: 0.05; }
  100% { opacity: 1; }
}

.mazapan-narrador {
  position: absolute;
  right: -10px;
  top: -74px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  pointer-events: none;
  z-index: 6;
}
.mazapan-sprite { width: 110px; animation: flotar 3s ease-in-out infinite; }
.mazapan-sprite svg, .mazapan-sprite img { width: 100%; height: auto; filter: drop-shadow(0 6px 10px rgba(0,0,0,0.35)); }
@keyframes flotar { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.mazapan-narrador .mazapan-sprite { width: 92px; }
.mazapan-globo {
  background: var(--pergamino-claro);
  border: 2px solid var(--tinta-suave);
  border-radius: 12px 12px 2px 12px;
  padding: 8px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  max-width: 170px;
  margin-top: 4px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  font-family: 'Quicksand', sans-serif;
}
#btn-saltar-prologo { margin-top: 48px; }

/* marco circular para los retratos oficiales */
.avatar-marco {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid var(--anillo, var(--acento));
  background: #fdf6e3;
  box-sizing: border-box;
  box-shadow: inset 0 0 12px rgba(120, 85, 40, 0.2);
}
.avatar-marco img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 12%;
  display: block;
}
/* ═══════════ MAPA ═══════════ */
#pantalla-mapa { justify-content: flex-start; padding: 14px 10px 20px; }
.mapa-encabezado {
  width: 100%;
  max-width: 1200px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.mapa-titulo {
  font-family: 'Pirata One', serif;
  color: var(--pergamino);
  font-size: clamp(1.3rem, 4vw, 2rem);
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
  text-align: center;
}
.mapa-jugador {
  display: flex; align-items: center; gap: 8px;
  color: var(--pergamino-oscuro); font-weight: 700;
}
.avatar-mini { width: 44px; height: 44px; }
.avatar-mini svg { width: 100%; height: 100%; }
.mapa-acciones { display: flex; gap: 8px; }

.mapa-contenedor {
  width: fit-content;
  max-width: 100%;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: var(--sombra);
  border: 3px solid var(--madera-clara);
  background: #33220e;
}
/* el mapa completo cabe en pantalla: limitado por ancho Y por alto a la vez */
#mapa-svg { display: block; width: min(96vw, calc((100vh - 150px) * 1.9)); height: auto; }
@media (max-width: 700px) {
  /* en celular sí se panea: encogerlo todo lo haría ilegible */
  .mapa-contenedor { width: 100%; overflow: auto; }
  #mapa-svg { width: auto; height: max(430px, calc(100vh - 190px)); }
}
.mapa-ayuda {
  color: var(--pergamino-oscuro);
  font-style: italic;
  font-size: 0.9rem;
  margin-top: 10px;
}

.rotulo-mar {
  font-family: 'IM Fell English', serif;
  font-style: italic;
  font-size: 27px;
  fill: var(--tinta);
  opacity: 0.5;
  letter-spacing: 3px;
}

/* nodos del mapa */
.nodo { cursor: pointer; }
.nodo:not(.desbloqueado) { cursor: not-allowed; }
/* los niveles sin descubrir no revelan su nombre ni su número */
.nodo:not(.desbloqueado) .nodo-titulo { display: none; }
.nodo:not(.desbloqueado) .nodo-numero { display: none; }
.nodo-titulo {
  font-family: 'IM Fell English', serif;
  font-size: 26px;
  fill: var(--tinta);
  font-weight: bold;
  paint-order: stroke;
  stroke: var(--pergamino-claro);
  stroke-width: 4.5px;
}
.nodo.desbloqueado:hover .nodo-halo { opacity: 0.18; }
.nodo.desbloqueado:hover .nodo-icono { transform: scale(1.08); }
.nodo-icono, .nodo-halo { transition: transform 0.2s ease, opacity 0.2s ease; transform-origin: center; transform-box: fill-box; }
.niebla-interrogacion {
  font-family: 'Pirata One', serif;
  font-size: 48px;
  fill: var(--tinta);
  opacity: 0.85;
}
.nodo-niebla { transition: opacity 2.2s ease; }
.niebla-disipando { animation: disipar 2.3s ease forwards; }
@keyframes disipar {
  0% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-26px) scale(1.15); }
}
.nodo-sacudida .nodo-icono, .nodo-sacudida .nodo-niebla { animation: sacudir 0.5s ease; }
@keyframes sacudir {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
.nodo .nodo-sello { transition: opacity 0.6s ease; }
.personaje-ficha { filter: drop-shadow(0 3px 5px rgba(0,0,0,0.3)); }

/* ═══════════ NIVEL ═══════════ */
#pantalla-nivel { justify-content: flex-start; }
.nivel-encabezado {
  width: 100%;
  max-width: 900px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.nivel-titulos { flex: 1; text-align: center; }
.nivel-titulos h2 {
  font-family: 'Pirata One', serif;
  color: var(--pergamino);
  font-size: clamp(1.4rem, 5vw, 2.1rem);
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
.nivel-titulos p { color: var(--pergamino-oscuro); font-style: italic; font-size: 1.12rem; }
.nivel-insignia {
  font-family: 'IM Fell English', serif;
  background: var(--acento);
  color: var(--pergamino-claro);
  border-radius: 50px;
  padding: 6px 14px;
  font-size: 0.9rem;
  white-space: nowrap;
  box-shadow: 0 3px 8px rgba(0,0,0,0.4);
}

.nivel-contenido {
  position: relative;
  width: 100%;
  max-width: 900px;
  background: var(--pergamino);
  border: 2px solid var(--tinta-suave);
  border-radius: 8px;
  box-shadow: var(--sombra), inset 0 0 50px rgba(120, 85, 40, 0.15);
  padding: 26px 24px;
  flex: 1;
}
.nivel-pie { margin-top: 18px; }
.btn-sello.listo { animation: latido 1.6s ease-in-out infinite; }
@keyframes latido { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }

.ilustracion-nivel {
  display: block;
  margin: 0 auto 14px;
  width: min(260px, 60%);
  height: auto;
  filter: drop-shadow(0 8px 14px rgba(30, 18, 5, 0.3));
}
.ilustracion-ancha { width: min(420px, 85%); }

.instruccion {
  text-align: center;
  font-style: italic;
  color: var(--tinta-suave);
  margin-bottom: 16px;
  font-weight: 600;
  font-size: 1.08rem;
}
.subtitulo-bloque {
  font-family: 'IM Fell English', serif;
  font-size: 1.3rem;
  margin: 20px 0 8px;
  border-bottom: 2px solid rgba(74, 56, 38, 0.25);
  padding-bottom: 4px;
}
.nota-pergamino {
  background: var(--pergamino-claro);
  border: 1.5px dashed var(--tinta-suave);
  border-radius: 6px;
  padding: 15px 19px;
  font-family: 'IM Fell English', serif;
  font-style: italic;
  font-size: 1.16rem;
  line-height: 1.6;
  margin-bottom: 20px;
  box-shadow: 2px 3px 8px rgba(74, 56, 38, 0.15);
}

/* ─── Collage polaroid ─── */
.collage {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: center;
  padding: 8px 0;
}
.polaroid {
  background: #fdfbf5;
  padding: 10px 10px 8px;
  box-shadow: 0 6px 16px rgba(30, 18, 5, 0.3);
  transform: rotate(var(--rot, 0deg));
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  width: 172px;
}
.polaroid:hover { transform: rotate(0deg) scale(1.06); box-shadow: 0 12px 28px rgba(30, 18, 5, 0.4); z-index: 2; position: relative; }
.polaroid-foto {
  width: 100%; aspect-ratio: 1;
  background: repeating-linear-gradient(45deg, #e8e0cc 0 12px, #efe8d6 12px 24px);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; opacity: 0.75;
}
.polaroid-foto img { width: 100%; height: 100%; object-fit: cover; }
.polaroid figcaption {
  font-family: 'IM Fell English', serif;
  font-style: italic;
  text-align: center;
  font-size: 1.05rem;
  line-height: 1.35;
  padding-top: 8px;
  color: var(--tinta);
}

/* ─── Reencuentro (escenas) ─── */
.escenas { display: flex; flex-direction: column; gap: 26px; }
.escena { position: relative; }

/* café brecco: vapor saliendo de la taza del letrero */
.brecco-taza { position: relative; width: fit-content; margin: 0 auto; }
.vapor {
  position: absolute;
  top: 6px;
  width: 13px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.75);
  filter: blur(5px);
  pointer-events: none;
  opacity: 0;
  animation: subirVapor 2.8s ease-in-out infinite;
}
.vapor-a { left: calc(50% - 18px); animation-delay: 0s; }
.vapor-b { left: calc(50% - 2px); animation-delay: 0.9s; height: 42px; }
.vapor-c { left: calc(50% + 14px); animation-delay: 1.7s; }
@keyframes subirVapor {
  0%   { transform: translateY(6px) scaleX(1); opacity: 0; }
  30%  { opacity: 0.85; }
  100% { transform: translateY(-44px) scaleX(1.7); opacity: 0; }
}
.cafe-deco {
  position: absolute;
  font-size: 1.8rem;
  pointer-events: none;
  z-index: 1;
  opacity: 0.9;
  filter: drop-shadow(2px 3px 3px rgba(30, 18, 5, 0.25));
  animation: mecerCafe 3.2s ease-in-out infinite alternate;
}
.cafe-a { top: 8px; left: 6px; }
.cafe-b { top: 40%; right: 8px; animation-delay: 0.8s; }
.cafe-c { bottom: 12px; left: 10px; animation-delay: 1.4s; font-size: 1.4rem; }
@keyframes mecerCafe {
  from { transform: rotate(-10deg) translateY(0); }
  to   { transform: rotate(10deg) translateY(-6px); }
}

/* la pedida: corazones que suben flotando */
.escena-pedida { overflow: hidden; }
.corazon-flotante {
  position: absolute;
  bottom: -34px;
  font-size: 1.6rem;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  animation: subirCorazon 5.5s ease-in infinite;
}
.cor-1 { left: 6%;  animation-delay: 0s; }
.cor-2 { left: 26%; animation-delay: 1.8s; font-size: 1.2rem; }
.cor-3 { left: 50%; animation-delay: 3.2s; }
.cor-4 { left: 72%; animation-delay: 0.9s; font-size: 1.3rem; }
.cor-5 { left: 90%; animation-delay: 2.4s; }
@keyframes subirCorazon {
  0%   { transform: translateY(0) rotate(-8deg) scale(0.8); opacity: 0; }
  12%  { opacity: 0.85; }
  85%  { opacity: 0.5; }
  100% { transform: translateY(-460px) rotate(10deg) scale(1.15); opacity: 0; }
}
.escena-especial { animation: latidoBorde 2.4s ease-in-out infinite; }
@keyframes latidoBorde {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--acento) 30%, transparent); }
  50%      { box-shadow: 0 0 0 6px color-mix(in srgb, var(--acento) 12%, transparent); }
}
.escena h3 {
  font-family: 'IM Fell English', serif;
  font-size: 1.35rem;
  margin-bottom: 10px;
  text-align: center;
}
.escena-especial {
  border: 2px solid var(--acento);
  border-radius: 8px;
  padding: 18px 14px;
  background: color-mix(in srgb, var(--acento) 6%, var(--pergamino-claro));
}

/* ─── Centro de Querétaro: enredaderas y fuente viva ─── */
.enredadera {
  position: absolute;
  top: -26px;
  width: min(150px, 18vw);
  pointer-events: none;
  transform-origin: top center;
  transform: scale(var(--sx, 1), 1);
  animation: mecerEnredadera 4.2s ease-in-out infinite;
  filter: drop-shadow(0 5px 6px rgba(30, 18, 5, 0.3));
  z-index: 1;
}
.enredadera-izq { left: 2%; }
.enredadera-der { right: 2%; --sx: -1; animation-delay: 1.6s; }
@keyframes mecerEnredadera {
  0%, 100% { transform: scale(var(--sx, 1), 1) rotate(-1.6deg); }
  50%      { transform: scale(var(--sx, 1), 1) rotate(1.6deg); }
}
.centro-plaza { position: relative; width: fit-content; margin: 0 auto; }
.gota-fuente {
  position: absolute;
  left: 47%;
  top: 56%;
  font-size: 13px;
  pointer-events: none;
  opacity: 0;
  animation: chorroFuente 1.9s ease-in infinite;
}
.gf-1 { --dx: -26px; animation-delay: 0s; }
.gf-2 { --dx: 22px;  animation-delay: 0.5s; }
.gf-3 { --dx: -12px; animation-delay: 0.9s; font-size: 11px; }
.gf-4 { --dx: 16px;  animation-delay: 1.3s; font-size: 11px; }
@keyframes chorroFuente {
  0%   { transform: translate(0, 0) scale(0.8); opacity: 0; }
  20%  { transform: translate(calc(var(--dx) * 0.4), -22px) scale(1); opacity: 0.95; }
  55%  { transform: translate(var(--dx), -10px) scale(1); opacity: 0.8; }
  100% { transform: translate(calc(var(--dx) * 1.3), 26px) scale(0.7); opacity: 0; }
}
.destello-fuente {
  position: absolute;
  left: 45%;
  top: 63%;
  font-size: 15px;
  pointer-events: none;
  animation: brillarFuente 2.4s ease-in-out infinite;
}
@keyframes brillarFuente {
  0%, 100% { opacity: 0.2; transform: scale(0.8) rotate(0deg); }
  50%      { opacity: 1; transform: scale(1.25) rotate(20deg); }
}

/* ─── Postales (Centro de Qro) ─── */
.postales { display: flex; flex-wrap: wrap; gap: 22px; justify-content: center; }
.postal {
  width: min(380px, 100%);
  cursor: pointer;
  perspective: 1000px;
}
.postal-frente {
  background: var(--pergamino-claro);
  border: 2px solid var(--tinta-suave);
  border-radius: 6px;
  padding: 30px 22px;
  text-align: center;
  box-shadow: 4px 5px 14px rgba(74, 56, 38, 0.25);
  transition: transform 0.2s ease;
  background-image: repeating-linear-gradient(0deg, transparent 0 28px, rgba(74,56,38,0.08) 28px 29px);
}
.postal:hover .postal-frente { transform: translateY(-4px) rotate(-0.6deg); }
.postal-sello { font-size: 2.2rem; margin-bottom: 8px; }
.postal-frente h3 { font-family: 'Pirata One', serif; font-size: 1.5rem; }
.postal-frente p { font-style: italic; color: var(--tinta-suave); }
.postal-reverso { display: none; margin-top: 12px; animation: aparecer 0.4s ease; }
.postal[data-abierta="si"] .postal-reverso { display: block; }
.postal[data-abierta="si"] .postal-frente { border-color: var(--acento); }

/* ─── Lego ─── */
.lego-tarjetas { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-bottom: 20px; }
.lego-tarjeta {
  background: var(--pergamino-claro);
  border: 2px solid var(--tinta-suave);
  border-radius: 10px;
  padding: 18px 26px;
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  transition: transform 0.15s ease, border-color 0.15s;
  font-family: 'Quicksand', sans-serif;
}
.lego-tarjeta:hover { transform: translateY(-4px); }
.lego-tarjeta.activa { border-color: var(--acento); box-shadow: 0 0 0 3px color-mix(in srgb, var(--acento) 35%, transparent); }
.lego-emoji { font-size: 2.4rem; }
.lego-nombre { font-weight: 700; color: var(--tinta); }
.lego-panel {
  border-radius: 10px;
  padding: 22px;
  animation: aparecer 0.4s ease;
  border: 2px solid var(--tinta-suave);
}
.lego-panel h3 { font-family: 'Pirata One', serif; font-size: 1.6rem; text-align: center; }
.lego-descripcion { text-align: center; font-style: italic; margin: 6px 0 14px; font-weight: 600; }
.tema-mcqueen { background: linear-gradient(180deg, #f8e3df, var(--pergamino-claro)); border-color: #a33b2e; }
.tema-ironman { background: linear-gradient(180deg, #f5e0d8, #f7ecd0); border-color: #8c2f22; }
.tema-chimuelo { background: linear-gradient(180deg, #dfe6dc, var(--pergamino-claro)); border-color: #3a5040; }

/* ─── Helado: goteo de chocolate + mini-juego del Blizzard ─── */
.helado-encabezado { position: relative; }
.gotas {
  position: absolute;
  top: -26px;
  width: min(130px, 16vw);
  pointer-events: none;
  opacity: 0.95;
  transform-origin: top center;
  transform: scale(var(--sx, 1), 1);
  animation: gotear 3.6s ease-in-out infinite;
  filter: drop-shadow(0 4px 5px rgba(30, 18, 5, 0.25));
}
.gotas-izq { left: 3%; }
.gotas-der { right: 3%; --sx: -1; animation-delay: 1.4s; }
@keyframes gotear {
  0%, 100% { transform: scale(var(--sx, 1), 1); }
  50%      { transform: scale(var(--sx, 1), 1.06); }
}
.blizzard-instruccion { text-align: center; font-weight: 500; margin-bottom: 10px; }
.blizzard-arena {
  position: relative;
  height: 340px;
  background:
    radial-gradient(ellipse at 50% 110%, rgba(214, 108, 132, 0.18), transparent 60%),
    linear-gradient(180deg, #fdf3f0, var(--pergamino-claro));
  border: 2px dashed var(--tinta-suave);
  border-radius: 10px;
  overflow: hidden;
  touch-action: none;
}
.blizzard-marcador {
  position: absolute;
  top: 8px; left: 0; right: 0;
  text-align: center;
  font-weight: 700;
  font-size: 1.1rem;
}
.blizzard-vaso {
  position: absolute;
  bottom: 8px;
  transform: translateX(-50%);
  font-size: 54px;
  user-select: none;
  pointer-events: none;
}
.vaso-pop { animation: vasoPop 0.25s ease; }
@keyframes vasoPop {
  50% { transform: translateX(-50%) scale(1.3) rotate(-6deg); }
}
.brownie {
  position: absolute;
  top: 0;
  font-size: 30px;
  user-select: none;
  pointer-events: none;
}
.blizzard-banner {
  text-align: center;
  font-weight: 700;
  color: var(--exito);
  font-size: 1.1rem;
  margin-bottom: 14px;
}

/* panel de lego con ambientación de fondo (Radiator Springs, Berk…) */
.lego-panel.con-fondo {
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  background-color: var(--pergamino-claro);
  border-width: 3px;
  min-height: 430px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.lego-panel.con-fondo h3,
.lego-panel.con-fondo .lego-descripcion {
  background: rgba(249, 240, 216, 0.85);
  border-radius: 8px;
  padding: 4px 14px;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

/* ─── Caja fuerte (Documentos importantes) ─── */
.caja-fuerte {
  width: min(280px, 80vw);
  margin: 0 auto;
  position: relative;
  perspective: 1000px;
  cursor: pointer;
  user-select: none;
}
.caja-interior {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 40%, #3d434a, #1d2126);
  border-radius: 16px;
  border: 6px solid #454b52;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 68px;
  box-shadow: inset 0 0 34px rgba(0, 0, 0, 0.8);
}
.caja-brillo {
  filter: drop-shadow(0 0 16px rgba(245, 197, 66, 0.85));
  animation: brilloDoc 1.6s ease-in-out infinite;
}
@keyframes brilloDoc { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }
.caja-puerta {
  position: relative;
  z-index: 2;
  background: linear-gradient(145deg, #aab3bb, #79828b);
  border: 6px solid #5b636b;
  border-radius: 16px;
  padding: 16px 22px 20px;
  transform-origin: left center;
  transition: transform 1.15s cubic-bezier(0.55, 0.05, 0.35, 1);
  box-shadow: inset 0 2px 6px rgba(255,255,255,0.35), inset 0 -4px 8px rgba(0,0,0,0.25), 0 10px 24px rgba(0,0,0,0.35);
}
.caja-fuerte.abierta .caja-puerta { transform: rotateY(-108deg); }
.caja-dial-svg { display: block; width: 100%; height: auto; }
.caja-leds { text-align: center; margin-bottom: 8px; }
.led {
  display: inline-block;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #454b52;
  border: 2px solid #333;
  margin: 0 6px;
}
.led.on { background: #6fe07a; box-shadow: 0 0 10px #6fe07a; }
.caja-manija {
  position: absolute;
  right: 8px; top: 50%;
  width: 10px; height: 56px;
  transform: translateY(-50%);
  background: linear-gradient(180deg, #cdd5dc, #8a939c);
  border: 2px solid #5b636b;
  border-radius: 6px;
}
.caja-estado {
  text-align: center;
  margin-top: 12px;
  font-weight: 600;
  min-height: 1.4em;
}
.caja-sacudida { animation: sacudirCaja 0.4s ease; }
@keyframes sacudirCaja {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  50% { transform: translateX(6px); }
  75% { transform: translateX(-4px); }
}

/* ─── Documentos ─── */
.documentos { display: flex; flex-direction: column; gap: 16px; }
.documento-tapa {
  width: 100%;
  display: flex; align-items: center; gap: 14px;
  background: var(--pergamino-claro);
  border: 2px solid var(--tinta-suave);
  border-radius: 8px;
  padding: 16px 18px;
  cursor: pointer;
  font-family: 'Quicksand', sans-serif;
  transition: transform 0.15s ease;
}
.documento-tapa:hover { transform: translateX(4px); }
.documento-sello { font-size: 1.8rem; }
.documento-nombre { flex: 1; text-align: left; font-weight: 700; font-size: 1.05rem; color: var(--tinta); }
.documento-clasificado {
  font-family: 'IM Fell English', serif;
  color: var(--error);
  border: 1.5px solid var(--error);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 0.72rem;
  letter-spacing: 2px;
  transform: rotate(-4deg);
  opacity: 0.85;
}
.documento-interior { display: none; padding: 16px 10px 4px; animation: aparecer 0.4s ease; }
.documento-interior p { font-style: italic; line-height: 1.6; margin-bottom: 12px; font-weight: 500; }
.documento[data-abierto="si"] .documento-interior { display: block; }
.documento[data-abierto="si"] .documento-tapa { border-color: var(--acento); }

/* ─── Rescate de Mazapán ─── */
.rescate-arena {
  position: relative;
  height: 380px;
  background:
    radial-gradient(ellipse at 50% 100%, rgba(120,85,40,0.2), transparent 60%),
    var(--pergamino-claro);
  border: 2px dashed var(--tinta-suave);
  border-radius: 10px;
  overflow: hidden;
}
.rescate-instruccion {
  position: absolute; top: 0; left: 0; right: 0;
  text-align: center;
  padding: 10px;
  font-weight: 600;
  background: rgba(243, 229, 194, 0.9);
  border-bottom: 1.5px dashed var(--tinta-suave);
  z-index: 2;
}
.rescate-mau {
  position: absolute;
  width: 84px;
  cursor: pointer;
  transition: left 0.55s ease, top 0.55s ease;
  z-index: 1;
}
.rescate-mau-svg svg { width: 100%; height: auto; }
.rescate-mazapan-mini {
  position: absolute; top: 34px; right: -26px; width: 44px;
  transform: rotate(24deg);
}
.rescate-mazapan-mini svg, .rescate-mazapan-mini img { width: 100%; height: auto; }
.rescate-mau.golpeado { filter: brightness(1.4) saturate(0.4); transform: scale(0.92); }
.rescate-contador {
  position: absolute; bottom: 8px; left: 0; right: 0;
  text-align: center; font-size: 1.3rem; letter-spacing: 4px;
}
.rescate-festejo { display: flex; align-items: center; gap: 14px; justify-content: center; margin-bottom: 18px; flex-wrap: wrap; }
.mazapan-feliz { animation: brincar 0.7s ease infinite; }
@keyframes brincar { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-12px) rotate(-3deg); } }

/* ─── Conciertos: luces de escenario ─── */
.concierto-escenario {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  padding-top: 6px;
}
.concierto-escenario::before {
  content: '';
  position: absolute;
  left: 50%; top: 55%;
  width: 70%; height: 70%;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse, rgba(255, 170, 220, 0.35), transparent 65%);
  animation: pulsoEscenario 2.6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes pulsoEscenario { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }
.luz {
  position: absolute;
  top: -14px;
  width: 110px;
  height: 105%;
  clip-path: polygon(44% 0, 56% 0, 100% 100%, 0 100%);
  transform-origin: 50% 0;
  pointer-events: none;
  z-index: 2;
}
.luz-a { left: 12%; background: linear-gradient(180deg, rgba(255, 60, 170, 0.5), rgba(255, 60, 170, 0)); animation: barridoLuz 3.2s ease-in-out infinite alternate; }
.luz-b { right: 12%; background: linear-gradient(180deg, rgba(60, 190, 255, 0.5), rgba(60, 190, 255, 0)); animation: barridoLuz 3.6s ease-in-out infinite alternate-reverse; }
.luz-c { left: 32%; background: linear-gradient(180deg, rgba(255, 200, 60, 0.42), rgba(255, 200, 60, 0)); animation: barridoLuz 2.7s ease-in-out 0.6s infinite alternate-reverse; }
.luz-d { right: 32%; background: linear-gradient(180deg, rgba(170, 90, 255, 0.42), rgba(170, 90, 255, 0)); animation: barridoLuz 4.1s ease-in-out 0.3s infinite alternate; }
@keyframes barridoLuz {
  from { transform: rotate(-26deg); }
  to   { transform: rotate(26deg); }
}

/* boleto pendiente pero con fecha confirmada */
.boleto-confirmado {
  opacity: 1;
  filter: none;
  border-color: var(--acento);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--acento) 30%, transparent);
}

/* ─── Conciertos (boletos) ─── */
.boletos { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-bottom: 14px; }
.boleto {
  display: flex;
  background: var(--pergamino-claro);
  border: 2px solid var(--tinta-suave);
  border-radius: 8px;
  overflow: hidden;
  width: min(270px, 100%);
  box-shadow: 3px 4px 10px rgba(74,56,38,0.2);
}
.boleto-vivido { cursor: pointer; transition: transform 0.15s ease; }
.boleto-vivido:hover { transform: translateY(-3px) rotate(-0.8deg); }
.boleto-vivido.activo { border-color: var(--acento); box-shadow: 0 0 0 3px color-mix(in srgb, var(--acento) 35%, transparent); }
.boleto-perforacion {
  width: 22px;
  border-right: 2px dashed var(--tinta-suave);
  background:
    radial-gradient(circle at 50% 12%, var(--pergamino) 5px, transparent 6px),
    radial-gradient(circle at 50% 88%, var(--pergamino) 5px, transparent 6px),
    color-mix(in srgb, var(--acento) 30%, var(--pergamino-claro));
}
.boleto-cuerpo { padding: 12px 16px; flex: 1; }
.boleto-admision {
  font-size: 0.62rem; letter-spacing: 2.5px; font-weight: 700;
  color: var(--tinta-suave);
}
.boleto-cuerpo h3 { font-family: 'IM Fell English', serif; font-size: 1.2rem; margin: 2px 0; }
.boleto-cuerpo p { font-size: 0.85rem; font-style: italic; color: var(--tinta-suave); }
.boleto-pendiente { opacity: 0.65; filter: grayscale(0.35); }
.boletos-chicos .boleto { width: min(220px, 100%); }

/* ─── TO DO list: libreta y papelería ─── */
.todo-zona { position: relative; }
.todo-deco {
  position: absolute;
  font-size: 1.9rem;
  pointer-events: none;
  z-index: 1;
  opacity: 0.9;
  filter: drop-shadow(2px 3px 3px rgba(30, 18, 5, 0.25));
}
.deco-lapiz {
  top: 34%; right: -6px;
  font-size: 2.6rem;
  animation: escribir 1.6s ease-in-out infinite;
  transform-origin: 80% 80%;
}
@keyframes escribir {
  0%, 100% { transform: rotate(8deg) translateY(0); }
  25%      { transform: rotate(2deg) translateY(3px); }
  50%      { transform: rotate(10deg) translateY(-2px); }
  75%      { transform: rotate(4deg) translateY(2px); }
}
.deco-clip { top: 6%; left: 0; transform: rotate(-24deg); }
.deco-check { bottom: 10%; left: 8px; animation: pulsoCheck 2.2s ease-in-out infinite; }
@keyframes pulsoCheck { 0%, 100% { transform: scale(1) rotate(-8deg); } 50% { transform: scale(1.25) rotate(4deg); } }
.deco-nota { top: 8%; right: 4px; transform: rotate(14deg); }
.deco-regla { bottom: 8%; right: 10px; transform: rotate(-40deg); }

.todo-papel {
  position: relative;
  background:
    repeating-linear-gradient(0deg, transparent 0 30px, rgba(63, 106, 138, 0.16) 30px 31px),
    linear-gradient(90deg, transparent 0 34px, rgba(165, 63, 46, 0.35) 34px 36px, transparent 36px),
    #fdfaf1;
  border: 1.5px solid rgba(74, 56, 38, 0.3);
  border-radius: 4px;
  box-shadow: 3px 5px 14px rgba(30, 18, 5, 0.22);
  padding: 20px 20px 16px 48px;
  transform: rotate(-0.5deg);
  margin-bottom: 20px;
}
.todo-pin {
  position: absolute;
  top: -14px;
  font-size: 1.7rem;
  filter: drop-shadow(2px 3px 3px rgba(30, 18, 5, 0.3));
}
.todo-pin-a { left: 12%; transform: rotate(-14deg); }
.todo-pin-b { right: 12%; transform: rotate(18deg); }

/* ─── TO DO list ─── */
.todo-lista {
  columns: 2;
  column-gap: 26px;
  margin-bottom: 20px;
}
@media (max-width: 640px) { .todo-lista { columns: 1; } }
.todo-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 7px 8px;
  border-radius: 6px;
  cursor: pointer;
  break-inside: avoid;
  transition: background 0.15s;
  font-weight: 500;
}
.todo-item:hover { background: rgba(74, 56, 38, 0.07); }
.todo-item input { display: none; }
.todo-caja {
  width: 20px; height: 20px; flex-shrink: 0;
  border: 2px solid var(--tinta-suave);
  border-radius: 4px;
  background: var(--pergamino-claro);
  position: relative;
  margin-top: 1px;
}
.todo-item input:checked + .todo-caja::after {
  content: '✔';
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--acento);
  font-weight: 800;
}
.todo-item.correcto { background: color-mix(in srgb, var(--exito) 16%, transparent); }
.todo-item.incorrecto { background: color-mix(in srgb, var(--error) 16%, transparent); }
.todo-acciones { text-align: center; }
.todo-resultado { margin-top: 12px; font-weight: 700; min-height: 1.4em; }
.todo-resultado.exito { color: var(--exito); }
.todo-resultado.error { color: var(--error); }

/* ─── Cartas (dates) ─── */
.cartas { display: flex; flex-wrap: wrap; gap: 18px; justify-content: center; }
.carta {
  width: min(250px, 100%);
  cursor: pointer;
}
.carta-frente {
  background: var(--pergamino-claro);
  border: 2px solid var(--tinta-suave);
  border-radius: 10px;
  padding: 24px 18px;
  text-align: center;
  box-shadow: 3px 5px 12px rgba(74,56,38,0.25);
  transition: transform 0.15s ease;
  position: relative;
}
.carta:hover .carta-frente { transform: translateY(-4px) rotate(0.8deg); }
.carta-emoji { font-size: 2.6rem; display: block; margin-bottom: 8px; }
.carta-frente h3 { font-family: 'IM Fell English', serif; font-size: 1.25rem; }
.carta-nota {
  margin-top: 10px;
  background: #f6e3b0;
  border: 1.5px dashed var(--error);
  color: var(--error);
  border-radius: 6px;
  padding: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  transform: rotate(-2deg);
}
.carta-nota small { color: var(--tinta-suave); font-weight: 600; }
.carta-reverso { display: none; position: relative; margin-top: 10px; animation: aparecer 0.4s ease; }

/* ── efecto teatrito: lluvia de risas ── */
.fx-risas { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 2; }
.risa {
  position: absolute;
  bottom: -30px;
  font-size: 1.5rem;
  opacity: 0;
  animation: subirRisa 3.2s ease-in infinite;
}
.risa-0 { left: 5%; animation-delay: 0s; }
.risa-1 { left: 25%; animation-delay: 1.1s; font-size: 1.2rem; }
.risa-2 { left: 45%; animation-delay: 0.5s; }
.risa-3 { left: 62%; animation-delay: 1.7s; }
.risa-4 { left: 80%; animation-delay: 0.8s; font-size: 1.2rem; }
.risa-5 { left: 92%; animation-delay: 2.2s; }
@keyframes subirRisa {
  0%   { transform: translateY(0) rotate(-14deg) scale(0.8); opacity: 0; }
  15%  { opacity: 1; }
  100% { transform: translateY(-300px) rotate(14deg) scale(1.25); opacity: 0; }
}

/* ── efecto boliche: la chuza ── */
.fx-chuza {
  position: relative;
  height: 74px;
  margin-bottom: 12px;
  background: linear-gradient(180deg, #caa26b, #b78c52);
  border-radius: 8px;
  border: 1.5px solid rgba(74, 56, 38, 0.4);
  overflow: hidden;
  box-shadow: inset 0 3px 8px rgba(30, 18, 5, 0.25);
}
.bola-boliche {
  position: absolute;
  left: 6px;
  bottom: 12px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, #7a4a66, #3a1f30 70%);
  animation: rodarBola 3s ease-in infinite;
}
@keyframes rodarBola {
  0%   { transform: translateX(0) rotate(0); opacity: 1; }
  40%  { transform: translateX(240px) rotate(540deg); opacity: 1; }
  46%  { transform: translateX(300px) rotate(620deg); opacity: 0; }
  95%  { opacity: 0; }
  100% { transform: translateX(0) rotate(0); opacity: 1; }
}
.pino {
  position: absolute;
  bottom: 12px;
  width: 13px; height: 38px;
  background: linear-gradient(180deg, #fdfaf1 55%, #c0392b 55%, #c0392b 66%, #fdfaf1 66%);
  border-radius: 45% 45% 40% 40%;
  border: 1.5px solid rgba(74, 56, 38, 0.4);
}
.pino-1 { right: 46px; animation: volarPino 3s ease-in infinite; }
.pino-2 { right: 28px; bottom: 16px; animation: volarPino2 3s ease-in infinite; }
.pino-3 { right: 10px; animation: volarPino3 3s ease-in infinite; }
@keyframes volarPino {
  0%, 40%  { transform: translate(0, 0) rotate(0); opacity: 1; }
  70%      { transform: translate(-34px, -46px) rotate(-130deg); opacity: 0; }
  71%, 92% { opacity: 0; }
  100%     { transform: translate(0, 0) rotate(0); opacity: 1; }
}
@keyframes volarPino2 {
  0%, 41%  { transform: translate(0, 0) rotate(0); opacity: 1; }
  70%      { transform: translate(10px, -56px) rotate(150deg); opacity: 0; }
  71%, 92% { opacity: 0; }
  100%     { transform: translate(0, 0) rotate(0); opacity: 1; }
}
@keyframes volarPino3 {
  0%, 42%  { transform: translate(0, 0) rotate(0); opacity: 1; }
  70%      { transform: translate(30px, -40px) rotate(120deg); opacity: 0; }
  71%, 92% { opacity: 0; }
  100%     { transform: translate(0, 0) rotate(0); opacity: 1; }
}
.impacto-chuza {
  position: absolute;
  right: 20px;
  bottom: 22px;
  font-size: 1.6rem;
  opacity: 0;
  animation: estallarChuza 3s ease-out infinite;
}
@keyframes estallarChuza {
  0%, 39% { opacity: 0; transform: scale(0.4); }
  45%     { opacity: 1; transform: scale(1.3); }
  62%     { opacity: 0; transform: scale(1); }
  100%    { opacity: 0; }
}

/* ── efecto pintar: manchas y brocha ── */
.mancha {
  position: absolute;
  width: 44px; height: 40px;
  border-radius: 62% 38% 55% 45% / 48% 60% 40% 55%;
  opacity: 0.8;
  pointer-events: none;
  z-index: 2;
  animation: aparecerMancha 0.6s ease backwards, latirMancha 3.4s ease-in-out infinite;
}
.mancha-1 { top: -8px; left: -6px; background: #d4552e; animation-delay: 0.1s, 0s; }
.mancha-2 { top: 20%; right: -10px; background: #3f6a8a; width: 36px; animation-delay: 0.3s, 0.7s; }
.mancha-3 { bottom: 8%; left: -8px; background: #d9a622; width: 32px; animation-delay: 0.5s, 1.2s; }
.mancha-4 { bottom: -10px; right: 12%; background: #4e7248; animation-delay: 0.7s, 0.4s; }
.mancha-5 { top: 45%; left: 40%; background: #8a4a9e; width: 26px; height: 24px; opacity: 0.55; animation-delay: 0.9s, 1.6s; }
@keyframes aparecerMancha { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes latirMancha { 0%, 100% { transform: scale(1) rotate(0); } 50% { transform: scale(1.12) rotate(6deg); } }
.brocha-fx {
  position: absolute;
  top: -16px; right: 26%;
  font-size: 2rem;
  z-index: 2;
  pointer-events: none;
  animation: pintarBrocha 2.2s ease-in-out infinite;
  transform-origin: 85% 15%;
}
@keyframes pintarBrocha {
  0%, 100% { transform: rotate(-18deg) translateX(0); }
  50%      { transform: rotate(10deg) translateX(14px); }
}

/* ── efecto romper cosas: el jarrón que no sobrevive ── */
.fx-romper {
  position: relative;
  height: 84px;
  margin-bottom: 10px;
  pointer-events: none;
}
.rompible {
  position: absolute;
  left: 50%;
  top: 0;
  font-size: 2.2rem;
  transform: translateX(-50%);
  animation: caerObjeto 2.8s ease-in infinite;
}
@keyframes caerObjeto {
  0%       { transform: translate(-50%, 0) rotate(0); opacity: 1; }
  38%      { transform: translate(-50%, 38px) rotate(14deg); opacity: 1; }
  42%, 96% { opacity: 0; }
  100%     { transform: translate(-50%, 0) rotate(0); opacity: 1; }
}
.estallido {
  position: absolute;
  left: 50%;
  bottom: 4px;
  transform: translateX(-50%);
  font-size: 2rem;
  opacity: 0;
  animation: estallarObjeto 2.8s ease-out infinite;
}
@keyframes estallarObjeto {
  0%, 37% { opacity: 0; transform: translateX(-50%) scale(0.4); }
  44%     { opacity: 1; transform: translateX(-50%) scale(1.35); }
  62%     { opacity: 0; transform: translateX(-50%) scale(1); }
  100%    { opacity: 0; }
}
.esquirla {
  position: absolute;
  left: 50%;
  bottom: 14px;
  font-size: 0.8rem;
  color: #6b7a8a;
  opacity: 0;
  animation: volarEsquirla 2.8s ease-out infinite;
}
.esq-1 { --ex: -36px; --ey: -30px; }
.esq-2 { --ex: 30px;  --ey: -40px; animation-delay: 0.04s; }
.esq-3 { --ex: -18px; --ey: -52px; animation-delay: 0.08s; }
.esq-4 { --ex: 42px;  --ey: -18px; animation-delay: 0.02s; }
@keyframes volarEsquirla {
  0%, 38% { opacity: 0; transform: translate(0, 0) rotate(0); }
  44%     { opacity: 1; }
  78%     { opacity: 0; transform: translate(var(--ex), var(--ey)) rotate(200deg); }
  100%    { opacity: 0; }
}
.carta[data-volteada="si"] .carta-reverso { display: block; }
.carta[data-volteada="si"] .carta-frente { border-color: var(--acento); }

/* ── efecto acampar: noche de fogata ── */
.fx-fogata {
  position: relative;
  height: 96px;
  margin-bottom: 12px;
  border-radius: 10px;
  background: linear-gradient(180deg, #1d2a44 0%, #2c3a58 70%, #3a3020 100%);
  overflow: hidden;
  border: 1.5px solid rgba(74, 56, 38, 0.45);
}
.estrella-noche {
  position: absolute;
  color: #ffe9a8;
  font-size: 0.85rem;
  animation: titilar 2.2s ease-in-out infinite;
}
.en-1 { top: 10px; left: 10%; }
.en-2 { top: 22px; left: 30%; animation-delay: 0.6s; font-size: 0.7rem; }
.en-3 { top: 8px;  left: 55%; animation-delay: 1.1s; }
.en-4 { top: 18px; left: 76%; animation-delay: 0.3s; font-size: 0.75rem; }
.en-5 { top: 34px; left: 88%; animation-delay: 1.5s; font-size: 0.65rem; }
@keyframes titilar { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
.luna-noche { position: absolute; top: 8px; right: 12px; font-size: 1.3rem; filter: drop-shadow(0 0 8px rgba(255, 233, 168, 0.6)); }
.fuego {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.9rem;
  transform-origin: bottom center;
  animation: flamear 0.5s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 14px rgba(255, 140, 40, 0.8));
}
@keyframes flamear {
  from { transform: translateX(-50%) scale(1, 1) rotate(-2deg); }
  to   { transform: translateX(-52%) scale(1.08, 1.16) rotate(2deg); }
}
.tronco { position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%); font-size: 1.2rem; }
.chispa {
  position: absolute;
  bottom: 40px;
  left: 50%;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: #ffb347;
  opacity: 0;
  animation: subirChispa 1.7s ease-out infinite;
}
.chi-1 { --cx: -14px; animation-delay: 0s; }
.chi-2 { --cx: 10px;  animation-delay: 0.6s; }
.chi-3 { --cx: 2px;   animation-delay: 1.1s; width: 3px; height: 3px; }
@keyframes subirChispa {
  0%   { transform: translate(0, 0); opacity: 0; }
  15%  { opacity: 1; }
  100% { transform: translate(var(--cx), -46px); opacity: 0; }
}

/* ─── Ascenso (Bernal) ─── */
.bugambilia {
  position: absolute;
  top: -26px;
  width: min(150px, 18vw);
  pointer-events: none;
  transform-origin: top center;
  transform: scale(var(--sx, 1), 1);
  animation: mecerEnredadera 4.6s ease-in-out infinite;
  filter: drop-shadow(0 5px 6px rgba(30, 18, 5, 0.3));
  z-index: 1;
}
.bugambilia-izq { left: 2%; }
.bugambilia-der { right: 2%; --sx: -1; animation-delay: 1.9s; }
.ascenso { display: flex; flex-direction: column; align-items: center; gap: 10px; position: relative; }
.sendero-deco {
  position: absolute;
  font-size: 1.9rem;
  pointer-events: none;
  z-index: 1;
  opacity: 0.95;
  filter: drop-shadow(2px 3px 3px rgba(30, 18, 5, 0.25));
}
.sd-1 { top: 4%;  left: 12%; font-size: 2.1rem; }
.sd-2 { top: 11%; right: 14%; }
.sd-3 { top: 18%; left: 7%; }
.sd-4 { top: 24%; right: 8%; animation: planearAve 5s ease-in-out infinite alternate; }
.sd-5 { top: 30%; left: 4%; opacity: 0.8; animation: derivarNube 7s ease-in-out infinite alternate; }
.sd-6 { top: 37%; right: 11%; font-size: 1.6rem; }
.sd-7 { top: 44%; left: 12%; }
.sd-8 { top: 50%; right: 5%; opacity: 0.8; animation: derivarNube 6s ease-in-out 1.5s infinite alternate-reverse; }
.sd-9  { top: 56%; left: 6%; font-size: 1.5rem; }
.sd-10 { top: 61%; right: 14%; font-size: 1.4rem; animation: planearAve 4s ease-in-out 0.5s infinite alternate; }
.sd-11 { top: 66%; left: 13%; font-size: 1.6rem; }
.sd-12 { top: 72%; right: 8%; font-size: 2rem; }
.sd-13 { top: 77%; left: 5%; font-size: 1.4rem; animation: planearAve 6s ease-in-out 1s infinite alternate-reverse; }
.sd-14 { top: 82%; right: 13%; font-size: 1.7rem; }
.sd-15 { top: 86%; left: 9%; opacity: 0.75; animation: derivarNube 8s ease-in-out 0.8s infinite alternate; }
.sd-16 { top: 90%; right: 6%; font-size: 1.5rem; }
.sd-17 { top: 94%; left: 14%; font-size: 1.7rem; }
.sd-18 { top: 97%; right: 12%; font-size: 1.8rem; }
.sd-19 { top: 14%; left: 45%; font-size: 1.3rem; opacity: 0.75; animation: planearAve 7s ease-in-out 2s infinite alternate; }
.sd-20 { top: 68%; left: 47%; font-size: 1.3rem; opacity: 0.6; }
@keyframes planearAve {
  from { transform: translate(0, 0) rotate(-4deg); }
  to   { transform: translate(-30px, -14px) rotate(6deg); }
}
@keyframes derivarNube {
  from { transform: translateX(0); }
  to   { transform: translateX(26px); }
}
.ascenso .collage { flex-direction: column; align-items: center; }
.ascenso-cima, .ascenso-base {
  font-family: 'Pirata One', serif;
  font-size: 1.2rem;
  color: var(--tinta);
  padding: 8px 20px;
  border: 2px solid var(--tinta-suave);
  border-radius: 50px;
  background: var(--pergamino-claro);
}

/* ─── El Tesoro de la Locura ─── */
.locura-zona {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  padding: 14px 10px 20px;
  background:
    repeating-linear-gradient(-45deg,
      rgba(255, 60, 170, 0.06) 0 28px,
      rgba(60, 190, 255, 0.06) 28px 56px,
      rgba(255, 200, 60, 0.08) 56px 84px,
      rgba(170, 90, 255, 0.06) 84px 112px);
}
.locura-titulo {
  font-family: 'Pirata One', serif;
  font-size: clamp(1.3rem, 4vw, 1.9rem);
  text-align: center;
  color: var(--error);
  letter-spacing: 3px;
  margin-bottom: 14px;
  animation: tambaleo 1.1s ease-in-out infinite;
}
@keyframes tambaleo {
  0%, 100% { transform: rotate(-2.5deg) scale(1); }
  50%      { transform: rotate(2.5deg) scale(1.04); }
}
.loco-flotante {
  position: absolute;
  font-size: 2.1rem;
  pointer-events: none;
  z-index: 1;
  opacity: 0.9;
  animation: locoFlotar 2.8s ease-in-out infinite alternate;
}
.loco-0 { top: 5%;  left: 2%;  animation-duration: 2.3s; }
.loco-1 { top: 8%;  right: 3%; animation-duration: 3.1s; animation-delay: 0.4s; }
.loco-2 { top: 42%; left: 1%;  animation-duration: 2.7s; animation-delay: 0.8s; }
.loco-3 { top: 48%; right: 2%; animation-duration: 2.2s; animation-delay: 0.2s; }
.loco-4 { bottom: 6%; left: 4%;  animation-duration: 3.4s; animation-delay: 0.6s; }
.loco-5 { bottom: 9%; right: 5%; animation-duration: 2.5s; animation-delay: 1s; }
.loco-6 { top: 24%; left: 47%; animation-duration: 2.9s; animation-delay: 0.3s; }
.loco-7 { bottom: 30%; right: 40%; animation-duration: 2.4s; animation-delay: 0.7s; }
@keyframes locoFlotar {
  from { transform: translateY(0) rotate(-24deg) scale(1); }
  to   { transform: translateY(-24px) rotate(24deg) scale(1.3); }
}
/* polaroids bailarinas: giros más locos y meneo constante */
.collage-loco .polaroid { animation: bailoteo 2.6s ease-in-out infinite; }
.collage-loco .polaroid:nth-child(odd)  { --rot: 6deg; animation-duration: 3.1s; }
.collage-loco .polaroid:nth-child(even) { --rot: -7deg; animation-duration: 2.4s; }
.collage-loco .polaroid:nth-child(3n)   { --rot: 9deg; animation-delay: 0.5s; }
@keyframes bailoteo {
  0%, 100% { transform: rotate(var(--rot)) translateY(0); }
  50%      { transform: rotate(calc(var(--rot) * -0.7)) translateY(-6px); }
}

/* ─── Escalada de la Peña (mini-juego) ─── */
.escalada-arena {
  position: relative;
  height: 350px;
  background:
    linear-gradient(180deg, #cfe0ec 0%, #e8d8b4 34%, #d3b47c 70%, #b98f56 100%);
  border: 2px dashed var(--tinta-suave);
  border-radius: 10px;
  overflow: hidden;
  touch-action: none;
}
.escalada-marcador {
  position: absolute;
  top: 8px; left: 0; right: 0;
  text-align: center;
  font-weight: 700;
  font-size: 1.1rem;
  z-index: 2;
}
.escalada-escalador {
  position: absolute;
  bottom: 8px;
  transform: translateX(-50%);
  font-size: 46px;
  user-select: none;
  pointer-events: none;
}
.roca-caida {
  position: absolute;
  top: 0;
  font-size: 27px;
  user-select: none;
  pointer-events: none;
}
.arena-golpe { animation: golpeArena 0.45s ease; }
@keyframes golpeArena {
  0%, 100% { box-shadow: none; }
  30% { box-shadow: inset 0 0 0 6px rgba(165, 63, 46, 0.55); }
}

/* ─── Gran final: cofre de oro ─── */
.final-caja {
  position: relative;
  overflow: hidden;
  background: var(--pergamino);
  border: 2.5px solid var(--tinta-suave);
  border-radius: 12px;
  padding: 30px 28px 22px;
  max-width: 580px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  text-align: center;
  box-shadow: var(--sombra), inset 0 0 50px rgba(120, 85, 40, 0.18);
}
.final-confeti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confeti {
  position: absolute;
  top: -18px;
  width: 9px; height: 15px;
  border-radius: 2px;
  animation: caerConfeti linear infinite;
}
@keyframes caerConfeti {
  0%   { transform: translateY(0) rotate(0); opacity: 1; }
  100% { transform: translateY(720px) rotate(680deg); opacity: 0.6; }
}
.final-titulo {
  font-family: 'Pirata One', serif;
  font-size: clamp(1.5rem, 5vw, 2.2rem);
  color: var(--tinta);
  animation: latido 1.8s ease-in-out infinite;
}
.final-sub {
  font-family: 'IM Fell English', serif;
  font-style: italic;
  color: var(--tinta-suave);
  margin: 4px 0 10px;
}
.cofre-final { width: min(260px, 65vw); margin: 0 auto; }
.cofre-final svg { width: 100%; height: auto; filter: drop-shadow(0 8px 18px rgba(245, 197, 66, 0.4)); }
.brillo-cofre { animation: titilar 1.8s ease-in-out infinite; }
.brillo-cofre.b2 { animation-delay: 0.6s; }
.brillo-cofre.b3 { animation-delay: 1.1s; }
.final-hint { font-style: italic; color: var(--tinta-suave); margin: 6px 0 12px; }
.final-items { display: flex; gap: 18px; justify-content: center; margin-bottom: 14px; }
.final-item {
  font-family: 'IM Fell English', serif;
  font-size: 1.05rem;
  color: var(--tinta);
  background: var(--pergamino-claro);
  border: 2px solid var(--acento);
  border-radius: 12px;
  padding: 12px 22px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  box-shadow: 0 4px 10px rgba(30, 18, 5, 0.25);
  transition: transform 0.15s ease;
  animation: latido 2.2s ease-in-out infinite;
}
.final-item:hover { transform: translateY(-4px) scale(1.05); }
.final-item-icono { font-size: 2.3rem; }
.final-panel {
  background: var(--pergamino-claro);
  border: 1.5px dashed var(--tinta-suave);
  border-radius: 8px;
  padding: 18px 20px;
  margin-bottom: 14px;
  animation: aparecer 0.4s ease;
}
.final-carta-texto {
  font-family: 'IM Fell English', serif;
  font-size: 1.14rem;
  line-height: 1.85;
  text-align: left;
}
.final-carta-texto p { margin-bottom: 14px; }
.carta-encabezado {
  text-align: center;
  font-size: 0.82rem;
  letter-spacing: 3px;
  color: var(--tinta-suave);
  border-bottom: 1.5px solid rgba(74, 56, 38, 0.3);
  padding-bottom: 10px;
  margin-bottom: 18px;
  text-transform: uppercase;
}
.carta-firma {
  text-align: right;
  font-style: italic;
  color: var(--tinta-suave);
  margin-top: 18px;
}
.carta-postdata {
  font-size: 1rem;
  font-style: italic;
  color: var(--tinta-suave);
  border-top: 1.5px dashed rgba(74, 56, 38, 0.3);
  padding-top: 12px;
  margin-top: 6px;
}
.final-insignia p { font-weight: 500; line-height: 1.6; margin: 10px 0 16px; }
.final-insignia-medalla { font-size: 3.4rem; animation: latido 1.4s ease-in-out infinite; }
.insignia-img {
  width: min(230px, 60%);
  height: auto;
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 8px 16px rgba(245, 197, 66, 0.5));
  animation: latido 2.6s ease-in-out infinite;
}
.insignia-botones { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn-descarga {
  background: linear-gradient(180deg, #a8842c, #8a6a1e);
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  text-decoration: none;
  display: inline-block;
}
.insignia-tip {
  font-size: 0.9rem !important;
  font-style: italic;
  color: var(--tinta-suave);
  margin: 12px 0 0 !important;
}
/* botón sobre pergamino: el estilo fantasma se pierde en fondo claro */
#btn-final-cerrar {
  margin-top: 8px;
  color: var(--tinta);
  background: var(--pergamino-claro);
  border: 2px solid var(--tinta-suave);
  font-family: 'IM Fell English', serif;
  font-size: 1.05rem;
  padding: 10px 22px;
  box-shadow: 0 3px 8px rgba(30, 18, 5, 0.25);
}
#btn-final-cerrar:hover { background: var(--pergamino-oscuro); }
.btn-wa {
  background: linear-gradient(180deg, #2ebd5f, #1da84e);
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
}

/* ═══════════ OVERLAYS ═══════════ */
.overlay {
  position: fixed; inset: 0;
  background: rgba(20, 12, 4, 0.75);
  display: flex; align-items: center; justify-content: center;
  z-index: 50;
  padding: 18px;
  animation: aparecer 0.3s ease;
}
.alerta-mazapan {
  display: flex; align-items: flex-end; gap: 0;
  max-width: 560px; width: 100%;
}
.mazapan-alerta { width: 130px; flex-shrink: 0; margin-right: -22px; z-index: 2; }
.alerta-caja {
  background: var(--pergamino);
  border: 2.5px solid var(--tinta-suave);
  border-radius: 10px;
  padding: 24px 24px 20px 40px;
  box-shadow: var(--sombra);
  flex: 1;
}
.alerta-caja h3 {
  font-family: 'Pirata One', serif;
  font-size: 1.5rem;
  margin-bottom: 10px;
  color: var(--tinta);
}
.alerta-caja p { line-height: 1.6; font-weight: 500; margin-bottom: 18px; }
.alerta-botones { display: flex; gap: 12px; flex-wrap: wrap; }
.alerta-botones .btn-fantasma { color: var(--tinta-suave); border-color: var(--tinta-suave); }

.desbloqueo-caja {
  background: var(--pergamino);
  border: 2.5px solid var(--tinta-suave);
  border-radius: 10px;
  padding: 40px 36px;
  text-align: center;
  box-shadow: var(--sombra);
  max-width: 420px;
}
.desbloqueo-brillo { font-size: 3rem; color: var(--acento); animation: girarBrillo 2.4s linear infinite; display: inline-block; }
@keyframes girarBrillo { from { transform: rotate(0) scale(1); } 50% { transform: rotate(180deg) scale(1.25); } to { transform: rotate(360deg) scale(1); } }
.desbloqueo-caja h3 { font-family: 'Pirata One', serif; font-size: 1.7rem; margin: 8px 0 6px; }
.desbloqueo-caja p { font-family: 'IM Fell English', serif; font-style: italic; font-size: 1.15rem; margin-bottom: 22px; color: var(--tinta-suave); }

/* ─── Fotos y videos reales ─── */
.polaroid-foto { cursor: zoom-in; }
.polaroid-video { width: 250px; }
.polaroid-video .polaroid-foto { cursor: default; aspect-ratio: auto; background: #1a1410; }
.polaroid-video video { width: 100%; max-height: 320px; display: block; }
.polaroid-prologo { width: min(250px, 60vw); margin: 0 auto; }
.polaroid-destacada { width: 290px; border: 3px solid var(--acento); }
.polaroid-ascenso { width: 210px; }

/* ─── Dedicatoria (Yatra) ─── */
.dedicatoria {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  flex-wrap: wrap;
  background: color-mix(in srgb, var(--acento) 8%, var(--pergamino-claro));
  border: 2px solid var(--acento);
  border-radius: 10px;
  padding: 20px;
  margin: 14px 0 18px;
}
.dedicatoria-nota {
  font-family: 'IM Fell English', serif;
  font-style: italic;
  font-size: 1.12rem;
  line-height: 1.7;
  max-width: 340px;
}
.dedicatoria-nota small { color: var(--tinta-suave); }

/* ─── Portadas de lego ─── */
.lego-portada {
  width: 120px; height: 120px;
  display: flex; align-items: center; justify-content: center;
  background: #fff;
  border-radius: 8px;
  border: 1.5px solid rgba(74, 56, 38, 0.25);
  overflow: hidden;
}
.lego-portada img { max-width: 100%; max-height: 100%; object-fit: contain; }
.decoracion-vikinga {
  text-align: center;
  font-size: 1.3rem;
  letter-spacing: 12px;
  margin-bottom: 12px;
  opacity: 0.85;
}
.tema-chimuelo {
  background:
    linear-gradient(180deg, rgba(58, 80, 64, 0.16), transparent 40%),
    repeating-linear-gradient(90deg, transparent 0 46px, rgba(74, 56, 38, 0.05) 46px 48px),
    var(--pergamino-claro);
  border-color: #3a5040;
}

/* ─── Lightbox ─── */
#lightbox { z-index: 80; cursor: zoom-out; }
.lightbox-figura {
  position: relative;
  max-width: min(92vw, 900px);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #fdfbf5;
  padding: 14px 14px 10px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.lightbox-figura img {
  max-width: 100%;
  max-height: calc(90vh - 90px);
  object-fit: contain;
}
.lightbox-cap {
  font-family: 'IM Fell English', serif;
  font-style: italic;
  font-size: 1.15rem;
  padding-top: 8px;
  color: var(--tinta);
}
.lightbox-cerrar {
  position: absolute;
  top: -16px; right: -16px;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 2px solid var(--pergamino-claro);
  background: var(--acento);
  color: var(--pergamino-claro);
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

/* ─── Tesoro del mapa ─── */
.tesoro { cursor: pointer; }
.tesoro-brillo { animation: brilloTesoro 2.2s ease-in-out infinite; }
@keyframes brilloTesoro { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }

/* ═══════════ Responsive ═══════════ */
/* En pantallas angostas el libro se apila: ilustración arriba, texto abajo */
@media (max-width: 700px) {
  .libro-abierto { flex-direction: column; padding: 10px; }
  .pagina-libro { min-height: 0; padding: 22px 18px 16px; }
  .pagina-izq {
    border-radius: 8px 8px 2px 2px;
    box-shadow: inset 0 -18px 24px -18px rgba(74, 56, 38, 0.55);
    padding-bottom: 10px;
  }
  .pagina-der {
    border-radius: 2px 2px 8px 8px;
    box-shadow: inset 0 18px 24px -18px rgba(74, 56, 38, 0.55);
  }
  .lomo { display: none; }
  .pagina-ornamento { display: none; }
}
@media (max-width: 640px) {
  .pergamino-titulo { padding: 34px 22px; }
  .mazapan-narrador { right: 0; top: -58px; }
  .mazapan-narrador .mazapan-sprite { width: 68px; }
  .mazapan-globo { max-width: 130px; font-size: 0.75rem; }
  .nivel-contenido { padding: 18px 14px; }
  .polaroid { width: 128px; }
  .mazapan-alerta { width: 92px; margin-right: -18px; }
  .alerta-caja { padding: 18px 16px 16px 30px; }
}

/* ─── Gran final: navegación entre los dos tesoros ─── */
.final-x {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 5;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--tinta-suave);
  background: var(--pergamino-claro);
  color: var(--tinta);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(30, 18, 5, 0.3);
  transition: background 0.15s ease, transform 0.15s ease;
}
.final-x:hover { background: var(--acento); color: var(--pergamino-claro); transform: scale(1.1); }

/* el tesoro que se está viendo se marca */
.final-item.activo {
  background: color-mix(in srgb, var(--acento) 16%, var(--pergamino-claro));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--acento) 35%, transparent);
  animation: none;
}

/* invitación a ver el otro tesoro, al final de la carta */
.panel-siguiente {
  text-align: center;
  border-top: 1.5px dashed rgba(74, 56, 38, 0.35);
  margin-top: 18px;
  padding-top: 16px;
}
.panel-siguiente-nota {
  font-family: 'IM Fell English', serif;
  font-style: italic;
  color: var(--tinta-suave);
  margin-bottom: 12px;
}

/* enlace discreto para regresar a la carta */
.btn-enlace {
  display: block;
  margin: 16px auto 0;
  background: none;
  border: none;
  color: var(--tinta-suave);
  font-family: 'Quicksand', sans-serif;
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: underline;
  cursor: pointer;
}
.btn-enlace:hover { color: var(--tinta); }
