/* Оформление по мотивам Moonify: чёрный фон, стеклянные карточки, Figtree.
   Акцент — цвет обложки того, что играет; без неё — розовое вино. */

@font-face {
  font-family: "Figtree";
  src: url("/figtree.ttf") format("truetype");
  font-weight: 300 900;
  font-display: swap;
}

@property --accent {
  syntax: "<color>";
  inherits: true;
  initial-value: #f4a6b7;
}

:root {
  --bg: #000;
  --elev: #111111;
  --high: #1c1c1e;
  --press: #2c2c2e;
  --text: #fff;
  --sub: #a1a1a6;
  --muted: #636366;
  --rose: #f4a6b7;
  --accent: var(--rose);
  --on-accent: #000;
  --danger: #f15e6c;
  --r-m: 14px;
  --r-s: 16px;
  --r-l: 20px;
  --r-xl: 28px;
  --rim: inset 0 0 0 1px rgba(255, 255, 255, .09), inset 0 1px 0 rgba(255, 255, 255, .14);
  transition: --accent .7s ease;
}

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

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 500 16px/1.3 "Figtree", -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
[hidden] { display: none !important; }

/* мягкое свечение цвета акцента сверху страницы */
.glow {
  position: fixed;
  inset: 0 0 auto 0;
  height: 420px;
  pointer-events: none;
  background: radial-gradient(120% 80% at 50% -10%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%);
  z-index: 0;
}

main {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
  padding: 12px 16px calc(110px + env(safe-area-inset-bottom));
}

.caps {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .72);
}

.section {
  margin: 26px 0 12px;
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -.3px;
}

/* --- шапка --- */
.top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0 16px;
}
.avatar {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 600;
  background: linear-gradient(135deg, var(--accent), #4f3fd9);
  color: #fff;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.hello { min-width: 0; flex: 1; }
.greet { color: var(--sub); font-size: 14px; font-weight: 500; }
h1 {
  margin: 1px 0 0;
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -.4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.round-btn {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .06);
  box-shadow: var(--rim);
}
.round-btn svg { width: 22px; height: 22px; }

/* --- обложки --- */
.art {
  position: relative;
  flex: none;
  overflow: hidden;
  background: var(--high);
  border-radius: var(--r-m);
}
.art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: rgba(255, 255, 255, .92);
  background: linear-gradient(135deg, hsl(var(--h) 55% 48%), hsl(calc(var(--h) + 50) 60% 28%));
}

/* --- главная карточка --- */
.hero {
  position: relative;
  height: 208px;
  border-radius: var(--r-xl);
  overflow: hidden;
  background: var(--elev);
  box-shadow: var(--rim);
  isolation: isolate;
}
.hero-bg {
  position: absolute;
  inset: -40px;
  background-size: cover;
  background-position: center;
  filter: blur(36px) saturate(1.25);
  opacity: .9;
  z-index: -2;
  transition: background-image .6s;
}
.hero-bg.empty {
  background: radial-gradient(80% 90% at 30% 30%, color-mix(in srgb, var(--accent) 55%, #222), #151515 75%);
  filter: none;
}
.hero-shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(0, 0, 0, .55), rgba(0, 0, 0, .15));
}
.hero-row {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 100%;
  padding: 18px;
}
.hero-art {
  width: 132px;
  height: 132px;
  border-radius: var(--r-s);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
}
.hero-art .ph { font-size: 38px; }
.hero-text { min-width: 0; flex: 1; padding-bottom: 18px; }
.hero-text .caps { display: flex; align-items: center; gap: 8px; }
.hero-title {
  margin-top: 6px;
  font-size: 28px;
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -.4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hero-sub {
  margin-top: 4px;
  color: rgba(255, 255, 255, .75);
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hero-progress {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 16px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .18);
  overflow: hidden;
  margin-right: 64px;
}
.hero-progress i, .pl-bar i, .mini-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: inherit;
}
.fab {
  position: absolute;
  right: 14px;
  bottom: 14px;
  min-width: 48px;
  height: 48px;
  padding: 0 14px;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 700;
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
  transition: transform .12s;
}
.fab:active { transform: scale(.94); }
.fab svg { width: 20px; height: 20px; }
.fab.ghost { background: rgba(0, 0, 0, .35); color: #fff; backdrop-filter: blur(10px); }

/* «эквалайзер» рядом с «сейчас играет» */
.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 11px; }
.eq i { width: 2.5px; background: var(--accent); border-radius: 1px; animation: eq 1s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.35s; }
.eq i:nth-child(3) { animation-delay: -.7s; }
.eq.paused i { animation-play-state: paused; height: 30%; }
@keyframes eq { 0%, 100% { height: 30%; } 50% { height: 100%; } }

/* --- плитки --- */
.tiles {
  display: flex;
  gap: 12px;
  height: 188px;
  margin-top: 16px;
}
.tile {
  position: relative;
  flex: 1;
  text-align: left;
  padding: 14px 16px;
  border-radius: var(--r-l);
  background: var(--elev);
  box-shadow: var(--rim);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transition: transform .15s;
}
.tile:active { transform: scale(.97); }
.tile-big {
  border-radius: var(--r-xl);
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 70%, #5a3fd9), color-mix(in srgb, var(--accent) 30%, #3523a8));
}
.tile-heart { position: absolute; top: 16px; right: 16px; width: 34px; height: 34px; color: #fff; }
.tile-col { flex: 1; display: flex; flex-direction: column; gap: 12px; }
.tile-title { font-size: 18px; font-weight: 500; }
.tile-big .tile-title { font-size: 20px; }
.tile-sub { color: var(--sub); font-size: 14px; margin-top: 2px; }
.tile-big .tile-sub { color: rgba(255, 255, 255, .85); }
.tile.on { box-shadow: inset 0 0 0 1.5px var(--accent); }

/* --- «Далее»: полка обложек --- */
.shelf {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  margin: 0 -16px;
  padding: 0 16px 4px;
  scroll-padding-inline: 16px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.shelf::-webkit-scrollbar { display: none; }
.card {
  flex: none;
  width: 148px;
  scroll-snap-align: start;
  text-align: left;
}
.card .art { width: 148px; height: 148px; border-radius: var(--r-l); }
.card .ph { font-size: 34px; }
.rank {
  position: absolute;
  top: 8px;
  left: 8px;
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
  background: var(--accent);
  color: var(--on-accent);
}
.rank.forced { background: #fff; color: #000; }
.card-title { margin-top: 8px; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-sub { color: var(--sub); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* --- фильтры --- */
.chips {
  display: flex;
  gap: 8px;
  margin: 26px -16px 6px;
  padding: 0 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  height: 38px;
  padding: 0 16px;
  border-radius: 19px;
  font-size: 15px;
  background: var(--high);
  box-shadow: var(--rim);
}
.chip.on { background: var(--accent); color: var(--on-accent); box-shadow: none; }

/* --- список --- */
.rows { display: flex; flex-direction: column; }
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}
.row .art { width: 56px; height: 56px; border-radius: 10px; cursor: pointer; }
.row .art .ph { font-size: 18px; }
.row .art .play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, .45);
  opacity: 0;
  transition: opacity .15s;
}
.row .art .play svg { width: 22px; height: 22px; }
.row.previewing .art .play { opacity: 1; }
.row-text { min-width: 0; flex: 1; }
.row-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  white-space: nowrap;
  overflow: hidden;
}
.row-title span { overflow: hidden; text-overflow: ellipsis; }
.row.now .row-title { color: var(--accent); }
.row-sub {
  margin-top: 2px;
  color: var(--sub);
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row.done { opacity: .5; }
.b18 {
  flex: none;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 4px;
  color: var(--danger);
  box-shadow: inset 0 0 0 1px var(--danger);
}
.tag {
  flex: none;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .6px;
  padding: 2px 6px;
  border-radius: 6px;
  background: #fff;
  color: #000;
}
.vote {
  flex: none;
  min-width: 58px;
  height: 36px;
  padding: 0 12px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 700;
  font-size: 15px;
  background: var(--high);
  box-shadow: var(--rim);
  color: var(--sub);
  transition: transform .12s, background .2s, color .2s;
}
.vote svg { width: 17px; height: 17px; }
.vote.on { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.vote:active { transform: scale(.9); }
.vote.static { background: none; box-shadow: none; cursor: default; }
.more {
  flex: none;
  width: 30px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--sub);
}
.more svg { width: 20px; height: 20px; }

.empty {
  text-align: center;
  color: var(--sub);
  padding: 40px 20px;
  font-size: 15px;
}

/* --- мини-плеер --- */
.mini {
  position: fixed;
  z-index: 5;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  max-width: 616px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px 10px 8px;
  border-radius: var(--r-l);
  background: rgba(28, 28, 30, .82);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  box-shadow: var(--rim), 0 10px 30px rgba(0, 0, 0, .5);
}
.mini-art { width: 44px; height: 44px; border-radius: 10px; }
.mini-text { min-width: 0; flex: 1; }
.mini-title, .mini-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-title { font-size: 15px; }
.mini-sub { font-size: 13px; color: var(--sub); }
.mini-btn { width: 40px; height: 40px; display: grid; place-items: center; }
.mini-btn svg { width: 26px; height: 26px; }
.mini-bar {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 4px;
  height: 2px;
  border-radius: 1px;
  background: rgba(255, 255, 255, .15);
  overflow: hidden;
}

/* --- меню трека --- */
.sheet-wrap {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(0, 0, 0, .55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet {
  width: 100%;
  max-width: 640px;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  background: var(--high);
  box-shadow: var(--rim);
  animation: up .2s ease-out;
}
@keyframes up { from { transform: translateY(30px); opacity: .5; } }
.sheet-head { display: flex; align-items: center; gap: 12px; padding: 4px 4px 14px; }
.sheet-art { width: 52px; height: 52px; border-radius: 10px; }
.sheet-title { font-size: 17px; }
.sheet-sub { color: var(--sub); font-size: 14px; }
.sheet-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 15px 14px;
  border-radius: var(--r-m);
  font-size: 17px;
}
.sheet-item:active { background: var(--press); }
.sheet-item.danger { color: var(--danger); }
.sheet-item.muted { color: var(--sub); }

.toast {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: calc(90px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 10px 16px;
  border-radius: var(--r-m);
  background: rgba(44, 44, 46, .95);
  font-size: 14px;
  box-shadow: var(--rim);
}

/* --- плеер --- */
#player { max-width: 1100px; padding-top: 8px; }
.pl-bg {
  position: fixed;
  inset: -80px;
  z-index: -1;
  background-size: cover;
  background-position: center;
  filter: blur(70px) saturate(1.3) brightness(.55);
  transition: background-image .8s;
}
.pl-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, .15), #000 85%);
}
.pl-top {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 8px;
  padding: 4px 0 14px;
  text-align: center;
}
.pl-net { font-size: 12px; color: var(--sub); text-align: right; white-space: nowrap; }
.pl-net.bad { color: var(--danger); }
.pl-grid { display: grid; gap: 28px; }
.pl-now { max-width: 480px; width: 100%; margin: 0 auto; }
.pl-art {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--r-l);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
}
.pl-art .ph { font-size: 96px; }
.pl-info { display: flex; align-items: center; gap: 12px; margin-top: 26px; }
.pl-meta { min-width: 0; flex: 1; }
.pl-title {
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -.4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pl-artist { color: var(--sub); font-size: 17px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-votes { flex: none; display: flex; align-items: center; gap: 6px; color: var(--accent); font-weight: 700; }
.pl-votes svg { width: 22px; height: 22px; }
.pl-bar {
  margin-top: 22px;
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .2);
  overflow: hidden;
}
.pl-bar i { background: #fff; }
.pl-times { display: flex; justify-content: space-between; margin-top: 8px; font-size: 13px; color: var(--sub); font-variant-numeric: tabular-nums; }
.pl-controls { display: flex; align-items: center; justify-content: center; gap: 40px; margin-top: 18px; }
.ctl { width: 52px; height: 52px; display: grid; place-items: center; color: #fff; }
.ctl svg { width: 30px; height: 30px; }
.ctl-main { width: 76px; height: 76px; border-radius: 50%; background: #fff; color: #000; transition: transform .12s; }
.ctl-main:active, .ctl:active { transform: scale(.92); }
.ctl-main svg { width: 34px; height: 34px; }
.pills { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 26px; }
.pill {
  height: 40px;
  padding: 0 16px;
  border-radius: 20px;
  font-size: 15px;
  background: rgba(255, 255, 255, .08);
  box-shadow: var(--rim);
}
.pill.on { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.pl-queue .section { margin-top: 0; }
.pl-start {
  position: fixed;
  inset: 0;
  z-index: 15;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, .72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.pl-start-box { max-width: 420px; text-align: center; }
.pl-start-title { margin-top: 10px; font-size: 32px; font-weight: 500; letter-spacing: -.5px; }
.pl-start-text { margin-top: 10px; color: var(--sub); font-size: 16px; line-height: 1.45; }
.big-btn {
  margin-top: 26px;
  height: 56px;
  padding: 0 40px;
  border-radius: 28px;
  font-size: 18px;
  font-weight: 700;
  background: var(--accent);
  color: var(--on-accent);
}

@media (min-width: 900px) {
  .pl-grid { grid-template-columns: minmax(360px, 460px) 1fr; align-items: start; gap: 56px; }
  .pl-now { margin: 0; }
  .pl-queue { max-height: calc(100vh - 110px); overflow-y: auto; padding-right: 6px; }
}
