:root {
  --navy: #14284c; --azul: #1e3a8a; --ouro: #c9a227; --ouro-claro: #f3dd94; --creme: #fffaf0;
  --texto: #14284c; --suave: #5b6880; --linha: #e3e8f3; --fundo: #f4f6fb;
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  color: var(--texto);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--fundo); -webkit-tap-highlight-color: transparent; }
button { font: inherit; cursor: pointer; color: inherit; }
a { color: var(--azul); }
.app { max-width: 560px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; padding-bottom: 32px; }
.carregando { display: grid; place-items: center; min-height: 100vh; }
.carregando img { border-radius: 20px; animation: pulsa 1.2s ease-in-out infinite; }
@keyframes pulsa { 50% { opacity: .5; transform: scale(.96); } }

/* entrada */
.entrada { min-height: 100vh; min-height: 100dvh; padding: 48px 22px 32px; text-align: center;
  background: radial-gradient(120% 70% at 50% 0%, #2a4a9a 0%, var(--navy) 60%); color: #fff; }
.entrada-logo { border-radius: 26px; box-shadow: 0 12px 40px #0006; }
.entrada h1 { margin: 18px 0 4px; font-size: 32px; letter-spacing: -.02em; }
.entrada-sub { margin: 0 0 28px; color: var(--ouro-claro); font-weight: 600; }
.cartao { background: #fff; color: var(--texto); border-radius: 20px; padding: 22px; text-align: left; box-shadow: 0 10px 30px #0003; }
.cartao label { display: block; font-weight: 700; margin-bottom: 10px; }
.cartao input { width: 100%; font: inherit; font-size: 17px; padding: 14px; border: 2px solid var(--linha); border-radius: 12px; outline: none; }
.cartao input:focus { border-color: var(--azul); }
.erro { color: #b42318; background: #fef3f2; border-radius: 10px; padding: 10px 12px; font-size: 14px; line-height: 1.45; }
.ajuda { font-size: 13px; color: var(--suave); line-height: 1.5; margin: 14px 0 0; }

.botao { display: block; width: 100%; margin-top: 14px; padding: 15px 16px; border: 0; border-radius: 14px;
  background: linear-gradient(105deg, #16a34a, #22c55e); color: #fff; font-weight: 800; font-size: 17px; box-shadow: 0 4px 0 #15803d; }
.botao:active { transform: translateY(2px); box-shadow: 0 2px 0 #15803d; }
.botao:disabled { opacity: .7; }
.botao.ok { background: var(--navy); box-shadow: 0 4px 0 #0b1730; }
.botao.sec { background: #fff; color: var(--navy); border: 2px solid var(--linha); box-shadow: none; font-size: 15px; padding: 12px; }
.botao.sec.ativo { border-color: #e11d48; color: #e11d48; }

/* topo */
.topo { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top)); background: var(--navy); color: #fff; }
.marca { display: flex; align-items: center; gap: 10px; }
.marca img { border-radius: 10px; }
.marca strong { display: block; font-size: 17px; }
.marca span { font-size: 12px; color: var(--ouro-claro); }
.topo-acoes { display: flex; gap: 8px; }
.icone { width: 38px; height: 38px; border-radius: 12px; border: 1px solid #ffffff33; background: #ffffff14; color: #fff; font-weight: 800; font-size: 17px; }
.aviso { margin: 12px 16px 0; padding: 12px 14px; border-radius: 14px; background: #fff7e0; border: 1px solid #f0d78a; font-size: 14px; line-height: 1.45; }
.aviso-link { display: inline-block; margin-top: 6px; font-weight: 800; color: var(--azul); }

.barra { display: flex; gap: 8px; padding: 12px 16px 6px; }
.barra input { flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--linha); background: #fff; outline: none; }
.barra input:focus { border-color: var(--azul); }
.fundo-btn { flex: none; border: 2px solid var(--linha); background: #fff; border-radius: 12px; padding: 0 12px; font-weight: 700; font-size: 13px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 8px 16px 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 9px 14px; border-radius: 999px; border: 1.5px solid var(--linha); background: #fff; font-weight: 700; font-size: 14px; white-space: nowrap; }
.chip.ativo { background: var(--navy); color: #fff; border-color: var(--navy); }

/* grade de figurinhas */
.grade { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0 16px; padding: 10px; border-radius: 18px; }
.fundo-claro { background: #eef1f7; }
.fundo-escuro { background: #1b2233; }
.fig { position: relative; aspect-ratio: 1; padding: 6px; border: 0; border-radius: 14px; background: transparent; }
.fundo-claro .fig { background: #fff; }
.fundo-escuro .fig { background: #262f45; }
.fig img { width: 100%; height: 100%; object-fit: contain; }
.fig:active { transform: scale(.96); }
.fav-tag { position: absolute; top: 4px; right: 6px; color: #e11d48; font-size: 13px; }
.vazio { grid-column: 1 / -1; text-align: center; color: var(--suave); padding: 30px 10px; }
.fundo-escuro .vazio { color: #c7cede; }
.rodape { text-align: center; color: var(--suave); font-size: 13px; margin: 16px; }

/* modal */
.modal { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center; background: #0b1428b3; }
.modal-caixa { position: relative; width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; background: #fff; border-radius: 22px 22px 0 0;
  padding: 18px 18px max(18px, env(safe-area-inset-bottom)); animation: sobe .2s ease-out; }
@keyframes sobe { from { transform: translateY(30px); opacity: 0; } }
.fechar { position: absolute; top: 10px; right: 12px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: #eef1f7; font-size: 22px; line-height: 1; }
.previa { margin: 26px 0 4px; border-radius: 18px; padding: 18px; display: grid; place-items: center; min-height: 260px; }
.previa img { width: 100%; max-width: 340px; max-height: 46vh; object-fit: contain; }
.modal-linha { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dica { font-size: 13px; color: var(--suave); line-height: 1.5; margin: 12px 2px 0; }
.ajuda-caixa h2 { margin: 6px 0 10px; }
.ajuda-caixa ol { padding-left: 20px; line-height: 1.6; }
.ajuda-caixa p { line-height: 1.55; }

.toast { position: fixed; left: 50%; bottom: max(22px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 30;
  width: calc(100% - 32px); max-width: 480px; padding: 13px 16px; border-radius: 14px; background: var(--navy); color: #fff; font-weight: 600; font-size: 14px; text-align: center; box-shadow: 0 10px 30px #0005; }
@media (min-width: 600px) {
  .modal { align-items: center; }
  .modal-caixa { border-radius: 22px; }
  .grade { grid-template-columns: repeat(4, 1fr); }
}
.icone.sair { width: auto; padding: 0 10px; font-size: 13px; }
