Brink of Disaster timing
You pay all the costs during the activation of an ability, as an action that doesn't use the stack.

After the Shrine's ability has gone on the stack, Brink of Disaster's trigger will go on the stack on top of it (meaning it will resolve first). There's no permanent for it to destroy, though.