body {
  background-color: #f9f7fe;
  font-family: Helvetica, Arial, sans-serif;
  color: #222;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: 40px 20px;
}

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

header h1 {
  text-align: center;
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 30px;
}

main {
  background: #ffffff;
  padding: 40px;
  width: min(550px, 100%);
  border-radius: 14px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
  text-align: center;
}

form {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
}

form input[type="text"] {
  flex: 1;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 1rem;
  transition: border 0.2s ease;
}

form input[type="text"]:focus {
  border-color: #8c4482;
  outline: none;
}

form input[type="submit"] {
  background: #8c4482;
  color: #fff;
  border: none;
  padding: 14px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  transition: 0.2s ease;
}
form input[type="submit"]:hover {
  background: #602e59;
}

.hidden {
  display: none;
}

.generating .dots {
  display: inline-block;
  animation: dots 1s steps(3, end) infinite;
}

@keyframes dots {
  0%,
  20% {
    content: "";
  }
  40% {
    content: ".";
  }
  60% {
    content: "..";
  }
  80%,
  100% {
    content: "...";
  }
}

#poem {
  margin-top: 30px;
  text-align: center;
  font-size: 1.3rem;
  color: #333;
  line-height: 1.6;
  padding: 20px;
  width: min(650px, 90%);
  white-space: pre-wrap;
}

footer {
  border-top: 1px solid #f9f7fe;
  text-align: center;
  padding-top: 15px;
  color: #602e59;
}
