/* Fit the HUD to the browser's content area, not the monitor resolution. */
body.game-open { overflow: hidden; }
html:has(body.game-open) { overflow: hidden; }
body.game-open #gameOuter {
  position: fixed;
  inset: 8px;
  width: auto;
  height: auto;
  min-height: 0;
}
body.game-open #leftPanels,
body.game-open #rightPanels {
  width: calc(220px * var(--hud-panel-scale, 1)) !important;
  flex: 0 0 calc(220px * var(--hud-panel-scale, 1)) !important;
  gap: calc(10px * var(--hud-panel-scale, 1)) !important;
  max-height: none !important;
  overflow: visible !important;
}
/* Only in-flow panels scale. Fixed dialogs and tooltips keep their coordinates. */
.hud-fit-panel { zoom: var(--hud-panel-scale, 1); flex-shrink: 0; }
body.game-open #gameWrap { flex-shrink: 0; }

/* Remove inherited title height and unused space before shrinking text. */
#gameOuter #statsPanel.compactStatsPanel > .gamePanelTitle {
  min-height: 0 !important;
  margin-bottom: 5px !important;
}
#gameOuter #statsPanel .statsExperience { margin: 5px 2px 6px; }
#gameOuter #statsPanel .statCapacityCell { margin-bottom: 3px !important; }
#gameOuter #statsPanel .compactSkillTraining { padding-top: 4px !important; }
