@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&display=swap');

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

body {
    font-family: 'Orbitron', monospace;
    background: #000;
    color: #00FFFF;
    overflow: hidden;
    user-select: none;
}

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

#canvas {
    display: block;
    background: #000;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

#hud {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 100;
}

.hud-element {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #00FFFF;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    animation: glitch-flicker 0.1s infinite;
}

.label {
    min-width: 60px;
    font-size: 12px;
    color: #FF00FF;
}

.bar {
    width: 100px;
    height: 10px;
    background: #333;
    border: 1px solid #00FFFF;
    overflow: hidden;
}

.fill {
    height: 100%;
    background: linear-gradient(90deg, #00FF00, #FFFF00, #FF0000);
    transition: width 0.3s ease;
    animation: pulse 0.5s infinite alternate;
}

#score-value, #fragment-count {
    font-family: 'Courier New', monospace;
    color: #00FF00;
    font-weight: bold;
    text-shadow: 0 0 5px #00FF00;
}

#controls {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #FF00FF;
    padding: 15px;
    font-size: 12px;
    line-height: 1.8;
    z-index: 100;
}

.glitch-text {
    animation: text-glitch 0.2s infinite;
    text-shadow: 
        2px 0 #FF0000,
        -2px 0 #00FFFF,
        0 2px #00FF00;
}

#manifesto-display {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.95);
    border: 3px solid #FF00FF;
    padding: 30px;
    max-width: 500px;
    text-align: center;
    z-index: 200;
    animation: manifesto-appear 0.5s ease;
}

.manifesto-content h2 {
    color: #FF00FF;
    margin-bottom: 20px;
    font-size: 18px;
    letter-spacing: 3px;
}

.manifesto-content p {
    color: #00FFFF;
    margin-bottom: 15px;
    font-size: 14px;
}

#manifesto-text {
    color: #00FF00;
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    animation: text-corruption 1s infinite;
}

#pause-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.menu-content {
    background: #000;
    border: 4px solid #00FFFF;
    padding: 40px;
    text-align: center;
}

.menu-content h2 {
    color: #FF00FF;
    margin-bottom: 30px;
    font-size: 24px;
    letter-spacing: 4px;
}

.menu-content button {
    display: block;
    width: 100%;
    margin: 15px 0;
    padding: 12px;
    background: #000;
    color: #00FFFF;
    border: 2px solid #00FFFF;
    font-family: 'Orbitron', monospace;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.2s;
}

.menu-content button:hover {
    background: #00FFFF;
    color: #000;
    box-shadow: 0 0 15px #00FFFF;
}

.hidden {
    display: none !important;
}

/* Animations */
@keyframes glitch-flicker {
    0% { opacity: 1; }
    98% { opacity: 1; }
    99% { opacity: 0.8; }
    100% { opacity: 1; }
}

@keyframes pulse {
    0% { filter: brightness(100%); }
    100% { filter: brightness(120%); }
}

@keyframes text-glitch {
    0% { 
        text-shadow: 2px 0 #FF0000, -2px 0 #00FFFF, 0 2px #00FF00;
        transform: translate(0);
    }
    20% { 
        text-shadow: -2px 0 #FF0000, 2px 0 #00FFFF, 0 -2px #00FF00;
        transform: translate(-1px, 1px);
    }
    40% { 
        text-shadow: 2px 0 #FF0000, -2px 0 #00FFFF, 0 2px #00FF00;
        transform: translate(1px, -1px);
    }
    60% { 
        text-shadow: -2px 0 #FF0000, 2px 0 #00FFFF, 0 -2px #00FF00;
        transform: translate(0, 1px);
    }
    80% { 
        text-shadow: 2px 0 #FF0000, -2px 0 #00FFFF, 0 2px #00FF00;
        transform: translate(-1px, 0);
    }
    100% { 
        text-shadow: 2px 0 #FF0000, -2px 0 #00FFFF, 0 2px #00FF00;
        transform: translate(0);
    }
}

@keyframes text-corruption {
    0%, 90% { 
        filter: hue-rotate(0deg); 
    }
    10% { 
        filter: hue-rotate(90deg); 
    }
    20% { 
        filter: hue-rotate(180deg); 
    }
    30% { 
        filter: hue-rotate(270deg); 
    }
}

@keyframes manifesto-appear {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Responsive design */
@media (max-width: 768px) {
    #hud {
        top: 10px;
        right: 10px;
        gap: 10px;
    }
    
    .hud-element {
        padding: 6px 8px;
        font-size: 10px;
    }
    
    .label {
        min-width: 40px;
        font-size: 9px;
    }
    
    .bar {
        width: 60px;
        height: 8px;
    }
    
    #controls {
        bottom: 10px;
        left: 10px;
        padding: 10px;
        font-size: 10px;
        line-height: 1.5;
    }
    
    #manifesto-display {
        max-width: 90%;
        padding: 20px;
    }
    
    .manifesto-content h2 {
        font-size: 14px;
    }
    
    #manifesto-text {
        font-size: 12px;
    }
}

/* Performance optimizations */
* {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

#canvas {
    will-change: transform;
}