/* One Seed — design tokens: warm soil, moss and late-afternoon light */
:root {
  --bg: #f3e7d0;
  --bg-2: #eadabb;
  --surface: #fffaf0;
  --surface-2: #f8efdc;
  --line: #dcc8a5;
  --ink: #2c2117;
  --ink-2: #5f4c38;
  --ink-3: #7d6851;
  --moss-800: #2f4d1f;
  --moss-600: #4f7a2b;
  --moss-400: #7fae45;
  --leaf: #a6d45f;
  --soil-900: #3a2618;
  --soil-700: #6b4529;
  --soil-500: #8f6340;
  --soil-300: #b98a5c;
  --soil-hi: #c99b6a;
  --clay: #b8552c;
  --clay-ink: #fff6ec;
  --sun: #e8a23a;
  --water: #3f8f9c;
  --water-hi: #79c3c9;
  --shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 10px 30px -12px rgba(70,40,15,.35);
  --shadow-sm: 0 4px 14px -8px rgba(70,40,15,.45);

  --font-ui: ui-rounded, "SF Pro Rounded", "Nunito", "Varela Round", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-num: ui-rounded, "SF Pro Rounded", system-ui, sans-serif;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  --r-s: 10px; --r-m: 16px; --r-l: 24px; --r-pill: 999px;
  --tap: 44px;
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16120d;
    --bg-2: #1e1811;
    --surface: #241c14;
    --surface-2: #2c2219;
    --line: #463627;
    --ink: #f5ead6;
    --ink-2: #d7c3a5;
    --ink-3: #b49c7d;
    --moss-800: #cfe6a8;
    --moss-600: #9fce63;
    --soil-hi: #8a6340;
    --soil-300: #7a5536;
    --soil-500: #61422a;
    --soil-700: #4a311e;
    --clay: #d06a3c;
    --shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 12px 34px -14px rgba(0,0,0,.7);
    --shadow-sm: 0 4px 14px -8px rgba(0,0,0,.7);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(232,162,58,.18), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(79,122,43,.14), transparent 60%),
    var(--bg);
  min-height: 100vh;
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; color: inherit; }
h1, h2, p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; border-radius: 8px; }

/* ---------- loading / error ---------- */
.splash {
  position: fixed; inset: 0; z-index: 50; display: grid; place-content: center; justify-items: center; gap: var(--s3);
  background: var(--bg); color: var(--ink-2); transition: opacity .4s var(--ease-out), visibility .4s;
}
.splash-sprout { width: 72px; height: 72px; transform-origin: 50% 92%; animation: sprout-grow 1.2s var(--ease-spring) infinite alternate; }
body:not(.is-loading) .splash { opacity: 0; visibility: hidden; pointer-events: none; }
@keyframes sprout-grow { from { transform: scale(.5); } to { transform: scale(1); } }
.error-panel {
  position: fixed; inset: 0; z-index: 60; display: grid; place-content: center; justify-items: center; gap: var(--s3);
  padding: var(--s5); text-align: center; background: var(--bg);
}
.error-panel[hidden] { display: none; }
.error-panel svg { width: 72px; height: 72px; }
.error-panel h2 { font-family: var(--font-display); font-size: 1.6rem; }
.error-panel p { max-width: 34ch; color: var(--ink-2); }
.noscript { padding: var(--s5); text-align: center; }

/* ---------- buttons ---------- */
.btn {
  min-height: var(--tap); padding: 0 var(--s5); border: 0; border-radius: var(--r-pill); cursor: pointer;
  font-weight: 700; font-size: 1rem; display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  transition: transform .18s var(--ease-spring), box-shadow .2s, background-color .2s, opacity .2s;
}
.btn:active { transform: scale(.96); }
.btn-primary { background: var(--moss-600); color: #fbfff2; box-shadow: 0 6px 18px -8px rgba(47,77,31,.8); }
.btn-primary:hover { background: #456c25; }
@media (prefers-color-scheme: dark) { .btn-primary { background: #4d7a26; } .btn-primary:hover { background: #5a8a2e; } }
.btn-clay { background: #a54c26; color: var(--clay-ink); box-shadow: 0 6px 18px -8px rgba(150,60,20,.8); }
.btn-clay:hover { filter: brightness(1.06); }
.btn-ghost { background: transparent; color: var(--ink-2); border: 2px solid var(--line); }
.btn-ghost small { font-weight: 500; color: var(--ink-3); }
.btn-big { min-height: 56px; font-size: 1.15rem; padding: 0 var(--s6) 0 var(--s5); }
.btn-big svg { width: 34px; height: 34px; margin-bottom: 4px; }
.icon-btn {
  width: var(--tap); height: var(--tap); border-radius: 50%; border: 2px solid var(--line); background: var(--surface);
  font-weight: 800; font-size: 1.1rem; cursor: pointer; color: var(--ink-2); transition: transform .18s var(--ease-spring);
}
.icon-btn:active { transform: scale(.92); }

/* ---------- top ---------- */
.topbar {
  max-width: 1120px; margin: 0 auto; padding: var(--s4) var(--s4) var(--s2);
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
}
.brand { display: flex; align-items: center; gap: var(--s3); }
.brand-mark { width: 40px; height: 40px; filter: drop-shadow(0 3px 4px rgba(60,40,10,.25)); }
.brand-name { font-family: var(--font-display); font-size: 1.55rem; font-weight: 700; letter-spacing: -.01em; line-height: 1.1; }
.day-no { font-family: var(--font-num); font-size: .9rem; font-weight: 800; color: var(--clay-ink); background: var(--soil-700); padding: 2px 9px; border-radius: var(--r-pill); vertical-align: 4px; }
@media (prefers-color-scheme: dark) { .day-no { background: #9a4c2b; } }
.brand-sub { font-size: .85rem; color: var(--ink-3); }
.help { max-width: 1120px; margin: 0 auto var(--s3); padding: 0 var(--s4); animation: rise .35s var(--ease-out); }
.help ul { margin: 0; padding: var(--s4) var(--s5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); box-shadow: var(--shadow-sm); display: grid; gap: var(--s2); }
.help li { color: var(--ink-2); }
.help b { color: var(--ink); }

/* ---------- layout ---------- */
.layout {
  max-width: 1120px; margin: 0 auto; padding: 0 var(--s4) var(--s5);
  display: grid; grid-template-columns: minmax(0, 600px) minmax(0, 1fr); gap: var(--s5); align-items: start;
}
/* on short desktop screens the play column shrinks so the start button stays above the fold */
@media (min-width: 861px) {
  .layout { grid-template-columns: minmax(0, min(600px, max(420px, calc(100vh - 360px)))) minmax(0, 1fr); }
}
.play { display: grid; gap: var(--s3); position: relative; min-width: 0; }
.side { display: grid; gap: var(--s4); min-width: 0; }
.tagline { font-family: var(--font-display); font-size: 1.3rem; line-height: 1.3; color: var(--ink); max-width: 40ch; }
body.is-started .tagline { display: none; }

/* ---------- HUD ---------- */
.hud {
  display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: var(--s4);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: var(--s3) var(--s4); box-shadow: var(--shadow);
}
.hud-leaves { display: flex; align-items: center; gap: var(--s2); min-width: 0; }
.hud-leaf { width: 38px; height: 38px; flex: none; transition: transform .25s var(--ease-spring); }
.hud-leaf.bump { transform: rotate(-14deg) scale(1.18); }
.leaves { font-family: var(--font-num); font-weight: 800; font-size: 2rem; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; min-width: 4.2ch; transition: transform .2s var(--ease-spring), color .2s; }
.leaves.bump { transform: scale(1.12); }
.leaves.spend { color: var(--clay); }
.rate { font-size: .85rem; font-weight: 700; color: var(--moss-600); font-variant-numeric: tabular-nums; }
.hud-clock { position: relative; width: 64px; height: 64px; }
.clock-ring { width: 64px; height: 64px; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--bg-2); stroke-width: 4; }
.ring-fg { fill: none; stroke: var(--sun); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 119.38; stroke-dashoffset: 0; transition: stroke .3s; }
.clock-text { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.05; }
.clock-text span { font-weight: 800; font-variant-numeric: tabular-nums; font-size: .98rem; }
.clock-text small { font-size: .62rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.hud.paused .clock-text small { color: var(--clay); }
.hud-total { min-width: 0; }
.total-row { display: flex; justify-content: space-between; gap: var(--s2); font-size: .82rem; color: var(--ink-3); font-weight: 600; margin-bottom: 6px; }
.total-row b { color: var(--ink); font-variant-numeric: tabular-nums; }
.logbar { position: relative; height: 10px; border-radius: var(--r-pill); background: var(--bg-2); margin-bottom: 16px; }
.logbar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--moss-400), var(--leaf) 60%, var(--sun)); transition: width .4s var(--ease-out); }
.logbar span { position: absolute; top: 13px; transform: translateX(-50%); font-size: .62rem; font-weight: 700; color: var(--ink-3); }
.logbar span:first-of-type { transform: none; }
.logbar span:last-of-type { transform: translateX(-100%); }
.logbar-lg { height: 14px; margin: var(--s3) 0 22px; }

.effects { display: flex; flex-wrap: wrap; gap: var(--s2); min-height: 0; }
.effects:empty { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--r-pill);
  font-size: .85rem; font-weight: 700; background: var(--surface); border: 1px solid var(--line); animation: pop-in .35s var(--ease-spring);
}
.chip svg { width: 16px; height: 16px; }
.chip-rain { background: #dcf0f2; color: #1d5961; border-color: #a9d5da; }
.chip-drought { background: #fbe7c4; color: #7a4a0c; border-color: #f0c983; }
@media (prefers-color-scheme: dark) {
  .chip-rain { background: #183538; color: #bfe9ee; border-color: #2b5a60; }
  .chip-drought { background: #3d2a10; color: #f6d39a; border-color: #6b4a1c; }
}

/* ---------- garden bed ---------- */
.bed-wrap { position: relative; }
.bed {
  position: relative; overflow: hidden; border-radius: var(--r-l); padding: 10px;
  background: linear-gradient(160deg, #8a5a35, #6a4227 60%, #5a3820);
  box-shadow: 0 2px 0 rgba(255,255,255,.2) inset, 0 -3px 0 rgba(0,0,0,.25) inset, 0 18px 40px -18px rgba(60,30,10,.6);
}
.grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 3px; position: relative; z-index: 1; }
.cell {
  position: relative; aspect-ratio: 1; min-width: 0; padding: 0; border: 0; cursor: pointer; border-radius: 8px;
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,.14) 0 2px, transparent 3px),
    radial-gradient(circle at 70% 65%, rgba(0,0,0,.12) 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 45% 80%, rgba(255,255,255,.08) 0 1.5px, transparent 2.5px),
    linear-gradient(180deg, var(--soil-hi), var(--soil-300));
  box-shadow: 0 -2px 0 rgba(0,0,0,.18) inset, 0 1px 0 rgba(255,255,255,.18) inset;
  transition: transform .15s var(--ease-spring), filter .2s;
  overflow: visible;
}
.cell:hover:not(.rock) { filter: brightness(1.08); }
.cell:active:not(.rock) { transform: scale(.94); }
.cell.water {
  background:
    linear-gradient(115deg, transparent 30%, rgba(255,255,255,.28) 45%, transparent 60%) 0 0 / 300% 100%,
    linear-gradient(180deg, var(--water-hi), var(--water));
  animation: shimmer 4.5s linear infinite;
}
.cell.water::before { content: '×2'; position: absolute; right: 4px; top: 2px; font-size: .62rem; font-weight: 800; color: rgba(255,255,255,.9); z-index: 2; }
@keyframes shimmer { from { background-position: 150% 0, 0 0; } to { background-position: -150% 0, 0 0; } }
.cell.rock { cursor: default; background: linear-gradient(180deg, #a98260, #8a6646); }
@media (prefers-color-scheme: dark) { .cell.rock { background: linear-gradient(180deg, #6a4e36, #553d29); } }
.cell .plant { position: absolute; left: 6%; top: 4%; width: 88%; height: 88%; transform-origin: 50% 92%; pointer-events: none; }
.cell.k1 .plant, .cell.k2 .plant, .cell.k3 .plant { animation: sway 4.2s ease-in-out infinite; animation-delay: var(--d, 0s); }
.cell.k4 .plant { left: -6%; top: -14%; width: 112%; height: 112%; filter: drop-shadow(0 0 6px rgba(242,196,90,.45)); }
.cell.pop .plant { animation: grow-pop .6s var(--ease-spring) both, sway 4.2s ease-in-out .6s infinite; }
.cell.k4.pop .plant { animation: ancient-pop .9s var(--ease-spring) both; }
@keyframes sway { 0%, 100% { transform: rotate(-2.5deg); } 50% { transform: rotate(2.5deg); } }
@keyframes grow-pop { 0% { transform: scale(.2); opacity: .2; } 60% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); } }
@keyframes ancient-pop { 0% { transform: scale(.4) rotate(-8deg); } 55% { transform: scale(1.22) rotate(3deg); } 100% { transform: scale(1); } }
.cell .gbar { position: absolute; left: 14%; right: 14%; bottom: 7%; height: 4px; border-radius: 4px; background: rgba(40,20,5,.35); overflow: hidden; pointer-events: none; opacity: 0; transition: opacity .3s; }
.cell.k1 .gbar, .cell.k2 .gbar { opacity: 1; }
.cell .gbar i { display: block; height: 100%; width: 100%; background: #d9f28f; transform-origin: 0 50%; transform: scaleX(0); }
.cell.k2 .gbar i { background: #9ee06a; }
.cell.start { box-shadow: 0 0 0 3px var(--sun), 0 0 22px 4px rgba(232,162,58,.75); animation: start-glow 1.4s ease-in-out infinite; z-index: 2; }
.cell.start::after { content: ''; position: absolute; left: 50%; top: 50%; width: 22%; height: 22%; border-radius: 50%; background: #5b3a1f; transform: translate(-50%, -30%); box-shadow: 0 0 0 4px rgba(255,236,190,.55); }
@keyframes start-glow { 50% { box-shadow: 0 0 0 3px var(--sun), 0 0 34px 10px rgba(232,162,58,.55); } }
.cell.nope, .up.nope { animation: nope .35s ease; }
.cell.k0 .plant { display: none; }
@keyframes nope { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.cell.merge { animation: merge-flash .7s ease; }
@keyframes merge-flash { 0% { filter: brightness(1.8) saturate(1.4); } 100% { filter: none; } }
.cell .gift { position: absolute; left: 50%; top: 0; font-size: 16px; pointer-events: none; animation: gift-drop .9s var(--ease-out) forwards; z-index: 3; }
@keyframes gift-drop { 0% { transform: translate(-50%, -140%) scale(.6); opacity: 0; } 40% { opacity: 1; } 100% { transform: translate(-50%, 10%) scale(1); opacity: 0; } }
.cell.ghost .plant { opacity: .9; }

/* weather on the bed */
.bed::before, .bed::after { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .8s; z-index: 2; }
.bed::before {
  background: repeating-linear-gradient(105deg, transparent 0 14px, rgba(200,232,255,.5) 14px 15.5px, transparent 15.5px 34px);
  background-size: 200% 200%; animation: rain 0.7s linear infinite;
}
.bed::after { background: radial-gradient(circle at 80% 10%, rgba(255,190,80,.55), rgba(255,140,40,.15) 50%, transparent 75%); animation: heat 2.4s ease-in-out infinite; }
.bed.raining::before { opacity: 1; }
.bed.drought::after { opacity: 1; }
@keyframes rain { from { background-position: 0 0; } to { background-position: -34px 120px; } }
@keyframes heat { 50% { filter: brightness(1.2); } }

.fx { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.float {
  position: absolute; transform: translate(-50%, 0); font-weight: 800; font-size: .82rem; color: #f6ffd8; white-space: nowrap;
  text-shadow: 0 1px 0 rgba(30,40,10,.8), 0 0 6px rgba(30,40,10,.6); animation: float-up 1.1s var(--ease-out) forwards; will-change: transform, opacity;
}
.float.big { font-size: 1rem; color: #ffe9a8; }
@keyframes float-up { 0% { transform: translate(-50%, 6px) scale(.7); opacity: 0; } 20% { opacity: 1; transform: translate(-50%, -6px) scale(1.08); } 100% { transform: translate(-50%, -34px) scale(1); opacity: 0; } }
.wind-leaf { position: absolute; width: 18px; height: 18px; animation: blow 1.6s var(--ease-out) forwards; }
@keyframes blow { from { transform: translate(-40px, 0) rotate(0); opacity: 0; } 20% { opacity: 1; } to { transform: translate(420px, -60px) rotate(540deg); opacity: 0; } }

.weather-call {
  position: absolute; left: 50%; top: 14px; z-index: 6; transform: translateX(-50%);
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 10px; min-height: 60px; min-width: 230px;
  padding: 10px 18px 14px 12px; border: 0; border-radius: var(--r-l); cursor: pointer; text-align: left;
  background: #f4fbfc; color: #173f45; box-shadow: 0 14px 30px -10px rgba(10,40,50,.6), 0 0 0 3px rgba(255,255,255,.7);
  animation: call-in .45s var(--ease-spring), bob 1.8s ease-in-out .45s infinite;
}
.weather-call[hidden] { display: none; }
.weather-call.wind { background: #f6f3e6; color: #47391a; }
.wc-icon { font-size: 34px; line-height: 1; grid-row: span 2; }
.wc-text b { display: block; font-size: 1.02rem; }
.wc-text small { display: block; font-size: .78rem; opacity: .8; }
.wc-timer { position: absolute; left: 14px; right: 14px; bottom: 6px; height: 4px; border-radius: 4px; background: rgba(0,0,0,.1); overflow: hidden; }
.wc-timer i { display: block; height: 100%; background: currentColor; transform-origin: 0 50%; }
@keyframes call-in { from { transform: translate(-50%, -30px) scale(.7); opacity: 0; } }
@keyframes bob { 50% { transform: translate(-50%, -5px); } }

.startbar { display: grid; justify-items: center; gap: var(--s2); text-align: center; animation: rise .5s var(--ease-out) .1s both; }
.startbar-hint { font-size: .85rem; color: var(--ink-3); }
body.is-started .startbar { display: none; }
.example {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s4); align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: var(--s4); box-shadow: var(--shadow-sm);
  animation: rise .5s var(--ease-out) .2s both;
}
.example h2 { font-family: var(--font-display); font-size: 1.15rem; margin: 2px 0 6px; }
.example-text p:last-child { font-size: .88rem; color: var(--ink-2); }
.share-card-sm { font-size: 11.5px; line-height: 1.3; padding: var(--s3); animation: none; transform: rotate(1.5deg); box-shadow: var(--shadow-sm); }
body.is-started .example { display: none; }
@media (max-width: 520px) {
  .example { grid-template-columns: 1fr; margin: 0 var(--s1); padding: var(--s3); border-radius: var(--r-m); }
  .share-card-sm { justify-self: center; transform: none; }
}
.seedbar { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); color: var(--ink-3); font-size: .88rem; font-weight: 600; }
.seedbar[hidden] { display: none; }
.chip-seed b { font-variant-numeric: tabular-nums; }
.toast-zone { position: absolute; left: 0; right: 0; bottom: 40px; display: grid; justify-items: center; gap: 6px; pointer-events: none; z-index: 10; }
.toast { background: var(--soil-900); color: #fff4e2; padding: 9px 16px; border-radius: var(--r-pill); font-size: .88rem; font-weight: 700; box-shadow: var(--shadow-sm); animation: toast 2.4s var(--ease-out) forwards; max-width: 92%; text-align: center; }
@media (prefers-color-scheme: dark) { .toast { background: #f1e3c8; color: #2a1d10; } }
@keyframes toast { 0% { transform: translateY(10px); opacity: 0; } 12%, 80% { transform: none; opacity: 1; } 100% { transform: translateY(-6px); opacity: 0; } }

/* ---------- side panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: var(--s4); box-shadow: var(--shadow); animation: rise .45s var(--ease-out) both; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s2); margin-bottom: var(--s3); }
.panel h2 { font-family: var(--font-display); font-size: 1.25rem; }
.muted { color: var(--ink-3); font-size: .8rem; }
@keyframes rise { from { transform: translateY(12px); opacity: 0; } }
@keyframes pop-in { from { transform: scale(.7); opacity: 0; } }

.track { position: relative; height: 62px; margin: 0 14px; }
.track-line { position: absolute; left: 0; right: 0; top: 40px; height: 6px; border-radius: 6px; background: var(--bg-2); overflow: hidden; }
.track-line i { position: absolute; inset: 0; background: linear-gradient(90deg, var(--moss-400), var(--sun)); transform-origin: 0 50%; transform: scaleX(0); }
.track .ev { position: absolute; top: 0; transform: translateX(-50%); display: grid; justify-items: center; gap: 1px; font-size: .68rem; font-weight: 700; color: var(--ink-3); }
.track .ev .e-ic { width: 32px; height: 32px; display: grid; place-content: center; font-size: 18px; border-radius: 50%; background: var(--surface-2); border: 2px solid var(--line); transition: transform .3s var(--ease-spring), background-color .3s, border-color .3s; }
.track .ev .e-t { margin-top: 18px; }
.track .ev.prompt .e-ic { transform: scale(1.18); border-color: var(--sun); }
.track .ev.caught .e-ic { background: #e4f3cf; border-color: var(--moss-400); }
.track .ev.missed .e-ic { opacity: .45; filter: grayscale(.8); }
@media (prefers-color-scheme: dark) { .track .ev.caught .e-ic { background: #2a3a1a; } }
.track .ev .e-mark { position: absolute; top: 22px; right: -4px; font-size: 11px; font-weight: 900; }

.up-list { display: grid; grid-template-columns: 1fr; gap: var(--s2); }
.up {
  position: relative; display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: var(--s3);
  min-height: 64px; padding: var(--s2) var(--s3); border: 1.5px solid var(--line); border-radius: var(--r-m); background: var(--surface-2);
  text-align: left; cursor: pointer; overflow: hidden; transition: transform .18s var(--ease-spring), border-color .2s, opacity .2s;
}
.up::before { content: ''; position: absolute; inset: 0; background: rgba(127,174,69,.13); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); transition: transform .3s linear; pointer-events: none; }
.up > * { position: relative; }
.up:active { transform: scale(.97); }
.up.can { border-color: var(--moss-400); }
.up.can .up-price { background: var(--moss-600); color: #fbfff2; }
.up.maxed { opacity: .65; cursor: default; }
.up.locked { opacity: .78; }
.up.bought { animation: bought .6s var(--ease-spring); }
@keyframes bought { 40% { transform: scale(1.04); border-color: var(--sun); } }
.up-ic { width: 44px; height: 44px; display: grid; place-content: center; font-size: 24px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.up-name { font-weight: 800; font-size: .95rem; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.up-desc { font-size: .8rem; color: var(--ink-2); line-height: 1.3; }
.pips { display: inline-flex; gap: 3px; }
.pips i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.pips i.on { background: var(--moss-600); }
.tag { font-size: .66rem; font-weight: 800; padding: 2px 7px; border-radius: var(--r-pill); letter-spacing: .02em; }
.tag-cheap { background: #dff0c6; color: #2f5413; }
.tag-pricey { background: #f6d9c9; color: #7a2f0c; }
.up-price { font-weight: 800; font-size: .88rem; padding: 6px 10px; border-radius: var(--r-pill); background: var(--bg-2); white-space: nowrap; font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; gap: 4px; }
.up-price svg { width: 14px; height: 14px; }

/* ---------- result ---------- */
.result { display: grid; gap: var(--s4); }
.result[hidden], .fullgame[hidden] { display: none; }
.eyebrow { font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--clay); }
.res-score { display: flex; align-items: center; gap: var(--s2); }
.res-score svg { width: 44px; height: 44px; animation: grow-pop .8s var(--ease-spring) both; }
.res-score b { font-family: var(--font-num); font-size: 3rem; font-weight: 900; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.res-sub { color: var(--ink-2); font-size: .92rem; }
.res-stats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); }
.res-stats li { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-s); padding: var(--s2) var(--s3); font-size: .82rem; color: var(--ink-3); animation: rise .4s var(--ease-out) both; }
.res-stats li b { display: block; font-size: 1.1rem; color: var(--ink); }
.card-wrap { display: grid; gap: var(--s2); }
.share-card {
  margin: 0; padding: var(--s4); border-radius: var(--r-m); background: #fdf6e6; color: #2c2117; border: 1px dashed var(--soil-300);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 15px; line-height: 1.35; white-space: pre; overflow-x: auto;
  animation: card-in .6s var(--ease-spring) .15s both;
}
@media (prefers-color-scheme: dark) { .share-card { background: #1b150f; color: #f5ead6; } }
@keyframes card-in { from { transform: translateY(16px) rotate(-1.5deg); opacity: 0; } }
.copy-note { font-size: .85rem; color: var(--moss-600); min-height: 1.2em; text-align: center; font-weight: 700; }
.next { text-align: center; color: var(--ink-2); }
.next b { font-variant-numeric: tabular-nums; }
.practice-note { text-align: center; font-size: .85rem; color: var(--ink-3); }

.fullgame { display: grid; gap: var(--s3); position: relative; overflow: hidden; background: linear-gradient(170deg, var(--surface), var(--surface-2)); }
.fg-art { position: absolute; right: -8px; top: -6px; display: flex; opacity: .9; pointer-events: none; }
.fg-art svg { width: 54px; height: 54px; }
.fg-list { margin: 0; padding: 0 0 0 1.1em; display: grid; gap: 4px; color: var(--ink-2); }
.fg-list li::marker { content: '🌱 '; }
.fg-price { font-weight: 800; color: var(--ink); }
.notify { display: grid; gap: var(--s2); padding: var(--s3); border-radius: var(--r-m); background: var(--bg-2); animation: rise .35s var(--ease-out); }
.notify p { font-size: .92rem; color: var(--ink); }
.notify .btn { text-decoration: none; justify-self: start; }

body.state-result .forecast, body.state-result .upgrades { display: none; }
body.state-result .seedbar { display: none; }
body.state-result .bed { filter: saturate(1.05); }

.foot { max-width: 1120px; margin: 0 auto; padding: var(--s3) var(--s4) var(--s6); text-align: center; font-size: .8rem; color: var(--ink-3); }

/* ---------- small screens ---------- */
@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); max-width: 620px; }
  body.state-result .side { order: -1; }
  .up-list { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .topbar { padding: var(--s3) var(--s3) var(--s1); }
  .layout { padding: 0 var(--s1) var(--s4); gap: var(--s3); }
  .tagline { font-size: 1.12rem; padding: 0 var(--s2); }
  .hud { grid-template-columns: auto auto; gap: var(--s2) var(--s3); padding: var(--s3); border-radius: var(--r-m); margin: 0 var(--s1); }
  .hud-total { grid-column: 1 / -1; }
  .hud-clock { justify-self: end; }
  .leaves { font-size: 1.8rem; }
  .bed { padding: 3px; border-radius: 14px; }
  .grid { gap: 2px; }
  .cell { border-radius: 6px; }
  .seedbar, .effects { padding: 0 var(--s2); }
  .panel { padding: var(--s3); border-radius: var(--r-m); margin: 0 var(--s1); }
  .res-score b { font-size: 2.5rem; }
  .share-card { font-size: 12.5px; padding: var(--s3); }
  .weather-call { min-width: 0; width: calc(100% - 24px); }
  .help { padding: 0 var(--s2); }
}

@media (max-width: 400px) {
  .layout { padding-left: 0; padding-right: 0; }   /* keeps each plot >= 44px wide at 375px */
  .bed { border-radius: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
