@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', sans-serif;
    background: #000;
    color: #fff;
    overflow: hidden;
    user-select: none;
}

#canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.95);
    z-index: 100;
    backdrop-filter: blur(10px);
}

.screen.hidden {
    display: none;
}

.title-content, .gameover-content, .pause-content {
    text-align: center;
    padding: 20px;
}

.game-title {
    font-size: 5rem;
    font-weight: 900;
    letter-spacing: 0.2em;
    background: linear-gradient(45deg, #00A8FF, #FF4757, #FFA502, #26DE81);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 3s ease infinite;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.5);
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.2rem;
    color: #888;
    font-style: italic;
    margin-bottom: 30px;
}

.preview-container {
    margin: 30px auto;
    border: 2px solid #333;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(0, 168, 255, 0.3);
}

.difficulty-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 30px 0;
}

.difficulty-btn {
    padding: 15px 30px;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    background: #111;
    color: #888;
    border: 2px solid #333;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.difficulty-btn:hover {
    background: #222;
    border-color: #00A8FF;
    color: #00A8FF;
    transform: scale(1.05);
}

.difficulty-btn.selected {
    background: #00A8FF;
    color: #000;
    border-color: #00A8FF;
    box-shadow: 0 0 20px #00A8FF;
}

#start-btn, .game-btn {
    padding: 20px 60px;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, #00A8FF, #FF4757);
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    margin: 10px;
    transition: all 0.3s;
    box-shadow: 0 0 30px rgba(255, 71, 87, 0.5);
}

#start-btn:hover, .game-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 50px rgba(255, 71, 87, 0.8);
}

.pulse {
    animation: pulse 1.5s ease-in-out infinite;
}

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

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

/* HUD */
#hud {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

#hud.hidden {
    display: none;
}

.hud-top {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: all;
}

.score-container {
    text-align: center;
}

.score-label {
    font-size: 1.2rem;
    color: #888;
    letter-spacing: 0.2em;
}

.score-value {
    font-size: 4rem;
    font-weight: 900;
    background: linear-gradient(135deg, #FFA502, #FF4757);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(255, 71, 87, 0.5);
}

.hud-side {
    position: absolute;
    top: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stat {
    background: rgba(0, 0, 0, 0.8);
    padding: 15px 25px;
    border-radius: 10px;
    border: 2px solid #333;
    display: flex;
    justify-content: space-between;
    gap: 15px;
    min-width: 200px;
}

.stat-label {
    color: #888;
    font-size: 1rem;
}

.stat-value {
    font-weight: 900;
    font-size: 1.3rem;
    color: #00A8FF;
}

.combo-glow {
    animation: comboGlow 0.5s ease-in-out infinite;
}

.mega-combo {
    color: #FF4757 !important;
    animation: megaCombo 0.3s ease-in-out infinite;
}

@keyframes comboGlow {
    0%, 100% { text-shadow: 0 0 10px #00A8FF; }
    50% { text-shadow: 0 0 20px #00A8FF; }
}

@keyframes megaCombo {
    0%, 100% { transform: scale(1); text-shadow: 0 0 20px #FF4757; }
    50% { transform: scale(1.2); text-shadow: 0 0 40px #FF4757; }
}

.speed-bar {
    background: rgba(0, 0, 0, 0.8);
    padding: 15px 25px;
    border-radius: 10px;
    border: 2px solid #333;
}

.speed-label {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.speed-track {
    width: 150px;
    height: 10px;
    background: #222;
    border-radius: 5px;
    overflow: hidden;
}

.speed-fill {
    height: 100%;
    background: linear-gradient(90deg, #26DE81, #FFA502, #FF4757);
    width: 0%;
    transition: width 0.3s;
}

.control-btn {
    position: absolute;
    bottom: 30px;
    padding: 15px 20px;
    font-size: 1.5rem;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #333;
    border-radius: 10px;
    cursor: pointer;
    pointer-events: all;
    transition: all 0.3s;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #00A8FF;
    transform: scale(1.1);
}

#pause-btn {
    right: 90px;
}

#mute-btn {
    right: 30px;
}

/* Game Over Screen */
.gameover-title {
    font-size: 3rem;
    font-weight: 900;
    color: #FF4757;
    letter-spacing: 0.2em;
    margin-bottom: 30px;
    text-shadow: 0 0 30px #FF4757;
}

.final-score-container {
    margin: 30px 0;
}

.final-score-label {
    font-size: 1.5rem;
    color: #888;
    letter-spacing: 0.2em;
}

.final-score {
    font-size: 6rem;
    font-weight: 900;
    background: linear-gradient(135deg, #FFA502, #FF4757);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: scoreReveal 1s ease-out;
}

@keyframes scoreReveal {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 40px 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.stat-item {
    background: rgba(0, 0, 0, 0.8);
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #333;
}

.stat-item-value {
    font-size: 2.5rem;
    font-weight: 900;
    color: #00A8FF;
    margin-bottom: 5px;
}

.stat-item-label {
    font-size: 0.9rem;
    color: #888;
}

.insanity-level {
    font-size: 1.8rem;
    font-weight: 900;
    color: #FFA502;
    margin: 30px 0;
    text-shadow: 0 0 20px #FFA502;
}

.achievements {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin: 20px 0;
}

.achievement {
    padding: 10px 20px;
    background: rgba(38, 222, 129, 0.2);
    border: 2px solid #26DE81;
    border-radius: 20px;
    color: #26DE81;
    font-weight: 700;
}

.gameover-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

/* Pause Screen */
.pause-title {
    font-size: 4rem;
    font-weight: 900;
    color: #00A8FF;
    letter-spacing: 0.2em;
    margin-bottom: 20px;
    text-shadow: 0 0 30px #00A8FF;
}

.pause-subtitle {
    font-size: 1.3rem;
    color: #888;
    font-style: italic;
    margin-bottom: 40px;
}

/* Footer */
.app-footer {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8rem;
    color: #555;
    z-index: 200;
    pointer-events: all;
}

.app-footer a {
    color: #00A8FF;
    text-decoration: none;
}

.app-footer a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .game-title {
        font-size: 2.5rem;
    }
    
    .difficulty-buttons {
        flex-direction: column;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .hud-side {
        right: 10px;
        top: 10px;
    }
    
    .stat {
        min-width: 150px;
        padding: 10px 15px;
    }
    
    .score-value {
        font-size: 2.5rem;
    }
    
    .final-score {
        font-size: 4rem;
    }
}