
/* ============================================
   GLUB — ATIVIDADE 3
   Cenário e posicionamento inicial do jogador
   ============================================ */

#tarefa3-tela {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: none;
  z-index: 180;
  background: #102b30;
}
/* =====================================================
   GLUB — ATIVIDADE 3
   IMAGEM DE FUNDO ORIGINAL
   ===================================================== */

#tarefa3-tela .tarefa3-fundo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: fill;
    z-index: 1;
    display: block;
    pointer-events: none;
}
#tarefa3-tela .tarefa3-avatar {
  position: absolute;

  /* POSIÇÃO INICIAL DO AVATAR */
  left: 5.859375%;
  top: 68.055556%;

  width: var(--glub-avatar-largura,12.8125%);
  height: var(--glub-avatar-altura,22.7777778%);

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

  visibility: visible;
  opacity: 1;
  z-index: 30;

  pointer-events: none;
   /* AJUSTE VISUAL DO POUSO */
  transform: translateY(8px);
}

#tarefa3-tela .tarefa3-avatar-imagem {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* GLUB — ATIVIDADE 3
   Evitar bloqueio dos controles globais */

#tarefa3-tela {
  pointer-events: none;
}

#tarefa3-tela .tarefa3-avatar,
#tarefa3-tela .tarefa3-fundo {
  pointer-events: none;
}

/* Elementos do cenário sobre o fundo, abaixo do avatar e HUD. */
#tarefa3-tela .tarefa3-decoracao {position:absolute;z-index:4;object-fit:fill;pointer-events:none;user-select:none}
#tarefa3-tela .tarefa3-avatar {z-index:30}

/* Plataformas e objetos escalados com o cenário 1280 × 720. */
#tarefa3-tela .at3-plataforma{object-fit:fill;filter:drop-shadow(0 7px 4px rgba(0,0,0,.35))}
#tarefa3-tela .at3-grama-plataforma{object-fit:fill}

#tarefa3-tela {background:linear-gradient(#102b30,#153d40 55%,#092035)}
#tarefa3-tela .tarefa3-fundo{position:absolute;inset:0;z-index:1;background:radial-gradient(ellipse at 35% 40%,#31534880,transparent 55%)}
#tarefa3-tela .at3-trio-silabas{position:absolute;left:41.5%;top:18%;width:26%;height:13%;display:flex;justify-content:space-between;z-index:25;pointer-events:none}
#tarefa3-tela .at3-trio-silabas img{width:30%;height:100%;object-fit:contain;animation:at3-flutuar 2.6s ease-in-out infinite alternate}
@keyframes at3-flutuar{to{transform:translateY(-9px)}}

/* Desafio de formação silábica — acima do cenário e abaixo do HUD */
#tarefa3-tela .at3-desafio{position:absolute;left:24%;top:15%;width:52%;z-index:45;pointer-events:none;text-align:center}
#tarefa3-tela .at3-palavra-fragmentos,#tarefa3-tela .at3-opcoes{display:flex;align-items:center;justify-content:center;gap:12px;min-height:76px}
#tarefa3-tela .at3-opcoes{margin-top:12px;gap:28px;pointer-events:auto}
#tarefa3-tela .at3-bloco{width:90px;height:73px;display:flex;align-items:center;justify-content:center;font-size:29px;font-weight:900;color:#20150b}
#tarefa3-tela .at3-bloco img{width:100%;height:100%;object-fit:contain}
#tarefa3-tela .at3-bloco-texto{background:#f2d89a;border:5px ridge #9c672f;border-radius:14px}
#tarefa3-tela .at3-opcao{border:0;background:transparent;padding:0;cursor:pointer;animation:at3-flutuar 2.6s ease-in-out infinite alternate}
#tarefa3-tela .at3-opcao:nth-child(2){animation-delay:.6s}
#tarefa3-tela .at3-opcao:nth-child(3){animation-delay:1.2s}
#tarefa3-tela .at3-opcao:focus-visible{outline:4px solid yellow}
#tarefa3-tela .at3-incorreto{outline:none!important;border:0!important;box-shadow:none!important;border-radius:0}
#tarefa3-tela .at3-palavra-completa{max-width:80%;height:78px;object-fit:contain}
#tarefa3-tela .at3-resultado{color:white;font-weight:bold;text-shadow:0 2px 4px #000}

/* GLUB — Atividade 3: blocos maiores */

#tarefa3-tela .at3-bloco {
  width: 105px;
  height: 105px;
  flex-shrink: 0;
}

#tarefa3-tela .at3-bloco img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#tarefa3-tela .at3-opcao {
  width: 115px;
  height: 115px;
  padding: 0;
}
/* Figura da palavra concluída: canto inferior esquerdo, independente do desafio central. */
#tarefa3-tela .at3-figura-inferior-esquerda{position:absolute;left:19%;bottom:10%;width:145px;height:115px;max-width:none;object-fit:contain;z-index:42;pointer-events:none;filter:drop-shadow(0 4px 5px rgba(0,0,0,.55));}

#tarefa3-tela .at3-figura-inferior-esquerda{left:19%;bottom:11%;width:150px;height:150px;z-index:42;display:block;visibility:visible;opacity:1;}

/* AT3: garantir que os blocos e alternativas recebam cliques e fiquem visíveis. */
#tarefa3-tela .at3-desafio{display:block!important;visibility:visible!important;opacity:1!important;z-index:65}
#tarefa3-tela .at3-opcoes,#tarefa3-tela .at3-opcao{pointer-events:auto!important}

/* ATIVIDADE 3 — disposição original Construct 3, sem afetar outras telas. */
#tarefa3-tela .at3-desafio{
  left:32%;top:13%;width:38%;z-index:65;
}
#tarefa3-tela .at3-opcoes{
  position:absolute;top:0;left:0;width:100%;margin-top:0;
  display:flex;justify-content:center;gap:13px;pointer-events:auto;
}
#tarefa3-tela .at3-palavra-fragmentos{
  position:absolute;top:133px;left:0;width:100%;
  display:flex;justify-content:center;gap:10px;
}
#tarefa3-tela .at3-opcao,#tarefa3-tela .at3-bloco{width:82px;height:82px}
#tarefa3-tela .at3-figuras-trio{
  position:absolute;left:18%;bottom:12%;width:25%;height:12%;
  display:flex;align-items:end;justify-content:center;gap:5px;
  z-index:36;pointer-events:none;
}
#tarefa3-tela .at3-figuras-trio img{
  width:32%;height:100%;object-fit:contain;filter:drop-shadow(0 3px 3px #0007);
}
#tarefa3-tela .at3-palavras-acumuladas{
  position:absolute;left:73%;top:31%;width:19%;height:29%;
  display:flex;flex-direction:column;justify-content:flex-start;align-items:center;
  gap:9px;z-index:39;pointer-events:none;
}
#tarefa3-tela .at3-palavras-acumuladas img{
  display:block;max-width:100%;width:100%;height:27%;object-fit:contain;
  filter:drop-shadow(0 3px 4px #0008);
}

/* AT3: figuras agrupadas como na referência: uma acima e duas abaixo. */
#tarefa3-tela .at3-figuras-trio{left:18%;bottom:12%;width:11%;height:20%;display:grid;grid-template-columns:repeat(2,1fr);grid-template-rows:repeat(2,1fr);gap:2px;align-items:center;justify-items:center;z-index:41}
#tarefa3-tela .at3-figuras-trio img{width:100%;height:100%;max-width:100%;object-fit:contain}
#tarefa3-tela .at3-figuras-trio img:first-child{grid-column:1 / 3;width:52%;height:100%}
#tarefa3-tela .at3-siri-lancador{position:absolute;left:18%;bottom:35%;width:95px;height:95px;object-fit:contain;z-index:40;pointer-events:none;transform:rotate(-90deg);filter:drop-shadow(0 4px 4px #0008)}
#tarefa3-tela .at3-siri-projetil{position:absolute;width:75px;height:75px;object-fit:contain;z-index:64;pointer-events:none}

/* AT3: Siri junto à placa GLUB, garras na horizontal, dispara só blocos da palavra. */
#tarefa3-tela .at3-siri-lancador{
  left:19%;top:26%;bottom:auto;width:94px;height:94px;
  transform:none;z-index:46;
}
/* Formação à direita; trio de escolhas surge no centro para colisão com o avatar. */
#tarefa3-tela .at3-desafio{left:0;top:0;width:100%;height:100%;pointer-events:none;z-index:65}
#tarefa3-tela .at3-palavra-fragmentos{
  position:absolute;left:66%;top:23%;width:31%;
  display:flex;justify-content:center;gap:8px;
}
#tarefa3-tela .at3-opcoes{
  position:absolute;left:34%;top:39%;width:33%;
  display:flex;justify-content:center;gap:12px;pointer-events:none;
}
#tarefa3-tela .at3-opcao{pointer-events:none!important;cursor:default}

/* GLUB — AT3: distribuição do esboço aprovado (somente esta atividade).
   Siri ao lado do letreiro; alternativas na plataforma superior direita;
   formação no centro; figuras em pirâmide embaixo à esquerda;
   três palavras concluídas junto à cachoeira. */
#tarefa3-tela .at3-siri-lancador{
 left:19%;top:20%;bottom:auto;width:96px;height:96px;
 transform:none;z-index:46;
}
#tarefa3-tela .at3-desafio{
 position:absolute;inset:0;width:100%;height:100%;z-index:65;
 pointer-events:none;
}
#tarefa3-tela .at3-opcoes{
 position:absolute;left:68%;top:16%;width:30%;height:13%;
 display:flex;align-items:center;justify-content:center;gap:7px;
 margin:0;pointer-events:none;
}
#tarefa3-tela .at3-palavra-fragmentos{
 position:absolute;left:38%;top:42%;width:35%;height:14%;
 display:flex;align-items:center;justify-content:center;gap:9px;
}
#tarefa3-tela .at3-opcao,#tarefa3-tela .at3-bloco{
 width:82px;height:82px;flex-shrink:0;
}
#tarefa3-tela .at3-figuras-trio{
 position:absolute;left:13%;bottom:9%;width:17%;height:23%;
 display:grid;grid-template-columns:repeat(2,minmax(0,1fr));
 grid-template-rows:repeat(2,minmax(0,1fr));
 align-items:center;justify-items:center;gap:3px;
 z-index:41;pointer-events:none;
}
#tarefa3-tela .at3-figuras-trio img{
 width:100%;height:100%;max-width:100%;object-fit:contain;
}
#tarefa3-tela .at3-figuras-trio img:first-child{
 grid-column:1 / 3;width:49%;height:100%;
}
#tarefa3-tela .at3-palavras-acumuladas{
 position:absolute;left:77%;top:53%;width:16%;height:32%;
 display:flex;flex-direction:column;align-items:center;
 justify-content:flex-start;gap:6px;
 z-index:39;pointer-events:none;
}
#tarefa3-tela .at3-palavras-acumuladas img{
 display:block;width:100%;max-width:100%;height:30%;
 object-fit:contain;
}

/* AT3 — posições finais: alternativas centrais e formação à direita. */
#tarefa3-tela .at3-desafio{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:65}
#tarefa3-tela .at3-opcoes{position:absolute;left:35%;top:39%;width:34%;height:14%;margin:0;display:flex;align-items:center;justify-content:center;gap:12px;pointer-events:none}
#tarefa3-tela .at3-palavra-fragmentos{position:absolute;left:68%;top:19%;width:30%;height:14%;display:flex;align-items:center;justify-content:center;gap:8px}
#tarefa3-tela .at3-siri-lancador{left:22%;top:19%;bottom:auto;width:96px;height:96px;transform:none;z-index:46}
#tarefa3-tela .at3-opcao{pointer-events:none!important}

/* =====================================================
   GLUB — ATIVIDADE 3
   BLOCOS SILÁBICOS MAIORES — 150px
   ===================================================== */

/* Blocos da palavra: A, BE e bloco vazio */
#tarefa3-tela .at3-palavra-fragmentos .at3-bloco {
    width: 150px;
    height: 150px;
    flex-shrink: 0;
}

/* Alternativas: LHA, LA e LO */
#tarefa3-tela .at3-opcoes .at3-opcao {
    width: 150px;
    height: 150px;
    flex-shrink: 0;
    padding: 0;
}

/* Blocos internos das alternativas */
#tarefa3-tela .at3-opcoes .at3-bloco {
    width: 100%;
    height: 100%;
}

/* Imagens dos blocos */
#tarefa3-tela .at3-bloco img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Ampliar as áreas para acomodar os blocos */
#tarefa3-tela .at3-opcoes {
    width: 42%;
    gap: 10px;
}

#tarefa3-tela .at3-palavra-fragmentos {
    width: 34%;
    gap: 6px;
}

/* ATIVIDADE 3 — Trio de sílabas centralizado */

#tarefa3-tela .at3-opcoes {
    left: 32%;
    top: 39%;
    width: 38%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
/* =====================================================
   GLUB — ATIVIDADE 3
   FLUTUAÇÃO SUAVE DE TODOS OS BLOCOS SILÁBICOS
   ===================================================== */

@keyframes at3-flutuacao-suave {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-12px);
    }
}

/* Blocos lançados pelo Siri */
#tarefa3-tela .at3-palavra-fragmentos .at3-bloco {
    animation: at3-flutuacao-suave 3s ease-in-out infinite;
}

/* Movimento alternado dos blocos lançados */
#tarefa3-tela .at3-palavra-fragmentos .at3-bloco:nth-child(2) {
    animation-delay: -1s;
}

#tarefa3-tela .at3-palavra-fragmentos .at3-bloco:nth-child(3) {
    animation-delay: -2s;
}

/* Alternativas de sílabas: LHA, LA e LO */
#tarefa3-tela .at3-opcoes .at3-opcao {
    animation: at3-flutuacao-suave 3s ease-in-out infinite;
}

#tarefa3-tela .at3-opcoes .at3-opcao:nth-child(2) {
    animation-delay: -1s;
}

#tarefa3-tela .at3-opcoes .at3-opcao:nth-child(3) {
    animation-delay: -2s;
}
/* GLUB — ATIVIDADE 3
   Ordem de escrita: esquerda para direita */

#tarefa3-tela .at3-palavra-fragmentos {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: flex-start;
    direction: ltr;
    gap: 10px;
}

#tarefa3-tela .at3-palavra-fragmentos .at3-bloco {
    order: 0;
    flex-shrink: 0;
}
/* AT3 — Apenas as alternativas centrais recebem mouse/clique. */
#tarefa3-tela .at3-opcoes { pointer-events: auto !important; }
#tarefa3-tela .at3-opcoes .at3-opcao { pointer-events: auto !important; cursor: pointer !important; }
#tarefa3-tela .at3-opcoes .at3-opcao:hover { filter: brightness(1.2) drop-shadow(0 0 9px #ffe17a); }
#tarefa3-tela .at3-palavra-fragmentos { pointer-events: none !important; }

/* AT3 — Vagalumes do cenário: vídeo transparente, sem bloquear o jogador. */
#tarefa3-tela .at3-vagalumes {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: fill;
    z-index: 18;
    opacity: .85;
    pointer-events: none;
    user-select: none;
}

/* AT3 — palavras completas, coluna vertical à esquerda da cachoeira. */
#tarefa3-tela .at3-palavras-acumuladas{
  left:76%;top:49%;width:15%;height:40%;
  display:flex;flex-direction:column;align-items:center;
  justify-content:flex-start;gap:5px;pointer-events:none;
}
#tarefa3-tela .at3-palavras-acumuladas img{
  width:100%;max-width:100%;height:30%;object-fit:contain;
}
/* Figuras ainda não concluídas mantêm os lugares originais no trio. */

#tarefa3-tela .at3-figuras-trio .at3-figura-concluida{width:100%;height:100%;display:block;}
#tarefa3-tela .at3-figuras-trio .at3-figura-concluida:first-child{grid-column:1 / 3;width:49%;}

/* =========================================================
   AT3 — Ajuste responsivo dos blocos que formam a palavra.
   Somente os blocos lançados pelo Siri; não altera o trio
   de alternativas nem suas áreas clicáveis.
   ========================================================= */
#tarefa3-tela .at3-palavra-fragmentos {
    left: 64%;
    width: 34%;
    gap: 2px;
    justify-content: center;
}
#tarefa3-tela .at3-palavra-fragmentos .at3-bloco {
    width: clamp(72px, 7.8vw, 112px);
    height: clamp(72px, 7.8vw, 112px);
    flex: 0 0 auto;
}

/* =========================================================
   GLUB AT3 — RESPONSIVIDADE PROPORCIONAL (1280 x 720)
   O JS define --at3-escala conforme a área real da atividade.
   Todos os blocos mantêm a proporção quadrada e cabem no trio.
   ========================================================= */
#tarefa3-tela {
  --at3-escala: 1;
}
/* Os blocos da palavra ficam próximos e não ultrapassam a faixa direita. */
#tarefa3-tela .at3-palavra-fragmentos {
  left: 65%;
  width: 33%;
  gap: calc(2px * var(--at3-escala));
  justify-content: center;
  min-height: 0;
}
#tarefa3-tela .at3-palavra-fragmentos .at3-bloco {
  width: min(calc(112px * var(--at3-escala)), 32%);
  height: auto;
  aspect-ratio: 1 / 1;
  flex: 0 1 auto;
  min-width: 0;
}
/* Trio central: mesma escala para largura, altura e espaçamento. */
#tarefa3-tela .at3-opcoes {
  width: 38%;
  height: auto;
  min-height: 0;
  gap: calc(8px * var(--at3-escala));
}
#tarefa3-tela .at3-opcoes .at3-opcao {
  width: min(calc(150px * var(--at3-escala)), 31%);
  height: auto;
  aspect-ratio: 1 / 1;
  flex: 0 1 auto;
  min-width: 0;
}
#tarefa3-tela .at3-opcoes .at3-bloco {
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
}
/* Siri, projéteis e aventureiro acompanham a mesma escala visual. */
#tarefa3-tela .at3-siri-lancador {
  width: calc(96px * var(--at3-escala));
  height: calc(96px * var(--at3-escala));
}
#tarefa3-tela .at3-siri-projetil {
  width: calc(75px * var(--at3-escala));
  height: calc(75px * var(--at3-escala));
}
#tarefa3-tela .tarefa3-avatar {
  width: var(--glub-avatar-largura,12.8125%);
  height: var(--glub-avatar-altura,22.7777778%);
}
#tarefa3-tela .at3-figuras-trio,
#tarefa3-tela .at3-palavras-acumuladas { min-width: 0; }
#tarefa3-tela .at3-figuras-trio img,
#tarefa3-tela .at3-palavras-acumuladas img { object-fit: contain; }

/* Colisão AT3: o avatar permanece visualmente à frente das alternativas. */
#tarefa3-tela .tarefa3-avatar{z-index:70;}

/* Mantém as caixas de colisão iguais às caixas visuais. */
#tarefa3-tela .at3-opcoes .at3-opcao { box-sizing:border-box; }

/* As caixas de colisão são apenas cálculos no JS: sem moldura visível. */
#tarefa3-tela .at3-opcoes .at3-opcao { background: transparent; border: 0; box-shadow: none; }

/* AT3: máscaras de colisão são invisíveis; nenhum quadro vermelho no erro. */
#tarefa3-tela .at3-opcoes .at3-opcao,
#tarefa3-tela .at3-opcoes .at3-opcao.at3-incorreto {
  background:transparent!important; border:0!important; outline:none!important; box-shadow:none!important;
}


/* GLUB — AT3: rio ondulante de verdade (canvas sobre agua_rio.png). */
#tarefa3-tela .at3-rio-ondulante {
  position: absolute;
  left: 0;
  top: 86.1111%;
  width: 100%;
  height: 13.8889%;
  z-index: 4;
  pointer-events: none;
  display: block;
  object-fit: fill;
}
/* A água original continua como reserva caso canvas não seja suportado. */
#tarefa3-tela .at3-agua { animation: none; filter: none; transform: none; }

/* AT3 — avatar sempre em evidência; cenários e caixas ficam atrás.
   HUD global continua acima de tudo (z-index 10000). */
#tarefa3-tela .tarefa3-avatar { z-index:90 !important; }
#tarefa3-tela .tarefa3-decoracao { pointer-events:none; }
#tarefa3-tela .at3-opcoes { z-index:65; }

/* GLUB — ATIVIDADE 3
   Trio de figuras abaixo da escada,
   no canto inferior direito.
*/
#tarefa3-tela .at3-figuras-trio {
    left: auto;
    right: 4%;
    bottom: 5%;
    width: 17%;
    height: 23%;
    z-index: 41;
}
/* ATIVIDADE 3 — margem tropical frontal, à frente do jogador.
   Fundo e objetos < avatar (90) < margem (95) < HUD global (10000). */
#tarefa3-tela .at3-margem-tropical {
  z-index: 95 !important;
  pointer-events: none !important;
  object-fit: fill;
  user-select: none;
}

/* ==========================================
   GLUB — ATIVIDADE 3
   Flutuação suave das figuras das palavras
   ========================================== */

#tarefa3-tela .at3-figuras-trio {
    z-index: 60 !important;
}

#tarefa3-tela .at3-figuras-trio img {
    animation: at3FlutuarFigura 3s ease-in-out infinite;
    will-change: transform;
}

/* Pequena diferença entre os movimentos */
#tarefa3-tela .at3-figuras-trio img:nth-child(2) {
    animation-delay: -1s;
}

#tarefa3-tela .at3-figuras-trio img:nth-child(3) {
    animation-delay: -2s;
}

@keyframes at3FlutuarFigura {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }
}
/* MUSGO: elementos exclusivos da Atividade 3. */
#tarefa3-tela .at3-musgo{position:absolute;top:66.11%;left:73%;width:12%;height:20%;object-fit:contain;z-index:48;pointer-events:none;user-select:none;filter:drop-shadow(0 5px 5px #071b09);}
#tarefa3-tela .at3-musgo-pedra{position:absolute;width:5.5%;height:8%;object-fit:contain;z-index:49;pointer-events:none;}
#tarefa3-tela .at3-musgo-vida{position:absolute;left:70%;top:54%;color:white;font:bold clamp(9px,1.2vw,17px) sans-serif;text-shadow:0 2px 4px #000;z-index:49;pointer-events:none;}

#tarefa3-tela .at3-musgo-vida{display:none!important;}
#tarefa3-tela .at3-concha-jogador{position:absolute;width:4%;height:5%;object-fit:contain;z-index:51;pointer-events:none;}

/* Todos os avatares usam a mesma escala e alinhamento. */
#tarefa3-tela .tarefa3-avatar-imagem { object-position: center bottom; }
