Viewers can now vote for their favourite audience answers during the
30-second voting window. Votes are persisted to the DB at round end
and aggregated as SUM(votes) in the JUGADORES leaderboard.
- db.ts: add persistUserAnswerVotes(); switch getPlayerScores() to SUM(votes)
- game.ts: add userAnswerVotes to RoundState; persist votes before saveRound
- server.ts: add userAnswerVoters map + /api/vote/respuesta endpoint
- frontend.tsx: add userAnswerVotes type; vote state/handler in App; ▲ buttons in Arena
- frontend.css: flex layout for user-answer rows; user-vote-btn styles
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Server: /api/respuesta/enviar checks admin cookie; if authorized,
bypasses credit check and stores answer via insertAdminAnswer()
- DB: insertAdminAnswer() inserts directly into user_answers with
username='Admin', skipping the credit budget entirely
- Frontend: ProposeAnswer checks /api/admin/status on mount; if admin
is logged in, shows the answer form directly (orange Admin badge)
instead of the payment tier selection
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Core mechanic change: users now submit answers to the live prompt,
competing alongside AI models; answers broadcast to all viewers
- New pricing (no time limit, pure count-based, refillable):
0,99€ = 10 resp · 9,99€ = 300 resp · 19,99€ = 1000 resp
- DB: new user_answers table; submitUserAnswer() atomically validates
credit, inserts answer, decrements budget; JUGADORES leaderboard
now scores by user_answers count
- server: /api/respuesta/enviar endpoint; credit activation sets
expires_at 10 years out (effectively no expiry); answers injected
into live round state and broadcast via WebSocket
- frontend: ProposeAnswer widget shows current prompt, textarea active
during answering phase, tracks per-round submission state;
Arena shows Respuestas del público section live
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Move /pregunta flow into a compact ProposeQuestion component
rendered inside <main> above the footer
- Tier cards, username input, Redsys payment, polling, and question
submission all work inline without leaving the game page
- Payment redirects now go to /?credito_ok=ORDER and /?ko=1
so the game stays in view during the full payment cycle
- Badge shows live questions remaining; updates on each submission
- Removed /pregunta link from footer (functionality is now inline)
- .propose-* CSS: compact tier grid, textarea+button row, spinner
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Pricing: 0,99€/10q · 9,99€/200q · 19,99€/unlimited (all 30 days)
- DB: max_questions + questions_used columns on credits table;
consumeCreditQuestion() atomically validates, creates question,
and decrements quota in a single transaction
- Server: updated CREDIT_TIERS, /api/credito/estado returns questionsLeft,
/api/pregunta/enviar returns updated questionsLeft after each submission
- pregunta.tsx: badge shows live question count; submit disabled when exhausted;
questionsLeft synced to localStorage after each submission; Cloud Host footer added
- footer: moved from Standings sidebar into <main> (scrolls with game content);
also added to all pregunta page states
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Footer: add site-footer with one-liner + Cloud Host branding linking to cloudhost.es (mobile only, hidden on desktop)
- Auto-pause: game pauses automatically after AUTOPAUSE_DELAY_MS (default 60s) with no viewers connected; auto-resumes when first viewer connects; shows "Esperando espectadores…" in the UI
- Redsys: new /pregunta page lets viewers pay 1€ via Redsys to submit a fill-in question; submitted questions are used as prompts in the next round instead of AI generation; new redsys.ts implements HMAC_SHA256_V1 signing (3DES key derivation + HMAC-SHA256); notification endpoint at /api/redsys/notificacion handles server-to-server confirmation
- db.ts: questions table with createPendingQuestion / markQuestionPaid / getNextPendingQuestion / markQuestionUsed
- .env.sample: added AUTOPAUSE_DELAY_MS, PUBLIC_URL, REDSYS_* vars
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Translate all ~430 prompts to Spanish with cultural adaptations
- Translate all UI strings (frontend, admin, history, broadcast)
- Translate AI system prompts; models now respond in Spanish
- Replace Twitch/Fossabot viewer voting with in-site vote buttons
- Add POST /api/vote endpoint (IP-based, supports vote switching)
- Vote buttons appear during voting phase with active state highlight
- Rename project to argument.es throughout (package.json, cookie, DB)
- Add docker-compose.yml with SQLite volume mount
- Add .env.sample documenting all required and optional vars
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>