:root {
  --gold: #ffcc00;
  --gold-soft: #ffe27a;
  --cyan: #43d7ff;
  --green: #61d37a;
  --red: #ff6f6f;
  --bg: #0d1116;
  --panel: rgba(10, 14, 18, 0.82);
  --panel-strong: rgba(6, 9, 12, 0.94);
  --panel-soft: rgba(255,255,255,0.06);
  --line: rgba(255,255,255,0.12);
  --text: #f4f6f8;
  --muted: #bfc7cf;
  --nav-width: 260px;
  --footer-height: 44px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  overflow: hidden;
}

button, input, select, textarea { font: inherit; }
a { color: var(--cyan); text-decoration: none; }
a:hover, a:focus-visible { color: #9beaff; text-decoration: underline; }

/* ---------- Splash ---------- */
.startscreen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(rgba(0,0,0,.18), rgba(0,0,0,.32)),
    url('../BG.jpg') center/cover no-repeat;
  cursor: pointer;
  opacity: 1;
  transition: opacity .65s ease, visibility .65s ease;
}
.startscreen.is-leaving { opacity: 0; visibility: hidden; }
.splash-card {
  width: min(92vw, 620px);
  text-align: center;
  padding: 24px;
  border-radius: 24px;
  background: rgba(0,0,0,.42);
  border: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(8px);
  box-shadow: 0 24px 80px rgba(0,0,0,.35);
}
.startlogo {
  width: min(66vw, 460px);
  max-height: 54vh;
  object-fit: contain;
  filter: drop-shadow(0 12px 28px rgba(0,0,0,.45));
  transition: transform .25s ease;
}
.startscreen:hover .startlogo { transform: scale(1.025); }
.splash-title { margin: 12px 0 4px; color: var(--gold); font-size: clamp(1.25rem, 2.2vw, 1.8rem); }
.splash-sub { margin: 0; color: #fff; opacity: .92; }
.splash-progress {
  height: 5px;
  margin: 18px auto 0;
  max-width: 360px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.14);
}
.splash-progress > span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--gold);
  animation: splashcount 3s linear forwards;
}
@keyframes splashcount { to { width: 100%; } }

/* ---------- App shell ---------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: url('../BG.jpg') center/cover no-repeat;
  filter: brightness(.52) saturate(.92);
  transition: background-image .6s ease, filter .3s ease;
}
.bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 60% 18%, rgba(0,0,0,.02), rgba(0,0,0,.38) 72%);
}
.mobile-topbar { display: none; }

.sidebar {
  position: fixed;
  z-index: 30;
  top: 20px;
  bottom: calc(var(--footer-height) + 18px);
  left: 20px;
  width: var(--nav-width);
  display: flex;
  flex-direction: column;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel-strong);
  backdrop-filter: blur(14px);
  box-shadow: 0 16px 45px rgba(0,0,0,.3);
  overflow: hidden;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 6px 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}
.brand-mark { font-size: 1.85rem; }
.brand strong { display: block; color: var(--gold); font-size: 1.08rem; letter-spacing: .02em; }
.brand small { color: var(--muted); }
.language-switch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0 6px 9px;
  padding: 6px 9px;
  width: fit-content;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  background: rgba(255,255,255,.045);
  color: #dfe6eb;
  font-size: .78rem;
  font-weight: 700;
  text-decoration: none;
}
.language-switch:hover, .language-switch:focus-visible {
  color: #fff;
  background: rgba(255,255,255,.09);
  text-decoration: none;
}
.language-switch .flag { font-size: 1rem; line-height: 1; }

.nav-scroll { overflow-y: auto; padding-right: 3px; scrollbar-width: thin; }
.nav-section { margin: 8px 0 12px; }
.nav-label {
  padding: 5px 10px;
  font-size: .72rem;
  color: #89939d;
  text-transform: uppercase;
  letter-spacing: .11em;
}
.nav-link, .nav-toggle, .member-link {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 5px 0;
  padding: 10px 11px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #fff;
  background: rgba(255,255,255,.055);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}
.nav-link:hover, .nav-link:focus-visible, .nav-toggle:hover, .nav-toggle:focus-visible, .member-link:hover, .member-link:focus-visible {
  background: rgba(255,255,255,.105);
  border-color: rgba(255,255,255,.14);
  color: #fff;
  text-decoration: none;
}
.nav-link.active { border-color: rgba(255,204,0,.55); background: rgba(255,204,0,.12); }
.nav-link.featured { border-color: rgba(255,204,0,.38); background: linear-gradient(90deg, rgba(255,204,0,.14), rgba(255,255,255,.045)); }
.nav-link .grow, .nav-toggle .grow { flex: 1; }
.nav-badge {
  flex: 0 0 auto;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .03em;
  background: rgba(97,211,122,.16);
  color: #95efa8;
  border: 1px solid rgba(97,211,122,.28);
}
.nav-badge.gold { background: rgba(255,204,0,.14); color: #ffe27a; border-color: rgba(255,204,0,.32); }
.nav-toggle .chevron { transition: transform .2s ease; }
.nav-toggle[aria-expanded="true"] .chevron { transform: rotate(180deg); }
.subnav { display: none; margin: 2px 0 4px 16px; padding-left: 10px; border-left: 1px solid rgba(255,255,255,.14); }
.subnav.open { display: block; }
.subnav .nav-link { font-size: .92rem; background: rgba(255,255,255,.035); }
.sidebar-bottom { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); }
.member-link { background: rgba(67,215,255,.08); border-color: rgba(67,215,255,.16); }

.content-wrapper {
  position: relative;
  z-index: 5;
  margin-left: calc(var(--nav-width) + 54px);
  height: calc(100vh - var(--footer-height));
  overflow-y: auto;
  padding: 28px 32px 50px 24px;
}
.content-box {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: clamp(24px, 3vw, 42px);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  backdrop-filter: blur(14px);
  box-shadow: 0 22px 70px rgba(0,0,0,.24);
  line-height: 1.65;
}
.content-box > :first-child { margin-top: 0; }
.content-box h1, .content-box h2, .content-box h3 { color: var(--gold); line-height: 1.2; }
.content-box h1 { font-size: clamp(2rem, 4vw, 3.3rem); margin-bottom: .45em; }
.content-box h2 { margin-top: 1.6em; }
.content-box h3 { margin-top: 1.35em; color: var(--gold-soft); }
.content-box p, .content-box li { color: #f1f3f5; }
.content-box .muted { color: var(--muted); }

footer {
  position: fixed;
  z-index: 40;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--footer-height);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border-top: 1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.86);
  font-size: .78rem;
  color: #cbd1d6;
  backdrop-filter: blur(10px);
}

/* ---------- Reusable content components ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
  color: var(--gold-soft);
  font-size: .8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
}
.hero-title { max-width: 850px; }
.hero-lead { max-width: 870px; margin: 0 0 22px; font-size: clamp(1.04rem, 1.7vw, 1.22rem); color: #eef2f5; }

.badge-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 22px; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 999px;
  background: rgba(255,255,255,.055);
  color: #e9edf0;
  font-size: .82rem;
  font-weight: 650;
}
.badge.online { border-color: rgba(97,211,122,.35); background: rgba(97,211,122,.11); color: #9bedaa; }
.badge.planned { border-color: rgba(255,204,0,.35); background: rgba(255,204,0,.10); color: #ffe57f; }
.badge.info { border-color: rgba(67,215,255,.32); background: rgba(67,215,255,.09); color: #9beaff; }

.cta-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 4px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 10px;
  background: rgba(255,255,255,.075);
  color: #fff !important;
  font-weight: 700;
  text-decoration: none !important;
  cursor: pointer;
}
.btn:hover { background: rgba(255,255,255,.12); }
.btn.primary { background: var(--gold); color: #151515 !important; border-color: var(--gold); }
.btn.primary:hover { background: #ffdc45; }
.btn.cyan { background: rgba(67,215,255,.14); border-color: rgba(67,215,255,.35); }

.grid-2, .grid-3, .grid-4 { display: grid; gap: 16px; margin: 18px 0; }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }

.card {
  position: relative;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(0,0,0,.25);
  overflow: hidden;
}
.card h2, .card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }
.card.featured {
  border-color: rgba(255,204,0,.38);
  background: linear-gradient(145deg, rgba(255,204,0,.08), rgba(0,0,0,.28));
}
.card.online-card { border-color: rgba(97,211,122,.25); }
.card .status {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: rgba(97,211,122,.14);
  border: 1px solid rgba(97,211,122,.3);
  color: #9bedaa;
}
.card .status.request { background: rgba(255,204,0,.1); border-color: rgba(255,204,0,.25); color: #ffe47b; }

.feature-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px 18px; padding: 0; margin: 18px 0; list-style: none; }
.feature-list li { padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.07); }

.server-address {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 7px;
  background: rgba(67,215,255,.09);
  border: 1px solid rgba(67,215,255,.18);
  color: #a8efff;
  font-family: Consolas, "Courier New", monospace;
}

.callout {
  margin: 18px 0;
  padding: 16px 18px;
  border-left: 4px solid var(--gold);
  border-radius: 10px;
  background: rgba(255,204,0,.065);
}
.callout.info { border-left-color: var(--cyan); background: rgba(67,215,255,.06); }
.callout.good { border-left-color: var(--green); background: rgba(97,211,122,.06); }

.plugin-card { display: flex; flex-direction: column; min-height: 100%; }
.plugin-card .plugin-icon { font-size: 2rem; margin-bottom: 8px; }
.plugin-card .plugin-summary { color: #dce1e5; flex: 1; }
.plugin-card .cta-row { margin-top: auto; padding-top: 8px; }

.steps { counter-reset: mdstep; list-style: none; padding: 0; }
.steps li { counter-increment: mdstep; position: relative; margin: 0 0 11px; padding: 11px 12px 11px 46px; background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.07); border-radius: 10px; }
.steps li::before { content: counter(mdstep); position: absolute; left: 12px; top: 10px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--gold); color: #111; font-weight: 900; }

.portal-diagram, pre, code { font-family: Consolas, "Courier New", monospace; }
.portal-diagram, pre {
  overflow-x: auto;
  padding: 14px;
  border-radius: 10px;
  background: #080b0e;
  border: 1px solid rgba(255,255,255,.09);
  color: #eef2f4;
}
code { color: #dff6ff; }

.table-wrap { width: 100%; overflow-x: auto; margin: 16px 0; }
table { width: 100%; border-collapse: collapse; min-width: 620px; }
th, td { padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,.1); text-align: left; vertical-align: top; }
th { color: var(--gold-soft); background: rgba(255,255,255,.04); }

summary { cursor: pointer; color: var(--gold-soft); font-weight: 700; }
details { margin: 14px 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: rgba(0,0,0,.18); }
details.tech-details { background: rgba(67,215,255,.035); border-color: rgba(67,215,255,.16); }
details.tech-details > summary { color: #a8efff; }
details.admin-details { background: rgba(255,204,0,.035); border-color: rgba(255,204,0,.16); }
details.admin-details > summary { color: var(--gold-soft); }
.progression-table td:first-child { white-space: nowrap; font-weight: 800; color: var(--gold-soft); }
.progression-note { color: var(--muted); font-size: .94rem; }

a[data-page] { cursor: pointer; }

/* ---------- Modal ---------- */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  padding: 24px;
  overflow-y: auto;
  background: rgba(0,0,0,.94);
}
.modal .content-box { margin: 40px auto; max-width: 760px; }

/* ---------- Loading ---------- */
.loading { min-height: 160px; display: grid; place-items: center; color: var(--muted); }
.error-box { padding: 18px; border: 1px solid rgba(255,111,111,.32); background: rgba(255,111,111,.08); border-radius: 12px; color: #ffd1d1; }

/* ---------- Mobile ---------- */
@media (max-width: 900px) {
  body { overflow: auto; }
  .mobile-topbar {
    position: fixed;
    z-index: 50;
    top: 0;
    left: 0;
    right: 0;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    border-bottom: 1px solid rgba(255,255,255,.09);
    background: rgba(4,7,10,.94);
    backdrop-filter: blur(12px);
  }
  .mobile-brand { display: flex; align-items: center; gap: 9px; color: var(--gold); font-weight: 800; }
  .menu-button {
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255,255,255,.13);
    border-radius: 10px;
    background: rgba(255,255,255,.06);
    color: #fff;
    font-size: 1.25rem;
    cursor: pointer;
  }
  .sidebar {
    top: 58px;
    bottom: 0;
    left: 0;
    width: min(88vw, 330px);
    border-radius: 0 18px 18px 0;
    transform: translateX(-105%);
    transition: transform .24s ease;
    box-shadow: 18px 0 60px rgba(0,0,0,.45);
  }
  .sidebar.open { transform: translateX(0); }
  .menu-backdrop {
    display: none;
    position: fixed;
    z-index: 25;
    inset: 58px 0 0 0;
    background: rgba(0,0,0,.58);
  }
  .menu-backdrop.open { display: block; }
  .content-wrapper {
    margin-left: 0;
    height: auto;
    min-height: 100vh;
    padding: 78px 14px 76px;
    overflow: visible;
  }
  .content-box { padding: 22px 18px; border-radius: 16px; }
  footer { min-height: var(--footer-height); height: auto; padding: 9px 12px; line-height: 1.35; text-align: center; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 640px) {
  .splash-card { padding: 18px 14px; border-radius: 18px; }
  .startlogo { width: min(80vw, 390px); }
  .grid-2, .grid-3, .grid-4, .feature-list { grid-template-columns: 1fr; }
  .card { padding: 17px; }
  .card .status { position: static; display: inline-flex; margin-bottom: 10px; }
  .content-box h1 { font-size: 2rem; }
  .content-box h2 { font-size: 1.4rem; }
  .cta-row { flex-direction: column; }
  .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
