<?php
require_once 'config.php';
header('Content-Type: application/json');

$names = ['Aarav', 'Rahul', 'Vikram', 'Pooja', 'Neha', 'Karan', 'Amit', 'Sneha', 'Deepak', 'Rohit'];
$games = ['Wingo 1Min', 'Aviator Pro', 'IPL Live', 'Mega Slots', 'K3 Lottery'];

$winners = [];
for ($i = 0; $i < 15; $i++) {
    // Hidden mobile/name format like "Aarav***" or "987***12"
    $winnerName = $names[array_rand($names)] . '***';
    $wonGame = $games[array_rand($games)];
    $amount = rand(1000, 85000); // Random amount between 1k to 85k

    $winners[] = [
        "userName" => $winnerName,
        "gameName" => $wonGame,
        "winAmount" => $amount,
        "avatar" => "default_avatar.png"
    ];
}

echo json_encode([
    "code" => 0,
    "msg" => "Succeed",
    "data" => $winners
]);
?>