:root {
    /* === HORROR PALETTE === */
    --horror-red: #ff0000;
    --horror-dark: #0a0000;
    --glitch-offset: 2px;
}

/* === GLITCH TEXT EFFECT === */
.glitch-text {
    position: relative;
    display: inline-block;
}

.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--void-bg);
}

.glitch-text::before {
    left: 2px;
    text-shadow: -1px 0 #ff00c1;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}

.glitch-text::after {
    left: -2px;
    text-shadow: -1px 0 #00fff9;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim2 5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% { clip: rect(13px, 9999px, 86px, 0); }
    5% { clip: rect(76px, 9999px, 14px, 0); }
    10% { clip: rect(44px, 9999px, 29px, 0); }
    15% { clip: rect(98px, 9999px, 56px, 0); }
    20% { clip: rect(2px, 9999px, 8px, 0); }
    25% { clip: rect(42px, 9999px, 73px, 0); }
    30% { clip: rect(91px, 9999px, 3px, 0); }
    35% { clip: rect(34px, 9999px, 12px, 0); }
    40% { clip: rect(65px, 9999px, 94px, 0); }
    45% { clip: rect(10px, 9999px, 37px, 0); }
    50% { clip: rect(88px, 9999px, 59px, 0); }
    55% { clip: rect(53px, 9999px, 21px, 0); }
    60% { clip: rect(17px, 9999px, 83px, 0); }
    65% { clip: rect(72px, 9999px, 49px, 0); }
    70% { clip: rect(28px, 9999px, 66px, 0); }
    75% { clip: rect(95px, 9999px, 5px, 0); }
    80% { clip: rect(6px, 9999px, 39px, 0); }
    85% { clip: rect(61px, 9999px, 92px, 0); }
    90% { clip: rect(33px, 9999px, 19px, 0); }
    95% { clip: rect(81px, 9999px, 74px, 0); }
    100% { clip: rect(47px, 9999px, 11px, 0); }
}

@keyframes glitch-anim2 {
    0% { clip: rect(65px, 9999px, 94px, 0); }
    100% { clip: rect(10px, 9999px, 37px, 0); }
}

/* === HORROR OVERLAYS === */
#horror-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
    background: red;
    opacity: 0;
    mix-blend-mode: overlay;
    transition: opacity 0.1s;
}

#jumpscare-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.05s;
}

#jumpscare-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.1; /* Très subtil */
    mix-blend-mode: difference;
}

.corrupted-text {
    color: var(--horror-red) !important;
    font-family: 'Courier New', Courier, monospace !important;
    font-weight: bold;
    letter-spacing: 0.2em;
    animation: shake 0.5s infinite;
}

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