<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta name="format-detection" content="telephone=no">
    <meta name="viewport" content="initial-scale=1, width=device-width, viewport-fit=cover">
    <meta name="color-scheme" content="light dark">

    <script src="cordova.js"></script>

    <script>
        document.addEventListener("deviceready", function() {
            screen.orientation.lock('portrait').then(function() {

            }).catch(function(error) {

            });
        }, false);
    </script>

    <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-WWGKM3W9');</script>

</head>
<body>
<script src="cordova.js"></script>
<script src="js/phaser.js"></script>
<script src="js/game.js"></script>

<script>
    // Убедитесь, что Cordova готова
    document.addEventListener('deviceready', () => {
        console.log('Cordova is ready');

        // Событие для паузы
        document.addEventListener('pause', () => {
            console.log('Application paused');
            if (window.phaserGame) {
                const currentScene = window.phaserGame.scene.getScenes(true)[0];
                if (currentScene) {
                    currentScene.sound.pauseAll(); // Пауза всех звуков
                }
            }
        }, false);

        // Событие для возобновления
        document.addEventListener('resume', () => {
            console.log('Application resumed');
            if (window.phaserGame) {
                const currentScene = window.phaserGame.scene.getScenes(true)[0];
                if (currentScene) {
                    currentScene.sound.resumeAll(); // Возобновление всех звуков
                }
            }
        }, false);
    }, false);
</script>

<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-WWGKM3W9"
                  height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
</body>
</html>