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

:root {
    /* Default Theme (Purple) */
    --bg-gradient-start: #667eea;
    --bg-gradient-end: #764ba2;
    --primary-color: #667eea;
    --primary-hover: #764ba2;
    --container-bg: #ffffff;
    --text-color: #333333;
    --text-secondary: #555555;
    --text-tertiary: #666666;
    --border-color: #e2e8f0;
    --surface-bg: #f7fafc;
    --pulse-active: #ff6b6b;
    --pulse-shadow: rgba(255, 107, 107, 0.6);
    --button-active: #667eea;
    --pad-bg: linear-gradient(145deg, #1a1a2e 0%, #16213e 100%);
}

body.theme-light {
    /* Light Theme (Olive/Yellow) */
    --bg-gradient-start: #97B22D;
    --bg-gradient-end: #89751B;
    --primary-color: #97B22D;
    --primary-hover: #89751B;
    --container-bg: #FEFCAD;
    --text-color: #2d3748;
    --text-secondary: #4a5568;
    --text-tertiary: #718096;
    --border-color: #E3DE81;
    --surface-bg: #f1ff72;
    --pulse-active: #89751B;
    --pulse-shadow: rgba(137, 117, 27, 0.6);
    --button-active: #97B22D;
    --pad-bg: linear-gradient(145deg, #3d4d1f 0%, #2a3a12 100%);
}

body.theme-dark {
    /* Dark Theme (Dark Olive) */
    --bg-gradient-start: #2d3d0f;
    --bg-gradient-end: #1a2208;
    --primary-color: #97B22D;
    --primary-hover: #E3DE81;
    --container-bg: #1f2d0a;
    --text-color: #E3DAB2;
    --text-secondary: #E3DE81;
    --text-tertiary: #97B22D;
    --border-color: #3d4d1f;
    --surface-bg: #2a3a12;
    --pulse-active: #E3DE81;
    --pulse-shadow: rgba(227, 222, 129, 0.6);
    --button-active: #97B22D;
    --pad-bg: linear-gradient(145deg, #1a2208 0%, #0f1505 100%);
}

body.theme-warm-light {
    /* Warm Light Theme */
    --bg-gradient-start: #C6BE28;
    --bg-gradient-end: #97B22D;
    --primary-color: #E49A32;
    --primary-hover: #C6BE28;
    --container-bg: #FEFCAD;
    --text-color: #3d3d1f;
    --text-secondary: #5d5d3f;
    --text-tertiary: #7d7d5f;
    --border-color: #E3DAB2;
    --surface-bg: #faedb6;
    --pulse-active: #E49A32;
    --pulse-shadow: rgba(228, 154, 50, 0.6);
    --button-active: #E49A32;
    --pad-bg: linear-gradient(145deg, #4a3f1a 0%, #3a3220 100%);
}

body.theme-warm-dark {
    /* Warm Dark Theme */
    --bg-gradient-start: #2a2510;
    --bg-gradient-end: #1a1808;
    --primary-color: #E49A32;
    --primary-hover: #C6BE28;
    --container-bg: #2d2815;
    --text-color: #FEFCAD;
    --text-secondary: #E3DAB2;
    --text-tertiary: #C6BE28;
    --border-color: #4a3f1a;
    --surface-bg: #3a3220;
    --pulse-active: #E49A32;
    --pulse-shadow: rgba(228, 154, 50, 0.6);
    --button-active: #E49A32;
    --pad-bg: linear-gradient(145deg, #1a1808 0%, #0f0d05 100%);
}

body.theme-red {
    /* Red Theme */
    --bg-gradient-start: #dc2626;
    --bg-gradient-end: #991b1b;
    --primary-color: #ef4444;
    --primary-hover: #dc2626;
    --container-bg: #ffffff;
    --text-color: #1f2937;
    --text-secondary: #374151;
    --text-tertiary: #4b5563;
    --border-color: #fecaca;
    --surface-bg: #fef2f2;
    --pulse-active: #b91c1c;
    --pulse-shadow: rgba(185, 28, 28, 0.6);
    --button-active: #ef4444;
    --pad-bg: linear-gradient(145deg, #450a0a 0%, #7f1d1d 100%);
}

body.theme-pink {
    /* Pink Theme */
    --bg-gradient-start: #ec4899;
    --bg-gradient-end: #be185d;
    --primary-color: #f472b6;
    --primary-hover: #ec4899;
    --container-bg: #ffffff;
    --text-color: #1f2937;
    --text-secondary: #374151;
    --text-tertiary: #4b5563;
    --border-color: #fbcfe8;
    --surface-bg: #fdf2f8;
    --pulse-active: #be185d;
    --pulse-shadow: rgba(190, 24, 93, 0.6);
    --button-active: #f472b6;
    --pad-bg: linear-gradient(145deg, #500724 0%, #831843 100%);
}

body.theme-red-dark {
    /* Dark Red Theme */
    --bg-gradient-start: #7f1d1d;
    --bg-gradient-end: #450a0a;
    --primary-color: #ef4444;
    --primary-hover: #f87171;
    --container-bg: #1a0505;
    --text-color: #fecaca;
    --text-secondary: #fca5a5;
    --text-tertiary: #f87171;
    --border-color: #7f1d1d;
    --surface-bg: #450a0a;
    --pulse-active: #f87171;
    --pulse-shadow: rgba(248, 113, 113, 0.6);
    --button-active: #ef4444;
    --pad-bg: linear-gradient(145deg, #1a0505 0%, #450a0a 100%);
}

body.theme-pink-dark {
    /* Dark Pink Theme */
    --bg-gradient-start: #831843;
    --bg-gradient-end: #500724;
    --primary-color: #f472b6;
    --primary-hover: #f9a8d4;
    --container-bg: #1a050f;
    --text-color: #fce7f3;
    --text-secondary: #fbcfe8;
    --text-tertiary: #f9a8d4;
    --border-color: #831843;
    --surface-bg: #500724;
    --pulse-active: #f9a8d4;
    --pulse-shadow: rgba(249, 168, 212, 0.6);
    --button-active: #f472b6;
    --pad-bg: linear-gradient(145deg, #1a050f 0%, #500724 100%);
}

body.theme-black {
    /* Black Theme */
    --bg-gradient-start: #1f2937;
    --bg-gradient-end: #111827;
    --primary-color: #6b7280;
    --primary-hover: #9ca3af;
    --container-bg: #0f172a;
    --text-color: #f3f4f6;
    --text-secondary: #d1d5db;
    --text-tertiary: #9ca3af;
    --border-color: #374151;
    --surface-bg: #1e293b;
    --pulse-active: #e5e7eb;
    --pulse-shadow: rgba(229, 231, 235, 0.6);
    --button-active: #6b7280;
    --pad-bg: linear-gradient(145deg, #0a0a0a 0%, #1f2937 100%);
}

body.theme-blue {
    /* Blue Theme */
    --bg-gradient-start: #3b82f6;
    --bg-gradient-end: #1e40af;
    --primary-color: #60a5fa;
    --primary-hover: #3b82f6;
    --container-bg: #ffffff;
    --text-color: #1f2937;
    --text-secondary: #374151;
    --text-tertiary: #4b5563;
    --border-color: #bfdbfe;
    --surface-bg: #eff6ff;
    --pulse-active: #1e40af;
    --pulse-shadow: rgba(30, 64, 175, 0.6);
    --button-active: #60a5fa;
    --pad-bg: linear-gradient(145deg, #1e3a5f 0%, #1e40af 100%);
}

body.theme-blue-dark {
    /* Dark Blue Theme (Dark with Bright Blues) */
    --bg-gradient-start: #0c4a6e;
    --bg-gradient-end: #082f49;
    --primary-color: #38bdf8;
    --primary-hover: #0ea5e9;
    --container-bg: #0a1929;
    --text-color: #e0f2fe;
    --text-secondary: #7dd3fc;
    --text-tertiary: #38bdf8;
    --border-color: #0e7490;
    --surface-bg: #164e63;
    --pulse-active: #0ea5e9;
    --pulse-shadow: rgba(14, 165, 233, 0.6);
    --button-active: #38bdf8;
    --pad-bg: linear-gradient(145deg, #082f49 0%, #0c4a6e 100%);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    transition: background 0.3s ease;
}

.container {
    background: var(--container-bg);
    border-radius: 20px;
    padding: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: background 0.3s ease;
}

/* Header Row */
.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.home-btn {
    text-decoration: none;
    font-size: 1.5em;
    padding: 5px;
    transition: transform 0.2s ease, opacity 0.2s ease;
    opacity: 0.8;
}

.home-btn:hover {
    transform: scale(1.1);
    opacity: 1;
}

h1 {
    text-align: center;
    color: var(--text-color);
    font-size: 1.5em;
    flex: 1;
    transition: color 0.3s ease;
}

/* Theme Picker */
.theme-picker {
    position: relative;
    margin-right: 10px;
}

.theme-btn-active {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 3px solid var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.theme-btn-active:hover {
    transform: scale(1.1);
}

.theme-btn-active.theme-default {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.theme-btn-active.theme-light {
    background: linear-gradient(135deg, #97B22D 0%, #E3DE81 100%);
}

.theme-btn-active.theme-dark {
    background: linear-gradient(135deg, #2d3d0f 0%, #97B22D 100%);
}

.theme-btn-active.theme-warm-light {
    background: linear-gradient(135deg, #E49A32 0%, #FEFCAD 100%);
}

.theme-btn-active.theme-warm-dark {
    background: linear-gradient(135deg, #2a2510 0%, #E49A32 100%);
}

.theme-btn-active.theme-red {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
}

.theme-btn-active.theme-pink {
    background: linear-gradient(135deg, #ec4899 0%, #be185d 100%);
}

.theme-btn-active.theme-red-dark {
    background: linear-gradient(135deg, #7f1d1d 0%, #ef4444 100%);
}

.theme-btn-active.theme-pink-dark {
    background: linear-gradient(135deg, #831843 0%, #f472b6 100%);
}

.theme-btn-active.theme-black {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
}

.theme-btn-active.theme-blue {
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
}

.theme-btn-active.theme-blue-dark {
    background: linear-gradient(135deg, #0c4a6e 0%, #38bdf8 100%);
}

.theme-dropdown {
    position: absolute;
    top: 40px;
    left: 0;
    background: var(--container-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 10px;
    display: none;
    grid-template-columns: 32px 32px;
    gap: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

.theme-dropdown.visible {
    display: grid;
}

.theme-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-btn:hover {
    transform: scale(1.1);
    border-color: var(--primary-color);
}

.theme-btn.active {
    border: 3px solid var(--text-color);
    box-shadow: 0 0 0 2px var(--container-bg), 0 0 8px rgba(0, 0, 0, 0.3);
}

.theme-btn.theme-default {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.theme-btn.theme-light {
    background: linear-gradient(135deg, #97B22D 0%, #E3DE81 100%);
}

.theme-btn.theme-dark {
    background: linear-gradient(135deg, #2d3d0f 0%, #97B22D 100%);
}

.theme-btn.theme-warm-light {
    background: linear-gradient(135deg, #E49A32 0%, #FEFCAD 100%);
}

.theme-btn.theme-warm-dark {
    background: linear-gradient(135deg, #2a2510 0%, #E49A32 100%);
}

.theme-btn.theme-red {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
}

.theme-btn.theme-pink {
    background: linear-gradient(135deg, #ec4899 0%, #be185d 100%);
}

.theme-btn.theme-red-dark {
    background: linear-gradient(135deg, #7f1d1d 0%, #ef4444 100%);
}

.theme-btn.theme-pink-dark {
    background: linear-gradient(135deg, #831843 0%, #f472b6 100%);
}

.theme-btn.theme-black {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
}

.theme-btn.theme-blue {
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
}

.theme-btn.theme-blue-dark {
    background: linear-gradient(135deg, #0c4a6e 0%, #38bdf8 100%);
}

/* Info Button */
.info-btn {
    background: none;
    border: none;
    font-size: 1.5em;
    color: var(--primary-color);
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s;
}

.info-btn:hover {
    color: var(--primary-hover);
}

/* Drum Pads Grid */
.drum-pads {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 10px 0;
}

.pads-row {
    display: flex;
    gap: 15px;
}

.drum-pad-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.drum-pad {
    border: none;
    background: var(--pad-bg);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.1s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), inset 0 2px 10px rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.1);
    user-select: none;
    -webkit-user-select: none;
}

.drum-pad-top {
    border-radius: 16px 16px 0 0;
    height: 80px;
}

.drum-pad-bottom {
    border-radius: 0 0 16px 16px;
    border-top: none;
    height: 40px;
}

.drum-pad:hover {
    transform: scale(0.98);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4), inset 0 2px 10px rgba(255, 255, 255, 0.15);
}

.drum-pad:active,
.drum-pad.active {
    transform: scale(0.95);
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.5), inset 0 4px 20px rgba(0, 0, 0, 0.3);
    background: var(--button-active);
    border-color: var(--button-active);
}

.drum-pad.active {
    animation: pad-pulse 0.15s ease-out;
}

@keyframes pad-pulse {
    0% {
        box-shadow: 0 0 0 0 var(--pulse-shadow);
    }

    50% {
        box-shadow: 0 0 20px 10px var(--pulse-shadow);
    }

    100% {
        box-shadow: 0 0 0 0 var(--pulse-shadow);
    }
}

.pad-icon {
    font-size: 2.5em;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.pad-label {
    font-size: 0.9em;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Modifiers Panel */
.modifiers-panel {
    display: flex;
    gap: 8px;
    padding: 10px 0;
    flex-shrink: 0;
}

.modifier-btn {
    flex: 1;
    padding: 12px 8px;
    border: none;
    border-radius: 12px;
    background: var(--surface-bg);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    border: 2px solid var(--border-color);
}

.modifier-btn:hover {
    transform: translateY(-1px);
    border-color: var(--primary-color);
}

.modifier-btn:active {
    transform: scale(0.98);
}

.modifier-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.modifier-btn.active .modifier-label {
    color: white;
}

.modifier-label {
    font-size: 0.8em;
    font-weight: 600;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

/* Accelerometer Indicator */
.accel-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    padding: 8px;
    background: var(--surface-bg);
    border-radius: 8px;
    font-size: 0.8em;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.accel-value {
    font-weight: 600;
    color: var(--primary-color);
}

.accel-value.active {
    color: var(--pulse-active);
}

/* Info Modal */
.info-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.info-modal-content {
    background: var(--container-bg);
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    transition: background 0.3s ease;
    overflow-y: auto;
}

.info-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 20px 15px 20px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    transition: border-color 0.3s ease;
}

.info-modal-header h3 {
    margin: 0;
    color: var(--text-color);
    transition: color 0.3s ease;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: var(--text-tertiary);
    padding: 0;
    line-height: 1;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: var(--text-color);
}

.info-modal-content h4 {
    color: var(--primary-color);
    margin-top: 15px;
    margin-bottom: 8px;
    font-size: 1.1em;
    transition: color 0.3s ease;
}

.info-modal-content h4:first-child {
    margin-top: 5px;
}

.info-modal-content p {
    margin: 8px 0;
    color: var(--text-secondary);
    line-height: 1.5;
    font-size: 0.9em;
    transition: color 0.3s ease;
}

.info-modal-content ul {
    list-style: none;
    padding: 0;
}

.info-modal-content li {
    margin: 10px 0;
    padding-left: 15px;
    position: relative;
    color: var(--text-secondary);
    line-height: 1.5;
    font-size: 0.9em;
    transition: color 0.3s ease;
}

.info-modal-content li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
    transition: color 0.3s ease;
}

/* Responsive Design - Mobile full width/height */
@media (max-width: 480px) {
    body {
        padding: 0;
        align-items: stretch;
    }

    .container {
        max-width: 100%;
        width: 100%;
        min-height: 100vh;
        border-radius: 0;
        padding: 10px;
    }

    h1 {
        font-size: 1.2em;
    }

    .drum-pads {
        gap: 12px;
    }

    .pads-row {
        gap: 12px;
    }

    .drum-pad-top {
        border-radius: 12px 12px 0 0;
        height: 70px;
    }

    .drum-pad-bottom {
        border-radius: 0 0 12px 12px;
        height: 35px;
    }

    .pad-icon {
        font-size: 1.8em;
    }

    .pad-label {
        font-size: 0.7em;
    }

    .modifier-btn {
        padding: 10px 5px;
    }

    .modifier-label {
        font-size: 0.7em;
    }
}

@media (max-width: 400px) {
    .container {
        padding: 8px;
    }

    h1 {
        font-size: 1.1em;
    }

    .drum-pad-top {
        border-radius: 10px 10px 0 0;
        height: 60px;
    }

    .drum-pad-bottom {
        border-radius: 0 0 10px 10px;
        height: 30px;
    }

    .pad-icon {
        font-size: 1.5em;
    }

    .pad-label {
        font-size: 0.65em;
    }

    .modifier-btn {
        padding: 8px 4px;
    }

    .modifier-label {
        font-size: 0.65em;
    }
}

@media (max-height: 600px) {
    .drum-pads {
        gap: 10px;
        padding: 6px 0;
    }

    .pads-row {
        gap: 10px;
    }

    .drum-pad-top {
        height: 60px;
    }

    .drum-pad-bottom {
        height: 30px;
    }

    .pad-icon {
        font-size: 1.8em;
    }

    .pad-label {
        font-size: 0.7em;
    }

    .modifiers-panel {
        gap: 6px;
        padding: 6px 0;
    }

    .modifier-btn {
        padding: 8px 5px;
    }
}

/* Recording Controls */
.recording-controls {
    display: flex;
    gap: 8px;
    padding: 10px 0;
    flex-shrink: 0;
    align-items: center;
}

.record-btn,
.save-btn,
.save-play-btn {
    flex: 1;
    padding: 12px 8px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    font-family: inherit;
}

.record-btn {
    background: var(--surface-bg);
    border: 2px solid var(--border-color);
}

.record-btn:hover {
    border-color: #dc2626;
}

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

.record-btn.recording .record-icon,
.record-btn.recording .record-label {
    color: white;
}

@keyframes recording-pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4);
    }

    50% {
        box-shadow: 0 0 0 10px rgba(220, 38, 38, 0);
    }
}

.record-icon,
.save-icon,
.save-play-icon {
    font-size: 1.2em;
}

.record-label,
.save-label,
.save-play-label {
    font-size: 0.8em;
    font-weight: 600;
    color: var(--text-secondary);
}

.save-btn {
    background: #22c55e;
    border: 2px solid #22c55e;
}

.save-btn .save-icon,
.save-btn .save-label {
    color: white;
}

.save-btn:hover {
    background: #16a34a;
    border-color: #16a34a;
}

.save-play-btn {
    background: #3b82f6;
    border: 2px solid #3b82f6;
}

.save-play-btn .save-play-icon,
.save-play-btn .save-play-label {
    color: white;
}

.save-play-btn:hover {
    background: #2563eb;
    border-color: #2563eb;
}

/* Menu */
.menu-container,
.settings-menu-container {
    position: relative;
}

.menu-btn,
.settings-menu-btn {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 12px;
    background: var(--surface-bg);
    border: 2px solid var(--border-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.menu-btn:hover,
.settings-menu-btn:hover {
    border-color: var(--primary-color);
}

.settings-menu-btn.reset-mode-active {
    background: #f59e0b;
    border-color: #f59e0b;
    animation: reset-mode-indicator-pulse 1.5s infinite;
}

.settings-menu-btn.reset-mode-active .settings-icon {
    color: white;
}

@keyframes reset-mode-indicator-pulse {

    0%,
    100% {
        box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3);
    }

    50% {
        box-shadow: 0 4px 12px rgba(245, 158, 11, 0.6);
    }
}

.menu-icon,
.settings-icon {
    font-size: 1.2em;
    color: var(--text-secondary);
}

.menu-dropdown,
.settings-menu-dropdown {
    position: absolute;
    top: 50px;
    right: 0;
    background: var(--container-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 12px;
    display: none;
    min-width: 200px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

.menu-dropdown.visible,
.settings-menu-dropdown.visible {
    display: block;
}

.menu-item,
.settings-menu-item {
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    text-align: left;
    font-size: 0.9em;
    font-weight: 500;
    color: var(--text-color);
    font-family: inherit;
    transition: background 0.2s ease;
}

.menu-item:hover,
.settings-menu-item:hover {
    background: var(--surface-bg);
}

.settings-menu-item.active {
    background: #f59e0b;
    color: white;
    font-weight: 600;
}

.settings-menu-label {
    font-size: 0.8em;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.settings-menu-slider {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 0;
    font-size: 0.9em;
    color: var(--text-color);
    position: relative;
}

.settings-menu-slider.has-value::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #f59e0b;
}

.settings-menu-slider .slider-label {
    font-weight: 600;
    font-size: 0.85em;
}

.settings-menu-slider .slider-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-menu-slider .slider-value {
    min-width: 30px;
    text-align: center;
    font-weight: 600;
    font-size: 0.85em;
}

.settings-menu-slider .effect-slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    background: var(--border-color);
}

.settings-menu-slider .effect-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
}

.settings-menu-slider .effect-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
}

.settings-menu-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    cursor: pointer;
    font-size: 0.9em;
    color: var(--text-color);
}

.settings-menu-checkbox input {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.settings-menu-pitch {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 0;
    font-size: 0.9em;
    color: var(--text-color);
    position: relative;
}

.settings-menu-pitch.has-value::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #f59e0b;
}

.settings-menu-pitch .pitch-label {
    font-weight: 600;
}

.settings-menu-pitch .pitch-slider-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-menu-pitch .pitch-value {
    min-width: 40px;
    text-align: center;
    font-weight: 600;
    font-size: 0.85em;
}

.settings-menu-divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 0;
}

.menu-item:hover {
    background: var(--surface-bg);
}

.menu-item:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Beat List */
.beat-list {
    display: none;
    flex-direction: column;
    background: var(--surface-bg);
    border-radius: 12px;
    padding: 10px;
    flex-shrink: 0;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
}

.beat-list.has-beats {
    display: flex;
}

.beat-list-header {
    font-size: 0.85em;
    font-weight: 600;
    color: var(--text-secondary);
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 8px;
}

.beat-list-items {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.beat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: var(--container-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.beat-name {
    flex: 1;
    font-size: 0.85em;
    font-weight: 500;
    color: var(--text-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.beat-duration,
.sample-duration {
    font-size: 0.75em;
    color: var(--text-tertiary);
    margin-left: auto;
}

.beat-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 1em;
}

.beat-repeat-btn {
    background: var(--primary-color);
    color: white;
}

.beat-repeat-btn.off {
    background: var(--surface-bg);
    color: var(--text-tertiary);
    border: 1px solid var(--border-color);
}

.beat-repeat-btn:hover {
    opacity: 0.8;
}

.beat-play-btn {
    background: #22c55e;
    color: white;
}

.beat-play-btn.playing {
    background: #f59e0b;
}

.beat-play-btn:hover {
    opacity: 0.8;
}

.beat-delete-btn {
    background: var(--surface-bg);
    color: var(--text-tertiary);
    border: 1px solid var(--border-color);
}

.beat-delete-btn:hover {
    background: #dc2626;
    color: white;
    border-color: #dc2626;
}

/* Sample Recording Button - moved to recording controls */
.sample-btn {
    flex: 1;
    padding: 12px 8px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    font-family: inherit;
    background: var(--surface-bg);
    border: 2px solid var(--border-color);
}

.sample-btn:hover {
    border-color: #a855f7;
}

.sample-icon {
    font-size: 1.2em;
}

.sample-label {
    font-size: 0.8em;
    font-weight: 600;
    color: var(--text-secondary);
}

.sample-btn.recording {
    background: #a855f7;
    border-color: #a855f7;
    animation: sample-recording-pulse 1s infinite;
}

.sample-btn.recording .sample-icon,
.sample-btn.recording .sample-label {
    color: white;
}

/* Save Sample Button */
.save-sample-btn {
    flex: 1;
    padding: 12px 8px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    font-family: inherit;
    background: #22c55e;
    border: 2px solid #22c55e;
}

.save-sample-btn .save-sample-icon,
.save-sample-btn .save-sample-label {
    color: white;
}

.save-sample-btn:hover {
    background: #16a34a;
    border-color: #16a34a;
}

.save-sample-icon {
    font-size: 1.2em;
}

.save-sample-label {
    font-size: 0.8em;
    font-weight: 600;
}

@keyframes sample-recording-pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(168, 85, 247, 0.4);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(168, 85, 247, 0);
    }
}

/* Sample Save Mode - Pads become save buttons */
body.sample-save-mode .drum-pad {
    background: linear-gradient(145deg, #16a34a 0%, #22c55e 100%);
    border-color: #22c55e;
    animation: save-mode-pulse 1.5s infinite;
}

body.sample-save-mode .drum-pad:hover {
    background: linear-gradient(145deg, #15803d 0%, #16a34a 100%);
}

body.sample-save-mode .drum-pad:active,
body.sample-save-mode .drum-pad.active {
    background: linear-gradient(145deg, #166534 0%, #15803d 100%);
}

body.sample-save-mode .drum-pad .pad-icon::after {
    content: '💾';
    position: absolute;
    font-size: 0.6em;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

body.sample-save-mode .drum-pad .pad-icon {
    position: relative;
    opacity: 0.3;
}

body.sample-save-mode .pad-label::before {
    content: 'Save ';
}

@keyframes save-mode-pulse {

    0%,
    100% {
        box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3), inset 0 2px 10px rgba(255, 255, 255, 0.1);
    }

    50% {
        box-shadow: 0 4px 20px rgba(34, 197, 94, 0.6), inset 0 2px 10px rgba(255, 255, 255, 0.1);
    }
}

/* Has custom sample indicator */
.drum-pad.has-sample {
    position: relative;
}

.drum-pad.has-sample::after {
    content: '🎤';
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 0.7em;
    opacity: 0.8;
}

/* Sample List */
.sample-list {
    display: none;
    flex-direction: column;
    background: var(--surface-bg);
    border-radius: 12px;
    padding: 10px;
    flex-shrink: 0;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
    margin-top: 10px;
}

.sample-list.has-samples {
    display: flex;
}

.sample-list-header {
    font-size: 0.85em;
    font-weight: 600;
    color: var(--text-secondary);
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 8px;
}

.sample-list-items {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sample-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: var(--container-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.sample-name {
    flex: 1;
    font-size: 0.85em;
    font-weight: 500;
    color: var(--text-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sample-btn-small {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 1em;
}

.sample-play-btn {
    background: #22c55e;
    color: white;
}

.sample-play-btn:hover {
    opacity: 0.8;
}

.sample-apply-btn {
    background: var(--primary-color);
    color: white;
}

.sample-apply-btn:hover {
    opacity: 0.8;
}

.sample-rename-btn {
    background: var(--surface-bg);
    color: var(--text-tertiary);
    border: 1px solid var(--border-color);
}

.sample-rename-btn:hover {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.sample-delete-btn {
    background: var(--surface-bg);
    color: var(--text-tertiary);
    border: 1px solid var(--border-color);
}

.sample-delete-btn:hover {
    background: #dc2626;
    color: white;
    border-color: #dc2626;
}

/* Default Samples List */
.default-sample-list {
    display: flex;
    flex-direction: column;
    background: var(--surface-bg);
    border-radius: 12px;
    padding: 10px;
    flex-shrink: 0;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
    margin-top: 10px;
}

.default-sample-list-header {
    font-size: 0.85em;
    font-weight: 600;
    color: var(--text-secondary);
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 8px;
}

.default-sample-list-items {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.default-sample-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: var(--container-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.default-sample-name {
    flex: 1;
    font-size: 0.85em;
    font-weight: 500;
    color: var(--text-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Default Sound Mode */
.default-sound-btn.active {
    background: #f59e0b;
    border-color: #f59e0b;
}

.default-sound-btn.active .modifier-label {
    color: white;
}

body.default-sound-mode .drum-pad.has-sample {
    background: linear-gradient(145deg, #f59e0b 0%, #d97706 100%);
    border-color: #f59e0b;
    animation: default-mode-pulse 1.5s infinite;
}

body.default-sound-mode .drum-pad.has-sample:hover {
    background: linear-gradient(145deg, #d97706 0%, #b45309 100%);
}

body.default-sound-mode .drum-pad.has-sample:active,
body.default-sound-mode .drum-pad.has-sample.active {
    background: linear-gradient(145deg, #b45309 0%, #92400e 100%);
}

body.default-sound-mode .drum-pad.has-sample .pad-label::before {
    content: 'Reset ';
}

@keyframes default-mode-pulse {

    0%,
    100% {
        box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3), inset 0 2px 10px rgba(255, 255, 255, 0.1);
    }

    50% {
        box-shadow: 0 4px 20px rgba(245, 158, 11, 0.6), inset 0 2px 10px rgba(255, 255, 255, 0.1);
    }
}

/* Sample Apply Mode */
body.sample-apply-mode .drum-pad {
    background: linear-gradient(145deg, #3b82f6 0%, #2563eb 100%);
    border-color: #3b82f6;
    animation: apply-mode-pulse 1.5s infinite;
}

body.sample-apply-mode .drum-pad:hover {
    background: linear-gradient(145deg, #2563eb 0%, #1d4ed8 100%);
}

body.sample-apply-mode .drum-pad:active,
body.sample-apply-mode .drum-pad.active {
    background: linear-gradient(145deg, #1d4ed8 0%, #1e40af 100%);
}

body.sample-apply-mode .pad-label::before {
    content: 'Apply ';
}

@keyframes apply-mode-pulse {

    0%,
    100% {
        box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3), inset 0 2px 10px rgba(255, 255, 255, 0.1);
    }

    50% {
        box-shadow: 0 4px 20px rgba(59, 130, 246, 0.6), inset 0 2px 10px rgba(255, 255, 255, 0.1);
    }
}

/* Default Sound Apply Mode */
body.default-sound-apply-mode .drum-pad {
    background: linear-gradient(145deg, #10b981 0%, #059669 100%);
    border-color: #10b981;
    animation: default-apply-mode-pulse 1.5s infinite;
}

body.default-sound-apply-mode .drum-pad:hover {
    background: linear-gradient(145deg, #059669 0%, #047857 100%);
}

body.default-sound-apply-mode .drum-pad:active,
body.default-sound-apply-mode .drum-pad.active {
    background: linear-gradient(145deg, #047857 0%, #065f46 100%);
}

body.default-sound-apply-mode .pad-label::before {
    content: 'Assign ';
}

@keyframes default-apply-mode-pulse {

    0%,
    100% {
        box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3), inset 0 2px 10px rgba(255, 255, 255, 0.1);
    }

    50% {
        box-shadow: 0 4px 20px rgba(16, 185, 129, 0.6), inset 0 2px 10px rgba(255, 255, 255, 0.1);
    }
}

/* Beat Apply Mode */
body.beat-apply-mode .drum-pad {
    background: linear-gradient(145deg, #f59e0b 0%, #d97706 100%);
    border-color: #f59e0b;
    animation: beat-apply-mode-pulse 1.5s infinite;
}

body.beat-apply-mode .drum-pad:hover {
    background: linear-gradient(145deg, #d97706 0%, #b45309 100%);
}

body.beat-apply-mode .drum-pad:active,
body.beat-apply-mode .drum-pad.active {
    background: linear-gradient(145deg, #b45309 0%, #92400e 100%);
}

body.beat-apply-mode .pad-label::before {
    content: 'Pin ';
}

@keyframes beat-apply-mode-pulse {

    0%,
    100% {
        box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3), inset 0 2px 10px rgba(255, 255, 255, 0.1);
    }

    50% {
        box-shadow: 0 4px 20px rgba(245, 158, 11, 0.6), inset 0 2px 10px rgba(255, 255, 255, 0.1);
    }
}

/* Pitch Display */
/* Main Pitch Control */
.main-pitch-control {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    max-width: 300px;
}

.pitch-label {
    font-size: 0.9em;
    font-weight: 600;
    color: var(--text-color);
    white-space: nowrap;
}

.main-pitch-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    border-radius: 4px;
    background: var(--border-color);
    outline: none;
    cursor: pointer;
}

.main-pitch-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.main-pitch-slider::-webkit-slider-thumb:hover {
    background: var(--primary-hover);
    transform: scale(1.15);
}

.main-pitch-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.main-pitch-slider::-moz-range-thumb:hover {
    background: var(--primary-hover);
    transform: scale(1.15);
}

.pitch-display {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    font-size: 0.9em;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--surface-bg);
    border-radius: 8px;
    min-width: 50px;
    border: 1px solid var(--border-color);
}

.pitch-display.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Settings Container for Beats and Samples */
.beat-settings-container,
.sample-settings-container {
    position: relative;
    display: inline-block;
}

.beat-settings-btn,
.sample-settings-btn {
    background: var(--surface-bg);
    color: var(--text-tertiary);
    border: 1px solid var(--border-color);
}

.beat-settings-btn:hover,
.sample-settings-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Settings Dropdown */
.beat-settings-dropdown,
.sample-settings-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--container-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 12px;
    display: none;
    min-width: 180px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    margin-top: 5px;
}

.beat-settings-dropdown.visible,
.sample-settings-dropdown.visible {
    display: block;
}

.beat-settings-item,
.sample-settings-item {
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    text-align: left;
    font-size: 0.9em;
    font-weight: 500;
    color: var(--text-color);
    font-family: inherit;
    transition: background 0.2s ease;
}

.beat-settings-item:hover,
.sample-settings-item:hover {
    background: var(--surface-bg);
}

.beat-settings-divider,
.sample-settings-divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 0;
}

.beat-settings-label,
.sample-settings-label {
    font-size: 0.8em;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.beat-settings-slider,
.sample-settings-slider {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 0.9em;
    color: var(--text-color);
    flex-direction: column;
    align-items: stretch;
}

.beat-settings-slider .slider-container,
.sample-settings-slider .slider-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.beat-settings-slider .slider-value,
.sample-settings-slider .slider-value {
    min-width: 30px;
    text-align: center;
    font-weight: 600;
    font-size: 0.85em;
}

.beat-settings-slider .effect-slider,
.sample-settings-slider .effect-slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    background: var(--border-color);
}

.beat-settings-slider .effect-slider::-webkit-slider-thumb,
.sample-settings-slider .effect-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
}

.beat-settings-slider .effect-slider::-moz-range-thumb,
.sample-settings-slider .effect-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
}

.beat-settings-checkbox,
.sample-settings-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    cursor: pointer;
    font-size: 0.9em;
    color: var(--text-color);
}

.beat-settings-checkbox input,
.sample-settings-checkbox input {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.beat-settings-pitch,
.sample-settings-pitch {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    font-size: 0.9em;
    color: var(--text-color);
    flex-direction: column;
    align-items: stretch;
}

.pitch-slider-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pitch-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: var(--border-color);
    outline: none;
    cursor: pointer;
}

.pitch-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.pitch-slider::-webkit-slider-thumb:hover {
    background: var(--primary-hover);
    transform: scale(1.1);
}

.pitch-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.pitch-slider::-moz-range-thumb:hover {
    background: var(--primary-hover);
    transform: scale(1.1);
}

.pitch-value {
    min-width: 40px;
    text-align: center;
    font-weight: 600;
    font-size: 0.85em;
}