pauseBgm method

void pauseBgm()

Pauses the music when the app goes to background (lifecycle paused/inactive/hidden). Keeps _bgmPlaying = true so it knows there's music to resume when coming back.

Implementation

void pauseBgm() {
  if (!_bgmPlaying || muted.value) return;
  _ignoreAudio(_bgm.pause());
}