{% if i and n %}
Stage {{ i }}/{{ n }}
{% endif %}
{% set deck_count = (total_cards if total_cards is not none else 0) %}
Deck {{ deck_count }}/100
{% if added_total is not none %}
Added {{ added_total }}
{% endif %}
{% if prefer_combos %}
Combos: {{ combo_target_count }} ({{ combo_balance }})
{% endif %}
{% if clamped_overflow is defined and clamped_overflow and (clamped_overflow > 0) %}
Clamped {{ clamped_overflow }}
{% endif %}
{% if stage_label and stage_label == 'Multi-Copy Package' and mc_summary is defined and mc_summary %}
{{ mc_summary }}
{% endif %}
{% if locks and locks|length > 0 %}🔒 {{ locks|length }} locked{% endif %}
{% set pct = ((deck_count / 100.0) * 100.0) if deck_count else 0 %}
{% set pct_clamped = (pct if pct <= 100 else 100) %}
{% set pct_int = pct_clamped|int %}
{% if mc_adjustments is defined and mc_adjustments and stage_label and stage_label == 'Multi-Copy Package' %}
Adjusted targets: {{ mc_adjustments|join(', ') }}
{% endif %}
{% if status %}
Status: {{ status }}{% if stage_label %} — {{ stage_label }}{% endif %}
{% endif %}
{% if status and status.startswith('Build complete') %}
{% endif %}
{% if locked_cards is defined and locked_cards %}
{% from 'partials/_macros.html' import lock_button %}
Locked cards (always kept)
{% for lk in locked_cards %}
{{ lk.name }}{% if lk.owned %}✔ Owned{% else %}✖ Not owned{% endif %}
{% if lk.in_deck %}• In deck{% else %}• Will be included on rerun{% endif %}
{% if added_cards is not none %}
{% if history is defined and history %}
Stage timeline
Jump back to a previous stage, then you can continue forward again.
{% for h in history %}
{{ h.label }}
{% endfor %}
{% endif %}
Cards added this stage
{% if skipped and (not added_cards or added_cards|length == 0) %}
No cards added in this stage.
{% endif %}
✔ Owned✖ Not owned
{% if stage_label and stage_label.startswith('Creatures') %}
{% set groups = added_cards|groupby('sub_role') %}
{% for g in groups %}
{% set group_idx = loop.index0 %}
{% set role = g.grouper %}
{% if role %}
{% set heading = 'Theme: ' + role.title() %}
{% else %}
{% set heading = 'Additional Picks' %}
{% endif %}
{{ heading }}
({{ g.list|length }})
{% for c in g.list %}
{% set owned = (owned_set is defined and c.name and (c.name|lower in owned_set)) %}
{% set is_locked = (locks is defined and (c.name|lower in locks)) %}
{% if owned %}✔{% else %}✖{% endif %}
{{ c.name|safe }}{% if c.count and c.count > 1 %} ×{{ c.count }}{% endif %}
{% from 'partials/_macros.html' import lock_button %}
{{ lock_button(c.name, is_locked) }}
{% if c.reason %}
{{ c.reason }}
{% else %}
{% endif %}
{% endfor %}
{% endfor %}
{% else %}
{% for c in added_cards %}
{% set owned = (owned_set is defined and c.name and (c.name|lower in owned_set)) %}
{% set is_locked = (locks is defined and (c.name|lower in locks)) %}
{% if owned %}✔{% else %}✖{% endif %}
{{ c.name|safe }}{% if c.count and c.count > 1 %} ×{{ c.count }}{% endif %}
{% from 'partials/_macros.html' import lock_button %}
{{ lock_button(c.name, is_locked) }}
{% if c.reason %}
{{ c.reason }}
{% else %}
{% endif %}
{% endfor %}
{% endif %}
Tip: Click a card to lock or unlock it. Locked cards are kept across reruns and won’t be replaced unless you unlock them.
No cards match your filters.
{% endif %}
{% if show_logs and log %}
Show logs
{{ log }}
{% endif %}
{% if status and status.startswith('Build complete') %}
{% if summary %}
{% include "partials/deck_summary.html" %}
{% endif %}
{% endif %}