:root {
  --bg: #15110c;
  --bg2: #1d1812;
  --card: #221c15;
  --line: #3a3026;
  --ink: #f6eee2;
  --muted: #a99a86;
  --gold: #f0b54a;
  --gold-ink: #2a1b05;
  --ember: #ff7a3d;
  --ok: #7ed49a;
  --bad: #ff8a7a;
  --radius: 18px;
  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --body: "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background:
    radial-gradient(1200px 600px at 50% -200px, #3a2710 0%, transparent 70%),
    var(--bg);
  color: var(--ink);
  font: 15px/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); }

.top {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1040px; margin: 0 auto; padding: 18px 16px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font: 800 19px var(--display); }
.brand em { color: var(--muted); font-style: normal; font-weight: 600; }
.brand:hover { text-decoration: none; }

main { max-width: 1040px; margin: 0 auto; padding: 0 16px 40px; }

.btn {
  font: 600 14px var(--body); color: var(--ink);
  background: var(--bg2); border: 1px solid var(--line); border-radius: 999px;
  padding: 9px 16px; cursor: pointer; transition: border-color .15s, transform .05s;
}
.btn:hover { border-color: var(--gold); }
.btn:active { transform: translateY(1px); }
.btn-ghost { background: transparent; }
.btn-big {
  width: 100%; padding: 17px 20px; font: 800 19px var(--display);
  background: var(--gold); color: var(--gold-ink); border: 0; border-radius: 14px;
  box-shadow: 0 8px 30px -10px #f0b54a88;
}
.btn-big:hover { filter: brightness(1.06); }
.btn[disabled] { opacity: .55; cursor: not-allowed; filter: none; box-shadow: none; }
#walletBtn.connected { border-color: var(--gold); font-family: var(--mono); font-size: 13px; }

.hero { text-align: center; padding: 18px 0 8px; }
.eyebrow {
  display: inline-block; margin: 0 0 10px; padding: 4px 12px; border-radius: 999px;
  background: #f0b54a1f; color: var(--gold); font-weight: 600; font-size: 13px;
}
.eyebrow.won { background: #7ed49a22; color: var(--ok); }
h1 {
  font: 800 clamp(28px, 5vw, 46px)/1.08 var(--display); letter-spacing: -.02em;
  margin: 0 auto 26px; max-width: 760px;
}
.hl { color: var(--gold); }

.board {
  display: grid; grid-template-columns: 1.3fr 1fr; gap: 14px; text-align: left;
}
.pot, .clock, .card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px;
}
.pot { background: linear-gradient(160deg, #2d2212, var(--card) 60%); }
.label { color: var(--muted); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.pot-amt { font: 800 clamp(44px, 8vw, 76px)/1 var(--display); margin: 8px 0 12px; letter-spacing: -.03em; }
.pot-amt small { font-size: .32em; color: var(--muted); margin-left: 8px; letter-spacing: 0; }
.holder { color: var(--muted); font-family: var(--mono); font-size: 13px; word-break: break-all; }
.tag { font-family: var(--body); background: var(--gold); color: var(--gold-ink); border-radius: 6px; padding: 1px 7px; font-size: 12px; font-weight: 700; margin-left: 4px; }
.time { font: 700 clamp(34px, 6vw, 52px)/1.1 var(--mono); margin: 10px 0 14px; font-variant-numeric: tabular-nums; }
.time.hot { color: var(--ember); }
.bar { height: 8px; border-radius: 99px; background: #ffffff12; overflow: hidden; }
.bar > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--ember)); transition: width 1s linear; }
.sub { margin-top: 10px; color: var(--muted); font-size: 13px; }

.note {
  margin-top: 14px; padding: 12px 16px; border-radius: 12px; text-align: left;
  background: #7ed49a14; border: 1px solid #7ed49a44; color: var(--ok); font-size: 14px;
}

.take { margin-top: 18px; max-width: 620px; margin-left: auto; margin-right: auto; }
.take-head h2, .card h2 { font: 800 22px var(--display); margin: 0 0 6px; }
.take-head p { margin: 0 0 16px; color: var(--muted); }
.costs { margin: 0 0 18px; }
.costs > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.costs dt { color: var(--muted); }
.costs dd { margin: 0; font-family: var(--mono); font-weight: 500; }
.costs .total { border-bottom: 0; padding-top: 14px; }
.costs .total dt { color: var(--ink); font-weight: 600; }
.costs .total dd { font-size: 20px; font-weight: 700; color: var(--gold); }
.seg { display: inline-flex; background: var(--bg2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg button { font: 600 12px var(--body); color: var(--muted); background: none; border: 0; padding: 6px 11px; border-radius: 999px; cursor: pointer; }
.seg button.on { background: var(--line); color: var(--ink); }
.fine { color: var(--muted); font-size: 12.5px; text-align: center; margin: 12px 0 0; }
.fine.warn { color: #e6b07a; text-align: left; }

.manual { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.manual summary { cursor: pointer; color: var(--muted); font-size: 13.5px; }
.manual ol { padding-left: 20px; color: var(--muted); font-size: 13.5px; }
.manual input, .manual textarea, .copyrow input {
  width: 100%; background: var(--bg); border: 1px solid var(--line); color: var(--ink);
  border-radius: 10px; padding: 10px 12px; font: 13px var(--mono); margin-bottom: 8px; resize: vertical;
}

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; }
.holders { list-style: none; margin: 10px 0 0; padding: 0; }
.holders li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid #ffffff0d; font-size: 13.5px; }
.holders li:last-child { border-bottom: 0; }
.holders .who { font-family: var(--mono); }
.holders .who.me { color: var(--gold); }
.holders .dur { color: var(--muted); white-space: nowrap; }
.record .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 8px; }
.record .stat { background: var(--bg2); border-radius: 12px; padding: 12px; }
.record .stat b { display: block; font: 800 22px var(--display); }
.record .stat span { color: var(--muted); font-size: 12px; }

.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 18px; }
.step { padding: 18px; border-radius: var(--radius); border: 1px solid var(--line); }
.step b { font: 800 16px var(--display); color: var(--gold); }
.step p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }

.faq { margin-top: 18px; }
.faq details { border-top: 1px solid var(--line); padding: 12px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { color: var(--muted); margin: 8px 0 0; }

footer {
  max-width: 1040px; margin: 0 auto; padding: 18px 16px 34px; display: flex; flex-wrap: wrap;
  justify-content: space-between; gap: 8px; color: var(--muted); font-size: 13px;
}
footer a { word-break: break-all; }

dialog {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--ink);
  padding: 0; width: min(440px, calc(100vw - 32px));
}
dialog::backdrop { background: #0009; backdrop-filter: blur(3px); }
.dlg { padding: 20px; }
.dlg header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.dlg h3 { font: 800 20px var(--display); margin: 0; }
.x { background: none; border: 0; color: var(--muted); font-size: 26px; cursor: pointer; line-height: 1; }
.qr { display: grid; place-items: center; min-height: 280px; background: #fff; border-radius: 14px; margin: 12px 0; }
.qr img { width: 260px; height: 260px; image-rendering: pixelated; }
.copyrow { display: flex; gap: 8px; }
.copyrow input { margin: 0; }
.addr { word-break: break-all; background: var(--bg2); padding: 10px; border-radius: 10px; font-size: 13px; }
.row { display: flex; gap: 8px; justify-content: flex-end; }
.progress { list-style: none; padding: 0; margin: 14px 0; }
.progress li { padding: 8px 0 8px 30px; position: relative; color: var(--muted); }
.progress li::before { content: ""; position: absolute; left: 4px; top: 13px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line); }
.progress li.active { color: var(--ink); }
.progress li.active::before { border-color: var(--gold); border-top-color: transparent; animation: spin 0.8s linear infinite; }
.progress li.done { color: var(--ink); }
.progress li.done::before { background: var(--ok); border-color: var(--ok); }
.progress li.fail::before { background: var(--bad); border-color: var(--bad); }
.msg { margin: 0; font-size: 14px; }
.msg.err { color: var(--bad); }
.msg.ok { color: var(--ok); }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 760px) {
  .board, .grid2, .how { grid-template-columns: 1fr; }
  .record .stats { grid-template-columns: 1fr 1fr 1fr; }
  .costs > div { flex-wrap: wrap; }
}
