/* -----------------------------------------------------------------------------*/
/* TELAS COM LARGURA DE 376PX A 414PX */

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

    body {
        height: 100dvh;
        overflow: hidden;
    }

    #cabecalho {
        grid-template-columns: 34vw 33vw 33vw;
        grid-template-rows: 50% 50%;
        height: 12dvh;
        overflow: hidden;
        align-items: center;
        margin: 1% auto;
    }

    #titulo {
        display: none;
    }

    #titulo-media {
        display: block;
        margin-top: 0;
        width: 100%;
        grid-area: 1 / 1 / span 2 / span 2;
        max-height: 100%;
        object-fit: contain;
    }
    
    #score {
        grid-area: 1 / 3;
    }
    
    #placar {
        font-size: 1.5rem;
        line-height: 2.2rem;
    }
    
    #marcatempo {
        grid-area: 2 / 3;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        position: static;
        top: auto;
        right: auto;
        z-index: 60;
    }

    #cronometro {
        font-size: 1.5rem;
        line-height: 2.2rem;
    }

    #caixa-dialogo {
        display: grid;
        grid-area: 1 / 1 / span 2 / span 2;
        grid-template-columns: 80% 20%;
        grid-template-rows: 1fr 1fr;
        row-gap: 0.3dvh;
        align-items: center;
        position: relative;
        top: auto;
        left: auto;
        width: 100%;
        height: 12dvh;
        max-width: 100%;
        padding: 0.5dvh 2%;
        box-sizing: border-box;
        z-index: 50;
        border-radius: 0;
        overflow: hidden;
    }

    #caixa-dialogo p {
        grid-area: 1 / 1 / 3 / 2;
        margin: 0 3% 0 0;
        padding-left: 2%;
        display: block;
        font-size: clamp(0.7rem, 2dvh, 2.2dvh);
        line-height: 1.15;
    }

    #botao-sim {
        grid-area: 1 / 2 / 2 / 3;
        font-size: 1rem;
        margin: 0;
        padding: 0.2dvh 0.5dvh;
        height: 100%;
        max-height: 5dvh;
        box-sizing: border-box;
        border-radius: 5px;
    }

    #botao-nao {
        grid-area: 2 / 2 / 3 / 3;
        font-size: 1rem;
        margin: 0;
        padding: 0.2dvh 0.5dvh;
        height: 100%;
        max-height: 5dvh;
        box-sizing: border-box;
        border-radius: 5px;
    }

    #stage {
        height: min(88dvh, calc(100vw * 15 / 8));
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
        padding: 0;
    }

    #container {
        height: 100%;
        width: 100%;
        max-width: 100%;
        aspect-ratio: 8 / 15;
        margin: 0 auto;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        grid-template-rows: repeat(5, minmax(0, 1fr));
        gap: 1px;
        padding: 0 2% 4% 2%;
    }

    #container::before {
        content: "";
        display: block;
        width: 100%;
        height: 100%;
        background-color: #5E4A16;
        border-radius: 10px;
        pointer-events: none;
    }

    #container::after {
        content: "";
        display: block;
        width: 100%;
        height: 100%;
        background-color: #5E4A16;
        border-radius: 10px;
        pointer-events: none;
    }

    .card {
        width: 100%;
        height: 100%;
        padding: 0;
    }

    .card .back {
        background-size: 100% 100%;
        background-repeat: no-repeat;
        background-position: center;
    }

    #imgMatchSign {
        width: 90%;
    }
}


/* -----------------------------------------------------------------------------*/
/* TELAS COM ORIENTAÇÃO LANDSCAPE E ALTURA MENOR OU IGUAL A 460PX */

@media screen and (orientation: landscape) and (max-height: 460px) {

    #landscape-warning {
        display: flex !important;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        width: 100vw;
        height: 100vh;
        background-color: rgba(0, 0, 0, 0.95);
        z-index: 10000;
        justify-content: center;
        align-items: center;
        flex-direction: column;
    }

    #landscape-warning-content {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        padding: 30px;
        border-radius: 15px;
        text-align: center;
        color: white;
        max-width: 90%;
        width: fit-content;
        margin: auto;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    }

    #landscape-warning-content h2 {
        margin: 0 0 15px 0;
        font-size: 28px;
        font-weight: bold;
    }

    #landscape-warning-content p {
        margin: 15px 0;
        font-size: 18px;
        line-height: 1.5;
    }

    #rotate-icon {
        font-size: 48px;
        margin-top: 20px;
        animation: rotateAnimation 2s infinite;
    }

    @keyframes rotateAnimation {

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

        50% {
            transform: rotate(90deg);
        }
    }
}