:root {
  --fondo: #1B0A11;
  --superficie: #2D111C;
  --tinta: #F6ECDD;
  --acento: #DDB57E;
  --burdeos: #7A1E36;
  --burdeos-o: #561425;
  --oro: #E3BE88;
  --papel: #6C1A30;
  --texto: "Bricolage Grotesque", ui-sans-serif, "Segoe UI", system-ui, sans-serif;
  --margen: max(20px, 3.5vw);
}

* { box-sizing: border-box; margin: 0; }
html { background: var(--fondo); scrollbar-width: none; -webkit-text-size-adjust: 100%; }
html::-webkit-scrollbar { display: none; }
html.cerrado { overflow: hidden; }
body { color: var(--tinta); font-family: var(--texto); font-size: 18px; line-height: 1.25; overflow-x: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--acento); outline-offset: 3px; }
.solo-lector { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

#escenario { position: fixed; inset: 0; overflow: hidden; contain: strict; background: var(--fondo); }

/* ---------------------------------- recuerdos */
.m { position: absolute; left: 0; top: 0; transform-origin: 0 0; overflow: hidden; cursor: zoom-in; border-radius: 2px; }
.m.con-video { cursor: pointer; }
.m img, .m video { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; user-select: none; }
.m img { opacity: 0; transition: opacity .3s; }
.m.lista img { opacity: 1; }
.m video { opacity: 0; transition: opacity .25s; }
.m.rodando video { opacity: 1; }
.aviso {
  position: absolute; left: 50%; top: 50%; width: 76px; height: 76px; margin: -38px 0 0 -38px; border-radius: 50%;
  background: rgba(27,10,17,.86); opacity: 0; transform: scale(.85); transition: opacity .2s, transform .2s; pointer-events: none;
}
.aviso::after { content: ""; position: absolute; left: 30px; top: 23px; border-style: solid; border-width: 15px 0 15px 24px; border-color: transparent transparent transparent var(--acento); }
.m.en-pausa .aviso { opacity: 1; transform: none; }

/* ---------------------------------- mandos de vídeo: fuera de la imagen, para no tapar caras */
#mando {
  position: fixed; left: 0; top: 0; z-index: 32; display: flex; align-items: center; gap: 6px;
  width: min(420px, 92vw); height: 44px; padding: 0 8px;
  background: var(--superficie); border-radius: 22px; box-shadow: 0 0 0 1px rgba(221,181,126,.16);
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
#mando.ver { opacity: 1; pointer-events: auto; }
#mando button { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; transition: background .15s; }
#mando button:hover { background: rgba(221,181,126,.1); }
#mando svg { width: 22px; height: 22px; fill: var(--acento); }
#mando .i-play, #mando.parado .i-pausa, #mando .i-off, #mando.mudo .i-on { display: none; }
#mando.parado .i-play, #mando.mudo .i-off { display: inline; }
#m-barra { flex: 1; height: 24px; position: relative; cursor: pointer; touch-action: none; }
#m-barra::before { content: ""; position: absolute; left: 0; right: 0; top: 10.5px; height: 3px; border-radius: 2px; background: rgba(221,181,126,.18); }
#m-barra i { position: absolute; left: 0; right: 0; top: 10.5px; height: 3px; border-radius: 2px; background: var(--acento); transform: scaleX(0); transform-origin: 0 50%; }
#m-tiempo { flex: none; min-width: 34px; font-size: 14px; color: var(--acento); font-variant-numeric: tabular-nums; text-align: right; }

/* ---------------------------------- primer recuerdo: el título */
#entrada {
  position: fixed; z-index: 90; left: var(--margen); top: 0; bottom: 0; width: 30vw;
  display: flex; flex-direction: column; justify-content: flex-end; padding-bottom: max(32px, 6vh); pointer-events: none;
  opacity: 0;
}
#entrada h1 { font-size: clamp(30px, 3.5vw, 58px); line-height: 1.04; font-weight: 500; letter-spacing: -.025em; }
#entrada h1 span { display: block; opacity: 0; transform: translateY(14px); }
#entrada.ver h1 span { animation: subir .7s .55s cubic-bezier(.2,.7,.2,1) forwards; }
#entrada.ver h1 span + span { animation-delay: .72s; }
#baja { display: block; width: 1px; height: 38px; margin-top: 18px; background: var(--acento); transform-origin: 50% 0; opacity: 0; }
#entrada.ver #baja { animation: baja 2.2s 1.5s ease-in-out infinite; }
@keyframes subir { to { opacity: 1; transform: none; } }
@keyframes baja { 0% { opacity: 1; transform: scaleY(0); } 55% { opacity: 1; transform: scaleY(1); } 100% { opacity: 0; transform: scaleY(1) translateY(10px); } }
#avance { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; height: 2px; background: var(--acento); transform: scaleX(0); transform-origin: 0 50%; }

/* ---------------------------------- la lupa */
#lupa { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 2.5vh 3vw; background: rgba(27,10,17,.97); cursor: zoom-out; opacity: 0; transition: opacity .22s; }
#lupa.ver { opacity: 1; }
#lupa[hidden] { display: none; }
#lupa img { max-width: 100%; max-height: 95vh; display: block; transform: scale(.975); transition: transform .3s cubic-bezier(.2,.7,.2,1); }
#lupa.ver img { transform: none; }

/* ---------------------------------- el muro */
.mini { position: absolute; display: block; object-fit: cover; visibility: hidden; opacity: 0; z-index: 8; border-radius: 1px; }

/* ---------------------------------- el regalo */
#regalo { position: fixed; inset: 0; z-index: 80; background: var(--fondo); overflow: hidden; touch-action: none; user-select: none; }
.paquete { position: absolute; perspective: 1500px; transform-style: preserve-3d; filter: drop-shadow(0 24px 34px rgba(0,0,0,.6)); }
.forro { position: absolute; inset: 1.5px; background: #3D0E1C; }
.dentro { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; }
.dentro.libre { position: fixed; inset: auto; z-index: 3; }
.solapa { position: absolute; inset: 0; transform-style: preserve-3d; }
.solapa i, .solapa b { position: absolute; inset: 0; display: block; backface-visibility: hidden; }
.solapa i { background: var(--papel); }
.solapa b { background: #3D0E1C; transform: rotateY(180deg); }
.solapa.der b, .solapa.izq b { transform: rotateY(180deg); }
.solapa.arr b, .solapa.aba b { transform: rotateX(180deg); }
.solapa.arr i, .solapa.arr b { clip-path: polygon(0 0, 100% 0, 50% 52%); }
.solapa.arr b { clip-path: polygon(0 100%, 100% 100%, 50% 48%); }
.solapa.aba i { clip-path: polygon(0 100%, 100% 100%, 50% 48%); }
.solapa.aba b { clip-path: polygon(0 0, 100% 0, 50% 52%); }
.solapa.izq i { clip-path: polygon(0 0, 0 100%, 54% 50%); }
.solapa.izq b { clip-path: polygon(100% 0, 100% 100%, 46% 50%); }
.solapa.der i { clip-path: polygon(100% 0, 100% 100%, 46% 50%); }
.solapa.der b { clip-path: polygon(0 0, 0 100%, 54% 50%); }
.solapa.arr { transform-origin: 50% 0; z-index: 4; }
.solapa.arr i { background: linear-gradient(#85233D, #6F1B32); }
.solapa.aba { transform-origin: 50% 100%; z-index: 3; }
.solapa.aba i { background: linear-gradient(#5E162A, #6A1A30); }
.solapa.izq { transform-origin: 0 50%; z-index: 2; }
.solapa.izq i { background: linear-gradient(90deg, #7A1E36, #631729); }
.solapa.der { transform-origin: 100% 50%; z-index: 2; }
.solapa.der i { background: linear-gradient(270deg, #7A1E36, #631729); }
#cinta { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; overflow: visible; pointer-events: none; }
#cinta.a-mano { cursor: grab; }
#regalo:has(#cinta.a-mano) { cursor: grab; }
#regalo:has(#cinta.agarrando) { cursor: grabbing; }
.cinta { stroke: var(--acento); fill: none; stroke-linecap: butt; }
.cola { stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 3px 3px rgba(40,10,20,.28)); }
.cinta-luz { stroke: rgba(255,255,255,.3); fill: none; stroke-linecap: round; }
.ala { fill: var(--acento); stroke: #B58B52; stroke-width: 1.5; }
.punta { stroke: var(--acento); fill: none; stroke-linecap: round; }
.nudo { fill: #B58B52; }
.etq-papel { fill: #F6ECDD; stroke: rgba(221,181,126,.32); stroke-width: 1; filter: drop-shadow(0 4px 6px rgba(40,10,20,.2)); }
.etq-ojo { fill: var(--burdeos-o); }
.etq-txt { font-family: var(--texto); font-weight: 500; fill: var(--burdeos-o); text-anchor: middle; letter-spacing: -.01em; }
#pista { position: absolute; left: calc(50% + 11vh); bottom: 9vh; z-index: 3; color: var(--acento); font-size: 19px; font-weight: 500; opacity: 0; transition: opacity .5s; pointer-events: none; }
#pista.ver { opacity: 1; }
#pista.insiste { animation: insiste .5s; }
@keyframes insiste { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.chispa-foto { position: absolute; z-index: 1; object-fit: cover; pointer-events: none; box-shadow: 0 8px 20px -8px rgba(40,10,20,.4); }

/* ---------------------------------- pantallas verticales */
/* ---------------------------------- pase automático */
#auto {
  position: fixed; z-index: 36; left: max(14px, 1.2vw); bottom: 10px; display: flex; gap: 2px; padding: 3px;
  background: rgba(45,17,28,.88); border-radius: 22px; opacity: 0; pointer-events: none; transition: opacity .3s;
}
#auto.ver { opacity: .75; pointer-events: auto; }
#auto.ver:hover, #auto.ver:focus-within, #auto.parado.ver { opacity: 1; }
#auto button { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; transition: background .15s; }
#auto button:hover { background: rgba(221,181,126,.18); }
#auto svg { width: 20px; height: 20px; fill: var(--tinta); }
#auto .i-play, #auto.parado .i-pausa { display: none; }
#auto.parado .i-play { display: inline; }

/* ---------------------------------- las letras ganadas */
#bandeja { position: fixed; z-index: 72; right: max(14px, 1.2vw); bottom: 12px; display: flex; gap: 5px; opacity: 0; transition: opacity .5s; pointer-events: none; }
#bandeja.ver { opacity: 1; }
#bandeja.fuera { opacity: 0; }
.ficha { width: 30px; height: 38px; display: grid; place-items: center; border-radius: 4px; background: var(--oro); color: #2A0E18; font-size: 21px; font-weight: 600; }
.ficha.vacia { background: rgba(45,17,28,.88); box-shadow: inset 0 0 0 1px rgba(224,182,94,.5); }

/* ---------------------------------- los juegos */
#juego { position: fixed; inset: 0; z-index: 65; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2.2vh; background: rgba(22,7,13,.93); opacity: 0; transition: opacity .3s; overflow: hidden; }
#juego.ver { opacity: 1; }
#juego[hidden] { display: none; }
.j-titulo { font-size: clamp(22px, 2.4vw, 36px); font-weight: 500; letter-spacing: -.015em; text-align: center; transition: opacity .25s; z-index: 2; }
.premio { position: absolute; left: 50%; top: 50%; width: 26vh; height: 32vh; display: grid; place-items: center; border-radius: 16px; background: var(--oro); color: #2A0E18; font-size: 21vh; font-weight: 600; line-height: 1; box-shadow: 0 0 120px rgba(224,182,94,.5); z-index: 4; }
.j-boton { padding: 12px 36px; border-radius: 26px; background: var(--acento); color: #2A0E18; font-size: 20px; font-weight: 500; transition: opacity .2s, transform .15s; }
.j-boton:hover { transform: scale(1.04); }
.j-boton:disabled { opacity: .4; }

.j-parejas { display: grid; grid-template-columns: repeat(4, auto); gap: 1.4vh; }
.carta-j { width: 17vh; height: 25vh; perspective: 700px; }
.giro-j { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .38s cubic-bezier(.3,.7,.3,1); }
.carta-j.dada .giro-j { transform: rotateY(180deg); }
.lomo, .cara { position: absolute; inset: 0; width: 100%; height: 100%; backface-visibility: hidden; border-radius: 8px; }
.lomo { background: var(--burdeos); box-shadow: inset 0 0 0 1px rgba(224,182,94,.45); transition: background .15s; }
.carta-j:hover .lomo { background: #8F2843; }
.lomo::after { content: ""; position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px; border-radius: 50%; background: var(--oro); }
.cara { object-fit: cover; transform: rotateY(180deg); }

.j-campo { position: relative; width: min(1000px, 88vw); height: 74vh; overflow: hidden; border-radius: 14px; background: var(--superficie); cursor: none; touch-action: none; }
.j-puntos { display: flex; gap: 8px; }
.j-puntos i { width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--oro); transition: background .15s; }
.j-puntos i.hecho { background: var(--oro); }
.plato { position: absolute; left: 0; top: 0; width: 140px; height: 26px; border-radius: 50%; background: radial-gradient(closest-side, #F6ECDD 62%, #BFB6AA 66%, #F6ECDD 100%); box-shadow: 0 8px 14px rgba(0,0,0,.5); }
.tarta-j { position: absolute; left: 0; top: 0; width: 84px; height: 84px; border-radius: 50%; background: url(../media/25.webp) -96px -142px / 180px auto; box-shadow: 0 6px 12px rgba(0,0,0,.45); }

.j-planta { display: flex; align-items: center; gap: 4vw; }
.planta-foto { height: 76vh; width: auto; display: block; border-radius: 6px; }
.botonera { display: grid; grid-template-columns: repeat(2, 72px); gap: 14px; padding: 22px; border-radius: 14px; background: var(--superficie); }
.piso { width: 72px; height: 72px; border-radius: 50%; font-size: 24px; font-weight: 500; box-shadow: inset 0 0 0 2px rgba(239,232,223,.4); transition: background .15s, color .15s, opacity .15s; }
.piso:hover { background: rgba(221,181,126,.25); }
.piso:disabled { opacity: .25; cursor: default; }
.piso.bien { background: var(--oro); color: #2A0E18; box-shadow: none; }

.j-ruleta { display: flex; flex-direction: column; align-items: center; gap: 2.4vh; }
.rueda { width: 66vh; height: 66vh; max-width: 80vw; font-family: var(--texto); font-weight: 500; }

.j-puzzle { position: relative; border-radius: 4px; overflow: hidden; }
.pieza { position: absolute; left: 0; top: 0; width: 33.3334%; height: 33.3334%; box-shadow: inset 0 0 0 .5px rgba(0,0,0,.5); transition: transform .28s cubic-bezier(.3,.7,.2,1), filter .15s; }
.pieza:hover { filter: brightness(1.14); }
.pieza.sel { box-shadow: inset 0 0 0 4px var(--oro); z-index: 2; }
.j-puzzle.hecho .pieza { box-shadow: none; }


@media (max-aspect-ratio: 11/10) {
  #entrada { width: auto; right: var(--margen); bottom: auto; justify-content: flex-start; padding: max(28px, 6vh) 0 0; }
  #entrada h1 { font-size: clamp(30px, 8.6vw, 60px); }
  #palabra { left: 6vw; top: 12%; }
  #torre { left: 50%; }
  .j-parejas { grid-template-columns: repeat(3, auto); }
  .carta-j { width: 26vw; height: 17vh; }
}
@media (prefers-reduced-motion: reduce) {
  .m img, .m video, #mando, #entrada.ver h1 span, #entrada.ver #baja { transition: none; animation: none; }
  #entrada.ver h1 span { opacity: 1; transform: none; }
}

/* La foto del ascensor, al derecho, con su pantalla ampliada */
.planta-foto, .planta-zoom img { transform: scaleX(-1); }
.planta-lado { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.planta-zoom { position: relative; width: 196px; height: 170px; overflow: hidden; border-radius: 10px; background: var(--superficie); }
.planta-zoom img { position: absolute; width: 900px; height: 1200px; max-width: none; left: -6px; top: -340px; }

/* ---------------------------------- el final */
#final { position: fixed; inset: 0; z-index: 70; opacity: 0; visibility: hidden; overflow: hidden; color: var(--tinta); }
#velo { position: absolute; inset: 0; background: radial-gradient(circle at 50% 46%, rgba(62,18,33,.93), rgba(15,5,9,.98) 72%); opacity: 0; transition: opacity 1s; }
#velo.ver { opacity: 1; }
#cielo { position: absolute; inset: 0; width: 100%; height: 100%; display: block; visibility: hidden; background: linear-gradient(#15103a 0%, #77295f 48%, #f07a4b 62%, #ffc98a 66%, #8c3f55 78%, #4a1a3a 100%); }
#torre { position: absolute; z-index: 1; left: 71%; bottom: 25%; width: 58vh; height: 72vh; transform-origin: 50% 100%; opacity: 0; visibility: hidden; filter: blur(.3px); -webkit-mask-image: linear-gradient(to top, transparent 0, #000 7%); mask-image: linear-gradient(to top, transparent 0, #000 7%); }
#torre svg { display: block; width: 100%; height: 100%; }
.brillo { fill: #FFE1A6; animation: parpadeo 2.6s ease-in-out infinite; }
@keyframes parpadeo { 0%, 100% { opacity: .15; } 50% { opacity: 1; } }

#palabra { position: absolute; z-index: 2; left: 8vw; top: 26%; opacity: 1; pointer-events: none; }
.letras { position: relative; display: flex; font-size: clamp(90px, 13.5vw, 250px); font-weight: 500; letter-spacing: -.035em; line-height: 1; }
.letra { display: block; opacity: 0; color: #FFF6E8; text-shadow: 0 4px 44px rgba(90,20,40,.55); will-change: transform, opacity; transition: color .5s, text-shadow .5s; }
.letra.oro { color: #FFE5B4; text-shadow: 0 0 34px rgba(255,190,110,.75), 0 4px 40px rgba(90,20,40,.5); }
.nos { margin: .5em 0 0 .3em; font-size: clamp(24px, 2.7vw, 44px); font-weight: 500; letter-spacing: -.015em; opacity: 0; color: #FFF6E8; text-shadow: 0 2px 22px rgba(80,20,40,.6); }

#foto { position: absolute; inset: 0; z-index: 3; opacity: 0; visibility: hidden; overflow: hidden; }
#foto img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
#foto::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 26%; background: linear-gradient(to top, rgba(14,4,8,.62), rgba(14,4,8,0)); }
.dedica { position: absolute; z-index: 1; left: var(--margen); bottom: max(26px, 4.6vh); font-size: clamp(26px, 3vw, 48px); font-weight: 500; letter-spacing: -.02em; opacity: 0; }
.otra { position: absolute; z-index: 3; right: var(--margen); bottom: max(28px, 5vh); color: var(--tinta); font-size: 16px; text-decoration: underline; text-underline-offset: .22em; text-decoration-thickness: 1px; opacity: 0; visibility: hidden; }

#luces { position: absolute; inset: 0; z-index: 4; width: 100%; height: 100%; display: block; pointer-events: none; }
#destello { position: absolute; inset: 0; z-index: 6; background: #FFF4E2; opacity: 0; pointer-events: none; }
.sigue { position: absolute; z-index: 5; left: 50%; bottom: 3.5vh; width: 1.5px; height: 44px; background: #FFF6E8; opacity: 0; animation: latido 1.8s ease-in-out infinite; transform-origin: 50% 0; }
@keyframes latido { 0%, 100% { transform: scaleY(.45); } 50% { transform: scaleY(1); } }

@keyframes flota { 0%, 100% { translate: 0 0; } 50% { translate: 0 -9px; } }
#abrir { padding: 15px 58px; border-radius: 32px; background: linear-gradient(#EFCF97, #D4A869); color: #3A1420; font-size: 23px; font-weight: 600; letter-spacing: -.005em; box-shadow: 0 12px 34px -8px rgba(232,180,110,.6); opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .45s, transform .45s, box-shadow .2s; }
#abrir.ver { opacity: 1; transform: none; pointer-events: auto; animation: llama 2.2s ease-in-out infinite; }
#abrir:hover { transform: translateY(-2px) scale(1.03); }
@keyframes llama { 0%, 100% { box-shadow: 0 12px 34px -8px rgba(232,180,110,.5); } 50% { box-shadow: 0 12px 54px -2px rgba(240,190,120,.95); } }

#palabra { top: 19%; }
.nos { margin-top: .32em; text-shadow: 0 2px 14px rgba(60,12,30,.85); }

/* ---------------------------------- el último regalo */
#caja-final { position: absolute; inset: 0; z-index: 5; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 7vh; perspective: 1500px; }
#caja-final.ver { display: flex; }
.balanceo { --c: min(40vh, 34vw); --h: calc(var(--c) * .68); --l: calc(var(--c) * 1.07); --tl: calc(var(--c) * .2); position: relative; width: var(--c); height: var(--h); margin-top: 12vh; transform-style: preserve-3d; }
.balanceo.flota { animation: flota 3.6s ease-in-out infinite; }
#cubo { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateX(-24deg) rotateY(-32deg); cursor: pointer; }
.cara { position: absolute; inset: 0; backface-visibility: hidden; }
.c-f { background: linear-gradient(90deg, transparent 43%, #E3BE88 43%, #F1D6A8 50%, #D4AB70 57%, transparent 57%), linear-gradient(#8A2540, #6E1A30); transform: translateZ(calc(var(--c) / 2)); }
.c-d { background: linear-gradient(90deg, transparent 43%, #C79D62 43%, #DDB57E 50%, #B98F55 57%, transparent 57%), linear-gradient(#6B1A2F, #4F1223); transform: rotateY(90deg) translateZ(calc(var(--c) / 2)); }
.c-i { background: linear-gradient(#6B1A2F, #4F1223); transform: rotateY(-90deg) translateZ(calc(var(--c) / 2)); }
.c-t { background: #3D0E1C; transform: rotateY(180deg) translateZ(calc(var(--c) / 2)); }
.c-boca { position: absolute; left: 0; top: calc((var(--h) - var(--c)) / 2); width: var(--c); height: var(--c); background: #2A0A14; transform: rotateX(90deg) translateZ(calc(var(--h) / 2)); transition: background .35s, box-shadow .35s; }
.c-boca.luz { background: #FFF4DC; box-shadow: 0 0 120px 60px rgba(255,220,160,.85); }
.tapa { position: absolute; left: 50%; top: 0; width: 0; height: 0; transform-style: preserve-3d; }
.t-cara { position: absolute; left: 0; top: 0; width: var(--l); height: var(--tl); backface-visibility: hidden; }
.t-f { background: linear-gradient(90deg, transparent 43%, #EFCF97 43%, #F7E2BC 50%, #DDB57E 57%, transparent 57%), linear-gradient(#9B2C49, #7E2039); transform: translate(-50%, -50%) translateZ(calc(var(--l) / 2)); }
.t-d { background: linear-gradient(90deg, transparent 43%, #CFA66B 43%, #E3BE88 50%, #C0965B 57%, transparent 57%), linear-gradient(#7A1E36, #5E162A); transform: translate(-50%, -50%) rotateY(90deg) translateZ(calc(var(--l) / 2)); }
.t-i { background: linear-gradient(#7A1E36, #5E162A); transform: translate(-50%, -50%) rotateY(-90deg) translateZ(calc(var(--l) / 2)); }
.t-t { background: #4F1223; transform: translate(-50%, -50%) rotateY(180deg) translateZ(calc(var(--l) / 2)); }
.t-arriba { position: absolute; left: 0; top: 0; width: var(--l); height: var(--l); transform: translate(-50%, -50%) rotateX(90deg) translateZ(calc(var(--tl) / 2));
  background: linear-gradient(90deg, transparent 43%, #E3BE88 43%, #F4DCB1 50%, #D4AB70 57%, transparent 57%), linear-gradient(transparent 43%, #E3BE88 43%, #F4DCB1 50%, #D4AB70 57%, transparent 57%), linear-gradient(135deg, #A63252, #85233D); }
.c-lazo { position: absolute; left: 0; top: 0; width: calc(var(--c) * .86); transform: translate(-50%, -72%) translateY(calc(var(--tl) * -.5)) rotateY(32deg) rotateX(24deg); }
.c-lazo svg { display: block; width: 100%; overflow: visible; filter: drop-shadow(0 8px 8px rgba(30,6,14,.4)); }
.l1, .l2 { fill: #E3BE88; stroke: #B58B52; stroke-width: 2.5; transform-origin: 150px 92px; }
.l-nudo { fill: #C79D62; }
#rayos { position: absolute; left: 50%; top: 46%; width: 190vmax; height: 190vmax; border-radius: 50%; opacity: 0; pointer-events: none; transform: translate(-50%, -50%);
  background: repeating-conic-gradient(rgba(255,226,170,.5) 0 5deg, rgba(255,226,170,0) 9deg 21deg, rgba(255,226,170,.3) 24deg 26deg, rgba(255,226,170,0) 29deg 40deg);
  -webkit-mask-image: radial-gradient(closest-side, #000 0, rgba(0,0,0,.65) 22%, transparent 66%); mask-image: radial-gradient(closest-side, #000 0, rgba(0,0,0,.65) 22%, transparent 66%); }

/* El avión */
#avion { position: absolute; z-index: 4; left: 0; top: 0; width: 22vw; aspect-ratio: 200 / 70; visibility: hidden; transform-origin: 95% 50%; overflow: visible; filter: drop-shadow(0 10px 16px rgba(50,10,30,.4)); will-change: transform; pointer-events: none; }

/* La torre */
.brillo { opacity: .15; animation: parpadeo 2.8s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
#torre.chispea .brillo { animation-name: chispeo; animation-duration: .85s; }
@keyframes chispeo { 0%, 100% { opacity: .1; transform: scale(.6); } 45% { opacity: 1; transform: scale(1.5); } }
.bruma { position: absolute; left: -24%; right: -24%; bottom: -5%; height: 19%; border-radius: 50%; background: radial-gradient(closest-side, rgba(218,130,132,.9), rgba(214,120,128,0)); animation: bruma 11s ease-in-out infinite alternate; }
.bruma.b2 { bottom: 3%; left: -8%; right: -36%; height: 11%; opacity: .75; animation-duration: 15s; animation-direction: alternate-reverse; }
@keyframes bruma { from { transform: translateX(-7%); } to { transform: translateX(7%); } }

/* Ajustes: la bruma no se recorta con la torre, y el regalo deja sitio al botón */
#torre { -webkit-mask-image: none; mask-image: none; }
#torre svg { -webkit-mask-image: linear-gradient(to top, transparent 0, #000 9%); mask-image: linear-gradient(to top, transparent 0, #000 9%); }
.balanceo { margin-top: 6vh; margin-bottom: 15vh; }
#caja-final { gap: 0; }
@keyframes chispeo { 0%, 100% { opacity: .1; transform: scale(.7); } 45% { opacity: 1; transform: scale(1.35); } }

/* La pista que acompaña a cada letra */
.premio { top: 42%; }
.pista { position: absolute; left: 50%; top: 66%; z-index: 4; width: min(780px, 88vw); text-align: center; opacity: 0; transform: translateX(-50%); }
.pista b { display: block; color: var(--oro); font-size: clamp(30px, 3.6vw, 56px); font-weight: 500; letter-spacing: -.02em; line-height: 1.1; }
.pista span { display: block; margin-top: .45em; font-size: clamp(21px, 2.1vw, 32px); line-height: 1.2; }
.ficha.volando { position: absolute; z-index: 8; pointer-events: none; }
#juego.solo-premio { background: rgba(22,7,13,.98); transition: background .3s, opacity .3s; }

/* Sin textos ni mandos */
.j-boton.parar { width: 76px; height: 76px; padding: 0; border-radius: 50%; display: grid; place-items: center; }
.j-boton.parar::after { content: ""; width: 24px; height: 24px; border-radius: 4px; background: #2A0E18; }
.premio { top: 50%; }
.otra { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: rgba(27,10,17,.65); text-decoration: none; }
.otra svg { width: 24px; height: 24px; fill: var(--tinta); }
.m.con-video { cursor: default; }

/* Sin rueda: flechas grandes junto a las fotos, y la pausa abajo */
#auto, #auto.ver { position: static; display: block; translate: none; padding: 0; background: none; box-shadow: none; opacity: 1; pointer-events: auto; }
#auto button { position: fixed; z-index: 73; display: grid; place-items: center; border-radius: 50%; opacity: 0; pointer-events: none; transition: opacity .3s, background .15s, transform .15s; }
#auto.ver button { opacity: 1; pointer-events: auto; }
#a-ant, #a-sig { top: 50%; width: 64px; height: 64px; margin-top: -32px; background: rgba(45,17,28,.9); box-shadow: 0 0 0 1px rgba(221,181,126,.55), 0 8px 22px rgba(0,0,0,.45); }
#a-ant { left: 18px; }
#a-sig { right: 18px; }
#auto #a-ant:hover, #auto #a-sig:hover { background: #5A1A2E; transform: scale(1.07); }
#a-ant svg, #a-sig svg { width: 30px; height: 30px; fill: var(--oro); }
#a-play { left: 50%; bottom: 12px; width: 42px; height: 42px; margin-left: -21px; background: rgba(45,17,28,.9); box-shadow: 0 0 0 1px rgba(221,181,126,.4); }
#a-play svg { width: 22px; height: 22px; fill: var(--oro); }
html.cerrado #auto { display: none; }
#auto #a-ant, #auto #a-sig { width: 64px; height: 64px; }
#auto #a-play { width: 42px; height: 42px; }
#auto #a-ant svg, #auto #a-sig svg { width: 30px; height: 30px; fill: var(--oro); }

/* Pistas visuales, en lugar de letras */
.ficha { width: 42px; height: 42px; border-radius: 50%; }
.ficha svg { width: 25px; height: 25px; fill: #2A0E18; }
.ficha svg .h { fill: none; stroke: var(--oro); stroke-width: 2.5; }
.ficha svg circle.h { fill: var(--oro); stroke: none; }
.ficha svg .p { fill: #2A0E18; }
.ficha.volando { position: absolute; z-index: 8; pointer-events: none; }
.premio { width: 30vh; height: 30vh; border-radius: 50%; top: 50%; }
.premio svg { width: 60%; height: 60%; fill: #2A0E18; }
.premio svg .h { fill: none; stroke: var(--oro); stroke-width: 2.5; }
.premio svg circle.h { fill: var(--oro); stroke: none; }
.premio svg .p { fill: #2A0E18; }
.j-parejas { grid-template-columns: repeat(4, auto); gap: 1.8vh; }
.carta-j { width: 21vh; height: 30vh; }
.pieza { width: 50%; height: 33.3334%; }

/* En tierra */
#viaje { position: absolute; inset: 0; z-index: 1; visibility: hidden; overflow: hidden; }
#viaje svg { display: block; width: 100%; height: 100%; }
.vj-luz { fill: #FFD79A; animation: parpadeo 1.6s ease-in-out infinite; }

/* Las tarjetas de embarque */
#pases { position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center; gap: 3vw; visibility: hidden; perspective: 1200px; pointer-events: none; }
.pase { display: flex; flex-direction: column; width: min(40vw, 72vh); aspect-ratio: 1.52; border-radius: 22px; overflow: hidden; background: #FFF9EE; color: #2A0E18; box-shadow: 0 34px 70px -14px rgba(50,10,30,.7), 0 0 0 1px rgba(255,255,255,.3); will-change: transform; }
.p-franja { flex: none; height: 16%; display: flex; align-items: center; padding: 0 5%; background: #7A1E36; }
.p-franja svg { width: 8%; aspect-ratio: 1; fill: var(--oro); }
.p-cuerpo { flex: 1; display: flex; flex-direction: column; justify-content: space-between; padding: 3.8% 5% 4.2%; }
.p-dato > span { display: block; color: #8A6A5C; font-size: clamp(11px, 1.05vw, 17px); font-weight: 500; letter-spacing: .02em; }
.p-dato b { display: block; font-size: clamp(18px, 2.25vw, 36px); font-weight: 600; letter-spacing: -.01em; line-height: 1.15; }
.p-letras { display: flex; gap: 1.2%; margin-top: 1%; perspective: 500px; }
.p-letra { position: relative; display: grid; place-items: center; width: 15%; aspect-ratio: .86; border-radius: 7px; background: #2A0E18; color: #F6ECDD; font-size: clamp(26px, 3.5vw, 58px); font-weight: 600; line-height: 1; overflow: hidden; }
.p-letra::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1.5px; background: rgba(0,0,0,.55); }
.p-letra.fija { color: var(--oro); }
#pases.revelado .p-letra.fija { background: #7A1E36; color: #FFE5B4; box-shadow: 0 0 22px rgba(255,190,110,.75); transition: background .4s, box-shadow .4s; }
.p-pie { display: flex; align-items: flex-end; justify-content: space-between; }
.p-codigo { display: block; width: 38%; height: clamp(26px, 3vw, 46px); background: repeating-linear-gradient(90deg, #2A0E18 0 3px, transparent 3px 6px, #2A0E18 6px 7px, transparent 7px 12px, #2A0E18 12px 16px, transparent 16px 19px); }

/* PARÍS ocupa todo el ancho de la tarjeta */
.pase { aspect-ratio: 1.42; }
.p-franja { height: 12%; }
.p-cuerpo { padding: 2.8% 4.5% 3.4%; gap: 1.5%; }
.p-dest { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.p-letras { flex: 1; width: 100%; gap: 1.6%; margin-top: 1%; min-height: 0; }
.p-letra { flex: 1 1 0; width: auto; aspect-ratio: auto; border-radius: 10px; font-size: min(7.4vw, 12.5vh); }
.p-dato b { font-size: clamp(16px, 1.9vw, 30px); }
.p-codigo { height: clamp(20px, 2.3vw, 36px); }

/* ---------------------------------- el primer regalo: el sobre */
#c-sobre { position: absolute; inset: 0; z-index: 6; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 5vh; }
#c-sobre.ver { display: flex; }
#sobre { --w: min(70vh, 56vw); position: relative; width: var(--w); height: calc(var(--w) * .64); perspective: 1300px; cursor: pointer; transform-style: preserve-3d; }
#sobre.flota { animation: flota 3.6s ease-in-out infinite; }
.s-luz { position: absolute; inset: -34%; background: radial-gradient(closest-side, rgba(255,214,150,.75), rgba(255,180,110,.18) 55%, rgba(255,170,100,0)); opacity: .25; pointer-events: none; }
.s-fondo { position: absolute; inset: 0; border-radius: 7px; background: #4A0F20; box-shadow: 0 40px 70px -18px rgba(0,0,0,.72); }
.s-carta { position: absolute; left: 4%; right: 4%; top: 5%; bottom: 5%; z-index: 1; border-radius: 4px; background: linear-gradient(#FFFAF0, #F8E7CB); box-shadow: 0 0 60px rgba(255,220,160,.7); }
.s-frente { position: absolute; inset: 0; z-index: 2; border-radius: 7px; background: linear-gradient(#6E1A31, #7C2038); clip-path: polygon(0 0, 50% 58%, 100% 0, 100% 100%, 0 100%); }
.s-frente::after { content: ""; position: absolute; inset: 0; background: linear-gradient(#8B2740, #7A1E36); clip-path: polygon(0 100%, 50% 50%, 100% 100%); }
.s-solapa { position: absolute; left: 0; right: 0; top: 0; height: 60%; z-index: 3; transform-origin: 50% 0; transform-style: preserve-3d; filter: drop-shadow(0 3px 5px rgba(20,4,10,.45)); }
.s-solapa i, .s-solapa b { position: absolute; inset: 0; clip-path: polygon(0 0, 100% 0, 50% 100%); backface-visibility: hidden; }
.s-solapa i { background: linear-gradient(#8C2840, #6C1B30); }
.s-solapa b { background: linear-gradient(#3A0C1A, #5A1427); transform: rotateX(180deg); }
.s-sello { position: absolute; z-index: 4; left: 50%; top: 60%; width: calc(var(--w) * .16); aspect-ratio: 1; transform: translate(-50%, -50%); opacity: 0; filter: drop-shadow(0 7px 10px rgba(0,0,0,.5)); }
.s-sello.ver { opacity: 1; }
.s-sello span { position: absolute; inset: 0; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 36% 30%, #F4D79E, #D2A566 52%, #A97B3F 100%); box-shadow: inset 0 0 0 3px rgba(120,80,30,.35); }
.s-sello span::after { content: ""; width: 42%; aspect-ratio: 1; background: #7A5322; clip-path: path("M0 0"); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21S3 14.600 3 8.600A5 5 0 0 1 12 6a5 5 0 0 1 9 2.600C21 14.600 12 21 12 21z'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21S3 14.600 3 8.600A5 5 0 0 1 12 6a5 5 0 0 1 9 2.600C21 14.600 12 21 12 21z'/%3E%3C/svg%3E") center / contain no-repeat; clip-path: none; }
.m1 { clip-path: polygon(0 0, 54% 0, 44% 32%, 58% 60%, 46% 100%, 0 100%); }
.m2 { clip-path: polygon(54% 0, 100% 0, 100% 100%, 46% 100%, 58% 60%, 44% 32%); }
#c-abrir { padding: 15px 58px; border-radius: 32px; background: linear-gradient(#EFCF97, #D4A869); color: #3A1420; font-size: 23px; font-weight: 600; opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .45s, transform .45s; }
#c-abrir.ver { opacity: 1; transform: none; pointer-events: auto; animation: llama 2.2s ease-in-out infinite; }
#c-abrir:hover { transform: translateY(-2px) scale(1.03); }

/* ---------------------------------- la carta */
#lectura { position: absolute; inset: 0; z-index: 7; visibility: hidden; opacity: 0; transition: opacity .7s; }
#lectura.ver { visibility: visible; opacity: 1; }
#lectura.fuera { opacity: 0; transition: none; visibility: hidden; }
.hoja { --h: 78vh; position: absolute; left: 50%; top: 7vh; width: min(46vw, 660px); height: var(--h); margin-left: calc(min(46vw, 660px) / -2); overflow: hidden; border-radius: 6px; background: #FFF9EE; box-shadow: 0 34px 80px -20px rgba(0,0,0,.75), 0 0 0 1px rgba(255,255,255,.2); }
#lectura.doblando .hoja { top: 50%; left: 50%; margin: 0; translate: -50% -50%; }
#lectura.doblando .h-texto, #lectura.doblando .h-velo { opacity: .35; transition: opacity .6s; }
.h-texto { position: absolute; left: 0; right: 0; top: 0; padding: 0 8.5%; transition: transform .85s cubic-bezier(.4,0,.2,1); }
.h-p { margin: 0 0 1.5em; font-family: "Newsreader", Georgia, "Times New Roman", serif; font-size: clamp(19px, min(1.72vw, 3vh), 27px); line-height: 1.5; color: #2F121C; opacity: .14; transition: opacity .7s; }
.h-p.activo { opacity: 1; }
.h-velo { position: absolute; left: 0; right: 0; height: 16%; z-index: 1; pointer-events: none; }
.h-velo.ar { top: 0; background: linear-gradient(#FFF9EE, rgba(255,249,238,0)); }
.h-velo.ab { bottom: 0; background: linear-gradient(rgba(255,249,238,0), #FFF9EE); }

.h-foto { position: absolute; top: var(--alto); margin: 0; width: calc((100vw - min(46vw, 660px)) / 2 - 52px); max-width: 340px; padding: 9px 9px 34px; background: #FFFDF8; box-shadow: 0 22px 44px -14px rgba(0,0,0,.7); opacity: 0; pointer-events: none; transition: opacity .8s, transform 1.1s cubic-bezier(.2,.8,.2,1); }
.h-foto img { display: block; width: 100%; max-height: 56vh; object-fit: cover; }
.h-foto.izq { right: calc(50% + min(46vw, 660px) / 2 + 26px); transform: translate(-40px, -50%) rotate(calc(var(--giro) - 7deg)) scale(.95); }
.h-foto.der { left: calc(50% + min(46vw, 660px) / 2 + 26px); transform: translate(40px, -50%) rotate(calc(var(--giro) + 7deg)) scale(.95); }
.h-foto.ver { opacity: 1; transform: translate(0, -50%) rotate(var(--giro)); }
.h-foto.recoge { opacity: 0; transition: opacity .55s, transform .7s cubic-bezier(.5,0,.8,.5); }
.h-foto.izq.recoge { transform: translate(44%, -50%) rotate(12deg) scale(.5); }
.h-foto.der.recoge { transform: translate(-44%, -50%) rotate(-12deg) scale(.5); }

.h-mandos { position: absolute; left: 0; right: 0; bottom: 2.2vh; display: flex; align-items: center; justify-content: center; gap: 18px; transition: opacity .35s; }
#lectura.doblando .h-mandos { opacity: 0; pointer-events: none; }
.h-mandos button { display: grid; place-items: center; border-radius: 50%; }
#h-ant { width: 42px; height: 42px; box-shadow: inset 0 0 0 1px rgba(227,190,136,.55); opacity: 0; pointer-events: none; transition: opacity .3s; }
#h-ant.ver { opacity: 1; pointer-events: auto; }
#h-ant svg { width: 21px; height: 21px; fill: var(--oro); }
#h-sig { width: 60px; height: 60px; background: linear-gradient(#EFCF97, #D4A869); box-shadow: 0 8px 26px -6px rgba(232,180,110,.7); transition: transform .15s; }
#h-sig:hover { transform: scale(1.07); }
#h-sig svg { width: 28px; height: 28px; fill: #3A1420; }
#h-sig .i-papel { display: none; }
#h-sig.doblar .i-baja { display: none; }
#h-sig.doblar .i-papel { display: inline; }
#h-sig.doblar { animation: llama 2.2s ease-in-out infinite; }
.h-puntos { position: absolute; left: 50%; bottom: -1.5vh; translate: -50% 0; display: flex; gap: 6px; }
.h-puntos i { width: 6px; height: 6px; border-radius: 50%; background: rgba(227,190,136,.3); transition: background .4s; }
.h-puntos i.ver { background: var(--oro); }
#papel { position: absolute; inset: 0; z-index: 8; width: 100%; height: 100%; display: block; visibility: hidden; pointer-events: none; }

/* El ramo */
#bandeja { display: block; right: 14px; bottom: 6px; width: 104px; height: 140px; gap: 0; transition: opacity .6s, transform 1.3s cubic-bezier(.3,.8,.25,1); filter: drop-shadow(0 8px 12px rgba(10,2,6,.55)); }
#bandeja svg { display: block; width: 100%; height: 100%; overflow: visible; }
#bandeja.fuera { opacity: 0; }
.r-tallos path, .r-hojas path { opacity: 0; transition: opacity .6s; }
#bandeja.con-peonia .t-peonia, #bandeja.con-rosa .t-rosa, #bandeja.con-margarita .t-margarita { opacity: 1; }
.flor { transform: scale(0) rotate(-40deg); transform-box: fill-box; transform-origin: center; transition: transform .75s cubic-bezier(.3,1.5,.5,1); }
.flor.abierta { transform: none; }
.premio { background: var(--oro); }
.premio svg { width: 74%; height: 74%; }
.h-foto.izq { --alto: 43% !important; }

/* Música: discreta, abajo a la izquierda */
#sonando { position: fixed; z-index: 95; left: 12px; bottom: 10px; display: flex; align-items: center; gap: 6px; padding: 3px 12px 3px 3px; border-radius: 20px; background: rgba(27,10,17,.62); opacity: 0; pointer-events: none; transition: opacity .3s; }
#sonando.ver { opacity: .5; pointer-events: auto; }
#sonando.ver:hover, #sonando.ver:focus-within, #sonando.ver.parada { opacity: 1; }
#s-pausa { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; }
#s-pausa svg { width: 16px; height: 16px; fill: var(--oro); }
#s-pausa .i-play, #sonando.parada #s-pausa .i-pausa { display: none; }
#sonando.parada #s-pausa .i-play { display: inline; }
#s-volumen { width: 72px; height: 18px; accent-color: #E3BE88; cursor: pointer; background: none; }
