/* ===== Shared components: nav, cards, chips, track rows, menus, tooltips, toasts ===== */

/* ---------- sidebar ---------- */
.nav-pane { padding: 14px 10px; display: flex; flex-direction: column; gap: 6px; }
.brand { padding: 4px 8px 12px; display: block; }
.nav-item {
  display: flex; align-items: center; gap: 16px;
  color: var(--text-subdued); font-weight: 700; font-size: .98rem;
  padding: 9px 12px; border-radius: 6px; width: calc(var(--sidebar-nav-w) - 20px);
}
.nav-item:hover, .nav-item.active { color: #fff; }
.lib-pane { flex: 1; min-height: 0; display: flex; flex-direction: column; width: var(--sidebar-lib-w); padding: 10px; }
.lib-header { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px; }
.lib-title-btn { display: flex; gap: 12px; align-items: center; color: var(--text-subdued); font-weight: 800; }
.lib-title-btn:hover { color: #fff; }
.icon-pill {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; color: var(--text-subdued);
}
.icon-pill:hover { color: #fff; background: var(--bg-card-hover); transform: scale(1.05); }
.chip-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 8px 10px; }
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  background: var(--bg-card-hover); color: #fff;
  border-radius: var(--radius-pill); font-size: .78rem; font-weight: 600;
  padding: 7px 13px; white-space: nowrap;
}
.chip.on { background: #fff; color: #000; }
.chip.lg { background: hsla(0,0%,100%,.08); }
.chip.lg.on { background: #fff; color: #000; }
.lib-list { flex: 1; overflow-y: auto; padding: 0 4px 20px; }
.lib-row {
  display: grid; grid-template-columns: 48px 1fr; gap: 12px; align-items: center;
  padding: 6px 8px; border-radius: 6px;
}
.lib-row img { width: 48px; height: 48px; object-fit: cover; border-radius: 4px; }
.lib-row:hover { background: hsla(0,0%,100%,.07); }
.lib-line1 { font-size: .92rem; font-weight: 500; }
.lib-line2 { font-size: .8rem; margin-top: 2px; }
.liked-cover {
  background: linear-gradient(135deg, #450af5, #c4efd9);
  border-radius: 4px; display: grid; place-items: center; color: #fff;
}
.liked-cover .icon { filter: drop-shadow(0 1px 3px rgba(0,0,0,.45)); }
.up-cover { width: 48px; height: 48px; border-radius: 4px; background: #333; display: grid; place-items: center; overflow: hidden; }
.up-cover.big { width: 168px; height: 168px; border-radius: 6px; position: relative; }
.up-cover img { width: 100%; height: 100%; object-fit: cover; }
.lib-empty { padding: 18px 10px; font-size: .85rem; }

/* generic icon */
.icon { display: inline-grid; place-items: center; line-height: 0; }

/* ---------- cards / shelves ---------- */
.shelf { position: relative; margin: 26px 0 30px; }
.shelf-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 12px; gap: 12px; }
.shelf-title { cursor: pointer; }
.shelf-title:hover { text-decoration: underline; }
.show-all {
  color: var(--text-subdued); font-size: .8rem; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; white-space: nowrap; opacity: 0;
  transition: opacity var(--dur-fast) ease;
}
.shelf:hover .show-all, .show-all:focus-visible { opacity: 1; }
.show-all:hover { text-decoration: underline; color: var(--text-bright-accent); }

.shelf-rail-wrap { position: relative; overflow: hidden; border-radius: var(--radius-md); }
.shelf-rail {
  display: flex; gap: 6px;
  overflow-x: auto; scrollbar-width: none;
  scroll-snap-type: x proximity;
  padding-bottom: 6px;
  overscroll-behavior-x: contain;
}
.shelf-rail::-webkit-scrollbar { display: none; }
.rail-chevron {
  position: absolute; top: 40%; z-index: 5;
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(10,10,10,.86); color: #fff;
  display: none; place-items: center;
}
.rail-chevron.prev { left: -6px; }
.rail-chevron.next { right: -6px; }
.shelf:hover .rail-chevron:not(:disabled), .rail-chevron:focus-visible { display: grid; }
.rail-chevron:hover { scale: 1.1; }

.media-card {
  position: relative;
  background: transparent;
  border-radius: 8px;
  padding: 12px;
  transition: background-color .35s ease;
  cursor: pointer;
  flex: none;
  width: 178px;
  scroll-snap-align: start;
}
.media-card:hover { background: var(--bg-card-hover); }
.card-img, .card-img-holder { width: 100%; aspect-ratio: 1; border-radius: 6px; object-fit: cover; box-shadow: 0 8px 24px rgba(0,0,0,.5); }
.round { border-radius: 50% !important; }
.artist-img-wrap { border-radius: 50%; overflow: hidden; }
.card-body { margin-top: 12px; }
.card-title { font-weight: 600; font-size: .96rem; }
.card-sub { color: var(--text-subdued); font-size: .82rem; margin-top: 4px; }

/* hover play button rises over artwork */
.card-art-overlay { pointer-events: none; position: absolute; inset: 12px auto auto 12px; z-index: 2; }
.card-play-btn {
  pointer-events: auto;
  position: absolute; right: 10px; bottom: 88px;
  translate: 0 8px;
  opacity: 0;
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--green); color: #000;
  display: grid; place-items: center;
  box-shadow: 0 8px 16px rgba(0,0,0,.5);
  transition: all .25s var(--ease-momentum);
  z-index: 6;
}
.media-card:hover .card-play-btn, .card-play-btn:focus-visible, .card-play-btn.static.on-topresult {
  opacity: 1; translate: 0 0;
}
.card-play-btn:hover { transform: scale(1.05); background: var(--green-dark); color:#fff; }
.artist-card .card-play-btn { bottom: 132px; }

/* panoramic promo shelf (private territory) */
.is-promo .shelf-rail-wrap::before { content: ""; }
.promo-backdrop {
  position: absolute; inset: -26px -60px 0; z-index: 0;
  overflow: hidden; border-radius: var(--radius-lg);
  mask-image: linear-gradient(180deg, #000 72%, transparent);
}
.promo-pan {
  position: absolute; inset: 0;
  background:
    radial-gradient(58vw 90px at 20% 108%, hsla(160,70%,44%,.32), transparent),
    radial-gradient(64vw 120px at 55% 120%, hsla(255,66%,54%,.30), transparent),
    radial-gradient(72vw 140px at 90% 128%, hsla(24,85%,56%,.28), transparent);
  will-change: transform;
}
.shelf-rail.promo { position: relative; }
.promo-copy {
  flex: none; width: 240px; align-self: center;
  padding: 0 22px 22px 4px; z-index: 1;
}
.promo-copy .light { color: hsla(0,0%,100%,.55); }
.promo-title { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; margin-top: 6px; }
.promo-sub { font-size: .84rem; margin-top: 8px; max-width: 210px; }
.is-promo .media-card { z-index: 1; }

/* quick tiles on home */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px; margin: 22px 0 10px;
}
.quick-tile {
  position: relative;
  display: flex; align-items: center; gap: 2px;
  background: hsla(0,0%,100%,.09);
  border-radius: 6px; overflow: hidden;
  transition: background-color .3s ease;
  cursor: pointer; min-height: 64px;
}
.quick-tile img { width: 64px; height: 64px; object-fit: cover; }
.quick-label { flex: 1; font-weight: 700; padding-right: 52px; }
.quick-play {
  position: absolute; right: 12px; bottom: 9px;
  opacity: 0; translate: 0 6px;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--green); color: #000;
  display: grid; place-items: center;
  box-shadow: 0 6px 14px rgba(0,0,0,.5);
  transition: all .22s var(--ease-momentum);
}
.quick-tile:hover { background: hsla(0,0%,100%,.16); }
.quick-tile:hover .quick-play { opacity: 1; translate: 0 0; }
.quick-play:hover { transform: scale(1.06); background: var(--green-dark); color: #fff; }

/* ---------- category tiles (search browse) ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 20px; margin-top: 20px; }
.cat-tile {
  position: relative; aspect-ratio: 1.02/1; border-radius: var(--radius-md);
  background: var(--cat-color); overflow: hidden;
  text-align: left; isolation: isolate;
}
.cat-name { position: absolute; top: 14px; left: 14px; z-index: 2; letter-spacing: -.01em; }
.cat-art {
  position: absolute; right: -22px; bottom: -16px; width: 46%; aspect-ratio: 1;
  rotate: 26deg; border-radius: 4px; z-index: 1;
  box-shadow: 0 4px 26px rgba(0,0,0,.35);
  background-image:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,.34), transparent 62%),
    repeating-linear-gradient(135deg, rgba(255,255,255,.13) 0 6px, transparent 6px 15px);
}
.cat-tile:hover { filter: brightness(1.09); }

/* ---------- detail pages ---------- */
.detail-hero { position: relative; padding: 0 0 22px; }
.hero-bg { position: absolute; inset: calc(-1 * var(--topbar-h)) calc(-1 * var(--gutter-x)) -170px; z-index: -1; }
.hero-inner { display: flex; align-items: flex-end; gap: 22px; padding-top: 74px; }
.hero-art-holder img, .hero-art-holder .pcov, .hero-art-holder .liked-cover {
  width: clamp(150px, 21vw, 234px); aspect-ratio: 1; object-fit: cover;
  border-radius: 8px; box-shadow: 0 16px 60px rgba(0,0,0,.55);
}
.hero-kind { font-size: .8rem; font-weight: 700; }
.hero-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 14px; font-size: .88rem; }
.meta-artist-img, .meta-owner-dot { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.artist-chip b:hover { text-decoration: underline; }
.dot-sep { margin: 0 2px; color: var(--text-subdued); }
.detail-actions { display: flex; align-items: center; gap: 22px; padding: 22px 0 12px; }
.big-play-fab {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--green); color: #000; display: grid; place-items: center;
  transition: transform .12s ease, filter .2s ease;
  box-shadow: 0 8px 22px rgba(30,215,96,.24);
}
.big-play-fab:hover { transform: scale(1.04); }
.circle-action {
  width: 46px; height: 46px; border-radius: 50%;
  color: var(--text-subdued); display: grid; place-items: center;
}
.circle-action:hover, .circle-action.on { color: var(--green); scale: 1.06; }

.tracklist-wrap { border-top: 1px solid hsla(0,0%,100%,.09); padding-top: 14px; }
.tracklist-wrap.with-head > .track-row.head { display: grid; }
.track-row.head .cell { color: var(--text-subdued); font-size: .74rem; letter-spacing: .05em; }

.track-row {
  display: grid;
  grid-template-columns: 16px minmax(0, 6fr) minmax(0, 4fr) minmax(0, 3fr) 76px;
  gap: 16px; align-items: center;
  border-radius: 4px; padding: 8px 12px;
  font-size: .9rem;
}
.track-row.head { margin-bottom: 4px; }
.track-row:not(.head):hover { background: hsla(0,0%,100%,.08); }
.tr-main.cell { grid-column: span 1; display: flex; align-items: center; gap: 12px; min-width: 0; }
.track-row.withhead2 {}
.tr-art { width: 40px; height: 40px; border-radius: 4px; object-fit: cover; }
.tr-title-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tr-title { font-weight: 500; }
.track-row.current .tr-title { color: var(--green); }
.explicit-badge {
  flex: none; background: hsla(0,0%,87%,.62); color: #111;
  border-radius: 2px; font-size: .56rem; font-weight: 800;
  width: 17px; height: 17px; display: inline-grid; place-items: center;
}
.tr-idx.cell.swappable { position: relative; }
.idx-state { display: inline-flex; }
.hover-play {
  position: absolute; inset: 0;
  display: none; place-items: center; color: #fff;
}
.track-row:hover .idx-num, .track-row:hover .eq-bars { visibility: hidden; }
.track-row:hover .hover-play { display: grid; }
.eq-bars { display: inline-flex; gap: 2.2px; height: 14px; align-items: flex-end; color: var(--green); }
.eq-bars i { width: 2.6px; background: currentColor; animation: eqb 1s ease-in-out infinite; }
.eq-bars i:nth-child(1){ animation-delay: -.1s; height: 40%; }
.eq-bars i:nth-child(2){ animation-delay: -.55s; height: 95%; }
.eq-bars i:nth-child(3){ animation-delay: -.3s; height: 65%; }
.eq-bars i:nth-child(4){ animation-delay: -.75s; height: 80%; }
@keyframes eqb { 0%,100%{ transform: scaleY(.35);} 50%{ transform: scaleY(1);} }

.track-row.detail-album {}
@media (max-width: 900px) {
  .track-row { grid-template-columns: 16px minmax(0,1fr) 76px; }
  .tr-album.cell, .tr-date.cell, .tr-plays.cell, .track-row.head .tr-album.cell,
  .track-row.head .tr-date.cell { display: none; }
}

.like-btn { color: var(--text-subdued); }
.like-btn:hover { color: #fff !important; }
.like-btn.active { color: var(--green); }
.tr-dur.cell { display: flex; align-items: center; gap: 14px; justify-content: flex-end; }
.dur-text { font-variant-numeric: tabular-nums; font-size: .8rem; }

/* search results */
.sr-hero { display: grid; grid-template-columns: minmax(280px, 4fr) 8fr; gap: 26px; margin-bottom: 26px; }
.top-result {
  position: relative; display: block; width: 100%;
  background: transparent; text-align: left;
  border-radius: var(--radius-md); padding: 18px;
  transition: background-color .3s ease;
}
.top-result:hover { background: var(--bg-card-hover); }
.top-result .tr-art-holder img, .top-result .pcov.small {
  width: 92px; height: 92px; border-radius: 50%; object-fit: cover;
  box-shadow: 0 10px 30px rgba(0,0,0,.5);
}
.pcov.mosaic { display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; }
.pcov.mosaic img { width: 100%; height: 100%; object-fit: cover; }
.pcov.mosaic.small { border-radius: 50%; }
.top-result .pcov.small { grid-template-columns: 1fr 1fr; width: 92px; height: 92px; }
.top-name { font-size: 1.6rem; font-weight: 800; letter-spacing: -.03em; margin: 14px 0 8px; }
.top-kind {
  display: inline-block; background: rgba(0,0,0,.6); border-radius: var(--radius-pill);
  font-size: .72rem; font-weight: 700; padding: 5px 10px;
}
.song-list .track-row { grid-template-columns: 16px minmax(0,1fr) 76px; }
.empty-state { padding: 30vh 4vw 0; text-align: center; }
.empty-state.center-page { padding: 8vh 4vw 0; }
.empty-state p { margin-top: 10px; }
.btn.white-pill { background: #fff; color: #000; font-weight: 700; border-radius: var(--radius-pill); padding: 11px 22px; margin-top: 22px; }
.btn.white-pill:hover { scale: 1.03; }

/* library page */
.library-view .t-title-xl { font-size: clamp(1.6rem, 3vw, 3rem); }
.libpage-controls { display: flex; gap: 8px; margin: 18px 0 6px; }
.controls-row.right { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 18px; }
.sort-select {
  background: var(--bg-card-hover); color: #fff; border-radius: var(--radius-pill);
  font-size: .8rem; padding: 8px 12px; appearance: auto;
}
.lib-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.lib-cards .media-card { width: auto; }
.lib-cards.as-list { display: flex; flex-direction: column; }

/* context menu */
.ctx-menu {
  position: fixed; z-index: 200; min-width: 216px;
  background: var(--bg-menu); border-radius: 6px;
  box-shadow: 0 12px 36px rgba(0,0,0,.6);
  padding: 4px; animation: menuIn 90ms ease-out both;
}
@keyframes menuIn { from { opacity: 0; } to { opacity: 1; } }
.ctx-item {
  display: flex; width: 100%; justify-content: space-between; align-items: center;
  padding: 10px 12px; border-radius: 3px; text-align: left; font-size: .84rem;
}
.ctx-item:hover { background: hsla(0,0%,100%,.12); }
.ctx-item[aria-disabled="true"] { color: var(--text-subdued); }
.ctx-sep { border: 0; border-top: 1px solid hsla(0,0%,100%,.12); margin: 4px 6px; }
.ctx-arrow { margin-left: 20px; }
.ctx-sub { width: 230px; }

.tooltip {
  position: fixed; z-index: 300; pointer-events: none;
  background: #282828; color: #fff; font-size: .72rem; font-weight: 600;
  padding: 6px 9px; border-radius: 4px;
  opacity: 0; transform: translateY(2px);
  transition: opacity 90ms ease;
  box-shadow: 0 4px 12px rgba(0,0,0,.5);
  white-space: nowrap;
}
.tooltip.on { opacity: 1; }

.toast-holder {
  position: fixed; z-index: 400; left: 50%; bottom: calc(var(--np-bar-h) + 26px);
  transform: translateX(-50%);
  display: grid; gap: 8px; justify-items: center;
}
.toast-holder, .toast { pointer-events: none; }
.toast {
  background: #202020; border: 1px solid rgba(255,255,255,.14);
  color: #fff; font-weight: 700; font-size: .88rem;
  border-radius: var(--radius-pill);
  padding: 12px 22px;
  opacity: 0; transform: translateY(10px);
  transition: all var(--dur-med) var(--ease-momentum);
  box-shadow: 0 10px 30px rgba(0,0,0,.45);
}
.toast.on { opacity: 1; transform: translateY(0); }

/* skeletons */
.skel-boot, .skel-home { padding: 80px var(--gutter-x) 0; }
.skel-line { height: 22px; border-radius: 6px; background: hsla(0,0%,100%,.07); margin-bottom: 20px; }
.skel-cards { display: flex; gap: 10px; overflow: hidden; }
.skel-card {
  flex: none; width: 178px; aspect-ratio: 1.14;
  border-radius: 8px; background: hsla(0,0%,100%,.055);
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer {
  0% { opacity: .55; } 50% { opacity: 1; } 100% { opacity: .55; }
}

/* category page strip */
.cat-hero-strip { border-radius: var(--radius-md); padding: 80px var(--gutter-x) 42px; margin: -64px calc(var(--gutter-x) * -1) 18px; }
.category-grid, .category-view .category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 6px; }

.queue-h { font-size: 1rem; font-weight: 700; margin: 16px 0 8px; color: var(--text-subdued); text-transform: none; letter-spacing: 0; }
.queue-title { margin-top: 4px; }
.row-remove { opacity: 0; }
.track-row:hover .row-remove { opacity: 1; }
.clear-queue-btn { margin: 6px 8px 2px; color: var(--text-subdued); font-size: .78rem; font-weight: 700; }
.clear-queue-btn:hover { color: #fff; }
