{% extends "base.html" %}

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

{% block content %}
<h1>📊 Leaderboard</h1>
{% include "components/nav.html" %}

{% if leaderboard.is_empty() %}
    <div class="alert alert-info">
        No players with matches yet. <a href="/matches/new">Record a match</a> to see the leaderboard!
    </div>
{% else %}
    <div style="max-width: 600px; margin: 0 auto;">
        {% for (rank, player) in leaderboard %}
        <div class="leaderboard-entry">
            <div class="rank">{{ rank }}</div>
            <div class="player-info">
                <div class="player-name">
                    <a href="/players/{{ player.id }}" style="color: #003594; text-decoration: none;">
                        {{ player.name }}
                    </a>
                </div>
            </div>
            <div class="player-rating">{{ player.rating | round(1) }}</div>
        </div>
        {% endfor %}
    </div>
{% endif %}
{% endblock %}
