The Supreme Court ruled on Friday that the federal government can legally shut down TikTok in the U.S., delivering a stunning blow to the viral video app used by about half of Americans.