/* =========================================================================
   ESTILO.CSS — "Noche de Lavanda"
   Un valle de montañas moradas, una casita con la luz encendida,
   un sobre lacrado en oro y una carta escrita en papel de verdad.
   ========================================================================= */

:root {
  --noche-0:   #0d0618;   /* cielo arriba, casi negro       */
  --noche-1:   #1c0e33;
  --noche-2:   #31164f;
  --noche-3:   #4a2173;   /* horizonte                      */
  --lavanda:   #cfb3f2;
  --lavanda-2: #efe4ff;
  --oro-0:     #fff0c4;
  --oro-1:     #f3cf7f;
  --oro-2:     #d9a13b;
  --oro-3:     #9a6b1e;

  --papel:     #f8efdd;
  --papel-2:   #efe2c8;
  --tinta:     #3c2a55;
  --tinta-2:   #6b5687;

  --script: "Great Vibes", "Cormorant Garamond", cursive;
  --serif:  "Cormorant Garamond", Georgia, serif;
  --sans:   "Quicksand", -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { margin: 0; padding: 0; min-height: 100%; overscroll-behavior: none; }

body {
  font-family: var(--sans);
  color: #fff;
  background:
    radial-gradient(130% 60% at 50% 108%, rgba(150, 82, 216, .45), transparent 60%),
    linear-gradient(180deg, var(--noche-0) 0%, var(--noche-1) 42%, var(--noche-2) 72%, var(--noche-3) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  min-height: 100dvh;
}

/* =========================================================================
   EL PAISAJE  (todo fijo, detrás del contenido)
   ========================================================================= */

#cielo { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

/* --- La luna, con sus cráteres y su halo que respira ------------------- */
.luna {
  position: fixed;
  top: 6vh; right: 11vw;
  width: 74px; height: 74px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, #fffdf4, #f6e3b2 55%, #e0c17c);
  box-shadow:
    0 0 34px 10px rgba(255, 231, 170, .38),
    0 0 110px 40px rgba(255, 231, 170, .14);
  z-index: 0;
  animation: luna-respira 7s ease-in-out infinite;
  pointer-events: none;
}
.crater {
  position: absolute; border-radius: 50%;
  background: rgba(190, 152, 92, .28);
  box-shadow: inset 1px 1px 2px rgba(120, 90, 40, .35);
}
.crater.c1 { width: 16px; height: 16px; top: 38%; left: 20%; }
.crater.c2 { width: 10px; height: 10px; top: 20%; left: 55%; }
.crater.c3 { width:  8px; height:  8px; top: 62%; left: 58%; }
@keyframes luna-respira {
  0%, 100% { box-shadow: 0 0 30px 8px rgba(255,231,170,.32), 0 0 100px 34px rgba(255,231,170,.12); }
  50%      { box-shadow: 0 0 44px 14px rgba(255,231,170,.5),  0 0 130px 52px rgba(255,231,170,.2);  }
}

/* --- Nubes que cruzan despacito ---------------------------------------- */
.nube {
  position: fixed;
  height: 34px; border-radius: 99px;
  background: radial-gradient(ellipse at 50% 55%, rgba(205, 175, 250, .10), transparent 72%);
  filter: blur(14px);
  z-index: 0; pointer-events: none;
  animation: nube-cruza linear infinite;
}
.nube.n1 { width: 260px; top: 11vh; animation-duration: 95s;  animation-delay: -20s; }
.nube.n2 { width: 180px; top: 24vh; animation-duration: 130s; animation-delay: -70s; }
.nube.n3 { width: 300px; top:  4vh; animation-duration: 160s; animation-delay: -110s; }
@keyframes nube-cruza {
  from { transform: translateX(-30vw); }
  to   { transform: translateX(130vw); }
}

/* --- Montañas y la casita ---------------------------------------------- */
.paisaje {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  width: 100%; height: 30vh;
  z-index: 0; pointer-events: none;
}
.monte.lejos { fill: #241040; }
.monte.medio { fill: #180a2e; }
.monte.cerca { fill: #0e0520; }

.casita .techo    { fill: #241028; }
.casita .pared    { fill: #170b20; }
.casita .chimenea { fill: #1c0e26; }
.casita .ventana {
  fill: #ffd98a;
  animation: ventana-titila 5s ease-in-out infinite;
}
.casita .puerta { fill: #241335; }
@keyframes ventana-titila {
  0%, 100% { fill: #ffd98a; } 47% { fill: #ffcf6f; } 52% { fill: #f4b94e; }
}
.humo { fill: rgba(220, 200, 255, .18); animation: humo-sube 6s ease-in infinite; }
.humo.h2 { animation-delay: 2s; }
.humo.h3 { animation-delay: 4s; }
@keyframes humo-sube {
  0%   { opacity: 0;   transform: translateY(6px); }
  30%  { opacity: .55; }
  100% { opacity: 0;   transform: translateY(-26px) translateX(5px); }
}

.neblina {
  position: fixed;
  left: -10%; right: -10%; bottom: -12vh; height: 34vh;
  background: radial-gradient(ellipse at 50% 100%, rgba(167, 108, 233, .4), transparent 66%);
  filter: blur(26px);
  z-index: 0; pointer-events: none;
}

/* Viñeta: oscurece las orillas, como una foto antigua */
.vineta {
  position: fixed; inset: 0; z-index: 2; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 42%, transparent 62%, rgba(6, 2, 14, .5) 100%);
}

/* =========================================================================
   ESCENARIO Y PANTALLAS
   ========================================================================= */

#escenario {
  position: relative; z-index: 3;
  min-height: 100vh; min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 30px 20px calc(30px + env(safe-area-inset-bottom));
}

.pantalla { display: none; width: 100%; max-width: 430px; }
.pantalla.activa {
  display: block;
  animation: pantalla-entra .8s cubic-bezier(.22, .9, .28, 1) both;
}
@keyframes pantalla-entra {
  from { opacity: 0; transform: translateY(26px) scale(.975); filter: blur(3px); }
  to   { opacity: 1; transform: none; filter: none; }
}

/* =========================================================================
   TIPOGRAFÍA
   ========================================================================= */

.script-oro {
  font-family: var(--script);
  font-weight: 400;
  font-size: 46px;
  line-height: 1.12;
  margin: 0 0 6px;
  background: linear-gradient(168deg, var(--oro-0) 15%, var(--oro-1) 48%, var(--oro-2) 85%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 12px rgba(255, 214, 130, .3));
  text-align: center;
}
.script-oro.chico { font-size: 34px; }

.script-tinta {
  font-family: var(--script);
  font-weight: 400;
  font-size: 42px;
  color: var(--tinta);
  margin: 0 0 4px;
  text-align: center;
}

.sub {
  color: var(--lavanda-2);
  font-size: 14.5px;
  line-height: 1.65;
  margin: 0 0 18px;
  text-align: center;
  opacity: .94;
}

/* Etiqueta con líneas doradas a los lados: PISTA · EL PRIMER REGALO */
.etiqueta {
  display: flex; align-items: center; gap: 12px;
  font-size: 11px; font-weight: 700;
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--oro-1);
  margin: 0 0 14px;
  white-space: nowrap;
}
.etiqueta::before, .etiqueta::after {
  content: ""; height: 1px; flex: 1;
  background: linear-gradient(90deg, transparent, rgba(243, 207, 127, .55));
}
.etiqueta::after { background: linear-gradient(90deg, rgba(243, 207, 127, .55), transparent); }

.contador {
  font-size: 12px; letter-spacing: .08em;
  color: var(--oro-1);
  text-align: center; margin: 0 0 14px;
}

/* =========================================================================
   LA TARJETA NOCTURNA  (pista, pregunta, castigo, celebración)
   ========================================================================= */

.tarjeta {
  position: relative;
  border-radius: 24px;
  padding: 30px 26px;
  background:
    linear-gradient(172deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, .035) 55%),
    linear-gradient(180deg, rgba(38, 18, 66, .82), rgba(22, 10, 42, .88));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow:
    0 26px 60px rgba(3, 1, 10, .55),
    inset 0 1px 0 rgba(255, 255, 255, .14);
  text-align: center;
}
/* Borde doble: hairline de oro afuera, brillo frío adentro */
.tarjeta.ornamentada {
  border: 1px solid rgba(243, 207, 127, .34);
}
.tarjeta.ornamentada::before {
  content: "";
  position: absolute; inset: 7px;
  border: 1px solid rgba(207, 179, 242, .16);
  border-radius: 17px;
  pointer-events: none;
}

/* Filigrana: línea — ◆ — línea, arriba y abajo de la tarjeta */
.filigrana {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  height: 9px; margin: 0 auto 16px;
}
.filigrana.abajo { margin: 20px auto 0; }
.filigrana::before, .filigrana::after {
  content: ""; width: 52px; height: 1px;
}
.filigrana::before { background: linear-gradient(90deg, transparent, rgba(243, 207, 127, .65)); }
.filigrana::after  { background: linear-gradient(90deg, rgba(243, 207, 127, .65), transparent); }
.filigrana {
  background: radial-gradient(circle 3px at 50% 50%, var(--oro-1) 92%, transparent) center / 9px 9px no-repeat;
}

/* =========================================================================
   TODAVÍA NO ES LA HORA — la cuenta regresiva de la activación
   ========================================================================= */

.sello-dormido {
  width: 62px; height: 62px;
  margin: 2px auto 16px;
  border-radius: 47% 53% 51% 49% / 52% 48% 52% 48%;
  background: radial-gradient(circle at 34% 28%, var(--oro-0), var(--oro-1) 42%, var(--oro-2) 78%, var(--oro-3));
  box-shadow:
    0 4px 12px rgba(0, 0, 0, .45),
    inset 0 -2px 5px rgba(110, 70, 15, .5),
    inset 0 2px 4px rgba(255, 246, 214, .8),
    0 0 26px rgba(255, 217, 138, .3);
  display: grid; place-items: center;
  animation: sello-duerme 4.5s ease-in-out infinite;
}
.sello-dormido svg { width: 28px; height: 28px; fill: rgba(110, 70, 15, .55); }
@keyframes sello-duerme {
  0%, 100% { transform: scale(1) rotate(-3deg);    box-shadow: 0 4px 12px rgba(0,0,0,.45), inset 0 -2px 5px rgba(110,70,15,.5), inset 0 2px 4px rgba(255,246,214,.8), 0 0 20px rgba(255,217,138,.22); }
  50%      { transform: scale(1.045) rotate(3deg); box-shadow: 0 4px 12px rgba(0,0,0,.45), inset 0 -2px 5px rgba(110,70,15,.5), inset 0 2px 4px rgba(255,246,214,.8), 0 0 36px rgba(255,217,138,.45); }
}

.cuenta {
  display: flex; justify-content: center; gap: 8px;
  margin: 6px 0 18px;
}
.unidad {
  flex: 1 1 0; min-width: 0;
  padding: 13px 4px 10px;
  background: rgba(13, 6, 24, .42);
  border: 1px solid rgba(243, 207, 127, .24);
  border-radius: 14px;
}
.unidad b {
  display: block;
  font-family: var(--sans);
  font-size: 30px; font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--oro-0);
  text-shadow: 0 0 20px rgba(243, 207, 127, .45);
}
.unidad span {
  display: block;
  margin-top: 7px;
  font-size: 9.5px; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--lavanda);
  opacity: .75;
}
/* el segundero late para que se note que está corriendo */
.unidad.segundos b { animation: latido-seg 1s ease-in-out infinite; }
@keyframes latido-seg {
  0%, 100% { opacity: 1; }
  55%      { opacity: .62; }
}

/* Cuando solo faltan horas, los números crecen */
.cuenta.corta .unidad b { font-size: 36px; }

/* =========================================================================
   EL SOBRE LACRADO
   ========================================================================= */

.escena-sobre { text-align: center; }

.sobre {
  position: relative;
  width: 250px; height: 168px;
  margin: 26px auto 30px;
  filter: drop-shadow(0 22px 30px rgba(3, 1, 10, .55));
  animation: sobre-flota 5.5s ease-in-out infinite;
}
@keyframes sobre-flota {
  0%, 100% { transform: translateY(0) rotate(-.6deg); }
  50%      { transform: translateY(-9px) rotate(.6deg); }
}

.sobre-cuerpo {
  position: absolute; inset: 0;
  background: linear-gradient(165deg, #55307f, #3a1d61 60%, #2e1650);
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px rgba(243, 207, 127, .25);
}

/* La cartita que se asoma al abrir */
.carta-asomada {
  position: absolute; left: 22px; right: 22px; top: 16px;
  height: 120px;
  background: linear-gradient(180deg, var(--papel), var(--papel-2));
  border-radius: 5px;
  padding: 16px 15px 0;
  transform: translateY(24px);
  z-index: 1;
  transition: transform 1s cubic-bezier(.2, .9, .3, 1.1) .75s;
}
.linea-tinta {
  display: block; height: 4px; border-radius: 2px;
  background: rgba(90, 62, 128, .4);
  margin-bottom: 9px;
}
.linea-tinta.ancha { width: 55%; background: rgba(90, 62, 128, .6); }
.linea-tinta.corta { width: 70%; }

/* Bolsillo del sobre (los dos triángulos de abajo) */
.sobre-bolsillo {
  position: absolute; inset: 0; z-index: 2;
  background: linear-gradient(165deg, #5d3689, #40216a 55%, #331a56);
  clip-path: polygon(0 0, 50% 62%, 100% 0, 100% 100%, 0 100%);
  border-radius: 10px;
  box-shadow: inset 0 -1px 0 rgba(243, 207, 127, .2);
}

/* La tapa que se abre */
.sobre-tapa {
  position: absolute; left: 0; right: 0; top: 0;
  height: 62%;
  background: linear-gradient(190deg, #6a3f9c, #4a2879 70%);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  border-radius: 10px 10px 0 0;
  transform-origin: top center;
  z-index: 3;
  transition: transform .9s cubic-bezier(.5, 0, .3, 1) .28s, z-index 0s .7s;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16);
}

/* El sello de cera dorada con el corazón */
.sello {
  position: absolute;
  left: 50%; top: 58%;
  width: 52px; height: 52px;
  transform: translate(-50%, -50%);
  z-index: 4;
  border-radius: 47% 53% 51% 49% / 52% 48% 52% 48%;
  background: radial-gradient(circle at 34% 28%, var(--oro-0), var(--oro-1) 42%, var(--oro-2) 78%, var(--oro-3));
  box-shadow:
    0 3px 10px rgba(0, 0, 0, .45),
    inset 0 -2px 5px rgba(110, 70, 15, .5),
    inset 0 2px 4px rgba(255, 246, 214, .8),
    0 0 22px rgba(255, 217, 138, .35);
  display: grid; place-items: center;
  transition: transform .5s ease, opacity .45s ease;
}
.sello-corazon {
  width: 24px; height: 24px;
  fill: rgba(110, 70, 15, .55);
  filter: drop-shadow(0 1px 0 rgba(255, 240, 200, .5));
}
.sello-grieta {
  position: absolute; inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(115deg, transparent 46%, rgba(60, 30, 5, .8) 48%, transparent 50%),
    linear-gradient(75deg, transparent 55%, rgba(60, 30, 5, .7) 57%, transparent 59%);
  opacity: 0;
  transition: opacity .18s ease;
}

/* Chispas que saltan cuando el sello truena */
.destello {
  position: absolute;
  left: 50%; top: 58%;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--oro-0);
  box-shadow: 0 0 10px var(--oro-1);
  opacity: 0; z-index: 5;
  pointer-events: none;
}

/* --------------- LA SECUENCIA DE APERTURA --------------- */
.sobre.abierto { animation: none; }
.sobre.abierto .sello {
  transform: translate(-50%, -50%) scale(1.25) rotate(10deg);
  opacity: 0;
}
.sobre.abierto .sello .sello-grieta { opacity: 1; }
.sobre.abierto .sobre-tapa { transform: rotateX(180deg) ; z-index: 1; }
.sobre.abierto .carta-asomada { transform: translateY(-58px); }
.sobre.abierto .destello { animation: destello-salta .7s ease-out .2s both; }
.sobre.abierto .destello.d2 { animation-delay: .26s; --dx: -46px; --dy: -38px; }
.sobre.abierto .destello.d3 { animation-delay: .32s; --dx: 40px;  --dy: -48px; }
.sobre.abierto .destello.d1 { --dx: 8px; --dy: -60px; }
@keyframes destello-salta {
  0%   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% + var(--dy, -50px))) scale(.3); }
}

/* Al final, todo el sobre se va hacia la cámara */
.sobre.abierto.zoom {
  transition: transform .8s cubic-bezier(.6, 0, .8, 1), opacity .7s ease .1s;
  transform: scale(2.4) translateY(12px);
  opacity: 0;
}
.zona-clave { transition: opacity .5s ease; }
.zona-clave.desvanece { opacity: 0; pointer-events: none; }

/* =========================================================================
   EL PAPEL DE LA CARTA
   ========================================================================= */

.papel {
  position: relative;
  background:
    /* vetas del papel */
    repeating-linear-gradient(3deg, transparent 0 26px, rgba(150, 120, 80, .045) 26px 27px),
    repeating-linear-gradient(92deg, transparent 0 34px, rgba(150, 120, 80, .035) 34px 35px),
    linear-gradient(168deg, #fbf4e4 0%, var(--papel) 40%, var(--papel-2) 100%);
  color: var(--tinta);
  border-radius: 6px;
  padding: 40px 28px 30px;
  transform: rotate(-.7deg);
  box-shadow:
    0 2px 4px rgba(20, 8, 40, .3),
    0 18px 44px rgba(3, 1, 10, .55),
    0 34px 80px rgba(3, 1, 10, .35);
}
/* Orilla superior como rasgada, con máscara de zigzag suave */
.papel::before {
  content: "";
  position: absolute; left: 0; right: 0; top: -7px; height: 8px;
  background: inherit;
  clip-path: polygon(0 100%, 2% 40%, 5% 75%, 9% 30%, 13% 70%, 18% 35%, 23% 80%, 28% 30%, 34% 65%, 40% 25%, 46% 70%, 52% 35%, 58% 75%, 64% 30%, 70% 68%, 76% 28%, 82% 72%, 88% 38%, 93% 70%, 97% 35%, 100% 100%);
}

/* La cinta dorada que lo detiene, arriba */
.cinta {
  position: absolute;
  top: -14px; left: 50%;
  width: 92px; height: 26px;
  transform: translateX(-50%) rotate(1.6deg);
  background: linear-gradient(100deg, rgba(243, 207, 127, .92), rgba(217, 161, 59, .88));
  opacity: .92;
  box-shadow: 0 2px 6px rgba(20, 8, 40, .3);
  clip-path: polygon(4% 0, 96% 6%, 100% 94%, 0 100%);
}

.carta-cuerpo {
  font-family: var(--serif);
  font-size: 19.5px;
  line-height: 1.74;
  color: var(--tinta);
  text-align: left;
  min-height: 40px;
}
.carta-cuerpo p { margin: 0 0 15px; }
.carta-cuerpo p:first-letter { font-size: 1.35em; color: #6a4595; }
/* pluma que parpadea mientras se escribe */
.carta-cuerpo p.escribiendo::after {
  content: "";
  display: inline-block;
  width: 2px; height: 1em;
  margin-left: 2px;
  vertical-align: -2px;
  background: var(--tinta);
  animation: pluma 1s steps(2) infinite;
}
@keyframes pluma { 50% { opacity: 0; } }

.firma {
  font-family: var(--script);
  font-size: 33px;
  color: #7a4f2a;
  text-align: right;
  margin: 10px 4px 0 0;
  opacity: 0; transform: translateY(8px) rotate(-2deg);
  transition: opacity 1.1s ease, transform 1.1s ease;
}
.firma.visible { opacity: 1; transform: rotate(-2deg); }

.pista-toque {
  font-size: 11px; letter-spacing: .04em;
  color: rgba(90, 62, 128, .45);
  text-align: center; margin: 16px 0 0;
  font-style: italic;
}

/* Sello chiquito de cera en la esquina del papel */
.sello-papel {
  position: absolute;
  right: 18px; bottom: -16px;
  width: 44px; height: 44px;
  border-radius: 47% 53% 51% 49% / 52% 48% 52% 48%;
  background: radial-gradient(circle at 34% 28%, var(--oro-0), var(--oro-1) 42%, var(--oro-2) 80%, var(--oro-3));
  box-shadow: 0 4px 10px rgba(20, 8, 40, .4), inset 0 -2px 4px rgba(110, 70, 15, .5), inset 0 2px 3px rgba(255, 246, 214, .8);
  display: grid; place-items: center;
  transform: rotate(-8deg);
}
.sello-papel svg { width: 19px; height: 19px; fill: rgba(110, 70, 15, .55); }

/* =========================================================================
   CAMPOS Y BOTONES
   ========================================================================= */

.campo {
  width: 100%;
  font-family: var(--sans);
  font-size: 17px; font-weight: 600;
  color: #fff; text-align: center;
  background: rgba(13, 6, 24, .5);
  border: 1px solid rgba(207, 179, 242, .3);
  border-radius: 14px;
  padding: 15px 16px;
  outline: none;
  transition: border-color .25s, box-shadow .25s;
}
.campo::placeholder { color: rgba(220, 200, 250, .38); font-weight: 500; }
.campo:focus {
  border-color: var(--oro-1);
  box-shadow: 0 0 0 4px rgba(243, 207, 127, .15), 0 0 24px rgba(243, 207, 127, .12);
}

.boton {
  position: relative;
  display: block; width: 100%;
  font-family: var(--sans);
  font-size: 15.5px; font-weight: 700; letter-spacing: .04em;
  border: none; border-radius: 99px;
  padding: 16px 20px; margin-top: 14px;
  cursor: pointer;
  transition: transform .18s cubic-bezier(.34, 1.56, .64, 1), box-shadow .25s, filter .25s;
  overflow: hidden;
}
.boton:active { transform: scale(.96); }

.boton.principal {
  color: #2d1449;
  background: linear-gradient(160deg, var(--oro-0), var(--oro-1) 45%, var(--oro-2));
  box-shadow:
    0 10px 26px rgba(217, 161, 59, .3),
    inset 0 1px 0 rgba(255, 250, 230, .9),
    inset 0 -2px 4px rgba(154, 107, 30, .35);
  text-shadow: 0 1px 0 rgba(255, 246, 214, .6);
}
.boton.principal:hover { filter: brightness(1.05); }
/* destello que barre el botón de vez en cuando */
.boton.principal::after {
  content: "";
  position: absolute; top: -20%; bottom: -20%;
  left: -35%; width: 26%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .75), transparent);
  transform: skewX(-18deg);
  animation: barrido 4.6s ease-in-out infinite;
}
@keyframes barrido {
  0%, 74% { left: -35%; opacity: 0; }
  80%     { opacity: 1; }
  95%, 100% { left: 115%; opacity: 0; }
}

.boton.secundario {
  color: var(--lavanda-2);
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(243, 207, 127, .3);
}
.boton.secundario:hover { background: rgba(255, 255, 255, .12); }

/* Botones cuando viven sobre el papel */
.boton.en-papel.principal { box-shadow: 0 8px 20px rgba(122, 79, 42, .35), inset 0 1px 0 rgba(255,250,230,.9); }
.boton.secundario.en-papel {
  color: #6a4595;
  background: rgba(106, 69, 149, .08);
  border-color: rgba(106, 69, 149, .35);
}

/* =========================================================================
   LA PISTA
   ========================================================================= */

.marco-pista {
  position: relative;
  margin: 4px 0 20px;
  padding: 22px 20px 18px;
  background: rgba(13, 6, 24, .38);
  border: 1px solid rgba(243, 207, 127, .22);
  border-radius: 16px;
}
.comilla {
  position: absolute;
  top: -6px; left: 12px;
  font-family: var(--serif);
  font-size: 58px; line-height: 1;
  color: rgba(243, 207, 127, .5);
}
.pista-texto {
  font-family: var(--serif);
  font-style: italic;
  font-size: 21.5px;
  line-height: 1.62;
  color: #fdf9ee;
  margin: 0;
  text-align: center;
}

.puntos { display: flex; gap: 9px; justify-content: center; margin: 2px 0 10px; }
.punto {
  width: 8px; height: 8px;
  transform: rotate(45deg);
  background: rgba(255, 255, 255, .18);
  transition: background .35s, box-shadow .35s;
}
.punto.lleno {
  background: var(--oro-1);
  box-shadow: 0 0 10px rgba(243, 207, 127, .8);
}

.aviso-suave {
  font-size: 14px; line-height: 1.6;
  color: var(--lavanda-2);
  margin: 16px 0 0; opacity: .85;
}

/* =========================================================================
   LA PREGUNTA
   ========================================================================= */

.pregunta-texto {
  font-family: var(--serif);
  font-size: 23px; line-height: 1.5;
  margin: 2px 0 14px;
  color: #fdf9ee;
}
.aviso {
  min-height: 22px;
  font-size: 14px; line-height: 1.55;
  margin: 14px 0 0;
  white-space: pre-line;
}
.aviso.bien { color: #9fe8bd; text-shadow: 0 0 14px rgba(120, 230, 170, .3); }
.aviso.mal  { color: #ffb8c2; }

.error { min-height: 20px; font-size: 13.5px; color: #ffb8c2; margin: 12px 0 0; }

/* =========================================================================
   EL CASTIGO — anillo de oro que se va llenando
   ========================================================================= */

.anillo {
  --avance: 0;
  position: relative;
  width: 172px; height: 172px;
  margin: 6px auto 18px;
  display: grid; place-items: center;
}
.anillo svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.anillo .riel {
  fill: none;
  stroke: rgba(255, 255, 255, .12);
  stroke-width: 5;
}
.anillo .avance {
  fill: none;
  stroke: url(#oro-anillo);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 439.8;
  stroke-dashoffset: calc(439.8 * (1 - var(--avance)));
  filter: drop-shadow(0 0 6px rgba(243, 207, 127, .7));
  transition: stroke-dashoffset .4s linear;
}
.reloj {
  font-size: 40px; font-weight: 700;
  letter-spacing: .04em;
  font-variant-numeric: tabular-nums;
  color: var(--oro-0);
  text-shadow: 0 0 26px rgba(243, 207, 127, .5);
}

.fragmento {
  font-family: var(--serif);
  font-style: italic;
  font-size: 18.5px; line-height: 1.68;
  text-align: left;
  color: #fdf9ee;
  background: rgba(13, 6, 24, .38);
  border: 1px solid rgba(243, 207, 127, .25);
  border-radius: 16px;
  padding: 20px 19px;
  margin: 4px 0 0;
  animation: fragmento-revela 1.6s ease both;
}
@keyframes fragmento-revela {
  from { opacity: 0; transform: translateY(16px); filter: blur(8px); }
  to   { opacity: 1; transform: none; filter: none; }
}
.listo-texto { color: #9fe8bd; font-size: 15px; margin: 18px 0 0; }

/* =========================================================================
   LA CELEBRACIÓN
   ========================================================================= */

.tarjeta.centrada { padding-top: 36px; }
.regalo-caja { width: 84px; margin: 0 auto 8px; animation: regalo-brinca 1.6s ease-in-out infinite; }
.regalo-caja svg { width: 100%; height: auto; }
.rc-base   { fill: #5d3689; stroke: rgba(243, 207, 127, .5); stroke-width: 1; }
.rc-tapa   { fill: #6a3f9c; stroke: rgba(243, 207, 127, .5); stroke-width: 1; }
.rc-liston { fill: var(--oro-1); }
.rc-mono   { fill: none; stroke: var(--oro-1); stroke-width: 2.4; }
@keyframes regalo-brinca {
  0%, 100% { transform: translateY(0) rotate(-2.5deg); }
  50%      { transform: translateY(-12px) rotate(2.5deg); }
}

/* =========================================================================
   TEMBLOR (respuesta equivocada)
   ========================================================================= */

.temblor { animation: temblor .45s ease; }
@keyframes temblor {
  0%, 100% { transform: translateX(0); }
  18% { transform: translateX(-10px) rotate(-.4deg); }
  36% { transform: translateX(9px) rotate(.4deg); }
  54% { transform: translateX(-6px); }
  72% { transform: translateX(4px); }
}
/* el papel tiembla sin perder su inclinación */
.papel.temblor { animation: temblor-papel .45s ease; }
@keyframes temblor-papel {
  0%, 100% { transform: rotate(-.7deg) translateX(0); }
  25% { transform: rotate(-.7deg) translateX(-9px); }
  55% { transform: rotate(-.7deg) translateX(7px); }
  80% { transform: rotate(-.7deg) translateX(-4px); }
}

.oculto { display: none !important; }

/* =========================================================================
   BARRA DE MODO PRUEBA
   ========================================================================= */

#barra-prueba {
  position: fixed; top: 0; left: 0; right: 0; z-index: 99;
  display: flex; gap: 8px; align-items: center; justify-content: center;
  padding: 7px;
  background: rgba(243, 207, 127, .95);
  color: #2d1449; font-size: 12px; font-weight: 700;
}
#barra-prueba button {
  font-family: var(--sans); font-size: 11.5px; font-weight: 700;
  border: none; border-radius: 99px; padding: 5px 12px;
  background: #2d1449; color: var(--oro-0); cursor: pointer;
}

/* =========================================================================
   PANTALLAS CHICAS Y ACCESIBILIDAD
   ========================================================================= */

@media (max-height: 720px) {
  .script-oro { font-size: 38px; }
  .sobre { width: 210px; height: 142px; margin: 18px auto 22px; }
  .carta-asomada { height: 100px; top: 13px; }
  .sobre.abierto .carta-asomada { transform: translateY(-48px); }
  .tarjeta { padding: 24px 20px; }
  .papel { padding: 32px 22px 26px; }
  .anillo { width: 148px; height: 148px; }
  .reloj { font-size: 34px; }
  .luna { width: 56px; height: 56px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
