* {
    box-sizing: border-box;
}

/* .abc {
    border: 2px solid #65eb84;
} */

.memory-game-container {
    background: #fff;
    min-height: 100%;
    font-family: "Lilita One", serif;
    font-style: normal;
    margin: 0;
    padding: 0;
}

.body-title h1 {
    color: #0372cc;
    font-size: 40px;
    font-family: "Lilita One", serif;
    font-weight: 700;
    text-align: center;
    margin-bottom: 25px;
    margin-top: 0;
}

.game-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    font-size: 24px;
    color: #2A2A2A;
}

.final-score {
    text-align: center;
    margin: 20px 0;
    font-size: 24px;
    color: #2A2A2A;
}

.head-wrap {
    position: relative;
    width: 100%;
    height: 150px;
    /* background-color: #2d42fa; */
    /* background-repeat: no-repeat; */
}

.head-wrap-image {
    position: absolute;
    width: 150px;
    left: 50%;
    transform: translatex(-50%);
    bottom: -60px;
}

.head-wrap-image img {
    width: 100%;
}

.floating-c {
    animation-name: floating;
    animation-duration: 3s;
    animation-iteration-count: infinite;
    animation-timing-function: ease-in-out;
}

@keyframes floating {
    from {
        transform: translate(0, 0px);
    }

    65% {
        transform: translate(0, 10px);
    }

    to {
        transform: translate(0, -0px);
    }
}

.wrap {
    position: relative;
    height: 100%;
    padding-bottom: 50px;
    padding-top: 100px;
    padding-left: 10px;
    padding-right: 10px;
    width: 800px;
    margin: auto;
    max-width: 100%;
}

.game {
    transform-style: preserve-3d;
    perspective: 500px;
    min-height: 100%;
    height: 100%;
}

/* Grid Layouts */
.game.grid-easy .card {
    width: 25%;
    height: 206px;
}

.game.grid-medium .card {
    width: 20%;
    height: 206px;
}

.game.grid-hard .card {
    width: 16.666%;
    height: 206px;
}

@keyframes matchAnim {
    0% {
        border: 2px solid white;
    }

    100% {
        border: 2px solid #65eb84;
    }
}

.card {
    float: left;
    padding: 5px;
    text-align: center;
    display: block;
    perspective: 500px;
    position: relative;
    cursor: pointer;
    z-index: 50;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    object-fit: cover;
}

.card .inside {
    width: 100%;
    height: 100%;
    display: block;
    transform-style: preserve-3d;
    transition: 0.4s ease-in-out;
    background: white;
}

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

.card .inside.picked,
.card .inside.matched {
    transform: rotateY(180deg);
}

.card .inside.matched {
    animation: 1s matchAnim ease-in-out;
    animation-delay: 0.4s;
}

.card .front,
.card .back {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 0px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.card .front img,
.card .back img {
    max-width: 100%;
    display: block;
    margin: 0 auto;
    max-height: 100%;
    width: 100%;
    object-fit: cover;
}

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

.abc {
    transform: scale(-0.9);
}

.card .back {
    transform: rotateX(0);
}

.modal-overlay {
    display: none;
    background: rgba(0, 0, 0, 0.8);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

.modal {
    display: none;
    position: relative;
    width: 500px;
    height: 400px;
    max-height: 90%;
    max-width: 90%;
    min-height: 380px;
    margin: 0 auto;
    background: white;
    top: 50%;
    transform: translateY(-50%);
    padding: 30px 10px;
}

.modal .winner {
    color: #0372cc;
    font-size: 40px;
    font-family: "Lilita One", serif;
    font-weight: 700;
    text-align: center;
    margin-bottom: 25px;
    margin-top: 0;
}

.modal h3 {
    color: #353535;
    font-size: 26px;
    font-family: "Lilita One", serif;
    font-weight: 500;
    text-align: center;
    margin-bottom: 15px;
    margin-top: 0;
}

.winner-cup {
    text-align: center;
}

.winner-cup img {
    text-align: center;
    width: 20%;
}

.modal .restart {
    margin: 30px auto;
    padding: 15px 30px;
    display: block;
    font-size: 20px;
    border: none;
    background: #FFD502;
    border-radius: 50px;
    color: #2A2A2A;
    cursor: pointer;
    font-family: "Lilita One", serif;
    margin-bottom: 0;
}

.modal .restart:hover {
    background: #2A2A2A;
    color: #FFD502;
}

@media (max-width: 1024px) {
    .game.grid-easy .card {
        height: 22%;
    }

    .game.grid-medium .card {
        height: 22%;
    }

    .game.grid-hard .card {
        height: 20%;
    }

    .head-wrap {
        height: 130px;
    }

    .head-wrap-image {
        position: absolute;
        width: 100px;
        bottom: -30px;
    }

    .wrap {
        position: relative;
        height: 88vh;
        width: 100%;
        margin: auto;
        padding-top: 50px;
        padding-left: 5px;
        padding-right: 5px;
    }

    .card .front,
    .card .back {
        padding: 0;
    }
}

@media (max-width: 767px) {
    .game.grid-easy .card {
        height: 20%;
    }

    .game.grid-medium .card {
        height: 20%;
    }

    .game.grid-hard .card {
        height: 18%;
    }

    .head-wrap {
        height: 80px;
    }

    .head-wrap-image {
        position: absolute;
        width: 80px;
        bottom: -30px;
    }

    .wrap {
        padding-top: 50px;
        width: 100%;
        margin: auto;
        padding-left: 5px;
        padding-right: 5px;
    }

    .card .front,
    .card .back {
        padding: 0;
    }

    .game-stats {
        font-size: 18px;
        gap: 10px;
    }
}