body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  background-color: #f4f4f4;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100vh;
  margin: 0;
  padding-top: 20px;
}

.game-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.game-title {
  font-size: 32px;
  margin-bottom: 20px;
  text-align: center;
  color: #776e65;
}
.game-logo {
  max-width: 100px; /* Adjust the size as needed */
  margin: 10px;
  align-self: center; /* Center the logo in the flex container */
}
.how-to-play {
  text-align: center;
  margin-top: 20px; /* Adjust spacing as needed */
  font-size: 14px; /* Adjust font size as needed */
  width: 300px; /* Match the width of the grid */
  margin-left: auto;
  margin-right: auto;
}

.score-container {
  margin-bottom: 20px;
  font-size: 18px;
  color: #776e65;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  width: 300px;
  height: 300px;
  background-color: #cdc0b4;
  padding: 10px;
  border-radius: 10px;
}

.tile {
  background-color: #eee4da;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: bold;
  width: 100%;
  height: 100%;
  transition: transform 0.2s, opacity 0.2s;
  border-radius: 5px;
  min-width: 60px; /* Adjusted */
  min-height: 60px; /* Adjusted */
  will-change: transform, opacity;
}

.tile-number {
  font-size: 16px; /* Default font size */
  color: #776e65;
  font-weight: bold;
  position: absolute;
  top: 5px;
  right: 5px;
  opacity: 0.8;
}

@media screen and (max-width: 600px) {
  .tile-number {
    font-size: 12px; /* Smaller font size for small screens */
  }
}

@media screen and (min-width: 601px) and (max-width: 900px) {
  .tile-number {
    font-size: 14px; /* Slightly larger font size for medium screens */
  }
}

@media screen and (min-width: 901px) {
  .tile-number {
    font-size: 16px; /* Default font size for large screens */
  }
}

.controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 20px;
}

.control-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 5px 0;
}

.control-button {
  font-size: 20px;
  padding: 10px 15px;
  cursor: pointer;
  border: none;
  background-color: #eee4da;
  border-radius: 5px;
}
#player-info-form input {
  margin: 10px 0;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

#player-info-form button {
  background-color: #4caf50; /* Green */
  border: none;
  color: white;
  padding: 10px 20px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  margin: 4px 2px;
  cursor: pointer;
}

button {
  background-color: #eee4da;
  border: none;
  padding: 10px 20px;
  font-size: 18px;
  margin-top: 20px;
  cursor: pointer;
  transition: background-color 0.2s;
  border-radius: 5px;
  color: #776e65;
}

button:hover {
  background-color: #ded0c2;
}

.modal {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
  background-color: #fff;
  padding: 20px;
  border-radius: 10px;
  text-align: center;
  z-index: 11;
  max-width: 90%;
}

.hidden {
  display: none;
}

@media screen and (max-width: 500px) {
  .grid {
    width: 90%;
    height: auto;
    grid-template-columns: repeat(4, 1fr);
  }

  .game-title {
    font-size: 24px;
  }

  .control-button {
    font-size: 16px;
    padding: 8px 12px;
  }

  button {
    font-size: 16px;
    padding: 8px 16px;
  }

  .tile {
    min-width: 15vw;
    min-height: 15vw;
  }

  .tile-number {
    font-size: 3vw;
  }
}
#game-over-message {
  background-color: #e8f0fe; /* Light blue background, choose a color that suits your design */
  color: #333; /* Darker text for contrast */
  padding: 15px; /* Spacing inside the message box */
  margin-top: 20px; /* Space above the message box */
  border: 1px solid #b0c4de; /* Border to make it stand out */
  border-radius: 8px; /* Rounded corners */
  font-weight: bold; /* Make text bold */
  text-align: center; /* Center the text */
}

.snowflake {
  position: absolute;
  background-image: url("https://i.postimg.cc/6qPbNmH8/pngwing-com-2.png");
  background-size: cover;
  width: 25px;
  height: 25px;
  opacity: 0;
  animation: sprinkle 1s linear forwards;
}

@keyframes sprinkle {
  0% {
    opacity: 1;
    transform: translateY(0%);
  }
  100% {
    opacity: 0.5;
    transform: translateY(100%);
  }
}

.tile.merging {
  animation: burst 0.3s forwards, mergeAnimation 0.2s forwards;
}

@keyframes burst {
  from {
    transform: scale(1);
    opacity: 1;
  }
  to {
    transform: scale(1.5);
    opacity: 0;
  }
}

@keyframes mergeAnimation {
  0% {
    transform: scale(1.1);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.tile.spawned {
  animation: spawnAnimation 0.2s forwards;
}

@keyframes spawnAnimation {
  0% {
    transform: scale(0.5);
    opacity: 0.5;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}
