If multiple cards are put into the library this way (such as when the spell targets a melded permanent), that permanent's owner puts all the cards on top or all the cards on the bottom. They put them in whatever order they wish, and do not need to reveal the order.

Artwork
Loading artwork…
Endless Detour
Final Fantasy Commander · #324 · EN
Nonfoil—Foil—
Card rules
The owner of target spell, nonland permanent, or card in a graveyard puts it on their choice of the top or bottom of their library.
"I'm scared of lightning! Let's rest, please? Pretty please?" —Rikku
Rare · Illustrated by Yoichi Ito
Format legality
Brawl Legal
Commander Legal
Competitive Brawl Legal
Duel Legal
Gladiator Legal
Historic Legal
Legacy Legal
Modern Legal
Oathbreaker Legal
Penny Legal
Pioneer Legal
Timeless Legal
Tlr Legal
Vintage Legal
Alchemy Not Legal
Future Not Legal
Old School Not Legal
Pauper Not Legal
Pauper Commander Not Legal
PreDH Not Legal
Premodern Not Legal
Standard Not Legal
Standard Brawl Not Legal
Rulings
Published rulings from the downloaded Scryfall catalog. Source card record · Rules and interactions
The card's owner chooses whether to put it on the top or bottom of their library.
Endless Detour doesn't counter spells. A spell that can't be countered can still be put on the top or bottom of its owner's library this way.
If Endless Detour targets a token, that token is put into the library, then ceases to exist.