We study the interstellar medium (ISM) properties as a function of the molecular gas size for 77 infrared-selected galaxies at z ~ 1.3, having stellar masses 109.4 ≲ M⋆ ≲ 1012.0 M⊙ and star formation rates 12 ≲ SFRFIR ≲ 1000 M⊙ yr-1. Molecular gas sizes are measured on ALMA images that combine CO(2-1), CO(5-4), and underlying continuum observations, and include CO(4-3), CO(7-6) + [CI](3P2 - 3P1), [CI](3P1 - 3P0) observations for a subset of the sample. The $\gtrsim $46 per cent of our galaxies have a compact molecular gas reservoir, and lie below the optical discs mass-size relation. Compact galaxies on and above the main sequence have higher CO excitation and star formation efficiency than galaxies with extended molecular gas reservoirs, as traced by CO(5-4)/CO(2-1) and CO(2-1)/LIR, SF ratios. Average CO + [CI] spectral line energy distributions indicate higher excitation in compacts relative to extended sources. Using CO(2-1) and dust masses as molecular gas mass tracers, and conversion factors tailored to their ISM conditions, we measure lower gas fractions in compact main-sequence galaxies compared to extended sources. We suggest that the submillimetre compactness, defined as the ratio between the molecular gas and the stellar size, is an unavoidable information to be used with the main sequence offset to describe the ISM properties of galaxies, at least above M⋆ ≥ 1010.6 M⊙, where our observations fully probe the main sequence scatter. Our results are consistent with mergers driving the gas in the nuclear regions, enhancing the CO excitation and star formation efficiency. Compact main-sequence galaxies are consistent with being an early post-starburst population following a merger-driven starburst episode, stressing the important role of mergers in the evolution of massive galaxies.