* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

body {
    font-family: 'Arial', sans-serif;
    overflow: hidden;
    background: #000;
    position: fixed;
    width: 100%;
    height: 100%;
    touch-action: none;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#gameCanvas {
    display: block;
    background: linear-gradient(180deg, #0a0a1f 0%, #1a0a2e 50%, #2d1b3d 100%);
    box-shadow: 0 0 50px rgba(138, 43, 226, 0.5);
    max-width: 100%;
    max-height: 100%;
    touch-action: none;
}

#ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    color: white;
}

#score, #best {
    position: absolute;
    top: 10px;
    font-size: clamp(16px, 4vw, 24px);
    font-weight: bold;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
    z-index: 10;
}

#score {
    left: 10px;
    color: #00ffff;
}

#best {
    right: 10px;
    color: #ff00ff;
}

#powerup-indicator {
    position: absolute;
    top: clamp(40px, 10vh, 60px);
    left: 10px;
    font-size: clamp(14px, 3vw, 18px);
    font-weight: bold;
    color: #ffff00;
    text-shadow: 0 0 15px rgba(255, 255, 0, 0.8);
    animation: pulse 0.5s infinite;
    z-index: 10;
}

#powerup-indicator.hidden {
    display: none;
}

#instructions {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    font-size: clamp(14px, 3vw, 20px);
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
    animation: pulse 2s infinite;
    padding: 0 20px;
}

#instructions div {
    margin: 10px 0;
}

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

#game-over {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    background: rgba(0, 0, 0, 0.9);
    padding: clamp(20px, 5vw, 40px) clamp(30px, 8vw, 60px);
    border-radius: 20px;
    border: 3px solid #ff00ff;
    box-shadow: 0 0 30px rgba(255, 0, 255, 0.8);
    max-width: 90%;
}

#game-over h1 {
    font-size: clamp(32px, 8vw, 48px);
    color: #ff00ff;
    text-shadow: 0 0 20px rgba(255, 0, 255, 0.8);
    margin-bottom: 20px;
    animation: glitch 1s infinite;
}

#game-over p {
    font-size: clamp(16px, 4vw, 24px);
    margin: 10px 0;
    color: #00ffff;
}

.hidden {
    display: none !important;
}

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

/* Mobile optimizations */
@media (max-width: 768px) {
    #instructions {
        font-size: 16px;
    }
    
    #instructions div {
        margin: 8px 0;
    }
    
    #game-over {
        padding: 20px 30px;
    }
}

@media (max-width: 480px) {
    #score, #best {
        font-size: 18px;
        top: 5px;
    }
    
    #score {
        left: 5px;
    }
    
    #best {
        right: 5px;
    }
    
    #powerup-indicator {
        font-size: 14px;
        top: 35px;
        left: 5px;
    }
    
    #instructions {
        font-size: 14px;
    }
    
    #game-over h1 {
        font-size: 36px;
    }
    
    #game-over p {
        font-size: 18px;
    }
}
