<?php
require_once __DIR__ . '/../includes/functions.php';
$row = $db->select('sports', '*', '', 'id ASC')[0] ?? [];
$heading = rawurlencode((string)($row['header_n'] ?? 'Sports Event'));
$border = ltrim((string)($row['border_c'] ?? '#f00505'), '#');
$background = ltrim((string)($row['background_c'] ?? '#050505'), '#');
$text = ltrim((string)($row['text_c'] ?? '#ffffff'), '#');
$days = max(1, (int)($row['days'] ?? 7));
$api = rawurlencode((string)($row['api'] ?? '1'));
$url = "https://www.tvsportguide.com/widget/{$api}?filter_mode=all&filter_value=&days={$days}&heading={$heading}&border_color=custom&autoscroll=1&custom_colors={$border},{$background},{$text}";
?>
<!DOCTYPE html><html lang="pt-BR"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1"><style>html,body{margin:0;width:100%;height:100%;background:#000}iframe{display:block;border:0;width:100vw;height:100vh}</style></head><body><iframe src="<?= htmlspecialchars($url, ENT_QUOTES, 'UTF-8') ?>" allowfullscreen></iframe></body></html>
