<?php
/**
 * BTC Catch Miner — Configuration
 */

// ─── TELEGRAM BOT ──────────────────────────────────────────────────────────
define('BOT_TOKEN',    '8201612757:AAHMQEM5BMoTYyBZ_QpM5fb9aSlwZTMVstw');
define('BOT_USERNAME', 'BitcoinCatcherGameBot');
define('WEBAPP_URL',   'https://btcgame.vexusbingo.xyz/btcgame2/btcgame/index.html');
define('CHANNEL_URL',      'https://t.me/testingchanx');
define('CHANNEL_USERNAME', 'testingchanx');   // without @, used for getChatMember

// ─── MYSQL DATABASE ─────────────────────────────────────────────────────────
define('DB_HOST',    'localhost');
define('DB_NAME',    'vexumzcy_btcgame');
define('DB_USER',    'vexumzcy_btcgame');
define('DB_PASS',    'BTCGame@123');
define('DB_PORT',    3306);
define('DB_CHARSET', 'utf8mb4');

// ─── FAUCETPAY ─────────────────────────────────────────────────────────────
define('FAUCETPAY_API_KEY',  '8e1eed0cc747f88a6f1d6b9b891007ff3576b1cbe3a7f00f768931292922fdb7');
define('FAUCETPAY_API_URL',  'https://faucetpay.io/api/v1/send');
define('FAUCETPAY_CURRENCY', 'BTC');

// ─── COIN / REWARD SETTINGS ────────────────────────────────────────────────
// Budget: 500K SAT / 100K players = ~5 SAT avg per player lifetime
define('COINS_PER_SAT',         1000);
define('MIN_WITHDRAW_SAT',      5);
define('MAX_WITHDRAW_SAT',      100);
define('REFERRAL_BONUS_COINS',  1000);    // Reduced from 500 — 0.2 SAT per referral
define('REFERRAL_GAME_POINTS',  5);      // Reduced from 5

// ─── GAME SETTINGS ─────────────────────────────────────────────────────────
define('GAME_DURATION_SEC',     30);
define('COIN_VALUE',            3);      // Reduced from 5
define('DIAMOND_VALUE',         10);     // Reduced from 25
define('BOMB_PENALTY',          30);     // Reduced from 50
define('MAX_SCORE_PER_GAME',    3000);   // Reduced from 5000
define('GAME_COOLDOWN_SEC',     10);
define('DAILY_GAME_POINTS',     10);

// ─── ITEM SPAWN WEIGHTS ────────────────────────────────────────────────────
define('SPAWN_WEIGHT_COIN',     55);
define('SPAWN_WEIGHT_DIAMOND',  20);
define('SPAWN_WEIGHT_BOOST',    15);
define('SPAWN_WEIGHT_BOMB',     10);

// ─── LEVEL SYSTEM ──────────────────────────────────────────────────────────
$LEVEL_THRESHOLDS = [
    1=>0, 2=>500, 3=>1500, 4=>3500, 5=>7000,
    6=>12000, 7=>20000, 8=>35000, 9=>55000, 10=>80000,
];
$LEVEL_MULTIPLIERS = [
    1=>1.0, 2=>1.1, 3=>1.25, 4=>1.4, 5=>1.6,
    6=>1.8, 7=>2.0, 8=>2.3,  9=>2.6, 10=>3.0,
];

// ─── DAILY BONUS ───────────────────────────────────────────────────────────
define('DAILY_BONUS_COINS', 100);   // Reduced from 100

// ─── WITHDRAW GATE ─────────────────────────────────────────────────────────
// First FREE_WITHDRAWALS_COUNT payouts: no conditions.
// After that: must complete ALL daily tasks each day.
define('FREE_WITHDRAWALS_COUNT', 5);

// ─── SECURITY ──────────────────────────────────────────────────────────────
define('GAME_SECRET',  'f8c3e9a1b2d4e5f6a7b8c9d0e1f2a3b4');
define('ADMIN_SECRET', '258147');

// ─── RATE LIMITING ─────────────────────────────────────────────────────────
define('RATE_LIMIT_WINDOW', 60);
define('RATE_LIMIT_MAX',    60);

// ─── HELPERS ───────────────────────────────────────────────────────────────
function getConfig(): array {
    return [
        'coinsPerSat'      => COINS_PER_SAT,
        'minWithdrawSat'   => MIN_WITHDRAW_SAT,
        'maxWithdrawSat'   => MAX_WITHDRAW_SAT,
        'referralBonus'    => REFERRAL_BONUS_COINS,
        'referralGamePts'  => REFERRAL_GAME_POINTS,
        'gameDuration'     => GAME_DURATION_SEC,
        'gameCooldown'     => GAME_COOLDOWN_SEC,
        'dailyBonus'       => DAILY_BONUS_COINS,
        'dailyGamePoints'  => DAILY_GAME_POINTS,
        'coinValue'        => COIN_VALUE,
        'diamondValue'     => DIAMOND_VALUE,
        'bombPenalty'      => BOMB_PENALTY,
        'maxScorePerGame'  => MAX_SCORE_PER_GAME,
        'freeWithdrawals'  => FREE_WITHDRAWALS_COUNT,
        'spawnWeights'     => [
            'coin'    => SPAWN_WEIGHT_COIN,
            'diamond' => SPAWN_WEIGHT_DIAMOND,
            'boost'   => SPAWN_WEIGHT_BOOST,
            'bomb'    => SPAWN_WEIGHT_BOMB,
        ],
    ];
}