/* ROTTAMI 0.6 — schermo di gioco orizzontale. Caricare dopo visual.css.
   Ogni pannello ha un'altezza finita: i cataloghi cambiano pagina con i pulsanti. */
html:has(body.phone-game) { height: 100%; overflow: hidden; overscroll-behavior: none; }

/* Analogico fisso: il centro resta visibile e non segue il dito. */
.in-field #move-zone { display:none!important; }
.in-field #joystick { left:calc(78px + var(--phone-safe-left,0px)); right:auto; top:auto; bottom:calc(74px + var(--phone-safe-bottom,0px)); transform:translate(-50%,50%); border:2px solid #e4f2deaa; background:#243e4280; opacity:.7; box-shadow:inset 0 0 0 7px #d4e9dc12; }
.in-field #joystick[data-active="true"] { opacity:1; }
.in-field[data-controls="left"] #joystick { left:auto; right:calc(78px + var(--phone-safe-right,0px)); transform:translate(50%,50%); }
.in-field #joystick i { border:2px solid #fff6d9; background:#ffc95ee8; box-shadow:0 2px 4px #122c3680; }
body.phone-game.in-field #toast { top:calc(103px + var(--phone-safe-top)); left:calc(10px + var(--phone-safe-left)); right:auto; bottom:auto; transform:translateY(3px); width:max-content; max-width:min(230px,31vw); max-height:56px; overflow:hidden; padding:6px 9px; border:1px solid #91aaa1; border-radius:8px; background:#fff9eef5; color:#293b3f; font:700 12px/17px system-ui,sans-serif; letter-spacing:0; text-align:left; box-shadow:0 2px 0 #172f3d30; }
body.phone-game.in-field #toast { transition:transform .12s ease; }
body.phone-game.in-field #toast.visible { transform:translateY(0); opacity:1; }
body.phone-game.in-field #toast { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; max-height:48px; }
body.phone-game.in-field #toast.component-loss { border-left:4px solid #c75639; }

/* 0.8.3 — comandi sul campo più grandi; restano fuori dalla zona di guida. */
body.phone-game.in-field #dash-button { width:74px; height:74px; }
body.phone-game.in-field #ability-actions { bottom:calc(108px + var(--phone-safe-bottom)); gap:9px; }
body.phone-game.in-field #ability-actions .system-ability { width:60px; height:64px; }
body.phone-game.in-field #pause-button { width:40px; height:40px; min-height:40px; }
body.phone-game.in-field #move-zone { width:116px; }
body.phone-game.in-field #move-zone i { width:88px; height:88px; }
body.phone-game.in-field #joystick { width:92px; height:92px; }
body.phone-game.in-field #joystick i { width:30px; height:30px; left:30px; top:30px; }
.inspect-parts-button { position:absolute; left:calc(73px + env(safe-area-inset-left,0px)); top:calc(43px + env(safe-area-inset-top,0px)); z-index:8; width:40px; height:40px; min-height:40px; display:grid; place-items:center; padding:7px; border:1px solid #91aaa1; border-radius:9px; color:#f4f1df; background:#263e42ed; }
.inspect-parts-button .ui-icon { width:24px; height:24px; }
body.phone-game #component-dialog { --ink:#293b3f; color-scheme:light; width:min(660px,calc(100% - var(--phone-safe-left) - var(--phone-safe-right) - 20px)); max-height:calc(100dvh - var(--phone-safe-top) - var(--phone-safe-bottom) - 16px); margin:auto; padding:14px 18px; border:2px solid #95aaa1; border-radius:14px; color:#293b3f; background:#fffaf1; overflow:hidden; }
body.phone-game #component-dialog .dialog-close { position:absolute; right:7px; top:7px; width:40px; height:40px; min-height:40px; padding:8px; border-radius:9px; background:#e7ecdf; color:#293b3f; border:1px solid #b5c3b8; }
.component-layout { display:grid; grid-template-columns:minmax(0,1fr); gap:18px; min-width:0; }
.has-rover .component-layout { grid-template-columns:210px minmax(0,1fr); align-items:center; }
.component-copy { display:grid; grid-template-columns:78px minmax(0,1fr); grid-template-rows:auto auto auto auto auto 44px; align-content:center; gap:6px 12px; min-width:0; }
.component-art { grid-column:1; grid-row:1/4; width:78px; height:78px; align-self:center; display:grid; place-items:center; overflow:hidden; }
#component-art .part-preview { width:100%!important; height:100%!important; max-width:100%; max-height:100%; object-fit:contain; transform:scale(1.25); transform-origin:center; background:transparent; padding:0; border:0; box-shadow:none; }
.component-heading { grid-column:2; grid-row:1; padding-right:30px; }
body.phone-game #component-dialog .component-heading h2 { margin:3px 0; font-size:21px; line-height:24px; color:#293b3f; }
body.phone-game #component-dialog #component-rank { display:block; font:800 9px/12px system-ui,sans-serif; color:#53675f; }
body.phone-game #component-dialog #component-description { grid-column:2; grid-row:2; margin:0; font:500 12px/16px system-ui,sans-serif; color:#293b3f; }
body.phone-game #component-dialog #component-ability { grid-column:2; grid-row:3; margin:0; font:600 11px/15px system-ui,sans-serif; color:#3f6255; }
.component-stats { grid-column:1/-1; grid-row:4; display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:7px; padding:7px; border:1px solid #bdc9b6; border-radius:8px; background:#edf0e5; }
.component-stats span { display:flex; flex-direction:column; gap:2px; color:#53675f; font:800 8px/11px system-ui,sans-serif; }
.component-stats b { color:#293b3f; font:900 12px/14px system-ui,sans-serif; }
body.phone-game #component-dialog .component-bonus { grid-column:1/-1; grid-row:5; margin:0; color:#53675f; font:500 10px/14px system-ui,sans-serif; }
body.phone-game #component-dialog #component-done { grid-column:1/-1; grid-row:6; height:44px; min-height:44px; padding:5px; font:900 12px/16px system-ui,sans-serif; background:#ffd35f; color:#293b3f; border:2px solid #34494a; border-radius:9px; }
#component-rover h3 { margin:0 0 5px; font:900 12px/15px system-ui,sans-serif; }
#component-rover>small { display:block; margin-top:5px; font:600 10px/13px system-ui,sans-serif; color:#53675f; }
.component-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); grid-template-rows:repeat(5,minmax(0,1fr)); width:210px; height:210px; gap:3px; padding:3px; border:1px solid #a7bba2; border-radius:8px; background:#d6e0d0; }
.component-cell { display:grid; place-items:center; min-width:0; min-height:0; padding:0; overflow:hidden; border:1px solid #aabda5; border-radius:4px; background:#f0f3e8; color:#53675f; }
.component-cell canvas { width:100%; height:100%; max-width:100%; max-height:100%; padding:0; margin:0; border:0; background:transparent; pointer-events:none; }
.component-cell:focus-visible { outline:2px solid #ba8a28; outline-offset:-2px; }
body.phone-game {
  --phone-nav: 66px;
  --phone-header: 36px;
  --phone-gap: 8px;
  --phone-content-pad: 8px;
  --phone-safe-left: env(safe-area-inset-left, 0px);
  --phone-safe-right: env(safe-area-inset-right, 0px);
  --phone-safe-top: env(safe-area-inset-top, 0px);
  --phone-safe-bottom: env(safe-area-inset-bottom, 0px);
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  width: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: #304447;
}
body.phone-game .frontier-shell {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: none;
  height: 100%;
  min-height: 0;
  padding: var(--phone-safe-top) var(--phone-safe-right) var(--phone-safe-bottom) calc(var(--phone-nav) + var(--phone-safe-left));
  overflow: hidden;
}
body.phone-game .command-header {
  flex: 0 0 var(--phone-header);
  height: var(--phone-header);
  min-height: var(--phone-header);
  width: 100%;
  padding: 3px 10px;
  margin: 0;
  gap: 8px;
  flex-wrap: nowrap;
  border-bottom-width: 1px;
  z-index: 32;
}
body.phone-game .command-header .brand { gap: 7px; font-size: 17px; margin: 0; }
body.phone-game .command-header .brand-mark { width: 23px; height: 25px; font-size: 23px; border-radius: 5px; }
body.phone-game .brand small,
body.phone-game .pilot-rank,
body.phone-game .nav-index,
body.phone-game .frontier-footer,
body.phone-game .hub-foot,
body.phone-game .pwa-bar { display: none !important; }
body.phone-game .command-resources { margin: 0 0 0 auto; gap: 6px; }
body.phone-game .permanent-wallet { min-width: 0; margin: 0 4px 0 0; gap: 4px; }
body.phone-game .permanent-wallet strong,
body.phone-game #alloys-value { font-size: 12px; }
body.phone-game .command-header .icon-button { height: 29px; min-width: 30px; padding: 3px 6px; border-width: 1px; }
body.phone-game .command-header #sound-button { padding: 3px 6px; }
body.phone-game .command-header .ui-icon { width: 18px; height: 18px; }
body.phone-game .command-nav {
  position: fixed;
  inset: var(--phone-safe-top) auto var(--phone-safe-bottom) var(--phone-safe-left);
  z-index: 35;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: repeat(5, minmax(0, 1fr));
  align-content: stretch;
  width: var(--phone-nav);
  height: auto;
  min-height: 0;
  margin: 0;
  padding: 4px;
  gap: 3px;
  border: 0;
  border-right: 1px solid #829a90;
  border-radius: 0;
  background: #304447;
  box-shadow: 3px 0 12px #19313730;
}
body.phone-game .command-nav .nav-tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  min-height: 0;
  padding: 5px 1px;
  gap: 6px;
  border-radius: 8px;
}
body.phone-game .command-nav .nav-tab::after { display: none; }
body.phone-game .command-nav .nav-icon { display: block; order: -1; width: 23px; height: 23px; flex-shrink: 0; }
body.phone-game .command-nav .nav-tab span:not(.nav-icon) { font-size: 8px; line-height: 1.15; letter-spacing: 0; font-weight: 800; }
body.phone-game .command-nav .nav-badge { top: 3px; right: 1px; min-width: 15px; height: 16px; font-size: 9px; line-height: 12px; }

/* Lo schermo non scorre. Le liste paginate hanno un solo corpo ed un comando pagina. */
body.phone-game .hub-screen {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  width: 100%;
  height: auto;
  min-height: 0;
  margin: 0;
  padding: var(--phone-content-pad) 10px;
  overflow: hidden;
  overscroll-behavior: none;
}
body.phone-game .hub-view { flex: 1 1 0; display: flex; flex-direction: column; height: 100%; min-height: 0; overflow: hidden; }
body.phone-game .hub-view > .hub-heading { flex: 0 0 26px; min-height: 26px; height: 26px; margin: 0 0 6px; gap: 8px; align-items: center; }
body.phone-game .hub-view > .hub-heading h1 { font-size: 19px; line-height: 1; margin: 0; letter-spacing: -.4px; }
body.phone-game .hub-heading :is(.eyebrow, h1 br, h1 em, .archive-copy),
body.phone-game .hub-heading .hangar-counter > span,
body.phone-game .hub-heading .campaign-progress > span { display: none; }
body.phone-game .hub-heading .hangar-counter strong { font-size: 14px; margin: 0; }
body.phone-game .screen-segments { flex: 0 0 32px; position: static; min-height: 32px; margin: 0 0 6px; padding: 0; gap: 6px; border: 0; }
body.phone-game .hub-screen .screen-segments button { min-height: 32px; height: 32px; padding: 4px 8px; font-size: 11px; }
body.phone-game .phone-page-body { display: flex; flex-direction: column; flex: 1 1 0; min-height: 0; overflow: hidden; }
body.phone-game .phone-pager { display: flex; justify-content: center; align-items: center; flex: 0 0 34px; gap: 12px; height: 34px; margin: 6px 0 0; padding: 0; }
body.phone-game .phone-pager button { min-height: 32px; min-width: 44px; padding: 4px 12px; border: 1px solid #91aaa1; border-radius: 8px; background: #42595d; color: #f4f1df; font-size: 11px; font-weight: 800; }
body.phone-game .phone-pager .page-button { min-height: 32px; height: 32px; padding: 4px 12px; font-size: 11px; }
body.phone-game .phone-pager :is(.pager-count, .page-count) { min-width: 76px; color: #d1dbcd; font-size: 11px; font-weight: 800; text-align: center; }
body.phone-game .hub-screen .archive-filters { flex: 0 0 32px; min-height: 32px; margin: 0 0 6px; padding: 0; gap: 6px; }
body.phone-game .hub-screen .archive-filters button { min-height: 32px; padding: 3px 10px; font-size: 10px; }
body.phone-game .hub-screen .section-heading { flex: 0 0 auto; min-height: 20px; margin: 0 0 6px; align-items: center; }
body.phone-game .hub-screen .section-heading h2 { margin: 0; font-size: 16px; }
body.phone-game .hub-screen .section-heading .eyebrow,
body.phone-game .hub-screen .section-heading > span,
body.phone-game .hub-screen .progression-footnote,
body.phone-game .hub-screen .progression-note { display: none; }

/* La campagna è la mappa: il dettaglio compare solo dopo aver scelto un nodo. */
body.phone-game #map-view > :is(.hub-heading, .district-cards) { display: none; }
body.phone-game #map-view .campaign-layout { display: block; flex: 1 1 0; height: 100%; min-height: 0; margin: 0; }
body.phone-game #map-view .map-board { position: relative; display: grid; grid-template-rows: 38px minmax(0, 1fr); height: 100%; min-height: 0; overflow: hidden; border: 1px solid #829a90; border-radius: 10px; background: #3c5153; }
body.phone-game #map-view .map-toolbar { display: none; }
body.phone-game #map-view .district-selector { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); min-height: 38px; height: 38px; margin: 0; padding: 0 3px; gap: 3px; border: 0; background: #304447; }
body.phone-game #map-view .district-tab { display: flex; justify-content: center; align-items: center; min-height: 36px; padding: 3px 5px; gap: 5px; border-radius: 5px; border: 0; border-bottom: 2px solid transparent; }
body.phone-game #map-view .district-tab strong { min-width: 0; font-size: 9px; line-height: 1.2; white-space: normal; text-align: center; }
body.phone-game #map-view .district-tab > span { font-size: 10px; }
body.phone-game #map-view .district-tab small { font-size: 9px; white-space: nowrap; }
body.phone-game #map-view .map-scroll { display: flex; align-items: center; justify-content: center; min-height: 0; height: 100%; overflow: hidden; padding: 0; background: radial-gradient(ellipse at 50% 50%, #637c6b55, transparent 75%); }
body.phone-game #map-view .map-scene { position: relative; flex: 0 1 auto; min-width: 0; width: min(100%, calc((100dvh - var(--phone-header) - var(--phone-content-pad) - var(--phone-content-pad) - 40px - var(--phone-safe-top) - var(--phone-safe-bottom)) * 1.8868)); height: auto; aspect-ratio: 1000 / 530; max-height: 100%; margin: 0 auto; overflow: visible; }
body.phone-game #map-view .district-terrain { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; }
body.phone-game #map-view .map-nodes { position: absolute; inset: 0; width: 100%; height: 100%; }
body.phone-game #map-view .mission-node { width: 44px; height: 44px; min-height: 44px; border-radius: 12px; transform: translate(-50%, -50%); }
body.phone-game #map-view .mission-node.boss-node { width: 48px; height: 48px; }
body.phone-game #map-view .mission-node strong { font-size: 18px; }
body.phone-game #map-view .mission-node small { position: absolute; width: 112px; left: 50%; top: calc(100% + 4px); transform: translateX(-50%); text-align: center; font-size: 10px; line-height: 1.2; }
body.phone-game #map-view .map-legend { position: absolute; bottom: 3px; left: 8px; right: 8px; display: flex; justify-content: center; gap: 16px; padding: 3px 6px; border: 0; font-size: 7px; pointer-events: none; background: #304447b8; border-radius: 5px; }
body.phone-game #map-view .map-version { display: none; }
body.phone-game #map-view .mission-brief { display: none; }
body.phone-game #map-view[data-mission-open="true"] .mission-brief { position: fixed; z-index: 90; inset: max(8px, var(--phone-safe-top)) max(8px, var(--phone-safe-right)) max(8px, var(--phone-safe-bottom)) auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-content: start; gap: 7px 14px; width: min(540px, calc(100% - var(--phone-nav) - 24px)); max-height: calc(100dvh - 16px); padding: 14px 18px; margin: 0; overflow: hidden; border: 2px solid #91aaa1; border-radius: 14px; background: #42595d; box-shadow: 0 0 0 100vmax #172b3199, 0 10px 40px #13272b66; }
body.phone-game #map-view .mission-brief .brief-topline { grid-column: 1 / -1; min-height: 20px; margin: 0 28px 0 0; padding: 0; border: 0; font-size: 9px; }
body.phone-game #map-view .mission-brief .mission-number { display: none; }
body.phone-game #map-view .mission-brief > .eyebrow { grid-column: 1 / -1; font-size: 9px; margin: 0; }
body.phone-game #map-view .mission-brief h2 { grid-column: 1 / -1; font-size: 23px; line-height: 1.05; max-width: none; margin: 0; }
body.phone-game #map-view .mission-brief > #mission-description { grid-column: 1 / -1; font-size: 11px; line-height: 1.35; max-width: none; margin: 0; }
body.phone-game #map-view .mission-facts { display: flex; grid-column: 1 / -1; justify-content: space-between; padding: 0 0 6px; margin: 0; gap: 12px; }
body.phone-game #map-view .mission-facts span { font-size: 8px; }
body.phone-game #map-view .mission-facts strong { font-size: 10px; }
body.phone-game #map-view .mission-objectives { grid-column: 1; display: grid; margin: 0; padding: 0; gap: 3px; border: 0; }
body.phone-game #map-view .mission-objectives .goal-row { grid-template-columns: 16px 16px minmax(0, 1fr); gap: 5px; font-size: 8px; }
body.phone-game #map-view .mission-objectives .goal-row b { font-size: 9px; }
body.phone-game #map-view .mission-loadout { grid-column: 2; display: grid; align-content: start; gap: 3px; padding: 0; margin: 0; }
body.phone-game #map-view .mission-loadout > span { font-size: 8px; }
body.phone-game #map-view .mission-loadout strong { font-size: 10px; }
body.phone-game #map-view #configure-button { min-height: 28px; padding: 4px 8px; margin-top: 3px; font-size: 9px; }
body.phone-game #close-mission-button { position: absolute; top: 6px; right: 6px; display: grid; place-items: center; width: 34px; height: 34px; min-height: 34px; padding: 5px; border: 1px solid #91aaa1; border-radius: 8px; color: #f4f1df; background: #304447; }
body.phone-game #mission-difficulty { display: flex; grid-column: 1 / -1; gap: 6px; margin: 0; }
body.phone-game #mission-difficulty button { flex: 1; min-width: 0; min-height: 32px; padding: 5px 7px; border: 1px solid #91aaa1; border-radius: 7px; font-size: 10px; font-weight: 800; background: #304447; color: #f4f1df; }
body.phone-game #mission-difficulty [aria-pressed="true"] { background: #dfab67; color: #182c2e; border-color: #f1c98a; }
body.phone-game #map-view .mission-brief #start-button { grid-column: 1 / -1; grid-row: auto; min-height: 38px; margin: 0; padding: 6px 12px; font-size: 11px; }
body.phone-game #map-view .mission-brief #mission-lock { grid-column: 1 / -1; max-width: none; font-size: 9px; line-height: 1.25; margin: 0; }

/* Hangar: il mezzo vive nel riquadro sinistro, le scelte cambiano pannello a destra. */
body.phone-game #hangar-view .hangar-layout { flex: 1 1 0; display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 10px; min-height: 0; height: auto; margin: 0; }
body.phone-game #hangar-view .rover-workbench { display: flex; flex-direction: column; min-height: 0; height: 100%; border: 1px solid #91aaa1; border-radius: 12px; overflow: hidden; }
body.phone-game #hangar-view :is(.workbench-topline, .workbench-bottomline) { flex: 0 0 25px; min-height: 25px; height: 25px; font-size: 8px; padding: 6px 9px; }
body.phone-game #hangar-view .rover-preview { display: block; flex: 1 1 0; min-height: 0; height: auto; width: 100%; position: relative; overflow: hidden; touch-action: none; }
body.phone-game #hangar-view .rover-preview canvas { display: block; width: 100%; height: 100%; max-width: 100%; max-height: 100%; object-fit: contain; }
body.phone-game #hangar-view .hangar-configuration { display: flex; flex-direction: column; min-height: 0; padding: 0; overflow: hidden; }
body.phone-game #hangar-view .hangar-segments { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; flex: 0 0 34px; margin-bottom: 6px; }
body.phone-game #hangar-view .hangar-segments button { min-width: 0; min-height: 34px; padding: 4px 3px; border: 1px solid #91aaa1; border-radius: 7px; color: #f4f1df; background: #42595d; font-size: 9px; font-weight: 800; }
body.phone-game #hangar-view .hangar-segments [aria-pressed="true"] { background: #dfab67; color: #182c2e; }
body.phone-game #hangar-view [data-phone-panel] { flex: 1 1 0; min-height: 0; overflow: hidden; }
body.phone-game #hangar-view .hangar-rotate { display: flex; flex: 0 0 32px; height: 32px; align-items: center; justify-content: space-between; gap: 6px; padding: 3px 6px; border-top: 1px solid #819a90; }
body.phone-game #hangar-view .hangar-rotate button { min-height: 26px; min-width: 36px; padding: 2px 5px; border: 1px solid #91aaa1; border-radius: 6px; background: #304447; color: #f4f1df; font-size: 8px; }
body.phone-game #hangar-view #hangar-summary { flex: 1; min-width: 0; text-align: center; font-size: 9px; line-height: 1.25; }
body.phone-game #hangar-view .hangar-configuration > .configuration-hint { flex: 0 0 auto; margin: 4px 0 0; font-size: 9px; line-height: 1.3; }
body.phone-game #hangar-view .chassis-list { display: grid; grid-template-columns: 1fr; gap: 6px; margin: 0; }
body.phone-game #hangar-view .chassis-option { min-height: 52px; height: auto; padding: 7px 9px; gap: 8px; }
body.phone-game #hangar-view .chassis-option strong { font-size: 12px; }
body.phone-game #hangar-view .chassis-option small { margin-top: 3px; font-size: 10px; line-height: 1.25; }
body.phone-game #hangar-view .chassis-glyph { width: 27px; font-size: 24px; }
body.phone-game #hangar-view .weapon-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; margin: 0; }
body.phone-game #hangar-view .weapon-option { min-height: 43px; padding: 4px 7px; font-size: 10px; gap: 6px; }
body.phone-game #hangar-view .weapon-art { width: 32px; height: 30px; flex-basis: 32px; }
body.phone-game #hangar-view .livery-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; margin: 0; }
body.phone-game #hangar-view .livery-option { min-height: 36px; padding: 5px 7px; gap: 6px; font-size: 10px; }
body.phone-game #hangar-view .upgrade-list { display: grid; grid-template-columns: 1fr; gap: 5px; margin: 0; }
body.phone-game #hangar-view .upgrade-card { display: grid; grid-template-columns: 22px minmax(0, 1fr) 105px; gap: 6px; padding: 6px 8px; align-items: center; min-height: 55px; }
body.phone-game #hangar-view .upgrade-symbol { font-size: 22px; }
body.phone-game #hangar-view .upgrade-content .eyebrow { font-size: 8px; }
body.phone-game #hangar-view .upgrade-content h3 { margin: 2px 0; font-size: 12px; }
body.phone-game #hangar-view .upgrade-content p { margin: 0; min-height: 0; font-size: 9px; line-height: 1.3; }
body.phone-game #hangar-view .upgrade-pips { display: none; }
body.phone-game #hangar-view .upgrade-buy { grid-column: 3; grid-row: 1; min-height: 34px; padding: 4px; font-size: 9px; }

/* Tre schede per pagina, senza corpi lunghi nascosti fuori dal vetro. */
body.phone-game .hub-screen :is(.blueprint-grid, .part-workbench, .achievement-list, .contract-list) { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); flex: 1 1 0; min-height: 0; margin: 0; gap: 8px; overflow: hidden; }
body.phone-game .hub-screen :is(.blueprint-tile, .lab-part, .achievement-card, .contract-card) { min-width: 0; min-height: 0; height: 100%; padding: 9px; margin: 0; overflow: hidden; }
body.phone-game .hub-screen .blueprint-tile { display: flex; flex-direction: column; }
body.phone-game .hub-screen .blueprint-tile-top { font-size: 7px; }
body.phone-game .hub-screen .blueprint-tile-top > span:first-child { font-size: 9px; }
body.phone-game .hub-screen .blueprint-glyph { flex: 0 1 72px; width: 82px; height: 72px; min-height: 35px; margin: 6px auto; }
body.phone-game .hub-screen .blueprint-tile h3 { font-size: 14px; line-height: 1.2; margin: 2px 0 5px; }
body.phone-game .hub-screen .blueprint-tile p { flex: 1 1 0; min-height: 0; font-size: 10px; line-height: 1.35; margin: 0 0 5px; }
body.phone-game .hub-screen .blueprint-tile-stats { flex: 0 0 auto; font-size: 8px; gap: 7px; padding-top: 5px; }
body.phone-game .hub-screen .blueprint-tile-stats b { font-size: 10px; }
body.phone-game .hub-screen .lab-part { display: grid; grid-template-columns: 44px minmax(0, 1fr); grid-template-rows: 12px 44px 14px 24px 30px; gap: 4px; padding: 8px; }
body.phone-game .hub-screen .lab-part-heading { font-size: 9px; }
body.phone-game .hub-screen .lab-part .lab-part-heading { grid-column: 1 / -1; grid-row: 1; }
body.phone-game .hub-screen .lab-part .lab-part-art { grid-column: 1; grid-row: 2; width: 44px; height: 44px; min-height: 0; margin: 0; padding: 0; }
body.phone-game .hub-screen .lab-part h3 { grid-column: 2; grid-row: 2; align-self: center; font-size: 13px; line-height: 1.2; margin: 0; }
body.phone-game .hub-screen .lab-part p { font-size: 10px; line-height: 1.3; margin: 0; }
body.phone-game .hub-screen .lab-part-stats { grid-column: 1 / -1; grid-row: 3; font-size: 8px; gap: 5px; margin: 0; padding: 0; }
body.phone-game .hub-screen .lab-part .part-info-button { grid-column: 1 / -1; grid-row: 4; min-height: 24px; padding: 2px 5px; font-size: 9px; }
body.phone-game .hub-screen .lab-part :is([data-upgrade-part], .part-max) { grid-column: 1; grid-row: 5; width: auto; min-width: 0; }
body.phone-game .hub-screen .lab-part [data-upgrade-part] { grid-column: 1 / -1; justify-self: start; width: 49%; }
body.phone-game .hub-screen .lab-part [data-evolve-part] { grid-column: 1 / -1; grid-row: 5; justify-self: end; width: 49%; min-width: 0; }
body.phone-game .hub-screen .lab-part :is([data-upgrade-part], [data-evolve-part]) { min-height: 30px; height: 30px; padding: 3px; font-size: 8px; margin: 0; }
body.phone-game .hub-screen .lab-part .part-max { grid-column: 1 / -1; justify-self: start; width: 49%; font-size: 8px; line-height: 1.2; align-self: center; margin: 0; }
body.phone-game .hub-screen .lab-part:has(.part-info-button) :is(.lab-part-description, .evolution-preview, .evolution-requirement) { display: none; }
body.phone-game #lab-view [data-panel-content="lab:parts"] > .section-heading { display: none; }
body.phone-game .hub-screen :is(.lab-part, .achievement-card, .contract-card, .tier-card) .progression-action { min-height: 32px; padding: 5px 7px; font-size: 10px; }
body.phone-game #lab-view [data-panel-content="lab:research"] { flex: 1 1 0; min-height: 0; overflow: hidden; }
body.phone-game #lab-view [data-panel-content="lab:parts"] { display: flex; flex-direction: column; flex: 1 1 0; min-height: 0; overflow: hidden; }
body.phone-game #research-tree { min-height: 0; margin: 0; }
body.phone-game #service-view .claim-all-bar { flex: 0 0 32px; min-height: 32px; height: 32px; margin: 0 0 6px; }
body.phone-game #service-view .claim-all-bar #claim-all-button { min-height: 32px; height: 32px; padding: 4px 12px; font-size: 11px; }
body.phone-game #service-view #claim-all-summary { font-size: 10px; }
body.phone-game #service-view [data-panel-content] { display: flex; flex-direction: column; flex: 1 1 0; min-height: 0; overflow: hidden; }
body.phone-game #service-view .contract-segments { display: flex; gap: 5px; flex: 0 0 30px; margin: 0 0 6px; }
body.phone-game #service-view .contract-segments button { flex: 1; min-height: 30px; border: 1px solid #91aaa1; border-radius: 7px; padding: 4px 6px; font-size: 10px; font-weight: 800; color: #f4f1df; background: #42595d; }
body.phone-game #service-view .contract-segments [aria-pressed="true"] { color: #182c2e; background: #dfab67; }
body.phone-game #service-view [data-phone-panel] { display: flex; flex-direction: column; flex: 1 1 0; min-height: 0; overflow: hidden; }
body.phone-game #service-view .contracts-columns { display: flex; flex-direction: column; flex: 1 1 0; min-height: 0; gap: 0; }
body.phone-game #service-view .list-title { min-height: 14px; height: 14px; margin: 0 0 3px; padding: 0; }
body.phone-game #service-view .list-title h3 { font-size: 10px; margin: 0; }
body.phone-game #service-view .list-title > span { font-size: 8px; }
body.phone-game #service-view #reroll-note { flex: 0 0 12px; height: 12px; line-height: 12px; font-size: 8px; margin: 0 0 3px; max-width: none; }
body.phone-game #service-view .contract-card { display: flex; flex-direction: column; }
body.phone-game #service-view .contract-card h4 { margin: 0 0 5px; font-size: 13px; }
body.phone-game #service-view .contract-card p { margin: 4px 0; font-size: 10px; line-height: 1.35; }
body.phone-game #service-view .contract-actions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: auto; }
body.phone-game #service-view .contract-actions button { flex: 1; min-height: 30px; font-size: 9px; }
body.phone-game #service-view .season-panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2px 10px; flex: 0 0 32px; height: 32px; padding: 0; margin: 0 0 4px; border: 0; background: none; }
body.phone-game #service-view .season-panel > :is(p, small) { display: none; }
body.phone-game #service-view .season-panel > .eyebrow { grid-column: 1; grid-row: 1; font-size: 8px; }
body.phone-game #service-view .season-panel > h2 { grid-column: 1; grid-row: 2; font-size: 14px; line-height: 1.1; margin: 0; }
body.phone-game #service-view .season-panel .season-progress-meta { grid-column: 2; grid-row: 1; display: flex; justify-content: flex-end; gap: 5px; font-size: 9px; margin: 0; }
body.phone-game #service-view .season-panel .season-progress-meta > span { display: none; }
body.phone-game #service-view .season-panel .season-progress-track { grid-column: 2; grid-row: 2; align-self: center; height: 6px; margin: 0; }
body.phone-game #service-view [data-panel-content="service:season"] > .section-heading { display: none; }
body.phone-game #service-view .daily-challenge { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 0; height: 100%; padding: 10px 14px; gap: 5px 16px; }
body.phone-game #service-view .daily-challenge > .eyebrow { grid-column: 1; font-size: 9px; }
body.phone-game #service-view .daily-challenge > .daily-date { grid-column: 2; font-size: 9px; justify-self: end; }
body.phone-game #service-view .daily-challenge h2 { grid-column: 1; font-size: 21px; margin: 0; }
body.phone-game #service-view .daily-challenge > p { grid-column: 1; font-size: 11px; line-height: 1.4; margin: 0; }
body.phone-game #service-view .daily-challenge .daily-record { grid-column: 2; grid-row: 2; margin: 0; }
body.phone-game #service-view .daily-challenge .daily-record strong { font-size: 23px; }
body.phone-game #service-view .daily-challenge > .reward-line { grid-column: 2; grid-row: 3; font-size: 10px; }
body.phone-game #service-view .daily-challenge > .primary-button { grid-column: 1 / -1; min-height: 34px; margin: 0; padding: 5px 10px; font-size: 11px; }
body.phone-game #service-view .daily-challenge > small { grid-column: 1 / -1; font-size: 9px; line-height: 1.3; }
body.phone-game #service-view .season-tiers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); flex: 1 1 0; min-height: 0; margin: 0; gap: 6px; }
body.phone-game #service-view .tier-card { display: flex; flex-direction: column; height: 100%; min-height: 0; gap: 2px; padding: 6px 8px; overflow: hidden; }
body.phone-game #service-view .tier-card :is(p, small),
body.phone-game #service-view .tier-card > span { font-size: 9px; line-height: 1.2; min-height: 0; margin: 0; }
body.phone-game #service-view .tier-card > strong { font-size: 16px; line-height: 1; }
body.phone-game #service-view .tier-card .progression-action { min-height: 25px; padding: 3px 5px; font-size: 9px; margin-top: auto; }
body.phone-game #service-view .achievement-card { display: flex; flex-direction: column; gap: 5px; }
body.phone-game #service-view .achievement-card h3 { font-size: 13px; margin: 0; }
body.phone-game #service-view .achievement-card p { font-size: 10px; line-height: 1.35; margin: 0; }
body.phone-game #service-view .achievement-card .progression-action { margin-top: auto; }

/* La partita usa l'intero rettangolo disponibile: nessun rapporto verticale imposto al Canvas. */
body.phone-game.in-field .frontier-shell { padding: 0; }
body.phone-game.in-field :is(.command-header, .command-nav, .field-topbar, .field-rail, .game-bottomline, .field-footer) { display: none !important; }
body.phone-game.in-field .field-screen { display: flex; flex-direction: column; flex: 1 1 0; width: 100%; height: 100%; min-height: 0; margin: 0; padding: 0; overflow: hidden; }
body.phone-game.in-field :is(.field-layout, .field-game) { display: block; flex: 1 1 0; width: 100%; height: 100%; min-height: 0; padding: 0; margin: 0; }
body.phone-game.in-field .field-screen .arena-frame { position: relative; display: block; width: 100%; height: 100%; min-height: 0; max-height: none; max-width: none; margin: 0; padding: 0; border: 0; border-radius: 0; aspect-ratio: auto; overflow: hidden; }
body.phone-game.in-field #game-canvas { display: block; width: 100%; height: 100%; min-height: 0; max-width: none; max-height: none; margin: 0; border: 0; aspect-ratio: auto; touch-action: none; }
body.phone-game.in-field .field-screen .hud { padding: calc(8px + var(--phone-safe-top)) calc(10px + var(--phone-safe-right)) calc(8px + var(--phone-safe-bottom)) calc(10px + var(--phone-safe-left)); }
body.phone-game.in-field .hull-display { width: 105px; }
body.phone-game.in-field .hull-display > span { font-size: 8px; }
body.phone-game.in-field .integrity-panel { top: calc(37px + var(--phone-safe-top)); left: calc(10px + var(--phone-safe-left)); width: 58px; }
body.phone-game.in-field .integrity-grid { width: 54px; height: 54px; }
body.phone-game.in-field #systems-status { font-size: 6px; max-width: 105px; }
body.phone-game.in-field .objective-hud { top: calc(8px + var(--phone-safe-top)); left: 50%; right: auto; transform: translateX(-50%); width: min(270px, 39%); min-height: 0; padding: 5px 8px; }
body.phone-game.in-field .objective-hud > span { font-size: 8px; }
body.phone-game.in-field .objective-hud strong { font-size: 11px; }
body.phone-game.in-field .objective-hud small { font-size: 9px; }
body.phone-game.in-field .boss-hud { top: calc(66px + var(--phone-safe-top)); left: 50%; right: auto; transform: translateX(-50%); width: min(240px, 37%); }
body.phone-game.in-field #boss-name { font-size: 8px; }
body.phone-game.in-field #pause-button { position: absolute; display: grid; place-items: center; top: calc(8px + var(--phone-safe-top)); right: calc(132px + var(--phone-safe-right)); width: 34px; height: 34px; min-height: 34px; z-index: 9; padding: 6px; border: 1px solid #91aaa1; border-radius: 8px; background: #304447db; }
body.phone-game.in-field .radar-panel { position: absolute; top: calc(8px + var(--phone-safe-top)); right: calc(10px + var(--phone-safe-right)); width: 112px; z-index: 6; padding: 3px; border: 1px solid #91aaa1; border-radius: 9px; background: #20383edb; pointer-events: none; overflow: hidden; }
body.phone-game.in-field .radar-panel #minimap { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; margin: 0; border: 0; border-radius: 5px; }
body.phone-game.in-field .radar-caption { display: block; font: 700 7px/1.15 Arial, sans-serif; letter-spacing: .25px; color: #d1dbcd; text-align: center; margin: 2px 0 0; }
body.phone-game.in-field .hud-bottom { position: absolute; left: 50%; right: auto; bottom: calc(6px + var(--phone-safe-bottom)); transform: translateX(-50%); width: min(300px, 42%); padding: 0; gap: 12px; }
body.phone-game.in-field .hud-bottom strong { font-size: 20px; }
body.phone-game.in-field .hud-bottom .hud-label { font-size: 7px; }
body.phone-game.in-field .sector-clock { padding: 0; }
body.phone-game.in-field .sector-clock > span:first-child { font-size: 17px; }
body.phone-game.in-field .dash-button { width: 66px; height: 66px; right: calc(22px + var(--phone-safe-right)); bottom: calc(20px + var(--phone-safe-bottom)); }
body.phone-game.in-field .ability-actions { right: calc(18px + var(--phone-safe-right)); bottom: calc(100px + var(--phone-safe-bottom)); display: flex; flex-direction: row; gap: 8px; }
body.phone-game.in-field .system-ability { width: 54px; height: 57px; }
body.phone-game.in-field .system-ability :is(b, small) { font-size: 8px; }
body.phone-game.in-field .move-zone { display: block; left: calc(22px + var(--phone-safe-left)); right: auto; bottom: calc(18px + var(--phone-safe-bottom)); width: 104px; }
body.phone-game.in-field .move-zone i { width: 80px; height: 80px; }
body.phone-game.in-field .move-zone span { font-size: 8px; }
body.phone-game.in-field[data-controls="left"] .dash-button { right: auto; left: calc(22px + var(--phone-safe-left)); }
body.phone-game.in-field[data-controls="left"] .ability-actions { right: auto; left: calc(18px + var(--phone-safe-left)); }
body.phone-game.in-field[data-controls="left"] .move-zone { left: auto; right: calc(22px + var(--phone-safe-right)); }
body.phone-game.in-field .toast { top: calc(119px + var(--phone-safe-top)); bottom: auto; max-width: min(390px, 58%); font-size: 10px; padding: 7px 10px; pointer-events: none; }

/* Officina unificata: tutte le decisioni della sosta sono nella stessa schermata. */
body.phone-game .workshop-dialog:not([open]) { display: none; }
body.phone-game .workshop-dialog[open] { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: 36px minmax(0, 1fr) 38px 15px 40px; gap: 5px 10px; width: calc(100% - var(--phone-safe-left) - var(--phone-safe-right) - 12px); max-width: 1080px; height: calc(100dvh - var(--phone-safe-top) - var(--phone-safe-bottom) - 12px); max-height: calc(100dvh - 12px); min-height: 0; margin: auto; padding: 8px 10px; border: 1px solid #91aaa1; border-radius: 12px; overflow: hidden; }
body.phone-game .workshop-dialog .workshop-heading { grid-column: 1; grid-row: 1; margin: 0; align-items: center; min-height: 0; }
body.phone-game .workshop-dialog .workshop-heading .eyebrow { display: none; }
body.phone-game .workshop-dialog .workshop-heading h2 { margin: 0; font-size: 18px; }
body.phone-game .workshop-dialog .workshop-heading h2 em { font-style: normal; }
body.phone-game .workshop-dialog .workshop-sector { font-size: 23px; }
body.phone-game .workshop-dialog .workshop-sector span { font-size: 10px; }
body.phone-game .workshop-dialog .workshop-strip { grid-column: 2; grid-row: 1; display: flex; justify-content: space-between; align-items: center; min-height: 0; margin: 0; padding: 3px 7px; gap: 6px; }
body.phone-game .workshop-dialog .workshop-wallet { display: flex; align-items: center; gap: 6px; }
body.phone-game .workshop-dialog .workshop-wallet > span { font-size: 8px; }
body.phone-game .workshop-dialog .workshop-wallet strong { font-size: 17px; }
body.phone-game .workshop-dialog .repair-button { min-height: 29px; padding: 3px 8px; font-size: 9px; }
body.phone-game .workshop-dialog :is(.workshop-tabs, .workshop-intro, .workshop-warning) { display: none !important; }
body.phone-game .workshop-dialog[data-tab] .workshop-body { display: grid; grid-column: 1 / -1; grid-row: 2; grid-template-columns: minmax(270px, 1.04fr) minmax(0, 1fr); gap: 12px; min-height: 0; height: 100%; padding: 0; margin: 0; overflow: hidden; }
body.phone-game .workshop-dialog[data-tab] .assembly-panel[data-panel="vehicle"] { display: grid; grid-template-columns: 168px minmax(0, 1fr); grid-template-rows: 18px minmax(0, 1fr); gap: 5px 8px; align-items: center; height: 100%; min-height: 0; }
body.phone-game .workshop-dialog .assembly-panel > .panel-label { display: flex; grid-column: 1 / -1; min-height: 18px; margin: 0; font-size: 8px; }
body.phone-game .workshop-dialog .assembly-grid { grid-column: 1; grid-row: 2; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); grid-template-rows: repeat(5, minmax(0, 1fr)); width: 168px; max-width: 168px; height: 168px; gap: 3px; padding: 4px; margin: 0; }
body.phone-game .workshop-dialog .assembly-cell { width: 100%; height: 28px; min-height: 28px; max-height: 28px; padding: 0; font-size: 16px; }
body.phone-game .workshop-dialog .cell-rank { display: block; }
body.phone-game .workshop-dialog .assembly-detail { display: flex; grid-column: 2; grid-row: 2; flex-direction: column; flex-wrap: nowrap; align-items: stretch; justify-content: center; gap: 5px; min-height: 0; width: 100%; margin: 0; }
body.phone-game .workshop-dialog .selected-art { width: 64px; height: 42px; min-height: 42px; margin: 0 auto; border-radius: 7px; }
body.phone-game .workshop-dialog .selected-info { flex: 0 1 auto; min-width: 0; min-height: 0; max-height: none; font-size: 10px; line-height: 1.35; }
body.phone-game .workshop-dialog #remove-button { flex: 0 0 auto; min-height: 28px; padding: 3px 5px; font-size: 9px; }
body.phone-game .workshop-dialog .synergy-info { display: none; }
body.phone-game .workshop-dialog[data-tab] .salvage-panel[data-panel="salvage"] { display: flex; flex-direction: column; height: 100%; min-height: 0; }
body.phone-game .workshop-dialog .salvage-panel > .panel-label { flex: 0 0 18px; min-height: 18px; margin: 0 0 5px; font-size: 8px; }
body.phone-game .workshop-dialog .offers-list { display: grid; grid-template-columns: 1fr; grid-auto-rows: minmax(0, 1fr); gap: 5px; flex: 1 1 0; min-height: 0; overflow: hidden; }
body.phone-game .workshop-dialog .offer-button { display: flex; flex-direction: row; align-items: center; gap: 7px; min-height: 0; padding: 4px 7px; border-radius: 8px; }
body.phone-game .workshop-dialog .offer-symbol { width: 38px; height: 38px; flex: 0 0 38px; min-width: 38px; min-height: 38px; padding: 1px; }
body.phone-game .workshop-dialog .offer-button > span:nth-child(2) { min-width: 0; }
body.phone-game .workshop-dialog .offer-name { font-size: 11px; line-height: 1.2; padding: 0; }
body.phone-game .workshop-dialog .offer-name :is(.part-rank, .shape-badge, .ability-badge) { font-size: 8px; }
body.phone-game .workshop-dialog .offer-description { display: none; }
body.phone-game .workshop-dialog .offer-value { position: static; white-space: nowrap; flex-shrink: 0; font-size: 9px; margin-left: auto; }
body.phone-game .workshop-dialog .no-offers { min-height: 0; display: flex; align-items: center; font-size: 11px; line-height: 1.4; padding: 8px; }
body.phone-game .workshop-dialog .workshop-route-inline { grid-column: 1 / -1; grid-row: 3; min-height: 0; height: 100%; }
body.phone-game .workshop-dialog[data-tab] .route-choice[data-panel="route"]:not([hidden]) { display: flex; align-items: center; gap: 10px; height: 100%; padding: 0; margin: 0; border: 0; overflow: hidden; }
body.phone-game .workshop-dialog .route-choice > .panel-label { width: 35%; flex: 0 0 35%; font-size: 8px; line-height: 1.3; margin: 0; }
body.phone-game .workshop-dialog .route-options { display: grid; flex: 1; grid-template-columns: repeat(2, minmax(0, 1fr)); height: 100%; gap: 7px; margin: 0; }
body.phone-game .workshop-dialog .route-option { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 2px 5px; min-height: 32px; height: 100%; padding: 4px 7px; }
body.phone-game .workshop-dialog .route-option > span { font-size: 9px; }
body.phone-game .workshop-dialog .route-option small { display: block; width: 100%; margin: 0; font-size: 8px; line-height: 1.15; }
body.phone-game .workshop-dialog .route-option .action-icon { width: 14px; height: 14px; }
body.phone-game .workshop-dialog .workshop-feedback { grid-column: 1 / -1; grid-row: 4; min-height: 0; height: 15px; max-height: 15px; margin: 0; overflow: hidden; font-size: 9px; line-height: 15px; white-space: nowrap; text-overflow: ellipsis; }
body.phone-game .workshop-dialog .workshop-actions { display: grid; grid-column: 1 / -1; grid-row: 5; grid-template-columns: 1fr 1fr; gap: 8px; min-height: 0; position: static; margin: 0; padding: 0; border: 0; background: none; }
body.phone-game .workshop-dialog .workshop-actions :is(.primary-button, .secondary-button) { min-height: 40px; height: 40px; padding: 5px 12px; font-size: 11px; }

/* Dialoghi di servizio: sezioni/pagine gestite dall'app, senza scorrimento del corpo. */
body.phone-game :is(.settings-dialog, .help-dialog, .saves-dialog) { width: min(650px, calc(100% - 24px)); max-height: calc(100dvh - 20px); padding: 12px 18px; overflow: hidden; }
body.phone-game :is(.settings-dialog, .help-dialog, .saves-dialog) h2 { margin: 6px 0 10px; font-size: 24px; }
body.phone-game :is(.settings-dialog, .help-dialog, .saves-dialog) h3 { margin: 7px 0; font-size: 13px; }
body.phone-game :is(.settings-dialog, .help-dialog, .saves-dialog) p { margin: 6px 0; font-size: 11px; line-height: 1.4; }
body.phone-game .settings-dialog .control-choices { gap: 7px; }
body.phone-game .settings-dialog .control-choices button { min-height: 58px; padding: 7px; }
body.phone-game .settings-dialog .control-choices b { font-size: 11px; margin-bottom: 4px; }
body.phone-game .settings-dialog .control-choices span { font-size: 10px; line-height: 1.3; }
body.phone-game .settings-dialog > :is(.primary-button, .secondary-button) { min-height: 32px; padding: 5px 9px; margin-top: 6px; }
body.phone-game .settings-dialog > small { margin-top: 7px; font-size: 9px; line-height: 1.3; }
body.phone-game .phone-segments { display: flex; gap: 5px; flex-shrink: 0; margin: 0 0 8px; }
body.phone-game .phone-segments button { flex: 1; min-width: 0; min-height: 32px; padding: 4px 7px; border: 1px solid #91aaa1; border-radius: 7px; font-size: 10px; font-weight: 800; background: #304447; color: #f4f1df; }
body.phone-game .phone-segments [aria-pressed="true"] { color: #182c2e; background: #dfab67; }
body.phone-game #settings-button { display: grid; place-items: center; height: 29px; width: 30px; min-height: 29px; padding: 4px; border: 1px solid #91aaa1; border-radius: 8px; background: #4d6063; color: #f4f1df; }
body.phone-game .settings-controls-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
body.phone-game .settings-utils { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin: 8px 0; }
body.phone-game .settings-utils button { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 5px 9px; border: 1px solid #91aaa1; border-radius: 8px; background: #42595d; color: #f4f1df; font-size: 11px; font-weight: 800; }
body.phone-game #settings-dialog .pwa-bar { display: flex !important; min-height: 0; padding: 5px 0; margin: 0; border: 0; background: none; font-size: 10px; }
body.phone-game .help-dialog #help-steps { display: block; min-height: 90px; height: 90px; margin: 8px 0; padding-left: 20px; overflow: hidden; }
body.phone-game .help-dialog #help-steps li { font-size: 13px; line-height: 1.5; padding: 0 0 0 4px; }
body.phone-game .help-dialog #help-steps strong { color: #f1c98a; }
body.phone-game .help-dialog #understood-button { min-height: 34px; margin-top: 8px; padding: 5px 10px; }
body.phone-game #help-dialog[open] { display: flex; flex-direction: column; }
body.phone-game #help-dialog > .eyebrow { flex: 0 0 auto; margin-right: 35px; font-size: 9px; }
body.phone-game #help-dialog h2 { flex: 0 0 auto; margin-right: 35px; }
body.phone-game #help-dialog #help-steps { flex: 0 0 90px; }
body.phone-game #help-dialog #help-pager { flex: 0 0 34px; margin-top: 0; }
body.phone-game #help-dialog #understood-button { flex: 0 0 34px; height: 34px; }
body.phone-game #saves-dialog[open] { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: 26px 32px 12px 46px minmax(0, 1fr); gap: 5px; height: min(340px, calc(100dvh - var(--phone-safe-top) - var(--phone-safe-bottom) - 20px)); max-height: calc(100dvh - var(--phone-safe-top) - var(--phone-safe-bottom) - 20px); padding: 12px 18px; }
body.phone-game #saves-dialog h2 { grid-row: 1; margin: 0 36px 0 0; font-size: 23px; line-height: 26px; }
body.phone-game #saves-dialog > .phone-segments { grid-row: 2; margin: 0; }
body.phone-game #saves-dialog > label[for] { grid-row: 3; min-height: 12px; height: 12px; margin: 0; padding: 0; font-size: 9px; line-height: 12px; letter-spacing: .2px; }
body.phone-game #saves-dialog #save-code { grid-row: 4; display: block; width: 100%; min-height: 46px; height: 46px; max-height: 46px; margin: 0; padding: 6px 8px; resize: none; font-size: 10px; line-height: 1.25; overflow-wrap: anywhere; }
body.phone-game #saves-dialog [data-phone-panel] { grid-row: 5; min-height: 0; height: 100%; }
body.phone-game #saves-dialog [data-phone-panel="saves:export"] { display: flex; flex-direction: column; justify-content: center; gap: 8px; }
body.phone-game #saves-dialog [data-phone-panel="saves:export"] > p { margin: 0; font-size: 11px; line-height: 1.4; }
body.phone-game #saves-dialog [data-phone-panel="saves:import"] { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: 32px minmax(40px, 1fr) 32px auto; gap: 4px; }
body.phone-game #saves-dialog .save-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; min-height: 32px; margin: 0; }
body.phone-game #saves-dialog .save-actions :is(.secondary-button, .file-label) { min-height: 32px; height: 32px; padding: 4px 7px; font-size: 10px; }
body.phone-game #saves-dialog #save-preview { display: flex; flex-direction: column; justify-content: center; min-height: 40px; margin: 0; padding: 5px 8px; font-size: 10px; line-height: 1.25; }
body.phone-game #saves-dialog #save-preview :is(p, small, div) { margin: 0; font-size: 10px; line-height: 1.25; }
body.phone-game #saves-dialog #import-save-button { min-height: 32px; height: 32px; padding: 4px 8px; margin: 0; font-size: 11px; }
body.phone-game #saves-dialog .save-warning { margin: 0; font-size: 9px; line-height: 1.25; }
body.phone-game #part-detail-dialog { width: min(550px, calc(100% - 24px)); max-height: calc(100dvh - 20px); padding: 14px 22px; overflow: hidden; }
body.phone-game #part-detail-dialog h2 { margin: 5px 0 8px; font-size: 23px; }
body.phone-game #part-detail-dialog p { margin: 6px 0; font-size: 12px; line-height: 1.4; }
body.phone-game .utility-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 7px 0; }
body.phone-game .utility-actions button { min-height: 34px; padding: 4px 6px; font-size: 9px; }
body.phone-game .utility-status { font-size: 9px; line-height: 1.3; color: #d1dbcd; }
body.phone-game #rotate-notice { position: fixed; inset: 0; z-index: 200; margin: 0; width: 100vw; max-width: none; height: 100vh; height: 100dvh; max-height: none; min-height: 0; padding: 24px; border: 0; border-radius: 0; overflow: hidden; background: #304447; }
body.phone-game #rotate-notice[open] { display: grid; place-items: center; }
body.phone-game #rotate-notice:not([open]) { display: none; }
body.phone-game #rotate-notice::backdrop { background: #304447; }
body.phone-game #rotate-notice .rotation-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; width: min(370px, 100%); max-width: 100%; max-height: 100%; margin: 0; padding: 0; }
body.phone-game .rotation-card h2 { color: #f4f1df; font-size: 24px; line-height: 1.15; margin: 3px 0; }
body.phone-game .rotation-card > svg { flex: 0 1 90px; width: 115px; height: 90px; min-height: 45px; stroke: #dfab67; }
body.phone-game #rotate-notice .rotation-card p { font-size: 14px; line-height: 1.5; margin: 0; }
body.phone-game #rotate-notice .rotation-card small { font-size: 12px; line-height: 1.4; margin: 0; }
body.phone-game #rotate-notice .rotation-card button { width: 100%; min-height: 44px; height: auto; margin: 0; padding: 9px 12px; font-size: 11px; }
body.phone-game .rotation-card :is(p, small) { color: #d1dbcd; }

@media (max-height: 380px) and (orientation: landscape) {
  body.phone-game { --phone-header: 32px; --phone-content-pad: 6px; }
  body.phone-game .hub-screen { padding: 6px 8px; }
  body.phone-game .command-header { padding-block: 2px; }
  body.phone-game .command-nav .nav-tab { gap: 4px; }
  body.phone-game .command-nav .nav-icon { width: 21px; height: 21px; }
  body.phone-game #map-view[data-mission-open="true"] .mission-brief { gap: 5px 12px; padding: 10px 16px; }
  body.phone-game #map-view .mission-brief h2 { font-size: 21px; }
  body.phone-game #map-view .mission-brief #mission-lock { font-size: 8px; }
  body.phone-game .hub-screen .blueprint-glyph { height: 56px; flex-basis: 56px; width: 68px; margin-block: 4px; }
  body.phone-game .hub-screen .blueprint-tile h3 { font-size: 13px; }
  body.phone-game .hub-screen .blueprint-tile p { font-size: 9px; line-height: 1.3; }
  body.phone-game .hub-screen .lab-part p { font-size: 9px; }
  body.phone-game .hub-screen .lab-part { grid-template-rows: 11px 36px 13px 24px 28px; gap: 3px; padding: 6px; }
  body.phone-game .hub-screen .lab-part .lab-part-art { width: 36px; height: 36px; }
  body.phone-game #service-view .contract-card { padding: 6px; }
  body.phone-game #service-view .contract-card h4 { font-size: 11px; margin: 0 0 3px; }
  body.phone-game #service-view .contract-card p { margin: 3px 0; font-size: 9px; line-height: 1.3; }
  body.phone-game #service-view .contract-card .reward-line { font-size: 9px; }
  body.phone-game #service-view .contract-actions button { min-height: 28px; padding: 3px 5px; font-size: 8px; }
  body.phone-game .workshop-dialog[open] { grid-template-rows: 32px minmax(0, 1fr) 34px 13px 36px; gap: 4px 8px; padding: 6px 9px; }
  body.phone-game .workshop-dialog .workshop-heading h2 { font-size: 16px; }
  body.phone-game .workshop-dialog .workshop-body { gap: 9px; }
  body.phone-game .workshop-dialog[data-tab] .assembly-panel[data-panel="vehicle"] { grid-template-rows: minmax(0, 1fr); }
  body.phone-game .workshop-dialog .assembly-panel > .panel-label { display: none; }
  body.phone-game .workshop-dialog :is(.assembly-grid, .assembly-detail) { grid-row: 1; }
  body.phone-game .workshop-dialog .selected-info { font-size: 9px; line-height: 1.3; }
  body.phone-game .workshop-dialog .workshop-feedback { height: 13px; max-height: 13px; font-size: 8px; line-height: 13px; }
  body.phone-game .workshop-dialog .workshop-actions :is(.primary-button, .secondary-button) { min-height: 36px; height: 36px; }
  body.phone-game #service-view .tier-card { padding: 4px 7px; }
  body.phone-game #service-view .tier-card > strong { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  body.phone-game :is(.hub-screen, dialog, .command-header) *,
  body.phone-game .command-nav * { transition: none !important; animation: none !important; }
}

/* Collaudo 740×360: il dettaglio è una schermata finita, con azione sempre visibile. */
body.phone-game #map-view[data-mission-open="true"] .mission-brief { display: flex; flex-direction: column; width: min(700px, calc(100% - var(--phone-nav) - 24px)); height: calc(100dvh - 16px - var(--phone-safe-top) - var(--phone-safe-bottom)); max-height: none; gap: 6px; padding: 12px 16px; }
body.phone-game #map-view .mission-brief > .brief-topline { flex: 0 0 14px; min-height: 14px; margin-right: 30px; }
body.phone-game #map-view .mission-brief > :is(.mission-number, .eyebrow) { display: none; }
body.phone-game #map-view .mission-brief > h2 { flex: 0 0 25px; font-size: 22px; line-height: 25px; padding-right: 28px; }
body.phone-game #map-view .mission-main { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); flex: 1 1 0; min-height: 0; gap: 16px; }
body.phone-game #map-view .mission-path, body.phone-game #map-view .mission-options { display: flex; flex-direction: column; gap: 7px; min-width: 0; min-height: 0; }
body.phone-game #map-view #mission-description { font-size: 11px; line-height: 1.35; margin: 0; max-width: none; }
body.phone-game #map-view .mission-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 0; padding: 5px 0; }
body.phone-game #map-view .mission-facts span { display: block; font-size: 7px; line-height: 1.2; }
body.phone-game #map-view .mission-facts strong { display: block; font-size: 10px; line-height: 1.3; }
body.phone-game #map-view .mission-objectives { display: grid; gap: 5px; margin: 0; padding: 0; }
body.phone-game #map-view .goal-row { font-size: 9px; line-height: 1.25; gap: 4px; grid-template-columns: 15px 15px minmax(0, 1fr); }
body.phone-game #map-view .goal-row .ui-icon { width: 14px; height: 14px; }
body.phone-game #map-view #mission-difficulty { display: grid; flex: 0 0 auto; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
body.phone-game #map-view #mission-difficulty > span { grid-column: 1 / -1; font-size: 9px; line-height: 12px; }
body.phone-game #map-view #mission-difficulty button { display: flex; justify-content: center; align-items: center; gap: 4px; min-height: 34px; padding: 4px; font-size: 9px; }
body.phone-game #map-view #mission-difficulty .ui-icon { width: 14px; height: 14px; }
body.phone-game #map-view #difficulty-note { grid-column: 1 / -1; font-size: 9px; line-height: 1.3; }
body.phone-game #map-view .mission-loadout { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 8px; align-items: center; margin: 0; }
body.phone-game #map-view .mission-loadout > span { grid-column: 1; }
body.phone-game #map-view .mission-loadout strong { grid-column: 1; font-size: 10px; }
body.phone-game #map-view #configure-button { grid-column: 2; grid-row: 1 / 3; min-height: 32px; margin: 0; }
body.phone-game #map-view #mission-lock { font-size: 9px; line-height: 1.3; margin: 0; }
body.phone-game #map-view .mission-brief > #start-button { flex: 0 0 38px; min-height: 38px; height: 38px; margin: 0; }
body.phone-game .startup-error { position: fixed; z-index: 210; inset: 15%; padding: 28px; background: #304447; border: 2px solid #dfab67; color: #f4f1df; font: 700 18px/1.5 Arial, sans-serif; }
/* Una trasformazione, anche identità dopo un'animazione, sposta i discendenti fixed. */
body.phone-game .hub-view { transform: none !important; animation: phone-view .12s ease-out both; }
@keyframes phone-view { from { opacity: .7; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { body.phone-game .hub-view { animation: none; } }

/* Le intestazioni secondarie non conservano il margine editoriale della vecchia pagina. */
body.phone-game .hub-screen .section-heading { padding: 0; }
body.phone-game #service-view [data-panel-content="service:achievements"] > .section-heading { display: none; }
body.phone-game #service-view .achievement-card { position: relative; }
body.phone-game #service-view .achievement-symbol { position: absolute; top: 8px; left: 8px; width: 22px; height: 22px; }
body.phone-game #service-view .achievement-symbol .ui-icon { width: 20px; height: 20px; }
body.phone-game #service-view .achievement-card > div { min-height: 0; }
body.phone-game #service-view .achievement-card h3 { min-height: 24px; padding-left: 27px; line-height: 1.2; }
body.phone-game #service-view .achievement-card .progression-action { flex: 0 0 32px; margin-top: auto; }
body.phone-game #service-view .tier-card { display: grid; grid-template-columns: minmax(0, 1fr) 20px minmax(70px, .9fr); grid-template-rows: 16px minmax(28px, 1fr); gap: 2px 4px; padding: 5px; }
body.phone-game #service-view .tier-card > span { grid-column: 1; grid-row: 1; align-self: center; font-size: 9px; }
body.phone-game #service-view .tier-card > strong { grid-column: 2; grid-row: 1; align-self: center; line-height: 1; }
body.phone-game #service-view .tier-card > strong .ui-icon { width: 14px; height: 14px; }
body.phone-game #service-view .tier-card > small { grid-column: 3; grid-row: 1; align-self: center; justify-self: end; font-size: 8px; }
body.phone-game #service-view .tier-card > p { grid-column: 1 / 3; grid-row: 2; align-self: center; font-size: 9px; line-height: 1.2; }
body.phone-game #service-view .tier-card > .progression-action { grid-column: 3; grid-row: 2; min-height: 28px; height: 100%; margin: 0; padding: 3px; font-size: 8px; }
body.phone-game .workshop-dialog .route-option { position: relative; padding-right: 28px; }
body.phone-game .workshop-dialog .route-option > .action-icon { position: absolute; right: 7px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 16px; height: 16px; min-height: 0; margin: 0; }
body.phone-game .workshop-dialog .route-option > .action-icon .ui-icon { width: 16px; height: 16px; }
/* La cornice segue ciascun bordo sicuro: un inset inferiore asimmetrico
   non viene dimezzato dalla centratura automatica del dialog. */
body.phone-game .workshop-dialog[open] {
  inset: calc(var(--phone-safe-top) + 6px) calc(var(--phone-safe-right) + 6px) calc(var(--phone-safe-bottom) + 6px) calc(var(--phone-safe-left) + 6px);
}

/* Marchio modulare 0.6: vettori alla dimensione naturale del telefono. */
body.phone-game .command-header .brand { gap: 0; flex-shrink: 0; }
body.phone-game .command-header .brand-logo { display: block; width: 151px; height: 28px; object-fit: contain; object-position: left center; }
body.phone-game #rotate-notice .rotation-logo { display: block; width: min(300px, 90%); height: auto; max-height: 70px; object-fit: contain; flex: 0 0 auto; margin-bottom: 3px; }
body.phone-game .launch-curtain .launch-logo { width: 180px; height: 42px; object-fit: contain; margin-bottom: 12px; }
@media (max-height: 380px) and (orientation: landscape) { body.phone-game .command-header .brand-logo { width: 137px; height: 25px; } }

/* I controlli dell'officina hanno una riga propria, anche con i bordi sicuri iOS. */
body.phone-game #workshop-dialog[open] { grid-template-rows:40px minmax(0,1fr) 42px 18px 44px; }
body.phone-game #workshop-dialog .repair-button,
body.phone-game #workshop-dialog #remove-button { min-height:40px; height:40px; padding:5px 8px; font-size:10px; }
body.phone-game #workshop-dialog .workshop-actions :is(.primary-button,.secondary-button) { min-height:44px; height:44px; }
body.phone-game #workshop-dialog .route-option { min-height:40px; }
body.phone-game #workshop-dialog .assembly-grid { width:auto; height:100%; max-width:174px; max-height:174px; aspect-ratio:1; justify-self:center; }
body.phone-game #workshop-dialog .assembly-cell { width:100%; height:100%; max-height:none; min-height:0; }
body.phone-game #workshop-dialog .selected-art { height:38px; min-height:38px; }
body.phone-game #workshop-dialog .selected-info { max-height:65px; overflow:hidden; font-size:10px; line-height:13px; }
body.phone-game #workshop-dialog .selected-info::after { content:none; }
body.phone-game #workshop-dialog .workshop-actions.has-mounted { grid-template-columns:minmax(0,.65fr) repeat(2,minmax(0,1fr)); }
body.phone-game #workshop-dialog .workshop-actions #remove-button { height:44px; min-height:44px; }
body.phone-game.in-arena .arena-field-actions button { min-width:60px; min-height:60px; }
body.phone-game.in-arena #arena-dash { width:74px; height:74px; }
body.phone-game.in-arena .arena-base-actions {
  grid-template-columns:repeat(5,minmax(0,1fr));
  width:min(600px,82%);
  bottom:calc(max(12px,env(safe-area-inset-bottom,0px)) + 84px);
}
body.phone-game.in-arena .arena-base-actions #arena-deposit { grid-column:auto; }
body.phone-game.in-arena .arena-base-actions button { min-height:40px; }

/* Recuperi, griglia ed effetto restano visibili: selezionare non apre finestre. */
body.phone-game #workshop-dialog[data-tab] .workshop-body { grid-template-columns:minmax(125px,.72fr) minmax(155px,1fr) minmax(170px,1.08fr); gap:10px; }
body.phone-game #workshop-dialog[data-tab] .assembly-panel[data-panel="vehicle"] { display:contents; }
body.phone-game #workshop-dialog .assembly-panel>.panel-label { display:none; }
body.phone-game #workshop-dialog .assembly-grid { grid-column:1; grid-row:1; max-width:100%; width:auto; height:100%; max-height:174px; align-self:center; }
body.phone-game #workshop-dialog .assembly-detail { grid-column:3; grid-row:1; position:relative; height:100%; min-height:0; padding:8px; border:1px solid #bdc9b6; border-radius:9px; background:#fffcf7; justify-content:flex-start; gap:4px; }
body.phone-game #workshop-dialog .selected-art { display:none; }
body.phone-game #workshop-dialog .selected-info { width:100%; max-height:none; flex:1; overflow:auto; color:#293b3f; cursor:default; padding:0; }
body.phone-game #workshop-dialog .selected-info h3 { margin:0 0 5px; font:900 13px/16px system-ui,sans-serif; }
body.phone-game #workshop-dialog .selected-info h3 small { font:800 9px/12px system-ui,sans-serif; color:#53675f; }
body.phone-game #workshop-dialog .selected-info p { margin:4px 0; color:#293b3f; font:500 11px/14px system-ui,sans-serif; }
body.phone-game #workshop-dialog .selected-info .selected-effect { color:#3f6255; font-size:10px; line-height:13px; }
body.phone-game #workshop-dialog .selected-info .selected-placement { color:#53675f; font-size:10px; line-height:13px; }
body.phone-game #workshop-dialog .selected-stats { display:flex; flex-wrap:wrap; gap:3px 8px; margin:5px 0; font:600 9px/13px system-ui,sans-serif; color:#53675f; }
body.phone-game #workshop-dialog .selected-stats b { color:#293b3f; }
body.phone-game #workshop-dialog[data-tab] .salvage-panel[data-panel="salvage"] { grid-column:2; grid-row:1; }
body.phone-game #workshop-dialog .salvage-panel>.panel-label { flex-basis:14px; min-height:14px; font-size:8px; margin-bottom:4px; }
body.phone-game #workshop-dialog .offer-button { gap:6px; padding:4px; }
body.phone-game #workshop-dialog .offer-symbol { width:32px; height:32px; min-width:32px; min-height:32px; flex-basis:32px; }
body.phone-game #workshop-dialog .offer-name { font-size:10px; line-height:12px; }
body.phone-game #workshop-dialog .offer-name .ability-badge { display:none; }
body.phone-game #workshop-dialog .offer-description { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden; color:#53675f; font:500 9px/11px system-ui,sans-serif; margin-top:2px; }
body.phone-game #workshop-dialog .offer-value { font-size:9px; }
body.phone-game #workshop-dialog :is(.part-rank,.shape-badge) { background:#e4f0de; color:#3c6352; }

/* Una sola presentazione per tipo nuovo, prima di tornare al montaggio. */
.component-discovery-dialog { width:min(680px,calc(100% - 24px)); max-height:calc(100dvh - 24px); padding:18px; border:2px solid #a8baac; border-radius:14px; background:#fffaf0; color:#293b3f; }
.component-discovery-dialog::backdrop { background:#132e34b8; backdrop-filter:blur(4px); }
.component-discovery-layout { display:grid; grid-template-columns:130px minmax(0,1fr); gap:20px; align-items:center; }
.component-discovery-art { width:130px; height:130px; padding:12px; border:1px solid #bbc9b5; border-radius:14px; background:#e5ece0; }
.component-discovery-art .part-preview { width:100%!important; height:100%!important; max-width:100%; max-height:100%; padding:0; border:0; background:transparent; box-shadow:none; object-fit:contain; }
.component-discovery-copy { min-width:0; }
.component-discovery-copy>small { display:block; font:900 10px/14px system-ui,sans-serif; color:#557565; }
.component-discovery-copy h2 { margin:4px 0 8px; font:900 24px/28px system-ui,sans-serif; }
.component-discovery-copy p { margin:6px 0; font:500 12px/16px system-ui,sans-serif; }
.component-discovery-copy #component-discovery-effect { color:#3e6656; font-size:11px; line-height:15px; }
.component-discovery-stats { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:6px; margin:9px 0; padding:7px; border:1px solid #bdc9b6; border-radius:8px; background:#edf0e5; }
.component-discovery-stats span { display:flex; flex-direction:column; font:800 8px/12px system-ui,sans-serif; color:#53675f; }
.component-discovery-stats b { font-size:12px; line-height:16px; color:#293b3f; }
.component-discovery-copy #component-discovery-note { color:#53675f; font-size:10px; line-height:14px; }
.component-discovery-copy #component-discovery-continue { width:100%; min-height:44px; padding:6px; border:2px solid #34494a; border-radius:9px; background:#ffd35f; color:#293b3f; font:900 12px/16px system-ui,sans-serif; }
body.phone-game .component-discovery-dialog { width:min(680px,calc(100% - var(--phone-safe-left) - var(--phone-safe-right) - 20px)); max-height:calc(100dvh - var(--phone-safe-top) - var(--phone-safe-bottom) - 20px); }
.tester-report-dialog { width:min(650px,calc(100% - 24px)); height:min(340px,calc(100dvh - 20px)); max-height:calc(100dvh - 20px); padding:14px; border:2px solid #a8baac; border-radius:12px; background:#fffaf0; color:#293b3f; overflow:hidden; }
.tester-report-dialog[open] { display:grid; grid-template-rows:25px auto minmax(0,1fr) 26px 44px; gap:6px; }
.tester-report-dialog::backdrop { background:#132e34b8; }
.tester-report-dialog h2 { margin:0 35px 0 0; font:900 19px/25px system-ui,sans-serif; }
.tester-report-dialog>p { margin:0; font:500 11px/14px system-ui,sans-serif; color:#53675f; }
.tester-report-dialog textarea { width:100%; height:100%; min-height:0; resize:none; padding:8px; border:1px solid #afbeaa; border-radius:8px; background:#f2f4ea; color:#293b3f; font:500 11px/15px ui-monospace,monospace; user-select:text; touch-action:pan-y; }
.tester-report-actions { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.tester-report-actions button { min-height:44px; padding:5px; border:1px solid #adbaab; border-radius:8px; background:#fffdf7; color:#293b3f; font:900 11px/15px system-ui,sans-serif; }
.tester-report-actions .primary-button { background:#ffd35f; border:2px solid #34494a; }
body.phone-game .tester-report-dialog { width:min(650px,calc(100% - var(--phone-safe-left) - var(--phone-safe-right) - 20px)); height:min(340px,calc(100dvh - var(--phone-safe-top) - var(--phone-safe-bottom) - 16px)); max-height:calc(100dvh - var(--phone-safe-top) - var(--phone-safe-bottom) - 16px); }
body.phone-game #tester-report-dialog,
body.phone-game #tester-report-dialog :is(h2,textarea,button) { color:#293b3f; }
body.phone-game #tester-report-dialog .dialog-close { min-width:40px; min-height:40px; }
body.phone-game.frontier :is(#tester-report-dialog,#component-discovery-dialog) { --ink:#293b3f; --muted:#53675f; --panel:#fffcf5; --bg:#f2eee5; color-scheme:light; color:#293b3f; }
@media(max-height:380px) and (orientation:landscape) {
  .component-discovery-dialog { padding:12px; }
  .component-discovery-layout { grid-template-columns:100px minmax(0,1fr); gap:14px; }
  .component-discovery-art { width:100px; height:100px; }
  .component-discovery-copy h2 { margin:3px 0 5px; font-size:21px; line-height:25px; }
  .component-discovery-copy p { margin:4px 0; font-size:11px; line-height:14px; }
  .component-discovery-stats { margin:6px 0; padding:5px; }
}
