/* ===== ANIMATION INTRO TV VINTAGE ===== */
.tv-intro-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #1a1a1a; /* Gris foncé au lieu de noir */
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.tv-intro-overlay.hidden {
    display: none;
}

/* Effet d'allumage de TV */
.tv-screen {
    width: 100%;
    height: 100%;
    background: 
        /* Texture de grille TV subtile */
        linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.02) 1px,
            transparent 1px
        ),
        linear-gradient(
            0deg,
            rgba(255, 255, 255, 0.02) 1px,
            transparent 1px
        ),
        /* Fond gris avec dégradé */
        radial-gradient(
            ellipse at center,
            #2a2a2a 0%,
            #1a1a1a 70%,
            #0a0a0a 100%
        ),
        /* Moiré TV subtil */
        repeating-radial-gradient(
            circle at 50% 50%,
            transparent 0,
            rgba(40, 40, 50, 0.1) 1px,
            transparent 2px
        );
    background-size: 
        20px 20px,
        20px 20px,
        100% 100%,
        100px 100px;
    position: relative;
    overflow: hidden;
}

/* Effet de phosphore TV */
.tv-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        /* Phosphore vert subtil (comme les vieux écrans) */
        radial-gradient(
            ellipse at 30% 30%,
            rgba(100, 255, 150, 0.02) 0%,
            transparent 50%
        ),
        radial-gradient(
            ellipse at 70% 70%,
            rgba(100, 200, 255, 0.02) 0%,
            transparent 50%
        ),
        /* Surchauffe du tube cathodique */
        radial-gradient(
            ellipse at center,
            rgba(255, 200, 100, 0.03) 0%,
            transparent 70%
        );
    pointer-events: none;
    z-index: 1;
    mix-blend-mode: screen;
}

/* Effet de rayonnement cathodique */
.tv-screen::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        /* Rayures de balayage très subtiles */
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 3px,
            rgba(255, 255, 255, 0.01) 3px,
            rgba(255, 255, 255, 0.01) 4px
        );
    pointer-events: none;
    z-index: 2;
    animation: crtFlicker 8s infinite alternate;
}

@keyframes crtFlicker {
    0%, 100% { opacity: 0.95; }
    25% { opacity: 0.92; }
    50% { opacity: 0.98; }
    75% { opacity: 0.93; }
}

/* Animation de la ligne blanche centrale qui s'étend */
.tv-line {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    background: #f0f0f0; /* Blanc cassé */
    transform: translateY(-50%) scaleX(0);
    animation: tvLineExpand 0.3s ease-out forwards;
    box-shadow: 
        0 0 20px rgba(255, 255, 255, 0.8),
        0 0 40px rgba(0, 168, 255, 0.6);
    z-index: 5;
}

@keyframes tvLineExpand {
    0% {
        transform: translateY(-50%) scaleX(0);
        height: 2px;
    }
    50% {
        transform: translateY(-50%) scaleX(1);
        height: 2px;
    }
    100% {
        transform: translateY(-50%) scaleX(1);
        height: 100vh;
    }
}

/* Effet de flash blanc */
.tv-flash {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(240, 240, 240, 0.9); /* Blanc cassé au lieu de blanc pur */
    opacity: 0;
    animation: tvFlash 0.5s ease-out 0.3s forwards;
    z-index: 3;
}

@keyframes tvFlash {
    0% { opacity: 0; }
    10% { opacity: 0.7; } /* Réduit l'intensité */
    100% { opacity: 0; }
}

/* Effet de bruit/static */
.tv-static {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        /* Bruit TV subtil */
        repeating-linear-gradient(
            0deg,
            rgba(255, 255, 255, 0.02) 0px,
            rgba(255, 255, 255, 0.02) 1px,
            transparent 1px,
            transparent 2px
        );
    opacity: 0;
    animation: tvStatic 0.3s ease-out 0.8s forwards, staticNoise 0.1s infinite 0.8s;
    z-index: 4;
}

@keyframes tvStatic {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes staticNoise {
    0% { transform: translate(0, 0); }
    10% { transform: translate(-2px, 2px); }
    20% { transform: translate(2px, -2px); }
    30% { transform: translate(-2px, -2px); }
    40% { transform: translate(2px, 2px); }
    50% { transform: translate(-2px, 2px); }
    60% { transform: translate(2px, -2px); }
    70% { transform: translate(-2px, -2px); }
    80% { transform: translate(2px, 2px); }
    90% { transform: translate(-2px, 2px); }
    100% { transform: translate(0, 0); }
}

/* Écran qui s'allume progressivement */
.tv-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(
            ellipse at center, 
            rgba(0, 168, 255, 0.2) 0%, 
            transparent 70%
        );
    opacity: 0;
    animation: tvGlow 1s ease-out 1.1s forwards;
    z-index: 2;
}

@keyframes tvGlow {
    0% { opacity: 0; }
    50% { opacity: 0.7; }
    100% { opacity: 0.3; }
}


/* Logo de chargement */
.tv-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    opacity: 0;
    animation: tvLoadingFade 0.5s ease-out 1.5s forwards;
    width: 80%;
    max-width: 900px;
    z-index: 20;
}

.tv-loading::before {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    border: 2px solid rgba(0, 168, 255, 0.2);
    border-radius: 15px;
    pointer-events: none;
    z-index: -1;
    animation: loadingGlow 3s infinite alternate;
}

@keyframes tvLoadingFade {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes loadingGlow {
    0% {
        border-color: rgba(0, 168, 255, 0.2);
        box-shadow: 
            0 0 30px rgba(0, 168, 255, 0.2),
            inset 0 0 30px rgba(0, 168, 255, 0.1);
    }
    100% {
        border-color: rgba(0, 255, 136, 0.3);
        box-shadow: 
            0 0 50px rgba(0, 255, 136, 0.3),
            inset 0 0 50px rgba(0, 255, 136, 0.2);
    }
}

.tv-loading-title {
    margin-bottom: 40px;
    position: relative;
}

.tv-loading-title::before {
    content: 'CRT';
    position: absolute;
    top: -10px;
    left: -30px;
    font-size: 0.8rem;
    color: #00a8ff;
    opacity: 0.7;
    letter-spacing: 3px;
    animation: crtLabel 2s infinite alternate;
}

@keyframes crtLabel {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}


.tv-loading-bar {
    width: 80%;
    max-width: 600px;
    height: 10px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 5px;
    overflow: visible;
    margin: 30px auto;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 
        inset 0 0 20px rgba(0, 0, 0, 0.8),
        0 0 20px rgba(0, 168, 255, 0.5),
        0 0 40px rgba(0, 168, 255, 0.3);
    position: relative;
}

.tv-loading-bar::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border: 1px solid rgba(0, 168, 255, 0.3);
    border-radius: 8px;
    animation: borderPulse 2s infinite;
}

@keyframes borderPulse {
    0%, 100% { 
        border-color: rgba(0, 168, 255, 0.3);
        box-shadow: 0 0 15px rgba(0, 168, 255, 0.2);
    }
    50% { 
        border-color: rgba(0, 255, 136, 0.5);
        box-shadow: 0 0 25px rgba(0, 255, 136, 0.4);
    }
}

.tv-loading-progress {
    height: 100%;
    background: 
        linear-gradient(90deg, 
            #00a8ff 0%,
            #00ff88 33%,
            #ff6b9d 66%,
            #ffaa00 100%);
    width: 0%;
    animation: tvLoadingProgress 2.5s ease-out 1.5s forwards;
    box-shadow: 
        0 0 15px rgba(0, 168, 255, 0.9),
        0 0 30px rgba(0, 168, 255, 0.7),
        inset 0 0 10px rgba(255, 255, 255, 0.5);
    position: relative;
    border-radius: 5px;
}

.tv-loading-progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.6),
            transparent);
    animation: progressShine 2s infinite linear;
}

@keyframes progressShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}


@keyframes tvLoadingProgress {
    0% { width: 0%; }
    100% { width: 100%; }
}

.tv-loading-text {
    margin-top: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.tv-loading-text::after {
    content: '▶';
    display: inline-block;
    margin-left: 10px;
    color: #00a8ff;
    animation: blink 1s infinite alternate;
}

@keyframes blink {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

.tv-loading-main {
    font-size: 4rem;
    font-weight: 900;
    color: #ffffff;
    text-shadow: 
        0 0 15px rgba(255, 255, 255, 0.9),
        0 0 30px rgba(0, 168, 255, 0.8),
        0 0 45px rgba(0, 168, 255, 0.6),
        0 0 60px rgba(0, 168, 255, 0.4),
        0 0 75px rgba(0, 168, 255, 0.2);
    margin-bottom: 15px;
    font-family: 'VT323', monospace, 'Courier New';
    letter-spacing: 0.2em;
    text-transform: uppercase;
    animation: titleGlow 2s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    0% {
        text-shadow: 
            0 0 15px rgba(255, 255, 255, 0.9),
            0 0 30px rgba(0, 168, 255, 0.8),
            0 0 45px rgba(0, 168, 255, 0.6);
    }
    100% {
        text-shadow: 
            0 0 20px rgba(255, 255, 255, 1),
            0 0 40px rgba(0, 168, 255, 1),
            0 0 60px rgba(0, 168, 255, 0.8),
            0 0 80px rgba(0, 168, 255, 0.6);
    }
}

.tv-loading-subtitle {
    font-size: 1.8rem;
    font-weight: 700;
    color: #00a8ff;
    text-shadow: 
        0 0 10px rgba(0, 168, 255, 0.8),
        0 0 20px rgba(0, 168, 255, 0.6),
        0 0 30px rgba(0, 168, 255, 0.4);
    margin-bottom: 8px;
    font-family: 'Segoe UI', sans-serif;
    letter-spacing: 0.1em;
    line-height: 1.3;
    opacity: 0.9;
}

.tv-loading-subtitle:nth-child(3) {
    color: #00ff88;
    text-shadow: 
        0 0 10px rgba(0, 255, 136, 0.8),
        0 0 20px rgba(0, 255, 136, 0.6);
    animation: subtitleColorShift 3s infinite alternate;
}

@keyframes subtitleColorShift {
    0%, 100% { 
        color: #00ff88;
        text-shadow: 
            0 0 10px rgba(0, 255, 136, 0.8),
            0 0 20px rgba(0, 255, 136, 0.6);
    }
    50% { 
        color: #ff6b9d;
        text-shadow: 
            0 0 10px rgba(255, 107, 157, 0.8),
            0 0 20px rgba(255, 107, 157, 0.6);
    }
}

.tv-loading-pulse {
    font-size: 1.8rem;
    color: #ffffff;
    font-family: 'VT323', monospace;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    animation: pulseText 1.5s infinite alternate;
    text-shadow: 
        0 0 10px rgba(255, 255, 255, 0.8),
        0 0 20px rgba(0, 168, 255, 0.6);
}

@keyframes pulseText {
    0% {
        opacity: 0.8;
        text-shadow: 
            0 0 10px rgba(255, 255, 255, 0.8),
            0 0 20px rgba(0, 168, 255, 0.6);
    }
    100% {
        opacity: 1;
        text-shadow: 
            0 0 15px rgba(255, 255, 255, 1),
            0 0 30px rgba(0, 168, 255, 0.8),
            0 0 45px rgba(0, 168, 255, 0.6);
    }
}

.tv-loading-dots {
    font-size: 2rem;
    color: #00ff88;
    font-family: 'VT323', monospace;
    animation: dotsBlink 1.5s infinite;
}

@keyframes dotsBlink {
    0% { opacity: 0.2; }
    20% { opacity: 1; }
    40% { opacity: 0.2; }
    60% { opacity: 0.2; }
    80% { opacity: 0.2; }
    100% { opacity: 0.2; }
}

.tv-loading-dots::before {
    content: '.';
    animation: dot1 1.5s infinite;
}

.tv-loading-dots::after {
    content: '..';
    animation: dot2 1.5s infinite;
}

@keyframes dot1 {
    0%, 20% { content: '.'; }
    40%, 100% { content: '..'; }
}

@keyframes dot2 {
    0%, 40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* Effet de scanlines */
.tv-scanlines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        repeating-linear-gradient(
            0deg,
            rgba(0, 0, 0, 0.1),
            rgba(0, 0, 0, 0.1) 1px,
            transparent 1px,
            transparent 3px
        );
    pointer-events: none;
    opacity: 0;
    animation: tvScanlines 0.5s ease-out 1.1s forwards;
    z-index: 6;
    mix-blend-mode: overlay;
}

@keyframes tvScanlines {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* Effet de vignette */
.tv-vignette {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(
            ellipse at center, 
            transparent 0%, 
            rgba(0, 0, 0, 0.5) 100%
        );
    pointer-events: none;
    opacity: 0;
    animation: tvVignette 0.5s ease-out 1.1s forwards;
    z-index: 7;
}


@keyframes tvVignette {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* Animation de sortie */
.tv-intro-overlay.fade-out {
    animation: tvFadeOut 0.8s ease-out forwards;
}

@keyframes tvFadeOut {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

/* Effet de rémanence CRT */
.tv-afterglow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(
            to bottom,
            transparent 0%,
            rgba(0, 168, 255, 0.05) 50%,
            transparent 100%
        );
    opacity: 0;
    animation: afterglow 4s ease-out 2s forwards;
    z-index: 8;
}

@keyframes afterglow {
    0% { opacity: 0; }
    20% { opacity: 0.4; }
    100% { opacity: 0.1; }
}

/* Ajustement pour les petits écrans */
@media (max-width: 768px) {
    .tv-loading-main {
        font-size: 2.5rem;
        letter-spacing: 0.1em;
    }
    
    .tv-loading-subtitle {
        font-size: 1.2rem;
    }
    
    .tv-loading-bar {
        width: 90%;
        height: 8px;
    }
    
    .tv-loading-pulse {
        font-size: 1.4rem;
    }
}

@media (max-width: 480px) {
    .tv-loading-main {
        font-size: 1.8rem;
    }
    
    .tv-loading-subtitle {
        font-size: 0.9rem;
    }
    
    .tv-loading {
        width: 95%;
    }
}


