/* ============================================================
   EL ORDEN DE LOS CUENTOS · Hoja de estilos
   Diseño tipo cuento infantil · Contenedores cálidos
   Optimizado para pizarra digital · Video en loop centrado
   ============================================================ */

/* ------------------------------------------------------------
   1. VARIABLES
   ------------------------------------------------------------ */
:root {
  /* Cielo de respaldo (si el video no carga) */
  --cielo-1: #4fb3e8;
  --cielo-2: #7ec8f5;
  --cielo-3: #b5e0ff;
  --cielo-4: #ffe4b8;

  /* Paleta cálida "papel de cuento" */
  --pergamino-1: #fff8e7;
  --pergamino-2: #fdeecb;
  --pergamino-3: #f5deb3;
  --pergamino-borde: #d4a574;

  /* Madera */
  --madera-1: #d9a066;
  --madera-2: #b8814a;
  --madera-3: #8b5e34;
  --madera-borde: #6b4423;

  /* Naturaleza */
  --verde: #63c96b;
  --verde-oscuro: #3ea347;

  /* Acciones */
  --naranja: #ff9d3d;
  --naranja-oscuro: #e07d1a;
  --rojo: #ff5b6e;
  --rojo-oscuro: #d63a4d;
  --amarillo: #ffd23f;
  --amarillo-oscuro: #e0b215;
  --azul: #4aa9ff;
  --azul-oscuro: #2a7fd6;
  --morado: #a06bff;
  --morado-oscuro: #7c48d6;
  --madera-oscura: #a06b3a;

  /* Neutros */
  --blanco: #ffffff;
  --tinta: #4a3520;
  --tinta-suave: #7a6040;

  /* Sombras */
  --sombra-suave: 0 4px 0 rgba(74, 53, 32, 0.15);
  --sombra-media: 0 6px 0 rgba(74, 53, 32, 0.2);
  --sombra-fuerte: 0 8px 0 rgba(74, 53, 32, 0.28);

  /* Tipografía */
  --fuente-titulo: 'Baloo 2', system-ui, sans-serif;
  --fuente-texto: 'Nunito', system-ui, sans-serif;

  /* Radios */
  --radio-sm: 12px;
  --radio-md: 20px;
  --radio-lg: 28px;
  --radio-xl: 36px;
  --radio-pill: 999px;
}

/* ------------------------------------------------------------
   2. RESET
   ------------------------------------------------------------ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

html,
body {
  min-height: 100%;
  height: 100%;
}

body {
  font-family: var(--fuente-texto);
  color: var(--tinta);
  background: linear-gradient(180deg, var(--cielo-1) 0%, var(--cielo-2) 35%, var(--cielo-3) 65%, var(--cielo-4) 100%);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 16px;
  line-height: 1.5;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

button:focus-visible {
  outline: 3px solid var(--azul);
  outline-offset: 3px;
  border-radius: var(--radio-sm);
}

ul { list-style: none; }
img { max-width: 100%; display: block; }

/* ------------------------------------------------------------
   3. ANIMACIONES
   ------------------------------------------------------------ */
@keyframes flotar {
  0%, 100% { transform: translateX(0) translateY(0); }
  50%      { transform: translateX(30px) translateY(-14px); }
}

@keyframes brillar {
  0%, 100% { opacity: 0.4; transform: scale(0.9); }
  50%      { opacity: 1;   transform: scale(1.15); }
}

@keyframes volar {
  0%   { transform: translateX(0) translateY(0) scaleX(1); }
  50%  { transform: translateX(55vw) translateY(-25px) scaleX(1); }
  51%  { transform: translateX(55vw) translateY(-25px) scaleX(-1); }
  100% { transform: translateX(110vw) translateY(0) scaleX(-1); }
}

@keyframes girar-lento {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes aparecer {
  from { opacity: 0; transform: translateY(24px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes pop {
  0%   { transform: scale(0.6); opacity: 0; }
  70%  { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); }
}

@keyframes temblor {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  20%      { transform: translateX(-6px) rotate(-2deg); }
  40%      { transform: translateX(6px) rotate(2deg); }
  60%      { transform: translateX(-4px) rotate(-1deg); }
  80%      { transform: translateX(4px) rotate(1deg); }
}

@keyframes saltito {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

@keyframes latido {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.06); }
}

@keyframes caer-confeti {
  0%   { transform: translateY(-10vh) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

@keyframes brillo-carta {
  0%   { box-shadow: 0 0 0 0 rgba(255, 210, 63, 0.9); }
  100% { box-shadow: 0 0 0 22px rgba(255, 210, 63, 0); }
}

@keyframes toast-entrar {
  from { opacity: 0; transform: translateX(-120%) scale(0.9); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toast-salir {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(-120%); }
}

@keyframes modal-entrar {
  from { opacity: 0; transform: scale(0.85) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes resplandor {
  0%, 100% { box-shadow: 0 6px 0 var(--naranja-oscuro), 0 12px 24px rgba(224, 125, 26, 0.42); }
  50%      { box-shadow: 0 6px 0 var(--naranja-oscuro), 0 14px 34px rgba(224, 125, 26, 0.7); }
}

@keyframes onda {
  0%   { background-position: 0 0; }
  100% { background-position: 60px 0; }
}

/* ------------------------------------------------------------
   4. FONDO · VIDEO EN LOOP CENTRADO
   ------------------------------------------------------------ */
.fondo {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background: linear-gradient(180deg, var(--cielo-1) 0%, var(--cielo-2) 35%, var(--cielo-3) 65%, var(--cielo-4) 100%);
}

.fondo__video-contenedor {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  background: linear-gradient(180deg, var(--cielo-1) 0%, var(--cielo-2) 35%, var(--cielo-3) 65%, var(--cielo-4) 100%);
}

.fondo__video {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  z-index: 0;
  pointer-events: none;
  background-color: transparent;
}

.fondo__velo {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 250, 220, 0.22) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 100%, rgba(80, 40, 10, 0.14) 0%, transparent 60%);
  pointer-events: none;
  z-index: 1;
}

.fondo__nube {
  position: absolute;
  font-size: clamp(3rem, 6vw, 5rem);
  opacity: 0.75;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.1));
  animation: flotar 18s ease-in-out infinite;
  z-index: 2;
}
.fondo__nube--1 { top: 4%;  left: -6%; animation-delay: 0s; }
.fondo__nube--2 { top: 10%; left: 55%; animation-delay: -6s; font-size: clamp(2.4rem, 4.5vw, 3.6rem); }
.fondo__nube--3 { top: 22%; left: 25%; animation-delay: -12s; font-size: clamp(2rem, 3.5vw, 3rem); opacity: 0.55; }

.fondo__pajaro {
  position: absolute;
  font-size: clamp(1.2rem, 2vw, 1.7rem);
  opacity: 0.7;
  animation: volar 26s linear infinite;
  z-index: 2;
}
.fondo__pajaro--1 { top: 14%; left: -10%; animation-delay: 0s; }
.fondo__pajaro--2 { top: 22%; left: -10%; animation-delay: -13s; font-size: clamp(1rem, 1.6vw, 1.3rem); }

.fondo__estrella {
  position: absolute;
  color: #fff;
  font-size: clamp(0.9rem, 1.4vw, 1.3rem);
  opacity: 0.8;
  animation: brillar 3s ease-in-out infinite;
  text-shadow: 0 0 12px rgba(255, 255, 255, 1);
  z-index: 2;
}
.fondo__estrella--1 { top: 8%;  left: 12%; animation-delay: 0s; }
.fondo__estrella--2 { top: 26%; left: 88%; animation-delay: 0.6s; }
.fondo__estrella--3 { top: 46%; left: 20%; animation-delay: 1.2s; }

/* ============================================================
   NOTA: Se eliminaron por completo los estilos de:
   · .controles-globales
   · .btn-flotante
   · .btn-flotante__icono
   · .btn-flotante.mudo
   Ya no se usan en el HTML.
   ============================================================ */

/* ------------------------------------------------------------
   5. TOASTS (entran desde la izquierda)
   ------------------------------------------------------------ */
.toasts {
  position: fixed;
  top: clamp(20px, 3vh, 40px);
  left: clamp(10px, 1.4vw, 22px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 70;
  pointer-events: none;
  max-width: min(340px, 86vw);
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: linear-gradient(180deg, #fff8e7 0%, #fdeecb 100%);
  border: 3px solid var(--pergamino-borde);
  padding: 0.85rem 1rem;
  border-radius: var(--radio-md);
  box-shadow: 0 6px 0 rgba(107, 68, 35, 0.22), 0 12px 26px rgba(74, 53, 32, 0.22);
  border-left: 8px solid var(--amarillo);
  animation: toast-entrar 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.toast.saliendo { animation: toast-salir 0.35s ease forwards; }

.toast__emoji {
  font-size: 1.8rem;
  flex-shrink: 0;
  animation: saltito 1.4s ease-in-out infinite;
}

.toast__contenido { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }

.toast__titulo {
  font-family: var(--fuente-titulo);
  font-size: 0.95rem;
  color: var(--tinta);
  font-weight: 800;
}

.toast__texto {
  font-size: 0.82rem;
  color: var(--tinta-suave);
  font-weight: 600;
  line-height: 1.3;
}

.toast--exito { border-left-color: var(--verde); }
.toast--info  { border-left-color: var(--azul); }
.toast--aviso { border-left-color: var(--naranja); }
.toast--logro {
  border-left-color: var(--amarillo);
  background: linear-gradient(180deg, #fffbe9 0%, #ffeaa0 100%);
}

/* ------------------------------------------------------------
   6. MODAL
   ------------------------------------------------------------ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal[hidden] { display: none; }

.modal__fondo {
  position: absolute;
  inset: 0;
  background: rgba(40, 30, 20, 0.6);
  backdrop-filter: blur(4px);
  animation: aparecer 0.3s ease both;
}

.modal__caja {
  position: relative;
  background: linear-gradient(180deg, #fff8e7 0%, #fdeecb 100%);
  border: 5px solid var(--pergamino-borde);
  border-radius: var(--radio-xl);
  padding: clamp(1.6rem, 4vw, 2.6rem);
  max-width: 540px;
  width: 100%;
  text-align: center;
  box-shadow: 0 12px 0 rgba(107, 68, 35, 0.28), 0 26px 50px rgba(74, 53, 32, 0.35);
  animation: modal-entrar 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.modal__caja::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 2px dashed rgba(212, 165, 116, 0.5);
  border-radius: calc(var(--radio-xl) - 8px);
  pointer-events: none;
}

.modal__emoji {
  font-size: clamp(3rem, 7vw, 4rem);
  display: block;
  margin-bottom: 0.6rem;
  animation: saltito 1.6s ease-in-out infinite;
}

.modal__titulo {
  font-family: var(--fuente-titulo);
  font-weight: 800;
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  color: var(--tinta);
  margin-bottom: 0.5rem;
}

.modal__texto {
  font-size: clamp(0.95rem, 1.7vw, 1.1rem);
  font-weight: 600;
  color: var(--tinta-suave);
  line-height: 1.5;
  margin-bottom: 1.4rem;
}

.modal__acciones {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ------------------------------------------------------------
   7. APP Y PANTALLAS
   ------------------------------------------------------------ */
.app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(20px, 3vh, 40px) clamp(14px, 2vw, 32px) clamp(20px, 3vh, 40px);
}

.pantalla {
  display: none;
  width: 100%;
  max-width: 1700px;
  animation: aparecer 0.45s ease both;
}

.pantalla--activa {
  display: flex;
  flex-direction: column;
}

/* ------------------------------------------------------------
   8. BOTONES
   ------------------------------------------------------------ */
.btn {
  font-family: var(--fuente-titulo);
  font-weight: 700;
  font-size: 1rem;
  padding: 0.75em 1.6em;
  border-radius: var(--radio-pill);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  user-select: none;
  white-space: nowrap;
  position: relative;
}

.btn:active { transform: translateY(3px) scale(0.98); }

.btn--principal {
  background: linear-gradient(180deg, var(--naranja) 0%, var(--naranja-oscuro) 100%);
  color: #fff;
  box-shadow: 0 5px 0 var(--naranja-oscuro), 0 10px 18px rgba(224, 125, 26, 0.4);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.18);
  border: 2px solid rgba(255, 255, 255, 0.35);
}
.btn--principal:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 0 var(--naranja-oscuro), 0 14px 24px rgba(224, 125, 26, 0.5);
  animation: resplandor 1.6s ease-in-out infinite;
}

.btn--secundario {
  background: linear-gradient(180deg, #fff8e7 0%, #f5deb3 100%);
  color: var(--tinta);
  border: 3px solid var(--pergamino-borde);
  box-shadow: 0 4px 0 rgba(107, 68, 35, 0.25);
}
.btn--secundario:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 rgba(107, 68, 35, 0.3);
  background: linear-gradient(180deg, #fffef8 0%, #ffeecb 100%);
}

.btn--lg {
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  padding: 0.85em 1.9em;
}

.btn--xl {
  font-size: clamp(1.15rem, 1.8vw, 1.5rem);
  padding: 0.85em 2.2em;
}

.btn--icono {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(180deg, #fff8e7 0%, #f5deb3 100%);
  color: var(--tinta);
  font-size: 1.3rem;
  border: 3px solid var(--pergamino-borde);
  box-shadow: 0 4px 0 rgba(107, 68, 35, 0.25);
  flex-shrink: 0;
  padding: 0;
}
.btn--icono:hover { transform: translateY(-2px) rotate(-6deg); }

.btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none !important;
  animation: none !important;
}

/* ------------------------------------------------------------
   9. PANTALLA 1 · INICIO
   ------------------------------------------------------------ */
#pantalla-inicio.pantalla--activa {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: clamp(20px, 4vw, 60px);
  flex-wrap: wrap;
}

.inicio__contenido {
  flex: 1 1 min(520px, 100%);
  text-align: center;
  animation: aparecer 0.6s 0.05s both;
  z-index: 2;
}

.inicio__espacio-animacion {
  flex: 1 1 min(400px, 100%);
  min-height: 420px;
  pointer-events: none;
}

.inicio__etiqueta {
  display: inline-block;
  background: linear-gradient(180deg, #fff8e7 0%, #f5deb3 100%);
  color: var(--tinta-suave);
  font-weight: 800;
  font-size: clamp(0.7rem, 1.1vw, 0.9rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.55em 1.3em;
  border: 3px solid var(--pergamino-borde);
  border-radius: var(--radio-pill);
  box-shadow: 0 3px 0 rgba(107, 68, 35, 0.18);
  margin-bottom: 1.4rem;
  animation: latido 3s ease-in-out infinite;
}

.inicio__titulo {
  font-family: var(--fuente-titulo);
  font-weight: 800;
  line-height: 0.92;
  margin-bottom: 1.2rem;
  text-shadow:
    0 5px 0 rgba(255, 255, 255, 0.55),
    0 8px 20px rgba(74, 53, 32, 0.25);
}

.inicio__titulo-linea {
  display: block;
  font-size: clamp(2.8rem, 6vw, 5.6rem);
}

.inicio__titulo-linea--arriba {
  color: var(--rojo);
  transform: rotate(-2deg);
  -webkit-text-stroke: 2px rgba(255, 255, 255, 0.6);
}

.inicio__titulo-linea--abajo {
  color: var(--azul);
  transform: rotate(1deg);
  -webkit-text-stroke: 2px rgba(255, 255, 255, 0.6);
}

.inicio__subtitulo {
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  font-weight: 700;
  color: var(--tinta);
  background: rgba(255, 248, 231, 0.9);
  backdrop-filter: blur(6px);
  border: 3px solid rgba(212, 165, 116, 0.65);
  border-radius: var(--radio-lg);
  padding: 0.9em 1.4em;
  max-width: 44ch;
  margin: 0 auto 2rem;
  line-height: 1.55;
  box-shadow: 0 4px 0 rgba(107, 68, 35, 0.18);
}

.inicio__acciones {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 2rem;
}

.inicio__stats {
  display: inline-flex;
  align-items: center;
  gap: clamp(0.8rem, 1.6vw, 1.6rem);
  background: linear-gradient(180deg, #fff8e7 0%, #f5deb3 100%);
  border: 4px solid var(--pergamino-borde);
  padding: 0.9rem clamp(1rem, 2vw, 1.8rem);
  border-radius: var(--radio-xl);
  box-shadow: 0 6px 0 rgba(107, 68, 35, 0.22), 0 12px 24px rgba(74, 53, 32, 0.15);
  animation: aparecer 0.6s 0.3s both;
  position: relative;
}

.inicio__stats::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 2px dashed rgba(212, 165, 116, 0.5);
  border-radius: calc(var(--radio-xl) - 6px);
  pointer-events: none;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  min-width: 60px;
}

.stat__emoji {
  font-size: clamp(1.2rem, 1.8vw, 1.6rem);
  filter: drop-shadow(0 2px 0 rgba(107, 68, 35, 0.15));
}

.stat__valor {
  font-family: var(--fuente-titulo);
  font-weight: 800;
  font-size: clamp(1.1rem, 1.7vw, 1.4rem);
  color: var(--tinta);
  line-height: 1;
}

.stat__label {
  font-size: clamp(0.65rem, 0.9vw, 0.78rem);
  font-weight: 700;
  color: var(--tinta-suave);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat__sep {
  width: 2px;
  height: 40px;
  background: linear-gradient(180deg, transparent 0%, rgba(212, 165, 116, 0.7) 50%, transparent 100%);
  border-radius: 2px;
}

/* ------------------------------------------------------------
   10. CABECERA COMPARTIDA
   ------------------------------------------------------------ */
.cabecera {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.6rem;
  animation: aparecer 0.4s both;
}

.cabecera__titulo {
  font-family: var(--fuente-titulo);
  font-weight: 800;
  font-size: clamp(1.5rem, 2.6vw, 2.4rem);
  color: var(--tinta);
  text-shadow:
    0 3px 0 rgba(255, 255, 255, 0.7),
    0 6px 14px rgba(74, 53, 32, 0.2);
  text-align: center;
  flex: 1;
}

.cabecera__hueco { width: 48px; flex-shrink: 0; }

/* ------------------------------------------------------------
   11. PANTALLA 2 · INSTRUCCIONES
   ------------------------------------------------------------ */
.pasos {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(14px, 1.8vw, 24px);
  margin-bottom: 1.6rem;
}

.paso {
  position: relative;
  background: linear-gradient(180deg, #fff8e7 0%, #f5deb3 100%);
  border: 4px solid var(--pergamino-borde);
  border-radius: var(--radio-lg);
  padding: 2.4rem 1.4rem 1.6rem;
  text-align: center;
  box-shadow: 0 6px 0 rgba(107, 68, 35, 0.22), 0 14px 26px rgba(74, 53, 32, 0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: aparecer 0.5s both;
}
.paso--1 { animation-delay: 0.05s; }
.paso--2 { animation-delay: 0.12s; }
.paso--3 { animation-delay: 0.19s; }
.paso--4 { animation-delay: 0.26s; }

.paso::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 2px dashed rgba(212, 165, 116, 0.45);
  border-radius: calc(var(--radio-lg) - 8px);
  pointer-events: none;
}

.paso:hover {
  transform: translateY(-6px) rotate(-1deg);
  box-shadow: 0 10px 0 rgba(107, 68, 35, 0.25), 0 18px 32px rgba(74, 53, 32, 0.18);
}

.paso__numero {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--amarillo), var(--amarillo-oscuro));
  color: #fff;
  font-family: var(--fuente-titulo);
  font-weight: 800;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 0 rgba(180, 140, 20, 0.6), 0 0 0 4px #fff8e7;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
  z-index: 2;
}

.paso__emoji {
  font-size: clamp(2.4rem, 3.6vw, 3.2rem);
  display: block;
  margin-bottom: 0.6rem;
  animation: saltito 3s ease-in-out infinite;
  filter: drop-shadow(0 3px 0 rgba(107, 68, 35, 0.15));
}
.paso--2 .paso__emoji { animation-delay: 0.3s; }
.paso--3 .paso__emoji { animation-delay: 0.6s; }
.paso--4 .paso__emoji { animation-delay: 0.9s; }

.paso__titulo {
  font-family: var(--fuente-titulo);
  font-weight: 800;
  font-size: 1.15rem;
  margin-bottom: 0.4rem;
  color: var(--tinta);
}

.paso__texto {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--tinta-suave);
  line-height: 1.45;
}

.consejos {
  background: linear-gradient(180deg, #fff8e7 0%, #f5deb3 100%);
  border: 4px solid var(--pergamino-borde);
  border-radius: var(--radio-lg);
  padding: clamp(1.2rem, 1.8vw, 1.8rem);
  box-shadow: 0 6px 0 rgba(107, 68, 35, 0.22), 0 12px 24px rgba(74, 53, 32, 0.12);
  margin-bottom: 1.8rem;
  animation: aparecer 0.5s 0.35s both;
  position: relative;
}

.consejos::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 2px dashed rgba(212, 165, 116, 0.45);
  border-radius: calc(var(--radio-lg) - 8px);
  pointer-events: none;
}

.consejos__titulo {
  font-family: var(--fuente-titulo);
  font-weight: 800;
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  color: var(--tinta);
  margin-bottom: 0.7rem;
  position: relative;
}

.consejos__lista {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.5rem 1.4rem;
  position: relative;
}

.consejos__lista li {
  position: relative;
  padding-left: 1.6rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--tinta-suave);
  line-height: 1.5;
}

.consejos__lista li::before {
  content: "✔";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--verde-oscuro);
  font-weight: 800;
  font-size: 1.05rem;
}

.consejos__lista strong { color: var(--tinta); font-weight: 800; }

.instrucciones__acciones {
  display: flex;
  justify-content: center;
  animation: aparecer 0.5s 0.45s both;
}

/* ------------------------------------------------------------
   12. PANTALLA 3 · SELECCIÓN
   ------------------------------------------------------------ */
.seleccion__ayuda {
  text-align: center;
  font-weight: 700;
  color: var(--tinta);
  font-size: clamp(0.95rem, 1.3vw, 1.1rem);
  background: rgba(255, 248, 231, 0.9);
  backdrop-filter: blur(6px);
  border: 3px solid rgba(212, 165, 116, 0.65);
  border-radius: var(--radio-pill);
  padding: 0.6em 1.4em;
  display: inline-block;
  margin: 0 auto 1.2rem;
  box-shadow: 0 3px 0 rgba(107, 68, 35, 0.18);
  animation: aparecer 0.4s both;
  align-self: center;
}

.seleccion__filtros {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 1.6rem;
  flex-wrap: wrap;
  animation: aparecer 0.5s 0.05s both;
}

.filtro {
  font-family: var(--fuente-titulo);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.6em 1.4em;
  border-radius: var(--radio-pill);
  background: linear-gradient(180deg, #fff8e7 0%, #f5deb3 100%);
  color: var(--tinta);
  border: 3px solid var(--pergamino-borde);
  box-shadow: 0 4px 0 rgba(107, 68, 35, 0.2);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
}

.filtro:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 rgba(107, 68, 35, 0.25);
}

.filtro--activo {
  background: linear-gradient(180deg, var(--azul), var(--azul-oscuro));
  color: #fff;
  border-color: var(--azul-oscuro);
  box-shadow: 0 4px 0 var(--azul-oscuro);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}

.cuentos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(16px, 1.8vw, 24px);
}

.cuento {
  position: relative;
  background: linear-gradient(180deg, #fff8e7 0%, #f5deb3 100%);
  border: 5px solid var(--pergamino-borde);
  border-radius: var(--radio-xl);
  padding: 2.2rem 1.2rem 1.6rem;
  text-align: center;
  box-shadow: 0 8px 0 rgba(107, 68, 35, 0.24), 0 14px 24px rgba(74, 53, 32, 0.14);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  animation: aparecer 0.5s both;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cuento:nth-child(1) { animation-delay: 0.04s; }
.cuento:nth-child(2) { animation-delay: 0.10s; }
.cuento:nth-child(3) { animation-delay: 0.16s; }
.cuento:nth-child(4) { animation-delay: 0.22s; }
.cuento:nth-child(5) { animation-delay: 0.28s; }
.cuento:nth-child(6) { animation-delay: 0.34s; }

.cuento.oculto { display: none; }

.cuento::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 110px;
  opacity: 0.32;
  border-radius: var(--radio-xl) var(--radio-xl) 60% 60%;
  transition: opacity 0.3s ease, height 0.3s ease;
}

.cuento::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 2px dashed rgba(212, 165, 116, 0.45);
  border-radius: calc(var(--radio-xl) - 10px);
  pointer-events: none;
  transition: border-color 0.25s ease;
}

.cuento:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 14px 0 rgba(107, 68, 35, 0.3), 0 24px 40px rgba(74, 53, 32, 0.24);
}

.cuento:hover::before { opacity: 0.5; height: 140px; }
.cuento:active { transform: translateY(-2px) scale(0.99); }

.cuento--rojo::before    { background: linear-gradient(180deg, var(--rojo) 0%, transparent 100%); }
.cuento--verde::before   { background: linear-gradient(180deg, var(--verde) 0%, transparent 100%); }
.cuento--dorado::before  { background: linear-gradient(180deg, var(--amarillo) 0%, transparent 100%); }
.cuento--azul::before    { background: linear-gradient(180deg, var(--azul) 0%, transparent 100%); }
.cuento--morado::before  { background: linear-gradient(180deg, var(--morado) 0%, transparent 100%); }
.cuento--madera::before  { background: linear-gradient(180deg, var(--madera-1) 0%, transparent 100%); }

.cuento--rojo:hover    { border-color: var(--rojo); }
.cuento--verde:hover   { border-color: var(--verde); }
.cuento--dorado:hover  { border-color: var(--amarillo); }
.cuento--azul:hover    { border-color: var(--azul); }
.cuento--morado:hover  { border-color: var(--morado); }
.cuento--madera:hover  { border-color: var(--madera-1); }

.cuento__cinta {
  position: absolute;
  top: 14px;
  right: 14px;
  background: linear-gradient(180deg, #fff8e7 0%, #f5deb3 100%);
  color: var(--tinta);
  font-family: var(--fuente-titulo);
  font-weight: 700;
  font-size: 0.72rem;
  padding: 0.35em 0.85em;
  border: 2px solid var(--pergamino-borde);
  border-radius: var(--radio-pill);
  box-shadow: 0 2px 0 rgba(107, 68, 35, 0.18);
  z-index: 2;
}

.cuento__estrellas-mini {
  position: absolute;
  top: 14px;
  left: 14px;
  font-size: 0.85rem;
  color: var(--amarillo-oscuro);
  letter-spacing: 0.05em;
  z-index: 2;
  background: rgba(255, 248, 231, 0.95);
  padding: 0.25em 0.6em;
  border-radius: var(--radio-pill);
  box-shadow: 0 2px 0 rgba(107, 68, 35, 0.12);
  border: 2px solid rgba(212, 165, 116, 0.5);
}

.cuento__emoji {
  position: relative;
  font-size: clamp(3rem, 4.2vw, 4.2rem);
  display: block;
  margin: 0.8rem 0 0.5rem;
  filter: drop-shadow(0 6px 0 rgba(107, 68, 35, 0.18));
  transition: transform 0.3s ease;
  z-index: 1;
}

.cuento:hover .cuento__emoji { transform: scale(1.18) rotate(-10deg); }

.cuento__nombre {
  position: relative;
  font-family: var(--fuente-titulo);
  font-weight: 800;
  font-size: clamp(1.1rem, 1.4vw, 1.35rem);
  color: var(--tinta);
  margin-bottom: 0.4rem;
  z-index: 1;
  line-height: 1.15;
}

.cuento__dificultad {
  position: relative;
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--tinta-suave);
  background: rgba(255, 255, 255, 0.75);
  padding: 0.25em 0.8em;
  border-radius: var(--radio-pill);
  margin-bottom: 0.7rem;
  z-index: 1;
  border: 2px solid rgba(212, 165, 116, 0.4);
}

.cuento__descripcion {
  position: relative;
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--tinta-suave);
  line-height: 1.35;
  margin-bottom: 1.1rem;
  min-height: 2.6em;
  z-index: 1;
}

.cuento__btn {
  position: relative;
  display: inline-block;
  font-family: var(--fuente-titulo);
  font-weight: 800;
  font-size: 0.98rem;
  color: #fff;
  background: linear-gradient(180deg, var(--naranja) 0%, var(--naranja-oscuro) 100%);
  padding: 0.55em 1.3em;
  border-radius: var(--radio-pill);
  box-shadow: 0 4px 0 var(--naranja-oscuro);
  transition: transform 0.15s ease, background 0.2s ease;
  z-index: 1;
  margin-top: auto;
  border: 2px solid rgba(255, 255, 255, 0.4);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.15);
}

.cuento:hover .cuento__btn { transform: translateY(-3px) scale(1.05); }

.cuento--rojo:hover .cuento__btn    { background: linear-gradient(180deg, var(--rojo) 0%, var(--rojo-oscuro) 100%); box-shadow: 0 4px 0 var(--rojo-oscuro); }
.cuento--verde:hover .cuento__btn   { background: linear-gradient(180deg, var(--verde) 0%, var(--verde-oscuro) 100%); box-shadow: 0 4px 0 var(--verde-oscuro); }
.cuento--dorado:hover .cuento__btn  { background: linear-gradient(180deg, var(--amarillo) 0%, var(--amarillo-oscuro) 100%); box-shadow: 0 4px 0 #b8900f; }
.cuento--azul:hover .cuento__btn    { background: linear-gradient(180deg, var(--azul) 0%, var(--azul-oscuro) 100%); box-shadow: 0 4px 0 var(--azul-oscuro); }
.cuento--morado:hover .cuento__btn  { background: linear-gradient(180deg, var(--morado) 0%, var(--morado-oscuro) 100%); box-shadow: 0 4px 0 var(--morado-oscuro); }
.cuento--madera:hover .cuento__btn  { background: linear-gradient(180deg, var(--madera-1) 0%, var(--madera-oscura) 100%); box-shadow: 0 4px 0 var(--madera-oscura); }

/* ------------------------------------------------------------
   13. PANTALLA 4 · JUEGO
   Se amplía el espacio disponible al eliminar los botones flotantes
   ------------------------------------------------------------ */
#pantalla-juego.pantalla--activa {
  gap: clamp(10px, 1.4vh, 16px);
  max-width: 1750px;
  height: min(calc(100vh - 80px), 950px);
  max-height: calc(100vh - 80px);
  overflow: hidden;
}

.juego__cabecera {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(0.6rem, 1.2vw, 1rem);
  background:
    linear-gradient(180deg, rgba(255, 248, 231, 0.96) 0%, rgba(245, 222, 179, 0.96) 100%);
  border: 4px solid var(--pergamino-borde);
  border-radius: var(--radio-xl);
  padding: clamp(0.6rem, 1vh, 0.9rem) clamp(0.9rem, 1.4vw, 1.3rem);
  box-shadow:
    0 6px 0 rgba(107, 68, 35, 0.22),
    0 12px 24px rgba(74, 53, 32, 0.14),
    inset 0 2px 0 rgba(255, 255, 255, 0.7);
  animation: aparecer 0.4s both;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.juego__cabecera::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: repeating-linear-gradient(
    90deg,
    var(--rojo) 0px, var(--rojo) 30px,
    var(--amarillo) 30px, var(--amarillo) 60px,
    var(--verde) 60px, var(--verde) 90px,
    var(--azul) 90px, var(--azul) 120px,
    var(--morado) 120px, var(--morado) 150px
  );
  opacity: 0.5;
}

.juego__info { min-width: 0; text-align: center; }

.juego__titulo {
  font-family: var(--fuente-titulo);
  font-weight: 800;
  font-size: clamp(1rem, 1.7vw, 1.5rem);
  color: var(--tinta);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.1;
  margin-bottom: 0.35rem;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.7);
}

.juego__progreso {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: center;
}

.juego__progreso-barra {
  width: min(340px, 90%);
  height: 12px;
  background: linear-gradient(180deg, rgba(107, 68, 35, 0.25) 0%, rgba(107, 68, 35, 0.15) 100%);
  border-radius: var(--radio-pill);
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 0 rgba(255, 255, 255, 0.6);
  border: 2px solid rgba(107, 68, 35, 0.2);
}

.juego__progreso-fill {
  height: 100%;
  background: linear-gradient(90deg, #7ed957 0%, var(--verde) 50%, var(--verde-oscuro) 100%);
  border-radius: var(--radio-pill);
  transition: width 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s ease;
  box-shadow: 0 0 10px rgba(99, 201, 107, 0.6);
  position: relative;
  overflow: hidden;
}

.juego__progreso-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    45deg,
    transparent 0px, transparent 8px,
    rgba(255, 255, 255, 0.25) 8px, rgba(255, 255, 255, 0.25) 16px
  );
  animation: onda 1s linear infinite;
}

.juego__progreso-fill.completo {
  background: linear-gradient(90deg, var(--amarillo) 0%, var(--naranja) 100%);
  box-shadow: 0 0 14px rgba(255, 210, 63, 0.9);
}

.juego__progreso-texto {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--tinta-suave);
  letter-spacing: 0.03em;
}

.juego__marcador {
  display: flex;
  align-items: center;
  gap: clamp(0.4rem, 0.7vw, 0.65rem);
  flex-shrink: 0;
}

.marcador__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  padding: 0.4rem 0.55rem;
  border-radius: var(--radio-md);
  min-width: 56px;
  border: 3px solid;
  box-shadow: 0 3px 0 rgba(107, 68, 35, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transition: transform 0.2s ease;
}

.marcador__item:hover { transform: translateY(-2px); }

.marcador__item--tiempo {
  background: linear-gradient(180deg, #d6ecff 0%, #a5d4ff 100%);
  border-color: #5ba3e8;
}
.marcador__item--intentos {
  background: linear-gradient(180deg, #ffe0d0 0%, #ffc4a3 100%);
  border-color: #e88a4a;
}
.marcador__item--pistas {
  background: linear-gradient(180deg, #fff8c8 0%, #ffe98a 100%);
  border-color: #d4a72c;
}
.marcador__item--estrellas {
  background: linear-gradient(180deg, #fff0e0 0%, #ffd8a8 100%);
  border-color: #e8a84a;
  min-width: 78px;
}

.marcador__emoji { font-size: clamp(0.85rem, 1.2vw, 1.05rem); line-height: 1; }

.marcador__valor {
  font-family: var(--fuente-titulo);
  font-weight: 800;
  font-size: clamp(0.8rem, 1.1vw, 1rem);
  color: var(--tinta);
  line-height: 1;
}

.juego__estrellas {
  font-size: clamp(0.95rem, 1.4vw, 1.25rem);
  color: var(--amarillo-oscuro);
  letter-spacing: 0.05em;
  transition: transform 0.3s ease;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}

.juego__estrellas.animar { animation: pop 0.5s ease; }

.marcador__item.peligro { animation: temblor 0.5s ease; }
.marcador__item.peligro .marcador__valor { color: var(--rojo-oscuro); }

.juego__cuerpo {
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.4vh, 16px);
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.zona {
  position: relative;
  border-radius: var(--radio-xl);
  padding: clamp(0.7rem, 1.2vh, 1rem) clamp(0.9rem, 1.4vw, 1.4rem);
  display: flex;
  flex-direction: column;
  animation: aparecer 0.5s both;
  min-height: 0;
  overflow: hidden;
  border: 4px solid;
  box-shadow:
    0 6px 0 rgba(107, 68, 35, 0.22),
    0 14px 26px rgba(74, 53, 32, 0.12),
    inset 0 2px 0 rgba(255, 255, 255, 0.6);
}

.zona::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      0deg,
      transparent 0px, transparent 34px,
      rgba(212, 165, 116, 0.12) 34px, rgba(212, 165, 116, 0.12) 35px
    );
  pointer-events: none;
  border-radius: inherit;
}

.zona::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 2px dashed rgba(212, 165, 116, 0.5);
  border-radius: calc(var(--radio-xl) - 8px);
  pointer-events: none;
}

.zona--linea {
  background: linear-gradient(180deg, #fffbe9 0%, #fdeecb 100%);
  border-color: var(--pergamino-borde);
  animation-delay: 0.05s;
  flex: 1.1;
}

.zona--mazo {
  background: linear-gradient(180deg, #fff2da 0%, #f5d9b0 100%);
  border-color: #b8814a;
  animation-delay: 0.12s;
  flex: 1;
}

.zona__decoracion {
  position: absolute;
  font-size: clamp(1.4rem, 2vw, 2rem);
  opacity: 0.35;
  filter: drop-shadow(0 2px 0 rgba(107, 68, 35, 0.15));
  pointer-events: none;
  z-index: 1;
  animation: latido 4s ease-in-out infinite;
}
.zona__decoracion--tl { top: 8px; left: 14px; animation-delay: 0s; }
.zona__decoracion--tr { top: 8px; right: 14px; animation-delay: 0.5s; }

.zona__cabecera {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: clamp(0.5rem, 0.9vh, 0.75rem);
  gap: 0.5rem;
  flex-shrink: 0;
}

.zona__titulo {
  font-family: var(--fuente-titulo);
  font-weight: 800;
  font-size: clamp(0.95rem, 1.35vw, 1.15rem);
  color: var(--tinta);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.7);
}

.zona__titulo-emoji {
  font-size: clamp(1.1rem, 1.6vw, 1.5rem);
  filter: drop-shadow(0 2px 0 rgba(107, 68, 35, 0.2));
}

.zona__contador {
  font-family: var(--fuente-titulo);
  font-weight: 800;
  font-size: clamp(0.72rem, 1vw, 0.88rem);
  color: var(--tinta);
  background: linear-gradient(180deg, #fff8e7 0%, #f5deb3 100%);
  padding: 0.3em 0.9em;
  border: 2px solid var(--pergamino-borde);
  border-radius: var(--radio-pill);
  box-shadow: 0 2px 0 rgba(107, 68, 35, 0.18);
}

.zona--mazo .zona__contador {
  background: linear-gradient(180deg, #fff2da 0%, #f5d9b0 100%);
  border-color: #b8814a;
}

.linea {
  display: grid;
  gap: clamp(6px, 0.8vw, 12px);
  flex: 1;
  min-height: 0;
  position: relative;
  z-index: 2;
}

.linea--horizontal {
  grid-template-columns: repeat(6, 1fr);
}

.hueco {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: clamp(0.5rem, 0.9vh, 0.8rem);
  border: 3px dashed rgba(184, 129, 74, 0.5);
  border-radius: var(--radio-md);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7) 0%, rgba(255, 248, 231, 0.5) 100%);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  min-height: 0;
  text-align: center;
  box-shadow: inset 0 2px 4px rgba(107, 68, 35, 0.08);
}

.hueco:hover {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.85) 0%, rgba(255, 248, 231, 0.7) 100%);
  border-color: rgba(184, 129, 74, 0.75);
}

.hueco__numero {
  position: absolute;
  top: -10px;
  left: -8px;
  width: clamp(28px, 2vw, 34px);
  height: clamp(28px, 2vw, 34px);
  border-radius: 50%;
  background: linear-gradient(180deg, var(--azul), var(--azul-oscuro));
  color: #fff;
  font-family: var(--fuente-titulo);
  font-weight: 800;
  font-size: clamp(0.78rem, 1vw, 0.95rem);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 3px 0 var(--azul-oscuro),
    0 0 0 3px #fff8e7,
    0 4px 8px rgba(42, 127, 214, 0.35);
  z-index: 4;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.15);
}

.hueco__pista {
  font-size: clamp(0.7rem, 0.95vw, 0.85rem);
  font-weight: 700;
  color: var(--tinta-suave);
  opacity: 0.7;
  text-align: center;
  padding: 0 0.3rem;
}

.hueco.lleno {
  border-style: solid;
  border-color: var(--verde);
  background:
    linear-gradient(180deg, rgba(200, 240, 200, 0.4) 0%, rgba(99, 201, 107, 0.2) 100%);
  padding: 0.4rem;
  box-shadow:
    inset 0 2px 6px rgba(62, 163, 71, 0.2),
    0 3px 0 rgba(62, 163, 71, 0.3);
}

.hueco.lleno .hueco__pista { display: none; }

.hueco.destino {
  background: linear-gradient(180deg, rgba(255, 235, 130, 0.7) 0%, rgba(255, 210, 63, 0.5) 100%);
  border-color: var(--amarillo-oscuro);
  transform: scale(1.03);
  box-shadow:
    0 0 0 5px rgba(255, 210, 63, 0.4),
    inset 0 2px 6px rgba(212, 167, 44, 0.25);
}

.hueco.correcto {
  border-color: var(--verde-oscuro);
  animation: brillo-carta 0.8s ease;
}

.hueco.incorrecto {
  border-color: var(--rojo-oscuro);
  animation: temblor 0.5s ease;
}

.hueco.hint {
  border-color: var(--amarillo-oscuro);
  background: linear-gradient(180deg, rgba(255, 235, 130, 0.6) 0%, rgba(255, 210, 63, 0.45) 100%);
  animation: latido 0.8s ease-in-out 3;
  box-shadow: 0 0 0 5px rgba(255, 210, 63, 0.4);
}

.mazo {
  display: grid;
  gap: clamp(6px, 0.8vw, 12px);
  flex: 1;
  min-height: 0;
  position: relative;
  z-index: 2;
}

.mazo--horizontal {
  grid-template-columns: repeat(6, 1fr);
}

.mazo.vacio::after {
  content: "¡Todas las cartas colocadas! 🎉";
  grid-column: 1 / -1;
  text-align: center;
  font-family: var(--fuente-titulo);
  font-weight: 800;
  font-size: clamp(1rem, 1.4vw, 1.25rem);
  color: var(--verde-oscuro);
  padding: 2rem 1rem;
  animation: latido 2s ease-in-out infinite;
  display: flex;
  align-items: center;
  justify-content: center;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.7);
}

/* ------------------------------------------------------------
   14. CARTAS · Sin texto, solo imagen
   Se aprovecha más espacio para la imagen al quitar el texto
   ------------------------------------------------------------ */
.carta {
  position: relative;
  background: linear-gradient(180deg, #ffffff 0%, #fff6e6 100%);
  border-radius: var(--radio-md);
  padding: clamp(0.35rem, 0.6vh, 0.5rem);
  box-shadow:
    0 4px 0 rgba(107, 68, 35, 0.22),
    0 8px 14px rgba(74, 53, 32, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  cursor: grab;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border: 3px solid rgba(255, 210, 63, 0.65);
  animation: pop 0.35s ease both;
  user-select: none;
  touch-action: manipulation;
  min-height: 0;
  justify-content: center;
  overflow: hidden;
}

.carta:hover {
  transform: translateY(-5px) rotate(-1.5deg);
  box-shadow:
    0 8px 0 rgba(107, 68, 35, 0.25),
    0 14px 22px rgba(74, 53, 32, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  border-color: var(--amarillo);
  z-index: 2;
}

.carta:active {
  cursor: grabbing;
  transform: scale(1.04) rotate(2deg);
}

.carta.arrastrando {
  opacity: 0.45;
  transform: scale(0.95) rotate(3deg);
  cursor: grabbing;
}

.carta.seleccionada {
  border-color: var(--naranja);
  box-shadow:
    0 0 0 5px rgba(255, 157, 61, 0.45),
    0 6px 0 rgba(107, 68, 35, 0.24);
  transform: translateY(-5px) scale(1.03);
  animation: latido 1.4s ease-in-out infinite;
  z-index: 3;
}

.carta__adorno {
  position: absolute;
  top: -6px;
  left: -6px;
  width: clamp(24px, 1.8vw, 30px);
  height: clamp(24px, 1.8vw, 30px);
  border-radius: 50%;
  background: linear-gradient(180deg, var(--rojo), var(--rojo-oscuro));
  color: #fff;
  font-family: var(--fuente-titulo);
  font-weight: 800;
  font-size: clamp(0.65rem, 0.85vw, 0.8rem);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 3px 0 var(--rojo-oscuro),
    0 0 0 3px #fff6e6;
  z-index: 4;
}

.carta__imagen-contenedor {
  position: relative;
  width: 100%;
  height: 100%;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radio-sm);
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.6) 0%, rgba(245, 222, 179, 0.4) 100%);
}

.carta__imagen {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 2px 0 rgba(107, 68, 35, 0.12));
  transition: transform 0.25s ease;
}

.carta:hover .carta__imagen {
  transform: scale(1.04);
}

.carta__imagen[src=""] { display: none; }

.carta__emoji {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(2rem, 3vw, 3.2rem);
  filter: drop-shadow(0 3px 0 rgba(107, 68, 35, 0.15));
  z-index: 1;
  pointer-events: none;
}

.carta__imagen:not([src=""]) + .carta__emoji,
.carta__imagen[src]:not([src=""]) ~ .carta__emoji {
  display: none;
}

.carta__imagen--error { display: none; }
.carta__imagen--error + .carta__emoji { display: flex; }

/* NOTA: se eliminaron los estilos de .carta__texto
   porque las cartas ya no muestran texto (la imagen lo incluye) */

.carta__asa {
  position: absolute;
  bottom: 3px;
  right: 6px;
  font-size: 0.75rem;
  color: rgba(107, 68, 35, 0.3);
  letter-spacing: -3px;
  line-height: 1;
}

.hueco .carta {
  width: 100%;
  height: 100%;
  padding: clamp(0.25rem, 0.4vh, 0.4rem);
  border-color: transparent;
  box-shadow: 0 2px 0 rgba(107, 68, 35, 0.15);
  animation: none;
  justify-content: center;
  background: linear-gradient(180deg, #ffffff 0%, #fff8e8 100%);
}

.hueco .carta:hover { transform: translateY(-2px); border-color: transparent; }

.hueco .carta .carta__imagen-contenedor { min-height: 0; flex: 1; }
.hueco .carta .carta__adorno,
.hueco .carta .carta__asa { display: none; }

/* ------------------------------------------------------------
   15. BOTONES DEL JUEGO · Los 4 CENTRADOS
   ------------------------------------------------------------ */
.juego__acciones {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.6rem, 1.2vw, 1.2rem);
  padding: clamp(0.6rem, 1vh, 0.9rem) clamp(0.9rem, 1.4vw, 1.3rem);
  background:
    linear-gradient(180deg, rgba(255, 248, 231, 0.96) 0%, rgba(245, 222, 179, 0.96) 100%);
  border: 4px solid var(--pergamino-borde);
  border-radius: var(--radio-xl);
  box-shadow:
    0 6px 0 rgba(107, 68, 35, 0.22),
    0 12px 24px rgba(74, 53, 32, 0.14),
    inset 0 2px 0 rgba(255, 255, 255, 0.7);
  animation: aparecer 0.5s 0.2s both;
  flex-shrink: 0;
  flex-wrap: wrap;
  position: relative;
  overflow: hidden;
}

.juego__acciones::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: repeating-linear-gradient(
    90deg,
    var(--rojo) 0px, var(--rojo) 30px,
    var(--amarillo) 30px, var(--amarillo) 60px,
    var(--verde) 60px, var(--verde) 90px,
    var(--azul) 90px, var(--azul) 120px,
    var(--morado) 120px, var(--morado) 150px
  );
  opacity: 0.5;
}

.btn--accion {
  font-family: var(--fuente-titulo);
  font-weight: 800;
  font-size: clamp(0.85rem, 1.05vw, 1rem);
  padding: clamp(0.55rem, 1vh, 0.7rem) clamp(0.9rem, 1.4vw, 1.4rem);
  border-radius: var(--radio-pill);
  background: linear-gradient(180deg, #ffffff 0%, #f5deb3 100%);
  color: var(--tinta);
  border: 3px solid var(--pergamino-borde);
  box-shadow:
    0 5px 0 rgba(107, 68, 35, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
  min-height: clamp(52px, 6.5vh, 64px);
  white-space: nowrap;
}

.btn--accion:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow:
    0 8px 0 rgba(107, 68, 35, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  background: linear-gradient(180deg, #fffef8 0%, #ffeecb 100%);
}

.btn--accion:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 3px 0 rgba(107, 68, 35, 0.3);
}

.btn--accion:disabled { opacity: 0.4; cursor: not-allowed; }

.btn__icono {
  font-size: clamp(1.1rem, 1.5vw, 1.4rem);
  line-height: 1;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.1));
}

.btn__texto { line-height: 1; }

.btn--accion-principal {
  font-family: var(--fuente-titulo);
  font-weight: 800;
  font-size: clamp(1.05rem, 1.5vw, 1.4rem);
  padding: clamp(0.7rem, 1.2vh, 0.9rem) clamp(1.6rem, 2.4vw, 2.4rem);
  border-radius: var(--radio-pill);
  background: linear-gradient(180deg, var(--naranja) 0%, var(--naranja-oscuro) 100%);
  color: #fff;
  border: 3px solid rgba(255, 255, 255, 0.45);
  box-shadow:
    0 6px 0 var(--naranja-oscuro),
    0 12px 24px rgba(224, 125, 26, 0.45);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
  min-height: clamp(58px, 7.5vh, 72px);
  min-width: clamp(200px, 16vw, 260px);
  justify-content: center;
  animation: resplandor 2.4s ease-in-out infinite;
}

.btn--accion-principal:hover {
  transform: translateY(-3px);
  box-shadow:
    0 9px 0 var(--naranja-oscuro),
    0 16px 30px rgba(224, 125, 26, 0.55);
}

.btn--accion-principal:active {
  transform: translateY(3px);
  box-shadow: 0 3px 0 var(--naranja-oscuro);
}

.btn--accion-principal .btn__icono {
  font-size: clamp(1.3rem, 1.8vw, 1.6rem);
}

.mensaje {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%) translateY(120px);
  background: linear-gradient(180deg, var(--tinta) 0%, #2a1e10 100%);
  color: #fff;
  font-family: var(--fuente-titulo);
  font-weight: 700;
  font-size: clamp(0.95rem, 1.2vw, 1.1rem);
  padding: 0.9em 1.7em;
  border-radius: var(--radio-pill);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
  z-index: 65;
  text-align: center;
  max-width: 90vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 3px solid rgba(255, 255, 255, 0.25);
}

.mensaje.visible { transform: translateX(-50%) translateY(0); opacity: 1; }
.mensaje.exito  { background: linear-gradient(180deg, #7ed957 0%, var(--verde-oscuro) 100%); }
.mensaje.error  { background: linear-gradient(180deg, var(--rojo) 0%, var(--rojo-oscuro) 100%); }
.mensaje.info   { background: linear-gradient(180deg, var(--azul) 0%, var(--azul-oscuro) 100%); }

/* ------------------------------------------------------------
   16. PANTALLA FINAL
   ------------------------------------------------------------ */
#pantalla-final.pantalla--activa {
  align-items: center;
  justify-content: center;
}

.final__tarjeta {
  background: linear-gradient(180deg, #fff8e7 0%, #f5deb3 100%);
  border: 5px solid var(--pergamino-borde);
  border-radius: var(--radio-xl);
  padding: clamp(1.8rem, 3.5vw, 3.2rem) clamp(1.5rem, 3vw, 2.8rem);
  text-align: center;
  max-width: 640px;
  width: 100%;
  box-shadow:
    0 12px 0 rgba(107, 68, 35, 0.28),
    0 26px 50px rgba(74, 53, 32, 0.28);
  position: relative;
  animation: pop 0.5s ease both;
  overflow: hidden;
}

.final__tarjeta::before {
  content: "";
  position: absolute;
  inset: -50%;
  background: conic-gradient(from 0deg, transparent 0deg, rgba(255, 210, 63, 0.3) 60deg, transparent 120deg);
  animation: girar-lento 12s linear infinite;
  z-index: 0;
  pointer-events: none;
}

.final__tarjeta::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 3px dashed rgba(212, 165, 116, 0.55);
  border-radius: calc(var(--radio-xl) - 12px);
  pointer-events: none;
  z-index: 1;
}

.final__emoji {
  position: relative;
  font-size: clamp(3.5rem, 8vw, 6rem);
  display: block;
  margin-bottom: 0.5rem;
  animation: saltito 1.4s ease-in-out infinite;
  z-index: 2;
  filter: drop-shadow(0 6px 0 rgba(107, 68, 35, 0.2));
}

.final__titulo {
  position: relative;
  font-family: var(--fuente-titulo);
  font-weight: 800;
  font-size: clamp(1.7rem, 3.5vw, 2.6rem);
  color: var(--verde-oscuro);
  margin-bottom: 0.6rem;
  z-index: 2;
  text-shadow:
    0 3px 0 rgba(255, 255, 255, 0.7),
    0 6px 12px rgba(62, 163, 71, 0.25);
}

.final__mensaje {
  position: relative;
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  font-weight: 700;
  color: var(--tinta-suave);
  line-height: 1.5;
  margin-bottom: 1.3rem;
  z-index: 2;
}

.final__estrellas {
  position: relative;
  font-size: clamp(2.2rem, 5.5vw, 3.4rem);
  letter-spacing: 0.1em;
  color: var(--amarillo);
  text-shadow:
    0 4px 0 var(--amarillo-oscuro),
    0 8px 16px rgba(224, 178, 21, 0.5);
  margin-bottom: 1.4rem;
  animation: latido 1.8s ease-in-out infinite;
  z-index: 2;
}

.final__resumen {
  position: relative;
  display: flex;
  justify-content: center;
  gap: clamp(0.8rem, 1.8vw, 1.6rem);
  margin-bottom: 1.3rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.7);
  border: 3px solid rgba(212, 165, 116, 0.5);
  border-radius: var(--radio-lg);
  z-index: 2;
  box-shadow: inset 0 2px 8px rgba(107, 68, 35, 0.08);
}

.resumen__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  min-width: 64px;
}

.resumen__emoji { font-size: clamp(1.1rem, 1.6vw, 1.4rem); }

.resumen__valor {
  font-family: var(--fuente-titulo);
  font-weight: 800;
  font-size: clamp(1.05rem, 1.5vw, 1.3rem);
  color: var(--tinta);
  line-height: 1;
}

.resumen__label {
  font-size: clamp(0.65rem, 0.85vw, 0.75rem);
  font-weight: 700;
  color: var(--tinta-suave);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.final__logros {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  margin-bottom: 1.4rem;
  z-index: 2;
}

.logro-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: linear-gradient(180deg, #fffbe9 0%, #ffeaa0 100%);
  border: 3px solid var(--amarillo-oscuro);
  padding: 0.5em 1em;
  border-radius: var(--radio-pill);
  box-shadow: 0 3px 0 var(--amarillo-oscuro);
  font-family: var(--fuente-titulo);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--tinta);
  animation: pop 0.5s ease both;
}

.logro-badge__emoji { font-size: 1.1rem; }

.final__acciones {
  position: relative;
  display: flex;
  gap: 0.9rem;
  justify-content: center;
  flex-wrap: wrap;
  z-index: 2;
  margin-bottom: 1.2rem;
}

.final__frase {
  position: relative;
  font-size: clamp(0.82rem, 1.1vw, 0.95rem);
  font-weight: 700;
  font-style: italic;
  color: var(--tinta-suave);
  z-index: 2;
  opacity: 0.9;
}

/* ------------------------------------------------------------
   17. CONFETI
   ------------------------------------------------------------ */
.confeti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  overflow: hidden;
}

.confeti__pieza {
  position: absolute;
  top: -10vh;
  width: 12px;
  height: 18px;
  border-radius: 3px;
  animation: caer-confeti linear forwards;
}

/* ------------------------------------------------------------
   18. RESPONSIVE
   ------------------------------------------------------------ */
@media (min-width: 1900px) {
  body { font-size: 17px; }
  #pantalla-juego.pantalla--activa { height: min(calc(100vh - 90px), 1000px); }
}

@media (max-width: 1400px) {
  .linea--horizontal,
  .mazo--horizontal { gap: 8px; }
}

@media (max-width: 1200px) {
  .linea--horizontal,
  .mazo--horizontal { gap: 6px; }
}

@media (max-width: 1024px) {
  #pantalla-juego.pantalla--activa {
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .pasos { grid-template-columns: repeat(2, 1fr); }
  .cuentos { grid-template-columns: repeat(2, 1fr); }

  .juego__cabecera {
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "salir info"
      "marcador marcador";
    gap: 0.8rem;
  }
  .juego__cabecera > .btn--icono { grid-area: salir; }
  .juego__info { grid-area: info; }
  .juego__marcador { grid-area: marcador; justify-content: center; flex-wrap: wrap; }

  .linea--horizontal,
  .mazo--horizontal { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 820px) {
  .juego__acciones { flex-direction: column; align-items: stretch; }
  .btn--accion-principal { width: 100%; min-width: 0; }
}

@media (max-width: 620px) {
  body { font-size: 15px; }

  #pantalla-inicio.pantalla--activa {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .inicio__espacio-animacion {
    min-height: 180px;
    flex: 0 0 auto;
    width: 100%;
  }

  .inicio__stats { flex-wrap: wrap; justify-content: center; padding: 0.7rem 1rem; }
  .stat__sep { display: none; }
  .stat { min-width: 70px; }

  .pasos { grid-template-columns: 1fr; }
  .cuentos { grid-template-columns: 1fr; }
  .cuento { padding: 1.8rem 1rem 1.4rem; }

  .linea--horizontal,
  .mazo--horizontal { grid-template-columns: repeat(2, 1fr); }

  .juego__acciones { flex-direction: column; }
  .btn--accion { justify-content: center; }

  .toasts {
    top: 10px;
    left: 10px;
    right: 10px;
    max-width: none;
    align-items: flex-start;
  }

  .toast {
    max-width: 100%;
    padding: 0.7rem 0.85rem;
  }

  .toast__emoji { font-size: 1.5rem; }
  .toast__titulo { font-size: 0.88rem; }
  .toast__texto { font-size: 0.76rem; }

  .mensaje {
    white-space: normal;
    max-width: 85vw;
    bottom: 90px;
  }
}

@media (max-width: 400px) {
  .inicio__titulo-linea { font-size: 2.4rem; }
}

@media (max-height: 560px) and (orientation: landscape) {
  .app { padding-top: 20px; align-items: flex-start; }

  #pantalla-juego.pantalla--activa {
    height: auto;
    max-height: none;
    overflow: visible;
  }
}

/* ------------------------------------------------------------
   19. ACCESIBILIDAD
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

@media (prefers-contrast: more) {
  :root {
    --tinta: #1a1006;
    --tinta-suave: #3a2a1a;
  }
  .carta, .hueco, .cuento, .zona { border-width: 4px; }
}