/* ============================================================
   MONO — monochrome design system
   Palette: #090909 bg · #111111 secondary · #171717 cards ·
   #222222 hover · #292929 borders · #FFFFFF text ·
   #A0A0A0 secondary · #686868 muted
   ============================================================ */

:root {
  --bg: #090909;
  --bg-2: #111111;
  --card: #171717;
  --hover: #222222;
  --border: #292929;
  --text: #ffffff;
  --text-2: #a0a0a0;
  --text-3: #686868;
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar-w: 240px;
  --player-h: 84px;
  --mnav-h: 62px;
  --mini-h: 58px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  --ease: cubic-bezier(0.25, 0.8, 0.35, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

[hidden] { display: none !important; }

html { height: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100%;
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }
button { font-family: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85em; background: var(--bg-2); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; }

::selection { background: #3a3a3a; color: #fff; }

:focus-visible { outline: 2px solid #7a7a7a; outline-offset: 2px; border-radius: 4px; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2c2c2c; border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #3d3d3d; }

.noscript { padding: 40px; text-align: center; color: var(--text-2); }

/* ================= layout ================= */

#app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  height: 100vh;
  height: 100dvh;
}

.main {
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg);
  position: relative;
  padding-bottom: calc(var(--player-h) + 24px);
}

.view { max-width: 1180px; margin: 0 auto; padding: 28px 28px 0; animation: viewIn 0.28s var(--ease) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ================= sidebar ================= */

.sidebar {
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 14px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
}

.logo { display: flex; align-items: center; gap: 10px; padding: 6px 10px 18px; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: #fff; color: #000;
  display: grid; place-items: center;
  font-weight: 800; font-size: 17px; letter-spacing: -0.5px;
}
.logo-word { font-weight: 800; font-size: 19px; letter-spacing: 0.22em; }

.side-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.side-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 500; font-size: 14.5px;
  transition: background 0.16s, color 0.16s;
  border: 1px solid transparent;
}
.side-link:hover { background: var(--hover); color: var(--text); }
.side-link.active { background: var(--card); color: var(--text); border-color: var(--border); }
.side-link .ic { flex: 0 0 auto; }
.side-sep { height: 1px; background: var(--border); margin: 10px 8px; }

.side-foot { margin-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.free-note { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; }
.free-note-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.free-note p { font-size: 12px; color: var(--text-3); line-height: 1.5; }
.sc-credit { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-3); padding: 4px 8px; border-radius: 6px; transition: color 0.15s; }
.sc-credit:hover { color: var(--text-2); }
.ic16 { display: inline-flex; }

/* ================= hero / headers ================= */

.page-hero { padding: 26px 0 8px; }
.hero-kicker { font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--text-3); font-weight: 600; margin-bottom: 6px; }
.hero-title { font-size: clamp(26px, 4.5vw, 40px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.hero-sub { color: var(--text-2); font-size: clamp(13.5px, 1.6vw, 15px); margin-top: 10px; max-width: 640px; }

.pl-hero, .artist-hero { display: flex; gap: 24px; padding: 26px 0 10px; align-items: flex-end; flex-wrap: wrap; }
.pl-hero-art, .artist-hero-art {
  width: clamp(150px, 22vw, 220px); aspect-ratio: 1; object-fit: cover;
  border-radius: var(--radius); border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.pl-hero-meta, .artist-hero-meta { flex: 1; min-width: 240px; }

.pagebar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 16px 0 6px; }
.pagebar-meta { color: var(--text-3); font-size: 12.5px; margin-left: 6px; }

/* ================= buttons ================= */

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--card); color: var(--text);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 9px 18px; font-size: 13.5px; font-weight: 600;
  transition: background 0.16s, transform 0.12s, border-color 0.16s, color 0.16s;
  white-space: nowrap;
}
.btn:hover { background: var(--hover); }
.btn:active { transform: scale(0.97); }
.btn.primary { background: #fff; color: #000; border-color: #fff; }
.btn.primary:hover { background: #d9d9d9; }
.btn.primary:disabled, .btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--hover); }
.btn.sm { padding: 6px 13px; font-size: 12.5px; }
.btn.icon-only { padding: 8px; border-radius: 999px; }
.btn.icon-only .ic { display: block; }
.btn.danger { color: #fff; }
.row-danger:hover { background: #2b1010 !important; border-color: #552222 !important; }

.play-circle {
  width: 42px; height: 42px; border-radius: 999px;
  background: #fff; color: #000; border: none;
  display: grid; place-items: center; padding: 0;
  transition: transform 0.15s var(--ease), background 0.15s;
}
.play-circle:hover { transform: scale(1.06); background: #e8e8e8; }
.play-circle:active { transform: scale(0.95); }
.play-circle.big { width: 52px; height: 52px; }
.play-circle.xl { width: 64px; height: 64px; }
.play-circle.sm { width: 36px; height: 36px; }

.switch { width: 44px; height: 26px; border-radius: 999px; background: var(--card); border: 1px solid var(--border); position: relative; transition: background 0.18s; flex: 0 0 auto; }
.switch .knob { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 999px; background: var(--text-3); transition: transform 0.18s var(--ease), background 0.18s; }
.switch.on { background: #fff; border-color: #fff; }
.switch.on .knob { transform: translateX(18px); background: #000; }

.seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--border); border-radius: 999px; padding: 3px; }
.seg-btn { background: transparent; border: none; color: var(--text-2); padding: 6px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 600; transition: background 0.15s, color 0.15s; }
.seg-btn.active { background: #fff; color: #000; }

.input {
  width: 100%; background: var(--bg-2); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--radius-sm);
  padding: 11px 14px; font-size: 14px; font-family: inherit;
  transition: border-color 0.15s;
}
.input:focus { outline: none; border-color: #5a5a5a; }
.input::placeholder { color: var(--text-3); }

.range { -webkit-appearance: none; appearance: none; width: 180px; height: 4px; background: #2e2e2e; border-radius: 999px; outline: none; }
.range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 14px; height: 14px; border-radius: 999px; background: #fff; cursor: pointer; }
.range::-moz-range-thumb { width: 14px; height: 14px; border-radius: 999px; background: #fff; border: none; cursor: pointer; }
.range-val { color: var(--text-2); font-size: 12.5px; min-width: 38px; }

.tabs { display: flex; gap: 8px; padding: 10px 0 16px; flex-wrap: wrap; }
.tab { background: transparent; border: 1px solid var(--border); color: var(--text-2); border-radius: 999px; padding: 8px 16px; font-size: 13px; font-weight: 600; transition: all 0.15s; }
.tab:hover { background: var(--hover); color: var(--text); }
.tab.active { background: #fff; border-color: #fff; color: #000; }

.chip-row { display: flex; gap: 8px; flex-wrap: wrap; padding: 8px 0 16px; }
.chip { background: var(--card); border: 1px solid var(--border); color: var(--text-2); border-radius: 999px; padding: 7px 14px; font-size: 12.5px; font-weight: 500; transition: all 0.15s; }
.chip:hover { background: var(--hover); color: var(--text); }
.chip-hist { display: inline-flex; align-items: center; gap: 7px; }
.chip-x-btn { display: inline-flex; align-items: center; color: var(--text-3); border-radius: 999px; padding: 2px; }
.chip-x-btn:hover { color: #fff; background: var(--hover); }

/* ================= sections & rows ================= */

.sec { margin: 26px 0; }
.sec-wide .tlist, .sec-wide .empty { max-width: none; }
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.sec-title { font-size: 19px; font-weight: 750; letter-spacing: -0.01em; }
.sec-sub { color: var(--text-3); font-size: 12.5px; margin-top: 3px; }
.sec-head .btn { flex: 0 0 auto; }

.hrow-wrap { position: relative; }
.hrow {
  display: flex; gap: 16px;
  overflow-x: auto; overflow-y: visible;
  scroll-snap-type: x proximity;
  padding: 4px 2px 10px;
  margin: 0 -2px;
  scrollbar-width: none;
}
.hrow::-webkit-scrollbar { display: none; }
.hrow > * { scroll-snap-align: start; }

.hrow-arrow {
  position: absolute; top: 34%; transform: translateY(-50%);
  width: 34px; height: 34px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--border); color: var(--text);
  display: grid; place-items: center; z-index: 3;
  opacity: 0; transition: opacity 0.18s, background 0.15s;
  box-shadow: var(--shadow);
}
.hrow-wrap:hover .hrow-arrow { opacity: 1; }
.hrow-arrow:hover { background: var(--hover); }
.hrow-arrow.left { left: -6px; }
.hrow-arrow.right { right: -6px; }
.hrow-arrow .ic { display: block; }

.tcard {
  width: 168px; flex: 0 0 auto;
  background: transparent; border-radius: var(--radius);
  padding: 10px; position: relative;
  transition: background 0.16s;
  cursor: pointer;
}
.tcard:hover { background: var(--card); }
.tcard-art { position: relative; aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); background: var(--bg-2); }
.tcard-img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.35s var(--ease); }
.tcard:hover .tcard-img { transform: scale(1.05); }
.tcard-dur {
  position: absolute; right: 6px; bottom: 6px;
  background: rgba(0, 0, 0, 0.82); color: #ddd;
  font-size: 11px; font-weight: 600; padding: 3px 7px; border-radius: 6px;
}
.tcard-playbtn {
  position: absolute; right: 8px; bottom: 8px;
  width: 40px; height: 40px; border-radius: 999px;
  background: #fff; color: #000;
  display: grid; place-items: center;
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s var(--ease);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}
.tcard:hover .tcard-playbtn, .tcard:focus-visible .tcard-playbtn { opacity: 1; transform: none; }
.tcard-menu {
  position: absolute; top: 16px; right: 16px;
  background: rgba(0, 0, 0, 0.85); color: #ccc;
  width: 28px; height: 28px; border-radius: 999px; border: none;
  display: grid; place-items: center;
  opacity: 0; transition: opacity 0.18s, color 0.15s;
}
.tcard:hover .tcard-menu { opacity: 1; }
.tcard-menu:hover { color: #fff; }
.tcard-title { font-size: 13.5px; font-weight: 600; margin-top: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tcard-artist { font-size: 12.5px; color: var(--text-2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.art-fallback { width: 100%; height: 100%; display: grid; place-items: center; color: var(--text-3); background: linear-gradient(135deg, #1c1c1c, #101010); }

.acard { width: 168px; flex: 0 0 auto; padding: 10px; border-radius: var(--radius); text-align: center; cursor: pointer; transition: background 0.16s; }
.acard:hover { background: var(--card); }
.acard-img { width: 132px; height: 132px; object-fit: cover; border-radius: 999px; margin: 0 auto; display: block; border: 1px solid var(--border); background: var(--bg-2); }
.acard-name { font-size: 13.5px; font-weight: 600; margin-top: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acard-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }

.tlist { display: flex; flex-direction: column; gap: 2px; }
.trow {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px; border-radius: var(--radius-sm);
  cursor: pointer; transition: background 0.15s;
  min-width: 0;
}
.trow:hover { background: var(--card); }
.trow.current { background: var(--card); }
.trow.current .trow-title { color: #fff; }
.trow-idx { width: 22px; color: var(--text-3); font-size: 12.5px; font-variant-numeric: tabular-nums; flex: 0 0 auto; text-align: right; }
.trow-art { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; border: 1px solid var(--border); flex: 0 0 auto; background: var(--bg-2); }
.trow-meta { flex: 1; min-width: 0; }
.trow-title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trow-artist { font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.trow-plays { color: var(--text-3); font-size: 12px; font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.trow-unverified { font-size: 10px; border: 1px solid var(--border); color: var(--text-3); padding: 1px 6px; border-radius: 999px; vertical-align: middle; margin-left: 6px; }
.trow-actions { display: flex; gap: 2px; flex: 0 0 auto; opacity: 0; transition: opacity 0.15s; }
.trow:hover .trow-actions, .trow:focus-within .trow-actions { opacity: 1; }
.row-btn { width: 30px; height: 30px; }
.row-btn .ic { display: block; }

.like-btn.liked { color: #fff; }
.like-btn.liked .ic-heart, .like-btn.liked .ic { fill: #fff; }
.like-btn .ic { transition: fill 0.15s; }

/* card grid (playlists) */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; padding: 8px 0; }
.card-grid .tcard { width: auto; }

/* ================= player bar ================= */

.playerbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  height: var(--player-h);
  background: rgba(13, 13, 13, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(320px, 1.6fr) minmax(160px, 1fr);
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  transition: transform 0.3s var(--ease);
}

.pb-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pb-art { position: relative; width: 52px; height: 52px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); padding: 0; background: var(--bg-2); flex: 0 0 auto; }
.pb-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pb-art-chev { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,0.55); color: #fff; opacity: 0; transition: opacity 0.16s; }
.pb-art:hover .pb-art-chev { opacity: 1; }
.pb-meta { min-width: 0; }
.pb-title { font-size: 13.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-artist { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.pb-center { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.pb-controls { display: flex; align-items: center; gap: 6px; }
.pb-controls .btn { color: var(--text-2); }
.pb-controls .btn:hover { color: var(--text); }
.pb-controls .btn.active { color: #fff; }
.pb-controls .btn.active .ic { fill: #fff; }
.pb-progress { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 560px; }
.pb-progress.wide { max-width: 640px; }
.pb-time { font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; flex: 0 0 auto; min-width: 38px; text-align: center; }

.pb-right { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.pb-right .btn { color: var(--text-2); }
.pb-right .btn:hover { color: var(--text); }
.pb-lyr { display: inline-flex; }
.vol-wrap { display: flex; align-items: center; gap: 8px; color: var(--text-2); }

/* seekbars */
.seekbar { position: relative; height: 16px; display: flex; align-items: center; cursor: pointer; flex: 1; min-width: 60px; touch-action: none; }
.sb-track { position: relative; width: 100%; height: 4px; background: #2e2e2e; border-radius: 999px; overflow: visible; }
.sb-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0%; background: #fff; border-radius: 999px; transition: width 0.2s linear; }
.sb-thumb { position: absolute; top: 50%; left: 0%; width: 12px; height: 12px; border-radius: 999px; background: #fff; transform: translate(-50%, -50%) scale(0); transition: transform 0.15s var(--ease), left 0.2s linear; box-shadow: 0 1px 6px rgba(0,0,0,0.6); }
.seekbar:hover .sb-thumb, .seekbar:focus-visible .sb-thumb { transform: translate(-50%, -50%) scale(1); }
.seekbar.vol { flex: 0 0 90px; min-width: 60px; }
.seekbar.hairline { height: 3px; position: absolute; top: -3px; left: 0; right: 0; display: block; }
.seekbar.hairline .sb-track { height: 2px; border-radius: 0; }

/* ================= expanded player (desktop) ================= */

.player-expanded {
  position: fixed; left: 0; right: 0; bottom: var(--player-h); z-index: 55;
  height: min(72vh, 640px);
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  transform: translateY(102%);
  transition: transform 0.32s var(--ease);
  overflow: hidden;
}
.player-expanded.open { transform: none; }
.pe-inner { display: grid; grid-template-columns: minmax(280px, 1fr) 1.1fr; gap: 32px; height: 100%; padding: 30px clamp(24px, 5vw, 56px); }
.pe-left { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.pe-left > img { width: min(240px, 40vh); aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); }
.pe-meta { min-width: 0; }
.pe-title { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pe-artist { color: var(--text-2); margin-top: 4px; font-size: 14.5px; }
.pe-tags { color: var(--text-3); font-size: 12px; margin-top: 8px; }
.pe-actions { display: flex; gap: 10px; align-items: center; }
.pe-controls { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.pe-right { display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--border); padding-left: 32px; }
.pe-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 12px; }
.pe-head-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; }

/* ================= lyrics ================= */

.lyrics-box { flex: 1; overflow-y: auto; position: relative; padding: 10px 4px 40px; mask-image: linear-gradient(transparent, #000 8%, #000 92%, transparent); -webkit-mask-image: linear-gradient(transparent, #000 8%, #000 92%, transparent); }
.lyr-lines { display: flex; flex-direction: column; gap: 14px; }
.lyr-line {
  font-size: clamp(17px, 2.2vw, 22px); font-weight: 700; line-height: 1.4;
  color: var(--text-3); transition: color 0.25s, transform 0.25s var(--ease), opacity 0.25s;
  cursor: pointer; padding: 2px 6px; border-radius: 8px;
}
.lyr-line:hover { color: var(--text-2); }
.lyr-line.past { color: var(--text-3); opacity: 0.6; }
.lyr-line.current { color: #fff; transform: translateX(4px); }
.lyr-plain { white-space: pre-wrap; font-size: 15.5px; line-height: 1.8; color: var(--text-2); }
.lyr-note { color: var(--text-3); font-size: 12px; margin-top: 14px; }
.lyr-state { color: var(--text-2); font-size: 14.5px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; line-height: 1.6; }
.lyr-state .ic { color: var(--text-3); }
.lyr-sub { color: var(--text-3); font-size: 12.5px; }
.lyr-resume { position: sticky; bottom: 8px; align-self: center; background: var(--card); }
.lyrics-box .spinner { align-self: flex-start; }

.spinner { width: 16px; height: 16px; border-radius: 999px; border: 2px solid var(--border); border-top-color: var(--text-2); display: inline-block; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ================= queue drawer ================= */

.queue-drawer {
  position: fixed; top: 0; right: 0; bottom: var(--player-h); z-index: 58;
  width: min(400px, 92vw);
  background: var(--bg-2);
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  animation: drawerIn 0.26s var(--ease);
}
@keyframes drawerIn { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.qd-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 10px; }
.qd-title { font-weight: 800; font-size: 17px; letter-spacing: -0.01em; }
.qd-actions { display: flex; gap: 8px; }
.qd-context { color: var(--text-3); font-size: 12px; padding: 0 18px 8px; }
.qd-list { flex: 1; overflow-y: auto; padding: 4px 10px 20px; }
.qd-label { color: var(--text-3); font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; font-weight: 700; padding: 12px 8px 6px; }
.qrow { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: var(--radius-sm); cursor: pointer; transition: background 0.15s; min-width: 0; }
.qrow:hover { background: var(--card); }
.qrow.current { background: var(--card); }
.qrow-art { width: 40px; height: 40px; border-radius: 7px; object-fit: cover; border: 1px solid var(--border); flex: 0 0 auto; }
.qrow-idx { width: 20px; text-align: right; color: var(--text-3); font-size: 12px; flex: 0 0 auto; }
.qrow-meta { flex: 1; min-width: 0; }
.qrow-title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qrow-artist { font-size: 11.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qrow-time { color: var(--text-3); font-size: 11.5px; font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.qrow-actions { display: flex; flex: 0 0 auto; opacity: 0; transition: opacity 0.15s; }
.qrow:hover .qrow-actions { opacity: 1; }
.q-eq { color: #fff; flex: 0 0 auto; width: 20px; display: grid; place-items: center; }
.drawer-scrim { position: fixed; inset: 0 0 var(--player-h); background: rgba(0,0,0,0.5); z-index: 57; }

/* ================= mini player & mobile nav ================= */

.mini-player {
  position: fixed; left: 10px; right: 10px;
  bottom: calc(var(--mnav-h) + env(safe-area-inset-bottom, 0px) + 8px);
  height: var(--mini-h); z-index: 58;
  background: rgba(19, 19, 19, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border); border-radius: 14px;
  display: none; /* mobile only — desktop uses the full player bar */
  align-items: center; gap: 12px;
  padding: 0 10px 0 8px;
  box-shadow: var(--shadow);
  text-align: left;
  overflow: hidden;
}
#mp-artwork { width: 42px; height: 42px; border-radius: 9px; object-fit: cover; flex: 0 0 auto; }
.mp-meta { flex: 1; min-width: 0; }
.mp-title { font-size: 13px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-artist { font-size: 11.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#mp-play { flex: 0 0 auto; }

.mobile-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 59;
  height: calc(var(--mnav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(10, 10, 10, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  display: none;
  grid-template-columns: repeat(5, 1fr);
}
.mnav-link { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--text-3); font-size: 10px; font-weight: 600; transition: color 0.15s; padding: 6px 0; min-height: var(--mnav-h); }
.mnav-link:hover, .mnav-link.active { color: #fff; }
.mnav-link.active .mnav-ic { fill: #fff; }

/* ================= fullscreen now playing (mobile) ================= */

.np {
  position: fixed; inset: 0; z-index: 70;
  background: var(--bg);
  display: flex; flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.34s var(--ease);
  padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px);
}
.np.open { transform: none; }
body.np-lock { overflow: hidden; }
.np-top { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 4px; }
.np-context { color: var(--text-3); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; max-width: 60%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-body { flex: 1; display: flex; flex-direction: column; padding: 8px clamp(20px, 7vw, 44px) 18px; min-height: 0; overflow-y: auto; }
.np-art-wrap { display: grid; place-items: center; padding: 10px 0 18px; }
#np-artwork { width: min(78vw, 46vh, 420px); aspect-ratio: 1; object-fit: cover; border-radius: 16px; border: 1px solid var(--border); box-shadow: var(--shadow); }
.np-meta { text-align: center; min-width: 0; }
.np-title { font-size: clamp(20px, 5.6vw, 26px); font-weight: 800; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-artist { color: var(--text-2); font-size: clamp(14px, 3.8vw, 16px); margin-top: 5px; cursor: pointer; }
.np-progress { margin-top: 18px; }
.np-times { display: flex; justify-content: space-between; color: var(--text-3); font-size: 11.5px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.np-controls-main { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; padding: 0 6px; }
.np-controls-main .btn { color: var(--text-2); }
.np-controls-main .btn.active { color: #fff; }
.np-controls-main .btn.active .ic { fill: #fff; }
.np-controls-sec { display: flex; align-items: center; justify-content: space-around; margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--border); }
.np-controls-sec .btn { color: var(--text-2); }
.np-controls-sec .vol-wrap { flex: 1; max-width: 150px; padding: 0 10px; }
.np-controls-sec .seekbar.vol { flex: 1; }

.np-lyrics { position: absolute; inset: 0; background: var(--bg); display: flex; flex-direction: column; padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px); animation: lyrIn 0.28s var(--ease); z-index: 2; }
@keyframes lyrIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.np-lyrics-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 6px; }
.np-lyrics-title { font-weight: 700; font-size: 15px; }
.np-lyrics-spacer { width: 60px; }
.np-lyrics .lyrics-box { padding: 6px clamp(20px, 6vw, 40px) 40px; }
.np-lyrics .lyr-line { text-align: center; font-size: clamp(21px, 6.4vw, 30px); }
.np-lyrics .lyr-plain { text-align: center; font-size: clamp(15px, 4.4vw, 17px); }
.np-lyrics .lyr-state, .np-lyrics .lyr-resume { align-self: center; text-align: center; }

/* ================= search ================= */

.search-head { padding: 26px 0 8px; position: relative; }
.search-box { position: relative; display: flex; align-items: center; margin-top: 16px; max-width: 680px; }
.search-ic { position: absolute; left: 14px; color: var(--text-3); display: grid; place-items: center; pointer-events: none; }
.search-input {
  width: 100%; background: var(--bg-2); border: 1px solid var(--border);
  color: var(--text); border-radius: 999px; padding: 13px 46px;
  font-size: 15px; font-family: inherit;
}
.search-input:focus { outline: none; border-color: #5a5a5a; background: var(--card); }
.search-input::-webkit-search-cancel-button { display: none; }
.search-clear { position: absolute; right: 8px; }
.search-suggest {
  position: absolute; top: calc(100% - 4px); left: 0; right: 0; z-index: 30;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; max-width: 680px;
  animation: pop 0.16s var(--ease);
}
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.sug-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: none; color: var(--text); padding: 10px 14px; font-size: 13.5px; transition: background 0.13s; }
.sug-item:hover { background: var(--card); }
.sug-art { width: 30px; height: 30px; border-radius: 6px; object-fit: cover; border: 1px solid var(--border); }
.sug-kind { margin-left: auto; color: var(--text-3); font-size: 11.5px; }
.search-recent { margin-top: 14px; }
.search-recent-head { display: flex; align-items: center; justify-content: space-between; max-width: 680px; margin-bottom: 4px; color: var(--text-3); font-size: 12.5px; }

.notice {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px;
  color: var(--text-2); font-size: 13px; line-height: 1.55;
  margin: 12px 0;
}
.notice b { color: var(--text); }
.notice a { text-decoration: underline; }
.notice-ok { border-color: #2e2e2e; }
.notice .ic, .notice span[data-icon] { flex: 0 0 auto; margin-top: 1px; }

/* ================= settings ================= */

.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.setting-row:last-child { border-bottom: none; }
.setting-col { flex-direction: column; align-items: stretch; gap: 10px; }
.setting-label { font-size: 14px; font-weight: 600; }
.setting-control { display: flex; align-items: center; gap: 10px; }
.setting-help { color: var(--text-3); font-size: 12.5px; line-height: 1.6; }
.setting-btns { display: flex; gap: 8px; }
.about { color: var(--text-2); font-size: 13.5px; line-height: 1.7; padding: 6px 0; }
.about ul { margin: 10px 0 0 18px; display: flex; flex-direction: column; gap: 8px; }
.about b { color: var(--text); }

/* ================= modal / menu / toast ================= */

.modal-root { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.65); animation: fade 0.2s; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  position: relative; width: min(440px, 100%);
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: var(--shadow);
  animation: pop 0.2s var(--ease);
  max-height: 84vh; display: flex; flex-direction: column;
}
.modal-wide { width: min(560px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 8px; }
.modal-title { font-weight: 800; font-size: 16.5px; }
.modal-body { padding: 10px 18px; overflow-y: auto; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 10px 18px 16px; }
.confirm-desc { color: var(--text-2); font-size: 14px; line-height: 1.6; }
.mpl-list { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; max-height: 44vh; overflow-y: auto; }
.mpl-row { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; color: var(--text); font-size: 13.5px; text-align: left; transition: background 0.14s; }
.mpl-row:hover { background: var(--hover); }
.mpl-row.in { opacity: 0.55; }
.mpl-row:disabled { cursor: default; }
.mpl-count { margin-left: auto; color: var(--text-3); font-size: 12px; }
.mpl-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.mpl-artist { color: var(--text-2); font-size: 12px; flex: 0 1 auto; max-width: 40%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.menu-root { position: fixed; inset: 0; z-index: 85; }
.menu-scrim { position: absolute; inset: 0; }
.menu-sheet {
  position: absolute; min-width: 220px; max-width: 280px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow);
  padding: 6px; animation: pop 0.16s var(--ease);
  max-height: 70vh; overflow-y: auto;
}
.menu-item { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; background: none; border: none; color: var(--text); padding: 10px 12px; border-radius: 8px; font-size: 13.5px; transition: background 0.13s; }
.menu-item:hover { background: var(--card); }
.menu-item.danger { color: #ffb3b3; }
.menu-item .ic { color: var(--text-2); flex: 0 0 auto; }
.menu-sep { height: 1px; background: var(--border); margin: 5px 8px; }

.toast-root { position: fixed; bottom: calc(var(--player-h) + 14px); left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: 92vw; }
.toast {
  display: flex; align-items: center; gap: 10px;
  background: #1d1d1d; border: 1px solid var(--border);
  color: var(--text); border-radius: 999px;
  padding: 10px 18px; font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow);
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.25s, transform 0.25s var(--ease);
  max-width: 92vw;
}
.toast.show { opacity: 1; transform: none; }
.toast .ic { flex: 0 0 auto; }
.toast-error .ic { color: #ff9d9d; }
.toast-ok .ic { color: #cfcfcf; }
.toast-info .ic, .toast-warn .ic { color: var(--text-2); }

/* ================= empty / error / skeleton ================= */

.empty { text-align: center; padding: 46px 20px; color: var(--text-2); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty .ic { color: var(--text-3); }
.empty-title { font-weight: 750; font-size: 16.5px; color: var(--text); }
.empty-desc { font-size: 13px; color: var(--text-3); max-width: 420px; line-height: 1.6; }
.empty .btn { margin-top: 8px; }

.sk { background: linear-gradient(100deg, #161616 40%, #202020 50%, #161616 60%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.sk-art { width: 44px; height: 44px; border-radius: 8px; flex: 0 0 auto; }
.sk-line { height: 12px; margin: 6px 0; }
.w25 { width: 25%; } .w35 { width: 35%; } .w40 { width: 40%; } .w60 { width: 60%; }
.sk-row { display: flex; gap: 12px; align-items: center; padding: 8px 12px; }
.sk-row-lines { flex: 1; }
.sk-avatar { width: 160px; height: 160px; border-radius: 999px; }
.skeleton-hero { display: flex; gap: 24px; align-items: center; padding: 26px 0; }

/* ================= offline banner ================= */

.offline-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 95;
  background: #1d1d1d; border-bottom: 1px solid var(--border);
  color: var(--text-2); font-size: 12.5px;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px; justify-content: center;
}
.offline-dot { width: 8px; height: 8px; border-radius: 999px; background: #888; }

/* ================= responsive ================= */

@media (max-width: 1080px) {
  .view { padding: 22px 20px 0; }
  .pb-right .pb-lyr { display: none; }
}

@media (max-width: 900px) {
  #app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .mobile-nav { display: grid; }
  .playerbar { display: none; }
  .player-expanded { display: none; }
  .mini-player { display: flex; }
  .queue-drawer { bottom: 0; width: 100%; border-radius: 18px 18px 0 0; border: 1px solid var(--border); }
  .toast-root { bottom: calc(var(--mnav-h) + var(--mini-h) + 22px); }
  .view { padding: 18px 16px calc(var(--mnav-h) + var(--mini-h) + 40px); }
  .hrow-arrow { display: none; }
  .tcard { width: 148px; }
  .trow-actions { opacity: 1; }
  .tcard-playbtn { opacity: 1; transform: none; width: 34px; height: 34px; }
  .main { padding-bottom: 0; }
  .tcard-menu { opacity: 1; background: rgba(0,0,0,0.7); }
  .menu-sheet.bottom-sheet {
    left: 10px !important; right: 10px !important; top: auto !important; bottom: 12px;
    max-width: none; width: auto;
    border-radius: 16px; padding: 10px;
    animation: sheetIn 0.24s var(--ease);
  }
  @keyframes sheetIn { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
}

@media (max-width: 560px) {
  .tcard { width: 132px; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
  .pl-hero, .artist-hero { gap: 16px; }
}

/* iOS: volume sliders can't control the widget — hide to avoid dead controls */
body.ios .vol-wrap, body.ios #pb-vol { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
