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

body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    font-family: Verdana, sans-serif;
    font-size: 1.2rem;
}

main {
    width: calc(100vmin - 1rem);
    max-width: calc(100vh - 11.5rem);
    display: grid;
    grid-template-columns: auto auto auto auto;
    grid-gap: .5rem;
    margin: .5rem auto;
}

main > div {
    border: 1px solid lightgray;
    height: calc((100vmin - 2.5rem) / 4);
    max-height: calc((100vh - 14rem) / 4);
    box-shadow: 1px 1px 2px lightgray;
}

main > div.matched {
    border: none;
    box-shadow: none;
}

.agregar-alerta {
    display: none;
    width: 100%;
    height: 3rem;
    text-align: center;
    text-decoration: none;
    position: fixed;
    bottom: 0;
    justify-content: center;
    align-items: center;
    animation-duration: 1s;
    animation-fill-mode: both;
    background: #f3a08c;
    cursor: pointer;
}

@keyframes efecto {

    from,
    60%,
    75%,
    90%,
    to {
        animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
    }

    from {
        opacity: 0;
        transform: translate3d(0, 3000px, 0);
    }

    60% {
        opacity: 1;
        transform: translate3d(0, -20px, 0);
    }

    75% {
        transform: translate3d(0, 10px, 0);
    }

    90% {
        transform: translate3d(0, -5px, 0);
    }

    to {
        transform: translate3d(0, 0, 0);
    }
}

.efecto {
    animation-name: efecto;
}

.congrats {
    display: flex;
    width: 100%;
    height: 80%;
    position: absolute;
    background: white;
}

.congrats div {
    display: flex;
    flex-direction: column;
    margin: auto;
}

p {
    text-align: center;
    margin: 1rem;
}

.botones {
    width: 100vw;
    margin-bottom: .5rem;
}

button {
    display: block;
    font-size: 1rem;
    line-height: 3rem;
    margin: .75rem auto 0 auto;
    border-radius: 2rem;
    width: 95%;
}

@media screen and (orientation:landscape) {
    body {
        flex-direction: row;
    }
    main {
        width: calc(100vmin - 5rem);
      /*  max-width: calc(100vw - 11.5rem);*/
        max-width: calc(100vh - 4rem);
        margin: .5rem;
    }

    main > div {
        height: calc((100vw - 13rem) / 4);
        max-height: calc((100vh - 6.5rem) / 4);
    }

    .botones {
        width: auto;
        margin-right: .5rem;
    }

    button {
        width: 10rem;
    }
}

@media screen and (min-width:1024px) {
    main {
        width: calc(100vmin - 5rem);
        grid-gap: 1rem;
        margin: 1rem;
    }

    main > div {
        height: calc((100vmin - 8rem) / 4);
    }

    button {
        width: 15rem;
    }
}
