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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #111111;
    min-height: 100vh;
    padding: 20px;
    color: #F8F7F6;
}

.container {
    max-width: 2400px;
    margin: 0 auto;
    background: #1e1e1e;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    color: #CC2929;
    font-size: 2.5em;
    font-weight: 700;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    margin-bottom: 40px;
    padding: 20px;
    background: #252525;
    border-radius: 15px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-group label {
    font-weight: 600;
    color: #aaa;
    font-size: 0.9em;
}

.control-group select {
    padding: 10px 15px;
    border: 2px solid #444;
    border-radius: 8px;
    font-size: 1em;
    background: #1e1e1e;
    cursor: pointer;
    transition: border-color 0.3s;
    color: #F8F7F6;
}

.control-group select:hover {
    border-color: #CC2929;
}

.control-group select:focus {
    outline: none;
    border-color: #CC2929;
    box-shadow: 0 0 0 3px rgba(232, 137, 74, 0.1);
}

.play-button {
    padding: 12px 24px;
    background: #E8894A;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 24px;
}

.play-button:hover {
    background: #d4773e;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(232, 137, 74, 0.3);
}

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

.piano-container {
    margin: 40px 0;
    padding: 20px;
    background: #252525;
    border-radius: 15px;
    overflow-x: auto;
}

.piano-keyboard {
    display: flex;
    position: relative;
    height: 200px;
    margin: 0 auto;
    width: fit-content;
    background: #111111;
    padding: 10px;
    border-radius: 10px;
}

.key {
    position: relative;
    cursor: pointer;
    user-select: none;
}

.white-key {
    width: 50px;
    height: 180px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 0 0 5px 5px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding-bottom: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
}

.white-key:hover {
    background: #f0f0f0;
}

.white-key.left-hand {
    background: #4a90e2 !important;
    color: white;
    font-weight: bold;
}

.white-key.right-hand {
    background: #e74c3c !important;
    color: white;
    font-weight: bold;
}

.white-key.both-hands {
    background: linear-gradient(to right, #4a90e2 50%, #e74c3c 50%) !important;
    color: white;
    font-weight: bold;
}

.key-label {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
}

.white-key.left-hand .key-label,
.white-key.right-hand .key-label,
.white-key.both-hands .key-label {
    color: white;
}

.finger-number {
    font-size: 1.8em;
    font-weight: bold;
    color: #F8F7F6;
}

.white-key.left-hand .finger-number,
.white-key.right-hand .finger-number,
.white-key.both-hands .finger-number {
    color: white;
}

.black-key {
    position: absolute;
    width: 30px;
    height: 110px;
    background: #1a1a1a;
    border-radius: 0 0 3px 3px;
    z-index: 1;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding-bottom: 8px;
    transition: all 0.2s;
}

.black-key:hover {
    background: #2a2a2a;
}

.black-key.left-hand {
    background: #357abd !important;
    color: white;
}

.black-key.right-hand {
    background: #c0392b !important;
    color: white;
}

.black-key.both-hands {
    background: linear-gradient(to right, #357abd 50%, #c0392b 50%) !important;
    color: white;
}

.black-key .key-label {
    font-size: 0.7em;
    color: #ddd;
    margin-bottom: 3px;
}

/* Black key: sharp on top, flat below (e.g. C# / Db) */
.black-key .key-label.black-key-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.black-key .key-label-sharp {
    font-size: 1em;
    line-height: 1.1;
}

.black-key .key-label-flat {
    font-size: 0.85em;
    line-height: 1.1;
    opacity: 0.9;
}

.black-key.left-hand .key-label,
.black-key.right-hand .key-label,
.black-key.both-hands .key-label {
    color: white;
}

.black-key.left-hand .key-label-flat,
.black-key.right-hand .key-label-flat,
.black-key.both-hands .key-label-flat {
    opacity: 0.95;
}

.black-key .finger-number {
    font-size: 1.2em;
}

.info-table-container {
    margin: 40px 0;
    display: flex;
    justify-content: center;
}

.info-table {
    border-collapse: collapse;
    width: 100%;
    max-width: 600px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.info-table-header {
    background: #CC2929;
    color: white;
    padding: 20px;
    text-align: center;
    font-size: 1.5em;
    font-weight: 700;
}

.info-table-row {
    display: flex;
    border-bottom: 1px solid #333;
}

.info-table-row:last-child {
    border-bottom: none;
}

.info-table-label {
    background: #2a2a2a;
    padding: 15px 20px;
    font-weight: 600;
    width: 200px;
    color: #aaa;
}

.info-table-value {
    padding: 15px 20px;
    background: #1e1e1e;
    flex: 1;
    font-size: 1.1em;
}

.info-table-value.left-hand-fingering {
    background: #4a90e2;
    color: white;
    font-weight: bold;
}

.info-table-value.right-hand-fingering {
    background: #e74c3c;
    color: white;
    font-weight: bold;
}

.finger-reference {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 40px;
    padding: 30px;
    background: #252525;
    border-radius: 15px;
}

.hand-diagram {
    text-align: center;
}

.hand-diagram h3 {
    margin-bottom: 15px;
    font-size: 1.3em;
}

.left-hand h3 {
    color: #4a90e2;
}

.right-hand h3 {
    color: #e74c3c;
}

.fingers {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.finger {
    width: 60px;
    height: 120px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s;
}

.left-hand .finger {
    background: #4a90e2;
}

.right-hand .finger {
    background: #e74c3c;
}

.finger:hover {
    transform: translateY(-5px);
}

.finger span {
    font-size: 0.8em;
    margin-top: 5px;
    opacity: 0.9;
}

@media (max-width: 768px) {
    .controls {
        flex-direction: column;
    }

    .finger-reference {
        flex-direction: column;
        gap: 20px;
    }

    .piano-keyboard {
        height: 150px;
    }

    .white-key {
        width: 40px;
        height: 130px;
    }

    .black-key {
        width: 24px;
        height: 80px;
    }
}
