body {
  background-image: url('../img/bg.jpg');
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  min-height: 100vh;
}

.game-board-wrapper {
  width: 100%;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.card-container {
  width: 560px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(5, 104px);
  gap: 10px;
}

.card {
  position: relative;
  width: 104px;
  height: 153px;
  margin: 0;
  perspective: 1000px;
}

.card-flip {
  transform: rotateY(180deg);
  transform-style: preserve-3d;
  transition: transform 0.5s;
}

.card-front,
.card-back {
  position: absolute;
  backface-visibility: hidden;
}

.card-back {
  cursor: pointer;
  transform: rotateY(180deg);
}

.card-front .card-img,
.card-back .card-img {
  border-radius: 12px;
  box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.3);
}

.card-front-img,
.card-back-img {
  width: 104px;
  height: 153px;
}

.game-over-container {
  display: none;
  justify-content: center;
  align-items: center;
  flex-direction: row;
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  padding: 20px;
  background-image: url("../img/bg.jpg");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  z-index: 10;
}

.game-over {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  width: min(520px, 100%);
  min-height: 320px;
  padding: 30px 20px;
  background-color: #fff;
  border-radius: 20px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

h1 {
  text-align: center;
  margin-bottom: 20px;
}

h2 {
  text-align: center;
  margin-bottom: 40px;
}

.btn-game-over {
  width: 200px;
  height: 40px;
  font-size: 1rem;
  font-weight: bold;
  color: #fff;
  margin: 15px;
  border-radius: 5px;
  outline: none;
  border: none;
  background-color: #9c27b0;
  cursor: pointer;
  transition: all 0.5s ease;
}

.btn-game-over:hover {
  color: #9c27b0;
  background-color: #fff;
  border: 2px solid #9c27b0;
}

@media (max-width: 768px) {
  .game-board-wrapper {
    align-items: flex-start;
    padding: 12px 0;
  }

  .card-container {
    width: 340px;
    grid-template-columns: repeat(5, 60px);
    gap: 8px;
  }

  .card {
    width: 60px;
    height: 88px;
  }

  .card-front-img,
  .card-back-img {
    width: 60px;
    height: 88px;
  }

  .game-over {
    min-height: auto;
    padding: 24px 16px;
  }

  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1rem;
    margin-bottom: 24px;
  }

  .btn-game-over {
    width: 100%;
    max-width: 220px;
    margin: 8px 0;
  }
}
