> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/igorek05m/daily-geogame/llms.txt
> Use this file to discover all available pages before exploring further.

# Daily challenge

> Discover a new country every day at midnight UTC with Daily GeoGame's daily challenge system

## How it works

Every day at midnight UTC, Daily GeoGame generates a fresh challenge featuring a randomly selected country from around the world. Each challenge is identified by a unique day number, starting from the game's launch date.

### Challenge generation

The daily challenge system ensures quality gameplay through a smart country selection process:

* Countries are randomly selected from a curated list of 195+ nations
* Each selected country must have complete CIA World Factbook data available
* If a country lacks sufficient data, the system automatically tries another candidate
* The system attempts up to 5 countries before falling back to a guaranteed valid option

<Note>
  The same daily challenge is shared by all players worldwide, creating a global community experience where everyone guesses the same country each day.
</Note>

### Midnight UTC reset

Challenges refresh automatically at midnight UTC (Coordinated Universal Time). This means:

* Players in different time zones receive the new challenge at different local times
* Your current challenge progress is saved until you complete it or the day ends
* Once a new day begins, a completely new country becomes the target
* Previous day challenges remain accessible through the date browser

<Info>
  UTC was chosen as the reset time to provide a fair, universal standard for all players regardless of location.
</Info>

## Day numbering system

Each challenge is assigned a sequential day number, making it easy to reference and share specific challenges:

```
Day 1: Launch date (2025-01-01)
Day 2: 2025-01-02
Day 3: 2025-01-03
...
```

The day number appears prominently in the game interface and statistics modal, helping you track your progress over time.

## Browsing past challenges

Daily GeoGame lets you revisit any previous challenge you might have missed:

<AccordionGroup>
  <Accordion title="Navigate with arrow buttons">
    Use the left and right arrow buttons in the game header to move backward or forward through challenges. The system prevents you from accessing future dates that haven't occurred yet.
  </Accordion>

  <Accordion title="Jump to today's challenge">
    Click the "Today" button to instantly return to the current daily challenge, no matter which past date you're viewing.
  </Accordion>

  <Accordion title="Use the calendar picker">
    Select any past date from the calendar interface to jump directly to that day's challenge. Dates are validated against the game's launch date and today's date.
  </Accordion>
</AccordionGroup>

### Progress tracking across dates

Your progress is saved independently for each date:

* Switching to a past challenge shows your previous guesses for that day
* If you never played a past challenge, you can start fresh
* Returning to today's challenge restores your current progress
* All statistics and guess history are preserved per date

<Warning>
  You cannot play future challenges. The system blocks any dates beyond today to maintain fairness.
</Warning>

## Technical implementation

The daily challenge system is powered by several key components:

**API endpoint**: `/api/daily/route.ts` handles challenge generation and retrieval\
**Date validation**: Ensures dates are in `YYYY-MM-DD` format and within valid range\
**Database storage**: MongoDB stores each day's challenge with the target country and pre-generated hints\
**Session tracking**: Browser cookies maintain your session across page reloads

### Data sources

Each daily challenge pulls information from multiple reliable sources:

* **RestCountries API**: Provides country names, codes, borders, population, flags, and geographic data
* **CIA World Factbook**: Supplies detailed hints about climate, terrain, resources, economy, and culture
* **Local country database**: Contains the master list of valid countries and their FIPS codes

<Card title="Why FIPS codes?" icon="code">
  The CIA World Factbook uses FIPS codes (Federal Information Processing Standards) to identify countries. Daily GeoGame maps each country's ISO alpha-2 code to its corresponding FIPS code to fetch the correct Factbook data.
</Card>

## Playing strategically

To maximize your daily challenge experience:

1. **Play consistently**: Build streaks by playing every day
2. **Use all six guesses**: Each incorrect guess unlocks a new hint
3. **Study past challenges**: Review previous days to learn country characteristics
4. **Compare with others**: Check global statistics to see how you stack up

The daily format creates anticipation and routine, turning geography learning into a daily habit that's both educational and entertaining.
