Im newbie too but here is my suggestion (not the code but the logic) for you:
Add a collision to your fireball so you check if and what it hits.
You can add a collision by adding component in your fireball blueprint if you search for collision, you will find 3 types. Choose the shape which suits your needs best. You can further adjust size after that. With this Collision you have access to events like “On Component begin overlap”. Your players need a collision as well to make that work.
Both players can shoot the fireball
If Player 1 shoot fireball -> Set a variable to P1
If Player 2 shoot fireball -> Set a variable to P2
If fireball hits Player 1, check if the variable is P1 or P2. If P1 it was your own fireball so no damge, if P2 than it was the fireball from Player 2 so make damage.
With the screen pop up you could go with a “Widget Blueprint” which you can use for menues and stuff. Widget blueprints are very easy to use, just watch a small tutorial on that.
To open the screen while playing it’s basically: “Event happened” (fireball hits) -> **Create Widget **(choose your widget in the class selection) -> Add to viewport.
You might want to disable inputs or movements while your widget is open.
To restart the game you could simply add a button in the widget which opens your level when you click on it, or a button that just closes the widget so you can continue to play.
My recommendation for all kind of stuff, think about the logic and then search for a tutorial video on exactly this topic.
So for your setup you should watch videos for “Collision component” and"Widget Blueprints" and Im pretty sure you can archive all your goals with that.
Have fun and keep going