:root {
  --bg: #f07822;
  --paper: #ffd4a8;
  --cream: #fff4e8;
  --ink: #111111;
  --muted: #4a3018;
  --line: #111111;
  --orange: #f07822;
  --orange-soft: #ffc48a;
  --link: #111111;
  --panel: #fff4e8;
  --red: #d7263d;
  --font-display: "Archivo Black", sans-serif;
  --font-body: "IBM Plex Sans", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;
  --max: 1080px;
  --radius: 2px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; height: auto; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input { font: inherit; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 300;
  background: var(--ink);
  color: var(--cream);
  padding: 0.5rem 0.9rem;
  font-weight: 600;
}
.skip:focus { top: 0.75rem; }

.paper {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(17, 17, 17, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 17, 17, 0.05) 1px, transparent 1px);
  background-size: 28px 28px;
}

.nav, main, footer { width: 100%; }
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.wrap {
  box-sizing: border-box;
  width: 100%;
  max-width: var(--max);
  margin-left: auto;
  margin-right: auto;
  padding-inline: 1.2rem;
}
main > .wrap { align-self: center; }

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(240, 120, 34, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1.5px solid var(--ink);
}
.nav-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 1rem;
}
@media (min-width: 861px) {
  .nav-inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
  }
  .brand { justify-self: start; }
  .nav-links { justify-self: center; }
  .nav-inner > #connectBtn { justify-self: end; }
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.04em;
}
.brand img {
  width: 36px;
  height: 36px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.35rem;
  list-style: none;
  font-size: 0.92rem;
  font-weight: 500;
}
.nav-links a {
  color: var(--ink);
  border-bottom: 2px solid transparent;
  padding-bottom: 2px;
}
.nav-links a:hover,
.nav-links a:focus-visible { border-bottom-color: var(--ink); }
.x-link {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1.5px solid var(--ink) !important;
  background: var(--cream);
  color: var(--ink);
  padding-bottom: 0 !important;
}
.nav-links a.x-link:hover,
.nav-links a.x-link:focus-visible {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink) !important;
  border-bottom-color: var(--ink) !important;
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1.5px solid var(--ink);
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
.nav-toggle span {
  display: block;
  width: 16px;
  height: 2px;
  background: var(--ink);
  transition: transform 0.2s ease;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.15rem;
  border: 1.5px solid var(--ink);
  font-weight: 600;
  font-size: 0.92rem;
  transition: transform 0.12s ease, background 0.15s ease, color 0.15s ease;
}
.btn:active { transform: translate(1px, 1px); }
.btn-ink {
  background: var(--ink);
  color: var(--cream);
}
.btn-ink:hover { background: var(--cream); color: var(--ink); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
}
.btn-ghost:hover { background: var(--ink); color: var(--cream); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.hero { padding: 1.6rem 0 0.4rem; }
.hero-box {
  position: relative;
  overflow: hidden;
  background: var(--panel);
  border: 1.5px solid var(--ink);
  box-shadow: 6px 6px 0 rgba(17, 17, 17, 0.12);
  padding: 1.5rem 1.6rem 1.4rem;
}

.schematic {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(17, 17, 17, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 17, 17, 0.12) 1px, transparent 1px),
    radial-gradient(circle at 78% 72%, transparent 0 38%, rgba(240, 122, 40, 0.18) 38.5% 39%, transparent 40%),
    linear-gradient(18deg, transparent 48%, rgba(17,17,17,0.18) 48.2%, transparent 48.5%),
    linear-gradient(-12deg, transparent 62%, rgba(17, 17, 17, 0.22) 62.2%, transparent 62.6%);
  background-size: 22px 22px, 22px 22px, 100% 100%, 100% 100%, 100% 100%;
}

.hero-top {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1rem;
  align-items: end;
  min-height: 280px;
}
.hero-copy { position: relative; z-index: 1; max-width: 36rem; padding-bottom: 0.4rem; }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  padding: 0.32rem 0.85rem;
  background: rgba(255, 255, 255, 0.55);
  margin-bottom: 1.1rem;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 3px var(--orange-soft);
  animation: pulse 1.6s infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5.4vw, 3.35rem);
  line-height: 0.98;
  letter-spacing: -0.02em;
  margin-bottom: 0.9rem;
}
.lede {
  font-size: 1.02rem;
  color: var(--muted);
  max-width: 34rem;
}
.lede strong, .lede em { color: var(--ink); font-style: normal; font-weight: 700; }

.note {
  position: relative;
  margin-top: 1.15rem;
  padding-left: 0.85rem;
  font-size: 0.82rem;
  color: var(--muted);
  max-width: 28rem;
}
.note::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.15rem;
  bottom: 0.15rem;
  width: 3px;
  background: var(--orange);
}

.hero-mascot {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  pointer-events: none;
}
.hero-mascot img {
  width: min(420px, 100%);
  height: auto;
  margin-right: -1.4rem;
  margin-bottom: -1.6rem;
  filter: drop-shadow(8px 10px 0 rgba(17, 17, 17, 0.08));
}

.hero-metrics {
  position: relative;
  z-index: 2;
  margin-top: 0.4rem;
  padding-top: 1.1rem;
  border-top: 1.5px solid var(--ink);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem 1.2rem;
  align-items: end;
}
.metric-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.2rem;
}
.pot-value {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 3.8rem);
  line-height: 1;
  letter-spacing: -0.03em;
}
.pot-value small {
  font-family: var(--font-mono);
  font-size: 0.32em;
  font-weight: 500;
  letter-spacing: 0;
  margin-left: 0.35em;
  color: var(--muted);
}

.clock {
  display: flex;
  justify-content: flex-end;
  gap: 0.45rem;
  grid-column: 2;
  grid-row: 1;
}
.clock-cell {
  min-width: 72px;
  padding: 0.55rem 0.4rem 0.45rem;
  border: 1.5px solid var(--ink);
  background: #fff;
  text-align: center;
}
.clock-cell b {
  display: block;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1.7rem;
  font-variant-numeric: tabular-nums;
}
.clock-cell span {
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}
.clock.ending .clock-cell {
  border-color: var(--red);
  color: var(--red);
}
.clock.ending .clock-cell b { animation: flash 1s steps(2) infinite; }
@keyframes flash { 50% { opacity: 0.4; } }

.clock-meta {
  grid-column: 1 / -1;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
}
.king {
  grid-column: 1 / -1;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--muted);
}
.king b { color: var(--ink); }
.king.you b { color: var(--ink); }

.board-section { margin: 1.4rem auto 0; }
.panel {
  background: var(--panel);
  border: 1.5px solid var(--ink);
  box-shadow: 5px 5px 0 rgba(17, 17, 17, 0.1);
  padding: 1.35rem 1.4rem;
}
.panel-head { margin-bottom: 0.9rem; }
.panel-head h2,
.how h2,
.lore h2 {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  margin-bottom: 0.35rem;
}
.panel-head p { color: var(--muted); font-size: 0.92rem; max-width: 40rem; }

.podium {
  list-style: none;
  margin: 0;
  padding: 0;
}
.podium li {
  display: grid;
  grid-template-columns: 2rem 1fr auto;
  gap: 0.6rem;
  align-items: center;
  padding: 0.55rem 0.7rem;
  border: 1.5px solid var(--ink);
  margin-bottom: 0.4rem;
  background: #fff;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}
.podium .place { color: var(--orange); font-weight: 600; }
.podium .cut { color: var(--ink); font-weight: 600; }
.podium li.you { background: var(--orange-soft); }
.podium li.empty {
  display: block;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
  background: var(--paper);
}

.field {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: #fff;
  border: 1.5px solid var(--ink);
  padding: 0.5rem 0.6rem 0.5rem 1rem;
}
.field input {
  flex: 1;
  background: none;
  border: none;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 1.35rem;
  outline: none;
  width: 100%;
  min-width: 0;
}
.field .unit { color: var(--muted); font-family: var(--font-mono); font-weight: 600; }
.chip {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink);
  border: 1.5px solid var(--ink);
  padding: 0.3rem 0.5rem;
  background: var(--paper);
}
.chip:hover { background: var(--ink); color: var(--cream); }
.preview {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--muted);
  padding: 0.45rem 0;
}
.preview b { color: var(--ink); }

.grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 1.1rem;
  width: 100%;
  margin: 1.4rem auto 2rem;
  justify-content: center;
}
.card {
  background: var(--panel);
  border: 1.5px solid var(--ink);
  box-shadow: 5px 5px 0 rgba(17, 17, 17, 0.1);
  padding: 1.4rem;
  text-align: left;
}
.card h3 {
  font-family: var(--font-display);
  font-size: 1.18rem;
  margin-bottom: 0.35rem;
}
.card .sub { color: var(--muted); font-size: 0.88rem; margin-bottom: 1.1rem; }

.big-buy { width: 100%; justify-content: center; margin-top: 1.1rem; padding: 0.95rem; font-size: 1.02rem; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 0.22rem 0.55rem;
  border: 1.5px solid var(--ink);
  color: var(--muted);
  background: #fff;
}
.status-pill.king {
  color: #fff;
  background: var(--orange);
  border-color: var(--ink);
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.62rem 0;
  border-bottom: 1px dashed rgba(17, 17, 17, 0.28);
  gap: 1rem;
}
.stat-row:last-child { border-bottom: none; }
.stat-row span { color: var(--muted); font-size: 0.88rem; }
.stat-row b {
  font-family: var(--font-mono);
  font-size: 1.02rem;
  font-variant-numeric: tabular-nums;
}
.stat-row b.green { color: var(--ink); }

.actions { display: grid; grid-template-columns: 1fr; gap: 0.55rem; margin-top: 1.1rem; }
.actions .btn { justify-content: center; }

.strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.8rem;
  width: 100%;
  margin: 1.2rem auto 0;
}
.strip .cell {
  background: var(--panel);
  border: 1.5px solid var(--ink);
  padding: 1rem 0.7rem;
  text-align: center;
}
.strip .cell b {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-variant-numeric: tabular-nums;
}
.strip .cell span {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.how { width: 100%; margin: 2.4rem auto 1.4rem; text-align: center; }
.how .lead { text-align: center; color: var(--muted); max-width: 620px; margin: 0 auto 1.6rem; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.85rem; text-align: left; }
.step {
  background: var(--panel);
  border: 1.5px solid var(--ink);
  padding: 1.25rem;
}
.step .n {
  font-family: var(--font-mono);
  color: var(--orange);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}
.step h4 {
  font-family: var(--font-display);
  margin: 0.4rem 0;
}
.step p { color: var(--muted); font-size: 0.9rem; }

.splits { margin: 1.8rem auto 0; overflow-x: auto; text-align: left; border: 1.5px solid var(--ink); background: var(--panel); }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 460px; }
th, td { text-align: left; padding: 0.75rem 1rem; border-bottom: 1px solid rgba(17, 17, 17, 0.18); }
th {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  background: var(--paper);
}
td.pct { font-family: var(--font-mono); color: var(--ink); font-weight: 600; }
tr:last-child td { border-bottom: none; }

.lore { width: 100%; margin: 0 auto 2.6rem; }
.lore-panel h2 { margin-bottom: 0.7rem; }
.lore-panel p { color: var(--muted); margin-bottom: 0.75rem; max-width: 46rem; }
.lore-facts {
  margin-top: 1rem;
  padding-left: 1.1rem;
  color: var(--muted);
}
.lore-facts li { margin-bottom: 0.55rem; }
.lore-facts b { color: var(--ink); }
.lore-facts a { color: var(--ink); border-bottom: 1px solid var(--ink); }
.lore-facts code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--paper);
  border: 1px solid rgba(17, 17, 17, 0.2);
  padding: 0.05rem 0.3rem;
}

footer {
  border-top: 1.5px solid var(--ink);
  margin-top: auto;
  padding: 1.6rem 0 2.4rem;
}
.foot-inner {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.2rem 1.8rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}
.foot-inner a:hover { color: var(--ink); border-bottom: 2px solid var(--orange); }
.addr { font-family: var(--font-mono); font-size: 0.78rem; }
.warn { text-align: center; color: var(--muted); font-size: 0.78rem; margin-top: 1.1rem; }
.warn-buy { margin-top: 0.8rem; font-size: 0.78rem; color: var(--muted); }
.warn-buy a { color: var(--ink); border-bottom: 1px solid var(--ink); }
.brand-sm { font-size: 1rem; }
.brand-sm img { width: 24px; height: 24px; }
.foot-links { display: flex; gap: 1.1rem; }
.end-btn { width: 100%; }
.is-hidden { display: none !important; }
.noscript { padding: 1rem; }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  background: var(--ink);
  color: var(--cream);
  border: 1.5px solid var(--ink);
  padding: 0.8rem 1.2rem;
  font-size: 0.9rem;
  z-index: 200;
  transition: transform 0.3s cubic-bezier(0.2, 1, 0.3, 1);
  max-width: min(90vw, 420px);
  text-align: center;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--red); color: #fff; }
.badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--orange);
  border: 1.5px solid var(--ink);
  padding: 0.12rem 0.4rem;
  background: #fff;
}

@media (max-width: 860px) {
  .grid, .hero-top, .hero-metrics { grid-template-columns: 1fr; }
  .clock { justify-content: flex-start; grid-column: 1; grid-row: auto; }
  .hero-mascot { justify-content: center; }
  .hero-mascot img { margin: 0 auto -1rem; width: min(280px, 70vw); }
}
@media (max-width: 760px) {
  .nav-toggle { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--panel);
    border: 1.5px solid var(--ink);
    padding: 0.4rem;
  }
  .nav-links.open { display: flex; }
  .nav-links a { display: block; padding: 0.75rem 1rem; text-align: center; }
  .nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(3.25px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-3.25px) rotate(-45deg); }
  .strip { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .dot, .clock.ending .clock-cell b { animation: none; }
}
@media (min-width: 861px) {
  .foot-inner { justify-content: space-between; text-align: left; }
}
