:root {
  --correct-color: #6aaa64;
  --present-color: #c9b458;
  --absent-color: #787c7e;
  --key-bg: #d3d6da;
  --key-color: #1a1a1b;
}

body {
  font-family: 'Helvetica Neue', sans-serif;
  background-color: #f7f7f7;
  color: var(--key-color);
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  margin: 0;
}

.game-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  max-width: 500px;
  margin: 0 auto;
}

header {
  border-bottom: 1px solid #ccc;
  padding: 10px 0;
  width: 100%;
  text-align: center;
}

.title {
  font-size: 2.5rem;
  font-weight: bold;
  letter-spacing: 0.1em;
  margin: 0;
}

main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.game-board {
  display: grid;
  grid-template-rows: repeat(6, 1fr);
  gap: 5px;
  padding: 10px;
  width: fit-content; /* Fit to content */
  margin: 0 auto; /* Center the board */
}

.tile-row {
  display: grid;
  /* grid-template-columns will be set by JS */
  gap: 5px;
}

.tile {
  width: 60px;
  height: 60px;
  border: 2px solid #d3d6da;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 2rem;
  font-weight: bold;
  text-transform: uppercase;
  transition: transform 0.2s;
}

.tile.filled {
  border-color: #878a8c;
}

.tile.correct {
  background-color: var(--correct-color);
  color: white;
  border-color: var(--correct-color);
}

.tile.present {
  background-color: var(--present-color);
  color: white;
  border-color: var(--present-color);
}

.tile.absent {
  background-color: var(--absent-color);
  color: white;
  border-color: var(--absent-color);
}

.keyboard-container {
  margin: 20px 0;
}

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

.key {
  font-size: 1rem;
  font-weight: bold;
  padding: 20px;
  margin: 0 3px;
  background-color: var(--key-bg);
  color: var(--key-color);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-transform: uppercase;
}

.key.large {
  padding: 20px 30px;
}

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

.alert-container {
  position: fixed;
  top: 10vh;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.alert {
  pointer-events: none;
  background-color: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 10px 20px;
  border-radius: 5px;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
  font-size: 1rem;
}

.alert.show {
  opacity: 1;
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: none; /* Hidden by default */
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.modal-overlay.show {
  display: flex; /* Shown when needed */
}

.modal-content {
  background-color: white;
  padding: 30px;
  border-radius: 10px;
  text-align: center;
}

.modal-content h2 {
  margin-top: 0;
}

.language-options button {
  font-size: 1.2rem;
  padding: 10px 20px;
  margin: 0 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
  cursor: pointer;
}

.language-options button:hover {
  background-color: #eee;
}