* {
    box-sizing: border-box;
}

html {
    min-height: 100vh;
    /* cursor: pointer; */
}

body {
    margin: 0;
    background: #99918e;  /* fallback for old browsers */
    background: linear-gradient(to bottom, #FF9900, #FF9900); 
}

.page-title {
    font-family: 'Griffy', cursive;
    color: white;
    text-align: center;
    font-size: 6em;
}

.overlay-text {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    justify-content: center;
    align-items: center;
    z-index: 100;
    color: white;
    font-family: 'Griffy', cursive;
}

.overlay-text-small {
    font-size: .3em;
}
.overlay-text.visible {
    display: flex;
    flex-direction: column;
    animation: overlay-growth 500ms forwards;
}
@keyframes overlay-growth {
    from {
        background-color: rgba(0, 0, 0, 0);
        font-size: 0;
    }
    to {
        background-color: rgba(0, 0, 0, .8);
        font-size: 8em;
    }
}

.game-status-container {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-around;
}

.game-status {
    font-family: 'Henny Penny', cursive;
    color: white;
    font-size: 4em;
}

.card {
    position: relative;
    height: 326px;
    width: 201px;
}

.game-container {
    display: grid;
    grid-template-columns: repeat(4, auto);
    grid-gap: 10px;
    margin: 50px;
    justify-content: center;
    perspective: 500px;   
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    backface-visibility: hidden;
    transition: transform 500ms ease-in-out;
}

.card.visible .card-back {
    transform: rotateY(-180deg);
  }
  
.card.visible .card-front {
    transform: rotateY(0)
  }

.card.matched .card-value {
    animation: shake 1s linear infinite 500ms
}

@keyframes shake {
    0%, 100% {
        transform: rotate(0);   
    }
    25% {
        transform: rotate(-30deg);
    }
    75%{
        transform: rotate(30deg);
    }
}

.card-back {
    background-color: #FF9900;
    border: rgb(255, 255, 255) 4px solid;
}

.card-back:hover {
    transform: translateY(-10px);
}

.black-cat {
    align-self: center;
}

.card-front {
    background-color: #ffffff;
    border: black 4px solid;
    transform: rotateY(180deg);
    
}

.card-front:hover .card-value {
    transform: scale(1.5);

}

@media (max-width: 600px) {
    .game-container {
        grid-template-columns: repeat(2, auto);
    }
    .game-status-container {
        flex-direction: column;
        align-items: center;
    }
}