.piano-wrapper {
    display: flex;
    height: 220px;
    justify-content: center;
    margin-top: 2rem;
    user-select: none;
    overflow-x: auto;
    padding: 10px 0;
    -webkit-overflow-scrolling: touch; 
}
.key-group {
    position: relative;
    margin: 0 1px;
}
.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.1s;
    touch-action: manipulation;
}
.white-key.active, .white-key:hover:active { background: #e0e0e0; }

.black-key {
    width: 32px;
    height: 60%;
    background: #222;
    border-radius: 0 0 6px 6px;
    z-index: 2;
    position: absolute;
    top: 0;
    right: -16px;
    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.1s;
    touch-action: manipulation;
}
.black-key.active, .black-key:hover:active { background: #000; }

#noteLog {
    background: #1c1c1e;
    color: #4ade80;
    font-family: monospace;
    font-size: 0.9rem;
    resize: none;
}

.btn-rec {
    color: #ac202e;
    border: 1.5px solid #ac202e;
}
.btn-rec:hover, .btn-rec.active {
    background-color: #ac202e;
    color: #fff;
}
.btn-stop {
    color: #6c757d;
    border: 1.5px solid #6c757d;
}
.btn-stop:hover {
    background-color: #6c757d;
    color: #fff;
}