This Monte Carlo uses a four-by-six grid. Remove equal-rank pairs when their positions touch horizontally, vertically or diagonally; suits and colors do not matter.
Every pair changes the neighbors
Drag one card onto an adjacent card of the same rank. Both disappear, and the remaining cards automatically slide together in grid order. New cards fill the free positions from the 28-card stock. You do not need to click the stock to compact the board.
Inspect the new grid before the next match
A pair that was legal before the shift may separate, while two previously distant cards may become neighbors. When several pairs are available, compare how their removal will move the surrounding ranks. There are no ordinary card moves or stock redeals. Continue matching until every card has left the grid.