/* ========= Design tokens — aligned with main/shop ========= */
:root {
  --bg-deep: #0c0f14;
  --bg-panel: #121826;
  --bg-card: #161d2e;
  --border: rgba(94, 234, 212, 0.12);
  --text: #e8edf7;
  --muted: #94a3b8;
  --accent: #34d399;
  --accent-dim: rgba(52, 211, 153, 0.15);
  --accent-2: #a78bfa;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --font-ui: 'Inter', system-ui, sans-serif;
  --font-pixel: 'Press Start 2P', monospace;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-ui);
  color: var(--text);
  background: var(--bg-deep);
  line-height: 1.6;
}

a {
  color: inherit;
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(52, 211, 153, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(52, 211, 153, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}

.glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}

.glow--1 {
  width: 420px;
  height: 420px;
  top: -120px;
  right: -80px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
}

.glow--2 {
  width: 380px;
  height: 380px;
  bottom: -100px;
  left: -60px;
  background: radial-gradient(circle, var(--accent-2) 0%, transparent 70%);
}

.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1160px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
}

.topbar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.brand__pixel {
  font-family: var(--font-pixel);
  font-size: clamp(0.55rem, 2vw, 0.75rem);
  letter-spacing: 0.08em;
  color: var(--accent);
  text-shadow: 0 0 24px rgba(52, 211, 153, 0.45);
}

.brand__sub {
  font-size: 0.85rem;
  color: var(--muted);
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--border);
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.chip--ghost {
  color: var(--text);
  background: rgba(22, 29, 46, 0.8);
}

.chip--ghost:hover {
  border-color: rgba(52, 211, 153, 0.35);
  transform: translateY(-1px);
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}

.card {
  background: linear-gradient(145deg, var(--bg-card), #111827);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.section {
  margin-bottom: 2.5rem;
}

.section__title {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
}

.section__sub {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.footer {
  margin-top: 2.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
}

.footer a {
  color: var(--accent);
}

/* ========= Wiki layout ========= */
.wiki-shell {
  margin-top: 0.75rem;
}

.wiki-layout {
  display: grid;
  grid-template-columns: 280px minmax(620px, 780px);
  justify-content: center;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 920px) {
  .wiki-layout {
    grid-template-columns: minmax(0, 780px);
    justify-content: center;
    gap: 0.9rem;
  }
}

.wiki-sidebar {
  align-self: start;
}

@media (max-width: 920px) {
  .wiki-sidebar {
    width: min(100%, 780px);
    margin: 0 auto;
  }
}

.wiki-sidebar__inner {
  position: sticky;
  top: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(18, 24, 38, 0.78);
  padding: 0.95rem;
}

@media (max-width: 920px) {
  .wiki-sidebar__inner {
    position: static;
  }
}

.wiki-sidebar__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.85rem;
}

.wiki-sidebar__title {
  font-weight: 800;
  letter-spacing: -0.01em;
}

.wiki-sidebar__home {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.3rem 0.62rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(12, 15, 20, 0.5);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.wiki-sidebar__home:hover {
  color: var(--accent);
  border-color: rgba(52, 211, 153, 0.35);
}

.wiki-cat {
  margin: 0 0 0.85rem;
}

.wiki-cat__title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 0.55rem;
}

.wiki-cat__list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.wiki-link {
  text-decoration: none;
  padding: 0.45rem 0.55rem;
  border-radius: 10px;
  border: 1px solid transparent;
  background: rgba(12, 15, 20, 0.35);
  color: var(--text);
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.wiki-link:hover {
  transform: translateY(-1px);
  border-color: rgba(167, 139, 250, 0.35);
  background: rgba(22, 29, 46, 0.65);
}

.wiki-link.is-active {
  border-color: rgba(52, 211, 153, 0.45);
  background: rgba(52, 211, 153, 0.12);
}

.wiki-content {
  padding: 1.35rem 1.35rem 1.45rem;
  width: 100%;
  margin: 0 auto;
}

.wiki-content__head {
  padding-bottom: 1rem;
  margin-bottom: 1.15rem;
  border-bottom: 1px solid var(--border);
}

.wiki-content__title {
  margin: 0;
  font-size: clamp(1.45rem, 3.5vw, 2.05rem);
  letter-spacing: -0.02em;
}

.wiki-content__sub {
  margin: 0.5rem 0 0;
  color: var(--muted);
  max-width: 70ch;
}

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

.prose h2,
.prose h3 {
  margin: 1.6rem 0 0.65rem;
  letter-spacing: -0.01em;
}

.prose p {
  margin: 0.75rem 0;
  color: rgba(232, 237, 247, 0.92);
}

.prose ul,
.prose ol {
  padding-left: 1.1rem;
  margin: 0.75rem 0;
  color: rgba(232, 237, 247, 0.92);
}

.prose code {
  font-size: 0.92em;
  padding: 0.12em 0.35em;
  border-radius: 6px;
  background: rgba(52, 211, 153, 0.08);
  color: var(--accent);
}

.prose pre {
  overflow: auto;
  padding: 1rem;
  border-radius: var(--radius-sm);
  background: rgba(12, 15, 20, 0.65);
  border: 1px solid var(--border);
}

/* ========= Start cards (image links) ========= */
.start-grid {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

@media (max-width: 760px) {
  .start-grid {
    flex-wrap: wrap;
  }
}

.image-link {
  display: block;
  text-decoration: none;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.image-link:hover {
  transform: translateY(-4px);
  border-color: rgba(167, 139, 250, 0.35);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
}

.image-link__img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: rgba(0, 0, 0, 0.25);
}

.image-link--plain {
  display: inline-block;
  border: none;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.image-link--plain:hover {
  transform: none;
  border-color: transparent;
  box-shadow: none;
}

.image-link--plain .image-link__img {
  width: clamp(260px, 32vw, 380px);
  max-width: 100%;
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.link-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.25rem 1.35rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: inherit;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.link-card:hover {
  transform: translateY(-4px);
  border-color: rgba(167, 139, 250, 0.35);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
}

.link-card__name {
  font-weight: 800;
  font-size: 1.05rem;
}

.link-card__meta {
  font-size: 0.85rem;
  color: var(--muted);
}

