/* В духе iOS: размытая обложка на весь экран, «матовое стекло», системный шрифт */
:root {
  --glass: rgba(255, 255, 255, .10);
  --glass-strong: rgba(255, 255, 255, .16);
  --glass-hover: rgba(255, 255, 255, .20);
  --edge: rgba(255, 255, 255, .18);
  --sep: rgba(255, 255, 255, .12);
  --text: #fff;
  --muted: rgba(235, 235, 245, .62);
  --faint: rgba(235, 235, 245, .32);
  --accent: #ff375f;                   /* розово-красный, как системный акцент iOS */
  --danger: #ff6961;
  --discord: #5865f2;
  --tg: #2aabee;
  --blur: blur(28px) saturate(180%);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--text); background: #1c1c1e;
  font: 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; letter-spacing: -.01em;
}
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: #fff; }
:focus-visible { outline: 2px solid rgba(255,255,255,.85); outline-offset: 2px; border-radius: 10px; }
svg { display: block; }

/* ── фон ── */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: #1c1c1e; }
.bg-img {
  position: absolute; inset: -12%; background: center/cover no-repeat;
  filter: blur(70px) saturate(1.7) brightness(.85); transform: scale(1.15);
  opacity: 0; transition: opacity 1.2s ease;
}
.bg-img.show { opacity: 1; }
.bg-img.empty {
  background:
    radial-gradient(40% 50% at 20% 25%, #ff375f 0, transparent 70%),
    radial-gradient(45% 55% at 85% 20%, #5e5ce6 0, transparent 70%),
    radial-gradient(50% 60% at 60% 95%, #0a84ff 0, transparent 70%), #1c1c1e;
  filter: blur(60px) saturate(1.3);
}
.bg-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.25), rgba(0,0,0,.55)); }

/* стекло */
.glass, .top, .deck, .panel, .pop, .dlg, .toast, .login-box, .tabs {
  background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: .5px solid var(--edge);
}

/* ── вход ── */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-box { width: 100%; max-width: 380px; display: grid; gap: 14px; justify-items: center; text-align: center;
  padding: 32px 24px 26px; border-radius: 28px; box-shadow: 0 30px 60px rgba(0,0,0,.35); }
.login-mark { width: 64px; height: 64px; }
.login-mark circle { fill: rgba(255,255,255,.18); }
.login-mark .hole { fill: #fff; }
.login-mark .groove { fill: none; stroke: rgba(255,255,255,.35); stroke-width: 2; }
.login h1 { font-size: 28px; line-height: 1.15; font-weight: 700; margin: 4px 0 0; letter-spacing: -.02em; }
.login-guild { margin: 0 0 8px; color: var(--muted); }
.btn-login {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 14px 16px;
  border-radius: 14px; color: #fff; text-decoration: none; font-weight: 600; font-size: 16px;
}
.btn-login svg { width: 22px; height: 22px; }
.btn-login.discord { background: var(--discord); }
.btn-login.tg { background: var(--tg); }
.btn-login:active { transform: scale(.98); }
.login-hint { margin: 0; color: var(--muted); font-size: 13px; }

/* ── шапка ── */
.top {
  display: flex; align-items: center; gap: 12px; padding: 10px 20px; border-width: 0 0 .5px;
  position: sticky; top: 0; z-index: 5; background: rgba(30, 30, 32, .45);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none;
  font-weight: 700; font-size: 19px; letter-spacing: -.02em; }
.brand svg { width: 28px; height: 28px; }
.brand circle { fill: rgba(255,255,255,.2); }
.brand .hole { fill: #fff; }
.chan { position: relative; margin-left: auto; }
.chan-btn {
  display: flex; align-items: center; gap: 8px; background: var(--glass-strong); border: .5px solid var(--edge);
  padding: 7px 14px; border-radius: 999px; max-width: 46vw; font-weight: 500;
}
.chan-btn svg { width: 18px; height: 18px; flex: none; }
.chan-btn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chan-btn.off { color: var(--muted); }
.pop {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 250px; background: rgba(44, 44, 46, .7);
  border-radius: 16px; padding: 6px; box-shadow: 0 20px 50px rgba(0,0,0,.45); z-index: 10;
}
.pop button {
  width: 100%; display: flex; justify-content: space-between; gap: 12px; text-align: left; background: none;
  border: 0; padding: 10px 12px; border-radius: 10px;
}
.pop button:hover { background: var(--glass-hover); }
.pop button.on { font-weight: 600; }
.pop button.on::before { content: "✓"; margin-right: -4px; }
.pop .people { color: var(--muted); font-size: 13px; margin-left: auto; }
.pop hr { border: 0; border-top: .5px solid var(--sep); margin: 4px 8px; }
.me { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.me img { width: 28px; height: 28px; border-radius: 50%; }
.me #meName { max-width: 140px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logout { color: var(--muted); text-decoration: none; }
.logout:hover { color: #fff; }

/* ── раскладка ── */
.layout {
  display: grid; grid-template-columns: minmax(300px, 410px) 1fr; gap: 24px;
  max-width: 1180px; margin: 0 auto; padding: 24px 20px 40px; align-items: start;
}
.deck { position: sticky; top: 78px; display: grid; gap: 14px; padding: 20px; border-radius: 28px;
  box-shadow: 0 30px 60px rgba(0,0,0,.25); }
.panel { min-width: 0; border-radius: 28px; padding: 14px; box-shadow: 0 30px 60px rgba(0,0,0,.2); }

/* ── что играет ── */
.cover {
  aspect-ratio: 1; width: 100%; border-radius: 14px; overflow: hidden; background: rgba(255,255,255,.08);
  box-shadow: 0 18px 40px rgba(0,0,0,.45); transition: transform .45s cubic-bezier(.2,.8,.2,1);
}
.cover.paused { transform: scale(.86); }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-empty {
  width: 100%; height: 100%; display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(255,255,255,.14), rgba(255,255,255,.04));
}
.cover-empty::after { content: "♪"; font-size: 72px; color: rgba(255,255,255,.35); }
.np-title { font-size: 22px; line-height: 1.2; font-weight: 700; margin: 4px 0 0; letter-spacing: -.02em; overflow-wrap: anywhere; }
.np-title a { color: inherit; text-decoration: none; }
.np-title a:hover { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.np-artist { margin: 2px 0 0; color: var(--muted); font-size: 18px; letter-spacing: -.015em; }
.np-meta { margin: 6px 0 0; color: var(--faint); font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.np-meta .src { color: var(--muted); }
.np-loading { margin: 6px 0 0; color: var(--muted); font-size: 14px; }

/* полоса прогресса как в iOS */
.meter { padding: 10px 0 4px; cursor: pointer; touch-action: none; }
.meter.off { cursor: default; }
.bar { position: relative; height: 6px; border-radius: 3px; background: rgba(255,255,255,.22); transition: height .15s; }
.meter:not(.off):hover .bar, .meter:not(.off):active .bar { height: 10px; border-radius: 5px; }
.fill { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; background: rgba(255,255,255,.85); }
.knob { display: none; }
.times { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; font-weight: 500;
  font-variant-numeric: tabular-nums; margin-top: -6px; }

.controls { display: flex; align-items: center; justify-content: space-evenly; padding: 2px 0; }
.ctl { width: 56px; height: 56px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center;
  transition: background .15s, transform .1s; }
.ctl svg { width: 30px; height: 30px; fill: #fff; }
.ctl:hover { background: rgba(255,255,255,.1); }
.ctl:active { transform: scale(.9); }
.ctl.play { width: 72px; height: 72px; }
.ctl.play svg { width: 46px; height: 46px; }
.ctl[data-act="stop"] svg { width: 22px; height: 22px; fill: var(--muted); }

.row2 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.vol { display: flex; align-items: center; gap: 10px; flex: 1 1 100%; color: var(--muted); padding: 2px 0 6px; }
.vol svg { width: 20px; height: 20px; flex: none; }
.vol output { width: 42px; text-align: right; font-variant-numeric: tabular-nums; font-size: 12px; font-weight: 500; }
.vol input {
  --p: 50%; flex: 1; height: 6px; border-radius: 3px; -webkit-appearance: none; appearance: none; cursor: pointer;
  background: linear-gradient(90deg, rgba(255,255,255,.85) var(--p), rgba(255,255,255,.22) var(--p));
}
.vol input::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.vol input::-moz-range-thumb { width: 22px; height: 22px; border: 0; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.chip {
  background: var(--glass); border: .5px solid var(--edge); border-radius: 999px; padding: 7px 14px; font-size: 14px;
  font-weight: 500; transition: background .15s;
}
.chip:hover { background: var(--glass-hover); }
.chip.on { background: #fff; color: #000; border-color: #fff; }
.chip.accent { margin-left: auto; background: var(--accent); border-color: var(--accent); color: #fff; }
.station {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 12px; padding: 10px 14px;
  background: rgba(255,255,255,.08); border-radius: 14px; font-size: 14px;
}

/* ── вкладки: сегментный переключатель ── */
.tabs { display: flex; gap: 2px; padding: 3px; border-radius: 12px; margin-bottom: 14px; overflow-x: auto;
  scrollbar-width: none; background: rgba(118, 118, 128, .24); border: 0; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  flex: 1; background: none; border: 0; padding: 7px 12px; border-radius: 9px; font-weight: 600; font-size: 14px;
  white-space: nowrap; color: rgba(255,255,255,.85); transition: background .2s;
}
.tabs button[aria-selected="true"] { background: rgba(255,255,255,.28); color: #fff; box-shadow: 0 3px 8px rgba(0,0,0,.18); }
.count { color: var(--muted); font-weight: 500; font-size: 13px; }

/* сгруппированные списки, как в «Настройках» */
.list { list-style: none; margin: 0; padding: 0; border-radius: 16px; overflow: hidden; background: rgba(255,255,255,.06); }
.list:empty { display: none; }
.item {
  display: grid; grid-template-columns: auto 48px 1fr auto; align-items: center; gap: 12px; padding: 8px 12px;
  position: relative;
}
.item + .item::before { content: ""; position: absolute; top: 0; left: 84px; right: 0; border-top: .5px solid var(--sep); }
.item.noimg + .item.noimg::before { left: 50px; }
.item:hover { background: rgba(255,255,255,.06); }
.item .thumb { width: 48px; height: 48px; border-radius: 8px; background: rgba(255,255,255,.1) center/cover no-repeat;
  box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.item .txt { min-width: 0; }
.item .t1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.item .t2 { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .acts { display: flex; gap: 2px; }
.item .num { width: 22px; text-align: center; color: var(--muted); font-size: 15px; font-variant-numeric: tabular-nums; }
.item.noimg { grid-template-columns: auto 1fr auto; }
.list > .hint { padding: 12px 14px; margin: 0; }
.ib {
  width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center;
  color: var(--muted);
}
.ib svg { width: 19px; height: 19px; fill: currentColor; }
.ib:hover { background: rgba(255,255,255,.12); color: #fff; }
.ib.go { color: #fff; }
.handle { cursor: grab; touch-action: none; color: var(--faint); width: 22px; display: grid; place-items: center; }
.handle svg { width: 16px; height: 16px; fill: currentColor; }
.queue .item { transition: transform .15s; }
.queue .item.drag { background: rgba(255,255,255,.18); box-shadow: 0 12px 30px rgba(0,0,0,.35); z-index: 2;
  transition: none; border-radius: 12px; -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }

.empty p, .hint { color: var(--muted); max-width: 60ch; }
.empty p { margin: 18px 6px; }
.tab-foot { margin-top: 12px; text-align: right; }
.link { background: none; border: 0; color: #fff; padding: 0; font-weight: 500; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.link.danger { color: var(--danger); }

.search { display: flex; gap: 8px; }
.search input, .stack input {
  flex: 1; min-width: 0; padding: 10px 14px; border-radius: 12px; border: 0; outline: none;
  background: rgba(118, 118, 128, .24);
}
.search input::placeholder, .stack input::placeholder { color: var(--faint); }
.search input:focus, .stack input:focus { background: rgba(118, 118, 128, .36); }
.btn { padding: 10px 18px; border-radius: 12px; border: 0; background: #fff; color: #000; font-weight: 600; }
.btn:active { transform: scale(.97); }
.btn.ghost { background: var(--glass-strong); color: #fff; }
.srcs { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 12px; }
.sub { font-size: 20px; font-weight: 700; letter-spacing: -.02em; margin: 22px 4px 8px; }

/* подборки */
.mixtop { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
.bigmix {
  text-align: left; padding: 18px; border-radius: 18px; border: 0; color: #fff; min-height: 96px;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 2px;
  background: linear-gradient(135deg, #ff375f, #bf5af2);
}
.bigmix:nth-child(2) { background: linear-gradient(135deg, #0a84ff, #5e5ce6); }
.bigmix b { font-size: 20px; letter-spacing: -.02em; }
.bigmix span { color: rgba(255,255,255,.8); font-size: 13px; }
.bigmix:active { transform: scale(.98); }
.mixgroup { margin-bottom: 20px; }
.mixgroup h3 { font-size: 20px; font-weight: 700; letter-spacing: -.02em; margin: 0 4px 10px; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.kids { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; margin: 2px 0 6px; background: rgba(255,255,255,.06);
  border-radius: 14px; width: 100%; }
.chip.more::after { content: " ›"; color: var(--muted); }
.chip.more[aria-expanded="true"]::after { content: " ⌄"; }

.addurl { margin-top: 18px; padding: 0 4px; }
.addurl summary { cursor: pointer; color: var(--muted); }
.stack { display: grid; gap: 8px; margin-top: 10px; max-width: 460px; }

/* админ */
.admin { display: grid; gap: 22px; }
.admin h3 { font-size: 20px; font-weight: 700; letter-spacing: -.02em; margin: 0 4px 8px; }
.admin .box { background: rgba(255,255,255,.06); border-radius: 16px; padding: 14px 16px; }
.admin .box > p:first-child { margin-top: 0; }
.admin .status { white-space: pre-wrap; }
.admin pre { white-space: pre-wrap; margin: 0; font-size: 12.5px; color: var(--muted); max-height: 340px; overflow: auto; }
.admin .row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.admin table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin td { padding: 9px 4px; border-top: .5px solid var(--sep); vertical-align: middle; }
.admin tr:first-child td { border-top: 0; }
.admin td:last-child { text-align: right; }
.admin .muted { color: var(--muted); }
.copy { display: flex; gap: 8px; margin-top: 10px; }
.copy input { flex: 1; min-width: 0; padding: 9px 12px; border-radius: 10px; border: 0; background: rgba(118,118,128,.24); }

/* окно «что играет» и уведомления */
.dlg {
  border-radius: 22px; background: rgba(44, 44, 46, .72); color: var(--text);
  max-width: 440px; width: calc(100% - 32px); padding: 22px; box-shadow: 0 30px 70px rgba(0,0,0,.5);
}
.dlg::backdrop { background: rgba(0,0,0,.35); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.dlg #songBody { white-space: pre-wrap; margin-bottom: 16px; }
.dlg form { display: flex; justify-content: flex-end; }
.toast {
  position: fixed; left: 50%; top: 14px; transform: translate(-50%, -30px); opacity: 0; pointer-events: none;
  background: rgba(44, 44, 46, .75); padding: 11px 18px; border-radius: 999px; font-weight: 500;
  max-width: calc(100% - 32px); transition: opacity .25s, transform .35s cubic-bezier(.2,.8,.2,1); z-index: 20;
  box-shadow: 0 12px 30px rgba(0,0,0,.35);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { color: #ffb4ae; }

/* браузеры без размытия — плотнее, чтобы читалось */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .top, .deck, .panel, .pop, .dlg, .toast, .login-box { background: rgba(40, 40, 44, .92); }
}

/* ── телефон ── */
@media (max-width: 820px) {
  .top { padding: 8px 14px; padding-top: max(8px, env(safe-area-inset-top)); }
  .brand span { display: none; }
  .me #meName { display: none; }
  .layout { grid-template-columns: 1fr; gap: 14px; padding: 12px 12px 32px; }
  .deck { position: static; padding: 16px; border-radius: 24px; }
  .deck .cover { width: min(78vw, 320px); justify-self: center; }
  .np-title { font-size: 21px; }
  .np-artist { font-size: 17px; }
  .chip.accent { margin-left: 0; }
  .panel { padding: 10px; border-radius: 24px; }
  .mixtop { grid-template-columns: 1fr 1fr; }
  .bigmix { min-height: 84px; padding: 14px; }
  .bigmix b { font-size: 17px; }
  .item { gap: 10px; padding: 8px 8px; }
  .item + .item::before { left: 76px; }
  .tabs button { padding: 7px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
