/* Brasilzinho · interface. Um tema só (o mapa é o "tabuleiro" azul-petróleo; os cartões são papel).
   Layout: mapa em tela cheia; no celular o painel sobe de baixo, no computador fica encostado à esquerda. */
:root {
  --mar: #0f4c5c;
  --mar-escuro: #0a3440;
  --papel: #fffaf2;
  --papel-2: #f6ecdc;
  --tinta: #2b2118;
  --tinta-suave: #6b5d50;
  --coral: #e4572e;
  --coral-escuro: #c4401b;
  --ouro: #ffcf3f;
  --verde: #16a06b;
  --linha: #e7dac5;
  --display: "Lilita One", "Arial Rounded MT Bold", system-ui, sans-serif;
  --ui: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --sombra: 0 10px 30px rgba(10, 52, 64, 0.28);
  --raio: 18px;
  --abas-h: 64px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; overflow: hidden; background: var(--mar); color: var(--tinta);
  font-family: var(--ui); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--coral-escuro); }
:focus-visible { outline: 3px solid var(--ouro); outline-offset: 2px; }
[hidden] { display: none !important; }

#mapa { position: fixed; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: grab; display: block; }
#mapa.arrastando { cursor: grabbing; }

#faixa-demo {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30; text-align: center; font-size: 12.5px; font-weight: 700;
  padding: calc(4px + env(safe-area-inset-top, 0px)) 12px 4px; background: var(--ouro); color: var(--tinta);
}
body.demo .topo { top: calc(26px + env(safe-area-inset-top, 0px)); }
body.demo .placar { top: calc(92px + env(safe-area-inset-top, 0px)); }

/* topo */
.topo {
  position: fixed; z-index: 20; top: env(safe-area-inset-top, 0px); left: 0; right: 0;
  display: flex; align-items: center; gap: 10px;
  padding: 10px max(12px, env(safe-area-inset-right, 0px)) 10px max(12px, env(safe-area-inset-left, 0px));
  pointer-events: none;
}
.topo > * { pointer-events: auto; }
.marca {
  display: flex; align-items: center; gap: 6px; text-decoration: none; color: var(--papel);
  font-family: var(--display); font-size: 22px; letter-spacing: 0.01em; text-shadow: 0 2px 0 var(--mar-escuro);
}
.marca svg { width: 34px; height: 34px; filter: drop-shadow(0 2px 0 rgba(10, 52, 64, 0.6)); }
.busca { position: relative; flex: 1; max-width: 460px; margin-left: auto; display: flex; }
.busca input {
  width: 100%; min-width: 0; border: 0; border-radius: 999px; padding: 11px 46px 11px 16px; background: var(--papel);
  box-shadow: var(--sombra); font-weight: 600;
}
.busca input::placeholder { color: var(--tinta-suave); font-weight: 500; }
.busca button {
  position: absolute; right: 4px; top: 4px; bottom: 4px; width: 38px; border: 0; border-radius: 999px;
  background: var(--coral); color: var(--papel); display: grid; place-items: center;
}
.busca button svg { width: 18px; height: 18px; }
.sugestoes {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; margin: 0; padding: 6px; list-style: none;
  background: var(--papel); border-radius: 14px; box-shadow: var(--sombra); max-height: 50vh; overflow: auto;
}
.sugestoes li button {
  width: 100%; text-align: left; border: 0; background: none; padding: 9px 10px; border-radius: 10px;
  display: flex; justify-content: space-between; gap: 10px;
}
.sugestoes li button:hover, .sugestoes li button[aria-selected="true"] { background: var(--papel-2); }
.sugestoes small { color: var(--tinta-suave); }

/* placar */
.placar {
  position: fixed; z-index: 10; top: calc(66px + env(safe-area-inset-top, 0px)); left: max(12px, env(safe-area-inset-left, 0px));
  display: flex; align-items: stretch; gap: 0; background: var(--papel); border-radius: 14px; box-shadow: var(--sombra); overflow: hidden;
}
.placar-dia {
  font-family: var(--display); font-size: 18px; background: var(--coral); color: var(--papel); padding: 6px 12px;
  display: grid; place-items: center; letter-spacing: 0.02em;
}
.placar-num { padding: 5px 12px; display: grid; line-height: 1.1; border-left: 1px solid var(--linha); }
.placar-num b { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.placar-num span { font-size: 11.5px; color: var(--tinta-suave); font-weight: 600; }

/* controles */
.controles {
  position: fixed; z-index: 10; right: max(12px, env(safe-area-inset-right, 0px)); top: 50%; transform: translateY(-50%);
  display: grid; gap: 8px;
}
.controles button {
  width: 44px; height: 44px; border: 0; border-radius: 14px; background: var(--papel); box-shadow: var(--sombra);
  font-size: 24px; font-weight: 700; display: grid; place-items: center; color: var(--tinta);
}
.controles svg { width: 20px; height: 20px; }

.chamada-anuncio {
  position: fixed; z-index: 10; left: max(12px, env(safe-area-inset-left, 0px));
  bottom: calc(var(--abas-h) + 14px + env(safe-area-inset-bottom, 0px));
  background: var(--ouro); color: var(--tinta); text-decoration: none; font-weight: 700; font-size: 13.5px;
  padding: 9px 14px; border-radius: 999px; box-shadow: var(--sombra);
}
.chamada-anuncio b { font-weight: 800; }

/* abas */
.abas {
  position: fixed; z-index: 25; left: 0; right: 0; bottom: 0; height: calc(var(--abas-h) + env(safe-area-inset-bottom, 0px));
  padding: 6px max(6px, env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(6px, env(safe-area-inset-left, 0px));
  display: grid; grid-template-columns: repeat(5, 1fr); background: var(--papel); box-shadow: 0 -6px 20px rgba(10, 52, 64, 0.2);
}
.abas a {
  display: grid; justify-items: center; align-content: center; gap: 2px; text-decoration: none; color: var(--tinta-suave);
  font-size: 11.5px; font-weight: 700; border-radius: 12px;
}
.abas a svg { width: 23px; height: 23px; }
.abas a[aria-current="page"] { color: var(--coral); background: #fde9e2; }

/* painel */
.painel {
  position: fixed; z-index: 20; left: 0; right: 0; bottom: calc(var(--abas-h) + env(safe-area-inset-bottom, 0px));
  max-height: min(48vh, 440px); display: flex; flex-direction: column;
  background: var(--papel); border-radius: 22px 22px 0 0; box-shadow: 0 -10px 30px rgba(10, 52, 64, 0.3);
  transform: translateY(0); transition: transform 0.28s ease;
}
.painel.fechado { transform: translateY(calc(100% - 34px)); }
.painel.vazio { display: none; }
.painel-alca { flex: none; height: 26px; border: 0; background: none; display: grid; place-items: center; }
.painel-alca::before { content: ""; width: 44px; height: 5px; border-radius: 9px; background: var(--linha); }
.painel-corpo {
  overflow-y: auto; overscroll-behavior: contain; padding: 0 max(18px, env(safe-area-inset-right, 0px)) 22px max(18px, env(safe-area-inset-left, 0px));
  display: grid; gap: 14px; align-content: start;
}

@media (min-width: 900px) {
  :root { --abas-h: 0px; }
  .abas {
    top: calc(76px + env(safe-area-inset-top, 0px)); bottom: auto; left: 16px; right: auto; width: 400px; height: auto;
    border-radius: 16px 16px 0 0; padding: 6px; box-shadow: none; border-bottom: 1px solid var(--linha);
  }
  body.demo .abas { top: 102px; }
  .abas a { padding: 6px 0; }
  .painel {
    top: calc(146px + env(safe-area-inset-top, 0px)); bottom: 16px; left: 16px; right: auto; width: 400px; max-height: none;
    border-radius: 0 0 18px 18px; transition: none;
  }
  body.demo .painel { top: 172px; }
  .painel.fechado { transform: none; }
  .painel-alca { display: none; }
  .painel-corpo { padding: 18px 20px 24px; }
  .placar { left: auto; right: 72px; top: calc(76px + env(safe-area-inset-top, 0px)); }
  body.demo .placar { top: 102px; }
  .chamada-anuncio { left: auto; right: 72px; bottom: 20px; }
  .marca { font-size: 26px; }
}
@media (max-width: 520px) {
  .marca span { display: none; }
  .placar-num span { font-size: 10.5px; }
}

/* conteúdo do painel */
.eyebrow { font-size: 11.5px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--tinta-suave); margin: 0; }
.titulo { font-family: var(--display); font-weight: 400; font-size: 27px; line-height: 1.08; margin: 0; letter-spacing: 0.005em; text-wrap: balance; }
.titulo small { font-family: var(--ui); font-size: 15px; font-weight: 700; color: var(--tinta-suave); }
.texto { margin: 0; color: var(--tinta); }
.suave { color: var(--tinta-suave); }
.linha { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 999px; padding: 11px 18px;
  background: var(--coral); color: var(--papel); font-weight: 800; text-decoration: none; font-size: 15px;
}
.btn:hover { background: var(--coral-escuro); }
.btn.secundario { background: transparent; color: var(--tinta); box-shadow: inset 0 0 0 2px var(--tinta); }
.btn.secundario:hover { background: var(--papel-2); }
.btn.ouro { background: var(--ouro); color: var(--tinta); }
.btn.cheio { width: 100%; }
.btn[disabled] { opacity: 0.55; cursor: default; }

.numeros { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.numeros div { background: var(--papel-2); border-radius: 12px; padding: 9px 10px; display: grid; }
.numeros b { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.15; }
.numeros span { font-size: 12px; color: var(--tinta-suave); font-weight: 600; }

.cartao-mor { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; background: var(--papel-2); border-radius: 14px; padding: 12px; }
.cartao-mor canvas { width: 64px; height: 64px; border-radius: 12px; background: #cfe7d5; }
.cartao-mor b { font-size: 17px; }
.barra { height: 10px; border-radius: 9px; background: var(--linha); overflow: hidden; }
.barra i { display: block; height: 100%; background: var(--verde); border-radius: 9px; }

.lista { list-style: none; margin: 0; padding: 0; display: grid; }
.lista li { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; padding: 8px 2px; border-bottom: 1px solid var(--linha); }
.lista li:last-child { border-bottom: 0; }
.lista .pos { font-weight: 800; color: var(--tinta-suave); font-variant-numeric: tabular-nums; text-align: right; }
.lista .nome { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lista .nome small { display: block; color: var(--tinta-suave); font-size: 12.5px; }
.lista .val { font-weight: 800; font-variant-numeric: tabular-nums; }
.lista button.link { border: 0; background: none; padding: 0; text-align: left; font-weight: 700; color: var(--tinta); }
.lista button.link:hover { color: var(--coral-escuro); text-decoration: underline; }

.selo { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 800; background: var(--papel-2); }
.selo.ouro { background: var(--ouro); }
.selo.coral { background: var(--coral); color: var(--papel); }
.selo.verde { background: #d7f0e4; color: #0d6b47; }

.ganhos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ganho { background: var(--papel-2); border-radius: 12px; padding: 10px 12px; display: grid; gap: 2px; }
.ganho b { font-size: 20px; font-weight: 800; color: var(--verde); }
.ganho span { font-size: 13px; font-weight: 600; line-height: 1.3; }

.segmentos { display: flex; gap: 4px; background: var(--papel-2); border-radius: 999px; padding: 4px; }
.segmentos button { flex: 1; border: 0; background: none; border-radius: 999px; padding: 7px 8px; font-weight: 700; font-size: 13.5px; color: var(--tinta-suave); }
.segmentos button[aria-pressed="true"] { background: var(--papel); color: var(--tinta); box-shadow: 0 1px 4px rgba(43, 33, 24, 0.15); }

.estado { display: grid; grid-template-columns: 34px 1fr 64px; gap: 8px; align-items: center; font-size: 13.5px; }
.estado b { font-weight: 800; }
.estado .val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.estado .barra i { background: var(--coral); }
.estado.ok .barra i { background: var(--ouro); }

.loja { display: grid; grid-template-columns: 46px 1fr; gap: 12px; background: var(--papel-2); border-radius: 14px; padding: 12px; }
.loja .logo { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; color: var(--papel); font-family: var(--display); font-size: 22px; }
.loja h3 { margin: 0; font-size: 16px; }
.loja p { margin: 2px 0 8px; font-size: 13.5px; color: var(--tinta-suave); }
.loja .linha { gap: 6px; }

form.formulario { display: grid; gap: 12px; }
.campo { display: grid; gap: 5px; }
.campo label { font-weight: 700; font-size: 13.5px; }
.campo small { color: var(--tinta-suave); font-size: 12.5px; }
.campo input, .campo select, .campo textarea {
  width: 100%; border: 2px solid var(--linha); border-radius: 12px; padding: 10px 12px; background: #fff; min-width: 0;
}
.campo input:focus, .campo select:focus, .campo textarea:focus { border-color: var(--tinta); outline: none; }
.campo textarea { resize: vertical; min-height: 64px; }
.campo-cidade { position: relative; }
.erro { background: #fde3dc; color: #8a2a10; border-radius: 12px; padding: 10px 12px; font-weight: 600; font-size: 14px; }
.ok-box { background: #d7f0e4; color: #0d4f35; border-radius: 12px; padding: 12px; font-weight: 600; }
.preco { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; background: var(--papel-2); border-radius: 14px; padding: 12px 14px; }
.preco b { font-family: var(--display); font-size: 30px; font-weight: 400; }
.preco span { font-size: 13px; color: var(--tinta-suave); font-weight: 600; }
.pacote { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: 14px; }

.pix { display: grid; justify-items: center; gap: 10px; background: #fff; border-radius: 16px; padding: 14px; border: 2px dashed var(--linha); }
.pix img, .pix canvas, .pix svg { width: 210px; height: 210px; image-rendering: pixelated; }
.pix code { font-size: 11.5px; word-break: break-all; background: var(--papel-2); padding: 8px; border-radius: 8px; max-height: 80px; overflow: auto; width: 100%; }

.passos { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; counter-reset: p; }
.passos li { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start; }
.passos li::before {
  counter-increment: p; content: counter(p); width: 30px; height: 30px; border-radius: 50%; background: var(--coral); color: var(--papel);
  display: grid; place-items: center; font-family: var(--display); font-size: 16px;
}
.regras { font-size: 13.5px; color: var(--tinta-suave); }
hr { border: 0; border-top: 1px solid var(--linha); margin: 2px 0; width: 100%; }

.aviso {
  position: fixed; z-index: 40; left: 50%; transform: translateX(-50%); bottom: calc(var(--abas-h) + 80px + env(safe-area-inset-bottom, 0px));
  background: var(--tinta); color: var(--papel); padding: 10px 16px; border-radius: 999px; font-weight: 700; box-shadow: var(--sombra);
  max-width: calc(100% - 32px); text-align: center;
}
@media (min-width: 900px) { .aviso { bottom: 30px; } }
@media (prefers-reduced-motion: reduce) { .painel { transition: none; } }
