:root {
  --ink: #2B2621;
  --muted: #8C8072;
  --accent: #C1602F;
  --accent-hover: #9C4E24;
  --accent2: #6F8F76;
  --card-bg: #F6F0E4;
  --input-bg: #FFFDF8;
  --outer-bg: #EDE6D6;
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--outer-bg);
}

body {
  font-family: Karla, sans-serif;
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}

a { color: var(--accent); }
a:hover { color: var(--accent-hover); }

button, input, textarea {
  font: inherit;
  color: inherit;
}

button {
  -webkit-appearance: none;
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

input, textarea {
  -webkit-appearance: none;
  appearance: none;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}
@keyframes popIn {
  from { opacity: 0; transform: scale(0.86); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes tileIn {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes checkPop {
  0% { transform: scale(0); }
  60% { transform: scale(1.25); }
  100% { transform: scale(1); }
}
@keyframes leafPop {
  0% { transform: scale(0.4) rotate(-8deg); }
  60% { transform: scale(1.15) rotate(4deg); }
  100% { transform: scale(1) rotate(0deg); }
}
@keyframes leafBob {
  0%, 100% { transform: translateY(-50%) scale(1); }
  50% { transform: translateY(-55%) scale(1.15); }
}
@keyframes shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}

.app {
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  background: var(--outer-bg);
}

.card {
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 460px;
  min-height: 100dvh;
  background: var(--card-bg);
  display: flex;
  flex-direction: column;
}

@media (min-width: 560px) {
  .app { align-items: center; padding: 40px 16px; }
  .card {
    min-height: 0;
    height: min(874px, 90vh);
    border-radius: 32px;
    box-shadow: 0 30px 60px -20px rgba(43, 38, 33, 0.35);
  }
}

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Intro / notice / end — centered screens */
.screen-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: calc(env(safe-area-inset-top, 0px) + 28px) 28px 32px;
  box-sizing: border-box;
  min-height: 0;
  animation: fadeUp 0.4s ease both;
}
.screen-center .body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  min-height: 0;
}

.headline {
  font-family: "Baloo 2", sans-serif;
  font-size: 29px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 10px;
  line-height: 1.22;
}
.subtext {
  font-family: Karla, sans-serif;
  font-size: 15.5px;
  color: var(--muted);
  margin: 0;
  line-height: 1.55;
}
.proof-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(111, 143, 118, 0.14);
  color: #4E6555;
  font-family: Karla, sans-serif;
  font-size: 12.5px;
  font-weight: 600;
}

.btn-primary {
  width: 100%;
  padding: 18px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--input-bg);
  font-family: Karla, sans-serif;
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 10px 24px -8px rgba(193, 96, 47, 0.5);
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.btn-primary:hover { opacity: 0.92; transform: translateY(-1px); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary.btn-plain {
  box-shadow: none;
  font-size: 15px;
  padding: 16px;
}

.notice-heading {
  font-family: "Baloo 2", sans-serif;
  font-size: 23px;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
}
.notice-body {
  font-family: Karla, sans-serif;
  font-size: 15px;
  color: var(--muted);
  margin: 0;
  max-width: 270px;
  line-height: 1.55;
}

/* Transition */
.screen-transition {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  cursor: pointer;
  min-height: 0;
  animation: fadeUp 0.3s ease both;
}
.screen-transition .transition-label {
  font-family: Karla, sans-serif;
  font-size: 15px;
  color: var(--muted);
}

/* Question / names / final top row */
.top-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(env(safe-area-inset-top, 0px) + 18px) 22px 14px;
  flex-shrink: 0;
}
.back-btn {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--muted);
}
.back-btn:hover { background: rgba(43, 38, 33, 0.06); }

.progress-track {
  flex: 1;
  height: 5px;
  border-radius: 999px;
  background: rgba(43, 38, 33, 0.1);
  position: relative;
}
.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  position: relative;
  transition: width 0.35s ease;
}
.progress-leaf {
  position: absolute;
  right: -7px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent2);
  animation: leafBob 1.8s ease-in-out infinite;
}

.end-now {
  font-family: Karla, sans-serif;
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.end-now:hover { color: var(--ink); }

.q-body {
  flex: 1;
  overflow-y: auto;
  padding: 6px 24px 20px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  box-sizing: border-box;
}
.q-body.step-enter { animation: fadeUp 0.28s ease both; }
.section-label {
  font-family: Karla, sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.q-title {
  font-family: "Baloo 2", sans-serif;
  font-size: 23px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 6px;
  line-height: 1.28;
}
.q-sub {
  font-family: Karla, sans-serif;
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 4px;
  line-height: 1.5;
}

.options-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}
.option-tile {
  font-family: Karla, sans-serif;
  font-size: 16px;
  cursor: pointer;
  position: relative;
  box-sizing: border-box;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.option-tile svg { flex-shrink: 0; }
.option-tile:hover { transform: translateY(-2px); }
.option-tile:active { transform: scale(0.97); }

.other-reveal {
  flex: 0 0 100%;
  display: flex;
  gap: 10px;
  align-items: center;
  animation: fadeUp 0.2s ease both;
}
.other-input {
  flex: 1;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1.5px solid rgba(43, 38, 33, 0.18);
  font-family: Karla, sans-serif;
  font-size: 15px;
  background: var(--input-bg);
  color: var(--ink);
  outline: none;
  width: 100%;
}

.footer-multi {
  padding: 12px 24px 30px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
  box-sizing: border-box;
}
.footer-single {
  padding: 6px 24px 30px;
  text-align: center;
  flex-shrink: 0;
  box-sizing: border-box;
}
.skip-link {
  font-family: Karla, sans-serif;
  color: var(--muted);
  text-align: center;
}
.footer-multi .skip-link { font-size: 13px; }
.footer-single .skip-link { font-size: 13.5px; }

/* Names screen */
.names-heading {
  font-family: "Baloo 2", sans-serif;
  font-size: 23px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 8px;
}
.names-sub {
  font-family: Karla, sans-serif;
  font-size: 14.5px;
  color: var(--muted);
  margin: 0 0 22px;
  line-height: 1.5;
}
.names-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.text-field {
  padding: 16px 18px;
  border-radius: 14px;
  border: 1.5px solid rgba(43, 38, 33, 0.16);
  font-family: Karla, sans-serif;
  font-size: 16px;
  background: var(--input-bg);
  color: var(--ink);
  outline: none;
  width: 100%;
  transition: border-color 0.15s ease;
}
.text-field.input-error {
  border-color: #B3423A;
  background: rgba(179, 66, 58, 0.05);
}
.text-field.shake { animation: shake 0.4s ease; }
.field-group { display: flex; flex-direction: column; gap: 6px; }
.field-error {
  font-family: Karla, sans-serif;
  font-size: 12.5px;
  color: #B3423A;
  min-height: 15px;
  padding-left: 4px;
}
.names-footer { padding: 12px 24px 30px; flex-shrink: 0; box-sizing: border-box; }

/* Final ask screen */
.final-label {
  font-family: Karla, sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.final-heading {
  font-family: "Baloo 2", sans-serif;
  font-size: 23px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 8px;
  line-height: 1.28;
}
.final-sub {
  font-family: Karla, sans-serif;
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 18px;
  line-height: 1.5;
}
.final-textarea {
  width: 100%;
  min-height: 90px;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1.5px solid rgba(43, 38, 33, 0.16);
  font-family: Karla, sans-serif;
  font-size: 15px;
  background: var(--input-bg);
  color: var(--ink);
  outline: none;
  resize: none;
}
.final-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.final-chip {
  padding: 9px 14px;
  border-radius: 999px;
  border: 1.5px solid rgba(43, 38, 33, 0.16);
  font-family: Karla, sans-serif;
  font-size: 13px;
  color: var(--ink);
  background: var(--input-bg);
}
.final-chip:hover { border-color: var(--accent); color: var(--accent); }
.final-footer { padding: 12px 24px 30px; flex-shrink: 0; box-sizing: border-box; }

/* End screen */
.screen-end {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px 30px 40px;
  box-sizing: border-box;
  gap: 16px;
  min-height: 0;
  animation: popIn 0.35s ease both;
}
.end-heading {
  font-family: "Baloo 2", sans-serif;
  font-size: 24px;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
}
.end-body {
  font-family: Karla, sans-serif;
  font-size: 15px;
  color: var(--muted);
  margin: 0;
  max-width: 270px;
  line-height: 1.55;
}
.restart-link {
  font-family: Karla, sans-serif;
  font-size: 13px;
  color: var(--muted);
  text-decoration: underline;
  margin-top: 8px;
}

/* Category-complete "nice one" overlay */
.nice-one {
  position: absolute;
  inset: 0;
  background: var(--card-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  cursor: pointer;
  animation: popIn 0.25s ease both;
}
.nice-one-label {
  font-family: "Baloo 2", sans-serif;
  font-size: 19px;
  font-weight: 600;
  color: var(--ink);
}
