/* Halloween — candidato «escena», pasada focal P2 (24/10/2026).
   Sucesor de R1. Dirección escénica aceptada (Reference.zip 02/03/05):
   escena nocturna integrada, profundidad, paneles oscuros legibles con
   filete dorado, tarjetas ilustradas, anillo «O» alrededor de Ambrosio.
   P2 (pedido de Lu sobre e8c12a5): menos espacio decorativo antes del
   formulario y de las acciones, cortes suavizados entre escena, paneles y
   tarjetas, jerarquía y bordes consistentes.
   ALCANCE: sólo Bienvenida e Inicio. Todo va bajo
   html[data-halloween-theme="escena"] y además bajo una de estas vistas:
     Bienvenida  body:has(#app > .hero-grid)
     Inicio      body:has(#app > .home-heading)
   El resto de la app queda exactamente como INT8c.
   Arte aprobado intacto (HAL020, logo, C02 no se tocan). Sin !important.
   P3: arte ESC01–04 final aprobado por Lu (paquete
   ESC01_04_ARTE_APROBADO_FINAL_20261024), integrado con derivados WebP
   declarados en halloween-escena/esc/DERIVADOS.json. Los originales no se
   modifican; el encuadre se resuelve con background-position y capas. */

/* ---------- Tokens ---------- */
html[data-halloween-theme="escena"] {
  --e-night: #0c0c10;
  --e-panel: #121217;
  --e-panel-a: rgb(16 16 21 / 0.9); /* panel sobre escena */
  --e-panel-top: rgb(16 16 21 / 0.62); /* borde superior translúcido: funde con la escena */
  --e-field: #19191f;
  --e-field-line: #5a5a64;
  /* Un solo filete para paneles, tarjetas y chips. */
  --e-edge: rgb(201 160 72 / 0.48);
  --e-edge-strong: rgb(214 172 78 / 0.78);
  --e-glow: 0 0 0 1px rgb(247 211 106 / 0.06) inset, 0 18px 48px rgb(0 0 0 / 0.5);
  --e-gold: #e9b949; /* 10,6:1 sobre --e-panel */
  --e-gold-hi: #f7d36a;
  --e-gold-lo: #c8901f;
  --e-on-gold: #1b1406; /* ≥7,9:1 sobre el botón miel (medido) */
  --e-text: #f6efe0;
  --e-muted: #d3cbba; /* 11:1 sobre --e-panel */
  --e-serif: Georgia, "Times New Roman", serif;
  --e-sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* Escala: radios y espacios únicos para las dos vistas. */
  --e-r-panel: 18px;
  --e-r-card: 14px;
  --e-r-btn: 12px;
  --e-gutter: 16px;
  --e-btn: linear-gradient(180deg, var(--e-gold-hi), var(--e-gold-lo));
  /* ESC01 aprobado: recorte móvil (vertical) por defecto; escritorio desde 768 px.
     image-set elige el derivado por densidad de pantalla. */
  --e-scene: image-set(url("/halloween-escena/esc/esc01-movil-556.webp") 1x, url("/halloween-escena/esc/esc01-movil-834.webp") 2x, url("/halloween-escena/esc/esc01-movil-1112.webp") 3x);
  --e-scene-pos: center 38%;
  --e-ring: url("/loader/o-halloween-384.webp");
  --e-ring-sm: url("/loader/o-halloween-192.webp");
  /* Piezas usadas por screens.css (candidato). Un tema de temporada sólo
     redefine tokens; ver docs/halloween-r1/TEMAS.md. */
  --e-icon-mesas: url("/halloween-r1/icons/dark/mesas_24.svg");
  --e-cine-mascot: url("/cine/ambrosio-cineasta-768.webp");
  --e-chat-mascot: url("/chat-emotes/16_saludando_144.webp");
}
@media (min-width: 768px) {
  html[data-halloween-theme="escena"] {
    --e-gutter: 24px;
  }
}
@media (min-width: 768px) {
  html[data-halloween-theme="escena"] {
    --e-scene: image-set(url("/halloween-escena/esc/esc01-escritorio-1280.webp") 1x, url("/halloween-escena/esc/esc01-escritorio-1774.webp") 2x);
    --e-scene-pos: center 30%;
  }
}
@media (min-width: 1300px) {
  html[data-halloween-theme="escena"] {
    --e-scene: url("/halloween-escena/esc/esc01-escritorio-1774.webp");
  }
}

/* ---------- Página y shell (sólo en las dos vistas) ---------- */
html[data-halloween-theme="escena"] :is(body:has(#app > .hero-grid), body:has(#app > .home-heading)) {
  background: var(--e-night);
  color: var(--e-text);
  font-family: var(--e-sans);
}
/* Cabecera translúcida: la escena empieza detrás y no hay corte duro. */
html[data-halloween-theme="escena"] :is(body:has(#app > .hero-grid), body:has(#app > .home-heading)) header {
  background: linear-gradient(180deg, rgb(10 10 13 / 0.96), rgb(10 10 13 / 0.78));
  border-bottom: 1px solid var(--e-edge);
}
html[data-halloween-theme="escena"] :is(body:has(#app > .hero-grid), body:has(#app > .home-heading)) .edition {
  background: transparent;
  color: var(--e-gold);
}
html[data-halloween-theme="escena"] :is(body:has(#app > .hero-grid), body:has(#app > .home-heading)) .site-nav.bottom-nav {
  background: rgb(12 12 15 / 0.96);
  border-color: var(--e-edge);
}
html[data-halloween-theme="escena"] :is(body:has(#app > .hero-grid), body:has(#app > .home-heading)) .site-nav.bottom-nav a {
  color: var(--e-text);
}
html[data-halloween-theme="escena"] :is(body:has(#app > .hero-grid), body:has(#app > .home-heading)) .site-nav.bottom-nav a[aria-current="page"] {
  background: transparent;
  color: var(--e-gold);
  box-shadow: inset 0 -3px 0 var(--e-gold);
}
/* El textarea del chat no lleva anillo propio: lo muestra .chat-field (chat-ui.css). */
html[data-halloween-theme="escena"] :is(body:has(#app > .hero-grid), body:has(#app > .home-heading)) :focus-visible:not(.chat-field textarea) {
  outline: 3px solid var(--e-gold-hi);
  outline-offset: 3px;
}
html[data-halloween-theme="escena"] :is(body:has(#app > .hero-grid), body:has(#app > .home-heading)) footer {
  color: var(--e-muted);
}
/* El aviso de entorno (demo/revisión) nunca queda bajo la decoración. */
html[data-halloween-theme="escena"] :is(body:has(#app > .hero-grid), body:has(#app > .home-heading)) .preview {
  z-index: 3;
}
/* Telarañas aprobadas, sobre la escena. */
html[data-halloween-theme="escena"] :is(body:has(#app > .hero-grid), body:has(#app > .home-heading)) .halloween-canopy {
  z-index: 2;
}
html[data-halloween-theme="escena"] :is(body:has(#app > .hero-grid), body:has(#app > .home-heading)) .halloween-canopy img {
  opacity: 0.8;
}
/* Calabazas aprobadas: suben y se apoyan sobre el final del contenido, en
   vez de flotar en un bloque negro aparte. */
html[data-halloween-theme="escena"] :is(body:has(#app > .hero-grid), body:has(#app > .home-heading)) .halloween-hearth {
  margin-top: -28px;
  position: relative;
  z-index: 0;
}

/* ---------- Foco y desplazamiento ----------
   Al tabular, el navegador desplaza el control enfocado respetando
   scroll-padding: se reserva la cabecera fija arriba y el menú fijo abajo
   para que ningún control enfocado quede tapado (WCAG 2.4.11). */
html[data-halloween-theme="escena"]:is(:has(#app > .hero-grid), :has(#app > .home-heading)) {
  scroll-padding-top: calc(124px + env(safe-area-inset-top, 0px));
  /* Menú inferior + botón flotante de Chat (58 px, 12 px sobre el menú) + margen. */
  scroll-padding-bottom: calc(var(--bottom-nav-clearance, 70px) + 84px);
}
@media (min-width: 768px) {
  html[data-halloween-theme="escena"]:is(:has(#app > .hero-grid), :has(#app > .home-heading)) {
    scroll-padding-top: 176px;
  }
}

/* ---------- Escena compartida, a sangre detrás del héroe ----------
   Capas de luz (no arte nuevo): halo lunar frío, faroles cálidos, viñeta y
   un fundido largo al negro de la página para que no haya corte. */
html[data-halloween-theme="escena"] #app:is(:has(> .hero-grid), :has(> .home-heading)) {
  position: relative;
  isolation: isolate;
  padding-top: 0;
}
html[data-halloween-theme="escena"] #app:is(:has(> .hero-grid), :has(> .home-heading))::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 0;
  left: 50%;
  width: 100vw;
  height: var(--e-scene-h, 560px);
  transform: translateX(-50%);
  pointer-events: none;
  background:
    /* Sólo velos de legibilidad: el arte ya trae luna, faroles y calabazas. */
    radial-gradient(ellipse 120% 90% at 50% 35%, transparent 60%, rgb(5 5 8 / 0.55) 100%),
    linear-gradient(180deg, rgb(18 22 62 / 0.5) 0%, rgb(30 20 50 / 0.15) 32%, rgb(12 12 16 / 0.4) 58%, rgb(12 12 16 / 0.86) 82%, var(--e-night) 100%),
    var(--e-scene) var(--e-scene-pos) / cover no-repeat,
    var(--e-night);
}

/* ---------- Anillo «O» alrededor de Ambrosio (HAL020 intacto) ----------
   El anillo aprobado es el fondo del propio <img>; un halo cálido lo une
   con la escena. El personaje no se recorta ni recolorea. */
html[data-halloween-theme="escena"] :is(.welcome-mascot.halloween-hero, .home-heading img.halloween-hero) {
  box-sizing: border-box;
  padding: 7%;
  border-radius: 50%;
  background:
    var(--e-ring) center / 100% 100% no-repeat,
    radial-gradient(circle at 50% 50%, rgb(20 16 10 / 0.9) 0 57%, rgb(255 160 60 / 0.22) 62%, transparent 72%);
  filter: drop-shadow(0 8px 22px rgb(0 0 0 / 0.55));
}

/* ---------- Tipografía ---------- */
html[data-halloween-theme="escena"] :is(.hero-grid, .home-heading) h1 {
  font-family: var(--e-serif);
  font-weight: 700;
  color: var(--e-text);
  letter-spacing: -0.4px;
  line-height: 1.04;
  text-shadow: 0 2px 12px rgb(0 0 0 / 0.75);
  margin: 4px 0 0;
}
html[data-halloween-theme="escena"] :is(.hero-grid, .home-heading) h1 em {
  font-style: normal;
  color: var(--e-gold);
  background: linear-gradient(180deg, var(--e-gold-hi), var(--e-gold-lo));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 2px 6px rgb(0 0 0 / 0.8));
}
html[data-halloween-theme="escena"] :is(.hero-grid, .home-heading) .eyebrow {
  color: var(--e-gold);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  line-height: 1.3;
  margin: 0;
  text-shadow: 0 1px 6px rgb(0 0 0 / 0.9);
}
/* Panel compartido (acceso y sección de Inicio): borde superior translúcido
   y desenfoque de la escena detrás, para que no parezca una pieza pegada. */
html[data-halloween-theme="escena"] :is(.hero-grid > section.card, #app > .section:has(.home-grid)) {
  background: linear-gradient(180deg, var(--e-panel-top) 0, var(--e-panel-a) 96px, var(--e-panel-a));
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border: 1px solid var(--e-edge);
  border-radius: var(--e-r-panel);
  box-shadow: var(--e-glow);
  color: var(--e-text);
}
html[data-halloween-theme="escena"] :is(.hero-grid > section.card h2, #app > .section:has(.home-grid) > h2) {
  font-family: var(--e-serif);
  font-weight: 700;
  font-size: 22px;
  line-height: 1.2;
  color: var(--e-text);
}

/* =====================================================================
   BIENVENIDA
   ===================================================================== */
html[data-halloween-theme="escena"] #app:has(> .hero-grid) {
  --e-scene-h: 470px;
}
html[data-halloween-theme="escena"] .hero-grid {
  gap: 16px;
  align-items: start;
  padding-top: 12px;
}
/* Héroe compacto: anillo a la izquierda, saludo y título a la derecha; el
   texto secundario y la fecha debajo, a todo el ancho (referencia 02 móvil). */
html[data-halloween-theme="escena"] .hero-grid > section:first-child {
  /* Velo suave detrás del texto del héroe: sin caja visible, sólo oscurece
     el arte donde cae el texto (contraste medido sobre píxeles finales). */
  background: radial-gradient(ellipse 75% 70% at 45% 55%, rgb(8 8 12 / 0.62), rgb(8 8 12 / 0.38) 60%, transparent 100%);
  border-radius: 24px;
  display: grid;
  grid-template-columns: minmax(0, 40%) minmax(0, 1fr);
  grid-template-areas:
    "ring eyebrow"
    "ring title"
    "copy copy"
    "date date";
  grid-template-rows: auto 1fr auto auto;
  column-gap: 14px;
  align-items: center;
  text-align: left;
}
html[data-halloween-theme="escena"] .hero-grid .welcome-mascot.halloween-hero {
  grid-area: ring;
  width: 100%;
  max-width: 200px;
  margin: 0;
  align-self: center;
}
html[data-halloween-theme="escena"] .hero-grid > section:first-child > .eyebrow {
  grid-area: eyebrow;
  align-self: end;
}
html[data-halloween-theme="escena"] .hero-grid h1 {
  grid-area: title;
  align-self: start;
  font-size: clamp(30px, 8.6vw, 40px);
}
html[data-halloween-theme="escena"] .hero-grid > section:first-child > p:not(.eyebrow) {
  grid-area: copy;
  margin: 14px 0 10px;
  max-width: 46ch;
  color: var(--e-text);
  font-size: 15px;
  line-height: 1.5;
  text-shadow: 0 1px 8px rgb(0 0 0 / 0.95);
}
html[data-halloween-theme="escena"] .hero-grid .date {
  grid-area: date;
  justify-self: start;
  margin: 0;
  padding: 6px 12px;
  border: 1px solid var(--e-edge);
  border-radius: 999px;
  background: rgb(10 10 13 / 0.72);
  color: var(--e-gold);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.4px;
}

/* Panel de acceso compacto. */
html[data-halloween-theme="escena"] .hero-grid > section.card {
  padding: 18px var(--e-gutter) 20px;
}
html[data-halloween-theme="escena"] .hero-grid > section.card h2 {
  margin: 14px 0 4px;
}
html[data-halloween-theme="escena"] .hero-grid > section.card label {
  color: var(--e-text);
  font-weight: 600;
  font-size: 14px;
  margin: 12px 0 6px;
}
html[data-halloween-theme="escena"] .hero-grid > section.card :is(p, .small) {
  color: var(--e-muted);
  font-size: 13px;
  line-height: 1.45;
  margin: 6px 0 0;
}
html[data-halloween-theme="escena"] .hero-grid > section.card :is(input, select, textarea) {
  background: var(--e-field);
  border: 1px solid var(--e-field-line);
  border-radius: var(--e-r-btn);
  color: var(--e-text);
  min-height: 46px;
}
html[data-halloween-theme="escena"] .hero-grid > section.card :is(input, select, textarea):hover {
  border-color: var(--e-edge-strong);
}
/* Crear cuenta / Ingresar: control segmentado; estado real aria-pressed. */
html[data-halloween-theme="escena"] .hero-grid .account-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--e-edge);
  border-radius: var(--e-r-btn);
  background: var(--e-night);
}
html[data-halloween-theme="escena"] .hero-grid .account-tabs button {
  margin: 0;
  min-height: 44px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--e-text);
  font: 700 15px var(--e-sans);
}
html[data-halloween-theme="escena"] .hero-grid .account-tabs button[aria-pressed="true"] {
  background: var(--e-btn);
  color: var(--e-on-gold);
}
/* Botones: un solo radio y alto para principal y secundario. */
html[data-halloween-theme="escena"] .hero-grid > section.card button[type="submit"]:not(.secondary) {
  width: 100%;
  min-height: 50px;
  margin-top: 18px;
  border: 1px solid var(--e-gold-lo);
  border-radius: var(--e-r-btn);
  background: var(--e-btn);
  color: var(--e-on-gold);
  font: 700 17px var(--e-sans);
  box-shadow: 0 6px 18px rgb(233 185 73 / 0.22);
}
html[data-halloween-theme="escena"] .hero-grid > section.card form button.secondary:not(.password-toggle) {
  min-height: 46px;
  background: transparent;
  border: 1px solid var(--e-edge-strong);
  border-radius: var(--e-r-btn);
  color: var(--e-gold);
  font-weight: 700;
}
html[data-halloween-theme="escena"] .hero-grid > section.card button.password-toggle {
  background: var(--e-field);
  border: 1px solid var(--e-field-line);
  border-radius: var(--e-r-btn);
  color: var(--e-gold);
}
html[data-halloween-theme="escena"] .hero-grid > section.card .recovery-section {
  margin-top: 16px;
  border-top: 1px solid var(--e-edge);
}
html[data-halloween-theme="escena"] .hero-grid > section.card summary {
  color: var(--e-gold);
  font-weight: 600;
  min-height: 44px;
  padding-block: 11px;
}
@media (min-width: 900px) {
  html[data-halloween-theme="escena"] #app:has(> .hero-grid) {
    --e-scene-h: 640px;
  }
  html[data-halloween-theme="escena"] .hero-grid {
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
    gap: 36px;
    padding-top: 16px;
  }
  html[data-halloween-theme="escena"] .hero-grid > section:first-child {
    grid-template-columns: 200px minmax(0, 1fr);
    column-gap: 22px;
    padding-top: 20px;
  }
  html[data-halloween-theme="escena"] .hero-grid .welcome-mascot.halloween-hero {
    max-width: 200px;
  }
  html[data-halloween-theme="escena"] .hero-grid h1 {
    font-size: 42px;
  }
  html[data-halloween-theme="escena"] .hero-grid > section:first-child > p:not(.eyebrow) {
    font-size: 16px;
    margin-top: 20px;
  }
  html[data-halloween-theme="escena"] .hero-grid > section.card {
    padding: 16px 22px 18px;
  }
  /* Escritorio: formulario más compacto para que la acción principal entre
     en el primer pantallazo de 1280×800 sin reducir el área táctil (44 px). */
  html[data-halloween-theme="escena"] .hero-grid > section.card h2 {
    font-size: 20px;
    margin: 10px 0 0;
  }
  html[data-halloween-theme="escena"] .hero-grid > section.card label {
    margin: 9px 0 4px;
  }
  html[data-halloween-theme="escena"] .hero-grid > section.card :is(input, select, textarea) {
    min-height: 44px;
  }
  html[data-halloween-theme="escena"] .hero-grid > section.card :is(p, .small) {
    margin-top: 4px;
  }
  html[data-halloween-theme="escena"] .hero-grid > section.card button[type="submit"]:not(.secondary) {
    min-height: 48px;
    margin-top: 14px;
  }
}

/* =====================================================================
   INICIO
   ===================================================================== */
html[data-halloween-theme="escena"] #app:has(> .home-heading) {
  --e-scene-h: 360px;
}
/* Héroe compacto: anillo + saludo/título (referencia 02 móvil). */
html[data-halloween-theme="escena"] .home-heading:has(.halloween-hero) {
  display: grid;
  grid-template-columns: minmax(0, 36%) minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-height: 0;
  padding: 14px 0 18px;
  margin: 0;
}
html[data-halloween-theme="escena"] .home-heading img.halloween-hero {
  grid-column: 1;
  grid-row: 1;
  width: 100%;
  max-width: 170px;
  margin: 0;
}
html[data-halloween-theme="escena"] .home-heading .home-intro {
  grid-column: 2;
  grid-row: 1;
  text-align: left;
}
html[data-halloween-theme="escena"] .home-heading .home-intro h1 {
  font-size: clamp(30px, 8.6vw, 40px);
  margin-top: 6px;
}

/* Sección «¿Qué hacemos ahora?»: sube sobre el final de la escena. */
html[data-halloween-theme="escena"] #app > .section:has(.home-grid) {
  margin-top: 0;
  padding: 16px 12px 14px;
}
html[data-halloween-theme="escena"] #app > .section:has(.home-grid) > h2 {
  margin: 0 4px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}
html[data-halloween-theme="escena"] #app > .section:has(.home-grid) > h2::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--e-edge-strong), transparent);
}

/* Tarjetas ilustradas. Toda la tarjeta sigue siendo el mismo enlace real. */
html[data-halloween-theme="escena"] .home-grid {
  gap: 10px;
}
html[data-halloween-theme="escena"] .home-grid .route-card {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  column-gap: 14px;
  align-items: center;
  padding: 12px 14px;
  min-height: 0;
  border: 1px solid var(--e-edge);
  border-radius: var(--e-r-card);
  background: var(--e-panel);
  box-shadow: none;
  color: var(--e-text);
  text-decoration: none;
}
/* Móvil (tarjetas apiladas, ≤680 px): franja de imagen ARRIBA y cuerpo opaco debajo, en las tres
   tarjetas (decisión de Lu, Addendum P4 V2). Sin texto ni velo sobre los motivos:
   sólo un fundido corto en el borde inferior. Alto común según el ANCHO REAL de
   la tarjeta (contenedor .home-grid): clamp(104px, ancho / 2,7, 136px). Escritorio
   redefine todo en su @media. */
html[data-halloween-theme="escena"] .home-grid .route-card {
  --e-strip-h: 116px;
  padding-top: calc(var(--e-strip-h) + 12px);
}
@supports (width: 1cqw) {
  html[data-halloween-theme="escena"] .home-grid .route-card {
    --e-strip-h: clamp(104px, 100cqw / 2.7, 136px);
  }
}
html[data-halloween-theme="escena"] .home-grid .route-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: var(--e-strip-h);
  z-index: 0;
  background:
    linear-gradient(180deg, rgb(18 18 23 / 0) 72%, var(--e-panel) 100%),
    var(--e-strip-art, var(--e-card-art));
  background-size: cover, var(--e-strip-size, cover);
  background-position: center, var(--e-strip-pos, center);
  background-repeat: no-repeat;
  pointer-events: none;
}
html[data-halloween-theme="escena"] .home-grid .route-card > * {
  position: relative;
  z-index: 1;
  grid-column: 2;
  margin: 0;
}
html[data-halloween-theme="escena"] .home-grid .route-card:hover {
  border-color: var(--e-edge-strong);
}
/* Actividades en Inicio: miniatura propia aprobada por Lu (fantasma, calabaza y
   vampira; DERIVADOS-MINIATURA-ACTIVIDADES.json), sólo en esta tarjeta. La banda
   grande de /actividades sigue con ESC02. Encuadre: se amplía la mitad derecha
   del arte (las tres cabezas) en lugar de mostrar todo el panorama. */
html[data-halloween-theme="escena"] .home-grid .route-card[href="/actividades"] {
  --e-thumb-actividades: image-set(url("/halloween-escena/esc/esc02-personajes-640.webp") 1x, url("/halloween-escena/esc/esc02-personajes-1280.webp") 2x, url("/halloween-escena/esc/esc02-personajes-1942.webp") 3x);
  --e-card-art: var(--e-thumb-actividades);
  /* Franja móvil: ventana focal (850,150)–(1942,555) del original 1942×809
     (Addendum V2): tres cabezas completas. pos = x0/(W−w), y0/(H−h).
     Escala: la MENOR entre «ventana al ancho» (1942/1092 = 177,84 %) y «ventana al
     alto» (alto × 1942/405): con franjas más anchas que 2,7:1 (412–680 px, alto
     tope 136) la ventana entera sigue visible y sobra panorama a la izquierda. */
  --e-strip-size: min(177.84%, calc(var(--e-strip-h) * 4.7951)) auto;
  --e-strip-pos: 100% 37.1%;
  --e-hex-icon: url("/halloween-r1/icons/app/actividades_24.svg");
}
html[data-halloween-theme="escena"] .home-grid .route-card[href="/horarios"] {
  --e-card-art: image-set(url("/halloween-escena/esc/esc03-horarios-640.webp") 1x, url("/halloween-escena/esc/esc03-horarios-1280.webp") 2x);
  --e-card-art-pos: 76% 45%;
  /* Franja móvil: torre y reloj v4, ventana (1060,10)–(1944,337) de 1944×809.
     En móvil la imagen se ve a ~2,2× del ancho de tarjeta: 1280 también en 1x. */
  --e-strip-art: image-set(url("/halloween-escena/esc/esc03-horarios-1280.webp") 1x);
  --e-strip-size: min(219.91%, calc(var(--e-strip-h) * 5.945)) auto; /* 1944/884 · 1944/327 */
  --e-strip-pos: 100% 2.1%;
  --e-hex-icon: url("/halloween-r1/icons/dark/horarios_24.svg");
}
html[data-halloween-theme="escena"] .home-grid .route-card[href="/mesas"] {
  --e-card-art: image-set(url("/halloween-escena/esc/esc04-mesas-640.webp") 1x, url("/halloween-escena/esc/esc04-mesas-1280.webp") 2x);
  --e-card-art-pos: 78% 50%;
  /* Franja móvil: mesa redonda y sillas, ventana (850,285)–(1942,690) de 1942×809. */
  --e-strip-size: min(177.84%, calc(var(--e-strip-h) * 4.7951)) auto;
  --e-strip-pos: 100% 70.5%;
  --e-hex-icon: url("/halloween-r1/icons/dark/mesas_24.svg");
}
/* Medallón hexagonal (actividad ≠ logro): aro dorado + núcleo + icono. */
html[data-halloween-theme="escena"] .home-grid .route-card .eyebrow {
  grid-row: 1 / span 3;
  grid-column: 1;
  position: relative;
  width: 54px;
  height: 60px;
  font-size: 0;
  letter-spacing: 0;
  align-self: center;
}
html[data-halloween-theme="escena"] .home-grid .route-card .eyebrow::before,
html[data-halloween-theme="escena"] .home-grid .route-card .eyebrow::after {
  content: "";
  position: absolute;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}
html[data-halloween-theme="escena"] .home-grid .route-card .eyebrow::before {
  inset: 0;
  background: linear-gradient(160deg, var(--e-gold-hi), var(--e-gold-lo) 60%, #7a520f);
}
html[data-halloween-theme="escena"] .home-grid .route-card .eyebrow::after {
  inset: 4px;
  background:
    var(--e-hex-icon) center / 26px 26px no-repeat,
    radial-gradient(circle at 50% 35%, #3a2a12, #120d06 75%);
}
/* El «01 · JUGÁ» del eyebrow sigue en el nombre accesible del enlace. */
html[data-halloween-theme="escena"] .home-grid .route-card h3 {
  font-family: var(--e-serif);
  font-weight: 700;
  font-size: 19px;
  line-height: 1.2;
  color: var(--e-text);
  text-shadow: 0 1px 6px rgb(0 0 0 / 0.9);
}
/* Contenedor de la franja: sólo con las tarjetas apiladas (una columna = ancho real de la tarjeta). */
@media (max-width: 680px) {
  html[data-halloween-theme="escena"] .home-grid {
    container-type: inline-size;
  }
}
html[data-halloween-theme="escena"] .home-grid .route-card .small {
  color: var(--e-muted);
  font-size: 14px;
  line-height: 1.4;
  margin-top: 3px;
  text-shadow: 0 1px 6px rgb(0 0 0 / 0.9);
}
html[data-halloween-theme="escena"] .home-grid .route-card > span:last-child {
  justify-self: start;
  margin-top: 8px;
  padding: 7px 14px;
  border-radius: var(--e-r-btn);
  background: var(--e-btn);
  color: var(--e-on-gold);
  font-weight: 700;
  font-size: 14px;
  line-height: 1.2;
}
@media (min-width: 768px) {
  html[data-halloween-theme="escena"] #app:has(> .home-heading) {
    --e-scene-h: 470px;
  }
  html[data-halloween-theme="escena"] .home-heading:has(.halloween-hero) {
    grid-template-columns: 210px minmax(0, 1fr);
    gap: 28px;
    padding: 24px var(--e-gutter) 28px;
  }
  html[data-halloween-theme="escena"] .home-heading img.halloween-hero {
    max-width: 210px;
  }
  html[data-halloween-theme="escena"] .home-heading .home-intro h1 {
    font-size: 50px;
  }
  html[data-halloween-theme="escena"] #app > .section:has(.home-grid) {
    padding: 20px 20px 18px;
  }
  html[data-halloween-theme="escena"] #app > .section:has(.home-grid) > h2 {
    font-size: 24px;
  }
}

/* Tarjetas en tres columnas (INT8c apila recién a ≤680 px): imagen arriba, como
   en escritorio P4, también entre 681 y 767 px, para que no haya salto en 767/768. */
@media (min-width: 681px) {
  html[data-halloween-theme="escena"] .home-grid {
    gap: 14px;
  }
  html[data-halloween-theme="escena"] .home-grid .route-card {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 112px auto auto 1fr;
    align-items: start;
    padding: 0 16px 16px;
  }
  /* CTA al pie aunque un título ocupe dos líneas (681–767 px y textos ampliados). */
  html[data-halloween-theme="escena"] .home-grid .route-card > span:last-child {
    align-self: end;
  }
  html[data-halloween-theme="escena"] .home-grid .route-card::before {
    inset: 0 0 auto 0;
    height: 124px;
    background:
      linear-gradient(180deg, rgb(18 18 23 / 0) 30%, rgb(18 18 23 / 0.7) 72%, var(--e-panel) 100%),
      var(--e-card-art);
    background-size: cover, var(--e-card-art-size, cover);
    background-position: center, var(--e-card-art-pos, center);
    background-repeat: no-repeat;
  }
  html[data-halloween-theme="escena"] .home-grid .route-card > * {
    grid-column: 1;
  }
  html[data-halloween-theme="escena"] .home-grid .route-card[href="/actividades"] {
    --e-card-art-size: auto 160%;
    --e-card-art-pos: 97% 38%;
  }
  html[data-halloween-theme="escena"] .home-grid .route-card .eyebrow {
    grid-row: 1;
    align-self: end;
    margin-bottom: -24px;
  }
  html[data-halloween-theme="escena"] .home-grid .route-card h3 {
    margin-top: 30px;
  }
}

/* ---------- CLS: decoración inferior fuera mientras carga ---------- */
html[data-halloween-theme="escena"] main[aria-busy="true"] ~ .halloween-hearth {
  visibility: hidden;
}

/* ---------- Preferencias del sistema ---------- */
/* Sin animaciones ni transiciones nuevas: reduced-motion no requiere cambios. */
@media (forced-colors: active) {
  html[data-halloween-theme="escena"] #app:is(:has(> .hero-grid), :has(> .home-heading))::before,
  html[data-halloween-theme="escena"] .home-grid .route-card::before {
    display: none;
  }
  html[data-halloween-theme="escena"] :is(.hero-grid, .home-heading) h1 em {
    -webkit-text-fill-color: currentColor;
    background: none;
  }
  html[data-halloween-theme="escena"] :is(.welcome-mascot.halloween-hero, .home-heading img.halloween-hero) {
    background: none;
    filter: none;
  }
  html[data-halloween-theme="escena"] :is(.hero-grid > section.card, #app > .section:has(.home-grid)) {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  html[data-halloween-theme="escena"] .home-grid .route-card .eyebrow {
    font-size: 12px;
    width: auto;
    height: auto;
  }
  html[data-halloween-theme="escena"] .home-grid .route-card .eyebrow::before,
  html[data-halloween-theme="escena"] .home-grid .route-card .eyebrow::after {
    display: none;
  }
  /* Sin franja de imagen: el cuerpo no reserva su alto. */
  html[data-halloween-theme="escena"] .home-grid .route-card {
    padding-top: 12px;
  }
}
