I need to create a card element that always flips in the same direction when clicked and the attached two snippets do exactly what I want but only when using Chrome and Firefox. When viewing the snippet on Safari on both iOS and MacOS, one encounters a weird issue where after approximately 20 clicks, the card flips randomly back and forth and becomes unpredictable as shown in the attached screen record. I tried to implement the desired behaviour in two different variants which I also attached, one using a counter variable and one using the Web Animations API. Both variants work fine under Firefox and Chrome and should also work according to the official specification but do not work under Safari without regard to the operating system or device.
Created attachment 464470 [details] Two implementation variants and a screen recording of the issue
*** This bug has been marked as a duplicate of bug 250515 ***