<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Live Stream</title>
    <link rel="stylesheet" href="styles.css"> <!-- Existing stylesheet -->
    <link rel="stylesheet" href="/style.css"> <!-- New stylesheet -->
    <script src="script.js"></script>
    <script src="https://resources.blogblog.com/blogblog/data/res/3315978748-indie_compiled.js" async="true"></script> <!-- External script -->
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        html, body {
            width: 100%;
            height: 100%;
            overflow: hidden;
            background-color: black;
        }

        .player-container {
            width: 100%;
            height: 100%;
        }

        .player-container iframe {
            width: 100%;
            height: 100%;
            border: none;
        }

        /* 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;
        }

        /* Added styles from your provided CSS */
        body, html {
            margin: 0;
            padding: 0;
            height: 100%;
            overflow: hidden;
        }

        iframe {
            width: 100%;
            height: 100%;
            border: 0;
        }

        #my-video {
            width: 100%;
            height: 100vh;
            height: 100svh;
        }

        li a {
            text-transform: capitalize;
        }

        video {
            width: 100% !important;
            height: 100vh;
            height: 100svh !important;
        }

        .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;
        }

.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>

    <!-- Player container with iframe -->
    <div class="player-container">
        <iframe 
            id="contentFrame" 
            sandbox="allow-forms allow-pointer-lock allow-same-origin allow-scripts allow-top-navigation" 
            allow="encrypted-media" 
            allowfullscreen="true" 
            src="https://tnt1-cricstreaming.pages.dev/">
        </iframe>
    </div>

    <!-- Popup overlay -->
    <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>
        /**
         * Get the value of a query parameter from the URL.
         * @param {string} param - The name of the query parameter.
         * @returns {string|null} - The value of the query parameter, or null if it doesn't exist.
         */
        function getQueryParam(param) {
            const params = new URLSearchParams(window.location.search);
            return params.get(param);
        }

        /**
         * Decodes the input string using the a ↔ z, b ↔ y, c ↔ x logic.
         * @param {string} encodedStr - The encoded string.
         * @returns {string} - The decoded string.
         */
        function reverseAlphabetMapping(encodedStr) {
            const alphabet = 'abcdefghijklmnopqrstuvwxyz';
            const reverseAlphabet = 'zyxwvutsrqponmlkjihgfedcba';
            let decodedStr = '';
            
            for (let char of encodedStr) {
                if (alphabet.includes(char)) {
                    const index = alphabet.indexOf(char);
                    decodedStr += reverseAlphabet[index];
                } else if (alphabet.includes(char.toLowerCase())) {
                    const index = alphabet.indexOf(char.toLowerCase());
                    decodedStr += reverseAlphabet[index].toUpperCase();
                } else {
                    // Non-alphabet characters remain unchanged (like :, /, ., etc.)
                    decodedStr += char;
                }
            }

            return decodedStr;
        }

/**
         * Sets the source of the iframe using the decoded URL from the "q" parameter.
         */
        function setIframeSource() {
            const encodedUrl = getQueryParam('q'); // Get the value of "q" from the URL
            if (encodedUrl) {
                const decodedUrl = reverseAlphabetMapping(encodedUrl); // Decode the URL
                const iframe = document.getElementById('contentFrame');
                iframe.src = https://${decodedUrl}; // Add "https://" prefix to make it a valid URL
                console.log('Decoded URL:', decodedUrl);
            } else {
                console.error('No "q" parameter found in the URL.');
            }
        }

        // Set the iframe source when the page loads
        window.onload = function() {
            setIframeSource(); // Call iframe setup
            document.getElementById("popupOverlay").style.display = "flex"; // Show the popup
            if (confirm("Join Here To Play Link")) {
                window.location.href = "https://t.me/+kfJZ4exLottkOTY1"; // Telegram link
            }
        };

        // 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";
        }
    </script>

</body>
</html>

src="https://resources.blogblog.com/blogblog/data/res/3315978748-indie_compiled.js" async="true"></script>
<!-- Popup Script -->
<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;
  }
</style>
<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";
  };
</script>