#screen-wrapper {
    width: 1280px; 
    height: 800px;
    position: relative;
    overflow: hidden;
    background: #000;
    display: flex;
    flex-direction: column;
    z-index: 10;
    border-radius: 12px; 
    transform: scale(0.99);
    flex-shrink: 0;
    transform-origin: center center;
}

#crt-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    pointer-events: none;

    background: 
        repeating-linear-gradient(
            0deg,
            rgba(0, 0, 0, 0) 0px,
            rgba(0, 0, 0, calc(var(--scanline-strength) * 1.5)) 1px,
            rgba(0, 0, 0, 0) 2px
        ),
        repeating-linear-gradient(
            90deg,
            rgba(255, 20, 20, calc(var(--scanline-strength) * 0.15)) 0px,
            rgba(20, 255, 20, calc(var(--scanline-strength) * 0.15)) 1px,
            rgba(20, 20, 255, calc(var(--scanline-strength) * 0.15)) 2px,
            transparent 3px
        ),
        repeating-linear-gradient(
            45deg,
            transparent 0px,
            rgba(255, 255, 255, calc(var(--scanline-strength) * 0.02)) 1px,
            transparent 2px,
            transparent 4px
        ),
        radial-gradient(
            ellipse at center,
            transparent 0%,
            transparent 50%,
            rgba(0, 0, 0, calc(var(--scanline-strength) * 0.8)) 100%
        );
        
    background-size: 
        100% 2px,
        3px 100%,
        4px 4px,
        100% 100%; 
    
    animation: scanlineMove 6s linear infinite, flicker 0.15s infinite;
    
    box-shadow: 
        inset 0 0 150px rgba(0, 0, 0, calc(var(--scanline-strength) * 2.5)),
        inset 0 0 50px rgba(0, 0, 0, calc(var(--scanline-strength) * 1.5));
    
    border-radius: inherit; 
    
    mix-blend-mode: screen;
    opacity: calc(0.3 + (var(--scanline-strength) * 1.4));
}

@keyframes scanlineMove {
    0% { background-position: 0 0, 0 0, 0 0, center; }
    100% { background-position: 0 2px, 0 0, 4px 4px, center; }
}

.crt-active,
.crt-active * {
    text-shadow: 
        1.5px 0 rgba(255, 50, 50, calc(var(--scanline-strength) * 1.2)), 
        -1.5px 0 rgba(50, 255, 255, calc(var(--scanline-strength) * 1.2)),
        0 0 3px rgba(0, 217, 255, calc(var(--scanline-strength) * 0.3));
}

.crt-active {
    background: transparent !important;
}

/* Also apply to specific game elements */
#word-display,
#timer,
#input-box,
.side-title,
.stat-row,
.stat-val,
#shop-screen *,
#boss-name,
#boss-hp-text,
#round,
#words-left,
#gold,
#high-score {
    text-shadow: 
        1.5px 0 rgba(255, 50, 50, calc(var(--scanline-strength) * 1.2)), 
        -1.5px 0 rgba(50, 255, 255, calc(var(--scanline-strength) * 1.2)),
        0 0 3px rgba(0, 217, 255, calc(var(--scanline-strength) * 0.3));
}

.crt-turn-on {
    animation: turnOn 1s ease-out forwards;
}

@keyframes turnOn {
    0% { 
        transform: scale(1, 0.002) skewX(0deg); 
        filter: brightness(0); 
        background: #fff; 
    }
    30% { 
        transform: scale(1, 0.002) skewX(0deg); 
        filter: brightness(2); 
        background: #fff; 
    }
    60% { 
        transform: scale(1, 0.002) skewX(0deg); 
        filter: brightness(5); 
    }
    100% { 
        transform: scale(0.99); 
        filter: brightness(1); 
    }
}

@keyframes flicker {
    0% { opacity: 0.97; }
    50% { opacity: 1; }
    100% { opacity: 0.98; }
}

/* Optional: Screen bloom/glow effect on bright elements */
.crt-active #word-display,
.crt-active #timer,
.crt-active .btn-round,
.crt-active button,
.crt-active h1,
.crt-active h2,
.crt-active h3 {
    filter: 
        drop-shadow(0 0 2px rgba(0, 217, 255, calc(var(--scanline-strength) * 0.4)))
        drop-shadow(0 0 5px rgba(0, 217, 255, calc(var(--scanline-strength) * 0.2)));
}

/* Apply CRT effect to buttons and interactive elements */
button,
.btn-round,
.diff-card,
.slot-card,
.ach-block {
    text-shadow: 
        1.5px 0 rgba(255, 50, 50, calc(var(--scanline-strength) * 1.2)), 
        -1.5px 0 rgba(50, 255, 255, calc(var(--scanline-strength) * 1.2)),
        0 0 3px rgba(0, 217, 255, calc(var(--scanline-strength) * 0.3)) !important;
}

body.boot-state #timer, body.boot-state #word-display {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none;
    
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

body.boot-state #timer::before {
    display: none !important;
    width: 0 !important;
}

body.boot-state #hud-stats {
    display: none !important;
}

#game-logo {
    display: none; 
    pointer-events: none;
    transition: opacity 0.5s ease;
}

body.boot-state #combo-container {
    display: none !important;
}

body.boot-state #game-logo {
    display: block;
    position: fixed;
    top: 35%; 
    left: 50%;
    transform: translate(-50%, -50%);
    
    width: 500px;
    height: auto;
    z-index: 9999;
    animation: logoFloat 4s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% { 
        transform: translate(-50%, -50%) scale(1); 
    }
    50% { 
        transform: translate(-50%, -60%) scale(1.02); 
    }
}

        #boot-splash {
            display: none !important;
            z-index: 1999;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.8s ease, transform 0.2s ease;
        }
        
        body.boot-state #boot-splash {
            display: flex !important;
            position: absolute;
            bottom: 30px;
            left: 30px;
            opacity: 0.6;
            pointer-events: auto;
            animation: float 4s ease-in-out infinite;
        }

        body.boot-state #boot-splash:hover {
            opacity: 1;
            transform: scale(1.05);
            cursor: pointer;
        }

        #boot-splash img {
            height: 100px;
            width: auto;
            display: block;
            border-radius: 50%;
            border: 1px solid #333;
        }
        body.boot-state #curse-warning{
            display: none !important;
        }

        @keyframes float {
            0% { transform: translateY(0px); }
            50% { transform: translateY(-5px); }
            100% { transform: translateY(0px); }
        }