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

:root {
  --bg: #12122a;
  --surface: #14141e;
  --border: #252535;
  --text: #ddd;
  --text-dim: rgba(255, 255, 255, 0.5);
  --accent: #e94560;
  --vocals: #e94560;
  --drums: #f9a826;
  --bass: #3a86ff;
  --other: #06d6a0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

header {
  text-align: center;
  padding: 3rem 1rem 0.5rem;
}

header h1 {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.tagline {
  color: var(--text-dim);
  margin-top: 0.4rem;
  font-size: 1.05rem;
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 2rem;
}

/* Upload */

#upload-section {
  margin-top: 2rem;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

#drop-zone {
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: 14px;
  padding: 2.8rem 1.5rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.25s, background 0.25s, box-shadow 0.25s;
}

#drop-zone:hover,
#drop-zone.dragover {
  border-color: var(--accent);
  background: rgba(233, 69, 96, 0.04);
  box-shadow: 0 0 24px rgba(233, 69, 96, 0.06);
}

.drop-icon {
  font-size: 2.5rem;
  margin-bottom: 0.6rem;
  opacity: 0.4;
  transition: transform 0.3s, opacity 0.3s;
}

#drop-zone:hover .drop-icon {
  transform: translateY(-4px);
  opacity: 0.7;
}

.drop-title {
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--text);
}

.browse-link {
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
}

.hint {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-top: 0.4rem;
}

.divider {
  display: flex;
  align-items: center;
  margin: 1.6rem 0;
  color: var(--text-dim);
  font-size: 0.95rem;
}

.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.divider span { padding: 0 1rem; }

#url-form {
  display: flex;
  gap: 0.5rem;
}

#url-input {
  flex: 1;
  padding: 0.85rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 1.05rem;
}

#url-input::placeholder { color: var(--text-dim); }
#url-input:focus { outline: none; border-color: var(--accent); }

#url-btn {
  padding: 0.85rem 1.8rem;
  background: var(--accent);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

#url-btn:hover { opacity: 0.85; }
#url-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.source-tags {
  display: flex;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 0.8rem;
  flex-wrap: wrap;
}

.source-tag {
  font-size: 0.8rem;
  padding: 0.25rem 0.7rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-dim);
  white-space: nowrap;
}

.source-tag-more {
  border-style: dashed;
}

.disclaimer {
  margin-top: 1.6rem;
  font-size: 0.78rem;
  color: var(--text-dim);
  text-align: center;
  line-height: 1.5;
}

/* Progress */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  margin-top: 1.5rem;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.vex-avatar {
  display: block;
  margin: 0 auto 0.8rem;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.vex-header {
  margin-bottom: 0.6rem;
  opacity: 0.7;
  transition: opacity 0.3s;
}

.vex-header:hover {
  opacity: 1;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  margin: 1rem 0 0.5rem;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  width: 0%;
  transition: width 0.5s ease;
}

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

/* Player */

#song-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#player-section {
  margin-top: 1.5rem;
}

#transport {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

#play-btn {
  width: 44px;
  height: 44px;
  background: var(--accent);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
  flex-shrink: 0;
}

#play-btn:hover { opacity: 0.85; }

#time-display {
  font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
  color: var(--text-dim);
}

#download-btn {
  margin-left: auto;
  padding: 0.5rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.85rem;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.2s;
}

#download-btn:hover { border-color: var(--accent); }

.stem-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 0.4rem;
  padding: 0.4rem 0.6rem;
  transition: opacity 0.2s, border-color 0.2s;
}

.stem-row.stem-muted {
  opacity: 0.3;
}

.stem-row.stem-soloed {
  border-color: rgba(255, 255, 255, 0.15);
}

.stem-label {
  font-size: 0.8rem;
  font-weight: 600;
  width: 52px;
  text-transform: capitalize;
  flex-shrink: 0;
}

.stem-row button {
  width: 26px;
  height: 26px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: transparent;
  color: var(--text-dim);
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}

.stem-row button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.stem-row button:hover:not(.active) {
  border-color: rgba(255, 255, 255, 0.3);
  color: var(--text);
}

.stem-volume {
  width: 50px;
  height: 4px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

.stem-pan {
  width: 40px;
  height: 4px;
  accent-color: var(--text-dim);
  cursor: pointer;
  flex-shrink: 0;
}

.stem-waveform {
  flex: 1;
  min-width: 0;
  height: 72px;
}

/* Split another */

.split-another {
  margin-top: 2.5rem;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.drop-zone-mini {
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 1.2rem;
  text-align: center;
  cursor: pointer;
  font-size: 0.95rem;
  transition: border-color 0.25s;
}

.drop-zone-mini:hover {
  border-color: var(--accent);
}

.url-form-mini {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.url-form-mini input {
  flex: 1;
  padding: 0.7rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.95rem;
}

.url-form-mini input::placeholder { color: var(--text-dim); }
.url-form-mini input:focus { outline: none; border-color: var(--accent); }

.url-form-mini button {
  padding: 0.7rem 1.4rem;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.url-form-mini button:hover { opacity: 0.85; }

/* Error */

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

#error-text {
  margin-bottom: 1rem;
}

#retry-btn {
  padding: 0.5rem 1.5rem;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-size: 0.9rem;
}

/* Responsive */

@media (max-width: 600px) {
  header { padding-top: 1.5rem; }
  header h1 { font-size: 1.8rem; }
  main { padding: 0.5rem; }
  #drop-zone { padding: 2rem 1rem 1.5rem; }
  .stem-volume, .stem-pan { display: none; }
  .stem-label { width: 44px; font-size: 0.75rem; }
  .stem-waveform { height: 44px; }
  .source-tags { gap: 0.3rem; }
}
