@font-face{font-family:Miudezas;src:url("./arte/miudezas.ttf") format("truetype");font-display:swap}
:root{--ink:#2e3535;--paper:#fff5df;--cream:#f7e9cd;--edge:#b9ad8e;--green:#386251;--shadow:#253736;--muted:#655d50;--gold:#f4bf64;--pixel:Miudezas,monospace;--text:Verdana,Arial,sans-serif}
*{box-sizing:border-box}html,body{margin:0;min-height:100%;color:var(--ink);font-family:var(--text)}button{font:inherit;color:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent}button:disabled{cursor:default;opacity:.45}button:focus-visible{outline:3px solid #ad522f;outline-offset:2px;z-index:1}button,canvas{touch-action:manipulation}img,canvas{image-rendering:pixelated}
.desktop{min-height:100svh;display:grid;place-items:center;padding:15px;background-color:#dce1d4;background-image:radial-gradient(#bfc8b9 .9px,transparent .9px);background-size:9px 9px}
.window{width:min(100%,492px);height:min(492px,calc(100svh - 30px));min-height:min(360px,calc(100svh - 30px));display:flex;flex-direction:column;background:var(--paper);border:3px solid var(--ink);box-shadow:5px 5px 0 #7c8b7b;overflow:hidden}
.bar{height:34px;flex:none;border-bottom:2px solid var(--ink);display:flex;align-items:center;gap:8px;padding:0 6px 0 9px;background:var(--cream);font:16px var(--pixel)}.bar>img{width:21px;height:21px}.bar-actions{display:flex;margin-left:auto;gap:4px}.bar-actions button,.icon-button{display:grid;place-items:center;background:transparent;border:1px solid transparent;min-width:30px;height:28px;padding:4px}.bar-actions button:hover,.icon-button:hover{background:#dfd3b7}.icon{width:19px;height:19px;display:block;flex:none;shape-rendering:crispEdges}
#screen{flex:1;min-height:0;display:flex;flex-direction:column;position:relative;overflow:auto}.screen-page{padding:15px 20px 11px;display:flex;flex:1;min-height:0;flex-direction:column;gap:12px}h1,h2,h3,p{margin:0}h1,h2,h3,.pixel{font-family:var(--pixel);font-weight:400}h2{font-size:24px;line-height:1.15}.body-copy{font-size:13px;line-height:1.5;color:var(--muted)}.page-head{display:flex;align-items:center;gap:8px;flex:none}.back{border:1px solid var(--edge);background:var(--cream);width:33px;height:31px;display:grid;place-items:center}.back:hover{background:#ead8b1}.count{margin-left:auto;font:13px var(--pixel);color:var(--muted);white-space:nowrap}
/* Preserva a composição inteira e suas proporções, sem recorte ou título duplicado. */
.hero{position:relative;flex:1;min-height:100px;overflow:hidden;background:#f5bf8c;border-bottom:2px solid var(--ink);display:grid;place-items:center}.hero img{display:block;width:100%;height:100%;object-fit:contain;min-height:0}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.home-options{padding:15px 19px 14px;display:grid;gap:9px}.mode{display:flex;align-items:center;gap:12px;text-align:left;border:2px solid var(--ink);padding:9px 12px;background:#f6e4be;box-shadow:2px 2px 0 #c7b69a;min-height:56px}.mode.primary{background:#dce9d4}.mode:hover,.mode:focus-visible{transform:translate(-1px,-1px);box-shadow:3px 3px 0 #ac9f85}.mode-icon{width:32px;min-width:32px;display:grid;place-items:center}.mode-icon .icon{width:28px;height:28px}.mode b{font:17px var(--pixel);display:block}.mode small{font-size:11px;color:#585545;display:block;margin-top:3px}.mode .chev{margin-left:auto;font:20px var(--pixel)}
#foot{border-top:1px solid var(--edge);height:26px;flex:none;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:0 11px;color:#655e51;background:var(--cream);font:10px var(--text)}.signal{display:flex;align-items:center;gap:6px}.dot{width:6px;height:6px;background:#62816a;box-shadow:1px 1px #3e594a}.foot-action{font:inherit;border:0;padding:2px;background:none;text-decoration:underline;text-underline-offset:2px}
.gallery{flex:1;min-height:0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));gap:8px}.card{padding:0;display:flex;flex-direction:column;align-items:stretch;background:#fffae9;border:2px solid #6e6f60;overflow:hidden}.card:hover,.card:focus-visible{border-color:var(--ink);box-shadow:2px 2px 0 #aa9b75}.card img{width:100%;height:0;flex:1;min-height:0;object-fit:cover}.card span{font:13px var(--pixel);line-height:1.2;min-height:29px;display:grid;place-items:center;padding:2px}.pager{display:flex;align-items:center;justify-content:space-between;gap:8px}.small-btn{background:var(--cream);border:1px solid var(--edge);padding:4px 10px;min-height:29px;font:13px var(--pixel)}.pips{display:flex;gap:5px}.pips i{width:8px;height:8px;border:1px solid #767863}.pips .on{background:var(--green)}
.game-intro{display:grid;grid-template-columns:85px minmax(0,1fr);gap:12px;align-items:center}.game-intro img{border:2px solid var(--ink);width:85px;height:75px;object-fit:cover}.game-intro h3{font-size:18px;margin-bottom:5px}.game-intro p{font-size:12px;line-height:1.45}.controls-copy{font-size:11px;line-height:1.5;color:var(--muted)}.level-list{display:grid;gap:7px}.level-btn{display:flex;gap:10px;align-items:center;background:#fff7e5;border:1px solid var(--edge);padding:8px 11px;font:15px var(--pixel);text-align:left}.level-btn .number{width:22px;text-align:center;color:var(--muted)}.level-btn small{font:11px var(--text);margin-left:auto}.level-btn.selected{background:#dce9d4;border:2px solid var(--green);padding:7px 10px}.level-btn.selected .number{color:var(--green)}.action{border:2px solid var(--ink);background:var(--green);color:#fff8df;box-shadow:2px 2px #aaa185;padding:9px 15px;min-height:37px;font:15px var(--pixel);line-height:1.2}.action:hover{background:#2f5244}.action.secondary{background:var(--cream);color:var(--ink)}.actions{margin-top:auto;display:flex;gap:8px;flex-wrap:wrap}.actions .action{flex:1}.route-grid{display:grid;grid-template-columns:1fr 1fr;gap:5px 10px;list-style:none;padding:0;margin:0}.route-grid li{display:flex;align-items:center;gap:7px;font-size:12px;min-width:0}.route-grid img{width:26px;height:23px;object-fit:cover;border:1px solid #666849}.route-grid .idx{font:11px var(--pixel);color:var(--muted)}.overview{gap:10px}.small-title{font:15px var(--pixel)}.game-area{display:flex;flex:1;min-height:0;flex-direction:column;--game-color:#2e4644}.game-head{height:32px;display:flex;align-items:center;gap:7px;padding:0 8px;flex:none}.game-head .level-tag{margin-left:auto;color:var(--muted);font:12px var(--pixel)}.game-head strong{font:15px var(--pixel)}.stage{display:grid;place-items:center;flex:1;min-height:0;background:var(--game-color);overflow:hidden;position:relative}.stage canvas{display:block;max-width:100%;max-height:100%;aspect-ratio:1;touch-action:none}.game-hud{min-height:24px;display:grid;place-items:center;background:#efe5cc;font:12px var(--pixel);text-align:center;padding:3px}.pad{display:flex;align-items:center;justify-content:center;gap:7px;min-height:45px;padding:3px 6px}.pad button{touch-action:none;user-select:none;background:var(--cream);border:1px solid var(--edge);border-bottom:3px solid #9f947b;min-width:46px;min-height:35px;font:bold 17px monospace}.pad button:active{background:var(--gold);border-bottom-width:1px}.pad .single{font:14px var(--pixel);min-width:90px}.modal-box{margin:auto 0;text-align:center;display:flex;flex-direction:column;align-items:center;gap:9px}.modal-box img{width:100px;height:86px;object-fit:cover;border:2px solid var(--ink);box-shadow:3px 3px #c5b69d}.modal-box h2{font-size:27px}.modal-box p{max-width:340px}.result-actions{display:grid;gap:9px;grid-template-columns:1fr 1fr}.result-actions>.action:first-child:last-child{grid-column:1/-1}.summary-cards{display:grid;grid-template-columns:repeat(6,1fr);gap:7px}.summary-cards img{width:100%;border:2px solid var(--green)}.summary-cards .miss{border-color:#a47552;filter:saturate(.35)}
@media(max-width:540px){.desktop{padding:8px}.window{width:min(100%,465px);height:min(520px,calc(100svh - 16px));min-height:min(390px,calc(100svh - 16px));box-shadow:3px 3px 0 #7c8b7b}.screen-page{padding:12px 13px 10px;gap:9px}.mode small{font-size:11px}.card span{font-size:12px}.bar-actions #popup{display:none}.home-options{padding:13px}.gallery{gap:6px}.route-grid{gap:6px}.stage canvas{max-width:100%}.game-intro{grid-template-columns:67px minmax(0,1fr)}.game-intro img{width:67px;height:65px}}
/* Na abertura estreita, a janela acompanha a arte inteira, sem faixas de preenchimento. */
@media(max-width:540px){
  .window:has(.hero){height:auto;min-height:0;max-height:calc(100svh - 16px)}
  .hero{flex:none;min-height:0}
  .hero img{height:auto}
}

body.popup .desktop{padding:0}body.popup .window{width:min(492px,100vw,100svh);height:min(492px,100vw,100svh);min-height:0;box-shadow:none}body.popup #popup{display:none}
@media(max-height:465px){.window{min-height:0}.screen-page{display:block;overflow:auto}.screen-page>*+*{margin-top:7px}.gallery{min-height:185px}.hero{min-height:50px}.home-options{padding:6px 13px;gap:5px}.mode{min-height:42px;padding:5px 10px}.bar{height:29px}#foot{height:22px}.game-intro img{height:48px}.gallery{grid-template-rows:85px 85px}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}
[hidden]{display:none!important}

/* O roteiro cresce com o catálogo, conservando a ação visível na janelinha. */
.overview .route-grid{flex:1;min-height:0;overflow-y:auto;align-content:start;padding:2px}
.summary-cards{grid-template-columns:repeat(8,minmax(0,1fr))}

/* A assinatura ocupa a barra sem alterar as áreas de toque. */
.bar>.brand-logo{width:100px;height:auto;max-height:24px;object-fit:contain}

/* Controles exclusivos da chapa: os demais jogos conservam o painel original. */
.chapa-tools{display:flex;gap:7px;padding:4px 8px 0;justify-content:center}
.chapa-tools button{flex:1;min-height:44px;border:2px solid var(--edge);background:var(--cream);font:14px var(--pixel);touch-action:manipulation}
.chapa-tools button[aria-pressed="true"]{background:var(--green);color:#fff8df;border-color:var(--ink);box-shadow:inset 0 0 0 2px #c4d4ae}
.chapa-tools small{font:11px var(--text)}
.chapa-game .pad button{min-height:44px;flex:1;font:12px var(--pixel)}
.chapa-game .game-hud{min-height:34px;font-size:12px}
.chapa-game .stage{min-height:150px}

/* A pausa compartilha a arte da seleção e centraliza só a saída ao menu. */
.modal-box .pause-art{object-fit:contain}
.pause-actions>[data-do="sair"]{grid-column:1/-1;justify-self:center;width:calc((100% - 9px)/2)}
