/* --- Reset Básico e Configurações Gerais --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    /* Fundo com a mesma imagem do Ranking */
    background-image: url('../../image/fundo.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed; /* Mantém o fundo fixo ao fazer scroll no telemóvel */
    
    font-family: 'Montserrat', sans-serif;
    color: #FFFFFF;
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* 1. Zera as margens padrão do navegador e garante que o fundo cubra tudo */
html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background-color: #3b2b73; /* Coloque a cor roxa mais escura do seu gradiente aqui como segurança */
}

/* 2. A classe da sua div principal (provavelmente .welcome-mobile ou similar) */
.container-principal { /* Substitua pelo nome da classe dessa sua tela */
    min-height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    
    /* Garante que o fundo não repita e cubra tudo */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    
    /* Remove margens que podem empurrar a caixa para cima */
    margin-bottom: 0; 
}

/* --- Layout Principal --- */
.app-header {
    /* Reduz o respiro no topo para celulares, mas mantém maior no PC */
    padding: clamp(20px, 4vh, 40px) 5vw 10px 5vw; 
    display: flex;
    justify-content: center; /* Garante que a logo fique centralizada */
}

.app-logo {
    /* Tamanho dinâmico: mínimo de 140px, ideal 35% da tela, máximo de 220px */
    width: clamp(140px, 35vw, 220px); 
    height: auto;
}

#app-container {
    flex-grow: 1;
    width: 100%;
    display: flex;
    justify-content: center; 
    padding: 0 5vw 40px 5vw;
}

.content-wrapper {
    padding-top: 200px;
    padding-left: 100px;
    padding-right: 100px;
    width: 100%;
    max-width: 700px; /* Limita a largura do conteúdo para melhor leitura */
}

/* --- Estilos de Texto Comuns --- */
.quiz-title {
    font-size: clamp(2.5rem, 5vw, 3rem);
    font-weight: 700;
    color: #f6a733; /* Amarelo B3 */
    margin-bottom: 25px;
    line-height: 1.2;
}

.quiz-text {
    font-size: clamp(1rem, 5vw, 1.25rem);
    color: #FFFFFF;
    line-height: 1.6;
    max-width: 500px;
}

/* --- Botão Principal --- */
.btn-primary {
    width: 500px;
    display: inline-block;
    background-color: #f6a733;
    color: #00145f;
    font-size: 1.25rem;
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
    padding: 20px 60px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}


/* --- Botão Principal --- */
.btn-primaryinicioquiz {
    width: 500px;
    display: inline-block;
    background-color: #f6a733;
    color: #00145f;
    font-size: 1.25rem;
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
    padding: 20px 60px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    margin-top:50px;
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* --- Tela de Regras --- */
.divider {
    border: none;
    height: 1px;
    background-color: #f6a733; 
    margin: 30px 0;
}

.rule-item {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
}

.rule-icon {
    width: 24px;
    height: auto;
}

/* --- Tela de Cadastro --- */
.form-group {
    position: relative;
    margin-bottom: 35px;
}

.form-input {
    width: 100%;
    background-color: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    color: #FFFFFF;
    font-size: 1.2rem;
    padding: 10px 40px 10px 0;
    outline: none;
    font-family: 'Montserrat', sans-serif; 
}
.form-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}
.form-input:focus {
    border-bottom-color: #f6a733;
}

.form-icon {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
}

#form-error {
    color: #ff8a80;
    margin-bottom: 15px;
    min-height: 20px;
}

/* --- Tela do Quiz --- */
.question-number {
    font-size: clamp(3.5rem, 8vw, 5rem);
    font-weight: 700;
    color: #f6a733;
    margin-bottom: 15px;
}

.question-text {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    font-weight: 400;
    margin-bottom: 50px;
    line-height: 1.4;
    max-width: none; 
}

.options-list {
    list-style: none;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding-bottom: 15px;
    margin-bottom: 15px;
    border-bottom: 1px solid #FFC72C;
    cursor: pointer;
    transition: border-color 0.2s;
}
.option-item:hover {
    border-bottom-color: #FFC72C;
}
.option-item.disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.option-letter {
    border: 1px solid #FFC72C;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-weight: bold;
    color: #FFC72C;
}

.option-text {
    font-size: 1.1rem;
    line-height: 1.5;
}

/* Feedback visual para respostas (ATUALIZADO) */

/* --- Resposta CORRETA (Tudo Laranja) --- */
.option-item.correct .option-letter,
.option-item.correct .option-text {
    color: #FFC72C; 
}
.option-item.correct .option-letter {
    border-color: #FFC72C; 
}
.option-item.correct {
    border-bottom-color: rgba(255, 199, 44, 0.5); 
}
.option-item.correct:hover {
    border-bottom-color: rgba(255, 199, 44, 0.5);
}

/* --- Respostas ERRADAS (Tudo Cinza) --- */
.option-item.faded-out .option-letter,
.option-item.faded-out .option-text {
    color: #888; 
}
.option-item.faded-out .option-letter {
    border-color: #888; 
}
.option-item.faded-out {
    border-bottom-color: rgba(136, 136, 136, 0.3); 
    opacity: 1; 
}
.option-item.faded-out:hover {
    border-bottom-color: rgba(136, 136, 136, 0.3);
}

/* --- Tela de Resposta (Explicação) --- */
.explanation-box {
    margin-top: 40px;
    font-size: 1.1rem;
    line-height: 1.6;
    color: #FFC72C;
}

/* --- Botão de Tela Cheia (Restaurado) --- */
#fullscreen-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background-color: rgba(255, 255, 255, .7);
    border: 1px solid rgba(0, 0, 0, .1);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    transition: transform .2s;
}

#fullscreen-btn:hover {
    transform: scale(1.1);
}

#fullscreen-btn svg {
    width: 24px;
    height: 24px;
    color: #2c3e50;
}

#icon-exit-fs {
    display: none;
}

/* --- Estilos do Timer do Quiz --- */
.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 15px;
}

.question-number {
    margin-bottom: 0;
}

.quiz-timer {
    font-size: 1.75rem;
    font-weight: 700;
    color: #FFC72C; 
}

.quiz-titleranking {
    font-size: clamp(2.5rem, 5vw, 3rem);
    font-weight: 700;
    color: #f6a733; 
    margin-bottom: 25px;
    line-height: 1.2;
}

/* ================================================================== */
/* --- INÍCIO: ESTILOS COMPLETOS DO RANKING (USUÁRIO + ADMIN) --- */
/* ================================================================== */

/* --- PARTE 1: CSS DO RANKING DO USUÁRIO (O PADRÃO) --- */

.ranking-header {
    display: none;
}

.ranking-list {
    position: relative;
    border-left: none;
}

.ranking-list::before,
.ranking-list::after {
    display: none;
}

.ranking-trophy {
    display: none;
}

.ranking-item {
    display: grid;
    grid-template-columns: 1fr 90px 100px; 
    gap: 15px;
    align-items: center;
    padding: 14px 0;
    font-size: 1.1rem;
    position: relative; 
    background-color: transparent; 
    border-radius: 0;
    margin-bottom: 0;
}

.ranking-position {
    position: absolute;
    left: -75px; 
    top: 50%;
    transform: translateY(-50%);
    font-weight: 700;
    font-size: 1.1rem;
    width: 50px;
    text-align: center;
    color: #f6a733; 
    display: block;
}

.ranking-name {
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 0;
}

.ranking-email {
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 0;
}

.ranking-score {
    display: block;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
    text-align: right;
    white-space: nowrap;
}

.ranking-time {
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
    text-align: right;
}

.ranking-item.current-user {
    background-color: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    padding: 14px 15px;
    margin-left: -15px;
}
.ranking-item.current-user .ranking-position {
    left: -55px;
}

.ranking-empty {
    padding: 40px;
    text-align: center;
    opacity: 0.7;
}

.ranking-footer {
    text-align: center;
    margin-top: 40px;
}


/* --- PARTE 2: OVERRIDE DO RANKING ADMIN --- */

.ranking-list.admin-list {
    padding-left: 0;
    padding-top: 0;
    background-image: none; 
}

.ranking-header.admin-header {
    display: grid;
    grid-template-columns: 50px 1.5fr 2fr 90px 100px;
    gap: 15px;
    padding: 0 15px;
    color: #f6a733;
    font-size: 0.8rem;
    text-transform: uppercase;
    margin-bottom: 10px;
    opacity: 0.7;
}
.ranking-header.admin-header span:nth-child(n+4) { text-align: right; }
.ranking-header.admin-header .email-header { text-align: left; }

.ranking-item.admin-item {
    grid-template-columns: 50px 300px 130px 10px 50px; 
    gap: 15px;
    align-items: center;
    font-size: 1.1rem;
    position: relative;
    border-radius: 8px;
}

.ranking-item.admin-item .ranking-position {
    position: static; 
    transform: none;
    width: auto;
    text-align: left;
    color: #f6a733;
}

.ranking-item.admin-item .ranking-email {
    display: block;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}

.ranking-item.admin-item .ranking-score,
.ranking-item.admin-item .ranking-time {
    text-align: right;
}

.rankingadmin-name {
    font-weight: 700; 
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rankingadmin-email {
    font-weight: 400; 
    font-size: 0.95rem; 
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left; 
    padding-right: 0;
}

.rankingadmin-score {
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
    text-align: right;
    white-space: nowrap;
}

.rankingadmin-time {
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
    text-align: right;
}

.rankingadmin2-list {
    position: relative;
    padding-left: 28px; 
    padding-top: 65px; 
    border-left: none;
    background-image: url('../../image/candle-com-trofeu.png');
    background-repeat: no-repeat;
    background-size: 60px auto; 
    background-position: 0 0; 
}

.contentadmin-wrapper {
    width: 100%;
    max-width: 700px; 
}

.quizadmin-titleranking {
    font-size: clamp(2.5rem, 5vw, 3rem);
    font-weight: 700;
    color: #f6a733; 
    margin-bottom: 25px;
    line-height: 1.2;
    text-align: center;
}

#login-container {
    max-width: 500px; 
    margin: 0 auto;
}

#login-error {
    color: #f6a733; 
    margin-bottom: 15px;
    min-height: 20px;
    font-weight: bold;
}

/* ================================================================== */
/* --- FIM: ESTILOS COMPLETOS DO RANKING --- */
/* ================================================================== */


/* ================================================================== */
/* --- ESTILOS DA NOVA TELA DE BOAS VINDAS (MOBILE) TURBINADOS --- */
/* ================================================================== */

.welcome-mobile {
    padding: clamp(2vh, 4vh, 40px) 20px !important; 
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly; 
    min-height: 100vh; 
    max-width: 550px; 
    margin: 0 auto;
}

/* Bloco 1: Header do Escudo */
.welcome-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(15px, 4vw, 25px);
    margin-bottom: clamp(20px, 4vh, 40px);
    width: 100%;
}
.welcome-shield {
    width: clamp(100px, 28vw, 150px); 
    height: auto;
}
.welcome-header-text {
    display: flex;
    flex-direction: column;
    font-family: 'Montserrat', sans-serif;
    line-height: 1.1;
    text-align: left;
}
.welcome-header-text .text-white {
    color: #ffffff;
    font-weight: 900;
    font-size: clamp(1.2rem, 5vw, 1.8rem); 
}
.welcome-header-text .text-pink {
    color: #e39bc0; 
    font-weight: 900;
    font-size: clamp(1.2rem, 5vw, 1.8rem); 
    margin-top: 5px;
    margin-bottom: 8px;
}
.welcome-header-text .text-small {
    color: #ffffff;
    font-weight: 900;
    font-size: clamp(1rem, 3.5vw, 1.2rem);
}
.welcome-header-text .text-small small {
    font-weight: 400;
    font-size: clamp(0.8rem, 3vw, 1rem);
    display: block;
}

/* Bloco 2: Regras */
.welcome-rules {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: clamp(20px, 4vh, 40px);
}
.rule-row {
    display: flex;
    align-items: center;
    gap: 20px;
    width: 100%;
    max-width: 450px; 
}
.rule-icon-small {
    width: clamp(55px, 15vw, 80px); 
    height: auto;
    flex-shrink: 0;
}
.rule-row p {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: clamp(1rem, 4.5vw, 1.3rem); 
    margin: 0;
    line-height: 1.3;
    text-align: left;
}
.rule-row p.text-orange { color: #f6a733; }
.rule-row p.text-white { color: #ffffff; }

.rule-separator {
    color: #f6a733;
    font-size: clamp(1.5rem, 5vw, 2rem);
    letter-spacing: 5px;
    margin: clamp(10px, 2vh, 20px) 0;
}

/* Bloco 3: Prêmios */
.welcome-prizes {
    text-align: center;
    width: 100%;
}
.prize-title {
    color: #ffffff;
    font-size: clamp(1.2rem, 5vw, 1.6rem); 
    font-weight: 400;
    margin-bottom: 15px;
    line-height: 1.3;
}
.prize-title .text-orange {
    color: #f6a733;
    font-weight: 800;
}
.prize-img {
    width: 100%;
    max-width: 420px; 
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Ajuste no botão de iniciar para ficar responsivo */
.btn-primaryinicioquiz {
    width: 100%;
    max-width: 420px;
    font-size: clamp(1.2rem, 5vw, 1.5rem);
    padding: 15px 20px;
}

/* ================================================================== */
/* --- IMPORTAÇÃO DE FONTES LOCAIS (MONTSERRAT) --- */
/* ================================================================== */

@font-face {
    font-family: 'Montserrat';
    src: url('../fonts/montserrat-thin.ttf') format('truetype');
    font-weight: 100;
    font-style: normal;
}

@font-face {
    font-family: 'Montserrat';
    src: url('../fonts/Montserrat-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Montserrat';
    src: url('../fonts/montserrat-italic.ttf') format('truetype');
    font-weight: 400;
    font-style: italic;
}

@font-face {
    font-family: 'Montserrat';
    src: url('../fonts/montserrat-semi-bold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
}

@font-face {
    font-family: 'Montserrat';
    src: url('../fonts/Montserrat-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}

@font-face {
    font-family: 'Montserrat';
    src: url('../fonts/montserrat-bold-italic.ttf') format('truetype');
    font-weight: 700;
    font-style: italic;
}