/* ViberMusic web app - brand #730094, light type, real icons */
:root {
  --bg: #0f0b14;
  --panel: #171121;
  --panel-2: #1f1730;
  --line: #2c2339;
  --text: #f3eef7;
  --mut: #a99dba;
  --brand: #730094;
  --brand-hi: #c874e6;
  --on-brand: #fff;
  --hover: rgba(255, 255, 255, .06);
  --shadow: 0 18px 50px rgba(0, 0, 0, .45);
  --radius: 14px;
  --sidebar: 244px;
  --player-h: 88px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #faf7fc;
  --panel: #ffffff;
  --panel-2: #f3edf8;
  --line: #e7dcef;
  --text: #1d1426;
  --mut: #6f6380;
  --brand-hi: #730094;
  --hover: rgba(115, 0, 148, .07);
  --shadow: 0 18px 50px rgba(60, 20, 80, .16);
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #faf7fc;
    --panel: #ffffff;
    --panel-2: #f3edf8;
    --line: #e7dcef;
    --text: #1d1426;
    --mut: #6f6380;
    --brand-hi: #730094;
    --hover: rgba(115, 0, 148, .07);
    --shadow: 0 18px 50px rgba(60, 20, 80, .16);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 300 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
#app { height: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3 { font-weight: 300; margin: 0; letter-spacing: -.01em; }
svg.i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
svg.i.fill { fill: currentColor; stroke: none; }
:focus-visible { outline: 2px solid var(--brand-hi); outline-offset: 2px; border-radius: 6px; }

/* ---------- shell ---------- */
.shell {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) var(--player-h);
  height: 100%;
}
.sidebar {
  grid-row: 1 / 2;
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 22px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 10px 22px; }
.brand img { width: 38px; height: 38px; border-radius: 10px; }
.brand b { font-weight: 300; font-size: 21px; letter-spacing: -.01em; }
.nav a, .nav button {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 10px 12px; border-radius: 10px; color: var(--mut); font-weight: 400;
}
.nav a:hover, .nav button:hover { background: var(--hover); color: var(--text); }
.nav a.on { background: var(--brand); color: var(--on-brand); }
.nav .sec { margin: 18px 12px 6px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--mut); font-weight: 400; }
.sidebar .foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; padding-top: 14px; border-top: 1px solid var(--line); }

.main { grid-column: 2; grid-row: 1; overflow-y: auto; position: relative; scroll-behavior: smooth; }
.topbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px;
  padding: 14px 32px; background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.search { flex: 1; max-width: 520px; display: flex; align-items: center; gap: 10px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 0 16px; height: 44px; color: var(--mut); }
.search:focus-within { border-color: var(--brand-hi); color: var(--text); }
.search input { flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: 0; color: var(--text); font: inherit; }
.search input::placeholder { color: var(--mut); }
.who { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 400; text-transform: uppercase; }
.page { padding: 8px 32px 40px; max-width: 1320px; }
.page-head { display: flex; align-items: flex-end; gap: 24px; padding: 14px 0 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 34px; }
.sub { color: var(--mut); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px; height: 42px; padding: 0 20px; border-radius: 999px;
  background: var(--brand); color: var(--on-brand); font-weight: 400; transition: transform .12s, filter .12s;
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: scale(.97); }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--hover); }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--mut); }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn.on { color: var(--brand-hi); }
.icon-btn.heart.on svg { fill: var(--brand-hi); }

/* ---------- covers ---------- */
.cov { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; background: var(--panel-2); display: block; }
.cov.ph { display: grid; place-items: center; color: rgba(255, 255, 255, .85);
  background: linear-gradient(140deg, hsl(var(--h, 285) 70% 36%), hsl(calc(var(--h, 285) + 28) 75% 22%)); }
.cov.ph svg { width: 34%; height: 34%; stroke-width: 1.3; }
.cov.sm { width: 44px; border-radius: 8px; }
.cov.round { border-radius: 50%; }

/* ---------- shelves + grids ---------- */
.shelf { margin: 8px 0 30px; }
.shelf-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.shelf-head h2 { font-size: 22px; }
.shelf-head a { color: var(--mut); font-size: 13px; }
.shelf-head a:hover { color: var(--text); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 22px 18px; }
.card { display: block; padding: 12px; border-radius: var(--radius); background: transparent; transition: background .15s; position: relative; }
.card:hover { background: var(--panel); }
.card .t { margin-top: 12px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .s { color: var(--mut); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .go { position: absolute; right: 22px; top: calc(12px + 100% * 0); transform: translateY(0); }
.card .play-fab {
  position: absolute; right: 20px; bottom: 74px; width: 46px; height: 46px; border-radius: 50%;
  background: var(--brand); color: #fff; display: grid; place-items: center; opacity: 0; transform: translateY(8px);
  transition: opacity .15s, transform .15s; box-shadow: var(--shadow);
}
.card:hover .play-fab, .card:focus-within .play-fab { opacity: 1; transform: none; }
.card.artist .cov { border-radius: 50%; }
.card.artist .t, .card.artist .s { text-align: center; }

.hero {
  display: grid; grid-template-columns: 220px 1fr; gap: 28px; align-items: end; padding: 18px 0 8px;
}
.hero .cov { border-radius: 16px; box-shadow: var(--shadow); }
.hero h1 { font-size: 46px; line-height: 1.1; margin: 6px 0 10px; }
.hero .kind { text-transform: uppercase; letter-spacing: .14em; font-size: 11px; color: var(--brand-hi); font-weight: 400; }
.actions { display: flex; gap: 10px; margin: 16px 0 6px; flex-wrap: wrap; align-items: center; }

/* ---------- song list ---------- */
.songs { width: 100%; margin-top: 6px; }
.row {
  display: grid; grid-template-columns: 40px minmax(0, 4fr) minmax(0, 3fr) 40px 56px; gap: 12px; align-items: center;
  padding: 7px 10px; border-radius: 10px; cursor: default;
}
.row.head { color: var(--mut); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; border-bottom: 1px solid var(--line); border-radius: 0; margin-bottom: 4px; cursor: default; }
.row:not(.head):hover { background: var(--hover); }
.row .n { color: var(--mut); text-align: center; font-variant-numeric: tabular-nums; }
.row .playbtn { display: none; }
.row:hover .n span, .row.now .n span { display: none; }
.row:hover .playbtn { display: grid; place-items: center; }
.row .ti { display: flex; align-items: center; gap: 12px; min-width: 0; }
.row .ti .meta { min-width: 0; }
.row .ti .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 400; }
.row .ti .by { color: var(--mut); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .al { color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row a:hover { text-decoration: underline; }
.row .tm { color: var(--mut); text-align: right; font-variant-numeric: tabular-nums; }
.row.now .name { color: var(--brand-hi); }
.row.now .n { color: var(--brand-hi); }
.row .fav { opacity: 0; }
.row:hover .fav, .row .fav.on { opacity: 1; }
.row .fav svg { width: 18px; height: 18px; }
.eq { display: none; gap: 2px; align-items: flex-end; height: 14px; justify-content: center; }
.row.now .eq { display: inline-flex; }
.row.now:hover .eq { display: none; }
.eq i { width: 3px; background: var(--brand-hi); border-radius: 2px; animation: eq 0.9s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: .2s; }
.eq i:nth-child(3) { animation-delay: .4s; }
.paused .eq i { animation-play-state: paused; }
@keyframes eq { 0%, 100% { height: 4px; } 50% { height: 14px; } }

/* ---------- states ---------- */
.empty { text-align: center; padding: 70px 20px; color: var(--mut); }
.empty .big { width: 72px; height: 72px; border-radius: 22px; background: var(--panel-2); display: grid; place-items: center; margin: 0 auto 18px; color: var(--brand-hi); }
.empty .big svg { width: 32px; height: 32px; }
.empty h2 { color: var(--text); margin-bottom: 8px; font-size: 24px; }
.skel { background: linear-gradient(90deg, var(--panel) 25%, var(--panel-2) 37%, var(--panel) 63%); background-size: 400% 100%; animation: sh 1.4s infinite; border-radius: 12px; }
@keyframes sh { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.more { display: flex; justify-content: center; margin: 24px 0; }
.err { color: #ff8aa0; }

/* ---------- player bar ---------- */
.player {
  grid-column: 1 / -1; grid-row: 2; background: var(--panel); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1fr); align-items: center; gap: 16px; padding: 0 20px;
  z-index: 20;
}
.np { display: flex; align-items: center; gap: 14px; min-width: 0; }
.np .cov { width: 56px; border-radius: 10px; flex: none; }
.np .meta { min-width: 0; }
.np .t { font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np .a { color: var(--mut); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np .a:hover { text-decoration: underline; }
.ctrl { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.ctrl .btns { display: flex; align-items: center; gap: 6px; }
.ctrl .play { width: 46px; height: 46px; border-radius: 50%; background: var(--text); color: var(--bg); display: grid; place-items: center; }
.ctrl .play:hover { transform: scale(1.06); }
.seek { width: 100%; max-width: 620px; display: flex; align-items: center; gap: 10px; color: var(--mut); font-size: 12px; font-variant-numeric: tabular-nums; }
.seek span { width: 38px; }
.seek span:first-child { text-align: right; }
.right { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
input[type=range] { -webkit-appearance: none; appearance: none; height: 18px; background: transparent; width: 100%; cursor: pointer; --p: 0%; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--brand-hi) var(--p), var(--line) var(--p)); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 4px; background: var(--line); }
input[type=range]::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--brand-hi); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; background: var(--text); margin-top: -4px; opacity: 0; transition: opacity .12s; }
input[type=range]:hover::-webkit-slider-thumb, input[type=range]:focus-visible::-webkit-slider-thumb { opacity: 1; }
input[type=range]::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: var(--text); }
.vol { width: 96px; }

/* ---------- queue drawer ---------- */
.drawer {
  position: fixed; top: 0; right: 0; bottom: var(--player-h); width: min(400px, 100%); background: var(--panel);
  border-left: 1px solid var(--line); z-index: 15; transform: translateX(100%); transition: transform .22s ease; display: flex; flex-direction: column;
  visibility: hidden;
}
.drawer.open { transform: none; visibility: visible; box-shadow: var(--shadow); }
.drawer header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 10px; }
.drawer header h2 { font-size: 20px; }
.drawer .list { overflow-y: auto; padding: 0 10px 20px; }
.drawer .row { grid-template-columns: 28px minmax(0, 1fr) 48px; }

/* ---------- sign in ---------- */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(900px 500px at 15% -10%, rgba(115, 0, 148, .55), transparent 60%), radial-gradient(700px 500px at 100% 110%, rgba(115, 0, 148, .35), transparent 60%), var(--bg); }
.login-card { width: min(400px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 34px 30px; box-shadow: var(--shadow); }
.login-card img { width: 64px; height: 64px; border-radius: 18px; display: block; margin: 0 auto 14px; }
.login-card h1 { text-align: center; font-size: 28px; }
.login-card p { text-align: center; color: var(--mut); margin: 6px 0 24px; }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--mut); margin-bottom: 6px; font-weight: 400; }
.field input { width: 100%; height: 46px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--text); padding: 0 14px; font: inherit; outline: 0; }
.field input:focus { border-color: var(--brand-hi); }
.login-card .btn { width: 100%; justify-content: center; height: 48px; margin-top: 6px; }
.login-card .err { min-height: 22px; text-align: center; margin-top: 12px; font-size: 14px; }

/* ---------- mobile ---------- */
.tabbar, .full { display: none; }
@media (max-width: 860px) {
  :root { --player-h: 64px; --tab-h: 58px; }
  body { font-size: 15px; }
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) var(--player-h) var(--tab-h); }
  .sidebar { display: none; }
  .main { grid-column: 1; }
  .topbar { padding: 10px 16px; }
  .who .name-btn { display: none; }
  .page { padding: 4px 16px 28px; }
  .page-head h1 { font-size: 28px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); gap: 16px 10px; }
  .card { padding: 8px; }
  .card .play-fab { display: none; }
  .hero { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .hero .cov { width: min(240px, 70vw); }
  .hero h1 { font-size: 32px; }
  .actions { justify-content: center; }
  .row { grid-template-columns: 30px minmax(0, 1fr) 40px 48px; }
  .row .al { display: none; }
  .row.head { display: none; }
  .row .fav { opacity: 1; }
  .player { grid-template-columns: minmax(0, 1fr) auto; padding: 0 10px; gap: 6px; border-top: 0; }
  .player .seek, .player .vol, .player .hide-m { display: none; }
  .np .cov { width: 46px; }
  .ctrl { flex-direction: row; }
  .ctrl .play { width: 42px; height: 42px; }
  .right { display: none; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); grid-row: 3; background: var(--panel); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; color: var(--mut); }
  .tabbar a.on { color: var(--brand-hi); }
  .drawer { bottom: calc(var(--player-h) + var(--tab-h)); width: 100%; z-index: 40; }
  .full {
    display: flex; flex-direction: column; position: fixed; inset: 0; z-index: 30; background: var(--bg);
    padding: calc(14px + env(safe-area-inset-top)) 24px calc(24px + env(safe-area-inset-bottom)); gap: 18px;
    transform: translateY(100%); transition: transform .26s ease;
    background-image: radial-gradient(600px 400px at 50% -10%, rgba(115, 0, 148, .5), transparent 70%);
  }
  .full.open { transform: none; }
  .full .bar { display: flex; justify-content: space-between; align-items: center; color: var(--mut); }
  .full .art { width: min(78vw, 360px); margin: 8px auto 0; }
  .full .art .cov { box-shadow: var(--shadow); border-radius: 18px; }
  .full .titles { text-align: center; }
  .full .titles .t { font-size: 22px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .full .titles .a { color: var(--mut); }
  .full .seek { max-width: none; }
  .full .btns { display: flex; justify-content: center; align-items: center; gap: 12px; }
  .full .btns .play { width: 64px; height: 64px; border-radius: 50%; background: var(--text); color: var(--bg); display: grid; place-items: center; }
  .full .btns .icon-btn { width: 48px; height: 48px; }
  .full .tools { display: flex; justify-content: center; gap: 28px; margin-top: auto; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
