:root {
  --purple-500: #7C4DFF;
  --purple-400: #9B77FF;
  --purple-600: #6431E0;
  --gold-500: #E8B23A;
  --gold-400: #F3C863;

  --canvas: #FFFFFF;
  --surface: #F9F8F7;
  --surface-2: #F0EFED;
  --raised: #FFFFFF;
  --border: #E6E5E3;
  --text: #2C2C2B;
  --text-dim: #6F6C67;
  --accent: var(--purple-600);
  --accent-soft: #F0EAFF;
  --gold: #A9761A;
  --gold-soft: #FBF1DC;
  --positive: #46A171;
  --positive-soft: #E8F1EC;
  --attention: #C4702C;
  --attention-soft: #FBEBDE;
  --danger: #D24F44;
  --danger-soft: #FCE9E7;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 12px rgba(0,0,0,.04);

  --radius: 8px;
  --radius-lg: 12px;
  --wrap: 1120px;
  --gutter: 24px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: Menlo, Consolas, "Liberation Mono", monospace;
}

:root[data-theme="dark"] {
  --canvas: #17151C;
  --surface: #1E1B25;
  --surface-2: #262231;
  --raised: #2A2634;
  --border: rgba(255,255,255,.14);
  --text: #FFFFFF;
  --text-dim: rgba(255,255,255,.66);
  --accent: var(--purple-400);
  --accent-soft: rgba(124,77,255,.16);
  --gold: var(--gold-400);
  --gold-soft: rgba(232,178,58,.14);
  --positive: #72BC8F;
  --positive-soft: rgba(114,188,143,.14);
  --attention: #DE9255;
  --attention-soft: rgba(222,146,85,.14);
  --danger: #E97366;
  --danger-soft: rgba(233,115,102,.14);
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.28);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--canvas);
  overflow-x: hidden;
  transition: background-color .25s ease, color .25s ease;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.wrap-narrow { max-width: 760px; }
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--accent); color: #fff; padding: 12px 16px; z-index: 200; }
.skip-link:focus { left: 12px; top: 12px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--canvas) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 32px; height: 32px; flex: none; }
.brand-name { font-size: 18px; }
.brand-name span { color: var(--gold); }

.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav a {
  color: var(--text-dim); font-size: 15px; padding: 8px 10px; border-radius: var(--radius);
  transition: color .15s ease, background-color .15s ease;
}
.nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--text); font-weight: 600; background: var(--accent-soft); }
.header-actions { display: flex; align-items: center; gap: 8px; margin-left: 8px; }

.icon-btn {
  width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: var(--radius); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 20px; height: 20px; }
:root[data-theme="dark"] .icon-sun { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }
.icon-sun { display: none; }
.icon-moon { display: block; }
.nav-toggle { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 11px 20px; border-radius: var(--radius);
  font-size: 15px; font-weight: 600; cursor: pointer; border: 1px solid transparent;
  transition: transform .15s ease, background-color .15s ease, border-color .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--purple-600); color: #fff; }
:root[data-theme="dark"] .btn-primary { background: var(--purple-500); }
.btn-primary:hover { background: var(--purple-500); }
.btn-gold { background: var(--gold-500); color: #2A1D00; }
.btn-gold:hover { background: var(--gold-400); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; }

/* ---------- Generic blocks ---------- */
.section { padding: 64px 0; }
.section-sm { padding: 40px 0; }
.section-head { margin-bottom: 32px; }
.section-head h2 { font-size: 28px; line-height: 1.25; margin: 0 0 8px; letter-spacing: -.02em; }
.section-head p { margin: 0; color: var(--text-dim); max-width: 680px; }
.eyebrow {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 12px;
}
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--raised); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 24px; transition: border-color .2s ease, transform .2s ease;
}
.card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.card h3 { margin: 0 0 8px; font-size: 18px; letter-spacing: -.01em; }
.card p { margin: 0; color: var(--text-dim); font-size: 15px; }
.card-link:hover { transform: translateY(-2px); text-decoration: none; }

.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--text-dim);
  border: 1px solid var(--border);
}
.badge-accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge-gold { background: var(--gold-soft); color: var(--gold); border-color: transparent; }
.badge-ok { background: var(--positive-soft); color: var(--positive); border-color: transparent; }
.badge-warn { background: var(--attention-soft); color: var(--attention); border-color: transparent; }
.badge-bad { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }

/* ---------- Page header ---------- */
.page-head { padding: 56px 0 32px; border-bottom: 1px solid var(--border); background: var(--surface); }
.page-head h1 { margin: 0 0 12px; font-size: 40px; line-height: 1.15; letter-spacing: -.03em; }
.page-head p { margin: 0; color: var(--text-dim); max-width: 680px; font-size: 17px; }
.breadcrumbs { font-size: 13px; color: var(--text-dim); margin-bottom: 16px; }
.breadcrumbs a { color: var(--text-dim); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: 88px 0 72px; background: var(--surface); border-bottom: 1px solid var(--border); }
.hero::before {
  content: ""; position: absolute; inset: -40% -10% auto -10%; height: 520px;
  background: radial-gradient(60% 60% at 25% 40%, color-mix(in srgb, var(--purple-500) 26%, transparent) 0%, transparent 70%),
              radial-gradient(45% 45% at 80% 20%, color-mix(in srgb, var(--gold-500) 20%, transparent) 0%, transparent 70%);
  pointer-events: none;
}
.hero-inner { position: relative; display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; }
.hero h1 { margin: 0 0 16px; font-size: 48px; line-height: 1.08; letter-spacing: -.035em; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p.lead { margin: 0 0 28px; font-size: 18px; color: var(--text-dim); max-width: 560px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 24px; margin-top: 32px; }
.hero-meta div strong { display: block; font-size: 22px; letter-spacing: -.02em; }
.hero-meta div span { font-size: 13px; color: var(--text-dim); }

.status-card { background: var(--raised); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow); }
.status-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.status-row:last-child { border-bottom: 0; padding-bottom: 0; }
.status-row:first-child { padding-top: 0; }
.status-row span { color: var(--text-dim); font-size: 14px; }
.status-row b { font-size: 15px; }
.ip-copy { display: flex; gap: 8px; margin-top: 16px; }
.ip-copy code {
  flex: 1; font-family: var(--mono); font-size: 15px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 11px 14px; color: var(--text);
  display: flex; align-items: center;
}

/* ---------- Tables / lists ---------- */
.table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); }
table.data { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 560px; }
table.data th, table.data td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--border); }
table.data th { background: var(--surface-2); font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim); }
table.data tr:last-child td { border-bottom: 0; }

/* ---------- Rules ---------- */
.rules-layout { display: grid; grid-template-columns: 260px 1fr; gap: 48px; align-items: start; }
.toc { position: sticky; top: 88px; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; background: var(--surface); }
.toc h4 { margin: 0 0 12px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-dim); }
.toc a { display: block; padding: 8px 10px; border-radius: var(--radius); font-size: 14px; color: var(--text-dim); }
.toc a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.rule-block { margin-bottom: 40px; scroll-margin-top: 88px; }
.rule-block h2 { font-size: 22px; margin: 0 0 16px; letter-spacing: -.02em; }
.rule-list { list-style: none; margin: 0; padding: 0; counter-reset: r; }
.rule-list li {
  counter-increment: r; position: relative; padding: 14px 16px 14px 52px; border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 8px; background: var(--raised); font-size: 15px;
}
.rule-list li::before {
  content: counter(r); position: absolute; left: 14px; top: 14px; width: 24px; height: 24px;
  border-radius: 6px; background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700;
}
.notice { border-left: 3px solid var(--accent); background: var(--accent-soft); padding: 16px 20px; border-radius: var(--radius); font-size: 15px; }
.notice-gold { border-left-color: var(--gold); background: var(--gold-soft); }

/* ---------- Donate ---------- */
.tier { display: flex; flex-direction: column; position: relative; overflow: hidden; }
.tier-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.tier-name { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.tier-price { font-size: 30px; font-weight: 700; letter-spacing: -.03em; margin: 8px 0 4px; }
.tier-price small { font-size: 14px; font-weight: 500; color: var(--text-dim); }
.tier ul { list-style: none; margin: 16px 0 24px; padding: 0; display: grid; gap: 10px; }
.tier ul li { position: relative; padding-left: 26px; font-size: 15px; color: var(--text-dim); }
.tier ul li::before {
  content: ""; position: absolute; left: 0; top: 6px; width: 14px; height: 8px;
  border-left: 2px solid var(--positive); border-bottom: 2px solid var(--positive); transform: rotate(-45deg);
}
.tier .btn { margin-top: auto; }
.tier-featured { border-color: color-mix(in srgb, var(--purple-500) 60%, var(--border)); box-shadow: var(--shadow); }
.tier-featured::after {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--purple-500), var(--gold-500));
}

/* ---------- Forum ---------- */
.forum-cat { display: flex; gap: 16px; align-items: flex-start; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--raised); }
.forum-cat:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.forum-ico { width: 44px; height: 44px; border-radius: var(--radius); background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; flex: none; font-weight: 700; }
.forum-cat h3 { margin: 0 0 4px; font-size: 17px; }
.forum-cat p { margin: 0 0 8px; font-size: 14px; color: var(--text-dim); }
.forum-cat .meta { font-size: 13px; color: var(--text-dim); }
.thread { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; padding: 16px; border-bottom: 1px solid var(--border); }
.thread:last-child { border-bottom: 0; }
.thread h4 { margin: 0 0 6px; font-size: 16px; }
.thread .meta { font-size: 13px; color: var(--text-dim); }
.thread-stats { display: flex; gap: 20px; text-align: center; color: var(--text-dim); font-size: 13px; }
.thread-stats b { display: block; color: var(--text); font-size: 15px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip {
  min-height: 40px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-dim); font-size: 14px; cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); border-color: transparent; font-weight: 600; }

/* ---------- Account / forms ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 44px; padding: 11px 14px; font-family: inherit; font-size: 15px;
  color: var(--text); background: var(--canvas); border: 1px solid var(--border); border-radius: var(--radius);
}
.field textarea { min-height: 132px; resize: vertical; }
.field .hint { font-size: 13px; color: var(--text-dim); margin-top: 6px; }
.stat { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; background: var(--raised); }
.stat b { display: block; font-size: 26px; letter-spacing: -.02em; }
.stat span { font-size: 13px; color: var(--text-dim); }

/* ---------- FAQ ---------- */
details.faq { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--raised); padding: 0 20px; margin-bottom: 8px; }
details.faq summary { cursor: pointer; list-style: none; padding: 18px 0; font-weight: 600; display: flex; justify-content: space-between; gap: 16px; align-items: center; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; color: var(--accent); font-size: 20px; line-height: 1; }
details.faq[open] summary::after { content: "\2212"; }
details.faq p { margin: 0 0 18px; color: var(--text-dim); font-size: 15px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding: 48px 0 32px; margin-top: 24px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; }
.footer-grid h5 { margin: 0 0 12px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-dim); }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-grid a { color: var(--text-dim); font-size: 14px; }
.footer-grid a:hover { color: var(--text); }
.footer-bottom { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-dim); }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity .5s ease, transform .5s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .hero-inner { grid-template-columns: 1fr; gap: 32px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .rules-layout { grid-template-columns: 1fr; gap: 24px; }
  .toc { position: static; }
}
@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; margin-left: auto; }
  .nav {
    position: fixed; inset: 64px 0 auto 0; flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--canvas); border-bottom: 1px solid var(--border); padding: 12px var(--gutter) 20px;
    margin-left: 0; display: none; max-height: calc(100vh - 64px); overflow-y: auto;
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 12px; font-size: 16px; }
  .header-actions { margin-left: 8px; order: 3; }
  .grid-3 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  :root { --gutter: 20px; }
  .section { padding: 48px 0; }
  .hero { padding: 56px 0 48px; }
  .hero h1 { font-size: 34px; }
  .page-head h1 { font-size: 30px; }
  .grid-2, .grid-4 { grid-template-columns: 1fr; }
  .thread { grid-template-columns: 1fr; align-items: start; }
}
@media (max-width: 480px) {
  :root { --gutter: 16px; }
  .hero h1 { font-size: 29px; }
  .hero p.lead { font-size: 16px; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-actions .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
