@font-face {
    font-family: 'Bravura';
    src: url('https://cdn.jsdelivr.net/gh/musescore/MuseScore@master/fonts/bravura/Bravura.otf') format('opentype');
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #f0f4f8;
    margin: 0;
    padding: 20px;
}

.container {
    background-color: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    text-align: center;
    max-width: 800px;
    width: 100%;
}

h1 {
    color: #2c3e50;
    margin-bottom: 25px;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

label {
    font-weight: bold;
    margin-bottom: 5px;
    color: #34495e;
}

select {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #bdc3c7;
    background-color: white;
    font-size: 16px;
    cursor: pointer;
}

.btn {
    padding: 8px 20px;
    border-radius: 6px;
    border: none;
    background-color: #3498db;
    color: white;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn:hover {
    background-color: #2980b9;
}

.btn:active {
    background-color: #1c638e;
}

canvas {
    background-color: white;
    cursor: pointer;
    max-width: 100%;
    height: auto;
}

.instructions {
    margin-top: 20px;
    color: #7f8c8d;
    font-style: italic;
    margin-bottom: 20px;
}

#piano-container {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    overflow-x: auto;
    padding-bottom: 10px;
}

.piano {
    display: flex;
    position: relative;
    height: 150px;
    user-select: none;
}

.key {
    border: 1px solid #333;
    border-radius: 0 0 5px 5px;
    cursor: pointer;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 10px;
    position: relative;
    transition: background-color 0.1s;
}

.white-key {
    width: 40px;
    height: 150px;
    background-color: white;
    z-index: 1;
}

.black-key {
    width: 26px;
    height: 90px;
    background-color: #333;
    z-index: 2;
    margin-left: -13px;
    margin-right: -13px;
    color: white;
}

.white-key.active {
    background-color: #e74c3c;
    border-color: #c0392b;
}

.black-key.active {
    background-color: #c0392b;
}

.key-label {
    pointer-events: none;
    font-size: 12px;
    font-weight: bold;
}


.white-key .key-label {
    color: #333;
}

.black-key .key-label {
    color: white;
}

.white-key.primary-tonic-key .key-label, .black-key.primary-tonic-key .key-label {
    text-decoration: underline;
    font-weight: 900;
}

.white-key.in-scale {
    background-color: #ecf0f1;
}

.white-key.blue-note-key {
    background-color: #d6eaf8;
    border-color: #3498db;
}

.black-key.blue-note-key {
    background-color: #2980b9;
}

.white-key.blue-note-key .key-label {
    color: #2980b9;
}

.white-key.active .key-label, .black-key.active .key-label {
    color: white;
}

#note-display-container {
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
}

.note-card {
    background-color: #3498db;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 24px;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    opacity: 0;
    transform: translateY(10px) scale(0.9);
    transition: all 0.2s ease-out;
    pointer-events: none;
    z-index: 10;
}

.note-card.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}
