Sadly I'm aware of that glitch. There is one main glitch that causes all of it. If you put your card on tray and wait 8 seconds, card disappears because of the misplaced timing system in my code. So it's not about clicking offscreen and coming back later. Because you probably spent 8 seconds after you put the card. Except End Turn glitch, it's just my stupidity.
All glitches aside, there is how card cancel system work if you play the same card:
-Game extracts card values and takes the result (just like mentioned in tutorial but it's easy to miss)
-If your card value was bigger, damage/heal goes to your enemy, otherwise damage/heal goes to you.
-Then game looks for corresponding element types to determine if it's damage, heal or uneffected.
For instance: Your enemy is fire. And you are lighting. Let's say you put 4-water and your enemy put 2-water. 4 - 2 = 2, because yours was higher, 2 goes to your enemy. Your enemy takes 2 damage. If enemy's value was higher 2 goes to you. Because of water doesn't damage/heal lighting you see the "Uneffective" text instead of +2/-2 because you don't effected by it.
And yes all of them is my fault because I didn't even explained it, thinking anyone can catch up with the rule. But in my comment section all I see almost no one understood that, and I don't even blame them.
Thank you for your detailed review. Have a good day ^-^