
document.addEventListener('DOMContentLoaded', function() {
    const music = document.getElementById('background-music');
    const musicToggle = document.getElementById('music-toggle');

    if (music && musicToggle) {
        musicToggle.addEventListener('click', function() {
            if (music.paused) {
                music.play();
                musicToggle.textContent = 'Pause Music';
            } else {
                music.pause();
                musicToggle.textContent = 'Play Music';
            }
        });
    }
});
