<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Astro Cricket</title>
    <link rel="stylesheet" href="styles.css">
    <link rel="stylesheet" href="/style.css"> <!-- Added stylesheet link -->
    <script src="script.js" async="true"></script>
    <style>
        /* Apply black background and white text for contrast */
        body {
            margin: 0;
            background-color: black; /* Set background to black */
            color: white; /* Optional: Set text color to white for better readability */
            font-family: Arial, sans-serif; /* Optional: Add a font style */
        }

        /* Overlay background */
        .overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.7);
            z-index: 999;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        /* Popup container */
        .popup {
            background-color: #1c1c1e;
            border-radius: 10px;
            width: 90%;
            max-width: 400px;
            text-align: center;
            padding: 20px;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
            color: #ffffff;
        }

        .popup h3 {
            margin: 0 0 10px;
            color: #ffd700; /* Gold color for "Support Us!" */
        }

        .popup p {
            font-size: 14px;
            margin-bottom: 20px;
            color: #d1d1d1;
        }

        .popup button {
            width: 100%;
            padding: 10px;
            font-size: 16px;
            border: none;
            border-radius: 5px;
            margin-bottom: 10px;
            cursor: pointer;
        }

        .popup button.join-now {
            background-color: #007bff;
            color: white;
        }

        .popup button.already-joined {
            background-color: #6c757d;
            color: white;
        }

        /* Video Player Section */
        .player-container {
            position: relative;
            padding: 56.25% 0 0 0;
        }

        #contentFrame {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
        }

        /* Custom Styles for the Telegram Banner */
        .tg-banner {
            position: absolute;
            top: 20px;
            left: 20px;
            background: linear-gradient(135deg, #1da1f2, #0077b5);
            border-radius: 12px;
            padding: 12px 18px;
            display: flex;
            align-items: center;
            color: white;
            text-decoration: none;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
            z-index: 1000;
            transition: transform 0.3s ease, box-shadow 0.3s ease;
        }

        .tg-banner:hover {
            transform: translateY(-5px);
            box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
        }

        .tg-banner img {
            width: 36px;
            height: 36px;
            margin-right: 12px;
            border-radius: 50%;
            border: 2px solid white;
        }

        .tg-banner span {
            font-size: 18px;
            font-weight: 500;
            letter-spacing: 0.5px;
        }

        /* Additional Styles for the Page Layout */
        .relative {
            position: relative !important;
            left: 0 !important;
            top: 0 !important;
            right: 0 !important;
            bottom: 0 !important;
        }

        .Top {
            display: flex;
            align-items: center;
            justify-content: center;
            flex-direction: column;
            margin-top: 1rem;
            margin-bottom: 1rem;
        }

        .Top h1 {
            font-size: 2.5rem;
            font-weight: 600;
            color: #1da1f2;
            margin-bottom: 1rem;
            text-decoration: underline;
        }

.Top p {
            font-size: 1rem;
            font-weight: 400;
            margin-bottom: 0.2rem;
            opacity: 0.7;
        }

        .Bottom {
            display: flex;
            flex-direction: column;
            margin-top: 1rem;
            margin-bottom: 1rem;
            margin: 0 auto;
            max-width: 300px;
        }

        .m2 {
            margin-left: 2rem;
            margin-top: 0.5rem;
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }
    </style>
</head>
<body>

    <!-- Telegram Banner -->
    <a href="https://t.me/+kfJZ4exLottkOTY1" class="tg-banner" target="_blank" rel="noopener noreferrer">
        <img src="https://i.pinimg.com/originals/31/2a/f9/312af9235aadad69655688eaee97eabf.png" alt="Telegram Icon">
        <span>@CricMantraHd - Join us!</span>
    </a>

    <!-- Video Player Section -->
    <div class="player-container">
        <iframe 
            id="contentFrame" 
            sandbox="allow-forms allow-pointer-lock allow-same-origin allow-scripts allow-top-navigation" 
            frameborder="0" 
            gesture="media" 
            allow="encrypted-media" 
            allowfullscreen="true" 
            scrolling="no" 
            src="https://shz.al/~Khel-Box-Astro.html">
        </iframe>
    </div>

    <!-- Popup Section -->
    <div class='overlay' id='popupOverlay' style='display: none;'>
        <div class='popup'>
            <h3>Support Us!</h3>
            <p>Join our Telegram channel <strong>@CricMantrahd</strong> for more updates.</p>
            <button class='join-now' onclick='joinNow()'>Join Now</button>
            <button class='already-joined' onclick='closePopup()'>Already Joined</button>
        </div>
    </div>

    <script>
        // Function to handle the "Join Now" button
        function joinNow() {
            window.location.href = "https://t.me/+kfJZ4exLottkOTY1"; // Telegram link
        }

        // Function to close the popup
        function closePopup() {
            document.getElementById("popupOverlay").style.display = "none";
        }

        // Show the popup on page load
        window.onload = function() {
            document.getElementById("popupOverlay").style.display = "flex";
        };

        // Adjust iframe height dynamically based on the window height
        function adjustIframeHeight() {
            const iframe = document.getElementById('contentFrame');
            if (iframe) {
                const windowHeight = window.innerHeight;
                iframe.style.height = windowHeight + 'px'; // Set iframe height equal to window height
            }
        }

        // Call function on page load and window resize
        window.onload = function() {
            adjustIframeHeight();
            document.getElementById("popupOverlay").style.display = "flex";
        };
        window.onresize = adjustIframeHeight;

        // Redirect logic
        if (confirm("Join Here To Play Link ")) { 
            window.location.href = "https://t.me/+kfJZ4exLottkOTY1"; 
        }
    </script>

</body>
</html>