/* Quebra-cabeças do Gemalino — visual próprio do jogo (o comum está em base.css). */
:root { --tema: #ffb74d; --tema-escuro: #e08a1e; }

/* 1. escolher a figura: 12 miniaturas, 4 por linha */
.qc-menu {
  display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: minmax(var(--alvo), 1fr); gap: 10px;
  overflow-y: auto; touch-action: pan-y; /* em tela muito baixa as figuras rolam, em vez de sumir */
}
.qc-miniatura {
  position: relative; min-width: var(--alvo); min-height: var(--alvo); border: 5px solid var(--branco); border-radius: 18px;
  background: #cfe9f7 center / cover no-repeat; box-shadow: var(--sombra); padding: 0;
}
.qc-miniatura:active { transform: translateY(3px); }
.qc-estrela { position: absolute; top: 2px; right: 6px; font-size: 30px; text-shadow: 0 0 4px #fff; }

/* 2. quantas peças */
.qc-tamanho { align-items: center; gap: 3vw; }
.qc-previa { flex: 1 1 50%; min-width: 0; display: grid; place-items: center; height: 100%; }
.qc-previa img { max-width: 100%; max-height: 100%; border: 6px solid var(--branco); border-radius: 18px; box-shadow: var(--sombra); }
.qc-opcoes { flex: 0 0 auto; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.qc-opcao {
  width: clamp(var(--alvo), 16vw, 170px); height: clamp(var(--alvo), 16vw, 170px); border: 0; border-radius: var(--raio);
  background: var(--branco); box-shadow: var(--sombra); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
}
.qc-grade { display: grid; gap: 3px; width: 56%; aspect-ratio: 4 / 3; }
.qc-grade i { background: var(--tema); border-radius: 4px; }
.qc-numero { font-size: clamp(22px, 3vw, 34px); font-weight: bold; color: var(--azul); line-height: 1; }

/* 3. montar: tabuleiro à esquerda, bandeja à direita; as peças ficam soltas por cima */
.qc-montar { display: block; touch-action: none; }
.qc-tabuleiro {
  position: absolute; background: var(--branco); border-radius: 10px; box-shadow: 0 0 0 5px var(--branco), var(--sombra); overflow: hidden;
}
.qc-guia { width: 100%; height: 100%; opacity: 0.22; filter: grayscale(0.6); }
.qc-guia.inteira { opacity: 1; filter: none; }
.qc-brilho {
  position: absolute; border: 6px solid var(--amarelo); border-radius: 10px; background: rgba(255, 213, 79, 0.35);
  animation: brilhar 1.3s ease-in-out 2; pointer-events: none;
}
.qc-brilho[hidden] { display: none; }
.qc-bandeja {
  position: absolute; top: 0; bottom: 0; border-radius: var(--raio); background: rgba(255, 253, 247, 0.9);
  border: 4px dashed var(--tema);
}
.qc-peca {
  position: absolute; left: 0; top: 0; transform-origin: center; touch-action: none; cursor: grab; z-index: 2;
  filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.3));
}
.qc-peca svg { width: 100%; height: 100%; display: block; pointer-events: none; overflow: visible; }
.qc-contorno { fill: none; stroke: rgba(255, 255, 255, 0.85); stroke-width: 2; }
.qc-peca.arrastando { cursor: grabbing; z-index: 5; }
.qc-peca.volta { transition: transform 0.25s ease-out; animation: none; }
.qc-peca.entra svg { animation: entra 0.3s ease-out; }
.qc-peca.posta { z-index: 1; cursor: default; pointer-events: none; filter: none; }
.qc-peca.posta .qc-contorno { stroke: rgba(255, 255, 255, 0.35); stroke-width: 1; }

/* 4. completou */
.qc-video { position: absolute; inset: 0; width: 100%; height: 100%; background: #000; z-index: 6; }
.qc-tocar { position: absolute; z-index: 7; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.qc-fim {
  position: absolute; top: 0; bottom: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
}

@keyframes brilhar { 50% { background: rgba(255, 213, 79, 0.7); } }

@media (max-height: 460px) {
  .qc-menu { gap: 6px; }
  .qc-miniatura { border-width: 3px; }
  .qc-estrela { font-size: 22px; }
}
/* Celular deitado (ex.: 750 x 351): 12 figuras em 6 colunas x 2 fileiras cabem inteiras, sem rolar e com alvos de 90 px
   (em 4 colunas eram 3 fileiras e a de baixo passava do rodapé) */
@media (orientation: landscape) and (max-height: 460px) {
  .qc-menu { grid-template-columns: repeat(6, 1fr); }
}

/* nome escrito em cada cartão de escolha (qualidade: toda escolha mostra o nome; o adulto lê, a criança ouve) */
.rotulo-escolha { display: block; max-width: 100%; font-weight: 700; font-size: clamp(12px, 1.5vw, 16px); line-height: 1.15;
  color: #1f3b57; text-align: center; pointer-events: none; overflow-wrap: anywhere; }
.qc-miniatura { position: relative; }
.qc-miniatura .rotulo-escolha { position: absolute; left: 6px; right: 6px; bottom: 6px; padding: 2px 6px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.92); font-size: clamp(11px, 1.3vw, 14px); }
