/* PrayStation Music — camada global acima do conteúdo, abaixo de cookies/modais */
#praystation-player-root {
  position: fixed;
  inset: 0;
  z-index: var(--z-player, 5000);
  pointer-events: none;
  overflow: hidden;
  max-width: 100%;
}

#praystation-player-root .ps-music__shell {
  pointer-events: auto;
}

.ps-music {
  --psm-bg: #101024;
  --psm-border: rgba(34, 211, 238, 0.55);
  --psm-text: #f8fafc;
  --psm-muted: #94a3b8;
  --psm-yellow: #facc15;
}

[data-theme="light"] .ps-music {
  --psm-bg: #ffffff;
  --psm-border: rgba(37, 99, 235, 0.45);
  --psm-text: #101024;
  --psm-muted: #5b6178;
}

.ps-music__fab {
  position: absolute;
  right: var(--floating-right, 1rem);
  bottom: var(--music-fab-bottom, 5.25rem);
  width: var(--music-fab-size, 3.35rem);
  height: var(--music-fab-size, 3.35rem);
  border-radius: 999px;
  border: 2px solid var(--psm-yellow);
  background: linear-gradient(145deg, #18182f, #101024);
  color: var(--psm-yellow);
  font-size: 1.35rem;
  cursor: pointer;
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.45),
    0 0 0 4px rgba(250, 204, 21, 0.15);
  z-index: 2;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.ps-music__fab:hover,
.ps-music__fab:focus-visible {
  transform: scale(1.06);
  box-shadow:
    0 14px 36px rgba(0, 0, 0, 0.5),
    0 0 0 5px rgba(250, 204, 21, 0.28);
  outline: none;
}
.ps-music__fab.is-ready {
  animation: psm-fab-pulse 2.8s ease-in-out infinite;
}
.ps-music__fab.is-playing {
  animation: psm-fab-playing 1.2s ease-in-out infinite;
  border-color: var(--psm-yellow);
}
.ps-music__fab.is-minimized {
  /* bolinha de sessão ativa — um pouco maior no toque */
  width: 3.5rem;
  height: 3.5rem;
}
@keyframes psm-fab-pulse {
  0%, 100% { box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45), 0 0 0 4px rgba(250, 204, 21, 0.15); }
  50% { box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45), 0 0 0 7px rgba(250, 204, 21, 0.28); }
}
@keyframes psm-fab-playing {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45), 0 0 0 4px rgba(250, 204, 21, 0.25);
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.5), 0 0 0 8px rgba(250, 204, 21, 0.35);
  }
}
@media (prefers-reduced-motion: reduce) {
  .ps-music__fab.is-ready,
  .ps-music__fab.is-playing { animation: none; }
}

/*
 * Stage estacionado: mantém o iframe YT montado para o áudio continuar,
 * sem left negativo (evita expandir/deslocar o documento em alguns browsers).
 */
.ps-music__stage-park {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  pointer-events: none;
}
.ps-music__stage.is-parked {
  position: absolute !important;
  left: 0 !important;
  top: 0 !important;
  width: 360px !important;
  height: 200px !important;
  opacity: 0.01;
  pointer-events: none;
  max-width: none;
  z-index: -1;
}

.ps-music__mini {
  position: absolute;
  right: 1rem;
  bottom: 5.25rem;
  width: min(360px, calc(100% - 2rem));
  background: var(--psm-bg);
  color: var(--psm-text);
  border: 1px solid var(--psm-border);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  touch-action: none;
}

.ps-music__mini[hidden],
.ps-music__panel[hidden],
.ps-music__fab[hidden] {
  display: none !important;
}

.ps-music__drag {
  cursor: grab;
  padding: 0.5rem 0.75rem 0.2rem;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--psm-muted);
  user-select: none;
}
.ps-music__drag:active { cursor: grabbing; }

.ps-music__mini-body {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.25rem 0.75rem 0.55rem;
}

.ps-music__thumb {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  object-fit: cover;
  background: #1a1a3a;
}

.ps-music__meta strong {
  display: block;
  font-size: 0.88rem;
  line-height: 1.25;
}
.ps-music__meta span {
  display: block;
  font-size: 0.75rem;
  color: var(--psm-muted);
}

.ps-music__controls {
  display: flex;
  gap: 0.2rem;
  align-items: center;
}
.ps-music__controls button {
  border: 0;
  background: transparent;
  color: var(--psm-text);
  font-size: 1.15rem;
  cursor: pointer;
  padding: 0.35rem;
  min-width: 2rem;
  min-height: 2rem;
  border-radius: 8px;
}
.ps-music__controls button:hover,
.ps-music__controls button:focus-visible {
  outline: 2px solid var(--psm-yellow);
  outline-offset: 1px;
}
.ps-music__controls button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.ps-music__play {
  background: var(--psm-yellow) !important;
  color: #101024 !important;
  font-weight: 800;
  border-radius: 999px !important;
}

/* Stage persistente: NUNCA display:none enquanto houver faixa — evita matar o YT */
.ps-music__stage {
  width: 100%;
  background: #000;
}
.ps-music__stage.is-compact {
  height: 160px;
}
.ps-music__stage.is-expanded {
  height: 210px;
}
.ps-music__stage iframe,
.ps-music__stage > div {
  width: 100% !important;
  height: 100% !important;
}
.ps-music__stage[hidden] {
  /* não usar display:none no stage ativo — ver JS */
}

.ps-music__status {
  padding: 0.35rem 0.75rem 0.55rem;
  font-size: 0.75rem;
  color: var(--psm-muted);
}

.ps-music__panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(400px, 100%);
  height: 100%;
  background: var(--psm-bg);
  color: var(--psm-text);
  border-left: 1px solid var(--psm-border);
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
}

.ps-music__panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}
.ps-music__panel-head h2 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0.06em;
}

.ps-music__now {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.ps-music__fallback {
  margin: 0.5rem 0.75rem 0.75rem;
  padding: 0.75rem;
  border-radius: 10px;
  background: rgba(248, 113, 113, 0.12);
  color: #fecaca;
  font-size: 0.88rem;
}
.ps-music__fallback a { color: var(--psm-yellow); }

.ps-music__list {
  list-style: none;
  margin: 0;
  padding: 0.5rem;
  overflow: auto;
  flex: 1;
}
.ps-music__list li {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.55rem;
  border-radius: 10px;
  cursor: pointer;
}
.ps-music__list li:hover,
.ps-music__list li.is-active {
  background: rgba(124, 58, 237, 0.28);
}
.ps-music__list img {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  background: #1a1a3a;
}
.ps-music__list strong { display: block; font-size: 0.85rem; }
.ps-music__list span { display: block; font-size: 0.72rem; color: var(--psm-muted); }

@media (max-width: 768px) {
  .ps-music__mini {
    left: 0.75rem;
    right: 0.75rem;
    width: auto;
    bottom: calc(4.85rem + env(safe-area-inset-bottom, 0px));
  }
  .ps-music__fab {
    right: 0.85rem;
    bottom: calc(4.85rem + env(safe-area-inset-bottom, 0px));
  }
  /* Espelho dos tokens para o Social FAB acompanhar no mobile */
  :root {
    --floating-right: 0.85rem;
    --music-fab-bottom: calc(4.85rem + env(safe-area-inset-bottom, 0px));
  }
  .ps-music__drag { cursor: default; }
  .ps-music__panel { width: 100%; max-width: 100%; }
}
