Theory of core-collapse supernovae