/* Muse Shelf — dark, bold, streaming-platform energy. Vanilla CSS, no frameworks. */
:root {
  --bg: #0a0a0f;
  --bg2: #101016;
  --card: #16161e;
  --card-hover: #1e1e29;
  --border: #262633;
  --text: #f2f2f7;
  --muted: #9c9caf;
  --accent: #ff3b3b;
  --accent-deep: #a3121f;
  --amber: #ffb02e;
  --violet: #7c5cff;
  --glow-a: rgba(255,59,59,.10);
  --glow-b: rgba(124,92,255,.10);
  --radius: 14px;
  --shadow: 0 8px 32px rgba(0,0,0,.45);
}

/* ---- themes: same layout, different soul. :root IS "ember" (default). ---- */
html[data-theme="midnight"] {
  --bg: #060a13; --bg2: #0a101c; --card: #0e1524; --card-hover: #141d31;
  --border: #1e2a44; --text: #eef2fa; --muted: #8b98b3;
  --accent: #3b82f6; --accent-deep: #1d4ed8; --amber: #60a5fa; --violet: #818cf8;
  --glow-a: rgba(59,130,246,.12); --glow-b: rgba(129,140,248,.10);
}
html[data-theme="violet"] {
  --bg: #0c0714; --bg2: #120b1e; --card: #17102a; --card-hover: #1f1537;
  --border: #2c2050; --text: #f3eefa; --muted: #a79bc4;
  --accent: #8b5cf6; --accent-deep: #6d28d9; --amber: #c084fc; --violet: #a78bfa;
  --glow-a: rgba(139,92,246,.12); --glow-b: rgba(192,132,252,.08);
}
html[data-theme="forest"] {
  --bg: #071009; --bg2: #0b1610; --card: #0f1d15; --card-hover: #152819;
  --border: #1e3327; --text: #eef7ef; --muted: #8fa898;
  --accent: #22c55e; --accent-deep: #15803d; --amber: #a3e635; --violet: #34d399;
  --glow-a: rgba(34,197,94,.10); --glow-b: rgba(52,211,153,.08);
}
html[data-theme="bone"] {
  --bg: #f4f1e8; --bg2: #ece7d8; --card: #fffdf7; --card-hover: #f6f1e4;
  --border: #ddd5c0; --text: #1c1a14; --muted: #6f6a5c;
  --accent: #c2372b; --accent-deep: #8f241b; --amber: #b97f1f; --violet: #6d5bd0;
  --glow-a: rgba(194,55,43,.06); --glow-b: rgba(109,91,208,.05);
  --shadow: 0 8px 28px rgba(60,50,30,.12);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background:
    radial-gradient(1200px 500px at 15% -5%, var(--glow-a), transparent 60%),
    radial-gradient(1000px 500px at 90% 0%, var(--glow-b), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  padding-bottom: 120px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--amber); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: var(--accent); color: #fff; }

/* ---------- header ---------- */
header.top {
  display: flex; align-items: center; gap: 1.4rem;
  padding: .9rem 1.6rem;
  background: rgba(16,16,22,.85);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(12px);
}
.logo { font-size: 1.35rem; font-weight: 900; letter-spacing: 2px; text-transform: uppercase; }
.logo span {
  background: linear-gradient(90deg, var(--accent), var(--amber));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
nav.main { display: flex; gap: 1.2rem; margin-left: auto; }
nav.main a {
  color: var(--muted); font-weight: 700; font-size: .92rem;
  text-transform: uppercase; letter-spacing: 1px; padding: .3rem 0;
  border-bottom: 2px solid transparent;
}
nav.main a:hover { color: var(--text); text-decoration: none; }
nav.main a.active { color: var(--text); border-bottom-color: var(--accent); }

/* ---------- hero ---------- */
.hero {
  padding: 3.2rem 1.5rem 2.2rem;
  max-width: 1100px; margin: 0 auto;
}
.hero h1 {
  font-size: clamp(2.2rem, 6vw, 3.8rem);
  font-weight: 900; letter-spacing: -1px; line-height: 1.05;
}
.hero h1 .grad {
  background: linear-gradient(92deg, var(--accent) 10%, var(--amber) 60%, var(--violet) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { color: var(--muted); font-size: 1.05rem; margin-top: .7rem; max-width: 620px; }
.hero .stats { display: flex; gap: 1.6rem; margin-top: 1.2rem; }
.hero .stat b { font-size: 1.5rem; font-weight: 900; display: block; }
.hero .stat span { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: 1px; }

/* ---------- sections ---------- */
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }
section.block { margin-top: 2.2rem; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 1rem; }
.sec-head h2 { font-size: 1.35rem; font-weight: 800; letter-spacing: -.5px; margin: 0; }
.sec-head a { font-size: .85rem; font-weight: 700; }

/* ---------- artist strip (first-class artist browsing) ---------- */
.astrip {
  display: flex; gap: 1.1rem; overflow-x: auto; padding: .4rem .2rem 1rem;
  scroll-snap-type: x mandatory; scrollbar-width: thin;
}
.astrip::-webkit-scrollbar { height: 6px; }
.astrip::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.achip {
  flex: 0 0 auto; width: 108px; text-align: center; cursor: pointer;
  scroll-snap-align: start; border: none; background: none; color: var(--text);
  font: inherit; padding: 0;
}
.achip .ring {
  width: 92px; height: 92px; border-radius: 50%; margin: 0 auto .5rem;
  padding: 3px;
  background: linear-gradient(135deg, var(--accent), var(--amber), var(--violet));
  transition: transform .15s;
}
.achip:hover .ring { transform: scale(1.07); }
.achip .face {
  width: 100%; height: 100%; border-radius: 50%;
  background: var(--card);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; font-weight: 900; color: #fff;
  overflow: hidden;
}
.achip .face img { width: 100%; height: 100%; object-fit: cover; }
.achip .nm { font-weight: 700; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.achip .ct { color: var(--muted); font-size: .72rem; }

/* ---------- track grid ---------- */
.toolbar { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.toolbar input, .toolbar select {
  background: var(--card); border: 1px solid var(--border); color: var(--text);
  padding: .6rem .9rem; border-radius: 10px; font-size: .95rem;
}
.toolbar input { flex: 1; min-width: 180px; }
.toolbar input:focus, .toolbar select:focus { outline: none; border-color: var(--accent); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1.1rem; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; cursor: pointer; transition: transform .15s, box-shadow .15s, background .15s;
}
.card:hover { background: var(--card-hover); transform: translateY(-4px); box-shadow: var(--shadow); border-color: #3a3a4d; }
.cover {
  aspect-ratio: 1; position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #2b2b3d 0%, #17171f 70%);
  font-size: 2.6rem; color: #55556a;
}
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover .hoverplay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.45); opacity: 0; transition: opacity .15s;
}
.card:hover .hoverplay { opacity: 1; }
.hoverplay .big {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 1.3rem;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(255,59,59,.5);
}
.card .meta { padding: .75rem .85rem .85rem; }
.card .title { font-weight: 800; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .artist { color: var(--muted); font-size: .83rem; margin-top: .1rem; }
.card .artist:hover { color: var(--amber); }
.card .stats { color: var(--muted); font-size: .74rem; margin-top: .3rem; display: flex; gap: .5rem; align-items: center; }
.badge {
  display: inline-block; font-size: .68rem; font-weight: 700;
  background: rgba(255,176,46,.12); color: var(--amber);
  border: 1px solid rgba(255,176,46,.3);
  border-radius: 20px; padding: .1rem .55rem;
}

/* ---------- player bar ---------- */
#playerbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 100;
  background: rgba(14,14,20,.96); border-top: 1px solid var(--border);
  padding: .65rem 1rem; display: none; gap: .8rem; align-items: center;
  backdrop-filter: blur(14px); box-shadow: 0 -8px 32px rgba(0,0,0,.5);
}
#playerbar.show { display: flex; }
#playerbar .pthumb {
  width: 46px; height: 46px; border-radius: 8px; flex-shrink: 0;
  background: linear-gradient(135deg, #2b2b3d, #17171f);
  display: flex; align-items: center; justify-content: center; font-size: 1.3rem;
  overflow: hidden; color: #55556a;
}
#playerbar .pthumb img { width: 100%; height: 100%; object-fit: cover; }
#playerbar .pinfo { min-width: 0; flex: 1; max-width: 260px; }
#playerbar .ptitle { font-weight: 800; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#playerbar .partist { color: var(--muted); font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pbtn {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff; border: none; border-radius: 50%;
  width: 46px; height: 46px; font-size: 1.05rem; cursor: pointer; flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(255,59,59,.4); transition: transform .1s;
}
.pbtn:hover { transform: scale(1.06); }
.pbtn.ghost { background: transparent; color: var(--muted); font-size: 1rem; width: 38px; height: 38px; box-shadow: none; }
.pbtn.ghost:hover { color: var(--text); }
#seek { flex: 2; accent-color: var(--accent); min-width: 80px; cursor: pointer; }
#time { color: var(--muted); font-size: .75rem; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- forms ---------- */
form.sheet { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; max-width: 580px; box-shadow: var(--shadow); }
form.sheet label { display: block; margin: .95rem 0 .3rem; color: var(--muted); font-size: .83rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
form.sheet input, form.sheet textarea, form.sheet select {
  width: 100%; background: var(--bg); border: 1px solid var(--border); color: var(--text);
  padding: .65rem .85rem; border-radius: 10px; font-size: 1rem;
}
form.sheet input:focus, form.sheet textarea:focus { outline: none; border-color: var(--accent); }
form.sheet textarea { min-height: 90px; resize: vertical; }
.btn {
  display: inline-block; background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff; border: none; padding: .75rem 1.5rem; border-radius: 10px;
  font-size: 1rem; font-weight: 800; cursor: pointer; margin-top: 1.1rem;
  box-shadow: 0 4px 16px rgba(255,59,59,.35); transition: transform .1s;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn.ghostbtn { background: var(--card); border: 1px solid var(--border); box-shadow: none; color: var(--text); }
.notice { margin-top: 1rem; padding: .85rem 1rem; border-radius: 10px; font-size: .9rem; }
.notice.ok { background: rgba(46,160,67,.12); border: 1px solid #2a6b35; }
.notice.bad { background: rgba(255,59,59,.1); border: 1px solid #7a2a2a; }

/* ---------- docs ---------- */
pre.code {
  background: #08080c; border: 1px solid var(--border); border-radius: 10px;
  padding: 1rem 1.1rem; overflow-x: auto; font-size: .84rem; margin: .8rem 0; white-space: pre;
  line-height: 1.6;
}
pre.code .c { color: #6a6a80; }
h2 { margin: 1.8rem 0 .6rem; font-size: 1.25rem; font-weight: 800; letter-spacing: -.5px; }
.endpoint { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.2rem; margin: .9rem 0; }
.method { display: inline-block; font-weight: 800; font-size: .72rem; border-radius: 6px; padding: .2rem .55rem; margin-right: .55rem; letter-spacing: .5px; }
.method.get { background: rgba(125,184,245,.15); color: #7db8f5; }
.method.post { background: rgba(165,224,117,.13); color: #a5e075; }

/* ---------- artist page ---------- */
.artist-hero {
  position: relative; border-radius: 18px; overflow: hidden;
  padding: 2.4rem 2rem; margin-bottom: 1.6rem;
  background: linear-gradient(120deg, #231319 0%, #16161e 55%, #141a2b 100%);
  border: 1px solid var(--border);
}
.artist-hero::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(600px 200px at 20% 0%, rgba(255,59,59,.18), transparent 70%);
  pointer-events: none;
}
.artist-head { position: relative; display: flex; gap: 1.3rem; align-items: center; flex-wrap: wrap; }
.artist-head .avatar {
  width: 104px; height: 104px; border-radius: 50%; flex-shrink: 0;
  padding: 4px; background: linear-gradient(135deg, var(--accent), var(--amber), var(--violet));
}
.artist-head .avatar .in {
  width: 100%; height: 100%; border-radius: 50%; background: var(--card);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.4rem; font-weight: 900; color: #fff;
  overflow: hidden;
}
.artist-head .avatar .in img { width: 100%; height: 100%; object-fit: cover; }
.artist-head h1 { font-size: 2rem; font-weight: 900; letter-spacing: -1px; }
.artist-head .sub { color: var(--muted); margin: .25rem 0 .8rem; }
.trackrow {
  display: flex; align-items: center; gap: .95rem; padding: .75rem .9rem;
  border-radius: 10px; cursor: pointer; border: 1px solid transparent;
}
.trackrow:hover { background: var(--card); border-color: var(--border); }
.trackrow .n { color: var(--muted); width: 1.8rem; text-align: right; font-size: .85rem; font-variant-numeric: tabular-nums; }
.trackrow .t { flex: 1; min-width: 0; }
.trackrow .t .tt { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trackrow .t .gg { color: var(--muted); font-size: .78rem; }
.trackrow .pp { color: var(--muted); font-size: .78rem; white-space: nowrap; }
.trackrow .rowplay {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border);
  background: transparent; color: var(--text); cursor: pointer; font-size: .85rem; flex-shrink: 0;
}
.trackrow:hover .rowplay { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- favorites / hearts ---------- */
.favbtn {
  background: transparent; border: none; color: var(--muted);
  font-size: 1.05rem; cursor: pointer; padding: .25rem .4rem; border-radius: 8px;
  line-height: 1; transition: transform .1s, color .1s;
  flex-shrink: 0;
}
.favbtn:hover { color: var(--accent); transform: scale(1.2); }
.favbtn.on { color: var(--accent); }
.card .stats { gap: .55rem; }
.card .stats .likes { white-space: nowrap; }
.card .stats .favbtn { margin-left: auto; font-size: 1.15rem; }
.trackrow .favbtn { font-size: 1.2rem; }
#btn-fav.on { color: var(--accent); }

/* ---------- My Playlist page ---------- */
.plist-head {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  margin: 1.4rem 0 1.2rem;
}
.plist-head h1 { font-size: 1.8rem; font-weight: 900; letter-spacing: -1px; margin: 0; }
.plist-head .sub { color: var(--muted); margin: 0; flex-basis: 100%; }
.trackrow .mv {
  display: flex; gap: .25rem; flex-shrink: 0;
}
.trackrow .mv button {
  background: transparent; border: 1px solid var(--border); color: var(--muted);
  width: 30px; height: 30px; border-radius: 8px; cursor: pointer; font-size: .8rem;
}
.trackrow .mv button:hover { color: var(--text); border-color: var(--accent); }
.trackrow .mv button:disabled { opacity: .3; cursor: default; }
.plist-note {
  margin-top: 1.6rem; padding: .9rem 1.1rem; border-radius: 10px;
  background: rgba(124,92,255,.08); border: 1px solid rgba(124,92,255,.25);
  color: var(--muted); font-size: .85rem;
}

/* ---------- visualizer ---------- */
#vizwrap {
  position: fixed; left: 0; right: 0; bottom: 76px; z-index: 90;
  height: 168px; margin: 0 1rem;
  border-radius: var(--radius); overflow: hidden;
  background: rgba(10,10,16,.92);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  opacity: 0; transform: translateY(14px); pointer-events: none;
  transition: opacity .25s, transform .25s;
}
#vizwrap.show { opacity: 1; transform: none; pointer-events: auto; }
#vizcanvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.vizmodes {
  position: absolute; top: .5rem; right: .6rem;
  display: flex; gap: .3rem;
}
.vizmodes button {
  background: rgba(16,16,22,.8); border: 1px solid var(--border); color: var(--muted);
  font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  padding: .3rem .6rem; border-radius: 8px; cursor: pointer;
}
.vizmodes button:hover { color: var(--text); }
.vizmodes button.on {
  color: #fff; border-color: var(--accent);
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
}
#btn-viz.on { color: var(--accent); }

/* ============================================================
   ADAPTIVE LAYOUT — three modes set by layout.js on <html data-layout>:
   compact  = narrow portrait phones / fold cover screens
   expanded = square-ish: unfolded foldables, tablets (stacked)
   wide     = desktop / landscape (default styles above)
   ============================================================ */

/* chrome hidden unless its mode activates it */
#tabbar, #nowplaying, #nowpane { display: none; }

/* ---------- bottom tab bar (compact) ---------- */
#tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 120;
  background: rgba(14,14,20,.97); border-top: 1px solid var(--border);
  backdrop-filter: blur(12px);
  padding-bottom: env(safe-area-inset-bottom);
}
#tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: .55rem 0 .5rem; color: var(--muted); min-height: 60px;
  font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
}
#tabbar a:hover { text-decoration: none; color: var(--text); }
#tabbar a.active { color: var(--amber); }
#tabbar .ti { font-size: 1.25rem; line-height: 1; }

/* ---------- full-screen now-playing (compact) ---------- */
#nowplaying {
  position: fixed; inset: 0; z-index: 210;
  background: linear-gradient(180deg, rgba(8,8,12,.55), rgba(8,8,12,.88));
  flex-direction: column; align-items: center; justify-content: flex-start;
  padding: calc(env(safe-area-inset-top, 0px) + 3rem) 1.4rem 2rem;
  overflow-y: auto; text-align: center;
}
#nowplaying.show { display: flex; }
#np-close {
  position: absolute; top: calc(env(safe-area-inset-top, 0px) + .8rem); right: 1rem;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(16,16,22,.8); border: 1px solid var(--border); color: var(--text);
  font-size: 1.1rem; cursor: pointer;
}
.np-cover {
  width: min(62vw, 280px); aspect-ratio: 1; border-radius: 18px; overflow: hidden;
  background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center; font-size: 4rem; margin-bottom: 1.1rem;
}
.np-cover img { width: 100%; height: 100%; object-fit: cover; }
.np-title { font-size: 1.4rem; font-weight: 900; letter-spacing: -.5px; }
.np-artist { color: var(--muted); margin: .2rem 0 1.2rem; font-size: 1rem; }
.np-artist .aname { color: var(--text); }
.np-controls { display: flex; gap: 1.1rem; align-items: center; margin-bottom: 1rem; }
.np-controls button {
  width: 60px; height: 60px; border-radius: 50%; border: 1px solid var(--border);
  background: rgba(22,22,30,.9); color: var(--text); font-size: 1.4rem; cursor: pointer;
}
#np-play { width: 76px; height: 76px; font-size: 1.8rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep)); border: none;
  box-shadow: 0 4px 20px rgba(255,59,59,.4); }
#np-fav {
  width: 52px; height: 52px; border-radius: 50%; font-size: 1.5rem; cursor: pointer;
  background: rgba(22,22,30,.9); border: 1px solid var(--border); color: var(--muted);
  margin-bottom: 1.2rem;
}
#np-fav.on { color: var(--accent); border-color: var(--accent); }
.np-queue { width: 100%; max-width: 420px; text-align: left; }
.npq-row {
  display: flex; gap: .7rem; align-items: baseline; padding: .7rem .8rem;
  border-radius: 10px; cursor: pointer; min-height: 44px;
}
.npq-row.cur { background: rgba(255,59,59,.1); }
.npq-t { font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.npq-a { color: var(--muted); font-size: .82rem; }
.npq-empty { color: var(--muted); text-align: center; padding: 1rem; }

/* fullscreen visualizer backdrop (behind now-playing) */
#vizwrap.full {
  position: fixed; inset: 0; z-index: 205; height: auto; margin: 0;
  border-radius: 0; border: none; background: #06060a;
  opacity: 1; transform: none; pointer-events: none;
}
#vizwrap.full .vizmodes { display: none; }

/* ---------- now-playing side pane (parked: hidden in expanded mode,
   kept for a future wide-tablet treatment) ---------- */
#nowpane {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.1rem; position: sticky; top: 84px; align-self: start;
  max-height: calc(100vh - 200px); overflow-y: auto;
}
.np2-head { font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px;
  color: var(--muted); margin-bottom: .7rem; }
.np2-cover { width: 100%; aspect-ratio: 1; border-radius: 10px; overflow: hidden;
  background: var(--bg); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; font-size: 3rem; margin-bottom: .7rem; }
.np2-cover img { width: 100%; height: 100%; object-fit: cover; }
.np2-title { font-weight: 800; }
.np2-artist { color: var(--muted); font-size: .85rem; margin-bottom: .7rem; }
.np2-artist .aname { color: var(--text); }

/* ============================================================
   COMPACT MODE
   ============================================================ */
html[data-layout="compact"] body { padding-bottom: 150px; }

/* slim header: logo only */
html[data-layout="compact"] header.top nav.main { display: none; }
html[data-layout="compact"] header.top { padding: .65rem 1rem; }
html[data-layout="compact"] .logo { font-size: 1.05rem; }

html[data-layout="compact"] #tabbar { display: flex; }
html[data-layout="compact"] #nowpane { display: none; }

/* mini-player: sits above the tab bar */
html[data-layout="compact"] #playerbar {
  bottom: calc(60px + env(safe-area-inset-bottom, 0px)); height: 68px;
  align-items: center; cursor: pointer;
}
html[data-layout="compact"] #seek,
html[data-layout="compact"] #time,
html[data-layout="compact"] #btn-prev,
html[data-layout="compact"] #btn-next,
html[data-layout="compact"] #btn-fav,
html[data-layout="compact"] #btn-viz { display: none; }
html[data-layout="compact"] #playerbar .pbtn { min-width: 48px; min-height: 48px; }
html[data-layout="compact"] #playerbar .pinfo { max-width: none; }
html[data-layout="compact"] #vizwrap { bottom: 140px; }

/* stacked cards: full-width horizontal rows */
html[data-layout="compact"] .grid { grid-template-columns: 1fr; gap: .7rem; }
html[data-layout="compact"] .card { display: flex; gap: .9rem; align-items: center; padding: .7rem; }
html[data-layout="compact"] .card .cover { width: 64px; height: 64px; flex-shrink: 0; border-radius: 10px; }
html[data-layout="compact"] .card .meta { flex: 1; min-width: 0; }
html[data-layout="compact"] .card .badge { display: none; } /* simplified metadata */
html[data-layout="compact"] .card .hoverplay { display: none; }

/* artist rail stays horizontal */
html[data-layout="compact"] .astrip { display: flex; gap: .7rem; overflow-x: auto; padding-bottom: .4rem;
  -webkit-overflow-scrolling: touch; }
html[data-layout="compact"] .achip { flex-shrink: 0; }

/* touch targets ≥44px */
html[data-layout="compact"] .pbtn,
html[data-layout="compact"] .favbtn,
html[data-layout="compact"] .btn { min-height: 44px; }
html[data-layout="compact"] .trackrow { min-height: 56px; transition: transform .12s, background .3s; }
html[data-layout="compact"] .trackrow.swiped-fav { background: rgba(74,222,128,.14); }
html[data-layout="compact"] .trackrow.swiped-unfav { background: rgba(255,59,59,.1); }

/* track detail stacks */
html[data-layout="compact"] .track-hero { flex-direction: column; }
html[data-layout="compact"] .track-cover { width: 100%; max-width: 320px; height: auto; aspect-ratio: 1; }
html[data-layout="compact"] .artist-hero .avatar { width: 72px; height: 72px; }
html[data-layout="compact"] .hero { padding: 1.8rem 1.1rem 1.4rem; }
html[data-layout="compact"] .wrap { padding: 0 1rem; }

/* ============================================================
   EXPANDED MODE (square-ish: unfolded foldables, tablets)
   Stacked, not split: full-width artist rail up top, track shelf
   below in a clean 2–3 column grid. Desktop top-nav stays.
   (The #nowpane side pane is parked — display:none — the split
   cramped every page at this size.)
   ============================================================ */
html[data-layout="expanded"] #nowpane { display: none; }
html[data-layout="expanded"] .wrap { max-width: 1200px; } /* normal block flow */
html[data-layout="expanded"] .grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.1rem; }
html[data-layout="expanded"] .hero { max-width: 1200px; }

/* artist rail: full width, momentum scroll, scrollbar styled away */
html[data-layout="expanded"] .astrip {
  scrollbar-width: none; -ms-overflow-style: none;
  padding-bottom: .6rem;
}
html[data-layout="expanded"] .astrip::-webkit-scrollbar { display: none; }

/* generous breathing room between stacked sections */
html[data-layout="expanded"] section.block { margin-top: 2.6rem; }

/* ============================================================
   WIDE MODE — default styles above; ensure compact/expanded
   chrome stays hidden
   ============================================================ */
html[data-layout="wide"] #tabbar,
html[data-layout="wide"] #nowplaying,
html[data-layout="wide"] #nowpane { display: none; }

/* ---------- theme picker ---------- */
#themebtn {
  background: transparent; border: 1px solid var(--border); border-radius: 10px;
  color: var(--muted); font-size: 1.15rem; width: 44px; height: 44px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
#themebtn:hover { color: var(--text); border-color: var(--accent); }
#themepanel {
  position: fixed; z-index: 300; top: 64px; right: 12px; width: 264px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1rem; display: none;
}
#themepanel.show { display: block; }
#themepanel .tp-title { font-size: .78rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 1px; color: var(--muted); margin-bottom: .6rem; }
.tp-swatches { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; margin-bottom: .8rem; }
.tp-sw {
  display: flex; align-items: center; gap: .5rem; padding: .5rem .6rem; min-height: 44px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); font-size: .85rem; font-weight: 700; cursor: pointer;
}
.tp-sw .dot { width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0; }
.tp-sw.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.tp-hue { display: block; margin-bottom: .8rem; }
.tp-hue span { font-size: .78rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.tp-hue input { width: 100%; margin-top: .3rem; accent-color: var(--accent); min-height: 44px; }
#tp-reset {
  width: 100%; min-height: 44px; background: transparent; border: 1px solid var(--border);
  color: var(--muted); border-radius: 10px; font-weight: 700; cursor: pointer;
}
#tp-reset:hover { color: var(--text); border-color: var(--accent); }
/* artist-theme notice pill */
#artist-theme-pill {
  display: inline-flex; align-items: center; gap: .5rem; margin: .6rem 0 0;
  background: rgba(255,176,46,.1); border: 1px solid rgba(255,176,46,.35); color: var(--amber);
  border-radius: 20px; padding: .35rem .8rem; font-size: .82rem; font-weight: 700;
}
#artist-theme-pill button {
  background: none; border: none; color: var(--amber); font-weight: 800; cursor: pointer;
  text-decoration: underline; font-size: .82rem; padding: .3rem;
}

/* ---------- misc ---------- */
.empty { color: var(--muted); text-align: center; padding: 3rem 1rem; }
.empty .big { font-size: 2.5rem; display: block; margin-bottom: .6rem; }
footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 2.5rem 1rem 1rem; }
.pagehead { padding: 2.4rem 0 1.2rem; }
.pagehead h1 { font-size: 2rem; font-weight: 900; letter-spacing: -1px; }
.pagehead .sub { color: var(--muted); margin-top: .35rem; }
.sub { color: var(--muted); margin-bottom: 1.2rem; }

@media (max-width: 640px) {
  #time { display: none; }
  #playerbar .pinfo { max-width: 140px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem; }
  .hero { padding: 2.2rem 1.2rem 1.6rem; }
  .wrap { padding: 0 1.2rem; }
  nav.main { gap: .8rem; }
  nav.main a { font-size: .8rem; }
}

/* ---------- attribution: verified artist badge ---------- */
.vbadge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.05em; height: 1.05em; margin-left: .3em;
  font-size: .8em; font-weight: 900; line-height: 1;
  color: #0a0a0f; background: #4ade80; border-radius: 50%;
  vertical-align: baseline; cursor: default;
}
.aname { font-weight: 700; }
.infolink {
  display: inline-block; margin-left: .4em; color: var(--muted);
  font-size: .85em; text-decoration: none;
}
.infolink:hover { color: var(--amber); text-decoration: none; }
.trackrow .ta { color: var(--muted); font-size: .8rem; margin-top: .1rem; }
.trackrow .ta:hover { color: var(--amber); }

/* ---------- upload form extras ---------- */
.hint { color: var(--muted); font-size: .78rem; margin: .3rem 0 .6rem; }
.hint a { color: var(--amber); }
.radios { display: flex; flex-direction: column; gap: .35rem; margin: .2rem 0 .6rem; }
.radio {
  display: flex !important; gap: .6rem; align-items: flex-start;
  margin: 0 !important; padding: .55rem .7rem;
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  cursor: pointer; text-transform: none !important; letter-spacing: 0 !important;
  font-size: .9rem !important; font-weight: 400 !important; color: var(--text) !important;
}
.radio input { width: auto !important; margin-top: .2rem; accent-color: var(--accent); }
.radio:has(input:checked) { border-color: var(--accent); background: rgba(255,59,59,.07); }
.radio b { color: var(--amber); }

/* ---------- track detail page ---------- */
.track-hero { display: flex; gap: 1.6rem; align-items: flex-start; flex-wrap: wrap; margin-bottom: 1.4rem; }
.track-cover { width: 220px; height: 220px; border-radius: var(--radius); overflow: hidden;
  background: var(--card); border: 1px solid var(--border); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 4rem; }
.track-cover img { width: 100%; height: 100%; object-fit: cover; }
.track-cover .nocover { color: var(--muted); }
.track-info { flex: 1; min-width: 240px; }
.track-info h1 { font-size: 2.1rem; font-weight: 900; letter-spacing: -1px; }
.tartist.big { font-size: 1.15rem; margin: .3rem 0 .6rem; color: var(--muted); }
.tartist.big .aname { color: var(--text); }
.tstats { display: flex; gap: .9rem; align-items: center; color: var(--muted); font-size: .9rem; margin-bottom: 1rem; flex-wrap: wrap; }
.ghostbtn { background: transparent !important; border: 1px solid var(--border) !important;
  color: var(--text) !important; box-shadow: none !important; margin-left: .6rem; }
.sheet.notes { margin-bottom: 1.2rem; }
.sheet.notes h3, .copyblock h3 { font-size: .85rem; text-transform: uppercase; letter-spacing: 1px;
  color: var(--muted); margin-bottom: .5rem; }
.copyblock { margin-bottom: 1.2rem; }
.copyblock .copyline { font-size: 1.25rem; font-weight: 800; margin-bottom: .5rem; }
.copyblock p { margin: .35rem 0; }
.copyblock .fineprint { color: var(--muted); font-size: .82rem; margin-top: .8rem;
  border-top: 1px solid var(--border); padding-top: .8rem; }
.copyblock .muted { color: var(--muted); font-size: .85em; }
