Sort by {#each [['name','Name'],['cost','Cost'],['attack','Attack'],['defense','Defense'],['rarity','Rarity']] as [val, lbl]} {/each}
{#if filtersOpen}
Rarity
{#each RARITIES as r} {/each}
Type
{#each TYPES as t} {/each}
Cost
Min: {costMin} { if (costMin > costMax) costMax = costMin; }} /> Max: {costMax} { if (costMax < costMin) costMin = costMax; }} />
{/if}
{#if loading}

Loading your cards...

{:else if filtered.length === 0}

No cards match your filters.

{:else}

{filtered.length} card{filtered.length === 1 ? '' : 's'}

{#each filtered as card (card.id)} {/each}
{/if} {#if selectedCard}
e.stopPropagation()}>

{actionMessage}

{/if}