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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    min-height: 100vh;
    padding: 20px;
    overflow-x: hidden;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 10px;
}

.page-header {
    position: relative;
    margin-bottom: 30px;
}

h1 {
    text-align: center;
    margin-bottom: 0;
    font-size: 3rem;
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-shadow: 
        0 0 10px rgba(255, 0, 255, 0.5),
        0 0 20px rgba(0, 255, 255, 0.5),
        0 0 30px rgba(255, 0, 255, 0.3),
        2px 2px 4px rgba(0, 0, 0, 0.5);
    background: linear-gradient(
        90deg,
        #ff0080,
        #ff8c00,
        #40e0d0,
        #9370db,
        #00ffff,
        #ff1493,
        #ff0080
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: iridescent 3s linear infinite;
    position: relative;
}

.github-link {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    color: #00ffff;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(0, 255, 255, 0.1);
    border: 2px solid rgba(0, 255, 255, 0.3);
}

.github-link:hover {
    color: #ff0080;
    background: rgba(255, 0, 128, 0.1);
    border-color: rgba(255, 0, 128, 0.5);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
}

.github-link svg {
    width: 32px;
    height: 32px;
}

.dual-visualizer-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 1200px) {
    .dual-visualizer-wrapper {
        grid-template-columns: 1fr;
    }
}

.track-container {
    display: flex;
    flex-direction: column;
}

.track-title {
    text-align: center;
    font-size: 1.5rem;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

@keyframes iridescent {
    0% {
        background-position: 0% center;
    }
    100% {
        background-position: 200% center;
    }
}

.controls {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

/* DJ Layout Containers */
.dj-decks-container {
    display: grid;
    grid-template-columns: 2fr 1fr 2fr; /* Track 1 (wide) | Mixer (narrow) | Track 2 (wide) */
    gap: 10px;
    margin-bottom: 25px;
}

@media (max-width: 1400px) {
    .dj-decks-container {
        grid-template-columns: 1fr; /* Stack vertically on smaller screens */
    }

    /* Once the layout stacks, cap button rows at 4 so they wrap */
    .track-controls {
        grid-template-columns: repeat(4, 1fr);
    }

    /* Prevent 7 slider containers from stretching into one overflowing row */
    .tempo-volume-row {
        flex-wrap: wrap;
    }

    .beat-grid-controls-row {
        flex-wrap: wrap;
    }

    .roll-buttons, .jump-buttons {
        flex-wrap: wrap;
    }
}

.dj-mixer-section {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.4), rgba(40, 40, 40, 0.4));
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.5),
        inset 0 2px 10px rgba(255, 255, 255, 0.1);
}

.mixer-header {
    text-align: center;
    font-size: 1.5rem;
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    color: rgba(0, 255, 255, 1);
    text-shadow: 0 0 20px rgba(0, 255, 255, 0.8);
    letter-spacing: 0.2em;
    margin-bottom: 20px;
    padding: 10px;
    background: rgba(0, 255, 255, 0.1);
    border-radius: 8px;
    border: 2px solid rgba(0, 255, 255, 0.3);
}

.track-upload {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 15px;
    background: linear-gradient(145deg, rgba(0, 0, 0, 0.3), rgba(40, 40, 40, 0.2));
    border-radius: 15px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    flex: 1;
    min-width: 0;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.4),
        inset 0 1px 5px rgba(255, 255, 255, 0.1);
}

.track-upload > label:first-child {
    font-weight: 900;
    font-size: 1.3rem;
    font-family: 'Orbitron', sans-serif;
    color: rgba(255, 255, 255, 0.95);
    text-align: center;
    padding: 12px;
    border-bottom: 3px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    letter-spacing: 0.1em;
}

/* DJ-style color coding for tracks */
.track-upload:first-child {
    border-color: rgba(0, 255, 255, 0.4);
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.4),
        inset 0 1px 5px rgba(0, 255, 255, 0.1),
        0 0 20px rgba(0, 255, 255, 0.2);
}

.track-upload:first-child > label:first-child {
    border-bottom-color: rgba(0, 255, 255, 0.4);
    text-shadow: 0 0 15px rgba(0, 255, 255, 0.8);
}

.track-upload:last-child {
    border-color: rgba(255, 0, 255, 0.4);
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.4),
        inset 0 1px 5px rgba(255, 0, 255, 0.1),
        0 0 20px rgba(255, 0, 255, 0.2);
}

.track-upload:last-child > label:first-child {
    border-bottom-color: rgba(255, 0, 255, 0.4);
    text-shadow: 0 0 15px rgba(255, 0, 255, 0.8);
}

/* Drag-and-drop visual feedback */
.track-upload.drag-over {
    transition: all 0.3s ease;
    transform: scale(1.02);
}

.track-upload:first-child.drag-over {
    border-color: rgba(0, 255, 255, 0.8);
    background: rgba(0, 255, 255, 0.15);
    box-shadow: 
        0 4px 30px rgba(0, 255, 255, 0.4),
        inset 0 1px 10px rgba(0, 255, 255, 0.3),
        0 0 40px rgba(0, 255, 255, 0.5);
}

.track-upload:last-child.drag-over {
    border-color: rgba(255, 0, 255, 0.8);
    background: rgba(255, 0, 255, 0.15);
    box-shadow: 
        0 4px 30px rgba(255, 0, 255, 0.4),
        inset 0 1px 10px rgba(255, 0, 255, 0.3),
        0 0 40px rgba(255, 0, 255, 0.5);
}

/* Vinyl Animation Styles */
.vinyl-animation {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px 0;
    margin: 10px 0;
}

.vinyl-record {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(
        circle at center,
        #1a1a1a 0%,
        #1a1a1a 20%,
        #2d2d2d 20%,
        #2d2d2d 22%,
        #1a1a1a 22%,
        #1a1a1a 24%,
        #2d2d2d 24%,
        #2d2d2d 26%,
        #1a1a1a 26%,
        #1a1a1a 100%
    );
    position: relative;
    box-shadow: 
        0 0 20px rgba(0, 0, 0, 0.5),
        inset 0 0 10px rgba(0, 0, 0, 0.8);
    animation: spin 2s linear infinite;
}

/* Add a bright line indicator to make spinning obvious */
.vinyl-record::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 35%;
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.9) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: translate(-50%, -100%);
    transform-origin: bottom center;
    filter: blur(0.5px);
}

/* Add a second indicator line for even more visibility */
.vinyl-record::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 3px;
    height: 20%;
    background: linear-gradient(
        to bottom,
        rgba(255, 215, 0, 0) 0%,
        rgba(255, 215, 0, 1) 50%,
        rgba(255, 215, 0, 0) 100%
    );
    transform: translate(-50%, -100%) rotate(90deg);
    transform-origin: bottom center;
}

.vinyl-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: radial-gradient(circle, #d4af37 0%, #aa8a3c 50%, #8b7333 100%);
    box-shadow: 
        0 0 5px rgba(212, 175, 55, 0.8),
        inset 0 0 3px rgba(0, 0, 0, 0.5);
    z-index: 2;
}

/* Add a small offset mark on the center to show rotation */
.vinyl-center::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: #000;
    border-radius: 50%;
}

.vinyl-groove {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(100, 100, 100, 0.3);
}

.vinyl-groove:nth-child(2) {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 55%;
    height: 55%;
}

.vinyl-groove:nth-child(3) {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70%;
    height: 70%;
}

.vinyl-groove:nth-child(4) {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 85%;
    height: 85%;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Track 1 vinyl glow effect */
.track-upload:first-child .vinyl-record {
    box-shadow: 
        0 0 20px rgba(0, 255, 255, 0.3),
        0 0 30px rgba(0, 255, 255, 0.2),
        inset 0 0 10px rgba(0, 0, 0, 0.8);
}

.track-upload:first-child .vinyl-record::before {
    background: linear-gradient(
        to bottom,
        rgba(0, 255, 255, 0) 0%,
        rgba(0, 255, 255, 0.9) 50%,
        rgba(0, 255, 255, 0) 100%
    );
}

/* Track 2 vinyl glow effect */
.track-upload:last-child .vinyl-record {
    box-shadow: 
        0 0 20px rgba(255, 0, 255, 0.3),
        0 0 30px rgba(255, 0, 255, 0.2),
        inset 0 0 10px rgba(0, 0, 0, 0.8);
}

.track-upload:last-child .vinyl-record::before {
    background: linear-gradient(
        to bottom,
        rgba(255, 0, 255, 0) 0%,
        rgba(255, 0, 255, 0.9) 50%,
        rgba(255, 0, 255, 0) 100%
    );
}

.track-main-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.track-controls-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

@media (max-width: 1400px) {
    .dual-track-section {
        grid-template-columns: 1fr;
    }
}

.upload-section {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: space-between;
}

.upload-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    font-weight: 600;
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.file-name {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.playback-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.track-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 15px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 16px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3),
                inset 0 1px 3px rgba(255, 255, 255, 0.1);
}

.control-btn-small {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.9), rgba(118, 75, 162, 0.9));
    border: 2px solid rgba(255, 255, 255, 0.4);
    color: white;
    padding: 20px 28px;
    border-radius: 16px;
    cursor: pointer;
    font-size: 2.2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4),
                0 2px 8px rgba(102, 126, 234, 0.3),
                inset 0 1px 2px rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    min-width: 80px;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.control-btn-small::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.control-btn-small:hover:not(:disabled)::before {
    width: 300px;
    height: 300px;
}

.control-btn-small:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(102, 126, 234, 1), rgba(118, 75, 162, 1));
    transform: translateY(-4px) scale(1.08);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.6),
                0 4px 12px rgba(118, 75, 162, 0.4),
                0 0 25px rgba(102, 126, 234, 0.4),
                inset 0 1px 3px rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.6);
}

.control-btn-small:active:not(:disabled) {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5),
                0 2px 8px rgba(118, 75, 162, 0.3);
}

.control-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    font-weight: 600;
}

.control-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.control-btn-small:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: rgba(60, 60, 60, 0.5);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: none;
}

.loop-btn.active {
    background: linear-gradient(135deg, #00ffff, #ff00ff);
    border-color: rgba(0, 255, 255, 0.8);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.6),
                0 0 30px rgba(255, 0, 255, 0.4),
                0 4px 15px rgba(0, 0, 0, 0.3);
    animation: loopPulse 2s ease-in-out infinite;
}

@keyframes loopPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(0, 255, 255, 0.6),
                    0 0 30px rgba(255, 0, 255, 0.4),
                    0 4px 15px rgba(0, 0, 0, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(0, 255, 255, 0.8),
                    0 0 40px rgba(255, 0, 255, 0.6),
                    0 6px 20px rgba(0, 0, 0, 0.4);
    }
}

.loop-btn.active:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 0 35px rgba(0, 255, 255, 0.9),
                0 0 50px rgba(255, 0, 255, 0.7),
                0 8px 25px rgba(0, 0, 0, 0.5);
}

.reverse-loop-btn.active {
    background: linear-gradient(135deg, #ff00ff, #ff8c00);
    border-color: rgba(255, 0, 255, 0.8);
    box-shadow: 0 0 20px rgba(255, 0, 255, 0.6),
                0 0 30px rgba(255, 140, 0, 0.4),
                0 4px 15px rgba(0, 0, 0, 0.3);
    animation: reverseLoopPulse 2s ease-in-out infinite;
}

@keyframes reverseLoopPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 0, 255, 0.6),
                    0 0 30px rgba(255, 140, 0, 0.4),
                    0 4px 15px rgba(0, 0, 0, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(255, 0, 255, 0.8),
                    0 0 40px rgba(255, 140, 0, 0.6),
                    0 6px 20px rgba(0, 0, 0, 0.4);
    }
}

.reverse-loop-btn.active:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 0 35px rgba(255, 0, 255, 0.9),
                0 0 50px rgba(255, 140, 0, 0.7),
                0 8px 25px rgba(0, 0, 0, 0.5);
}

/* Tempo and Volume Row */
.tempo-volume-row {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.tempo-control-inline {
    flex: 1;
    padding: 15px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 200px;
}

.tempo-control-inline label {
    display: block;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 12px;
    text-align: center;
    font-size: 0.9em;
}

.tempo-control-inline span {
    color: #00ffff;
    font-weight: 700;
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
}

.tempo-control-inline input[type="range"] {
    writing-mode: vertical-lr; /* Modern standard */
    direction: rtl; /* Right to left for correct orientation */
    width: 8px;
    height: 150px;
    padding: 0;
    margin: 10px 0;
    background: linear-gradient(180deg, 
        rgba(100, 255, 100, 0.6) 0%, 
        rgba(255, 255, 255, 0.6) 50%, 
        rgba(255, 100, 100, 0.6) 100%
    );
    border-radius: 5px;
    outline: none;
    cursor: pointer;
}

.tempo-control-inline input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00ffff, #0080ff);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
    transition: transform 0.2s;
}

.tempo-control-inline input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.8);
}

.tempo-control-inline input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00ffff, #0080ff);
    cursor: pointer;
    border: none;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
    transition: transform 0.2s;
}

/* Stretch Control Styling */
.stretch-control-inline {
    flex: 1;
    padding: 15px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 200px;
}

.stretch-control-inline label {
    display: block;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 12px;
    text-align: center;
    font-size: 0.9em;
}

.stretch-control-inline span {
    color: #ff00ff;
    font-weight: 700;
    text-shadow: 0 0 5px rgba(255, 0, 255, 0.5);
}

.stretch-slider {
    writing-mode: vertical-lr; /* Modern standard */
    direction: rtl; /* Right to left for correct orientation */
    width: 8px;
    height: 150px;
    padding: 0;
    margin: 10px 0;
    background: linear-gradient(180deg, 
        rgba(100, 255, 255, 0.6) 0%, 
        rgba(255, 255, 255, 0.6) 50%, 
        rgba(255, 100, 255, 0.6) 100%
    );
    border-radius: 5px;
    outline: none;
    cursor: pointer;
}

.stretch-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff00ff, #aa00aa);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(255, 0, 255, 0.5);
    transition: transform 0.2s;
}

.stretch-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.8);
}

.stretch-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff00ff, #aa00aa);
    cursor: pointer;
    border: none;
    box-shadow: 0 0 10px rgba(255, 0, 255, 0.5);
    transition: transform 0.2s;
}

.tempo-control label {
    display: block;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 8px;
}

.tempo-control #tempoValue {
    color: #00ffff;
    font-weight: 700;
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
}

#tempoSlider {
    width: 100%;
    height: 6px;
    border-radius: 5px;
    background: linear-gradient(90deg, 
        rgba(255, 100, 100, 0.6) 0%, 
        rgba(255, 255, 255, 0.6) 50%, 
        rgba(100, 255, 100, 0.6) 100%
    );
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

#tempoSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00ffff, #ff00ff);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
    transition: transform 0.2s;
}

#tempoSlider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.8);
}

#tempoSlider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00ffff, #ff00ff);
    cursor: pointer;
    border: none;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
    transition: transform 0.2s;
}

#tempoSlider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.8);
}

.quick-loop-section {
    margin-top: 15px;
    padding: 12px 15px;
    background: rgba(138, 43, 226, 0.15);
    border-radius: 8px;
    border: 2px solid rgba(186, 85, 211, 0.4);
}

.quick-loop-label {
    display: block;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 10px;
    font-size: 0.9em;
}

.quick-loop-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 10px;
}

.quick-loop-btn {
    padding: 8px 12px;
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.6), rgba(186, 85, 211, 0.6));
    border: 2px solid rgba(186, 85, 211, 0.5);
    border-radius: 6px;
    color: white;
    font-weight: 600;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(138, 43, 226, 0.3);
}

.quick-loop-btn:hover {
    background: linear-gradient(135deg, rgba(186, 85, 211, 0.8), rgba(138, 43, 226, 0.8));
    border-color: rgba(186, 85, 211, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(138, 43, 226, 0.5);
}

.quick-loop-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(138, 43, 226, 0.4);
}

.loop-info-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
}

.loop-info-label input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

/* Precise Loop Controls */
.precise-loop-section {
    margin-top: 15px;
    padding: 12px 15px;
    background: rgba(0, 206, 209, 0.15);
    border-radius: 8px;
    border: 2px solid rgba(0, 206, 209, 0.4);
}

.precise-loop-label {
    display: block;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 10px;
    font-size: 0.9em;
}

.precise-loop-inputs {
    display: flex;
    gap: 15px;
    align-items: center;
}

.precise-loop-input-group {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.precise-loop-input-group label {
    font-weight: 700;
    color: #00ffff;
    font-size: 1.1em;
    min-width: 20px;
}

.loop-time-input {
    flex: 1;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(0, 206, 209, 0.5);
    border-radius: 6px;
    color: #00ffff;
    font-size: 0.9em;
    font-weight: 600;
    font-family: 'Courier New', monospace;
    transition: all 0.3s ease;
}

.loop-time-input:hover:not(:disabled) {
    border-color: rgba(0, 206, 209, 0.8);
    background: rgba(0, 0, 0, 0.5);
}

.loop-time-input:focus {
    outline: none;
    border-color: #00ffff;
    background: rgba(0, 0, 0, 0.6);
    box-shadow: 0 0 10px rgba(0, 206, 209, 0.5);
}

.loop-time-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.loop-hint {
    margin-top: 10px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
    border-left: 3px solid #00ffff;
    font-size: 0.8em;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.4;
}

.loop-hint strong {
    color: #00ffff;
    font-weight: 700;
}

.volume-control-inline {
    flex: 1;
    padding: 15px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 200px;
}

.volume-control-inline label {
    display: block;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 12px;
    text-align: center;
    font-size: 0.9em;
}

.volume-control-inline span {
    color: #ff00ff;
    font-weight: 700;
    text-shadow: 0 0 5px rgba(255, 0, 255, 0.5);
}

.volume-slider {
    writing-mode: vertical-lr; /* Modern standard */
    direction: rtl; /* Right to left for correct orientation */
    width: 8px;
    height: 150px;
    padding: 0;
    margin: 10px 0;
    background: linear-gradient(180deg, 
        rgba(255, 0, 255, 0.6) 0%, 
        rgba(100, 100, 100, 0.6) 100%
    );
    border-radius: 5px;
    outline: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff00ff, #00ffff);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(255, 0, 255, 0.5);
    transition: transform 0.2s;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.8);
}

.volume-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff00ff, #00ffff);
    cursor: pointer;
    border: none;
    box-shadow: 0 0 10px rgba(255, 0, 255, 0.5);
    transition: transform 0.2s;
}

/* Pitch Control Styling */
.pitch-control-inline {
    flex: 1;
    padding: 15px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 200px;
}

.pitch-control-inline label {
    display: block;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 12px;
    text-align: center;
    font-size: 0.9em;
}

.pitch-control-inline span {
    color: #00ff00;
    font-weight: 700;
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
}

.pitch-slider {
    writing-mode: vertical-lr; /* Modern standard */
    direction: rtl; /* Right to left for correct orientation */
    width: 8px;
    height: 150px;
    padding: 0;
    margin: 10px 0;
    background: linear-gradient(180deg, 
        rgba(0, 255, 0, 0.6) 0%, 
        rgba(255, 255, 255, 0.6) 50%, 
        rgba(255, 165, 0, 0.6) 100%
    );
    border-radius: 5px;
    outline: none;
    cursor: pointer;
}

.pitch-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00ff00, #00aa00);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
    transition: transform 0.2s;
}

.pitch-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.8);
}

.pitch-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00ff00, #00aa00);
    cursor: pointer;
    border: none;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
    transition: transform 0.2s;
}

/* 3-Band EQ Control Styling */
.eq-control-inline {
    flex: 1;
    padding: 15px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 200px;
}

.eq-control-inline label {
    display: block;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 12px;
    text-align: center;
    font-size: 0.9em;
}

.eq-control-inline span {
    color: #ffa500;
    font-weight: 700;
    text-shadow: 0 0 5px rgba(255, 165, 0, 0.5);
}

.eq-slider {
    writing-mode: vertical-lr; /* Modern standard */
    direction: rtl; /* Right to left for correct orientation */
    width: 8px;
    height: 150px;
    padding: 0;
    margin: 10px 0;
    background: linear-gradient(180deg, 
        rgba(0, 255, 100, 0.6) 0%, 
        rgba(255, 255, 255, 0.6) 50%, 
        rgba(255, 100, 100, 0.6) 100%
    );
    border-radius: 5px;
    outline: none;
    cursor: pointer;
}

.eq-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffa500, #ff8c00);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(255, 165, 0, 0.5);
    transition: transform 0.2s;
}

.eq-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 15px rgba(255, 165, 0, 0.8);
}

.eq-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffa500, #ff8c00);
    cursor: pointer;
    border: none;
    box-shadow: 0 0 10px rgba(255, 165, 0, 0.5);
    transition: transform 0.2s;
}

/* Pan Control Styling */
.pan-control-inline {
    margin-top: 15px;
    padding: 12px 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.pan-control-inline label {
    display: block;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 8px;
    text-align: center;
    font-size: 0.9em;
}

.pan-control-inline span {
    color: #ffff00;
    font-weight: 700;
    text-shadow: 0 0 5px rgba(255, 255, 0, 0.5);
}

.pan-slider {
    width: 100%;
    height: 6px;
    border-radius: 5px;
    background: linear-gradient(90deg, 
        rgba(0, 255, 255, 0.6) 0%, 
        rgba(255, 255, 255, 0.6) 50%, 
        rgba(255, 0, 255, 0.6) 100%
    );
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.pan-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffff00, #ffaa00);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(255, 255, 0, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.8);
    transition: transform 0.2s;
}

.pan-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 15px rgba(255, 255, 0, 1);
}

.pan-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffff00, #ffaa00);
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 10px rgba(255, 255, 0, 0.8);
    transition: transform 0.2s;
}

.volume-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.8);
}

/* Effects Section */
.effects-section {
    margin-top: 15px;
    padding: 12px 15px;
    background: rgba(0, 128, 255, 0.1);
    border-radius: 8px;
    border: 2px solid rgba(0, 191, 255, 0.3);
}

.effects-header {
    font-weight: 700;
    color: rgba(0, 255, 255, 0.9);
    margin-bottom: 12px;
    font-size: 0.95em;
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
}

.effect-control {
    margin-bottom: 10px;
    transition: opacity 0.3s ease, max-height 0.3s ease;
    overflow: hidden;
}

.effect-control label {
    display: block;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 4px;
    font-size: 0.85em;
}

.effect-control span {
    color: #00ffff;
    font-weight: 700;
}

.effect-slider {
    width: 100%;
    height: 4px;
    border-radius: 3px;
    background: linear-gradient(90deg, rgba(0, 128, 255, 0.4), rgba(0, 255, 255, 0.6));
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    margin-bottom: 6px;
}

.effect-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00bfff, #00ffff);
    cursor: pointer;
    box-shadow: 0 0 8px rgba(0, 255, 255, 0.6);
    transition: transform 0.2s;
}

.effect-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 0 12px rgba(0, 255, 255, 0.8);
}

.effect-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00bfff, #00ffff);
    cursor: pointer;
    border: none;
    box-shadow: 0 0 8px rgba(0, 255, 255, 0.6);
    transition: transform 0.2s;
}

.effect-slider::-moz-range-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 0 12px rgba(0, 255, 255, 0.8);
}

.filter-type-select {
    width: 100%;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(0, 255, 255, 0.4);
    border-radius: 4px;
    color: white;
    font-size: 0.85em;
    cursor: pointer;
    outline: none;
}

.filter-type-select:hover {
    border-color: rgba(0, 255, 255, 0.6);
    background: rgba(0, 0, 0, 0.5);
}

/* ADSR Envelope Styles */
.adsr-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    gap: 10px;
}

.adsr-header label {
    font-weight: 700;
    color: rgba(255, 200, 100, 0.9);
    font-size: 0.9em;
    text-shadow: 0 0 5px rgba(255, 200, 100, 0.5);
}

.adsr-trigger-btn {
    padding: 4px 12px;
    background: linear-gradient(135deg, #ff8c00, #ffa500);
    border: 2px solid rgba(255, 200, 100, 0.6);
    border-radius: 5px;
    color: white;
    font-weight: 700;
    font-size: 0.8em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 8px rgba(255, 140, 0, 0.4);
}

.adsr-trigger-btn:hover {
    background: linear-gradient(135deg, #ffa500, #ffb732);
    box-shadow: 0 0 15px rgba(255, 140, 0, 0.6);
    transform: scale(1.05);
}

.adsr-trigger-btn:active {
    transform: scale(0.95);
    box-shadow: 0 0 10px rgba(255, 140, 0, 0.8);
}

.adsr-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px;
    background: rgba(255, 140, 0, 0.05);
    border-radius: 5px;
    border: 1px solid rgba(255, 200, 100, 0.2);
}

.adsr-param {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.adsr-param label {
    font-size: 0.8em;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
}

.adsr-param span {
    color: #ffb732;
    font-weight: 700;
}

.adsr-enable-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
    margin-left: 8px;
}

.adsr-enable-label {
    font-size: 0.85em;
    cursor: pointer;
    user-select: none;
}

.sampler-adsr-control {
    margin-top: 12px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border: 1px solid rgba(255, 200, 100, 0.3);
}

/* Export Section */
.export-section {
    margin-top: 15px;
    padding: 12px 15px;
    background: rgba(0, 200, 100, 0.1);
    border-radius: 8px;
    border: 2px solid rgba(0, 255, 150, 0.3);
}

.export-header {
    font-weight: 700;
    color: rgba(0, 255, 150, 0.9);
    margin-bottom: 10px;
    font-size: 0.95em;
    text-shadow: 0 0 5px rgba(0, 255, 150, 0.5);
}

.export-format-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.export-format-selector label {
    font-size: 0.85em;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
}

.export-format-select {
    flex: 1;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(0, 255, 150, 0.4);
    border-radius: 5px;
    color: white;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.export-format-select:hover {
    background: rgba(0, 255, 150, 0.1);
    border-color: rgba(0, 255, 150, 0.6);
}

.export-format-select:focus {
    outline: none;
    border-color: rgba(0, 255, 150, 0.8);
    box-shadow: 0 0 8px rgba(0, 255, 150, 0.4);
}

.export-format-select option {
    background: #1a1a1a;
    color: white;
}

.export-btn {
    width: 100%;
    padding: 10px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, rgba(0, 200, 100, 0.6), rgba(0, 255, 150, 0.6));
    border: 2px solid rgba(0, 255, 150, 0.5);
    border-radius: 6px;
    color: white;
    font-weight: 600;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 255, 150, 0.3);
}

.export-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(0, 255, 150, 0.8), rgba(0, 200, 100, 0.8));
    border-color: rgba(0, 255, 150, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 255, 150, 0.5);
}

.export-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 255, 150, 0.4);
}

.export-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.visualization-mode {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    padding: 12px 20px;
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    z-index: 10;
}

.visualization-mode label {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.mode-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    font-weight: 600;
}

.mode-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.mode-btn.active {
    background: linear-gradient(135deg, #00ffff, #ff00ff);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 15px rgba(0, 255, 255, 0.3);
}

.mode-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.key-display {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    align-items: center;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    padding: 12px 20px;
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    z-index: 10;
}

.key-display label {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.key-display span[id^="currentKey"],
.key-display #currentKey {
    font-size: 1.5rem;
    font-weight: bold;
    padding: 5px 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    min-width: 60px;
    text-align: center;
    transition: all 0.3s ease;
}

/* Dual Track Controls */
.dual-track-controls-section {
    margin-top: 0;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    border: 2px solid rgba(0, 255, 255, 0.3);
    margin-bottom: 20px;
}

.dual-controls-header {
    font-size: 1.15rem;
    font-weight: 900;
    font-family: 'Orbitron', sans-serif;
    color: rgba(0, 255, 255, 0.95);
    margin-bottom: 15px;
    text-shadow: 0 0 15px rgba(0, 255, 255, 0.7);
    text-align: center;
    letter-spacing: 0.08em;
}

.dual-controls-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.dual-control-btn {
    flex: 1;
    min-width: 200px;
    max-width: 300px;
    font-size: 1.05rem;
    padding: 14px 22px;
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.15), rgba(138, 43, 226, 0.15));
    border: 2px solid rgba(0, 255, 255, 0.4);
    box-shadow: 0 2px 10px rgba(0, 255, 255, 0.2);
}

.dual-control-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.25), rgba(138, 43, 226, 0.25));
    border-color: rgba(0, 255, 255, 0.7);
    box-shadow: 0 0 25px rgba(0, 255, 255, 0.5);
    transform: translateY(-2px);
}

.dual-control-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.dual-icon {
    display: inline-block;
    margin-right: 8px;
    font-size: 1.2rem;
}

/* BPM Sync Controls */
.sync-controls-section {
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.08), rgba(138, 43, 226, 0.08));
    border-radius: 10px;
    border: 2px solid rgba(0, 255, 255, 0.3);
}

.sync-header {
    font-size: 1.1rem;
    font-weight: 700;
    color: #00ffff;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
    margin-bottom: 15px;
    text-align: center;
}

.sync-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.sync-btn {
    position: relative;
    flex: 1;
    min-width: 200px;
    max-width: 280px;
}

.sync-btn.active {
    background: linear-gradient(135deg, #00ffff, #ff00ff);
    border-color: rgba(0, 255, 255, 0.8);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.6),
                0 0 30px rgba(255, 0, 255, 0.4),
                0 4px 15px rgba(0, 0, 0, 0.3);
    animation: syncPulse 2s ease-in-out infinite;
}

@keyframes syncPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(0, 255, 255, 0.6),
                    0 0 30px rgba(255, 0, 255, 0.4),
                    0 4px 15px rgba(0, 0, 0, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(0, 255, 255, 0.8),
                    0 0 40px rgba(255, 0, 255, 0.6),
                    0 6px 20px rgba(0, 0, 0, 0.4);
    }
}

.sync-btn.active:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 0 35px rgba(0, 255, 255, 0.9),
                0 0 50px rgba(255, 0, 255, 0.7),
                0 8px 25px rgba(0, 0, 0, 0.5);
}

.auto-sync-toggle {
    position: relative;
}

.auto-sync-toggle.active {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.3), rgba(255, 140, 0, 0.3));
    border-color: rgba(255, 215, 0, 0.8);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5),
                0 0 30px rgba(255, 140, 0, 0.3);
    animation: autoSyncPulse 1.5s ease-in-out infinite;
}

@keyframes autoSyncPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.5),
                    0 0 30px rgba(255, 140, 0, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.7),
                    0 0 40px rgba(255, 140, 0, 0.5);
    }
}

.sync-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    margin-left: 8px;
    transition: all 0.3s ease;
    vertical-align: middle;
}

.sync-btn.active .sync-indicator,
.auto-sync-toggle.active .sync-indicator {
    background: #00ff00;
    box-shadow: 0 0 10px #00ff00, 0 0 20px rgba(0, 255, 0, 0.5);
    animation: indicatorPulse 1s ease-in-out infinite;
}

@keyframes indicatorPulse {
    0%, 100% { 
        opacity: 1;
        transform: scale(1);
    }
    50% { 
        opacity: 0.6;
        transform: scale(1.2);
    }
}

.sync-status-display {
    text-align: center;
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 2px solid rgba(0, 255, 255, 0.2);
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sync-status-display #syncStatusText {
    font-size: 1.1rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
}

.sync-status-display.active #syncStatusText {
    color: #00ffff;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.6);
    font-size: 1.2rem;
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% {
        text-shadow: 0 0 10px rgba(0, 255, 255, 0.6);
    }
    50% {
        text-shadow: 0 0 20px rgba(0, 255, 255, 0.9),
                     0 0 30px rgba(255, 0, 255, 0.5);
    }
}

/* Crossfader Section */
.crossfader-section {
    margin-top: 0;
    padding: 20px;
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.1), rgba(255, 0, 255, 0.1));
    border-radius: 10px;
    border: 2px solid rgba(128, 0, 255, 0.4);
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(128, 0, 255, 0.2);
}

.crossfader-header {
    font-size: 1.15rem;
    font-weight: 900;
    font-family: 'Orbitron', sans-serif;
    color: rgba(200, 100, 255, 0.95);
    margin-bottom: 15px;
    text-shadow: 0 0 15px rgba(200, 100, 255, 0.7);
    text-align: center;
    letter-spacing: 0.08em;
}

.crossfader-mode-select {
    margin-bottom: 15px;
    text-align: center;
}

.crossfader-mode-select label {
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    margin-right: 10px;
    font-size: 0.95rem;
}

.crossfader-mode-dropdown {
    padding: 8px 15px;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(128, 0, 255, 0.4);
    border-radius: 8px;
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
}

.crossfader-mode-dropdown:hover {
    border-color: rgba(200, 100, 255, 0.6);
    background: rgba(0, 0, 0, 0.6);
    box-shadow: 0 0 10px rgba(128, 0, 255, 0.3);
}

.crossfader-mode-dropdown:focus {
    outline: none;
    border-color: rgba(200, 100, 255, 0.8);
    box-shadow: 0 0 15px rgba(128, 0, 255, 0.5);
}

.crossfader-control {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.crossfader-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
    font-size: 0.85rem;
    font-weight: 700;
}

.crossfader-label-left {
    color: rgba(0, 255, 255, 0.9);
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.6);
}

.crossfader-label-center {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
}

.crossfader-label-right {
    color: rgba(255, 0, 255, 0.9);
    text-shadow: 0 0 8px rgba(255, 0, 255, 0.6);
}

.crossfader-slider {
    width: 100%;
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg, 
        rgba(0, 255, 255, 0.8) 0%, 
        rgba(128, 128, 255, 0.4) 50%, 
        rgba(255, 0, 255, 0.8) 100%
    );
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 
        0 0 15px rgba(128, 0, 255, 0.3),
        inset 0 2px 5px rgba(0, 0, 0, 0.3);
}

.crossfader-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00ffff, #ff00ff);
    cursor: pointer;
    box-shadow: 0 0 20px rgba(200, 100, 255, 1);
    border: 3px solid rgba(255, 255, 255, 0.9);
    transition: transform 0.2s;
}

.crossfader-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 25px rgba(200, 100, 255, 1);
}

.crossfader-slider::-moz-range-thumb {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00ffff, #ff00ff);
    cursor: pointer;
    box-shadow: 0 0 20px rgba(200, 100, 255, 1);
    border: 3px solid rgba(255, 255, 255, 0.9);
    transition: transform 0.2s;
}

.crossfader-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 25px rgba(200, 100, 255, 1);
}

.crossfader-value {
    text-align: center;
    margin-top: 5px;
}

.crossfader-value span {
    font-weight: 700;
    color: rgba(200, 100, 255, 0.95);
    text-shadow: 0 0 10px rgba(200, 100, 255, 0.6);
    font-size: 0.95rem;
}

.microphone-section {
    margin-top: 0;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    border: 2px solid rgba(255, 100, 255, 0.3);
    margin-bottom: 20px;
}

.mic-header {
    font-size: 1.15rem;
    font-weight: 900;
    font-family: 'Orbitron', sans-serif;
    color: rgba(255, 100, 255, 0.95);
    margin-bottom: 15px;
    text-shadow: 0 0 15px rgba(255, 100, 255, 0.7);
    letter-spacing: 0.08em;
}

.mic-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.mic-volume-control {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 15px 12px;
    background: rgba(255, 100, 255, 0.1);
    border-radius: 8px;
    flex: 1;
    min-width: 120px;
    min-height: 200px;
}

.mic-volume-control label {
    font-size: 0.9rem;
    white-space: nowrap;
    text-align: center;
    margin-bottom: 8px;
}

.mic-volume-control input[type="range"] {
    writing-mode: vertical-lr; /* Modern standard */
    direction: rtl; /* Right to left for correct orientation */
    width: 8px;
    height: 150px;
    padding: 0;
    margin: 10px 0;
    background: linear-gradient(180deg, 
        rgba(255, 100, 255, 0.6) 0%, 
        rgba(100, 100, 100, 0.6) 100%
    );
    border-radius: 5px;
    outline: none;
    cursor: pointer;
}

.mic-volume-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff64ff, #ff00ff);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(255, 100, 255, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.8);
}

.mic-volume-control input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff64ff, #ff00ff);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(255, 100, 255, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.8);
}

.mic-monitoring {
    padding: 10px 15px;
    background: rgba(255, 100, 255, 0.1);
    border-radius: 8px;
}

.mic-monitoring label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
}

.mic-monitoring input[type="checkbox"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.mic-waveform-container {
    margin-top: 15px;
}

.mic-waveform-container label {
    display: block;
    font-weight: 600;
    color: rgba(255, 100, 255, 0.9);
    margin-bottom: 10px;
}

.mic-waveform-container canvas {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid rgba(255, 100, 255, 0.3);
}

.mic-icon {
    font-size: 1.1rem;
}

/* Microphone Recording Section */
.mic-recording-section {
    margin-top: 15px;
    padding: 15px;
    background: rgba(255, 50, 100, 0.1);
    border-radius: 10px;
    border: 2px solid rgba(255, 50, 100, 0.4);
}

.mic-recording-header {
    font-size: 1.1rem;
    font-weight: 700;
    color: rgba(255, 100, 150, 0.9);
    margin-bottom: 12px;
    text-shadow: 0 0 10px rgba(255, 100, 150, 0.5);
}

.mic-recording-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.recording-time {
    font-size: 1.2rem;
    font-weight: 700;
    color: #ff0064;
    text-shadow: 0 0 10px rgba(255, 0, 100, 0.5);
    animation: pulse 1s infinite;
}

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

.mic-recording-waveform-container {
    margin: 15px 0;
    background: rgba(10, 10, 10, 0.5);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 50, 100, 0.3);
}

.mic-recording-waveform-container canvas {
    width: 100%;
    height: 120px;
    display: block;
}

.mic-recording-playback {
    margin-top: 15px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
}

.mic-recording-playback audio {
    width: 100%;
    margin-bottom: 15px;
}

.mic-recording-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.mic-recording-load {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.mic-recording-load label {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
}

.load-track-btn {
    flex: 1;
    min-width: 120px;
    background: linear-gradient(135deg, rgba(0, 150, 255, 0.8), rgba(0, 200, 255, 0.8));
    border: 2px solid rgba(0, 200, 255, 0.5);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 150, 255, 0.3);
}

.load-track-btn:hover {
    background: linear-gradient(135deg, rgba(0, 170, 255, 0.9), rgba(0, 220, 255, 0.9));
    box-shadow: 0 6px 20px rgba(0, 200, 255, 0.5);
    transform: translateY(-2px);
}

.load-track-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(0, 200, 255, 0.4);
}

.mic-recording-export {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.export-btn {
    flex: 1;
    min-width: 150px;
    background: linear-gradient(135deg, rgba(100, 200, 100, 0.8), rgba(50, 255, 50, 0.8));
    border: 2px solid rgba(100, 255, 100, 0.5);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(100, 255, 100, 0.3);
}

.export-btn:hover {
    background: linear-gradient(135deg, rgba(120, 220, 120, 0.9), rgba(80, 255, 80, 0.9));
    box-shadow: 0 6px 20px rgba(100, 255, 100, 0.5);
    transform: translateY(-2px);
}

.export-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(100, 255, 100, 0.4);
}

.vocoder-section {
    margin-top: 15px;
    padding: 15px;
    background: rgba(0, 150, 255, 0.1);
    border-radius: 10px;
    border: 2px solid rgba(0, 150, 255, 0.4);
}

.vocoder-header {
    font-size: 1.1rem;
    font-weight: 700;
    color: rgba(0, 200, 255, 0.9);
    margin-bottom: 12px;
    text-shadow: 0 0 10px rgba(0, 200, 255, 0.5);
}

.vocoder-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.vocoder-btn {
    background: linear-gradient(135deg, rgba(0, 150, 255, 0.8), rgba(0, 200, 255, 0.8));
    border: 2px solid rgba(0, 200, 255, 0.5);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 150, 255, 0.3);
}

.vocoder-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(0, 150, 255, 1), rgba(0, 200, 255, 1));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 150, 255, 0.5);
}

.vocoder-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: rgba(60, 60, 60, 0.5);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: none;
}

.vocoder-settings {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.vocoder-control {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.vocoder-control label {
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
    min-width: 120px;
}

.vocoder-select {
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(0, 200, 255, 0.3);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    outline: none;
}

.vocoder-select:hover {
    border-color: rgba(0, 200, 255, 0.6);
    background: rgba(0, 0, 0, 0.6);
}

.vocoder-select:focus {
    border-color: rgba(0, 200, 255, 0.8);
    box-shadow: 0 0 10px rgba(0, 200, 255, 0.4);
}

.vocoder-select option {
    background: #1a1a1a;
    color: white;
}

/* Auto-Tune Section Styling */
.autotune-section {
    margin-top: 15px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    border: 2px solid rgba(150, 0, 255, 0.3);
}

.autotune-header {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 10px;
    color: rgba(200, 100, 255, 0.9);
    text-shadow: 0 0 10px rgba(150, 0, 255, 0.5);
}

.autotune-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.autotune-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, rgba(150, 0, 255, 0.6), rgba(200, 100, 255, 0.6));
    color: white;
    border: 2px solid rgba(150, 0, 255, 0.5);
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(150, 0, 255, 0.3);
}

.autotune-btn:hover {
    background: linear-gradient(135deg, rgba(150, 0, 255, 0.8), rgba(200, 100, 255, 0.8));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(150, 0, 255, 0.5);
}

.autotune-btn:active {
    transform: translateY(0);
}

.autotune-btn:disabled {
    background: rgba(100, 100, 100, 0.3);
    border-color: rgba(100, 100, 100, 0.5);
    cursor: not-allowed;
    box-shadow: none;
}

.autotune-settings {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

.autotune-control {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.autotune-control label {
    font-size: 0.9rem;
    color: rgba(200, 100, 255, 0.8);
}

.autotune-select {
    padding: 8px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(150, 0, 255, 0.4);
    border-radius: 6px;
    color: white;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.autotune-select:hover {
    border-color: rgba(200, 100, 255, 0.6);
    background: rgba(0, 0, 0, 0.6);
}

.autotune-select:focus {
    border-color: rgba(200, 100, 255, 0.8);
    box-shadow: 0 0 10px rgba(150, 0, 255, 0.4);
}

.autotune-select option {
    background: #1a1a1a;
    color: white;
}

.recording-section {
    margin-top: 15px;
    padding: 15px;
    background: rgba(255, 215, 0, 0.08);
    border-radius: 10px;
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.recording-header {
    font-weight: 900;
    font-size: 1.1rem;
    color: rgba(255, 215, 0, 0.95);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
    margin-bottom: 12px;
    text-align: center;
    letter-spacing: 0.05em;
}

.recording-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.recording-export-group {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid rgba(255, 0, 100, 0.3);
}

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

.recording-format-selector label {
    font-size: 0.85em;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    white-space: nowrap;
}

.recording-format-select {
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 0, 100, 0.4);
    border-radius: 5px;
    color: white;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 140px;
}

.recording-format-select:hover {
    background: rgba(255, 0, 100, 0.1);
    border-color: rgba(255, 0, 100, 0.6);
}

.recording-format-select:focus {
    outline: none;
    border-color: rgba(255, 0, 100, 0.8);
    box-shadow: 0 0 8px rgba(255, 0, 100, 0.4);
}

.recording-format-select option {
    background: #1a1a1a;
    color: white;
}

.recording-time {
    font-size: 1.2rem;
    font-weight: bold;
    color: #ff0000;
    padding: 5px 15px;
    background: rgba(255, 0, 0, 0.1);
    border-radius: 5px;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
    animation: pulse 1s ease-in-out infinite;
}

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

.recording-waveform-container {
    margin-top: 15px;
}

.recording-waveform-container label {
    display: block;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 10px;
}

.recording-waveform-container canvas {
    margin-bottom: 10px;
}

.recording-waveform-container audio {
    width: 100%;
    margin-top: 10px;
    filter: sepia(20%) saturate(70%) grayscale(1) contrast(99%) invert(12%);
    border-radius: 10px;
}

.record-icon {
    font-size: 1.1rem;
}

#recordBtn:not(:disabled) {
    border-color: rgba(255, 0, 0, 0.5);
}

#recordBtn:not(:disabled):hover {
    background: rgba(255, 0, 0, 0.2);
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.4);
}

#stopRecordBtn:not(:disabled) {
    border-color: rgba(255, 100, 0, 0.5);
}

#stopRecordBtn:not(:disabled):hover {
    background: rgba(255, 100, 0, 0.2);
    box-shadow: 0 0 20px rgba(255, 100, 0, 0.4);
}

#downloadBtn:not(:disabled) {
    border-color: rgba(0, 255, 100, 0.5);
}

#downloadBtn:not(:disabled):hover {
    background: rgba(0, 255, 100, 0.2);
    box-shadow: 0 0 20px rgba(0, 255, 100, 0.4);
}

#loadToTrack1Btn:not(:disabled) {
    border-color: rgba(0, 255, 255, 0.5);
}

#loadToTrack1Btn:not(:disabled):hover {
    background: rgba(0, 255, 255, 0.2);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.4);
}

#loadToTrack2Btn:not(:disabled) {
    border-color: rgba(255, 0, 255, 0.5);
}

#loadToTrack2Btn:not(:disabled):hover {
    background: rgba(255, 0, 255, 0.2);
    box-shadow: 0 0 20px rgba(255, 0, 255, 0.4);
}

/* Keyboard Sampler Section */
.keyboard-sampler-section {
    margin-top: 20px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    border: 2px solid rgba(138, 43, 226, 0.3);
}

.sampler-header {
    font-size: 1.2rem;
    font-weight: 900;
    font-family: 'Orbitron', sans-serif;
    margin-bottom: 15px;
    color: rgba(200, 150, 255, 0.95);
    text-shadow: 0 0 15px rgba(138, 43, 226, 0.7);
    letter-spacing: 0.08em;
}

.sampler-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sampler-source-select,
.sampler-mode-select,
.sampler-root-select {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sampler-source-select label,
.sampler-mode-select label,
.sampler-root-select label {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    min-width: 100px;
}

.sampler-select {
    flex: 1;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(138, 43, 226, 0.4);
    border-radius: 5px;
    color: white;
    font-size: 0.95em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sampler-select:hover {
    background: rgba(138, 43, 226, 0.1);
    border-color: rgba(138, 43, 226, 0.6);
}

.sampler-select:focus {
    outline: none;
    border-color: rgba(138, 43, 226, 0.8);
    box-shadow: 0 0 8px rgba(138, 43, 226, 0.4);
}

.sampler-select option {
    background: #1a1a1a;
    color: white;
}

.sampler-volume-control {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sampler-volume-control label {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95em;
}

.sampler-volume-slider {
    width: 100%;
    height: 6px;
    background: rgba(138, 43, 226, 0.2);
    border-radius: 3px;
    outline: none;
    transition: all 0.3s ease;
}

.sampler-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: rgba(138, 43, 226, 0.8);
    border: 2px solid rgba(200, 150, 255, 0.9);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sampler-volume-slider::-webkit-slider-thumb:hover {
    background: rgba(138, 43, 226, 1);
    box-shadow: 0 0 10px rgba(138, 43, 226, 0.6);
    transform: scale(1.2);
}

.sampler-volume-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: rgba(138, 43, 226, 0.8);
    border: 2px solid rgba(200, 150, 255, 0.9);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sampler-volume-slider::-moz-range-thumb:hover {
    background: rgba(138, 43, 226, 1);
    box-shadow: 0 0 10px rgba(138, 43, 226, 0.6);
    transform: scale(1.2);
}

.sampler-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.sampler-btn {
    border-color: rgba(138, 43, 226, 0.5);
}

.sampler-btn:not(:disabled):hover {
    background: rgba(138, 43, 226, 0.2);
    box-shadow: 0 0 20px rgba(138, 43, 226, 0.4);
}

.sampler-icon {
    font-size: 1.1rem;
}

.sampler-help-text {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
}

.keyboard-visual {
    margin-top: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    border: 1px solid rgba(138, 43, 226, 0.3);
}

.keyboard-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.keyboard-row:last-child {
    margin-bottom: 0;
}

.keyboard-note {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    min-width: 120px;
    font-size: 0.9rem;
}

.key-indicator {
    padding: 10px 15px;
    background: rgba(138, 43, 226, 0.2);
    border: 2px solid rgba(138, 43, 226, 0.4);
    border-radius: 6px;
    color: white;
    font-weight: bold;
    font-size: 1rem;
    text-align: center;
    min-width: 45px;
    transition: all 0.1s ease;
    user-select: none;
}

.key-indicator.active {
    background: rgba(138, 43, 226, 0.6);
    border-color: rgba(200, 150, 255, 0.8);
    box-shadow: 0 0 15px rgba(138, 43, 226, 0.6);
    transform: scale(0.95);
}

/* Camera Theremin Section */
.camera-theremin-section {
    margin-top: 20px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    border: 2px solid rgba(0, 255, 255, 0.3);
}

.theremin-header {
    font-size: 1.2rem;
    font-weight: 900;
    font-family: 'Orbitron', sans-serif;
    margin-bottom: 15px;
    color: rgba(0, 255, 255, 0.95);
    text-shadow: 0 0 15px rgba(0, 255, 255, 0.7);
    letter-spacing: 0.08em;
}

.theremin-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.theremin-info {
    padding: 10px;
    background: rgba(0, 255, 255, 0.05);
    border-radius: 5px;
    border: 1px solid rgba(0, 255, 255, 0.2);
}

.theremin-help-text {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    line-height: 1.4;
}

.theremin-buttons {
    display: flex;
    gap: 10px;
}

.theremin-btn {
    border-color: rgba(0, 255, 255, 0.5);
    flex: 1;
}

.theremin-btn:not(:disabled):hover {
    background: rgba(0, 255, 255, 0.2);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.4);
}

.theremin-icon {
    font-size: 1.1rem;
}

.theremin-video-container {
    position: relative;
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid rgba(0, 255, 255, 0.3);
}

.theremin-video-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 75%; /* 4:3 aspect ratio */
    overflow: hidden;
}

.theremin-video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    transform: scaleX(-1); /* Mirror the video for more intuitive control */
    object-fit: cover;
}

.theremin-video-container canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.theremin-display-overlay {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 15px;
    border-radius: 5px;
    border: 1px solid rgba(0, 255, 255, 0.5);
    z-index: 3;
    font-family: 'Orbitron', monospace;
    font-size: 1rem;
    color: #00ffff;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.theremin-value {
    margin: 3px 0;
    font-weight: 600;
}

.theremin-value span {
    color: #ffffff;
    font-weight: 700;
}

.theremin-settings {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid rgba(0, 255, 255, 0.2);
}

.theremin-setting {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.theremin-setting label {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.theremin-mapping-help {
    margin-top: -4px;
    padding: 6px 10px;
    background: rgba(0, 255, 255, 0.1);
    border-left: 3px solid rgba(0, 255, 255, 0.5);
    border-radius: 3px;
}

.theremin-mapping-help small {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    line-height: 1.4;
}

.theremin-select {
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(0, 255, 255, 0.4);
    border-radius: 5px;
    color: white;
    font-size: 0.95em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.theremin-select:hover {
    background: rgba(0, 255, 255, 0.1);
    border-color: rgba(0, 255, 255, 0.6);
}

.theremin-select:focus {
    outline: none;
    border-color: rgba(0, 255, 255, 0.8);
    box-shadow: 0 0 8px rgba(0, 255, 255, 0.4);
}

.theremin-select option {
    background: #1a1a1a;
    color: white;
}

.theremin-slider {
    width: 100%;
    height: 6px;
    background: rgba(0, 255, 255, 0.2);
    border-radius: 3px;
    outline: none;
    transition: all 0.3s ease;
}

.theremin-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: rgba(0, 255, 255, 0.8);
    border: 2px solid rgba(0, 255, 255, 0.9);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.theremin-slider::-webkit-slider-thumb:hover {
    background: rgba(0, 255, 255, 1);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.6);
    transform: scale(1.2);
}

.theremin-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: rgba(0, 255, 255, 0.8);
    border: 2px solid rgba(0, 255, 255, 0.9);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.theremin-slider::-moz-range-thumb:hover {
    background: rgba(0, 255, 255, 1);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.6);
    transform: scale(1.2);
}

/* Visualization wrapper for side-by-side layout */
.visualization-wrapper {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    width: 100%;
}

.visualizer-container,
#visualizer-container {
    position: relative;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 15px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    min-height: 500px;
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: move;
    transition: box-shadow 0.3s ease;
}

.visualizer-container:hover,
#visualizer-container:hover {
    box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.5);
}

.visualizer-container canvas,
#visualizer-container canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
    border-radius: 15px;
}

/* Oscilloscope styles */
.oscilloscope-container {
    position: relative;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 15px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    min-height: 500px;
    height: 500px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.oscilloscope-container:hover {
    box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.5);
}

.oscilloscope-header {
    position: relative;
    padding: 15px;
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 2px solid rgba(0, 255, 255, 0.3);
}

.oscilloscope-header label {
    font-size: 1.1rem;
    font-weight: bold;
    color: rgba(0, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.oscilloscope-fullscreen-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 255, 255, 0.15);
    border: 1px solid rgba(0, 255, 255, 0.4);
    color: rgba(0, 255, 255, 0.9);
    font-size: 1.1rem;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.oscilloscope-fullscreen-btn:hover {
    background: rgba(0, 255, 255, 0.3);
    border-color: rgba(0, 255, 255, 0.7);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.oscilloscope-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    min-height: 100vh;
    z-index: 10000;
    border-radius: 0;
    background: rgba(0, 0, 0, 0.95);
    animation: fullscreenEnter 0.3s ease;
}

.oscilloscope-container.fullscreen .oscilloscope-fullscreen-btn {
    background: rgba(0, 255, 255, 0.25);
}

.oscilloscope-canvas {
    flex: 1;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.placeholder,
#placeholder {
    position: absolute;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.2rem;
    z-index: 1;
    pointer-events: none;
}

.placeholder.hidden,
#placeholder.hidden {
    display: none;
}

/* Waveform styles */
.waveform-container {
    position: relative;
    width: 100%;
    height: 80px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.2);
    margin: 10px 0;
}

.waveform-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.waveform-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, rgba(0, 255, 255, 0.3), rgba(255, 0, 255, 0.3));
    pointer-events: none;
    transition: width 0.1s linear;
}

.waveform-zoom-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 5px;
    padding: 5px 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 5px;
}

.zoom-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 5px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.zoom-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(0, 255, 255, 0.5);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.zoom-btn:active {
    transform: scale(0.95);
}

.zoom-info {
    margin-left: auto;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

.zoom-info span {
    color: #00ffff;
    font-weight: 700;
}

.loop-region {
    position: absolute;
    top: 0;
    height: 100%;
    background: rgba(0, 255, 100, 0.2);
    border-left: 2px solid rgba(0, 255, 100, 0.8);
    border-right: 2px solid rgba(255, 100, 0, 0.8);
    pointer-events: none;
    z-index: 1;
}

.loop-marker {
    position: absolute;
    top: 0;
    height: 100%;
    width: 3px;
    cursor: ew-resize;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
    color: white;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
    user-select: none;
}

.loop-marker::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.loop-marker-start {
    background: rgba(0, 255, 100, 0.8);
    box-shadow: 0 0 10px rgba(0, 255, 100, 0.6);
}

.loop-marker-start::after {
    content: attr(data-time);
    position: absolute;
    top: -20px;
    left: 5px;
    font-size: 0.7rem;
    background: rgba(0, 0, 0, 0.7);
    padding: 2px 5px;
    border-radius: 3px;
    white-space: nowrap;
}

.loop-marker-end {
    background: rgba(255, 100, 0, 0.8);
    box-shadow: 0 0 10px rgba(255, 100, 0, 0.6);
}

.loop-marker-end::after {
    content: attr(data-time);
    position: absolute;
    top: -20px;
    right: 5px;
    font-size: 0.7rem;
    background: rgba(0, 0, 0, 0.7);
    padding: 2px 5px;
    border-radius: 3px;
    white-space: nowrap;
}

/* Time tooltip that follows mouse cursor */
.time-tooltip {
    position: absolute;
    top: -30px;
    background: rgba(0, 0, 0, 0.9);
    color: #00ffff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: 'Courier New', monospace;
    pointer-events: none;
    z-index: 1000;
    border: 1px solid rgba(0, 255, 255, 0.5);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
    white-space: nowrap;
}

/* Hover time display in zoom controls */
.hover-time {
    font-size: 0.85em;
    color: rgba(0, 255, 255, 0.9);
    font-weight: 600;
    margin-left: 10px;
}

.hover-time span {
    font-family: 'Courier New', monospace;
    color: #00ffff;
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
}

.track-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.bpm-display {
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
}

.bpm-display span {
    color: #00ffff;
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
    font-size: 1.1rem;
}

.key-display-inline {
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    margin-left: 15px;
}

.key-display-inline span {
    color: #ff00ff;
    text-shadow: 0 0 5px rgba(255, 0, 255, 0.5);
    font-size: 1.1rem;
}

.duration-display {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
}

.waveform-color-picker {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    margin-left: auto;
}

.waveform-color-picker label {
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
}

.waveform-color-picker input[type="color"] {
    width: 50px;
    height: 35px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.waveform-color-picker input[type="color"]:hover {
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

.waveform-color-picker input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 2px;
    border-radius: 4px;
}

.waveform-color-picker input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 3px;
}

.waveform-color-picker input[type="color"]::-moz-color-swatch {
    border: none;
    border-radius: 3px;
}

.reset-color-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    font-weight: 700;
}

.reset-color-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: rotate(180deg) scale(1.1);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
}

.reset-color-btn:active {
    transform: rotate(180deg) scale(1.05);
}

/* Effect Chain Drag and Drop */
.effect-chain-container {
    margin-top: 15px;
    padding: 12px 15px;
    background: rgba(128, 0, 255, 0.1);
    border-radius: 8px;
    border: 2px solid rgba(191, 0, 255, 0.3);
}

.effect-chain-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.effect-chain-title {
    font-weight: 700;
    color: rgba(255, 0, 255, 0.9);
    font-size: 0.95em;
    text-shadow: 0 0 5px rgba(255, 0, 255, 0.5);
}

.effect-chain-reset {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8em;
    transition: all 0.3s ease;
}

.effect-chain-reset:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

.effect-chain-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
}

.effect-chain-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    cursor: move;
    transition: all 0.2s ease;
    user-select: none;
}

.effect-chain-item.enabled {
    background: rgba(0, 255, 128, 0.1);
    border-color: rgba(0, 255, 128, 0.3);
}

.effect-chain-item.disabled {
    background: rgba(128, 128, 128, 0.1);
    border-color: rgba(128, 128, 128, 0.3);
    opacity: 0.6;
}

.effect-chain-item:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateX(5px);
}

.effect-chain-item.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

.effect-chain-item.drag-over {
    border-color: rgba(0, 255, 255, 0.8);
    background: rgba(0, 255, 255, 0.2);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 255, 255, 0.3);
}

.effect-chain-drag-handle {
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.2em;
    cursor: grab;
    line-height: 1;
}

.effect-chain-drag-handle:active {
    cursor: grabbing;
}

.effect-chain-icon {
    font-size: 1.3em;
    line-height: 1;
}

.effect-chain-name {
    flex: 1;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9em;
}

.effect-chain-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 700;
    transition: all 0.2s ease;
    min-width: 30px;
}

.effect-chain-item.enabled .effect-chain-toggle {
    background: rgba(0, 255, 128, 0.3);
    border-color: rgba(0, 255, 128, 0.5);
    color: #00ff80;
}

.effect-chain-item.disabled .effect-chain-toggle {
    background: rgba(255, 0, 0, 0.2);
    border-color: rgba(255, 0, 0, 0.4);
    color: #ff6666;
}

.effect-chain-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.effect-chain-info {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75em;
    margin-top: 8px;
}

/* Master Effects Section */
.master-effects-section {
    margin: 20px 0;
    padding: 20px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 140, 0, 0.1));
    border-radius: 12px;
    border: 3px solid rgba(255, 215, 0, 0.4);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.2);
}

.master-effects-header {
    margin-bottom: 15px;
    text-align: center;
}

.master-title {
    font-size: 1.3rem;
    font-weight: 900;
    color: rgba(255, 215, 0, 1);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.7);
    letter-spacing: 0.05em;
}

.master-effects-content {
    display: grid;
    gap: 15px;
}

/* Master Routing Section */
.master-routing-section {
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.routing-header {
    font-size: 1.1rem;
    font-weight: 700;
    color: rgba(255, 215, 0, 0.9);
    margin-bottom: 12px;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
}

.routing-controls {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.routing-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background: rgba(255, 215, 0, 0.1);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.routing-toggle:hover {
    background: rgba(255, 215, 0, 0.2);
    border-color: rgba(255, 215, 0, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

.routing-toggle input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #ffd700;
}

.routing-toggle span {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
}

.routing-toggle input[type="checkbox"]:checked + span {
    color: #ffd700;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
}

/* Activity Indicators */
.activity-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    margin-left: auto;
    transition: all 0.2s ease;
}

.activity-indicator.active {
    background: #00ff00;
    box-shadow: 0 0 10px #00ff00, 0 0 20px rgba(0, 255, 0, 0.5);
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.2);
    }
}

/* Master Controls Row - Volume/Pan left, Effects right */
.master-controls-row {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 20px;
    align-items: start;
}

@media (max-width: 1000px) {
    .master-controls-row {
        grid-template-columns: 1fr;
    }
}

/* Volume and Pan Section */
.master-volume-pan-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.master-volume-control {
    padding: 15px;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 8px;
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.master-volume-control label {
    display: block;
    font-weight: 700;
    color: rgba(255, 215, 0, 0.9);
    margin-bottom: 10px;
    font-size: 0.95em;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
}

.master-volume-control span {
    color: #ffd700;
    font-weight: 900;
}

.master-volume-control input[type="range"] {
    width: 100%;
}

.master-volume-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    cursor: pointer;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.9);
    border: 3px solid rgba(255, 255, 255, 0.9);
}

.master-volume-control input[type="range"]::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    cursor: pointer;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.9);
    border: 3px solid rgba(255, 255, 255, 0.9);
}

/* Master Pan Control */
.master-pan-control {
    padding: 15px;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 8px;
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.master-pan-control label {
    display: block;
    font-weight: 700;
    color: rgba(255, 215, 0, 0.9);
    margin-bottom: 10px;
    font-size: 0.95em;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
}

.master-pan-control span {
    color: #ffd700;
    font-weight: 900;
}

.master-pan-control input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: linear-gradient(90deg, 
        rgba(0, 255, 255, 0.6) 0%, 
        rgba(255, 215, 0, 0.8) 50%, 
        rgba(255, 0, 255, 0.6) 100%
    );
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.master-pan-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    cursor: pointer;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.9);
    border: 3px solid rgba(255, 255, 255, 0.9);
    transition: transform 0.2s;
}

.master-pan-control input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 0 20px rgba(255, 215, 0, 1);
}

.master-pan-control input[type="range"]::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    cursor: pointer;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.9);
    border: 3px solid rgba(255, 255, 255, 0.9);
    transition: transform 0.2s;
}

/* Master Effects Wrapper (right side) */
.master-effects-wrapper {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Master effect chain - gold theme */
#effectChainMaster {
    background: rgba(255, 215, 0, 0.1);
    border-color: rgba(255, 215, 0, 0.3);
}

#effectChainMaster .effect-chain-title {
    color: rgba(255, 215, 0, 0.9);
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
}

#effectChainMaster .effect-chain-item.enabled {
    background: rgba(255, 215, 0, 0.15);
    border-color: rgba(255, 215, 0, 0.4);
}

#effectChainMaster .effect-chain-item.enabled .effect-chain-toggle {
    background: rgba(255, 215, 0, 0.3);
    border-color: rgba(255, 215, 0, 0.5);
    color: #ffd700;
}

/* Credits Footer */
.credits {
    position: fixed;
    bottom: 10px;
    right: 15px;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.3);
    font-family: 'Courier New', monospace;
    letter-spacing: 0.05em;
    pointer-events: none;
    z-index: 1;
}

/* Responsive layout for smaller screens */
@media (max-width: 1200px) {
    .visualization-wrapper {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .oscilloscope-container {
        min-height: 300px;
        height: 300px;
    }
}
/* Tab Navigation Styles */
.tab-navigation {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    background: rgba(0, 0, 0, 0.3);
    padding: 10px;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.tab-btn {
    flex: 1;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: bold;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.8);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.tab-btn.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.8), rgba(118, 75, 162, 0.8));
    color: white;
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Sequencer Styles */
.sequencer-container {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    padding: 20px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
}

/* Fullscreen Mode for Sequencer */
.sequencer-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    border-radius: 0;
    background: rgba(0, 0, 0, 0.95);
    overflow: auto;
    padding: 30px;
    animation: fullscreenEnter 0.3s ease;
}

@keyframes fullscreenEnter {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.sequencer-container.fullscreen .sequencer-workspace {
    height: calc(100vh - 200px);
}

.sequencer-container.fullscreen .clips-panel {
    max-height: calc(100vh - 250px);
}

.sequencer-container.fullscreen .sequencer-timeline-container {
    max-height: calc(100vh - 200px); /* More space in fullscreen */
    min-height: 400px;
}

/* Hide visualizer and oscilloscope when sequencer is in fullscreen mode */
body.sequencer-fullscreen .visualization-wrapper {
    display: none !important;
}

.sequencer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.sequencer-header h2 {
    font-size: 2rem;
    margin: 0;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.sequencer-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.sequencer-btn {
    padding: 10px 20px;
    font-size: 1rem;
    font-weight: bold;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.8), rgba(118, 75, 162, 0.8));
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sequencer-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.5);
}

.sequencer-btn:active {
    transform: translateY(0);
}

.sequencer-btn.active {
    background: linear-gradient(135deg, rgba(118, 75, 162, 0.9), rgba(102, 126, 234, 0.9));
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.6);
}

.bpm-control {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
}

.bpm-control input[type="number"] {
    width: 70px;
    padding: 8px;
    font-size: 1rem;
    background: rgba(0, 0, 0, 0.3);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    text-align: center;
}

.zoom-control {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
}

.zoom-control input[type="range"] {
    cursor: pointer;
}

.zoom-control span {
    min-width: 50px;
    text-align: center;
}

.cache-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

.cache-status span {
    color: #4CAF50;
    font-weight: bold;
}

.sequencer-workspace {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 20px;
    margin-top: 20px;
    align-items: start; /* Align items to top, let them size naturally */
}

/* Clips Panel */
.clips-panel {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    padding: 15px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    min-height: 300px; /* Minimum height */
    max-height: 85vh; /* Match timeline - larger when effects hidden */
    height: auto; /* Auto-size to match timeline */
    overflow-y: auto;
    overflow-x: hidden; /* Prevent horizontal scroll */
    transition: max-height 0.3s ease;
    scroll-behavior: smooth;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sequencer-workspace.effects-visible .clips-panel {
    max-height: 80vh; /* Smaller when effects visible */
}

/* Webkit scrollbar styling for clips panel */
.clips-panel::-webkit-scrollbar {
    width: 8px;
}

.clips-panel::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.clips-panel::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.6);
    border-radius: 4px;
}

.clips-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.8);
}

.clips-panel.drag-over {
    background: rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.6);
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.4);
}

.clips-panel h3 {
    margin: 0 0 15px 0;
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}

/* Sequencer Upload Section */
.sequencer-upload-section {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.sequencer-upload-btn {
    display: block;
    padding: 12px 20px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.7), rgba(118, 75, 162, 0.7));
    color: white;
    text-align: center;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.sequencer-upload-btn:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.9), rgba(118, 75, 162, 0.9));
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.5);
}

.sequencer-upload-btn:active {
    transform: translateY(0);
}

.sequencer-upload-help {
    margin-top: 8px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    font-style: italic;
}

.clips-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1; /* Allow clips list to grow within panel */
    min-height: 0; /* Allow flexbox to shrink if needed */
}

.clip-item {
    padding: 8px 10px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.6), rgba(118, 75, 162, 0.6));
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    cursor: grab;
    transition: all 0.2s ease;
}

.clip-item:hover {
    transform: translateX(5px);
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.6);
}

.clip-item:active {
    cursor: grabbing;
}

.clip-item.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.clip-name {
    font-weight: bold;
    display: block;
    margin-bottom: 3px;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.clip-duration {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
}

.clip-help-text {
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* Add Track Button - special styling */
.add-track-btn {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.6), rgba(56, 142, 60, 0.6)) !important;
    border-color: rgba(76, 175, 80, 0.5) !important;
    cursor: pointer !important;
}

.add-track-btn:hover {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.8), rgba(56, 142, 60, 0.8)) !important;
    border-color: rgba(76, 175, 80, 0.8) !important;
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.8) !important;
}

.add-track-btn .clip-name {
    text-align: center;
    font-size: 1rem;
    margin-bottom: 0;
}

/* Sequencer Timeline */
.sequencer-timeline-container {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    padding: 15px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    overflow-x: auto;
    overflow-y: auto;
    min-height: 300px; /* Minimum height for empty state */
    max-height: 85vh; /* Larger when effects panel hidden - allow vertical expansion */
    height: auto; /* Auto-size based on content */
    scroll-behavior: smooth;
    cursor: grab;
    transition: max-height 0.3s ease; /* Smooth transition when toggling effects */
}

.sequencer-workspace.effects-visible .sequencer-timeline-container {
    max-height: 80vh; /* Slightly smaller when effects panel visible */
}

.sequencer-timeline-container:active {
    cursor: grabbing;
}

/* Webkit scrollbar styling for horizontal scroll */
.sequencer-timeline-container::-webkit-scrollbar {
    height: 10px;
}

.sequencer-timeline-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
}

.sequencer-timeline-container::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.6);
    border-radius: 5px;
}

.sequencer-timeline-container::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.8);
}

.timeline-header {
    margin-bottom: 10px;
    position: relative; /* Allow absolute positioning of loop markers */
}

/* Timeline Loop Markers */
.timeline-loop-marker {
    position: absolute;
    top: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(to bottom, rgba(255, 215, 0, 0.9), rgba(255, 165, 0, 0.9));
    z-index: 10;
    cursor: ew-resize;
    transition: width 0.2s;
}

.timeline-loop-marker:hover {
    width: 5px;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
}

.timeline-loop-marker-label {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 215, 0, 0.95);
    color: #000;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.timeline-loop-region {
    position: absolute;
    top: 0;
    height: 100%;
    background: rgba(255, 215, 0, 0.15);
    border: 2px solid rgba(255, 215, 0, 0.4);
    border-radius: 4px;
    z-index: 5;
    pointer-events: none;
}

.timeline-ruler {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    padding: 8px;
    min-height: 40px;
    position: relative;
    min-width: fit-content;
}

.bar-marker {
    flex-shrink: 0;
    text-align: center;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    padding: 5px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.8);
}

.bar-marker:last-child {
    border-right: none;
}

.sequencer-tracks {
    display: flex;
    flex-direction: column;
    gap: 10px;
    /* Removed min-height to allow natural sizing based on track count */
    width: fit-content; /* Allow tracks to expand beyond viewport */
    min-width: 100%; /* At minimum, fill container */
}

.sequencer-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 10px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    min-height: 80px;
    position: relative;
    overflow: visible; /* Allow track to extend naturally */
    display: block; /* Block level element */
    width: fit-content; /* Shrink-wrap to content */
    min-width: 100%; /* At minimum, fill container width */
}

.track-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.track-name {
    font-weight: bold;
    color: rgba(255, 255, 255, 0.9);
}

.sequencer-track .track-controls {
    display: flex;
    gap: 5px;
    align-items: center;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.track-volume-control {
    display: flex;
    align-items: center;
    gap: 3px;
    background: rgba(0, 0, 0, 0.3);
    padding: 3px 6px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.track-volume-control label {
    font-size: 0.7rem;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.8);
    min-width: 20px;
}

.track-volume-slider {
    width: 60px;
    height: 3px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    border-radius: 2px;
}

.track-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.9), rgba(118, 75, 162, 0.9));
    cursor: pointer;
    border-radius: 50%;
    border: 2px solid white;
}

.track-volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.9), rgba(118, 75, 162, 0.9));
    cursor: pointer;
    border-radius: 50%;
    border: 2px solid white;
}

.track-volume-value {
    font-size: 0.75rem;
    font-weight: bold;
    min-width: 35px;
    text-align: right;
    color: rgba(255, 255, 255, 0.9);
}

.track-control-btn {
    padding: 3px 6px;
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.track-control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.track-timeline {
    display: block; /* Changed from flex to allow natural width expansion */
    position: relative;
    min-height: 50px;
    /* Width will be set dynamically by JavaScript based on clips */
    background: repeating-linear-gradient(
        90deg,
        rgba(0, 0, 0, 0.2) 0px,
        rgba(0, 0, 0, 0.2) 150px,
        rgba(0, 0, 0, 0.3) 150px,
        rgba(0, 0, 0, 0.3) 151px
    ); /* Default bar grid pattern */
}

.timeline-clip {
    position: absolute;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.8), rgba(118, 75, 162, 0.8));
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 6px;
    padding: 8px;
    cursor: move;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.timeline-clip:hover {
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.8);
    border-color: rgba(255, 255, 255, 0.6);
}

.timeline-clip.dragging {
    opacity: 0.7;
    z-index: 1000;
}

.timeline-clip.resizing {
    opacity: 0.8;
    z-index: 1000;
}

/* Resize handles */
.timeline-clip::before,
.timeline-clip::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 8px;
    z-index: 10;
    cursor: ew-resize;
}

.timeline-clip::before {
    left: 0;
    border-left: 2px solid rgba(255, 255, 255, 0.6);
    background: linear-gradient(to right, rgba(255, 255, 255, 0.2), transparent);
}

.timeline-clip::after {
    right: 0;
    border-right: 2px solid rgba(255, 255, 255, 0.6);
    background: linear-gradient(to left, rgba(255, 255, 255, 0.2), transparent);
}

.timeline-clip:hover::before,
.timeline-clip:hover::after {
    border-color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.3);
}

.timeline-clip-waveform {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.4;
    pointer-events: none;
    z-index: 0;
    /* Ensure canvas doesn't overflow */
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.timeline-clip-content {
    font-weight: bold;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    z-index: 2;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    padding: 5px;
}

/* Timestretch badge for clips */
.timestretch-badge {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: rgba(76, 175, 80, 0.9);
    color: white;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    z-index: 10;
    pointer-events: none;
}

/* Rendering overlay for clips */
.rendering-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    border-radius: 4px;
}

.rendering-overlay span {
    color: #ffeb3b;
    font-weight: bold;
    font-size: 0.9rem;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
    animation: pulse 1.5s infinite;
}

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

/* Sequencer render progress bar */
.sequencer-render-progress {
    position: relative;
    width: 300px;
    height: 30px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
    margin-left: 20px;
    display: none;
}

.sequencer-render-progress .progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #66BB6A);
    width: 0%;
    transition: width 0.3s ease;
}

.sequencer-render-progress .progress-text {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 0.85rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    z-index: 1;
}

.timeline-bar {
    flex-shrink: 0;
    border-right: 1px dashed rgba(255, 255, 255, 0.1);
    position: relative;
    height: 100%;
}

.timeline-bar:last-child {
    border-right: none;
}

.drop-indicator {
    position: absolute;
    background: rgba(0, 255, 255, 0.3);
    border: 2px dashed rgba(0, 255, 255, 0.6);
    border-radius: 6px;
    pointer-events: none;
    z-index: 999;
}

/* Playhead */
.playhead {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(255, 0, 0, 0.8);
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.6);
    z-index: 1001;
    pointer-events: auto;
    cursor: ew-resize;
}

.playhead::before {
    content: '▼';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: auto;
    cursor: pointer;
    color: rgba(255, 0, 0, 0.8);
    font-size: 16px;
}

/* Sequencer Effects Panel */
.sequencer-effects-panel {
    background: rgba(0, 0, 0, 0.5);
    border-radius: 12px;
    padding: 15px;
    border: 2px solid rgba(102, 126, 234, 0.5);
    max-height: 600px;
    overflow-y: auto;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.sequencer-effects-header {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.sequencer-effects-header h3 {
    margin: 0 0 10px 0;
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

.selected-clip-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(102, 126, 234, 0.2);
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: bold;
    gap: 10px; /* Space between clip name and close button */
}

#selectedClipName {
    flex: 1; /* Take up available space */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0; /* Allow flex item to shrink below content size */
    font-size: clamp(0.75rem, 2.5vw, 1rem); /* Responsive font size: min 0.75rem, max 1rem */
}

.clip-header-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

.delete-clip-btn {
    background: rgba(255, 100, 100, 0.2);
    border: 1px solid rgba(255, 100, 100, 0.4);
    color: white;
    border-radius: 4px;
    padding: 4px 10px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.delete-clip-btn:hover {
    background: rgba(255, 50, 50, 0.4);
    border-color: rgba(255, 50, 50, 0.6);
    transform: scale(1.05);
}

.delete-clip-btn:active {
    transform: scale(0.95);
}

.close-effects-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    border-radius: 4px;
    padding: 4px 10px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
    flex-shrink: 0; /* Prevent button from shrinking */
}

.close-effects-btn:hover {
    background: rgba(255, 0, 0, 0.3);
    border-color: rgba(255, 0, 0, 0.5);
}

.sequencer-effects-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.clip-effect-control {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.clip-effect-control label {
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.9);
}

.clip-effect-control .effect-slider {
    width: 100%;
}

.clip-effect-control .filter-type-select {
    padding: 6px;
    background: rgba(0, 0, 0, 0.3);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    font-size: 0.9rem;
}

/* Adjust sequencer workspace grid when effects panel is visible */
.sequencer-workspace {
    display: grid;
    grid-template-columns: 250px 1fr; /* Default: clips panel + timeline (full width) */
    gap: 20px;
    margin-top: 20px;
    transition: grid-template-columns 0.3s ease;
}

.sequencer-workspace.effects-visible {
    grid-template-columns: 250px 1fr 280px; /* clips panel + timeline + effects panel */
}

/* Highlight selected clip */
.timeline-clip.selected {
    border-color: rgba(255, 215, 0, 0.8);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
}

/* Sequencer Recording Section */
.sequencer-recording-section {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    padding: 15px;
    margin-top: 15px;
    border: 2px solid rgba(255, 100, 100, 0.3);
}

.sequencer-recording-section .recording-header {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 10px;
    color: rgba(255, 100, 100, 0.9);
    text-shadow: 0 0 10px rgba(255, 100, 100, 0.5);
}

.sequencer-recording-controls {
    display: flex;
    gap: 10px;
    margin: 10px 0;
    align-items: center;
}

/* ─── Responsive breakpoints ─────────────────────────────────────────────── */

/* 768 px — tablet: single-column, reduced font sizes, stacked mixer controls */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    h1 {
        font-size: 1.8rem;
        letter-spacing: 0.05em;
    }

    .controls {
        padding: 15px;
        border-radius: 10px;
    }

    /* Stack the 3-column DJ layout (already done at 1400px, repeat for clarity) */
    .dj-decks-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    /* Stack dual-track visualiser */
    .dual-visualizer-wrapper {
        grid-template-columns: 1fr;
    }

    /* Stack master controls */
    .master-controls-row {
        grid-template-columns: 1fr;
    }

    /* Waveform canvas: give it a fixed minimum height on small screens */
    .waveform-canvas {
        min-height: 80px;
    }

    /* Mixer section: reduce padding */
    .dj-mixer-section {
        padding: 12px;
    }

    /* Crossfader labels: smaller text */
    .crossfader-label-left,
    .crossfader-label-right,
    .crossfader-label-center {
        font-size: 0.75rem;
    }

    /* Tab buttons: fill row */
    .tab-navigation {
        flex-wrap: wrap;
    }

    .tab-btn {
        flex: 1 1 auto;
        text-align: center;
    }

    .control-btn-small {
        padding: 12px 16px;
        min-width: 60px;
        min-height: 60px;
    }

    .track-controls {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
        padding: 12px;
    }

    .loop-roll-controls-row {
        gap: 6px;
    }

    .file-name {
        max-width: 100%;
    }

    /* Prevent the 7 slider containers from overflowing at tablet widths */
    .tempo-volume-row {
        flex-wrap: wrap;
    }
}

/* 480 px — mobile: single-column, larger tap targets, hide 3-D visualiser */
@media (max-width: 480px) {
    h1 {
        font-size: 1.4rem;
    }

    /* Larger tap targets for buttons */
    .control-btn-small {
        min-width: 44px;
        min-height: 44px;
        font-size: 1.1rem;
    }

    .control-btn {
        min-height: 44px;
        width: 100%;
        justify-content: center;
    }

    /* Sliders: full-width and taller touch target */
    input[type="range"] {
        height: 28px;
        width: 100%;
    }

    /* Sliders: switch vertical → horizontal */
    .volume-slider,
    .tempo-control-inline input[type="range"],
    .pitch-slider,
    .stretch-slider,
    .eq-slider {
        writing-mode: horizontal-tb;
        direction: ltr;
        width: 100%;
        height: 32px;
    }

    /* Slider containers: switch column → row */
    .volume-control-inline,
    .tempo-control-inline,
    .pitch-control-inline,
    .stretch-control-inline,
    .eq-control-inline {
        flex-direction: row;
        min-height: auto;
        align-items: center;
        width: 100%;
        gap: 8px;
        padding: 8px;
    }

    /* tempo-volume-row: 2-column grid instead of stacked column */
    .tempo-volume-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }

    /* control-btn-small: allow buttons to shrink freely on narrow screens */
    .control-btn-small {
        min-width: 0;
        min-height: 44px;
        padding: 8px 6px;
        font-size: 1.2rem;
    }

    /* track-controls: fixed 4-column grid, reduced padding */
    .track-controls {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
        padding: 8px;
    }

    /* hot-cue-btn: better touch target */
    .hot-cue-btn {
        width: 38px;
        height: 34px;
    }

    /* beat-nudge-btn: better touch target */
    .beat-nudge-btn {
        width: 36px;
        height: 32px;
    }

    .dj-mixer-section {
        padding: 10px;
    }

    .controls {
        padding: 10px;
    }

    .hot-cues-label,
    .beat-grid-label {
        white-space: normal;
    }

    /* Hide the 3-D oscilloscope visualiser — too heavy for mobile */
    .dual-visualizer-wrapper {
        display: none;
    }

    /* Mic waveform canvas: reduce height on mobile */
    #micWaveform {
        height: 40px !important;
    }

    /* Upload buttons: full-width */
    .upload-btn {
        width: 100%;
        text-align: center;
        box-sizing: border-box;
    }

    /* Credits: hide on mobile to reclaim space */
    .credits {
        display: none;
    }
}

/* ============================================================
   F-004 — Hot Cues
   ============================================================ */

.hot-cues-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
}

.hot-cues-top-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.hot-cues-label {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    white-space: nowrap;
    min-width: 58px;
}

.hot-cues-buttons {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.hot-cue-btn {
    width: 34px;
    height: 28px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    cursor: pointer;
    font-size: 11px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.5);
    background: rgba(40, 40, 40, 0.85);
    transition: transform 0.08s, box-shadow 0.1s, background-color 0.15s;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 2px;
    position: relative;
}

.hot-cue-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.hot-cue-btn.cue-set {
    color: rgba(0, 0, 0, 0.85);
    border-color: transparent;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.3);
}

.hot-cue-btn:not(:disabled):hover {
    transform: translateY(-2px) scale(1.06);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
    filter: brightness(1.15);
}

.hot-cue-btn:not(:disabled):active {
    transform: scale(0.93);
}

/* Flash animations */
@keyframes hcFlashSet {
    0%   { filter: brightness(1); outline: 3px solid #fff; outline-offset: 1px; }
    50%  { filter: brightness(2.5); outline-color: #fff; }
    100% { filter: brightness(1); outline: none; }
}

@keyframes hcFlashJump {
    0%   { filter: brightness(1); outline: 3px solid rgba(255,255,255,0.6); outline-offset: 1px; }
    40%  { filter: brightness(1.8); }
    100% { filter: brightness(1); outline: none; }
}

.hot-cue-btn.hc-flash-set  { animation: hcFlashSet  0.28s ease-out forwards; }
.hot-cue-btn.hc-flash-jump { animation: hcFlashJump 0.22s ease-out forwards; }

/* Hint row */
.hot-cues-hint {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 6px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.42);
    line-height: 1.4;
}

.hot-cues-hint strong {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
}

.hc-hint-sep {
    color: rgba(255, 255, 255, 0.2);
    font-size: 12px;
}

.hot-cues-hint kbd {
    display: inline-block;
    padding: 1px 5px;
    font-size: 9px;
    font-family: monospace;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 3px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.6;
}

.hc-hint-crossdeck {
    margin-top: 2px;
    border-top: 1px solid rgba(255,255,255,0.06);
    padding-top: 3px;
    color: rgba(255,255,255,0.32);
}
.hc-hint-crossdeck-label {
    color: rgba(255,255,255,0.22);
    font-style: italic;
}

/* Waveform cue-point marker line */
.hot-cue-marker {
    position: absolute;
    top: 0;
    height: 100%;
    width: 2px;
    pointer-events: none;
    z-index: 2;
    transform: translateX(-50%);
}

/* ============================================================
   F-005 — Beat Grid + Quantize
   ============================================================ */

/* Overlay canvas — above waveform, below hot-cue markers */
.beat-grid-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.beat-grid-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
}

.beat-grid-top-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.beat-grid-label {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    white-space: nowrap;
    min-width: 58px;
}

.beat-grid-bpm-display {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.65);
    font-weight: 600;
    letter-spacing: 0.3px;
    margin-left: auto;
}

.beat-grid-toggle-btn,
.beat-snap-btn {
    padding: 4px 10px;
    border-radius: 5px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(40, 40, 40, 0.85);
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.beat-grid-toggle-btn:disabled,
.beat-snap-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.beat-grid-toggle-btn.active {
    background: rgba(0, 220, 180, 0.18);
    border-color: rgba(0, 220, 180, 0.6);
    color: #00dcb4;
    box-shadow: 0 0 10px rgba(0, 220, 180, 0.25);
}

.beat-snap-btn.active {
    background: rgba(255, 200, 0, 0.18);
    border-color: rgba(255, 200, 0, 0.6);
    color: #ffc800;
    box-shadow: 0 0 10px rgba(255, 200, 0, 0.25);
}

.beat-grid-toggle-btn:not(:disabled):hover,
.beat-snap-btn:not(:disabled):hover {
    filter: brightness(1.2);
    transform: translateY(-1px);
}

.beat-grid-controls-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.beat-nudge-btn {
    width: 30px;
    height: 28px;
    border-radius: 4px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(40, 40, 40, 0.85);
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.1s;
    flex-shrink: 0;
}

.beat-nudge-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.beat-nudge-btn:not(:disabled):hover  { filter: brightness(1.3); transform: scale(1.08); }
.beat-nudge-btn:not(:disabled):active { transform: scale(0.92); }

.tap-tempo-btn {
    flex: 1;
    height: 28px;
    border-radius: 5px;
    border: 2px solid rgba(255, 100, 100, 0.35);
    background: rgba(40, 20, 20, 0.85);
    color: rgba(255, 140, 140, 0.85);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.08s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}

.tap-tempo-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.tap-tempo-btn:not(:disabled):hover {
    border-color: rgba(255, 100, 100, 0.6);
    color: #ff8888;
}

.tap-tempo-btn:not(:disabled):active {
    background: rgba(255, 80, 80, 0.25);
    border-color: rgba(255, 80, 80, 0.7);
    transform: scale(0.97);
}

.tap-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 16px;
    padding: 0 5px;
    font-size: 10px;
    font-weight: 700;
    background: rgba(255, 130, 130, 0.18);
    border-radius: 10px;
    color: rgba(255, 150, 150, 0.9);
}

.beat-grid-hint {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 6px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.42);
    line-height: 1.4;
}

.bg-hint-sep { color: rgba(255, 255, 255, 0.2); font-size: 12px; }

.beat-grid-hint kbd {
    display: inline-block;
    padding: 1px 5px;
    font-size: 9px;
    font-family: monospace;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 3px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.6;
}

/* ----- F-006: Slip Mode ----- */
.slip-playhead {
    position: absolute;
    top: 0;
    height: 100%;
    width: 2px;
    background: linear-gradient(
        180deg,
        rgba(255, 180, 0, 0)   0%,
        rgba(255, 180, 0, 0.9) 10%,
        rgba(255, 180, 0, 0.9) 90%,
        rgba(255, 180, 0, 0)   100%
    );
    z-index: 3;
    pointer-events: none;
    transform: translateX(-50%);
    display: none;
    transition: left 0.05s linear;
}

.slip-btn {
    color: #ffb400;
    border: 1px solid rgba(255, 180, 0, 0.4);
    background: rgba(255, 180, 0, 0.08);
    font-size: 0.68rem;
    letter-spacing: 0.05em;
    font-weight: 700;
    padding: 2px 7px;
}

.slip-btn:hover:not(:disabled) {
    background: rgba(255, 180, 0, 0.2);
    border-color: rgba(255, 180, 0, 0.7);
    color: #ffc933;
}

.slip-btn.active {
    background: rgba(255, 180, 0, 0.35);
    border-color: #ffb400;
    box-shadow: 0 0 10px rgba(255, 180, 0, 0.5), inset 0 0 6px rgba(255, 180, 0, 0.2);
    color: #ffe066;
}

.slip-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* ----- F-009: Sidechain Compression ----- */
.sidechain-section {
    background: rgba(255, 50, 140, 0.06);
    border: 1px solid rgba(255, 50, 140, 0.22);
    border-radius: 8px;
    padding: 10px 14px 12px;
    margin: 8px 4px;
}

.sidechain-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.sidechain-title {
    font-size: 0.72rem;
    font-weight: 700;
    color: #ff5599;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sidechain-direction-btn {
    font-size: 0.6rem;
    color: rgba(255, 85, 153, 0.65);
    background: rgba(255, 85, 153, 0.08);
    border: 1px solid rgba(255, 85, 153, 0.25);
    border-radius: 3px;
    padding: 2px 7px;
    margin-left: auto;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.sidechain-direction-btn:hover:not(:disabled) {
    background: rgba(255, 85, 153, 0.2);
    border-color: rgba(255, 85, 153, 0.5);
    color: #ff88bb;
}

.sidechain-direction-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.sidechain-toggle-btn {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    padding: 2px 10px;
    border-radius: 4px;
    border: 1px solid rgba(255, 85, 153, 0.4);
    background: rgba(255, 85, 153, 0.08);
    color: #ff5599;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s, color 0.15s;
}

.sidechain-toggle-btn:hover:not(:disabled) {
    background: rgba(255, 85, 153, 0.22);
    border-color: rgba(255, 85, 153, 0.7);
}

.sidechain-toggle-btn.active {
    background: rgba(255, 85, 153, 0.3);
    border-color: #ff5599;
    box-shadow: 0 0 10px rgba(255, 85, 153, 0.45);
    color: #ff88bb;
}

.sidechain-toggle-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.sidechain-controls {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.sc-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sc-label {
    font-size: 0.63rem;
    color: rgba(255, 255, 255, 0.45);
    width: 62px;
    flex-shrink: 0;
    text-align: right;
}

.sc-slider {
    flex: 1;
    -webkit-appearance: none;
    height: 3px;
    border-radius: 2px;
    background: rgba(255, 85, 153, 0.22);
    outline: none;
    cursor: pointer;
}

.sc-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ff5599;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(255, 85, 153, 0.6);
}

.sc-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ff5599;
    cursor: pointer;
    border: none;
}

.sc-value {
    font-size: 0.62rem;
    color: rgba(255, 255, 255, 0.5);
    width: 58px;
    text-align: right;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

.sc-meter-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

.sc-meter-label {
    font-size: 0.6rem;
    color: #ff5599;
    font-weight: 700;
    width: 62px;
    text-align: right;
    flex-shrink: 0;
    letter-spacing: 0.06em;
}

.sc-meter-track {
    flex: 1;
    height: 6px;
    background: rgba(255, 85, 153, 0.1);
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid rgba(255, 85, 153, 0.2);
}

.sc-meter-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ff5599 0%, #ff1166 100%);
    border-radius: 3px;
    transition: width 0.04s linear;
}


/* ================================================================
   Transcription Feature Styles
   ================================================================ */

.transcription-separator {
    flex-basis: 100%;
    height: 1px;
    background: rgba(139, 92, 246, 0.4);
    margin: 6px 0;
}

.transcribe-btn {
    border-color: rgba(139, 92, 246, 0.6) !important;
    color: #c4b5fd !important;
}

.transcribe-btn:hover {
    background: rgba(139, 92, 246, 0.15) !important;
    border-color: #8b5cf6 !important;
    color: #ddd6fe !important;
}

.transcribe-btn.loading {
    opacity: 0.7;
    animation: transcribe-pulse 1.2s ease-in-out infinite;
}

@keyframes transcribe-pulse {
    0%, 100% { border-color: rgba(139, 92, 246, 0.4); }
    50%       { border-color: #8b5cf6; box-shadow: 0 0 8px rgba(139, 92, 246, 0.5); }
}

.transcription-panel {
    background: rgba(139, 92, 246, 0.06);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 8px;
    padding: 12px 14px;
    margin: 8px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.transcription-options-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.transcription-option-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.transcription-label {
    font-size: 0.8rem;
    color: #c4b5fd;
    white-space: nowrap;
}

.transcription-select {
    background: rgba(20, 10, 35, 0.8);
    border: 1px solid rgba(139, 92, 246, 0.4);
    border-radius: 4px;
    color: #e2d9f3;
    font-size: 0.8rem;
    padding: 3px 6px;
    cursor: pointer;
}

.transcription-select:focus {
    outline: none;
    border-color: #8b5cf6;
}

.transcription-checkbox {
    accent-color: #8b5cf6;
    width: 14px;
    height: 14px;
    cursor: pointer;
}

.transcription-progress-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.transcription-status-text {
    font-size: 0.75rem;
    color: #c4b5fd;
    white-space: nowrap;
    min-width: 140px;
    flex-shrink: 0;
}

.transcription-progress-track {
    flex: 1;
    height: 6px;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.transcription-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #7c3aed 0%, #8b5cf6 100%);
    border-radius: 3px;
    transition: width 0.2s ease;
}

.transcription-progress-pct {
    font-size: 0.75rem;
    color: #a78bfa;
    min-width: 36px;
    text-align: right;
    flex-shrink: 0;
}

.transcription-output {
    width: 100%;
    box-sizing: border-box;
    background: rgba(10, 5, 20, 0.7);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 5px;
    color: #e2d9f3;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.8rem;
    line-height: 1.5;
    padding: 8px 10px;
    resize: vertical;
}

.transcription-output:focus {
    outline: none;
    border-color: #8b5cf6;
}

.transcription-output::placeholder {
    color: rgba(167, 139, 250, 0.4);
}

.transcription-action-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.transcription-action-btn {
    font-size: 0.8rem !important;
    padding: 5px 12px !important;
    border-color: rgba(139, 92, 246, 0.5) !important;
    color: #c4b5fd !important;
}

.transcription-action-btn:hover {
    background: rgba(139, 92, 246, 0.15) !important;
    border-color: #8b5cf6 !important;
    color: #ddd6fe !important;
}

/* ================================================================
   Loop Roll + Beat Jump (F-058)
   ================================================================ */
.loop-roll-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 10px;
    background: rgba(245, 158, 11, 0.05);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 6px;
    margin: 4px 0;
}
.loop-roll-controls-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}
.roll-group, .jump-group {
    display: flex;
    align-items: center;
    gap: 6px;
}
.lr-label {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.45);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    min-width: 28px;
}
.roll-buttons, .jump-buttons {
    display: flex;
    gap: 3px;
    flex-wrap: wrap;
}
.roll-btn, .jump-btn {
    font-size: 0.68rem;
    padding: 3px 6px;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid;
    background: transparent;
    transition: background 0.1s, box-shadow 0.1s;
}
.roll-btn {
    border-color: rgba(245, 158, 11, 0.5);
    color: #fbbf24;
}
.roll-btn:hover { background: rgba(245, 158, 11, 0.15); }
.roll-btn.active {
    background: rgba(245, 158, 11, 0.35);
    border-color: #f59e0b;
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.5);
}
.jump-btn {
    border-color: rgba(100, 210, 230, 0.4);
    color: #67e8f9;
    min-width: 26px;
    text-align: center;
}
.jump-btn:hover { background: rgba(100, 210, 230, 0.12); }
.roll-btn:disabled, .jump-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ================================================================
   VU Metering + Master Limiter (F-019)
   ================================================================ */
.vu-meter-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 0;
}
.vu-meter-canvas {
    flex: 1;
    display: block;
    border-radius: 2px;
    background: rgba(0,0,0,0.5);
}
.vu-clip-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid rgba(239,68,68,0.5);
    background: transparent;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.05s;
}
.vu-clip-indicator.lit {
    background: #ef4444;
    box-shadow: 0 0 6px rgba(239,68,68,0.8);
}
.master-meter-section {
    padding: 8px 10px;
    background: rgba(0,0,0,0.25);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    margin: 4px 0;
    display: none;
}
.master-meter-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 5px;
}
.master-limiter-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.limiter-btn {
    font-size: 0.68rem;
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid rgba(139,92,246,0.5);
    background: transparent;
    color: #a78bfa;
    transition: background 0.1s;
}
.limiter-btn.active {
    background: rgba(139,92,246,0.25);
    border-color: #8b5cf6;
    box-shadow: 0 0 5px rgba(139,92,246,0.4);
}
.limiter-gr-label {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.45);
}

/* =====================================================================
   F-021 Pattern Deck — Electric Violet Theme
   ===================================================================== */

.pattern-deck-section {
    background: rgba(0,0,0,0.35);
    border: 1px solid rgba(153,51,255,0.45);
    border-radius: 8px;
    padding: 12px 14px;
    margin: 8px 0;
}

.pattern-deck-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #b366ff;
    letter-spacing: 0.03em;
}

.pattern-deck-badge {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 1px 6px;
    border-radius: 3px;
    background: rgba(153,51,255,0.25);
    border: 1px solid rgba(153,51,255,0.55);
    color: #b366ff;
    margin-left: 6px;
    vertical-align: middle;
}

.pattern-deck-help-text {
    font-size: 0.68rem;
    font-weight: 400;
    color: rgba(255,255,255,0.4);
    letter-spacing: normal;
}

.pattern-deck-controls {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-bottom: 10px;
}

.pattern-deck-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.pattern-deck-btn {
    font-size: 0.72rem;
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid rgba(153,51,255,0.5);
    background: rgba(153,51,255,0.1);
    color: #b366ff;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.pattern-deck-btn:hover {
    background: rgba(153,51,255,0.25);
    border-color: #9933ff;
}

.pattern-deck-sync-btn {
    font-size: 0.72rem;
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid rgba(153,51,255,0.35);
    background: rgba(153,51,255,0.06);
    color: rgba(179,102,255,0.8);
    cursor: pointer;
    transition: background 0.15s;
}
.pattern-deck-sync-btn:hover {
    background: rgba(153,51,255,0.18);
    border-color: rgba(153,51,255,0.6);
}

.pattern-preset-btn {
    font-size: 0.68rem;
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid rgba(153,51,255,0.35);
    background: rgba(153,51,255,0.07);
    color: rgba(179,102,255,0.85);
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s;
}
.pattern-preset-btn:hover {
    background: rgba(153,51,255,0.22);
    border-color: rgba(153,51,255,0.65);
    color: #b366ff;
}

.preset-label {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.4);
    margin-right: 2px;
}

.pattern-deck-tempo {
    font-family: 'Courier New', monospace;
    font-size: 0.72rem;
    color: rgba(255,255,255,0.45);
    margin-left: 4px;
}

.pattern-deck-vol-slider {
    width: 120px;
}

.pattern-deck-sidechain {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 6px 8px;
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(153,51,255,0.2);
    border-radius: 5px;
    margin-bottom: 10px;
    font-size: 0.72rem;
    color: rgba(255,255,255,0.75);
}

.pattern-deck-sidechain label {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.sidechain-label {
    color: rgba(179,102,255,0.7);
    font-weight: 600;
    margin-right: 2px;
}

.pd-sidechain-params {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.pd-sidechain-params label {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.6);
}

.pattern-deck-editor {
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(153,51,255,0.3);
}

strudel-repl {
    display: block;
    width: 100%;
    min-height: 220px;
    border-radius: 4px;
    overflow: hidden;
}

/* strudel-editor mounts its CodeMirror into a sibling <div> it creates
   via connectedCallback → parentElement.insertBefore(n, nextSibling).
   The custom element itself is empty; hiding it removes the phantom
   min-height gap above the actual editor. */
strudel-editor {
    display: none;
}

#patternDeckEditor > div {
    min-height: 220px;
    border-radius: 4px;
    overflow: hidden;
    width: 100%;
}

.pattern-deck-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60px;
    color: rgba(179,102,255,0.4);
    font-size: 0.75rem;
    font-style: italic;
}

.pattern-deck-error {
    display: none;
    margin-top: 6px;
    padding: 7px 10px;
    background: rgba(255, 55, 55, 0.1);
    border: 1px solid rgba(255, 80, 80, 0.4);
    border-radius: 4px;
    color: #ff8888;
    font-family: 'Courier New', monospace;
    font-size: 0.68rem;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 80px;
    overflow-y: auto;
}

/* ═══════════════════════════════════════════════════════════════
   F-022  Lo-fi Station
   ═══════════════════════════════════════════════════════════════ */

.lofi-station-section {
    background: rgba(0,0,0,0.35);
    border: 1px solid rgba(230,168,50,0.45);
    border-radius: 8px;
    padding: 12px 14px;
    margin: 8px 0;
}

.lofi-station-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #e6a832;
    letter-spacing: 0.03em;
}

.lofi-station-badge {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 1px 6px;
    border-radius: 3px;
    background: rgba(230,168,50,0.2);
    border: 1px solid rgba(230,168,50,0.55);
    color: #e6a832;
    margin-left: 6px;
    vertical-align: middle;
}

.lofi-station-help-text {
    font-size: 0.68rem;
    font-weight: 400;
    color: rgba(255,255,255,0.4);
    letter-spacing: normal;
}

.lofi-station-controls {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.lofi-station-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.lofi-btn {
    font-size: 0.72rem;
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid rgba(230,168,50,0.5);
    background: rgba(230,168,50,0.1);
    color: #e6a832;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.lofi-btn:hover {
    background: rgba(230,168,50,0.25);
    border-color: #e6a832;
}

.lofi-sync-btn {
    font-size: 0.72rem;
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid rgba(230,168,50,0.35);
    background: rgba(230,168,50,0.06);
    color: rgba(230,168,50,0.8);
    cursor: pointer;
    transition: background 0.15s;
}

.lofi-sync-btn:hover {
    background: rgba(230,168,50,0.18);
    border-color: rgba(230,168,50,0.6);
}

.lofi-tempo-display {
    font-family: 'Courier New', monospace;
    font-size: 0.72rem;
    color: rgba(255,255,255,0.45);
    margin-left: 4px;
}

.lofi-slider-label {
    font-size: 0.72rem;
    color: rgba(230,168,50,0.7);
    font-weight: 600;
    white-space: nowrap;
}

.lofi-slider {
    width: 120px;
}

.lofi-value-display {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.5);
    min-width: 30px;
}

.lofi-layers-row {
    padding: 6px 8px;
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(230,168,50,0.2);
    border-radius: 5px;
    gap: 10px;
}

.lofi-layer {
    display: flex;
    align-items: center;
    gap: 4px;
}

.lofi-mute-btn {
    font-size: 0.72rem;
    padding: 3px 6px;
    border-radius: 4px;
    border: 1px solid rgba(230,168,50,0.35);
    background: rgba(230,168,50,0.08);
    cursor: pointer;
    transition: background 0.12s, opacity 0.12s;
    line-height: 1;
}

.lofi-mute-btn:hover {
    background: rgba(230,168,50,0.2);
}

.lofi-mute-btn.muted {
    opacity: 0.35;
    border-color: rgba(255,255,255,0.15);
}

.lofi-layer-slider {
    width: 60px;
}
