card function now accepts card objects improve css