let your players make up the magic system as they go along, doing whatever overpowered bullshit they want as long as they give a brief in-universe explanation of why they can do that (e.g. “actually i’m immune to fire magic because i’m wearing red”).
keep track of everything they do. then use the magic system they created against them, turning every deus ex machina they ever gave themselves into a diabolus ex machina (e.g. “you notice that the giant plant monster has a red ribbon tied around its trunk, making it immune to fire magic”).