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

html, body {
    width: 100%;
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #e2e8f0;
    overflow: hidden;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 12px;
    gap: 12px;
}

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

.header h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.info-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #334155;
    border: 2px solid #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.info-btn:hover {
    background: #475569;
    border-color: #64748b;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 24px;
    max-width: 400px;
    width: 90%;
}

.modal-content h2 {
    margin-bottom: 12px;
    color: #60a5fa;
}

.modal-content p {
    margin-bottom: 16px;
    font-size: 14px;
    opacity: 0.9;
}

.modal-content ul {
    list-style: none;
    margin-bottom: 20px;
}

.modal-content li {
    font-size: 13px;
    margin-bottom: 8px;
    opacity: 0.85;
}

.modal-close {
    background: #334155;
    border: none;
    color: #e2e8f0;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #475569;
}

.controls-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 12px;
}

.transport {
    display: flex;
    gap: 8px;
}

.play-btn, .stop-btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.play-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.play-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

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

.play-btn.playing {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    box-shadow: 0 0 16px rgba(6, 182, 212, 0.5);
}

.stop-btn {
    background: #334155;
    color: #e2e8f0;
}

.stop-btn:hover {
    background: #475569;
}

.knobs-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.knob-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 1;
    min-width: 80px;
}

.knob-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.7;
}

.knob {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: conic-gradient(
        from 225deg,
        #334155 0deg,
        #475569 90deg,
        #334155 180deg,
        #0f172a 225deg
    );
    border: 2px solid #475569;
    position: relative;
    cursor: grab;
    transition: border-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.knob::before {
    content: '';
    position: absolute;
    width: 3px;
    height: 20px;
    background: linear-gradient(to top, #60a5fa, #a78bfa);
    border-radius: 2px;
    top: 8px;
    transform-origin: center 26px;
}

.knob:hover {
    border-color: #64748b;
    cursor: grab;
}

.knob:active {
    cursor: grabbing;
}

.knob-value {
    font-size: 12px;
    font-weight: 600;
    min-width: 35px;
    text-align: center;
}

.mutate-btn, .share-btn {
    padding: 8px 12px;
    border: 1px solid #475569;
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 12px;
    white-space: nowrap;
    transition: all 0.2s;
}

.mutate-btn:hover, .share-btn:hover {
    background: #334155;
    border-color: #64748b;
}

.mutate-btn:active, .share-btn:active {
    transform: scale(0.95);
}

.sequencer {
    display: flex;
    gap: 12px;
    flex: 1;
    min-height: 0;
    flex-wrap: wrap;
}

.tracks {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    padding-right: 4px;
    min-width: 0;
}

.track {
    display: flex;
    gap: 8px;
    align-items: center;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 8px;
}

.track-header {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 90px;
    flex-shrink: 0;
}

.track-name {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

.mute-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #475569;
    background: #334155;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.mute-btn:hover {
    background: #475569;
}

.mute-btn.muted {
    background: #7f1d1d;
    border-color: #dc2626;
    opacity: 0.6;
}

.steps {
    display: flex;
    gap: 4px;
    flex: 1;
}

.step {
    flex: 1;
    min-width: 20px;
    aspect-ratio: 1;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.1s;
    position: relative;
}

.step:hover {
    border-color: #64748b;
    background: #293548;
}

.step.active {
    background: linear-gradient(135deg, #60a5fa, #a78bfa);
    border-color: #60a5fa;
    box-shadow: 0 0 8px rgba(96, 165, 250, 0.5);
}

.step.playing {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.7);
}

.visualizer {
    width: 280px;
    height: 120px;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

#visualizerCanvas {
    width: 100%;
    height: 100%;
    max-width: 200px;
}

.footer {
    text-align: center;
    font-size: 11px;
    opacity: 0.6;
    margin-top: 4px;
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 24px;
    }

    .container {
        padding: 8px;
        gap: 8px;
    }

    .knob {
        width: 50px;
        height: 50px;
    }

    .knob::before {
        height: 16px;
        top: 6px;
    }

    .sequencer {
        flex-direction: column;
    }

    .visualizer {
        width: 100%;
        height: 140px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 20px;
    }

    .container {
        padding: 6px;
        gap: 6px;
    }

    .controls-panel {
        padding: 8px;
        gap: 8px;
    }

    .knobs-row {
        gap: 6px;
    }

    .knob {
        width: 44px;
        height: 44px;
    }

    .knob::before {
        height: 14px;
        width: 2px;
        top: 5px;
    }

    .knob-value {
        font-size: 11px;
    }

    .track {
        padding: 6px;
        gap: 6px;
    }

    .step {
        min-width: 16px;
    }

    .mutate-btn, .share-btn {
        padding: 6px 8px;
        font-size: 11px;
    }
}

/* Scrollbar styling */
.tracks::-webkit-scrollbar {
    width: 6px;
}

.tracks::-webkit-scrollbar-track {
    background: #0f172a;
}

.tracks::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 3px;
}

.tracks::-webkit-scrollbar-thumb:hover {
    background: #475569;
}
