* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: sans-serif;
}

.content-wrapper {
    padding: 5px 10px 15px 10px;
    border-radius: 20px;
}

.content-wrapper header {
    display: flex;
    color: #B2B2B2;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
}

.columnbox {
    display: grid;
    grid-template-columns: 1fr 4fr 1fr;
    /* 3 columns */
    align-items: center;
    padding: 15px 20px;
    background-color: #252424;
    border-radius: 20px;
    width: 100%;
}

/* Left column layout */
.col-left {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Logo + Title in one row */
.piano-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Title styling */
.piano-title h2 {
    margin: 0;
    font-size: 21px;
    font-weight: bold;
    color: #555555;
    /* yellow */
    font-style: italic;
    font-family: fantasy;
}

.piano-title .version {
    font-size: 18px;
    color: #555555;
    /* light blue */
    margin-left: 6px;
    font-family: cursive;
}

/* Speaker styling */
.piano-speaker {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 5px;
}

.piano-speaker img {
    max-width: 150px;
    display: block;
}

/* RGB Glow Ring — centered on speaker image */
.speaker-glow-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
    border: 3px solid transparent;
    box-shadow:
        0 0 12px 4px rgba(255, 0, 0, 0.0),
        0 0 24px 8px rgba(0, 255, 0, 0.0),
        inset 0 0 12px 2px rgba(0, 0, 255, 0.0);
}

/* Active state — glow ring visible and animating */
.ptpiano-wrapper.playing .speaker-glow-ring {
    opacity: 1;
    animation: speakerRgbGlow 2s linear infinite, speakerPulse 1.2s ease-in-out infinite;
}

/* RGB color rotation */
@keyframes speakerRgbGlow {
    0% {
        border-color: rgba(255, 0, 0, 0.8);
        box-shadow:
            0 0 14px 5px rgba(255, 0, 0, 0.5),
            0 0 30px 10px rgba(255, 0, 0, 0.2),
            inset 0 0 10px 3px rgba(255, 0, 0, 0.15);
    }

    16% {
        border-color: rgba(255, 165, 0, 0.8);
        box-shadow:
            0 0 14px 5px rgba(255, 165, 0, 0.5),
            0 0 30px 10px rgba(255, 165, 0, 0.2),
            inset 0 0 10px 3px rgba(255, 165, 0, 0.15);
    }

    33% {
        border-color: rgba(255, 255, 0, 0.8);
        box-shadow:
            0 0 14px 5px rgba(255, 255, 0, 0.45),
            0 0 30px 10px rgba(255, 255, 0, 0.18),
            inset 0 0 10px 3px rgba(255, 255, 0, 0.12);
    }

    50% {
        border-color: rgba(0, 255, 0, 0.8);
        box-shadow:
            0 0 14px 5px rgba(0, 255, 0, 0.5),
            0 0 30px 10px rgba(0, 255, 0, 0.2),
            inset 0 0 10px 3px rgba(0, 255, 0, 0.15);
    }

    66% {
        border-color: rgba(0, 100, 255, 0.8);
        box-shadow:
            0 0 14px 5px rgba(0, 100, 255, 0.5),
            0 0 30px 10px rgba(0, 100, 255, 0.2),
            inset 0 0 10px 3px rgba(0, 100, 255, 0.15);
    }

    83% {
        border-color: rgba(150, 0, 255, 0.8);
        box-shadow:
            0 0 14px 5px rgba(150, 0, 255, 0.5),
            0 0 30px 10px rgba(150, 0, 255, 0.2),
            inset 0 0 10px 3px rgba(150, 0, 255, 0.15);
    }

    100% {
        border-color: rgba(255, 0, 0, 0.8);
        box-shadow:
            0 0 14px 5px rgba(255, 0, 0, 0.5),
            0 0 30px 10px rgba(255, 0, 0, 0.2),
            inset 0 0 10px 3px rgba(255, 0, 0, 0.15);
    }
}

/* Subtle breathing pulse */
@keyframes speakerPulse {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        transform: translate(-50%, -50%) scale(1.08);
    }
}

/* Center column */
.col-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 15px;
}

/************ Recording part *************************************************************************************/
.equalizer-notes-row {
    display: flex;
    flex-direction: row;
    gap: 5px;
    align-items: center;
    justify-content: center;
    width: 100%;
    /* Make sure it fills available space */
    max-width: 100%;
}

/* Note display wrapper */
.note-display-wrapper {
    background: #1e1e1e;
    border-radius: 12px;
    padding: 10px 15px;
    min-height: 100px;
    box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.6);
    border: 1px solid #444;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-grow: 1;
    width: 90%;
    /* or auto with flex-grow */
    min-height: 125px;
    max-width: 100%;
    overflow-x: hidden;
}

.equalizer-wrapper {
    background: #1e1e1e;
    border-radius: 12px;
    padding: 10px 15px;
    box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.6);
    border: 1px solid #444;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 220px;
    /* match canvas width */
    min-height: 100px;
    /* match canvas height */
}

.note-display {
    width: 100%;
    height: 100px;
    overflow-x: hidden;
    /* no horizontal scroll */
    overflow-y: auto;
    /* vertical scroll if content exceeds */
    white-space: normal;
    /* allow wrapping */
    padding: 8px 12px;
    background: #121212;
    border-radius: 8px;
    color: #eee;
    font-family: monospace, monospace;
    font-size: 16px;
    user-select: text;
    box-sizing: border-box;
}

/* ID selector corrected */
/* Container: wraps the notes */
#played-notes {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    overflow-x: hidden;
    overflow-y: auto;
    background: #121212;
    border-radius: 8px;
    padding: 8px 12px;
    height: 100px;
    color: #eee;
    font-family: monospace;
    font-size: 16px;
    box-sizing: border-box;
    gap: 6px 8px;
    /* gap: row-gap column-gap */
    line-height: 1;
    /* Reduces line height */
}

#played-notes::-webkit-scrollbar {
    width: 10px;
    /* width of vertical scrollbar */
}

#played-notes::-webkit-scrollbar-track {
    background: #1e1e1e;
    /* track background */
    border-radius: 10px;
}

#played-notes::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #ff6ec4, #7873f5);
    /* colorful gradient */
    border-radius: 10px;
    border: 2px solid #1e1e1e;
    /* gives padding inside thumb */
}

#played-notes::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #ff8ec4, #9893f5);
    /* hover effect */
}



/* Individual note style */
.played-note {
    display: inline-block;
    padding: 2px 6px;
    /* Reduce vertical padding */
    background-color: #2a2a2a;
    border-radius: 4px;
    white-space: nowrap;
    margin: 0;
    /* Make sure no extra margin */
    line-height: 1;
    /* Tighter vertical spacing */
}


#equalizer {
    width: 220px;
}

/* Right column */
.col-right {
    display: flex;
    flex-direction: column;
    padding: 5px 0 0 15px;
}

/* Piano midi enable button */
#enable-piano-btn {
    padding: 10px 20px;
    font-size: 16px;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

/* Enabled state with glow */
#enable-piano-btn.enabled {
    background-color: green;
    color: white;
    box-shadow: 0 0 10px 2px rgba(0, 255, 0, 0.8);
    /* Green glow */
}

/* Disabled state without glow */
#enable-piano-btn.disabled {
    background-color: red;
    color: white;
    box-shadow: none;
}


.vol-notes-row {
    display: flex;
    flex-wrap: wrap;
    /* Allow wrapping */
    align-items: center;
    gap: 10px;
    justify-content: center;
}

/*Volume slider **********************************************************/
.volume-slider {
    display: flex;
    align-items: center;
    background: #555;
    padding: 10px 15px;
    border-radius: 40px;
    width: 250px;
    gap: 12px;
    font-family: sans-serif;
    color: #00fdfd;
}

.volume-icon {
    font-size: 20px;
}

#volumeControl {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: linear-gradient(to bottom, #555, #1E1E1E);
    border-radius: 3px;
    cursor: pointer;
}

#volumeControl::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 21px;
    height: 30px;

    /* Background: base gradient at the bottom, horizontal line on top */
    background:
        linear-gradient(to right, #555, #ccc),
        /* horizontal line (top) */
        linear-gradient(to bottom, #444, #111);
    /* dark base gradient (bottom) */

    background-repeat: no-repeat;
    background-position: center;
    /* center the horizontal line */
    background-size: 100% 6px, cover;
    /* line = 2px height, gradient = full cover */

    border: 2px solid #888;
    border-radius: 3px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    margin-top: 2px;
    z-index: 3;
    position: relative;
}

#volumeControl::-moz-range-thumb {
    width: 21px;
    height: 30px;

    background:
        linear-gradient(to right, #ccc, #ccc),
        linear-gradient(to bottom, #444, #111);

    background-repeat: no-repeat;
    background-position: center;
    background-size: 100% 2px, cover;

    border: 2px solid #888;
    border-radius: 3px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}


#volumeRValue {
    font-weight: 700;
    min-width: 32px;
    text-align: right;
    color: #FFA500;
}

.button-box {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    background: #555;
    padding: 10px 20px;
    border-radius: 40px;
    font-family: sans-serif;
    justify-content: center;
    /* Center buttons if wrapped */
}

.dotted-btn {
    position: relative;
    width: 100px;
    padding: 10px 16px;
    height: auto;
    background-color: #2b2b2b;
    border: none;
    border-radius: 8px;
    box-shadow: inset -4px 4px 8px #1a1a1a, inset 4px -4px 8px #3a3a3a;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.dotted-btn:hover {
    transform: scale(0.95);
    box-shadow: inset 3px 3px 6px rgba(0, 0, 0, 0.6),
        inset -3px -3px 6px rgba(255, 255, 255, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

.dotted-btn::before {
    content: "";
    position: absolute;
    width: 80%;
    height: 80%;
    background-image: radial-gradient(#000 2px, transparent 0);
    background-size: 8px 8px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.3;
    pointer-events: none;
    border-radius: 6px;
}

/* Wrapper to place indicator and icon inline */
.button-content {
    display: flex;
    align-items: center;
    gap: 8px;
    /* space between indicator and icon */
    z-index: 1;
    background-color: #252525;
}

/* Indicator dot */
.indicator {
    width: 12px;
    height: 12px;
    background-color: #ff2e2e;
    border-radius: 50%;
    transition: box-shadow 0.3s ease, opacity 0.3s ease;
    opacity: 0.5;
}

/* Indicator dot */
.indicatorp {
    width: 12px;
    height: 12px;
    background-color: #00FDFD;
    border-radius: 50%;
    transition: box-shadow 0.3s ease, opacity 0.3s ease;
    opacity: 0.5;
}

.dotted-btn.active .indicator {
    box-shadow: 0 0 12px 4px #ff2e2e;
    opacity: 1;
}

.dotted-btn.active .indicatorp {
    box-shadow: 0 0 12px 4px #00FDFD;
    opacity: 1;
}

/* Icon next to indicator */
.btn-label {
    color: #555555;
    background-color: transparent;
}

/*.dotted-btn:disabled {
  background-color: #ccc;     
  color: #888;                
  opacity: 0.6;               
  cursor: not-allowed;        
}*/


#clearBtn {
    transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

/* Container */
.tempo-control {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    user-select: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: transparent;
    border: none;
}

/* Arrow Buttons */
.tempo-btn {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 50%;
    color: #555555;
    font-size: 9px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    padding: 0;
    line-height: 1;
    box-shadow: none;
}

.tempo-btn:hover {
    background: rgba(0, 229, 255, 0.05);
    border-color: rgba(0, 229, 255, 0.3);
    color: #00e5ff;
    box-shadow: 0 0 8px rgba(0, 229, 255, 0.4);
}

.tempo-btn:active {
    transform: scale(0.85);
    background: rgba(0, 229, 255, 0.15);
}

/* Display Box (Center) */
.tempo-display-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: #080808;
    border: 1px solid rgba(0, 229, 255, 0.25);
    border-radius: 50%;
    box-shadow:
        inset 0 0 6px rgba(0, 229, 255, 0.35),
        0 0 8px rgba(0, 229, 255, 0.15);
    padding: 0;
    box-sizing: border-box;
    font-size: 10px;
}

.tempo-value {
    color: #00e5ff;
    text-shadow: 0 0 2px rgba(0, 229, 255, 0.6);
    line-height: 1;
    letter-spacing: 0.2px;
    font-family: monospace;
}

.tempo-label {
    color: #00a3cc;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 0.5;
    font-weight: 700;
}


/* Chord Option *************************************************************************************************************/
.content-wrapper .control {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-start;
    justify-content: center;
    gap: 8px;
    padding: 10px 8px;
    color: #252424;
}

.chord-group {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    margin: 0;
    flex-shrink: 1;
    min-width: 0;
}

.chord-label {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    color: #777;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 2;
    padding: 2px 8px 0 8px;
    border-radius: 6px 6px 0 0;
    white-space: nowrap;
}

.chord-option {
    display: inline-flex;
    gap: 4px;
    padding: 8px 6px;
    border-radius: 0 0 8px 8px;
    background: #070707;
    position: relative;
    flex-wrap: nowrap;
}

.chord-option::before {
    content: "";
    position: absolute;
    top: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: #252424;
}

.chord-option select,
#ptpianInstrumentSelect {
    background-color: #252424;
    border: 1px solid #444;
    border-radius: 6px;
    padding: 6px 8px;
    font-weight: 600;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    color: var(--ptpian-control-select-color, #fff);
    outline: none;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
    width: auto;
    min-width: 0;
    cursor: pointer;
    white-space: nowrap;
}

.chord-option select:hover,
#ptpianInstrumentSelect:hover {
    border-color: #666;
}

.chord-option select:focus,
#ptpianInstrumentSelect:focus {
    border-color: #888;
    box-shadow: 0 0 4px rgba(136, 136, 136, 0.3);
}

select option {
    background-color: #252424;
    font-weight: 400;
}

#ptpianInstrumentSelect optgroup {
    background-color: #1a1a1a;
    color: #aaa;
    font-weight: 700;
    font-style: normal;
    padding: 4px 0;
}

#ptpianInstrumentSelect option {
    background-color: #252424;
    color: #fff;
    font-weight: 400;
    padding: 6px 12px;
}


.progression {
    text-align: center;
}

/*Piano move scale *************************************************************************************************/

.ptpian-scale-wrapper {
    width: 100%;
    max-width: 100%;
    overflow-x: visible;
    overflow-y: visible;
    position: relative;
    padding: 8px 0;
}

.ptpian-scale-inner {
    display: flex;
    align-items: center;
    width: 100%;
    position: relative;
    background: linear-gradient(to bottom, #000000, #252424);
    border-radius: 10px;
    border: 1px dashed rgba(255, 255, 255, 0.15);
    cursor: grab;
    min-height: 82px;
    overflow: visible;
}

/* Left arrow hint */
.ptpian-scale-inner::before,
.ptpian-scale-inner::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 0;
    height: 0;
    transform: translateY(-50%);
    z-index: 1;
    opacity: 0.25;
    pointer-events: none;
    transition: opacity 0.3s;
}

/* Left chevron arrow */
.ptpian-scale-inner::before {
    left: 6px;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 10px solid rgba(255, 255, 255, 0.6);
}

/* Right chevron arrow */
.ptpian-scale-inner::after {
    right: 6px;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 10px solid rgba(255, 255, 255, 0.6);
}

/* Brighten arrows on hover to reinforce draggability */
.ptpian-scale-inner:hover::before,
.ptpian-scale-inner:hover::after {
    opacity: 0.55;
}

.ptpian-scale-wrapper:active {
    cursor: grabbing;
}

.ptpian-scale-inner:active {
    cursor: grabbing;
    border-color: rgba(255, 200, 50, 0.25);
}

.ptpian-scale-track {
    position: relative;
    height: 80px;
    /* width is set dynamically by JS to match the piano keys */
}

/* SCALE CELL — premium style with bottom pointer */
.ptpian-scale-cell {
    position: absolute;
    width: 50px;
    height: 52px;
    top: 17%;
    transform: translate(-50%, -50%);
    border-radius: 8px 8px 4px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    cursor: grab;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Bottom arrow pointer towards piano keys */
.ptpian-scale-cell::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 10px solid;
    /* color inherited from border-top-color below */
}

/* Hover lift effect */
.ptpian-scale-cell:hover {
    transform: translate(-50%, -50%) translateY(-2px);
}

/* Number label — glowing */
.ptpian-scale-cell span:first-child {
    font-size: 16px;
    font-weight: 800;
    line-height: 1;
    z-index: 1;
}

/* Sargam label — glowing */
.ptpian-scale-cell span:last-child {
    font-size: 11px;
    font-weight: 600;
    text-transform: lowercase;
    line-height: 1;
    z-index: 1;
}

/* Filled scale notes — gradient bg with glow */
.ptpian-scale-cell.filled-cell {
    background: linear-gradient(180deg, #e0e0e0 0%, #a0a0a0 100%);
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.ptpian-scale-cell.filled-cell::after {
    border-top-color: #a0a0a0;
}

.ptpian-scale-cell.filled-cell span:first-child {
    color: #1a1a1a;
    text-shadow:
        0 0 6px rgba(255, 255, 255, 0.9),
        0 0 12px rgba(200, 200, 255, 0.4);
}

.ptpian-scale-cell.filled-cell span:last-child {
    color: #2a6e2a;
    text-shadow:
        0 0 4px rgba(100, 255, 100, 0.5),
        0 0 8px rgba(50, 200, 50, 0.3);
}

.ptpian-scale-cell.filled-cell:hover {
    box-shadow:
        0 4px 14px rgba(0, 0, 0, 0.5),
        0 0 12px rgba(200, 220, 255, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

/*Piano buttons *************************************************************************************************/
.columnboxpiano {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    padding: 15px 0 0 0;
    background-color: #252424;
    border-radius: 20px;
    width: 100%;
    box-sizing: border-box;
}

.left-column {
    flex: 1;
    min-width: 0;
}

.left-column,
.right-column {
    display: flex;
    gap: 10px;
    color: #fff;
    box-sizing: border-box;
}

.left-column ul {
    margin: 0 0 0 15px !important;
}

/* .control styles moved to Chord Option section above */

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

.control span {
    font-weight: 500;
    margin-right: 15px;
    font-size: 1.19rem;
}

.control input {
    outline: none;
    border-radius: 30px;
}

.piano-keys {
    display: flex;
    list-style: none;
    margin-top: 40px;
    padding: 20px;
}

ul.piano-keys {
    list-style-type: none !important;
}

.piano-keys .key {
    cursor: pointer;
    user-select: none;
    position: relative;
    text-transform: uppercase;
}

.piano-keys .white,
.piano-keys .black {
    transition:
        transform 0.08s ease-in,
        box-shadow 0.1s ease,
        background 0.1s ease;
    will-change: transform;
}

.piano-keys .black {
    z-index: 3;
    /* Higher than white keys */
    width: 2.3vw;
    height: 110px;
    margin: 0 -1.15vw 0 -1.15vw;
    border-radius: 0 0 5px 5px;
    background: linear-gradient(#333, #000);
    box-shadow:
        0 4px 8px rgba(0, 0, 0, 0.6),
        /* Drop shadow */
        inset 0 -2px 2px rgba(255, 255, 255, 0.05);
    /* Subtle top shine */
    transition:
        transform 0.08s ease-in,
        box-shadow 0.1s ease,
        background 0.1s ease;
}

.piano-keys .black.active {
    transform: scale(0.96) translateY(1px);
    /* Slight depression */
    background: linear-gradient(to bottom, #000, #434343);
    box-shadow:
        inset -5px -10px 10px rgba(255, 255, 255, 0.1),
        0 2px 10px rgba(0, 0, 0, 0.5);
}

.piano-keys .white {
    height: 185px;
    width: 3.8vw;
    border-radius: 8px;
    border: 1px solid #000;
    background: linear-gradient(#fff 96%, #eee 4%);
}

.piano-keys .white.active {
    transform: scale(0.97);
    /* slight shrink */
    box-shadow: inset -5px 5px 20px rgb(0 0 0 / .2), 0 2px 6px rgba(0, 0, 0, 0.3);
    background: linear-gradient(to bottom, #fff 0%, #eee 100%);
}

.piano-keys .key span {
    position: absolute;
    bottom: 20px;
    width: 80%;
    font-size: 1.13rem;
    text-align: center;
}

.piano-keys .black span {
    bottom: 21px;
    color: #888;
}

.hide {
    display: none !important;
}

.piano-keys .key span.note-label {
    display: block;
    bottom: 29px;
}

.piano-keys .key span.key-label {
    display: block;
    font-size: 12px;
    color: #555;
    bottom: 9px;
}

/* Right column controls*********************************************/
.right-column {
    width: 50px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px 5px;
}

.right-column .ctl-label {
    color: #555555;
}

.right-column .showscalechord {
    width: 90%;
    appearance: none;
    border: 1px solid #333;
    outline: none;
    background: #131212;
    border-radius: 6px;
    text-align: center;
    padding: 6px 4px;
    margin: 0;
    color: #fff;
    font-size: .6rem;
    box-sizing: border-box;
}

.right-column .settings-fab {
    position: relative;
    /* Not floating, static in column */
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3a7afe 0%, #000 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 25% 0 -50% 85%;
}

.right-column .settings-fab:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6);
    background: linear-gradient(135deg, #4a8aff 0%, #3570e3 100%);
}

.right-column .settings-fab span {
    font-size: 16px;
    color: #fff;
}

.right-column .pedal-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
    position: relative;
}

.right-column .pedal-top-cover {
    width: 28px;
    height: 18px;
    background: #1c1b1b;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
    border: 3px solid #1c1b1b;
    margin-bottom: -3px;
    position: relative;
}

.right-column .pedal-button {
    width: 28px;
    height: 65px;
    background: linear-gradient(to right,
            #a67c00 0%,
            #d1a119 25%,
            #ffd700 50%,
            #d1a119 75%,
            #a67c00 100%);
    border-radius: 6px 6px 16px 16px;
    border: 1px solid #7a5c00;
    box-shadow:
        inset 1px 1px 3px rgba(255, 255, 255, 0.4),
        inset -1px -1px 3px rgba(0, 0, 0, 0.4),
        0 4px 8px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    transition: transform 0.1s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.1s ease;
    outline: none;
    position: relative;
    z-index: 1;
}

.right-column .pedal-button:hover {
    background: linear-gradient(to right,
            #b88a00 0%,
            #e0b024 25%,
            #ffe44d 50%,
            #e0b024 75%,
            #b88a00 100%);
    box-shadow:
        inset 1px 1px 4px rgba(255, 255, 255, 0.5),
        inset -1px -1px 3px rgba(0, 0, 0, 0.4),
        0 6px 12px rgba(218, 165, 32, 0.35);
}

.right-column .pedal-button:active {
    transform: translateY(4px);
    box-shadow:
        inset 1px 2px 4px rgba(0, 0, 0, 0.6),
        0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-box {
    background: #252424;
    padding: 10px 15px 20px 15px;
    border-radius: 40px;
    font-family: sans-serif;
    margin-bottom: 10px;
    display: flex;
    /* Add this */
    flex-direction: row;
    /* Add this - side by side */
    gap: 20px;
    /* Add this - space between checkboxes */
    align-items: center;
    /* Add this - vertical alignment */
    justify-content: center;
    /* Add this - center content */
}

.keys-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    /* Changed from 10px 0 0 0 */
    font-family: sans-serif;
    width: auto;
    /* Changed from 100% */
    flex-shrink: 0;
    /* Add this - prevent shrinking */
}

.keys-checkbox input {
    height: 30px;
    width: 60px;
    cursor: pointer;
    appearance: none;
    position: relative;
    background: #4B4B4B;
}

.keys-checkbox input::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 5px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #8c8c8c;
    transform: translateY(-50%);
    transition: all 0.3s ease;
}

.keys-checkbox input:checked::before {
    left: 35px;
    background: #fff;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch {
    position: relative;
    display: inline-block;
    width: 65px;
    height: 26px;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 26px;
    width: 50px;
}

.slider::before {
    content: "";
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: linear-gradient(to bottom right, #555, #ccc);
    transition: 0.4s;
    border-radius: 50%
}

.switch input:checked+.slider {
    width: 50px;
}

.switch input:checked+.slider::before {
    transform: translateX(24px);
}

/* Reverb option *************************************************************************/
.reverb-box {
    background: #252424;
    padding: 10px 15px 20px 15px;
    border-radius: 40px;
    font-family: sans-serif;
    margin: 0 auto;
}

.reverb-box select {
    background-color: #252424;
    color: gold;
    border: 2px solid #555555;
    border-radius: 8px;
    padding: 10px 16px;
    font-weight: 700;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    outline: none;
    transition: background-color 0.3s, color 0.3s;
    width: 95px;
}

/* PIANO LOADER 
***********************************************************************************************************************************************************************************************************************/
.ptpiano-wrapper {
    position: relative;
    min-height: 300px;
    /* adjust to avoid collapse */
    background: transparent;
}

.ptpiano-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.ptpiano-loader p {
    margin-top: 15px;
    font-size: 14px;
    font-weight: bold;
    color: #333;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #ddd;
    border-top: 4px solid cyan;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

/* === RECORD POPUP OVERLAY === */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    /* Dim background */
    display: none;
    /* Hidden by default */
    justify-content: center;
    align-items: center;
    z-index: 9999;
    /* Sit on top */
    pointer-events: all;
}

.popup-overlay.active {
    display: flex !important;
}

/* Popup Content */
.popup-content {
    background: #252424;
    padding: 25px 30px;
    color: #fff;
    border-radius: 12px;
    text-align: center;
    max-width: 350px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    animation: fadeInScale 0.3s ease-in-out;
    font-family: 'Segoe UI', sans-serif;
}

.popup-content h3 {
    margin-top: 0;
    color: #555555;
}

.popup-content p {
    color: #555;
    margin: 15px 0;
}

.popup-content button {
    background-color: #3a7afe;
    color: white;
    border: none;
    padding: 10px 18px;
    font-size: 14px;
    border-radius: 6px;
    cursor: pointer;
}

.popup-content button:hover {
    background-color: #245fd3;
}


/* === SETTINGS POPUP OVERLAY === */
#settingsPopup.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    pointer-events: all;
}

#settingsPopup.popup-overlay.active {
    display: flex;
}

/* Popup Content */
#settingsPopup .popup-content.settings-popup {
    background: #252424;
    padding: 25px 30px;
    color: #fff;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    animation: fadeInScale 0.3s ease-in-out;
    font-family: 'Segoe UI', sans-serif;
    text-align: left;
}

/* === SONG SETTINGS POPUP OVERLAY === */
#songPopup.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    pointer-events: all;
}

#songPopup.popup-overlay.active {
    display: flex;
}

/* === CLEAR CONFIRM POPUP OVERLAY === */
#clearConfirmPopup.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    pointer-events: all;
}

#clearConfirmPopup.popup-overlay.active {
    display: flex;
}

#clearConfirmPopup .popup-content {
    background: #252424;
    padding: 25px 30px;
    color: #fff;
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    animation: fadeInScale 0.3s ease-in-out;
    font-family: 'Segoe UI', sans-serif;
    text-align: center;
}

#clearConfirmPopup #confirmClearBtn:hover {
    background: #c0392b !important;
}

#clearConfirmPopup #cancelClearBtn:hover {
    background: #777 !important;
}

/* Popup Content */
#songPopup .popup-content {
    background: #252424;
    padding: 25px 30px;
    color: #fff;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    animation: fadeInScale 0.3s ease-in-out;
    font-family: 'Segoe UI', sans-serif;
    text-align: left;
}

#songPopup select {
    background-color: #252424;
    border: 2px solid #555555;
    border-radius: 8px;
    padding: 10px 16px;
    font-weight: 700;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    outline: none;
    transition: background-color 0.3s, color 0.3s;
    width: 90%;
}

#songPopup select option {
    background-color: #252424;
    font-weight: 400;
}

@keyframes fadeInScale {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* === POPUP HEADER === */
.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #444;
}

.popup-header h3 {
    margin: 0;
    color: #fff;
    font-size: 20px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 32px;
    color: #999;
    cursor: pointer;
    transition: color 0.3s;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.close-btn:hover {
    color: #fff;
}

/* === POPUP BODY === */
.popup-body {
    max-height: 500px;
    overflow-y: auto;
}

.popup-body::-webkit-scrollbar {
    width: 8px;
}

.popup-body::-webkit-scrollbar-track {
    background: #1e1e1e;
    border-radius: 10px;
}

.popup-body::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #3a7afe, #245fd3);
    border-radius: 10px;
}

/* === SETTINGS SECTIONS === */
.settings-section {
    margin-bottom: 25px;
    padding: 15px;
    background: #333;
    border-radius: 8px;
}

.settings-section h4 {
    margin-bottom: 15px;
    color: #ddd;
    font-size: 16px;
}

/* === SETTINGS FAB BUTTON (Floating Action Button) === */
.settings-fab {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3a7afe 0%, #245fd3 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    transition: all 0.3s;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-fab:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6);
}

.settings-fab span {
    font-size: 28px;
    color: #fff;
}

/* === ADJUSTMENTS FOR EXISTING ELEMENTS IN POPUP === */
#settingsPopup .pedal-wrapper {
    margin: 10px auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#settingsPopup .toggle-box {
    width: 100%;
}

#settingsPopup .reverb-box {
    width: 100%;
}

#settingsPopup .showscalechord {
    width: 100%;
    margin-bottom: 15px;
}

#settingsPopup .reverb-select {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

#settingsPopup .reverb-select select {
    flex: 1;
}

/* === MOBILE RESPONSIVE === */
@media screen and (max-width: 768px) {
    .settings-fab {
        width: 50px;
        height: 50px;
        bottom: 15px;
        right: 15px;
    }

    .settings-fab span {
        font-size: 24px;
    }

    #settingsPopup .popup-content.settings-popup {
        max-width: 95%;
        padding: 20px;
    }
}



/* RESPONSIVE — TABLET & SMALL DESKTOP (≤1280px) */
@media screen and (max-width: 1280px) {
    .content-wrapper {
        padding: 5px;
    }

    header {
        flex-direction: column;
    }

    header :where(h2, .column) {
        margin-bottom: 13px;
    }

    /* Stack the grid to single column */
    .columnbox {
        grid-template-columns: 1fr;
        padding: 10px;
    }

    .piano-header {
        width: auto !important;
        justify-content: center;
    }

    /* Hide speakers on smaller screens */
    .piano-speaker {
        display: none;
    }

    /* Reorganize header columns for mobile */
    .col-left {
        text-align: center;
    }

    .col-right {
        text-align: center;
        order: -1;
    }

    .col-center {
        grid-column: 1 / -1;
        width: 100%;
        padding-left: 0;
        align-items: center;
    }

    /* Controls wrap on small screens */
    .content-wrapper .control {
        flex-wrap: wrap !important;
        gap: 6px;
        padding: 8px 4px;
    }

    .chord-group {
        margin: 4px 0 !important;
    }

    .chord-option {
        flex-wrap: wrap !important;
        gap: 4px;
        padding: 6px;
    }

    .chord-option select,
    #ptpianInstrumentSelect {
        font-size: 11px;
        padding: 5px 6px;
    }

    .chord-option::before {
        display: none;
    }

    .chord-label {
        font-size: 8px;
        top: -12px;
    }

    /* Volume slider adjustments */
    .volume-slider {
        width: 100%;
        max-width: 300px;
    }

    /* Button box */
    .button-box {
        padding: 8px 12px;
        gap: 6px;
    }

    .dotted-btn {
        width: 80px;
        padding: 8px 10px;
    }

    .btn-label {
        font-size: 14px;
    }

    /* Tempo control */
    .tempo-control {
        margin-top: 5px;
    }

    /* Equalizer and notes */
    .equalizer-notes-row {
        flex-direction: column;
        gap: 8px;
    }

    .equalizer-wrapper {
        width: 100%;
        max-width: 300px;
    }

    canvas#equalizer {
        width: 100% !important;
        height: auto !important;
    }

    .note-display-wrapper {
        width: 100%;
        min-height: 80px;
    }

    #played-notes {
        width: 100% !important;
        height: 80px;
        font-size: 14px;
    }

    /* Toggle and reverb boxes */
    .toggle-box {
        flex-wrap: wrap;
        gap: 10px;
        padding: 8px 10px 15px;
    }

    /* Piano layout */
    .columnboxpiano {
        flex-direction: column;
        align-items: center;
        padding: 10px 0 0 0;
    }

    .left-column {
        width: 100%;
    }

    .right-column {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 12px;
        padding: 10px;
    }

    /* Show chord/note label on full width */
    .right-column .showscalechord {
        width: auto;
        margin-bottom: 0;
        font-size: 0.7rem;
        padding: 0.5em 1em;
    }

    /* Settings and Song buttons side by side */
    .right-column .settings-fab {
        position: relative;
        margin: 0;
        width: 28px;
        height: 28px;
    }

    /* Scale down pedal for tablet instead of using transform scale */
    .right-column .pedal-wrapper {
        margin: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .right-column .pedal-top-cover {
        width: 20px;
        height: 12px;
        border: 2px solid #1c1b1b;
        margin-bottom: -2px;
    }

    .right-column .pedal-button {
        width: 20px;
        height: 45px;
        border-radius: 4px 4px 10px 10px;
    }

    /* Piano keys */
    .piano-keys {
        display: flex;
        justify-content: center;
        flex-wrap: nowrap;
        margin: 10px 0 0 0 !important;
        padding: 0 5px;
    }

    .piano-keys .white {
        width: 4.5vw;
        height: 140px;
        min-width: 38px;
    }

    .piano-keys .black {
        width: 2.6vw;
        height: 100px;
        margin: 0 -1.3vw;
        min-width: 28px;
    }

    /* Show 3 octaves (first 36 keys) on screens <= 1280px */
    .piano-keys .key:nth-child(n+37) {
        display: none !important;
    }

    .piano-keys .key span {
        font-size: 10px;
    }

    /* Scale track adjustments */
    .ptpian-scale-wrapper {
        padding: 5px 0;
    }

    .ptpian-scale-inner {
        min-height: 70px;
    }

    .ptpian-scale-track {
        height: 70px;
    }

    .ptpian-scale-cell {
        width: 42px;
        height: 44px;
    }

    .ptpian-scale-cell span:first-child {
        font-size: 13px;
    }

    .ptpian-scale-cell span:last-child {
        font-size: 9px;
    }

    /* Vol-notes row */
    .vol-notes-row {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }
}

/* RESPONSIVE — TABLET PORTRAIT (≤992px) */
@media screen and (max-width: 992px) {
    .piano-keys .white {
        width: 5vw;
        height: 130px;
        min-width: 36px;
    }

    .piano-keys .black {
        width: 2.8vw;
        height: 95px;
        margin: 0 -1.4vw;
        min-width: 26px;
    }

    /* Show 2 octaves (first 24 keys) on screens <= 992px */
    .piano-keys .key:nth-child(n+25) {
        display: none !important;
    }

    .volume-slider {
        max-width: 250px;
        padding: 8px 12px;
    }

    .button-box {
        border-radius: 20px;
    }

    .dotted-btn {
        width: 70px;
        padding: 7px 8px;
    }

    .btn-label {
        font-size: 12px;
    }
}

/* RESPONSIVE — SMALL MOBILE (≤768px) */
@media screen and (max-width: 768px) {

    /* Show only 1 octave (first 12 keys) on mobile */
    .piano-keys .key:nth-child(n+13) {
        display: none !important;
    }

    /* Size keys to fit 1 octave on screen */
    .piano-keys .white {
        width: 12vw;
        height: 130px;
        min-width: 40px;
    }

    .piano-keys .black {
        width: 7vw;
        height: 90px;
        margin: 0 -3.5vw;
        min-width: 28px;
    }

    .piano-keys .key span {
        font-size: 9px;
    }

    .piano-keys .key span.note-label {
        bottom: 22px;
    }

    .piano-keys .key span.key-label {
        font-size: 8px;
        bottom: 6px;
    }

    /* Hide pedal on mobile */
    .right-column .pedal-wrapper {
        display: none;
    }

    /* Scale cells smaller */
    .ptpian-scale-cell {
        width: 36px;
        height: 38px;
    }

    .ptpian-scale-cell span:first-child {
        font-size: 11px;
    }

    .ptpian-scale-cell span:last-child {
        font-size: 8px;
    }

    .ptpian-scale-cell::after {
        border-left-width: 6px;
        border-right-width: 6px;
        border-top-width: 8px;
        bottom: -8px;
    }

    .ptpian-scale-inner {
        min-height: 60px;
    }

    .ptpian-scale-track {
        height: 60px;
    }

    /* Tempo */
    .tempo-btn {
        width: 24px;
        height: 24px;
        font-size: 9px;
    }

    /* Settings buttons */
    .settings-fab {
        width: 40px;
        height: 40px;
    }

    .settings-fab span {
        font-size: 20px;
    }

    #settingsPopup .popup-content.settings-popup {
        max-width: 95%;
        padding: 18px;
    }

    /* Volume slider */
    .volume-slider {
        max-width: 220px;
        padding: 6px 10px;
        border-radius: 25px;
    }

    .volume-icon {
        font-size: 16px;
    }

    #volumeRValue {
        font-size: 13px;
    }
}

/* RESPONSIVE — EXTRA SMALL MOBILE (≤480px) */
@media screen and (max-width: 480px) {
    .content-wrapper {
        padding: 3px;
    }

    .columnbox {
        padding: 8px;
        border-radius: 12px;
    }

    .piano-keys .white {
        width: 8.5vw;
        height: 100px;
        min-width: 32px;
        border-radius: 5px;
    }

    .piano-keys .black {
        width: 4.8vw;
        height: 70px;
        margin: 0 -2.4vw;
        min-width: 22px;
    }

    .piano-keys .key span.note-label {
        font-size: 8px;
        bottom: 20px;
    }

    .piano-keys .key span.key-label {
        font-size: 7px;
        bottom: 5px;
    }

    /* Even smaller scale cells */
    .ptpian-scale-cell {
        width: 30px;
        height: 32px;
    }

    .ptpian-scale-cell span:first-child {
        font-size: 10px;
    }

    .ptpian-scale-cell span:last-child {
        font-size: 7px;
    }

    .ptpian-scale-inner {
        min-height: 50px;
    }

    .ptpian-scale-track {
        height: 50px;
    }

    /* Buttons smaller */
    .dotted-btn {
        width: 60px;
        padding: 6px;
    }

    .btn-label {
        font-size: 11px;
    }

    .indicator,
    .indicatorp {
        width: 8px;
        height: 8px;
    }

    /* Tempo control */
    .tempo-btn {
        width: 22px;
        height: 22px;
        font-size: 8px;
    }

    /* Chord selects */
    .chord-option select {
        padding: 6px 10px;
        font-size: 12px;
    }

    /* Note display */
    #played-notes {
        height: 60px;
        font-size: 12px;
    }

    .note-display-wrapper {
        min-height: 60px;
    }

    /* Volume */
    .volume-slider {
        max-width: 180px;
        gap: 6px;
    }
}

/* === DESKTOP — Ensure all keys visible === */
@media screen and (min-width: 1281px) {
    .piano-keys .key {
        display: block;
    }
}