/* Ateliê de Arte (o Tinto, o polvo pintor): só o que as salas do ateliê precisam além do estilo.css. Tudo começa com at-. */

/* ---------- o Tinto, o menu e a galeria ---------- */
.at-tinto { display: block; width: 100%; height: auto; }
.at-apresenta-tinto { width: 116px; }
.abertura-arte .at-tinto { width: 140px; max-width: none; margin: 0 -15px; }
.at-brincadeira-emoji { background: #fce7f3; }
.at-botao-claro { background: #fff; color: var(--roxo-escuro); }

.at-galeria { display: flex; flex-direction: column; gap: 10px; }
.at-galeria-vazia {
  margin: 0; padding: 12px 16px; border-radius: 18px; background: rgba(255, 255, 255, .25);
  color: var(--branco); font-weight: 700; text-align: center;
}
.at-galeria-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.at-quadrinho {
  display: flex; flex-direction: column; gap: 4px; padding: 6px; border-radius: 12px; background: #fff;
  border: 4px solid #fbbf24; box-shadow: var(--sombra); min-width: 0;
}
.at-quadrinho:active { transform: scale(.96); }
.at-quadrinho img { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 6px; background: #f8fafc; }
.at-quadrinho small { font-size: 12px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.at-janela-obra .janela-arte { width: min(320px, 76vw); }
.at-janela-obra .janela-arte img { display: block; width: 100%; border-radius: 6px; border: 8px solid #fbbf24; box-shadow: 0 6px 14px rgba(0, 0, 0, .2); }

/* ---------- o mapa de fases ---------- */
.at-mapa-topo { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.at-mapa-total { padding: 6px 14px; border-radius: 999px; background: var(--branco); font-size: 18px; font-weight: 900; box-shadow: var(--sombra); }
.at-mapa { position: relative; width: 100%; max-width: 860px; min-height: 200px; margin: 0 auto; }
.at-mapa-fundo { position: absolute; inset: 0; border-radius: 22px; overflow: hidden; box-shadow: var(--sombra); }
.at-mapa-fundo svg { display: block; width: 100%; height: 100%; }
.at-mapa-dica { font-size: 16px; }
.at-parada {
  position: absolute; z-index: 1; transform: translate(-50%, -34%); width: 31%; max-width: 160px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.at-parada:disabled { opacity: 1; }
.at-parada-bola {
  position: relative; width: clamp(54px, 14vw, 84px); height: clamp(54px, 14vw, 84px); border-radius: 50%;
  display: grid; place-items: center; background: #fff; border: 5px solid #f472b6; box-shadow: 0 5px 0 rgba(12, 74, 110, .45);
}
.at-parada-emoji { font-size: clamp(24px, 6.5vw, 38px); font-weight: 900; line-height: 1; color: #7c3aed; }
.at-parada-num {
  position: absolute; top: -9px; right: -9px; min-width: 27px; height: 27px; padding: 0 5px; border-radius: 999px;
  display: grid; place-items: center; background: #7c3aed; color: #fff; font-size: 14px; font-weight: 900; border: 2px solid #fff;
}
.at-parada-estrelas { color: #fde047; font-size: 16px; letter-spacing: 1px; text-shadow: 0 1px 0 rgba(0, 0, 0, .45); }
.at-parada-nome { color: #fff; font-size: 13px; font-weight: 800; line-height: 1.1; text-align: center; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); }
.at-chefao .at-parada-bola { border-color: #facc15; background: #fef9c3; }
.at-chefao .at-parada-num { background: #f59e0b; }
.at-trancada .at-parada-bola { border-color: #94a3b8; background: #e2e8f0; filter: grayscale(.7); }
.at-trancada .at-parada-nome { opacity: .75; }
.at-aqui .at-parada-bola { border-color: #22c55e; animation: at-pula 1.2s ease-in-out infinite; }
.at-parada:focus-visible .at-parada-bola { outline: 5px solid #fde047; outline-offset: 3px; }

/* ---------- a tela de jogo ---------- */
.at-palco { display: flex; flex-direction: column; gap: 10px; }
.at-cabeca { display: flex; flex-direction: column; gap: 8px; }
.at-meio { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.at-area { position: relative; width: 100%; display: flex; justify-content: center; }
.at-lado { width: 100%; display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
.at-rodape:empty { display: none; }
.at-tela {
  display: block; flex: none; border-radius: 18px; background: #fff; box-shadow: var(--sombra);
  touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.vez.at-vez { padding: 6px 14px; font-size: 18px; }
.at-vez-nome { display: inline-flex; align-items: center; gap: 4px; }
.erros-fato.at-pedido { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 14px; font-size: 17px; line-height: 1.3; }
.at-pedido .at-mao { flex: none; font-size: 28px; }
.at-fato-erro { background: #ffedd5; box-shadow: 0 0 0 3px #fb923c, var(--sombra); }
.at-fato-ok { background: #dcfce7; box-shadow: 0 0 0 3px #22c55e, var(--sombra); }
.at-fato-dica { background: #fef9c3; }
.at-escondido { display: none !important; }

/* Celular em pé: tudo cabe na tela (a mãozinha do gesto já está no pedido, em cima). */
@media (max-aspect-ratio: 1/1) {
  .at-lado .at-gestos { display: none; }
  .at-ferramenta { min-width: 46px; height: 50px; padding: 3px 4px; font-size: 20px; }
  .at-ferramenta small { font-size: 10px; }
  .at-tinta { min-width: 42px; padding: 3px 2px; }
  .at-tinta-gota { width: 36px; height: 36px; }
  .at-paleta-num .at-tinta-gota { width: 40px; height: 40px; }
  .at-escolha { padding: 4px 9px; font-size: 16px; }
  .at-bolinha-cor { width: 30px; height: 30px; }
  .at-linha-ferramentas { flex-direction: row; flex-wrap: wrap; justify-content: center; }
  .at-escolha small { display: none; }
  .at-paleta { gap: 4px; }
  .at-paleta-muitas .at-tinta small { display: none; }
  .at-paleta-muitas .at-tinta { min-width: 36px; padding: 2px; }
  .at-paleta-muitas .at-tinta-gota { width: 33px; height: 33px; }
  .erros-fato.at-pedido { font-size: 16px; padding: 7px 12px; }
}

/* TV e tablet deitado: as ferramentas numa coluna do lado do desenho. */
@media (min-width: 700px) and (min-aspect-ratio: 5/4) {
  .at-meio { flex-direction: row; align-items: flex-start; justify-content: center; }
  .at-area { flex: 1; min-width: 0; }
  .at-lado { width: 300px; flex: none; }
  .at-tubo { width: 54px; }
  .at-tinta small { font-size: 13px; }
  .vez.at-vez { font-size: 20px; }
}
/* TV grande: as telas de jogo do ateliê usam mais largura (o desenho fica maior). */
@media (min-width: 1000px) and (min-aspect-ratio: 5/4) {
  .tela[class*="tela-arte-"] .corpo { max-width: 1180px; }
}

/* ---------- tintas, ferramentas e gestos ---------- */
.at-paleta { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.at-tinta {
  display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 48px; padding: 4px 3px;
  border-radius: 14px; border: 3px solid transparent;
}
.at-tinta-gota {
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50% 50% 46% 46% / 58% 58% 42% 42%;
  background: var(--tinta); border: 3px solid rgba(42, 26, 94, .55); color: var(--tinta, #2a1a5e);
  font-size: 15px; font-weight: 900; transition: transform .12s;
  box-shadow: inset -4px -4px 0 rgba(0, 0, 0, .14), inset 4px 4px 0 rgba(255, 255, 255, .35);
}
.at-paleta-num .at-tinta-gota { width: 46px; height: 46px; color: #2a1a5e; font-size: 16px; }
.at-tinta-gota.at-escura { color: #fff; text-shadow: 0 1px 1px rgba(0, 0, 0, .55); }
.at-arco { background: conic-gradient(#ef4444, #fb923c, #facc15, #22c55e, #22d3ee, #3b82f6, #a855f7, #ef4444); }
.at-tinta small { color: #fff; font-size: 11px; font-weight: 800; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); }
.at-tinta.at-escolhida { background: #fff; border-color: #fde047; }
.at-tinta.at-escolhida small { color: var(--tinta); text-shadow: none; filter: brightness(.6); }
.at-tinta.at-escolhida .at-tinta-gota { transform: scale(1.1); }
.at-pisca { animation: at-pisca .45s ease-in-out 3; }

.at-ferramentas { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.at-ferramenta {
  display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 58px; height: 56px;
  padding: 4px 6px; border-radius: 16px; background: #fff; color: var(--tinta); font-size: 22px; line-height: 1;
  box-shadow: 0 4px 0 rgba(42, 26, 94, .25);
}
.at-ferramenta small { margin-top: 3px; font-size: 11px; font-weight: 800; }
.at-ferramenta:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(42, 26, 94, .25); }
.at-pronto { align-self: center; }
.at-ferramenta.at-verde { background: #22c55e; color: #fff; box-shadow: 0 4px 0 #15803d; }
.at-ferramenta.at-verde:disabled { background: #e2e8f0; color: var(--tinta); box-shadow: 0 4px 0 rgba(42, 26, 94, .2); opacity: .8; }
.at-linha-ferramentas { display: flex; flex-direction: column; gap: 6px; }
.at-escolhas { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.at-escolha {
  display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border-radius: 999px; border: 3px solid transparent;
  background: rgba(255, 255, 255, .3); color: #fff; font-size: 18px; font-weight: 800;
}
.at-escolha small { font-size: 13px; }
.at-escolha.at-escolhida { background: #fff; color: var(--roxo-escuro); border-color: #fde047; }
.at-bolinha-cor { width: 34px; height: 34px; border-radius: 50%; background: var(--tinta); border: 3px solid #fff; box-shadow: 0 2px 0 rgba(0, 0, 0, .25); }
.at-bolinha-cor.at-escolhida { transform: scale(1.15); box-shadow: 0 0 0 3px #fde047; }

.at-gestos { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.at-gesto {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px 3px 6px; border-radius: 999px;
  background: rgba(255, 255, 255, .92); font-size: 14px;
}
.at-mao { display: inline-block; font-size: 24px; line-height: 1; }
.at-gesto-tocar .at-mao { animation: at-mao-toca 1s ease-in-out infinite; }
.at-gesto-arrastar .at-mao, .at-gesto-ligar .at-mao { animation: at-mao-arrasta 1.6s ease-in-out infinite; }
.at-gesto-desenhar .at-mao, .at-gesto-pintar .at-mao { animation: at-mao-desenha 1.6s ease-in-out infinite; }
.at-gesto-girar .at-mao { animation: at-mao-gira 1.4s linear infinite; }
.at-gesto-virar .at-mao { animation: at-mao-vira 1.6s ease-in-out infinite; }
.at-gesto-segurar .at-mao { animation: at-mao-toca 1.6s ease-in-out infinite; }
/* A mãozinha que anda em cima do desenho (a posição vem do JS). */
.at-mao-quadro {
  position: absolute; left: 0; top: 0; z-index: 5; margin: -4px 0 0 -18px; font-size: 40px; line-height: 1;
  pointer-events: none; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .35));
}

/* ---------- Trace a Letra ---------- */
.at-palavra-alvo {
  display: flex; align-items: center; justify-content: center; gap: 6px; padding: 6px 12px; border-radius: 16px;
  background: #fff; font-size: 28px; font-weight: 900; letter-spacing: 2px; box-shadow: var(--sombra);
}
.at-palavra-emoji { font-size: 30px; margin-right: 6px; }
.at-palavra-alvo b { min-width: 18px; text-align: center; color: #cbd5e1; }
.at-palavra-alvo b.at-feita { color: #16a34a; }
.at-palavra-alvo b.at-agora { color: #7c3aed; border-bottom: 4px solid #7c3aed; }
.at-progresso { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.at-progresso i {
  min-width: 24px; height: 24px; padding: 0 5px; border-radius: 999px; display: grid; place-items: center;
  background: rgba(255, 255, 255, .35); color: var(--tinta); font-size: 13px; font-style: normal; font-weight: 900;
}
.at-progresso i.at-feita { background: #fde047; }
.at-progresso i.at-agora { background: #fff; box-shadow: 0 0 0 3px #22c55e; }
.at-cartao-letra {
  position: absolute; z-index: 6; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(300px, 88%);
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 16px; text-align: center;
  border-radius: 26px; background: #fff; border: 6px solid #fde047; box-shadow: 0 12px 30px rgba(42, 26, 94, .4);
}
.at-cartao-letra.entra { animation: at-surge .4s cubic-bezier(.2, 1.6, .4, 1); }
.at-cartao-letra-grande { color: #7c3aed; font-size: 54px; font-weight: 900; line-height: 1; letter-spacing: 2px; }
.at-cartao-figura { font-size: 54px; line-height: 1.1; word-break: break-all; }
.at-cartao-figura.at-figura-miuda { font-size: 28px; }
.at-cartao-palavra { font-size: 26px; font-weight: 900; letter-spacing: 1px; }
.at-cartao-palavra b { color: #ef4444; }
.at-cartao-letra small { font-size: 15px; font-weight: 700; opacity: .7; }
.at-cartao-estrelas { color: #f59e0b; font-size: 30px; letter-spacing: 2px; }

/* ---------- Laboratório de Cores ---------- */
.at-alvo { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 20px; background: #fff; box-shadow: var(--sombra); }
.at-alvo-quadro { flex: none; }
.at-tela-quadrinho { border-radius: 8px; border: 4px solid #fbbf24; box-shadow: none; touch-action: auto; }
.at-alvo-texto { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.at-alvo-linha { display: flex; align-items: center; gap: 8px; font-size: 21px; }
.at-amostra { flex: none; width: 42px; height: 42px; border-radius: 50%; border: 3px solid var(--tinta); box-shadow: inset -4px -4px 0 rgba(0, 0, 0, .15); }
.at-receita { font-size: 15px; font-weight: 700; line-height: 1.3; }
.at-tubos { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.at-tubo {
  display: flex; flex-direction: column; align-items: center; width: 58px; padding: 4px 2px; border-radius: 14px;
  background: rgba(255, 255, 255, .92); box-shadow: 0 4px 0 rgba(42, 26, 94, .25); touch-action: none;
}
.at-tubo svg { width: 32px; height: 56px; display: block; }
.at-tubo small { font-size: 11px; font-weight: 800; }
.at-tubo:active, .at-tubo.at-pegou { transform: translateY(3px); box-shadow: 0 1px 0 rgba(42, 26, 94, .25); }
.at-tubo.at-pegou { opacity: .55; }
.at-arrasto { position: fixed; left: 0; top: 0; z-index: 90; pointer-events: none; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .35)); }
.at-gota-voando { width: 36px; height: 48px; }
.at-gota-voando svg { display: block; width: 100%; height: 100%; }
.at-segurar { touch-action: none; }
.at-segurar.at-apertado { background: #fde047; transform: translateY(3px); }

/* ---------- Monte com Formas ---------- */
.at-pergunta {
  display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 18px; text-align: center;
  background: #fff; border: 4px solid #fde047; font-size: 18px; box-shadow: var(--sombra);
}
.at-pergunta-opcoes { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.at-pergunta-opcoes .botao { padding: 10px 18px; background: #ede9fe; }

/* ---------- a festa do fim da fase ---------- */
.janela.at-festa { z-index: 55; overflow: hidden; }
.at-festa-caixa { position: relative; z-index: 2; border: 6px solid #fde047; gap: 8px; }
.at-festa-caixa h2 { color: #7c3aed; }
.at-festa-tinto { width: 104px; margin: -6px auto 0; animation: at-danca .8s ease-in-out infinite alternate; }
.at-moldura {
  align-self: center; padding: 9px; border-radius: 8px;
  background: linear-gradient(135deg, #b45309, #fde047 30%, #d97706 60%, #fde68a); box-shadow: 0 8px 16px rgba(0, 0, 0, .28);
}
.at-moldura img { display: block; max-width: min(300px, 68vw); max-height: 34vh; border: 3px solid #fff; border-radius: 3px; }
.at-festa-estrelas { display: flex; justify-content: center; gap: 8px; }
.at-festa-estrela { color: #e5e7eb; font-size: 46px; line-height: 1; animation: at-estrela .5s cubic-bezier(.2, 1.6, .4, 1) both; }
.at-festa-estrela.at-ganhou { color: #f59e0b; text-shadow: 0 3px 0 #b45309; }
.at-festa-licao { font-size: 18px !important; font-weight: 700; }
.at-respingos { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.at-respingo-solto {
  position: absolute; width: var(--tam); height: var(--tam); opacity: .9; transform: rotate(var(--giro));
  animation: at-respingo .45s cubic-bezier(.2, 1.6, .4, 1) both;
}
.at-respingo-solto svg { display: block; width: 100%; height: 100%; }
.at-praticou { padding: 12px 16px; border-radius: 18px; background: rgba(255, 255, 255, .95); color: var(--tinta); text-align: left; box-shadow: var(--sombra); }
.at-praticou ul { margin: 6px 0 0; padding-left: 22px; font-size: 16px; font-weight: 700; }

/* ---------- animações ---------- */
@keyframes at-pula { 50% { transform: translateY(-6px) scale(1.06); } }
@keyframes at-pisca { 50% { transform: scale(1.18); box-shadow: 0 0 0 5px #fde047; } }
@keyframes at-surge { from { scale: .5; opacity: 0; } }
@keyframes at-danca { from { transform: rotate(-8deg) translateY(2px); } to { transform: rotate(8deg) translateY(-6px); } }
@keyframes at-estrela { from { scale: 0; rotate: -90deg; opacity: 0; } }
@keyframes at-respingo { from { scale: 0; opacity: 0; } }
@keyframes at-mao-toca { 0%, 100% { transform: translateY(-4px); } 45% { transform: translateY(3px) scale(.88); } }
@keyframes at-mao-arrasta { 0% { transform: translate(-8px, 4px) scale(.9); } 60% { transform: translate(10px, -4px) scale(.9); } 100% { transform: translate(-8px, 4px); } }
@keyframes at-mao-desenha { 0% { transform: translate(-8px, 4px); } 33% { transform: translate(0, -5px); } 66% { transform: translate(8px, 4px); } 100% { transform: translate(-8px, 4px); } }
@keyframes at-mao-gira { from { transform: rotate(0) translateX(6px) rotate(0); } to { transform: rotate(360deg) translateX(6px) rotate(-360deg); } }
@keyframes at-mao-vira { 0%, 100% { transform: scaleX(1); } 50% { transform: scaleX(-1); } }
@media (prefers-reduced-motion: reduce) {
  .at-aqui .at-parada-bola, .at-festa-tinto, .at-mao, .at-pisca { animation: none; }
}
