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

:root {
  --bg: #0d0d0d;
  --surface: #1a1a1a;
  --surface-2: #242424;
  --surface-3: #2e2e2e;
  --border: #333;
  --text: #e5e5e5;
  --text-dim: #888;
  --accent: #6c5ce7;
  --accent-hover: #7c6cf7;
  --success: #2ecc71;
  --error: #e74c3c;
  --warning: #f39c12;
  --radius: 10px;
  --radius-sm: 6px;
}

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

.hidden { display: none !important; }

/* Auth */
.auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}
.auth-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  max-width: 360px;
  width: 100%;
}
.auth-box h1 { font-size: 24px; margin-bottom: 8px; }
.auth-box p { color: var(--text-dim); margin-bottom: 24px; }
.auth-box input {
  width: 100%;
  padding: 12px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 16px;
  margin-bottom: 12px;
}
.auth-box button {
  width: 100%;
  padding: 12px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s;
}
.auth-box button:hover { background: var(--accent-hover); }
.error { color: var(--error); font-size: 14px; margin-top: 8px; }

/* App */
.app { max-width: 800px; margin: 0 auto; padding: 24px 16px; }

.header {
  text-align: center;
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}
.header h1 { font-size: 28px; }
.subtitle { color: var(--text-dim); margin-top: 4px; }

/* Fields */
.field { margin-bottom: 20px; }
.field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.optional, .hint { font-weight: 400; text-transform: none; letter-spacing: 0; font-size: 12px; }

.field input[type="text"],
.field select {
  width: 100%;
  padding: 12px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 15px;
}
.field select { cursor: pointer; }
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--accent);
}

/* Artist row */
.artist-row { display: flex; gap: 8px; }
.artist-row select { flex: 1; }
.btn-icon {
  width: 44px;
  height: 44px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.btn-icon:hover { background: var(--surface-3); border-color: var(--accent); }

.new-artist-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.new-artist-row input { flex: 1; }
.btn-sm {
  padding: 8px 16px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}
.btn-sm:hover { background: var(--accent-hover); }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
}
.btn-ghost:hover { background: var(--surface-2); }

/* Drop zones */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  color: var(--text-dim);
}
.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--accent);
  background: rgba(108, 92, 231, 0.05);
}
.drop-zone--small { padding: 20px; }
.drop-sub { display: block; font-size: 13px; margin-top: 4px; }
.file-input {
  display: none;
}

.cover-preview {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

/* Track list */
.track-list {
  margin-bottom: 20px;
}
.track-list h3 {
  font-size: 14px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.track-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}
.track-num {
  font-size: 14px;
  color: var(--text-dim);
  min-width: 24px;
  text-align: right;
}
.track-name {
  flex: 1;
  font-size: 15px;
}
.track-size {
  font-size: 13px;
  color: var(--text-dim);
  min-width: 60px;
  text-align: right;
}
.track-status {
  min-width: 80px;
  text-align: right;
  font-size: 13px;
}
.track-status.waiting { color: var(--text-dim); }
.track-status.converting { color: var(--warning); }
.track-status.uploading { color: var(--accent); }
.track-status.done { color: var(--success); }
.track-status.error { color: var(--error); }

.track-progress {
  width: 100%;
  height: 3px;
  background: var(--surface-2);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}
.track-progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s;
  width: 0%;
}
.track-progress-bar.done { background: var(--success); }

.track-remove {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 18px;
  padding: 0 4px;
}
.track-remove:hover { color: var(--error); }

/* Publish */
.publish-area {
  text-align: center;
  padding: 20px 0;
}
.global-status {
  font-size: 15px;
  margin-bottom: 16px;
  min-height: 24px;
}
.btn-publish {
  padding: 14px 48px;
  background: var(--success);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-publish:hover { background: #27ae60; transform: scale(1.02); }
.btn-publish:disabled {
  background: var(--surface-3);
  color: var(--text-dim);
  cursor: not-allowed;
  transform: none;
}

/* Albums list */
.albums-section {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.albums-section h2 { margin-bottom: 16px; }

.album-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
}
.album-cover {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--surface-3);
}
.album-info { flex: 1; }
.album-artist { font-size: 13px; color: var(--text-dim); }
.album-title { font-size: 16px; font-weight: 600; }
.album-tracks { font-size: 13px; color: var(--text-dim); margin-top: 2px; }
.album-date { font-size: 12px; color: var(--text-dim); }

.empty-state { color: var(--text-dim); font-style: italic; }

/* Responsive */
@media (max-width: 600px) {
  .app { padding: 16px 12px; }
  .header h1 { font-size: 22px; }
  .track-item { flex-wrap: wrap; }
  .track-size { min-width: auto; }
}

@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.spin { animation: spin 1s linear infinite; }
.track-status svg { display: inline-block; vertical-align: middle; margin-right: 4px; }

.track-drag {
  cursor: grab;
  opacity: 0.5;
  display: flex;
  align-items: center;
  padding: 0 4px;
}
.track-drag:hover { opacity: 1; }
.track-item.dragging { opacity: 0.4; }
.track-item.drag-over { border-top: 2px solid #a855f7; margin-top: -2px; }
.track-item { display: flex; align-items: center; gap: 8px; }
