/* NexCraft Wiki – sidebar + content layout, reuses NexCraft's blue/green
   palette and the shared .project-hero-box shell so it reads as part of the
   same project instead of a bolted-on separate tool. */

.wiki-page {
  max-width: 1300px;
  margin: 0 auto;
  padding: 3rem 0 4rem;
}

.wiki-hero {
  padding-bottom: 1.6rem;
  margin-bottom: 2.4rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}
.wiki-breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 1rem;
}
.wiki-breadcrumb:hover {
  color: #e5e7eb;
}
.wiki-hero-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.wiki-hero-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: clamp(1.9rem, 3.2vw, 2.5rem);
  margin: 0;
  color: #f9fafb;
}
.wiki-hero-title i {
  color: var(--nexcraft-green);
  font-size: 0.85em;
}
.wiki-hero-sub {
  margin-top: 0.7rem;
  color: var(--text-muted);
  max-width: 40rem;
  line-height: 1.7;
  font-size: 0.92rem;
}
.wiki-hero-discord {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.2rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.85);
  color: #e5e7eb;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.wiki-hero-discord:hover {
  transform: translateY(-2px);
  border-color: rgba(var(--nexcraft-blue-rgb), 0.6);
}
.wiki-stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.5rem;
}
.wiki-stat-chip {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.22);
}
.wiki-stat-num {
  font-weight: 800;
  font-size: 1rem;
  color: var(--nexcraft-green);
}
.wiki-stat-label {
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* --- Sidebar + content layout ---
   Fixed-width sidebar column + a content column that always takes the
   remaining space as a hard 1fr grid track — its width comes purely from
   the grid, never from whatever content/table happens to be active, so
   nothing can make the page flex wider or narrower between sections. */
.wiki-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
}
@media (max-width: 900px) {
  .wiki-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
  }
}
.wiki-sidebar-col {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  min-width: 0;
}

/* --- Mode switcher (Genblock today, more modes later) --- */
.wiki-mode-switcher-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin: 0 0 0.5rem;
  padding: 0 0.2rem;
}
.wiki-mode-tabs {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.wiki-mode-tab {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.85);
  color: #e5e7eb;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.wiki-mode-tab i {
  color: var(--text-muted);
  font-size: 0.85rem;
  width: 1rem;
  text-align: center;
}
.wiki-mode-tab.is-active {
  border-color: rgba(var(--nexcraft-green-rgb), 0.55);
  background: rgba(var(--nexcraft-green-rgb), 0.14);
  color: #f9fafb;
}
.wiki-mode-tab.is-active i {
  color: var(--nexcraft-green);
}
.wiki-mode-tab:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
.wiki-mode-soon {
  margin-left: auto;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Mobile burger toggle for the category sidebar — hidden entirely on
   desktop, where the sidebar is always visible. */
.wiki-toc-toggle {
  display: none;
  width: 100%;
  align-items: center;
  gap: 0.7rem;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: var(--radius-md);
  padding: 0.8rem 1rem;
  color: #e5e7eb;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}
.wiki-toc-toggle-bars {
  display: inline-flex;
  flex-direction: column;
  justify-content: space-between;
  width: 18px;
  height: 13px;
}
.wiki-toc-toggle-bars span {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: var(--nexcraft-green);
}
.wiki-toc-toggle-caret {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 0.8rem;
  transition: transform 0.25s ease;
}
#wiki-toc-wrap.is-toc-open .wiki-toc-toggle-caret {
  transform: rotate(180deg);
}
@media (max-width: 900px) {
  .wiki-toc-toggle {
    display: flex;
    margin-bottom: 0.8rem;
  }
}

.wiki-toc {
  position: sticky;
  top: 1.5rem;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: var(--radius-lg);
  padding: 0.6rem;
}
@media (max-width: 900px) {
  .wiki-toc {
    position: static;
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.3s ease;
    border-width: 0;
    padding: 0;
  }
  .wiki-toc-inner {
    overflow: hidden;
    min-height: 0;
  }
  #wiki-toc-wrap.is-toc-open .wiki-toc {
    grid-template-rows: 1fr;
    border-width: 1px;
    padding: 0.6rem;
  }
}

/* --- Category accordion --- */
.wiki-toc-group {
  border-radius: var(--radius-md);
  padding: 0.3rem;
}
.wiki-toc-group + .wiki-toc-group {
  margin-top: 0.35rem;
}
.wiki-toc-group.is-open {
  background: rgba(var(--wiki-accent-rgb), 0.07);
}

/* Per-category accent color, so the three groups read as distinct topics
   instead of one long blue-green list. */
.wiki-toc-group-blue { --wiki-accent-rgb: 56, 189, 248; --wiki-accent: #38bdf8; }
.wiki-toc-group-green { --wiki-accent-rgb: 16, 185, 129; --wiki-accent: #10b981; }
.wiki-toc-group-amber { --wiki-accent-rgb: 245, 158, 11; --wiki-accent: #f59e0b; }

.wiki-toc-cat {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  background: none;
  border: none;
  color: #f1f5f9;
  font-size: 0.83rem;
  font-weight: 700;
  text-align: left;
  padding: 0.5rem 0.5rem;
  border-radius: 8px;
  cursor: pointer;
}
.wiki-toc-cat:hover {
  background: rgba(var(--wiki-accent-rgb), 0.12);
}
.wiki-toc-cat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  min-width: 26px;
  border-radius: 8px;
  background: rgba(var(--wiki-accent-rgb), 0.16);
  color: var(--wiki-accent);
  font-size: 0.75rem;
}
.wiki-toc-cat-label {
  flex: 1;
  min-width: 0;
}
.wiki-toc-cat-count {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(15, 23, 42, 0.6);
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
}
.wiki-toc-caret {
  font-size: 0.7rem;
  color: var(--text-muted);
  transition: transform 0.22s ease;
}
.wiki-toc-group.is-open .wiki-toc-caret {
  transform: rotate(180deg);
}

.wiki-toc-items {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.25s ease;
}
.wiki-toc-items-inner {
  overflow: hidden;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.25rem 0 0.2rem;
}
.wiki-toc-group.is-open .wiki-toc-items {
  grid-template-rows: 1fr;
}

.wiki-toc-link {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0.4rem 0.6rem 0.4rem 1.9rem;
  border-radius: 8px;
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.82rem;
}
.wiki-toc-link::before {
  content: "";
  position: absolute;
  left: 0.9rem;
  top: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.6;
  transform: translateY(-50%);
}
.wiki-toc-link:hover {
  background: rgba(var(--wiki-accent-rgb), 0.1);
  color: #e5e7eb;
}
.wiki-toc-link.is-active {
  background: rgba(var(--wiki-accent-rgb), 0.18);
  color: #f9fafb;
  font-weight: 700;
  box-shadow: inset 2px 0 0 var(--wiki-accent);
}
.wiki-toc-link.is-active::before {
  background: var(--wiki-accent);
  opacity: 1;
}

.wiki-content-wrap {
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  scroll-margin-top: 1.5rem;
}

.wiki-content {
  width: 100%;
  min-width: 0;
}

/* Only the active section is rendered; switching sections re-triggers a
   fade/slide-in animation instead of everything sitting stacked on one
   long scrolling page. */
.wiki-section[hidden] {
  display: none;
}
.wiki-section.wiki-anim-in {
  animation: wiki-section-in 0.32s ease;
}
@keyframes wiki-section-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.wiki-section {
  width: 100%;
  max-width: 900px;
}
.wiki-kicker {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0 0 0.5rem;
}
.wiki-kicker-blue { color: #38bdf8; }
.wiki-kicker-green { color: var(--nexcraft-green); }
.wiki-kicker-amber { color: #f59e0b; }
.wiki-section h2 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.35rem;
  margin-bottom: 0.8rem;
  color: #f9fafb;
}
.wiki-section h2 i {
  color: var(--nexcraft-green);
  font-size: 1.1rem;
}
.wiki-subhead {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.02rem;
  color: #f1f5f9;
  margin: 1.6rem 0 0.7rem;
  padding-top: 1.3rem;
  border-top: 1px solid rgba(148, 163, 184, 0.15);
}
.wiki-subhead:first-of-type {
  margin-top: 0.4rem;
  padding-top: 0;
  border-top: none;
}
.wiki-subhead i {
  color: var(--nexcraft-green);
  font-size: 0.9rem;
}
.wiki-section p {
  color: rgba(226, 232, 240, 0.9);
  font-size: 0.95rem;
  line-height: 1.75;
  margin-bottom: 0.9rem;
}
.wiki-section p a {
  color: #7DD3FC;
}
.wiki-section code {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 6px;
  padding: 0.1rem 0.4rem;
  font-size: 0.88em;
}
.wiki-section-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

/* --- Ordered onboarding steps --- */
.wiki-steps {
  margin: 0 0 1.1rem;
  padding-left: 1.3rem;
  color: rgba(226, 232, 240, 0.9);
  font-size: 0.95rem;
  line-height: 1.9;
}
.wiki-steps code {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 6px;
  padding: 0.1rem 0.4rem;
  font-size: 0.88em;
}

/* --- Small inline stat trio (e.g. Prestige numbers) --- */
.wiki-mini-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin: 0.2rem 0 1.2rem;
}
.wiki-mini-stat {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-md);
  background: rgba(6, 78, 59, 0.18);
  border: 1px solid rgba(var(--nexcraft-green-rgb), 0.3);
  font-size: 0.76rem;
  color: var(--text-muted);
  min-width: 8rem;
}
.wiki-mini-stat span {
  font-size: 1.3rem;
  font-weight: 800;
  color: #f9fafb;
}

/* --- Quick fact lists --- */
.wiki-facts {
  margin: 0 0 1.1rem;
  padding-left: 1.2rem;
  color: rgba(226, 232, 240, 0.9);
  font-size: 0.92rem;
  line-height: 1.85;
}
.wiki-facts strong {
  color: #f1f5f9;
}

/* --- Data tables (generator tiers, quest chapters, commands) ---
   width:0 + min-width:100% forces this wrapper to always be exactly the
   available column width, completely ignoring the table's own intrinsic
   content size (the 36-row generator table is by far the widest thing on
   the page) — that's what actually keeps the page from flexing wider when
   a data-heavy section becomes active. max-width:100% alone wasn't enough
   because it only clamps the upper bound, not the box's base sizing. */
.wiki-table-scroll {
  overflow-x: auto;
  width: 0;
  min-width: 100%;
  margin-bottom: 1.2rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.22);
}
.wiki-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  white-space: nowrap;
}
.wiki-table thead th {
  position: sticky;
  top: 0;
  background: rgba(6, 78, 59, 0.55);
  color: #f9fafb;
  text-align: left;
  padding: 0.6rem 0.9rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.wiki-table tbody td {
  padding: 0.5rem 0.9rem;
  color: rgba(226, 232, 240, 0.9);
  border-top: 1px solid rgba(148, 163, 184, 0.15);
}
.wiki-table tbody tr:nth-child(even) {
  background: rgba(15, 23, 42, 0.55);
}
.wiki-table tbody tr:hover {
  background: rgba(var(--nexcraft-blue-rgb), 0.12);
}

/* --- FAQ (native <details>/<summary> accordion) --- */
.wiki-faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.wiki-faq-item {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.75);
  padding: 0.2rem 1.2rem;
  transition: background 0.15s ease;
}
.wiki-faq-item[open] {
  background: rgba(15, 23, 42, 0.95);
  border-color: rgba(245, 158, 11, 0.35);
}
.wiki-faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.85rem 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: #f1f5f9;
  cursor: pointer;
  list-style: none;
}
.wiki-faq-item summary::-webkit-details-marker {
  display: none;
}
.wiki-faq-item summary i {
  color: var(--text-muted);
  font-size: 0.78rem;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.wiki-faq-item[open] summary i {
  transform: rotate(180deg);
  color: #f59e0b;
}
.wiki-faq-item p {
  margin: 0 0 0.9rem;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.65;
}

/* --- Blue callout: a notable in-game fact worth calling out --- */
.wiki-callout {
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: var(--radius-md);
  background: rgba(56, 189, 248, 0.08);
  padding: 1.1rem 1.3rem;
  margin-bottom: 1.2rem;
}
.wiki-callout-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #7DD3FC;
  margin-bottom: 0.6rem;
}
.wiki-callout p {
  margin: 0;
  color: rgba(226, 232, 240, 0.9);
  font-size: 0.9rem;
  line-height: 1.7;
}

/* --- Placeholder callouts: clearly mark unfinished sections so nobody
   mistakes scaffolding for verified game info --- */
.wiki-placeholder-card {
  border: 1px dashed rgba(var(--nexcraft-green-rgb), 0.5);
  border-radius: var(--radius-md);
  background: rgba(6, 78, 59, 0.12);
  padding: 1.1rem 1.3rem;
}
.wiki-placeholder-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6EE7B7;
  margin-bottom: 0.6rem;
}
.wiki-placeholder-card ul {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.8;
}
.wiki-placeholder-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
}

/* --- Upcoming-mode cards --- */
.wiki-mode-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2rem;
}
@media (max-width: 700px) {
  .wiki-mode-cards {
    grid-template-columns: minmax(0, 1fr);
  }
}
.wiki-mode-card {
  background: linear-gradient(145deg, rgba(6, 78, 59, 0.5), rgba(7,89,133,0.45));
  border: 1px solid rgba(var(--nexcraft-blue-rgb), 0.35);
  border-radius: var(--radius-lg);
  padding: 1.3rem 1.4rem;
}
.wiki-mode-card h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.05rem;
  margin-bottom: 0.6rem;
  color: #BAE6FD;
}
.wiki-mode-card p {
  color: rgba(226, 232, 240, 0.85);
  font-size: 0.88rem;
  line-height: 1.65;
  margin-bottom: 0.8rem;
}
.wiki-status-badge {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.45);
  color: #60a5fa;
}

.wiki-footer-note {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 1.1rem 1.3rem;
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.25);
}
.wiki-footer-note i {
  color: var(--nexcraft-green);
  margin-top: 0.2rem;
}
.wiki-footer-note p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.6;
}
.wiki-footer-note p a {
  color: #7DD3FC;
}
