/* ==========================================================
   Diseño "Medianoche" · XV años · "Cuando el reloj marque las doce"
   salón de palacio de noche + reloj antiguo → 12 campanadas → espejo con escarcha y zapatilla de cristal
   ========================================================== */

@font-face { font-family: "Pinyon Script"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(../fonts/pinyon-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Pinyon Script"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(../fonts/pinyon-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+20A0-20AB, U+20AD-20C4, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --noche: #0b1430;
  --noche-osc: #060c22;
  --azul: #1f3a6b;
  --azul-cl: #3d5fa8;
  --plata: #dfe6f5;
  --plata-osc: #8f9cba;
  --rosa: #e8c4b8;
  --oro-rosa: #e2b08d;
  --tinta: #eef2fb;
  --suave: rgba(223, 230, 245, .72);
  --plata-texto: linear-gradient(100deg, #9aa6c0 0%, #ffffff 30%, #c3cde3 52%, #ffffff 74%, #8f9cba 100%);
  --rosa-texto: linear-gradient(100deg, #b47a5c 0%, #fde6d2 35%, #e2b08d 60%, #fff3e6 80%, #b47a5c 100%);
  --estrella-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 24'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%23fff3e6'/%3E%3Cstop offset='.5' stop-color='%23e2b08d'/%3E%3Cstop offset='1' stop-color='%23b47a5c'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M2 12H22M38 12H58' stroke='%23c3cde3' stroke-width='1'/%3E%3Cpath d='M30 2Q31.6 10.4 40 12Q31.6 13.6 30 22Q28.4 13.6 20 12Q28.4 10.4 30 2Z' fill='url(%23g)'/%3E%3Ccircle cx='24' cy='12' r='1.4' fill='%23dfe6f5'/%3E%3Ccircle cx='36' cy='12' r='1.4' fill='%23dfe6f5'/%3E%3C/svg%3E");
  --damasco: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='120' viewBox='0 0 80 120'%3E%3Cg fill='none' stroke='%23c3cde3' stroke-opacity='.07' stroke-width='1'%3E%3Cpath d='M40 10C52 26 52 44 40 60C28 44 28 26 40 10ZM40 60C54 72 54 92 40 110C26 92 26 72 40 60ZM0 60C10 50 10 34 0 24M80 60C70 50 70 34 80 24M0 60C10 70 10 86 0 96M80 60C70 70 70 86 80 96'/%3E%3C/g%3E%3C/svg%3E");

  --s-fondo: transparent;
  --s-tinta: var(--tinta);
  --s-suave: var(--suave);
  --s-acento: var(--oro-rosa);
  --s-acento-tinta: #1b1530;
  --s-tarjeta: linear-gradient(170deg, rgba(31, 58, 107, .5), rgba(6, 12, 34, .88));
  --s-borde: rgba(195, 205, 227, .28);
  --s-radio: 20px;
  --s-sombra: 0 22px 40px -24px rgba(0, 0, 0, .95);
  --s-fuente: "Cormorant Garamond", Georgia, serif;
  --s-titulo: "Pinyon Script", "Great Vibes", cursive;
  --s-titulo-tam: clamp(2.5rem, 10.5vw, 3.3rem);
  --s-etiqueta: "Cinzel", Georgia, serif;
  --s-num: "Cinzel", Georgia, serif;
  --s-titulo-color: var(--plata);
  --s-btn-linea-color: var(--plata);
  color-scheme: dark;
}

body {
  background:
    radial-gradient(120% 50% at 50% 0%, rgba(61, 95, 168, .35), transparent 60%),
    var(--damasco),
    linear-gradient(180deg, #0a1330 0%, #0d1838 50%, #070d24 100%);
  background-attachment: fixed;
  color: var(--tinta);
  font-family: var(--s-fuente);
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Botón de sonido (respeta el silencio) ---------- */
.btn-sonido {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 10px);
  right: max(10px, calc(50% - 280px));
  z-index: 55;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(195, 205, 227, .45);
  border-radius: 50%;
  background: rgba(6, 12, 34, .62);
  color: var(--plata);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.btn-sonido svg { width: 21px; height: 21px; }
.btn-sonido:focus-visible { outline: 2px solid var(--plata); outline-offset: 3px; }
.btn-sonido__tacha { opacity: 0; }
.btn-sonido[aria-pressed="true"] .btn-sonido__tacha { opacity: 1; }
.btn-sonido[aria-pressed="true"] .btn-sonido__onda { opacity: 0; }

/* ---------- Hero: el salón del palacio ---------- */
.palacio {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  justify-items: center;
  align-items: center;
  padding: calc(env(safe-area-inset-top) + 16px) 16px calc(env(safe-area-inset-bottom) + 50px);
  overflow: hidden;
  isolation: isolate;
  text-align: center;
  color: var(--tinta);
  background: var(--noche-osc);
}

.sala {
  position: absolute;
  inset: 0;
  z-index: -5;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, .45), transparent 14%, transparent 86%, rgba(0, 0, 0, .45)),
    var(--damasco),
    radial-gradient(90% 60% at 50% 40%, #16295a, transparent 75%),
    linear-gradient(180deg, #091230 0%, #0e1c45 60%, #070d24 100%);
}
.sala::after { content: ""; position: absolute; inset: 0; background: var(--grano); opacity: .7; }

/* Ventanal con luna y estrellas */
.ventanal {
  position: absolute;
  left: 50%;
  bottom: 12%;
  z-index: -4;
  width: min(96vw, 560px, calc(78svh * .714));
  aspect-ratio: 400 / 560;
  transform: translateX(-50%);
}
.ventanal__svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.titila { animation: titilar 3.2s ease-in-out infinite alternate; }
.titila--1 { animation-duration: 2.6s; animation-delay: -1.2s; }
.titila--2 { animation-duration: 3.8s; animation-delay: -2.1s; }
@keyframes titilar { from { opacity: .35; } to { opacity: 1; } }
.chispa { transform-box: fill-box; transform-origin: center; animation: chispa 2.8s ease-in-out infinite; }
.chispa--1 { animation-delay: -1s; animation-duration: 3.3s; }
.chispa--2 { animation-delay: -1.9s; animation-duration: 2.4s; }
@keyframes chispa { 0%, 100% { opacity: .2; transform: scale(.5); } 50% { opacity: 1; transform: scale(1.15); } }
.luna__halo { transform-box: fill-box; transform-origin: center; transition: opacity 2s ease, transform 2s ease; opacity: .75; }
.palacio.c5 .luna__halo { opacity: 1; transform: scale(1.35); }
.palacio.c5 .titila { animation-duration: 1.4s; }
.fugaz { opacity: 0; }
.fugaz--1 { transform: translate(360px, 60px); }
.fugaz--2 { transform: translate(250px, 300px); }
.palacio.c8 .fugaz--1 { animation: fugaz1 1.4s ease-in forwards; }
.palacio.c8 .fugaz--2 { animation: fugaz2 1.2s ease-in .5s forwards; }
@keyframes fugaz1 { 0% { opacity: 0; transform: translate(360px, 60px); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(120px, 150px); } }
@keyframes fugaz2 { 0% { opacity: 0; transform: translate(250px, 300px); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(60px, 370px); } }
.vidrio-escarcha { opacity: 0; transition: opacity 2.4s ease; }
.palacio.c7 .vidrio-escarcha { opacity: 1; }

/* Cortinas de terciopelo (se abren en la 4.ª campanada) */
.cortinas { position: absolute; left: 5%; right: 5%; top: 37.5%; bottom: 0; }
.cortina { position: absolute; top: 0; bottom: 0; width: 50.5%; height: 100%; transition: transform 2.6s cubic-bezier(.5, .05, .25, 1); }
.cortina--izq { left: 0; transform-origin: 0 0; }
.cortina--der { right: 0; transform-origin: 100% 0; }
.palacio.c4 .cortina--izq, .palacio.c4 .cortina--der { transform: scaleX(.24); }
.cenefa { position: absolute; left: -3%; top: -4%; width: 106%; height: 20%; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .5)); }

/* Candiles con velas */
.candil {
  position: absolute;
  top: 36%;
  z-index: -2;
  width: clamp(46px, 13vw, 96px);
  height: auto;
  aspect-ratio: 100 / 190;
  overflow: visible;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .6));
}
.candil--izq { left: max(2px, 1.5%); }
.candil--der { right: max(2px, 1.5%); transform: scaleX(-1); }
.flama { opacity: 0; transition: opacity .8s ease; }
.flama__fuego { transform-box: fill-box; transform-origin: 50% 100%; transform: scale(.2); transition: transform .8s cubic-bezier(.3, 1.6, .5, 1); }
.flama__halo { transform-box: fill-box; transform-origin: center; }
.palacio.c2 .candil--izq .flama, .palacio.c3 .candil--der .flama { opacity: 1; }
.palacio.c2 .candil--izq .flama__fuego, .palacio.c3 .candil--der .flama__fuego { transform: scale(1); animation: parpadeo 1.2s ease-in-out .8s infinite alternate; }
.palacio.c2 .candil--izq .flama__halo, .palacio.c3 .candil--der .flama__halo { animation: halo 2.2s ease-in-out infinite alternate; }
.flama--1 .flama__fuego { animation-delay: .6s !important; animation-duration: 1.05s !important; }
.flama--2 .flama__fuego { animation-delay: 1s !important; }
@keyframes parpadeo {
  0% { transform: scale(1, 1) skewX(0deg); }
  30% { transform: scale(.9, 1.1) skewX(4deg); }
  60% { transform: scale(1.06, .93) skewX(-3deg); }
  100% { transform: scale(.96, 1.05) skewX(1deg); }
}
@keyframes halo { from { opacity: .7; transform: scale(.9); } to { opacity: 1; transform: scale(1.12); } }

/* Piso de mármol */
.piso {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 12.5%;
  z-index: -3;
  background:
    radial-gradient(60% 90% at 50% 0%, rgba(150, 175, 230, .22), transparent 70%),
    linear-gradient(180deg, #16244f 0%, #0a1330 70%, #060c22 100%);
  border-top: 1px solid rgba(195, 205, 227, .35);
  overflow: hidden;
}
.piso::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .28) 48%, transparent 66%);
  transform: translateX(-120%);
}
.palacio.c11 .piso::after { animation: barrer 1.6s ease-in-out forwards; }
@keyframes barrer { from { transform: translateX(-120%); } to { transform: translateX(120%); } }

/* Textos (antes / después) */
.palacio__arriba, .palacio__abajo { position: relative; z-index: 4; display: grid; justify-items: center; width: 100%; }
.palacio__arriba > *, .palacio__abajo > * { grid-area: 1 / 1; margin: 0; transition: opacity .9s ease, transform .9s ease, visibility 0s; }
.palacio__abajo { min-height: 130px; align-content: start; align-self: start; }

.palacio__q {
  margin: 0;
  padding: 0 .25em;
  font-family: "Pinyon Script", "Great Vibes", cursive;
  font-size: clamp(1.8rem, 7.6vw, 2.7rem);
  line-height: 1.2;
  background: var(--plata-texto);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, .85));
}
.palacio__sub { margin: 4px 0 0; font-family: "Cinzel", serif; font-size: .6rem; letter-spacing: .34em; padding-left: .34em; text-transform: uppercase; color: rgba(232, 196, 184, .85); text-shadow: 0 1px 6px #000; }
.palacio__fecha { align-self: end; font-family: "Cinzel", serif; font-size: .66rem; letter-spacing: .24em; text-transform: uppercase; color: var(--plata); text-shadow: 0 1px 8px #000; opacity: 0; transform: translateY(10px); }
.palacio__fecha i { font-style: normal; margin: 0 .7em; font-size: .7em; color: var(--oro-rosa); }
.palacio.revelado .palacio__pre { opacity: 0; transform: translateY(-12px); }
.palacio.revelado .palacio__fecha { opacity: 1; transform: none; transition-delay: 2.6s; }

.palacio__antes { display: grid; justify-items: center; gap: 6px; }
.palacio.medianoche .palacio__antes { opacity: 0; visibility: hidden; transition: opacity .6s ease, visibility 0s .6s; }
.palacio__hint { margin: 0; display: flex; align-items: center; justify-content: center; gap: 8px; font-style: italic; font-size: 1.1rem; line-height: 1.2; color: var(--plata); text-shadow: 0 1px 8px #000; }
.palacio__giro { flex: none; width: 20px; height: 20px; color: var(--oro-rosa); animation: girar 2.4s linear infinite; }
@keyframes girar { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.palacio__hint-sub { margin: 0; font-family: "Cinzel", serif; font-size: .56rem; letter-spacing: .18em; text-transform: uppercase; color: rgba(223, 230, 245, .7); }
.palacio.pista .palacio__hint { animation: pista .6s ease 2; }
@keyframes pista { 50% { transform: scale(1.06); color: #fff; } }

.btn-doce {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  margin-top: 6px;
  padding: 0 22px;
  border: 1px solid rgba(226, 176, 141, .8);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(45, 75, 150, .78), rgba(8, 16, 46, .92));
  color: var(--plata);
  font-family: "Cinzel", serif;
  font-size: .66rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 12px 26px -14px #000, inset 0 1px 0 rgba(255, 255, 255, .22), 0 0 18px rgba(226, 176, 141, .18);
  transition: transform .2s ease, box-shadow .3s;
}
.btn-doce svg { width: 18px; height: 18px; flex: none; color: var(--oro-rosa); }
.btn-doce:active { transform: scale(.96); }
.btn-doce:focus-visible { outline: 2px solid var(--plata); outline-offset: 3px; }
.btn-doce:disabled { opacity: .6; cursor: default; }

.palacio__despues { opacity: 0; pointer-events: none; display: grid; justify-items: center; }
.palacio.revelado .palacio__despues { opacity: 1; transition-delay: .3s; }
.firma { margin: 0; width: min(88vw, 470px); line-height: 0; outline: none; }
.firma__svg { display: block; width: 100%; height: auto; aspect-ratio: 600 / 170; overflow: visible; filter: drop-shadow(0 0 10px rgba(190, 210, 255, .45)); }
.firma__txt { fill: url(#firmaPlata); fill-opacity: 0; stroke: url(#firmaPlata); stroke-width: 1.3; stroke-dasharray: 1200; stroke-dashoffset: 1200; }
.palacio.firmando .firma__txt { animation: trazar 3.2s cubic-bezier(.45, .1, .3, 1) forwards, rellenar 1.4s ease 2.1s forwards; }
@keyframes trazar { from { stroke-dashoffset: 1200; } to { stroke-dashoffset: 0; } }
@keyframes rellenar { from { fill-opacity: 0; } to { fill-opacity: 1; } }
.palacio__xv { margin: 0; font-family: "Cinzel", serif; font-size: .68rem; letter-spacing: .28em; padding-left: .28em; text-transform: uppercase; color: var(--rosa); opacity: 0; transform: translateY(8px); transition: opacity 1s ease, transform 1s ease; }
.palacio__xv i { font-style: normal; color: var(--plata-osc); }
.palacio.revelado .palacio__xv { opacity: 1; transform: none; transition-delay: 2.2s; }
.palacio__varita { margin: 8px 0 0; max-width: 20em; font-style: italic; font-size: .95rem; color: rgba(223, 230, 245, .7); opacity: 0; transition: opacity 1s ease; }
.palacio.listo .palacio__varita { opacity: 1; }

.desliza-c { color: var(--plata); z-index: 5; }

/* ---------- Escenario: reloj → retrato ---------- */
.escenario {
  --p: min(60vw, 290px, 33svh);
  position: relative;
  z-index: 3;
  width: var(--p);
  height: calc(var(--p) * 1.5);
  margin: 8px 0;
}

.reloj { position: absolute; inset: 0; transition: opacity 1s ease, transform 1.2s cubic-bezier(.5, 0, .6, 1), filter 1s ease; }
.reloj__cuerpo { position: absolute; inset: 0; transform-origin: 50% 35.5%; }
.reloj__cuerpo.golpe { animation: golpe .55s ease; }
@keyframes golpe { 0% { transform: scale(1); } 25% { transform: scale(1.025) rotate(-.6deg); } 55% { transform: scale(.995) rotate(.4deg); } 100% { transform: scale(1) rotate(0deg); } }
.reloj__svg { display: block; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 18px 22px rgba(0, 0, 0, .65)); transition: filter 1.5s ease; }
.palacio.c9 .reloj__svg { filter: drop-shadow(0 18px 22px rgba(0, 0, 0, .65)) drop-shadow(0 0 16px rgba(240, 190, 160, .75)); }
.pendulo { transform-box: view-box; transform-origin: 150px 290px; animation: pendulo 1s ease-in-out infinite alternate; }
@keyframes pendulo { from { transform: rotate(-8deg); } to { transform: rotate(8deg); } }
.ruta { animation: flujo 1.2s linear infinite; transition: opacity .6s ease; }
@keyframes flujo { from { stroke-dashoffset: 14; } to { stroke-dashoffset: 0; } }
.meta { transform-box: fill-box; transform-origin: center; animation: latir 1.6s ease-in-out infinite; }
@keyframes latir { 0%, 100% { transform: scale(.75); opacity: .7; } 50% { transform: scale(1.15); opacity: 1; } }
.agarre { transform-box: fill-box; transform-origin: center; animation: agarre 1.8s ease-out infinite; }
@keyframes agarre { from { transform: scale(.7); opacity: 1; } to { transform: scale(1.5); opacity: 0; } }
.palacio.medianoche .ruta, .palacio.medianoche .meta, .palacio.medianoche .agarre { opacity: 0; animation: none; }
.rl-remate { transform-box: fill-box; transform-origin: center; animation: remate 3s ease-in-out infinite; }
@keyframes remate { 0%, 100% { transform: scale(1) rotate(0deg); } 50% { transform: scale(1.12) rotate(45deg); } }

.minutero {
  position: absolute;
  left: 6.33%;
  top: 6.44%;
  width: 87.33%;
  height: 58.22%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: grab;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.minutero:active, .palacio.tocando .minutero { cursor: grabbing; }
.minutero:focus-visible { outline: 2px solid var(--rosa); outline-offset: 4px; }
.minutero:disabled { cursor: default; }

.palacio.transformando .reloj { opacity: 0; transform: scale(.55) rotate(-25deg); filter: blur(6px) brightness(2); }
.palacio.revelado .reloj { visibility: hidden; }

.campanada {
  position: absolute;
  left: 0;
  right: 0;
  top: 64%;
  z-index: 4;
  margin: 0;
  font-family: "Cinzel", serif;
  font-size: clamp(1.8rem, 9vw, 2.6rem);
  font-weight: 600;
  line-height: 1;
  color: #fff;
  text-shadow: 0 0 12px rgba(190, 210, 255, .9), 0 0 26px rgba(226, 176, 141, .7);
  opacity: 0;
  pointer-events: none;
}
.campanada.late { animation: late 1s ease-out forwards; }
@keyframes late { 0% { opacity: 0; transform: scale(.6); } 25% { opacity: 1; transform: scale(1.1); } 100% { opacity: 0; transform: scale(1.4) translateY(-14px); } }

.onda {
  position: absolute;
  left: 2%;
  top: calc(35.5% - var(--p) * .48);
  width: 96%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid rgba(223, 230, 245, .8);
  box-shadow: 0 0 22px rgba(190, 210, 255, .6), inset 0 0 18px rgba(226, 176, 141, .4);
  opacity: 0;
  pointer-events: none;
}
.onda.late { animation: onda 1.1s ease-out forwards; }
@keyframes onda { from { opacity: .9; transform: scale(.85); } to { opacity: 0; transform: scale(1.6); } }

.destello-total {
  position: absolute;
  inset: 0;
  z-index: 6;
  background: radial-gradient(circle at 50% 45%, rgba(255, 255, 255, .95), rgba(190, 210, 255, .6) 35%, rgba(11, 20, 48, 0) 75%);
  opacity: 0;
  pointer-events: none;
}
.palacio.transformando .destello-total { animation: destello 1.8s ease forwards; }
@keyframes destello { 0% { opacity: 0; } 40% { opacity: 1; } 100% { opacity: 0; } }

/* Espejo ovalado */
.retrato {
  position: absolute;
  left: 11%;
  top: 9%;
  width: 78%;
  height: 65%;
  opacity: 0;
  transform: scale(.7);
  transition: opacity 1.2s ease, transform 1.6s cubic-bezier(.2, .9, .3, 1.15);
}
.palacio.revelado .retrato { opacity: 1; transform: none; }
.retrato__oval {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 50%;
  background: #0a1430;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .6), 0 30px 50px -22px #000, 0 0 60px rgba(150, 180, 255, .4);
  transform: translateZ(0);
}
.retrato__foto {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
  filter: brightness(2.4) saturate(0) blur(6px);
  transform: scale(1.12);
  transition: filter 2.6s ease .5s, transform 3s cubic-bezier(.2, .8, .2, 1);
}
.palacio.revelado .retrato__foto { filter: none; transform: scale(1); }
.retrato__luz {
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .45) 48%, rgba(220, 232, 255, .15) 54%, transparent 62%);
  transform: translateX(-130%);
  mix-blend-mode: screen;
}
.palacio.listo .retrato__luz { animation: reflejo 6s ease-in-out 1s infinite; }
@keyframes reflejo { 0%, 70% { transform: translateX(-130%); } 100% { transform: translateX(130%); } }
.retrato__marco { position: absolute; left: -20%; top: -19.2%; width: 140%; height: 138.4%; overflow: visible; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .7)) drop-shadow(0 0 6px rgba(190, 210, 255, .3)); }

.hielo { stroke-dasharray: 1; stroke-dashoffset: 1; filter: drop-shadow(0 0 1.5px rgba(200, 225, 255, .9)); }
.palacio.revelado .hielo { animation: cristalizar 2.4s ease-out 1s forwards; }
.palacio.revelado .hielo--1 { animation-delay: 1.3s; }
.palacio.revelado .hielo--2 { animation-delay: 1.6s; }
.palacio.revelado .hielo--3 { animation-delay: 1.9s; }
@keyframes cristalizar { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.copo { opacity: 0; transform-box: fill-box; transform-origin: center; }
.palacio.revelado .copo { animation: copo 1.2s cubic-bezier(.3, 1.5, .5, 1) forwards; }
.palacio.revelado .copo--0 { animation-delay: 2.2s; }
.palacio.revelado .copo--1 { animation-delay: 2.5s; }
.palacio.revelado .copo--2 { animation-delay: 2.8s; }
.palacio.revelado .copo--3 { animation-delay: 3.1s; }
.palacio.revelado .copo--4 { animation-delay: 3.4s; }
@keyframes copo { from { opacity: 0; transform: scale(0) rotate(-90deg); } to { opacity: 1; transform: scale(1) rotate(0deg); } }

/* Zapatilla de cristal */
.zapatilla {
  position: absolute;
  left: 50%;
  top: 70%;
  z-index: 3;
  width: 54%;
  height: auto;
  aspect-ratio: 220 / 150;
  overflow: visible;
  opacity: 0;
  transform: translateY(24px) rotate(-6deg) scale(.6);
  filter: drop-shadow(0 0 10px rgba(190, 215, 255, .65));
  transition: opacity 1.2s ease 1.8s, transform 1.4s cubic-bezier(.2, .9, .3, 1.3) 1.8s;
  pointer-events: none;
}
.palacio.revelado .zapatilla { opacity: 1; transform: rotate(-6deg); }
.zp-destello { transform-box: fill-box; transform-origin: center; animation: chispa 2.2s ease-in-out infinite; }
.zp-destello--2 { animation-delay: -1.1s; }

/* Varita: polvo de estrellas que sigue el dedo */
.varita { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 59; pointer-events: none; }

@media (min-width: 700px) {
  .escenario { --p: min(34vw, 320px, 40svh); }
}
@media (max-height: 600px) {
  .escenario { --p: min(56vw, 290px, 30svh); }
  .palacio__abajo { min-height: 118px; }
  .palacio__hint-sub { display: none; }
}

/* ---------- Secciones ---------- */
.s-titulo {
  padding: 0 .25em;
  background: var(--plata-texto);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.s-titulo::before {
  content: "";
  display: block;
  width: 64px;
  height: 26px;
  margin: 0 auto 10px;
  background: var(--estrella-ico) center / contain no-repeat;
}

.dedicatoria { padding-top: 96px; }
.dedicatoria__mono {
  width: 96px;
  height: 120px;
  margin: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 45% 35%, #2a4688, #0a1430 75%);
  box-shadow: 0 0 0 1px var(--plata), 0 0 0 5px var(--noche), 0 0 0 6px rgba(226, 176, 141, .6), 0 0 44px rgba(150, 180, 255, .3);
}
.dedicatoria__mono span {
  padding: 0 .2em;
  font-family: "Pinyon Script", cursive;
  font-size: 3.4rem;
  line-height: 1;
  background: var(--plata-texto);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.dedicatoria__texto { margin: 30px 0 0; max-width: 21em; font-style: italic; font-size: clamp(1.22rem, 5vw, 1.42rem); line-height: 1.6; }
.dedicatoria__familia { margin-top: 26px; }
.dedicatoria__t { margin: 18px 0 0; font-family: "Cinzel", serif; font-size: .64rem; letter-spacing: .3em; text-transform: uppercase; color: var(--suave); }
.dedicatoria__n { margin: 4px 0 0; font-family: "Pinyon Script", cursive; font-size: 1.85rem; line-height: 1.3; color: var(--rosa); }

/* Invitación de palacio con sello de cera */
.palco { --pw: min(calc(100vw - 48px), 340px); position: relative; width: var(--pw); padding-top: 34px; }
.palco__hint {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  margin: 0;
  font-family: "Cinzel", serif;
  font-size: .62rem;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--rosa);
  animation: latido 2.2s ease-in-out infinite;
  transition: opacity .5s ease;
}
@keyframes latido { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
.palco.abierta .palco__hint { opacity: 0; animation: none; }
.palco__caja { position: relative; width: 100%; perspective: 1100px; }
.carta {
  position: relative;
  margin: 0;
  padding: 28px 18px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-radius: 8px;
  background: radial-gradient(120% 90% at 50% 0%, #ffffff, #eef1f8 60%, #dfe4f0);
  box-shadow: 0 30px 50px -26px #000, inset 0 0 0 7px #ffffff, inset 0 0 0 8px rgba(143, 156, 186, .7), inset 0 0 0 11px #ffffff, inset 0 0 0 12px rgba(180, 122, 92, .5);
  color: #14244f;
  text-align: center;
}
.carta > * { opacity: .0; transform: translateY(6px); transition: opacity .8s ease, transform .8s ease; }
.palco.abierta .carta > * { opacity: 1; transform: none; }
.palco.abierta .carta > :nth-child(2) { transition-delay: .9s; }
.palco.abierta .carta > :nth-child(3) { transition-delay: 1.2s; }
.palco.abierta .carta > :nth-child(n+4) { transition-delay: 1.5s; }
.carta__pre { margin: 0; font-family: "Cinzel", serif; font-size: .56rem; letter-spacing: .22em; text-transform: uppercase; color: #6d5a6e; }
.carta__nombre { margin: 6px 0 0; max-width: 100%; font-family: "Pinyon Script", cursive; font-size: clamp(1.9rem, 8.4vw, 2.4rem); line-height: 1.2; color: #1f3a6b; overflow-wrap: anywhere; }
.carta__frase { margin: 2px 0 0; font-style: italic; font-size: 1.22rem; line-height: 1.3; color: #8a4f42; }
.carta__orn { width: 150px; height: 15px; margin: 12px 0 6px; }
.carta__xv { margin: 0; font-family: "Pinyon Script", cursive; font-size: 1.5rem; line-height: 1.2; color: #1f3a6b; }
.carta__pases { margin: 6px 0 0; font-family: "Cinzel", serif; font-size: .6rem; letter-spacing: .22em; text-transform: uppercase; color: #6d5a6e; }
.carta__pases b { font-size: 1.35rem; font-weight: 600; letter-spacing: 0; color: #b47a5c; vertical-align: -2px; }
.carta__fecha { margin: 4px 0 0; font-family: "Cinzel", serif; font-size: .56rem; letter-spacing: .16em; text-transform: uppercase; color: #6d5a6e; }

.puerta {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  z-index: 3;
  display: flex;
  align-items: center;
  padding: 0 10px;
  background:
    var(--damasco),
    linear-gradient(160deg, #1f3a6b, #0b1638 70%);
  border: 1px solid rgba(195, 205, 227, .6);
  box-shadow: inset 0 0 0 7px rgba(0, 0, 0, 0), inset 0 0 0 8px rgba(195, 205, 227, .35), 0 20px 34px -20px #000;
  transition: transform 1.3s cubic-bezier(.5, .05, .25, 1) .35s;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.puerta--izq { left: 0; justify-content: flex-end; border-radius: 8px 0 0 8px; transform-origin: 0 50%; }
.puerta--der { right: 0; justify-content: flex-start; border-radius: 0 8px 8px 0; transform-origin: 100% 50%; }
.puerta::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 14px;
  width: 44px;
  height: 18px;
  margin-left: -22px;
  background: var(--estrella-ico) center / contain no-repeat;
  opacity: .9;
}
.puerta__txt { position: relative; margin-top: 74px; font-family: "Pinyon Script", cursive; font-size: clamp(1.25rem, 5.6vw, 1.55rem); line-height: 1; color: var(--plata); text-shadow: 0 1px 6px #000; }
.puerta--izq .puerta__txt { padding-right: 46px; }
.puerta--der .puerta__txt { padding-left: 46px; }
.palco.abierta .puerta--izq { transform: rotateY(-108deg); }
.palco.abierta .puerta--der { transform: rotateY(108deg); }
.palco.abierta .puerta { pointer-events: none; }

.sello {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 6;
  width: 84px;
  height: 84px;
  margin: -42px 0 0 -42px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.sello:focus-visible { outline: 2px solid var(--plata); outline-offset: 4px; }
.sello__mitad { position: absolute; inset: 0; transition: transform .8s cubic-bezier(.3, .6, .4, 1), opacity .8s ease; }
.sello__mitad svg { display: block; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 4px 5px rgba(0, 0, 0, .6)); }
.sello__mitad--izq { clip-path: inset(0 50% 0 0); }
.sello__mitad--der { clip-path: inset(0 0 0 50%); }
.sello:not([aria-expanded="true"]) .sello__mitad { animation: tiembla 4s ease-in-out infinite; }
@keyframes tiembla { 0%, 86%, 100% { transform: rotate(0deg); } 90% { transform: rotate(-5deg); } 94% { transform: rotate(4deg); } }
.sello__pulso { position: absolute; inset: -9px; border-radius: 50%; border: 1.5px solid rgba(232, 196, 184, .8); animation: pulso 2.2s ease-out infinite; }
@keyframes pulso { from { transform: scale(.85); opacity: .9; } to { transform: scale(1.3); opacity: 0; } }
.palco.abierta .sello { pointer-events: none; }
.palco.abierta .sello__pulso { display: none; }
.palco.abierta .sello__mitad--izq { transform: translate(-40px, 60px) rotate(-30deg); opacity: 0; }
.palco.abierta .sello__mitad--der { transform: translate(40px, 66px) rotate(26deg); opacity: 0; }

/* Cuenta regresiva: un reloj */
.cuenta__sub { margin: -14px 0 18px; font-family: "Cinzel", serif; font-size: .64rem; letter-spacing: .32em; padding-left: .32em; text-transform: uppercase; color: var(--suave); }
.cuenta-reloj { position: relative; width: min(84vw, 330px); aspect-ratio: 1; display: grid; place-items: center; }
.cuenta-reloj__esfera { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 20px 30px rgba(0, 0, 0, .7)); }
.cuenta-reloj__cajas { position: relative; width: 58%; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cuenta-reloj__caja {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0 6px;
  border-radius: 14px;
  background: rgba(6, 12, 34, .55);
  border: 1px solid rgba(195, 205, 227, .25);
}
.cuenta-reloj .s-cuenta__num { font-size: clamp(1.3rem, 6.2vw, 1.8rem); color: var(--plata); }
.cuenta-reloj .s-cuenta__lbl { font-size: .52rem; color: var(--rosa); }
.cuenta-reloj__fin { position: relative; max-width: 7em; font-family: "Pinyon Script", cursive; font-size: 2rem; line-height: 1.15; color: var(--rosa); }

/* Itinerario, galería */
.s-cuenta__fecha { color: var(--suave); }
.s-evento { position: relative; box-shadow: var(--s-sombra), inset 0 0 0 6px rgba(0, 0, 0, 0), inset 0 0 0 7px rgba(195, 205, 227, .14); }
.s-evento::before { content: ""; position: absolute; left: 50%; top: -1px; width: 60px; height: 2px; margin-left: -30px; background: linear-gradient(90deg, transparent, var(--oro-rosa), transparent); }
.s-evento__icono { color: var(--plata); border-color: rgba(195, 205, 227, .55); background: radial-gradient(circle, rgba(45, 75, 150, .55), rgba(6, 12, 34, .9)); }
.s-evento__titulo { color: var(--rosa); }
.s-evento__hora { font-family: "Cinzel", serif; font-size: 1.7rem; color: var(--plata); }
.s-foto { padding: 5px; border: 1px solid rgba(195, 205, 227, .5); background: #0a1430; }
.s-foto img { border-radius: calc(var(--s-radio) - 5px); }
.s-galeria__rejilla--3 .s-foto:not(:first-child) { border-radius: 200px 200px 18px 18px; }
.s-galeria__rejilla--3 .s-foto:not(:first-child) img { border-radius: 200px 200px 13px 13px; }

/* Vestimenta */
.s-vestimenta__tipo { font-family: "Cinzel", serif; font-size: 1rem; letter-spacing: .3em; padding-left: .3em; text-transform: uppercase; color: var(--plata); }
.s-paleta li { border-color: rgba(195, 205, 227, .45); }
.detalle {
  max-width: 22em;
  margin: 24px 0 0;
  padding: 18px 22px 20px;
  border: 1px solid rgba(195, 205, 227, .45);
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(45, 75, 150, .4), rgba(6, 12, 34, .9));
  box-shadow: inset 0 0 0 5px rgba(0, 0, 0, 0), inset 0 0 0 6px rgba(226, 176, 141, .18), 0 22px 40px -24px #000;
}
.detalle__ico { display: block; width: 120px; height: 82px; margin: 0 auto; filter: drop-shadow(0 0 10px rgba(190, 215, 255, .6)); animation: flota 3.4s ease-in-out infinite alternate; }
@keyframes flota { from { transform: translateY(0) rotate(-3deg); } to { transform: translateY(-5px) rotate(2deg); } }
.detalle__t { margin: 8px 0 4px; font-family: "Cinzel", serif; font-size: 1rem; font-weight: 600; letter-spacing: .2em; padding-left: .2em; text-transform: uppercase; color: var(--rosa); }
.detalle__n { margin: 0; font-style: italic; font-size: 1.05rem; line-height: 1.45; color: var(--suave); }

/* Banda con el vestido */
.banda { position: relative; margin: 10px 24px; overflow: hidden; border-radius: 220px 220px 24px 24px; border: 1px solid rgba(195, 205, 227, .55); box-shadow: var(--s-sombra), 0 0 0 5px var(--noche), 0 0 0 6px rgba(226, 176, 141, .3); }
.banda img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 40%; }
.banda figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 80px 26px 28px;
  background: linear-gradient(180deg, transparent, rgba(6, 12, 34, .92));
  font-family: "Pinyon Script", cursive;
  font-size: clamp(1.5rem, 6.4vw, 1.85rem);
  line-height: 1.3;
  text-align: center;
  color: var(--plata);
}

.s-rsvp__saludo { font-family: "Pinyon Script", cursive; font-size: 2rem; color: var(--rosa); }
.s-btn--lleno { background: linear-gradient(120deg, #b47a5c, #fde6d2 45%, #e2b08d 70%, #b47a5c); color: #1b1530; }
.s-pie__n { font-family: "Pinyon Script", cursive; font-size: 3rem; color: var(--plata); }
.s-cuenta__fin { color: var(--rosa); }
.btn-musica { background: var(--noche); color: var(--plata); box-shadow: var(--s-sombra), 0 0 0 1px rgba(195, 205, 227, .5); }

@media (prefers-reduced-motion: reduce) {
  .titila, .chispa, .pendulo, .ruta, .meta, .agarre, .rl-remate, .palacio__giro, .zp-destello, .detalle__ico,
  .palco__hint, .sello__mitad, .sello__pulso, .retrato__luz { animation: none !important; }
  .palacio.c2 .candil--izq .flama__fuego, .palacio.c3 .candil--der .flama__fuego,
  .palacio.c2 .candil--izq .flama__halo, .palacio.c3 .candil--der .flama__halo { animation: none !important; }
  .cortina, .reloj, .retrato, .retrato__foto, .zapatilla, .puerta, .sello__mitad, .carta > * { transition-duration: .3s !important; transition-delay: 0s !important; }
  .firma__txt { stroke-dashoffset: 0; fill-opacity: 1; }
  .palacio.firmando .firma__txt { animation: none; }
  .hielo { stroke-dashoffset: 0; }
  .palacio.revelado .hielo, .palacio.revelado .copo { animation: none; }
  .palacio.revelado .copo { opacity: 1; }
  .reloj__cuerpo.golpe, .campanada.late, .onda.late, .palacio.transformando .destello-total { animation: none; }
}
