.piano-wrapper {
    display: flex;
    height: 220px;
    justify-content: safe center;
    margin-top: 0.5rem;
    user-select: none;
    -webkit-user-select: none;
    overflow-x: auto;
    padding: 10px 0;
    -webkit-overflow-scrolling: touch;
}
.key-group { position: relative; margin: 0 1px; flex: 0 0 auto; }
.white-key {
    width: 50px;
    height: 100%;
    border: 1px solid rgba(0, 0, 0, 0.2);
    background: #fff;
    border-radius: 0 0 8px 8px;
    z-index: 1;
    cursor: pointer;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 12px;
    color: #666;
    font-weight: bold;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: background 0.08s;
    touch-action: none;
}
.white-key.active { background: #cfe3fb; }
.black-key {
    width: 32px;
    height: 60%;
    background: #222;
    border-radius: 0 0 6px 6px;
    z-index: 2;
    position: absolute;
    top: 0;
    right: -17px;
    cursor: pointer;
    color: #ccc;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 10px;
    font-size: 0.75rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transition: background 0.08s;
    touch-action: none;
}
.black-key.active { background: #0071e3; color: #fff; }
.white-key span, .black-key span { pointer-events: none; }

.synth-scope {
    display: block; width: 100%; height: 110px;
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
}
body.dark-mode .synth-scope { background: rgba(255, 255, 255, 0.04); }
.synth-octave { min-width: 2ch; text-align: center; }

#noteLog {
    background: #1c1c1e;
    color: #4ade80;
    font-family: monospace;
    font-size: 0.9rem;
    resize: none;
}
#noteLog::placeholder { color: rgba(74, 222, 128, 0.6); }
.btn-rec { color: #ac202e; border: 1.5px solid #ac202e; }
.btn-rec:hover, .btn-rec.active { background-color: #ac202e; color: #fff; }
.btn-rec.active { animation: synth-rec 1.2s ease-in-out infinite; }
@keyframes synth-rec { 50% { opacity: 0.65; } }
.btn-stop { color: #6c757d; border: 1.5px solid #6c757d; }
.btn-stop:hover { background-color: #6c757d; color: #fff; }
@media (prefers-reduced-motion: reduce) { .btn-rec.active { animation: none; } }
