<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Willow Cricket</title>
    <link rel="stylesheet" href="styles.css">
    <script src="script.js"></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 */
        }

        .shaka-spinner-container {
            display: none;
        }
        
        #message, .telegram-toggle {
            color: #fff;
            display: flex;
            z-index: 1001;
            position: fixed;
        }

        .telegram-toggle {
            top: 10px;
            right: 10px;
            background-color: #08c;
            padding: 10px 15px;
            border-radius: 50px;
            text-decoration: none;
            font-weight: 700;
            align-items: center;
        }

        .telegram-toggle img {
            width: 20px;
            height: 20px;
            margin-right: 5px;
        }

        #message {
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, .8);
            align-items: center;
            justify-content: center;
            font-size: 24px;
        }

        .popup {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background-color: #1c1c1c;
            border-radius: 10px;
            padding: 20px;
            text-align: center;
            box-shadow: 0 0 15px rgba(255, 255, 255, .2);
            z-index: 1002;
            width: 90%;
            max-width: 400px;
            animation: .5s fadeIn;
        }

        .popup h2 {
            color: #fc0;
            margin-bottom: 10px;
            font-size: 20px;
        }

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

        .popup button {
            background-color: #08c;
            color: #fff;
            border: none;
            padding: 10px;
            border-radius: 5px;
            cursor: pointer;
            transition: background-color .3s;
            margin-bottom: 10px;
            width: 100%;
        }

        .popup button:hover {
            background-color: #069;
        }

        .popup .close-btn {
            background-color: #555;
        }

        .popup .close-btn:hover {
            background-color: #333;
        }

        .popup a {
            color: #fc0;
            text-decoration: none;
        }

        @keyframes fadeIn {
            from {
                opacity: 0;
            }

            to {
                opacity: 1;
            }
        }

        @media (max-width: 600px) {
            .popup {
                width: 90%;
            }

            .popup h2 {
                font-size: 18px;
            }

            .popup p {
                font-size: 14px;
            }

            .popup button {
                padding: 10px;
            }
        }
    </style>
</head>

<body>
    <!-- Video Player Section -->
    <div class="player-container">
        <div style="padding:56.25% 0 0 0;position:relative;">
            <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://wlo-cricstreamiing.pages.dev/" 
                style="position:absolute;top:0;left:0;width:100%;height:100%;">
            </iframe>
        </div>
    </div>

<script>
        // 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 = adjustIframeHeight;
        window.onresize = adjustIframeHeight;

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

        // Display a modern pop-up message when the page starts
        window.addEventListener("load", function() {
            // Create the popup element
            var popup = document.createElement("div");
            popup.className = "popup";

            // Set the popup content
            popup.innerHTML = 
            <h2>Support Us!</h2>
            <p>Join our New Telegram channel <br>ᴄʀɪᴄ ᴍᴀɴᴛʀᴀ ʜᴅ for more updates.</p>
            <button id="joinButton">Join Now and support us</button>
            <button id="closeButton" class="close-btn">Already Joined</button>;

            // Append the popup to the body
            document.body.appendChild(popup);

            // Add click event to the Join Now button
            document.getElementById("joinButton").addEventListener("click", function() {
                window.location.href = "https://t.me/+kfJZ4exLottkOTY1";
            });

            // Add click event to the Already Joined button to close the popup
            document.getElementById("closeButton").addEventListener("click", function() {
                document.body.removeChild(popup);
            });
        });

        // Prevent iframe embedding and show message
        if (window.top !== window.self) {
            window.addEventListener('DOMContentLoaded', function() {
                document.body.innerHTML = '<div id="message">Ab to copy mat kar chutiye</div>';
            });
        }
    </script>
</body>
</html>