/* ============================================================
   DNF复古 · 全站音乐播放器（fugu-music.css）
   ------------------------------------------------------------
   「旧票根」语言：朱红黑胶唱片 + 米黄纸面板 + 双线票框 +
   等宽编号歌单。独立组件，不依赖 dnf86-base.css，
   也不复用 dnf86 站的深色霓虹播放器视觉。
   ============================================================ */

.fgmp {
  position: fixed;
  left: 22px;
  bottom: 22px;
  z-index: 78;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #1f1a15;
}
.fgmp.open { z-index: 88; }
.fgmp[hidden] { display: none; }

/* ---------- 唱片按钮 ---------- */
.fgmp-disc {
  position: relative;
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 50%, #d8b878 0 5px, #2b1f15 5px 12px, #16120f 12px 100%);
  box-shadow:
    0 0 0 3px #b5372a,
    0 0 0 5px #f8f4ec,
    0 10px 24px -8px rgba(52, 38, 22, .8);
  transition: transform .25s ease, box-shadow .25s ease;
}
.fgmp-disc:hover { transform: scale(1.06); }
.fgmp-disc svg { width: 20px; height: 20px; color: #f6ead3; position: relative; z-index: 2; }
/* 黑胶纹路：常驻缓慢旋转（不管播不播放都在转），播放时加速 */
.fgmp-disc::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: repeating-radial-gradient(circle at 50% 50%, rgba(255,255,255,.07) 0 1px, transparent 1px 3px);
  -webkit-mask-image: radial-gradient(circle, transparent 23%, #000 24% 84%, transparent 85%);
          mask-image: radial-gradient(circle, transparent 23%, #000 24% 84%, transparent 85%);
  animation: fgmpSpin 9s linear infinite;
}
/* 声波扩散环：常驻，表示「在响」 */
.fgmp-disc::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid rgba(181, 55, 42, .5);
  animation: fgmpRipple 2.6s ease-out infinite;
}
.fgmp.playing .fgmp-disc::before { animation-duration: 3.6s; }
@keyframes fgmpSpin { to { transform: rotate(360deg); } }
@keyframes fgmpRipple {
  0% { transform: scale(.9); opacity: .7; }
  100% { transform: scale(1.55); opacity: 0; }
}

.fgmp.need-click .fgmp-disc { animation: fgmpPulse 1.5s ease-in-out infinite; }
@keyframes fgmpPulse {
  0%, 100% { box-shadow: 0 0 0 3px #b5372a, 0 0 0 5px #f4ecdd, 0 10px 24px -8px rgba(52, 38, 22, .75), 0 0 0 8px rgba(181, 55, 42, 0); }
  50%      { box-shadow: 0 0 0 3px #b5372a, 0 0 0 5px #f4ecdd, 0 10px 24px -8px rgba(52, 38, 22, .75), 0 0 0 12px rgba(181, 55, 42, .18); }
}

/* ---------- 面板 ---------- */
.fgmp-panel {
  position: absolute;
  left: 0;
  bottom: 66px;
  width: 306px;
  max-width: calc(100vw - 44px);
  padding: 18px 18px 16px;
  background: #fbf7ee;
  border: 1px solid rgba(31, 26, 21, .28);
  outline: 1px solid rgba(31, 26, 21, .14);
  outline-offset: -5px;
  border-radius: 4px;
  box-shadow: 0 22px 50px -22px rgba(52, 38, 22, .8);
  transform: translateY(12px) scale(.97);
  opacity: 0;
  visibility: hidden;
  transform-origin: bottom left;
  transition: transform .28s ease, opacity .28s ease, visibility .28s;
}
.fgmp.open .fgmp-panel { transform: none; opacity: 1; visibility: visible; }

/* 面板左右两侧齿孔，呼应票根 */
.fgmp-panel::before,
.fgmp-panel::after {
  content: "";
  position: absolute;
  top: 14px;
  bottom: 14px;
  width: 4px;
  background-image: radial-gradient(circle, #d9cdb7 1.6px, transparent 1.7px);
  background-size: 4px 11px;
  background-repeat: repeat-y;
  opacity: .9;
  pointer-events: none;
}
.fgmp-panel::before { left: 6px; }
.fgmp-panel::after { right: 6px; }

.fgmp-head { display: flex; align-items: flex-start; gap: 10px; padding: 0 8px; }
.fgmp-meta { min-width: 0; flex: 1; }
.fgmp-kicker {
  font-family: "Roboto Mono", ui-monospace, monospace;
  font-size: 9.5px;
  letter-spacing: .22em;
  color: #8d281e;
  text-transform: uppercase;
  margin-bottom: 5px;
}
.fgmp-name {
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fgmp-artist {
  font-size: 11px;
  color: #6d6357;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fgmp-list-btn {
  flex: none;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(31, 26, 21, .22);
  background: transparent;
  color: #3b332a;
  border-radius: 3px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
}
.fgmp-list-btn:hover,
.fgmp.list-open .fgmp-list-btn { background: #b5372a; border-color: #b5372a; color: #fff6e6; }

.fgmp-embed { display: none; margin: 12px 8px 0; }
.fgmp.mode-embed .fgmp-embed { display: block; }
.fgmp-embed iframe { display: block; width: 100%; border: 0; border-radius: 3px; }

.fgmp-progress {
  height: 5px;
  margin: 14px 8px 5px;
  background: #e6dac4;
  border-radius: 3px;
  cursor: pointer;
  overflow: hidden;
}
.fgmp-progress-cur { height: 100%; width: 0; background: #b5372a; transition: width .2s linear; }
.fgmp-times {
  display: flex;
  justify-content: space-between;
  margin: 0 8px;
  font-family: "Roboto Mono", ui-monospace, monospace;
  font-size: 10.5px;
  color: #6d6357;
}

.fgmp-controls { display: flex; align-items: center; gap: 7px; margin: 12px 8px 0; }
.fgmp-btn {
  width: 32px;
  height: 32px;
  flex: none;
  border: 1px solid rgba(31, 26, 21, .22);
  background: transparent;
  color: #3b332a;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
  display: grid;
  place-items: center;
}
.fgmp-btn:hover { border-color: #b5372a; color: #8d281e; }
.fgmp-btn-play {
  width: 40px;
  height: 40px;
  border: 0;
  background: #b5372a;
  color: #fff6e6;
  font-size: 14px;
  box-shadow: 0 3px 0 #8d281e;
}
.fgmp-btn-play:hover { background: #8d281e; color: #fff6e6; }
.fgmp-vol { display: flex; align-items: center; gap: 6px; margin-left: auto; min-width: 0; flex: 1; }
.fgmp-vol span { font-size: 12px; flex: none; }
.fgmp-vol input[type="range"] {
  flex: 1;
  min-width: 0;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: #e6dac4;
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.fgmp-vol input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #b5372a;
}
.fgmp-vol input[type="range"]::-moz-range-thumb {
  width: 11px; height: 11px; border: 0; border-radius: 50%; background: #b5372a;
}

.fgmp-list {
  display: none;
  max-height: 196px;
  overflow-y: auto;
  margin: 13px 8px 0;
  padding-top: 9px;
  border-top: 1px dashed rgba(31, 26, 21, .24);
}
.fgmp.list-open .fgmp-list { display: block; }
.fgmp-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  cursor: pointer;
  font-size: 12.5px;
  color: #3b332a;
  border-radius: 3px;
}
.fgmp-item:hover { background: #f0e6d3; }
.fgmp-item.active { background: rgba(181, 55, 42, .1); color: #8d281e; font-weight: 700; }
.fgmp-item i {
  font-family: "Roboto Mono", ui-monospace, monospace;
  font-size: 10px;
  font-style: normal;
  color: #8c8172;
  flex: none;
  width: 20px;
}
.fgmp-item span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fgmp-empty { font-size: 12px; color: #6d6357; text-align: center; padding: 12px 0; }

/* 外链播放器模式：隐藏本地音频才有的控件 */
.fgmp.mode-embed .fgmp-panel { width: 360px; max-width: calc(100vw - 44px); }
.fgmp.mode-embed .fgmp-progress,
.fgmp.mode-embed .fgmp-times,
.fgmp.mode-embed .fgmp-btn-play,
.fgmp.mode-embed .fgmp-vol { display: none; }
.fgmp.mode-embed .fgmp-controls { justify-content: center; }
.fgmp.mode-embed .fgmp-disc::after { animation: none; }
.fgmp.mode-embed .fgmp-disc::before { animation-duration: 12s; }

@media (max-width: 640px) {
  .fgmp { left: 14px; bottom: 14px; }
  .fgmp-panel { bottom: 60px; }
}
@media (prefers-reduced-motion: reduce) {
  .fgmp-disc::before,
  .fgmp-disc::after,
  .fgmp.need-click .fgmp-disc { animation: none; }
}
