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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #333;
}

#game-container {
    width: 90%;
    max-width: 1200px;
    min-height: 80vh;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    padding: 20px;
    text-align: center;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 2.5em;
    margin: 0;
}

#score-display {
    font-size: 1.5em;
    font-weight: bold;
}

.screen {
    padding: 40px;
    text-align: center;
}

.screen.hidden {
    display: none;
}

#main-menu h2 {
    font-size: 2em;
    margin-bottom: 20px;
    color: #667eea;
}

#main-menu p {
    font-size: 1.2em;
    margin-bottom: 30px;
    color: #666;
}

.instructions {
    margin-top: 40px;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 10px;
    text-align: left;
}

.instructions h3 {
    color: #667eea;
    margin-bottom: 15px;
}

.instructions p {
    margin: 10px 0;
    font-size: 1em;
}

.mode-selection {
    margin: 30px 0;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 10px;
}

.mode-selection h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.mode-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.mode-button {
    background: white;
    border: 2px solid #667eea;
    color: #667eea;
    padding: 15px 25px;
    font-size: 1.1em;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    min-width: 180px;
}

.mode-button:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.mode-button.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #764ba2;
}

.mode-content {
    margin-top: 20px;
}

.mode-content.hidden {
    display: none;
}

.fingering-instructions {
    margin: 20px 0;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 10px;
    text-align: left;
}

.fingering-instructions h3 {
    color: #667eea;
    margin-bottom: 15px;
}

.fingering-instructions p {
    margin: 10px 0;
    font-size: 1em;
}

.song-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
    margin: 0 auto;
}

.song-button {
    background: white;
    border: 2px solid #667eea;
    color: #667eea;
    padding: 15px 30px;
    font-size: 1.1em;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.song-button:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.song-button.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #764ba2;
}

.game-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.2em;
    border-radius: 50px;
    cursor: pointer;
    margin: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.game-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

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

#game-screen {
    padding: 20px;
}

#track-container {
    position: relative;
    width: 100%;
    height: 400px;
    background: linear-gradient(to bottom, #1a1a2e 0%, #16213e 100%);
    border-radius: 10px;
    margin-bottom: 30px;
    overflow: hidden;
}

#game-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

#target-line {
    position: absolute;
    bottom: 60px;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 100, 100, 1) 20%, rgba(255, 100, 100, 1) 80%, rgba(255, 255, 255, 0) 100%);
    box-shadow: 0 0 10px rgba(255, 100, 100, 0.8);
    pointer-events: none;
}

#flute-diagram {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 30px;
    padding: 30px 20px;
    background: linear-gradient(to bottom, #f8f8f8 0%, #e8e8e8 100%);
    border-radius: 10px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.1);
    min-height: 200px;
}

#flute-svg {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

/* SVG Flute Key Animations */
.flute-key-svg {
    transition: all 0.2s ease-in-out;
}

.flute-key-svg .key-preview {
    transition: opacity 0.3s ease-in-out;
}

.flute-key-svg .key-highlight {
    transition: opacity 0.2s ease-in-out;
}

.flute-key-svg .key-highlight.hit-pulse {
    animation: hit-pulse-animation 0.3s ease-out;
}

@keyframes hit-pulse-animation {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0.9;
    }
}

/* Legacy flute key styles - kept for backwards compatibility */

.flute-key {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #e0e0e0 0%, #c0c0c0 100%);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 1.5em;
    font-weight: bold;
    position: relative;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.1s;
    border: 3px solid #999;
}

.flute-key.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: scale(0.95);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.flute-key.preview {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: white;
    border-color: #FF8C00;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.5);
    animation: preview-pulse 1s infinite;
}

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

.key-indicator {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.6) 0%, rgba(255, 215, 0, 0) 70%);
    animation: pulse 0.5s;
    pointer-events: none;
}

@keyframes pulse {
    0% {
        opacity: 0;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
    100% {
        opacity: 0;
        transform: scale(1.4);
    }
}

.flute-key.active .key-indicator {
    opacity: 1;
}

#game-controls {
    text-align: center;
}

#pause-menu, #fingering-screen {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

#staff-container {
    text-align: center;
    background: linear-gradient(to bottom, #f8f8f8 0%, #e8e8e8 100%);
    padding: 30px;
    border-radius: 15px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.1);
}

#staff-container h2 {
    color: #667eea;
    margin-bottom: 10px;
}

#staff-container p {
    color: #666;
    margin-bottom: 20px;
}

#treble-staff {
    margin: 30px auto;
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    cursor: pointer;
}

#current-note-info {
    margin-top: 20px;
    padding: 15px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#selected-note-display {
    color: #667eea;
    margin-bottom: 5px;
    font-size: 1.5em;
}

#note-description {
    color: #666;
    margin: 0;
}

#flute-diagram-fingering {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px 20px;
    background: linear-gradient(to bottom, #f8f8f8 0%, #e8e8e8 100%);
    border-radius: 10px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.1);
    min-height: 200px;
}

#fingering-controls {
    text-align: center;
    padding: 20px;
}

.staff-note {
    cursor: pointer;
    transition: all 0.2s ease;
}

.staff-note:hover {
    fill: #667eea;
    stroke: #667eea;
    transform: translateY(-3px);
}

.staff-note.selected {
    fill: #f5576c;
    stroke: #f5576c;
    transform: translateY(-5px);
}

.staff-line {
    stroke: #333;
    stroke-width: 1;
}

.clef {
    fill: #333;
    font-family: 'Times New Roman', serif;
    font-size: 48px;
    font-weight: bold;
}

#pause-menu, #game-over-screen {
    padding: 60px 40px;
}

#pause-menu h2, #game-over-screen h2 {
    font-size: 2.5em;
    color: #667eea;
    margin-bottom: 30px;
}

#game-over-screen p {
    font-size: 1.5em;
    margin-bottom: 30px;
    color: #666;
}

#final-score {
    color: #f5576c;
    font-weight: bold;
    font-size: 1.3em;
}

@media (max-width: 768px) {
    #game-container {
        width: 95%;
    }

    header h1 {
        font-size: 1.8em;
    }

    #score-display {
        font-size: 1.2em;
    }

    .flute-key {
        width: 60px;
        height: 60px;
        font-size: 1.2em;
    }

    #flute-diagram {
        gap: 10px;
    }

    #track-container {
        height: 300px;
    }
}
