:root {
    --primary: #FF6B9D;
    --secondary: #FDB43A;
    --dark: #8B0000;
    --bg-start: #E0BBE4;
    --bg-end: #FFDFD3;
}

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

body {
    font-family: 'Fredoka', sans-serif;
    background: linear-gradient(135deg, var(--bg-start) 0%, var(--bg-end) 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
}

#game-container {
    position: relative;
    max-width: 800px;
    width: 100%;
    margin: 20px auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    overflow: hidden;
}

#canvas {
    display: block;
    width: 100%;
    height: auto;
    background: linear-gradient(180deg, var(--bg-start) 0%, var(--bg-end) 100%);
}

#ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

#ui-overlay > * {
    pointer-events: auto;
}

/* HUD */
#hud {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

#score-display {
    background: rgba(255, 255, 255, 0.9);
    padding: 15px 25px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.score-label {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#score {
    font-size: 36px;
    font-weight: 700;
    color: var(--primary);
    font-family: 'Space Mono', monospace;
}

#vibe-meter {
    background: rgba(255, 255, 255, 0.9);
    padding: 15px 20px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    min-width: 200px;
}

.vibe-label {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.vibe-bar {
    height: 12px;
    background: #ddd;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 8px;
}

#vibe-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    width: 0%;
    transition: width 0.3s ease;
}

#combo {
    font-size: 18px;
    font-weight: 700;
    color: var(--secondary);
    text-align: center;
}

/* Start Screen */
#start-screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(224, 187, 228, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.title-section {
    text-align: center;
    margin-bottom: 40px;
}

.game-title {
    font-size: 64px;
    font-weight: 700;
    color: var(--primary);
    text-shadow: 4px 4px 0 rgba(0, 0, 0, 0.1);
    margin-bottom: 10px;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.subtitle {
    font-size: 20px;
    color: #666;
    font-weight: 500;
}

.instructions {
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    margin-bottom: 30px;
    max-width: 400px;
}

.instruction-item {
    font-size: 18px;
    margin-bottom: 15px;
    color: #333;
}

.key {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 5px 12px;
    border-radius: 8px;
    font-weight: 700;
    font-family: 'Space Mono', monospace;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.instruction-tip {
    font-size: 16px;
    color: #666;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #eee;
    font-style: italic;
}

#high-score-display {
    font-size: 24px;
    font-weight: 600;
    color: #666;
    margin-bottom: 30px;
}

#high-score {
    color: var(--primary);
    font-family: 'Space Mono', monospace;
}

.game-button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 20px 50px;
    border-radius: 50px;
    font-size: 24px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(255, 107, 157, 0.4);
    transition: all 0.3s ease;
    font-family: 'Fredoka', sans-serif;
    margin-bottom: 30px;
}

.game-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(255, 107, 157, 0.5);
}

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

.difficulty-selector {
    display: flex;
    gap: 10px;
}

.difficulty-btn {
    background: white;
    border: 3px solid var(--primary);
    color: var(--primary);
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Fredoka', sans-serif;
}

.difficulty-btn:hover {
    background: rgba(255, 107, 157, 0.1);
}

.difficulty-btn.active {
    background: var(--primary);
    color: white;
}

/* Game Over Screen */
#game-over-screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(139, 0, 0, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.game-over-title {
    font-size: 56px;
    font-weight: 700;
    color: white;
    margin-bottom: 30px;
    text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.3);
}

.final-score {
    background: white;
    padding: 30px 50px;
    border-radius: 20px;
    margin-bottom: 20px;
    text-align: center;
}

.final-score div {
    font-size: 28px;
    font-weight: 600;
    color: #333;
    margin: 10px 0;
}

.final-score span {
    color: var(--primary);
    font-family: 'Space Mono', monospace;
    font-size: 36px;
}

.high-score-label {
    font-size: 18px !important;
    color: #666 !important;
}

#encouragement {
    font-size: 20px;
    color: white;
    margin-bottom: 30px;
    text-align: center;
    max-width: 500px;
}

#achievements {
    margin-bottom: 30px;
}

.achievement-title {
    font-size: 18px;
    font-weight: 600;
    color: white;
    margin-bottom: 10px;
}

.achievement {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    margin: 5px;
    display: inline-block;
    font-size: 16px;
}

.share-button {
    background: var(--secondary);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 40px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 15px rgba(253, 180, 58, 0.4);
    transition: all 0.3s ease;
    font-family: 'Fredoka', sans-serif;
}

.share-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(253, 180, 58, 0.5);
}

/* Footer */
footer {
    text-align: center;
    padding: 30px;
    color: #666;
    max-width: 800px;
}

footer p {
    margin: 5px 0;
}

footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

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

.footer-joke {
    font-size: 14px;
    font-style: italic;
    opacity: 0.8;
}

/* Mute Button */
.mute-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    z-index: 1000;
}

.mute-btn:hover {
    transform: scale(1.1);
}

/* Utility */
.hidden {
    display: none !important;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .game-title {
        font-size: 40px;
    }
    
    .subtitle {
        font-size: 16px;
    }
    
    .instructions {
        padding: 20px;
    }
    
    .instruction-item {
        font-size: 16px;
    }
    
    .game-button {
        padding: 15px 35px;
        font-size: 20px;
    }
    
    .difficulty-btn {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    #score {
        font-size: 28px;
    }
    
    #vibe-meter {
        min-width: 150px;
    }
    
    .game-over-title {
        font-size: 40px;
    }
    
    .final-score div {
        font-size: 20px;
    }
    
    .final-score span {
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    #game-container {
        margin: 10px;
    }
    
    #hud {
        flex-direction: column;
        gap: 10px;
    }
    
    #score-display, #vibe-meter {
        width: 100%;
    }
    
    .game-title {
        font-size: 32px;
    }
    
    .difficulty-selector {
        flex-direction: column;
        width: 100%;
    }
    
    .difficulty-btn {
        width: 100%;
    }
}