/* Player Avante v2 — estilo tirinha: papel claro, traço preto, laranja e verde-azulado da marca.
   Leve de propósito (laboratório NComputing): só transform/opacity, sem blur nem sombras pesadas. */
@font-face { font-family: Poppins; src: url(Poppins-Regular.ttf); font-weight: 400; }
@font-face { font-family: Poppins; src: url(Poppins-SemiBold.ttf); font-weight: 600; }
:root {
  --laranja: #E68E27; --laranja-forte: #E35205; --verde: #00816D; --verde-claro: #e2f2ee;
  --tinta: #1b1b1b; --papel: #fffdf7; --cinza: #6b6b6b; --linha: #1b1b1b; --ok: #3f9e4d; --erro: #d15b4a;
  --raio: 14px; --claro: #fff7e9; --sobre-destaque: #fff;
}
/* Temas de cor por curso (aula.json "tema"): só muda o destaque. Logo, letras e personagens continuam iguais. */
body[data-tema="verde-azulado"] { --laranja: #00816D; --laranja-forte: #00695A; --verde: #E68E27; --verde-claro: #fdf0e0; --claro: #e2f2ee; }
body[data-tema="verde"] { --laranja: #6CC24A; --laranja-forte: #3F8A2A; --claro: #eef8e9; --sobre-destaque: #1b1b1b; }
body[data-tema="amarelo"] { --laranja: #F0E87B; --laranja-forte: #8C7A0E; --claro: #fdfbe3; --sobre-destaque: #1b1b1b; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: 'Emoji Avante', Poppins, system-ui, sans-serif; color: var(--tinta); background: var(--papel);
  background-image: radial-gradient(#00000010 1px, transparent 1px); background-size: 14px 14px;
  display: flex; flex-direction: column; }
button { font: inherit; cursor: pointer; }

.topo { display: flex; align-items: center; gap: 16px; padding: 10px 20px; border-bottom: 3px solid var(--linha); background: #fff; }
.marca { font-weight: 600; letter-spacing: .08em; background: var(--verde); color: #fff; padding: 4px 10px; border-left: 5px solid var(--laranja); }
.titulos { display: flex; flex-direction: column; line-height: 1.2; font-size: 13px; color: var(--cinza); }
.titulos b { color: var(--tinta); font-size: 16px; }
.progresso { flex: 1; height: 10px; border: 2px solid var(--linha); border-radius: 99px; overflow: hidden; background: #fff; }
#barra { height: 100%; width: 0; background: var(--laranja); transition: width .4s; }
.xp { font-weight: 600; font-size: 18px; border: 2px solid var(--linha); border-radius: 99px; padding: 4px 14px; background: var(--claro); }
.xp.pulo { animation: pulo .5s; }
@keyframes pulo { 50% { transform: scale(1.25); } }

#palco { flex: 1; min-height: 0; display: grid; grid-template-rows: auto 1fr; gap: 10px; padding: 14px 24px 6px; max-width: 1280px; width: 100%; margin: 0 auto; }
#elenco { display: grid; grid-template-columns: 120px 1fr 120px; align-items: end; gap: 14px; min-height: 150px; }
.ator { margin: 0; text-align: center; opacity: 0; transform: translateY(10px); transition: opacity .3s, transform .3s; }
.ator.on { opacity: 1; transform: none; }
/* Busto: a imagem é a ficha de corpo inteiro do AZDIN; a moldura recorta do peito para cima. */
.ator .moldura { width: 120px; height: 130px; margin: 0 auto; overflow: hidden; border: 3px solid var(--linha); border-radius: 50% 50% 14px 14px; background: #fff; transition: transform .15s; }
.ator .moldura img { display: block; width: 100%; transform: scale(2.3); transform-origin: 50% 9%; }
.ator.falando .moldura { transform: translateY(-5px) rotate(-1.5deg); border-color: var(--laranja); }
.ator figcaption { font-size: 12px; font-weight: 600; }
.balao { position: relative; align-self: center; background: #fff; border: 3px solid var(--linha); border-radius: 22px; padding: 12px 18px; font-size: 18px; min-height: 64px; }
.balao .quem { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; }
.balao .fala { margin: 2px 0 0; line-height: 1.45; }
.balao.esq::after, .balao.dir::after { content: ""; position: absolute; bottom: 14px; width: 18px; height: 18px; background: #fff; border: 3px solid var(--linha); transform: rotate(45deg); }
.balao.esq::after { left: -12px; border-top: 0; border-right: 0; }
.balao.dir::after { right: -12px; border-bottom: 0; border-left: 0; }
.oculto { visibility: hidden; }

#conteudo { min-height: 0; overflow: auto; display: flex; flex-direction: column; align-items: center; gap: 14px; padding-bottom: 8px; }
.cartao { background: #fff; border: 3px solid var(--linha); border-radius: var(--raio); padding: 18px 22px; width: min(980px, 100%); }
.cartao h2 { margin: 0 0 6px; font-size: 26px; }
.cartao h3 { margin: 0 0 8px; }
.cartao p { margin: 6px 0; font-size: 17px; line-height: 1.5; }
.etiqueta { display: inline-block; background: var(--laranja); color: var(--sobre-destaque); font-weight: 600; font-size: 13px; padding: 2px 10px; border-radius: 99px; margin-bottom: 8px; }
.grade { display: grid; gap: 12px; width: min(980px, 100%); grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.opcao { background: #fff; border: 3px solid var(--linha); border-radius: var(--raio); padding: 14px 16px; text-align: left; font-size: 17px; transition: transform .1s; }
.opcao:hover:not(:disabled) { transform: translateY(-2px); background: var(--claro); }
.opcao.certa { background: #e9f7e6; border-color: var(--ok); }
.opcao.errada { background: #fceeeb; border-color: var(--erro); }
.opcao.escolhida { outline: 4px solid var(--laranja); }
.opcao:disabled { cursor: default; }
.feedback { width: min(980px, 100%); border-left: 6px solid var(--verde); background: var(--verde-claro); padding: 12px 16px; border-radius: 8px; font-size: 17px; line-height: 1.5; }
.feedback.ruim { border-color: var(--erro); background: #fceeeb; }

/* classificar */
.itens { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; width: min(980px, 100%); }
.item { background: #fff; border: 3px solid var(--linha); border-radius: 99px; padding: 8px 16px; font-size: 16px; }
.item.sel { background: var(--laranja); color: var(--sobre-destaque); transform: scale(1.06); }
.item.feito { visibility: hidden; }
.grupo { background: #fff; border: 3px dashed var(--linha); border-radius: var(--raio); padding: 12px; min-height: 120px; }
.grupo.alvo { border-style: solid; background: var(--claro); }
.grupo h4 { margin: 0 0 4px; font-size: 18px; }
.grupo small { color: var(--cinza); }
.grupo .dentro { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.grupo .dentro span { background: var(--verde-claro); border: 2px solid var(--verde); border-radius: 99px; padding: 2px 10px; font-size: 14px; }
.grupo.treme { animation: treme .35s; }
@keyframes treme { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* explorar */
/* A moldura encolhe até o tamanho da imagem: assim os pontos (em %) caem sempre no lugar certo. */
.mapa { position: relative; max-width: min(980px, 100%); border: 3px solid var(--linha); border-radius: var(--raio); background: #fff; overflow: hidden; line-height: 0; }
.mapa img, .mapa video { display: block; max-width: 100%; max-height: 46vh; width: auto; height: auto; }
.ponto { position: absolute; transform: translate(-50%, -50%); background: var(--laranja); color: var(--sobre-destaque); border: 3px solid var(--linha); border-radius: 99px; padding: 4px 12px; font-weight: 600; font-size: 14px; }
.ponto::before { content: "?"; }
.ponto.visto { background: var(--verde); }
.ponto.visto::before { content: ""; }
.contador { font-weight: 600; }

/* relâmpago */
.relogio { width: min(600px, 100%); height: 12px; border: 2px solid var(--linha); border-radius: 99px; overflow: hidden; }
.relogio div { height: 100%; background: var(--verde); width: 100%; }
.palavra { font-size: 40px; font-weight: 600; text-align: center; padding: 20px; }
.duas { display: flex; gap: 16px; }
.duas .opcao { font-size: 22px; font-weight: 600; padding: 18px 36px; text-align: center; }

/* missão */
.check { display: flex; gap: 12px; align-items: center; padding: 10px 6px; border-bottom: 2px dashed #0002; font-size: 17px; cursor: pointer; }
.check input { width: 24px; height: 24px; accent-color: var(--verde); }

/* fechamento */
.medalha { font-size: 90px; text-align: center; animation: gira 1s ease-out; }
@keyframes gira { from { transform: scale(.2) rotate(-200deg); opacity: 0; } }
.total { font-size: 32px; font-weight: 600; text-align: center; }

.rodape { display: flex; align-items: center; gap: 12px; padding: 10px 20px; border-top: 3px solid var(--linha); background: #fff; }
.rodape button { border: 3px solid var(--linha); border-radius: 99px; padding: 10px 22px; background: #fff; font-weight: 600; }
#btn-continuar { margin-left: auto; background: var(--laranja); color: var(--sobre-destaque); font-size: 18px; }
#btn-continuar:disabled { background: #ddd; color: #888; border-color: #aaa; cursor: not-allowed; }
#btn-continuar.chama { animation: chama 1.2s infinite; }
#btn-continuar.cutuca { animation: pulo .5s 2; }
@keyframes chama { 50% { transform: scale(1.05); } }
.sec { font-size: 14px; }
.dica { color: var(--cinza); font-size: 14px; }
.toast { position: fixed; top: 70px; left: 50%; transform: translateX(-50%) translateY(-20px); opacity: 0; background: var(--ok); color: #fff; font-weight: 600; padding: 8px 18px; border: 3px solid var(--linha); border-radius: 99px; transition: .3s; pointer-events: none; }
.toast.on { opacity: 1; transform: translateX(-50%); }

.inicio { text-align: center; }
.inicio .grande { font-size: 22px; padding: 14px 40px; background: var(--laranja); color: var(--sobre-destaque); border: 3px solid var(--linha); border-radius: 99px; font-weight: 600; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media (max-width: 700px) { #elenco { grid-template-columns: 70px 1fr 70px; } .ator .moldura { width: 66px; height: 72px; } .balao { font-size: 15px; } }

/* ===== v7: Método GIRO ===== */
/* painel de missão com cadeados */
.missao-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; padding: 6px 16px; background: var(--claro); border-bottom: 2px solid var(--linha); font-size: 13px; }
.missao-bar .m-titulo { font-weight: 600; margin-right: 6px; }
.missao-bar .cad { border: 2px solid #0003; border-radius: 99px; padding: 2px 10px; background: #fff; color: var(--cinza); }
.missao-bar .cad.aberto { border-color: var(--verde); background: var(--verde-claro); color: var(--tinta); animation: pulo .6s; }

/* tela animada: quadros que entram junto com as falas */
.tela { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; align-items: stretch; width: min(980px, 100%); }
.tela:empty { display: none; }
.quadro { background: #fff; border: 3px solid var(--linha); border-radius: var(--raio); padding: 12px 16px; min-width: 140px; max-width: 300px; flex: 1 1 160px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; animation: entra .45s ease-out both; }
.quadro .q-emoji { font-size: 54px; line-height: 1.1; }
.quadro img { max-width: 100%; max-height: 140px; object-fit: contain; }
.quadro .q-titulo { font-size: 17px; }
.quadro .q-texto { font-size: 15px; color: #333; line-height: 1.35; }
.quadro.grande { max-width: 980px; flex-basis: 100%; }
.quadro.grande .q-emoji { font-size: 84px; }
.quadro.grande .q-texto { font-size: 18px; }
.quadro.frase { max-width: 980px; flex-basis: 100%; background: var(--laranja); color: var(--sobre-destaque); border-color: var(--linha); }
.quadro.frase .q-titulo, .quadro.frase .q-texto { color: var(--sobre-destaque); font-size: 20px; }
.quadro.alerta { border-color: var(--erro); background: #fceeeb; animation: entra .3s ease-out both, treme .4s .3s; }
.quadro.ok { border-color: var(--ok); background: #e9f7e6; }
.quadro.preto { background: #111; color: #eee; border-color: #000; }
.quadro.preto .q-texto { color: #ddd; }
.quadro.mini { flex-direction: row; max-width: none; min-width: 0; padding: 6px 10px; margin-bottom: 6px; border-width: 2px; text-align: left; }
.quadro.mini .q-emoji { font-size: 32px; }
.quadro.setor { border-style: solid; border-color: var(--verde); }
@keyframes entra { from { opacity: 0; transform: scale(.7) translateY(14px); } }
.analogia { font-size: 14px; font-weight: 600; color: var(--verde); margin-bottom: 4px; }

/* avatar por emoji (personagem ainda sem desenho) */
.ator .moldura .emo { display: flex; align-items: center; justify-content: center; height: 100%; font-size: 76px; }

/* modo palco: entrada do Astolfo, muda o clima da aula */
body.palco { background: #2a2140; background-image: radial-gradient(ellipse at 50% 0%, #5b4a8a 0%, #2a2140 60%); transition: background .6s; }
body.palco .ator figcaption { color: #fff !important; }
body.palco .ator .moldura { width: 150px; height: 160px; }
body.palco .ator.on { animation: holofote .8s ease-out; }
@keyframes holofote { from { opacity: 0; transform: scale(.6); } }
body.palco #elenco { grid-template-columns: 150px 1fr 150px; }

/* tabela (comparador de anúncios) */
.tabela { border-collapse: collapse; width: 100%; margin-top: 10px; font-size: 16px; }
.tabela th, .tabela td { border: 2px solid var(--linha); padding: 8px 10px; text-align: center; }
.tabela tr:first-child th { background: var(--verde); color: #fff; }
.tabela th:first-child { background: var(--claro); text-align: left; }

/* ordenar / montar */
.trilho { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; width: min(980px, 100%); }
.slot { width: 104px; min-height: 92px; border: 3px dashed #0005; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 600; font-size: 24px; color: #0004; background: #fff; padding: 4px; }
.slot.cheio { border-style: solid; border-color: var(--verde); color: var(--tinta); font-size: 12px; animation: entra .35s; }
.slot img { max-width: 86px; max-height: 56px; }
.item.peca { display: flex; flex-direction: column; align-items: center; gap: 2px; border-radius: 14px; }
.item.peca img { max-width: 96px; max-height: 64px; }
.item.treme { animation: treme .35s; }

/* ===== v9: vídeo 3D na cena + legenda palavra por palavra ===== */
.quadro.cinema { background: transparent; border: 0; padding: 0; max-width: 980px; flex-basis: 100%; animation: none; }
.quadro.cinema video { display: block; width: auto; max-width: 100%; max-height: 46vh; margin: 0 auto; }
.legenda { position: fixed; left: 50%; bottom: 110px; transform: translateX(-50%); z-index: 40; pointer-events: none;
  font-weight: 600; font-size: clamp(30px, 4.2vw, 56px); color: #fff; letter-spacing: .01em; white-space: nowrap;
  -webkit-text-stroke: 2px #1b1b1b; paint-order: stroke fill; text-shadow: 0 5px 0 #1b1b1b; opacity: 0; transition: opacity .15s; }
.legenda.on { opacity: 1; }
body.palco .quadro.cinema .q-titulo { color: #fff; text-shadow: 0 2px 0 #0008; }
.legenda.pula { animation: legPula .18s ease-out; }
@keyframes legPula { from { transform: translateX(-50%) scale(1.25); } }

/* ===== v17: montagem estilo jogo (arrastar até o gabinete) ===== */
.montagem { display: flex; gap: 14px; width: min(1100px, 100%); align-items: flex-start; }
.gabinete-aberto { position: relative; flex: 1 1 62%; aspect-ratio: 16 / 10; max-height: 50vh; background: linear-gradient(160deg, #565d66, #3a3f46); border: 6px solid #24282c; border-radius: 16px; box-shadow: inset 0 0 0 3px #6b737d; }
.gabinete-aberto.pronto { outline: 5px solid var(--ok); }
.zona { position: absolute; display: none; align-items: center; justify-content: center; border: 3px dashed #ffffffa0; border-radius: 8px; background: #ffffff12; cursor: pointer; pointer-events: none; }
.zona.visivel { display: flex; pointer-events: auto; animation: pulsaZona 1.4s infinite; }
.zona .fantasma { max-width: 85%; max-height: 80%; opacity: .22; filter: grayscale(1) brightness(2); pointer-events: none; }
.zona.encaixada { display: flex; border: 0; background: transparent; pointer-events: none; animation: entra .3s ease-out; }
.zona.encaixada .real { max-width: 100%; max-height: 100%; object-fit: contain; }
.zona .rot { position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%); background: #1d2b44; color: #fff; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 6px; white-space: nowrap; }
.zona.cobre.encaixada { background: #3a3f46f0; border-radius: 10px; }
.zona.cobre.encaixada .real { max-height: 90%; }
.zona.treme { animation: treme .35s; }
@keyframes pulsaZona { 50% { background: #ffd27a40; border-color: #ffd27a; } }
.bandeja { flex: 0 0 34%; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; align-content: start; }
.peca-arrastar { background: #fff; border: 3px solid var(--linha); border-radius: 12px; padding: 6px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 13px; font-weight: 600; touch-action: none; cursor: grab; user-select: none; }
.peca-arrastar img { max-width: 72px; max-height: 46px; pointer-events: none; }
.peca-arrastar.sel { background: var(--laranja); color: var(--sobre-destaque); }
.peca-arrastar.feito { visibility: hidden; }
.peca-arrastar.treme { animation: treme .35s; }
.peca-arrastar.voando { position: fixed; z-index: 100; pointer-events: none; width: 110px; transform: scale(1.1) rotate(-3deg); box-shadow: 0 10px 24px #0005; }

/* ===== v17: modo compacto (tudo cabe na tela, sem rolagem) ===== */
body.compacto #palco { gap: 6px; padding-top: 6px; }
body.compacto #elenco { min-height: 0; grid-template-columns: 78px 1fr 78px; }
body.compacto .ator .moldura { width: 76px; height: 82px; }
body.compacto.palco .ator .moldura { width: 90px; height: 96px; }
body.compacto .ator figcaption { font-size: 11px; }
body.compacto .balao { font-size: 15px; padding: 7px 14px; min-height: 0; }
body.compacto .cartao { padding: 9px 16px; }
body.compacto .cartao h3 { font-size: 17px; margin-bottom: 3px; }
body.compacto .cartao p { font-size: 15px; margin: 2px 0; }
body.compacto .opcao { padding: 8px 12px; font-size: 15px; }
body.compacto .feedback { padding: 8px 12px; font-size: 15px; }
body.compacto .tabela { font-size: 14px; margin-top: 6px; }
body.compacto .tabela th, body.compacto .tabela td { padding: 4px 8px; }
body.compacto .mapa img, body.compacto .mapa video, body.compacto .quadro.cinema video { max-height: 36vh; }
body.compacto .quadro .q-emoji { font-size: 40px; }
body.compacto .gabinete-aberto { max-height: 44vh; }
body.compacto #conteudo { gap: 8px; }
.zona.desenho-placa { background: #1f8f72; border: 3px solid #0c5a47; border-radius: 6px;
  background-image: linear-gradient(90deg, #ffffff22 1px, transparent 1px), linear-gradient(#ffffff22 1px, transparent 1px);
  background-size: 18px 18px; box-shadow: inset 0 0 0 4px #ffffff18; }
.zona.desenho-placa .rot { top: 6px; bottom: auto; left: 8px; transform: none; }
/* vídeo de consequência dentro do retorno (desastre a cada erro) */
.feedback .quadro.cinema { margin: 0 auto 6px; }
.feedback .quadro.cinema video { max-height: 26vh; }
.quadro.setor.mini { flex: 1 1 180px; max-width: 240px; font-size: 13px; flex-direction: column; text-align: center; padding: 6px 8px; }
.quadro.setor.mini .q-texto { font-size: 12px; }
.quadro.setor.mini .q-titulo { font-size: 14px; }
/* compacto, parte 2: mais aperto onde ainda sobrava */
body.compacto .quadro.cinema video, body.compacto .mapa img, body.compacto .mapa video { max-height: 30vh; }
body.compacto .feedback .quadro.cinema video { max-height: 20vh; }
body.compacto .medalha { font-size: 56px; }
body.compacto .total { font-size: 22px; }
body.compacto .cartao h2 { font-size: 20px; }
body.compacto .grupo { min-height: 78px; padding: 8px; }
body.compacto .item { padding: 5px 12px; font-size: 14px; }
body.compacto .gabinete-aberto { max-height: 40vh; }
body.compacto .quadro { padding: 6px 10px; }
body.compacto .quadro.frase .q-texto, body.compacto .quadro.frase .q-titulo { font-size: 16px; }

/* ===== v23: relatório do instrutor ===== */
.nome-aluno { display: block; margin: 4px auto 12px; font: inherit; font-size: 17px; padding: 8px 14px; border: 3px solid var(--linha); border-radius: 99px; width: min(320px, 90%); text-align: center; }
.tabela.rel td:first-child { text-align: left; font-family: monospace; font-size: 13px; }
.barra-rel { width: 35%; }
.barra-rel span { display: block; height: 10px; background: var(--laranja); border-radius: 99px; }

/* ===== v24: mascote passeando (Ferdinando / Caramelonauta) ===== */
#mascote { position: fixed; left: 0; top: 0; z-index: 30; width: 66px; height: 66px; pointer-events: none; will-change: transform; }
#mascote.pulo { transition: transform .6s cubic-bezier(.3,1.6,.5,1); }
#mascote img { width: 100%; height: 100%; object-fit: contain; object-position: bottom; cursor: pointer; pointer-events: auto; filter: drop-shadow(0 3px 0 #0002); }
#mascote-balao { position: fixed; left: 0; top: 0; z-index: 31; width: 290px; background: #fff; border: 3px solid var(--linha); border-radius: 16px; padding: 10px 14px; font-size: 15px; line-height: 1.4; display: none; box-shadow: 0 6px 0 #0002; }
#mascote-balao.on { display: block; animation: entra .25s ease-out; }
#mascote-balao .quem { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: #6B4FA0; }
#mascote-balao .mb-acoes { display: flex; gap: 6px; margin-top: 8px; }
#mascote-balao .mb-acoes button { font-size: 12px; border: 2px solid var(--linha); border-radius: 99px; background: var(--claro); padding: 3px 10px; }
#mascote-balao.leve { width: auto; max-width: 260px; font-size: 13px; }
#mascote-balao.leve .mb-acoes, #mascote-balao.leve .quem { display: none; }
body.palco #mascote-balao { box-shadow: 0 6px 0 #0006; }

/* ===== v26: laboratório (Windows 7, telas 4:3 de 1024x768) ===== */
/* Personagens GRANDES enquanto só há fala; encolhem para o canto quando entra ilustração ou atividade. */
.ator .moldura { transition: width .4s, height .4s, transform .15s; }
#elenco { transition: grid-template-columns .4s; }
body:not(.foco) #elenco { grid-template-columns: 190px 1fr 190px; min-height: 210px; }
body:not(.foco) .ator .moldura { width: 180px; height: 196px; }
body:not(.foco) .balao { font-size: 21px; padding: 16px 22px; }
body.foco #elenco { grid-template-columns: 96px 1fr 96px; min-height: 0; }
body.foco .ator .moldura { width: 92px; height: 100px; }
body.foco .balao { font-size: 16px; padding: 8px 16px; min-height: 0; }
body.foco.palco #elenco { grid-template-columns: 110px 1fr 110px; }
body.foco.palco .ator .moldura { width: 106px; height: 114px; }

/* telas baixas (1024x768 com barra do navegador): cabeçalho e missão mais finos */
@media (max-height: 820px) {
  .topo { padding: 5px 14px; gap: 10px; }
  .titulos { font-size: 11px; } .titulos b { font-size: 14px; }
  .xp { font-size: 15px; padding: 2px 10px; }
  .missao-bar { padding: 3px 10px; font-size: 11px; gap: 5px; }
  .missao-bar .cad { padding: 1px 8px; }
  .rodape { padding: 6px 14px; }
  .rodape button { padding: 7px 16px; }
  #btn-continuar { font-size: 16px; }
  #palco { padding: 8px 14px 4px; gap: 6px; }
  body:not(.foco) .ator .moldura { width: 150px; height: 162px; }
  body:not(.foco) #elenco { grid-template-columns: 160px 1fr 160px; min-height: 170px; }
}

/* explorar: imagem maior e pontos visitados só com ✓ (o nome aparece embaixo) */
.mapa.explorar img, .mapa.explorar video { max-height: 52vh; }
body.compacto .mapa.explorar img, body.compacto .mapa.explorar video { max-height: 46vh; }
.ponto.visto { padding: 2px 8px; font-size: 12px; }
.ponto.visto::before { content: "✓"; }

/* montar em tela estreita (4:3): gabinete à esquerda, peças pequenas à direita (2 colunas) */
@media (max-width: 1150px) {
  .montagem { gap: 8px; }
  .gabinete-aberto { flex: 1 1 64%; max-height: 40vh; }
  .bandeja { flex: 0 0 34%; gap: 5px; }
  .peca-arrastar { padding: 2px 3px; font-size: 11px; flex-direction: row; gap: 4px; justify-content: flex-start; }
  .peca-arrastar img { max-height: 26px; max-width: 40px; }
  body.compacto .compacto-cab { padding: 6px 14px; }
  body.compacto .compacto-cab h3 { font-size: 15px; }
}

/* nada dentro do conteúdo pode ser "espremido" (cortava a imagem do PC explodido) */
#conteudo > * { flex-shrink: 0; }
.mapa.explorar img, .mapa.explorar video { max-height: 44vh; }
body.compacto .mapa.explorar img, body.compacto .mapa.explorar video { max-height: 33vh; }
#conteudo .tela.recolhida { display: none; }

/* ===== v33: identidade visual Avante (brandbook) ===== */
@font-face { font-family: 'Maven Pro'; src: url(marca/MavenPro.woff2) format('woff2'); font-weight: 400 900; }
:root { --verde-vivo: #6CC24A; --amarelo: #F0E87B; }
h2, h3, .titulos b, .etiqueta, .balao .quem, #btn-continuar, .total, .palavra, .grupo h4, .missao-bar .m-titulo, .legenda {
  font-family: 'Maven Pro', 'Emoji Avante', Poppins, sans-serif; }
.marca-logo { height: 32px; width: auto; display: block; }
@media (max-height: 820px) { .marca-logo { height: 24px; } }
/* fundo com hexágonos da marca ("tecnologia e conexão"), bem suave */
body { background-color: var(--papel);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='97' viewBox='0 0 56 97'%3E%3Cpath d='M28 0l28 16v32L28 64 0 48V16zM28 64v33M0 48v49M56 48v49' fill='none' stroke='%23E68E27' stroke-opacity='.10' stroke-width='1.5'/%3E%3C/svg%3E");
  background-size: 56px 97px; }
body.palco { background-image: radial-gradient(ellipse at 50% 0%, #5b4a8a 0%, #2a2140 60%); }
/* etiquetas com ponta de seta (o "play" de avanço da marca) */
.etiqueta { border-radius: 4px 0 0 4px; padding: 3px 20px 3px 10px; clip-path: polygon(0 0, calc(100% - 11px) 0, 100% 50%, calc(100% - 11px) 100%, 0 100%); }
/* tela inicial com o símbolo */
.simbolo-inicio { height: 64px; width: auto; display: block; margin: 0 auto 8px; }
@media (max-height: 820px) { .simbolo-inicio { height: 44px; } }
/* medalha dentro de um hexágono laranja */
.medalha { width: 130px; height: 140px; margin: 0 auto; display: flex; align-items: center; justify-content: center; font-size: 70px;
  background: var(--laranja); clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
body.compacto .medalha { width: 90px; height: 98px; font-size: 46px; }
/* acerto com o verde vivo da marca */
.opcao.certa { background: #eef9e8; border-color: var(--verde-vivo); }
.toast { background: var(--verde); }

/* ===== v34: simuladores (ábaco e código binário) ===== */
.sim-desafio h3 { margin-bottom: 4px; }
.sim-passos { display: flex; gap: 6px; margin-top: 4px; }
.sim-passo { width: 22px; height: 8px; border-radius: 99px; background: #0002; }
.sim-passo.atual { background: var(--laranja); }
.sim-passo.feito { background: var(--verde-vivo, #6CC24A); }
.sim-acoes { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.sim-acoes .opcao { padding: 8px 16px; font-size: 15px; }
.sim-acoes .sec-sim { background: var(--claro); }

/* ábaco: moldura de madeira, hastes horizontais, contas que deslizam */
.abaco { background: #a8733f; border: 8px solid #6d4523; border-radius: 14px; padding: 10px 14px; display: flex; flex-direction: column; gap: 6px; width: min(640px, 100%);
  box-shadow: inset 0 0 0 3px #c08a52; }
.abaco-linha { display: grid; grid-template-columns: 78px 1fr 90px; align-items: center; gap: 8px; }
.abaco-rotulo { color: #fff; font-weight: 600; font-size: 13px; text-align: right; }
.abaco-valor-col { color: #fff3dc; font-size: 13px; font-weight: 600; }
.abaco-haste { position: relative; height: 38px; }
.abaco-haste::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 4px; margin-top: -2px; background: #3e2612; border-radius: 4px; }
.abaco-conta { position: absolute; top: 2px; width: 28px; height: 34px; border-radius: 45%; border: 2px solid #3e2612; background: #e2c08d; cursor: pointer; padding: 0;
  transition: left .22s ease-out, background .2s; box-shadow: inset -4px -4px 0 #0002; }
.abaco-conta.contada { background: var(--laranja); }
.abaco-conta:hover { filter: brightness(1.08); }
.abaco-visor { font-family: 'Maven Pro', Poppins, sans-serif; font-size: 40px; font-weight: 700; color: var(--tinta); background: #fff; border: 3px solid var(--linha); border-radius: 14px; padding: 2px 26px; }
body.compacto .abaco-haste { height: 32px; } body.compacto .abaco-conta { height: 28px; width: 24px; } body.compacto .abaco-visor { font-size: 30px; }

/* binário: 8 lâmpadas */
.bin-fileira { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; width: min(760px, 100%); }
.bin-lampada { background: #fff; border: 3px solid var(--linha); border-radius: 14px; padding: 8px 4px 6px; display: flex; flex-direction: column; align-items: center; gap: 3px; cursor: pointer; }
.bin-bulbo { width: 40px; height: 40px; border-radius: 50%; background: #c9c9c9; border: 3px solid #555; transition: background .15s, box-shadow .15s; }
.bin-lampada.acesa .bin-bulbo { background: #ffe066; border-color: #b8860b; box-shadow: 0 0 18px 6px #ffd84d99; }
.bin-lampada.acesa { background: #fffbe6; }
.bin-bit { font-family: monospace; font-size: 22px; }
.bin-peso { color: var(--cinza); font-size: 12px; font-weight: 600; }
.bin-leitura { display: flex; align-items: center; gap: 14px; background: #1d2b44; color: #fff; border-radius: 14px; padding: 8px 22px; font-family: 'Maven Pro', Poppins, sans-serif; }
.bin-bits { font-family: monospace; font-size: 26px; letter-spacing: .12em; color: #ffe066; }
.bin-igual { opacity: .6; font-size: 22px; }
.bin-num { font-size: 30px; font-weight: 700; }
.bin-letra { font-size: 40px; font-weight: 700; color: var(--laranja); min-width: 40px; text-align: center; }
.bin-palavra { display: flex; gap: 8px; }
.bin-casa { width: 52px; height: 60px; border: 3px dashed #0006; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-family: 'Maven Pro', Poppins, sans-serif; font-size: 34px; font-weight: 700; color: #0004; background: #fff; }
.bin-casa.atual { border-color: var(--laranja); border-style: solid; }
.bin-casa.cheia { border-style: solid; border-color: var(--verde); color: var(--verde); animation: entra .3s; }
.bin-tabela { background: #fff; border: 3px solid var(--linha); border-radius: 14px; padding: 8px 14px; width: min(760px, 100%); font-size: 14px; }
.bin-tab-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 2px 8px; margin-top: 4px; }
body.compacto .bin-bulbo { width: 30px; height: 30px; } body.compacto .bin-bit { font-size: 18px; } body.compacto .bin-letra { font-size: 30px; }
/* botão "Pronto" dos simuladores: laranja, ao lado do número, e pulsa quando já dá para confirmar */
.sim-visor-linha { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; }
.sim-acoes .sim-pronto { background: var(--laranja); color: var(--sobre-destaque); font-size: 17px; font-weight: 600; padding: 10px 22px; }
.sim-acoes .sim-pronto.chama { animation: chama 1.1s infinite; }
.sim-pronto:hover:not(:disabled) { background: var(--laranja-forte) !important; color: #fff; }   /* hover não pode apagar o texto branco */

/* ===== v38: fotos reais (pack do GPT) ===== */
.gabinete-aberto.foto { flex: 0 0 auto; aspect-ratio: auto; max-height: none; background: none; border: 0; box-shadow: none; line-height: 0; }
.gabinete-aberto.foto .fundo-img { display: block; height: 44vh; width: auto; max-width: 60vw; object-fit: contain; }
body.compacto .gabinete-aberto.foto .fundo-img { height: 38vh; }
.gabinete-aberto.foto .zona { z-index: 1; }
.gabinete-aberto.foto .zona { border-color: #ffd27acc; }
.gabinete-aberto.foto .zona.encaixada .real { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 2px 3px #0008); }
.gabinete-aberto.foto .zona .fantasma { filter: grayscale(1) brightness(2.2); opacity: .3; }
.gabinete-aberto.foto.revelado .zona { opacity: 0; transition: opacity .5s; }
.gabinete-aberto.foto.pronto { outline: 0; filter: drop-shadow(0 0 10px #6CC24A); }
.item.com-foto { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; border-radius: 14px; padding: 4px 10px; }
.item.com-foto img { height: 40px; width: auto; max-width: 70px; object-fit: contain; }
body.compacto .item.com-foto img { height: 30px; }
.mapa.explorar.foto-real { background: transparent; border: 0; }
/* na foto, o nome da peça aparece no encaixe e some (senão os nomes se amontoam) */
.gabinete-aberto.foto .zona .rot { animation: someRot 2.6s forwards; }
@keyframes someRot { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }
.gabinete-aberto.foto.pronto .fundo-img { height: 48vh; max-width: 80vw; }
.montagem:has(.gabinete-aberto.pronto) { justify-content: center; }

/* ===== v42: certificado na tela ===== */
.certificado { width: min(700px, 100%); background: #fff; border: 10px double var(--laranja); border-radius: 10px; padding: 16px 26px; text-align: center; box-shadow: 0 6px 0 #0001;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='97' viewBox='0 0 56 97'%3E%3Cpath d='M28 0l28 16v32L28 64 0 48V16zM28 64v33M0 48v49M56 48v49' fill='none' stroke='%2300816D' stroke-opacity='.07' stroke-width='1.5'/%3E%3C/svg%3E"); }
.cert-logo { height: 34px; margin: 0 auto 6px; display: block; }
.cert-titulo { font-family: 'Maven Pro', Poppins, sans-serif; font-weight: 700; font-size: 24px; color: var(--verde); text-transform: uppercase; letter-spacing: .06em; }
.cert-nome { font-family: 'Maven Pro', Poppins, sans-serif; font-weight: 700; font-size: 30px; color: var(--laranja-forte); border-bottom: 2px solid #0003; display: inline-block; padding: 0 20px 2px; margin: 4px 0; }
.certificado p { margin: 4px 0; font-size: 16px; }
.cert-data { margin-top: 8px; font-size: 13px; color: var(--cinza); }
body.compacto .certificado { padding: 8px 16px; } body.compacto .cert-nome { font-size: 22px; } body.compacto .cert-titulo { font-size: 18px; }
/* fechamento com certificado: cartão da medalha enxuto para os dois caberem na tela */
.cartao.inicio:has(+ .certificado) { padding: 8px 16px; }
.cartao.inicio:has(+ .certificado) .medalha { width: 66px; height: 72px; font-size: 34px; }
.cartao.inicio:has(+ .certificado) h2 { font-size: 18px; margin: 2px 0; }
.cartao.inicio:has(+ .certificado) .total { font-size: 17px; }
.cartao.inicio:has(+ .certificado) p { font-size: 14px; margin: 2px 0; }
.certificado { padding: 10px 22px; } .certificado p { margin: 2px 0; font-size: 15px; } .cert-logo { height: 28px; }

/* ---------------------------------------------------------------- tirinha animada */
body.modo-tirinha #elenco { display: none; }
.tirinha { width: 100%; max-width: 1060px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.tirinha > .etiqueta { align-self: flex-start; }
.tira-moldura { position: relative; width: 100%; max-width: calc((100vh - 230px) * 1.79); }
.tira-palco { position: relative; width: 100%; max-width: calc((100vh - 230px) * 1.79); aspect-ratio: 16 / 9; border: 4px solid #1d1d1b; border-radius: 14px; overflow: hidden; background: #fff8ec; box-shadow: 0 8px 0 rgba(0,0,0,.18); }
@supports not (aspect-ratio: 1) { .tira-palco { height: 0; padding-top: 56.25%; } }
.tira-quadro { position: absolute; inset: 0; top: 0; left: 0; right: 0; bottom: 0; overflow: hidden; }
.tira-quadro.entra { animation: tira-entra .6s ease-out both; }
.tira-quadro.sai { animation: tira-sai .6s ease-in both; }
@keyframes tira-entra { from { opacity: 0; transform: translateX(6%); } to { opacity: 1; transform: none; } }
@keyframes tira-sai { from { opacity: 1; } to { opacity: 0; transform: translateX(-6%); } }
.tira-quadro img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; will-change: transform; }
.tira-quadro img.mov-zoom { animation: mov-zoom 14s ease-out both; }
.tira-quadro img.mov-zoom-out { animation: mov-zoom 14s ease-out reverse both; }
.tira-quadro img.mov-pan-dir { animation: mov-pan-dir 14s ease-in-out both; }
.tira-quadro img.mov-pan-esq { animation: mov-pan-dir 14s ease-in-out reverse both; }
@keyframes mov-zoom { from { transform: scale(1); } to { transform: scale(1.12); } }
@keyframes mov-pan-dir { from { transform: scale(1.12) translateX(-4%); } to { transform: scale(1.12) translateX(4%); } }
.tira-legenda { position: absolute; left: 12px; bottom: 12px; background: #F0E87B; color: #1d1d1b; border: 3px solid #1d1d1b; border-radius: 6px; padding: 4px 12px; font-weight: 700; font-size: 16px; transform: rotate(-1.5deg); }
.tira-balao { position: absolute; top: 4%; max-width: 54%; background: #fff; color: #1d1d1b; border: 3px solid #1d1d1b; border-radius: 22px; padding: 10px 16px; font-size: 19px; line-height: 1.3; opacity: 0; transform: scale(.8); transition: opacity .25s, transform .25s; box-shadow: 0 4px 0 rgba(0,0,0,.15); }
.tira-balao.on { opacity: 1; transform: scale(1); }
.tira-balao.esq { left: 4%; }
.tira-balao.dir { right: 4%; }
.tira-balao.centro { left: 23%; right: 23%; max-width: none; text-align: center; }
.tira-balao::after { content: ''; position: absolute; bottom: -18px; width: 0; height: 0; border: 10px solid transparent; border-top: 16px solid #1d1d1b; }
.tira-balao.esq::after { left: 34px; }
.tira-balao.dir::after { right: 34px; }
.tira-balao.centro::after { left: 50%; }
.tira-balao.pensa { border-style: dashed; font-style: italic; }
.tira-balao b { display: block; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: #E35205; margin-bottom: 2px; }
.tira-pontos { display: flex; gap: 6px; }
.tira-pontos i { width: 26px; height: 7px; border-radius: 4px; background: #ddd; }
.tira-pontos i.agora { background: var(--laranja); }
.tira-pontos i.feito { background: #6CC24A; }
.tira-pergunta { display: none; position: absolute; left: 3%; right: 3%; bottom: 4%; text-align: center; background: rgba(255,255,255,.96); border: 3px solid #1d1d1b; border-radius: 14px; padding: 10px 12px; box-shadow: 0 6px 0 rgba(0,0,0,.2); animation: tira-entra .35s ease-out both; }
.tira-pergunta.on { display: block; }
.tira-p-texto { display: block; font-size: 19px; margin-bottom: 6px; }
.tira-opcoes { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.tira-opcoes .opcao { min-width: 160px; }
.tira-fb { margin: 6px 0; font-size: 17px; }
.tira-gibi { position: absolute; top: 0; left: 0; right: 0; bottom: 0; display: flex; flex-wrap: wrap; align-content: center; justify-content: center; background: #fff8ec; padding: 6px; }
.tira-gibi img { width: 32.5%; margin: .4%; border: 3px solid #1d1d1b; border-radius: 6px; }
.tira-pergunta .sim-pronto { background: var(--laranja); color: var(--sobre-destaque); font-weight: 600; border-color: #1d1d1b; }
.tira-pergunta .sim-pronto.chama { animation: chama 1.1s infinite; }
.tira-pergunta.fim { left: auto; right: 10px; bottom: 10px; padding: 4px; border-width: 2px; }

/* ---------------------------------------------------------------- mini-jogos do mouse */
.mj { display: flex; flex-direction: column; gap: 6px; }
.mj-titulo { font-size: 19px; }
.mj-placar { font-weight: 600; color: var(--verde); }
.mj-area { position: relative; height: calc(100vh - 430px); min-height: 220px; max-height: 420px; border: 3px dashed #d9cdb8; border-radius: 14px; background: #fffdf7; overflow: hidden; user-select: none; }
.mj-fb { min-height: 24px; margin: 0; font-size: 16px; }
.cartao.ex .mj-fb:empty { min-height: 0; }   /* no Explorador o aviso vazio não rouba altura da janela */
.mj-fb.ruim { color: var(--laranja-forte); }
/* balões */
.mj-balao { position: absolute; bottom: -120px; border: 3px solid rgba(0,0,0,.25); border-radius: 50% 50% 46% 46%; cursor: pointer; padding: 0; will-change: transform; }
.mj-balao::after { content: ''; position: absolute; left: 50%; bottom: -16px; width: 2px; height: 16px; background: #888; }
.mj-balao.estourou { transform: scale(1.4) !important; opacity: 0; transition: transform .2s, opacity .2s !important; }
/* caixas */
.mj-grade { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; padding: 14px; }
.mj-caixa { font-size: 52px; width: 96px; height: 96px; border-radius: 16px; border: 3px solid #1d1d1b; background: #fff3dd; cursor: pointer; }
.mj-caixa.aberta { background: var(--verde-claro); }
.mj-caixa.treme { animation: tremeCaixa .35s; }
@keyframes tremeCaixa { 25% { transform: rotate(-8deg); } 75% { transform: rotate(8deg); } }
.mj-surpresa { display: none; position: absolute; left: 4%; right: 4%; bottom: 10px; background: #F0E87B; border: 3px solid #1d1d1b; border-radius: 12px; padding: 8px 12px; font-size: 16px; }
.mj-surpresa.on { display: block; }
/* menu do botão direito */
.mj-mesa { display: flex; flex-wrap: wrap; gap: 10px; padding: 14px; align-content: flex-start; height: 78%; background: linear-gradient(#3f72b0, #24538c); }
.mj-icone { width: 96px; text-align: center; padding: 6px 4px; border-radius: 6px; color: #fff; cursor: default; border: 2px solid transparent; }
.mj-icone.sel { background: rgba(255,255,255,.28); border-color: rgba(255,255,255,.7); }
.mj-icone.saindo { transform: scale(.1); opacity: 0; transition: .35s; }
.mj-icone.aberto .mj-ic { filter: drop-shadow(0 0 8px #fff); }
.mj-ic { display: block; font-size: 38px; }
.mj-nome { display: block; font-size: 13px; font-weight: 600; text-shadow: 0 1px 2px #000, 0 0 4px rgba(0,0,0,.8); word-break: break-word; }
.mj-renomear { width: 92px; font-size: 13px; }
.mj-menu { position: absolute; z-index: 5; width: 150px; background: #fff; border: 1px solid #999; box-shadow: 3px 3px 8px rgba(0,0,0,.35); padding: 3px; }
.mj-menu-item { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 6px 10px; font-size: 15px; cursor: pointer; }
.mj-menu-item:hover { background: #cde4ff; }
.mj-tarefa { position: absolute; left: 0; right: 0; bottom: 0; height: 22%; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 17px; background: #fff8ec; }
/* arrastar */
.mj-bagunca { position: absolute; left: 0; right: 0; top: 0; height: 64%; background: #e8c9a0; }
.mj-peca { position: absolute; font-size: 44px; cursor: grab; touch-action: none; line-height: 1; filter: drop-shadow(0 3px 2px rgba(0,0,0,.3)); }
.mj-peca.pegou { cursor: grabbing; transform: scale(1.2); z-index: 3; }
.mj-zonas { position: absolute; left: 0; right: 0; bottom: 0; height: 36%; display: flex; gap: 8px; padding: 8px; }
.mj-zona { flex: 1; border: 3px dashed #999; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #fff; }
.mj-zona.mira { border-color: var(--laranja); background: #fff3dd; }
.mj-zona.ganhou { border-color: var(--verde); background: var(--verde-claro); }
/* rolar */
.mj-lista { height: 100%; overflow-y: scroll; padding: 6px; }
.mj-pedido { display: block; width: 100%; text-align: left; padding: 9px 12px; margin: 3px 0; border: 2px solid #e5dccb; border-radius: 8px; background: #fff; font-size: 15px; cursor: pointer; }
.mj-pedido:hover { border-color: var(--laranja); }
.mj-pedido.achou { background: var(--verde-claro); border-color: var(--verde); }

/* ---------------------------------------------------------------- simulador de digitação */
.dg { position: relative; display: flex; flex-direction: column; gap: 6px; }
.dg-titulo { font-size: 18px; }
.dg-placar { font-size: 14px; color: #555; }
.dg-texto { font-family: Consolas, "Courier New", monospace; font-size: 26px; line-height: 1.5; background: #fffdf7; border: 2px solid #e5dccb; border-radius: 12px; padding: 8px 14px; letter-spacing: 1px; word-break: break-word; }
.dg-c { position: relative; border-radius: 4px; color: #9a9a9a; }
.dg-c.esp { min-width: .6em; display: inline-block; }
.dg-c.atual { color: #1d1d1b; background: #F0E87B; box-shadow: 0 3px 0 var(--laranja); }
.dg-c.ok { color: var(--verde); }
.dg-c.corrigido { color: #b07a00; }
.dg-c.erro { background: #ffd6cc; color: #c0392b; animation: treme .3s; }
.dg-c.erro::after { content: '✕'; position: absolute; top: -.9em; left: 50%; transform: translateX(-50%); font-size: 14px; color: #c0392b; }
.dg-dedo { min-height: 24px; font-size: 16px; font-weight: 600; display: flex; align-items: center; }
.dg-dedo-cor { display: inline-block; width: 18px; height: 18px; border-radius: 50%; border: 2px solid #1d1d1b; }
.dg-teclado { background: #2b2d33; border-radius: 12px; padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.dg-linha { display: flex; gap: 4px; }
.dg-linha:last-child { justify-content: center; }
.dg-linha:last-child .dg-tecla { flex: 0 0 46%; }
.dg-tecla { flex: 1 1 0; min-width: 0; height: calc((100vh - 540px) / 5); min-height: 24px; max-height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 6px; font-size: 13px; font-weight: 600; color: #1d1d1b; border-bottom: 3px solid rgba(0,0,0,.35); opacity: .78; position: relative; }
.dg-tecla.marca::after { content: ''; position: absolute; bottom: 4px; width: 10px; height: 2px; background: #1d1d1b; border-radius: 2px; }
.dg-tecla.proxima { opacity: 1; outline: 4px solid #fff; transform: translateY(-2px) scale(1.08); z-index: 1; box-shadow: 0 0 14px #fff; }
.dg-tecla.proxima2 { opacity: 1; outline: 3px dashed #fff; }
.dg-tecla.apertou { transform: translateY(2px); border-bottom-width: 1px; }
.dg-tecla.ligado { box-shadow: inset 0 0 0 3px #6CC24A; }
.d0 { background: #d9d9d9; } .d1 { background: #f4a7b9; } .d2 { background: #f9c97a; } .d3 { background: #b8e08a; } .d4 { background: #8fd3f4; }
.d5 { background: #a9b8f7; } .d6 { background: #d3a8f2; } .d7 { background: #f2e38a; } .d8 { background: #f4b896; }
.dg-legenda { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; font-size: 11px; }
.dg-legenda span { padding: 1px 8px; border-radius: 99px; border: 1px solid rgba(0,0,0,.2); }
.dg-entrada { position: absolute; left: -9999px; top: 0; width: 10px; height: 10px; opacity: 0; }
.dg-foco { position: absolute; left: 50%; top: 44%; transform: translate(-50%, -50%); background: var(--laranja); color: var(--sobre-destaque); font-weight: 700; padding: 10px 18px; border-radius: 99px; cursor: pointer; box-shadow: 0 6px 0 rgba(0,0,0,.2); animation: chama 1.1s infinite; }
.dg-resultado { text-align: center; background: #fff3dd; border: 3px solid var(--laranja); border-radius: 12px; padding: 6px; }
.dg-resultado.passou { background: var(--verde-claro); border-color: var(--verde); }
.dg-resultado p { margin: 4px 0 0; }
.dg-estrelas { font-size: 30px; letter-spacing: 4px; }

/* ---------------------------------------------------------------- missões de teclas e mapa do teclado */
.tm { display: flex; flex-direction: column; gap: 6px; }
.tm-missao { font-size: 18px; }
.tm-janela { border: 2px solid #7a8aa0; border-radius: 6px; overflow: hidden; background: #fff; box-shadow: 0 4px 10px rgba(0,0,0,.15); }
.tm-barra { display: flex; justify-content: space-between; background: #dfe6f0; padding: 4px 10px; font-size: 13px; }
.tm-x { letter-spacing: 6px; color: #555; }
.tm-nota { width: 100%; height: calc(100vh - 520px); min-height: 90px; max-height: 220px; border: 0; padding: 8px 10px; font-family: Consolas, 'Courier New', monospace; font-size: 24px; resize: none; outline: none; box-sizing: border-box; }
.tm-caps { font-size: 14px; color: #666; }
.tm-caps.on { color: #c0392b; font-weight: 700; }
.tm-mapa { display: flex; gap: 8px; background: #2b2d33; border-radius: 12px; padding: 6px; }
.tm-corpo { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tm-mapa .dg-tecla { opacity: .45; cursor: default; height: calc((100vh - 470px) / 6); }
.tm-mapa .dg-tecla.reg { opacity: .95; cursor: pointer; }
.tm-mapa .dg-tecla.acesa { outline: 3px solid #fff; transform: translateY(-2px); box-shadow: 0 0 12px #fff; }
.tm-f { margin-bottom: 4px; }
.tm-lado { display: flex; flex-direction: column; justify-content: space-between; width: 26%; }
.tm-setas, .tm-num { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.tm-setas .vazia { visibility: hidden; }
/* ---------------------------------------------------------------- explorador de arquivos */
.ex { display: flex; flex-direction: column; gap: 6px; }
.ex-janela { position: relative; border: 2px solid #7a8aa0; border-radius: 6px; background: #fff; box-shadow: 0 4px 10px rgba(0,0,0,.15); outline: none; user-select: none; }
.ex-barra { display: flex; gap: 6px; padding: 5px; background: #f3f6fa; border-bottom: 1px solid #d5dde8; align-items: center; }
.ex-voltar { font-size: 18px; width: 36px; border: 1px solid #b9c4d3; background: #fff; border-radius: 4px; cursor: pointer; }
.ex-voltar:disabled { opacity: .35; cursor: default; }
.ex-endereco { flex: 1; border: 1px solid #b9c4d3; background: #fff; padding: 4px 8px; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ex-sep { color: #888; margin: 0 5px; }
.ex-nova { border: 1px solid #b9c4d3; background: #fff; padding: 4px 10px; font-size: 14px; border-radius: 4px; cursor: pointer; white-space: nowrap; }
.ex-nova:hover { background: #e5f1fb; border-color: #7eb4ea; }
.ex-busca { width: 24%; border: 1px solid #b9c4d3; padding: 4px 8px; font-size: 14px; }
.ex-corpo { display: flex; height: calc(100vh - 470px); min-height: 200px; max-height: 360px; }
.ex-nav { width: 26%; border-right: 1px solid #d5dde8; padding: 6px 0; overflow-y: auto; font-size: 14px; }
.ex-navitem { padding: 6px 10px; cursor: pointer; white-space: nowrap; }
.ex-navitem:hover, .ex-navitem.mira { background: #e5f1fb; }
.ex-navitem.on { background: #cce8ff; font-weight: 600; }
.ex-area { flex: 1; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 6px; padding: 8px; overflow-y: auto; }
.ex-item { width: 100px; text-align: center; padding: 6px 3px; border: 1px solid transparent; border-radius: 4px; cursor: default; touch-action: none; }
.ex-item:hover { background: #e5f1fb; }
.ex-item.sel { background: #cce8ff; border-color: #99d1ff; }
.ex-item.mira { background: #fff3dd; border-color: var(--laranja); }
.ex-item .mj-nome { color: #1d1d1b; text-shadow: none; }
.ex-onde { display: block; font-size: 10px; color: #888; }
.ex-vazio { color: #999; padding: 20px; }
.ex-status { font-size: 12px; color: #555; padding: 3px 8px; border-top: 1px solid #d5dde8; background: #f8f9fb; }
.ex-fantasma { position: fixed; z-index: 50; pointer-events: none; background: rgba(204,232,255,.95); border: 1px solid #99d1ff; padding: 4px 8px; border-radius: 4px; font-size: 14px; }
.ex-previa { position: absolute; left: 15%; right: 15%; top: 22%; background: #fff; border: 2px solid #7a8aa0; border-radius: 8px; padding: 12px; box-shadow: 0 10px 25px rgba(0,0,0,.3); z-index: 6; text-align: center; }
/* ---------------------------------------------------------------- conversa (chat) */
.chat { width: min(760px, 100%); margin: 0 auto; border: 3px solid #1d1d1b; border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; background: #efe7dc; }
.chat-topo { display: flex; align-items: center; gap: 10px; padding: 6px 12px; background: var(--verde); color: #fff; }
.chat-topo small { display: block; opacity: .85; }
.chat-av { width: 42px; height: 42px; border-radius: 50%; background: #fff; object-fit: cover; }
.chat-msgs { height: calc(100vh - 450px); min-height: 200px; max-height: 420px; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.chat-b { max-width: 78%; padding: 8px 12px; border-radius: 14px; font-size: 16px; line-height: 1.35; box-shadow: 0 1px 1px rgba(0,0,0,.15); animation: tira-entra .25s ease-out both; }
.chat-b.dele { align-self: flex-start; background: #fff; border-top-left-radius: 3px; }
.chat-b.meu { align-self: flex-end; background: #d9fdd3; border-top-right-radius: 3px; }
.chat-b.digitando { color: #999; letter-spacing: 3px; }
.chat-resp { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; background: #f6f2ec; border-top: 1px solid #ddd; min-height: 48px; }
.chat-op { flex: 1 1 30%; padding: 8px 10px; border: 2px solid var(--verde); border-radius: 18px; background: #fff; cursor: pointer; font-size: 15px; }
.chat-op:hover { background: var(--verde-claro); }
.chat-inp { flex: 1; padding: 9px 14px; border: 2px solid #ccc; border-radius: 20px; font-size: 16px; }
.chat-env { padding: 8px 16px; border: 0; border-radius: 20px; background: var(--verde); color: #fff; font-weight: 600; cursor: pointer; }

/* mapa do teclado: partes que faltam piscam se o aluno ficar parado */
.reg.pisca { animation: regPisca 1s ease-in-out infinite; }
@keyframes regPisca { 50% { filter: brightness(1.35); box-shadow: 0 0 0 3px #E68E27; } }

/* ---------------------------------------------------------------- personagem de corpo inteiro (momentos-chave) */
/* Fica à esquerda, de pé sobre o rodapé; o conteúdo abre espaço para ele. Movimento leve: respira, balança ao falar, troca de gesto. */
.corpo { position: fixed; left: max(12px, 3vw); bottom: 74px; height: min(58vh, 520px); margin: 0; z-index: 2; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; animation: corpo-entra .6s cubic-bezier(.2,.8,.3,1.2) both; }
.corpo img { height: calc(100% - 20px); width: auto; transform-origin: 50% 100%; animation: respira 3.6s ease-in-out infinite; filter: drop-shadow(0 6px 0 #0001); }
.corpo figcaption { font-size: 13px; font-weight: 600; }
.corpo.falando img { animation: respira 3.6s ease-in-out infinite, fala-balanca .9s ease-in-out infinite alternate; }
.corpo.gesto img { animation: gesto .35s ease-out, respira 3.6s .35s ease-in-out infinite; }
body.com-corpo #palco { padding-left: calc(min(58vh, 520px) * .48 + max(24px, 3vw)); }
body.com-corpo #ator-esq { visibility: hidden; }
@keyframes corpo-entra { from { opacity: 0; transform: translateX(-60px); } to { opacity: 1; transform: none; } }
@keyframes respira { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(1.012); } }
@keyframes fala-balanca { from { transform: rotate(-.6deg) translateY(0); } to { transform: rotate(.6deg) translateY(-3px); } }
@keyframes gesto { from { transform: scale(.97) translateY(4px); } to { transform: none; } }
@media (max-width: 900px), (max-height: 560px) { .corpo { height: min(40vh, 300px); } body.com-corpo #palco { padding-left: calc(min(40vh, 300px) * .48 + 20px); } }

/* ---------------------------------------------------------------- tutorial: escurece a tela e acende um elemento por vez */
.tut-veu { position: fixed; inset: 0; z-index: 900; background: transparent; }
.tut-alvo { position: fixed; z-index: 901; border: 3px solid var(--laranja); border-radius: 18px; background: transparent; padding: 0; cursor: default;
  box-shadow: 0 0 0 9999px rgba(20, 16, 30, .62); transition: left .35s, top .35s, width .35s, height .35s; }
.tut-alvo.pisca { cursor: pointer; animation: tut-pisca 1s ease-in-out infinite; }
.tut-rotulo { position: fixed; z-index: 902; width: 280px; background: #fff; border: 3px solid var(--linha); border-radius: 14px; padding: 10px 14px;
  font-weight: 600; font-size: 16px; text-align: center; animation: entra .3s ease-out both; }
@keyframes tut-pisca { 0%, 100% { box-shadow: 0 0 0 9999px rgba(20,16,30,.62), 0 0 0 0 #E3520599; } 50% { box-shadow: 0 0 0 9999px rgba(20,16,30,.62), 0 0 0 10px #E3520500; } }
body:has(.tut-veu) #elenco { position: relative; z-index: 903; }

/* desafio no computador de verdade (mecânica "desafio") */
.desafio-passos { margin: 8px 0; padding-left: 26px; font-size: 17px; line-height: 1.6; }
.desafio-passos input { transform: scale(1.3); margin-right: 6px; }
.desafio-pergunta { font-weight: 600; }
.desafio-resposta { font: inherit; font-size: 17px; padding: 8px 12px; border: 3px solid var(--linha); border-radius: 10px; width: min(420px, 100%); }
.desafio-estado { font-weight: 600; color: var(--verde); min-height: 1.4em; }
