:root {
  color-scheme: dark;
  --bg: #111315;
  --card: #1b1f22;
  --card-soft: #23282c;
  --text: #f3f5f4;
  --muted: #a7b0ad;
  --accent: #1ed760;
  --accent-strong: #18b851;
  --border: #30373c;
  --danger: #ff6b6b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #213329 0, var(--bg) 42rem);
  color: var(--text);
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 0.75rem 1rem;
  background: var(--card-soft);
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
}

button:hover,
button:focus-visible {
  background: #303840;
  outline: 2px solid transparent;
}

button.primary {
  background: var(--accent);
  color: #07100a;
}

button.primary:hover,
button.primary:focus-visible {
  background: var(--accent-strong);
}

button.ghost {
  padding: 0.55rem 0.8rem;
  color: var(--muted);
}

button.wide {
  width: 100%;
}

.app-shell {
  width: min(56rem, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0;
}

.hero {
  margin-bottom: 1rem;
}

.eyebrow {
  margin: 0 0 0.35rem;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0.25rem;
  font-size: clamp(2rem, 8vw, 3.5rem);
  line-height: 1;
}

h2 {
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
}

.muted,
.status,
.player-meta,
.playlist-meta {
  color: var(--muted);
}

.card {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: color-mix(in srgb, var(--card) 94%, transparent);
  box-shadow: 0 1rem 3rem rgb(0 0 0 / 18%);
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.login-form {
  display: grid;
  gap: 0.75rem;
}

label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 0.7rem;
  padding: 0.8rem;
  background: #0f1113;
  color: var(--text);
}

input:focus {
  border-color: var(--accent);
  outline: none;
}

.player-card {
  display: grid;
  gap: 1rem;
}

audio {
  width: 100%;
}

.track-text {
  margin-bottom: 0.15rem;
  color: var(--text);
  font-weight: 700;
}

.player-meta {
  margin-bottom: 0;
  font-size: 0.92rem;
}

.controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
}

.playlist-list {
  display: grid;
  gap: 0.75rem;
}

.playlist-row {
  display: grid;
  gap: 0.75rem;
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: #15181a;
}

.playlist-main {
  min-width: 0;
}

.playlist-name {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.playlist-meta {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.9rem;
}

.playlist-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.playlist-track-container {
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}

.playlist-tracks {
  margin: 0;
  padding-left: 1.25rem;
  display: grid;
  gap: 0.45rem;
}

.playlist-track {
  color: var(--text);
  line-height: 1.35;
}

.status {
  min-height: 1.25rem;
  margin-bottom: 0;
  font-size: 0.9rem;
}

.status.error {
  color: var(--danger);
}

@media (max-width: 38rem) {
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .playlist-actions {
    justify-content: stretch;
  }

  .playlist-actions button {
    flex: 1 1 10rem;
  }
}
