@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

#glitchText {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;

    font-family: 'Press Start 2P', 'Courier New', monospace;
    font-size: 1.5rem;
    font-weight: normal;
    color: #00ff00;
    text-align: center;
    text-shadow:
        0 0 3px #00ff00,
        0 0 6px #00ff00;

    letter-spacing: 0.1em;
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
    image-rendering: pixelated;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: grayscale;
}

#glitchText.glitching {
    animation: glitch-animation 0.1s infinite;
}

@keyframes glitch-animation {
    0% {
        transform: translate(-50%, -50%) translate(0);
    }
    20% {
        transform: translate(-50%, -50%) translate(-2px, 2px);
    }
    40% {
        transform: translate(-50%, -50%) translate(-2px, -2px);
    }
    60% {
        transform: translate(-50%, -50%) translate(2px, 2px);
    }
    80% {
        transform: translate(-50%, -50%) translate(2px, -2px);
    }
    100% {
        transform: translate(-50%, -50%) translate(0);
    }
}

/* Additional glitch effects */
#glitchText.glitching::before,
#glitchText.glitching::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#glitchText.glitching::before {
    animation: glitch-before 0.3s infinite;
    color: #ff00ff;
    z-index: -1;
}

#glitchText.glitching::after {
    animation: glitch-after 0.3s infinite;
    color: #00ffff;
    z-index: -2;
}

@keyframes glitch-before {
    0% {
        clip-path: inset(40% 0 61% 0);
        transform: translate(-2px, -2px);
    }
    20% {
        clip-path: inset(92% 0 1% 0);
        transform: translate(2px, 2px);
    }
    40% {
        clip-path: inset(43% 0 1% 0);
        transform: translate(-2px, 2px);
    }
    60% {
        clip-path: inset(25% 0 58% 0);
        transform: translate(2px, -2px);
    }
    80% {
        clip-path: inset(54% 0 7% 0);
        transform: translate(-2px, 2px);
    }
    100% {
        clip-path: inset(58% 0 43% 0);
        transform: translate(2px, -2px);
    }
}

@keyframes glitch-after {
    0% {
        clip-path: inset(60% 0 20% 0);
        transform: translate(2px, 2px);
    }
    20% {
        clip-path: inset(10% 0 80% 0);
        transform: translate(-2px, -2px);
    }
    40% {
        clip-path: inset(70% 0 15% 0);
        transform: translate(2px, -2px);
    }
    60% {
        clip-path: inset(30% 0 60% 0);
        transform: translate(-2px, 2px);
    }
    80% {
        clip-path: inset(80% 0 10% 0);
        transform: translate(2px, 2px);
    }
    100% {
        clip-path: inset(20% 0 70% 0);
        transform: translate(-2px, -2px);
    }
}

/* Responsive design */
@media (max-width: 768px) {
    #glitchText {
        font-size: 1.5rem;
        max-width: 90%;
        white-space: normal;
    }
}

@media (max-width: 480px) {
    #glitchText {
        font-size: 1rem;
    }
}
