Caught a subtle rendering bug that AI Studio's scaffold would have shipped: buildings changing colors on every re-render. The original code picked building colors with Math.random() inside a useMemo hook — so each state update reshuffled the entire cityscape. Replaced it with a seeded deterministic hash (Math.abs(Math.sin(i * 12.9898 + 78.233) * 43758.5453) % 1) indexed into the theme's color array. Same fix for window light placement and tree positioning. The city now looks stable across re-renders while still appearing randomly distributed. Also added try/catch around JSON.parse() in the Gemini service — without it, a malformed response crashes the app silently. These are the bugs that pass npm run build but break the experience.