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

h1 {
  margin-bottom: 20px;
}

.stats {
  margin-bottom: 20px;
  font-size: 1.2em;
}

#tries-counter,
#time-counter {
  font-weight: bold;
}

#time-counter {
  width: 50px;
  text-align: center;
  display: inline-block;
}

#game-board {
  display: grid;
  grid-template-columns: repeat(6, 100px);
  grid-gap: 10px;
  margin-bottom: 20px;
}

.card {
  width: 100px;
  height: 100px;
  cursor: pointer;
  perspective: 1000px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.6s;
}

.card.flipped .card-inner {
  transform: rotateY(180deg);
}

.card-front,
.card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2em;
  border-radius: 10px;
}

.card-front {
  background-color: #91c7b1;
}

.card-back {
  background-color: #ffffff;
  color: #91c7b1;
  transform: rotateY(180deg);
}

.stats-container {
  background-color: #e6dbcc;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  text-align: center;
  margin-bottom: 20px;
}

#end-screen {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: white;
  border: 2px solid #333;
  padding: 20px;
  z-index: 1000;
  text-align: center;
  display: none;
}

#end-screen h2 {
  margin-bottom: 20px;
}

.hidden {
  display: none;
}

#play-again {
  margin-top: 20px;
  padding: 10px 20px;
  background-color: rgb(66, 140, 117);
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

#play-again:hover {
  background-color: rgb(50, 108, 89);
}

button#restart {
  background-color: rgb(66, 140, 117);
  color: white;
  border: none;
  padding: 10px 20px;
  cursor: pointer;
  font-size: 16px;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

button#restart:hover {
  background-color: rgb(50, 108, 89);
}
