/* V390 · Conclusão de fase e Contexto e fontes em pixel art: chips de resultado, cards coloridos com ícone,
   balão de citação e ações em botões de verdade. Moldura em degrau, realce em cima/à esquerda e sombra
   embaixo/à direita, como os botões de toque (touch-pixel.css). Tudo aqui vale só para estas duas telas. */
@property --cp-count{syntax:'<integer>';inherits:false;initial-value:0}

#root #stage #overlay :is(.completion-panel,.facts-v2){
 --cp-ink:#0b0f1f;
 --cp-step:polygon(0 2px,2px 2px,2px 0,calc(100% - 2px) 0,calc(100% - 2px) 2px,100% 2px,100% calc(100% - 2px),calc(100% - 2px) calc(100% - 2px),calc(100% - 2px) 100%,2px 100%,2px calc(100% - 2px),0 calc(100% - 2px));
 --cp-step4:polygon(0 4px,2px 4px,2px 2px,4px 2px,4px 0,calc(100% - 4px) 0,calc(100% - 4px) 2px,calc(100% - 2px) 2px,calc(100% - 2px) 4px,100% 4px,100% calc(100% - 4px),calc(100% - 2px) calc(100% - 4px),calc(100% - 2px) calc(100% - 2px),calc(100% - 4px) calc(100% - 2px),calc(100% - 4px) 100%,4px 100%,4px calc(100% - 2px),2px calc(100% - 2px),2px calc(100% - 4px),0 calc(100% - 4px));
 box-sizing:border-box;display:flex;flex-direction:column;gap:10px;width:100%;max-width:880px;max-height:100%;min-height:0;margin:auto;padding:16px 18px;overflow:hidden;contain:paint;text-align:left;
 border:0;border-radius:0;clip-path:var(--cp-step4);
 background:linear-gradient(#ffffff08 1px,transparent 1px) 0 0/100% 4px,#141d33;
 box-shadow:inset 0 0 0 3px var(--cp-ink),inset 0 0 0 5px #3f6a86,inset 0 7px #5b8fae,inset 7px 0 #5b8fae,inset 0 -7px #1f3a4f,inset -7px 0 #1f3a4f;
 color:#e8f1f6
}
#root #stage #overlay :is(.completion-panel,.facts-v2) .cp-icon{flex:none;width:18px;height:18px;image-rendering:pixelated}
#root #stage #overlay :is(.completion-panel,.facts-v2) h2{margin:0;font:15px/1.45 'Brasil Arcade',monospace;color:#fff0bd;text-shadow:2px 2px 0 var(--cp-ink);overflow-wrap:normal;word-break:normal;min-width:0}

/* Chips: resultado, medalha, recorde, fase e personagem */
#root #stage #overlay .cp-chips{display:flex;flex-wrap:wrap;align-items:center;gap:6px;min-width:0}
#root #stage #overlay .cp-chip{--c:#3fbf74;display:inline-flex;align-items:center;gap:6px;min-height:26px;max-width:100%;margin:0;padding:3px 9px 3px 6px;box-sizing:border-box;clip-path:var(--cp-step);
 background:color-mix(in srgb,var(--c) 26%,#0d1424);color:color-mix(in srgb,var(--c) 45%,#fff);
 box-shadow:inset 0 0 0 2px color-mix(in srgb,var(--c) 75%,#050816),inset 0 4px color-mix(in srgb,var(--c) 40%,#0d1424),inset 0 -4px color-mix(in srgb,var(--c) 15%,#050816);
 font:9px/1.5 'Brasil Arcade',monospace;letter-spacing:.02em;white-space:nowrap;border:0;animation:none}
#root #stage #overlay .cp-chip .cp-icon{width:14px;height:14px}
#root #stage #overlay .cp-chip.is-medal.is-gold{--c:#f3c85b}
#root #stage #overlay .cp-chip.is-medal.is-silver{--c:#cfd9e4}
#root #stage #overlay .cp-chip.is-medal.is-bronze{--c:#d98a4c}
#root #stage #overlay .cp-chip.is-medal svg{width:16px;height:16px}
#root #stage #overlay .cp-chip.is-record{--c:#ffd84a}
#root #stage #overlay .cp-chip:is(.is-phase,.is-who){--c:#8f7ce0}
#root #stage #overlay .cp-chip.is-context{--c:#5aa9e6}
#root #stage #overlay .cp-chip.is-year{--c:#f0a830}

/* Cabeçalho da conclusão */
#root #stage #overlay .completion-panel .completion-head{display:grid;gap:8px;flex:none}
#root #stage #overlay .completion-panel .completion-title{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;min-width:0}
#root #stage #overlay .completion-panel .completed-phase-label{margin:0;font-size:8px;overflow-wrap:normal}
#root #stage #overlay .completion-panel .completion-body{display:flex;flex-direction:column;gap:10px;flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y;padding:2px;scrollbar-width:thin}

/* Cards de resultado */
#root #stage #overlay .completion-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(132px,1fr));gap:8px}
#root #stage #overlay .cp-card{--c:#5aa9e6;position:relative;display:flex;flex-direction:column;gap:3px;min-width:0;margin:0;padding:8px 10px 9px;box-sizing:border-box;clip-path:var(--cp-step);
 background:linear-gradient(color-mix(in srgb,var(--c) 30%,#0d1424),color-mix(in srgb,var(--c) 16%,#0b1120));
 box-shadow:inset 0 0 0 2px color-mix(in srgb,var(--c) 70%,#050816),inset 0 4px color-mix(in srgb,var(--c) 45%,#0d1424),inset 4px 0 color-mix(in srgb,var(--c) 35%,#0d1424),inset 0 -5px color-mix(in srgb,var(--c) 12%,#050816),inset -4px 0 color-mix(in srgb,var(--c) 14%,#050816);
 color:#f3f7fa;border:0;text-align:left}
#root #stage #overlay .cp-card-label{min-height:18px;display:flex;align-items:center;gap:6px;font:8px/1.5 'Brasil Arcade',monospace;letter-spacing:.03em;color:color-mix(in srgb,var(--c) 55%,#fff)}
#root #stage #overlay .cp-card-value{display:block;margin:0;font:30px/1 VT323,monospace;color:color-mix(in srgb,var(--c) 30%,#fff);text-shadow:2px 2px 0 var(--cp-ink);font-variant-numeric:tabular-nums}
#root #stage #overlay .cp-card-value.is-claimed{font:9px/1.5 'Brasil Arcade',monospace;margin:4px 0 2px}
#root #stage #overlay .cp-card small{display:block;font:17px/1.05 VT323,monospace;color:color-mix(in srgb,var(--c) 22%,#dfe7ee)}
#root #stage #overlay .cp-card.is-time{--c:#f0a830}
#root #stage #overlay .cp-card.is-coins{--c:#f5c542}
#root #stage #overlay .cp-card.is-health{--c:#ef5d6c}
#root #stage #overlay .cp-card.is-medal{--c:#6b7f93}
#root #stage #overlay .cp-card.is-medal.is-gold{--c:#f3c85b}
#root #stage #overlay .cp-card.is-medal.is-silver{--c:#b9c6d4}
#root #stage #overlay .cp-card.is-medal.is-bronze{--c:#d98a4c}
#root #stage #overlay .cp-card.time-medal{flex-direction:column;align-items:stretch;border:0}
#root #stage #overlay .cp-medal-row{display:flex;align-items:center;gap:8px}
#root #stage #overlay .cp-card .time-medal-icon{width:30px;height:30px;animation:none}
#root #stage #overlay .cp-card .time-medal-empty{width:22px;height:22px;margin:2px 4px;border-color:#8ea2b5}
#root #stage #overlay .cp-card.is-medal .cp-card-value{font:11px/1.4 'Brasil Arcade',monospace}
#root #stage #overlay .cp-card small.completion-settlement{color:#ffd9a0}
/* Contador de verba: o número final é o valor-base; a animação só parte do zero. */
#root #stage #overlay .cp-count{--cp-count:var(--to);counter-reset:cp-n var(--cp-count)}
#root #stage #overlay .cp-count::after{content:counter(cp-n)}
/* Relógio da corrida dentro do card: o botão de detalhes vira o próprio número. */
#root #stage #overlay .cp-clock{font:inherit}
#root #stage #overlay .cp-clock .run-pix{display:block;max-width:230px;margin:3px 0;font:14px/1.15 VT323,monospace;color:#ffe680;white-space:normal;text-shadow:none}
#root #stage #overlay .cp-clock .run-pix strong{color:#8af0b4}
#root #stage #overlay .cp-clock .run-rank-wrap{display:flex;flex-direction:column;align-items:flex-start;gap:2px}
#root #stage #overlay .cp-clock .run-rank{max-width:none;text-align:left;font:15px/1.1 VT323,monospace;color:#ffe0a3}
#root #stage #overlay .cp-clock .run-badge{min-height:32px;padding:0;margin:0;gap:6px;border:0;background:none;color:#fff3c4;box-shadow:none;justify-content:flex-start}
#root #stage #overlay .cp-clock .run-badge time{font:30px/1 VT323,monospace;text-shadow:2px 2px 0 var(--cp-ink)}
#root #stage #overlay .cp-clock .run-badge .run-clock svg{display:none}
#root #stage #overlay .cp-clock .run-badge .run-info-icon{width:16px;height:16px;font-size:14px;color:#ffd27a}
#root #stage #overlay .cp-clock .run-badge:hover{background:none;color:#fff}
/* Card de compras: lista curta, em fichas */

/* Citação: balão de fala com aspas em pixel art e rabicho em degrau */
#root #stage #overlay .completion-quote{position:relative;display:flex;align-items:flex-start;gap:8px;margin:0 0 0 2px;padding:7px 12px 8px 9px;clip-path:var(--cp-step);
 background:#f6ecd0;box-shadow:inset 0 0 0 2px var(--cp-ink),inset 0 4px #fff9e6,inset 0 -4px #d9c79a;color:#1d2233}
#root #stage #overlay .completion-quote .cp-quote-mark{width:20px;height:20px;margin-top:1px;transform:rotate(180deg)}
#root #stage #overlay .completion-panel .completion-story{margin:0;padding:0;border:0;font:21px/1.12 VT323,monospace;color:#1d2233}
/* V488 · Aviso de uma linha quando dá para comprar emenda (substitui o card com a lista). */
#root #stage #overlay .completion-buy{display:flex;align-items:center;gap:8px;margin:0;padding:4px 10px;border:2px solid #4fcf8a;background:#0b2a1e;color:#effff5;font:18px/1.1 VT323,monospace}
#root #stage #overlay .completion-buy .cp-icon{flex:none;width:16px;height:16px}
#root #stage #overlay .completion-buy span{min-width:0}

/* Contexto e fontes recolhível */
#root #stage #overlay .completion-context{flex:none;border:0;background:none;margin:0}
#root #stage #overlay .completion-context>summary{--c:#5aa9e6;display:flex;align-items:center;gap:10px;min-height:44px;padding:6px 12px;list-style:none;cursor:pointer;clip-path:var(--cp-step);
 background:color-mix(in srgb,var(--c) 20%,#0d1424);box-shadow:inset 0 0 0 2px color-mix(in srgb,var(--c) 70%,#050816),inset 0 4px color-mix(in srgb,var(--c) 38%,#0d1424),inset 0 -4px #08101d;color:#d6efff}
#root #stage #overlay .completion-context>summary::-webkit-details-marker{display:none}
#root #stage #overlay .completion-context>summary .completion-info{width:22px;height:22px;border:0;border-radius:0;display:block}
#root #stage #overlay .completion-context>summary>span:nth-child(2){flex:1;min-width:0;display:flex;flex-wrap:wrap;align-items:baseline;gap:2px 10px}
#root #stage #overlay .completion-context>summary strong{font:9px/1.5 'Brasil Arcade',monospace;color:#ffe180}
#root #stage #overlay .completion-context>summary small{font:18px/1.05 VT323,monospace;color:#bed5e1;margin:0}
#root #stage #overlay .completion-context>summary:focus-visible,#root #stage #overlay .fx-card.is-fiction>summary:focus-visible{outline:3px solid #ffe180;outline-offset:-3px}
#root #stage #overlay .completion-context-body{padding:8px 0 0;border:0}
#root #stage #overlay .cp-chevron{flex:none;width:10px;height:6px;background:currentColor;clip-path:polygon(0 0,100% 0,100% 2px,80% 2px,80% 4px,60% 4px,60% 6px,40% 6px,40% 4px,20% 4px,20% 2px,0 2px);transform:none;transition:none}
#root #stage #overlay details[open]>summary .cp-chevron{transform:rotate(180deg)}

/* Peças do Contexto e fontes (tela própria e dentro da conclusão) */
#root #stage #overlay .fx-grid{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(0,1fr);gap:8px;align-items:stretch}
#root #stage #overlay .fx-side{align-content:start}
#root #stage #overlay .fx-side{display:grid;gap:8px;min-width:0}
#root #stage #overlay .fx-card{--c:#5aa9e6;display:flex;flex-direction:column;gap:6px;min-width:0;margin:0;padding:9px 11px 10px;box-sizing:border-box;clip-path:var(--cp-step);
 background:color-mix(in srgb,var(--c) 16%,#0c1322);
 box-shadow:inset 0 0 0 2px color-mix(in srgb,var(--c) 70%,#050816),inset 0 4px color-mix(in srgb,var(--c) 34%,#0c1322),inset 0 -4px #070d18;color:#e3ebf3;border:0}
#root #stage #overlay .fx-card-head{display:flex;flex-wrap:wrap;align-items:center;gap:6px 8px}
#root #stage #overlay .fx-card-head strong{font:8px/1.5 'Brasil Arcade',monospace;letter-spacing:.03em;color:color-mix(in srgb,var(--c) 50%,#fff)}
#root #stage #overlay .fx-card.is-fact{--c:#f2c94c;background:linear-gradient(#f6ecd0,#eadcb4);box-shadow:inset 0 0 0 2px var(--cp-ink),inset 0 4px #fffaf0,inset 4px 0 #fffaf0,inset 0 -5px #c8ad72,inset -4px 0 #d8c08a;color:#1d2233}
#root #stage #overlay .fx-card.is-fact .fx-card-head strong{color:#7a4c0e}
#root #stage #overlay .fx-card.is-fact .status-label{margin:0 0 0 auto;padding:2px 6px;font:7px/1.5 'Brasil Arcade',monospace;color:#fff4d8;background:#8a3d2c;box-shadow:inset 0 0 0 1px var(--cp-ink);letter-spacing:.02em;max-width:100%;overflow-wrap:normal}
#root #stage #overlay .fx-card .fx-fact{margin:0;font:21px/1.15 VT323,monospace;color:#1d2233}
#root #stage #overlay .fx-card .fx-note{font:15px/1.1 VT323,monospace;color:#6b5a38}
#root #stage #overlay .fx-card.is-people{--c:#6ad1c8}
#root #stage #overlay .fx-card.is-people p{margin:0;font:18px/1.12 VT323,monospace;color:#d8f4f1;max-width:none}
#root #stage #overlay .fx-card.is-sources{--c:#5aa9e6}
#root #stage #overlay .fx-card .source-links{display:grid;gap:6px;margin:0;font:inherit}
#root #stage #overlay .fx-source{box-sizing:border-box;width:100%;margin:0;display:flex;align-items:center;gap:8px;min-height:44px;padding:5px 8px;clip-path:var(--cp-step);background:#123251;box-shadow:inset 0 0 0 2px #5aa9e6,inset 0 -3px #0a1d33;color:#e6f4ff;text-decoration:none;overflow-wrap:anywhere}
#root #stage #overlay .fx-source:hover,#root #stage #overlay .fx-source:focus-visible{background:#1d4a73;outline:none;box-shadow:inset 0 0 0 2px #ffe180,inset 0 -3px #0a1d33}
#root #stage #overlay .fx-source .cp-icon{width:16px;height:16px}
#root #stage #overlay .fx-source-text{min-width:0;font:17px/1.05 VT323,monospace}
#root #stage #overlay .fx-source-text b{font:8px/1.6 'Brasil Arcade',monospace;color:#9fd6ff;font-weight:400}
#root #stage #overlay .fx-source-text i{font-style:normal;color:#6f95b5}
#root #stage #overlay .fx-card.is-fiction{--c:#b58cff;padding:0}
#root #stage #overlay .fx-card.is-fiction>summary{display:flex;align-items:center;gap:8px;min-height:40px;padding:6px 11px;cursor:pointer;list-style:none;color:#eadcff}
#root #stage #overlay .fx-card.is-fiction>summary::-webkit-details-marker{display:none}
#root #stage #overlay .fx-card.is-fiction>summary strong{font:8px/1.5 'Brasil Arcade',monospace}
#root #stage #overlay .fx-card.is-fiction>summary small{flex:1;font:17px/1 VT323,monospace;color:#c8b6ec}
#root #stage #overlay .fx-fiction-body{padding:0 11px 9px}
#root #stage #overlay .fx-fiction-body p{margin:0 0 4px;font:17px/1.12 VT323,monospace;color:#ded2f5;max-width:none}
#root #stage #overlay .fx-fiction-body p.editorial{color:#b9aad6;margin:0}

/* Tela de Contexto e fontes */
#root #stage #overlay .facts-v2{position:relative;max-width:900px}
#root #stage #overlay .facts-v2 .facts-head{display:grid;gap:8px;flex:none}
#root #stage #overlay .facts-v2 .facts-scroll{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y;padding:2px;scrollbar-width:thin}
#root #stage #overlay .facts-v2 .facts-actions{display:flex;justify-content:flex-end;flex:none}
#root #stage #overlay .facts-v2 .facts-actions button{margin:0}

/* Ações: botões em degrau com cor própria; COMPARTILHAR nunca quebra a palavra */
#root #stage #overlay .completion-actions{display:flex;align-items:center;justify-content:space-between;gap:8px 14px;flex:none;margin:0;padding:8px 0 0;border-top:2px solid #2b4558}
#root #stage #overlay .completion-actions>small{flex:1 1 160px;max-width:none;min-width:0;font:16px/1.1 VT323,monospace;color:#9fb5c4}
#root #stage #overlay .completion-buttons{display:flex;align-items:stretch;justify-content:flex-end;flex-wrap:wrap;gap:8px}
#root #stage #overlay .completion-buttons>button,#root #stage #overlay .facts-v2 .facts-actions>button{--c:#2f71a3;position:relative;display:inline-flex;align-items:center;justify-content:center;gap:8px;flex:0 0 auto;min-width:min-content;min-height:44px;max-width:100%;margin:0;padding:8px 14px 10px;clip-path:var(--cp-step);border:0;border-radius:0;
 background:var(--c);color:#fff8e6;font:9px/1.4 'Brasil Arcade',monospace;letter-spacing:.02em;text-decoration:none;text-shadow:1px 1px 0 var(--cp-ink);
 white-space:nowrap;overflow-wrap:normal;word-break:normal;hyphens:manual;animation:none;transform:none;
 box-shadow:inset 0 0 0 2px var(--cp-ink),inset 0 4px color-mix(in srgb,var(--c) 50%,#fff6d8),inset 4px 0 color-mix(in srgb,var(--c) 70%,#fff6d8),inset 0 -5px color-mix(in srgb,var(--c) 55%,#050816),inset -4px 0 color-mix(in srgb,var(--c) 70%,#050816)}
#root #stage #overlay .completion-buttons>button::before,#root #stage #overlay .facts-v2 .facts-actions>button::before{content:none}
#root #stage #overlay .completion-buttons>button:is(:hover,:focus-visible),#root #stage #overlay .facts-v2 .facts-actions>button:is(:hover,:focus-visible){background:color-mix(in srgb,var(--c) 82%,#fff);outline:none}
#root #stage #overlay .completion-buttons>button:focus-visible,#root #stage #overlay .facts-v2 .facts-actions>button:focus-visible{box-shadow:inset 0 0 0 2px var(--cp-ink),inset 0 0 0 4px #ffe180,inset 0 -5px color-mix(in srgb,var(--c) 55%,#050816)}
#root #stage #overlay .completion-buttons>button:active,#root #stage #overlay .facts-v2 .facts-actions>button:active{transform:translateY(2px)}
#root #stage #overlay .completion-buttons>.continue-button{--c:#2fa864;font-size:10px;padding-inline:16px 14px}
#root #stage #overlay .completion-buttons>.continue-button::after{content:'';width:7px;height:12px;background:currentColor;clip-path:polygon(0 0,2px 0,2px 2px,4px 2px,4px 4px,6px 4px,6px 4px,7px 5px,7px 7px,6px 8px,4px 8px,4px 10px,2px 10px,2px 12px,0 12px)}
#root #stage #overlay .completion-buttons>.nav-button{--c:#2f6aa8}
#root #stage #overlay .completion-buttons>.nav-button::before{content:'';display:block;width:7px;height:12px;background:#bfe9ff;clip-path:polygon(100% 0,5px 0,5px 2px,3px 2px,3px 4px,1px 4px,0 5px,0 7px,1px 8px,3px 8px,3px 10px,5px 10px,5px 12px,100% 12px)}
#root #stage #overlay .completion-buttons>.completion-share{--c:#a447c9}
#root #stage #overlay .completion-share .cp-plane{width:18px;height:18px;margin:-2px 0}
#root #stage #overlay .completion-share [data-share-label]{white-space:nowrap}

/* Entrada: chips, cards e balão aparecem em sequência; o contador de verba sobe. */
#root #stage #overlay .completion-panel.is-entering .cp-chip{animation:cp-pop .28s steps(4,end) both}
#root #stage #overlay .completion-panel.is-entering .cp-chip:nth-child(2){animation-delay:.12s}
#root #stage #overlay .completion-panel.is-entering .cp-chip:nth-child(3){animation-delay:.24s}
#root #stage #overlay .completion-panel.is-entering :is(.cp-card,.completion-quote){animation:cp-rise .3s steps(5,end) both;animation-delay:calc(.18s + var(--i,0) * 90ms)}
#root #stage #overlay .completion-panel.is-entering .cp-count{animation:cp-count .9s steps(14,end) .45s both}
#root #stage #overlay .completion-panel.is-entering .cp-card .time-medal-icon{animation:time-medal-pop .7s steps(7,end) .5s both}
@keyframes cp-pop{0%{opacity:0;transform:scale(.6)}60%{opacity:1;transform:scale(1.08)}100%{opacity:1;transform:none}}
@keyframes cp-rise{0%{opacity:0;transform:translateY(10px)}100%{opacity:1;transform:none}}
@keyframes cp-count{from{--cp-count:0}}

/* Celular deitado e janelas baixas: tudo cabe sem rolar; só o Contexto aberto rola por dentro. */
@media (max-height:520px){
 #root #stage #overlay :is(.completion-panel,.facts-v2){gap:6px;padding:9px 12px 10px}
 #root #stage #overlay :is(.completion-panel,.facts-v2) h2{font-size:11px;line-height:1.4}
 #root #stage #overlay .cp-chip{min-height:22px;padding:2px 7px 2px 5px;font-size:7px;gap:5px}
 #root #stage #overlay .cp-chip .cp-icon{width:12px;height:12px}
 #root #stage #overlay .completion-panel .completion-head{gap:5px}
 #root #stage #overlay .completion-panel .completed-phase-label{font-size:7px}
 #root #stage #overlay .completion-panel .completion-body{gap:6px}
 #root #stage #overlay .completion-cards{grid-template-columns:repeat(auto-fit,minmax(112px,1fr));gap:6px}
 #root #stage #overlay .cp-card{padding:5px 8px 6px;gap:1px}
 #root #stage #overlay .cp-card-label{font-size:7px;gap:4px}
 #root #stage #overlay .cp-card-label .cp-icon{width:14px;height:14px}
 #root #stage #overlay .cp-card-value,#root #stage #overlay .cp-clock .run-badge time{font-size:25px}
 #root #stage #overlay .cp-clock .run-badge{min-height:26px}
 #root #stage #overlay .cp-card small{font-size:15px}
 #root #stage #overlay .cp-card .time-medal-icon{width:24px;height:24px}
 #root #stage #overlay .cp-card.is-medal .cp-card-value{font-size:9px}
 #root #stage #overlay .completion-quote{padding:4px 10px 5px 7px;gap:6px}
 #root #stage #overlay .completion-quote .cp-quote-mark{width:16px;height:16px}
 #root #stage #overlay .completion-panel .completion-story{font-size:18px;line-height:1.05}
 #root #stage #overlay .completion-context>summary{min-height:40px;padding:4px 10px}
 #root #stage #overlay .completion-context>summary strong{font-size:8px}
 #root #stage #overlay .completion-context>summary small{font-size:16px}
 #root #stage #overlay .completion-actions{padding-top:6px}
 #root #stage #overlay .completion-actions>small{font-size:14px}
 #root #stage #overlay .completion-buttons{gap:6px}
 #root #stage #overlay .completion-buttons>button,#root #stage #overlay .facts-v2 .facts-actions>button{min-height:40px;padding:6px 10px 8px;font-size:8px}
 #root #stage #overlay .completion-buttons>.continue-button{font-size:9px}
 #root #stage #overlay .fx-card{padding:6px 9px 7px;gap:4px}
 #root #stage #overlay .fx-card .fx-fact{font-size:18px;line-height:1.08}
 #root #stage #overlay .fx-card.is-people p,#root #stage #overlay .fx-fiction-body p,#root #stage #overlay .fx-source-text{font-size:16px}
 #root #stage #overlay .fx-source{min-height:44px;padding:5px 8px}
 #root #stage #overlay .fx-card.is-fiction>summary{min-height:36px;padding:4px 9px}
 /* VOLTAR sobe para o canto do cabeçalho (continua o último na ordem de tab) e libera uma faixa inteira. */
 #root #stage #overlay .facts-v2 .facts-actions{position:absolute;top:9px;right:12px}
 #root #stage #overlay .facts-v2 .facts-head{padding-right:96px}
}
/* Celular de pé ou tela estreita: uma coluna, botões dividem a largura. */
@media (max-width:620px){
 #root #stage #overlay .fx-grid{grid-template-columns:1fr}
 #root #stage #overlay .completion-actions{flex-wrap:wrap}
 #root #stage #overlay .completion-actions>small{flex-basis:100%}
 #root #stage #overlay .completion-buttons{width:100%}
 #root #stage #overlay .completion-buttons>button{flex:1 0 auto}
}
/* Computador: mais respiro, sem esticar. */
@media (min-width:1000px) and (min-height:640px){
 #root #stage #overlay :is(.completion-panel,.facts-v2){padding:20px 24px;gap:12px}
 #root #stage #overlay :is(.completion-panel,.facts-v2) h2{font-size:18px}
 #root #stage #overlay .completion-cards{grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px}
 #root #stage #overlay .cp-card{padding:10px 12px 11px}
 #root #stage #overlay .completion-panel .completion-story{font-size:23px}
 #root #stage #overlay .fx-card .fx-fact{font-size:22px}
}
@media (prefers-reduced-motion:reduce){
 #root #stage #overlay .completion-panel.is-entering :is(.cp-chip,.cp-card,.completion-quote,.cp-count,.time-medal-icon){animation:none!important}
}
/* V417 · Convite da Super Games: card pequeno no fim da conclusão, sem brilho nem animação. Nunca é popup;
   o foco continua no avançar e o × dispensa de vez (portal-invite.mjs). */
#root #stage #overlay .portal-invite{flex:none;display:flex;align-items:stretch;gap:0;margin:0;border:2px solid #4a3d7a;background:#151a33;color:#d8d3ee}
#root #stage #overlay .portal-invite .pi-link{flex:1 1 auto;display:flex;align-items:center;gap:10px;min-width:0;min-height:40px;margin:0;padding:4px 10px;color:inherit;font:inherit;text-decoration:none}
#root #stage #overlay .portal-invite .pi-icon{width:26px;height:18px;flex:none;image-rendering:pixelated}
#root #stage #overlay .portal-invite .pi-text{display:flex;flex-wrap:wrap;align-items:baseline;gap:2px 10px;min-width:0}
#root #stage #overlay .portal-invite .pi-title{font:17px/1.1 VT323,monospace;color:#e9e4ff}
#root #stage #overlay .portal-invite .pi-cta{font:15px/1.1 VT323,monospace;color:#93f2c2;text-decoration:underline;text-underline-offset:3px}
#root #stage #overlay .portal-invite .pi-link:is(:hover,:focus-visible) .pi-title{color:#fff}
#root #stage #overlay .portal-invite .pi-dismiss{flex:none;width:40px;min-width:40px;min-height:40px;margin:0;padding:0;border:0;border-left:2px solid #4a3d7a;background:none;color:#a9a3c8;font:20px/1 monospace;box-shadow:none;animation:none}
#root #stage #overlay .portal-invite .pi-dismiss:is(:hover,:focus-visible){color:#fff;background:#232a4a}
/* V458 · chamada para o ranking da campanha completa (entrou ou subiu). */
#root #stage #overlay .run-campaign,#stage .run-campaign{display:inline-block;font:15px/1.15 VT323,monospace;color:#99e4ca;text-decoration:none;border-bottom:1px dashed #99e4ca;padding:2px 0;max-width:260px;text-align:left}
#root #stage #overlay .run-campaign b,#stage .run-campaign b{color:#ffe59c;font-weight:400}
#root #stage #overlay .run-campaign:is(:hover,:focus-visible){color:#d8fff0;outline:2px solid #ffe088;outline-offset:2px}
/* V488 · Celular deitado: aviso de compra, cards, "Contexto e fontes" e convite ficam mais baixos, e os três botões
   cabem numa linha com a nota embaixo, para a frase do personagem e o resto caberem sem rolar. Fica no fim do arquivo
   para valer sobre as regras do convite. */
@media (max-height:520px){
 #root #stage #overlay .completion-buy{gap:6px;padding:1px 8px;font-size:16px}
 #root #stage #overlay .completion-quote{padding:3px 10px 3px 7px}
 #root #stage #overlay .completion-buy .cp-icon{width:14px;height:14px}
 #root #stage #overlay .completion-panel{gap:4px}
 #root #stage #overlay .completion-panel .completion-head{gap:3px}
 #root #stage #overlay .completion-panel .completion-body{gap:3px}
 #root #stage #overlay .cp-card{padding:3px 8px 4px}
 #root #stage #overlay .cp-card-value,#root #stage #overlay .cp-clock .run-badge time{font-size:20px}
 #root #stage #overlay .cp-clock .run-badge{min-height:22px}
 #root #stage #overlay .completion-context>summary{min-height:34px;padding:3px 10px}
 #root #stage #overlay .portal-invite .pi-link{min-height:32px;padding:2px 10px}
 #root #stage #overlay .portal-invite .pi-dismiss{min-height:32px}
}
@media (max-height:520px) and (min-width:640px){
 #root #stage #overlay .completion-actions{flex-wrap:wrap;row-gap:4px}
 #root #stage #overlay .completion-actions>small{order:2;flex:1 1 100%}
 #root #stage #overlay .completion-buttons{flex:1 1 100%;flex-wrap:nowrap}
}
/* V488 · Tela estreita (em pé): os três cards (tempo, verba e reputação) numa linha só. */
@media (max-width:620px){
 #root #stage #overlay .completion-cards{grid-template-columns:repeat(auto-fit,minmax(92px,1fr));gap:6px}
 #root #stage #overlay .cp-card{padding:5px 6px 6px}
 #root #stage #overlay .cp-card-value,#root #stage #overlay .cp-clock .run-badge time{font-size:19px}
 #root #stage #overlay .cp-card small{font-size:14px}
 #root #stage #overlay .cp-card-label{font-size:7px;gap:3px;letter-spacing:0}
 #root #stage #overlay .cp-card-label .cp-icon{width:12px;height:12px}
}

/* A small card inside the existing scroll region; actions remain fixed. */
#root #stage #overlay .completion-secret{flex:none;padding:6px 10px;border:1px solid #536471;background:#152532;color:#c7d2d9}
#root #stage #overlay .completion-secret strong{font:8px/1.5 "Brasil Arcade",monospace}
#root #stage #overlay .completion-secret p{margin:3px 0 0;font:17px/1.1 VT323,monospace}

/* Result labels stay readable; the panel owns scrolling on short screens. */
#root #stage #overlay .completion-panel :is(.fx-card-head strong,.status-label,.cp-chip,.completed-phase-label,.cp-card-label,.cp-card-value.is-claimed,.is-medal .cp-card-value,.completion-context>summary strong,.fx-card h3,.fx-card>summary strong,.fx-source-text b,.completion-secret strong,.completion-buttons>button){font-size:11px;line-height:1.4;white-space:normal;overflow-wrap:anywhere;text-overflow:clip;-webkit-line-clamp:unset}
#root #stage #overlay .completion-panel :is(.completion-context>summary,.fx-card>summary,.fx-card h3,.completed-phase-label){height:auto;max-height:none;overflow:visible}
#root #stage #overlay .completion-panel{overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y}
#root #stage #overlay .completion-panel .completion-body{flex:none;overflow:visible}
#root #stage #overlay .completion-panel :is(.completion-context,.fx-grid,.fx-card,.completion-buttons){min-width:0;max-width:100%;box-sizing:border-box}
#root #stage #overlay .completion-panel .completion-buttons{flex-wrap:wrap}
