/*
 * EvoMU InfoBase – Strict Dark (Launcher-like) Theme
 * v4:
 * - Neon hover (no solid fill) for top buttons / language
 * - Remove green accents (use blue everywhere)
 * - Sidebar hover neutral, active blue
 * - All images rounded + clipped; never overflow
 * - Background without seams; fixed attachment
 */

:root{
  --bg:#0f1115;
  --bg2:#151823;
  --panel:#121621;
  --card:#10131a;
  --border:#262a35;
  --border2: rgba(255,255,255,.06);
  --text:#e8eaed;
  --muted:#9aa0a6;
  --faint: rgba(232,234,237,.55);
  --accent:#4c8dff;              /* launcher blue */
  --accentSoft: rgba(76,141,255,.14);
  --accentSoft2: rgba(76,141,255,.08);
  --accentLine: rgba(76,141,255,.55);
  --accentGlow: rgba(76,141,255,.35);
  --shadow: 0 14px 40px rgba(0,0,0,.55);
  --shadow2: 0 10px 26px rgba(0,0,0,.45);
  --radius: 16px;
  --radius2: 12px;
  --mediaRadius: 14px;
  --font: system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Liberation Sans", sans-serif;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
html{ scrollbar-gutter: stable; }
body{
  margin:0;
  font-family:var(--font);
  color:var(--text);
  background:
    radial-gradient(900px 520px at 12% 0%, rgba(76,141,255,.10), transparent 58%),
    radial-gradient(820px 540px at 88% 2%, rgba(76,141,255,.06), transparent 60%),
    linear-gradient(180deg, var(--bg), var(--bg2));
  background-attachment: fixed;
}

a{ color: rgba(232,234,237,.90); text-decoration:none; }
a:hover{ text-decoration:underline; }
::selection{ background: rgba(76,141,255,.28); }

/* Topbar */
.topbar{
  position:sticky;
  top:0;
  height:62px;
  z-index:40;
  background: rgba(15,17,21,.86);
  border-bottom:1px solid var(--border2);
  backdrop-filter: blur(10px);
}
.topbar__inner{
  height:62px;
  max-width: 1420px;
  margin:0 auto;
  padding: 0 16px;
  display:flex;
  align-items:center;
  gap:14px;
}

.iconbtn{
  width:40px;height:40px;
  border-radius: 12px;
  border:1px solid var(--border2);
  background: rgba(255,255,255,.03);
  color: var(--text);
  display:grid;
  place-items:center;
  cursor:pointer;
  transition: transform .08s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.iconbtn.is-active{
  border-color: rgba(76,141,255,.95);
  box-shadow: 0 0 0 1px rgba(76,141,255,.28) inset, 0 0 18px rgba(76,141,255,.16);
}
.iconbtn:hover{
  background: rgba(255,255,255,.05);
  border-color: rgba(255,255,255,.12);
  box-shadow: 0 0 0 1px rgba(76,141,255,.10) inset;
  text-decoration:none;
}
.iconbtn:active{ transform: translateY(1px); }

.brand{
  display:flex;
  align-items:center;
  gap:10px;
  min-width: 220px;
  padding: 6px 10px;
  border-radius: 12px;
}
.brand:hover{ text-decoration:none; }
.brand__title{ font-weight:700; letter-spacing:.2px; color: rgba(232,234,237,.92); }

/* FAQ badge – neutral by default, blue outline on hover (like launcher tabs) */
.brand__badge{
  font-size:12px;
  padding: 2px 8px;
  border-radius: 999px;
  border:1px solid var(--border2);
  background: rgba(15,17,21,.55);
  color: rgba(232,234,237,.82);
  font-weight: 800;
  letter-spacing: .2px;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease, color .15s ease;
}
.brand__badge:hover{
  border-color: rgba(76,141,255,.95);
  color:#fff;
  box-shadow:
    0 0 0 1px rgba(76,141,255,.32) inset,
    0 0 18px rgba(76,141,255,.18);
  background: rgba(76,141,255,.06);
  text-decoration:none;
}


.search{
  position:relative;
  flex:1;
  max-width: 640px;
}
.search__icon{
  position:absolute;
  left:14px;
  top:50%;
  transform: translateY(-50%);
  color: var(--faint);
  pointer-events:none;
}
.search__input{
  width:100%;
  height:40px;
  padding: 0 14px 0 40px;
  border-radius: 14px;
  border: 1px solid var(--border2);
  background: rgba(255,255,255,.03);
  color: var(--text);
  outline:none;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.search__input:focus{
  border-color: rgba(76,141,255,.35);
  background: rgba(255,255,255,.04);
  box-shadow: 0 0 0 2px rgba(76,141,255,.10);
}

.search__dropdown{
  position:absolute;
  left:0;
  right:0;
  top:46px;
  border-radius: 14px;
  overflow:hidden;
  border:1px solid var(--border2);
  background: rgba(14,18,26,.96);
  box-shadow: var(--shadow2);
  display:none;
  max-height: 420px;
  overflow:auto;
}
.search__dropdown.is-open{ display:block; }
.search__item{
  display:block;
  padding: 10px 12px;
  color: rgba(232,234,237,.88);
  border-bottom:1px solid rgba(255,255,255,.04);
}
.search__item:last-child{ border-bottom:0; }
.search__item:hover{ background: rgba(255,255,255,.04); text-decoration:none; }
.search__title{ font-weight:700; color: rgba(232,234,237,.94); }
.search__snippet{ margin-top:6px; font-size: 12.5px; line-height:1.35; color: var(--muted); }
.search__empty{ padding: 12px; color: var(--muted); }

/* Top links (Avalon/Agarta/...) + Language buttons – neon outline */
.toplinks{ display:flex; align-items:center; gap:12px; white-space:nowrap; }
.toplinks__a,
.lang__btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height:34px;
  padding: 0 12px;
  border-radius: 12px;
  border:1px solid var(--border2); /* default grey */
  background: rgba(15,17,21,.62);
  color: rgba(232,234,237,.86);
  font-size: 13px;
  font-weight: 700;
  cursor:pointer;
  box-shadow: 0 0 0 1px rgba(0,0,0,.25) inset;
  transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease, transform .08s ease;
}

.toplinks__a:hover,
.lang__btn:hover{
  background: rgba(76,141,255,.06);
  border-color: rgba(76,141,255,.95);
  color:#fff;
  box-shadow:
    0 0 0 1px rgba(76,141,255,.35) inset,
    0 0 18px rgba(76,141,255,.18);
  text-decoration:none;
}

.toplinks__a:active,
.lang__btn:active{ transform: translateY(1px); }

/* Active state for top buttons and languages – same neon, a bit stronger */
/* Active state – stronger neon, but still strict (no heavy fill) */
.toplinks__a.is-active,
.lang__btn.is-active{
  background: rgba(76,141,255,.08);
  border-color: rgba(76,141,255,1);
  color:#fff;
  box-shadow:
    0 0 0 1px rgba(76,141,255,.45) inset,
    0 0 22px rgba(76,141,255,.22);
}


.lang{ display:flex; gap:8px; align-items:center; }

/* Main layout */
.app{
  max-width: 1420px;
  margin: 18px auto 34px;
  padding: 0 16px;
  display:flex;
  gap:16px;
  align-items:flex-start;
}

.sidebar{ width: 330px; flex: 0 0 330px; }
.sidebar__inner{
  position:sticky;
  top: 82px;
  border-radius: var(--radius);
  border:1px solid var(--border2);
  background: rgba(15,17,21,.70);
  box-shadow: var(--shadow2);
  overflow:hidden;
}
.sidebar__title{
  padding: 14px 16px;
  font-size: 12px;
  letter-spacing: .12em;
  color: var(--muted);
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255,255,255,.04);
}

.nav{
  max-height: calc(100vh - 140px);
  overflow:auto;
  padding: 10px 10px 14px;
  margin:0;
}
.nav::-webkit-scrollbar{ width: 10px; }
.nav::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,.07);
  border-radius: 999px;
  border: 2px solid rgba(0,0,0,0);
  background-clip: padding-box;
}

.nav__group{ margin: 6px 0 10px; }
.nav__groupBtn{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding: 10px 12px;
  border-radius: 12px;
  border:1px solid transparent;
  background: transparent;
  color: rgba(232,234,237,.90);
  font-weight: 800;
  cursor:pointer;
}
.nav__groupBtn:hover{
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.03);
}

/* Open group should be clearly visible (no "where am I" effect) */
.nav__group.is-open > .nav__groupBtn{
  background: rgba(255,255,255,.03);
  border-color: rgba(255,255,255,.06);
}

/* Group that contains the current page (subtle blue accent) */
.nav__group.is-current > .nav__groupBtn{
  background: rgba(76,141,255,.08);
  border-color: rgba(76,141,255,.18);
  box-shadow: inset 2px 0 0 rgba(76,141,255,.55);
}
.nav__group .fa-angle-down{ transition: transform .18s ease; color: var(--muted); }
.nav__items{
  list-style:none;
  margin: 6px 0 0;
  padding-left: 10px;
  display:none;
}
.nav__group.is-open .nav__items{ display:block; }
.nav__group.is-open .fa-angle-down{ transform: rotate(180deg); }

.nav__link{
  display:block;
  padding: 9px 10px;
  border-radius: 12px;
  color: rgba(232,234,237,.78);
  border:1px solid transparent;
}

/* Hover must be neutral like MIX hover (no blue fill) */
.nav__link:hover{
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.06);
  color: rgba(232,234,237,.95);
  text-decoration:none;
}

/* Selected item should be blue (not green) */
.nav__link.is-active{
  background: rgba(76,141,255,.10);
  border-color: rgba(76,141,255,.25);
  color: rgba(232,234,237,1);
  box-shadow: inset 2px 0 0 rgba(76,141,255,.65);
}

/* Main content */
.content{ flex:1; min-width:0; padding: 0; margin:0; display:block; }
.content__inner{ min-width:0; }

.crumbs{
  color: var(--muted);
  font-size: 12px;
  margin: 6px 0 12px;
}
.crumbs a{ color: rgba(232,234,237,.70); }
.crumbs a:hover{ color: rgba(232,234,237,.92); text-decoration:none; }
.crumbs__sep{ margin: 0 6px; color: rgba(232,234,237,.35); }

/* Article card */
#article{ border-radius: var(--radius); overflow:hidden; }

.article{
  border-radius: var(--radius);
  border:1px solid var(--border2);
  background: rgba(15,17,21,.72);
  box-shadow: var(--shadow);
  padding: 22px 22px 26px;
  min-height: 420px;
  position:relative;
  font-size: 15px;
  line-height: 1.7;
  color: rgba(232,234,237,.90);
  text-align: left;
  /* Fill content column (no awkward centering gap near the sidebar) */
  max-width: none;
  width: 100%;
  margin: 0;
  overflow:hidden; /* important: clip media to rounded corners */
}
.article.is-loading{ opacity:.88; filter: saturate(.95); }

/* Reset CKEditor quirks */
.article, .article *{ font-style: normal; }
.article i, .article em{ font-style: italic; }
.article p, .article div, .article span, .article li, .article ul, .article ol, .article h1, .article h2, .article h3{
  text-align: left !important;
}

.article h1{ font-size: 26px; margin: 2px 0 14px; line-height:1.22; color: rgba(232,234,237,.96); }
.article h2{ font-size: 20px; margin: 20px 0 10px; line-height:1.25; color: rgba(232,234,237,.95); }
.article h3{ font-size: 16px; margin: 18px 0 8px; line-height:1.25; color: rgba(232,234,237,.94); }
.article p{ margin: 10px 0; }
.article ul, .article ol{ margin: 10px 0 10px 18px; }
.article li{ margin: 4px 0; }
.article hr{ border:0; border-top: 1px solid rgba(255,255,255,.06); margin: 16px 0; }

.article a{
  color: rgba(232,234,237,.92);
  text-decoration: none;
  border-bottom: 1px dashed rgba(76,141,255,.45);
}
.article a:hover{ border-bottom-color: rgba(76,141,255,.85); text-decoration:none; }

.article blockquote{
  margin: 12px 0;
  padding: 10px 12px;
  border-left: 3px solid rgba(76,141,255,.55);
  background: rgba(255,255,255,.03);
  border-radius: 10px;
  color: rgba(232,234,237,.88);
}

/* Code */
.article code{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 13px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
  padding: 2px 6px;
  border-radius: 8px;
  color: rgba(232,234,237,.95);
}
.article pre{
  margin: 12px 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(0,0,0,.28);
  border: 1px solid rgba(255,255,255,.06);
  overflow:auto;
}
.article pre code{ background: transparent; border: 0; padding: 0; }

/* Media: ONE standard for ALL images/videos/iframes.
   We wrap every media element into .media-frame in JS, so the frame owns border+radius.
   (Fixes "some pages without frame" + "double frame".) */
#article :where(img, video, iframe),
.article :where(img, video, iframe){
  display:block;
  max-width:100% !important;
  height:auto !important;
  border: 0 !important;
  border-radius: 0 !important;
  margin: 0 !important;
  background: transparent !important;
}

#article .media-frame,
.article .media-frame{
  display:block;
  width: fit-content;
  max-width: 100%;
  border-radius: var(--mediaRadius);
  overflow:hidden;
  border:1px solid rgba(255,255,255,.06);
  background: rgba(0,0,0,.18);
  margin: 14px auto;
}

/* Inline wrapper (when media is embedded inside a text paragraph) */
#article .media-frame--inline,
.article .media-frame--inline{
  display:inline-block;
  margin: 0 6px;
  vertical-align: middle;
}

#article .media-frame > :where(img, video, iframe),
.article .media-frame > :where(img, video, iframe){
  display:block;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important; /* wrapper does the rounding */
  width: auto;
  max-width: 100% !important;
  height: auto !important;
}

/* Hard fallback: if something wasn't wrapped for any reason, still round it */
#article :where(img, video, iframe):not(.media-frame :where(img, video, iframe)),
.article :where(img, video, iframe):not(.media-frame :where(img, video, iframe)){
  border-radius: var(--mediaRadius) !important;
}
.article figure{ margin: 14px 0; }
.article figure :where(img, video){ margin: 0 auto; }

/* If some content uses floats, keep them usable but still clipped */
.article img[align],
.article img[style*="float"],
.article img[style*="position"]{
  margin: 10px 0;
}

/* Tables */
.article .table-wrap{ overflow-x:auto; border-radius: 14px; }
.article table{
  width:100%;
  border-collapse: collapse;
  margin: 12px 0;
  min-width: 680px;
  background: rgba(255,255,255,.01);
  border:1px solid rgba(255,255,255,.06);
  border-radius: 14px;
  overflow:hidden;
}
.article table th,
.article table td{
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  vertical-align: top;
}
.article table th{
  text-align:left !important;
  background: rgba(255,255,255,.04);
  color: rgba(232,234,237,.95);
  font-weight: 800;
}
.article table tr:last-child td{ border-bottom:0; }

/* Footer */
.articleFooter{
  width: 100%;
  max-width: none;
  margin: 14px 0 0;
  display:flex;
  justify-content: space-between;
  align-items:center;
  gap:12px;
  color: var(--muted);
  font-size: 12px;
}
.articleFooter__links a{ color: rgba(232,234,237,.70); margin-right: 10px; }
.articleFooter__links a:hover{ color: rgba(232,234,237,.92); text-decoration:none; }

/* Mobile drawer */
.backdrop{
  position:fixed;
  inset:0;
  background: rgba(0,0,0,.55);
  z-index:35;
  opacity:0;
  pointer-events:none;
  transition: opacity .15s ease;
}
.backdrop.is-open{ opacity:1; pointer-events:auto; }

@media (max-width: 980px){
  .brand{ min-width: 160px; }
  .toplinks{ display:none; }

  .app{ margin: 10px auto 22px; padding: 0 12px; }

  .sidebar{
    position:fixed;
    top:62px;
    left:0;
    bottom:0;
    width: 340px;
    transform: translateX(-105%);
    transition: transform .18s ease;
    z-index:38;
  }
  .sidebar.is-open{ transform: translateX(0); }

  .sidebar__inner{
    height: calc(100vh - 62px);
    position:static;
    border-radius: 0;
    border-right:1px solid rgba(255,255,255,.06);
    border-top:0; border-left:0; border-bottom:0;
  }

  .nav{ max-height: calc(100vh - 140px); }
  .article{ max-width: 100%; }
  .articleFooter{ max-width: 100%; }
}

@media (max-width: 520px){
  .search{ max-width: 100%; }
  .lang__btn{ min-width: 36px; padding: 0 10px; }
  .article{ padding: 18px 16px 22px; }
  .article h1{ font-size: 22px; }
}



/* v8: Group header highlight (open/current) like EN button */
.nav__groupBtn{
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 12px;
  background: rgba(255,255,255,.02);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.nav__group.is-open > .nav__groupBtn,
.nav__group.is-current > .nav__groupBtn{
  border-color: rgba(76,141,255,.75);
  box-shadow: 0 0 0 1px rgba(76,141,255,.25) inset, 0 0 18px rgba(76,141,255,.14);
  background: rgba(76,141,255,.06);
}

/* Make group header distinct from the active item inside */
.nav__group.is-open > .nav__groupBtn .nav__title,
.nav__group.is-current > .nav__groupBtn .nav__title{
  color: rgba(235,240,255,.95);
  font-weight: 600;
}

/* If group is open but not current, keep it subtle */
.nav__group.is-open:not(.is-current) > .nav__groupBtn{
  border-color: rgba(255,255,255,.18);
  box-shadow: none;
  background: rgba(255,255,255,.03);
}


/* v9: clearer distinction between open group header and active item */
.nav__group.is-open > .nav__groupBtn{
  border-color: rgba(255,255,255,.14);
  background: rgba(255,255,255,.03);
}
.nav__group.is-current > .nav__groupBtn{
  border-color: rgba(76,141,255,.95);
  box-shadow: 0 0 0 1px rgba(76,141,255,.28) inset, 0 0 18px rgba(76,141,255,.14);
  background: rgba(76,141,255,.06);
}

/* active page inside the group: filled pill + left accent bar (not same as group header) */
.nav__link.is-active,
.nav__single.is-active{
  position: relative;
  background: linear-gradient(180deg, rgba(76,141,255,.14), rgba(76,141,255,.07));
  border: 1px solid rgba(76,141,255,.55);
  box-shadow: 0 0 0 1px rgba(0,0,0,.35) inset, 0 8px 24px rgba(0,0,0,.35);
  color: rgba(255,255,255,.96);
}
.nav__link.is-active::before,
.nav__single.is-active::before{
  content:'';
  position:absolute;
  left: 10px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 3px;
  background: rgba(76,141,255,.95);
  box-shadow: 0 0 14px rgba(76,141,255,.35);
  pointer-events:none;
}
.nav__link, .nav__single{ padding-left: 18px; }
.nav__link.is-active, .nav__single.is-active{ padding-left: 24px; }


/* v11: highlight ANY opened section (accordion header) */
.nav__group.is-open > .nav__groupBtn,
.nav__group.is-open > button.nav__groupBtn{
  border-color: rgba(76,141,255,.75) !important;
  box-shadow: 0 0 0 1px rgba(76,141,255,.25) inset, 0 0 18px rgba(76,141,255,.14) !important;
  background: rgba(76,141,255,.06) !important;
}
.nav__group.is-open > .nav__groupBtn .nav__title{
  color: rgba(235,240,255,.95) !important;
  font-weight: 600 !important;
}
/* current section (where the active page is) a bit stronger */
.nav__group.is-current > .nav__groupBtn{
  border-color: rgba(76,141,255,.95) !important;
  box-shadow: 0 0 0 1px rgba(76,141,255,.35) inset, 0 0 26px rgba(76,141,255,.22) !important;
  background: rgba(76,141,255,.08) !important;
}
