Gambit Club — product requirements
Gambit Club is a small online chess club. Players face deterministic bots (Levels 1 to 3) or a friend on one screen, move by click or typed notation, import and export FEN and PGN, solve mate puzzles, replay finished games and track an Elo rating. Guests can play casual games and solve puzzles; rated games, History and Profile need an account.
Problem. Players need a chess board that applies the rules of the game exactly and predictably, with ratings that move in the right direction, so that results and history can be trusted.
Users
- Club member — Play rated games against bots and watch the rating and record follow every result.
- Casual guest — Start a game or a puzzle immediately without an account.
- Learner — See legal moves, check warnings and clear notation, and replay finished games move by move.
Goals
- Every rule of chess (castling, en passant, promotion, stalemate, checkmate) is enforced exactly.
- Bots always answer the same moves the same way, so games are repeatable.
- A rated result always moves the rating in the right direction and is recorded in History and Profile.
Out of scope
- Waiting for a clock to run out
- Drag gestures
- Real networks or opponents
Contents
Sign-in and access
Account sign-in, guest access and the pages that require an account.
- The top bar shows the display name, "Rating <n>" and a "Sign out" button
- The "Rated game" option becomes enabled
- No username: "Enter your username" with focus in the username field
- No password: "Enter your password"
- Wrong credentials: "Wrong username or password" and the login screen stays open
- "Continue as guest" opens Play with the top bar showing "Guest"
- Guest History: "Sign in to see your games"
- Guest Profile: "Sign in to see your profile"
Game lobby
Choosing opponent, level, colour and clock before a game.
- Heading "New game"; Opponent: Bot / Hot-seat; Bot level: Level 1, 2, 3; Your colour: White / Black; Time control: 5+0, 3+2, Untimed
- Defaults: Bot, Level 1, White, Untimed
- Sidebar: Play, Puzzles, History, Profile
- Guest: "Rated game" is disabled with the note "Sign in to play rated games." and a Sign in link
- Bot game: "Game vs Bot L<level>", status "Your move", "No moves yet"
- Hot-seat game: "Hot-seat game", "White to move"
- Starting a new game while one is in progress asks for confirmation ("Leave game")
Board and move entry
Click and typed moves, visual aids and notation.
- The knight on g1 at the start offers f3 and h3 only
- Clicking an opponent piece shows no dots
- "e4", "Bc4", "O-O" and "e2e4" are accepted when legal
- Otherwise the inline error is: Illegal or unreadable move "<text>"
- Captures use x (Nxe4, exd5), check +, mate #, castling O-O, promotion a8=N
- Black’s move after a break reads "2. ... Qh4#"
- Status reads "Black to move, in check"
- After the check is parried the status reads "White to move" with no glow
- Equal material shows no "+" on either side
- After 1.e4 d5 2.exd5 White’s strip shows one black pawn and "+1"
- Unflipped: ranks 1 to 8 in the left column (8 on top), files a to h along the bottom
- Flipped: Black at the bottom, rank 1 on top, files run h to a
Rules of chess
Exact enforcement of special moves and game endings.
- With a bishop attacking f1, the king on e1 has no destination dots and "O-O" is rejected as illegal
- Once the diagonal is blocked the position is playable again
- Castling with no attacked square is legal: O-O puts the king on g1 and the rook on f1
- 1.e4 a6 2.e5 d5 3.exd6 captures the d5 pawn
- If any other move is played first, exd6 is rejected as illegal
- Escape closes the dialog and leaves the pawn unmoved
- Choosing Knight on a8 gives a white knight and the notation a8=N
- Status "Draw by stalemate"; the move box is replaced by "New game" and "Export PGN"
- Status "<Side> wins by checkmate"
- Casual games show "Casual game, no rating change"
Bot opponents
Deterministic replies for Levels 1 to 3.
- The bot reply appears automatically and the status returns to "Your move"
- After e4, Nf3, d4 Levels 1 and 2 reply a5, a4, a3
- Level 3 replies a5, a4, b6
- When the user plays Black every bot opens with Na3
- Undo is disabled before any move and in hot-seat games
- After e4 a5, Undo restores the start position with "No moves yet"
Resign, draw and clocks
Ending a game by resignation or agreement, and time controls.
- Dialog "Resign this game?" with Cancel and Resign, focus on Cancel
- Confirming gives "<Opponent side> wins by resignation"
- Confirm dialog "Offer a draw?"
- Bot: "The bot declined: too early for a draw"
- Hot-seat: the callout "<Side> offers a draw" with Accept and Decline; Accept gives "Draw by agreement", Decline continues the game
- 5+0 starts both clocks at 5:00; 3+2 at 3:00
- Untimed shows no clocks
Ratings
Elo changes for rated games against bots.
- Rated win over Level 1 from 1340 shows "Rating 1341 (+1)"
- Resigning a rated Level 2 game from 1340 shows "Rating 1314 (−26)"
- After the win above: Rating 1341, Rated games 8, Record 3W 2D 3L
- After the resignation above: Rating 1314, Rated games 8, Record 2W 2D 4L, Last change −26
Import and export
FEN and PGN in and out.
- After e4 e5 Nf3 the text contains 1. e4 e5 2. Nf3
- The exported text lists all moves in the order played
- Empty: "Paste a FEN or PGN first"
- Invalid FEN: an error under the text box
- Valid input: heading "Imported position" and play continues from it, e.g. a 5-ply PGN ends with Bb5 and "Black to move"
Puzzles
Eight mate puzzles with forced replies.
- The list runs from "Back-rank finish" to "King steps up", none Solved initially
- A wrong move shows "Try again" and resets; the right move shows "Correct" and offers Restart and Next puzzle
- "Queen sacrifice on b8": Qb8+ shows "Correct. Black replied Rxb8, now find the mate"; Rxb8 completes it
- "Next puzzle" opens "King steps up"
History, replay and profile
Finished games, replay and rating chart.
- Seeded member: 12 rows; Wins 3, Draws 4, Losses 5
- The newest row is a loss to Bot L3 by resignation on Sep 24, 2026; the oldest is a win over Bot L1 by checkmate on Sep 2, 2026
- A member with no games sees an empty state
- Replay opens at the start position; Left arrow steps back, Home returns to the start
- An unknown game id shows "Game not found"
- Seeded member: Rating 1340, Rated games 7, Record 2W 2D 3L, Last change −14; line from 1400 to 1340 over 8 points
- A member with no games sees an empty chart state
Non-functional requirements
- Dialogs fit the screen; puzzle cards stack in one column
Glossary and rules
| Hot-seat | Two players taking turns on one screen. |
|---|---|
| Rated game | A game against a bot whose result changes the member’s Elo rating. |
| FEN / PGN | Standard text formats for a position and for a list of moves. |