Click detection logic for Minesweeper