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

body {
    background-color: #000;
    font-family: 'Inter', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    overflow-y: auto;
}

.visualizer-container {
    width: 95vw;
    max-width: 1000px;
    background: #111;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.controls-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 15px;
    color: #ccc;
    font-size: 14px;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 5px;
}

.controls-bar select, .controls-bar input[type="number"] {
    padding: 4px 8px;
    background: #222;
    color: #fff;
    border: 1px solid #444;
    border-radius: 4px;
    font-family: 'Inter', sans-serif;
    outline: none;
}

button.record-btn {
    background-color: #444;
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-weight: bold;
}

button.record-btn.recording {
    background-color: #ff3b30;
    animation: pulse 1s infinite;
}

button.play-btn {
    background-color: #4CAF50;
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-weight: bold;
}

button.play-btn.playing {
    background-color: #ff9800;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}

button.clear-btn {
    background-color: #555;
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
}

.note-display {
    height: 250px;
    background: #fff;
    border-radius: 4px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    position: relative;
    border-bottom: 2px solid #ccc;
    overflow-x: auto;
    overflow-y: hidden;
}

#sheet-music-container {
    height: 100%;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding-left: 20px;
    min-width: max-content;
}

/* Optional: align note letters exactly above keys using absolute positioning */
.note-label {
    position: absolute;
    bottom: 10px;
    transform: translateX(-50%);
    font-size: 32px;
    color: #333;
    transition: opacity 0.1s ease;
}

.piano-keyboard,
.big-piano-keyboard {
    position: relative;
    height: 200px;
    display: flex;
    background: #333;
    border: 2px solid #222;
    border-radius: 0 0 6px 6px;
    user-select: none;
    margin-top: 1rem;
}

.gs-key {
    position: relative;
    cursor: pointer;
    border: 1px solid #000;
    border-top: none;
    transition: background-color 0.05s ease;
}

.gs-white {
    flex: 1;
    background: linear-gradient(to bottom, #fff 0%, #eee 100%);
    z-index: 1;
    border-radius: 0 0 4px 4px;
}

.gs-black {
    position: absolute;
    width: 2%; /* will be set by JS dynamically based on flex */
    height: 60%;
    background: linear-gradient(to bottom, #222 0%, #000 100%);
    z-index: 2;
    border-radius: 0 0 4px 4px;
    transform: translateX(-50%);
}

.gs-key-label {
    position: absolute;
    bottom: 8px;
    width: 100%;
    text-align: center;
    font-size: 11px;
    color: #666;
    pointer-events: none;
    font-weight: 600;
}

/* Active State */
.gs-white.active {
    background: #2196F3;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
}

.gs-black.active {
    background: #1976D2;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.8);
}
