@font-face {
  font-family: Gbonserrat;
  src: url(Fonts/Gbonserrat-Regular.otf);
}

@font-face {
  font-family: GBEB;
  src: url(Fonts/GbonserratExtra_bold.otf);
}

.container {
  width: 70%; /* Move the width constraint here */
  margin: 0 auto; /* Center the container */
  padding-top: 40px;
}

.game-heading {
  font-family: Gbonserrat;
}

.game-container {
  width: 100%;
  padding: 20px;
  border-radius: 10px;
  row-gap: 15px;
  background-image: linear-gradient(90deg, #ffffff, #ffffff);
}

.cards-container {
  display: grid;
  grid-template-rows: 125px 125px 125px;
  grid-template-columns: 200px 200px 200px 200px;
  grid-gap: 20px 10px;
  place-items: center;
  justify-content: center;
}

.heading-container {
  text-align: center;
}

.gfg-heading {
  color: #b50938;
  font-family: GBEB;
}

.card {
  justify-items: center;
  display: flex;
  align-items: center;
  position: relative;
  cursor: url("img/background/Pointer.svg"),
    url("img/background/cursors/Finger%20cursor.png"), pointer !important;
}

.outline-image {
  position: absolute;
  border-radius: 10px;
  top: 0;
  left: 0;
  height: 125px;
  width: 125px;
  border-radius: 50%;
}

.card-image {
  height: 125px;
  width: 125px;
  transform: rotateY(90deg);
  transition: all ease-in 0.25s;
  mix-blend-mode: multiply;
}

.progress-container {
  text-align: center;
  display: flex;
  justify-content: space-around;
  width: 100%;
  margin: 50px 0 20px 0;
}

.move-counter {
  padding: 10px 20px;
  border-radius: 25px;
  border: 1px solid #ccc;
}

.restart-button {
  padding: 10px 20px;
  background-color: #00bed6;
  border: none;
  border-radius: 25px;
  color: #fff;
  cursor: pointer;
}

.restart-button:hover {
  background-color: transparent;
  border: 1px solid #00bed6;
  color: #00bed6;
}

/* Dynamic classes that are being added by JavaScript */
.toggled .card-image {
  transform: rotateY(0deg);
  transition-delay: 0.25s;
}

.item .outline-image {
  transition: all ease-in 0.25s;
  transition-delay: 0.25s;
}

.toggled .outline-image {
  transform: rotateY(90deg);
  transition-delay: 0s;
}

@media screen and (max-width: 767px) {
  .container {
    width: 95%;
    padding-top: 20px;
  }

  .game-container {
    width: 100%;
  }

  .cards-container {
    grid-template-rows: 125px 125px 125px 125px;
    grid-template-columns: 33% 33% 33%;
    grid-gap: 10px 10px;
  }

  .outline-image {
    height: 100px;
    width: 100px;
  }

  .card-image {
    height: 100px;
    width: 100px;
  }

  .progress-container {
    margin: 10px 0 10px 0;
  }
}

.restart-button:hover {
  cursor: url("img/background/Pointer.svg"),
    url("img/background/cursors/Finger%20cursor.png"), pointer !important;
}

/* Win Popup Styles */
.win-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.win-popup-overlay.show {
  opacity: 1;
}

.win-popup {
  background: linear-gradient(135deg, #fff 0%, #f5f5f5 100%);
  border-radius: 20px;
  padding: 0;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  transform: scale(0.7);
  transition: transform 0.3s ease;
  overflow: hidden;
  border: 3px solid #d42027;
}

.win-popup-overlay.show .win-popup {
  transform: scale(1);
}

.win-popup-header {
  background-color: #012169;
  color: white;
  padding: 30px 20px;
  text-align: center;
  border-bottom: 4px solid #d42027;
}

.win-popup-header h2 {
  margin: 0;
  font-family: "GbonserratEB", sans-serif;
  font-size: 2.2rem;
  font-weight: 900;
  color: white;
  background-color: #012169;
}

.win-popup-content {
  padding: 40px 30px;
  text-align: center;
}

.win-message {
  font-family: "GBonserrat", sans-serif;
  font-size: 1.3rem;
  margin-bottom: 20px;
  color: #333;
}

.moves-count {
  font-family: "GBonserrat", sans-serif;
  font-size: 1.5rem;
  color: #030e51;
  margin: 0;
}

.moves-count strong {
  font-family: "GbonserratEB", sans-serif;
  color: #d42027;
  font-size: 2rem;
}

.win-popup-actions {
  padding: 20px 30px 30px;
  display: flex;
  gap: 15px;
  justify-content: center;
}

.popup-btn {
  padding: 15px 30px;
  border: none;
  border-radius: 25px;
  font-family: "GBonserrat", sans-serif;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
}

.play-again-btn {
  background-color: #d42027;
  color: white;
}

.play-again-btn:hover {
  background-color: #b50938;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(212, 32, 39, 0.4);
}

.close-btn {
  background-color: #030e51;
  color: white;
}

.close-btn:hover {
  background-color: #012169;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(3, 14, 81, 0.4);
}

/* Mobile responsive */
@media screen and (max-width: 767px) {
  .win-popup {
    max-width: 90%;
  }

  .win-popup-header h2 {
    font-size: 1.8rem;
  }

  .win-message {
    font-size: 1.1rem;
  }

  .moves-count {
    font-size: 1.3rem;
  }

  .moves-count strong {
    font-size: 1.7rem;
  }

  .win-popup-actions {
    flex-direction: column;
  }

  .popup-btn {
    width: 100%;
  }
}
