body {
  font-family: "Roboto", "Helvetica Neue", sans-serif;
  background-color: #e9e9f0;
  color: #333;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-y: auto;
  padding: 20px;
}

body.dark-mode {
  background-color: #1e1e2e;
  color: #f8f8f2;
}

.container {
  background-color: #fff;
  padding: 30px;
  border-radius: 15px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  text-align: center;
  max-width: 800px;
  width: 100%;
  transition: background-color 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dark-mode .container {
  background-color: #282a36;
  box-shadow: 0 8px 20px rgba(255, 255, 255, 0.05);
}

.app-header {
  margin-bottom: 20px;
}

h1 {
  font-size: 2.5em;
  margin-bottom: 10px;
  color: #4a90e2;
  font-weight: 700;
}

.dark-mode h1 {
  color: #8be9fd;
}

.subtitle {
  font-size: 1.1em;
  color: #555;
  font-weight: 400;
}

.dark-mode .subtitle {
  color: #bbb;
}

.game-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

.game-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.hangman-status {
  font-size: 1.1em;
  font-weight: 600;
}

.hint-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.hint {
  font-style: italic;
  color: #777;
  font-size: 0.9em;
}

.dark-mode .hint {
  color: #999;
}

.game-play {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.word {
  font-size: 2.2em;
  letter-spacing: 10px;
  font-weight: 700;
}

.message {
  font-size: 1.2em;
  font-weight: 500;
}

.keyboard-area {
  margin-top: 10px;
}

.keyboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(35px, 1fr));
  gap: 6px;
}

.keyboard button {
  background-color: #f0f0f5;
  border: none;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9em;
  transition: background-color 0.3s ease, transform 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  font-weight: 500;
}

.keyboard button:hover {
  background-color: #e0e0e5;
  transform: translateY(-2px);
}

.keyboard button.used {
  background-color: #d0d0d5;
  cursor: default;
  box-shadow: none;
}

.dark-mode .keyboard button {
  background-color: #333;
  color: #eee;
}

.dark-mode .keyboard button:hover {
  background-color: #444;
}

.dark-mode .keyboard button.used {
  background-color: #555;
}

.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9em;
  font-weight: 500;
  transition: background-color 0.3s ease, transform 0.2s ease,
    box-shadow 0.2s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-primary {
  background-color: #4a90e2;
  color: #fff;
}

.btn-secondary {
  background-color: #777;
  color: #fff;
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary:hover {
  background-color: #357bd8;
}

.btn-secondary:hover {
  background-color: #666;
}

.hidden {
  display: none;
}

.theme-toggle {
  position: absolute;
  top: 20px;
  right: 20px;
}

.theme-label {
  width: 45px;
  height: 25px;
  background-color: #ccc;
  border-radius: 25px;
  display: block;
  position: relative;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.theme-label::before {
  content: "";
  position: absolute;
  width: 21px;
  height: 21px;
  background-color: #fff;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: transform 0.3s ease, background-color 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#theme-checkbox {
  display: none;
}

#theme-checkbox:checked + .theme-label {
  background-color: #666;
}

#theme-checkbox:checked + .theme-label::before {
  transform: translateX(20px);
  background-color: #333;
}

.creator-info {
  text-align: center;
  font-size: 0.8rem;
  color: #777;
}

.dark-mode .creator-info {
  color: #bbb;
}

.creator-info a {
  color: inherit;
  text-decoration: none;
  font-weight: 500;
}

.hidden {
  display: none !important;
}

.difficulty-selection {
  text-align: center;
  margin-bottom: 20px;
}

.difficulty-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 80%;
  max-width: 400px;
  margin: 0 auto;
  margin-bottom: 10px;
}

.difficulty-buttons button {
  padding: 15px 20px;
  font-size: 1.2em;
  width: 100%;
  box-sizing: border-box;
}

.difficulty-selection h2 {
  margin-bottom: 10px;
}

@media (min-width: 768px) {
  .difficulty-buttons {
    flex-direction: row;
    width: 100%;
    max-width: 600px;
  }
  .difficulty-buttons button {
    width: auto;
  }
}

@media (max-width: 600px) {
  .container {
    padding: 20px;
    border-radius: 10px;
  }

  h1 {
    font-size: 2em;
  }

  .word {
    font-size: 1.8em;
    letter-spacing: 8px;
  }

  .keyboard {
    grid-template-columns: repeat(auto-fit, minmax(30px, 1fr));
    gap: 4px;
  }

  .keyboard button {
    padding: 6px;
    font-size: 0.8em;
  }
}
