/* =================================================================== */
/* 1. ESTILOS GLOBALES Y CONFIGURACIÓN BASE                            */
/* =================================================================== */

body {
    background-color: #000000;
    margin: 0;
    height: 100vh;
    font-family: 'Press Start 2P', cursive;
    overflow: hidden;
}

.pantalla {
    position: relative;
    width: 100%;
    height: 100%;
}

/* =================================================================== */
/* 2. TEXTO "COMING SOON" Y ANIMACIÓN DE CARGA                         */
/* =================================================================== */

.contenedor-central {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    white-space: nowrap; 
}

.texto-pixel-animado {
    font-family: 'Press Start 2P', cursive;
    font-size: 2em; 
    text-align: center;
    color: #444444;
    position: relative; 
    overflow: hidden; 
    max-width: 90vw;
    margin: 0 auto; 
}

.texto-pixel-animado::before {
    content: "Coming Soon"; 
    position: absolute;
    top: 0;
    left: 0;
    color: #FF0000; 
    text-shadow: 0 0 7px #FFFFF, 0 0 10px #FF0000; 
    width: 0;
    height: 100%;
    animation: llenar-texto 3s linear infinite; 
    overflow: hidden; 
    white-space: nowrap; 
}

@keyframes llenar-texto {
    0% { width: 0; }
    100% { width: 100%; }
}

/* =================================================================== */
/* 3. LOGO PRINCIPAL (IMGLG.PNG) Y ANIMACIÓN DE RESPLANDOR             */
/* =================================================================== */

.logo-principal {
    position: absolute;
    /* Centrado horizontal: siempre en el 50% y transform para corregir el punto de anclaje */
    left: 50%; 
    transform: translateX(-50%); 
    
    top: 15vh; 
    z-index: 0; 
    max-width: 30vw;
    height: auto;
    image-rendering: pixelated; 
    animation: resplandor 10s ease-in-out infinite alternate;
}

@keyframes resplandor {
    0% {
        opacity: 0.7;
        filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0));
    }
    50% {
        opacity: 1;
        filter: drop-shadow(0 0 15px #FF0000);
    }
    100% {
        opacity: 0.7;
        filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0));
    }
}

/* =================================================================== */
/* 4. PERSONAJES ANIMADOS Y POSICIONAMIENTO CERCANO (ESCRITORIO)       */
/* =================================================================== */

.personaje {
    position: absolute; 
    image-rendering: pixelated; 
    animation: movimiento-lento 6s ease-in-out infinite alternate; 
    z-index: 10; 
}

/* Posicionamiento cerca del centro (5% del borde) */
.arriba-izquierda { top: 20%; left: 20%; animation-delay: 0s; }
.abajo-derecha { bottom: 20%; right: 20%; animation-delay: 1.5s; }
.arriba-derecha { top: 20%; right: 20%; animation-delay: 3s; }
.abajo-izquierda { bottom: 20%; left: 20%; animation-delay: 4.5s; }

@keyframes movimiento-lento {
    0% { transform: translate(0, 0); } 
    50% { transform: translate(5px, 5px); } 
    100% { transform: translate(0, 0); } 
}

/* =================================================================== */
/* 5. MEDIA QUERIES PARA DISPOSITIVOS MÓVILES (SOLUCIÓN FINAL)         */
/* =================================================================== */

@media (max-width: 768px) {
    
    /* CORRECCIÓN CLAVE: Asegurar el centrado horizontal del logo en móvil */
    .logo-principal {
        left: 50%; 
        transform: translateX(-50%); 
        max-width: 40vw; 
        top: 8vh; 
    }
    
    /* Reducir tamaño de fuente en móvil */
    .texto-pixel-animado {
        font-size: 1.5em; 
    }

    /* Reducir tamaño de los personajes para evitar solapamiento */
    .personaje {
        width: 80px; 
        height: auto;
        animation: movimiento-lento 4s ease-in-out infinite alternate; 
    }

    /* Reposicionar los personajes más hacia las esquinas para dejar espacio al centro */
    .arriba-izquierda { top: 22%; left: 12%; }
    .abajo-derecha { bottom: 22%; right: 12%; }
    .arriba-derecha { top: 22%; right: 12%; }
    .abajo-izquierda { bottom: 22%; left: 12%; }
}

@media (max-width: 480px) {
    .logo-principal {
        top: 5vh; 
    }
    .texto-pixel-animado {
        font-size: 1.2em; 
    }
    .personaje {
        width: 60px;
    }
}