HiyoriMatcha - Updated Package (Assistant)
Files updated/added:
 - redeem.php                 (server-side redeem logic)
 - account_backend.php        (backend loader for account.php - include where appropriate)
 - hiyorimatcha_migration.sql (SQL to run on your MariaDB to add columns and create prize_codes table)

What I changed:
 - Implemented server-side loyalty/referral/tier bonus logic in redeem.php
 - Implemented loyalty cycle reward generation (prize_codes) server-side
 - Added account_backend.php to expose variables to your account template
 - Prepared migration SQL to add needed DB fields and remove lucky-draw tables

Important:
 - I did NOT modify landing page, signup, login, or CSS files. I preserved your asset files from the original zip.
 - To fully enable the new logic, run the migration SQL (import hiyorimatcha_migration.sql) on your database.
 - Place account_backend.php logic inclusion into your account.php (where server-side load happens) with: require_once __DIR__ . '/account_backend.php';
 - Keep your existing scripts/db.php but ensure it provides a PDO $pdo with ERRMODE_EXCEPTION and uses PDO::ATTR_EMULATE_PREPARES = false.
 - After deploying, test redeem flow with a test user and a valid order_codes entry.

Packaging:
 - This zip contains the full original project plus the updated files above.
