/* Map-first mobile shell. Secondary systems live in dialogs. */
body.map-first{overflow:hidden;background:#10343e}
.map-first .game-shell{height:100dvh;max-width:none}
.map-first .game-shell>.topbar{display:none}
.map-first main{position:relative;display:block;height:100dvh;min-height:0;padding:0}
.map-first .world-stage{position:absolute;inset:0;height:auto;min-height:0;max-height:none;border:0;background:#10343e}
.map-first .world-stage:after{box-shadow:inset 0 0 100px #001a2455;pointer-events:none}
.map-first .world-stage .map-viewport{inset:48px 0 calc(86px + env(safe-area-inset-bottom))!important;width:auto!important;height:auto!important;touch-action:none}
.map-first .world-map{min-width:0;width:100%;height:100%}
.map-first .map-title,.map-first .map-key,.map-first .news-strip,.map-first .command-bar>.save-note,.map-first .command-bar>#advance,.map-first .game-shell #signal-tray{display:none!important}
.map-first .world-updates{position:absolute;z-index:4;top:max(7px,env(safe-area-inset-top));left:68px;right:220px;height:38px}
.map-first #news-ticker{height:38px;min-height:0;width:100%;padding:0 12px;border:1px solid #badbd329;border-radius:5px;background:#082630da;display:flex;gap:10px;align-items:center}
.map-first #news-ticker b{font-size:0}.map-first #news-ticker b:after{content:'●';font-size:11px;color:#a9dfc6}
.map-first #news-headline{font:13px var(--body)!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#e0ebe2}
.map-first .cycle{position:fixed;top:max(7px,env(safe-area-inset-top));right:max(12px,env(safe-area-inset-right));height:38px;display:flex;gap:7px;padding:0 8px;background:#082630da;border:1px solid #badbd329;border-radius:5px;z-index:5}
.map-first .cycle>span:first-child{font-size:11px}.map-first .cycle strong{font-size:23px}.map-first .cycle-state{display:none}
.map-first .time-controls{display:flex;margin:0;padding:0;border:0;background:none;gap:2px}
.map-first .time-controls button{min-width:32px;min-height:34px;padding:5px;font-size:12px;border-radius:4px}
.map-first .edge-button{position:absolute;z-index:5;width:44px;height:40px;background:#082630dc;border:1px solid #a4c9c244;border-radius:5px;font-size:24px;color:#d3e6dc}
.map-first #open-menu{top:max(7px,env(safe-area-inset-top));left:max(12px,env(safe-area-inset-left))}
.map-first #open-layers{bottom:calc(58px + env(safe-area-inset-bottom));left:max(12px,env(safe-area-inset-left))}
.map-first .map-tools{left:max(12px,env(safe-area-inset-left));top:58px!important;display:flex;flex-direction:column;gap:4px}
.map-first .map-tools button{width:38px;height:38px;border-radius:5px;background:#082630a8}
.map-first #zoom-reset{display:none}
.map-first .command-bar{position:absolute;bottom:0;left:0;right:0;height:calc(48px + env(safe-area-inset-bottom));display:grid;grid-template-columns:132px auto minmax(0,1fr) 122px 96px;gap:0;padding:1px max(10px,env(safe-area-inset-right)) calc(1px + env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left));background:#071d26f5;border-top:1px solid #8ab8b43d}
.map-first .command-left{display:block}.map-first #show-upgrades{width:100%;height:44px;min-height:44px;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:4px 10px;border-radius:4px;background:#bdd6ba;color:#18362d;font-size:15px}
.map-first #show-upgrades .button-symbol,.map-first #show-upgrades .button-arrow,.map-first #upgrade-count{display:none}
.map-first #compact-credits{font:21px var(--display);white-space:nowrap}.map-first #compact-credits small{display:inline;font:11px var(--body);color:#365543}
.map-first #global-pulse{display:flex;align-items:center;justify-content:center;gap:24px;border:0;background:none;color:#a5bfbf}
.map-first #global-pulse span{display:flex;flex-direction:row;align-items:baseline;gap:6px;font:11px var(--body);text-align:left}.map-first #global-pulse b{font:20px/1 var(--display);color:#d0e8bf}.map-first #global-pulse span+span b{color:#ef9a7d}
.map-first #compact-response{position:relative;display:flex;align-items:center;justify-content:center;gap:6px;flex-wrap:nowrap;padding:3px 8px 7px;background:none;border:0;border-left:1px solid #91b3b32b;color:#e7b6a9}
.map-first #compact-response small{font:11px var(--body)}.map-first #compact-response strong{font:20px/1 var(--display)}.map-first #compact-response i{position:absolute;bottom:5px;left:14px;right:14px;height:2px;background:#385354}.map-first #compact-response em{display:block;height:2px;background:#ea8c7b}
.map-first #open-world{border:1px solid #81a8a746;border-radius:5px;background:#163b45;color:#d9e5da;font-size:15px}.map-first #world-attention{color:#f0b978}
.map-first #country-peek{position:absolute;z-index:5;bottom:calc(59px + env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);display:flex;max-width:calc(100% - 150px);width:430px;height:48px;border:1px solid #bed4c73b;border-radius:5px;background:#08232edb;backdrop-filter:blur(12px)}
.map-first #country-peek[hidden]{display:none}.map-first #open-country{display:grid;grid-template-columns:1fr 20px;align-content:center;gap:3px;flex:1;min-width:0;border:0;background:none;text-align:left;padding:5px 12px}.map-first #peek-name{font:20px/1 var(--display);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.map-first #peek-stats{font:11px var(--body);color:#b6ccca;grid-row:2;white-space:nowrap}.map-first #open-country>b{grid-row:1/3;grid-column:2;align-self:center;color:#b6d9b4}.map-first #dismiss-country{width:40px;border:0;border-left:1px solid #829b9633;background:none;font-size:21px}
.map-first #country-sheet{width:min(720px,96vw);padding:18px;max-height:94dvh}
.map-first #country-sheet .selection-panel{position:static;width:auto;max-height:none;padding:0!important;background:none;border:0;box-shadow:none;overflow:visible;backdrop-filter:none}
.map-first #country-sheet .selection-top{display:none}.map-first #country-sheet .country-heading{margin:12px 0}.map-first #country-sheet .country-note{display:block}.map-first #country-sheet .local-action{min-height:44px!important}
.map-first #world-hub{width:min(740px,96vw);padding:20px;max-height:94dvh}
.map-first .hub-tabs{display:flex;gap:8px;margin:12px 0}.map-first .hub-tabs button{min-height:40px;padding:8px 16px;border:1px solid #759e9e44;border-radius:5px;background:none}.map-first .hub-tabs button[aria-pressed=true]{background:#bdd6ba;color:#18362d}
.map-first #hub-overview .hud{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));height:auto;padding:0;gap:12px;background:none}
.map-first #hub-overview .metric{padding:10px!important;height:auto;min-height:75px;background:#07192260;border:0}.map-first #hub-overview .metric strong{font-size:28px}.map-first #hub-overview .metric-caption{font-size:11px}.map-first #hub-overview .metric>span{font-size:11px}.map-first #hub-overview .micro-bars{font-size:11px;letter-spacing:0;height:auto;line-height:1.3;white-space:normal}
.map-first #hub-overview .mission-card{position:static;display:block;width:auto;padding:12px 0;background:none}.map-first #hub-overview .mission-card h2{font-size:25px;margin:4px 0}.map-first #hub-overview .mission-card p{font-size:12px;margin:6px 0}
.map-first #world-hub>section[hidden],.map-first #hub-overview>[hidden],.map-first #hub-overview>#show-conflicts[hidden]{display:none}
.map-first #hub-overview>#show-conflicts{position:static;transform:none;display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;height:auto;min-height:44px;margin-top:10px;padding:10px 12px;border:1px solid #f2a06555;border-radius:5px;background:#0a202980;font:14px var(--body);text-align:left}
.map-first #game-menu{width:380px}.map-first #game-menu .brand{margin:20px 0}.map-first #game-menu .brand small{display:block}.map-first #game-menu .top-status{display:flex;margin-bottom:18px}.map-first #game-menu>button{width:100%;height:44px;margin-top:10px;border-radius:5px;font-size:15px}.map-first #game-menu #save-status{display:block;margin-top:18px;font-size:11px}
.map-first #map-options .layer-controls{display:grid;grid-template-columns:1fr 1fr;gap:8px;width:100%;max-width:none;margin-top:18px}.map-first #map-options button[data-layer]{min-height:44px;font-size:14px}
.map-first #origin-banner{position:absolute;z-index:8;top:52px;left:65px;right:12px;margin:0;background:#12343c}
.map-first #live-event{bottom:calc(111px + env(safe-area-inset-bottom));right:12px;left:auto;width:min(320px,calc(100vw - 24px));max-height:calc(100dvh - 180px);border-radius:6px}.map-first #live-event.compact{padding:8px 12px;width:260px}.map-first #live-event.compact h3{font-size:18px;margin:5px 0}.map-first .action-feedback{bottom:calc(114px + env(safe-area-inset-bottom))}
.map-first .country-shape{stroke:#98b3a559;stroke-width:.65}.map-first .country-shape.chosen{stroke:#fff0bf;stroke-width:1.5;filter:drop-shadow(0 0 3px #e2edb76b)}
.map-first .network-line{stroke:#ffb48f;opacity:.55;stroke-width:.85}.map-first .potential-route{opacity:.15}.map-first .node-label{fill:#e7f0d8;paint-order:stroke;stroke:#11303a;stroke-width:2px;stroke-linejoin:round;font-size:11px}
@media(max-width:740px){.map-first .command-bar{grid-template-columns:118px auto minmax(0,1fr) 112px 80px}.map-first #global-pulse{gap:16px}.map-first #global-pulse b{font-size:19px}.map-first #show-upgrades{font-size:14px;padding:4px 8px}.map-first #compact-credits{font-size:20px}.map-first #open-world{font-size:14px}.map-first #compact-response{gap:4px}.map-first #compact-response small{font-size:11px}.map-first .world-updates{right:205px}.map-first #news-headline{font-size:12px!important}.map-first .cycle{gap:4px}.map-first #world-hub .dialog-top h2,.map-first #country-sheet .dialog-top h2{font-size:25px;margin:0}}
@media(prefers-reduced-motion:reduce){.map-first .network-line{animation:none}}

.map-first #map-options #signal-tray{position:static;display:flex;flex-wrap:wrap;margin-top:14px;max-width:none}.map-first #map-options #signal-tray[hidden]{display:none}
.map-first dialog #live-event.compact{position:static;width:100%;max-height:none;margin-top:12px;padding:8px 12px;box-shadow:none}
.map-first dialog #live-event.compact h3,.map-first dialog #live-event.compact #event-countdown{display:none}
/* A Pesquisa virou painel lateral: o chip do evento fixo em right:180px (research-ui.css, do diálogo largo) saía pela esquerda e cortava o texto. */
.map-first #research-dialog #live-event.compact{inset:auto;width:100%}.map-first #research-dialog:has(#live-event:not([hidden])) #research-map{width:auto}
.map-first #country-sheet .country-profile,.map-first #country-sheet .country-vitals,.map-first #country-sheet .country-note{font-size:12px}
.map-first #country-sheet .country-profile span{font-size:11px}
.map-first #country-sheet .local-metrics>span{font-size:12px}
.map-first #country-sheet .sector-overview{font-size:11px}
.map-first #country-sheet .country-heading h2{font-size:28px}
.map-first .map-tools #zoom-reset{display:grid}

.map-first .live-route{fill:none;stroke:#ff9a6e;stroke-width:.7;opacity:.18;transition:opacity .4s}
.map-first .network-packet{opacity:.85}
@media(prefers-reduced-motion:reduce){.map-first .network-packet{display:none}}
@media(orientation:landscape) and (max-height:550px){
 .map-first #world-hub{padding:14px 18px}
 .map-first #world-hub .hub-tabs{margin:7px 0}
 .map-first dialog #live-event.compact{margin-top:8px;padding:5px 10px}
 .map-first #hub-overview .hud{gap:6px}
 .map-first #hub-overview .metric{min-height:60px;padding:6px 10px!important}
 .map-first #hub-overview .mission-card{padding:8px 0 0}
 .map-first #hub-overview .mission-card>.eyebrow{display:none}
 .map-first #hub-overview .mission-card h2{font-size:20px}
 .map-first #hub-overview .mission-card p{font-size:11px;margin:4px 0}
}
.map-first .command-bar>button{align-self:stretch;min-height:44px}
.map-first #open-world{display:flex;align-items:center;justify-content:center;gap:6px}
#destruction-panel{padding:4px 0 2px}
.map-first .world-consequences h3{margin:14px 0 6px;font:12px var(--body);color:#b5cbcb;text-transform:uppercase;letter-spacing:.5px}.map-first #impact-news{margin:0;padding-left:18px;font:12px/1.4 var(--body);color:#d0ddd8}.map-first #impact-news small{color:#9bb5b8}.map-first #impact-news p{margin:2px 0 6px}
#destruction-advice{font:13px/1.5 var(--body);color:#b5cbcb}
.destruction-progress{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;padding:14px 0;border-block:1px solid #a6807133}
.destruction-progress small{display:block;font:11px var(--body);color:#b7aaa0}.destruction-progress strong{display:block;font:24px var(--display);color:#f0ac8a;margin-top:4px}
#open-collapse-tree{min-height:44px}
@media(max-height:550px){#destruction-advice{font-size:11px;margin:8px 0}.destruction-progress{padding:8px 0}.destruction-progress strong{font-size:21px}#open-collapse-tree{font-size:12px}}
#human-research{font:12px/1.4 var(--body);color:#e3b69b;border-left:2px solid #bc8b67;padding-left:9px;margin:9px 0}
@media(max-height:550px){#human-research{font-size:11px;margin:7px 0}}
@media(orientation:landscape) and (max-height:400px){#destruction-advice{margin:5px 0}.destruction-progress{padding:5px 0}#open-collapse-tree{margin-top:4px}}
.map-first #economy-pulse{display:flex;align-items:center;gap:6px;padding:0 10px;border-left:1px solid #91b3b32b;border-right:1px solid #91b3b32b}.map-first #economy-pulse>#open-economy{display:flex;align-items:baseline;gap:4px;color:#a5bfbf;font:11px var(--body);white-space:nowrap}.map-first #compact-cp{font:20px/1 var(--display);font-style:normal;color:#d0e8bf}.map-first #compact-net{font:11px var(--mono);font-style:normal;color:#9fc4a8}.map-first #economy-pulse[data-deficit=true] #compact-net{color:#ef8a7a}.map-first #compact-spread{display:flex;flex-direction:column;align-items:center;justify-content:center;min-width:64px;min-height:38px;padding:2px 8px;border:1px solid #81a8a746;border-radius:5px;background:#163b45;color:#d9e5da;font-size:11px;line-height:1.15}.map-first #compact-spread small{font-size:11px;color:#9fc4a8}.map-first #compact-spread[aria-pressed=false] small{color:#ffe3b0}.map-first #compact-spread[aria-pressed=false]{background:#5a3f1f;border-color:#e0b26c;color:#ffe3b0}.map-first #global-pulse b small{font:11px var(--body);color:#8fa9a9}@media(max-height:400px){.map-first #compact-cp{font-size:18px}.map-first #economy-pulse{padding:0 6px}}
/* Rodapé: rótulo pequeno em cima, número embaixo; nenhum bloco vaza para o vizinho. */.map-first #global-pulse{min-width:0;overflow:hidden;gap:14px;padding:0 6px}.map-first #global-pulse span{flex-direction:column;align-items:flex-start;gap:2px;min-width:0;line-height:1;font-size:11px;white-space:nowrap}.map-first #global-pulse b{font-size:19px}.map-first #economy-pulse>#open-economy{flex-direction:column;align-items:flex-start;gap:2px;line-height:1}.map-first #economy-pulse>#open-economy b{display:flex;align-items:baseline;gap:3px}.map-first #compact-cp small{font:11px var(--body);color:#8fa9a9}.map-first #compact-response{min-width:0;overflow:hidden}
/* Topo: O que fazer agora sempre à vista, ao lado das notícias. */.map-first .world-updates{display:flex;gap:8px;align-items:stretch}.map-first .world-updates #news-ticker{flex:1;min-width:0}
.tip{position:fixed;z-index:140;left:50%;bottom:calc(60px + env(safe-area-inset-bottom));transform:translateX(-50%);display:flex;align-items:center;gap:12px;width:max-content;max-width:min(92vw,560px);padding:8px 8px 8px 16px;border:1px solid #9fd7c455;border-radius:8px;background:#0b1d25f2;box-shadow:0 8px 30px #0006;color:#e3efe9;font:13px/1.35 var(--body)}.tip[hidden]{display:none}.tip button{flex:none;min-height:36px;padding:0 12px;border:1px solid #bdd6ba66;border-radius:5px;background:#bdd6ba;color:#13261d;font:600 12px var(--body)}
#objective-line{margin:10px 0 0;padding:8px 10px;border-left:2px solid #d5ba79;font:12px/1.4 var(--body);color:#e3d3a8}
#objective-line[hidden]{display:none}
/* Painel de Processamento (economy-ui.mjs): abre pelo CP do rodapé. */
.map-first #open-economy{border:0;background:none;padding:0;color:inherit;cursor:pointer;text-align:left}
.map-first #open-economy:focus-visible{outline:2px solid #d0e8bf;outline-offset:3px}
#economy-dialog{width:min(560px,94vw);max-height:92dvh;padding:20px 22px}
#economy-dialog h2{font:30px var(--display);margin:4px 0 0}
#economy-dialog .dialog-top small{font:11px var(--mono);letter-spacing:.08em;color:#9fb6bb}
.economy-net{display:flex;flex-direction:column;gap:4px;margin:14px 0 0;padding:12px 14px;border:1px solid #b9e98640;border-radius:8px;background:#b9e98612;font:12px/1.4 var(--body);color:#b8cccc}
.economy-net strong{font:26px var(--display);color:#d0e8bf}
.economy-net.is-deficit{border-color:#ff8a7a66;background:#ff8a7a12}.economy-net.is-deficit strong{color:#ff9b8c}
#economy-body h3{margin:16px 0 4px;font:12px var(--body);letter-spacing:.06em;text-transform:uppercase;color:#9fb6bb}
#economy-body ul{list-style:none;margin:0;padding:0}
#economy-body li{display:flex;justify-content:space-between;align-items:baseline;gap:12px;padding:7px 0;border-bottom:1px solid #2c444b;font:13px/1.3 var(--body);color:#d0ddd8}
#economy-body li small{display:block;margin-top:2px;font-size:11px;color:#8fa8ad}
#economy-body li b{font:600 13px var(--mono);white-space:nowrap}
.economy-note,.economy-help{margin:8px 0 0;font:12px/1.45 var(--body);color:#a9c0c4}
.economy-help{margin-top:14px;padding:10px 12px;border-left:2px solid #d5ba79;color:#e3d3a8}
@media(max-height:550px){#economy-dialog{padding:12px 16px}#economy-dialog h2{font-size:24px}.economy-net strong{font-size:21px}#economy-body li{padding:4px 0}}
/* Avisos que pausam (warnings.mjs): no topo do mapa, um por vez. */
.warning{position:fixed;z-index:160;top:calc(64px + env(safe-area-inset-top));left:50%;transform:translateX(-50%);width:min(520px,92vw);padding:14px 16px;border:1px solid #ff9b8c88;border-left:4px solid #ff9b8c;border-radius:10px;background:#1b1418f2;box-shadow:0 12px 40px #000a;color:#f2dcd6}
.warning[hidden]{display:none}
.warning[data-level=info]{border-color:#b9e98666;border-left-color:#b9e986;background:#10231cf2;color:#dcefd2}
.warning strong{display:block;font:20px/1.15 var(--display)}
.warning p{margin:6px 0 10px;font:13px/1.45 var(--body);color:inherit;opacity:.9}
.warning-actions{display:flex;gap:8px;flex-wrap:wrap}.warning-actions button{min-height:40px;padding:0 14px;font:600 13px var(--body)}
@media(max-height:550px){.warning{top:52px;padding:10px 12px}.warning strong{font-size:17px}.warning p{margin:4px 0 8px;font-size:12px}.warning-actions button{min-height:36px}}
