@font-face {
  font-family: 'Prime Regular';
  font-style: normal;
  font-weight: 400;
  src: local('Prime Regular'), url('../Prime-Regular.woff') format('woff');
}

@font-face {
  font-family: 'Prime Light';
  font-style: normal;
  font-weight: 300;
  src: local('Prime Light'), url('../Prime-Light.woff') format('woff');
}

:root {
  --wiki-text: #d7e7f0;
  --wiki-accent: #93f1ff;
  --wiki-accent-strong: #b6f3ff;
  --wiki-glow: rgba(40, 220, 240, 0.5);
  --wiki-surface: rgba(8, 18, 30, 0.9);
  --wiki-surface-soft: rgba(6, 14, 24, 0.9);
  --wiki-border: rgba(80, 200, 220, 0.3);
  --wiki-border-strong: rgba(120, 230, 255, 0.6);
}

a,
a:visited,
a:hover,
a:active,
a:focus {
  text-decoration: none;
}

#wikiModalOverlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(3, 6, 12, 0.9);
  z-index: 10000;
  backdrop-filter: blur(6px);
}

#wikiModal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 92%;
  max-width: 1120px;
  height: 86%;
  max-height: 760px;
  background: radial-gradient(circle at top, rgba(16, 40, 60, 0.45), rgba(6, 10, 20, 0.95)),
    linear-gradient(135deg, #050914, #081425 45%, #050913 100%);
  border: 1px solid var(--wiki-border);
  border-radius: 10px;
  box-shadow: 0 0 45px rgba(8, 120, 160, 0.25), inset 0 1px 0 rgba(200, 238, 242, 0.12);
  color: var(--wiki-text);
  font-family: 'Prime Light', 'Trebuchet MS', Arial, sans-serif;
  letter-spacing: 0.4px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#wikiModal::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(10, 200, 220, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(10, 200, 220, 0.08) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.2;
  pointer-events: none;
}

#wikiModal::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.035) 1px, transparent 1px, transparent 3px);
  opacity: 0.22;
  pointer-events: none;
}

#wikiModalHeader {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: linear-gradient(90deg, rgba(12, 40, 60, 0.9), rgba(8, 24, 40, 0.95));
  border-bottom: 1px solid rgba(120, 230, 255, 0.3);
}

#wikiModalTitle {
  font-family: 'Prime Regular', 'Trebuchet MS', Arial, sans-serif;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 4px;
  color: var(--wiki-accent);
  text-shadow: 0 0 16px var(--wiki-glow);
}

#wikiHeaderButtons {
  display: flex;
  align-items: center;
}

#wikiModalClose,
#wikiMenuToggle {
  font-family: 'Prime Regular', 'Trebuchet MS', Arial, sans-serif;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #d7f8ff;
  background: linear-gradient(135deg, rgba(20, 120, 140, 0.45), rgba(20, 60, 100, 0.7));
  border: 1px solid rgba(120, 220, 230, 0.5);
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  box-shadow: 0 0 18px rgba(20, 160, 190, 0.2);
}

#wikiModalClose:hover,
#wikiMenuToggle:hover {
  transform: translateY(-1px);
  border-color: rgba(150, 240, 255, 0.9);
  box-shadow: 0 0 20px rgba(120, 230, 255, 0.4);
}

#wikiModalBody {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 1;
  overflow: hidden;
}

#wikiSidebar {
  width: 260px;
  min-width: 260px;
  background: rgba(5, 12, 22, 0.85);
  border-right: 1px solid rgba(80, 200, 220, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#wikiSearchBox {
  padding: 12px;
  border-bottom: 1px solid rgba(80, 200, 220, 0.2);
}

#wikiSearchInput {
  width: 100%;
  padding: 8px 12px;
  background: var(--wiki-surface-soft);
  border: 1px solid rgba(90, 200, 220, 0.35);
  border-radius: 6px;
  color: var(--wiki-text);
  font-size: 12px;
  outline: none;
  box-sizing: border-box;
  font-family: 'Prime Light', 'Trebuchet MS', Arial, sans-serif;
}

#wikiSearchInput:focus {
  border-color: var(--wiki-border-strong);
  box-shadow: 0 0 12px rgba(120, 230, 255, 0.25);
}

#wikiFileList {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.wiki-category {
  padding: 10px 16px 6px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: rgba(160, 230, 240, 0.7);
}

.wiki-file-link {
  display: block;
  padding: 8px 16px 8px 24px;
  font-size: 12px;
  color: #b6f3ff;
  text-decoration: none;
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.wiki-file-link:hover {
  background: rgba(120, 230, 255, 0.08);
  color: #e2fbff;
  border-left-color: rgba(150, 240, 255, 0.8);
}

.wiki-file-link.active {
  background: rgba(120, 230, 255, 0.15);
  color: #ffffff;
  border-left-color: rgba(150, 240, 255, 0.9);
  font-family: 'Prime Regular', 'Trebuchet MS', Arial, sans-serif;
}

#wikiContent {
  flex: 1;
  padding: 26px 34px;
  overflow-y: auto;
  font-size: 13px;
  color: var(--wiki-text);
  line-height: 1.7;
}

#wikiContent h1 {
  font-family: 'Prime Regular', 'Trebuchet MS', Arial, sans-serif;
  font-size: 20px;
  color: var(--wiki-accent);
  border-bottom: 1px solid rgba(120, 230, 255, 0.3);
  padding-bottom: 10px;
  margin: 0 0 20px 0;
}

#wikiContent h2 {
  font-family: 'Prime Regular', 'Trebuchet MS', Arial, sans-serif;
  font-size: 16px;
  color: #b6f3ff;
  margin: 26px 0 14px 0;
}

#wikiContent h3 {
  font-family: 'Prime Regular', 'Trebuchet MS', Arial, sans-serif;
  font-size: 14px;
  color: #f1d46e;
  margin: 20px 0 10px 0;
}

#wikiContent a {
  color: #93f1ff;
  text-decoration: none;
}

#wikiContent a:hover {
  color: #e2fbff;
}

#wikiContent ul,
#wikiContent ol {
  padding-left: 24px;
}

#wikiContent code {
  background: rgba(22, 76, 77, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
  color: #f1d46e;
}

#wikiContent blockquote {
  border-left: 3px solid rgba(150, 240, 255, 0.8);
  padding: 10px 18px;
  background: rgba(120, 230, 255, 0.08);
}

.wiki-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: rgba(200, 238, 242, 0.6);
}

.wiki-error {
  color: rgb(255, 120, 120);
  padding: 20px;
  text-align: center;
}

@media screen and (max-width: 576px) {
  #wikiModal {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    border-radius: 0;
    top: 0;
    left: 0;
    transform: none;
  }

  #wikiMenuToggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  #wikiModalBody {
    flex-direction: column;
    position: relative;
  }

  #wikiSidebar {
    position: absolute;
    top: 0;
    left: 0;
    width: 85%;
    max-width: 300px;
    height: 100%;
    min-width: auto;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  #wikiSidebar.open {
    transform: translateX(0);
  }

  #wikiContent {
    padding: 18px;
  }
}
