/* ========================================= */
/* IMPORTS E CONFIG GERAIS          */
/* ========================================= */

@import url("https://fonts.googleapis.com/css2?family=Bree+Serif&family=Lobster+Two:ital,wght@0,400;0,700&family=Playfair+Display:wght@700&family=Roboto+Mono:wght@100..700&display=swap");

body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 15px;
    box-sizing: border-box;
    text-align: center;
    overflow-x: hidden;
    background-image: url("../imagens/FUNDO_TELA_MOVE.gif");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    font-family: "Roboto Mono", monospace;
    color: white;
}

/* ========================================= */
/* HEADER E TEXTOS             */
/* ========================================= */

header {
    width: 100%;
    margin-top: -60px;
    margin-bottom: 5px;
    font-family: "Lobster Two", sans-serif;
    font-size: clamp(32px, 5vw, 50px);
    color: rgb(245, 168, 25);
    text-shadow: 10px 8px 1px rgba(10, 10, 0, 0.8);
    transition: all 0.3s ease;
}

header:hover {
    transform: scale(1.05);
    text-shadow: 15px 8px 1px rgba(0, 0, 0, 0.8);
}

h2{
    font-family: "Playfair Display", serif;
    font-size: clamp(20px, 3vw, 24px);
    margin: -30px 30px;
    color: white;
    text-shadow: 1px 2px 3px rgba(0, 0, 0, 0.9);
}

/* OTIMIZAÇÃO 1: Imagem agora responsiva e com tamanho máximo/mínimo */
img{
    width: clamp(100px, 20vw, 150px); /* Reduz em telas menores, mas tem um mínimo de 100px */
    height: auto; /* Mantém a proporção */
    max-width: 150px;
    max-height: 150px;
    border-radius: 20%;
}

/* Estilo base para parágrafos */
p {
    font-size: clamp(16px, 2.5vw, 18px);
    line-height: 1.5;
    text-shadow: 1px 2px 3px rgba(0, 0, 0, 0.9);
    margin: 10px auto;
}

.fontIndex {
    font-family: "Playfair Display", serif;
    font-size: clamp(18px, 3vw, 20px);
    margin: 10px auto;
}

#pergunta {
    max-width:1000px;
    font-family: "Bree Serif", serif;
    font-weight: bold;
    font-size: clamp(24px, 4vw, 30px);
    margin: 20px 0;
    color: white;
    text-shadow: 1px 4px 2px rgba(50, 3, 3, 0.9);
}

/* ========================================= */
/* CAIXAS DE CONTEÚDO PRINCIPAL       */
/* ========================================= */

/* Garante que o container principal ocupe todo o espaço e centralize o conteúdo */
#game-container {
    flex-grow: 1; 
    width: 100%; 
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* OTIMIZAÇÃO 3: Containers principais agora com max-width responsivo e width de 95% para fluidz */
.caixa-principal {
    width: 95%; /* Ajuste: Usa 95% da largura por padrão */
    max-width: 1000px; /* Ajuste: Limite máximo mantido */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    background-color: rgba(0, 255, 255, 0.212);
    box-shadow: 10px 10px 4px rgba(0, 0, 0, 0.693);
    border-radius: 10px;
    text-shadow: 1px 4px 3px rgba(0, 0, 0, 0.9);
    box-sizing: border-box;
}

.orientacaoIndex {
    width: 95%; /* Ajuste: Usa 95% da largura por padrão */
    max-width: 1000px;
    margin-top: 75px;
    min-height: 340px;
    padding: 10px;
    justify-content: center;
    transition: all 0.3s ease;
    background-color: rgba(0, 255, 255, 0.193);
    border-radius: 10px;
}

.orientacaoIndex:hover {
    transform: scale(1);
    box-shadow: 15px 15px 8px rgba(0, 0, 0, 0.693);
    background-color: rgba(64, 206, 3, 0.897);
    color: white;
    text-shadow: 1px 4px 3px rgba(255, 255, 255, 0.9);
}

.orientacao {
    width: 95%; /* Ajuste: Usa 95% da largura por padrão */
    max-width: 880px;
    min-height: 380px;
    margin-top: 10px; /* OTIMIZAÇÃO 2: Removida a margem negativa do estilo base */
}

#alternativas {
    width: 95%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background-color: rgba(0, 255, 255, 0.337);
    padding: 8px;
    box-sizing: border-box;
}

/* ========================================= */
/* BOTÕES E LINKS                 */
/* ========================================= */

/* Estilo base para botões e links que parecem botões */
.button-style {
    display: block;
    width: 95%;
    margin: 10px auto;
    padding: 10px;
    color: aliceblue;
    text-shadow: 1px 4px 2px rgba(0, 0, 0, 1);
    border: none;
    font-size: 20px;
    cursor: pointer;
    border-radius: 8px;
    background-color: transparent;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease-in-out;
    text-decoration: none;
}

.button-style:hover {
    background-color: #1a2fe88b;
    color: white;
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

/* Aplica o estilo base nos botões do quiz */
#alternativas button {
    width: 85%;
    gap:5px;
    display: block;
    margin: 10px auto;
    padding: 10px;
    color: aliceblue;
    text-shadow: 1px 4px 2px rgba(0, 0, 0, 1);
    border: none;
    font-size: 20px;
    cursor: pointer;
    border-radius: 8px;
    background-color: transparent;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease-in-out;
    text-decoration: none;
    font-family: "Bree Serif", serif;
}

/* Estilo específico para o link/botão da página inicial */
#btnIndex {
    display: block;
    width: 95%;
    margin: 10px auto;
    padding: 10px;
    color: orange;
    text-shadow: 1px 4px 2px rgba(0, 0, 0, 1);
    border: none;
    font-size: 25px;
    cursor: pointer;
    border-radius: 8px;
    background-color: transparent;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease-in-out;
    text-decoration: none;
    font-family: "Playfair Display", serif;
    font-weight: bold;
}

/* ========================================= */
/* MODAL                    */
/* ========================================= */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    box-sizing: border-box;
}

.modal-conteudo {
    background-color: white;
    border-radius: 10px;
    box-shadow: 2px 4px 15px rgba(0, 0, 0, 0.2);
    text-align: center;
    width: 90%;
    max-width: 600px;
    padding: 20px;
    color: #333;
}

.modal-conteudo p {
    margin: 2px;
    font-family: "Lobster Two", sans-serif;
    color: #333;
    font-size: clamp(16px, 4vw, 24px);
}

.hidden {
    display: none !important;
}

/* ========================================= */
/* BARRA DE PROGRESSO             */
/* ========================================= */

#progresso-container {
    width: 95%;
    margin-bottom: 5px;
    /* OTIMIZAÇÃO 2: Removida a margem negativa base - será ajustada no mobile */
    margin-top: 10px;
}

#progresso-texto {
    font-weight: bold;
    margin-bottom: 5px;
}

#barra-progresso-container {
    width: 100%;
    height: 8px;
    background-color: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

#barra-progresso {
    height: 100%;
    width: 0%;
    background-color: #4caf50;
    border-radius: 10px;
    transition: width 0.5s ease-in-out;
}

/* ========================================= */
/* RODAPÉ (FOOTER) - NO FLUXO NORMAL (ESTÁTICO) */
/* ========================================= */

footer {
    /* Garante que o footer flua normalmente após o conteúdo principal */
    position: static; 
    margin-top: 40px; 
    margin-bottom: 40px; 
    width: 90%; 
    max-width: 840px;
    height: auto;
    font-family: "Lobster Two", sans-serif;
    align-self: center; 
}

/* Estilo combinado para os créditos */
#credits, #creditsIndex {
    padding: 10px;
    background-color: rgba(0, 255, 255, 0.337);
    box-shadow: 10px 10px 4px rgba(0, 0, 0, 0.693);
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    color: aliceblue;
}

#credits p, #creditsIndex p {
    margin: 4px auto;
    font-family: "Lobster Two", sans-serif;
}


/* ========================================================================================= */
/* RESPONSIVIDADE (TELA MENOR QUE 414PX - CELULARES)                                         */
/* ========================================================================================= */

@media (max-width: 414px) {
    /* CORREÇÃO: Ajusta o header para telas muito pequenas */
    header {
        margin-top: -80px;
        font-size: clamp(28px, 10vw, 40px);
    }

    /* Reduz a margem do subtítulo */
    h2 {
        margin: -10px 10px 10px;
    }

    /* OTIMIZAÇÃO 2: Ajuste da margem do progresso para mobile */
    #progresso-container {
        margin-top: 0; /* Remove a margem superior problemática */
    }

    /* OTIMIZAÇÃO 2: Espaçamento ajustado na orientação do quizz */
    .orientacao {
        margin-top: 10px; /* Garante que o progresso não fique grudado */
        min-height: 300px;
    }

    /* Reduz o tamanho dos containers principais para caber na tela */
    .orientacaoIndex, .orientacao {
        width: 95vw;
        max-width: 95vw;
        min-height: auto;
        padding: 10px;
    }

    /* Reduz o tamanho do texto do corpo */
    p, .fontIndex {
        font-size: clamp(14px, 4vw, 16px);
    }

    /* Reduz o tamanho do texto da pergunta */
    #pergunta {
        font-size: clamp(20px, 6vw, 24px);
        margin: 10px 0;
    }

    /* Reduz o tamanho dos botões de alternativa */
    #alternativas button {
        width: 90%;
        font-size: 16px;
        padding: 8px;
    }

    /* Reposiciona e redimensiona o footer */
    footer {
        margin-top: 20px;
        margin-bottom: 5px;
        width: 95%;
    }

    #credits, #creditsIndex {
        font-size: 12px;
        padding: 5px;
        box-shadow: 5px 5px 2px rgba(0, 0, 0, 0.693);
    }
}

/* ========================================================================================= */
/* RESPONSIVIDADE (AJUSTES DE ZOOM E FLUIDEZ)                                                */
/* Mantido como backup, mas a fluidez já é garantida por unidades relativas e fluxbox.        */
/* ========================================================================================= */

@media (max-width: 600px) and (min-resolution: 1.1dppx), (min-resolution: 1.1dppx) and (max-width: 414px) {
    body {
        padding: 5px;
    }

    .orientacaoIndex, .orientacao {
        padding: 5px;
    }
    
    #alternativas button {
        margin: 5px auto;
        padding: 6px;
    }
}