Manipulating pins (SD Card)

The definitions are addressing the port directly, there is no need to do this. Just follow the diagrams so that pin 10 is connected to CS so you define that as:-
int CS = 10;
int DI = 11;
pinMode(CS,OUTPUT);
pinMode(DI,INPUT);

and so on.