body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #020617;
  color: #e5e7eb;
}

.app {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px;
}

h1 {
  text-align: center;
  margin-bottom: 24px;
}

/* Card */

.card {
  background: #0f172a;
  border-radius: 16px;
  border: 1px solid #1e293b;
  padding: 20px;
}

label {
  font-size: 14px;
  color: #9ca3af;
  margin-bottom: 4px;
  display: block;
}

input,
textarea {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #475569;
  background: #020617;
  color: #e5e7eb;
  margin-bottom: 12px;
}

textarea {
  min-height: 100px;
  font-family: inherit;
  resize: vertical;
}

/* Extract box */

.extract-box {
  border-radius: 12px;
  border: 1px dashed #1f2937;
  padding: 10px;
  margin-bottom: 12px;
  background: #020617;
}

.extract-box textarea {
  min-height: 90px;
}

.extract-box button {
  margin-top: 4px;
  font-size: 12px;
  padding: 6px 12px;
}

/* Options row */

.options-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.option {
  flex: 1;
}

.checkbox-option label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 0;
  font-size: 13px;
}

.checkbox-option input[type="checkbox"] {
  width: auto;
  margin: 0;
}

/* Button */

button {
  padding: 10px 16px;
  border-radius: 999px;
  border: none;
  background: #3b82f6;
  color: white;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

button:hover {
  opacity: 0.9;
}

/* Error & result */

.error {
  color: #f97373;
  font-size: 13px;
  margin-top: 8px;
  min-height: 16px;
}

.result {
  margin-top: 20px;
  padding-top: 12px;
  border-top: 1px dashed #1f2937;
}

.hidden {
  display: none;
}

.small {
  font-size: 13px;
  color: #9ca3af;
  margin: 4px 0;
}

/* Winners display */

.winner-box-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.winner-pill {
  padding: 8px 14px;
  border-radius: 999px;
  background: #22c55e;
  color: #022c22;
  font-weight: 600;
  font-size: 14px;
  animation: pop 0.3s ease-out;
}

/* History */

.history-title {
  margin-top: 32px;
  margin-bottom: 8px;
}

.history {
  background: #020617;
  border-radius: 12px;
  border: 1px solid #1e293b;
  padding: 12px;
  font-size: 14px;
}

.history-item {
  border-bottom: 1px solid #1e293b;
  padding: 8px 0;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.history-item:last-child {
  border-bottom: none;
}

.history-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.history-title-text {
  font-weight: 500;
}

.history-meta {
  color: #9ca3af;
  font-size: 12px;
}

.history-view-btn {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #3b82f6;
  background: transparent;
  color: #bfdbfe;
  font-size: 12px;
  cursor: pointer;
}

.history-view-btn:hover {
  background: #1d4ed8;
  color: white;
}

/* Footer */

.footer {
  margin-top: 20px;
  text-align: center;
  font-size: 12px;
  color: #6b7280;
}

/* Animations */

@keyframes pop {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
