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

body {
  background-color: #f9f7fe;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #333;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 650px;
  margin: 60px auto;
  padding: 30px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(39, 32, 68, 0.12);
}

.header {
  text-align: center;
  margin-bottom: 35px;
}

h1 {
  font-size: 36px;
  font-weight: 800;
  line-height: 1.3;
  color: #272044;
  margin-bottom: 10px;
}

.subtitle {
  font-size: 16px;
  color: #7b6fa0;
  font-style: italic;
}

.poem-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

label {
  font-size: 16px;
  font-weight: 600;
  color: #272044;
}

select {
  padding: 12px 16px;
  font-size: 16px;
  border: 2px solid #c9b8f0;
  border-radius: 8px;
  background-color: #f3effe;
  color: #272044;
  cursor: pointer;
  outline: none;
  transition: border 0.3s ease;
}

select:focus {
  border-color: #7c4dff;
}

.generate-poem-btn {
  padding: 14px;
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(135deg, #7c4dff, #272044);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.generate-poem-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(124, 77, 255, 0.4);
}

.generate-poem-btn:active {
  transform: translateY(0);
}

.poem-box,
#poem-container {
  margin-top: 20px;
  padding: 20px;
  background: #f3effe;
  border-left: 4px solid #7c4dff;
  border-radius: 8px;
  font-size: 16px;
  line-height: 1.8;
  color: #272044;
  min-height: 50px;
}

#poemContent,
.poem-box #poemContent,
.typed-text {
  white-space: pre-wrap;
}

.typing-cursor {
  display: inline-block;
  margin-left: 6px;
  animation: blink 1s steps(2, start) infinite;
  color: #272044;
}

@keyframes blink {
  to { visibility: hidden; }
}

.copy-btn {
  margin-left: 12px;
  padding: 10px 14px;
  font-size: 15px;
  background: #ffffff;
  border: 2px solid #7c4dff;
  color: #272044;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.08s ease;
}

.copy-btn:hover { background: #f3effe; transform: translateY(-1px); }
.copy-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.footer {
  margin-top: 30px;
  padding: 20px;
  text-align: center;
  background: #272044;
  color: #ccc;
  border-radius: 12px;
  font-size: 10px;
  line-height: 2;
}

.footer a {
  color: #90caf9;
  text-decoration: none;
  font-weight: 600;
}

.footer a:hover {
  text-decoration: underline;
  color: #ffffff;
}