We propose a Gribov-Zwanziger type model action for the Landau-DeWitt gauge that preserves, for any gauge group, the invariance under background gauge transformations. At zero temperature, and to one-loop accuracy, the model can be related to the Gribov no-pole condition. We apply the model to the deconfinement transition in SU(2) and SU(3) Yang-Mills theories and compare the predictions obtained with a single or with various (color dependent) Gribov parameters that can be introduced in the action without jeopardizing its background gauge invariance. The Gribov parameters associated to color directions orthogonal to the background can become negative, while keeping the background effective potential real. In some cases, the proper analysis of the transition requires the potential to be resolved in those regions.