<html lang="en"><head>

    <meta charset="UTF-8">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>𝐖𝐈𝐍𝐆𝐎 𝟏 𝐌𝐈𝐍 𝐏𝐑𝐄𝐃𝐈𝐂𝐓𝐈𝐎𝐍</title>

    <script src="js/chart.js"></script>
    
        <script src="https://www.gstatic.com/firebasejs/8.10.0/firebase-app.js"></script>

    <script src="https://www.gstatic.com/firebasejs/8.10.0/firebase-database.js"></script>
    

    <style>

        /* General Styles */
        body {
            font-family: 'Arial', sans-serif;
            background-color: #000;
            color: white;
            margin: 0;
            padding: 0;
            text-align: center;
            overflow-x: hidden;
        }

        /* Login Box */
        .login-container {
            background: rgba(0, 0, 0, 0.2);
            padding: 30px;
            border-radius: 15px;
            box-shadow: 0 0 25px rgba(255, 255, 255, 0.3);
            text-align: center;
            width: 320px;
            backdrop-filter: blur(10px);
            position: relative;
            animation: rainbowBorder 5s linear infinite; /* Rainbow border animation */
        }

        @keyframes rainbowBorder {
            0% {
                border: 5px solid red;
                box-shadow: 0 0 15px red;
            }
            14% {
                border: 5px solid orange;
                box-shadow: 0 0 15px orange;
            }
            28% {
                border: 5px solid yellow;
                box-shadow: 0 0 15px yellow;
            }
            42% {
                border: 5px solid green;
                box-shadow: 0 0 15px green;
            }
            57% {
                border: 5px solid cyan;
                box-shadow: 0 0 15px cyan;
            }
            71% {
                border: 5px solid blue;
                box-shadow: 0 0 15px blue;
            }
            85% {
                border: 5px solid purple;
                box-shadow: 0 0 15px purple;
            }
            100% {
                border: 5px solid red;
                box-shadow: 0 0 15px red;
            }
        }

        h2 {
            margin-bottom: 20px;
            color: #fff;
        }

        /* Input Fields */
        .input-box {
            width: 100%;
            padding: 12px;
            margin: 10px 0;
            border: none;
            border-radius: 5px;
            background: rgba(255, 255, 255, 0.1);
            color: white;
            outline: none;
            transition: 0.3s;
            font-size: 16px;
        }

        .input-box:focus {
            background: rgba(255, 255, 255, 0.2);
            box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
        }

        /* Glowing Button */
        .login-btn, .telegram-btn {
            width: 100%;
            padding: 12px;
            border: none;
            border-radius: 5px;
            font-size: 16px;
            color: white;
            cursor: pointer;
            position: relative;
            overflow: hidden;
            text-transform: uppercase;
            transition: 0.3s;
            margin-top: 15px;
        }

        .login-btn {
            background: linear-gradient(90deg, #ff416c, #ff4b2b);
        }

        .telegram-btn {
            background: linear-gradient(90deg, #0088cc, #00c6ff);
        }

        .login-btn:hover, .telegram-btn:hover {
            box-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
        }

        .login-btn::before, .telegram-btn::before {
            content: "";
            position: absolute;
            top: 50%;
            left: 50%;
            width: 300%;
            height: 300%;
            background: rgba(255, 255, 255, 0.3);
            transition: 0.6s;
            border-radius: 50%;
            transform: translate(-50%, -50%) scale(0);
        }

        .login-btn:active::before, .telegram-btn:active::before {
            transform: translate(-50%, -50%) scale(1);
            opacity: 0;
            transition: 0s;
        }

        /* Message Display */
        #message {
            margin-top: 15px;
            font-size: 14px;
            color: #ff4b2b;
        }

        /* Telegram Button Styling */
        .telegram-btn {
            background: linear-gradient(90deg, #0088cc, #00c6ff);
        }

        /* Hover effect on Telegram Button */
        .telegram-btn:hover {
            box-shadow: 0 0 20px rgba(0, 204, 255, 0.8);
        }

    /* Dashboard (Initially Hidden) */
        .dashboard {
            display: none;
            text-align: center;
            padding: 0px;
            }

        /* Card Design */
        .card {
            max-width: 90%;
            margin: 20px auto;
            padding: 20px;
            border-radius: 8px;
            background: rgba(255, 0, 0, 0.2);
            border: 2px solid #ff0000;
            box-shadow: 0px 0px 20px #ff0000;
        }

        /* Glowing Buttons */
        .glow-button {
            display: inline-block;
            padding: 10px 20px;
            border-radius: 5px;
            text-decoration: none;
            color: white;
            font-weight: bold;
            transition: 0.3s;
            background: linear-gradient(90deg, #ff0000, #00ff00);
            box-shadow: 0px 0px 20px #ff0000;
        }

        .glow-button:hover {
            transform: scale(1.1);
            box-shadow: 0px 0px 30px #ff0000;
        }

        /* Table Styling */
        table {
            width: 100%;
            border-collapse: collapse;
            background: rgba(0, 0, 0, 0.7);
            color: white;
        }

        th, td {
            padding: 12px;
            text-align: center;
            border-bottom: 1px solid #ff0000;
        }

        th {
            background: #ff0000;
            color: black;
            font-weight: bold;
        }

        tr:hover {
            background: rgba(255, 0, 0, 0.3);
        }

        /* Responsive Design */
        @media (max-width: 768px) {
            h1 { font-size: 1.5em; }
            .card { padding: 15px; }
            th, td { font-size: 14px; padding: 8px; }
        }

            .card {

                padding: 15px;

            }
            
            
        #predictionChart {

            width: 100%;

            height: 250px; /* Fixed height */

            border: 2px solid #FFFF00;

            border-radius: 8px;

            background-color: #FFFFFF;

        }

        .pagination {

            display: flex;

            justify-content: center;

            margin-top: 20px;

        }

        .pagination button {

            padding: 10px 20px;

            margin: 0 5px;

            border: none;

            border-radius: 5px;

            background-color: #FFFF00;

            color: black;

            cursor: pointer;

            transition: background-color 0.3s ease, transform 0.2s ease;

        }

        .pagination button:hover {

            background-color: #FF0000;

            transform: scale(1.05);

        }

        .pagination button:disabled {

            background-color: #DDDDDD;

            cursor: not-allowed;

        }

        #timeRemaining {

            font-size: 24px;

            font-weight: bold;

            text-align: center;

        }

        #predictedNumber, #predictedPremium {

            font-size: 18px;

            text-align: center;

            margin: 10px 0;

        }

            th, td {

                padding: 8px;

                font-size: 14px;

            }

            #timeRemaining {

                font-size: 20px;

            }

            #predictedNumber, #predictedPremium {

                font-size: 16px;

            }

            #predictionChart {

                height: 200px; /* Adjusted height for mobile */

            }

        }

        @media (max-width: 480px) {

            th, td {

                font-size: 12px;

            }

            #timeRemaining {

                font-size: 18px;

            }

            #predictedNumber, #predictedPremium {

                font-size: 14px;

            }

            #predictionChart {

                height: 180px; /* Further adjustment for very small screens */

            }
            
                    #dataTable, #predictionHistoryTable {

            width: 100%;

            border-radius: 8px;

            overflow: hidden;

            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);

            background-color: #FFFFFF;

        }
        
                .button-group {

            display: flex;

            justify-content: center;

            margin: 20px 0;

        }

        .button-group a {

            padding: 10px 20px;

            margin: 0 10px;

            border-radius: 5px;

            cursor: pointer;

            text-decoration: none; /* Remove underline */

            color: white; /* Text color */

            display: inline-block; /* Make anchor behave like a button */

            transition: background-color 0.3s ease, transform 0.2s ease;

        }
        
                .button-group a:hover {

            transform: scale(1.05);

        }
        


    </style>


</head>

<body>

<div class="mainContent">
        <!-- Login Form -->
        <div class="login-container" id="loginBox">
            <h2>Login</h2>
            <form id="loginForm">
                <input type="email" id="email" class="input-box" placeholder="Enter Email" required>
                <input type="password" id="password" class="input-box" placeholder="Enter Password" required>
                <button type="submit" class="login-btn">Login</button>
            </form>
            <p id="message"></p>
            <a href="https://t.me/tradegenius07" target="_blank">
                <button class="telegram-btn">Join Us on Telegram</button>
            </a>
        </div>

    <!-- Main Content -->
    <div class="dashboard" id="dashboard">


    <h1>𝐖𝐈𝐍𝐆𝐎 𝟏 𝐌𝐈𝐍 𝐏𝐑𝐄𝐃𝐈𝐂𝐓𝐈𝐎𝐍</h1>
    
                <p id="message"></p>
            <a href="https://55club.game/#/register?invitationCode=83422115232" target="_blank">
                <button class="telegram-btn">REGISTER NOW!!</button>
            </a>

    <div class="card">

        <h2>©TradeGenius07™</h2>

        <p id="predictedNumber">Prediction :--</p>

        <p id="predictedPremium">Enjoy: --</p>

    </div>

    <div class="card">

        <h2>Timer</h2>

        <p id="timeRemaining">--:--</p>

        

    <div class="button-group">

    </div>

    </div>

    <div class="card">

        <h2>Collected Data</h2>

        <table id="dataTable">

            <thead>

                <tr>

                    <th>Issue Number</th>

                    <th>Number</th>

                    <th>Colour</th>

                    <th>Premium</th>

                </tr>

            </thead>

            <tbody>

                <!-- Data rows will be inserted here -->

            </tbody>

        </table>

    </div>

    <div class="card">

        <h2>Prediction History</h2>

        <table id="predictionHistoryTable">

            <thead>

                <tr>

                    <th>Issue Number</th>

                    <th>Predicted Number</th>

                    <th>Actual Number</th>

                    <th>Result</th>

                </tr>

            </thead>

            <tbody></tbody>

        </table>

        <div class="pagination">

            <button id="prevPage" disabled="">Previous</button>

            <button id="nextPage" disabled="">Next</button>

        </div>

    </div>

    <div class="card">

        <h2>Devloper  @TradeGenius07™</h2>

        <div class="button-group">

            <p id="message"></p>
            <a href="https://t.me/tradegenius07" target="_blank">
                <button class="telegram-btn">Join Us on Telegram</button>
            </a>

    </div>

<script>

document.addEventListener('DOMContentLoaded', function() {

    const tableBody = document.querySelector('#dataTable tbody');

    const predictedNumberElement = document.getElementById('predictedNumber');

    const predictedPremiumElement = document.getElementById('predictedPremium');

    const timerElement = document.getElementById('timeRemaining');

    const historyTableBody = document.querySelector('#predictionHistoryTable tbody');

    const prevPageButton = document.getElementById('prevPage');

    const nextPageButton = document.getElementById('nextPage');

    let predictionHistory = JSON.parse(localStorage.getItem('predictionHistory')) || [];

    let lastPrediction = JSON.parse(localStorage.getItem('lastPrediction'));

    let currentPrediction = JSON.parse(localStorage.getItem('currentPrediction'));

    let currentPage = 0;

    const itemsPerPage = 10;

    let timerInterval;

    const fetchNoAverageEmerdList = () => {

        const requestData = {

            pageSize: 10,

            pageNo: 1,

            typeId: 1,

            language: 0,

            random: "ded40537a2ce416e96c00e5218f6859a",

            signature: "69306982EEEB19FA940D72EC93C62552",

            timestamp: Math.floor(Date.now() / 1000)

        };

        return fetch('https://api.bdg88zf.com/api/webapi/GetNoaverageEmerdList', {

            method: 'POST',

            headers: {

                'Content-Type': 'application/json;charset=UTF-8',

                'Accept': 'application/json, text/plain, */*'

            },

            body: JSON.stringify(requestData)

        })

        .then(response => response.json())

        .catch(error => console.error('Error fetching no average EMERD list data:', error));

    };

    const fetchGameIssue = () => {

        const requestData = {

            typeId: 1,

            language: 0,

            random: "f8dcb5c527814db68800e3946a2b60e8",

            signature: "08CF7FF3339ED58D4743F4B650FCBEA9",

            timestamp: Math.floor(Date.now() / 1000)

        };

        return fetch('https://api.bdg88zf.com/api/webapi/GetGameIssue', {

            method: 'POST',

            headers: {

                'Content-Type': 'application/json;charset=UTF-8',

                'Accept': 'application/json, text/plain, */*'

            },

            body: JSON.stringify(requestData)

        })

        .then(response => response.json())

        .catch(error => console.error('Error fetching game issue:', error));

    };
  
          const predictedNumber = (number) => {

        if (number >= 0 && number <= 4) return 'SMALL';

        

        if (number >= 5 && number <= 9) return 'BIG';

      
        return 'Unknown';

    };
    
    

    const categorizeNumber = (number) => {



        if (number >= 0 && number <= 4) return 'SMALL';

        

        if (number >= 5 && number <= 9) return 'BIG';

        
        
        return 'Unknown';

    };

    const generateRandomPrediction = () => {

        const randomNumber = Math.floor(Math.random() * 10);

        const randomCategory = categorizeNumber(randomNumber);

        return { number: randomNumber, category: randomCategory };

    };

    const updateDataAndPrediction = () => {

        fetchNoAverageEmerdList()

            .then(data => {

                const list = data.data.list;

                tableBody.innerHTML = '';

                list.forEach(item => {

                    const numberCategory = categorizeNumber(Number(item.number));

                    const row = document.createElement('tr');

                    row.innerHTML = `

                        <td>${item.issueNumber}</td>

                        <td>${item.number} (${numberCategory})</td>

                        <td>${item.colour}</td>

                        <td>${item.premium}</td>

                    `;

                    tableBody.appendChild(row);

                });

                const latestIssue = list[0].issueNumber;

                const latestActual = Number(list[0].number);

                const actualCategory = predictedNumber(latestActual);

                if (!lastPrediction || lastPrediction.issueNumber !== latestIssue) {

                    if (lastPrediction) {

                        const result = (lastPrediction.category === actualCategory) ? 'Win' : 'Loss';

                        predictionHistory.unshift({

                            issueNumber: latestIssue,

                            predictedNumber: lastPrediction.number,

                            actualNumber: latestActual,

                            result: result

                        });

                        localStorage.setItem('predictionHistory', JSON.stringify(predictionHistory));

                    }

                    currentPrediction = generateRandomPrediction();

                    currentPrediction.issueNumber = latestIssue;

                    localStorage.setItem('currentPrediction', JSON.stringify(currentPrediction));

                }

                predictedNumberElement.textContent = `Prediction: ${currentPrediction.number} (${currentPrediction.category})`;

                predictedPremiumElement.textContent = `:`;

                lastPrediction = {

                    issueNumber: latestIssue,

                    number: currentPrediction.number,

                    category: currentPrediction.category

                };

                localStorage.setItem('lastPrediction', JSON.stringify(lastPrediction));

                updatePredictionHistoryTable();

            })

            .catch(error => console.error('Error updating data and prediction:', error));

    };

    const updatePredictionHistoryTable = () => {

        historyTableBody.innerHTML = '';

        const start = currentPage * itemsPerPage;

        const end = start + itemsPerPage;

        const paginatedHistory = predictionHistory.slice(start, end);

        paginatedHistory.forEach(entry => {

            const row = document.createElement('tr');

            row.innerHTML = `

                <td>${entry.issueNumber}</td>

                <td>${entry.predictedNumber}</td>

                <td>${entry.actualNumber}</td>

                <td>${entry.result}</td>

            `;

            historyTableBody.appendChild(row);

        });

        prevPageButton.disabled = currentPage === 0;

        nextPageButton.disabled = end >= predictionHistory.length;

    };

    const updateTimer = () => {

        fetchGameIssue()

            .then(data => {

                const { endTime } = data.data;

                const endDate = new Date(endTime);

                const now = new Date();

                const remainingTimeMs = endDate - now;

                if (remainingTimeMs <= 0) {

                    timerElement.textContent = "Time Remaining: 00:00:00";

                    clearInterval(timerInterval);

                    updateDataAndPrediction();

                    updateTimer();

                } else {

                    const hours = String(Math.floor(remainingTimeMs / (1000 * 60 * 60))).padStart(2, '0');

                    const minutes = String(Math.floor((remainingTimeMs % (1000 * 60 * 60)) / (1000 * 60))).padStart(2, '0');

                    const seconds = String(Math.floor((remainingTimeMs % (1000 * 60)) / 1000)).padStart(2, '0');

                    timerElement.textContent = `Time Remaining: ${hours}:${minutes}:${seconds}`;

                }

            })

            .catch(error => console.error('Error fetching game issue for timer:', error));

    };

    // Pagination controls

    prevPageButton.addEventListener('click', () => {

        if (currentPage > 0) {

            currentPage--;

            updatePredictionHistoryTable();

        }

    });

    nextPageButton.addEventListener('click', () => {

        if ((currentPage + 1) * itemsPerPage < predictionHistory.length) {

            currentPage++;

            updatePredictionHistoryTable();

        }

    });

    // Initialize data and start the timer

    updateDataAndPrediction();

    updateTimer();

    timerInterval = setInterval(() => {

        updateTimer();

        updateDataAndPrediction();

    }, 1000); // Update every 10 seconds

    // Load initial prediction history table

    updatePredictionHistoryTable();

});

 </script>

    <!-- Firebase Integration and Login Handling -->

<script>
    // Firebase Configuration
    const firebaseConfig = {
        apiKey: "AIzaSyAwUjC7CaA1QJSTwrKFP-W8fXXskDKoFQo",
        authDomain: "tradegenius07-panel.firebaseapp.com",
        databaseURL: "https://tradegenius07-panel-default-rtdb.firebaseio.com",
        projectId: "tradegenius07-panel",
        storageBucket: "tradegenius07-panel.firebasestorage.app",
        messagingSenderId: "746554117507",
        appId: "1:746554117507:android:4b569abb5bb8d53e4a7ab6"
    };

    // Initialize Firebase
    firebase.initializeApp(firebaseConfig);
    const database = firebase.database();

    // Login Function
    document.getElementById('loginForm').addEventListener('submit', function(event) {
        event.preventDefault();

        var email = document.getElementById('email').value;
        var password = document.getElementById('password').value;

        // Database se email aur password match karna
        database.ref('users').once('value', function(snapshot) {
            let isValidUser = false;

            snapshot.forEach(function(childSnapshot) {
                let userData = childSnapshot.val();

                // Check if email and password match
                if (userData.email === email && userData.password === password) {
                    // Convert the expiry date string (e.g., '202502010850') to a Date object
                    let currentDate = new Date();
                    let expiryStr = userData.expiry; // Format: 'YYYYMMDDHHMM'
                    
                    // Extract year, month, day, hour, and minute from the expiry string
                    let expiryYear = parseInt(expiryStr.substring(0, 4), 10);
                    let expiryMonth = parseInt(expiryStr.substring(4, 6), 10) - 1; // Month is 0-based in JavaScript
                    let expiryDay = parseInt(expiryStr.substring(6, 8), 10);
                    let expiryHour = parseInt(expiryStr.substring(8, 10), 10);
                    let expiryMinute = parseInt(expiryStr.substring(10, 12), 10);

                    // Create a Date object for the expiry date
                    let expiryDate = new Date(expiryYear, expiryMonth, expiryDay, expiryHour, expiryMinute);

                    // Check if current date is after expiry date
                    if (currentDate > expiryDate) {
                        // Expiry has passed
                        document.getElementById('message').innerText = "Your account has expired!";
                        document.getElementById('message').style.color = "#ff4b2b";
                        isValidUser = false;
                    } else {
                        // Valid user and expiry is not passed
                        isValidUser = true;
                    }
                }
            });

            // Proceed with login if valid user and not expired
            if (isValidUser) {
                document.getElementById('message').innerText = "Login Successful!";
                document.getElementById('message').style.color = "#00ff00";

                // 1 Second ke baad login form hide kare aur dashboard show kare
                setTimeout(() => {
                    document.getElementById('loginBox').style.display = "none"; // Hide Login Box
                    document.getElementById('dashboard').style.display = "block"; // Show Dashboard
                }, 1000);
            } else {
                document.getElementById('message').innerText = "Invalid Email or Password!";
                document.getElementById('message').style.color = "#ff4b2b";
            }
        });
    });

    // Logout Function
    function logout() {
        document.getElementById('loginBox').style.display = "block"; // Show Login Form
        document.getElementById('dashboard').style.display = "none"; // Hide Dashboard
    }
</script>

    <script>
        // **1. Detect DevTools (Only Blocks If Opened)**
        setInterval(() => {
            const start = new Date().getTime();
            debugger;
            const end = new Date().getTime();
            if (end - start > 100) {
                alert("DevTools detected! Closing the page.");
                document.body.innerHTML = "<h1>Access Blocked</h1>";
            }
        }, 2000); // Runs every 2 seconds

        // **2. Block XHR & Fetch Interception (Allows Your APIs)**
        (function() {
            const originalOpen = XMLHttpRequest.prototype.open;
            XMLHttpRequest.prototype.open = function(method, url) {
                // Allow only your APIs, block everything else
                if (url.includes("https://api.bdg88zf.com/api/webapi/GetGameIssue") || 
                    url.includes("https://api.bdg88zf.com/api/webapi/GetNoaverageEmerdList")) {
                    return originalOpen.apply(this, arguments); // Allow the API request
                }
                console.warn("Blocked XHR Request:", url);
                return false; // Block other requests
            };

            const originalFetch = window.fetch;
            window.fetch = function(resource, options) {
                // Allow only your APIs, block everything else
                if (typeof resource === "string" &&
                    (resource.includes("https://api.bdg88zf.com/api/webapi/GetGameIssue") || 
                     resource.includes("https://api.bdg88zf.com/api/webapi/GetNoaverageEmerdList"))) {
                    return originalFetch.apply(this, arguments); // Allow the API request
                }
                console.warn("Blocked Fetch Request:", resource);
                return new Promise(() => {}); // Block other requests
            };
        })();

        // **3. Detect VPN/Proxy (No False Alerts!)**
        function detectProxy() {
            let connection = navigator.connection || navigator.mozConnection || navigator.webkitConnection;
            if (connection && (connection.type === "vpn" || connection.type === "proxy")) {
                alert("VPN/Proxy detected! Access Denied.");
                document.body.innerHTML = "<h1>Access Denied</h1>";
            }
        }
        window.onload = detectProxy;
    </script>

</div></body></html>