/* Awesome Downloader Music -- the web player, in the Windows app's design language
   (docs/music-design.md in the app):
   - the page wears its picture: painted from the album / artist / playing song,
     cross-fading over 350 ms, with film grain and light leaks over the colour
   - text is white at three strengths; names in Inter Black, upper case, as large as fits
   - one solid white pill per page; everything else is rings or thin small-caps frames
   - the rail is near-black and quiet; only its marker takes the page's colour
   Colours (as "r g b" triplets) are set live by music.js: --p-* for the page,
   --c-* for the player (the playing song's). */

@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('../fonts/inter-variable.ttf') format('truetype');
}
@font-face {
  font-family: 'Instrument Serif'; font-style: italic; font-weight: 400; font-display: swap;
  src: url('../fonts/instrument-serif-italic-400-latin.woff2') format('woff2');
}

:root {
  /* the page (music.js: the picture's palette); the app's night navy until there is one */
  --p-base: 27 46 96;
  --p-deep: 7 11 26;
  --p-glow: 61 99 201;
  --p-accent: 120 168 255;
  /* the player (the playing song's) */
  --c-base: 27 46 96;
  --c-deep: 7 11 26;
  --c-glow: 61 99 201;
  --c-accent: 244 164 122;
  --t1: #fff;
  --t2: rgba(255,255,255,.75);
  --t3: rgba(255,255,255,.53);
  --hair: rgba(255,255,255,.10);
  --rail-bg: #101116;
  --rail-text: #e9eaef;
  --rail-muted: #9a9eab;
  --rail-label: #5d6170;
  --rail-field: #1b1d24;
  --rail-w: 240px;
  --bar-h: 100px;
  --ease: cubic-bezier(.2,.8,.2,1);
  --pop: cubic-bezier(.34,1.45,.64,1);
  --font: 'Inter', 'Segoe UI Variable Display', 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body.m-body {
  background: #07080c; color: var(--t1); font: 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased; overflow: hidden; font-feature-settings: 'cv11', 'ss01';
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
a { color: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg .f { fill: currentColor; stroke: none; }
svg text { fill: currentColor; stroke: none; font: 700 6.6px var(--font); }
:focus-visible { outline: 2px solid rgb(var(--p-accent)); outline-offset: 2px; border-radius: 8px; }
input[type=search]::-webkit-search-cancel-button { filter: invert(1) opacity(.5); }

/* ── the frame: floating panels ───────────────────────────────────── */
.m-app {
  position: fixed; inset: 0 0 calc(var(--bar-h) + 16px) 0; display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr); gap: 10px; padding: 10px 10px 0;
}

/* the rail */
.m-rail {
  display: flex; flex-direction: column; min-height: 0; overflow-y: auto; scrollbar-width: none;
  padding: 10px 10px 16px; border-radius: 22px; border: 1px solid rgba(255,255,255,.06);
  background: linear-gradient(180deg, color-mix(in srgb, rgb(var(--p-deep)) 55%, var(--rail-bg)), var(--rail-bg) 70%);
  transition: background .35s;
}
.m-rail::-webkit-scrollbar { display: none; }
.m-rail-card {
  padding: 12px 8px 8px; border-radius: 18px; border: 1px solid rgba(255,255,255,.07);
  background: rgba(255,255,255,.035);
}
.m-brand-row { display: flex; align-items: center; justify-content: space-between; padding: 0 6px 10px; }
.m-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.m-bolt { width: 30px; height: 30px; color: #8fb4ff; stroke-width: 1.6; }
.m-bolt path { fill: rgba(143,180,255,.25); }
.m-brand span { font: italic 400 27px/1 'Instrument Serif', serif; color: #a9c4ff; letter-spacing: -.01em; }
.m-rail-dots { text-decoration: none; color: var(--rail-muted); font-size: 20px; letter-spacing: 1px; padding: 0 4px; }
.m-search { position: relative; display: flex; align-items: center; margin: 0 0 8px; }
.m-search svg { position: absolute; left: 13px; width: 16px; height: 16px; color: var(--rail-muted); }
.m-search input {
  width: 100%; height: 38px; border-radius: 19px; border: 1px solid rgba(255,255,255,.07); background: var(--rail-field);
  color: var(--rail-text); padding: 0 34px 0 38px; font: 500 13.5px var(--font); outline: none; transition: border-color .2s;
}
.m-search input:focus { border-color: rgba(255,255,255,.22); }
.m-search input::placeholder { color: var(--rail-muted); }
.m-search kbd { position: absolute; right: 12px; font: 500 10.5px var(--font); color: var(--rail-label); }
.m-nav { display: flex; flex-direction: column; gap: 1px; }
.m-nav-item {
  position: relative; display: flex; align-items: center; gap: 13px; height: 38px; padding: 0 12px; border-radius: 10px;
  color: var(--rail-text); font: 500 14.5px var(--font); text-align: left; transition: background .15s;
}
.m-nav-item[hidden] { display: none; }
.m-nav-item svg { width: 19px; height: 19px; color: var(--rail-text); }
.m-nav-item:hover { background: rgba(255,255,255,.05); }
.m-nav-item.is-on { background: rgba(255,255,255,.085); }
.m-nav-item.is-on::before {
  content: ""; position: absolute; left: 5px; top: 10px; bottom: 10px; width: 2.5px; border-radius: 2px;
  background: rgb(var(--p-accent)); box-shadow: 0 0 8px rgb(var(--p-accent) / .7); transition: background .35s;
}
.m-count { margin-left: auto; font: 500 12px var(--font); color: var(--rail-muted); }
.m-label { margin: 22px 14px 8px; font: 700 10.5px var(--font); letter-spacing: .16em; text-transform: uppercase; color: var(--rail-label); }
.m-nav-lib { padding: 0 2px; }
.m-app-cta {
  display: flex; gap: 12px; align-items: center; margin: 0 4px; padding: 10px; border-radius: 14px; text-decoration: none;
  transition: background .15s;
}
.m-app-cta:hover { background: rgba(255,255,255,.05); }
.m-app-ico { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; flex: none;
  background: linear-gradient(140deg, rgb(var(--p-accent) / .35), rgb(var(--p-glow) / .2)); }
.m-app-ico svg { width: 18px; height: 18px; }
.m-app-cta b { display: block; font: 600 14px var(--font); color: var(--rail-text); }
.m-app-cta small { display: block; font-size: 12px; color: var(--rail-muted); line-height: 1.35; }

/* the stage: painted from its picture */
.m-stage { position: relative; border-radius: 22px; overflow: hidden; min-height: 0; isolation: isolate;
  border: 1px solid rgba(255,255,255,.07); }
.m-bg {
  position: absolute; inset: 0; z-index: -3; opacity: 0; transition: opacity .35s linear;
  background:
    radial-gradient(70% 80% at 82% 14%, rgb(var(--g) / .50) 0%, rgb(var(--g) / .16) 45%, rgb(var(--g) / 0) 100%),
    linear-gradient(to top right, rgb(var(--d)) 0%, color-mix(in srgb, rgb(var(--d)) 28%, rgb(var(--b))) 55%, rgb(var(--b)) 100%);
}
.m-bg.is-on { opacity: 1; }
/* soft vertical light along the left, as the app's leaks */
.m-leaks {
  position: absolute; inset: 0; z-index: -2; pointer-events: none; mix-blend-mode: screen; opacity: .9;
  background:
    linear-gradient(90deg, transparent 2%, rgb(var(--p-glow) / .10) 5%, transparent 9%, transparent 13%,
      rgb(var(--p-glow) / .07) 16%, transparent 21%, transparent 26%, rgba(255,255,255,.03) 28%, transparent 31%);
  filter: blur(10px); transition: background .35s;
}
/* film grain and dust over everything on the page */
.m-film {
  position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .55; mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E"),
    radial-gradient(1px 1px at 12% 22%, rgba(255,255,255,.5), transparent), radial-gradient(1px 1px at 63% 71%, rgba(255,255,255,.4), transparent),
    radial-gradient(1.2px 1.2px at 81% 38%, rgba(255,255,255,.35), transparent), radial-gradient(1px 1px at 34% 88%, rgba(255,255,255,.4), transparent);
}
.m-scroll { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; scroll-behavior: smooth;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent; }
.m-scroll::-webkit-scrollbar { width: 8px; }
.m-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.16); border-radius: 8px; }
.m-page { padding: 18px 36px 48px; animation: m-page-in .35s var(--ease); }
@keyframes m-page-in { from { opacity: 0; transform: translateY(6px); } }

/* top of the page: back / reload rings */
.m-top-ctl { display: flex; gap: 10px; height: 34px; margin: 6px 0 14px; }
.m-ring-sm { width: 32px; height: 32px; border-radius: 50%; border: 1px solid rgba(255,255,255,.38); display: grid; place-items: center; transition: background .15s, border-color .15s; }
.m-ring-sm svg { width: 15px; height: 15px; stroke-width: 2; }
.m-ring-sm:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.6); }

/* the hero: name huge on the left, picture on the right melting into the page */
.m-hero { position: relative; display: flex; gap: 32px; min-height: clamp(300px, 46vh, 520px); padding-bottom: 28px; }
.m-hero-text { position: relative; z-index: 1; flex: 1; min-width: 0; display: flex; flex-direction: column; }
.m-over { margin: 0 0 10px; font: 800 11.5px var(--font); letter-spacing: .2em; text-transform: uppercase; color: var(--t1); opacity: .9; }
.m-name {
  margin: 0; font: 900 104px/.92 var(--font); text-transform: uppercase; letter-spacing: -.02em; color: #fff;
  max-width: 100%; word-break: break-word; overflow-wrap: anywhere;
}
.m-line { margin: 14px 0 0; max-width: 720px; color: var(--t2); font: 500 15px/1.5 var(--font); }
.m-line a { color: var(--t1); text-decoration: none; }
.m-line a:hover { text-decoration: underline; }
.m-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.m-pill {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 18px 0 16px; border-radius: 19px;
  background: #fff; color: #0a0b10; font: 700 13.5px var(--font); transition: background .15s, transform .15s var(--pop);
}
.m-pill svg { width: 16px; height: 16px; }
.m-pill:hover { background: #eceef4; }
.m-pill:active { transform: scale(.96); }
.m-ring { width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(255,255,255,.4); display: grid; place-items: center; transition: background .15s, border-color .15s; flex: none; }
.m-ring svg { width: 17px; height: 17px; }
.m-ring:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.7); }
.m-frame {
  height: 32px; padding: 0 12px; border: 1px solid rgba(255,255,255,.55); border-radius: 2px;
  font: 800 10.5px var(--font); letter-spacing: .16em; text-transform: uppercase; transition: background .15s;
}
.m-frame:hover { background: rgba(255,255,255,.1); }
/* the picture: a cover stands on a reflection in its own light; a photo melts into the page */
.m-pic { position: relative; flex: none; align-self: flex-start; margin-top: 18px; }
.m-pic-cover { width: clamp(180px, 22vw, 290px); aspect-ratio: 1; }
.m-pic-cover::before { content: ""; position: absolute; inset: -40%; z-index: -1;
  background: radial-gradient(closest-side, rgb(var(--p-glow) / .42), rgb(var(--p-glow) / .14) 45%, transparent); }
.m-pic-cover img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 6px; display: block;
  box-shadow: 0 24px 40px -12px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.18) inset;
  -webkit-box-reflect: below 8px linear-gradient(transparent 72%, rgba(0,0,0,.28));
  animation: m-fade-in .35s ease;
}
.m-pic-photo { position: absolute; right: -36px; top: -18px; bottom: 0; width: min(58%, 760px); z-index: 0; pointer-events: none; }
.m-pic-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 25%;
  -webkit-mask-image: linear-gradient(to left, #000 45%, transparent 98%), linear-gradient(to top, transparent 0%, #000 30%);
  -webkit-mask-composite: source-in; mask-image: linear-gradient(to left, #000 45%, transparent 98%);
  opacity: .92; animation: m-fade-in .35s ease; }
@keyframes m-fade-in { from { opacity: 0; } }

/* sections */
.m-section { margin-top: 30px; }
.m-section-label { margin: 0 0 14px 4px; font: 800 11.5px var(--font); letter-spacing: .2em; text-transform: uppercase; color: var(--t1); }
.m-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 190px)); gap: 22px; }
.m-col { cursor: pointer; min-width: 0; }
.m-col b { display: block; font: 800 13px var(--font); letter-spacing: .02em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-col span { display: block; font-size: 13px; color: var(--t2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-col:hover b { text-decoration: underline; text-underline-offset: 3px; }

/* song rows: number, +, cover, title over artist, album, length, ⋮ */
.m-rows { display: flex; flex-direction: column; }
.m-row {
  display: grid; grid-template-columns: 36px 28px 38px minmax(0, 1.5fr) minmax(0, 1fr) 52px 36px; align-items: center;
  gap: 12px; height: 50px; padding: 0 8px; border-radius: 6px; cursor: pointer; transition: background .12s;
  animation: m-rise .4s var(--ease) both;
}
.m-row:hover { background: rgba(255,255,255,.07); }
.m-row.is-current { background: rgba(255,255,255,.12); }
@keyframes m-rise { from { opacity: 0; transform: translateY(6px); } }
.m-row-n { font: 500 13px var(--font); color: var(--t2); text-align: center; position: relative; height: 18px; }
.m-row-n .n { display: inline; }
.m-row-n .p, .m-row-n .bars { display: none; }
.m-row:hover .m-row-n .n { display: none; }
.m-row:hover .m-row-n .p { display: inline-block; }
.m-row.is-current .m-row-n .n, .m-row.is-current .m-row-n .p { display: none; }
.m-row.is-current .m-row-n .bars { display: inline-flex; }
.m-row-n .p svg { width: 14px; height: 14px; }
.bars { gap: 2px; align-items: flex-end; height: 14px; }
.bars i { width: 3px; background: rgb(var(--p-accent)); border-radius: 1px; height: 30%; }
body.is-playing .m-row.is-current .bars i { animation: m-bar .9s steps(12) infinite; }
.bars i:nth-child(2) { animation-delay: -.3s !important; }
.bars i:nth-child(3) { animation-delay: -.6s !important; }
@keyframes m-bar { 0%,100% { height: 25%; } 30% { height: 100%; } 60% { height: 55%; } 80% { height: 85%; } }
.m-row-add { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: var(--t2); }
.m-row-add:hover { color: #fff; background: rgba(255,255,255,.12); }
.m-row-add svg { width: 16px; height: 16px; }
.m-row-cover { width: 38px; height: 38px; border-radius: 4px; object-fit: cover; background: rgba(255,255,255,.08); }
.m-row-names { min-width: 0; line-height: 1.3; }
.m-row-names b { display: block; font: 600 14.5px var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-row-names span { display: block; font-size: 13px; color: var(--t2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-link { cursor: pointer; }
.m-link:hover { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.m-row-album { font-size: 13px; color: var(--t2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-row-dur { font: 500 12.5px var(--font); color: var(--t2); text-align: right; font-variant-numeric: tabular-nums; }
.m-row-more { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: var(--t2); }
.m-row-more:hover { color: #fff; background: rgba(255,255,255,.12); }
.m-row-more svg { width: 16px; height: 16px; }
.m-skel { height: 50px; border-radius: 6px; margin-bottom: 2px; background: linear-gradient(90deg, rgba(255,255,255,.04), rgba(255,255,255,.09), rgba(255,255,255,.04)); background-size: 200% 100%; animation: m-shim 1.2s linear infinite; }
@keyframes m-shim { to { background-position: -200% 0; } }
.m-empty { color: var(--t2); padding: 24px 4px; }
.m-more { margin: 16px 0 0 8px; }

/* tiles: square covers, a lift and a play disc under the cursor */
.m-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 22px 18px; }
.m-tile { cursor: pointer; min-width: 0; transition: transform .2s var(--ease); }
.m-tile:hover { transform: translateY(-3px); }
.m-tile-art { position: relative; aspect-ratio: 1; border-radius: 6px; overflow: hidden; background: rgba(255,255,255,.08); box-shadow: 0 10px 24px -10px rgba(0,0,0,.5); }
.m-tile-art img { width: 100%; height: 100%; object-fit: cover; display: block; transition: filter .2s; }
.m-tile:hover .m-tile-art img { filter: brightness(.82); }
.m-disc { position: absolute; right: 10px; bottom: 10px; width: 40px; height: 40px; border-radius: 50%; background: #fff; color: #0a0b10; display: grid; place-items: center; opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s var(--ease); box-shadow: 0 6px 16px rgba(0,0,0,.35); }
.m-disc svg { width: 16px; height: 16px; }
.m-tile:hover .m-disc { opacity: 1; transform: none; }
.m-tile b { display: block; margin-top: 10px; font: 600 14px var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-tile span { display: block; font-size: 13px; color: var(--t2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* moods: coloured cards, their name in display type */
.m-moods { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px; }
.m-mood {
  position: relative; aspect-ratio: 1; border-radius: 6px; overflow: hidden; padding: 14px; display: flex; align-items: flex-end;
  background: linear-gradient(150deg, var(--m1), var(--m2)); text-align: left; transition: transform .2s var(--ease), filter .2s;
  box-shadow: 0 10px 24px -10px rgba(0,0,0,.5);
}
.m-mood::after { content: ""; position: absolute; inset: 0; opacity: .5; mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E"); }
.m-mood:hover { transform: translateY(-3px); filter: brightness(1.08); }
.m-mood b { position: relative; z-index: 1; font: 900 25px/.95 var(--font); text-transform: uppercase; letter-spacing: -.01em; }

.m-about { margin-top: 56px; max-width: 860px; color: var(--t2); font-size: 13.5px; }
.m-about p { margin: 0; }
.m-about a { color: var(--t1); }

/* ── the player bar: a floating panel in the playing song's colours ── */
.m-bar {
  position: fixed; left: 10px; right: 10px; bottom: 10px; height: var(--bar-h); z-index: 3;
  display: grid; grid-template-columns: minmax(250px, 1fr) minmax(360px, 520px) minmax(250px, 1fr); align-items: center; gap: 18px;
  padding: 0 18px 0 16px; border-radius: 22px; border: 1px solid rgba(255,255,255,.09);
  background:
    linear-gradient(100deg, color-mix(in srgb, rgb(var(--c-base)) 55%, #120c0a) 0%, color-mix(in srgb, rgb(var(--c-deep)) 70%, #0b0a0e) 45%, #0b0b10 100%);
  box-shadow: 0 18px 50px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.07);
  transition: background .6s;
}
.m-bar::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: .4; mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E"); }
.m-bar-left, .m-bar-right { display: flex; align-items: center; gap: 6px; min-width: 0; position: relative; z-index: 1; }
.m-bar-right { justify-content: flex-end; }
.m-bar-mid { display: flex; flex-direction: column; align-items: center; gap: 2px; position: relative; z-index: 1; }
.m-bar-cover { flex: none; width: 64px; height: 64px; border-radius: 8px; overflow: hidden; background: linear-gradient(140deg, #2a3f7a, #141d3c); box-shadow: 0 6px 18px rgba(0,0,0,.4); }
.m-bar-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.m-bar-cover img:not([src]), .m-bar-cover img[src=""] { visibility: hidden; }
.m-bar-names { display: flex; flex-direction: column; min-width: 0; margin: 0 6px 0 10px; flex: 1; }
.m-bar-names b { font: 600 15px var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-bar-names > span { font-size: 13px; color: var(--t2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-badge-q { align-self: flex-start; margin-top: 4px; padding: 1px 6px; border: 1px solid rgba(255,255,255,.3); border-radius: 4px; font: 700 10.5px var(--font); letter-spacing: .06em; color: var(--t1) !important; }
.m-vdiv { width: 1px; height: 30px; background: rgba(255,255,255,.14); margin: 0 6px; flex: none; }
.m-ctl { display: flex; align-items: center; gap: 14px; }
.m-ico { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: var(--t1); opacity: .92; transition: background .15s, opacity .15s, transform .15s; flex: none; }
.m-ico:hover { background: rgba(255,255,255,.1); opacity: 1; }
.m-ico:active { transform: scale(.92); }
.m-ico.is-on { color: rgb(var(--c-accent)); opacity: 1; }
.m-ico svg text { font-size: 6.6px; }
/* the play button: a ring in the cover's accent over a warm glass fill, breathing while it plays */
.m-play {
  width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; color: #fff; flex: none;
  border: 2px solid rgb(var(--c-accent)); background: radial-gradient(circle, rgb(var(--c-accent) / .30), rgb(var(--c-accent) / .12));
  box-shadow: 0 0 0 4px rgb(var(--c-accent) / .10), 0 0 22px rgb(var(--c-accent) / .45);
  transition: transform .15s var(--pop), box-shadow .4s;
}
.m-play svg { width: 22px; height: 22px; }
.m-play:hover { transform: scale(1.05); }
.m-play:active { transform: scale(.95); }
body.is-playing .m-play { animation: m-breathe 2.6s ease-in-out infinite; }
@keyframes m-breathe { 50% { box-shadow: 0 0 0 7px rgb(var(--c-accent) / .10), 0 0 30px rgb(var(--c-accent) / .55); } }
.m-i-pause { display: none; }
body.is-playing .m-i-play { display: none; }
body.is-playing .m-i-pause { display: inline; }
.m-progress { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 12px; width: 100%; font: 500 12px var(--font); color: var(--t2); font-variant-numeric: tabular-nums; }
.m-progress span:first-child { text-align: right; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 18px; background: none; cursor: pointer; --p: 0%; --a: var(--c-accent); margin: 0; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, rgb(var(--a)) var(--p), rgba(255,255,255,.18) var(--p)); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, rgb(var(--a)) var(--p), rgba(255,255,255,.18) var(--p)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px; border-radius: 50%; background: #fff; box-shadow: 0 1px 6px rgba(0,0,0,.45); }
input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: #fff; }
#m-vol { width: 120px; flex: none; --a: 255 255 255; }
.m-vol-n { width: 26px; font: 500 13px var(--font); color: var(--t2); text-align: right; margin-right: 6px; }
.m-pill-glass { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px 0 13px; border-radius: 19px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.06); font: 600 13.5px var(--font); transition: background .15s, border-color .15s; flex: none; }
.m-pill-glass svg { width: 17px; height: 17px; }
.m-pill-glass:hover { background: rgba(255,255,255,.12); }
.m-pill-glass.is-on { background: rgb(var(--c-accent) / .25); border-color: rgb(var(--c-accent) / .8); }
.m-heart.is-on { color: #ff5a6e !important; opacity: 1; }
.m-heart.is-on svg path { fill: currentColor; }
.m-heart.pop { animation: m-heart .4s var(--pop); }
@keyframes m-heart { 50% { transform: scale(1.35); } }

/* the menu (⋮) */
.m-menu { position: fixed; z-index: 70; min-width: 210px; padding: 6px; border-radius: 12px; background: rgba(22,23,30,.97); border: 1px solid rgba(255,255,255,.1); box-shadow: 0 18px 40px rgba(0,0,0,.5); animation: m-pop-in .18s var(--ease); }
.m-menu[hidden] { display: none; }
.m-menu button { display: flex; width: 100%; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: 8px; font: 500 13.5px var(--font); text-align: left; }
.m-menu button:hover { background: rgba(255,255,255,.08); }
.m-menu svg { width: 16px; height: 16px; opacity: .8; }

/* ── full screen ───────────────────────────────────────────────────── */
.m-fluid { position: fixed; inset: 0; width: 100vw; height: 100vh; opacity: 0; pointer-events: none; transition: opacity .6s; z-index: 4; }
body.is-full .m-fluid { opacity: 1; }
body.is-full .m-app, body.is-full .m-bar { opacity: 0; pointer-events: none; }
.m-app, .m-bar { transition: opacity .4s; }
.m-full { position: fixed; inset: 0; z-index: 5; display: flex; flex-direction: column; animation: m-fade .45s var(--ease); }
.m-full::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .32; mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E"); }
.m-full[hidden] { display: none; }
@keyframes m-fade { from { opacity: 0; } }
.m-full-top { position: relative; display: flex; justify-content: flex-end; gap: 6px; padding: 18px 22px 0; }
.m-stage-full { position: relative; flex: 1; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: clamp(16px, 2.4vw, 36px); padding: 0 24px 24px; min-height: 0; }
.m-side-left { justify-self: end; grid-column: 1; grid-row: 1; }
.m-card { grid-column: 2; grid-row: 1; }
.m-side-right { justify-self: start; grid-column: 3; grid-row: 1; }
.m-card, .m-side {
  border-radius: clamp(28px, 3vw, 40px); border: 1px solid rgba(255,255,255,.16);
  background: linear-gradient(180deg, rgba(255,255,255,.13), rgba(255,255,255,.05)), rgb(var(--c-deep) / .42);
  backdrop-filter: blur(32px) saturate(150%); -webkit-backdrop-filter: blur(32px) saturate(150%);
  box-shadow: 0 30px 80px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.18);
}
.m-card {
  --cw: min(410px, 30vw, calc((100vh - 120px) * .56));
  width: var(--cw); min-width: 260px; padding: calc(var(--cw) * .072); display: flex; flex-direction: column;
  animation: m-card-in .6s var(--pop);
}
@keyframes m-card-in { from { opacity: 0; transform: scale(.94) translateY(14px); } }
body.has-video .m-card { animation: m-fade .4s ease; }   /* never scaled while YouTube's player sits on it */
.m-card-cover { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: calc(var(--cw) * .085); background: rgba(255,255,255,.08); box-shadow: 0 18px 50px rgba(0,0,0,.4); transition: transform .5s var(--pop); }
body:not(.is-playing) .m-card-cover { transform: scale(.95); }
.m-card-head { display: flex; align-items: center; gap: 10px; margin-top: 18px; }
.m-card-names { flex: 1; min-width: 0; }
.m-card-names h2 { margin: 0; font: 700 clamp(17px, 1.55vw, 22px)/1.2 var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-card-names p { margin: 2px 0 0; color: var(--t2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font: 500 14.5px var(--font); }
.m-card .m-ring { width: 46px; height: 46px; }
.m-badge { margin: 8px 0 0; font: 700 10.5px var(--font); letter-spacing: .06em; color: var(--t2); }
.m-card-progress { margin-top: 12px; }
.m-times { display: flex; justify-content: space-between; font: 500 12px var(--font); color: var(--t2); margin-top: 2px; font-variant-numeric: tabular-nums; }
.m-card-ctl { justify-content: space-between; margin-top: 10px; gap: 0; }
.m-card-ctl .m-vdiv { height: 22px; margin: 0; }
.m-play-big { width: 76px; height: 76px; }
.m-play-big svg { width: 26px; height: 26px; }
.m-card-foot { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.m-tile-btn { height: 52px; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 16px; border: 1px solid rgba(255,255,255,.13); background: rgba(255,255,255,.045); font: 600 11px var(--font); transition: background .2s, border-color .2s; }
.m-tile-btn svg { width: 18px; height: 18px; }
.m-tile-wide { flex: 1.5; flex-direction: row; gap: 8px; font-size: 13.5px; }
.m-tile-btn:hover { background: rgba(255,255,255,.1); }
.m-tile-btn.is-on { background: rgb(var(--c-accent) / .26); border-color: rgb(var(--c-accent) / .8); }
.m-card-foot .m-vdiv { height: 30px; margin: 0 2px; }
.m-vol-pill { flex: 2; height: 52px; display: flex; align-items: center; gap: 8px; padding: 0 14px; border-radius: 26px; border: 1px solid rgba(255,255,255,.13); background: rgba(255,255,255,.045); }
.m-vol-pill input { --a: 255 255 255; }
.m-side { width: min(380px, 28vw); height: min(640px, calc(100vh - 130px)); padding: 22px; display: flex; flex-direction: column; min-height: 0; }
.m-side[hidden] { display: none; }
.m-side.pop-in { animation: m-pop-in .42s var(--pop); }
.m-side.pop-out { animation: m-pop-out .2s ease-in forwards; }
@keyframes m-pop-in { from { opacity: 0; transform: scale(.86); } }
@keyframes m-pop-out { to { opacity: 0; transform: scale(.9); } }
.m-side h3 { margin: 0 0 12px; font: 700 17px var(--font); display: flex; align-items: center; justify-content: space-between; }
.m-side-body { overflow-y: auto; overflow-x: hidden; min-height: 0; flex: 1; margin-right: -8px; padding-right: 8px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent; }
.m-side-body::-webkit-scrollbar, .m-lyrics::-webkit-scrollbar { width: 6px; }
.m-side-body::-webkit-scrollbar-thumb, .m-lyrics::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 6px; }
.m-q-row { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; padding: 6px; border-radius: 12px; cursor: pointer; }
.m-q-row > div { min-width: 0; }
.m-q-row:hover { background: rgba(255,255,255,.07); }
.m-q-row.is-current { background: rgba(255,255,255,.12); }
.m-q-row img { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; }
.m-q-row b { display: block; font: 600 13.5px var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-q-row span { display: block; font-size: 12px; color: var(--t2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-q-label { font: 800 10.5px var(--font); letter-spacing: .16em; color: var(--t3); margin: 12px 6px 4px; }
.m-q-row .m-row-dur { font-size: 12px; }
.m-eq-bands { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; height: 230px; margin: 4px 0 10px; }
.m-eq-band { display: flex; flex-direction: column; align-items: center; gap: 6px; font: 600 9.5px var(--font); color: var(--t3); }
.m-eq-band input { writing-mode: vertical-lr; direction: rtl; width: 18px; height: 190px; --a: 255 255 255; }
.m-eq-band input::-webkit-slider-runnable-track { width: 4px; height: auto; background: rgba(255,255,255,.16); }
.m-eq-band input::-webkit-slider-thumb { margin-top: 0; margin-left: -5px; }
.m-pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 12px; }
.m-pills .m-chip { padding: 6px 12px; border-radius: 99px; border: 1px solid rgba(255,255,255,.2); font: 600 12.5px var(--font); }
.m-pills .m-chip:hover { background: rgba(255,255,255,.08); }
.m-pills .m-chip.is-on { background: #fff; color: #0a0b10; }
.m-setting { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; font-size: 13.5px; color: var(--t2); }
.m-setting a { color: rgb(var(--c-accent)); }
.m-note { font-size: 12.5px; color: var(--t2); background: rgba(255,255,255,.06); border-radius: 12px; padding: 10px 12px; margin: 0 0 10px; }
.m-lyrics { flex: 1; overflow-y: auto; scroll-behavior: smooth; mask-image: linear-gradient(transparent, #000 18%, #000 82%, transparent); padding: 40% 4px; scrollbar-width: none; }
.m-lyric { font: 800 clamp(20px, 1.9vw, 30px)/1.25 var(--font); margin: 0 0 18px; color: rgba(255,255,255,.32); filter: blur(1.2px); transition: color .35s, filter .35s, transform .45s var(--ease); transform-origin: left center; cursor: pointer; }
.m-lyric.is-on { color: #fff; filter: none; transform: scale(1.04); }
.m-lyric.is-past { color: rgba(255,255,255,.45); filter: blur(.6px); }
.m-lyrics-plain { white-space: pre-wrap; color: var(--t2); font-size: 16px; line-height: 1.7; padding: 0 4px; }

/* ── a YouTube song's player: a tile just over YouTube's smallest allowed size (200 x 200) -- a
   little over, so zoom or rounding never takes it under (YouTube won't play a smaller one) ── */
.m-yt { position: fixed; left: -10000px; top: 0; width: 216px; height: 216px; z-index: 60; overflow: hidden; background: #000; visibility: hidden; }
.m-yt iframe { width: 100%; height: 100%; border: 0; display: block; }
/* a YouTube song's player while the page is in front: a square at the foot of the rail, held in view
   (sticky) as the rail scrolls; music.js places the player over .m-now-video, or over the card's art in
   full screen. A fade, never a scale: YouTube won't play a player measured under its minimum. */
.m-now { position: sticky; bottom: -16px; margin: auto -10px 0; padding: 2px 12px 16px; background: var(--rail-bg); border-top: 1px solid rgba(255,255,255,.06); animation: m-fade .3s ease; z-index: 1; }
.m-now[hidden] { display: none; }
.m-now .m-label { margin: 14px 12px 8px; }
.m-now-video { width: 216px; height: 216px; margin: 0 auto; border-radius: 14px; background: #000; box-shadow: 0 0 0 1px rgba(255,255,255,.1), 0 14px 34px rgba(0,0,0,.45); }

.m-toast { position: fixed; left: 50%; bottom: calc(var(--bar-h) + 24px); transform: translate(-50%, 20px); opacity: 0; z-index: 20; padding: 10px 16px; border-radius: 14px; background: rgba(16,17,22,.94); border: 1px solid rgba(255,255,255,.1); font: 500 13.5px var(--font); transition: opacity .25s, transform .3s var(--ease); pointer-events: none; }
.m-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.m-noscript { position: fixed; inset: auto 0 40% 0; text-align: center; }

/* ── the floating mini player's page (Document Picture-in-Picture) ──
   A small square shows the picture and previous / play / next; give it room and the song's name, the
   seek line and back / forward 10 s come in. Dragged from anywhere but the buttons, where the browser
   lets a page say so. A YouTube song's player keeps its own square (at least 216), never covered. */
.mini-body { margin: 0; overflow: hidden; background: #0b0b10; color: #fff; font: 14px var(--font); user-select: none; app-region: drag; -webkit-app-region: drag; }
.mini-body button, .mini-body input { app-region: no-drag; -webkit-app-region: no-drag; }
.mini { position: fixed; inset: 0; --vs: max(216px, min(100vw, 100vh - 64px)); }
.mini-cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mini-shade { position: absolute; inset: 0; background: linear-gradient(rgba(0,0,0,.45), transparent 32%, transparent 48%, rgba(0,0,0,.78)); }
.mini-ui { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; padding: 10px; }
.mini-top { display: flex; align-items: center; gap: 8px; }
.mini-pill { flex: 1; min-width: 0; padding: 6px 12px; border-radius: 99px; background: rgba(30,30,34,.55); backdrop-filter: blur(14px); }
.mini-pill b, .mini-pill span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-pill b { font-weight: 700; font-size: 13.5px; }
.mini-pill span { font-size: 12px; opacity: .75; }
.mini-btn { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: rgba(30,30,34,.55); backdrop-filter: blur(14px); color: #fff; flex: none; transition: background .15s; }
.mini-btn:hover { background: rgba(80,80,90,.65); }
.mini-btn.big { width: 50px; height: 50px; background: rgba(255,255,255,.92); color: #0a0b10; }
.mini-btn.big:hover { background: #fff; }
.mini-btn.is-on { color: #ff5a6e; }
.mini-btn.is-on svg path { fill: currentColor; }
.mini-close { width: 30px; height: 30px; }
.mini-close svg { width: 14px; height: 14px; }
.mini-times { display: flex; justify-content: space-between; font: 600 11px var(--font); margin-bottom: 2px; font-variant-numeric: tabular-nums; text-shadow: 0 1px 4px rgba(0,0,0,.5); }
.mini-ctl { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 4px; }
/* a small square: the picture, and previous / play / next */
@media (max-width: 299px), (max-height: 299px) {
  .mini-pill, .mini-like, .mini-times, #mini-seek, [data-mini=back10], [data-mini=fwd10] { display: none; }
  .mini-top { justify-content: flex-end; }
  .mini-ui { padding: 8px; }
  .mini-btn { width: 34px; height: 34px; }
  .mini-btn.big { width: 44px; height: 44px; }
}
/* a YouTube song: its player on top, as big as fits, and the controls under it -- never over it */
.mini-video { position: absolute; left: 50%; top: 0; width: var(--vs); height: var(--vs); transform: translateX(-50%); display: none; }
.mini-video .m-yt { position: absolute !important; left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; visibility: visible !important; border-radius: 0; box-shadow: none; }
.mini.is-video .mini-video { display: block; }
.mini.is-video .mini-shade { display: none; }
.mini.is-video .mini-cover { filter: blur(24px) brightness(.5); transform: scale(1.2); }
.mini.is-video .mini-ui { top: var(--vs); padding: 6px 10px 8px; justify-content: center; }
.mini.is-video .mini-top { position: fixed; top: auto; bottom: 8px; right: 8px; }
.mini.is-video .mini-top .mini-pill, .mini.is-video .mini-like { display: none; }
.mini.is-video .mini-times { display: none; }
@media (max-height: 340px) { .mini.is-video #mini-seek { display: none; } }

/* ── smaller screens ── */
@media (max-width: 1100px) {
  .m-bar-right #m-vol, .m-bar-right .m-vol-n, .m-bar-right [data-act=info], .m-bar-left [data-act=addq] { display: none; }
  .m-name { font-size: 72px; }
}
@media (max-width: 860px) {
  :root { --rail-w: 0px; --bar-h: 148px; }
  .m-app { grid-template-columns: 1fr; padding-top: 118px; }
  .m-rail { position: fixed; z-index: 3; left: 10px; right: 10px; top: 10px; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px; overflow: visible; }
  .m-rail-card { flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px; }
  .m-brand-row { padding: 0 4px; }
  .m-rail-dots, .m-label, .m-app-cta, .m-search kbd { display: none; }
  .m-search { flex: 1; min-width: 150px; margin: 0; }
  .m-nav { flex-direction: row; overflow-x: auto; scrollbar-width: none; flex: 1 1 100%; }
  .m-nav::-webkit-scrollbar { display: none; }
  .m-nav-lib { display: none; }
  .m-now { position: fixed; right: 12px; bottom: calc(var(--bar-h) + 20px); margin: 0; padding: 0; background: none; z-index: 2; }
  .m-now .m-label { display: none; }
  .m-nav-item { height: 32px; padding: 0 10px; white-space: nowrap; font-size: 13.5px; }
  .m-nav-item.is-on::before { display: none; }
  .m-page { padding: 14px 18px 40px; }
  .m-hero { flex-direction: column; min-height: 0; }
  .m-name { font-size: 46px; }
  .m-pic-photo { position: relative; right: auto; top: auto; width: 100%; height: 200px; order: -1; }
  .m-pic-cover { width: 160px; }
  .m-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .m-row { grid-template-columns: 26px 38px minmax(0, 1fr) 44px 30px; gap: 10px; }
  .m-row-add, .m-row-album { display: none; }
  .m-bar { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; height: auto; padding: 10px 12px; gap: 6px 8px; }
  .m-bar-mid { grid-column: 1 / -1; grid-row: 2; }
  .m-bar-left .m-vdiv, .m-bar-left [data-act=songmenu], .m-bar-right .m-vdiv, .m-bar-right [data-act=mute], .m-bar-right [data-act=eq], .m-bar-right [data-act=queue], .m-bar-right .m-pill-glass { display: none; }
  .m-bar-cover { width: 48px; height: 48px; }
  .m-ctl { gap: 6px; }
  .m-play { width: 50px; height: 50px; }
  .m-stage-full { display: flex; flex-direction: column; overflow-y: auto; justify-content: flex-start; padding-top: 8px; }
  .m-card { --cw: min(420px, 92vw); }
  .m-side { width: min(420px, 92vw); height: 62vh; flex: none; }
  .m-lyrics { padding: 30% 4px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
