<?php
if (session_status() === PHP_SESSION_NONE) session_start();
require_once __DIR__ . '/../includes/auth.php';
require_once __DIR__ . '/../config/db.php';
include __DIR__ . '/../includes/header.php';
require_login('/WATCHING/pages/account.php');
$u = current_user();
?>
<div class="container glass-card" style="padding:16px;margin-top:24px;max-width:640px;">
  <h2>My Account</h2>
  <p>Name: <?php echo htmlspecialchars($u['name'] ?: ''); ?></p>
  <p>Email: <?php echo htmlspecialchars($u['email']); ?></p>
  <?php if (!empty($u['avatar_url'])): ?>
    <img src="<?php echo htmlspecialchars($u['avatar_url']); ?>" alt="Avatar" style="width:80px;height:80px;border-radius:50%;">
  <?php endif; ?>
  <div style="margin-top:10px;">
    <a class="btn" href="/WATCHING/pages/logout.php">Log Out</a>
  </div>
</div>
<?php include __DIR__ . '/../includes/footer.php'; ?>