{% extends "base.html" %}

{% block title %}Leaderboard - Pickleball ELO Tracker{% endblock %}

{% block content %}
<h1 class="pitt-primary text-4xl font-bold mb-8 text-center">📊 Leaderboard</h1>

{% include "components/nav.html" %}

{% if leaderboard.is_empty() %}
    <div class="alert-info">
        No players with matches yet. <a href="/matches/new" class="font-bold hover:underline">Record a match</a> to see the leaderboard!
    </div>
{% else %}
    <div class="max-w-2xl mx-auto">
        {% for (rank, player) in leaderboard %}
        <div class="leaderboard-entry">
            <div class="rank">{{ rank }}</div>
            <div class="flex-1">
                <a href="/players/{{ player.id }}" class="pitt-primary font-bold hover:underline">
                    {{ player.name }}
                </a>
            </div>
            <div class="player-rating">{{ player.rating_display }}</div>
        </div>
        {% endfor %}
    </div>
{% endif %}
{% endblock %}
