/* Brave Soul — design system */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600;700;800;900&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Dark fantasy cool blue base */
  --bg-0: oklch(0.12 0.025 255);
  --bg-1: oklch(0.16 0.030 255);
  --bg-2: oklch(0.20 0.035 255);
  --surface: oklch(0.18 0.035 255 / 0.7);
  --surface-2: oklch(0.22 0.040 258 / 0.85);
  --border: oklch(0.45 0.03 250 / 0.35);
  --border-strong: oklch(0.55 0.04 250 / 0.6);
  --divider: oklch(0.35 0.02 250 / 0.4);

  /* Text */
  --ink: oklch(0.95 0.015 85);
  --ink-dim: oklch(0.78 0.020 85);
  --ink-faint: oklch(0.58 0.020 250);

  /* Accents */
  --gold: oklch(0.80 0.135 85);
  --gold-dim: oklch(0.62 0.110 80);
  --gold-deep: oklch(0.48 0.085 75);
  --cyan: oklch(0.82 0.12 210);
  --cyan-dim: oklch(0.65 0.11 215);
  --rose: oklch(0.72 0.16 15);
  --violet: oklch(0.70 0.14 300);
  --emerald: oklch(0.72 0.13 160);

  /* Rarity */
  --r5: oklch(0.78 0.15 70);   /* 5-star gold */
  --r4: oklch(0.75 0.14 300);  /* 4-star violet */
  --r3: oklch(0.75 0.14 220);  /* 3-star cyan */

  /* Typography */
  --f-display: 'Cinzel', 'Playfair Display', Georgia, serif;
  --f-body: 'Inter', -apple-system, sans-serif;
  --f-mono: 'JetBrains Mono', 'Menlo', monospace;

  /* Density */
  --density: 1;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;

  /* Shadows */
  --glow-gold: 0 0 30px oklch(0.70 0.14 85 / 0.35);
  --glow-cyan: 0 0 30px oklch(0.75 0.12 210 / 0.35);
  --shadow-lg: 0 20px 60px oklch(0.05 0.02 255 / 0.6);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--f-body);
  background: var(--bg-0);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Video responsive wrapper */
.video-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  height: 0;
  overflow: hidden;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  border: 1px solid var(--border);
}
.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Code Blocks & PrismJS */
pre[class*="language-"],
code[class*="language-"] {
  font-family: var(--f-mono) !important;
  font-size: 14px !important;
  text-shadow: none !important;
}
pre[class*="language-"] {
  background: oklch(0.10 0.02 255) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md) !important;
  padding: 1.5em !important;
  margin: 1.5em 0 !important;
  overflow: auto !important;
}
.news-content-body pre {
  max-width: 100%;
  overflow-x: auto;
}

/* Accordion / Details */
.bs-accordion {
  background: oklch(0.18 0.04 255 / 0.4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  overflow: hidden;
}
.bs-accordion summary {
  padding: 14px 20px;
  cursor: pointer;
  font-weight: 700;
  font-family: var(--f-display);
  color: var(--gold);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
  background: oklch(0.22 0.05 255 / 0.5);
  transition: background 0.2s;
  user-select: none;
}
.bs-accordion summary:hover {
  background: oklch(0.28 0.06 255 / 0.6);
}
.bs-accordion summary::-webkit-details-marker {
  display: none;
}
.bs-accordion summary::before {
  content: '◆';
  font-size: 10px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.bs-accordion[open] summary::before {
  transform: rotate(90deg);
  color: var(--cyan);
}
.bs-accordion-content {
  padding: 20px;
  border-top: 1px solid var(--divider);
  background: oklch(0.12 0.03 255 / 0.3);
  animation: bs-accordion-slide 0.3s ease-out;
}
@keyframes bs-accordion-slide {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Raw HTML block inside Quill editor */
.ql-editor .ql-raw-html-block {
  position: relative;
  margin: 8px 0;
  border-radius: 6px;
  border: 1px dashed var(--border);
  cursor: default;
  user-select: none;
}
.ql-editor .ql-raw-html-edit-btn {
  position: absolute;
  top: 6px;
  right: 8px;
  background: var(--surface-2, #1e2235);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--ink-dim);
  font-size: 12px;
  padding: 2px 6px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 1;
}
.ql-editor .ql-raw-html-block:hover .ql-raw-html-edit-btn {
  opacity: 1;
}

/* Page painted backdrop */
.page-backdrop {
  position: fixed; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, oklch(0.32 0.08 235 / 0.6), transparent 60%),
    radial-gradient(ellipse 60% 80% at 100% 50%, oklch(0.25 0.06 290 / 0.4), transparent 60%),
    radial-gradient(ellipse 60% 80% at 0% 80%, oklch(0.28 0.07 210 / 0.4), transparent 60%),
    linear-gradient(180deg, oklch(0.10 0.025 255), oklch(0.14 0.03 260));
}
.page-backdrop::before {
  content: ''; position: absolute; inset: 0;
  background-image:
    radial-gradient(1px 1px at 20% 30%, oklch(0.9 0.02 85 / 0.9), transparent),
    radial-gradient(1px 1px at 70% 70%, oklch(0.9 0.02 85 / 0.8), transparent),
    radial-gradient(1px 1px at 40% 80%, oklch(0.9 0.02 85 / 0.7), transparent),
    radial-gradient(1px 1px at 85% 20%, oklch(0.9 0.02 85 / 0.9), transparent),
    radial-gradient(1px 1px at 10% 60%, oklch(0.9 0.02 85 / 0.6), transparent),
    radial-gradient(2px 2px at 60% 40%, oklch(0.9 0.05 210 / 0.8), transparent),
    radial-gradient(1px 1px at 30% 50%, oklch(0.9 0.02 85 / 0.5), transparent);
  background-size: 400px 400px, 350px 350px, 450px 450px, 500px 500px, 380px 380px, 600px 600px, 420px 420px;
  opacity: 0.7;
  pointer-events: none;
}

/* Glass card */
.glass {
  background: linear-gradient(180deg,
    oklch(0.22 0.04 255 / 0.75),
    oklch(0.16 0.03 255 / 0.85));
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: relative;
}
.glass::before {
  content: ''; position: absolute; inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(180deg,
    oklch(0.85 0.04 85 / 0.08),
    transparent 40%);
}

/* Gold framed card (featured) */
.framed {
  position: relative;
  background: linear-gradient(180deg,
    oklch(0.22 0.04 255 / 0.8),
    oklch(0.14 0.03 255 / 0.92));
  border: 1px solid oklch(0.65 0.10 85 / 0.5);
  border-radius: var(--radius-md);
}
.framed::before {
  content: ''; position: absolute; inset: 1px;
  border-radius: calc(var(--radius-md) - 1px);
  border: 1px solid oklch(0.5 0.04 250 / 0.3);
  pointer-events: none;
}

/* Buttons */
.btn {
  font-family: var(--f-body);
  font-weight: 600;
  font-size: 14px;
  padding: calc(10px * var(--density)) calc(20px * var(--density));
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  display: inline-flex; align-items: center; gap: 8px;
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(180deg, var(--gold), var(--gold-dim));
  color: oklch(0.14 0.02 85);
  border-color: oklch(0.45 0.06 80);
  box-shadow: 0 4px 16px oklch(0.60 0.13 85 / 0.3), inset 0 1px 0 oklch(0.95 0.05 85 / 0.5);
}
.btn-primary:hover {
  filter: brightness(1.08);
  box-shadow: 0 6px 20px oklch(0.60 0.13 85 / 0.5), inset 0 1px 0 oklch(0.95 0.05 85 / 0.6);
  transform: translateY(-1px);
}
.btn-ghost {
  background: oklch(0.22 0.04 255 / 0.5);
  color: var(--ink);
  border-color: var(--border-strong);
}
.btn-ghost:hover {
  background: oklch(0.28 0.05 255 / 0.7);
  border-color: var(--gold-dim);
  color: var(--gold);
}
.btn-cyan {
  background: linear-gradient(180deg, var(--cyan), var(--cyan-dim));
  color: oklch(0.14 0.03 220);
  border-color: oklch(0.40 0.08 215);
}
.btn-sm { font-size: 12px; padding: 6px 12px; }
.btn-lg { font-size: 15px; padding: 12px 28px; }

/* Pill / tags */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.12em;
  padding: 4px 10px; border-radius: 999px;
  background: oklch(0.20 0.04 255 / 0.7);
  border: 1px solid var(--border);
  color: var(--ink-dim);
}
.pill-gold { color: var(--gold); border-color: oklch(0.55 0.10 85 / 0.5); }
.pill-cyan { color: var(--cyan); border-color: oklch(0.55 0.10 210 / 0.5); }

/* Forms */
.input, .select {
  width: 100%;
  font-family: var(--f-body);
  font-size: 14px;
  padding: 12px 14px;
  background: oklch(0.14 0.025 255 / 0.8);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--ink);
  transition: border 0.15s, box-shadow 0.15s;
}
.input::placeholder { color: var(--ink-faint); }
.input:focus, .select:focus {
  outline: none;
  border-color: var(--gold-dim);
  box-shadow: 0 0 0 3px oklch(0.65 0.11 85 / 0.15);
}
.label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 6px;
}
.checkbox {
  appearance: none;
  width: 16px; height: 16px;
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  background: oklch(0.14 0.025 255);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}
.checkbox:checked {
  background: var(--gold);
  border-color: var(--gold);
}
.checkbox:checked::after {
  content: ''; position: absolute;
  left: 4px; top: 1px; width: 5px; height: 9px;
  border: solid oklch(0.14 0.02 85); border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Display type */
.h-display {
  font-family: var(--f-display);
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.05;
}
.h-eyebrow {
  font-family: var(--f-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: var(--gold);
}

/* Rune divider */
.rune-divider {
  display: flex; align-items: center; gap: 14px;
  color: var(--gold-dim);
}
.rune-divider::before, .rune-divider::after {
  content: ''; flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
}
.rune-divider .diamond {
  width: 8px; height: 8px;
  background: var(--gold);
  transform: rotate(45deg);
  box-shadow: 0 0 8px var(--gold);
}

/* Nav */
.nav-shell {
  position: sticky; top: 0; z-index: 40;
  background: linear-gradient(180deg,
    oklch(0.08 0.02 255 / 0.95),
    oklch(0.10 0.025 255 / 0.85));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

/* Page content container */
.page {
  position: relative; z-index: 1;
  min-height: calc(100vh - 64px);
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: oklch(0.08 0.02 255 / 0.5); }
::-webkit-scrollbar-thumb { background: oklch(0.25 0.04 255); border-radius: 4px; border: 2px solid oklch(0.12 0.03 255); }
::-webkit-scrollbar-thumb:hover { background: var(--gold-deep); }

.scroll-styled {
  scrollbar-width: thin;
  scrollbar-color: var(--gold-deep) oklch(0.08 0.02 255 / 0.5);
}
.scroll-styled::-webkit-scrollbar { width: 6px; }
.scroll-styled::-webkit-scrollbar-track { background: oklch(0.08 0.02 255 / 0.3); border-radius: 3px; }
.scroll-styled::-webkit-scrollbar-thumb { 
  background: linear-gradient(180deg, var(--gold-deep), oklch(0.35 0.06 80)); 
  border-radius: 3px; 
  border: none;
}

.desc-text {
  max-height: 280px;
  overflow-y: auto;
  padding-right: 12px;
  line-height: 1.7;
  color: var(--ink-dim);
  font-size: 14.5px;
  text-wrap: pretty;
  white-space: pre-line;
}

/* Utility anims */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px oklch(0.70 0.14 85 / 0.3); }
  50% { box-shadow: 0 0 40px oklch(0.70 0.14 85 / 0.6); }
}
@keyframes slide-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.anim-slide-up { animation: slide-up 0.5s ease both; }
.anim-float { animation: float 4s ease-in-out infinite; }

/* Placeholder art */
.ph-art {
  background:
    repeating-linear-gradient(135deg,
      oklch(0.25 0.04 255 / 0.6) 0 12px,
      oklch(0.20 0.035 255 / 0.6) 12px 24px);
  position: relative;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-faint);
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

/* News Content & Quill Support */
.news-content-body {
  font-size: 17px;
  line-height: 1.8;
  color: var(--ink-dim);
}
.news-content-body .ql-align-center { text-align: center; }
.news-content-body .ql-align-right { text-align: right; }
.news-content-body .ql-align-justify { text-align: justify; }
.news-content-body .ql-indent-1 { padding-left: 3em; }
.news-content-body .ql-indent-2 { padding-left: 6em; }
.news-content-body .ql-indent-3 { padding-left: 9em; }
.news-content-body .ql-indent-4 { padding-left: 12em; }
.news-content-body img { max-width: 100%; height: auto; border-radius: 8px; margin: 20px 0; }
.news-content-body blockquote { border-left: 4px solid var(--gold); padding-left: 20px; font-style: italic; color: var(--ink-dim); margin: 24px 0; }
.news-content-body p { margin: 0 0 10px; }
.news-content-body pre { background: oklch(0.12 0.02 255); padding: 16px; border-radius: 6px; font-family: var(--f-mono); overflow-x: auto; margin: 20px 0; color: #ccc; }
.news-content-body pre[class*="language-"] { color: #ccc; }
.news-content-body code[class*="language-"] { color: #ccc; }
.news-content-body .token.comment { color: #999; }
.news-content-body .token.tag,
.news-content-body .token.attr-name,
.news-content-body .token.namespace,
.news-content-body .token.deleted { color: #e2777a; }
.news-content-body .token.boolean,
.news-content-body .token.number,
.news-content-body .token.function { color: #f08d49; }
.news-content-body .token.property,
.news-content-body .token.class-name,
.news-content-body .token.constant,
.news-content-body .token.symbol { color: #f8c555; }
.news-content-body .token.selector,
.news-content-body .token.important,
.news-content-body .token.atrule,
.news-content-body .token.keyword,
.news-content-body .token.builtin { color: #cc99cd; }
.news-content-body .token.string,
.news-content-body .token.char,
.news-content-body .token.attr-value,
.news-content-body .token.regex,
.news-content-body .token.variable { color: #7ec699; }
.news-content-body .token.operator,
.news-content-body .token.entity,
.news-content-body .token.url { color: #67cdcc; }
.news-content-body .token.punctuation { color: #ccc; }
.news-content-body h1, .news-content-body h2, .news-content-body h3 { color: var(--ink); margin-top: 32px; margin-bottom: 16px; font-family: var(--f-display); }
.news-content-body iframe,
.news-content-body .ql-video {
  display: block;
  width: 100%;
  aspect-ratio: 16/9;
  border: 0;
  border-radius: var(--radius-md);
  margin: 20px 0;
}
.news-content-body a { color: var(--gold); text-decoration: underline; }
.news-content-body a:hover { color: var(--gold-deep); }
.news-content-body table {
  border-collapse: separate;
  border-spacing: 0 8px;
  width: 100%;
  min-width: 640px;
  margin: 24px 0 32px;
}
.news-content-body th,
.news-content-body tr:first-child td {
  background: rgba(255,255,255,0.05);
  color: var(--gold);
  font-weight: 900;
  font-size: 12px;
  text-transform: uppercase;
  padding: 15px 25px;
  text-align: left;
  border: none;
  letter-spacing: 0.06em;
}
.news-content-body th:first-child,
.news-content-body tr:first-child td:first-child { border-radius: 12px 0 0 12px; }
.news-content-body th:last-child,
.news-content-body tr:first-child td:last-child { border-radius: 0 12px 12px 0; }
.news-content-body td {
  background: rgba(255,255,255,0.02);
  padding: 20px 25px;
  border-top: 1px solid rgba(255,255,255,0.05);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  color: var(--ink);
}

/* --- RESPONSIVE / MOBILE --- */

.desktop-only { display: flex !important; }
.mobile-only { display: none !important; }

@media (max-width: 1024px) {
  .nav-shell > div { padding: 0 20px !important; gap: 20px !important; }
  .desktop-only { display: flex !important; }
}

@media (max-width: 768px) {
  .desktop-only { display: none !important; }
  .mobile-only { display: flex !important; }

  .nav-shell { height: auto !important; min-height: 64px; }
  .nav-shell > div { padding: 0 16px !important; gap: 10px !important; height: 64px !important; justify-content: space-between; }
  
  .btn { padding: 8px 16px; font-size: 13px; }
  .btn-sm { padding: 6px 10px; font-size: 11px; }
  .btn-lg { padding: 10px 20px; font-size: 14px; }

  .h-display { font-size: 28px !important; }
  
  /* Mobile Menu overlay */
  .mobile-menu-overlay {
    position: fixed; inset: 0; z-index: 100;
    background: oklch(0.05 0.02 255 / 0.95);
    backdrop-filter: blur(20px);
    display: flex; flex-direction: column;
    padding: 80px 24px 40px;
    animation: fadeIn 0.3s ease both;
  }
  
  @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

  .mobile-menu-item {
    background: none; border: none;
    padding: 16px 0;
    font-family: var(--f-display);
    font-size: 24px;
    font-weight: 700;
    color: var(--ink-dim);
    text-align: left;
    border-bottom: 1px solid var(--divider);
    width: 100%;
    cursor: pointer;
  }
  .mobile-menu-item.active { color: var(--gold); }
}

@media (max-width: 480px) {
  .nav-shell > div { padding: 0 12px !important; }
  .logo-text { display: none; }
}

/* Advanced Wiki & Quill 2.0 Styles */
.wiki-rendered-body {
  font-family: var(--f-body);
  color: var(--ink-dim);
  line-height: 1.8;
}

.wiki-rendered-body section { margin-bottom: 60px; }
.wiki-rendered-body > *:first-child { margin-top: 0; }
.wiki-rendered-body > *:last-child { margin-bottom: 0; }

.wiki-rendered-body .wiki-h3 {
  font-family: var(--f-display);
  font-size: 28px;
  font-weight: 900;
  color: var(--gold);
  margin-bottom: 24px;
  border-bottom: 1px solid var(--gold-dim);
  padding-bottom: 12px;
  letter-spacing: 0.05em;
}

.wiki-rendered-body .wiki-lead {
  --wiki-accent: var(--gold);
  margin: 0 0 26px;
  padding: 20px 22px;
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--wiki-accent) 30%, rgba(255,255,255,0.08));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--wiki-accent) 18%, transparent), rgba(10, 16, 24, 0.94)),
    radial-gradient(circle at top right, color-mix(in srgb, var(--wiki-accent) 18%, transparent), transparent 42%);
  color: var(--ink);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.75;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.wiki-rendered-body .wiki-infobox {
  --wiki-accent: var(--gold);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--wiki-accent) 10%, transparent), rgba(4, 10, 18, 0.92)),
    rgba(0,0,0,0.2);
  padding: 32px;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--wiki-accent) 24%, rgba(255,255,255,0.08));
  border-left: 4px solid var(--wiki-accent);
  margin-bottom: 30px;
  font-size: 16px;
  color: rgba(255,255,255,0.85);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.wiki-rendered-body .wiki-callout {
  --wiki-accent: var(--gold);
  margin: 0 0 22px;
  padding: 20px 22px;
  border-radius: 20px;
  border: 1px solid color-mix(in srgb, var(--wiki-accent) 28%, rgba(255,255,255,0.08));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--wiki-accent) 14%, rgba(255,255,255,0.03)), rgba(8, 12, 18, 0.96));
  box-shadow: 0 14px 24px rgba(0,0,0,0.16);
}

.wiki-rendered-body .wiki-callout-title {
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--wiki-accent);
}

.wiki-rendered-body .wiki-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.wiki-rendered-body .wiki-columns {
  display: grid;
  grid-template-columns: repeat(var(--wiki-cols, 2), minmax(0, 1fr));
  gap: 24px;
  margin-bottom: 30px;
}

.wiki-rendered-body .wiki-column {
  min-width: 0;
}

.wiki-rendered-body .wiki-card {
  --wiki-accent: var(--gold);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 28px;
  margin: 18px 0 26px;
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--wiki-accent) 20%, transparent), transparent 42%),
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(9, 14, 22, 0.92));
  border-radius: 22px;
  border: 1px solid color-mix(in srgb, var(--wiki-accent) 30%, rgba(255,255,255,0.08));
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  height: 100%;
  overflow: hidden;
  box-shadow: 0 16px 28px rgba(0,0,0,0.18);
}

.wiki-rendered-body .wiki-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent, color-mix(in srgb, var(--wiki-accent) 12%, transparent), transparent 70%);
  opacity: 0.6;
  pointer-events: none;
}

.wiki-rendered-body .wiki-card > * {
  position: relative;
  z-index: 1;
}

.wiki-rendered-body .wiki-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--wiki-accent) 48%, rgba(255,255,255,0.12));
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--wiki-accent) 24%, transparent), transparent 42%),
    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(9, 14, 22, 0.96));
  box-shadow: 0 20px 34px rgba(0,0,0,0.24);
}

.wiki-rendered-body .wiki-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}

.wiki-rendered-body .wiki-card-title {
  flex: 1 1 220px;
  font-size: 22px;
  font-weight: 900;
  color: var(--ink);
  line-height: 1.18;
  text-wrap: balance;
}

.wiki-rendered-body .wiki-tag {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  font-size: 10px;
  padding: 7px 12px;
  background: color-mix(in srgb, var(--wiki-accent) 18%, rgba(255,255,255,0.05));
  border: 1px solid color-mix(in srgb, var(--wiki-accent) 34%, rgba(255,255,255,0.08));
  border-radius: 999px;
  font-weight: 900;
  text-transform: uppercase;
  color: var(--wiki-accent);
  letter-spacing: 0.12em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

.wiki-rendered-body .wiki-inline-badge {
  --wiki-accent: var(--gold);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  margin: 2px 8px 6px 0;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--wiki-accent) 34%, rgba(255,255,255,0.08));
  background: color-mix(in srgb, var(--wiki-accent) 16%, rgba(255,255,255,0.03));
  color: var(--wiki-accent);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.wiki-rendered-body .wiki-status-card {
  --wiki-accent: var(--rose);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
  margin: 0 0 22px;
  border-radius: 22px;
  border: 1px solid color-mix(in srgb, var(--wiki-accent) 30%, rgba(255,255,255,0.08));
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--wiki-accent) 20%, transparent), transparent 42%),
    linear-gradient(180deg, color-mix(in srgb, var(--wiki-accent) 10%, rgba(255,255,255,0.03)), rgba(8, 12, 18, 0.96));
  box-shadow: 0 16px 28px rgba(0,0,0,0.18);
  overflow: hidden;
}

.wiki-rendered-body .wiki-status-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent, color-mix(in srgb, var(--wiki-accent) 10%, transparent), transparent 72%);
  pointer-events: none;
}

.wiki-rendered-body .wiki-status-head,
.wiki-rendered-body .wiki-status-card > * {
  position: relative;
  z-index: 1;
}

.wiki-rendered-body .wiki-status-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wiki-rendered-body .wiki-status-kicker {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  min-height: 28px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--wiki-accent) 34%, rgba(255,255,255,0.08));
  background: color-mix(in srgb, var(--wiki-accent) 16%, rgba(255,255,255,0.03));
  color: var(--wiki-accent);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.wiki-rendered-body .wiki-status-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.16;
  color: var(--ink);
}

.wiki-rendered-body .wiki-refine-card {
  --wiki-accent: var(--gold);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
  margin: 0 0 22px;
  border-radius: 22px;
  border: 1px solid color-mix(in srgb, var(--wiki-accent) 30%, rgba(255,255,255,0.08));
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--wiki-accent) 18%, transparent), transparent 42%),
    linear-gradient(180deg, color-mix(in srgb, var(--wiki-accent) 10%, rgba(255,255,255,0.03)), rgba(8, 12, 18, 0.96));
  box-shadow: 0 16px 28px rgba(0,0,0,0.18);
  overflow: hidden;
}

.wiki-rendered-body .wiki-refine-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent, color-mix(in srgb, var(--wiki-accent) 10%, transparent), transparent 72%);
  pointer-events: none;
}

.wiki-rendered-body .wiki-refine-head,
.wiki-rendered-body .wiki-refine-card > * {
  position: relative;
  z-index: 1;
}

.wiki-rendered-body .wiki-refine-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wiki-rendered-body .wiki-refine-tier {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  min-height: 28px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--wiki-accent) 34%, rgba(255,255,255,0.08));
  background: color-mix(in srgb, var(--wiki-accent) 16%, rgba(255,255,255,0.03));
  color: var(--wiki-accent);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.wiki-rendered-body .wiki-refine-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.16;
  color: var(--ink);
}

.wiki-rendered-body .wiki-refine-chip {
  --wiki-accent: var(--gold);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--wiki-accent) 34%, rgba(255,255,255,0.08));
  background: color-mix(in srgb, var(--wiki-accent) 16%, rgba(255,255,255,0.03));
  color: var(--wiki-accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.wiki-rendered-body .wiki-refine-row {
  --wiki-accent: var(--gold);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--wiki-accent) 28%, rgba(255,255,255,0.08));
  background: color-mix(in srgb, var(--wiki-accent) 10%, rgba(255,255,255,0.02));
}

.wiki-rendered-body .wiki-refine-row-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.wiki-rendered-body .wiki-refine-row-value {
  color: var(--wiki-accent);
  font-size: 14px;
  font-weight: 900;
}

.wiki-rendered-body .wiki-effect-row {
  --wiki-accent: var(--gold);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--wiki-accent) 28%, rgba(255,255,255,0.08));
  background: color-mix(in srgb, var(--wiki-accent) 10%, rgba(255,255,255,0.02));
}

.wiki-rendered-body .wiki-effect-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.wiki-rendered-body .wiki-effect-value {
  color: var(--wiki-accent);
  font-size: 14px;
  font-weight: 900;
}

.wiki-rendered-body .wiki-stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 4px 0 6px;
}

.wiki-rendered-body .wiki-stat {
  --wiki-accent: var(--gold);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  background: color-mix(in srgb, var(--wiki-accent) 14%, rgba(255,255,255,0.03));
  border-radius: 14px;
  font-size: 11px;
  font-weight: 900;
  color: var(--wiki-accent);
  border: 1px solid color-mix(in srgb, var(--wiki-accent) 30%, rgba(255,255,255,0.08));
}

.wiki-rendered-body .wiki-stat-label {
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.wiki-rendered-body .wiki-stat-value {
  color: currentColor;
}

.wiki-rendered-body .wiki-chip-list {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 6px 0 0;
}

.wiki-rendered-body .wiki-card .wiki-chip-list + .wiki-chip-list {
  margin-top: 12px;
}

.wiki-rendered-body .wiki-chip {
  --wiki-accent: var(--cyan);
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  min-height: 34px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--wiki-accent) 36%, rgba(255,255,255,0.08));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--wiki-accent) 14%, transparent), rgba(255,255,255,0.03));
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--wiki-accent);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.wiki-rendered-body .wiki-panel {
  --wiki-accent: var(--gold);
  padding: 24px;
  border-radius: 20px;
  border: 1px solid color-mix(in srgb, var(--wiki-accent) 24%, rgba(255,255,255,0.08));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--wiki-accent) 10%, rgba(255,255,255,0.03)), rgba(255,255,255,0.02));
  margin-bottom: 24px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
  position: relative;
  overflow: hidden;
}

.wiki-rendered-body .wiki-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, color-mix(in srgb, var(--wiki-accent) 18%, transparent), transparent 40%);
  pointer-events: none;
}

.wiki-rendered-body b {
  color: var(--gold-dim);
  font-weight: 700;
}

.wiki-rendered-body .wiki-mod-item {
  --wiki-accent: var(--gold);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  background: color-mix(in srgb, var(--wiki-accent) 10%, rgba(255,255,255,0.02));
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--wiki-accent) 24%, rgba(255,255,255,0.05));
  margin-bottom: 10px;
  font-size: 14px;
  align-items: center;
}

.wiki-rendered-body .wiki-mod-item b {
  color: var(--wiki-accent);
}

.wiki-rendered-body .wiki-separator {
  height: 2px;
  background: var(--divider);
  margin: 40px 0;
  width: 100%;
}

/* Professional Tables */
.wiki-rendered-body .wiki-table-shell {
  margin: 24px 0 32px;
}

.wiki-rendered-body .wiki-table-scroll {
  overflow-x: auto;
  padding-bottom: 6px;
}

.wiki-rendered-body table {
  border-collapse: separate;
  border-spacing: 0 8px;
  width: 100% !important;
  min-width: 640px;
  margin: 0;
}

.wiki-rendered-body th,
.wiki-rendered-body .wiki-table-head td {
  background: rgba(255,255,255,0.05);
  color: var(--gold);
  font-weight: 900;
  font-size: 12px;
  text-transform: uppercase;
  padding: 15px 25px;
  text-align: left;
  border: none;
  letter-spacing: 0.06em;
}

.wiki-rendered-body th:first-child,
.wiki-rendered-body .wiki-table-head td:first-child { border-radius: 12px 0 0 12px; }
.wiki-rendered-body th:last-child,
.wiki-rendered-body .wiki-table-head td:last-child { border-radius: 0 12px 12px 0; }

.wiki-rendered-body td {
  background: rgba(255,255,255,0.02);
  padding: 20px 25px;
  border-top: 1px solid rgba(255,255,255,0.05);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  color: var(--ink);
  font-size: 14px;
}

.wiki-rendered-body tbody tr:not(.wiki-table-head):hover td {
  background: rgba(255,255,255,0.04);
}

.wiki-rendered-body td:first-child { border-left: 1px solid rgba(255,255,255,0.05); border-radius: 16px 0 0 16px; }
.wiki-rendered-body td:last-child { border-right: 1px solid rgba(255,255,255,0.05); border-radius: 0 16px 16px 0; }

.input-field {
  width: 100%;
  font-family: var(--f-body);
  font-size: 14px;
  line-height: 1.5;
  padding: 12px 14px;
  background: linear-gradient(180deg, oklch(0.15 0.03 255 / 0.92), oklch(0.12 0.025 255 / 0.96));
  border: 1px solid oklch(0.42 0.04 250 / 0.45);
  border-radius: 12px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.input-field::placeholder {
  color: var(--ink-faint);
}

.input-field:focus {
  border-color: oklch(0.70 0.12 85 / 0.8);
  box-shadow: 0 0 0 3px oklch(0.70 0.12 85 / 0.15);
}

.input-field option {
  background: oklch(0.16 0.03 255);
  color: var(--ink);
}

.wiki-form-shell {
  background: linear-gradient(180deg, rgba(10, 16, 24, 0.92), rgba(8, 12, 18, 0.96));
  border: 1px solid rgba(186, 146, 88, 0.12);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
}

.wiki-form-panel {
  padding: 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.wiki-upload-box {
  cursor: pointer;
  display: block;
  padding: 36px;
  border-radius: 16px;
  text-align: center;
  border: 1px dashed rgba(186, 146, 88, 0.35);
  background: linear-gradient(180deg, rgba(186, 146, 88, 0.07), rgba(255, 255, 255, 0.02));
}

.wiki-floating-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(5, 7, 10, 0.66);
  color: var(--ink);
  cursor: pointer;
}

.wiki-helper-text {
  font-size: 11px;
  color: var(--ink-faint);
  line-height: 1.5;
  margin-top: 8px;
}

.wiki-editor-shell,
.cms-editor-shell {
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(186, 146, 88, 0.18);
  background: linear-gradient(180deg, rgba(12, 18, 28, 0.98), rgba(8, 12, 18, 0.98));
}

.rich-editor-mode-switch {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.rich-editor-surface,
.rich-editor-host {
  min-height: 0;
}

.rich-editor-host .ql-toolbar.ql-snow {
  position: sticky;
  top: 0;
  z-index: 3;
}

.rich-editor-host .ql-container.ql-snow {
  height: calc(100% - 43px);
}

.rich-code-editor {
  width: 100%;
  resize: none;
  border: none;
  outline: none;
  background:
    linear-gradient(180deg, rgba(0,255,200,0.05), rgba(8, 12, 18, 0.96));
  color: var(--ink);
  font-family: var(--f-mono);
  font-size: 13px;
  line-height: 1.7;
  padding: 18px 20px;
  white-space: pre-wrap;
  overflow: auto;
}

.rich-code-editor::placeholder {
  color: var(--ink-faint);
}

.wiki-live-preview-shell {
  max-height: 72vh;
  min-height: 280px;
  overflow-y: auto;
}

.wiki-live-preview-full {
  max-height: none;
}

.wiki-tag-editor {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  background: rgba(8, 12, 18, 0.7);
  padding: 10px;
}

.wiki-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.wiki-tag-chip,
.wiki-tag-suggestion {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(0,255,200,0.18);
  background: rgba(0,255,200,0.08);
  color: var(--cyan);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.wiki-tag-chip span {
  font-size: 14px;
  line-height: 1;
}

.wiki-tag-suggestion {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.09);
  color: var(--ink-dim);
}

.wiki-tag-input {
  flex: 1 1 180px;
  min-width: 140px;
  border: none;
  outline: none;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  padding: 6px 4px;
}

.wiki-tag-input::placeholder {
  color: var(--ink-faint);
}

.wiki-alert {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  color: var(--ink-dim);
}

.wiki-alert-warning {
  background: rgba(186,146,88,0.10);
  border-color: rgba(186,146,88,0.28);
  color: var(--ink);
}

.wiki-alert-danger {
  background: rgba(255,68,68,0.10);
  border-color: rgba(255,68,68,0.28);
  color: var(--ink);
}

.wiki-stat-card {
  padding: 18px;
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}

.wiki-stat-value {
  font-family: var(--f-display);
  font-size: 28px;
  font-weight: 800;
  color: var(--gold);
}

.wiki-stat-caption {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
}

.wiki-snippet-code {
  margin: 0;
  font-size: 10px;
  line-height: 1.6;
  white-space: pre-wrap;
  color: var(--cyan);
  font-family: var(--f-mono);
  background: rgba(0,255,200,0.05);
  padding: 10px 12px;
  border-radius: 10px;
  overflow-x: auto;
}

.wiki-snippet-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.wiki-snippet-preview-shell {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.025);
}

.wiki-snippet-preview-title {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 10px;
}

.wiki-snippet-preview {
  max-height: 300px;
  overflow: auto;
  padding-right: 4px;
}

.wiki-snippet-preview .wiki-rendered-body {
  font-size: 14px;
}

.wiki-review-preview {
  max-height: 520px;
  overflow: auto;
  padding-right: 8px;
}

.wiki-inline-action {
  background: none;
  border: none;
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.wiki-inline-action-danger {
  color: var(--rose);
}

.ql-toolbar.ql-snow,
.ql-container.ql-snow {
  border: none !important;
}

.ql-toolbar.ql-snow {
  background: linear-gradient(180deg, rgba(186,146,88,0.16), rgba(186,146,88,0.08));
  border-bottom: 1px solid rgba(186,146,88,0.18) !important;
}

.ql-toolbar.ql-snow .ql-stroke {
  stroke: var(--ink);
}

.ql-toolbar.ql-snow .ql-fill {
  fill: var(--ink);
}

.ql-toolbar.ql-snow .ql-picker,
.ql-toolbar.ql-snow button {
  color: var(--ink);
}

.ql-container.ql-snow {
  background: transparent;
}

.ql-editor {
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.7;
  padding: 18px 20px 24px;
}

.ql-editor.ql-blank::before {
  color: var(--ink-faint) !important;
  font-style: normal;
}

.ql-editor table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  margin: 12px 0;
  background: rgba(255,255,255,0.98);
}

.ql-editor td,
.ql-editor th {
  min-width: 120px;
  border: 1px solid rgba(15,23,42,0.18);
  padding: 10px 12px;
  color: #111827;
  background: #fff;
  vertical-align: top;
}

.ql-editor tr:first-child td,
.ql-editor th {
  background: rgba(186,146,88,0.12);
  color: #4b2e0f;
  font-weight: 700;
}

.ql-editor .ql-table-cursor {
  background-color: var(--gold);
}

@media (max-width: 768px) {
  .wiki-rendered-body .wiki-grid,
  .wiki-rendered-body .wiki-columns { grid-template-columns: 1fr; }
  .wiki-rendered-body .wiki-h3 { font-size: 22px; }
  .wiki-rendered-body td, .wiki-rendered-body th { padding: 12px; font-size: 12px; }
}
