/* ============================================================
   #BlagTag Music — global player styles
   ============================================================ */

#music-global-player {
  --mgp-accent: #3b86f2;
  --mgp-accent-2: #8f6eff;
  --mgp-bar-h: 64px;
  position: relative;
  z-index: 1200;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

#music-global-player .mgp-icon {
  background: transparent;
  border: 0;
  color: #eaf1ff;
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  transition: background .15s ease, transform .12s ease, color .15s ease;
  padding: 0;
}
#music-global-player .mgp-icon:hover { background: rgba(255, 255, 255, .13); }
#music-global-player .mgp-icon.mgp-active { color: #54e6c1; }
#music-global-player .mgp-icon.mgp-on { color: var(--mgp-accent-2); }

/* ---------- mini bar ---------- */
#music-global-player .mgp-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--mgp-bar-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  background: rgba(13, 19, 32, .97);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid rgba(255, 255, 255, .09);
  box-shadow: 0 -10px 32px rgba(0, 0, 0, .4);
  transform: translateY(110%);
  transition: transform .28s cubic-bezier(.2, .9, .3, 1);
  color: #eaf1ff;
}
#music-global-player[data-active="1"] .mgp-bar { transform: translateY(0); }
#music-global-player.mgp-expanded .mgp-bar { transform: translateY(110%); }

#music-global-player .mgp-cover-wrap {
  width: 44px; height: 44px; min-width: 44px;
  border-radius: 9px; overflow: hidden;
  background: #22304d;
  box-shadow: 0 3px 12px rgba(0, 0, 0, .45);
  cursor: pointer;
}
#music-global-player .mgp-cover-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }

#music-global-player .mgp-meta { min-width: 130px; max-width: 240px; flex: 0 1 240px; overflow: hidden; }
#music-global-player .mgp-title {
  display: block; font-weight: 600; font-size: 13.5px; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none;
}
#music-global-player .mgp-title:hover { color: #9cc0ff; }
#music-global-player .mgp-sub {
  font-size: 12px; color: #9db0d0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

#music-global-player .mgp-center { flex: 1; display: flex; align-items: center; gap: 14px; min-width: 0; }
#music-global-player .mgp-buttons { display: flex; align-items: center; gap: 4px; }
#music-global-player .mgp-play {
  width: 44px; height: 44px; min-width: 44px;
  background: rgba(255, 255, 255, .1);
  font-size: 17px;
}
#music-global-player .mgp-play:hover { background: rgba(255, 255, 255, .18); }

#music-global-player .mgp-progress { flex: 1; display: flex; align-items: center; gap: 9px; min-width: 120px; }
#music-global-player .mgp-time { font-size: 11.5px; color: #8fa3c4; font-variant-numeric: tabular-nums; min-width: 34px; text-align: center; }

#music-global-player .mgp-line {
  flex: 1; height: 5px; border-radius: 6px;
  background: rgba(255, 255, 255, .16);
  cursor: pointer; position: relative; overflow: hidden;
}
#music-global-player .mgp-line-fill {
  height: 100%; width: 0;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--mgp-accent), var(--mgp-accent-2));
  transition: width .12s linear;
  pointer-events: none;
}

#music-global-player .mgp-right { display: flex; align-items: center; gap: 2px; }
#music-global-player .mgp-volume { display: flex; align-items: center; gap: 2px; }
#music-global-player .mgp-volume input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 84px; height: 4px; border-radius: 4px;
  background: rgba(255, 255, 255, .2);
  outline: none; cursor: pointer;
}
#music-global-player .mgp-volume input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--mgp-accent);
  box-shadow: 0 0 10px rgba(59, 134, 242, .5);
}
#music-global-player .mgp-volume input[type="range"]::-moz-range-thumb {
  width: 13px; height: 13px; border-radius: 50%; border: 0;
  background: var(--mgp-accent);
}

/* ---------- fullscreen ---------- */
#music-global-player .mgp-full {
  position: fixed; inset: 0; z-index: 1210;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .3s ease, visibility .3s ease;
  display: flex; align-items: stretch; justify-content: center;
}
#music-global-player.mgp-expanded .mgp-full { opacity: 1; visibility: visible; pointer-events: all; }

#music-global-player .mgp-full-bg {
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(150deg, #0a1020 0%, #131c31 55%, #1b1533 100%);
  background-size: cover; background-position: center;
  filter: blur(0px) brightness(.32);
  transform: scale(1.1);
}
#music-global-player .mgp-full-inner {
  width: 100%; max-width: 1240px; padding: 22px 26px 30px;
  display: flex; flex-direction: column; gap: 18px; color: #eaf1ff;
}

#music-global-player .mgp-full-head { display: flex; align-items: center; gap: 14px; }
#music-global-player .mgp-full-titles { flex: 1; min-width: 0; }
#music-global-player .mgp-full-title {
  font-size: 22px; font-weight: 700; letter-spacing: .2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: linear-gradient(135deg, #fff, #a5b9ff);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
#music-global-player .mgp-full-artist { font-size: 13.5px; color: #9db0d0; }
#music-global-player .mgp-full-head-right { display: flex; gap: 8px; }
#music-global-player .mgp-select {
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .14);
  color: #eaf1ff; border-radius: 9px; padding: 8px 10px; font-size: 12.5px;
  outline: none; cursor: pointer;
}
#music-global-player .mgp-select option { background: #16203a; color: #eaf1ff; }

#music-global-player .mgp-full-body { flex: 1; display: flex; gap: 30px; min-height: 0; }
#music-global-player .mgp-full-left {
  flex: 1.25; min-width: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 22px;
}
#music-global-player .mgp-full-cover-wrap { position: relative; width: min(46vh, 380px); aspect-ratio: 1/1; }
#music-global-player .mgp-full-cover {
  width: 100%; height: 100%; object-fit: cover; border-radius: 22px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, .55);
}
#music-global-player .mgp-visualizer {
  position: absolute; left: 0; right: 0; bottom: -26px; height: 22px;
  display: flex; align-items: flex-end; justify-content: center; gap: 4px;
  pointer-events: none;
}
#music-global-player .mgp-visualizer span {
  width: 4px; height: 4px; border-radius: 3px;
  background: linear-gradient(to top, var(--mgp-accent), var(--mgp-accent-2));
  opacity: .85;
}
#music-global-player .mgp-playing .mgp-visualizer span { animation: mgp-viz 1s ease-in-out infinite; }
#music-global-player .mgp-playing .mgp-visualizer span:nth-child(2n) { animation-duration: 1.35s; }
#music-global-player .mgp-playing .mgp-visualizer span:nth-child(3n) { animation-duration: .82s; }
#music-global-player .mgp-playing .mgp-visualizer span:nth-child(5n) { animation-duration: 1.6s; }
@keyframes mgp-viz {
  0%, 100% { height: 4px; opacity: .55; }
  50% { height: 22px; opacity: 1; }
}

#music-global-player .mgp-full-controls { display: flex; align-items: center; gap: 18px; }
#music-global-player .mgp-icon-lg { width: 50px; height: 50px; min-width: 50px; font-size: 19px; background: rgba(255, 255, 255, .07); }
#music-global-player .mgp-icon-xl {
  width: 72px; height: 72px; min-width: 72px; font-size: 26px;
  background: linear-gradient(135deg, var(--mgp-accent), var(--mgp-accent-2));
  box-shadow: 0 12px 34px rgba(59, 134, 242, .45);
}
#music-global-player .mgp-icon-xl:hover { background: linear-gradient(135deg, #5c9cff, #a58cff); }

#music-global-player .mgp-full-progress { width: min(100%, 560px); display: flex; align-items: center; gap: 12px; }
#music-global-player .mgp-full-progress .mgp-line { height: 7px; }
#music-global-player .mgp-full-bottom { display: flex; align-items: center; gap: 16px; }
#music-global-player .mgp-full-bottom .mgp-volume input[type="range"] { width: 130px; }

/* ---------- right panel: queue / lyrics ---------- */
#music-global-player .mgp-full-right {
  flex: 0 0 360px; max-width: 360px; min-width: 0;
  background: rgba(10, 16, 30, .55);
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 18px;
  display: flex; flex-direction: column; overflow: hidden;
}
#music-global-player .mgp-panel { display: flex; flex-direction: column; min-height: 0; height: 100%; }
#music-global-player .mgp-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; font-size: 13px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: #9db0d0;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
#music-global-player .mgp-icon.mgp-mini { width: 28px; height: 28px; min-width: 28px; font-size: 12.5px; }

#music-global-player .mgp-queue-list {
  list-style: none; margin: 0; padding: 8px; overflow-y: auto; flex: 1; min-height: 0;
}
#music-global-player .mgp-queue-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 9px; border-radius: 10px; cursor: pointer;
  transition: background .12s ease;
}
#music-global-player .mgp-queue-list li:hover { background: rgba(255, 255, 255, .08); }
#music-global-player .mgp-queue-list li.mgp-current { background: rgba(59, 134, 242, .18); }
#music-global-player .mgp-queue-list li.mgp-current .mgp-q-name { color: #7fb0ff; }
#music-global-player .mgp-q-num { width: 20px; min-width: 20px; text-align: center; font-size: 11.5px; color: #708097; font-variant-numeric: tabular-nums; }
#music-global-player .mgp-queue-list li.mgp-current .mgp-q-num { color: #7fb0ff; }
#music-global-player .mgp-q-img { width: 34px; height: 34px; min-width: 34px; border-radius: 7px; object-fit: cover; background: #22304d; }
#music-global-player .mgp-q-meta { flex: 1; min-width: 0; }
#music-global-player .mgp-q-name { font-size: 13px; color: #e6edfb; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#music-global-player .mgp-q-artist { font-size: 11.5px; color: #8296b5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#music-global-player .mgp-q-time { font-size: 11px; color: #708097; font-variant-numeric: tabular-nums; }
#music-global-player .mgp-q-remove {
  opacity: 0; border: 0; background: transparent; color: #93a6c5;
  font-size: 13px; cursor: pointer; width: 26px; height: 26px; min-width: 26px; border-radius: 50%;
}
#music-global-player .mgp-queue-list li:hover .mgp-q-remove { opacity: 1; }
#music-global-player .mgp-q-remove:hover { background: rgba(255, 90, 120, .18); color: #ff8fa3; }

#music-global-player .mgp-lyrics-body {
  flex: 1; overflow-y: auto; padding: 16px; font-size: 14px; line-height: 1.75;
  color: #d7e2f5; white-space: pre-line;
}

/* ---------- queue drawer (mini) ---------- */
#music-global-player .mgp-queue-drawer {
  position: fixed; right: 14px; bottom: calc(var(--mgp-bar-h) + 12px);
  width: 340px; max-width: calc(100vw - 28px); max-height: 60vh;
  background: rgba(13, 19, 32, .98);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 16px; overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 22px 60px rgba(0, 0, 0, .5);
  opacity: 0; visibility: hidden; transform: translateY(14px);
  transition: all .22s ease;
  color: #eaf1ff; z-index: 1205;
}
#music-global-player .mgp-queue-drawer.mgp-open { opacity: 1; visibility: visible; transform: translateY(0); }
#music-global-player.mgp-expanded .mgp-queue-drawer { display: none; }

/* ---------- toast ---------- */
#music-global-player .mgp-toast {
  position: fixed; bottom: calc(var(--mgp-bar-h) + 18px); left: 50%; transform: translateX(-50%);
  background: rgba(20, 30, 52, .98); color: #eaf1ff;
  border: 1px solid rgba(255, 255, 255, .12);
  padding: 10px 18px; border-radius: 12px; font-size: 13px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .45);
  z-index: 1220; pointer-events: none;
}

/* ---------- body padding when player visible ---------- */
body.mgp-has-player { padding-bottom: 78px; }
@media (max-width: 768px) { body.mgp-has-player { padding-bottom: 70px; } }

/* ---------- PJAX progress line ---------- */
#music-global-player .mgp-pjax-bar {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 2000;
  background: linear-gradient(90deg, var(--mgp-accent), var(--mgp-accent-2));
  transform: scaleX(0); transform-origin: left center;
  transition: transform .25s ease, opacity .3s ease;
  opacity: 0;
}
#music-global-player .mgp-pjax-bar.on {
  opacity: 1;
  animation: mgp-pjax-slide 1.1s ease-in-out infinite;
}
@keyframes mgp-pjax-slide {
  0% { transform: scaleX(.05); }
  50% { transform: scaleX(.7); }
  100% { transform: scaleX(.96); }
}

/* ---------- navbar button (вставляется в тему) ---------- */
#mgp-nav-button {
  position: relative;
  display: flex !important;
  align-items: center;
  justify-content: center;
  height: 50px;
}
#mgp-nav-button .svg-container {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 24px !important;
  height: 24px !important;
}
#mgp-nav-button .svg-container svg {
  display: block;
  width: 22px !important;
  height: 22px !important;
}
#mgp-nav-button.mgp-nav-playing::after {
  content: ''; position: absolute; top: -3px; right: -3px;
  width: 9px; height: 9px; border-radius: 50%;
  background: #2dd4a7;
  box-shadow: 0 0 0 3px rgba(45, 212, 167, .25);
  animation: mgp-nav-pulse 1.5s ease-in-out infinite;
}
@keyframes mgp-nav-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 3px rgba(45, 212, 167, .25); }
  50% { transform: scale(1.15); box-shadow: 0 0 0 6px rgba(45, 212, 167, .12); }
}

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  #music-global-player .mgp-volume input[type="range"] { width: 60px; }
  #music-global-player .mgp-right > .mgp-icon:not(.mgp-queue-btn) { display: none; }
  #music-global-player .mgp-right .mgp-volume { display: none; }
  #music-global-player .mgp-right #mgp-like, #music-global-player .mgp-right #mgp-expand, #music-global-player .mgp-right #mgp-close { display: inline-flex; }
}
@media (max-width: 768px) {
  #music-global-player .mgp-meta { flex: 1 1 90px; min-width: 0; max-width: none; }
  #music-global-player .mgp-center { flex: 1.4; gap: 8px; }
  #music-global-player .mgp-progress { display: none; }
  #music-global-player .mgp-right { gap: 0; }
  #music-global-player .mgp-bar { padding: 0 8px; gap: 7px; }
  #music-global-player .mgp-queue-btn { display: none; }

  #music-global-player .mgp-full-inner { padding: 14px; gap: 12px; }
  #music-global-player .mgp-full-body { flex-direction: column; gap: 16px; overflow-y: auto; }
  #music-global-player .mgp-full-right { flex: 1 1 auto; max-width: none; }
  #music-global-player .mgp-full-cover-wrap { width: min(38vh, 300px); }
  #music-global-player .mgp-full-title { font-size: 18px; }
  #music-global-player .mgp-full-head-right .mgp-select { padding: 6px 8px; font-size: 11.5px; }
}
