/* CC Track — оформление в духе телевизионного ЛК Яндекс Музыки.
   Тёмный фон, крупная типографика, жёлтый акцент, большие карточки, круглые кнопки.
   Mobile-first: 360 → 768 → 1280 px, без горизонтальной прокрутки. */

:root {
  --bg: #0a0a0d;
  --bg-elevated: #14141b;
  --panel: #17171f;
  --panel-2: #1f1f29;
  --line: rgba(255, 255, 255, .07);
  --line-strong: rgba(255, 255, 255, .28);
  --text: #f5f6f8;
  --muted: #a9b0c0;
  --accent: #ffdb4d;
  --danger: #ff6b6b;
  --radius-lg: 26px;
  --radius: 18px;
  --radius-sm: 12px;
  --tap: 48px;
  --topbar-h: 77px;
  --glow: 0 24px 60px rgba(0, 0, 0, .55);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(255, 219, 77, .07), transparent 60%),
    radial-gradient(900px 500px at 0% 100%, rgba(110, 168, 255, .06), transparent 55%),
    var(--bg);
  min-height: 100vh;
}

h1 { font-size: 28px; line-height: 1.15; letter-spacing: -.02em; margin: 0 0 10px; font-weight: 800; }
h2 { font-size: 20px; margin: 0 0 14px; font-weight: 700; letter-spacing: -.01em; }
a { color: inherit; text-decoration: none; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.eyebrow {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: 11px;
  font-weight: 700;
  margin: 0 0 10px;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ── Оболочка ───────────────────────────────────────────── */
.shell { min-height: 100vh; padding-bottom: 96px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 12px 16px;
  min-height: var(--topbar-h);
  background: rgba(10, 10, 13, .82);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}
.topbar__left, .topbar__right { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar__left { flex: 1 1 auto; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  letter-spacing: -.01em;
  font-size: 15px;
}
.brand::before {
  content: "";
  width: 26px;
  height: 26px;
  border-radius: 9px;
  background: linear-gradient(140deg, var(--accent), #ffb03a 70%);
  box-shadow: 0 6px 18px rgba(255, 219, 77, .28);
}
.org-name {
  color: var(--muted);
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 42vw;
}
.org-switch { flex: 1 1 auto; min-width: 0; }
.org-switch select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: var(--tap);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--panel-2);
  color: var(--text);
  font-size: 16px;
}

.badge {
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  white-space: nowrap;
}
/* Статус экрана — с планшета: на 360 px шапка иначе переполняется. */
.badge--offline {
  display: none;
  color: #ffd8a1;
  border-color: rgba(255, 190, 110, .28);
  background: rgba(255, 176, 70, .1);
}

.sidebar { display: none; }
.content { padding: 18px 16px 28px; max-width: 1080px; margin: 0 auto; }

/* Нижнее меню на телефоне */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  background: rgba(17, 17, 23, .96);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  backdrop-filter: blur(18px);
  z-index: 30;
}
.tabbar__item {
  min-height: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
}
.tabbar__icon { font-size: 17px; line-height: 1; }
.tabbar__item.is-active { color: var(--accent); }
.tabbar__item.is-active .tabbar__icon { transform: translateY(-1px); }

/* ── Карточки ───────────────────────────────────────────── */
.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, 0)) , var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}
.card--focus {
  border-color: rgba(255, 219, 77, .22);
  box-shadow: var(--glow), inset 0 1px 0 rgba(255, 255, 255, .04);
}

/* Главный блок «сейчас играет» — как на ТВ */
.hero {
  display: grid;
  gap: 20px;
  padding: 20px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 120% at 15% 0%, rgba(255, 219, 77, .16), transparent 55%),
    radial-gradient(120% 120% at 90% 90%, rgba(120, 120, 255, .14), transparent 60%),
    var(--bg-elevated);
  border: 1px solid var(--line);
  box-shadow: var(--glow);
  margin-bottom: 16px;
}
.cover {
  position: relative;
  border-radius: 20px;
  min-height: 168px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(160deg, #24242f, #101017 70%);
  border: 1px solid var(--line);
}
.cover__wave {
  position: absolute;
  inset: auto 0 0 0;
  height: 62%;
  background:
    repeating-linear-gradient(90deg, rgba(255, 219, 77, .5) 0 4px, transparent 4px 10px);
  -webkit-mask-image: radial-gradient(120% 90% at 50% 100%, #000 25%, transparent 75%);
  mask-image: radial-gradient(120% 90% at 50% 100%, #000 25%, transparent 75%);
  opacity: .55;
}
.cover__glow {
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 219, 77, .35), transparent 65%);
  filter: blur(14px);
  transform: translateY(28%);
}
.cover__label {
  position: relative;
  z-index: 1;
  font-size: 13px;
  color: var(--muted);
  letter-spacing: .18em;
  text-transform: uppercase;
  font-weight: 700;
}

.track-title {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.05;
  margin: 0 0 6px;
}
.track-artist { font-size: 17px; color: var(--muted); margin: 0; }

.progress {
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
  overflow: hidden;
  margin: 18px 0 8px;
}
.progress span { display: block; width: 0; height: 100%; background: var(--accent); border-radius: 999px; }
.progress-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }

.controls { display: flex; align-items: center; gap: 14px; margin-top: 18px; flex-wrap: wrap; }
.btn {
  min-height: var(--tap);
  min-width: var(--tap);
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, .06);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}
.btn:hover { background: rgba(255, 255, 255, .1); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .4; cursor: default; }
.btn:focus-visible, .tabbar__item:focus-visible, .sidebar__link:focus-visible, select:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #17150a;
  font-weight: 800;
}
.btn--primary:hover { background: #ffe066; }
.btn--ghost { background: transparent; }
.btn--round { border-radius: 50%; width: var(--tap); padding: 0; font-size: 17px; }
.btn--play {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 0;
  background: var(--accent);
  color: #17150a;
  font-size: 22px;
  display: grid;
  place-items: center;
  box-shadow: 0 12px 30px rgba(255, 219, 77, .3);
}

/* Списки и факты */
.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.facts li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}
.facts li:last-child { border-bottom: 0; padding-bottom: 0; }
.facts span { color: var(--muted); }
.facts strong { font-weight: 600; text-align: right; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.chip {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .04);
  border-radius: 999px;
  padding: 8px 12px;
}
a.chip:hover { color: var(--text); border-color: var(--line-strong); }

.footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
  padding: 22px 4px 0;
  border-top: 1px solid var(--line);
  margin-top: 8px;
}

/* ── Вход ───────────────────────────────────────────────── */
.auth {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px 18px;
  background:
    radial-gradient(900px 520px at 50% -10%, rgba(255, 219, 77, .12), transparent 60%),
    var(--bg);
}
.auth__card {
  width: 100%;
  max-width: 400px;
  padding: 30px 26px 26px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .01)), var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--glow);
}
.auth__logo {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: linear-gradient(140deg, var(--accent), #ffb03a 75%);
  box-shadow: 0 14px 34px rgba(255, 219, 77, .28);
  margin-bottom: 18px;
}
.auth__card h1 { font-size: 32px; margin-bottom: 6px; }
.form { display: grid; gap: 16px; margin-top: 22px; }
.form label { display: grid; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: .04em; }
.form input {
  min-height: 54px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--panel-2);
  color: var(--text);
  font-size: 17px;
  font-weight: 500;
  transition: border-color .12s ease, background .12s ease;
}
.form input:focus { border-color: rgba(255, 219, 77, .6); background: #23232f; }
.form .btn { min-height: 54px; font-size: 16px; margin-top: 6px; }
.alert {
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--danger) 34%, transparent);
  color: #ffb3b3;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin: 14px 0 0;
  font-size: 14px;
}
.hint { margin-top: 18px; }

/* ── Каталог треков ─────────────────────────────────────── */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin: 16px 0 8px;
}
.filters__field { display: grid; gap: 6px; font-size: 12px; color: var(--muted); flex: 1 1 180px; }
.filters__field input,
.filters__field select {
  min-height: var(--tap);
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--panel-2);
  color: var(--text);
  font-size: 16px;
  min-width: 0;
}

.track-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 24px;
}
.track-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
}
.track-card__cover {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  background: linear-gradient(150deg, #262633, #13131a 70%);
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
}
.track-card__wave {
  position: absolute;
  inset: auto 0 0 0;
  height: 55%;
  background: repeating-linear-gradient(90deg, rgba(255, 219, 77, .45) 0 3px, transparent 3px 8px);
  -webkit-mask-image: linear-gradient(to top, #000, transparent);
  mask-image: linear-gradient(to top, #000, transparent);
}
.track-card__body { min-width: 0; }
.track-card__title {
  font-size: 16px;
  margin: 0 0 4px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.track-card__meta { margin: 0; font-size: 13px; color: var(--muted); }
.track-card--dim { opacity: .72; }
.track-card__flag {
  margin: 6px 0 0;
  font-size: 12px;
  color: #ffd8a1;
  border-left: 2px solid rgba(255, 190, 110, .5);
  padding-left: 8px;
}
.scope-chips { margin: 14px 0 0; }
.chip.is-active {
  color: #17150a;
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 700;
}
.btn--play-sm { width: 52px; height: 52px; font-size: 16px; border-radius: 50%; }
.btn--play-sm.is-playing { background: var(--accent); color: #17150a; }

.player-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 76px;
  z-index: 25;
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  background: rgba(20, 20, 27, .97);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(18px);
}
.player-bar__info { min-width: 0; }
.player-bar__title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.player-bar__meta {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.player-bar audio { width: 100%; }

@media (min-width: 768px) {
  .track-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .player-bar {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: min(760px, 100%);
    bottom: 84px;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    border-radius: 18px;
    border: 1px solid var(--line);
  }
}

@media (min-width: 1280px) {
  .track-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .player-bar {
    left: calc(264px + (100% - 264px) / 2);
    width: min(720px, calc(100% - 264px - 48px));
    bottom: 20px;
  }
}

/* ── Планшет ────────────────────────────────────────────── */
@media (min-width: 768px) {
  .content { padding: 26px 26px 36px; }
  h1 { font-size: 34px; }
  .card { padding: 24px; }
  .hero { grid-template-columns: 280px 1fr; align-items: center; padding: 24px; }
  .cover { min-height: 240px; }
  .track-title { font-size: 42px; }
  .tabbar {
    left: 0;
    right: 0;
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    border-radius: 22px 22px 0 0;
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
  }
  .badge--offline { display: inline-flex; }
}

/* ── ПК: боковое меню ───────────────────────────────────── */
@media (min-width: 1280px) {
  .shell {
    display: grid;
    grid-template-columns: 264px minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    grid-template-areas: "top top" "side main";
    padding-bottom: 0;
    min-height: 100vh;
  }
  .topbar { grid-area: top; padding: 14px 28px; }
  .sidebar {
    grid-area: side;
    display: block;
    padding: 22px 16px;
    border-right: 1px solid var(--line);
    position: sticky;
    top: var(--topbar-h);
    align-self: start;
    max-height: calc(100vh - var(--topbar-h));
    overflow-y: auto;
  }
  .sidebar__title {
    margin: 20px 12px 8px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .14em;
    color: var(--muted);
    font-weight: 700;
  }
  .sidebar__group:first-child .sidebar__title { margin-top: 0; }
  .sidebar__link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 12px;
    color: var(--text);
    opacity: .74;
    font-size: 15px;
    font-weight: 500;
    transition: background .12s ease, opacity .12s ease;
  }
  .sidebar__icon { width: 20px; text-align: center; color: var(--muted); font-size: 15px; }
  .sidebar__link:hover { background: rgba(255, 255, 255, .05); opacity: 1; }
  .sidebar__link.is-active { background: rgba(255, 219, 77, .1); opacity: 1; color: var(--accent); }
  .sidebar__link.is-active .sidebar__icon { color: var(--accent); }
  .content { grid-area: main; max-width: 1000px; margin: 0; padding: 30px 34px 48px; }
  .tabbar { display: none; }
  .hero { grid-template-columns: 340px 1fr; }
  .track-title { font-size: 52px; }
}
