Card flip memory game in raw JavaScript