In a game this is likely done as simply a prerendered animated texture (atlas).
Perhaps in a modern AAA game you might try a GPU particle system with 10k+ particles.
With the right tech artist, this sort of shader is essentially what their job is. ShaderToy shows how much you can do with a quad and enthusiasm.
You could build this same set up in a particle system and then have convenient knobs (like physics) to turn on for higher quality instances.