/* Letras: só o que as brincadeiras de letras precisam além do estilo.css. Tudo com o prefixo le-. */

/* ---------- o Lelo ---------- */
.le-mascote { width: 82px; }
.abertura-arte svg.le-lelo, .janela-arte svg.le-lelo { width: auto; height: 130px; margin: 0 auto; }
.le-brincadeira-emoji { background: #e0f2fe; }

/* ---------- palavra e desenho (Com que letra começa? e Monte a Palavra) ---------- */
.le-figura { padding: 16px 14px; gap: 6px; }
.le-emoji { font-size: clamp(76px, 24vw, 110px); }
.le-palavra {
  font-size: clamp(34px, 11vw, 52px); font-weight: 900; letter-spacing: .12em; line-height: 1.1;
  color: var(--tinta); min-height: 1.1em;
}
.le-inicial { color: #ef4444; text-decoration: underline; text-decoration-thickness: 5px; text-underline-offset: 6px; }
.le-buraco {
  display: inline-block; min-width: .9em; margin-right: .08em; border-radius: 12px;
  background: #fef3c7; color: #f59e0b; border: 3px dashed #f59e0b; letter-spacing: 0;
}
.le-escondida { color: #c4b5fd; letter-spacing: .3em; }
.le-modelo { font-size: min(clamp(28px, 9vw, 40px), calc(72vw / var(--len, 5))); color: var(--roxo); }
/* Palavras compridas: a letra encolhe para caber (--len vem do jogo). */
.le-palavra[style] { font-size: min(clamp(34px, 11vw, 52px), calc(68vw / var(--len, 5))); }
.le-modelo[style] { font-size: min(clamp(28px, 9vw, 40px), calc(68vw / var(--len, 5))); }

/* ---------- com que letra começa? ---------- */
.le-opcoes { display: grid; grid-template-columns: repeat(var(--n, 3), 1fr); gap: 12px; }
.le-opcao {
  aspect-ratio: 1; max-height: 128px; width: 100%; justify-self: center; border-radius: 24px;
  background: var(--branco); color: var(--roxo-escuro); box-shadow: 0 6px 0 rgba(42, 26, 94, .25);
  border: 5px solid transparent; font-size: clamp(46px, 15vw, 80px); font-weight: 900; line-height: 1;
  transition: transform .08s;
}
.le-opcoes-2 .le-opcao { max-height: 150px; }
.le-opcao:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(42, 26, 94, .25); }
.le-respondida .le-opcao { pointer-events: none; }
.le-respondida .le-opcao:not(.le-certa):not(.le-errada) { opacity: .45; }
.le-opcao.le-certa { border-color: #22c55e; background: #dcfce7; color: #15803d; animation: le-pula .45s cubic-bezier(.2, 1.6, .4, 1); }
.le-opcao.le-errada { border-color: #ef4444; background: #fee2e2; color: #b91c1c; animation: treme .12s 4; }

/* ---------- caça-letras ---------- */
.le-procura { gap: 12px; width: 100%; color: var(--tinta); }
.le-procura-letra {
  display: inline-flex; align-items: baseline; gap: 6px; padding: 2px 14px; border-radius: 14px;
  background: var(--branco); color: var(--roxo-escuro); font-size: 40px; font-weight: 900; line-height: 1.15;
}
.le-procura-letra small { font-size: 34px; }
.le-procura-ouvir { font-size: 24px; }
.le-campo {
  position: relative; width: 100%; aspect-ratio: 3 / 4; max-height: 60vh; margin: 0 auto; overflow: hidden;
  border-radius: 26px; touch-action: none; box-shadow: var(--sombra);
  background:
    radial-gradient(circle at 18% 22%, rgba(255, 255, 255, .7) 0 4%, transparent 5%),
    radial-gradient(circle at 80% 70%, rgba(255, 255, 255, .5) 0 6%, transparent 7%),
    linear-gradient(#7dd3fc 0%, #bae6fd 55%, #e0f2fe 100%);
}
@media (min-aspect-ratio: 1/1) { .le-campo { aspect-ratio: 4 / 3; } }
.le-campo .contagem-grande { color: var(--roxo-escuro); text-shadow: 0 6px 0 rgba(255, 255, 255, .7); }
.le-bolha {
  position: absolute; width: 19%; min-width: 60px; max-width: 110px; aspect-ratio: 1; padding: 0;
  transform: translate(-50%, -50%); border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 34% 28%, #fff 0 14%, var(--c) 58%);
  border: 3px solid rgba(255, 255, 255, .95); box-shadow: 0 5px 0 rgba(42, 26, 94, .18), 0 8px 14px rgba(42, 26, 94, .18);
  color: #1e1b4b; font-size: clamp(30px, 9vw, 54px); font-weight: 900; line-height: 1;
  animation: le-surge .25s ease-out, le-flutua var(--dura) linear forwards;
}
.le-bolha.le-pegou { animation: le-estoura .3s ease-out forwards; pointer-events: none; }
.le-bolha.le-errou { background: #fecaca; border-color: #ef4444; animation: le-murcha .32s ease-in forwards; pointer-events: none; }
.le-bolha.le-some { opacity: 0; transition: opacity .25s; pointer-events: none; }
@keyframes le-surge { from { transform: translate(-50%, -50%) scale(.2); opacity: 0; } }
@keyframes le-flutua { to { translate: var(--ir-x) var(--ir-y); } }
@keyframes le-estoura { to { transform: translate(-50%, -50%) scale(1.7); opacity: 0; } }
@keyframes le-murcha { 30% { transform: translate(-46%, -50%); } 60% { transform: translate(-54%, -50%); } to { transform: translate(-50%, -50%) scale(.5); opacity: 0; } }

/* ---------- monte a palavra ---------- */
.le-casas { display: flex; justify-content: center; gap: 8px; }
.le-casa {
  /* --n: quantas casas tem a palavra (até 7 cabem no celular em pé). */
  width: min(calc((100vw - 40px - (var(--n, 4) - 1) * 8px) / var(--n, 4)), 76px); aspect-ratio: 1 / 1.15; border-radius: 16px; display: grid; place-items: center;
  background: rgba(255, 255, 255, .35); border: 4px dashed rgba(255, 255, 255, .9);
  font-size: clamp(34px, 11vw, 56px); font-weight: 900; line-height: 1; color: var(--tinta);
}
.le-casa.le-proxima { border-color: #fde047; background: rgba(254, 240, 138, .45); animation: le-pulsa 1.2s ease-in-out infinite; }
.le-guia { color: rgba(42, 26, 94, .22); }
.le-casa.le-cheia { background: var(--branco); border: 4px solid #22c55e; animation: le-pula .35s cubic-bezier(.2, 1.6, .4, 1); }
.le-casas.le-pronta .le-casa { border-color: #16a34a; background: #dcfce7; animation: le-onda .6s ease-in-out; }
.le-casas.le-pronta .le-casa:nth-child(2) { animation-delay: .08s; }
.le-casas.le-pronta .le-casa:nth-child(3) { animation-delay: .16s; }
.le-casas.le-pronta .le-casa:nth-child(4) { animation-delay: .24s; }
.le-casas.le-pronta .le-casa:nth-child(5) { animation-delay: .32s; }
.le-pecas { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.le-peca {
  width: min(17vw, 76px); aspect-ratio: 1; border-radius: 18px; touch-action: none; position: relative;
  background: var(--branco); color: var(--roxo-escuro); box-shadow: 0 6px 0 rgba(42, 26, 94, .25);
  font-size: clamp(32px, 10vw, 52px); font-weight: 900; line-height: 1; border: 4px solid transparent;
}
.le-peca:active { box-shadow: 0 2px 0 rgba(42, 26, 94, .25); }
.le-peca.le-usada { visibility: hidden; }
.le-peca.le-arrastando { z-index: 30; box-shadow: 0 14px 22px rgba(42, 26, 94, .35); animation: none; }
.le-peca.le-errou { background: #fee2e2; border-color: #ef4444; animation: treme .12s 4; }
.le-peca.le-dica { border-color: #fde047; animation: le-pulsa .8s ease-in-out infinite; }

/* As sílabas: peças e casas mais largas. */
.le-casas.le-silabas .le-casa { width: min(calc((100vw - 40px - (var(--n, 3) - 1) * 8px) / var(--n, 3)), 110px); aspect-ratio: 1.3 / 1; font-size: clamp(28px, 8.5vw, 46px); }
.le-pecas.le-silabas .le-peca { width: auto; min-width: min(24vw, 104px); aspect-ratio: auto; padding: 14px 12px; font-size: clamp(28px, 8.5vw, 44px); }
.le-casas.le-pronta .le-casa:nth-child(6) { animation-delay: .4s; }
.le-casas.le-pronta .le-casa:nth-child(7) { animation-delay: .48s; }

/* ---------- recados escritos e surpresas (para brincar sem a voz) ---------- */
.le-pede { font-size: 18px !important; opacity: .8 !important; }
.le-recado {
  margin: 0; padding: 8px 14px; border-radius: 16px; background: var(--branco); box-shadow: var(--sombra);
  text-align: center; font-size: 19px; font-weight: 800; color: var(--tinta);
}
.le-recado-ruim { background: #fff7ed; color: #9a3412; }
.le-ver { align-self: center; }
.le-selo-dourado {
  align-self: center; padding: 6px 18px; border-radius: 999px; font-size: 18px; font-weight: 900; color: #78350f;
  background: linear-gradient(90deg, #fde68a, #facc15, #fde68a); box-shadow: 0 4px 0 #d97706; animation: le-pula .5s cubic-bezier(.2, 1.6, .4, 1);
}
.le-figura.le-dourada { box-shadow: 0 0 0 5px #facc15, var(--sombra); }
.le-bolha.le-bolha-dourada {
  background: radial-gradient(circle at 34% 28%, #fff 0 14%, #fde047 50%, #f59e0b 100%);
  border-color: #fff7cc; box-shadow: 0 0 18px 6px rgba(250, 204, 21, .75); z-index: 2;
}

@keyframes le-pula { from { transform: scale(.6); } }
@keyframes le-pulsa { 50% { transform: scale(1.08); } }
@keyframes le-onda { 50% { transform: translateY(-12px); } }
@media (prefers-reduced-motion: reduce) { .le-casa.le-proxima, .le-peca.le-dica { animation: none; } }

/* ---------- com que letra começa: o retorno que ensina ---------- */
.le-pede.le-pede-ensina { opacity: 1 !important; color: #9a3412; font-weight: 800; }

/* ---------- a mãozinha dos gestos ---------- */
.le-gestos { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 10px; }
.le-gesto {
  align-self: center; display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 10px; border-radius: 999px;
  background: #fff; color: var(--tinta); font-size: 16px; box-shadow: 0 3px 0 rgba(42, 26, 94, .15);
}
.le-mao { display: inline-block; font-size: 26px; line-height: 1; animation: le-mao-toca 1s ease-in-out infinite; }
.le-gesto-tocarN .le-mao { animation: le-mao-bate .5s ease-in-out infinite; }
.le-gesto-arrastar .le-mao { animation: le-mao-arrasta 1.6s ease-in-out infinite; }
.le-gesto-pintar .le-mao, .le-gesto-esfregar .le-mao { animation: le-mao-pinta .9s ease-in-out infinite; }
.le-gesto-pinca .le-mao { animation: le-mao-pinca 1.2s ease-in-out infinite; }
.le-gesto-ligar .le-mao { animation: le-mao-liga 1.6s ease-in-out infinite; }
@keyframes le-mao-toca { 0%, 100% { transform: translateY(-4px); } 45% { transform: translateY(3px) scale(.9); } }
@keyframes le-mao-bate { 0%, 100% { transform: rotate(-12deg); } 50% { transform: rotate(12deg) scale(1.1); } }
@keyframes le-mao-arrasta { 0% { transform: translate(-8px, 4px) scale(.9); } 60% { transform: translate(10px, -4px) scale(.9); } 100% { transform: translate(-8px, 4px); } }
@keyframes le-mao-pinta { 0%, 100% { transform: translate(-8px, 3px) rotate(-10deg); } 50% { transform: translate(8px, -3px) rotate(10deg); } }
@keyframes le-mao-pinca { 0%, 100% { transform: scale(.85); } 50% { transform: scale(1.25); } }
@keyframes le-mao-liga { 0%, 40% { transform: translate(-8px, 2px); } 20% { transform: translate(-8px, 6px) scale(.88); } 60%, 100% { transform: translate(10px, 2px); } 80% { transform: translate(10px, 6px) scale(.88); } }
.le-linha { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }

/* ---------- fábrica de palavras: o mapa ---------- */
.le-borrao { width: 100%; height: 100%; }
.abertura-arte svg.le-borrao { width: 130px; height: 130px; }
.le-fb-mapa {
  position: relative; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 12px; border-radius: 26px;
  background: repeating-linear-gradient(90deg, #475569 0 18px, #64748b 18px 36px); box-shadow: var(--sombra);
}
@media (min-width: 700px) { .le-fb-mapa { grid-template-columns: repeat(4, 1fr); } }
.le-fb-maquina {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 6px 8px; min-height: 124px;
  border-radius: 18px; background: #fef9c3; border: 4px solid #facc15; box-shadow: 0 5px 0 rgba(0, 0, 0, .3);
}
.le-fb-num { position: absolute; left: 8px; top: 6px; font-weight: 900; color: #a16207; }
.le-fb-icone { width: 56px; height: 52px; display: grid; place-items: center; font-size: 40px; line-height: 1; }
.le-fb-maquina strong { font-size: 15px; line-height: 1.1; text-align: center; }
.le-fb-maquina small { color: #f59e0b; font-size: 16px; letter-spacing: 1px; text-shadow: 0 1px 0 #fff; }
.le-fb-chefao { background: #ede9fe; border-color: #7c3aed; }
.le-fb-feita { border-color: #22c55e; }
.le-fb-atual { animation: le-fb-chama 1s ease-in-out infinite; }
.le-fb-maquina:disabled { opacity: .55; }
@keyframes le-fb-chama { 50% { box-shadow: 0 0 0 6px rgba(250, 204, 21, .6); } }

/* a faixa de cima: as rodadas da fase */
.le-fb-rodadas { display: flex; gap: 5px; }
.le-fb-rodadas i { width: 14px; height: 14px; border-radius: 50%; background: #e2e8f0; }
.le-fb-rodadas i.le-fb-feita { background: #22c55e; }
.le-fb-rodadas i.le-fb-agora { background: #f59e0b; box-shadow: 0 0 0 3px #fde68a; }

/* palmas */
.le-fb-palavra { display: flex; justify-content: center; gap: .15em; flex-wrap: wrap; }
.le-fb-silaba { display: inline-block; padding: 0 .12em; border-radius: 10px; background: #fef3c7; animation: le-pula .4s calc(var(--i) * .35s) both cubic-bezier(.2, 1.6, .4, 1); }
.le-fb-bater { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; }
.le-fb-tambor {
  width: 120px; height: 120px; border-radius: 50%; font-size: 72px; line-height: 1;
  background: radial-gradient(circle, #fff 0 55%, #fde68a 56%); box-shadow: 0 8px 0 #d97706; touch-action: manipulation;
}
.le-fb-tambor.le-fb-bate { animation: le-fb-bate .18s ease-out; }
@keyframes le-fb-bate { 50% { transform: scale(.88) translateY(4px); box-shadow: 0 2px 0 #d97706; } }
.le-fb-pontos { display: flex; gap: 6px; flex-wrap: wrap; max-width: 220px; }
.le-fb-pontos i { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 900; font-size: 20px; color: #fff; background: #f59e0b; box-shadow: 0 3px 0 #b45309; animation: le-pula .25s; }
.le-fb-escolha { padding: 4px 12px; margin: 0 2px; border-radius: 14px; background: #fff; border: 4px solid #c4b5fd; font: inherit; color: inherit; }
.le-fb-escolha.le-fb-forte { border-color: #22c55e; background: #dcfce7; }
.le-fb-escolha.le-fb-fraca { border-color: #ef4444; background: #fee2e2; }

/* esteira */
.le-fb-casa { background: rgba(255, 255, 255, .5); }
.le-fb-guia-clara { color: rgba(42, 26, 94, .1); }
.le-fb-esteira {
  position: relative; overflow: hidden; padding: 16px 0 22px; border-radius: 22px;
  background: linear-gradient(#94a3b8, #64748b); box-shadow: inset 0 -10px 0 #334155, var(--sombra);
}
.le-fb-rolos { position: absolute; left: 0; right: 0; bottom: 4px; height: 12px; background: repeating-linear-gradient(90deg, #1e293b 0 10px, #475569 10px 22px); animation: le-fb-rola 1s linear infinite; }
.le-fb-faixa { display: flex; gap: 14px; width: max-content; animation: le-fb-corre var(--dura, 12s) linear infinite; }
.le-fb-faixa.le-fb-parada { animation-play-state: paused; }
.le-fb-esteira:hover .le-fb-faixa, .le-fb-esteira:focus-within .le-fb-faixa { animation-play-state: paused; }
@keyframes le-fb-corre { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes le-fb-rola { to { background-position: 22px 0; } }
.le-fb-peca {
  min-width: 92px; padding: 14px 14px; border-radius: 16px; background: #fff; color: var(--roxo-escuro); touch-action: none;
  font-size: clamp(28px, 8vw, 40px); font-weight: 900; line-height: 1; box-shadow: 0 6px 0 rgba(42, 26, 94, .3); border: 4px solid transparent;
}
.le-fb-peca.le-fb-usada { visibility: hidden; }
.le-fb-peca.le-fb-levantada { opacity: .3; }
.le-fb-peca.le-errou { background: #fee2e2; border-color: #ef4444; animation: treme .12s 4; }
.le-fb-fantasma {
  position: fixed; left: 0; top: 0; z-index: 90; min-width: 80px; padding: 12px; border-radius: 16px; background: #fff; pointer-events: none;
  color: var(--roxo-escuro); font-size: 38px; font-weight: 900; text-align: center; box-shadow: 0 14px 24px rgba(0, 0, 0, .35); border: 4px solid #a78bfa;
}

/* pintura */
.le-fb-tela { width: min(78vw, 300px, 40vh); aspect-ratio: 1; margin: 0 auto; border-radius: 24px; background: #fff; box-shadow: var(--sombra); overflow: hidden; touch-action: none; }
.le-fb-tela.le-fb-pronta { box-shadow: 0 0 0 6px #22c55e, var(--sombra); }
.le-fb-canvas { display: block; touch-action: none; cursor: crosshair; }
.le-fb-paleta { display: flex; justify-content: center; gap: 10px; }
.le-fb-cor { width: 44px; height: 44px; border-radius: 50%; border: 4px solid #fff; box-shadow: 0 3px 0 rgba(0, 0, 0, .25); }
.le-fb-cor.le-fb-cor-sim { transform: scale(1.18); box-shadow: 0 0 0 4px var(--roxo); }

/* lupa */
.le-fb-pedido { align-self: center; display: flex; align-items: center; gap: 8px; padding: 6px 16px; border-radius: 999px; background: #fff; font-size: 20px; font-weight: 900; box-shadow: var(--sombra); }
.le-fb-pedido b { min-width: 40px; text-align: center; padding: 0 8px; border-radius: 12px; background: #ede9fe; color: var(--roxo-escuro); font-size: 28px; }
.le-fb-pedido b.le-fb-achada { background: #22c55e; color: #fff; }
.le-fb-feira-caixa { width: min(100%, calc((100vh - 330px) * 1.2)); aspect-ratio: 6 / 5; margin: 0 auto; border-radius: 22px; overflow: hidden; box-shadow: var(--sombra); }
.le-zoom { position: relative; width: 100%; height: 100%; overflow: hidden; touch-action: none; }
.le-zoom-miolo { width: 100%; height: 100%; transform-origin: 0 0; }
.le-lupas { display: flex; gap: 6px; }
.le-lupa { white-space: nowrap; min-width: 46px; height: 46px; padding: 0 10px; border-radius: 999px; background: #fff; color: var(--roxo-escuro); font-size: 20px; font-weight: 900; box-shadow: 0 3px 0 rgba(42, 26, 94, .25); }
.le-fb-ferramentas { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.le-fb-ferramentas .le-gesto { font-size: 14px; }
.le-fb-feira {
  position: relative; width: 100%; height: 100%;
  background: radial-gradient(circle at 20% 30%, #fde68a 0 3%, transparent 4%), repeating-linear-gradient(45deg, #fef3c7 0 16px, #fde68a 16px 32px);
}
.le-fb-coisa { position: absolute; transform: translate(-50%, -50%) rotate(var(--giro, 0deg)); font-size: clamp(26px, 8vw, 46px); line-height: 1; pointer-events: none; }
.le-fb-escondida {
  position: absolute; z-index: 2; transform: translate(-50%, -50%) rotate(var(--giro, 0deg)); padding: 2px 3px; min-width: 14px;
  font-weight: 900; line-height: 1; color: #6d28d9; background: rgba(255, 255, 255, .55); border-radius: 4px;
}
.le-fb-escondida.le-fb-achou { color: #fff; background: #22c55e; transform: translate(-50%, -50%) scale(1.6); box-shadow: 0 0 0 2px #fff; }
.le-fb-escondida.le-errou { color: #fff; background: #ef4444; animation: treme .12s 4; }

/* ligar */
.le-fb-ligar { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 60px; width: min(100%, 420px); margin: 0 auto; }
.le-fb-linhas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.le-fb-coluna { display: flex; flex-direction: column; gap: 8px; }
.le-fb-letra {
  position: relative; z-index: 1; height: 62px; border-radius: 16px; background: #fff; color: var(--roxo-escuro);
  font-size: 40px; font-weight: 900; line-height: 1; box-shadow: var(--sombra); border: 4px solid transparent;
}
.le-fb-letra.le-fb-sel { border-color: #f59e0b; background: #fffbeb; }
.le-fb-letra.le-fb-ligada { border-color: #22c55e; background: #f0fdf4; color: #15803d; }
.le-fb-letra.le-errou { border-color: #ef4444; animation: treme .12s 4; }

/* limpar a tinta do Borrão */
.le-fb-sujo { position: relative; width: min(70vw, 260px, 36vh); aspect-ratio: 1; margin: 0 auto; border-radius: 50%; background: #fff; box-shadow: var(--sombra); touch-action: none; overflow: hidden; }
.le-fb-sujo-desenho { position: absolute; inset: 0; display: grid; place-items: center; font-size: clamp(90px, 28vw, 140px); line-height: 1; }
.le-fb-tinta { position: absolute; inset: -4%; pointer-events: none; }
.le-fb-tinta svg { width: 100%; height: 100%; }
.le-fb-bucha { position: absolute; left: 70%; top: 70%; font-size: 44px; transform: translate(-50%, -50%); pointer-events: none; }
.le-fb-praticou { padding: 10px 14px; border-radius: 18px; background: rgba(255, 255, 255, .92); color: var(--tinta); font-size: 15px; line-height: 1.4; }
.le-fb-praticou p { margin: 6px 0 0; font-weight: 800; }

@media (prefers-reduced-motion: reduce) {
  .le-mao, .le-fb-atual, .le-fb-rolos { animation: none; }
  .le-fb-faixa { animation-duration: calc(var(--dura, 12s) * 2); }
}
