/**
 * FAQ copy. Plain-text paragraphs so the same source renders the accordion and the FAQPage
 * structured data. Keep claims consistent with docs/ARCHITECTURE.md (privacy, purge, rules).
 */
export interface FaqItem {
  id: string;
  question: string;
  answer: readonly string[];
  link?: { href: string; label: string };
}

export interface FaqGroup {
  id: string;
  title: string;
  items: readonly FaqItem[];
}

export const faqGroups: readonly FaqGroup[] = [
  {
    id: 'guests',
    title: 'For guests',
    items: [
      {
        id: 'no-app',
        question: 'Do guests need to download an app or create an account?',
        answer: [
          'No. Guests scan the QR code on the TV or a table card and the game opens right in their phone’s browser. They pick a nickname and they’re in — no app store, no email, no password.',
        ],
      },
      {
        id: 'privacy',
        question: 'What do you collect from players?',
        answer: [
          'Only a nickname and a random device identifier, so a phone that drops off can rejoin with its score intact. We never ask players for names, emails, phone numbers or accounts.',
          'Guest play data is deleted automatically after 90 days. This website counts page views without cookies, never stores IP addresses, and honours Do Not Track and Global Privacy Control.',
        ],
        link: { href: '/legal/privacy', label: 'Read the privacy notice' },
      },
      {
        id: 'free-to-play',
        question: 'Does it cost anything to play?',
        answer: [
          'Never for guests. There is no paid entry and nothing to buy inside the game. Power-ups are earned by completing a line on your board — they are never sold.',
        ],
      },
    ],
  },
  {
    id: 'legal',
    title: 'Legal & content',
    items: [
      {
        id: 'legality',
        question: 'Is this gambling? Is it allowed in my bar?',
        answer: [
          'PintRush is a skill game with no paid entry and no wagering of any kind. Double Down only risks in-game points, never money.',
          'If you want to hand out prizes, check first: prize promotions are regulated differently by state and town, so we recommend a local legal review before offering anything of real value.',
        ],
      },
      {
        id: 'content',
        question: 'Where do the questions come from? What about music?',
        answer: [
          'Our trivia is original and written for PintRush. Music Mayhem asks about songs and artists without playing recordings or reproducing lyrics.',
          'Any licensed content would only be added once rights are cleared, and public-performance rights for music played in a venue are reviewed separately.',
        ],
      },
    ],
  },
  {
    id: 'venues',
    title: 'For venues',
    items: [
      {
        id: 'hardware',
        question: 'What hardware do I need?',
        answer: [
          'A TV that can open a web page: a smart-TV browser, a streaming stick, or any laptop or mini PC plugged in over HDMI. No buzzers, consoles or special boxes.',
        ],
      },
      {
        id: 'internet',
        question: 'What internet connection does it need?',
        answer: [
          'The TV needs a steady internet connection. Guests play over your guest Wi-Fi or their own mobile data, and the game uses very little bandwidth. If a phone drops off, it reconnects and catches up automatically.',
        ],
      },
      {
        id: 'cost',
        question: 'How much does it cost?',
        answer: [
          'Pilot pricing is $79 per venue per month for Starter, $149 for Pro and $249 for Network. Nothing is billed through this website; pricing for pilot venues is agreed with you directly.',
        ],
        link: { href: '/pricing', label: 'Compare plans' },
      },
      {
        id: 'setup',
        question: 'How long does setup take?',
        answer: [
          'Minutes. We create your venue, you open the TV link on your screen and put QR codes on the tables. For a Championship, your host signs in on a phone or laptop to run the show.',
        ],
      },
      {
        id: 'multiple-tvs',
        question: 'Can I run it on more than one TV?',
        answer: [
          'Yes. Open the same TV link on as many screens as you like. They stay in sync, and guests can scan whichever screen they can see.',
        ],
      },
      {
        id: 'host',
        question: 'Do I need a host?',
        answer: [
          'Not for Always-on: rounds start, run and score themselves whenever you’re open. Championships are designed for a host — a bartender or your regular trivia host can run one from a phone.',
        ],
      },
      {
        id: 'moderation',
        question: 'What if someone picks a rude nickname?',
        answer: [
          'Nicknames are filtered automatically, including creative spellings, and duplicates get a number (“Mike”, “Mike 2”). Hosts can rename or remove any player from the host dashboard in one tap.',
        ],
      },
    ],
  },
];

export const allFaqItems: readonly FaqItem[] = faqGroups.flatMap((group) => group.items);

export function faqItems(ids: readonly string[]): FaqItem[] {
  return ids.flatMap((id) => allFaqItems.filter((item) => item.id === id));
}
