* {
    margin: 0;
    padding: 0;
    box-sizing: border-box
}

:root {
    --bg-main: #464646;
    --bg-card: #2D2727;
    --border-color: #efc94f;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 1.5rem;
    font-family: "Lexend Deca Light";
    background-color: var(--bg-main);
}

h1 {
    color: #fff;
    font-family: "Lexend Deca Light";
    font-size: 2.9rem;
    margin-top: 20px;
}

span {
    color: var(--border-color);
}

#card-section {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-gap: 1.25rem;
}

.card {
    cursor:pointer;
    position: relative;
    transition: all .4s linear;
    transform-style: preserve-3d;
}

.card,
.back-card,
.front-card {
    height: 6rem;
    width: 6rem;
    border-radius: .6rem;
}

.back-card,
.front-card {
    position: absolute;
    backface-visibility: hidden;
}

.front-card {
    background: var(--border-color);
    background-size: contain;
    border-radius: .6rem;
    box-shadow: rgba(208, 214, 220, 0.2) 0px 8px 24px;
    padding: 2rem;
}

.back-card {
    transform: rotateY(180deg);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center center;
    box-shadow: rgba(208, 214, 220, 0.2) 0px 8px 24px;
    padding: 2rem;
}

.card_selected {
    transform: rotateY(180deg);
}

.card_match {
    transform: rotateY(180deg);
}

.card_match1 {
    transform: rotate(0deg);
}

.card_match_border {
    border: 2px solid #efc94f;
}

.footer {
    color: #fff;
    text-align: center;
    position: absolute;
    bottom: 10px;
    font-size: 22px;
    font-weight: 500;
}

.footer p i {
    color: #efc94f;
}

.controls {
    display: flex;
    gap: 22px;
    margin-bottom: 5px;
    margin-right: 233px;
}

button {
    background: #282A3A;
    color: #FFF;
    border: 1px solid #FFF;
    border-radius: 5px;
    padding: 10px 20px;
    cursor: pointer;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 18pt;
    font-weight: bold;
}

.disabled {
    color: #757575;
    border: 1px solid #757575;
}

.stats {
    color: #FFF;
    font-size: 14pt;
    font-weight: bold;
}


.win {
    border: 3px solid #282A3A;
    border-radius: 5px;
    box-shadow: 0 25px 50px rgb(33 33 33 / 25%);
    backface-visibility: hidden;
}

.win {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    text-align: center;
    background: #FDF8E6;
    transform: rotateY(180deg);
    transition: all .4s linear;
    transform-style: preserve-3d;
}

.win-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotateY(360deg);
    font-size: 21pt;
    color: #000000;
}

.highlight {
    color: #d5a813;
}

@media only screen and (max-width: 600px) {

    .card,
    .back-card,
    .front-card {
        height: 65px;
        width: 65px;
        border-radius: .4rem;
    }

    #card-section {
        grid-gap: 20px;
    }

    h1 {
        font-size: 40px;
        margin: 40px 0px 10px 35px;
    }

    .controls {
        display: flex;
        gap: 22px;
        margin-bottom: 15px;
        margin-right: 110px;
    }

    .win {
        top: -1px;
        left: -3px;
        width: 102%;
        height: 102%;
    }

    .win-text{
        font-size: 18px;
    }
}
