/* ==========================================================================
   ЕДИНЫЙ ВЫСОКОТЕХНОЛОГИЧНЫЙ SOUND TOGGLE (ГОРИЗОНТАЛЬНАЯ КИБЕР-КАПСУЛА)
   Референс 1: Включённый звук — зелёная капсула (sound-toggle-on.webp)
   Референс 2: Выключенный звук — красная капсула (sound-toggle-off.webp)
   Плавное переключение без мигания и дёрганий
   ========================================================================== */

.sound-toggle {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 58px !important;
  min-width: 58px !important;
  max-width: 58px !important;
  height: 28px !important;
  min-height: 28px !important;
  max-height: 28px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  background: transparent !important;
  cursor: pointer !important;
  outline: none !important;
  touch-action: manipulation !important;
  -webkit-tap-highlight-color: transparent !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  position: relative !important;
  border-radius: 999px !important;
  flex-shrink: 0 !important;
  pointer-events: auto !important;
  box-sizing: border-box !important;
  isolation: isolate;
  overflow: visible !important;
  transition: transform 0.16s ease !important;
}

.sound-toggle:active {
  transform: scale(0.95) !important;
}

.sound-toggle:focus-visible {
  outline: 2px solid rgba(0, 230, 118, 0.8) !important;
  outline-offset: 2px !important;
}

/* Скрываем старые внутренние SVG и трек */
.sound-toggle__track,
.sound-toggle__thumb,
.sound-toggle__indicator,
.sound-toggle__icon {
  display: none !important;
}

/* Зелёное состояние (Sound ON / включён): Референс 1 */
.sound-toggle::before {
  content: '' !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background-image: url('../assets/sound-toggle-on.webp');
  background-size: contain !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  opacity: 1 !important;
  transform: scale(1) !important;
  transition: opacity 0.28s cubic-bezier(0.4, 0, 0.2, 1), transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), filter 0.28s ease !important;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.65)) drop-shadow(0 0 10px rgba(0, 230, 118, 0.55)) !important;
  pointer-events: none !important;
}

/* Красное состояние (Sound OFF / выключен): Референс 2 */
.sound-toggle::after {
  content: '' !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background-image: url('../assets/sound-toggle-off.webp');
  background-size: contain !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  opacity: 0 !important;
  transform: scale(0.97) !important;
  transition: opacity 0.28s cubic-bezier(0.4, 0, 0.2, 1), transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), filter 0.28s ease !important;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.65)) drop-shadow(0 0 10px rgba(255, 60, 60, 0.55)) !important;
  pointer-events: none !important;
}

.sound-toggle:hover::before {
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.75)) drop-shadow(0 0 14px rgba(0, 230, 118, 0.75)) !important;
}

.sound-toggle:hover::after {
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.75)) drop-shadow(0 0 14px rgba(255, 60, 60, 0.75)) !important;
}

/* При выключенном звуке (класс .is-muted): плавно показываем красную и скрываем зелёную */
.sound-toggle.is-muted::before {
  opacity: 0 !important;
  transform: scale(0.97) !important;
}

.sound-toggle.is-muted::after {
  opacity: 1 !important;
  transform: scale(1) !important;
}
