/* World's Easiest Farm whitelist. The clay / playdough tokens are copied from
   web/src/styles.css rather than imported: this is a separate deployment on its
   own origin. If a token changes there, change it here too. */

:root {
  --bg: #fff1dc;
  --ink: #2b1d3a;
  --ink-soft: #6b5a7d;
  --cream: #fff8ec;
  --pink: #ff6fb5;
  --blue: #4cc9f0;
  --yellow: #ffd23f;
  --purple: #9b5de5;
  --green: #1fdc6a;
  --mint: #3ddc84;
  --line: rgba(43, 29, 58, 0.12);
  --font: 'Fredoka', ui-rounded, 'SF Pro Rounded', system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: var(--purple); }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 4px solid var(--purple); outline-offset: 3px; }
[hidden] { display: none !important; }
.tnum { font-variant-numeric: tabular-nums; }

/* ── clay ─────────────────────────────────────────────────────────── */

.clay, .btn {
  --c: var(--cream);
  background: var(--c);
  box-shadow:
    inset -5px -7px 0 rgba(0, 0, 0, 0.12),
    inset 5px 6px 0 rgba(255, 255, 255, 0.55),
    0 7px 0 rgba(43, 29, 58, 0.14),
    0 14px 26px rgba(43, 29, 58, 0.14);
}

/* ── animated background ─────────────────────────────────────────── */

.blobs { position: fixed; inset: 0; overflow: hidden; z-index: -1; pointer-events: none; }
.blobs span {
  position: absolute; width: 46vmax; height: 46vmax; border-radius: 50%;
  filter: blur(60px); opacity: 0.5;
  animation: drift 24s ease-in-out infinite alternate;
}
.blobs span:nth-child(1) { background: var(--pink); top: -15%; left: -10%; }
.blobs span:nth-child(2) { background: var(--blue); top: 40%; left: 60%; animation-duration: 28s; animation-delay: -6s; }
.blobs span:nth-child(3) { background: var(--yellow); top: 55%; left: -15%; animation-duration: 32s; animation-delay: -12s; }
.blobs span:nth-child(4) { background: var(--purple); top: -20%; left: 55%; animation-duration: 26s; opacity: .32; }
.blobs span:nth-child(5) { background: var(--mint); top: 72%; left: 35%; animation-duration: 30s; animation-delay: -9s; opacity: .38; }
@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(6vw, 8vh) scale(1.12); }
  100% { transform: translate(-4vw, -6vh) scale(0.94); }
}

/* ── header ──────────────────────────────────────────────────────── */

.top { display: flex; align-items: center; gap: 12px; padding: 18px 24px 6px; max-width: 980px; width: 100%; margin: 0 auto; }
.top__spacer { flex: 1; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand__mark { filter: drop-shadow(0 3px 0 rgba(43,29,58,.18)); }
.brand__word { display: flex; flex-direction: column; line-height: 1.05; }
.brand__name { font-weight: 700; font-size: 1.25rem; letter-spacing: .01em; }
.brand__name i {
  font-style: normal; color: var(--c);
  -webkit-text-stroke: 1.5px var(--ink); paint-order: stroke fill; text-shadow: 0 2px 0 var(--ink);
}
.brand__tag { font-size: .8rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .12em; }
.chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 8px 14px; font-weight: 600; }
.chip b { font-size: 1.05rem; }
#topScore { --c: var(--yellow); }
#topUser { --c: #fff; }
.chip__av { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--ink); }

/* ── progress spine ──────────────────────────────────────────────── */

.prog { padding: 8px 24px; max-width: 980px; width: 100%; margin: 0 auto; }
.prog__in { display: flex; gap: 8px; }
.prog__step {
  flex: 1; display: flex; align-items: center; gap: 8px; justify-content: center;
  padding: 8px 6px; border-radius: 999px; background: rgba(255,255,255,.55);
  font-weight: 600; font-size: .9rem; color: var(--ink-soft);
}
.prog__step:disabled { opacity: .55; }
.prog__n {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: #fff; border: 2px solid var(--ink); font-size: .8rem; color: var(--ink); flex: none;
}
.prog__n svg { width: 14px; height: 14px; }
.prog__step.is-on { background: var(--purple); color: #fff; box-shadow: 0 4px 0 rgba(43,29,58,.18); }
.prog__step.is-done .prog__n { background: var(--green); }

/* ── screens ─────────────────────────────────────────────────────────
   Every screen is the same four bands: a title block with a minimum height,
   a body that grows, a status line that is always present, and an action bar.
   The min-heights are load bearing: they stop the layout jumping. */

.wrap { flex: 1; width: 100%; max-width: 980px; margin: 0 auto; padding: 12px 24px 24px; }
.screen {
  border-radius: 36px; padding: 32px 36px 24px;
  display: flex; flex-direction: column; min-height: 560px;
  animation: pop-in .35s cubic-bezier(.3, 1.5, .5, 1);
}
.screen.is-leaving { animation: pop-out .15s ease-in forwards; }
@keyframes pop-in { from { transform: scale(.96) translateY(10px); opacity: 0; } }
@keyframes pop-out { to { transform: scale(.97); opacity: 0; } }
.screen__top { min-height: 150px; }
.screen__body { flex: 1; display: flex; flex-direction: column; gap: 16px; }
.eyebrow { margin: 0 0 6px; font-size: .82rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--purple); }
h1, h2 { margin: 0 0 10px; font-weight: 700; line-height: 1.08; }
h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
.hl { color: var(--pink); -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; text-shadow: 0 3px 0 var(--ink); }
.lede { margin: 0 0 8px; font-size: 1.08rem; line-height: 1.5; color: var(--ink-soft); max-width: 40rem; }
.hint { margin: 0; font-size: .92rem; color: var(--ink-soft); line-height: 1.45; }
.hint.is-bad { color: #d6336c; }
.msg { min-height: 1.6em; margin: 12px 0 4px; font-weight: 600; color: var(--ink-soft); }
.msg.is-bad { color: #d6336c; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.actions { min-height: 64px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; border-top: 2px dashed var(--line); padding-top: 14px; }
.actions--bare { border-top: 0; }
.actions__note { color: var(--ink-soft); font-size: .92rem; }

/* ── buttons ─────────────────────────────────────────────────────── */

.btn {
  --c: var(--purple);
  color: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 999px; padding: 12px 24px; font-weight: 600; font-size: 1rem; text-decoration: none;
  transition: transform .16s cubic-bezier(.3, 1.6, .5, 1), box-shadow .16s;
}
.btn:not(:disabled):not(.is-off):hover { transform: translateY(-2px) scale(1.02); }
.btn:not(:disabled):not(.is-off):active { transform: translateY(3px) scale(.97); }
.btn:disabled, .btn.is-off { filter: grayscale(.5); opacity: .55; pointer-events: none; }
.btn--dark { --c: var(--ink); }
.btn--pink { --c: var(--pink); }
.btn--quiet { --c: #fff; color: var(--ink); }
.btn--sm { padding: 8px 16px; font-size: .9rem; }
.btn--lg { padding: 16px 30px; font-size: 1.15rem; }
.btn--wide { width: 100%; }
.btn.is-owned { --c: var(--green); opacity: 1; filter: none; }
.linkbtn { color: var(--purple); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; padding: 4px 0; }
.linkbtn:hover { text-decoration: underline; }

/* ── status pills ────────────────────────────────────────────────── */

.status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-weight: 600; font-size: .85rem; background: #fff; border: 2px solid var(--ink); }
.status__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-soft); }
.status--done .status__dot { background: var(--green); }
.status--soon .status__dot { background: var(--yellow); }

/* ── missions ────────────────────────────────────────────────────── */

.missions { display: flex; flex-direction: column; gap: 10px; }
.mission {
  display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 22px; background: #fff; border: 2px solid var(--line);
}
.mission > .field, .mission > .hint { grid-column: 2 / -1; }
.mission__ico { width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center; color: #fff; border: 2px solid var(--ink); box-shadow: 0 3px 0 rgba(43,29,58,.2); }
.mission__ico svg { width: 20px; height: 20px; }
.mission__t { font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mission__req { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; padding: 2px 8px; border-radius: 999px; background: #ffe0ef; color: #c2185b; }
.pts { font-weight: 700; color: var(--purple); }
.mission__actions { display: flex; gap: 8px; }
.mission__state { font-size: .82rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: #d8fbe4; color: #137a3c; }
.mission__state.is-bad { background: #ffe0e6; color: #c2185b; }
.mission.is-approved, .mission.is-review { background: #f2fff6; border-color: #b9f0cb; }
.mission.is-waiting { opacity: .7; }

/* ── inputs ──────────────────────────────────────────────────────── */

.field { display: flex; gap: 8px; align-items: center; }
.field input, .reflink input {
  flex: 1; min-width: 0; font: inherit; padding: 11px 16px; border-radius: 999px;
  border: 2px solid var(--ink); background: #fff; color: var(--ink);
}
[data-mono], .reflink input { font-family: var(--mono); font-size: .9rem; }

/* ── wallet ──────────────────────────────────────────────────────── */

.wallet { display: flex; flex-direction: column; gap: 14px; }
.wallet__addr { font-family: var(--mono); font-size: 1rem; word-break: break-all; margin: 6px 0; padding: 12px 16px; background: #fff; border-radius: 18px; border: 2px dashed var(--line); }

/* ── boost ───────────────────────────────────────────────────────── */

.boosts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.boost { border-radius: 26px; padding: 18px 20px; display: flex; flex-direction: column; gap: 2px; }
.boost--pink { --c: #ffd6ec; }
.boost--green { --c: #c7f9cc; }
.boost__x { font-size: 2rem; font-weight: 700; }
.boost__t { font-weight: 600; }
.boost__d { color: var(--ink-soft); font-size: .92rem; }
.farmers { margin: 0; font-size: 1.05rem; color: var(--ink-soft); }
.farmers b { color: var(--ink); font-size: 1.25rem; }

/* ── done ────────────────────────────────────────────────────────── */

.done-banner { display: flex; align-items: center; gap: 16px; }
.done-tick { width: 64px; height: 64px; flex: none; }
.done-tick__svg { width: 100%; height: 100%; }
.done-tick__circle { stroke: var(--green); stroke-width: 4; stroke-dasharray: 145; stroke-dashoffset: 145; animation: draw .6s ease-out forwards; }
.done-tick__check { stroke: var(--ink); stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .35s .5s ease-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.share { display: grid; grid-template-columns: 1fr 1.15fr; gap: 24px; align-items: start; }
.share__left { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.reflink { display: flex; gap: 8px; width: 100%; }
.reftally { --c: var(--yellow); display: flex; align-items: baseline; gap: 10px; padding: 12px 18px; border-radius: 22px; }
.reftally__n { font-size: 2rem; font-weight: 700; }
.reftally__k { font-weight: 600; }
.cardprev { --c: #fff; border-radius: 22px; padding: 8px; }
.cardprev img { display: block; width: 100%; aspect-ratio: 1200 / 630; border-radius: 16px; background: #eaf7ff; }
.share__card .hint { margin-top: 8px; text-align: center; }

/* ── dialogs ─────────────────────────────────────────────────────── */

dialog { border: 0; color: var(--ink); padding: 0; }
dialog::backdrop { background: rgba(43, 29, 58, .4); }
.sheet { --c: var(--cream); border-radius: 30px; padding: 22px; width: min(400px, calc(100vw - 32px)); }
.sheet__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.sheet__head h3 { margin: 0; }
.sheet__close { font-size: 1.6rem; line-height: 1; color: var(--ink-soft); }
.wallets { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.wallet-opt { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 999px; background: #fff; border: 2px solid var(--line); font-weight: 600; text-align: left; }
.wallet-opt:hover { border-color: var(--purple); }
.wallet-opt__icon { border-radius: 8px; }
.wallet-opt__letter { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--purple); color: #fff; }
.wallet-opt__name { flex: 1; }
.wallet-opt__tag { font-size: .75rem; padding: 3px 8px; border-radius: 999px; background: #efe9f7; color: var(--ink-soft); }

.opened { --c: var(--cream); border-radius: 34px; padding: 28px; width: min(440px, calc(100vw - 32px)); text-align: center; }
.opened__h { margin: 4px 0 8px; }
.opened__facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0; }
.opened__facts div { background: #fff; border-radius: 18px; padding: 10px; border: 2px solid var(--line); }
.opened__facts dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); }
.opened__facts dd { margin: 2px 0 0; font-weight: 700; font-size: 1.2rem; }
.opened__tx { display: block; margin-bottom: 14px; font-weight: 600; }

/* ── test bar, footer, invite page ───────────────────────────────── */

.devbar { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; padding: 8px 16px; background: var(--ink); color: #fff; font-size: .9rem; }
.devbar .btn--quiet { color: var(--ink); }
.foot { text-align: center; padding: 10px 16px 22px; color: var(--ink-soft); font-size: .9rem; }

.invite { flex: 1; display: grid; place-items: center; padding: 24px 16px; }
.invite__card { --c: var(--cream); border-radius: 36px; padding: 34px; max-width: 560px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.invite__logo { filter: drop-shadow(0 4px 0 rgba(43,29,58,.18)); }
.invite__h { font-size: clamp(1.8rem, 5vw, 2.5rem); margin: 0; }

.confetti-canvas { position: fixed; inset: 0; pointer-events: none; z-index: 50; }

/* ── small screens ───────────────────────────────────────────────── */

@media (max-width: 700px) {
  .top { padding: 14px 16px 4px; }
  .brand__name { font-size: .9rem; max-width: 120px; line-height: 1.1; }
  .brand__tag { display: none; }
  .brand__mark { width: 40px; height: 40px; }
  .prog { padding: 6px 16px; }
  .prog__lbl { display: none; }
  .wrap { padding: 10px 16px 20px; }
  .screen { padding: 24px 20px 18px; border-radius: 28px; min-height: 0; }
  .screen__top, .actions, .msg { min-height: 0; }
  .boosts, .share { grid-template-columns: 1fr; }
  .mission { grid-template-columns: auto 1fr auto; }
  .mission__actions, .mission__state { grid-column: 2 / -1; justify-self: start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .done-tick__circle, .done-tick__check { stroke-dashoffset: 0; }
}
