:root {
  --forest-dark: #1b3a2a;
  --forest: #2d5f3f;
  --forest-light: #4a8c5f;
  --moss: #7fb069;
  --earth: #6b4423;
  --sand: #f4ead5;
  --cream: #fffaf0;
  --success: #3a8c4f;
  --fail: #b7472a;
  --ink: #22301f;
  --shadow: rgba(27, 58, 42, 0.25);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: linear-gradient(160deg, var(--forest-dark), var(--forest) 55%, var(--forest-light));
  background-attachment: fixed;
  color: var(--ink);
  display: flex;
  justify-content: center;
  padding: 24px 16px 48px;
}

.wrap {
  width: 100%;
  max-width: 560px;
}

header {
  text-align: center;
  color: var(--cream);
  margin-bottom: 20px;
}

header h1 {
  margin: 0 0 6px;
  font-size: 2rem;
  text-shadow: 0 2px 6px var(--shadow);
}

.subtitle {
  margin: 0;
  opacity: 0.9;
  font-size: 0.95rem;
}

.stats {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.stat {
  flex: 1;
  background: var(--cream);
  border-radius: 14px;
  padding: 12px 16px;
  text-align: center;
  box-shadow: 0 6px 16px var(--shadow);
}

.stat-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--earth);
  margin-bottom: 4px;
}

.stat-value {
  display: block;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--forest-dark);
}

.card {
  background: var(--sand);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 10px 30px var(--shadow);
  border: 1px solid rgba(107, 68, 35, 0.15);
}

.hidden {
  display: none !important;
}

.label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--earth);
  font-weight: 700;
  margin: 0 0 8px;
}

.scenario-text {
  font-size: 1.15rem;
  line-height: 1.5;
  color: var(--ink);
  margin: 0 0 18px;
}

textarea {
  width: 100%;
  border: 2px solid rgba(107, 68, 35, 0.25);
  border-radius: 10px;
  padding: 12px;
  font-family: inherit;
  font-size: 1rem;
  resize: vertical;
  background: var(--cream);
  color: var(--ink);
  margin-bottom: 14px;
}

textarea:focus {
  outline: none;
  border-color: var(--forest);
}

.btn {
  display: inline-block;
  border: none;
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  width: 100%;
}

.btn:active {
  transform: scale(0.98);
}

.btn.primary {
  background: var(--forest);
  color: var(--cream);
}

.btn.primary:hover {
  background: var(--forest-dark);
}

.btn.secondary {
  background: transparent;
  color: var(--earth);
  border: 2px solid var(--earth);
  margin-top: 10px;
}

.result-text {
  font-size: 1.1rem;
  line-height: 1.5;
  margin: 0 0 18px;
}

#result-label.success {
  color: var(--success);
}

#result-label.fail {
  color: var(--fail);
}

.spinner {
  width: 36px;
  height: 36px;
  border: 4px solid rgba(107, 68, 35, 0.2);
  border-top-color: var(--forest);
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

#loading-card {
  text-align: center;
}

footer {
  text-align: center;
  color: var(--cream);
  opacity: 0.7;
  font-size: 0.8rem;
  margin-top: 24px;
}
