card backgrounds and better pie layout calculation