Torn Progress Tracker Pro

Torn 200 Easy Merits Tracker

// ==UserScript==
// @name         Torn Progress Tracker Pro
// @namespace    http://torn.com
// @version      1.6.2
// @description  Torn 200 Easy Merits Tracker
// @author       Your Name
// @match        https://www.torn.com/awards.php*
// @grant        GM_xmlhttpRequest
// @grant        GM_setValue
// @grant        GM_getValue
// @grant        GM_addStyle
// ==/UserScript==
(function() {
    'use strict';

    const allAchievements = [
        {
            "id": 1,
            "type": "honor",
            "category": "Activity",
            "days": 200,
            "desc": "Find 50 items in the city",
            "advice": "Probably needs points in awareness to do this under 200 days. Not recommended."
        },
        {
            "id": 8,
            "type": "honor",
            "category": "Activity",
            "days": 200,
            "desc": "Achieve a high credit score with Duke",
            "advice": "Get a loan from duke, pay your fee when he asks you. I did mine with $160k loan, you don't need to increase it. Is somewhat random and can take time."
        },
        {
            "id": 26,
            "type": "medal",
            "category": "Activity",
            "days": 100,
            "desc": "Serve 100 days in a single faction",
            "advice": "L O Y A L B O Y S"
        },
        {
            "id": 27,
            "type": "medal",
            "category": "Activity",
            "days": 200,
            "desc": "Serve 200 days in a single faction",
            "advice": "L O Y A L B O Y S"
        },
        {
            "id": 198,
            "type": "medal",
            "category": "Activity",
            "days": 150,
            "desc": "Use 500 medical items",
            "advice": "Fill blood bags. Always have a med cooldown."
        },
        {
            "id": 204,
            "type": "medal",
            "category": "Activity",
            "days": 70,
            "desc": "Find 10 items in the city",
            "advice": "Needs no focus. Use Torntools to find the items easier."
        },
        {
            "id": 239,
            "type": "honor",
            "category": "Activity",
            "days": 100,
            "desc": "Have 100 customers buy from your bazaar",
            "advice": "To rush this you can buy a bunch of trash and put them up now and then for $1. Not all at once or the same guy will buy all."
        },
        {
            "id": 245,
            "type": "honor",
            "category": "Activity",
            "days": 200,
            "desc": "Achieve 1,000 hours of activity on Torn",
            "advice": "Needs no focus, and nothing to be proud of."
        },
        {
            "id": 316,
            "type": "honor",
            "category": "Activity",
            "days": 14,
            "desc": "Be truly forgiven for all of your sins",
            "advice": "Pray once a day in the church for 2 weeks. Some pray once in the morning and once in the evening to not accidentally miss a day."
        },
        {
            "id": 371,
            "type": "honor",
            "category": "Activity",
            "days": 1,
            "desc": "Complete the mission Introduction: Duke",
            "advice": "Do what it says."
        },
        {
            "id": 606,
            "type": "honor",
            "category": "Activity",
            "days": 40,
            "desc": "Achieve 100 total awards",
            "advice": "Get it on the way to 200 merits."
        },
        {
            "id": 607,
            "type": "honor",
            "category": "Activity",
            "days": 200,
            "desc": "Achieve 50 personal perks",
            "advice": "Counts crime enhancers, stock blocks, education perks, faction perks, merits, everything that gives an added bonus."
        },
        {
            "id": 844,
            "type": "honor",
            "category": "Activity",
            "days": 150,
            "desc": "Achieve 10,000 in any working stat",
            "advice": "Make sure you get trained in your company. ~120 days at 1 train per day. You can also buy trains when you have the economy for it."
        },
        {
            "id": 845,
            "type": "honor",
            "category": "Activity",
            "days": 1,
            "desc": "Read a chronicle",
            "advice": "Have one of these open for a while. Read if you want."
        },
        {
            "id": 873,
            "type": "honor",
            "category": "Activity",
            "days": 100,
            "desc": "Be online every day for 100 days",
            "advice": "Do what it says."
        },
        {
            "id": 15,
            "type": "honor",
            "category": "Attacks",
            "days": 6,
            "desc": "Achieve a best killstreak of 10",
            "advice": "Done while leveling."
        },
        {
            "id": 16,
            "type": "honor",
            "category": "Attacks",
            "days": 14,
            "desc": "Achieve a best killstreak of 100",
            "advice": "Try to get this before you are 14 days old, or during chains. Don't make forum posts, don't say dumb shit in public chats."
        },
        {
            "id": 20,
            "type": "honor",
            "category": "Attacks",
            "days": 5,
            "desc": "Achieve 25 critical hits",
            "advice": "Needs no focus."
        },
        {
            "id": 27,
            "type": "honor",
            "category": "Attacks",
            "days": 40,
            "desc": "Make 100 stealthed attacks",
            "advice": "Needs no focus. Daggers are good at stealthing."
        },
        {
            "id": 28,
            "type": "honor",
            "category": "Attacks",
            "days": 28,
            "desc": "Achieve 100 finishing hits with mechanical weapons",
            "advice": "Weapon list. This is great to do during Halloween, when you want to use chainsaw anyway."
        },
        {
            "id": 39,
            "type": "honor",
            "category": "Attacks",
            "days": 2,
            "desc": "Win 5 attacks",
            "advice": "Done while leveling."
        },
        {
            "id": 40,
            "type": "honor",
            "category": "Attacks",
            "days": 3,
            "desc": "Win 20 attacks",
            "advice": "Done while leveling."
        },
        {
            "id": 41,
            "type": "honor",
            "category": "Attacks",
            "days": 5,
            "desc": "Win 50 attacks",
            "advice": "Done while leveling."
        },
        {
            "id": 41,
            "type": "honor",
            "category": "Attacks",
            "days": 5,
            "desc": "Win 50 attacks",
            "advice": "Done while leveling."
        },
        {
            "id": 42,
            "type": "honor",
            "category": "Attacks",
            "days": 10,
            "desc": "Win 100 attacks",
            "advice": "Done while leveling."
        },
        {
            "id": 43,
            "type": "honor",
            "category": "Attacks",
            "days": 35,
            "desc": "Win 250 attacks",
            "advice": "Do your best in chains."
        },
        {
            "id": 43,
            "type": "honor",
            "category": "Attacks",
            "days": 35,
            "desc": "Win 250 attacks",
            "advice": "Do your best in chains."
        },
        {
            "id": 44,
            "type": "honor",
            "category": "Attacks",
            "days": 100,
            "desc": "Win 500 attacks",
            "advice": "Do your best in chains."
        },
        {
            "id": 44,
            "type": "honor",
            "category": "Attacks",
            "days": 100,
            "desc": "Win 500 attacks",
            "advice": "Do your best in chains."
        },
        {
            "id": 45,
            "type": "honor",
            "category": "Attacks",
            "days": 150,
            "desc": "Win 1,000 attacks",
            "advice": "Do your best in chains."
        },
        {
            "id": 46,
            "type": "honor",
            "category": "Attacks",
            "days": 200,
            "desc": "Win 2,000 attacks",
            "advice": "Do your best in chains."
        },
        {
            "id": 140,
            "type": "honor",
            "category": "Attacks",
            "days": 15,
            "desc": "Fire 1,000 rounds",
            "advice": "Needs no focus. Can be rushed with minigun."
        },
        {
            "id": 141,
            "type": "honor",
            "category": "Attacks",
            "days": 28,
            "desc": "Achieve 100 finishing hits with heavy artillery",
            "advice": "Weapon list. Neither alternative is very good."
        },
        {
            "id": 142,
            "type": "honor",
            "category": "Attacks",
            "days": 28,
            "desc": "Achieve 100 finishing hits with clubbing weapons",
            "advice": "Weapon list. I used nunchakus."
        },
        {
            "id": 143,
            "type": "honor",
            "category": "Attacks",
            "days": 28,
            "desc": "Achieve 100 finishing hits with temporary weapons",
            "advice": "Weapon list. I used Grenades and HEG."
        },
        {
            "id": 144,
            "type": "honor",
            "category": "Attacks",
            "days": 28,
            "desc": "Achieve 100 finishing hits with machine guns",
            "advice": "Weapon list. Para or Minigun equally good/bad."
        },
        {
            "id": 145,
            "type": "honor",
            "category": "Attacks",
            "days": 28,
            "desc": "Achieve 100 finishing hits with pistols",
            "advice": "Weapon list. I used Qsz 92."
        },
        {
            "id": 146,
            "type": "honor",
            "category": "Attacks",
            "days": 28,
            "desc": "Achieve 100 finishing hits with rifles",
            "advice": "Weapon list. I used Armalite but Enfield is good too."
        },
        {
            "id": 147,
            "type": "honor",
            "category": "Attacks",
            "days": 28,
            "desc": "Achieve 100 finishing hits with shotguns",
            "advice": "Weapon list. I used Jackhammer"
        },
        {
            "id": 148,
            "type": "honor",
            "category": "Attacks",
            "days": 28,
            "desc": "Achieve 100 finishing hits with SMGs",
            "advice": "Weapon list. I used BT MP9"
        },
        {
            "id": 149,
            "type": "honor",
            "category": "Attacks",
            "days": 28,
            "desc": "Achieve 100 finishing hits with piercing weapons",
            "advice": "Weapon list. You'll always have a dagger equiped so don't focus on this one."
        },
        {
            "id": 150,
            "type": "honor",
            "category": "Attacks",
            "days": 28,
            "desc": "Achieve 100 finishing hits with slashing weapons",
            "advice": "Weapon list. I used Kodachi Swords"
        },
        {
            "id": 151,
            "type": "honor",
            "category": "Attacks",
            "days": 100,
            "desc": "Fire 10,000 rounds",
            "advice": "Needs no focus. Can be rushed with minigun."
        },
        {
            "id": 190,
            "type": "medal",
            "category": "Attacks",
            "days": 14,
            "desc": "Acquire a kill streak of 25",
            "advice": "Best done while leveling, else try during chains."
        },
        {
            "id": 191,
            "type": "medal",
            "category": "Attacks",
            "days": 14,
            "desc": "Acquire a kill streak of 50",
            "advice": "Best done while leveling, else try during chains."
        },
        {
            "id": 192,
            "type": "medal",
            "category": "Attacks",
            "days": 14,
            "desc": "Acquire a kill streak of 100",
            "advice": "Best done while leveling, else try during chains."
        },
        {
            "id": 195,
            "type": "medal",
            "category": "Attacks",
            "days": 150,
            "desc": "Deal 500 critical hits to enemies during combat",
            "advice": "Can be rushed by using pillow/fists to get more hits in on targets that are no threat to you."
        },
        {
            "id": 201,
            "type": "medal",
            "category": "Attacks",
            "days": 50,
            "desc": "Collect 25 bounties",
            "advice": "Either hunt for bounties or ask friends to put $50 bounties on your mission targets. Or both."
        },
        {
            "id": 215,
            "type": "medal",
            "category": "Attacks",
            "days": 14,
            "desc": "Earn 100 respect for your faction",
            "advice": "Do your best in chains."
        },
        {
            "id": 216,
            "type": "medal",
            "category": "Attacks",
            "days": 100,
            "desc": "Earn 500 respect for your faction",
            "advice": "Do your best in chains."
        },
        {
            "id": 217,
            "type": "medal",
            "category": "Attacks",
            "days": 100,
            "desc": "Earn 1,000 respect for your faction",
            "advice": "Do your best in chains."
        },
        {
            "id": 218,
            "type": "medal",
            "category": "Attacks",
            "days": 150,
            "desc": "Earn 2,500 respect for your faction",
            "advice": "Do your best in chains."
        },
        {
            "id": 219,
            "type": "medal",
            "category": "Attacks",
            "days": 200,
            "desc": "Earn 5,000 respect for your faction",
            "advice": "Do your best in chains."
        },
        {
            "id": 220,
            "type": "medal",
            "category": "Attacks",
            "days": 200,
            "desc": "Earn 10,000 respect for your faction",
            "advice": "Do your best in chains, probably hard to complete without at least 1 big bonus hit."
        },
        {
            "id": 227,
            "type": "honor",
            "category": "Attacks",
            "days": 200,
            "desc": "Achieve 1,000 critical hits",
            "advice": "Can be rushed by using pillow/fists to get more hits in on targets that are no threat to you."
        },
        {
            "id": 230,
            "type": "honor",
            "category": "Attacks",
            "days": 1,
            "desc": "Defeat someone displaying this honor (Domino Effect)",
            "advice": "Attack this guy https://www.torn.com/profiles.php?XID=1776074#/ or ask a friend to display the honor then attack them."
        },
        {
            "id": 236,
            "type": "honor",
            "category": "Attacks",
            "days": 1,
            "desc": "Earn $10,000,000 from bounty hunting",
            "advice": "Can be rushed by asking a friend to bounty someone for $10m. Will cost $5m in bounty fee."
        },
        {
            "id": 247,
            "type": "honor",
            "category": "Attacks",
            "days": 1,
            "desc": "Make $1,000,000 from a single mugging",
            "advice": "Ask someone to help you. Send them $21m and then mug them."
        },
        {
            "id": 253,
            "type": "honor",
            "category": "Attacks",
            "days": 30,
            "desc": "Participate in a 10 length chain",
            "advice": "Participate in chains."
        },
        {
            "id": 254,
            "type": "honor",
            "category": "Attacks",
            "days": 1,
            "desc": "Achieve a one hit kill on a target from full life",
            "advice": "Hit a low level when you have some stats."
        },
        {
            "id": 255,
            "type": "honor",
            "category": "Attacks",
            "days": 30,
            "desc": "Participate in a 100 length chain",
            "advice": "Participate in chains."
        },
        {
            "id": 256,
            "type": "honor",
            "category": "Attacks",
            "days": 30,
            "desc": "Make a single hit that earns your faction 10 or more respect",
            "advice": "Get the 10th+ bonus hit in a chain."
        },
        {
            "id": 257,
            "type": "honor",
            "category": "Attacks",
            "days": 30,
            "desc": "Participate in a 1,000 length chain",
            "advice": "Participate in chains."
        },
        {
            "id": 317,
            "type": "honor",
            "category": "Attacks",
            "days": 1,
            "desc": "Defeat someone after losing to them within 10 minutes",
            "advice": "Lose to someone, med out of hospital, then defeat them."
        },
        {
            "id": 477,
            "type": "honor",
            "category": "Attacks",
            "days": 100,
            "desc": "Make a single hit that earns your faction 100 or more respect",
            "advice": "Get the 500th+ bonus hit in a chain."
        },
        {
            "id": 478,
            "type": "honor",
            "category": "Attacks",
            "days": 100,
            "desc": "Make a single hit that earns your faction 1,000 or more respect",
            "advice": "Be in good standing with your faction so they let you take the 2500th+ bonus hit in a chain."
        },
        {
            "id": 481,
            "type": "honor",
            "category": "Attacks",
            "days": 1,
            "desc": "Defeat someone who has more battle stats than you in a solo attack",
            "advice": "Ask a friend who you can beat to help you."
        },
        {
            "id": 488,
            "type": "honor",
            "category": "Attacks",
            "days": 100,
            "desc": "Successfully perform a faction retaliation hit",
            "advice": "When you see someone attack a faction member without stealthing, attack them and hospitalize them."
        },
        {
            "id": 500,
            "type": "honor",
            "category": "Attacks",
            "days": 100,
            "desc": "Win an attack with only 1% life remaining",
            "advice": "Hard to focus. Just let it happen. You cannot start the fight at 1%, you have to lose hp during the fight."
        },
        {
            "id": 515,
            "type": "honor",
            "category": "Attacks",
            "days": 28,
            "desc": "Achieve 100 finishing hits with fists or kick",
            "advice": "You always have fists/kick available, so if a target is not a threat try to finish with a fist. Can focus on it during chains."
        },
        {
            "id": 517,
            "type": "honor",
            "category": "Attacks",
            "days": 15,
            "desc": "Achieve 100 one hit kills",
            "advice": "Needs no focus. Rehit your chain targets as they come out of hospital."
        },
        {
            "id": 605,
            "type": "honor",
            "category": "Attacks",
            "days": 1,
            "desc": "Defeat a fellow faction member",
            "advice": "Try to combine it with a merit they need, like getting mugged for $1."
        },
        {
            "id": 615,
            "type": "honor",
            "category": "Attacks",
            "days": 1,
            "desc": "Defeat someone while they are attacking someone else",
            "advice": "Ask a friend who you can beat to help you."
        },
        {
            "id": 627,
            "type": "honor",
            "category": "Attacks",
            "days": 1,
            "desc": "Defeat someone who has at least double your battle stats in a solo attack",
            "advice": "Ask a friend who you can beat to help you."
        },
        {
            "id": 631,
            "type": "honor",
            "category": "Attacks",
            "days": 1,
            "desc": "Defeat someone who has five times more battlestats than you in a solo attack",
            "advice": "Ask a friend who you can beat to help you."
        },
        {
            "id": 639,
            "type": "honor",
            "category": "Attacks",
            "days": 1,
            "desc": "Assist in a single attack",
            "advice": "Will be gotten during other merits."
        },
        {
            "id": 641,
            "type": "honor",
            "category": "Attacks",
            "days": 30,
            "desc": "Make 100 hits in a single chain",
            "advice": "Do what it says. Might be hard if your faction doesn't chain to at least 5000. Stack to 1000 energy beforehand, use xanax and refills on cooldown until chain is over."
        },
        {
            "id": 665,
            "type": "honor",
            "category": "Attacks",
            "days": 1,
            "desc": "Participate in the defeat of a lootable NPC",
            "advice": "Attack Duke, Leslie or Jimmy when they are about to reach loot level 4. Timers can be found on https://yata.yt/loot/"
        },
        {
            "id": 719,
            "type": "honor",
            "category": "Attacks",
            "days": 1,
            "desc": "Successfully defend against someone who has at least double your battle stats",
            "advice": "Ask a friend to bloodbag down to 1hp and then lose to you."
        },
        {
            "id": 739,
            "type": "honor",
            "category": "Attacks",
            "days": 1,
            "desc": "Be mugged for exactly $1",
            "advice": "Empty wallet, then put $20 in wallet. Ask a friend with no mugging merits to mug you."
        },
        {
            "id": 763,
            "type": "honor",
            "category": "Attacks",
            "days": 50,
            "desc": "Win 250 unarmored fights",
            "advice": "Unarmored means no armor. You can use weapons. You will get the title Nudist for a very long time."
        },
        {
            "id": 781,
            "type": "honor",
            "category": "Attacks",
            "days": 1,
            "desc": "Defeat an opponent after hitting at least 10 different body parts in a single attack",
            "advice": "Use pepper spray and a pillow until you've hit 10 different bodyparts, then kill them. Make sure you don't stalemate (25+ actions)."
        },
        {
            "id": 793,
            "type": "honor",
            "category": "Attacks",
            "days": 150,
            "desc": "Use 1,000 rounds of special ammunition",
            "advice": "Buy 2 sets of ammo for mission points, then use them."
        },
        {
            "id": 800,
            "type": "honor",
            "category": "Attacks",
            "days": 150,
            "desc": "Use 100 rounds of special ammunition",
            "advice": "Buy 1 set of ammo for mission points, then use them."
        },
        {
            "id": 827,
            "type": "honor",
            "category": "Attacks",
            "days": 1,
            "desc": "Attack and defeat an opponent with your spouse",
            "advice": "Marry someone, then attack someone together with them."
        },
        {
            "id": 828,
            "type": "honor",
            "category": "Attacks",
            "days": 1,
            "desc": "Defeat someone on the 25th turn of an attack",
            "advice": "Use a pillow and a good weapon. Hit ~18 times, then mix in good weapon to get them low. On 24th attack use pepper spray, on 25th kill them."
        },
        {
            "id": 838,
            "type": "honor",
            "category": "Attacks",
            "days": 1,
            "desc": "Defeat a married couple",
            "advice": "Find a married couple where you can defeat both, then defeat both."
        },
        {
            "id": 896,
            "type": "honor",
            "category": "Attacks",
            "days": 1,
            "desc": "Defeat a company co-worker",
            "advice": "While in a player-owned company, defeat someone else in that company."
        },
        {
            "id": 902,
            "type": "honor",
            "category": "Attacks",
            "days": 1,
            "desc": "Be defeated by a trout",
            "advice": "Ask someone to land a finishing blow on you with a trout. Or bloodbag down to 1% and ask Adobi to equip a trout, then attack him."
        },
        {
            "id": 903,
            "type": "honor",
            "category": "Attacks",
            "days": 100,
            "desc": "Go to hospital 250 times",
            "advice": "Needs no focus. Time spent depends heavily on playstyle."
        },
        {
            "id": 916,
            "type": "honor",
            "category": "Attacks",
            "days": 200,
            "desc": "Save a 100+ chain 10 seconds before it breaks",
            "advice": "Can't really be done without your faction organizing it, since risking a large chain won't be worth it for one person's merit. If your faction won't do it message me and switch faction."
        },
        {
            "id": 942,
            "type": "honor",
            "category": "Attacks",
            "days": 35,
            "desc": "Use 2,500 Hollow Point rounds",
            "advice": "Do missions, buy ammo. There are better things to spend your credits on."
        },
        {
            "id": 943,
            "type": "honor",
            "category": "Attacks",
            "days": 35,
            "desc": "Use 2,500 Piercing rounds",
            "advice": "Do missions, buy ammo. There are better things to spend your credits on."
        },
        {
            "id": 944,
            "type": "honor",
            "category": "Attacks",
            "days": 35,
            "desc": "Use 2,500 Incendiary rounds",
            "advice": "Do missions, buy ammo. There are better things to spend your credits on."
        },
        {
            "id": 945,
            "type": "honor",
            "category": "Attacks",
            "days": 35,
            "desc": "Use 2,500 Tracer rounds",
            "advice": "Do missions, buy ammo. There are better things to spend your credits on."
        },
        {
            "id": 951,
            "type": "honor",
            "category": "Attacks",
            "days": 31,
            "desc": "Use a 12 Gauge Incendiary round",
            "advice": "Equip a shotgun in your primary or secondary so that new mission rewards have a chance to spawn 12 gauge ammo, then pray for incendiary. More info here"
        },
        {
            "id": 955,
            "type": "honor",
            "category": "Attacks",
            "days": 1,
            "desc": "Successfully mug someone who just mugged someone else",
            "advice": "When you mug them they need to have the same amount (or more than) they mugged from the victim. If they mug for $1000 and put $500 in the bank it will not count when you mug them. Time limit is 5 minutes."
        },
        {
            "id": 1002,
            "type": "honor",
            "category": "Attacks",
            "days": 100,
            "desc": "Deal over 1,000,000 total damage",
            "advice": "Can be rushed by attacking NPCs. They are usually attacked at loot level 4. Check their timers here"
        },
        {
            "id": 1004,
            "type": "honor",
            "category": "Attacks",
            "days": 15,
            "desc": "Deal over 100,000 total damage",
            "advice": "Should be complete by the time you're level 15, or in your first chain."
        },
        {
            "id": 269,
            "type": "honor",
            "category": "Casino",
            "days": 14,
            "desc": "Spin the roulette wheel 1,000 times",
            "advice": "2 weeks of spinning. Can be sped up by having several windows open or refreshing page after each spin."
        },
        {
            "id": 326,
            "type": "honor",
            "category": "Casino",
            "days": 14,
            "desc": "Achieve a win-streak of 25 in High-Low",
            "advice": "Use TornTools to not go insane. Could take 3000 tries"
        },
        {
            "id": 327,
            "type": "honor",
            "category": "Casino",
            "days": 20,
            "desc": "Win 50 games of Foot Russian Roulette",
            "advice": "Play 100 games of RR on average. Bet amount does not matter."
        },
        {
            "id": 338,
            "type": "honor",
            "category": "Casino",
            "days": 5,
            "desc": "Achieve a Natural, Six card Charlie, Double down and Insurance on Blackjack",
            "advice": "Google blackjack rules."
        },
        {
            "id": 427,
            "type": "honor",
            "category": "Casino",
            "days": 100,
            "desc": "Win while spinning the Wheel of Awesome",
            "advice": "Spin Leslie's wheels and you'll get it eventually."
        },
        {
            "id": 431,
            "type": "honor",
            "category": "Casino",
            "days": 100,
            "desc": "Win while spinning the Wheel of Lame",
            "advice": "Spin Leslie's wheels and you'll get it eventually."
        },
        {
            "id": 437,
            "type": "honor",
            "category": "Casino",
            "days": 100,
            "desc": "Win while spinning the Wheel of Mediocrity",
            "advice": "Spin Leslie's wheels and you'll get it eventually."
        },
        {
            "id": 513,
            "type": "honor",
            "category": "Casino",
            "days": 1,
            "desc": "Win $100,000,000 on a single game of Russian Roulette",
            "advice": "Ask a friend to help. Don't forget password, and preferably self hosp."
        },
        {
            "id": 519,
            "type": "honor",
            "category": "Casino",
            "days": 5,
            "desc": "Beat 10 unique opponents in Russian Roulette",
            "advice": "Will be gotten during other merits."
        },
        {
            "id": 210,
            "type": "medal",
            "category": "Donator",
            "days": 30,
            "desc": "Be a donator for 30 days",
            "advice": "This game is worth $5."
        },
        {
            "id": 211,
            "type": "medal",
            "category": "Donator",
            "days": 100,
            "desc": "Be a donator for 100 days",
            "advice": "This game is worth $5."
        },
        {
            "id": 29,
            "type": "honor",
            "category": "Drugs",
            "days": 3,
            "desc": "Use 50 Cannabis",
            "advice": "https://wiki.torn.com/wiki/Drugs#Drugs for cooldowns and risk of each drug."
        },
        {
            "id": 30,
            "type": "honor",
            "category": "Drugs",
            "days": 100,
            "desc": "Use 50 Ecstasy",
            "advice": "https://wiki.torn.com/wiki/Drugs#Drugs for cooldowns and risk of each drug."
        },
        {
            "id": 31,
            "type": "honor",
            "category": "Drugs",
            "days": 5,
            "desc": "Use 50 Ketamine",
            "advice": "https://wiki.torn.com/wiki/Drugs#Drugs for cooldowns and risk of each drug."
        },
        {
            "id": 32,
            "type": "honor",
            "category": "Drugs",
            "days": 20,
            "desc": "Use 50 LSD",
            "advice": "https://wiki.torn.com/wiki/Drugs#Drugs for cooldowns and risk of each drug."
        },
        {
            "id": 33,
            "type": "honor",
            "category": "Drugs",
            "days": 15,
            "desc": "Use 50 Opium",
            "advice": "https://wiki.torn.com/wiki/Drugs#Drugs for cooldowns and risk of each drug."
        },
        {
            "id": 34,
            "type": "honor",
            "category": "Drugs",
            "days": 10,
            "desc": "Use 50 Shrooms",
            "advice": "https://wiki.torn.com/wiki/Drugs#Drugs for cooldowns and risk of each drug."
        },
        {
            "id": 35,
            "type": "honor",
            "category": "Drugs",
            "days": 15,
            "desc": "Use 50 Speed",
            "advice": "https://wiki.torn.com/wiki/Drugs#Drugs for cooldowns and risk of each drug."
        },
        {
            "id": 36,
            "type": "honor",
            "category": "Drugs",
            "days": 15,
            "desc": "Use 50 PCP",
            "advice": "https://wiki.torn.com/wiki/Drugs#Drugs for cooldowns and risk of each drug."
        },
        {
            "id": 37,
            "type": "honor",
            "category": "Drugs",
            "days": 50,
            "desc": "Use 50 Xanax",
            "advice": "https://wiki.torn.com/wiki/Drugs#Drugs for cooldowns and risk of each drug."
        },
        {
            "id": 38,
            "type": "honor",
            "category": "Drugs",
            "days": 15,
            "desc": "Use 50 Vicodin",
            "advice": "https://wiki.torn.com/wiki/Drugs#Drugs for cooldowns and risk of each drug."
        },
        {
            "id": 53,
            "type": "honor",
            "category": "Education",
            "days": 200,
            "desc": "Complete all classes in Biology",
            "advice": "Doesn't have to be biology, but 1 bachelor can be done in 200 days if you pick one early. Put merits in edu reduction and get WSSB block."
        },
        {
            "id": 367,
            "type": "honor",
            "category": "Education",
            "days": 1,
            "desc": "Suffer from an acute hemolytic reaction, or be immune to it",
            "advice": "Use an incompatible blood bag. https://i.imgur.com/oayek9n.gif"
        },
        {
            "id": 398,
            "type": "honor",
            "category": "Education",
            "days": 200,
            "desc": "Fill 1,000 empty blood bags",
            "advice": "First 2 educations you should get are Intro to Biochemistry and Intravenous Therapy. Then ALWAYS have a med cooldown from filling blood bags. Always."
        },
        {
            "id": 406,
            "type": "honor",
            "category": "Education",
            "days": 200,
            "desc": "Random chance upon using a blood bag",
            "advice": "Random. Gotten when using a blood bag, not filling an empty blood bag."
        },
        {
            "id": 418,
            "type": "honor",
            "category": "Education",
            "days": 100,
            "desc": "Fill 250 empty blood bags",
            "advice": "First 2 educations you should get are Intro to Biochemistry and Intravenous Therapy. Then ALWAYS have a med cooldown from filling blood bags. Always."
        },
        {
            "id": 653,
            "type": "honor",
            "category": "Education",
            "days": 150,
            "desc": "Complete 10 education courses",
            "advice": "You should always be in an education course."
        },
        {
            "id": 871,
            "type": "honor",
            "category": "Education",
            "days": 30,
            "desc": "Achieve a finishing hit with Kick",
            "advice": "Unlock Kick through the educations Introduction to Self Defense + Kick Boxing. Then do the last hit on someone with Kick."
        },
        {
            "id": 11,
            "type": "honor",
            "category": "Flying",
            "days": 50,
            "desc": "Travel 100 times",
            "advice": "Flying Guide"
        },
        {
            "id": 130,
            "type": "honor",
            "category": "Flying",
            "days": 15,
            "desc": "Travel to Argentina 50 times",
            "advice": "Flying Guide"
        },
        {
            "id": 131,
            "type": "honor",
            "category": "Flying",
            "days": 5,
            "desc": "Travel to Mexico 50 times",
            "advice": "Flying Guide"
        },
        {
            "id": 132,
            "type": "honor",
            "category": "Flying",
            "days": 50,
            "desc": "Travel to the United Arab Emirates 50 times",
            "advice": "Flying Guide. I don't recommend this one as it wastes a ton of energy. If you do it, also defeat 100 people abroad so you waste less energy."
        },
        {
            "id": 133,
            "type": "honor",
            "category": "Flying",
            "days": 15,
            "desc": "Travel to Hawaii 50 times",
            "advice": "Flying Guide"
        },
        {
            "id": 134,
            "type": "honor",
            "category": "Flying",
            "days": 25,
            "desc": "Travel to Japan 50 times",
            "advice": "Flying Guide. I don't recommend this one as it wastes a ton of energy. If you do it, also defeat 100 people abroad so you waste less energy."
        },
        {
            "id": 135,
            "type": "honor",
            "category": "Flying",
            "days": 15,
            "desc": "Travel to the United Kingdom 50 times",
            "advice": "Flying Guide"
        },
        {
            "id": 136,
            "type": "honor",
            "category": "Flying",
            "days": 50,
            "desc": "Travel to South Africa 50 times",
            "advice": "Flying Guide. I don't recommend this one as it wastes a ton of energy. If you do it, also defeat 100 people abroad so you waste less energy."
        },
        {
            "id": 137,
            "type": "honor",
            "category": "Flying",
            "days": 15,
            "desc": "Travel to Switzerland 50 times",
            "advice": "Flying Guide"
        },
        {
            "id": 138,
            "type": "honor",
            "category": "Flying",
            "days": 25,
            "desc": "Travel to China 50 times",
            "advice": "Flying Guide. I don't recommend this one as it wastes a ton of energy. If you do it, also defeat 100 people abroad so you waste less energy."
        },
        {
            "id": 139,
            "type": "honor",
            "category": "Flying",
            "days": 5,
            "desc": "Travel to Canada 50 times",
            "advice": "Flying Guide"
        },
        {
            "id": 207,
            "type": "medal",
            "category": "Flying",
            "days": 10,
            "desc": "Travel abroad 25 times",
            "advice": "Flying Guide"
        },
        {
            "id": 208,
            "type": "medal",
            "category": "Flying",
            "days": 30,
            "desc": "Travel abroad 100 times",
            "advice": "Flying Guide"
        },
        {
            "id": 209,
            "type": "medal",
            "category": "Flying",
            "days": 100,
            "desc": "Travel abroad 500 times",
            "advice": "Flying Guide"
        },
        {
            "id": 272,
            "type": "honor",
            "category": "Flying",
            "days": 5,
            "desc": "Travel to Cayman Islands 50 times",
            "advice": "Flying Guide"
        },
        {
            "id": 541,
            "type": "honor",
            "category": "Flying",
            "days": 2,
            "desc": "Import 100 items from abroad",
            "advice": "Flying Guide"
        },
        {
            "id": 542,
            "type": "honor",
            "category": "Flying",
            "days": 15,
            "desc": "Import 1,000 items from abroad",
            "advice": "Flying Guide"
        },
        {
            "id": 543,
            "type": "honor",
            "category": "Flying",
            "days": 150,
            "desc": "Import 10,000 items from abroad",
            "advice": "Flying Guide"
        },
        {
            "id": 549,
            "type": "honor",
            "category": "Flying",
            "days": 40,
            "desc": "Spend 7 days in the air",
            "advice": "Flying Guide"
        },
        {
            "id": 567,
            "type": "honor",
            "category": "Flying",
            "days": 150,
            "desc": "Spend 31 days in the air",
            "advice": "Flying Guide"
        },
        {
            "id": 846,
            "type": "honor",
            "category": "Flying",
            "days": 100,
            "desc": "Defeat 100 people while abroad",
            "advice": "Hit 1 person per day while flying, or enough to not waste energy if you fly to far away places."
        },
        {
            "id": 853,
            "type": "honor",
            "category": "Flying",
            "days": 1,
            "desc": "Purchase the perfect souvenir abroad",
            "advice": "Which item to buy depends on the last 2 digits in your torn ID. https://i.imgur.com/0RiIKek.png"
        },
        {
            "id": 233,
            "type": "honor",
            "category": "Gym",
            "days": 50,
            "desc": "Own all lightweight gym memberships",
            "advice": "Train in the gym."
        },
        {
            "id": 234,
            "type": "honor",
            "category": "Gym",
            "days": 150,
            "desc": "Own all middleweight gym memberships",
            "advice": "Train in the gym."
        },
        {
            "id": 686,
            "type": "honor",
            "category": "Gym",
            "days": 50,
            "desc": "Attain 10,000 total stats",
            "advice": "Train in the gym."
        },
        {
            "id": 687,
            "type": "honor",
            "category": "Gym",
            "days": 3,
            "desc": "Attain 100 total stats",
            "advice": "Train in the gym."
        },
        {
            "id": 694,
            "type": "honor",
            "category": "Gym",
            "days": 200,
            "desc": "Attain 1,000,000 total stats",
            "advice": "Train in the gym."
        },
        {
            "id": 720,
            "type": "honor",
            "category": "Gym",
            "days": 5,
            "desc": "Attain 1,000 total stats",
            "advice": "Train in the gym."
        },
        {
            "id": 723,
            "type": "honor",
            "category": "Gym",
            "days": 100,
            "desc": "Attain 100,000 total stats",
            "advice": "Train in the gym."
        },
        {
            "id": 888,
            "type": "honor",
            "category": "Gym",
            "days": 100,
            "desc": "Nice",
            "advice": "Make the numbers 420 and 69 appear 5 times across all your battlestats, at least one of each. Like 420,123 142,069 345,691 23,420. You don't need to use all 4 stats if you can fit the numbers in 3 or less stats. Use this calculator"
        },
        {
            "id": 18,
            "type": "honor",
            "category": "Level",
            "days": 4,
            "desc": "Reach level 10",
            "advice": "Needs no focus."
        },
        {
            "id": 34,
            "type": "medal",
            "category": "Level",
            "days": 3,
            "desc": "Reach level Five",
            "advice": "Level up like you should."
        },
        {
            "id": 35,
            "type": "medal",
            "category": "Level",
            "days": 4,
            "desc": "Reach level Ten",
            "advice": "Level up like you should."
        },
        {
            "id": 36,
            "type": "medal",
            "category": "Level",
            "days": 5,
            "desc": "Reach level Fifteen",
            "advice": "Level up like you should."
        },
        {
            "id": 37,
            "type": "medal",
            "category": "Level",
            "days": 20,
            "desc": "Reach level Twenty",
            "advice": "Hit high level targets in chains."
        },
        {
            "id": 38,
            "type": "medal",
            "category": "Level",
            "days": 35,
            "desc": "Reach level Twenty Five",
            "advice": "Hit high level targets in chains."
        },
        {
            "id": 39,
            "type": "medal",
            "category": "Level",
            "days": 60,
            "desc": "Reach level Thirty",
            "advice": "Hit high level targets in chains."
        },
        {
            "id": 40,
            "type": "medal",
            "category": "Level",
            "days": 90,
            "desc": "Reach level Thirty Five",
            "advice": "Hit high level targets in chains."
        },
        {
            "id": 41,
            "type": "medal",
            "category": "Level",
            "days": 130,
            "desc": "Reach level Forty",
            "advice": "Hit high level targets in chains."
        },
        {
            "id": 42,
            "type": "medal",
            "category": "Level",
            "days": 180,
            "desc": "Reach level Forty Five",
            "advice": "Hit high level targets in chains."
        },
        {
            "id": 74,
            "type": "medal",
            "category": "Marriage",
            "days": 50,
            "desc": "Stay married to a single person for 50 days without divorce",
            "advice": "Be faithful."
        },
        {
            "id": 75,
            "type": "medal",
            "category": "Marriage",
            "days": 100,
            "desc": "Stay married to a single person for 100 days without divorce",
            "advice": "Be faithful."
        },
        {
            "id": 76,
            "type": "medal",
            "category": "Marriage",
            "days": 150,
            "desc": "Stay married to a single person for 150 days without divorce",
            "advice": "Be faithful."
        },
        {
            "id": 288,
            "type": "honor",
            "category": "Misc",
            "days": 200,
            "desc": "Reset your merits",
            "advice": "I regret doing this early, but you get a free reset every christmas so use that when you think you know how you want to spend your merits."
        },
        {
            "id": 380,
            "type": "honor",
            "category": "Misc",
            "days": 100,
            "desc": "Achieve the maximum of 99,999 happiness",
            "advice": "https://www.torn.com/forums.php#/p=treads&t=15953131 I did mine in a toy shop."
        },
        {
            "id": 395,
            "type": "honor",
            "category": "Misc",
            "days": 2,
            "desc": "Achieve the maximum of 1,000 energy",
            "advice": "Stack energy to 1000 with 4 xanax, for a chain or happyjump."
        },
        {
            "id": 534,
            "type": "honor",
            "category": "Misc",
            "days": 25,
            "desc": "Drink 500 bottles of alcohol",
            "advice": "Drink beer, gain nerve, do crime. You should always have a booster cooldown active from either candy or alcohol."
        },
        {
            "id": 537,
            "type": "honor",
            "category": "Misc",
            "days": 12,
            "desc": "Eat 500 bags of candy",
            "advice": "You should be chocojumping daily so so you'll get this during that."
        },
        {
            "id": 617,
            "type": "honor",
            "category": "Misc",
            "days": 20,
            "desc": "Increase a merit upgrade to its maximum",
            "advice": "Your first 55 merits should go into education reduction which will triggers this merit."
        },
        {
            "id": 860,
            "type": "honor",
            "category": "Misc",
            "days": 1,
            "desc": "Lease one of your properties to someone",
            "advice": "Lease a trailer to a friend for $1."
        },
        {
            "id": 3,
            "type": "honor",
            "category": "Money",
            "days": 1,
            "desc": "Invest $100,000,000 in the stock market",
            "advice": "Do what it says"
        },
        {
            "id": 12,
            "type": "honor",
            "category": "Money",
            "days": 1,
            "desc": "Make an investment in the city bank",
            "advice": "Invest $100 for 1 week."
        },
        {
            "id": 268,
            "type": "honor",
            "category": "Money",
            "days": 1,
            "desc": "Sell 1,000 points on the market",
            "advice": "Can be done very quickly with $5m. Just buy points, sell them a bit cheaper and they'll sell right away. Repeat until 1000 total sold."
        },
        {
            "id": 271,
            "type": "honor",
            "category": "Money",
            "days": 1,
            "desc": "Trash 5,000 items",
            "advice": "Buy 5000 jackets or some crap and trash them."
        },
        {
            "id": 273,
            "type": "honor",
            "category": "Money",
            "days": 28,
            "desc": "Win 10 auctions",
            "advice": "Pick a number X, then bid that number on every single auction. Eventually you'll have won 10. If not, increase X. My X was 250k. Sell the items back to break even."
        },
        {
            "id": 520,
            "type": "honor",
            "category": "Money",
            "days": 1,
            "desc": "Donate a total of $100,000 to the church",
            "advice": "Do what it says."
        },
        {
            "id": 521,
            "type": "honor",
            "category": "Money",
            "days": 1,
            "desc": "Donate a total of $1,000,000 to the church",
            "advice": "Do what it says."
        },
        {
            "id": 544,
            "type": "honor",
            "category": "Money",
            "days": 14,
            "desc": "Make a profit of $10,000,000 in a single Stock Market sale",
            "advice": "Put some money in a stock and wait for it to be up by $10m, then sell. The more money you invest the faster it will go (and the more you can lose). You can sell and rebuy a benefit block every 7/31 days after you have claimed the rewards, before it starts counting again the next day."
        },
        {
            "id": 678,
            "type": "honor",
            "category": "Money",
            "days": 1,
            "desc": "Successfully prank someone with Stink Bombs",
            "advice": "Buy from item market, use on someone you hate or on a lowbie inactive. It can fail, and battlestats might have an effect."
        },
        {
            "id": 716,
            "type": "honor",
            "category": "Money",
            "days": 1,
            "desc": "Successfully prank someone with Toilet Paper",
            "advice": "Buy from item market, use on someone you hate or on a lowbie inactive. It can fail, and battlestats might have an effect."
        },
        {
            "id": 717,
            "type": "honor",
            "category": "Money",
            "days": 1,
            "desc": "Successfully prank someone with Dog Poop",
            "advice": "Buy from item market, use on someone you hate or on a lowbie inactive. It can fail, and battlestats might have an effect."
        },
        {
            "id": 743,
            "type": "honor",
            "category": "Money",
            "days": 1,
            "desc": "Dump an item with a current market value of at least $1,000,000",
            "advice": "This image shows items with current marketprice between $1m-$1.1m. Updated daily."
        },
        {
            "id": 882,
            "type": "honor",
            "category": "Money",
            "days": 1,
            "desc": "Use a Neumune Tablet to reduce radiation poisoning",
            "advice": "When not at full health, use Blood Bag : Irradiated, then use a Neumune Tablet. Withdraw blood while irradiated if those bags still have value. Current cost of merit: $3m"
        },
        {
            "id": 89,
            "type": "medal",
            "category": "Networth",
            "days": 3,
            "desc": "Have a recorded networth value of $100,000 for at least 3 days",
            "advice": "Get money."
        },
        {
            "id": 90,
            "type": "medal",
            "category": "Networth",
            "days": 3,
            "desc": "Have a recorded networth value of $250,000 for at least 3 days",
            "advice": "Get money."
        },
        {
            "id": 91,
            "type": "medal",
            "category": "Networth",
            "days": 3,
            "desc": "Have a recorded networth value of $500,000 for at least 3 days",
            "advice": "Get money."
        },
        {
            "id": 92,
            "type": "medal",
            "category": "Networth",
            "days": 3,
            "desc": "Have a recorded networth value of $1,000,000 for at least 3 days",
            "advice": "Get money."
        },
        {
            "id": 93,
            "type": "medal",
            "category": "Networth",
            "days": 10,
            "desc": "Have a recorded networth value of $2,500,000 for at least 7 days",
            "advice": "Get money."
        },
        {
            "id": 94,
            "type": "medal",
            "category": "Networth",
            "days": 10,
            "desc": "Have a recorded networth value of $10,000,000 for at least 7 days",
            "advice": "Get money."
        },
        {
            "id": 95,
            "type": "medal",
            "category": "Networth",
            "days": 20,
            "desc": "Have a recorded networth value of $25,000,000 for at least 14 days",
            "advice": "Get money."
        },
        {
            "id": 96,
            "type": "medal",
            "category": "Networth",
            "days": 40,
            "desc": "Have a recorded networth value of $100,000,000 for at least 14 days",
            "advice": "Get money."
        },
        {
            "id": 236,
            "type": "medal",
            "category": "Networth",
            "days": 100,
            "desc": "Have a recorded networth value of $250,000,000 for at least 28 days",
            "advice": "Get money."
        },
        {
            "id": 237,
            "type": "medal",
            "category": "Networth",
            "days": 200,
            "desc": "Have a recorded networth value of $1,000,000,000 for at least 28 days",
            "advice": "Get money."
        },
        {
            "id": 21,
            "type": "honor",
            "category": "Racing",
            "days": 150,
            "desc": "Reach racing class A",
            "advice": "Follow this guide https://www.torn.com/forums.php#/p=threads&t=16126414"
        },
        {
            "id": 571,
            "type": "honor",
            "category": "Racing",
            "days": 150,
            "desc": "Win 100 races",
            "advice": "Follow this guide https://www.torn.com/forums.php#/p=threads&t=16126414"
        },
        {
            "id": 734,
            "type": "honor",
            "category": "Racing",
            "days": 150,
            "desc": "Crash a car while racing",
            "advice": "Low random chance any time you race."
        },
        {
            "id": 1,
            "type": "medal",
            "category": "Rank",
            "days": 5,
            "desc": "Reach the rank of \"\"Beginner\"\"",
            "advice": "Check what triggers you are close to on https://www.tornstats.com/awards.php"
        },
        {
            "id": 2,
            "type": "medal",
            "category": "Rank",
            "days": 5,
            "desc": "Reach the rank of \"\"Inexperienced\"\"",
            "advice": "Check what triggers you are close to on https://www.tornstats.com/awards.php"
        },
        {
            "id": 3,
            "type": "medal",
            "category": "Rank",
            "days": 5,
            "desc": "Reach the rank of \"\"Rookie\"\"",
            "advice": "Check what triggers you are close to on https://www.tornstats.com/awards.php"
        },
        {
            "id": 4,
            "type": "medal",
            "category": "Rank",
            "days": 5,
            "desc": "Reach the rank of \"\"Novice\"\"",
            "advice": "Check what triggers you are close to on https://www.tornstats.com/awards.php"
        },
        {
            "id": 5,
            "type": "medal",
            "category": "Rank",
            "days": 5,
            "desc": "Reach the rank of \"\"Below Average\"\"",
            "advice": "Check what triggers you are close to on https://www.tornstats.com/awards.php"
        },
        {
            "id": 6,
            "type": "medal",
            "category": "Rank",
            "days": 20,
            "desc": "Reach the rank of \"\"Average\"\"",
            "advice": "Check what triggers you are close to on https://www.tornstats.com/awards.php"
        },
        {
            "id": 7,
            "type": "medal",
            "category": "Rank",
            "days": 40,
            "desc": "Reach the rank of \"\"Reasonable\"\"",
            "advice": "Check what triggers you are close to on https://www.tornstats.com/awards.php"
        },
        {
            "id": 8,
            "type": "medal",
            "category": "Rank",
            "days": 60,
            "desc": "Reach the rank of \"\"Above Average\"\"",
            "advice": "Check what triggers you are close to on https://www.tornstats.com/awards.php"
        },
        {
            "id": 9,
            "type": "medal",
            "category": "Rank",
            "days": 80,
            "desc": "Reach the rank of \"\"Competent\"\"",
            "advice": "Check what triggers you are close to on https://www.tornstats.com/awards.php"
        },
        {
            "id": 10,
            "type": "medal",
            "category": "Rank",
            "days": 110,
            "desc": "Reach the rank of \"\"Highly Competent\"\"",
            "advice": "Check what triggers you are close to on https://www.tornstats.com/awards.php"
        },
        {
            "id": 11,
            "type": "medal",
            "category": "Rank",
            "days": 140,
            "desc": "Reach the rank of \"\"Veteran\"\"",
            "advice": "Check what triggers you are close to on https://www.tornstats.com/awards.php"
        },
        {
            "id": 12,
            "type": "medal",
            "category": "Rank",
            "days": 170,
            "desc": "Reach the rank of \"\"Distinguished\"\"",
            "advice": "Check what triggers you are close to on https://www.tornstats.com/awards.php"
        },
        {
            "id": 13,
            "type": "medal",
            "category": "Rank",
            "days": 200,
            "desc": "Reach the rank of \"\"Highly Distinguished\"\"",
            "advice": "Check what triggers you are close to on https://www.tornstats.com/awards.php"
        },
        {
            "id": 50,
            "type": "honor",
            "category": "Seasonal",
            "days": 2,
            "desc": "Achieve 50 skill in hunting",
            "advice": "29th of August is World Tiger Day, where hunting xp is increased 500%. If you stack to 1000 energy and make a few more trips you can get this done in one event. Hunting at any other time is a waste of energy."
        },
        {
            "id": 221,
            "type": "honor",
            "category": "Seasonal",
            "days": 14,
            "desc": "Get 50 or more tags in the Dog Tag competition",
            "advice": "Stack to 1000e before the event, use advanced search to make a list of inactives, then hit them one by one until you have 50."
        },
        {
            "id": 222,
            "type": "honor",
            "category": "Seasonal",
            "days": 1,
            "desc": "Find and collect 10 Easter eggs",
            "advice": "Doesn't have to be in the same year, but you can find 10 in one year."
        },
        {
            "id": 283,
            "type": "honor",
            "category": "Seasonal",
            "days": 1,
            "desc": "Purchase Globule from the Token Shop",
            "advice": "Use competition tokens."
        },
        {
            "id": 308,
            "type": "honor",
            "category": "Seasonal",
            "days": 1,
            "desc": "Purchase Retro from the Token Shop",
            "advice": "Use competition tokens."
        },
        {
            "id": 309,
            "type": "honor",
            "category": "Seasonal",
            "days": 1,
            "desc": "Login on Christmas Day",
            "advice": "Do what it says."
        },
        {
            "id": 375,
            "type": "honor",
            "category": "Seasonal",
            "days": 1,
            "desc": "Login on New Year's Day",
            "advice": "Do what it says."
        },
        {
            "id": 443,
            "type": "honor",
            "category": "Seasonal",
            "days": 1,
            "desc": "Login on Halloween",
            "advice": "Do what it says."
        },
        {
            "id": 459,
            "type": "honor",
            "category": "Seasonal",
            "days": 1,
            "desc": "Login on November 15th",
            "advice": "Do what it says."
        },
        {
            "id": 730,
            "type": "honor",
            "category": "Seasonal",
            "days": 1,
            "desc": "Unlock a backdrop from the token shop",
            "advice": "Use competition tokens."
        },
        {
            "id": 731,
            "type": "honor",
            "category": "Seasonal",
            "days": 1,
            "desc": "Login on Valentine's Day",
            "advice": "Do what it says."
        },
        {
            "id": 843,
            "type": "honor",
            "category": "Seasonal",
            "days": 1,
            "desc": "Defeat someone using only your fists on May 4th",
            "advice": "Do what it says."
        },
        {
            "id": 964,
            "type": "honor",
            "category": "Seasonal",
            "days": 8,
            "desc": "Upgrade your Halloween Basket to Terrifying",
            "advice": "Buy a basket during halloween and attack people. This is definitely possible in 8 days because I did it, but you'll need to use non stop xanax and waste very little energy for the whole event. Else it will take 2 events to complete. Here's a great halloween guide"
        },
        {
            "id": 969,
            "type": "honor",
            "category": "Seasonal",
            "days": 3,
            "desc": "Upgrade your Halloween Basket to Frightful",
            "advice": "Buy a basket during halloween and attack people. Here's a great halloween guide"
        },
        {
            "id": 4,
            "type": "honor",
            "category": "Work",
            "days": 10,
            "desc": "Use 100 job points",
            "advice": "Works with player owned companies and city jobs, the former giving more points per day"
        },
        {
            "id": 164,
            "type": "honor",
            "category": "Work",
            "days": 100,
            "desc": "Use 1000 job points",
            "advice": "Works with player owned companies and city jobs, the former giving more points per day"
        },
        {
            "id": 220,
            "type": "honor",
            "category": "Work",
            "days": 1,
            "desc": "Infuriate all interviewers in starter jobs",
            "advice": "Follow this guide https://www.torn.com/forums.php?p=threads&t=15925001 All need to be completed within ~24 hours."
        },
        {
            "id": 256,
            "type": "medal",
            "category": "Crime",
            "days": 67,
            "desc": "Commit a total of 10,000 criminal offenses",
            "advice": "15 merits, cheapest nerve cost is 2 but you'll get this on the way to other merits"
        },
        {
            "id": 271,
            "type": "medal",
            "category": "Crime",
            "days": 100,
            "desc": "Commit 10,000 Vandalism offenses",
            "advice": "15 merits, cheapest nerve cost is 3."
        },
        {
            "id": 286,
            "type": "medal",
            "category": "Crime",
            "days": 67,
            "desc": "Commit 10,000 Theft offenses",
            "advice": "15 merits, cheapest nerve cost is 2 but you'll get this on the way to other merits"
        },
        {
            "id": 301,
            "type": "medal",
            "category": "Crime",
            "days": 100,
            "desc": "Commit 10,000 Counterfeiting offenses",
            "advice": "15 merits, cheapest nerve cost is 3."
        },
        {
            "id": 316,
            "type": "medal",
            "category": "Crime",
            "days": 167,
            "desc": "Commit 10,000 Fraud offenses",
            "advice": "15 merits, cheapest nerve cost is 5 but is time gated. Don't rush it, let it take time."
        },
        {
            "id": 331,
            "type": "medal",
            "category": "Crime",
            "days": 500,
            "desc": "Commit 10,000 Illicit Service offenses",
            "advice": "15 merits, currently the only option is expensive and timegated. Difficult to grind."
        },
        {
            "id": 346,
            "type": "medal",
            "category": "Crime",
            "days": 220,
            "desc": "Commit 10,000 Cybercrime offenses",
            "advice": "15 merits, cheapest nerve cost is 7."
        },
        {
            "id": 361,
            "type": "medal",
            "category": "Crime",
            "days": "n/a",
            "desc": "Commit 10,000 Extortion offenses",
            "advice": "15 merits, currently unavailable"
        },
        {
            "id": 376,
            "type": "medal",
            "category": "Crime",
            "days": "n/a",
            "desc": "Commit 10,000 Illegal Production offenses",
            "advice": "15 merits, currently unavailable"
        },
        {
            "id": 676,
            "type": "honor",
            "category": "Crime",
            "days": 70,
            "desc": "Successfully burgle all 34 areas",
            "advice": "Final 3 areas unlock at level 100, one in each district."
        },
        {
            "id": 1012,
            "type": "honor",
            "category": "Crime",
            "days": 5,
            "desc": "Find all seven rotten food & drink",
            "advice": "Search the Trash for a chance at the 7 required items. 45 skill required to unlock all items."
        },
        {
            "id": 1014,
            "type": "honor",
            "category": "Crime",
            "days": 21,
            "desc": "Achieve a skill level of 100 in Search for Cash",
            "advice": "Grind until you get there. Read this for detailed info on when to do which crime."
        },
        {
            "id": 1025,
            "type": "honor",
            "category": "Crime",
            "days": 26,
            "desc": "Achieve a skill level of 100 in Bootlegging",
            "advice": "Grind until you get there. You likely never need to manually sell dvds for xp. Just create more."
        },
        {
            "id": 1029,
            "type": "honor",
            "category": "Crime",
            "days": 33,
            "desc": "Achieve a skill level of 100 in Shoplifting",
            "advice": "Grind until you get there. Slightly timegated in the start, but notoriety stacks slower the more skill you gain. You can spend all available nerve eventually."
        },
        {
            "id": 1031,
            "type": "honor",
            "category": "Crime",
            "days": 21,
            "desc": "Acquire 10,000 customers on your online counterfeit DVD store",
            "advice": "Take the education in Computer science that allows you to open an online store. Make dvds in roughly this ratio and amount, and open your online store. Then let it sit for 2 weeks."
        },
        {
            "id": 1032,
            "type": "honor",
            "category": "Crime",
            "days": 12,
            "desc": "Become initiated into one of Torn's five graffiti crews",
            "advice": "Reach 70 crime skill in Graffiti, and 500 rep with East side, then hit the Unique in East side."
        },
        {
            "id": 1034,
            "type": "honor",
            "category": "Crime",
            "days": 28,
            "desc": "Achieve a skill level of 100 in Graffiti",
            "advice": "Grind until you get there."
        },
        {
            "id": 1038,
            "type": "honor",
            "category": "Crime",
            "days": 1,
            "desc": "Achieve 100% notoriety at all stores at the same time in Shoplifting",
            "advice": "Have > 200 nerve available and spam all the shoplifting areas until you have 100% on all. Do this merit early before you have too much skill in shoplifting"
        },
        {
            "id": 1053,
            "type": "honor",
            "category": "Crime",
            "days": 200,
            "desc": "Achieve a skill level of 100 in Card Skimming",
            "advice": "Set 20 on bus station and leave them until 2-3 have been discovered. It will take time but you will spend very little nerve."
        },
        {
            "id": 1054,
            "type": "honor",
            "category": "Crime",
            "days": 30,
            "desc": "Recover a skimmer which has accumulated at least 250 card details",
            "advice": "Set 20 on bus station and leave them until 2-3 have been discovered. Repeat until level 100, you will get this merit on the way."
        },
        {
            "id": 1064,
            "type": "honor",
            "category": "Crime",
            "days": 60,
            "desc": "Achieve a skill level of 100 in Burglary",
            "advice": "Grind until you get there. Residential seems to be better xp due to less casing. I case to maximum to avoid critical fails."
        },
        {
            "id": 1076,
            "type": "honor",
            "category": "Crime",
            "days": 33,
            "desc": "Pickpocket a police officer's badge",
            "advice": "Pickpocket a police officer who is running. High chance of critical fail. Either try to do this at 0 skill where you don't lose any skill, or wait until 100 skill."
        },
        {
            "id": 1078,
            "type": "honor",
            "category": "Crime",
            "days": 32,
            "desc": "Achieve a skill level of 100 in Pickpocketing",
            "advice": "Read this guide or use this script to select safe targets, or you might have a bad time."
        },
        {
            "id": 1083,
            "type": "honor",
            "category": "Crime",
            "days": 17,
            "desc": "Achieve a skill level of 100 in Hustling",
            "advice": "Read the best method for this crime in my compact guide."
        },
        {
            "id": 1097,
            "type": "honor",
            "category": "Crime",
            "days": 20,
            "desc": "Achieve maximum technique in all four Hustling confidence tricks",
            "advice": "Read the best method for this crime in my compact guide."
        },
        {
            "id": 1104,
            "type": "honor",
            "category": "Crime",
            "days": 35,
            "desc": "Achieve a skill level of 100 in Disposal",
            "advice": "Use this table or this script to select the safest methods that give the most skill. Don't just guess. Daily tasks are limited, they respawn at midnight."
        },
        {
            "id": 1106,
            "type": "honor",
            "category": "Crime",
            "days": 30,
            "desc": "Dissolve a Dead Body in Acid",
            "advice": "Dead body unlocks around skill level 85 and appears 1-2 times per week."
        },
        {
            "id": 1118,
            "type": "honor",
            "category": "Crime",
            "days": 80,
            "desc": "Achieve a skill level of 100 in Cracking",
            "advice": "Brute force to unlock characters, guess when you can. Use this script to help with guessing, and use this site with its templates when you build a rig."
        },
        {
            "id": 1129,
            "type": "honor",
            "category": "Crime",
            "days": 25,
            "desc": "Successfully guess 250 password characters in Cracking",
            "advice": "Use this script to help with guessing."
        },
        {
            "id": 1130,
            "type": "honor",
            "category": "Crime",
            "days": 80,
            "desc": "Achieve a skill level of 100 in Forgery",
            "advice": "It's ok to do only driver's license to 100 if the materials are too expensive."
        },
        {
            "id": 1136,
            "type": "honor",
            "category": "Crime",
            "days": 14,
            "desc": "Have ten of the same project in a state of cooldown at the same time in Forgery",
            "advice": "You need at least 25 skill. License plate has a 1hr cd."
        },
        {
            "id": 1277,
            "type": "honor",
            "category": "Crime",
            "days": 80,
            "desc": "Achieve a skill level of 100 in Scamming",
            "advice": "Read this guide to understand how to navigate the tiles"
        },
        {
            "id": 1166,
            "type": "honor",
            "category": "Crime",
            "days": 30,
            "desc": "Respond to a victim's Temptation, Sensitivity, Concern, and Hesitation within a single successful scam attempt",
            "advice": "In scamming - land in a blue arrow, red arrow, yellow tile, and purple tile on the same target and then successfully scam the target"
        }
    ]

    let currentFilters = {
        search: '',
        category: 'all',
        showCompleted: true,
        sortBy: 'default'
    };

    let earned = {
        honors: new Set(),
        medals: new Set()
    };

    function getAPIKey() { return GM_getValue('torn_api_key'); }
    function setAPIKey(key) { GM_setValue('torn_api_key', key); }

    function createControls() {
    const controls = document.createElement('div');
    controls.className = 'controls-container';

    // Search with icon
    const searchWrapper = document.createElement('div');
    searchWrapper.className = 'search-wrapper';

    const search = document.createElement('input');
    search.type = 'text';
    search.placeholder = 'Search achievements...';
    search.className = 'control-search';
    search.value = currentFilters.search;

    const searchIcon = document.createElement('span');
    searchIcon.className = 'search-icon';
    searchIcon.innerHTML = '🔍';

    searchWrapper.append(search, searchIcon);

    // Sort Headers
    const sortHeaderContainer = document.createElement('div');
    sortHeaderContainer.className = 'sort-header-container';

    const sortableFields = [
        { key: 'category', label: 'Category' },
        { key: 'days', label: 'Days' },
        { key: 'completion', label: 'Status' }
    ];

    sortableFields.forEach(field => {
        const header = document.createElement('div');
        header.className = 'sort-header';

        const headerText = document.createElement('span');
        headerText.textContent = field.label;
        header.appendChild(headerText);

        if (currentFilters.sortBy === field.key) {
            header.classList.add('active');
            const dirIndicator = document.createElement('span');
            dirIndicator.className = 'sort-indicator';
            dirIndicator.textContent = currentFilters.sortDirection === 'asc' ? '↑' : '↓';
            header.appendChild(dirIndicator);
        }

        header.dataset.sortKey = field.key;
        sortHeaderContainer.appendChild(header);
    });

    // Show Completed - Modern Toggle Switch
    const toggleLabel = document.createElement('label');
    toggleLabel.className = 'control-toggle';

    const toggleText = document.createElement('span');
    toggleText.textContent = 'Show completed';

    const toggleSwitch = document.createElement('span');
    toggleSwitch.className = 'toggle-switch';

    const toggleCheckbox = document.createElement('input');
    toggleCheckbox.type = 'checkbox';
    toggleCheckbox.checked = currentFilters.showCompleted;

    const toggleSlider = document.createElement('span');
    toggleSlider.className = 'toggle-slider';

    toggleSwitch.append(toggleCheckbox, toggleSlider);
    toggleLabel.append(toggleText, toggleSwitch);

    // Category Navigation
    const categoryNav = document.createElement('div');
    categoryNav.className = 'category-nav';

    const categories = ['all', ...new Set(Object.values(allAchievements).map(a => a.category))];

    categories.forEach(cat => {
        const button = document.createElement('button');
        button.className = `nav-button ${currentFilters.category === cat ? 'active' : ''}`;
        button.textContent = cat.charAt(0).toUpperCase() + cat.slice(1);
        button.dataset.category = cat;
        categoryNav.appendChild(button);
    });

    // Event Listeners
    const updateFilter = () => refreshDisplay();

    search.addEventListener('input', e => {
        currentFilters.search = e.target.value.toLowerCase();
        updateFilter();
    });

    categoryNav.addEventListener('click', e => {
        if (e.target.tagName === 'BUTTON') {
            currentFilters.category = e.target.dataset.category;
            categoryNav.querySelectorAll('.nav-button').forEach(btn =>
                btn.classList.toggle('active', btn === e.target)
            );
            updateFilter();
        }
    });

    toggleCheckbox.addEventListener('change', e => {
        currentFilters.showCompleted = e.target.checked;
        updateFilter();
    });

    sortHeaderContainer.addEventListener('click', e => {
        const header = e.target.closest('.sort-header');
        if (!header) return;

        const sortKey = header.dataset.sortKey;
        if (currentFilters.sortBy === sortKey) {
            currentFilters.sortDirection = currentFilters.sortDirection === 'asc' ? 'desc' : 'asc';
        } else {
            currentFilters.sortBy = sortKey;
            currentFilters.sortDirection = 'asc';
        }

        updateFilter();
    });

    controls.append(searchWrapper, sortHeaderContainer, toggleLabel, categoryNav);
    return controls;
}

    function refreshDisplay() {
        const container = document.getElementById('progress-container');
        container.innerHTML = '';
        container.appendChild(createControls());

        const filtered = allAchievements
        .filter(a => {
            const matchesSearch = a.desc.toLowerCase().includes(currentFilters.search) ||
                  a.advice.toLowerCase().includes(currentFilters.search);
            const matchesCategory = currentFilters.category === 'all' || a.category === currentFilters.category;
            const matchesCompletion = currentFilters.showCompleted || !isCompleted(a.type, a.id);
            return matchesSearch && matchesCategory && matchesCompletion;
        })
        .sort((a, b) => {
            let result;
            switch (currentFilters.sortBy) {
                case 'id':
                    result = a.id - b.id;
                    break;
                case 'days':
                    result = a.days - b.days;
                    break;
                case 'completion':
                    const aCompleted = isCompleted(a.type, a.id) ? 1 : 0;
                    const bCompleted = isCompleted(b.type, b.id) ? 1 : 0;
                    result = aCompleted - bCompleted;
                    break;
                case 'category':
                default:
                    result = a.category.localeCompare(b.category);
                    if (result === 0) result = a.id - b.id; // Tiebreaker
                    break;
            }
            return currentFilters.sortDirection === 'asc' ? result : -result;
        });

        const groupedByType = filtered.reduce((acc, data) => {
            const type = data.type;
            if (!acc[type]) acc[type] = [];
            acc[type].push(data);
            return acc;
        }, {});

        Object.entries(groupedByType).forEach(([type, items]) => {
            const typeSection = document.createElement('div');
            typeSection.className = 'type-section';

            const total = allAchievements.filter(a => a.type === type).length;
            const completed = earned[`${type}s`].size;

            typeSection.innerHTML = `
            <h2 class="type-title">
                ${type.charAt(0).toUpperCase() + type.slice(1)}
                <span class="count">(${completed}/${total})</span>
            </h2>
        `;

            const table = document.createElement('table');
            table.className = 'achievement-table';
            const tbody = document.createElement('tbody');
            const thead = document.createElement('tr');
            thead.className = "achievement-item";
            thead.innerHTML = `
            <td class='achievement-days'>Days</th>
            <td class='achievement-cat'>Category</th>
            <td class='achievement-desc'>Description</th>
        `;
            tbody.appendChild(thead);


            items.forEach(item => {
                const row = document.createElement('tr');
                row.className = `achievement-item ${isCompleted(item.type, item.id) ? 'completed' : 'pending'}`;
                row.innerHTML = `
                <td class="achievement-days">${item.days}</td>
                <td class="achievement-cat">${item.category}</td>
                <td class="achievement-desc">${item.desc} ${!isCompleted(item.type, item.id) ?
                    `<div class="advice">${item.advice}</div>` : ''}
                </td>
            `;
                tbody.appendChild(row);
            });

            table.appendChild(tbody);
            typeSection.appendChild(table);
            container.appendChild(typeSection);
        });
    }

    function showKeyInput() {
    // Create popup element
    const popup = document.createElement('div');
    popup.className = 'api-popup';

    // Create popup content
    popup.innerHTML = `
        <div class="api-popup-container">
            <h3 class="api-popup-title">
                API Key Required
                <span id="closePopup" class="api-popup-close">✕</span>
            </h3>
            <input type="password"
                   id="apiKeyInput"
                   placeholder="Enter API key"
                   class="api-key-input">
            <div class="api-popup-footer">
                <a href="https://www.torn.com/preferences.php#tab=api"
                   target="_blank"
                   rel="noopener noreferrer"
                   class="api-popup-link">
                    Get API key here ↗
                </a>
                <div class="api-popup-actions">
                    <button id="submitKey" class="api-submit-button">
                        Submit
                    </button>
                </div>
            </div>
        </div>
    `;

    document.body.appendChild(popup);

    const inputField = popup.querySelector('#apiKeyInput');
    const submitButton = popup.querySelector('#submitKey');
    const closeButton = popup.querySelector('#closePopup');

    // Submit handler
    const handleSubmit = () => {
        if (inputField.value.trim()) {
            setAPIKey(inputField.value.trim());
            popup.remove();
            checkProgress(inputField.value.trim());
        }
    };

    submitButton.addEventListener('click', handleSubmit);
    inputField.addEventListener('keypress', (e) => {
        if (e.key === 'Enter') handleSubmit();
    });

    // Close handlers
    closeButton.addEventListener('click', () => popup.remove());

    // Close when clicking outside
    document.addEventListener('click', (e) => {
        if (!popup.contains(e.target)) {
            popup.remove();
        }
    }, { once: true });
}


    function isCompleted(type, id) {
        return earned[`${type}s`].has(id);
    }

    function checkProgress(apiKey) {
        GM_xmlhttpRequest({
            method: 'GET',
            url: `https://api.torn.com/user/?selections=honors,medals&key=${apiKey}`,
            onload: function(res) {
                const container = document.getElementById('progress-container');
                try {
                    const data = JSON.parse(res.responseText);
                    if (data.error) throw new Error(data.error.error);

                    earned = {
                        honors: new Set(data.honors_awarded || []),
                        medals: new Set(data.medals_awarded || [])
                    };

                    refreshDisplay();
                    container.style = "display: block; background: #2E2E2E; margin: 1rem 1rem 1rem 0; border-radius: 10px; padding: 1rem; width: 100%; color: #fff";
                } catch (e) {
                    container.innerHTML = `<div class="error">Error: ${e.message}</div>`;
                    setAPIKey('');
                }
            }
        });
    }

    GM_addStyle(`
    * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary-color: #4CAF50;
    --primary-hover: #45a049;
    --primary-light: rgba(76, 175, 80, 0.2);
    --bg-dark: #1a1a1a;
    --bg-darker: #121212;
    --bg-lighter: #262626;
    --border-color: #404040;
    --border-hover: #666;
    --text-light: #fff;
    --text-muted: #888;
    --text-warning: #FFA726;
    --text-error: #EF5350;
    --completed-bg: #1a2a1a;
    --completed-border: #2a4040;
    --border-radius-sm: 4px;
    --border-radius-md: 15px;
    --border-radius-lg: 20px;
    --transition-speed: 0.3s;
    --box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    background: var(--bg-darker);
    color: var(--text-light);
}

/* Typography */
.type-title, .category-title {
    font-family: 'Roboto Condensed', Arial, sans-serif;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    padding: 8px 10px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
}

.type-title {
    font-size: 22px;
    margin: 0 0 15px 0 !important;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.category-title {
    font-size: 18px;
    margin: 10px 0 12px 0 !important;
}

.type-title:hover, .category-title:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateX(2px);
}

.type-title .count, .category-title .count {
    font-size: 0.8em;
    color: var(--text-muted);
    margin-left: 12px;
    font-weight: normal;
    opacity: 0.9;
}

.type-title .count::before, .category-title .count::before {
    content: "•";
    display: inline-block;
    margin: 0 5px 0 0;
    opacity: 0.7;
}

/* Controls Container */
.controls-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 0 0 30px 0;
    padding: 20px;
    background: linear-gradient(to bottom, #252525, var(--bg-dark));
    border-radius: 8px;
    border: 1px solid var(--border-color);
    position: sticky;
    top: 10px;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    align-items: center;
}

/* Search Bar with Icon */
.search-wrapper {
    position: relative;
    flex-grow: 1;
    max-width: 300px;
}

.control-search {
    padding: 12px 15px 12px 40px;
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    color: var(--text-light);
    font-family: 'Roboto', sans-serif;
    transition: all var(--transition-speed) ease;
    width: 100%;
    font-size: 14px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    transition: color var(--transition-speed) ease;
}

.control-search:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--primary-light), inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.control-search:focus + .search-icon {
    color: var(--primary-color);
}

/* Sort Headers */
.sort-header-container {
    display: flex;
    gap: 10px;
    background: var(--bg-darker);
    border-radius: var(--border-radius-md);
    padding: 5px;
    border: 1px solid var(--border-color);
    overflow-x: auto;
    max-width: 100%;
    scrollbar-width: thin;
}

.sort-header {
    padding: 8px 12px;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-speed) ease;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    user-select: none;
}

.sort-header:hover {
    color: var(--text-light);
    background: rgba(255, 255, 255, 0.05);
}

.sort-header.active {
    color: var(--primary-color);
    font-weight: 600;
    background: rgba(76, 175, 80, 0.1);
}

.sort-indicator {
    display: inline-block;
    font-size: 12px;
    transition: transform 0.2s ease;
}

.sort-header.active[data-sort-direction="desc"] .sort-indicator {
    transform: rotate(180deg);
}

/* Toggle Switch (Modern Style) */
.control-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-light);
    font-family: 'Roboto', sans-serif;
    cursor: pointer;
    transition: color var(--transition-speed) ease;
    font-size: 14px;
    user-select: none;
    margin-left: auto;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-lighter);
    transition: .4s;
    border-radius: 24px;
    border: 1px solid var(--border-color);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

input:checked + .toggle-slider {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

input:focus + .toggle-slider {
    box-shadow: 0 0 1px var(--primary-color);
}

input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* Category Navigation */
.category-nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    width: 100%;
    margin-top: 5px;
}

.nav-button {
    padding: 10px 16px;
    background: var(--bg-lighter);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    color: var(--text-light);
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    font-size: 14px;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.nav-button:hover {
    background: #444;
    transform: translateY(-2px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
    border-color: var(--border-hover);
}

.nav-button.active {
    background: var(--primary-color);
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    border-color: var(--primary-color);
}

.nav-button.active:after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid var(--primary-color);
}

/* Sections */
.type-section {
    margin-bottom: 35px;
    background: var(--bg-dark);
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
    padding: 20px;
    box-shadow: var(--box-shadow);
}

.category-section {
    margin-bottom: 25px;
}

/* Achievement List */
.achievement-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 10px;
}

.achievement-item {
    padding: 15px;
    background: var(--bg-lighter);
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all var(--transition-speed) ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.achievement-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
    border-color: var(--border-hover);
}

.achievement-item.completed {
    background: var(--completed-bg);
    border-color: var(--completed-border);
}

.achievement-item.completed::after {
    content: '✓';
    color: var(--primary-color);
    font-weight: bold;
    margin-left: auto;
    font-size: 18px;
}

.toggle-icon {
    margin-right: 10px;
    cursor: pointer;
    user-select: none;
    width: 15px;
    display: inline-block;
    transition: transform var(--transition-speed) ease;
}

.toggle-icon:hover {
    transform: scale(1.2);
}

/* Achievement Components */
.achievement-cat {
    text-align: center;
    color: var(--text-muted);
    min-width: 90px;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--border-radius-sm);
    font-size: 13px;
    letter-spacing: 0.5px;
}

.achievement-days {
    padding: 5px 10px;
    text-align: center;
    color: var(--primary-color);
    min-width: 70px;
    font-weight: bold;
    background: rgba(76, 175, 80, 0.1);
    border-radius: var(--border-radius-sm);
}

.achievement-desc {
    color: var(--text-light);
    flex-grow: 1;
    line-height: 1.5;
}

.advice {
    color: var(--text-warning);
    font-size: 13px;
    margin-top: 5px;
    font-style: italic;
}

/* Error Message */
.error {
    color: var(--text-error);
    padding: 18px;
    background: #2a1a1a;
    border: 1px solid #402020;
    border-radius: var(--border-radius-sm);
    margin: 20px 0;
    box-shadow: var(--box-shadow);
}

/* API Key Input */
#apiKeyInput {
    padding: 10px 15px;
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-light);
    width: 100%;
    margin-bottom: 15px;
    font-family: 'Roboto', sans-serif;
    transition: all var(--transition-speed) ease;
}

#apiKeyInput:focus {
    outline: none;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 2px var(--primary-light);
}

#submitKey {
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-weight: bold;
    transition: all var(--transition-speed) ease;
}

#submitKey:hover {
    background: var(--primary-hover) !important;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

#submitKey:active {
    transform: translateY(1px);
}

/* API Key Popup Styles */
@keyframes slideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.api-popup {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--bg-dark);
    padding: 20px;
    border-radius: var(--border-radius-sm);
    width: 280px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    z-index: 99999;
    animation: slideIn 0.3s ease-out;
    border: 1px solid var(--border-color);
}

.api-popup-container {
    position: relative;
}


.api-popup-title {
    color: var(--text-light);
    margin: 0 0 15px 0;
    font-size: 18px;
    font-family: 'Roboto Condensed', sans-serif;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.api-popup-close {
    cursor: pointer;
    color: var(--text-muted);
    font-size: 16px;
    transition: color var(--transition-speed) ease;
    padding: 5px;
}

.api-popup-close:hover {
    color: var(--text-light);
}

.api-key-input {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 15px;
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-light);
    font-size: 14px;
    font-family: 'Roboto Condensed', sans-serif;
    transition: all var(--transition-speed) ease;
}

.api-key-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.api-popup-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.api-popup-link {
    color: var(--text-muted);
    font-size: 13px;
    text-decoration: none;
    font-family: 'Roboto Condensed', sans-serif;
    transition: color var(--transition-speed) ease;
}

.api-popup-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.api-popup-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.api-submit-button {
    padding: 8px 18px;
    background: var(--primary-color);
    border: none;
    border-radius: var(--border-radius-sm);
    color: var(--text-light);
    cursor: pointer;
    font-size: 14px;
    font-family: 'Roboto Condensed', sans-serif;
    font-weight: 500;
    transition: all var(--transition-speed) ease;
}

.api-submit-button:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.api-submit-button:active {
    transform: translateY(0);
}
    `);

    function init() {
        const container = document.createElement('div');
        container.id = 'progress-content';
        container.className = 'awards-wrap';
        container.style.display = 'none';

        const innerContent = document.createElement('div');
        innerContent.id = 'progress-container';
        innerContent.className = 'awards-cont';
        container.appendChild(innerContent);

        const tabContentParent = document.querySelector('#honors, #medals').parentNode;
        tabContentParent.appendChild(container);
        container.style.display = 'block';

        const apiKey = getAPIKey();
        if (apiKey) {
            checkProgress(apiKey);
        }
        else {
            showKeyInput();
        }
    }

    if (document.readyState === 'complete') init();
    else window.addEventListener('load', init);
})();