

<style>

.dice {
      font-size: 2.5rem;
      animation: roll 3s infinite;
      display: inline-block;
    }
    
    @keyframes roll {
      0% { transform: rotate(0deg); }
      25% { transform: rotate(90deg); }
      50% { transform: rotate(180deg); }
      75% { transform: rotate(270deg); }
      100% { transform: rotate(360deg); }
    }

.logo {
      font-family: 'Amaranth', sans-serif;
      font-weight: 700;
      font-size: 50px;
      color: black;
      -webkit-text-stroke: 2px white;
      position: relative;
    }

    .highlight {
      background: linear-gradient(to left, yellow, black);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      -webkit-text-stroke: 2px white;
    }


</style>

 <center><div class="logo">
        <span class="dice">🎲</span>
       gamble-gala<span class="highlight">xy.com</span>
    <br> </div>
<a style="color:black;" href="https://gamble-galaxy.com">Back to gamble-galaxy.com</a></center>


<?php
$apiUrl = "https://api.casinoscores.com/svc-evolution-game-events/api/xxxtremelightningroulette?limit=50";

$options = [
    "http" => [
        "method" => "GET",
        "header" => "User-Agent: Mozilla/5.0\r\n"
    ]
];

$context = stream_context_create($options);
$response = @file_get_contents($apiUrl, false, $context); // suppress warnings

echo "<h2 style='text-align:center;'>Last 50 Spins (Auto-refreshes every 15s)<br>xxxtreme lightning roulette</h2>";

// Clean bad unicode
$clean_response = '';
if ($response !== false) {
    $clean_response = preg_replace_callback(
        '/\\\\u(d[89ab][0-9a-f]{2}|d[cdef][0-9a-f]{2})/i',
        function($matches) { return ''; },
        $response
    );
}

$data = json_decode($clean_response, true);

// ✅ Only run foreach if $data is a valid array
if (is_array($data) && !empty($data)) {
    echo "<table border='1' style='margin:auto; border-collapse:collapse; width:100%; max-width:700px;'>";
    echo "<tr><th>#</th><th>Number</th><th>Color</th><th>Lightning Numbers</th><th>Multipliers</th></tr>";

    $count = 0;
    foreach ($data as $spin) {
        if (++$count > 50) break;

        $spinData = $spin["data"] ?? [];
        $number = $spinData["result"]["outcome"]["number"] ?? 'N/A';
        $color = strtolower($spinData["result"]["outcome"]["color"] ?? 'N/A');

        $lightning = $spinData["result"]["luckyNumbersList"] ?? [];
        $lnums = $multis = [];

        if (is_array($lightning)) {
            foreach ($lightning as $lucky) {
                $lnums[] = $lucky["number"] ?? '?';
                $multis[] = ($lucky["roundedMultiplier"] ?? '') . "x";
            }
        }

        $colorClass = in_array($color, ['red','black','green']) ? $color : '';

        echo "<tr>";
        echo "<td>$count</td>";
        echo "<td class='$colorClass'>$number</td>";
        echo "<td>" . ucfirst($color) . "</td>";
        echo "<td>" . implode(", ", $lnums) . "</td>";
        echo "<td>" . implode(", ", $multis) . "</td>";
        echo "</tr>";
    }

    echo "</table>";
} else {
    // ✅ Show message if $data is null or empty
    echo "<p style='color:red; text-align:center; font-weight:bold;'>No spins just yet, come back later.</p>";
}

echo "<p style='text-align:center;'>Updated at: " . date("H:i:s") . "</p>";
?>







<?php
$apiUrl = "https://api.casinoscores.com/svc-evolution-game-events/api/lightningroulette?limit=50";

$options = [
    "http" => [
        "method" => "GET",
        "header" => "User-Agent: Mozilla/5.0\r\n"
    ]
];

$context = stream_context_create($options);
$response = file_get_contents($apiUrl, false, $context);

// ✅ Function to strip bad UTF-16 surrogates
function strip_invalid_unicode_surrogates($json) {
    // Remove lone high-surrogate \uD800–\uDBFF not followed by low-surrogate
    $json = preg_replace('/\\\\uD[89AB][0-9A-F]{2}(?!\\\\uD[CDEF][0-9A-F]{2})/i', '', $json);
    // Remove lone low-surrogate \uDC00–\uDFFF not preceded by high-surrogate
    $json = preg_replace('/(?<!\\\\uD[89AB][0-9A-F]{2})\\\\uD[CDEF][0-9A-F]{2}/i', '', $json);
    return $json;
}

// ✅ Strip bad surrogates
$response = strip_invalid_unicode_surrogates($response);

echo "<h2 style='text-align:center;'>Last 50 Lightning Roulette Spins (Auto-refreshes every 15s)<br>lightning roulette</h2>";

if ($response !== false) {
    $data = json_decode($response, true);

    if (is_array($data)) {
        echo "<table><tr><th>#</th><th>Number</th><th>Color</th><th>Lightning Numbers</th><th>Multipliers</th></tr>";

        $count = 0;
        foreach ($data as $spin) {
            if (++$count > 50) break;

            $spinData = $spin["data"] ?? [];

            $number = $spinData["result"]["outcome"]["number"] ?? 'N/A';
            $color = strtolower($spinData["result"]["outcome"]["color"] ?? 'N/A');

            $lightning = $spinData["result"]["luckyNumbersList"] ?? [];
            $lnums = [];
            $multis = [];

            foreach ($lightning as $lucky) {
                $lnums[] = $lucky["number"] ?? '?';
                $multis[] = ($lucky["roundedMultiplier"] ?? '') . "x";
            }

            $colorClass = in_array($color, ['red','black','green']) ? $color : '';

            echo "<tr>";
            echo "<td>$count</td>";
            echo "<td class='$colorClass'>$number</td>";
            echo "<td>" . ucfirst($color) . "</td>";
            echo "<td>" . implode(", ", $lnums) . "</td>";
            echo "<td>" . implode(", ", $multis) . "</td>";
            echo "</tr>";
        }

        echo "</table>";
        echo "<p style='text-align:center;'>Updated at: " . date("H:i:s") . "</p>";
    } else {
        echo "<p style='text-align:center; color:red;'>❌ JSON decode failed: " . json_last_error_msg() . "</p>";
        echo "<pre style='background:#f0f0f0; padding:10px; max-width:700px; margin:20px auto; overflow:auto;'>" . htmlentities(substr($response, 0, 1000)) . "</pre>";
    }
} else {
    echo "<p style='text-align:center; color:red;'>❌ Failed to retrieve data from API.</p>";
}
?>



<?php
$apiUrl = "https://api.casinoscores.com/svc-evolution-game-events/api/autoroulette?limit=50";

$options = [
    "http" => [
        "method" => "GET",
        "header" => "User-Agent: Mozilla/5.0\r\n"
    ]
];

$context = stream_context_create($options);
$response = file_get_contents($apiUrl, false, $context);

if ($response !== false) {
    // Remove lone/unpaired UTF-16 surrogate escape sequences
    $response_clean = preg_replace('/\\\\u(d8|d9|da|db|dc|dd|de|df)[0-9a-f]{2}/i', '', $response);

    $data = json_decode($response_clean, true);

    if (json_last_error() !== JSON_ERROR_NONE) {
        file_put_contents('api_raw_response.txt', $response);
        file_put_contents('api_clean_response.txt', $response_clean);
        die("Failed to decode JSON after cleaning: " . json_last_error_msg() . ". Raw and cleaned responses saved.");
    }

    echo "<html><head><title>Last 50 Auto Roulette Spins</title>";
    echo '<meta http-equiv="refresh" content="15">';
    echo "<style>
        body { font-family: Arial, sans-serif; padding: 20px; background: #f9f9f9; }
        table { border-collapse: collapse; width: 100%; max-width: 700px; margin: auto; }
        th, td { border: 1px solid #ccc; padding: 8px; text-align: center; }
        th { background: #222; color: #fff; }
        tr:nth-child(even) { background: #eee; }
    </style>";
    echo "</head><body>";
    echo "<h2 style='text-align:center;'>Last 50 Auto Roulette Spins (Auto-refreshes every 15s)</h2>";
    echo "<table><tr><th>#</th><th>Number</th><th>Color</th></tr>";

    $count = 0;
    foreach ($data as $spin) {
        if (++$count > 50) break;

        $spinData = $spin["data"] ?? [];

        $number = $spinData["result"]["outcome"]["number"] ?? 'N/A';
        $color = strtolower($spinData["result"]["outcome"]["color"] ?? 'N/A');

        $bgColor = '';
        $textColor = '#000';
        switch ($color) {
            case 'red': $bgColor = '#ffdddd'; break;
            case 'black': $bgColor = '#222'; $textColor = '#fff'; break;
            case 'green': $bgColor = '#ddffdd'; break;
        }

        echo "<tr>";
        echo "<td>$count</td>";
        echo "<td style='background-color:$bgColor; color:$textColor; font-weight:bold;'>$number</td>";
        echo "<td>" . ucfirst($color) . "</td>";
        echo "</tr>";
    }

    echo "</table>";
    echo "<p style='text-align:center;'>Updated at: " . date("H:i:s") . "</p>";
    echo "</body></html>";
} else {
    echo "Failed to retrieve data from API.";
}
?>





<?php
$apiUrl = "https://api.casinoscores.com/svc-evolution-game-events/api/immersiveroulette?limit=50";

$options = [
    "http" => [
        "method" => "GET",
        "header" => "User-Agent: Mozilla/5.0\r\n"
    ]
];

$context = stream_context_create($options);
$response = file_get_contents($apiUrl, false, $context);

if ($response !== false) {
   // Remove lone UTF-16 surrogate halves to avoid decode errors
$clean_response = preg_replace_callback('/\\\\u(d[89ab][0-9a-f]{2}|d[cdef][0-9a-f]{2})/i', function($matches) {
    return '';
}, $response);

$data = json_decode($clean_response, true);


    echo "<html><head><title>Last 50 Immersive Roulette Spins</title>";
    echo '<meta http-equiv="refresh" content="15">';
    echo "<style>
        body { font-family: Arial, sans-serif; padding: 20px; background: #f9f9f9; }
        table { border-collapse: collapse; width: 100%; max-width: 700px; margin: auto; }
        th, td { border: 1px solid #ccc; padding: 8px; text-align: center; }
        th { background: #222; color: #fff; }
        tr:nth-child(even) { background: #eee; }
        .red { color: red; font-weight: bold; }
        .black { color: black; font-weight: bold; }
        .green { color: green; font-weight: bold; }
    </style>";
    echo "</head><body>";
    echo "<h2 style='text-align:center;'>Last 50 Immersive Roulette Spins (Auto-refreshes every 15s)</h2>";
    echo "<table><tr><th>#</th><th>Number</th><th>Color</th><th>Column</th><th>Dozen</th></tr>";

    $count = 0;
    foreach ($data as $spin) {
        if (++$count > 50) break;

        $spinData = $spin["data"] ?? [];

        $number = $spinData["result"]["outcome"]["number"] ?? 'N/A';
        $color = strtolower($spinData["result"]["outcome"]["color"] ?? 'N/A');
        $column = $spinData["result"]["outcome"]["column"] ?? 'N/A';
        $dozen = $spinData["result"]["outcome"]["dozen"] ?? 'N/A';

        $colorClass = in_array($color, ['red','black','green']) ? $color : '';

        echo "<tr>";
        echo "<td>$count</td>";
        echo "<td class='$colorClass'>$number</td>";
        echo "<td>" . ucfirst($color) . "</td>";
        echo "<td>$column</td>";
        echo "<td>$dozen</td>";
        echo "</tr>";
    }

    echo "</table>";
    echo "<p style='text-align:center;'>Updated at: " . date("H:i:s") . "</p>";
    echo "</body></html>";
} else {
    echo "Failed to retrieve data from API.";
}
?>


