.audio-toggle {
  position: fixed;
  z-index: 30;
  top: max(18px, env(safe-area-inset-top));
  right: 18px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 232, 166, 0.5);
  border-radius: 999px;
  background: rgba(55, 0, 8, 0.58);
  backdrop-filter: blur(10px);
  color: #ffebad;
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  transition: background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.audio-toggle:hover,
.audio-toggle:focus-visible {
  outline: 0;
  transform: translateY(-1px);
  border-color: #ffe5a0;
  background: rgba(164, 8, 25, 0.82);
}

.audio-toggle__icon {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  width: 13px;
  height: 14px;
}

.audio-toggle__icon i {
  display: block;
  width: 2px;
  border-radius: 2px;
  background: currentColor;
}

.audio-toggle__icon i:nth-child(1) { height: 5px; }
.audio-toggle__icon i:nth-child(2) { height: 10px; }
.audio-toggle__icon i:nth-child(3) { height: 7px; }

.audio-toggle.is-on {
  border-color: rgba(255, 229, 153, 0.82);
  background: rgba(177, 11, 31, 0.74);
  box-shadow: 0 0 0 4px rgba(255, 222, 143, 0.08), 0 7px 20px rgba(67, 0, 8, 0.28);
}

.audio-toggle.is-on .audio-toggle__icon i {
  animation: equalizer 970ms ease-in-out infinite alternate;
}

.audio-toggle.is-on .audio-toggle__icon i:nth-child(2) { animation-delay: 150ms; }
.audio-toggle.is-on .audio-toggle__icon i:nth-child(3) { animation-delay: 290ms; }

@keyframes equalizer {
  to { transform: scaleY(1.6); transform-origin: bottom; }
}

@media (min-width: 740px) {
  .audio-toggle { right: calc(50% - 340px); }
}

@media (prefers-reduced-motion: reduce) {
  .audio-toggle.is-on .audio-toggle__icon i { animation: none; }
}
