:root {
  color-scheme: light;
  --tinta: #2b211c;
  --papel: #efe3c8;
  --papel-2: #e2d2ae;
  --borda: #3b2a22;
  --claro: rgba(255, 255, 255, .55);
  --escuro: rgba(0, 0, 0, .28);
  --verde: #4f9d3a;
  --verde-esc: #2f6b22;
  --laranja: #d9822b;
  --ceu-1: #7cc4f0;
  --ceu-2: #cfeefc;
  --t: 30px;
  --tarde: 0;
  font-family: ui-rounded, "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100dvh; color: var(--tinta);
  background: linear-gradient(var(--ceu-1), var(--ceu-2) 70%) fixed;
  -webkit-tap-highlight-color: transparent; overscroll-behavior: none; user-select: none; -webkit-user-select: none;
}
#app { max-width: 1120px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }
.carregando-txt { padding: 40px; font-size: 22px; font-weight: 800; text-align: center; }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
.ico, .mini, .peca, .voando, .particula, .bloco-mina, .pilha, .placa, .tatu { image-rendering: pixelated; image-rendering: crisp-edges; }
.ico { display: inline-block; width: 1.1em; height: 1.1em; background-size: cover; vertical-align: -0.15em; }

/* painel "de bloco": borda escura + chanfro claro/escuro */
.painel, .pergunta, .construcao, .cena, .jogo-card, .opcao, .andaime.aberto, .resumo-dia, .aviso {
  background: var(--papel); border: 3px solid var(--borda); border-radius: 4px;
  box-shadow: inset 3px 3px 0 var(--claro), inset -3px -3px 0 var(--escuro), 0 4px 0 rgba(0, 0, 0, .18);
}

/* topo */
.topo { display: flex; align-items: center; gap: 8px; padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top)); }
.marca { font-weight: 900; font-size: 22px; letter-spacing: .5px; padding: 0 4px; text-shadow: 2px 2px 0 rgba(255, 255, 255, .6); }
.titulo { flex: 1; font-weight: 900; font-size: 20px; }
.bt-icone {
  width: 48px; height: 48px; display: grid; place-items: center; background: var(--papel); border: 3px solid var(--borda);
  border-radius: 4px; box-shadow: inset 2px 2px 0 var(--claro), inset -2px -2px 0 var(--escuro);
}
.bt-icone svg { width: 26px; height: 26px; }
.bt-icone.desl { opacity: .55; }
.bt-icone:active { transform: translateY(2px); }

/* balão do Tatu */
.balao { display: flex; align-items: center; gap: 8px; }
.balao p { flex: 1; margin: 0; font-size: 19px; font-weight: 800; line-height: 1.3; }
.bt-ouvir { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--borda); background: #fff7e0; display: grid; place-items: center; }
.bt-ouvir svg { width: 22px; height: 22px; }

/* mundo */
.casa { display: flex; flex-direction: column; gap: 12px; padding: 0 12px 16px; }
.mundo {
  position: relative; height: clamp(230px, 42vh, 380px); overflow-x: auto; overflow-y: hidden;
  border: 3px solid var(--borda); border-radius: 4px; scrollbar-width: thin;
  background: linear-gradient(#6fb9ea, #bfe6fb 75%);
}
.mundo .ceu { position: sticky; left: 0; top: 0; width: 100%; height: 0; z-index: 0; }
.mundo::before { content: ""; position: absolute; inset: 0; min-width: 100%; background: linear-gradient(#f08a5d, #6b4a7a); opacity: var(--tarde); pointer-events: none; }
.mundo .sol { position: absolute; right: 24px; top: 18px; width: 44px; height: 44px; background: #ffe36b; box-shadow: 0 0 0 6px rgba(255, 227, 107, .35); }
.mundo.noite { background: linear-gradient(#0f1a3a, #2a3a6a); }
.mundo.noite::before { opacity: 0; }
.mundo.noite .terreno { filter: brightness(.55) saturate(.8); }
.mundo .lua { position: absolute; right: 30px; top: 20px; width: 36px; height: 36px; background: #f2f0d8; box-shadow: -8px 0 0 0 #c9c7ad inset; }
.mundo.noite::after { content: ""; position: absolute; inset: 0; min-width: 100%; pointer-events: none;
  background-image: radial-gradient(2px 2px at 20% 20%, #fff 50%, transparent 51%), radial-gradient(2px 2px at 45% 12%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 70% 30%, #fff 50%, transparent 51%), radial-gradient(2px 2px at 85% 10%, #fff 50%, transparent 51%), radial-gradient(2px 2px at 10% 40%, #fff 50%, transparent 51%); }
.terreno { position: relative; height: 100%; min-width: calc(var(--t) * (7 + var(--lotes) * 4)); width: 100%; z-index: 1; }
.terreno::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--t) * 2);
  background: url(../img/luanti/default_grass_side.png) left top / var(--t) var(--t) repeat-x, url(../img/luanti/default_dirt.png) left top / var(--t) var(--t) repeat;
  image-rendering: pixelated;
}
.lote { position: absolute; bottom: calc(var(--t) * 2); left: calc(var(--t) * (4 + var(--i) * 4)); width: calc(var(--t) * 3); height: calc(var(--t) * 6); z-index: 2; }
.peca { position: absolute; width: var(--t); height: var(--t); left: calc(var(--x) * var(--t)); bottom: calc(var(--y) * var(--t)); background-size: cover; background-repeat: no-repeat; }
.peca.planta { background-size: contain; background-position: center bottom; }
.chao-lote { position: absolute; left: 0; bottom: calc(var(--t) * -1); width: calc(var(--t) * 3); height: var(--t); background-size: var(--t) var(--t); background-repeat: repeat-x; z-index: 3; }
.lote.novo { animation: cai .5s cubic-bezier(.3, 1.4, .5, 1) both; }
.lote.novo .peca { animation: brilho 1.6s ease-out .5s 1; }
@keyframes cai { from { transform: translateY(-120%); } to { transform: none; } }
@keyframes brilho { 0% { filter: brightness(1.6); } 100% { filter: none; } }
.tatu-no-mundo { position: absolute; left: var(--t); bottom: calc(var(--t) * 2); z-index: 2; }
.tatu-no-mundo canvas { width: calc(var(--t) * 2.6); display: block; }
.zzz { position: absolute; top: -18px; right: -6px; font-weight: 900; color: #fff; font-size: 16px; }

.jogos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.jogo-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; min-height: 140px; text-align: center; }
.jogo-card:active, .opcao:active { transform: translateY(3px); box-shadow: inset 3px 3px 0 var(--claro), inset -3px -3px 0 var(--escuro); }
.jogo-card strong { font-size: 18px; }
.jogo-card small { font-size: 13px; font-weight: 700; opacity: .8; }
.ico-grande { position: relative; width: 60px; height: 60px; display: grid; place-items: center; }
.ico-grande .ico.bloco { width: 56px; height: 56px; }
.ico-grande .ico.sobre { position: absolute; right: -10px; bottom: -6px; width: 36px; height: 36px; }
.ico-grande canvas.mini { width: 84px; }
.prog { display: block; width: 86%; height: 10px; background: #8b7a5e; border: 2px solid var(--borda); }
.prog i { display: block; height: 100%; background: var(--verde); transition: width .3s; }
.creditos-link { align-self: center; color: var(--tinta); opacity: .6; font-size: 13px; }

/* escolha da construção */
.escolha { display: flex; flex-direction: column; gap: 14px; padding: 0 12px 16px; }
.escolha > .balao { background: var(--papel); border: 3px solid var(--borda); padding: 10px 12px; }
.opcoes { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.opcao { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 8px; min-height: 180px; }
.opcao strong { font-size: 18px; }
.mini-lote { --t: 26px; --h: 5; position: relative; display: inline-block; width: calc(var(--t) * 3); height: calc(var(--t) * var(--h)); }
.mini-lote .peca.vazia { opacity: .2; outline: 2px dashed rgba(0, 0, 0, .55); outline-offset: -2px; }
.mini-lote .peca.chegou { animation: chegou .3s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes chegou { from { transform: scale(1.6); } to { transform: none; } }

/* jogo */
.jogo { display: grid; grid-template-columns: 1fr; gap: 10px; padding: 0 10px 12px; flex: 1; align-content: start; }
.lado-a, .lado-b { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.cena { position: relative; min-height: 190px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 10px; overflow: auto; }
.jogo-mina .cena { background: linear-gradient(rgba(20, 16, 14, .62), rgba(20, 16, 14, .62)), url(../img/luanti/default_cobble.png) center / 48px; image-rendering: pixelated; }
.jogo-bancada .cena { background: linear-gradient(rgba(40, 24, 10, .45), rgba(40, 24, 10, .45)), url(../img/luanti/default_wood.png) center / 48px; }
.jogo-loja .cena { background: linear-gradient(rgba(255, 240, 200, .35), rgba(255, 240, 200, .35)), url(../img/luanti/default_sand.png) center / 48px; }
.construcao { display: flex; align-items: center; gap: 12px; padding: 8px 12px; }
.construcao .mini-lote { --t: 22px; }
.construcao .meta { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.construcao .meta strong { font-size: 18px; }
.construcao .meta small { font-weight: 800; font-size: 15px; }
.construcao .prog { width: 100%; height: 16px; }

.parede { display: grid; grid-template-columns: repeat(3, auto); gap: 8px; }
.parede.um { grid-template-columns: auto; position: relative; }
.bloco-mina { position: relative; width: 80px; height: 80px; padding: 0; border: 3px solid #1d1d1d; background-size: cover; border-radius: 2px; box-shadow: 0 4px 0 rgba(0, 0, 0, .35); transition: transform .12s, opacity .12s; }
.parede.um .bloco-mina { width: 120px; height: 120px; }
.rachado { position: absolute; inset: 0; background: url(../img/luanti/crack_anylength.png) 0 0 / 100% 500%; image-rendering: pixelated; opacity: 0; }
.bloco-mina[data-g] .rachado { opacity: 1; }
.bloco-mina.treme { animation: treme .12s; }
@keyframes treme { 25% { transform: translate(-3px, 1px) rotate(-2deg); } 75% { transform: translate(3px, -1px) rotate(2deg); } }
.bloco-mina.quebrado { opacity: 0; transform: scale(.4); pointer-events: none; }
.bloco-mina.chama { outline: 4px solid #fff59a; outline-offset: 3px; animation: chama 1.2s ease-in-out infinite; }
@keyframes chama { 50% { outline-color: rgba(255, 245, 154, .2); } }
.dedo { position: absolute; right: -44px; bottom: -14px; font-size: 48px; animation: martela .9s ease-in-out infinite; transform-origin: 20% 80%; pointer-events: none; }
@keyframes martela { 50% { transform: rotate(-30deg); } }

.bancada { display: flex; align-items: center; gap: 12px; }
.grade { display: grid; grid-template-columns: repeat(3, 44px); gap: 4px; padding: 6px; background: #8b8b8b; border: 3px solid var(--borda); }
.slot { width: 44px; height: 44px; display: grid; place-items: center; background: #8b8b8b; box-shadow: inset 2px 2px 0 rgba(0, 0, 0, .4), inset -2px -2px 0 rgba(255, 255, 255, .35); position: relative; }
.slot .ico { width: 34px; height: 34px; }
.saida.slot { width: 64px; height: 64px; border: 3px solid var(--borda); }
.saida .ico { width: 48px; height: 48px; }
.fantasma { opacity: .25; filter: grayscale(1); }
.seta { font-size: 34px; font-weight: 900; color: #fff; text-shadow: 2px 2px 0 var(--borda); }
.ico.pula { animation: chegou .2s ease-out; }
.grade.fundiu .slot .ico { animation: some .35s ease-in forwards; }
@keyframes some { to { transform: scale(.2); opacity: 0; } }
.ingrediente { display: flex; align-items: center; gap: 10px; padding: 10px 18px; min-height: 60px; font-size: 20px; font-weight: 900; background: var(--papel); border: 3px solid var(--borda); box-shadow: inset 2px 2px 0 var(--claro), inset -2px -2px 0 var(--escuro); animation: chama 1.2s ease-in-out infinite; outline: 4px solid #fff59a; }
.ingrediente .ico { width: 40px; height: 40px; }
.ingrediente.usado { opacity: .4; animation: none; outline: none; }

.loja { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; justify-content: center; }
.tatu.balcao { width: 130px; }
.prateleira { display: flex; gap: 10px; padding: 8px; background: #7a5a3a url(../img/luanti/default_wood.png) center / 32px; border: 3px solid var(--borda); }
.mercadoria { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 84px; min-height: 92px; padding: 6px; background: var(--papel); border: 3px solid var(--borda); font-weight: 800; font-size: 14px; }
.mercadoria .ico { width: 46px; height: 46px; }
.mercadoria.escolhida { outline: 4px solid #fff59a; transform: translateY(-4px); }

.pergunta { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.equacao { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; font-size: 36px; font-weight: 900; line-height: 1.1; }
.equacao .ico { width: 34px; height: 34px; margin-right: 2px; }
.caixa { min-width: 72px; padding: 2px 10px; text-align: center; border: 3px dashed var(--borda); background: #fff; }
.resposta { height: 64px; display: grid; place-items: center; background: #fff; border: 3px solid var(--borda); font-size: 44px; font-weight: 900; border-radius: 4px; }
.resposta.vazio .valor::after { content: "_"; opacity: .35; }
.resposta.certo { background: #c9f2b4; border-color: var(--verde-esc); }
.resposta.treme { animation: treme .25s; }
.teclado { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.teclado button {
  min-height: 60px; font-size: 32px; font-weight: 900; background: #f6f1e4; border: 3px solid var(--borda); border-radius: 4px;
  box-shadow: inset 3px 3px 0 #fff, inset -3px -3px 0 rgba(0, 0, 0, .2), 0 3px 0 rgba(0, 0, 0, .25); display: grid; place-items: center;
}
.teclado button:active { transform: translateY(3px); box-shadow: inset 3px 3px 0 #fff, inset -3px -3px 0 rgba(0, 0, 0, .2); }
.teclado .ok { background: var(--verde); color: #fff; }
.teclado .apagar { background: #e8b36a; }
.teclado svg { width: 34px; height: 34px; }
.teclado.travado { opacity: .45; pointer-events: none; }
.calma { display: flex; align-items: center; gap: 10px; font-weight: 800; }
.calma i { flex: 1; height: 10px; background: #8b7a5e; border: 2px solid var(--borda); position: relative; overflow: hidden; }
.calma i::after { content: ""; position: absolute; inset: 0; background: var(--verde); transform-origin: left; animation: enche 2.5s linear forwards; }
@keyframes enche { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* andaime */
.andaime { display: none; }
.andaime.aberto { display: block; padding: 10px; background: #fffaf0; }
.andaime.na-cena { width: 100%; max-height: 100%; overflow: auto; align-self: stretch; }
.cena:has(.na-cena) { justify-content: flex-start; }
.passo + .passo { margin-top: 8px; }
.passo p { margin: 0 0 6px; font-size: 17px; font-weight: 800; }
.desenho { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.mini { position: relative; display: inline-block; width: 20px; height: 20px; background-size: cover; }
.mini.riscado, .pilha.riscado, .placa.riscado { opacity: .4; }
.mini.riscado::after, .pilha.riscado::after, .placa.riscado::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(45deg, transparent 42%, #c0392b 42% 58%, transparent 58%), linear-gradient(-45deg, transparent 42%, #c0392b 42% 58%, transparent 58%);
}
.quadros { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.quadro { display: grid; grid-template-columns: repeat(5, 20px); gap: 2px; padding: 3px; border: 2px dashed rgba(0, 0, 0, .35); }
.pilha { position: relative; display: inline-block; width: 18px; height: 120px; background-size: 18px 12px; background-repeat: repeat-y; border: 1px solid rgba(0, 0, 0, .4); }
.placa { position: relative; display: inline-block; width: 100px; height: 100px; background-size: 10px 10px; background-repeat: repeat; border: 1px solid rgba(0, 0, 0, .4); }
.pilha b, .placa b { position: absolute; left: 50%; bottom: -18px; transform: translateX(-50%); font-size: 12px; }
.posicional { display: inline-flex; align-items: flex-end; gap: 4px; padding-bottom: 18px; flex-wrap: wrap; }
.sinal { font-size: 30px; font-weight: 900; padding: 0 4px; align-self: center; }
.grupo { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px; border: 2px dashed rgba(0, 0, 0, .3); }
.grupo small { font-weight: 900; font-size: 18px; }
.coluna { display: flex; flex-direction: column-reverse; gap: 2px; }
.revela { padding: 8px 10px; background: #c9f2b4; border: 3px solid var(--verde-esc); font-size: 22px; font-weight: 900; margin-bottom: 8px; }
.colunas { border-collapse: collapse; font: 900 30px ui-monospace, monospace; }
.colunas th { font-size: 14px; opacity: .6; }
.colunas td { width: 44px; text-align: center; border: 2px solid rgba(0, 0, 0, .2); }
.colunas .tot td { border-top: 4px solid var(--borda); }
.colunas .u { background: #fff2b8; }
.colunas td.s { border: 0; width: 26px; }

/* aviso de desbloqueio */
.aviso { position: fixed; left: 50%; top: 16px; transform: translateX(-50%); z-index: 60; padding: 12px 20px; text-align: center; min-width: 240px; animation: desce .3s cubic-bezier(.3, 1.4, .5, 1); }
.aviso strong { font-size: 24px; }
.aviso p { margin: 4px 0 0; font-size: 18px; font-weight: 800; }
.aviso-itens { display: flex; gap: 8px; justify-content: center; }
.aviso-itens .ico { width: 40px; height: 40px; }
.aviso.sai { opacity: 0; transition: opacity .25s; }
@keyframes desce { from { transform: translate(-50%, -140%); } }
.voando { position: fixed; z-index: 70; width: 40px; height: 40px; background-size: cover; pointer-events: none; }
.particula { position: fixed; z-index: 70; width: 10px; height: 10px; background-size: 400%; pointer-events: none; }

/* tutorial */
.tutorial { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 0 12px 16px; }
.tutorial > .balao { width: 100%; max-width: 560px; background: var(--papel); border: 3px solid var(--borda); padding: 10px 12px; }
.tatu.guia { width: 140px; }
.palco { width: 100%; max-width: 560px; display: flex; flex-direction: column; align-items: center; gap: 12px; min-height: 160px; justify-content: center; }
.palco .teclado { width: 100%; }
.palco .resposta { width: 100%; }
.grande { min-height: 64px; min-width: 220px; padding: 10px 24px; font-size: 26px; font-weight: 900; color: #fff; background: var(--verde); border: 3px solid var(--borda); border-radius: 4px; box-shadow: inset 3px 3px 0 rgba(255, 255, 255, .35), inset -3px -3px 0 rgba(0, 0, 0, .25), 0 4px 0 rgba(0, 0, 0, .3); }
.grande:active { transform: translateY(3px); }
.escondido { display: none; }
.mochila { display: flex; align-items: center; gap: 6px; padding: 6px; background: #6d6d6d; border: 3px solid var(--borda); }
.mochila .rotulo { color: #fff; font-weight: 800; font-size: 13px; writing-mode: vertical-rl; transform: rotate(180deg); }
.mochila .slot { width: 56px; height: 56px; border: 0; padding: 0; }
.mochila .slot .ico { width: 40px; height: 40px; }
.mochila .slot b { position: absolute; right: 3px; bottom: 1px; color: #fff; font-size: 18px; text-shadow: 2px 2px 0 #000; }
.pisca { outline: 4px solid #fff59a; animation: chama 1.2s ease-in-out infinite; }
.receita { display: flex; align-items: center; gap: 10px; padding: 12px; background: #8b8b8b; border: 3px solid var(--borda); }
.receita .slot { width: 64px; height: 64px; }
.receita .slot .ico { width: 48px; height: 48px; }
.receita .mais { font-size: 34px; font-weight: 900; color: #fff; text-shadow: 2px 2px 0 var(--borda); }
.receita.fundiu .alvo .ico { animation: some .35s ease-in forwards; }

/* noite */
.noite-tela .resumo-dia { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.hoje { display: flex; flex-wrap: wrap; gap: 12px; }
.feito { display: flex; flex-direction: column; align-items: center; gap: 4px; font-weight: 800; }
.contas { margin: 0; font-weight: 800; opacity: .8; }
.nada { margin: 0; font-weight: 700; }

/* telas largas: cena à esquerda, conta à direita */
@media (min-width: 900px) {
  /* tablet/desktop: o jogo ocupa a tela toda — cena (ou andaime) à esquerda, conta e teclado à direita */
  :root { --t: 48px; }
  .topo { padding: 12px 16px; }
  .titulo { font-size: 26px; }
  .marca { font-size: 26px; }
  .bt-icone { width: 56px; height: 56px; }
  .jogo { grid-template-columns: 1.1fr 1fr; grid-template-rows: minmax(0, 1fr); height: calc(100dvh - 82px); align-content: stretch; gap: 16px; padding: 0 16px 16px; }
  .lado-a, .lado-b { height: 100%; min-height: 0; gap: 12px; }
  .cena { flex: 1; min-height: 0; }
  .lado-b .teclado { flex: 1; grid-auto-rows: 1fr; gap: 10px; }
  .teclado button { min-height: 0; font-size: 44px; }
  .teclado svg { width: 44px; height: 44px; }
  .balao p { font-size: 23px; }
  .bt-ouvir { width: 52px; height: 52px; }
  .equacao { font-size: 44px; }
  .equacao .ico { width: 40px; height: 40px; }
  .caixa { min-width: 84px; }
  .resposta { height: 88px; flex: none; font-size: 58px; }
  .bloco-mina { width: 128px; height: 128px; }
  .parede { gap: 12px; }
  .construcao { padding: 10px 14px; }
  .construcao .mini-lote { --t: 26px; }
  .construcao .meta strong { font-size: 22px; }
  .grade { grid-template-columns: repeat(3, 64px); }
  .grade .slot { width: 64px; height: 64px; }
  .grade .slot .ico { width: 50px; height: 50px; }
  .saida.slot { width: 92px; height: 92px; }
  .saida .ico { width: 72px; height: 72px; }
  .ingrediente { font-size: 26px; min-height: 76px; }
  .ingrediente .ico { width: 54px; height: 54px; }
  .tatu.balcao { width: 190px; }
  .mercadoria { width: 116px; min-height: 124px; font-size: 17px; }
  .mercadoria .ico { width: 64px; height: 64px; }
  .andaime.na-cena { padding: 14px; }
  .passo p { font-size: 21px; }
  .mini { width: 28px; height: 28px; }
  .quadro { grid-template-columns: repeat(5, 28px); gap: 3px; }
  .pilha { width: 26px; height: 170px; background-size: 26px 17px; }
  .placa { width: 130px; height: 130px; background-size: 13px 13px; }
  .pilha b, .placa b { font-size: 15px; bottom: -22px; }
  .sinal { font-size: 40px; }
  .grupo small { font-size: 24px; }
  .colunas { font-size: 44px; }
  .colunas td { width: 64px; }
  .revela { font-size: 30px; }
  /* casa */
  .casa { gap: 16px; padding: 0 16px 20px; }
  .mundo { height: clamp(320px, 54vh, 560px); }
  .jogos { gap: 16px; }
  .jogo-card { min-height: 210px; gap: 10px; }
  .jogo-card strong { font-size: 26px; }
  .jogo-card small { font-size: 16px; }
  .ico-grande { width: 92px; height: 92px; }
  .ico-grande .ico.bloco { width: 86px; height: 86px; }
  .ico-grande .ico.sobre { width: 54px; height: 54px; }
  .ico-grande canvas.mini { width: 120px; }
  .prog { height: 14px; }
  /* escolha */
  .opcoes { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
  .opcao { min-height: 300px; justify-content: center; }
  .opcao .mini-lote { --t: 44px; }
  .opcao strong { font-size: 26px; }
  .escolha > .balao, .tutorial > .balao { padding: 14px 18px; }
  /* tutorial */
  .tutorial { gap: 18px; }
  .tutorial > .balao, .palco { max-width: 760px; }
  .tatu.guia { width: 200px; }
  .parede.um .bloco-mina { width: 180px; height: 180px; }
  .dedo { font-size: 72px; right: -70px; }
  .palco .teclado { grid-auto-rows: 76px; }
  .palco .resposta { height: 80px; }
  .mochila .slot { width: 76px; height: 76px; }
  .mochila .slot .ico { width: 56px; height: 56px; }
  .receita .slot { width: 96px; height: 96px; }
  .receita .slot .ico { width: 74px; height: 74px; }
  .grande { min-height: 80px; font-size: 32px; min-width: 300px; }
  .noite-tela .resumo-dia { padding: 18px; }
  .feito .mini-lote { --t: 34px; }
}
@media (min-width: 600px) and (max-width: 899px) {
  .cena { min-height: 260px; }
  .bloco-mina { width: 96px; height: 96px; }
  .equacao { font-size: 42px; }
  .equacao .ico { width: 38px; height: 38px; }
  .balao p { font-size: 21px; }
  .teclado button { font-size: 36px; }
  .resposta { height: 68px; font-size: 46px; }
  .construcao .mini-lote { --t: 20px; }
  .mundo { height: clamp(300px, 44vh, 520px); }
  .jogo-card { min-height: 190px; }
}
/* tela larga e baixa (paisagem de celular / tablet pequeno): teclado aperta pela altura */
@media (min-width: 900px) and (max-height: 640px) {
  .equacao { font-size: 38px; }
  .resposta { height: 64px; font-size: 44px; }
  .teclado button { font-size: 34px; }
  .balao p { font-size: 19px; }
}
@media (max-width: 899px) {
  /* celular e tablet em pé: o teclado cresce até o fim da tela */
  .jogo { display: flex; flex-direction: column; min-height: calc(100dvh - 66px); gap: 8px; }
  .lado-b { flex: 1; }
  .lado-b .teclado { flex: 1; grid-auto-rows: minmax(54px, 1fr); }
  .lado-a, .lado-b { gap: 8px; }
  .cena { min-height: 168px; max-height: 34vh; padding: 8px; }
  .andaime.na-cena { padding: 8px; }
  .mini { width: 16px; height: 16px; }
  .quadro { grid-template-columns: repeat(5, 16px); }
  .pilha { width: 14px; height: 80px; background-size: 14px 8px; }
  .placa { width: 70px; height: 70px; background-size: 7px 7px; }
  .passo p { font-size: 15px; }
  .colunas { font-size: 24px; }
  .colunas td { width: 36px; }
  .bloco-mina { width: 66px; height: 66px; }
  .construcao { padding: 4px 10px; gap: 10px; }
  .construcao .mini-lote { --t: 14px; }
  .construcao .meta { flex-direction: row; align-items: center; gap: 8px; }
  .construcao .meta strong { font-size: 15px; white-space: nowrap; }
  .construcao .prog { height: 12px; }
  .pergunta { padding: 8px 10px; gap: 6px; }
  .balao p { font-size: 17px; }
  .equacao { font-size: 30px; }
  .equacao .ico { width: 28px; height: 28px; }
  .resposta { height: 52px; font-size: 36px; }
  .teclado { gap: 6px; }
  .teclado button { min-height: 54px; font-size: 28px; }
  .grade { grid-template-columns: repeat(3, 34px); }
  .grade .slot { width: 34px; height: 34px; }
  .grade .slot .ico { width: 26px; height: 26px; }
  .tatu.balcao { width: 96px; }
  .mercadoria { width: 74px; min-height: 80px; }
  .mercadoria .ico { width: 38px; height: 38px; }
}
@media (max-width: 380px) {
  .equacao { font-size: 30px; }
  .bloco-mina { width: 70px; height: 70px; }
  .teclado button { min-height: 54px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* andaime vivo: um modelo só que muda enquanto a voz fala */
.modelo { display: flex; align-items: flex-end; gap: 18px; flex-wrap: wrap; padding: 10px 4px 26px; }
.modelo .pilhas { display: flex; gap: 6px; align-items: flex-end; }
.modelo .soltos { display: grid; grid-template-columns: repeat(5, auto); gap: 4px; align-content: end; }
.modelo .pilha { width: 30px; height: 190px; background-size: 30px 19px; transition: opacity .35s, transform .35s, filter .2s; }
.modelo .mini { width: 30px; height: 30px; transition: opacity .35s, transform .35s, filter .2s; }
.vivo.pisca { animation: vivo-pisca .9s ease-in-out 2; }
@keyframes vivo-pisca { 50% { filter: brightness(1.7) drop-shadow(0 0 6px #fff59a); transform: translateY(-4px); } }
.vivo.acesa { filter: brightness(1.35) drop-shadow(0 0 5px #fff59a); outline: 3px solid #fff59a; }
.vivo.tirado { opacity: .15; transform: translateY(18px) scale(.85); }
.vivo.tirado::after { content: ""; position: absolute; inset: 0; background: linear-gradient(45deg, transparent 42%, #c0392b 42% 58%, transparent 58%), linear-gradient(-45deg, transparent 42%, #c0392b 42% 58%, transparent 58%); }
.pilha.quebrada { opacity: 0; transform: scaleY(.1); width: 0; margin: 0 -3px; transition: all .4s; }
.mini.novo-solto { animation: novo-solto .35s cubic-bezier(.3, 1.5, .5, 1) both; }
@keyframes novo-solto { from { transform: translateY(-40px) scale(.4); opacity: 0; } }
.modelo.brilha { animation: vivo-pisca .9s ease-in-out 1; }
.equacao .foco { outline: 4px solid #fff59a; border-radius: 4px; }
.teclado.chama-teclado .ok, .teclado.chama-teclado button:not(.apagar):not(.ok) { animation: chama 1.2s ease-in-out 2; }
