body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  margin: 0;
  background-color: #f2f2f2;
  font-family: 'Arial', sans-serif;
  flex-direction: column;
  /* Để căn giữa theo chiều dọc */
}

#memory-game {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  grid-template-rows: repeat(8, minmax(0, 1fr));
  gap: 20px;
  max-width: 700px;
  max-height: 700px;
  margin: 20px auto;
}

#revealAllBtnContainer {
  text-align: center;
  margin-top: 20px;
}

#revealCountDisplay {
  margin-top: 10px;
  font-size: 14px;
  color: #555;
}

#elapsedTimeDisplay {
  margin-top: 10px;
  font-size: 16px;
  font-weight: bold;
  color: #333;
}

.card {
  width: 100%;
  height: 100%;
  background-color: #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: bold;
  color: #333;
  cursor: pointer;
  user-select: none;
  border-radius: 8px;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
  transition: background-color 0.3s ease;
}

.card.flipped {
  background-color: #fff;
}

.matched {
  background-color: #8aff8a !important;
  pointer-events: none;
}

#revealAllBtn {
  display: block;
  margin: 20px auto;
  padding: 12px 24px;
  font-size: 16px;
  background-color: #4caf50;
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  outline: none;
  transition: background-color 0.3s ease;
}

#revealAllBtn:hover {
  background-color: #45a049;
}

/* Popup styling */
#popupContainer {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

#popupContent {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 20px;
  background-color: #fff;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

.close {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 20px;
  cursor: pointer;
}

/* Authentication area styling */
#authenticationArea {
  text-align: center;
}

#authenticationArea h2 {
  margin-bottom: 20px;
}

#authenticationArea input {
  width: 100%;
  padding: 10px;
  margin-bottom: 10px;
}

#authenticationArea button {
  padding: 10px 20px;
  font-size: 16px;
  background-color: #4caf50;
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

#authenticationArea button:hover {
  background-color: #45a049;
}

#errorDisplay {
  color: red;
  margin-top: 10px;
}

/* User display styling */
#userDisplayName {
  font-size: 18px;
  font-weight: bold;
  margin-top: 20px;
  display: none;
}

/* Open Popup button styling */
#openPopupBtn {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 16px;
  background-color: #4caf50;
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  outline: none;
  transition: background-color 0.3s ease;
}

#openPopupBtn:hover {
  background-color: #45a049;
}