/* MP3 Box — matte black minimal. No borders, no outlines. Tonal fills only.
 * Type: Clash Display + Satoshi. Icons: Feather. Motion: springs, blur-in reveals.
 */
:root {
  --spring: cubic-bezier(0.22, 1, 0.36, 1);
  --ink: #f4f4f5;
  --dim: rgba(244, 244, 245, 0.6);
  --faint: rgba(244, 244, 245, 0.38);
  --green: #1ed760;
  --fill: rgba(255, 255, 255, 0.055);
  --fill-soft: rgba(255, 255, 255, 0.035);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
*:focus { outline: none; }
[hidden] { display: none !important; }
html { scrollbar-width: none; }
::-webkit-scrollbar { display: none; }
html, body { margin: 0; }
html { overflow-x: hidden; }
body { overflow-x: hidden; }
.grid > *, .card { min-width: 0; }
.sheet-row .nm { min-width: 0; }
body { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
img { -webkit-user-drag: none; user-drag: none; }
#view img, .player img, .sheet-row img, .trow img { flex: none; }
input, textarea { user-select: text; -webkit-user-select: text; }
body {
  font-family: "Satoshi", system-ui, sans-serif;
  background: #0a0a0b; color: var(--ink);
  min-height: 100dvh; overflow-x: hidden;
  display: flex;
  -webkit-font-smoothing: antialiased;
  animation: pagein 800ms var(--spring) both;
}
/* reserve room for the fixed player only while it's actually on screen */
body.has-player .stage .wrap { padding-bottom: 132px; }
body.has-player #side { padding-bottom: 124px; }
@keyframes pagein { from { opacity: 0; } to { opacity: 1; } }

/* sidebar + stage */
#side {
  width: 248px; flex: none;
  height: 100dvh; position: sticky; top: 0; z-index: 6;
  display: flex; flex-direction: column; gap: 4px;
  background: #0d0d0f; padding: 18px 12px 14px;
}
.stage { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.stage > * { min-width: 0; }
#sideBrand {
  font-family: "Clash Display", "Satoshi", sans-serif;
  font-size: 24px; font-weight: 600; letter-spacing: -0.01em;
  color: var(--ink); background: #000; border: none; border-radius: 999px;
  padding: 8px 22px 8px 10px; margin: 0 2px 12px; cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  transition: transform 500ms var(--spring);
}
.blogo { width: 27px; height: 27px; flex: none; }
.intro-pill .blogo { width: 27px; height: 27px; }
.intro-pill { display: flex; align-items: center; gap: 10px; }
#sideBrand:hover { transform: scale(1.03); }
#sideBrandText { display: inline-block; }
/* ghost account link: invisible until hovered; touch always shows a whisper */
#acctLink {
  font-family: "Satoshi", system-ui, sans-serif;
  font-size: 13px; font-weight: 700; letter-spacing: 0.04em;
  color: var(--ink); opacity: 0; margin-left: 2px; cursor: pointer;
  transition: opacity 450ms var(--spring);
}
#sideBrand:hover #acctLink { opacity: 0.75; }
#acctLink:hover { opacity: 1 !important; }
@media (hover: none) {
  #acctLink { opacity: 0.35; }
}

/* header */
.top {
  position: sticky; top: 12px; z-index: 5;
  max-width: 1060px; width: calc(100% - 32px); margin: 12px auto 0; padding: 0 16px;
  display: flex; gap: 16px; align-items: center;
  background: transparent;
  transition: transform 950ms var(--spring), opacity 650ms ease;
}
.brand {
  display: flex; align-items: center; flex: none;
  background: rgba(0, 0, 0, 0.42); border-radius: 999px; padding: 8px 22px;
}
.brand h1 { font-family: "Clash Display", "Satoshi", sans-serif; font-size: 24px; font-weight: 600; margin: 0; letter-spacing: -0.01em; white-space: nowrap; }
/* (legacy header brand — brand now lives in the sidebar as #sideBrand) */
.search {
  flex: 1; display: flex; align-items: center; gap: 10px;
  background: var(--fill); border-radius: 999px; padding: 12px 20px;
  transition: background 400ms var(--spring), transform 400ms var(--spring);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.09);
}
.search:focus-within { background: rgba(255, 255, 255, 0.075); }
.search svg { width: 17px; height: 17px; color: var(--faint); flex: none; }
.search input {
  flex: 1; min-width: 0; background: none; border: none;
  color: var(--ink); font: inherit; font-size: 14px; font-weight: 500;
}
.search input::placeholder { color: var(--faint); }

/* home: same top bar, viewport-locked (nothing to scroll to) */
body.home { height: 100dvh; overflow: hidden; }

/* intro: magic burst on the black pill, then the SAME pill flies top-left
 * and docks as the header brand — one unbroken motion, no crossfade cut. */
#intro {
  position: fixed; inset: 0; z-index: 100; background: transparent;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
#intro::before {
  content: ""; position: absolute; inset: 0; background: #0a0a0b;
  transition: opacity 450ms ease;
}
#intro.clear { pointer-events: none; }
#intro.clear::before { opacity: 0; }
.intro-pill {
  position: relative; --r: 56px;
  background: #000; border-radius: 999px; padding: 8px 22px 8px 10px;
  font-family: "Clash Display", "Satoshi", sans-serif;
  font-size: 24px; font-weight: 600; letter-spacing: -0.01em;
  animation: pillIn 700ms var(--spring) both;
}
@keyframes pillIn { from { transform: scale(0.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.intro-pill > span {
  display: inline-block;
  animation: wordIn 800ms var(--spring) 120ms both;
}
@keyframes wordIn {
  from { opacity: 0; transform: translateY(22px) scale(0.94); filter: blur(8px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}
/* sidebar brand hides until the intro pill docks into its slot */
body.intro #sideBrand { opacity: 0; }

/* content */
.wrap { max-width: 1060px; width: 100%; margin: 0 auto; padding: 22px 16px; transition: opacity 600ms ease; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 14px; }
.card {
  background: var(--fill-soft); border-radius: 20px; padding: 8px; overflow: hidden; cursor: pointer;
  animation: rise 750ms var(--spring) backwards;
  transition: transform 550ms var(--spring), background 400ms;
}
.card:hover { transform: translateY(-4px) scale(1.01); background: rgba(255, 255, 255, 0.06); }
.card:active { transform: scale(0.98); }
@keyframes rise {
  from { transform: translateY(16px) scale(0.98); opacity: 0; filter: blur(6px); }
  to { transform: none; opacity: 1; filter: blur(0); }
}
.thumb { position: relative; aspect-ratio: 16/9; border-radius: 13px; overflow: hidden; background: #171719; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; background: #000; transform: scale(1.02); transition: transform 800ms var(--spring), opacity 500ms; }
.card:hover .thumb img { transform: scale(1.08); }
.thumb .go {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.35); opacity: 0; transition: opacity 400ms;
}
.card:hover .thumb .go { opacity: 1; }
.thumb .go span {
  width: 50px; height: 50px; border-radius: 50%; background: #fff; color: #0a0a0b;
  display: flex; align-items: center; justify-content: center;
  transform: scale(0.7); transition: transform 550ms var(--spring);
}
.card:hover .thumb .go span { transform: scale(1); }
.thumb .go svg { height: 19px; width: auto; }
.thumb .dur {
  position: absolute; right: 7px; bottom: 7px; font-size: 11px; font-weight: 700;
  background: rgba(0, 0, 0, 0.72); border-radius: 7px; padding: 2px 7px; font-variant-numeric: tabular-nums;
}
.card h3 { font-size: 13.5px; margin: 10px 8px 8px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.skelcard {
  background: var(--fill-soft); border-radius: 20px; padding: 8px; overflow: hidden;
  animation: rise 700ms var(--spring) both;
}
.skelcard .sk-thumb {
  aspect-ratio: 16/9; border-radius: 13px;
  background: linear-gradient(100deg, rgba(255,255,255,0.04) 40%, rgba(255,255,255,0.11) 50%, rgba(255,255,255,0.04) 60%);
  background-size: 200% 100%; animation: sh 1100ms linear infinite;
}
.skelcard .sk-line {
  height: 12px; border-radius: 6px; margin: 10px 8px 0;
  background: linear-gradient(100deg, rgba(255,255,255,0.04) 40%, rgba(255,255,255,0.11) 50%, rgba(255,255,255,0.04) 60%);
  background-size: 200% 100%; animation: sh 1100ms linear infinite;
}
.skelcard .sk-line.short { width: 55%; margin-top: 7px; margin-bottom: 6px; }
@keyframes sh { to { background-position: -200% 0; } }

/* empty state */
.empty { padding: 0; margin: 0; }

/* player bar */
.player {
  position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%);
  width: min(1060px, calc(100% - 24px)); z-index: 10;
  display: flex; gap: 14px; align-items: center; padding: 12px 16px;
  background: #131315; border-radius: 22px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.65);
  animation: up 800ms var(--spring) both;
}
@keyframes up { from { transform: translate(-50%, 22px) scale(0.98); opacity: 0; } to { transform: translate(-50%, 0) scale(1); opacity: 1; } }
.player #art { width: 54px; height: 54px; border-radius: 13px; object-fit: cover; flex: none; background: #1c1c1f; }
.p-meta { width: 210px; min-width: 0; flex: none; display: flex; align-items: center; }
.p-meta #ptitle { font-weight: 900; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-center { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.p-btns { display: flex; gap: 16px; align-items: center; justify-content: center; }
.p-btns button {
  width: 32px; height: 32px; cursor: pointer; color: #8f8f94; background: none; border: none;
  display: flex; align-items: center; justify-content: center; position: relative;
  transition: transform 450ms var(--spring), color 300ms;
}
.p-btns button svg { width: 20px; height: 20px; }
.p-btns button:hover { color: #fff; transform: scale(1.1); }
.p-btns button:active { transform: scale(0.9); }
.p-btns button.on { color: var(--green); }
.p-btns button .one {
  display: none; position: absolute; right: 0; bottom: 1px;
  font-size: 8px; font-weight: 900; color: var(--green); font-style: normal;
}
.p-btns button.one .one { display: block; }
.p-btns #bLike.loved { color: #fff; }
.p-btns #bLike.loved svg path { fill: currentColor; }
.p-btns .big {
  width: 46px; height: 46px; border-radius: 50%;
  background: #fff; color: #0a0a0b;
  box-shadow: 0 6px 26px rgba(255, 255, 255, 0.14);
  transition: transform 450ms var(--spring);
}
.p-btns .big svg { height: 21px; width: auto; }
/* optical centering: the triangle's mass sits left, so nudge it right
   (position, not transform, so the pop animation never fights it) */
.p-btns .big .ic-play { position: relative; left: 2px; }
.p-btns .big:hover { transform: scale(1.07); color: #0a0a0b; }
.p-btns .big:active { transform: scale(0.92); }
.p-btns .big .ic-pause { display: none; }
.p-btns .big.playing .ic-play { display: none; }
.p-btns .big.playing .ic-pause { display: block; }
.p-btns .big.pop svg { animation: pop 450ms var(--spring); }
@keyframes pop { 0% { transform: scale(0.6); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }
/* thin line progress with edge times */
.p-track { display: flex; gap: 10px; align-items: center; font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; font-weight: 500; }
.p-track span { min-width: 30px; }
.p-track span:last-child { text-align: right; }
.p-line {
  position: relative; flex: 1; height: 12px; cursor: pointer;
  display: flex; align-items: center;
}
.p-line::before {
  content: ""; position: absolute; left: 0; right: 0; height: 3px; border-radius: 99px;
  background: rgba(255, 255, 255, 0.14);
}
.p-fill { position: relative; height: 3px; border-radius: 99px; background: #fff; width: 0%; }
.p-knob {
  position: absolute; top: 50%; left: 0; width: 10px; height: 10px; border-radius: 50%;
  background: #fff; transform: translate(-50%, -50%) scale(0); opacity: 0;
  transition: transform 350ms var(--spring), opacity 300ms;
  pointer-events: none;
}
.p-line:hover .p-knob, .p-line.drag .p-knob { transform: translate(-50%, -50%) scale(1); opacity: 1; }
.p-right { display: flex; gap: 10px; align-items: center; flex: none; }

input[type="range"] { accent-color: var(--green); cursor: pointer; }
.p-seek input { flex: 1; }
.toast {
  position: fixed; left: 50%; bottom: 122px; transform: translateX(-50%); z-index: 220;
  background: #131315; color: var(--ink); font-size: 13px; font-weight: 700;
  border-radius: 14px; padding: 11px 18px 11px 15px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.12);
  display: flex; align-items: center; gap: 9px;
  max-width: calc(100% - 40px);
}
.toast.show { animation: toastup 650ms var(--spring) both; }
.toast.show::after { animation: stickup 650ms var(--spring) both; }
@keyframes toastup {
  from { transform: translate(-50%, 20px) scale(0.95); opacity: 0; }
  60% { transform: translate(-50%, -3px) scale(1.01); opacity: 1; }
  to { transform: translate(-50%, 0) scale(1); opacity: 1; }
}
/* the little stick connecting the popup down to the player bar */
.toast::after {
  content: ""; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  width: 3px; height: 16px; border-radius: 2px; background: #131315;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
  transform-origin: top center;
}
@keyframes stickup { from { transform: translateX(-50%) scaleY(0); } to { transform: translateX(-50%) scaleY(1); } }
.toast .tdot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex: none; }
.toast.err .tdot { background: #ff5470; }

@media (max-width: 760px) {
  .p-meta { display: none; }
  #vol { display: none; }
  .player { flex-wrap: wrap; }
  .p-center { flex-basis: 100%; order: 3; }
  #sideBrand { font-size: 20px; padding: 7px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ============ sidebar nav / playlists / user ============ */
.snav { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.snav button, #plList button.pl {
  display: flex; align-items: center; gap: 11px; width: 100%;
  background: none; border: none; cursor: pointer; color: var(--dim);
  font: inherit; font-size: 13.5px; font-weight: 700;
  border-radius: 12px; padding: 9px 12px; text-align: left;
  transition: background 350ms var(--spring), color 300ms, transform 400ms var(--spring);
  white-space: nowrap; overflow: hidden;
}
.snav button svg { width: 18px; height: 18px; flex: none; }
.snav button:hover, #plList button.pl:hover { background: rgba(255, 255, 255, 0.06); color: var(--ink); }
.snav button.on, #plList button.pl.on { background: rgba(255, 255, 255, 0.09); color: var(--ink); }
#plList button.pl.fresh { animation: plpop 900ms var(--spring) both; }
@keyframes plpop {
  0% { transform: scale(0.85) translateX(-8px); opacity: 0; background: rgba(30, 215, 96, 0.18); }
  60% { transform: scale(1.03); opacity: 1; background: rgba(30, 215, 96, 0.1); }
  100% { transform: none; opacity: 1; }
}
.snav button:active, #plList button.pl:active { transform: scale(0.97); }
.snav b, #plList .cnt { margin-left: auto; font-size: 11px; color: var(--faint); font-weight: 900; }
.snav b:empty { display: none; }
.side-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 10.5px; font-weight: 900; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--faint); padding: 8px 12px 6px;
}
.side-head button {
  cursor: pointer; border: none; border-radius: 50%; width: 24px; height: 24px;
  background: rgba(255, 255, 255, 0.07); color: var(--ink); font-size: 16px; line-height: 1;
  transition: transform 400ms var(--spring), background 300ms;
}
.side-head button:hover { transform: scale(1.12); background: #fff; color: #0a0a0b; }
#plList { flex: 1; overflow-y: auto; min-height: 60px; display: flex; flex-direction: column; gap: 2px; }
#plList .pl img { width: 34px; height: 34px; border-radius: 9px; object-fit: cover; flex: none; background: #1c1c1f; }
#plList .pl .ph { width: 34px; height: 34px; border-radius: 9px; flex: none; background: linear-gradient(135deg, rgba(30,215,96,0.35), rgba(139,92,246,0.35)); display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 900; color: #fff; }
#plList .pl span.nm { overflow: hidden; text-overflow: ellipsis; }
#plList .plock { font-size: 12px; color: var(--faint); padding: 8px 12px; line-height: 1.5; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 15px; color: #fff;
  background: linear-gradient(135deg, #333, #111);
}

/* ============ views: headers + track rows ============ */
#view[hidden] { display: none; }
.vhead { display: flex; gap: 16px; align-items: center; margin-bottom: 16px; animation: rise 700ms var(--spring) both; }
.vcover {
  width: 118px; height: 118px; border-radius: 20px; flex: none;
  background: linear-gradient(135deg, rgba(30,215,96,0.4), rgba(139,92,246,0.4));
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.2);
}
.vcover img { width: 100%; height: 100%; object-fit: cover; }
.vcover.fy { background: linear-gradient(135deg, #4c1d95, #1d4ed8); }
.editcover {
  position: absolute; inset: 0; margin: auto; width: 64px; height: 64px;
  border-radius: 50%; border: none; cursor: pointer;
  background: rgba(0, 0, 0, 0.55); color: #fff;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: scale(0.85);
  transition: opacity 400ms var(--spring), transform 500ms var(--spring);
}
.editcover svg { width: 24px; height: 24px; }
.vcover.has-edit { cursor: pointer; }
.vcover.has-edit:hover .editcover { opacity: 1; transform: scale(1); }
/* mini cover editor: dimmed photo, bright crop frame, corner handles */
.cov-stage {
  position: relative; width: 100%; aspect-ratio: 1 / 1;
  border-radius: 16px; background: #000; touch-action: none; cursor: grab;
  margin-top: 4px; box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.15);
}
.cov-stage:active { cursor: grabbing; }
.cov-stage img { position: absolute; max-width: none; pointer-events: none; }
.cov-crop {
  position: absolute; overflow: hidden; border-radius: 10px;
  box-shadow: 0 0 0 1.5px #fff, 0 8px 30px rgba(0, 0, 0, 0.5);
  cursor: grab;
}
.cov-crop:active { cursor: grabbing; }
.cov-h {
  position: absolute; width: 20px; height: 20px; border-radius: 6px;
  background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.55); z-index: 2;
  touch-action: none;
}
.cov-h[data-h="nw"] { left: -10px; top: -10px; cursor: nwse-resize; }
.cov-h[data-h="ne"] { right: -10px; top: -10px; cursor: nesw-resize; }
.cov-h[data-h="sw"] { left: -10px; bottom: -10px; cursor: nesw-resize; }
.cov-h[data-h="se"] { right: -10px; bottom: -10px; cursor: nwse-resize; }
.cov-tools { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }
.toolbtn {
  width: 42px; height: 42px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255, 255, 255, 0.08); color: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: transform 400ms var(--spring), background 300ms, color 300ms;
}
.toolbtn svg { width: 19px; height: 19px; }
.toolbtn:hover { transform: scale(1.08); }
.toolbtn:active { transform: scale(0.94); }
.toolbtn.on { background: #fff; color: #0a0a0b; }
.cov-brow { display: flex; gap: 10px; align-items: center; margin-top: 10px; color: #fff; }
.cov-brow svg { width: 17px; height: 17px; flex: none; }
.cov-brow input { flex: 1; }
.cov-brow input[type="range"], input[type="range"].cov-zoom {
  -webkit-appearance: none; appearance: none;
  background: transparent; border: none; outline: none; cursor: pointer;
}
.cov-brow input[type="range"]::-webkit-slider-runnable-track,
input[type="range"].cov-zoom::-webkit-slider-runnable-track {
  height: 3px; border-radius: 99px; background: rgba(255, 255, 255, 0.22);
}
.cov-brow input[type="range"]::-webkit-slider-thumb,
input[type="range"].cov-zoom::-webkit-slider-thumb {
  -webkit-appearance: none; width: 15px; height: 15px; border-radius: 50%;
  background: #fff; border: none; margin-top: -6px;
}
.cov-brow input[type="range"]::-moz-range-track,
input[type="range"].cov-zoom::-moz-range-track {
  height: 3px; border-radius: 99px; background: rgba(255, 255, 255, 0.22);
}
.cov-brow input[type="range"]::-moz-range-progress,
input[type="range"].cov-zoom::-moz-range-progress {
  height: 3px; border-radius: 99px; background: #fff;
}
.cov-brow input[type="range"]::-moz-range-thumb,
input[type="range"].cov-zoom::-moz-range-thumb {
  width: 15px; height: 15px; border: none; border-radius: 50%; background: #fff;
}
input[type="range"].cov-zoom { width: 100%; margin-top: 14px; }
.cov-zoom { width: 100%; margin-top: 14px; }
.vcover svg { width: 44px; height: 44px; color: rgba(255, 255, 255, 0.9); }
.vhead h2 { font-family: "Clash Display", sans-serif; font-size: 30px; margin: 0 0 4px; letter-spacing: -0.02em; }
.vtitle-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.vtitle-row h2 { margin: 0; flex: none; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pencil {
  width: 32px; height: 32px; flex: none; border-radius: 50%; border: none; cursor: pointer;
  background: none; color: var(--dim);
  display: flex; align-items: center; justify-content: center;
  transition: transform 400ms var(--spring), color 300ms;
}
.pencil svg { width: 15px; height: 15px; }
.pencil:hover { color: var(--ink); transform: scale(1.12); }
.vhead p { margin: 0 0 12px; font-size: 12.5px; color: var(--faint); font-weight: 500; }
.vhead p:empty { display: none; }
.vhead .vsub { color: var(--green); font-weight: 700; }
.vactions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.vplay {
  cursor: pointer; border: none; border-radius: 999px; padding: 10px 22px;
  background: var(--ink); color: #0a0a0b; font: inherit; font-size: 13px; font-weight: 900;
  display: inline-flex; align-items: center; gap: 8px;
  transition: transform 450ms var(--spring);
}
.vplay svg { width: 15px; height: 15px; }
.vplay:hover { transform: scale(1.04); }
.vplay:active { transform: scale(0.95); }
/* icon-only play: white disc with the FA glyph, tucked under the title */
.vplay-ic {
  width: 50px; height: 50px; border-radius: 50%; border: none; cursor: pointer;
  background: #fff; color: #0a0a0b;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 30px rgba(255, 255, 255, 0.12);
  transition: transform 450ms var(--spring);
}
.vplay-ic svg { height: 21px; width: auto; }
.vplay-ic .ic-play { position: relative; left: 2px; }
.vplay-ic .ic-pause { display: none; }
.vplay-ic.playing .ic-play { display: none; }
.vplay-ic.playing .ic-pause { display: block; left: 0; }
.vplay-ic:hover { transform: scale(1.07); }
.vplay-ic:active { transform: scale(0.93); }
.vghost {
  cursor: pointer; border-radius: 999px; padding: 9px 16px;
  background: rgba(255, 255, 255, 0.06); border: none; color: var(--ink);
  font: inherit; font-size: 12.5px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 7px;
  transition: transform 400ms var(--spring), background 300ms;
}
.vghost:hover { background: rgba(255, 255, 255, 0.11); }
.vghost svg { width: 14px; height: 14px; }
.vghost.danger.armed { background: #e11d48; color: #fff; }
.vname { flex: 0 1 auto; min-width: 0; width: auto; font: inherit; font-size: 28px; font-weight: 600; font-family: "Clash Display", sans-serif; background: rgba(255,255,255,0.07); border: none; border-radius: 10px; color: var(--ink); padding: 4px 10px; }
.trow {
  display: flex; gap: 12px; align-items: center; padding: 8px 10px;
  border-radius: 14px; animation: rise 600ms var(--spring) backwards;
  transition: background 300ms, opacity 300ms;
}
.trow:hover { background: rgba(255, 255, 255, 0.045); }
.trow img { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; flex: none; background: #1c1c1f; cursor: pointer; }
.trow .tt { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 3px; cursor: pointer; }
.trow .tt .t { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trow .tt .tdur { font-size: 0.82em; color: var(--faint); font-weight: 500; font-variant-numeric: tabular-nums; }
.trow .tt small { display: block; font-size: 11px; color: var(--green); font-weight: 700; }
.trow .td { font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.trow button.icb {
  width: 30px; height: 30px; flex: none; border-radius: 50%; cursor: pointer;
  background: none; border: none; color: var(--faint);
  display: flex; align-items: center; justify-content: center;
  transition: color 300ms, background 300ms, transform 400ms var(--spring);
}
.trow button.icb svg { width: 15px; height: 15px; }
.trow button.icb:hover { color: var(--ink); background: rgba(255, 255, 255, 0.08); }
.trow button.icb.loved { color: #fff; }
.trow button.icb.loved svg path { fill: currentColor; }
/* drag-to-reorder: whole row is the handle */
.trow { cursor: grab; }
.trow:active { cursor: grabbing; }
.trow button { cursor: pointer; }
.trow.dragging { opacity: 0.3; }
.drag-ghost {
  position: fixed; z-index: 300; pointer-events: none; margin: 0;
  background: #1a1a1e; border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6);
  animation: none;
  will-change: transform;
}
.drop-line { height: 3px; border-radius: 2px; background: var(--green); margin: 2px 12px; }
/* self-update pill */
#updBar {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 300;
  display: flex; gap: 9px; align-items: center;
  background: #131315; color: var(--ink); border: none; border-radius: 999px;
  padding: 11px 20px; font: inherit; font-size: 13px; font-weight: 800; cursor: pointer;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55), inset 0 1px 1px rgba(255, 255, 255, 0.12);
  animation: updbop 600ms var(--spring) both;
}
#updBar .udot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex: none; animation: blink 1.2s ease infinite; }
@keyframes blink { 50% { opacity: 0.3; } }
@keyframes updbop { from { transform: translate(-50%, -18px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
.vempty { color: var(--faint); font-size: 13.5px; padding: 26px 6px; text-align: center; }
.vempty.pl-empty { padding: 34px 10px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.empty-icon.small { width: 58px; height: 58px; border-radius: 19px; margin-bottom: 12px; color: #0a0a0b; background: linear-gradient(135deg, var(--green), #0d7a37); display: flex; align-items: center; justify-content: center; box-shadow: 0 14px 40px rgba(30, 215, 96, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.5); }
.empty-icon.small svg { width: 26px; height: 26px; }
.vempty.pl-empty h3 { font-family: "Clash Display", sans-serif; font-size: 22px; margin: 0 0 4px; color: var(--ink); letter-spacing: -0.01em; }
.vempty.pl-empty p { margin: 0 0 16px; }

/* ============ cards: liked badge ============ */
.card .likedot {
  position: absolute; top: 7px; left: 7px; z-index: 2;
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(0, 0, 0, 0.55); color: #fff;
  display: none; align-items: center; justify-content: center;
}
.card .likedot svg { width: 14px; height: 14px; }
.card.liked .likedot { display: flex; }
.card.liked .likedot svg path { fill: currentColor; }
.card .reason { font-size: 11px; color: var(--green); font-weight: 700; margin: 2px 8px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#homeFy { margin-top: 26px; animation: rise 700ms var(--spring) both; }
.fyhead { display: flex; align-items: flex-end; justify-content: space-between; margin: 2px 2px 12px; }
.fyhead h2 { font-family: "Clash Display", sans-serif; font-size: 22px; margin: 0; letter-spacing: -0.01em; }
.fyhead p { margin: 3px 0 0; font-size: 12px; color: var(--faint); font-weight: 500; }

/* ============ context menu ============ */
.menu {
  position: fixed; z-index: 200; min-width: 210px;
  background: #161618; border-radius: 15px; padding: 6px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.65), inset 0 1px 1px rgba(255, 255, 255, 0.1);
  animation: menuin 350ms var(--spring) both;
}
@keyframes menuin { from { transform: scale(0.92) translateY(-4px); opacity: 0; } to { transform: none; opacity: 1; } }
.menu button {
  display: flex; gap: 10px; align-items: center; width: 100%;
  background: none; border: none; cursor: pointer; color: var(--ink);
  font: inherit; font-size: 13px; font-weight: 600;
  border-radius: 10px; padding: 9px 11px; text-align: left;
  transition: background 250ms;
}
.menu button:hover { background: rgba(255, 255, 255, 0.08); }
.menu button svg { width: 15px; height: 15px; color: var(--dim); flex: none; }
.menu button img { width: 26px; height: 26px; border-radius: 8px; object-fit: cover; flex: none; }
.vcover { position: relative; }
.menu button.loved { color: #fff; }
.menu button.loved svg path { fill: currentColor; }
.menu .sep { height: 1px; background: rgba(255, 255, 255, 0.07); margin: 5px 8px; }
.menu .mhead { font-size: 10px; font-weight: 900; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); padding: 7px 11px 3px; }
.mempty { display: flex; flex-direction: column; align-items: center; gap: 5px; text-align: center; padding: 16px 10px 12px; }
.mempty svg { width: 26px; height: 26px; color: var(--faint); }
.mempty b { font-size: 13px; }
.mempty span { font-size: 11.5px; color: var(--faint); }

/* ============ modals ============ */
.modal-wrap {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fadein 350ms ease both;
}
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: min(420px, 100%); max-height: calc(100dvh - 60px); overflow-y: auto;
  background: #131316; border-radius: 24px; padding: 24px 22px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7), inset 0 1px 1px rgba(255, 255, 255, 0.12);
  animation: modalup 550ms var(--spring) both;
}
@keyframes modalup { from { transform: translateY(22px) scale(0.97); opacity: 0; } to { transform: none; opacity: 1; } }
.modal h2 { font-family: "Clash Display", sans-serif; font-size: 24px; margin: 0 0 4px; letter-spacing: -0.01em; }
.modal .msub { font-size: 12.5px; color: var(--dim); margin: 0 0 16px; line-height: 1.55; }
.modal label.fl { display: block; font-size: 11px; font-weight: 900; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); margin: 14px 0 7px; }
.modal input[type="text"], .modal input[type="password"] {
  width: 100%; background: rgba(255, 255, 255, 0.06); border: none; border-radius: 12px;
  color: var(--ink); font: inherit; font-size: 14px; font-weight: 500; padding: 11px 13px;
}
.modal input:focus { background: rgba(255, 255, 255, 0.1); }
.modal .mrow { display: flex; gap: 9px; margin-top: 18px; }
.mbtn {
  flex: 1; cursor: pointer; border: none; border-radius: 999px; padding: 11px 0;
  font: inherit; font-size: 13.5px; font-weight: 900;
  transition: transform 400ms var(--spring);
}
.mbtn:active { transform: scale(0.96); }
.mbtn.primary { background: var(--ink); color: #0a0a0b; }
.mbtn.primary:hover { transform: scale(1.02); }
.mbtn.ghost { background: rgba(255, 255, 255, 0.07); color: var(--ink); }
.mbtn.danger { background: #e11d48; color: #fff; }
.modal .merr { color: #ff7d9c; font-size: 12.5px; font-weight: 700; margin-top: 10px; min-height: 18px; }
.mtabs { display: flex; gap: 6px; margin-bottom: 6px; }
.mtabs button {
  flex: 1; cursor: pointer; border: none; border-radius: 999px; padding: 9px 0;
  background: none; color: var(--dim); font: inherit; font-size: 13px; font-weight: 800;
  transition: all 350ms var(--spring);
}
.mtabs button.on { background: rgba(255, 255, 255, 0.09); color: var(--ink); }
.pickchips { display: flex; gap: 7px; flex-wrap: wrap; }
.pickchips button {
  cursor: pointer; border-radius: 999px; padding: 8px 14px;
  background: rgba(255, 255, 255, 0.06); border: none; color: var(--ink);
  font: inherit; font-size: 12.5px; font-weight: 700;
  transition: transform 400ms var(--spring), background 300ms;
}
.pickchips button:hover { transform: translateY(-1px); }
.pickchips button.on { background: var(--green); color: #0a0a0b; }
.swatches { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.swatches button {
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer; border: none;
  transition: transform 400ms var(--spring);
}
.swatches button:hover { transform: scale(1.12); }
.swatches button.on { box-shadow: 0 0 0 2px #0a0a0b, 0 0 0 4px currentColor; }
.swatches input[type="color"] { width: 34px; height: 34px; border: none; border-radius: 50%; background: none; cursor: pointer; padding: 0; }
.huerow { display: flex; gap: 12px; align-items: center; }
.huerow input { flex: 1; }
.avatar.big { width: 52px; height: 52px; font-size: 22px; flex: none; }
.profiletop { display: flex; gap: 14px; align-items: center; margin-bottom: 4px; }

/* custom volume slider */
#vol {
  -webkit-appearance: none; appearance: none;
  width: 96px; height: 14px; background: transparent; cursor: pointer;
}
#vol::-webkit-slider-runnable-track {
  height: 4px; border-radius: 99px;
  background: linear-gradient(to right, #fff var(--v, 85%), rgba(255, 255, 255, 0.16) var(--v, 85%));
}
#vol::-webkit-slider-thumb {
  -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%;
  background: #fff; margin-top: -4px; border: none;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.45);
  transition: transform 300ms var(--spring);
}
#vol::-webkit-slider-thumb:hover { transform: scale(1.25); }
#vol::-moz-range-track { height: 4px; border-radius: 99px; background: rgba(255, 255, 255, 0.16); }
#vol::-moz-range-progress { height: 4px; border-radius: 99px; background: #fff; }
#vol::-moz-range-thumb { width: 12px; height: 12px; border: none; border-radius: 50%; background: #fff; }

@media (max-width: 860px) {
  #side { width: 76px; padding: 14px 8px; }
  #sideBrand { font-size: 0; text-align: center; padding: 10px 0; }
  #sideBrand::first-letter { font-size: 22px; }
  .snav button span, #plList button.pl span.nm, #plList .cnt, .snav b,
  .side-head span, #newPl { display: none; }
  .snav button, #plList button.pl { justify-content: center; }
  .side-head { justify-content: center; }
}

/* ===== phone: tab bar + expandable player + library sheet ===== */
#tabbar, #sheet, #bigplayer { display: none; }

@media (max-width: 760px) {
  body { flex-direction: column; }
  body.home { height: auto; overflow: visible; }
  #side { display: none; }
  .wrap { padding: 12px 14px 0; }
  .top { width: calc(100% - 20px); }
  body.has-player .stage .wrap { padding-bottom: calc(252px + env(safe-area-inset-bottom, 0px)); }
  .search input { font-size: 16px; }

  /* bottom tab bar */
  #tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: rgba(13, 13, 16, 0.94);
    backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom, 0px));
  }
  #tabbar button {
    flex: 1; background: none; border: none; cursor: pointer; color: var(--faint);
    font: inherit; font-size: 10.5px; font-weight: 800;
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    min-height: 58px; justify-content: center; border-radius: 12px;
    transition: color 300ms, transform 400ms var(--spring);
  }
  #tabbar button:active { transform: scale(0.92); }
  #tabbar button svg { width: 23px; height: 23px; }
  #tabbar button.on { color: var(--green); }

  /* compact mini player above the tab bar (tap to expand) */
  .player {
    left: 0; right: 0; transform: none; width: 100%;
    bottom: calc(82px + env(safe-area-inset-bottom, 0px));
    border-radius: 0; padding: 10px 14px; gap: 10px; cursor: pointer;
    animation: none;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02) 50%, rgba(10, 10, 11, 0.4));
    backdrop-filter: blur(30px) saturate(1.9);
    -webkit-backdrop-filter: blur(30px) saturate(1.9);
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
  }
  .player #art { width: 50px; height: 50px; border-radius: 11px; }
  .p-meta { display: flex; flex: 1; align-items: center; min-width: 0; }
  .p-meta #ptitle { font-size: 14px; }
  .player .p-center { display: flex; flex: none; }
  .player .p-btns { display: flex; }
  .player .p-btns button { display: none; }
  .player .p-btns .big { display: flex; width: 60px; height: 60px; }
  .player .p-btns .big svg { height: 24px; }
  .player .p-track { display: none; }
  .player .p-right { display: none; }

  /* expanded full player */
  #bigplayer {
    display: flex; position: fixed; inset: 0; z-index: 120;
    flex-direction: column; align-items: center;
    gap: 0; padding: 0 28px calc(30px + env(safe-area-inset-bottom, 0px));
    background: #0a0a0b;
    animation: bpin 550ms var(--spring) both;
  }
  @keyframes bpin { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
  #bpClose {
    position: absolute; top: calc(14px + env(safe-area-inset-top, 0px)); right: 16px;
    width: 46px; height: 46px; border-radius: 50%; border: none; cursor: pointer;
    background: rgba(255,255,255,0.08); color: var(--ink);
    background: rgba(255, 255, 255, 0.08); color: var(--ink);
    display: flex; align-items: center; justify-content: center;
  }
  #bpClose svg { width: 22px; height: 22px; }
  #bpStage { display: flex; flex-direction: column; align-items: center; gap: 16px; width: 100%; max-width: 420px; height: 100%; justify-content: flex-start; }
  #bpStage #art { width: min(68vw, 300px); height: min(68vw, 300px); border-radius: 22px; margin-top: 9vh; }
  #bpStage #art { width: min(68vw, 300px); height: min(68vw, 300px); border-radius: 22px; }
  #bpStage .p-meta { width: 100%; justify-content: center; text-align: center; }
  #bpStage .p-meta #ptitle {
    font-size: 21px; font-weight: 900; white-space: normal;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  #bpStage .p-center { display: flex; width: 100%; margin-top: auto; }
  #bpStage .p-btns { display: flex; gap: 0; justify-content: space-between; width: 100%; }
  #bpStage .p-btns button { display: flex; flex: none; width: 46px; height: 46px; }
  #bpStage .p-btns button svg { width: 22px; height: 22px; }
  #bpStage .p-btns .big { width: 72px; height: 72px; flex: none; }
  #bpStage .p-btns .big svg { height: 30px; }
  #bpStage .p-track { display: flex; width: 100%; font-size: 12px; }
  #bpStage .p-line { height: 28px; }
  #bpStage .p-line::before, #bpStage .p-fill { height: 5px; }
  #bpStage .p-knob { width: 14px; height: 14px; }

  /* library bottom sheet */
  #sheet {
    display: block; position: fixed; inset: 0; z-index: 130;
    background: rgba(0, 0, 0, 0.55);
    animation: fadein 300ms ease both;
  }
  .sheet-card {
    position: absolute; left: 0; right: 0; bottom: 0;
    background: #141416; border-radius: 26px 26px 0 0;
    padding: 10px 18px calc(22px + env(safe-area-inset-bottom, 0px));
    max-height: 72dvh; overflow-y: auto;
    animation: sheetup 550ms var(--spring) both;
  }
  @keyframes sheetup { from { transform: translateY(60px); opacity: 0; } to { transform: none; opacity: 1; } }
  .sheet-grip { width: 40px; height: 4px; border-radius: 99px; background: rgba(255, 255, 255, 0.18); margin: 2px auto 12px; }
  .sheet-user {
    display: flex; gap: 11px; align-items: center; width: 100%;
    background: rgba(255, 255, 255, 0.05); border: none; border-radius: 15px;
    padding: 10px 12px; color: var(--ink); font: inherit; margin-bottom: 12px; cursor: pointer;
  }
  .sheet-user .avatar { width: 38px; height: 38px; font-size: 16px; }
  .sheet-user b { font-size: 14px; display: block; text-align: left; }
  .sheet-user i { font-style: normal; font-size: 11.5px; color: var(--faint); display: block; text-align: left; }
  .sheet-head {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 11px; font-weight: 900; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--faint); padding: 4px 4px 8px;
  }
  .sheet-head button {
    border: none; cursor: pointer; border-radius: 999px;
    background: rgba(255, 255, 255, 0.08); color: var(--ink);
    font: inherit; font-size: 12.5px; font-weight: 800; padding: 10px 18px;
  }
  .sheet-row {
    display: flex; gap: 12px; align-items: center; width: 100%;
    background: none; border: none; color: var(--ink); font: inherit;
    border-radius: 14px; padding: 9px 8px; cursor: pointer; text-align: left; min-height: 62px;
  }
  .sheet-row:active { background: rgba(255, 255, 255, 0.06); }
  .sheet-row img, .sheet-row .ph {
    width: 46px; height: 46px; border-radius: 12px; object-fit: cover; flex: none; background: #1c1c1f;
  }
  .sheet-row .ph {
    background: linear-gradient(135deg, rgba(30,215,96,0.35), rgba(139,92,246,0.35));
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; font-weight: 900; color: #fff;
  }
  .sheet-row .nm { flex: 1; font-size: 14.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sheet-row .cnt { font-size: 12px; color: var(--faint); }

  /* big touch targets everywhere else */
  .card h3 { font-size: 15px; }
  .trow { min-height: 64px; padding: 10px 12px; }
  .trow img { width: 52px; height: 52px; }
  .trow .tt { font-size: 14.5px; }
  .trow button.icb { width: 44px; height: 44px; }
  .trow button.icb svg { width: 18px; height: 18px; }
  .menu { min-width: 240px; }
  .menu button { min-height: 48px; font-size: 14px; }
  .modal { padding: 26px 22px; }
  .mbtn { padding: 14px 0; font-size: 14.5px; }
  .modal input[type="text"], .modal input[type="password"] { padding: 14px; font-size: 16px; }
  .pickchips button { padding: 12px 18px; font-size: 13.5px; }
}

/* ===== phone comfort pass: rhythm, safe areas, precision ===== */
@media (max-width: 760px) {
  body.home { height: auto; overflow: visible; }
  html, body { overscroll-behavior-y: none; }
  body { touch-action: manipulation; }
  .top {
    top: calc(8px + env(safe-area-inset-top, 0px));
    padding: 8px 8px 8px 10px;
    gap: 10px;
  }
  .search { padding: 12px 18px; }
  .search svg { width: 19px; height: 19px; }
  .vhead { gap: 13px; margin-bottom: 14px; }
  .vhead .vcover { width: 92px; height: 92px; border-radius: 17px; }
  .vhead .vcover svg { width: 34px; height: 34px; }
  .vhead h2 { font-size: 24px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .vhead p { font-size: 12px; margin-bottom: 10px; }
  .vactions { gap: 8px; }
  .vplay { padding: 12px 22px; }
  .trow { gap: 10px; border-radius: 16px; }
  #tabbar button.on { background: rgba(30, 215, 96, 0.12); }
  .player #art { width: 54px; height: 54px; }
  .p-meta #ptitle { font-size: 15px; }
  .toast { bottom: 216px; font-size: 13.5px; padding: 12px 18px 12px 15px; }
  .menu { min-width: 260px; border-radius: 18px; }
  #bigplayer { gap: 20px; }
  #bigplayer .p-track { font-size: 13px; }
  #bigplayer .p-track span { min-width: 36px; }
  .sheet-card { border-radius: 28px 28px 0 0; }
  .modal { border-radius: 26px; }
  .grid { gap: 12px; }
  .card { border-radius: 18px; }
}

/* ===== phone fit + scale pass ===== */
@media (max-width: 760px) {
  /* long playlist names must shrink, never push the screen sideways */
  .vtitle-row { min-width: 0; }
  .vtitle-row h2 { flex: 1; min-width: 0; font-size: 22px; }
  .vhead .vcover { width: 84px; height: 84px; }
  /* bigger tab bar */
  #tabbar button { min-height: 66px; font-size: 11.5px; }
  #tabbar button svg { width: 25px; height: 25px; }
  /* bigger mini player */
  .player #art { width: 58px; height: 58px; border-radius: 13px; }
  .p-meta #ptitle { font-size: 15px; }
  .player .p-btns .big { width: 68px; height: 68px; }
  .player .p-btns .big svg { height: 27px; }
  /* bigger fullscreen player */
  #bpStage #art { width: min(72vw, 320px); height: min(72vw, 320px); object-fit: cover; background: #1c1c1f; }
  #bpStage .p-btns button { width: 56px; height: 56px; }
  #bpStage .p-btns button svg { width: 25px; height: 25px; }
  #bpStage .p-btns .big { width: 88px; height: 88px; }
  #bpStage .p-btns .big svg { height: 34px; }
  #bpStage .p-meta #ptitle { font-size: 22px; }
  /* roomier rows + menus */
  .trow { min-height: 68px; gap: 12px; }
  .trow img { width: 56px; height: 56px; border-radius: 13px; }
  .trow .tt { font-size: 15px; }
  .trow button.icb { width: 46px; height: 46px; }
  .menu button { min-height: 52px; }
  .card { border-radius: 20px; }
  .card h3 { font-size: 15.5px; }
  .vplay-ic { width: 54px; height: 54px; }
  .pencil { width: 36px; height: 36px; }
}

/* ===== roomy rows on desktop + liquid-glass phone tab bar ===== */
@media (min-width: 761px) {
  .trow { min-height: 78px; padding: 10px 14px; gap: 14px; border-radius: 17px; }
  .trow img { width: 64px; height: 64px; border-radius: 14px; }
  .trow .tt { font-size: 15px; }
  .trow .td { font-size: 12.5px; }
  .trow button.icb { width: 38px; height: 38px; }
  .trow button.icb svg { width: 17px; height: 17px; }
}

@media (max-width: 760px) {
  #tabbar {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02) 42%, rgba(10, 10, 11, 0.4));
    backdrop-filter: blur(30px) saturate(1.9);
    -webkit-backdrop-filter: blur(30px) saturate(1.9);
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 -14px 44px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  }
  #tabbar::before {
    content: ""; position: absolute; top: 0; left: 15%; right: 15%; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
    pointer-events: none;
  }
  #tabbar button { color: rgba(255, 255, 255, 0.55); }
  #tabbar button svg { filter: drop-shadow(0 1px 6px rgba(255, 255, 255, 0.12)); }
  #tabbar button.on {
    color: #fff;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.05));
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25), 0 4px 18px rgba(0, 0, 0, 0.35);
    border-radius: 16px;
  }
}

/* ===== phone: list views as big as search ===== */
@media (max-width: 760px) {
  .vhead { gap: 14px; margin-bottom: 16px; }
  .vhead .vcover { width: 104px; height: 104px; border-radius: 20px; }
  .vhead h2 { font-size: 26px; }
  .vhead p { font-size: 13px; }
  .vplay-ic { width: 56px; height: 56px; }
  .vplay-ic svg { height: 23px; }
  .trow { min-height: 84px; padding: 12px 14px; gap: 13px; border-radius: 18px; }
  .trow img { width: 72px; height: 72px; border-radius: 16px; }
  .trow .tt { font-size: 16px; }
  .trow .td { font-size: 12.5px; }
  .trow button.icb { width: 48px; height: 48px; }
  .trow button.icb svg { width: 19px; height: 19px; }
}

/* ===== phone overlay: controls must fit the stage, art locked center ===== */
@media (max-width: 760px) {
  #bigplayer { overflow: hidden; }
  #bpStage #art { align-self: center; flex: none; }
  #bpStage .p-meta { align-self: center; }
  #bpStage .p-btns button { width: 44px; height: 44px; }
  #bpStage .p-btns button svg { width: 21px; height: 21px; }
  #bpStage .p-btns .big { width: 70px; height: 70px; }
  #bpStage .p-btns .big svg { height: 29px; }
}

/* ===== phone fullscreen: centered stack, bigger everything ===== */
@media (max-width: 760px) {
  #bpStage { justify-content: center; gap: 20px; }
  #bpStage #art {
    width: min(76vw, 340px); height: min(76vw, 340px);
    border-radius: 26px; margin-top: 0;
  }
  #bpStage .p-meta #ptitle { font-size: 24px; }
  #bpStage .p-center { margin-top: 0; gap: 14px; }
  #bpStage .p-btns { gap: 0; }
  #bpStage .p-btns button { width: 42px; height: 42px; }
  #bpStage .p-btns button svg { width: 20px; height: 20px; }
  #bpStage .p-btns .big { width: 78px; height: 78px; }
  #bpStage .p-btns .big svg { height: 30px; }
  #bpStage .p-line { height: 32px; }
  #bpStage .p-line::before, #bpStage .p-fill { height: 6px; }
  #bpStage .p-knob { width: 16px; height: 16px; }
  #bpStage .p-track { font-size: 13px; }
}

/* ===== phone fullscreen: bulletproof centering ===== */
@media (max-width: 760px) {
  #bigplayer { justify-content: center; }
  #bpStage { height: auto; max-height: 100%; justify-content: center; }
  #bpStage #art { margin-top: 0; }
  #bpStage .p-center { margin-top: 0; }
}

/* ===== touch press states: every tap answers instantly ===== */
@media (hover: none) {
  button:active { transform: scale(0.93); }
  .card:active { transform: scale(0.97); }
  .trow:active { background: rgba(255, 255, 255, 0.07); }
  .menu button:active { background: rgba(255, 255, 255, 0.13); }
  .sheet-row:active { background: rgba(255, 255, 255, 0.09); }
  .snav button:active, #tabbar button:active { transform: scale(0.9); }
  .pickchips button:active { transform: scale(0.93); }
  .mbtn:active, .vplay-ic:active, .vplay:active { transform: scale(0.94); }
}

/* ===== phone matte black bars (flat, opaque, zero gloss) ===== */
@media (max-width: 760px) {
  .search { background: #141416; box-shadow: none; }
  .search:focus-within { background: #141416; }
  #tabbar {
    background: #0d0d0f;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: none;
  }
  #tabbar::before { display: none; }
  #tabbar button.on { background: rgba(255, 255, 255, 0.1); box-shadow: none; }
  .player {
    background: #0d0d0f;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: none;
  }
  #bigplayer { background: #0a0a0b; }
}

/* ===== phone final: soft motion, visible hearts, guaranteed clearance ===== */
@keyframes phonein {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@media (max-width: 760px) {
  .card, .trow, .vhead, #homeFy, .skelcard {
    animation-name: phonein;
    animation-duration: 550ms;
    animation-timing-function: ease-out;
  }
  .trow button.icb { background: rgba(255, 255, 255, 0.08); }
}

#pfHard { display: none; }
@media (max-width: 760px) {
  #pfHard { display: block; }
}

/* ===== v121 phone deep-fix: header never covers, hearts always visible, soft motion ===== */
@media (max-width: 760px) {
  /* 1) solid sticky header — no transparent gap for content to slide under */
  .top {
    top: 0;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 10px;
    background: #0a0a0b;
    z-index: 50;
  }
  /* standalone PWA (installed web app) gets extra notch room */
  @supports (padding: env(safe-area-inset-top)) {
    .top { padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
  }
  .search { background: #141416; box-shadow: none; }
  .search:focus-within { background: #141416; }

  /* headers start safely below the bar, never kissed by it */
  .wrap { padding-top: 8px; }
  #view .vhead {
    margin-top: 10px;
    padding-top: 4px;
    scroll-margin-top: 96px;
    min-width: 0;
    max-width: 100%;
  }
  .vhead > div { min-width: 0; }

  /* 2) hearts can never be pushed off-screen — hard layout guarantees */
  html, body { overflow-x: hidden; max-width: 100vw; }
  .stage, .wrap, #view { min-width: 0; max-width: 100%; }
  #view { overflow-x: clip; }
  .trow {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    gap: 10px;
  }
  .trow .tt {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }
  .trow .tt .t {
    display: block;
    min-width: 0;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .trow .tt .tdur { flex: none; }
  .trow button.icb {
    flex: none;
    margin-left: auto;
    background: rgba(255, 255, 255, 0.08);
  }

  /* 3a) silky motion — gentle fade-up, no snap, no blur pop */
  .card, .trow, .vhead, #homeFy, .skelcard {
    animation-name: phonein;
    animation-duration: 700ms;
    animation-timing-function: cubic-bezier(0.25, 0.1, 0.25, 1);
  }
  /* stagger stays subtle so lists feel calm, not резкие */
  .trow { animation-delay: 0ms !important; }
  .card { animation-delay: 0ms !important; }

  /* soft press: small shrink, quick down + slow release */
  button { transition: transform 220ms ease-out, background 220ms ease-out, color 220ms ease-out; }
  button:active { transform: scale(0.97); }
  .card:active { transform: scale(0.985); }
  #tabbar button:active { transform: scale(0.95); }

  /* 3b) bottom always reachable */
  body.has-player .stage .wrap { padding-bottom: calc(280px + env(safe-area-inset-bottom, 0px)); }
  .wrap { padding-bottom: calc(200px + env(safe-area-inset-bottom, 0px)); }

  /* 3c) matte black bars — flat, opaque, zero gloss (reinforced last-wins) */
  #tabbar {
    background: #0d0d0f;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: none;
  }
  #tabbar::before { display: none; }
  #tabbar button.on { background: rgba(255, 255, 255, 0.1); box-shadow: none; }
  .player {
    background: #0d0d0f;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: none;
  }
  #bigplayer { background: #0a0a0b; }
}
@keyframes phonein {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* ===== v123: phone intro = big logo fade only ===== */
@media (max-width: 760px) {
  #intro { background: #0a0a0b; transition: opacity 700ms ease; }
  #intro::before { display: none; }
  #intro.clear { opacity: 0; pointer-events: none; }
  .intro-pill {
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
    padding: 0;
    animation: introLogoIn 1100ms ease-out both;
  }
  .intro-pill img.blogo {
    width: 128px;
    height: 128px;
    background: transparent !important;
    border-radius: 50%;
    filter: drop-shadow(0 12px 44px rgba(0, 0, 0, 0.6));
    animation: introLogoIn 1100ms ease-out both;
  }
  .intro-pill > span { display: none; }
  #intro.phonefade {
    transition: opacity 700ms ease;
    opacity: 0;
    pointer-events: none;
  }
  #intro.phonefade .intro-pill,
  #intro.phonefade img.blogo {
    animation: introLogoOut 700ms ease-in both;
  }
}
@keyframes introLogoIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes introLogoOut {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(1.06); }
}

/* ===== v123: tab bar sliding pill + fullscreen collapse ===== */
@media (max-width: 760px) {
  #tabbar { position: fixed; }
  #tabbar button { position: relative; z-index: 1; background: none !important; box-shadow: none !important; }
  #tabbar button svg { transition: transform 350ms cubic-bezier(0.22,1,0.36,1); }
  #tabbar button.on svg { transform: translateY(-1px) scale(1.12); }
  #tabInd {
    position: absolute;
    top: 8px;
    left: 0;
    width: 0;
    height: calc(100% - 16px - env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    transition: left 420ms cubic-bezier(0.22,1,0.36,1), width 420ms cubic-bezier(0.22,1,0.36,1);
    pointer-events: none;
  }
  #bigplayer.closing {
    animation: bpout 380ms cubic-bezier(0.22,1,0.36,1) both;
  }
  .player.pop-in {
    animation: playerin 450ms cubic-bezier(0.22,1,0.36,1) both;
  }
}
@keyframes bpout {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: translateY(48px) scale(0.98); }
}
@keyframes playerin {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

/* ===== v124: playlist create/delete animations on phone sheet ===== */
@media (max-width: 760px) {
  .sheet-row { transition: opacity 300ms ease, transform 350ms cubic-bezier(0.22,1,0.36,1), background 300ms; }
  .sheet-row.fresh {
    animation: sheetpop 900ms cubic-bezier(0.22,1,0.36,1) both;
    background: rgba(30, 215, 96, 0.12);
  }
  .sheet-row.leaving {
    opacity: 0;
    transform: translateX(56px);
    pointer-events: none;
  }
}
@keyframes sheetpop {
  0% { opacity: 0; transform: translateY(14px) scale(0.96); background: rgba(30, 215, 96, 0.22); }
  60% { opacity: 1; transform: translateY(-2px) scale(1.01); background: rgba(30, 215, 96, 0.12); }
  100% { opacity: 1; transform: none; background: transparent; }
}

/* ===== v125: fullscreen controls MUCH bigger (wrap-safe) ===== */
@media (max-width: 760px) {
  #bpStage .p-btns {
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 14px 16px;
    row-gap: 16px;
  }
  #bpStage .p-btns button {
    width: 58px;
    height: 58px;
  }
  #bpStage .p-btns button svg {
    width: 28px;
    height: 28px;
  }
  #bpStage .p-btns .big {
    width: 118px;
    height: 118px;
    margin: 0 8px;
  }
  #bpStage .p-btns .big svg { height: 46px; }
  #bpStage .p-line { height: 36px; }
  #bpStage .p-line::before, #bpStage .p-fill { height: 7px; }
  #bpStage .p-knob { width: 18px; height: 18px; }
}

/* ===== v126: fullscreen 2-row clean layout (fixes wrap mess) ===== */
@media (max-width: 760px) {
  #bpStage .p-btns {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px 8px;
    justify-items: center;
    align-items: center;
    width: 100%;
  }
  /* main row: prev | PLAY (spans 2) | next */
  #bpStage #bPrev { grid-column: 1; grid-row: 1; width: 80px; height: 80px; }
  #bpStage .p-btns .big {
    grid-column: 2 / 4;
    grid-row: 1;
    justify-self: center;
    width: 112px;
    height: 112px;
    margin: 0;
  }
  #bpStage #bNext { grid-column: 4; grid-row: 1; width: 80px; height: 80px; }
  #bpStage #bPrev svg, #bpStage #bNext svg { width: 36px; height: 36px; }
  #bpStage .p-btns .big svg { height: 44px; width: auto; }
  /* second row: like / shuffle / repeat / add */
  #bpStage #bLike { grid-column: 1; grid-row: 2; width: 52px; height: 52px; }
  #bpStage #bShuffle { grid-column: 2; grid-row: 2; width: 52px; height: 52px; }
  #bpStage #bRepeat { grid-column: 3; grid-row: 2; width: 52px; height: 52px; }
  #bpStage #bAdd { grid-column: 4; grid-row: 2; width: 52px; height: 52px; }
  #bpStage #bLike svg, #bpStage #bShuffle svg,
  #bpStage #bRepeat svg, #bpStage #bAdd svg { width: 24px; height: 24px; }
}

/* ===== v129: list headers dock under the sticky search (no half-cut glitch) ===== */
@media (max-width: 760px) {
  #view .vhead {
    position: sticky;
    top: var(--topH, 76px);
    z-index: 40;
    background: #0a0a0b;
    margin: 0 -6px;
    padding: 10px 6px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }
}

/* ===== v130: desktop precision pass — aligned chrome at every width ===== */
:root {
  --sidew: 248px;
  --contentw: 1060px;
}
@media (min-width: 1600px) {
  :root { --contentw: 1240px; }
}
@media (min-width: 1920px) {
  :root { --contentw: 1360px; }
}
@media (max-width: 860px) {
  :root { --sidew: 76px; }
}
@media (min-width: 761px) {
  /* content column + top bar share one measure, always centered in stage */
  .wrap { max-width: var(--contentw); padding: 24px 20px; }
  .top { max-width: var(--contentw); width: calc(100% - 40px); margin: 14px auto 0; padding: 0 20px; }
  body.has-player .stage .wrap { padding-bottom: 140px; }

  /* player centers on the CONTENT column, not the window (sidebar offset) */
  .player {
    left: calc(50% + var(--sidew) / 2);
    width: min(var(--contentw), calc(100% - 28px - var(--sidew)));
    padding: 12px 18px;
  }

  /* fluid grid rhythm per viewport band */
  .grid { gap: 14px; }
  @media (min-width: 1600px) {
    .grid { grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 16px; }
  }
  @media (max-width: 1100px) {
    .grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  }

  /* fluid display type + cover scale */
  .vhead h2 { font-size: clamp(24px, 1.1vw + 18px, 32px); }
  .vhead .vcover { width: clamp(104px, 5vw + 72px, 128px); height: clamp(104px, 5vw + 72px, 128px); }
  .vtitle-row h2 { font-size: clamp(22px, 1.1vw + 16px, 30px); }

  /* player meta yields instead of crowding on narrow desktop */
  .p-meta { flex: 0 1 220px; min-width: 0; width: auto; }

  /* keyboard precision */
  button:focus-visible, input:focus-visible {
    outline: 2px solid var(--green);
    outline-offset: 2px;
  }
}
