/**
 * Floating Music Player — visual gamificado MEK-Over
 */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700&family=Outfit:wght@400;500;600;700&display=swap');

:root {
  --fmp-bg: linear-gradient(165deg, rgba(36, 30, 18, 0.98) 0%, rgba(12, 12, 18, 0.99) 55%, rgba(14, 12, 22, 0.98) 100%);
  --fmp-border: rgba(201, 162, 39, 0.55);
  --fmp-ornament: rgba(201, 162, 39, 0.75);
  --fmp-text: #f2ead8;
  --fmp-muted: #9a8f7a;
  --fmp-gold: #e8c547;
  --fmp-accent: #c9a227;
  --fmp-font: 'Outfit', 'Segoe UI', sans-serif;
  --fmp-display: 'Cinzel', Georgia, serif;
}

#floating-music-player.fmp-player {
  position: fixed;
  right: 20px;
  top: 20px;
  width: min(320px, calc(100vw - 32px));
  padding: 16px 14px 14px;
  z-index: 100050;
  pointer-events: auto;
  font-family: var(--fmp-font);
  color: var(--fmp-text);
  background: var(--fmp-bg);
  border: 1px solid var(--fmp-border);
  border-radius: 18px;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.45) inset,
    0 18px 50px rgba(0, 0, 0, 0.55),
    0 0 24px rgba(201, 162, 39, 0.08);
  transform: translateX(110%);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
}

#floating-music-player.fmp-player.is-visible {
  transform: translateX(0);
  opacity: 1;
}

#floating-music-player.fmp-player::before {
  content: '';
  position: absolute;
  inset: 10px;
  pointer-events: none;
  z-index: 0;
  background:
    linear-gradient(var(--fmp-ornament), var(--fmp-ornament)) left top / 18px 1.5px no-repeat,
    linear-gradient(var(--fmp-ornament), var(--fmp-ornament)) left top / 1.5px 18px no-repeat,
    linear-gradient(var(--fmp-ornament), var(--fmp-ornament)) right top / 18px 1.5px no-repeat,
    linear-gradient(var(--fmp-ornament), var(--fmp-ornament)) right top / 1.5px 18px no-repeat,
    linear-gradient(var(--fmp-ornament), var(--fmp-ornament)) left bottom / 18px 1.5px no-repeat,
    linear-gradient(var(--fmp-ornament), var(--fmp-ornament)) left bottom / 1.5px 18px no-repeat,
    linear-gradient(var(--fmp-ornament), var(--fmp-ornament)) right bottom / 18px 1.5px no-repeat,
    linear-gradient(var(--fmp-ornament), var(--fmp-ornament)) right bottom / 1.5px 18px no-repeat;
}

#floating-music-player.fmp-player > * {
  position: relative;
  z-index: 1;
}

.fmp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.fmp-head-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.fmp-live {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--fmp-gold);
  box-shadow: 0 0 10px rgba(232, 197, 71, 0.65);
  animation: fmpPulse 2s ease-in-out infinite;
  flex-shrink: 0;
}

.fmp-title {
  font-family: var(--fmp-display);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fmp-gold);
  white-space: nowrap;
}

.fmp-head-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.fmp-icon-btn {
  appearance: none;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(201, 162, 39, 0.28);
  color: var(--fmp-muted);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.fmp-icon-btn:hover {
  color: var(--fmp-gold);
  border-color: rgba(201, 162, 39, 0.55);
  background: rgba(201, 162, 39, 0.12);
}

.fmp-close {
  display: none;
  color: #f5a89f;
  border-color: rgba(244, 117, 106, 0.35);
}

.fmp-track-info {
  text-align: center;
  margin-bottom: 14px;
  padding: 10px 8px;
  border-radius: 12px;
  border: 1px solid rgba(201, 162, 39, 0.2);
  background: rgba(0, 0, 0, 0.28);
}

.fmp-track-name {
  font-family: var(--fmp-display);
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--fmp-text);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fmp-track-artist {
  font-size: 0.72rem;
  color: var(--fmp-muted);
}

.fmp-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 12px;
}

.fmp-ctrl {
  appearance: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(201, 162, 39, 0.28);
  background: rgba(12, 12, 18, 0.85);
  color: var(--fmp-text);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.15s, border-color 0.15s, color 0.15s;
}

.fmp-ctrl:hover {
  transform: scale(1.06);
  border-color: rgba(232, 197, 71, 0.55);
  color: var(--fmp-gold);
}

.fmp-play {
  appearance: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(232, 197, 71, 0.65);
  background: linear-gradient(165deg, #e8c547 0%, #c9a227 45%, #8a6914 100%);
  color: #1a1408;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 1rem;
  box-shadow: 0 6px 18px rgba(201, 162, 39, 0.35);
  transition: transform 0.15s, box-shadow 0.15s;
}

.fmp-play:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 22px rgba(232, 197, 71, 0.45);
}

.fmp-ctrl.is-active,
#loop-button.is-active {
  color: var(--fmp-gold);
  border-color: rgba(232, 197, 71, 0.55);
  background: rgba(201, 162, 39, 0.16);
}

.fmp-volume {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.fmp-volume #mute-button {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--fmp-muted);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
}

.fmp-volume #mute-button:hover {
  color: var(--fmp-gold);
  background: rgba(201, 162, 39, 0.1);
}

#volume-slider {
  flex: 1;
  height: 5px;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 999px;
  outline: none;
  cursor: pointer;
  background: linear-gradient(90deg, #9a7418 0%, #e8c547 30%, rgba(255, 255, 255, 0.08) 30%);
  border: 1px solid rgba(201, 162, 39, 0.22);
}

#volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(145deg, #f5e6a3, #c9a227);
  border: 2px solid #1a1408;
  box-shadow: 0 0 8px rgba(232, 197, 71, 0.45);
  cursor: pointer;
}

#volume-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(145deg, #f5e6a3, #c9a227);
  border: 2px solid #1a1408;
  cursor: pointer;
}

#volume-text {
  min-width: 36px;
  text-align: right;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--fmp-gold);
  font-family: var(--fmp-display);
}

.fmp-playlist {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.fmp-playlist.is-open {
  max-height: 220px;
  overflow-y: auto;
  margin-top: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 162, 39, 0.55) rgba(0, 0, 0, 0.25);
}

.fmp-playlist.is-open::-webkit-scrollbar {
  width: 6px;
}

.fmp-playlist.is-open::-webkit-scrollbar-thumb {
  background: rgba(201, 162, 39, 0.5);
  border-radius: 999px;
}

.fmp-playlist-inner {
  border-top: 1px solid rgba(201, 162, 39, 0.22);
  padding-top: 10px;
}

.fmp-playlist-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-family: var(--fmp-display);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fmp-gold);
}

.fmp-refresh {
  appearance: none;
  border: 1px solid rgba(201, 162, 39, 0.28);
  background: rgba(0, 0, 0, 0.25);
  color: var(--fmp-muted);
  width: 26px;
  height: 26px;
  border-radius: 7px;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
}

.fmp-refresh:hover {
  color: var(--fmp-gold);
  border-color: rgba(201, 162, 39, 0.5);
}

#playlist-tracks {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.playlist-track {
  appearance: none;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--fmp-text);
  cursor: pointer;
  text-align: left;
  font-family: var(--fmp-font);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.playlist-track:hover {
  background: rgba(201, 162, 39, 0.08);
  border-color: rgba(201, 162, 39, 0.22);
}

.playlist-track.is-active {
  background: rgba(201, 162, 39, 0.14);
  border-color: rgba(201, 162, 39, 0.4);
  color: var(--fmp-gold);
}

.playlist-track-name {
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.25;
}

.playlist-track-artist {
  font-size: 0.65rem;
  color: var(--fmp-muted);
  margin-top: 2px;
}

.playlist-track-icon {
  color: var(--fmp-gold);
  font-size: 0.7rem;
  flex-shrink: 0;
}

.fmp-empty {
  margin: 0;
  padding: 10px;
  text-align: center;
  font-size: 0.75rem;
  color: var(--fmp-muted);
  border: 1px dashed rgba(201, 162, 39, 0.25);
  border-radius: 10px;
}

.fmp-refresh.is-spinning i {
  animation: fmpSpin 0.8s linear infinite;
}

@keyframes fmpSpin {
  to { transform: rotate(360deg); }
}

/* Botão mobile na sidebar */
.mobile-player-btn,
#mobile-player-btn {
  color: inherit;
}

.mobile-player-btn i,
#mobile-player-btn i {
  color: var(--fmp-gold, #e8c547);
}

#mobile-player-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 4, 10, 0.72);
  z-index: 100049;
  display: none;
}

#mobile-player-overlay.is-visible {
  display: block;
}

@media (max-width: 768px) {
  #floating-music-player.fmp-player {
    top: 50%;
    left: 50%;
    right: auto;
    width: min(400px, 92vw);
    transform: translate(-50%, -50%) scale(0.96);
    opacity: 0;
    pointer-events: none;
  }

  #floating-music-player.fmp-player.is-visible {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: auto;
  }

  #floating-music-player.fmp-player .fmp-close {
    display: grid;
  }
}

@keyframes fmpPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.85); }
}
