@charset "UTF-8";

img, picture, video, embed {
	max-width: 100%;
}

/* Flexbox declaration */
#cardDeck {
	display: flex;
	flex-wrap: wrap;
	margin-left: auto;
	margin-right: auto;
}

#essentials {
	display: flex;
	justify-content: center;
	padding: 20px 0;
}

#winPopUp {
	display: flex;
	flex-wrap: wrap;
}

#infoPopUp {
	display: flex;
	flex-direction: column;
}

/* Essentials setting */
/* Title */
#gameTitle {
	display: block;
	text-align: center;
	margin: 7px 0;
	font-family: 'Comfortaa', light;
	font-size: 24px;
	letter-spacing: 0.05em;
}

/* Star rating box */
#starRating {
	padding: 0 10px 0 5px;
	min-width: 60px;
}

/* Full stars */
.fa-star {
	width: 10px;
	padding: 0;
	margin: 0;
}

/* Empty stars */
.fa-star-o {
	width: 10px;
	padding: 0;
	margin: 0;
}

/* Move counter */
#moves {
	padding: 0;
	font-family: 'Comfortaa', light;
	font-size: 14px;
	text-align: center;
}

/* Timer */
#currentTime {
	padding: 0 10px;
	font-family: 'Comfortaa', light;
	font-size: 14px;
	text-align: center;
}

/* Reset button */
#resetButton {
	padding: 0 8px;
}

/* Information button */
#infoButton {
	padding: 0 8px;
}

/* Board setting */
/* The deck itself */
#cardDeck {
	width: 90%;
	height: auto;
    background: linear-gradient(160deg, #02ccba 0%, #aa7ecd 100%);
    padding: 10px;
    border-radius: 10px;
    box-shadow: 12px 15px 20px 0 rgba(46, 61, 73, 0.5);
	justify-content: space-evenly;
	align-content: center;
}

/* Card setting */
/* Game card */
.gameCard {
	width: 17%;
	height: auto;
	min-width: 50px;
	margin: 10px;
	padding: 0;
	border-radius: 10px;
	box-shadow: 12px 15px 20px 0 rgba(46, 61, 73, 0.5);
}

/* Face-down state */
.downState {
	background: url("../img/cardback.png");
}

/* Neutral (unmatched) state */
.neutralState {
	background: #739cb2;
}

/* Correctly matched state */
.correctState {
	transition: background 0.5s ease;
	background: #579e63;
}

/* Wrongly matched state */
.wrongState {
	transition: background 0.5s ease;
	background: #c9413c;
}

/* Styling for the image on the card */
.cardImageUp {
	vertical-align: middle;
	margin-left: auto;
	margin-right: auto;
	display: block;
}

/* Face-down cards (no image is shown) */
.cardImageDown {
	visibility: hidden;
}

/* Popups setting */
/* The modal box in which the popups appear */
#modalBox {
	display: block;
	visibility: hidden;
	width: 100%;
	height: 100%;
	z-index: 1;
	background-color: rgba(0,0,0,0.60);
	position: fixed;
	left: 0;
	top: 0;
}

/* The popups */
.popup {
	width: 70%;
	padding: 5% 2%;
    border-radius: 10px;
    box-shadow: 12px 15px 20px 0 rgba(46, 61, 73, 0.5);
	justify-content: space-evenly;
	align-content: center;
	margin-left: auto;
	margin-right: auto;
	background: linear-gradient(160deg, #02ccba 0%, #aa7ecd 100%);
	margin-top: 120px;
}

/* The popup shown at the end of the game */
#winPopUp {
	height: 35%;
}

/* End of the game popup title */
#winTitle {
	text-align: center;
	margin: 5px 0 15px;
	font-family: 'Comfortaa', light;
	font-size: 18px;
	letter-spacing: 0.05em;
	width: 100%;
	display: block;
}

/* End of the game popup text */
#winText {
	text-align: center;
	font-family: 'Comfortaa', light;
	font-size: 13px;
	width: 80%;
	margin: 10px 0;
	display: block;
	white-space: pre-line;
}

/* End of the game popup picture */
#winPic {
	max-width: 40%;
	height: auto;
	width: auto;
	display: block;
}

/* close popup button */
#winButton, #closeButton {
	margin-top: 10px;
	padding: 10px;
    border-radius: 10px;
    box-shadow: 12px 15px 20px 0 rgba(46, 61, 73, 0.5);
	background: #739cb2;
	font-family: 'Comfortaa', light;
	text-align: center;
	display: block;
}

/* The information popup (shown when a user clicks the information button) */
#infoPopUp {
	height: 60%;
}

/* The scrollbox within the information popup */
#popupScroll {
	height: 100%;
	overflow-y: scroll;
}

/* Information popup title */
#infoTitle {
	text-align: center;
	margin: 5px 0 15px;
	font-family: 'Comfortaa', light;
	font-size: 18px;
	letter-spacing: 0.05em;
	width: 100%;
}

/* Information popup text */
#infoText {
	text-align: center;
	font-family: 'Comfortaa', light;
	font-size: 14px;
	width: 100%;
	padding: 0;
	margin: 0;
	display: block;
	white-space: pre-line;
}


/* Responsive Styling */
/* Breakpoint for any screen below 250px (if there are any) */
@media screen and (max-width: 250px) {
	#starRating {
		min-width: 0;
	}
}

/* Breakpoint at 450px, changing text sizes, padding/margin and the layout of the end-of-game popup */
@media screen and (min-width: 450px) {
	/* Title */
	#gameTitle {
		font-size: 26px;
	}
	
	/* Star rating box */
	#starRating {
		padding: 0 10px;
	}
	
	/* Full stars */
	.fa-star {
		width: 12px;
	}
	
	/* Empty stars */
	.fa-star-o {
		width: 12px;
	}
	
	/* Move counter */
	#moves {
		padding: 0 12px;
		font-size: 16px;
	}
	
	/* Timer */
	#currentTime {
		padding: 0 12px;
		font-size: 16px;
	}
	
	/* Reset button */
	#resetButton {
		padding: 0 15px;
	}
	
	/* Game card */
	.gameCard {
		margin: 15px;
	}
	
	/* The popup shown at the end of the game */
	#winPopUp {
		width: 75%;
		height: 30%;
	}
	
	/* End of the game popup text */
	#winText {
		font-size: 16px;
		max-width: 50%;
		align-self: center;
	}
	
	/* End of the game popup picture */
	#winPic {
		max-width: 30%;
	}
	
	/* End of the game popup title & Information popup title */
	#winTitle, #infoTitle {
		font-size: 24px;
	}
	
	/* close popup button */
	#winButton, #closeButton {
		padding: auto;
		margin-top: 15px;
	}
	
	/* The information popup (shown when a user clicks the information button) */
	#infoPopUp {
		width: 75%;
	}
	
	/* Information popup text */
	#infoText {
		font-size: 16px;
		width: 100%;
		align-self: center;
	}
}

/* Breakpoint at 600px, mostly changing font sizes */
@media screen and (min-width: 600px) {
	/* End of the game popup text */
	#winText {
		font-size: 17px;
		align-self: center;
		width: 55%;
	}
	
	/* End of the game popup picture */
	#winPic {
		max-width: 32%;
	}
	
	/* Information popup text */
	#infoText {
		font-size: 17px;
		align-self: center;
		width: 100%;
	}
}

/* Breakpoint at 750px with element sizes changes and padding/margin. Also includes fixed sizes for some elements to keep at a reasonable size even when the screen grows beyond a certain point. */
@media screen and (min-width: 750px) {
	
	/* Title */
	#gameTitle {
		font-size: 32px;
	}
	
	/* Star rating box */
	#starRating {
		padding: 0 10px;
	}
	
	/* Full stars */
	.fa-star {
		width: 16px;
	}
	
	/* Empty stars */
	.fa-star-o {
		width: 16px;
	}
	
	/* Move counter */
	#moves {
		padding: 0 10px;
		font-size: 18px;
	}
	
	/* Timer */
	#currentTime {
		padding: 0 20px;
		font-size: 18px;
	}
	
	/* The deck itself */
	#cardDeck {
		width: 640px;
    	height: 640px;
		padding: 32px;
	}
	
	/* Game card */
	.gameCard {
		width: 120px;
		height: 120px;
		max-width: 120px;
		margin: 20px;
	}
	
	/* The popups */
	.popup {
		width: 400px;
		padding: 32px;
		border-radius: 10px;
	}
	
	/* The popup shown at the end of the game */
	#winPopUp {
		height: 250px;
	}
	
	/* End of the game popup text */
	#winText {
		font-size: 18px;
		width: 60%;
	}
	
	/* End of the game popup picture */
	#winPic {
		max-width: 35%;
		height: auto;
		width: auto;
	}
	
	/* End of the game popup title & Information popup title */
	#winTitle, #infoTitle {
		font-size: 26px;
	}
	
	/* The information popup (shown when a user clicks the information button) */
	#infoPopUp {
		height: 500px;
	}
	
	/* Information popup text */
	#infoText {
		font-size: 18px;
		width: 100%;
	}
}