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

.main_hide{
    display: none;
}
.form_hide{
    display: none;

}



body {
    max-width: 1200px;
    margin: 0 auto;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: sans-serif;
    background-color: #1d2b3a;
}


main {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(800px, 3fr) 1fr;
    align-items: center;
    justify-content: center;
    
}

/* HEADER */

header{
    max-width: 900px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    justify-content: center;
    align-items: center;
}


h1{
    color: rgb(239, 239, 239);
    width: 100%;
    font-size: 5rem;
    text-align: center;
}


/* Input */

.inputBox{
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.inputBox input {
    width: 100%;
    height: 10vh;
    padding: 10px;
    border: 1px solid rgba(255,255,255,0.25);
    background: #1d2b3a;
    border-radius: 5px;
    outline: none;
    color : #fff;
    font-size: 3em;
    text-transform: uppercase;
    text-align: center;
}

.inputBox button {
    width: 10vh;
    height: 10vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.inputBox img{
        width: 7vh;
        height: 7vh;
    }

.inputBox > h2{
    position: absolute;
    left: 0;
    font-size: 3em;
    padding: 10px;
    margin-top: 7px;
    pointer-events: none;
    color: rgba(255,255,255,0.25);
    
    text-transform: uppercase;
}


::placeholder{
    color:rgba(255,255,255,0.25)
}



/* CONTENEDORES PRINCIPAL */

.container {
    height: 850px;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 1rem;
    gap: 0.5rem;
    border: 1px solid black;
    border-radius: 1rem;
    background: linear-gradient(rgb(206, 255, 244), rgb(96, 223, 255));
}

.background {
    height: 100%;
    max-width: fit-content;
    border: 5px solid rgb(255, 231, 195);
    background-color: #070808a9;
    padding: 1rem;
    border-radius: 1rem;

}

.container > .countdown {
    height: fit-content;
    width: 100%;
    padding: 0.5rem 1rem;
    border-radius: 0.4rem;
    font-size: 4rem;
    color: #000000;
    font-weight: bold;
    
    
}

.game {
    display: grid;
    gap: 0.5rem;
    align-items: center;
    justify-items: center;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);

}

/* CONTENEDORES SECUNDARIO */

.container_ranking {

    height: 850px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    text-align: center;
    padding: 1rem;
    gap: 1rem;
    border: 5px solid black;
    border-radius: 1rem;
    background: linear-gradient(rgb(255, 205, 113), rgb(255, 230, 128));
}

.hButoms{
    width: 100%;
}

.marked{
    background: #FFFFFF;
    color: black;
}

.butoms {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 1rem
}


button {
    width: 100%;
    border: 3px solid rgb(134, 65, 0);
    background-color: #070808a9;
    border-radius: 0.4rem;
    color: #f7f1f1;
    background: linear-gradient(rgb(35, 86, 255), rgb(0, 85, 165));
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    letter-spacing: 2px;
    cursor: pointer;
    -webkit-box-shadow: 10px 10px 5px -7px rgba(0, 0, 0, 0.2);
    -moz-box-shadow: 10px 10px 5px -7px rgba(0, 0, 0, 0.2);
    box-shadow: 10px 10px 5px -7px rgba(0, 0, 0, 0.2);
}

.ranking {
    display: flex;
    width: 100%;
    height: fit-content;
    flex-direction: column;
    gap: 1rem;
    list-style-position: inside;
}

.ranking > h2 {
    text-decoration: underline;
    font-size: 2rem;
}

.butomsRanking{
    display: flex;
    width: 100%;
    justify-content: space-between;
}

.butomsRanking > h3{
    padding: 0.25rem 0;
    font-size: 1.5rem;
    color: #000000;
    font-weight: bold;
}

.moveRankingLevels{
    display: flex;
    width: 40px;
    justify-content: center;
    align-items: center;
}

img{
    width: 30px;
    height: 30px;
}

.ranking{
    list-style-position: inside;
    display: flex;
    height: fit-content;
}

.ranking li{
    width: fit-content;
}

.perfect{
    font-size: 1.2rem;
    font-weight: bold;
    color: #ff0000;
}

.persons {

    list-style: none;
    font-size: 30px;
    font-weight: bold;

}

.background_ranking {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    border: 2px solid rgb(37, 35, 32);
    background: linear-gradient(rgb(255, 242, 217), rgb(255, 232, 129));
    padding: 1rem 1rem;
    border-radius: 1rem;
}

.hRanking{
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: center;
}

.hRanking > h2{
    height: fit-content;
    justify-content: center;
    align-content: center;
}

.hRanking > .deleteRanking{
    height: fit-content;
    width: fit-content;
    display: flex;
    justify-content: center;
    align-content: center;
    background: linear-gradient(rgb(255, 53, 53), rgb(99, 3, 3));
}

.fButoms {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.5rem;
}

.redButoms {
    background: linear-gradient(rgb(255, 53, 53), rgb(99, 3, 3));
}

.dataFooter{
    list-style: none;
    width: 100%;
    font-size: 26px;
    font-weight: bold;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.tries {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    
    text-align: left;
}



/* CARDS */

.card {
    list-style: none;
    width: 100px;
    height: 130px;
    perspective: 600px;
    margin: 1rem;
    border-radius: 1rem;
    cursor: pointer;
    box-shadow: 10px 9px 17px -6px rgba(0, 0, 0, 0.67);
}

.card:hover .front {
    transform: scale(1.1);
}


.content {
    position: absolute;
    width: 100%;
    height: 100%;
    transition: transform 1s;
    transform-style: preserve-3d;
}

.front,
.back {
    transition: transform 0.2s;
    position: absolute;
    height: 100%;
    width: 100%;
    background: linear-gradient(rgb(250, 190, 78), rgb(184, 150, 15));
    display: grid;
    place-content: center;
    font-size: 5rem;
    border-radius: 1rem;
    backface-visibility: hidden;
    user-select: none;
}

.back {
    background: linear-gradient(steelblue, lightsteelblue);
    transform: rotateY(180deg);
}

.card.flipped .content {
    transform: rotateY(180deg);
    transition: transform 0.5s;
}

.shaking {

    animation: shaking 0.2s ease-in forwards infinite alternate
}

.point {

    animation: point 0.25s ease-in forwards alternate
}

.win {

    animation: win 0.25s ease-in forwards infinite alternate
}



/* ANIMACION */

@keyframes shaking {
    0% {
        transform: rotate(4deg);

    }

    50% {
        transform: rotate(-4deg);
    }

    100% {
        transform: rotate(0deg);
    }
}

@keyframes point {
    0% {
        transform: scale(1);

    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes win {
    0% {
        transform: scale(1) rotate(4deg);


    }

    50% {
        transform: scale(1.1) rotate(-4deg);

    }

    100% {
        transform: scale(1) rotate(0deg);

    }
}

/* media query */

@media screen and (max-width: 1200px){ 
    body {
    max-width: 900px;
    }

    main {
        max-width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    /* HEADER */

    header{
        max-width: 900px;
    }

    /* Input */

    .inputBox{
        position: relative;
        width: 100%;
        display: flex;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        gap: 1rem;
    }

    .inputBox input {
        width: 100%;
        height: 10vh;
        padding: 10px;
    }

    .inputBox button {
        width: 10vh;
        height: 10vh;
    }

    .inputBox > h2{
        
        font-size: 3em;
        padding: 10px;
        margin-top: 7px;
    }

    /* CONTENEDORES PRINCIPAL */

    .container {
        width: 100%;
        height: fit-content;
    }

    .container > .countdown{
        padding: 0;
        font-size: inherit;
    }

    .size{
        font-size: 3rem;
    }

    .background {
        height: 100%;
        max-width: fit-content;
        border: 5px solid rgb(255, 231, 195);
        background-color: #070808a9;
        padding: 1rem;
        border-radius: 1rem;
    }

    .game{
        width: 100%;
        height: fit-content;
        padding: 0.5rem;
        gap: 2rem;
    }

    .card{
        margin: 0;
        max-width: 90px;
        max-height: 110px;
        gap: 0.1rem;
    }

    .content{
        width: 100%;
        height: 100%;
    }

    .front, .back{
        width: 100%;
        height: 100%;
        font-size: 4rem;
        border-radius: 0.5rem;
    }

    /* CONTENEDORES SECUNDARIO */
    .container_ranking{
        width: 100%;
        height: fit-content;
        padding: 0.3rem;
        font-size: 1rem;
        display: grid;
        grid-template-columns: 300px repeat(3, 1fr);
        grid-template-rows: repeat(3, auto);
        gap: 0.3rem;
    }

    .butoms{
        flex-direction: row;
    }

    .hButoms{
        grid-column: 2 / 5;
        grid-row: 1;
    } 


    .fButoms{
        grid-column: 2 / 4;
        grid-row: 2;
    }

    .dataFooter{
        grid-column: 2 / 4;
        grid-row: 3;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .background_ranking{
        grid-column: 1 / 2;
        grid-row: 1 / 4;
        width: 100%;
        padding: 0.25rem;
        gap: 0.25rem;
    }

    .hRanking > h2{
        height: fit-content;
        justify-content: center;
        align-content: center;
    }

    h2, .butomsRanking, .l1, .l2, .l3, .replay, .changePlayer, .deleteRanking, .data{
        height: 2rem;
        font-size: 1.5rem;
    }
    .butomsRanking > h3{
        font-size: 1.5rem;
    }

    .moveRankingLevels{
        width: 2rem;
        height: 2rem;
    }

    img{
    width: 1.5rem;
    height: 1.5rem;
    }

    .ranking{
        gap: 0.25rem;
    }

    .dataFooter{
        display: flex;
        justify-content: space-around;
    }

    .data{
        height: fit-content;
        display: flex;
        flex-direction: row;
        justify-content: center;
        align-items: center;
    }

    .dataFooter > li{
        width: fit-content;
    }
}

@media screen and (max-width: 900px){
    body{
        max-width: 600px;
    }

    main{
        height: fit-content;
        flex-direction: column;
    }

    /* HEADER */

    h1{
    font-size: 4rem;
}

    /* CONTENEDORES PRINCIPAL */
    .container{
        width: 100%;
        height: fit-content;
        padding: 0.3rem;
        gap: 0.3rem;
    }

    .container > .countdown{
        padding: 0;
        height: auto;
        font-size: inherit;
    }

    .size{
        font-size: 1.5rem;
    }
    
    .background{
        width: 100%;
        height: fit-content;
        padding: 0.3rem;
    }

    .game{
        width: 100%;
        height: fit-content;
        padding: 0.5rem;
        gap: 1.5rem;
    }

    .card{
        max-width: 70px;
        max-height: 90px;
        gap: 0.1rem;
    }

    .content{
        width: 100%;
        height: 100%;
    }

    .front, .back{
        font-size: 3.5rem;
    }

    /* CONTENEDORES SECUNDARIO */
    .container_ranking{
        grid-template-columns: 190px repeat(3, 1fr);
        font-size: 0.7rem;
    }

    .butoms{
        flex-direction: row;
    }

    .hButoms{
        grid-column: 2 / 5;
        grid-row: 1;
    } 

    .fButoms{
        grid-column: 2 / 4;
        grid-row: 2;
    }

    .dataFooter{
        grid-column: 2 / 4;
        grid-row: 3;
        flex-direction: row;
        align-items: center;
    }

    .background_ranking{
        grid-column: 1 / 2;
        grid-row: 1 / 4;
        width: 100%;
        padding: 0.25rem;
        gap: 0.25rem;
    }

    h2, .butomsRanking, .l1, .l2, .l3, .replay, .changePlayer, .deleteRanking, .data{
        height: 2rem;
        font-size: 1.5rem;
    }

    .butomsRanking > h3{
        font-size: 1rem;
    }
    
    .perfect{
        font-size: 0.7rem;
    }

    .moveRankingLevels{
        width: 1.5rem;
        height: 1.5rem;
    }

    img{
    width: 1rem;
    height: 1rem;
    }
}

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

    body{
        min-width: 370px;
        height: 100vh;
    }

    /* HEADER */

    header{
        width: 100%;
    }

    h1{
        color: rgb(239, 239, 239);
        font-size: 2rem;
    }

    ::placeholder{
        font-size: 2rem;
}

    /* CONTENEDORES PRINCIPAL */
    .container{
        gap: 0.1rem;
    }

    .card{
        max-width: 30px;
        max-height: 50px;
        gap: 0.1rem;
    }

    .front, .back{
        width: 100%;
        height: 100%;
        font-size: 1.6rem;
        border-radius: 0.5rem;
    }

    /* CONTENEDORES SECUNDARIO */
    .container_ranking{
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(4, auto);
        gap: 0.1rem;
    }

    .hButoms{
        grid-column: 1 / 4;
        grid-row: 1;
    } 

    .fButoms{
        grid-column: 1 / 3;
        grid-row: 2;
    }

    .dataFooter{
        grid-column: 1 / 3;
        grid-row: 3;
    }

    .background_ranking{
        grid-column: 1 / 4;
        grid-row: 4;
    }

    h2, .butomsRanking, .l1, .l2, .l3, .replay, .changePlayer, .deleteRanking, .data{
        height: 1.5rem;
        font-size: 1rem;
    }
}