"""
zones.py — Math zones and challenges for the Math Advanced skill pack.
"""

ZONE_ORDER = [
    "multiplication",
    "division",
    "word_problems",
    "geometry",
    "decimals_percents",
    "negative_numbers",
    "time_and_calendars",
    "patterns_and_sequences",
]

ZONES = {
    "multiplication": {
        "id": "multiplication",
        "name": "The Multiplication Kingdom",
        "description": "Master the times tables and discover the power of multiplication",
        "level_required": 1,
        "challenges": [
            {
                "id": "mul_01",
                "title": "First Times Tables",
                "type": "quiz",
                "question": "What is [bold yellow]2 × 3[/bold yellow]?",
                "lesson": "[bold yellow]2 × 3[/bold yellow] means 2 groups of 3, or 3 + 3 = [bold yellow]6[/bold yellow]. Multiplication is a fast way to add equal groups!",
                "options": ["5", "8", "6", "4"],
                "answer": "c",
                "hints": ["Think of it as 3 + 3.", "Two groups of three equals 6!"],
                "xp": 25,
            },
            {
                "id": "mul_02",
                "title": "The Sixes",
                "type": "quiz",
                "question": "What is [bold yellow]6 × 7[/bold yellow]?",
                "lesson": "[bold yellow]6 × 7 = 42[/bold yellow]. A helpful trick: 6 × 7 = 6 × 5 + 6 × 2 = 30 + 12 = 42!",
                "options": ["36", "48", "43", "42"],
                "answer": "d",
                "hints": ["Try counting by 6s: 6, 12, 18, 24, 30, 36, 42!", "6 × 5 = 30, then add one more 6."],
                "xp": 30,
            },
            {
                "id": "mul_03",
                "title": "The Eights",
                "type": "quiz",
                "question": "What is [bold yellow]8 × 9[/bold yellow]?",
                "lesson": "[bold yellow]8 × 9 = 72[/bold yellow]. A trick: 8 × 9 = 8 × 10 - 8 = 80 - 8 = 72!",
                "options": ["63", "81", "72", "64"],
                "answer": "c",
                "hints": ["Try: 8 × 10 = 80, then subtract 8.", "80 - 8 = ?"],
                "xp": 30,
            },
            {
                "id": "mul_04",
                "title": "Twelves",
                "type": "quiz",
                "question": "What is [bold yellow]12 × 4[/bold yellow]?",
                "lesson": "[bold yellow]12 × 4 = 48[/bold yellow]. Break it up: 10 × 4 = 40, plus 2 × 4 = 8, so 40 + 8 = 48!",
                "options": ["44", "48", "52", "46"],
                "answer": "b",
                "hints": ["Try: 10 × 4 = 40, then add 2 × 4.", "40 + 8 = ?"],
                "xp": 30,
            },
            {
                "id": "mul_05",
                "title": "Sevens",
                "type": "quiz",
                "question": "What is [bold yellow]7 × 8[/bold yellow]?",
                "lesson": "[bold yellow]7 × 8 = 56[/bold yellow]. A memory trick: 5, 6, 7, 8 — [italic]five six seven eight[/italic] means 56 = 7 × 8!",
                "options": ["54", "63", "48", "56"],
                "answer": "d",
                "hints": ["Remember: 5, 6, 7, 8 — 56 = 7 × 8!", "Count by 7s: 7, 14, 21, 28, 35, 42, 49, 56."],
                "xp": 35,
            },
            {
                "id": "mul_boss",
                "title": "Boss: The Eleven Champion",
                "type": "quiz",
                "question": "What is [bold yellow]11 × 11[/bold yellow]?",
                "lesson": "[bold yellow]11 × 11 = 121[/bold yellow]. The 11 times table has a lovely pattern: 11, 22, 33, 44... up to 99, then 110, 121!",
                "options": ["111", "112", "121", "131"],
                "answer": "c",
                "hints": ["11 × 10 = 110, then add one more 11.", "110 + 11 = ?"],
                "xp": 50,
            },
        ],
    },
    "division": {
        "id": "division",
        "name": "The Division Workshop",
        "description": "Learn to split numbers into equal groups",
        "level_required": 1,
        "challenges": [
            {
                "id": "div_01",
                "title": "What Is Division?",
                "type": "quiz",
                "question": "What does division mean?",
                "lesson": "Division means [bold yellow]splitting into equal groups[/bold yellow]. 12 ÷ 4 means: split 12 into 4 equal groups. How many in each group?",
                "options": ["Adding numbers together", "Splitting into equal groups", "Making numbers bigger", "Counting by twos"],
                "answer": "b",
                "hints": ["Think about sharing cookies equally with friends.", "÷ means 'split into equal groups'!"],
                "xp": 25,
            },
            {
                "id": "div_02",
                "title": "Simple Division",
                "type": "quiz",
                "question": "What is [bold yellow]12 ÷ 4[/bold yellow]?",
                "lesson": "[bold yellow]12 ÷ 4 = 3[/bold yellow]. Split 12 into 4 equal groups: each group gets 3. Check: 4 × 3 = 12 ✓",
                "options": ["4", "2", "3", "5"],
                "answer": "c",
                "hints": ["How many groups of 4 fit inside 12?", "4 × ? = 12"],
                "xp": 25,
            },
            {
                "id": "div_03",
                "title": "Dividing by Eight",
                "type": "quiz",
                "question": "What is [bold yellow]48 ÷ 8[/bold yellow]?",
                "lesson": "[bold yellow]48 ÷ 8 = 6[/bold yellow]. Ask yourself: 8 × ? = 48. Since 8 × 6 = 48, the answer is 6!",
                "options": ["5", "7", "8", "6"],
                "answer": "d",
                "hints": ["What times 8 equals 48?", "8 × 6 = 48!"],
                "xp": 30,
            },
            {
                "id": "div_04",
                "title": "Dividing by Six",
                "type": "quiz",
                "question": "What is [bold yellow]36 ÷ 6[/bold yellow]?",
                "lesson": "[bold yellow]36 ÷ 6 = 6[/bold yellow]. 6 × 6 = 36, so 36 split into 6 equal groups gives 6 in each group!",
                "options": ["7", "5", "6", "8"],
                "answer": "c",
                "hints": ["What times 6 equals 36?", "6 × 6 = 36!"],
                "xp": 30,
            },
            {
                "id": "div_05",
                "title": "Dividing by Ten",
                "type": "quiz",
                "question": "What is [bold yellow]100 ÷ 10[/bold yellow]?",
                "lesson": "[bold yellow]100 ÷ 10 = 10[/bold yellow]. Dividing by 10 is easy — just remove one zero! 100 → 10.",
                "options": ["100", "1", "10", "20"],
                "answer": "c",
                "hints": ["Dividing by 10 removes one zero from the number.", "100 has two zeros — remove one!"],
                "xp": 25,
            },
            {
                "id": "div_boss",
                "title": "Boss: The Big Divide",
                "type": "quiz",
                "question": "What is [bold yellow]144 ÷ 12[/bold yellow]?",
                "lesson": "[bold yellow]144 ÷ 12 = 12[/bold yellow]. 12 × 12 = 144 — the square of 12! This is a famous multiplication fact.",
                "options": ["11", "14", "13", "12"],
                "answer": "d",
                "hints": ["What times 12 equals 144?", "12 × 12 = 144 — it's 12 squared!"],
                "xp": 50,
            },
        ],
    },
    "word_problems": {
        "id": "word_problems",
        "name": "The Story Problem Café",
        "description": "Solve real-world math puzzles hidden inside stories",
        "level_required": 1,
        "challenges": [
            {
                "id": "wp_01",
                "title": "Apple Bags",
                "type": "quiz",
                "question": "Sarah has [bold yellow]24 apples[/bold yellow] and puts them into bags of [bold yellow]6[/bold yellow]. How many bags does she fill?",
                "lesson": "To find the number of bags, divide: [bold yellow]24 ÷ 6 = 4[/bold yellow]. She fills 4 bags!",
                "options": ["3", "5", "6", "4"],
                "answer": "d",
                "hints": ["How many groups of 6 fit in 24?", "24 ÷ 6 = ?"],
                "xp": 30,
            },
            {
                "id": "wp_02",
                "title": "The Train Journey",
                "type": "quiz",
                "question": "A train travels [bold yellow]60 miles per hour[/bold yellow]. How far does it travel in [bold yellow]3 hours[/bold yellow]?",
                "lesson": "Multiply speed × time: [bold yellow]60 × 3 = 180 miles[/bold yellow]. The train travels 180 miles!",
                "options": ["120 miles", "63 miles", "180 miles", "200 miles"],
                "answer": "c",
                "hints": ["Multiply: 60 × 3.", "60 + 60 + 60 = ?"],
                "xp": 30,
            },
            {
                "id": "wp_03",
                "title": "Sticker Sharing",
                "type": "quiz",
                "question": "[bold yellow]5 friends[/bold yellow] share [bold yellow]35 stickers[/bold yellow] equally. How many stickers does each friend get?",
                "lesson": "Divide: [bold yellow]35 ÷ 5 = 7[/bold yellow]. Each friend gets 7 stickers!",
                "options": ["8", "6", "7", "9"],
                "answer": "c",
                "hints": ["Divide 35 by 5.", "What times 5 equals 35?"],
                "xp": 30,
            },
            {
                "id": "wp_04",
                "title": "The Baking Recipe",
                "type": "quiz",
                "question": "A recipe needs [bold yellow]3 cups of flour[/bold yellow] for [bold yellow]12 cookies[/bold yellow]. How many cups are needed for [bold yellow]24 cookies[/bold yellow]?",
                "lesson": "24 cookies is twice 12 cookies, so you need twice the flour: [bold yellow]3 × 2 = 6 cups[/bold yellow]!",
                "options": ["4 cups", "5 cups", "6 cups", "8 cups"],
                "answer": "c",
                "hints": ["24 is double 12 — so double the flour too!", "3 × 2 = ?"],
                "xp": 35,
            },
            {
                "id": "wp_boss",
                "title": "Boss: The School Count",
                "type": "quiz",
                "question": "A school has [bold yellow]8 classes[/bold yellow] with [bold yellow]28 students[/bold yellow] in each class. How many students are there in total?",
                "lesson": "Multiply: [bold yellow]8 × 28 = 224[/bold yellow]. Break it up: 8 × 20 = 160, plus 8 × 8 = 64. So 160 + 64 = 224!",
                "options": ["184", "196", "224", "240"],
                "answer": "c",
                "hints": ["Multiply 8 × 28.", "Try: 8 × 20 = 160, then add 8 × 8 = 64."],
                "xp": 50,
            },
        ],
    },
    "geometry": {
        "id": "geometry",
        "name": "The Shape Lab",
        "description": "Explore perimeter, area, and the secrets of shapes",
        "level_required": 1,
        "challenges": [
            {
                "id": "geo_01",
                "title": "What Is a Right Angle?",
                "type": "quiz",
                "question": "How many degrees is a [bold yellow]right angle[/bold yellow]?",
                "lesson": "A [bold yellow]right angle is exactly 90°[/bold yellow]. It looks like the corner of a square or the corner of a book. The little square symbol □ marks a right angle.",
                "options": ["45°", "180°", "90°", "360°"],
                "answer": "c",
                "hints": ["Think of the corner of a square.", "It's exactly one-quarter of a full circle!"],
                "xp": 25,
            },
            {
                "id": "geo_02",
                "title": "Degrees in a Circle",
                "type": "quiz",
                "question": "How many degrees are in a full circle?",
                "lesson": "A full circle has [bold yellow]360 degrees[/bold yellow]. Half a circle = 180°. A quarter circle (right angle) = 90°.",
                "options": ["180°", "270°", "90°", "360°"],
                "answer": "d",
                "hints": ["A half turn is 180° — a full turn is double that.", "Think of a spinning top doing a full spin!"],
                "xp": 25,
            },
            {
                "id": "geo_03",
                "title": "Perimeter of a Rectangle",
                "type": "quiz",
                "question": "What is the formula for the [bold yellow]perimeter[/bold yellow] of a rectangle?",
                "lesson": "Perimeter = [bold yellow]2 × length + 2 × width[/bold yellow]. You add up all four sides. Two long sides and two short sides!",
                "options": ["length × width", "2 × length + 2 × width", "length + width", "4 × length"],
                "answer": "b",
                "hints": ["Perimeter means the distance all the way around.", "A rectangle has 2 long sides and 2 short sides — add them all!"],
                "xp": 30,
            },
            {
                "id": "geo_04",
                "title": "Area of a Rectangle",
                "type": "quiz",
                "question": "What is the formula for the [bold yellow]area[/bold yellow] of a rectangle?",
                "lesson": "[bold yellow]Area = length × width[/bold yellow]. Area measures how much surface is inside the shape — like how many square tiles would cover the floor.",
                "options": ["length + width", "2 × (length + width)", "length × width", "length × length"],
                "answer": "c",
                "hints": ["Area is the space INSIDE the shape.", "Multiply the two sides together!"],
                "xp": 30,
            },
            {
                "id": "geo_05",
                "title": "Area of a Square",
                "type": "quiz",
                "question": "A square has a side of [bold yellow]5 units[/bold yellow]. What is its area?",
                "lesson": "[bold yellow]5 × 5 = 25 square units[/bold yellow]. A square is a special rectangle where all sides are equal, so area = side × side!",
                "options": ["10 square units", "20 square units", "15 square units", "25 square units"],
                "answer": "d",
                "hints": ["Area of a square = side × side.", "5 × 5 = ?"],
                "xp": 30,
            },
            {
                "id": "geo_boss",
                "title": "Boss: Triangle Area",
                "type": "quiz",
                "question": "What is the formula for the [bold yellow]area of a triangle[/bold yellow]?",
                "lesson": "[bold yellow]Area of a triangle = ½ × base × height[/bold yellow]. A triangle is exactly half of a rectangle, which is why we use ½!",
                "options": ["base × height", "base + height", "½ × base × height", "2 × base × height"],
                "answer": "c",
                "hints": ["A triangle is half of a rectangle!", "Start with base × height, then cut it in half."],
                "xp": 50,
            },
        ],
    },
    "decimals_percents": {
        "id": "decimals_percents",
        "name": "The Decimal Garden",
        "description": "Discover the world of decimals, fractions, and percents",
        "level_required": 1,
        "challenges": [
            {
                "id": "dec_01",
                "title": "Half as a Decimal",
                "type": "quiz",
                "question": "What fraction is equal to [bold yellow]0.5[/bold yellow]?",
                "lesson": "[bold yellow]0.5 = 1/2[/bold yellow]. The decimal 0.5 means five-tenths, which is the same as one-half. Half a pizza, half a dollar!",
                "options": ["1/4", "1/3", "1/2", "2/5"],
                "answer": "c",
                "hints": ["0.5 is halfway between 0 and 1.", "Half of 1.0 is 0.5 — so it equals 1/2!"],
                "xp": 25,
            },
            {
                "id": "dec_02",
                "title": "Quarter as a Decimal",
                "type": "quiz",
                "question": "What fraction is equal to [bold yellow]0.25[/bold yellow]?",
                "lesson": "[bold yellow]0.25 = 1/4[/bold yellow]. A quarter of a dollar is 25 cents, which is 0.25 of a dollar. One-quarter!",
                "options": ["1/2", "1/3", "3/4", "1/4"],
                "answer": "d",
                "hints": ["Think of a quarter coin — 25 cents out of 100 cents.", "0.25 is one-quarter of 1.0!"],
                "xp": 25,
            },
            {
                "id": "dec_03",
                "title": "50 Percent",
                "type": "quiz",
                "question": "What is [bold yellow]50%[/bold yellow] of [bold yellow]80[/bold yellow]?",
                "lesson": "[bold yellow]50% of 80 = 40[/bold yellow]. 50% means half. Half of 80 is 40. Just divide by 2!",
                "options": ["50", "30", "40", "45"],
                "answer": "c",
                "hints": ["50% means half. What is half of 80?", "80 ÷ 2 = ?"],
                "xp": 30,
            },
            {
                "id": "dec_04",
                "title": "10 Percent",
                "type": "quiz",
                "question": "What is [bold yellow]10%[/bold yellow] of [bold yellow]150[/bold yellow]?",
                "lesson": "[bold yellow]10% of 150 = 15[/bold yellow]. To find 10%, divide by 10. Just remove one zero or move the decimal point!",
                "options": ["10", "1.5", "15", "150"],
                "answer": "c",
                "hints": ["To find 10%, divide by 10.", "150 ÷ 10 = ?"],
                "xp": 30,
            },
            {
                "id": "dec_05",
                "title": "Adding Decimals",
                "type": "quiz",
                "question": "What is [bold yellow]1.5 + 2.3[/bold yellow]?",
                "lesson": "[bold yellow]1.5 + 2.3 = 3.8[/bold yellow]. Add the ones: 1 + 2 = 3. Add the tenths: 5 + 3 = 8. So 3.8!",
                "options": ["3.9", "4.8", "3.8", "2.8"],
                "answer": "c",
                "hints": ["Add the whole number parts first, then the decimal parts.", "1 + 2 = 3, and 0.5 + 0.3 = 0.8"],
                "xp": 30,
            },
            {
                "id": "dec_boss",
                "title": "Boss: The Sale Price",
                "type": "quiz",
                "question": "A toy costs [bold yellow]$20[/bold yellow] and is [bold yellow]25% off[/bold yellow]. How much do you pay?",
                "lesson": "[bold yellow]25% of $20 = $5[/bold yellow] off. So you pay $20 - $5 = [bold yellow]$15[/bold yellow]. To find 25%, take 10% ($2) and multiply by 2.5, or just find half of half: half of $20 = $10, half again = $5!",
                "options": ["$5", "$10", "$18", "$15"],
                "answer": "d",
                "hints": ["First find 25% of $20 — that's the discount.", "25% = 1/4. What is one-quarter of 20?"],
                "xp": 50,
            },
        ],
    },
    "negative_numbers": {
        "id": "negative_numbers",
        "name": "The Number Line Underground",
        "description": "Venture below zero and discover negative numbers",
        "level_required": 1,
        "challenges": [
            {
                "id": "neg_01",
                "title": "What Is a Negative Number?",
                "type": "quiz",
                "question": "What is a [bold yellow]negative number[/bold yellow]?",
                "lesson": "A [bold yellow]negative number is less than zero[/bold yellow]. We write a minus sign in front: -3, -10, -50. Think of temperatures below freezing or floors below ground!",
                "options": ["A number greater than zero", "A number less than zero", "The number zero itself", "A very large number"],
                "answer": "b",
                "hints": ["Think of a thermometer going below the freezing line.", "Negative numbers are on the LEFT side of zero on a number line!"],
                "xp": 25,
            },
            {
                "id": "neg_02",
                "title": "Adding to a Negative",
                "type": "quiz",
                "question": "What is [bold yellow]-3 + 5[/bold yellow]?",
                "lesson": "[bold yellow]-3 + 5 = 2[/bold yellow]. Start at -3 on the number line, then hop 5 steps to the right: -3, -2, -1, 0, 1, 2!",
                "options": ["-8", "-2", "8", "2"],
                "answer": "d",
                "hints": ["Start at -3 and count up 5 steps.", "-3, -2, -1, 0, 1, 2 — how many steps?"],
                "xp": 30,
            },
            {
                "id": "neg_03",
                "title": "Still Negative",
                "type": "quiz",
                "question": "What is [bold yellow]-8 + 3[/bold yellow]?",
                "lesson": "[bold yellow]-8 + 3 = -5[/bold yellow]. Start at -8 and hop 3 steps right: -8, -7, -6, -5. Still below zero!",
                "options": ["-5", "5", "-11", "11"],
                "answer": "a",
                "hints": ["Start at -8 and count up 3 steps.", "-8, -7, -6, -5 — what number is that?"],
                "xp": 30,
            },
            {
                "id": "neg_04",
                "title": "Subtracting from Zero",
                "type": "quiz",
                "question": "What is [bold yellow]0 - 7[/bold yellow]?",
                "lesson": "[bold yellow]0 - 7 = -7[/bold yellow]. When you take away more than you have, you go below zero! 0 minus 7 lands at -7.",
                "options": ["7", "-7", "0", "-1"],
                "answer": "b",
                "hints": ["Start at 0 and go 7 steps to the left.", "Taking 7 away from nothing leaves you 7 in debt — that's -7!"],
                "xp": 30,
            },
            {
                "id": "neg_05",
                "title": "Comparing Negatives",
                "type": "quiz",
                "question": "Which number is [bold yellow]larger[/bold yellow]: [bold yellow]-2[/bold yellow] or [bold yellow]-8[/bold yellow]?",
                "lesson": "[bold yellow]-2 is larger than -8[/bold yellow]. On the number line, -2 is closer to zero and further to the right. With negative numbers, closer to zero means bigger!",
                "options": ["-8", "They are equal", "-2", "Can't tell"],
                "answer": "c",
                "hints": ["On a number line, numbers get bigger as you go right.", "-2 is to the RIGHT of -8, so it is larger!"],
                "xp": 35,
            },
            {
                "id": "neg_boss",
                "title": "Boss: The Temperature Rise",
                "type": "quiz",
                "question": "The temperature is [bold yellow]-4°C[/bold yellow]. It rises [bold yellow]9 degrees[/bold yellow]. What is the new temperature?",
                "lesson": "[bold yellow]-4 + 9 = 5°C[/bold yellow]. Start at -4 and hop 9 steps right: -4, -3, -2, -1, 0, 1, 2, 3, 4, 5. Above zero!",
                "options": ["13°C", "-13°C", "-5°C", "5°C"],
                "answer": "d",
                "hints": ["Start at -4 and count up 9 steps.", "-4 + 9 = ? (Hint: you'll cross zero!)"],
                "xp": 50,
            },
        ],
    },
    "time_and_calendars": {
        "id": "time_and_calendars",
        "name": "The Clock Tower",
        "description": "Read clocks, measure elapsed time, and navigate calendars and leap years",
        "level_required": 1,
        "challenges": [
            {
                "id": "tc_01",
                "title": "Quarter Past",
                "type": "quiz",
                "question": "An analogue clock shows the hour hand on the [bold yellow]3[/bold yellow] and the minute hand on the [bold yellow]3[/bold yellow]. What time is it?",
                "lesson": "When the minute hand points to the [bold yellow]3[/bold yellow], it means [bold yellow]15 minutes[/bold yellow] have passed. So the time is 3:15 — or 'quarter past three!' Each number on the clock represents 5 minutes.",
                "options": ["3:03", "3:15", "3:30", "3:45"],
                "answer": "b",
                "hints": ["The minute hand on the 3 = 15 minutes past.", "Each number = 5 minutes: 1×5=5, 2×5=10, 3×5=15!"],
                "xp": 25,
            },
            {
                "id": "tc_02",
                "title": "Half Past",
                "type": "quiz",
                "question": "An analogue clock shows the hour hand halfway between [bold yellow]7[/bold yellow] and [bold yellow]8[/bold yellow], and the minute hand on the [bold yellow]6[/bold yellow]. What time is it?",
                "lesson": "When the minute hand points to the [bold yellow]6[/bold yellow], exactly [bold yellow]30 minutes[/bold yellow] have passed. The time is 7:30 — or 'half past seven!' The hour hand is halfway because 30 minutes of the hour have passed.",
                "options": ["6:30", "7:00", "7:30", "8:30"],
                "answer": "c",
                "hints": ["The minute hand on the 6 always means 30 minutes.", "Half past 7 = 7:30!"],
                "xp": 25,
            },
            {
                "id": "tc_03",
                "title": "Elapsed Time",
                "type": "quiz",
                "question": "A film starts at [bold yellow]2:15 PM[/bold yellow] and ends at [bold yellow]4:45 PM[/bold yellow]. How long is the film?",
                "lesson": "From 2:15 to 4:45: count from 2:15 to 4:15 = [bold yellow]2 hours[/bold yellow], then from 4:15 to 4:45 = [bold yellow]30 more minutes[/bold yellow]. Total: [bold yellow]2 hours 30 minutes[/bold yellow]!",
                "options": ["1 hour 30 minutes", "2 hours", "2 hours 30 minutes", "3 hours"],
                "answer": "c",
                "hints": ["Count from 2:15 to 4:15 first — that's 2 hours.", "Then count from 4:15 to 4:45 — that's 30 more minutes."],
                "xp": 35,
            },
            {
                "id": "tc_04",
                "title": "Months of the Year",
                "type": "quiz",
                "question": "How many months are in a year?",
                "lesson": "There are [bold yellow]12 months[/bold yellow] in a year: January, February, March, April, May, June, July, August, September, October, November, December. A helpful trick: a year has 12 months, just like a clock has 12 numbers!",
                "options": ["10", "11", "12", "13"],
                "answer": "c",
                "hints": ["Count on your fingers: Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec.", "Same number as a clock's numbers!"],
                "xp": 20,
            },
            {
                "id": "tc_05",
                "title": "Days in a Year",
                "type": "quiz",
                "question": "How many days are in a normal (non-leap) year?",
                "lesson": "A normal year has [bold yellow]365 days[/bold yellow]. Earth takes about 365¼ days to travel all the way around the Sun. The leftover quarter-day is why we add an extra day every 4 years — a leap year!",
                "options": ["360", "364", "365", "366"],
                "answer": "c",
                "hints": ["It's a number close to 360.", "365 days — and every 4 years, 366!"],
                "xp": 25,
            },
            {
                "id": "tc_boss",
                "title": "Boss: The Leap Year",
                "type": "quiz",
                "question": "A [bold yellow]leap year[/bold yellow] has 366 days instead of 365. How often does a leap year happen?",
                "lesson": "A [bold yellow]leap year happens every 4 years[/bold yellow]. Earth actually takes 365 and a quarter days to go around the Sun. After 4 years, those extra quarter-days add up to one full day — so we add February 29th! Famous leap years: 2020, 2024, 2028.",
                "options": ["Every 2 years", "Every 3 years", "Every 4 years", "Every 10 years"],
                "answer": "c",
                "hints": ["Think of the Olympics — they also happen every 4 years, always in a leap year!", "4 × ¼ day = 1 whole extra day."],
                "xp": 50,
            },
        ],
    },
    "patterns_and_sequences": {
        "id": "patterns_and_sequences",
        "name": "The Pattern Palace",
        "description": "Discover number patterns, skip counting, shape sequences, and the magic of Fibonacci",
        "level_required": 1,
        "challenges": [
            {
                "id": "ps_01",
                "title": "Skip Counting by 5",
                "type": "quiz",
                "question": "What comes next in this pattern? [bold yellow]5, 10, 15, 20, 25, __[/bold yellow]",
                "lesson": "This is [bold yellow]skip counting by 5[/bold yellow]. Each number is 5 more than the last. 25 + 5 = [bold yellow]30[/bold yellow]! Skip counting by 5 is the same as the 5 times table.",
                "options": ["28", "30", "35", "29"],
                "answer": "b",
                "hints": ["Each number goes up by 5.", "25 + 5 = ?"],
                "xp": 20,
            },
            {
                "id": "ps_02",
                "title": "Even Numbers",
                "type": "quiz",
                "question": "What comes next in this pattern? [bold yellow]2, 4, 6, 8, 10, __[/bold yellow]",
                "lesson": "These are [bold yellow]even numbers[/bold yellow] — skip counting by 2. Every even number ends in 0, 2, 4, 6, or 8. After 10 comes [bold yellow]12[/bold yellow]!",
                "options": ["11", "12", "13", "14"],
                "answer": "b",
                "hints": ["Each number increases by 2.", "Even numbers always end in 0, 2, 4, 6, or 8!"],
                "xp": 20,
            },
            {
                "id": "ps_03",
                "title": "A Shrinking Pattern",
                "type": "quiz",
                "question": "What comes next in this pattern? [bold yellow]100, 90, 80, 70, 60, __[/bold yellow]",
                "lesson": "This pattern [bold yellow]decreases by 10[/bold yellow] each time — it's skip counting backwards by 10! 60 − 10 = [bold yellow]50[/bold yellow].",
                "options": ["55", "40", "50", "45"],
                "answer": "c",
                "hints": ["The pattern goes down, not up.", "Each step subtracts 10: 60 - 10 = ?"],
                "xp": 25,
            },
            {
                "id": "ps_04",
                "title": "Shape Patterns",
                "type": "quiz",
                "question": "A pattern goes: [bold yellow]circle, square, triangle, circle, square, triangle, circle, square, ...[/bold yellow] What shape comes next?",
                "lesson": "This is a [bold yellow]repeating pattern[/bold yellow] with a unit of 3 shapes: circle, square, triangle. After square comes [bold yellow]triangle[/bold yellow] — and then the pattern starts again!",
                "options": ["Circle", "Square", "Triangle", "Rectangle"],
                "answer": "c",
                "hints": ["The pattern repeats every 3 shapes.", "After circle, square… what's the third shape in the pattern?"],
                "xp": 25,
            },
            {
                "id": "ps_05",
                "title": "Function Table",
                "type": "quiz",
                "question": "A function table shows: In=1→Out=3, In=2→Out=6, In=3→Out=9, In=4→Out=?. What is the output when the input is 4?",
                "lesson": "The rule is [bold yellow]multiply by 3[/bold yellow]: 1×3=3, 2×3=6, 3×3=9. So 4×3=[bold yellow]12[/bold yellow]! A function always applies the same rule to every input.",
                "options": ["10", "11", "12", "13"],
                "answer": "c",
                "hints": ["Look at 1→3, 2→6: what operation turns 1 into 3 and 2 into 6?", "Multiply by 3: so 4 × 3 = ?"],
                "xp": 35,
            },
            {
                "id": "ps_boss",
                "title": "Boss: The Fibonacci Sequence",
                "type": "quiz",
                "question": "In the Fibonacci sequence, [bold yellow]each number is the sum of the two before it[/bold yellow]: 1, 1, 2, 3, 5, 8, 13, 21, __. What comes next?",
                "lesson": "The [bold yellow]Fibonacci sequence[/bold yellow]: add the last two numbers to get the next. 13 + 21 = [bold yellow]34[/bold yellow]! This magical sequence appears in flower petals, pinecones, snail shells, and galaxies. It was discovered by a mathematician named Fibonacci in the year 1202!",
                "options": ["30", "32", "34", "42"],
                "answer": "c",
                "hints": ["Add the last two numbers: 13 + 21 = ?", "13 + 21: start with 13, then add 21."],
                "xp": 60,
            },
        ],
    },
}
