:root {
  --bg: #0c0b09;
  --bg-2: #13110e;
  --paper: #ece7dc;
  --muted: #8d877b;
  --line: #2a2722;
  --line-2: #3a362f;
  --long: #3f8a62;
  --long-2: #b7e0c8;
  --long-bg: #101812;
  --short: #c24b40;
  --short-2: #f0b8b2;
  --short-bg: #1a1110;
  --brass: #d4b483;
  --warn: #d7a04a;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--paper);
  font-family: Outfit, sans-serif;
  font-weight: 380;
  letter-spacing: 0.01em;
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; }

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.top {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 8;
  background: rgba(12, 11, 9, 0.92);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  background: none;
  border: 0;
  padding: 0;
}
.brand-mark {
  font-family: Newsreader, serif;
  font-size: 28px;
  font-weight: 650;
  letter-spacing: -0.03em;
}
.brand-sub {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav { display: flex; gap: 4px; }
.nav button {
  background: none;
  border: 0;
  color: var(--muted);
  padding: 8px 12px;
}
.nav button.on, .nav button:hover { color: var(--paper); }

.tape {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 18px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  color: var(--muted);
}
.tape b { color: var(--paper); font-weight: 500; }
.up { color: var(--long-2); }
.down { color: var(--short-2); }

.wallet {
  border: 1px solid var(--line-2);
  background: transparent;
  padding: 8px 12px;
  font-size: 13px;
}
.wallet:hover { border-color: var(--brass); color: var(--brass); }

.page {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 180px;
}
.desk, .notice, .camps, .settle {
  scroll-margin-bottom: 88px;
}
.hidden { display: none !important; }

.hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 18px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.ca-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 22px;
  border-bottom: 1px solid var(--line);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.ca-bar button {
  border: 0;
  background: transparent;
  color: var(--brass);
  padding: 0;
  word-break: break-all;
  text-align: left;
}
.ca-bar button:hover { color: var(--paper); }

.kicker {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.px {
  font-family: Newsreader, serif;
  font-size: clamp(42px, 6vw, 72px);
  line-height: 0.92;
  letter-spacing: -0.04em;
}
.px-sub {
  margin-top: 10px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 14px;
}
.stat .px { font-size: clamp(36px, 4.4vw, 52px); }

.war { margin: 22px 0 8px; }
.war-meta {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}
.bar {
  height: 10px;
  display: flex;
  overflow: hidden;
  background: #1b1915;
}
.bar .l { background: var(--long); }
.bar .s { background: var(--short); }

.camps {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 18px;
}
.camp {
  border: 1px solid var(--line);
  padding: 22px;
  min-height: 320px;
  display: flex;
  flex-direction: column;
}
.camp.long { background: linear-gradient(180deg, var(--long-bg), var(--bg)); }
.camp.short { background: linear-gradient(180deg, var(--short-bg), var(--bg)); }
.camp h2 {
  font-family: Newsreader, serif;
  font-weight: 560;
  font-size: 34px;
  margin: 0 0 6px;
  letter-spacing: -0.03em;
}
.hint { color: var(--muted); font-size: 13px; line-height: 1.5; }
.camp-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 22px 0;
}
.camp-stats span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.camp-stats b {
  font-family: "IBM Plex Mono", monospace;
  font-size: 18px;
  font-weight: 500;
}

.field {
  display: flex;
  gap: 8px;
  margin-top: auto;
}
.field input {
  flex: 1;
  background: #0a0908;
  border: 1px solid var(--line-2);
  padding: 10px 12px;
  outline: none;
}
.field input:focus { border-color: var(--brass); }
.btn {
  border: 1px solid var(--line-2);
  background: transparent;
  padding: 10px 14px;
  white-space: nowrap;
}
.btn:hover { border-color: var(--paper); }
.btn.long { border-color: var(--long); color: var(--long-2); }
.btn.long:hover { background: var(--long); color: #08110c; }
.btn.short { border-color: var(--short); color: var(--short-2); }
.btn.short:hover { background: var(--short); color: #1a0808; }
.btn.brass { border-color: var(--brass); color: var(--brass); }
.btn.brass:hover { background: var(--brass); color: #1a140c; }
.btn.ghost { color: var(--muted); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
a.btn {
  text-decoration: none;
  text-align: center;
}
.mono {
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  color: var(--brass);
  word-break: break-all;
}

.chart-box {
  margin-top: 22px;
  border: 1px solid var(--line);
  padding: 16px 16px 8px;
}
.chart-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.legend { display: flex; gap: 16px; }
.legend i {
  display: inline-block;
  width: 18px;
  height: 2px;
  margin-right: 6px;
  vertical-align: middle;
}
.legend .nv { background: var(--brass); }
.legend .sd { background: var(--paper); }

.desk {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
}
.panel {
  border: 1px solid var(--line);
  padding: 20px;
}
.panel h3 {
  margin: 0 0 14px;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 460;
}
.rows { display: grid; gap: 10px; }
.row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}
.row span { color: var(--muted); }
.row b { font-family: "IBM Plex Mono", monospace; font-weight: 500; }

.notice {
  margin-top: 16px;
  padding: 14px 16px;
  border-left: 2px solid var(--brass);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.rules {
  width: min(820px, calc(100% - 40px));
  margin: 0 auto;
  padding: 36px 0 180px;
}
.rules h1, .display {
  font-family: Newsreader, serif;
  font-size: clamp(40px, 6vw, 64px);
  font-weight: 560;
  letter-spacing: -0.04em;
  margin: 0 0 8px;
}
.rules .lede {
  font-family: Newsreader, serif;
  font-size: 22px;
  line-height: 1.35;
  color: #cfc8b8;
  margin: 0 0 36px;
}
.rules h2 {
  font-family: Newsreader, serif;
  font-size: 28px;
  font-weight: 560;
  margin: 36px 0 10px;
  letter-spacing: -0.03em;
}
.rules p, .rules li { color: #c9c3b6; line-height: 1.7; font-size: 16px; }
.rules ol, .rules ul { padding-left: 1.2em; }
.rules li { margin: 6px 0; }
.rules table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 8px;
  font-size: 14px;
}
.rules th, .rules td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
}
.rules th {
  color: var(--muted);
  font-weight: 460;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.example {
  border: 1px solid var(--line);
  padding: 16px 18px;
  background: var(--bg-2);
  margin: 12px 0;
}
.example b { color: var(--paper); }

.hist { width: 100%; border-collapse: collapse; }
.hist th, .hist td {
  text-align: left;
  padding: 12px 8px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.hist th {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 460;
}
.hist td { font-family: "IBM Plex Mono", monospace; }
.tag {
  display: inline-block;
  padding: 2px 7px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: Outfit, sans-serif;
}
.tag.long { color: var(--long-2); border: 1px solid var(--long); }
.tag.short { color: var(--short-2); border: 1px solid var(--short); }
.tag.push { color: var(--muted); border: 1px solid var(--line-2); }

.demo {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 16px;
  background: #16130f;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
  z-index: 9;
}
.demo strong { color: var(--brass); font-weight: 520; }
.demo button {
  border: 1px solid var(--line-2);
  background: transparent;
  padding: 6px 10px;
  font-size: 12px;
}
.demo button.on { border-color: var(--brass); color: var(--brass); }

.toast {
  position: fixed;
  top: 78px;
  right: 20px;
  max-width: 360px;
  padding: 12px 14px;
  background: #1b1814;
  border: 1px solid var(--line-2);
  z-index: 12;
  font-size: 14px;
}
.toast.warn { border-color: var(--warn); }

.settle {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--brass);
  background: #18140e;
}
.settle h2 {
  font-family: Newsreader, serif;
  margin: 0 0 8px;
  font-size: 28px;
}

.gate {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 32px;
}
.gate[hidden] { display: none; }
.gate-inner { width: min(560px, 100%); }
.gate h1 {
  font-family: Newsreader, serif;
  font-size: clamp(56px, 10vw, 88px);
  font-weight: 560;
  letter-spacing: -0.05em;
  margin: 8px 0 16px;
}
.gate p {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.5;
  margin: 0;
}
.gate-url {
  margin-top: 28px !important;
  color: var(--brass) !important;
  font-family: "IBM Plex Mono", monospace;
  font-size: 14px !important;
  letter-spacing: 0.08em;
}
body.is-paused .app,
body.is-paused .demo,
body.is-paused .toast { display: none !important; }

@media (max-width: 860px) {
  .top { flex-wrap: wrap; gap: 12px; padding: 14px 16px; }
  .tape { margin-left: 0; width: 100%; justify-content: space-between; }
  .hero, .camps, .desk { grid-template-columns: 1fr; }
  .page { width: calc(100% - 28px); }
  .px { font-size: 48px; }
}
