@font-face {
font-family: "Go Speeds";
src: url('/img/font/GoSpeeds.ttf')
}

@font-face {
font-family: "KG HAPPY";
src: url('/img/font/KGHAPPY.ttf')
}

* {
box-sizing: border-box;
}

html {
min-height: 100vh;

}

body {
margin: 0;
background: url('/img/background.jpg');
background-repeat: no-repeat;
background-size: cover;
}

.page-title {
color:#40a3b5; 
font-family: KG HAPPY, serif;
font-weight: normal;
text-align: center;
font-size: 6em;
}

.game-info-container {
grid-column: 1 / -1;
display: flex;
justify-content: space-between;
}

.game-info {
font-family: Go Speeds, serif;
color: #5DC0D1;
font-size: 4em;
font-style: bold;
}

.game-container {
display: grid;
grid-template-columns: repeat(4, auto);
grid-gap: 10px;
margin: 50px;
justify-content: center;
perspective: 500px;
}

.card {
overflow: hidden;    
position: relative;
height: 175px;
width: 125px;
}

.card-face {
position: absolute;
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 100%;
border-radius: 12px;
border-width: 1px;
border-style: solid;
overflow: hidden;
transition: transform .5s ease-in-out;
backface-visibility: hidden;
}

.card.visible .card-back {
transform: rotateY(-180deg); 
}

.card.visible .card-front {
transform: rotateY(0); 
}

.card.matched .card-front .card-value {
animation: dance 1s linear .5s;
}

img{
object-fit: cover;
height: 189px;
width: 135px;

}
.card-back {
background-color: #f7f6eb;
border-color: #d50821;
transform: rotateY(0); 
}

.x-logo {  
position: absolute;
width: 47px;
height: 47px;
transition: transform 100ms ease-in-out;
transform: translateY(-10px);
} 


.card-face:hover .x-logo {
width: 52px;
height: 52px;
}


.card-back:hover .x-logo {
transform: translateY(0);
}

.card-value {
position: relative;
transition: transform 100ms ease-in-out;

}


.card-front {
transform: rotateY(180deg);
}

.overlay-text {
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 100;
display: none;
position: fixed;
justify-content: center;
align-items: center;
flex-direction: column;
color: #0ebfbc; 
font-family: KG HAPPY, serif;
transition: background-color 500ms, font-size 500ms;
}

.overlay-text-small {
font-size: .3em;
}

.overlay-text.visible {
display: flex;
animation: overlay-grow .5s forwards;
}

@keyframes dance {
0%, 100% {
    transform: rotate(0)
}
25% {
    transform: rotate(-30deg)
}
75% {
    transform: rotate(30deg) 
}
}

@keyframes overlay-grow {
from {
    background-color: rgba(240, 228, 228, 0);
    font-size: 0;
}
to {
    background-color: rgba(0, 0, 0, .8);
    font-size: 10em;
}
}

@media (max-width: 600px) {
.game-container {
    grid-template-columns: repeat(2, auto)
}

.game-info-container {
    flex-direction: column;
    align-items: center;
}
}