.cultural-lore {
  --lore-bg: linear-gradient(
    135deg,
    rgba(69, 10, 10, 0.94),
    rgba(15, 23, 42, 0.98) 55%,
    rgba(30, 27, 75, 0.95)
  );
  --lore-border: rgba(251, 191, 36, 0.45);
  --lore-glow: rgba(248, 113, 113, 0.22);
  --lore-text: #fef3c7;
  --lore-muted: #cbd5e1;
  --lore-accent: #fbbf24;
  position: relative;
  margin: 0 auto;
  max-width: 1160px;
  padding: 0 1rem;
  scroll-margin-top: calc(var(--navbar-height, 64px) + 1rem);
}

.cultural-lore-inner {
  position: relative;
  overflow: hidden;
  padding: 2rem 1.75rem 1.75rem;
  border-radius: 24px;
  background: var(--lore-bg);
  border: 1px solid var(--lore-border);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 24px 60px rgba(0, 0, 0, 0.35),
    0 0 48px var(--lore-glow);
}

.cultural-lore-inner::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent,
    #fbbf24,
    #f87171,
    #fbbf24,
    transparent
  );
}

.cultural-lore-inner::after {
  content: "文";
  position: absolute;
  top: -0.5rem;
  right: 1rem;
  font-size: 6rem;
  font-weight: 700;
  color: rgba(251, 191, 36, 0.06);
  pointer-events: none;
  line-height: 1;
}

.cultural-lore-header {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin-bottom: 1.75rem;
}

.cultural-lore-badge {
  display: inline-block;
  margin-bottom: 0.75rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.12);
  color: var(--lore-accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cultural-lore-header h2 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.55rem, 3vw, 2rem);
  color: #fff7ed;
  line-height: 1.2;
}

.cultural-lore-lead {
  margin: 0;
  color: var(--lore-muted);
  font-size: 1rem;
  line-height: 1.75;
}

.cultural-lore-lead em {
  color: var(--lore-text);
  font-style: normal;
  font-weight: 600;
}

/* Category Navigation */
.lore-categories {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid rgba(251, 191, 36, 0.18);
}

.category-btn {
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  border: 1px solid rgba(251, 191, 36, 0.28);
  background: rgba(15, 23, 42, 0.6);
  color: #94a3b8;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.category-btn:hover {
  border-color: rgba(251, 191, 36, 0.45);
  color: #fde68a;
}

.category-btn.active {
  background: rgba(251, 191, 36, 0.18);
  border-color: rgba(251, 191, 36, 0.55);
  color: #fcd34d;
}

/* Section Title */
.section-title {
  margin: 0 0 1.25rem;
  font-size: 1.25rem;
  color: #fff7ed;
}

/* Category Sections */
.lore-section {
  display: none;
}

.lore-section.active {
  display: block;
}

.cultural-lore-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.lore-entry {
  padding: 1.25rem 1.35rem;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(251, 191, 36, 0.16);
  transition:
    border-color 0.2s ease,
    transform 0.2s ease;
}

.lore-entry:hover {
  border-color: rgba(251, 191, 36, 0.38);
  transform: translateY(-2px);
}

.lore-title {
  margin: 0 0 0.35rem;
  font-size: 1.08rem;
  color: #fff7ed;
  line-height: 1.4;
}

.lore-reading {
  display: inline;
  color: #fcd34d;
  font-weight: 500;
  font-size: 0.92em;
}

.lore-tag {
  margin: 0 0 0.65rem;
  color: #94a3b8;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.lore-entry p:last-child {
  margin: 0;
  color: #e2e8f0;
  font-size: 0.92rem;
  line-height: 1.65;
}

.lore-entry strong {
  color: #fde68a;
}

.cultural-lore-footer {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(251, 191, 36, 0.2);
}

.cultural-lore-footer p {
  margin: 0;
  color: var(--lore-muted);
  font-size: 0.92rem;
}

.cultural-lore-wiki-link {
  display: inline-flex;
  align-items: center;
  padding: 0.65rem 1.1rem;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.14);
  border: 1px solid rgba(251, 191, 36, 0.35);
  color: #fde68a;
  font-weight: 700;
  text-decoration: none;
  transition:
    background-color 0.2s ease,
    transform 0.2s ease;
}

.cultural-lore-wiki-link:hover {
  background: rgba(251, 191, 36, 0.24);
  transform: translateY(-1px);
  color: #fff7ed;
}

@media (max-width: 640px) {
  .cultural-lore-inner {
    padding: 1.5rem 1.15rem 1.25rem;
  }

  .cultural-lore-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lore-entry,
  .cultural-lore-wiki-link {
    transition: none;
  }
}
