/* Раздел «Для вас и Тренды»: редакционные витрины («Премьера», «Лучшие треки для вас»),
   новые релизы, двухколоночный чарт и полноэкранные редакционные плейлисты. */

.tr-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 6px 0 22px;
}
.tr-date-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
.tr-date {
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}
.tr-refresh { color: var(--ink-2); }
.tr-refresh:hover { color: var(--ink); }
.ibtn.spinning .ico { animation: spin .9s linear infinite; }
.tr-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---------- редакционные витрины («Премьера» и «Лучшие треки для вас») ---------- */
.ed-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.ed-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 20px 16px 16px;
  border-radius: 28px;
  overflow: hidden;
  cursor: pointer;
  min-width: 0;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.ed-card:hover {
  transform: translateY(-3px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .36),
    0 34px 70px -28px rgba(0, 0, 0, .95);
}
.ed-card:active { transform: scale(.988); }
.ed-card-glow {
  position: absolute !important;
  inset: 0;
  z-index: 1 !important;
  pointer-events: none;
  background:
    radial-gradient(85% 130% at 12% 50%, var(--c1, #ff6a2b), transparent 65%),
    radial-gradient(75% 120% at 92% 100%, var(--c2, #a82432), transparent 68%);
  opacity: .24;
  transition: opacity .35s var(--ease);
}
.ed-card:hover .ed-card-glow,
.ed-card.playing .ed-card-glow { opacity: .36; }

.ed-card-art {
  position: relative;
  width: 136px;
  height: 136px;
  flex: none;
  border-radius: 20px;
  overflow: hidden;
  background: #0b0b10;
  box-shadow: 0 22px 44px -18px rgba(0, 0, 0, .92), inset 0 0 0 1px rgba(255, 255, 255, .14);
}
.ed-card-art::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35);
  pointer-events: none;
}
.ed-card-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s var(--ease);
}
.ed-card:hover .ed-card-art img { transform: scale(1.045); }

.ed-card-play {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #000;
  background: #fff;
  box-shadow: 0 10px 26px -6px rgba(0, 0, 0, .75);
  opacity: .94;
  transform: scale(.96);
  transition: transform .28s var(--spring), opacity .2s, box-shadow .2s;
}
.ed-card-play .ico { width: 18px; height: 18px; }
.ed-card:hover .ed-card-play,
.ed-card.playing .ed-card-play { opacity: 1; transform: scale(1.04); box-shadow: 0 12px 30px -4px rgba(0, 0, 0, .85); }
.ed-card-play:active { transform: scale(.92) !important; }

.ed-card-eq {
  position: absolute;
  left: 10px;
  top: 10px;
  height: 22px;
  padding: 5px 7px;
  border-radius: 999px;
  background: rgba(8, 8, 12, .72);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
  display: none;
  align-items: flex-end;
  gap: 2.5px;
  pointer-events: none;
}
.ed-card-eq i {
  width: 2.5px;
  height: 100%;
  border-radius: 2px;
  background: #fff;
  transform-origin: 50% 100%;
  transform: scaleY(.35);
}
.ed-card.playing .ed-card-eq { display: flex; }
.ed-card.live .ed-card-eq i { animation: eq 1s ease-in-out infinite; }
.ed-card.live .ed-card-eq i:nth-child(2) { animation-delay: -.35s; }
.ed-card.live .ed-card-eq i:nth-child(3) { animation-delay: -.7s; }

.ed-card-body {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 6px;
  align-content: center;
}
.ed-card-kind {
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .01em;
}
.ed-card-title {
  font: 800 clamp(19px, 1.9vw, 24px)/1.12 var(--font-display);
  letter-spacing: -.025em;
  color: var(--ink);
}
.ed-card-sub {
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ed-card-artists {
  margin-top: 2px;
  color: var(--ink-3);
  font-size: 12.5px;
}

.ed-sk-card { height: 168px; border-radius: 28px; }

/* ---------- карточки новых релизов ---------- */
.rel-tag {
  position: absolute;
  left: 9px;
  top: 9px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .01em;
  color: rgba(255, 255, 255, .94);
  background: rgba(8, 8, 12, .64);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14);
  pointer-events: none;
}
.rel-chips { margin: 4px 0 22px; }

/* ---------- двухколоночный чарт на экране «Тренды» ---------- */
.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(5, auto);
  grid-auto-flow: column;
  gap: 2px 24px;
}
.chart-row {
  display: grid;
  grid-template-columns: 30px 46px minmax(0, 1fr) 32px 44px 30px;
  align-items: center;
  gap: 11px;
  height: 60px;
  padding: 0 8px 0 4px;
  border-radius: 15px;
  cursor: pointer;
  transition: background .14s;
}
.chart-row:hover,
.chart-row:focus-visible,
.chart-row.menu-open { background: var(--fill-1); }
.chart-row.playing {
  background: linear-gradient(90deg, rgba(255, 255, 255, .095), rgba(255, 255, 255, .03));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12);
}
.chart-row.playing .row-title { color: #fff; font-weight: 650; }
.chart-row.playing .row-art .eq { display: flex; padding: 14px 0; background: rgba(0, 0, 0, .52); }
.chart-row .like,
.chart-row .row-more { opacity: 0; }
.chart-row:hover .like,
.chart-row:hover .row-more,
.chart-row:focus-within .like,
.chart-row:focus-within .row-more,
.chart-row .like.on,
.chart-row.menu-open .row-more { opacity: 1; }

.chart-rank {
  text-align: center;
  font: 700 14px/1 var(--font-display);
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.chart-rank.top-1 { color: #ffd479; text-shadow: 0 0 14px rgba(255, 212, 121, .45); }
.chart-rank.top-2 { color: #e2e8f5; }
.chart-rank.top-3 { color: #e3a77d; }

/* ---------- полноэкранная редакционная шапка («Премьера», «Лучшие треки для вас», «Чарт») ---------- */
.ed-hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 30px;
  padding: 32px 28px 30px;
  margin: -10px -28px 20px;
  border-radius: 30px 30px 0 0;
  overflow: visible;
  isolation: isolate;
}
.ed-hero-glow {
  position: absolute;
  z-index: -1;
  left: 0;
  right: 0;
  top: -130px;
  bottom: -80px;
  pointer-events: none;
  background:
    radial-gradient(66% 78% at 20% 34%, var(--c1, #ff6a2b), transparent 72%),
    radial-gradient(62% 72% at 80% 18%, var(--c2, #a82432), transparent 76%);
  opacity: .46;
  filter: blur(46px);
  -webkit-mask-image: linear-gradient(#000 50%, transparent 100%);
  mask-image: linear-gradient(#000 50%, transparent 100%);
}
.ed-hero-pic {
  position: relative;
  width: 214px;
  height: 214px;
  flex: none;
  border-radius: 26px;
  overflow: hidden;
  background: #0b0b10;
  box-shadow:
    0 34px 70px -24px rgba(0, 0, 0, .95),
    0 20px 52px -20px var(--c1, rgba(255, 106, 43, .65)),
    inset 0 0 0 1px rgba(255, 255, 255, .14);
}
.ed-hero-pic::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .36);
  pointer-events: none;
}
.ed-hero-pic img { width: 100%; height: 100%; object-fit: cover; }

.ed-hero-sub {
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  max-width: 620px;
}
.ed-hero-meta {
  color: var(--ink-2);
  font-size: 13.5px;
  min-height: 19px;
}
.ed-play {
  height: 46px;
  padding: 0 26px 0 20px;
  font-size: 14.5px;
}
.ed-save.saved {
  color: #6df2b0;
  background: rgba(109, 242, 176, .14);
  box-shadow: inset 0 0 0 1px rgba(109, 242, 176, .35);
}
.btn.spinning .ico { animation: spin .9s linear infinite; }

/* строка поиска трека внутри редакционного плейлиста (как в референсе) */
.ed-filter {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 8px 0 16px;
  margin-bottom: 16px;
  border-radius: 999px;
}
.ed-filter > .ico { width: 17px; height: 17px; color: var(--ink-3); }
.ed-filter input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: none;
  outline: none;
  font-size: 14px;
  user-select: text;
  -webkit-user-select: text;
}
.ed-filter input::placeholder { color: var(--ink-3); }

/* подсветка топ-3 в полной странице чарта */
.chart-list .row[data-top='1'] .row-n > i { color: #ffd479; font-weight: 700; text-shadow: 0 0 14px rgba(255, 212, 121, .45); }
.chart-list .row[data-top='2'] .row-n > i { color: #e2e8f5; font-weight: 700; }
.chart-list .row[data-top='3'] .row-n > i { color: #e3a77d; font-weight: 700; }

/* ---------- адаптив (планшеты и узкие окна) ---------- */
@media (max-width: 1080px) {
  .ed-cards { grid-template-columns: 1fr; }
  .chart-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    grid-auto-flow: row;
    gap: 2px;
  }
  .ed-hero-pic { width: 176px; height: 176px; }
}

/* ---------- телефон (body.phone) ---------- */
body.phone .tr-head { padding: 2px 0 16px; align-items: center; flex-wrap: wrap; gap: 4px 10px; }
body.phone .tr-head .h1 { font-size: 24px; }
body.phone .tr-date-wrap { gap: 4px; }
body.phone .tr-date { font-size: 12px; }
body.phone .tr-head-actions { gap: 6px; flex: none; }
body.phone .tr-head-actions .btn.sm { height: 32px; padding: 0 11px; font-size: 12.5px; }

body.phone .ed-cards { grid-template-columns: 1fr; gap: 12px; }
body.phone .ed-card {
  gap: 14px;
  padding: 12px 14px 12px 12px;
  border-radius: 24px;
}
body.phone .ed-card-art { width: 96px; height: 96px; border-radius: 16px; }
body.phone .ed-card-play { width: 34px; height: 34px; right: 7px; bottom: 7px; }
body.phone .ed-card-play .ico { width: 14px; height: 14px; }
body.phone .ed-card-eq { left: 7px; top: 7px; height: 19px; padding: 4px 6px; }
body.phone .ed-card-title { font-size: 17.5px; }
body.phone .ed-card-sub { font-size: 12.5px; -webkit-line-clamp: 2; }
body.phone .ed-card-artists { font-size: 11.5px; }
body.phone .ed-sk-card { height: 120px; border-radius: 24px; }

body.phone .chart-grid {
  grid-template-columns: 1fr;
  grid-template-rows: auto;
  grid-auto-flow: row;
  gap: 2px;
}
body.phone .chart-row {
  grid-template-columns: 26px 46px minmax(0, 1fr) 36px 36px;
  gap: 8px;
  height: 62px;
  margin: 0 -6px;
  padding: 0 0 0 4px;
}
body.phone .chart-row .row-dur { display: none; }
body.phone .chart-row .like,
body.phone .chart-row .row-more { opacity: 1; width: 36px; height: 36px; }
body.phone .chart-row .like:not(.on) { color: var(--ink-3); }
body.phone .chart-row .like .ico,
body.phone .chart-row .row-more .ico { width: 19px; height: 19px; }

body.phone .ed-hero {
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  margin: -14px -16px 16px;
  padding: 18px 16px 20px;
}
body.phone .ed-hero-pic { width: 184px; height: 184px; border-radius: 24px; }
body.phone .ed-hero .hero-text { width: 100%; justify-items: center; gap: 8px; }
body.phone .ed-hero-sub { font-size: 14px; }
body.phone .ed-hero-meta { font-size: 13px; }
body.phone .ed-hero .hero-actions { justify-content: center; margin-top: 6px; flex-wrap: wrap; }
body.phone .ed-filter { margin-bottom: 12px; }

/* на телефоне в полной странице чарта сохраняем 5 колонок с видимыми номерами 1..38 (перебиваем phone.css по специфичности) */
body.phone .rows.chart-list:not(.compact) .row {
  grid-template-columns: 26px 46px minmax(0, 1fr) 36px 36px;
  gap: 8px;
  padding: 0 0 0 4px;
}
body.phone .rows.chart-list:not(.compact) .row-art {
  width: 46px;
  height: 46px;
}
body.phone .rows.chart-list:not(.compact) .row-n {
  display: grid;
  place-items: center;
  font: 700 13.5px/1 var(--font-display);
  font-variant-numeric: tabular-nums;
}
body.phone .rows.chart-list:not(.compact) .row-n .ico,
body.phone .rows.chart-list:not(.compact) .row-n .eq { display: none; }
body.phone .rows.chart-list:not(.compact) .row.playing .row-n > i { opacity: 1; }

body.touch .ed-card:hover { transform: none; }
body.touch .ed-card:hover .ed-card-art img { transform: none; }
body.touch .chart-row:not(.playing):not(.menu-open):hover { background: none; }
body.touch .chart-row:not(.playing):not(.menu-open):active { background: var(--fill-1); }
