@import url('https://fonts.googleapis.com/css?family=Merriweather:300,400,400i,700,900|Montserrat:400,700');


html {
	box-sizing: border-box;
}

*,
*::before,
*::after {
	box-sizing: inherit;
}

html,
body {
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	-webkit-backface-visibility: hidden;
}

body {
	background: transparent;
	font-family: 'Montserrat', sans-serif;
	font-size: 16px;
}

.container {
	display: flex;
	justify-content: center;
	align-items: center;
	flex-direction: column;
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100vh;
	-webkit-backface-visibility: hidden !important;
}

h1 {
	font-family: 'Montserrat';
	font-weight: normal;
	color: #4ab15b;
	margin-bottom: 0px;
}


/*
 * Styles for the deck of cards
 */


.deck {
	width: 85%;
	padding: 1rem;
	border-radius: 4px;
	display: flex;
	flex-wrap: wrap;
	justify-content: space-around;
	align-items: center;
}

.deck .card {
	height: 3.7rem;
	width: 3.7rem;
	margin: 0.2rem 0.2rem;
	background: linear-gradient(135deg, #EC2E25 0%, #91234C 79.92%);
	background-image: url('../img/back.svg');
	background-position: center center;
	background-repeat: no-repeat;
	background-size: cover;
	font-size: 0;
	color: #ffffff;
	border-radius: 5px;
	cursor: pointer;
	display: flex;
	justify-content: center;
	align-items: center;
	box-shadow: 5px 2px 20px 0 rgba(46, 61, 73, 0.5);
}

.deck .card.open {
	transform: rotateY(0);
	cursor: default;
	animation-name: flipInY;
	-webkit-backface-visibility: hidden !important;
	backface-visibility: visible !important;
	animation-duration: .75s;
}

.deck .card.open[type="1"],
.deck .card.match[type="1"] {
	background-image: url(../img/1.jpg);
}
.deck .card.open[type="2"],
.deck .card.match[type="2"] {
	background-image: url(../img/2.jpg);
}
.deck .card.open[type="3"],
.deck .card.match[type="3"] {
	background-image: url(../img/3.jpg);
}
.deck .card.open[type="4"],
.deck .card.match[type="4"] {
	background-image: url(../img/4.jpg);
}
.deck .card.open[type="5"],
.deck .card.match[type="5"] {
	background-image: url(../img/5.jpg);
}
.deck .card.open[type="6"],
.deck .card.match[type="6"] {
	background-image: url(../img/6.jpg);
}
.deck .card.open[type="7"],
.deck .card.match[type="7"] {
	background-image: url(../img/7.jpg);
}
.deck .card.open[type="8"],
.deck .card.match[type="8"] {
	background-image: url(../img/8.jpg);
}


.deck .card.show {
	font-size: 33px;
}

.deck .card.match {
	cursor: default;
	font-size: 33px;
	animation-name: rubberBand;
	-webkit-backface-visibility: hidden !important;
	backface-visibility: visible !important;
	animation-duration: .75s;
}

.deck .card.unmatched {
	animation-name: pulse;
	-webkit-backface-visibility: hidden !important;
	backface-visibility: visible !important;
	animation-duration: .75s;

}

.deck .card.disabled {
	pointer-events: none;
	opacity: 0.9;
}


/*
 * Styles for the Score Panel
 */


.score-panel {
	text-align: left;
	margin-bottom: 10px;
	position: fixed;
	left: 0px;
	top: 0px;
}

.score-panel .stars {
	margin: 0;
	padding: 0;
	display: inline-block;
	margin: 0 5px 0 0;
}

.score-panel .stars li {
	list-style: none;
	display: inline-block;
}

.score-panel .restart {
	float: right;
	cursor: pointer;
}

.fa-star {
	color: #FFD700;
}

.timer {
	display: inline-block;
	margin: 0 1rem;
}


/*
 * Styles for congratulations modal
 */


.overlay {
	position: fixed;
	top: 0;
	bottom: 0;
	left: 0;
	right: 0;
	background: rgba(0, 0, 0, 0.7);
	transition: opacity 500ms;
	visibility: hidden;
	opacity: 0;
}

.overlay:target {
	visibility: visible;
	opacity: 1;
}
  
.popup {
	margin: calc(50vh - 150px) auto;
	padding: 40px 20px;
	background: #ffffff;
	border-radius: 5px;
	width: 500px;
	position: relative;
	transition: all 2s ease-in-out;

}
  
.popup h2 {
	margin-top: 0;
	color: #333;
	text-transform: uppercase;
	letter-spacing: 1px;
}

.popup .close {
	position: absolute;
	top: 20px;
	right: 30px;
	transition: all 200ms;
	font-size: 30px;
	font-weight: bold;
	text-decoration: none;
	color: #333;
}

.popup .close:hover {
	color: #E5F720;
}

.popup .content-1,
.content-2 {
	max-height: 30%;
	overflow: auto;
	text-align: center;
}

.show {
	visibility: visible !important;
	opacity: 100 !important;
}

#starRating li {
	display: inline-block;
}

#play-again {
	background-color: #c72935;
	padding: 0.7rem 1rem;
	font-size: 1.1rem;
	display: block;
	margin: 0 auto;
	width: 50%;
	font-family: 'Montserrat', cursive;
	color: #ffffff;
	border-radius: 5px;
	margin-top: 20px;
	border: 0px;
}

a.close {
	display: none;
}

.popup p {
	margin-top: 0px !important;
	margin-bottom: 0px;
	font-size: 17px;
	line-height: 25px;
}

.restart {
	background: linear-gradient(135deg, #EC2E25 0%, #91234C 79.92%);
	color: white;
	padding: 10px;
	font-size: 20px;
	border-radius: 5px;
	margin-left: 10px;
	display: inline-block;
	position: absolute;
	right: 20px;
	top:20px;
	opacity: 0.8;
	margin-bottom: 20px;
	position: fixed;

}
.restart:active {
	opacity: 1;	
}


h1 {
	position: relative;
}

/* animations */
@keyframes flipInY {
	from {
		transform: perspective(400px) rotate3d(0, 1, 0, 90deg);
		animation-timing-function: ease-in;
		opacity: 0;
	}

	40% {
		transform: perspective(400px) rotate3d(0, 1, 0, -20deg);
		animation-timing-function: ease-in;
	}

	60% {
		transform: perspective(400px) rotate3d(0, 1, 0, 10deg);
		opacity: 1;
	}

	80% {
		transform: perspective(400px) rotate3d(0, 1, 0, -5deg);
	}

	to {
		transform: perspective(400px);
	}
}

@keyframes rubberBand {
	from {
		transform: scale3d(1, 1, 1);
	}

	30% {
		transform: scale3d(1.25, 0.75, 1);
	}

	40% {
		transform: scale3d(0.75, 1.25, 1);
	}

	50% {
		transform: scale3d(1.15, 0.85, 1);
	}

	65% {
		transform: scale3d(.95, 1.05, 1);
	}

	75% {
		transform: scale3d(1.05, .95, 1);
	}

	to {
		transform: scale3d(1, 1, 1);
	}
}

@keyframes pulse {
	from {
		transform: scale3d(1, 1, 1);
	}

	50% {
		transform: scale3d(1.2, 1.2, 1.2);
	}

	to {
		transform: scale3d(1, 1, 1);
	}
}


/****** Media queries
***************************/


@media (max-width: 320px) {
	.deck {
		width: 85%;
	}

	.deck .card {
		height: 4.7rem;
		width: 4.7rem;
	}
}


/* For Tablets and larger screens
****************/

@media (min-width: 768px) {
	.container {
		font-size: 22px;
	}

	.deck {
		width: 850px;
		height: 850px;
	}

	.deck .card {
		height: 175px;
		width: 175px;
	}


}

