/* css/music.css — corner mute/unmute button for the background song */
.music-toggle {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 40;
  width: 2.9rem;
  height: 2.9rem;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 8px 22px var(--rose-soft);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease, opacity 0.3s ease;
}

.music-toggle:hover { transform: scale(1.06); }

/* speaker glyph drawn in CSS: a small body + two sound arcs */
.music-icon {
  position: relative;
  width: 1.2rem;
  height: 1.2rem;
  display: block;
}

.music-icon::before {
  content: "";
  position: absolute;
  left: 0.05rem;
  top: 0.3rem;
  width: 0.55rem;
  height: 0.6rem;
  background: var(--rose);
  clip-path: polygon(0 25%, 45% 25%, 100% 0, 100% 100%, 45% 75%, 0 75%);
}

.music-icon::after {
  content: "";
  position: absolute;
  left: 0.65rem;
  top: 0.18rem;
  width: 0.5rem;
  height: 0.84rem;
  border: 2px solid var(--rose);
  border-left: 0;
  border-radius: 0 0.6rem 0.6rem 0;
  box-sizing: border-box;
  transition: opacity 0.2s ease;
}

/* muted: arcs disappear, a slash appears */
.music-toggle.is-muted .music-icon::after { opacity: 0; }
.music-toggle.is-muted .music-icon {
  background: linear-gradient(135deg, transparent 46%, var(--rose) 46%, var(--rose) 54%, transparent 54%);
}

/* gentle pulse while playing */
.music-toggle.is-playing:not(.is-muted) {
  animation: music-pulse 2.4s ease-in-out infinite;
}
@keyframes music-pulse {
  0%, 100% { box-shadow: 0 8px 22px var(--rose-soft); }
  50%      { box-shadow: 0 8px 22px rgba(139, 47, 74, 0.3), 0 0 0 6px rgba(139, 47, 74, 0.08); }
}

@media (prefers-reduced-motion: reduce) {
  .music-toggle { animation: none !important; }
}
