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

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

body {
    background: linear-gradient(45deg, #1a0033, #330066, #1a0033);
    background-size: 400% 400%;
    animation: raveBackground 8s ease-in-out infinite;
    font-family: 'Orbitron', monospace;
    overflow: hidden;
    height: 100vh;
    color: #ffffff;
}

@keyframes raveBackground {
    0%, 100% { background-position: 0% 50%; }
    25% { background-position: 100% 0%; }
    50% { background-position: 100% 100%; }
    75% { background-position: 0% 100%; }
}

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

#gameCanvas {
    border: 2px solid #00ffff;
    border-radius: 10px;
    box-shadow: 
        0 0 20px #00ffff,
        0 0 40px #00ffff,
        inset 0 0 20px rgba(0, 255, 255, 0.1);
    background: #000;
    max-width: 100vw;
    max-height: 100vh;
}

#hud {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    pointer-events: none;
    z-index: 10;
}

#hud > div {
    background: rgba(0, 0, 0, 0.8);
    padding: 8px 15px;
    border-radius: 20px;
    border: 2px solid #00ffff;
    box-shadow: 0 0 10px #00ffff;
    font-weight: bold;
    text-shadow: 0 0 5px #00ffff;
    margin: 5px;
}

#timer {
    flex: 1;
    max-width: 200px;
    height: 20px;
    background: rgba(255, 0, 0, 0.3);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    margin: 0 20px;
}

#timeBar {
    height: 100%;
    background: linear-gradient(90deg, #ff0000, #ffff00, #00ff00);
    border-radius: 10px;
    transition: width 0.1s ease;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.9);
    z-index: 20;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.screen.active {
    opacity: 1;
    pointer-events: all;
}

#logo {
    font-size: 4rem;
    font-weight: 900;
    background: linear-gradient(45deg, #ff1493, #00ffff, #32cd32);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: raveText 3s ease-in-out infinite;
    text-shadow: 0 0 30px rgba(255, 20, 147, 0.8);
    margin-bottom: 20px;
}

@keyframes raveText {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

#subtitle {
    font-size: 1.5rem;
    color: #00ffff;
    text-shadow: 0 0 10px #00ffff;
    margin-bottom: 40px;
}

.neon-btn {
    background: transparent;
    border: 2px solid #00ffff;
    color: #00ffff;
    padding: 15px 30px;
    font-family: 'Orbitron', monospace;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 25px;
    cursor: pointer;
    margin: 10px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    overflow: hidden;
}

.neon-btn:hover {
    background: rgba(0, 255, 255, 0.1);
    box-shadow: 
        0 0 20px #00ffff,
        inset 0 0 20px rgba(0, 255, 255, 0.1);
    transform: translateY(-2px);
}

.neon-btn:active {
    transform: translateY(0);
}

.neon-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.neon-btn:hover::before {
    left: 100%;
}

#highScore, #finalScore {
    margin-top: 20px;
    font-size: 1.2rem;
    color: #32cd32;
    text-shadow: 0 0 10px #32cd32;
}

#instructions {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    padding: 15px 25px;
    border-radius: 20px;
    border: 1px solid #00ffff;
    font-size: 0.9rem;
    text-align: center;
    color: #ffffff;
    text-shadow: 0 0 5px #00ffff;
}

#gameOverTitle {
    font-size: 3rem;
    font-weight: 900;
    color: #ff1493;
    text-shadow: 0 0 20px #ff1493;
    margin-bottom: 30px;
    animation: pulse 2s ease-in-out infinite;
}

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

#combo {
    color: #ffff00;
    border-color: #ffff00;
    box-shadow: 0 0 10px #ffff00;
    text-shadow: 0 0 5px #ffff00;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    #logo {
        font-size: 2.5rem;
    }
    
    #subtitle {
        font-size: 1.2rem;
    }
    
    .neon-btn {
        padding: 12px 25px;
        font-size: 1rem;
    }
    
    #hud {
        font-size: 0.8rem;
        top: 10px;
        left: 10px;
        right: 10px;
    }
    
    #hud > div {
        padding: 5px 10px;
        margin: 2px;
    }
    
    #instructions {
        font-size: 0.8rem;
        padding: 10px 15px;
        bottom: 20px;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}