*{
    box-sizing:border-box;
    margin:0;
    padding:0;
}

body{
    font-family:Arial, Helvetica, sans-serif;
    background:linear-gradient(135deg,#00767d,#287c7c);
    display:flex;
    justify-content:center;
    align-items:center;
    min-height:100vh;
}

.container{
    width:95%;
    max-width:900px;
    text-align:center;
    color:white;
}

.title-container{
    display:flex;
    justify-content:center;
    align-items:center;
    gap:10px;
    margin-bottom:10px;
}

.game-info{
    display:flex;
    flex-wrap:wrap;
    justify-content:center;
    align-items:center;
    gap:15px;
    margin:15px 0;
}

.info-item{
    font-weight:bold;
}

button{
    padding:8px 15px;
    border:none;
    border-radius:6px;
    cursor:pointer;
    font-weight:bold;
}

#musicBtn{
    width:42px;
    height:42px;

    padding:0;

    border:none;
    border-radius:50%;

    background:#fff;

    font-size:20px;

    box-shadow:0 4px 10px rgba(0,0,0,.2);

    transition:.2s;
}

#musicBtn:hover{
    transform:scale(1.1);
}

.game-board{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(120px,1fr));
    gap:15px;
}

.card{
    position:relative;
    width:100%;
    aspect-ratio:2/3;
    perspective:1000px;
    cursor:pointer;
}

.card-inner{
    width:100%;
    height:100%;
    position:relative;
    transform-style:preserve-3d;
    transition:transform .6s ease;
}

.card.flip .card-inner{
    transform:rotateY(180deg);
}

.card-front,
.card-back{
    position:absolute;
    width:100%;
    height:100%;
    top:0;
    left:0;

    border-radius:15px;
    overflow:hidden;

    backface-visibility:hidden;
}

.card-front{
    transform:rotateY(180deg);
}

.card-front img{
    width:100%;
    height:100%;
    object-fit:cover;
}

.card-back{
    background:#76bc21;
    display:flex;
    align-items:center;
    justify-content:center;
}

.card-back img{
    width:60%;
    height:auto;
}

.overlay{
    position:fixed;
    inset:0;

    background:rgba(0,0,0,.7);

    display:flex;
    justify-content:center;
    align-items:center;

    opacity:0;
    pointer-events:none;

    transition:.4s;
}

.overlay.active{
    opacity:1;
    pointer-events:all;
}

.modal{
    background:white;
    color:#333;

    padding:30px;

    border-radius:15px;

    text-align:center;

    animation:pop .4s ease;
}

@keyframes pop{
    from{
        transform:scale(.6);
        opacity:0;
    }

    to{
        transform:scale(1);
        opacity:1;
    }
}

/* MÓVIL */

@media (max-width:768px){

    body{
        padding:8px;
        align-items:flex-start;
    }

    h1{
        font-size:1.2rem;
    }

    .container{
        width:100%;
    }

    .game-info{
        gap:8px;
        font-size:13px;
    }

    #restart{
        font-size:12px;
        padding:6px 10px;
    }

    #musicBtn{
        width:36px;
        height:36px;
        font-size:18px;
    }

    .game-board{

        grid-template-columns:repeat(4,1fr);

        gap:6px;

        width:100%;
        max-width:380px;

        margin:auto;
    }

    .card{
        aspect-ratio:2/3;
    }

    .modal{
        width:90%;
    }
}



.botoncito {
    width: 200px;
    position: absolute;
    top: 40px;
    left:40px;
}