Ball Sort Game

Setup and goal

There are C equal containers, each one capable of holding up to H items (balls).

Such items can have N different colors. For each color, there are exactly H items, so in total there are N•H items.

Initially, N of such containers are filled with these items,randomly sorted, and the remaining K=C-N containers are empty.

The goal is to move these items among the containers to sort them and have N full containers, each one with H items of the same color.

Moving rules

You can move the item on the top of container A to container B if either:

As an additional rule, you can:

Finally, you can optionally choose to initially hide the color of all the items except the top one in each containers.
The color of such items is revealed as soon as they become the top items.

Resources

See here for more details on how to solve the game.

Number of colors
Number of empty containers
Max number of items per container
YOU WON! NO MORE USEFUL MOVES... NO MORE MOVES...