<?php
require_once __DIR__ . '/../config.php';
require_admin();
$rows = array_reverse(get_submissions());
foreach ($rows as $row):
?>
  <div class="feed-item">
    <strong><?= esc((string) ($row['timestamp'] ?? '')) ?></strong> —
    <?= esc((string) ($row['name'] ?? 'Unnamed')) ?> →
    <?= esc((string) ($row['answer'] ?? '')) ?>
    <?php if (!empty($row['correct'])): ?> <span style="color:#79ffb1">✅ correct</span><?php endif; ?>
    <?php if (!empty($row['is_winner'])): ?> <span style="color:#79ffb1">🏆 winner</span><?php endif; ?>
  </div>
<?php endforeach; ?>
