Ever play Memory as a kid? In this game you're presented with an even number of cards, and pairs of the cards have the same face. All of the cards start face down. You then reveal two cards - if they match they remain face up. Here's our HTML

Now, this challenge is broken in two. The CSS side of the challenge is to do the following:

Beginner LevelStyle the shape of the cards, their backs and fronts. Respond to Java Script toggling the presence of 'down' - if the class is present the card should be face down.Your styling must tolerate Java Script changing the position of the card in the DOM or absolute positioning of the card.

Javascript will also be applying a class of 'matched' to the cards when the player successfully matches a pair. You need to style for this (perhaps by changing the border color). To test your styling you'll need to manually edit the HTML (or do the JS challenge as well )

Advanced and ExpertAnimate the flip using a 3D transition.

As usual, use spoiler tags to hide your answers to the challenge that you post.

This...[noparse]

[spoiler]Like this[/spoiler]

[/noparse]

Renders

[spoiler]Like this[/spoiler]

If you have Java Script programming skills there is a [thread=991431]tie in challenge[/thread] in the Java Script forum.

Note - the data-face attribute is present to make the JS code easier to write - I realize it's redundant to the final CSS class name. I also know it's possible to style on attributes, but browser support for that trick is uneven (not that such has stopped us before). Both are presented to keep the difficulty of the challenge down some.