/* ===== CSS VARIABLES ===== */
:root {
  --bg: #0d0a1a;
  --bg2: #12082a;
  --purple: #9b59d0;
  --purple-light: #c084fc;
  --purple-deep: #5b21b6;
  --gold: #d4a017;
  --gold-light: #f0c040;
  --ink: #2a1f0e;
  --ink-light: #4a3520;
  --parchment: #f5ead6;
  --parchment-dark: #e0c898;

  /* Book page colors */
  --page-bg: linear-gradient(135deg, #f5ead6 0%, #ede0c4 40%, #e8d5b0 100%);
  --page-dark-bg: linear-gradient(135deg, #1a0d2e 0%, #130a22 100%);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Lora', serif;
  background: var(--bg);
  color: var(--ink);
  overflow-x: hidden;
  min-height: 100vh;
}

/* ===== LOADING ===== */
#loading-screen {
  position: fixed; inset: 0;
  background: var(--bg);
  z-index: 9999;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  transition: opacity 0.8s ease;
}
#loading-screen.fade-out { opacity: 0; pointer-events: none; }

.loading-rune {
  width: 100px; height: 100px;
  border: 3px solid var(--purple);
  border-radius: 50%;
  animation: spin-rune 3s linear infinite;
  position: relative;
  box-shadow: 0 0 30px var(--purple), inset 0 0 20px rgba(155,89,208,0.15);
}
.loading-rune::before {
  content: '';
  position: absolute; inset: 10px;
  border: 2px dashed var(--gold);
  border-radius: 50%;
  animation: spin-rune 2s linear infinite reverse;
}
@keyframes spin-rune { to { transform: rotate(360deg); } }

.loading-title {
  font-family: 'Cinzel Decorative', serif;
  color: var(--purple-light);
  font-size: 1.8rem;
  margin-top: 1.5rem;
  letter-spacing: 0.3em;
  animation: pulse-glow 1.5s ease-in-out infinite;
}
.loading-sub {
  font-family: 'Lora', serif;
  font-style: italic;
  color: #6b7280;
  margin-top: 0.4rem;
  font-size: 0.85rem;
}
@keyframes pulse-glow { 0%,100% { opacity:0.5; } 50% { opacity:1; } }

/* ===== CANVASES ===== */
#particles-canvas, #butterfly-canvas {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0;
}

/* ===== NAVBAR ===== */
#navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(13,10,26,0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(155,89,208,0.25);
  transition: background 0.3s;
}
#navbar.scrolled { background: rgba(13,10,26,0.98); }

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.7rem 2rem;
  display: flex; align-items: center; gap: 2rem;
}

.nav-logo {
  display: flex; align-items: center; gap: 0.6rem;
  text-decoration: none;
  flex-shrink: 0;
}
.nav-logo img {
  height: 44px; width: 44px; object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(192,132,252,0.5));
}
.nav-logo span {
  font-family: 'Cinzel Decorative', serif;
  font-size: 1.15rem;
  color: var(--purple-light);
  letter-spacing: 0.1em;
  text-shadow: 0 0 15px rgba(192,132,252,0.4);
}

.nav-links {
  display: flex; align-items: center; gap: 1.75rem;
  list-style: none; flex: 1;
}
.nav-links a {
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  color: #c4b5fd;
  text-decoration: none;
  letter-spacing: 0.1em;
  transition: color 0.2s;
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute; bottom: -3px; left: 0; right: 0;
  height: 1px; background: var(--gold);
  transform: scaleX(0); transition: transform 0.2s;
}
.nav-links a:hover, .nav-links a.nav-active { color: var(--gold-light); }
.nav-links a:hover::after, .nav-links a.nav-active::after { transform: scaleX(1); }

.btn-join {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  padding: 0.5rem 1.25rem;
  background: linear-gradient(135deg, var(--purple-deep), var(--purple));
  color: white;
  border: 1px solid var(--purple-light);
  border-radius: 4px;
  cursor: pointer;
  letter-spacing: 0.1em;
  transition: all 0.2s;
  box-shadow: 0 0 12px rgba(155,89,208,0.3);
  white-space: nowrap;
  flex-shrink: 0;
}
.btn-join:hover { box-shadow: 0 0 25px rgba(155,89,208,0.7); transform: translateY(-1px); }

.hamburger {
  display: none; flex-direction: column; gap: 5px;
  cursor: pointer; padding: 5px; flex-shrink: 0;
}
.hamburger span { display: block; width: 22px; height: 2px; background: var(--purple-light); transition: all 0.3s; }
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu {
  display: none; position: fixed; inset: 0; top: 68px;
  background: rgba(13,10,26,0.98); z-index: 999;
  padding: 2.5rem; flex-direction: column; gap: 1.5rem; align-items: center;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  font-family: 'Cinzel', serif; font-size: 1.05rem;
  color: var(--purple-light); text-decoration: none;
  letter-spacing: 0.15em;
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,0.8); backdrop-filter: blur(6px);
  display: none; align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: linear-gradient(135deg, #1a0d2e, #0d0a1a);
  border: 1px solid var(--purple);
  border-radius: 8px; padding: 2.5rem;
  max-width: 460px; width: 90%;
  box-shadow: 0 0 60px rgba(155,89,208,0.4);
  position: relative;
  animation: modal-pop 0.3s ease;
}
@keyframes modal-pop { from { opacity:0; transform:scale(0.9); } to { opacity:1; transform:scale(1); } }
.modal-close {
  position: absolute; top: 1rem; right: 1rem;
  background: none; border: none; color: #9ca3af;
  cursor: pointer; font-size: 1.2rem;
}
.modal-close:hover { color: white; }
.modal-title {
  font-family: 'Cinzel Decorative', serif;
  color: var(--purple-light); font-size: 1.3rem;
  text-align: center; margin-bottom: 0.4rem; letter-spacing: 0.1em;
}
.modal-sub { font-family: 'Lora', serif; font-style: italic; color: #9ca3af; text-align: center; font-size: 0.85rem; margin-bottom: 1rem; }
.ip-row {
  background: rgba(0,0,0,0.4); border: 1px solid rgba(155,89,208,0.4);
  border-radius: 6px; padding: 0.85rem 1rem;
  display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.25rem;
}
.ip-text {
  font-family: 'Cinzel', serif;
  color: var(--gold-light); font-size: 1rem; flex: 1;
}
.modal-steps { margin-bottom: 1.5rem; }
.steps-label {
  font-family: 'Cinzel', serif; font-size: 0.7rem;
  color: #9ca3af; letter-spacing: 0.2em; text-transform: uppercase;
  margin-bottom: 0.75rem;
}
.modal-step {
  display: flex; gap: 0.75rem; align-items: flex-start;
  margin-bottom: 0.5rem; font-size: 0.82rem; color: #c4b5fd;
}
.step-dot {
  min-width: 22px; height: 22px;
  background: rgba(155,89,208,0.25); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Cinzel', serif; font-size: 0.65rem;
  color: var(--purple-light); flex-shrink: 0;
}
.modal-actions { display: flex; gap: 0.75rem; }

/* ===== BUTTONS ===== */
.btn-primary {
  font-family: 'Cinzel', serif; font-size: 0.8rem;
  padding: 0.75rem 1.75rem;
  background: linear-gradient(135deg, var(--purple-deep), var(--purple));
  color: white; border: 1px solid var(--purple-light);
  border-radius: 4px; cursor: pointer;
  letter-spacing: 0.12em; transition: all 0.25s;
  box-shadow: 0 0 16px rgba(155,89,208,0.35);
  text-decoration: none; display: inline-block;
}
.btn-primary:hover { box-shadow: 0 0 35px rgba(155,89,208,0.75); transform: translateY(-2px); }

.btn-secondary {
  font-family: 'Cinzel', serif; font-size: 0.8rem;
  padding: 0.75rem 1.75rem;
  background: transparent; color: var(--gold-light);
  border: 1px solid var(--gold);
  border-radius: 4px; cursor: pointer;
  letter-spacing: 0.12em; transition: all 0.25s;
  text-decoration: none; display: inline-block;
}
.btn-secondary:hover { background: rgba(212,160,23,0.1); transform: translateY(-2px); }

.btn-ghost {
  font-family: 'Cinzel', serif; font-size: 0.8rem;
  padding: 0.75rem 1.75rem;
  background: transparent; color: #c4b5fd;
  border: 1px solid rgba(192,132,252,0.35);
  border-radius: 4px; cursor: pointer;
  letter-spacing: 0.12em; transition: all 0.25s;
  text-decoration: none; display: inline-block;
}
.btn-ghost:hover { background: rgba(192,132,252,0.1); transform: translateY(-2px); }

.copy-btn {
  font-family: 'Cinzel', serif; font-size: 0.72rem;
  padding: 0.4rem 1rem;
  background: linear-gradient(135deg, var(--purple-deep), var(--purple));
  border: 1px solid var(--purple-light);
  border-radius: 4px; color: white; cursor: pointer;
  letter-spacing: 0.05em; transition: all 0.2s; white-space: nowrap;
}
.copy-btn:hover { box-shadow: 0 0 15px rgba(155,89,208,0.6); }
.copy-btn.copied { background: linear-gradient(135deg, #065f46, #059669); border-color: #34d399; }
.copy-btn.sm { font-size: 0.65rem; padding: 0.3rem 0.75rem; }

/* ===== OPEN BOOK — SHARED ===== */
.open-book, .book-spread {
  display: flex;
  align-items: stretch;
  max-width: 1080px;
  width: 95%;
  margin: 0 auto;
  position: relative;
  filter: drop-shadow(0 30px 60px rgba(0,0,0,0.6));
}

.book-page {
  flex: 1;
  position: relative;
  overflow: hidden;
}

/* Dark mode pages (hero, wiki, etc.) */
.book-page.book-left {
  background: var(--page-dark-bg);
  border: 1px solid rgba(155,89,208,0.35);
  border-right: none;
  border-radius: 6px 0 0 6px;
  padding: 0;
}

.book-page.book-right {
  background: var(--page-dark-bg);
  border: 1px solid rgba(155,89,208,0.35);
  border-left: none;
  border-radius: 0 6px 6px 0;
  padding: 0;
}

/* Parchment pages for About, shop featured */
.book-page.parchment-page {
  background: var(--page-bg) !important;
}
.book-page.parchment-page .left-page-content,
.book-page.parchment-page .right-page-content {
  color: var(--ink);
}

/* Page corner ornaments */
.page-corner {
  position: absolute;
  width: 18px; height: 18px;
  z-index: 2; pointer-events: none;
}
.page-corner.tl { top: 8px; left: 8px; border-top: 2px solid var(--gold); border-left: 2px solid var(--gold); }
.page-corner.tr { top: 8px; right: 8px; border-top: 2px solid var(--gold); border-right: 2px solid var(--gold); }
.page-corner.bl { bottom: 8px; left: 8px; border-bottom: 2px solid var(--gold); border-left: 2px solid var(--gold); }
.page-corner.br { bottom: 8px; right: 8px; border-bottom: 2px solid var(--gold); border-right: 2px solid var(--gold); }

/* Page inner content wrappers */
.left-page-content, .right-page-content {
  padding: 2.5rem 2rem 2.5rem 2.5rem;
  height: 100%; display: flex; flex-direction: column;
}
.right-page-content { padding: 2.5rem 2.5rem 2.5rem 2rem; }

/* Book spine shadow */
.book-spine-shadow {
  width: 24px; flex-shrink: 0;
  background: linear-gradient(90deg, rgba(0,0,0,0.4), rgba(155,89,208,0.15), rgba(0,0,0,0.4));
  position: relative; z-index: 10;
}
.book-spine-shadow::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(155,89,208,0.1) 30%, rgba(155,89,208,0.2) 50%, rgba(155,89,208,0.1) 70%, transparent 100%);
}

/* ===== PAGE TEXT STYLES ===== */
.page-chapter-label {
  font-family: 'Cinzel', serif;
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.4rem;
}

.page-heading {
  font-family: 'Cinzel Decorative', serif;
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  color: var(--purple-light);
  letter-spacing: 0.05em;
  line-height: 1.2;
  text-shadow: 0 0 20px rgba(192,132,252,0.3);
}

.page-body {
  font-family: 'Lora', serif;
  font-size: 0.88rem;
  color: #c4b5fd;
  line-height: 1.8;
  margin-top: 0.75rem;
}

.rune-divider {
  display: flex; align-items: center; gap: 0.6rem;
  margin: 0.75rem 0;
}
.rune-divider span {
  flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212,160,23,0.4));
}
.rune-divider.sm span { max-width: 60px; }
.rune-divider span:last-child {
  background: linear-gradient(90deg, rgba(212,160,23,0.4), transparent);
}
.rune-gem {
  width: 8px; height: 8px;
  background: var(--gold);
  transform: rotate(45deg);
  box-shadow: 0 0 8px var(--gold);
  flex-shrink: 0;
}
.rune-gem.sm { width: 6px; height: 6px; }

/* ===== HERO ===== */
.hero-section {
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 100px 1rem 3rem;
  position: relative; z-index: 1; overflow: hidden;
}

.hero-bg-img {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: 0.2;
}
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, var(--bg) 0%, rgba(13,10,26,0.3) 40%, rgba(13,10,26,0.3) 70%, var(--bg) 100%);
}
.hero-glow {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 60%, rgba(155,89,208,0.18) 0%, transparent 65%);
}

.hero-logo-img {
  width: 100px; height: 100px;
  object-fit: contain; margin: 0 auto 1rem;
  filter: drop-shadow(0 0 25px rgba(192,132,252,0.7));
  animation: float-logo 4s ease-in-out infinite;
  display: block;
}
@keyframes float-logo { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

.hero-title {
  font-family: 'Cinzel Decorative', serif;
  font-size: clamp(2rem, 6vw, 4rem);
  color: var(--purple-light);
  letter-spacing: 0.2em;
  text-align: center;
  text-shadow: 0 0 40px rgba(192,132,252,0.8), 0 0 80px rgba(155,89,208,0.4);
  animation: title-glow 3s ease-in-out infinite alternate;
  line-height: 1.1;
}
@keyframes title-glow {
  from { text-shadow: 0 0 25px rgba(192,132,252,0.5); }
  to { text-shadow: 0 0 50px rgba(192,132,252,1), 0 0 90px rgba(155,89,208,0.5); }
}
.hero-tagline {
  font-family: 'Lora', serif; font-style: italic;
  color: #c4b5fd; font-size: 0.9rem; text-align: center;
  margin-top: 0.75rem; line-height: 1.5;
}
.hero-sub {
  font-family: 'Cinzel', serif; font-size: 0.65rem;
  color: var(--gold); letter-spacing: 0.3em;
  text-transform: uppercase; text-align: center;
  margin-top: 0.5rem; margin-bottom: 1.5rem;
}
.hero-btns {
  display: flex; gap: 0.75rem; justify-content: center;
  flex-wrap: wrap; margin-top: 0.5rem;
}

.left-page-content {
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
}

/* Features mini grid */
.feature-grid-mini {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 0.6rem; margin-top: 1.25rem; width: 100%;
}
.feature-mini {
  display: flex; align-items: center; gap: 0.5rem;
  background: rgba(155,89,208,0.1);
  border: 1px solid rgba(155,89,208,0.2);
  border-radius: 4px; padding: 0.5rem 0.6rem;
  font-family: 'Cinzel', serif; font-size: 0.7rem;
  color: #c4b5fd; letter-spacing: 0.05em;
}
.feature-mini svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--gold); }

.page-turn-hint { margin-top: auto; padding-top: 1rem; }
.page-turn-link {
  font-family: 'Cinzel', serif; font-size: 0.75rem;
  color: var(--gold); letter-spacing: 0.15em;
  text-decoration: none; transition: color 0.2s;
}
.page-turn-link:hover { color: var(--gold-light); }

/* ===== CHAPTERS BAR ===== */
.chapters-bar {
  display: flex; align-items: center; justify-content: center;
  gap: 0; max-width: 1080px; width: 95%;
  margin: 2rem auto 0; flex-wrap: wrap;
  position: relative; z-index: 1;
  border: 1px solid rgba(155,89,208,0.25);
  border-radius: 6px; overflow: hidden;
}
.chapter-tab {
  font-family: 'Cinzel', serif; font-size: 0.72rem;
  padding: 0.7rem 1.25rem; flex: 1; text-align: center;
  color: #9ca3af; text-decoration: none;
  letter-spacing: 0.1em; background: rgba(26,13,46,0.7);
  border-right: 1px solid rgba(155,89,208,0.2);
  transition: all 0.2s; white-space: nowrap;
}
.chapter-tab:last-child { border-right: none; }
.chapter-tab:hover { background: rgba(91,33,182,0.2); color: var(--purple-light); }
.chapter-tab.ctab-active {
  background: rgba(91,33,182,0.3);
  color: var(--gold-light);
  border-bottom: 2px solid var(--gold);
}

/* ===== INNER PAGES ===== */
.inner-main {
  padding-top: 80px;
  position: relative; z-index: 1;
  min-height: 100vh;
}

.page-header {
  text-align: center;
  padding: 3rem 1rem 2rem;
}
.page-chap-num {
  font-family: 'Cinzel', serif; font-size: 0.7rem;
  color: var(--gold); letter-spacing: 0.4em;
  text-transform: uppercase; margin-bottom: 0.5rem;
}
.page-title {
  font-family: 'Cinzel Decorative', serif;
  font-size: clamp(1.5rem, 5vw, 2.8rem);
  color: var(--purple-light); letter-spacing: 0.15em;
  text-shadow: 0 0 30px rgba(192,132,252,0.5);
}
.page-header-sub {
  font-family: 'Lora', serif; font-style: italic;
  color: #9ca3af; margin-top: 0.75rem; font-size: 0.9rem;
}

/* Book spread used throughout inner pages */
.book-spread {
  margin: 0 auto 2rem;
  animation: page-appear 0.5s ease;
}

/* ===== ANIMATIONS ===== */
@keyframes page-appear {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-book-open {
  animation: book-open 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes book-open {
  from { opacity: 0; transform: scale(0.88) rotateX(8deg); }
  to { opacity: 1; transform: scale(1) rotateX(0deg); }
}

.animate-page-in {
  animation: page-flip-in 0.45s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}
@keyframes page-flip-in {
  from { opacity: 0; transform: rotateY(-8deg) translateX(-20px); }
  to { opacity: 1; transform: rotateY(0) translateX(0); }
}
.animate-page-in-right {
  animation: page-flip-in-right 0.45s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}
@keyframes page-flip-in-right {
  from { opacity: 0; transform: rotateY(8deg) translateX(20px); }
  to { opacity: 1; transform: rotateY(0) translateX(0); }
}

.page-flip-out-left {
  animation: flip-out-left 0.3s ease forwards;
  pointer-events: none;
}
.page-flip-out-right {
  animation: flip-out-right 0.3s ease forwards;
  pointer-events: none;
}
@keyframes flip-out-left {
  to { opacity: 0; transform: rotateY(-10deg) translateX(-20px); }
}
@keyframes flip-out-right {
  to { opacity: 0; transform: rotateY(10deg) translateX(20px); }
}

/* ===== PAGE FLIP DIVIDER ===== */
.page-flip-divider {
  display: flex; justify-content: center;
  margin: 1.5rem auto;
  max-width: 1080px; width: 95%;
}
.flip-page {
  display: flex; align-items: center; gap: 0.5rem;
  font-family: 'Cinzel', serif; font-size: 0.78rem;
  color: var(--gold); letter-spacing: 0.15em;
  cursor: pointer; padding: 0.65rem 2rem;
  border: 1px solid rgba(212,160,23,0.35);
  border-radius: 4px; background: rgba(26,13,46,0.7);
  transition: all 0.25s;
}
.flip-page:hover { background: rgba(212,160,23,0.1); box-shadow: 0 0 20px rgba(212,160,23,0.2); }
.flip-page.flipping {
  animation: flip-turn 0.4s ease forwards;
}
@keyframes flip-turn {
  50% { transform: scaleX(0); opacity: 0.5; }
  100% { transform: scaleX(1); opacity: 1; }
}

/* ===== ABOUT PAGE ===== */
.staff-card-parchment {
  display: flex; gap: 1rem; align-items: flex-start;
  margin-top: 1.25rem;
  padding: 1rem;
  background: rgba(155,89,208,0.08);
  border: 1px solid rgba(155,89,208,0.2);
  border-radius: 6px;
}
.staff-avatar-sm {
  width: 64px; height: 64px; border-radius: 50%;
  object-fit: cover; border: 2px solid var(--purple);
  flex-shrink: 0;
  box-shadow: 0 0 15px rgba(155,89,208,0.3);
}
.staff-pname {
  font-family: 'Cinzel', serif; color: var(--gold-light);
  font-size: 0.95rem; margin-bottom: 0.2rem;
}
.staff-prole {
  font-family: 'Cinzel', serif; font-size: 0.65rem;
  color: var(--purple-light); letter-spacing: 0.1em;
  text-transform: uppercase; margin-bottom: 0.4rem;
}
.staff-pdesc { font-size: 0.8rem; color: #9ca3af; line-height: 1.5; }

.page-img {
  width: 100%; border-radius: 6px;
  border: 1px solid rgba(155,89,208,0.3);
  box-shadow: 0 0 20px rgba(155,89,208,0.15);
  object-fit: cover; max-height: 200px;
}

/* ===== WIKI PAGE ===== */
.wiki-tabs-container {
  max-width: 1080px; width: 95%; margin: 0 auto 0;
  display: flex; justify-content: center;
}
.wiki-tabs {
  display: flex; gap: 0.4rem; flex-wrap: wrap;
  justify-content: center; margin-bottom: 1.5rem;
}
.wiki-tab {
  font-family: 'Cinzel', serif; font-size: 0.72rem;
  padding: 0.5rem 1.1rem;
  background: rgba(26,13,46,0.8);
  border: 1px solid rgba(155,89,208,0.25);
  border-radius: 4px; color: #9ca3af;
  cursor: pointer; letter-spacing: 0.08em;
  transition: all 0.2s;
}
.wiki-tab:hover { border-color: var(--purple-light); color: var(--purple-light); }
.wiki-tab.wtab-active {
  background: rgba(91,33,182,0.3);
  border-color: var(--purple-light);
  color: var(--purple-light);
}

.info-list { margin-top: 0.75rem; }
.info-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(155,89,208,0.1);
  font-size: 0.82rem;
}
.info-label { font-family: 'Cinzel', serif; color: #9ca3af; letter-spacing: 0.05em; font-size: 0.75rem; }
.info-val { color: #c4b5fd; }

.wiki-feature-list { list-style: none; margin-top: 0.5rem; }
.wiki-feature-list li {
  display: flex; align-items: flex-start; gap: 0.75rem;
  font-size: 0.85rem; color: #c4b5fd;
  padding: 0.5rem 0; border-bottom: 1px solid rgba(155,89,208,0.1);
  line-height: 1.5;
}
.wfl-dot {
  width: 6px; height: 6px; background: var(--gold);
  border-radius: 50%; flex-shrink: 0; margin-top: 6px;
  box-shadow: 0 0 6px var(--gold);
}

/* Registration steps */
.reg-steps { margin-top: 0.75rem; }
.reg-step {
  display: flex; gap: 1rem; align-items: flex-start;
  margin-bottom: 0.85rem;
}
.reg-num {
  font-family: 'Cinzel Decorative', serif;
  font-size: 0.9rem; color: var(--purple-light);
  min-width: 28px; flex-shrink: 0;
  text-shadow: 0 0 10px rgba(192,132,252,0.4);
}
.rs-title {
  font-family: 'Cinzel', serif; font-size: 0.8rem;
  color: var(--gold-light); letter-spacing: 0.05em;
  margin-bottom: 0.2rem;
}
.rs-desc { font-size: 0.78rem; color: #9ca3af; line-height: 1.4; }

/* Mod step cards */
.mod-step-card {
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(155,89,208,0.2);
  border-radius: 4px; padding: 0.85rem;
  margin-top: 0.65rem;
}
.msc-num {
  font-family: 'Cinzel', serif; font-size: 0.65rem;
  color: var(--gold); letter-spacing: 0.2em;
  text-transform: uppercase; margin-bottom: 0.2rem;
}
.msc-title {
  font-family: 'Cinzel', serif; color: var(--purple-light);
  font-size: 0.82rem; margin-bottom: 0.3rem;
}
.msc-desc { font-size: 0.78rem; color: #9ca3af; line-height: 1.4; }

/* Economy cards */
.eco-card {
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(155,89,208,0.2);
  border-radius: 4px; padding: 0.85rem;
  margin-top: 0.65rem;
}
.eco-card h3 {
  font-family: 'Cinzel', serif; color: var(--gold-light);
  font-size: 0.82rem; margin-bottom: 0.3rem;
}
.eco-card p { font-size: 0.78rem; color: #9ca3af; line-height: 1.4; }

/* ===== ORIGINS PAGE ===== */
.origins-book-container {
  position: relative; z-index: 1;
  padding: 0 1rem 2rem;
}

.origin-spread {
  display: flex; /* flex when shown */
  max-width: 1080px; width: 95%;
  margin: 0 auto;
  filter: drop-shadow(0 20px 50px rgba(0,0,0,0.5));
}

.origin-themed {
  border-color: rgba(var(--orig-color, 155,89,208), 0.4) !important;
}
.origin-themed:hover {
  box-shadow: 0 0 40px var(--orig-glow, rgba(155,89,208,0.3));
}

.origin-icon-large {
  display: flex; justify-content: center; margin-bottom: 1rem;
  filter: drop-shadow(0 0 15px currentColor);
}
.origin-name {
  font-family: 'Cinzel Decorative', serif;
  font-size: clamp(1.1rem, 3vw, 1.6rem);
  letter-spacing: 0.1em;
}
.origin-badge-label {
  display: inline-block;
  font-family: 'Cinzel', serif; font-size: 0.65rem;
  padding: 0.2rem 0.85rem;
  border-radius: 20px; border-width: 1px; border-style: solid;
  letter-spacing: 0.12em; text-transform: uppercase;
  margin: 0.5rem 0;
}

.ability-block {
  border: 1px solid rgba(155,89,208,0.2);
  border-radius: 4px; padding: 0.85rem;
  margin-top: 0.75rem;
}
.ability-block.pro { border-color: rgba(134,239,172,0.25); }
.ability-block.con { border-color: rgba(248,113,113,0.25); }
.ability-block h4 {
  font-family: 'Cinzel', serif; font-size: 0.68rem;
  letter-spacing: 0.15em; text-transform: uppercase;
  margin-bottom: 0.5rem; color: #9ca3af;
}
.ability-block.pro h4 { color: #86efac; }
.ability-block.con h4 { color: #fca5a5; }

.ability-row {
  display: flex; align-items: flex-start; gap: 0.6rem;
  font-size: 0.8rem; color: #c4b5fd;
  margin-bottom: 0.4rem; line-height: 1.4;
}
.ab-dot {
  width: 7px; height: 7px; border-radius: 50%;
  flex-shrink: 0; margin-top: 4px;
}
.ab-dot.pro { background: #86efac; box-shadow: 0 0 6px rgba(134,239,172,0.5); }
.ab-dot.con { background: #fca5a5; box-shadow: 0 0 6px rgba(252,165,165,0.5); }

.origin-nav {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: auto; padding-top: 1.5rem;
}
.origin-prev-btn, .origin-next-btn {
  font-family: 'Cinzel', serif; font-size: 0.72rem;
  padding: 0.4rem 1rem;
  background: rgba(155,89,208,0.15);
  border: 1px solid rgba(155,89,208,0.35);
  border-radius: 4px; color: var(--purple-light);
  cursor: pointer; letter-spacing: 0.1em; transition: all 0.2s;
}
.origin-prev-btn:hover, .origin-next-btn:hover {
  background: rgba(155,89,208,0.3);
}

.origin-dots {
  display: flex; gap: 0.6rem; justify-content: center;
  margin: 1.25rem auto; max-width: 1080px;
}
.origin-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: rgba(155,89,208,0.3);
  border: 1px solid rgba(155,89,208,0.4);
  cursor: pointer; transition: all 0.2s;
}
.origin-dot.dot-active {
  background: var(--purple-light);
  box-shadow: 0 0 10px rgba(192,132,252,0.6);
}

/* ===== SHOP PAGE ===== */
.shop-featured-page {
  border-color: rgba(212,160,23,0.4) !important;
}
.featured-tag {
  font-family: 'Cinzel', serif; font-size: 0.65rem;
  padding: 0.2rem 0.85rem;
  background: linear-gradient(135deg, #b45309, #d97706);
  border-radius: 3px; color: white;
  letter-spacing: 0.15em; text-transform: uppercase;
  display: inline-block; margin-bottom: 0.75rem;
}
.shop-price-large {
  font-family: 'Cinzel Decorative', serif;
  font-size: 2.5rem; color: var(--gold);
  text-shadow: 0 0 20px rgba(212,160,23,0.5);
  text-align: center; margin-top: 1rem;
}
.payment-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 0.75rem; margin-top: 1rem;
}
.payment-card {
  display: flex; flex-direction: column; align-items: center; gap: 0.4rem;
  padding: 0.75rem;
  background: rgba(0,0,0,0.2);
  border-radius: 6px; border-width: 1px; border-style: solid;
  border-color: rgba(155,89,208,0.2);
  font-family: 'Cinzel', serif; font-size: 0.75rem; color: #c4b5fd;
}
.pay-icon {
  width: 36px; height: 36px;
  border-radius: 50%; border-width: 1px; border-style: solid;
  display: flex; align-items: center; justify-content: center;
}

.shop-item-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.65rem 0;
  border-bottom: 1px solid rgba(155,89,208,0.1);
}
.shop-item-row:last-child { border-bottom: none; }
.shop-item-row.featured { background: rgba(212,160,23,0.05); border-radius: 4px; padding: 0.65rem 0.5rem; margin: 0 -0.5rem; }
.sir-info { display: flex; align-items: center; gap: 0.6rem; }
.sir-name { font-size: 0.82rem; color: #c4b5fd; }
.sir-right { display: flex; align-items: center; gap: 0.75rem; }
.sir-price { font-family: 'Cinzel', serif; color: var(--gold-light); font-size: 0.85rem; }

.sir-tier {
  font-family: 'Cinzel', serif; font-size: 0.58rem;
  padding: 0.1rem 0.45rem; border-radius: 3px;
  text-transform: uppercase; letter-spacing: 0.08em;
}
.sir-tier.common { background: rgba(156,163,175,0.2); color: #9ca3af; }
.sir-tier.rare { background: rgba(59,130,246,0.2); color: #93c5fd; }
.sir-tier.enchanted { background: rgba(168,85,247,0.2); color: #c084fc; }
.sir-tier.mystic { background: rgba(16,185,129,0.2); color: #6ee7b7; }
.sir-tier.legendary { background: rgba(245,158,11,0.2); color: #fcd34d; }
.sir-tier.ascended { background: rgba(239,68,68,0.2); color: #fca5a5; }

.shop-buy-btn {
  font-family: 'Cinzel', serif; font-size: 0.68rem;
  padding: 0.3rem 0.75rem;
  background: rgba(155,89,208,0.15);
  border: 1px solid rgba(155,89,208,0.35);
  border-radius: 3px; color: var(--purple-light);
  cursor: pointer; letter-spacing: 0.05em; transition: all 0.2s;
}
.shop-buy-btn:hover { background: rgba(155,89,208,0.35); }
.shop-buy-btn.gold {
  background: rgba(212,160,23,0.15);
  border-color: rgba(212,160,23,0.4);
  color: var(--gold-light);
}
.shop-buy-btn.gold:hover { background: rgba(212,160,23,0.3); }

.hot-badge {
  font-family: 'Cinzel', serif; font-size: 0.55rem;
  padding: 0.05rem 0.35rem;
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  border-radius: 2px; color: white;
  vertical-align: middle;
}

/* ===== FOOTER ===== */
.site-footer {
  background: #050310;
  border-top: 1px solid rgba(155,89,208,0.2);
  padding: 3rem 2rem 2rem;
  position: relative; z-index: 1;
}
.footer-inner { text-align: center; max-width: 800px; margin: 0 auto; }
.footer-logo-img { height: 64px; object-fit: contain; margin: 0 auto 0.75rem; display: block; filter: drop-shadow(0 0 15px rgba(192,132,252,0.4)); }
.footer-name {
  font-family: 'Cinzel Decorative', serif;
  color: var(--purple-light); font-size: 1.4rem; letter-spacing: 0.2em;
}
.footer-tag {
  font-family: 'Lora', serif; font-style: italic;
  color: #6b7280; font-size: 0.82rem; margin: 0.3rem 0 1rem;
}
.footer-ip-row {
  display: inline-flex; align-items: center; gap: 0.75rem;
  font-family: 'Cinzel', serif; color: var(--gold);
  font-size: 0.9rem; margin-bottom: 1rem;
}
.footer-links {
  display: flex; gap: 1.5rem; justify-content: center;
  flex-wrap: wrap; margin: 0.75rem 0 1.25rem;
}
.footer-links a {
  font-family: 'Cinzel', serif; font-size: 0.75rem;
  color: #6b7280; text-decoration: none;
  letter-spacing: 0.1em; transition: color 0.2s;
}
.footer-links a:hover { color: var(--purple-light); }
.footer-copy { font-size: 0.72rem; color: #374151; font-family: 'Lora', serif; }

/* Sound toggle */
#sound-toggle {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 500;
  width: 44px; height: 44px;
  background: rgba(26,13,46,0.9);
  border: 1px solid rgba(155,89,208,0.35);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.2s;
}
#sound-toggle:hover { box-shadow: 0 0 20px rgba(155,89,208,0.4); }
#sound-toggle svg { width: 20px; height: 20px; color: var(--purple-light); }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .open-book, .book-spread, .origin-spread {
    flex-direction: column; max-width: 520px;
  }
  .book-page.book-left { border-right: 1px solid rgba(155,89,208,0.35); border-bottom: none; border-radius: 6px 6px 0 0; }
  .book-page.book-right { border-left: 1px solid rgba(155,89,208,0.35); border-top: none; border-radius: 0 0 6px 6px; }
  .book-spine-shadow { width: 100%; height: 16px; background: linear-gradient(to bottom, rgba(0,0,0,0.4), rgba(155,89,208,0.1), rgba(0,0,0,0.4)); }
  .left-page-content, .right-page-content { padding: 1.75rem; }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .hero-section { padding-top: 90px; }
  .hero-logo-img { width: 80px; height: 80px; }
  .hero-title { font-size: 2rem; }
  .feature-grid-mini { grid-template-columns: 1fr; }
  .chapter-tab { font-size: 0.62rem; padding: 0.6rem 0.5rem; }
}

@media (max-width: 480px) {
  .hero-btns { flex-direction: column; align-items: center; }
  .chapters-bar { flex-direction: column; }
  .chapter-tab { border-right: none; border-bottom: 1px solid rgba(155,89,208,0.2); }
}
