Casting order is determined by your initiative.
The description of initiative is very vague on here, but it really just means the order of your attack.
You can level it by refining for now and later by eight inner gates and other things.
And also attacking order is affected by the position of your ninjas on your team,
for instance even if the initiative of your ninja on position/"move" 3 is a lot higher than your opponent, you still cannot attack before their ninja on position/"move" 1 use their mystery.
This is why for most times you should let your ninja thats on move 1 to have the highest initiative