* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #0a0a0a;
    --surface: #141414;
    --border: #2a2a2a;
    --text: #e0e0e0;
    --text-dim: #808080;
    --accent: #4a9eff;
    --accent-dim: #2a5a99;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.1em;
}

.icon-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.icon-btn:hover {
    border-color: var(--accent);
}

.section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
}

.section h2 {
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    color: var(--text-dim);
    margin-bottom: 16px;
}

.drop-zone {
    border: 2px dashed var(--border);
    border-radius: 8px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--accent);
    background: rgba(74, 158, 255, 0.05);
}

.drop-zone p {
    color: var(--text-dim);
    font-size: 0.875rem;
    letter-spacing: 0.05em;
}

.status {
    margin-top: 16px;
}

.status p {
    font-size: 0.875rem;
    color: var(--text-dim);
    margin-bottom: 8px;
}

.progress-bar {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    width: 0%;
    transition: width 0.3s;
}

.stem-toggles {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.stem-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    transition: border-color 0.2s, background 0.2s;
}

.stem-toggle:hover {
    border-color: var(--accent-dim);
}

.stem-toggle input {
    display: none;
}

.stem-toggle input:checked + span {
    color: var(--accent);
}

.stem-toggle input:checked ~ .stem-toggle {
    border-color: var(--accent);
}

.stem-toggle span {
    font-size: 0.875rem;
    color: var(--text-dim);
    transition: color 0.2s;
}

.stem-toggle:has(input:checked) {
    border-color: var(--accent);
    background: rgba(74, 158, 255, 0.1);
}

.stem-toggle:has(input:checked) span {
    color: var(--accent);
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn {
    padding: 8px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: border-color 0.2s, background 0.2s;
}

.btn:hover {
    border-color: var(--accent);
    background: rgba(74, 158, 255, 0.1);
}

.btn:active {
    background: rgba(74, 158, 255, 0.2);
}

.btn-small {
    padding: 4px 12px;
    font-size: 0.75rem;
}

.seek-bar {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--border);
    border-radius: 2px;
    cursor: pointer;
}

.seek-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
}

.seek-bar::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

#timeDisplay {
    font-size: 0.75rem;
    color: var(--text-dim);
    font-variant-numeric: tabular-nums;
    min-width: 100px;
}

.remix-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.remix-row label {
    font-size: 0.875rem;
    color: var(--text-dim);
    min-width: 60px;
}

.remix-row select {
    flex: 1;
    padding: 8px;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 4px;
    font-size: 0.875rem;
}

.remix-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.remix-controls label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--text-dim);
}

.remix-controls select {
    padding: 4px 8px;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 4px;
    font-size: 0.875rem;
}

.remix-controls input[type="range"] {
    width: 100px;
}

#thresholdValue {
    font-size: 0.75rem;
    color: var(--text);
    min-width: 30px;
}

.export-buttons {
    display: flex;
    gap: 12px;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal[hidden] {
    display: none;
}

.modal-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px;
    max-width: 400px;
    width: 90%;
}

.modal-content h2 {
    font-size: 1.125rem;
    margin-bottom: 16px;
}

.modal-content ol {
    margin-left: 20px;
    margin-bottom: 20px;
}

.modal-content li {
    font-size: 0.875rem;
    color: var(--text-dim);
    margin-bottom: 8px;
}

@media (max-width: 600px) {
    .container {
        padding: 12px;
    }

    .stem-toggles {
        gap: 8px;
    }

    .stem-toggle {
        padding: 6px 10px;
    }

    .player-controls {
        flex-wrap: wrap;
    }

    .seek-bar {
        order: 3;
        width: 100%;
        flex: none;
    }

    #timeDisplay {
        order: 4;
    }
}
