:root {
  --bg: #0a0f0a;
  --surface: #101710;
  --surface2: #16201a;
  --surface3: #1d2a1e;
  --border: rgba(120, 200, 120, 0.12);
  --border2: rgba(120, 200, 120, 0.22);
  --text: #e4f0e2;
  --muted: #7d9a7d;
  --muted2: #a7c0a5;
  --pepe: #3fa34d;
  --pepe-bright: #62d16e;
  --pepe-glow: rgba(98, 209, 110, 0.35);
  --eth: #7aa6ff;
  --btc: #f7931a;
  --danger: #ff5d5d;
  --gold: #ffcf4a;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  background: radial-gradient(1200px 700px at 50% -10%, #12210f 0%, var(--bg) 55%) fixed;
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  line-height: 1.55;
  min-height: 100vh;
}
a { color: var(--pepe-bright); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1000px; margin: 0 auto; padding: 0 20px; }

header.site {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; max-width: 1000px; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -0.02em; font-size: 18px; }
.brand .logo { font-size: 22px; filter: drop-shadow(0 0 8px var(--pepe-glow)); }
.brand small { color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; }
.nav-links { display: flex; gap: 18px; font-size: 14px; font-weight: 600; }
.nav-links a { color: var(--muted2); }

/* Hero */
.hero { text-align: center; padding: 40px 0 36px; }
.pond-emoji { font-size: 30px; letter-spacing: 6px; margin-bottom: 14px; height: 40px; }
.pond-emoji .frog { display: inline-block; animation: hop 1.6s ease-in-out infinite; }
.pond-emoji .lily { opacity: 0.85; }
@keyframes hop {
  0%, 100% { transform: translateY(0); }
  40% { transform: translateY(-16px) rotate(-6deg); }
  60% { transform: translateY(-16px) rotate(6deg); }
}
.hero h1 {
  font-size: clamp(38px, 7vw, 68px); font-weight: 900; letter-spacing: -0.03em; line-height: 1.02;
  background: linear-gradient(180deg, #fff, var(--pepe-bright));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .tag { color: var(--muted2); font-size: clamp(15px, 2.5vw, 19px); margin-top: 18px; max-width: 560px; margin-left: auto; margin-right: auto; }
.hero .tag b { color: var(--text); }
.hero .tag-sub { color: var(--pepe-bright); font-weight: 700; font-size: 14px; letter-spacing: 0.02em; margin-top: 10px; }
.cta-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 30px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  border: 1px solid var(--border2); background: var(--surface2); color: var(--text);
  font-weight: 700; font-size: 15px; padding: 13px 22px; border-radius: 12px;
  transition: transform 0.08s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn-primary {
  background: linear-gradient(180deg, var(--pepe-bright), var(--pepe));
  color: #06210a; border-color: transparent; box-shadow: 0 8px 24px -8px var(--pepe-glow);
}
.btn-primary:hover { box-shadow: 0 12px 30px -6px var(--pepe-glow); }
.btn-ghost { background: transparent; }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 40px 0; }
.step {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 22px;
}
.step .n {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: var(--surface3); color: var(--pepe-bright); font-weight: 800; font-size: 14px; margin-bottom: 12px;
}
.step h3 { font-size: 16px; margin-bottom: 6px; }
.step p { color: var(--muted); font-size: 13.5px; }

/* Fairness strip */
.fair {
  display: flex; gap: 14px; align-items: flex-start; background: var(--surface);
  border: 1px solid var(--border); border-left: 3px solid var(--pepe); border-radius: 14px;
  padding: 20px 22px; margin: 12px 0 48px;
}
.fair .ico { font-size: 26px; }
.fair h3 { font-size: 16px; margin-bottom: 4px; }
.fair p { color: var(--muted2); font-size: 13.5px; }

/* Phrase preview */
.phrases { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 8px 0 50px; }
.chip {
  font-size: 12.5px; font-weight: 600; color: var(--muted2);
  border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 6px 13px;
}
.chip.win { color: var(--gold); border-color: rgba(255,207,74,0.4); background: rgba(255,207,74,0.08); }

footer.site { text-align: center; color: var(--muted); font-size: 12.5px; padding: 30px 0 50px; border-top: 1px solid var(--border); }

.section-label { text-align: center; text-transform: uppercase; letter-spacing: 0.16em; font-size: 11px; color: var(--muted); font-weight: 700; margin-bottom: 6px; }

@media (max-width: 720px) {
  .steps { grid-template-columns: 1fr; }
}

/* ── Setup form ── */
.form-wrap { max-width: 680px; padding-bottom: 60px; }
.form-title { font-size: 34px; font-weight: 900; letter-spacing: -0.02em; margin: 18px 0 6px; }
.form-sub { color: var(--muted2); font-size: 14.5px; margin-bottom: 26px; max-width: 600px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 22px; margin-bottom: 18px; }
.card-h { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 16px; margin-bottom: 16px; }
.badge { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--surface3); color: var(--pepe-bright); font-size: 13px; font-weight: 800; }
.count { margin-left: auto; background: var(--surface3); color: var(--pepe-bright); font-weight: 800; font-size: 13px; padding: 2px 10px; border-radius: 999px; }

.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 13px; font-weight: 700; color: var(--muted2); margin-bottom: 7px; }
.field > span em { color: var(--muted); font-weight: 500; font-style: normal; }
input, textarea {
  width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--border2);
  border-radius: 10px; padding: 11px 13px; font-family: inherit; font-size: 14px; resize: vertical;
}
input:focus, textarea:focus { outline: none; border-color: var(--pepe); box-shadow: 0 0 0 3px var(--pepe-glow); }
textarea { line-height: 1.5; }

.nft-row { display: flex; gap: 8px; }
.nft-row input { flex: 1; }
.btn-sm { padding: 9px 15px; font-size: 13.5px; }
.nft-preview { margin-top: 12px; display: flex; align-items: center; gap: 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.nft-preview img { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; border: 1px solid var(--border2); }
.nft-preview span { font-size: 14px; font-weight: 600; color: var(--muted2); }

.hint { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.hint code, code { background: var(--surface3); padding: 1px 6px; border-radius: 5px; font-size: 12.5px; color: var(--pepe-bright); }

.row-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.file-btn { cursor: pointer; }
.tmpl-link { font-size: 12.5px; color: var(--muted2); margin-left: auto; }

.errors { margin-top: 12px; font-size: 12.5px; color: var(--danger); display: flex; flex-direction: column; gap: 3px; }
.errors span { color: var(--muted2); }
.errors b { color: var(--danger); }

.ent-list { list-style: none; margin-top: 16px; display: flex; flex-direction: column; gap: 6px; }
.ent-list li { display: flex; align-items: center; gap: 10px; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; }
.ent-dot { font-size: 15px; }
.ent-label { font-weight: 700; font-size: 14px; }
.ent-addr { color: var(--muted); font-size: 12px; margin-left: auto; font-variant-numeric: tabular-nums; }
.ent-x { background: transparent; border: none; color: var(--muted); cursor: pointer; font-size: 13px; padding: 4px 6px; border-radius: 6px; }
.ent-x:hover { color: var(--danger); background: rgba(255,93,93,0.1); }

.commit-card { border-color: var(--border2); }
.commit-card .btn-primary { width: 100%; justify-content: center; }
.commit-msg { margin-top: 14px; border-radius: 12px; padding: 16px; font-size: 14px; }
.commit-msg.ok { background: rgba(98,209,110,0.08); border: 1px solid rgba(98,209,110,0.3); }
.commit-msg.err { background: rgba(255,93,93,0.08); border: 1px solid rgba(255,93,93,0.3); color: var(--danger); }
.commit-msg .mono, .mono { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 11.5px; color: var(--muted2); margin-top: 8px; word-break: break-all; }
.commit-msg code { font-size: 12.5px; }

/* ── Run / draw page ── */
.run-wrap { max-width: 860px; padding-bottom: 50px; }
.run-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 16px 0 18px; }
.run-title { font-size: 30px; font-weight: 900; letter-spacing: -0.02em; }
.run-meta { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.nft-badge img { width: 66px; height: 66px; border-radius: 12px; object-fit: cover; border: 1px solid var(--border2); }

.pond-stage { position: relative; width: 100%; aspect-ratio: 16 / 10; border-radius: 20px; overflow: hidden; border: 1px solid var(--border2); box-shadow: inset 0 0 60px rgba(0,0,0,0.4); }
.pond-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; transition: filter 0.6s ease; }
.pond-stage.revealed canvas { filter: blur(7px) brightness(0.7); }

.wait-banner {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  background: rgba(8,20,18,0.85); border: 1px solid var(--border2); border-radius: 999px;
  padding: 8px 18px; font-size: 13px; font-weight: 700; color: var(--pepe-bright); backdrop-filter: blur(4px);
}

.winner-overlay { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 20px;
  animation: fadeIn 0.5s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.winner-inner { max-width: 90%; }
.winner-kicker {
  font-size: clamp(40px, 9vw, 84px); font-weight: 900; letter-spacing: 0.02em; line-height: 1;
  background: linear-gradient(180deg, #fff2b8, var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 24px rgba(255,207,74,0.5)); animation: pop 0.5s cubic-bezier(.2,1.4,.4,1);
}
@keyframes pop { 0% { transform: scale(0.4); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.winner-label { font-size: clamp(20px, 4vw, 32px); font-weight: 800; margin-top: 8px; color: #fff; word-break: break-word; }
.winner-addr { font-family: ui-monospace, Menlo, monospace; font-size: 13px; color: var(--muted2); margin-top: 6px; word-break: break-all; }
.winner-prize { margin-top: 12px; color: var(--pepe-bright); font-weight: 700; font-size: 15px; }
.winner-actions { display: flex; gap: 10px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }

.run-controls { text-align: center; margin-top: 22px; }
#startBtn { min-width: 220px; justify-content: center; }
.fair-note { color: var(--muted); font-size: 12.5px; margin-top: 14px; }
.fair-note code { font-size: 12px; }

@media (max-width: 520px) { .pond-stage { aspect-ratio: 4 / 5; } }

/* ── Verify page ── */
.verify-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.verify-summary > div { display: flex; flex-direction: column; gap: 3px; }
.vs-k { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-weight: 700; }
.vs-v { font-size: 15px; font-weight: 700; word-break: break-all; }
.vs-v.gold { color: var(--gold); }

.check-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg); }
.check.pass { border-color: rgba(98,209,110,0.35); background: rgba(98,209,110,0.06); }
.check.fail { border-color: rgba(255,93,93,0.4); background: rgba(255,93,93,0.07); }
.check.warn { border-color: rgba(255,207,74,0.35); background: rgba(255,207,74,0.06); }
.check-ico { font-size: 16px; font-weight: 800; line-height: 1.4; }
.check.pass .check-ico { color: var(--pepe-bright); }
.check.fail .check-ico { color: var(--danger); }
.check b { font-size: 14px; }
.check-detail { color: var(--muted2); font-size: 11.5px; margin-top: 4px; line-height: 1.6; word-break: break-all; }
.check-detail a { color: var(--pepe-bright); }

.math-block { font-size: 11.5px; line-height: 2; color: var(--muted2); word-break: break-all; }

.verify-ents li { gap: 12px; }
.ent-idx { color: var(--muted); font-size: 11px; min-width: 20px; }
.verify-ents .ent-addr { font-family: ui-monospace, Menlo, monospace; font-size: 11px; }
.verify-ents .is-winner { border-color: rgba(255,207,74,0.5); background: rgba(255,207,74,0.08); }
.verify-ents .is-winner .ent-label { color: var(--gold); }

@media (max-width: 520px) { .verify-summary { grid-template-columns: 1fr; } }
