{#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 trapNotice}
A cruel draw!
{trapNotice === "gift-from-below"
? "It bites for 3 points, then the deck deals you another."
: "The trap snaps shut — you lose a turn."}
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?.cardId === "illusionary-attack" && view.stack.params?.cardId
? `an illusionary ${cardDef(view.stack.params.cardId).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 === "swap-meet"}
{#if !swapMeetTarget}
— click the other trader
{:else if myTradables.length === 0}
— you carry no items to trade
{:else if !swapMine}
— trade away your:
{#each myTradables as c (c.key)}
{/each}
{:else if theirTradables.length === 0}
— they show no item you could claim
{:else}
— and take their:
{#each theirTradables as c (c.key)}
{/each}
{/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?.cardId === "add"}
— ADD rides a second NUMBER: play one number for movement,
then play another, and the Add spends itself
{/if}
{#if selectedCard && isNumberCard(selectedCard.cardId)}
{@const needsAdd = view.turn.numberPlayedForMovement}
{@const haveAdd = view.yourHand.some((c) => c.cardId === "add")}
{#if needsAdd && !haveAdd}
— a second movement number needs an ADD card
{:else}
{/if}
{/if}
{/if}
{/if}
{#if isYourTurn && onWarpToken}
{/if}
{#if isYourTurn}
{#if pickChoice}
— whose?
{#each treasuresHere as t (t.id)}
{/each}
{/if}
{#each objectsHere as obj (obj.instanceId)}
{/each}
{#if holdingWard}
{/if}
{/if}