/* ============================================================
   MiraStreet — плеер: компактная плашка «сейчас играет»
   справа сверху + выпадающий список треков.
   ============================================================ */

#player {
  position: fixed;
  right: 78px; /* слева от кнопки звука, не перекрывает фон по центру */
  top: max(14px, env(safe-area-inset-top)); /* на одной линии с кнопкой звука */
  z-index: 200;
  width: min(452px, calc(100vw - 106px));
  transition: opacity 0.25s ease-out, transform 0.25s ease-out;
}
/* внутри разделов плеер прячется — не перекрывает контент
   (музыка продолжает играть, управление вернётся на главной) */
body.section-open #player {
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
}

/* --- Плашка: обложка + бегущая строка + кнопки.
   Фон почти прозрачный — только лёгкое размытие --- */
#pl-bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px 8px;
  border-radius: 9px;
  /* почти невидимая плашка: фон не спорит с персонажами позади */
  background: rgba(10, 10, 13, 0.09);
  border: 1px solid rgba(201, 201, 204, 0.05);
  -webkit-backdrop-filter: blur(4px) saturate(1.08);
  backdrop-filter: blur(4px) saturate(1.08);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  transition: background 0.25s, border-color 0.25s;
}
#player:hover #pl-bar {
  background: rgba(10, 10, 13, 0.45);
  border-color: rgba(201, 201, 204, 0.22);
}

.pl-cover {
  width: 38px;
  height: 38px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  overflow: hidden;
  background: var(--bg-1);
  border: 1px solid rgba(201, 201, 204, 0.3);
  /* мягкое бордовое свечение — обложка выделяется */
  box-shadow:
    0 0 16px rgba(138, 30, 45, 0.45),
    0 0 42px rgba(138, 30, 45, 0.16),
    0 4px 12px rgba(0, 0, 0, 0.5);
  transition: box-shadow 0.3s;
}
#player.playing .pl-cover, .pl-cover:hover {
  box-shadow:
    0 0 20px rgba(138, 30, 45, 0.6),
    0 0 54px rgba(138, 30, 45, 0.22),
    0 4px 12px rgba(0, 0, 0, 0.5);
}
.pl-cover img { width: 100%; height: 100%; object-fit: cover; }

/* бегущая строка — читается на прозрачном фоне за счёт тени */
.pl-marquee {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-align: left;
  padding: 2px 0;
}
.pl-marquee-inner {
  display: inline-block;
  font-family: var(--font-sys);
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9), 0 0 18px rgba(138, 30, 45, 0.35);
}
/* едет, только если название не влезло, и с остановками по краям —
   иначе строку ловишь в середине и не можешь прочитать */
.pl-marquee-inner.scrolling {
  animation: pl-marquee var(--pl-time, 9s) ease-in-out infinite alternate;
}
@keyframes pl-marquee {
  0%, 22% { transform: translateX(0); }
  78%, 100% { transform: translateX(var(--pl-shift, 0)); }
}
.pl-marquee:hover .pl-marquee-inner { color: var(--text); }

/* эквалайзер: сегментные столбики (бас слева, верха справа).
   Он же кнопка в раздел «Наш музон» — места занимает много,
   пусть хотя бы ведёт куда-то. */
.pl-eq-btn {
  flex: none;
  padding: 0;
  line-height: 0;
  border-radius: 4px;
  transition: opacity 0.18s, filter 0.18s;
}
.pl-eq-btn:hover { filter: brightness(1.25); }
.pl-eq {
  width: 116px;
  height: 26px;
  display: block;
  opacity: 0.95;
  filter: drop-shadow(0 0 6px rgba(138, 30, 45, 0.35));
}

/* прогресс трека — по самому низу плашки */
.pl-progress {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 3px;
  height: 2px;
  border-radius: 1px;
  background: rgba(201, 201, 204, 0.14);
  overflow: hidden;
  pointer-events: none;
}
.pl-progress i {
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: left center;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--accent), var(--accent-hi));
  box-shadow: 0 0 6px rgba(138, 30, 45, 0.8);
}

/* кнопки */
.pl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex: none;
  color: var(--silver-hi);
  border: 1px solid rgba(201, 201, 204, 0.2);
  border-radius: 6px;
  background: rgba(10, 10, 13, 0.25);
  transition: color 0.15s, border-color 0.15s, box-shadow 0.15s;
  font-size: 12px;
}
.pl-btn:hover {
  color: var(--text);
  border-color: var(--silver-hi);
  box-shadow: 0 0 10px rgba(201, 201, 204, 0.15);
}

/* --- Выпадающий список --- */
#pl-drop {
  margin-top: 6px;
  padding: 8px;
  border-radius: 9px;
  background: rgba(10, 10, 13, 0.88);
  border: 1px solid rgba(201, 201, 204, 0.22);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
}

.pl-vol-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 6px 8px;
}
.pl-vol-label {
  font-family: var(--font-sys);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--silver);
  flex: none;
}
.pl-vol {
  flex: 1;
  height: 4px;
  appearance: none;
  -webkit-appearance: none;
  background: rgba(143, 143, 148, 0.4);
  border-radius: 2px;
  outline: none;
}
.pl-vol::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-hi);
  border: 1px solid rgba(255, 255, 255, 0.4);
}
.pl-vol::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-hi);
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.pl-list {
  max-height: min(44vh, 380px);
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pl-track {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 6px;
  border-radius: 7px;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
}
.pl-track:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(201, 201, 204, 0.2);
}
.pl-track.current {
  border-color: rgba(138, 30, 45, 0.55);
  background: rgba(122, 24, 38, 0.14);
}
.pl-track .pl-cover { width: 34px; height: 34px; }
.pl-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.pl-meta b {
  font-family: var(--font-sys);
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pl-meta i {
  font-style: normal;
  font-family: var(--font-sys);
  font-size: 11px;
  color: var(--silver);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pl-track.current .pl-tplay {
  color: var(--text);
  background: var(--accent);
  border-color: var(--accent-hi);
}

@media (max-width: 768px) {
  #player { right: 10px; top: 74px; width: min(300px, calc(100vw - 20px)); }
  /* на телефоне ховера нет — плашка всегда читаемая */
  #pl-bar { opacity: 1; background: rgba(10, 10, 13, 0.8); }
  .pl-btn { width: 34px; height: 34px; }
  .pl-list { max-height: 36vh; }
  /* на 300 px столбики съедали всё место, и от названия оставалась одна
     буква. Эквалайзер убираем, название переносим на свою строку */
  #pl-bar { flex-wrap: wrap; }
  .pl-eq-btn { display: none; }
  .pl-marquee { order: 5; flex-basis: 100%; padding-top: 2px; }
}
