:root {
  --bg: #070305;
  --bg-2: #12070a;
  --card: rgba(18, 8, 12, 0.78);
  --scarlet: #e0142a;
  --scarlet-hot: #ff2a3e;
  --scarlet-dim: #8a0c1c;
  --gold: #d4b056;
  --gold-soft: #f0dfb0;
  --gold-dim: #8a7040;
  --text: #f3e6d8;
  --muted: #b9a290;
  --line: rgba(212, 176, 86, 0.32);
  --danger: #e0142a;
  --shadow: 0 16px 50px rgba(0, 0, 0, 0.55);
  --font-display: "Cinzel Decorative", Cinzel, serif;
  --font-serif: Cinzel, "Cormorant Garamond", serif;
  --font-body: "Cormorant Garamond", Georgia, serif;
  --font-ui: Manrope, system-ui, sans-serif;
  --safe-top: max(env(safe-area-inset-top, 0px), var(--tg-content-safe-area-inset-top, 0px), var(--tg-safe-area-inset-top, 0px));
  --safe-bot: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px));
  --tab-h: 58px;
  --mini-h: 62px;
  --top-h: 64px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); height: 100%; }
html { background: #070305; }
body {
  font-family: var(--font-ui);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
img, audio, video { -webkit-user-drag: none; user-select: none; pointer-events: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: var(--gold); }

.atmosphere {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(224, 20, 42, 0.18), transparent 55%),
    radial-gradient(ellipse 70% 60% at 80% 100%, rgba(80, 20, 40, 0.35), transparent 50%),
    url("../assets/bg-dome.jpg") center 20% / cover no-repeat,
    var(--bg);
  opacity: 0.55;
  filter: saturate(0.9);
}
.grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0.12;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}
.vignette {
  position: fixed; inset: 0; z-index: 2; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,.72) 100%);
}

#app {
  position: relative; z-index: 3;
  height: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 100%;
  display: flex; flex-direction: column;
  padding-top: calc(var(--safe-top) + 6px);
  padding-bottom: calc(var(--safe-bot) + var(--tab-h) + 8px);
}

.topbar {
  height: var(--top-h);
  display: flex; align-items: center; gap: 8px;
  padding: 0 14px;
  flex: 0 0 auto;
}
.brand { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; cursor: pointer; }
.brand-mark { color: var(--gold); font-size: 14px; text-shadow: 0 0 12px rgba(224,20,42,.7); }
.brand-title {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.14em;
  font-size: 15px;
  line-height: 1.1;
  color: var(--gold-soft);
  text-transform: uppercase;
}
.brand-sub {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  margin-top: 1px;
}
.share-btn {
  border: 1px solid var(--line);
  color: var(--gold-soft);
  font-family: var(--font-serif);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(212,176,86,.08);
  white-space: nowrap;
}
.share-btn:active { background: rgba(224,20,42,.2); }

.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center;
  color: var(--gold-soft); border-radius: 50%;
}
.icon-btn:active { background: rgba(255,255,255,.06); }
.back-btn.hidden, .hidden { display: none !important; }

.view {
  flex: 1; min-height: 0;
  overflow-y: auto; overflow-x: hidden;
  padding: 4px 16px 18px;
  -webkit-overflow-scrolling: touch;
}
.view.has-mini { padding-bottom: calc(18px + var(--mini-h)); }

/* typography in views */
h1, h2, h3 { font-family: var(--font-serif); font-weight: 600; margin: 0; }
.kicker {
  font-family: var(--font-serif);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 10px;
  color: var(--gold);
  margin-bottom: 6px;
}

.hero {
  position: relative;
  margin: 6px 0 20px;
  padding: 22px 18px 20px;
  text-align: center;
  background: linear-gradient(180deg, rgba(40,10,16,.55), rgba(10,4,6,.7));
  border: 1px solid var(--line);
  box-shadow: var(--shadow), inset 0 0 40px rgba(224,20,42,.08);
}
.hero::before, .hero::after {
  content: ""; position: absolute; width: 28px; height: 28px; border-color: var(--gold); border-style: solid; opacity: .7;
}
.hero::before { top: 6px; left: 6px; border-width: 1.5px 0 0 1.5px; }
.hero::after { top: 6px; right: 6px; border-width: 1.5px 1.5px 0 0; }
.hero .corners-b { pointer-events: none; }
.hero-title {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.16em;
  color: var(--gold-soft);
  text-transform: uppercase;
  text-shadow: 0 0 18px rgba(224,20,42,.35);
}
.hero-lead {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 17px;
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.35;
}

.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 8px 0 10px;
}
.section-head h2 { font-size: 15px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-soft); }
.linkish { color: var(--muted); font-size: 12px; }

/* track rows */
.track-list { display: flex; flex-direction: column; gap: 6px; }
.track-row {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 8px;
  background: var(--card);
  border: 1px solid rgba(212,176,86,.12);
  border-radius: 4px;
}
.track-row:active { border-color: var(--gold); background: rgba(224,20,42,.1); }
.track-row .cov {
  width: 58px; height: 58px; border-radius: 2px; overflow: hidden;
  background: #111 center/cover no-repeat;
  box-shadow: 0 0 0 1px rgba(212,176,86,.3), 0 4px 12px rgba(0,0,0,.4);
}
.track-row .ttl {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.track-row .art {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.track-side { display: flex; align-items: center; gap: 4px; }
.dur { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 36px; text-align: right; }
.heart-btn { width: 34px; height: 34px; color: var(--muted); font-size: 18px; line-height: 1; }
.heart-btn.on, .icon-btn.heart.on { color: var(--scarlet-hot); text-shadow: 0 0 10px rgba(224,20,42,.8); }
.more-btn { width: 30px; height: 34px; color: var(--muted); font-size: 18px; }

/* artists */
.artist-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.artist-card {
  background: var(--card);
  border: 1px solid var(--line);
  padding: 12px 10px 14px;
  text-align: center;
  box-shadow: var(--shadow);
}
.artist-card .ava {
  width: 92px; height: 92px; margin: 4px auto 10px;
  border-radius: 50%;
  background: #111 center/cover no-repeat;
  box-shadow: 0 0 0 1px var(--gold), 0 0 0 5px rgba(212,176,86,.15), 0 8px 20px rgba(0,0,0,.5);
}
.artist-card h3 { font-size: 15px; color: var(--gold-soft); }
.artist-card p { margin: 4px 0 0; font-size: 12px; color: var(--muted); font-family: var(--font-body); font-style: italic; }

.artist-hero { text-align: center; margin-bottom: 18px; }
.artist-hero .banner {
  height: 140px; margin: 0 -16px 0;
  background: #100 center/cover no-repeat;
  mask-image: linear-gradient(180deg, #000 40%, transparent);
}
.artist-hero .ava {
  width: 110px; height: 110px; margin: -58px auto 10px;
  border-radius: 50%;
  background: #111 center/cover no-repeat;
  box-shadow: 0 0 0 2px var(--gold), 0 0 0 7px rgba(224,20,42,.25);
  position: relative;
}
.artist-hero h1 { font-family: var(--font-display); font-size: 22px; letter-spacing: .08em; color: var(--gold-soft); }
.artist-hero .bio {
  font-family: var(--font-body); font-style: italic; font-size: 16px;
  color: var(--muted); margin: 8px 12px 0; line-height: 1.4;
}

/* playlists */
.playlist-row, .action-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 10px;
  border: 1px solid rgba(212,176,86,.14);
  background: var(--card);
  margin-bottom: 8px;
}
.playlist-ico {
  width: 48px; height: 48px; display: grid; place-items: center;
  border: 1px solid var(--line); color: var(--gold);
  font-family: var(--font-display); font-size: 18px;
}
.action-row.primary {
  justify-content: center;
  border-style: dashed;
  color: var(--gold-soft);
  letter-spacing: .12em;
  text-transform: uppercase;
  font-family: var(--font-serif);
  font-size: 13px;
}

.empty {
  text-align: center; padding: 40px 16px;
  font-family: var(--font-body); font-style: italic;
  color: var(--muted); font-size: 18px;
}

/* admin */
.admin-note {
  border: 1px solid var(--line);
  padding: 10px 12px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  background: rgba(224,20,42,.08);
}
label.field { display: block; margin: 0 0 12px; font-size: 12px; color: var(--gold); letter-spacing: .08em; text-transform: uppercase; }
label.field input, label.field textarea, label.field select {
  display: block; width: 100%; margin-top: 6px;
  background: rgba(0,0,0,.45);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 2px;
  font-family: var(--font-ui);
  font-size: 14px;
  user-select: text; -webkit-user-select: text;
}
label.field textarea { min-height: 140px; resize: vertical; font-family: var(--font-body); font-size: 16px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%; padding: 12px;
  margin: 6px 0 16px;
  background: linear-gradient(180deg, var(--scarlet), var(--scarlet-dim));
  color: var(--gold-soft);
  border: 1px solid var(--gold-dim);
  font-family: var(--font-serif);
  letter-spacing: .14em;
  text-transform: uppercase;
  font-size: 13px;
  box-shadow: 0 0 18px rgba(224,20,42,.35);
}
.btn.ghost {
  background: transparent; color: var(--gold-soft);
  box-shadow: none;
}
.admin-list { margin-bottom: 24px; }
.admin-list .row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  border-bottom: 1px solid rgba(212,176,86,.12);
  padding: 10px 0;
  font-size: 14px;
}
.admin-list .row button { color: var(--muted); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }

/* tabbar + mini */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 8;
  height: calc(var(--tab-h) + var(--safe-bot));
  padding: 4px 6px var(--safe-bot);
  display: flex; justify-content: space-around; align-items: flex-start;
  background: linear-gradient(180deg, rgba(20,8,10,.92), #090305);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.tabbar button {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--muted); font-size: 10px; letter-spacing: .06em; text-transform: uppercase;
  padding-top: 6px;
}
.tabbar button.on { color: var(--gold-soft); text-shadow: 0 0 8px rgba(224,20,42,.5); }
.tab-ico { font-size: 16px; line-height: 1; }

.mini-player {
  position: fixed; left: 8px; right: 8px; z-index: 7;
  bottom: calc(var(--tab-h) + var(--safe-bot) + 6px);
  height: var(--mini-h);
  display: grid; grid-template-columns: 50px 1fr 44px; align-items: center; gap: 10px;
  padding: 6px 8px;
  background: linear-gradient(90deg, rgba(30,8,12,.94), rgba(12,6,8,.94));
  border: 1px solid var(--line);
  box-shadow: 0 8px 30px rgba(0,0,0,.5), 0 0 20px rgba(224,20,42,.15);
}
.mini-cover {
  width: 50px; height: 50px;
  background: #111 center/cover no-repeat;
  box-shadow: 0 0 0 1px var(--gold-dim);
}
.mini-title { font-family: var(--font-serif); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-artist { font-family: var(--font-body); font-style: italic; font-size: 12px; color: var(--muted); }
.mini-player #miniPlay { color: var(--gold-soft); }

/* full player */
.full-player {
  position: fixed; inset: 0; z-index: 20;
  display: flex; flex-direction: column;
  padding: calc(var(--safe-top) + 8px) 18px calc(var(--safe-bot) + 16px);
  overflow: auto;
}
.fp-bg {
  position: absolute; inset: 0;
  background: #100 center/cover no-repeat;
  filter: blur(28px) saturate(1.1) brightness(.45);
  transform: scale(1.15);
}
.fp-shade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(7,3,5,.55) 0%, rgba(7,3,5,.82) 48%, #070305 100%);
}
.fp-inner { position: relative; z-index: 1; display: flex; flex-direction: column; min-height: 100%; }
.fp-top { display: flex; align-items: center; justify-content: space-between; }
.fp-now {
  font-family: var(--font-serif);
  letter-spacing: .22em; text-transform: uppercase;
  font-size: 10px; color: var(--gold);
}
.fp-cover-wrap {
  position: relative;
  width: min(78vw, 340px);
  margin: 18px auto 16px;
  aspect-ratio: 1;
}
.fp-cover {
  width: 100%; height: 100%;
  background: #111 center/cover no-repeat;
  box-shadow: 0 20px 50px rgba(0,0,0,.6);
}
.ornament {
  position: absolute; width: 36px; height: 36px; z-index: 2;
  border-color: var(--gold); border-style: solid; opacity: .85;
  filter: drop-shadow(0 0 4px rgba(224,20,42,.4));
}
.ornament.tl { top: -7px; left: -7px; border-width: 2px 0 0 2px; }
.ornament.tr { top: -7px; right: -7px; border-width: 2px 2px 0 0; }
.ornament.bl { bottom: -7px; left: -7px; border-width: 0 0 2px 2px; }
.ornament.br { bottom: -7px; right: -7px; border-width: 0 2px 2px 0; }
.fp-cover-wrap::after {
  content: ""; position: absolute; inset: -3px;
  border: 1px solid rgba(212,176,86,.45);
  pointer-events: none;
}
.fp-info { text-align: center; margin-bottom: 8px; }
.fp-title {
  font-family: var(--font-serif);
  font-size: 22px; letter-spacing: .04em;
  color: var(--gold-soft);
}
.fp-artist {
  display: inline-block; margin-top: 4px;
  font-family: var(--font-body); font-style: italic;
  font-size: 16px; color: var(--muted);
}
.fp-progress { margin: 10px 4px 4px; }
.fp-progress input[type=range] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 4px; border-radius: 99px;
  background: linear-gradient(90deg, var(--scarlet) var(--p, 0%), rgba(255,255,255,.18) var(--p, 0%));
  outline: none;
}
.fp-progress input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%;
  background: var(--gold-soft);
  box-shadow: 0 0 10px rgba(224,20,42,.9);
  border: 1px solid var(--gold);
}
.fp-times {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; margin-top: 4px;
}
.fp-controls {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 4px 4px;
}
.ctrl {
  color: var(--gold-soft);
  width: 52px; height: 52px; display: grid; place-items: center;
}
.ctrl.play {
  width: 72px; height: 72px; border-radius: 50%;
  background: radial-gradient(circle at 40% 30%, var(--scarlet-hot), var(--scarlet-dim));
  border: 1px solid var(--gold);
  color: var(--gold-soft);
  box-shadow: 0 0 26px rgba(224,20,42,.55), inset 0 0 12px rgba(255,200,160,.15);
}
.ctrl.play:active { transform: scale(.96); }
.lyrics-toggle {
  align-self: center;
  margin-top: 10px;
  font-family: var(--font-serif);
  letter-spacing: .16em; text-transform: uppercase;
  font-size: 11px; color: var(--gold);
  border-bottom: 1px solid var(--line); padding-bottom: 3px;
}
.lyrics {
  margin-top: 14px;
  font-family: var(--font-body);
  font-style: italic;
  font-size: 18px;
  line-height: 1.55;
  color: var(--text);
  text-align: center;
  white-space: pre-wrap;
  max-height: 40vh; overflow: auto;
  padding: 0 6px 20px;
  mask-image: linear-gradient(180deg, transparent, #000 12px, #000 calc(100% - 18px), transparent);
}
.lyrics.empty-ly { color: var(--muted); font-size: 16px; }

/* sheet + toast */
.sheet { position: fixed; inset: 0; z-index: 30; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.55); }
.sheet-card {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: linear-gradient(180deg, #1a0b0f, #0c0507);
  border-top: 1px solid var(--line);
  padding: 16px 16px calc(var(--safe-bot) + 18px);
  max-height: 72vh; overflow: auto;
  border-radius: 16px 16px 0 0;
}
.sheet-card h3 { margin-bottom: 12px; color: var(--gold-soft); letter-spacing: .08em; text-transform: uppercase; font-size: 14px; }
.sheet-item {
  display: block; width: 100%; text-align: left;
  padding: 12px 4px; border-bottom: 1px solid rgba(212,176,86,.12);
  font-family: var(--font-serif); font-size: 16px;
}
.sheet-item:active { color: var(--gold); }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + var(--safe-bot) + 80px);
  transform: translateX(-50%);
  z-index: 40;
  background: rgba(20,8,10,.94);
  border: 1px solid var(--gold-dim);
  color: var(--gold-soft);
  padding: 8px 14px;
  font-family: var(--font-serif);
  font-size: 13px;
  letter-spacing: .06em;
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
  white-space: nowrap;
}

.loading-dot { color: var(--gold); font-family: var(--font-body); font-style: italic; text-align: center; padding: 40px 0; }

input[type=file] { font-size: 13px; }

@media (min-width: 720px) {
  .view { max-width: 560px; margin: 0 auto; width: 100%; }
  .full-player { align-items: center; }
  .fp-inner { width: min(420px, 100%); }
}

/* extra player modes + download */
.fp-extra {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  margin-top: 2px;
}
.icon-btn.mode {
  position: relative;
  color: var(--muted);
}
.icon-btn.mode.on { color: var(--gold-soft); text-shadow: 0 0 10px rgba(224,20,42,.6); }
.repeat-one {
  display: none;
  position: absolute;
  right: 2px; bottom: 2px;
  font-size: 9px;
  font-family: var(--font-ui);
  color: var(--gold-soft);
}
.icon-btn.mode.one .repeat-one { display: block; }
.icon-btn.mode.one { color: var(--gold-soft); }

.dl-btn { position: relative; color: var(--muted); }
.dl-btn.on { color: var(--gold-soft); }
.dl-btn.busy { color: var(--gold); }
.dl-btn .dl-pct {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-family: var(--font-ui);
  color: var(--gold-soft);
}
.dl-btn.busy .dl-pct { display: flex; }
.dl-btn.busy .i-dl { opacity: 0.15; }

.track-side .dl-btn {
  width: 30px; height: 34px;
  font-size: 15px;
  line-height: 1;
}
.track-row .dl-btn.busy { font-size: 9px; letter-spacing: 0; }

.tabbar button { font-size: 9px; letter-spacing: 0.03em; }
.tabbar button span:last-child { max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.online-note {
  font-family: var(--font-body);
  font-style: italic;
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 12px;
  text-align: center;
}

/* first-run onboarding */
.onboard {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  padding: 24px 18px;
  background: rgba(5, 1, 3, 0.78);
  backdrop-filter: blur(8px);
}
.onboard-card {
  width: min(100%, 380px);
  background: linear-gradient(180deg, #1a0b0f, #0c0507);
  border: 1px solid var(--line);
  box-shadow: 0 20px 50px rgba(0,0,0,.6), inset 0 0 40px rgba(224,20,42,.08);
  padding: 28px 22px 22px;
  text-align: center;
  position: relative;
}
.onboard-card::before, .onboard-card::after {
  content: ""; position: absolute; width: 22px; height: 22px;
  border-color: var(--gold); border-style: solid; opacity: .7;
}
.onboard-card::before { top: 8px; left: 8px; border-width: 1.5px 0 0 1.5px; }
.onboard-card::after { top: 8px; right: 8px; border-width: 1.5px 1.5px 0 0; }
.onboard-card h2 {
  font-family: var(--font-serif);
  color: var(--gold-soft);
  font-size: 22px;
  margin: 8px 0 12px;
}
.onboard-card p {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 17px;
  line-height: 1.45;
  color: var(--muted);
  margin: 0 0 8px;
}
.onboard-nav { margin-top: 22px; }
.onboard-dots { display: flex; justify-content: center; gap: 8px; margin-bottom: 14px; }
.onboard-dots i {
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(212,176,86,.25);
  display: block;
}
.onboard-dots i.on { background: var(--gold); box-shadow: 0 0 8px rgba(224,20,42,.6); }
.onboard .btn { width: auto; min-width: 60%; margin: 0 auto; padding: 12px 22px; }

/* ===== v2 additions ===== */
.ell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* mini player with full controls */
:root { --mini-h: 66px; }
.mini-player {
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 8px; padding: 6px 6px 8px 8px; overflow: hidden;
}
.mini-cover { width: 46px; height: 46px; }
.mini-meta { min-width: 0; }
.mini-artist { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-ctrls { display: flex; align-items: center; gap: 0; }
.mini-btn {
  width: 40px; height: 44px; display: grid; place-items: center;
  color: var(--gold-soft); border-radius: 10px; font-size: 18px; line-height: 1;
}
.mini-btn:active { background: rgba(255,255,255,.07); }
.mini-btn.play { width: 44px; height: 44px; border-radius: 50%; background: rgba(224,20,42,.18); box-shadow: inset 0 0 0 1px var(--line); }
.mini-btn.heart { color: var(--muted); font-size: 19px; }
.mini-btn.heart.on { color: var(--scarlet-hot); text-shadow: 0 0 10px rgba(255,42,62,.6); }
.mini-btn.add { font-size: 20px; color: var(--muted); }
.mini-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: rgba(212,176,86,.12); }
.mini-progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--scarlet), var(--gold)); }
@media (max-width: 370px) { .mini-btn.add { display: none; } .mini-btn { width: 38px; } }
@media (max-width: 330px) { .mini-btn.heart { display: none; } }

.tabbar button { min-width: 0; }
.tab-ico { position: relative; }
.tab-badge { position: absolute; top: -4px; right: -10px; min-width: 15px; height: 15px; padding: 0 3px; border-radius: 8px; background: var(--scarlet); color: #fff; font: 600 9px/15px var(--font-ui); font-style: normal; }
.fp-stats { font-family: var(--font-ui); font-size: 12px; color: var(--muted); letter-spacing: .06em; margin-top: 6px; white-space: pre; }

.guest-note { border: 1px solid var(--line); background: rgba(224,20,42,.1); padding: 12px 14px; margin: 8px 0 12px; font-family: var(--font-body); font-size: 15px; line-height: 1.4; color: var(--gold-soft); }
.h-scroll { display: flex; gap: 12px; overflow-x: auto; padding: 2px 0 10px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; -webkit-overflow-scrolling: touch; }
.mini-card { flex: 0 0 116px; text-align: left; color: var(--text); }
.mc-cov { width: 116px; height: 116px; background: #111 center/cover no-repeat; box-shadow: 0 0 0 1px var(--gold-dim); }
.mc-ttl { font-family: var(--font-serif); font-size: 12px; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-sub { font-family: var(--font-body); font-style: italic; font-size: 12px; color: var(--muted); }
.album-hero { display: flex; gap: 14px; align-items: flex-end; margin: 6px 0 14px; }
.album-cov { flex: 0 0 130px; height: 130px; background: #111 center/cover no-repeat; box-shadow: 0 0 0 1px var(--gold-dim), var(--shadow); }
.album-hero h1 { font-size: 20px; color: var(--gold-soft); margin: 4px 0; }
.art { font-family: var(--font-body); font-style: italic; color: var(--muted); font-size: 14px; }
.pub { font-family: var(--font-ui); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); border: 1px solid var(--line); padding: 1px 5px; margin-left: 4px; vertical-align: middle; }
.pl-tools { margin: 0 0 12px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.btn.small { width: auto; min-height: 40px; padding: 8px 14px; font-size: 12px; }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--gold-soft); }
.toggle { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; font-family: var(--font-body); font-size: 15px; color: var(--text); }
.toggle input { width: 22px; height: 22px; accent-color: var(--scarlet); flex: 0 0 22px; margin: 0; }
.empty.small { padding: 10px 0; font-size: 14px; }
.yt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.yt-card { text-align: left; color: var(--text); }
.yt-thumb { position: relative; aspect-ratio: 16/9; background: #111 center/cover no-repeat; box-shadow: 0 0 0 1px var(--gold-dim); }
.yt-play { position: absolute; inset: 0; display: grid; place-items: center; font-size: 26px; color: #fff; text-shadow: 0 0 12px rgba(0,0,0,.8); }
.yt-title { font-family: var(--font-serif); font-size: 12px; margin-top: 6px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.yt-embed { position: relative; aspect-ratio: 16/9; margin: 8px 0 12px; background: #000; }
.yt-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.u-ava { border-radius: 50%; background: #1a0b0f center/cover no-repeat; box-shadow: 0 0 0 1px var(--gold-dim); flex: 0 0 auto; display: grid; place-items: center; color: var(--gold-soft); font-family: var(--font-serif); }
.profile-hero { display: flex; gap: 14px; align-items: center; margin: 8px 0 4px; }
.ph-meta { min-width: 0; }
.profile-hero h1 { font-size: 21px; color: var(--gold-soft); }
.dot-online { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 6px #3ddc84; margin-right: 6px; vertical-align: middle; }
.act-list { display: flex; flex-direction: column; }
.act-row { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid rgba(212,176,86,.1); cursor: pointer; }
.act-ico { width: 34px; height: 34px; display: grid; place-items: center; color: var(--scarlet-hot); }
.act-txt { font-family: var(--font-body); font-size: 15px; min-width: 0; }
.act-time { font-size: 12px; color: var(--muted); font-style: italic; }
.friend-row { display: flex; align-items: center; gap: 6px; padding: 6px 0; border-bottom: 1px solid rgba(212,176,86,.1); }
.fr-main { flex: 1; display: flex; gap: 10px; align-items: center; min-width: 0; text-align: left; color: var(--text); min-height: 48px; }
.fr-txt { min-width: 0; }
.sheet-search { width: 100%; box-sizing: border-box; min-height: 44px; padding: 10px 12px; margin: 6px 0 10px; background: rgba(0,0,0,.35); color: var(--text); border: 1px solid var(--line); font: 15px var(--font-ui); }
.sheet-stats { font-family: var(--font-ui); font-size: 12px; color: var(--muted); margin: -4px 0 8px; }
.sheet-item.danger { color: var(--scarlet-hot); }
/* admin */
.seg { display: flex; gap: 6px; overflow-x: auto; margin: 4px -16px 12px; padding: 0 16px; }
.seg button { flex: 0 0 auto; min-height: 40px; padding: 8px 14px; border: 1px solid var(--line); color: var(--muted); font: 600 12px var(--font-ui); letter-spacing: .04em; border-radius: 999px; }
.seg button.on { color: #fff; background: var(--scarlet-dim); border-color: var(--scarlet); }
.adm-tools { position: sticky; top: -4px; z-index: 2; background: linear-gradient(180deg, #070305 80%, rgba(7,3,5,0)); padding-bottom: 6px; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.chip { flex: 0 0 auto; min-height: 36px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font: 12px var(--font-ui); }
.chip.on { color: var(--gold-soft); border-color: var(--gold); background: rgba(212,176,86,.12); }
.bulk-bar { position: sticky; top: 92px; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px; margin: 4px 0 8px; background: #1a0b0f; border: 1px solid var(--line); font: 12px var(--font-ui); color: var(--gold-soft); }
.bulk-bar span { margin-right: auto; }
.admin-note.small { font-size: 13px; }
.adm-list { display: flex; flex-direction: column; }
.adm-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid rgba(212,176,86,.1); background: var(--bg); touch-action: pan-y; }
.adm-row.is-hidden { opacity: .5; }
.adm-row.sel { background: rgba(224,20,42,.12); }
.adm-row.dragging { position: relative; z-index: 3; box-shadow: 0 8px 24px rgba(0,0,0,.6); background: #1a0b0f; }
.adm-row .cov { flex: 0 0 48px; width: 48px; height: 48px; background: #111 center/cover no-repeat; box-shadow: 0 0 0 1px var(--gold-dim); }
.adm-txt { flex: 1; min-width: 0; text-align: left; color: var(--text); min-height: 48px; display: flex; flex-direction: column; justify-content: center; }
.adm-txt .art { font-family: var(--font-ui); font-style: normal; font-size: 11px; }
.drag { flex: 0 0 32px; height: 48px; display: grid; place-items: center; color: var(--muted); font-size: 20px; touch-action: none; cursor: grab; }
.mini-act { flex: 0 0 auto; min-width: 40px; height: 40px; padding: 0 8px; display: grid; place-items: center; color: var(--gold-soft); border: 1px solid rgba(212,176,86,.2); font: 12px var(--font-ui); }
.mini-act.chk { width: 32px; min-width: 32px; height: 32px; border-radius: 6px; color: var(--scarlet-hot); }
.rank { flex: 0 0 32px; text-align: center; font-family: var(--font-display); color: var(--gold); }
.gal { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; max-height: 55vh; overflow-y: auto; }
.gal-i { aspect-ratio: 1; background: #111 center/cover no-repeat; box-shadow: 0 0 0 1px var(--gold-dim); }
.pick-list { display: flex; flex-direction: column; max-height: 300px; overflow-y: auto; border: 1px solid var(--line); margin-top: 6px; }
.pick { display: flex; gap: 10px; align-items: center; text-align: left; min-height: 44px; padding: 6px 10px; color: var(--text); border-bottom: 1px solid rgba(212,176,86,.08); font: 14px var(--font-ui); }
.pick.on { background: rgba(224,20,42,.15); }
.pick-n { flex: 0 0 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; font-size: 11px; color: var(--gold-soft); }
.up-prog { position: relative; height: 26px; border: 1px solid var(--line); margin: 8px 0; }
.up-prog i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: rgba(224,20,42,.4); transition: width .2s; }
.up-prog span { position: relative; display: block; text-align: center; font: 12px/26px var(--font-ui); color: var(--gold-soft); }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { border: 1px solid var(--line); padding: 10px 8px; text-align: center; background: rgba(18,8,12,.6); }
.stat b { display: block; font-family: var(--font-display); font-size: 20px; color: var(--gold-soft); }
.stat span { font: 10px var(--font-ui); color: var(--muted); letter-spacing: .03em; }
.chart { display: flex; align-items: flex-end; gap: 3px; height: 140px; padding: 6px 0 18px; border-bottom: 1px solid var(--line); }
.chart .bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; }
.chart .bar i { display: block; width: 100%; background: linear-gradient(180deg, var(--scarlet-hot), var(--scarlet-dim)); }
.chart .bar span { position: absolute; bottom: -16px; font: 8px var(--font-ui); color: var(--muted); }
@media (max-width: 360px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
.btn-row .btn, .bulk-bar .btn { margin: 0; }
div.field { display: block; margin: 0 0 12px; font-size: 12px; color: var(--gold); letter-spacing: .08em; text-transform: uppercase; }
.action-row { min-height: 44px; }
.fp-now-wrap { display: flex; flex-direction: column; align-items: center; min-width: 0; flex: 1; }
.fp-src { max-width: 70vw; font: 11px var(--font-ui); color: var(--gold); opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; min-height: 20px; }
.fp-src:empty { display: none; }
.sheet-card.tall { max-height: 82vh; display: flex; flex-direction: column; }
.q-head { flex: 0 0 auto; }
.q-src { font-family: var(--font-body); font-size: 15px; color: var(--muted); margin: 2px 0; }
.q-sub { font: 11px var(--font-ui); color: var(--muted); margin-bottom: 8px; }
.q-list { flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; }
.q-item { display: flex; align-items: center; gap: 4px; padding: 4px; border-bottom: 1px solid rgba(212,176,86,.08); background: #120709; touch-action: pan-y; }
.q-item.past { opacity: .5; }
.q-item.now { background: rgba(224,20,42,.18); box-shadow: inset 3px 0 0 var(--scarlet-hot); }
.q-item.dragging { position: relative; z-index: 3; box-shadow: 0 8px 24px rgba(0,0,0,.6); }
.q-main { flex: 1; min-width: 0; display: flex; gap: 10px; align-items: center; text-align: left; color: var(--text); min-height: 48px; }
.q-main .cov { flex: 0 0 42px; width: 42px; height: 42px; background: #111 center/cover no-repeat; box-shadow: 0 0 0 1px var(--gold-dim); }
.q-txt { min-width: 0; }
.q-txt .art { font-size: 12px; }
.q-now { font: 10px var(--font-ui); color: var(--scarlet-hot); text-transform: uppercase; letter-spacing: .08em; padding: 0 8px; }
.q-title { display: flex; align-items: center; justify-content: space-between; } .q-title h3 { margin: 0; }
/* compact track rows (v2.1) */
.track-row { grid-template-columns: 54px minmax(0, 1fr) auto; gap: 10px; padding: 7px 4px 7px 7px; }
.track-row .cov { width: 54px; height: 54px; }
.tr-mid { min-width: 0; }
.tr-stats { display: flex; gap: 8px; margin-top: 3px; font: 11px/1.2 var(--font-ui); color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; }
.tr-stats span:first-child { color: var(--gold-soft); opacity: .8; }
.tr-off { color: var(--gold) !important; }
.tr-off.busy { color: var(--scarlet-hot) !important; }
.track-side { gap: 0; flex-shrink: 0; }
.track-side .heart-btn { width: 40px; height: 44px; }
.track-side .more-btn { width: 36px; height: 44px; font-size: 20px; }
/* YouTube fullscreen */
.yt-embed:fullscreen, .yt-embed:-webkit-full-screen { width: 100vw; height: 100vh; aspect-ratio: auto; margin: 0; background: #000; }
.yt-fs-exit { display: none; position: absolute; top: calc(10px + var(--safe-top)); right: 10px; z-index: 3; width: 44px; height: 44px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; font-size: 18px; }
.yt-embed:fullscreen .yt-fs-exit, .yt-embed:-webkit-full-screen .yt-fs-exit, .yt-embed.pseudo-fs .yt-fs-exit { display: grid; place-items: center; }
.yt-embed.pseudo-fs { position: fixed; z-index: 100; margin: 0; background: #000; inset: 0; aspect-ratio: auto; }
@media (orientation: portrait) {
  .yt-embed.pseudo-fs { inset: auto; top: 50%; left: 50%; width: 100vh; height: 100vw; transform: translate(-50%, -50%) rotate(90deg); }
}
html.yt-fs .sheet-card { transform: none !important; }

/* avatars: Telegram photo over a letter fallback */
.u-ava { position: relative; overflow: hidden; }
.u-ava .u-ph { position: absolute; inset: 0; background: center/cover no-repeat; border-radius: inherit; }

/* friends: add box, search, invite, badges */
.fr-add-box { margin: 4px 0 18px; padding: 14px; border: 1px solid var(--gold-dim); border-radius: 14px; background: rgba(20, 8, 12, .55); }
.fr-add-title { font-family: var(--font-serif); color: var(--gold-soft); letter-spacing: .08em; text-transform: uppercase; font-size: 13px; margin-bottom: 10px; }
.fr-search { display: flex; gap: 8px; }
.fr-search input { flex: 1 1 auto; min-width: 0; height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--gold-dim); background: rgba(0,0,0,.35); color: inherit; font-size: 16px; }
.fr-search .btn { min-height: 44px; }
#frResult .friend-row { margin-top: 10px; }
.fr-invite { width: 100%; margin-top: 12px; min-height: 46px; }
.fr-badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px; border-radius: 9px; background: #c4122f; color: #fff; font-style: normal; font-size: 11px; line-height: 1; vertical-align: middle; }
.fr-badge.hidden { display: none; }
