/* Music: mini player, Now Playing, Listen page, release page, music cards. */

/* ── Mini player ── */
#music-mini{position:fixed;left:16px;right:16px;bottom:16px;z-index:450;display:none;align-items:center;gap:14px;max-width:960px;margin:0 auto;padding:10px 14px;border:1px solid var(--border2);border-radius:16px;background:rgba(20,20,30,.95);backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);box-shadow:0 12px 40px rgba(0,0,0,.45);color:var(--text);overflow:hidden}
#music-mini.open{display:flex}
#music-mini audio{display:none}
.mm-progress{position:absolute;left:0;right:0;top:0;height:3px;background:rgba(255,255,255,.08)}
.mm-progress i{display:block;height:100%;width:0;background:#fff}
.mm-open{display:flex;align-items:center;gap:12px;min-width:0;flex:1 1 220px;padding:0;border:0;background:none;color:inherit;text-align:left;cursor:pointer;font:inherit}
.mm-cover{width:44px;height:44px;flex-shrink:0;border-radius:6px;overflow:hidden;background:var(--surface2)}
.mm-cover img{width:100%;height:100%;object-fit:cover;display:block}
.mm-copy{min-width:0;display:flex;flex-direction:column;gap:2px}
.mm-copy b{font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mm-copy small{font-size:12px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mm-controls{display:flex;align-items:center;gap:6px;flex-shrink:0}
.mm-btn{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;flex-shrink:0;border:0;border-radius:50%;background:transparent;color:var(--text);cursor:pointer}
.mm-btn svg{width:18px;height:18px}
.mm-btn:hover{background:rgba(255,255,255,.08)}
.mm-btn:focus-visible,.mm-open:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.mm-play{width:40px;height:40px;background:#fff;color:#0a0a0f}
.mm-play:hover{background:#fff;transform:scale(1.05)}
.mm-play .i-pause,#music-mini.is-playing .mm-play .i-play{display:none}
#music-mini.is-playing .mm-play .i-pause{display:block}
.mm-like.on{color:#ff5c8a}
.mm-like.on svg{fill:currentColor}
.mm-time{font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums;white-space:nowrap}
.mm-close{color:var(--muted);font-size:14px}
body.has-music-player{padding-bottom:88px}
body.theme-light #music-mini{background:rgba(255,255,255,.97);box-shadow:0 12px 40px rgba(0,0,0,.14)}
body.theme-light .mm-play{background:#111;color:#fff}
body.theme-light .mm-progress i{background:#111}

@media (max-width:768px){
  /* Clear the 73px mobile nav with an 8px gap. */
  #music-mini{left:8px;right:8px;bottom:calc(81px + env(safe-area-inset-bottom,0px));gap:8px;padding:8px 10px}
  .mm-time,.mm-queue{display:none}
  body.has-music-player{padding-bottom:160px}
}
@media (max-width:480px){
  .mm-cover{width:40px;height:40px}
  .mm-btn{width:32px;height:32px}
  .mm-play{width:36px;height:36px}
}

/* ── Now Playing ── */
#now-playing{position:fixed;inset:0;z-index:2200;display:none;justify-content:flex-end;background:rgba(0,0,0,.55)}
#now-playing.open{display:flex}
.np-sheet{width:min(440px,100%);height:100%;overflow-y:auto;display:flex;flex-direction:column;gap:20px;padding:18px 22px 28px;background:var(--surface,#1a1a28);border-left:1px solid var(--border2);color:var(--text)}
.np-head{display:flex;align-items:center;justify-content:space-between;gap:12px}
.np-head small{font-size:12px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.np-close{width:36px;height:36px;flex-shrink:0;border-radius:50%;border:1px solid var(--border2);background:transparent;color:var(--text);cursor:pointer}
.np-cover{aspect-ratio:1/1;width:100%;border-radius:12px;overflow:hidden;background:var(--surface2);box-shadow:0 20px 50px rgba(0,0,0,.45)}
.np-cover img{width:100%;height:100%;object-fit:cover;display:block}
.np-main{display:flex;flex-direction:column;gap:18px}
.np-title-row{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.np-title{margin:0;font-size:22px;line-height:1.2}
.np-artist{margin:4px 0 0;color:var(--muted);font-size:14px}
.np-like{width:40px;height:40px;flex-shrink:0;border:0;border-radius:50%;background:transparent;color:var(--text);cursor:pointer}
.np-like svg{width:22px;height:22px}
.np-like.on{color:#ff5c8a}.np-like.on svg{fill:currentColor}
.np-seek{display:flex;align-items:center;gap:10px;font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums}
.np-range{flex:1;accent-color:#fff}
.np-controls{display:flex;align-items:center;justify-content:space-between}
.np-btn{width:44px;height:44px;display:inline-flex;align-items:center;justify-content:center;border:0;border-radius:50%;background:transparent;color:var(--text);cursor:pointer;font-size:18px}
.np-btn svg{width:22px;height:22px}
.np-btn.on{color:var(--text);background:rgba(255,255,255,.12)}
.np-play{width:60px;height:60px;background:#fff;color:#0a0a0f}
.np-credit{margin:0;font-size:12px;line-height:1.5;color:var(--muted)}
.np-queue-wrap h3{margin:0 0 8px;font-size:15px}
.np-queue{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:4px}
.np-queue li{display:flex;align-items:center;gap:6px;padding:8px 6px;border-radius:8px}
.np-queue li:hover{background:rgba(255,255,255,.05)}
.np-q-copy{flex:1;min-width:0;display:flex;flex-direction:column}
.np-q-copy b{font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.np-q-copy small{font-size:12px;color:var(--muted)}
.np-queue button{width:32px;height:32px;border:0;border-radius:50%;background:transparent;color:var(--muted);cursor:pointer}
.np-queue button:disabled{opacity:.3;cursor:default}
.np-empty{margin:0;font-size:13px;color:var(--muted)}
.np-close:focus-visible,.np-btn:focus-visible,.np-like:focus-visible,.np-queue button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
body.theme-light .np-play{background:#111;color:#fff}

@media (max-width:768px){
  .np-sheet{width:100%;border-left:0}
  .np-main{max-width:420px;margin:0 auto;width:100%}
}
@media (max-width:480px){
  .np-sheet{padding:14px 16px 24px}
  .np-title{font-size:20px}
}

/* ── Music cards ── */
.mu-row{display:flex;gap:18px;overflow-x:auto;padding-bottom:6px;scrollbar-width:none}
.mu-row::-webkit-scrollbar{display:none}
.mu-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:20px}
.mu-card{width:180px;flex-shrink:0;cursor:pointer;padding:10px;border-radius:12px;transition:background .15s}
.mu-grid .mu-card{width:auto}
.mu-card:hover,.mu-card:focus-visible{background:rgba(255,255,255,.05)}
.mu-card:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.mu-cover{position:relative;aspect-ratio:1/1;border-radius:8px;overflow:hidden;background:var(--surface2);box-shadow:0 8px 24px rgba(0,0,0,.35)}
.mu-cover img{width:100%;height:100%;object-fit:cover;display:block}
.mu-play{position:absolute;right:8px;bottom:8px;width:44px;height:44px;display:flex;align-items:center;justify-content:center;border:0;border-radius:50%;background:#fff;color:#0a0a0f;opacity:0;transform:translateY(6px);transition:all .18s;cursor:pointer;box-shadow:0 8px 20px rgba(0,0,0,.4)}
.mu-play svg{width:18px;height:18px}
.mu-card:hover .mu-play,.mu-play:focus-visible{opacity:1;transform:none}
.mu-title{margin:10px 0 2px;font-size:14px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--text)}
.mu-sub{font-size:12px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* ── Release page ── */
.release-shell{--rl-wash:#7b5ea7;max-width:1200px;margin:0 auto;padding:96px 32px 48px;background:linear-gradient(180deg,color-mix(in srgb,var(--rl-wash) 38%,transparent) 0,transparent 420px)}
.rl-head{display:flex;align-items:flex-end;gap:28px}
.rl-cover{width:232px;height:232px;flex-shrink:0;border-radius:10px;overflow:hidden;background:var(--surface2);box-shadow:0 24px 60px rgba(0,0,0,.5)}
.rl-cover img{width:100%;height:100%;object-fit:cover;display:block}
.rl-headcopy{min-width:0}
.rl-kind{font-size:13px;font-weight:700;color:var(--text)}
.rl-title{margin:6px 0 10px;font-size:clamp(32px,6vw,72px);line-height:1;letter-spacing:-.03em;color:var(--text)}
.rl-sample{display:inline-block;margin-bottom:10px;padding:3px 10px;border-radius:999px;border:1px solid var(--border2);font-size:12px;color:var(--muted)}
.rl-facts{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;font-size:14px;color:var(--muted)}
.rl-facts span+span::before,.rl-artist+span::before{content:"•";margin-right:10px;opacity:.6}
.rl-artist{padding:0;border:0;background:none;color:var(--text);font:inherit;font-weight:700;cursor:pointer}
.rl-artist:hover{text-decoration:underline}
.rl-actions{display:flex;align-items:center;gap:14px;margin:28px 0 18px}
.rl-play{width:56px;height:56px;display:flex;align-items:center;justify-content:center;border:0;border-radius:50%;background:var(--accent);color:#0a0a0f;cursor:pointer;transition:transform .15s}
.rl-play svg{width:22px;height:22px}
.rl-play:hover{transform:scale(1.05)}
.rl-play:disabled{opacity:.4;cursor:default;transform:none}
.rl-act{width:44px;height:44px;display:flex;align-items:center;justify-content:center;border:1px solid var(--border2);border-radius:50%;background:transparent;color:var(--text);cursor:pointer;font-size:18px}
.rl-act svg{width:20px;height:20px}
.rl-act:disabled{opacity:.4;cursor:default}
.rl-save.on{color:#ff5c8a;border-color:transparent}.rl-save.on svg{fill:currentColor}
.rl-tracks{list-style:none;margin:0;padding:0}
.rl-track{display:grid;grid-template-columns:40px minmax(0,1fr) auto 40px;align-items:center;gap:12px;padding:8px 12px;border-radius:8px;cursor:pointer}
.rl-track:hover,.rl-track:focus-visible{background:rgba(255,255,255,.06)}
.rl-track:focus-visible,.rl-act:focus-visible,.rl-play:focus-visible,.rl-more:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.rl-t-n{position:relative;text-align:center;color:var(--muted);font-variant-numeric:tabular-nums}
.rl-t-bars{display:none;align-items:flex-end;justify-content:center;gap:2px;height:14px}
.rl-t-bars i{width:3px;background:var(--text);animation:rlbar .9s ease-in-out infinite}
.rl-t-bars i:nth-child(2){animation-delay:.2s}.rl-t-bars i:nth-child(3){animation-delay:.4s}
@keyframes rlbar{0%,100%{height:4px}50%{height:14px}}
.rl-track.is-playing .rl-t-num{display:none}
.rl-track.is-playing .rl-t-bars{display:flex}
.rl-track.is-paused .rl-t-bars i{animation:none;height:6px}
.rl-track.is-playing .rl-t-title{color:var(--text);text-decoration:underline;text-underline-offset:3px}
.rl-t-copy{min-width:0;display:flex;flex-direction:column}
.rl-t-title{font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rl-t-copy small{font-size:13px;color:var(--muted)}
.rl-t-time{font-size:13px;color:var(--muted);font-variant-numeric:tabular-nums}
.rl-more{width:36px;height:36px;border:0;border-radius:50%;background:transparent;color:var(--muted);cursor:pointer;font-size:18px}
.rl-empty,.rl-loading{color:var(--muted);padding:24px 0}
.rl-missing{padding:64px 0;text-align:center}
.rl-about,.rl-shelf,.rl-reviews{margin-top:40px}
.rl-about h2,.rl-shelf h2,.rl-reviews h2{font-size:20px;margin:0 0 12px}
.rl-about p{max-width:720px;line-height:1.6;color:var(--muted)}
.rl-credits h3{font-size:14px;margin:18px 0 6px}
.rl-credits p{margin:4px 0;font-size:13px}
.rl-credits a{color:var(--text)}
#music-track-menu{position:fixed;z-index:2300;min-width:180px;padding:6px;border:1px solid var(--border2);border-radius:10px;background:var(--surface,#1a1a28);box-shadow:0 16px 40px rgba(0,0,0,.45)}
#music-track-menu button{display:block;width:100%;padding:10px 12px;border:0;border-radius:6px;background:transparent;color:var(--text);text-align:left;font:inherit;cursor:pointer}
#music-track-menu button:hover{background:rgba(255,255,255,.08)}

@media (max-width:768px){
  .release-shell{padding:16px 16px 40px}
  /* Centred facts wrap unpredictably, so drop the separator dots and space the items instead. */
  .rl-facts{gap:4px 14px}
  .release-shell .rl-facts span+span::before,.release-shell .rl-facts .rl-artist+span::before{content:none;display:none}
  .rl-head{flex-direction:column;align-items:center;text-align:center}
  .rl-cover{width:min(240px,64vw);height:min(240px,64vw)}
  .rl-facts{justify-content:center}
  .rl-actions{justify-content:center}
  .mu-card{width:150px}
  #music-track-menu{left:8px!important;right:8px;bottom:calc(8px + env(safe-area-inset-bottom,0px));top:auto!important}
}
@media (max-width:480px){
  .rl-track{grid-template-columns:28px minmax(0,1fr) auto 32px;gap:8px;padding:8px 4px}
  .rl-t-time{font-size:12px}
  .mu-card{width:136px;padding:6px}
  .mu-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
}

/* ── Continue listening ── */
.continue-listening-row .mu-row{padding:4px 0 8px}
.cl-card{position:relative;display:flex;align-items:center;gap:12px;width:280px;flex-shrink:0;padding:8px 12px 12px 8px;border:1px solid var(--border);border-radius:10px;background:rgba(255,255,255,.03);color:var(--text);text-align:left;font:inherit;cursor:pointer}
.cl-card:hover{background:rgba(255,255,255,.07)}
.cl-card:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.cl-cover{width:56px;height:56px;flex-shrink:0;border-radius:6px;overflow:hidden;background:var(--surface2)}
.cl-cover img{width:100%;height:100%;object-fit:cover;display:block}
.cl-copy{min-width:0;display:flex;flex-direction:column;gap:2px}
.cl-copy b{font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cl-copy small{font-size:12px;color:var(--muted)}
.cl-bar{position:absolute;left:8px;right:8px;bottom:5px;height:3px;border-radius:2px;background:rgba(255,255,255,.1);overflow:hidden}
.cl-bar i{display:block;height:100%;background:#fff}
@media (max-width:768px){.cl-card{width:240px}}
@media (max-width:480px){.cl-card{width:220px}}

/* Music cards inside shared rails and grids take the same slot as every other card (one card width per row). */
html body .sv-rail > .mu-card,.sv-rank .mu-card,html body #page-discover #disc-grid > .mu-card,html body #detail-modal .dx-grid .mu-card{width:auto;min-width:0;padding:0}
.sv-rank .mu-card{flex:1 1 0}
.sv-rail > .mu-card:hover,#disc-grid > .mu-card:hover{background:none}

/* ── Listen page ── */
.listen-shell{max-width:1240px;margin:0 auto;padding:96px 32px 48px}
.ls-head{display:flex;align-items:center;gap:16px;flex-wrap:wrap;margin-bottom:20px}
.ls-head h1{margin:0;font-size:32px;letter-spacing:-.02em}
.ls-active-mood{display:inline-flex;align-items:center;gap:8px;padding:6px 8px 6px 14px;border-radius:999px;background:rgba(255,255,255,.08);font-size:13px}
.ls-active-mood button{width:26px;height:26px;border:0;border-radius:50%;background:rgba(255,255,255,.1);color:var(--text);cursor:pointer}
.ls-featured{display:flex;align-items:flex-end;gap:28px;padding:24px;border-radius:16px;background:linear-gradient(135deg,rgba(123,94,167,.35),rgba(255,255,255,.03));cursor:pointer}
.ls-f-cover{width:220px;height:220px;flex-shrink:0;border-radius:10px;overflow:hidden;box-shadow:0 20px 50px rgba(0,0,0,.45);background:var(--surface2)}
.ls-f-cover img{width:100%;height:100%;object-fit:cover;display:block}
.ls-f-copy small{font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.08em;color:var(--muted)}
.ls-f-title{margin:6px 0;font-size:clamp(28px,5vw,56px);line-height:1;letter-spacing:-.03em}
.ls-f-copy p{margin:0 0 18px;color:var(--muted)}
.ls-f-actions{display:flex;gap:12px;align-items:center}
.ls-shelf{margin-top:40px}
.ls-shelf-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}
.ls-shelf-head h2{margin:0;font-size:22px}
.ls-see-all{border:0;background:none;color:var(--muted);font:inherit;font-weight:700;font-size:13px;cursor:pointer}
.ls-see-all:hover{color:var(--text)}
.ls-popular{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px 24px}
.ls-popular li{display:grid;grid-template-columns:24px 48px minmax(0,1fr) auto;align-items:center;gap:12px;padding:6px 8px;border-radius:8px;cursor:pointer}
.ls-popular li:hover,.ls-popular li:focus-visible{background:rgba(255,255,255,.06)}
.ls-popular li:focus-visible,.ls-mood:focus-visible,.ls-artist:focus-visible,.ls-featured:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.ls-p-n{text-align:center;color:var(--muted);font-variant-numeric:tabular-nums}
.ls-popular img{width:48px;height:48px;border-radius:4px;object-fit:cover}
.ls-p-copy{min-width:0;display:flex;flex-direction:column}
.ls-p-copy b{font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ls-p-copy small{font-size:12px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ls-p-time{font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums}
.ls-moods{display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:14px}
.ls-mood{height:88px;padding:14px;border:0;border-radius:10px;background:var(--mood);color:#fff;font:inherit;font-size:18px;font-weight:800;text-align:left;cursor:pointer;display:flex;align-items:flex-end}
.ls-mood.on{box-shadow:0 0 0 3px #fff inset}
.ls-artist{width:150px;flex-shrink:0;display:flex;flex-direction:column;align-items:center;gap:4px;padding:10px;border:0;border-radius:12px;background:none;color:var(--text);font:inherit;cursor:pointer}
.ls-artist:hover{background:rgba(255,255,255,.05)}
.ls-a-img{width:120px;height:120px;border-radius:50%;overflow:hidden;background:var(--surface2);margin-bottom:6px}
.ls-a-img img{width:100%;height:100%;object-fit:cover;display:block}
.ls-artist small{color:var(--muted);font-size:12px}
.ls-seeall-head{display:flex;align-items:center;gap:12px;margin-bottom:20px}
.ls-seeall-head h1{margin:0;font-size:28px}
.ls-back{width:40px;height:40px;border:1px solid var(--border2);border-radius:50%;background:transparent;color:var(--text);cursor:pointer;font-size:18px}
.ls-empty{padding:64px 0;text-align:center}

@media (max-width:768px){
  .listen-shell{padding:16px 16px 40px}
  .ls-featured{flex-direction:column;align-items:flex-start;padding:18px}
  .ls-f-cover{width:min(220px,60vw);height:min(220px,60vw)}
  .ls-popular{grid-template-columns:1fr}
  .ls-artist{width:120px}.ls-a-img{width:96px;height:96px}
}
@media (max-width:480px){
  .ls-moods{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .ls-mood{height:72px;font-size:16px}
  .ls-popular li{grid-template-columns:20px 40px minmax(0,1fr) auto;gap:10px;padding:6px 2px}
  .ls-popular img{width:40px;height:40px}
}

/* ── Search groups ── */
.ms-groups{display:flex;flex-direction:column;gap:28px;margin-bottom:28px}
.ms-groups h2{margin:0 0 10px;font-size:18px}
.ms-tracks{list-style:none;margin:0;padding:0}
.ms-track{display:grid;grid-template-columns:48px minmax(0,1fr) auto;align-items:center;gap:12px;padding:6px 8px;border-radius:8px;cursor:pointer}
.ms-track:hover,.ms-track:focus-visible{background:rgba(255,255,255,.06)}
.ms-track:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.ms-track img{width:48px;height:48px;border-radius:4px;object-fit:cover}
@media (max-width:768px){.ms-groups{gap:22px}}
@media (max-width:480px){.ms-track{grid-template-columns:40px minmax(0,1fr) auto;gap:10px;padding:6px 2px}.ms-track img{width:40px;height:40px}}

/* ── Saved > Music ── */
#saved-grid.saved-music{display:block}
.sm-liked,.sm-releases{margin-bottom:36px}
.sm-head{display:flex;align-items:center;gap:16px;margin-bottom:10px}
.sm-liked h2,.sm-releases h2{margin:0 0 10px;font-size:20px}
.sm-head h2{margin:0}
.sm-play-all{width:48px;height:48px}
.sm-empty{color:var(--muted);margin:0}

/* ── Upload wizard: music releases preview as square covers ── */
#upload-wizard[data-wtype="music"] #wiz-rev-thumb-wrap{aspect-ratio:1/1;width:min(240px,100%);height:auto;margin-left:auto;margin-right:auto}
#upload-wizard[data-wtype="music"] #wiz-rev-thumb-wrap img{object-fit:cover}

/* Sample label on music cards; licence links in credits. */
.mu-sample{margin-top:4px;font-size:11px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.np-credit a,.rl-credits a{color:var(--text);text-decoration:underline;text-underline-offset:2px}
