body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Oxygen, Ubuntu, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: #f8f9fa;
  margin-top: 20px;
  color: #2c3e50;
}

h1 {
  color: #2c3e50;
  font-size: 2.5em;
  margin-bottom: 1em;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.controls {
  margin-bottom: 20px;
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.game-mode {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 10px;
}

.mode-toggle {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.mode-button {
  padding: 10px 16px;
  background-color: #e9ecef;
  color: #495057;
  border-radius: 8px;
  transition: all 0.3s ease;
  font-weight: 500;
}

.mode-button.active {
  background-color: #228be6;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(34, 139, 230, 0.3);
}

#word-length {
  padding: 8px 12px;
  border: 2px solid #dee2e6;
  border-radius: 8px;
  font-size: 1em;
  color: #495057;
  background-color: white;
  cursor: pointer;
  transition: all 0.2s ease;
}

#word-length:hover {
  border-color: #228be6;
}

#custom-word {
  padding: 10px 16px;
  font-size: 1em;
  width: 180px;
  border: 2px solid #dee2e6;
  border-radius: 8px;
  transition: all 0.2s ease;
}

#custom-word:focus {
  border-color: #228be6;
  outline: none;
  box-shadow: 0 0 0 3px rgba(34, 139, 230, 0.2);
}

#game-board {
  display: grid;
  grid-template-rows: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 20px;
  max-width: 500px;
  width: 90%;
  padding: 20px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.row {
  display: grid;
  gap: 8px;
}

.cell {
  width: 50px;
  height: 50px;
  border: 2px solid #dee2e6;
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.8em;
  font-weight: bold;
  text-transform: uppercase;
  background-color: white;
  color: #495057;
  transition: all 0.3s ease;
  transform-style: preserve-3d;
}

.cell.correct {
  background-color: #6aaa64;
  border-color: #6aaa64;
  color: white;
  transform: rotateX(360deg);
  box-shadow: 0 2px 4px rgba(106, 170, 100, 0.3);
}

.cell.present {
  background-color: #f59f00;
  border-color: #f59f00;
  color: white;
  transform: rotateX(360deg);
  box-shadow: 0 2px 4px rgba(245, 159, 0, 0.3);
}

.cell.absent {
  background-color: #868e96;
  border-color: #868e96;
  color: white;
  transform: rotateX(360deg);
}

.cell.filled {
  border-color: #495057;
}

.input-area {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

#guess-input {
  padding: 12px 16px;
  font-size: 1.1em;
  text-transform: lowercase;
  border: 2px solid #dee2e6;
  border-radius: 8px;
  transition: all 0.2s ease;
}

#guess-input:focus {
  border-color: #228be6;
  outline: none;
  box-shadow: 0 0 0 3px rgba(34, 139, 230, 0.2);
}

button {
  padding: 12px 20px;
  font-size: 1em;
  font-weight: 500;
  cursor: pointer;
  background-color: #228be6;
  color: white;
  border: none;
  border-radius: 8px;
  transition: all 0.2s ease;
}

button:hover {
  background-color: #1c7ed6;
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(34, 139, 230, 0.3);
}

button:disabled {
  background-color: #dee2e6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

#message-area {
  margin-top: 16px;
  min-height: 2em;
  text-align: center;
  padding: 8px 16px;
  border-radius: 8px;
}

#message {
  font-weight: 500;
  color: #e03131;
}

#message.success {
  color: #6aaa64;
}

#message.warning {
  color: #f39c12;
  font-weight: bold;
}

#message.info {
  color: #228be6;
}

#keyboard {
  margin-top: 24px;
  user-select: none;
  background: white;
  padding: 16px;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.keyboard-row {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}

#keyboard button {
  font-family: inherit;
  font-weight: 500;
  padding: 0;
  margin: 0 4px;
  height: 50px;
  min-width: 40px;
  border-radius: 6px;
  background-color: #e9ecef;
  color: #495057;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#keyboard button:hover {
  background-color: #dee2e6;
}

#keyboard button.wide {
  min-width: 60px;
}

#keyboard button.correct {
  background-color: #6aaa64;
  color: white;
}

#keyboard button.present {
  background-color: #f59f00;
  color: white;
}

#keyboard button.absent {
  background-color: #868e96;
  color: white;
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-5px);
  }

  75% {
    transform: translateX(5px);
  }
}

.shake {
  animation: shake 0.3s ease-in-out;
}

@keyframes dance {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

.dance .cell {
  animation: dance 0.5s ease-in-out;
}