.coin-scene { width: 400px; height: 400px; margin: 40px auto; perspective: 1000px; } .coin { width: 400px; height: 400px; position: relative; transform-style: preserve-3d; transition: transform 1.6s ease-out; } .coin-face { position: absolute; width: 100%; height: 100%; backface-visibility: hidden; border-radius: 50%; } .coin-face img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; } /* Heads = front */ .heads { transform: rotateY(0deg); } /* Tails = back */ .tails { transform: rotateY(180deg); } .hidden { opacity: 0; visibility: hidden; } .show { opacity: 1; visibility: visible; transition: opacity 0.6s ease-in; }