# Pharma Word Search Game  (v3.5.1)

## Installation / update
1. WordPress > Plugins > Add New > Upload Plugin > choose pharma-word-search.zip
   (if an older version is installed, click "Replace current with uploaded").
2. Activate the plugin.
3. Put this shortcode on a page:  [pharma_word_search]

## Settings (one page, one Save button, 4 tabs)
WordPress admin > Word Search > Game Settings
  1. Brands: title, logo, separate LEFT and RIGHT pictures for the game screen, brand colours, description, words per puzzle, keyword pool (x4)
  2. Colours & Design: all colours, fonts, LEFT section width, RIGHT section (puzzle board) width, puzzle row height, corner roundness, page background, timer (on/off, countdown or stopwatch, countdown duration), reset button
  3. Text Sizes: size of every text on login, brand and game screens (+ overall % and grid-letter %)
  4. Texts & Labels: every heading, label, button and message players see, including the timer label, the "time's up" message, and the puzzle board's "Back to login" button

## Timer
Turn it on in Colours & Design > Timer. Countdown mode shows a shrinking
clock. When it hits 0:00 the puzzle board locks and a "Time's up!" popup
appears with a friendly message ("Better luck next time!") and an OK
button. Clicking OK (or pressing Esc) takes the player back to the login
page, ready for the next person. The popup heading, message and button
text can all be edited in Texts & Labels (Game screen section).
Stopwatch mode just counts up and never locks the board. The timer resets
every time a puzzle starts ("Play", "New puzzle" or "Play again").

## Puzzle board buttons
The puzzle board footer now has three buttons: "New puzzle" (same brand,
fresh random puzzle), "Back to brands" (brand-picker screen) and
"Back to login" (returns to the very first name/email screen, for
handing the device to the next player). All three are re-labelled from
Texts & Labels.

## Setting up the 4 buttons
For each button set: title, brand logo (upload), description, words per
puzzle, and the keyword pool (one keyword per line).

## How the puzzle changes every time
Every play (and every "New puzzle" / "Play again") the server
  * randomly picks "words per puzzle" words from that button's keyword pool
  * builds a brand-new grid with random positions/directions/filler letters
So keep the pool LONGER than "words per puzzle" (e.g. 20 keywords, 8 shown).

## Anti-cheating
The keyword pool and the answer positions never reach the browser. Each
selection is verified on the server, and score + time are calculated on the
server. A visitor cannot fake a result.

## Results
Word Search > Word Search Results (table + Export CSV, includes brand name).
Results table: wp_pws_results (prefix may differ). No database change was
needed for v3, so old results are kept (old "Round 1/2" show as button 1/2).
