:root {
  --ink: #2a1a12;
  --text: #3b2a20;
  --muted: #7a5f45;
  --cream: #fbf3dc;
  --sol: #9945ff;
  --font: 'SV Digits', 'Pixelify Sans', ui-monospace, monospace;
  --outline: 2px 2px 0 #2a160c, -2px 2px 0 #2a160c, 2px -2px 0 #2a160c, -2px -2px 0 #2a160c, 0 4px 0 #1a0e08;
}
/* Digits use JetBrains Mono via unicode-range; prose stays Pixelify Sans.
   Pixel digits read as blobs at landing-page sizes, and every number on this page is
   either money or a price — so clarity wins over style here. */
@font-face {
  font-family: 'SV Digits';
  src: url('fonts/jetbrainsmono-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0024, U+0025, U+002B, U+002F, U+0030-0039, U+003A, U+00D7;
  size-adjust: 92%;
}
@font-face {
  font-family: 'SV Digits';
  src: url('fonts/jetbrainsmono-700.woff2') format('woff2');
  font-weight: 600 900;
  font-display: swap;
  unicode-range: U+0024, U+0025, U+002B, U+002F, U+0030-0039, U+003A, U+00D7;
  size-adjust: 92%;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
/* The document must never be wider than the viewport.
 *
 * Absolutely-positioned children inside the horizontal strips (.marks, .mk) escape their scroll
 * container and widen the initial containing block. `body { overflow-x: hidden }` does not help,
 * because a fixed element (the nav) sizes against the ICB, not the clipped body: on a 390px phone
 * the nav measured 510px and the layout viewport expanded with it.
 *
 * `clip` on the root stops that without creating a scroll container, so sticky/fixed behaviour is
 * untouched. */
html { overflow-x: clip; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--cream);
  /* colour first, texture second: an empty --ground must not take the colour with it */
  background-color: #1f3526;
  background-image: var(--ground, none);
  background-repeat: repeat;
  background-size: 144px;
  image-rendering: pixelated;
  -webkit-font-smoothing: none;
  overflow-x: hidden;
}
img.px, canvas.px, .px { image-rendering: pixelated; image-rendering: crisp-edges; }
a { color: inherit; }

.panel {
  border-style: solid;
  border-width: 18px;
  border-image: var(--frame-panel) 6 fill / 18px / 0 stretch;
  color: var(--text);
}
.panel.dark {
  border-width: 9px;
  border-image: var(--frame-dark) 3 fill / 9px / 0 stretch;
  color: var(--cream);
}

kbd {
  display: inline-block;
  min-width: 1.5em;
  padding: 1px 5px 2px;
  margin: 0 3px;
  font: 600 13px var(--font);
  color: var(--cream);
  background: #3a2418;
  border: 2px solid #120c10;
  box-shadow: inset 0 -2px 0 #1e120c;
  text-align: center;
}

.btn {
  display: inline-block;
  cursor: pointer;
  padding: 8px 18px 10px;
  font: 600 18px var(--font);
  color: #fff6e0;
  text-decoration: none;
  background: #93633a;
  border: 3px solid #120c10;
  box-shadow: inset 0 3px 0 #c99357, inset 0 -4px 0 #5a3822;
  text-shadow: 2px 2px 0 #3a2418;
}
.btn:hover { background: #a8723f; }
.btn:active { box-shadow: inset 0 4px 0 #5a3822; transform: translateY(1px); }
.btn.primary { background: #4b8b44; box-shadow: inset 0 3px 0 #86c254, inset 0 -4px 0 #2b5e3a; text-shadow: 2px 2px 0 #1e4a34; }
.btn.primary:hover { background: #579a4c; }
.btn.big { font-size: 24px; padding: 12px 28px 15px; }
.btn.small { font-size: 16px; padding: 5px 12px 7px; }
.btn:disabled { cursor: default; background: #8a7a6a; box-shadow: inset 0 3px 0 #a89a8a, inset 0 -4px 0 #6a5a4a; color: #e8dcc8; text-shadow: none; }
/* A disabled CTA has to read as "not yet", not as "broken". Flat grey plus a dashed rim does
   that; the muted label says when. */
.btn.soon {
  background: #4a4038;
  box-shadow: inset 0 2px 0 #6a5a4a;
  border-style: dashed;
  border-color: #7a6a58;
  color: #b9a888;
  opacity: 1;
}
.btn.soon:hover { background: #4a4038; }

/* ---------------------------------------------------------------- nav */
.top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px 20px;

  /* Over the hero the bar floats on the animated valley instead of covering it: no panel, no
     border, no shadow. A short gradient at the very top is the only thing there, and only so the
     links stay legible when the scene behind them is bright. `site.js` adds .solid once the hero
     has scrolled past, which is when a real bar is wanted. */
  background: linear-gradient(180deg, rgba(12, 8, 10, .72) 0%, rgba(12, 8, 10, .34) 62%, rgba(12, 8, 10, 0) 100%);
  border-bottom: 3px solid transparent;
  box-shadow: none;
  transition: background .25s, border-color .25s, box-shadow .25s;
}

.top.solid {
  background: rgba(26, 18, 22, .94);
  border-bottom-color: #120c10;
  box-shadow: 0 2px 0 #3a2418;
}
.brand {
  display: flex;
  line-height: 0;
  /* the wordmark is a canvas, but the anchor still styles it: keep the underline off in case
     the mark ever falls back to text */
  text-decoration: none;
}

.links { display: flex; gap: 18px; margin-left: auto; font-size: 17px; font-weight: 600; }
.links a { text-decoration: none; color: #e8dcc8; white-space: nowrap; }
.links a:hover { color: #fff2b8; }

/* ---------------------------------------------------------------- hero */
.hero {
  position: relative;
  height: min(100vh, 900px);
  min-height: 560px;
  overflow: hidden;
  background: #1a1420;
}
#hero-canvas { position: absolute; inset: 0; display: block; image-rendering: pixelated; }
.hero-copy {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 140px 16px 40px;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity .8s;
}
.ready .hero-copy { opacity: 1; }
.hero-copy .btn { pointer-events: auto; }
#hero-logo canvas { display: block; }
.tagline { margin: 0 0 6px; font-size: clamp(22px, 3vw, 32px); font-weight: 700; color: #fff6e0; text-shadow: var(--outline); }
.fine { margin: 0; font-size: 16px; font-weight: 600; color: #fff6e0; text-shadow: var(--outline); }
.clock-chip {
  position: absolute;
  left: 20px;
  bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 8px 8px;
  font-size: 16px;
  background: #2a1d22;
  border: 3px solid #120c10;
  box-shadow: inset 0 0 0 2px #553420;
}
.clock-chip span { color: #c8b8a0; }
.clock-chip b { min-width: 72px; color: #fff2b8; }
.wx { display: inline-block; width: 24px; height: 24px; background-size: 24px; image-rendering: pixelated; }
.wx.sun { background-image: var(--ic-sun); }
.wx.moon { background-image: var(--ic-moon); }

/* ---------------------------------------------------------------- sections */
main { max-width: 1140px; margin: 0 auto; padding: 0 16px; }
.sec { padding: 88px 0 0; }
.sec-head { max-width: 720px; margin: 0 0 22px; }
.sec-head h2 { margin: 0 0 8px; font-size: clamp(30px, 4vw, 42px); line-height: 1.05; color: #fff2b8; text-shadow: var(--outline); }
.sec-head p { margin: 0; font-size: 19px; line-height: 1.4; color: #e8dcc8; text-shadow: 2px 2px 0 #12100c; }

/* day panorama */
.strip-wrap { padding: 0; }
.strip-scroll { overflow-x: auto; }
.strip { position: relative; width: 960px; margin: 0 auto; padding-bottom: 196px; }
#strip { display: block; width: 960px; height: 150px; image-rendering: pixelated; }
.marks { list-style: none; margin: 0; padding: 0; position: absolute; left: 0; right: 0; top: 150px; height: 196px; }
.marks li { position: absolute; top: 0; width: 0; }
.marks .pin { position: absolute; left: -1px; top: -8px; width: 3px; height: 22px; background: #fff2b8; box-shadow: 0 0 0 2px #120c10; }
.marks .mk { position: absolute; top: 20px; left: -4px; width: 132px; display: flex; flex-direction: column; gap: 2px; }
.marks li.low .mk { top: 104px; }
.marks li.low .pin { height: 106px; }
.marks li:last-child .mk { left: auto; right: -4px; text-align: right; align-items: flex-end; }
.marks img { width: 24px; height: 24px; }
.marks b { font-size: 15px; color: #fff2b8; }
.marks small { font-size: 13px; line-height: 1.25; color: #c8b8a0; }

/* almanac */
.almanac { overflow-x: auto; }
.almanac table { width: 100%; border-collapse: collapse; font-size: 17px; }
.almanac th { text-align: left; font-size: 14px; color: var(--muted); font-weight: 600; padding: 0 10px 8px; border-bottom: 3px solid #c9b48a; }
.almanac td { padding: 10px; border-bottom: 2px solid #e2cf9f; vertical-align: middle; }
.almanac tr:last-child td { border-bottom: 0; }
.almanac .stages { white-space: nowrap; }
.almanac .stages img { width: 32px; height: 52px; margin-right: 2px; }
.almanac .name { white-space: nowrap; }
.almanac .name img { width: 32px; height: 32px; vertical-align: middle; margin-right: 6px; }
.almanac .name b { font-size: 19px; vertical-align: middle; }
.almanac .note { color: var(--muted); font-size: 15px; min-width: 220px; }
.almanac tr.sol .name b { color: #5b2fa8; }

/* $GAME flow and ledger */
.flow { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 18px 12px; overflow-x: auto; }
.flow .step { flex: 1; min-width: 120px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.flow .art { height: 90px; display: flex; align-items: flex-end; justify-content: center; }
.flow .step b { font-size: 18px; color: #fff2b8; }
.flow .step small { font-size: 14px; color: #c8b8a0; }
.flow .arrow { width: 30px; height: 27px; flex: none; margin-top: 52px; }
.ledger-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 16px; margin-top: 16px; }
.ledger-mock header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.ledger-mock h3, .ledger-rules h3 { margin: 0; font-size: 26px; color: #5a2f14; }
.tag { padding: 2px 10px 4px; font-size: 14px; color: var(--cream); background: #3a2418; border: 2px solid #120c10; }
.bank { display: flex; align-items: center; gap: 14px; padding: 10px 12px; margin-bottom: 10px; background: #2a1d22; color: var(--cream); border: 3px solid #120c10; box-shadow: inset 0 0 0 2px #5b2fa8; }
.bank img { width: 48px; height: 48px; }
.bank div { flex: 1; display: flex; flex-direction: column; }
.bank small { font-size: 14px; color: #c8b8e8; }
.bank b { font-size: 34px; line-height: 1; }
.list { display: flex; flex-direction: column; gap: 6px; }
.row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; background: #ead9b0; border: 2px solid #c9b48a; }
.row img { width: 32px; height: 32px; flex: none; }
.row .grow { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.row b { font-size: 17px; }
.row small { font-size: 14px; color: var(--muted); }
.row.done { opacity: .62; }
.meter { height: 8px; background: #c9b48a; border: 2px solid #8a7050; }
.meter i { display: block; height: 100%; background: #4b8b44; }
.row.done .meter i { background: var(--sol); }

/* Mira's seed stall — richer per-crop descriptions */
.shop-intro { margin: 0 0 12px; font-size: 15px; line-height: 1.45; color: #5a3a1e; }
.shop-intro b { color: #7a2f1e; }
.shop-row { align-items: center; }
.shop-row .grow { gap: 1px; min-width: 0; }
.shop-row .grow b { display: flex; align-items: center; gap: 6px; font-size: 18px; }
.shop-row .grow small { font-size: 13px; color: #8a6a44; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shop-row .grow .pay { color: #4b2f7a; }
.shop-row .grow .pay b { font-size: 13px; color: #5b2fa8; display: inline; }
.shop-row .price { font-size: 18px; font-weight: 700; color: #5a2f14; white-space: nowrap; }
.shop-row .buy { display: flex; flex-direction: column; gap: 4px; flex: none; }
.tier.t-gold { background: #b5832a; }
.reward { display: flex; align-items: center; gap: 4px; font-size: 17px; font-weight: 700; color: #5b2fa8; }
.reward img { width: 22px; height: 22px; }
.ledger-rules dl { margin: 14px 0 0; }
.tier { display: inline-block; margin-right: 8px; padding: 0 6px 2px; font-size: 13px; color: #fff6e0; border: 2px solid #120c10; vertical-align: 2px; }
.t-easy { background: #4b8b44; }
.t-medium { background: #b5832a; }
.t-hard { background: #b2302e; }
.t-bloom { background: #5b2fa8; }
/* Stock Valley tier badges (T1–T4) */
.t-t1 { background: #4b8b44; }
.t-t2 { background: #b5832a; }
.t-t3 { background: #b2302e; }
.t-t4 { background: #5b2fa8; }
.mock-note { margin: 0 0 10px; font-size: 15px; color: var(--muted); }
.bloomline { display: flex; align-items: center; gap: 6px; margin: 10px 0 0; font-size: 15px; color: var(--text); }
.bloomline img { width: 24px; height: 24px; }
.rewards { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 16px; }
.rewards th { text-align: left; font-size: 13px; color: var(--muted); font-weight: 600; padding: 0 6px 6px; border-bottom: 3px solid #c9b48a; }
.rewards td { padding: 7px 6px; border-bottom: 2px solid #e2cf9f; vertical-align: middle; }
.rewards td img { width: 24px; height: 24px; vertical-align: middle; }
.rewards td small { color: var(--muted); font-size: 13px; }
.rewards td b { color: #5b2fa8; white-space: nowrap; }
.daily { margin: 12px 0 0; padding: 8px 10px; font-size: 16px; line-height: 1.35; background: #ead9b0; border: 2px solid #c9b48a; }
.daily b { color: #5b2fa8; }
.treasury { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 24px; margin-top: 16px; padding: 18px 20px; }
.supply { display: flex; flex-direction: column; gap: 10px; min-width: 230px; }
.supply div { display: flex; flex-direction: column; }
.supply small { font-size: 14px; color: #c8b8a0; }
.supply b { font-size: 28px; line-height: 1.05; color: #fff2b8; }
.supply span { font-size: 14px; color: #c8b8e8; }
.pool-rule { flex-basis: 100%; margin: 0; padding-top: 12px; border-top: 2px solid #3a2a30; font-size: 15px; line-height: 1.4; color: #c8b8a0; }
.vol-note { flex-basis: 100%; margin: 0; padding: 12px 14px; background: #2a1d22; border: 3px solid #120c10; box-shadow: inset 0 0 0 2px #6a4a9a; font-size: 15px; line-height: 1.45; color: #e6d8c0; }
.vol-note b { color: var(--gold); }
.waterfall { list-style: none; display: flex; gap: 10px; margin: 0; padding: 0; flex: 1; }
.waterfall li { position: relative; flex: 1; display: flex; flex-direction: column; gap: 3px; padding: 10px 12px 12px; background: #2a1d22; border: 3px solid #120c10; box-shadow: inset 0 0 0 2px #553420; }
.waterfall li + li::before { content: ''; position: absolute; left: -12px; top: 50%; margin-top: -6px; border: 6px solid transparent; border-left-color: #f1e3bf; }
.waterfall i { font-style: normal; font-size: 13px; color: #c8b8a0; }
.waterfall b { font-size: 18px; color: #fff2b8; }
.waterfall small { font-size: 14px; line-height: 1.3; color: #c8b8a0; }
.ledger-rules dt { font-size: 18px; font-weight: 700; color: #5a2f14; margin-top: 12px; }
.ledger-rules dt:first-child { margin-top: 0; }
.ledger-rules dd { margin: 2px 0 0; font-size: 16px; line-height: 1.4; color: var(--text); }

/* valley map */
.map-frame { padding: 0; }
.map { position: relative; line-height: 0; }
#map-canvas { width: 100%; height: auto; display: block; image-rendering: pixelated; }
.label {
  position: absolute;
  transform: translate(-50%, -100%);
  padding: 3px 8px 5px;
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
  color: var(--cream);
  background: #2a1d22;
  border: 2px solid #120c10;
  box-shadow: inset 0 0 0 1px #93633a;
  pointer-events: none;
}
.label::after { content: ''; position: absolute; left: 50%; bottom: -6px; margin-left: -3px; border: 3px solid transparent; border-top-color: #120c10; }

/* folk */
.folk { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.person { display: flex; flex-direction: column; }
.stage { width: 100%; height: 190px; display: flex; align-items: flex-end; justify-content: center; background: #55974a; border: 3px solid #120c10; border-bottom: 0; box-shadow: inset 0 -26px 0 #3d7a3f, inset 0 -30px 0 #2b5e3a; }
.stage img { width: 96px; height: 144px; margin-bottom: 16px; }
.bubble { position: relative; flex: 1; margin-top: -3px; }
.bubble .nm { display: inline-block; padding: 2px 10px 4px; font-size: 18px; font-weight: 700; color: #fff2b8; background: #3a2418; border: 2px solid #120c10; }
.bubble small { display: block; margin: 6px 0 4px; font-size: 14px; color: var(--muted); }
.bubble p { margin: 0; font-size: 18px; line-height: 1.38; }

/* closing call */
.cta { margin: 96px auto 0; max-width: 720px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.cta p { margin: 0; font-size: 20px; }
.cta .keys { font-size: 15px; color: var(--muted); margin-top: 4px; }
.cta canvas { display: block; }
.foot { margin-top: 60px; padding: 22px 16px 28px; text-align: center; font-size: 15px; color: #a8b8a0; background: rgba(18, 12, 16, .6); border-top: 3px solid #120c10; }

@media (max-width: 860px) {
  .links { display: none; }
  .top .btn { margin-left: auto; }
  .ledger-grid { grid-template-columns: 1fr; }
  .treasury, .waterfall { flex-direction: column; align-items: stretch; }
  .waterfall li + li::before { left: 50%; top: -12px; margin: 0 0 0 -6px; border-left-color: transparent; border-top-color: #f1e3bf; }
  .folk { grid-template-columns: 1fr; }
  .flow { justify-content: flex-start; }
  .label { font-size: 11px; padding: 2px 5px 3px; }
}

/* contract address frame */
.ca { display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 10px; background: #2a1d22; border: 3px solid #120c10; box-shadow: inset 0 0 0 2px #5b2fa8; color: var(--cream); }
.ca img { width: 28px; height: 28px; flex: none; }
.ca-body { display: flex; flex-direction: column; min-width: 0; flex: 1; text-align: left; }
.ca-body small { font-size: 12px; color: #c8b8e8; }
.ca-body code { font: 600 16px var(--font); color: #fff2b8; overflow-wrap: anywhere; }
.ca-body code.tba { color: #c8b8a0; }
.ca .btn { flex: none; }
.ca-hero { pointer-events: auto; width: min(460px, 100%); margin-top: 4px; }
.ca-wide { flex-basis: 100%; }
.fine { font-size: 17px; max-width: 560px; line-height: 1.35; }
/* `.fine b` used to be `display: block; font-size: 24px`. That was written for a single stat on its
   own line, but it applies to EVERY <b> inside .fine — so a sentence like "Burn 25,000 $GAME and
   your farm opens for 30 days" rendered as three stacked 24px blocks and read like a list of
   fragments. Nothing in the site relies on the block form, so emphasis is inline now. */
.fine b { color: #fff2b8; }
.foot a { color: #e8dcc8; }
.foot a:hover { color: #fff2b8; }

/* ---------------------------------------------------------------- docs */
.links a.on { color: #fff2b8; }
.docs { max-width: 1140px; margin: 0 auto; padding: 96px 16px 0; display: grid; grid-template-columns: 230px 1fr; gap: 20px; align-items: start; }
.toc { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 2px; padding: 8px 6px; }
.toc b { font-size: 14px; color: #c8b8a0; padding: 0 8px 6px; }
.toc a { padding: 5px 8px 7px; font-size: 16px; text-decoration: none; color: #e8dcc8; }
.toc a:hover { color: #fff2b8; }
.toc a.on { color: #fff2b8; background: #3a2418; box-shadow: inset 3px 0 0 #f2c14e; }
.doc { min-width: 0; font-size: 18px; line-height: 1.5; }
.doc section + section { margin-top: 34px; padding-top: 26px; border-top: 3px solid #e2cf9f; }
.doc h1 { margin: 0 0 10px; font-size: 38px; line-height: 1.1; color: #5a2f14; }
.doc h2 { margin: 0 0 10px; font-size: 30px; line-height: 1.1; color: #5a2f14; }
.doc h3 { margin: 18px 0 6px; font-size: 21px; color: #5a2f14; }
.doc p { margin: 0 0 10px; }
.doc a { color: #5b2fa8; }
.doc ol, .doc ul { margin: 0 0 10px; padding-left: 24px; }
.doc li { margin: 0 0 6px; }
.doc .muted, .dt .muted { color: var(--muted); font-size: 16px; }
.callout { padding: 10px 12px; background: #ead9b0; border: 2px solid #c9b48a; box-shadow: inset 4px 0 0 #5b2fa8; }
.callout b { color: #5b2fa8; }
.dt { width: 100%; border-collapse: collapse; margin: 6px 0 12px; font-size: 17px; }
.dt th { text-align: left; font-size: 14px; color: var(--muted); font-weight: 600; padding: 0 8px 6px; border-bottom: 3px solid #c9b48a; }
.dt td { padding: 8px; border-bottom: 2px solid #e2cf9f; vertical-align: middle; }
.dt td.nm { white-space: nowrap; }
.dt td.nm img { width: 24px; height: 24px; vertical-align: middle; margin-right: 6px; }
.dt.kv td:first-child { width: 190px; color: var(--muted); }
.dt kbd { font-size: 12px; }
.dt b { color: #5b2fa8; }
.faq dt { font-weight: 700; color: #5a2f14; margin-top: 12px; }
.faq dd { margin: 2px 0 0; }
.doc [data-ca] { margin-top: 6px; }
@media (max-width: 860px) {
  .docs { grid-template-columns: 1fr; padding-top: 84px; }
  .toc { position: static; flex-direction: row; flex-wrap: wrap; }
  .toc b { display: none; }
  .doc { font-size: 17px; }
  .dt { display: block; overflow-x: auto; }
}

/* leaderboard */
.board-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 10px; }
.tabs { display: flex; gap: 4px; }
.tab { cursor: pointer; padding: 4px 12px 6px; font: 600 16px var(--font); color: var(--text); background: #e2cf9f; border: 2px solid #8a7050; }
.tab.on { color: #fff6e0; background: #5a2f14; border-color: #120c10; }
.board-sub { font-size: 15px; color: var(--muted); }
.board { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; }
.brow { display: flex; align-items: center; gap: 10px; padding: 6px 10px; background: #ead9b0; border: 2px solid #c9b48a; }
.brow.you { border-color: #5b2fa8; box-shadow: inset 4px 0 0 #9945ff; }
.rk { min-width: 32px; text-align: center; font-size: 17px; font-weight: 700; color: var(--muted); }
.rk.r1, .rk.r2, .rk.r3 { color: #fff6e0; border: 2px solid #120c10; padding: 0 4px 2px; }
.rk.r1 { background: #c98b2a; }
.rk.r2 { background: #8b93a3; }
.rk.r3 { background: #9a5a3a; }
.who { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.who b { font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who small { font-size: 13px; color: var(--muted); }
.val { display: flex; align-items: center; gap: 4px; font-size: 18px; font-weight: 700; color: #5b2fa8; }
.val img { width: 22px; height: 22px; }
.board-empty { margin: 6px 0; font-size: 17px; color: var(--muted); }
@media (max-width: 860px) { .board { grid-template-columns: 1fr; } }

/* X link */
.x-link { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; color: #e8dcc8; text-decoration: none; padding: 5px 10px 7px; border: 3px solid #120c10; background: #2a1d22; box-shadow: inset 0 0 0 2px #553420; }
.x-link:hover { color: #fff2b8; }
.x-link .xi { width: 14px; height: 14px; shape-rendering: crispEdges; }
@media (max-width: 860px) { .x-link span { display: none; } .x-link { padding: 7px 8px; } }

.top .btn, .x-link { white-space: nowrap; flex: none; }
/* One height for every control in the bar. Left alone, the icon-only X link measured 34px, the
   disabled Play 37px and the logo 36px, which reads as misalignment at phone width. */
.top .btn, .top .x-link {
  box-sizing: border-box;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
@media (max-width: 1180px) { .top .x-link span { display: none; } .top .x-link { padding: 7px 8px; } .links { gap: 14px; } }

/* A phone cannot fit the logo, three links and the CTA on one row: at 390px the nav measured
   510px wide and pushed the whole page sideways. Tighten the row instead of letting it overflow,
   and drop the nav links below 520px — the footer and the hero already link to the same pages. */
@media (max-width: 640px) {
  .top { gap: 10px; padding: 8px 12px; }
  .links { gap: 12px; font-size: 15px; }
  .top .btn { padding: 7px 10px; font-size: 14px; }
}
@media (max-width: 520px) {
  .links { display: none; }
  .brand { flex: 1 1 auto; min-width: 0; }
}

/* ---------------------------------------------------------------- pre-registration
   One page, one job: get a wallet connected and show the codes. Everything is a single
   column so it reads the same on a phone as on a desktop — this link gets shared in
   replies and DMs, so most people will open it on a phone.

   NOTE ON COLOUR: `.panel` is a CREAM card with dark text. Anything inside a .prereg-card
   must therefore be dark, or it disappears. The dark-inset blocks below (codes, progress,
   earned) flip back to pale text on purpose — that is what gives them their weight. */

.prereg-page { min-height: 100vh; overflow-x: clip; }

.prereg {
  max-width: 720px;
  margin: 0 auto;
  padding: 88px 16px 48px;
}

/* The hero is a wooden signboard: same border-image frame as the cards below, so the page
   reads as one set of signs nailed to the valley rather than text floating on a photo.
   The frame's `fill` slice supplies the cream interior, which is why the copy below is dark —
   cream text on cream fill would vanish. */
.prereg-head {
  position: relative;
  text-align: center;
  margin-bottom: 16px;
  padding: 12px 18px 16px;
  border-style: solid;
  border-width: 18px;
  border-image: var(--frame-panel) 6 fill / 18px / 0 stretch;
  color: var(--text);
}

.prereg-head h1 {
  font-size: clamp(30px, 7vw, 46px);
  margin: 0 0 10px;
  color: #6b3f12;
  letter-spacing: .5px;
  text-shadow: 0 2px 0 rgba(255, 255, 255, .55);
}
.prereg-head .lede {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  max-width: 54ch;
  margin: 0 auto 10px;
}
.prereg-head .lede b { color: #6b3f12; }
.prereg-head .fine {
  font-size: 13px;
  line-height: 1.65;
  color: var(--muted);
  max-width: 50ch;
  margin: 0 auto;
  /* the global `.fine` carries a 4-way dark outline for text sitting on the valley. On a cream
     panel that outline just muddies small glyphs, so it is cancelled here. */
  text-shadow: none;
  font-weight: 400;
}

/* Everything inside .prereg-head is on a CREAM panel, so the global `.fine b` highlight colour
   (#fff2b8, a pale yellow) is invisible here. The handle @stockvalley_ rendered as pale text on
   cream — present in the DOM, unreadable on screen. Bold inside this block stays brown. */
.prereg-head .fine b { color: #6b3f12; }

/* A link inside small print on a cream panel needs to look like a link, not like body text: the
   global rule is `a { color: inherit }`, which made it indistinguishable from the sentence. */
.prereg-head .fine a {
  color: #6b3f12;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
}
.prereg-head .fine a:hover { color: var(--sol); }

/* Same trap in the reward card: `.panel` is cream, `.fine` is pale, so pale-on-cream vanished.
   The card's own note at the top of this file already says anything inside .prereg-card must be
   dark — this enforces it for .fine, which was the one class that ignored the rule. */
.prereg-card .fine {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  text-shadow: none;
  font-weight: 400;
  margin: 0 0 10px;
}
.prereg-card .fine b { color: #6b3f12; }

.prereg-stage { display: grid; gap: 14px; }

/* the card itself: cream panel, so every child defaults to dark */
.prereg-card { padding: 6px 10px 14px; }
.prereg-card h2 {
  font-size: 19px;
  margin: 0 0 6px;
  color: #6b3f12;
}
.prereg-card > p {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text);
  margin: 0 0 12px;
}
.prereg-card > p b { color: #6b3f12; }

.wallet-row { display: flex; gap: 10px; flex-wrap: wrap; }
.wallet-row .btn { flex: 1 1 200px; }

.prereg-note {
  font-size: 12.5px !important;
  color: var(--muted) !important;
  margin: 10px 0 0 !important;
  min-height: 16px;
  line-height: 1.5;
}
.prereg-note.warn { color: #a8321f !important; }
/* a claimed reward is good news, not a warning — but it sits on the cream card, so it has to be
   dark enough to read: #1d6b3a on cream is 5.6:1 */
.prereg-note.ok { color: #1d6b3a !important; font-weight: 600; }

/* The gold amount. Two surfaces, so two colours — the same trap that made @stockvalley_ invisible:
   a colour chosen for the cream card is unreadable on the dark task rows, and vice versa.
     default   cream card  -> dark brown  #6b3f12  (8.1:1 on --cream)
     task row  dark inset  -> pale gold   #ffd479  (11.4:1 on #2a1a12) */
.gold-pay { color: #6b3f12; font-weight: 700; }
.task-body .gold-pay { color: #ffd479; }

/* the code list — dark inset inside the cream card, so the code itself reads clearly */
.code-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 7px; }
.code-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 11px;
  border-radius: 7px;
  background: #2a1a12;
  border: 1px solid #4a3428;
}
.code-item.used { opacity: .62; }
.code-value {
  font-family: var(--font);
  font-size: 16px;
  letter-spacing: 2.5px;
  color: #ffe9a8;
  flex: 1 1 auto;
  user-select: all;
}
.code-state {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #b9a98c;
}
.code-item.used .code-state { color: #9ed69e; }
.code-copy { flex: 0 0 auto; }

/* progress — dark track so the fill is visible against cream */
.progress-wrap { margin: 4px 0 14px; }
.progress-bar {
  height: 12px;
  border-radius: 6px;
  background: #2a1a12;
  overflow: hidden;
  border: 1px solid #4a3428;
  /* an empty bar looks like a divider, so the track itself carries a faint fill */
  background-image: linear-gradient(90deg, rgba(255, 233, 168, .07), rgba(255, 233, 168, .12));
}
.progress-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #8fd06a, #ffe9a8);
  transition: width .35s ease;
}
.progress-text {
  font-size: 12.5px !important;
  color: var(--text) !important;
  margin: 8px 0 0 !important;
}
.next-reward { color: var(--muted); }

.earned-row { display: flex; gap: 10px; }
.earned {
  flex: 1;
  padding: 9px 12px;
  border-radius: 7px;
  background: #2a1a12;
  border: 1px solid #4a3428;
}
.earned small {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #b9a98c;
}
.earned b { font-size: 20px; color: #ffe9a8; }

/* join box */
.join-row { display: flex; gap: 8px; flex-wrap: wrap; }
.code-input {
  flex: 1 1 160px;
  min-width: 0;
  padding: 11px 13px;
  font-family: var(--font);
  font-size: 17px;
  letter-spacing: 3px;
  text-align: center;
  text-transform: uppercase;
  color: #ffe9a8;
  background: #2a1a12;
  border: 2px solid #4a3428;
  border-radius: 7px;
  outline: none;
}
.code-input:focus { border-color: #8a6a3a; }
.code-input::placeholder { color: #7a6550; letter-spacing: 3px; }
.join-row .btn { flex: 0 0 auto; }

.invitee-reward {
  font-size: 24px !important;
  color: #2f6b2f !important;
  margin: 0 0 8px !important;
}
.invitee-reward b { font-size: 32px; }

/* ---------------------------------------------------------------- X mission
   A checklist on a cream card. Each row is: state badge, what to do, an Open link, and either a
   button or a tick. Rows are full-width so the tap target is the whole row on a phone. */

.handle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 2px;
}
.handle-at {
  font-size: 20px;
  font-weight: 700;
  color: var(--muted);
  flex: 0 0 auto;
}
.handle-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 9px 12px;
  font-family: var(--font);
  font-size: 16px;
  color: var(--text);
  background: #fffaf0;
  border: 2px solid #b8a488;
  border-radius: 7px;
  outline: none;
}
.handle-input:focus { border-color: #8a6a3a; }
.handle-input::placeholder { color: #a8957a; }

.task-list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  gap: 7px;
}
.task-row {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  padding: 9px 11px;
  border-radius: 7px;
  background: #2a1a12;
  border: 1px solid #4a3428;
}
.task-row.done { opacity: .72; border-color: #4d7a3f; }
.task-step {
  flex: 0 0 22px;
  height: 22px;
  line-height: 22px;
  text-align: center;
  border-radius: 50%;
  background: rgba(255, 233, 168, .18);
  color: #ffe9a8;
  font-size: 12px;
}
.task-row.done .task-step { background: #4d7a3f; color: #eaf5df; }
.task-body { flex: 1 1 150px; min-width: 0; }
.task-body b {
  display: block;
  font-size: 13.5px;
  color: #f6ecd2;
  line-height: 1.3;
}
.task-body small {
  display: block;
  font-size: 12px;
  color: #cbb894;
  line-height: 1.35;
  margin-top: 2px;
}
.task-open {
  flex: 0 0 auto;
  font-size: 12.5px;
  font-weight: 600;
  color: #8fd06a;
  text-decoration: none;
  border-bottom: 1px solid rgba(143, 208, 106, .5);
  padding-bottom: 1px;
}
.task-open:hover { color: #b6e88f; }

/* The right-hand side of a task row. Holds either one Open button, or "open again" + "I did it". */
.task-action {
  flex: 0 0 auto;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 9px;
}
/* Open is an <a class="btn">, so it must not inherit the underline-and-green link styling above. */
.task-action .task-open {
  color: inherit;
  border-bottom: 0;
  padding-bottom: 0;
  text-decoration: none;
}
.task-reopen {
  font-size: 11.5px;
  color: #9c8b74;
  text-decoration: none;
  border-bottom: 1px solid rgba(156, 139, 116, .45);
  padding-bottom: 1px;
}
.task-reopen:hover { color: #c9b79c; }
/* A disabled "I did it" must read as unavailable, not as a broken green button: same box, drained
   of colour, with the countdown as the label. The text is lightened until it clears 4.5:1 against
   its own background — WCAG exempts disabled controls, but this one carries information (the
   remaining seconds), so it has to be legible. */
.task-btn[disabled] {
  background: #3a3630;
  color: #a8a096;
  box-shadow: inset 0 2px 0 #4a453d, inset 0 -3px 0 #2a2620;
  text-shadow: none;
  cursor: default;
}
.task-btn {
  flex: 0 0 auto;
  font-size: 13px;
  padding: 5px 11px 7px;
  background: #4b8b44;
  box-shadow: inset 0 2px 0 #86c254, inset 0 -3px 0 #2b5e3a;
  text-shadow: 1px 1px 0 #1e4a34;
}
.task-btn:hover:not([disabled]) { background: #579a4c; }
.task-done {
  flex: 0 0 auto;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #9ed69e;
}
/* What a finished step paid. Same size as the old "DONE" label, but it says something useful. */
.task-done.task-paid {
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
  font-weight: 700;
  color: #ffd479;
}

/* the ladder — sits on the dark page, so pale text is correct here */
.prereg-rules {
  margin-top: 26px;
  padding: 18px 20px;
  border-radius: 10px;
  /* near-solid: the valley behind is busy, and this block is all small text */
  background: rgba(12, 20, 14, .94);
  border: 1px solid rgba(255, 233, 168, .2);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}
.prereg-rules h2 { font-size: 17px; margin: 0 0 12px; color: #ffe9a8; }
.prereg-rules .fine { font-size: 12.5px; line-height: 1.65; color: #ded0b0; margin: 12px 0 0; text-shadow: none; font-weight: 400; }

.ladder { display: grid; gap: 6px; }
.ladder-row {
  display: flex;
  align-items: center;
  gap: 10px;
  /* a long value (the kit's "150 gold + 5 turnip seeds") must drop to its own line on a phone
     rather than push the row wider than the screen */
  flex-wrap: wrap;
  padding: 8px 11px;
  border-radius: 7px;
  background: rgba(255, 255, 255, .04);
  font-size: 13.5px;
}
/* the row everyone gets — visually first, but not competing with the jackpot */
.ladder-row.kit {
  background: rgba(143, 208, 106, .14);
  border: 1px solid rgba(143, 208, 106, .34);
}
.ladder-row.kit .ladder-step { background: rgba(143, 208, 106, .3); color: #d8f0c0; }

.ladder-row.jackpot {
  background: rgba(255, 233, 168, .16);
  border: 1px solid rgba(255, 233, 168, .42);
}
.ladder-step {
  flex: 0 0 24px;
  height: 24px;
  line-height: 24px;
  text-align: center;
  border-radius: 50%;
  background: rgba(255, 233, 168, .2);
  color: #ffe9a8;
  font-size: 12px;
}
.ladder-label { flex: 1 1 auto; color: #f2e7c8; min-width: 0; }
.ladder-value { color: #ffe9a8; white-space: nowrap; }

.prereg-foot {
  text-align: center;
  padding: 18px 16px 24px;
  font-size: 12.5px;
  /* was #b9a888 at 11.5px — 5.7:1 against flat #1f3526, but this line sits directly on the valley
     texture, where trees and water are far lighter than the flat colour. Raising the tone alone
     did not help: at 12.5px the glyphs still dissolved into the scenery. The site already has a
     pattern for text on the valley — the 4-way dark outline in --outline — so use it here too. */
  color: #e2d3b2;
  text-shadow: var(--outline);
}

@media (max-width: 480px) {
  .prereg { padding-top: 76px; }
  .prereg-card { padding: 15px 14px 16px; }
  .code-value { font-size: 15px; letter-spacing: 2px; }
  .earned b { font-size: 17px; }
}

/* ---------------------------------------------------------------- pre-reg background
   One static frame of the actual valley, painted behind the form. It sits under a scrim so
   the copy stays readable — the scene is there to say "this is the game", not to compete
   with the text. */

#prereg-bg {
  position: fixed;
  inset: 0;
  /* canvas is a replaced element, so inset alone leaves it at its intrinsic 300x150 */
  width: 100%;
  height: 100%;
  z-index: 0;
  image-rendering: pixelated;
  display: block;
}

/* dark gradient over the scene: heaviest at the top and bottom where the text sits */
#prereg-scrim {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg,
      rgba(14, 22, 16, .80) 0%,
      rgba(14, 22, 16, .52) 18%,
      rgba(14, 22, 16, .34) 46%,
      rgba(14, 22, 16, .52) 74%,
      rgba(14, 22, 16, .72) 100%);
}

/* everything else rides above the scene */
.prereg-page .top,
.prereg-page .prereg,
.prereg-page .prereg-foot {
  position: relative;
  z-index: 2;
}

/* with the valley behind, the page no longer needs its own texture */
.prereg-page { background-image: none; }

/* --- transparency: shelf address + epoch receipts (docs page) --- */
.shelf-live, .epochs-live { margin: 10px 0 18px; }
.shelf-addr { padding: 12px 14px; background: var(--cream); border: 2px solid #c9b48a; box-shadow: inset 4px 0 0 var(--sol); margin-bottom: 10px; }
.shelf-addr small { display: block; font-size: 14px; color: var(--muted); margin-bottom: 4px; }
.shelf-addr small.muted { margin: 6px 0 0; }
.shelf-addr .addr { display: inline-block; text-decoration: none; }
.shelf-addr code { font-size: 15px; color: #5b2fa8; word-break: break-all; border-bottom: 2px solid #c9b48a; }
.shelf-addr .addr:hover code { border-bottom-color: var(--sol); }
.epoch-card { padding: 10px 12px; background: var(--cream); border: 2px solid #c9b48a; margin-bottom: 10px; }
.epoch-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.epoch-head b { color: #5a2f14; }
.epoch-figs { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 8px; }
.epoch-figs span { display: flex; flex-direction: column; }
.epoch-figs small { font-size: 12px; color: var(--muted); }
.epoch-figs b { font-size: 18px; color: #5b2fa8; }
.epoch-card .dt { margin: 0; font-size: 15px; }
.epoch-card .dt th { font-size: 12px; }

/* Anchor links land under the fixed header without this — the heading gets clipped. */
.doc section[id], .doc h3[id], .doc h4[id] { scroll-margin-top: 96px; }
