/* TajMusic Player — стили */
.tm-player {
  --tm-bg: rgba(13, 21, 29, .97);
  --tm-panel: #121922;
  --tm-line: rgba(255, 255, 255, .08);
  --tm-text: #e9f2f6;
  --tm-muted: #8ba2b0;
  --tm-accent: #20e3c2;
  --tm-ink: #071511;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 9999;
  color: var(--tm-text);
  font-family: inherit;
}
.tm-player[hidden] { display: none; }
body.tm-has-player { padding-bottom: 92px; }

/* сброс глобальных стилей темы для элементов плеера */
.tm-player, .tm-player *, .tm-player *::before, .tm-player *::after { box-sizing: border-box; }
.tm-player button {
  margin: 0; padding: 0; min-width: 0; line-height: 1;
  font: inherit; text-transform: none; letter-spacing: normal;
  box-shadow: none; text-shadow: none;
}
.tm-player input[type="range"] { margin: 0; padding: 0; border: 0; box-shadow: none; }
.tm-player ol, .tm-player li { margin: 0; padding: 0; list-style: none; }
.tm-player img { max-width: none; }

/* ---------- Панель ---------- */
.tm-bar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(320px, 2fr) minmax(180px, 1fr);
  align-items: center;
  gap: 24px;
  height: 76px;
  padding: 0 20px;
  background: var(--tm-bg);
  border-top: 1px solid rgba(27, 220, 194, .38);
  border-radius: 14px 14px 0 0;
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

/* Сейчас играет */
.tm-now { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tm-cover { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; background: var(--tm-panel); flex: none; }
.tm-meta { min-width: 0; }
.tm-title, .tm-artist { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tm-title { font-weight: 700; font-size: 14px; }
.tm-artist { font-size: 12px; color: var(--tm-muted); margin-top: 2px; }
.tm-title a { color: inherit; text-decoration: none; }
.tm-title a:hover { text-decoration: underline; }
.tm-player.is-error .tm-artist { color: #ff8a8a; }

/* Центр */
.tm-center { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tm-controls { display: flex; align-items: center; justify-content: center; gap: 10px; }
.tm-seek { display: flex; align-items: center; gap: 10px; }
.tm-time { font-size: 11px; color: var(--tm-muted); font-variant-numeric: tabular-nums; min-width: 34px; }
.tm-time.tm-dur { text-align: right; }

/* Правая часть */
.tm-side { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }

/* Кнопки */
.tm-btn {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px;
  border: 0; border-radius: 50%;
  background: transparent; color: var(--tm-muted);
  cursor: pointer; position: relative;
  transition: color .15s, background .15s;
}
.tm-btn:hover { color: var(--tm-text); background: rgba(255, 255, 255, .06); }
.tm-btn.is-on { color: var(--tm-accent); }
.tm-player .tm-btn.tm-play { width: 44px; height: 44px; background: var(--tm-accent); color: var(--tm-ink); }
.tm-btn.tm-play:hover { background: #3df0d2; color: var(--tm-ink); }
.tm-btn.tm-play svg { width: 24px; height: 24px; }
.tm-btn.is-one::after {
  content: "1"; position: absolute; right: 5px; bottom: 4px;
  font-size: 9px; font-weight: 800; line-height: 1; color: var(--tm-accent);
}
.tm-btn:focus { outline: none; }
.tm-btn:focus-visible, .tm-range:focus-visible { outline: 2px solid var(--tm-accent); outline-offset: 2px; }
.tm-btn.tm-play:focus-visible { outline-offset: 3px; }

/* Ползунки */
.tm-range {
  --p: 0%;
  -webkit-appearance: none; appearance: none;
  height: 4px; border-radius: 4px; outline: none; cursor: pointer;
  background: linear-gradient(to right, var(--tm-accent) var(--p), rgba(255, 255, 255, .14) var(--p));
}
.tm-progress { flex: 1; min-width: 0; }
.tm-volume { width: 90px; }
.tm-range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%;
  background: var(--tm-accent); border: 0; transform: scale(0); transition: transform .12s;
}
.tm-range::-moz-range-thumb {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--tm-accent); border: 0; transform: scale(0); transition: transform .12s;
}
.tm-range:hover::-webkit-slider-thumb, .tm-range:focus-visible::-webkit-slider-thumb { transform: scale(1); }
.tm-range:hover::-moz-range-thumb, .tm-range:focus-visible::-moz-range-thumb { transform: scale(1); }

/* ---------- Очередь ---------- */
.tm-queue {
  position: absolute; right: 16px; bottom: 84px;
  width: 360px; max-width: calc(100vw - 32px); max-height: 55vh;
  display: flex; flex-direction: column;
  background: var(--tm-panel); border: 1px solid var(--tm-line);
  border-radius: 12px; overflow: hidden;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .5);
}
.tm-queue[hidden] { display: none; }
.tm-queue-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 8px 12px 16px; border-bottom: 1px solid var(--tm-line); font-weight: 700;
}
.tm-queue-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; }
.tm-q-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 6px 8px; border: 0; border-radius: 8px;
  background: transparent; color: inherit; text-align: left; cursor: pointer; font: inherit;
}
.tm-q-item:hover { background: rgba(255, 255, 255, .05); }
.tm-q-item.is-current { background: rgba(32, 227, 194, .1); }
.tm-q-item.is-current .tm-q-title { color: var(--tm-accent); }
.tm-q-item img { width: 36px; height: 36px; border-radius: 6px; object-fit: cover; background: var(--tm-bg); flex: none; }
.tm-q-text { min-width: 0; }
.tm-q-title, .tm-q-artist { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.tm-q-title { font-size: 13px; font-weight: 600; }
.tm-q-artist { font-size: 11px; color: var(--tm-muted); }

/* ---------- Подсветка карточек на странице ---------- */
/* карточки песен */
.taj-track.is-current { border-color: rgba(32, 227, 194, .55); }
.taj-track.is-playing .taj-track__play { box-shadow: 0 0 0 4px rgba(32, 227, 194, .25); }

/* ---------- Телефон ---------- */
@media (max-width: 720px) {
  body.tm-has-player { padding-bottom: 116px; }
  .tm-bar {
    grid-template-columns: 1fr auto;
    grid-template-areas: "now ctrl" "seek seek";
    gap: 6px 12px; height: auto; padding: 10px 12px 12px;
  }
  .tm-center { display: contents; }
  .tm-now { grid-area: now; }
  .tm-controls { grid-area: ctrl; }
  .tm-seek { grid-area: seek; }
  .tm-side, .tm-hide-m { display: none; }
  .tm-btn.tm-play { width: 40px; height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  .tm-btn, .tm-range::-webkit-slider-thumb, .tm-range::-moz-range-thumb { transition: none; }
}

/* Главная кнопка play/пауза: градиент, свечение и пульсация во время игры (как на странице песни) */
.tm-player .tm-btn.tm-play {
  width: 48px; height: 48px;
  background: linear-gradient(145deg, #4af5d8 0%, #20e3c2 45%, #10b79b 100%);
  color: #04221d;
  box-shadow: 0 8px 22px rgba(32, 227, 194, .35), inset 0 1px 0 rgba(255, 255, 255, .45);
  transition: transform .2s, box-shadow .2s, background .2s;
}
.tm-player .tm-btn.tm-play:hover {
  background: linear-gradient(145deg, #6af8df 0%, #2eecca 45%, #14c6a8 100%);
  transform: scale(1.07);
  box-shadow: 0 12px 28px rgba(32, 227, 194, .5), inset 0 1px 0 rgba(255, 255, 255, .5);
}
.tm-player .tm-btn.tm-play:active { transform: scale(.96); }
.tm-player.is-playing .tm-btn.tm-play::after {
  content: ""; position: absolute; inset: -5px; border-radius: 50%;
  border: 2px solid rgba(32, 227, 194, .55);
  animation: tm-play-pulse 1.6s ease-out infinite; pointer-events: none;
}
@keyframes tm-play-pulse { 0% { transform: scale(.92); opacity: 1; } 100% { transform: scale(1.4); opacity: 0; } }
@media (max-width: 700px) { .tm-player .tm-btn.tm-play { width: 44px; height: 44px; } }
@media (prefers-reduced-motion: reduce) { .tm-player.is-playing .tm-btn.tm-play::after { animation: none; } }

/* полоска загрузки при переходе между страницами */
.tm-navbar { position: fixed; top: 0; left: 0; z-index: 10000; height: 3px; width: 0; background: linear-gradient(90deg, #20e3c2, #4af5d8); box-shadow: 0 0 10px rgba(32, 227, 194, .7); pointer-events: none; opacity: 0; }
