Brightness helps but it's not the only factor here. The Galaxy A12 has a pretty mid processor and Genshin Impact is pretty demanding, so that heat is relatively normal for that phone playing for 20+ minutes, but there's something most people overlook: background processes. Check if you have apps running simultaneously (social media, browser, anything that does sync) because that adds to CPU usage and the temperature goes up more. Aside from brightness, close everything else before playing and keep basic ventilation on your phone, don't have it on a pillow or anything. The battery itself doesn't get damaged just from occasional heat, but if it stays above 40°C constantly after a few months it will degrade, so if you keep noticing a lot of heat it's a sign that phone is at its limit with that game.