@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;600&display=swap');

:root {
    --terminal-font: 'Fira Code', monospace;
    --terminal-font-size: 14px;
    --terminal-line-height: 1.6;
    --terminal-text-color: #0f0;
}

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

body {
    background-color: #000;
    font-family: var(--terminal-font);
    color: var(--terminal-text-color);
    overflow: hidden;
    position: relative;
}

/* Global CRT Effects */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.2) 0px,
        rgba(0, 0, 0, 0.2) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    z-index: 99999;
    opacity: 0.7;
    animation: scanline 8s linear infinite;
    mix-blend-mode: screen;
}

@keyframes scanline {
    0% { 
        background-position: 0 0;
        opacity: 0.7;
    }
    50% { opacity: 0.5; }
    100% { 
        background-position: 0 100%;
        opacity: 0.7;
    }
}

.game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
}

.canvas-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#backgroundCanvas {
    z-index: 1;
}

#gameCanvas {
    z-index: 2;
}

#ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    pointer-events: none;
}

#score {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 24px;
    text-shadow: 0 0 10px var(--terminal-text-color);
}

#game-over {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    background-color: rgba(0, 0, 0, 0.9);
    padding: 2rem;
    border: 2px solid var(--terminal-text-color);
    box-shadow: 0 0 20px var(--terminal-text-color);
    animation: glitchTransition 0.3s ease-out;
    pointer-events: auto;
}

#game-over h2 {
    font-size: 36px;
    margin-bottom: 1rem;
    text-shadow: 0 0 10px var(--terminal-text-color);
}

#game-over p {
    margin: 1rem 0;
    font-size: 24px;
    text-shadow: 0 0 5px var(--terminal-text-color);
}

.cyber-button {
    font-family: var(--terminal-font);
    background: transparent;
    color: var(--terminal-text-color);
    border: 2px solid var(--terminal-text-color);
    padding: 10px 20px;
    font-size: 18px;
    cursor: pointer;
    margin-top: 1rem;
    pointer-events: auto;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-decoration: none;
    display: inline-block;
    position: relative;
    overflow: hidden;
}

.cyber-button:hover {
    background: var(--terminal-text-color);
    color: #000;
    box-shadow: 0 0 15px var(--terminal-text-color);
    transform: translateY(-2px);
}

.cyber-button:active {
    transform: translateY(0);
}

.hidden {
    display: none;
}

#ascii-cat {
    margin-bottom: 1.5rem;
    animation: glitchText 2s infinite;
    text-shadow: 0 0 5px var(--terminal-text-color);
}

@keyframes glitchText {
    0% { transform: skew(0deg); }
    20% { transform: skew(-2deg); }
    40% { transform: skew(2deg); }
    60% { transform: skew(-2deg); }
    80% { transform: skew(2deg); }
    100% { transform: skew(0deg); }
}

@keyframes glitchTransition {
    0% { transform: translate(-50%, -50%) scale(0.95); opacity: 0; }
    50% { transform: translate(-50%, -50%) scale(1.05); opacity: 0.5; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

@media (max-width: 600px) {
    :root {
        --terminal-font-size: 12px;
    }

    #game-over {
        width: 90%;
        padding: 1.5rem;
    }

    #game-over h2 {
        font-size: 24px;
    }

    .cyber-button {
        font-size: 16px;
        padding: 8px 16px;
    }
}