/* Eu Quero — a prancha de comunicação. Fundo calmo, cartões grandes e brancos com a borda na cor do grupo,
   nada piscando. O tamanho do cartão (--lado) é calculado pelo jogo.js para caber o maior possível. */

:root {
  --fundo: #eef3f8;
  --tinta: #1d2a38;
  --suave: #5b6b7c;
  --azul: #2563a8;
  --linha: #d3dde7;
  --lado: 160px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--fundo); color: var(--tinta); }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  touch-action: manipulation;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
  overflow: hidden;
}
button { font: inherit; color: inherit; }

#app { height: 100%; display: flex; flex-direction: column; }

#topo {
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 10px;
  min-height: 46px;
}
.titulo { font-weight: 700; color: var(--suave); font-size: 15px; letter-spacing: .02em; }
.botoes { display: flex; gap: 6px; }
.icone {
  position: relative;
  width: 40px; height: 40px; border-radius: 12px;
  border: 1px solid var(--linha); background: #fff;
  font-size: 19px; line-height: 1; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--suave);
}
/* o dedo que segura o ⚙ não pode virar rolagem (o navegador cancelaria o "segurar") */
.ajustes { touch-action: none; }
.ajustes .anel { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); pointer-events: none; }
.ajustes .anel circle { fill: none; stroke: var(--azul); stroke-width: 3; stroke-dasharray: 107; stroke-dashoffset: 107; }
.ajustes.segurando .anel circle { transition: stroke-dashoffset 1.2s linear; stroke-dashoffset: 0; }

#prancha {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  justify-content: center;
  align-content: center;
  gap: 12px;
  padding: 4px 12px 14px;
}

.cartao {
  width: var(--lado);
  height: calc(var(--lado) * 1.18);
  border: calc(var(--lado) * .035 + 2px) solid var(--cor, #3b82c4);
  border-radius: calc(var(--lado) * .1 + 6px);
  background: #fff;
  box-shadow: 0 2px 0 rgba(30, 50, 70, .08);
  padding: calc(var(--lado) * .06) calc(var(--lado) * .06) calc(var(--lado) * .04);
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  cursor: pointer;
  transition: transform .08s ease-out;
}
.cartao:active { transform: scale(.97); }
.cartao.tocado { box-shadow: 0 0 0 6px rgba(37, 99, 168, .35); }
.cartao .fig { flex: 1 1 auto; width: 100%; min-height: 0; display: flex; align-items: center; justify-content: center; }
.cartao .fig svg, .cartao .fig img { width: 100%; height: 100%; object-fit: contain; display: block; }
.cartao .palavra {
  flex: 0 0 auto;
  font-weight: 800;
  font-size: clamp(14px, calc(var(--lado) * .15), 44px);
  line-height: 1.15;
  margin-top: 2px;
  white-space: nowrap;
}

.dica {
  position: fixed; left: 50%; top: 52px; transform: translateX(-50%);
  background: #1d2a38; color: #fff; padding: 8px 14px; border-radius: 10px; font-size: 14px;
  margin: 0; z-index: 30; max-width: 90vw; text-align: center;
}

/* ---- Camadas por cima da prancha ---- */
.camada {
  position: fixed; inset: 0; z-index: 20;
  display: flex; align-items: center; justify-content: center;
  background: rgba(15, 30, 50, .55);
  padding: 14px;
}
.camada[hidden] { display: none; }
.camada.clara { background: rgba(238, 243, 248, .97); align-items: flex-start; overflow-y: auto; }

/* O pedido grande */
/* Bem maior que o cartão da prancha (que já é o maior possível): quase a tela toda, para o adulto ver de longe. */
.grande {
  width: min(92vw, 600px); height: min(84vh, calc(92vw * 1.3), 680px);
  background: #fff;
  border: 10px solid var(--cor, #3b82c4);
  border-radius: 28px;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: 18px 14px 12px;
  animation: crescer .18s ease-out;
}
.grande .figura { flex: 1 1 auto; width: 100%; min-height: 0; display: flex; align-items: center; justify-content: center; }
.grande .figura svg, .grande .figura img { width: 100%; height: 100%; object-fit: contain; }
.grande .frase { margin: 6px 0 0; font-size: clamp(22px, 7.5vmin, 52px); font-weight: 800; text-align: center; line-height: 1.15; }
@keyframes crescer { from { transform: scale(.7); opacity: .4; } to { transform: scale(1); opacity: 1; } }

/* Os painéis do adulto */
.folha {
  width: 100%; max-width: 560px;
  background: #fff; border: 1px solid var(--linha); border-radius: 18px;
  padding: 16px 16px 12px; margin: auto 0;
  -webkit-user-select: text; user-select: text;
}
.folha.larga { max-width: 760px; }
.folha h2 { margin: 0 0 10px; font-size: 20px; color: var(--azul); }
.folha h3 { margin: 16px 0 6px; font-size: 15px; }
.folha p { margin: 0 0 8px; line-height: 1.45; font-size: 15px; }
.explica { color: var(--suave); font-size: 13.5px !important; }
.explica.pequeno { font-size: 12.5px !important; margin-top: 8px !important; }
.conta { color: var(--suave); font-weight: 600; font-size: 13px; }
.aviso { color: #a8670b; font-size: 13.5px; min-height: 1em; margin: 6px 0 0 !important; }

.rodape { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.principal, .secundario, .atalhos button, .opcoes button {
  border-radius: 12px; padding: 10px 16px; font-weight: 700; cursor: pointer; font-size: 15px;
}
.principal { background: var(--azul); color: #fff; border: 1px solid var(--azul); }
.secundario { background: #fff; color: var(--azul); border: 1px solid var(--linha); }

.atalhos { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; font-size: 14px; color: var(--suave); }
.atalhos button { background: #fff; border: 1px solid var(--linha); padding: 6px 14px; color: var(--tinta); }

.opcoes { display: flex; flex-wrap: wrap; gap: 6px; }
.opcoes button { background: #fff; border: 1px solid var(--linha); padding: 8px 12px; font-weight: 600; color: var(--tinta); }
.opcoes button[aria-pressed="true"] { background: #e6f0fa; border-color: var(--azul); color: var(--azul); box-shadow: inset 0 0 0 1px var(--azul); }

.mini-lista, .escolhidos { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 10px; }
.mini {
  display: flex; flex-direction: column; align-items: center;
  width: 84px; padding: 6px 4px 4px; border-radius: 12px; background: #fff;
  border: 3px solid var(--cor, #3b82c4); font-size: 12.5px; font-weight: 700;
}
.mini .fig { width: 54px; height: 54px; }
.mini .fig svg, .mini .fig img { width: 100%; height: 100%; object-fit: contain; }
.mini .mover { display: flex; gap: 4px; margin-top: 3px; }
.mini .mover button { border: 1px solid var(--linha); background: #f6f9fc; border-radius: 8px; width: 30px; height: 26px; cursor: pointer; font-size: 12px; padding: 0; }
.mini .mover button:disabled { opacity: .3; cursor: default; }
.mini .pos { font-size: 11px; color: var(--suave); font-weight: 600; }

.grupo-titulo { display: flex; align-items: center; gap: 6px; margin: 10px 0 4px; font-size: 13.5px; font-weight: 700; color: var(--suave); }
.grupo-titulo i { width: 12px; height: 12px; border-radius: 50%; background: var(--cor); display: inline-block; }
.grupo-cartoes { display: flex; flex-wrap: wrap; gap: 8px; }
.escolha {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  width: 84px; padding: 6px 4px 4px; border-radius: 12px; background: #fff;
  border: 2px dashed var(--linha); font-size: 12.5px; font-weight: 700; cursor: pointer; color: var(--suave);
}
.escolha .fig { width: 54px; height: 54px; opacity: .55; }
.escolha .fig svg, .escolha .fig img { width: 100%; height: 100%; object-fit: contain; }
.escolha[aria-pressed="true"] { border: 3px solid var(--cor); color: var(--tinta); background: #fff; }
.escolha[aria-pressed="true"] .fig { opacity: 1; }
.escolha .num {
  position: absolute; top: -8px; right: -6px; min-width: 22px; height: 22px; border-radius: 11px;
  background: var(--cor); color: #fff; font-size: 12px; line-height: 22px; text-align: center; padding: 0 5px;
}

@media (prefers-reduced-motion: reduce) {
  .grande { animation: none; }
  .cartao { transition: none; }
  .ajustes.segurando .anel circle { transition: none; }
}
