title @a[distance=..250] times 20 100 20
title @a[distance=..250] subtitle ""
title @a[distance=..250] title {"text":"RED WINS","bold":true,"color":"red"}

scoreboard players set #game_end temp 2

execute store result storage pctf:map input.win int 1 run scoreboard players set .win temp 2

execute at @n[tag=map_center] as @a[distance=..250] run function pctf:logic/game/end/start

scoreboard players add @a[team=red,distance=..250] total_wins 1
tag @a[team=red,distance=..250] add winner

execute at @s as @a[tag=playing,distance=..250] run function pctf:logic/game/end/start