body.light { background:#faf7ff; color:#201a2d; }
body.dark { background:#111; color:#eee; }
body.lavender { background:#f3eaff; color:#2a1c46; }

.serif .poem { font-family:"Playfair Display", Georgia, serif; }
.sans .poem { font-family:Inter, Arial, sans-serif; }
.handwriting .poem { font-family:"Shadows Into Light", cursive; }

.customization { display:flex; flex-wrap:wrap; gap:16px; margin-top:12px; }
.customization label { display:flex; flex-direction:column; font-size:14px; gap:4px; }
.toggle { flex-direction:row; align-items:center; gap:6px; }

.card{background:#fff;padding:16px;border-radius:12px;box-shadow:0 5px 15px rgba(0,0,0,.1);margin-top:12px}
.button{background:#7c5cff;color:#fff;padding:12px 18px;border:0;border-radius:999px;cursor:pointer;font-weight:600;display:inline-flex;align-items:center;gap:8px}
.button.loading .spinner{display:inline-block}
.spinner{width:14px;height:14px;border:2px solid rgba(255,255,255,.6);border-top-color:#fff;border-radius:50%;display:none;animation:spin 1s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}


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

body.light {
  background-color: #f9f9f9;
  color: #222;
}

body.dark {
  background-color: #1e1e1e;
  color: #f0f0f0;
}

body.lavender {
  background-color: #f3e5f5;
  color: #4a2c66;
}

/* Fonts */
body.serif {
  font-family: 'Playfair Display', serif;
}
body.sans {
  font-family: 'Inter', sans-serif;
}
body.handwriting {
  font-family: 'Shadows Into Light', cursive;
}

/* Container */
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem;
}

/* Header styles */
.hero {
  background-color: inherit;
  padding: 2rem 1rem;
  text-align: center;
}
.title {
  font-family: 'Playfair Display', serif;
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  color: inherit;
}
.subtitle {
  font-size: 1.2rem;
  color: #555;
}

/* Form styles */
form {
  background: inherit;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 700px;
  margin: 0 auto;
}
label {
  display: flex;
  flex-direction: column;
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.5rem;
}
input[type="text"], select, input[type="range"] {
  padding: 0.75rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-family: inherit;
  font-size: 1rem;
  margin-top: 0.5rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input[type="text"]:focus, select:focus {
  border-color: #007BFF;
  outline: none;
  box-shadow: 0 0 0 2px rgba(0,123,255,0.2);
}
.output {
  margin-top: 2rem;
}

/* Custom range slider */
input[type="range"] {
  width: 100%;
  margin-top: 0.5rem;
}
#linesVal {
  margin-top: 0.5rem;
  font-weight: 600;
  display: inline-block;
  margin-left: 0.5rem;
}

/* Toggle switch */
.toggle {
  align-items: center;
  font-size: 1rem;
}
.toggle input[type="checkbox"] {
  margin-right: 0.5rem;
}

/* Buttons */
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #007BFF;
  color: #fff;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  transition: background-color 0.2s, box-shadow 0.2s;
}
button:hover {
  background-color: #0056b3;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
button:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

/* Button labels and spinner */
.btn-label {
  margin-right: 0.5rem;
}
.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  display: none;
}
button.loading .spinner {
  display: inline-block;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Output poem styling */
.poem {
  background-color: transparent;
  padding: 1rem;
  border-radius: 8px;
  font-family: 'Shadows Into Light', cursive;
  font-size: 1.2rem;
  white-space: pre-wrap;
  line-height: 1.5;
  border: 2px dashed transparent;
}
.output .toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.output .tools button {
  background: none;
  border: none;
  color: #007BFF;
  font-size: 1rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  transition: color 0.2s;
}
.output .tools button:hover {
  color: #0056b3;
}

/* Responsive styles */
@media (max-width: 768px) {
  form {
    padding: 1.5rem;
  }
  body.serif {
    font-size: 0.9rem;
  }
}