/* Wiki-only visual compatibility fixes. */
body.tc-page .tc-gem-detail__image img,
body.tc-page .tc-gem-choice img,
body.tc-page .tc-gem-card img {
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}

html[data-color-theme="dark"] body.tc-page .tc-wiki-nav {
  background: #101c2a !important;
  border-color: #3b5066 !important;
  box-shadow: var(--tc-shadow-sm) !important;
}

html[data-color-theme="dark"] body.tc-page .tc-wiki-nav a {
  color: #aebdca !important;
}

html[data-color-theme="dark"] body.tc-page .tc-wiki-nav a:hover,
html[data-color-theme="dark"] body.tc-page .tc-wiki-nav a.is-active {
  background: #18283b !important;
  border-color: #40546a !important;
  border-bottom-color: #d3a94f !important;
  color: #ffffff !important;
}

/* The legacy light presentation layer owns deliberate cherry hover states.
 * Keep them in light mode, but make every interactive surface on the Wiki
 * landing page explicitly dark-owned so stylesheet order cannot leak pink. */
html[data-color-theme="dark"] body.tc-page .tc-wiki-page--index :is(.tc-guide-link, a.tc-wiki-card):hover {
  background: #18181b !important;
  border-color: #52525b !important;
  color: #f4f4f5 !important;
  box-shadow: 0 3px 0 rgba(0, 0, 0, .28) !important;
}

html[data-color-theme="dark"] body.tc-page .tc-wiki-page--index :is(.tc-guide-link, a.tc-wiki-card):hover :is(h2, h3) {
  color: #ffffff !important;
}

html[data-color-theme="dark"] body.tc-page .tc-wiki-page--index :is(.tc-guide-link:hover > i, a.tc-wiki-card:hover .tc-wiki-card__icon) {
  background: #27272a !important;
  border-color: #52525b !important;
  color: #d3a94f !important;
}

html[data-color-theme="dark"] body.tc-page .tc-wiki-page--index .tc-wiki-actions :is(.tc-btn, .btn):hover {
  background: #27272a !important;
  border-color: #71717a !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

html[data-color-theme="dark"] body.tc-page .tc-wiki-page--index .tc-wiki-actions :is(.tc-btn-primary, .btn-primary):hover {
  background: #3b82f6 !important;
  border-color: #3b82f6 !important;
}

html[data-color-theme="dark"] body.tc-page .tc-wiki-page--index .tc-world-route a:hover {
  background: #202024 !important;
  border-color: #52525b !important;
  color: #ffffff !important;
}

html[data-color-theme="dark"] body.tc-page .tc-wiki-page--index .tc-text-link:hover {
  color: #d3a94f !important;
}

html[data-color-theme="dark"] body.tc-page ::selection {
  background: #33485c;
  color: #f8fafc;
}

html[data-color-theme="dark"] body.tc-page ::-moz-selection {
  background: #33485c;
  color: #f8fafc;
}
