/* ==========================================================
   SANCTUARY 2.0 — PLAYER DE MÚSICA + MODO CONTEMPLATIVO
   Player flutuante persistente, modo fullscreen contemplativo
   ========================================================== */

/* ===== AMBIENT PLAYER (FLUTUANTE) ===== */
.ambient-player {
  position: fixed;
  bottom: calc(var(--s-5) + var(--tabbar-h) + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-fab);
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  background: var(--bg-glass);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-lg);
  max-width: 95vw;
  transition: all var(--t-normal);
}

.ambient-player[hidden] { display: none; }

.ambient-player__eq {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 18px;
  width: 24px;
}

.ambient-player__eq span {
  width: 3px;
  background: var(--gold-sacred);
  border-radius: var(--r-pill);
  animation: eq 1.2s ease-in-out infinite;
}

.ambient-player__eq span:nth-child(1) { animation-delay: 0s; }
.ambient-player__eq span:nth-child(2) { animation-delay: 0.2s; height: 60%; }
.ambient-player__eq span:nth-child(3) { animation-delay: 0.4s; height: 80%; }
.ambient-player__eq span:nth-child(4) { animation-delay: 0.6s; height: 50%; }

@keyframes eq {
  0%, 100% { height: 30%; }
  50% { height: 100%; }
}

.ambient-player.is-paused .ambient-player__eq span { animation-play-state: paused; }

.ambient-player__info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 120px;
}

.ambient-player__info strong {
  font-size: 0.85rem;
  color: var(--text-main);
}

.ambient-player__info small {
  font-size: 0.7rem;
  color: var(--text-light);
}

#ambient-volume {
  width: 80px;
  height: 4px;
  -webkit-appearance: none;
  background: var(--border);
  border-radius: var(--r-pill);
  cursor: pointer;
}

#ambient-volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  background: var(--gold-sacred);
  border-radius: 50%;
  cursor: pointer;
}

#ambient-volume::-moz-range-thumb {
  width: 14px; height: 14px;
  background: var(--gold-sacred);
  border: none;
  border-radius: 50%;
  cursor: pointer;
}

@media (min-width: 1200px) {
  .ambient-player {
    bottom: var(--s-5);
    left: var(--s-5);
    transform: none;
  }
}

@media (max-width: 767px) {
  .ambient-player__info { display: none; }
  #ambient-volume { display: none; }
}

/* ===== MODO CONTEMPLATIVO (TELA CHEIA) ===== */
.contemplative {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: none;
  flex-direction: column;
  background: var(--grad-aurora);
  background-size: 200% 200%;
  animation: auroraShift 30s ease-in-out infinite;
}

.contemplative.is-open {
  display: flex;
}

@keyframes auroraShift {
  0%, 100% { background-position: 0% 0%; }
  50% { background-position: 100% 100%; }
}

#contemplative-stars {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
}

.contemplative__close {
  position: absolute;
  top: calc(var(--s-5) + var(--safe-top));
  right: var(--s-5);
  width: 50px; height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: white;
  font-size: 1.2rem;
  z-index: 2;
  display: grid;
  place-items: center;
  transition: all var(--t-fast);
}

.contemplative__close:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: rotate(90deg);
}

.contemplative__content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-7);
  z-index: 1;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.contemplative__text {
  font-family: var(--font-prayer);
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  line-height: 1.6;
  color: white;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
  animation: fadeIn 1.5s ease;
  letter-spacing: 0.01em;
  max-width: 32ch;
}

.contemplative__controls {
  display: flex;
  justify-content: center;
  gap: var(--s-4);
  padding: var(--s-5) var(--s-5) calc(var(--s-7) + var(--safe-bottom));
  z-index: 1;
}

.ctl-btn {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: white;
  font-size: 1.1rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all var(--t-fast);
}

.ctl-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.1);
}

.ctl-btn:active { transform: scale(0.95); }

[data-action="contemplative-tts"] {
  width: 72px; height: 72px;
  background: var(--grad-dourado);
  border: none;
  font-size: 1.4rem;
  box-shadow: 0 0 30px var(--halo-gold);
}
