/* Disable transitions during flickering */
body.x-flickering-mode,
body.x-flickering-mode * {
    transition: none !important;
    animation: none !important;
}

/* Ensure images toggle instantly */
body.x-flickering-mode .light-mode,
body.x-flickering-mode .wp-image-light,
body.x-flickering-mode .wp-image-306,
body.x-flickering-mode .dark-mode,
body.x-flick-mode .wp-image-dark,
body.x-flickering-mode .wp-image-305,
body.x-flickering-mode img {
    transition: none !important;
}

/* Dark Overlay Background - Clearer but not too clear */
#x-dark-overlay {
    background: rgba(0, 0, 0, 0.82) !important;
}

/* Intense CRT Overlay Effects - No white flashing */
@keyframes x-crt-flicker {
    0%, 100% {
        opacity: 0.9;
        filter: brightness(1.1) contrast(1.2);
    }
    50% {
        opacity: 0.8;
        filter: brightness(1.05) contrast(1.3);
    }
}

@keyframes x-crt-scan {
    0% {
        top: -10%;
        opacity: 0.6;
    }
    100% {
        top: 110%;
        opacity: 0.6;
    }
}

#x-crt-overlay {
    animation: x-crt-flicker 0.1s infinite;
}

/* Eye GIF Animation */
@keyframes x-eye-pulse {
    0%, 100% {
        opacity: 0.9;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

#x-eye-gif {
    animation: x-eye-pulse 2s infinite;
}

/* Text flicker without movement */
@keyframes x-text-flicker {
    0%, 100% {
        opacity: 1;
        text-shadow: 0 0 15px #CC3945;
        filter: brightness(1);
    }
    25% {
        opacity: 0.7;
        text-shadow: 0 0 25px #C82130;
        filter: brightness(1.2);
    }
    50% {
        opacity: 0.9;
        text-shadow: 0 0 20px #8C2525;
        filter: brightness(0.9);
    }
    75% {
        opacity: 0.8;
        text-shadow: 0 0 30px #CC3945, 0 0 40px rgba(204, 57, 69, 0.5);
        filter: brightness(1.1);
    }
}

#x-access-denied {
    animation: x-text-flicker 0.3s infinite;
}

/* Pulse for rebooting text */
@keyframes x-pulse-subtle {
    0%, 100% {
        opacity: 0.7;
        color: #979797;
    }
    50% {
        opacity: 1;
        color: #E6E6E5;
    }
}

#x-rebooting {
    animation: x-pulse-subtle 1.2s infinite;
}

/* Make ALL text non-selectable */
#x-breaking-overlay,
#x-breaking-overlay * {
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    pointer-events: none !important;
}

/* Mobile-specific adjustments - SMALLER and CENTERED */
@media (max-width: 768px) {
    #x-breaking-overlay {
        width: 280px !important;
        height: 280px !important;
        padding: 30px !important;
        margin: 0 !important;
        box-shadow: 0 0 20px #C82130, 0 0 40px rgba(200, 33, 48, 0.4) !important;
    }
    
    #x-access-denied {
        font-size: 1.5em !important;
        letter-spacing: 1px !important;
        margin-bottom: 8px !important;
    }
    
    #x-eye-gif {
        width: 120px !important;
        height: 120px !important;
        margin-bottom: 10px !important;
    }
    
    #x-rebooting {
        font-size: 0.9em !important;
    }
}

/* Tablet-specific adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    #x-breaking-overlay {
        width: 380px !important;
        height: 380px !important;
        padding: 40px !important;
    }
    
    #x-access-denied {
        font-size: 1.8em !important;
    }
    
    #x-eye-gif {
        width: 180px !important;
        height: 180px !important;
        margin-bottom: 15px !important;
    }
}

/* Desktop adjustments */
@media (min-width: 1025px) {
    #x-breaking-overlay {
        width: 480px !important;
        height: 480px !important;
        padding: 50px !important;
    }
    
    #x-access-denied {
        font-size: 2.2em !important;
    }
    
    #x-eye-gif {
        width: 220px !important;
        height: 220px !important;
        margin-bottom: 20px !important;
    }
}

/* Prevent any text selection on the entire page during flicker */
body.x-flickering-mode {
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    #x-breaking-overlay {
        -webkit-tap-highlight-color: transparent;
    }
}