:root {
  --amarelo: #f2c014;
  --ambar: #f6a21a;
  --amarelo-sombra: #b08a00;
  --preto: #1f1f1f;
  --carvao: #2a2622;
  --papel: #fff8e6;
  --branco: #ffffff;
  --linha: #e6dbb9;
  --suave: #6a6148;
  --verde: #2f9a4a;
  --verde-claro: #dff3df;
  --vermelho: #d6452f;
  --vermelho-claro: #fbdcd6;
  --azul: #2f78c9;
  --m: #2f6fb5;
  --f: #b8407a;
  --vidro: rgba(28, 30, 26, 0.82);
  --seguro-topo: env(safe-area-inset-top, 0px);
  --seguro-base: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #1d3a2c; overscroll-behavior: none; }
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--preto); user-select: none; -webkit-user-select: none; touch-action: none; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; border: 0; cursor: pointer; background: none; padding: 0; }
h2, h3, p { margin: 0; }

#cena { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#rotulos { position: fixed; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; }
.rotulo { position: absolute; left: 0; top: 0; white-space: nowrap; font-weight: 800; pointer-events: none; }
.rotulo-lider { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.rotulo-lider b { padding: 2px 8px; border-radius: 999px; background: var(--vidro); color: var(--amarelo); font-size: 12px; }
.rotulo-lider i { font-style: normal; font-size: 11px; color: #fff; text-shadow: 0 1px 2px #000; }
.rotulo-lider i:empty { display: none; }
.rotulo-ponto { padding: 3px 9px; border-radius: 8px; background: rgba(255, 248, 230, 0.9); color: #3a2412; font-size: 12px; border: 1.5px solid #3a2412; }
.rotulo-obra { padding: 3px 9px; border-radius: 999px; background: var(--amarelo); font-size: 12px; box-shadow: 0 2px 0 var(--amarelo-sombra); }
.rotulo-caminho { width: 34px; height: 34px; border-radius: 50%; background: var(--amarelo); border: 3px solid var(--preto); text-align: center; line-height: 28px; font-size: 18px; font-weight: 900; }
.flutua { position: absolute; left: 0; top: 0; padding: 3px 10px; border-radius: 999px; background: var(--verde); color: #fff; font-weight: 900; font-size: 15px; white-space: nowrap; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35); }
.flutua.agua { background: var(--azul); }
.flutua.obra { background: var(--amarelo); color: var(--preto); }

/* ---------- botões ---------- */
.botao { min-height: 50px; padding: 12px 18px; border-radius: 16px; background: var(--amarelo); font-weight: 800; font-size: 16px; box-shadow: 0 4px 0 var(--amarelo-sombra); }
.botao.claro { background: #ece4cc; box-shadow: 0 4px 0 #c2b998; }
.botao:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--amarelo-sombra); }
.botao:disabled { opacity: 0.45; transform: none; }
.tag { display: inline-block; padding: 3px 9px; border-radius: 999px; background: var(--preto); color: var(--amarelo); font-size: 11px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; z-index: 2; pointer-events: none; display: flex; flex-direction: column; justify-content: space-between; }
#hud button, #hud .barra-rec, #hud .chip { pointer-events: auto; }
.hud-topo { padding: calc(8px + var(--seguro-topo)) 8px 0; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.barras { display: flex; gap: 6px; width: 100%; max-width: 520px; }
.barra-rec { flex: 1; min-width: 0; position: relative; display: flex; align-items: center; gap: 6px; padding: 5px 9px 5px 6px; border-radius: 14px; background: var(--vidro); color: #fff; }
.barra-rec .ico { font-size: 17px; }
.barra-rec .trilho { position: absolute; left: 32px; right: 9px; bottom: 5px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.18); overflow: hidden; }
.barra-rec .trilho i { display: block; height: 100%; width: 0; background: #c98a3f; transition: width 0.4s; }
#barra-agua .trilho i { background: #4aa8f0; }
.barra-rec b { font-size: 14px; padding-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barra-rec b img.ic { width: 16px; height: 16px; vertical-align: -3px; }
.barra-rec.pulsa { animation: pulsa 0.5s; }
@keyframes pulsa { 40% { transform: scale(1.06); background: #2f6b3d; } }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 7px 11px; border-radius: 999px; background: var(--amarelo); font-weight: 800; font-size: 13px; box-shadow: 0 3px 0 var(--amarelo-sombra); }
.chip.escuro { background: var(--vidro); color: var(--amarelo); box-shadow: none; }
.chip.fogo { background: var(--vidro); color: #fff; box-shadow: none; }
.chip.fogo.fraco { background: #8a3a1a; }
.chip.alerta { animation: brilha 1.4s infinite; }
@keyframes brilha { 50% { box-shadow: 0 0 0 4px rgba(242, 192, 20, 0.45), 0 3px 0 var(--amarelo-sombra); } }
#objetivo { max-width: min(520px, 100%); display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left; padding: 7px 11px 8px; border-radius: 14px; background: rgba(255, 248, 230, 0.94); border-left: 5px solid var(--amarelo); font-size: 14px; font-weight: 600; line-height: 1.3; }
#objetivo .tag { font-size: 10px; }
#sabado { pointer-events: auto; max-width: 520px; padding: 8px 12px; border-radius: 14px; background: #283a63; color: #fff; font-size: 14px; font-weight: 700; }

.hud-base { padding: 0 8px calc(8px + var(--seguro-base)); display: flex; flex-direction: column; gap: 7px; }
#lideres { display: flex; gap: 7px; overflow-x: auto; pointer-events: auto; padding: 2px 2px 4px; scrollbar-width: none; touch-action: pan-x; }
#lideres::-webkit-scrollbar { display: none; }
.card-lider { flex: none; width: 150px; text-align: left; padding: 8px 10px; border-radius: 16px; background: rgba(255, 248, 230, 0.96); border: 2px solid transparent; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25); }
.card-lider.sel { border-color: var(--preto); }
.card-lider .nome { display: flex; align-items: center; gap: 5px; font-weight: 900; font-size: 14px; }
.card-lider .nome i { width: 9px; height: 9px; border-radius: 50%; }
.card-lider .tarefa { display: block; margin-top: 2px; font-size: 12px; line-height: 1.25; color: #4a4433; min-height: 2.5em; }
.card-lider .prog { height: 6px; margin-top: 5px; border-radius: 3px; background: #ece4cc; overflow: hidden; }
.card-lider .prog i { display: block; height: 100%; width: 0; background: var(--amarelo); }
.card-lider.livre .tarefa { color: var(--verde); font-weight: 800; }
.acoes { display: flex; gap: 7px; }
.acao { flex: 1; min-height: 52px; display: flex; align-items: center; justify-content: center; gap: 6px; border-radius: 16px; background: var(--carvao); color: var(--amarelo); font-weight: 900; font-size: 15px; box-shadow: 0 4px 0 #000, inset 0 0 0 2px #6b5a2a; pointer-events: auto; }
.acao span { font-size: 18px; }
.acao:active { transform: translateY(3px); box-shadow: 0 1px 0 #000, inset 0 0 0 2px #6b5a2a; }
@media (min-width: 760px) {
  .hud-base { flex-direction: row; align-items: flex-end; }
  #lideres { flex: 1; }
  .acoes { flex: none; width: 420px; }
}

#modo-lote, #barra-percurso { position: fixed; z-index: 3; left: 8px; right: 8px; top: calc(8px + var(--seguro-topo)); max-width: 560px; margin: 0 auto; display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; border-radius: 18px; background: var(--papel); box-shadow: 0 0 0 2px var(--preto), 0 6px 20px rgba(0, 0, 0, 0.35); }
#modo-lote p, #barra-percurso b { flex: 1; font-size: 15px; font-weight: 700; line-height: 1.3; }
#modo-lote .botao, #barra-percurso .botao { min-height: 42px; padding: 8px 14px; font-size: 14px; }

/* ---------- folha ---------- */
#painel { position: fixed; inset: 0; z-index: 5; display: flex; align-items: flex-end; justify-content: center; background: rgba(18, 28, 18, 0.5); }
#painel.leve { background: transparent; pointer-events: none; }
#painel.leve #cartao { pointer-events: auto; }
#cartao { display: flex; flex-direction: column; width: 100%; max-width: 560px; max-height: calc(100% - 40px - var(--seguro-topo)); border-radius: 24px 24px 0 0; background: var(--papel); box-shadow: 0 -6px 30px rgba(0, 0, 0, 0.35); animation: sobe 0.2s ease-out; overflow: hidden; }
@keyframes sobe { from { transform: translateY(16px); opacity: 0; } }
.topo { flex: none; position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 22px 16px 10px; }
.topo::before { content: ""; position: absolute; left: 50%; top: 8px; width: 42px; height: 5px; margin-left: -21px; border-radius: 3px; background: var(--linha); }
.topo-texto { flex: 1; min-width: 0; }
.topo h2 { margin-top: 7px; font-size: 21px; line-height: 1.2; }
.fechar { flex: none; width: 42px; height: 42px; margin: -4px -4px 0 0; border-radius: 50%; background: #ece4cc; font-size: 19px; font-weight: 800; }
.corpo { flex: 1; min-height: 0; overflow-y: auto; padding: 2px 16px 16px; touch-action: pan-y; }
.corpo > p { font-size: 15.5px; line-height: 1.4; color: #3d3829; }
.pe { flex: none; display: flex; gap: 10px; padding: 12px 16px calc(14px + var(--seguro-base)); border-top: 2px solid var(--linha); }
.pe .botao { flex: 1; }
.pe .botao.claro { flex: 0 1 auto; }
@media (min-width: 620px) {
  #painel { align-items: center; padding: 20px; }
  #cartao { border-radius: 24px; max-height: 100%; }
  .topo::before { display: none; }
}

.secao { margin: 16px 2px 8px; font-size: 12px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var(--suave); }
.secao:first-child { margin-top: 4px; }
.custos { display: flex; flex-wrap: wrap; gap: 6px; }
.custo { display: inline-flex; align-items: center; gap: 5px; padding: 6px 10px; border-radius: 12px; background: var(--branco); border: 2px solid var(--linha); font-weight: 800; font-size: 14px; }
.custo.falta { border-color: var(--vermelho); background: var(--vermelho-claro); color: #9c2a19; }
.custo small { font-weight: 600; color: var(--suave); }
.custo.falta small { color: #9c2a19; }
.efeito { padding: 10px 12px; border-radius: 14px; background: var(--verde-claro); color: #1d5a2b; font-size: 14.5px; font-weight: 600; line-height: 1.35; }
.motivos { margin: 0; padding: 0; list-style: none; }
.motivos li { margin: 6px 0; padding: 9px 12px; border-radius: 12px; background: var(--vermelho-claro); color: #8a2515; font-size: 14.5px; font-weight: 700; line-height: 1.3; }
.ok-linha { padding: 9px 12px; border-radius: 12px; background: var(--verde-claro); color: #1d5a2b; font-weight: 700; font-size: 14.5px; }
.lados { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lado { min-height: 54px; border-radius: 14px; background: var(--branco); border: 2px solid var(--linha); font-weight: 900; font-size: 15px; }
.lado b { display: block; }
.lado small { display: block; font-weight: 600; font-size: 12px; color: var(--suave); }
.lado.sel.m { border-color: var(--m); background: #e2ecf8; }
.lado.sel.f { border-color: var(--f); background: #f7e3ee; }
.lado:disabled { opacity: 0.45; }
.regra { margin-top: 10px; padding: 9px 12px; border-radius: 12px; background: #efe6c8; font-size: 13.5px; line-height: 1.35; color: #4a4433; }
.regra b { color: var(--preto); }

.lista { display: flex; flex-direction: column; gap: 7px; }
.item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 11px 12px; border-radius: 16px; background: var(--branco); border: 2px solid var(--linha); }
.item .ico { flex: none; width: 38px; height: 38px; border-radius: 12px; background: #f3ead0; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.item .txt { flex: 1; min-width: 0; }
.item b { display: block; font-size: 15.5px; }
.item small { display: block; margin-top: 2px; font-size: 13px; line-height: 1.3; color: var(--suave); }
.item small.ruim { color: #9c2a19; font-weight: 700; }
.item .seta { flex: none; font-weight: 900; color: var(--suave); }
.item:disabled, .item.off { opacity: 0.6; }
.item.atual { border-color: var(--preto); background: #fff3c4; }
.item.bloq .ico { filter: grayscale(1); opacity: 0.6; }

.req { display: flex; gap: 10px; align-items: flex-start; padding: 10px 2px; border-bottom: 2px solid var(--linha); }
.req:last-child { border-bottom: 0; }
.req .marca { flex: none; width: 28px; height: 28px; border-radius: 50%; text-align: center; line-height: 28px; font-weight: 900; background: #ece4cc; color: var(--suave); }
.req.ok .marca { background: var(--verde); color: #fff; }
.req b { display: block; font-size: 15.5px; }
.req small { display: block; margin-top: 2px; font-size: 13.5px; line-height: 1.3; color: #9c2a19; font-weight: 700; }
.req.ok small { display: none; }
.fase-cab { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; background: var(--carvao); color: #fff; }
.fase-cab .num { flex: none; width: 52px; height: 52px; border-radius: 14px; background: var(--amarelo); color: var(--preto); text-align: center; font-size: 26px; font-weight: 900; line-height: 52px; }
.fase-cab b { display: block; font-size: 17px; color: var(--amarelo); }
.fase-cab small { display: block; font-size: 13px; color: #d8d2bd; }
.resumo { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.fato { padding: 9px 6px; border-radius: 14px; background: var(--branco); border: 2px solid var(--linha); text-align: center; }
.fato b { display: block; font-size: 18px; font-weight: 900; line-height: 1.15; }
.fato span { display: block; margin-top: 2px; font-size: 11.5px; font-weight: 700; color: var(--suave); }
.escolhas { display: flex; flex-direction: column; gap: 6px; }
.escolha { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 14px; background: var(--branco); border: 2px solid var(--linha); }
.escolha .marca { flex: none; width: 28px; height: 28px; border-radius: 50%; text-align: center; line-height: 28px; font-weight: 900; color: #fff; background: var(--verde); }
.escolha.erro .marca { background: var(--vermelho); }
.escolha b { display: block; font-size: 15px; }
.escolha small { display: block; font-size: 13px; color: var(--suave); }
.premio { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 16px; background: #fff3c4; border: 2px solid var(--amarelo); }
.premio .ico { font-size: 30px; }
.premio b { display: block; font-size: 16px; }
.premio small { display: block; font-size: 13.5px; color: #4a4433; }
.premio.cinza { background: #f3eedf; border-color: var(--linha); }
.retorno { margin-top: 10px; padding: 10px 12px; border-radius: 12px; font-weight: 700; font-size: 15px; line-height: 1.35; background: var(--vermelho-claro); color: #8a2515; }

#toast { position: fixed; z-index: 6; left: 50%; bottom: calc(150px + var(--seguro-base)); transform: translate(-50%, 10px); max-width: 88%; padding: 11px 16px; border-radius: 16px; background: var(--preto); color: #fff; font-weight: 700; font-size: 15px; line-height: 1.3; text-align: center; opacity: 0; transition: opacity 0.25s, transform 0.25s; pointer-events: none; }
#toast.visivel { opacity: 1; transform: translate(-50%, 0); }

/* ---------- abertura ---------- */
#abertura { position: fixed; inset: 0; z-index: 9; overflow: hidden; background: #123024 url("../assets/abertura/fundo.webp") center 40% / cover no-repeat; display: flex; flex-direction: column; align-items: center; }
.abertura-luz { position: absolute; inset: 0; background: linear-gradient(rgba(10, 25, 18, 0) 45%, rgba(10, 22, 16, 0.85) 82%, #0b1a12); pointer-events: none; }
.abertura-logo { position: relative; width: min(78vw, 520px, 52vh); margin-top: calc(3vh + var(--seguro-topo)); filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.45)); }
.abertura-trio { position: relative; flex: 1; min-height: 0; width: 100%; max-width: 760px; display: flex; justify-content: center; align-items: flex-end; margin-top: -2vh; }
.abertura-trio img { width: auto; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.5)); }
.abertura-trio .p-heroi { position: relative; z-index: 2; height: min(46vh, 64vw); margin: 0 -7vw; }
.abertura-trio .p-bia, .abertura-trio .p-davi { height: min(38vh, 52vw); margin-bottom: 3vh; }
.abertura-trio .p-davi { margin-left: -5vw; }
@media (min-width: 700px) { .abertura-trio .p-heroi { margin: 0 -60px; } }
.abertura-menu { position: relative; width: 100%; max-width: 400px; padding: 0 22px calc(14px + var(--seguro-base)); display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: -3vh; }
#abertura-status { min-height: 1.3em; color: #f3e6b8; font-weight: 700; font-size: 15px; text-shadow: 0 2px 4px #000; text-align: center; }
.bt-img { display: block; width: 100%; max-width: 330px; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.45)); transition: transform 0.1s; }
.bt-img img { display: block; width: 100%; height: auto; }
.bt-img:active { transform: scale(0.96); }
.bt-img.secundario { max-width: 290px; }
.abertura-rodape { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; }
.bt-img.mini { max-width: 190px; }
.bt-img.engrenagem { width: 58px; flex: none; }
@media (orientation: landscape) and (max-height: 560px) {
  #abertura { flex-direction: row; justify-content: center; align-items: center; gap: 2vw; }
  .abertura-logo { position: absolute; top: 2vh; left: 50%; transform: translateX(-50%); width: min(44vw, 54vh); margin: 0; }
  .abertura-trio { flex: none; width: 50vw; height: 64vh; margin: 26vh 0 0; }
  .abertura-trio img { max-height: 60vh; }
  .abertura-menu { width: 34vw; margin: 22vh 0 0; padding-bottom: 10px; }
}

/* ---------- guia: o líder embaixo, balão atrás e ao lado ---------- */
#guia { position: fixed; z-index: 4; left: 0; right: 0; bottom: 0; height: calc(240px + var(--seguro-base)); pointer-events: none; overflow: hidden; }
#guia > * { pointer-events: auto; }
#guia-img { position: absolute; z-index: 2; left: -26px; bottom: 0; height: 190px; width: auto; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.45)); transform-origin: 50% 100%; }
.guia-balao { position: absolute; z-index: 1; left: 80px; right: 8px; bottom: calc(12px + var(--seguro-base)); min-height: 150px; display: flex; flex-direction: column; padding: 20px 14px 12px 102px; border-radius: 22px; background: var(--papel); box-shadow: 0 0 0 2px var(--preto), 0 8px 24px rgba(0, 0, 0, 0.35); cursor: pointer; }
.guia-nome { position: absolute; left: 102px; top: -13px; padding: 4px 12px; border-radius: 999px; background: var(--preto); color: var(--amarelo); font-size: 13px; font-weight: 900; }
#guia-texto { flex: 1; font-size: 15.5px; line-height: 1.36; font-weight: 600; min-height: 5.4em; }
#guia-conta { position: absolute; right: 50px; top: -10px; padding: 3px 9px; border-radius: 999px; background: #ece4cc; font-size: 11px; font-weight: 800; color: var(--suave); }
#guia-conta:empty { display: none; }
#guia-fechar { position: absolute; right: 8px; top: -16px; width: 34px; height: 34px; border-radius: 50%; background: var(--papel); border: 2px solid var(--preto); font-size: 15px; font-weight: 900; color: var(--suave); }
#guia-texto { padding-right: 0; }
#guia-botoes { display: flex; justify-content: flex-end; margin-top: 8px; }
#guia-botoes .botao { min-height: 44px; padding: 8px 16px; font-size: 15px; }
#guia.entra #guia-img { animation: guia-sobe 0.35s cubic-bezier(0.3, 1.4, 0.5, 1); }
#guia.entra .guia-balao { animation: guia-balao 0.3s ease-out 0.08s both; }
@keyframes guia-sobe { from { transform: translateY(120px); } }
@keyframes guia-balao { from { transform: translateX(-24px) scale(0.92); opacity: 0; } }
body.com-guia .hud-base { visibility: hidden; }
#guia-mini { position: fixed; z-index: 3; left: 10px; bottom: calc(142px + var(--seguro-base)); width: 60px; height: 60px; padding: 0; border-radius: 50%; background: radial-gradient(circle at 50% 35%, #ffe07a, var(--amarelo) 70%); border: 3px solid var(--preto); box-shadow: 0 4px 0 var(--amarelo-sombra), 0 6px 14px rgba(0, 0, 0, 0.35); }
#guia-mini img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
#guia-mini span { position: absolute; right: -6px; top: -6px; width: 26px; height: 26px; border-radius: 50%; background: var(--papel); border: 2px solid var(--preto); font-size: 13px; line-height: 22px; text-align: center; }
#guia-mini:active { transform: translateY(2px); }
@media (min-width: 760px) {
  #guia { left: 50%; right: auto; width: 640px; margin-left: -320px; }
  #guia-mini { bottom: calc(80px + var(--seguro-base)); }
}
body.com-guia #toast { bottom: calc(300px + var(--seguro-base)); }

/* ---------- ícones de imagem (assets/ui) ---------- */
img.ic { width: 1.35em; height: 1.35em; object-fit: contain; vertical-align: -0.3em; pointer-events: none; }
.item .ico img.ic, .premio .ico img.ic { width: 34px; height: 34px; vertical-align: middle; }
.acao span img.ic { width: 30px; height: 30px; vertical-align: middle; }
.barra-rec .ico img.ic { width: 24px; height: 24px; vertical-align: middle; }
.custo img.ic { width: 22px; height: 22px; }
.rotulo-lider i img.ic, .rotulo-obra img.ic, .flutua img.ic { width: 16px; height: 16px; vertical-align: -3px; }
body.ui-fechar .fechar, body.ui-fechar #guia-fechar { background: url("../assets/ui/fechar.webp") center / contain no-repeat; border: 0; color: transparent; font-size: 0; box-shadow: none; }

/* bases de botão e moldura (scarf-camp-interface-v1) em 9 fatias: cantos fixos, meio estica */
body.ui-botao-primario-base .botao:not(.claro) { background: none; border: 13px solid transparent; border-image: url("../assets/ui/botao-primario-base.webp") 76 fill / 13px stretch; box-shadow: none; padding: 0 6px; min-height: 54px; color: #2a2118; }
body.ui-botao-primario-base .botao:not(.claro):active { transform: translateY(2px) scale(0.98); }
body.ui-botao-secundario-base .botao.claro { background: none; border: 13px solid transparent; border-image: url("../assets/ui/botao-secundario-base.webp") 76 fill / 13px stretch; box-shadow: none; padding: 0 6px; min-height: 54px; color: var(--amarelo); }
body.ui-botao-secundario-base .acao { background: none; border: 13px solid transparent; border-image: url("../assets/ui/botao-secundario-base.webp") 76 fill / 13px stretch; box-shadow: none; min-height: 60px; padding: 0 4px; }
body.ui-botao-secundario-base .acao:active { transform: translateY(2px) scale(0.98); box-shadow: none; }
body.ui-moldura-dialogo .guia-balao { background: none; border: 12px solid transparent; border-image: url("../assets/ui/moldura-dialogo.webp") 52 fill / 12px stretch; box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25); padding: 8px 4px 2px 90px; }
body.ui-moldura-dialogo .guia-nome { top: -24px; left: 90px; }
body.ui-moldura-dialogo #guia-conta { top: -21px; }
body.ui-moldura-dialogo #guia-fechar { top: -28px; right: -4px; }
body.ui-moldura-dialogo #objetivo { background: none; border: 10px solid transparent; border-image: url("../assets/ui/moldura-dialogo.webp") 52 fill / 10px stretch; padding: 2px 6px 3px; }
body.ui-botao-secundario-base .acoes { gap: 4px; }
body.ui-botao-secundario-base .acao { min-width: 0; gap: 3px; font-size: 14px; letter-spacing: -0.01em; }
.acao span img.ic { width: 26px; height: 26px; }
@media (max-width: 380px) { .acao { font-size: 13px; } .acao span img.ic { width: 22px; height: 22px; } }
.req .marca:has(img), .escolha .marca:has(img) { background: none; width: 32px; height: 32px; }
.req .marca img.ic, .escolha .marca img.ic { width: 32px; height: 32px; vertical-align: top; }

/* ---------- revisão de design 1: topo compacto, guia sem corte ---------- */
.barras { align-items: stretch; }
.barras .chip.fogo { flex: none; display: flex; align-items: center; gap: 3px; padding: 5px 9px; border-radius: 14px; font-size: 14px; font-weight: 800; white-space: nowrap; }
.chips { flex-wrap: nowrap; max-width: 100%; }
.chip { min-height: 36px; font-size: 14px; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.chip img.ic { width: 22px; height: 22px; vertical-align: middle; }
#objetivo-texto { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#objetivo .tag { font-size: 11px; }
.card-lider .prog { display: block; }

#guia { overflow: visible; }
.guia-balao { max-height: calc(100vh - 230px - var(--seguro-topo)); }
#guia-texto { overflow-y: auto; }
#guia-botoes .botao { flex: 1; }
#guia-fechar { width: 44px; height: 44px; }
body.ui-moldura-dialogo #guia-fechar { top: -32px; right: -8px; }
@media (max-width: 480px) {
  #guia-img { height: 150px; left: -18px; }
  .guia-balao { left: 70px; padding-left: 74px; }
  body.ui-moldura-dialogo .guia-balao { padding: 8px 4px 2px 62px; }
  .guia-nome, body.ui-moldura-dialogo .guia-nome { left: 62px; }
  #guia-texto { font-size: 15px; line-height: 1.34; min-height: 4.1em; }
}
.card-lider.chama { animation: chama 0.8s ease-in-out 5; border-color: var(--amarelo); }
@keyframes chama { 50% { transform: translateY(-6px); box-shadow: 0 0 0 4px rgba(242, 192, 20, 0.7), 0 3px 8px rgba(0, 0, 0, 0.25); } }

/* lugares de construção, seta de líder fora da tela, aviso no topo no modo de escolher lugar */
.rotulo-selo img.ic { width: 34px; height: 34px; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5)); }
.rotulo-selo { font-size: 26px; font-weight: 900; }
.seta-lider { position: fixed; z-index: 2; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 4px; min-height: 44px; padding: 4px 10px 4px 4px; border-radius: 999px; background: var(--vidro); color: var(--amarelo); font-size: 13px; font-weight: 900; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35); }
.seta-lider i { width: 30px; height: 30px; border-radius: 50%; background: var(--amarelo); position: relative; }
.seta-lider i::after { content: ""; position: absolute; left: 50%; top: 50%; margin: -7px 0 0 -4px; border: 7px solid transparent; border-left: 11px solid var(--preto); }
body.com-guia .seta-lider, body.modo-lote .seta-lider { visibility: hidden; }
body.modo-lote #toast { top: calc(96px + var(--seguro-topo)); bottom: auto; }

/* Construir em grupos */
.item small.bom { color: #1d6a31; font-weight: 800; }
.item.g-depois { background: #f3eedf; border-color: #e2d9bd; }
.item.g-depois .ico { filter: grayscale(1); opacity: 0.55; }
.item.g-depois b, .item.g-depois small { color: var(--suave); }
.custos-linha { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.mini-custo { display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px; border-radius: 9px; background: #f3ead0; font-size: 13px; font-weight: 800; color: #3d3829; }
.mini-custo img.ic { width: 18px; height: 18px; }
.mini-custo.falta { background: #fde7c2; color: #9a5a00; }
.em-breve { margin-top: 14px; padding: 10px 12px; border-radius: 12px; border: 2px dashed var(--linha); color: var(--suave); font-size: 14px; }
@media (max-width: 480px) {
  .barras { gap: 5px; }
  .barra-rec { padding: 5px 7px 5px 4px; gap: 4px; }
  .barra-rec b { font-size: 13px; letter-spacing: -0.02em; }
  .barra-rec .ico img.ic { width: 22px; height: 22px; }
  .barra-rec .trilho { left: 28px; right: 7px; }
  .barras .chip.fogo { padding: 5px 7px; font-size: 13px; }
}
#guia-mini { bottom: calc(172px + var(--seguro-base)); }
@media (min-width: 760px) { #guia-mini { bottom: calc(150px + var(--seguro-base)); } }

/* ---------- interface v2: retratos ---------- */
.retrato { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; object-position: 50% 15%; background: #f3ead0; border: 2px solid var(--preto); flex: none; }
.retrato.letra { display: inline-flex; align-items: center; justify-content: center; font-weight: 900; font-size: 14px; }
.item .ico .retrato { width: 38px; height: 38px; }
.card-lider .nome { gap: 6px; }
.card-lider .ic-tarefa { margin-left: auto; font-style: normal; }
.card-lider .ic-tarefa img.ic { width: 22px; height: 22px; }
#guia-mini span img.ic { width: 22px; height: 22px; vertical-align: middle; }
#guia-mini span:has(img) { background: none; border: 0; }
#sabado img.ic { width: 22px; height: 22px; }

/* ---------- revisão de design 1: itens médios ---------- */
/* fontes mínimas */
.tag { font-size: 12.5px; }
#objetivo .tag { font-size: 12px; }
#guia-conta { font-size: 12.5px; }
.card-lider .tarefa { font-size: 13px; }
.rotulo-lider b { font-size: 13px; }
.rotulo-lider i { font-size: 12.5px; }
.fato span, .lado small { font-size: 12.5px; }
.custo small { font-size: 13px; }

/* cards: livre chama atenção; novo líder "pula" */
.card-lider.livre { border-color: #2f9a4a; animation: livre 1.6s ease-in-out infinite; }
@keyframes livre { 50% { box-shadow: 0 0 0 3px rgba(47, 154, 74, 0.45), 0 3px 8px rgba(0, 0, 0, 0.25); } }
.card-lider.novo { animation: novo 0.6s cubic-bezier(0.3, 1.6, 0.5, 1); }
@keyframes novo { from { transform: scale(0.3) translateY(30px); } }

/* engrenagem do HUD */
.chips .bt-menu { margin-left: auto; width: 40px; min-height: 40px; padding: 0; justify-content: center; }
.chips .bt-menu img.ic { width: 34px; height: 34px; }
.chips { width: 100%; }

/* prancheta */
.req:not(.ok) .marca img.ic { filter: grayscale(1); opacity: 0.35; }
.grade-libera { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.grade-libera span { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border-radius: 14px; background: var(--branco); border: 2px solid var(--linha); text-align: center; }
.grade-libera img.ic { width: 42px; height: 42px; }
.grade-libera small { font-size: 12.5px; font-weight: 700; line-height: 1.2; color: #3d3829; }
.item .mini { flex: none; min-height: 40px; padding: 6px 12px; border-radius: 12px; background: var(--amarelo); font-weight: 800; font-size: 14px; box-shadow: 0 3px 0 var(--amarelo-sombra); }
.item .mini:disabled { opacity: 0.45; }
.botao.trancado, body.ui-botao-primario-base .botao.trancado { filter: grayscale(1) brightness(0.92); opacity: 1; color: #4a4433; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.botao.trancado img.ic { width: 22px; height: 22px; }
.custo.ferramenta { background: transparent; border-color: transparent; }

/* resumo do percurso */
.secao.primeiro { margin-top: 2px; }
.premio:not(.cinza) .ico img.ic { animation: pula 0.6s cubic-bezier(0.3, 1.6, 0.5, 1); }

/* letras do percurso tocáveis */
.rotulo-caminho { pointer-events: auto; width: 44px; height: 44px; line-height: 38px; font-size: 21px; cursor: pointer; }

/* ícone sobre os pontos de coleta */
.rotulo-recurso { display: flex; gap: 2px; padding: 3px 6px; border-radius: 999px; background: rgba(255, 248, 230, 0.88); border: 2px solid #3a2412; animation: boia 2.4s ease-in-out infinite; }
.rotulo-recurso img.ic { width: 26px; height: 26px; }
@keyframes boia { 50% { margin-top: -6px; } }

/* aviso: papel com borda, como as folhas */
#toast { background: var(--papel); color: var(--preto); border: 2px solid var(--preto); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3); }

/* faixa de nova fase */
.festa-fase { position: fixed; inset: 0; z-index: 7; pointer-events: none; overflow: hidden; }
.festa-fase .faixa { position: absolute; left: 50%; top: 32%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px 34px; border-radius: 22px; background: var(--carvao); border: 3px solid var(--amarelo); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); animation: faixa 2.8s ease-out both; }
.festa-fase .faixa img.ic { width: 72px; height: 72px; }
.festa-fase .faixa b { color: var(--amarelo); font-size: 34px; font-weight: 900; }
.festa-fase .faixa small { color: #f3e6b8; font-size: 15px; font-weight: 700; }
@keyframes faixa { 0% { transform: translate(-50%, -50%) scale(0.3); opacity: 0; } 15% { transform: translate(-50%, -50%) scale(1.08); opacity: 1; } 25% { transform: translate(-50%, -50%) scale(1); } 85% { opacity: 1; } 100% { opacity: 0; } }
.festa-fase i { position: absolute; top: -20px; width: 9px; height: 14px; border-radius: 2px; animation: confete 2.4s linear both; }
@keyframes confete { to { transform: translateY(110vh) rotate(720deg); } }

/* abertura: lugar do menu reservado e barra de carregamento */
.abertura-menu { min-height: 210px; justify-content: flex-start; }
.carregando { width: min(300px, 80%); height: 12px; margin-top: 30px; border-radius: 999px; background: rgba(0, 0, 0, 0.45); border: 2px solid #6b5a2a; overflow: hidden; }
.carregando i { display: block; width: 40%; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #f6a21a, #f2c014); animation: carrega 1.3s ease-in-out infinite; }
@keyframes carrega { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
#toast { bottom: calc(222px + var(--seguro-base)); }
.festa-fase .faixa { min-width: 240px; white-space: nowrap; }
.festa-fase .faixa small { white-space: normal; text-align: center; }

/* ================= horizontal: o mesmo jogo no PC e no celular deitado ================= */
#girar { display: none; position: fixed; inset: 0; z-index: 20; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 24px; background: #12241b; color: #fff8e6; text-align: center; }
#girar b { font-size: 24px; color: var(--amarelo); }
#girar span { font-size: 16px; max-width: 280px; line-height: 1.4; }
.girar-cel { width: 70px; height: 120px; border: 5px solid var(--amarelo); border-radius: 14px; position: relative; animation: girar 2.2s ease-in-out infinite; }
.girar-cel i { position: absolute; left: 50%; bottom: 6px; width: 16px; height: 4px; margin-left: -8px; border-radius: 2px; background: var(--amarelo); }
@keyframes girar { 0%, 25% { transform: rotate(0); } 55%, 100% { transform: rotate(-90deg); } }
@media (orientation: portrait) and (pointer: coarse) { #girar { display: flex; } }

/* folhas: painel à direita, altura inteira, mapa visível à esquerda */
@media (orientation: landscape) {
  #painel { align-items: stretch; justify-content: flex-end; padding: 0; background: rgba(18, 28, 18, 0.22); }
  #cartao { width: min(430px, 48vw); max-width: none; height: 100%; max-height: none; border-radius: 22px 0 0 22px; animation: entra-lado 0.22s ease-out; }
  .topo { padding-top: calc(14px + var(--seguro-topo)); }
  .topo::before { display: none; }
  .pe { padding-bottom: calc(12px + var(--seguro-base)); }
  @keyframes entra-lado { from { transform: translateX(40px); opacity: 0; } }
  /* o aviso e as setas de líder ficam na parte do mapa */
  body:has(#painel:not([hidden])) .seta-lider { visibility: hidden; }
}

/* celular deitado (tela baixa): topo numa faixa só, base e guia mais baixos */
@media (orientation: landscape) and (max-height: 520px) {
  .hud-topo { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 5px 6px; padding: calc(6px + var(--seguro-topo)) calc(8px + env(safe-area-inset-right, 0px)) 0 calc(8px + env(safe-area-inset-left, 0px)); }
  .barras { width: auto; max-width: none; flex: 0 1 auto; }
  .barra-rec { min-width: 132px; }
  .chips { width: auto; flex: 1 1 auto; }
  .chip { min-height: 34px; font-size: 13px; padding: 5px 10px; }
  #objetivo { flex: 0 1 auto; max-width: 46vw; padding: 3px 8px 4px; font-size: 13px; }
  body.ui-moldura-dialogo #objetivo { padding: 0 4px 1px; }
  #objetivo .tag { display: none; }
  #objetivo-texto { -webkit-line-clamp: 2; }
  #sabado { padding: 5px 10px; font-size: 13px; }
  .hud-base { padding: 0 calc(8px + env(safe-area-inset-right, 0px)) calc(6px + var(--seguro-base)) calc(8px + env(safe-area-inset-left, 0px)); gap: 8px; }
  .card-lider { width: 138px; padding: 5px 8px; }
  .card-lider .tarefa { min-height: 0; font-size: 12.5px; }
  .acoes { width: 360px; }
  body.ui-botao-secundario-base .acao { min-height: 52px; }
  #guia { height: calc(175px + var(--seguro-base)); }
  #guia-img { height: 140px; }
  .guia-balao { min-height: 0; }
  #guia-texto { min-height: 2.8em; font-size: 15px; }
  #guia-botoes .botao { min-height: 46px; }
  #guia-mini { bottom: calc(96px + var(--seguro-base)); width: 52px; height: 52px; }
  #toast { bottom: auto; top: calc(64px + var(--seguro-topo)); }
  body.com-guia #toast { bottom: auto; }
  #cartao .corpo { padding-bottom: 10px; }
  .topo h2 { font-size: 19px; }
  #modo-lote, #barra-percurso { top: calc(6px + var(--seguro-topo)); padding: 6px 8px 6px 12px; }
  .festa-fase .faixa { top: 45%; }
}
@media (orientation: landscape) and (max-height: 560px) {
  .abertura-trio { align-items: flex-end; }
  .abertura-trio .p-heroi { height: 66vh; margin: 0 -2vw; }
  .abertura-trio .p-bia, .abertura-trio .p-davi { height: 52vh; margin-bottom: 3vh; }
  .abertura-trio .p-davi { margin-left: 0; }
  .abertura-menu { min-height: 0; }
}
@media (orientation: landscape) and (max-height: 520px) {
  .barra-rec { flex: none; width: 152px; min-width: 0; }
  .barra-rec b { font-size: 13px; }
}
