{#if view.winReason === "treasures"}
carried two stolen treasures home — the maze is theirs
{:else if view.winReason === "lastStanding"}
the last wizard standing
{:else}
wins the game
{/if}
{/if}
{#if openingRolls}
The dice decide who casts first
{#each openingRolls.players as p (p)}
{p === openingRolls.first ? "🏆 " : ""}{p}
{#each openingRolls.rolls[p] ?? [] as r, i (i)}🎲{r}{/each}
Your {broken.map((c) => cardDef(c.card.cardId).name).join(" and ")}
{broken.length === 1 ? "was" : "were"} nullified — the attack comes on unchecked.
{:else if standing.length > 0}
Your {standing.map((c) => cardDef(c.card.cardId).name).join(" and ")}
stand{standing.length === 1 ? "s" : ""} — only what slips past
{standing.length === 1 ? "it" : "them"} will land. Counter again, or let it resolve.
{cardDef(ambushVia.cardId).name} — set an ambush
{#if !ambushTrigger}
springs when an opponent…
{:else if !ambushSpell}
— now tap the attack card to commit
{:else}
{cardDef(ambushSpell.cardId).name}{attachedNumber ? ` with a ${numberTotal}` : " (tap a number to power it)"}
{/if}
{#if selectedCreature && !selectedDef}
{@const sc = view.creatures.find((c) => c.id === selectedCreature)}
{#if sc}
Commanding {cardDef(sc.kind).name} — {creatureStats(sc)}.
Tap a square beside it to march, a target in its square to attack.
{/if}
{/if}
{#if youMustRespond && view.stack}
{#if view.stack.defenderId === view.you && selectedCard?.cardId === "teleport"}
{pendingTeleport
? "Escaping by teleport — tap the marked square again to jump."
: "Escaping by teleport — tap a square within four spaces to mark it."}
{:else if view.stack.defenderId === view.you}
{view.stack.attackerId} attacks with
{attackingCreature ? `the ${cardDef(attackingCreature.kind).name}` : view.stack.attackCard ? cardDef(view.stack.attackCard.cardId).name : "a punch"} —
tap a counteraction card, or
{:else}
{view.stack.waitingOn === view.you ? "They counter your spell — counter back, or" : ""}
{/if}
{/if}
{#if youMustDiscard}
Hand over the limit — mark cards and discard.
{:else if discardMode && discardSelection.size === 0}
Mark the cards to throw away, then confirm.
{/if}
{#if discardSelection.size > 0}
{/if}
{#if discardMode || (discardSelection.size > 0 && !youMustDiscard)}
{/if}
{#if selectedDef}
{selectedDef.name}
{#if selectedCard && EDGE_CARDS.has(selectedCard.cardId)}
— {EDGE_HINTS[selectedCard.cardId] ?? "click a wall line"}
{/if}
{#if selectedCard && WAND_IDS.has(selectedCard.cardId) && view.wandCharges[selectedCard.instanceId] == null && !attachedNumber}
— first use: tap a NUMBER card to set the wand's charges, then click a target
{:else if selectedDef.cardType === "attack" && !cellSelectMode && !EDGE_CARDS.has(selectedCard?.cardId ?? "")}
— click a target, or a wall line to batter it{attachedNumber ? ` (powered by a ${numberTotal})` : ""}
{/if}
{#if attachedMods.length > 0}
[+ {attachedMods.map((m) => cardDef(m.cardId).name).join(", ")}]
{/if}
{#if selectedCard?.cardId === "boobytrap"}
— place 4 tokens ({trapCells.length}/4; the first is real)
{/if}
{#if selectedCard?.cardId === "redirection"}
{tradeFrom ? "— now the exit it should connect TO" : "— click the first exit"}
{:else if selectedCard && TWO_CELL_CARDS.has(selectedCard.cardId)}
{tradeFrom ? "— now the second square" : "— click the first square"}
{/if}
{#if selectedCard?.cardId === "teleport" && !youMustRespond}
{pendingTeleport
? "— tap the marked square again to jump, or pick another"
: "— tap a destination (up to four squares, walls ignored)"}
{#if pendingTeleport}
{/if}
{/if}
{#if selectedCard?.cardId === "mega-monster"}
— double its— then tap the monster
{/if}
{#if selectedCard?.cardId === "pick-lock" || selectedCard?.cardId === "master-key"}
{/if}
{#if selectedCard?.cardId === "rotate-sector"}
— click the sector
{/if}
{#if selectedCard?.cardId === "relocate-sector"}
{pendingSectorFrom
? (relocateGhosts?.length
? "— now tap a dashed landing beside the maze"
: "— that sector has nowhere legal to go; pick another")
: "— click the sector to move"}
{/if}
{#if selectedCard && NAMED_CARDS.has(selectedCard.cardId)}
{#if selectedCard.cardId === "deja-vu"}
{:else}
— then click the target
{/if}
{/if}
{#if selectedCard?.cardId === "waterbolt"}
(knockback {numberTotal - wbDamage})
{/if}
{#if selectedCard?.cardId === "power-run"}
{/if}
{#if selectedCard && CONFIRM_CAST.has(selectedCard.cardId)}
{/if}
{#if selectedCard && isMovableObject(selectedCard.cardId) && isYourTurn}
{/if}
{#if selectedCard && isNumberCard(selectedCard.cardId)}
{/if}
{/if}