
:root {
  --bg: #000;
  --panel: #121212;
  --card: #181818;
  --card-hover: #282828;
  --text: #fff;
  --muted: #b3b3b3;
  --green: #1ed760;
  --green-hover: #3be477;
  --line: rgba(255, 255, 255, 0.1);
  --hue: #2a3b55;
  --a: 0;
  --topbar-h: 64px;
  --side-w: 300px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  font: 14px "Circular Std", "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button {
  font-family: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

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

input {
  font-family: inherit;
}

img {
  display: block;
}

svg {
  display: block;
}

.hidden {
  display: none !important;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

#main::-webkit-scrollbar,
.lib-list::-webkit-scrollbar,
#queue::-webkit-scrollbar {
  width: 12px;
}

#main::-webkit-scrollbar-thumb,
.lib-list::-webkit-scrollbar-thumb,
#queue::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.28);
  border: 3px solid transparent;
  background-clip: padding-box;
  border-radius: 6px;
}

#app {
  display: grid;
  height: 100vh;
  padding: 8px;
  gap: 8px;
  grid-template-columns: var(--side-w) 1fr;
  grid-template-rows: minmax(0, 1fr) auto;
  grid-template-areas: "side main" "player player";
}

#app.queue-open {
  grid-template-columns: var(--side-w) 1fr 330px;
  grid-template-areas: "side main queue" "player player player";
}

.panel {
  background: var(--panel);
  border-radius: 8px;
}

#sidebar {
  grid-area: side;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.nav-panel {
  padding: 8px 12px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 40px;
  padding: 0 12px;
  font-size: 16px;
  font-weight: 700;
  color: var(--muted);
  transition: color 0.2s;
}

.nav-item:hover,
.nav-item.active {
  color: #fff;
}

.nav-item svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.lib-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.lib-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 8px 0 20px;
  flex-shrink: 0;
}

.lib-title {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-weight: 700;
  font-size: 16px;
}

.lib-title svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--muted);
}

.icon-btn:hover {
  color: #fff;
  background: #1f1f1f;
}

.icon-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.lib-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 8px 8px;
}

.lib-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: 6px;
  cursor: pointer;
}

.lib-item:hover {
  background: #1a1a1a;
}

.lib-item.active {
  background: #232323;
}

.lib-img {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 4px;
  background: #282828;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: var(--muted);
}

.lib-img svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

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

.lib-img.liked {
  background: linear-gradient(135deg, #450af5, #8e8ee5);
  color: #fff;
}

.lib-img.round {
  border-radius: 50%;
}

.lib-img.grid4 {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.lib-text {
  min-width: 0;
}

.lib-name {
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lib-sub {
  margin-top: 2px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lib-promo {
  background: #242424;
  border-radius: 8px;
  padding: 16px 20px 20px;
  margin: 8px 8px 0;
}

.lib-promo b {
  display: block;
  font-size: 16px;
  margin-bottom: 8px;
}

.lib-promo p {
  margin-bottom: 20px;
}

.pill {
  display: inline-block;
  padding: 8px 32px;
  border-radius: 500px;
  background: #fff;
  color: #000;
  font-weight: 700;
  transition: transform 0.1s;
}

.pill:hover {
  transform: scale(1.04);
}

.pill.small {
  padding: 6px 16px;
}

.pill.ghost {
  background: transparent;
  color: #fff;
}

.pill.outline {
  background: transparent;
  color: #fff;
  border: 1px solid #7c7c7c;
  padding: 7px 16px;
}

.pill.outline:hover {
  border-color: #fff;
}

.pill.green {
  background: var(--green);
}

#main {
  grid-area: main;
  position: relative;
  background: var(--panel);
  border-radius: 8px;
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
}

#bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 360px;
  background: linear-gradient(180deg, var(--hue) 0%, var(--panel) 100%);
  opacity: 0.6;
  pointer-events: none;
  transition: background 0.4s;
}

#topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--topbar-h);
  margin-bottom: calc(var(--topbar-h) * -1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: rgba(18, 18, 18, var(--a));
}

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

.circle-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.circle-btn svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
  width: min(364px, 40vw);
  height: 48px;
  padding: 0 12px;
  background: #242424;
  border-radius: 500px;
  border: 2px solid transparent;
  color: var(--muted);
}

.search-box:hover {
  background: #2a2a2a;
  color: #fff;
}

.search-box:focus-within {
  border-color: #fff;
  color: #fff;
}

.search-box svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
  flex-shrink: 0;
}

.search-box input {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  outline: none;
  color: #fff;
  font-size: 16px;
}

.search-box input::placeholder {
  color: #8a8a8a;
}

.search-box button {
  display: flex;
  color: var(--muted);
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #1f1f1f;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar span {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #535353;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar svg {
  width: 20px;
  height: 20px;
  fill: #fff;
}

#view {
  position: relative;
  z-index: 1;
  padding: var(--topbar-h) 24px 32px;
  min-height: 100%;
}

.spinner {
  width: 40px;
  height: 40px;
  margin: 140px auto;
  border: 4px solid #333;
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.empty {
  text-align: center;
  padding: 80px 20px;
}

.empty h2 {
  font-size: 24px;
  margin-bottom: 8px;
}

.empty p {
  color: var(--muted);
  margin-bottom: 24px;
}

.footer-note {
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.greeting {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.5px;
  padding-top: 8px;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.quick {
  position: relative;
  display: flex;
  align-items: center;
  height: 64px;
  border-radius: 4px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
}

.quick:hover {
  background: rgba(255, 255, 255, 0.2);
}

.quick img,
.quick .quick-ph {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  object-fit: cover;
  background: #333;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.4);
}

.quick .quick-ph {
  display: flex;
  align-items: center;
  justify-content: center;
}

.quick .quick-ph.liked {
  background: linear-gradient(135deg, #450af5, #8e8ee5);
}

.quick .quick-ph svg {
  width: 26px;
  height: 26px;
  fill: #fff;
}

.quick .q-name {
  flex: 1;
  min-width: 0;
  padding: 0 16px;
  font-weight: 700;
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quick .card-play {
  right: 16px;
  bottom: auto;
  top: 8px;
}

.shelf {
  margin-top: 32px;
}

.shelf-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 4px;
}

.shelf-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.shelf-more {
  color: var(--muted);
  font-weight: 700;
  padding-bottom: 2px;
}

.shelf-more:hover {
  text-decoration: underline;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
  grid-auto-rows: 0;
  overflow: hidden;
  margin: 0 -6px;
}

.grid.wrap {
  grid-auto-rows: auto;
}

.grid > .card {
  margin: 6px;
}

.card {
  position: relative;
  min-width: 0;
  padding: 16px;
  background: var(--card);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s;
}

.card:hover {
  background: var(--card-hover);
}

.card-img-wrap {
  position: relative;
  margin-bottom: 16px;
}

.card-img {
  width: 100%;
  aspect-ratio: 1/1;
  border-radius: 6px;
  overflow: hidden;
  background: #333;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.card-img svg {
  width: 40%;
  fill: #777;
}

.card.round .card-img {
  border-radius: 50%;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-sub {
  line-height: 20px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-play {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 8px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s, transform 0.3s;
}

.card:hover .card-play,
.quick:hover .card-play,
.top-card:hover .card-play,
.card-play:focus-visible {
  opacity: 1;
  transform: none;
}

.card-play:hover {
  background: var(--green-hover);
  transform: scale(1.06) !important;
}

.card-play svg {
  width: 24px;
  height: 24px;
  fill: #000;
}

.entity-head {
  display: flex;
  align-items: flex-end;
  gap: 24px;
  min-height: 300px;
  padding: 24px 0;
}

.entity-cover {
  width: 232px;
  height: 232px;
  flex-shrink: 0;
  border-radius: 4px;
  overflow: hidden;
  background: #282828;
  box-shadow: 0 4px 60px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #7f7f7f;
}

.entity-cover.round {
  border-radius: 50%;
}

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

.entity-cover svg {
  width: 64px;
  height: 64px;
  fill: currentColor;
}

.entity-cover.liked {
  background: linear-gradient(135deg, #450af5, #8e8ee5);
  color: #fff;
}

.entity-cover.grid4 {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

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

.entity-type {
  font-weight: 700;
}

.entity-title {
  margin: 8px 0 12px;
  font-size: 96px;
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.05;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.entity-title.mid {
  font-size: 64px;
}

.entity-title.small {
  font-size: 40px;
}

.entity-meta {
  color: #e6e6e6;
  line-height: 1.5;
}

.entity-meta .bold {
  font-weight: 700;
  color: #fff;
}

.entity-meta a:hover {
  text-decoration: underline;
}

.entity-meta .dim {
  color: #cfcfcf;
}

.actions {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 24px 0;
}

.big-play {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s;
}

.big-play:hover {
  transform: scale(1.06);
  background: var(--green-hover);
}

.big-play svg {
  width: 28px;
  height: 28px;
  fill: #000;
}

.act-btn {
  color: var(--muted);
  display: flex;
  align-items: center;
  font-weight: 700;
}

.act-btn:hover {
  color: #fff;
}

.act-btn svg {
  width: 32px;
  height: 32px;
  fill: currentColor;
}

.t-head,
.t-row {
  display: grid;
  grid-template-columns: 24px minmax(120px, 6fr) 32px 56px 32px;
  gap: 16px;
  align-items: center;
  padding: 0 16px;
}

.tracks.album-col .t-head,
.tracks.album-col .t-row {
  grid-template-columns: 24px minmax(120px, 6fr) minmax(100px, 4fr) 32px 56px 32px;
}

.t-head {
  height: 36px;
  margin-bottom: 8px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}

.t-head .t-time-h {
  display: flex;
  justify-content: flex-end;
}

.t-head svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.t-num-h {
  text-align: center;
  font-size: 16px;
}

.t-row {
  height: 56px;
  border-radius: 4px;
  color: var(--muted);
}

.t-row:hover {
  background: rgba(255, 255, 255, 0.1);
}

.t-row.selected {
  background: rgba(255, 255, 255, 0.2);
}

.t-row.unavailable {
  opacity: 0.4;
}

.t-num {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
}

.t-num .num-play {
  display: none;
}

.t-num .num-play svg {
  width: 20px;
  height: 20px;
  fill: #fff;
}

.t-row:hover .t-num .num-text {
  display: none;
}

.t-row:hover .t-num .num-play {
  display: block;
}

.eq {
  display: none;
  width: 14px;
  height: 14px;
  align-items: flex-end;
  gap: 2px;
}

.eq i {
  flex: 1;
  background: var(--green);
  animation: eq 0.9s infinite ease-in-out;
}

.eq i:nth-child(1) {
  animation-delay: -0.5s;
}

.eq i:nth-child(2) {
  animation-delay: -0.25s;
}

@keyframes eq {
  0%,
  100% {
    height: 25%;
  }

  50% {
    height: 100%;
  }
}

body.paused .eq i {
  animation-play-state: paused;
}

.t-row.playing .eq {
  display: flex;
}

.t-row.playing .num-text {
  display: none;
}

.t-row.playing:hover .eq {
  display: none;
}

.t-row.playing .t-title {
  color: var(--green);
}

.t-main {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.t-main img {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  background: #333;
}

.t-text {
  min-width: 0;
}

.t-title {
  font-size: 16px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.t-artist {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.t-row:hover .t-artist,
.t-row:hover .t-album {
  color: #fff;
}

.t-artist a:hover,
.t-album a:hover {
  text-decoration: underline;
}

.explicit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 2px;
  background: #b3b3b3;
  color: #000;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}

.t-album {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.t-heart,
.t-more {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  opacity: 0;
}

.t-row:hover .t-heart,
.t-row:hover .t-more,
.t-heart.liked,
.t-heart:focus-visible,
.t-more:focus-visible {
  opacity: 1;
}

.t-heart:hover,
.t-more:hover {
  color: #fff;
}

.t-heart.liked {
  color: var(--green);
}

.t-heart svg,
.t-more svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.t-time {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.tracks.collapsed .t-row:nth-child(n+6) {
  display: none;
}

.see-more {
  margin: 8px 0 0 16px;
  color: var(--muted);
  font-weight: 700;
}

.see-more:hover {
  color: #fff;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.chip {
  padding: 8px 14px;
  border-radius: 500px;
  background: rgba(255, 255, 255, 0.1);
}

.chip:hover {
  background: rgba(255, 255, 255, 0.2);
}

.chip.active {
  background: #fff;
  color: #000;
}

.genre-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 24px;
  margin-top: 16px;
}

.genre-card {
  position: relative;
  aspect-ratio: 1/1;
  padding: 16px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  transition: transform 0.15s;
}

.genre-card:hover {
  transform: scale(1.02);
}

.top-grid {
  display: grid;
  grid-template-columns: minmax(280px, 2fr) 5fr;
  gap: 24px;
  margin-top: 24px;
}

.top-card {
  position: relative;
  min-height: 240px;
  padding: 20px;
  background: var(--card);
  border-radius: 8px;
  cursor: pointer;
}

.top-card:hover {
  background: var(--card-hover);
}

.top-card img,
.top-card .ph {
  width: 100px;
  height: 100px;
  margin-bottom: 20px;
  border-radius: 4px;
  object-fit: cover;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  background: #333;
}

.top-card .ph {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.top-card .ph svg {
  width: 44px;
  height: 44px;
  fill: #888;
}

.top-card .name {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-card .tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 500px;
  background: #121212;
  font-weight: 700;
}

.top-card .sub {
  color: var(--muted);
  margin-right: 8px;
}

.top-card .card-play {
  right: 20px;
  bottom: 20px;
}

.section-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

#player {
  grid-area: player;
  display: grid;
  grid-template-columns: minmax(180px, 30%) minmax(280px, 40%) minmax(180px, 30%);
  align-items: center;
  justify-content: space-between;
  height: 72px;
  padding: 0 8px;
}

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

.np-cover {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 4px;
  background: #282828;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6a6a6a;
}

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

.np-cover svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.np-text {
  min-width: 0;
}

.np-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.np-title a:hover,
.np-artist a:hover {
  text-decoration: underline;
}

.np-artist {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.np-artist a:hover {
  color: #fff;
}

.controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  max-width: 722px;
  width: 100%;
  margin: 0 auto;
}

.ctrl-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.ctrl {
  position: relative;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.ctrl:hover {
  color: #fff;
}

.ctrl svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.ctrl.on {
  color: var(--green);
}

.ctrl.on::after {
  content: "";
  position: absolute;
  bottom: 1px;
  left: 50%;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: currentColor;
}

.ctrl.heart-ctrl.liked {
  color: var(--green);
}

.ctrl.heart-ctrl.liked::after {
  display: none;
}

.ctrl.play-main {
  border-radius: 50%;
  background: #fff;
  color: #000;
}

.ctrl.play-main:hover {
  transform: scale(1.06);
  color: #000;
}

.progress-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.time {
  min-width: 40px;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.right-ctrl {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

input[type="range"].bar {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 12px;
  background: transparent;
  cursor: pointer;
  outline: none;
  --c: #fff;
  --fill: 0%;
}

input[type="range"].bar:hover {
  --c: var(--green);
}

input[type="range"].bar::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(to right, var(--c) var(--fill), #4d4d4d var(--fill));
}

input[type="range"].bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  margin-top: -4px;
  border-radius: 50%;
  background: #fff;
  opacity: 0;
}

input[type="range"].bar:hover::-webkit-slider-thumb {
  opacity: 1;
}

input[type="range"].bar::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: #4d4d4d;
}

input[type="range"].bar::-moz-range-progress {
  height: 4px;
  border-radius: 2px;
  background: var(--c);
}

input[type="range"].bar::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: none;
  border-radius: 50%;
  background: #fff;
  opacity: 0;
}

input[type="range"].bar:hover::-moz-range-thumb {
  opacity: 1;
}

input[type="range"].vol {
  width: 100px;
}

#queue {
  grid-area: queue;
  display: none;
  background: var(--panel);
  border-radius: 8px;
  overflow-y: auto;
  padding: 16px 8px;
}

#app.queue-open #queue {
  display: block;
}

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

.q-head h2 {
  font-size: 16px;
}

.q-label {
  padding: 16px 8px 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--muted);
}

.q-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: 4px;
  cursor: pointer;
}

.q-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.q-item img {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  object-fit: cover;
  background: #333;
}

.q-item .q-t {
  min-width: 0;
}

.q-item .q-title {
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.q-item.now .q-title {
  color: var(--green);
}

.q-item .q-artist {
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.q-empty {
  padding: 24px 8px;
  color: var(--muted);
}

#menu {
  position: fixed;
  z-index: 200;
  display: none;
  min-width: 220px;
  padding: 4px;
  background: #282828;
  border-radius: 4px;
  box-shadow: 0 16px 24px rgba(0, 0, 0, 0.3);
}

.menu-item {
  display: block;
  width: 100%;
  padding: 12px;
  border-radius: 2px;
  text-align: left;
  color: #e8e8e8;
}

.menu-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.menu-sep {
  height: 1px;
  margin: 4px 0;
  background: rgba(255, 255, 255, 0.1);
}

#modal-back {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
}

.modal {
  width: min(480px, 92vw);
  max-height: 80vh;
  overflow-y: auto;
  padding: 24px;
  background: #282828;
  border-radius: 8px;
}

.modal h2 {
  font-size: 24px;
  margin-bottom: 20px;
}

.modal input.text {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 4px;
  outline: none;
  background: #3e3e3e;
  color: #fff;
  font-size: 14px;
}

.modal input.text:focus {
  box-shadow: 0 0 0 2px #fff;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  margin-top: 24px;
}

.pick {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px;
  border-radius: 4px;
  text-align: left;
}

.pick:hover {
  background: rgba(255, 255, 255, 0.1);
}

.pick .lib-img {
  width: 40px;
  height: 40px;
}

#toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  z-index: 400;
  padding: 12px 24px;
  border-radius: 6px;
  background: #fff;
  color: #000;
  font-weight: 700;
  opacity: 0;
  transform: translate(-50%, 16px);
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
}

#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 1100px) {
  :root {
    --side-w: 72px;
  }

  .lbl,
  .lib-promo,
  .lib-title,
  .lib-text {
    display: none !important;
  }

  .nav-item {
    justify-content: center;
    padding: 0;
  }

  .lib-head {
    justify-content: center;
    padding: 0;
  }

  .lib-item {
    justify-content: center;
  }

  #app.queue-open {
    grid-template-columns: var(--side-w) 1fr 280px;
  }

  .entity-title {
    font-size: 64px;
  }

  .entity-title.mid {
    font-size: 48px;
  }
}

@media (max-width: 760px) {
  #app,
  #app.queue-open {
    grid-template-columns: 1fr;
    grid-template-areas: "main" "player";
  }

  #sidebar,
  #queue {
    display: none !important;
  }

  #player {
    grid-template-columns: 1fr auto;
    height: 64px;
  }

  .right-ctrl,
  .time,
  .progress-row {
    display: none;
  }

  .controls {
    width: auto;
  }

  .ctrl-row .ctrl:not(.play-main):not(.skip) {
    display: none;
  }

  .entity-head {
    flex-direction: column;
    align-items: flex-start;
    min-height: 0;
  }

  .entity-cover {
    width: 160px;
    height: 160px;
  }

  .entity-title {
    font-size: 40px;
  }

  .tracks.album-col .t-head,
  .tracks.album-col .t-row {
    grid-template-columns: 24px minmax(100px, 1fr) 32px 56px 32px;
  }

  .t-album,
  .t-head .album-h {
    display: none;
  }

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

  .search-box {
    width: 200px;
  }
}

.select {
  padding: 8px 10px;
  background: #3e3e3e;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  max-width: 220px;
}

.set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.set-row label {
  font-size: 16px;
}

.set-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: #1ed760;
}

.set-help {
  color: #b3b3b3;
  font-size: 12px;
  margin: 6px 0 0;
}

.set-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.kbd-table {
  width: 100%;
  border-collapse: collapse;
}

.kbd-table td {
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.kbd-table td:first-child {
  width: 190px;
}

kbd {
  display: inline-block;
  min-width: 24px;
  padding: 2px 8px;
  border-radius: 4px;
  background: #3e3e3e;
  border-bottom: 2px solid #1a1a1a;
  font: 12px/1.6 monospace;
  text-align: center;
}

.sleep-list {
  display: grid;
  gap: 4px;
}

.sleep-list .pick {
  font-size: 16px;
  padding: 12px;
}

.info-table {
  width: 100%;
  border-collapse: collapse;
}

.info-table td {
  padding: 8px 0;
  vertical-align: top;
}

.info-table td:first-child {
  color: #b3b3b3;
  width: 110px;
}

.page-title {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.5px;
  padding-top: 8px;
}

.page-sub {
  color: var(--muted);
  margin-top: 4px;
}

.stat-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.stat-tile {
  padding: 20px;
  background: var(--card);
  border-radius: 8px;
}

.stat-tile b {
  display: block;
  font-size: 36px;
  letter-spacing: -1px;
  margin-bottom: 4px;
}

.stat-tile span {
  color: var(--muted);
}

.bar-row {
  display: grid;
  grid-template-columns: 180px 1fr 40px;
  gap: 12px;
  align-items: center;
  margin: 8px 0;
}

.bar-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-track {
  height: 8px;
  background: #333;
  border-radius: 4px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--green);
  border-radius: 4px;
}

.bar-n {
  text-align: right;
  color: var(--muted);
}

.recent-searches {
  margin: 8px 0 24px;
}

.recent-searches h3 {
  font-size: 16px;
  margin-bottom: 8px;
}

.chip.clear {
  background: transparent;
  border: 1px solid #7c7c7c;
}

@media (max-width: 760px) {
  .bar-row {
    grid-template-columns: 110px 1fr 32px;
  }

  .kbd-table td:first-child {
    width: 130px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
