/* Somente o controle existente: mantém a caixa e o cálculo de largura originais.
 * O glifo invisível conserva a largura mínima original quando o flex encolhe.
 * A face circular se ajusta à largura disponível, sem deslocar os vizinhos.
 */
.sound-toggle {
  position: relative;
  display: inline-block;
  border-color: transparent;
  background: transparent;
  border-radius: 50%;
  -webkit-tap-highlight-color: transparent;
}
.sound-toggle::after { content: '♪'; visibility: hidden; }
.sound-toggle::before {
  content: '';
  position: absolute;
  left: -1px;
  top: 50%;
  width: calc(100% + 2px);
  aspect-ratio: 1;
  transform: translateY(-50%);
  border: 1px solid var(--line);
  border-radius: 50%;
  background: linear-gradient(145deg, #ffffff0d, #ffffff03);
  transition: background .22s ease, border-color .22s ease, box-shadow .22s ease;
  pointer-events: none;
}
.sound-toggle:hover::before { border-color: var(--red); }
.sound-toggle:focus-visible { outline: 2px solid var(--cream); outline-offset: 3px; }
.sound-toggle.playing { background: transparent; border-color: transparent; }
.sound-toggle.playing::before { background: var(--red); border-color: var(--red); box-shadow: 0 0 12px #ff304a33; }
.sound-spectrum {
  position: absolute;
  inset: 0;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 16px;
  pointer-events: none;
}
.sound-spectrum i {
  display: block;
  width: 2px;
  height: 12px;
  border-radius: 2px;
  background: currentColor;
  transform: scaleY(.25);
  transition: transform .2s ease;
}
.sound-spectrum i:nth-child(2), .sound-spectrum i:nth-child(4) { height: 16px; }
.sound-toggle.playing .sound-spectrum i { animation: sloop-music-spectrum .9s ease-in-out infinite alternate; }
.sound-toggle.playing .sound-spectrum i:nth-child(2) { animation-delay: -.35s; }
.sound-toggle.playing .sound-spectrum i:nth-child(3) { animation-delay: -.7s; }
.sound-toggle.playing .sound-spectrum i:nth-child(4) { animation-delay: -.15s; }
.sound-toggle.playing .sound-spectrum i:nth-child(5) { animation-delay: -.5s; }
@keyframes sloop-music-spectrum { from { transform: scaleY(.25); } to { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) {
  .sound-toggle::before, .sound-spectrum i { transition: none; }
  .sound-toggle.playing .sound-spectrum i { animation: none; transform: scaleY(.85); }
}
