import json, random, re

random.seed(23)

BANNED_WORDS = ["travel", "trip", "visit", "phone"]
BANNED_RE = re.compile(r"\b(" + "|".join(BANNED_WORDS) + r")\b", re.IGNORECASE)

def is_banned(phrase):
    return bool(BANNED_RE.search(phrase))

# First-message style: reference ONLY the stated interest on the profile,
# warm/personal tone, one easy question. {i} = the interest subject.

OPENERS = [
    "I noticed you like {i}.",
    "I noticed you love {i} — same here.",
    "I saw {i} on your profile and it made me smile.",
    "Your profile says you love {i}, and honestly, same.",
    "I couldn't help but notice you like {i}.",
    "I saw that you like {i} and had to say hi.",
    "Noticed {i} on your profile — instant respect.",
    "I saw {i} listed on your profile.",
    "Your interest in {i} caught my eye.",
    "I noticed {i} on your profile.",
    "Saw {i} on your profile — had to reach out.",
    "Your profile mentions {i}, and I had questions.",
    "I came across {i} on your profile and smiled.",
    "I noticed you enjoy {i}.",
    "Heads up, I saw {i} on your profile and I'm intrigued.",
    "I saw {i} on your profile and it made me feel happy so I had to text.",
    "I noticed {i} on your profile and knew I had to say hi.",
    "I came across {i} on your profile and it made my day.",
    "I saw {i} listed on your profile and had to reach out.",
    "I saw {i} on your profile — my day got better.",
    "Your love of {i} is adorable.",
]

# Broad, general interests for the "General" category — each one IS the
# stated interest, nothing more specific.
GENERAL_INTERESTS = [
    "hiking",
    "coffee",
    "plants",
    "reading",
    "movies",
    "music",
    "cooking",
    "travel",
    "photography",
    "gaming",
    "fitness",
    "yoga",
    "art",
    "dancing",
    "writing",
    "meditation",
    "camping",
    "fishing",
    "cycling",
    "running",
    "painting",
    "pottery",
    "sewing",
    "knitting",
    "board games",
    "chess",
    "puzzles",
    "anime",
    "podcasts",
    "journaling",
    "sketching",
    "thrifting",
    "streetwear",
    "sneakers",
    "watch collecting",
    "comics",
    "true crime",
    "history",
    "space",
    "cars",
    "motorcycles",
    "baking",
    "gardening",
    "beach days",
    "road trips",
    "vinyl records",
    "concerts",
    "museums",
    "theater",
    "stand-up comedy",
    "swimming",
    "wildlife",
    "the outdoors",
    "food",
    "home decor",
    "candles",
    "astrology",
    "birdwatching",
    "stargazing",
    "surfing",
    "skateboarding",
    "skiing",
    "rock climbing",
    "kayaking",
    "scuba diving",
    "volunteering",
    "coding",
    "woodworking",
    "calligraphy",
    "juggling",
    "magic tricks",
    "improv",
    "screenwriting",
    "filmmaking",
    "streaming",
    "esports",
    "geocaching",
    "beekeeping",
    "fermentation",
    "sourdough",
    "homebrewing",
    "coffee roasting",
    "tea blending",
    "chocolate making",
    "ice cream making",
    "bread baking",
    "cake decorating",
    "pasta making",
    "sushi rolling",
    "pizza making",
    "ramen making",
    "bbq",
    "smoking meats",
    "fermented foods",
    "meal prepping",
    "food photography",
    "plant care",
    "terrariums",
    "bonsai",
    "succulents",
    "houseplants",
    "floral arranging",
    "candle making",
    "soap making",
    "resin art",
    "diamond painting",
    "cross-stitch",
    "embroidery",
    "crochet",
    "nail art",
    "mehndi",
    "temporary tattoos"
]

GENERAL_QUESTIONS = [
    "what got you into it?",
    "what's the best part about it for you?",
    "how long have you been into it?",
    "what's your favorite thing about it?",
    "what's one thing you love most about it?",
    "what would you tell someone new to it?",
    "what's your go-to way to enjoy it?",
    "what's the best memory tied to it?",
    "what's something people get wrong about it?",
    "what's your favorite part of the routine?",
    "what do you love most about it?",
    "what's the coolest thing about it?",
    "what's one thing you'd change about it?",
    "what's your proudest moment with it?",
    "what's the best thing that's come out of it?",
    "what do you wish more people knew?",
    "what's your favorite thing about it lately?",
    "what's a challenge you've overcome with it?",
    "what's the most fun version of it?",
    "what's your ideal way to do it?",
    "what's one thing you could talk about all day?",
    "what made you fall for it?",
    "what's the best thing you have or do with it?",
    "what's your happy place when you do it?",
    "what's the last thing you enjoyed about it?",
    "what's your favorite thing about doing it?",
    "what's one thing you could miss most?",
    "what's your favorite memory?",
    "what's the best part of your week because of it?",
    "what's something small but great about it?",
    "what's your favorite thing about the community around it?",
    "what's one thing about it that surprised you?",
    "what's your favorite way to unwind with it?",
    "what's the best advice you've gotten about it?",
    "what's something you've learned from it?",
    "what's the most underrated part of it?",
    "what's your dream version of it?",
    "what's the funniest moment you've had with it?",
    "what's your favorite thing about it right now?",
]

CATEGORIES = {
"tv": {
    "subjects": ["TV shows", "binge-watching", "TV", "movies and shows", "watchlists", "comfort shows"],
    "questions": [
        "what show could you watch on repeat forever?",
        "what's a show that always makes you laugh?",
        "what are you watching right now?",
        "what's the last show that kept you up way too late?",
        "what's your guilty-pleasure show?",
        "what's a show you'd recommend to literally anyone?",
        "what's the best episode you've seen lately?",
        "what do you love most about watching shows?",
        "are you a one-episode-at-a-time person or a full binge?",
        "what's your favorite way to watch — alone or with someone?",
        "what show made you cry recently?",
        "what's the funniest show you've ever seen?",
        "what's a show everyone loves but you can't get into?",
        "what's your comfort show for a rough day?",
        "what's the best thing about having a watchlist?",
        "what show do you think about when you can't sleep?",
        "what's your favorite genre to fall into?",
        "what's a show you started and immediately loved?",
        "what's the best recommendation you've gotten recently?",
        "what's a show that surprised you?",
        "what do you miss most when you're not watching?",
        "what's your go-to show when you need something familiar?",
        "what's the best show you've seen this year?",
        "what makes a show a keeper for you?",
        "what's a show you'd watch a hundred times?",
        "what's your favorite kind of character?",
        "what's the best twist you've seen on TV?",
        "what show would you pick for a first date?",
        "what's a show that taught you something?",
        "what's the most rewatchable show in your opinion?",
        "what's your favorite thing about binge-watching?",
        "what's a show everyone should watch at least once?",
        "what's the best show you've seen with someone else?",
        "what's a show that feels like home?",
        "what's your favorite thing about TV nights?",
        "what's a show you could talk about all day?",
        "what's the best show you've discovered recently?",
        "what's a show you love that others don't get?",
        "what's the funniest character you've seen lately?",
        "what's your favorite thing about a good story?",
    ]
},
"cars": {
    "subjects": ["cars", "driving", "car culture", "old cars", "weekend drives"],
    "questions": [
        "what's your car's name (if it has one)?",
        "what do you love most about driving?",
        "what's the best road trip memory you have?",
        "what's your dream car?",
        "are you more into old cars or new ones?",
        "what's the first car you ever owned?",
        "what's your go-to driving playlist like?",
        "what's the best thing about car rides for you?",
        "do you prefer driving or being driven?",
        "what's the most memorable car you've been in?",
        "what's your favorite kind of car and why?",
        "what's the best car fact you know?",
        "what's a car you'd love to own someday?",
        "what's the best part of a long drive?",
        "what's your favorite thing to do in a car?",
        "do you judge cars or just appreciate them?",
        "what's the best car you've ever ridden in?",
        "what's your ideal weekend drive?",
        "what's the funniest thing that's happened in your car?",
        "what's your favorite thing about car people?",
        "what do you miss most about driving?",
        "what's the best car smell — new car or old car?",
        "what's a car you'd never want to drive?",
        "what's your favorite thing about your own car?",
        "what's the best passenger seat view you've had?",
        "what's a car memory from your childhood?",
        "what's your favorite thing about vintage cars?",
        "what's the most spontaneous drive you've taken?",
        "what's your dream road trip?",
        "what's the best thing about having car friends?",
        "what's your favorite thing to do on a road trip?",
        "what's a car you see on the road and smile?",
        "what's your favorite thing about car culture?",
        "what's the best car you've ever detailed or cleaned?",
        "what's your go-to car radio station or playlist?",
        "what's a car you'd take on a desert island?",
    ]
},
"cooking": {
    "subjects": ["cooking", "baking", "home cooking", "food", "weeknight dinners"],
    "questions": [
        "what's your go-to comfort dish?",
        "what do you love most about cooking?",
        "what's the best thing you've ever made?",
        "are you a recipe-follower or a freestyle cook?",
        "what's your signature dish?",
        "what's the most surprising thing you've learned in the kitchen?",
        "what's your favorite thing to bake?",
        "what's a dish you could make with your eyes closed?",
        "what's your kitchen's most-used tool?",
        "what's the best meal you've ever eaten that you made?",
        "what do you love most about baking?",
        "what's your favorite ingredient to cook with?",
        "what's the most fun you've had cooking?",
        "what's your favorite thing about weeknight dinners?",
        "what's a dish you wish you could eat every day?",
        "what's your comfort food and why?",
        "what's the best thing about cooking for someone?",
        "what's your favorite kitchen smell?",
        "what's a recipe you made up yourself?",
        "what's your favorite thing about food?",
        "what's the best meal you've ever had?",
        "what's your ideal Sunday cook?",
        "what's the most impressive thing you've cooked?",
        "what's your favorite thing about home cooking?",
        "what's a dish you could eat a hundred times?",
        "what's your favorite thing about trying new recipes?",
        "what's the best thing that's come out of your cooking?",
        "what's your go-to meal when you're short on time?",
        "what's your favorite thing about baking vs cooking?",
        "what's a dish that always turns out perfectly?",
        "what's your favorite thing about sharing food?",
        "what's the best thing you've eaten recently?",
        "what's your favorite thing about a good home-cooked meal?",
        "what's a dish you could eat for breakfast, lunch, and dinner?",
        "what's your favorite thing about cooking with someone?",
        "what's the best thing about a full kitchen?",
        "what's your dream dish to master?",
        "what's your favorite thing about comfort food?",
    ]
},
"music": {
    "subjects": ["music", "live music", "concerts", "playlists", "music discovery"],
    "questions": [
        "what's a song that always lifts your mood?",
        "what's your favorite way to listen to music?",
        "what's the last concert you went to?",
        "what genre do you reach for most?",
        "what's a song you could listen to on repeat forever?",
        "do you prefer live music or studio recordings?",
        "what's your favorite thing about live shows?",
        "what's a song that reminds you of someone?",
        "what's your go-to workout or focus playlist vibe?",
        "what's the best music you've heard lately?",
        "what's your favorite thing about music discovery?",
        "what's a song you love that others don't get?",
        "what's your favorite thing about concerts?",
        "what's a song that makes you feel unstoppable?",
        "what's your music taste in three words?",
        "what's the best live performance you've seen?",
        "what's your favorite thing about playlists?",
        "what's a song you'd dedicate to a stranger?",
        "what's the most underrated artist you love?",
        "what's your favorite thing about music festivals?",
        "what's a song that always brings back memories?",
        "what's your favorite thing about singing in the car?",
        "what's the best song you've heard this week?",
        "what's your favorite thing about discovering new music?",
        "what's a song you love that surprises people?",
        "what's your favorite thing about live bands?",
        "what's the best concert experience you've had?",
        "what's your favorite thing about music videos?",
        "what's a song you'd play at your own wedding?",
        "what's your favorite thing about oldies vs new releases?",
        "what's the most-played song on your playlist?",
        "what's your favorite thing about music that makes you dance?",
        "what's a song you love that you'd never admit to?",
        "what's your favorite thing about a good beat?",
        "what's the best thing about live music energy?",
        "what's your favorite thing about music that tells a story?",
        "what's a song that defined a moment for you?",
    ]
},
"nature": {
    "subjects": ["nature", "outdoors", "hiking", "wildlife", "camping", "the great outdoors"],
    "questions": [
        "what's your favorite place in nature?",
        "what do you love most about the outdoors?",
        "what's the most beautiful thing you've seen outside?",
        "are you more of a hiker or a beach person?",
        "what's your favorite outdoor activity?",
        "what's the best thing about being outside for you?",
        "what's a nature memory you still think about?",
        "what's your favorite thing about the morning outdoors?",
        "what do you love most about camping?",
        "what's the best view you've ever seen?",
        "what's your favorite thing about wildlife?",
        "what's the most peaceful place you've been?",
        "what's your favorite thing about hiking?",
        "what's a nature sound you could listen to forever?",
        "what's your favorite thing about the seasons?",
        "what's the best thing about a day outside?",
        "what's your favorite thing about stargazing?",
        "what's a place in nature you'd visit a hundred times?",
        "what's the best thing about fresh air?",
        "what's your favorite thing about the ocean?",
        "what's a nature spot close to home you love?",
        "what's your favorite thing about flowers?",
        "what's the best thing about a sunrise or sunset?",
        "what's your favorite thing about mountains?",
        "what's a nature experience that changed you?",
        "what's your favorite thing about rain or snow outside?",
        "what's the best thing about being barefoot outside?",
        "what's your favorite thing about birds or animals in the wild?",
        "what's a place in nature you want to visit?",
        "what's your favorite thing about the smell of nature?",
        "what's the most beautiful thing nature has shown you?",
        "what's your favorite thing about a quiet trail?",
        "what's the best thing about camping under the stars?",
        "what's your favorite thing about the beach?",
        "what's a nature moment that made you stop and stare?",
        "what's your favorite thing about the forest?",
        "what's the best thing about watching wildlife?",
        "what's your favorite thing about the great outdoors?",
    ]
},
"pets": {
    "subjects": ["pets", "dogs", "cats", "animals", "pet parents"],
    "questions": [
        "what's something your pet does that you completely adore?",
        "what's your pet's name and what's their personality like?",
        "what's the funniest thing your pet has done lately?",
        "do you have a pet or are you a proud pet parent in spirit?",
        "what's your pet's favorite thing to do?",
        "what's one thing about your pet that always makes you laugh?",
        "how did you end up with your pet?",
        "what's the best part of having a pet for you?",
        "what's your pet's go-to spot in the house?",
        "what's a small thing your pet does that melts your heart?",
        "if your pet could talk, what do you think they'd say?",
        "what's the most playful thing your pet does?",
        "what's your pet's favorite treat or toy?",
        "what's the cutest habit your pet has?",
        "do you and your pet have any routines you both love?",
        "what's the best photo or memory you have with your pet?",
        "what does your pet do when you're not home?",
        "what's your pet's most dramatic moment?",
        "what's one thing your pet does that no one expects?",
        "what's your favorite thing about your pet's personality?",
        "how would you describe your pet in three words?",
        "what's the weirdest thing your pet has done?",
        "what's your pet's favorite place to nap?",
        "what's a trait your pet has that you wish you had?",
        "what's the best adventure you've had with your pet?",
        "what does your pet do to get your attention?",
        "what's your pet's go-to move when they want something?",
        "what's the most heartwarming thing your pet does?",
        "if you could ask your pet one question, what would it be?",
        "what's your pet's favorite time of day and why?",
        "what's the funniest name or nickname you have for your pet?",
        "what's your pet's superpower?",
        "what's one thing about pets that still amazes you?",
        "what's the best thing about being a pet owner?",
        "what's your pet's favorite human (besides you, obviously)?",
        "what's a little ritual you and your pet share?",
        "what's the most spontaneous thing your pet has done?",
        "what's your pet's favorite outdoor spot?",
        "what's one thing you'd tell someone who's thinking about getting a pet?",
        "what's the best thing about animals in general?",
        "what's your favorite thing about pet people?",
    ]
},
"photography": {
    "subjects": ["photography", "taking photos", "photo editing", "cameras", "photo walks"],
    "questions": [
        "what do you love most about photography?",
        "what's your favorite thing to photograph?",
        "what's the best photo you've ever taken?",
        "what's your favorite thing about golden hour?",
        "are you more into portraits or landscapes?",
        "what's your favorite thing about your camera?",
        "what's a photo that always makes you smile?",
        "what's your favorite thing about editing photos?",
        "what's the best thing about photography walks?",
        "what's your favorite thing to capture?",
        "what's a photo you'd love to take someday?",
        "what's a photo you'd frame and hang on your wall?",
        "what's your favorite thing about your photography hobby?",
        "what's the best lighting you've ever caught on camera?",
        "what's your favorite thing about black and white photos?",
        "what's a photo you took that you're proud of?",
        "what's your favorite thing about photo prints?",
        "what's the best thing about taking photos of people?",
        "what's your favorite thing about your favorite camera?",
        "what's a place you'd love to photograph?",
        "what's your favorite thing about capturing moments?",
        "what's the best photo you've ever taken of someone you love?",
        "what's your favorite thing about sunset photos?",
        "what's a photo that tells a story?",
        "what's your favorite thing about photography as an art?",
        "what's the most beautiful thing you've captured?",
        "what's your favorite thing about your photo collection?",
        "what's a photo you could look at all day?",
        "what's your favorite thing about photography challenges?",
        "what's the best thing about having a camera with you?",
        "what's your favorite thing about candid moments?",
        "what's a photo you took on a trip that you love?",
        "what's your favorite thing about your favorite lens or filter?",
        "what's the best photo you've ever gotten someone to take of you?",
        "what's your favorite thing about photography that no one expects?",
        "what's a photo you'd show someone to prove your point?",
        "what's the best thing about a good photograph?",
        "what's your favorite thing about the photos on your phone?",
        "what's a photo you took that surprised you?",
        "what's your favorite thing about photography that you can't explain?",
    ]
},
"reading": {
    "subjects": ["reading", "books", "book clubs", "audiobooks", "page-turners"],
    "questions": [
        "what's a book you could reread forever?",
        "what do you love most about reading?",
        "what's the best book you've read recently?",
        "what genre do you reach for most?",
        "what's your favorite thing about a good book?",
        "are you a slow reader or a speed reader?",
        "what's a book that changed how you see things?",
        "what's your favorite thing about bookstores?",
        "what's the best book you've ever finished?",
        "what's your go-to reading spot?",
        "what's a book you love that others don't get?",
        "what's your favorite thing about reading before bed?",
        "what's the best character you've ever met in a book?",
        "what's your favorite thing about discovering new books?",
        "what's a book you'd recommend to anyone?",
        "what's your favorite thing about audiobooks?",
        "what's a book that made you laugh out loud?",
        "what's your favorite thing about a good plot twist?",
        "what's the best book you've read this year?",
        "what's your favorite thing about reading on a rainy day?",
        "what's a book you can't stop thinking about?",
        "what's your favorite thing about your favorite author?",
        "what's the best opening line you've ever read?",
        "what's your favorite thing about finishing a great book?",
        "what's a book you'd love to see as a movie?",
        "what's your favorite thing about reading with someone?",
        "what's the most underrated book you've read?",
        "what's your favorite thing about a book series?",
        "what's a book that felt like a hug?",
        "what's your favorite thing about reading in a new place?",
        "what's the best book you've ever lent to someone?",
        "what's your favorite thing about finding a hidden gem?",
        "what's a book that taught you something?",
        "what's your favorite thing about a book you can't put down?",
        "what's the best book you've read on vacation?",
        "what's your favorite thing about your favorite genre?",
        "what's a book that surprised you?",
        "what's your favorite thing about reading stories that aren't yours?",
    ]
},
"travelling": {
    "subjects": ["getaways", "new places", "weekend escapes", "adventures", "exploring"],
    "questions": [
        "what's your favorite getaway you've ever had?",
        "where would you go if you could go anywhere tomorrow?",
        "what's the best thing about getting away for you?",
        "what's your dream destination?",
        "are you more of a planner or a spontaneous explorer?",
        "what's the most beautiful place you've ever seen?",
        "what's your favorite thing about a new city?",
        "what's the best getaway memory you have?",
        "what's your favorite kind of escape?",
        "what's the best thing about a weekend getaway?",
        "what's a place you want to see someday?",
        "what's your favorite thing about trying new food while you're away?",
        "what's the best view you've ever seen?",
        "what's your favorite thing about exploring solo?",
        "what's a moment away that made you feel alive?",
        "what's your favorite thing about capturing memories through photos?",
        "what's the best thing about a beach escape?",
        "what's your favorite thing about city breaks?",
        "what's a place you'd return to a hundred times?",
        "what's your favorite thing about adventure stories?",
        "what's the most underrated place you've been?",
        "what's your favorite thing about long drives?",
        "what's the best thing about waking up somewhere new?",
        "what's an adventure challenge you've overcome?",
        "what's your favorite thing about a good hotel or Airbnb?",
        "what's the best meal you've had while you're away?",
        "what's your favorite thing about backpacking?",
        "what's a destination that surprised you?",
        "what's your favorite thing about a sunset somewhere beautiful?",
        "what's the best thing about a spontaneous detour?",
        "what's your favorite thing about escaping with friends vs solo?",
        "what's a place you went that didn't live up to the hype?",
        "what's your favorite thing about a journal or photos from your adventures?",
        "what's the best thing about a long train ride?",
        "what's your favorite thing about a new culture?",
        "what's an adventure moment you'd relive forever?",
        "what's your favorite thing about being a tourist?",
        "what's the best thing about exploring that money can't buy?",
        "what's a place you'd love to retire or live someday?",
        "what's your favorite thing about wanderlust?",
    ]
},
"dancing": {
    "subjects": ["dancing", "dance", "dance moves", "the dance floor", "dance classes"],
    "questions": [
        "what's your favorite thing to dance to?",
        "what got you into dancing?",
        "what's your favorite dance style?",
        "what's the best thing about dancing for you?",
        "do you dance alone or with a crew?",
        "what's your favorite place to dance?",
        "what's the most fun you've had dancing?",
        "what's your go-to dance move?",
        "what's a dance you'd do a hundred times?",
        "what's your favorite thing about dance music?",
        "what's the best dance you've ever learned?",
        "what's your favorite thing about the dance floor?",
        "what style would you love to learn?",
        "what's your favorite thing about dancing at a party?",
        "what's the funniest dance moment you've had?",
        "what's your favorite thing about dancing with someone?",
        "what's a song that makes you want to dance?",
        "what's your favorite thing about dance challenges?",
        "what's the best thing about moving to music?",
        "what's your favorite thing about learning a new routine?",
        "what's a dance you could watch forever?",
        "what's your favorite thing about dance classes?",
        "what's the best thing about dancing when no one's watching?",
        "what's your favorite thing about a good dance battle?",
        "what's a dance move that always makes you laugh?",
        "what's your favorite thing about the energy at a club or party?",
        "what's the best dance you've ever seen?",
        "what's your favorite thing about dancing to your favorite song?",
        "what's a dance you'd love to perform someday?",
        "what's your favorite thing about a dance routine that clicks?",
        "what's the most fun version of dancing you've had?",
        "what's your favorite thing about dancing with friends?",
        "what's a dance style you've always wanted to try?",
        "what's your favorite thing about the freedom of dancing?",
        "what's the best thing about a dance that makes you feel like yourself?",
        "what's your favorite thing about a dance that everyone knows?",
        "what's a dance you'd teach someone new?",
        "what's your favorite thing about dancing at golden hour?",
    ]
},
"arts": {
    "subjects": ["art", "painting", "drawing", "creative projects", "gallery hops"],
    "questions": [
        "what's your favorite medium to work with?",
        "what do you love most about making art?",
        "what's the best piece you've ever made?",
        "are you more into painting or drawing?",
        "what's your go-to subject to create?",
        "what's the most fun you've had being creative?",
        "what do you love most about art?",
        "what's a piece of art you could stare at all day?",
        "what's your favorite thing about galleries or museums?",
        "what's the best art memory you have?",
        "what made you start getting into art?",
        "what's your favorite thing about your creative process?",
        "what's a style you wish you could try?",
        "what's the most meaningful art you've made?",
        "what do you love most about sharing your art?",
        "what's your favorite thing about color or texture?",
        "what's a piece of art that changed how you see things?",
        "what's the best thing about making something from scratch?",
        "what's your favorite thing about art supplies or tools?",
        "what's a creative project you're proud of?",
        "what do you love most about art communities or classes?",
        "what's the funniest art mishap you've had?",
        "what's your favorite thing about art that isn't perfect?",
        "what's a piece of art you'd love to own someday?",
        "what do you love most about the act of creating?",
        "what's your favorite thing about art that makes you happy?",
        "what's the best compliment you've gotten on your art?",
        "what's a creative challenge you've overcome?",
        "what's your favorite thing about art that tells a story?",
        "what's the most surprising thing about your art process?",
        "what do you love most about art that feels personal?",
        "what's your favorite thing about art that you can touch?",
        "what's a creative routine you enjoy?",
        "what's the best art you've seen recently?",
        "what do you love most about art that feels timeless?",
    ]
},
"gardening": {
    "subjects": ["gardening", "plants", "herbs", "vegetables", "flower beds"],
    "questions": [
        "what's your favorite thing to grow?",
        "what do you love most about gardening?",
        "what's the best thing you've grown?",
        "are you more into flowers or vegetables?",
        "what's your go-to plant or herb?",
        "what's the most satisfying part of gardening?",
        "what do you love most about being outside in the garden?",
        "what's the best garden memory you have?",
        "what made you start gardening?",
        "what's your favorite thing about planting season?",
        "what's a plant you've killed and learned from?",
        "what's your favorite thing about fresh herbs or produce?",
        "what's the most beautiful thing in your garden?",
        "what do you love most about garden design or layout?",
        "what's a gardening challenge you've overcome?",
        "what's your favorite thing about watching something grow?",
        "what's the best thing about gardening for you?",
        "what's a garden project you're proud of?",
        "what do you love most about gardening with others?",
        "what's your favorite thing about garden pests or problems?",
        "what's the best harvest or bloom you've had?",
        "what do you love most about the smell of a garden?",
        "what's your favorite thing about a quiet garden morning?",
        "what's a plant you'd love to grow someday?",
        "what do you love most about gardening that relaxes you?",
        "what's your favorite thing about compost or soil?",
        "what's the most fun garden task for you?",
        "what's a gardening mistake you still laugh about?",
        "what do you love most about gardening as a hobby?",
        "what's your favorite thing about a garden that feels like home?",
        "what's the best thing about gardening in different seasons?",
        "what do you love most about garden wildlife or pollinators?",
        "what's a garden tool or gadget you love?",
        "what's your favorite thing about a garden that changes over time?",
        "what's the most rewarding gardening moment you've had?",
        "what do you love most about gardening that teaches patience?",
    ]
},
"fishing": {
    "subjects": ["fishing", "angling", "fly fishing", "lake days", "catch and release"],
    "questions": [
        "what's your favorite way to fish?",
        "what do you love most about fishing?",
        "what's the best catch you've ever had?",
        "are you more into lake fishing or ocean fishing?",
        "what's your go-to bait or lure?",
        "what's the most peaceful part of fishing for you?",
        "what do you love most about being by the water?",
        "what's the best fishing memory you have?",
        "what made you start fishing?",
        "what's your favorite thing about early mornings on the water?",
        "what's a fishing story you love telling?",
        "what's your favorite thing about the quiet on the water?",
        "what's the most challenging fish you've caught?",
        "what do you love most about fishing with friends?",
        "what's your favorite thing about fishing that isn't about catching?",
        "what's a fishing spot you'd return to?",
        "what's the best thing about fishing that relaxes you?",
        "what's your favorite thing about fishing gear or tackle?",
        "what's a fish you'd love to catch someday?",
        "what do you love most about fishing that gets you outside?",
        "what's the most fun fishing moment you've had?",
        "what's your favorite thing about fishing that tests your patience?",
        "what's a fishing memory that still makes you smile?",
        "what do you love most about fishing that you can't explain?",
        "what's your favorite thing about fishing that feels like an escape?",
        "what's the best thing about fishing that you do for yourself?",
        "what's a fishing technique you'd love to learn?",
        "what do you love most about fishing that connects you to nature?",
        "what's your favorite thing about fishing that feels rewarding?",
        "what's the most underrated part of fishing?",
        "what's a fishing tradition you enjoy?",
        "what do you love most about fishing that makes you feel alive?",
        "what's your favorite thing about fishing that you wish more people tried?",
        "what's a fishing challenge you're working on?",
        "what do you love most about fishing that you could do for hours?",
        "what's your favorite thing about fishing that feels timeless?",
    ]
},
"fitness": {
    "subjects": ["fitness", "workouts", "gym", "running", "yoga"],
    "questions": [
        "what's your favorite way to move?",
        "what do you love most about fitness?",
        "what's the best workout you've ever had?",
        "are you more into strength or cardio?",
        "what's your go-to workout routine?",
        "what's the most energizing part of exercising?",
        "what do you love most about feeling strong?",
        "what's the best fitness memory you have?",
        "what made you start getting into fitness?",
        "what's your favorite thing about working out consistently?",
        "what's a fitness goal you're proud of?",
        "what's your favorite thing about exercise that clears your head?",
        "what's the most fun workout you've tried?",
        "what do you love most about fitness that isn't about looks?",
        "what's your favorite thing about gym culture or classes?",
        "what's a fitness challenge you've overcome?",
        "what's the best thing about fitness for your mood?",
        "what's your favorite thing about fitness that you do for yourself?",
        "what's a workout you'd love to try someday?",
        "what do you love most about fitness that makes you feel capable?",
        "what's your favorite thing about fitness that builds discipline?",
        "what's the most surprising thing about fitness for you?",
        "what do you love most about fitness that feels empowering?",
        "what's your favorite thing about fitness that you can do anywhere?",
        "what's a fitness habit you never skip?",
        "what's the best thing about fitness that you love most?",
        "what's your favorite thing about fitness that feels like progress?",
        "what's a fitness milestone you're proud of?",
        "what do you love most about fitness that you enjoy?",
        "what's your favorite thing about fitness that makes you feel alive?",
        "what's the most underrated benefit of fitness for you?",
        "what's a fitness routine you could do every day?",
        "what do you love most about fitness that you look forward to?",
        "what's your favorite thing about fitness that challenges you?",
        "what's the best thing about fitness that you love most?",
        "what's one thing you'd tell someone new to fitness?",
    ]
},
"workout": {
    "subjects": ["working out", "the gym", "lifting", "cardio", "exercise"],
    "questions": [
        "what's your favorite workout to do?",
        "are you more into lifting weights or cardio?",
        "what's your go-to gym move?",
        "what's the best workout you've ever done?",
        "do you prefer morning or evening workouts?",
        "what's your favorite way to break a sweat?",
        "are you a gym person or do you work out at home?",
        "what's one exercise you could do forever?",
        "what's your favorite workout song or playlist?",
        "what's the hardest workout you've ever finished?",
        "do you like workout classes or solo sessions?",
        "what's your favorite muscle group to train?",
        "what made you start working out?",
        "what's your pre-workout ritual?",
        "are you more into strength training or endurance?",
        "what's your favorite thing about the burn?",
        "what's a workout you've been wanting to try?",
        "do you track your workouts or wing it?",
        "what's your favorite rest day activity?",
        "what's the best feeling after a good workout?",
        "are you a routine person or do you mix it up?",
        "what's your favorite way to stay motivated?",
        "what's one workout you never skip?",
        "what's your favorite gym or workout spot?",
        "what's the most surprising thing about working out for you?",
        "do you prefer short intense sessions or long ones?",
        "what's your favorite thing about feeling stronger?",
        "what's a workout goal you're working toward?",
        "what's your favorite thing about working out with a buddy?",
        "what do you love most about working out?",
        "what's your favorite way to cool down after?",
    ]
},
"astrology": {
    "subjects": ["astrology", "horoscopes", "star signs", "zodiac", "birth charts"],
    "questions": [
        "what's your zodiac sign?",
        "what do you love most about astrology?",
        "what's the most accurate reading you've gotten?",
        "are you more into horoscopes or birth charts?",
        "what's your go-to astrology topic?",
        "what's the most fun part of astrology for you?",
        "what do you love most about learning about stars?",
        "what's the best astrology memory you have?",
        "what made you start getting into astrology?",
        "what's your favorite thing about reading horoscopes?",
        "what's a sign you feel connected to?",
        "what's your favorite thing about astrology that feels personal?",
        "what's the most surprising thing astrology has told you?",
        "what do you love most about astrology that feels like fun?",
        "what's your favorite thing about compatibility readings?",
        "what's an astrology fact you love sharing?",
        "what's the best thing about astrology that you enjoy?",
        "what's a zodiac trait you relate to most?",
        "what do you love most about astrology that feels mystical?",
        "what's your favorite thing about astrology that sparks conversation?",
        "what's the most interesting astrology topic for you?",
        "what's your favorite thing about astrology that feels accurate?",
        "what's a sign you'd love to learn more about?",
        "what do you love most about astrology that feels timeless?",
        "what's your favorite thing about astrology that you check often?",
        "what's the best thing about astrology that you love most?",
        "what's an astrology question you always ask?",
        "what do you love most about astrology that feels like a game?",
        "what's your favorite thing about astrology that feels meaningful?",
        "what's the most fun astrology debate you've had?",
        "what's your favorite thing about astrology that you wish more people tried?",
        "what's a sign you have a soft spot for?",
        "what do you love most about astrology that feels like magic?",
        "what's your favorite thing about astrology that you could talk about all day?",
        "what's the best thing about astrology that you love most?",
        "what's one thing you'd tell someone who's skeptical about astrology?",
    ]
},
"soccer": {
    "subjects": ["soccer", "the beautiful game", "match days", "World Cup", "goals"],
    "questions": [
        "what's your favorite team or player?",
        "what do you love most about soccer?",
        "what's the best match you've ever watched?",
        "are you more into offense or defense?",
        "what's your go-to match day snack or tradition?",
        "what's the most exciting part of a soccer match?",
        "what do you love most about soccer that isn't the score?",
        "what's the best soccer memory you have?",
        "what made you start getting into soccer?",
        "what's your favorite thing about watching soccer with people?",
        "what's a soccer moment that gave you chills?",
        "what's your favorite thing about soccer that feels like tradition?",
        "what's the most fun soccer experience you've had?",
        "what do you love most about soccer that brings people together?",
        "what's your favorite thing about soccer that you could watch for hours?",
        "what's a soccer player you admire?",
        "what's the best thing about soccer that you love most?",
        "what's your favorite thing about soccer that feels cinematic?",
        "what's a soccer play you never get tired of?",
        "what do you love most about soccer that feels competitive?",
        "what's your favorite thing about soccer that feels nostalgic?",
        "what's the most underrated part of soccer?",
        "what's a soccer tradition you enjoy most?",
        "what do you love most about soccer that feels like community?",
        "what's your favorite thing about soccer that you could talk about all day?",
        "what's the best soccer season you've had as a fan?",
        "what's your favorite thing about soccer that feels electric?",
        "what's a soccer moment that made you smile?",
        "what do you love most about soccer that feels timeless?",
        "what's your favorite thing about soccer that you never get tired of?",
        "what's the most fun soccer debate you've had?",
        "what's your favorite thing about soccer that you wish more people understood?",
        "what's a soccer memory that still makes you smile?",
        "what do you love most about soccer that feels personal?",
        "what's your favorite thing about soccer that you look forward to?",
        "what's the best thing about soccer that you love most?",
        "what's one thing you'd tell someone who's never watched soccer?",
    ]
},
"baseball": {
    "subjects": ["baseball", "MLB", "batting practice", "game day", "little league"],
    "questions": [
        "what's your favorite team or player?",
        "what do you love most about baseball?",
        "what's the best game you've ever watched?",
        "are you more into pitching or batting?",
        "what's your go-to baseball snack or tradition?",
        "what's the most exciting part of a baseball game?",
        "what do you love most about baseball that isn't the score?",
        "what's the best baseball memory you have?",
        "what made you start getting into baseball?",
        "what's your favorite thing about watching baseball with people?",
        "what's a baseball moment that gave you chills?",
        "what's your favorite thing about baseball that feels like tradition?",
        "what's the most fun baseball experience you've had?",
        "what do you love most about baseball that brings people together?",
        "what's your favorite thing about baseball that you could watch for hours?",
        "what's a baseball player you admire?",
        "what's the best thing about baseball that you love most?",
        "what's your favorite thing about baseball that feels cinematic?",
        "what's a baseball play you never get tired of?",
        "what do you love most about baseball that feels competitive?",
        "what's your favorite thing about baseball that feels nostalgic?",
        "what's the most underrated part of baseball?",
        "what's a baseball tradition you enjoy most?",
        "what do you love most about baseball that feels like community?",
        "what's your favorite thing about baseball that you could talk about all day?",
        "what's the best baseball season you've had as a fan?",
        "what's your favorite thing about baseball that feels electric?",
        "what's a baseball moment that made you smile?",
        "what do you love most about baseball that feels timeless?",
        "what's your favorite thing about baseball that you never get tired of?",
        "what's the most fun baseball debate you've had?",
        "what's your favorite thing about baseball that you wish more people understood?",
        "what's a baseball memory that still makes you smile?",
        "what do you love most about baseball that feels personal?",
        "what's your favorite thing about baseball that you look forward to?",
        "what's the best thing about baseball that you love most?",
        "what's one thing you'd tell someone who's never watched baseball?",
    ]
}
}

COMPLIMENTS = {
"tv": [
    "People who love {i} always have the best recommendations",
    "There's something comforting about loving {i}",
    "Anyone who loves {i} has great taste",
    "It's easy to like someone who loves {i}",
    "People who love {i} make conversations better",
    "There's a certain charm to loving {i}",
    "Anyone into {i} seems to have a good vibe",
    "People who love {i} are easy to talk to",
],
"cars": [
    "People who love {i} really know how to enjoy the ride",
    "There's something cool about someone who loves {i}",
    "Anyone into {i} has a great eye for details",
    "People who love {i} always have a good story",
    "It's easy to respect someone who loves {i}",
    "There's a certain passion in people who love {i}",
    "Anyone who loves {i} seems to live life a little louder",
    "People who love {i} are always fun to talk to",
],
"cooking": [
    "People who cook are really amazing people",
    "There's something special about someone who loves {i}",
    "Anyone who loves {i} has great taste",
    "People who love {i} always know how to make a day better",
    "It's easy to like someone who loves {i}",
    "There's a certain warmth to loving {i}",
    "Anyone into {i} seems to have a good heart",
    "People who love {i} are easy to talk to",
],
"music": [
    "People who love {i} always have a great soundtrack",
    "There's something special about someone who loves {i}",
    "Anyone who loves {i} has great taste",
    "It's easy to like someone who loves {i}",
    "People who love {i} make every moment feel bigger",
    "There's a certain energy to loving {i}",
    "Anyone into {i} seems to have a good vibe",
    "People who love {i} are always fun to talk to",
],
"nature": [
    "People who love {i} always seem at peace",
    "There's something calming about loving {i}",
    "Anyone who loves {i} has a gentle heart",
    "It's easy to like someone who loves {i}",
    "People who love {i} always have a good story",
    "There's a certain beauty to loving {i}",
    "Anyone into {i} seems to have a good vibe",
    "People who love {i} are easy to talk to",
],
"pets": [
    "Pet parents are some of the kindest people",
    "Anyone who loves animals has a soft side",
    "There's something special about someone who adores pets",
    "It's easy to like someone who loves animals",
    "People who love pets always have the best stories",
    "There's a certain warmth to loving animals",
    "Anyone into pets seems to have a good vibe",
    "People who love animals are easy to talk to",
],
"photography": [
    "People who love {i} always see the world differently",
    "There's something special about someone who loves {i}",
    "Anyone who loves {i} has a great eye",
    "It's easy to like someone who loves {i}",
    "People who love {i} always have a story to tell",
    "There's a certain creativity to loving {i}",
    "Anyone into {i} seems to have a good vibe",
    "People who love {i} are easy to talk to",
],
"reading": [
    "People who love {i} always have a good story",
    "There's something special about someone who loves {i}",
    "Anyone who loves {i} has a great imagination",
    "It's easy to like someone who loves {i}",
    "People who love {i} always have a good book to recommend",
    "There's a certain curiosity to loving {i}",
    "Anyone into {i} seems to have a good vibe",
    "People who love {i} are easy to talk to",
],
"travelling": [
    "People who love {i} always have the best stories",
    "There's something exciting about loving {i}",
    "Anyone who loves {i} has a great eye for experiences",
    "It's easy to like someone who loves {i}",
    "People who love {i} always seem to have a good time",
    "There's a certain freedom to loving {i}",
    "Anyone into {i} seems to have a good vibe",
    "People who love {i} are easy to talk to",
],
"dancing": [
    "People who love {i} always have rhythm",
    "There's something special about someone who loves {i}",
    "Anyone who loves {i} has great energy",
    "It's easy to like someone who loves {i}",
    "People who love {i} always know how to have fun",
    "There's a certain joy to loving {i}",
    "Anyone into {i} seems to have a good vibe",
    "People who love {i} are easy to talk to",
],
"arts": [
    "People who love {i} always notice the little details",
    "There's something beautiful about loving {i}",
    "Anyone who loves {i} has a creative spark",
    "It's easy to like someone who loves {i}",
    "People who love {i} always have a story to tell",
    "There's a certain creativity to loving {i}",
    "Anyone into {i} seems to have a good vibe",
    "People who love {i} are easy to talk to",
],
"gardening": [
    "People who love {i} always have a green thumb",
    "There's something calming about loving {i}",
    "Anyone who loves {i} has a gentle heart",
    "It's easy to like someone who loves {i}",
    "People who love {i} always have a good story",
    "There's a certain patience to loving {i}",
    "Anyone into {i} seems to have a good vibe",
    "People who love {i} are easy to talk to",
],
"fishing": [
    "People who love {i} always know how to relax",
    "There's something peaceful about loving {i}",
    "Anyone who loves {i} has a patient spirit",
    "It's easy to like someone who loves {i}",
    "People who love {i} always have a good story",
    "There's a certain calm to loving {i}",
    "Anyone into {i} seems to have a good vibe",
    "People who love {i} are easy to talk to",
],
"fitness": [
    "People who love {i} always have great energy",
    "There's something inspiring about loving {i}",
    "Anyone who loves {i} has a strong mindset",
    "It's easy to like someone who loves {i}",
    "People who love {i} always know how to push themselves",
    "There's a certain discipline to loving {i}",
    "Anyone into {i} seems to have a good vibe",
    "People who love {i} are easy to talk to",
],
"workout": [
    "People who love {i} always have great energy",
    "There's something inspiring about loving {i}",
    "Anyone who loves {i} has a strong mindset",
    "It's easy to like someone who loves {i}",
    "People who love {i} always know how to push themselves",
    "There's a certain energy to loving {i}",
    "Anyone into {i} seems to have a good vibe",
    "People who love {i} are easy to talk to",
],
"astrology": [
    "People who love {i} always have a good read on things",
    "There's something fun about loving {i}",
    "Anyone who loves {i} has a curious mind",
    "It's easy to like someone who loves {i}",
    "People who love {i} always have a story to tell",
    "There's a certain mystery to loving {i}",
    "Anyone into {i} seems to have a good vibe",
    "People who love {i} are easy to talk to",
],
"soccer": [
    "People who love {i} always have game-day energy",
    "There's something exciting about loving {i}",
    "Anyone who loves {i} has a competitive spirit",
    "It's easy to like someone who loves {i}",
    "People who love {i} always have a good story",
    "There's a certain passion to loving {i}",
    "Anyone into {i} seems to have a good vibe",
    "People who love {i} are easy to talk to",
],
"baseball": [
    "People who love {i} always have a love for the game",
    "There's something classic about loving {i}",
    "Anyone who loves {i} has a patient spirit",
    "It's easy to like someone who loves {i}",
    "People who love {i} always have a good story",
    "There's a certain tradition to loving {i}",
    "Anyone into {i} seems to have a good vibe",
    "People who love {i} are easy to talk to",
],
}

TRANSITIONS = [
    "and it got me wondering,",
    "and that got me wondering,",
    "so I had to ask,",
    "and I couldn't help wondering,",
    "and it made me curious,",
    "so now I'm curious,",
]

def casualize(phrase):
    phrase = phrase.replace("do you have", "do_you_have")
    reps = [
        ("what is", "what's"), ("you have", "you've"), ("I have", "I've"),
        ("cannot", "can't"), ("do not", "don't"), ("does not", "doesn't"),
        ("did not", "didn't"), ("are not", "aren't"), ("is not", "isn't"),
        ("it is", "it's"), ("that is", "that's"), ("there is", "there's"),
        ("have not", "haven't"), ("has not", "hasn't"), ("would not", "wouldn't"),
        ("could not", "couldn't"), ("should not", "shouldn't"),
        ("What is", "What's"), ("You have", "You've"),
        ("I have", "I've"), ("Cannot", "Can't"),
    ]
    for a, b in reps:
        phrase = phrase.replace(a, b)
    return phrase.replace("do_you_have", "do you have")

def build_category_phrase(cat, opener, subject, question):
    compliment = random.choice(COMPLIMENTS[cat]).replace("{i}", subject)
    transition = random.choice(TRANSITIONS)
    return casualize(opener.replace("{i}", subject) + " " + compliment + " " + transition + " " + question)

# {i} is always the category name itself — never a synonym or sub-topic.
CATEGORY_NAMES = {
    "tv": "TV",
    "arts": "art",
    "workout": "working out",
}

for cat, data in CATEGORIES.items():
    openers = OPENERS
    subjects = [CATEGORY_NAMES.get(cat, cat)]
    questions = data["questions"]
    phrases = set()
    combos = [(o, i, q) for o in openers for i in subjects for q in questions]
    random.shuffle(combos)
    for o, i, q in combos:
        phrase = build_category_phrase(cat, o, i, q)
        if is_banned(phrase):
            continue
        phrases.add(phrase)
        if len(phrases) >= 500:
            break
    idx = 0
    while len(phrases) < 500 and idx < 500000:
        o = openers[idx % len(openers)]
        i = subjects[(idx // len(openers)) % len(subjects)]
        q = questions[(idx // (len(openers) * len(subjects))) % len(questions)]
        phrase = build_category_phrase(cat, o, i, q)
        if not is_banned(phrase):
            phrases.add(phrase)
        idx += 1
    out = sorted(phrases)[:500]
    path = f"icebreakers-{cat}.json"
    with open(path, "w", encoding="utf-8") as f:
        json.dump(out, f, indent=4, ensure_ascii=False)
    print(f"{cat}: {len(out)} phrases -> {path}")

# General category uses the standalone first-message templates
def load_general_template(path="TEMPLATE - ICEBREAKER.txt"):
    phrases = []
    with open(path, encoding="utf-8") as f:
        for line in f:
            phrase = line.strip()
            if not phrase.endswith("?"):
                continue
            if "[Your Name]" in phrase or "[Your City]" in phrase or is_banned(phrase):
                continue
            phrases.append(phrase)
    return list(dict.fromkeys(phrases))

gen_out = load_general_template()
with open("icebreakers-general.json", "w", encoding="utf-8") as f:
    json.dump(gen_out, f, indent=4, ensure_ascii=False)
print(f"general: {len(gen_out)} phrases -> icebreakers-general.json")

# Rebuild the JS data file the HTML loads
cats = ["general"] + list(CATEGORIES.keys())
out = "const ICEBREAKERS = {\n"
for c in cats:
    arr = json.load(open(f"icebreakers-{c}.json", encoding="utf-8"))
    out += f"    {c}: {json.dumps(arr, ensure_ascii=False)},\n"
out = out.rstrip(",\n") + "\n};\n"
with open("icebreakers-data.js", "w", encoding="utf-8") as f:
    f.write(out)
print("icebreakers-data.js rebuilt")
print("Done")
