:root {
  --terracota: #b35a3c;
  --puerta: #a04d32;
  --tinta: #3d1c12;
  --crema: #faf3e8;
  --oro: #f6d9a6;
  --pino: #1f4a3a;
  --titulo: "Cormorant Garamond", Georgia, serif;
  --texto: "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  min-height: 100vh;
  background: radial-gradient(ellipse at top, #d97757 0%, var(--terracota) 55%, #964429 100%) fixed var(--terracota);
  color: var(--crema);
  font-family: var(--texto);
  font-weight: 300;
}

#nieve {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

main {
  position: relative;
  max-width: 860px;
  margin: 0 auto;
  padding: 56px 20px 40px;
}

/* Cabecera */
header { text-align: center; margin-bottom: 44px; }

.retrato {
  display: block;
  width: min(240px, 62vw);
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: top;
  margin: 0 auto 26px;
  padding: 6px;
  border: 1px solid var(--oro);
  border-radius: 999px 999px 16px 16px; /* mismo arco que las puertas */
  background: radial-gradient(circle at 50% 35%, #eba184 0%, #a84f34 55%, #6e2d1b 100%) content-box;
  box-shadow: 0 18px 40px rgba(61, 28, 18, .35);
}

.logo {
  display: block;
  width: min(210px, 56vw);
  margin: 16px auto 0;
  padding: 4px 20px;
  border-radius: 999px;
  background: #fff;
}
.logo img { display: block; width: 100%; aspect-ratio: 800 / 300; object-fit: cover; }

h1 {
  font-family: var(--titulo);
  font-weight: 500;
  font-size: clamp(2.2rem, 7vw, 3.8rem);
  line-height: 1.05;
}

.subtitulo {
  margin-top: 18px;
  color: var(--oro);
  font-size: .75rem;
  letter-spacing: .42em;
  text-transform: uppercase;
}

.estado {
  margin-top: 22px;
  min-height: 1.4em;
  font-size: .9rem;
  font-variant-numeric: tabular-nums;
  opacity: .92;
}

/* Puertas */
.calendario {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}

.puerta {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  display: grid;
  place-items: center;
  border: 1px solid rgba(250, 243, 232, .35);
  border-radius: 999px 999px 10px 10px; /* forma de arco */
  background: var(--puerta);
  color: var(--crema);
  cursor: pointer;
  transition: transform .2s, border-color .2s, box-shadow .2s, background-color .2s;
}

/* marco interior fino */
.puerta::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid currentColor;
  border-radius: 999px 999px 6px 6px;
  opacity: .12;
}

.numero {
  font-family: var(--titulo);
  font-weight: 600;
  font-size: clamp(1.6rem, 4.5vw, 2.5rem);
  font-variant-numeric: lining-nums;
}

.marca { position: absolute; bottom: 12%; font-size: .8rem; line-height: 1; }

.bloqueada { background: rgba(122, 52, 30, .38); cursor: default; }
.bloqueada .numero { opacity: .6; }

.perdida { background: transparent; border-style: dashed; border-color: rgba(250, 243, 232, .25); cursor: default; }
.perdida .numero { opacity: .3; text-decoration: line-through; }
.perdida::before { display: none; }

.disponible { background: var(--crema); border-color: var(--oro); color: var(--tinta); }
.disponible .marca::after { content: "✦"; color: var(--terracota); }

.disponible.hoy .marca::after { color: var(--oro); }
.disponible.hoy {
  background: var(--pino);
  color: var(--crema);
  animation: brillo 2.8s ease-in-out infinite;
}

.abierta { background: transparent; border-color: var(--oro); color: var(--oro); }
.abierta .marca::after { content: "✓"; }

.puerta:not(.bloqueada, .perdida):hover { transform: translateY(-4px); box-shadow: 0 10px 24px rgba(61, 28, 18, .3); }
.puerta:focus-visible { outline: 2px solid var(--oro); outline-offset: 3px; }

.temblor { animation: temblor .4s; }

@keyframes temblor {
  25% { transform: translateX(-5px); }
  50% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
}

@keyframes brillo {
  0%, 100% { box-shadow: 0 0 0 0 rgba(246, 217, 166, 0); }
  50% { box-shadow: 0 0 26px 3px rgba(246, 217, 166, .7); }
}

footer {
  margin-top: 40px;
  text-align: center;
  font-family: var(--titulo);
  font-style: italic;
  font-size: 1.1rem;
  opacity: .8;
}

/* Aviso de puerta bloqueada */
.aviso {
  position: fixed;
  left: 50%;
  bottom: 24px;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--crema);
  color: var(--tinta);
  font-size: .85rem;
  font-weight: 400;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
  transition: opacity .25s, transform .25s;
}
.aviso.visible { opacity: 1; transform: translate(-50%, 0); }

/* Ventana de cada día */
dialog {
  margin: auto;
  width: min(480px, calc(100% - 32px));
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 44px 28px 36px;
  border: 1px solid var(--oro);
  border-radius: 20px;
  background: var(--crema);
  color: var(--tinta);
  text-align: center;
}
dialog[open] { animation: aparecer .35s ease-out; }
dialog::backdrop { background: rgba(61, 28, 18, .7); backdrop-filter: blur(3px); }

@keyframes aparecer {
  from { opacity: 0; transform: translateY(14px) scale(.97); }
}

.cerrar {
  position: absolute;
  top: 10px;
  right: 14px;
  border: 0;
  background: none;
  color: inherit;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  opacity: .5;
}
.cerrar:hover { opacity: 1; }

.ventana-dia {
  color: var(--terracota);
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .3em;
  text-transform: uppercase;
}

dialog h2 {
  margin-top: 8px;
  font-family: var(--titulo);
  font-weight: 600;
  font-size: 2.2rem;
}

.ventana-contenido { display: grid; justify-items: center; gap: 18px; margin-top: 18px; }
.ventana-contenido p { line-height: 1.65; white-space: pre-line; }
.ventana-contenido .lectura { text-align: left; font-family: var(--titulo); font-weight: 500; font-size: 1.28rem; line-height: 1.55; }
.ventana-contenido img, .ventana-contenido video { max-width: 100%; border-radius: 12px; }
.ventana-contenido .vacio { font-family: var(--titulo); font-style: italic; font-size: 1.25rem; }
.ventana-contenido a {
  padding: 11px 24px;
  border-radius: 999px;
  background: var(--terracota);
  color: var(--crema);
  font-size: .9rem;
  font-weight: 400;
  text-decoration: none;
}

[hidden] { display: none !important; }

/* Entrada con correo */
.entrada { max-width: 420px; margin: 0 auto; text-align: center; }
.entrada label { display: block; margin-bottom: 14px; font-family: var(--titulo); font-size: 1.35rem; }
.entrada-fila { display: flex; flex-wrap: wrap; gap: 10px; }
.entrada input, .entrada button {
  padding: 13px 20px;
  border-radius: 999px;
  font: inherit;
  font-size: 1rem;
}
.entrada input { flex: 1 1 220px; min-width: 0; border: 1px solid var(--oro); background: var(--crema); color: var(--tinta); }
.entrada button { flex: 1 0 auto; border: 0; background: var(--pino); color: var(--crema); font-weight: 500; cursor: pointer; }
.entrada button:disabled { opacity: .6; cursor: wait; }
.entrada :focus-visible, .sesion button:focus-visible { outline: 2px solid var(--oro); outline-offset: 3px; }
.entrada-nota { margin-top: 14px; font-size: .78rem; line-height: 1.5; opacity: .85; }

.sesion { margin-top: 24px; text-align: center; font-size: .8rem; opacity: .85; overflow-wrap: anywhere; }
.sesion button { border: 0; background: none; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; }

.puerta[aria-busy="true"] { opacity: .6; cursor: wait; }

/* Billete dorado */
.puerta.dorada, .boleto {
  background: linear-gradient(115deg, #b8862f 0%, #f3d581 28%, #fff3c4 42%, #dfb04f 58%, #f6dc8e 78%, #a97a26 100%);
  background-size: 220% 100%;
  color: #4a3208;
  animation: destello 3.5s ease-in-out infinite alternate;
}
.puerta.dorada { border-color: #fff3c4; }
.puerta.dorada .marca::after { content: "★"; color: #4a3208; }
.boleto {
  margin-bottom: 26px;
  padding: 24px 18px;
  border: 2px dashed rgba(74, 50, 8, .55);
  border-radius: 14px;
  box-shadow: 0 0 34px rgba(223, 176, 79, .7);
}
.boleto-marca { font-size: .75rem; font-weight: 500; letter-spacing: .24em; text-transform: uppercase; }
.boleto-frase { margin-top: 10px; font-family: var(--titulo); font-weight: 600; font-size: 1.5rem; line-height: 1.2; }
.boleto-codigo { margin-top: 14px; font-size: 1.2rem; font-weight: 500; letter-spacing: .14em; }
.boleto-nota { margin-top: 10px; font-size: .78rem; }

@keyframes destello {
  from { background-position: 0% 0; }
  to { background-position: 100% 0; }
}

/* Progreso: racha, premio final y billete */
.panel { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 28px; text-align: center; }
.ficha { padding: 16px 14px; border: 1px solid rgba(250, 243, 232, .3); border-radius: 16px; background: rgba(122, 52, 30, .3); }
.ficha-titulo { font-family: var(--titulo); font-weight: 600; font-size: 1.35rem; }
.ficha-texto { margin-top: 4px; font-size: .78rem; line-height: 1.45; }
.ficha progress { appearance: none; width: 100%; height: 6px; margin-top: 10px; border: 0; border-radius: 99px; overflow: hidden; background: rgba(250, 243, 232, .25); }
.ficha progress::-webkit-progress-bar { background: rgba(250, 243, 232, .25); }
.ficha progress::-webkit-progress-value { background: var(--oro); }
.ficha progress::-moz-progress-bar { background: var(--oro); }
.ficha button { margin-top: 10px; padding: 7px 16px; border: 0; border-radius: 99px; background: var(--crema); color: var(--tinta); font: inherit; font-size: .78rem; font-weight: 500; cursor: pointer; }
.ficha.tuyo { border-color: #fff3c4; box-shadow: 0 0 22px rgba(246, 217, 166, .6); }

/* Letrero del billete dorado */
.letrero-oro {
  grid-column: 1 / -1; padding: 16px 14px; border: 2px solid #fff3c4; border-radius: 16px;
  background: linear-gradient(115deg, #b8862f 0%, #f3d581 28%, #fff3c4 42%, #dfb04f 58%, #f6dc8e 78%, #a97a26 100%);
  background-size: 220% 100%; color: #4a3208; font-family: var(--titulo); font-weight: 600; font-size: 1.4rem; line-height: 1.25;
  box-shadow: 0 0 24px rgba(246, 217, 166, .6); animation: destello 3.5s ease-in-out infinite alternate;
}
.letrero-oro.salido { background: rgba(61, 28, 18, .45); border-color: var(--oro); color: var(--crema); box-shadow: none; animation: none; }

/* Lista de intriga: qué puede haber, sin desvelarlo todo */
.tesoros { grid-column: 1 / -1; padding: 18px 14px; border: 1px solid var(--oro); border-radius: 16px; background: rgba(122, 52, 30, .3); }
.tesoros-titulo { font-family: var(--titulo); font-weight: 600; font-size: 1.35rem; }
.tesoros ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; list-style: none; }
.tesoros li { padding: 8px 15px; border-radius: 99px; background: var(--crema); color: var(--tinta); font-size: .82rem; font-weight: 500; }

/* Apertura de la puerta */
.puerta.abriendose { perspective: 600px; animation: none; transform: none; opacity: 1; z-index: 2; }
.hueco, .hoja { position: absolute; inset: 0; border-radius: inherit; }
.hueco { background: radial-gradient(circle at 50% 60%, #fffbe8 0%, #f6d9a6 45%, #c98a3d 100%); box-shadow: 0 0 34px rgba(255, 236, 180, .9); }
.hoja {
  display: grid;
  place-items: center;
  background: var(--pino);
  border: 1px solid var(--oro);
  color: var(--crema);
  font-family: var(--titulo);
  font-weight: 600;
  font-size: clamp(1.6rem, 4.5vw, 2.5rem);
  transform-origin: left center;
  animation: girar .9s cubic-bezier(.5, 0, .2, 1) forwards;
}
@keyframes girar { to { transform: rotateY(-112deg); } }
.confeti { position: fixed; z-index: 10; pointer-events: none; }

/* Premio final y compartir */
.premio { display: grid; justify-items: center; gap: 10px; margin-top: 26px; padding: 22px 16px; border: 2px solid var(--terracota); border-radius: 14px; }
.premio-marca { color: var(--terracota); font-size: .75rem; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; }
.premio h3 { font-family: var(--titulo); font-size: 1.5rem; }
.premio a { color: var(--terracota); }
.compartir { margin-top: 26px; padding: 11px 22px; border: 1px solid var(--terracota); border-radius: 99px; background: none; color: var(--terracota); font: inherit; font-size: .85rem; font-weight: 500; cursor: pointer; }
.compartir:hover { background: var(--terracota); color: var(--crema); }
.compartir-estado { margin-top: 10px; font-size: .8rem; white-space: pre-line; user-select: text; }

/* Celebración del billete dorado: línea de tiempo de ~26 s */
dialog.gala {
  width: 100vw; height: 100vh; height: 100dvh;
  max-width: none; max-height: none; margin: 0; padding: 0;
  border: 0; border-radius: 0; overflow: hidden;
  background: radial-gradient(circle at center, #3a2503 0%, #130b01 60%, #050300 100%);
  color: #fff3c4;
}
dialog.gala[open] { animation: gala-fondo .8s ease-out both; }
.gala > * { position: absolute; }
#gala-lienzo { inset: 0; width: 100%; height: 100%; z-index: 3; pointer-events: none; }

.gala-rayos {
  left: 50%; top: 50%; width: 220vmax; height: 220vmax; margin: -110vmax 0 0 -110vmax;
  border-radius: 50%; opacity: .55;
  background: repeating-conic-gradient(rgba(255, 220, 110, .38) 0 6deg, transparent 6deg 18deg);
  -webkit-mask-image: radial-gradient(circle, #000 0%, transparent 55%);
  mask-image: radial-gradient(circle, #000 0%, transparent 55%);
  animation: gala-aparece 1.2s 11s both, gala-girar 30s linear infinite;
}
.gala-orbe {
  left: 50%; top: 50%; width: 90px; height: 90px; margin: -45px 0 0 -45px;
  border-radius: 50%; opacity: 0;
  background: radial-gradient(circle, #fff 0%, #ffe58a 35%, rgba(223, 171, 53, 0) 70%);
  animation: gala-orbe 11s .2s linear both;
}
.gala-destello { inset: 0; z-index: 4; opacity: 0; pointer-events: none; background: #fff3c4; animation: gala-destello 1.3s 10.9s both; }
.gala-intro {
  left: 20px; right: 20px; top: 24%; z-index: 2; opacity: 0; text-align: center;
  font-family: var(--titulo); font-style: italic; font-size: clamp(1.8rem, 6vw, 3.2rem);
}
.gala-intro.uno { animation: gala-frase 3s .6s both; }
.gala-intro.dos { animation: gala-frase 3.2s 3.7s both; }
.gala-intro.tres { animation: gala-frase 3.8s 7s both; }
.gala-enhorabuena { font-family: var(--titulo); font-weight: 600; font-size: clamp(1.7rem, min(7vw, 6vh), 3.2rem); text-shadow: 0 0 24px rgba(255, 214, 90, .9); animation: gala-golpe .8s 23.7s cubic-bezier(.2, 1.4, .4, 1) both; }

.gala-escena {
  inset: 0; z-index: 2; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: clamp(10px, 3vh, 26px); padding: 20px; perspective: 1200px;
}
.gala-billete {
  position: relative; width: min(820px, 94vw, 135vh); padding: clamp(18px, 3.6vmin, 40px) clamp(22px, 5vmin, 54px);
  border-radius: 22px; text-align: center; color: #4a3208; overflow: hidden;
  background: linear-gradient(115deg, #a97a26 0%, #f3d581 24%, #fff7d1 40%, #dfab35 58%, #fbe596 78%, #9c6f1f 100%);
  background-size: 220% 100%;
  box-shadow: 0 0 40px 8px rgba(255, 214, 90, .75), 0 0 130px 40px rgba(255, 190, 40, .4);
  animation: gala-entrada 3.3s 11.1s cubic-bezier(.15, .85, .25, 1.12) both,
             destello 2.6s linear infinite alternate,
             gala-flotar 4s 14.4s ease-in-out infinite;
}
.gala-billete::before { content: ""; position: absolute; inset: 12px; border: 3px dashed rgba(74, 50, 8, .55); border-radius: 14px; }
.gala-billete::after {
  content: ""; position: absolute; top: -20%; bottom: -20%; left: -40%; width: 22%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .85), transparent);
  transform: skewX(-20deg); pointer-events: none;
  animation: gala-brillo 2.8s 14.2s ease-in-out infinite;
}
.gala-arriba { font-size: clamp(.62rem, 2.2vmin, .95rem); font-weight: 500; letter-spacing: .22em; text-transform: uppercase; }
.gala-billete h2 {
  margin: .12em 0; font-family: var(--titulo); font-weight: 600; text-transform: uppercase;
  font-size: clamp(2.4rem, min(11vw, 11vh), 5.6rem); line-height: .95; text-shadow: 0 2px 0 rgba(255, 255, 255, .65);
}
.gala-billete h2 span { display: inline-block; animation: gala-golpe .8s 14.7s cubic-bezier(.2, 1.4, .4, 1) both; }
.gala-billete h2 span + span { animation-delay: 15.7s; }
.gala-frase { font-family: var(--titulo); font-size: clamp(1.1rem, 3.6vmin, 1.9rem); line-height: 1.3; animation: gala-subir 1s 17.4s both; }
.gala-frase strong { display: block; font-size: 1.35em; }
.gala-premio { margin-top: .05em; font: 700 clamp(3rem, min(15vw, 15vh), 7.5rem)/1.05 var(--texto); letter-spacing: -.02em; text-shadow: 0 3px 0 rgba(255, 255, 255, .75), 0 0 30px rgba(255, 255, 255, .8); animation: gala-golpe .8s 18.7s cubic-bezier(.2, 1.5, .4, 1) both; }
.gala-codigo {
  margin-top: .3em; min-height: 1.6em; font-size: clamp(1.15rem, min(5.4vw, 5vh), 2.4rem);
  font-weight: 500; letter-spacing: .12em; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.gala-codigo span { display: inline-block; animation: gala-golpe .35s both; }
.gala-acciones { min-height: 52px; }
.gala-acciones button {
  padding: 14px 44px; border: 0; border-radius: 99px; background: #fff3c4; color: #4a3208;
  font: 500 1.05rem var(--texto); cursor: pointer; animation: gala-subir .6s both;
}
.gala-saltar { right: 16px; bottom: 16px; z-index: 5; border: 0; background: none; color: #fff3c4; font: inherit; font-size: .85rem; text-decoration: underline; cursor: pointer; }

.gala-sonido { right: 16px; top: 16px; z-index: 5; padding: 8px 16px; border: 1px solid rgba(255, 243, 196, .6); border-radius: 99px; background: rgba(0, 0, 0, .4); color: #fff3c4; font: inherit; font-size: .85rem; cursor: pointer; }

@keyframes gala-fondo { from { opacity: 0; } }
@keyframes gala-aparece { from { opacity: 0; } }
@keyframes gala-girar { to { transform: rotate(360deg); } }
@keyframes gala-orbe {
  0% { opacity: 0; transform: scale(.2); }
  8% { opacity: .9; transform: scale(.7); }
  16% { transform: scale(.55); }
  26% { transform: scale(1.1); }
  34% { transform: scale(.85); }
  45% { transform: scale(1.5); }
  53% { transform: scale(1.15); }
  64% { transform: scale(2); }
  70% { transform: scale(1.55); }
  79% { transform: scale(2.6); }
  84% { transform: scale(2); }
  90% { transform: scale(3.4); }
  94% { transform: scale(2.6); }
  99% { opacity: 1; transform: scale(10); }
  100% { opacity: 0; transform: scale(14); }
}
@keyframes gala-destello { 0% { opacity: 0; } 18% { opacity: 1; } 100% { opacity: 0; } }
@keyframes gala-frase { 0% { opacity: 0; transform: translateY(14px); } 25%, 75% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-14px); } }
@keyframes gala-entrada {
  from { opacity: 0; transform: scale(.04) rotateY(1440deg) rotateZ(-25deg); }
  15% { opacity: 1; }
  to { opacity: 1; transform: scale(1) rotateY(0) rotateZ(0); }
}
@keyframes gala-flotar { 25% { transform: rotateY(9deg) rotateX(4deg) translateY(-8px); } 75% { transform: rotateY(-9deg) rotateX(-4deg) translateY(6px); } }
@keyframes gala-brillo { 0% { left: -40%; } 55%, 100% { left: 140%; } }
@keyframes gala-golpe { from { opacity: 0; transform: scale(3); } to { opacity: 1; transform: scale(1); } }
@keyframes gala-subir { from { opacity: 0; transform: translateY(18px); } }

/* Billete plateado: puerta y boleto */
.puerta.plateada, .boleto.plateado {
  background: linear-gradient(115deg, #8e9ab5 0%, #dfe5f2 28%, #ffffff 42%, #b7c1da 60%, #eef2fb 78%, #8590ad 100%);
  background-size: 220% 100%;
  color: #1c2459;
}
.puerta.plateada { border-color: #fff; animation: destello 3.5s ease-in-out infinite alternate; }
.puerta.plateada .marca::after { content: "❄"; color: #1c2459; }
.boleto.plateado { border-color: rgba(28, 36, 89, .5); box-shadow: 0 0 34px rgba(159, 180, 255, .8); }

/* Celebración del billete plateado: línea de tiempo de ~18 s */
dialog.plata {
  width: 100vw; height: 100vh; height: 100dvh;
  max-width: none; max-height: none; margin: 0; padding: 0;
  border: 0; border-radius: 0; overflow: hidden;
  background: radial-gradient(ellipse at 50% 60%, #26317a 0%, #141b48 45%, #060920 100%);
  color: #eef2ff;
}
dialog.plata[open] { animation: gala-fondo .8s ease-out both; }
.plata > * { position: absolute; }
#plata-lienzo { inset: 0; width: 100%; height: 100%; z-index: 3; pointer-events: none; }
.plata-aurora {
  inset: -30%; filter: blur(50px); opacity: .55;
  background:
    radial-gradient(ellipse 45% 18% at 30% 35%, #4f46e5, transparent 70%),
    radial-gradient(ellipse 40% 16% at 70% 55%, #38bdf8, transparent 70%),
    radial-gradient(ellipse 50% 14% at 50% 75%, #8b5cf6, transparent 70%);
  animation: plata-aurora 7s ease-in-out infinite alternate;
}
.plata-intro { left: 20px; right: 20px; top: 20%; z-index: 4; opacity: 0; text-align: center; font-family: var(--titulo); font-style: italic; font-size: clamp(1.8rem, 6vw, 3.2rem); text-shadow: 0 0 18px #000; }
.plata-intro.uno { animation: gala-frase 2.7s .5s both; }
.plata-intro.dos { animation: gala-frase 3s 3.3s both; }
.plata-rayo {
  left: 50%; top: 12%; bottom: 12%; width: 4px; margin-left: -2px; z-index: 4; opacity: 0; border-radius: 4px;
  background: #fff; box-shadow: 0 0 24px 8px #9fb4ff, 0 0 80px 24px #4f46e5;
  animation: plata-rayo 1.6s 5.4s both;
}
.plata-escena { inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(10px, 3vh, 24px); padding: 20px; perspective: 1200px; }
.plata-billete {
  position: relative; width: min(760px, 94vw, 125vh); padding: clamp(24px, 5vmin, 48px) clamp(22px, 5vmin, 48px);
  border-radius: 22px; text-align: center; color: #1c2459; overflow: hidden;
  background: linear-gradient(115deg, #9aa6c2 0%, #e3e8f5 24%, #ffffff 40%, #bcc6df 58%, #f2f5fd 78%, #8b96b4 100%);
  background-size: 220% 100%;
  box-shadow: 0 0 40px 8px rgba(190, 205, 255, .65), 0 0 130px 40px rgba(79, 70, 229, .5);
  animation: plata-abrir 1.5s 6.6s cubic-bezier(.2, .9, .2, 1) both, destello 2.8s linear infinite alternate, plata-mecer 5s 8.4s ease-in-out infinite;
}
.plata-billete::before { content: ""; position: absolute; inset: 12px; border: 2px solid rgba(28, 36, 89, .5); outline: 1px solid rgba(28, 36, 89, .3); outline-offset: -7px; border-radius: 14px; }
.plata-billete::after { content: ""; position: absolute; top: -20%; bottom: -20%; left: -40%; width: 20%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .95), transparent); transform: skewX(-20deg); pointer-events: none; animation: gala-brillo 3.2s 8.2s ease-in-out infinite; }
.plata-arriba { font-size: clamp(.58rem, 2.1vmin, .9rem); font-weight: 500; letter-spacing: .18em; text-transform: uppercase; }
.plata-billete h2 { margin: .15em 0; font-family: var(--titulo); font-weight: 600; text-transform: uppercase; font-size: clamp(2.5rem, min(10vw, 12vh), 5.4rem); line-height: 1; text-shadow: 0 2px 0 #fff; animation: plata-nitido 1.1s 8.7s both; }
.plata-premio { font-size: clamp(.9rem, 3vmin, 1.25rem); line-height: 1.4; animation: gala-subir .9s 10.5s both; }
.plata-premio strong { display: block; font-family: var(--titulo); font-size: 1.5em; line-height: 1.15; color: #4338ca; }
.plata-precio { display: flex; justify-content: center; align-items: center; gap: 18px; margin-top: .5em; font-size: clamp(1.3rem, 5vmin, 2rem); font-weight: 500; animation: gala-subir .6s 11.6s both; }
.plata-precio s { opacity: .65; text-decoration: none; position: relative; }
.plata-precio s::after { content: ""; position: absolute; left: -4px; right: -4px; top: 50%; height: 3px; background: #c0262d; transform-origin: left; animation: plata-tachar .5s 13.2s both; }
.plata-sello { padding: 2px 14px; border: 3px solid #4338ca; border-radius: 10px; color: #4338ca; letter-spacing: .08em; transform: rotate(-8deg); animation: plata-sello .5s 13.7s cubic-bezier(.2, 1.5, .4, 1) both; }
.plata-codigo { margin-top: .7em; min-height: 1.5em; font-family: ui-monospace, Menlo, monospace; font-size: clamp(1rem, min(4.8vw, 4.4vh), 2rem); font-weight: 700; letter-spacing: .1em; white-space: nowrap; }
.plata-final { font-family: var(--titulo); font-weight: 600; text-align: center; font-size: clamp(1.4rem, min(6vw, 5vh), 2.6rem); text-shadow: 0 0 24px #9fb4ff; animation: gala-golpe .8s 15.5s cubic-bezier(.2, 1.4, .4, 1) both; }
.plata .gala-acciones button { background: #eef2ff; color: #1c2459; }
.plata .gala-sonido, .plata .gala-saltar { color: #eef2ff; border-color: rgba(238, 242, 255, .6); }

@keyframes plata-aurora { from { transform: translate(-6%, -3%) rotate(-8deg); } to { transform: translate(6%, 4%) rotate(8deg); } }
@keyframes plata-rayo { 0% { opacity: 0; transform: scaleY(0); } 45% { opacity: 1; transform: scaleY(1); } 75% { opacity: 1; transform: scaleY(1.1) scaleX(3); } 100% { opacity: 0; transform: scaleY(1.1) scaleX(60); } }
@keyframes plata-abrir { from { opacity: 0; clip-path: inset(-180px 50%); transform: rotateY(80deg) scale(1.15); } 15% { opacity: 1; } to { opacity: 1; clip-path: inset(-180px -180px); transform: none; } }
@keyframes plata-mecer { 30% { transform: rotateX(7deg) translateY(-6px); } 70% { transform: rotateX(-6deg) translateY(5px); } }
@keyframes plata-nitido { from { opacity: 0; filter: blur(18px); letter-spacing: .35em; } to { opacity: 1; filter: blur(0); } }
@keyframes plata-tachar { from { transform: scaleX(0); } }
@keyframes plata-sello { from { opacity: 0; transform: scale(4) rotate(14deg); } to { opacity: 1; transform: scale(1) rotate(-8deg); } }

/* El Foco: puerta y boleto */
.puerta.estelar, .boleto.estelar { background: linear-gradient(135deg, #ff1f4b, #b30024 60%, #6d0016); color: #fff; animation: none; }
.puerta.estelar { border-color: #ffd23f; box-shadow: 0 0 20px rgba(255, 31, 75, .8); }
.puerta.estelar .marca::after { content: "▶"; color: #ffd23f; }
.boleto.estelar { border-color: #ffd23f; box-shadow: 0 0 34px rgba(255, 31, 75, .7); }

/* Celebración de El Foco: línea de tiempo de ~24 s */
dialog.foco {
  width: 100vw; height: 100vh; height: 100dvh;
  max-width: none; max-height: none; margin: 0; padding: 0;
  border: 0; border-radius: 0; overflow: hidden;
  background: radial-gradient(ellipse at 50% 110%, #3a0612 0%, #0d0306 55%, #000 100%);
  color: #fff;
}
dialog.foco[open] { animation: gala-fondo .5s both; }
.foco > * { position: absolute; }
#foco-lienzo { inset: 0; width: 100%; height: 100%; z-index: 5; pointer-events: none; }
.foco-haz {
  top: -12vh; width: 46vmax; height: 140vh; margin-left: -23vmax; opacity: 0; pointer-events: none;
  transform-origin: 50% 0; mix-blend-mode: screen;
  clip-path: polygon(47% 0, 53% 0, 100% 100%, 0 100%);
  background: linear-gradient(180deg, rgba(255, 250, 220, .75), rgba(255, 250, 220, .1) 80%, transparent);
}
.foco-haz.izquierdo { left: 10%; animation: foco-encender .4s .4s both, foco-barrer-i 3.1s .4s ease-in-out 3 alternate, foco-fijar-i 1s 9.7s forwards; }
.foco-haz.derecho { left: 90%; animation: foco-encender .4s 3.4s both, foco-barrer-d 2.6s .4s ease-in-out 4 alternate, foco-fijar-d 1s 9.7s forwards; }
.foco-intro { left: 20px; right: 20px; top: 40%; z-index: 2; opacity: 0; text-align: center; font-family: var(--titulo); font-style: italic; font-size: clamp(2rem, 7vw, 4rem); text-shadow: 0 2px 20px #000; }
.foco-intro.uno { animation: gala-frase 2.7s .6s both; }
.foco-intro.dos { animation: gala-frase 2s 3.4s both; }
.foco-intro.tres { animation: gala-frase 2s 5.4s both; }
.foco-numero { inset: 0; z-index: 2; display: grid; place-items: center; opacity: 0; font: 700 min(52vw, 52vh)/1 var(--texto); text-shadow: 0 0 60px #ff1f4b; }
.foco-numero.n3 { animation: foco-numero 1.1s 7.4s both; }
.foco-numero.n2 { animation: foco-numero 1.1s 8.5s both; }
.foco-numero.n1 { animation: foco-numero 1.1s 9.6s both; }
.foco-claqueta { left: 50%; top: 50%; z-index: 3; width: min(420px, 82vw); transform: translate(-50%, -50%); opacity: 0; animation: foco-claqueta 1.5s 10.6s both; }
.foco-palo, .foco-pizarra { display: block; border: 3px solid #fff; }
.foco-palo { height: 46px; border-radius: 8px 8px 0 0; background: repeating-linear-gradient(115deg, #fff 0 34px, #111 34px 68px); transform-origin: left bottom; animation: foco-palo 1s 10.6s both; }
.foco-pizarra { padding: 36px 10px; border-radius: 0 0 14px 14px; background: #111; text-align: center; font-weight: 500; font-size: clamp(2rem, 9vw, 3.4rem); letter-spacing: .08em; }
.foco-destello { inset: 0; z-index: 4; background: #fff; opacity: 0; pointer-events: none; animation: gala-destello 1s 11.95s both; }
.foco-escena { inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: min(1.5vh, 12px); padding: 12px 16px; text-align: center; }
.foco-video {
  width: min(520px, 90vw, 62vh); border-radius: 18px; overflow: hidden; background: #111;
  box-shadow: 0 0 0 3px #ff1f4b, 0 0 50px 8px rgba(255, 31, 75, .75), 0 0 140px 40px rgba(255, 31, 75, .3);
  animation: foco-estreno 1.2s 12s cubic-bezier(.2, 1.35, .35, 1) both;
}
.foco-pantalla { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: radial-gradient(circle at 50% 35%, #ff5a76, #8d0020 65%, #33000c); }
.foco-pantalla img { position: absolute; left: 50%; top: 6%; width: 52%; transform: translateX(-50%); }
.foco-rec { position: absolute; left: 12px; top: 10px; z-index: 1; padding: 3px 10px; border-radius: 6px; background: #e1002d; font-size: .7rem; font-weight: 500; letter-spacing: .08em; animation: foco-parpadeo 1.1s steps(2, start) infinite; }
.foco-play { position: absolute; right: 5%; bottom: 8%; width: 22%; aspect-ratio: 10 / 7; border-radius: 22%; background: #ff0033; box-shadow: 0 8px 22px rgba(0, 0, 0, .5); animation: foco-latir 1s 13s ease-in-out infinite; }
.foco-play::after { content: ""; position: absolute; left: 39%; top: 28%; width: 30%; height: 44%; background: #fff; clip-path: polygon(0 0, 100% 50%, 0 100%); }
.foco-barra { height: 7px; background: #444; }
.foco-barra span { display: block; height: 100%; background: #ff0033; transform-origin: left; animation: plata-tachar 12s 12s linear both; }
.foco h2 { font-family: var(--titulo); font-weight: 600; text-transform: uppercase; font-size: clamp(1.9rem, min(8.6vw, 7.4vh), 4.3rem); line-height: 1; text-shadow: 0 0 26px #ff1f4b, 0 3px 0 #7a0019; animation: gala-golpe .8s 14.3s cubic-bezier(.2, 1.4, .4, 1) both; }
.foco-premio { font-size: clamp(.85rem, min(3.6vw, 2.3vh), 1.15rem); line-height: 1.45; animation: gala-subir .9s 16.4s both; }
.foco-premio strong { color: #ff5a76; font-weight: 500; }
.foco-unico { color: #ffd23f; font-weight: 500; font-size: clamp(.75rem, min(3.2vw, 2vh), 1rem); letter-spacing: .05em; animation: gala-golpe .6s 18s both; }
.foco-codigo { padding: 6px 22px; border: 2px dashed #ffd23f; border-radius: 10px; background: rgba(0, 0, 0, .55); font: 700 clamp(1rem, min(5vw, 3.2vh), 1.7rem) ui-monospace, Menlo, monospace; letter-spacing: .1em; animation: gala-golpe .6s 19.8s both; }
.foco-final { font-family: var(--titulo); font-weight: 600; font-size: clamp(1.5rem, min(7vw, 5vh), 2.8rem); animation: gala-golpe .8s 21.7s cubic-bezier(.2, 1.4, .4, 1) both; }
.foco .gala-acciones button { background: #ff0033; color: #fff; }
.foco .gala-sonido, .foco .gala-saltar { z-index: 6; color: #fff; border-color: rgba(255, 255, 255, .6); }

@keyframes foco-encender { 0% { opacity: 0; } 30% { opacity: .9; } 50% { opacity: .15; } 100% { opacity: .7; } }
@keyframes foco-barrer-i { from { transform: rotate(8deg); } to { transform: rotate(-52deg); } }
@keyframes foco-barrer-d { from { transform: rotate(-4deg); } to { transform: rotate(54deg); } }
@keyframes foco-fijar-i { to { transform: rotate(-27deg); } }
@keyframes foco-fijar-d { to { transform: rotate(27deg); } }
@keyframes foco-numero { 0% { opacity: 0; transform: scale(2.4); } 20% { opacity: 1; transform: scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: scale(.6); } }
@keyframes foco-claqueta { 0% { opacity: 0; transform: translate(-50%, 60%) rotate(-12deg); } 25%, 88% { opacity: 1; transform: translate(-50%, -50%); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.6); } }
@keyframes foco-palo { 0%, 70% { transform: rotate(-24deg); } 90%, 100% { transform: rotate(0); } }
@keyframes foco-estreno { from { opacity: 0; transform: scale(.1) rotate(-14deg); } 25% { opacity: 1; } to { opacity: 1; transform: none; } }
@keyframes foco-parpadeo { to { opacity: .35; } }
@keyframes foco-latir { 50% { transform: scale(1.14); } }

/* Cursos: puertas y boletos */
.puerta.con-ko, .boleto.curso-ko { background: linear-gradient(135deg, #ffe2c4, #ffc79a); color: #0f1c33; animation: none; }
.puerta.con-ko { border-color: #d6341f; box-shadow: 0 0 20px rgba(255, 199, 154, .9); }
.puerta.con-ko .marca::after { content: "🥊"; }
.boleto.curso-ko { border-color: #d6341f; }
.puerta.con-anti, .boleto.curso-antigravity { background: linear-gradient(135deg, #26211a, #050505 65%); color: #f1cf7a; animation: none; }
.puerta.con-anti { border-color: #f1cf7a; box-shadow: 0 0 20px rgba(241, 207, 122, .8); }
.puerta.con-anti .marca::after { content: "💎"; }
.boleto.curso-antigravity { border-color: #d3a64a; }

/* Celebraciones de los cursos: líneas de tiempo de ~20 s */
dialog.curso { width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; border-radius: 0; overflow: hidden; }
dialog.curso[open] { animation: gala-fondo .5s both; }
.curso > * { position: absolute; }
#curso-lienzo { inset: 0; width: 100%; height: 100%; z-index: 5; pointer-events: none; }
.curso-fondo { inset: 0; pointer-events: none; }
.curso-intro { left: 20px; right: 20px; top: 38%; z-index: 2; opacity: 0; text-align: center; font-size: clamp(1.9rem, 6.5vw, 3.8rem); line-height: 1.15; }
.curso-intro.uno { animation: gala-frase 2.6s .5s both; }
.curso-intro.dos { animation: gala-frase 2.6s 3.1s both; }
.curso-destello { inset: 0; z-index: 4; opacity: 0; pointer-events: none; }
.curso-escena { inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: min(1.4vh, 11px); padding: 12px 16px; text-align: center; }
.curso-tarjeta { width: min(560px, 90vw, 66vh); border-radius: 18px; overflow: hidden; }
.curso-tarjeta img { display: block; width: 100%; height: auto; }
.curso h2 { font-weight: 600; font-size: clamp(1.8rem, min(8vw, 6.6vh), 3.8rem); line-height: 1.05; }
.curso-premio { font-size: clamp(.85rem, min(3.6vw, 2.3vh), 1.1rem); }
.curso-premio strong { display: block; font-weight: 500; font-size: 1.3em; }
.curso-precio { display: flex; align-items: center; gap: 16px; font-size: clamp(1.3rem, min(6vw, 4vh), 2.1rem); font-weight: 500; }
.curso-precio s { position: relative; text-decoration: none; opacity: .75; }
.curso-precio s::after { content: ""; position: absolute; left: -4px; right: -4px; top: 50%; height: 4px; background: #e02b20; transform-origin: left; }
.curso-sello { padding: 0 14px; border: 3px solid currentColor; border-radius: 10px; letter-spacing: .08em; }
.curso-codigo { padding: 5px 20px; border: 2px dashed currentColor; border-radius: 10px; font: 700 clamp(1rem, min(5vw, 3.1vh), 1.6rem) ui-monospace, Menlo, monospace; letter-spacing: .1em; }
.curso-unico { font-size: clamp(.72rem, min(3.1vw, 1.9vh), .95rem); font-weight: 500; }
.curso-final { font-family: var(--titulo); font-weight: 600; font-size: clamp(1.25rem, min(5.8vw, 4.2vh), 2.3rem); }
.curso .gala-sonido, .curso .gala-saltar { z-index: 6; }
/* las capas de efectos ocupan toda la pantalla */
.curso > .solo-ko, .curso > .solo-anti { inset: 0; pointer-events: none; }
.curso > .solo-ko { z-index: 3; }
.curso > .solo-anti { z-index: 1; }
.curso.ko .curso > .solo-anti, .curso.ko > .solo-anti, .curso.anti > .solo-ko { display: none; }

/* — Diseño K.O.: ring de boxeo, golpes y confeti — */
dialog.curso.ko { background: radial-gradient(ellipse at 50% 20%, #5a2a1c, #160b0b 60%, #050304); color: #fff; }
.ko .curso-fondo {
  background:
    linear-gradient(transparent 68%, #d6341f 68% 69.2%, transparent 69.2% 76%, #fff 76% 77.2%, transparent 77.2% 84%, #2563eb 84% 85.2%, transparent 85.2%),
    radial-gradient(ellipse 40% 55% at 50% 0, rgba(255, 236, 200, .35), transparent 70%);
  animation: ko-cuerdas .6s 12.9s forwards;
}
.ko .curso-intro { font-weight: 500; text-transform: uppercase; letter-spacing: .02em; text-shadow: 4px 4px 0 #d6341f; }
.ko .curso-intro.tres { animation: gala-golpe 1.4s 5.6s both, ko-fuera .3s 7.1s forwards; }
.ko-golpe { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; pointer-events: none; }
.ko-golpe > * { grid-area: 1 / 1; opacity: 0; line-height: 1; }
.ko-guante { font-size: min(62vw, 62vh); }
.ko-onda { padding: .2em .5em; border: 5px solid #0f1c33; border-radius: 20px; background: #ffb020; color: #0f1c33; font-weight: 700; font-size: clamp(2.6rem, 11vw, 6rem); }
.ko-golpe.g1 { translate: -18vw -8vh; } .ko-golpe.g2 { translate: 18vw 8vh; } .ko-golpe.g3 { translate: 0 -2vh; }
.g1 .ko-guante { animation: ko-puno .65s 7.15s cubic-bezier(.5, 0, 1, .7) both; }
.g1 .ko-onda { animation: ko-onda .95s 7.6s both; }
.g2 .ko-guante { animation: ko-puno-d .65s 8.35s cubic-bezier(.5, 0, 1, .7) both; }
.g2 .ko-onda { animation: ko-onda .95s 8.8s both; }
.g3 .ko-guante { animation: ko-puno .65s 9.55s cubic-bezier(.5, 0, 1, .7) both; }
.g3 .ko-onda { animation: ko-onda .95s 10s both; }
.ko-grande { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; opacity: 0; color: #e0321c; font: 700 min(40vw, 54vh)/1 var(--texto); text-shadow: -4px -4px 0 #fff, 4px -4px 0 #fff, -4px 4px 0 #fff, 4px 4px 0 #fff, 0 -5px 0 #fff, 0 5px 0 #fff, -5px 0 0 #fff, 5px 0 0 #fff, 0 16px 0 #0f1c33; animation: ko-grande 2s 11.35s both; }
.ko .curso-destello { background: #fff; animation: gala-destello .9s 13s both; }
.ko .curso-escena { animation: ko-temblor 1.4s 13.5s; }
.ko .curso-tarjeta { border: 5px solid #fff; box-shadow: 0 0 0 4px #d6341f, 0 0 60px 12px rgba(255, 176, 110, .65); animation: ko-caer 1s 13.1s both; }
.ko h2 { color: #fff; text-transform: uppercase; font-family: var(--texto); font-weight: 700; text-shadow: 4px 4px 0 #d6341f; animation: gala-golpe .6s 14.5s cubic-bezier(.2, 1.4, .4, 1) both; }
.ko .curso-premio { animation: gala-subir .6s 15.3s both; }
.ko .curso-premio strong { color: #ffc79a; }
.ko .curso-precio { animation: gala-subir .5s 15.8s both; }
.ko .curso-precio s::after { animation: plata-tachar .4s 16.4s both; }
.ko .curso-sello { color: #7cf2a0; animation: gala-golpe .5s 16.8s cubic-bezier(.2, 1.5, .4, 1) both; }
.ko .curso-codigo { background: rgba(0, 0, 0, .55); color: #ffd23f; animation: gala-golpe .6s 17.6s both; }
.ko .curso-unico { color: #ffc79a; animation: gala-subir .6s 18.2s both; }
.ko .curso-final { animation: gala-golpe .7s 18.7s cubic-bezier(.2, 1.4, .4, 1) both; }
.ko .gala-acciones button { background: #d6341f; color: #fff; }
.ko .gala-sonido, .ko .gala-saltar { color: #fff; border-color: rgba(255, 255, 255, .6); }

/* — Antigravity: negro, oro y gravedad cero — */
dialog.curso.anti { background: radial-gradient(ellipse at 50% 60%, #1d1810, #080705 55%, #000); color: #f7ecd0; }
.anti .curso-fondo { background: radial-gradient(circle at 50% 108%, rgba(241, 207, 122, .4), transparent 45%); animation: anti-respirar 4s ease-in-out infinite alternate; }
.anti .curso-intro { font-weight: 300; letter-spacing: .04em; text-shadow: 0 0 22px rgba(241, 207, 122, .8); }
.anti .curso-intro.uno { animation-name: anti-flotar-texto; }
.anti .curso-intro.dos { animation-name: anti-flotar-texto; }
.anti .curso-intro.tres { top: 18%; animation: anti-flotar-texto 4.7s 6s both; }
.anti-numero { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; color: #f1cf7a; font: 300 min(46vw, 46vh)/1 var(--texto); text-shadow: 0 0 50px #d3a64a; }
.anti-numero.n3 { animation: anti-numero .9s 8.2s both; }
.anti-numero.n2 { animation: anti-numero .9s 9.1s both; }
.anti-numero.n1 { animation: anti-numero 1s 10s both; }
.anti-anillo { position: absolute; left: 50%; top: 50%; width: 118vmin; height: 40vmin; margin: -20vmin 0 0 -59vmin; border: 1px solid rgba(241, 207, 122, .65); border-radius: 50%; box-shadow: 0 0 18px rgba(241, 207, 122, .35); opacity: 0; }
.anti-anillo.a1 { animation: gala-aparece 3s 1s both, anti-orbita 14s linear infinite; }
.anti-anillo.a2 { animation: gala-aparece 3s 4s both, anti-orbita 19s linear infinite reverse; }
.anti-anillo.a3 { width: 90vmin; margin-left: -45vmin; animation: gala-aparece 3s 7s both, anti-orbita 9s linear infinite; }
.anti .curso-destello { background: radial-gradient(circle, #fff 0%, #f1cf7a 40%, transparent 75%); animation: gala-destello 1.4s 10.9s both; }
.anti .curso-tarjeta { border: 1px solid #f1cf7a; box-shadow: 0 0 30px 4px rgba(241, 207, 122, .6), 0 40px 90px 10px rgba(211, 166, 74, .35); animation: anti-subir 2.8s 11.2s cubic-bezier(.15, .85, .25, 1) both, anti-levitar 4s 14s ease-in-out infinite; }
.anti h2 { font-family: var(--texto); font-weight: 300; text-transform: uppercase; letter-spacing: .12em; color: #f1cf7a; text-shadow: 0 0 26px rgba(241, 207, 122, .8); animation: anti-aparecer 1.2s 13.8s both; }
.anti .curso-premio { animation: anti-aparecer 1s 15.2s both; }
.anti .curso-premio strong { color: #fff; letter-spacing: .04em; }
.anti .curso-precio { animation: anti-aparecer .8s 16s both; }
.anti .curso-precio s::after { animation: plata-tachar .5s 16.5s both; }
.anti .curso-sello { color: #f1cf7a; animation: gala-golpe .5s 17s cubic-bezier(.2, 1.5, .4, 1) both; }
.anti .curso-codigo { color: #f1cf7a; background: rgba(0, 0, 0, .6); animation: anti-aparecer .8s 18s both; }
.anti .curso-unico { color: #cdbb8d; animation: anti-aparecer .8s 18.5s both; }
.anti .curso-final { animation: anti-aparecer .9s 19s both; }
.anti .gala-acciones button { background: linear-gradient(135deg, #fff0c2, #d3a64a); color: #171208; }
.anti .gala-sonido, .anti .gala-saltar { color: #f7ecd0; border-color: rgba(241, 207, 122, .6); }

@keyframes ko-cuerdas { to { opacity: .16; } }
@keyframes ko-fuera { to { opacity: 0; } }
@keyframes ko-puno { 0% { opacity: 0; transform: translate(-45vw, 55vh) scale(.1) rotate(-50deg); } 20% { opacity: 1; } 75% { opacity: 1; transform: scale(1.15) rotate(8deg); } 100% { opacity: 0; transform: scale(1.7) rotate(14deg); } }
@keyframes ko-puno-d { 0% { opacity: 0; transform: translate(45vw, 55vh) scale(-.1, .1) rotate(-50deg); } 20% { opacity: 1; } 75% { opacity: 1; transform: scale(-1.15, 1.15) rotate(8deg); } 100% { opacity: 0; transform: scale(-1.7, 1.7) rotate(14deg); } }
@keyframes ko-onda { 0% { opacity: 0; transform: scale(.2) rotate(-25deg); } 18% { opacity: 1; transform: scale(1.25) rotate(-8deg); } 75% { opacity: 1; transform: scale(1) rotate(-8deg); } 100% { opacity: 0; transform: scale(1.1) rotate(-8deg); } }
@keyframes ko-grande { 0% { opacity: 0; transform: scale(5) rotate(-18deg); } 18% { opacity: 1; transform: scale(1) rotate(-7deg); } 28% { transform: scale(1.1) rotate(-5deg); } 38% { transform: scale(1) rotate(-7deg); } 82% { opacity: 1; } 100% { opacity: 0; transform: scale(1.4) rotate(-7deg); } }
@keyframes ko-caer { 0% { opacity: 0; transform: translateY(-110vh) rotate(-9deg); } 55% { opacity: 1; transform: translateY(14px) rotate(2deg); } 72% { transform: translateY(-22px) rotate(-1deg); } 100% { opacity: 1; transform: none; } }
@keyframes ko-temblor { 10%, 50% { transform: translate(-9px, 5px); } 30%, 70% { transform: translate(8px, -5px); } 85% { transform: translate(-3px, 2px); } }
@keyframes anti-respirar { from { opacity: .5; } to { opacity: 1; } }
@keyframes anti-flotar-texto { 0% { opacity: 0; transform: translateY(40px); } 25%, 72% { opacity: 1; } 100% { opacity: 0; transform: translateY(-80px); letter-spacing: .14em; } }
@keyframes anti-numero { 0% { opacity: 0; transform: translateY(60px) scale(.7); } 25%, 65% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-110px) rotate(12deg); } }
@keyframes anti-orbita { from { transform: rotate(0); } to { transform: rotate(360deg); } }
@keyframes anti-subir { from { opacity: 0; transform: translateY(95vh) rotate(16deg) scale(.55); } 20% { opacity: 1; } to { opacity: 1; transform: none; } }
@keyframes anti-levitar { 25% { transform: translateY(-11px) rotate(-.8deg); } 75% { transform: translateY(5px) rotate(.8deg); } }
@keyframes anti-aparecer { from { opacity: 0; transform: translateY(36px); filter: blur(10px); } to { opacity: 1; filter: blur(0); } }

/* Regalo: puerta y boleto */
.puerta.con-regalo, .boleto.mes { background: linear-gradient(135deg, #2f8f66, #145238); color: #fff; animation: none; }
.puerta.con-regalo { border-color: #ffd23f; box-shadow: 0 0 20px rgba(127, 232, 176, .8); }
.puerta.con-regalo .marca::after { content: "🎁"; }
.boleto.mes { border-color: #ffd23f; }

/* Celebración del regalo: línea de tiempo de ~16 s */
dialog.regalo {
  width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0;
  border: 0; border-radius: 0; overflow: hidden; color: #fff;
  background: radial-gradient(ellipse at 50% 60%, #23714f, #0d3526 55%, #04140e);
}
dialog.regalo[open] { animation: gala-fondo .5s both; }
.regalo > * { position: absolute; }
#regalo-lienzo { inset: 0; width: 100%; height: 100%; z-index: 5; pointer-events: none; }
.regalo-fondo { inset: 0; background: radial-gradient(circle at 50% 58%, rgba(255, 224, 150, .45), transparent 48%); animation: anti-respirar 2.4s ease-in-out infinite alternate; }
.regalo-intro { left: 20px; right: 20px; top: 14%; z-index: 2; opacity: 0; text-align: center; font-family: var(--titulo); font-style: italic; font-size: clamp(1.7rem, 5.6vw, 3rem); }
.regalo-intro.uno { animation: gala-frase 2.6s 1.2s both; }
.regalo-intro.dos { animation: gala-frase 2.8s 3.9s both; }

.regalo-caja {
  --lado: min(250px, 52vw, 34vh);
  left: 50%; top: 56%; z-index: 3; width: var(--lado); height: var(--lado); margin: calc(var(--lado) / -2) 0 0 calc(var(--lado) / -2);
  animation: regalo-caer 1.2s .3s both, regalo-sacudir .75s 3s, regalo-sacudir-2 .75s 4.3s, regalo-sacudir-3 1.3s 5.6s, regalo-irse .7s 7.2s forwards;
}
.regalo-sombra { position: absolute; left: 0; right: 0; bottom: -8%; height: 12%; border-radius: 50%; background: rgba(0, 0, 0, .45); filter: blur(10px); }
.regalo-cuerpo, .regalo-tapa { position: absolute; }
.regalo-cuerpo { left: 6%; right: 6%; top: 28%; bottom: 0; border-radius: 6px 6px 14px 14px; background: linear-gradient(90deg, transparent 42%, #ffd23f 42% 58%, transparent 58%), linear-gradient(135deg, #e8453a, #9c1c17); }
.regalo-tapa { left: 0; right: 0; top: 14%; height: 20%; border-radius: 10px; background: linear-gradient(90deg, transparent 42%, #ffd23f 42% 58%, transparent 58%), linear-gradient(135deg, #ff5b4f, #b8251e); box-shadow: 0 8px 14px rgba(0, 0, 0, .35); animation: regalo-tapa 1.1s 6.9s cubic-bezier(.2, .7, .3, 1) forwards; }
.regalo-lazo { position: absolute; bottom: 92%; width: 25%; height: 105%; border: calc(var(--lado) * .045) solid #ffd23f; }
.regalo-lazo.izq { right: 50%; border-radius: 60% 40% 10% 60%; transform: rotate(14deg); }
.regalo-lazo.der { left: 50%; border-radius: 40% 60% 60% 10%; transform: rotate(-14deg); }

.regalo-destello { inset: 0; z-index: 4; opacity: 0; pointer-events: none; background: radial-gradient(circle at 50% 55%, #fff 0%, #ffe9ad 40%, transparent 80%); animation: gala-destello 1.2s 6.95s both; }
.regalo-escena { inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: min(2.4vh, 20px); padding: 14px 16px; text-align: center; }
.regalo-tarjeta { width: min(640px, 94vw); padding: min(3.4vh, 30px) clamp(16px, 4vw, 36px); border: 3px solid #ffd23f; border-radius: 22px; background: #fdf6e8; color: #17382a; box-shadow: 0 0 50px 8px rgba(255, 214, 100, .55); animation: regalo-salir 1.5s 7.2s cubic-bezier(.2, 1.25, .35, 1) both; }
.regalo-marca { font-size: clamp(.62rem, 2.4vmin, .85rem); font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: #b8251e; }
.regalo h2 { font-family: var(--titulo); font-weight: 600; text-transform: uppercase; font-size: clamp(2.6rem, min(13vw, 11vh), 6rem); line-height: 1.02; color: #b8251e; animation: gala-golpe .8s 9s cubic-bezier(.2, 1.4, .4, 1) both; }
.regalo-donde { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0 8px; font-size: clamp(.9rem, min(3.8vw, 2.6vh), 1.2rem); animation: gala-subir .7s 10.1s both; }
.regalo-donde img { height: 2em; width: 5.3em; object-fit: cover; mix-blend-mode: multiply; }
.regalo-opciones { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: min(2vh, 16px); }
.regalo-opcion { padding: 10px 8px; border-radius: 12px; font-size: clamp(.74rem, min(3.3vw, 2.1vh), .95rem); line-height: 1.35; }
.regalo-opcion strong { display: block; font-weight: 500; }
.regalo-opcion.a { background: #1f5c43; color: #fff; animation: regalo-izq .7s 11.2s both; }
.regalo-opcion.b { background: #b8251e; color: #fff; animation: regalo-der .7s 12.1s both; }
.regalo-codigo { display: inline-block; margin-top: min(2vh, 16px); padding: 4px 18px; border: 2px dashed #17382a; border-radius: 10px; font: 700 clamp(1rem, min(5vw, 3vh), 1.5rem) ui-monospace, Menlo, monospace; letter-spacing: .1em; animation: gala-golpe .6s 12.9s both; }
.regalo-final { font-family: var(--titulo); font-weight: 600; font-size: clamp(1.5rem, min(7vw, 5vh), 2.6rem); animation: gala-golpe .8s 13.6s cubic-bezier(.2, 1.4, .4, 1) both; }
.regalo .gala-acciones button { background: #fdf6e8; color: #17382a; }
.regalo .gala-sonido, .regalo .gala-saltar { z-index: 6; color: #fff; border-color: rgba(255, 255, 255, .6); }

@keyframes regalo-caer { 0% { opacity: 0; transform: translateY(-110vh) rotate(-14deg); } 70% { opacity: 1; transform: translateY(0) scale(1.14, .84); } 84% { transform: translateY(-26px) scale(.95, 1.07); } 100% { opacity: 1; transform: none; } }
@keyframes regalo-sacudir { 15%, 55% { transform: rotate(-9deg) translateX(-8px); } 35%, 75% { transform: rotate(9deg) translateX(8px); } }
@keyframes regalo-sacudir-2 { 12%, 45%, 78% { transform: rotate(-13deg) translateY(-14px); } 28%, 62% { transform: rotate(13deg) scale(1.08); } }
@keyframes regalo-sacudir-3 { 8%, 24%, 40%, 56% { transform: rotate(-12deg) scale(1.08); } 16%, 32%, 48%, 64% { transform: rotate(12deg) scale(1.1); } 80% { transform: scale(1.18, .8); } 100% { transform: scale(.94, 1.1); } }
@keyframes regalo-irse { from { opacity: 1; } to { opacity: 0; transform: translateY(40vh) scale(.7); } }
@keyframes regalo-tapa { to { opacity: 0; transform: translate(45%, -75vh) rotate(52deg); } }
@keyframes regalo-salir { from { opacity: 0; transform: translateY(18vh) scale(.1) rotate(-12deg); } 25% { opacity: 1; } to { opacity: 1; transform: none; } }
@keyframes regalo-izq { from { opacity: 0; transform: translateX(-60px); } }
@keyframes regalo-der { from { opacity: 0; transform: translateX(60px); } }

/* En las celebraciones, los efectos decorativos nunca deben bloquear un clic:
   aunque se vuelvan transparentes, siguen ocupando su sitio. */
.gala [aria-hidden="true"], .plata [aria-hidden="true"], .foco [aria-hidden="true"],
.curso [aria-hidden="true"], .regalo [aria-hidden="true"],
.gala [aria-hidden="true"] *, .plata [aria-hidden="true"] *, .foco [aria-hidden="true"] *,
.curso [aria-hidden="true"] *, .regalo [aria-hidden="true"] * { pointer-events: none; }
/* y los botones quedan siempre por encima */
.gala-acciones { position: relative; z-index: 7; }

/* Tablet y móvil */
@media (max-width: 700px) {
  .calendario { grid-template-columns: repeat(4, 1fr); gap: 10px; }
  .panel { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .foco-premio br { display: none; }
  .ficha-titulo { font-size: 1.15rem; }
}
@media (max-width: 380px) {
  .calendario { grid-template-columns: repeat(3, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before { animation: none !important; transition: none !important; }
}
