:root {
    --bg-color: #1e1e2f;
    --piano-bg: #2d2d44;
    --text-color: #e0e0ff;
    --accent-color: #4d88ff;
    --white-key-width: 55px;
    --black-key-width: 34px;
    --white-key-color: #f8f8f8;
    --white-key-active: #dcdcdc;
    --black-key-color: #333;
    --black-key-active: #555;
    --key-border: #bbb;
    --shadow-light: rgba(255, 255, 255, 0.1);
    --shadow-dark: rgba(0, 0, 0, 0.4);
}

body {
    
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2em 0;
    margin: 0;
    background-color: var(--bg-color);
    font-family: 'Poppins', sans-serif;
    color: var(--text-color);
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.piano-container {
    background-color: var(--piano-bg);
    padding: 2em;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    text-align: center;
    width: 95%;
    max-width: 1600px;
}

h1 { margin: 0; font-weight: 600; color: white; }
.author { color: var(--text-color); opacity: 0.7; margin: 0.25em 0 1em 0; font-style: italic; }
.subtitle { margin-bottom: 1.5em; font-weight: 300; opacity: 0.8; line-height: 1.5; }
.controls { margin-bottom: 1.5em; display: flex; justify-content: center; align-items: center; gap: 30px; flex-wrap: wrap; }
.control-group { display: flex; align-items: center; gap: 10px; }

#instrument-select { padding: 8px 12px; border-radius: 5px; border: 1px solid var(--accent-color); background-color: var(--bg-color); color: var(--text-color); font-family: 'Poppins', sans-serif; font-size: 1em; cursor: pointer; }


#volume-slider { -webkit-appearance: none; appearance: none; width: 150px; height: 8px; background: var(--bg-color); border-radius: 5px; border: 1px solid #444; outline: none; transition: opacity .2s; cursor: pointer; }
#volume-slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 20px; height: 20px; background: var(--accent-color); border-radius: 50%; border: 2px solid var(--piano-bg); cursor: pointer; }
#volume-slider::-moz-range-thumb { width: 20px; height: 20px; background: var(--accent-color); border-radius: 50%; border: 2px solid var(--piano-bg); cursor: pointer; }

#loading-indicator { padding: 1em; background-color: rgba(255, 215, 0, 0.2); border: 1px solid gold; border-radius: 5px; margin-bottom: 1.5em; display: none; }
#loading-indicator.visible { display: block; }

.keyboard-wrapper { display: flex; justify-content: center; overflow-x: auto; padding: 20px; background: #111; border-radius: 10px; border: 1px solid #000; }
.keyboard { display: flex; position: relative; }
.key { cursor: pointer; border: 1px solid var(--key-border); border-radius: 0 0 5px 5px; transition: all 0.07s ease; box-sizing: border-box; position: relative; display: flex; flex-direction: column; align-items: center; padding: 10px 0; }
.key.white { width: var(--white-key-width); height: 280px; background: linear-gradient(to bottom, #fff, #f0f0f0); box-shadow: 0 5px 1px var(--key-border), inset 0 2px 5px var(--shadow-light); z-index: 1; justify-content: flex-end; }
.key.white.active { background: var(--white-key-active); transform: translateY(3px); box-shadow: 0 2px 0px var(--key-border), inset 0 1px 2px var(--shadow-dark); }
.key.black { width: var(--black-key-width); height: 170px; background: linear-gradient(to bottom, #555, #333); position: absolute; top: 1px; z-index: 2; border-radius: 0 0 4px 4px; box-shadow: 0 4px 1px #222, inset 0 -3px 4px rgba(255, 255, 255, 0.1); justify-content: flex-end; }
.key.black.active { background: var(--black-key-active); transform: translateY(2px); box-shadow: 0 2px 0px #222, inset 0 -1px 2px rgba(255, 255, 255, 0.1); }
.key.keyboard-mapped { border-bottom: 4px solid var(--accent-color); padding-bottom: 6px; }
.note-name { font-size: 0.8em; font-weight: 600; pointer-events: none; }
.key.white .note-name { color: #888; }
.key.black .note-name { color: #ccc; }
.keyboard-key-label { font-size: 0.9em; font-weight: 600; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; border-radius: 4px; pointer-events: none; box-sizing: border-box; }
.key.white .keyboard-key-label { background-color: #e0e0e0; color: #333; border: 1px solid #ccc; margin-bottom: 8px; }
.key.black .keyboard-key-label { background-color: #555; color: #fff; border: 1px solid #777; position: absolute; top: 8px; left: 50%; transform: translateX(-50%); }



footer {
    width: 100%;
    margin-top: 3em;
    padding-top: 2em;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}
.footer-links {
    display: flex;
    justify-content: center;
    gap: 2.5em;
    margin-bottom: 1.5em;
}
.footer-links a {
    color: var(--text-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1em;
    opacity: 0.8;
    transition: all 0.2s ease-in-out;
}
.footer-links a:hover {
    opacity: 1;
    color: var(--accent-color);
    transform: translateY(-2px);
}
.footer-links i {
    font-size: 1.6em;
}
.footer-credit {
    font-size: 0.9em;
    opacity: 0.6;
}

@media (max-width: 600px) {
    .footer-links {
        flex-direction: column;
        gap: 1.5em;
        align-items: center;
    }
}


@media (max-width: 1600px) { :root { --white-key-width: 48px; --black-key-width: 30px; } }
@media (max-width: 1400px) { :root { --white-key-width: 42px; --black-key-width: 26px; } }
@media (max-width: 1100px) { :root { --white-key-width: 38px; --black-key-width: 24px; } .key.white { height: 200px; } .key.black { height: 120px; } .note-name { font-size: 0.7em; } .keyboard-key-label { width: 20px; height: 20px; font-size: 0.8em; } }