body {
    height: 100vh;
    perspective: 1200px;
    background: url(./images/wood.jpg) center repeat;
    font-family: sans-serif;
}

* {
    margin: 0;
    padding: 0;
}

.half-opacity {
    opacity: 0.3;
}

h1 {
    margin-top: 2%;
    font-size: 36px;
    margin-bottom: 4px;
}

h1,
h2 {
    text-align: center;
    text-transform: uppercase;
}

.some-page-wrapper {
    width: 400px;
    margin: 0 auto;
    margin-top: 20px;
}

.row {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
}

.column {
    display: flex;
    flex-direction: column;
    flex-basis: 100%;
    flex: 1;

}

details {
    text-align: center;
    line-height: 1.4;
    font-size: 18px;
    position: relative;
    z-index: 10;
    max-width: 460px;
    margin: 0 auto;
}

button {
    background: orange;
    height: 60px;
    text-align: center;
    text-transform: uppercase;
    font-size: 20px;
    margin: 20px;
    min-width: 100px;
    border-radius: 8px;
    box-shadow: 0 0 10px #333;
    padding: 4px;
}

details:hover,
button:hover {
    background: #fbc300;
    color: #2e2e2e;
    cursor: pointer;
}

.board {
    display: grid;
    grid-gap: 20px;
    grid-template-columns: repeat(4, 100px);
    grid-template-rows: repeat(3, 100px);
    position: relative;
    top: 20px;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    width: 460px;
    height: 340px;
    margin: 0 auto;
}

.hide,
.clone {
    display: none;
}


@keyframes blinker {
    from {
        opacity: 1.0;
    }

    50% {
        opacity: 0.5;
    }

    to {
        opacity: 1.0;
    }
}

.cube {
    -webkit-animation: enter 600ms ease-out;
    animation: enter 600ms ease-out;
    transform-style: preserve-3d;
    transform: translateZ(0) scale(1);
    transition: all 350ms ease-out;
    transform-origin: 50% 50%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.cube.flipped {
    pointer-events: none;
    transform: rotateY(180deg) translateZ(0) scale(1);
    transition: all 500ms ease-out;
}

.cube.matched {
    pointer-events: none;
    transform: rotateY(180deg) translateZ(0) scale(1);
    animation: blinker 400ms ease;
}

.face {
    outline: 1px solid transparent;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    box-shadow: inset 0 0 2px 1px #fff0d2;
    height: 100px;
    overflow: hidden;
    position: absolute;
    transform-origin: 50% 50%;
    width: 100px;
}

.face:nth-child(1) {
    background-color: wheat;
    cursor: pointer;
    transform: rotateY(0deg) translateZ(10px);
    transition: background 150ms ease-out;
}

.face:nth-child(1):before {
    align-items: center;
    bottom: 0;
    color: #93794c;
    content: "?";
    display: flex;
    font-size: 60px;
    justify-content: center;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
}

.face:nth-child(2) {
    background-color: #efca86;
    width: 20px;
    transform: rotateY(90deg) translateZ(90px);
}

.face:nth-child(3) {
    background-color: dodgerblue;
    transform: rotateY(180deg) translateZ(10px);
}

.face:nth-child(4) {
    background-color: #efca86;
    width: 20px;
    transform: rotateY(270deg) translateZ(10px);
}

.face:nth-child(5) {
    background-color: #efca86;
    height: 20px;
    transform: rotateX(90deg) translateZ(10px);
}

.face:nth-child(6) {
    background-color: #efca86;
    height: 20px;
    transform: rotateX(-90deg) translateZ(90px);
}

.overlay {
    align-items: center;
    width: 100vw;
    display: flex;
    justify-content: center;
    left: 0;
    opacity: 1;
    position: absolute;
    height: 100vh;
    top: 0;
    transition: all 500ms ease-out;
    z-index: 100;
}

.overlay.hidden {
    opacity: 0;
    pointer-events: none;
    transition: all 300ms ease-out;
}

.overlay.hidden .gameover {
    transform: translateY(60px);
    transition: all 300ms ease-out;
}

select {
    width: 160px;
    font-size: 20px;
    justify-content: space-between;
    transition: all 500ms ease-out;
    text-align: center;
}

.gameover {
    background: url(./images/paper.png) center no-repeat;
    background-size: cover;
    box-shadow: 0 0 20px #333;
    border-radius: 2px;
    color: #2e2e2e;
    font-size: 32px;
    height: 180px;
    width: 340px;
    transition: all 500ms ease-out;
    text-align: center;
    margin: 60px auto 0 auto;
    padding: 20px;
}

.reset {
    background-color: #fbc300;
    border-radius: 50%;
    border: 0;
    box-shadow: 0px 6px 0px 0px #f2a003;
    cursor: pointer;
    display: block;
    height: 94px;
    margin-left: 20px;
    position: relative;
    top: -3px;
    width: 96px;
}

.reset:active {
    box-shadow: none;
    top: 0;
}

.reset:focus {
    outline: 0;
}

/* flower */
[data-tile=anthurium] div:nth-child(3) {
    background: #fff8e7 url(./images/flowers/anthurium.png) center no-repeat;
    background-size: 60px cover;
}

[data-tile=daffodil] div:nth-child(3) {
    background: #fff8e7 url(./images/flowers/daffodil.png) center no-repeat;
    background-size: 60px cover;
}

[data-tile=heather] div:nth-child(3) {
    background: #fff8e7 url(./images/flowers/heather.png) center no-repeat;
    background-size: 60px cover;
}

[data-tile=pansies] div:nth-child(3) {
    background: #fff8e7 url(./images/flowers/pansies.png) center no-repeat;
    background-size: 60px cover;
}

[data-tile=protea] div:nth-child(3) {
    background: #fff8e7 url(./images/flowers/protea.png) center no-repeat;
    background-size: 60px cover;
}

[data-tile=scarlet] div:nth-child(3) {
    background: #fff8e7 url(./images/flowers/scarlet.png) center no-repeat;
    background-size: 60px cover;
}

/* rpg */
[data-tile=coin] div:nth-child(3) {
    background: #fff8e7 url(./images/rpg/coin.png) center no-repeat;
    background-size: 60px;
}

[data-tile=crystal] div:nth-child(3) {
    background: #fff8e7 url(./images/rpg/crystal.png) center no-repeat;
    background-size: 60px;
}

[data-tile=mineral] div:nth-child(3) {
    background: #fff8e7 url(./images/rpg/mineral.png) center no-repeat;
    background-size: 85px;
}

[data-tile=paper] div:nth-child(3) {
    background: #333 url(./images/rpg/paper.png) center no-repeat;
    background-size: 85px;
}

[data-tile=skull] div:nth-child(3) {
    background: #333 url(./images/rpg/skull.png) center no-repeat;
    background-size: 60px;
}

[data-tile=wood] div:nth-child(3) {
    background: #fff8e7 url(./images/rpg/wood.png) center no-repeat;
    background-size: 85px;
}

/* egg */
[data-tile=blue] div:nth-child(3) {
    background: #fff8e7 url(./images/eggs/blue.png) center no-repeat;
    background-size: 60px;
}

[data-tile=green] div:nth-child(3) {
    background: #fff8e7 url(./images/eggs/green.png) center no-repeat;
    background-size: 60px;
}

[data-tile=purple] div:nth-child(3) {
    background: #fff8e7 url(./images/eggs/purple.png) center no-repeat;
    background-size: 60px;
}

[data-tile=red] div:nth-child(3) {
    background: #fff8e7 url(./images/eggs/red.png) center no-repeat;
    background-size: 60px;
}

[data-tile=white] div:nth-child(3) {
    background: #111 url(./images/eggs/white.png) center no-repeat;
    background-size: 60px;
}

[data-tile=yellow] div:nth-child(3) {
    background: #fff8e7 url(./images/eggs/yellow.png) center no-repeat;
    background-size: 60px;
}

/* fishes */
[data-tile=fish1] div:nth-child(3) {
    background: #333 url(./images/fish/fish1.png) center no-repeat;
    background-size: 85px;
}

[data-tile=fish2] div:nth-child(3) {
    background: #fff8e7 url(./images/fish/fish2.png) center no-repeat;
    background-size: 85px;
}

[data-tile=fish3] div:nth-child(3) {
    background: #333 url(./images/fish/fish3.png) center no-repeat;
    background-size: 85px;
}

[data-tile=fish4] div:nth-child(3) {
    background: #fff8e7 url(./images/fish/fish4.png) center no-repeat;
    background-size: 85px;
}

[data-tile=fish5] div:nth-child(3) {
    background: #fff8e7 url(./images/fish/fish5.png) center no-repeat;
    background-size: 85px;
}

[data-tile=fish6] div:nth-child(3) {
    background: #333 url(./images/fish/fish6.png) center no-repeat;
    background-size: 85px;
}

@-webkit-keyframes enter {
    0% {
        transform: translateZ(-20px) scale(0.3);
    }

    50% {
        transform: translateZ(20px) scale(1.02);
    }

    100% {
        transform: translateZ(0) scale(1);
    }
}

@keyframes enter {
    0% {
        transform: translateZ(-20px) scale(0.3);
    }

    50% {
        transform: translateZ(20px) scale(1.02);
    }

    100% {
        transform: translateZ(0) scale(1);
    }
}