Phase transitions, screening and dielectric response of CsPbBr3