/* ==========================================================
   Diseño "Galaxia" · Infantil (aventura espacial, personajes originales)
   panel → 3-2-1 → despegue → velocidad luz → planeta
   ========================================================== */

:root {
  --espacio: #0b1033;
  --morado: #2a1b5c;
  --naranja: #ff8a3d;
  --cian: #4fd1ff;
  --amarillo: #ffd43b;
  --rojo: #ff5a5f;
  --marino: #1d2b53;

  --s-fondo: var(--espacio);
  --s-tinta: #ffffff;
  --s-suave: rgba(255, 255, 255, .72);
  --s-acento: var(--naranja);
  --s-acento-tinta: #fff;
  --s-tarjeta: rgba(255, 255, 255, .07);
  --s-borde: rgba(79, 209, 255, .35);
  --s-radio: 26px;
  --s-sombra: 0 16px 30px -16px rgba(0, 0, 0, .6);
  --s-fuente: "Fredoka", system-ui, sans-serif;
  --s-titulo: "Fredoka", system-ui, sans-serif;
  --s-titulo-tam: clamp(2rem, 9vw, 2.6rem);
  --s-etiqueta: "Fredoka", system-ui, sans-serif;
  --s-num: "Fredoka", system-ui, sans-serif;
  --s-btn-linea-color: #fff;
}

body {
  background:
    radial-gradient(circle, rgba(255, 255, 255, .9) 0 1px, transparent 1.5px) 0 0 / 90px 90px,
    radial-gradient(circle, rgba(255, 255, 255, .6) 0 1px, transparent 1.5px) 40px 60px / 130px 130px,
    radial-gradient(circle, rgba(79, 209, 255, .7) 0 1px, transparent 1.5px) 70px 20px / 170px 170px,
    linear-gradient(180deg, var(--espacio), var(--morado) 60%, var(--espacio));
  background-attachment: fixed;
  color: #fff;
  font-family: var(--s-fuente);
}

/* ---------- Escena ---------- */
.espacio {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  background: radial-gradient(80% 60% at 50% 30%, #26357a, var(--espacio) 72%);
}
.estrellas { position: absolute; inset: 0; width: 100%; height: 100%; }

.plataforma {
  position: absolute;
  left: 0;
  right: 0;
  top: 4%;
  bottom: clamp(250px, 36svh, 300px);
  transition: opacity 1s ease;
}
.espacio.warp .plataforma, .espacio.llegado .plataforma { opacity: 0; }
.suelo {
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: 0;
  height: 16%;
  border-radius: 50% 50% 0 0 / 30% 30% 0 0;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, .08) 0 6px, transparent 7px) 0 0 / 60px 40px, linear-gradient(180deg, #4b5677, #262e4b);
}
.torre {
  position: absolute;
  left: calc(50% - clamp(78px, 22vw, 110px));
  bottom: 14%;
  width: 26px;
  height: 58%;
  border-left: 3px solid #8a96a8;
  border-right: 3px solid #8a96a8;
  background: repeating-linear-gradient(45deg, transparent 0 9px, #8a96a8 9px 11px), repeating-linear-gradient(-45deg, transparent 0 9px, #8a96a8 9px 11px);
  opacity: .9;
}
.cohete {
  position: absolute;
  left: 50%;
  bottom: 13%;
  width: clamp(78px, 21vw, 108px);
  transform: translateX(-50%);
  z-index: 3;
}
.cohete svg { display: block; width: 100%; height: auto; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .45)); }
.cohete.vibrando svg { animation: temblor .07s linear infinite; }
.cohete.despegando { transform: translate(-50%, -150vh); transition: transform 2.4s cubic-bezier(.65, 0, .85, .4); }
@keyframes temblor { 0% { transform: translate(-1px, 0); } 50% { transform: translate(1px, 1px); } 100% { transform: translate(-1px, 0); } }
.llama {
  position: absolute;
  top: 84%;
  left: 50%;
  width: 40%;
  height: 0;
  transform: translateX(-50%);
  transition: height .4s ease;
}
.cohete.encendido .llama { height: 70%; }
.llama span {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  border-radius: 50% 50% 50% 50% / 30% 30% 70% 70%;
  background: radial-gradient(ellipse at 50% 20%, #fffbe0 0 25%, var(--amarillo) 45%, var(--naranja) 70%, transparent 72%);
  transform-origin: 50% 0;
  animation: fuego .12s ease-in-out infinite alternate;
}
.llama span + span { left: 18%; right: 18%; animation-duration: .09s; background: radial-gradient(ellipse at 50% 20%, #ffffff 0 30%, #9ae6ff 60%, transparent 62%); }
@keyframes fuego { from { transform: scaleY(.85) scaleX(1.05); } to { transform: scaleY(1.15) scaleX(.92); } }

/* ---------- Panel de control ---------- */
.panel {
  position: absolute;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 14px);
  z-index: 6;
  width: min(92vw, 360px);
  padding: 14px 18px 16px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  border-radius: 24px;
  background: linear-gradient(180deg, #46516f, #262e47);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .15), 0 20px 40px rgba(0, 0, 0, .55), 0 0 0 3px #1a2036;
  text-align: center;
  transition: transform .9s cubic-bezier(.6, 0, .3, 1), opacity .9s ease;
}
.panel.oculto { transform: translate(-50%, 140%); opacity: 0; pointer-events: none; }
.panel__t { margin: 0; font-weight: 600; font-size: .74rem; letter-spacing: .24em; text-transform: uppercase; color: var(--cian); }
.panel__pantalla {
  width: 100%;
  padding: 8px 0;
  border-radius: 12px;
  background: repeating-linear-gradient(180deg, rgba(255, 255, 255, .04) 0 2px, transparent 2px 4px), #07120c;
  box-shadow: inset 0 0 14px rgba(0, 0, 0, .8), 0 0 0 2px #10161f;
  font-weight: 700;
  font-size: 2rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #7cffb2;
  text-shadow: 0 0 8px rgba(124, 255, 178, .8);
}
.panel__pantalla span.pulso { animation: pulso .9s ease; display: inline-block; }
@keyframes pulso { from { transform: scale(1.6); opacity: .3; } }
.panel__luces { display: flex; gap: 10px; }
.panel__luces i { width: 12px; height: 12px; border-radius: 50%; background: #3a4258; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .5); animation: luz 1.5s steps(1, end) infinite; }
.panel__luces i:nth-child(1) { animation-delay: 0s; --c: var(--rojo); }
.panel__luces i:nth-child(2) { animation-delay: .3s; --c: var(--amarillo); }
.panel__luces i:nth-child(3) { animation-delay: .6s; --c: #7cffb2; }
.panel__luces i:nth-child(4) { animation-delay: .9s; --c: var(--cian); }
.panel__luces i:nth-child(5) { animation-delay: 1.2s; --c: var(--naranja); }
@keyframes luz { 0%, 30% { background: var(--c); box-shadow: 0 0 10px var(--c); } 31%, 100% { background: #3a4258; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .5); } }
.boton-rojo {
  all: unset;
  width: 112px;
  height: 112px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  cursor: pointer;
  background: radial-gradient(circle at 35% 30%, #ff9a9d, var(--rojo) 50%, #c22f35);
  box-shadow: 0 0 0 7px #9aa6b8, 0 0 0 10px #59637a, 0 8px 0 10px #3a4258, 0 16px 24px 10px rgba(0, 0, 0, .45);
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .3);
  transition: transform .12s ease, box-shadow .12s ease;
  animation: llamar 1.6s ease-in-out infinite;
}
.boton-rojo:active, .boton-rojo.pulsado { transform: translateY(5px); box-shadow: 0 0 0 7px #9aa6b8, 0 0 0 10px #59637a, 0 3px 0 10px #3a4258, 0 8px 14px 10px rgba(0, 0, 0, .45); animation: none; }
.boton-rojo:focus-visible { outline: 3px solid var(--amarillo); outline-offset: 14px; }
@keyframes llamar { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.18); } }
.panel__hint { margin: 4px 0 0; font-size: .78rem; color: rgba(255, 255, 255, .65); }

/* ---------- Llegada ---------- */
.llegada {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: calc(env(safe-area-inset-top) + 30px) 16px 26svh;
  opacity: 0;
  pointer-events: none;
  transition: opacity .8s ease;
  text-align: center;
}
.espacio.llegado .llegada { opacity: 1; pointer-events: auto; }
.horizonte {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 170vw;
  max-width: 1200px;
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-50%, 92%);
  background:
    radial-gradient(circle at 30% 12%, rgba(0, 0, 0, .18) 0 4%, transparent 4.5%),
    radial-gradient(circle at 62% 8%, rgba(0, 0, 0, .15) 0 3%, transparent 3.5%),
    radial-gradient(circle at 48% 20%, rgba(255, 255, 255, .12) 0 2%, transparent 2.5%),
    radial-gradient(circle at 50% 0%, #ffb27a, #c45ad6 40%, #4b2a8f 70%);
  box-shadow: 0 0 60px rgba(196, 90, 214, .6);
  transition: transform 1.6s cubic-bezier(.2, .8, .2, 1);
  z-index: -1;
}
.espacio.llegado .horizonte { transform: translate(-50%, 82%); }
.planeta-anillos {
  position: absolute;
  top: 12%;
  right: 8%;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe08a, var(--naranja) 60%, #c2410c);
  animation: flotar 6s ease-in-out infinite;
}
.planeta-anillos::after {
  content: "";
  position: absolute;
  left: -30%;
  right: -30%;
  top: 40%;
  height: 20%;
  border-radius: 50%;
  border: 4px solid rgba(79, 209, 255, .8);
  transform: rotate(-18deg);
}
.flotador { width: min(40vw, 170px); animation: flotar 4s ease-in-out infinite; margin-top: 8px; }
.astronauta { display: block; width: 100%; height: auto; filter: drop-shadow(0 12px 18px rgba(0, 0, 0, .45)); }
.astronauta__brazo-der { transform-box: view-box; transform-origin: 108px 72px; animation: saludar 1s ease-in-out infinite alternate; }
@keyframes saludar { from { transform: rotate(-14deg); } to { transform: rotate(16deg); } }
@keyframes flotar { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-12px) rotate(4deg); } }

.titulo-mision > * { opacity: 0; transform: translateY(20px) scale(.8); }
.espacio.llegado .titulo-mision > * { animation: rebote .8s cubic-bezier(.3, 1.6, .5, 1) forwards; }
.espacio.llegado .titulo-mision > :nth-child(2) { animation-delay: .25s; }
.espacio.llegado .titulo-mision > :nth-child(3) { animation-delay: .5s; }
.espacio.llegado .titulo-mision > :nth-child(4) { animation-delay: .75s; }
@keyframes rebote { to { opacity: 1; transform: none; } }
.titulo-mision__eyebrow { margin: 0; font-weight: 600; font-size: .8rem; letter-spacing: .28em; text-transform: uppercase; color: var(--cian); }
.titulo-mision__nombre {
  margin: 0;
  font-weight: 700;
  font-size: clamp(3.4rem, 17vw, 4.6rem);
  line-height: 1;
  color: #fff;
  text-shadow: 0 4px 0 var(--naranja), 0 8px 0 #c2410c, 0 14px 20px rgba(0, 0, 0, .5);
}
.titulo-mision__nombre small { display: block; font-size: .36em; font-weight: 600; letter-spacing: .1em; text-shadow: 0 2px 0 var(--naranja); }
.titulo-mision__edad { margin: 16px 0 0; display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; }
.titulo-mision__edad span {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff3b0, var(--amarillo));
  color: var(--marino);
  font-weight: 700;
  font-size: 2.4rem;
  box-shadow: 0 0 0 5px rgba(255, 212, 59, .35), 0 0 24px rgba(255, 212, 59, .7);
}
.titulo-mision__fecha { margin: 6px 0 0; font-size: .95rem; color: rgba(255, 255, 255, .8); text-transform: capitalize; }

.espacio .desliza-c { color: #fff; z-index: 7; }

/* ---------- Secciones ---------- */
.ficha-sec { padding-top: 80px; }
.ficha {
  width: min(100%, 340px);
  overflow: hidden;
  border-radius: 26px;
  background: linear-gradient(180deg, #f4f7fb, #dfe7f1);
  color: var(--marino);
  box-shadow: 0 24px 40px -18px rgba(0, 0, 0, .7);
}
.ficha__t { margin: 0; padding: 12px 0; background: var(--naranja); color: #fff; font-weight: 700; font-size: .82rem; letter-spacing: .24em; text-transform: uppercase; }
.ficha__ventanilla {
  width: 150px;
  height: 150px;
  margin: 22px auto 10px;
  border-radius: 50%;
  padding: 10px;
  background: radial-gradient(circle, #8a96a8 0 66%, #6b7689 67%);
  box-shadow: 0 0 0 4px #59637a, inset 0 0 0 2px rgba(255, 255, 255, .3);
}
.ficha__ventanilla img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; box-shadow: inset 0 0 20px rgba(0, 0, 0, .5); }
.ficha__datos { margin: 0; padding: 4px 24px 22px; display: grid; gap: 8px; text-align: left; }
.ficha__datos div { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 6px; border-bottom: 2px dashed rgba(29, 43, 83, .15); }
.ficha__datos dt { font-size: .76rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: #6b7689; }
.ficha__datos dd { margin: 0; font-weight: 700; }
.ficha__mensaje { margin: 26px 0 0; max-width: 22em; font-size: 1.1rem; line-height: 1.6; }

.s-titulo { font-weight: 700; text-shadow: 0 3px 0 rgba(255, 138, 61, .9); }
.s-cuenta__num { font-weight: 700; color: var(--amarillo); }
.s-evento__icono { color: var(--naranja); border-color: var(--naranja); background: rgba(255, 138, 61, .1); }
.s-evento__hora { font-weight: 700; color: var(--amarillo); }
.s-vestimenta__tipo { font-weight: 700; font-size: 1.5rem; color: var(--cian); }
.s-rsvp__saludo { font-weight: 600; font-size: 1.2rem; color: var(--cian); }
.s-btn { font-weight: 700; letter-spacing: .06em; }
.s-btn--lleno { background: linear-gradient(180deg, #ffa25e, var(--naranja)); box-shadow: 0 6px 0 #c2410c, 0 14px 20px rgba(0, 0, 0, .4); }
.s-btn--lleno:active { transform: translateY(4px); box-shadow: 0 2px 0 #c2410c; }
.s-pie__n { font-weight: 700; }
.btn-musica { background: var(--marino); color: var(--amarillo); border: 2px solid var(--cian); }

@media (max-height: 640px) {
  .boton-rojo { width: 92px; height: 92px; }
  .panel__pantalla { font-size: 1.6rem; }
}
@media (prefers-reduced-motion: reduce) {
  .boton-rojo, .panel__luces i, .flotador, .planeta-anillos, .astronauta__brazo-der { animation: none !important; }
  .cohete.despegando { transition-duration: .6s; }
}
