:root {
  --bg: #000000;
  --panel: #121212;
  --panel-soft: #1a1a1a;
  --panel-hover: #232323;
  --text: #ffffff;
  --muted: #b3b3b3;
  --line: rgba(255, 255, 255, 0.08);
  --green: #1ed760;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  padding: 8px 8px 110px;
  font-family: "Space Grotesk", sans-serif;
  background: var(--bg);
  color: var(--text);
}

button,
input,
a,
label {
  font: inherit;
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 8px 8px;
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.spotify-badge {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #ffffff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.spotify-badge span {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, transparent 0 32%, #111 33% 40%, transparent 41%),
    linear-gradient(#111, #111);
  position: relative;
}

.spotify-badge span::before,
.spotify-badge span::after {
  content: "";
  position: absolute;
  left: 1px;
  right: 1px;
  border-top: 2px solid #111;
  border-radius: 50%;
}

.spotify-badge span::before {
  top: 5px;
  height: 5px;
}

.spotify-badge span::after {
  top: 10px;
  height: 4px;
}

.icon-pill {
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: #1f1f1f;
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.home-icon,
.search-icon,
.library-icon {
  display: block;
  position: relative;
}

.home-icon {
  width: 18px;
  height: 14px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 0 0 4px 4px;
}

.home-icon::before {
  content: "";
  position: absolute;
  left: -1px;
  top: -9px;
  width: 14px;
  height: 14px;
  border-left: 2px solid currentColor;
  border-top: 2px solid currentColor;
  transform: rotate(45deg);
}

.searchbar {
  width: min(560px, 48vw);
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  min-height: 48px;
  border-radius: 999px;
  background: #1f1f1f;
  color: var(--muted);
}

.searchbar input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.searchbar input::placeholder {
  color: #b8b8b8;
}

.search-icon {
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.search-icon::after {
  content: "";
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 8px;
  border-top: 2px solid currentColor;
  transform: rotate(45deg);
}

.library-icon {
  width: 16px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.library-icon::before {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  top: 3px;
  border-top: 2px solid currentColor;
}

.top-link {
  color: #d6d6d6;
  font-size: 0.95rem;
  font-weight: 700;
}

.top-link-button {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.top-divider {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.3);
}

.login-button {
  min-height: 48px;
  padding: 0 28px;
  border: 0;
  border-radius: 999px;
  background: #ffffff;
  color: #111111;
  font-weight: 700;
  cursor: pointer;
}

.user-session {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 6px;
}

.user-session span {
  color: var(--text);
  font-weight: 700;
}

.session-button {
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: #232323;
  color: var(--text);
  cursor: pointer;
}

.page-shell {
  display: grid;
  grid-template-columns: 390px minmax(0, 1fr);
  gap: 8px;
}

.sidebar,
.main-panel {
  min-height: calc(100vh - 126px);
  border-radius: 10px;
  background: var(--panel);
}

.sidebar {
  padding: 14px 10px;
  display: grid;
  align-content: start;
  gap: 22px;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 10px;
}

.sidebar-head h1 {
  margin: 0;
  font-size: 1.6rem;
}

.create-button,
.white-button,
.clear-button {
  border: 0;
  cursor: pointer;
}

.create-button {
  min-height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  background: #242424;
  color: var(--text);
  font-weight: 700;
}

.sidebar-card {
  padding: 18px;
  border-radius: 10px;
  background: #1f1f1f;
  display: grid;
  gap: 10px;
}

.sidebar-card h2,
.section-head h2,
.artist-card h3,
.track-title,
.empty-state h3 {
  margin: 0;
}

.sidebar-card p,
.artist-card p,
.track-meta,
#storage-status,
.empty-state p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.white-button,
.upload-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  background: #ffffff;
  color: #111111;
  font-weight: 700;
}

.clear-button {
  width: fit-content;
  min-height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  background: #2a2a2a;
  color: var(--text);
}

.sidebar-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 0 10px;
}

.sidebar-footer a {
  color: var(--muted);
  font-size: 0.9rem;
}

.main-panel {
  padding: 20px 22px;
  background:
    linear-gradient(180deg, rgba(50, 50, 50, 0.95), #121212 180px);
  display: grid;
  align-content: start;
  gap: 34px;
}

.content-section {
  display: grid;
  gap: 16px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-head h2 {
  font-size: 2rem;
}

.section-link {
  color: #bdbdbd;
  font-weight: 700;
}

.empty-state {
  padding: 28px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.empty-kicker {
  margin: 0 0 10px;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
}

.music-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
}

.music-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  transition: background 160ms ease, transform 160ms ease;
}

.music-card:hover,
.artist-card:hover {
  background: var(--panel-hover);
  transform: translateY(-2px);
}

.card-cover {
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(38, 38, 38, 0.15), rgba(0, 0, 0, 0.35)),
    linear-gradient(135deg, #4b4b4b, #191919 60%);
  display: grid;
  place-items: center;
}

.cover-disc {
  width: 54%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #111 0 14%, #2b2b2b 15% 38%, #0a0a0a 39% 100%);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.track-badge {
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 0.72rem;
  font-weight: 700;
}

.delete-button {
  min-height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: #2f2f2f;
  color: var(--text);
  cursor: pointer;
}

.track-title {
  font-size: 1.1rem;
  line-height: 1.25;
}

.track-meta {
  min-height: 3em;
  font-size: 0.92rem;
}

.card-actions {
  display: flex;
}

.play-main-button {
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--green);
  color: #111111;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(30, 215, 96, 0.25);
}

.play-icon {
  display: block;
  width: 0;
  height: 0;
  margin-left: 4px;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-left: 16px solid #111111;
}

.artist-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
}

.artist-card {
  padding: 12px;
  border-radius: 8px;
  background: transparent;
  transition: background 160ms ease, transform 160ms ease;
}

.artist-avatar {
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  margin-bottom: 14px;
  background-size: cover;
  background-position: center;
}

.avatar-one {
  background:
    radial-gradient(circle at 30% 25%, #cde8ff, transparent 25%),
    linear-gradient(135deg, #dfefff, #3c4254 65%);
}

.avatar-two {
  background:
    radial-gradient(circle at 60% 28%, #ffd89f, transparent 22%),
    linear-gradient(135deg, #ffe6c8, #46331c 62%);
}

.avatar-three {
  background:
    radial-gradient(circle at 40% 32%, #867a83, transparent 18%),
    linear-gradient(135deg, #181818, #5a4f58 70%);
}

.avatar-four {
  background:
    radial-gradient(circle at 52% 40%, #7b7b7b, transparent 20%),
    linear-gradient(135deg, #1c1c1c, #4b4b4b 60%);
}

.avatar-five {
  background:
    radial-gradient(circle at 50% 35%, #775f4d, transparent 18%),
    linear-gradient(135deg, #231b1d, #274457 70%);
}

.avatar-six {
  background:
    radial-gradient(circle at 50% 28%, #ffffff, transparent 18%),
    linear-gradient(135deg, #f0f0f0, #787878 68%);
}

.bottom-player {
  position: fixed;
  left: 8px;
  right: 8px;
  bottom: 8px;
  z-index: 20;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  min-height: 84px;
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: #000000;
}

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

.bottom-player__art {
  width: 56px;
  height: 56px;
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(30, 215, 96, 0.92), rgba(8, 19, 11, 0.6));
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.bottom-player__disc {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #121212 0 16%, #2b2b2b 17% 34%, #111 35% 100%);
}

.bottom-player__meta {
  min-width: 0;
}

.bottom-player__meta p,
.bottom-player__meta span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bottom-player__meta p {
  margin: 0 0 4px;
  font-weight: 700;
}

.bottom-player__meta span {
  color: var(--muted);
  font-size: 0.9rem;
}

.bottom-player audio {
  width: 100%;
  min-height: 40px;
  border-radius: 999px;
}

.auth-modal[hidden] {
  display: none;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
}

.auth-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(10px);
}

.auth-panel {
  position: relative;
  width: min(430px, calc(100% - 24px));
  padding: 26px 18px 22px;
  background: #121212;
  text-align: center;
}

.auth-panel--login {
  width: min(420px, calc(100% - 24px));
}

.auth-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: #232323;
  color: #ffffff;
  font-size: 1.4rem;
  cursor: pointer;
}

.auth-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}

.auth-brand__logo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #ffffff;
  display: grid;
  place-items: center;
}

.auth-brand__logo span {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, transparent 0 32%, #111 33% 40%, transparent 41%),
    linear-gradient(#111, #111);
  position: relative;
}

.auth-brand__logo span::before,
.auth-brand__logo span::after {
  content: "";
  position: absolute;
  left: 1px;
  right: 1px;
  border-top: 2px solid #111;
  border-radius: 50%;
}

.auth-brand__logo span::before {
  top: 4px;
  height: 4px;
}

.auth-brand__logo span::after {
  top: 8px;
  height: 3px;
}

.auth-message {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(30, 215, 96, 0.12);
  color: #b9f5cc;
}

.auth-form {
  display: grid;
  gap: 14px;
  justify-items: stretch;
}

.auth-title {
  max-width: 8ch;
  margin: 0 auto 16px;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 0.98;
  font-weight: 700;
}

.auth-title--login {
  max-width: 11ch;
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
}

.auth-field {
  display: grid;
  gap: 8px;
  text-align: left;
}

.auth-field span {
  color: #ffffff;
  font-size: 0.92rem;
  font-weight: 700;
}

.auth-field input {
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: #1d1d1d;
  color: var(--text);
}

.auth-field--compact {
  display: grid;
}

.auth-submit {
  min-height: 46px;
  border: 0;
  border-radius: 999px;
  background: var(--green);
  color: #111111;
  font-weight: 700;
  cursor: pointer;
}

.auth-separator {
  color: #ffffff;
  font-weight: 700;
  text-transform: lowercase;
}

.auth-provider {
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: transparent;
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
}

.auth-footer {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  justify-items: center;
}

.auth-footer p {
  margin: 0;
  color: var(--muted);
}

.auth-secondary-link {
  width: fit-content;
  margin: 0 auto;
  border: 0;
  background: transparent;
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 1180px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-right {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .searchbar {
    width: 100%;
  }

  .page-shell {
    grid-template-columns: 1fr;
  }

  .sidebar,
  .main-panel {
    min-height: auto;
  }
}

@media (max-width: 720px) {
  body {
    padding: 8px 8px 140px;
  }

  .topbar-left,
  .topbar-right {
    flex-wrap: wrap;
  }

  .topbar-right {
    justify-content: flex-start;
  }

  .main-panel {
    padding: 18px 14px;
  }

  .section-head h2 {
    font-size: 1.5rem;
  }

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

  .bottom-player {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}
