* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body,
html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #000;
    font-family: 'Consolas', 'Courier New', monospace;
    color: #00ff66;
}

/* Canvas per il Digital Rain */
#matrix-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    display: block;
}

/* Effetto scanline e vignettatura cinematografica CRT */
.crt-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    background:
        radial-gradient(circle at center, transparent 45%, rgba(0, 0, 0, 0.85) 100%),
        repeating-linear-gradient(0deg,
            rgba(0, 0, 0, 0.28),
            rgba(0, 0, 0, 0.28) 1px,
            transparent 1px,
            transparent 2px);
}

/* Contenitore centrale con messaggio */
.glitch-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    text-align: center;
    padding: 2.2rem 3.5rem;
    background: rgba(0, 8, 3, 0.78);
    border: 1px solid rgba(0, 255, 102, 0.45);
    border-radius: 4px;
    box-shadow:
        0 0 25px rgba(0, 255, 102, 0.25),
        inset 0 0 15px rgba(0, 255, 102, 0.15);
    backdrop-filter: blur(6px);
    max-width: 90vw;
}

/* Angoli hi-tech del box */
.glitch-container::before,
.glitch-container::after {
    content: "";
    position: absolute;
    width: 12px;
    height: 12px;
    border-color: #55ff88;
    pointer-events: none;
}

.glitch-container::before {
    top: -2px;
    left: -2px;
    border-top: 2px solid #55ff88;
    border-left: 2px solid #55ff88;
}

.glitch-container::after {
    bottom: -2px;
    right: -2px;
    border-bottom: 2px solid #55ff88;
    border-right: 2px solid #55ff88;
}

/* Scritta principale con effetto Glitch cinematografico */
.title-glitch {
    position: relative;
    font-size: clamp(1.4rem, 3.2vw, 2.3rem);
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #e6fffa;
    text-shadow: 0 0 8px rgba(0, 255, 102, 0.8), 0 0 20px rgba(0, 255, 102, 0.4);
    margin-bottom: 1rem;
}

.title-glitch::before,
.title-glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    clip: rect(0, 0, 0, 0);
}

.title-glitch::before {
    left: -2px;
    text-shadow: 2px 0 #00ff88;
    animation: glitch-anim-1 2.5s infinite linear alternate-reverse;
}

.title-glitch::after {
    left: 2px;
    text-shadow: -2px 0 #00ffff;
    animation: glitch-anim-2 3.2s infinite linear alternate-reverse;
}

/* Sottotitolo / Status */
.subtitle {
    font-size: clamp(0.95rem, 1.8vw, 1.2rem);
    color: #55ff88;
    letter-spacing: 3px;
    display: inline-block;
    text-shadow: 0 0 5px rgba(0, 255, 102, 0.6);
}

.cursor {
    display: inline-block;
    width: 9px;
    height: 1.1em;
    background-color: #00ff66;
    vertical-align: middle;
    margin-left: 4px;
    box-shadow: 0 0 8px #00ff66;
    animation: blink 0.8s infinite;
}

/* Keyframes Animazioni */
@keyframes blink {
    0%,
    49% {
        opacity: 1;
    }

    50%,
    100% {
        opacity: 0;
    }
}

@keyframes glitch-anim-1 {
    0% {
        clip: rect(12px, 9999px, 44px, 0);
        transform: skew(0.3deg);
    }

    15% {
        clip: rect(62px, 9999px, 85px, 0);
        transform: skew(-0.5deg);
    }

    30% {
        clip: rect(2px, 9999px, 28px, 0);
        transform: skew(0.2deg);
    }

    45% {
        clip: rect(45px, 9999px, 72px, 0);
        transform: skew(-0.8deg);
    }

    60% {
        clip: rect(10px, 9999px, 50px, 0);
        transform: skew(0.4deg);
    }

    75% {
        clip: rect(80px, 9999px, 95px, 0);
        transform: skew(-0.2deg);
    }

    100% {
        clip: rect(35px, 9999px, 68px, 0);
        transform: skew(0.1deg);
    }
}

@keyframes glitch-anim-2 {
    0% {
        clip: rect(30px, 9999px, 60px, 0);
        transform: skew(-0.4deg);
    }

    20% {
        clip: rect(8px, 9999px, 35px, 0);
        transform: skew(0.6deg);
    }

    40% {
        clip: rect(70px, 9999px, 95px, 0);
        transform: skew(-0.3deg);
    }

    60% {
        clip: rect(22px, 9999px, 55px, 0);
        transform: skew(0.5deg);
    }

    80% {
        clip: rect(52px, 9999px, 80px, 0);
        transform: skew(-0.2deg);
    }

    100% {
        clip: rect(5px, 9999px, 40px, 0);
        transform: skew(0.3deg);
    }
}

