A. The series ended the way it did---Team 7 triumphs over the strongest in history as a team--highlighting the message of teamwork making the writing and literature great.
B. Everyone including Naruto and Sasuke are trapped in IT, we see a small vision of what Naruto and Sasuke would have dreamed of--but during the dream Naruto overpowers the IT and we get a giant panel of all 9 tailed beasts disrupting his chakra to break it, and Sasuke while dreaming realizes he is in a genjutsu due to his rinnegan--they both are released and continue the final battle fighting Madara(or Kaguya)
B. Everyone including Naruto and Sasuke are trapped in IT, we see a small vision of what Naruto and Sasuke would have dreamed of--but during the dream Naruto overpowers the IT and we get a giant panel of all 9 tailed beasts disrupting his chakra to break it, and Sasuke while dreaming realizes he is in a genjutsu due to his rinnegan--they both are released and continue the final battle fighting Madara(or Kaguya)