/* ---------- віджет «зараз у плеєрі» ---------- */
.widget {
  position: relative; isolation: isolate; overflow: hidden;
  flex: 0 0 clamp(250px, 21vw, 320px); align-self: center; max-height: 100%; min-height: 0;
  --wr: 26px; border-radius: var(--wr); background: #e8f1f9;
  box-shadow: 0 30px 70px -34px rgba(20, 86, 143, .55), 0 2px 10px rgba(20, 86, 143, .1);
}
.widget__bgimg {
  position: absolute; z-index: -2; left: -30%; top: -30%; width: 160%; height: 160%; object-fit: cover;
  filter: blur(34px) saturate(1.4); opacity: 0; transition: opacity .7s var(--ease);
  pointer-events: none; user-select: none;
  /* Safari не обрізає заокругленням батька шар із filter — тому обрізаємо самі: видима частина = вікно віджета (відступ 30/160 = 18.75%) */
  clip-path: inset(18.75% round var(--wr));
}
.widget[data-state="ready"] .widget__bgimg { opacity: 1; }
.widget__veil { position: absolute; inset: 0; z-index: -1; background: rgba(255, 255, 255, .6); border-radius: inherit; }
.widget__in {
  display: flex; flex-direction: column; gap: clamp(8px, 1.7vh, 16px);
  padding: 16px 18px 18px;
}
.widget__head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; letter-spacing: .16em; text-transform: lowercase; opacity: .75;
}
.widget__art {
  position: relative; display: block; width: 100%;
  aspect-ratio: var(--ratio); max-height: clamp(110px, 32vh, 280px);
  border-radius: 14px; overflow: hidden;
  background: repeating-linear-gradient(135deg, rgba(238, 245, 251, .9) 0 8px, rgba(230, 240, 248, .9) 8px 16px);
  box-shadow: 0 14px 30px -18px rgba(20, 86, 143, .55);
  -webkit-tap-highlight-color: transparent;
}
.widget__art:disabled { cursor: default; }
.widget__art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: none; user-select: none; }
.widget[data-state="ready"] .widget__art img { display: block; }
.widget__empty {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center;
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase; line-height: 1.7; color: var(--ink-soft);
}
.widget[data-state="ready"] .widget__empty { display: none; }
.widget__art:not(:disabled):hover img { transform: scale(1.03); }
.widget__art img { transition: transform .6s var(--ease); }
.widget__meta { display: grid; grid-template-rows: auto auto; align-content: start; gap: 2px; min-width: 0; height: 70px; }   /* фіксована висота: довга/коротка назва не змінює розмір віджета */
.widget__meta b {
  font-size: 19px; line-height: 1.2; font-weight: 700; letter-spacing: .005em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.widget__meta span { font-size: 14px; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.widget[data-state="empty"] .widget__meta b { opacity: .45; font-weight: 600; }
.widget__seek { display: grid; gap: 0; }
.widget .seek { width: 100%; flex: none; }
.widget__times { display: flex; justify-content: space-between; font-size: 11px; font-variant-numeric: tabular-nums; opacity: .75; }
.widget__ctrl { display: flex; align-items: center; justify-content: center; gap: clamp(18px, 2vw, 28px); }
.wbtn { width: 44px; height: 44px; display: grid; place-items: center; }
.wbtn svg { width: 26px; height: 26px; fill: currentColor; }
.wbtn:hover:not(:disabled) { opacity: .6; }
.wbtn:disabled { opacity: .25; cursor: default; }
.wplay {
  width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ink); color: #fff; box-shadow: 0 10px 22px -10px rgba(20, 86, 143, .8);
  transition: transform .25s var(--ease), opacity .25s;
}
.wplay svg { width: 26px; height: 26px; fill: currentColor; grid-area: 1 / 1; }
.wplay .i-pause { display: none; }
.is-sound .wplay .i-play { display: none; }
.is-sound .wplay .i-pause { display: block; }
.wplay:hover:not(:disabled) { transform: scale(1.06); }
.wplay:disabled { opacity: .35; cursor: default; box-shadow: none; }
.widget__vol { width: 100%; }
.widget__vol .vol__range { flex: 1; width: auto; }
.widget .eq, .card .eq { display: inline-flex; width: 16px; height: 14px; align-items: flex-end; gap: 2px; }
.widget .eq u, .card .eq u { display: block; width: 3px; height: 25%; background: currentColor; text-decoration: none; }
.widget .eq u:nth-child(1), .card .eq u:nth-child(1) { height: 45%; }
.widget .eq u:nth-child(2), .card .eq u:nth-child(2) { height: 85%; }
.widget .eq u:nth-child(3), .card .eq u:nth-child(3) { height: 60%; }
.widget[data-state="empty"] .eq { visibility: hidden; }
.is-sound .widget .eq u, .is-sound .card.is-active .eq u { animation: m-eq .9s ease-in-out infinite; }
.is-sound .widget .eq u:nth-child(2), .is-sound .card.is-active .eq u:nth-child(2) { animation-delay: -.35s; }
.is-sound .widget .eq u:nth-child(3), .is-sound .card.is-active .eq u:nth-child(3) { animation-delay: -.7s; }
@media (max-height: 640px) { .widget__head, .widget__vol { display: none; } }
