body {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background-color: #50a9d8 !important;
  font-family: Arial, sans-serif;
  margin: 0;
  flex-direction: column;
  position: relative;
}

.memory-game {
  width: 90vw;
  height: 90vw;
  max-width: 640px;
  max-height: 640px;
  display: flex;
  flex-wrap: wrap;
  perspective: 1000px;
}

.memory-card {
  width: calc(25% - 10px);
  height: calc(25% - 10px);
  margin: 5px;
  position: relative;
  transform: scale(1);
  transform-style: preserve-3d;
  transition: transform 0.5s;
  cursor: pointer;
}

.memory-card:active {
  transform: scale(0.97);
  transition: transform 0.2s;
}

.memory-card.flip {
  transform: rotateY(180deg);
}

.memory-card img {
  width: 100%;
  height: 100%;
  border-radius: 5px;
  position: absolute;
  backface-visibility: hidden;
}

.front-face {
  transform: rotateY(180deg);
}

.game-controls {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

#start-button {
  display: none;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background-color: #28a745;
  color: white;
  border: none;
  font-size: 1.5em;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  transition: background-color 0.3s, transform 0.3s;
}

#start-button:hover {
  background-color: #218838;
  transform: scale(1.1);
}

/* Media queries for smaller screens */
@media (max-width: 768px) {
  .memory-card {
    width: calc(25% - 8px);
    height: calc(25% - 8px);
    margin: 4px;
  }

  #start-button {
    width: 80px;
    height: 80px;
    font-size: 1.2em;
  }
}

@media (max-width: 480px) {
  .memory-card {
    width: calc(25% - 6px);
    height: calc(25% - 6px);
    margin: 3px;
  }

  #start-button {
    width: 70px;
    height: 70px;
    font-size: 1em;
  }
}
