html{ width: 100vw; height: 100vh; } body{ margin: 0; padding: 0; display: flex; flex-direction: column; width: 100%; height: 100%; position: relative; } body::before{ content: ""; position: absolute; z-index: -1; width: 100%; height: 100%; background: url("bacgroung_fortune_teller.jpg") ; opacity: 0.8; background-size: cover; background-repeat: no-repeat; background-position: center; } .card{ display: flex; justify-content: center; align-items: center; width: 200px; height: 300px; border: 1px solid grey; border-radius: 15px; font-size: 200px; color: darkslategrey; } #wrapper{ margin: auto; display: flex; flex-direction: column; align-items: center; perspective: 1000px; } #card{ position: relative; width: 200px; height: 300px; transform-style: preserve-3d; transition: transform .5s; } #back-face{ position: absolute; background: url("./back-red_large-1024x1024.png"); background-position: center; background-size: cover; backface-visibility: hidden; } #front-face{ transform: rotateY(180deg); position: absolute; background: #f1e8b8; } .table{ display: flex; } .memory-card{ transform-style: preserve-3d; box-shadow: 1px 1px 0 rgba(0, 0, 0, .3); transform: scale(1); background: #f1e8b8; cursor: pointer; margin: 0 5px; } .memory-card:active{ transform: scale(0.97); transition: transform .2s; } .textResult{ width: 100px; height: 40px; } #card.flip{ transform: rotateY(180deg); } .hidden{ opacity: 0; } #textResult{ margin: 5px auto; text-align: center; font-size: 30px; font-style: italic; border-radius: 10px; color: red; background: #f1e8b8; width: 200px; } #btn{margin-top: 5px; font-size: 20px; background: #f1e8b8; width: 150px; height: 35px; border-radius: 15px; border: 1px solid lightgray; }