:root {
  --bg: #152238;
  --dot: rgba(255, 255, 255, .07);
  --ink: #1a1a22;
  --cream: #fdf6dc;
  --cream-2: #efe6c4;
  --lilac: #ece4ff;
  --muted: #6d6656;
  --red: #e5383b;
  --green: #2fbf4f;
  --blue: #3b8fe0;
  --gold: #f5c33b;
  --purple: #b05bd8;
  --pix: "Press Start 2P", monospace;
  --label: "Silkscreen", monospace;
  --body: "Pixelify Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  background-image: radial-gradient(var(--dot) 1.5px, transparent 1.5px);
  background-size: 10px 10px;
  color: var(--ink);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.5;
  padding: 20px clamp(12px, 2.5vw, 28px) 48px;
}
img[data-sprite], canvas { image-rendering: pixelated; }
a { color: inherit; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- header ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.logo {
  font-family: var(--pix);
  font-size: clamp(26px, 4.5vw, 44px);
  color: #48e070;
  text-decoration: none;
  letter-spacing: -.02em;
  text-shadow:
    3px 0 0 var(--ink), -3px 0 0 var(--ink), 0 3px 0 var(--ink), 0 -3px 0 var(--ink),
    3px 3px 0 var(--ink), -3px -3px 0 var(--ink), 3px -3px 0 var(--ink), -3px 3px 0 var(--ink),
    6px 6px 0 #0b5d2a, 7px 7px 0 var(--ink);
}
.topnav { display: flex; gap: 10px; flex-wrap: wrap; }
.topnav a {
  font-family: var(--label); font-size: 13px; text-transform: uppercase; text-decoration: none;
  background: var(--cream); border: 3px solid var(--ink); padding: 6px 16px;
  box-shadow: inset 0 -4px 0 var(--cream-2), 3px 3px 0 rgba(0,0,0,.35);
}
.topnav a.active { background: var(--green); color: #fff; box-shadow: inset 0 -4px 0 #1f8a37, 3px 3px 0 rgba(0,0,0,.35); }
body[data-view="field"] .topnav { display: none; }
.brand { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  font-family: var(--label); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .12em;
  color: #fff; padding: 4px 10px; border: 2px solid var(--ink); box-shadow: inset 0 -3px 0 rgba(0,0,0,.2);
}
.chip-green { background: var(--green); }
.chip-gold { background: var(--gold); color: var(--ink); }
.chip-red { background: var(--red); }

/* ---------- views ---------- */
.view { display: none; }
body[data-view="field"] .view-field { display: grid; }
body[data-view="launch"] .view-launch { display: block; }
body[data-view="check"] .view-check { display: block; }
body[data-view="docs"] .view-docs { display: block; }

/* ---------- panels & tags ---------- */
.panel {
  position: relative;
  background: var(--cream);
  border: 3px solid var(--ink);
  box-shadow: 8px 8px 0 rgba(0,0,0,.4);
  padding: 30px 18px 18px;
  margin: 22px 0 30px;
}
.panel-lilac { background: var(--lilac); }
.narrow { max-width: 920px; }
.tag {
  position: absolute; top: -20px; left: 4px;
  font-family: var(--label); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .08em;
  color: #fff; text-shadow: 2px 2px 0 rgba(0,0,0,.35);
  padding: 4px 14px; border: 3px solid var(--ink);
  display: inline-flex; align-items: center; gap: 8px;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.2);
}
.stage > .tag { position: static; margin-left: 4px; }
.tag-ico { width: 16px; height: auto; }
.tag-green { background: var(--green); }
.tag-red { background: var(--red); }
.tag-blue { background: var(--blue); }
.tag-gold { background: var(--gold); }
.tag-purple { background: var(--purple); }

/* ---------- pixel buttons ---------- */
.pbtn {
  font-family: var(--label); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .1em;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px; border: 3px solid var(--ink); cursor: pointer; text-decoration: none;
  color: var(--ink); background: var(--cream);
  box-shadow: inset 0 -4px 0 rgba(0,0,0,.18), 3px 3px 0 rgba(0,0,0,.35);
  transition: transform .05s;
}
.pbtn:active { transform: translate(2px, 2px); box-shadow: inset 0 -2px 0 rgba(0,0,0,.18), 1px 1px 0 rgba(0,0,0,.35); }
.pbtn-red { background: var(--red); color: #fff; }
.pbtn-gold { background: var(--gold); }
.pbtn-blue { background: var(--blue); color: #fff; }
.pbtn-cream { background: var(--cream); }
.pbtn.full { width: 100%; }
.pbtn.grow { flex: 1; }
.pbtn.sq { width: 56px; font-size: 16px; padding: 8px; }

/* ---------- field layout ---------- */
.view-field > *, .launch-grid > * { min-width: 0; }
.view-field { grid-template-columns: 290px minmax(0, 1fr); gap: 26px; align-items: start; }
.view-field .side .panel:first-child { margin-top: 0; }
.side .logo-slot { margin-bottom: 18px; }
.coin-head { display: flex; gap: 14px; align-items: center; }
.coin-pic { width: 72px; height: 72px; background: var(--red); border: 3px solid var(--ink); display: grid; place-items: center; flex: none; }
.coin-pic img { width: 56px; }
.coin-meta { flex: 1; }
.lv { font-family: var(--label); font-size: 12px; }
.lv b { font-family: var(--body); font-size: 22px; margin-left: 6px; }
.xp { display: flex; align-items: center; gap: 8px; font-family: var(--label); font-size: 11px; }
.bar { flex: 1; height: 12px; border: 2px solid var(--ink); background: #3a2b2b; }
.bar i { display: block; height: 100%; background: var(--red); width: 70%; transition: width .4s; }
.ca-row { display: flex; gap: 8px; }
.ca { flex: 1; font-family: var(--mono); font-size: 11px; word-break: break-all; background: var(--cream-2); border: 3px solid var(--ink); padding: 8px; }
.btn-row { display: flex; gap: 10px; margin-top: 10px; }

.menu { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; }
.menu li { display: flex; gap: 10px; }
.menu a {
  flex: 1; text-decoration: none; font-family: var(--label); font-weight: 700; font-size: 13px; letter-spacing: .12em; text-transform: uppercase;
  border: 3px solid var(--ink); padding: 6px 12px; background: var(--cream);
  box-shadow: inset 0 -4px 0 var(--cream-2);
}
.menu a.active { background: var(--green); color: #fff; box-shadow: inset 0 -4px 0 #1f8a37; }
.menu kbd { font-family: var(--label); font-weight: 700; width: 36px; display: grid; place-items: center; background: var(--gold); border: 3px solid var(--ink); }

.stage .scene-panel { margin-top: 8px; padding: 10px; }
.scene-wrap { position: relative; border: 3px solid var(--ink); }
#scene { display: block; width: 100%; height: auto; cursor: pointer; }
.scene-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 8px; font-size: 13px; }
.legend { display: flex; gap: 14px; }
.legend img { width: 18px; vertical-align: middle; }
.status { font-family: var(--label); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; }
.hint { color: #9fb0c8; font-size: 13px; margin: -16px 0 0 4px; }
.host-pop {
  position: absolute; min-width: 200px; max-width: 260px;
  background: var(--cream); border: 3px solid var(--ink); padding: 10px 12px; font-size: 13px;
  box-shadow: 4px 4px 0 rgba(0,0,0,.4); pointer-events: none;
}
.host-pop b { font-family: var(--label); }
.host-pop ul { margin: 6px 0 0; padding-left: 16px; }

/* ---------- forms ---------- */
.lbl { display: block; font-family: var(--label); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .12em; margin: 14px 0 6px; }
input[type=text], input:not([type]), input[type=number] {
  width: 100%; font-family: var(--mono); font-size: 13px;
  background: var(--cream-2); border: 3px solid var(--ink); padding: 10px 12px; color: var(--ink);
}
input:focus { outline: 3px solid var(--gold); outline-offset: 0; }
.launch-grid { display: grid; grid-template-columns: 1fr 300px; gap: 26px; align-items: start; }
.launch-grid > .panel { margin-bottom: 0; }
.launch-side .panel:first-child { margin-top: 22px; }
.pic-row { display: flex; gap: 16px; align-items: flex-start; }
.pic-box { width: 100px; height: 100px; border: 3px solid var(--ink); background: var(--cream-2); display: grid; place-items: center; overflow: hidden; flex: none; }
.pic-box img { width: 56px; }
.pic-box img.custom { width: 100%; height: 100%; object-fit: cover; }
.pic-row .lbl { margin-top: 4px; }
.file-btn { cursor: pointer; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.host-pick { display: flex; gap: 12px; flex-wrap: wrap; }
.host-card {
  width: 130px; border: 3px solid var(--ink); background: var(--cream); padding: 8px; text-align: center; cursor: pointer;
  box-shadow: inset 0 -4px 0 var(--cream-2); font-family: var(--body);
}
.host-card img { width: 80px; display: block; margin: 0 auto 4px; }
.host-card b { display: block; font-family: var(--label); font-size: 12px; letter-spacing: .1em; }
.host-card small { color: var(--muted); }
.host-card.sel { background: #d9f7df; outline: 3px solid var(--green); }
.first-buy { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.first-buy input { width: 160px; }
.first-buy .lbl { margin: 0; }
.form-msg { min-height: 1.4em; font-size: 13px; color: #1f8a37; margin: 10px 0 0; }
.form-msg.err { color: var(--red); }
.curve { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin: 0 0 10px; }
.curve dt { font-family: var(--label); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; }
.curve dd { margin: 0; font-weight: 600; font-size: 17px; text-align: right; }

/* ---------- stonk cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.scard { display: flex; gap: 10px; border: 3px solid var(--ink); padding: 10px; background: var(--cream); box-shadow: inset 0 -4px 0 var(--cream-2); }
.scard .av { width: 52px; height: 52px; flex: none; display: grid; place-items: center; }
.scard .av img { max-width: 100%; max-height: 100%; }
.scard .av img.custom { width: 52px; height: 52px; object-fit: cover; border: 2px solid var(--ink); }
.scard .info { flex: 1; min-width: 0; font-size: 12px; }
.scard .tk { font-family: var(--label); font-weight: 700; font-size: 15px; }
.stage-badge { display: inline-block; font-family: var(--label); font-weight: 700; font-size: 10px; text-transform: uppercase; color: #fff; padding: 0 6px; margin-right: 6px; }
.stage-calf { background: #6fae3f; }
.stage-yearling { background: var(--green); }
.stage-bull { background: #d99a00; }
.stage-voting { background: #a54fd0; }
.stage-curve { background: #7a7a7a; }
.mini { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-family: var(--label); font-size: 10px; text-transform: uppercase; }
.mini .bar { height: 10px; background: #333; }
.mini .bar i { background: var(--green); }
.empty { color: var(--muted); font-size: 13px; }

/* ---------- check ---------- */
.check-row { display: flex; gap: 12px; }
.check-row input { flex: 1; }
.result-line { display: flex; align-items: center; gap: 14px; font-size: 17px; }
.result-line img { width: 96px; flex: none; }

/* ---------- docs ---------- */
.docs h2 { font-family: var(--label); font-size: 18px; text-transform: uppercase; letter-spacing: .08em; margin: 22px 0 6px; }
.docs h2:first-of-type { margin-top: 4px; }
.docs ul { padding-left: 20px; }
.stages { list-style: none; padding: 0 !important; }
.stages li { display: flex; align-items: center; gap: 10px; margin: 6px 0; }
.stages img { width: 28px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--cream); font-family: var(--label); font-size: 13px;
  padding: 10px 18px; border: 3px solid var(--gold); z-index: 50; max-width: calc(100% - 32px);
}

/* ---------- responsive ---------- */
/* ---------- field extras ---------- */
.field-under { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 8px; }
.field-under .panel { margin-bottom: 0; }
.feed { list-style: none; margin: 0; padding: 0; font-size: 13px; max-height: 230px; overflow-y: auto; }
.feed li { padding: 5px 0; border-bottom: 2px dashed var(--cream-2); }
.feed time { font-family: var(--label); font-size: 10px; color: var(--muted); margin-right: 6px; }
.vote { border: 3px solid var(--ink); background: #f6efff; padding: 10px; margin-bottom: 10px; }
.vote-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.vote-head b { font-family: var(--label); font-size: 14px; }
.vote-clock { font-family: var(--pix); font-size: 13px; }
.vote-tier { font-family: var(--label); font-weight: 700; font-size: 10px; background: #e0a100; color: #fff; padding: 1px 6px; text-transform: uppercase; }
.vote-row { display: grid; grid-template-columns: 64px 1fr 40px 64px; align-items: center; gap: 8px; margin-top: 6px; font-size: 12px; }
.vote-row img { width: 56px; }
.vote-row .bar { height: 12px; background: #333; }
.vote-row .bar i { background: #d36bf0; }
.vote-row button { font-size: 10px; padding: 4px 6px; }
.empty-vote { color: var(--muted); font-size: 13px; }

/* ---------- launch extras ---------- */
.tx { border: 3px solid var(--ink); background: var(--cream); padding: 12px; margin-bottom: 16px; }
.tx-head { font-family: var(--label); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: #fff; background: var(--blue); display: inline-block; padding: 2px 8px; margin-bottom: 8px; }
.tx-row { border: 3px solid var(--ink); background: var(--cream-2); padding: 8px 10px; margin-bottom: 8px; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.tx-row img { width: 18px; }
.tx-row b { font-family: var(--label); letter-spacing: .06em; }
.tx-note { font-family: var(--label); font-weight: 700; color: var(--red); text-transform: uppercase; letter-spacing: .1em; font-size: 12px; }
.split { display: grid; gap: 8px; margin-bottom: 8px; }
.split-row { display: grid; grid-template-columns: 22px 64px 40px 1fr; align-items: center; gap: 8px; font-size: 12px; }
.split-row .nm { font-family: var(--label); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: 11px; }
.split-row .pc { font-weight: 600; font-size: 15px; }
.split-row .bar { height: 12px; background: #333; }
.split-row small { grid-column: 3 / -1; color: var(--muted); margin-top: -4px; }
.curve-chart { display: flex; align-items: flex-end; gap: 2px; height: 70px; border-left: 3px solid var(--ink); border-bottom: 3px solid var(--ink); padding: 0 4px; margin-bottom: 12px; }
.curve-chart i { flex: 1; background: var(--gold); }

/* ---------- docs extras ---------- */
.docs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 0 26px; }
.docs-grid .panel { margin-bottom: 14px; }
.life { list-style: none; padding: 0; margin: 12px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 10px; }
.life li { border: 3px solid var(--ink); background: var(--cream-2); padding: 8px 10px; font-size: 12px; position: relative; }
.life li b { display: block; font-family: var(--label); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 2px; }
.life li img { height: 22px; display: block; margin-bottom: 4px; }
.flow { display: flex; align-items: stretch; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.flow-box { border: 3px solid var(--ink); background: var(--cream-2); padding: 8px; text-align: center; min-width: 86px; flex: 1; }
.flow-box b { display: block; font-size: 20px; }
.flow-box small { display: block; color: var(--muted); font-size: 11px; }
.flow-box span { font-family: var(--label); font-size: 10px; text-transform: uppercase; font-weight: 700; }
.flow-arrow { align-self: center; font-family: var(--pix); }
.tiers { width: 100%; border-collapse: collapse; font-size: 13px; }
.tiers td { padding: 4px 6px; border-bottom: 2px dashed var(--cream-2); }
.tier-img { width: 72px; }
.oracle { display: flex; align-items: flex-end; gap: 6px; height: 64px; border-bottom: 3px solid var(--ink); padding: 0 6px; position: relative; }
.oracle i { flex: 1; height: 70%; background: var(--blue); }
.oracle i:nth-child(2n) { height: 74%; }
.oracle i.spike { height: 100%; background: repeating-linear-gradient(0deg, var(--blue) 0 4px, #8ab9e8 4px 8px); }
.oracle::after { content: ""; position: absolute; left: 0; right: 0; top: 24%; border-top: 2px dashed var(--red); }
.admin { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin: 0 0 10px; align-items: center; }
.admin dt { font-family: var(--label); font-weight: 700; text-transform: uppercase; letter-spacing: .1em; font-size: 12px; }
.admin dd { margin: 0; background: var(--red); color: #fff; font-family: var(--label); font-weight: 700; font-size: 11px; padding: 2px 8px; text-transform: uppercase; }

@media (max-width: 900px) {
  .field-under { grid-template-columns: 1fr; }
  .view-field { grid-template-columns: minmax(0, 1fr); }
  body[data-view="field"] .view-field .stage { order: -1; }
  .launch-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .grid2 { grid-template-columns: 1fr; }
  .check-row { flex-direction: column; }
  .topnav a { padding: 6px 10px; font-size: 11px; }
}
