* {
  margin: 0;
  padding: 0;
}

html {
  overflow-x: hidden;
}

body {
  background-repeat: no-repeat;
  background-size: cover;
  font-family: "Open Sans", sans-serif;
  font-size: 62.5%;
  letter-spacing: 1.5px;
  margin: 0;
  text-align: center;
}

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

li {
  list-style: none;
}

.square,
.btn {
  cursor: pointer;
}

.btn {
  border-radius: 2em;
  border: none;
  color: #fff;
  box-shadow: 5px 2px 20px 0 rgba(103, 112, 121, 0.5);
  padding: 2em;
}

/*----------------------------------
Header
------------------------------------*/

h1 {
  font-family: sans-serif;
  font-size: 40px;
  font-weight: bold;
  letter-spacing: -1px;
  line-height: 1;
  text-align: center;
  margin-top: 1em;
}

p {
  font-size: 1.6em;
}

h3 {
  font-weight: 400;
}

/*----------------------------------
Section - Score Panel
------------------------------------*/

.score-panel {
  font-size: 24px;
  display: flex;
  flex-direction: column;
  margin: 2rem 2rem 1rem 2rem;
  align-items: center;
  justify-content: space-around;
  width: 20rem;
  height: 20rem;
}

.star-rating > li {
  display: inline-block;
  padding: 0.5em;
}

.reset-btn {
  border-radius: 50%;
  height: 2em;
  width: 2em;
  background: #1c9882;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 100ms linear;
}

.reset-btn:hover {
  transform: scale(1.05);
}

.timer-container {
  background: rgb(255, 216, 209);
  border-radius: 0.5em;
  color: #000;
  margin: 0.5em;
  padding: 0.5em 1em;
  box-shadow: 10px 10px 28px -11px rgba(0, 0, 0, 0.75);
}

/*----------------------------------
Section - Modal
------------------------------------*/

/* Modal (background) */

.modal {
  /*Hidden by default */
  display: none;
  position: fixed;
  z-index: 99;
  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 {
  border-radius: 2rem;
  background-color: #fff;
  margin-left: 8%;
  border: 0.8em solid #43b538;
  padding-right: 2em;
  width: 80%;
}

/* Modal Details */
#modal-details {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin-top: -10px;
  padding-top: 0px;
}

/* 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*/

a {
  color: rgb(255, 216, 209);
  text-decoration: none;
}

.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: 2em 1em;
  padding: 1em 2em;
}

/*----------------------------------
Deck of Cards
------------------------------------*/

/*Mobile first responsivness*/

.deck {
  grid-template-columns: repeat(6, 1fr);
  background: rgb(231, 237, 247);
  border-radius: 1.5em;
  display: grid;
  flex-wrap: wrap;
  justify-content: space-around;
  align-items: center;
  justify-items: center;
  margin-bottom: 6em;
  height: 40em;
  padding: 2em;
  width: 40em;
}

.square {
  border-radius: 0.5em;
  border:#fff 1px solid;
  height: 6.5em;
  width: 6.5em;
}

/*
To disable the color highlight if and img is clicked
https://stackoverflow.com/questions/21107439/disable-or-change-firefoxs-element-image-highlight-color
*/

img {
  width:6.5em;
  user-select: none;
}

.deck img {
  visibility: hidden;
}

.deck .square.flip {
  cursor: default;
  pointer-events: none;
}

.flip {
  transition: transform 0.3s linear;
}

.flip img {
  visibility: visible;
  height: 6.5em;
}

.deck .square.match {
  visibility: visible;
  cursor: default;
  animation: pulse 1s;
  animation-fill-mode: forwards;
}

h4 {
  width: 100%;
  padding: 9px;
  background: black;
  color: white;
  text-align: center;
  /* center the title */
  font-size: 20px;
  /* set the font size */
}

@keyframes pulse {
  0% {
    transform: rotateX(0deg) rotateY(180deg) scale(1);
  }
  80% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

/*----------------------------------
Desktops
------------------------------------*/

@media screen and (min-width: 800px) {
  h1 {
    font-size: 6em;
  }
  p {
    font-size: 2.3em;
  }
  .deck {
    height: 70em;
    width: 70em;
  }
  .square {
    height: 11em;
    width: 11em;
  }
  .deck img {
    height: 11em;
    width: 11em;
  }
  .reset-btn {
    font-size: 0.8em;
  }
  .footer {
    font-size: 1.2em;
  }
  .modal-content h2 {
    font-size: 5em;
  }
  /* Modal Image*/
  .modal-img {
    width: 30em;
  }
  .play-again-btn {
    font-size: 2em;
  }
  .score-panel {
    flex-direction: row;
    width: 48rem;
    height: auto;
  }
  #start:hover {
    /* width: 150px; */
    color: rgb(243, 156, 214);
    font-weight: bold;
    /* font-size: 2.1em; */
    box-shadow: 10px 10px 8px #888888;
    transform: scale(1.1);
  }
  #play-again:hover {
    font-weight: bold;
    box-shadow: 10px 10px 8px #888888;
    transform: scale(1.1);
  }
}
