:root {
  --bg: #0b0b10;
  --panel: rgba(255,255,255,.04);
  --panel-2: rgba(255,255,255,.07);
  --line: rgba(255,255,255,.08);
  --text: #f3f3f6;
  --muted: #9a9aa8;
  --dim: #6b6b78;
  --accent-rgb: 255, 99, 132;
  --accent: rgb(var(--accent-rgb));
  --heart: #ff4d67;
  --radius: 14px;
  --player-h: 88px;
  --side-w: 232px;
  --vh: 100vh; /* the height of the window; where the browser knows better (bars of a phone browser sliding in and out), see below */
  --font: "Be Vietnam Pro", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", "Hiragino Sans", "Noto Sans JP", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}
@supports (height: 100dvh) { :root { --vh: 100dvh; } }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); -webkit-font-smoothing: antialiased; }
body { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
svg { width: 20px; height: 20px; flex: none; }
img { display: block; }
[hidden] { display: none !important; }
::selection { background: rgba(var(--accent-rgb), .45); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(255,255,255,.22); }

/* ambient colour wash behind everything */
.ambient {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(900px 520px at 75% -10%, rgba(var(--accent-rgb), .22), transparent 60%),
    radial-gradient(700px 500px at -10% 110%, rgba(var(--accent-rgb), .10), transparent 60%);
  transition: background 1.2s ease;
}

.app { position: relative; z-index: 1; display: grid; grid-template-columns: var(--side-w) 1fr; height: 100vh; height: 100dvh; padding-bottom: var(--player-h); }
body.no-player .app { padding-bottom: 0; }

/* ---------- sidebar ---------- */
.sidebar { display: flex; flex-direction: column; padding: 22px 14px; border-right: 1px solid var(--line); background: rgba(0,0,0,.25); backdrop-filter: blur(20px); }
.brand { display: flex; align-items: center; padding: 4px 10px 24px; }
.brand img { height: 44px; width: auto; }
.top-logo { display: none; flex: none; }
.top-logo img { width: 40px; height: 40px; border-radius: 10px; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--muted); font-weight: 500; font-size: 14.5px; transition: .15s; }
.sidebar nav a:hover { color: var(--text); background: var(--panel); }
.sidebar nav a.on { color: var(--text); background: var(--panel-2); }
.sidebar nav a.on svg { color: var(--accent); }
.side-foot { margin-top: auto; }
.scan-note { font-size: 12px; color: var(--dim); padding: 8px 12px 0; line-height: 1.5; }
.ghost { display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 10px; color: var(--muted); font-size: 13.5px; }
.ghost:hover { background: var(--panel); color: var(--text); }
.ghost.spin svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- main ---------- */
.main { overflow-y: auto; overflow-x: hidden; position: relative; scroll-behavior: smooth; }
.topbar { position: sticky; top: 0; z-index: 5; padding: 16px 36px; display: flex; align-items: center; gap: 12px; background: linear-gradient(var(--bg) 30%, transparent); }
.search { flex: 1; max-width: 420px; display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 42px; border-radius: 999px; background: var(--panel-2); border: 1px solid transparent; transition: .2s; }
.search:focus-within { border-color: rgba(var(--accent-rgb), .6); background: rgba(255,255,255,.09); }
.search svg { color: var(--muted); width: 18px; height: 18px; }
.search input { flex: 1; background: none; border: 0; outline: 0; color: var(--text); font: inherit; font-size: 14px; }
.search input::-webkit-search-cancel-button { filter: invert(1) opacity(.5); }
.view { padding: 4px 36px 48px; animation: fadein .35s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 10px 0 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 44px; line-height: 1.05; letter-spacing: -.035em; margin: 0; font-weight: 800; }
.page-head .sub { color: var(--muted); font-size: 14px; margin-top: 8px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 7px 14px; border-radius: 999px; background: var(--panel-2); font-size: 13px; font-weight: 500; color: var(--muted); transition: .15s; }
.chip:hover { color: var(--text); }
.chip.on { background: var(--text); color: #111; }
select.chip { appearance: none; border: 0; outline: 0; padding-right: 14px; }

/* ---------- home: the lightstick stage ---------- */
/* --h: the height of a lightstick; each is as wide as its picture makes it (--ar), and all of them side by side are --ars times as wide as they are high.
   Alone, the stage fills the page; with an artist chosen it shrinks to a strip above that artist's albums. */
.stage { --gap: clamp(4px, 3vw, 84px); --wave: 9deg; --h: clamp(190px, min(46vh, calc((100vw - var(--side-w) - 120px - 3 * var(--gap)) / var(--ars))), 440px); position: relative; isolation: isolate; display: flex; flex-direction: column; justify-content: center; min-height: calc(var(--vh) - var(--player-h) - 140px); margin: 0 -36px; padding: 30px 36px 10px; transition: min-height .55s cubic-bezier(.2,.8,.2,1); }
body.no-player .stage { min-height: calc(var(--vh) - 140px); }
.stage.has, body.no-player .stage.has { --h: clamp(112px, 19vh, 176px); min-height: 0; }
.sticks { display: flex; justify-content: center; align-items: flex-end; gap: var(--gap); transition: gap .55s cubic-bezier(.2,.8,.2,1); }
.stick { position: relative; display: flex; flex-direction: column; align-items: center; padding: 0 4px; visibility: hidden; -webkit-tap-highlight-color: transparent; transition: transform .35s cubic-bezier(.2,.8,.2,1), opacity .4s, filter .4s; }
.stick.ready { visibility: visible; animation: ls-rise .7s cubic-bezier(.2,.8,.2,1) calc(var(--i) * .09s) backwards; } /* on stage once its picture has arrived */
/* the stick sways from the hand that holds it, each a little out of step with the next */
.stick-art { position: relative; display: block; height: var(--h); width: calc(var(--h) * var(--ar)); transform-origin: 50% 86%; animation: ls-sway 3.4s ease-in-out calc(var(--i) * -1.1s) infinite alternate; transition: height .55s cubic-bezier(.2,.8,.2,1), width .55s cubic-bezier(.2,.8,.2,1); }
.stick-art img { width: 100%; height: 100%; pointer-events: none; user-select: none; -webkit-user-drag: none; filter: drop-shadow(0 0 calc(var(--h) * .03) rgba(var(--c), .45)); transition: filter .3s; }
/* its light, around the part of the picture that shines (--hx, --hy: its middle; --hr: its radius against the height of the picture):
   a glow behind it and a beam going up from it */
.halo, .beam, .shine { position: absolute; pointer-events: none; }
.halo, .beam { left: var(--hx); z-index: -1; }
.halo { top: var(--hy); width: calc(var(--h) * var(--hr) * 3.8); aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(var(--c), .5), rgba(var(--c), .16) 36%, transparent 68%); transform: translate(-50%, -50%); animation: ls-pulse 2.6s ease-in-out calc(var(--i) * -.8s) infinite alternate; }
.beam { bottom: calc(100% - var(--hy)); width: calc(var(--h) * .7); height: calc(var(--h) * 1.4); transform: translateX(-50%); opacity: .55; background: conic-gradient(from -13deg at 50% 100%, transparent, rgba(var(--c), .5) 13deg, transparent 26deg); -webkit-mask-image: linear-gradient(to top, #000, transparent 92%); mask-image: linear-gradient(to top, #000, transparent 92%); transition: opacity .4s; }
/* and light on the stick itself, kept to the shape of the picture: a glint that passes over it now and then,
   and, when the stick is pointed at or chosen, the glow of its own lamp */
.shine { inset: 0; mix-blend-mode: screen; -webkit-mask-image: var(--art); mask-image: var(--art); -webkit-mask-size: 100% 100%; mask-size: 100% 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }
.shine::before { content: ""; position: absolute; inset: 0; opacity: 0; background: radial-gradient(circle calc(var(--h) * var(--hr) * 1.5) at var(--hx) var(--hy), rgba(var(--c), .9), rgba(var(--c), .35) 60%, transparent); transition: opacity .35s; }
.shine::after { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 70%; background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,.42) 50%, transparent 70%); transform: translateX(-110%); animation: ls-glint 6.5s ease-in-out calc(var(--i) * .8s + 1.4s) infinite; }
.stick-name { margin-top: 16px; font-size: clamp(11px, 1.35vw, 17px); font-weight: 800; letter-spacing: .14em; white-space: nowrap; transition: color .3s, text-shadow .3s; }
.stick-n { margin-top: 4px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
@media (hover: hover) {
  .stick:hover { transform: translateY(-10px) scale(1.04); }
  .stick:hover img { filter: drop-shadow(0 0 calc(var(--h) * .05) rgba(var(--c), .9)); }
  .stick:hover .shine::before { opacity: .35; }
  .stick:hover .stick-name { color: rgb(var(--c)); }
}
.stick:focus-visible { outline: 2px solid rgba(var(--c), .8); outline-offset: 8px; border-radius: 14px; }
/* the chosen one is held high and waved, and is lit; the others stand in the dark */
.stick.on { transform: translateY(-6px) scale(1.1); }
.stick.on .stick-art { animation-name: ls-wave; animation-duration: 1.3s; }
.stick.on img { filter: drop-shadow(0 0 calc(var(--h) * .06) rgba(var(--c), .95)); }
.stick.on .shine::before { opacity: .45; animation: ls-shine 1.3s ease-in-out infinite alternate; }
.stick.on .stick-name { color: rgb(var(--c)); text-shadow: 0 0 18px rgba(var(--c), .55); }
.stick.on .stick-art::after { content: ""; position: absolute; left: var(--hx); top: var(--hy); width: calc(var(--h) * var(--hr) * 2.6); aspect-ratio: 1; border-radius: 50%; border: 2px solid rgba(var(--c), .9); opacity: 0; transform: translate(-50%, -50%); pointer-events: none; animation: ls-burst .9s ease-out; }
.stage.has .stick:not(.on) { opacity: .8; filter: brightness(.5) saturate(.8); }
.stage.has .stick:not(.on):hover { opacity: 1; filter: none; }
.stage.has .stick:not(.on) .beam { opacity: 0; }
.stage.has .stick-n, .stage.has .stage-hint { display: none; }
.stage-hint { margin: 30px 0 0; text-align: center; color: var(--muted); font-size: 14px; }
/* the crowd behind: small lights, all in the colour of the chosen stick once one is chosen */
.stage-lights { position: absolute; inset: 0; z-index: -2; overflow: hidden; pointer-events: none; -webkit-mask-image: radial-gradient(ellipse 72% 80% at 50% 52%, #000 40%, transparent); mask-image: radial-gradient(ellipse 72% 80% at 50% 52%, #000 40%, transparent); }
.stage-lights i { position: absolute; width: var(--s); height: var(--s); border-radius: 50%; background: rgb(var(--dc)); box-shadow: 0 0 calc(var(--s) * 2) rgba(var(--dc), .8); opacity: .5; animation: ls-twinkle var(--d) ease-in-out var(--w) infinite alternate; transition: background .8s, box-shadow .8s; }
.stage.has .stage-lights i { --dc: var(--sel) !important; }
@keyframes ls-rise { from { opacity: 0; transform: translateY(44px) scale(.92); } }
@keyframes ls-sway { from { transform: rotate(-3.5deg); } to { transform: rotate(3.5deg); } }
@keyframes ls-wave { from { transform: rotate(calc(var(--wave) * -1)); } to { transform: rotate(var(--wave)); } }
@keyframes ls-glint { 0% { transform: translateX(-110%); } 24%, 100% { transform: translateX(260%); } }
@keyframes ls-pulse { from { opacity: .6; transform: translate(-50%, -50%) scale(.9); } to { opacity: 1; transform: translate(-50%, -50%) scale(1.1); } }
@keyframes ls-burst { from { opacity: .9; transform: translate(-50%, -50%) scale(.3); } to { opacity: 0; transform: translate(-50%, -50%) scale(1.7); } }
@keyframes ls-twinkle { from { opacity: .1; transform: translateY(3px) scale(.8); } to { opacity: .85; transform: translateY(-3px) scale(1.15); } }
@keyframes ls-shine { from { opacity: .2; } to { opacity: .6; } }

/* ---------- album grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 26px 22px; }
.card { position: relative; cursor: pointer; }
.card .art { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--panel-2); box-shadow: 0 10px 30px rgba(0,0,0,.35); transition: transform .25s ease, box-shadow .25s; }
.card .art img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .4s; }
.card .art img.ok { opacity: 1; }
.card:hover .art { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(0,0,0,.5); }
.card .hover-play { position: absolute; right: 10px; bottom: 10px; width: 46px; height: 46px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; box-shadow: 0 8px 20px rgba(0,0,0,.4); opacity: 0; transform: translateY(8px) scale(.9); transition: .2s; }
.card .hover-play svg { width: 20px; height: 20px; margin-left: 2px; }
.card:hover .hover-play, .card .hover-play:focus { opacity: 1; transform: none; }
.card .hover-play:hover { transform: scale(1.06); }
.card .t { margin-top: 11px; font-weight: 600; font-size: 14.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .s { color: var(--muted); font-size: 13px; margin-top: 3px; }
.card.playing .t { color: var(--accent); }
.placeholder { width: 100%; height: 100%; display: grid; place-items: center; color: var(--dim); background: linear-gradient(135deg, #22222c, #15151b); }
.placeholder svg { width: 38%; height: 38%; opacity: .5; }

/* ---------- album page ---------- */
.album-hero { display: flex; gap: 32px; align-items: flex-end; margin: 6px 0 28px; }
.album-hero .cover { width: 248px; height: 248px; border-radius: 14px; overflow: hidden; flex: none; box-shadow: 0 24px 60px rgba(0,0,0,.55); background: var(--panel-2); }
.album-hero .cover img { width: 100%; height: 100%; object-fit: cover; }
.album-hero .kind { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.album-hero h1 { font-size: clamp(30px, 4.4vw, 58px); line-height: 1.04; letter-spacing: -.035em; margin: 8px 0 14px; font-weight: 800; }
.album-hero .info { color: var(--muted); font-size: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.album-hero .info b { color: var(--text); font-weight: 600; }
.dot::before { content: "•"; opacity: .5; }
.badge { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 5px; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; background: rgba(255,255,255,.1); color: var(--muted); white-space: nowrap; }
.badge.hires { background: rgba(var(--accent-rgb), .18); color: var(--accent); }
.badge:empty { display: none; }
.actions { display: flex; align-items: center; gap: 14px; margin: 0 0 18px; }
.btn-play { width: 58px; height: 58px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; box-shadow: 0 10px 28px rgba(var(--accent-rgb), .35); transition: transform .15s; }
.btn-play:hover { transform: scale(1.05); }
.btn-play svg { width: 24px; height: 24px; margin-left: 2px; }
.btn-play.is-pause svg { margin-left: 0; }
.btn-round { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); border: 1px solid var(--line); }
.btn-round:hover { color: var(--text); border-color: rgba(255,255,255,.3); }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13.5px; padding: 6px 10px 6px 4px; border-radius: 8px; margin-left: -4px; }
.back:hover { color: var(--text); background: var(--panel); }

/* ---------- track list ---------- */
.tracks { display: flex; flex-direction: column; }
.tracks .disc { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 18px 16px 8px; display: flex; gap: 8px; align-items: center; }
.tracks .disc svg { width: 16px; height: 16px; }
.trow { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto 34px 64px; align-items: center; gap: 14px; padding: 9px 16px; border-radius: 10px; cursor: pointer; transition: background .12s; }
.trow.with-album { grid-template-columns: 40px minmax(0, 1.4fr) minmax(0, 1fr) auto 34px 64px; }
.trow:hover { background: var(--panel-2); }
.trow .n { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 14px; text-align: right; position: relative; }
.trow .n .pi { display: none; }
.trow:hover .n .num { display: none; }
.trow:hover .n .pi { display: inline-flex; justify-content: flex-end; color: var(--text); }
.trow .n .pi svg { width: 16px; height: 16px; }
.trow .ti { min-width: 0; }
.trow .ti .a { font-size: 15px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow .ti .b { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.trow .alb { color: var(--muted); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow .alb:hover { color: var(--text); text-decoration: underline; }
.trow .flags { display: flex; gap: 6px; color: var(--dim); }
.trow .flags svg { width: 16px; height: 16px; }
.trow .d { color: var(--muted); font-size: 13.5px; font-variant-numeric: tabular-nums; text-align: right; }
.fav { color: var(--dim); flex: none; }
.icon.fav.on, .icon.fav.on:hover { color: var(--heart); }
.icon.fav.on::after { content: none; }
.fav.pop svg { animation: pop .3s ease; }
@keyframes pop { 50% { transform: scale(1.3); } }
.trow .fav { width: 34px; height: 34px; }
.trow .fav svg { width: 18px; height: 18px; }
@media (hover: hover) {
  .trow .fav:not(.on) { opacity: 0; }
  .trow:hover .fav, .trow .fav:focus-visible { opacity: 1; }
}
.empty svg { width: 18px; height: 18px; vertical-align: -3px; }
.trow.cur .ti .a { color: var(--accent); }
.trow.cur .n .num { display: none; }
.trow.cur .n .pi { display: none; }
.eq { display: none; gap: 2px; height: 14px; align-items: flex-end; justify-content: flex-end; }
.trow.cur .eq { display: inline-flex; }
.trow.cur:hover .eq { display: none; }
.trow.cur:hover .n .pi { display: inline-flex; }
.eq i { width: 3px; height: 8px; background: var(--accent); border-radius: 1px; animation: eq 1s ease-in-out infinite; }
.eq i:nth-child(2) { height: 14px; animation-delay: -.4s; } .eq i:nth-child(3) { height: 5px; animation-delay: -.7s; }
body.paused .eq i { animation-play-state: paused; height: 4px; }
@keyframes eq { 0%,100% { height: 4px; } 50% { height: 14px; } }

.section-t { font-size: 22px; font-weight: 700; letter-spacing: -.02em; margin: 30px 0 14px; }
.empty { color: var(--muted); padding: 60px 0; text-align: center; font-size: 15px; line-height: 1.7; }
.empty b { color: var(--text); }
.loading-box { max-width: 420px; margin: 14vh auto 0; text-align: center; }
.loading-box h2 { font-size: 22px; margin: 18px 0 6px; }
.loading-box p { color: var(--muted); font-size: 14px; margin: 0 0 18px; line-height: 1.6; }
.pbar { height: 6px; border-radius: 6px; background: var(--panel-2); overflow: hidden; }
.pbar > div { height: 100%; background: var(--accent); width: 0; transition: width .4s; }
.loader { width: 54px; height: 54px; margin: 0 auto; border-radius: 50%; border: 3px solid var(--panel-2); border-top-color: var(--accent); animation: spin .9s linear infinite; }

/* ---------- player bar ---------- */
.player { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; height: var(--player-h); display: grid; grid-template-columns: minmax(180px, 1fr) minmax(320px, 1.6fr) minmax(180px, 1fr); align-items: center; gap: 16px; padding: 0 20px; padding-bottom: env(safe-area-inset-bottom); background: rgba(14,14,20,.82); backdrop-filter: blur(28px) saturate(1.4); border-top: 1px solid var(--line); }
.p-left { display: flex; align-items: center; gap: 13px; min-width: 0; cursor: pointer; }
.p-left img { flex: none; width: 56px; height: 56px; border-radius: 8px; object-fit: cover; background: var(--panel-2); box-shadow: 0 6px 16px rgba(0,0,0,.4); }
.p-meta { min-width: 0; }
.p-title { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-artist { color: var(--muted); font-size: 12.5px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-center { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.controls { display: flex; align-items: center; gap: 14px; }
.icon { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); transition: color .15s, transform .1s; position: relative; }
.icon:hover { color: var(--text); }
.icon:active { transform: scale(.92); }
.icon.on { color: var(--accent); }
.icon.on::after { content: ""; position: absolute; bottom: 1px; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }
.icon.one::before { content: "1"; position: absolute; font-size: 9px; font-weight: 800; top: 4px; right: 3px; color: var(--accent); }
.icon.play { width: 40px; height: 40px; background: var(--text); color: #111; }
.icon.play:hover { transform: scale(1.06); color: #111; }
.icon.play svg { width: 18px; height: 18px; }
.progress { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 620px; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.progress > span { width: 38px; text-align: center; }
.bar { position: relative; flex: 1; height: 4px; border-radius: 4px; background: rgba(255,255,255,.14); cursor: pointer; touch-action: none; }
.bar::before { content: ""; position: absolute; inset: -8px 0; }
.bar .buf { position: absolute; inset: 0 auto 0 0; background: rgba(255,255,255,.14); border-radius: 4px; width: 0; }
.bar .fill { position: absolute; inset: 0 auto 0 0; background: var(--text); border-radius: 4px; width: 0; }
.bar:hover .fill, .bar.drag .fill { background: var(--accent); }
.bar .knob { position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: #fff; left: 0; opacity: 0; transition: opacity .15s; box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.bar:hover .knob, .bar.drag .knob { opacity: 1; }
/* while the bar drives a YouTube video: what belongs to the music only is put away */
.player.video #shuffleBtn, .player.video #repeatBtn, .player.video #lyricsBtn, .player.video #pFav { display: none; }
.player.video .p-left img { width: 100px; }
.p-right { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.p-right .badge { margin-right: 6px; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100px; height: 4px; border-radius: 4px; background: linear-gradient(to right, var(--text) var(--v, 100%), rgba(255,255,255,.14) var(--v, 100%)); outline: 0; cursor: pointer; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 0; }
input[type=range]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 0; }
.mini-progress { display: none; }

/* ---------- now playing ---------- */
.np { position: fixed; inset: 0; z-index: 40; overflow: hidden; background: #08080c; animation: npin .35s cubic-bezier(.2,.8,.2,1); color: #fff; }
@keyframes npin { from { transform: translateY(40px); opacity: 0; } }
.np.closing { animation: npout .25s ease forwards; }
@keyframes npout { to { transform: translateY(40px); opacity: 0; } }
.np-bg { position: absolute; inset: -12%; background-size: cover; background-position: center; filter: blur(70px) saturate(1.6) brightness(.55); transform: scale(1.1); animation: drift 30s ease-in-out infinite alternate; }
.np-bg::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 30% 40%, transparent, rgba(0,0,0,.45)); }
@keyframes drift { to { transform: scale(1.25) rotate(4deg) translate(2%, -2%); } }
.np-close { position: absolute; top: 18px; left: 22px; z-index: 3; color: rgba(255,255,255,.8); background: rgba(255,255,255,.08); width: 40px; height: 40px; }
.np-close svg { width: 24px; height: 24px; }
.np-tabs { position: absolute; top: 20px; left: 50%; transform: translateX(-50%); z-index: 3; display: flex; gap: 4px; background: rgba(0,0,0,.25); padding: 4px; border-radius: 999px; }
.np-tabs button { white-space: nowrap; padding: 7px 16px; border-radius: 999px; font-size: 13px; font-weight: 600; color: rgba(255,255,255,.65); }
.np-tabs button.on { background: rgba(255,255,255,.18); color: #fff; }
.np-body { position: relative; z-index: 2; height: 100%; display: grid; grid-template-columns: minmax(320px, 0.9fr) 1.1fr; gap: 6vw; padding: 9vh 7vw 6vh; align-items: center; }
.np-left { display: flex; flex-direction: column; align-items: stretch; max-width: 460px; width: 100%; justify-self: end; }
.np-left img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 16px; box-shadow: 0 30px 80px rgba(0,0,0,.55); transition: transform .5s cubic-bezier(.2,.8,.2,1); background: rgba(255,255,255,.08); }
body.paused .np-left img { transform: scale(.94); }
.np-meta { margin: 26px 0 16px; display: flex; align-items: center; gap: 12px; }
.np-meta-t { flex: 1; min-width: 0; }
.np-meta .fav { width: 46px; height: 46px; color: rgba(255,255,255,.7); }
.np-meta .fav svg { width: 26px; height: 26px; }
.np-meta .fav.on { color: var(--heart); }
.np-title { font-size: 24px; font-weight: 700; letter-spacing: -.02em; line-height: 1.25; }
.np-artist { display: inline-block; margin-top: 4px; color: rgba(255,255,255,.65); font-size: 16px; cursor: pointer; }
.np-artist:hover { color: #fff; text-decoration: underline; }
.progress.big { flex-direction: column; align-items: stretch; gap: 8px; max-width: none; color: rgba(255,255,255,.6); }
.progress.big .bar { height: 5px; background: rgba(255,255,255,.2); flex: none; }
.progress.big .bar .buf { background: rgba(255,255,255,.18); }
.progress.big .bar .fill { background: #fff; }
.progress.big .times { display: flex; justify-content: space-between; align-items: center; }
.controls.big { justify-content: space-between; margin-top: 14px; }
.controls.big .icon { width: 48px; height: 48px; color: rgba(255,255,255,.75); }
.controls.big .icon svg { width: 26px; height: 26px; }
.controls.big .icon.tog svg { width: 20px; height: 20px; }
.controls.big .icon.on { color: #fff; }
.controls.big .icon.on::after, .controls.big .icon.one::before { background: #fff; color: #fff; }
.controls.big .icon.play { width: 66px; height: 66px; background: #fff; color: #111; }
.controls.big .icon.play svg { width: 28px; height: 28px; }
.np-right { height: 100%; min-height: 0; position: relative; }

.lyrics { height: 100%; overflow-y: auto; scrollbar-width: none; padding: 38vh 0 45vh; -webkit-mask-image: linear-gradient(transparent, #000 18%, #000 78%, transparent); mask-image: linear-gradient(transparent, #000 18%, #000 78%, transparent); }
.lyrics::-webkit-scrollbar { display: none; }
.ly { font-size: clamp(22px, 2.5vw, 34px); font-weight: 700; line-height: 1.3; letter-spacing: -.015em; padding: 10px 14px; margin: 0 -14px; border-radius: 12px; color: rgba(255,255,255,.32); cursor: pointer; transition: color .35s, transform .35s cubic-bezier(.2,.8,.2,1), filter .35s; transform-origin: left center; }
.ly:hover { background: rgba(255,255,255,.06); color: rgba(255,255,255,.6); }
.ly.past { color: rgba(255,255,255,.42); }
.ly.on { color: #fff; transform: scale(1.03); }
.lyrics.blur .ly:not(.on) { filter: blur(1.2px); }
.lyrics.blur .ly:not(.on):hover, .lyrics.manual .ly { filter: none; }
.ly .sub { display: block; font-size: .58em; font-weight: 500; margin-top: 4px; opacity: .8; }
.ly.gap { font-size: 22px; letter-spacing: .4em; }
.lyrics.plain { padding-top: 6vh; }
.lyrics.plain .ly { cursor: default; color: rgba(255,255,255,.85); font-size: clamp(18px, 1.8vw, 24px); font-weight: 600; padding: 4px 14px; }
.lyrics.plain .ly:hover { background: none; }
.ly-src { font-size: 12px; color: rgba(255,255,255,.45); margin-top: 40px; font-weight: 500; }
.ly-empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: rgba(255,255,255,.55); font-size: 17px; line-height: 1.7; }
.ly-empty svg { width: 46px; height: 46px; margin: 0 auto 10px; opacity: .5; display: block; }
.np-queue { height: 100%; overflow-y: auto; padding: 6vh 6px 6vh 0; }
.np-queue h3 { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.55); margin: 0 0 10px 12px; }
.qrow { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 10px; cursor: pointer; }
.qrow:hover { background: rgba(255,255,255,.08); }
.qrow img { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; background: rgba(255,255,255,.08); }
.qrow .ti { flex: 1; min-width: 0; }
.qrow .a { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qrow .b { font-size: 12.5px; color: rgba(255,255,255,.55); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.qrow.cur .a { color: var(--accent); }
.np .qrow.cur .a { color: #fff; }
.np .qrow.cur { background: rgba(255,255,255,.12); }
.qrow .rm { opacity: 0; color: var(--muted); }
.qrow:hover .rm { opacity: 1; }
.qrow .d { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- YouTube ---------- */
/* the open video: centred, and sized so that it and its title (two lines at most) fit between the search box and the bar */
.yt-stage { max-width: max(480px, calc((100vh - 266px) * 16 / 9)); margin: 6px auto 30px; }
.yt-stage:not([hidden]) + .page-head h1 { font-size: 24px; letter-spacing: -.02em; } /* under a video the page title heads the list */
.yt-frame { aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: #000; box-shadow: 0 24px 60px rgba(0,0,0,.5); }
.yt-frame iframe { display: block; width: 100%; height: 100%; border: 0; }
.yt-now { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.yt-now-t { flex: 1; min-width: 0; }
.yt-now .a { font-size: 19px; font-weight: 700; line-height: 1.3; letter-spacing: -.01em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.yt-now .b { color: var(--muted); font-size: 13.5px; margin-top: 3px; }
.yt-now .btn-round { flex: none; }
.grid.videos { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.card.video .art { aspect-ratio: 16 / 9; }
.card.video.on .t { color: var(--accent); }
.empty a { color: var(--text); text-decoration: underline; }

/* ---------- toast ---------- */
.toast { position: fixed; z-index: 60; left: 50%; bottom: calc(var(--player-h) + 18px); transform: translate(-50%, 20px); background: #fff; color: #111; padding: 11px 18px; border-radius: 12px; font-size: 14px; font-weight: 500; box-shadow: 0 14px 40px rgba(0,0,0,.4); opacity: 0; pointer-events: none; transition: .25s; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast button { margin-left: 10px; font-weight: 700; color: rgb(var(--accent-rgb)); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .p-right input[type=range], .p-right #muteBtn, .p-right .badge { display: none; }
  .player { grid-template-columns: minmax(160px, 1fr) minmax(280px, 1.6fr) auto; }
}
@media (max-width: 860px) {
  :root { --player-h: 70px; --side-w: 0px; }
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 15; left: 0; right: 0; bottom: var(--player-h); top: auto; flex-direction: row; padding: 6px 8px; padding-bottom: calc(6px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line); background: rgba(12,12,18,.9); }
  body.no-player .sidebar { bottom: 0; }
  .app { padding-bottom: calc(var(--player-h) + 62px); }
  body.no-player .app { padding-bottom: 62px; }
  .brand, .side-foot { display: none; }
  .top-logo { display: block; }
  .sidebar nav { flex-direction: row; flex: 1; justify-content: space-around; }
  .sidebar nav a { flex-direction: column; gap: 3px; font-size: 11px; padding: 6px 4px; white-space: nowrap; }
  .sidebar nav a.on { background: none; }
  .topbar { padding: 12px 16px; }
  .search { max-width: none; }
  .view { padding: 0 16px 30px; }
  .page-head h1 { font-size: 32px; }
  .stage { --gap: 2.4vw; --wave: 6deg; --h: min(40vh, calc((100vw - 24px - 3 * var(--gap)) / var(--ars))); min-height: calc(var(--vh) - var(--player-h) - 62px - 110px); margin: 0 -16px; padding: 22px 4px 6px; }
  body.no-player .stage { min-height: calc(var(--vh) - 62px - 110px); }
  .stage.has, body.no-player .stage.has { --gap: clamp(4px, 4.4vw, 24px); --h: min(16vh, 124px, calc((100vw - 40px - 3 * var(--gap)) / var(--ars))); min-height: 0; }
  .stick { padding: 0; }
  .stick-name { margin-top: 12px; letter-spacing: .06em; }
  .stick-n { font-size: 11.5px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 20px 14px; }
  .grid.videos { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .yt-stage { margin-bottom: 24px; }
  .yt-now .a { font-size: 17px; display: block; } /* the page scrolls here: the whole title is shown */
  .album-hero { flex-direction: column; align-items: flex-start; gap: 18px; }
  .album-hero .cover { width: min(64vw, 260px); height: min(64vw, 260px); align-self: center; }
  .trow, .trow.with-album { grid-template-columns: 28px minmax(0, 1fr) 34px 44px; gap: 8px; padding: 7px 8px; }
  .trow .flags, .trow .alb { display: none; }
  .player { grid-template-columns: 1fr auto; padding: 0 10px 0 10px; bottom: 0; height: calc(var(--player-h) + env(safe-area-inset-bottom)); border-top: 0; }
  .p-left img { width: 46px; height: 46px; }
  .player.video .p-left img { width: 82px; }
  .p-center { flex-direction: row; }
  .p-center .progress, .p-center #shuffleBtn, .p-center #repeatBtn, .p-center #prevBtn { display: none; }
  .p-right { display: none; }
  .mini-progress { display: block; position: absolute; left: 10px; right: 10px; top: 0; height: 2px; background: rgba(255,255,255,.1); border-radius: 2px; overflow: hidden; }
  .mini-progress div { height: 100%; width: 0; background: var(--text); }
  .toast { bottom: calc(var(--player-h) + 80px); }
  .np-body { grid-template-columns: 1fr; padding: 74px 22px calc(22px + env(safe-area-inset-bottom)); gap: 0; align-items: stretch; }
  .np-left { justify-self: center; justify-content: flex-end; }
  .np-left img { width: min(100%, 46vh); align-self: center; }
  .np-right { display: none; }
  .np.tab-lyrics .np-right, .np.tab-queue .np-right { display: block; }
  .np.tab-lyrics .np-left img, .np.tab-queue .np-left img { display: none; }
  .np.tab-lyrics .np-body, .np.tab-queue .np-body { grid-template-rows: 1fr auto; }
  .np.tab-lyrics .np-left, .np.tab-queue .np-left { order: 2; }
  .np.tab-lyrics .np-meta, .np.tab-queue .np-meta { margin-top: 12px; }
  .lyrics { padding: 30vh 0 40vh; }
  .ly { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
