/* Ninho das Letras - celular em pé primeiro. Alvos de toque de 64 px ou mais. */
:root {
  --ceu: #bfe6ff; --ceu2: #e9f7ff; --galho: #8a5a2b; --folha: #3fa34d; --tinta: #3b2a1a;
  --ovo: #fffaf0; --sol: #ffd23f; --verde: #2f9e44; --laranja: #ff9f1c; --suave: #6b5a4a;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Andika", "Nunito", "Segoe UI", system-ui, sans-serif; color: var(--tinta);
  background: linear-gradient(var(--ceu), var(--ceu2) 70%, #dff3d4);
  user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
#app { max-width: 560px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; padding: 10px 14px calc(14px + env(safe-area-inset-bottom)); }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
button:focus-visible { outline: 4px solid var(--laranja); outline-offset: 3px; border-radius: 14px; }
.carregando { text-align: center; margin-top: 40vh; }
svg { display: block; width: 100%; height: 100%; }

/* Barra de cima */
.barra { display: flex; align-items: center; gap: 10px; min-height: 64px; }
.barra .espaco { flex: 1; }
.redondo { width: 64px; height: 64px; border-radius: 50%; background: #fff; box-shadow: 0 3px 0 #0002; display: grid; place-items: center; font-size: 30px; }
.redondo:active { transform: translateY(2px); box-shadow: 0 1px 0 #0002; }
.adulto-btn { font-size: 15px; padding: 0 14px; height: 48px; border-radius: 24px; background: #fff8; color: var(--suave); }
.logo { height: 44px; width: auto; }
.trilha { flex: 1; display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.trilha i { width: 14px; height: 18px; border-radius: 50% 50% 46% 46% / 60% 60% 40% 40%; background: #fff; border: 2px solid #3b2a1a55; }
.trilha i.feito { background: var(--sol); border-color: var(--laranja); }
.trilha i.agora { transform: scale(1.3); border-color: var(--tinta); }

/* Início */
.titulo { text-align: center; font-size: 30px; margin: 6px 0 0; letter-spacing: .5px; }
.ola { text-align: center; margin: 4px 0 0; color: var(--suave); min-height: 1.3em; }
.arvore { flex: 1; display: flex; flex-direction: column-reverse; justify-content: center; gap: 14px; padding: 16px 0; }
.galho { position: relative; min-height: 76px; display: flex; align-items: flex-end; gap: 4px; padding: 0 10px 14px; }
.galho::after { content: ""; position: absolute; left: 0; right: 10%; bottom: 6px; height: 14px; border-radius: 8px; background: var(--galho); }
.galho:nth-child(even)::after { left: 10%; right: 0; }
.galho .ave, .galho .ovinho { width: 52px; height: 52px; position: relative; z-index: 1; }
.galho .ovinho { width: 34px; height: 42px; opacity: .85; }
.galho .nome { position: absolute; right: 10px; top: -4px; font-size: 14px; color: var(--suave); }
.galho.trancado { opacity: .45; }
.jogar { align-self: center; width: 150px; height: 150px; border-radius: 50%; background: var(--verde); color: #fff; font-size: 64px; box-shadow: 0 6px 0 #1d6b2c; display: grid; place-items: center; }
.jogar:active { transform: translateY(4px); box-shadow: 0 2px 0 #1d6b2c; }

/* Atividade */
.palco { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 8px 0; }
.legenda { text-align: center; color: var(--suave); font-size: 15px; min-height: 2.6em; max-width: 30em; margin: 0; }
.opcoes { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; width: 100%; }
.opcao { min-width: 96px; min-height: 96px; border-radius: 22px; background: #fff; box-shadow: 0 5px 0 #0002; display: grid; place-items: center; padding: 8px; transition: transform .12s; }
.opcao:active { transform: translateY(3px); box-shadow: 0 2px 0 #0002; }
.opcao.ovo-op { background: none; box-shadow: none; width: 96px; height: 116px; padding: 0; }
.opcao.texto { font-size: 46px; font-weight: 700; padding: 8px 18px; }
.opcao.fig { width: 30%; max-width: 150px; aspect-ratio: 1; }
.opcao.certo { background: #d3f9d8; animation: pulo .4s; }
.opcao.ovo-op.certo { background: none; filter: drop-shadow(0 0 10px #2f9e44); }
.opcao.mostra { animation: brilho 1s infinite; outline: 5px solid var(--laranja); outline-offset: 4px; }
.opcao.sumiu { visibility: hidden; }
.treme { animation: treme .4s; }
.ovo-letra { font-size: 46px; font-weight: 700; fill: var(--tinta); font-family: inherit; }
.filhote-letra { font-size: 30px; font-weight: 700; fill: var(--tinta); font-family: inherit; }
.grande { width: 190px; height: 210px; }
.figura-grande { width: 170px; height: 170px; background: #fff; border-radius: 26px; padding: 12px; box-shadow: 0 4px 0 #0001; }
.letra-mae { display: flex; gap: 12px; align-items: center; }
.letra-mae .ave { width: 120px; height: 120px; }
.continuar { width: 96px; height: 96px; border-radius: 50%; background: var(--verde); color: #fff; font-size: 48px; box-shadow: 0 5px 0 #1d6b2c; display: grid; place-items: center; }
.juntar { display: flex; align-items: center; gap: 4px; }
.juntar .ovinho { width: 90px; height: 108px; transition: transform .6s; }
.juntar.junto .ovinho:first-child { transform: translateX(14px) rotate(6deg); }
.juntar.junto .ovinho:last-child { transform: translateX(-14px) rotate(-6deg); }
.silaba-nova { font-size: 64px; font-weight: 700; min-height: 80px; }
.ninhos { display: flex; gap: 8px; }
.ninho { width: 96px; height: 76px; border-radius: 0 0 48px 48px; background: #c99a5b; border: 3px solid var(--galho); display: grid; place-items: center; font-size: 42px; font-weight: 700; }
.ninho.cheio { background: #ffe9a8; }
.palavra-ler { display: flex; gap: 6px; }
.palavra-ler button { font-size: 56px; font-weight: 700; padding: 4px 10px; border-radius: 14px; background: #fff; box-shadow: 0 4px 0 #0002; min-height: 80px; min-width: 72px; }
.tambor { width: 110px; height: 110px; border-radius: 50%; background: #ff7a59; color: #fff; font-size: 50px; box-shadow: 0 6px 0 #b04a30; display: grid; place-items: center; }
.tambor:active { transform: translateY(4px); box-shadow: 0 2px 0 #b04a30; }
.palmas-conta { display: flex; gap: 6px; min-height: 30px; font-size: 26px; }
.pontos { font-size: 34px; letter-spacing: 4px; }

/* Fim e mensagens */
.festa { text-align: center; }
.festa .aves { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: 100%; }
.festa .aves div { width: 56px; height: 56px; animation: pulo 1s infinite alternate; }
.festa .aves div:nth-child(2) { animation-delay: .2s; } .festa .aves div:nth-child(3) { animation-delay: .4s; }
.festa h2 { font-size: 26px; }
.botoes { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.botao { min-height: 64px; padding: 0 22px; border-radius: 32px; background: #fff; box-shadow: 0 4px 0 #0002; font-size: 18px; display: inline-flex; align-items: center; gap: 8px; }
.botao.principal { background: var(--verde); color: #fff; box-shadow: 0 4px 0 #1d6b2c; }

/* Área do adulto */
.adulto { background: #fff; border-radius: 22px; padding: 18px; margin-top: 6px; user-select: text; -webkit-user-select: text; }
.adulto h2 { margin: 0 0 6px; font-size: 22px; }
.adulto h3 { margin: 18px 0 6px; font-size: 17px; }
.adulto p, .adulto li { font-size: 15px; line-height: 1.45; }
.adulto ul { padding-left: 18px; margin: 4px 0; }
.adulto .cod { color: var(--suave); font-size: 12px; }
.adulto .aviso { background: #fff4d6; border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.adulto .linha { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.adulto .botao { min-height: 52px; font-size: 16px; background: #f1f3f5; box-shadow: none; }
.adulto .botao.principal { background: var(--verde); }
.teclado { display: grid; grid-template-columns: repeat(3, 72px); gap: 10px; justify-content: center; margin: 10px 0; }
.teclado button { height: 64px; border-radius: 16px; background: #f1f3f5; font-size: 26px; }
.codigo-visor { text-align: center; font-size: 34px; letter-spacing: 10px; min-height: 44px; }
.portao-num { display: flex; gap: 12px; justify-content: center; }
.portao-num button { width: 84px; height: 72px; border-radius: 16px; background: #f1f3f5; font-size: 28px; }
.erro { color: #c92a2a; }
.grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 8px; }
.grade .cel { border-radius: 12px; padding: 6px; text-align: center; background: #f1f3f5; }
.grade .cel b { display: block; font-size: 24px; }
.grade .cel span { font-size: 12px; }
.cel.aprendendo, .sil.aprendendo { background: #fff3bf; } .cel.firme, .sil.firme { background: #d3f9d8; }
.cel.decorado, .sil.decorado { background: #b2f2bb; outline: 2px solid #2f9e44; }
.sil { display: inline-block; padding: 2px 8px; border-radius: 8px; margin: 2px; font-weight: 700; background: #f1f3f5; }
.galho .ave { padding: 0; }
.ave.canta { animation: pulo .3s 2 alternate; }

@keyframes pulo { from { transform: translateY(0); } to { transform: translateY(-10px); } }
@keyframes treme { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
@keyframes brilho { 50% { outline-color: transparent; } }
@keyframes choca { 0% { transform: rotate(0); } 25% { transform: rotate(-10deg); } 50% { transform: rotate(10deg); } 75% { transform: rotate(-6deg); } 100% { transform: scale(0); opacity: 0; } }
@keyframes nasce { from { transform: scale(.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.chocando { animation: choca .8s forwards; }
.nascendo { animation: nasce .5s; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media (min-height: 760px) { .figura-grande { width: 200px; height: 200px; } }
