/* ==========================================================================
   Abridor «Press Start»
   Pantalla de arranque retro: cielo de estrellas, sol con franjas, una
   cuadrícula en perspectiva que avanza y líneas de televisor encima.
   Solo transform y opacity en lo que se mueve.
   ========================================================================== */

.ab-ps {
    position: fixed; inset: 0; z-index: 2000; overflow: hidden;
    display: grid; place-items: center; text-align: center;
    background: radial-gradient(ellipse at 50% 110%, rgb(var(--inv-primario-rgb) / .45), transparent 60%), #07051a;
    color: #fff; font-family: var(--inv-fuente-titulos);
}

/* Estrellas: dos capas de puntos que titilan a destiempo */
.ab-ps__cielo, .ab-ps__cielo::after {
    position: absolute; inset: 0 0 45%;
    background-image:
        radial-gradient(1.5px 1.5px at 12% 22%, #fff 99%, transparent),
        radial-gradient(1px 1px at 28% 58%, #fff 99%, transparent),
        radial-gradient(2px 2px at 44% 12%, #fff 99%, transparent),
        radial-gradient(1px 1px at 63% 40%, #fff 99%, transparent),
        radial-gradient(1.5px 1.5px at 78% 18%, #fff 99%, transparent),
        radial-gradient(1px 1px at 90% 62%, #fff 99%, transparent),
        radial-gradient(1.5px 1.5px at 6% 70%, #fff 99%, transparent);
    animation: ab-ps-titilar 3s steps(2) infinite;
}
.ab-ps__cielo::after { content: ""; inset: 0; transform: translate(9%, 13%); animation-delay: -1.5s; opacity: .7; }
@keyframes ab-ps-titilar { 50% { opacity: .35; } }

/* El sol con franjas, detrás del horizonte */
.ab-ps__sol {
    /* Medio sol: el centro en el horizonte y la mitad de abajo recortada. */
    position: absolute; left: 50%; bottom: 40%; width: min(64vw, 300px); aspect-ratio: 1; transform: translate(-50%, 50%);
    border-radius: 50%; clip-path: inset(0 0 50% 0);
    background: linear-gradient(var(--inv-acento), var(--inv-primario));
    -webkit-mask: repeating-linear-gradient(#000 0 14px, transparent 14px 18px) 0 50% / 100% 100% no-repeat, linear-gradient(#000 0 50%, transparent 50%);
    -webkit-mask-composite: source-in; mask-composite: intersect;
    mask: repeating-linear-gradient(#000 0 14px, transparent 14px 18px), linear-gradient(#000 0 50%, transparent 50%);
    filter: drop-shadow(0 0 30px rgb(var(--inv-primario-rgb) / .8));
    opacity: .6;
}

/* La cuadrícula del suelo, en perspectiva y avanzando */
.ab-ps__suelo {
    position: absolute; left: -50%; right: -50%; bottom: 0; height: 40%;
    background:
        linear-gradient(transparent 0 calc(100% - 2px), rgb(var(--inv-primario-rgb) / .9) calc(100% - 2px)) 0 0 / 100% 40px,
        linear-gradient(90deg, transparent 0 calc(100% - 2px), rgb(var(--inv-primario-rgb) / .9) calc(100% - 2px)) 0 0 / 60px 100%;
    transform: perspective(300px) rotateX(62deg); transform-origin: 50% 0;
    animation: ab-ps-avanzar 1.2s linear infinite;
    -webkit-mask: linear-gradient(transparent, #000 35%); mask: linear-gradient(transparent, #000 35%);
}
@keyframes ab-ps-avanzar { to { background-position: 0 40px, 0 0; } }

/* Líneas de televisor */
.ab-ps__lineas {
    position: absolute; inset: 0; pointer-events: none; z-index: 3;
    background: repeating-linear-gradient(rgb(0 0 0 / .22) 0 1px, transparent 1px 3px);
    animation: ab-ps-parpadeo 6s steps(1) infinite;
}
@keyframes ab-ps-parpadeo { 0%, 96%, 100% { opacity: 1; } 97% { opacity: .6; } }

.ab-ps__pantalla { position: relative; z-index: 2; display: grid; justify-items: center; gap: 1.4rem; padding: 0 1.2rem; transform-origin: 50% 50%; }

.ab-ps__encabezado { margin: 0; font-size: .8rem; letter-spacing: .25em; text-transform: uppercase; color: var(--inv-acento); }

.ab-ps__titulo { margin: 0; display: grid; gap: .9rem; justify-items: center; }
.ab-ps__nombre {
    font: 700 clamp(2.6rem, 14vw, 4.8rem)/1.05 var(--inv-fuente-caligrafia); color: #fff; text-transform: uppercase;
    text-shadow: 3px 3px 0 var(--inv-primario), 6px 6px 0 rgb(0 0 0 / .5);
    max-width: 92vw; overflow-wrap: anywhere;
}
.ab-ps__nivel {
    font-size: 1rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #07051a;
    background: var(--inv-acento); padding: .55rem .8rem;
    box-shadow: 0 0 0 3px #07051a, 0 0 0 6px var(--inv-acento);
}

.ab-ps__carga { width: min(78vw, 320px); display: grid; gap: .55rem; }
.ab-ps__carga-texto { margin: 0; display: flex; justify-content: space-between; gap: 1rem; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: rgb(255 255 255 / .8); }
.ab-ps__barra { height: 18px; padding: 3px; border: 3px solid #fff; }
.ab-ps__barra i {
    display: block; height: 100%; width: 0;
    background: repeating-linear-gradient(90deg, var(--inv-acento) 0 10px, transparent 10px 13px);
}

.ab-ps__boton {
    font: inherit; font-weight: 700; font-size: clamp(1.15rem, 5vw, 1.4rem); letter-spacing: .12em; text-transform: uppercase; cursor: pointer;
    color: #fff; background: transparent; border: 0; padding: 1rem 1.4rem;
    text-shadow: 0 0 12px var(--inv-primario);
    animation: ab-ps-press 1s steps(1) infinite;
}
.ab-ps__boton span::before { content: "▶ "; color: var(--inv-acento); }
.ab-ps__boton:focus-visible { outline: 3px solid var(--inv-acento); }
@keyframes ab-ps-press { 50% { opacity: 0; } }

.ab-ps__pie { margin: 0; font-size: .8rem; letter-spacing: .2em; color: rgb(255 255 255 / .55); }

@media (prefers-reduced-motion: reduce) {
    .ab-ps__cielo, .ab-ps__cielo::after, .ab-ps__suelo, .ab-ps__lineas, .ab-ps__boton { animation: none; }
}
