* {
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f4f4f9;
  margin: 0;
  padding: 0;
  display: flex;
  min-height: 100vh;
  justify-content: center;
  align-items: center;
}

.game-container {
  background: #ffffff;
  padding: 1.75rem 2rem 2.25rem;
  border-radius: 16px;
  max-width: 640px;
  width: 100%;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

h1 {
  text-align: center;
  margin-top: 0;
  margin-bottom: 1rem;
  letter-spacing: 0.06em;
}

#status-bar {
  display: flex;
  justify-content: space-between;
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

#word-display {
  font-size: 2rem;
  letter-spacing: 0.2em;
  text-align: center;
  margin: 1rem 0 1.5rem;
  min-height: 2.4em;
}

#keyboard {
  display: grid;
  grid-template-columns: repeat(13, minmax(0, 1fr));
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.key-btn {
  border: 1px solid #ddd;
  padding: 0.35rem 0;
  background: #fafafa;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: transform 0.05s ease, box-shadow 0.05s ease, background 0.15s ease;
}

.key-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(0,0,0,0.06);
}

.key-btn:disabled {
  background: #e3e3e3;
  color: #777;
  cursor: default;
  box-shadow: none;
  transform: none;
}

#message {
  min-height: 1.5rem;
  text-align: center;
  margin-bottom: 1rem;
  font-weight: 500;
}

#message.win {
  color: #1a7f3c;
}

#message.lose {
  color: #b00020;
}

#definition-panel {
  border-top: 1px solid #ddd;
  padding-top: 1rem;
  margin-top: 0.5rem;
  font-size: 0.95rem;
}

#definition-panel h2 {
  margin-top: 0;
  font-size: 1.1rem;
}

.hidden {
  display: none;
}

#new-game-btn {
  display: block;
  margin: 1rem auto 0;
  padding: 0.5rem 1.5rem;
  border-radius: 999px;
  border: none;
  background: #3949ab;
  color: white;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease, box-shadow 0.05s ease;
}

#new-game-btn:hover {
  background: #303f9f;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

#new-game-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

@media (max-width: 600px) {
  .game-container {
    margin: 1rem;
    padding: 1.25rem 1.5rem 1.5rem;
  }

  #keyboard {
    grid-template-columns: repeat(9, minmax(0, 1fr));
  }

  #word-display {
    font-size: 1.6rem;
  }
}
