/* Baralho dos Passos: estilo da web.
   Inclusão: fonte Lexend (local) com Verdana/Arial; corpo grande; espaçamento aumentado; texto à esquerda;
   sem itálico nem maiúsculas contínuas; fundo creme nos cartões; cor + forma + ícone; contraste AA. */
@font-face { font-family: "Lexend"; src: url("/fontes/Lexend.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }
* { box-sizing: border-box; }
:root { --cor: #2b2b2b; --creme: #FFF8E7; --tinta: #1a1a1a; --certo: #1F4E9A; --erro: #B3261E; }
body {
  margin: 0; font-family: "Lexend", Verdana, Arial, sans-serif; background: #f3f1ec; color: var(--tinta);
  font-size: 19px; line-height: 1.5; letter-spacing: .02em; word-spacing: .08em; text-align: left;
}
em, i { font-style: normal; }
a { color: inherit; }
button { font: inherit; }
:focus-visible { outline: 4px solid #1a1a1a; outline-offset: 2px; }
.topo { padding: 1.2rem 1.4rem .4rem; max-width: 1200px; margin: 0 auto; }
.topo h1 { margin: 0 0 .3rem; font-size: 1.9rem; line-height: 1.25; }
.topo p { margin: 0; }

/* Padrões por naipe (não depender só da cor). */
.padrao-riscas { background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.45) 0 8px, transparent 8px 16px); }
.padrao-pontos { background-image: radial-gradient(circle, rgba(255,255,255,.6) 4px, transparent 5px); background-size: 18px 18px; }
.padrao-xadrez { background-image: conic-gradient(rgba(255,255,255,.45) 25%, transparent 0 50%, rgba(255,255,255,.45) 0 75%, transparent 0); background-size: 28px 28px; }
.padrao-ondas { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='20'%3E%3Cpath d='M0 10 Q10 0 20 10 T40 10' fill='none' stroke='white' stroke-opacity='.6' stroke-width='3'/%3E%3C/svg%3E"); background-size: 40px 20px; }

/* Página inicial */
.naipes { display: grid; gap: 1.2rem; padding: 1rem 1.4rem; max-width: 1200px; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.naipe { background: var(--creme); border-radius: 18px; border: 4px solid var(--cor); overflow: hidden; padding-bottom: 1rem; }
.naipe .faixa { background-color: var(--cor); height: 84px; display: flex; align-items: center; gap: .6rem; padding: 0 1rem; }
.faixa-forma, .faixa-icone { background: #fff; border-radius: 50%; width: 56px; height: 56px; display: grid; place-items: center; font-size: 1.8rem; color: var(--cor); border: 3px solid #1a1a1a; }
.naipe h2 { margin: .6rem 1rem .2rem; color: var(--cor); }
.naipe p { margin: 0 1rem .8rem; font-size: .95rem; }
.tarefas { display: grid; gap: .6rem; padding: 0 1rem; }
.botao-tarefa { display: grid; gap: .2rem; text-decoration: none; padding: .7rem .9rem; border-radius: 12px; background: var(--cor); color: #fff; font-size: .92rem; }
.botao-tarefa strong { font-size: 1.1rem; }
.botao-tarefa .casas { font-size: .85rem; }
.rodape-pagina { display: flex; gap: 1.4rem; flex-wrap: wrap; padding: 1rem 1.4rem 2rem; max-width: 1200px; margin: 0 auto; font-weight: 600; }

/* Página da tarefa */
.topo-tarefa { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; background: var(--cor); color: #fff; max-width: none; padding: .8rem 1.4rem; }
.topo-tarefa .cabeca { flex: 1; min-width: 260px; }
.topo-tarefa h1 { font-size: 1.6rem; }
.topo-tarefa .audio { background: #fff; }
.voltar { text-decoration: none; font-weight: 600; white-space: nowrap; }
.chips { display: flex; gap: .5rem; flex-wrap: wrap; }
.chip { background: #fff; color: var(--tinta); padding: .35rem .9rem; border-radius: 999px; white-space: nowrap; }
.aviso-lingua { background: #fff; color: var(--tinta); display: inline-block; padding: .1rem .6rem; border-radius: 6px; margin-top: .3rem !important; }
.opcoes { display: flex; gap: .5rem 1.2rem; flex-wrap: wrap; align-items: center; padding: .6rem 1.4rem; background: #fff; border-bottom: 2px solid #ddd; font-size: .9rem; }
.opcoes label { display: inline-flex; align-items: center; gap: .35rem; cursor: pointer; }
.opcoes input[type=checkbox] { width: 22px; height: 22px; }
.opcoes select { font: inherit; padding: .2rem .4rem; }
.pagina-tarefa main { max-width: 1240px; margin: 0 auto; padding: .4rem 1.4rem 2rem; }
.zona h2 { margin: .9rem 0 .1rem; font-size: 1.2rem; }
.ajuda { margin: 0 0 .5rem; font-size: .92rem; color: #333; }

/* Temporizador: barra que esvazia, sem som nem animação em ciclo. */
.tempo { max-width: 1240px; margin: .6rem auto 0; padding: 0 1.4rem; }
.tempo-barra { height: 22px; border: 3px solid #1a1a1a; border-radius: 999px; background: #fff; overflow: hidden; }
.tempo-enche { height: 100%; background: var(--certo); transition: width 1s linear; }
.tempo-texto { margin: .25rem 0 0; font-weight: 600; }
.tempo.aviso .tempo-barra { border-style: dashed; border-color: #7A5C00; background: #FFF1C2; }
.tempo.aviso .tempo-enche { background: #7A5C00; }
.tempo.aviso .tempo-texto { background: #FFF1C2; border: 3px dashed #7A5C00; padding: .3rem .6rem; border-radius: 10px; }

/* Cartões */
.cartas { display: flex; flex-wrap: wrap; gap: 1.1rem .9rem; min-height: 230px; padding: 1rem; border-radius: 16px; }
.monte { background: #e4e0d6; }
.linha { background: #fff; outline: 3px dashed #999; outline-offset: -3px; }
.cartas.alvo { outline: 4px solid var(--cor); outline-offset: -4px; background: #fffbe9; }
.carta {
  position: relative; width: 158px; height: 212px; flex: none;
  background: var(--creme); border: 4px solid var(--cor); border-radius: 14px;
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
  padding: 1.8rem .7rem 2.2rem; text-align: left; cursor: grab; user-select: none;
  touch-action: none; box-shadow: 0 3px 0 rgba(0,0,0,.18);
}
/* Com tradução o cartão cresce. A margem de cima afasta o desenho da marca do naipe.
   A de baixo reserva o 🔊 e a marca de baixo, para não ficarem em cima do texto. */
.carta.com-traducao {
  height: auto; min-height: 212px; justify-content: flex-start;
  padding-top: 2.45rem; padding-bottom: 3.6rem;
}
.carta .canto { position: absolute; top: 5px; left: 8px; font-size: .95rem; display: flex; align-items: center; gap: 2px; }
.carta .canto .forma { color: var(--cor); font-size: 1.15rem; line-height: 1; }
.carta .canto.baixo { top: auto; left: auto; bottom: 5px; right: 8px; transform: rotate(180deg); }
.carta .emoji { font-size: 2.1rem; line-height: 1; margin-bottom: .4rem; }
.carta .texto { font-size: .95rem; line-height: 1.4; overflow-wrap: break-word; max-width: 100%; }
.carta .selo { margin-top: .3rem; padding: .05rem .5rem; border: 3px solid #1a1a1a; border-radius: 8px; font-weight: 700; font-size: 1.15rem; background: #fff; }
.carta .traducao { margin-top: .3rem; font-size: .85rem; line-height: 1.35; border-top: 2px solid #bbb; padding-top: .2rem; overflow-wrap: break-word; max-width: 100%; }
.carta .audio { position: absolute; bottom: 4px; left: 6px; }
.carta .cadeado { position: absolute; top: 4px; right: 8px; font-size: .9rem; }
.carta.fixa { cursor: default; background: #fff; border-style: double; border-width: 6px; }
.carta.a-arrastar { opacity: .3; }
.carta.selecionada { box-shadow: 0 0 0 4px #1a1a1a; }
.fantasma { position: fixed; z-index: 10; pointer-events: none; box-shadow: 0 12px 24px rgba(0,0,0,.25); }
.marcador { width: 8px; height: 212px; border-radius: 4px; background: #1a1a1a; flex: none; }

.audio { width: 38px; height: 38px; border-radius: 50%; border: 2px solid #1a1a1a; background: #fff; cursor: pointer; font-size: 1rem; line-height: 1; padding: 0; }
.sem-audio .audio { display: none; }

/* Casas numeradas com seta (discalculia: a direção não depende de contar). */
.numero { position: absolute; top: -14px; left: -10px; background: #1a1a1a; color: #fff; border-radius: 999px; padding: 0 .5rem; font-size: .85rem; font-weight: 700; line-height: 1.7; white-space: nowrap; z-index: 1; }
.casa-vazia { position: relative; width: 158px; height: 212px; flex: none; border: 3px dashed #8a8579; border-radius: 14px; background: #faf8f3; }
.casa-vazia .numero { top: 50%; left: 50%; transform: translate(-50%, -50%); background: transparent; color: #5f5a50; font-size: 2rem; }

.ctrl { position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%); display: flex; gap: 4px; z-index: 2; }
.ctrl button { min-width: 42px; height: 42px; border-radius: 999px; border: 3px solid #1a1a1a; background: #fff; cursor: pointer; font-size: .9rem; white-space: nowrap; padding: 0 .5rem; }

/* Resultado: não depende só da cor. Certo = borda contínua + ✓; erro = borda tracejada + ✗. */
.carta.a-ver { outline: 5px solid #1a1a1a; outline-offset: 3px; transform: translateY(-8px); }
.carta.ok { border: 5px solid var(--certo); }
.carta.ok::after { content: "✓"; position: absolute; top: -14px; right: -10px; background: var(--certo); color: #fff; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; border: 2px solid #fff; }
.carta.falhou { border: 5px dashed var(--erro); background: #FDECEA; }
.carta.falhou::after { content: "✗"; position: absolute; top: -14px; right: -10px; background: var(--erro); color: #fff; width: 30px; height: 30px; border-radius: 6px; display: grid; place-items: center; font-weight: 700; border: 2px dashed #fff; }

.acoes { display: flex; gap: .8rem; flex-wrap: wrap; margin: 1.2rem 0 .6rem; }
.botao { font-weight: 700; border: 3px solid #1a1a1a; border-radius: 999px; padding: .75rem 1.5rem; background: var(--cor); color: #fff; cursor: pointer; text-decoration: none; display: inline-block; }
.botao.grande { font-size: 1.25rem; padding: .85rem 2rem; }
.botao.pequeno { font-size: .9rem; padding: .3rem .9rem; }
.botao.secundario { background: #fff; color: var(--tinta); }
.botao:disabled { opacity: .55; cursor: default; }

.mensagem { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin: .7rem 0; padding: .9rem 1.1rem; border-radius: 14px; font-size: 1.1rem; background: #fff; }
.mensagem .msg-texto { margin: 0; flex: 1; min-width: 220px; }
.mensagem .msg-desafio { margin: 0; flex-basis: 100%; font-size: 1rem; }
.mensagem.sucesso { border: 4px solid var(--certo); }
.mensagem.falha { border: 4px dashed var(--erro); }

/* Glossário visual */
.glossario.painel { max-width: 1240px; margin: .8rem auto 0; padding: 0 1.4rem; }
.glossario h2 { font-size: 1.15rem; margin: .6rem 0; }
.palavras { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .6rem; }
.palavra { display: flex; align-items: center; gap: .6rem; background: var(--creme); border: 3px solid var(--cor); border-radius: 12px; padding: .5rem .7rem; }
.palavra .emoji { font-size: 2rem; }
.palavra .palavra-texto { flex: 1; font-size: 1.1rem; }
.glossarios { max-width: 1200px; margin: 0 auto; padding: .6rem 1.4rem 2rem; }

/* Aviso antes da tarefa de emergência */
.aviso-jogo { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: grid; place-items: center; z-index: 20; padding: 1rem; }
.aviso-jogo[hidden] { display: none; }
.aviso-caixa { background: #fff; border: 4px solid #1a1a1a; border-radius: 18px; padding: 1.4rem 1.6rem; max-width: 460px; }
.aviso-emoji { font-size: 2.6rem; margin: 0; }
.aviso-caixa h2 { margin: .2rem 0 .4rem; }

@media (max-width: 640px) {
  body { font-size: 18px; }
  .carta, .casa-vazia { width: 136px; height: 196px; }
  .carta.com-traducao { height: auto; min-height: 196px; }
  .marcador { height: 196px; }
}
/* Sem animações para quem as prefere desligadas. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .carta.a-ver { transform: none; }
}
[hidden], .mensagem[hidden], .aviso-lingua[hidden] { display: none !important; }

/* Conversa final (debriefing), para projetar: um cartão grande de cada vez. */
.conversa-palco { max-width: 1000px; margin: 0 auto; padding: 1.5rem 1.4rem 2rem; }
.cartao-conversa { background: var(--creme); border: 8px solid #3d3d3d; border-radius: 28px; padding: 2rem 2.4rem; min-height: 56vh; display: flex; flex-direction: column; gap: .8rem; }
.cc-topo { display: flex; justify-content: space-between; align-items: center; }
.cc-emoji { font-size: 4.5rem; line-height: 1; }
.cc-tempo { font-size: 1.3rem; font-weight: 600; }
.cartao-conversa h2 { font-size: clamp(2rem, 4.5vw, 3.2rem); line-height: 1.25; margin: 0; }
.cc-pista { font-size: clamp(1.4rem, 2.8vw, 2rem); margin: 0; }
.cc-como { font-size: 1.3rem; margin: .6rem 0 0; }
.cc-audio .audio { width: 64px; height: 64px; font-size: 1.8rem; }
.cc-prof { margin-top: auto; font-size: 1rem; color: #333; border-top: 2px solid #ccc; padding-top: .5rem; }
.conversa-acoes { justify-content: space-between; }

/* «Começar de novo»: longe de «Experimentar» e com confirmação (IN3, IN5). */
.recomecar-zona { display: flex; justify-content: flex-end; margin: 2.4rem 0 .4rem; padding-top: 1rem; border-top: 2px dashed #ccc; }
.confirmar-botoes { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1rem; }
.zona-extra { margin: .5rem 0 0; }

/* Painel do professor: fechado por omissão, no fim da página. */
.painel-professor { max-width: 1240px; margin: 1rem auto 2rem; padding: 0 1.4rem; font-size: .92rem; }
.painel-professor > summary { cursor: pointer; font-weight: 700; padding: .6rem 1rem; background: #fff; border: 3px solid #1a1a1a; border-radius: 12px; list-style: none; display: inline-block; }
.painel-professor > summary::-webkit-details-marker { display: none; }
.painel-professor > summary::before { content: "▸ "; }
.painel-professor[open] > summary::before { content: "▾ "; }
.painel-corpo { background: #fff; border: 3px solid #1a1a1a; border-radius: 12px; padding: .8rem 1rem; margin-top: .5rem; }
.painel-grupos { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.painel-corpo fieldset { border: 2px solid #ccc; border-radius: 10px; display: grid; gap: .45rem; align-content: start; }
.painel-corpo legend { font-weight: 700; padding: 0 .3rem; }
.painel-corpo label { display: flex; align-items: center; gap: .4rem; cursor: pointer; }
.painel-corpo label:has(input[type=text]) { flex-wrap: wrap; }
.painel-corpo input[type=checkbox] { flex: none; }
.painel-corpo input[type=checkbox] { width: 22px; height: 22px; }
.painel-corpo select, .painel-corpo input[type=text] { font: inherit; padding: .2rem .4rem; }
.painel-links { display: flex; flex-wrap: wrap; gap: 1.2rem; font-weight: 600; margin: .8rem 0 0; }
.aviso-audio { padding: .5rem .8rem; border-radius: 10px; border: 3px solid var(--certo); background: #eef3fb; margin: .4rem 0 .8rem; }
.aviso-audio.alerta { border: 3px dashed #7A5C00; background: #FFF1C2; font-weight: 600; }

/* Pista «precisa de»: símbolos a preto sobre branco, iguais aos do papel. */
.carta .simbolo-pista { position: absolute; top: 22px; right: 8px; background: #fff; border: 2px solid #1a1a1a; border-radius: 8px; padding: 0 .35rem; font-size: 1.05rem; font-weight: 700; line-height: 1.5; }
.carta .precisa-pista { margin-top: .3rem; font-size: .8rem; background: #fff; border: 2px dashed #1a1a1a; border-radius: 8px; padding: 0 .4rem; }
.carta .precisa-pista b { font-size: 1.05rem; }
.mensagem .pista { flex-basis: 100%; display: flex; gap: .6rem; align-items: center; border-top: 2px dashed #999; padding-top: .5rem; }
.mensagem .pista b { font-size: 1.25rem; }

/* Página inicial: ligações para a criança e para o professor separadas (IN4). */
.rodape-grupos { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); max-width: 1200px; margin: 0 auto; padding: 1rem 1.4rem 2rem; }
.rodape-grupo { border-radius: 14px; padding: .6rem 1rem 1rem; background: #fff; border: 3px solid #1a1a1a; }
.rodape-grupo.professor { background: #f7f7f7; border-style: dashed; }
.rodape-grupo h2 { font-size: 1.05rem; margin: .2rem 0 .5rem; }
.rodape-grupo nav { display: flex; flex-direction: column; gap: .5rem; font-weight: 600; }

/* Páginas do professor (como usar, teste de áudio). */
.pagina-texto { max-width: 900px; margin: 0 auto; padding: 1rem 1.4rem 3rem; }
.pagina-texto h2 { margin: 1.6rem 0 .4rem; font-size: 1.3rem; }
.pagina-texto li { margin: .25rem 0; }
.pagina-texto table { border-collapse: collapse; width: 100%; font-size: .9rem; background: #fff; }
.pagina-texto th, .pagina-texto td { border: 1px solid #bbb; padding: .3rem .5rem; text-align: left; vertical-align: top; }
.pagina-texto code { background: #fff; border: 1px solid #ccc; border-radius: 4px; padding: 0 .25rem; font-size: .9em; }
.estado-ok { font-weight: 700; color: var(--certo); }
.estado-falta { color: #5f5a50; }
.indice { display: flex; flex-wrap: wrap; gap: .4rem 1rem; background: #fff; border: 2px solid #ccc; border-radius: 10px; padding: .5rem .8rem; }
