  We study charm production in Pb+Pb collisions at $\sqrt{s_{\rm NN}}=$2.76 TeV
in the Parton-Hadron-String-Dynamics transport approach and the charm dynamics
in the partonic and hadronic medium. The charm quarks are produced through
initial binary nucleon-nucleon collisions by using the PYTHIA event generator
taking into account the (anti-)shadowing incorporated in the EPS09 package. The
produced charm quarks interact with off-shell massive partons in the
quark-gluon plasma and are hadronized into $D$ mesons through coalescence or
fragmentation close to the critical energy density, and then interact with
hadrons in the final hadronic stage with scattering cross sections calculated
in an effective Lagrangian approach with heavy-quark spin symmetry. The PHSD
results show a reasonable $R_{\rm AA}$ and elliptic flow of $D$ mesons in
comparison to the experimental data for Pb+Pb collisions at $\sqrt{s_{NN}}$ =
2.76 TeV from the ALICE Collaboration. We also study the effect of
temperature-dependent off-shell charm quarks in relativistic heavy-ion
collisions. We find that the scattering cross sections are only moderately
affected by off-shell charm degrees of freedom. However, the position of the
peak of $R_{\rm AA}$ for $D$ mesons depends on the strength of the scalar
partonic forces which also have an impact on the $D$ meson elliptic flow. The
comparison with experimental data on the $R_{\rm AA}$ suggests that the
repulsive force is weaker for off-shell charm quarks as compared to that for
light quarks. Furthermore, the effects from radiative charm energy loss appear
to be low compared to the collisional energy loss up to transverse momenta of
$\sim$ 15 GeV/c.
