METHEXIS TRIVIA - SIMPLE VERSION
================================

NO BUILD REQUIRED! NO DEPLOYMENT! JUST UPLOAD AND USE!

FILES:
- index.html         = Homepage
- admin.html         = Admin panel
- control.html       = Game control (for host)
- scoreboard.html    = Live scoreboard (for participants)
- api.php            = All backend logic in ONE file
- google_sheets.php  = Google Sheets integration
- credentials.json   = Google API credentials (keep secure!)

FEATURES:
✅ Timer (15s default, adjustable)
✅ Bonus points (triple-click to access)
✅ Google Sheets integration (reads & writes)
✅ 3-month usage tracking (in Sheets)
✅ Question rating system (👍/-1, 👎/+1, ❌ wrong answer)
✅ Manual import option (format: Question|Answer)
✅ Live scoreboard (3-second refresh)
✅ NO composer/vendor needed!

HOW TO USE:

1. UPLOAD FILES:
   - Upload all 7 files to trivia.methexis.eu
   - That's it! No folders, no complex structure

2. QUESTIONS (2 options):
   Option A - Google Sheets (automatic):
   - Questions load from your Google Sheet
   - Tracks usage dates automatically
   - Updates usage count in Sheet
   
   Option B - Manual import:
   - Go to admin.html → "Întrebări" tab
   - Paste questions in format: Question|Answer
   - Click Import

3. CREATE GAME:
   - Go to admin.html
   - Enter theme and teams
   - Click "Creează Joc"

4. RUN GAME:
   - Open Control Panel link
   - Click "Încarcă Întrebări"
   - Timer starts automatically
   - Click team buttons for points
   - Triple-click for bonus points

5. PARTICIPANTS:
   - Share scoreboard link
   - Updates every 3 seconds

RATING SYSTEM:
- After showing answer, 3 rating buttons appear:
  👍 Good Question = +1 to rating (column I)
  👎 Bad Question = -1 to rating (column I)  
  ❌ Wrong Answer = Writes "RĂSPUNS GREȘIT" in notes (column K)
  
- Switching between 👍 and 👎 correctly adjusts the score
- Ratings are saved directly to Google Sheets

DATABASE:
First time only - run these in phpMyAdmin:

CREATE TABLE IF NOT EXISTS games (
    id INT AUTO_INCREMENT PRIMARY KEY,
    theme VARCHAR(255),
    question_count INT DEFAULT 15,
    current_question_index INT DEFAULT 0,
    is_active BOOLEAN DEFAULT FALSE,
    game_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

CREATE TABLE IF NOT EXISTS teams (
    id INT AUTO_INCREMENT PRIMARY KEY,
    team_name VARCHAR(255),
    game_id INT,
    FOREIGN KEY (game_id) REFERENCES games(id)
);

CREATE TABLE IF NOT EXISTS scores (
    id INT AUTO_INCREMENT PRIMARY KEY,
    game_id INT,
    team_id INT,
    score INT DEFAULT 0,
    UNIQUE KEY unique_game_team (game_id, team_id),
    FOREIGN KEY (game_id) REFERENCES games(id),
    FOREIGN KEY (team_id) REFERENCES teams(id)
);

That's ALL! Simple as possible!