/* Creator Garden v2 — mobile-first homestead grid, Instagram-safe */

:root {
  --sky: #e7f3ee;
  --cream: #fbf6ea;
  --paper: #fffdf7;
  --soil: #4a3428;
  --soil-soft: #6b4a3a;
  --leaf: #2f6a45;
  --leaf-deep: #1f4a30;
  --moss: #7da36a;
  --sun: #e8b84a;
  --petal: #e07a5f;
  --lavender: #8d7bb8;
  --line: rgba(74, 52, 40, 0.14);
  --shadow: 0 10px 28px rgba(48, 32, 20, 0.12);
  --radius: 18px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font-display: "Fraunces", "Iowan Old Style", Palatino, Georgia, serif;
  --font-body: "Nunito", "Segoe UI", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--soil);
  background:
    radial-gradient(1200px 500px at 50% -80px, #f4e7b8 0%, transparent 60%),
    linear-gradient(180deg, #d8ecc8 0%, var(--sky) 28%, var(--cream) 100%);
  min-height: 100dvh;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}

button, a { font-family: inherit; }
img, svg { max-width: 100%; display: block; }

.wrap {
  width: min(520px, 100%);
  margin: 0 auto;
  padding: 12px 14px calc(28px + var(--safe-bottom));
}

/* ----- HUD ----- */
.hud {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 0 12px;
  background: linear-gradient(180deg, rgba(238,246,234,0.96) 70%, rgba(238,246,234,0));
  backdrop-filter: blur(8px);
}
.brand { display: flex; flex-direction: column; min-width: 0; }
.brand strong {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}
.brand span { font-size: 0.75rem; color: var(--soil-soft); }
.hud-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.seed-jar, .badge-chip, .how-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  box-shadow: var(--shadow);
  font-weight: 800;
  font-size: 0.85rem;
}
.seed-jar b, .badge-chip b { font-variant-numeric: tabular-nums; }
.how-btn { cursor: pointer; color: var(--soil); }
.how-btn:active { transform: scale(0.96); }
.seed-pop {
  position: fixed;
  z-index: 80;
  pointer-events: none;
  font-weight: 800;
  color: var(--leaf-deep);
  text-shadow: 0 1px 0 #fff;
  animation: pop 900ms ease-out forwards;
}
@keyframes pop {
  0% { transform: translate(-50%, 0) scale(0.8); opacity: 0; }
  20% { opacity: 1; transform: translate(-50%, -8px) scale(1.1); }
  100% { transform: translate(-50%, -48px) scale(1); opacity: 0; }
}

/* ----- Hero ----- */
.hero {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 16px 16px 14px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.hero-deco {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 86px;
  height: 86px;
  pointer-events: none;
  opacity: 0.95;
}
.hero-deco svg { width: 100%; height: 100%; }
.hero h1 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  line-height: 1.15;
  margin: 0 0 6px;
  font-weight: 600;
  letter-spacing: -0.03em;
}
.hero p { margin: 0 0 12px; color: var(--soil-soft); }
.hero p.kicker { padding-right: 0; }
.hero > p:not(.kicker) { padding-right: 72px; }
.hero .actions { padding-right: 78px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  padding: 11px 16px;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--paper);
  background: var(--leaf);
  box-shadow: 0 4px 0 var(--leaf-deep);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--leaf-deep); }
.btn-ghost {
  background: #efe6d4;
  color: var(--soil);
  box-shadow: 0 4px 0 #d9cdb4;
}
.btn-ghost:active { box-shadow: 0 1px 0 #d9cdb4; }
.btn-petal { background: var(--petal); box-shadow: 0 4px 0 #b85a43; }
.btn-petal:active { box-shadow: 0 1px 0 #b85a43; }
.btn[disabled], .btn.is-off {
  opacity: 0.65;
  cursor: default;
  box-shadow: none;
  transform: none;
}

/* ----- Map mode toggle ----- */
.mode-bar {
  display: flex;
  gap: 4px;
  background: #efe6d4;
  border-radius: 999px;
  padding: 4px;
  margin: 14px 0 8px;
}
.mode-bar button {
  flex: 1;
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--soil-soft);
  font-weight: 800;
  font-size: 0.8rem;
  padding: 8px 6px;
  border-radius: 999px;
  cursor: pointer;
}
.mode-bar button.is-on {
  background: var(--paper);
  color: var(--leaf-deep);
  box-shadow: 0 2px 0 rgba(0,0,0,0.08);
}
.mode-caption {
  font-size: 0.8rem;
  color: var(--soil-soft);
  margin: 0 4px 10px;
}

/* ----- Homestead board ----- */
.board-wrap {
  position: relative;
  border-radius: 22px;
  padding: 10px;
  background:
    repeating-linear-gradient(45deg, #8a9a4e 0 8px, #7e9146 8px 16px),
    #7a8c44;
  box-shadow: var(--shadow), inset 0 0 0 3px #5d6e32;
  overflow: hidden;
}
.board-wrap.is-satellite {
  background:
    url("../assets/satellite-placeholder.svg") center / cover no-repeat,
    #cbb892;
  box-shadow: var(--shadow), inset 0 0 0 3px #7a6240;
}
.board-wrap.is-satellite .board {
  background: transparent;
}
.board-wrap.is-satellite .tile {
  background-image: none;
  background-color: hsla(var(--hue, 110), 40%, 92%, 0.58);
  border-color: rgba(255,255,255,0.7);
}
.board-wrap.is-satellite .tile-house {
  background: hsla(28, 40%, 92%, 0.82);
}

.board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, minmax(78px, auto));
  gap: 7px;
  min-height: 400px;
}

.tile {
  appearance: none;
  border: 1px solid rgba(255,255,255,0.45);
  text-align: left;
  cursor: pointer;
  border-radius: 14px;
  padding: 6px 7px 8px;
  color: var(--soil);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.45), rgba(255,255,255,0.06) 50%),
    hsl(var(--hue, 110) 48% 72%);
  box-shadow: 0 3px 0 rgba(60, 40, 20, 0.18);
  position: relative;
  overflow: hidden;
  min-height: 72px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transition: transform 0.12s ease;
}
.tile:active, .tile.is-pop { transform: scale(0.96); }
.tile h3 {
  font-family: var(--font-display);
  font-size: 0.68rem;
  margin: 0;
  font-weight: 600;
  line-height: 1.15;
  position: relative;
  z-index: 1;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: manual;
}
.tile .glyph {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 1.45rem;
  filter: drop-shadow(0 2px 0 rgba(0,0,0,0.08));
  z-index: 1;
  animation: sway 3.8s ease-in-out infinite;
  transform-origin: 50% 100%;
  pointer-events: none;
}
.tile:nth-child(2n) .glyph { animation-delay: -1.2s; }
.tile:nth-child(3n) .glyph { animation-delay: -2.1s; }
@keyframes sway {
  0%, 100% { transform: rotate(-5deg); }
  50% { transform: rotate(6deg); }
}
.tile-flag {
  position: absolute;
  top: 5px;
  left: 5px;
  background: var(--paper);
  border-radius: 999px;
  padding: 1px 6px;
  font-size: 0.62rem;
  font-weight: 800;
  color: var(--leaf-deep);
  z-index: 2;
}
.tile.is-found { outline: 2px solid var(--leaf); }
.tile.is-locked {
  filter: saturate(0.7);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.3), rgba(40,30,20,0.08)),
    hsl(var(--hue, 110) 20% 78%);
}
.tile .price-tag {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--leaf-deep);
  position: relative;
  z-index: 1;
}

/* House */
.tile-house {
  background:
    linear-gradient(180deg, #f3e6cf 0 42%, #8fbf6a 42% 100%);
  padding: 0;
  justify-content: flex-end;
}
.tile-house .house-art { width: 100%; height: 100%; pointer-events: none; }
.tile-house h3 {
  position: absolute;
  left: 8px;
  bottom: 6px;
  font-size: 0.78rem;
}

/* pets bounce */
.pet-art { position: absolute; inset: 8px 6px auto auto; width: 48px; height: 48px; pointer-events: none; }
.tile-pet .glyph { display: none; }
.tile.is-wiggle .pet-art, .tile.is-wiggle .house-art .tail {
  animation: wiggle 0.45s ease;
}
@keyframes wiggle {
  0%, 100% { transform: translateY(0) rotate(0); }
  30% { transform: translateY(-6px) rotate(-8deg); }
  60% { transform: translateY(-3px) rotate(8deg); }
}

/* coffee meter on tile */
.cup-meter {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 10px;
  border-radius: 99px;
  background: rgba(255,255,255,0.55);
  overflow: hidden;
  margin-top: 4px;
  box-shadow: inset 0 0 0 1px rgba(74,52,40,0.15);
}
.cup-meter > span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #b0693a, #e8b84a);
  border-radius: 99px;
  transition: width 0.35s ease;
}
.cup-label {
  font-size: 0.62rem;
  font-weight: 800;
  color: var(--soil-soft);
  position: relative;
  z-index: 1;
}
.tile.is-full .cup-label { color: var(--leaf-deep); }

/* ----- Regional map ----- */
.region-map {
  display: none;
  position: relative;
  height: 420px;
  border-radius: 16px;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 80%, #8eb7d4 0 18%, transparent 19%),
    linear-gradient(180deg, #b7d4ea 0 28%, #9cba7a 28% 70%, #7da36a 100%);
}
.board-wrap.is-regional .board { display: none; }
.board-wrap.is-regional .region-map { display: block; }
.region-map .river {
  position: absolute;
  left: 10%;
  top: 40%;
  width: 120%;
  height: 42px;
  background: #7eadd0;
  border-radius: 40px;
  transform: rotate(-18deg);
  box-shadow: 0 0 0 8px #8ebdd8;
  opacity: 0.9;
}
.region-map .hill {
  position: absolute;
  width: 180px;
  height: 80px;
  background: #6f8f4e;
  border-radius: 80px 80px 0 0;
  opacity: 0.85;
}
.pin {
  position: absolute;
  transform: translate(-50%, -100%);
  appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 92px;
}
.pin .dot {
  width: 28px;
  height: 28px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: var(--petal);
  box-shadow: 0 4px 0 #b85a43;
}
.pin .dot.farm { background: var(--sun); box-shadow: 0 4px 0 #b8922e; }
.pin span {
  margin-top: 6px;
  background: var(--paper);
  border-radius: 8px;
  padding: 2px 6px;
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--soil);
  box-shadow: var(--shadow);
  line-height: 1.2;
  text-align: center;
}
.pin:active { transform: translate(-50%, -100%) scale(0.94); }

/* ----- How coins / cards ----- */
.section-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin: 22px 4px 10px;
  font-weight: 600;
}
.hint { margin: -4px 4px 12px; color: var(--soil-soft); font-size: 0.92rem; }

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin: 0 0 12px;
}
.card h3 {
  font-family: var(--font-display);
  margin: 0 0 6px;
  font-size: 1.1rem;
  font-weight: 600;
}
.card p, .card li { color: var(--soil-soft); margin: 0 0 8px; }
.card ul { padding-left: 18px; margin: 0 0 8px; }
.kicker { font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 800; color: var(--moss); margin: 0 0 4px; }

.coins-list { margin: 0; padding: 0; list-style: none; }
.coins-list li {
  margin: 0 0 10px;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--line);
  color: var(--soil-soft);
}
.coins-list li:last-child { border-bottom: 0; margin: 0; padding: 0; }
.coins-list strong { color: var(--soil); display: block; margin-bottom: 2px; }

/* wishlist */
.wish-grid { display: grid; gap: 10px; }
.wish-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: #f6efe2;
  border-radius: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  cursor: pointer;
  text-align: left;
  width: 100%;
  appearance: none;
  font: inherit;
}
.wish-card:active { transform: scale(0.98); }
.wish-card b { display: block; font-family: var(--font-display); font-size: 1.05rem; }
.wish-card span { display: block; font-size: 0.85rem; color: var(--soil-soft); }

.spice-link { margin: 22px 0 8px; display: flex; justify-content: center; }
.spice-link a {
  color: var(--soil-soft);
  font-size: 0.85rem;
  text-decoration: none;
  border-bottom: 1px dashed rgba(74,52,40,0.35);
  padding: 6px 2px;
}
.legal {
  font-size: 0.78rem;
  color: var(--soil-soft);
  margin: 8px 4px 0;
  text-align: center;
}

/* ----- Sheets ----- */
.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(32, 22, 14, 0.45);
  z-index: 40;
  display: none;
  align-items: flex-end;
  justify-content: center;
}
.backdrop.is-open { display: flex; }
.sheet {
  width: min(520px, 100%);
  background: var(--paper);
  border-radius: 24px 24px 0 0;
  padding: 10px 18px calc(20px + var(--safe-bottom));
  max-height: 88dvh;
  overflow: auto;
  box-shadow: 0 -12px 40px rgba(0,0,0,0.2);
  animation: up 0.22s ease-out;
}
@keyframes up {
  from { transform: translateY(24px); opacity: 0.4; }
  to { transform: none; opacity: 1; }
}
.grab {
  width: 42px;
  height: 5px;
  border-radius: 99px;
  background: #ddd2c2;
  margin: 4px auto 12px;
}
.sheet h2 {
  font-family: var(--font-display);
  margin: 0 0 6px;
  font-size: 1.45rem;
  font-weight: 600;
}
.sheet .art {
  border-radius: 16px;
  margin: 10px 0 12px;
  overflow: hidden;
  min-height: 160px;
  background: #e7f0dc;
}
.sheet .meta { color: var(--soil-soft); margin: 0 0 14px; }
.sheet-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.art-frame { width: 100%; height: 200px; }

/* coffee sheet meter */
.big-cup {
  height: 18px;
  border-radius: 99px;
  background: #efe6d4;
  overflow: hidden;
  margin: 8px 0 6px;
  box-shadow: inset 0 0 0 1px var(--line);
}
.big-cup > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #b0693a, #e8b84a);
  border-radius: 99px;
  transition: width 0.35s ease;
}
.full-pill {
  display: inline-block;
  background: #dceee0;
  color: var(--leaf-deep);
  font-weight: 800;
  font-size: 0.8rem;
  border-radius: 999px;
  padding: 3px 10px;
  margin: 0 0 10px;
}

/* badges in sheet */
.badge-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.badge-pill {
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 800;
  background: #efe6d4;
  color: var(--soil-soft);
}
.badge-pill.is-got { background: #dceee0; color: var(--leaf-deep); }

.price-box {
  background: #f6efe2;
  border-radius: 14px;
  padding: 12px;
  margin: 8px 0 12px;
  border: 1px solid var(--line);
}
.price-box .amount {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0 0 4px;
}
.price-box p { margin: 0 0 6px; color: var(--soil-soft); font-size: 0.9rem; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(18px + var(--safe-bottom));
  transform: translateX(-50%) translateY(20px);
  background: var(--soil);
  color: var(--paper);
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s ease;
  max-width: 90vw;
  text-align: center;
}
.toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }

.drip {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #7ec8e3;
  pointer-events: none;
  animation: drip 700ms ease-out forwards;
  z-index: 70;
}
@keyframes drip {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(28px) scale(0.4); }
}
.heart {
  position: absolute;
  z-index: 70;
  pointer-events: none;
  font-size: 1.1rem;
  animation: pop 800ms ease-out forwards;
}

/* spice gate page (unchanged look) */
body.spice {
  background: linear-gradient(180deg, #2a211c 0%, #3d2c26 50%, #1a1411 100%);
  color: #f4ece4;
  min-height: 100dvh;
}
body.spice .wrap { padding-top: 48px; }
.gate {
  background: #4a342c;
  color: #f7efe6;
  border-radius: 24px;
  padding: 24px 20px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.35);
}
.gate h1 {
  font-family: var(--font-display);
  font-size: 1.7rem;
  margin: 0 0 10px;
  font-weight: 600;
}
.gate p { color: #e8d8c8; }
.gate .btn { margin-top: 6px; }
.age-box {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 14px 0 16px;
  font-size: 0.95rem;
}
.age-box input { width: 20px; height: 20px; margin-top: 2px; flex: none; }
.leaving { font-size: 0.85rem; color: #d9c4b0; margin-top: 16px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}


/* Screenshot framing helpers */
html.is-shot { scroll-behavior: auto; }
body.shot-wishlist .hero,
body.shot-wishlist .mode-bar,
body.shot-wishlist .mode-caption,
body.shot-wishlist .board-wrap,
body.shot-wishlist #how-coins,
body.shot-wishlist #community {
  display: none !important;
}

.back-link {
  display: inline-block;
  margin-top: 2px;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--leaf-deep);
  text-decoration: none;
  border-bottom: 1px dashed rgba(31, 74, 48, 0.35);
}
.back-link:active { transform: scale(0.98); }

.media-grid {
  display: grid;
  gap: 8px;
  margin: 8px 0 12px;
}
.media-card {
  appearance: none;
  border: 1px solid var(--line);
  background: #f6efe2;
  border-radius: 14px;
  padding: 12px 12px 10px;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.media-card:active { transform: scale(0.98); }
.media-card b { display: block; font-family: var(--font-display); margin-bottom: 4px; }
.media-card span { display: block; font-size: 0.88rem; color: var(--soil-soft); }
.media-grid.is-locked .media-card span { filter: blur(0); }
.media-lock {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--paper);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--soil);
  box-shadow: var(--shadow);
}
html.is-shot { scroll-behavior: auto; }
