<?php
require_once __DIR__ . '/includes/bootstrap.php';

if (is_logged_in()) {
    redirect(APP_URL . '/main.php');
}

$page_title = __('welcome');
$hide_menu = true;
require __DIR__ . '/includes/header.php';
?>

<div class="home-hero">
    <img src="<?= APP_URL ?>/assets/img/home_splash.jpg" alt="BiteFight" class="home-splash" usemap="#raceMap">
    <map name="raceMap">
        <area shape="poly" coords="1,388,226,265,167,148,91,60,1,27"
              href="<?= APP_URL ?>/register.php?race=2" alt="<?= __('race_werewolf') ?>" title="<?= __('race_werewolf') ?>">
        <area shape="poly" coords="779,3,706,3,624,53,585,170,658,375,780,367"
              href="<?= APP_URL ?>/register.php?race=1" alt="<?= __('race_vampire') ?>" title="<?= __('race_vampire') ?>">
    </map>

    <div class="home-hero-thumbs">
        <div class="home-thumb">
            <img src="<?= APP_URL ?>/assets/img/home_thumb01.jpg" alt="">
            <p>Yeni kurbanlarini aramak icin sehirde dolas.</p>
        </div>
        <div class="home-thumb">
            <img src="<?= APP_URL ?>/assets/img/home_thumb02.jpg" alt="">
            <p>Dusmanlarini yenmek icin kendini donat.</p>
        </div>
        <div class="home-thumb">
            <img src="<?= APP_URL ?>/assets/img/home_thumb03.jpg" alt="">
            <p>Vampirler ve Kurtadamlar arasindaki savas asirlardir surup gidiyor.</p>
        </div>
    </div>
</div>

<div class="home-cta">
    <h1><?= e(__('tagline')) ?></h1>
    <div class="home-buttons">
        <a href="<?= APP_URL ?>/login.php" class="btn"><?= __('login') ?></a>
        <a href="<?= APP_URL ?>/register.php" class="btn btn-secondary"><?= __('register') ?></a>
    </div>
</div>

<h2 class="text-center mt-2"><?= e(__('choose_race')) ?></h2>

<div class="race-grid">
    <a href="<?= APP_URL ?>/register.php?race=1" class="race-card">
        <img src="<?= APP_URL ?>/assets/img/race1.gif" alt="<?= __('race_vampire') ?>">
        <h3><?= __('race_vampire') ?></h3>
        <p><?= e(__('race_vampire_desc')) ?></p>
    </a>
    <a href="<?= APP_URL ?>/register.php?race=2" class="race-card">
        <img src="<?= APP_URL ?>/assets/img/race2.gif" alt="<?= __('race_werewolf') ?>">
        <h3><?= __('race_werewolf') ?></h3>
        <p><?= e(__('race_werewolf_desc')) ?></p>
    </a>
</div>

<?php require __DIR__ . '/includes/footer.php'; ?>
