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: 'Coda', cursive;
}

.container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

h1 {
    font-family: 'Open Sans', sans-serif;
    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 {
    height: 125px;
    width: 125px;
    background: #2e3d49;
    font-size: 0;
    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);
}

.deck .card.open {
    transform: rotateY(0);
    background: #02b3e4;
    cursor: default;
}

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

.deck .card.match {
    cursor: default;
    background: #02ccba;
    font-size: 33px;
	animation-timing-function: ease-in;
	animation: bounce 0.5s;
}

.deck .card.unmatched {
	cursor: default;
	background: #ff3232;
	animation: shake 0.5s ease-in-out;
}

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

/*
 * Styles for the Score Panel
 */

.score-panel {
    text-align: center;
    width: 500px;
    margin-bottom: 10px;
}

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

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

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

.moves {
    font-size: 25px;
}

.timer {
    font-size: 25px;
}

/*
 * Styles for the Success Dialogue Box
 */

.modal {
	visibility: hidden;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgb(0,0,0);
    background-color: rgba(0,0,0,0.4);
	font-size: 25px;
	text-align: center;
}

.modal:target {
    visibility: visible;
    opacity: 1;
}

.modal-content {
	background: linear-gradient(160deg, #02ccba 0%, #aa7ecd 100%);
	margin: 10% auto;
	padding: 20px;
	border: 1px solid #888;
	width: 80%;
  border-radius: 10px;
}

.close {
    color: #aaa;
    float: right;
    font-size: 40px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

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

.play-again {
    background-color: #2e3d49;
    padding: 1em 1em;
    font-size: 1em;
    display: block;
    margin: 10px auto;
    /*width: 50%;*/
    color: #ffffff;
    border-radius: 5px;
    cursor: pointer;
}

h2 {
	display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    margin: 50px;
}

h3 {
  display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.total-moves {
	font-size: 25px;
	display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;	
}

.final-time {
	justify-content: center;
	display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.final-stars {
    margin: 0;
    padding: 0;
    display: inline-block;
    margin: 0 5px 0 0;
	color: yellow;	
}

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


/* ANIMATIONS */

@keyframes shake {
10%, 90% {
	transform: translate3d(-1px, 0, 0);
}
  
20%, 80% {
	transform: translate3d(2px, 0, 0);
}

30%, 50%, 70% {
	transform: translate3d(-4px, 0, 0);
}

40%, 60% {
	transform: translate3d(4px, 0, 0);
}
}

@keyframes bounce {
from {
	transform: translateY(0px);
}
to {
	transform: translateY(-25px);
}
}

/*  
 *	MOBILE
 */
 
@media screen and (max-width: 280px) {

.deck {
	max-width: 150px;
	min-height: auto;
	padding: 16px;
}

.deck .card {
	height: 50px;
	width: 50px;
	margin-bottom: 10px;
}

.deck .card.open {
	font-size: 20px;
}

.score-panel {
	max-width: 100%;
	padding-bottom: 0;
	display: block;
	text-align: center;
	line-height: 1.7em;
}

h1 {
	font-size: 22px;
	margin: 0;
	padding: 10px 0;
}
	
}

@media screen and (max-width: 350px) {

h2 {
  display: none;
}

}

@media screen and (max-width: 450px) {

h2 {
  display: none;
}

}

@media screen and (min-width: 281px) and (max-width: 450px) {

.deck {
	max-width: 250px;
	min-height: auto;
	padding: 16px;
}

.deck .card {
	height: 50px;
	width: 50px;
	margin-bottom: 10px;
}

.deck .card.open {
	font-size: 20px;
}

.score-panel {
	max-width: 100%;
	padding-bottom: 0;
	display: block;
	text-align: center;
	line-height: 1.7em;
}

h1 {
	font-size: 22px;
	margin: 0;
	padding: 10px 0;
}

h2 {
  font-size: 25px;
}
	
}

/*  
 *	TABLET
 */

@media screen and (min-width: 451px) and (max-width: 519px) {
	
.deck {
	max-width: 400px;
	min-height: auto;
	padding-bottom: 17px;
}

.deck .card {
	height: 80px;
	width: 80px;
	margin-bottom: 17px;
}

.deck .card.open {
	font-size: 30px;
}

.score-panel {
	max-width: 250px;
	padding-bottom: 0;
	display: block;
	text-align: center;
	line-height: 1.7em;
}

h1 {
	margin: 0;
	padding: 10px 0;
}

h2 {
  font-size: 25px;
}
	
}

@media screen and (min-width: 520px) and (max-width: 849px) {
	
.deck {
	max-width: 500px;
	min-height: auto;
	padding-bottom: 17px;
}

.deck .card {
	height: 100px;
	width: 100px;
	margin-bottom: 16px;
}

.deck .card.open {
	font-size: 30px;
}

.score-panel {
	max-width: 250px;
	padding-bottom: 0;
	display: block;
	text-align: center;
	line-height: 1.7em;
}

h1 {
	margin: 0;
	padding: 10px 0;
}
	
}