:root {
  color-scheme: dark;
  --bg: #070b18;
  --bg-soft: #0d1326;
  --panel: rgba(16, 24, 45, 0.82);
  --panel-strong: rgba(20, 31, 58, 0.96);
  --line: rgba(148, 163, 184, 0.22);
  --text: #e5edf8;
  --muted: #91a0b8;
  --muted-strong: #b9c4d6;
  --accent: #67e8f9;
  --accent-2: #a78bfa;
  --danger: #fb7185;
  --success: #34d399;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.38);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(103, 232, 249, 0.16), transparent 34rem),
    radial-gradient(circle at top right, rgba(167, 139, 250, 0.18), transparent 38rem),
    var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--text);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  padding-bottom: 132px;
}

button,
input,
audio {
  font: inherit;
}

button {
  border: 0;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0;
}

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

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 4rem);
  letter-spacing: -0.06em;
  line-height: 0.98;
}

.subtitle {
  max-width: 720px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.6;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 16px;
  background: rgba(15, 23, 42, 0.7);
  color: var(--muted-strong);
  font-size: 0.92rem;
  font-weight: 700;
  white-space: nowrap;
}

.toolbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  margin-bottom: 18px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(15, 23, 42, 0.72);
  padding: 0 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.search-box svg,
.refresh-button svg,
.icon-button svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.search-box svg {
  color: var(--muted);
  flex: 0 0 auto;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 1rem;
}

.search-box input::placeholder {
  color: #66748d;
}

.refresh-button {
  display: grid;
  place-items: center;
  width: 58px;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(15, 23, 42, 0.72);
  color: var(--muted-strong);
  cursor: pointer;
  box-shadow: var(--shadow);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    background 160ms ease;
}

.refresh-button:hover {
  transform: translateY(-1px);
  border-color: rgba(103, 232, 249, 0.54);
  color: var(--accent);
  background: rgba(18, 30, 56, 0.92);
}

.content-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.table-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  gap: 16px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.songs-list {
  display: grid;
}

.song-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  gap: 16px;
  align-items: center;
  min-height: 86px;
  padding: 18px 22px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  transition:
    background 160ms ease,
    transform 160ms ease;
}

.song-row:last-child {
  border-bottom: 0;
}

.song-row:hover {
  background: rgba(103, 232, 249, 0.045);
}

.song-row.is-active {
  background:
    linear-gradient(90deg, rgba(103, 232, 249, 0.13), transparent 70%),
    rgba(15, 23, 42, 0.54);
}

.song-info {
  min-width: 0;
}

.song-title {
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.song-artist {
  margin: 6px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 16px;
  background: rgba(8, 13, 27, 0.76);
  color: var(--muted-strong);
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease,
    opacity 160ms ease;
}

.icon-button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(103, 232, 249, 0.62);
  color: var(--accent);
  background: rgba(15, 23, 42, 0.96);
}

.icon-button.is-active {
  border-color: rgba(103, 232, 249, 0.72);
  color: var(--accent);
  box-shadow: 0 0 0 4px rgba(103, 232, 249, 0.08);
}

.icon-button:disabled {
  opacity: 0.32;
  cursor: not-allowed;
}

.empty-state {
  padding: 44px 22px;
  text-align: center;
}

.empty-state h2 {
  margin: 0;
  font-size: 1.3rem;
}

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

.empty-state code,
.empty-state pre {
  color: var(--accent);
}

.empty-state pre {
  width: min(680px, 100%);
  margin: 18px auto 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(8, 13, 27, 0.78);
  padding: 18px;
  text-align: left;
}

.player-bar {
  position: fixed;
  right: 18px;
  bottom: 18px;
  left: 18px;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 560px);
  gap: 18px;
  align-items: center;
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 24px;
  background: var(--panel-strong);
  padding: 16px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.now-playing {
  min-width: 0;
}

.now-playing .label {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.now-playing h2 {
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.now-playing p:last-child {
  margin: 5px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.88rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

audio {
  width: 100%;
  accent-color: var(--accent);
}

@media (max-width: 780px) {
  body {
    padding-bottom: 190px;
  }

  .topbar {
    display: grid;
  }

  .toolbar {
    grid-template-columns: 1fr;
  }

  .refresh-button {
    width: 100%;
  }

  .table-head {
    display: none;
  }

  .song-row {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .source-actions {
    justify-content: flex-start;
  }

  .player-bar {
    grid-template-columns: 1fr;
  }
}
