/* Jogos dos pequenos (1º ao 5º ano): figuras grandes, botões grandes, sem texto para ler no 1º ao 3º ano.
   Usado com material-didatico/assets/pequenos.js e figuras.js. */
.pq { --pq-cel: 92px; --pq-fig: 96px; position: relative; border: 2px solid var(--ink); border-radius: var(--radius); background: var(--paper);
  padding: 14px; box-shadow: 4px 4px 0 var(--ink); user-select: none; -webkit-user-select: none; }
.pq svg.fg { display: block; width: 100%; height: 100%; overflow: visible; }
.pq-barra { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.pq-fases { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.pq-fase { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--ink); background: var(--paper); padding: 0; cursor: pointer; }
.pq-fase.feita { background: #ffd84d; }
.pq-fase[aria-current="true"] { outline: 3px solid var(--accent); outline-offset: 2px; }
.pq-fase svg { width: 100%; height: 100%; }
.pq-bt { width: 56px; height: 56px; border-radius: 18px; border: 2px solid var(--ink); background: var(--paper); cursor: pointer; padding: 6px;
  display: inline-grid; place-items: center; box-shadow: 2px 2px 0 var(--ink); flex: none; }
.pq-bt:hover { background: var(--pill); }
.pq-bt:active { transform: translate(2px, 2px); box-shadow: none; }
.pq-bt[aria-pressed="false"] { opacity: .5; }
.pq-bt.grande { width: 84px; height: 84px; border-radius: 24px; }
.pq-bt.ok { background: #c6ebd4; }
.pq-palco { min-height: 320px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.pq-linha { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; align-items: center; }
.pq-carta { width: var(--pq-fig); height: var(--pq-fig); border: 2px solid var(--ink); border-radius: 20px; background: #fff; padding: 8px; cursor: pointer;
  box-shadow: 3px 3px 0 var(--ink); transition: transform .15s, opacity .2s; display: grid; place-items: center; flex: none; color: #111; font: 800 28px var(--display); }
.pq-carta:hover { transform: translateY(-3px); }
.pq-carta.usada { opacity: .25; pointer-events: none; }
.pq-carta.certa { background: #c6ebd4; }
.pq-carta.par1 { background: #ffe9a8; } .pq-carta.par2 { background: #cfe6fb; } .pq-carta.par3 { background: #f9d2df; }
.pq-carta.par4 { background: #dcefc9; } .pq-carta.par5 { background: #e6dcf7; } .pq-carta.par6 { background: #ffd9bd; }
.pq-carta.sel { outline: 4px solid var(--accent); outline-offset: 3px; }
.pq-carta.txt { width: auto; min-width: var(--pq-fig); height: auto; min-height: 64px; padding: 10px 16px; font: 600 17px/1.3 var(--body); text-align: center; max-width: 320px; }
.pq-carta.fila { width: auto; display: flex; gap: 6px; padding: 8px 10px; }
.pq-carta.fila svg.fg { width: 52px; height: 52px; }
.pq-carta.sombra svg.fg { filter: brightness(0); }
.pq-vaga { width: var(--pq-fig); height: var(--pq-fig); border: 3px dashed var(--ink-3); border-radius: 20px; display: grid; place-items: center; padding: 8px;
  position: relative; background: var(--paper-2); flex: none; }
.pq-vaga.cheia { border-style: solid; border-color: var(--ink); background: #fff; cursor: pointer; }
.pq-vaga .pq-num { position: absolute; top: -12px; left: -10px; display: flex; gap: 2px; background: var(--paper); border-radius: 99px; padding: 2px 4px; }
.pq-vaga .pq-num i { width: 8px; height: 8px; border-radius: 50%; background: var(--ink); display: block; }
.pq-seta-entre { width: 26px; height: 26px; flex: none; opacity: .6; }
.pq-quadro { border: 2px solid var(--ink); border-radius: 22px; background: #fffbe6; padding: 12px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  align-items: center; max-width: 100%; color: #111; }
.pq-quadro svg.fg { width: 70px; height: 70px; }
.pq-quadro.balao { background: #fff; border-radius: 26px 26px 26px 6px; }
.pq-quadro .op { font: 800 22px var(--display); padding: 0 4px; }
.pq-caixas { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.pq-caixa { width: 128px; min-height: 128px; border: 3px solid var(--ink); border-radius: 0 0 26px 26px; border-top-width: 6px; background: var(--paper-2);
  display: flex; flex-direction: column; align-items: center; padding: 8px; cursor: pointer; gap: 6px; }
.pq-caixa:hover { background: var(--pill); }
.pq-caixa .rot { width: 64px; height: 64px; }
.pq-caixa .rot.swatch { border: 2px solid var(--ink); border-radius: 50%; }
.pq-caixa .dentro { display: flex; flex-wrap: wrap; gap: 2px; justify-content: center; }
.pq-caixa .dentro svg.fg { width: 26px; height: 26px; }
.pq-atual { width: 120px; height: 120px; animation: pq-entra .35s ease; }
@keyframes pq-entra { from { transform: translateY(-30px) scale(.6); opacity: 0; } }
.pq-treme { animation: pq-treme .45s; }
@keyframes pq-treme { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-9px); } 40% { transform: translateX(9px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(6px); } }
.pq-dica { animation: pq-dica 1s ease 3; }
@keyframes pq-dica { 50% { box-shadow: 0 0 0 10px rgba(255, 216, 77, .9); transform: scale(1.06); } }

/* grade do personagem */
.pq-grade { display: grid; gap: 0; border: 2px solid var(--ink); border-radius: 16px; overflow: hidden; background: #eaf6e4; position: relative;
  width: min(100%, calc(var(--pq-cel) * var(--cols))); aspect-ratio: var(--cols) / var(--rows); }
.pq-grade .cel { border-right: 1px dashed rgba(0, 0, 0, .15); border-bottom: 1px dashed rgba(0, 0, 0, .15); display: block; padding: 8%; min-width: 0; min-height: 0; }
.pq-grade .cel.toque { cursor: pointer; }
.pq-grade .cel.toque:hover { background: rgba(255, 216, 77, .4); }
.pq-grade .cel.pego svg { opacity: .15; }
.pq-grade .cel.rastro { background: rgba(124, 188, 240, .25); }
.pq-boneco { position: absolute; display: block; padding: 4px; transition: left .3s ease, top .3s ease; pointer-events: none; z-index: 2; }
.pq-boneco .dir { position: absolute; width: 34%; height: 34%; transition: transform .2s; }
.pq-boneco.bateu { animation: pq-treme .45s; }
.pq-cmds { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.pq-prog { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; min-height: 70px; min-width: min(100%, 420px); border: 3px dashed var(--ink-3);
  border-radius: 18px; padding: 8px; background: var(--paper-2); justify-content: flex-start; }
.pq-prog.fixo { border-style: solid; background: #fff; }
.pq-blk { width: 52px; height: 52px; border: 2px solid var(--ink); border-radius: 12px; background: #fff; padding: 4px; cursor: pointer; position: relative; flex: none; }
.pq-blk.ativo { outline: 4px solid #ffd84d; outline-offset: 2px; }
.pq-blk .vezes { position: absolute; right: -8px; top: -10px; background: var(--ink); color: var(--paper); border-radius: 99px; min-width: 24px; height: 24px;
  display: flex; gap: 2px; align-items: center; justify-content: center; padding: 0 5px; }
.pq-blk .vezes i { width: 5px; height: 5px; border-radius: 50%; background: var(--paper); display: block; }
.pq-laco { display: flex; align-items: center; gap: 4px; border: 2px solid var(--ink); border-radius: 14px; padding: 4px 6px; background: #fff1c9; }
.pq-laco.aberto { border-style: dashed; }
.pq-laco > .n { font: 800 18px var(--display); padding: 0 4px; color: #111; }
.pq-partes { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.pq-partes .pq-prog { min-height: 0; padding: 4px; }
.pq-partes .pq-blk { width: 36px; height: 36px; }
.pq-cores { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.pq-cor { width: 58px; height: 58px; border-radius: 50%; border: 3px solid var(--ink); cursor: pointer; }
.pq-cor[aria-pressed="true"] { outline: 4px solid var(--ink); outline-offset: 3px; }
.pq-pixels { display: grid; gap: 3px; }
.pq-pixels button { width: var(--pq-px, 44px); height: var(--pq-px, 44px); border: 2px solid #111; border-radius: 6px; background: #fff; padding: 5px; cursor: pointer; color: #111;
  font: 800 16px var(--body); }
.pq-pixels .vazio { width: var(--pq-px, 44px); height: var(--pq-px, 44px); }
.pq-legenda { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.pq-legenda span { display: flex; align-items: center; gap: 6px; border: 2px solid var(--ink); border-radius: 99px; padding: 4px 10px 4px 4px; background: #fff; color: #111; font: 800 18px var(--body); }
.pq-legenda svg.fg { width: 34px; height: 34px; }
.pq-legenda i { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #111; display: block; }
.pq-colunas { display: grid; grid-template-columns: auto auto; gap: 14px 60px; }
.pq-vence { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(255, 255, 255, .85); border-radius: var(--radius); z-index: 5; }
.pq-vence .estrelao { width: 160px; height: 160px; animation: pq-gira .8s ease; }
@keyframes pq-gira { from { transform: scale(.2) rotate(-180deg); } }
.pq-fim { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.pq-fim .estrelas { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; max-width: 420px; }
.pq-fim .estrelas svg { width: 44px; height: 44px; }
.pq-pergunta { font: 600 19px/1.35 var(--body); text-align: center; max-width: 640px; margin: 0; }
.pq[data-leitura="0"] .pq-pergunta { display: none; }
.pq-oculta { visibility: hidden; }
@media (max-width: 560px) {
  .pq { --pq-cel: 64px; --pq-fig: 72px; padding: 10px; }
  .pq-caixa { width: 100px; min-height: 104px; }
  .pq-caixa .rot { width: 48px; height: 48px; }
  .pq-colunas { gap: 12px 30px; }
  .pq-bt { width: 50px; height: 50px; }
}
@media (prefers-reduced-motion: reduce) { .pq * { animation: none !important; transition: none !important; } }
.game-stage > .pq { border: 0; box-shadow: none; padding: 0; }

/* coordenadas */
.pq-coord { display: grid; grid-template-columns: 32px repeat(var(--cols), minmax(0, var(--pq-cel))); gap: 0; width: max-content; max-width: 100%; }
.pq-coord .rot { display: grid; place-items: center; font: 700 18px var(--body); color: var(--ink-2); min-height: 32px; }
.pq-coord .cel { aspect-ratio: 1; border: 1px solid #999; background: #fff; padding: 8%; display: block; min-width: 0; }
.pq-coord button.cel { cursor: pointer; }
.pq-coord button.cel:hover { background: #fff1b8; }
.pq-coord .cel svg { width: 100%; height: 100%; display: block; }
.pq-coord-pede { display: flex; align-items: center; gap: 10px; font: 700 34px var(--body); }
.pq-coord-pede svg { width: 52px; height: 52px; }
.pq-coord-pede i { width: 44px; height: 44px; border: 2px solid var(--ink); border-radius: 10px; display: block; }
/* binário */
.pq-bin-alvo { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.pq-bin-alvo b { font: 700 44px var(--body); }
.pq-bin-alvo span { display: flex; flex-wrap: wrap; gap: 4px; max-width: 260px; justify-content: center; }
.pq-bin-alvo i, .pq-bin .pts i { width: 12px; height: 12px; border-radius: 50%; background: var(--ink); display: block; }
.pq-bin { width: 92px; height: 120px; border: 3px solid var(--ink); border-radius: 16px; background: #555; cursor: pointer; display: flex; flex-direction: column;
  align-items: center; justify-content: space-between; padding: 10px 6px; color: #fff; }
.pq-bin .pts { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; visibility: hidden; }
.pq-bin b { font: 700 28px var(--body); color: #fff; }
.pq-bin.on b { color: var(--ink); }
.pq-bin.on { background: #fff8dc; color: var(--ink); }
.pq-bin.on .pts { visibility: visible; }
.pq-bin-soma { font: 700 22px var(--body); letter-spacing: 2px; }
/* rgb */
.pq-rgb { width: 130px; height: 130px; border: 3px solid var(--ink); border-radius: 18px; background: #000; }
.pq-rgb.alvo { border-style: dashed; }
.pq-rgb-igual { font: 800 34px var(--display); }
.pq-luz { position: relative; }
.pq-luz .nv { position: absolute; right: -6px; top: -8px; background: var(--ink); color: var(--paper); border-radius: 99px; min-width: 24px; height: 24px; font: 700 14px/24px var(--body); }
@media (max-width: 560px) { .pq-bin { width: 70px; height: 100px; } .pq-rgb { width: 100px; height: 100px; } }
/* ficha (registro) */
.pq-ficha { background: #fff; border: 2px solid var(--ink); border-radius: 14px; padding: 10px 12px; color: #111; }
.pq-ficha table { border-collapse: collapse; font: 600 16px/1.3 var(--body); margin: 0 auto; }
.pq-ficha th, .pq-ficha td { border: 1px solid #bbb; padding: 4px 10px; text-align: left; }
.pq-ficha th { background: #fff1b8; }
.pq-carta.txt .pq-ficha { border: 0; padding: 0; }

/* grafo */
.pq-grafo { position: relative; width: min(100%, 520px); aspect-ratio: 4 / 3; border: 2px solid var(--ink); border-radius: 18px; background: #f3faf5; }
.pq-grafo svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.pq-grafo line { stroke: #888; stroke-width: 1.4; stroke-linecap: round; vector-effect: non-scaling-stroke; stroke-width: 5px; }
.pq-grafo line.rota, .pq-grafo line.feita { stroke: var(--accent, #2f8f5b); stroke-width: 9px; }
.pq-vert { position: absolute; width: 64px; height: 64px; margin: -32px 0 0 -32px; border: 3px solid var(--ink); border-radius: 50%; background: #fff; padding: 8px; cursor: pointer; }
.pq-vert svg { width: 100%; height: 100%; display: block; }
.pq-vert b { font: 700 22px var(--body); }
.pq-vert i { position: absolute; right: -10px; bottom: -8px; background: var(--ink); color: #fff; font: 700 13px/20px var(--body); font-style: normal; border-radius: 99px; min-width: 20px; padding: 0 4px; }
.pq-vert.rota { background: #c6ebd4; }
.pq-vert.destino { outline: 4px dashed #ffd84d; outline-offset: 3px; }
.pq-vert.sel { outline: 4px solid var(--accent, #2f8f5b); outline-offset: 3px; }
@media (max-width: 560px) { .pq-vert { width: 48px; height: 48px; margin: -24px 0 0 -24px; padding: 5px; } }
/* regra se/então/senão */
.pq-regra { display: flex; flex-direction: column; gap: 6px; border: 2px solid var(--ink); border-radius: 18px; padding: 10px 14px; background: #fff; }
.pq-regra .linha { display: flex; align-items: center; gap: 10px; }
.pq-regra .linha > b { font: 700 18px var(--body); min-width: 70px; }
.pq-regra .pq-quadro { padding: 6px; border-radius: 14px; }
.pq-regra .pq-quadro svg.fg { width: 44px; height: 44px; }
.pq-txt { display: inline-grid; place-items: center; min-width: 1.6em; font: 700 22px/1.2 var(--body); color: #111; text-align: center; }
.pq-atual .pq-txt { width: 100%; height: 100%; font-size: 30px; border: 2px solid var(--ink); border-radius: 18px; background: #fff; padding: 6px; }
.pq-caixa .dentro .pq-txt { font-size: 13px; min-width: 0; }
.pq-vaga .pq-txt { width: 100%; height: 100%; }
