/* ─── Reset & base ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0f0f0f;
  --surface: #1a1a1a;
  --surface2: #242424;
  --border: #2e2e2e;
  --text: #f0f0f0;
  --muted: #888;
  --accent: #7c6ef7;

  --spotify: #1db954;
  --tidal: #0ff;
  --apple: #fc3c44;
  --youtube: #ff0000;
  --qobuz: #005eb8;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }

/* ─── Center page (landing) ─── */
.center-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 2rem 1rem;
  max-width: 560px;
  margin: 0 auto;
}

.logo {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.subtitle {
  color: var(--muted);
  text-align: center;
  max-width: 380px;
}

.input-row {
  display: flex;
  gap: 0.5rem;
  width: 100%;
}

.input-row input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.15s;
}

.input-row input:focus {
  border-color: var(--accent);
}

.input-row button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 0.75rem 1.25rem;
  font-size: 1.2rem;
  cursor: pointer;
  transition: opacity 0.15s;
}

.input-row button:hover { opacity: 0.85; }

.error-banner {
  background: #3d1414;
  border: 1px solid #7a2020;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: #f88;
  width: 100%;
  font-size: 0.9rem;
}

.error-banner.hidden { display: none; }

.supported {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  align-items: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.badge {
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.badge.spotify  { background: #1a3d29; color: var(--spotify); }
.badge.tidal    { background: #003333; color: var(--tidal); }
.badge.apple    { background: #3d1215; color: var(--apple); }
.badge.youtube  { background: #3d1212; color: var(--youtube); }
.badge.qobuz    { background: #001a33; color: var(--qobuz); }

/* ─── Song page ─── */
.song-page {
  max-width: 600px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.back-link {
  color: var(--muted);
  font-size: 0.9rem;
  transition: color 0.15s;
}

.back-link:hover { color: var(--text); }

.song-header {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}

.cover {
  width: 110px;
  height: 110px;
  object-fit: cover;
  border-radius: 10px;
  flex-shrink: 0;
  background: var(--surface);
}

.song-meta {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  justify-content: center;
}

.song-title {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
}

.song-artist {
  color: var(--muted);
  font-size: 1.05rem;
}

/* ─── Platform buttons ─── */
.platform-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.platform-btn {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  transition: background 0.15s, border-color 0.15s;
  cursor: pointer;
}

.platform-btn:hover { background: var(--surface2); }

.btn-icon { font-size: 1.3rem; width: 1.5rem; text-align: center; }

.platform-btn.spotify  { border-left: 3px solid var(--spotify); }
.platform-btn.tidal    { border-left: 3px solid var(--tidal); }
.platform-btn.apple    { border-left: 3px solid var(--apple); }
.platform-btn.youtube  { border-left: 3px solid var(--youtube); }
.platform-btn.qobuz    { border-left: 3px solid var(--qobuz); }

/* ─── Permalink ─── */
.permalink-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.permalink-label {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.permalink-row {
  display: flex;
  gap: 0.5rem;
}

.permalink-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 0.9rem;
  font-family: monospace;
  outline: none;
  min-width: 0;
}

.copy-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s;
}

.copy-btn:hover { opacity: 0.85; }

/* ─── Responsive ─── */
@media (max-width: 400px) {
  .song-title { font-size: 1.2rem; }
  .cover { width: 80px; height: 80px; }
}
