html {
    box-sizing: border-box;
}

*,
*::before,
*::after {
    box-sizing: inherit;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    background: #ffffff url('../img/geometry2.png'); /* Background pattern from Subtle Patterns */
    font-family: 'Nanum Gothic Coding', monospace;
	position: relative;
}

.container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.final-info {
	position: absolute;
	top: 25%;
	left: 33%;
	min-width: 100vw;
}

.invisible {
	visibility: hidden;
}

.final-info ul {
	list-style: none;
	padding: 0px;
}

.right-just {
	display: inline-block;
	min-width: 180px;
}

h1 {
    font-weight: 300;
}

/*
 * Styles for the deck of cards
 */

.deck {
    width: 660px;
    min-height: 680px;
    background: linear-gradient(160deg, #02ccba 0%, #aa7ecd 100%);
    padding: 32px;
    border-radius: 10px;
    box-shadow: 12px 15px 20px 0 rgba(46, 61, 73, 0.5);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin: 0 0 3em;
}

.deck .card {
	transform: rotateY(180deg);
    height: 125px;
    width: 125px;
    background: #2e3d49;
    font-size: 0px;
    color: #ffffff;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: -5px 2px 20px 0 rgba(46, 61, 73, 0.5);
}

@keyframes flip-open {
	0%		{transform: rotateY(180deg); font-size: 0px; background: #2e3d49;}
	49%		{transform: rotateY(90deg); font-size: 0px; background: #2e3d49;}
	50%		{transform: rotateY(89deg); font-size: 33px; background: #02b3e4;}
	100%	{transform: rotateY(0deg); font-size: 33px; background: #02b3e4;}
}

.deck .card.open {
    cursor: default;
	animation:	flip-open 0.40s ease 0s 1 normal forwards running;
    box-shadow: 5px 2px 20px 0 rgba(46, 61, 73, 0.5);
}

@keyframes icon-balloon {
	0%		{font-size: 33px;}
	50%		{font-size: 50px;}
	100%	{font-size: 33px;}
}

.deck .card.match {
	transform: rotateY(0deg);
    cursor: default;
    background: #02ccba;
	animation:	icon-balloon 0.40s ease 0s 1 normal forwards running;
    box-shadow: 5px 2px 20px 0 rgba(46, 61, 73, 0.5);
}

/*	to repeat the match animation at the end, use an differently named selector with identical rules	*/
@keyframes icon-balloon2 {
	0%		{font-size: 33px;}
	25%		{font-size: 50px;}
	50%		{font-size: 33px;}
	75%		{font-size: 50px;}
	100%	{font-size: 33px;}
}

.deck .card.rematch {
	transform: rotateY(0deg);
    cursor: default;
    background: #02ccba;
	animation:	icon-balloon2 0.50s ease 0s 1 normal forwards running;
    box-shadow: 5px 2px 20px 0 rgba(46, 61, 73, 0.5);
}

@keyframes jangle-close {
	0%		{transform: rotateZ(0deg); font-size: 33px; background: red;}
	16%		{transform:	rotateZ(-35deg); font-size: 33px; background: red;}
	32%		{transform:	rotateZ(0deg); font-size: 33px; background: red;}
	48%		{transform:	rotateZ(-35deg); font-size: 33px; background: red;}
	64%		{transform:	rotateZ(0deg) rotateY(0deg); font-size: 33px; background: red;}
	79%		{transform: rotateZ(0deg) rotateY(89deg); font-size: 33px; background: red;}
	80%		{transform: rotateY(90deg); font-size: 0px; background: #2e3d49;}
	100%	{transform: rotateY(180deg); font-size: 0px; background: #2e3d49;}
}

.deck .card.close {
    cursor: default;
	animation:	jangle-close 0.50s ease-in 0s 1 normal forwards running;
}

/*
 * Styles for the Score Panel
 */

.score-panel {
	display: flex;
	justify-content: space-between;
    text-align: left;
    width: 345px;
    margin-bottom: 10px;
}

.score-panel .stars,
.final-rating .stars {
	margin: 0;
	padding: 0;
	display: inline-block;
	margin: 0 5px 0 0;
}

.score-panel .stars li,
.final-rating .stars li {
	list-style: none;
	display: inline-block;
}

.timeclock,
.move-count,
.final-time,
.final-count,
.right-just {
	font-size: 1.25em;
}

.score-panel .restart,
.new-stats .final-restart {
	cursor: pointer;
}

.final-restart {
	color: red;
}

@media screen and (max-width: 660px)
{
	.deck {
		width: 350px;
	}
	
	.card {
		margin: 15px 0px;
	}
	
	.final-info {
		left: 10%;
	}
}
