/* ==========================================================
   Especial de Halloween · ADIPA — estilos (mobile-first)
   Paleta y tipografía según Documentación/DESIGN.md
   ========================================================== */

:root {
  /* Marca */
  --purple: #704EFD;
  --cyan: #2CB7FF;
  --gray: #F3F4FF;
  --navy: #091E42;
  --light-blue: #CBE8FF;
  --lavender: #DFD5FF;
  /* Campaña (Halloween) — acentos 20 % */
  --orange: #FF7415;
  --yellow: #FFC728;
  /* Derivados de la base navy */
  --navy-deep: #06142E;
  --navy-night: #030A17;
  --ink: #020308;
  --text: #F3F4FF;
  --text-soft: rgba(223, 213, 255, .86);
  --line: rgba(223, 213, 255, .14);
  --surface: rgba(9, 30, 66, .78);

  --radius: 8px;
  --radius-lg: 16px;
  --font: "Poppins", Helvetica, sans-serif;
  --gutter: 20px;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  background: var(--navy-night);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  /* Degradado sutil: navy ADIPA arriba, más oscuro hacia abajo */
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(112, 78, 253, .16), transparent 60%),
    linear-gradient(180deg, #0B2250 0%, var(--navy) 22%, var(--navy-deep) 62%, var(--navy-night) 100%);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; border-radius: 4px; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--gray); color: var(--navy); padding: 10px 16px; border-radius: var(--radius);
  font-weight: 600; text-decoration: none; transition: top .2s;
}
.skip-link:focus { top: 16px; }

.icon { width: 1.25em; height: 1.25em; fill: currentColor; flex: none; }

.wrap {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left, 0px));
}
.wrap--narrow { max-width: 720px; }

main { position: relative; z-index: 2; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: 48px; padding: .8em 1.5em;
  border: 0; border-radius: 999px;
  font-weight: 600; font-size: 1rem; line-height: 1.2; text-decoration: none;
  cursor: pointer;
  transition: transform .25s var(--ease-out), box-shadow .25s, background-color .25s;
}
.btn--primary {
  background: var(--purple); color: #fff;
  box-shadow: 0 8px 24px rgba(112, 78, 253, .35), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(112, 78, 253, .55), inset 0 1px 0 rgba(255, 255, 255, .2); }
.btn--light { background: #fff; color: var(--navy); }
.btn--light:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(9, 30, 66, .35); }
.btn--xl { width: 100%; min-height: 60px; font-size: 1.125rem; font-weight: 700; }

/* ---------- Encabezados de sección ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: .5em;
  font-size: .78rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--orange);
}
.section {
  position: relative;
  padding-block: 56px 40px;
}
.section-head { text-align: center; max-width: 720px; margin: 0 auto 36px; display: grid; gap: 12px; justify-items: center; }
.section-title {
  font-size: clamp(1.6rem, 6.4vw, 2.6rem);
  line-height: 1.18; font-weight: 700; letter-spacing: -.01em;
  text-wrap: balance;
}
.section-lead { color: var(--text-soft); font-size: 1rem; max-width: 60ch; text-wrap: pretty; }
.section-slogan {
  font-size: clamp(1.05rem, 4.2vw, 1.3rem); font-weight: 500; color: var(--light-blue); text-wrap: balance;
}

/* ---------- Logo (full-color en caja blanca, según manual) ---------- */
.logo-pill {
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff; border-radius: 999px;
  padding: 12px 24px;
  transition: transform .25s var(--ease-out);
}
.logo-pill img { width: 112px; height: auto; }
.logo-pill:hover { transform: translateY(-1px); }
.logo-pill--sm img { width: 92px; }

/* ==========================================================
   AMBIENTE: murciélagos, araña, niebla
   ========================================================== */
.bats-layer {
  position: fixed; inset: 0; z-index: 1;
  pointer-events: none; overflow: hidden;
}
.bat {
  position: absolute; left: 0; top: 0;
  width: var(--size, 28px); height: calc(var(--size, 28px) / 2);
  will-change: transform;
}
.bat svg { width: 100%; height: 100%; overflow: visible; }
.bat .bat-body { fill: #000; stroke: rgba(223, 213, 255, .22); stroke-width: .8; }
.bat .wing, .deco-bat .wing { fill: #000; stroke: rgba(223, 213, 255, .22); stroke-width: .8; transform-box: view-box; transform-origin: 32px 14px; animation: flap var(--flap, .32s) ease-in-out infinite alternate; }
@keyframes flap { from { transform: scaleY(1); } to { transform: scaleY(-.35); } }

/* Araña que desciende con el scroll */
.spider-trail {
  position: fixed; top: 0; right: max(2px, env(safe-area-inset-right, 0px)); z-index: 3;
  width: 22px; height: 100vh; height: 100lvh;
  pointer-events: none;
}
.spider-svg { width: 100%; height: 100%; overflow: visible; }
.spider-thread { stroke: rgba(223, 213, 255, .35); stroke-width: .7; }
.spider { fill: #000; }
.spider-legs { stroke: #000; stroke-width: 1.2; }
.spider ellipse, .spider > circle:not(.spider-eye) { stroke: rgba(223, 213, 255, .3); stroke-width: .6; }
.spider-eye { fill: var(--orange); }

/* Niebla */
.fog { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.fog span {
  position: absolute; left: -50%; width: 200%; height: 100%; top: 0;
  background:
    radial-gradient(28% 45% at 15% 55%, rgba(223, 213, 255, .10), transparent 70%),
    radial-gradient(22% 38% at 42% 45%, rgba(203, 232, 255, .08), transparent 70%),
    radial-gradient(30% 50% at 68% 60%, rgba(223, 213, 255, .09), transparent 70%),
    radial-gradient(20% 40% at 90% 50%, rgba(203, 232, 255, .07), transparent 70%);
  animation: drift 46s linear infinite alternate;
}
.fog span + span { animation-duration: 64s; animation-direction: alternate-reverse; opacity: .8; top: 12%; }
@keyframes drift { from { transform: translateX(-12%); } to { transform: translateX(12%); } }


/* ==========================================================
   1) HERO
   ========================================================== */
.hero {
  position: relative;
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column;
  overflow: hidden;
  isolation: isolate;
}
.hero-content {
  position: relative; z-index: 2;
  flex: 1 0 auto;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding-top: max(24px, env(safe-area-inset-top, 0px));
  gap: 14px;
}
/* logo arriba; el bloque de texto se centra en el cielo disponible */
.hero-content .logo-pill { margin-bottom: auto; }
.hero-content .hero-title { margin-top: 28px; }
.hero-lead { margin-bottom: auto; }

/* Cielo estrellado (dos capas con distinto patrón para que no se note la repetición) */
.stars, .stars::after {
  position: absolute; inset: 0 0 30% 0; pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, #000 40%, transparent);
          mask-image: linear-gradient(180deg, #000 40%, transparent);
}
.stars {
  background-image:
    radial-gradient(1.2px 1.2px at 23px 41px, rgba(243, 244, 255, .9), transparent),
    radial-gradient(1px 1px at 97px 133px, rgba(243, 244, 255, .7), transparent),
    radial-gradient(1.4px 1.4px at 161px 19px, rgba(223, 213, 255, .9), transparent),
    radial-gradient(1px 1px at 201px 187px, rgba(203, 232, 255, .7), transparent),
    radial-gradient(1px 1px at 59px 211px, rgba(243, 244, 255, .6), transparent);
  background-size: 233px 241px;
  opacity: .7;
}
.stars::after {
  content: "";
  background-image:
    radial-gradient(1.3px 1.3px at 41px 77px, rgba(243, 244, 255, .95), transparent),
    radial-gradient(1px 1px at 143px 29px, rgba(203, 232, 255, .8), transparent),
    radial-gradient(1.6px 1.6px at 271px 151px, rgba(255, 199, 40, .7), transparent),
    radial-gradient(1px 1px at 197px 263px, rgba(223, 213, 255, .8), transparent);
  background-size: 317px 293px;
  animation: twinkle 4.5s ease-in-out infinite alternate;
}
@keyframes twinkle { from { opacity: .25; } to { opacity: 1; } }
.hero-title { display: grid; line-height: 1; gap: 6px; margin-top: 2px; }
.hero-title-small {
  font-size: clamp(1.15rem, 5.5vw, 2rem); font-weight: 600; color: var(--lavender); letter-spacing: .02em;
}
.hero-title-big {
  font-size: clamp(3rem, 16vw, 7.5rem); font-weight: 800; letter-spacing: -.025em;
  color: var(--gray);
  text-shadow: 0 0 28px rgba(112, 78, 253, .75), 0 0 80px rgba(112, 78, 253, .45);
}
.hero-lead {
  /* mobile: casi todo el ancho; desktop: bloque amplio de ~900px */
  width: 100%; max-width: 900px; color: var(--text-soft);
  font-size: clamp(1.05rem, 4.4vw, 1.45rem); line-height: 1.5;
  text-wrap: balance; margin-top: 6px;
}

/* Murciélagos decorativos (hero y episodios) */
.deco-bats { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.deco-bat {
  position: absolute; top: var(--top); left: var(--left, auto); right: var(--right, auto);
  width: var(--w); height: calc(var(--w) / 2);
  overflow: visible;
  fill: #000; stroke: rgba(223, 213, 255, .28); stroke-width: .9;
  animation: hover-fly var(--dur, 9s) ease-in-out var(--delay, 0s) infinite;
}
@keyframes hover-fly {
  0%, 100% { transform: translate(0, 0) rotate(-4deg); }
  25% { transform: translate(-16px, -10px) rotate(3deg); }
  50% { transform: translate(-5px, -20px) rotate(-2deg); }
  75% { transform: translate(12px, -7px) rotate(5deg); }
}

.hero-scene {
  --moon: min(98vw, 400px);
  /* mobile: castillo completo (todas las torres), escalado por altura */
  --scene-h: clamp(190px, 52vw, 340px);
  position: relative; z-index: 1;
  flex: none;
  margin-top: auto;
  height: var(--scene-h);
}
.moon {
  position: absolute; left: 50%; top: calc(26% - var(--moon) / 2);
  width: var(--moon); aspect-ratio: 1;
  margin-left: calc(var(--moon) / -2);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, rgba(243, 244, 255, .95) 0 18%, rgba(223, 213, 255, .6) 30%, rgba(112, 78, 253, .2) 52%, transparent 70%);
  filter: blur(6px);
  will-change: transform;
}
/* El SVG usa "meet" con viewBox 0 -50 1440 470 (incluye la aguja central):
   nunca se recorta arriba. Su ancho es al menos el del castillo escalado a la
   altura de la escena (1440/470 = 3.064), y la colina se extiende a los lados. */
.castle {
  --castle-w: max(100%, calc(var(--scene-h, 300px) * 3.064));
  position: absolute; bottom: 0; left: 50%;
  width: var(--castle-w); height: 100%;
  margin-left: calc(var(--castle-w) / -2);
  overflow: visible;
  fill: var(--ink); color: var(--ink);
  will-change: transform;
}
/* Contenedor fijo con el desvanecido inferior: al hacer scroll el castillo
   baja (parallax) y se funde con la niebla, sin cortes rectos.
   Es más ancho que la pantalla para no recortar la colina extendida. */
.castle-wrap {
  position: absolute; top: 0; bottom: 0; left: -100vw; right: -100vw;
  -webkit-mask-image: linear-gradient(180deg, #000 72%, transparent 100%);
          mask-image: linear-gradient(180deg, #000 72%, transparent 100%);
}
.castle-wrap .castle { --castle-w: max(100vw, calc(var(--scene-h, 300px) * 3.064)); }
.castle .win {
  fill: var(--yellow);
  animation: flicker var(--dur, 3s) ease-in-out var(--del, 0s) infinite;
}
.castle .win:nth-child(3n) { fill: var(--orange); }
@keyframes flicker {
  0%, 100% { opacity: .9; }
  18% { opacity: .55; }
  22% { opacity: .95; }
  48% { opacity: .7; }
  52% { opacity: 1; }
  76% { opacity: .62; }
}
.fog--hero { top: auto; bottom: -10px; height: 46%; }

/* ==========================================================
   2) EPISODIOS
   ========================================================== */
.section--episodes { overflow-x: clip; }
.section--episodes .deco-bats { z-index: 0; }
.section--episodes .deco-bat { opacity: .85; }
.section--episodes > .wrap { position: relative; z-index: 1; }
.deco-bat--desk { display: none; }
.episodes { display: grid; gap: 22px; }
.episode {
  position: relative;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(112, 78, 253, .12), rgba(9, 30, 66, .55) 45%), var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform .35s var(--ease-out), box-shadow .35s, border-color .35s;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.episode-cover { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--navy); }
.episode-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease-out); }
.episode-badge {
  position: absolute; left: 12px; top: 12px;
  background: rgba(2, 3, 8, .72); color: var(--gray);
  font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  padding: 6px 12px; border-radius: 999px;
  border: 1px solid rgba(255, 116, 21, .6);
}
.episode-body { display: flex; flex-direction: column; gap: 12px; padding: 20px 20px 22px; flex: 1; }
.episode-title { font-size: 1.12rem; line-height: 1.35; font-weight: 700; text-wrap: pretty; }
.episode-guest { display: flex; gap: 8px; align-items: flex-start; color: var(--light-blue); font-size: .9rem; line-height: 1.45; }
.episode-guest .icon { margin-top: 2px; color: var(--cyan); }
.episode-guest strong { font-weight: 600; }
.episode-desc { color: var(--text-soft); font-size: .95rem; }
.episode-link { margin-top: auto; align-self: stretch; }
/* toda la tarjeta clicable (un solo enlace) */
.episode-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.episode:hover, .episode:focus-within {
  transform: translateY(-6px);
  border-color: rgba(112, 78, 253, .7);
  box-shadow: 0 18px 48px rgba(112, 78, 253, .35), 0 0 0 1px rgba(112, 78, 253, .35), 0 0 60px rgba(112, 78, 253, .25);
}
.episode:hover .episode-cover img { transform: scale(1.04); }
.episode:hover .episode-link { transform: none; }

/* ==========================================================
   3) CUPÓN PARA RASPAR
   ========================================================== */
/* Tono claro para destacar secciones, con entrada y salida suaves.
   Diccionario: #1C2A4E. Cupón: un tono más claro, mezcla de navy y morado ADIPA. */
.section--coupon, .section--dict {
  --lit-bg: #1C2A4E;
  background: linear-gradient(180deg, transparent 0, var(--lit-bg) 110px, var(--lit-bg) calc(100% - 130px), transparent 100%);
}
.section--coupon {
  --lit-bg: color-mix(in srgb, var(--navy) 84%, var(--lavender)); /* ≈ #2B3B60 */
  padding-block: 96px 88px;
}
.section-head--wide { max-width: 800px; }
/* sobre el fondo más claro, la etiqueta usa el amarillo de campaña (descuentos): contraste 8:1 */
.section--coupon .eyebrow { color: var(--yellow); }
.section-head--wide .section-lead { max-width: none; }

.scratch { position: relative; display: grid; justify-items: center; gap: 14px; }
.scratch[hidden] { display: none; }
.scratch-card {
  position: relative;
  width: 100%; max-width: 520px;
  min-height: 270px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(2, 3, 8, .55), 0 0 0 1px rgba(223, 213, 255, .16);
  /* muescas de ticket */
  -webkit-mask: radial-gradient(14px at 0 50%, transparent 98%, #000) left / 51% 100% no-repeat,
                radial-gradient(14px at 100% 50%, transparent 98%, #000) right / 51% 100% no-repeat;
          mask: radial-gradient(14px at 0 50%, transparent 98%, #000) left / 51% 100% no-repeat,
                radial-gradient(14px at 100% 50%, transparent 98%, #000) right / 51% 100% no-repeat;
  transition: box-shadow .6s;
}
/* Ticket revelado: morado con brillo leve y borde fino translúcido.
   Va en el flujo (no absoluto) para que la tarjeta crezca con el contenido;
   el canvas de raspe la cubre completa. */
.scratch-prize {
  position: relative;
  min-height: inherit;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  padding: 30px 16px 26px;
  text-align: center;
  border-radius: inherit;
  background:
    radial-gradient(90% 75% at 50% -10%, rgba(223, 213, 255, .32), transparent 60%),
    radial-gradient(60% 60% at 100% 110%, rgba(44, 183, 255, .16), transparent 70%),
    linear-gradient(165deg, color-mix(in srgb, var(--purple) 58%, var(--navy)) 0%, color-mix(in srgb, var(--purple) 34%, var(--navy)) 100%);
  box-shadow: inset 0 0 0 1px rgba(223, 213, 255, .34), inset 0 1px 0 rgba(255, 255, 255, .3);
}
.prize-kicker { font-size: clamp(1.1rem, 4.8vw, 1.35rem); font-weight: 600; color: #fff; }
.prize-tickets { display: grid; gap: 14px; width: 100%; }
.prize-ticket { display: grid; justify-items: center; gap: 16px; width: 100%; min-width: 0; }
/* Colombia: dos tickets dentro de la misma tarjeta */
.prize-tickets--double .prize-ticket {
  padding: 18px 14px;
  border-radius: 12px;
  background: rgba(9, 30, 66, .35);
  border: 1px solid rgba(223, 213, 255, .2);
}
.prize-code-wrap { width: 100%; container-type: inline-size; }
.prize-code {
  display: block; width: 100%;
  font-family: var(--font);
  font-weight: 700; color: #fff;
  letter-spacing: .06em;
  /* el código siempre cabe en una línea: el tamaño sale del ancho del recuadro
     y del largo del código (--chars), con tope de 1.9rem */
  font-size: clamp(.95rem, 4.6vw, 1.9rem);
  font-size: min(2.2rem, calc(86cqi / (var(--chars, 16) * .82)));
  line-height: 1.2;
  padding: 18px 6px 18px calc(6px + .08em);
  letter-spacing: .08em;
  /* recuadro destacado: morado intenso → lila brillante, con brillo alrededor */
  background: linear-gradient(120deg, color-mix(in srgb, var(--purple) 82%, var(--navy)) 0%, var(--purple) 45%, #9F86FF 100%);
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 12px;
  text-shadow: 0 2px 10px rgba(9, 30, 66, .45);
  box-shadow: 0 0 0 4px rgba(125, 97, 241, .22), 0 0 30px rgba(159, 134, 255, .6), 0 12px 28px rgba(2, 3, 8, .45), inset 0 1px 0 rgba(255, 255, 255, .35);
  white-space: nowrap;
  user-select: all;
}
.prize-details {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 6px;
  max-width: 34em;
  font-size: .84rem; line-height: 1.45; color: rgba(255, 255, 255, .86);
}
.prize-details li { text-wrap: balance; }
.prize-validity { font-size: .74rem; color: rgba(223, 213, 255, .8); text-wrap: balance; }
.btn-copy { min-width: 190px; }
.scratch-prize .btn--primary { box-shadow: 0 10px 26px rgba(9, 30, 66, .45), inset 0 0 0 1px rgba(255, 255, 255, .45); }
.scratch-prize .btn--primary:hover { box-shadow: 0 14px 32px rgba(9, 30, 66, .55), inset 0 0 0 1px rgba(255, 255, 255, .7); }
.btn-copy.is-copied { background: #fff; color: var(--purple); }
.btn--ghost {
  background: transparent; color: #fff;
  border: 1px solid rgba(255, 255, 255, .6);
}
.btn--ghost:hover { background: rgba(255, 255, 255, .14); transform: translateY(-2px); }
.prize-use { min-width: 190px; }
.copy-feedback { min-height: 1.2em; margin-top: 6px; text-align: center; font-size: .85rem; color: var(--lavender); }

/* Estado "detectando país": loader sobre la tarjeta y raspe bloqueado */
.scratch-loading { display: none; }
.js [data-state="loading"] .scratch-loading {
  position: absolute; inset: 0; z-index: 4;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: rgba(3, 10, 23, .5);
  color: var(--gray); font-size: .9rem; font-weight: 500;
}
.scratch-loading svg { width: 52px; height: 26px; fill: #000; stroke: rgba(223, 213, 255, .7); stroke-width: 1; animation: loader-bat 1s ease-in-out infinite alternate; }
.js [data-state="loading"] .scratch-hint { opacity: 0; }
.js [data-state="loading"] .scratch-canvas { pointer-events: none; cursor: progress; }
.js [data-state="loading"] .scratch-skip { visibility: hidden; }

/* Colombia: tarjeta más ancha para dos tickets */
.coupon[data-state="co"] .scratch-card { max-width: 860px; }

/* Otro país: mensaje + selector */
.coupon-other {
  max-width: 600px; margin: 0 auto;
  display: grid; justify-items: center; gap: 18px;
  padding: 28px 20px;
  border-radius: var(--radius-lg);
  background: rgba(9, 30, 66, .55);
  border: 1px solid var(--line);
  text-align: center;
}
.coupon-other[hidden] { display: none; }
.coupon-other-text { font-size: clamp(1.02rem, 4.2vw, 1.2rem); font-weight: 500; color: var(--gray); text-wrap: balance; }

/* Selector manual de país */
.country-options { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.social-flag { width: 22px; height: 15px; flex: none; border-radius: 3px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .25); }
.country-btn {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 48px; padding: 10px 18px;
  border-radius: 999px;
  background: rgba(112, 78, 253, .2);
  border: 1px solid rgba(223, 213, 255, .32);
  color: var(--gray); font-weight: 600; font-size: .95rem; cursor: pointer;
  transition: background-color .2s, transform .2s, border-color .2s;
}
.country-btn:hover { background: rgba(112, 78, 253, .45); transform: translateY(-2px); }
.country-btn[aria-pressed="true"] { background: var(--purple); border-color: rgba(255, 255, 255, .6); }

.scratch-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  touch-action: none; cursor: grab;
  transition: opacity .8s ease;
}
.scratch-canvas:active { cursor: grabbing; }
.scratch-hint, .scratch-skip { display: none; }
.js .scratch-skip { display: inline-block; }
.js .scratch-hint {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  pointer-events: none; text-align: center;
  transition: opacity .5s;
}
.scratch-hint-title {
  font-size: clamp(1.6rem, 8vw, 2.2rem); font-weight: 800; color: var(--gray);
  text-shadow: 0 0 22px rgba(112, 78, 253, .9);
  animation: pulse 1.8s ease-in-out infinite;
}
.scratch-hint-sub { font-size: .85rem; color: var(--lavender); opacity: .85; }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: .9; } 50% { transform: scale(1.08); opacity: 1; } }

.scratch-card.is-scratching .scratch-hint { opacity: 0; }
.scratch-card.is-revealed .scratch-canvas { opacity: 0; pointer-events: none; }
.scratch-card.is-revealed { box-shadow: 0 24px 70px rgba(112, 78, 253, .55), 0 0 0 1px rgba(223, 213, 255, .3), 0 0 90px rgba(44, 183, 255, .35); }
.scratch-card.is-revealed .scratch-prize > * { animation: come-forward .9s var(--ease-out) both; }
.scratch-card.is-revealed .scratch-prize > :nth-child(2) { animation-delay: .08s; }
.scratch-card.is-revealed .scratch-prize > :nth-child(3) { animation-delay: .16s; }
@keyframes come-forward {
  0% { transform: scale(.78); opacity: .2; filter: drop-shadow(0 0 0 rgba(223, 213, 255, 0)); }
  55% { transform: scale(1.1); opacity: 1; filter: drop-shadow(0 0 22px rgba(223, 213, 255, .8)); }
  100% { transform: scale(1); opacity: 1; filter: drop-shadow(0 0 0 rgba(223, 213, 255, 0)); }
}
.scratch-bats { position: absolute; left: 50%; top: 50%; width: 0; height: 0; pointer-events: none; z-index: 5; }
.flock-bat { position: absolute; left: -18px; top: -9px; width: 36px; height: 18px; }
.flock-bat svg { width: 100%; height: 100%; fill: #000; stroke: rgba(223, 213, 255, .35); stroke-width: 1; }

.js .scratch-skip {
  background: none; border: 0; padding: 8px 12px;
  color: var(--lavender); font-size: .85rem; text-decoration: underline; text-underline-offset: 3px;
  cursor: pointer; opacity: .7;
}
.scratch-skip:hover, .scratch-skip:focus-visible { opacity: 1; }
.scratch.is-done .scratch-skip { visibility: hidden; }

/* ==========================================================
   4) EBOOK HOJEABLE
   ========================================================== */
.book { position: relative; display: grid; justify-items: center; gap: 14px; }
.book-stage {
  position: relative;
  width: 100%; max-width: 980px;
  margin-inline: auto;
}
.book-stage::before {
  /* brillo morado detrás del libro */
  content: ""; position: absolute; left: 50%; top: 50%; z-index: 0;
  width: 92%; height: 82%; transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(112, 78, 253, .55), rgba(112, 78, 253, .18) 60%, transparent);
  filter: blur(30px);
  pointer-events: none;
}
.book-fallback { position: relative; z-index: 1; width: min(100%, 420px); margin: 0 auto; }
.book-fallback img {
  width: 100%; border-radius: 4px;
  box-shadow: 0 30px 60px rgba(2, 3, 8, .65), 0 0 50px rgba(112, 78, 253, .45);
}
.book-loader { display: none; }
.js .book-loader {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: rgba(3, 10, 23, .55);
  border-radius: 4px;
  color: var(--gray); font-size: .9rem; font-weight: 500;
}
.book-loader svg { width: 56px; height: 28px; fill: #000; stroke: rgba(223, 213, 255, .6); stroke-width: 1; animation: loader-bat 1s ease-in-out infinite alternate; }
@keyframes loader-bat { from { transform: translateY(-6px) scaleY(1); } to { transform: translateY(6px) scaleY(.7); } }
.book.is-failed .book-loader { display: none; }

.flipbook { position: relative; z-index: 1; display: none; outline: none; transition: transform .7s var(--ease-out); }
.flipbook:focus-visible { outline: 3px solid var(--cyan); outline-offset: 10px; }
.book.is-ready .flipbook { display: block; }
.book.is-ready .book-fallback { display: none; }

.page { background: #fff; overflow: hidden; }
.page img { width: 100%; height: 100%; object-fit: cover; display: block; user-select: none; -webkit-user-drag: none; }
.page img:not([src]) { visibility: hidden; }
.page::before { /* placeholder mientras carga */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(110deg, #e9eaf7 30%, #f6f6ff 50%, #e9eaf7 70%) 0 0 / 200% 100%;
  animation: shimmer 1.4s linear infinite;
  z-index: -1;
}
@keyframes shimmer { to { background-position: -200% 0; } }
.page--cover { box-shadow: inset -6px 0 14px rgba(0, 0, 0, .35); }
.page--cover img { filter: saturate(1.05); }
.stf__parent .page--cover { outline: 1px solid rgba(223, 213, 255, .25); }

.book-nav {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  width: 100%;
}
.book-nav[hidden] { display: none; }
.book-arrow {
  display: inline-grid; place-items: center;
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(112, 78, 253, .22); border: 1px solid rgba(223, 213, 255, .28);
  color: var(--gray); cursor: pointer;
  transition: background-color .2s, transform .2s;
}
.book-arrow:hover { background: var(--purple); transform: scale(1.06); }
.book-arrow:disabled { opacity: .35; cursor: default; transform: none; background: rgba(112, 78, 253, .12); }
.book-arrow .icon { width: 22px; height: 22px; }
.book-counter { min-width: 150px; text-align: center; font-weight: 600; font-size: .95rem; color: var(--lavender); font-variant-numeric: tabular-nums; }
.book-help { font-size: .8rem; color: var(--text-soft); opacity: .8; text-align: center; }
.book-help[hidden] { display: none; }

.ebook-cta { display: grid; justify-items: center; gap: 8px; margin-top: 30px; }
.ebook-cta .btn--xl {
  background: linear-gradient(135deg, var(--purple), #8a6dff);
  box-shadow: 0 14px 40px rgba(112, 78, 253, .55), 0 0 0 1px rgba(223, 213, 255, .25), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.ebook-cta .btn--xl .icon { width: 1.4em; height: 1.4em; }
.ebook-cta-note { font-size: .8rem; color: var(--text-soft); }

/* ==========================================================
   5) DICCIONARIO DEL MIEDO
   ========================================================== */
.section--dict { padding-block: 88px 96px; }
.dict { position: relative; }
.dict-viewport {
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  padding-block: 10px 44px; /* espacio para la sombra de las tarjetas */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.dict-viewport::-webkit-scrollbar { display: none; }
.dict-track {
  list-style: none; margin: 0; padding: 0 0 0 var(--gutter);
  display: flex; gap: 16px; width: max-content;
}
.dict-card { width: min(78vw, 290px); height: 340px; perspective: 1200px; flex: none; }
.dict-inner {
  position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d;
  transition: transform .7s var(--ease-out);
}
.dict-card.is-flipped .dict-inner { transform: rotateY(180deg); }
.dict-face {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  padding: 22px 20px 20px;
  border-radius: var(--radius-lg);
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
  overflow: hidden;
}
.dict-front {
  box-shadow: 0 14px 34px rgba(2, 3, 8, .45);
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(112, 78, 253, .32), transparent 55%),
    linear-gradient(180deg, rgba(14, 38, 84, .95), rgba(6, 20, 46, .97));
  border: 1px solid var(--line);
}
.dict-front::after { /* telaraña decorativa */
  content: ""; position: absolute; right: -8px; top: -8px; width: 92px; height: 92px; opacity: .22;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%23DFD5FF' stroke-width='1.2' stroke-linecap='round'%3E%3Cpath d='M120 0L0 0M120 0L120 120M120 0L8 46M120 0L36 84M120 0L74 112'/%3E%3Cpath d='M96 0Q100 8 98 9Q106 14 105 15Q111 20 111 22Q118 21 120 24'/%3E%3Cpath d='M70 0Q78 16 74 19Q90 28 88 32Q98 42 101 46Q106 44 120 50'/%3E%3Cpath d='M42 0Q54 24 50 30Q72 42 70 50Q84 64 90 70Q98 66 120 78'/%3E%3C/g%3E%3C/svg%3E") no-repeat center / contain;
}
.dict-back {
  transform: rotateY(180deg);
  background: linear-gradient(160deg, var(--purple), #4b2fc4 70%, #3a24a0);
  border: 1px solid rgba(223, 213, 255, .3);
}
.dict-num { font-size: 2.6rem; font-weight: 800; line-height: 1; color: rgba(223, 213, 255, .14); }
.dict-term { margin-top: auto; font-size: 1.45rem; line-height: 1.2; font-weight: 700; color: var(--gray); text-wrap: balance; }
.dict-hook { margin-top: 8px; font-size: 1rem; font-weight: 500; color: var(--orange); text-wrap: balance; }
.dict-back-term { font-size: .78rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--light-blue); }
.dict-def { margin-top: 10px; font-size: .92rem; line-height: 1.55; color: #fff; }
.dict-btn {
  margin-top: 18px; align-self: flex-start;
  display: inline-flex; align-items: center; gap: .45em;
  min-height: 44px; padding: .6em 1.2em;
  border-radius: 999px; border: 1px solid rgba(223, 213, 255, .4);
  background: rgba(112, 78, 253, .25); color: var(--gray);
  font-weight: 600; font-size: .9rem; cursor: pointer;
  transition: background-color .2s, transform .2s;
}
.dict-btn:hover { background: var(--purple); transform: translateY(-1px); }
.dict-btn--back { margin-top: auto; background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .45); }
.dict-btn--back:hover { background: #fff; color: var(--purple); }
.dict-help { text-align: center; font-size: .8rem; color: var(--text-soft); opacity: .75; margin-top: -18px; padding-inline: var(--gutter); }

/* Flechas del carrusel: centradas en la altura de las tarjetas */
.dict-arrow {
  position: absolute; z-index: 3;
  top: calc(10px + var(--card-h, 340px) * .4); /* zona libre de la tarjeta, sobre el término */
  transform: translateY(-50%);
  display: grid; place-items: center;
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(9, 30, 66, .88);
  border: 1px solid rgba(223, 213, 255, .38);
  color: var(--gray); cursor: pointer;
  box-shadow: 0 8px 22px rgba(2, 3, 8, .55);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: background-color .2s, transform .2s, border-color .2s;
}
.dict-arrow .icon { width: 22px; height: 22px; }
.dict-arrow:hover { background: var(--purple); border-color: rgba(255, 255, 255, .6); transform: translateY(-50%) scale(1.06); }
.dict-arrow:active { transform: translateY(-50%) scale(.96); }
.dict-arrow--prev { left: max(6px, env(safe-area-inset-left, 0px)); }
.dict-arrow--next { right: max(6px, env(safe-area-inset-right, 0px)); }

/* ==========================================================
   5b) NOTICIAS
   ========================================================== */
.section--news { overflow-x: clip; padding-bottom: 24px; }
.section--news .deco-bats { z-index: 0; }
.section--news .deco-bat { opacity: .85; }
.section--news > .wrap { position: relative; z-index: 1; }

/* Mobile: carrusel con scroll-snap (una tarjeta y asoma la siguiente) */
.news-track {
  display: flex; gap: 14px;
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  margin-inline: calc(var(--gutter) * -1);
  padding: 6px var(--gutter) 22px;
  scroll-padding-inline: var(--gutter);
}
.news-track::-webkit-scrollbar { display: none; }
.news-card {
  position: relative;
  flex: 0 0 85vw; /* ~85 % de la pantalla: asoma la siguiente tarjeta */
  max-width: 400px;
  scroll-snap-align: start;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(112, 78, 253, .1), rgba(9, 30, 66, .55) 40%), var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 12px;
  transition: transform .35s var(--ease-out), box-shadow .35s, border-color .35s;
}
.news-media { aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: var(--navy); }
.news-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease-out); }
.news-body { display: flex; flex-direction: column; gap: 10px; padding: 16px 8px 8px; flex: 1; }
.news-tag {
  align-self: flex-start;
  font-size: .7rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--lavender);
  background: rgba(112, 78, 253, .22);
  border: 1px solid rgba(223, 213, 255, .28);
  border-radius: 999px; padding: 4px 10px;
}
.news-title {
  font-size: 1.1rem; line-height: 1.32; font-weight: 700; color: var(--gray); text-wrap: pretty;
  /* el título nunca se corta a mitad de palabra */
  overflow-wrap: normal; word-break: normal; -webkit-hyphens: none; hyphens: none;
}
.news-meta { display: flex; flex-wrap: wrap; gap: 2px 6px; font-size: .78rem; color: var(--light-blue); opacity: .9; }
.news-excerpt {
  font-size: .9rem; line-height: 1.5; color: var(--text-soft);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.news-link { margin-top: auto; align-self: stretch; }
/* toda la tarjeta clicable (un solo enlace) */
.news-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.news-card:hover, .news-card:focus-within {
  transform: translateY(-6px);
  border-color: rgba(112, 78, 253, .7);
  box-shadow: 0 18px 48px rgba(112, 78, 253, .35), 0 0 0 1px rgba(112, 78, 253, .35), 0 0 60px rgba(112, 78, 253, .25);
}
.news-card:hover .news-media img { transform: scale(1.04); }
.news-card:hover .news-link { transform: none; }
/* Puntos de posición del carrusel (solo mobile) */
.news-dots { display: flex; justify-content: center; gap: 4px; margin-top: 2px; }
.news-dot-btn {
  /* área táctil de 32px con un punto visible de 8px */
  display: grid; place-items: center;
  width: 32px; height: 32px; padding: 0;
  background: none; border: 0; cursor: pointer;
}
.news-dot-btn::before {
  content: ""; width: 8px; height: 8px; border-radius: 999px;
  background: rgba(223, 213, 255, .35);
  transition: width .3s var(--ease-out), background-color .3s;
}
.news-dot-btn[aria-current="true"]::before { width: 24px; background: var(--lavender); }
.news-all { display: flex; justify-content: center; margin-top: 14px; }
.news-all .btn { gap: .5em; width: 100%; } /* mobile: ancho completo */
.news-all .icon { width: 1.1em; height: 1.1em; }

/* ==========================================================
   6) CIERRE (castillo) + FOOTER
   ========================================================== */
/* Cierre visual: castillo completo, protagonista, que se funde hacia el negro del footer */
.closing {
  --scene-h: clamp(210px, 40vw, 560px);      /* alto del castillo */
  --moon: calc(var(--scene-h) * 1.05);
  position: relative;
  height: calc(var(--scene-h) * 1.45);
  margin-top: 24px;
  overflow: hidden;
  pointer-events: none;
}
.moon--closing {
  /* halo de luna detrás de la torre central */
  top: auto; bottom: calc(var(--scene-h) * .42);
  background: radial-gradient(circle at 50% 50%,
    rgba(243, 244, 255, .9) 0 13%, rgba(223, 213, 255, .55) 24%,
    rgba(112, 78, 253, .32) 42%, rgba(112, 78, 253, .1) 58%, transparent 70%);
  filter: blur(8px);
  animation: halo 7s ease-in-out infinite alternate;
}
@keyframes halo { from { opacity: .85; transform: scale(.97); } to { opacity: 1; transform: scale(1.03); } }
.castle--closing { top: auto; bottom: 0; height: var(--scene-h); }
/* la parte baja del castillo se funde hacia el negro del footer */
.closing-fade {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  height: calc(var(--scene-h) * .42);
  background: linear-gradient(180deg, rgba(2, 3, 8, 0) 0%, rgba(2, 3, 8, .75) 55%, var(--ink) 100%);
}

/* Luciérnagas: suben lentamente con un brillo cálido */
.fireflies { position: absolute; inset: 0; z-index: 1; }
.fireflies span {
  position: absolute; left: var(--x); bottom: 6%;
  width: var(--s); height: var(--s); border-radius: 50%;
  background: radial-gradient(circle, #FFF6C9 0 30%, var(--yellow) 55%, rgba(255, 199, 40, 0) 72%);
  box-shadow: 0 0 10px 3px rgba(255, 199, 40, .55), 0 0 22px 6px rgba(255, 116, 21, .25);
  opacity: 0;
  animation: firefly var(--d) linear var(--delay) infinite;
}
.fireflies .ff-desk { display: none; }
@keyframes firefly {
  0% { transform: translate(0, 0); opacity: 0; }
  10% { opacity: .95; }
  30% { transform: translate(var(--drift), -18vh); opacity: .4; }
  50% { transform: translate(calc(var(--drift) * -.6), -30vh); opacity: 1; }
  75% { transform: translate(var(--drift), -44vh); opacity: .5; }
  100% { transform: translate(calc(var(--drift) * -.3), -56vh); opacity: 0; }
}

/* Footer real: fondo negro, ancho completo */
.site-footer {
  position: relative; z-index: 2;
  background: var(--ink);
  padding-block: 8px max(28px, env(safe-area-inset-bottom, 0px));
  color: var(--text);
}
.footer-inner { display: grid; gap: 34px; }
.footer-title {
  text-align: center;
  font-size: clamp(1.5rem, 6vw, 2.4rem); font-weight: 700; line-height: 1.2; text-wrap: balance;
}
.footer-cols { display: grid; gap: 14px; }
.footer-col {
  display: grid; justify-items: center; align-content: start; gap: 12px;
  text-align: center;
  padding: 22px 18px;
  border-radius: var(--radius-lg);
  background: rgba(9, 30, 66, .55);
  border: 1px solid var(--line);
}
.footer-col-title { font-size: 1.1rem; font-weight: 600; color: var(--gray); }
.footer-col-text { font-size: .9rem; color: var(--text-soft); max-width: 30ch; }
.footer-col .btn { margin-top: 4px; min-width: 220px; }
.footer-site { gap: .5em; }
.footer-site .icon { width: 1.1em; height: 1.1em; }

.social-icons { list-style: none; margin: 4px 0 0; padding: 0; display: flex; gap: 12px; justify-content: center; }
.social-icon {
  display: grid; place-items: center;
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(112, 78, 253, .2);
  border: 1px solid rgba(223, 213, 255, .32);
  color: var(--gray);
  transition: background-color .2s, transform .2s, border-color .2s;
}
.social-icon .icon { width: 24px; height: 24px; }
.social-icon:hover { background: var(--purple); border-color: rgba(255, 255, 255, .6); transform: translateY(-2px); }

/* Bolsa de empleos: franja compacta y discreta */
.footer-jobs {
  display: grid; justify-items: center; gap: 14px;
  text-align: center;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: rgba(223, 213, 255, .045);
  border: 1px solid rgba(223, 213, 255, .22);
}
.footer-jobs-text { display: grid; justify-items: center; gap: 10px; }
.footer-jobs-icon {
  display: grid; place-items: center; flex: none;
  width: 44px; height: 44px; border-radius: 12px;
  background: rgba(112, 78, 253, .2); color: var(--lavender);
}
.footer-jobs-icon .icon { width: 22px; height: 22px; }
.footer-jobs-title { font-size: 1rem; font-weight: 600; color: var(--gray); }
.footer-jobs-desc { font-size: .85rem; color: var(--text-soft); }
.footer-jobs-btn { width: 100%; min-height: 48px; }

.footer-countries { display: grid; justify-items: center; gap: 14px; padding-top: 26px; border-top: 1px solid rgba(223, 213, 255, .12); }
.footer-countries-title { font-size: .85rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--lavender); }
.country-flags {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px;
  width: 100%; max-width: 420px;
}
.flag-link {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(223, 213, 255, .18);
  background: rgba(255, 255, 255, .03);
  color: var(--text-soft); text-decoration: none; font-weight: 500; font-size: .95rem;
  transition: background-color .2s, border-color .2s, color .2s, box-shadow .2s;
}
.flag-link:hover { background: rgba(112, 78, 253, .2); color: var(--gray); }
.flag-svg { width: 26px; height: 17px; flex: none; border-radius: 3px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .25); }
/* país detectado: borde y brillo lila */
.flag-link.is-current {
  color: #fff; font-weight: 600;
  border-color: var(--lavender);
  background: rgba(112, 78, 253, .28);
  box-shadow: 0 0 0 1px rgba(223, 213, 255, .5), 0 0 22px rgba(125, 97, 241, .65);
}

.footer-bottom {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding-top: 22px; border-top: 1px solid rgba(223, 213, 255, .12);
}
.footer-copy { font-size: .85rem; color: var(--text-soft); }

/* Modo de prueba (?debug=1) */
.debug-badge {
  position: fixed; left: 10px; bottom: max(10px, env(safe-area-inset-bottom, 0px)); z-index: 50;
  max-width: calc(100vw - 20px);
  padding: 6px 10px; border-radius: 6px;
  background: rgba(2, 3, 8, .88); border: 1px solid rgba(223, 213, 255, .35);
  color: var(--lavender); font: 500 .72rem/1.35 ui-monospace, Consolas, monospace;
  pointer-events: none;
}

/* ==========================================================
   Animaciones de entrada (IntersectionObserver)
   ========================================================== */
.js [data-reveal] .rv {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .8s var(--ease-out), transform .8s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 90ms);
}
.js [data-reveal].is-in .rv { opacity: 1; transform: none; }

/* ==========================================================
   Breakpoints
   ========================================================== */
@media (min-width: 600px) {
  :root { --gutter: 28px; }
  .dict-card { width: 290px; }
  .btn--xl { width: auto; min-width: 340px; }
}

@media (min-width: 768px) {
  .section { padding-block: 80px 56px; }
  .section-head { margin-bottom: 48px; }
  .hero-content { padding-top: 40px; gap: 16px; }
  .logo-pill img { width: 128px; }
  .hero-content { padding-bottom: 24px; }
  .hero-scene { --moon: min(46vh, 440px); --scene-h: max(260px, min(46vh, 34vw, 500px)); }
  .deco-bat--desk { display: block; }
  .hero .deco-bat { --w: 72px !important; }
  .hero .deco-bat + .deco-bat { --w: 46px !important; }
  .section--coupon { padding-block: 110px 96px; }
  .scratch-prize { padding: 32px 30px 28px; }
  .prize-tickets--double { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
  .prize-tickets--double .prize-ticket { padding: 20px 18px; align-content: start; }
  .fireflies .ff-desk { display: block; }
  .section--dict { padding-block: 110px 120px; }
  /* footer: tres columnas, banderas en una fila, cierre a los lados */
  .footer-title { text-align: left; }
  .footer-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
  .footer-col { justify-items: start; text-align: left; padding: 26px 24px; }
  .social-icons { justify-content: flex-start; }
  .footer-countries { grid-template-columns: auto 1fr; align-items: center; justify-items: start; gap: 22px; }
  .country-flags { display: flex; flex-wrap: wrap; max-width: none; gap: 10px; }
  .footer-bottom { flex-direction: row; justify-content: space-between; }
  .footer-jobs { grid-template-columns: 1fr auto; align-items: center; justify-items: stretch; text-align: left; padding: 16px 20px; gap: 20px; }
  .footer-jobs-text { display: flex; align-items: center; gap: 14px; }
  .footer-jobs-btn { width: auto; min-width: 170px; }
  .dict-arrow { width: 56px; height: 56px; --card-h: 330px; }
  .dict-arrow--prev { left: 20px; }
  .dict-arrow--next { right: 20px; }
  .episodes { grid-template-columns: 1fr 1fr; gap: 28px; }
  .episode-body { padding: 24px 26px 26px; }
  .episode-title { font-size: 1.2rem; }
  .scratch-card { min-height: 300px; }
  .spider-trail { width: 34px; right: 10px; }
  .dict-track { padding-left: max(var(--gutter), calc((100vw - 1120px) / 2 + var(--gutter))); gap: 22px; }
  .dict-card { width: 300px; height: 330px; }
}

/* Noticias: 3 tarjetas lado a lado, misma altura (debajo de 960px, carrusel) */
@media (min-width: 960px) {
  .news-track {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px;
    overflow: visible; margin-inline: 0; padding: 6px 0 22px;
  }
  .news-card { flex: none; max-width: none; }
  .news-dots { display: none; }
  .news-all .btn { width: auto; min-width: 240px; }
}

/* Desktop: flechas laterales a media altura del libro; contador debajo */
@media (min-width: 1000px) {
  .book { padding-inline: 76px; max-width: 1120px; margin-inline: auto; }
  .book-arrow {
    position: absolute; top: calc((100% - 70px) / 2);
    width: 56px; height: 56px; transform: translateY(-50%);
  }
  .book-arrow--prev { left: 0; }
  .book-arrow--next { right: 0; }
  .book-arrow:hover { transform: translateY(-50%) scale(1.06); }
  .book-arrow:disabled { transform: translateY(-50%); }
}

/* Sin hover real (pantallas táctiles): sin elevaciones pegadas */
@media (hover: none) {
  .episode:hover { transform: none; box-shadow: none; border-color: var(--line); }
  .episode:hover .episode-cover img { transform: none; }
  .news-card:hover { transform: none; box-shadow: none; border-color: var(--line); }
  .news-card:hover .news-media img { transform: none; }
}

/* ==========================================================
   Movimiento reducido: sin animaciones de fondo
   ========================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .bats-layer, .spider-trail { display: none; }
  .fog span, .stars::after, .deco-bat, .moon--closing { animation: none; }
  .fireflies { display: none; }
  .castle .win { animation: none; opacity: .9; }
  .js [data-reveal] .rv { opacity: 1; transform: none; }
  .dict-inner { transform-style: flat; }
  .dict-card.is-flipped .dict-inner { transform: none; }
  .dict-back { transform: none; opacity: 0; }
  .dict-card.is-flipped .dict-back { opacity: 1; }
  .dict-card.is-flipped .dict-front { opacity: 0; }
  .dict-viewport { scroll-snap-type: x mandatory; }
  .dict-card { scroll-snap-align: center; }
}
