Context. Strongly stratified hydromagnetic turbulence has recently been identified as a candidate for explaining the spontaneous formation of magnetic flux concentrations by the negative effective magnetic pressure instability (NEMPI). Much of this work has been done for isothermal layers, in which the density scale height is constant throughout. Aims. We now want to know whether earlier conclusions regarding the size of magnetic structures and their growth rates carry over to the case of polytropic layers, in which the scale height decreases sharply as one approaches the surface. Methods. To allow for a continuous transition from isothermal to polytropic layers, we employ a generalization of the exponential function known as the q-exponential. This implies that the top of the polytropic layer shifts with changing polytropic index such that the scale height is always the same at some reference height. We used both mean-field simulations (MFS) and direct numerical simulations (DNS) of forced stratified turbulence to determine the resulting flux concentrations in polytropic layers. Cases of both horizontal and vertical applied magnetic fields were considered. Results. Magnetic structures begin to form at a depth where the magnetic field strength is a small fraction of the local equipartition field strength with respect to the turbulent kinetic energy. Unlike the isothermal case where stronger fields can give rise to magnetic flux concentrations at larger depths, in the polytropic case the growth rate of NEMPI decreases for structures deeper down. Moreover, the structures that form higher up have a smaller horizontal scale of about four times their local depth. For vertical fields, magnetic structures of super-equipartition strengths are formed, because such fields survive downward advection that causes NEMPI with horizontal magnetic fields to reach premature nonlinear saturation by what is called the "potato-sack" effect. The horizontal cross-section of such structures found in DNS is approximately circular, which is reproduced with MFS of NEMPI using a vertical magnetic field. Conclusions. Results based on isothermal models can be applied locally to polytropic layers. For vertical fields, magnetic flux concentrations of super-equipartition strengths form, which supports suggestions that sunspot formation might be a shallow phenomenon.