body.page-rules { background: var(--page-bg, #121212); }

/* ── Glows ────────────────────────────────── */
.rules-hero { position: relative; overflow: hidden; }

.rules-glow {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(72px);
}
.rules-glow-1 {
  width: 620px; height: 260px;
  background: #D4A373;
  opacity: .13;
  top: -80px; right: 7%;
}
.rules-glow-2 {
  width: 280px; height: 180px;
  background: #f87171;
  opacity: .22;
  bottom: -40px; right: 50%;
}
.rules-glow-3 {
  width: 220px; height: 160px;
  background: #60a5fa;
  opacity: .09;
  bottom: -20px; left: 8%;
}

.rules-hero .page-hero-inner { align-items: flex-end; }
.rules-hero .page-hero-right { align-items: flex-end; margin-left: auto; align-self: flex-end; }

/* ── Category header ──────────────────────── */
.rules-category-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  border-left: 4px solid transparent;
  border-radius: 6px;
  margin-bottom: 8px;
}
.cat-icon {
  width: 34px; height: 34px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.cat-name { display: block; font-size: .95rem; font-weight: 700; color: #f8f5f4; }
.cat-count { display: block; font-size: .68rem; color: #6b6865; margin-top: 1px; }

/* ── Rules list ───────────────────────────── */
.rules-list { display: flex; flex-direction: column; gap: 5px; margin-bottom: 40px; }

.rule-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: #1b1c1c;
  border: 1px solid #272828;
  border-radius: 6px;
  padding: 12px 14px;
  transition: background .15s, border-color .15s;
}
.rule-card:hover { background: #212222; border-color: #333; }
.rule-card.rule-hidden { display: none; }

.rule-num {
  font-size: 1rem;
  font-weight: 900;
  min-width: 22px;
  padding-top: 2px;
  opacity: .5;
  flex-shrink: 0;
  line-height: 1;
}
.rule-body { flex: 1; min-width: 0; }
.rule-text { font-size: .865rem; color: #ccc9c6; line-height: 1.6; margin: 0; }

/* ── Punishment badges ────────────────────── */
.rule-punish {
  flex-shrink: 0;
  font-size: .66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  padding: 5px 10px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  align-self: flex-start;
}
.rule-punish i { font-size: 10px; }

.punish-warn    { background: rgba(250,204,21,.1);  color: #facc15; border: 1px solid rgba(250,204,21,.2); }
.punish-mute    { background: rgba(96,165,250,.1);  color: #60a5fa; border: 1px solid rgba(96,165,250,.2); }
.punish-ban     { background: rgba(251,146,60,.1);  color: #fb923c; border: 1px solid rgba(251,146,60,.2); }
.punish-permban { background: rgba(248,113,113,.1); color: #f87171; border: 1px solid rgba(248,113,113,.2); }

/* ── TOC links ────────────────────────────── */
.rules-toc-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  font-size: .8rem;
  color: #9e9b97;
  text-decoration: none;
  border-radius: 6px;
  transition: color .15s, background .15s;
}
.rules-toc-link:hover  { color: #D4A373; background: rgba(212,163,115,.07); }
.rules-toc-link.active { color: #D4A373; background: rgba(212,163,115,.1); }
.toc-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ── Misc ─────────────────────────────────── */
.rules-empty-cat { font-size: .8rem; color: #6b6865; margin: 0 0 32px 20px; }

.rules-no-match { text-align: center; padding: 80px 20px; color: #6b6865; }
.rules-no-match i { font-size: 2rem; margin-bottom: 12px; display: block; }
.rules-no-match p { font-size: .9rem; margin: 0; }

.rules-placeholder { text-align: center; padding: 120px 20px; color: #6b6865; }
.rules-placeholder i { font-size: 2.5rem; margin-bottom: 16px; display: block; }
.rules-placeholder p { font-size: 1rem; margin: 0; }

/* ── Responsive ───────────────────────────── */
@media (max-width: 900px) {
  .page-container { grid-template-columns: 1fr; }
  .page-sidebar   { display: none; }
  .rules-hero .page-hero-inner { align-items: flex-start; }
  .rules-hero .page-hero-right { align-self: auto; margin-left: 0; }
  .rules-hero { padding-bottom: 16px; margin-bottom: 16px; }
}
@media (max-width: 480px) {
  .rules-hero .page-hero-inner { padding-top: 16px; padding-bottom: 0; }
}
@media (max-width: 600px) {
  .rule-card   { flex-direction: column; gap: 8px; }
  .rule-num    { display: none; }
  .rule-punish { align-self: flex-start; white-space: normal; }
}