/*
Theme Name: Pulang Lupa Roleplay
Theme URI: http://localhost/pulangluparp
Author: Pulang Lupa Team
Description: Official theme for Pulang Lupa Roleplay - A RedM Red Dead Redemption 2 Roleplay Server
Version: 1.0
License: GNU General Public License v2 or later
Text Domain: pulang-lupa
*/

/* =========================================
   RESET & BASE
========================================= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --black:        #0d0d0d;
  --dark:         #181818;
  --dark-red:     #6B1010;
  --red:          #8B1A1A;
  --red-light:    #C0392B;
  --gold:         #C9A84C;
  --gold-light:   #E8C96A;
  --orange:       #D4731A;
  --text:         #E8DCC8;
  --text-muted:   #9A8A72;
  --border:       rgba(201,168,76,0.25);
  --overlay:      rgba(10,10,10,0.65);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Roboto Slab', 'Georgia', serif;
  background-color: var(--black);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
}

a {
  color: var(--gold);
  text-decoration: none;
  transition: color 0.25s ease;
}
a:hover { color: var(--gold-light); }

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4, h5, h6 {
  font-family: 'Cinzel', 'Times New Roman', serif;
  line-height: 1.2;
  color: var(--gold);
}

/* =========================================
   SCROLLBAR
========================================= */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--black); }
::-webkit-scrollbar-thumb { background: var(--dark-red); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--red); }

/* =========================================
   NAVBAR
========================================= */
#site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: linear-gradient(to bottom, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.8) 100%);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(6px);
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 70px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-logo img {
  height: 52px;
  width: auto;
}

.nav-logo .site-name {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  color: var(--gold);
  letter-spacing: 0.05em;
  line-height: 1.2;
  display: none;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}

.nav-menu a {
  font-family: 'Cinzel', serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
  padding: 0.4rem 0.85rem;
  border-radius: 3px;
  transition: color 0.2s, background 0.2s;
}

.nav-menu a:hover,
.nav-menu li.current-menu-item a {
  color: var(--gold);
  background: rgba(201,168,76,0.08);
}

.nav-menu li.menu-highlight a {
  color: var(--gold);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.nav-menu li.menu-highlight a:hover {
  background: var(--dark-red);
  border-color: var(--red);
}

.nav-discord-btn {
  font-family: 'Cinzel', serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text) !important;
  background: #5865F2;
  padding: 0.45rem 1rem !important;
  border-radius: 4px !important;
  transition: background 0.2s, transform 0.2s !important;
}
.nav-discord-btn:hover {
  background: #4752C4 !important;
  color: #fff !important;
  transform: translateY(-1px);
}

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 25px;
  height: 2px;
  background: var(--gold);
  transition: all 0.3s;
}

/* =========================================
   HERO SECTION
========================================= */
#hero {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-image: url('images/hero-bg.jpg');
  background-size: cover;
  background-position: center 30%;
  background-repeat: no-repeat;
  transform: scale(1.05);
  animation: heroZoom 20s ease-in-out infinite alternate;
}

@keyframes heroZoom {
  from { transform: scale(1.05); }
  to   { transform: scale(1.12); }
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.55) 0%,
    rgba(10,5,0,0.45) 40%,
    rgba(0,0,0,0.75) 85%,
    var(--black) 100%
  );
}

/* Dirt/vignette edges */
.hero-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.6) 100%);
}

/* Top/bottom border lines (like reference site) */
.hero-border-top {
  position: absolute;
  top: 70px; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(to right, transparent, var(--dark-red), var(--red), var(--dark-red), transparent);
  opacity: 0.7;
}
.hero-border-bottom {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(to right, transparent, var(--dark-red), var(--red), var(--dark-red), transparent);
  opacity: 0.7;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  animation: heroFadeIn 1.2s ease-out forwards;
}

@keyframes heroFadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-logo {
  width: clamp(160px, 22vw, 280px);
  filter: drop-shadow(0 4px 24px rgba(0,0,0,0.8));
  animation: heroPulse 4s ease-in-out infinite;
}

@keyframes heroPulse {
  0%, 100% { filter: drop-shadow(0 4px 24px rgba(0,0,0,0.8)); }
  50%       { filter: drop-shadow(0 6px 32px rgba(201,168,76,0.3)) drop-shadow(0 0 60px rgba(139,26,26,0.2)); }
}

.hero-tagline {
  font-family: 'Roboto Slab', serif;
  font-size: clamp(1.1rem, 2.5vw, 1.6rem);
  font-weight: 400;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0,0,0,0.9);
  letter-spacing: 0.02em;
}

.hero-tagline span {
  color: var(--gold);
  font-weight: 700;
}

.hero-tagline em {
  color: var(--red-light);
  font-style: normal;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.75rem 2rem;
  border-radius: 4px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.25s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--red);
  color: #fff;
  border-color: var(--dark-red);
  box-shadow: 0 0 20px rgba(139,26,26,0.4);
}
.btn-primary:hover {
  background: var(--red-light);
  border-color: var(--red-light);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 24px rgba(192,57,43,0.5);
}

.btn-outline {
  background: transparent;
  color: var(--gold);
  border-color: var(--gold);
}
.btn-outline:hover {
  background: var(--gold);
  color: var(--black);
  transform: translateY(-2px);
}

.btn-discord {
  background: #5865F2;
  color: #fff;
  border-color: #4752C4;
}
.btn-discord:hover {
  background: #4752C4;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(88,101,242,0.4);
}

.hero-scroll-down {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  animation: bounce 2s infinite;
}
.hero-scroll-down svg {
  width: 28px;
  height: 28px;
  stroke: var(--gold);
  opacity: 0.7;
}
@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(8px); }
}

/* =========================================
   SECTION BASE
========================================= */
section {
  padding: 5rem 1.5rem;
}

.section-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.section-title {
  text-align: center;
  margin-bottom: 0.5rem;
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.section-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 3.5rem;
  font-style: italic;
}

.section-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 3.5rem;
}
.section-divider::before,
.section-divider::after {
  content: '';
  flex: 1;
  max-width: 200px;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border));
}
.section-divider::after {
  background: linear-gradient(to left, transparent, var(--border));
}
.section-divider span {
  color: var(--gold);
  font-size: 1.2rem;
}

/* =========================================
   ABOUT SECTION
========================================= */
#about {
  background: var(--dark);
  position: relative;
}

#about::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('images/noise.png') repeat;
  opacity: 0.03;
  pointer-events: none;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.about-text p {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  font-size: 1rem;
}

.about-text p strong {
  color: var(--gold);
}

.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.stat-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.5rem 1rem;
  text-align: center;
  transition: border-color 0.3s, transform 0.3s;
}
.stat-card:hover {
  border-color: var(--gold);
  transform: translateY(-3px);
}

.stat-card .stat-num {
  font-family: 'Cinzel', serif;
  font-size: 2rem;
  color: var(--gold);
  display: block;
  line-height: 1;
  margin-bottom: 0.4rem;
}

.stat-card .stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

/* =========================================
   FEATURES SECTION
========================================= */
#features {
  background: var(--black);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.75rem;
}

.feature-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2rem 1.5rem;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(to right, var(--dark-red), var(--gold), var(--dark-red));
  opacity: 0;
  transition: opacity 0.3s;
}

.feature-card:hover {
  border-color: rgba(201,168,76,0.4);
  background: rgba(201,168,76,0.05);
  transform: translateY(-4px);
}
.feature-card:hover::before { opacity: 1; }

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  display: block;
}

.feature-card h3 {
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.feature-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.65;
}

/* =========================================
   HOW TO JOIN
========================================= */
#join {
  background: var(--dark);
  position: relative;
}

.join-bg-pattern {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 50%, rgba(139,26,26,0.07) 0%, transparent 70%);
  pointer-events: none;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  counter-reset: steps;
}

.step-card {
  text-align: center;
  padding: 2rem 1.5rem;
  position: relative;
}

.step-number {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--dark-red);
  border: 2px solid var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cinzel', serif;
  font-size: 1.25rem;
  color: var(--gold);
  margin: 0 auto 1.25rem;
  box-shadow: 0 0 20px rgba(139,26,26,0.3);
}

.step-card h3 {
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}

.step-card p {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.join-cta {
  text-align: center;
  margin-top: 3.5rem;
  display: flex;
  gap: 1.25rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* =========================================
   RULES SECTION
========================================= */
#rules-preview {
  background: var(--black);
}

.rules-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.rule-item {
  display: flex;
  gap: 1rem;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(255,255,255,0.05);
  transition: border-color 0.3s;
}
.rule-item:hover { border-color: rgba(201,168,76,0.35); }

.rule-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.rule-item h4 {
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.rule-item p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* =========================================
   COMMUNITY / DISCORD BANNER
========================================= */
#community {
  background: linear-gradient(135deg, rgba(88,101,242,0.12) 0%, rgba(0,0,0,0) 100%), var(--dark);
  border-top: 1px solid rgba(88,101,242,0.2);
  border-bottom: 1px solid rgba(88,101,242,0.2);
  text-align: center;
  padding: 4rem 1.5rem;
}

#community .section-title { color: #fff; }

#community p {
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 2.5rem;
}

/* =========================================
   FOOTER
========================================= */
#site-footer {
  background: #050505;
  border-top: 1px solid var(--border);
  padding: 3rem 1.5rem 1.5rem;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.footer-brand .footer-logo {
  height: 60px;
  margin-bottom: 1rem;
}

.footer-brand p {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 300px;
}

.footer-col h4 {
  font-family: 'Cinzel', serif;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-col ul a {
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: color 0.2s;
}
.footer-col ul a:hover { color: var(--gold); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.footer-social {
  display: flex;
  gap: 0.75rem;
}
.footer-social a {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: all 0.2s;
}
.footer-social a:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(201,168,76,0.08);
}

/* =========================================
   PAGE HERO (inner pages)
========================================= */
.page-hero {
  padding-top: 70px;
  background: linear-gradient(to bottom, rgba(139,26,26,0.2), var(--black));
  text-align: center;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--border);
}
.page-hero h1 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  padding-top: 4rem;
}
.page-hero .breadcrumb {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

/* =========================================
   RESPONSIVE
========================================= */
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .rules-grid { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
  .nav-menu {
    display: none;
    position: absolute;
    top: 70px; left: 0; right: 0;
    background: rgba(0,0,0,0.97);
    flex-direction: column;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    gap: 0;
  }
  .nav-menu.open { display: flex; }
  .nav-menu a { padding: 0.75rem 1rem; display: block; width: 100%; }
  .nav-toggle { display: flex; }
  .footer-top { grid-template-columns: 1fr; gap: 2rem; }
  .footer-bottom { flex-direction: column; gap: 1rem; text-align: center; }
}

@media (max-width: 480px) {
  .about-stats { grid-template-columns: 1fr 1fr; }
  .hero-buttons { flex-direction: column; align-items: center; }
}

/* =========================================
   UTILITY
========================================= */
.text-gold { color: var(--gold); }
.text-red  { color: var(--red-light); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }

.wp-site-blocks { padding: 0 !important; }

/* =========================================
   RULES PAGE
========================================= */
#rules-page {
  padding-top: 70px;
  min-height: 100vh;
  background: var(--black);
}

/* Admin bar offset */
.admin-bar #rules-page { padding-top: 102px; }

.rules-page-header {
  background: linear-gradient(to bottom, rgba(107,16,16,0.35) 0%, transparent 100%);
  border-bottom: 1px solid var(--border);
  padding: 2.5rem 2rem 1.5rem;
}
.rules-header-inner {
  max-width: 1300px;
  margin: 0 auto;
}
.rules-page-header h1 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gold);
}

/* Layout */
.rules-layout {
  display: flex;
  max-width: 1300px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  gap: 2.5rem;
  align-items: flex-start;
}

/* ── Sidebar ── */
.rules-sidebar {
  width: 260px;
  flex-shrink: 0;
  position: sticky;
  top: 90px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--dark-red) transparent;
}
.rules-sidebar::-webkit-scrollbar { width: 4px; }
.rules-sidebar::-webkit-scrollbar-thumb { background: var(--dark-red); border-radius: 2px; }

.rules-search-wrap {
  position: relative;
  margin-bottom: 1.25rem;
}
#rules-search {
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.55rem 2.5rem 0.55rem 0.85rem;
  color: var(--text);
  font-family: 'Roboto Slab', serif;
  font-size: 0.82rem;
  outline: none;
  transition: border-color 0.2s;
}
#rules-search:focus { border-color: var(--gold); }
#rules-search::placeholder { color: var(--text-muted); }
.rules-search-icon {
  position: absolute;
  right: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  width: 15px; height: 15px;
  stroke: var(--text-muted);
  pointer-events: none;
}

.rules-nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.rules-nav-link {
  display: block;
  padding: 0.5rem 0.85rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
  border-left: 2px solid transparent;
  line-height: 1.4;
}
.rules-nav-link:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text);
}
.rules-nav-link.active,
.rules-nav-link.active:hover {
  color: var(--gold);
  border-left-color: var(--gold);
  background: rgba(201,168,76,0.08);
}
.rules-nav-link.hidden { display: none; }

/* ── Main Content ── */
.rules-main {
  flex: 1;
  min-width: 0;
}

.rules-intro {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.75rem 2rem;
  margin-bottom: 2rem;
}
.rules-intro h2 {
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  margin-bottom: 1rem;
}
.rules-intro p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
  line-height: 1.75;
}
.rules-intro p:last-child { margin-bottom: 0; }
.rules-notice {
  color: var(--text) !important;
  background: rgba(139,26,26,0.2);
  border-left: 3px solid var(--red);
  padding: 0.75rem 1rem;
  border-radius: 0 4px 4px 0;
}
.rules-notice strong { color: #fff; }

/* Rule Sections */
.rule-section {
  border-bottom: 1px solid var(--border);
  padding: 2rem 0;
  scroll-margin-top: 90px;
}
.rule-section:last-child { border-bottom: none; }

.rule-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.rule-section-title {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex: 1;
}

.rule-section-title h2 {
  font-size: 1.2rem;
  letter-spacing: 0.04em;
  color: var(--gold);
  margin: 0;
  line-height: 1.3;
}

.rule-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  background: rgba(139,26,26,0.3);
  border: 1px solid var(--red);
  border-radius: 4px;
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--red-light, #c0392b);
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.rule-body {
  color: var(--text-muted);
  font-size: 0.93rem;
  line-height: 1.75;
  margin-bottom: 1rem;
  max-width: 820px;
}

.rule-section-summary {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.75;
  margin-bottom: 1rem;
  max-width: 820px;
}

/* Rule Actions */
.rule-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
  align-items: center;
}
.rule-copy-link,
.rule-details-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.4rem 0.9rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}
.rule-copy-link svg,
.rule-details-toggle svg {
  width: 13px; height: 13px;
  stroke: currentColor;
  flex-shrink: 0;
  transition: transform 0.25s ease;
}
.rule-copy-link:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(201,168,76,0.07);
}
.rule-details-toggle:hover,
.rule-details-toggle.open {
  border-color: var(--red);
  color: var(--text);
  background: rgba(139,26,26,0.15);
}

/* Details panel */
.rule-details-content {
  display: none;
  margin-top: 1.25rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.5rem;
  animation: detailsFade 0.25s ease;
}
.rule-details-content.open { display: block; }

@keyframes detailsFade {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.rule-details-content h4 {
  font-family: 'Cinzel', serif;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.6rem;
  margin-top: 1rem;
}
.rule-details-content h4:first-child { margin-top: 0; }

.rule-details-content p {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.75;
  margin-bottom: 0.5rem;
}
.rule-details-content ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}
.rule-details-content ul li {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.65;
  padding-left: 1.2rem;
  position: relative;
}
.rule-details-content ul li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--gold);
  font-weight: 700;
}
.rule-details-content strong { color: var(--text); }

/* Copied toast */
.copy-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--dark-red);
  color: #fff;
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  padding: 0.6rem 1.5rem;
  border-radius: 20px;
  border: 1px solid var(--red);
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
  z-index: 9999;
}
.copy-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Search no results */
.rules-no-results {
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 0.5rem 0.85rem;
  font-style: italic;
  display: none;
}

/* Responsive */
@media (max-width: 900px) {
  .rules-layout { flex-direction: column; }
  .rules-sidebar {
    width: 100%;
    position: static;
    max-height: none;
  }
  .rules-nav ul {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .rules-nav-link { font-size: 0.78rem; border-left: none; border-bottom: 2px solid transparent; }
  .rules-nav-link.active { border-bottom-color: var(--gold); border-left-color: transparent; }
}

/* =========================================================================
   RULES PAGE — REDESIGN (v2)
   Data-driven rulebook: header, grouped TOC sidebar, chapter dividers,
   rule cards with typed lists, call-outs, violations, afterword.
========================================================================= */
:root {
  --rp-green:       #4E8A5F;
  --rp-green-soft:  rgba(78,138,95,0.10);
  --rp-red-soft:    rgba(139,26,26,0.12);
  --rp-gold-soft:   rgba(201,168,76,0.08);
  --rp-card:        #141110;
  --rp-card-2:      #191413;
}

/* ── Reading progress bar ─────────────────────────────── */
.reading-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: rgba(255,255,255,0.04);
  z-index: 1001;
}
.admin-bar .reading-progress { top: 32px; }
#reading-progress-bar {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(to right, var(--dark-red), var(--gold), var(--orange));
  box-shadow: 0 0 12px rgba(201,168,76,0.5);
  transition: width 0.1s linear;
}

/* ── Page header ─────────────────────────────────────── */
.rules-page-header {
  position: relative;
  background:
    radial-gradient(ellipse at 50% -20%, rgba(139,26,26,0.35), transparent 60%),
    linear-gradient(to bottom, rgba(107,16,16,0.28) 0%, transparent 100%);
  border-bottom: 1px solid var(--border);
  padding: 3rem 2rem 2.5rem;
  text-align: center;
  overflow: hidden;
}
.rules-page-header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: min(680px, 80%);
  height: 1px;
  background: linear-gradient(to right, transparent, var(--gold), transparent);
  opacity: 0.5;
}
.rules-header-inner { max-width: 820px; margin: 0 auto; }
.rules-eyebrow {
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.85rem;
}
.rules-page-header h1 {
  font-size: clamp(1.7rem, 4vw, 2.8rem);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gold);
  text-shadow: 0 2px 20px rgba(0,0,0,0.6);
  line-height: 1.15;
}
.rules-subhead {
  color: var(--text-muted);
  font-size: 0.98rem;
  font-style: italic;
  max-width: 620px;
  margin: 1rem auto 0;
  line-height: 1.7;
}
.rules-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin: 1.5rem 0 0;
}
.rules-tags li {
  font-family: 'Cinzel', serif;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
}
.rules-header-actions {
  margin-top: 1.75rem;
  display: flex;
  justify-content: center;
}
.rules-print-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.55rem 1.2rem;
  cursor: pointer;
  transition: all 0.2s;
}
.rules-print-btn svg { width: 15px; height: 15px; }
.rules-print-btn:hover {
  border-color: var(--gold);
  background: var(--rp-gold-soft);
  transform: translateY(-1px);
}

/* ── Sidebar: grouped, collapsible TOC ───────────────── */
.rules-nav { padding-bottom: 1rem; }

.rules-nav-chapter {
  border: 1px solid transparent;
  border-radius: 6px;
  margin-bottom: 2px;
}
.rules-nav-chapter.current {
  background: rgba(255,255,255,0.02);
  border-color: var(--border);
}
.rules-nav-chapter-toggle {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.25rem 0.5rem;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.6rem 0.7rem;
  border-radius: 6px;
  transition: background 0.2s;
}
.rules-nav-chapter-toggle:hover { background: rgba(255,255,255,0.04); }
.rules-nav-chapter-label {
  grid-column: 1;
  font-family: 'Cinzel', serif;
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.rules-nav-chapter.current .rules-nav-chapter-label { color: var(--gold); }
.rules-nav-chapter-title {
  grid-column: 1;
  grid-row: 2;
  font-family: 'Cinzel', serif;
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.3;
}
.rules-nav-chapter.current .rules-nav-chapter-title { color: var(--gold-light); }
.rules-nav-chevron {
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 15px; height: 15px;
  color: var(--text-muted);
  transition: transform 0.25s ease;
}
.rules-nav-chapter.open .rules-nav-chevron { transform: rotate(180deg); }

.rules-nav .rules-nav-sublist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.25s ease;
  padding: 0 0.4rem;
}
.rules-nav-chapter.open .rules-nav-sublist {
  max-height: 640px;
  opacity: 1;
  padding: 0.15rem 0.4rem 0.5rem;
}
.rules-nav .rules-nav-link {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.42rem 0.6rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-radius: 4px;
  border-left: 2px solid transparent;
  line-height: 1.35;
  transition: background 0.2s, color 0.2s;
}
.rules-nav .rules-nav-link:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.rules-nav .rules-nav-link.active {
  color: var(--gold);
  background: var(--rp-gold-soft);
  border-left-color: var(--gold);
}
.rules-nav-num {
  flex-shrink: 0;
  width: 1.35rem; height: 1.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cinzel', serif;
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
  transition: all 0.2s;
}
.rules-nav .rules-nav-link:hover .rules-nav-num { color: var(--text); }
.rules-nav .rules-nav-link.active .rules-nav-num {
  color: var(--black);
  background: var(--gold);
}
.rules-nav-chapter.hidden { display: none; }
.rules-nav-link.hidden { display: none; }
.rules-no-results { margin-top: 0.75rem; }

/* ── Main: intro / server overview ───────────────────── */
.rules-intro {
  background: linear-gradient(180deg, var(--rp-card-2), var(--rp-card));
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2rem 2.25rem;
  margin-bottom: 2.5rem;
}
.rules-intro .rule-lead {
  color: var(--text);
  font-size: 1.05rem;
  font-style: normal;
  margin-bottom: 1rem;
}
.rules-intro > p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.8;
  margin-bottom: 1rem;
}
.rules-discretion {
  margin-top: 1.5rem;
  background: var(--rp-red-soft);
  border: 1px solid rgba(139,26,26,0.35);
  border-left: 3px solid var(--red);
  border-radius: 0 8px 8px 0;
  padding: 1.25rem 1.5rem;
}
.rules-discretion h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Cinzel', serif;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.85rem;
}
.rules-discretion h3 span { color: var(--red-light); font-size: 1.15rem; }
.rules-discretion p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.75;
  margin-bottom: 0.7rem;
}
.rules-discretion p:last-child { margin-bottom: 0; color: var(--text); }

/* ── Chapter dividers ────────────────────────────────── */
.rule-chapter { scroll-margin-top: 90px; }
.chapter-divider {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.75rem 0 1.5rem;
  margin: 1rem 0 2rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  position: relative;
}
.rule-chapter:first-of-type .chapter-divider { border-top: none; padding-top: 0; margin-top: 0; }
.chapter-numeral {
  flex-shrink: 0;
  width: 68px; height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cinzel', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold);
  background: radial-gradient(circle at 50% 35%, rgba(139,26,26,0.4), rgba(0,0,0,0.2));
  border: 1px solid var(--red);
  border-radius: 50%;
  box-shadow: 0 0 24px rgba(139,26,26,0.25), inset 0 0 12px rgba(0,0,0,0.4);
  letter-spacing: 0.02em;
}
.chapter-label {
  display: block;
  font-family: 'Cinzel', serif;
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}
.chapter-title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  letter-spacing: 0.03em;
  color: var(--gold);
  margin-bottom: 0.35rem;
  line-height: 1.15;
}
.chapter-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-style: italic;
  margin: 0;
}

/* ── Rule cards ──────────────────────────────────────── */
.rule-section {
  background: var(--rp-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.6rem 1.75rem;
  margin-bottom: 1.25rem;
  scroll-margin-top: 90px;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
  position: relative;
}
.rule-section::before {
  content: '';
  position: absolute;
  left: 0; top: 1.4rem; bottom: 1.4rem;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(to bottom, var(--dark-red), transparent);
  opacity: 0;
  transition: opacity 0.25s;
}
.rule-section:hover,
.rule-section:target {
  border-color: rgba(201,168,76,0.4);
  box-shadow: 0 6px 28px rgba(0,0,0,0.35);
}
.rule-section:hover::before,
.rule-section:target::before { opacity: 1; }
.rule-section:target { border-color: var(--gold); }

.rule-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.15rem;
}
.rule-section-title { display: flex; align-items: center; gap: 0.9rem; flex: 1; }
.rule-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem; height: 2.4rem;
  min-width: 2.4rem;
  background: linear-gradient(145deg, var(--dark-red), rgba(0,0,0,0.3));
  border: 1px solid var(--red);
  border-radius: 8px;
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold-light);
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.08);
}
.rule-section-title h3 {
  font-family: 'Cinzel', serif;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  color: var(--gold);
  margin: 0;
  line-height: 1.3;
}
.rule-copy-link { padding: 0.4rem 0.75rem; }
.rule-copy-link span { display: inline; }

.rule-body { color: var(--text-muted); font-size: 0.94rem; line-height: 1.8; max-width: none; margin: 0; }
.rule-body > p { margin-bottom: 1rem; }
.rule-body > p:last-child { margin-bottom: 0; }
.rule-lead {
  color: var(--text);
  font-size: 1.02rem;
  font-weight: 500;
  margin-bottom: 1rem;
  padding-left: 0.9rem;
  border-left: 3px solid var(--gold);
}
.rule-subhead {
  font-family: 'Cinzel', serif;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-light);
  margin: 1.5rem 0 0.75rem;
}

/* Injury-style sub-cards */
.rule-subcard {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-left: 3px solid var(--orange);
  border-radius: 0 6px 6px 0;
  padding: 0.85rem 1.1rem;
  margin-bottom: 0.65rem;
}
.rule-subcard-title {
  display: block;
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  color: var(--orange);
  margin-bottom: 0.25rem;
}
.rule-subcard p { margin: 0; font-size: 0.88rem; color: var(--text-muted); line-height: 1.7; }

/* Typed lists (must / must-not / neutral) */
.rule-list {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem 1.1rem;
  margin: 1rem 0;
}
.rule-list--must    { border-left: 3px solid var(--rp-green); background: var(--rp-green-soft); }
.rule-list--mustnot { border-left: 3px solid var(--red);      background: var(--rp-red-soft); }
.rule-list--neutral { border-left: 3px solid var(--gold);     background: var(--rp-gold-soft); }
.rule-list-title {
  font-family: 'Cinzel', serif;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 0.7rem !important;
}
.rule-list--must .rule-list-title    { color: #8fce9f; }
.rule-list--mustnot .rule-list-title { color: var(--red-light); }
.rule-list--neutral .rule-list-title { color: var(--gold-light); }
.rule-list ul { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; margin: 0; }
.rule-list li {
  position: relative;
  padding-left: 1.7rem;
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text-muted);
}
.rule-list li::before {
  position: absolute;
  left: 0; top: -0.05rem;
  width: 1.15rem; height: 1.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 50%;
  line-height: 1;
}
.rule-list--must li::before    { content: '\2713'; color: #8fce9f; background: rgba(78,138,95,0.18); }
.rule-list--mustnot li::before { content: '\2715'; color: var(--red-light); background: rgba(192,57,43,0.18); }
.rule-list--neutral li::before { content: '\203A'; color: var(--gold); background: var(--rp-gold-soft); font-size: 0.9rem; }

/* Call-out note */
.rule-note {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  background: linear-gradient(90deg, rgba(212,115,26,0.10), transparent);
  border: 1px solid rgba(212,115,26,0.3);
  border-left: 3px solid var(--orange);
  border-radius: 0 8px 8px 0;
  padding: 0.9rem 1.15rem;
  margin: 1.1rem 0 0;
}
.rule-note-icon {
  flex-shrink: 0;
  width: 1.5rem; height: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--black);
  background: var(--orange);
  border-radius: 50%;
  margin-top: 0.1rem;
}
.rule-note p { margin: 0; color: var(--text); font-size: 0.9rem; line-height: 1.7; }

/* Chapter violations box */
.chapter-violations {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: repeating-linear-gradient(45deg, rgba(139,26,26,0.08), rgba(139,26,26,0.08) 12px, rgba(139,26,26,0.14) 12px, rgba(139,26,26,0.14) 24px);
  border: 1px solid rgba(139,26,26,0.45);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin: 1.75rem 0 0.5rem;
}
.chapter-violations-icon { font-size: 1.6rem; line-height: 1.2; color: var(--red-light); flex-shrink: 0; }
.chapter-violations h4 {
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--red-light);
  margin-bottom: 0.5rem;
}
.chapter-violations p { color: var(--text); font-size: 0.88rem; line-height: 1.7; margin: 0; }

/* ── Afterword ───────────────────────────────────────── */
.rules-afterword {
  background: linear-gradient(180deg, var(--rp-card-2), var(--rp-card));
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2.25rem 2.5rem;
  position: relative;
}
.rules-afterword::before {
  content: '\201C';
  position: absolute;
  top: 0.5rem; left: 1.25rem;
  font-family: 'Cinzel', serif;
  font-size: 4rem;
  color: rgba(201,168,76,0.18);
  line-height: 1;
}
.rules-afterword p {
  color: var(--text-muted);
  font-size: 0.96rem;
  line-height: 1.9;
  margin-bottom: 1.15rem;
}
.afterword-welcome {
  font-family: 'Cinzel', serif;
  font-size: 1.15rem !important;
  color: var(--gold) !important;
  text-align: center;
  letter-spacing: 0.04em;
  margin: 1.75rem 0 !important;
}
.afterword-signature {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  align-items: flex-end;
  text-align: right;
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
  margin-top: 1.5rem;
}
.afterword-signoff { color: var(--text-muted); font-style: italic; font-size: 0.9rem; }
.afterword-name {
  font-family: 'Cinzel', serif;
  font-size: 1.05rem;
  color: var(--gold-light);
  letter-spacing: 0.02em;
}
.afterword-role {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ── Back to top ─────────────────────────────────────── */
.rules-back-to-top {
  position: fixed;
  right: 1.5rem; bottom: 1.5rem;
  width: 46px; height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--dark-red);
  border: 1px solid var(--red);
  border-radius: 50%;
  color: var(--gold);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.25s, transform 0.25s, visibility 0.25s, background 0.2s;
  z-index: 900;
  box-shadow: 0 4px 18px rgba(0,0,0,0.5);
}
.rules-back-to-top svg { width: 22px; height: 22px; }
.rules-back-to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.rules-back-to-top:hover { background: var(--red); color: var(--gold-light); transform: translateY(-2px); }

/* ── Responsive overrides (v2) ───────────────────────── */
@media (max-width: 900px) {
  .rules-layout { flex-direction: column; gap: 1.5rem; }
  .rules-sidebar { width: 100%; position: static; max-height: none; }
  .rules-nav .rules-nav-sublist { max-height: 0; }
  .rules-nav-chapter.open .rules-nav-sublist { max-height: 640px; }
  .rule-section { padding: 1.35rem 1.25rem; }
  .chapter-divider { gap: 1rem; }
  .chapter-numeral { width: 54px; height: 54px; font-size: 1.2rem; }
}

@media (max-width: 560px) {
  .rules-page-header { padding: 2.25rem 1.25rem 2rem; }
  .rules-intro { padding: 1.5rem 1.25rem; }
  .rules-afterword { padding: 1.75rem 1.35rem; }
  .rule-section-header { flex-wrap: wrap; }
  .rule-copy-link span { display: none; }
  .rule-copy-link { padding: 0.4rem 0.5rem; }
}

/* ── Print ───────────────────────────────────────────── */
@media print {
  #site-header, #site-footer, .reading-progress, .rules-sidebar,
  .rules-back-to-top, .rules-header-actions, .rule-actions { display: none !important; }
  body { background: #fff; color: #111; }
  #rules-page { padding-top: 0; }
  .rules-layout { display: block; padding: 0; }
  .rule-section, .rules-intro, .rules-afterword, .chapter-violations, .rule-list, .rule-note {
    break-inside: avoid;
    border-color: #ccc;
    background: #fff;
    box-shadow: none;
  }
  .rule-section-title h3, .chapter-title, .rules-page-header h1, .rule-subhead,
  .rule-list-title, .chapter-label, .rules-eyebrow { color: #6B1010; }
  .rule-body, .rule-list li, .rules-intro > p, .rules-afterword p, .rule-note p { color: #222; }
}

/* =========================================================================
   RULES PAGE — READABILITY (larger reading type)
   Bumps the long-form reading sizes on the rulebook. Grouped here so the
   scale is easy to tune in one place.
========================================================================= */
/* Intro / server overview */
.rules-subhead              { font-size: 1.08rem; }
.rules-intro .rule-lead     { font-size: 1.22rem; line-height: 1.65; }
.rules-intro > p            { font-size: 1.08rem; line-height: 1.85; }
.rules-discretion h3        { font-size: 1.02rem; }
.rules-discretion p         { font-size: 1rem; line-height: 1.8; }

/* Chapter dividers */
.chapter-desc               { font-size: 1rem; }

/* Rule cards */
.rule-section-title h3      { font-size: 1.3rem; }
.rule-body                  { font-size: 1.08rem; line-height: 1.85; }
.rule-lead                  { font-size: 1.16rem; }
.rule-subhead               { font-size: 0.92rem; }
.rule-subcard-title         { font-size: 0.9rem; }
.rule-subcard p             { font-size: 1rem; line-height: 1.75; }

/* Typed lists */
.rule-list-title            { font-size: 0.86rem; }
.rule-list li               { font-size: 1.02rem; line-height: 1.7; }

/* Call-outs, violations, afterword */
.rule-note p                { font-size: 1rem; line-height: 1.75; }
.chapter-violations h4      { font-size: 0.92rem; }
.chapter-violations p       { font-size: 1rem; line-height: 1.75; }
.rules-afterword p          { font-size: 1.1rem; line-height: 1.9; }

/* Sidebar table of contents */
#rules-search               { font-size: 0.92rem; }
.rules-nav-chapter-title    { font-size: 0.9rem; }
.rules-nav .rules-nav-link  { font-size: 0.9rem; }

@media (max-width: 560px) {
  .rules-intro .rule-lead { font-size: 1.12rem; }
  .rule-body              { font-size: 1.04rem; }
  .rule-list li           { font-size: 1rem; }
  .rule-section-title h3  { font-size: 1.18rem; }
}

/* =========================================================================
   FACTIONS PAGE
   Reuses the handbook UI (.rules-* / .rule-*). Only the page wrapper and two
   faction-specific components (org-type chips + numeric-limit stat cards)
   are defined here.
========================================================================= */
.factions-page {
  padding-top: 70px;
  min-height: 100vh;
  background: var(--black);
}
.admin-bar .factions-page { padding-top: 102px; }

/* Header CTA (Register a Faction) */
.rules-header-actions { gap: 0.75rem; flex-wrap: wrap; }
.rules-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  background: var(--red);
  border: 1px solid var(--dark-red);
  border-radius: 4px;
  padding: 0.55rem 1.25rem;
  box-shadow: 0 0 18px rgba(139,26,26,0.35);
  transition: all 0.2s;
}
.rules-cta-btn svg { width: 15px; height: 15px; }
.rules-cta-btn:hover {
  background: var(--red-light);
  border-color: var(--red-light);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 22px rgba(192,57,43,0.45);
}

/* Organization-type chips */
.faction-types {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}
.faction-types li {
  font-family: 'Cinzel', serif;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  color: var(--text);
  background: var(--rp-gold-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.42rem 0.95rem;
  transition: all 0.2s;
}
.faction-types li:hover {
  border-color: var(--gold);
  color: var(--gold-light);
  background: rgba(201,168,76,0.14);
  transform: translateY(-1px);
}

/* Numeric-limit stat cards */
.faction-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1.25rem 0;
}
.faction-stat {
  text-align: center;
  background: linear-gradient(180deg, rgba(139,26,26,0.18), rgba(139,26,26,0.06));
  border: 1px solid rgba(139,26,26,0.4);
  border-radius: 10px;
  padding: 1.15rem 0.75rem;
  transition: border-color 0.25s, transform 0.25s;
}
.faction-stat:hover { border-color: var(--gold); transform: translateY(-2px); }
.faction-stat-num {
  display: block;
  font-family: 'Cinzel', serif;
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 0.4rem;
}
.faction-stat-label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  line-height: 1.35;
}
@media (max-width: 560px) {
  .faction-stats { grid-template-columns: 1fr; gap: 0.75rem; }
  .faction-stat { display: flex; align-items: center; justify-content: center; gap: 0.75rem; padding: 0.85rem 1rem; }
  .faction-stat-num { font-size: 1.6rem; margin-bottom: 0; }
}

/* =========================================================================
   FRONT PAGE — V2 (flipbook, RDR2 parallax, richer hero & about)
========================================================================= */

/* Hero polish */
.hero-bg { will-change: transform; }
.hero-grain {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.05;
  background-image: radial-gradient(rgba(255,255,255,0.5) 1px, transparent 1px);
  background-size: 3px 3px;
  mix-blend-mode: overlay;
}
.hero-subtagline {
  font-family: 'Roboto Slab', serif;
  font-size: clamp(0.85rem, 1.5vw, 1.1rem);
  color: var(--text-muted);
  margin-top: -0.5rem;
  text-shadow: 0 2px 12px rgba(0,0,0,0.95);
}
.hero-subtagline em { color: var(--gold); font-style: normal; }
.hero-scroll-down { cursor: pointer; }

/* Handbook flipbook */
.flipbook-section { background: var(--dark); position: relative; overflow: hidden; }
.flipbook-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(139,26,26,0.10), transparent 60%);
  pointer-events: none;
}
.flip-frame {
  position: relative;
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #0a0a0a;
  box-shadow: 0 24px 70px rgba(0,0,0,0.6), inset 0 0 0 1px rgba(201,168,76,0.08);
}
.flip-embed { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.flip-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-top: 2.25rem;
}

/* About media image */
.about-media {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  min-height: 340px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.5);
}
.about-media img {
  width: 100%;
  height: 100%;
  min-height: 340px;
  object-fit: cover;
  display: block;
  will-change: transform;
}
.about-media-frame {
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(201,168,76,0.4);
  border-radius: 6px;
  pointer-events: none;
  z-index: 2;
}
.about-stats { grid-template-columns: repeat(4, 1fr); margin-top: 3rem; }

/* Parallax bands */
.parallax-band {
  position: relative;
  overflow: hidden;
  min-height: 460px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 1.5rem;
  background-color: #0a0a0a;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.parallax-band-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  will-change: transform;
}
.parallax-band::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 35%, rgba(0,0,0,0.6)),
    linear-gradient(rgba(10,6,3,0.42), rgba(8,4,2,0.66));
}
.parallax-band-inner { position: relative; z-index: 2; max-width: 780px; }
.parallax-quote-mark {
  display: block;
  font-family: 'Cinzel', serif;
  font-size: 4rem;
  line-height: 0.4;
  color: var(--gold);
  opacity: 0.5;
  margin-bottom: 1.25rem;
}
.parallax-quote {
  font-family: 'Cinzel', serif;
  font-size: clamp(1.25rem, 3vw, 2rem);
  line-height: 1.5;
  color: #fff;
  text-shadow: 0 2px 24px rgba(0,0,0,0.95);
}
.parallax-quote-by {
  display: block;
  margin-top: 1.5rem;
  font-size: 0.78rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold);
}

/* Front page responsive */
@media (max-width: 900px) {
  .about-stats { grid-template-columns: 1fr 1fr; }
  .about-media { min-height: 260px; }
}
@media (max-width: 768px) {
  .parallax-band { min-height: 360px; padding: 4rem 1.5rem; }
  .flip-frame { aspect-ratio: 3 / 4; }
}
/* Parallax intentionally runs even under prefers-reduced-motion, per owner request.
   The JS applies the transforms; no reduced-motion override here. */

/* =========================================================================
   CUSTOM PAGE-FLIP HANDBOOK (self-hosted 3D book — replaces the iframe)
========================================================================= */
.flipbook-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}
.flipbook {
  position: relative;
  width: min(1120px, 96vw);
  aspect-ratio: 1.412 / 1; /* two portrait pages side by side (√2 spread) */
  perspective: 2800px;
  user-select: none;
}
/* leather board behind the pages */
.flipbook::before {
  content: '';
  position: absolute;
  inset: -10px -14px;
  border-radius: 6px 12px 12px 6px;
  background:
    linear-gradient(90deg, rgba(0,0,0,0.45), transparent 6%, transparent 94%, rgba(0,0,0,0.3)),
    linear-gradient(135deg, #2a1410, #180b08);
  box-shadow: 0 30px 70px rgba(0,0,0,0.6);
  z-index: 0;
}
/* centre spine shadow */
.flipbook::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0; left: 50%;
  width: 30px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, rgba(0,0,0,0), rgba(0,0,0,0.45), rgba(0,0,0,0));
  z-index: 70;
  pointer-events: none;
}
.flip-leaf {
  position: absolute;
  top: 0; right: 0;
  width: 50%;
  height: 100%;
  transform-origin: left center;
  transform-style: preserve-3d;
  transition: transform 0.95s cubic-bezier(0.645, 0.045, 0.355, 1);
  cursor: pointer;
}
.flip-leaf.flipped { transform: rotateY(-180deg); }
.leaf-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: 2px 6px 6px 2px;
}
.leaf-back { transform: rotateY(180deg); border-radius: 6px 2px 2px 6px; }

/* Full-bleed rendered PDF pages */
.book-img { padding: 0; background: #140a08; }
.book-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}
.book-endpaper {
  background:
    radial-gradient(120% 120% at 0 50%, rgba(0,0,0,0.15), transparent 60%),
    linear-gradient(#2a1712, #1c0f0b);
}
/* gutter (spine-side) shadow for depth */
.book-img.leaf-front::after,
.book-img.leaf-back::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 9%;
  pointer-events: none;
  z-index: 3;
}
.book-img.leaf-front::after { left: 0;  background: linear-gradient(90deg,  rgba(0,0,0,0.32), transparent); }
.book-img.leaf-back::after  { right: 0; background: linear-gradient(270deg, rgba(0,0,0,0.32), transparent); }

/* Parchment page */
.book-page {
  background:
    radial-gradient(130% 130% at 100% 50%, rgba(0,0,0,0.05), transparent 55%),
    linear-gradient(#efe4cd, #e3d3b2);
  color: #3a2a18;
  padding: clamp(1rem, 3.2vw, 2rem) clamp(1rem, 3vw, 1.9rem);
}
.book-page.leaf-front { box-shadow: inset 16px 0 26px -16px rgba(60,30,10,0.55); }
.book-page.leaf-back  { box-shadow: inset -16px 0 26px -16px rgba(60,30,10,0.55); }
.book-page h3 {
  font-family: 'Cinzel', serif;
  color: #7a1f16;
  font-size: clamp(1rem, 2.6vw, 1.5rem);
  letter-spacing: 0.03em;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(122,31,22,0.25);
}
.book-page p {
  font-size: clamp(0.72rem, 1.7vw, 0.95rem);
  line-height: 1.65;
  margin-bottom: 0.7rem;
  color: #4a3826;
}
.book-page ul, .book-page ol { margin: 0 0 0.5rem; padding-left: 1.15rem; }
.book-page li {
  font-size: clamp(0.72rem, 1.7vw, 0.92rem);
  line-height: 1.5;
  margin-bottom: 0.42rem;
  color: #4a3826;
}
.book-page li::marker { color: #7a1f16; font-weight: 700; }
.book-links { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 0.5rem; }
.book-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: 'Cinzel', serif;
  font-size: clamp(0.72rem, 1.7vw, 0.9rem);
  color: #7a1f16;
  border: 1px solid rgba(122,31,22,0.35);
  border-radius: 4px;
  padding: 0.5rem 0.8rem;
  background: rgba(122,31,22,0.05);
  transition: all 0.2s;
}
.book-links a:hover { background: rgba(122,31,22,0.13); color: #5a1710; }
.page-num {
  margin-top: auto;
  text-align: center;
  font-family: 'Cinzel', serif;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  color: #9a8358;
  padding-top: 0.5rem;
}

/* Leather cover / title & back pages */
.book-cover {
  background:
    radial-gradient(130% 130% at 50% 25%, rgba(201,168,76,0.10), transparent 55%),
    linear-gradient(145deg, #3a0f0c, #23090a 60%, #180708);
  color: var(--gold);
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem;
}
.book-cover::before {
  content: '';
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(201,168,76,0.4);
  border-radius: 4px;
  pointer-events: none;
}
.book-cover img {
  width: clamp(64px, 22%, 118px);
  margin-bottom: 1rem;
  filter: drop-shadow(0 4px 14px rgba(0,0,0,0.6));
}
.book-cover .cover-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(1.2rem, 3.4vw, 2rem);
  color: var(--gold-light);
  letter-spacing: 0.06em;
  line-height: 1.1;
}
.book-cover .cover-sub {
  font-family: 'Cinzel', serif;
  font-size: clamp(0.7rem, 1.8vw, 1rem);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: 0.5rem;
}
.book-cover .cover-rule {
  width: 60%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 1rem auto;
  opacity: 0.6;
}
.book-cover .cover-foot {
  font-size: clamp(0.62rem, 1.5vw, 0.8rem);
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* Controls */
.flipbook-controls { display: flex; align-items: center; gap: 1.25rem; }
.book-btn {
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.5rem 1.1rem;
  cursor: pointer;
  transition: all 0.2s;
}
.book-btn:hover:not(:disabled) { border-color: var(--gold); background: var(--rp-gold-soft); }
.book-btn:disabled { opacity: 0.35; cursor: default; }
.book-progress {
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  min-width: 96px;
  text-align: center;
}
.book-hint { font-size: 0.74rem; color: var(--text-muted); font-style: italic; }

@media (max-width: 600px) {
  .book-page { padding: 0.9rem 0.85rem; }
}
