/* ===================================
   SIMPLE GAMING PAGE TRANSITION
   Fade to Black → Glitch Title → Fade to Page
   =================================== */

.page-transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    pointer-events: none;
    display: none;
    background: #000;
}

/* Active State */
.page-transition-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: all;
    animation: fadeIn 0.5s ease-out forwards;
}

/* Fade In - Screen goes to black */
@keyframes fadeIn {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

/* Fade Out - Transition to gaming page */
.page-transition-overlay.fade-out {
    animation: fadeOut 0.5s ease-out forwards;
}

@keyframes fadeOut {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

/* Gaming Title Container */
.transition-title {
    position: relative;
    font-family: 'Orbitron', 'Rajdhani', sans-serif;
    font-size: 64px;
    font-weight: 900;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 8px;
    opacity: 0;
    animation: titleFadeIn 0.5s ease-out 0.5s forwards;
}

@keyframes titleFadeIn {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Glitch Effect on Title */
.transition-title::before,
.transition-title::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.8;
}

.transition-title::before {
    animation: glitchTop 2s infinite;
    clip-path: polygon(0 0, 100% 0, 100% 33%, 0 33%);
    color: #FF6B00;
    text-shadow: 2px 0 #FF6B00;
}

.transition-title::after {
    animation: glitchBottom 2.5s infinite;
    clip-path: polygon(0 67%, 100% 67%, 100% 100%, 0 100%);
    color: #E8E8E8;
    text-shadow: -2px 0 #E8E8E8;
}

@keyframes glitchTop {

    0%,
    100% {
        transform: translate(0);
    }

    20% {
        transform: translate(-3px, 2px);
    }

    40% {
        transform: translate(3px, -2px);
    }

    60% {
        transform: translate(-2px, 3px);
    }

    80% {
        transform: translate(2px, -3px);
    }
}

@keyframes glitchBottom {

    0%,
    100% {
        transform: translate(0);
    }

    25% {
        transform: translate(3px, -2px);
    }

    50% {
        transform: translate(-3px, 2px);
    }

    75% {
        transform: translate(2px, 3px);
    }
}

/* Main Title Glitch Animation */
.transition-title {
    animation:
        titleFadeIn 0.5s ease-out 0.5s forwards,
        titleGlitch 3s infinite;
}

@keyframes titleGlitch {

    0%,
    90%,
    100% {
        transform: translate(0) scale(1);
        filter: none;
    }

    91% {
        transform: translate(-2px, 0) scale(1.01);
    }

    92% {
        transform: translate(2px, 0) scale(0.99);
    }

    93% {
        transform: translate(-2px, 0) scale(1.01);
    }

    94% {
        transform: translate(0) scale(1);
    }
}

/* Text Glow Effect */
.transition-title {
    text-shadow:
        0 0 20px rgba(255, 255, 255, 0.8),
        0 0 40px rgba(255, 107, 0, 0.6),
        0 0 60px rgba(255, 107, 0, 0.4),
        0 0 80px rgba(255, 107, 0, 0.3);
}

/* RGB Split Effect on Random Glitches */
@keyframes rgbSplit {

    0%,
    100% {
        text-shadow:
            0 0 20px rgba(255, 255, 255, 0.8),
            0 0 40px rgba(0, 255, 255, 0.6),
            0 0 60px rgba(255, 0, 255, 0.4);
    }

    33% {
        text-shadow:
            -2px 0 0 #ff00ff,
            2px 0 0 #00ffff,
            0 0 40px rgba(255, 255, 255, 0.8);
    }

    66% {
        text-shadow:
            2px 0 0 #ff00ff,
            -2px 0 0 #00ffff,
            0 0 40px rgba(255, 255, 255, 0.8);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .transition-title {
        font-size: 36px;
        letter-spacing: 4px;
    }
}

@media (max-width: 480px) {
    .transition-title {
        font-size: 28px;
        letter-spacing: 2px;
    }
}