/* Ki — Liquid Glass поверх живого ASCII-поля. Палитра Glacier Blue,
   под музыку акцент (--acc) берётся из обложки трека.
   Сетка 4px, веса 400/500/600, одна кривая анимации. */

:root {
  --navy: #0A1F44;
  --deep: #0D3E7C;
  --blue: #1579E6;
  --sky: #5BAFF9;
  --ice: #B9DEFF;
  --frost: #EAF6FF;
  --night: #020814;
  --ink: var(--frost);
  --ink-2: rgba(234, 246, 255, 0.74);
  --ink-3: rgba(234, 246, 255, 0.5);
  --acc: 91 175 249;          /* акцент тройкой RGB, меняется под обложку */
  --accent: rgb(var(--acc));
  --font: "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont, Inter, "Segoe UI", system-ui, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --gutter: clamp(16px, 2.2vw, 28px);
}

* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }

body {
  min-height: 100svh;
  overflow: hidden;
  color: var(--ink);
  font: 400 16px/1.45 var(--font);
  background:
    radial-gradient(22% 18% at 0% 24%, rgba(91, 175, 249, 0.42), transparent 70%),
    radial-gradient(22% 18% at 100% 24%, rgba(91, 175, 249, 0.42), transparent 70%),
    radial-gradient(22% 18% at 0% 70%, rgba(21, 121, 230, 0.38), transparent 70%),
    radial-gradient(22% 18% at 100% 70%, rgba(21, 121, 230, 0.38), transparent 70%),
    radial-gradient(ellipse 60% 55% at 50% 48%, rgba(13, 62, 124, 0.55) 0%, transparent 72%),
    linear-gradient(180deg, var(--navy) 0%, #061331 45%, var(--night) 100%);
  background-color: var(--night);
  -webkit-font-smoothing: antialiased;
  touch-action: none;
}

::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
button { font: inherit; color: inherit; }
.defs { position: absolute; }

/* ---------- фон ---------- */
.backdrop { position: fixed; inset: 0; pointer-events: none; }
.bd {
  position: absolute;
  inset: -10%;
  background-size: cover;
  background-position: center;
  filter: blur(56px) saturate(1.5) brightness(0.62);
  opacity: 0;
  transform: scale(1.08);
  transition: opacity 1.4s var(--ease);
  will-change: opacity;
}
.bd.on { opacity: 1; }
.bd-shade {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 70% at 50% 45%, rgba(2, 8, 20, 0.05), rgba(2, 8, 20, 0.55));
  opacity: 0;
  transition: opacity 1.4s var(--ease);
}
.cover-on .bd-shade { opacity: 1; }

#field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  transition: opacity 1.2s var(--ease);
}
.intro #field { opacity: 0; }

/* ---------- liquid glass ---------- */
.glass {
  --tint: rgba(255, 255, 255, 0.05);
  --rim-a: rgba(234, 246, 255, 0.95);
  --rim-b: rgba(185, 222, 255, 0.6);
  --glow: rgb(var(--acc) / 0.3);
  position: relative;
  isolation: isolate;
  background: var(--tint);
  -webkit-backdrop-filter: blur(14px) saturate(210%) brightness(1.12);
  backdrop-filter: blur(14px) saturate(210%) brightness(1.12);
  backdrop-filter: url(#refract) blur(12px) saturate(210%) brightness(1.12);
  box-shadow:
    inset 0 0 14px rgba(255, 255, 255, 0.07),
    inset 0 -14px 22px -14px var(--glow),
    0 6px 20px rgba(0, 0, 0, 0.16);
}
.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1.5px;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(135deg,
    var(--rim-a) 0%, rgba(255, 255, 255, 0.18) 28%,
    rgba(255, 255, 255, 0.04) 55%, rgba(255, 255, 255, 0.14) 75%, var(--rim-b) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.glass::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: -1;
  background: radial-gradient(90% 70% at 30% 0%, rgba(255, 255, 255, 0.13), transparent 60%);
}
.glass-accent {
  --tint: rgb(var(--acc) / 0.5);
  --rim-a: rgba(234, 246, 255, 1);
  --rim-b: rgba(185, 222, 255, 0.85);
  --glow: rgb(var(--acc) / 0.65);
}

/* ---------- карточка канала (как профиль в Telegram) ---------- */
.chan {
  position: fixed;
  top: var(--gutter);
  left: var(--gutter);
  z-index: 5000;
  width: min(340px, calc(100% - var(--gutter) * 2));
  border-radius: 28px;
  overflow: hidden;
}
.chan-head {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px 12px 12px;
  border: 0;
  text-align: left;
  cursor: pointer;
  background: rgb(var(--acc) / 0.28);
  transition: background-color 1.2s var(--ease);
}
.chan-avatar {
  width: 56px;
  height: 56px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 2px rgba(234, 246, 255, 0.5), 0 0 24px rgb(var(--acc) / 0.6);
}
.chan-names { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.chan-title {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chan-count { font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; }

.chan-body {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows .35s var(--ease);
}
.chan-body > * { min-height: 0; }
.chan.closed .chan-body { grid-template-rows: 0fr; }
.chan-body-inner { overflow: hidden; }
.chan-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
}
.chan-row + .chan-row { padding-top: 0; }
.chan-text { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.chan-link {
  color: var(--sky);
  font-size: 15px;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chan-link:hover { text-decoration: underline; }
.chan-desc { font-size: 15px; line-height: 1.4; white-space: pre-line; overflow-wrap: anywhere; }
.chan-desc a { color: var(--sky); text-decoration: none; }
.chan-desc a:hover { text-decoration: underline; }
.chan-cap { font-size: 13px; color: var(--ink-3); }
.chan-qr {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--sky);
  cursor: pointer;
  transition: background-color .2s var(--ease), transform .15s var(--ease);
}
.chan-qr:hover { background: rgba(255, 255, 255, 0.1); }
.chan-qr:active { transform: scale(.92); }
.chan-qr svg { width: 22px; height: 22px; fill: currentColor; }

/* ---------- QR ---------- */
.qr {
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
  max-width: min(420px, 86vw);
}
.qr img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 32px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}
.qr::backdrop {
  background: rgba(2, 8, 20, 0.55);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}
.qr[open] { animation: qr-in .45s var(--ease); }
.qr[open]::backdrop { animation: fade-in .45s var(--ease); }
.qr.closing { animation: qr-out .3s var(--ease) forwards; }
.qr.closing::backdrop { animation: fade-out .3s var(--ease) forwards; }
@keyframes qr-in { from { opacity: 0; transform: translateY(16px) scale(.9); } }
@keyframes qr-out { to { opacity: 0; transform: translateY(8px) scale(.94); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
.qr-close {
  position: absolute;
  top: -16px;
  right: -16px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 22px;
  cursor: pointer;
}
.qr-close svg { width: 20px; height: 20px; fill: currentColor; }

/* ---------- сцена ---------- */
.stage {
  position: fixed;
  inset: 0;
  z-index: 10;
  cursor: grab;
}
.stage.dragging { cursor: grabbing; }
.world { position: absolute; inset: 0; }

.core, .dm, .sub {
  position: absolute;
  left: 0;
  top: 0;
  will-change: transform, opacity;
}

/* стеклянная линза */
.bubble {
  position: relative;
  display: block;
  border-radius: 50%;
  overflow: hidden;
  background: #061331;
}
.bubble img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
  /* жёсткий круг: картинка никогда не вылезает за сферу, даже при масштабе и наведении */
  clip-path: circle(50%);
  user-select: none;
  -webkit-user-drag: none;
}
.bubble::before,
.bubble::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
}
.bubble::before {
  z-index: 3;
  padding: 2px;
  background: linear-gradient(135deg,
    rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.2) 28%,
    rgba(255, 255, 255, 0.04) 55%, rgba(255, 255, 255, 0.16) 75%, rgba(185, 222, 255, 0.85) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.bubble::after {
  z-index: 2;
  background:
    radial-gradient(40% 22% at 30% 20%, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 70%),
    radial-gradient(60% 30% at 50% 100%, rgb(var(--acc) / 0.5), rgb(var(--acc) / 0) 70%),
    radial-gradient(circle at 50% 45%, rgba(0, 0, 0, 0) 58%, rgba(0, 0, 0, 0.32) 100%);
}

/* аура канала: турбулентное пламя на WebGL (рисует app.js) */
.aura {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
  will-change: transform;
}
.no-gl .core { box-shadow: 0 0 0 3px rgb(var(--acc) / 0.5), 0 0 60px 14px rgb(var(--acc) / 0.5); }
.core {
  width: 200px;
  height: 200px;
  margin: -100px 0 0 -100px;
  padding: 0;
  border: 0;
  cursor: pointer;
  overflow: hidden;
}
.core img { border-radius: 50%; }
.core { border-radius: 50%; box-shadow: 0 0 0 2px rgb(var(--acc) / 0.55), 0 10px 40px rgba(0, 0, 0, 0.45); }
.dm-bubble { box-shadow: 0 0 0 2px rgb(var(--acc) / 0.5), 0 0 28px 4px rgb(var(--acc) / 0.45); }
.dm-glow {
  position: absolute;
  left: 50%;
  top: 70px;
  width: 300px;
  height: 300px;
  margin: -150px 0 0 -150px;
  border-radius: 50%;
  background: radial-gradient(circle, rgb(var(--acc) / 0.55) 0%, rgb(var(--acc) / 0.18) 38%, transparent 68%);
  pointer-events: none;
  will-change: transform, opacity;
}
.core::before, .core::after { border-radius: 50%; }

.dm {
  width: 140px;
  margin: -70px 0 0 -70px;
  transform-origin: 70px 70px; /* масштаб вокруг центра сферы, а не всего блока с подписью */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}
.dm-bubble {
  width: 140px;
  height: 140px;
  overflow: hidden;
  transition: transform .3s var(--ease);
}
.dm:hover .dm-bubble { transform: scale(1.06); }
.dm-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  line-height: 1.3;
  white-space: nowrap;
}
.dm-label b { font-weight: 600; color: var(--accent); }

/* подписчики */
.sub {
  width: var(--s);
  margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2);
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
  outline-offset: 4px;
}
.sub .bubble {
  width: var(--s);
  height: var(--s);
  flex: none;
  transition: transform .25s var(--ease);
}
.sub .bubble::before { padding: 1.5px; }
.sub:hover .bubble, .sub:focus-visible .bubble { transform: scale(1.12); }
.sub .name {
  margin-top: 8px;
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(4, 14, 36, 0.62);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  opacity: var(--lbl, 0);
  transition: opacity .25s var(--ease);
}

/* замазанный подписчик: мазок поверх фото, ник мозаикой */
.smear {
  position: absolute;
  inset: -18%;
  z-index: 4;
  background: url(assets/smear.png) center / contain no-repeat;
  transform: rotate(var(--rot, -12deg)) scale(1.05);
  pointer-events: none;
}
.sub.hidden .bubble { overflow: visible; background: radial-gradient(circle at 35% 30%, #2a5aa0, #0A1F44 75%); }
.sub.hidden .bubble img { display: none; }
.mosaic {
  display: inline-block;
  width: var(--mw, 64px);
  height: 12px;
  vertical-align: middle;
  border-radius: 3px;
  background:
    repeating-conic-gradient(rgba(234, 246, 255, 0.55) 0 25%, rgba(91, 175, 249, 0.35) 0 50%) 0 0 / 8px 8px,
    rgba(234, 246, 255, 0.2);
  filter: blur(0.4px);
}
.sub.hidden .name { opacity: 0.9; }

.card {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 4000;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 8px 20px 8px 8px;
  border-radius: 36px;
  pointer-events: none;
}
.card[hidden] { display: none; }
.card-pic { position: relative; width: 56px; height: 56px; flex: none; }
.card-pic img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }
.card-pic .smear { inset: -10%; }
.card-name { font-size: 15px; font-weight: 600; }
.card-user { font-size: 14px; color: var(--ink-2); }

/* ---------- камера ---------- */
.cam {
  position: fixed;
  right: var(--gutter);
  top: 50%;
  transform: translateY(-50%);
  z-index: 5000;
  display: flex;
  flex-direction: column;
  padding: 4px;
  border-radius: 28px;
}
.cam button {
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 24px;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background-color .2s var(--ease), transform .15s var(--ease);
}
.cam button:hover { background: rgba(255, 255, 255, 0.1); }
.cam button:active { transform: scale(.92); }
.cam svg, .ctl svg { width: 20px; height: 20px; fill: currentColor; }

.hint {
  position: fixed;
  left: 50%;
  bottom: calc(var(--gutter) + 160px);
  transform: translateX(-50%);
  z-index: 5000;
  padding: 8px 16px;
  border-radius: 18px;
  font-size: 13px;
  color: var(--ink-2);
  white-space: nowrap;
  pointer-events: none;
  transition: opacity .6s var(--ease);
}
.hint.gone { opacity: 0; }

.toast {
  position: fixed;
  left: 50%;
  top: var(--gutter);
  z-index: 5000;
  padding: 12px 20px;
  border-radius: 24px;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  max-width: calc(100% - 32px);
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transform: translate(-50%, -8px) scale(.96);
  transition: opacity .35s var(--ease), transform .35s var(--ease);
  pointer-events: none;
}
.toast.on { opacity: 1; transform: translate(-50%, 0) scale(1); }

/* ---------- плеер ---------- */
.player {
  position: fixed;
  left: 50%;
  bottom: var(--gutter);
  width: min(880px, calc(100% - var(--gutter) * 2));
  transform: translateX(-50%);
  z-index: 5000;
}
.scope {
  display: block;
  width: 100%;
  height: 84px;
  margin-bottom: 4px;
  pointer-events: none;
}
.bar {
  display: grid;
  grid-template-columns: 64px minmax(120px, 200px) auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 8px 16px 8px 8px;
  border-radius: 40px;
}
.cover {
  width: 64px;
  height: 64px;
  border-radius: 32px;
  object-fit: cover;
  background: var(--deep);
}
.now { min-width: 0; }
.now-title, .now-artist { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.now-title { font-size: 15px; font-weight: 600; }
.now-artist { font-size: 13px; color: var(--ink-2); }

.controls { display: flex; align-items: center; gap: 4px; }
.ctl {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 22px;
  background: transparent;
  cursor: pointer;
  transition: background-color .2s var(--ease), transform .15s var(--ease);
}
.ctl:hover { background: rgba(255, 255, 255, 0.1); }
.ctl:active { transform: scale(.9); }
.ctl-play { width: 52px; height: 52px; border-radius: 26px; color: #fff; background: var(--tint); }
.ctl-play:hover { --tint: rgb(var(--acc) / 0.65); background: var(--tint); }
.ctl-play svg { width: 22px; height: 22px; }
.ctl-play .i-pause, .playing .ctl-play .i-play { display: none; }
.playing .ctl-play .i-pause { display: block; }
.ctl-list {
  display: inline-flex;
  gap: 4px;
  width: auto;
  padding: 0 12px;
  font-size: 13px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.timeline { min-width: 0; }
.scrub {
  --p: 0%;
  position: relative;
  height: 20px;
  cursor: pointer;
  touch-action: none;
}
.scrub::before,
.scrub-fill {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  height: 4px;
  border-radius: 2px;
  transition: height .2s var(--ease), top .2s var(--ease);
}
.scrub::before { right: 0; background: rgba(234, 246, 255, 0.14); }
.scrub-fill {
  width: 0;
  background: linear-gradient(90deg, rgb(var(--acc) / 0.55), rgb(var(--acc)) 70%, #fff);
  box-shadow: 0 0 10px rgb(var(--acc) / 0.8), 0 0 2px rgb(var(--acc));
}
.scrub:hover::before, .scrub:hover .scrub-fill,
.scrub.active::before, .scrub.active .scrub-fill { top: 7px; height: 6px; border-radius: 3px; }
.scrub-knob {
  position: absolute;
  top: 3px;
  left: 0;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 4px rgb(var(--acc) / 0.25), 0 0 14px rgb(var(--acc) / 0.9);
  transform: scale(0);
  transition: transform .2s var(--ease);
}
.scrub:hover .scrub-knob, .scrub.active .scrub-knob, .scrub:focus-visible .scrub-knob { transform: scale(1); }
.scrub:focus-visible { outline: none; }
.times {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.tracklist {
  margin: 0 0 12px auto;
  width: min(420px, 100%);
  padding: 8px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(10, 22, 48, 0.82), rgba(4, 10, 24, 0.9));
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  backdrop-filter: blur(28px) saturate(160%);
  box-shadow:
    inset 0 0 0 1px rgba(234, 246, 255, 0.12),
    inset 0 1px 0 rgba(234, 246, 255, 0.22),
    0 24px 60px rgba(0, 0, 0, 0.5);
  transform-origin: 100% 100%;
  animation: tl-in .32s var(--ease);
}
@keyframes tl-in { from { opacity: 0; transform: translateY(12px) scale(.97); } }
.tl-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 12px 12px 8px;
}
.tl-head h2 { font-size: 17px; font-weight: 600; }
.tl-count { font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.tl-list {
  list-style: none;
  padding: 4px 0;
  max-height: min(46vh, 432px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(234, 246, 255, 0.22) transparent;
  -webkit-mask: linear-gradient(transparent, #000 12px, #000 calc(100% - 16px), transparent);
  mask: linear-gradient(transparent, #000 12px, #000 calc(100% - 16px), transparent);
}
.tl-list::-webkit-scrollbar { width: 6px; }
.tl-list::-webkit-scrollbar-track { background: transparent; }
.tl-list::-webkit-scrollbar-thumb { background: rgba(234, 246, 255, 0.2); border-radius: 3px; }
.tl-list::-webkit-scrollbar-thumb:hover { background: rgba(234, 246, 255, 0.36); }
.tl-item {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 12px 8px 8px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background-color .2s var(--ease);
}
.tl-item:hover { background: rgba(234, 246, 255, 0.07); }
.tl-item[aria-current="true"] {
  background: linear-gradient(90deg, rgb(var(--acc) / 0.26), rgb(var(--acc) / 0.06));
  box-shadow: inset 0 0 0 1px rgb(var(--acc) / 0.35);
}
.tl-pic { position: relative; width: 44px; height: 44px; }
.tl-pic img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--deep);
  display: block;
}
.tl-eq {
  position: absolute;
  inset: 0;
  display: none;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  padding-bottom: 12px;
  border-radius: 12px;
  background: rgba(2, 8, 20, 0.55);
}
.tl-eq i { width: 4px; height: 6px; border-radius: 2px; background: #fff; box-shadow: 0 0 6px rgb(var(--acc)); }
.tl-item[aria-current="true"] .tl-eq { display: flex; }
.playing .tl-item[aria-current="true"] .tl-eq i { animation: eq .9s ease-in-out infinite alternate; }
.playing .tl-eq i:nth-child(2) { animation-delay: -.45s !important; animation-duration: .7s !important; }
.playing .tl-eq i:nth-child(3) { animation-delay: -.2s !important; animation-duration: 1.1s !important; }
@keyframes eq { from { height: 5px; } to { height: 20px; } }
.tl-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tl-title, .tl-artist { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-title { font-size: 15px; font-weight: 500; line-height: 1.3; }
.tl-item[aria-current="true"] .tl-title { color: #fff; font-weight: 600; }
.tl-artist { font-size: 13px; color: var(--ink-3); }
.tl-dur { font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* ---------- поиск по нику ---------- */
.find {
  position: fixed;
  left: var(--gutter);
  top: 50%;
  transform: translateY(-50%);
  z-index: 5200;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.find-btn {
  width: 56px;
  height: 56px;
  flex: none;
  border: 0;
  border-radius: 28px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform .15s var(--ease);
}
.find-btn svg { width: 22px; height: 22px; fill: currentColor; }
.find-btn:active { transform: scale(.92); }
.find-btn[aria-expanded="true"] { --tint: rgb(var(--acc) / 0.45); }
.find-panel {
  width: 300px;
  padding: 8px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(10, 22, 48, 0.85), rgba(4, 10, 24, 0.92));
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  backdrop-filter: blur(28px) saturate(160%);
  box-shadow: inset 0 0 0 1px rgba(234, 246, 255, 0.12), inset 0 1px 0 rgba(234, 246, 255, 0.22), 0 24px 60px rgba(0, 0, 0, 0.5);
  transform-origin: 0 28px;
  animation: find-in .28s var(--ease);
}
@keyframes find-in { from { opacity: 0; transform: translateX(-8px) scale(.96); } }
.find-field {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 40px;
  padding: 0 14px;
  border-radius: 20px;
  background: rgba(234, 246, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(234, 246, 255, 0.1);
}
.find-field:focus-within { box-shadow: inset 0 0 0 1.5px rgb(var(--acc) / 0.8), 0 0 16px rgb(var(--acc) / 0.25); }
.find-at { color: var(--ink-3); font-weight: 500; }
.find-field input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: 500 15px/1 var(--font);
}
.find-field input::placeholder { color: var(--ink-3); font-weight: 400; }
.find-field input::-webkit-search-cancel-button { display: none; }
.find-list { list-style: none; padding: 0; max-height: 300px; overflow-y: auto; scrollbar-width: thin; }
.find-list:not(:empty) { margin-top: 6px; }
.find-list button {
  display: grid;
  grid-template-columns: 36px 1fr;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 6px 8px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.find-list button:hover, .find-list [aria-selected="true"] button { background: rgb(var(--acc) / 0.22); }
.find-list img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.find-list b, .find-list small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.find-list b { font-size: 14px; font-weight: 600; }
.find-list small { font-size: 12px; color: var(--ink-3); }
.find-list mark { background: none; color: var(--accent); }
.find-empty { padding: 10px 12px; font-size: 13px; color: var(--ink-3); }

/* найденный подписчик */
.sub.found { z-index: 3500 !important; }
.sub.found .bubble { box-shadow: 0 0 0 3px #fff, 0 0 0 6px rgb(var(--acc)), 0 0 30px 8px rgb(var(--acc) / 0.7); }
.sub.found .bubble::after { animation: found 1.4s ease-out infinite; }
@keyframes found { 50% { opacity: .55; } }
.sub.found .name { background: rgb(var(--acc) / 0.85); color: #fff; }

/* ---------- телефон ---------- */
@media (max-width: 720px) {
  .chan { width: calc(100% - var(--gutter) * 2 - 64px); border-radius: 24px; }
  .chan-head { padding: 8px 12px 8px 8px; }
  .chan-avatar { width: 44px; height: 44px; }
  .chan-title { font-size: 16px; }
  .chan-count { font-size: 13px; }
  .cam { display: none; }
  .dm-label { display: none; }  /* сфера у канала маленькая — подпись не читалась бы */
  .find { top: var(--gutter); right: var(--gutter); left: auto; transform: none; flex-direction: column; align-items: flex-end; }
  .find-btn { width: 52px; height: 52px; }
  .find-panel { width: calc(100vw - var(--gutter) * 2); transform-origin: 100% 0; }
  .cam button { width: 44px; height: 44px; }
  .hint { display: none; }
  .scope { height: 56px; }
  .bar {
    grid-template-columns: 48px 1fr auto;
    grid-template-areas: "cover now controls" "time time list";
    gap: 4px 12px;
    border-radius: 28px;
    padding: 8px 12px 8px 8px;
  }
  .cover { grid-area: cover; width: 48px; height: 48px; }
  .now { grid-area: now; }
  .controls { grid-area: controls; }
  .controls #prev { display: none; }
  .timeline { grid-area: time; padding-left: 8px; }
  .ctl-list { grid-area: list; }
}

@media (prefers-reduced-motion: reduce) {
  #field, .bd, .bd-shade { transition: none; }
  .bd { transform: none; }
  .tracklist, .find-panel, .playing .tl-eq i { animation: none !important; }
  .qr[open], .qr.closing, .qr[open]::backdrop { animation: none; }
}
