/* ============================================
   馥靈之鑰 Hour Light
   背景音樂控制模組 v1.0
   432Hz 療癒音樂
   ============================================ */

/* 音樂控制按鈕 - 固定右上角 */
.hl-music-toggle {
  position: fixed;
  top: 18px;
  right: 18px;
  width: 46px;
  height: 46px;
  background: rgba(10, 6, 24, 0.88);
  border: 1px solid rgba(233, 194, 125, 0.45);
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.3rem;
  color: #e9c27d;
  transition: all 0.3s ease;
  z-index: 9999;
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.hl-music-toggle:hover {
  background: rgba(233, 194, 125, 0.12);
  border-color: rgba(233, 194, 125, 0.7);
  box-shadow: 0 0 25px rgba(233, 194, 125, 0.35);
  transform: scale(1.05);
}

/* 播放中狀態 */
.hl-music-toggle.playing {
  border-color: #e9c27d;
  box-shadow: 0 0 20px rgba(233, 194, 125, 0.5);
  animation: hl-music-pulse 2s ease-in-out infinite;
}

/* 播放中的脈動動畫 */
@keyframes hl-music-pulse {
  0%, 100% {
    box-shadow: 0 0 15px rgba(233, 194, 125, 0.4);
  }
  50% {
    box-shadow: 0 0 25px rgba(233, 194, 125, 0.7);
  }
}

/* 音符漂浮動畫（播放時顯示） */
.hl-music-toggle.playing::before,
.hl-music-toggle.playing::after {
  content: '♪';
  position: absolute;
  font-size: 0.7rem;
  color: #e9c27d;
  opacity: 0;
  animation: hl-note-float 2s ease-in-out infinite;
}

.hl-music-toggle.playing::before {
  top: -5px;
  right: -5px;
  animation-delay: 0s;
}

.hl-music-toggle.playing::after {
  content: '♫';
  top: -8px;
  left: -3px;
  animation-delay: 1s;
}

@keyframes hl-note-float {
  0% {
    opacity: 0;
    transform: translateY(0) scale(0.8);
  }
  50% {
    opacity: 1;
    transform: translateY(-10px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-20px) scale(0.8);
  }
}

/* 手機版調整 */
@media (max-width: 768px) {
  .hl-music-toggle {
    top: 12px;
    right: 12px;
    width: 42px;
    height: 42px;
    font-size: 1.2rem;
  }
}

/* 如果頁面有其他固定元素在右上角，可以調整位置 */
.hl-music-toggle.offset-nav {
  top: 70px;
}
