Sunset

Sunset is an event that occurs at the end of each in-game day in the Pikmin games. When the sunset arrives, all leaders and Pikmin must stop what they are doing, retreat into the Onions and ship, and spend the night in low-orbit, due to the fact that many predators become active at night.

Safe Pikmin
When the sunset arrives, any Pikmin that are considered to be safe will be able to board their Onion, spend the night above the surface, and be ready to be picked up the following day. When the day ends, Pikmin will be considered safe if:
 * They are in a leader's group.
 * They are close to an activated Onion.
 * They are close to an inactivated Onion.

It does not matter which Onion the Pikmin is close to, even if the Pikmin's type does not match the Onion's type.

In addition to these, any Pikmin that is buried will stay where they are buried, and will not be harmed over the night. Any other Pikmin that isn't safe or buried will be left behind on the surface and will be eaten by enemies during the night.

added some ways to know for sure that Pikmin are safe. A large white circle appears around all activated Onions on the area, indicating that Pikmin within it will be safe. Although unactivated Onions do not show the circle, the safety radius still exists, and if a dormant Onion is activated after the sunset warning period begins, the circle will still not appear, but nearby Pikmin will still be counted as safe. A small counter will appear on the top-right corner of the screen to alert the player of how many Pikmin are in danger of being left behind. What types of Pikmin that are idle are displayed near the top of the map, along with how many. Pikmin icons will also appear larger on the radar when the sunset is approaching, and the icons of those that are at risk of being left on the surface will also appear flashing on the radar. Finally, when the player attempts to finish the day from the pause menu, a warning will show up saying that Pikmin will be left behind if there are indeed any Pikmin considered not safe when the player tried to end the day.

Warning
Some minutes before the sun is down, a message will appear on-screen warning the player that they need to gather their Pikmin. From here on, the music changes to a calmer remix. It is also at this point that the hud changes, and the Onions get their safety limits shown, in Pikmin 3.

Countdown
Some time after the warning, a countdown from 10 takes place. Each digit takes a few seconds to pass and is presented on-screen, slowly fading away to make way for the next one. 0 also appears, and the day doesn't end until after the 0 disappears completely.

Gathering
When the countdown finishes, or when the day is ended with the pause menu, two cutscenes take place. The first scene starts with all alive leaders and safe Pikmin following the leaders walking up to the landing site in a single group led by the leader who was selected when the day ended. The main leader then dismisses and orders every Pikmin to get on their Onions or ship. Any Pikmin that is near an Onion, but away from the landing site will still climb to their Onion, despite not being shown. Any Pikmin that are buried will remain buried in the same spot and can be plucked on another day. After all the Pikmin have entered their Onion, the leaders are beamed into the ship.

Lift off
The second cinematic shows the ship preparing for lift-off, while wild creatures draw near. If any Pikmin were not considered safe, they'll be shown running towards the ship in an attempt to be saved. However, it is too late, and the wandering enemies will begin to eat them. The ship then takes off into the night sky.

=In fanon games=

In Pikmin: Wide World
Sunset is an event that occurs at the end of each in-game day in Pikmin: Wide World, and it begins one-and-a-half real-time minutes before the end of an in-game day. When sunset begins, a message appears on-screen alerting leaders to gather their Pikmin and finish up the day's current tasks. The area's music also becomes calmer and quieter. Additionally, the Master Onion and any other Onions will display a ring of light around themselves that indicates the zone in which Pikmin will automatically enter their Onion. Needless to say, an Onion must be in an active state for its appropriately-colored Pikmin to be able to enter it. Small swarms of Twilight Spectralids may also appear once sunset begins, and they will remain until the next day begins.

The heads-up display will also change to include a counter that tracks how many Pikmin are currently in danger of being left behind, and a counter that tracks what specific Pikmin types are in danger of being left behind can be viewed from the HocoPad's radar screen. Additionally, dots on the radar screen representing Pikmin in danger will blink and pulsate so that they are more easily seen. Pikmin can only enter an Onion that matches their type or has their color incorporated into it.

As the day comes to a close, a countdown starting from ten will begin, and slowly count down to zero, the day ending immediately afterward unless the day is manually ended before then. The Pikmin counters on the heads-up display and on the HocoPad's radar screen will flash red to illustrate the importance of Pikmin possibly being left behind. The on-screen text about gathering Pikmin and finishing tasks will also change color the longer the timer counts down. After the timer reaches zero, the traditional end-of-the-day cutscene will begin, accompanied by its music. It sees the leaders walking up to the day's landing site, any Pikmin in their group accompanying them. They look around before dismissing their Pikmin into the Master Onion, and the PikHold if it was obtained. The leaders then board the Dolphin Lander after every Pikmin has entered their appropriate lodging. The Dolphin Lander, the Master Onion, and any other active Onions present then blast off into the night sky as hungry beasts close in on their position. The only exception to this is when Captain Olimar is abducted by the Plasm Wraith in Ancient Metalworks. Any Onions discovered during the day merge with the Master Onion as they proceed into orbit. While in orbit, the Pikmin in the Master Onion and the Pikmin in the PikHold exchange knowledge between one another, but not between vessels, and the leaders talk amongst themselves and drink the day's ration of juice. Additionally, if enough progress has been made in an area, a leader will gaze out the window, reflecting on themselves or their actions, and then catch sight of a potential new area to land in.

Pikmin that are left behind at the end of the day may perish, being messily devoured by nocturnal creatures, unless they are Captmin, parasitic Pikmin hosts, or Alien Pikmin. Captmin and parasitic Pikmin hosts hide to survive the night, and creatures do not eat Alien Pikmin because they are an invasive species. Pikmin that are transformed into Mushroom Pikmin and are left behind are counted as Pikmin deaths, but Mushroom Pikmin that are found naturally do not. Other Pikmin that are left behind overnight may survive if they are able to find refuge under vegetation and are lucky enough to avoid the vicious predators hunting them. They can be found in their hiding spots the next day. Pikmin are considered safe if they are in a leader's group, idling within the vicinity of a leader, at the day's landing site, or in an Onion's safe zone. Pikmin that are buried are also considered safe but will remain where they are until they are plucked from the ground.

Additionally, once enough progress is made in Story Mode, leaders can choose to stay on the surface of PNF-404 past sunset, and they can stay until quarterway into the night. This can be done in a variety of ways, such as by accepting the Dolphin Lander's offer to stay past sundown, or by toggling the option to stay past sundown in the Dolphin Lander's menus. Eventually, after a few sunsets, she will stop asking, notifying the leaders they may let her know if they wish to stay after sunset by interacting with her. No matter the method used, the Dolphin Lander will tell the leaders to stay safe and be careful. At night, enemies that were active during the day will return to their nests or territories to sleep or hide. Likewise, enemies that were dormant during the day, either because they were sleeping or hiding, will begin to hunt for food. Some enemies are active during all times. Although moonlight is present, the most potent illumination is cast by the leaders' beacons, Onions, the Dolphin Lander, and enemies and vegetation that produce light. Idle Pikmin also glow faintly in the dark, making finding any stray Pikmin easy. Many nocturnal enemies are attracted to light, making navigation dangerous and necessitating extreme caution. The Dolphin Lander will initially be unwilling to allow leaders to stay on the surface past sundown, but once they become experienced enough, she will come to trust they can take care of themselves.