Zynga, once one of Silicon Valley's fastest-growing companies, suffered a dramatic reversal of fortunes in 2012 as gamers switched from Facebook-based games to those on mobile devices.