<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>
    


<style>

    /* General Styles */
    body {
        font-family: 'Courier New', Courier, monospace; /* Monospaced font for hacker feel */
        background-color: #121212; /* Dark background for a hacker look */
        color: #00FF41; /* Neon green text color for that classic hacker look */
        margin: 0;
        padding: 0;
        text-align: center;
        overflow-x: hidden; /* Prevent horizontal scroll */
        overflow-y: auto;  /* Allow vertical scrolling */
        height: 100vh; /* Ensure the body takes full viewport height */
    }

    /* Container styles to prevent overflow */
    .container {
        max-width: 100%;  /* Prevent any horizontal overflow */
        overflow-x: hidden; /* Prevent horizontal scroll */
        height: 100%;  /* Take full screen height */
    }

    /* Login Box */
    .login-container {
        background: rgba(0, 0, 0, 0.8); /* Dark, semi-transparent background */
        padding: 40px;
        border-radius: 10px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.8);
        text-align: center;
        width: 350px;
        margin: auto;
        border: 2px solid #00FF41; /* Neon green border */
        transition: all 0.3s ease-in-out;
        max-width: 100%; /* Prevent overflow on smaller screens */
        box-sizing: border-box;
    }

    .login-container:hover {
        box-shadow: 0 8px 16px rgba(0, 255, 65, 0.4);
    }

    h2 {
        color: #00FF41; /* Neon green color */
        font-size: 28px;
        margin-bottom: 20px;
    }

    /* Input Fields */
    .input-box {
        width: 100%;
        padding: 12px;
        margin: 10px 0;
        border: 1px solid #333;
        border-radius: 5px;
        background: #1d1d1d;
        color: #00FF41;
        font-size: 16px;
        outline: none;
        transition: all 0.3s ease;
        box-sizing: border-box;
    }

    .input-box:focus {
        border: 1px solid #00FF41;
        background: #333333;
        color: #00FF41;
    }

    /* Glowing Button */
    .login-btn, .telegram-btn {
        width: 100%;
        padding: 14px;
        border: none;
        border-radius: 5px;
        font-size: 16px;
        color: white;
        cursor: pointer;
        background: #00FF41; /* Neon green */
        box-shadow: 0 4px 12px rgba(0, 255, 65, 0.3);
        transition: all 0.3s ease-in-out;
        max-width: 100%; /* Prevent overflow */
        box-sizing: border-box;
    }

    .login-btn:hover, .telegram-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(0, 255, 65, 0.5);
    }

    .login-btn:active, .telegram-btn:active {
        transform: translateY(0);
    }

    /* Message Display */
    #message {
        margin-top: 15px;
        font-size: 14px;
        color: #FF6347; /* Bright red message color for alerts */
    }

    /* Table Styling */
    table {
        width: 100%;
        border-collapse: collapse;
        background: #1d1d1d;
        border-radius: 8px;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6);
        table-layout: fixed; /* Prevent table from expanding beyond width */
        word-wrap: break-word; /* Ensure content doesn't overflow */
    }

    th, td {
        padding: 12px;
        text-align: center;
        border-bottom: 1px solid #333;
        font-size: 14px;
        color: #00FF41;
    }

    th {
        background: #333;
        color: #00FF41;
        font-weight: bold;
    }

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

    /* 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(0, 255, 65, 0.1);
        border: 2px solid #00FF41;
        box-shadow: 0px 0px 20px #00FF41;
        overflow: hidden; /* Ensure no content overflows the card */
    }

    /* 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, #00FF41, #00CC36);
        box-shadow: 0px 0px 20px #00FF41;
    }

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

    /* Prediction Chart */
    #predictionChart {
        width: 100%;
        height: 250px;
        border: 2px solid #00FF41;
        border-radius: 8px;
        background-color: #1d1d1d;
        box-sizing: border-box; /* Ensure content stays within bounds */
    }

    .pagination {
        display: flex;
        justify-content: center;
        margin-top: 20px;
    }

    .pagination button {
        padding: 10px 20px;
        margin: 0 5px;
        border: none;
        border-radius: 5px;
        background-color: #333;
        color: #00FF41;
        cursor: pointer;
        transition: background-color 0.3s ease, transform 0.2s ease;
        max-width: 100%;
        box-sizing: border-box;
    }

    .pagination button:hover {
        background-color: #00FF41;
        color: #121212;
        transform: scale(1.05);
    }

    .pagination button:disabled {
        background-color: #333;
        cursor: not-allowed;
    }

    #timeRemaining {
        font-size: 24px;
        font-weight: bold;
        text-align: center;
        color: #00FF41;
    }

    #predictedNumber, #predictedPremium {
        font-size: 18px;
        text-align: center;
        margin: 10px 0;
        color: #00FF41;
    }

    /* Button Group */
    .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;
        color: #121212; /* Dark color for text */
        background-color: #00FF41; /* Neon green */
        transition: background-color 0.3s ease, transform 0.2s ease;
        max-width: 100%;
        box-sizing: border-box;
    }

    .button-group a:hover {
        background-color: #00CC36;
        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/ColorTraderPro" 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://www.55wingoe.com/#/register?invitationCode=885723619234">
                <button class="telegram-btn">REGISTER NOW!!</button>
            </a>

    <div class="card">

        <h2>©ColorTraderPro™</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">



            <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  @ColorTraderPro™</h2>

        <div class="button-group">

            <p id="message"></p>
            <a href="https://t.me/ColorTraderPro" 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 = () => {
    // Weighted probabilities for categories (higher numbers mean higher likelihood)
    const categoryWeights = {
        "BIG": 3,
        "SMALL": 3,
        "GREEN": 2,
        "RED": 2
    };

    const categories = Object.keys(categoryWeights);
    const categoryProbabilities = [];

    // Calculate the probability distribution based on weights
    let totalWeight = 0;
    categories.forEach(category => {
        totalWeight += categoryWeights[category];
    });

    categories.forEach(category => {
        const weight = categoryWeights[category];
        for (let i = 0; i < weight; i++) {
            categoryProbabilities.push(category);
        }
    });

    // Select a category randomly based on weighted probabilities
    const randomCategory = categoryProbabilities[Math.floor(Math.random() * categoryProbabilities.length)];

    // Random number (0-9) for prediction
    const randomNumber = Math.floor(Math.random() * 10); 

    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 type="module">
    // Firebase v9+ import
    import { initializeApp } from "https://www.gstatic.com/firebasejs/9.0.0/firebase-app.js";
    import { getAuth, signInWithEmailAndPassword, signOut } from "https://www.gstatic.com/firebasejs/9.0.0/firebase-auth.js";

    // Firebase Configuration
    const firebaseConfig = {
            apiKey: "AIzaSyBL1KlVtPLoGgkhsH1QnkrEkV_s9x7-Mws",

            authDomain: "colortraderpro-panel.firebaseapp.com",

            databaseURL: "https://colortraderpro-panel-default-rtdb.firebaseio.com",

            projectId: "colortraderpro-panel",

            storageBucket: "colortraderpro-panel.firebasestorage.app",

            messagingSenderId: "612198052901",

            appId: "1:612198052901:android:26b24e8056ca9f26953bcc"
    };

    // Initialize Firebase
    const app = initializeApp(firebaseConfig);
    const auth = getAuth(app);

    // Login Function
    document.getElementById('loginForm').addEventListener('submit', function(event) {
        event.preventDefault();
        
        const email = document.getElementById('email').value;
        const password = document.getElementById('password').value;

        signInWithEmailAndPassword(auth, email, password)
            .then((userCredential) => {
                document.getElementById('message').innerText = "Login Successful!";
                document.getElementById('message').style.color = "#00ff00";

                // Dashboard Show
                setTimeout(() => {
                    document.getElementById('loginBox').style.display = "none";
                    document.getElementById('dashboard').style.display = "block";
                }, 1000);
            })
            .catch((error) => {
                document.getElementById('message').innerText = "Invalid Email or Password!";
                document.getElementById('message').style.color = "#ff4b2b";
            });
    });

    // Logout Function
    function logout() {
        signOut(auth).then(() => {
            document.getElementById('loginBox').style.display = "block";
            document.getElementById('dashboard').style.display = "none";
        }).catch((error) => {
            console.error("Logout Error:", error);
        });
    }
</script>

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