Alchemy

Alchemy is how you produce and upgrade crystals, which you can slot on your characters to boost their stats.

Alchemist
There are 5 different alchemists, each of which costs more than the one to his left. Each time you click the button, the next alchemist is picked randomly. The first four can only give you green, blue, or purple, but the ones farther to the right have a higher chance of better crystals. The fifth can give you green, blue, purple, or rare, or shards that can be used to purchase rares. Nobody cares about this after the very early part of the game.

The Auto button effectively clicks Alchemy over and over until you've made 28 crystals or run out of gold.

You can drag crystals to Crystal Bag to use them, and click Stock Energy to convert all crystals you haven't put in your Bag into energy. (See below.)

The third number at the bottom of the screen, after gold and diamonds, is crystal shards. See below on that.

Epic crystals cannot be found at the alchemist.

Bag and Slots
Your bag starts with only a few slots, but can be expanded with diamonds, just like your backpack.

Each comp also has slots. Mains and 4-gold comps have 8, 3-gold have 7, and so on. You can put any crystal into any slot, except that you can't put two crystals that boost the same stat onto the same comp.

There is an exception: an epic boosts two stats, but can still be used together with non-epics that boost the same stats. So, you can use an Overkill (skl atk/lethal), a Nightmare (skl atk), and a Lionheart (lethal) all at the same time.

The Exchange button at the bottom lets you exchange shards for rare crystals.

Shards
Each kind of rare has a different cost in shards, from 20 to 50. (See the table below.)

In the mid-game, it may be worth holding off on using shards until you know which rares you're missing to complete the set. (It sucks to use 50 shards on an Immortal, and then get an Immortal from alchemy the next day.)

Eventually, you'll have more shards than you know what to do with. Every few months you may get a new character who needs a different crystal from whoever he's replacing, but that's about it. You can convert them to energy by buying a 20-shard crystal to stock for 360 energy, but this is hardly worth the clicks. Alternatively, you can just hold onto hundreds of shards forever, in hopes that one day they'll add a new use for them (maybe turning them into epic shards?).

Crystals
There are 16 stats that can be boosted, and crystals in four levels (green, blue, purple, and rare) for each.

There are also 31 epic crystals that boost two different stats (which obviously doesn't cover all of the 256 possible combinations).

Each crystal has a base value (or, for epics, two base values). Blue gems have 2x the base value of green, purple gems 4x the base, and rare gems 8x the base. (This may not be right—in which case the chart below is wrong for everything below rares…)

Epics usually have 12x or 16x the base for both stats, but they're not consistent.

Energy
Any crystal can be stocked for energy. The base value is 45 for green, 90 for blue, 180 for purple, 360 for rare, and as far as I know nobody's ever stocked an epic, but it's probably either 720 or 1440.

If you've spent any energy upgrading a crystal's level, you get all of that energy back, on top of the base value, when you stock it.

Leveling
Each crystal can be upgraded up to level 10. The stat value is the crystal's base value times its level.

Upgrade costs start at 240 (green), 480 (blue), 960 (purple), 1920 (rare), or 7680 (epic) to go from level 1 to level 2, and double each level.

This means that upgrading anything other than a rare beyond the first few levels is not worth it. For example, a purple Pierce gem has a base value of +20, and a base upgrade cost of 960. To get it to level 5, for +100 Pierce, costs 960+1920+3840+7680=14400 energy. A rare Pierce gem has a base value of +40, and a base upgrade cost of 1920. To get it to level 3, for +120 Pierce, costs 1920+3840=5760 energy.

Tips
For most people, Havoc is the most important crystal in the game. Levels 6, 8, and 10 are especially important—6 means you can usually skill on the second round; 8 means you can skill on the first round if you get hit before your turn, or if a +rage companion like Lulu boosts you; 10 means you can skill on the first round no matter what (unless you get tranquilized). There's a long period in the game where everyone with havoc 8 beats everyone without it, and then an even longer period when almost everyone is using havoc 10 on Ying Chen and competing over Formation speed.

Don't waste a slot with a lethal crystal unless your critical is reasonably high.

Early on, you can neglect defensive crystals, except maybe HP and skill def, and hit and pierce crystals too. Later, this will change. Almost everyone will need high HP and skill def; your front-line comps will need either dodge or phys def and block; etc.

Eventually, you will probably need to build up some alternate crystals for specific fights—resilience for opponents with high critical, magic def for opponents with high magic damage (especially certain Elite/Hell instances and Dragon's Lair level 80), extra offense for World Boss, hit for PvP against dodging targets, pierce for both PvP and PvE against blocking targets, etc. Fortunately, by that point, you'll be rolling in shards, but energy will still be a problem.

It's sometimes worth keeping old comps around in the lineup just to use their slots as extra bag slots for holding alternate crystals. (They can also hold spare gear, to save backpack space, but that doesn't come up as often.)

To get the energy-based Goals, whenever you have a decent amount of energy saved up and some time to kill, Auto up a page full of crystals, drag them all to your bag, upgrade each one as far as possible, and stock it. If you spend 122340 energy getting a green crystal to level 9 then immediately stock it, you get credit for gaining that 122340 energy. Do that to a whole page of crystals, and that's 3.4M. Do that 33 times in a row, and you've got the 100M energy goal (and carpal tunnel syndrome). This may sound cheap, but the admins have confirmed that they don't consider it an exploit, just clever gameplay.