/* ============================================================
   Spotifly — design tokens (dark default, light via [data-theme=light]
   or the system preference when nothing is saved)
   ============================================================ */
:root {
  --bg: #000000;
  --bg-2: #0d0d0f;
  --bg-3: #18181b;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.085);
  --surface-3: rgba(255, 255, 255, 0.13);
  --line: rgba(255, 255, 255, 0.08);
  --text: #f5f5f7;
  --muted: #9a9aa6;
  --accent: #8b6cff;
  --accent-2: #ff6cb5;
  --accent-ink: #ffffff;
  --green: #4ade80;
  --red: #f87171;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  --glow: 0 10px 30px rgba(139, 108, 255, 0.35);
  --play-bg: #ffffff;
  --play-ink: #000000;
  --radius: 18px;
  --nav-h: calc(66px + env(safe-area-inset-bottom));
  --ambient: transparent;
  color-scheme: dark;
}
:root[data-theme="light"] { --bg: #f6f5fb; --bg-2: #ffffff; --bg-3: #ebe8f5; --surface: rgba(20, 17, 39, 0.045); --surface-2: rgba(20, 17, 39, 0.08); --surface-3: rgba(20, 17, 39, 0.13); --line: rgba(20, 17, 39, 0.09); --text: #16132a; --muted: #6b6786; --shadow: 0 18px 44px rgba(40, 30, 90, 0.16); --glow: 0 10px 28px rgba(139, 108, 255, 0.3); --play-bg: #16132a; --play-ink: #ffffff; color-scheme: light; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; overscroll-behavior-y: none; -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; background: radial-gradient(80% 50% at 50% -10%, color-mix(in srgb, var(--accent) 10%, transparent) 0%, transparent 70%), var(--bg); transition: background .4s; }
:root[data-theme="light"] body::before { background: radial-gradient(80% 50% at 50% -10%, color-mix(in srgb, var(--accent) 24%, transparent) 0%, transparent 70%), var(--bg); }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input { font: inherit; }
img { background-color: var(--bg-3); }
.hidden { display: none !important; }

/* ---------- layout ---------- */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.view { flex: 1; width: 100%; max-width: 680px; margin: 0 auto; padding: calc(14px + env(safe-area-inset-top)) 16px calc(var(--nav-h) + 24px); }

/* ---------- nav (bottom bar on phones) ---------- */
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; height: var(--nav-h); padding-bottom: env(safe-area-inset-bottom); background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(20px) saturate(140%); -webkit-backdrop-filter: blur(20px) saturate(140%); border-top: 1px solid var(--line); display: flex; align-items: center; }
.nav .brand, .nav .nav-foot { display: none; }
.nav-links { display: flex; flex: 1; justify-content: space-around; align-items: center; }
.nav-links a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 500; color: var(--muted); min-width: 56px; padding: 8px 0; transition: color .15s; }
.nav-links a.active { color: var(--text); }
.nav-ico svg { width: 22px; height: 22px; fill: currentColor; display: block; }
.nav-ico.stroke svg { fill: none; }
.srow-ico.stroke svg { width: 20px; height: 20px; fill: none; stroke: currentColor; }

/* ---------- type & primitives ---------- */
h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.6px; margin: 8px 0 18px; }
h2 { font-size: 13px; margin: 26px 0 10px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; }
.muted { color: var(--muted); }
.row { display: flex; align-items: center; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.center { text-align: center; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.error { color: var(--red); }
.link:hover { text-decoration: underline; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 18px; border-radius: 999px; background: var(--surface-2); font-weight: 600; font-size: 14px; transition: transform .08s ease, background .15s, box-shadow .15s; white-space: nowrap; }
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(0.97); }
.btn.primary { background: linear-gradient(135deg, var(--accent), #6a4cff); color: var(--accent-ink); box-shadow: var(--glow); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.discord { background: #5865f2; color: #fff; }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--surface); }
.btn.small { padding: 8px 14px; font-size: 13px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: 0.5; pointer-events: none; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.input { width: 100%; padding: 14px 18px; border-radius: 16px; background: var(--surface-2); border: 1px solid transparent; color: var(--text); outline: none; font-size: 16px; transition: border-color .15s, background .15s; }
.input::placeholder { color: var(--muted); }
.input:focus { border-color: var(--accent); background: var(--surface-3); }
.pill { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.pill.live { color: var(--green); background: color-mix(in srgb, var(--green) 14%, transparent); }
.avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.avatars { display: flex; }
.avatars .avatar { margin-left: -8px; border: 2px solid var(--bg); }
.avatars .avatar:first-child { margin-left: 0; }
.spinner { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; margin: 28px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); }
.members { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.member { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; background: var(--surface); border: 1px solid var(--line); padding: 4px 10px 4px 4px; border-radius: 999px; }
.member .avatar { width: 22px; height: 22px; }

/* ---------- login / hero ---------- */
.hero { min-height: calc(100vh - 140px); display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 16px; }
.hero .logo { width: 96px; height: 96px; border-radius: 28px; box-shadow: var(--shadow), var(--glow); }
.hero h1 { font-size: 38px; margin: 6px 0 0; letter-spacing: -1px; }
.hero p { margin: 0; color: var(--muted); max-width: 320px; line-height: 1.5; }

/* ---------- track rows ---------- */
.track { display: flex; align-items: center; gap: 12px; padding: 8px 6px; border-radius: 14px; transition: background .12s; }
.track:hover, .track:active { background: var(--surface); }
.track .art { width: 50px; height: 50px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }
.track .title { font-weight: 600; font-size: 15px; }
.track .sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.track .more { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); font-size: 20px; }
.track .more:hover { background: var(--surface-2); color: var(--text); }
.track.playing .title { color: var(--accent); }
.track .num { width: 22px; text-align: right; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }

/* ---------- now playing ---------- */
.np-wrap { position: relative; }
.np-ambient { position: absolute; inset: -40px -16px -20px; z-index: -1; background: var(--ambient) center / cover no-repeat; filter: blur(70px) saturate(1.3); opacity: 0.45; pointer-events: none; mask-image: linear-gradient(to bottom, #000 40%, transparent); -webkit-mask-image: linear-gradient(to bottom, #000 40%, transparent); }
:root[data-theme="light"] .np-ambient { opacity: 0.35; }
.np { display: flex; flex-direction: column; align-items: center; gap: 16px; padding-top: 10px; }
.np .big-art { width: min(72vw, 320px); aspect-ratio: 1; border-radius: 24px; object-fit: cover; box-shadow: var(--shadow); }
.art-wrap { position: relative; width: min(72vw, 320px); }
.art-wrap .big-art { width: 100%; }
.art-loading { position: absolute; inset: 0; border-radius: 24px; background: rgba(10, 8, 20, 0.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: none; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: #fff; font-weight: 600; font-size: 14px; }
.art-loading .spinner { margin: 0; border-top-color: #fff; }
.art-wrap.loading .art-loading { display: flex; }
.loading-banner { display: inline-block; background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--text); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; margin-bottom: 10px; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
.np .big-art.idle { display: grid; place-items: center; font-size: 64px; color: var(--muted); background: var(--surface-2); }
.np .np-title { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; text-align: center; line-height: 1.15; }
.np .np-artist { color: var(--muted); text-align: center; font-weight: 500; margin-top: 4px; }
.np .added { font-size: 12px; color: var(--muted); }
.progress { width: 100%; }
.progress .times { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 4px; font-variant-numeric: tabular-nums; }
.seek { -webkit-appearance: none; appearance: none; width: 100%; height: 20px; background: transparent; margin: 0; cursor: pointer; --pct: 0%; }
.seek:disabled { cursor: default; opacity: .5; }
.seek::-webkit-slider-runnable-track { height: 5px; border-radius: 5px; background: linear-gradient(to right, var(--accent) var(--pct), var(--surface-3) var(--pct)); }
.seek::-moz-range-track { height: 5px; border-radius: 5px; background: var(--surface-3); }
.seek::-moz-range-progress { height: 5px; border-radius: 5px; background: var(--accent); }
.seek::-webkit-slider-thumb { -webkit-appearance: none; width: 15px; height: 15px; border-radius: 50%; background: var(--text); margin-top: -5px; box-shadow: 0 2px 8px rgba(0,0,0,.4); transition: transform .1s; }
.seek:active::-webkit-slider-thumb { transform: scale(1.35); }
.seek::-moz-range-thumb { width: 15px; height: 15px; border: 0; border-radius: 50%; background: var(--text); box-shadow: 0 2px 8px rgba(0,0,0,.4); }
.controls { display: flex; align-items: center; justify-content: center; gap: 18px; }
.controls button { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-size: 20px; background: var(--surface-2); transition: background .15s, transform .08s; }
.controls button:hover { background: var(--surface-3); }
.controls button.main { width: 74px; height: 74px; font-size: 30px; background: var(--play-bg); color: var(--play-ink); box-shadow: var(--shadow); }
.controls button:active { transform: scale(0.94); }
.volume { display: flex; align-items: center; gap: 10px; width: 100%; color: var(--muted); }
.volume input { flex: 1; accent-color: var(--accent); }
.queue-head { display: flex; align-items: center; justify-content: space-between; margin-top: 26px; }
.queue-head h2 { margin: 0; }
.mini-actions { display: flex; gap: 6px; }

/* ---------- sheet ---------- */
.sheet { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); z-index: 50; display: flex; align-items: flex-end; }
.sheet-body { width: 100%; max-width: 640px; margin: 0 auto; background: var(--bg-2); border: 1px solid var(--line); border-radius: 24px 24px 0 0; padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); animation: up .18s ease-out; max-height: 80vh; overflow: auto; box-shadow: var(--shadow); }
@keyframes up { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-handle { width: 40px; height: 4px; background: var(--line); border-radius: 4px; margin: 0 auto 12px; }
.sheet-item { display: flex; align-items: center; gap: 14px; padding: 14px 8px; font-size: 16px; font-weight: 500; border-radius: 14px; width: 100%; text-align: left; }
.sheet-item:hover, .sheet-item:active { background: var(--surface); }
.sheet-item .ico { width: 28px; text-align: center; font-size: 18px; }
.sheet-item.danger { color: var(--red); }
.btn.danger { background: color-mix(in srgb, var(--red) 16%, transparent); color: var(--red); border-color: color-mix(in srgb, var(--red) 45%, transparent); }
.btn.danger:hover { background: color-mix(in srgb, var(--red) 28%, transparent); }
.brand-ico { width: 28px; height: 28px; border-radius: 50%; object-fit: contain; flex: none; }

/* ---------- toasts ---------- */
.toasts { position: fixed; top: calc(12px + env(safe-area-inset-top)); left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 60; pointer-events: none; }
.toast { background: var(--bg-2); border: 1px solid var(--line); padding: 10px 14px; border-radius: 999px; font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 8px; box-shadow: var(--shadow); animation: pop .2s ease-out; max-width: 92vw; }
.toast.error { border-color: color-mix(in srgb, var(--red) 50%, transparent); }
@keyframes pop { from { transform: translateY(-10px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- grids, tiles, servers ---------- */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; transition: transform .15s ease, background .15s; }
.tile:hover { transform: translateY(-2px); background: var(--surface-2); }
.tile img, .tile .ph { width: 100%; aspect-ratio: 1; object-fit: cover; display: grid; place-items: center; font-size: 36px; color: var(--muted); }
.tile .t { padding: 10px 10px 2px; font-size: 14px; font-weight: 600; }
.tile .s { padding: 0 10px 10px; font-size: 12px; color: var(--muted); }
.server { display: flex; align-items: center; gap: 14px; padding: 14px; transition: background .15s; }
.server:hover { background: var(--surface-2); }
.server img, .server .ph { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-weight: 700; background: var(--bg-3); }
.server .name { font-weight: 700; font-size: 16px; }
.server .sub { color: var(--muted); font-size: 13px; }
.server.locked { opacity: 0.6; }
.chip-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }
.chip { flex-shrink: 0; padding: 8px 14px; border-radius: 999px; background: var(--surface-2); font-size: 14px; font-weight: 600; }
.chip.active { background: var(--accent); color: var(--accent-ink); }
.sticky-search { position: sticky; top: 0; padding: 6px 0 12px; background: linear-gradient(var(--bg) 70%, transparent); z-index: 5; }
.pl-art { width: 96px; height: 96px; border-radius: 16px; object-fit: cover; box-shadow: var(--shadow); }

/* ---------- artists & albums ---------- */
.chip-row.artists { gap: 14px; padding: 4px 0 8px; }
.artist-card { flex-shrink: 0; width: 120px; text-align: center; }
.artist-card img, .artist-card .ph { width: 110px; height: 110px; border-radius: 50%; object-fit: cover; margin: 0 auto 8px; display: grid; place-items: center; font-size: 36px; box-shadow: var(--shadow); transition: transform .15s; }
.artist-card:hover img { transform: scale(1.04); }
.artist-card .t { font-weight: 600; font-size: 14px; }
.artist-card .s { font-size: 12px; color: var(--muted); }
.artist-hero { position: relative; margin: calc(-14px - env(safe-area-inset-top)) -16px 0; padding: calc(16px + env(safe-area-inset-top)) 16px 18px; min-height: 300px; display: flex; flex-direction: column; justify-content: space-between; background: linear-gradient(to bottom, color-mix(in srgb, var(--bg) 10%, transparent), color-mix(in srgb, var(--bg) 55%, transparent) 60%, var(--bg)), var(--hero, linear-gradient(135deg, var(--accent), var(--accent-2))) center 25% / cover no-repeat; }
.hero-kicker { font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.hero-name { font-size: 40px; font-weight: 800; margin: 2px 0 4px; letter-spacing: -1.2px; line-height: 1; text-shadow: 0 4px 24px rgba(0,0,0,.5); }

/* ---------- account / theme ---------- */
.theme-toggle { display: inline-flex; align-items: center; gap: 10px; padding: 8px 12px 8px 8px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--muted); transition: background .15s; }
.theme-toggle:hover { background: var(--surface-2); color: var(--text); }
.tt-track { position: relative; width: 40px; height: 22px; border-radius: 999px; background: var(--surface-3); flex-shrink: 0; transition: background .2s; }
.tt-knob { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--text); transition: transform .2s, background .2s; }
:root[data-theme="light"] .tt-track { background: var(--accent); }
:root[data-theme="light"] .tt-knob { transform: translateX(18px); background: #fff; }
.theme-toggle .moon { display: none; }
:root[data-theme="light"] .theme-toggle .sun { display: none; }
:root[data-theme="light"] .theme-toggle .moon { display: inline; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 4px; gap: 4px; }
.seg button { padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); }
.seg button.active { background: var(--bg-2); color: var(--text); box-shadow: 0 2px 8px rgba(0,0,0,.2); }

/* ============================================================
   Desktop (≥ 900px): left sidebar, roomy content, two-column player
   ============================================================ */
@media (min-width: 900px) {
  :root { --nav-h: 0px; }
  .app { flex-direction: row; }
  .nav { position: sticky; top: 0; height: 100vh; width: 248px; flex-shrink: 0; flex-direction: column; align-items: stretch; padding: 22px 14px; border-top: 0; border-right: 1px solid var(--line); background: color-mix(in srgb, var(--bg-2) 70%, transparent); }
  .nav .brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 24px; font-size: 20px; font-weight: 800; letter-spacing: -0.4px; }
  .nav .brand img { border-radius: 10px; box-shadow: var(--glow); }
  .nav-links { flex-direction: column; justify-content: flex-start; align-items: stretch; gap: 4px; flex: 1; }
  .nav-links a { flex-direction: row; gap: 12px; font-size: 15px; padding: 11px 12px; border-radius: 12px; min-width: 0; }
  .nav-links a:hover { background: var(--surface); color: var(--text); }
  .nav-links a.active { background: var(--surface-2); }
  .nav-ico svg { width: 20px; height: 20px; }
  .nav .nav-foot { display: flex; justify-content: flex-start; padding: 8px 6px 0; }
  .view { max-width: 1180px; margin: 0; padding: 36px 44px 60px; }
  h1 { font-size: 34px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
  .np { display: grid; grid-template-columns: 360px 1fr; grid-template-areas: "art meta" "art progress" "art controls" "art volume"; column-gap: 40px; row-gap: 18px; align-items: center; justify-items: start; padding: 10px 0 24px; }
  .np .art-wrap { grid-area: art; width: 360px; }
  .np .big-art { width: 360px; border-radius: 26px; }
  .np > div:nth-child(2) { grid-area: meta; }
  .np .np-title, .np .np-artist, .np .added { text-align: left; }
  .np .np-title { font-size: 40px; letter-spacing: -1.2px; }
  .np .np-artist { font-size: 17px; }
  .np .progress { grid-area: progress; }
  .np .controls { grid-area: controls; justify-content: flex-start; }
  .np .volume { grid-area: volume; max-width: 360px; }
  .np-ambient { inset: -60px -44px -40px; }
  .sheet { align-items: center; }
  .sheet-body { border-radius: 24px; max-width: 460px; }
  .toasts { top: 20px; }
  .sticky-search { padding-top: 0; }
  .track .more { opacity: 0; transition: opacity .15s; }
  .track:hover .more { opacity: 1; }
  .artist-hero { margin: -36px -44px 0; padding: 36px 44px 28px; min-height: 380px; border-radius: 0 0 28px 28px; }
  .hero-name { font-size: 68px; }
  .artist-card { width: 150px; }
  .artist-card img, .artist-card .ph { width: 140px; height: 140px; }
}

/* ---------- accent colours (picked in the quiz / Account) ---------- */
:root[data-accent="blue"]   { --accent: #4f8dff; --accent-2: #7cc4ff; --glow: 0 10px 30px rgba(79, 141, 255, 0.35); }
:root[data-accent="teal"]   { --accent: #2dd4bf; --accent-2: #67e8f9; --accent-ink: #052a26; --glow: 0 10px 30px rgba(45, 212, 191, 0.35); }
:root[data-accent="green"]  { --accent: #34d399; --accent-2: #a3e635; --accent-ink: #052e1c; --glow: 0 10px 30px rgba(52, 211, 153, 0.35); }
:root[data-accent="gold"]   { --accent: #fbbf24; --accent-2: #fb923c; --accent-ink: #2a1a02; --glow: 0 10px 30px rgba(251, 191, 36, 0.35); }
:root[data-accent="orange"] { --accent: #fb923c; --accent-2: #f87171; --accent-ink: #2a1202; --glow: 0 10px 30px rgba(251, 146, 60, 0.35); }
:root[data-accent="red"]    { --accent: #f87171; --accent-2: #fb7185; --glow: 0 10px 30px rgba(248, 113, 113, 0.35); }
:root[data-accent="pink"]   { --accent: #f472b6; --accent-2: #c084fc; --glow: 0 10px 30px rgba(244, 114, 182, 0.35); }
:root[data-accent] .btn.primary { background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #000)); }

.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 30px; height: 30px; border-radius: 50%; background: var(--sw); border: 3px solid transparent; box-shadow: 0 0 0 1px var(--line); transition: transform .12s; }
.swatch:hover { transform: scale(1.1); }
.swatch.active { border-color: var(--text); box-shadow: 0 0 0 2px var(--bg), 0 0 16px color-mix(in srgb, var(--sw) 60%, transparent); }

/* ---------- player tweaks ---------- */
.controls button svg { width: 22px; height: 22px; fill: currentColor; display: block; }
.controls button.main svg { width: 30px; height: 30px; }
.controls button.side { width: 44px; height: 44px; background: transparent; color: var(--muted); position: relative; }
.controls button.side svg { width: 20px; height: 20px; fill: none; }
.controls button.side:hover { background: var(--surface-2); }
.controls button.side.on { color: var(--accent); }
.controls button.side b { position: absolute; right: 6px; bottom: 6px; font-size: 10px; font-weight: 800; background: var(--accent); color: var(--accent-ink); border-radius: 999px; width: 14px; height: 14px; display: grid; place-items: center; }

/* ---------- mixes ---------- */
.mix-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 560px) { .mix-grid { grid-template-columns: repeat(3, 1fr); } }
.mix { text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; padding: 0; transition: transform .15s ease, background .15s; }
.mix:hover { transform: translateY(-2px); background: var(--surface-2); }
.mix-art { aspect-ratio: 1; display: grid; background: var(--bg-3); }
.mix-art.quad { grid-template-columns: 1fr 1fr; }
.mix-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mix-art .ph { display: grid; place-items: center; font-size: 36px; color: var(--muted); }
.mix-name { padding: 10px 10px 2px; font-size: 14px; font-weight: 700; }
.mix-sub { padding: 0 10px 10px; font-size: 12px; color: var(--muted); }
.quiz-nudge { margin: 6px 0 14px; border-color: color-mix(in srgb, var(--accent) 50%, transparent); background: color-mix(in srgb, var(--accent) 10%, transparent); }

/* ---------- taste quiz ---------- */
.quiz-head { margin: 10px 0 18px; }
.quiz-head h1 { margin-bottom: 4px; }
.quiz-foot { position: sticky; bottom: calc(var(--nav-h) + 8px); display: flex; align-items: center; gap: 10px; margin-top: 22px; padding: 10px; border-radius: 999px; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--line); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips .chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); transition: background .15s, border-color .15s, transform .08s; }
.chips .chip:active { transform: scale(0.96); }
.chips .chip.on { background: color-mix(in srgb, var(--accent) 22%, transparent); border-color: var(--accent); color: var(--text); }
.artist-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 14px; }
@media (min-width: 560px) { .artist-grid { grid-template-columns: repeat(4, 1fr); } }
.artist-grid:empty { display: none; }
.artist-pick { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px 6px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 600; transition: background .15s, border-color .15s, transform .08s; }
.artist-pick:active { transform: scale(0.96); }
.artist-pick img, .artist-pick .ph { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; display: grid; place-items: center; font-size: 26px; color: var(--muted); transition: box-shadow .15s; }
.artist-pick span { max-width: 100%; }
.artist-pick i { position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-style: normal; font-size: 13px; display: grid; place-items: center; opacity: 0; transform: scale(0.6); transition: opacity .15s, transform .15s; }
.artist-pick.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.artist-pick.on img, .artist-pick.on .ph { box-shadow: 0 0 0 3px var(--accent); }
.artist-pick.on i { opacity: 1; transform: scale(1); }

/* ---------- linked accounts ---------- */
.brand-ico-wrap { width: 36px; height: 36px; display: grid; place-items: center; flex: none; }
.card.linked { padding: 12px 14px; }

/* "Now playing" tab gets a little pulse so people notice music is on */
.nav-links a.live .nav-ico { position: relative; }
.nav-links a.live .nav-ico::after { content: ""; position: absolute; top: -2px; right: -4px; width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 60%, transparent); animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 55%, transparent); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* verified check (popular artists) */
.verified { display: inline-block; vertical-align: -3px; margin-left: 4px; width: 16px; height: 16px; }
.verified svg { width: 16px; height: 16px; fill: #3b9cff; display: block; }
.hero-name .verified, .hero-name .verified svg { width: 26px; height: 26px; vertical-align: -2px; margin-left: 8px; }

/* Spotify-green + solid red, fixed regardless of accent */
.btn.spotify { background: #1db954 !important; color: #04210f !important; box-shadow: 0 8px 22px rgba(29, 185, 84, 0.35); }
.btn.spotify:hover { background: #1ed760 !important; }
.btn.danger.solid { background: #e5484d !important; color: #fff !important; border-color: transparent; box-shadow: 0 8px 22px rgba(229, 72, 77, 0.3); }
.btn.danger.solid:hover { background: #f05b60 !important; }

.btn.icon { width: 44px; height: 44px; padding: 0; border-radius: 50%; }
.sp-card { margin-bottom: 4px; }
.sp-card .brand-ico { width: 32px; height: 32px; }

/* library strip on the Start something section */
.lib-row { gap: 12px; padding: 2px 0 12px; }
.lib-tile { flex-shrink: 0; width: 132px; text-align: left; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; transition: transform .15s, background .15s; }
.lib-tile:hover { transform: translateY(-2px); background: var(--surface-2); }
.lib-tile img, .lib-tile .ph { width: 100%; aspect-ratio: 1; object-fit: cover; display: grid; place-items: center; font-size: 30px; color: var(--muted); }
.lib-tile .t { padding: 8px 10px 0; font-size: 13px; font-weight: 700; }
.lib-tile .s { padding: 0 10px 9px; font-size: 11px; color: var(--muted); }

.server-ico { width: 40px; height: 40px; border-radius: 12px; flex: none; }
.server-ico.ph { display: grid; place-items: center; font-weight: 800; font-size: 16px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--accent-ink); }

/* ---------- install guide (animated phone) ---------- */
.install-overlay { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: flex; align-items: flex-end; justify-content: center; padding: 16px; }
@media (min-width: 700px) { .install-overlay { align-items: center; } }
.install-card { width: 100%; max-width: 520px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 24px; padding: 18px; display: grid; grid-template-columns: 150px 1fr; gap: 18px; box-shadow: var(--shadow); max-height: calc(100vh - 32px); overflow: auto; }
@media (max-width: 420px) { .install-card { grid-template-columns: 120px 1fr; gap: 12px; } }
.install-title { font-size: 18px; font-weight: 800; margin-bottom: 4px; }
.install-steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: 14px; }
.install-steps li::marker { color: var(--accent); font-weight: 800; }
.phone { position: relative; width: 100%; aspect-ratio: 9 / 18; border-radius: 22px; background: #000; padding: 6px; box-shadow: 0 0 0 2px #2a2a33, 0 10px 30px rgba(0,0,0,.5); align-self: center; }
.ph-screen { position: relative; width: 100%; height: 100%; border-radius: 16px; overflow: hidden; background: #0f0e16; }
.ph-app { position: absolute; inset: 0 0 34px 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-size: 11px; font-weight: 700; color: #fff; }
.ph-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 34px; background: #1c1b25; display: flex; align-items: center; justify-content: center; }
.phone.android .ph-bar { top: 0; bottom: auto; height: 26px; justify-content: flex-end; padding-right: 8px; }
.ph-share svg { width: 18px; height: 18px; color: #4f8dff; }
.ph-dots { color: #fff; font-weight: 800; font-size: 16px; }
.ph-sheet { position: absolute; left: 0; right: 0; bottom: 0; background: #23222d; border-radius: 14px 14px 0 0; padding: 8px; transform: translateY(110%); display: grid; gap: 5px; }
.phone.android .ph-sheet { bottom: auto; top: 26px; right: 6px; left: auto; width: 70%; border-radius: 10px; transform: translateY(-120%); }
.ph-row { font-size: 8px; color: #cfcfe0; padding: 6px 8px; border-radius: 7px; background: #2d2c38; display: flex; justify-content: space-between; }
.ph-row.hot { color: #fff; }
.ph-home { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 22px; gap: 4px; font-size: 8px; color: #fff; background: linear-gradient(180deg, #2b2a5a, #0f0e16); opacity: 0; }
.ph-icon { width: 30px; height: 30px; border-radius: 8px; overflow: hidden; }
.ph-icon img { width: 100%; height: 100%; display: block; }
.ph-tap { position: absolute; width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,.35); border: 2px solid #fff; opacity: 0; pointer-events: none; }

/* 9s loop: tap share → sheet slides up → tap "Add to Home Screen" → home screen with Aux icon */
@keyframes ig-tap1 { 0%, 10% { opacity: 0; } 12%, 18% { opacity: 1; } 20%, 100% { opacity: 0; } }
@keyframes ig-sheet { 0%, 20% { transform: translateY(110%); } 26%, 60% { transform: translateY(0); } 66%, 100% { transform: translateY(110%); } }
@keyframes ig-sheet-android { 0%, 20% { transform: translateY(-120%); } 26%, 60% { transform: translateY(0); } 66%, 100% { transform: translateY(-120%); } }
@keyframes ig-hot { 0%, 44% { background: #2d2c38; } 48%, 60% { background: var(--accent); } 62%, 100% { background: #2d2c38; } }
@keyframes ig-tap2 { 0%, 42% { opacity: 0; } 44%, 50% { opacity: 1; } 52%, 100% { opacity: 0; } }
@keyframes ig-home { 0%, 64% { opacity: 0; } 70%, 94% { opacity: 1; } 100% { opacity: 0; } }
.phone .ph-sheet { animation: ig-sheet 9s infinite; }
.phone.android .ph-sheet { animation: ig-sheet-android 9s infinite; }
.phone .ph-row.hot { animation: ig-hot 9s infinite; }
.phone .ph-home { animation: ig-home 9s infinite; }
.phone .ph-tap { animation: ig-tap1 9s infinite; left: calc(50% - 11px); bottom: 6px; }
.phone.android .ph-tap { left: auto; right: 4px; top: 2px; bottom: auto; }
.phone .ph-screen::after { content: ""; position: absolute; width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,.35); border: 2px solid #fff; left: 72%; bottom: 23%; transform: translateX(-50%); opacity: 0; animation: ig-tap2 9s infinite; pointer-events: none; }
.phone.android .ph-screen::after { left: auto; right: 20%; top: 40%; bottom: auto; transform: none; }

/* tiny sun/moon switch in the player header */
.theme-mini { display: inline-flex; align-items: center; gap: 2px; padding: 4px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.theme-mini span { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; opacity: .45; transition: opacity .15s, background .15s, transform .15s; }
.theme-mini span.on { opacity: 1; background: var(--surface-3); transform: scale(1.05); }

/* ---------- back / forward buttons ---------- */
.histnav { position: fixed; z-index: 15; top: calc(10px + env(safe-area-inset-top)); left: 12px; display: flex; gap: 6px; }
.histnav button { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--line); color: var(--text); transition: opacity .15s, background .15s; }
.histnav button svg { width: 18px; height: 18px; }
.histnav button:hover { background: var(--surface-3); }
.histnav button[disabled] { opacity: .3; pointer-events: none; }
/* phones: only a back button, and only on inner pages (artist, album, playlist, mix…) */
@media (max-width: 899px) {
  .histnav #hist-fwd { display: none; }
  .histnav.noback { display: none; }                      /* nothing to go back to → no button */
  .histnav:not(.noback):not(.hidden) ~ .view { padding-top: calc(58px + env(safe-area-inset-top)); }
}
@media (min-width: 900px) {
  .histnav { position: fixed; left: 292px; top: 30px; }
  .histnav.hidden ~ .view { padding-top: 36px; }
  .view { padding-top: 84px; }
}
/* the global back button covers phones; desktop keeps the inline one too */
.inline-back { display: none !important; }

/* ---------- settings page polish ---------- */
.brand-head { display: flex; align-items: center; gap: 14px; margin: 4px 0 18px; }
.brand-logo { width: 54px; height: 54px; border-radius: 16px; box-shadow: var(--glow); }
.brand-name { font-size: 22px; font-weight: 900; letter-spacing: 3px; line-height: 1; }
.brand-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.settings-title { font-size: 20px; margin: 0 0 6px; color: var(--muted); font-weight: 700; letter-spacing: -0.2px; }
.sgroup { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.srow { display: flex; align-items: center; gap: 12px; padding: 13px 14px; }
.srow + .srow { border-top: 1px solid var(--line); }
.srow.col { display: block; }
.srow-ico { width: 32px; height: 32px; display: grid; place-items: center; flex: none; }
.srow-ico .avatar { width: 30px; height: 30px; }
.srow-t { font-weight: 600; font-size: 15px; }
.srow-s { font-size: 12px; color: var(--muted); margin-top: 2px; }
@media (min-width: 900px) { .brand-head { margin-top: 0; } .brand-logo { width: 64px; height: 64px; border-radius: 18px; } .brand-name { font-size: 26px; } .sgroup { max-width: 760px; } }

.brand-mono { width: 30px; height: 30px; border-radius: 9px; display: inline-grid; place-items: center; color: #fff; font-weight: 800; font-size: 15px; flex: none; }
.srow-ico .brand-ico { width: 30px; height: 30px; border-radius: 9px; }
