Phase transition for the clock model via random-cluster percolation