:root {
  --bg: #0f1115;
  --surface: #181b22;
  --surface-2: #20242d;
  --text: #f3f5f7;
  --muted: #9aa3af;
  --green: #1db954;
  --green-dark: #169c46;
  --border: #2a2f3a;
  --danger: #ef4444;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.15rem;
}

.logo {
  font-size: 1.4rem;
}

.user-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-2);
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

.hero {
  text-align: center;
  padding: 64px 16px;
}

.hero h1 {
  font-size: 2.4rem;
  margin: 0 0 16px;
}

.subtitle {
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto 32px;
  font-size: 1.1rem;
}

.btn {
  display: inline-block;
  border: none;
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.05s ease, background 0.15s ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--green);
  color: #fff;
}

.btn-primary:hover {
  background: var(--green-dark);
}

.btn-lg {
  padding: 14px 32px;
  font-size: 1.05rem;
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  color: var(--text);
}

.options {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 28px;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.95rem;
  cursor: pointer;
}

.checkbox input {
  width: 16px;
  height: 16px;
  accent-color: var(--green);
}

h2 {
  margin: 0 0 4px;
}

.hint {
  color: var(--muted);
  margin: 0 0 20px;
}

.playlist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.playlist-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease;
}

.playlist-card:hover {
  background: var(--surface-2);
}

.playlist-card:active {
  transform: scale(0.99);
}

.playlist-cover {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface-2);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--muted);
}

.playlist-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.playlist-meta {
  color: var(--muted);
  font-size: 0.85rem;
}

.loading {
  text-align: center;
  padding: 60px 0;
}

.spinner {
  width: 42px;
  height: 42px;
  border: 4px solid var(--border);
  border-top-color: var(--green);
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: spin 0.8s linear infinite;
}

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

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 50;
}

.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  max-width: 520px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-card h2 {
  margin-top: 0;
}

.modal-card .btn-primary {
  margin: 12px 0;
}

.result-details {
  margin: 16px 0;
  font-size: 0.9rem;
}

.result-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-top: 1px solid var(--border);
}

.tag {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.tag-cleaned {
  background: rgba(29, 185, 84, 0.15);
  color: var(--green);
}

.tag-kept {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.tag-skipped {
  background: var(--surface-2);
  color: var(--muted);
}

.error {
  color: var(--danger);
  margin-top: 16px;
}

.hidden {
  display: none !important;
}
