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

:root {
    --bg-dark: #1a1a1f;
    --bg-panel: #252530;
    --bg-cell: #2d2d3a;
    --bg-cell-hover: #3a3a4a;
    --bg-sidebar: #1e1e26;
    --accent-kick: #ff4757;
    --accent-snare: #ffa502;
    --accent-hihat: #2ed573;
    --accent-clap: #1e90ff;
    --accent-tom: #ff6b81;
    --accent-perc: #a55eea;
    --accent-synth: #00d2d3;
    --accent-bass: #ff9ff3;
    --accent-primary: #00d2d3;
    --text-primary: #ffffff;
    --text-secondary: #888899;
    --border-color: #3d3d4d;
    --glow-intensity: 0.6;
    --chat-bg: #1a1a22;
}

/* Themes */
body.theme-neon {
    --bg-dark: #0a0a12;
    --bg-panel: #12121f;
    --bg-cell: #1a1a2e;
    --bg-sidebar: #08080f;
    --accent-kick: #ff00ff;
    --accent-snare: #00ffff;
    --accent-hihat: #00ff00;
    --accent-clap: #ffff00;
    --accent-primary: #00ffcc;
    --glow-intensity: 0.9;
}

body.theme-sunset {
    --bg-dark: #1a1215;
    --bg-panel: #2d1f22;
    --bg-cell: #3d2a2e;
    --bg-sidebar: #150f11;
    --accent-kick: #ff6b35;
    --accent-snare: #f7c59f;
    --accent-hihat: #efa00b;
    --accent-clap: #d65108;
    --accent-primary: #ff6b35;
}

body.theme-ocean {
    --bg-dark: #0a1628;
    --bg-panel: #132744;
    --bg-cell: #1a3a5c;
    --bg-sidebar: #071120;
    --accent-kick: #48cae4;
    --accent-snare: #90e0ef;
    --accent-hihat: #00b4d8;
    --accent-clap: #0077b6;
    --accent-primary: #48cae4;
}

body.theme-purple {
    --bg-dark: #1a1025;
    --bg-panel: #2d1f44;
    --bg-cell: #3d2a5c;
    --bg-sidebar: #120a1a;
    --accent-kick: #bf5af2;
    --accent-snare: #da8ee7;
    --accent-hihat: #ff6b9d;
    --accent-clap: #c77dff;
    --accent-primary: #bf5af2;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    min-height: 100vh;
    overflow: hidden;
    transition: background 0.3s ease;
}

/* App Layout */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Sidebar */
.sidebar {
    width: 200px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
}

.sidebar-header {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h2 {
    font-size: 0.8rem;
    color: var(--text-secondary);
    letter-spacing: 2px;
}

.sidebar-header i {
    margin-right: 8px;
    color: var(--accent-primary);
}

.create-room-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: var(--accent-primary);
    color: white;
    cursor: pointer;
    transition: all 0.15s ease;
}

.create-room-btn:hover {
    transform: scale(1.1);
}

.rooms-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.room-item {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    background: var(--bg-cell);
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.room-item:hover {
    background: var(--bg-cell-hover);
}

.room-item.active {
    background: var(--accent-primary);
    color: white;
}

.room-item .room-name {
    font-size: 0.85rem;
    font-weight: 500;
}

.room-item .room-users {
    font-size: 0.7rem;
    opacity: 0.7;
}

.current-room {
    padding: 15px;
    border-top: 1px solid var(--border-color);
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.current-room strong {
    color: var(--accent-primary);
}

/* Main Content */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.sequencer-container {
    background: linear-gradient(145deg, var(--bg-panel), var(--bg-dark));
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    max-width: 1200px;
    margin: 0 auto;
}

/* Header */
.sequencer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 15px;
}

.logo-text {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 2px;
}

.pro-badge {
    font-size: 0.55rem;
    background: linear-gradient(135deg, var(--accent-synth), var(--accent-kick));
    padding: 2px 6px;
    border-radius: 4px;
    vertical-align: middle;
}

.logo-subtitle {
    font-size: 0.6rem;
    color: var(--text-secondary);
    letter-spacing: 3px;
    display: block;
    margin-top: 2px;
}

.transport-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.transport-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(145deg, #35354a, #25253a);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    color: var(--text-primary);
    font-size: 1rem;
}

.transport-btn:hover {
    transform: scale(1.08);
}

.transport-btn.active {
    background: linear-gradient(145deg, var(--accent-kick), #cc3a47);
    box-shadow: 0 0 20px rgba(255, 71, 87, 0.5);
}

.transport-btn.record {
    color: var(--accent-kick);
}

.transport-btn.record.active {
    animation: recordPulse 1s ease infinite;
}

@keyframes recordPulse {
    0%, 100% { box-shadow: 0 0 5px var(--accent-kick); }
    50% { box-shadow: 0 0 20px var(--accent-kick); }
}

.bpm-control, .swing-control {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.bpm-control label, .swing-control label {
    font-size: 0.55rem;
    color: var(--text-secondary);
    letter-spacing: 2px;
}

.bpm-input-group {
    display: flex;
    align-items: center;
    gap: 2px;
}

.bpm-btn {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 4px;
    background: var(--bg-cell);
    color: var(--text-primary);
    cursor: pointer;
    font-weight: bold;
}

.bpm-btn:hover {
    background: var(--bg-cell-hover);
}

.bpm-control input[type="number"] {
    width: 50px;
    padding: 5px;
    border: none;
    border-radius: 4px;
    background: var(--bg-cell);
    color: var(--text-primary);
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
}

.swing-control input[type="range"] {
    width: 50px;
}

.swing-value {
    font-size: 0.65rem;
    color: var(--accent-primary);
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-led {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.led {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #333;
    transition: all 0.2s ease;
}

.led.active {
    background: var(--accent-hihat);
    box-shadow: 0 0 10px var(--accent-hihat);
}

.status-led span {
    font-size: 0.5rem;
    color: var(--text-secondary);
}

.users-online {
    display: flex;
    gap: -8px;
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--bg-panel);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: bold;
    color: white;
    margin-left: -8px;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.user-avatar:first-child {
    margin-left: 0;
}

.user-avatar:hover {
    transform: scale(1.15);
    z-index: 10;
}

/* Control Bar */
.control-bar {
    display: flex;
    gap: 20px;
    padding: 12px 15px;
    background: rgba(0,0,0,0.2);
    border-radius: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.kit-selector, .mode-selector, .scale-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-bar label {
    font-size: 0.6rem;
    color: var(--text-secondary);
    letter-spacing: 2px;
}

.kit-buttons, .mode-buttons {
    display: flex;
    gap: 5px;
}

.kit-btn, .mode-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 5px;
    background: var(--bg-cell);
    color: var(--text-secondary);
    font-size: 0.65rem;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.kit-btn:hover, .mode-btn:hover {
    background: var(--bg-cell-hover);
    color: var(--text-primary);
}

.kit-btn.active, .mode-btn.active {
    background: var(--accent-primary);
    color: white;
}

.scale-selector select {
    padding: 5px 8px;
    border: none;
    border-radius: 4px;
    background: var(--bg-cell);
    color: var(--text-primary);
    font-size: 0.75rem;
}

/* Visualizer */
.visualizer-container {
    display: flex;
    gap: 15px;
    margin-bottom: 12px;
    height: 50px;
}

.visualizer {
    flex: 1;
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
}

.vu-meters {
    display: flex;
    gap: 4px;
}

.vu-meter {
    width: 20px;
    height: 50px;
    background: var(--bg-cell);
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    overflow: hidden;
    position: relative;
}

.vu-meter .vu-fill {
    width: 100%;
    height: 0%;
    background: linear-gradient(to top, var(--accent-hihat), var(--accent-kick));
    transition: height 0.05s ease;
    position: absolute;
    bottom: 0;
}

.vu-meter span {
    font-size: 0.5rem;
    color: var(--text-secondary);
    position: relative;
    z-index: 1;
    padding: 2px;
}

/* Grid */
.grid-wrapper {
    margin-bottom: 12px;
}

.grid-container {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: 1fr auto;
    gap: 6px;
}

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

.track-control {
    height: 32px;
    display: flex;
    align-items: center;
    gap: 5px;
    padding-right: 6px;
}

.track-name {
    font-size: 0.55rem;
    color: var(--text-secondary);
    letter-spacing: 1px;
    min-width: 42px;
    text-align: right;
}

.track-indicator {
    width: 3px;
    height: 20px;
    border-radius: 2px;
}

.track-indicator.kick { background: var(--accent-kick); }
.track-indicator.snare { background: var(--accent-snare); }
.track-indicator.hihat { background: var(--accent-hihat); }
.track-indicator.clap { background: var(--accent-clap); }
.track-indicator.tom { background: var(--accent-tom); }
.track-indicator.perc { background: var(--accent-perc); }
.track-indicator.synth { background: var(--accent-synth); }
.track-indicator.bass { background: var(--accent-bass); }

.track-volume {
    width: 40px;
    height: 3px;
    -webkit-appearance: none;
    background: var(--bg-cell);
    border-radius: 2px;
}

.track-volume::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 10px;
    height: 10px;
    background: var(--text-primary);
    border-radius: 50%;
}

.solo-btn, .mute-btn {
    width: 18px;
    height: 18px;
    border: none;
    border-radius: 3px;
    background: var(--bg-cell);
    color: var(--text-secondary);
    font-size: 0.5rem;
    font-weight: 700;
    cursor: pointer;
}

.solo-btn.active {
    background: var(--accent-synth);
    color: white;
}

.mute-btn.muted {
    background: var(--accent-kick);
    color: white;
}

/* Step Grid */
.step-grid {
    display: grid;
    grid-template-columns: repeat(16, 1fr);
    grid-template-rows: repeat(8, 1fr);
    gap: 3px;
}

.step-cell {
    aspect-ratio: 1;
    min-height: 28px;
    background: linear-gradient(145deg, var(--bg-cell), #232330);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.08s ease;
    border: 1px solid transparent;
    position: relative;
}

.step-cell:hover {
    background: var(--bg-cell-hover);
    transform: scale(1.08);
}

.step-cell.beat-start {
    border-left: 2px solid rgba(255,255,255,0.1);
}

.step-cell.active[data-track="0"] { background: var(--accent-kick); box-shadow: 0 0 12px var(--accent-kick); }
.step-cell.active[data-track="1"] { background: var(--accent-snare); box-shadow: 0 0 12px var(--accent-snare); }
.step-cell.active[data-track="2"] { background: var(--accent-hihat); box-shadow: 0 0 12px var(--accent-hihat); }
.step-cell.active[data-track="3"] { background: var(--accent-clap); box-shadow: 0 0 12px var(--accent-clap); }
.step-cell.active[data-track="4"] { background: var(--accent-tom); box-shadow: 0 0 12px var(--accent-tom); }
.step-cell.active[data-track="5"] { background: var(--accent-perc); box-shadow: 0 0 12px var(--accent-perc); }
.step-cell.active[data-track="6"] { background: var(--accent-synth); box-shadow: 0 0 12px var(--accent-synth); }
.step-cell.active[data-track="7"] { background: var(--accent-bass); box-shadow: 0 0 12px var(--accent-bass); }

.step-cell.current {
    border: 2px solid rgba(255,255,255,0.7);
    box-shadow: 0 0 8px rgba(255,255,255,0.4);
}

.step-cell.playing {
    animation: cellPulse 0.1s ease;
}

@keyframes cellPulse {
    50% { transform: scale(1.15); }
}

.step-numbers {
    grid-column: 2;
    display: grid;
    grid-template-columns: repeat(16, 1fr);
    gap: 3px;
    padding-top: 4px;
}

.step-numbers span {
    text-align: center;
    font-size: 0.55rem;
    color: var(--text-secondary);
}

.step-numbers span.beat {
    color: var(--text-primary);
    font-weight: 700;
}

/* Piano Roll */
.piano-roll-wrapper {
    margin-bottom: 12px;
}

.piano-roll-container {
    display: flex;
    background: var(--bg-cell);
    border-radius: 8px;
    overflow: hidden;
    height: 300px;
}

.piano-keys {
    width: 50px;
    display: flex;
    flex-direction: column;
}

.piano-key {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 5px;
    font-size: 0.6rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.1s ease;
}

.piano-key.white {
    background: linear-gradient(90deg, #e8e8e8, #ffffff);
    color: #333;
}

.piano-key.black {
    background: linear-gradient(90deg, #333, #444);
    color: #fff;
}

.piano-key:hover {
    filter: brightness(0.9);
}

.piano-key.playing {
    background: var(--accent-primary) !important;
    color: white !important;
}

.piano-roll-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(16, 1fr);
    overflow-x: auto;
}

.piano-row {
    display: contents;
}

.piano-cell {
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.1s ease;
}

.piano-cell:hover {
    background: var(--bg-cell-hover);
}

.piano-cell.active {
    background: var(--accent-primary);
    box-shadow: inset 0 0 10px rgba(255,255,255,0.3);
}

.piano-cell.beat-start {
    border-left: 2px solid rgba(255,255,255,0.2);
}

.melody-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    background: rgba(0,0,0,0.2);
    border-radius: 0 0 8px 8px;
}

.melody-controls label {
    font-size: 0.6rem;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

.octave-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 4px;
    background: var(--bg-cell);
    color: var(--text-primary);
    cursor: pointer;
}

.melody-controls select {
    padding: 6px 10px;
    border: none;
    border-radius: 4px;
    background: var(--bg-cell);
    color: var(--text-primary);
}

#currentOctave {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--accent-primary);
    width: 20px;
    text-align: center;
}

/* Effects */
.effects-section {
    padding: 12px 15px;
    background: rgba(0,0,0,0.2);
    border-radius: 10px;
    margin-bottom: 12px;
}

.effect-group h4 {
    font-size: 0.65rem;
    color: var(--text-secondary);
    letter-spacing: 2px;
    margin-bottom: 10px;
}

.effect-group h4 i {
    margin-right: 8px;
    color: var(--accent-primary);
}

.effects-row {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
    justify-content: center;
}

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

.effect-control label {
    font-size: 0.55rem;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

.effect-control input[type="range"] {
    width: 70px;
    height: 4px;
    -webkit-appearance: none;
    background: var(--bg-cell);
    border-radius: 2px;
}

.effect-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: var(--accent-primary);
    border-radius: 50%;
}

.effect-value {
    font-size: 0.6rem;
    color: var(--accent-primary);
}

/* Footer */
.sequencer-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 12px;
}

.footer-left, .footer-center, .footer-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
}

.volume-control input[type="range"] {
    width: 70px;
}

.pattern-select {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pattern-select label {
    font-size: 0.55rem;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

.pattern-buttons {
    display: flex;
    gap: 3px;
}

.pattern-btn {
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 4px;
    background: var(--bg-cell);
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
}

.pattern-btn.active {
    background: var(--accent-primary);
    color: white;
}

.small-btn {
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 4px;
    background: var(--bg-cell);
    color: var(--text-secondary);
    cursor: pointer;
}

.small-btn:hover {
    background: var(--bg-cell-hover);
    color: var(--text-primary);
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    background: var(--bg-cell);
    color: var(--text-secondary);
    font-size: 0.6rem;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.action-btn:hover {
    background: var(--bg-cell-hover);
    color: var(--text-primary);
}

.action-btn.highlight {
    background: var(--accent-primary);
    color: white;
}

.action-btn.highlight:hover {
    filter: brightness(1.1);
}

.action-btn.danger:hover {
    background: var(--accent-kick);
    color: white;
}

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

.theme-selector label {
    font-size: 0.55rem;
    color: var(--text-secondary);
}

.theme-selector select {
    padding: 5px 8px;
    border: none;
    border-radius: 4px;
    background: var(--bg-cell);
    color: var(--text-primary);
    font-size: 0.7rem;
}

.icon-btn {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 6px;
    background: var(--bg-cell);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.icon-btn:hover {
    background: var(--bg-cell-hover);
    color: var(--text-primary);
}

/* Chat Panel */
.chat-panel {
    width: 280px;
    background: var(--chat-bg);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
}

.chat-panel.collapsed {
    width: 0;
    overflow: hidden;
}

.chat-header {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h3 {
    font-size: 0.8rem;
    color: var(--text-secondary);
    letter-spacing: 2px;
}

.chat-header i {
    margin-right: 8px;
    color: var(--accent-primary);
}

.toggle-chat {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.chat-message {
    margin-bottom: 12px;
    animation: messageIn 0.2s ease;
}

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

.chat-message .message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.chat-message .message-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: bold;
    color: white;
}

.chat-message .message-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
}

.chat-message .message-time {
    font-size: 0.6rem;
    color: var(--text-secondary);
    margin-left: auto;
}

.chat-message .message-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding-left: 32px;
    word-wrap: break-word;
}

.chat-message.system {
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-style: italic;
}

.chat-input-container {
    padding: 12px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 8px;
}

.chat-input-container input {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 6px;
    background: var(--bg-cell);
    color: var(--text-primary);
    font-size: 0.8rem;
}

.chat-input-container button {
    width: 40px;
    border: none;
    border-radius: 6px;
    background: var(--accent-primary);
    color: white;
    cursor: pointer;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-panel);
    padding: 25px;
    border-radius: 12px;
    min-width: 320px;
    max-width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-content h3 {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 1rem;
    letter-spacing: 1px;
}

.modal-content h3 i {
    margin-right: 10px;
    color: var(--accent-primary);
}

.modal-content p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 15px;
}

.modal-content input[type="text"] {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 6px;
    background: var(--bg-cell);
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.saved-patterns {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.pattern-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--bg-cell);
    border-radius: 6px;
    margin-bottom: 8px;
    cursor: pointer;
}

.pattern-item:hover {
    background: var(--bg-cell-hover);
}

.pattern-delete {
    background: none;
    border: none;
    color: var(--accent-kick);
    cursor: pointer;
    font-size: 1.1rem;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    background: var(--bg-cell);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.85rem;
}

.modal-btn:hover {
    background: var(--bg-cell-hover);
}

.modal-btn.primary {
    background: var(--accent-primary);
    color: white;
}

.share-link-container {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}

.share-link-container input {
    flex: 1;
    margin-bottom: 0;
}

.share-qr {
    display: flex;
    justify-content: center;
    padding: 15px;
    background: white;
    border-radius: 8px;
    margin-bottom: 15px;
}

.export-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.export-options label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.export-options select {
    padding: 10px;
    border: none;
    border-radius: 6px;
    background: var(--bg-cell);
    color: var(--text-primary);
}

.export-progress {
    margin-bottom: 15px;
}

.progress-bar {
    height: 8px;
    background: var(--bg-cell);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: var(--accent-primary);
    width: 0%;
    transition: width 0.3s ease;
}

#exportStatus {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.settings-content {
    min-width: 350px;
}

.settings-group {
    margin-bottom: 20px;
}

.settings-group > label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.color-picker {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.color-option {
    width: 32px;
    height: 32px;
    border: 2px solid transparent;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.color-option:hover {
    transform: scale(1.15);
}

.color-option.active {
    border-color: white;
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 2000;
}

.toast {
    padding: 12px 20px;
    background: var(--bg-panel);
    border-left: 4px solid var(--accent-primary);
    border-radius: 6px;
    margin-top: 10px;
    animation: toastIn 0.3s ease;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
}

.toast.success {
    border-color: var(--accent-hihat);
}

.toast.error {
    border-color: var(--accent-kick);
}

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

.toast span {
    color: var(--text-primary);
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        width: 60px;
    }
    .sidebar-header h2, .rooms-list, .current-room span {
        display: none;
    }
    .chat-panel {
        width: 0;
        position: absolute;
        right: 0;
        height: 100%;
    }
    .chat-panel.active {
        width: 280px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    .app-container {
        flex-direction: column;
    }
    .main-content {
        padding: 10px;
    }
    .sequencer-container {
        padding: 12px;
    }
    .control-bar {
        flex-direction: column;
        align-items: flex-start;
    }
    .step-cell {
        min-height: 22px;
    }
    .effects-row {
        gap: 15px;
    }
    .footer-left, .footer-center, .footer-right {
        flex-wrap: wrap;
        justify-content: center;
    }
    .sequencer-footer {
        flex-direction: column;
    }
}

@media (max-width: 500px) {
    .step-cell {
        min-height: 18px;
    }
    .step-grid {
        gap: 2px;
    }
    .track-volume, .solo-btn, .mute-btn, .track-indicator {
        display: none;
    }
    .visualizer-container {
        height: 40px;
    }
    .vu-meters {
        display: none;
    }
    .logo-text {
        font-size: 1.2rem;
    }
    .action-btn span {
        display: none;
    }
}
