Ahh would definitely recommend going to a CC if you’re intent on going to a UC! There are several paths you can take (TAG to a UC eligible campus) or taking TAP which can help increase your chances of transferring to UCLA or UCB!
I remember being rejected by both UCLA and UCB my senior year and I was so devastated, but I don’t regret my decision going to CC at all. I was able to save money and get my pre-reqs out of the way at my own pace. This time, I got accepted to every UC I applied to and I’m currently deciding between UCB and UCLA! You can take the CSU route, but I wouldn’t recommend it since it’s technically harder to transfer to a UC later on. Wishing you the best!