/* =========================================================
   JOGO-TAREFAS.CSS — PALCOS, CONTROLES E EXERCÍCIOS
   ---------------------------------------------------------
   Aqui ficam:
   - palco base;
   - controles;
   - teclado numérico;
   - exercícios específicos;
   - tarefas com arte própria.
========================================================= */

/* =========================================================
   PALCO BASE DOS EXERCÍCIOS
========================================================= */

#palco-objetos {
    width: 100%;
    max-width: 100%;
    min-height: 92px;

    margin: 8px auto 12px;
    padding: 10px;

    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;

    overflow: visible;

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

/*
   Apenas quem tiver .palco-padrao recebe
   o visual tracejado padrão.
*/
#palco-objetos.palco-padrao {
    border-radius: 18px;
    background: rgba(255, 248, 235, 0.24);
    border: 3px dashed #e0a13a;
}

/* =========================================================
   OBJETOS CLICÁVEIS — CONTAGEM
========================================================= */

.objeto-clicavel-contagem {
    position: relative;

    width: 56px;
    height: 56px;
    padding: 0;

    display: grid;
    place-items: center;

    border-radius: 14px;
    background: rgba(255, 255, 255, 0.78);

    box-shadow:
        0 5px 0 rgba(184, 107, 47, 0.38),
        0 9px 16px rgba(0, 0, 0, 0.10);

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

.objeto-clicavel-contagem img,
.objeto-clicavel-contagem .objeto-img {
    width: 38px;
    height: 38px;

    display: block;

    object-fit: contain;
}

.objeto-clicavel-contagem .objeto-emoji {
    display: block;

    font-size: 2rem;
    line-height: 1;
}

.objeto-numero-contagem {
    position: absolute;
    top: -8px;
    right: -6px;

    min-width: 22px;
    height: 22px;

    display: grid;
    place-items: center;

    border-radius: 50%;
    background: #2fb45a;
    color: #ffffff;

    font-size: 0.72rem;
    line-height: 1;
    font-weight: 900;

    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.18);

    opacity: 0;
    transform: scale(0.6);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.objeto-clicavel-contagem.contado {
    background: #e9ffe9;
    transform: scale(0.96);
}

.objeto-clicavel-contagem.contado .objeto-numero-contagem {
    opacity: 1;
    transform: scale(1);
}

/* =========================================================
   CONTROLES DO DESAFIO
========================================================= */

#teclado-numerico,
.controles-desafio {
    width: 100%;

    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;

    margin-top: 0;
}

.controles-desafio .contador-exercicio {
    flex: 0 0 100%;
}

.contador-exercicio {
    width: min(320px, 94%);
    margin: 0 auto 10px;
    padding: 7px 12px;

    text-align: center;

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

    color: var(--ocean-dark);
    background: rgba(255, 255, 255, 0.84);
    border: 2px solid rgba(74, 144, 226, 0.72);
    border-radius: 999px;
}

.btn-controle-desafio {
    min-height: 40px;

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

    padding: 10px 20px;

    border-radius: 999px;

    background: linear-gradient(180deg, #4aa3ff, #1f74d2);
    color: #ffffff;

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

    box-shadow:
        0 6px 0 #15549b,
        0 10px 16px rgba(0, 0, 0, 0.18);

    cursor: pointer;
}

.icone-btn-tarefa {
    width: 20px;
    height: 20px;

    display: inline-block;
    flex-shrink: 0;

    object-fit: contain;
}

/* =========================================================
   TECLADO NUMÉRICO
========================================================= */

.btn-numero {
    width: 58px;
    height: 58px;
    padding: 0;

    border-radius: 18px;

    background: var(--primary-blue);
    color: #ffffff;

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

    box-shadow: 0 6px 0 var(--primary-blue-dark);
}

.btn-numero.resposta-certa {
    background: var(--green);
    box-shadow: 0 6px 0 var(--green-dark);
}

.btn-numero.resposta-errada {
    background: var(--danger);
    box-shadow: 0 6px 0 #81261d;
    animation: tremer 0.28s ease;
}

/* =========================================================
   EXERCÍCIOS GENÉRICOS
========================================================= */

.objeto-matematico {
    font-size: 2rem;
    animation: aparecer 0.25s ease both;
}

.objeto-estimativa {
    font-size: 1.8rem;
    animation: aparecer 0.25s ease both;
}

.bolha-numero {
    width: 62px;
    height: 62px;
    padding: 0;

    border-radius: 50%;

    background: radial-gradient(circle at 30% 25%, #ffffff, #8bdcff);
    color: var(--ocean-dark);

    font-size: 1.25rem;
    font-weight: 800;

    box-shadow: 0 6px 0 #3c8fc0;
}

.bolha-correta {
    background: radial-gradient(circle at 30% 25%, #ffffff, #8cffaa);
    box-shadow: 0 6px 0 var(--green-dark);
}

.bolha-errada {
    background: radial-gradient(circle at 30% 25%, #ffffff, #ff9a8b);
    box-shadow: 0 6px 0 #81261d;
}

.reta-numerica {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.ponto-reta {
    width: 52px;
    height: 52px;
    padding: 0;

    border-radius: 50%;
    background: #ffffff;
    color: var(--ocean-dark);
    border: 3px solid var(--primary-blue);

    font-size: 1rem;
    font-weight: 800;

    box-shadow: 0 5px 0 var(--primary-blue-dark);
}

.ponto-inicial {
    background: #fff7df;
    border-color: var(--orange);
}

.ponto-reta.selecionado {
    background: var(--green);
    color: #ffffff;
    border-color: var(--green-dark);
}

/* =========================================================
   AVISOS E FEEDBACK
========================================================= */

.aviso-exercicio {
    padding: 18px;

    border-radius: 18px;
    background: rgba(255, 255, 255, 0.82);

    font-weight: 700;
    color: var(--ocean-dark);
}

#palco-objetos button:disabled,
#teclado-numerico button:disabled {
    cursor: not-allowed;
}

.objeto-destaque {
    transform: scale(1.35);
    filter: drop-shadow(0 0 10px var(--sand-color));
    transition: transform 0.2s ease, filter 0.2s ease;
}

.objeto-ajuda {
    animation: ajudaPulso 0.65s ease both;
    filter:
        drop-shadow(0 0 10px rgba(255, 204, 77, 0.95)) drop-shadow(0 0 18px rgba(255, 204, 77, 0.65));
}

@keyframes ajudaPulso {
    0% {
        transform: scale(1);
    }

    45% {
        transform: scale(1.18);
    }

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

/* =========================================================
   OPÇÕES DE RESPOSTA E ÁREA VISUAL COMPARTILHADA
========================================================= */

#teclado-numerico.opcoes-resposta {
    width: min(100%, 320px);
    margin: 14px auto 18px;
    display: grid;
    gap: 10px;
}

.opcoes-curtas {
    grid-template-columns: repeat(4, 1fr);
}

.opcoes-longas {
    grid-template-columns: 1fr;
}

#teclado-numerico.opcoes-resposta.opcoes-longas {
    width: min(100%, 320px);
    margin: 12px auto 24px;
    gap: 8px;
}

.opcoes-resposta button {
    min-height: 54px;
    padding: 8px 10px;
    border-radius: 14px;
    white-space: normal;
    overflow-wrap: break-word;
    line-height: 1.1;
    text-align: center;
}

.opcoes-resposta.opcoes-longas button,
.opcoes-resposta.opcoes-longas .btn-opcao,
.opcoes-resposta.opcoes-longas .btn-numero {
    width: 100%;
    min-height: 48px;
    height: auto;
    padding: 8px 12px;
    border-radius: 14px;
    font-size: 0.82rem;
    line-height: 1.15;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
    text-align: center;
}

.area-visual-tarefa {
    width: min(100%, 320px);
    min-height: 140px;
    margin: 10px auto 12px;
    padding: 0;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

.area-visual-tarefa img,
.img-visual-tarefa {
    width: 100%;
    max-width: 320px;
    max-height: 180px;
    height: auto;
    display: block;
    object-fit: contain;
    border-radius: 18px;
}

.visual-conceito {
    font-weight: 900;
    color: #1b5fae;
    font-size: 1.02rem;
    line-height: 1.25;
}

#btn-voltar-mapa-jogo {
    margin-top: 10px;
}

@media (max-width: 380px) {
    .opcoes-curtas {
        grid-template-columns: repeat(2, 1fr);
    }

    .opcoes-resposta button {
        min-height: 50px;
        font-size: 0.88rem;
    }
}

.opcao-resposta {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
}

.opcao-letra {
    min-width: 24px;
    font-weight: 900;
    font-size: 0.88rem;
    color: #fff7db;
}

.opcao-texto {
    flex: 1;
    text-align: left;
}