/* =========================================
   RESETEO BÁSICO PARA PÁGINA DE ESPERA
   ========================================= */
body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden; /* Esto evita que salgan barras de scroll */
    background-color: #031424;
}

/* =========================================
   PRELOADER INFINITO
   ========================================= */
/* =========================================
   PRELOADER INFINITO (A prueba de balas)
   ========================================= */
#preloader-infinito {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    
    /* TU FONDO */
    background-image: url('img/fondoazul.webp'); 
    background-size: cover;
    background-position: center;
    background-color: #031424; 
    z-index: 10;
}
/* El logo centrado con su latido eterno */
.logo-preloader {
    width: 250px; /* Ajusta este valor según el tamaño de tu logo */
    position: relative;
    z-index: 2;
    /* Sombrilla para que resalte del fondo */
    filter: drop-shadow(0px 4px 15px rgba(0, 0, 0, 0.4));
    
    /* Animación de latido suave */
    animation: latido 2s ease-in-out infinite;
}

@keyframes latido {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* EL EFECTO DE RUIDO DE TV ANALÓGICA */
.ruido-tv {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200vh;
    z-index: 1;
    
    /* El truco del SVG codificado en la misma URL */
    background-image: url('data:image/svg+xml;charset=utf-8,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noiseFilter"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noiseFilter)"/%3E%3C/svg%3E');
    
    opacity: 0.6; /* Intensidad del ruido */
    mix-blend-mode: multiply; /* Contrasta los granitos oscuros con el fondo */
    
    pointer-events: none;
    /* La animación infinita que le da vida a la estática */
    animation: ruido-animacion 0.2s infinite;
}

/* Animación que hace que la estática "tiemble" */
@keyframes ruido-animacion {
    0% { transform: translate(0, 0); }
    10% { transform: translate(-5%, -5%); }
    20% { transform: translate(-10%, 5%); }
    30% { transform: translate(5%, -10%); }
    40% { transform: translate(-5%, 15%); }
    50% { transform: translate(-10%, 5%); }
    60% { transform: translate(15%, 0); }
    70% { transform: translate(0, 10%); }
    80% { transform: translate(-15%, 0); }
    90% { transform: translate(10%, 5%); }
    100% { transform: translate(5%, 0); }
}

/* Responsive para que el logo no se vea gigante en celulares */
@media (max-width: 768px) {
    .logo-preloader {
        width: 180px;
    }
}




/* =========================================
   TEXTO MÁQUINA DE ESCRIBIR 100% CENTRADO
   ========================================= */

.contenido-centrado {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2;
    width: 100%; /* Asegura que el contenedor abarque toda la pantalla para buscar el centro real */
}

.contenedor-maquina {
    margin-top: 30px;
    
    /* LA MAGIA PARA EL CENTRADO PERFECTO: */
    display: flex;
    justify-content: center;
    align-items: center;
    white-space: nowrap; /* Prohíbe que baje a una segunda línea */
    
    /* BORRAMOS EL WIDTH FIJO QUE CAUSABA EL DESCUADRE */
}

#texto-maquina {
    color: #ffffff;
    font-family: 'Courier New', Courier, monospace; 
    font-size: 1.3rem;
    font-weight: bold;
}

/* El cuadradito/línea que titila */
.cursor-maquina {
    display: inline-block;
    width: 8px; 
    height: 1.2rem;
    background-color: #1da9b7; 
    margin-left: 2px;
    animation: parpadearCursor 0.8s step-end infinite;
}

@keyframes parpadearCursor {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}