:root {
  --bg: #ffffff;
  --bg-soft: #fafafa;
  --bg-elev: #ffffff;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --muted-2: #86868b;
  --accent: #00d95f;
  --accent-2: #00ffa3;
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.14);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.14);
  --radius: 14px;
  --radius-sm: 10px;
  --font-display: "Righteous", "Poppins", system-ui, sans-serif;
  --focus-ring: 0 0 0 3px rgba(0, 217, 95, 0.45);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-soft: #1c1c1e;
    --bg-elev: #1c1c1e;
    --text: #f5f5f7;
    --muted: #a1a1a6;
    --muted-2: #8e8e93;
    --border: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.18);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.6);
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  /* Don't let the browser auto-shift scroll when content above swaps
     (e.g. the centered loader is replaced by a long genre/artist list). */
  overflow-anchor: none;
  scroll-padding-top: 72px;
  background: var(--bg);
  color: var(--text);
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI",
               system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  touch-action: pan-x pan-y;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--accent); text-decoration: none; }
::selection { background: rgba(0, 217, 95, 0.2); }

/* Visible focus rings for keyboard users (a11y); pointer clicks stay clean. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Structural icons: scale to the button's font-size, render crisply. */
.glyph { display: inline-flex; align-items: center; justify-content: center; }
.glyph svg, .card .dl svg { width: 1em; height: 1em; display: block; }
.btn-play svg, .btn-ghost svg { width: 16px; height: 16px; display: block; }
#player-close svg { width: 16px; height: 16px; display: block; }

/* Inline spinner used inside buttons during async actions. */
.btn-spin {
  display: inline-block; width: 1em; height: 1em;
  border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; opacity: 0.75;
  animation: spin 0.65s linear infinite;
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr minmax(0, 520px) 1fr;
  gap: 16px;
  align-items: center;
  padding: 12px 22px;
}
.brand { justify-self: start; }
.topbar-inner .search-wrap { justify-self: stretch; width: 100%; }
.controls { justify-self: end; }

.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.logo { display: grid; place-items: center; height: 30px; }
.brand-mark { display: block; height: 30px; width: auto; }
.brand-name {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 400; letter-spacing: 0.2px;
}
.brand-name span { color: var(--accent); }

.controls { display: flex; gap: 10px; align-items: center; }

.search-wrap { position: relative; display: flex; align-items: center; }
.search-icon {
  position: absolute; left: 11px;
  width: 16px; height: 16px; color: var(--muted-2);
  pointer-events: none;
}
.search-wrap input,
.controls select {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 11px;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.search-wrap input { width: 100%; padding-left: 38px; text-align: center; }
.search-wrap input:focus { text-align: left; }
.search-wrap input::placeholder { color: var(--muted-2); }
.search-wrap input:focus,
.controls select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 217, 95, 0.15);
  background: var(--bg);
}

/* "Топ 100" nav toggle */
.nav-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 11px;
  height: 40px; padding: 0 15px;
  font-family: var(--font-display); font-size: 14px; letter-spacing: 0.3px;
  cursor: pointer; white-space: nowrap;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.nav-btn svg { width: 18px; height: 18px; }
.nav-btn:hover { color: var(--accent); border-color: var(--accent); }
.nav-btn.active {
  background: var(--accent); color: #fff; border-color: var(--accent);
}

.select-wrap { position: relative; display: flex; align-items: center; }
.controls select {
  appearance: none; -webkit-appearance: none;
  padding-right: 32px; cursor: pointer;
}
.controls select option { background: var(--bg); color: var(--text); }
.chevron {
  position: absolute; right: 9px;
  width: 16px; height: 16px; color: var(--muted-2);
  pointer-events: none;
}

/* ---------- main ---------- */
main { max-width: 1200px; margin: 0 auto; padding: 20px 22px 160px; }

.status {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: min(68vh, 560px);
  text-align: center;
  color: var(--muted); font-size: 15px;
}
.status:empty { display: none; }
.spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid var(--border-strong);
  border-top-color: var(--accent);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty {
  display: flex; align-items: center; justify-content: center;
  min-height: min(60vh, 480px);
  text-align: center;
  color: var(--muted); padding: 24px; font-size: 15px;
}

/* ---------- featured banner ---------- */
.featured {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  margin: 0 0 30px;
  isolation: isolate;
}
.featured-bg {
  position: absolute; inset: 0; z-index: -1;
  background-image: var(--art);
  background-size: cover; background-position: center;
  filter: blur(40px) saturate(160%) brightness(0.8);
  transform: scale(1.3);
}
.featured-bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(0,0,0,0.65), rgba(0,0,0,0.35));
}
.featured-inner {
  position: relative;
  display: flex; align-items: center; gap: 26px;
  padding: 32px;
}
.featured-art {
  width: 168px; height: 168px; flex: 0 0 auto;
  border-radius: 14px; object-fit: cover;
  box-shadow: 0 16px 40px rgba(0,0,0,0.45);
}
.featured-art.ph { background: rgba(255,255,255,0.15); }
.featured-info { min-width: 0; color: #fff; }
.featured-eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: rgba(255,255,255,0.85);
}
.featured-title {
  margin: 8px 0 4px;
  font-size: clamp(24px, 4vw, 40px); font-weight: 800; letter-spacing: -0.5px;
  line-height: 1.05;
}
.featured-title span { font-weight: 500; opacity: 0.7; }
.featured-artist { margin: 0 0 18px; font-size: 16px; color: rgba(255,255,255,0.9); }
.featured-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-play {
  display: inline-flex; align-items: center; gap: 7px;
  background: #fff; color: #000;
  border: 0; border-radius: 999px;
  padding: 10px 22px; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: transform 0.15s ease, background 0.15s ease;
}
.btn-play .glyph { color: var(--accent); }
.btn-play:hover { transform: scale(1.03); }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.18); color: #fff;
  border: 1px solid rgba(255,255,255,0.3); border-radius: 999px;
  padding: 10px 18px; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: background 0.15s ease;
}
.btn-ghost:hover { background: rgba(255,255,255,0.28); }
.btn-ghost:disabled { opacity: 0.6; cursor: default; }

/* White download CTA — clearly visible on the dark banner; states 320 kbps. */
.btn-white {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff; color: #111;
  border: 0; border-radius: 999px;
  padding: 10px 18px; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 6px 18px rgba(0,0,0,0.28);
}
.btn-white:hover { transform: scale(1.03); }
.btn-white:disabled { opacity: 0.7; cursor: default; }
.kbps { white-space: nowrap; }
.btn-white .kbps {
  font-size: 11px; font-weight: 700; line-height: 1;
  background: var(--accent); color: #fff;
  padding: 3px 6px; border-radius: 6px;
}
.featured-note {
  margin: 14px 0 0; font-size: 12.5px; font-weight: 500;
  color: rgba(255,255,255,0.8);
}

/* ---------- section / shelf headers ---------- */
.section-head, .shelf-head {
  display: flex; align-items: baseline; gap: 10px;
  margin: 26px 0 14px;
}
.section-head h2, .shelf-head h2 {
  margin: 0; font-family: var(--font-display);
  font-size: 22px; font-weight: 400; letter-spacing: 0.2px;
}
.section-head .count {
  font-size: 14px; color: var(--muted-2); font-weight: 500;
}

/* ---------- shelf (horizontal scroll) ---------- */
.shelf { margin-bottom: 6px; }
.shelf-track {
  display: flex; gap: 18px;
  overflow-x: auto;
  /* Negative margin + matching padding so the playing card's green outline
     (extends ~4px) isn't clipped at the edges, while cards stay aligned with
     the shelf header. */
  margin: 0 -8px;
  padding: 6px 8px 16px;
  /* Keep snapping from scrolling the side padding out of view, which would
     re-clip the first/last playing card's outline. */
  scroll-padding-inline: 8px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}
.shelf-track::-webkit-scrollbar { height: 8px; }
.shelf-track::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; }
.shelf-track .card { flex: 0 0 168px; scroll-snap-align: start; }

/* clickable genre shelf header → drills into that genre's Top 100 */
.shelf-head.shelf-more {
  background: none; border: 0; padding: 0; width: 100%; cursor: pointer;
  text-align: left; color: inherit; font: inherit;
  justify-content: flex-start;
}
.shelf-head.shelf-more h2 svg {
  width: 18px; height: 18px; vertical-align: -2px;
  color: var(--muted); opacity: 0; transform: translateX(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease, color 0.15s ease;
}
.shelf-head.shelf-more:hover h2 { color: var(--accent); }
.shelf-head.shelf-more:hover h2 svg { opacity: 1; transform: none; color: var(--accent); }
/* on touch the chevron affordance is always visible (no hover) */
@media (hover: none) { .shelf-head.shelf-more h2 svg { opacity: 1; transform: none; } }

/* ---------- artist results row + cards ---------- */
.artist-row {
  display: flex; gap: 18px; overflow-x: auto;
  padding: 4px 2px 16px; scroll-snap-type: x proximity; scrollbar-width: thin;
}
.artist-row::-webkit-scrollbar { height: 8px; }
.artist-row::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; }
.artist-card {
  flex: 0 0 132px; scroll-snap-align: start;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: none; border: 0; padding: 4px 0; cursor: pointer;
  color: inherit; font: inherit;
}
.artist-av-wrap {
  width: 124px; height: 124px; border-radius: 50%; overflow: hidden;
  box-shadow: var(--shadow-sm); transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.artist-card:hover .artist-av-wrap { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.artist-av { width: 100%; height: 100%; object-fit: cover; display: block; }
.artist-av.ph { background: linear-gradient(135deg, #e5e5ea, #d1d1d6); }
.artist-card-name {
  margin-top: 6px; font-size: 14px; font-weight: 600; text-align: center;
  max-width: 124px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.artist-card-sub {
  font-size: 12px; color: var(--muted); text-align: center;
  max-width: 124px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---------- artist profile hero ---------- */
.artist-hero {
  display: flex; align-items: center; gap: 22px;
  margin: 6px 0 22px;
}
.artist-hero-img {
  width: 132px; height: 132px; border-radius: 50%; object-fit: cover;
  box-shadow: var(--shadow-md); flex: 0 0 auto;
}
.artist-hero-img.ph { background: linear-gradient(135deg, #e5e5ea, #d1d1d6); }
.artist-hero-eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  color: var(--accent);
}
.artist-hero-name {
  margin: 6px 0 4px; font-family: var(--font-display); font-weight: 400;
  font-size: clamp(28px, 6vw, 44px); line-height: 1.05;
}
.artist-hero-sub { margin: 0; color: var(--muted); font-size: 15px; }

@media (max-width: 600px) {
  .artist-hero { gap: 16px; }
  .artist-hero-img { width: 96px; height: 96px; }
}

/* ---------- grid view ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 20px 18px;
}

/* ---------- card ---------- */
.card { min-width: 0; cursor: default; }
.card-art {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-soft);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover .card-art { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.card-art-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-art-img.ph { background: linear-gradient(135deg, #e5e5ea, #d1d1d6); }

.card-rank {
  position: absolute; top: 8px; left: 8px;
  min-width: 22px; height: 22px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
  background: rgba(0,0,0,0.55); border-radius: 7px;
  backdrop-filter: blur(4px);
}
.card-hype {
  position: absolute; top: 8px; right: 8px;
  font-size: 9.5px; font-weight: 800; letter-spacing: 0.5px; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  padding: 3px 6px; border-radius: 6px;
}

.card .play {
  position: absolute; left: 10px; bottom: 10px;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: rgba(255,255,255,0.92); color: #000;
  font-size: 15px; cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  opacity: 0; transform: translateY(6px);
  transition: opacity 0.18s ease, transform 0.18s ease, background 0.18s ease;
}
.card .play .glyph { color: var(--accent); }
.card-art:hover .play,
.card.is-playing .play,
.card.is-loading .play { opacity: 1; transform: translateY(0); }
.card .play:hover { background: #fff; }

/* White download pill — always visible, clearly readable, labels 320 kbps. */
.card .dl {
  position: absolute; right: 10px; bottom: 10px;
  display: inline-flex; align-items: center; gap: 4px;
  height: 32px; padding: 0 10px;
  border: 0; border-radius: 999px;
  background: rgba(255,255,255,0.96); color: #0a0a0a;
  font-size: 12px; font-weight: 700; cursor: pointer;
  backdrop-filter: blur(4px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  transition: transform 0.15s ease, background 0.15s ease;
}
.card .dl svg { width: 15px; height: 15px; }
.card .dl:hover { background: #fff; transform: translateY(-1px); }
.card .dl:disabled { opacity: 0.6; cursor: default; }

.card.is-playing .card-art { outline: 2px solid var(--accent); outline-offset: 2px; }

.card-title {
  margin-top: 9px; font-size: 14px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-artist {
  font-size: 13px; color: var(--muted); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---------- Top 100 list view ---------- */
.list-head {
  display: flex; align-items: center; gap: 14px;
  margin: 10px 0 18px;
}
.list-head h2 {
  margin: 0; font-family: var(--font-display);
  font-size: 28px; font-weight: 400; letter-spacing: 0.3px;
}
.list-head .count { color: var(--muted-2); font-size: 14px; }
.back-btn {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--bg-soft); border: 1px solid var(--border); color: var(--text);
  border-radius: 11px; height: 38px; padding: 0 14px 0 10px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease;
}
.back-btn svg { width: 20px; height: 20px; }
.back-btn:hover { color: var(--accent); border-color: var(--accent); }

.tracklist { display: flex; flex-direction: column; }
.track-row {
  display: flex; align-items: center; gap: 14px;
  padding: 8px 10px; border-radius: 12px;
  transition: background 0.15s ease;
}
.track-row + .track-row { border-top: 1px solid var(--border); border-radius: 0; }
.track-row:hover { background: var(--bg-soft); border-color: transparent; }
.track-row.is-playing { background: color-mix(in srgb, var(--accent) 12%, transparent); }

.tl-rank {
  width: 30px; flex: 0 0 auto; text-align: center;
  font-variant-numeric: tabular-nums; font-weight: 700;
  font-size: 15px; color: var(--muted-2);
}
.track-row.is-playing .tl-rank { color: var(--accent); }

.tl-art {
  position: relative; width: 52px; height: 52px; flex: 0 0 auto;
  border-radius: 9px; overflow: hidden; background: var(--bg-soft);
  box-shadow: var(--shadow-sm);
}
.tl-art-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tl-art-img.ph { background: linear-gradient(135deg, #e5e5ea, #d1d1d6); }
.tl-art .play {
  position: absolute; inset: 0; width: 100%; height: 100%;
  display: grid; place-items: center; border: 0; cursor: pointer;
  background: rgba(0,0,0,0.45); color: #fff; font-size: 18px;
  opacity: 0; transition: opacity 0.15s ease;
}
.tl-art .play .glyph { color: #fff; }
.tl-art:hover .play,
.track-row.is-playing .tl-art .play,
.track-row.is-loading .tl-art .play { opacity: 1; }

.tl-main { min-width: 0; flex: 1 1 auto; }
.tl-title {
  font-size: 15px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tl-title span { font-weight: 400; color: var(--muted); }
.tl-artist {
  font-size: 13px; color: var(--muted); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tl-meta {
  flex: 0 0 auto; max-width: 220px; color: var(--muted-2);
  font-size: 12.5px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}

.track-row .dl {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 5px;
  height: 36px; padding: 0 14px;
  border: 0; border-radius: 999px;
  background: #fff; color: #0a0a0a;
  font-size: 13px; font-weight: 700; cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.track-row .dl svg { width: 16px; height: 16px; }
.track-row .dl .kbps { color: var(--accent); }
.track-row .dl:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.track-row .dl:disabled { opacity: 0.6; cursor: default; }

/* ---------- footer ---------- */
.footer {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 25;
  display: flex; justify-content: space-between; gap: 12px;
  padding: 8px 22px; font-size: 12px; color: var(--muted-2);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
}

/* ---------- SEO intro (видимый текст для поисковиков) ---------- */
.seo-intro {
  max-width: 760px;
  margin: 40px auto 96px;   /* нижний отступ, чтобы не уезжало под плеер/футер */
  padding: 0 22px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}
.seo-intro h1 {
  font-size: 18px;
  font-weight: 600;
  color: var(--muted-2);
  margin: 0 0 14px;
}
.seo-intro p { margin: 0 0 12px; }
.seo-intro strong { color: var(--muted); font-weight: 600; }

/* ---------- player ---------- */
.player {
  position: fixed; bottom: 38px; left: 50%; transform: translateX(-50%);
  width: min(680px, 94vw);
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  z-index: 35;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  animation: playerIn 0.3s cubic-bezier(0.2, 0.9, 0.2, 1);
}
@keyframes playerIn {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
.player.hidden { display: none; }
.player-main { display: flex; align-items: center; gap: 12px; padding: 11px 14px; }

/* round play/pause control inside the player */
.player-toggle {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%;
  border: none; cursor: pointer; color: #fff;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, filter 0.15s ease;
}
.player-toggle:hover { transform: scale(1.06); filter: brightness(1.06); }
.player-toggle:active { transform: scale(0.95); }
.player-toggle svg { width: 20px; height: 20px; display: block; }
.player-toggle .glyph { display: grid; place-items: center; }

/* the native audio element is fully replaced by the custom controls */
.player audio { display: none; }

/* interactive seek bar */
.player-seek { flex: 1 1 auto; display: flex; align-items: center; gap: 10px; min-width: 0; }
.player-time {
  flex: 0 0 auto; min-width: 36px; text-align: center;
  font-size: 11px; font-weight: 500; color: var(--muted);
  font-variant-numeric: tabular-nums; user-select: none;
}
.player-track {
  position: relative; flex: 1 1 auto; height: 32px;
  display: flex; align-items: center; cursor: pointer; touch-action: none;
}
.player-track:focus-visible { outline: none; }
/* The waveform canvas now paints the whole track (bars + played/buffered
   colours), so the old thin progress line, fill and thumb are hidden. */
.player-wave {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
}
.player-track:focus-visible .player-wave {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px;
}
.player-track::before,
.player-buf,
.player-fill,
.player-thumb { display: none; }
.player-art-wrap { position: relative; width: 48px; height: 48px; flex: 0 0 auto; }
.player img { width: 48px; height: 48px; border-radius: 9px; object-fit: cover; box-shadow: var(--shadow-sm); }
.player-eq {
  position: absolute; bottom: 4px; right: 4px;
  display: none; align-items: flex-end; gap: 2px; height: 13px;
  padding: 2px; border-radius: 4px; background: rgba(0,0,0,0.55);
}
.player.is-playing .player-eq { display: flex; }
.player-eq i {
  width: 2.5px; background: #fff; border-radius: 2px;
  animation: eq 0.9s ease-in-out infinite;
}
.player-eq i:nth-child(1) { height: 40%; animation-delay: 0s; }
.player-eq i:nth-child(2) { height: 100%; animation-delay: 0.2s; }
.player-eq i:nth-child(3) { height: 60%; animation-delay: 0.4s; }
.player-eq i:nth-child(4) { height: 85%; animation-delay: 0.1s; }
@keyframes eq { 0%,100% { transform: scaleY(0.4); } 50% { transform: scaleY(1); } }

.player-info { min-width: 0; flex: 0 0 190px; }
.player-title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-artist { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player audio { flex: 1; height: 36px; min-width: 0; }
#player-close {
  background: var(--bg-soft); border: 1px solid var(--border);
  color: var(--muted); width: 32px; height: 32px; flex: 0 0 auto;
  border-radius: 9px; font-size: 13px; cursor: pointer;
  display: grid; place-items: center; transition: all 0.15s ease;
}
#player-close:hover { color: var(--text); border-color: var(--border-strong); }

/* ---------- responsive ---------- */
@media (max-width: 820px) {
  .topbar-inner {
    display: flex; flex-wrap: wrap; align-items: center;
    justify-content: space-between; gap: 12px; padding: 11px 16px;
  }
  .topbar-inner .search-wrap { order: 3; flex: 1 1 100%; }
  .search-wrap input { text-align: left; padding-left: 38px; }
}

@media (max-width: 600px) {
  main { padding: 16px 14px 150px; }
  .featured-inner { flex-direction: column; align-items: flex-start; gap: 18px; padding: 22px; }
  .featured-art { width: 120px; height: 120px; }
  .section-head h2, .shelf-head h2 { font-size: 19px; }
  .shelf-track .card { flex-basis: 140px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 16px 14px; }
  .footer-note { display: none; }
  /* On touch screens the play control is always visible and meets 44px. */
  .card .play { opacity: 1; transform: none; width: 44px; height: 44px; }
  /* Narrow cards can't fit the play control plus a fully-labelled pill side
     by side, so shorten the badge to just "320" (keep the mark, drop the
     unit) to stop the buttons overlapping. */
  .card .dl .kbps-unit { display: none; }
  .tl-meta { display: none; }
  .list-head h2 { font-size: 22px; }
  .player { bottom: 34px; width: calc(100vw - 16px); max-width: 100%; }
  .player-main { flex-wrap: wrap; gap: 10px 12px; padding: 11px 12px; }
  /* min-width:0 lets the nowrap title ellipsize instead of forcing the row
     wider than the screen (the close button was being pushed off-screen). */
  .player-info { flex: 1 1 0; min-width: 0; }
  /* drop the seek bar onto its own full-width row below the track info */
  .player-seek { order: 10; flex: 1 1 100%; min-width: 0; }
}

/* Respect users who prefer reduced motion: keep meaning, drop the movement. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
