/* ===== RESET Y ESTILOS BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===== PALETA DE COLORES GLOBAL ====  */
:root {
    --deep-blue: #0a1650;
    --classic-blue: #0a4b8c;
    --bonnie-blue: #1a6bb0;
    --frozen-blue: #8fcbff;
    --magenta: #ff00a0;
    --ambar-yellow: #ffbf00;
    --verde-fosfato: #00ff41;
}
/* ===== BODY FONT Y CARACTERISTICAS BASE ====== */
body {
    overflow-y: auto;
    overflow-x: hidden;
    font-family: 'Courier New', monospace;
    background: black;
}

/* ===== CONTENEDOR PRINCIPAL (EFECTO CRT) ===== */
.crt {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: black;
    animation: textShadow 2.6s infinite, screenFlicker 8s infinite;
}

/* ===== VIDEO DE FONDO ===== */
.background-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

/* ===== TITLE NAME CONTENT  ===== */
.content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    text-align: center;
    padding: 20px;
    font-size: 2rem;
    pointer-events: auto;
}

.content-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    pointer-events: auto;
}

.content h1 {
    animation: flicker-subtil 0.28s infinite;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.content p {
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

/* ============================================================
   GLITCH - DESACTIVA FLICKER DURANTE LA ANIMACIÓN
   ============================================================ */

.content-inner.glitch-out h1,
.content-inner.glitch-out p,
.content-inner.glitch-in h1,
.content-inner.glitch-in p {
    animation: none !important;
    text-shadow: none !important;
}

.content-inner.glitch-out {
    animation: glitch-out 0.8s steps(2, end) forwards !important;
}

.content-inner.glitch-in {
    animation: glitch-in 0.8s steps(2, end) forwards !important;
}
.content-inner.hidden {
    visibility: hidden !important;
    pointer-events: none !important;
}


/* ============================================================
   GLITCH AGRESIVO CON TEXT-SHADOW + STEPS
   ============================================================ */
@keyframes glitch-out {
    0%   { opacity: 1;   transform: skewX(0deg) translateX(0);   text-shadow: none; }
    10%  { opacity: 1;   transform: skewX(-5deg) translateX(-6px); text-shadow: 6px 0 red, -6px 0 cyan; }
    20%  { opacity: 0.9; transform: skewX(8deg) translateX(10px);  text-shadow: -10px 0 red, 10px 0 cyan; }
    30%  { opacity: 0.8; transform: skewX(-6deg) translateX(-14px); text-shadow: 14px 0 red, -14px 0 cyan; }
    40%  { opacity: 0.6; transform: skewX(10deg) translateX(20px);  text-shadow: -18px 0 red, 18px 0 cyan; }
    55%  { opacity: 0.4; transform: skewX(-8deg) translateX(-28px); text-shadow: 22px 0 red, -22px 0 cyan; }
    70%  { opacity: 0.2; transform: skewX(12deg) translateX(38px);  text-shadow: -28px 0 red, 28px 0 cyan; }
    85%  { opacity: 0.1; transform: skewX(-4deg) translateX(50px);  text-shadow: 32px 0 red, -32px 0 cyan; }
    100% { opacity: 0;   transform: skewX(0deg) translateX(65px);   text-shadow: 40px 0 red, -40px 0 cyan; }
}

@keyframes glitch-in {
    0%   { opacity: 0;   transform: skewX(0deg) translateX(-65px);  text-shadow: 40px 0 red, -40px 0 cyan; }
    15%  { opacity: 0.2; transform: skewX(-4deg) translateX(-50px); text-shadow: -32px 0 red, 32px 0 cyan; }
    30%  { opacity: 0.4; transform: skewX(8deg) translateX(-35px);  text-shadow: 28px 0 red, -28px 0 cyan; }
    45%  { opacity: 0.6; transform: skewX(-10deg) translateX(-20px); text-shadow: -22px 0 red, 22px 0 cyan; }
    60%  { opacity: 0.8; transform: skewX(6deg) translateX(-8px);   text-shadow: 14px 0 red, -14px 0 cyan; }
    75%  { opacity: 0.9; transform: skewX(-3deg) translateX(3px);   text-shadow: -8px 0 red, 8px 0 cyan; }
    90%  { opacity: 1;   transform: skewX(1deg) translateX(-1px);   text-shadow: 4px 0 red, -4px 0 cyan; }
    100% { opacity: 1;   transform: skewX(0deg) translateX(0);      text-shadow: none; }
}

/* ============================================================
   EFECTOS CRT (scanlines + vignette) DISPLAY
   ============================================================ */
.crt::before {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(255, 255, 255, 0.06) 50%);
    background-size: 100% 3px;
    z-index: 2;
    pointer-events: none;
    animation: scanlines 0.1s linear infinite;
}

.crt::after {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: rgba(18, 15, 15, 0.2);
    opacity: 0;
    z-index: 2;
    pointer-events: none;
    animation: vignette 2s ease-in-out infinite alternate;
}

@keyframes scanlines {
    0%   { background-position: 0 0; }
    100% { background-position: 0 3px; }
}

@keyframes vignette {
    0%   { opacity: 0.4; }
    100% { opacity: 0.7; }
}

/* ============================================================
   CANALES + NUMEROS 
   ============================================================ */
.channel-display {
    position: absolute;
    top: 30px;
    left: 50px;
    z-index: 3;
    font-size: 4.5rem;
    color: green;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    filter: blur(1.2px);
    text-shadow: 0 0 10px rgba(50, 255, 15, 0.6);
}

#channelNumber {
    animation: flicker-subtil 0.28s infinite;
}

/* ============================================================
   INDICADORES DE NAVEGACIÓN (◀ ▶)
   ============================================================ */
.nav-hint {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    color: rgba(255, 255, 255, 0.08);
    font-size: 3rem;
    pointer-events: none;
    user-select: none;
    transition: opacity 0.3s ease;
    font-family: 'Courier New', monospace;
}

.nav-hint.left  { left: 20px; }
.nav-hint.right { right: 20px; }

/* ============================================================
   SCROLL HINT (↓)
   ============================================================ */
.scroll-hint {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 1.5rem;
    opacity: 0.4;
    z-index: 3;
    animation: bounce 2s infinite;
    pointer-events: none;
}

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50%      { transform: translateX(-50%) translateY(8px); }
}

/* ============================================================
   SYSTEM.CSS SECTION
   ============================================================ */
.system-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: black;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.system-section.visible {
    opacity: 1;
}

.system-container {
    width: 90%;
    max-width: 680px;
    padding: 40px 0;
}

/* ============================================================
   BOTÓN
   ============================================================ */
button {
    background: var(--frozen-blue);
    color: var(--bonnie-blue);
    border: 2px solid var(--classic-blue);
    padding: 10px 20px;
    font-size: 1.2rem;
    cursor: pointer;
    margin-top: 20px;
    font-family: inherit;
    transition: 0.3s;
}

button:hover {
    background: var(--deep-blue);
    color: var(--bonnie-blue);
}

/* ===============================================================
   ANIMACIONES BASE KEYFRAMES (flicker, textShadow, screenFlicker)
   ============================================================== */
@keyframes flicker-subtil {
    0%   { opacity: 0.75; }
    5%   { opacity: 0.82; }
    10%  { opacity: 0.78; }
    15%  { opacity: 0.95; }
    20%  { opacity: 0.82; }
    25%  { opacity: 0.97; }
    30%  { opacity: 0.88; }
    35%  { opacity: 0.91; }
    40%  { opacity: 0.79; }
    45%  { opacity: 0.94; }
    50%  { opacity: 0.98; }
    55%  { opacity: 0.71; }
    60%  { opacity: 0.76; }
    65%  { opacity: 0.89; }
    70%  { opacity: 0.84; }
    75%  { opacity: 0.81; }
    80%  { opacity: 0.93; }
    85%  { opacity: 0.87; }
    90%  { opacity: 0.90; }
    95%  { opacity: 0.77; }
    100% { opacity: 0.83; }
}

@keyframes textShadow {
    5%   { text-shadow: 2.79px 0 1px rgba(0,30,255,0.5), -2.79px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
    10%  { text-shadow: 0.03px 0 1px rgba(0,30,255,0.5), -0.03px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
    15%  { text-shadow: 0.40px 0 1px rgba(0,30,255,0.5), -0.40px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
    20%  { text-shadow: 3.48px 0 1px rgba(0,30,255,0.5), -3.48px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
    25%  { text-shadow: 1.61px 0 1px rgba(0,30,255,0.5), -1.61px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
    30%  { text-shadow: 0.70px 0 1px rgba(0,30,255,0.5), -0.70px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
    35%  { text-shadow: 3.90px 0 1px rgba(0,30,255,0.5), -3.90px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
    40%  { text-shadow: 3.87px 0 1px rgba(0,30,255,0.5), -3.87px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
    45%  { text-shadow: 2.23px 0 1px rgba(0,30,255,0.5), -2.23px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
    50%  { text-shadow: 0.08px 0 1px rgba(0,30,255,0.5), -0.08px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
    55%  { text-shadow: 2.38px 0 1px rgba(0,30,255,0.5), -2.38px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
    60%  { text-shadow: 2.20px 0 1px rgba(0,30,255,0.5), -2.20px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
    65%  { text-shadow: 2.86px 0 1px rgba(0,30,255,0.5), -2.86px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
    70%  { text-shadow: 0.49px 0 1px rgba(0,30,255,0.5), -0.49px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
    75%  { text-shadow: 1.89px 0 1px rgba(0,30,255,0.5), -1.89px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
    80%  { text-shadow: 0.08px 0 1px rgba(0,30,255,0.5), -0.08px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
    85%  { text-shadow: 0.10px 0 1px rgba(0,30,255,0.5), -0.10px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
    90%  { text-shadow: 3.44px 0 1px rgba(0,30,255,0.5), -3.44px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
    95%  { text-shadow: 2.18px 0 1px rgba(0,30,255,0.5), -2.18px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
    100% { text-shadow: 2.62px 0 1px rgba(0,30,255,0.5), -2.62px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
}

@keyframes screenFlicker {
    0%, 100% { opacity: 1; }
    3%  { opacity: 0.85; }
    6%  { opacity: 1; }
    7%  { opacity: 0.9; }
    8%  { opacity: 1; }
    92% { opacity: 1; }
    95% { opacity: 0.88; }
    96% { opacity: 1; }
}

/* ============================================================
   OCULTAR SCROLLBARS (Chrome, Firefox, Safari, Edge)
   ============================================================ */
::-webkit-scrollbar {
    width: 0px;
    height: 0px;
    background: transparent;
}

* {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* ============================================================
   RESPONSIVE (MÓVIL)
   ============================================================ */
@media (max-width: 768px) {
    .channel-display {
        font-size: 2.5rem;
        top: 16px;
        left: 20px;
    }

    .content {
        font-size: 1.2rem;
        padding: 10px;
    }

    .content h1 {
        font-size: 1.8rem;
    }

    .scroll-hint {
        font-size: 1.2rem;
        bottom: 16px;
    }

    .crt::before {
        background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(255, 255, 255, 0.03) 50%);
        background-size: 100% 2px;
    }

    .nav-hint {
        display: none;
    }

    .crt {
        border-radius: 12px;
        overflow: hidden;
        margin: 8px;
        width: calc(100vw - 16px);
        height: calc(100vh - 16px);
        box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 255, 0, 0.05);
    }

    .crt::after {
        background: rgba(0, 0, 0, 0.3);
        opacity: 1;
        animation: vignette-mobile 2s ease-in-out infinite alternate;
    }
}

@keyframes vignette-mobile {
    0%   { opacity: 0.4; }
    100% { opacity: 0.7; }
}

/* ============================================================
   PANTALLAS MUY PEQUEÑAS ( < 480px )
   ============================================================ */
@media (max-width: 480px) {
    .channel-display {
        font-size: 2rem;
        top: 12px;
        left: 16px;
    }

    .content h1 {
        font-size: 1.4rem;
    }

    .content {
        font-size: 1rem;
    }

    .scroll-hint {
        font-size: 1rem;
        bottom: 12px;
    }
}
