{% for m in farm.mastery %}
<div class="perk-card">
    <span class="perk-icon" aria-hidden="true">{{ m.icon }}</span>
    <strong class="perk-name">{{ m.name }}</strong>
    <span class="perk-level">Lv {{ m.level }}/{{ m.max_level }}</span>
    <span class="perk-effect">{{ m.effect or m.description }}</span>
    {% if m.maxed %}
    <span class="perk-maxed">Maxed</span>
    {% else %}
    <form method="post" action="/game/mastery" data-game-action="mastery">
        <input type="hidden" name="key" value="{{ m.key }}">
        <button type="submit" class="btn btn-sm">Upgrade ({{ format_exact(m.cost) }} Mastery)</button>
    </form>
    {% endif %}
</div>
{% endfor %}
