{% macro card_pic(id)%}
	<picture>
		<source srcset="{{ get_url(path="ptcg/" ~ id ~ ".webp") }}" type="image/webp">
		<source srcset="{{ get_url(path="ptcg/" ~ id ~ ".png") }}" type="image/png">
		<img src="{{ get_url(path="ptcg/" ~ id ~ ".png") }}" width="330" height="460" loading="lazy">
	</picture>
{% endmacro card_pic %}

{% macro acespec()%}
	<p class="acespec">
		<span class="acespec-tag">{{ trans(key="ptcg-acespec", lang=lang) }}</span>
		{{ trans(key="ptcg-acespec-text", lang=lang) }}
	</p>
{% endmacro acespec %}

{% macro ancient()%}
	<p class="ancient">
		<span class="ancient-tag">{{ trans(key="ptcg-ancient", lang=lang) }}</span>
	</p>
{% endmacro ancient %}

{% macro future()%}
	<p class="future">
		<span class="future-tag">{{ trans(key="ptcg-future", lang=lang) }}</span>
	</p>
{% endmacro future %}

{% macro attack(attack)%}
	<div class="attack">
		<div>
			<span class="attack-cost">{{ attack.cost }}</span>
			<span class="attack-name">{{ attack.name }}</span>
			<span class="attack-damage">{%if attack.damage %}{{ attack.damage }}{% endif %}</span>
		</div>
		{%if attack.effect %}
			<div class="attack-effect">{{ attack.effect }}</div>
		{% endif %}
	</div>
{% endmacro attack %}

{% macro ability(ability)%}
	<p class="ability">
		<span class="ability-tag">{{ trans(key="ptcg-ability", lang=lang) }}:</span>
		<span class="ability-name">{{ ability.name }}</span>
		<br>
		<span class="ability-effect">{{ ability.effect }}</span>
	</p>
{% endmacro ability %}

{% macro vstar(vstar)%}
	<div class="vstar">
		<span class="vstar-tag">{{ trans(key="ptcg-vstar", lang=lang) }}</span>
		{% if vstar.ability %}
			{{ self::ability(ability=vstar.ability) }}
		{% endif %}
		{% if vstar.attack %}
			{{ self::attack(attack=vstar.attack) }}
		{% endif %}
	</div>
{% endmacro vstar %}

{% macro pokemon_card_info(card)%}
	<p class="type">{{ trans(key="ptcg-pokemon", lang=lang)}} > {{ trans(key="ptcg-"~card.type, lang=lang) }}</p>
	<p class="name">
		<span>{{ card.name }}</span>
		<span>{{ card.hp }} {{ card.element }}</span>
	</p>
	{% if card.tera %}
		<p class="tera">
			<span class="tera-tag">{{ trans(key="ptcg-tera", lang=lang) }}</span>
			{{ trans(key="ptcg-tera-text", lang=lang) }}
		</p>
	{% endif %}
	{% if card.ancient %}
		{{ self::ancient() }}
	{% endif %}
	{% if card.future %}
		{{ self::future() }}
	{% endif %}
	{% if card.ability %}
		{{ self::ability(ability=card.ability) }}
	{% endif %}
	{% for attack in card.attacks %}
		{{ self::attack(attack=attack) }}
	{% endfor %}
	{% if card.vstar %}
		{{ self::vstar(vstar=card.vstar) }}
	{% endif %}
	<p class="bottom">
		<span>{{ trans(key="ptcg-weakness", lang=lang) }} {{ card.weakness }}</span>
		<span>{{ trans(key="ptcg-resistance", lang=lang) }} {{ card.resistance }}</span>
		<span>{{ trans(key="ptcg-retreat", lang=lang) }} {{ card.retreat }}</span>
	</p>
	{% if card.rulebox %}
		<p class="rule">
			<span class="rulebox-name">{{ trans(key="ptcg-"~card.rulebox~"-rule", lang=lang) }}</span>
			{{ trans(key="ptcg-"~card.rulebox~"-rule-text", lang=lang) }}
		</p>
	{% endif %}
{% endmacro pokemon_card_info %}

{% macro trainer_card_info(card)%}
	<p class="type">{{ trans(key="ptcg-trainer", lang=lang) }} > {{ trans(key="ptcg-"~card.type, lang=lang) }}</p>
	<p class="name">{{ card.name }}</p>
	{% if card.acespec %}
		{{ self::acespec() }}
	{% endif %}
	{% if card.tagteam %}
		<p>
		<span class="tagteam">{{ trans(key="ptcg-tagteam", lang=lang) }}</span>
		</p>
	{% endif %}
	{% if card.ancient %}
		{{ self::ancient() }}
	{% endif %}
	{% if card.future %}
		{{ self::future() }}
	{% endif %}
	{% if card.effect is string%}
		<p class="effect">{{ card.effect }}</p>
	{% else%}
		{% for line in card.effect %}
			<p class="effect">{{ line }}</p>
		{% endfor %}
	{% endif %}
	{% if card.attack %}
		{{ self::attack(attack=card.attack) }}
	{% endif %}
	{% if card.vstar %}
		{{ self::vstar(vstar=card.vstar) }}
	{% endif %}
	<p class="rule">{{ trans(key="ptcg-"~card.type~"-rule", lang=lang) }}</p>
{% endmacro trainer_card_info %}

{% macro energy_card_info(card)%}
	<p class="type">{{ trans(key="ptcg-energy", lang=lang) }} {{ trans(key="ptcg-energy-"~card.type, lang=lang) }}</p>
	<p class="name">{{ card.name }}</p>
	{% if card.acespec %}
		{{ self::acespec() }}
	{% endif %}
	{% if card.effect %}
		{% if card.effect is string%}
			<p class="effect">{{ card.effect }}</p>
		{% else%}
			{% for line in card.effect %}
				<p class="effect">{{ line }}</p>
			{% endfor %}
		{% endif %}
	{% endif %}
{% endmacro energy_card_info %}
