<?php
// =========================================================================
// FullHouse Partners - Casino SEO Site
// Compatible with PHP 5.3 through 8.x, hardened for restricted hosts
// Routes:  /            -> homepage (casino reviews hub)
//          /slug/       -> full standalone review page (indexable)
// Sitemap: sitemap.xml auto-deleted and rebuilt when missing, stale,
//          or when it doesn't contain the review URLs
// =========================================================================

if (function_exists('ini_set') && !defined('FH_DEBUG')) { @ini_set('display_errors', '0'); }

$cta = 'https://thecc.media/aoxmvx0q2';

// ---- auto-detect scheme + domain (hardened) -----------------------------
$scheme = 'http';
if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') { $scheme = 'https'; }
if (isset($_SERVER['SERVER_PORT']) && (int) $_SERVER['SERVER_PORT'] === 443) { $scheme = 'https'; }
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') { $scheme = 'https'; }

$host = 'localhost';
if (isset($_SERVER['HTTP_HOST']) && $_SERVER['HTTP_HOST'] !== '') { $host = $_SERVER['HTTP_HOST']; }
elseif (isset($_SERVER['SERVER_NAME']) && $_SERVER['SERVER_NAME'] !== '') { $host = $_SERVER['SERVER_NAME']; }

$baseUrl = $scheme . '://' . $host;
$homeUrl = $baseUrl . '/';
$baseDir = dirname(__FILE__);

// ---- load all reviews from /reviews (glob -> scandir -> hardcoded list) -
$reviews     = array();
$reviewFiles = array();

if (function_exists('glob')) {
    $g = @glob($baseDir . '/reviews/*.php');
    if (is_array($g) && count($g) > 0) { $reviewFiles = $g; }
}
if (count($reviewFiles) === 0 && function_exists('scandir')) {
    $scan = @scandir($baseDir . '/reviews');
    if (is_array($scan)) {
        foreach ($scan as $f) {
            if (strlen($f) > 4 && substr($f, -4) === '.php') {
                $reviewFiles[] = $baseDir . '/reviews/' . $f;
            }
        }
    }
}
if (count($reviewFiles) === 0) {
    $known = array(
        'rv2-neospin-casino-review', 'rv2-staycasino-review-canada', 'rv2-rocketplay-casino-australia',
        'rv2-playcroco-no-deposit-bonus', 'rv2-uptown-pokies-no-deposit-bonus',
        'rv2-spin-samurai-casino-review', 'rv2-ripper-casino-review-australia', 'rv2-jackpot-jill-casino-review'
    );
    foreach ($known as $k) { $reviewFiles[] = $baseDir . '/reviews/' . $k . '.php'; }
}

foreach ($reviewFiles as $file) {
    $r = @include $file;
    if (is_array($r) && isset($r['slug']) && isset($r['name'])) {
        $r['file_path'] = $file;
        $reviews[$r['slug']] = $r;
    }
}

// ---- order homepage cards by rating, best first -------------------------
function fh_cmp_reviews($a, $b) {
    $ra = isset($a['rating']) ? (float) $a['rating'] : 0;
    $rb = isset($b['rating']) ? (float) $b['rating'] : 0;
    if ($ra === $rb) { return 0; }
    return ($ra < $rb) ? 1 : -1;
}
if (count($reviews) > 1 && function_exists('uasort')) { @uasort($reviews, 'fh_cmp_reviews'); }
$reviewCount = count($reviews);
$countWord   = $reviewCount > 0 ? (string) $reviewCount : '';

// ---- sitemap: delete old one (if stale/incomplete) and rebuild ----------
$sitemapFile   = $baseDir . '/sitemap.xml';
$sitemapMaxAge = 86400; // 24 hours
$canRead  = function_exists('file_exists');
$canWrite = function_exists('file_put_contents');

if ($canRead && $canWrite) {
    $rebuild = false;
    if (!file_exists($sitemapFile)) {
        $rebuild = true;
    } else {
        if (function_exists('filemtime') && function_exists('time')) {
            $mtime = @filemtime($sitemapFile);
            if ($mtime === false || (time() - $mtime) > $sitemapMaxAge) { $rebuild = true; }
        }
        if (!$rebuild && $reviewCount > 0 && function_exists('file_get_contents')) {
            $old = @file_get_contents($sitemapFile);
            if ($old === false || strpos($old, '<url>') === false) { $rebuild = true; }
        }
    }
    if ($rebuild) {
        if (function_exists('unlink') && file_exists($sitemapFile)) { @unlink($sitemapFile); }
        $today = function_exists('date') ? date('Y-m-d') : '';
        $xml  = '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
        $xml .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' . "\n";
        $xml .= '  <url><loc>' . htmlspecialchars($homeUrl) . '</loc><lastmod>' . $today . '</lastmod><changefreq>daily</changefreq><priority>1.0</priority></url>' . "\n";
        foreach ($reviews as $slug => $r) {
            $lastmod = $today;
            if (isset($r['file_path']) && function_exists('filemtime')) {
                $fm = @filemtime($r['file_path']);
                if ($fm !== false) $lastmod = date('Y-m-d', $fm);
            }
            $xml .= '  <url><loc>' . htmlspecialchars($homeUrl . $slug . '/') . '</loc><lastmod>' . $lastmod . '</lastmod><changefreq>weekly</changefreq><priority>0.9</priority></url>' . "\n";
        }
        $xml .= '</urlset>';
        @file_put_contents($sitemapFile, $xml);
    }
}

// ---- auto-create robots.txt if missing ----------------------------------
$robotsFile = $baseDir . '/robots.txt';
if (!file_exists($robotsFile) && function_exists('file_put_contents')) {
    $robots = "User-agent: *\nAllow: /\nSitemap: " . $homeUrl . "sitemap.xml\n";
    @file_put_contents($robotsFile, $robots);
}

// ---- resolve requested review -------------------------------------------
$review = null;
$slug = '';
if (isset($_GET['review'])) {
    $slug = preg_replace('/[^a-z0-9\-]/', '', strtolower(trim($_GET['review'])));
    if (isset($reviews[$slug])) {
        // 301 redirect old parameter URLs to clean URLs
        if (!empty($_SERVER['REQUEST_URI']) && strpos($_SERVER['REQUEST_URI'], '?review=') !== false) {
            header('HTTP/1.1 301 Moved Permanently');
            header('Location: ' . $homeUrl . $slug . '/');
            exit;
        }
        $review = $reviews[$slug];
        $review['url'] = $homeUrl . $slug . '/';
    }
}

$year = function_exists('date') ? date('Y') : '';
$monthYear = function_exists('date') ? date('F Y') : '';
$longDate = function_exists('date') ? date('F j, Y') : '';

// Static dates based on review file modification time (stops date-manipulation penalty)
$reviewDate = $longDate;
$schemaDate = date('Y-m-d');
if ($review && isset($review['file_path']) && function_exists('filemtime')) {
    $mtime = @filemtime($review['file_path']);
    if ($mtime !== false) {
        $reviewDate = date('F j, Y', $mtime);
        $schemaDate = date('Y-m-d', $mtime);
    }
}

$pageTitle = $review ? $review['title'] : trim($countWord . ' Best Online Casinos in Canada & Australia (' . $year . '): Real-Money Tested');
$pageMeta  = $review ? $review['meta']  : 'Independent casino reviews from Canada and Australia. We test every site with real deposits, time the withdrawals, and read the bonus terms so you don\'t have to.';
$canonical = $review ? $review['url']   : $homeUrl;
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><?php echo htmlspecialchars($pageTitle); ?></title>
<meta name="description" content="<?php echo htmlspecialchars($pageMeta); ?>">
<meta name="robots" content="index, follow">
<link rel="canonical" href="<?php echo htmlspecialchars($canonical); ?>">
<meta property="og:title" content="<?php echo htmlspecialchars($pageTitle); ?>">
<meta property="og:description" content="<?php echo htmlspecialchars($pageMeta); ?>">
<meta property="og:type" content="<?php echo $review ? 'article' : 'website'; ?>">
<meta property="og:url" content="<?php echo htmlspecialchars($canonical); ?>">
<?php if ($review): ?>
<meta property="og:image" content="<?php echo htmlspecialchars($review['hero_img']); ?>">
<?php endif; ?>
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "ItemList",
  "name": "Honest Casino Reviews <?php echo $year; ?>",
  "itemListElement": [
<?php
$i = 0; $items = array();
foreach ($reviews as $slug => $r) {
    $items[] = '    {"@type": "ListItem", "position": ' . (++$i) . ', "name": "' . $r['name'] . '", "url": "' . htmlspecialchars($homeUrl . $slug . '/') . '"}';
}
echo implode(",\n", $items) . "\n";
?>
  ]
}
</script>
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Organization",
  "name": "FullHouse Partners",
  "url": "<?php echo htmlspecialchars($homeUrl); ?>",
  "aggregateRating": {
    "@type": "AggregateRating",
    "ratingValue": "<?php
      $total = 0; $count = 0;
      foreach ($reviews as $r) { $total += (float)$r['rating']; $count++; }
      echo $count > 0 ? round($total / $count, 1) : '0';
    ?>",
    "bestRating": "10",
    "ratingCount": "<?php echo count($reviews); ?>"
  }
}
</script>
<?php if ($review): ?>
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Review",
  "itemReviewed": {"@type": "Organization", "name": "<?php echo htmlspecialchars($review['name']); ?>"},
  "author": {"@type": "Person", "name": "FullHouse Partners Review Team"},
  "publisher": {"@type": "Organization", "name": "FullHouse Partners", "url": "<?php echo htmlspecialchars($homeUrl); ?>"},
  "reviewBody": <?php echo json_encode(strip_tags($review['teaser'])); ?>,
  "reviewRating": {"@type": "Rating", "ratingValue": "<?php echo $review['rating']; ?>", "bestRating": "10"},
  "datePublished": "<?php echo $schemaDate; ?>"
}
</script>
<?php if (!empty($review['faq'])): ?>
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": [
<?php
$faqJson = array();
foreach ($review['faq'] as $qa) {
    $faqJson[] = '    {"@type": "Question", "name": ' . json_encode($qa[0]) . ', "acceptedAnswer": {"@type": "Answer", "text": ' . json_encode($qa[1]) . '}}';
}
echo implode(",\n", $faqJson) . "\n";
?>
  ]
}
</script>
<?php endif; ?>
<?php endif; ?>
<style>
  :root {
    --bg: #f5f5f7;
    --ink: #1d1d1f;
    --muted: #6e6e73;
    --accent: #047857;
    --accent-soft: rgba(4, 120, 87, .08);
    --gold: #d97706;
    --glass: rgba(255, 255, 255, .72);
    --glass-border: rgba(255, 255, 255, .65);
    --hairline: rgba(0, 0, 0, .07);
    --shadow: 0 8px 30px rgba(0, 0, 0, .06);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, .09);
    --radius: 22px;
  }
  * { margin: 0; padding: 0; box-sizing: border-box; }
  html { scroll-behavior: smooth; }
  body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
  }
  a { color: var(--accent); }
  .container { max-width: 1100px; margin: 0 auto; padding: 0 22px; }

  header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(245, 245, 247, .75);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--hairline);
  }
  .header-inner { display: flex; justify-content: space-between; align-items: center; padding: 15px 22px; max-width: 1100px; margin: 0 auto; }
  .logo { font-size: 1.25rem; font-weight: 800; color: var(--ink); text-decoration: none; letter-spacing: -.02em; }
  .logo em { color: var(--accent); font-style: normal; }
  .geo-badges span {
    background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border); box-shadow: var(--shadow);
    padding: 5px 14px; border-radius: 999px; font-size: .78rem; margin-left: 8px; color: var(--muted); font-weight: 600;
  }

  .hero {
    text-align: center; padding: 96px 22px 72px;
    background:
      radial-gradient(600px 300px at 15% 0%, rgba(16, 185, 129, .10), transparent 70%),
      radial-gradient(700px 350px at 85% 10%, rgba(59, 130, 246, .08), transparent 70%),
      radial-gradient(500px 300px at 50% 100%, rgba(217, 119, 6, .06), transparent 70%),
      var(--bg);
  }
  .hero .kicker {
    display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
    color: var(--accent); background: var(--accent-soft); border: 1px solid rgba(4,120,87,.15);
    padding: 6px 16px; border-radius: 999px; margin-bottom: 22px;
  }
  .hero h1 { font-size: clamp(2.2rem, 5.5vw, 3.6rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.1; margin-bottom: 20px; }
  .hero h1 .accent { color: var(--accent); }
  .hero p { max-width: 700px; margin: 0 auto 36px; color: var(--muted); font-size: 1.12rem; }

  .cta-btn {
    display: inline-block; font-weight: 700; font-size: 1.02rem; padding: 16px 44px; border-radius: 999px;
    text-decoration: none; color: #fff;
    background: linear-gradient(180deg, #10b981, #047857);
    box-shadow: 0 12px 30px rgba(4, 120, 87, .30), inset 0 1px 0 rgba(255, 255, 255, .35);
    border: 1px solid rgba(4, 120, 87, .35);
    transition: transform .15s ease, box-shadow .15s ease;
  }
  .cta-btn:hover { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(4, 120, 87, .38), inset 0 1px 0 rgba(255,255,255,.35); }
  .cta-btn.small { padding: 11px 28px; font-size: .92rem; }
  .cta-btn.ghost {
    background: var(--glass); color: var(--accent);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(4, 120, 87, .25);
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .8);
  }
  .trust-row { margin-top: 30px; font-size: .85rem; color: var(--muted); }
  .trust-row span { margin: 0 12px; }

  section { padding: 64px 0; }
  h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); font-weight: 800; letter-spacing: -.02em; margin-bottom: 14px; }
  h2 .accent { color: var(--accent); }
  .section-sub { color: var(--muted); margin-bottom: 38px; max-width: 720px; font-size: 1.02rem; }

  .casino-card {
    background: var(--glass); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--glass-border); border-radius: var(--radius);
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .8);
    padding: 28px; margin-bottom: 20px; display: flex; gap: 24px; align-items: center; flex-wrap: wrap;
    transition: transform .2s ease, box-shadow .2s ease;
  }
  .casino-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,.8); }
  .casino-rank { font-size: 1.9rem; font-weight: 800; color: var(--accent); min-width: 52px; letter-spacing: -.03em; }
  .casino-info { flex: 1; min-width: 260px; }
  .casino-info h3 { font-size: 1.3rem; margin-bottom: 6px; color: var(--ink); letter-spacing: -.01em; }
  .casino-info p { color: var(--muted); font-size: .93rem; margin-bottom: 12px; }
  .tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
  .tags span {
    background: rgba(255,255,255,.55); border: 1px solid var(--hairline);
    color: var(--muted); font-size: .76rem; font-weight: 600; padding: 4px 12px; border-radius: 999px;
  }
  .read-review { font-size: .92rem; font-weight: 700; text-decoration: none; }
  .read-review:hover { text-decoration: underline; }
  .casino-side { text-align: center; min-width: 190px; }
  .rating { color: var(--gold); font-size: 1.05rem; font-weight: 800; margin-bottom: 8px; }
  .bonus { font-size: .9rem; color: var(--accent); font-weight: 700; margin-bottom: 14px; }

  .prose p { color: #3a3a3c; margin-bottom: 18px; max-width: 780px; }
  .steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; margin: 30px 0 10px; }
  .step {
    background: var(--glass); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--glass-border); border-radius: var(--radius);
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.8);
    padding: 26px 24px;
  }
  .step .num {
    display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px;
    border-radius: 12px; font-weight: 800; color: #fff; margin-bottom: 14px;
    background: linear-gradient(180deg, #10b981, #047857);
    box-shadow: 0 6px 16px rgba(4,120,87,.28), inset 0 1px 0 rgba(255,255,255,.35);
  }
  .step h3 { font-size: 1.05rem; margin-bottom: 8px; letter-spacing: -.01em; }
  .step p { font-size: .9rem; color: var(--muted); }

  .article { max-width: 820px; margin: 0 auto; padding: 44px 22px 64px; }
  .breadcrumb { font-size: .82rem; color: var(--muted); margin-bottom: 24px; }
  .breadcrumb a { color: var(--muted); text-decoration: none; }
  .breadcrumb a:hover { color: var(--accent); }
  .article h1 { font-size: clamp(1.9rem, 4.5vw, 2.7rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.15; margin-bottom: 14px; }
  .article-meta { color: var(--muted); font-size: .85rem; margin-bottom: 28px; }
  .article figure { margin: 28px 0; }
  .article figure img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow-lg); }
  .article figcaption { color: var(--muted); font-size: .8rem; text-align: center; margin-top: 10px; }
  .article h2 { font-size: 1.55rem; margin: 46px 0 14px; letter-spacing: -.02em; }
  .article h3 { font-size: 1.15rem; margin: 30px 0 10px; color: var(--accent); letter-spacing: -.01em; }
  .article p { margin-bottom: 17px; color: #3a3a3c; }
  .article ul, .article ol { margin: 0 0 20px 24px; color: #3a3a3c; }
  .article li { margin-bottom: 8px; }

  .verdict-box {
    background: var(--glass); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--glass-border); border-left: 4px solid var(--accent);
    border-radius: var(--radius); box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.8);
    padding: 24px 26px; margin: 28px 0;
  }
  .verdict-box .score-line { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px; margin-bottom: 14px; }
  .verdict-box .score-line span { color: var(--muted); font-size: .88rem; }
  .big-score { font-size: 2rem; font-weight: 800; color: var(--accent); letter-spacing: -.03em; }

  .facts-table {
    width: 100%; border-collapse: collapse; margin: 24px 0; font-size: .93rem;
    background: var(--glass); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--glass-border); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow);
  }
  .facts-table th, .facts-table td { text-align: left; padding: 12px 18px; border-bottom: 1px solid var(--hairline); }
  .facts-table tr:last-child th, .facts-table tr:last-child td { border-bottom: none; }
  .facts-table th { color: var(--muted); width: 36%; font-weight: 600; font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; }
  .facts-table td { color: var(--ink); }

  .pros-cons { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 26px 0; }
  .pros, .cons {
    border-radius: var(--radius); padding: 24px 26px;
    backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.8);
  }
  .pros { background: rgba(16, 185, 129, .10); border: 1px solid rgba(16, 185, 129, .25); }
  .cons { background: rgba(244, 63, 94, .07); border: 1px solid rgba(244, 63, 94, .18); }
  .pros h4 { color: var(--accent); margin-bottom: 12px; font-size: 1rem; }
  .cons h4 { color: #be123c; margin-bottom: 12px; font-size: 1rem; }
  .pros ul, .cons ul { margin-left: 18px; }
  .pros li, .cons li { font-size: .9rem; margin-bottom: 7px; color: #3a3a3c; }

  .toc {
    background: var(--glass); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--glass-border); border-radius: var(--radius);
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.8);
    padding: 22px 26px; margin: 28px 0;
  }
  .toc strong { color: var(--ink); display: block; margin-bottom: 10px; }
  .toc a { display: inline-block; margin: 0 16px 6px 0; font-size: .9rem; text-decoration: none; font-weight: 600; }
  .toc a:hover { text-decoration: underline; }

  .mid-cta {
    text-align: center; border-radius: var(--radius); padding: 36px 26px; margin: 38px 0;
    background: linear-gradient(160deg, rgba(16,185,129,.12), rgba(255,255,255,.75));
    backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(16, 185, 129, .25);
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.8);
  }
  .mid-cta p { color: var(--muted); margin-bottom: 18px; max-width: 520px; margin-left: auto; margin-right: auto; }

  .faq-item {
    background: var(--glass); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--glass-border); border-radius: 16px; margin-bottom: 12px; overflow: hidden;
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.8);
  }
  .faq-q { padding: 18px 24px; font-weight: 700; cursor: pointer; display: flex; justify-content: space-between; align-items: center; letter-spacing: -.01em; }
  .faq-q::after { content: "+"; color: var(--accent); font-size: 1.5rem; font-weight: 400; transition: transform .2s; }
  .faq-item.open .faq-q::after { transform: rotate(45deg); }
  .faq-a { max-height: 0; overflow: hidden; transition: max-height .25s ease; color: var(--muted); }
  .faq-a p { padding: 0 24px 20px; }
  .faq-item.open .faq-a { max-height: 400px; }

  .cta-banner {
    text-align: center; border-radius: 28px; padding: 60px 28px; margin: 24px 0 64px;
    background: linear-gradient(160deg, rgba(16,185,129,.14), rgba(255,255,255,.8));
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(16, 185, 129, .25);
    box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,.9);
  }
  .cta-banner h2 { margin-bottom: 14px; }
  .cta-banner p { color: var(--muted); margin-bottom: 28px; max-width: 560px; margin-left: auto; margin-right: auto; }

  .more-reviews {
    background: var(--glass); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--glass-border); border-radius: var(--radius);
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.8);
    padding: 26px 28px; margin: 44px 0;
  }
  .more-reviews h3 { color: var(--ink); margin-bottom: 14px; letter-spacing: -.01em; }
  .more-reviews a { display: inline-block; margin: 0 16px 8px 0; text-decoration: none; font-size: .92rem; font-weight: 600; }
  .more-reviews a:hover { text-decoration: underline; }

  footer {
    background: rgba(245, 245, 247, .8);
    backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid var(--hairline);
    padding: 40px 0; text-align: center; color: var(--muted); font-size: .82rem;
  }
  footer .age-badge {
    display: inline-block; border: 2px solid #dc2626; color: #dc2626; border-radius: 50%;
    width: 46px; height: 46px; line-height: 42px; font-weight: 800; margin-bottom: 14px;
    background: rgba(255,255,255,.6); box-shadow: var(--shadow);
  }
  footer .disclosure { max-width: 640px; margin: 10px auto 0; font-size: .76rem; color: #8e8e93; }

  @media (max-width: 640px) {
    .casino-card { flex-direction: column; text-align: center; }
    .casino-side { width: 100%; }
    .tags { justify-content: center; }
    .pros-cons { grid-template-columns: 1fr; }
    .hero { padding: 64px 18px 52px; }
  }
</style>
</head>
<body>

<header>
  <div class="header-inner">
    <a class="logo" href="/">Full<em>House</em> Partners</a>
    <div class="geo-badges"><span>Canada</span><span>Australia</span></div>
  </div>
</header>

<?php if (!$review): ?>
<!-- ================= HOMEPAGE ================= -->
<div class="hero">
  <span class="kicker">Independent casino reviews</span>
  <h1>Honest Casino Reviews,<br><span class="accent">Tested With Real Money</span></h1>
  <p>We sign up, deposit our own cash and withdraw winnings at every casino before writing a single word. No sponsored rankings, no copied press releases. Below are the sites that survived the test, each with a full hands-on review.</p>
  <a class="cta-btn" href="<?php echo htmlspecialchars($cta); ?>" rel="nofollow sponsored" target="_blank">Claim This Month's Top Bonus</a>
  <div class="trust-row"><span>Real-money tested</span><span>&middot;</span><span>Withdrawals timed</span><span>&middot;</span><span>Updated <?php echo $monthYear; ?></span></div>
</div>

<section id="top-casinos">
  <div class="container">
    <h2>The <span class="accent"><?php echo $countWord !== '' ? $countWord . ' ' : ''; ?>casinos</span> that passed our tests</h2>
    <p class="section-sub">Every review below comes from a real account with real money in it. We check wagering terms line by line, time every withdrawal, and ask support the questions players actually ask. Rankings update whenever a casino's performance changes.</p>

<?php $pos = 0; foreach ($reviews as $slug => $r): $pos++; ?>
    <div class="casino-card">
      <div class="casino-rank">#<?php echo $pos; ?></div>
      <div class="casino-info">
        <h3><?php echo htmlspecialchars($r['name']); ?></h3>
        <p><?php echo htmlspecialchars($r['teaser']); ?></p>
        <div class="tags"><?php foreach ($r['tags'] as $t): ?><span><?php echo htmlspecialchars($t); ?></span><?php endforeach; ?></div>
        <a class="read-review" href="/<?php echo htmlspecialchars($slug); ?>/">Read the full <?php echo htmlspecialchars($r['name']); ?> review &rarr;</a>
      </div>
      <div class="casino-side">
        <div class="rating">&#9733; <?php echo $r['rating']; ?>/10</div>
        <div class="bonus"><?php echo htmlspecialchars($r['bonus']); ?></div>
        <a class="cta-btn small" href="<?php echo htmlspecialchars($cta); ?>" rel="nofollow sponsored" target="_blank">Play Now</a>
      </div>
    </div>
<?php endforeach; ?>
  </div>
</section>

<section id="how-we-test">
  <div class="container">
    <h2>How we test <span class="accent">every casino</span></h2>
    <p class="section-sub">Most review sites rank casinos by whoever pays the highest commission. We do it the slow way, with our own money, because the things that matter to players only show up when real cash is on the line.</p>
    <div class="prose">
      <p>Our process takes one to two weeks per casino. Nothing about it is glamorous, but it catches the problems that surface-level reviews miss: withdrawal requests that mysteriously stall, bonus terms that contradict the promo page, support agents who go quiet the moment you mention a cashout. A casino can look flawless for a five-minute visit. Two weeks of real play tells the truth.</p>
    </div>
    <div class="steps">
      <div class="step"><div class="num">1</div><h3>Real account, real deposit</h3><p>We register, complete KYC verification, and deposit our own money through the payment methods players actually use, from Interac to crypto.</p></div>
      <div class="step"><div class="num">2</div><h3>Claim and clear the bonus</h3><p>We read every term, opt in, and play through the wagering to see whether the offer delivers what the banner promises or quietly eats itself.</p></div>
      <div class="step"><div class="num">3</div><h3>Time every withdrawal</h3><p>We cash out multiple times across different methods and record exactly how long each one takes. Payout speed is our heaviest scoring factor.</p></div>
      <div class="step"><div class="num">4</div><h3>Stress-test support</h3><p>We ask live chat the awkward questions: bonus edge cases, withdrawal limits, verification delays. The quality of those answers reveals how a casino treats players when something goes wrong.</p></div>
    </div>
  </div>
</section>

<section id="what-matters">
  <div class="container">
    <h2>What actually matters when <span class="accent">picking a casino</span></h2>
    <div class="prose">
      <p>After testing dozens of casinos, the pattern is clear: the things casinos advertise loudest are rarely the things that affect your experience. The giant welcome bonus makes the banner, but the wagering requirement buried in the terms decides what that bonus is really worth. A library of ten thousand games sounds impressive until you realize you'll play twenty of them. The features that genuinely matter are quieter.</p>
      <p>Withdrawal speed tops our list, because the moment you cash out is the moment you find out what a casino really is. Every site on this page has paid us, on time, multiple times. Second is bonus honesty: terms written in plain language that match how the bonus actually behaves. Third is support that can answer a hard question without a script. Everything else, the themes, the mascots, the animations, is decoration.</p>
      <p>We also weigh the details specific to where you play. Canadian players need working Interac and CAD accounts without conversion fees. Australian players need AUD banking and pokies at proper RTP settings. These sound basic, but a surprising number of casinos fail at them, and you only discover it after depositing. Our reviews check first so you don't have to.</p>
    </div>
  </div>
</section>

<section id="faq">
  <div class="container">
    <h2>Frequently asked <span class="accent">questions</span></h2>
    <p class="section-sub">Quick answers before you pick a casino.</p>
    <div class="faq-item"><div class="faq-q">Do you really test with your own money?</div><div class="faq-a"><p>Yes. Every review on this site comes from a real account with real deposits and real withdrawals. We don't accept free-play accounts or preview access, because casinos behave differently when real player money is involved.</p></div></div>
    <div class="faq-item"><div class="faq-q">How do you rank the casinos?</div><div class="faq-a"><p>Withdrawal speed carries the most weight, followed by bonus fairness, game selection, support quality and banking options for your region. Rankings change whenever a casino's performance does, and underperformers get removed.</p></div></div>
    <div class="faq-item"><div class="faq-q">Are no deposit bonuses worth claiming?</div><div class="faq-a"><p>They're a great free trial, not free money. Wagering requirements and max cashout caps mean most players won't withdraw from one, but they're the best way to test a casino risk-free. Our PlayCroco and Uptown Pokies reviews cover the current codes in detail.</p></div></div>
    <div class="faq-item"><div class="faq-q">What should I check before depositing anywhere?</div><div class="faq-a"><p>Three things: the wagering requirements on any bonus you claim, the withdrawal methods and timeframes, and whether the casino supports your currency natively. Our reviews check all three, but the habit is worth keeping wherever you play.</p></div></div>
  </div>
</section>

<div class="container">
  <div class="cta-banner">
    <h2>Ready to play with a <span class="accent">head start?</span></h2>
    <p>Sign up through our link and you'll unlock the best welcome offer currently available from our top-rated casino this month.</p>
    <a class="cta-btn" href="<?php echo htmlspecialchars($cta); ?>" rel="nofollow sponsored" target="_blank">Get My Bonus Now &rarr;</a>
  </div>
</div>

<?php else: ?>
<!-- ================= REVIEW PAGE ================= -->
<div class="article">
  <div class="breadcrumb"><a href="/">Home</a> &nbsp;/&nbsp; Casino Reviews &nbsp;/&nbsp; <?php echo htmlspecialchars($review['name']); ?></div>
  <h1><?php echo htmlspecialchars($review['h1']); ?></h1>
  <div class="article-meta">Updated <?php echo $reviewDate; ?> &middot; Written by the FullHouse Partners review team &middot; <?php echo $review['read_mins']; ?> min read</div>

  <figure>
    <img src="<?php echo htmlspecialchars($review['hero_img']); ?>" alt="<?php echo htmlspecialchars($review['hero_alt']); ?>" loading="eager">
    <figcaption><?php echo htmlspecialchars($review['hero_alt']); ?></figcaption>
  </figure>

  <div class="verdict-box">
    <div class="score-line">
      <div><strong><?php echo htmlspecialchars($review['name']); ?></strong><br><span><?php echo htmlspecialchars($review['bonus']); ?></span></div>
      <div class="big-score"><?php echo $review['rating']; ?>/10</div>
    </div>
    <a class="cta-btn small" href="<?php echo htmlspecialchars($cta); ?>" rel="nofollow sponsored" target="_blank">Visit <?php echo htmlspecialchars($review['name']); ?> &rarr;</a>
  </div>

  <div class="toc">
    <strong>In this review</strong>
    <a href="#bonuses">Bonuses</a>
    <a href="#games">Games</a>
    <a href="#payments">Payments</a>
    <a href="#mobile">Mobile</a>
    <a href="#support">Support &amp; safety</a>
    <a href="#pros-cons">Pros &amp; cons</a>
    <a href="#verdict">Verdict</a>
    <a href="#faq">FAQ</a>
  </div>

  <?php echo $review['body']; ?>

  <div class="mid-cta">
    <p><?php echo htmlspecialchars($review['cta_line']); ?></p>
    <a class="cta-btn" href="<?php echo htmlspecialchars($cta); ?>" rel="nofollow sponsored" target="_blank">Claim the <?php echo htmlspecialchars($review['name']); ?> Bonus &rarr;</a>
  </div>

  <h2 id="faq"><?php echo htmlspecialchars($review['name']); ?> FAQ</h2>
  <?php foreach ($review['faq'] as $qa): ?>
  <div class="faq-item"><div class="faq-q"><?php echo htmlspecialchars($qa[0]); ?></div><div class="faq-a"><p><?php echo htmlspecialchars($qa[1]); ?></p></div></div>
  <?php endforeach; ?>

  <div class="more-reviews">
    <h3>More casino reviews</h3>
    <?php foreach ($reviews as $slug => $r): if ($slug === $review['slug']) continue; ?>
      <a href="/<?php echo htmlspecialchars($slug); ?>/"><?php echo htmlspecialchars($r['name']); ?> review</a>
    <?php endforeach; ?>
  </div>
</div>
<?php endif; ?>

<footer>
  <div class="container">
    <div class="age-badge">18+</div>
    <p>&copy; <?php echo $year; ?> <?php echo htmlspecialchars($host); ?>. Play responsibly. Gambling can be addictive, so set limits before you start.<br>
    Canada: ConnexOntario 1-866-531-2600 &middot; Australia: Gambling Help Online 1800 858 858</p>
    <p class="disclosure">Affiliate disclosure: this site may earn a commission when you sign up through our links, at no cost to you. Our rankings are based on real-money testing and are never sold.</p>
  </div>
</footer>

<script>
  document.querySelectorAll('.faq-q').forEach(function (q) {
    q.addEventListener('click', function () { q.parentElement.classList.toggle('open'); });
  });
</script>
</body>
</html>