Grimoire

The Grimoire is a spell casting minigame unlocked by leveling up Wizard Towers with a Sugar lump. All of the spells are seeded so you can plan ahead of time using planners or savescumming.

Gambler's Fever Dream & Scrying
The backfire chance is not actually double, it is 50% (or the original chance if it is >50%). The spell actually increments the spell cast amount before deciding it's effect, this means that if you cast the spell it casts after, it will have the same seed and thus the same numbers from random calls.

If it succeeds then the next spell will also succeed, if it backfires the next spell instead has a 30% chance to backfire. If the casted spell is Force the Hand of Fate or Spontaneous Edifice the effect will be the same if you cast the same spell afterward without any other spells in between, provided the success/backfire is the same. When casting GFD you usually want to get all possible spells that can give you a refund to give the refund (AKA don't have any buffs on and be pledging, optimal max mana is 39). If you see that it will cast Spontaneous Edifice, quickly cast Diminish Ineptitude yourself to prevent it from casting Spontaneous Edifice, thus getting you more magic in the end and no possible loss of a building.

Magic
The formula for max magic is $$floor(4+towers^{0.6}+ln((towers+(lvl-1)*10)/15+1)*15)$$ The formula makes it so that at a lower tower count both each tower and each level give you more max magic. The formula for magic generation speed is $$max(0.002, \sqrt{magic/max(maxMagic,100)))}*0.06$$

Planners
Planners are tools that can "predict" what the outcome of a spell will be. There are two main ones- Fortune Cookie (Mod) and Messiesur's FtHoF Planner v2.