:root {
  color-scheme: dark;
  --bg: #101114;
  --panel: #181a1f;
  --panel-2: #20232a;
  --text: #f3f5f7;
  --muted: #a9b0bb;
  --line: #30343d;
  --green: #1ed760;
  --green-dark: #169c47;
  --pink: #e75480;
  --gold: #e7b449;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: calc(100vh - 96px);
}

.sidebar {
  position: sticky;
  top: 0;
  height: calc(100vh - 96px);
  padding: 24px 16px;
  background: #070809;
  border-right: 1px solid #202227;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  font-weight: 800;
}

.brand-mark,
.cover {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--green), var(--pink));
  color: #051007;
  font-weight: 900;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 8px;
}

.nav {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 6px;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  text-align: left;
}

.nav.active,
.nav:hover {
  background: var(--panel-2);
  color: var(--text);
}

.auth-card {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.folder-panel {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.folder-list {
  display: grid;
  gap: 6px;
  max-height: min(34vh, 300px);
  overflow: auto;
  padding-right: 4px;
}

.folder-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 9px 10px;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  text-align: left;
}

.folder-button span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-button.active,
.folder-button:hover {
  background: var(--panel-2);
  color: var(--text);
}

.auth-card input {
  width: 100%;
  margin-bottom: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d0f12;
  color: var(--text);
}

.auth-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.main {
  min-width: 0;
  padding: 28px 32px 124px;
  background:
    radial-gradient(circle at 72% 0%, rgba(30, 215, 96, 0.2), transparent 28%),
    linear-gradient(180deg, #23272f 0%, #101114 340px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: 2rem;
}

.search {
  display: grid;
  gap: 6px;
  width: min(420px, 48vw);
  color: var(--muted);
  font-size: 0.82rem;
}

.search input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: #fff;
  color: #111;
  outline: none;
}

.search input:focus {
  border-color: var(--green);
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  min-height: 178px;
  margin-bottom: 26px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(231, 180, 73, 0.18), rgba(231, 84, 128, 0.18)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='260' viewBox='0 0 900 260'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.16'%3E%3Cpath d='M40 170c70-60 130-60 200 0s130 60 200 0 130-60 200 0 130 60 220 0'/%3E%3Cpath d='M20 110c90-50 160-50 250 0s160 50 250 0 160-50 320 0'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover;
}

.hero h2 {
  max-width: 760px;
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 4.4rem);
  line-height: 0.96;
}

.hero p {
  color: var(--muted);
}

.content {
  display: grid;
  gap: 12px;
}

.track-row,
.playlist-row {
  display: grid;
  grid-template-columns: 52px minmax(160px, 1.5fr) minmax(120px, 1fr) minmax(120px, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 68px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--muted);
}

.track-row:hover,
.playlist-row:hover {
  background: rgba(255, 255, 255, 0.06);
}

.track-row strong,
.playlist-row strong {
  display: block;
  color: var(--text);
}

.cover {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  font-size: 0.78rem;
  overflow: hidden;
}

.cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.row-actions {
  display: flex;
  gap: 8px;
}

.primary,
.ghost,
.icon {
  min-height: 38px;
  border-radius: 8px;
  color: var(--text);
}

.primary {
  padding: 0 14px;
  background: var(--green);
  color: #041006;
  font-weight: 800;
}

.primary:hover {
  background: #33e173;
}

.ghost,
.icon {
  padding: 0 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.icon {
  min-width: 38px;
}

.liked {
  color: var(--green);
  border-color: rgba(30, 215, 96, 0.45);
}

.empty {
  padding: 40px 0;
  color: var(--muted);
  text-align: center;
}

.player {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: minmax(240px, 420px) 1fr;
  align-items: center;
  gap: 24px;
  height: 96px;
  padding: 14px 22px;
  background: #070809;
  border-top: 1px solid #262930;
}

.now {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.now span,
.track-row span,
.playlist-row span {
  display: block;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

audio {
  width: 100%;
}

dialog {
  width: min(420px, 92vw);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
}

.dialog-card {
  display: grid;
  gap: 16px;
}

.playlist-choices {
  display: grid;
  gap: 8px;
}

@media (max-width: 820px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    padding: 14px;
  }

  .brand,
  .folder-panel,
  .auth-card {
    grid-column: 1 / -1;
  }

  .main {
    padding: 22px 16px 142px;
  }

  .topbar,
  .hero,
  .player {
    grid-template-columns: 1fr;
  }

  .topbar,
  .hero {
    align-items: stretch;
  }

  .search {
    width: 100%;
  }

  .track-row,
  .playlist-row {
    grid-template-columns: 44px minmax(0, 1fr) auto;
  }

  .track-row .album,
  .track-row .size {
    display: none;
  }

  .player {
    height: 132px;
    gap: 10px;
  }
}
