/* Радио «Әділет» — плеер в стиле ALEM FM.
   Фон = размытая обложка текущего трека (ambient-цвет вытекает из обложки),
   поверх — матовое стекло: карточка обложки + нижний бар (LIVE · станция ·
   now playing · play · эквалайзер · громкость).
   Бренд-акценты: 2735C #290081, 291C #96C5FF, 172C #FE5200, 107C #FFF826.
   Шрифты: Oswald (заголовки/лого), Geist (текст). */
:root {
  --purple: #290081;
  --blue: #96C5FF;
  --orange: #FE5200;
  --yellow: #FFF826;
  --wave: #ffb457;
  --white: #ffffff;
  --muted: rgba(255, 255, 255, 0.62);
  --glass: rgba(255, 255, 255, 0.12);
  --glass-line: rgba(255, 255, 255, 0.16);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html, body { height: 100%; }
body {
  font-family: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--white);
  min-height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
  background: #14071f;
  -webkit-font-smoothing: antialiased;
}

/* ── Фон из обложки ─────────────────────────────────────── */
.bg {
  position: fixed;
  inset: -12%;
  z-index: 0;
  background-color: #1a0b33;
  background-size: cover;
  background-position: center;
  filter: blur(64px) saturate(1.5) brightness(0.72);
  transform: scale(1.18);
  opacity: 0;
  transition: opacity 0.7s ease;
}
.bg.on { opacity: 1; }
/* когда обложки нет (off-air / голос) — мягкий фирменный градиент */
.scrim {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(41, 0, 129, 0.35), transparent 60%),
    linear-gradient(180deg, rgba(10, 4, 20, 0.15) 0%, rgba(10, 4, 20, 0.55) 60%, rgba(8, 3, 16, 0.9) 100%);
  pointer-events: none;
}

/* ── Колонка плеера ─────────────────────────────────────── */
.player {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 660px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ── Карточка обложки ───────────────────────────────────── */
.art-card {
  position: relative;
  width: min(100%, 380px);
  border-radius: 26px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-line);
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.art {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background-color: rgba(255, 255, 255, 0.04);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease;
}
.art-mark {
  font-family: "Oswald", sans-serif;
  font-size: 108px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.14);
  transition: opacity 0.4s;
}
.art:not([data-empty="true"]) .art-mark { opacity: 0; }

/* Матовая плашка названия поверх низа обложки */
.art-panel {
  position: relative;
  padding: 16px 20px 20px;
  text-align: center;
  background: rgba(20, 12, 30, 0.42);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  border-top: 1px solid var(--glass-line);
}
.title {
  font-family: "Oswald", sans-serif;
  font-weight: 600;
  font-size: 27px;
  line-height: 1.12;
  letter-spacing: 0.3px;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.35);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.artist {
  font-size: 14px;
  color: var(--muted);
  margin-top: 5px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.meta.swap { animation: swap 0.5s ease; }
@keyframes swap { from { opacity: 0.15; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Тонкий прогресс сегмента по нижней кромке карточки */
.progress {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}
.progress .bar {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--wave), var(--orange));
  transition: width 0.25s linear;
}

/* ── Ссылки на стриминги ────────────────────────────────── */
.links { display: flex; gap: 10px; justify-content: center; margin-top: 16px; min-height: 0; }
.links a {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: "Oswald", sans-serif; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.5px; font-size: 12px;
  text-decoration: none; color: var(--white);
  padding: 8px 15px; border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  backdrop-filter: blur(8px);
  transition: background 0.2s, border-color 0.2s, transform 0.1s;
}
.links a:hover { background: rgba(255, 255, 255, 0.2); transform: translateY(-1px); }
.links a.spotify:hover { border-color: #1DB954; }
.links a.youtube:hover { border-color: var(--orange); }
.links a .d { width: 7px; height: 7px; border-radius: 50%; }
.links a.spotify .d { background: #1DB954; }
.links a.youtube .d { background: var(--orange); }

/* ── Нижний стеклянный бар ──────────────────────────────── */
.dock {
  margin-top: 22px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 18px;
  border-radius: 22px;
  background: rgba(18, 12, 28, 0.5);
  border: 1px solid var(--glass-line);
  backdrop-filter: blur(24px) saturate(1.3);
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
  box-shadow: 0 18px 50px -18px rgba(0, 0, 0, 0.6);
}

/* LIVE + станция */
.dock-station { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.live {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: "Oswald", sans-serif; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1px; font-size: 11px;
  color: #fff; background: #e11d2a;
  border-radius: 999px; padding: 5px 10px;
  box-shadow: 0 4px 14px -2px rgba(225, 29, 42, 0.6);
  transition: background 0.3s, box-shadow 0.3s;
}
.live .pulse { width: 7px; height: 7px; border-radius: 50%; background: #fff; }
body.live .live .pulse { animation: blink 1.4s ease-in-out infinite; }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }
.st-text { display: flex; flex-direction: column; line-height: 1.15; }
.st-text b { font-weight: 600; font-size: 13px; }
.st-text i { font-style: normal; font-size: 11px; color: var(--muted); }

.dock-div { width: 1px; align-self: stretch; background: var(--glass-line); flex-shrink: 0; }

/* NOW PLAYING */
.dock-now { display: flex; flex-direction: column; min-width: 130px; flex: 1 1 auto; }
.now-label {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  font-family: "Oswald", sans-serif; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1.4px; font-size: 9.5px;
  color: var(--wave); margin-bottom: 1px;
}
.now-title {
  font-weight: 600; font-size: 14px; line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.now-artist {
  font-style: normal; font-size: 12px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chip {
  font-family: "Oswald", sans-serif; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.6px; font-size: 9px;
  color: #0d0620; background: var(--blue);
  border-radius: 999px; padding: 2px 7px;
}

/* Play / Pause */
.play {
  width: 52px; height: 52px; flex-shrink: 0;
  border-radius: 50%; border: 1px solid var(--glass-line); cursor: pointer;
  color: var(--white);
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform 0.15s, background 0.2s;
}
.play:hover { transform: scale(1.06); background: rgba(255, 255, 255, 0.24); }
.play:active { transform: scale(0.95); }
.play .ic-pause { display: none; }
body.live:not(.paused) .play .ic-play { display: none; }
body.live:not(.paused) .play .ic-pause { display: block; }

/* Эквалайзер (декоративный, играет когда в эфире) */
.wave { display: flex; align-items: center; justify-content: center; gap: 3px; height: 34px; flex: 0 0 76px; overflow: hidden; }
.wave i {
  width: 3px; border-radius: 2px; height: 20%;
  background: linear-gradient(180deg, var(--wave), var(--orange));
  opacity: 0.85;
}
body.live:not(.paused) .wave i { animation: wv 1.1s ease-in-out infinite; }
.wave i:nth-child(odd) { animation-duration: 0.9s !important; }
.wave i:nth-child(1){animation-delay:-.2s} .wave i:nth-child(2){animation-delay:-.7s}
.wave i:nth-child(3){animation-delay:-.4s} .wave i:nth-child(4){animation-delay:-.9s}
.wave i:nth-child(5){animation-delay:-.1s} .wave i:nth-child(6){animation-delay:-.6s}
.wave i:nth-child(7){animation-delay:-.3s} .wave i:nth-child(8){animation-delay:-.8s}
.wave i:nth-child(9){animation-delay:-.5s} .wave i:nth-child(10){animation-delay:-.15s}
.wave i:nth-child(11){animation-delay:-.65s} .wave i:nth-child(12){animation-delay:-.35s}
.wave i:nth-child(13){animation-delay:-.85s} .wave i:nth-child(14){animation-delay:-.25s}
.wave i:nth-child(15){animation-delay:-.55s} .wave i:nth-child(16){animation-delay:-.45s}
.wave i:nth-child(17){animation-delay:-.75s} .wave i:nth-child(18){animation-delay:-.05s}
@keyframes wv { 0%,100% { height: 18%; } 50% { height: 95%; } }

/* Громкость */
.vol { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); flex-shrink: 0; }
.vol input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 58px; height: 4px;
  border-radius: 2px; background: rgba(255, 255, 255, 0.24); outline: none; cursor: pointer;
}
.vol input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 13px; height: 13px; border-radius: 50%;
  background: var(--white); cursor: pointer; border: none;
}
.vol input[type="range"]::-moz-range-thumb {
  width: 13px; height: 13px; border-radius: 50%; background: var(--white); border: none; cursor: pointer;
}

/* ── Следующий трек ─────────────────────────────────────── */
.next-up {
  display: flex; align-items: center; gap: 10px; justify-content: center;
  margin-top: 14px; font-size: 12px; color: var(--muted);
}
.next-up .nu-label {
  font-family: "Oswald", sans-serif; font-weight: 600; text-transform: uppercase;
  letter-spacing: 1px; font-size: 10px; color: var(--blue);
}
.next-up .nu-track { color: var(--white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Off-air ────────────────────────────────────────────── */
body.offair .live { background: rgba(255, 255, 255, 0.16); box-shadow: none; color: var(--muted); }
body.offair .live .pulse { background: var(--muted); animation: none; }

/* ── Адаптив ────────────────────────────────────────────── */
@media (max-width: 520px) {
  body { padding: 16px 12px; align-items: flex-start; }
  .dock { flex-wrap: wrap; gap: 10px 12px; }
  .dock-now { order: 5; flex-basis: 100%; }
  .dock-div { display: none; }
  .wave { flex: 1 1 auto; }
  .art-card { width: 100%; }
}
