/*----------------------------------  
Global Styles
------------------------------------*/
* {
	margin: 0;
	padding: 0;
}

/* border box fix */
*,
*::before,
*::after {
	box-sizing: inherit;
}

html {
	box-sizing: border-box;
}

body {
	/* Background pattern from Subtle Patterns */
	background: url('../img/bg.jpg');
	/*background-repeat: no-repeat;*/
	background-attachment: fixed;
	font-family: "Open Sans", sans-serif;
	/*one Em roughly ten pixels (16 x 62.5% = 10)*/
	font-size: 62.5%;
	letter-spacing: 1.5px;
	margin: 0;
	text-align: center;
	z-index: 1000000000;
}

.container {
	display: flex;
	justify-content: center;
	align-items: center;
	flex-direction: column;
	margin-top: 0;
	z-index: 9999;
}

ul > li {
	list-style: none;
}

.card,
.reset-btn {
	cursor: pointer;
}
.reset {
	display: none;
}
.header{
	z-index:99999;	
}
.logo-main {
	width: 1080px;
}

.btn {
	border-radius: 1em;
	border: none;
	color: #fff;
	box-shadow: 5px 2px 20px 0 rgba(46, 61, 73, 0.5);
	margin-top: 1em;
	padding: 1em;
}

/*----------------------------------  
Header
------------------------------------*/

h1 {
	font-size: 4em;
	font-weight: 400;
}

/*.fa {
	font-size: 1.5em;
}*/

h2 {
	font-size: 3em;
	font-weight: 600;
	padding-bottom: 0.5em;
}

p {
	font-size: 1.6em;
}

h3 {
	font-weight: 400;
}

/*----------------------------------  
Section - Score Panel
------------------------------------*/

.score-panel {
	font-size: 2.6em;
	padding: 1em 0 3em;
	z-index:99999;
	color: #FFFFFF;
	text-shadow: 2px 2px 4px black;
}

.star-rating > li {
	display: inline-block;
	padding: 0.5em;
}

.moves-counter {
	padding: 0.5em;
}

.reset-btn {
	background: #000;
}

.timer-container {
	background: #fff0;
	border-radius: 0.5em;
	color: #000;
	margin: 1em;
	padding: 0.5em;
}

.timer {
	font-size: 1em;
	color: #FFFFFF;
}

/*----------------------------------  
Section - Modal
------------------------------------*/
/*
Help with the modal from
https://www.w3schools.com/howto/howto_css_modals.asp
*/

/* Modal (background) */
.modal {
	/*Hidden by default */
	display: none;
	position: fixed;
	z-index: 9999999;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	/* Fallback color */
	background-color: rgb(46, 61, 73);
	/* With opacity */
	background-color: rgba(46, 61, 73, 0.6);
}

/* Modal Content/Box */
.modal-content {
	display: flex;
    background: url(../img/bg3.jpg) no-repeat;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: #fff;
    margin: 5% auto;
    padding: 2em;
    border: 0.8em solid #fc4;
    margin-top: 170px;
    width: 70%;
	height: 80%;
    padding-bottom: 50px;
    background-size: cover;
    background-position: bottom;
}

/* The Close Button */
.close {
	align-self: flex-end;
	color: #28e;
	font-size: 5em;
}

.close:hover,
.close:focus {
	color: #5cf;
	text-decoration: none;
	cursor: pointer;
}

/* Modal Image*/
.modal-img {
	display: inline-block;
	margin: 1em 0 1em;
	width: 20em;
}

p.stats {
	font-weight: 600;
}

p.stats:last-child {
	margin-bottom: 1em;
}

.play-again-btn {
	background: #28e;
	margin-bottom: 5em;
	margin-top: 5em;
}

/*----------------------------------  
Deck of Cards
------------------------------------*/
/*Mobile first responsivness*/
.deck {
	/*background: linear-gradient(to bottom, #5cf, #28e);*/
	background: #2266e2;
	border-radius: 1.5em;
	display: flex;
	flex-wrap: wrap;
	justify-content: space-around;
	align-items: center;
	height: 90em;
	margin-bottom: 6em;
	padding: 0.5em;
	width: 90em;
	z-index:99999;
}

.deck,
.card {
	box-shadow: 5px 2px 20px 0 rgba(46, 61, 73, 0.5);
}

.card {
	background: #FFD166;
	border-radius: 0.5em;
	height: 10em;
	width: 10em;
}

/*
To disable the color highlight if and img is clicked
https://stackoverflow.com/questions/21107439/disable-or-change-firefoxs-element-image-highlight-color
*/
img {
	user-select: none;
	width: 8em;
}

.deck img {
	visibility: hidden;
}

.deck .card.flip {
	background: #fff;
	cursor: default;
	transform: rotateY(360deg); /* Halfway flip to reveal front */
	transition: transform 0.6s ease-in-out;
	pointer-events: none;
}

img {
	border-radius: 5px;
}

/* Card hides, flipping back */
.deck .card {
	transform: rotateY(0deg); /* Initial hidden state */
	transition: transform 0.6s ease-in-out; /* Smooth transition */
}

/* To make sure the image hides when the card flips back */
.flip img {
	background: #fff;
	visibility: visible; /* Show image when card is flipped */
}

.deck img {
	visibility: hidden; /* Hide images by default */
}

.flip img {
	background: #fff;
	visibility: visible;
}

.deck .card.match {
	background: #39d;
	visibility: visible;
	cursor: default;
	animation: pulse 1s;
}

.match img {
	background: #39d;
}

@keyframes pulse {
	0% {
		transform: scale(1);
	}
	80% {
		transform: scale(1.1);
	}
	100% {
		transform: scale(1);
	}
}

/*---------------------------------- 
Footer
------------------------------------*/

.footer {
	color: #666;
	margin-bottom: 2em;
}

.footer > p {
	font-size: 1em;
	padding: 1em;
}

.footer a:link,
.footer a:visited {
	color: #28e;
	text-decoration: none;
}

/*---------------------------------- 
Media Queries
------------------------------------*/

/*--Tablets-------------------------*/
@media screen and (min-width: 550px) {

	.deck  {
		height: 70em;
		padding: 2em;
		width: 70em;
	}

	.card {
		height: 15em;
		width: 15em;
	}

	.deck img {
		width: 9em;
	}

	.modal-content h2 {
		font-size: 4em;
	}

	.play-again-btn {
		font-size: 1.8em;
	}
}

/*---------------------------------- 
Desktops
------------------------------------*/
@media screen and (min-width: 800px) {
	
	h1 {
		font-size: 3em;
	}

	p {
		font-size: 2em;
	}

	.deck  {
		height: 90em;
		width: 90em;
	}

	.card {
		height: 19em;
		width: 19em;
	}

	.deck img {
		width: 19em;
	}

	.reset-btn {
		font-size: 0.8em;
	}

	.footer {
		font-size: 1.2em;
	}
	
	.modal-content h2 {
		color: white;
	}
	
	.modal-content p {
		color: white;
		font-size: 2em;
	}

	/* Modal Image*/
	.modal-img {
		width: 45em;
	}

	.play-again-btn {
		font-size: 2em;
	}
}



@keyframes move {
    100% {
        transform: translate3d(0, 0, 1px) rotate(360deg);
    }
}

.bg {
    position: fixed;
    width: 100vw;
    height: 100vh;
    top: 0;
    left: 0;
    background: #3E1E68;
    overflow: hidden;
}

.bg span {
    width: 20vmin;
    height: 20vmin;
    border-radius: 20vmin;
    backface-visibility: hidden;
    position: absolute;
    animation: move;
    animation-duration: 33;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}


.bg span:nth-child(0) {
    color: #ffd166;
    top: 77%;
    left: 99%;
    animation-duration: 122s;
    animation-delay: -120s;
    transform-origin: -12vw -12vh;
    box-shadow: -40vmin 0 5.388536856613706vmin currentColor;
}
.bg span:nth-child(1) {
    color: #0c032f;
    top: 67%;
    left: 89%;
    animation-duration: 14s;
    animation-delay: -115s;
    transform-origin: 4vw -6vh;
    box-shadow: 40vmin 0 5.319694472485476vmin currentColor;
}
.bg span:nth-child(2) {
    color: #ffd166;
    top: 62%;
    left: 71%;
    animation-duration: 83s;
    animation-delay: -81s;
    transform-origin: 18vw 5vh;
    box-shadow: -40vmin 0 5.796661680003271vmin currentColor;
}
.bg span:nth-child(3) {
    color: #5a50f9;
    top: 23%;
    left: 95%;
    animation-duration: 20s;
    animation-delay: -36s;
    transform-origin: -23vw 11vh;
    box-shadow: 40vmin 0 5.794932183306714vmin currentColor;
}
.bg span:nth-child(4) {
    color: #5a50f9;
    top: 22%;
    left: 4%;
    animation-duration: 100s;
    animation-delay: -96s;
    transform-origin: -23vw 21vh;
    box-shadow: 40vmin 0 5.800194045569972vmin currentColor;
}
.bg span:nth-child(5) {
    color: #0c032f;
    top: 36%;
    left: 82%;
    animation-duration: 11s;
    animation-delay: -24s;
    transform-origin: -1vw -11vh;
    box-shadow: 40vmin 0 5.953918191138865vmin currentColor;
}
.bg span:nth-child(6) {
    color: #5a50f9;
    top: 56%;
    left: 30%;
    animation-duration: 137s;
    animation-delay: -96s;
    transform-origin: 12vw -9vh;
    box-shadow: 40vmin 0 5.068761573932888vmin currentColor;
}
.bg span:nth-child(7) {
    color: #ffd166;
    top: 90%;
    left: 40%;
    animation-duration: 53s;
    animation-delay: -5s;
    transform-origin: 16vw 18vh;
    box-shadow: -40vmin 0 5.5382142804467085vmin currentColor;
}
.bg span:nth-child(8) {
    color: #5a50f9;
    top: 56%;
    left: 32%;
    animation-duration: 127s;
    animation-delay: -22s;
    transform-origin: -22vw -2vh;
    box-shadow: -40vmin 0 5.640160066373301vmin currentColor;
}
.bg span:nth-child(9) {
    color: #ffd166;
    top: 37%;
    left: 18%;
    animation-duration: 133s;
    animation-delay: -137s;
    transform-origin: 3vw 4vh;
    box-shadow: -40vmin 0 5.9497634085311155vmin currentColor;
}
.bg span:nth-child(10) {
    color: #0c032f;
    top: 100%;
    left: 48%;
    animation-duration: 52s;
    animation-delay: -34s;
    transform-origin: 6vw 5vh;
    box-shadow: 40vmin 0 5.93791258295591vmin currentColor;
}
.bg span:nth-child(11) {
    color: #ffd166;
    top: 10%;
    left: 42%;
    animation-duration: 166s;
    animation-delay: -65s;
    transform-origin: 0vw 9vh;
    box-shadow: -40vmin 0 5.532589718640636vmin currentColor;
}
.bg span:nth-child(12) {
    color: #0c032f;
    top: 64%;
    left: 96%;
    animation-duration: 100s;
    animation-delay: -161s;
    transform-origin: 19vw 2vh;
    box-shadow: 40vmin 0 5.460980185027535vmin currentColor;
}
.bg span:nth-child(13) {
    color: #5a50f9;
    top: 96%;
    left: 61%;
    animation-duration: 6s;
    animation-delay: -69s;
    transform-origin: -13vw 22vh;
    box-shadow: 40vmin 0 5.740679672359473vmin currentColor;
}
.bg span:nth-child(14) {
    color: #0c032f;
    top: 87%;
    left: 43%;
    animation-duration: 163s;
    animation-delay: -3s;
    transform-origin: 6vw 7vh;
    box-shadow: 40vmin 0 5.128578914726919vmin currentColor;
}
.bg span:nth-child(15) {
    color: #ffd166;
    top: 81%;
    left: 58%;
    animation-duration: 79s;
    animation-delay: -16s;
    transform-origin: -24vw 20vh;
    box-shadow: -40vmin 0 5.478650524422594vmin currentColor;
}
.bg span:nth-child(16) {
    color: #ffd166;
    top: 82%;
    left: 79%;
    animation-duration: 21s;
    animation-delay: -50s;
    transform-origin: -1vw -6vh;
    box-shadow: -40vmin 0 5.865740272145084vmin currentColor;
}
.bg span:nth-child(17) {
    color: #ffd166;
    top: 57%;
    left: 13%;
    animation-duration: 18s;
    animation-delay: -153s;
    transform-origin: -11vw -22vh;
    box-shadow: -40vmin 0 5.595302204973613vmin currentColor;
}
.bg span:nth-child(18) {
    color: #5a50f9;
    top: 85%;
    left: 35%;
    animation-duration: 35s;
    animation-delay: -49s;
    transform-origin: 7vw 14vh;
    box-shadow: 40vmin 0 5.913204855501243vmin currentColor;
}
.bg span:nth-child(19) {
    color: #5a50f9;
    top: 28%;
    left: 64%;
    animation-duration: 86s;
    animation-delay: -78s;
    transform-origin: 18vw 0vh;
    box-shadow: 40vmin 0 5.810292769800951vmin currentColor;
}
