/* styles.css */

/* Global styles */
body {
  font-family: Arial, sans-serif;
  text-align: center;
  background-color: #3b80bd;
  margin: 0;
  padding: 0;
}

#start-screen {
  margin: 20px auto;
  max-width: 600px;
  padding: 20px;
  background: white;
  border: 2px solid #ccc;
  border-radius: 10px;
}

#game-container {
  margin: 20px auto;
  max-width: 600px;
  padding: 20px;
  background-color: #b5ca22;
  border: 2px solid #ccc;
  border-radius: 10px;
}

#stats {
  margin: 20px 0;
  font-size: 18px;
  color: #333;
  display: flex;
  justify-content: space-around;
}

#game-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin: 20px 0;
  background-color: #f0f0f0;
  padding: 15px;
  border-radius: 10px;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.1);
}

.card {
  width: 100px;
  height: 100px;
  position: relative;
  cursor: pointer;
  border-radius: 10px;
  overflow: hidden;
  transform-style: preserve-3d;
  transition: transform 0.3s;
  border: 1px solid #ccc;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('ostafers.ch_.png');
  background-size: contain;
  background-color: rgb(190, 188, 188);
  background-repeat: no-repeat;
  background-position: center;
  backface-visibility: hidden;
}

.card.flipped {
  background-color: white; /* Set background color to white for flipped cards */
  cursor: default;
}

.card.flipped::before {
  background-image: none; /* Hide the background image for flipped cards */
  backface-visibility: hidden;
}

.card img {
  width: 100%;
  height: 100%;
  border-radius: 10px;
  backface-visibility: hidden;
  transform: rotateY(180deg);
  display: block;
  object-fit: contain; /* Ensure the image maintains its aspect ratio */
}

.card.flipped {
  transform: rotateY(180deg);
}

.card.flipped img {
  backface-visibility: visible;
}

.card.correct {
  border: 2px solid green !important;
}

.card.incorrect {
  border: 2px solid red !important;
}

/* Mobile layout */
@media (max-width: 768px) {
  #game-board {
      grid-template-columns: repeat(3, 1fr);
      gap: 15px;
      margin: 10px auto;
  }

  .card {
      width: 80px;
      height: 80px;
  }

  .card img {
      width: 80px;
      height: 80px;
      object-fit: contain; /* Ensure the image maintains its aspect ratio */
  }
}

/* Default layout for larger screens */
@media (min-width: 769px) {
  #game-board {
      grid-template-columns: repeat(3, 1fr);
      gap: 10px;
  }

  .card {
      width: 100px;
      height: 100px;
  }

  .card img {
      width: 100px;
      height: 100px;
      object-fit: contain; /* Ensure the image maintains its aspect ratio */
  }
}

/* PC layout */
.pc #game-board {
  grid-template-columns: repeat(3, 1fr);
}

/* Popup */
#popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #b5ca22;
  display: flex;
  justify-content: center;
  align-items: center;
}

#popup-content {
  background-color: #b5ca22;
  padding: 20px;
  border-radius: 10px;
  text-align: center;
}

#popup-content h2 {
  margin: 10px 0;
}

#popup-content p {
  margin: 20px 0;
}

/* Restart Button */
#restart-button,
#popup-restart {
  background-color: #3b80bd; /* Same blue color as the background */
  color: white;
  border: none;
  border-radius: 25px;
  padding: 15px 30px;
  font-size: 18px;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.3s;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  margin-top: 20px;
}

#restart-button:hover,
#popup-restart:hover {
  background-color: #2f6e9c; /* Darker shade of blue for hover effect */
  transform: translateY(-2px);
}

#restart-button:active,
#popup-restart:active {
  background-color: #255a7d; /* Even darker shade of blue for active state */
  transform: translateY(0);
}
