/* =============================================================================
   ENTRADA DEL LOGO DE BOLA OCHO (portada "HACÉ CLICK PARA CONTINUAR") — 2026-11-22
   -----------------------------------------------------------------------------
   Pedido del autor: un efecto "más copado, de juego AAA". Línea de tiempo:
     0,15 s  el logo viene desde la cámara, grande y desenfocado
     0,75 s  GOLPE: aterriza (rebota un poco), fogonazo, dos ondas expansivas, sacudida y aparecen los rayos de luz detrás
     1,2 s   aparece el texto de abajo
     después flota suave, los rayos giran, le pasa un brillo cada 4,5 s y suben chispas naranjas y azules (js/ui/intro.js)
   Al hacer click (clase tg-intro-sale) el logo se va hacia la cámara mientras la portada se funde.
   Con "reducir movimiento" del sistema: solo aparece, sin golpe ni sacudida.
   ============================================================================= */

/* el logo va dentro de una caja del mismo tamaño que tenía (css/carga.css): ahí se calzan la onda y el brillo */
#intro-screen .tg-logo-caja {
    position: relative; z-index: 3;
    /* [2026-11-23] logo nuevo de Bola Ocho (sticker grafiti con transparencia, img/logo_bola_ocho.webp, 1560x1400) */
    width: min(620px, 60%); max-height: 62%; aspect-ratio: 1560 / 1400;
    margin-bottom: 7%;
    display: flex; align-items: center; justify-content: center;
    animation: tgLogoSacude .5s .75s both;
}
#intro-screen .tg-logo-caja .img-intro-chica {
    width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; object-fit: contain;
    filter: drop-shadow(0 0 18px rgba(120, 215, 255, .5)) drop-shadow(0 0 40px rgba(255, 150, 40, .25));
    animation: tgLogoEntra .9s .15s cubic-bezier(.2, .8, .25, 1) both, tgLogoFlota 5s 1.3s ease-in-out infinite;
    will-change: transform, filter, opacity;
}
@keyframes tgLogoEntra {
    0%   { transform: scale(2.4); opacity: 0; filter: blur(16px) brightness(2.2); }
    55%  { transform: scale(1.12); opacity: 1; filter: blur(5px) brightness(1.6); }
    66%  { transform: scale(.93); filter: blur(0) brightness(2) drop-shadow(0 0 30px rgba(255, 200, 90, .9)); }
    82%  { transform: scale(1.03); filter: brightness(1.15) drop-shadow(0 0 22px rgba(255, 160, 50, .6)); }
    100% { transform: scale(1); opacity: 1; filter: drop-shadow(0 0 18px rgba(120, 215, 255, .5)) drop-shadow(0 0 40px rgba(255, 150, 40, .25)); }
}
@keyframes tgLogoFlota {
    0%, 100% { transform: translateY(0) scale(1); }
    50%      { transform: translateY(-1.2%) scale(1.012); }
}
@keyframes tgLogoSacude {
    0%, 100% { transform: translate(0, 0); }
    15% { transform: translate(-1.2%, .8%); }
    30% { transform: translate(1%, -1%); }
    45% { transform: translate(-.7%, .5%); }
    60% { transform: translate(.5%, -.3%); }
    80% { transform: translate(-.2%, .1%); }
}

/* ondas expansivas del golpe */
#intro-screen .tg-logo-onda {
    position: absolute; left: 50%; top: 50%; width: 70%; aspect-ratio: 1; border-radius: 50%;
    border: 3px solid rgba(255, 215, 120, .9);
    box-shadow: 0 0 25px rgba(255, 170, 60, .8), inset 0 0 25px rgba(255, 170, 60, .5);
    transform: translate(-50%, -50%) scale(.6); opacity: 0; pointer-events: none;
    animation: tgOnda .9s .75s cubic-bezier(.1, .7, .3, 1) both;
}
#intro-screen .tg-logo-onda.dos {
    border-color: rgba(110, 190, 255, .85); box-shadow: 0 0 25px rgba(60, 150, 255, .8), inset 0 0 20px rgba(60, 150, 255, .5);
    animation-delay: .85s; animation-duration: 1.1s;
}
@keyframes tgOnda {
    0%   { transform: translate(-50%, -50%) scale(.6); opacity: 0; border-width: 6px; }   /* invisible hasta el golpe (relleno "both") */
    2%   { opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(2.6); opacity: 0; border-width: 1px; }
}

/* brillo que pasa por encima del logo (enmascarado con el mismo logo: solo brilla el dibujo) */
#intro-screen .tg-logo-brillo {
    position: absolute; inset: 0; pointer-events: none;
    -webkit-mask: url('../img/logo_bola_ocho.webp') center / contain no-repeat; mask: url('../img/logo_bola_ocho.webp') center / contain no-repeat;
    background: linear-gradient(105deg, transparent 42%, rgba(255, 255, 255, .0) 44%, rgba(255, 250, 230, .75) 50%, rgba(255, 255, 255, 0) 56%, transparent 58%);
    background-size: 280% 100%; background-repeat: no-repeat;
    mix-blend-mode: screen;
    animation: tgBrillo 4.5s 1.4s ease-in-out infinite both;
}
@keyframes tgBrillo {
    0%   { background-position: 120% 0; opacity: 1; }
    30%  { background-position: -20% 0; opacity: 1; }
    100% { background-position: -20% 0; opacity: 0; }
}

/* rayos de luz detrás del logo, giran lento */
#intro-screen .tg-intro-rayos {
    position: absolute; left: 50%; top: 44%; width: 150vmax; height: 150vmax; z-index: 2; pointer-events: none;
    transform: translate(-50%, -50%);
    background: repeating-conic-gradient(from 0deg, rgba(255, 190, 80, .13) 0deg 6deg, transparent 6deg 18deg,
                                                    rgba(80, 160, 255, .08) 18deg 22deg, transparent 22deg 36deg);
    -webkit-mask: radial-gradient(circle, #000 0%, rgba(0, 0, 0, .55) 18%, transparent 42%);
    mask: radial-gradient(circle, #000 0%, rgba(0, 0, 0, .55) 18%, transparent 42%);
    opacity: 0;
    animation: tgRayosAparecen 1s .75s ease-out forwards, tgRayosGiran 60s linear infinite;
}
@keyframes tgRayosAparecen { 0% { opacity: 0; } 25% { opacity: 1.6; } 100% { opacity: 1; } }
@keyframes tgRayosGiran { to { transform: translate(-50%, -50%) rotate(360deg); } }

/* chispas (canvas que dibuja js/ui/intro.js) */
#intro-screen .tg-intro-chispas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }

/* fogonazo del golpe y viñeta */
#intro-screen .tg-intro-fogonazo {
    position: absolute; inset: 0; z-index: 6; pointer-events: none; opacity: 0;
    background: radial-gradient(circle at 50% 44%, rgba(255, 245, 220, .95) 0%, rgba(255, 190, 90, .55) 25%, transparent 60%);
    animation: tgFogonazo .55s .75s ease-out both;
}
@keyframes tgFogonazo { 0% { opacity: 0; } 12% { opacity: 1; } 100% { opacity: 0; } }
#intro-screen .tg-intro-vineta {
    position: absolute; inset: 0; z-index: 4; pointer-events: none;
    background: radial-gradient(ellipse at 50% 45%, transparent 45%, rgba(0, 0, 0, .75) 100%);
}

/* el texto de abajo aparece después del golpe, con más estilo */
#intro-screen .contenido-intro { animation: tgTextoAparece .8s 1.2s ease-out both; }
@keyframes tgTextoAparece { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
#intro-screen .texto-continuar {
    color: #fff; letter-spacing: .14em; -webkit-text-stroke: 3px #000;
    text-shadow: 0 0 14px rgba(255, 170, 60, .85), 0 0 34px rgba(255, 120, 30, .45), 3px 3px 0 #000;
}
#intro-screen:not(.tg-intro-cargando) .texto-continuar { animation: tgTextoLate 1.6s ease-in-out infinite; }
@keyframes tgTextoLate {
    0%, 100% { opacity: .55; transform: scale(1); }
    50%      { opacity: 1; transform: scale(1.04); }
}

/* salida al hacer click: el logo se va hacia la cámara */
#intro-screen.tg-intro-sale .tg-logo-caja .img-intro-chica { animation: tgLogoSale .9s cubic-bezier(.5, 0, .9, .4) forwards; }
#intro-screen.tg-intro-sale .tg-intro-fogonazo { animation: tgFogonazo .5s ease-out both; }
@keyframes tgLogoSale {
    0%   { transform: scale(1); filter: brightness(1.4) blur(0); opacity: 1; }
    100% { transform: scale(2.2); filter: brightness(2.2) blur(10px); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    #intro-screen .tg-logo-caja, #intro-screen .tg-logo-onda, #intro-screen .tg-intro-fogonazo, #intro-screen .tg-logo-brillo { animation: none; opacity: 0; }
    #intro-screen .tg-logo-caja { opacity: 1; }
    #intro-screen .tg-logo-caja .img-intro-chica { animation: tgTextoAparece .8s both; }
    #intro-screen .tg-intro-rayos { animation: tgRayosAparecen 1s forwards; }
}
