{% extends "base.html" %}
{% block content %}
    <section class="grid-2">
        <article class="panel">
            <h2>Attack {{ target.username }}</h2>
            <p class="muted">Wallet cash exposed: ${{ target.wallet_money }}</p>
            <p class="muted">Life: {{ target.life }}/{{ target.max_life }}</p>
            <p class="muted">Status: {{ target.status }}</p>
            <p class="muted">Stats: {{ target.effective_strength }}/{{ target.effective_speed }}/{{ target.effective_defense }}/{{ target.effective_dexterity }}</p>
        </article>
        <article class="panel">
            <h2>Choose Outcome</h2>
            <p class="muted">If you win: leave for xp, hospitalize to lock them down, or mug to steal wallet cash only.</p>
            <div class="stack">
                {% for action_type, label in [("leave", "Leave"), ("hospitalize", "Hospitalize"), ("mug", "Mug")] %}
                    <form method="post" class="inline-form">
                        <input type="hidden" name="action_type" value="{{ action_type }}">
                        <button type="submit" class="{{ 'primary' if action_type == 'mug' else 'subtle' }}">{{ label }}</button>
                    </form>
                {% endfor %}
            </div>
        </article>
    </section>

    <section class="panel">
        <h2>Recent Combat Around You</h2>
        {% if combat_logs %}
            <ul class="log-list">
                {% for log in combat_logs %}
                    <li>
                        <strong>{{ log.summary }}</strong>
                        <p class="muted mini">{{ format_ts(log.created_at) }} • {{ log.action_type }} • stolen ${{ log.money_stolen }}</p>
                    </li>
                {% endfor %}
            </ul>
        {% else %}
            <p class="muted">No relevant combat yet.</p>
        {% endif %}
    </section>
{% endblock %}