/* Plugged In. Sizes are in rem, and 1rem tracks the screen height (16px at 1080p),
   so the whole layout scales with the monitor. */

@property --ar { syntax: '<number>'; inherits: true; initial-value: 185; }
@property --ag { syntax: '<number>'; inherits: true; initial-value: 255; }
@property --ab { syntax: '<number>'; inherits: true; initial-value: 102; }

:root {
  --ar: 185; --ag: 255; --ab: 102;
  --a: var(--ar) var(--ag) var(--ab);
  transition: --ar 1.4s ease, --ag 1.4s ease, --ab 1.4s ease;

  --glass: rgb(14 14 20 / .44);
  --glass-solid: rgb(20 20 28 / .82);
  --line: rgb(255 255 255 / .12);
  --line-strong: rgb(255 255 255 / .22);
  --text: #fff;
  --muted: rgb(255 255 255 / .64);
  --faint: rgb(255 255 255 / .4);
  --spotify: #1ed760;
  --juice: #c77dff;
  --ease: cubic-bezier(.2, .8, .2, 1);

  --energy: 0;              /* how much the music is moving, set every frame */
  --pw: min(64rem, 74vw);   /* player width */
  --pb: 7vh;                /* player distance from bottom (clear of the taskbar) */
  --wy: 57vh;               /* middle of the album wheel */
  --wr: 13rem;              /* wheel radius (keep in step with RADIUS in app.js) */
  --lyric-font: "Bricolage Grotesque", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --ph: 4.4rem;             /* player height */

  font-size: 1.48vh;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #060608; }
body {
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  color: var(--text);
  user-select: none;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled { cursor: default; opacity: .35; }
input { font: inherit; color: inherit; }
img { display: block; }
svg { width: 1em; height: 1em; display: block; }
a { color: rgb(var(--a)); }
.hidden { display: none !important; }

::-webkit-scrollbar { width: .45rem; height: .45rem; }
::-webkit-scrollbar-thumb { background: rgb(255 255 255 / .16); border-radius: 1rem; }
::-webkit-scrollbar-track { background: transparent; }

.glass {
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(1.6rem) saturate(1.5);
  -webkit-backdrop-filter: blur(1.6rem) saturate(1.5);
  box-shadow: 0 1.2rem 3rem rgb(0 0 0 / .32), inset 0 1px 0 rgb(255 255 255 / .06);
}

/* ---------- background ---------- */

/* Photos mode: artist photos and cover art, lightly blurred, with a slow pan and
   zoom (three variations, picked at random). Soft mode: heavily blurred cover. */
#bg { position: fixed; inset: -6%; z-index: 0; will-change: transform; }
#bg .layer {
  position: absolute; inset: 0;
  background: #0b0b10 center / cover no-repeat;
  filter: blur(1.1rem) saturate(1.25) brightness(.5);
  opacity: 0;
  transition: opacity 2s ease;
  animation: kb0 30s ease-in-out infinite alternate;
}
#bg .layer.photo { filter: blur(.12rem) saturate(1.12) brightness(.5); background-position: center 22%; }
#bg .layer.kb1 { animation-name: kb1; }
#bg .layer.kb2 { animation-name: kb2; }
.bg-soft #bg .layer { filter: blur(3.2rem) saturate(1.2) brightness(.42); }
#bg .layer.on { opacity: 1; }
#bg .layer.idle {
  background:
    radial-gradient(55% 60% at 28% 30%, rgb(var(--a) / .55), transparent 70%),
    radial-gradient(50% 55% at 76% 72%, rgb(130 90 255 / .45), transparent 70%),
    radial-gradient(40% 40% at 70% 20%, rgb(255 80 160 / .25), transparent 70%),
    #0b0b10;
  filter: blur(2rem) brightness(.8);
}
@keyframes kb0 {
  from { transform: scale(1.06) translate(-1.6%, -1%); }
  to { transform: scale(1.22) translate(1.6%, 1.2%); }
}
@keyframes kb1 {
  from { transform: scale(1.22) translate(1.6%, .4%); }
  to { transform: scale(1.06) translate(-1.4%, -1.4%); }
}
@keyframes kb2 {
  from { transform: scale(1.1) translate(0, 1.6%) rotate(-.7deg); }
  to { transform: scale(1.25) translate(0, -1.6%) rotate(.7deg); }
}
#shade {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 42%, transparent 35%, rgb(0 0 0 / .55) 100%),
    linear-gradient(to bottom, rgb(0 0 0 / .3), transparent 24%, transparent 66%, rgb(0 0 0 / .5));
}
/* A wash of the theme colour that swells with the music. */
#pulse {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(75% 65% at 50% 45%, rgb(var(--a) / .2), transparent 72%);
  opacity: calc(var(--energy) * .9);
  mix-blend-mode: screen;
}
#fx { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; opacity: .8; }

/* ---------- edge glow ---------- */

#glow {
  --glow: .75;
  position: fixed; inset: 0; z-index: 6; pointer-events: none;
  opacity: var(--glow);
  mix-blend-mode: screen;
}
#glow .rim {
  position: absolute; inset: 0;
  box-shadow: inset 0 0 3.2rem .6rem rgb(var(--a) / .6), inset 0 0 11rem 1.6rem rgb(var(--a) / .2);
  opacity: calc(.4 + var(--energy) * .6);
}
#glow .rim.line { box-shadow: inset 0 0 .8rem .14rem rgb(var(--a) / .95); opacity: calc(.2 + var(--energy) * .8); }
#glow .blob {
  position: absolute;
  animation: blob var(--d, 9s) ease-in-out var(--delay, 0s) infinite alternate;
  will-change: transform;
}
#glow .blob b {
  display: block; width: 100%; height: 100%; border-radius: 50%;
  background: rgb(var(--a));
  filter: blur(2.2rem);
  opacity: calc(.38 + var(--energy) * .6);
  transform: scale(calc(.8 + var(--energy) * var(--k, .6) * 1.25));
  will-change: transform, opacity;
}
@keyframes blob {
  0% { transform: translate(0, 0) scale(1, .8); }
  50% { transform: translate(var(--dx), var(--dy)) scale(1.2, 1.05); }
  100% { transform: translate(calc(var(--dx) * -1), calc(var(--dy) * -.6)) scale(.9, .9); }
}

/* ---------- top pills ---------- */

#topbar {
  position: absolute; top: 1.1rem; left: 1.4rem; right: 1.4rem; z-index: 8;
  display: flex; justify-content: space-between; pointer-events: none;
}
.pill {
  pointer-events: auto;
  display: inline-flex; align-items: center; gap: .55rem;
  height: 2.1rem; padding: 0 .95rem; border-radius: 2rem;
  font-size: .8rem; font-weight: 600; color: rgb(255 255 255 / .9);
}
.pill b { font-weight: 800; }
#topbar .tr { display: flex; gap: .5rem; }
.pill.round { width: 2.1rem; padding: 0; justify-content: center; font-size: 1rem; }
.dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--c, #888); box-shadow: 0 0 .6rem var(--c, #888); flex: none; }

/* ---------- clock ---------- */

#clock {
  position: absolute; left: 50%; top: 5vh; z-index: 1;
  transform: translateX(-50%);
  text-align: center; pointer-events: none;
}
#clock .date {
  font-size: 1.15rem; font-weight: 600; letter-spacing: .02em;
  color: rgb(255 255 255 / .88);
  text-shadow: 0 .1rem .8rem rgb(0 0 0 / .4);
}
#clock .time {
  font-family: Bahnschrift, "DIN Condensed", "Roboto Condensed", "Arial Narrow", sans-serif;
  font-stretch: 75%;
  font-variation-settings: "wdth" 75, "wght" 300;
  font-weight: 300;
  font-size: 17.5rem; line-height: .86; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  color: rgb(var(--a));
  text-shadow: 0 0 2.4rem rgb(var(--a) / .4), 0 .3rem 1.4rem rgb(0 0 0 / .25);
  transform: scaleY(1.1); transform-origin: top center;
}
/* A glow behind the digits that breathes with the music. */
#clock::before {
  content: ""; position: absolute; left: 50%; top: 58%; z-index: -1;
  width: 80%; height: 55%;
  background: radial-gradient(closest-side, rgb(var(--a) / .45), transparent);
  filter: blur(2rem);
  opacity: calc(.25 + var(--energy) * .55);
  transform: translate(-50%, -50%) scale(calc(.9 + var(--energy) * .3));
}

/* ---------- carousel ---------- */

/* The album wheel. #stage is the wheel's centre point; app.js places each album
   on the circle around it and turns them every frame. */
#stage { position: absolute; left: 50%; top: var(--wy); z-index: 2; perspective: 70rem; animation: float 7s ease-in-out infinite; }
@keyframes float { 50% { translate: 0 -.5rem; } }
#carousel { position: absolute; left: 0; top: 0; transform-style: preserve-3d; will-change: transform; }
#czone { display: none; }
.cnav {
  position: absolute; top: calc(var(--wy) - 1.4rem); z-index: 4;
  width: 2.8rem; height: 2.8rem; border-radius: 50%;
  display: grid; place-items: center; font-size: 1.3rem; color: #fff;
  background: rgb(255 255 255 / .08); border: 1px solid var(--line);
  backdrop-filter: blur(1rem); -webkit-backdrop-filter: blur(1rem);
  opacity: .5; transition: opacity .25s, background .2s, transform .15s;
}
.cnav:hover { opacity: 1; background: rgb(255 255 255 / .16); }
.cnav:active { transform: scale(.92); }
.cnav.off { opacity: 0; pointer-events: none; }
#cPrev { left: calc(50% - var(--wr) - 7rem); }
#cNext { left: calc(50% + var(--wr) + 4.2rem); }
/* Every album on the wheel is the same size, with its cover at full brightness. */
.card {
  position: absolute; left: -3.1rem; top: -3.1rem;
  width: 6.2rem; height: 6.2rem;
  border-radius: .8rem;
  background: #1c1c24 center / cover no-repeat;
  box-shadow: 0 .8rem 1.8rem rgb(0 0 0 / .5), inset 0 0 0 1px rgb(255 255 255 / .14);
  cursor: pointer;
  will-change: transform, opacity;
  opacity: 0;
}
.card.cur { box-shadow: 0 1rem 2.2rem rgb(0 0 0 / .55), 0 0 1.8rem rgb(var(--a) / .3), inset 0 0 0 1px rgb(255 255 255 / .22); }
.card.cur::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: 0 0 calc(.8rem + var(--energy) * 2.4rem) rgb(var(--a) / calc(.15 + var(--energy) * .45));
}
.card .now-tag {
  position: absolute; left: 50%; bottom: -1.35rem; transform: translateX(-50%);
  font-size: .5rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap;
  color: rgb(var(--a)); text-shadow: 0 .1rem .5rem rgb(0 0 0 / .6);
  opacity: 0; transition: opacity .3s;
}
.browsing .card.playing-now .now-tag { opacity: 1; }

/* ---------- the middle of the wheel: lyrics, or the song's name ---------- */

#center {
  position: absolute; left: 50%; top: var(--wy); z-index: 3;
  width: 15.4rem; height: 15.4rem;
  transform: translate(-50%, -50%);
  animation: float 7s ease-in-out infinite; /* floats with the wheel */
  display: grid; place-items: center;
  text-align: center; pointer-events: none;
}
#center > * { grid-area: 1 / 1; width: 100%; transition: opacity .45s ease, transform .55s var(--ease); }
#center > .off { opacity: 0; transform: scale(.94); }

#meta { text-shadow: 0 .15rem 1.2rem rgb(0 0 0 / .55); }
#meta .hint {
  margin-bottom: .55rem;
  font-size: .68rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  color: rgb(var(--a)); opacity: 0; transition: opacity .3s;
}
#meta .hint.on { opacity: .95; }
#meta .t {
  font-family: var(--lyric-font); font-weight: 800; font-variation-settings: "wdth" 80, "opsz" 72;
  font-size: 2.2rem; line-height: .95; letter-spacing: -.015em; color: #f6f1e7;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
#meta .a { margin-top: .5rem; font-size: .95rem; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- sidebar ---------- */

#sidebar {
  position: absolute; left: 2.6rem; top: 26vh; z-index: 3;
  width: 19rem; max-height: 46vh;
  display: flex; flex-direction: column;
  border-radius: 1.3rem; overflow: hidden;
}
#sidebar .tabs { display: flex; gap: .2rem; padding: .5rem; border-bottom: 1px solid var(--line); }
.tab {
  flex: 1 1 auto; height: 2rem; padding: 0 .5rem; border-radius: .65rem;
  font-size: .74rem; font-weight: 650; color: var(--muted); white-space: nowrap;
  transition: background .2s, color .2s;
}
.tab:hover { color: var(--text); }
.tab.on { background: rgb(255 255 255 / .12); color: var(--text); }
.jseg { display: flex; flex-wrap: wrap; gap: .25rem; padding: .45rem .5rem 0; }
.jseg button {
  height: 1.7rem; padding: 0 .6rem; border-radius: 2rem;
  font-size: .7rem; font-weight: 650; color: var(--muted);
  border: 1px solid var(--line);
}
.jseg button.on { color: #13061f; background: var(--juice); border-color: transparent; }
.jseg .dice { margin-left: auto; width: 1.7rem; padding: 0; display: grid; place-items: center; font-size: .9rem; }
#list { overflow-y: auto; padding: .4rem; flex: 1; min-height: 4rem; }
.row {
  display: flex; align-items: center; gap: .65rem;
  width: 100%; padding: .38rem; border-radius: .7rem; text-align: left;
  transition: background .15s, transform .15s;
  animation: rowIn .45s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 22ms);
  cursor: pointer;
}
.row:hover { background: rgb(255 255 255 / .08); transform: translateX(.15rem); }
@keyframes rowIn { from { opacity: 0; transform: translateX(-.6rem); } }
.row .img { position: relative; width: 2.6rem; height: 2.6rem; border-radius: .45rem; flex: none; background: #2a2a34 center / cover no-repeat; }
.row .img.swatch { display: grid; place-items: center; font-size: 1.15rem; color: rgb(255 255 255 / .92); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .15); }
/* Mood cards: a 2x2 collage of covers, tinted with the mood's colour. */
.moods { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; padding: .1rem; }
.mood {
  position: relative; aspect-ratio: 1; border-radius: .9rem; overflow: hidden; cursor: pointer;
  box-shadow: 0 .5rem 1.2rem rgb(0 0 0 / .35), inset 0 0 0 1px rgb(255 255 255 / .12);
  animation: rowIn .5s var(--ease) backwards; animation-delay: calc(var(--i) * 45ms);
  transition: transform .2s var(--ease), box-shadow .2s;
}
.mood:first-child { grid-column: 1 / -1; aspect-ratio: 2.1; }
.mood:hover { transform: translateY(-.15rem) scale(1.02); box-shadow: 0 .8rem 1.6rem rgb(0 0 0 / .45), 0 0 1.4rem var(--c1a), inset 0 0 0 1px rgb(255 255 255 / .2); }
.mood .collage { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.mood:first-child .collage { grid-template-columns: repeat(4, 1fr); grid-template-rows: 1fr; }
.mood .collage span { background: #222 center / cover no-repeat; transition: transform 6s ease; }
.mood:hover .collage span { transform: scale(1.12); }
.mood .tint {
  position: absolute; inset: 0;
  background:
    linear-gradient(to top, var(--c2a) 8%, var(--c2b) 55%, transparent),
    linear-gradient(135deg, var(--c1a), transparent 60%);
}
.mood .mt { position: absolute; left: .65rem; right: .65rem; bottom: .55rem; text-shadow: 0 .1rem .5rem rgb(0 0 0 / .6); }
.mood .mt b { display: block; font-family: var(--lyric-font); font-weight: 800; font-size: 1.15rem; line-height: 1; letter-spacing: -.01em; text-transform: lowercase; }
.mood .mt small { display: block; margin-top: .2rem; font-size: .62rem; color: rgb(255 255 255 / .8); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mood .radio {
  position: absolute; right: .5rem; top: .5rem;
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .2rem .45rem .2rem .35rem; border-radius: 1rem;
  font-size: .58rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: #111; background: var(--c1); box-shadow: 0 .2rem .6rem rgb(0 0 0 / .35);
}
.mood .radio svg { font-size: .7rem; }
.mood .radio em { font-style: normal; }

/* Little equaliser on the song that's playing. */
.eq { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center; gap: .14rem; padding-bottom: .55rem; border-radius: inherit; background: rgb(0 0 0 / .5); }
.eq i { width: .22rem; height: .35rem; border-radius: .1rem; background: rgb(var(--a)); }
.playing .eq i { animation: eq .85s ease-in-out infinite alternate; }
.eq i:nth-child(2) { animation-delay: -.28s; }
.eq i:nth-child(3) { animation-delay: -.55s; }
@keyframes eq { from { height: .3rem; } to { height: 1.35rem; } }
.row .tx { min-width: 0; flex: 1; }
.row .n { font-size: .84rem; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .s { margin-top: .1rem; font-size: .72rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: .35rem; }
.row .s span { overflow: hidden; text-overflow: ellipsis; }
.row.now .n { color: rgb(var(--a)); }
.row .rk { width: 1.2rem; flex: none; text-align: center; font-size: .78rem; font-weight: 800; color: var(--faint); }
.row .act {
  width: 1.9rem; height: 1.9rem; flex: none; border-radius: 50%;
  display: grid; place-items: center; font-size: .9rem; color: var(--muted);
  opacity: 0; transition: opacity .15s, background .15s;
}
.row:hover .act { opacity: 1; }
.row .act:hover { background: rgb(255 255 255 / .12); color: var(--text); }
.row .act.sp { color: var(--spotify); }
.empty { padding: 1.2rem .8rem; text-align: center; font-size: .82rem; color: var(--muted); line-height: 1.45; }

.badge {
  display: inline-block; flex: none;
  padding: .05rem .38rem; border-radius: .35rem;
  font-size: .58rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
  color: #111; background: var(--bc, #aaa);
}

/* ---------- lyrics ---------- */

/* Like the video: lowercase, heavy and a little condensed, a word or two per
   line, tightly stacked, warm white with a soft glow. app.js sets the size so
   the line fits inside the wheel. */
#lyrics .cur {
  font-family: var(--lyric-font);
  font-weight: 800; font-variation-settings: "wdth" 78, "opsz" 96;
  font-size: 3.4rem; line-height: .84; letter-spacing: -.025em;
  text-transform: lowercase;
  color: #f6f1e7;
  text-shadow: 0 .25rem 1.2rem rgb(0 0 0 / .55), 0 0 1.8rem rgb(var(--a) / .28);
  transform: scale(calc(1 + var(--energy) * .045));
}
#lyrics .ln { display: block; }
/* The lens look: app.js gives each letter its own size, biggest in the middle. */
#lyrics .w i { font-style: normal; vertical-align: middle; }
#lyrics .w { display: inline-block; animation: wordIn .5s var(--ease) both; animation-delay: calc(var(--i) * 60ms); }
#lyrics .credit { margin-top: 1rem; font-size: .55rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: rgb(255 255 255 / .28); }
@keyframes wordIn {
  from { opacity: 0; filter: blur(.5rem); transform: translateY(.6rem) scale(.96); }
  to { opacity: 1; filter: none; transform: none; }
}

/* ---------- player bar ---------- */

#player {
  position: absolute; left: 50%; bottom: var(--pb); z-index: 8;
  width: var(--pw); height: var(--ph);
  transform: translateX(-50%);
  display: flex; align-items: center; gap: .8rem;
  padding: 0 .8rem; border-radius: 1.3rem;
}
.src {
  width: 2.8rem; height: 2.8rem; flex: none; border-radius: .9rem;
  display: grid; place-items: center; font-size: 1.55rem;
  background: rgb(255 255 255 / .07);
  transition: background .2s;
}
.src:hover { background: rgb(255 255 255 / .13); }
.search {
  flex: 0 1 15rem; min-width: 8rem; height: 2.8rem;
  display: flex; align-items: center; gap: .55rem;
  padding: 0 .85rem; border-radius: .9rem;
  background: rgb(255 255 255 / .07); color: var(--muted);
  cursor: text; transition: background .2s, box-shadow .2s;
}
.search:focus-within { background: rgb(255 255 255 / .11); box-shadow: 0 0 0 1px rgb(var(--a) / .55); }
.search .sicon { font-size: 1rem; flex: none; }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: none; font-size: .92rem; color: var(--text); user-select: text; }
.search input::placeholder { color: var(--faint); }
.ctrls { display: flex; align-items: center; gap: .25rem; flex: none; }
.ib {
  width: 2.4rem; height: 2.4rem; flex: none; border-radius: 50%;
  display: grid; place-items: center; font-size: 1.15rem;
  color: rgb(255 255 255 / .86);
  transition: background .2s, color .2s, transform .12s;
}
.ib:hover:not(:disabled) { background: rgb(255 255 255 / .1); color: #fff; }
.ib:active:not(:disabled) { transform: scale(.92); }
.ib.big { width: 2.9rem; height: 2.9rem; font-size: 1.3rem; color: #0c0c10; background: rgb(255 255 255 / .94); }
.ib.big:hover:not(:disabled) { background: #fff; color: #0c0c10; }
.ib.on { color: rgb(var(--a)); }
.np {
  flex: 1; min-width: 0;
  display: grid; grid-template-columns: 2.8rem minmax(0, 1fr); grid-template-rows: auto auto;
  column-gap: .75rem; row-gap: .3rem; align-items: center;
}
.np img { grid-row: 1 / 3; width: 2.8rem; height: 2.8rem; border-radius: .55rem; object-fit: cover; background: #2a2a34; }
.np img:not([src]) { visibility: hidden; }
.np-text { display: flex; align-items: baseline; gap: .5rem; min-width: 0; }
.np-title { font-size: .92rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; min-width: 0; }
.np-artist { font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1 1 0; min-width: 0; }
.prog { display: flex; align-items: center; gap: .55rem; font-size: .7rem; color: var(--faint); font-variant-numeric: tabular-nums; }
.bar { flex: 1; height: .3rem; border-radius: 1rem; background: rgb(255 255 255 / .15); overflow: hidden; cursor: pointer; position: relative; }
.bar::after { content: ""; position: absolute; inset: -.5rem 0; }
.bar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, rgb(var(--a) / .7), rgb(var(--a))); box-shadow: 0 0 .7rem rgb(var(--a) / .8); border-radius: inherit; transform-origin: left; transform: scaleX(0); }
.right { display: flex; align-items: center; gap: .05rem; flex: none; }
.vol { display: flex; align-items: center; gap: .35rem; margin-left: .3rem; color: var(--muted); font-size: 1rem; }
.vol input { width: 5rem; accent-color: rgb(var(--a)); cursor: pointer; }

/* ---------- menus ---------- */

.menu {
  position: absolute; z-index: 20;
  bottom: calc(var(--pb) + var(--ph) + .7rem);
  min-width: 17rem; max-width: 22rem; padding: .4rem; border-radius: 1rem;
  background: var(--glass-solid);
}
#srcMenu { left: calc(50% - var(--pw) / 2); }
#devMenu { right: calc(50% - var(--pw) / 2); }
#themeMenu { right: calc(50% - var(--pw) / 2); width: 23rem; max-width: 23rem; padding: .5rem .55rem .7rem; }

/* ---------- colour theme menu ---------- */

.tmodes { display: grid; gap: .3rem; }
.tmodes.two { grid-template-columns: 1fr 1fr; }
.tmodes button {
  display: flex; align-items: center; gap: .65rem;
  padding: .5rem .6rem; border-radius: .75rem; text-align: left;
  font-size: .86rem; font-weight: 650; border: 1px solid transparent;
  transition: background .15s, border-color .15s;
}
.tmodes button:hover { background: rgb(255 255 255 / .07); }
.tmodes button.on { background: rgb(var(--a) / .14); border-color: rgb(var(--a) / .6); }
.tmodes small { display: block; margin-top: .05rem; font-size: .7rem; font-weight: 500; color: var(--muted); }
.sw { width: 1.6rem; height: 1.6rem; flex: none; border-radius: 50%; box-shadow: inset 0 0 0 2px rgb(255 255 255 / .25); }
.sw.art { background: conic-gradient(from 30deg, #ff7a3c, #ffd23c, #b9ff66, #3cc8ff, #b45cff, #ff7a3c); }
.sw.avg { background: radial-gradient(circle at 35% 30%, #c9a98a, #5f5047); }
.wheelbox { display: flex; gap: .95rem; align-items: center; padding: .7rem .4rem .4rem; }
.wheel {
  position: relative; width: 8.6rem; height: 8.6rem; flex: none; border-radius: 50%;
  cursor: crosshair; touch-action: none;
  background: radial-gradient(closest-side, #fff, rgb(255 255 255 / 0)), conic-gradient(red, yellow, lime, cyan, blue, magenta, red);
  box-shadow: 0 0 0 1px rgb(255 255 255 / .2), 0 .6rem 1.4rem rgb(0 0 0 / .4);
  transition: opacity .2s, filter .2s;
}
.wheel.dim { opacity: .6; filter: saturate(.65); }
.wheel.dim:hover { opacity: 1; filter: none; }
.knob {
  position: absolute; width: 1.15rem; height: 1.15rem; margin: -.575rem 0 0 -.575rem; border-radius: 50%;
  border: 2px solid #fff; box-shadow: 0 0 0 1px rgb(0 0 0 / .45), 0 .2rem .5rem rgb(0 0 0 / .5);
  pointer-events: none;
}
.wside { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .55rem; }
.swatch { height: 2rem; border-radius: .6rem; box-shadow: inset 0 0 0 1px rgb(255 255 255 / .2); }
.lrow { display: flex; flex-direction: column; gap: .25rem; font-size: .72rem; font-weight: 600; color: var(--muted); }
.lrow input { width: 100%; accent-color: rgb(var(--a)); cursor: pointer; }
.presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; }
.presets button { aspect-ratio: 1; border-radius: 50%; box-shadow: inset 0 0 0 2px rgb(255 255 255 / .25); transition: transform .12s; }
.presets button:hover { transform: scale(1.14); }
.menu h5 { margin: .35rem .6rem .45rem; font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.mi {
  display: flex; align-items: center; gap: .75rem;
  width: 100%; padding: .55rem .65rem; border-radius: .7rem;
  text-align: left; font-size: .9rem; font-weight: 650;
}
.mi:hover { background: rgb(255 255 255 / .09); }
.mi .ic { width: 2rem; height: 2rem; flex: none; border-radius: .6rem; display: grid; place-items: center; font-size: 1.35rem; background: rgb(255 255 255 / .06); }
.mi small { display: block; margin-top: .05rem; font-size: .72rem; font-weight: 500; color: var(--muted); }
.mi .ck { margin-left: auto; color: rgb(var(--a)); font-size: 1.1rem; }

/* ---------- search results ---------- */

#results {
  position: absolute; left: 50%; z-index: 9;
  bottom: calc(var(--pb) + var(--ph) + .7rem);
  width: var(--pw); max-height: 46vh;
  transform: translateX(-50%);
  overflow-y: auto; padding: .9rem 1.2rem 1.2rem; border-radius: 1.3rem;
  background: var(--glass-solid);
}
#results.busy > :not(.seg) { opacity: .55; transition: opacity .2s; }
.seg { display: flex; gap: .35rem; position: sticky; top: -.9rem; padding: .2rem 0 .4rem; z-index: 2; }
.seg button {
  display: inline-flex; align-items: center; gap: .4rem;
  height: 1.9rem; padding: 0 .8rem; border-radius: 2rem;
  font-size: .78rem; font-weight: 650; color: var(--muted);
  background: rgb(30 30 40 / .9); border: 1px solid var(--line);
}
.seg button svg { font-size: .95rem; }
.seg button.on { color: #0c0c10; background: #fff; border-color: transparent; }
#results h4 {
  display: flex; align-items: center; gap: .5rem;
  margin: .9rem 0 .55rem; font-size: .74rem; font-weight: 750;
  letter-spacing: .09em; text-transform: uppercase; color: var(--muted);
}
#results h4 svg { font-size: 1rem; }
.rgrid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: .5rem; }
.rcard { position: relative; text-align: left; padding: .45rem; border-radius: .9rem; transition: background .15s; min-width: 0; }
.rcard:hover { background: rgb(255 255 255 / .08); }
.rcard .img { aspect-ratio: 1; border-radius: .6rem; background: #2a2a34 center / cover no-repeat; box-shadow: 0 .5rem 1.2rem rgb(0 0 0 / .3); }
.rcard.round .img { border-radius: 50%; }
.rcard .n { margin-top: .45rem; font-size: .82rem; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rcard .s { margin-top: .08rem; font-size: .7rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rcard .badge { position: absolute; left: .85rem; top: .85rem; }
.rcard .act {
  position: absolute; right: .85rem; bottom: 3.3rem;
  width: 2.2rem; height: 2.2rem; border-radius: 50%;
  display: grid; place-items: center; font-size: 1.05rem;
  background: var(--spotify); color: #06120a;
  box-shadow: 0 .4rem 1rem rgb(0 0 0 / .4);
  opacity: 0; transform: translateY(.3rem); transition: opacity .15s, transform .15s;
}
.rcard:hover .act { opacity: 1; transform: none; }
.rcard .ext { position: absolute; right: .85rem; top: .85rem; width: 1.6rem; height: 1.6rem; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; background: rgb(0 0 0 / .55); color: #fff; opacity: 0; transition: opacity .15s; }
.rcard:hover .ext { opacity: 1; }
.note { margin: .7rem 0; font-size: .85rem; color: var(--muted); }
.note button { color: rgb(var(--a)); font-weight: 700; text-decoration: underline; }

/* ---------- setup card ---------- */

#setup {
  position: absolute; left: 50%; top: 50%; z-index: 30;
  width: 36rem; max-width: calc(100vw - 2rem);
  transform: translate(-50%, -50%);
  padding: 1.7rem 1.9rem; border-radius: 1.4rem;
  background: var(--glass-solid);
}
#setup h2 { margin: 0 0 .35rem; font-size: 1.55rem; display: flex; align-items: center; gap: .6rem; }
#setup h2 svg { font-size: 1.7rem; }
#setup .lead { margin: 0 0 .9rem; color: var(--muted); font-size: .95rem; line-height: 1.5; }
#setup ol { margin: 0 0 1rem; padding-left: 1.25rem; font-size: .92rem; line-height: 1.6; color: rgb(255 255 255 / .88); }
#setup li { margin-bottom: .35rem; }
#setup code { padding: .1rem .4rem; border-radius: .35rem; background: rgb(255 255 255 / .1); font-family: Consolas, monospace; font-size: .85rem; user-select: all; }
.mini { margin-left: .3rem; padding: .1rem .5rem; border-radius: .4rem; font-size: .75rem; font-weight: 700; background: rgb(255 255 255 / .12); }
.field { display: flex; flex-wrap: wrap; gap: .5rem; }
.field input {
  flex: 1 1 15rem; min-width: 0; height: 2.6rem; padding: 0 .85rem; border-radius: .75rem;
  border: 1px solid var(--line-strong); background: rgb(0 0 0 / .3); outline: none;
  font-family: Consolas, monospace; font-size: .9rem; user-select: text;
}
.field input:focus { border-color: var(--spotify); }
.btn { height: 2.6rem; padding: 0 1.1rem; border-radius: .75rem; font-weight: 700; font-size: .9rem; background: rgb(255 255 255 / .12); white-space: nowrap; }
.btn.primary { background: var(--spotify); color: #06120a; }
#setup .err { min-height: 1.2rem; margin: .5rem 0 0; color: #ff8a8a; font-size: .82rem; }
#setup .small { margin: .6rem 0 0; font-size: .8rem; color: var(--muted); }
.linkish { color: var(--muted); text-decoration: underline; font-size: inherit; }

/* ---------- toasts ---------- */

#toasts {
  position: absolute; left: 50%; top: 1.1rem; z-index: 40;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
  pointer-events: none;
}
.toast {
  max-width: 34rem; padding: .6rem 1.05rem; border-radius: .9rem;
  font-size: .86rem; font-weight: 600;
  background: var(--glass-solid);
  animation: toastIn .35s var(--ease) both;
}
.toast.err { border-color: rgb(255 120 120 / .45); }
.toast.out { opacity: 0; transform: translateY(-.4rem); transition: opacity .35s, transform .35s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-.6rem); } }

/* ---------- pop-out search window (?mode=remote) ---------- */

html.remote { font-size: 14px; --pw: auto; }
.remote #clock, .remote #sidebar, .remote #stage, .remote #center, .remote #glow, .remote #jlive,
.remote #fx, .remote #pulse, .remote #czone, .remote .cnav { display: none !important; }
.remote #topbar { display: none; }
.remote #player { left: 12px; right: 12px; top: 12px; bottom: auto; width: auto; transform: none; }
.remote .search { flex: 1 1 auto; }
.remote .np { flex: 0 1 16rem; }
.remote .right .vol, .remote #lyrBtn { display: none; }
.remote #results { display: block !important; left: 12px; right: 12px; top: calc(12px + var(--ph) + 10px); bottom: 12px; width: auto; max-height: none; transform: none; }
.remote .rgrid { grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); }
.remote .menu { bottom: auto; top: calc(12px + var(--ph) + 8px); }
.remote #srcMenu { left: 12px; }
.remote #devMenu, .remote #themeMenu { right: 12px; }
.remote #toasts { top: auto; bottom: 14px; }
