Pair Quest v1.7 for PHP shared hosting

cPanel installation
1. Select PHP 8.1 or later for the game domain. PHP 8.2 or later is recommended. Enable PDO and pdo_sqlite, or ask the host to enable them.
2. Open File Manager and create public_html/pairquest (or use your game subdomain's document root).
3. Copy the three files inside the upload folder into that directory: index.html, api.php and decks.json.
4. Open https://yourdomain.com/pairquest/ and create a private room. Share the invitation with another player. Two connected players are needed to start.
5. Select Animals, Family photos, Flags, Capitals, Animal young, or Custom. For Family photos, select a board size first and load at least that many different pictures.

SQLite creates the game database in a private directory under PHP's temporary directory. PHP needs write access there. A hosting account may periodically clear its temporary directory. For stable storage, set PAIRQUEST_DATA_DIR in the PHP environment to a writable directory outside all website document roots. Inactive rooms expire after 30 minutes. Old records are removed on later requests. Returning to the lobby after a photo round deletes that round's stored images.

Local development
From the upload folder, run php -S 127.0.0.1:8127 and open http://127.0.0.1:8127/ in a browser. For Windows XAMPP, use C:\xampp\php\php.exe in place of php. Open a separate private browser window for the second player.

Optional browser test
With the local development server running, install the official Playwright Python package on your development computer:
python -m pip install playwright
python -m playwright install chromium
python browser_smoke.py
Run the last command from the directory containing browser_smoke.py. For a different local URL, set PAIRQUEST_URL, including the trailing slash. Test dependencies are for the development computer only.

Changes from v1.0
PHP handles room actions and SQLite coordinates updates across PHP requests. Relative invite and API URLs support subfolders. Photo data is sent to each player on first reveal and cached for subsequent flips.


Version 1.2 adds 32, 40 and 48 tile boards. Every included deck supports 24 pairs. The default is 32 tiles.

Version 1.3 fits words inside tiles and wraps multi-word labels at spaces.

Version 1.4 measures rendered words against the tile interior and prevents text from widening the grid column.

Version 1.5 reduces the tile-word font from 20 px to 14 px maximum.

Version 1.6 embeds images for all 24 country flags. Existing v1.5 installations only need the updated index.html.

Version 1.7 adapts board columns and lobby controls to phones, tablets and desktop screens.
