/*Estilos da página inicial do jogo MathQuest*/
@import url('https://fonts.googleapis.com/css2?family=Bree+Serif&family=Geist+Mono:wght@100..900&family=Lobster+Two:ital,wght@0,400;0,700;1,400;1,700&family=Parisienne&family=Playwrite+HR+Lijeva:wght@100..400&family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700&family=Roboto+Mono:wght@100..900&display=swap');

/* --- Estrutura Base REM e Box Sizing --- */
html {
    /* Define a base para que 1rem = 10px (16px * 62.5% = 10px) */
    font-size: 62.5%;
    box-sizing: border-box;
}

*,
*::before,
*::after {
    box-sizing: inherit;
}

/* --- Estilos :fullscreen --- */
body:fullscreen {
    overflow: auto;
}

/* --- Aviso de Rotação para Telas Pequenas (Retrato) --- */
/* ALTERAÇÃO: Limite ajustado para 767px (76.7rem) */
@media (max-width: 414px) and (orientation: portrait) {
    body::before {
        content: 'Para uma melhor experiência, por favor, gire seu dispositivo para a posição paisagem (landscape).';
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background-color: rgba(0, 0, 0, 0.95);
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        font-size: 1.6rem;
        /* 16px */
        font-family: 'Roboto Mono', sans-serif;
        padding: 1.0rem;
        /* 10px */
        z-index: 10000;
    }

    /* Esconde o conteúdo principal quando o aviso estiver ativo */
    main,
    footer,
    .controles,
    #titulo1,
    #titulo2 {
        display: none !important;
    }
}


body {
    display: flex;
    overflow-x: hidden;
    overflow-y: auto;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    justify-content: center;
    align-items: center;
    text-align: center;
    background-image: url('../imagens/MathQuest.gif');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/*Ajuste de background (consolidado) */
@media (min-width: 0.1rem) {

    /* 1px */
    body {
        background-size: 185% 100%;
    }
}

.controles {
    display: flex;
    position: relative;
    border-radius: 1.0rem;
    /* 10px */
    width: 60rem;
    /* 600px */
    height: 29.0rem;
    /* 120px */
    margin: 1.0rem 10.0rem;
    /* 10px 60px */
    padding: 2.0rem;
    /* 10px 25px */
    border: outset 3px #dfa27c;
    flex-direction: column;
    /* Mantido em px */
    background-color: #dfa27c80;
    box-shadow: 2.0rem 2.0rem 0.8rem rgba(0, 0, 0, 0.9);
    /* 20px 20px 8px */
}

.controles:hover {
    background-color: lightgoldenrodyellow;
    transform: scale(1);
}

.controles:active {
    transform: scale(0.9);
}

.controles button {
    margin: 1.0rem auto;
    /* 15px */
    padding: 1.0rem;
    /* 10px 0 */
    width: 25rem;
    /* 250px */
    height: 4.5rem;
    /* 45px */
    border-radius: 0.8rem;
    /* 8px */
    font-size: 2.2rem;
    /* 22px */
    font-weight: bold;
    border: outset yellow;
    background: linear-gradient(45deg, #b3b7a5 15%, #c9f054 35%, #30382b 75%, #c05d20 4%);
    color: white;
    box-shadow: 1.0rem 1.0rem 0.6rem rgba(0, 0, 0, 0.9);
    /* 10px 10px 6px */
}

.controles button:hover {
    background-color: lightgoldenrodyellow;
    transform: scale(1.1);
}

.controles button:active {
    transform: scale(0.9);
}

#controlesIndex {
    top: -1.0rem;
    /* -10px */
    display: flex;
    flex-direction: column;
    position: relative;
    width: 100%;
    border: none;
    height: 18rem;
    /* 180px */
}

#titulo1 {
    top: 95.0rem;
    justify-content: center;
    font-family: "Lobster Two", sans-serif;
    font-size: 10.0rem;
    color: rgb(243, 13, 13);
    text-shadow: 1.5rem 0.8rem 0.1rem rgba(0, 0, 0, 0.8);
    /* 15px 8px 1px */
}

#titulo1:hover {
    transform: scale(1.3);
    text-shadow: 1.5rem 0.8rem 0.1rem rgba(0, 0, 0, 0.8);
}

#titulo1:active {
    transform: scale(1.1);
}

#titulo2 {
    margin-top: -10.0rem;
    justify-content: center;
    text-shadow: 0.1rem 0.4rem 0.3rem rgba(245, 240, 240, 0.9);
    font-size: 7.0rem;
    font-family: "Parisienne", cursive;
    color: rgb(202, 202, 6);
    font-weight: bold;
}

#titulo2:hover {
    transform: scale(1.3);
    text-shadow: 0.1rem 0.4rem 0.3rem rgba(245, 240, 240, 0.9);
    animation: spin 5s linear infinite;
}

#titulo2:active {
    transform: scale(1.1);
    text-shadow: 0.1rem 0.4rem 0.3rem rgba(245, 240, 240, 0.9);
}

#titulo3 {
    justify-content: center;
    text-shadow: 0.1rem 0.4rem 0.3rem rgba(245, 240, 240, 0.9);
    font-size: 3.2rem;
    font-family: "Parisienne", cursive;
    color: rgb(15, 15, 1);
    font-weight: bold;
}

div {
    align-items: center;
    justify-content: center;
}

main {
    flex: 1;
    align-items: center;
    display: flex;
    justify-content: center;
}

#tbem {
    padding: 0.5rem;
    /* 5px */
    font-size: 3.0rem;
    /* 30px */
    text-align: center;
    color: transparent;
    background-clip: text;
    -webkit-background-clip: text;
    background-color: hsl(34, 53%, 82%);
    background-image: repeating-linear-gradient(45deg, #d7dd60 0%, #e4f52a 20%, #f3a322 30%, #f5511b 40%, #e7b8a5 50%, #3e104c 60%, #83096e 70%, #840b2a 80%, #623c59 90%, #ef0a0a 100%);
    text-shadow: 0.2rem 0.2rem 0.4rem rgba(0, 0, 0, 0.5);
    /* 2px 2px 4px */
}

#tbem:hover {
    transform: scale(1.3);
    text-shadow: 0.4rem 0.2rem 0.3rem rgb(133, 114, 216);
    /* 4px 2px 3px */
    animation: spin 5s linear infinite;
}

#tbem:active {
    transform: scale(1.1);
    text-shadow: 0.1rem 0.4rem 0.3rem rgba(245, 240, 240, 0.9);
    /* 1px 4px 3px */
}

ul,
li {
    text-align: justify;
    font-weight: bold;
    font-size: 2.2rem;
    /* 22px */
    color: #000;
    margin-top: 0.2rem;
    /* 2px */
    margin-bottom: 0.5rem;
    /* 5px */
    margin-left: 5.5rem;
    /* 55px */
    padding: 0.5rem;
    /* 5px */
}

fieldset {
    border-color: #dfa27c;
    margin-top: 2.0rem;
    /* 20px */
    margin-bottom: 0.5rem;
    /* 5px */
}

legend {
    text-shadow: 0.1rem 0.2rem 0.01rem rgba(133, 8, 85, 1);
    /* 1px 2px 0.1px */
    color: rgba(255, 255, 255, 0.8);
    font-size: 2.5rem;
    /* 25px */
    font-weight: bold;
    text-align: center;
    margin: auto;
    padding-bottom: 1.0rem;
    /* 10px */
    border-radius: 1.0rem;
    /* 10px */
    filter: drop-shadow(0.2rem 0.2rem 0.1rem rgba(248, 5, 5, 1));
    /* 2px 2px 1px */
}

legend:hover {
    transform: scale(1.4);
    animation: spin 5s linear infinite;
}

footer {
    align-items: center;
    justify-content: center;
    position: fixed;
    font-size: 2.8rem;
    /* 28px */
    padding: 1.0rem;
    /* 10px */
    bottom: 3.0rem;
    /* 30px */
    text-align: center;
    color: aliceblue;
    font-weight: bold;
    width: 70rem;
    /* 700px */
    text-shadow: 0.3rem 0.4rem 0.1rem rgba(0, 0, 0, 0.8);
    /* 3px 4px 1px */
}

footer:hover {
    transform: scale(1.2);
    text-shadow: 0.1rem 0.4rem 0.3rem rgba(245, 240, 240, 0.9);
    /* 1px 4px 3px */
    animation: spin 5s linear infinite;
}

footer:active {
    transform: scale(0.95);
}

#tela {
    width: 80vw;
    height: auto;
    max-width: 80vh;
    border: 1px solid black;
    /* Mantido em px */
    display: block;
    margin: 0 auto;
}

@keyframes msnP {

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

    50% {
        transform: scale(1.5);
    }
}

.msnP {
    font-size: 4.0rem;
    /* 40px */
    color: green;
    text-align: center;
    animation: msnP 2s infinite;
}


/* --- Media Queries --- */
/*===========================================================*/
/* RESPONSIVIDADE */
/*===========================================================*/

/* Para telas < 414px (celulares em paisagem)*/
@media (max-height: 450px) and (orientation: landscape) {
    #titulo1 {
        margin-top: 10rem;
        font-size: 2.5rem;
        }

    #titulo2 {
        top: 12rem;
        font-size: 1.5rem;
        margin: 1.0rem auto;
    }

    #titulo3 {
            font-size: 1.5rem;
            font-family: "Arial", cursive;
    }

    .controles {
        flex-direction: column;
        max-height: 30%;
        top: -2rem;
        margin: 16rem 0;
        gap: 1rem;
    }

    .controles button {
        width: 60%;
        height: 50%;
        font-size: 1.4rem;
        /* 18px */
    }

    #controlesIndex {
        height: 40rem;
    }

    footer {
        font-size: 1.6rem;
        margin-top: -50.6rem;
    }

    ul,
    li {
        margin-left: 2.0rem;
        /* 20px */
        font-size: 1.6rem;
        /* 16px */
    }
}

/* Para telas < 414px (celulares em paisagem)*/
@media (max-width: 414px) and (orientation: landscape) {
    #titulo1 {
        width: 90vw;
        font-size: 3vw;
        top: 0;
        margin: 1.0rem auto;
        /* 20px */
        height: auto;
    }

    #titulo2 {
        width: 90vw;
        font-size: 2vw;
        top: 0;
        margin: 1.0rem auto;
        /* 10px */
        height: auto;
    }

    .controles {
        width: 90rem;
        flex-direction: column;
        height: 90rem;
        top: 0;
        margin: 1.0rem auto;
        /* 10px */
        padding: 1.0rem;
        /* 10px */
    }

    .controles button {
        width: 80%;
        font-size: 1.8rem;
        /* 18px */
    }

    #controlesIndex {
        height: auto;
    }

    footer {
        width: 90vw;
        position: static;
        font-size: 1.6rem;
        /* 16px */
        margin-top: 2.0rem;
        /* 20px */
    }

    ul,
    li {
        margin-left: 2.0rem;
        /* 20px */
        font-size: 1.6rem;
        /* 16px */
    }
}

/* --- Telas Maiores (Tablet Portrait): 415px (41.5rem) a 780px (78.0rem) --- */
@media (min-width: 415px) and (max-width: 780px){

    body{
        overflow-y: auto;
    }
    #titulo1 {
        font-size: 3.0rem;
        top: 2.0rem;
        margin-bottom: 1rem;
    }

    #titulo2 {
        top: -10.0rem;
        bottom: 0.5rem;
        font-size: 3.0rem;
    }

    .controles {
        top: -15.0rem;
        flex-direction: row;
        width: 40rem;
        height: 12.0rem;
        margin-bottom: 1.0rem;
    }

    .controles button {
        font-size: 1.4rem;
        width: 15rem;
            /* 600px */
        height: 5.0rem;
        /* 20px */
    }

    legend {
        font-size: 1.5rem;
        /* 25px */
    }

    ul,
    li {
        font-size: 2.0rem;
        /* 20px */
    }

    footer {
        top: 32.0rem;
        font-size: 1.8rem;
        /* 18px */
        width: 90%;
        position: fixed;
        margin-bottom: 40rem;
    }
}

/* --- Telas Médias (Tablet Landscape / Laptop Pequeno): 781px (78.1rem) a 1015px (101.5rem) --- */
@media (min-width: 781px) and (max-width: 1015px){
    #titulo1 {
        font-size: 5.0rem;
        /* 60px */
    }

    #titulo2 {
        font-size: 5.0rem;
        /* 50px */
    }

    .controles {
        width: 60rem;
        /* 600px */
        height: 15rem;
        /* 150px */
        padding: 1.0rem 2.5rem;
        /* 10px 25px */
        flex-direction: row;
    }

    .controles button {
        width: 25rem;
        /* 250px */
        height: 4.5rem;
        /* 45px */
        font-size: 2.2rem;
        /* 22px */
    }

    footer {
        font-size: 2.0rem;
        /* 20px */
        width: 70rem;
        /* 700px */
        position: fixed;
        /* Retorna ao footer fixo do desktop */
    }
}

/* --- Telas Grandes (Desktop): 1016px (101.6rem) e maiores --- */
@media (min-width: 1016px) {
    
    .controles {
        margin: 3.0rem 6.0rem;
        /* 10px 60px */
        top: -9.0rem;
        /* -20px */
        width: 60rem;
        /* 600px */
        height: 22rem;
        /* 220px */
    }

    footer {
        font-size: 2.8rem;
        /* 28px */
    }
}