* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  font-family: sans-serif;
  background: #f0f0f0;
}

#container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 600px;
  background: white;
  padding: 30px;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

#text-input {
  padding: 15px 20px;
  border: 2px solid #ddd;
  border-radius: 10px;
  font-size: 16px;
  outline: none;
  transition: border-color 0.3s;
}

#text-input:focus {
  border-color: rgb(235, 175, 62);
}

#button {
  height: 50px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  background: orange;
  color: white;
  border: none;
  border-radius: 10px;
  transition: background 0.3s;
}

#button:hover {
  background: rgb(235, 175, 62);
}

#generated-text {
  position: relative;
  min-height: 200px;
  border: 2px solid #ccc;
  padding: 20px;
  border-radius: 10px;
  background: #fafafa;
  line-height: 1.5;
}

.letter {
  display: inline-block;
  font-size: 28px;
  padding: 8px 4px;
  margin: 2px;
  cursor: grab;
  user-select: none;
  border-radius: 5px;
  transition: background 0.5s, transform 0.2s;
  min-width: 20px;
  text-align: center;
}

.letter:hover {
  background: #e3f2fd;
}

.letter.selected {
  background: #f44336;
  color: white;
  font-weight: bold;
  transform: scale(1.1);
}

.letter.dragging {
  opacity: 0.7;
  z-index: 1000;
  transition: none;
}

.selection-box {
  position: absolute;
  border: 2px solid lightskyblue;
  background: rgba(33, 150, 243, 0.1);
  pointer-events: none;
  z-index: 999;
}

.instructions {
  font-size: 14px;
  color: #666;
  text-align: center;
  margin-top: 10px;
}
