:root {
  --bg-color: #0e0b15;
  --text-color: #ffffff;
  --text-muted: #bbbbbb;
  --nav-bg: #171323;
  --nav-border: #494069;
  --card-bg: #171323;
  --accent: #d68d28;
  --hover-cyan: #5ac4d7;
  --hover-green: #4ea346;
  --highlight: #ffb300;
  --input-bg: #ffffff;
  --input-text: #000000;
  --overlay-bg: rgba(0, 0, 0, 0.85);
  --code-bg: #09070d;
  --danger: #dc3545;
  --danger-hover: #c82333;
  --shadow-strong: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.4));
  --radius-nav: 20px;
  --radius-card: 25px;
  --font: 'Bricolage Grotesque', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'Courier New', Courier, ui-monospace, monospace;
  --container: 1140px;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg-color: #f8f9fa;
    --text-color: #212529;
    --text-muted: #6c757d;
    --nav-bg: #ffffff;
    --nav-border: #dee2e6;
    --card-bg: #ffffff;
    --accent: #b06c1e;
    --hover-cyan: #007b8f;
    --highlight: #b06c1e;
    --input-bg: #f1f3f5;
    --input-text: #212529;
    --overlay-bg: rgba(255, 255, 255, 0.9);
    --code-bg: #e9ecef;
    color-scheme: light;
  }
}

.theme-cyber {
  --accent: #275fce;
}

@media (prefers-color-scheme: light) {
  .theme-cyber {
    --accent: #b06c1e;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 110px;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  overflow-x: hidden;
  transition: background-color 0.4s ease, color 0.4s ease;
}

body.is-locked {
  overflow: hidden;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 0.5rem;
  font-weight: 500;
  line-height: 1.2;
}

p, ul, ol {
  margin: 0 0 1rem;
}

img, svg {
  vertical-align: middle;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--hover-cyan);
  text-decoration: none;
  transition: color 0.3s;
}

a:hover {
  color: var(--accent);
}

:focus-visible {
  outline: 2px solid var(--hover-cyan);
  outline-offset: 3px;
}

button {
  font: inherit;
}

hr {
  border: 0;
  border-top: 1px solid var(--nav-border);
  margin: 1rem 0;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 2000;
  padding: 0.5rem 1rem;
  border-radius: 30px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

.skip-link:focus {
  top: 1rem;
  color: #fff;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 15px;
}

.main-title {
  font-weight: 800;
  font-size: clamp(2.2rem, 6vw, 3.5rem);
}

.section-title {
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 2.8rem);
  text-align: center;
  margin-bottom: 3rem;
}

.section-title.small {
  font-size: clamp(1.7rem, 4vw, 2.2rem);
  margin-bottom: 1.5rem;
}

.text-accent {
  color: var(--accent);
  transition: color 0.4s ease;
}

.subtitle {
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.muted {
  color: var(--text-muted);
}

.nav-wrap {
  position: sticky;
  top: 0;
  z-index: 1020;
  padding-top: 1.5rem;
}

.custom-navbar {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  background-color: var(--nav-bg);
  border-radius: var(--radius-nav);
  border: 1px solid var(--nav-border);
  padding: 10px 25px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  transition: background-color 0.4s ease, border-color 0.4s ease;
}

.navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3125rem 0;
  margin-right: 1rem;
  white-space: nowrap;
}

.brand-logo {
  height: 50px;
  width: auto;
}

.logo-text {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-color);
}

.navbar-toggler {
  display: none;
  padding: 0.25rem 0.75rem;
  background: transparent;
  border: 1px solid var(--nav-border);
  border-radius: 0.25rem;
  color: var(--text-color);
  cursor: pointer;
}

.navbar-toggler-icon {
  display: inline-block;
  width: 1.5em;
  height: 1.5em;
  vertical-align: middle;
  background: no-repeat center / 100% 100%;
  background-image: linear-gradient(currentColor, currentColor), linear-gradient(currentColor, currentColor), linear-gradient(currentColor, currentColor);
  background-size: 100% 2px, 100% 2px, 100% 2px;
  background-position: center 22%, center 50%, center 78%;
  opacity: 0.6;
}

.navbar-menu {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
}

.search-form {
  width: 45%;
  margin: 0 auto;
}

.search-input {
  display: block;
  width: 100%;
  height: calc(1.5em + 0.75rem + 2px);
  font-family: inherit;
  font-size: 1rem;
  background-color: var(--input-bg);
  border: 1px solid var(--nav-border);
  border-radius: 30px;
  padding: 8px 20px;
  color: var(--input-text);
  font-weight: 500;
  transition: background-color 0.4s ease, color 0.4s ease, box-shadow 0.2s;
}

.search-input:focus {
  box-shadow: 0 0 10px var(--hover-cyan);
  outline: none;
}

.navbar-nav {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0 0 0 auto;
  padding: 0;
}

.nav-link {
  display: block;
  padding: 0.5rem;
  color: var(--text-color);
  font-weight: 600;
  font-size: 1.1rem;
  margin-left: 15px;
  transition: color 0.3s;
}

.nav-link:hover,
.nav-link[aria-current='page'] {
  color: var(--hover-cyan);
}

@media (max-width: 991.98px) {
  .navbar-toggler {
    display: inline-block;
  }

  .navbar-menu {
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding: 0.75rem 0 0.25rem;
  }

  .custom-navbar.is-open .navbar-menu {
    display: flex;
  }

  .search-form {
    width: 100%;
  }

  .navbar-nav {
    flex-direction: column;
    align-items: center;
    margin: 0;
  }

  .nav-link {
    margin-left: 0;
  }
}

.hero {
  text-align: center;
  margin-top: 3rem;
  padding: 0 1rem;
}

.top-banner-img {
  max-width: 800px;
  width: 100%;
  margin-bottom: 1.5rem;
  filter: var(--shadow-strong);
}

.about-section {
  margin-top: 3rem;
  padding-top: 1.5rem;
}

.about-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  padding: 0 1rem;
}

.about-art {
  flex: 0 0 41.666%;
  max-width: 41.666%;
  padding: 0 15px;
  text-align: center;
}

.about-text {
  flex: 0 0 58.333%;
  max-width: 58.333%;
  padding: 0 15px;
}

.character-img {
  max-height: 280px;
  width: auto;
  filter: var(--shadow-strong);
}

.lead-text {
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1.7;
  color: var(--text-color);
  margin-bottom: 1.5rem;
}

@media (max-width: 767.98px) {
  .about-art,
  .about-text {
    flex-basis: 100%;
    max-width: 100%;
    text-align: center;
  }

  .about-art {
    margin-bottom: 1.5rem;
  }
}

.mods-section {
  margin-top: 3rem;
  margin-bottom: 3rem;
  padding-top: 3rem;
}

.custom-card {
  background-color: var(--card-bg);
  border: 1px solid var(--nav-border);
  border-radius: var(--radius-card);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  color: var(--text-color);
  transition: transform 0.3s ease, border-color 0.3s ease, background-color 0.4s ease;
}

.custom-card:hover {
  border-color: var(--hover-green);
}

.custom-carousel {
  position: relative;
  padding-bottom: 2.75rem;
}

.carousel-viewport {
  overflow: hidden;
  border-radius: var(--radius-card);
}

.carousel-track {
  display: flex;
  transition: transform 0.6s ease-in-out;
  will-change: transform;
  touch-action: pan-y;
}

.carousel-track.is-dragging {
  transition: none;
}

@media (prefers-reduced-motion: reduce) {
  .carousel-track {
    transition: none;
  }
}

.carousel-item {
  flex: 0 0 100%;
  min-width: 0;
  text-align: center;
  padding: 2px 0;
}

.mod-card {
  width: 80%;
  margin: 0 auto;
  padding: 1.5rem;
  cursor: pointer;
}

.mod-card:focus-visible {
  outline-offset: -4px;
}

.img-box {
  max-height: 150px;
  width: auto;
  border-radius: 20px;
  object-fit: contain;
  margin-bottom: 1rem;
}

.mod-name {
  font-size: 1.5rem;
  margin: 0 0 1rem;
}

.mod-name a {
  color: var(--text-color);
}

.mod-name a:hover {
  color: var(--hover-cyan);
}

.badges-container {
  display: inline-block;
}

.badges-container img {
  height: 20px;
  width: auto;
  margin: 0.25rem;
  transition: transform 0.2s;
}

.badges-container img:hover {
  transform: scale(1.05);
}

.carousel-control {
  position: absolute;
  top: 0;
  bottom: 2.75rem;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 10%;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-color);
  opacity: 0.5;
  cursor: pointer;
  transition: opacity 0.15s ease, color 0.3s;
}

.carousel-control:hover,
.carousel-control:focus-visible {
  opacity: 0.9;
  color: var(--hover-cyan);
}

.carousel-control.prev {
  left: 0;
}

.carousel-control.next {
  right: 0;
}

.carousel-indicators {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.5rem;
  display: flex;
  justify-content: center;
  gap: 6px;
}

.carousel-indicators button {
  box-sizing: content-box;
  width: 30px;
  height: 3px;
  padding: 0;
  border: 0;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  background-color: var(--text-color);
  background-clip: padding-box;
  opacity: 0.5;
  cursor: pointer;
  transition: opacity 0.6s ease, background-color 0.3s;
}

.carousel-indicators button.active {
  opacity: 1;
  background-color: var(--accent);
}

@media (max-width: 575.98px) {
  .mod-card {
    width: 78%;
    padding: 1rem;
  }

  .mod-name {
    font-size: 1.2rem;
  }
}

.footer-section {
  text-align: center;
  margin-top: 3rem;
  padding: 1.5rem;
}

.footer-art {
  max-height: 180px;
  width: auto;
}

.social-icon {
  max-height: 60px;
  width: auto;
  transition: transform 0.2s;
}

.footer-section a:hover .social-icon {
  transform: translateY(-3px);
}

.copyright {
  margin-top: 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--overlay-bg);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  transition: background 0.4s ease;
}

.search-overlay[hidden] {
  display: none;
}

.overlay-container {
  background-color: var(--card-bg);
  border: 1px solid var(--nav-border);
  border-radius: var(--radius-card);
  padding: 30px;
  width: 80%;
  max-width: 900px;
  max-height: 80vh;
  overflow-y: auto;
  text-align: center;
  color: var(--text-color);
  overscroll-behavior: contain;
}

.overlay-container:focus {
  outline: none;
}

.overlay-title {
  margin-bottom: 1rem;
  font-size: 1.75rem;
}

.theme-cyber .overlay-title {
  color: var(--accent);
}

@media (max-width: 575.98px) {
  .overlay-container {
    width: 92%;
    padding: 20px;
    max-height: 86vh;
  }
}

.btn-close-pill {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.375rem 1.5rem;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.5;
  color: #fff;
  background-color: var(--danger);
  border: 1px solid var(--danger);
  border-radius: 30px;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}

.btn-close-pill:hover {
  background-color: var(--danger-hover);
  border-color: var(--danger-hover);
}

.result-card {
  display: block;
  text-align: left;
  margin-bottom: 1rem;
  padding: 1rem;
  width: 100%;
}

.result-card:hover {
  color: var(--text-color);
}

.result-path {
  display: block;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--hover-cyan);
  margin-bottom: 0.25rem;
}

.result-path .sep {
  color: var(--text-muted);
  margin: 0 0.35rem;
}

.result-snippet {
  margin: 0;
  color: var(--text-color);
}

mark {
  background: none;
  color: var(--highlight);
  font-weight: 700;
  padding: 0;
}

.overlay-message {
  color: var(--text-muted);
}

.overlay-message.error {
  color: var(--danger);
}

.wiki-card {
  text-align: left;
  padding: 1.5rem 2rem;
  width: 100%;
}

.overlay-head {
  text-align: center;
  margin-bottom: 1rem;
}

.overlay-img {
  display: block;
  max-height: 120px;
  margin: 0 auto 0.75rem;
}

.wiki-more {
  display: inline-block;
  margin-top: 0.5rem;
  font-weight: 700;
}

.link-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin: 0.75rem 0 0;
}

.pill {
  display: inline-block;
  padding: 0.35rem 1.1rem;
  border: 1px solid var(--nav-border);
  border-radius: 30px;
  background: var(--card-bg);
  color: var(--text-color);
  font-weight: 600;
  transition: border-color 0.3s, color 0.3s, transform 0.2s;
}

.pill:hover {
  border-color: var(--hover-green);
  color: var(--hover-cyan);
  transform: translateY(-2px);
}

.wiki-body h1,
.wiki-body h2 {
  font-weight: 700;
  font-size: 1.9rem;
  margin: 2rem 0 1rem;
  color: var(--accent);
}

.wiki-body h3 {
  font-weight: 700;
  font-size: 1.35rem;
  margin: 1.5rem 0 0.75rem;
}

.wiki-body h4 {
  font-weight: 700;
  font-size: 1.15rem;
  margin: 1.25rem 0 0.5rem;
}

.wiki-body > :first-child {
  margin-top: 0;
}

.wiki-body p,
.wiki-body li {
  line-height: 1.7;
}

.wiki-body ul,
.wiki-body ol {
  padding-left: 1.4rem;
}

.wiki-body li {
  margin-bottom: 0.5rem;
}

.wiki-body li::marker {
  color: var(--accent);
}

.wiki-body strong {
  font-weight: 700;
}

.wiki-body figure {
  margin: 1.5rem 0;
  text-align: center;
}

.wiki-body figure img {
  border-radius: 20px;
  filter: var(--shadow-strong);
}

.wiki-body figcaption {
  margin-top: 0.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.wiki-body blockquote {
  margin: 1rem 0;
  padding: 0.75rem 1.25rem;
  border-left: 4px solid var(--accent);
  background: var(--code-bg);
  border-radius: 0 15px 15px 0;
}

.wiki-body blockquote > :last-child {
  margin-bottom: 0;
}

.wiki-body code {
  font-family: var(--mono);
  font-size: 0.92em;
  padding: 0.1em 0.4em;
  border-radius: 6px;
  background: var(--code-bg);
}

.wiki-body pre {
  padding: 1rem;
  border-radius: 15px;
  background: var(--code-bg);
  overflow-x: auto;
}

.wiki-body pre code {
  padding: 0;
  background: none;
}

.table-wrap {
  overflow-x: auto;
  margin: 1rem 0;
}

.wiki-body table {
  width: 100%;
  border-collapse: collapse;
}

.wiki-body th,
.wiki-body td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--nav-border);
  text-align: left;
}

.wiki-body th {
  color: var(--accent);
}

.wiki-hero {
  margin-top: 2.5rem;
}

.back-link {
  display: table;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 1.25rem;
  font-weight: 600;
}

.wiki-title-img {
  max-height: 160px;
  filter: var(--shadow-strong);
}

.wiki-title {
  margin-top: 0.5rem;
}

.wiki-hero .subtitle {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.wiki-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
  margin-top: 3rem;
}

.wiki-layout.no-toc {
  grid-template-columns: minmax(0, 1fr);
}

.wiki-toc {
  position: sticky;
  top: 120px;
}

.toc-card {
  padding: 1.25rem 1.5rem;
}

.toc-card summary {
  font-weight: 700;
  font-size: 1.15rem;
  cursor: pointer;
  list-style: none;
}

.toc-card summary::-webkit-details-marker {
  display: none;
}

.toc-card summary::after {
  content: '\25BE';
  float: right;
  color: var(--text-muted);
  transition: transform 0.2s;
}

.toc-card:not([open]) summary::after {
  transform: rotate(-90deg);
}

.toc-card ol {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  max-height: calc(100vh - 220px);
  overflow-y: auto;
}

.toc-card li {
  margin: 0.15rem 0;
}

.toc-card a {
  display: block;
  padding: 0.2rem 0;
  color: var(--text-color);
  line-height: 1.35;
}

.toc-card a:hover,
.toc-card a.is-active {
  color: var(--hover-cyan);
}

.toc-card .toc-l3 a {
  padding-left: 0.9rem;
  font-size: 0.93rem;
  color: var(--text-muted);
}

.toc-card .toc-l3 a:hover,
.toc-card .toc-l3 a.is-active {
  color: var(--hover-cyan);
}

@media (max-width: 991.98px) {
  .wiki-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .wiki-toc {
    position: static;
  }

  .toc-card ol {
    max-height: none;
  }

  .wiki-card {
    padding: 1.25rem;
  }
}

.wiki-pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
}

.pager-card {
  display: flex;
  flex-direction: column;
  padding: 1rem 1.5rem;
  flex: 1 1 0;
  max-width: 50%;
}

.pager-card:hover {
  color: var(--text-color);
  transform: translateY(-3px);
}

.pager-next {
  margin-left: auto;
  text-align: right;
}

.pager-label {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.pager-title {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--hover-cyan);
}

.cyber-main {
  margin-top: 1.5rem;
  margin-bottom: 3rem;
}

.section-container {
  margin-bottom: 3rem;
}

.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  padding: 20px 0;
}

.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 140px;
  height: 100%;
  padding: 24px;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.tile:hover {
  transform: translateY(-5px);
  color: inherit;
}

.tile[hidden] {
  display: none;
}

.tile.is-loading {
  cursor: default;
}

.tile .icon {
  font-size: 1.8rem;
  margin-bottom: 10px;
  color: var(--accent);
  font-family: var(--mono);
  font-weight: 700;
}

.tile .title {
  display: block;
  width: 100%;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-color);
  overflow-wrap: anywhere;
}

.tile .meta {
  margin-top: 0.35rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.code-box {
  position: relative;
  text-align: left;
  padding: 1rem;
  background-color: var(--code-bg);
}

.code-box:hover {
  border-color: var(--nav-border);
}

.code-box pre {
  margin: 0;
  color: var(--text-color);
  font-family: var(--mono);
  font-size: 0.95rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.copy-btn {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  padding: 0.2rem 0.8rem;
  border: 1px solid var(--nav-border);
  border-radius: 30px;
  background: var(--card-bg);
  color: var(--text-color);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.3s, color 0.3s;
}

.copy-btn:hover {
  border-color: var(--hover-green);
  color: var(--hover-cyan);
}

.grid-message {
  grid-column: 1 / -1;
  text-align: center;
}

.grid-message .pill {
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}

.filter-empty {
  text-align: center;
}

.not-found {
  margin: 3rem auto 2rem;
}

.not-found .character-img {
  margin-bottom: 1.5rem;
}
