:root {
  --bg: #0f172a;
  --bg-soft: #111827;
  --card: rgba(255, 255, 255, 0.08);
  --card-border: rgba(255, 255, 255, 0.12);
  --text: #f8fafc;
  --muted: #cbd5e1;
  --accent: #38bdf8;
  --accent-strong: #0ea5e9;
  --danger: #fb7185;
  --shadow: 0 20px 40px rgba(0, 0, 0, 0.28);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(160deg, #020617 0%, #0f172a 35%, #111827 100%);
  color: var(--text);
}
button, input {
  font: inherit;
}
button {
  cursor: pointer;
  border: none;
  border-radius: 999px;
  padding: 0.75rem 1rem;
  background: var(--accent);
  color: #082f49;
  font-weight: 700;
}
button:hover { background: var(--accent-strong); color: white; }
input {
  width: 100%;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}
input::file-selector-button {
  border: none;
  background: var(--accent);
  color: #082f49;
  padding: 0.6rem 0.8rem;
  border-radius: 999px;
  margin-right: 0.8rem;
  font-weight: 700;
}
.app-shell {
  max-width: 1300px;
  margin: 0 auto;
  padding: 1rem;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0 1.25rem;
}
.topbar h1 {
  margin: 0.2rem 0 0;
  font-size: clamp(2rem, 3vw, 3rem);
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent);
  font-size: 0.75rem;
  margin: 0;
}
.user-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.layout {
  display: grid;
  gap: 1rem;
}
.card, .playlist-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}
.card {
  padding: 1rem;
}
.auth-card {
  max-width: 460px;
  margin: 2rem auto;
}
.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.tab {
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}
.tab.active {
  background: var(--accent);
  color: #082f49;
}
.stacked-form, .inline-form {
  display: grid;
  gap: 0.9rem;
}
.stacked-form label {
  display: grid;
  gap: 0.45rem;
  color: var(--muted);
}
.app-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1rem;
}
.left-column, .right-column {
  display: grid;
  gap: 1rem;
  align-content: start;
}
.card-head, .playlist-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.card-head h2, .playlist-head h3, .card-head h3, .playlist-head p {
  margin: 0;
}
.list, .playlist-stack, .playlist-songs {
  display: grid;
  gap: 0.75rem;
}
.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.item-title, .track-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}
.item-subtitle, .track-artist {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}
.item-actions {
  display: flex;
  gap: 0.5rem;
}
.wrap-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}
.ghost-btn {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}
.ghost-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}
.danger-btn {
  color: white;
  border: 1px solid rgba(251, 113, 133, 0.45);
}
.danger-btn:hover {
  background: rgba(251, 113, 133, 0.2);
}
.status-text {
  min-height: 1.2rem;
  margin: 0;
  color: var(--muted);
}
.player-card audio {
  width: 100%;
  margin-top: 1rem;
}
.playlist-card {
  padding: 1rem;
}
.playlist-add-row {
  margin-bottom: 0.85rem;
}
select {
  width: 100%;
  padding: 0.8rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}
.hidden {
  display: none !important;
}
.empty-state {
  color: var(--muted);
  padding: 0.75rem 0;
}
@media (max-width: 900px) {
  .app-grid {
    grid-template-columns: 1fr;
  }
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }
}
@media (max-width: 560px) {
  .app-shell {
    padding: 0.75rem;
  }
  .card, .playlist-card {
    border-radius: 18px;
  }
  .list-item, .playlist-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .item-actions, .wrap-actions {
    width: 100%;
    justify-content: stretch;
  }
  .item-actions button, .wrap-actions button {
    flex: 1;
  }
}
