# PCMTG SYSTEM ARCHITECTURE & RULES GUARDRAIL 1. INFRASTRUCTURE & TOPOLOGY - Cloud Provider: Strictly Serverless Google Cloud Platform (GCP). - Compute: Cloud Run (Node.js/Express for Game Logic, Python/FastAPI for Content Factory). - Frontend: Next.js App Router deployed on Firebase App Hosting. - Control Plane: Cloud Scheduler and Pub/Sub acting as the metronome. - Security: Air-gapped protocol. Never expose DB URLs. Secrets injected via GCP Secret Manager. 2. DUAL-DATABASE ARCHITECTURE - Live Game State: Cloud Firestore (NoSQL) strictly for ephemeral 60-second table state and real-time client sync via `onSnapshot`. - Core Economy: Cloud SQL PostgreSQL (accessed via Prisma ORM) for persistent ACID compliance on wallets, inventories, and the ledger. 3. CORE GAME MECHANICS & THE ANTI-META DIRECTIVE - Objective: Win the round by playing cards to pull a News Stub's secret 3D vector as close to the origin (0,0,0) as possible. - Calculation: Final score is the shortest squared Euclidean distance: $d = \sqrt{x^2 + y^2 + z^2}$. - The Axes: * X: Left (-) vs. Right (+) * Y: Lib (-) vs. Auth (+) * Z (Hidden): Elitism (-) vs. Populism (+). - Quadrant Asymmetry: * AuthRight (Dinars) -> Z-Axis: HONOR vs. FAITH. * AuthLeft (Collective Labor) -> Z-Axis: UNITY vs. LOYALTY. * LibLeft (Pronouns) -> Z-Axis: PRIDE vs. KARMA. * LibRight (Monke) -> Z-Axis: CHAOS vs. YOMI. 4. THE "BASED" BUTTON (PRISONER'S DILEMMA) - Players can forfeit mathematical calculation by pressing "Based". - 1 Player hits Based: "Utter Humiliation" (massive ELO/currency penalty). - 4 Players hit Based: "Grand Consensus" (massive global payout, math calculation aborted). - 1 Player plays a Card while 3 hit Based: The Defector receives amplified payouts.