body {
  margin: 0;
  background-color: rgb(245, 224, 80);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  height: 100vh;
  padding-top: 1vh;
  font-family: 'Comic Relief', cursive;
  overflow: hidden;
}

#game-container {
  text-align: center;
  width: 100%;
  max-height: fit-content;
}

.bottomImg {
  width: 100%;
  max-width: 500px;
  width: min(90vw, 90vh);
}

.grid-wrapper {
  position: relative;
  width: min(90vw, 90vh);
  max-width: 500px;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  border: 3px solid white;
}

.background-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.background-image.visible {
  opacity: 1;
}

.grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  z-index: 1;
}

.tile {
  background-color: rgb(245, 224, 80);
  border: 1px solid white;
  cursor: pointer;
  transition: opacity 0.3s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: clamp(14px, 2vw, 20px);
  color: rgb(0, 0, 0);
}

.tile:hover {
  background-color: rgb(255, 234, 100);
}

.tile.revealed {
  opacity: 0;
  pointer-events: none;
}

#final-reveal {
  display: none;
  margin-top: 20px;
  font-size: clamp(18px, 3vw, 28px);
  color: rgb(0, 0, 0);
  text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.8);
}

/* Modal styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
}

.modal.active {
  display: flex;
}

.modal-content {
  background-color: rgb(245, 224, 80);
  padding: 20px;
  border-radius: 10px;
  width: fit-content;
  height: fit-content;
  max-width: 85%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-content h2 {
  margin-top: 0;
  color: rgb(0, 0, 0);
}

.close-btn {
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  background: none;
  border: none;
  color: rgb(0, 0, 0);
}

/* Wordle game styles */
.wordle-board {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 5px;
  margin: 20px auto;
}

.wordle-row {
  display: flex;
  width: 100%;
  gap: 5px;
  justify-content: space-between;
}

.wordle-letter {
  flex: 1;
  aspect-ratio: 1 / 1;
  border: 2px solid #d3d6da;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 32px;
  font-weight: bold;
  background-color: white;
  color: black;
  text-transform: uppercase;
  transition: all 0.3s ease;
}

.wordle-letter.filled {
  border-color: #878a8c;
  animation: pop 0.1s ease-in-out;
}

.wordle-letter.correct {
  background-color: #6aaa64;
  color: white;
  border-color: #6aaa64;
  animation: flip 0.5s ease-in-out;
}

.wordle-letter.present {
  background-color: #c9b458;
  color: white;
  border-color: #c9b458;
  animation: flip 0.5s ease-in-out;
}

.wordle-letter.absent {
  background-color: #787c7e;
  color: white;
  border-color: #787c7e;
  animation: flip 0.5s ease-in-out;
}

@keyframes pop {
  0%,
  90% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

@keyframes flip {
  0% {
    transform: rotateX(0);
  }
  50% {
    transform: rotateX(90deg);
  }
  90% {
    transform: rotateX(0);
  }
}

/* Keyboard styles */
.keyboard {
  margin-top: 20px;
}

.keyboard-row {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: 6px;
}

.key {
  display: flex;
  justify-content: center;
  align-items: center;

  min-width: 25px;
  height: 50px;
  flex-grow: 1;

  background-color: #e0e0e0;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.2s;
  color: black;
}

.key:hover {
  background-color: #d0d0d0;
}

.key:active {
  transform: scale(0.95);
}

.key.wide {
  min-width: 60px;
  font-size: 12px;
}

.key.correct {
  background-color: #6aaa64 !important;
  color: white !important;
}

.key.present {
  background-color: #c9b458 !important;
  color: white !important;
}

.key.absent {
  background-color: #787c7e !important;
  color: white !important;
}

.wordle-message {
  margin-top: 15px;
  font-size: 20px;
  min-height: 30px;
  font-weight: bold;
}

.question-game {
  text-align: center;
}


.rebus-game {
  text-align: center;
}

/* Emoji Game styles */
.emoji-game {
  text-align: center;
}

.emoji-display {
  font-size: 50px;
  min-height: 100px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.input {
  width: 90%;
  padding: 12px;
  font-size: 18px;
  text-align: center;
  border: 2px solid #333;
  border-radius: 5px;
  font-family: 'Comic Relief', cursive;
  margin-bottom: 10px;
}

.emoji-submit {
  padding: 12px 30px;
  font-size: 18px;
  background-color: #6aaa64;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-family: 'Comic Relief', cursive;
  width: 90%;
}

.emoji-submit:hover {
  background-color: #5a9a54;
}

.emoji-message {
  margin-top: 15px;
  font-size: 18px;
  min-height: 25px;
  font-weight: bold;
}

.emoji-progress {
  margin-top: 20px;
  font-size: 16px;
  color: #666;
}
.white-space-preline {
  white-space: pre-line;
}