# FRS — Gamification, Estimator, Studio & NFRs

> [← 11 Exercises Matrix](./exercises-matrix.md) | [FRS HTML View](./index.html) | Next: [Tech Stack →](../03-tech/tech-stack.md)

## Rewards, SRS & Exam Estimator Flow

```mermaid
flowchart LR
    Attempt["Exercise Attempt"] --> SRS["SM-2 SRS Update (ease, interval, next_review_at)"]
    Attempt --> XP["XP + Combo + Daily Streak"]
    Lesson["Lesson Complete"] --> Stars["1-3 Stars (>=90% = 3★)"]
    Stars --> Unlock["Unlock Next Lesson + Sticker Rules"]
    Lesson --> Est["Recompute Exam Readiness"]
    Est --> Badges["IELTS Band | TOEIC 300-990 | JLPT N5-N1 | TESOL"]
```

## Gamification, SRS & Studio Requirements (`FR-5xx` – `FR-7xx`)

| ID | Priority | Feature | Acceptance Summary |
| :--- | :--- | :--- | :--- |
| **FR-501** | P0 | **XP, Combos, 1–3 Stars & Stickers** | `>=90%` = 3★, `>=70%` = 2★; confetti & SVG stickers (`First Spark`, `Three-Star Ace`, `Polyglot Explorer`, `IELTS Band Architect`, `TOEIC Executive`, `TESOL Mentor`) |
| **FR-502** | P0 | **Exam Readiness Estimator** | Live rolling gauge: **IELTS (`4.0–9.0`)**, **TOEIC (`300–990`)**, **JLPT `N5–N1 %`**, **TESOL Tier**, **CEFR `A0–C2`** |
| **FR-601** | P0 | **SM-2 "Daily Brain Boost"** | Pulls due vocab into dynamic SM-2 mixed drills (`/review` + `/api/v1/review/brain-boost`) |
| **FR-702** | P1 | **Visual Pack Studio (`/studio`)** | Quick sentence-pack generator, live YAML/JSON editor, validator, atomic SQLite / Cloudflare D1 importer & `/export` download |
| **FR-703** | P1 | **Parent / Skill Analytics (`/parent`)** | Optional 4-digit PIN; skill breakdown (`Reading/Listening/Grammar/Vocab/Writing`), struggling-item table, reset & CSV/JSON CLI export |

## Non-Functional Requirements (`NFR-01` – `NFR-06`)

| ID | Category | Target |
| :--- | :--- | :--- |
| **NFR-01** | **Performance** | `~60 FPS` GPU `translate3d` drag physics; `<100ms` local & Cloudflare Edge grading API |
| **NFR-02** | **Cross-Device** | Desktop, tablet & phone (`375px–1440px+`), `>=52px` touch targets, responsive split reading |
| **NFR-03** | **Unicode & Scripts** | UTF-8 + `NFC` normalization; RTL `<bdi>`, `<ruby>` Furigana, Pinyin, Hangul, Polish diacritics & IPA |
| **NFR-04** | **Accessibility** | WCAG AA contrast, keyboard drag-drop parity, `prefers-reduced-motion` support |
| **NFR-05** | **Runtime** | Dual-runtime: Python `3.9.6+` + SQLite (`run.py`) AND serverless Cloudflare Worker + Hono + D1 (`https://language.outxet.dev`) |
| **NFR-06** | **Verification** | `16 pytest` specs + `4 vitest` specs + `ruff` lint + strict validation across all 17 YAML packs & live Chrome DOM checks |

## Changelog

| Version | Date | Summary of Changes |
| :--- | :--- | :--- |
| **v1.2.0** | 2026-11-22 | Updated `FR-702` and `NFR-01/03/05/06` for Cloudflare Worker + D1 edge deployment (`language.outxet.dev`), Polish diacritics, and Vitest verification alongside 17 packs. |
| **v1.1.0** | 2026-11-15 | Synced `FR-501` sticker catalog titles with `content/stickers.yaml`, `FR-702` Studio capabilities with `studio.html`, and `NFR-06` with verified test suite. |
| **v1.0.0** | 2026-11-15 | Initial gamification, Brain Boost SRS, Studio, and NFR specifications. |

