<center>

<center>

<ins class="64ddde7ff13f0a68c443938f" style="display:inline-block;width:1px;height:1px;"></ins><script>!function(e,n,c,t,o,r,d){!function e(n,c,t,o,r,m,d,s,a){s=c.getElementsByTagName(t)[0],(a=c.createElement(t)).async=!0,a.src="https://"+r[m]+"/js/"+o+".js?v="+d,a.onerror=function(){a.remove(),(m+=1)>=r.length||e(n,c,t,o,r,m)},s.parentNode.insertBefore(a,s)}(window,document,"script","64ddde7ff13f0a68c443938f",["cdn.bmcdn6.com"], 0, new Date().getTime())}();</script>

<center>

<center>
    
<div class="ads">
    <?= $settings['coinflip_top_ad'] ?>
</div>
<div class="row">
    <div class="col-lg-12">
        <div class="card">
            <div class="card-body">
                <h4 class="card-title mb-4 text-center">🪙 FLIP n EARN!</h4>
                <div class="row">
              
                    <div class="col-md-6">
                        <div id="coinflip">
                            <div id="bitcoin"></div>
                            <div id="ethereum"></div>
                        </div>
                    </div>
					
					
					      <div class="col-md-6">
                        <form id="betForm">
                       <div id="result">
                                            <div class="alert fade xalert-simple xalert-primary xalert-dismissible font__family-montserrat font__size-16 font__weight-light brk-library-rendered rendered show text-center" style="letter-spacing: 1px;font-weight: bold;">You Are Ready To Play!</div>
                                        </div>
                            <div class="row">
                                <div class="col-md-12">
                                    <label for="betAmount">Bet Amount</label>
                                    <div class="input-group mb-2 mr-sm-3">
                                        <div class="input-group-prepend">
                                            <div class="input-group-text"><i class="far fa-money-bill-alt"></i></div>
                                        </div>
                                        <input type="number" class="form-control" id="betAmount" value="<?= $settings['coinflip_min_bet'] / $settings['currency_rate'] ?>" min="<?= $settings['coinflip_min_bet'] / $settings['currency_rate'] ?>" max="<?= $settings['coinflip_max_bet'] ?>" step="0.000001" placeholder="Bet Amount">
                                        <div class="input-group-append">
                                            <button type="button" id="half" class="btn btn-warning btn-sm">/2</button>
                                        </div>
                                        <div class="input-group-append">
                                            <button type="button" id="double" class="btn btn-success btn-sm">x2</button>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-md-6"><button type="submit" id="betBTC" class="btn-hover color-3 bet-btn mt-1" data-coin="BTC">Bet on Bitcoin</button></div>
                                <div class="col-md-6"><button type="submit" id="betETH" class="btn-hover color-11 bet-btn mt-1" data-coin="ETH">Bet on Ethereum</button></div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="col-lg-12">
        <div class="card">
            <div class="card-body">
                <h4 class="card-title mb-4 text-center">🌷 PREVIOUS FLIPS</h4>
                <div class="table-responsive">
                    <table class="table table-striped text-center">
                        <thead>
                            <tr>
                                <td scope="col">Game ID</td>
                                <td scope="col">Bet Amount</td>
                                <td scope="col">Bet Coin</td>
                                <td scope="col">Result</td>
                                <td scope="col">Profit</td>
                            </tr>
                        </thead>
                        <tbody id="coinflipHistory">
                            <?php
                            foreach ($history as $flip) {
                                echo '<tr><th scope="row">' . $flip["id"] . '</th><td>' . currency($flip["bet_amount"], $settings['currency_rate']) . '</td><td>' . strtoupper($flip['coin']) . '</td><td>' . strtoupper($flip['result']) . '</td><td>' . currency($flip['profit'], $settings['currency_rate']) . '</td></tr>';
                            }
                            ?>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="ads">
    <?= $settings['coinflip_footer_ad'] ?>
</div>

