:root {
  --ink: #2a1a12;
  --text: #3b2a20;
  --muted: #7a5f45;
  --cream: #fbf3dc;
  --sol: #9945ff;
  --font: '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;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--cream);
  background: #1f3526 var(--ground) 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; }

/* ---------------------------------------------------------------- nav */
.top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px 20px;
  background: rgba(26, 18, 22, .86);
  border-bottom: 3px solid #120c10;
  box-shadow: 0 2px 0 #3a2418;
}
.brand { display: flex; line-height: 0; }
.links { display: flex; gap: 18px; margin-left: auto; font-size: 17px; font-weight: 600; }
.links a { text-decoration: none; color: #e8dcc8; }
.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: 80px 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; }

/* $STEAD 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); }
.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; }
.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; }
.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 { display: block; font-size: 24px; color: #fff2b8; margin-bottom: 2px; }
.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; } }
