/* Josias e o Carbono v2 */
:root { --tinta: #1d2a3a; --papel: #fffdf6; --verde: #2f9e5b; --ambar: #f2b53a; --alerta: #e2553a; --sombra: 0 6px 0 rgba(0, 0, 0, .22); }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #3b6fc4; color: var(--tinta); font: 600 15px/1.3 ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif; user-select: none; -webkit-user-select: none; overscroll-behavior: none; }
canvas#cena { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; }

#hud { position: fixed; top: max(8px, env(safe-area-inset-top)); left: max(8px, env(safe-area-inset-left)); right: max(8px, env(safe-area-inset-right)); display: flex; gap: 6px; align-items: center; pointer-events: none; z-index: 5; }
#hud .espaco { flex: 1; }
.chip { background: var(--papel); border-radius: 999px; padding: 6px 12px; display: flex; align-items: center; gap: 6px; box-shadow: 0 3px 0 rgba(0, 0, 0, .2); white-space: nowrap; font-size: 14px; }
.chip b { font-weight: 800; font-variant-numeric: tabular-nums; }
.chip.pulsa { animation: pulsa .35s; }
@keyframes pulsa { 40% { transform: scale(1.18); } }
.cubo { display: inline-block; width: 13px; height: 13px; background: #4b4458; border-radius: 3px; box-shadow: inset -3px -3px 0 rgba(0, 0, 0, .3), inset 2px 2px 0 rgba(255, 255, 255, .25); }
#h-co2 span { opacity: .6; font-weight: 600; }
#h-co2.passou { background: #ffe1d8; } #h-co2.passou .cubo { background: #b0402c; }
#h-animo .barra { width: 74px; height: 10px; background: #e3ddcc; border-radius: 6px; overflow: hidden; }
#h-animo .barra i { display: block; height: 100%; width: 50%; background: var(--verde); border-radius: 6px; transition: width .4s, background .4s; }
#hud.real #h-co2 { display: none; }

#fala { position: fixed; z-index: 6; transform: translate(-50%, -100%); background: var(--papel); border-radius: 14px; padding: 7px 12px; max-width: min(72vw, 300px); text-align: center; box-shadow: 0 3px 0 rgba(0, 0, 0, .2); pointer-events: none; animation: surge .18s; font-size: 14px; }
#fala::after { content: ""; position: absolute; left: 50%; bottom: -7px; margin-left: -7px; border: 7px solid transparent; border-top-color: var(--papel); border-bottom: 0; }
@keyframes surge { from { opacity: 0; transform: translate(-50%, -90%) scale(.9); } }

#fato { position: fixed; z-index: 7; left: 50%; bottom: 170px; transform: translateX(-50%); background: #1d2a3a; color: #fff; border-radius: 14px; padding: 9px 14px; max-width: min(92vw, 520px); text-align: center; box-shadow: 0 4px 0 rgba(0, 0, 0, .3); animation: sobe .25s; font-size: 14px; pointer-events: none; }
#fato b { color: #ffd84a; }
@keyframes sobe { from { opacity: 0; transform: translate(-50%, 12px); } }

#cartas { position: fixed; z-index: 8; left: 0; right: 0; bottom: max(10px, env(safe-area-inset-bottom)); display: flex; gap: 10px; justify-content: center; align-items: flex-end; padding: 0 10px; flex-wrap: nowrap; }
.carta { background: var(--papel); border-radius: 18px; padding: 10px 10px 9px; min-width: 104px; max-width: 150px; flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 3px; box-shadow: var(--sombra); animation: entra .25s backwards; transition: transform .1s; }
.carta:nth-child(2) { animation-delay: .05s; } .carta:nth-child(3) { animation-delay: .1s; } .carta:nth-child(4) { animation-delay: .15s; }
.carta:hover { transform: translateY(-4px); } .carta:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0, 0, 0, .22); }
.carta .ic { font-size: 30px; line-height: 1.1; } .carta .nome { font-weight: 800; font-size: 14px; text-align: center; line-height: 1.15; }
.carta .tags { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; font-size: 12px; font-weight: 700; margin-top: 2px; }
.carta .tags span { background: #efe9d8; border-radius: 8px; padding: 2px 6px; display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.carta .tags .co2 { background: #e2dfea; } .carta .tags .co2.alto { background: #ffd9cf; } .carta .tags .mais { background: #dff3e2; } .carta .tags .menos { background: #ffe6dc; }
.carta .tags .cubo { width: 10px; height: 10px; }
.carta[disabled] { opacity: .5; filter: grayscale(.6); }
.carta .trava { font-size: 11px; opacity: .7; text-align: center; }
@keyframes entra { from { opacity: 0; transform: translateY(40px); } }
#cartas .titulo { position: absolute; bottom: 100%; margin-bottom: 8px; background: rgba(29, 42, 58, .9); color: #fff; padding: 5px 12px; border-radius: 999px; font-size: 13px; animation: entra .2s; white-space: nowrap; }

#tela { position: fixed; inset: 0; z-index: 20; display: none; align-items: center; justify-content: center; padding: 14px; }
#tela.on { display: flex; } #tela.escuro { background: rgba(14, 22, 44, .72); } #tela.blocos { background: #151a2e; }
.painel { background: var(--papel); border-radius: 22px; padding: 18px; width: min(100%, 460px); max-height: calc(100dvh - 28px); overflow: auto; box-shadow: 0 8px 0 rgba(0, 0, 0, .25); display: flex; flex-direction: column; gap: 10px; text-align: center; animation: entra .25s; }
.painel.largo { width: min(100%, 680px); }
.painel h1 { margin: 0; font-size: 26px; line-height: 1.1; } .painel h2 { margin: 0; font-size: 19px; } .painel p { margin: 0; font-weight: 600; }
.painel .peq { font-size: 13px; opacity: .7; }
.botao { background: var(--verde); color: #fff; border-radius: 14px; padding: 11px 18px; font-weight: 800; font-size: 16px; box-shadow: 0 4px 0 #1f6f3f; }
.botao:active { transform: translateY(3px); box-shadow: 0 1px 0 #1f6f3f; } .botao.sec { background: #e6dfcc; color: var(--tinta); box-shadow: 0 4px 0 #bfb69c; }
.linhaB { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; color: #8df29a; background: #151a2e; border: 3px solid #8df29a; border-radius: 0; box-shadow: 8px 8px 0 rgba(0, 0, 0, .5); }
.mono .botao { background: #8df29a; color: #10231a; border-radius: 0; box-shadow: 4px 4px 0 #2a6b3a; }
.resumo { display: grid; grid-template-columns: auto 1fr auto; gap: 6px 10px; align-items: center; text-align: left; font-size: 15px; }
.resumo .v { font-weight: 800; } .estrelas { font-size: 34px; letter-spacing: 6px; }
.replay { font-size: 15px; min-height: 2.6em; }

/* portal 1 */
.zonas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.zona { border-radius: 16px; padding: 8px 6px 6px; display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 150px; box-shadow: 0 4px 0 rgba(0, 0, 0, .2); color: #fff; position: relative; }
.zona .ic { font-size: 28px; } .zona .n { font-size: 22px; font-weight: 800; } .zona .real { font-size: 12px; opacity: .9; min-height: 1.2em; }
.zona .monte { display: flex; flex-wrap: wrap-reverse; gap: 2px; justify-content: center; width: 86px; margin-top: auto; }
.zona .monte i { width: 15px; height: 15px; background: #4b4458; border-radius: 3px; box-shadow: inset -3px -3px 0 rgba(0, 0, 0, .3), inset 2px 2px 0 rgba(255, 255, 255, .25); animation: cai .25s; }
@keyframes cai { from { transform: translateY(-40px); opacity: 0; } }
.zona.ar { background: #6f8fd8; } .zona.mar { background: #2a8fb0; } .zona.terra { background: #3f9a52; }
.zona.certa { outline: 4px solid #ffd84a; }
.restam { font-size: 15px; } .restam b { font-size: 20px; }
.saiba { font-size: 13px; text-align: left; background: #eef4fb; border-radius: 12px; padding: 8px 12px; font-weight: 500; }

@media (max-width: 620px) { .chip { padding: 5px 9px; font-size: 13px; } #h-animo .barra { width: 48px; } #h-agua { display: none; } .carta { min-width: 0; padding: 8px 6px; } .carta .ic { font-size: 24px; } .carta .nome { font-size: 12.5px; } .carta .tags { font-size: 11px; } #fato { bottom: 150px; } }
@media (max-height: 520px) { #fato { bottom: 118px; } .carta .ic { font-size: 22px; } .carta { padding: 6px 8px; flex-direction: row; flex-wrap: wrap; justify-content: center; max-width: 190px; } .zona { min-height: 110px; } }

/* girar a cena */
#giro { position: fixed; z-index: 6; right: max(10px, env(safe-area-inset-right)); top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 8px; }
#giro button { width: 46px; height: 46px; border-radius: 50%; background: var(--papel); font-size: 24px; line-height: 1; box-shadow: 0 3px 0 rgba(0, 0, 0, .22); }
#giro button:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, .22); }
/* clarão ao ser sugado */
#tela.clarao { background: #fff; animation: clarao .38s; } #tela.clarao.some { animation: clarao2 .45s forwards; }
@keyframes clarao { from { opacity: 0; } } @keyframes clarao2 { to { opacity: 0; } }
@media (max-height: 520px) { #giro { top: 42%; } #giro button { width: 38px; height: 38px; font-size: 20px; } }

/* ---- jogo completo ---- */
#h-dia small { opacity: .55; font-weight: 700; } #h-dia .pts { letter-spacing: 2px; opacity: .55; }
.carta.dica { outline: 3px solid #ffd84a; }
.botao:disabled { opacity: .4; } .botao.peqb { padding: 7px 12px; font-size: 13px; box-shadow: 0 3px 0 rgba(0, 0, 0, .2); } .botao.sec.sel { background: var(--verde); color: #fff; }
.painel .selo { font: 800 12px ui-monospace, Menlo, Consolas, monospace; letter-spacing: .25em; color: #2f9e5b; } .painel .ped { font-size: 14px; }
.painel .corpo, .painel .pe { display: flex; flex-direction: column; gap: 8px; } .painel .linha { font-size: 16px; }
.estrelas span { opacity: .22; } .estrelas.peq2 { font-size: 22px; letter-spacing: 0; }
.porque { min-height: 1.4em; font-size: 14px; } .porque.ok { color: #1f7a45; } .porque.no { color: #b8442d; }
.pontos { display: flex; gap: 4px; justify-content: center; } .pontos i { width: 12px; height: 12px; border-radius: 50%; background: #ddd5c0; } .pontos i.ok { background: #2f9e5b; } .pontos i.no { background: #e2553a; }
/* separador */
.sep { display: grid; grid-template-columns: 1fr 1.2fr 1fr; gap: 8px; align-items: stretch; }
.lado { border-radius: 16px; padding: 12px 6px; color: #fff; display: flex; flex-direction: column; gap: 3px; justify-content: center; box-shadow: 0 4px 0 rgba(0, 0, 0, .22); font-size: 16px; } .lado small { font-weight: 600; font-size: 11.5px; opacity: .9; }
.lado.a { background: #2f9e5b; } .lado.b { background: #5b5470; } .lado:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, .22); }
.ficha { background: #fff; border-radius: 16px; min-height: 110px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 8px; box-shadow: 0 4px 0 rgba(0, 0, 0, .15); font-weight: 800; }
.ficha .ic, .item6 .ic { font-size: 40px; line-height: 1.1; } .ficha.entra, .item6.entra { animation: cai .22s; } .ficha.vaiA { transform: translateX(-60%) rotate(-8deg); opacity: 0; transition: .3s; } .ficha.vaiB { transform: translateX(60%) rotate(8deg); opacity: 0; transition: .3s; }
.setores { display: flex; flex-direction: column; gap: 3px; font-size: 13px; text-align: left; } .setores div { display: grid; grid-template-columns: 150px 1fr 40px; align-items: center; gap: 6px; } .setores i { height: 12px; background: var(--ambar); border-radius: 6px; } .setores b { text-align: right; }
/* terreno */
.terreno { display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; } .lote { aspect-ratio: 1; border-radius: 6px; font-size: clamp(14px, 3.2vw, 22px); display: flex; align-items: center; justify-content: center; padding: 0; }
.lote.mata { background: #2f8f4e; } .lote.mata.corte { background: #b9a26a; } .lote.pasto { background: #c9b98a; } .lote.pasto.p1 { background: #9fc56a; } .lote.pasto.p2 { background: #c7c35a; } .lote.pasto.p3 { background: #4fa058; }
.fichas3, .fontes4 { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; } .fichas3 button, .fontes4 button { background: #fff; border-radius: 12px; padding: 7px 10px; box-shadow: 0 3px 0 rgba(0, 0, 0, .15); font-size: 13.5px; } .fichas3 button.sel, .fontes4 button.sel { outline: 3px solid var(--verde); }
.fontes4 button { display: flex; flex-direction: column; align-items: center; min-width: 58px; } .fontes4 .ic { font-size: 24px; }
.placar3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; } .placar3 div { background: #fff; border-radius: 12px; padding: 6px; } .placar3 small { display: block; font-size: 11.5px; opacity: .7; } .placar3 b { font-size: 17px; } .boa b { color: #1f7a45; } .ruim b { color: #c2452c; }
/* usina e viagens */
.slots { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; } .slot { aspect-ratio: 1; border-radius: 8px; background: #e6dfcc; font-size: clamp(16px, 3.6vw, 26px); padding: 0; border: 2px dashed #bdb39a; } .slot.cheio { background: #fff; border-style: solid; }
.med4 { display: flex; flex-direction: column; gap: 5px; } .med4 > div { display: grid; grid-template-columns: 92px 1fr 70px; gap: 8px; align-items: center; font-size: 13px; text-align: left; } .med4 .b { position: relative; height: 12px; background: #e3ddcc; border-radius: 6px; } .med4 .b i { display: block; height: 100%; border-radius: 6px; background: #b9b3a2; } .med4 .boa .b i { background: #2f9e5b; } .med4 .ruim .b i { background: #e2553a; } .med4 .b u { position: absolute; top: -3px; bottom: -3px; width: 2px; background: #1d2a3a; } .med4 b { text-align: right; }
.viagem { display: grid; grid-template-columns: 120px 1fr; gap: 8px; align-items: center; text-align: left; font-size: 13.5px; } .viagem > div { display: flex; gap: 5px; flex-wrap: wrap; } .viagem button { background: #fff; border-radius: 12px; padding: 5px 8px; box-shadow: 0 3px 0 rgba(0, 0, 0, .15); display: flex; flex-direction: column; align-items: center; min-width: 62px; } .viagem button.sel { outline: 3px solid var(--verde); } .viagem .ic { font-size: 22px; } .viagem small { font-size: 10.5px; font-weight: 700; opacity: .75; }
/* lixo */
.item6 { background: #fff; border-radius: 16px; padding: 10px; display: flex; flex-direction: column; align-items: center; gap: 2px; align-self: center; min-width: 180px; box-shadow: 0 4px 0 rgba(0, 0, 0, .15); }
.cestos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; } .cestos button { color: #fff; border-radius: 12px; padding: 11px 4px; font-weight: 800; box-shadow: 0 4px 0 rgba(0, 0, 0, .25); } .cestos button:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, .25); }
/* loja, Bia, final, fontes */
.loja { display: flex; flex-direction: column; gap: 6px; text-align: left; } .loja .item { display: grid; grid-template-columns: 40px 1fr auto; gap: 8px; align-items: center; background: #fff; border-radius: 14px; padding: 8px 10px; } .loja .item.tem { background: #dff3e2; } .loja .ic { font-size: 28px; } .loja small { display: block; font-weight: 600; opacity: .7; font-size: 12.5px; } .loja .ok { color: #1f7a45; font-size: 13px; white-space: nowrap; }
.opsB { display: flex; flex-direction: column; gap: 7px; } .opsB .botao { text-align: left; font-size: 14.5px; }
.barrasF { display: flex; flex-direction: column; gap: 4px; font-size: 13px; text-align: left; } .barrasF div { display: grid; grid-template-columns: 86px 1fr 34px; gap: 6px; align-items: center; } .barrasF i { height: 13px; background: #6b6480; border-radius: 6px; } .barrasF i.v { background: #2f9e5b; } .barrasF b { text-align: right; }
.fontesT { overflow: auto; max-height: 50vh; text-align: left; } .fontesT table { border-collapse: collapse; font-size: 12.5px; font-weight: 500; } .fontesT td { border-bottom: 1px solid #ddd5c0; padding: 4px 6px; vertical-align: top; }
@media (max-width: 620px) { .viagem { grid-template-columns: 1fr; gap: 2px; } .sep { grid-template-columns: 1fr 1fr; } .sep .ficha { grid-column: 1 / 3; grid-row: 1; min-height: 84px; } .setores div { grid-template-columns: 110px 1fr 36px; } .med4 > div { grid-template-columns: 70px 1fr 62px; } }
@media (max-height: 520px) { .painel { padding: 10px; gap: 6px; } .painel h2 { font-size: 16px; } .ficha { min-height: 70px; } .ficha .ic, .item6 .ic { font-size: 26px; } .terreno { grid-template-columns: repeat(25, 1fr); } .lote { font-size: 12px; } .cestos { grid-template-columns: repeat(6, 1fr); } .zona { min-height: 96px; } }

/* contexto atual: ponto em debate, cubos de desmatamento, troca de cenário */
.carta .tags .deb { background: #fff1c7; } #h-desmat { background: #ffe1d8; } #h-desmat .cubo { background: #c0392b; }
#tela.troca { background: #10182c; animation: clarao .22s; } #tela.troca.some { animation: clarao2 .3s forwards; }

/* balanço: a parte dele × a parte que ele não controla */
.partes { display: grid; grid-template-columns: 1fr 1.25fr; gap: 10px; text-align: left; margin: 10px 0 4px; }
.parte { border-radius: 12px; padding: 9px 12px; font-size: 13px; line-height: 1.35; }
.parte h3 { margin: 0 0 4px; font-size: 14px; }
.parte p { margin: 4px 0; }
.parte.sua { background: #e6f5ec; border: 2px solid #2f9e5b; }
.parte.nao { background: #eef1f6; border: 2px solid #8b93a7; }
.setores { display: flex; flex-direction: column; gap: 3px; font-size: 12px; margin: 4px 0; }
.setores div { display: grid; grid-template-columns: 1fr minmax(60px, 110px) 30px; gap: 6px; align-items: center; }
.setores i { height: 9px; background: #8b93a7; border-radius: 5px; display: block; justify-self: start; }
.setores b { text-align: right; }
@media (max-width: 640px) { .partes { grid-template-columns: 1fr; gap: 6px; } .parte { padding: 7px 10px; font-size: 12px; } }
.painel.final { width: min(100%, 780px); } .final .barrasF { gap: 2px; } .final .barrasF i { height: 11px; }
.parte.sua p:not(:first-of-type) { font-weight: 500; } .parte .peq { opacity: 1; }
@media (max-height: 460px) { .final .barrasF { font-size: 11px; } .final .barrasF i { height: 8px; } .parte { padding: 6px 9px; font-size: 11.5px; } .parte h3 { font-size: 12.5px; } .setores { font-size: 11px; gap: 1px; } }
.parte .peq { font-size: inherit; }
.cred { display: flex; flex-direction: column; gap: 8px; font-size: 14px; } .cred p { font-weight: 500; } .cred a { color: #1f6fb2; }
#menuB { position: fixed; z-index: 35; right: max(10px, env(safe-area-inset-right)); top: calc(50% - 104px); width: 46px; height: 46px; border-radius: 50%; background: var(--papel); font-size: 22px; line-height: 1; box-shadow: 0 3px 0 rgba(0, 0, 0, .22); }
#menuB:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, .22); }
#menu { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; padding: 14px; background: rgba(14, 22, 44, .6); }
#menu[hidden] { display: none; }
#menu .painel { width: min(100%, 420px); }
@media (max-height: 520px) { #menuB { width: 38px; height: 38px; font-size: 18px; top: calc(42% - 86px); } }
