/* La intro de Los Simpson (client/js/simpsons-intro.js): cielo azul, nubes, el título «THE SIMPSONS» que se acerca y la portada que se disuelve. Solo existe con la celebración encendida y al cargar la página.
   Los tiempos (retrasos de las animaciones) son los de la secuencia: 3 s cielo y portada que se disuelve, 3,4 s nubes, 7,4 s título, 16 s fin (T de simpsons-intro.js). Todo con transform y opacity. */
/* la pantalla de entrada: la portada de siempre con un velo y un botón «Entrar» en el centro (el gesto que deja sonar el audio) */
#sp-gate { position: fixed; inset: 0; z-index: 9000; display: flex; align-items: center; justify-content: center; background: rgba(6,16,26,.55); cursor: pointer; animation: spGateIn .6s ease-out both; }
#sp-gate button {
  font: 700 clamp(1.2rem, 3.4vw, 2rem)/1 var(--font-pixel, monospace); letter-spacing: .12em; text-transform: uppercase; color: #06260f; padding: .75em 1.9em; cursor: pointer;
  border: 3px solid #0b3a17; border-bottom-width: 6px; background: linear-gradient(180deg, #8ff08f 0%, #4cd45c 55%, #2fb043 100%);
  box-shadow: 0 0 0 3px rgba(255,255,255,.2), 0 10px 30px rgba(0,0,0,.45); animation: spPulse 1.8s ease-in-out infinite alternate;
}
#sp-gate button:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }
@keyframes spGateIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes spPulse { from { transform: scale(1); } to { transform: scale(1.05); } }
#sp-intro { position: fixed; inset: 0; z-index: 9000; overflow: hidden; pointer-events: none; contain: layout paint; }
#sp-intro.out { opacity: 0; transition: opacity 1.5s ease-in-out; }
#sp-intro .sp-sky { position: absolute; inset: 0; opacity: 0; background: linear-gradient(180deg, #2f86dc 0%, #5db4f2 48%, #a9dcfb 100%); animation: spSky 5s ease-in-out 3s forwards; }
#sp-intro .sp-clouds { position: absolute; inset: 0; opacity: 0; animation: spIn 2.5s ease-out 3.4s forwards; }
/* una nube de dibujo animado: una elipse blanca con cuatro «bultos» (sombras sin desenfoque) que se miden en em, así que escala con --w */
#sp-intro .sp-cloud {
  position: absolute; left: 0; top: var(--t); display: block; font-size: var(--w); width: 1em; height: .34em; border-radius: 50%; background: #fff; opacity: var(--o);
  box-shadow: -.27em -.07em 0 -.06em #fff, .22em -.1em 0 -.02em #fff, -.02em -.17em 0 -.02em #fff, .4em .01em 0 -.1em #fff, -.4em .02em 0 -.11em #fff;
  will-change: transform; animation: spCloud var(--d) linear var(--s) infinite;
}
#sp-intro .sp-title {
  position: absolute; left: 50%; top: 46%; margin: 0; opacity: 0; text-align: center; white-space: nowrap; line-height: .88; text-transform: uppercase;
  font-family: "Arial Rounded MT Bold", "Trebuchet MS", "Segoe UI", Verdana, sans-serif; font-weight: 900; color: #ffd90f; letter-spacing: .01em;
  -webkit-text-stroke: .13em #7a3d00; paint-order: stroke fill;
  text-shadow: 0 .05em 0 #b86a00, 0 .1em 0 #8a4a00, 0 .17em .2em rgba(60,30,0,.4);
  transform-origin: 50% 50%; will-change: transform, opacity; animation: spZoom 8.6s cubic-bezier(.16,.7,.3,1) 7.4s forwards;
}
#sp-intro .sp-title span { color: inherit; }          /* (style.css pinta de verde los span de un h1) */
#sp-intro .sp-the { display: block; font-size: clamp(1.6rem, 6vw, 4.2rem); margin-bottom: .1em; }
#sp-intro .sp-name { display: block; font-size: clamp(2.6rem, 12.5vw, 9.4rem); }
#sp-intro .sp-hint {
  position: absolute; left: 0; right: 0; bottom: max(14px, 3vh); margin: 0; text-align: center; opacity: 0; padding: 0 16px;
  font: 700 clamp(.78rem, 1.8vw, 1rem)/1.3 var(--font-body, sans-serif); letter-spacing: .04em; color: #fff; text-shadow: 0 1px 3px rgba(0,40,90,.8), 0 0 12px rgba(0,40,90,.55);
  animation: spHint .8s ease-out 1.2s forwards;
}
/* «IslaKraft» y el resto de la portada de siempre se disuelven mientras el cielo se vuelve azul */
body.sp-intro #overlay.landing .land, body.sp-intro #overlay.landing .live { animation: spDissolve 3.4s ease-in 3.2s forwards; }
@keyframes spSky { from { opacity: 0; } to { opacity: 1; } }
@keyframes spIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes spCloud { from { transform: translate3d(110vw, 0, 0); } to { transform: translate3d(-130%, 0, 0); } }
@keyframes spZoom {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.22); }
  9% { opacity: 1; }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1.22); }
}
@keyframes spHint { from { opacity: 0; } to { opacity: .85; } }
@keyframes spDissolve { from { opacity: 1; } to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { #sp-intro { display: none; } #sp-gate, #sp-gate button { animation: none; } }
