gamemode spectator @s
execute if entity @s[tag=no_drop] at @s at @n[tag=map_center] run tp @s ~ ~ ~
execute at @s run playsound minecraft:entity.generic.hurt player @s ~ ~ ~ 1 1

scoreboard players set @s spectator_time 80

execute if entity @s[team=blue] if score #temp_blue player_count matches 2 run scoreboard players set @s spectator_time 160
execute if entity @s[team=red] if score #temp_red player_count matches 2 run scoreboard players set @s spectator_time 160

execute if entity @s[team=blue] if score #temp_blue player_count matches 3..4 run scoreboard players set @s spectator_time 200
execute if entity @s[team=red] if score #temp_red player_count matches 3..4 run scoreboard players set @s spectator_time 200

execute if entity @s[team=blue] if score #temp_blue player_count matches 5.. run scoreboard players set @s spectator_time 240
execute if entity @s[team=red] if score #temp_red player_count matches 5.. run scoreboard players set @s spectator_time 240