/* =========================================================
   JOGO.CSS — ESTRUTURA DA TELA DE DESAFIO
   ---------------------------------------------------------
   Regra:
   - Base pensada como app vertical.
   - Desktop usa a mesma largura do app.
   - Landscape fica no responsivo.css.
   - Tarefas específicas ficam em jogo-tarefas.css.
   - Pop-ups e Diário ficam em jogo-popups.css.
   - Resultado final fica em jogo-resultado.css.
========================================================= */

/* =========================================================
   TELA DE JOGO — ESTRUTURA GERAL
========================================================= */

#tela-jogo {
    width: 100%;
    max-width: 406px;
    min-height: auto;

    padding: 0;

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;

    z-index: 2;
    text-align: center;

    background: transparent;
    border-radius: 0;
    backdrop-filter: none;

    overflow: visible;
}

/* =========================================================
   TOPO DO DESAFIO
========================================================= */

#topo-desafio {
    width: 100%;
    margin: 0 auto;

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

#topo-desafio .selo-missao,
#progresso-missao {
    padding: 8px 16px;

    border-radius: 999px;
    background: #f7f2ea;
    border: 3px solid #4a90e2;

    box-shadow: 0 4px 0 rgba(74, 144, 226, 0.25);

    font-size: 0.82rem;
    font-weight: 900;
    color: #37527a;
}

#barra-progresso {
    position: relative;

    width: min(340px, 90vw);
    height: 18px;

    border-radius: 999px;
    background: #d8f2ff;
    border: 3px solid #ffffff;

    overflow: visible;

    box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.18);
}

#barra-progresso-fill {
    position: relative;

    width: 0%;
    height: 100%;

    border-radius: 999px;
    background: linear-gradient(90deg, #4aa3df, #7bd8ff);

    transition: width 0.35s ease;
}

#barra-progresso-fill::after {
    content: "";
    position: absolute;
    right: -14px;
    top: 50%;

    width: 30px;
    height: 30px;

    transform: translateY(-58%);

    background-image: url("../assets/tarefas/barco_progresso.png");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;

    filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.25));
}

/* =========================================================
   CARD PRINCIPAL DO DESAFIO
========================================================= */

#corpo-desafio {
    position: relative;

    width: min(370px, 96vw);
    margin: 0 auto;
    padding: 16px 14px 18px;

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;

    background: rgba(255, 250, 239, 0.74);
    border: 3px solid rgba(213, 161, 73, 0.72);
    border-radius: 26px;

    box-shadow:
        0 8px 0 rgba(184, 107, 47, 0.18),
        0 18px 34px rgba(92, 61, 26, 0.14),
        inset 0 0 0 3px rgba(255, 255, 255, 0.42);

    overflow: visible;
}

/* =========================================================
   ÁREA DA TUTORA ESTELA
========================================================= */

#area-personagem {
    position: relative;
    z-index: 3;

    width: 100%;
    min-width: 0;
    margin: 0 auto 10px;

    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
}

#area-tutor-atual {
    width: 42px;
    min-width: 42px;
    height: 42px;
    flex: 0 0 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;

    overflow: visible;
}

#tutor-atual {
    width: 42px;
    height: 42px;

    display: block;

    border-radius: 0;

    object-fit: contain;
    object-position: center;
}

#balao-fala {
    position: relative;

    width: 100%;
    max-width: none;
    min-width: 0;
    min-height: auto;

    padding: 11px 14px;

    border-radius: 16px;
    background: rgba(255, 255, 255, 0.92);
    border: 2px solid rgba(190, 139, 57, 0.7);

    box-shadow:
        0 5px 0 rgba(184, 107, 47, 0.18),
        0 10px 18px rgba(0, 0, 0, 0.08);

    color: var(--ocean-dark);
    text-align: center;
    font-weight: 800;
}

#balao-fala p {
    margin: 0;

    font-size: 0.74rem;
    line-height: 1.22;
    font-weight: 800;

    color: var(--ocean-dark);
}

#balao-fala::after {
    content: "";
    position: absolute;
    left: -8px;
    top: 50%;

    width: 14px;
    height: 14px;

    background: rgba(255, 255, 255, 0.92);
    border-left: 2px solid rgba(190, 139, 57, 0.7);
    border-bottom: 2px solid rgba(190, 139, 57, 0.7);

    transform: translateY(-50%) rotate(45deg);
}

/* =========================================================
   CONTEÚDO MATEMÁTICO
========================================================= */

#desafio-matematico {
    position: relative;
    z-index: 2;

    width: 100%;
    max-width: 100%;
    min-width: 0;

    margin: 0 auto;
    padding: 0;

    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;

    overflow: visible;
}

#pergunta-box h3 {
    max-width: 100%;
    margin: 0 auto 6px;
    padding: 0 4px;

    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    font-size: 0.86rem;
    line-height: 1.3;
    font-weight: 900;

    color: var(--ocean-dark);
    text-align: center;

    overflow-wrap: anywhere;
}

#display-operacao {
    max-width: 100%;
    min-height: auto;

    margin: 4px auto 10px;

    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    font-size: 1.14rem;
    line-height: 1.1;
    font-weight: 900;

    color: #316eb5;
    text-shadow: 1px 1px 0 #ffffff;

    text-align: center;
    overflow-wrap: anywhere;
}

/* =========================================================
   BOTÃO VOLTAR AO MAPA
========================================================= */

#rodape-desafio {
    width: 100%;
    margin-top: 12px;

    display: flex;
    justify-content: center;
    align-items: center;
}

#btn-voltar-mapa-jogo {
    position: relative;
    z-index: 2;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    margin: 0;
    padding: 9px 18px;

    border-radius: 999px;
    border: 3px solid #e67e22;

    background: rgba(255, 253, 248, 0.92);
    color: #c66013;

    font-size: 0.82rem;
    font-weight: 900;

    box-shadow:
        0 5px 0 rgba(185, 85, 14, 0.38),
        0 10px 16px rgba(0, 0, 0, 0.08);

    cursor: pointer;

    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#btn-voltar-mapa-jogo:hover:not(:disabled) {
    transform: translateY(-2px) scale(1.03);
}

#btn-voltar-mapa-jogo:active:not(:disabled) {
    transform: translateY(2px) scale(0.98);
    box-shadow: 0 3px 0 rgba(185, 85, 14, 0.38);
}

#btn-voltar-mapa-jogo .icone-btn-tarefa {
    width: 19px;
    height: 19px;
}