/* ========================================
   GAME OF LIFE - CLEAN STYLES
   ======================================== */

:root {
    --matrix-green: #00ff41;
    --matrix-green-dark: #008f11;
    --bg-dark: #0d0d0d;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    font-family: 'Share Tech Mono', monospace;
    background: var(--bg-dark);
    color: var(--matrix-green);
    height: 100%;
    width: 100%;
    overflow: hidden;
}

/* App Container */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
}

/* Header */
.header {
    flex-shrink: 0;
    text-align: center;
    padding: 20px 10px;
    background: var(--bg-dark);
    border-bottom: 1px solid rgba(0, 255, 65, 0.3);
}

.title {
    font-size: clamp(1.6rem, 6vw, 3rem);
    font-weight: 400;
    letter-spacing: 8px;
    text-shadow:
        0 0 10px var(--matrix-green),
        0 0 20px var(--matrix-green),
        0 0 40px var(--matrix-green-dark);
}

/* Glitch Effect */
.glitch {
    position: relative;
    animation: glitch-skew 4s infinite linear alternate-reverse;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 #ff00c1;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -2px 0 #00fff9, 2px 2px #ff00c1;
    animation: glitch-anim2 1s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% {
        clip: rect(31px, 9999px, 94px, 0);
        transform: skew(0.85deg);
    }

    20% {
        clip: rect(6px, 9999px, 55px, 0);
        transform: skew(0.1deg);
    }

    40% {
        clip: rect(99px, 9999px, 77px, 0);
        transform: skew(0.65deg);
    }

    60% {
        clip: rect(31px, 9999px, 16px, 0);
        transform: skew(0.53deg);
    }

    80% {
        clip: rect(25px, 9999px, 57px, 0);
        transform: skew(0.48deg);
    }

    100% {
        clip: rect(33px, 9999px, 51px, 0);
        transform: skew(0.26deg);
    }
}

@keyframes glitch-anim2 {
    0% {
        clip: rect(65px, 9999px, 100px, 0);
        transform: skew(0.03deg);
    }

    25% {
        clip: rect(39px, 9999px, 98px, 0);
        transform: skew(0.47deg);
    }

    50% {
        clip: rect(54px, 9999px, 47px, 0);
        transform: skew(0.33deg);
    }

    75% {
        clip: rect(29px, 9999px, 25px, 0);
        transform: skew(0.56deg);
    }

    100% {
        clip: rect(88px, 9999px, 47px, 0);
        transform: skew(0.09deg);
    }
}

@keyframes glitch-skew {
    0% {
        transform: skew(0deg);
    }

    10% {
        transform: skew(0deg);
    }

    11% {
        transform: skew(2deg);
    }

    12% {
        transform: skew(0deg);
    }

    100% {
        transform: skew(0deg);
    }
}

/* Game Area */
.game-area {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #050505;
}

#game-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* Mobile */
@media (max-width: 600px) {
    .header {
        padding: 15px 8px;
    }

    .title {
        letter-spacing: 5px;
    }
}