﻿/* Main CSS file for the MIDI Strudel Interface */

body {
    font-family: sans-serif;
    background-color: #2c2c2c; /* Dark background for the page */
    color: #f0f0f0; /* Light text color for readability */
    margin: 0;
    padding: 10px; /* Reduced from 20px */
    font-size: 13px; /* Setting a base font size, smaller than default 16px */
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #555;
    margin-bottom: 10px;
}

.github-fork-button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background-color: #21262d;
    color: #f0f6fc;
    text-decoration: none;
    border-radius: 6px;
    border: 1px solid #30363d;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.github-fork-button:hover {
    background-color: #30363d;
    border-color: #8b949e;
    color: #f0f6fc;
    text-decoration: none;
}

.fork-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

h1, h2 {
    color: #e0e0e0;
    border-bottom: 1px solid #555;
    padding-bottom: 3px; /* Reduced from 5px */
    /* Font sizes will be implicitly smaller due to body font-size or can be set explicitly if needed */
}

h1 {
    font-size: 1.8em; /* Was implicitly ~2em of 16px, now ~2em of 13px or explicit */
    border-bottom: none; /* Remove border since header has one */
    padding-bottom: 0;
    margin: 0;
}

h2 {
    font-size: 1.4em; /* Was implicitly ~1.5em of 16px */
}

section {
    margin-bottom: 2px;
    padding: 4px 8px;
    background-color: #383838; 
    border-radius: 4px;
}

/* Strudel Coder Specific Styles */
.component-panel, #strudelCoderContainer {
    background-color: #2a2f36; 
    padding: 8px; /* Reduced from 15px */
    border-radius: 4px; /* Reduced from 8px */
    border: 1px solid #4a4f56; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.2); /* Reduced shadow */
    color: #d0d0d0; 
    min-width: 280px;
}

#strudelCoderContainer h2 {
    margin-top: 0;
    color: #61dafb; 
    border-bottom: none;
    font-size: 1.3em; /* Adjusting Strudel Coder title specifically */
}

.strudel-coder-header {
    margin-bottom: 8px; /* Reduced from 15px */
    display: flex;
    align-items: center;
    gap: 10px;
}

.strudel-coder-header button {
    padding: 4px 8px; /* Same as actions buttons */
    border: none;
    border-radius: 3px;
    color: white;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.9em;
}

.strudel-coder-header #strudelClear {
    background-color: #d9534f; /* Red */
}
.strudel-coder-header #strudelClear:hover {
    background-color: #c9302c;
}

#strudelDeviceSelector {
    padding: 4px; /* Reduced from 8px */
    background-color: #3a3f46;
    color: #f0f0f0;
    border: 1px solid #5a5f66;
    border-radius: 3px; /* Slightly reduced */
    min-width: 120px; /* Reduced from 200px */
    font-size: 0.9em;
}

.strudel-coder-controls {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.notation-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
}

.notation-toggle label {
    font-size: 0.9em;
    color: #c0c0c0;
    font-weight: bold;
}

.sound-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sound-selector label {
    font-size: 0.9em;
    color: #c0c0c0;
    font-weight: bold;
}

#notationTypeToggle, #soundTypeSelector {
    padding: 4px 8px;
    background-color: #3a3f46;
    color: #f0f0f0;
    border: 1px solid #5a5f66;
    border-radius: 3px;
    font-size: 0.9em;
    min-width: 140px;
}

#notationTypeToggle:focus {
    outline: none;
    border-color: #61dafb;
    box-shadow: 0 0 3px rgba(97, 218, 251, 0.3);
}

#strudelCopyAndInject {
    padding: 6px 12px;
    border: none;
    border-radius: 3px;
    color: white;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.9em;
    background-color: #5cb85c; /* Green */
    transition: background-color 0.2s ease;
}

#strudelCopyAndInject:hover {
    background-color: #4cae4c;
}

#strudelCopyAndInject:active {
    background-color: #449d44;
    transform: translateY(1px);
}

.strudel-coder-actions button {
    padding: 4px 8px; /* Reduced from 8px 12px */
    border: none;
    border-radius: 3px;
    color: white;
    margin-right: 5px; /* Reduced from 10px */
    cursor: pointer;
    font-weight: bold;
    font-size: 0.9em;
}

#strudelCopyMusical {
    background-color: #5cb85c; /* Green */
}
#strudelCopyMusical:hover {
    background-color: #4cae4c;
}

#strudelCopyInteger {
    background-color: #5bc0de; /* Blue */
}
#strudelCopyInteger:hover {
    background-color: #46b8da;
}

.strudel-coder-output label {
    display: block;
    margin-top: 8px; /* Reduced from 15px */
    margin-bottom: 3px; /* Reduced from 5px */
    font-weight: bold;
    color: #a0a0a0; 
    font-size: 0.9em;
}

.strudel-coder-output pre {
    background-color: #1e1e1e; 
    color: #d4d4d4;
    padding: 6px; /* Reduced from 10px */
    border-radius: 3px;
    border: 1px solid #333;
    white-space: pre-wrap; 
    word-break: break-all;
    font-family: monospace;
    min-height: 25px; /* Reduced from 40px */
    font-size: 0.85em; /* Reduced font size for pre */
}

.strudel-coder-status p {
    margin: 4px 0; /* Reduced from 8px */
    font-size: 0.8em; /* Reduced from 0.9em */
    color: #b0b0b0;
}

.strudel-coder-status .hint-text {
    font-style: italic;
    color: #888;
}

/* General button styling (can be expanded) */
button {
    cursor: pointer;
    font-size: 0.9em; /* General button font size reduction */
}

/* Add some basic layout for main sections if needed */
main {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* Reduced minmax */
    gap: 4px;
}

#strudel-coder-section {
    grid-column: 1 / -1;
}

#strudel-integration-section {
    grid-column: 1 / -1;
}

#status-display {
    grid-column: 1 / -1;
}

/* Global Controls Styling - REMOVED: Now using key-scale-controls-panel */

/* Old control styling - keeping for reference but components now use panel styling */
.control-group {
    display: flex;
    flex-direction: column; 
    gap: 3px; /* Reduced from 5px */
}

.control-group label {
    font-size: 0.9em; /* Was 0.9em, relative to new body font so effectively smaller */
    color: #c0c0c0; 
    margin-bottom: 1px; /* Reduced from 2px */
}

#globalTonicSelector, #globalScaleSelector {
    padding: 4px; /* Reduced from 8px */
    background-color: #3a3f46;
    color: #f0f0f0;
    border: 1px solid #5a5f66;
    border-radius: 3px;
    min-width: 100px; /* Reduced from 150px */
    font-size: 0.9em;
}

/* New Synth Controls Styling */
.synth-control-group {
    display: flex;
    flex-direction: column; 
    align-items: flex-start; 
    gap: 2px; /* Reduced from 4px */
}

.synth-control-group label {
    font-size: 0.85em; /* Relative to new body font */
    color: #b0b0b0;
    margin-bottom: 0;
}

.synth-control-group select,
.synth-control-group input[type="range"] {
    padding: 3px; /* Reduced from 6px for select */
    background-color: #3a3f46;
    color: #f0f0f0;
    border: 1px solid #5a5f66;
    border-radius: 3px;
    box-sizing: border-box; 
    width: 100%; 
    max-width: 120px; /* Reduced from 180px */
    font-size: 0.9em;
}

.synth-control-group input[type="range"] {
    padding: 0; 
    height: 16px; /* Reduced from 20px */
}

.synth-control-group span { 
    font-size: 0.8em; /* Reduced from 0.8em (relative now) */
    color: #a0a0a0;
    min-width: 40px; /* Reduced from 50px */
    text-align: left;
}

/* Ensure Strudel Coder specific styles for its own select don't get overridden if too general */
#strudelDeviceSelector {
    /* Styles are already defined, just a reminder not to make global select styles too aggressive */
}

#status-display {
    grid-column: 1 / -1; /* ADDED #visual-keyboard-section back */
}

/* XY Pad Styling */
#xyPadContainer {
    display: flex;
    flex-direction: column; 
    align-items: left; 
    gap: 5px; /* Reduced from 10px */
}

#xyPadArea {
    width: 200px; /* Reduced from 250px */
    height: 200px; /* Reduced from 250px */
    background-color: #4a4f56; 
    border: 1px solid #61dafb; /* Reduced border width */
    position: relative; 
    cursor: crosshair;
    touch-action: none; 
}

#xyPadCrosshair {
    width: 7px; /* Reduced from 10px */
    height: 7px; /* Reduced from 10px */
    background-color: #ff5722; 
    border-radius: 50%;
    position: absolute;
    top: 50%; 
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none; 
}


#xyPadInfo {
    font-size: 0.85em; /* Reduced from 0.9em (relative now) */
    color: #c0c0c0;
    text-align: center;
}

#xyPadInfo p {
    margin: 2px 0; /* Reduced from 4px */
}

/* Reducing status display font size as well */
#status-display p {
    font-size: 0.9em;
    margin: 3px 0; /* Adding some margin control */
}

/* Footer font size */
footer p {
    font-size: 0.8em;
}

/* Visual Keyboard Styling */
#visual-keyboard-section {
    margin-bottom: 4px;
    padding: 8px;
    background-color: #383838; 
    border-radius: 4px;
    overflow: hidden;
}

.keyboard-layout {
    display: flex;
    gap: 15px;
    align-items: flex-start;
    transition: gap 0.25s ease;
    height: auto;
}

.keyboard-layout.controls-collapsed {
    gap: 0;
}

.keyboard-layout.controls-collapsed .keyboard-and-pad {
    min-width: 0;
}

#key-scale-controls-panel {
    width: 250px;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
    transition: width 0.25s ease, padding 0.25s ease, opacity 0.25s ease;
    overflow: hidden;
}

#key-scale-controls-panel.collapsed {
    width: 0;
    min-width: 0;
    height: 0;
    padding: 0;
    margin: 0;
    border: none;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
}

#key-scale-controls-panel h2 {
    margin-top: 0;
    color: #61dafb; 
    border-bottom: none;
    font-size: 1.3em;
}

#key-scale-controls-panel .control-group {
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

#key-scale-controls-panel .control-group label {
    font-size: 0.9em;
    color: #c0c0c0;
    font-weight: bold;
}

#key-scale-controls-panel select {
    padding: 6px 24px 6px 8px;
    background-color: #3a3f46;
    color: #f0f0f0;
    border: 1px solid #5a5f66;
    border-radius: 3px;
    font-size: 0.9em;
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23f0f0f0'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}

#key-scale-controls-panel select:focus {
    outline: none;
    border-color: #61dafb;
    box-shadow: 0 0 3px rgba(97, 218, 251, 0.3);
}

.keyboard-and-pad {
    flex: none;
    display: flex;
    flex-direction: row;
    gap: 15px;
    min-width: 0;
}

#pianoKeyboardContainer {
    flex: none;
    min-width: 1100px;
    width: 1100px;
    display: flex;
    height: 200px; /* Adjust height as needed */
    border: 1px solid #555;
    border-radius: 4px;
    overflow: hidden; /* Ensures rounded corners are visible for keys too */
    position: relative; /* For positioning black keys */
    background-color: #ccc; /* A light grey background for the container */
    box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
}

#xy-pad-section {
    display: flex;
    justify-content: flex-start;
    margin-left: 0px;
    flex-shrink: 0;
}

.piano-key {
    border: 1px solid #333;
    box-sizing: border-box;
    cursor: pointer;
    transition: background-color 0.05s ease-in-out;
    display: flex; /* For potential text/labels inside keys later */
    align-items: flex-end;
    justify-content: center;
    font-size: 0.7em;
    padding-bottom: 3px;
}

.white-key {
    background-color: #f8f8f8;
    color: #333;
    height: 100%;
    /* Calculate width based on 22 white keys for 3 octaves + 1 extra C. 
       Let's aim for a total width that fits the container nicely. 
       If container is ~400px, 400/22 = ~18px per white key */
    width: calc(100% / 22); /* Approximate, may need adjustment based on container width */
    z-index: 1;
}

.black-key {
    background-color: #333;
    color: #eee;
    height: 60%;
    width: calc(100% / 22 * 0.6);
    position: absolute;
    z-index: 2;
    /* margin-left: calc(-100% / 22 * 0.3); */ /* ENSURE THIS IS REMOVED */
}

/* Specific positioning for black keys, C3 (MIDI 48) start */
/* Visual Octave 1: Starts with C3 (MIDI 48) */
.black-key[data-note="49"] { left: calc(100% / 22 * 0.7); } /* C#3 */
.black-key[data-note="51"] { left: calc(100% / 22 * 1.7); } /* D#3 */
.black-key[data-note="54"] { left: calc(100% / 22 * 3.7); } /* F#3 */
.black-key[data-note="56"] { left: calc(100% / 22 * 4.7); } /* G#3 */
.black-key[data-note="58"] { left: calc(100% / 22 * 5.7); } /* A#3 */

/* Visual Octave 2: Starts 7 white keys after the displayed start (MIDI 60 is C4) */
.black-key[data-note="61"] { left: calc(100% / 22 * (7 + 0.7)); } /* C#4 */
.black-key[data-note="63"] { left: calc(100% / 22 * (7 + 1.7)); } /* D#4 */
.black-key[data-note="66"] { left: calc(100% / 22 * (7 + 3.7)); } /* F#4 */
.black-key[data-note="68"] { left: calc(100% / 22 * (7 + 4.7)); } /* G#4 */
.black-key[data-note="70"] { left: calc(100% / 22 * (7 + 5.7)); } /* A#4 */

/* Visual Octave 3: Starts 14 white keys after the displayed start (MIDI 72 is C5) */
.black-key[data-note="73"] { left: calc(100% / 22 * (14 + 0.7)); } /* C#5 */
.black-key[data-note="75"] { left: calc(100% / 22 * (14 + 1.7)); } /* D#5 */
.black-key[data-note="78"] { left: calc(100% / 22 * (14 + 3.7)); } /* F#5 */
.black-key[data-note="80"] { left: calc(100% / 22 * (14 + 4.7)); } /* G#5 */
.black-key[data-note="82"] { left: calc(100% / 22 * (14 + 5.7)); } /* A#5 */

.piano-key:hover {
    background-color: #ddd; /* Slightly darker for white keys on hover */
}
.black-key:hover {
    background-color: #555; /* Slightly lighter for black keys on hover */
}

.piano-key.key-pressed,
.piano-key.key-pressed-midi {
    background-color: #61dafb; /* Highlight color (same as Strudel title) */
    color: #fff;
    border-color: #40c4e8;
}

.black-key.key-pressed,
.black-key.key-pressed-midi {
    background-color: #61dafb;
    border-color: #40c4e8;
}

/* Global full-width sections */
#status-display, #visual-keyboard-section {
    grid-column: 1 / -1; /* Full width components spanning across all columns */
}

/* Gam içi (playable) */
.white-key.playable-key {
    background-color: #90ee90 !important;
}

.black-key.playable-key {
    background-color: #2e7d32 !important;
    color: #ccc !important;
}

/* Gam dışı (disabled) */
.piano-key.disabled-key {
    cursor: pointer;
}

.white-key.disabled-key {
    background-color: #d0d0d0 !important;
    color: #888 !important;
}

.black-key.disabled-key {
    /* No color override - stays default black */
} 


#strudel-integration-section {
    min-width: 0;
}

.strudel-integration-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.strudel-integration-header h2 {
    margin: 0;
    border-bottom: none;
}

.strudel-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

#copyStrudelSyntax {
    padding: 6px 12px;
    border: none;
    border-radius: 3px;
    color: white;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.9em;
    background-color: #61dafb;
    transition: background-color 0.2s ease;
}

#copyStrudelSyntax:hover {
    background-color: #40c4e8;
}

#copyStrudelSyntax:active {
    background-color: #2bb0d8;
    transform: translateY(1px);
}

#strudelDocsLink {
    padding: 6px 12px;
    border: 1px solid #61dafb;
    border-radius: 3px;
    color: #61dafb;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9em;
    background-color: transparent;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

#strudelDocsLink:hover {
    background-color: #61dafb;
    color: #2a2f36;
    text-decoration: none;
}

#strudelDocsLink:active {
    background-color: #40c4e8;
    border-color: #40c4e8;
    transform: translateY(1px);
}

.strudel-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    vertical-align: middle;
}



.strudel-bpm-control {
    margin-bottom: 8px;
    padding: 8px;
    background-color: rgba(97, 218, 251, 0.1);
    border-radius: 3px;
    border: 1px solid rgba(97, 218, 251, 0.3);
}

.strudel-bpm-control label {
    display: block;
    font-size: 0.9em;
    color: #c0c0c0;
    font-weight: bold;
    margin-bottom: 6px;
}

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

#strudelBpmSlider {
    flex: 1;
    height: 18px;
    background-color: #3a3f46;
    border-radius: 3px;
    outline: none;
    border: 1px solid #5a5f66;
}

#strudelBpmSlider::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    background-color: #61dafb;
    border-radius: 50%;
    cursor: pointer;
}

#strudelBpmSlider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background-color: #61dafb;
    border-radius: 50%;
    border: none;
    cursor: pointer;
}

#strudelBpmValue {
    font-size: 0.9em;
    color: #61dafb;
    font-weight: bold;
    min-width: 35px;
    text-align: center;
    background-color: #2a2f36;
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid #4a4f56;
}

.strudel-quantize-control {
    margin-bottom: 8px;
    padding: 8px;
    background-color: rgba(255, 152, 0, 0.1);
    border-radius: 3px;
    border: 1px solid rgba(255, 152, 0, 0.3);
}

.strudel-quantize-control label {
    display: block;
    font-size: 0.9em;
    color: #c0c0c0;
    font-weight: bold;
    margin-bottom: 6px;
}

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

#strudelQuantizeSlider {
    flex: 1;
    height: 18px;
    background-color: #3a3f46;
    border-radius: 3px;
    outline: none;
    border: 1px solid #5a5f66;
}

#strudelQuantizeSlider::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    background-color: #ff9800;
    border-radius: 50%;
    cursor: pointer;
}

#strudelQuantizeSlider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background-color: #ff9800;
    border-radius: 50%;
    border: none;
    cursor: pointer;
}

#strudelQuantizeValue {
    font-size: 0.9em;
    color: #ff9800;
    font-weight: bold;
    min-width: 55px;
    text-align: center;
    background-color: #2a2f36;
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid #4a4f56;
}

.autocomplete-container {
    position: relative;
    min-width: 200px;
}

.dropdown-input-wrapper {
    display: flex;
    align-items: center;
    background-color: #3a3f46;
    border: 1px solid #5a5f66;
    border-radius: 3px;
}

#soundTypeInput {
    padding: 4px 8px;
    background: transparent;
    color: #f0f0f0;
    border: none;
    font-size: 0.9em;
    flex: 1;
    cursor: pointer;
}

#soundTypeInput:focus {
    outline: none;
}

.dropdown-input-wrapper:focus-within {
    border-color: #61dafb;
    box-shadow: 0 0 3px rgba(97, 218, 251, 0.3);
}

.dropdown-toggle {
    background: transparent;
    border: none;
    color: #c0c0c0;
    cursor: pointer;
    padding: 4px 8px;
    font-size: 0.8em;
    min-width: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dropdown-toggle:hover {
    color: #61dafb;
}

.dropdown-toggle.open {
    transform: rotate(180deg);
}

.autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #3a3f46;
    border: 1px solid #5a5f66;
    border-top: none;
    border-radius: 0 0 3px 3px;
    z-index: 1000;
    display: none;
}

.autocomplete-results.show {
    display: block;
}

.search-input {
    width: 100%;
    padding: 6px 8px;
    background-color: #2a2f36;
    color: #f0f0f0;
    border: none;
    border-bottom: 1px solid #4a4f56;
    font-size: 0.9em;
    box-sizing: border-box;
}

.search-input:focus {
    outline: none;
    background-color: #1a1f26;
    border-bottom-color: #61dafb;
}

.dropdown-options {
    max-height: 200px;
    overflow-y: auto;
}

.autocomplete-item {
    padding: 6px 8px;
    cursor: pointer;
    font-size: 0.9em;
    color: #f0f0f0;
    border-bottom: 1px solid #4a4f56;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.selected {
    background-color: #61dafb;
    color: #2a2f36;
}

.autocomplete-item.highlighted {
    background-color: #555;
}

#strudel-coder-section {
    background-color: #2a2f36;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #4a4f56;
}

#strudel-integration-section {
    background-color: #2a2f36;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #4a4f56;
}

#status-display {
    background-color: #2a2f36;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #4a4f56;
}

/* MIDI Control Buttons */
.midi-controls {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}

.midi-controls button {
    padding: 8px 16px;
    background-color: #4a90e2;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.midi-controls button:hover {
    background-color: #357abd;
}

/* Computer Keyboard (QWERTY Piano) Help */
kbd {
    display: inline-block;
    padding: 1px 5px;
    font-size: 0.85em;
    font-family: monospace;
    color: #f0f0f0;
    background-color: #3a3f46;
    border: 1px solid #5a5f66;
    border-radius: 3px;
    box-shadow: 0 1px 0 rgba(0,0,0,0.3);
    min-width: 16px;
    text-align: center;
}

.piano-key.key-pressed-keyboard {
    background-color: #ff9800 !important;
    color: #fff;
    border-color: #e68900;
}

.black-key.key-pressed-keyboard {
    background-color: #ff9800 !important;
    border-color: #e68900;
}

/* QWERTY key labels on piano keys */
.key-label {
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    font-weight: bold;
    font-family: monospace;
    pointer-events: none;
    user-select: none;
    opacity: 0.7;
    text-shadow: 0 1px 1px rgba(0,0,0,0.4);
    line-height: 1;
}

.white-key .key-label {
    color: #555;
}

.black-key .key-label {
    color: #ccc;
    bottom: 3px;
    font-size: 9px;
}

/* Ensure white keys are positioned so labels stay inside */
.white-key {
    position: relative;
}

/* Two-line key label: QWERTY char + note name */
.key-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
}

/* Hide labels when toggled off */
.hide-labels .key-label {
    display: none !important;
}

.key-char {
    font-size: 11px;
    font-weight: bold;
}

.key-note {
    font-size: 8px;
    font-weight: normal;
    opacity: 0.6;
}

.black-key .key-char {
    font-size: 9px;
}

.black-key .key-note {
    font-size: 7px;
}

/* Mapped QWERTY range - no color effect, only label visibility */

/* Basılı tuş - parlak turuncu */
.white-key.key-pressed,
.white-key.key-pressed-midi {
    background-color: #ff6d00 !important;
    color: #fff !important;
    border-color: #e65100 !important;
    box-shadow: 0 0 16px rgba(255, 109, 0, 0.8), inset 0 0 12px rgba(255, 180, 0, 0.4) !important;
    z-index: 1 !important;
}

.black-key.key-pressed,
.black-key.key-pressed-midi {
    background-color: #ff6d00 !important;
    color: #fff !important;
    border-color: #e65100 !important;
    box-shadow: 0 0 16px rgba(255, 109, 0, 0.8), inset 0 0 12px rgba(255, 180, 0, 0.4) !important;
    z-index: 2 !important;
}

/* Collapsible keyboard help panel */
#keyboard-help-panel summary::-webkit-details-marker { display: none; }
#keyboard-help-panel[open] summary span:first-child { transform: rotate(90deg); }
