<!DOCTYPE html>
<html lang="ru">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>LuckyJet</title>

    <style>
        @import url('https://fonts.googleapis.com/css2?family=Playwrite+IE+Guides&family=Rubik:ital,wght@0,300..900;1,300..900&display=swap');

        /* Классы для шрифтов */
        .playwrite-ie-guides-regular {
            font-family: "Playwrite IE Guides", serif;
            font-weight: 400;
            font-style: normal;
        }

        .rubik-custom {
            font-family: "Rubik", sans-serif;
            font-weight: 500;
            font-style: normal;
            font-optical-sizing: auto;
        }

        /* Применение старого стиля */
        body {
            margin: 0;
            padding: 0;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            height: 100vh;
            background-image: url('background.jpg');
            background-size: cover;
            font-family: 'Rubik', sans-serif;
            color: white;
            text-align: center;
            overflow: hidden;
        }

        .circle-button {
            width: 200px;
            height: 200px;
            border-radius: 50%;
            background-color: #1f2e72;
            border: 3px solid #00ffd5;
            display: flex;
            justify-content: center;
            align-items: center;
            font-size: 24px;
            color: white;
            cursor: pointer;
            margin-bottom: 20px;
            position: absolute;
            opacity: 0; /* Initially hidden */
            transition: opacity 0.6s ease-out;
            box-shadow: 0 0 20px rgba(0, 255, 213, 0.8), 0 0 10px #00ffd5;
            animation: glowRing 2s linear infinite; /* Glowing effect */
        }

        .number {
            font-size: 48px;
            transition: opacity 0.5s ease-in-out;
            opacity: 1;
        }

        .signal-button, .play-button {
            width: 220px;
            padding: 10px;
            margin: 10px 0;
            border: none;
            border-radius: 30px;
            font-size: 20px;
            background-color: #6c52f5;
            color: white;
            cursor: pointer;
            transition: transform 0.3s, background-color 0.3s, box-shadow 0.3s;
            box-shadow: 0 0 20px rgba(108, 82, 245, 0.7), 0 0 10px #6c52f5;
        }

        .signal-button:hover, .play-button:hover {
            transform: scale(1.05);
            background-color: #4a3bbb;
            box-shadow: 0 0 30px rgba(74, 59, 187, 0.9), 0 0 15px #4a3bbb;
        }

        img {
            max-width: 100%;
            height: auto;
            transition: transform 0.6s ease-out;
        }

        .button-container {
            display: flex;
            flex-direction: column;
            align-items: center;
            position: relative;
            z-index: 1;
            transition: transform 0.6s ease-out;
        }

        .moved-down {
            transform: translateY(225px); /* Move buttons down */
        }

        .logo-move-up {
            transform: translateY(-75px); /* Move logo up */
        }

        .loading-bar {
            width: 220px; /* Match width of signal button */
            height: 5px; /* Thin bar */
            background-color: #444;
            margin-top: 100px; /* Increased to move lower */
            border-radius: 5px;
            opacity: 0; /* Initially hidden */
            transition: opacity 0.5s ease-out;
        }

        .loading-progress {
            height: 100%;
            width: 0;
            background-color: #00ffd5;
            border-radius: 5px;
            transition: width 1s linear;
        }

        .countdown {
            margin-top: 20px; /* Increased margin to move further down */
            font-size: 24px;
            color: #00ffd5;
            opacity: 0;
            transition: opacity 0.5s ease-in-out;
        }

        /* Glowing ring animation */
        @keyframes glowRing {
            0% {
                box-shadow: 0 0 20px rgba(0, 255, 213, 0), 0 0 40px rgba(0, 255, 213, 0);
            }
            25% {
                box-shadow: 0 0 20px rgba(0, 255, 213, 0.5), 0 0 40px rgba(0, 255, 213, 0.5);
            }
            50% {
                box-shadow: 0 0 20px rgba(0, 255, 213, 0.8), 0 0 60px rgba(0, 255, 213, 0.8);
            }
            75% {
                box-shadow: 0 0 30px rgba(0, 255, 213, 1), 0 0 80px rgba(0, 255, 213, 1);
            }
            100% {
                box-shadow: 0 0 20px rgba(0, 255, 213, 0), 0 0 40px rgba(0, 255, 213, 0);
            }
        }

        /* Additional class for hiding the button permanently */
        .hidden {
            display: none;
        }
    </style>
</head>
<body>
    <img src="lucky-jet.svg" alt="Lucky Jet" style="width: 300px; margin-bottom: 20px;" id="logo">
    <div class="button-container" id="buttonContainer">
        <button class="signal-button" id="signalButton" onclick="generateSignal()">GET A SIGNAL</button>
        <button class="play-button" onclick="window.location.href='https://example.com'">GAME HERE</button>
    </div>
    <div class="circle-button" id="signalCircle">
        <div class="number" id="numberDisplay"></div>
    </div>

    <div class="loading-bar" id="loadingBar">
        <div class="loading-progress" id="loadingProgress"></div>
    </div>
    <div class="countdown" id="countdownDisplay"></div>

    <audio id="notificationSound" src="Notify.mp3" preload="auto"></audio>

    <script>
        let isGenerating = false;
        let cooldownTime = 0;
        let lastCoefficient = null;
        let countdownInterval;

        function generateSignal() {
            if (isGenerating) {
                return;
            }

            const signalButton = document.getElementById('signalButton');
            signalButton.classList.add('hidden'); // Убираем кнопку "GET A SIGNAL" навсегда

            const logo = document.getElementById('logo');
            logo.classList.add('logo-move-up');

            const buttonContainer = document.getElementById('buttonContainer');
            buttonContainer.classList.add('moved-down');

            const signalCircle = document.getElementById('signalCircle');
            setTimeout(() => {
                signalCircle.style.opacity = '1'; 
            }, 600);

            startSignalGeneration();
        }

        function startSignalGeneration() {
            isGenerating = true;

            setTimeout(() => {
                const loadingBar = document.getElementById('loadingBar');
                loadingBar.style.opacity = '1'; // Показываем полосу
                const loadingProgress = document.getElementById('loadingProgress');
                const countdownDisplay = document.getElementById('countdownDisplay');
                countdownDisplay.style.opacity = '1'; // Показываем таймер
            }, 500);

            generateNewSignal();
        }

        function generateNewSignal() {
            const numberDisplay = document.getElementById('numberDisplay');
            const min = 1.5;
            const max = 5.0;
            let coefficient;

            do {
                coefficient = (Math.random() * (max - min) + min).toFixed(2);
            } while (coefficient === lastCoefficient);

            lastCoefficient = coefficient;
            numberDisplay.style.opacity = '0';

            setTimeout(() => {
                numberDisplay.textContent = 'x' + coefficient;
                numberDisplay.style.opacity = '1';
                playNotificationSound();
            }, 500);

            startCooldown(); // Запускаем отсчет
        }

        function startCooldown() {
            cooldownTime = 60; // Set countdown to 60 seconds

            const countdownDisplay = document.getElementById('countdownDisplay');
            countdownDisplay.textContent = cooldownTime + ' seconds';

            clearInterval(countdownInterval);
            countdownInterval = setInterval(updateCountdown, 1000);
        }

        function updateCountdown() {
            cooldownTime--;

            const countdownDisplay = document.getElementById('countdownDisplay');
            countdownDisplay.textContent = cooldownTime + ' seconds';

            const loadingProgress = document.getElementById('loadingProgress');
            loadingProgress.style.width = ((60 - cooldownTime) / 60) * 100 + '%'; 

            if (cooldownTime <= 0) {
                clearInterval(countdownInterval);
                setTimeout(() => {
                    generateNewSignal(); // Generate new signal after 3 seconds
                }, 3000); // 3 seconds wait
            }
        }

        function playNotificationSound() {
            const notificationSound = document.getElementById('notificationSound');
            notificationSound.play();
        }
    </script>
</body>
</html>
