:root {
  --bg: #0f1115;
  --panel: #171a21;
  --panel-2: #1e222b;
  --line: #2a2f3a;
  --text: #e6e8ec;
  --muted: #9aa3b2;
  --gold: #f6c453;
  --gold-2: #fda085;
  --green: #6fdc8c;
  --purple: #b388ff;
  --radius: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  line-height: 1.6;
}
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- top bar ---------- */
.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 24px;
  background: rgba(15, 17, 21, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 800; font-size: 20px; letter-spacing: .5px; color: var(--text); }
.brand span { background: linear-gradient(90deg, var(--gold), var(--gold-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav-links { display: flex; gap: 8px; flex-wrap: wrap; }
.nav-links a {
  padding: 8px 14px; border-radius: 10px; color: var(--muted); font-weight: 600;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); background: var(--panel-2); text-decoration: none; }
.nav-links a.shop { color: #1b1300; background: linear-gradient(90deg, var(--gold), var(--gold-2)); }
.nav-links a.shop:hover { filter: brightness(1.08); }

/* ---------- hero ---------- */
.hero {
  min-height: calc(100vh - 60px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 48px 20px;
  background:
    radial-gradient(1000px 500px at 50% -10%, rgba(246, 196, 83, .14), transparent 60%),
    radial-gradient(800px 400px at 50% 110%, rgba(179, 136, 255, .10), transparent 60%);
}
.hero h1 { font-size: clamp(36px, 7vw, 72px); margin: 0 0 8px; line-height: 1.05; }
.hero h1 span { background: linear-gradient(90deg, var(--gold), var(--gold-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { color: var(--muted); font-size: clamp(16px, 2.2vw, 20px); max-width: 720px; margin: 0 auto 32px; }

.ip-box {
  display: inline-flex; align-items: center; gap: 14px;
  padding: 14px 14px 14px 26px; border-radius: 18px;
  background: var(--panel); border: 2px solid var(--gold);
  box-shadow: 0 0 40px rgba(246, 196, 83, .18);
  font-family: Consolas, "Courier New", monospace; font-size: clamp(22px, 4vw, 34px); font-weight: 700;
}
.ip-box button {
  font: inherit; font-size: 16px; font-family: "Segoe UI", system-ui, sans-serif; font-weight: 700;
  padding: 10px 18px; border: 0; border-radius: 12px; cursor: pointer;
  color: #1b1300; background: linear-gradient(90deg, var(--gold), var(--gold-2));
}
.ip-box button:active { transform: translateY(1px); }
.ip-hint { color: var(--muted); margin-top: 12px; font-size: 14px; }

.cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 32px; }
.btn {
  display: inline-block; padding: 12px 22px; border-radius: 12px; font-weight: 700;
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
}
.btn:hover { text-decoration: none; border-color: var(--gold); }
.btn.primary { color: #1b1300; background: linear-gradient(90deg, var(--gold), var(--gold-2)); border: 0; }

/* ---------- sections ---------- */
.wrap { max-width: 1100px; margin: 0 auto; padding: 56px 20px; }
.section-title { font-size: 28px; margin: 0 0 8px; }
.section-sub { color: var(--muted); margin: 0 0 28px; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px;
}
.card h3 { margin: 8px 0 6px; font-size: 18px; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }

.steps { counter-reset: s; display: grid; gap: 12px; }
.steps li { list-style: none; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 14px 56px; position: relative; }
.steps li::before {
  counter-increment: s; content: counter(s);
  position: absolute; left: 14px; top: 12px; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; color: #1b1300;
  background: linear-gradient(90deg, var(--gold), var(--gold-2));
}
.steps { padding: 0; margin: 0; }

code, kbd {
  font-family: Consolas, "Courier New", monospace; font-size: .92em;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; color: var(--gold);
}

footer { border-top: 1px solid var(--line); color: var(--muted); text-align: center; padding: 28px 20px; font-size: 14px; }

/* ---------- join flowchart ---------- */
.flow { max-width: 760px; margin: 8px 0 20px; }
.wrap .flow { margin: 0 auto; }
.flow-step {
  display: flex; align-items: center; gap: 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px;
}
.flow-step code { white-space: nowrap; }
.flow-num {
  flex: none; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; color: #1b1300;
  background: linear-gradient(90deg, var(--gold), var(--gold-2));
}
.flow-end { border-color: var(--gold); }
.flow-arrow { width: 2px; height: 26px; margin: 0 auto; background: var(--line); position: relative; }
.flow-arrow::after {
  content: ""; position: absolute; left: 50%; bottom: -1px; transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: var(--line); border-bottom: 0;
}
.flow-arrow.small { height: 18px; }
.flow-split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.flow-branch { display: flex; flex-direction: column; }
.flow-label { text-align: center; color: var(--gold); font-weight: 700; font-size: 14px; margin-bottom: 8px; text-transform: uppercase; letter-spacing: .5px; }

/* ---------- wiki ---------- */
.wiki { display: grid; grid-template-columns: 240px 1fr; gap: 32px; max-width: 1200px; margin: 0 auto; padding: 32px 20px 64px; }
.toc { position: sticky; top: 84px; align-self: start; max-height: calc(100vh - 100px); overflow: auto; }
.toc h4 { margin: 0 0 8px; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: 1px; }
.toc a { display: block; padding: 6px 10px; border-radius: 8px; color: var(--muted); font-size: 15px; }
.toc a:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.content h1 { margin-top: 0; font-size: 36px; }
.content h2 { margin: 48px 0 12px; padding-top: 12px; font-size: 26px; border-top: 1px solid var(--line); scroll-margin-top: 80px; }
.content h2:first-of-type { border-top: 0; margin-top: 16px; }
.content h3 { margin: 24px 0 8px; font-size: 19px; color: var(--gold); }
.content p, .content li { color: #cfd3da; }
.content ul { padding-left: 22px; }
.note {
  background: rgba(246, 196, 83, .08); border: 1px solid rgba(246, 196, 83, .35); border-radius: 12px;
  padding: 12px 16px; margin: 14px 0; color: var(--text);
}
table { width: 100%; border-collapse: collapse; margin: 12px 0 18px; font-size: 15px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; background: var(--panel); }
tr:hover td { background: rgba(255, 255, 255, .02); }

@media (max-width: 860px) {
  .wiki { grid-template-columns: 1fr; }
  .toc { position: static; max-height: none; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
  .nav { padding: 10px 14px; }
  .nav-links { gap: 4px; flex-wrap: nowrap; }
  .nav-links a { padding: 6px 9px; font-size: 14px; white-space: nowrap; }
  .ip-box { flex-direction: column; padding: 16px 20px; }
  .flow-split { grid-template-columns: 1fr; }
  .flow-step code { white-space: normal; }
}
