My girlfriend has been playing a game on her smartphone for a while. The rules are:
- there are $n+2$ tubes (with $n\ge 1$) and $n$ colored liquids.
- Two tubes are left empty and the others are filled with four doses of liquid.
- A tube cannot contain more than $4$ doses of liquid.
- There are exactly $4$ doses of each liquid.
- Liquids of different colors are non-miscible.
- The goal is to move liquids so that the $4$ doses of each liquid are in a single tube.
- Only the doses of liquid on the top of a tube can be moved. They have to be moved on top of a liquid of the same color.
- All doses of the same color at the top have to be moved at the same time. The only exception is when there is not enough space available when moving into a new tube. Only the doses of the same color that can be moved are then moved. For example, imagine that tube 1 contains three red doses and tube 2 contains a red dose above a blue one. In that case, two red doses from tube 1 can be moved to tube 2.
Here is a picture that illustrates the problem (with $n=9$):
For example, the pink liquid at the top of the fifth tube can be moved to an empty tube. After that, the two doses of red liquid from the same tube can be moved on the remaining empty tube. It is not possible to move only one dose of red liquid.
Is there a general strategy to solve this problem?
My intuition tells me that I could use induction (like the Hanoi towers problem), or graphs, or invariants (defining the degree of disorder of a configuration, the solution of the problem corresponding to a degree of disorder of $0$), but I don't really know how to get started in any of these directions.
Note: I am not sure that it is possible to win from any starting configuration.

