html {
    box-sizing: border-box;
}

*,
*::before,
*::after {
    box-sizing: inherit;
}

/* */



.modal {
  display: none;
  position: fixed;
  z-index: 1;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
  background-color: #fefefe;
  margin: 90% auto;
  padding: 20px;
  border: 1px solid #888;
  width: 80%;
  text-align: center;
}

.close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
}

.close:hover,
.close:focus {
  color: black;
  text-decoration: none;
  cursor: pointer;
}

.container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

h1 {
    font-family: 'Arial', sans-serif;
    font-weight: 300;
}

.header-logo{
  margin-top: 27px;
}

/*
 * Styles for the deck of cards
 */

.deck {
    width: 660px;
    min-height: 680px;
    background: linear-gradient(160deg, #008ABE 0%, #006080 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;
    list-style-type: none;
}

.deck .card {
    height: 130px;
    width: 120px;
    background-image: url('../img/frontcard.png');
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    background-size: contain;
    font-size: 0;
    color: #ffffff;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius:20px;
    box-shadow: 5px 2px 20px 0 rgba(46, 61, 73, 0.5);
}

.deck .card.open {
    transform: rotateY(0);
    background: #ffffff;
    cursor: default;
}

.deck .card.show {
    font-size: 33px;
    border-radius: 10px;
}

.deck .card.match {
    cursor: default;
    background: #ffffff;
    font-size: 33px;
}

.deck .card.wrong {
  background: #ffffff;
}

/*
 * Styles for the Score Panel
 */

.score-panel {
    text-align: left;
    width: 545px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    margin-top: -103px;
}

.score-panel .stars {
    margin: 0;
    padding: 0;
    display: inline-block;
    margin: 0 5px 0 0;
    color: #ffcd00;
}

.score-panel .stars li {
    list-style-type: none;
    display: inline-block;
}

.score-panel .restart {
    cursor: pointer;
}

#restart i {
  padding-left: 5px;
}

#timer {
  display: inline-block;
}

#timer-text {
  color: #058A8c;
}

#restart-text {
  color: #764F92;
}

/* Winning Popup */
.popup {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1; /* Sit on top */
    padding-top: 0; /* Location of the box */
    margin: 0 auto;
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgb(0,0,0); /* Fallback color */
    background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
}

.popup-content {
    background-color: white;
    margin: 0 auto;
    height: 100%;
    width: 100%;
    padding: 20px;
    text-align: center;
    font-family: 'Helvetica';
    -webkit-animation-name: animatetop;
    -webkit-animation-duration: 1.5s;
    animation-name: animatetop;
    animation-duration: 1.5s;
}

/* Add Animation */
@-webkit-keyframes animatetop {
    from {top: -300px; opacity: 0}
    to {top: 0; opacity: 1}
}

@keyframes animatetop {
    from {top: -300px; opacity: 0}
    to {top: 0; opacity: 1}
}

.popup-content h1 {
  font-size: 3em;
  padding-top: 4em;
  color: #18bf8f;
  font-weight: bolder;
}

.popup-content h3 {
  font-weight: normal;
  color: #4f4f4f;
}

#play-again-btn {
  background-color: #8c4ed6;
  color: white;
  font-size: 16px;
  font-weight: normal;
  padding: 10px 25px;
  border: none;
  border-radius: 8px;
  margin-top: 15px;
  box-shadow: 7px 7px 30px #999999;
  transition: box-shadow 0.5s;
}

#play-again-btn:hover {
  box-shadow: 3px 3px 8px #6F6F6F;
  background-color: #9759E3;
  cursor: pointer;
}

#star-rating-text {
  padding-left: 15px;
}

/* The Close Button */
.close {
    color: #aaaaaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}

/*
 * Media queries
 */

@media only screen and (max-width: 780px) {
  .deck {
    max-width: 342px;
    min-height: auto;
    padding-bottom: 17px;
    height: 570px;
  }

  .deck .card {
    height: 83px;
    width: 76px;
    margin-bottom: 17px;
  }
  .deck .card.show {
    font-size: 15px;
    border-radius: 5px;
  }

  .score-panel {
    max-width: 70%;
    padding-bottom: 0;
    display: block;
    text-align: center;
    line-height: 1.7em;
    margin-top: -72px;
  }

  /* .header-logo{
    width: 150px;
    height: 150px;
  } */

  h1 {
    margin: 0;
    padding: 10px 0;
  }
  .header-logo{
    width: 261px;
    height: 227px;
    margin-top: -35px;
  }
}

/* @media only screen and (max-width: 480px){
  .header-logo{
    width: 140px;
   height: auto;
  }
} */

@media only screen and (min-width: 1080px){

  .deck .card {
           height: 290px;
        width: 265px;
        background-image: url(../img/frontcard.png);
        background-position: center;
        background-repeat: no-repeat;
        background-size: cover;
        background-size: contain;
        font-size: 0;
        color: #ffffff;
        border-radius: 59px;
        cursor: pointer;
        display: flex;
        justify-content: center;
        align-items: center;
        box-shadow: 5px 49px 20px 0 rgba(46, 61, 73, 0.5);
        gap: 88px;
}
.deck {
  width: 1026px;
  height: 1654px;
  background: linear-gradient(160deg, #008ABE 0%, #006080 100%);
  padding: 23px;
  border-radius: 44px;
  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;
  list-style-type: none;
}
.container{
  zoom:0.9;
}
body{
  overflow: hidden;
}
.header-logo{
  width: 617px;
  height: 483px;
  margin-top: -95px;

}
}

#win-popup.zoomIn {
  animation-delay: 1s;
}

/* Animation by theappguruz.com */
#win-popup.zoomIn {
  -webkit-animation-name: zoomIn;
  animation-name: zoomIn;
  -webkit-animation-duration: 1s;
  animation-duration: 1s;
  -webkit-animation-fill-mode: both;
  animation-fill-mode: both;
  }
  @-webkit-keyframes zoomIn {
  0% {
  opacity: 0;
  -webkit-transform: scale3d(.3, .3, .3);
  transform: scale3d(.3, .3, .3);
  }
  50% {
  opacity: 1;
  }
  }
  @keyframes zoomIn {
  0% {
  opacity: 0;
  -webkit-transform: scale3d(.3, .3, .3);
  transform: scale3d(.3, .3, .3);
  }
  50% {
  opacity: 1;
  }
  }

.deck .card.flipInY {
-webkit-backface-visibility: visible !important;
backface-visibility: visible !important;
-webkit-animation-name: flipInY;
animation-name: flipInY;
-webkit-animation-duration: 1s;
animation-duration: 1s;
-webkit-animation-fill-mode: both;
animation-fill-mode: both;
}
@-webkit-keyframes flipInY {
0% {
-webkit-transform: perspective(400px) rotate3d(0, 1, 0, 90deg);
transform: perspective(400px) rotate3d(0, 1, 0, 90deg);
-webkit-transition-timing-function: ease-in;
transition-timing-function: ease-in;
opacity: 0;
}
40% {
-webkit-transform: perspective(400px) rotate3d(0, 1, 0, -20deg);
transform: perspective(400px) rotate3d(0, 1, 0, -20deg);
-webkit-transition-timing-function: ease-in;
transition-timing-function: ease-in;
}
60% {
-webkit-transform: perspective(400px) rotate3d(0, 1, 0, 10deg);
transform: perspective(400px) rotate3d(0, 1, 0, 10deg);
opacity: 1;
}
80% {
-webkit-transform: perspective(400px) rotate3d(0, 1, 0, -5deg);
transform: perspective(400px) rotate3d(0, 1, 0, -5deg);
}
100% {
-webkit-transform: perspective(400px);
transform: perspective(400px);
}
}
@keyframes flipInY {
0% {
-webkit-transform: perspective(400px) rotate3d(0, 1, 0, 90deg);
transform: perspective(400px) rotate3d(0, 1, 0, 90deg);
-webkit-transition-timing-function: ease-in;
transition-timing-function: ease-in;
opacity: 0;
}
40% {
-webkit-transform: perspective(400px) rotate3d(0, 1, 0, -20deg);
transform: perspective(400px) rotate3d(0, 1, 0, -20deg);
-webkit-transition-timing-function: ease-in;
transition-timing-function: ease-in;
}
60% {
-webkit-transform: perspective(400px) rotate3d(0, 1, 0, 10deg);
transform: perspective(400px) rotate3d(0, 1, 0, 10deg);
opacity: 1;
}
80% {
-webkit-transform: perspective(400px) rotate3d(0, 1, 0, -5deg);
transform: perspective(400px) rotate3d(0, 1, 0, -5deg);
}
100% {
-webkit-transform: perspective(400px);
transform: perspective(400px);
}
}

.deck .card.shake {
-webkit-animation-name: shake;
animation-name: shake;
-webkit-animation-duration: 1s;
animation-duration: 1s;
-webkit-animation-fill-mode: both;
animation-fill-mode: both;
}
@-webkit-keyframes shake {
0%, 100% {
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
}
10%, 30%, 50%, 70%, 90% {
-webkit-transform: translate3d(-10px, 0, 0);
transform: translate3d(-10px, 0, 0);
}
20%, 40%, 60%, 80% {
-webkit-transform: translate3d(10px, 0, 0);
transform: translate3d(10px, 0, 0);
}
}
@keyframes shake {
0%, 100% {
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
}
10%, 30%, 50%, 70%, 90% {
-webkit-transform: translate3d(-10px, 0, 0);
transform: translate3d(-10px, 0, 0);
}
20%, 40%, 60%, 80% {
-webkit-transform: translate3d(10px, 0, 0);
transform: translate3d(10px, 0, 0);
}
}

.deck .card.bounceIn {
-webkit-animation-name: bounceIn;
animation-name: bounceIn;
-webkit-animation-duration: .75s;
animation-duration: .75s;
-webkit-animation-duration: 1s;
animation-duration: 1s;
-webkit-animation-fill-mode: both;
animation-fill-mode: both;
}
@-webkit-keyframes bounceIn {
0%, 20%, 40%, 60%, 80%, 100% {
-webkit-transition-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
transition-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
}
0% {
opacity: 0;
-webkit-transform: scale3d(.3, .3, .3);
transform: scale3d(.3, .3, .3);
}
20% {
-webkit-transform: scale3d(1.1, 1.1, 1.1);
transform: scale3d(1.1, 1.1, 1.1);
}
40% {
-webkit-transform: scale3d(.9, .9, .9);
transform: scale3d(.9, .9, .9);
}
60% {
opacity: 1;
-webkit-transform: scale3d(1.03, 1.03, 1.03);
transform: scale3d(1.03, 1.03, 1.03);
}
80% {
-webkit-transform: scale3d(.97, .97, .97);
transform: scale3d(.97, .97, .97);
}
100% {
opacity: 1;
-webkit-transform: scale3d(1, 1, 1);
transform: scale3d(1, 1, 1);
}
}
@keyframes bounceIn {
0%, 20%, 40%, 60%, 80%, 100% {
-webkit-transition-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
transition-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
}
0% {
opacity: 0;
-webkit-transform: scale3d(.3, .3, .3);
transform: scale3d(.3, .3, .3);
}
20% {
-webkit-transform: scale3d(1.1, 1.1, 1.1);
transform: scale3d(1.1, 1.1, 1.1);
}
40% {
-webkit-transform: scale3d(.9, .9, .9);
transform: scale3d(.9, .9, .9);
}
60% {
opacity: 1;
-webkit-transform: scale3d(1.03, 1.03, 1.03);
transform: scale3d(1.03, 1.03, 1.03);
}
80% {
-webkit-transform: scale3d(.97, .97, .97);
transform: scale3d(.97, .97, .97);
}
100% {
opacity: 1;
-webkit-transform: scale3d(1, 1, 1);
transform: scale3d(1, 1, 1);
}
}

/* Card container styles */
.card {
  width: 100px;
  height: 100px;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #2c3e50; /* Default card background */
  border-radius: 10px;
  cursor: pointer;
  overflow: hidden; /* Ensure image stays within the card */
  transition: transform 0.3s, background-color 0.3s;
}

/* Image inside the card */
.card img {
  max-width: 100%; /* Adjust image size */
  max-height: 94%;
  display: none; /* Initially hidden */
  transition: transform 0.3s; /* Smooth transformation */
}

/* Flip effect - show the image */
.card.open.show img {
  display: block; /* Reveal the image */
  transform: scale(1.1); /* Slight zoom effect */
}

/* Matched cards */
.card.match {
  background-color: #ffffff; /* Green background for matched cards */
  transform: rotateY(360deg); /* Flip effect for matched cards */
}


.card.wrong img {
  /* filter: grayscale(100%); Turn the image grayscale for wrong matches */
  animation: shake 0.5s; 
  background-color: none;
}


/* Shake animation */
@keyframes shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  50% { transform: translateX(10px); }
  75% { transform: translateX(-10px); }
  100% { transform: translateX(0); }
}
