{% extends "base.html" %}
{% block content %}
    <section class="panel">
        <h2>Crimes</h2>
        <p class="muted">Crime tools quietly add a small success bonus. Failure means jail. Success means money, xp, and sometimes loot.</p>
    </section>

    <section class="cards">
        {% for crime in crimes %}
            <article class="card">
                <div class="action-row" style="justify-content: space-between;">
                    <h3>{{ crime.name }}</h3>
                    <span class="badge">{{ crime.tier|upper }}</span>
                </div>
                <p class="muted">{{ crime.description }}</p>
                <p class="muted mini">Nerve {{ crime.nerve_cost }} • Success {{ (crime.success_rate * 100)|round|int }}% • Reward ${{ crime.money_min }}-{{ crime.money_max }} • {{ crime.xp_reward }} xp</p>
                <p class="muted mini">Fail jail: {{ format_duration(crime.jail_seconds) }}</p>
                <form method="post" class="inline-form">
                    <input type="hidden" name="crime_id" value="{{ crime.id }}">
                    <button type="submit" class="primary">Commit Crime</button>
                </form>
            </article>
        {% endfor %}
    </section>

    <section class="panel">
        <h2>Recent Crime Logs</h2>
        {% if crime_logs %}
            <ul class="log-list">
                {% for log in crime_logs %}
                    <li>
                        <strong>{{ log.crime_name }}</strong>
                        <p class="muted mini">{{ log.result }} • ${{ log.reward_money }} • {{ log.reward_xp }} xp{% if log.dropped_item_name %} • {{ log.dropped_item_name }}{% endif %}</p>
                    </li>
                {% endfor %}
            </ul>
        {% else %}
            <p class="muted">No crime history yet.</p>
        {% endif %}
    </section>
{% endblock %}
