@font-face {
  font-family: "Creepy";
  src: url("Assets/Fonts/Creepy.woff") format("woff"),
    url("Assets/Fonts/Creepy.woff2") format("woff2");
}
@font-face {
  font-family: "Lunacy";
  src: url("Assets/Fonts/Lunacy.woff") format("woff"),
    url("Assets/Fonts/Lunacy.woff2") format("woff2");
}
* {
  box-sizing: border-box;
}
html {
  min-height: 100vh;
  cursor: url("Assets/Cursors/Ghost.cur"), auto;
}
body {
  margin: 0;
  background: radial-gradient(#9d5900, #3d2200); /* inside , outside */
}
.page-title {
  color: #ff6d00;
  font-family: Creepy, serif;
  font-weight: normal;
  text-align: center;
  font-size: 6em;
  margin-top: 35px;
}
header {
  text-align: center;
}

h1 {
  margin-top: 0.321em;
  margin-bottom: 20px;
}
nav a {
  padding: 20px;
}

.pause:hover {
  cursor: pointer;
  color: blueviolet;
}
.sound:hover {
  color: aqua;
  cursor: pointer;
}
nav {
  color: #ff6d00;
  font-family: Creepy, serif;
  font-weight: normal;
  text-align: center;
  font-size: 2em;

  display: inline-block;
  vertical-align: baseline;
  margin-bottom: 40px;
}
.game-info-container {
  grid-column: 1 / -1; /*begin to last column */
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
}
.game-info {
  font-family: Lunacy, serif;
  color: #ffbb89;
  font-size: 4em;
}
.game-container {
  display: grid; /* grid layout*/
  grid-template-columns: repeat(5, auto);
  grid-gap: 10px;
  margin: 50px;
  justify-content: center;
  margin-top: 0;
  perspective: 500px; /*user is 500 px away from game container*/
}
.card {
  position: relative;
  height: 170px;
  width: 150px;
}
.card:hover {
  cursor: url("Assets/Cursors/GhostHover.cur"), auto;
}
.card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  backface-visibility: hidden; /*new back face hidden*/
  border-radius: 12px;
  border-width: 1px;
  border-style: solid;
  transition: transform 500ms ease-in-out;
}

.card.visible .card-back {
  transform: rotateY(-180deg);
}
.card.visible .card-front {
  transform: rotateY(0);
}

.card.matched .card-value {
  animation: dance 1s linear infinite 500ms;
}

.overlay-text {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  justify-content: center;
  align-items: center;
  z-index: 100;
  color: #ff6d00;
  font-family: Creepy, serif;
}

.overlay-text-small {
  font-size: 0.3em;
}

.overlay-text.visible {
  display: flex;
  animation: overlay-grow 500ms forwards;
  flex-direction: column;
}

@keyframes overlay-grow {
  from {
    background-color: rgba(0, 0, 0, 0);
    font-size: 0;
  }
  to {
    background-color: rgba(0, 0, 0, 0.8);
    font-size: 10em;
  }
}
/* for pic on cards motion*/
@keyframes dance {
  0%,
  100% {
    transform: rotateZ(0);
  }
  25% {
    transform: rotateZ(-30deg);
  }
  75% {
    transform: rotateZ(30deg);
  }
}
.card-back {
  background-color: black;
  border-color: #ff6d00;
}
.card-front {
  background-color: #ffbb89;
  border-color: #333;

  transform: rotateY(180deg); /*back face front ,  front face back*/
}

.card-value {
  transition: transform 100ms ease-in-out;
  transform: scale(0.9);
}

.card-front:hover .card-value {
  transform: scale(1);
}

.cob-web {
  position: absolute;
  width: 47px;
  height: 47px;
  transition: width 100ms ease-in-out, height 100ms ease-in-out;
}
/* when hover target card back change cob webs*/
.card-face:hover .cob-web {
  width: 52px;
  height: 52px;
}
.cob-web-top-left {
  transform: rotate(270deg);
  top: 0;
  left: 0;
}
.cob-web-top-right {
  top: 0;
  right: 0;
}
.cob-web-bottom-left {
  transform: rotate(180deg);
  bottom: 0;
  left: 0;
}
.cob-web-bottom-right {
  transform: rotate(90deg);
  bottom: 0;
  right: 0;
}
.spider {
  align-self: flex-start;
  transform: translateY(-10px);
  transition: transform 100ms ease-in-out;
}

.card:hover .spider {
  transform: translateY(0);
}

@media (max-width: 600px) {
  .game-container {
    grid-template-columns: repeat(2, auto);
  }

  .game-info-container {
    flex-direction: column;
    align-items: center;
  }
}
