/* Mini player bar */
body.has-lylib-player {
  padding-bottom: 96px;
}

#lylib-player {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 20px 12px;
  background: linear-gradient(135deg, rgba(22, 18, 48, 0.97) 0%, rgba(11, 13, 32, 0.98) 100%);
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(99, 102, 241, 0.35);
  box-shadow: 0 -16px 50px rgba(0, 0, 0, 0.55);
  transform: translateY(120%);
  transition: transform 0.45s cubic-bezier(0.34, 1.2, 0.4, 1);
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  overflow: hidden;
}

#lylib-player::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #6d4af0, #d0a4ff, #f472b6, #d0a4ff, #6d4af0);
  background-size: 200% 100%;
  animation: lpGradientDrift 6s linear infinite;
  opacity: 0.85;
}

@keyframes lpGradientDrift {
  to { background-position: -200% 0; }
}

#lylib-player.visible {
  transform: translateY(0);
}

#lylib-player .lp-cover {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
  background-image: linear-gradient(135deg, #a78bfa 0%, #f472b6 100%);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.06);
  transition: box-shadow 0.3s ease;
}

#lylib-player.playing .lp-cover {
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4), 0 0 0 2px rgba(99, 102, 241, 0.65), 0 0 22px rgba(99, 102, 241, 0.4);
}

#lylib-player .lp-meta {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-decoration: none;
  color: inherit;
}

#lylib-player .lp-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s ease;
}

#lylib-player .lp-meta:hover .lp-title {
  color: #d0c4ff;
}

#lylib-player .lp-artist {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#lylib-player .lp-icon-btn {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

#lylib-player .lp-icon-btn svg {
  width: 15px;
  height: 15px;
  display: block;
}

#lylib-player .lp-icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

#lylib-player .lp-icon-btn:active {
  transform: scale(0.9);
}

#lylib-player .lp-extra {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

#lylib-player .lp-like.active {
  color: #f472b6;
}

#lylib-player .lp-like.active:hover {
  background: rgba(244, 114, 182, 0.16);
  color: #f472b6;
}

#lylib-player .lp-like {
  position: relative;
}

#lylib-player .lp-like svg {
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: center;
}

#lylib-player .lp-like.pop svg {
  animation: lp-like-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes lp-like-pop {
  0% { transform: scale(1); }
  35% { transform: scale(1.55); }
  60% { transform: scale(0.85); }
  100% { transform: scale(1); }
}

#lylib-player .lp-like-particle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: lp-like-particle 0.6s ease-out forwards;
}

@keyframes lp-like-particle {
  to {
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0);
    opacity: 0;
  }
}

#lylib-player .lp-copy {
  width: auto;
  padding: 0 10px;
  gap: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.85);
}

#lylib-player .lp-copy::after {
  content: "ID";
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

#lylib-player .lp-copy:hover {
  background: rgba(99, 102, 241, 0.22);
  border-color: rgba(99, 102, 241, 0.55);
  color: #fff;
}

#lylib-player .lp-copy.copied {
  color: #4ade80;
  border-color: rgba(74, 222, 128, 0.5);
  background: rgba(74, 222, 128, 0.14);
}

#lylib-player .lp-repeat.active {
  color: #a78bfa;
  background: rgba(167, 139, 250, 0.16);
}

#lylib-player .lp-repeat.active:hover {
  background: rgba(167, 139, 250, 0.24);
  color: #a78bfa;
}

#lylib-player .lp-volume {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

#lylib-player .lp-volume-range {
  width: 70px;
  height: 14px;
  margin: 0;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

#lylib-player .lp-volume-range::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
}

#lylib-player .lp-volume-range::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
}

#lylib-player .lp-volume-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  margin-top: -4px;
  border-radius: 50%;
  background: #d0a4ff;
  box-shadow: 0 0 6px rgba(208, 164, 255, 0.6);
}

#lylib-player .lp-volume-range::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: none;
  border-radius: 50%;
  background: #d0a4ff;
  box-shadow: 0 0 6px rgba(208, 164, 255, 0.6);
}

#lylib-player .lp-controls {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

#lylib-player .lp-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

#lylib-player .lp-btn svg {
  width: 15px;
  height: 15px;
  display: block;
}

#lylib-player .lp-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

#lylib-player .lp-btn:active {
  transform: scale(0.9);
}

#lylib-player .lp-btn.lp-play {
  width: 40px;
  height: 40px;
  margin: 0 2px;
  color: #fff;
  background: linear-gradient(155deg, #7c5cfa 0%, #a855f7 55%, #ec4899 100%);
  box-shadow: 0 3px 12px rgba(124, 92, 250, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

#lylib-player .lp-btn.lp-play:hover {
  background: linear-gradient(155deg, #8a6bfb 0%, #b565f9 55%, #f0579f 100%);
}

#lylib-player .lp-btn.lp-play:active {
  transform: scale(0.94);
}

#lylib-player .lp-btn.lp-play svg {
  width: 17px;
  height: 17px;
  margin-left: 2px;
}

#lylib-player .lp-btn.lp-play.loading {
  cursor: wait;
}

#lylib-player .lp-btn.lp-play.loading::after {
  content: "";
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: lpSpin 0.7s linear infinite;
}

@keyframes lpSpin {
  to { transform: rotate(360deg); }
}

#lylib-player .lp-track {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

#lylib-player .lp-main-row {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
}

#lylib-player .lp-time {
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.5);
  flex-shrink: 0;
  min-width: 34px;
}

#lylib-player .lp-progress-bar {
  position: relative;
  flex: 1;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: height 0.15s ease;
}

#lylib-player .lp-progress-bar:hover {
  height: 7px;
}

#lylib-player .lp-progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: linear-gradient(90deg, #6d4af0, #d0a4ff, #f0d9ff);
  border-radius: 999px;
  box-shadow: 0 0 10px rgba(208, 164, 255, 0.55);
}

#lylib-player .lp-progress-fill::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 8px rgba(208, 164, 255, 0.8);
  transform: translate(50%, -50%) scale(0);
  transition: transform 0.15s ease;
}

#lylib-player .lp-progress-bar:hover .lp-progress-fill::after {
  transform: translate(50%, -50%) scale(1);
}

#lylib-player .lp-close {
  flex-shrink: 0;
  margin-left: 4px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

#lylib-player .lp-close svg {
  width: 12px;
  height: 12px;
}

#lylib-player .lp-close:hover {
  background: rgba(248, 113, 113, 0.18);
  color: #f87171;
  transform: rotate(90deg);
}

#lylib-player .lp-status {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.55);
  white-space: nowrap;
}

@media (min-width: 761px) {
  #lylib-player {
    left: 50%;
    right: auto;
    bottom: 18px;
    width: min(760px, calc(100vw - 40px));
    border-radius: 20px;
    border: 1px solid rgba(99, 102, 241, 0.35);
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.6), 0 0 60px rgba(99, 102, 241, 0.16);
    transform: translate(-50%, 140%);
  }

  #lylib-player.visible {
    transform: translate(-50%, 0);
  }

  body.has-lylib-player {
    padding-bottom: 112px;
  }
}

@media (max-width: 720px) {
  #lylib-player {
    padding: 8px 12px 10px;
    gap: 6px;
    border-radius: 16px 16px 0 0;
  }
  #lylib-player .lp-main-row {
    gap: 6px;
  }
  #lylib-player .lp-artist {
    display: none;
  }
  #lylib-player .lp-status {
    display: none;
  }
  #lylib-player .lp-volume-range {
    display: none;
  }
  #lylib-player .lp-extra {
    gap: 0;
  }
  #lylib-player .lp-icon-btn {
    width: 26px;
    height: 26px;
  }
  #lylib-player .lp-copy {
    width: auto;
    padding: 0 8px;
  }
  #lylib-player .lp-close {
    margin-left: 0;
  }
}

@media (max-width: 480px) {
  #lylib-player .lp-copy {
    display: none;
  }
}
