:root {
  --bg: #0a0704;
  --bg-elev: #140d05;
  --panel: rgba(28, 19, 8, 0.72);
  --gold: #ffb627;
  --gold-bright: #ffd469;
  --gold-dim: rgba(255, 182, 39, 0.16);
  --ember: #ff5722;
  --ember-soft: rgba(255, 87, 34, 0.5);
  --green: #37e39b;
  --red: #ff4d5e;
  --text: #fdf7ec;
  --muted: #b39b76;
  --line: rgba(255, 182, 39, 0.16);
  --line-strong: rgba(255, 182, 39, 0.34);
  --font-display: "Syne", sans-serif;
  --font-body: "IBM Plex Sans", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;
  --max: 1040px;
  --radius: 14px;
  color-scheme: dark;
}

*, *::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(--text);
  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(--gold); outline-offset: 3px; }

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 300;
  background: var(--gold);
  color: #241500;
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  font-weight: 600;
}
.skip:focus { top: 0.75rem; }

.bg-image {
  position: fixed; inset: 0; z-index: -3;
  background:
    image-set(
      url("../bg.webp") type("image/webp"),
      url("../bg.jpg") type("image/jpeg")
    ) center / cover no-repeat,
    var(--bg);
  opacity: 0.5;
}
.bg-veil {
  position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(255, 87, 34, 0.28), transparent 60%),
    radial-gradient(ellipse 60% 45% at 50% 110%, rgba(255, 182, 39, 0.14), transparent 55%),
    linear-gradient(180deg, rgba(10,7,4,0.55), rgba(10,7,4,0.92));
}
.grain {
  position: fixed; inset: -20%; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  opacity: 0.25;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black 15%, transparent 75%);
  animation: drift 60s linear infinite;
}
@keyframes drift { to { transform: translate(-56px, -56px); } }

.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;
  backdrop-filter: blur(14px);
  background: rgba(10, 7, 4, 0.7);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 66px;
  gap: 1rem;
}
@media (min-width: 761px) {
  .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.6rem;
  font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; letter-spacing: -0.02em;
}
.brand picture { display: contents; }
.brand img { width: 32px; height: 32px; border-radius: 8px; filter: drop-shadow(0 0 12px var(--ember-soft)); }
.brand b { color: var(--gold); }

.nav-links {
  display: flex; align-items: center; gap: 1.6rem;
  list-style: none; font-size: 0.9rem; color: var(--muted);
}
.nav-links a:hover { color: var(--gold-bright); }

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

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.7rem 1.25rem; border-radius: 999px;
  font-weight: 600; font-size: 0.92rem; letter-spacing: 0.01em;
  transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn-gold {
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: #241500;
  box-shadow: 0 6px 24px rgba(255, 182, 39, 0.32), inset 0 1px 0 rgba(255,255,255,0.4);
}
.btn-gold:hover { box-shadow: 0 8px 30px rgba(255, 182, 39, 0.5); }
.btn-ghost { border: 1px solid var(--line-strong); color: var(--text); background: rgba(255,255,255,0.02); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-bright); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.hero { padding: 3rem 0 2rem; text-align: center; }
.eyebrow {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font-family: var(--font-mono); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.18em;
  color: var(--gold); border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 0.35rem 0.9rem; margin-bottom: 1.5rem;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

.pot-stage { position: relative; display: grid; place-items: center; margin: 0.5rem auto 1rem; }
.pot-stage picture { display: contents; }
.pot-img {
  width: min(340px, 62vw); height: auto;
  filter: drop-shadow(0 20px 60px rgba(255, 87, 34, 0.45));
  animation: bob 5s ease-in-out infinite;
}
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.pot-label { font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); margin-top: -0.5rem; }
.pot-value {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(2.8rem, 9vw, 5.5rem); line-height: 1; letter-spacing: -0.03em;
  background: linear-gradient(180deg, #fff5db, var(--gold) 55%, var(--ember));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.pot-value small { font-size: 0.32em; -webkit-text-fill-color: var(--muted); font-family: var(--font-mono); font-weight: 500; letter-spacing: 0; margin-left: 0.3em; }

.clock { display: flex; justify-content: center; gap: 0.6rem; margin: 1.5rem auto 0.5rem; }
.clock-cell {
  min-width: 74px; padding: 0.7rem 0.4rem; border-radius: 12px;
  background: var(--panel); border: 1px solid var(--line-strong);
  backdrop-filter: blur(8px);
  text-align: center;
}
.clock-cell b { display: block; font-family: var(--font-mono); font-weight: 600; font-size: 1.9rem; color: var(--gold-bright); font-variant-numeric: tabular-nums; }
.clock-cell span { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.15em; color: var(--muted); }
.clock.ending .clock-cell b { color: var(--red); animation: flash 1s steps(2) infinite; }
@keyframes flash { 50% { opacity: 0.4; } }
.king { font-family: var(--font-mono); font-size: 0.85rem; color: var(--muted); margin-top: 0.8rem; text-align: center; }
.king b { color: var(--gold-bright); }
.podium-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin: 1.6rem auto 0.6rem;
  text-align: center;
}
.podium {
  list-style: none;
  max-width: 420px;
  margin: 0 auto;
  padding: 0;
  text-align: left;
}
.podium li {
  display: grid;
  grid-template-columns: 2rem 1fr auto;
  gap: 0.6rem;
  align-items: center;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 0.4rem;
  background: var(--panel);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}
.podium .place { color: var(--ember); font-weight: 600; }
.podium .cut { color: var(--gold-bright); }
.podium li.you { border-color: var(--gold); }
.podium li.empty {
  display: block;
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
}

.field { display: flex; align-items: center; gap: 0.45rem; background: #0d0904; border: 1px solid var(--line-strong); border-radius: 12px; padding: 0.5rem 0.6rem 0.5rem 1rem; }
.field input { flex: 1; background: none; border: none; color: var(--text); 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(--gold); border: 1px solid var(--line-strong); border-radius: 8px; padding: 0.3rem 0.5rem; }
.chip:hover { border-color: var(--gold); color: var(--gold-bright); }
.preview { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 0.85rem; color: var(--muted); padding: 0.4rem 0; }
.preview b { color: var(--gold-bright); }

.grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 1.2rem;
  width: 100%;
  margin: 2.5rem auto;
  justify-content: center;
}
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.5rem; backdrop-filter: blur(10px);
  text-align: left;
}
.card h3 { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; margin-bottom: 0.3rem; }
.card .sub { color: var(--muted); font-size: 0.85rem; margin-bottom: 1.2rem; }

.cta-row { display: flex; gap: 0.7rem; justify-content: center; flex-wrap: wrap; margin-top: 1.6rem; }
.cta-row .btn { padding: 0.95rem 1.8rem; font-size: 1.05rem; }

.rule { display: flex; gap: 0.8rem; padding: 0.7rem 0; border-bottom: 1px dashed var(--line); }
.rule:last-of-type { border-bottom: none; }
.rule .ic { font-size: 1.2rem; line-height: 1.4; flex-shrink: 0; }
.rule p { font-size: 0.92rem; color: var(--text); }
.rule p b { color: var(--gold-bright); }
.rule p span { color: var(--muted); }
.big-buy { width: 100%; justify-content: center; margin-top: 1.3rem; padding: 1rem; font-size: 1.05rem; }

.status-pill { display: inline-flex; align-items: center; gap: 0.4rem; font-family: var(--font-mono); font-size: 0.78rem; padding: 0.25rem 0.6rem; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--muted); }
.status-pill.king { color: #241500; background: linear-gradient(180deg, var(--gold-bright), var(--gold)); border-color: transparent; }
.king.you b { color: var(--green); }

.stat-row { display: flex; justify-content: space-between; align-items: baseline; padding: 0.65rem 0; border-bottom: 1px dashed var(--line); 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.05rem; color: var(--gold-bright); font-variant-numeric: tabular-nums; }
.stat-row b.green { color: var(--green); }

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

.strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  width: 100%;
  margin: 1.5rem auto 2.5rem;
}
.strip .cell { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 1.1rem; text-align: center; backdrop-filter: blur(8px); }
.strip .cell b { display: block; font-family: var(--font-mono); font-size: 1.35rem; color: var(--gold-bright); font-variant-numeric: tabular-nums; }
.strip .cell span { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }

.how { width: 100%; margin: 3rem auto; text-align: center; }
.how h2 { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.6rem, 4vw, 2.4rem); text-align: center; margin-bottom: 0.5rem; }
.how .lead { text-align: center; color: var(--muted); max-width: 620px; margin: 0 auto 2rem; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; text-align: left; }
.step { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; backdrop-filter: blur(8px); }
.step .n { font-family: var(--font-mono); color: var(--ember); font-size: 0.8rem; letter-spacing: 0.1em; }
.step h4 { font-family: var(--font-display); font-weight: 700; margin: 0.4rem 0; }
.step p { color: var(--muted); font-size: 0.9rem; }

.splits { margin: 2.5rem auto 0; overflow-x: auto; text-align: left; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 460px; margin-inline: auto; }
th, td { text-align: left; padding: 0.75rem 1rem; border-bottom: 1px solid var(--line); }
th { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }
td.pct { font-family: var(--font-mono); color: var(--gold-bright); }
tr td:first-child { color: var(--text); font-weight: 500; }

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

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(120%);
  background: var(--bg-elev); border: 1px solid var(--line-strong); color: var(--text);
  padding: 0.85rem 1.3rem; border-radius: 12px; font-size: 0.9rem; z-index: 200;
  transition: transform 0.3s cubic-bezier(0.2, 1, 0.3, 1); max-width: min(90vw, 420px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  text-align: center;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.err { border-color: var(--red); color: #ffd7db; }
.badge { font-family: var(--font-mono); font-size: 0.7rem; color: var(--ember); border: 1px solid var(--ember-soft); border-radius: 6px; padding: 0.15rem 0.45rem; }

@media (max-width: 860px) {
  .grid { grid-template-columns: 1fr; }
}
@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: rgba(14, 9, 4, 0.96);
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    padding: 0.4rem;
    backdrop-filter: blur(16px);
  }
  .nav-links.open { display: flex; }
  .nav-links a { display: block; padding: 0.75rem 1rem; border-radius: 8px; text-align: center; }
  .nav-links a:hover { background: var(--gold-dim); }
  .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; }
  .grain, .pot-img, .dot, .clock.ending .clock-cell b { animation: none; }
}

@media (min-width: 861px) {
  .foot-inner { justify-content: space-between; text-align: left; }
}
