/* El Hechizo de las Estrellas — base: MAPA ESTELAR Y ASTROLABIO. Paneles translúcidos azul noche con líneas de constelación en
   las orillas, detalles dorados, botones de luna y de estrella, contador de 5 estrellas que se encienden. Letras: Cinzel
   (títulos, grabado de astrolabio) + Alegreya Sans (texto). Todo cuelga de html.he. Por dentro se mide contra el marco (.app es
   un contenedor de tamaño: cqw/cqh), nunca contra la ventana. Contraste de textos ≥ 4.5:1. */
.he {
  --noche: #070B2E; --noche-2: #0E1442; --noche-3: #1A2060; --tinta: #10163F; --crema: #FFF7E2; --texto: #F5F0DC; --texto-2: #D8D4C2;
  --oro: #FFD98A; --oro-2: #FFC55E; --oro-d: #B98A3A; --lila: #B9A4FF; --rosa: #FF9AD6; --cian: #8FE3FF;
  --wa: #25D366;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --f-grabado: "Cinzel", Georgia, "Times New Roman", serif;
  --f-texto: "Alegreya Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  /* líneas de constelación para las orillas de los paneles (fondo en SVG, sin imágenes externas) */
  --constel: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='190' height='150' viewBox='0 0 190 150'%3E%3Cg fill='none' stroke='%23FFD98A' stroke-opacity='.42' stroke-width='1.1'%3E%3Cpath d='M9 18l28 12 19-18 34 16 18-14M9 18l6 34 25 12-9 30M168 132l-26-10-14 18-35-11-12 14M168 132l10-30-22-14 6-26'/%3E%3C/g%3E%3Cg fill='%23FFF0C4'%3E%3Ccircle cx='9' cy='18' r='2.200'/%3E%3Ccircle cx='37' cy='30' r='1.600'/%3E%3Ccircle cx='56' cy='12' r='2'/%3E%3Ccircle cx='90' cy='28' r='1.500'/%3E%3Ccircle cx='108' cy='14' r='2'/%3E%3Ccircle cx='15' cy='52' r='1.500'/%3E%3Ccircle cx='40' cy='64' r='1.900'/%3E%3Ccircle cx='31' cy='94' r='1.500'/%3E%3Ccircle cx='168' cy='132' r='2.200'/%3E%3Ccircle cx='142' cy='122' r='1.500'/%3E%3Ccircle cx='128' cy='140' r='2'/%3E%3Ccircle cx='93' cy='129' r='1.500'/%3E%3Ccircle cx='178' cy='102' r='2'/%3E%3Ccircle cx='156' cy='88' r='1.500'/%3E%3Ccircle cx='162' cy='62' r='1.800'/%3E%3C/g%3E%3C/svg%3E");
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
}
.he *, .he *::before, .he *::after { box-sizing: border-box; }
.he body { margin: 0; font-family: var(--f-texto); color: var(--texto); overflow: hidden; overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
.he button { font: inherit; color: inherit; }
.he :focus-visible { outline: 3px solid var(--oro); outline-offset: 3px; }
.he .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.he .noscript { margin: 24px; font: 700 18px/1.5 var(--f-texto); background: var(--crema); color: var(--tinta); padding: 16px; border-radius: 12px; }

/* ---------- marco ---------- */
.he .fondo { position: fixed; inset: 0; z-index: 0; pointer-events: none; background:
  radial-gradient(40% 32% at 32% 24%, rgba(255, 240, 210, .28), rgba(255, 240, 210, 0) 70%),
  radial-gradient(90% 60% at 60% 20%, #2C2F7C 0%, #120F4A 55%, #060A2A 100%); }
.he:not(.is-showcase) .fondo { filter: blur(6px) saturate(1.05); }
.he.is-showcase .fondo { display: none; }
.he .app { position: fixed; inset: 0; z-index: 1; overflow: hidden; isolation: isolate; container-type: size; container-name: marco; background: var(--noche); transition: opacity .5s ease; }
/* computadora y tableta: el mismo marco de teléfono, con aros dorados como un astrolabio */
@media (min-width: 560px) and (min-height: 560px) {
  .he .app { inset: auto; left: 50%; top: 50%; width: min(430px, 100vw - 32px); height: min(932px, 100dvh - 40px); transform: translate(-50%, -50%); border-radius: 30px;
    box-shadow: 0 0 0 2px var(--oro), 0 0 0 10px #0B1038, 0 0 0 12px var(--oro-d), 0 30px 90px rgba(2, 3, 20, .7); }
}
.he.is-showcase .app { inset: 0 !important; width: auto !important; height: auto !important; transform: none !important; border-radius: 0 !important; box-shadow: none !important; }
.he .stage { position: absolute; inset: 0; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; outline: none; }
.he .stage:focus-visible { box-shadow: inset 0 0 0 3px var(--oro); }
.he .gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity .7s ease; }
.he .gl.is-on { opacity: 1; }
.he .vineta { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(135% 95% at 50% 45%, rgba(0, 0, 0, 0) 62%, rgba(4, 6, 34, .34) 100%); }
.he .sin-gl .stage { background: url("../assets/poster/fondo-estrellas.webp") center / cover no-repeat, var(--noche); }
.he .ui { position: absolute; inset: 0; pointer-events: none; z-index: 20; }
.he .ui > * { pointer-events: auto; }

/* ---------- el fondo de panel: azul noche translúcido con líneas de constelación ---------- */
.he .constelado { position: absolute; inset: 0; pointer-events: none; border-radius: inherit; background: var(--constel) top 4px left 4px / 112px 88px no-repeat, var(--constel) bottom 4px right 4px / 112px 88px no-repeat; opacity: .8; }

/* ---------- botones: de ESTRELLA y LUNA ---------- */
.he .astro {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 26px;
  border: 0; border-radius: 30px; color: var(--tinta); text-decoration: none; cursor: pointer;
  font: 800 18px/1.1 var(--f-texto); letter-spacing: .01em; text-align: center;
  background: linear-gradient(180deg, #FFF3C4 0%, var(--oro) 46%, var(--oro-2) 100%);
  box-shadow: 0 0 0 2px #FFF3C4, 0 0 0 4px rgba(16, 22, 63, .55), 0 0 26px rgba(255, 217, 138, .45), 0 8px 16px rgba(2, 3, 20, .45);
  transition: transform .1s ease; touch-action: manipulation; user-select: none;
}
.he .astro > * { position: relative; }
.he .astro:active { transform: scale(.96); }
.he .astro.is-claro { color: var(--crema); background: rgba(26, 32, 96, .9); box-shadow: inset 0 0 0 1.5px var(--oro), 0 4px 10px rgba(2, 3, 20, .4); }
.he .astro.is-wa { color: #06301A; background: linear-gradient(180deg, #A9F0C4, #55DE8C); box-shadow: inset 0 0 0 1.5px #0B5A2E, 0 4px 10px rgba(2, 3, 20, .4); }
.he .astro.is-chica { min-height: 44px; padding: 0 18px; font-size: 16px; }
.he .astro.is-grande { min-height: 60px; font: 800 20px/1.05 var(--f-grabado); letter-spacing: .02em; padding: 0 28px; }
.he .astro.is-bloque { width: 100%; }
.he .pi { display: inline-flex; }
/* la luna del botón principal */
.he .astro-luna { width: 28px; height: 28px; border-radius: 50%; flex: none; background: radial-gradient(circle at 36% 30%, #FFF9E6 0 28%, #FFD98A 62%, #E7B55E 100%); box-shadow: inset -7px -2px 0 0 rgba(16, 22, 63, .92); }

/* botones redondos: lunas */
.he .lunita {
  width: 50px; height: 50px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 50%; cursor: pointer; color: var(--tinta); padding: 0;
  background: radial-gradient(circle at 36% 30%, #FFFBEF 0 22%, #F2E9CC 62%, #CBBB92 100%);
  box-shadow: 0 0 0 1.5px var(--oro), 0 0 16px rgba(255, 233, 180, .45), 0 4px 10px rgba(2, 3, 20, .45);
  transition: transform .1s ease; touch-action: manipulation;
}
.he .lunita:active { transform: scale(.93); }
/* botón de estrella (lanzar sin dibujar) */
.he .estrellin { position: relative; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; width: 92px; min-height: 64px; padding: 6px 4px; border: 0; color: var(--tinta); cursor: pointer; background: transparent; touch-action: none; }
.he .estrellin::before { content: ""; position: absolute; inset: 0; border-radius: 20px; background: linear-gradient(180deg, #FFF3C4, var(--oro) 60%, var(--oro-2)); box-shadow: 0 0 0 1.5px #FFF3C4, 0 0 16px rgba(255, 217, 138, .5), 0 4px 10px rgba(2, 3, 20, .45); }
.he .estrellin > * { position: relative; }
.he .est-t { font: 800 14.5px/1 var(--f-texto); }
.he .enlace { min-height: 44px; padding: 8px 14px; border: 0; border-radius: 22px; background: rgba(10, 16, 51, .75); color: var(--crema); font: 700 15.5px/1.2 var(--f-texto); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- HUD ---------- */
.he .hud { position: absolute; top: calc(12px + var(--safe-t)); left: 12px; right: 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; pointer-events: none; }
.he .hud > * { pointer-events: auto; }
.he .hud.is-intro .estrellas { opacity: 0; }
/* 5 estrellas sobre una línea de constelación */
.he .estrellas { position: relative; display: flex; align-items: center; gap: 4px; margin: 0; padding: 8px 12px; border-radius: 26px; background: rgba(10, 16, 51, .62); box-shadow: inset 0 0 0 1px rgba(255, 217, 138, .55); transition: opacity .3s; }
.he .estrellas-linea { position: absolute; left: 26px; right: 26px; top: 50%; border-top: 1.4px dashed rgba(255, 217, 138, .6); }
.he .est { position: relative; line-height: 0; }
.he .est.is-pop { animation: he-pop .7s cubic-bezier(.2, 1.4, .4, 1); filter: drop-shadow(0 0 7px #FFE9A8); }
@keyframes he-pop { 0% { transform: scale(.2) rotate(-40deg); } 70% { transform: scale(1.45) rotate(8deg); } 100% { transform: none; } }
.he .saltar-intro { position: absolute; bottom: calc(18px + var(--safe-b)); left: 50%; transform: translateX(-50%); white-space: nowrap; }

/* ---------- PORTADA ---------- */
.he .portada { position: absolute; left: 14px; right: 14px; bottom: calc(16px + var(--safe-b)); display: flex; flex-direction: column; align-items: center; gap: 12px; transition: opacity .4s, transform .4s; }
.he .portada.is-out { opacity: 0; transform: translateY(20px); pointer-events: none; }
.he .portada-mapa { position: relative; overflow: hidden; width: 100%; padding: 16px 18px 15px; border-radius: 22px; text-align: center; background: rgba(9, 14, 46, .86); box-shadow: inset 0 0 0 1px rgba(255, 217, 138, .7), inset 0 0 0 5px rgba(9, 14, 46, .5), inset 0 0 0 6px rgba(255, 217, 138, .3), 0 18px 40px rgba(2, 3, 20, .55); }
.he .portada-k { position: relative; margin: 0 0 4px; font: 800 13.5px/1.3 var(--f-texto); letter-spacing: .08em; text-transform: uppercase; color: var(--oro); }
.he .portada-t { position: relative; margin: 0; font: 700 clamp(24px, 7cqw, 30px)/1.16 var(--f-grabado); color: var(--crema); text-shadow: 0 0 22px rgba(255, 233, 180, .45); }
.he .portada-sub { position: relative; margin: 8px 0 0; font: 500 16px/1.32 var(--f-texto); color: var(--texto); }
.he .portada-acciones { display: flex; flex-direction: column; align-items: center; gap: 8px; }

/* ---------- la instrucción y el botón ---------- */
.he .abajo { position: absolute; left: 12px; right: 12px; bottom: calc(14px + var(--safe-b)); display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; pointer-events: none; }
.he .abajo > * { pointer-events: auto; }
.he .pista { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-radius: 18px; background: rgba(9, 14, 46, .86); box-shadow: inset 0 0 0 1px rgba(255, 217, 138, .6); color: var(--crema); opacity: 0; transform: translateY(10px); transition: opacity .3s, transform .3s; pointer-events: none !important; }
.he .pista.is-on { opacity: 1; transform: none; }
.he .pista-ic { display: inline-flex; color: var(--oro); }
.he .pista-t { font: 700 17px/1.2 var(--f-texto); }
.he .lanzar { opacity: 0; pointer-events: none !important; transform: translateY(10px); transition: opacity .3s, transform .3s; }
.he .lanzar.is-on { opacity: 1; pointer-events: auto !important; transform: none; }

/* ---------- la mano que enseña ---------- */
.he .mano { position: absolute; left: 0; top: 0; margin: -6px 0 0 -14px; opacity: 0; transition: opacity .25s; pointer-events: none !important; will-change: transform; z-index: 24; }
.he .mano.is-on { opacity: 1; }
.he .mano-dedo { display: block; line-height: 0; filter: drop-shadow(0 4px 6px rgba(2, 3, 20, .5)); }

/* ---------- el nombre del hechizo, en grande ---------- */
.he .conjuro { position: absolute; left: 0; right: 0; top: 13cqh; margin: 0; text-align: center; pointer-events: none !important; animation: he-conjuro 2.1s ease-out both; }
.he .conjuro span { display: inline-block; padding: 8px 18px; font: 800 clamp(25px, 8cqw, 33px)/1.1 var(--f-grabado); color: var(--crema); text-shadow: 0 0 22px rgba(255, 233, 180, .9), 0 2px 6px rgba(2, 3, 20, .85); }
.he .conjuro.is-chico span { font-size: clamp(21px, 6.4cqw, 26px); }
@keyframes he-conjuro { 0% { opacity: 0; transform: translateY(16px) scale(.92); letter-spacing: .24em; } 22% { opacity: 1; transform: none; letter-spacing: .02em; } 78% { opacity: 1; } 100% { opacity: 0; transform: translateY(-10px); } }
.he .toast { position: absolute; left: 0; right: 0; bottom: 18cqh; margin: 0; text-align: center; pointer-events: none !important; transition: opacity .35s; animation: he-toast .45s ease-out both; }
.he .toast.is-out { opacity: 0; }
.he .toast span { display: inline-block; padding: 9px 16px; border-radius: 18px; background: rgba(9, 14, 46, .86); box-shadow: inset 0 0 0 1px rgba(255, 217, 138, .6); font: 700 16.5px/1.2 var(--f-texto); color: var(--crema); }
@keyframes he-toast { 0% { opacity: 0; transform: translateY(14px); } 100% { opacity: 1; transform: none; } }

/* ---------- las tarjetas: cartas estelares ---------- */
.he .tarjeta { position: absolute; left: 12px; right: 12px; bottom: calc(12px + var(--safe-b)); max-height: 78cqh; overflow: auto; padding: 16px 16px 14px; border-radius: 22px; background: rgba(9, 14, 46, .9); box-shadow: inset 0 0 0 1px rgba(255, 217, 138, .75), inset 0 0 0 5px rgba(9, 14, 46, .4), inset 0 0 0 6px rgba(255, 217, 138, .28), 0 20px 44px rgba(2, 3, 20, .6); opacity: 0; transform: translateY(30px); transition: opacity .32s, transform .35s cubic-bezier(.2, 1.15, .35, 1); }
.he .tarjeta.is-in { opacity: 1; transform: none; }
.he .tarjeta.is-out { opacity: 0; transform: translateY(26px); }
.he .tj-k { position: relative; margin: 0 0 3px; font: 800 13.5px/1.3 var(--f-texto); letter-spacing: .07em; text-transform: uppercase; color: var(--oro); }
.he .tj-t { position: relative; margin: 0 0 10px; font: 700 clamp(24px, 7cqw, 29px)/1.12 var(--f-grabado); color: var(--crema); outline: none; }
.he .tj-cuerpo { position: relative; display: flex; flex-direction: column; gap: 10px; }
.he .tj-seguir { margin-top: 12px; overflow: hidden; touch-action: none; }
.he .tj-avance { position: absolute !important; left: 0; bottom: 0; height: 4px; width: 100%; transform-origin: left; transform: scaleX(0); background: rgba(16, 22, 63, .35); }
.he .tarjeta.is-auto .tj-avance { animation: he-avance var(--auto, 11s) linear both; }
@keyframes he-avance { to { transform: scaleX(1); } }
/* datos grandes de la tarjeta */
.he .dato-grande { text-align: center; padding: 10px 8px; border-radius: 14px; background: rgba(255, 233, 180, .09); box-shadow: inset 0 0 0 1px rgba(255, 217, 138, .32); }
.he .dg-k { margin: 0; font: 800 15px/1.2 var(--f-texto); letter-spacing: .1em; text-transform: uppercase; color: var(--oro); }
.he .dg-v { margin: 2px 0; font: 700 clamp(30px, 9cqw, 40px)/1.08 var(--f-grabado); color: var(--crema); text-shadow: 0 0 20px rgba(255, 233, 180, .35); }
.he .dg-s { margin: 0; font: 700 16px/1.2 var(--f-texto); color: var(--texto); }
.he .chip { align-self: center; margin: 0; padding: 6px 14px; border-radius: 16px; background: rgba(255, 217, 138, .16); color: var(--oro); font: 800 15.5px/1.2 var(--f-texto); box-shadow: inset 0 0 0 1px rgba(255, 217, 138, .55); }
.he .acciones { display: flex; flex-wrap: wrap; gap: 8px; }
.he .acciones > * { flex: 1 1 140px; min-height: 46px; font-size: 16px; padding: 0 12px; }
.he .bitacora { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.he .bitacora li { display: grid; grid-template-columns: 76px 1fr; gap: 8px; padding: 5px 2px; border-top: 1px dashed rgba(255, 217, 138, .35); font: 500 16px/1.25 var(--f-texto); }
.he .bt-hora { font-weight: 800; color: var(--oro); }
.he .mapa-estelar { line-height: 0; border-radius: 12px; overflow: hidden; box-shadow: 0 0 0 1px rgba(255, 217, 138, .5); }
.he .mapa-estelar svg { width: 100%; height: auto; display: block; }
.he .lugar-nombre { margin: 2px 0 0; font: 700 21px/1.15 var(--f-grabado); color: var(--crema); }
.he .lugar-dir { margin: 0; font: 500 15.5px/1.3 var(--f-texto); color: var(--texto); }
.he .mensaje { margin: 0; padding: 12px 14px; border-radius: 14px; background: rgba(255, 233, 180, .09); box-shadow: inset 0 0 0 1px rgba(255, 217, 138, .32); }
.he .mensaje p { margin: 0; font: 700 21px/1.25 var(--f-texto); color: var(--crema); }
.he .mensaje footer { margin-top: 6px; font: 800 16px/1.2 var(--f-texto); color: var(--oro); text-align: right; }
.he .anfitriones { margin: 0; text-align: center; font: 700 clamp(24px, 7.2cqw, 31px)/1.15 var(--f-grabado); color: var(--crema); }
.he .invita-nota { margin: 0; text-align: center; font: 500 16px/1.3 var(--f-texto); color: var(--texto); }
.he .con-tarjeta .vineta { background: radial-gradient(120% 70% at 50% 12%, rgba(0, 0, 0, 0) 40%, rgba(4, 6, 34, .55) 100%); }

/* ---------- final ---------- */
.he .saltar { position: absolute; bottom: calc(14px + var(--safe-b)); left: 50%; transform: translateX(-50%); }
.he .cumple { position: absolute; left: 12px; right: 12px; top: 45cqh; text-align: center; pointer-events: none !important; animation: he-cumple .8s cubic-bezier(.2, 1.2, .35, 1) both; }
.he .cumple-k { margin: 0; font: 800 14px/1.3 var(--f-texto); letter-spacing: .1em; text-transform: uppercase; color: var(--oro); text-shadow: 0 1px 8px rgba(2, 3, 20, .9); }
.he .cumple-t { margin: 2px 0; font: 800 clamp(30px, 9.4cqw, 40px)/1.08 var(--f-grabado); color: var(--crema); text-shadow: 0 0 26px rgba(255, 233, 180, .75), 0 2px 8px rgba(2, 3, 20, .95); }
.he .cumple-s { margin: 0; font: 700 17px/1.25 var(--f-texto); color: var(--crema); text-shadow: 0 1px 8px rgba(2, 3, 20, .95); }
@keyframes he-cumple { 0% { opacity: 0; transform: translateY(16px); } 100% { opacity: 1; transform: none; } }
.he .fin { position: absolute; left: 12px; right: 12px; bottom: calc(12px + var(--safe-b)); overflow: hidden; padding: 14px 14px 12px; border-radius: 22px; background: rgba(9, 14, 46, .9); box-shadow: inset 0 0 0 1px rgba(255, 217, 138, .75), inset 0 0 0 5px rgba(9, 14, 46, .4), inset 0 0 0 6px rgba(255, 217, 138, .28), 0 20px 44px rgba(2, 3, 20, .6); display: flex; flex-direction: column; gap: 10px; }
.he .fin-linea { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0; font: 700 17px/1.2 var(--f-texto); color: var(--crema); text-align: center; }
.he .fin-lugar { position: relative; }
.he .fin-lugar summary { display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 6px 12px; border-radius: 14px; background: rgba(255, 233, 180, .1); box-shadow: inset 0 0 0 1px rgba(255, 217, 138, .4); cursor: pointer; list-style: none; font: 700 17px/1.15 var(--f-texto); color: var(--crema); }
.he .fin-salon { flex: 1; min-width: 0; }
.he .fin-vermapa { padding: 3px 10px; border-radius: 12px; background: var(--oro); color: var(--tinta); font: 800 14px/1.2 var(--f-texto); }
.he .fin-lugar[open] { display: flex; flex-direction: column; gap: 8px; }
.he .fin-rsvp { position: relative; }
.he .fin-enlaces { position: relative; display: flex; justify-content: space-evenly; gap: 6px; flex-wrap: wrap; }
.he .vitrina-t { position: absolute; left: 0; right: 0; top: 6cqh; margin: 0; text-align: center; font: 800 clamp(28px, 7cqw, 46px)/1.1 var(--f-grabado); color: var(--crema); text-shadow: 0 0 26px rgba(255, 233, 180, .8), 0 2px 8px rgba(2, 3, 20, .9); pointer-events: none !important; }
.he .vitrina-t small { display: block; margin-top: 6px; font: 700 clamp(18px, 3cqw, 24px)/1.2 var(--f-texto); }
.he .dbg-fps { position: absolute; left: 4px; top: 66px; margin: 0; padding: 2px 6px; font: 12px/1.2 monospace; background: rgba(0, 0, 0, .6); color: #fff; pointer-events: none !important; }

/* movimiento reducido: sin brincos */
@media (prefers-reduced-motion: reduce) {
  .he .conjuro, .he .toast, .he .cumple, .he .est.is-pop { animation-duration: .01s; }
  .he .tarjeta, .he .portada { transition-duration: .01s; }
}
.he .rm .conjuro, .he .rm .toast, .he .rm .cumple, .he .rm .est.is-pop { animation-duration: .01s; }
