* { box-sizing: border-box; }
html { scroll-behavior: auto; }
body { margin: 0; min-height: 100vh; font-family: 'Poppins', sans-serif; }
.collapsible-header { cursor: pointer; display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.collapsible-header .toggle-icon { flex: 0 0 auto; }
.collapsible-header.collapsed .toggle-icon { transform: rotate(-90deg); }
.collapsible-content { opacity: 1; overflow: hidden; }
.collapsible-content.collapsed { max-height: 0; opacity: 0; margin-bottom: 0; }
.skip-link { position: fixed; left: 16px; top: -100px; z-index: 100; background: #581c87; color: white; border-radius: 12px; padding: 12px 20px; }
.skip-link:focus { top: 8px; }
.wiki-updated { color: #cdb5e9; font-size: .85rem; margin-top: 12px; }

[hidden] { display: none !important; }
.wiki-header, .wiki-layout { font-family: 'Poppins', sans-serif; box-sizing: border-box; color: #f8f3ff; }
.wiki-header { position: sticky; top: 0; z-index: 40; background: rgba(24, 13, 47, .9); border-bottom: 1px solid rgba(216, 180, 254, .2); backdrop-filter: blur(20px); }
.wiki-header-inner { width: min(1320px, calc(100% - 48px)); min-height: 82px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 28px; padding-block: 14px; }
.wiki-brand { display: inline-flex; align-items: center; gap: 12px; flex-shrink: 0; color: #f3d9ff; font-size: 1.55rem; font-weight: 700; text-decoration: none; }
.wiki-brand img { width: 38px; height: 38px; border-radius: 12px; }
.wiki-header nav { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.wiki-header nav a { padding: 10px 14px; border-radius: 12px; color: #d9c7ee; text-decoration: none; font-size: .875rem; font-weight: 500; white-space: nowrap; }
.wiki-header nav a:hover, .wiki-header nav a[aria-current='page'] { color: #fff; background: rgba(168, 85, 247, .22); }
.wiki-layout { width: min(1320px, calc(100% - 48px)); display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 40px; align-items: start; margin: auto; padding: 36px 0 64px; }
.wiki-topics { position: sticky; top: 108px; display: flex; flex-direction: column; min-height: 0; max-height: calc(100dvh - 136px); padding: 18px 12px; border: 1px solid rgba(216, 180, 254, .2); border-radius: 20px; background: rgba(255, 255, 255, .055); }
.wiki-topic-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 10px 14px; }
.wiki-topic-heading h2 { margin: 0; font-size: 1rem; font-weight: 600; }
.wiki-topic-heading button { display: none; }
.wiki-topics nav { overflow: auto; min-height: 0; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #9d78bc transparent; }
.wiki-topics a.nav-link { display: block; border-left: 3px solid transparent; padding: 10px 11px; margin: 2px 0; border-radius: 10px; color: #decef0; font-size: .81rem; line-height: 1.6; text-decoration: none; overflow-wrap: anywhere; }
.wiki-topics a.nav-link:hover { background: rgba(216, 180, 254, .1); color: #fff; }
.wiki-topics a.nav-link.active, .wiki-topics a.nav-link[aria-current='location'] { color: #fff; border-left-color: #d8b4fe; background: rgba(168, 85, 247, .22); }
.wiki-topics nav::-webkit-scrollbar { display: block; width: 5px; }
.wiki-topics nav::-webkit-scrollbar-thumb { background: #9d78bc; border-radius: 9px; }
#main.wiki-main { min-width: 0; width: auto; margin: 0; padding: 0; scroll-margin-top: 116px; }
.wiki-main h1 { font-size: clamp(2.2rem, 4vw, 3.5rem); line-height: 1.15; letter-spacing: -.025em; }
.wiki-main > div:first-child { text-align: left; }
.wiki-main p, .wiki-main li { line-height: 1.85; overflow-wrap: break-word; }
.wiki-main .content-section { margin-bottom: 32px; scroll-margin-top: 116px; }
.wiki-main .content-section > .glass-panel { padding: clamp(20px, 3vw, 32px); border-radius: 24px; border: 1px solid rgba(216, 180, 254, .2); background: rgba(255, 255, 255, .065); }
.wiki-main .content-section h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); line-height: 1.35; overflow-wrap: break-word; }
.wiki-main .content-section h3 { font-size: 1rem; line-height: 1.6; }
.wiki-main .collapsible-header { min-height: 52px; padding: 14px 16px; gap: 12px; background: rgba(255, 255, 255, .06); border-radius: 14px; }
.wiki-main .collapsible-header:hover { background: rgba(255, 255, 255, .1); }
.wiki-main .collapsible-content { transition: opacity .15s ease; }
.wiki-main .collapsible-content:not(.collapsed) { max-height: none; }
.wiki-main .collapsible-content.collapsed { visibility: hidden; }
.wiki-main .collapsible-content > div { padding: 18px; border-radius: 14px; }
.wiki-main .collapsible-content p, .wiki-main .collapsible-content li { font-size: .94rem; color: #e5d9f5; }
.wiki-main [data-wiki-expand], .wiki-main [data-wiki-collapse] { min-height: 44px; font-size: .8rem; }
.wiki-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin: 28px 0 12px; }
.wiki-search { display: block; flex: 1; min-width: 0; margin: 0; }
.wiki-search input { display: block; width: 100%; min-width: 0; min-height: 52px; border: 2px solid #c4b5fd; border-radius: 14px; padding: 12px 16px; background: #fbf7ff; color: #28133d; font: 400 1rem/1.5 'Poppins', sans-serif; }
.wiki-search input::placeholder { color: #71607f; opacity: 1; }
.wiki-tools button, #wiki-search-reset, .wiki-topic-heading button { min-height: 44px; border: 1px solid rgba(216, 180, 254, .38); border-radius: 12px; padding: 10px 15px; color: #f7edff; background: rgba(168, 85, 247, .14); font: 500 .875rem/1.5 'Poppins', sans-serif; cursor: pointer; }
.wiki-tools button:hover, #wiki-search-reset:hover, .wiki-topic-heading button:hover { background: rgba(168, 85, 247, .3); }
#wiki-topics-toggle { display: none; }
#wiki-search-status { margin: 0 0 22px; color: #e4d2f7; font-size: .875rem; }
#wiki-empty { margin-block: 28px; padding: 28px; border: 1px solid rgba(216, 180, 254, .3); border-radius: 20px; background: rgba(255, 255, 255, .07); }
#wiki-empty h2 { margin: 0 0 10px; font-size: 1.5rem; }
#wiki-empty p { color: #e4d2f7; margin-bottom: 18px; }
.wiki-header a:focus-visible, .wiki-topics a:focus-visible, .wiki-topics button:focus-visible, .wiki-main button:focus-visible, .wiki-main input:focus-visible, .wiki-main [data-wiki-toggle]:focus-visible { outline: 3px solid #f0abfc; outline-offset: 4px; }
.wiki-topics-backdrop { position: fixed; inset: 0; z-index: 50; border: 0; border-radius: 0; padding: 0; background: rgba(8, 4, 20, .65); cursor: pointer; }
body.wiki-topics-open { overflow: hidden; }
@media (max-width: 960px) {
  .wiki-layout { width: min(860px, calc(100% - 40px)); grid-template-columns: minmax(0, 1fr); padding-top: 28px; }
  #wiki-topics-toggle { display: inline-flex; align-items: center; }
  .wiki-topics { display: none; position: fixed; inset: 0 auto 0 0; z-index: 60; width: min(340px, calc(100vw - 40px)); height: 100dvh; max-height: none; border-radius: 0 22px 22px 0; padding: 24px 14px; background: linear-gradient(160deg, #271241, #1b102e); box-shadow: 16px 0 60px rgba(0, 0, 0, .35); }
  .wiki-topics.is-open { display: flex; }
  .wiki-topic-heading button { display: inline-flex; }
  .wiki-topics a.nav-link { padding-block: 12px; font-size: .875rem; }
  .wiki-tools { gap: 10px; }
  .wiki-tools .wiki-search { order: 3; flex-basis: 100%; }
  #wiki-search-clear { margin-left: auto; }
}
@media (max-width: 560px) {
  .wiki-header-inner { width: calc(100% - 32px); min-height: 0; flex-wrap: nowrap; justify-content: space-between; gap: 8px; padding-block: 10px; }
  .wiki-brand { gap: 8px; font-size: 1rem; }
  .wiki-brand img { width: 28px; height: 28px; border-radius: 9px; }
  .wiki-header nav { flex-wrap: nowrap; justify-content: flex-end; gap: 0; }
  .wiki-header nav a { padding: 8px; font-size: .75rem; }
  .wiki-header nav a[aria-current='page'] { display: none; }
  .wiki-layout { width: calc(100% - 32px); padding-top: 24px; }
  #main.wiki-main { scroll-margin-top: 88px; }
  .wiki-main .content-section { scroll-margin-top: 88px; }
  .wiki-main .content-section h2 { font-size: 1.5rem; }
  .wiki-main .content-section h3 { font-size: .94rem; }
  .wiki-main .collapsible-header { padding: 12px; }
  .wiki-main .collapsible-content > div { padding: 14px; }
  .wiki-main .collapsible-content p, .wiki-main .collapsible-content li { font-size: .88rem; }
  .wiki-main .content-section > .glass-panel { padding: 18px; }
  #wiki-empty { padding: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .wiki-layout *, .wiki-header * { transition: none !important; animation: none !important; }
}

.wiki-reference { margin: 0 0 22px; padding: 16px 18px; border-left: 3px solid #b99ae8; border-radius: 0 12px 12px 0; background: rgba(196,181,253,.08); }
.wiki-reference p { margin: 0; color: #e5d9f5; font-size: .9rem; line-height: 1.75; }
.wiki-reference p + p { margin-top: 10px; }
.wiki-reference strong { color: #fff; font-weight: 600; }
.wiki-main .wiki-related { margin-top: 22px; margin-bottom: 0; padding-top: 14px; border-top: 1px solid rgba(216,180,254,.2); font-size: .85rem; color: #d9c7ee; }
.wiki-related a { display: inline-flex; align-items: center; min-height: 44px; color: #e9d5ff; text-decoration: underline; text-underline-offset: 4px; }
.wiki-related a:hover { color: #fff; }
.wiki-related a:focus-visible { outline: 3px solid #f0abfc; outline-offset: 3px; border-radius: 4px; }
.wiki-table-wrap { max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; border: 1px solid rgba(216,180,254,.25); border-radius: 12px; scrollbar-color: #b99ae8 #28173d; }
.wiki-stats-table { width: 100%; min-width: 640px; border-collapse: collapse; text-align: left; color: #e5d9f5; font-size: .86rem; line-height: 1.75; }
.wiki-stats-table th, .wiki-stats-table td { padding: 14px; vertical-align: top; overflow-wrap: break-word; }
.wiki-stats-table thead th { color: #fff; font-weight: 600; background: rgba(168,85,247,.18); }
.wiki-stats-table tbody th { width: 24%; color: #fff; font-weight: 500; }
.wiki-stats-table td:first-of-type { width: 27%; color: #f1ddff; }
.wiki-stats-table tbody tr + tr { border-top: 1px solid rgba(216,180,254,.17); }
.wiki-stats-table tbody tr:nth-child(even) { background: rgba(255,255,255,.025); }
.wiki-main .wiki-table-hint { margin-bottom: 10px; font-size: .8rem; color: #cdb5e9; }
.wiki-table-wrap:focus-visible { outline: 3px solid #f0abfc; outline-offset: 3px; }
.wiki-figure { margin: 0; }
.wiki-figure > .wiki-image-frame { display: flex; justify-content: center; border: 1px solid rgba(216,180,254,.2); border-radius: 14px; overflow: hidden; background: rgba(10,5,25,.35); }
.wiki-figure img, .wiki-figure video { display: block; width: auto; max-width: 100%; height: auto; max-height: 680px; object-fit: contain; }
.wiki-figure figcaption p { margin: 16px 0 6px; }
@media (min-width: 1200px) { .wiki-main .wiki-table-hint { display: none; } }
@media (max-width: 700px) {
  .wiki-main .wiki-table-hint { display: none; }
  .wiki-main .collapsible-content > .wiki-stat-block { padding: 0; }
  .wiki-stats-table, .wiki-stats-table tbody { display: block; min-width: 0; }
  .wiki-stats-table thead { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); }
  .wiki-stats-table tbody tr { display: block; padding: 16px; }
  .wiki-stats-table tbody th, .wiki-stats-table td { display: block; width: 100%; padding: 0; }
  .wiki-stats-table td:first-of-type { width: 100%; color: #f1ddff; font-weight: 500; }
  .wiki-stats-table tbody th { margin-bottom: 10px; font-size: .95rem; font-weight: 600; }
  .wiki-stats-table td + td { margin-top: 12px; }
}
