/* Vedia Music — dark theme after Auralane (github.com/adam10000423-oss/Auralane, MIT).
   The accent follows the current song's artwork: app.js sets --theme / --theme-lite / --on-accent. */
:root {
  color-scheme: dark;
  --bg: #0b0b0c;
  --bg2: #18181b;        /* raised surfaces: inputs, chips, sheets */
  --card: #17171a;
  --card-2: #1f1f23;     /* pressed / current row */
  --line: #2b2b30;
  --line-soft: rgba(255, 255, 255, .08);
  --text: #f5f5f6;
  --sub: #a6a6ad;
  --subtle: #73737c;
  --theme: 41, 182, 246;       /* Vedia blue until a song plays */
  --theme-lite: 127, 227, 255;
  --on-accent: #101014;
  --accent: rgb(var(--theme));
  --accent2: rgb(var(--theme-lite));
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { height: 100%; }
/* min-height, not height: a sticky header can't leave its containing block, so a body capped at one
   screen pushed the top bar and tabs off screen once the page scrolled past it */
body {
  margin: 0; min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  background: var(--bg); color: var(--text);
  overscroll-behavior-y: contain;
}
/* artwork-coloured glow behind the top of every page */
body::before {
  content: ""; position: fixed; inset: 0 0 auto; height: 70vh; z-index: -1; pointer-events: none;
  background: radial-gradient(130% 75% at 50% -12%, rgba(var(--theme), .2), transparent 65%);
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.hidden { display: none !important; }

/* top bar */
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 10px;
  padding: calc(10px + var(--safe-t)) 14px 10px;
  background: rgba(11, 11, 12, .72);
  backdrop-filter: blur(22px) saturate(1.2); -webkit-backdrop-filter: blur(22px) saturate(1.2);
}
.brand-mark { width: 30px; height: 30px; }
.brand { font-weight: 900; font-size: 19px; letter-spacing: .2px; margin-right: 2px; }
.search { flex: 1; }
.search input {
  width: 100%; padding: 10px 14px 10px 38px; border-radius: 12px;
  border: 1px solid var(--line-soft); color: var(--text); font-size: 16px; outline: none;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23a6a6ad'%3E%3Cpath d='M10 3a7 7 0 0 1 5.6 11.2l4.6 4.6-1.4 1.4-4.6-4.6A7 7 0 1 1 10 3zm0 2a5 5 0 1 0 0 10 5 5 0 0 0 0-10z'/%3E%3C/svg%3E") no-repeat 12px center / 18px,
    var(--bg2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
}
.search input:focus { border-color: rgba(var(--theme), .7); }

.tabs, .chip-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar, .chip-row::-webkit-scrollbar, .shelf-rows::-webkit-scrollbar, .shelf-cards::-webkit-scrollbar { display: none; }
.tabs {
  padding: 2px 14px 10px; position: sticky; top: calc(58px + var(--safe-t)); z-index: 4;
  background: rgba(11, 11, 12, .72);
  backdrop-filter: blur(22px) saturate(1.2); -webkit-backdrop-filter: blur(22px) saturate(1.2);
}
.chip-row { padding: 4px 8px 14px; }
.tabs button, .chip {
  flex: none; min-height: 34px; padding: 0 15px; border-radius: 17px; white-space: nowrap;
  border: 1px solid var(--line-soft); background: var(--bg2); color: var(--sub);
  font-size: 14px; font-weight: 750; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
}
.tabs button.on, .chip.on {
  color: #101010; border-color: transparent;
  background: linear-gradient(180deg, #ffffff, #e0e0e5);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
}

/* page heading (home, collections) */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 14px 8px 12px; }
.eyebrow { color: var(--accent); font-size: 12px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.page-head h1 { margin: 4px 0 4px; font-size: 32px; font-weight: 850; line-height: 1.08; }
.page-head p { margin: 0; color: var(--sub); font-size: 14px; }
.ghost-btn {
  flex: none; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line-soft);
  background: var(--bg2); color: var(--text); font-size: 13px; font-weight: 750;
}

/* list */
.list { padding: 4px 8px calc(96px + var(--safe-b)); }
.row { display: flex; align-items: center; gap: 12px; padding: 6px 8px; border-radius: 8px; border: 1px solid transparent; }
.row:active { background: var(--card-2); }
.row.playing { background: var(--card-2); border-color: var(--line-soft); }
.row.playing .t1 { color: var(--accent2); }
.row img { width: 48px; height: 48px; border-radius: 6px; object-fit: cover; background: linear-gradient(135deg, #303037, #18181d); flex: none; }
.row .meta { flex: 1; min-width: 0; }
.t1 { font-size: 15px; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t2 { font-size: 13px; color: var(--sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 3px; }
.row .dur { font-size: 12px; color: var(--subtle); font-variant-numeric: tabular-nums; }
.row .more { width: 34px; height: 34px; border-radius: 50%; color: var(--sub); font-size: 18px; flex: none; }
.section-title { padding: 10px 8px 4px; color: var(--sub); font-size: 13px; display: flex; justify-content: space-between; }
.section-title button { color: var(--accent); font-size: 13px; }
.empty { text-align: center; color: var(--sub); padding-top: 12vh; }
.empty img { width: 96px; height: 96px; border-radius: 22px; box-shadow: 0 8px 30px rgba(var(--theme), .3); }
.empty p { color: var(--text); font-size: 18px; letter-spacing: 3px; margin: 18px 0 6px; }
.empty .ghost-btn { margin-top: 14px; }
.more-results { display: flex; justify-content: center; padding: 12px 0 20px; }
.more-results button { padding: 8px 18px; border-radius: 18px; background: var(--bg2); border: 1px solid var(--line-soft); color: var(--sub); font-size: 14px; }
.spinner { width: 28px; height: 28px; margin: 30px auto; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* home shelves */
.shelf { margin: 6px 0 22px; }
.shelf-head { padding: 0 8px 8px; }
.shelf-head small { display: block; color: var(--sub); font-size: 12px; font-weight: 700; margin-bottom: 2px; }
.shelf-head h2 { margin: 0; font-size: 21px; font-weight: 850; line-height: 1.2; }
.shelf-rows, .shelf-cards { display: grid; grid-auto-flow: column; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.shelf-rows { grid-auto-columns: 86%; column-gap: 6px; }
.shelf-rows .row, .shelf-cards .card { scroll-snap-align: start; }
.shelf-cards { grid-auto-columns: 41%; gap: 10px; padding: 0 8px 2px; scroll-padding: 0 8px; }
.card {
  display: flex; flex-direction: column; min-width: 0; padding: 8px; text-align: left;
  border-radius: 8px; border: 1px solid transparent; background: var(--card); color: var(--text);
}
.card:active, .card.playing { background: var(--card-2); border-color: var(--line-soft); }
.card img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; background: linear-gradient(135deg, #303037, #18181d); }
.card .ct, .card .cs { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.card .ct { margin-top: 8px; font-size: 14px; font-weight: 800; line-height: 1.3; }
.card.playing .ct { color: var(--accent2); }
.card .cs { margin-top: 4px; font-size: 12px; line-height: 1.35; color: var(--sub); }

.row img.round, .card img.round { border-radius: 50%; }

/* friends (owner only) */
.avatar { width: 48px; height: 48px; flex: none; border-radius: 50%; display: grid; place-items: center; background: rgba(var(--theme), .2); color: var(--accent2); font-size: 20px; font-weight: 800; }
.note { margin: 0; padding: 16px 8px; color: var(--subtle); font-size: 12px; line-height: 1.6; }
.sheet .link-text { margin-top: 6px; color: var(--accent2); font-size: 13px; word-break: break-all; user-select: all; -webkit-user-select: all; }
.row .chev { color: var(--sub); font-size: 22px; padding: 0 6px; }

/* artist page: wide photo with the name over it, bio, top songs, shelves */
.artist-hero {
  position: relative; min-height: 210px; margin: -4px -8px 4px; padding: 6px 14px 16px;
  display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(135deg, rgba(var(--theme), .35), #18181d) center / cover;
}
.artist-hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11, 11, 12, .2), rgba(11, 11, 12, .1) 40%, rgba(11, 11, 12, .92)); }
.artist-hero > * { position: relative; }
.artist-hero .back { align-self: flex-start; color: #fff; text-shadow: 0 1px 8px rgba(0, 0, 0, .6); }
.artist-name h1 { margin: 2px 0 4px; font-size: 32px; font-weight: 850; line-height: 1.1; text-shadow: 0 2px 16px rgba(0, 0, 0, .5); }
.artist-name .t2 { color: rgba(245, 245, 246, .8); }
.artist-bio { margin: 6px 8px 0; color: var(--sub); font-size: 14px; line-height: 1.6; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; cursor: pointer; }
.artist-bio.open { -webkit-line-clamp: unset; display: block; }
.artist-hero + .pl-actions, .artist-bio + .pl-actions { padding-left: 8px; }
.more-btn { display: block; margin: 8px auto 0; }

/* collection page (a playlist / album opened from home, search or an artist) */
.col-head { padding: 4px 6px 0; }
.col-top { display: flex; gap: 14px; align-items: flex-end; margin: 6px 0 4px; }
.col-cover { width: 132px; height: 132px; flex: none; border-radius: 8px; object-fit: cover; background: linear-gradient(135deg, #303037, #18181d); box-shadow: 0 14px 34px rgba(0, 0, 0, .45); }
.col-cover.round { border-radius: 50%; }
.col-meta { min-width: 0; }
.col-title { font-size: 22px; font-weight: 850; line-height: 1.2; margin: 4px 0 2px; word-break: break-word; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.t2.wrap { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }

/* action sheet */
.sheet-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 40; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; background: #18181b; border-top: 1px solid var(--line-soft); border-radius: 16px 16px 0 0; padding: 10px 0 calc(10px + var(--safe-b)); }
.sheet button { display: block; width: 100%; text-align: left; padding: 14px 22px; font-size: 16px; }
.sheet .sheet-title { padding: 8px 22px 10px; color: var(--sub); font-size: 13px; border-bottom: 1px solid var(--line-soft); }

/* mini player */
.mini {
  position: fixed; left: 8px; right: 8px; bottom: calc(8px + var(--safe-b)); z-index: 10;
  background: rgba(24, 24, 27, .9); border: 1px solid var(--line-soft);
  backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2);
  border-radius: 12px; overflow: hidden; box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
}
.mini-progress { height: 2px; background: rgba(255, 255, 255, .1); }
#miniBar { height: 100%; width: 0; background: var(--accent); }
.mini-row { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 10px; }
.mini-row img { width: 42px; height: 42px; border-radius: 6px; object-fit: cover; background: var(--card); }
.mini-meta { flex: 1; min-width: 0; }
#miniPlay { width: 40px; height: 40px; background: var(--accent); color: var(--on-accent); }
#miniPlay svg { width: 22px; height: 22px; }

.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; }
.icon-btn svg { width: 26px; height: 26px; fill: currentColor; }
.icon-btn.sm svg { width: 22px; height: 22px; }
.icon-btn.off { opacity: .45; }
.icon-btn.liked { color: var(--accent); }

/* full player */
.full {
  position: fixed; inset: 0; z-index: 20; transform: translateY(100%);
  transition: transform .32s cubic-bezier(.2, .8, .2, 1); background: var(--bg);
  overflow: hidden; overflow: clip; /* clip: not even scrollIntoView may shift the player sideways */
}
.full.open { transform: translateY(0); }
.full-bg { position: absolute; inset: -40px; background-size: cover; background-position: center; filter: blur(44px) brightness(.4) saturate(1.2); opacity: .9; }
.full-inner {
  position: relative; height: 100%; display: flex; flex-direction: column; padding: calc(8px + var(--safe-t)) 22px calc(18px + var(--safe-b));
  background: linear-gradient(180deg, rgba(var(--theme), .16), transparent 42%, rgba(11, 11, 12, .55));
}
.full-head { display: flex; align-items: center; justify-content: space-between; }
.seg { display: flex; background: rgba(255, 255, 255, .1); border-radius: 18px; padding: 3px; }
.seg button { padding: 6px 16px; border-radius: 15px; font-size: 14px; font-weight: 700; color: var(--sub); }
.seg button.on { background: rgba(255, 255, 255, .18); color: var(--text); }

.views { flex: 1; min-height: 0; position: relative; margin: 10px 0; }
.views > div { position: absolute; inset: 0; display: none; }
.views > div.on { display: flex; }
/* the cover takes whatever height is left (cqh = 1% of this view), so on short screens it shrinks
   instead of spilling over the header or the title */
.view-cover { flex-direction: column; align-items: center; justify-content: center; gap: 18px; container-type: size; }
.view-cover img { width: min(78vw, 380px, 100cqh - 96px); aspect-ratio: 1; border-radius: 12px; object-fit: cover; box-shadow: 0 18px 50px rgba(0, 0, 0, .55), 0 0 60px rgba(var(--theme), .18); background: var(--card); }
.mini-lyric { min-height: 48px; text-align: center; font-size: 17px; font-weight: 700; color: var(--accent2); padding: 0 10px; }
.mini-lyric small { display: block; font-weight: 500; color: var(--sub); font-size: 14px; margin-top: 4px; }

.view-lyrics { flex-direction: column; }
.lyrics { flex: 1; overflow-y: auto; padding: 35% 4px 45%; scroll-behavior: smooth; -webkit-mask-image: linear-gradient(transparent, #000 15%, #000 80%, transparent); mask-image: linear-gradient(transparent, #000 15%, #000 80%, transparent); }
.ly { padding: 9px 2px; font-size: 21px; font-weight: 800; line-height: 1.35; color: rgba(245, 245, 246, .3); transition: color .25s, transform .25s; transform-origin: left center; cursor: pointer; }
.ly .tr { display: block; font-size: 15px; font-weight: 600; margin-top: 3px; }
.ly.on { color: var(--accent2); transform: scale(1.04); text-shadow: 0 0 22px rgba(var(--theme), .35); }
.ly.on .tr { color: var(--text); }
/* karaoke: app.js sets --p (0–100%) on each word of the current line as it is sung */
.ly.on.kara .w {
  color: transparent; -webkit-background-clip: text; background-clip: text;
  background-image: linear-gradient(90deg, var(--accent2) var(--p, 0%), rgba(245, 245, 246, .42) var(--p, 0%));
}
.ly-plain { white-space: pre-wrap; font-size: 17px; line-height: 1.8; color: var(--text); }
.ly-none { color: var(--sub); text-align: center; padding-top: 30%; }
/* wraps rather than overflowing: a centred row wider than the screen cuts off both ends */
.lyric-tools { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; padding-top: 6px; font-size: 13px; color: var(--sub); }
.lyric-tools button { padding: 5px 9px; border-radius: 14px; background: rgba(255, 255, 255, .1); color: var(--text); font-size: 13px; white-space: nowrap; }
.lyric-tools button.on { background: var(--accent); color: var(--on-accent); }
.lyric-tools .ly-source { min-width: 0; max-width: 28vw; overflow: hidden; text-overflow: ellipsis; color: var(--accent2); }
.lyric-tools .icon-btn { width: 32px; height: 32px; padding: 0; background: rgba(255, 255, 255, .1); }
.lyric-tools .icon-btn svg { width: 18px; height: 18px; }
.sheet button small.block { float: none; display: block; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* full-screen lyrics: header, cover and title make room for bigger lyrics */
.focus-bar { display: none; align-items: center; gap: 10px; padding: 4px 0 2px; }
.focus-bar img { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; background: var(--card); }
.focus-bar .meta { flex: 1; min-width: 0; }
.full.focus .focus-bar { display: flex; }
.full.focus .full-head, .full.focus .full-meta, .full.focus .modes, .full.focus .status { display: none; }
.full.focus .ly { font-size: 27px; padding: 12px 2px; }
.full.focus .ly .tr { font-size: 17px; }
.full.focus .lyrics { padding-top: 28%; }

.full-meta { margin-top: 4px; }
.full-meta .t1 { font-size: 22px; font-weight: 850; }
.full-meta .t2 { font-size: 15px; }
#fullArtist { cursor: pointer; }
#fullArtist::after { content: " ›"; color: var(--subtle); }
.seekwrap { margin-top: 14px; }
#seek { width: 100%; -webkit-appearance: none; appearance: none; height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--accent) var(--p, 0%), rgba(255, 255, 255, .18) var(--p, 0%)); outline: none; }
#seek::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(var(--theme), .25); }
#seek::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 0; }
.times { display: flex; justify-content: space-between; font-size: 12px; color: var(--sub); margin-top: 6px; font-variant-numeric: tabular-nums; }
.controls { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.controls .icon-btn svg { width: 32px; height: 32px; }
.controls .icon-btn.skip svg { width: 30px; height: 30px; }
/* shuffle / repeat as labelled toggles, lit in the accent colour when on */
.modes { display: flex; justify-content: center; gap: 10px; margin-top: 14px; }
.mode {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 18px;
  border: 1px solid var(--line-soft); background: rgba(255, 255, 255, .07); color: var(--sub); font-size: 13px; font-weight: 700;
}
.mode svg { width: 18px; height: 18px; fill: currentColor; }
.mode.on { color: var(--accent2); background: rgba(var(--theme), .16); border-color: rgba(var(--theme), .45); }
.play-btn { width: 72px; height: 72px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; box-shadow: 0 12px 32px rgba(var(--theme), .35); }
.play-btn svg { width: 34px; height: 34px; fill: currentColor; }
.status { min-height: 18px; text-align: center; font-size: 12px; color: var(--sub); margin-top: 8px; }

/* playlists */
.head-right { display: flex; align-items: center; }
.pl-actions { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 2px 12px; }
.pl-actions button { padding: 8px 14px; border-radius: 18px; background: var(--bg2); border: 1px solid var(--line-soft); font-size: 14px; font-weight: 700; }
.pl-actions button.primary { background: var(--accent); border-color: transparent; color: var(--on-accent); box-shadow: 0 8px 22px rgba(var(--theme), .25); }
.pl-head { padding: 4px 6px 0; }
.link { color: var(--accent); font-size: 14px; font-weight: 700; padding: 6px 0; }
.pl-title { font-size: 22px; font-weight: 850; margin: 4px 0 2px; word-break: break-word; }
.pl-row .chev { color: var(--sub); font-size: 22px; padding: 0 6px; }
.row.edit { gap: 8px; }
.mini-btn { width: 36px; height: 36px; border-radius: 50%; background: var(--bg2); font-size: 16px; flex: none; }
.mini-btn:disabled { opacity: .3; }
.mini-btn.danger { color: #ff7a8a; }
.sheet button small { float: right; color: var(--sub); font-size: 13px; }
.sheet button.accent { color: var(--accent2); font-weight: 700; }
.sheet button.danger { color: #ff7a8a; }
.sheet-scroll { max-height: 55vh; overflow-y: auto; }

.toast { position: fixed; left: 50%; bottom: calc(110px + var(--safe-b)); transform: translateX(-50%) translateY(20px); background: rgba(36, 36, 42, .97); border: 1px solid var(--line-soft); color: var(--text); padding: 10px 18px; border-radius: 20px; font-size: 14px; opacity: 0; pointer-events: none; transition: .25s; z-index: 50; max-width: 86vw; text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (min-width: 900px) {
  .list { max-width: 820px; margin: 0 auto; }
  .tabs { justify-content: center; }
  .mini { max-width: 820px; margin: 0 auto; }
  .shelf-rows { grid-auto-columns: 48%; }
  .shelf-cards { grid-auto-columns: 180px; }
}
