
<style>
    .lottery-amount {
    max-width: 12em;
    border-radius: 10px;
    border: dotted #585360;
}
.alert-success {
    border: 1px solid rgba(36, 241, 6, 0.46);
    background-color: rgba(7, 149, 66, 0.12156862745098039);
    box-shadow: 0px 0px 2px #259c08;
    color: #0ad406;
    text-shadow: 2px 1px #00040a;
    transition: 0.5s;
    cursor: pointer;
}
.text-gradient2 {
    background-color: #FBAB7E;
    background-image: linear-gradient(62deg, #FBAB7E 0%, #F7CE68 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.nav-pills .nav-link.active, .nav-pills .show>.nav-link {
    color: #fff;
    background-color: #323a50;
}
</style>
<style>
    @import url(https://fonts.googleapis.com/css?family=Righteous);

hc, hc:before, *:after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  position: relative;
  }


hc {
  display: inline-block;
  color: white;
  font-family: 'Righteous', serif;
  font-size: 4.5em; 
  text-shadow: .03em .03em 0 hsla(230,40%,50%,1);
  }
  hc:after {
    content: attr(data-shadow);
    position: absolute;
    top: .06em; left: .06em;
    z-index: auto;
        
    text-shadow: none;
    background-image:
      linear-gradient(
        45deg,
        transparent 45%,
        hsla(48,20%,90%,1) 45%,
        hsla(48,20%,90%,1) 55%,
        transparent 0
        );
    background-size: .05em .05em;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  
    animation: shad-anim 15s linear infinite;
    }

@keyframes shad-anim {
  0% {background-position: 0 0}
  0% {background-position: 100% -100%}
  }
</style>
<style>
    hs {
  display: inline-block;
  color: white;
  font-family: 'Righteous', serif;
  font-size: 2.5em; 
  text-shadow: 0.03em 0.03em 0 hsl(54deg 92% 38%);
  }
  hs:after {
    content: attr(data-shadow);
    position: absolute;
    top: .06em; left: .06em;
    z-index: auto;
        display: none;
    text-shadow: none;
    background-image:
      linear-gradient(
        45deg,
        transparent 45%,
        hsla(48,20%,90%,1) 45%,
        hsla(48,20%,90%,1) 55%,
        transparent 0
        );
    background-size: .05em .05em;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  
    animation: shad-anim 15s linear infinite;
    }

@keyframes shad-anim {
  0% {background-position: 0 0}
  0% {background-position: 100% -100%}
  }
</style>
<div class="ads">
    <?= $settings['lottery_top_ad'] ?>
</div>
<div class="row">
    <div class="col-12 col-md-8 col-lg-6 order-md-2">

                
                    <div class="card" style="
    height: 452px;
    position: relative;
    background-image: url(/img/banner_1124c542a.png),url(/img/banner_2e8569189.png);
    background-position: left bottom,right bottom;
    background-size: 100%;
    background-repeat: no-repeat;
">
                <div class="card-body text-center">
				 <?php if (time() >= $settings['lottery_date']) { ?>
            <div class="alert alert-info text-center">This round has ended</div>
        <?php } else { ?>
                    <hc data-shadow="<?= $current_reward ?>"><?= $current_reward ?>000000</hc>
                    <p style="margin-top: -25px; margin-bottom: 0.2rem;"><hs data-shadow="tokens">tokens</hs></p>
                    <p style="letter-spacing: 1px;">JACKPOT</p>
                    <h4 class="card-title text-gradient2 mb-2" style="font-family: 'Righteous', serif;font-size: 1.8em;"><?= timespan(time(), $settings['lottery_date'], 2) ?></h4>
                    <p style="letter-spacing: 1px;">REMAINING TIME</p>
					  <form action="<?= site_url('/lottery/buy') ?>" method="POST" autocomplete="off">
                        <input type="hidden" name="<?= $csrf_name ?>" id="token" value="<?= $csrf_hash ?>">
                        <input type="number" class="form-control lottery-amount" id="lotteryAmount" name="amount" type="text" placeholder="Amount of tickets" min="1" value="1" required />
                     <button class="btn-hover color-5 mt-2" id="buyButton">Buy 1 ticket with <?= currency($settings['lottery_price'], $settings['currency_rate']) ?></button><br>
                    </form>
                    <script>
                        var lotteryPrice = <?= $settings['lottery_price'] / $settings['currency_rate'] ?>;
                    </script>

					  <?php } ?>
                </div>
                

                
            </div>
                <div class="card">
            <div class="card-body text-center">
                
                <ul class="nav nav-pills nav-justified mb-3 justify-content-center" id="iconTab" role="tablist">
                   
                   
 <li class="nav-item waves-effect waves-light" role="presentation">
                        <a class="nav-link active" id="mytickets-tab" data-toggle="tab" href="#mytickets" role="tab" aria-controls="mytickets" aria-selected="false">
                            <span class="d-block d-sm-none">My Tickets</span>
                                                    <span class="d-none d-sm-block"><i class="fas fa-ticket-alt"></i>&nbsp;My Tickets</span> 
                            </a>
                    </li>

					<li class="nav-item waves-effect waves-light" role="presentation">
                        <a class="nav-link " id="winners-tab" data-toggle="tab" href="#winners" role="tab" aria-controls="winners" aria-selected="true">
                            <span class="d-block d-sm-none">Previous winners</span>
                                                    <span class="d-none d-sm-block"><i class="fas fa-star"></i>&nbsp;Previous winners</span> 
                                                    </a>
                    </li>
                   
                </ul>
                
                
                <div class="tab-content" id="iconTabContent-1">
                    <div class="tab-pane fade" id="winners" role="tabpanel" aria-labelledby="winners-tab">
                        <table class="table table-striped text-center">
                        <thead>
                            <tr>
                                <th scope="col">Username</th>
                                <th scope="col">Number</th>
                                <th scope="col">Reward</th>
                                
                            </tr>
                        </thead>
                        <tbody>
 <?php
                            foreach ($winners as $value) {
                                echo '<tr><th scope="row">' . $value["username"] . '</th><td><span class="badge badge-success">' . $value["number"] . '</span></td><td>' . currency($value["amount"], $settings['currency_rate']) . '</td><td>' . timespan($value["create_time"], time(), 2) . ' ago</td></tr>';
                            }
                            ?>
					  </tbody>
                    </table>
                    </div>
                    <div class="tab-pane fade  active show" id="mytickets" role="tabpanel" aria-labelledby="mytickets-tab">
                        <div class="table-responsive">
                    <table class="table table-striped text-center">
                        <thead>
                            <tr>
                                <th scope="col">#</th>
                                <th scope="col">Number</th>
                                <th scope="col">Time</th>
                            </tr>
                        </thead>
                        <tbody>
                                            <?php
                            foreach ($lotteries as $value) {
                                echo '<tr><th scope="row">' . $value["id"] . '</th><td><span class="badge badge-success">' . $value["number"] . '</span></td><td>' . timespan($value["create_time"], time(), 2) . ' ago</td></tr>';
                            }
                            ?>
							</tbody>
                    </table>
                    
                </div>
                    </div>
                    </div>
            
            </div>
        </div>
        </div>
        
		
  <div class="col-6 col-md-2 col-lg-3 order-md-1 p-0 left-ads"><?= $settings['lottery_left_ad'] ?></div>
    <div class="col-6 col-md-2 col-lg-3 order-md-3 p-0 right-ads"><?= $settings['lottery_right_ad'] ?></div>


    </div>
	
<center><img class="desktop mb-4" src="img/howtoplay_lottery.png" draggable="false" alt="" style="width: 80%;
    border-radius: 10px;
    border-top: 5px #fff;
    border-top: 10px solid#222736!important;
    box-shadow: rgb(0 0 0 / 20%) 2px 2px 6px;"></center>
    
    
                    <center>  <div class="holidAds"></div>  <center> <br>
