# Math Game – Difficulty Levels

This document describes **how the game works today**.

Difficulty changes **how the player answers** and some number caps.
The player still chooses **which operations** to practice in Settings (`+`, `−`, `×`, `÷`).

---

## Overview

Three difficulties:

| Key | Label | Input | Timer |
|---|---|---|---|
| `easy` | Lahko | 4 multiple-choice buttons | Stopwatch (on) |
| `medium` | Srednje | 6 multiple-choice buttons | Stopwatch (on) |
| `hard` | Težko | Numeric keypad + OK | Stopwatch (on) |

Settings also choose:

- Which operations are active
- How many questions (`stevilo_racunov`)
- Add/subtract range (`max_number`)
- Multiplication factors (`za_mnozenje`)
- Division divisors (`za_deljenje`)

---

## Easy (`easy` / Lahko)

- Input: **4 choices**
- Timer: stopwatch, enabled
- Negatives: not allowed
- Multiply other-factor cap: **1–10**
- Add/subtract range: from settings (`max_number`)

---

## Medium (`medium` / Srednje)

- Input: **6 choices**
- Timer: stopwatch, enabled
- Negatives: not allowed
- Multiply other-factor cap: **1–12**
- Add/subtract range: from settings (`max_number`)

---

## Hard (`hard` / Težko)

- Input: **keypad** (digits, backspace, `OK`; `±` only if `allowNegative` is on)
- No multiple-choice buttons
- Timer: stopwatch, enabled
- Negatives: **off** (`allowNegative: false`) unless flipped later in `levels.js`
- Multiply other-factor cap: **1–20**
- Add/subtract range: from settings (`max_number`)
- Division: exact results only

---

## Code map

```js
// web/src/levels.js
LEVELS = {
  easy:   { inputType: 'choices', choicesCount: 4, timerEnabled: true, allowNegative: false, multiplicationMaxA: 10 },
  medium: { inputType: 'choices', choicesCount: 6, timerEnabled: true, allowNegative: false, multiplicationMaxA: 12 },
  hard:   { inputType: 'keypad',  choicesCount: 0, timerEnabled: true, allowNegative: false, multiplicationMaxA: 20 }
}
```

Questions are built by `buildSession(config, level)` in `web/src/questionGenerator.js`.
The Game screen only renders `question.text` and checks `question.result`.

---

## Design principles

- Difficulty increases interaction complexity, not intimidation
- Same play screen, different answer component
- Hard is framed as a challenge, not a punishment
- Unfinished modes (rounding, dice, calculator, equations, text problems) are **not** in the live path
