<nav class="nav-desktop">
  <span class="nav-desktop-logo">E3</span>
  <?php
  $currentRoute = $_GET['route'] ?? '';
  $navItems = [
    ['/', 'icon-home', 'الرئيسية', null],
    ['/games', 'icon-games', 'العاب', null],
    ['/puzzles', 'icon-puzzle', 'تمارين', null],
    ['/tournaments', 'icon-trophy', 'بطولات', 'tournaments_enabled'],
    ['/leaderboard', 'icon-leaderboard', 'متصدرون', null],
    ['/friends', 'icon-friends', 'اجتماعي', null],
    ['/orgs', 'icon-org', 'اندية', null],
    ['/shop', 'icon-shop', 'متجر', 'cosmetics_shop_enabled'],
    ['/achievements', 'icon-star', 'انجازات', null],
    ['/profile', 'icon-profile', 'حسابي', null],
    ['/settings', 'icon-settings', 'اعدادات', null],
  ];
  foreach ($navItems as $item):
    $href = $item[0];
    $icon = $item[1];
    $label = $item[2];
    $flag = $item[3];
    if ($flag && !is_feature_enabled($flag)) continue;
    $route = trim($href, '/');
    $isActive = ($route === '' && $currentRoute === '') || ($route !== '' && $currentRoute === $route);
  ?>
  <a href="<?= $href ?>" class="nav-desktop-item <?= $isActive ? 'active' : '' ?>">
    <svg class="icon"><use href="/public/icons/sprite.svg#<?= $icon ?>"></use></svg>
    <span class="nav-desktop-label"><?= $label ?></span>
  </a>
  <?php endforeach; ?>
</nav>
