/* Shared background-music control (see music.js) - the floating button sits
   in the same top-right corner on every template, guest-facing toggle or
   host edit-mode control alike. Deliberately neutral (near-black/white, no
   template accent colour) since one file now serves papercut's purple/cream
   palette, rose-invitation's brown/rose palette, and the plain simple-card /
   simple-announcement cards alike. */
.music-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 90;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: #2b2b2b;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.14);
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}

/* While editing or previewing, the floating edit toolbar sits along the top
   edge; drop the music toggle below it so the bar's buttons don't cover it. */

.music-toggle:hover {
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.music-toggle:active {
  transform: scale(0.94);
}

.music-toggle:focus-visible {
  outline: 2px solid #2b2b2b;
  outline-offset: 3px;
}

.music-toggle__icon {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

/* Show the sound-on icon by default; swap to the muted icon when muted. */
.music-toggle__icon--off {
  display: none;
}

.music-toggle.is-muted .music-toggle__icon--on {
  display: none;
}

.music-toggle.is-muted .music-toggle__icon--off {
  display: inline;
}

.music-toggle.is-muted {
  color: rgba(43, 43, 43, 0.55);
}

@media (max-width: 700px) {
  .music-toggle {
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
  }

  .music-toggle__icon {
    width: 20px;
    height: 20px;
  }
}

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

