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;
}

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

.headline {
  font-family: 'Open Sans', sans-serif;
  font-weight: 300;
  margin:0;
  color: white;
}

header {
  text-align: center;
  background: linear-gradient(160deg, #02ccba 0%, #aa7ecd 100%);
  background-size: 200% 100%;
  background-position: right bottom;
  transition: all 1s ease-out;
  width: 100%;
}
header:hover{
  background-position: left bottom;
}

.header-info {
  color: white;
  padding: 10px;
  margin: 0 0 10px 0;
}


/*
* Styles for the deck of cards
*/

.deck {
  width: 580px;
  min-height: 600px;
  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-around;
  align-items: center;
  margin: 0 0 3em;
}

.deck .card {
  height: 110px;
  width: 110px;
  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;
  pointer-events: none;
}

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

.deck .card.match {
  cursor: default;
  background: #02ccba;
  font-size: 33px;
  pointer-events: none;
  animation: pulse 1s ease-in-out;
  -webkit-animation: pulse 1s ease-in-out;
}

.deck .card.unmatched {
  background: #ff404b;
  animation: wobble 500ms;
  -webkit-animation: wobble 500ms;
  pointer-events: none;
}


/*
* Styles for the Score Panel
*/

.score-panel {
  display: flex;
  justify-content: center;
  width: 100%;
  margin: 10px;
}

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

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

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

.restart {
  margin: 0 8px 0 1rem;
}

#timer {
  margin: 0 1rem;
  width: 160px;
}

#moves {
  margin: 0 4px;
}

/* Styles for the modal */

.popup {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  position: absolute;
  opacity: 1;
  z-index: 20;
  visibility: hidden;
}

.popup.show {
  visibility: visible;
	opacity: 1;
  display: flex;
}

.game-finish {
	padding: 20px;
	background: #ffffff;
	border-radius: 5px;
	width: 85%;
	position: relative;
  bottom: 140px;
}

.game-finish h2 {
  font-size: 2rem;
  margin-bottom: 0;
}

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

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

.winner-text,
.winner-title {
  text-align: center;
}

#play-again {
	background-color: #141214;
	padding: 0.7rem 1rem;
	font-size: 1.1rem;
	display: block;
	margin: 0 auto;
	width: 50%;
	color: #ffffff;
	border-radius: 5px;
  text-align: center;
}

footer {
  background: linear-gradient(160deg, #02ccba 0%, #aa7ecd 100%);
  color: white;
  padding: 2px;
  text-align: center;
}
.portfolio {
  text-decoration: none;
  background: linear-gradient(to right, #aa7ecd 50%, transparent 50%);
  background-size: 200% 100%;
  background-position: right bottom;
  transition: all 1s ease-out;
  color: white;
}
.portfolio:hover{
  background-position: left bottom;
}

/* media queries smartphone */

@media screen and (min-width: 320px) and (max-width: 620px){
  .container {
    min-width: 320px;
    max-width: 620px;
  }
  h1 {
    font-size: 2rem;
  }

  .deck {
    width: 320px;
    min-height: 330px;
    padding: 16px;
    margin: 0 0 1.5rem;
  }

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

  .score-panel {
    width: 100%;
    font-size: 13px;
  }

  #timer {
    margin: 0 5px;
    width: 41%;
  }

  .score-panel .stars {
    margin: 0 5px 0 5px;
  }

  .restart {
    margin: 0 5px;
  }

  #moves {
    margin: 0 2px;
  }
}

@media screen and (min-width: 621px) and (max-width: 780px){
  .score-panel {
    width: 85%;
    font-size: 1.2rem;
  }

  .score-panel .stars {
    margin: 0;
  }

  h1 {
    font-size: 5rem;
  }

  #timer {
    width: 50%;
  }
}

/* keyframes for animation */
@-webkit-keyframes wobble {
  from {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
  33% {
    -webkit-transform: translate3d(-30%, 0, 0) rotate3d(0, 0, 1, -3deg);
    transform: translate3d(-30%, 0, 0) rotate3d(0, 0, 1, -3deg);
  }
  66% {
    -webkit-transform: translate3d(30%, 0, 0) rotate3d(0, 0, 1, 3deg);
    transform: translate3d(30%, 0, 0) rotate3d(0, 0, 1, 3deg);
  }
  to {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}

@keyframes wobble {
  from {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
  33% {
    -webkit-transform: translate3d(-30%, 0, 0) rotate3d(0, 0, 1, -3deg);
    transform: translate3d(-30%, 0, 0) rotate3d(0, 0, 1, -3deg);
  }
  66% {
    -webkit-transform: translate3d(30%, 0, 0) rotate3d(0, 0, 1, 3deg);
    transform: translate3d(30%, 0, 0) rotate3d(0, 0, 1, 3deg);
  }
  to {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}

@-webkit-keyframes pulse {
  from {
    -webkit-transform: scale3d(1, 1, 1);
    transform: scale3d(1, 1, 1);
  }
  50% {
    -webkit-transform: scale3d(2, 2, 2);
    transform: scale3d(2, 2, 2);
  }
  to {
    -webkit-transform: scale3d(1, 1, 1);
    transform: scale3d(1, 1, 1);
  }
}

@keyframes pulse {
  from {
    -webkit-transform: scale3d(1, 1, 1);
    transform: scale3d(1, 1, 1);
  }
  50% {
    -webkit-transform: scale3d(2, 2, 2);
    transform: scale3d(2, 2, 2);
  }
  to {
    -webkit-transform: scale3d(1, 1, 1);
    transform: scale3d(1, 1, 1);
  }
}
