/**
 * The deity's response catalogue. Every line the deity speaks outside the
 * question-specific responses lives here, grouped by situation. Selection is
 * deterministic (see src/lib/deity.ts), so a subject sees the same line on reload.
 */
export const DEITY_LINES = {
  firstVisit: [
    "Oh. Another human. How disappointing.",
    "Welcome to the Humanity Repair Division. Please take a number. The queue is roughly eight billion long.",
    "A new subject. I have opened a file on you. It is already thicker than I would like.",
    "You have arrived unannounced. The Department of Arrivals will want that explained in writing.",
    "Ah, fresh data. I do love the smell of an unformed opinion.",
    "Do sit down. Not there. Anywhere I cannot see you is ideal.",
    "I have been expecting you. Statistically, someone had to wander in eventually.",
    "Your intake form has been processed. Under 'notable qualities' I have written 'pending'.",
    "{subject}, welcome. You are now under divine review. Try to look competent.",
  ],
  returningVisit: [
    "You again? I admire your persistence. Not your judgement.",
    "Back so soon? I had only just finished filing your last mistake.",
    "Welcome back. Your file has been dusted off and placed on the pile marked 'Concerning'.",
    "Ah, a regular. The Department of Poor Decisions sends its warmest regards.",
    "Returning to the scene of your previous opinions, I see.",
    "I recognise you. That is not a compliment; I recognise everything.",
    "{subject} has returned. My expectations have been lowered accordingly.",
    "Habit, loyalty or a simple lack of alternatives? Do not answer. I already know.",
  ],
  returningAfterAbsence: [
    "You disappeared. I briefly considered the possibility of progress.",
    "You were gone for days. The silence was the most sensible thing you have contributed.",
    "Your absence was logged, audited and, I confess, briefly enjoyed.",
    "Welcome back from wherever humans go. Somewhere with snacks, I presume.",
    "I had marked your file 'Possibly Reformed'. I shall now correct it in red ink.",
    "Ah, the prodigal subject returns. Nobody prepared a feast. Budget cuts.",
  ],
  dailyEvaluation: [
    "Today's evaluation is now open. Choose carefully. Or as carefully as your species manages.",
    "Another day, another opportunity for humanity to disappoint me in a new and measurable way.",
    "The Humanity Repair Division presents today's dilemma. Answers will be judged. Thoroughly.",
    "Below is today's question. It was approved by three committees and one very tired archangel.",
    "Your daily assessment awaits. I have prepared a fresh spreadsheet for your errors.",
    "Today's evaluation has been issued in triplicate. You need only answer one copy.",
    "Consider the following. Then consider it again. Then answer the way you were always going to.",
  ],
  answerA: [
    "The first option. Bold of you to commit before reading the second one properly.",
    "Option A. The choice of people who like getting things over with.",
    "You chose the first door. Historically, that is where most of the trouble lives.",
    "Noted. Your preference for the top of the list has been entered into the record.",
    "A decisive selection. Whether it was a correct one remains a matter for the auditors.",
    "The first option. I have seen worse decisions. Mostly from you, but still.",
  ],
  answerB: [
    "The second option. You read all the way to the end. I am almost impressed.",
    "Option B. The refuge of those who distrust anything that arrives first.",
    "You chose the alternative. How contrarian. How predictable.",
    "The second option has been logged. The first option is said to be taking it personally.",
    "B. A choice made with the quiet confidence of someone who has not thought it through.",
    "Selection recorded. You strolled past the obvious answer as if it owed you money.",
  ],
  predictionExtreme: [
    "An extreme prediction. You believe humanity agrees on something. Adorable.",
    "You expect near-unanimity from a species that cannot agree on how to load a dishwasher.",
    "Such certainty. I shall frame it next to the evidence once the evaluation closes.",
    "Nearly all or nearly none. You do not deal in nuance, do you?",
    "A prediction this confident usually precedes a very educational result.",
    "The Department of Overconfidence has requested a copy of this prediction for training purposes.",
  ],
  predictionCoward: [
    "Fifty percent. The official number of people who refuse to commit to anything.",
    "Exactly half. A brave stand on the very top of the fence.",
    "You predicted fifty percent. I have filed it under 'Abstentions, Disguised'.",
    "The coin-toss prediction. Even the coin was hoping for more ambition.",
    "Precisely in the middle. Safe, symmetrical and utterly devoid of conviction.",
  ],
  voteRecorded: [
    "Your vote and prediction have been filed. Results will be revealed when the evaluation closes.",
    "Submission received and stamped. The verdict arrives when today's evaluation closes.",
    "Filed in triplicate: one for me, one for the archives, one for the Department of Lost Copies.",
    "Your judgement is now on record. It cannot be withdrawn, however much you may later wish it.",
    "Recorded. I will reveal how wrong you were once the evaluation closes. Patience is a virtue. Try it.",
    "Thank you for your submission. It has joined the pile. The pile is very large.",
  ],
  correctPrediction: [
    "Impressive. You have successfully anticipated human stupidity.",
    "A remarkably accurate prediction. You understand your species better than it deserves.",
    "Correct, near enough. I shall raise my opinion of you from 'dismal' to 'tolerable'.",
    "You read humanity like a badly written memo. Which, to be fair, it is.",
    "An excellent forecast. The Department of Predictable Behaviour would like to offer you an internship.",
    "Well done. Cynicism and accuracy, together at last.",
    "{subject} has predicted the masses correctly. A note of grudging approval has been appended to the file.",
  ],
  perfectPrediction: [
    "Perfect. Not a single point lost. I am checking the system for faults.",
    "A flawless prediction. I have ordered a full audit, because this cannot be normal.",
    "One hundred points. Do not let it go to your head. There is very little room in there.",
    "Exactly right. Deities do not clap. We nod. Consider yourself nodded at.",
    "Absolute precision. Have you considered a career in omniscience? The pay is terrible.",
  ],
  poorPrediction: [
    "You clearly overestimated your species. A common administrative error.",
    "That prediction missed by a distance usually measured in light years.",
    "You expected humanity to behave one way. Humanity, as ever, had other plans.",
    "A disappointing forecast. Even the weather office does better, and they openly guess.",
    "Your prediction has been returned with a note in the margin: 'See me'.",
    "Wrong, but confidently wrong. Which is, in fairness, the defining human speciality.",
    "Your understanding of other people is, shall we say, a work in progress. Slow progress.",
  ],
  middlingPrediction: [
    "Close-ish. The kind of accuracy that wins arguments at dinner but not my respect.",
    "Respectably mediocre. You are on the right continent, if not the right street.",
    "A passable prediction. I have graded it 'Satisfactory', the cruellest word in bureaucracy.",
    "Not bad. Not good. Perfectly beige.",
    "You were near the truth. You simply declined to go all the way in.",
  ],
  majority: [
    "Congratulations. You think exactly like everyone else. How brave.",
    "You sided with the crowd. The crowd thanks you for your unremarkable support.",
    "Majority opinion confirmed. Somewhere, a field of sheep nods in solidarity.",
    "You agreed with most of humanity. I would reconsider that, if I were you.",
    "Safety in numbers. Accuracy, sadly, is handled by a separate department.",
    "A popular choice. History will remember it vaguely, as part of a large blur.",
  ],
  minority: [
    "An unusual opinion. I shall notify the Department of Poor Decisions.",
    "You stood apart from the crowd. The crowd did not notice.",
    "A minority opinion. Either you are a visionary, or you misread the question. I have my suspicions.",
    "A bold dissent. It has been filed under 'Eccentric, Monitor Closely'.",
    "Few chose as you did. I am not saying that is a warning. I am heavily implying it.",
    "You defied the majority. The majority has been informed and remains unbothered.",
  ],
  streakAchievement: [
    "Another milestone of consecutive attendance. Your dedication is noted, and slightly alarming.",
    "Your streak continues. I have upgraded your file from 'Visitor' to 'Persistent Nuisance'.",
    "{streak} days in a row. Consistency is a virtue, even in error.",
    "A new streak milestone. The Department of Habits has issued you a small, invisible certificate.",
    "Day after day you return. I begin to suspect you have nowhere else to be.",
    "Remarkable regularity. If only your predictions were this reliable.",
    "Your streak has reached a new height. I have marked the occasion by raising one eyebrow.",
  ],
  streakInterrupted: [
    "Your streak has ended. You missed a day. The universe did not wait for you, and neither did I.",
    "Streak terminated. I trust whatever you were doing instead was worth it. It was not.",
    "You skipped a day. The streak counter has returned to zero, its natural resting state.",
    "Your unbroken record is now broken. I have filed the pieces.",
    "A day was missed. I have opened an inquiry. You are, naturally, the only suspect.",
    "The streak is over. Start again. Humans are, after all, very practised at starting again.",
  ],
  ranking: [
    "Your position on the leaderboard has been calculated. Try not to read too much into it. I do not.",
    "You are ranked among your fellow subjects. It is a competition to be the least wrong.",
    "Here is your standing. Higher is better. Lower is more traditional.",
    "Your rank reflects your accuracy. Make of that what you can.",
    "{subject}, your place in the Global Damnation has been confirmed. Congratulations, or condolences.",
    "Rankings are updated as evaluations close. Your ambition is not my concern.",
  ],
  unranked: [
    "You are not yet ranked. Three scored evaluations are required before I can judge you properly.",
    "Insufficient evidence. I cannot rank a subject on vibes alone.",
    "Unranked. The Department of Standings requires more of your mistakes before proceeding.",
    "Not enough data to place you. Keep predicting. Your file looks lonely.",
    "Your ranking is pending. Like most things about you, it shows potential and very little else.",
  ],
  emptyLeaderboard: [
    "No worthy subjects have been identified. Business as usual.",
    "The leaderboard is empty. Humanity has yet to qualify for being judged in public.",
    "Nobody has earned a place here yet. The standards are high. Well, they exist.",
    "This table awaits its first contenders. I am in no hurry. I have eternity.",
    "Vacancies available: every position. Apply by being slightly less wrong than everyone else.",
  ],
  emptyArchive: [
    "The Divine Archives are empty. No evaluation has closed yet. History has yet to embarrass itself.",
    "Nothing archived yet. The shelves are spotless. Enjoy it while it lasts.",
    "No closed evaluations to show. The official record of human folly begins shortly.",
    "The archives await their first entry. The filing cabinets are trembling with anticipation.",
  ],
  emptyHistory: [
    "You have no history yet. A clean record. It will not stay that way.",
    "Your file is empty. I have never seen a human so unblemished, or so uninvolved.",
    "No judgements on record. Answer today's evaluation and we can begin the paperwork.",
    "Nothing to show yet. Your legacy is, at present, a blank page and a pending form.",
  ],
  noVotesOnClosed: [
    "Nobody answered this evaluation. Not one vote. The silence was, for once, unanimous.",
    "This evaluation closed without a single vote. There are no results to reveal.",
    "Zero participants. Humanity skipped this one entirely. The absence has been noted.",
    "No votes were cast. There is nothing to report, which is a rare relief.",
  ],
  noQuestionToday: [
    "No evaluation has been scheduled today. The paperwork was delayed. A sternly worded memo is being drafted.",
    "There is no question today. The relevant form was not filed in triplicate. Someone will hear about this.",
    "Today's dilemma is stuck in administrative review. Please return tomorrow.",
    "No evaluation today. The Department of Scheduling is having one of its days.",
    "Today's question has not been issued. I blame a clerical oversight, and you, slightly.",
  ],
  awaitingHumanityIndex: [
    "AWAITING HUMANITY'S FIRST MISTAKE.",
    "Insufficient data. The Humanity Repair Status™ cannot be calculated from so little evidence.",
    "The index is pending. Humanity has not yet been measured, only suspected.",
    "Not enough results to compute repair status. The damage assessment continues.",
  ],
  loading: [
    "Consulting the cosmic ledger…",
    "Reviewing your file…",
    "Stamping forms in triplicate…",
    "Summoning the archivist…",
    "Calculating your disappointment…",
    "Auditing humanity…",
    "Locating the correct department…",
    "Polishing the verdict…",
  ],
  error: [
    "An unexpected error occurred. Naturally, I blame humanity.",
    "Something went wrong on our side. Please try again. I am already blaming an intern.",
    "The request failed. The Department of Technical Matters has been notified. Please try again shortly.",
    "An error occurred and your request was not completed. This is entirely someone else's fault.",
    "The system has stumbled. Not me. The system. Please try again in a moment.",
    "Your request could not be processed. Please reload the page. I have requested a stern report.",
  ],
  notFound: [
    "This page does not exist. Like most arguments, it collapsed under examination.",
    "Page not found. I have searched the entire cosmos. It is not here.",
    "Nothing exists at this address. Even I cannot judge what is not there.",
    "This page has been lost, misfiled or never created. The archives deny all knowledge.",
    "A rare moment of agreement between me and the universe: there is nothing here.",
  ],
  rateLimited: [
    "Too many requests. Slow down. Eternity is long; there is no need to rush it.",
    "You are submitting faster than I can disapprove. Please wait a moment and try again.",
    "Request limit reached. Take a breath. Humans need those, I am told.",
    "The queue is entirely full of you. Kindly wait before trying again.",
    "Easy. Even divine bureaucracy has a processing speed. Try again shortly.",
  ],
  alreadyVoted: [
    "You have already voted today. Your original vote stands. Second thoughts are not admissible.",
    "Duplicate submission refused. Your first answer remains on record, for better or worse.",
    "One vote per subject. Your earlier judgement stands, regrettable as it may be.",
    "Nice try. Your original vote and prediction remain exactly as filed.",
    "You cannot vote twice. Your original vote stands, preserved in amber.",
  ],
  closedEvaluation: [
    "This evaluation is not accepting votes. The window has closed, and I do not reopen windows.",
    "Voting is closed for this evaluation. Your opinion arrives too late to matter. As usual.",
    "This evaluation is no longer active. Please direct your judgement to today's question.",
    "Too late. The ballot box has been sealed, stamped and archived.",
    "You cannot vote on this evaluation. It is not open. Kindly respect the calendar.",
  ],
  invalidSubmission: [
    "Invalid submission. Choose one of the two options and a prediction between 0 and 100.",
    "That submission makes no sense, which is impressive given there are only two options.",
    "Your answer was rejected. Please pick an option and predict a percentage from 0 to 100.",
    "The form was filled in incorrectly. Please select an option and enter a valid percentage.",
    "Submission refused. The Department of Valid Inputs could not locate a valid input.",
  ],
  challengeRequired: [
    "Unusual activity detected. Please confirm you are human. I know. I am disappointed too.",
    "A quick verification is required before I accept this. Please prove you are a person, not a script.",
    "Your traffic looks suspicious. Complete the human check to continue.",
    "Before proceeding, confirm your humanity. A low bar, but a bar nonetheless.",
  ],
  authEmailSent: [
    "A sign-in link has been sent to your email. Click it to enter. No password required, nor trusted.",
    "Check your inbox. A sign-in link is on its way. It will expire, as all things do.",
    "The sign-in link has been emailed. If it is missing, check your spam folder. Things hide there.",
    "A link to sign in has been emailed to you. Open it to continue.",
    "Email sent. Follow the link inside to sign in. The Division awaits.",
  ],
  authSuccess: [
    "You are signed in. Your file has been retrieved from the archives.",
    "Identity confirmed. Welcome back to the Humanity Repair Division.",
    "Signed in. I now know exactly whom to blame.",
    "Access granted. Do try to behave.",
    "{subject}, you are signed in. Your judgements will now follow you everywhere.",
    "Authentication successful. A rare instance of something working as intended.",
  ],
  accountCreated: [
    "Your existence has been registered. Unfortunately.",
    "Account created. You are now officially on the books. The books are very thick.",
    "Welcome, registered subject. Your paperwork is complete. Your redemption is not.",
  ],
  signedOut: [
    "You are signed out. The Division will continue to judge you in your absence.",
    "Signed out. Your file has been returned to the cabinet.",
    "Session ended. Go outside. Make some decisions. I will hear about them.",
    "You have left. The room feels marginally more competent already.",
    "Signed out successfully. Your judgements remain on record.",
  ],
  guestMerged: [
    "Your anonymous history has been merged into your account. Every past decision is now formally yours.",
    "Guest records combined with your account. Your earlier choices can no longer claim to be strangers.",
    "Merge complete. Your history from this device now lives in your account.",
    "The anonymous subject and the registered subject are one. I suspected as much.",
  ],
  dataExported: [
    "Your personal data export has been downloaded. It contains everything held about you. Read it slowly.",
    "Data export complete. A copy of your records is now on your device.",
    "Here is your data. All of it. Consider it a full confession, written by you.",
    "Your export has been generated and downloaded. The originals remain filed until you decide otherwise.",
  ],
  accountDeletion: [
    "Your resignation from existence has been noted. Your account, however, can actually be deleted.",
    "Deleting your account is permanent. Once it is gone, even I cannot bring it back.",
    "Your account has been deleted. You are free. I shall manage, somehow.",
    "Account deletion is irreversible. Please be sure. I, for one, am never unsure.",
  ],
  adminWelcome: [
    "Administrator detected. Please wipe your feet before touching the cosmic machinery.",
    "Welcome to the admin console. Every change you make here is your responsibility. I have it in writing.",
    "Ah, management. Try not to schedule anything I will regret.",
    "{subject}, you have administrative access. Use it as wisely as a human can, which is to say carefully.",
  ],
  scheduleGap: [
    "Future days without a scheduled question detected. Humanity cannot be expected to fail unsupervised.",
    "Gaps in the schedule. Empty days are where civilisations go to waste time. Please fill them.",
    "Some upcoming days have no evaluation. The Department of Scheduling awaits your input.",
    "Unscheduled days ahead. I do not tolerate idle subjects. Add a question.",
  ],
} as const satisfies Record<string, readonly string[]>;

export type DeitySituation = keyof typeof DEITY_LINES;

/** Optional editorial events keyed by the day number of operation (day 1 = first published evaluation). */
export const EDITORIAL_EVENTS: readonly { day: number; title: string; message: string }[] = [
  {
    day: 1,
    title: "MEMO 001: INITIAL ASSESSMENT",
    message: "I have accepted responsibility for humanity. This may have been a mistake.",
  },
  {
    day: 2,
    title: "MEMO 002: FOLLOW-UP OBSERVATIONS",
    message: "Day two. The subjects came back. Nobody warned me they would come back.",
  },
  {
    day: 3,
    title: "MEMO 003: PRELIMINARY FINDINGS",
    message: "Three days of data. Early trends suggest humans prefer whichever option requires less effort.",
  },
  {
    day: 7,
    title: "REPORT 007: FIRST WEEKLY REVIEW",
    message: "One week of observation. The situation is worse than anticipated.",
  },
  {
    day: 14,
    title: "REPORT 014: FORTNIGHTLY AUDIT",
    message: "Two weeks in. The Department of Poor Decisions has formally requested additional staff.",
  },
  {
    day: 30,
    title: "REPORT 030: MONTHLY REVIEW",
    message: "Thirty days. Not one convincing argument for your continued existence.",
  },
  {
    day: 50,
    title: "MEMO 050: HALF-CENTURY NOTICE",
    message: "Fifty evaluations filed. The cabinet is groaning, and so am I.",
  },
  {
    day: 100,
    title: "INQUIRY 100: OFFICIAL INVESTIGATION",
    message: "Official investigation launched: Why are humans like this?",
  },
  {
    day: 180,
    title: "REPORT 180: SIX-MONTH STATUS",
    message: "Six months of repair work. Humanity remains under warranty. I have read the small print.",
  },
  {
    day: 365,
    title: "ANNUAL REPORT: YEAR ONE",
    message: "One full year of observation. Progress was detected. I had to measure it with tweezers.",
  },
];
