/* ROTTAMI 0.8: interfaccia mobile neutra, disegni originali e comandi rapidi. */
body.phone-game { --phone-nav:0px; --phone-header:48px; --menu-footer:70px; --ink:#293b3f; --muted:#53675f; --paper:#f2eee5; color:var(--ink); background:var(--paper); font-family:system-ui,-apple-system,'Segoe UI',sans-serif; }
body.phone-game .frontier-shell { padding-left:var(--phone-safe-left); padding-bottom:calc(var(--menu-footer) + var(--phone-safe-bottom)); background:radial-gradient(ellipse at 30% 20%,#fffaf2 0,transparent 65%),var(--paper); }
body.phone-game .command-header { background:transparent; border:0; box-shadow:none; padding:4px 18px; }
body.phone-game .brand { padding:2px 9px; background:#344c50; border:2px solid #293b3f; border-radius:10px; }
body.phone-game .brand-logo { width:146px; height:30px; }
body.phone-game .command-resources { gap:8px; color:var(--ink); }
body.phone-game .command-header .icon-button { display:flex; align-items:center; justify-content:center; min-width:36px; height:36px; border:1px solid #c7c9bd; border-radius:10px; background:#fffcf7; color:var(--ink); box-shadow:0 2px 0 #d0d0c4; }
body.phone-game .command-header .icon-button .menu-art-icon { width:26px; height:26px; }
body.phone-game .permanent-wallet { background:#fffcf7; border:2px solid #b8c2ba; border-radius:10px; padding:3px 8px; gap:6px; }
body.phone-game .permanent-wallet strong,body.phone-game #alloys-value { color:var(--ink); font-size:15px; font-weight:900; }
body.phone-game .permanent-wallet .currency-icon,body.phone-game .permanent-wallet .alloy-icon { display:inline-flex; width:26px; height:26px; background:none; clip-path:none; border:0; transform:none; margin:0; }
.menu-art-icon { width:1.5em; height:1.5em; display:inline-block; flex-shrink:0; vertical-align:middle; }
body.phone-game .command-nav { inset:auto var(--phone-safe-right) var(--phone-safe-bottom) var(--phone-safe-left); width:auto; height:var(--menu-footer); grid-template-columns:repeat(6,minmax(0,1fr)); grid-template-rows:1fr; padding:3px 14px 5px; gap:8px; background:var(--paper); border:0; border-top:1px solid #d5d5c8; box-shadow:none; }
body.phone-game[data-hub-view="map"] .command-nav { right:calc(205px + var(--phone-safe-right)); }
body.phone-game .command-nav .nav-tab { border:0; border-radius:12px; color:#546966; background:transparent; gap:0; padding:0 2px; box-shadow:none; }
body.phone-game .command-nav .nav-tab.active { color:#293b3f; background:#fff6d4; box-shadow:inset 0 -3px #e8b251; }
body.phone-game .command-nav .nav-tab span:not(.nav-icon) { font-size:9px; font-weight:900; }
body.phone-game .command-nav .nav-icon { width:40px; height:40px; }
body.phone-game .command-nav .nav-icon .menu-art-icon { width:100%; height:100%; }
body.phone-game .hub-screen { padding:5px 16px 8px; color:var(--ink); }
body.phone-game .hub-view { color:var(--ink); position:relative; }
body.phone-game .hub-heading h1,body.phone-game .hub-heading strong { color:var(--ink); }
body.phone-game :is(.hub-screen,dialog:not(.rotate-notice)) :is(h2,h3,strong,b) { color:inherit; }
body.phone-game .hub-screen :is(p,small,.eyebrow,.section-heading,.progression-footnote,.reward-line,.reroll-note) { color:#53675f; }
body.phone-game :is(.hub-screen,dialog:not(.rotate-notice)) :is(.secondary-button,.phone-pager button,.archive-filters button,.phone-segments button,.screen-segments button,.chassis-option,.weapon-option,.livery-option,.upgrade-card,.upgrade-buy,.blueprint-tile,.lab-part,.contract-card,.achievement-card,.tier-card,.research-branch,.research-node,.part-info-button) { color:var(--ink); border:1px solid #b9c4ba; background:#fffcf7; box-shadow:0 2px 0 #d7d9cd; border-radius:10px; }
body.phone-game :is(.hub-screen,dialog:not(.rotate-notice)) :is(button[aria-pressed="true"],button.selected,button.active) { background:#ffedba; border-color:#dca94c; color:var(--ink); }
body.phone-game :is(.hub-screen,dialog:not(.rotate-notice)) .primary-button { color:#293b3f; background:#ffd35f; border:2px solid #34494a; border-radius:10px; box-shadow:0 3px 0 #c6983e; font-weight:900; }
body.phone-game .hub-screen :is(.part-rank,.shape-badge,.ability-badge) { background:#e4f0de; border-color:#a2b39e; color:#3c6352; }
body.phone-game .hub-screen :is(.chassis-option.locked,.weapon-option.locked,.blueprint-tile.unknown) { opacity:.65; }
body.phone-game #map-view .map-board { border:0; border-radius:0; background:transparent; box-shadow:none; grid-template-rows:34px minmax(0,1fr); }
body.phone-game #map-view .district-selector { height:34px; min-height:34px; padding:0 90px; background:transparent; gap:7px; }
body.phone-game #map-view .district-tab { min-height:32px; height:32px; padding:3px 8px; background:#e5e6d9; color:#506862; border:1px solid #c0c7b8; border-radius:8px; }
body.phone-game #map-view .district-tab.active { background:#fff5d6; border-color:#c09a51; box-shadow:0 2px 0 #d4b47c; }
body.phone-game #map-view .district-tab strong { font-size:9px; }
body.phone-game #map-view .district-tab > span { display:none; }
body.phone-game #map-view .map-scroll { margin:0 auto; width:80%; background:none; padding-bottom:30px; }
body.phone-game #map-view .map-legend { display:none; }
body.phone-game #map-view .mission-node { width:46px; height:46px; border:3px solid #3d5751; border-radius:14px; background:#fff8dc; color:#293b3f; box-shadow:0 4px 0 #8c9e7b; }
body.phone-game #map-view .mission-node.available { background:#ffcc5f; border-color:#3a4e49; }
body.phone-game #map-view .mission-node.complete { background:#b4d1a2; border-color:#47664b; }
body.phone-game #map-view .mission-node.locked { background:#d5d7cb; border-color:#9aaba0; opacity:.83; }
body.phone-game #map-view .mission-node.selected { outline:3px solid #f5b84f; outline-offset:4px; }
body.phone-game #map-view .mission-node .node-ring { display:none; }
body.phone-game #map-view .mission-node strong { font-size:18px; color:#293b3f; }
body.phone-game #map-view .mission-node small { color:#293b3f; background:#f7f2e6e6; border-radius:5px; font-size:10px; font-weight:800; width:120px; padding:2px; text-shadow:none; }
body.phone-game #map-view .mission-node:first-child small { top:auto; bottom:calc(100% + 8px); margin-left:-12px; }
#home-play-dock { position:fixed; z-index:36; right:calc(16px + env(safe-area-inset-right,0px)); bottom:calc(8px + env(safe-area-inset-bottom,0px)); width:184px; height:51px; }
#home-play-button { display:flex; align-items:center; justify-content:center; gap:10px; width:100%; height:100%; color:#293b3f; background:#ffd35f; border:3px solid #293b3f; border-radius:13px; box-shadow:0 4px 0 #c59b40; padding:2px 10px; }
#home-play-button .menu-art-icon { width:39px; height:39px; }
#home-play-button span { display:flex; flex-direction:column; gap:0; text-align:left; overflow:hidden; }
#home-play-button small { font-size:8px; line-height:12px; color:#52605c; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
#home-play-button b { font-size:24px; line-height:26px; font-weight:1000; }
#home-play-button[data-resume="true"] b { font-size:19px; line-height:20px; }
#home-play-button[data-resume="true"] small { font-size:7px; line-height:10px; }
#home-play-button[data-resume="true"] #home-resume-stage { font-size:8px; line-height:10px; }
#home-shortcuts { position:absolute; z-index:5; left:0; top:43px; bottom:31px; display:flex; flex-direction:column; justify-content:center; gap:8px; width:76px; }
#home-shortcuts button { background:#fffcf5b5; border:0; padding:3px; border-radius:12px; display:flex; flex-direction:column; align-items:center; gap:0; color:#293b3f; min-height:54px; font-weight:900; }
#home-shortcuts .menu-art-icon { width:35px; height:35px; }
#home-shortcuts span { font-size:9px; }
#home-shortcuts small { font-size:8px; }
#home-district-title { position:absolute; z-index:4; bottom:0; left:20%; right:15%; height:36px; display:flex; gap:12px; align-items:center; justify-content:center; }
#home-district-title span { min-width:210px; display:flex; flex-direction:column; text-align:center; }
#home-district-title small { font-size:8px; letter-spacing:1px; }
#home-district-title b { font-size:15px; line-height:18px; }
#home-district-title button { height:36px; width:44px; border:0; border-radius:10px; background:#fff9eb; padding:4px; }
#home-district-title .menu-art-icon { width:27px; height:27px; }
body.phone-game #map-view[data-mission-open="true"] .mission-brief { background:#fffcf4; color:var(--ink); border-color:#8da198; box-shadow:0 0 0 100vmax #243b4388,0 10px 30px #243b4333; }
body.phone-game #map-view .mission-brief :is(p,small,.eyebrow,.brief-topline,.mission-facts span,.mission-loadout > span,.goal-row) { color:#5d706b; }
body.phone-game #map-view #mission-difficulty button,body.phone-game #map-view #configure-button { background:#e9eee4; color:var(--ink); border-color:#b6c4b5; }
body.phone-game #map-view #mission-difficulty [aria-pressed="true"] { background:#ffdc7b; color:var(--ink); }
body.phone-game #close-mission-button { color:var(--ink); background:#f1eee4; }
body.phone-game #hangar-view .rover-workbench { background:#e3e8dc; border-color:#b3c1b3; }
body.phone-game #hangar-view :is(.workbench-topline,.hangar-rotate) { color:#47625c; background:#f8f7ed; border-color:#bdcbbd; }
body.phone-game #hangar-view .hangar-rotate button { background:#fffaf0; color:#293b3f; }
/* Tre potenziamenti interi: ogni riga conserva il comando da 44px. */
body.phone-game #hub-screen #hangar-view > .hub-heading { flex:0 0 28px; min-height:28px; }
body.phone-game #hub-screen #hangar-view .hangar-segments { flex-basis:36px; margin-bottom:4px; }
body.phone-game #hub-screen #hangar-view .hangar-segments button { min-height:36px; padding:4px; font-size:10px; }
body.phone-game #hub-screen #hangar-view #upgrade-list { height:100%; min-height:0; grid-template-rows:repeat(3,minmax(0,1fr)); gap:4px; }
body.phone-game #hub-screen #hangar-view .upgrade-card { min-height:0; grid-template-columns:18px minmax(0,1fr) minmax(94px,30%); gap:5px; padding:0 6px; }
body.phone-game #hub-screen #hangar-view .upgrade-content { min-width:0; }
body.phone-game #hub-screen #hangar-view .upgrade-content .eyebrow { display:block; font-size:8px; line-height:9px; }
body.phone-game #hub-screen #hangar-view .upgrade-content h3 { margin:0; font-size:11px; line-height:13px; }
body.phone-game #hub-screen #hangar-view .upgrade-content p { margin:0; min-height:0; font-size:9px; line-height:11px; }
body.phone-game #hub-screen #hangar-view .upgrade-buy { display:inline-flex; align-items:center; justify-content:center; flex-direction:row; flex-wrap:nowrap; gap:4px; min-height:44px; height:44px; min-width:0; width:100%; padding:3px; font-size:9px; line-height:11px; text-align:center; }
body.phone-game #hub-screen #hangar-view .upgrade-buy .action-icon { display:inline-flex; flex:0 0 16px; width:16px; height:16px; }
body.phone-game #hub-screen #hangar-view .upgrade-buy .action-icon .ui-icon { width:16px; height:16px; }
/* Due righe per pagina: anche l'ultima arma resta raggiungibile senza tagli. */
body.phone-game #hub-screen #hangar-view [data-phone-panel="hangar:weapons"] { display:flex; flex-direction:column; gap:5px; min-height:0; }
body.phone-game #hub-screen #hangar-view [data-phone-panel="hangar:weapons"][hidden],
body.phone-game #hub-screen #hangar-view #weapon-list > [hidden],
body.phone-game #hub-screen #hangar-view #hangar-weapon-pager[hidden] { display:none!important; }
body.phone-game #hub-screen #hangar-view #weapon-list { display:grid; flex:1 1 0; min-height:0; grid-template-columns:repeat(2,minmax(0,1fr)); grid-template-rows:repeat(2,minmax(44px,1fr)); gap:5px; }
body.phone-game #hub-screen #hangar-view #weapon-list .weapon-option { display:flex; min-width:0; min-height:44px; padding:3px 7px; align-items:center; gap:6px; font-size:11px; line-height:14px; }
body.phone-game #hub-screen #hangar-view #weapon-list .weapon-art { width:32px; height:32px; flex:0 0 32px; }
body.phone-game #hub-screen #hangar-view .hangar-weapon-pager { display:flex; flex:0 0 44px; min-height:44px; align-items:center; justify-content:center; gap:14px; }
body.phone-game #hub-screen #hangar-view .hangar-weapon-pager button { display:grid; place-items:center; width:60px; min-width:44px; height:44px; min-height:44px; padding:4px; border:1px solid #b6c5b5; border-radius:10px; background:#fffcf5; color:#293b3f; box-shadow:0 2px 0 #d9dccf; }
body.phone-game #hub-screen #hangar-view .hangar-weapon-pager button:disabled { opacity:.4; }
body.phone-game #hub-screen #hangar-view .hangar-weapon-pager .menu-art-icon { width:25px; height:25px; }
body.phone-game #hub-screen #hangar-view .hangar-weapon-pager [role="status"] { min-width:42px; text-align:center; font:800 11px/15px system-ui,sans-serif; }
/* Evita il lampo delle vecchie percentuali prima del fit iniziale del menu. */
body.phone-game #map-nodes[data-map-layout="pending"] .mission-node { visibility:hidden; }
body.phone-game #research-tree { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); flex:1; min-height:0; gap:12px; }
body.phone-game #research-tree .research-branch { padding:8px; background:#fffdf7; border-color:#bcc8b8; }
body.phone-game #research-tree [hidden] { display:none!important; }
body.phone-game #lab-view [data-panel-content="lab:research"] { display:flex; flex-direction:column; }
body.phone-game .research-branch-heading { color:#435c53; }
body.phone-game .research-branch-heading .menu-art-icon { width:28px; height:28px; }
body.phone-game .research-node { color:#395148; background:#eaf0e3; }
body.phone-game .research-node.available { border-color:#cfaa58; background:#ffedb3; }
body.phone-game .research-node.complete { background:#b5d6b0; }
body.phone-game #research-pager { flex:0 0 36px; height:36px; margin-top:5px; display:flex; align-items:center; justify-content:center; gap:15px; }
body.phone-game #research-pager button { height:32px; min-width:44px; border:1px solid #b4c0b4; border-radius:9px; background:#fffaf0; color:#395148; font-weight:800; }
body.phone-game #research-page-label { font-size:11px; font-weight:800; }
body.phone-game dialog:not(.rotate-notice) { color:var(--ink); background:#fffaf1; border:2px solid #95aaa1; border-radius:16px; }
body.phone-game dialog:not(.rotate-notice) :is(p,small,.eyebrow,label) { color:#53675f; }
body.phone-game dialog:not(.rotate-notice) :is(.dialog-close,input,textarea,.control-choices button,.settings-utils button) { color:var(--ink); background:#edf0e6; border-color:#b5c3b8; }
body.phone-game dialog:not(.rotate-notice) :is(.research-effect,.research-cost,.research-requirement,.part-detail-stat,.save-preview) { color:var(--ink); background:#edf0e6; }
body.phone-game #arena-view { color:var(--ink); }
body.phone-game #arena-view :is(.arena-intro-copy p,.arena-mode-label,.arena-message,.arena-build-feedback,.arena-room-status,.arena-room-form p) { color:#53675f; }
body.phone-game #arena-view :is(.arena-menu-page,.arena-intro-art,.arena-build-left,.arena-room-form,.arena-room-state,.arena-preset,.arena-part,.arena-slot,.arena-build-grid,.arena-build-tools,.arena-selected-detail,.arena-build-bottom,.arena-build-cell) { color:var(--ink); background:#fffaf0; border-color:#aabeb1; }
body.phone-game #arena-view .arena-build-cell { background:#dee8d9; }
body.phone-game #arena-view .arena-intro-copy h2 { color:var(--ink); }
body.phone-game #arena-view input { background:#fffdf7; color:var(--ink); border-color:#aebeb1; }
body.phone-game .arena-self-hud .arena-lives { color:#ffd37d; letter-spacing:2px; font-size:13px; }
body.phone-game .arena-self-hud .arena-lives.last-life { color:#ff8a72; }
body.phone-game .encounter-dialog[open] { display:grid; grid-template-columns:210px minmax(0,1fr); gap:20px; padding:22px; width:min(700px,calc(100% - 30px)); max-height:calc(100dvh - 24px); overflow:hidden; }
.encounter-art { display:flex; flex-direction:column; align-items:center; justify-content:center; border-radius:14px; background:#e5ead9; color:#5b7162; font-size:11px; font-weight:900; }
.encounter-art canvas { display:block; width:210px; height:180px; }
.encounter-copy { display:flex; flex-direction:column; min-height:0; gap:10px; }
.encounter-copy h2 { margin:0; font-size:25px; }
.encounter-copy small { font-size:9px; letter-spacing:1px; }
.encounter-copy p { font-size:13px; line-height:1.4; margin:0; }
.encounter-copy .primary-button { min-height:44px; margin-top:auto; }
.encounter-weakness { padding:10px; border-radius:10px; background:#e6efdf; }
.encounter-weakness b { font-size:9px; }
.encounter-weakness p { margin-top:5px; }
/* Archivio: tre avversari visibili, con miniatura propria e attacco già leggibile. */
body.phone-game #enemy-archive-dialog[open] { display:grid; grid-template-rows:44px minmax(0,1fr) 44px; width:min(780px,calc(100% - var(--phone-safe-left,0px) - var(--phone-safe-right,0px) - 16px)); height:min(350px,calc(100dvh - var(--phone-safe-top,0px) - var(--phone-safe-bottom,0px) - 16px)); max-height:calc(100dvh - var(--phone-safe-top,0px) - var(--phone-safe-bottom,0px) - 16px); min-height:0; margin:auto; padding:10px; gap:8px; overflow:hidden; border:2px solid #91aa99; border-radius:14px; background:#fffcf5; color:#293b3f; font-family:system-ui,-apple-system,'Segoe UI',sans-serif; }
#enemy-archive-dialog header { display:flex; align-items:center; min-width:0; gap:10px; }
#enemy-archive-dialog header h2 { min-width:0; margin:0; color:#293b3f; font:900 19px/23px system-ui,sans-serif; letter-spacing:0; }
#enemy-archive-dialog header span { margin-left:auto; white-space:nowrap; color:#53675f; font:800 11px/15px system-ui,sans-serif; }
#enemy-archive-dialog button { min-width:0; min-height:44px; margin:0; border:2px solid #b1c3ae; border-radius:10px; color:#293b3f; background:#f6f8ed; font-family:system-ui,sans-serif; letter-spacing:0; touch-action:manipulation; }
#enemy-archive-dialog #enemy-archive-close { flex:0 0 44px; width:44px; height:44px; min-height:44px; padding:4px; font-size:26px; line-height:30px; }
#enemy-archive-dialog #enemy-archive-list { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); grid-template-rows:minmax(0,1fr); min-height:0; min-width:0; gap:8px; overflow:hidden; }
#enemy-archive-dialog .enemy-archive-card { display:grid; grid-template-columns:64px minmax(0,1fr); grid-template-rows:auto auto minmax(0,1fr) 13px; align-items:start; gap:4px 7px; min-width:0; min-height:0; height:100%; padding:7px; overflow:hidden; text-align:left; background:#fffef8; box-shadow:0 2px #d3ddcc; }
#enemy-archive-dialog .enemy-archive-card>span { grid-column:2; grid-row:1; min-width:0; color:#53675f; font:800 8px/10px system-ui,sans-serif; }
#enemy-archive-dialog .enemy-archive-art { grid-column:1; grid-row:1 / 3; align-self:center; display:flex; align-items:center; justify-content:center; width:64px; height:64px; min-width:0; min-height:0; padding:3px; border:1px solid #c0cdb8; border-radius:9px; background:radial-gradient(ellipse at center,#e6f0dc 0,#d7e5d4 75%); overflow:hidden; }
#enemy-archive-dialog .enemy-archive-art canvas.enemy-preview { display:block; width:auto!important; height:100%!important; max-width:100%!important; max-height:100%!important; margin:0; border:0; border-radius:0; background:transparent; aspect-ratio:1; object-fit:contain; image-rendering:auto; transform:scale(1.6); }
#enemy-archive-dialog .enemy-archive-card .enemy-archive-name { grid-column:2; grid-row:2; min-width:0; align-self:center; margin:0; color:#293b3f; font:900 12px/15px system-ui,sans-serif; overflow-wrap:break-word; }
#enemy-archive-dialog .enemy-archive-card p { grid-column:1 / -1; grid-row:3; min-width:0; min-height:0; margin:2px 0 0; color:#496657; font:500 11px/14px system-ui,sans-serif; text-align:left; }
#enemy-archive-dialog .enemy-archive-card>b { grid-column:1 / -1; grid-row:4; align-self:end; min-width:0; margin:0; color:#3c6d58; font:900 9px/13px system-ui,sans-serif; }
#enemy-archive-dialog .enemy-archive-card:active { background:#fff0bf; border-color:#c39943; box-shadow:0 1px #bdcbb5; }
#enemy-archive-dialog button:focus-visible { outline:3px solid #39a3ce; outline-offset:2px; }
#enemy-archive-dialog #enemy-archive-list>p { grid-column:1 / -1; align-self:center; margin:0; padding:14px; border:1px dashed #b1c3ae; border-radius:10px; color:#53675f; font:600 12px/18px system-ui,sans-serif; text-align:center; }
#enemy-archive-dialog footer { display:flex; justify-content:center; align-items:center; min-height:44px; gap:18px; color:#53675f; font:800 12px/16px system-ui,sans-serif; }
#enemy-archive-dialog footer button { flex:0 0 44px; width:44px; height:44px; padding:5px; font:900 22px/28px system-ui,sans-serif; }
body.phone-game .audio-volume { display:flex; align-items:center; gap:6px; font-size:10px; padding:3px 8px; }
.audio-volume input { width:100px; accent-color:#509b8f; }
body.phone-game .tech-tree-root { display:none!important; }
body.phone-game .tech-node-list { border-color:#bcc9b8; }
body.phone-game .tech-node { color:#314f45; }
body.phone-game .tech-node-orb { background:#e0e9d9; color:#405a4c; border-color:#a2b79d; }
body.phone-game .tech-node.available .tech-node-orb { background:#ffda76; border-color:#bb9147; }
body.phone-game .tech-node.done .tech-node-orb { background:#aad59f; border-color:#76a376; }
body.phone-game .tech-node-label { color:#425f51; }
/* Il tutorial riusa le illustrazioni senza ereditarne le dimensioni dei riquadri. */
body.phone-game #tutorial-dialog { background:#f2eee5; color:#293b3f; border:0; border-radius:0; padding:max(8px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left)); height:100dvh; box-shadow:none; }
body.phone-game #tutorial-dialog :is(h2,h3,strong,b) { color:#293b3f; }
body.phone-game #tutorial-dialog .tutorial-next { height:38px; min-height:38px; min-width:180px; max-width:42%; flex:0 0 auto; padding:5px 12px; font-size:11px; }
body.phone-game #tutorial-dialog .tutorial-next .menu-art-icon { width:21px; height:21px; flex:0 0 21px; }
body.phone-game #tutorial-dialog .tutorial-dash .menu-art-icon { width:30px; height:30px; flex:0 0 30px; }
body.phone-game #tutorial-dialog .tutorial-summary .menu-art-icon { width:42px; height:42px; }
body.phone-game #game-screen,body.phone-game .arena-field { --ink:#f4f1df; --muted:#c3d5cc; color:#f4f1df; }
body.phone-game #hub-screen { --ink:#293b3f; --muted:#53675f; background:transparent; color:#293b3f; }
body.phone-game #hub-screen *,body.phone-game .command-header * { --ink:#293b3f; --muted:#53675f; }
body.phone-game #hub-screen :is(h1,h2,h3,strong,b,label,.tech-node-label,.arena-mode-label) { color:#293b3f; }
body.phone-game #hub-screen :is(p,small) { color:#53675f; }
body.phone-game .command-header :is(#credits-value,#alloys-value) { color:#293b3f; }
body.phone-game .command-header #settings-button { background:#fffcf7; color:#293b3f; border:1px solid #c7c9bd; }
body.phone-game #hub-screen .district-tab.locked { opacity:.65; }
body.phone-game #tutorial-dialog #tutorial-armor { color:#293b3f; background:#f7f3e7; }
body.phone-game #tutorial-dialog #tutorial-armor[aria-pressed="true"] { background:#bfe4d5; }
body.phone-game #hub-screen #research-tree .research-branch { background:#fffdf6; border:1px solid #bcc8b8; padding:6px; box-shadow:0 2px 0 #d7d9cd; }
body.phone-game #hub-screen .tech-node { background:#edf1e6; color:#314c41; border:1px solid #bdcbbb; box-shadow:none; }
body.phone-game #hub-screen .tech-node.locked { background:#e6eadd; border-color:#c3cbbd; color:#65765f; }
body.phone-game #hub-screen .tech-node.available { background:#ffefbf; border-color:#d4ad5c; }
body.phone-game #hub-screen .tech-node.done { background:#cce6bb; border-color:#8dbf86; }
body.phone-game #hub-screen .tech-node-orb { color:#3d5b4b; background:#d7e5cb; border-color:#a2ba97; }
body.phone-game #hub-screen .tech-node.available .tech-node-orb { background:#ffca64; border-color:#c59642; }
body.phone-game #hub-screen .tech-node.locked .tech-node-orb { background:#d4dccb; color:#6b7a65; border-color:#b4c0ad; }
body.phone-game #hub-screen .tech-node-orb i { background:#f8f6e9; color:#547451; }
body.phone-game #hub-screen .tech-node-label { color:inherit; }
body.phone-game .command-nav .nav-tab:hover:not(.active) { background:#e3e9da; color:#293b3f; }
body.phone-game #research-pager button:disabled, #home-district-title button:disabled { background:#e2e6d9; color:#7c8a77; opacity:.6; box-shadow:none; }
body.phone-game #hub-screen :is(.chassis-option,.weapon-option,.livery-option,.upgrade-card,.upgrade-buy,.blueprint-tile,.lab-part,.contract-card,.achievement-card,.tier-card,.phone-segments button,.screen-segments button,.arena-preset,.arena-part-option,.arena-build-slots button,.arena-build-tools button,.arena-build-bottom button) { color:#293b3f; background:#fffcf5; border:1px solid #b6c5b5; border-radius:10px; box-shadow:0 2px 0 #d9dccf; }
body.phone-game #hub-screen :is(.chassis-option,.weapon-option,.livery-option,.phone-segments button,.screen-segments button,.arena-part-option,.arena-build-slots button)[aria-pressed="true"] { background:#ffedb8; border-color:#d2a959; }
body.phone-game #hub-screen :is(.blueprint-glyph,.lab-part-art,.chassis-glyph,.upgrade-symbol,.achievement-symbol) { color:#659d8d; background:transparent; }
body.phone-game #hub-screen :is(.contract-progress,.season-progress) { background:#d9e3d1; }
body.phone-game #hub-screen :is(.contract-progress,.season-progress)>i { background:#6ab9a4; }
body.phone-game #hub-screen :is(.arena-intro-art,.arena-build-left,.arena-room-form,.arena-room-state) { background:#e5ebdd; color:#293b3f; border-color:#b7c7b3; }
body.phone-game #hub-screen .arena-build-cell { background:#e1e8d9; border-color:#a8bda5; color:#547252; }
body.phone-game.frontier :is(#research-detail-dialog,#settings-dialog,#part-detail-dialog,#saves-dialog,#help-dialog,#install-dialog,#encounter-dialog,#enemy-archive-dialog,#workshop-dialog) { --ink:#293b3f; --muted:#53675f; --panel:#fffcf5; --bg:#f2eee5; color-scheme:light; }
body.phone-game.frontier :is(#research-detail-dialog,#settings-dialog,#part-detail-dialog,#saves-dialog,#help-dialog,#install-dialog,#encounter-dialog,#enemy-archive-dialog,#workshop-dialog) :is(h1,h2,h3,h4,span,p,small,strong,b,label,button) { color:#293b3f; }
body.phone-game #research-detail-dialog .research-detail-icon { color:#293b3f; background:#ffdc85; border-color:#c4a264; }
body.phone-game #research-detail-dialog .progression-action { color:#293b3f; background:#ffdc85; border:1px solid #b8a06b; border-radius:9px; }
body.phone-game #hub-screen h4 { color:#293b3f; }
body.phone-game #hub-screen span { color:#53675f; }
body.phone-game #hub-screen :is(.archive-filters,.screen-segments,.phone-segments) { background:transparent; }
body.phone-game #hub-screen .phone-pager :is(button,span) { color:#53675f; }
body.phone-game #hub-screen .phone-pager button:disabled { background:#e1e6d8; color:#7b8b77; border-color:#c1cbbb; box-shadow:none; opacity:.65; }
body.phone-game #service-view .hub-heading .hangar-counter { display:none; }
body.phone-game #service-view .claim-all-bar { position:absolute; top:0; right:0; width:195px; height:28px; min-height:28px; padding:0; margin:0; }
body.phone-game #service-view #claim-all-summary { display:none; }
body.phone-game #service-view .claim-all-bar #claim-all-button { width:100%; min-height:28px; height:28px; font-size:10px; }
body.phone-game #service-view .claim-all-bar #claim-all-button:disabled { color:#667762; background:#e3e8db; border-color:#c0cdb9; box-shadow:none; }
body.phone-game #service-view .list-title { min-height:12px; height:12px; margin:0 0 5px; }
body.phone-game #service-view .list-title :is(h3,span) { font-size:8px; line-height:12px; margin:0; }
body.phone-game #service-view .reroll-note { display:none; }
body.phone-game #service-view .contract-card { display:flex; flex-direction:column; gap:3px; padding:9px; }
body.phone-game #service-view .contract-card :is(h3,h4) { margin:0; font-size:12px; line-height:15px; }
body.phone-game #service-view .contract-card p { margin:0; font-size:10px; line-height:13px; }
body.phone-game #service-view .contract-card .contract-progress { min-height:5px; height:5px; margin:4px 0 0; }
body.phone-game #service-view .contract-card .contract-actions { margin-top:auto; gap:4px; }
body.phone-game #service-view .contract-card .reward-line { font-size:9px; line-height:12px; }
body.phone-game #service-view .contract-card small { font-size:9px; line-height:12px; }
body.phone-game #hub-screen button:disabled,body.phone-game dialog:not(.rotate-notice) button:disabled { background:#e1e7d9!important; color:#768571!important; border-color:#c1cdb8!important; box-shadow:none!important; }
body.phone-game #hub-screen .contract-actions button:not(:disabled) { background:#dceee0; color:#365a46; border-color:#9bbb9e; }
/* Il briefing è una schermata dedicata: la navigazione non gli si sovrappone. */
body.phone-game:has(#map-view[data-mission-open="true"]) :is(.command-header,.command-nav,#home-play-dock,#home-shortcuts,#home-district-title) { visibility:hidden; pointer-events:none; }
body.phone-game #map-view[data-mission-open="true"] .map-board { visibility:hidden; pointer-events:none; }
body.phone-game.in-field #home-play-dock,body.phone-game.in-field #home-shortcuts,body.phone-game.in-field #home-district-title { display:none!important; }
@media(max-height:370px){body.phone-game{--phone-header:40px;--menu-footer:59px;}body.phone-game .command-nav{gap:4px;padding:1px 12px 3px;}body.phone-game .command-nav .nav-icon{width:35px;height:35px;}body.phone-game .command-nav .nav-tab span:not(.nav-icon){font-size:8px;}#home-play-dock{height:47px;bottom:7px;}#home-shortcuts{gap:2px;}#home-shortcuts .menu-art-icon{width:30px;height:30px;}body.phone-game .hub-screen{padding:3px 12px 5px;}body.phone-game #map-view .district-selector{padding:0 80px;}body.phone-game #map-view .district-tab strong{font-size:8px;}body.phone-game #map-view .map-scroll{padding-bottom:26px;}#home-district-title{height:30px;}#home-district-title b{font-size:13px;}body.phone-game .hub-screen .blueprint-glyph{flex-basis:46px;height:46px;margin:2px auto;}body.phone-game .hub-screen .blueprint-tile p{font-size:9px;}body.phone-game .hub-screen .blueprint-tile h3{font-size:12px;}}
@media(prefers-reduced-motion:no-preference){.command-nav .nav-tab{transition:background .16s,transform .16s;}#home-play-button:active,.command-nav .nav-tab:active{transform:translateY(2px);}#home-shortcuts button:active{transform:scale(.96);}}

/* 0.8.2: il bersaglio tattile resta46px; la piastra32px libera il diorama. */
body.phone-game #map-view .mission-node { width:46px; height:46px; border:0; border-radius:9px; background:transparent; box-shadow:none; opacity:1; }
body.phone-game #map-view .mission-node::before { content:""; position:absolute; inset:6px; border:2px solid #071420; border-radius:7px; background:linear-gradient(135deg,#b6cbd5 0%,#64838f 16%,#365564 78%); box-shadow:inset 0 2px 0 #e9f7ff9c,0 3px 0 #182d3c; }
body.phone-game #map-view .mission-node.available::before { background:linear-gradient(135deg,#fff0aa,#ffba51 35%,#d18b31); }
body.phone-game #map-view .mission-node.complete::before { background:linear-gradient(135deg,#c7fff0,#70d8b7 35%,#368a78); }
body.phone-game #map-view .mission-node.locked::before { background:linear-gradient(135deg,#bfced5,#728c9c 35%,#405d70); }
body.phone-game #map-view .mission-node.boss-node::before { inset:3px; border-radius:9px; background:linear-gradient(135deg,#f4d8a4,#c99757 40%,#745137); }
body.phone-game #map-view .mission-node.selected:not(:focus-visible) { outline:0; }
body.phone-game #map-view .mission-node.selected::before { outline:2px solid #e8ad4d; outline-offset:3px; }
body.phone-game #map-view .mission-node.selected::after { content:none; }
body.phone-game #map-view .mission-node strong { position:relative; display:grid; place-items:center; width:28px; height:28px; color:#071420; font:900 13px system-ui,sans-serif; }
body.phone-game #map-view .mission-node.locked strong { color:#e2f4ff; }
body.phone-game #map-view .mission-node.boss-node strong { color:#fff1cd; }
body.phone-game #map-view .mission-node strong .ui-icon { width:21px; height:21px; stroke-width:2; }
body.phone-game #map-view .mission-node small { top:calc(100% - 1px); background:#f7f2e6ed; line-height:1.15; font-family:system-ui,-apple-system,sans-serif; letter-spacing:0; }
body.phone-game #map-view .mission-node:first-child small { top:auto; bottom:calc(100% + 2px); }
body.phone-game #map-view .mission-node .node-lock { position:absolute; z-index:2; right:0; bottom:1px; width:15px; height:15px; padding:2px; display:grid; place-items:center; border:1px solid #071420; border-radius:4px; background:#193a50; color:#e2f4ff; box-shadow:0 1px 0 #071420; }
body.phone-game #map-view .mission-node .node-lock .ui-icon { width:10px; height:10px; stroke-width:2.4; }

/* 0.8.3: quote riservate ai comandi, senza comprimere testo e statistiche. */
body.phone-game .command-header .icon-button,
body.phone-game .command-header #settings-button { width:40px; min-width:40px; height:40px; min-height:40px; padding:5px; }
body.phone-game .command-header #sound-button { width:auto; min-width:48px; gap:4px; }
body.phone-game .command-header .icon-button .menu-art-icon { width:29px; height:29px; }
body.phone-game .command-nav .nav-icon { width:44px; height:44px; }
body.phone-game .command-nav .nav-tab span:not(.nav-icon) { font-size:10px; line-height:13px; }
body.phone-game #hub-screen :is(.archive-filters,.phone-segments,.screen-segments) button { display:inline-flex; align-items:center; justify-content:center; gap:5px; min-height:40px; padding:5px 9px; font-size:11px; line-height:1.15; }
body.phone-game #hub-screen .phone-pager { flex:0 0 40px; height:40px; min-height:40px; padding:0; margin-top:6px; gap:16px; }
body.phone-game #hub-screen .phone-pager button { display:inline-flex; justify-content:center; align-items:center; gap:7px; min-height:40px; height:40px; padding:5px 12px; font:800 11px/1.1 system-ui,sans-serif; }
body.phone-game #hub-screen .phone-pager .page-count { font:800 11px/1.2 system-ui,sans-serif; }
body.phone-game #map-view .map-board { grid-template-rows:40px minmax(0,1fr); }
body.phone-game #map-view .district-selector { height:40px; min-height:40px; }
body.phone-game #map-view .district-tab { min-height:38px; height:38px; }
#home-district-title { height:40px; }
#home-district-title button { width:48px; height:40px; }
#home-play-dock { height:55px; }
#home-shortcuts button { min-height:58px; }
#home-shortcuts span { font-size:10px; line-height:12px; }
#home-shortcuts small { font-size:9px; line-height:11px; }

/* Titolo e filtri condividono la testata: il corpo conserva spazio reale per i valori. */
body.phone-game #hub-screen #blueprints-view { display:grid; grid-template-columns:100px minmax(0,1fr); grid-template-rows:44px minmax(0,1fr) 40px; gap:8px; }
body.phone-game #hub-screen #blueprints-view > .hub-heading { grid-column:1; grid-row:1; height:44px; min-height:0; margin:0; padding:0; align-items:center; }
body.phone-game #hub-screen #blueprints-view #archive-filters { grid-column:2; grid-row:1; display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); align-items:center; height:44px; min-height:44px; padding:0; margin:0; border:0; gap:5px; }
body.phone-game #hub-screen #blueprints-view #archive-filters button { width:100%; height:40px; min-height:40px; min-width:0; padding:4px; font-size:10px; gap:4px; }
body.phone-game #hub-screen #blueprints-view #archive-filters .ui-icon { width:16px; height:16px; flex:0 0 16px; }
body.phone-game #hub-screen #blueprints-view > .phone-page-body { grid-column:1/-1; grid-row:2; min-height:0; margin:0; }
body.phone-game #hub-screen #blueprints-view #blueprint-grid { height:100%; grid-template-rows:minmax(0,1fr); }
body.phone-game #hub-screen #blueprints-view > .phone-pager { grid-column:1/-1; grid-row:3; margin:0; }
body.phone-game #hub-screen #blueprints-view .blueprint-tile { display:grid; grid-template-columns:52px minmax(0,1fr); grid-template-rows:12px minmax(22px,1fr) 26px 34px; gap:3px 7px; padding:7px; cursor:pointer; border-radius:10px; }
body.phone-game #hub-screen #blueprints-view .blueprint-tile-top { grid-column:1/-1; grid-row:1; min-height:12px; height:12px; align-items:center; font:700 9px/12px system-ui,sans-serif; }
body.phone-game #hub-screen #blueprints-view .blueprint-glyph { grid-column:1; grid-row:2/4; width:52px; height:52px; max-height:100%; min-height:0; padding:0; margin:0; border:0; border-radius:0; background:transparent; box-shadow:none; align-self:center; overflow:hidden; }
body.phone-game #hub-screen #blueprints-view .blueprint-glyph .part-preview { display:block; width:100%!important; height:100%!important; min-height:0; max-width:100%; max-height:100%; object-fit:contain; transform:scale(1.25); transform-origin:center; padding:0; margin:0; border:0; border-radius:0; background:transparent; box-shadow:none; }
body.phone-game #hub-screen #blueprints-view .blueprint-tile h3 { grid-column:2; grid-row:2; margin:0; align-self:center; font-size:13px; line-height:15px; max-height:30px; overflow:hidden; }
body.phone-game #hub-screen #blueprints-view .blueprint-tile h3 small { display:inline-block; width:auto; max-width:100%; padding:1px 3px; margin-left:2px; vertical-align:middle; white-space:nowrap; font:800 9px/12px system-ui,sans-serif; color:#3c6352; }
body.phone-game #hub-screen #blueprints-view .blueprint-tile p { grid-column:2; grid-row:3; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; min-height:0; height:26px; margin:0; font-size:10px; line-height:13px; overflow:hidden; }
body.phone-game #hub-screen #blueprints-view .blueprint-tile-stats { grid-column:1/-1; grid-row:4; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); height:34px; min-height:34px; gap:5px; padding:4px 0 2px; margin:0; font:700 9px/11px system-ui,sans-serif; }
body.phone-game #hub-screen #blueprints-view .blueprint-tile-stats span { display:flex; flex-direction:column; justify-content:space-between; min-width:0; }
body.phone-game #hub-screen #blueprints-view .blueprint-tile-stats b { font:900 12px/14px system-ui,sans-serif; }
body.phone-game #hub-screen #blueprints-view .blueprint-tile:focus-visible { outline:3px solid #ba8a28; outline-offset:-3px; }
body.phone-game #hub-screen #blueprints-view .blueprint-tile:active { background:#fff0c3; }
body.phone-game #hub-screen #blueprints-view .blueprint-tile.unknown { opacity:1; background:#e9ede3; }
body.phone-game #workshop-dialog :is(.workshop-strip,.assembly-grid,.offer-button,.route-option,.selected-art) { color:#293b3f; background:#edf0e5; border-color:#b4c2b4; box-shadow:none; }
body.phone-game #workshop-dialog :is(h2,h2 em,.selected-info,.offer-name,.offer-value,.workshop-sector,.workshop-sector span,.workshop-wallet strong,.panel-label,.route-option>span) { color:#293b3f; }
body.phone-game #workshop-dialog :is(.workshop-wallet>span,.route-option small),body.phone-game #workshop-dialog .selected-info::after { color:#53675f; }
body.phone-game #workshop-dialog .repair-button { color:#293b3f; background:#ffdc85; border:1px solid #b8a06b; border-radius:8px; }
body.phone-game #workshop-dialog .assembly-cell { color:#53675f; background:#dde6d7; border-color:#9eaf99; }
body.phone-game #workshop-dialog .assembly-cell.filled { background:#d6e2d2; border-color:#789c82; }
body.phone-game #workshop-dialog .assembly-cell.can-place { background:#c5e4bd; border-color:#6eaa72; }
body.phone-game #workshop-dialog :is(.offer-button.selected,.route-option[aria-pressed="true"]) { color:#293b3f; background:#ffedb8; border-color:#cfa34c; }
body.phone-game #workshop-dialog .workshop-feedback { color:#53675f; }
body.phone-game #workshop-dialog .workshop-feedback.error { color:#a84335; }
@media(max-height:370px){
  body.phone-game { --phone-header:44px; --menu-footer:64px; }
  body.phone-game .command-header { padding-block:2px; }
  body.phone-game .command-nav { padding-block:2px; }
  body.phone-game .command-nav .nav-icon { width:39px; height:39px; }
  body.phone-game .command-nav .nav-tab span:not(.nav-icon) { font-size:9px; line-height:12px; }
  #home-shortcuts { gap:3px; top:46px; }
  #home-shortcuts button { min-height:55px; }
  #home-shortcuts .menu-art-icon { width:31px; height:31px; }
  #home-play-dock { height:51px; }
  #home-district-title { height:38px; }
}
