/* JustRun2 Wiki — palette aligned with in-game UI (gold title, purple panels, cyan highlights) */
:root {
  --jr-ink: #1e1a2e;
  --jr-muted: #5c5678;
  --jr-gold: #c9a227;
  --jr-gold-soft: #e8c84a;
  --jr-cyan: #4a9fd4;
  --jr-purple: #4a3e82;
  --jr-bg: #f4f3f8;
  --jr-surface: #ffffff;
  --jr-surface-raised: #eceaf4;
  --jr-border: #d4d0e4;
  --jr-heading: "ZCOOL QingKe HuangYou", "Noto Sans SC", system-ui, sans-serif;
  --jr-body: "Noto Sans SC", system-ui, sans-serif;
  --jr-primary: var(--jr-purple);
  --jr-secondary: var(--jr-muted);
  --jr-accent: var(--jr-gold);
  --jr-text: var(--jr-ink);
  --jr-radius: 8px;
  --jr-radius-lg: 12px;
  --jr-shadow-sm: 0 1px 3px rgba(30, 26, 46, 0.08);
  --jr-shadow-md: 0 6px 20px rgba(74, 62, 130, 0.12);
  --jr-z-sticky: 10;
}

[data-md-color-scheme="default"] {
  --md-default-bg-color: var(--jr-bg);
  --md-default-fg-color: var(--jr-text);
  --md-primary-fg-color: var(--jr-purple);
  --md-accent-fg-color: var(--jr-gold);
  --md-typeset-a-color: var(--jr-purple);
}

[data-md-color-scheme="slate"] {
  --jr-ink: #eceaf4;
  --jr-muted: #a8a3c0;
  --jr-bg: #12101c;
  --jr-surface: #1e1a2e;
  --jr-surface-raised: #2a2540;
  --jr-border: #3d3660;
  --jr-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
  --jr-shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
}

[data-md-color-scheme="slate"] {
  --md-default-bg-color: var(--jr-bg);
  --md-default-fg-color: var(--jr-ink);
  --md-primary-fg-color: #b8b0d8;
  --md-accent-fg-color: var(--jr-gold-soft);
  --md-typeset-a-color: var(--jr-cyan);
}

/* —— Typography —— */
.md-typeset h1,
.md-typeset h2,
.md-typeset h3,
.md-header__title,
.md-hero__title {
  font-family: var(--jr-heading);
  font-weight: 400;
  letter-spacing: 0.02em;
  text-wrap: balance;
}

.md-typeset {
  font-family: var(--jr-body);
  font-size: clamp(0.9375rem, 0.9rem + 0.15vw, 1rem);
  line-height: 1.72;
  color: var(--jr-text);
}

.md-typeset > p,
.md-typeset > ul,
.md-typeset > ol,
.md-typeset > blockquote,
.md-typeset > dl,
.md-typeset > .highlight,
.md-typeset > pre {
  max-width: 72ch;
}

.md-typeset a {
  color: var(--jr-purple);
  text-underline-offset: 0.15em;
}

[data-md-color-scheme="slate"] .md-typeset a {
  color: var(--jr-cyan);
}

.md-typeset a:hover {
  color: var(--jr-gold);
}

/* —— Layout density —— */
.md-grid {
  max-width: 68rem;
}

.md-content__inner {
  margin-top: 0.85rem;
  margin-bottom: 1.5rem;
}

.md-typeset h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.5rem, 1.2rem + 1vw, 1.85rem);
  line-height: 1.25;
  color: var(--jr-purple);
}

[data-md-color-scheme="slate"] .md-typeset h1 {
  color: var(--jr-gold-soft);
}

.md-typeset h2 {
  margin: 1.75rem 0 0.65rem;
  padding-bottom: 0.35rem;
  font-size: clamp(1.15rem, 1rem + 0.5vw, 1.35rem);
  line-height: 1.3;
  color: var(--jr-purple);
  border-bottom: 2px solid var(--jr-gold);
}

[data-md-color-scheme="slate"] .md-typeset h2 {
  color: var(--jr-gold-soft);
  border-bottom-color: rgba(232, 200, 74, 0.55);
}

.md-typeset h3 {
  margin: 1.25rem 0 0.45rem;
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.1rem);
  line-height: 1.35;
  color: var(--jr-muted);
}

.md-typeset p,
.md-typeset ul,
.md-typeset ol,
.md-typeset blockquote {
  margin-top: 0.55rem;
  margin-bottom: 0.55rem;
  text-wrap: pretty;
}

.md-typeset hr {
  margin: 1.25rem 0;
  border: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--jr-gold) 0%, var(--jr-border) 35%, transparent 100%);
}

.md-typeset table:not([class]) th,
.md-typeset table:not([class]) td {
  padding: 0.5rem 0.7rem;
}

.md-typeset pre {
  margin: 0.75rem 0;
  border-radius: var(--jr-radius);
}

.md-typeset code {
  font-size: 0.875em;
  border-radius: 4px;
}

.md-sidebar--primary .md-nav__link {
  font-size: 0.8125rem;
  padding-top: 0.2rem;
  padding-bottom: 0.2rem;
}

.md-nav--secondary .md-nav__link {
  font-size: 0.78rem;
  padding-top: 0.12rem;
  padding-bottom: 0.12rem;
}

/* Hero banner on wiki home */
.wiki-hero {
  display: grid;
  gap: 0.85rem;
  margin: 0 0 1.25rem;
  padding: 1.15rem 1.25rem;
  border-radius: var(--jr-radius-lg);
  background: var(--jr-surface);
  border: 2px solid var(--jr-gold);
  box-shadow: var(--jr-shadow-md);
}

[data-md-color-scheme="slate"] .wiki-hero {
  background: var(--jr-surface);
  border-color: rgba(232, 200, 74, 0.45);
}

.wiki-hero__grid {
  display: grid;
  grid-template-columns: 1fr minmax(180px, 40%);
  gap: 1rem 1.25rem;
  align-items: center;
}

@media (max-width: 768px) {
  .wiki-hero__grid {
    grid-template-columns: 1fr;
  }
}

.wiki-hero__badge {
  display: inline-block;
  margin: 0 0 0.45rem;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  font-family: var(--jr-body);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--jr-purple);
  background: rgba(74, 62, 130, 0.1);
}

[data-md-color-scheme="slate"] .wiki-hero__badge {
  color: var(--jr-cyan);
  background: rgba(74, 159, 212, 0.15);
}

.wiki-hero__title {
  margin: 0 0 0.35rem;
  font-family: var(--jr-heading);
  font-size: clamp(1.45rem, 1.2rem + 1vw, 1.75rem);
  font-weight: 400;
  line-height: 1.2;
  color: var(--jr-purple);
}

[data-md-color-scheme="slate"] .wiki-hero__title {
  color: var(--jr-gold-soft);
}

.wiki-hero__tagline {
  margin: 0;
  font-size: 0.925rem;
  line-height: 1.55;
  color: var(--jr-muted);
}

.wiki-hero__img {
  width: 100%;
  max-height: 150px;
  object-fit: contain;
  border-radius: var(--jr-radius);
  border: 1px solid var(--jr-border);
  box-shadow: var(--jr-shadow-sm);
}

/* Homepage: cards + screenshots */
.wiki-home-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 0 0 1rem;
}

@media (min-width: 960px) {
  .wiki-home-split {
    grid-template-columns: 1.15fr 0.85fr;
    align-items: start;
  }
}

.wiki-screenshots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  margin: 0;
}

.wiki-screenshots--strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 640px) {
  .wiki-screenshots--strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.md-typeset > h1:first-child:has(+ .wiki-hero) {
  display: none;
}

.wiki-screenshots img {
  width: 100%;
  max-height: 88px;
  object-fit: cover;
  object-position: top center;
  border-radius: var(--jr-radius);
  border: 1px solid var(--jr-border);
  transition: box-shadow 220ms cubic-bezier(0.25, 1, 0.5, 1), transform 220ms cubic-bezier(0.25, 1, 0.5, 1);
  cursor: pointer;
}

.wiki-screenshots img:hover {
  box-shadow: 0 8px 24px rgba(74, 62, 130, 0.2);
  transform: translateY(-2px);
}

@media (prefers-reduced-motion: reduce) {
  .wiki-screenshots img {
    transition: none;
  }

  .wiki-screenshots img:hover {
    transform: none;
  }
}

.wiki-quick-ref {
  margin: 0.65rem 0 0;
  padding: 0;
  border-collapse: collapse;
  width: 100%;
  max-width: none;
  font-size: 0.8125rem;
  line-height: 1.5;
}

.wiki-quick-ref th,
.wiki-quick-ref td {
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--jr-border);
  text-align: left;
  vertical-align: top;
}

.wiki-quick-ref th {
  width: 5.5rem;
  font-weight: 600;
  color: var(--jr-purple);
  background: var(--jr-surface-raised);
}

[data-md-color-scheme="slate"] .wiki-quick-ref th {
  color: var(--jr-gold-soft);
  background: var(--jr-surface-raised);
}

.wiki-section-label {
  margin: 0 0 0.5rem;
  padding-bottom: 0.25rem;
  font-family: var(--jr-heading);
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--jr-purple);
  border-bottom: 1px solid var(--jr-border);
}

[data-md-color-scheme="slate"] .wiki-section-label {
  color: var(--jr-gold-soft);
}

.wiki-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 0.6rem;
  margin: 0;
}

@media (min-width: 768px) {
  .wiki-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Plant loot cards — ~60% width, five per row on desktop */
.wiki-card-grid--plants {
  grid-template-columns: repeat(auto-fill, minmax(93px, 1fr));
}

@media (min-width: 768px) {
  .wiki-card-grid--plants {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

.wiki-card-grid--plants .wiki-card {
  padding: 0.45rem 0.5rem;
  text-align: center;
}

.wiki-card-grid--plants .wiki-card__title {
  font-size: 0.82rem;
}

.wiki-card-grid--plants .wiki-card__desc {
  font-size: 0.72rem;
  line-height: 1.35;
}

.wiki-card-grid--plants .wiki-card__icon {
  width: 40px;
  height: 40px;
}

.wiki-card {
  display: block;
  padding: 0.65rem 0.75rem;
  border-radius: var(--jr-radius);
  border: 1px solid var(--jr-border);
  background: var(--jr-surface);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--jr-shadow-sm);
  transition: border-color 200ms ease, box-shadow 200ms ease, transform 200ms ease;
  cursor: pointer;
}

[data-md-color-scheme="slate"] .wiki-card {
  background: var(--jr-surface);
  border-color: var(--jr-border);
}

.wiki-card:hover {
  border-color: var(--jr-gold);
  box-shadow: var(--jr-shadow-md);
  transform: translateY(-1px);
}

@media (prefers-reduced-motion: reduce) {
  .wiki-card {
    transition: border-color 200ms ease, box-shadow 200ms ease;
  }

  .wiki-card:hover {
    transform: none;
  }
}

.wiki-card__title {
  margin: 0 0 0.25rem;
  font-family: var(--jr-heading);
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--jr-purple);
}

[data-md-color-scheme="slate"] .wiki-card__title {
  color: var(--jr-gold-soft);
}

.wiki-card__desc {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--jr-muted);
}

/* Sidebar */
.md-nav__link {
  transition: color 200ms ease;
}

.md-nav__link--active {
  font-weight: 600;
  color: var(--jr-purple);
}

[data-md-color-scheme="slate"] .md-nav__link--active {
  color: var(--jr-gold-soft);
}

/* Tables */
.md-typeset table:not([class]) {
  font-size: 0.8125rem;
  line-height: 1.5;
  margin: 0.65rem 0;
  border-radius: var(--jr-radius);
  overflow: hidden;
  box-shadow: var(--jr-shadow-sm);
}

.md-typeset table:not([class]) thead th {
  background: var(--jr-surface-raised);
  color: var(--jr-purple);
  font-weight: 600;
}

[data-md-color-scheme="slate"] .md-typeset table:not([class]) thead th {
  color: var(--jr-gold-soft);
}

.md-typeset table:not([class]) tbody tr:nth-child(even) {
  background: rgba(74, 62, 130, 0.04);
}

[data-md-color-scheme="slate"] .md-typeset table:not([class]) tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.03);
}

/* Character sheets */
.wiki-char-compare {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
  margin: 0.75rem 0 1.1rem;
}

@media (max-width: 900px) {
  .wiki-char-compare {
    grid-template-columns: 1fr;
  }
}

.wiki-char-compare__item {
  padding: 0.65rem 0.75rem;
  border-radius: var(--jr-radius);
  border: 1px solid var(--jr-border);
  background: var(--jr-surface);
  box-shadow: var(--jr-shadow-sm);
}

[data-md-color-scheme="slate"] .wiki-char-compare__item {
  background: var(--jr-surface);
  border-color: var(--jr-border);
}

.wiki-char-compare__name {
  margin: 0 0 0.35rem;
  font-family: var(--jr-heading);
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--jr-purple);
}

[data-md-color-scheme="slate"] .wiki-char-compare__name {
  color: var(--jr-gold-soft);
}

.wiki-char-compare__meta {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--jr-muted);
}

.wiki-char-sheet {
  margin: 1.1rem 0 1.25rem;
  padding: 0.85rem 0.95rem;
  border-radius: var(--jr-radius-lg);
  border: 1px solid var(--jr-border);
  background: var(--jr-surface);
  box-shadow: var(--jr-shadow-sm);
}

.wiki-char-sheet > .wiki-char-sheet__top:last-child {
  margin-bottom: 0;
}

[data-md-color-scheme="slate"] .wiki-char-sheet {
  background: var(--jr-surface);
  border-color: var(--jr-border);
}

/* Icon + text side by side (e.g. items.md 金币) */
.wiki-char-sheet--split {
  width: fit-content;
  max-width: 100%;
  padding: 0.65rem 0.75rem;
}

.wiki-char-sheet--split .wiki-char-sheet__top {
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.85rem 1rem;
  align-items: center;
  margin-bottom: 0;
}

.wiki-char-sheet--split .wiki-char-sheet__visuals {
  grid-template-columns: auto;
  width: auto;
}

.md-typeset .wiki-char-sheet .wiki-char-frame {
  margin: 0;
}

.wiki-char-sheet--split .wiki-char-frame {
  min-height: 0;
  gap: 0.25rem;
}

.wiki-char-sheet--split .wiki-char-frame__media {
  flex: none;
  width: 5.5rem;
  height: 5.5rem;
  min-height: 0;
  padding: 0.45rem;
}

.wiki-char-sheet--split .wiki-char-frame__media img {
  width: auto;
  max-width: 100%;
  max-height: 100%;
  image-rendering: pixelated;
}

.wiki-char-sheet--split .wiki-char-sheet__blurb {
  align-self: center;
}

.wiki-char-sheet--split .wiki-char-sheet__blurb p {
  margin: 0 0 0.45rem;
}

.wiki-char-sheet--split .wiki-char-sheet__blurb p:last-child {
  margin-bottom: 0;
}

/* Playable character — portrait + arm */
.wiki-char-sheet--profile {
  width: fit-content;
  max-width: 100%;
}

.wiki-char-sheet--profile .wiki-char-sheet__top {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 1rem 1.15rem;
  margin-bottom: 0.65rem;
}

.wiki-char-sheet--profile .wiki-char-sheet__visuals {
  grid-template-columns: auto auto;
  gap: 0.65rem;
}

.wiki-char-sheet--profile .wiki-char-frame {
  min-height: 0;
}

.wiki-char-sheet--profile .wiki-char-frame:first-child .wiki-char-frame__media {
  flex: none;
  width: 7.5rem;
  height: 9.5rem;
  min-height: 0;
  padding: 0.4rem;
  display: grid;
  place-items: center;
}

.wiki-char-sheet--profile .wiki-char-frame:last-child .wiki-char-frame__media {
  flex: none;
  width: 5.5rem;
  height: 5.5rem;
  min-height: 0;
  padding: 0.4rem;
  display: grid;
  place-items: center;
}

.wiki-char-sheet--profile .wiki-char-frame__media img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center bottom;
  image-rendering: pixelated;
}

.wiki-char-sheet--profile .wiki-char-sheet__blurb {
  align-self: center;
}

.wiki-char-sheet--profile .wiki-arm-rhythm {
  margin-top: 0.55rem;
}

.wiki-char-sheet--split .wiki-char-frame__media {
  display: grid;
  place-items: center;
}

.wiki-char-sheet--split .wiki-char-frame__media img {
  image-rendering: pixelated;
}

.wiki-char-sheet--split .wiki-char-sheet__blurb .wiki-stat-list {
  margin: 0.35rem 0 0;
}

.wiki-char-sheet--boss .wiki-char-frame__media {
  width: 7rem;
  height: 7rem;
}

.wiki-char-compare--duo {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 28rem;
}

.md-typeset .wiki-char-sheet + blockquote {
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--jr-radius);
  border: 1px solid var(--jr-border);
  background: var(--jr-surface-raised);
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--jr-muted);
}

[data-md-color-scheme="slate"] .md-typeset .wiki-char-sheet + blockquote {
  background: var(--jr-bg);
}

/* Exp gems — table left, icons 1 row × 3 cols on right */
.wiki-exp-gems {
  display: grid;
  grid-template-columns: auto auto;
  gap: 0.75rem 0.85rem;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  margin: 0.65rem 0 1rem;
}

@media (max-width: 640px) {
  .wiki-exp-gems {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .wiki-exp-gems__icons {
    --gem-scale: 1;
    transform: none;
  }
}

.wiki-exp-gems__table {
  margin: 0;
  padding: 0;
}

.md-typeset .wiki-exp-gems__table .md-typeset__table {
  margin: 0;
  width: auto;
}

.md-typeset .wiki-exp-gems__table table:not([class]) {
  margin: 0;
  width: auto;
  box-shadow: var(--jr-shadow-sm);
}

.wiki-exp-gems__icons {
  --gem-scale: 1.22;
  display: grid;
  grid-template-columns: repeat(3, 4.75rem);
  gap: 0.5rem;
  transform: scale(var(--gem-scale));
  transform-origin: left center;
}

@media (prefers-reduced-motion: reduce) {
  .wiki-exp-gems__icons {
    --gem-scale: 1;
    transform: none;
    grid-template-columns: repeat(3, 5.75rem);
  }

  .wiki-exp-gems .wiki-char-frame__media {
    width: 5.75rem;
    height: 5.75rem;
  }

  .wiki-exp-gems .wiki-char-frame__media img {
    width: 4rem;
    height: 4rem;
  }
}

.md-typeset .wiki-exp-gems__icons .wiki-char-frame {
  margin: 0;
  min-height: 0;
  gap: 0.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.wiki-exp-gems .wiki-char-frame__media {
  flex: none;
  display: grid;
  place-items: center;
  width: 4.75rem;
  height: 4.75rem;
  padding: 0.45rem;
  box-sizing: border-box;
}

.wiki-exp-gems .wiki-char-frame__media img {
  display: block;
  width: 3.25rem;
  height: 3.25rem;
  max-width: none;
  max-height: none;
  object-fit: contain;
  object-position: center;
  image-rendering: pixelated;
}

.wiki-exp-gems .wiki-char-frame__label {
  flex-shrink: 0;
  font-size: 0.72rem;
  line-height: 1.3;
  text-align: center;
  white-space: nowrap;
}

.wiki-char-sheet__top {
  display: grid;
  grid-template-columns: minmax(200px, 280px) 1fr;
  gap: 0.85rem;
  align-items: start;
  margin-bottom: 0.7rem;
}

@media (max-width: 768px) {
  .wiki-char-sheet__top {
    grid-template-columns: 1fr;
  }
}

.wiki-char-sheet__visuals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.wiki-char-frame {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-height: 110px;
}

.wiki-char-frame__media {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 96px;
  padding: 0.5rem;
  border-radius: var(--jr-radius);
  border: 1px dashed var(--jr-border);
  background: var(--jr-surface-raised);
  overflow: hidden;
}

[data-md-color-scheme="slate"] .wiki-char-frame__media {
  background: var(--jr-bg);
  border-color: var(--jr-border);
}

.wiki-char-frame__media img {
  width: 100%;
  max-height: 110px;
  object-fit: contain;
}

.wiki-char-frame__placeholder {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.45;
  text-align: center;
  color: var(--jr-muted);
}

.wiki-char-frame__label {
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  color: var(--jr-muted);
}

.wiki-char-sheet__blurb {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--jr-text);
}

.wiki-char-sheet__blurb p {
  margin: 0 0 0.55rem;
}

.wiki-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem 0.75rem;
}

@media (max-width: 640px) {
  .wiki-stat-grid {
    grid-template-columns: 1fr;
  }
}

.wiki-stat-block {
  padding: 0.55rem 0.7rem;
  border-radius: var(--jr-radius);
  border: 1px solid var(--jr-border);
  background: var(--jr-surface-raised);
}

[data-md-color-scheme="slate"] .wiki-stat-block {
  background: var(--jr-bg);
  border-color: var(--jr-border);
}

.wiki-stat-block__title {
  margin: 0 0 0.45rem;
  font-family: var(--jr-heading);
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--jr-purple);
}

[data-md-color-scheme="slate"] .wiki-stat-block__title {
  color: var(--jr-gold-soft);
}

.wiki-stat-block__body {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.65;
  color: var(--jr-text);
}

.wiki-stat-inline {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.7;
}

.wiki-stat-list {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.84rem;
  line-height: 1.65;
}

.wiki-stat-list li {
  margin: 0.2rem 0;
}

.wiki-arm-rhythm {
  margin: 0.75rem 0 0;
  padding: 0.65rem 0.85rem;
  border-radius: var(--jr-radius);
  border: 1px solid rgba(201, 162, 39, 0.35);
  border-top: 3px solid var(--jr-gold);
  background: rgba(201, 162, 39, 0.08);
  font-size: 0.84rem;
  line-height: 1.6;
}

[data-md-color-scheme="slate"] .wiki-arm-rhythm {
  background: rgba(201, 162, 39, 0.12);
  border-color: rgba(232, 200, 74, 0.25);
  border-top-color: var(--jr-gold-soft);
}

.wiki-arm-rhythm code {
  font-size: 0.8em;
}

/* Loot / plant cards */
.wiki-card--static {
  cursor: default;
}

.wiki-card--static:hover {
  border-color: var(--jr-border);
  box-shadow: var(--jr-shadow-sm);
  transform: none;
}

.wiki-loot-table {
  margin: 0.5rem 0 0.75rem;
}

.wiki-loot-table table {
  width: 100%;
}

.wiki-img-ph {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--jr-muted);
  text-align: center;
}

.wiki-img-tag {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.68rem;
  line-height: 1.35;
  color: #9a6700;
  text-align: center;
}

[data-md-color-scheme="slate"] .wiki-img-tag {
  color: var(--jr-gold-soft);
}

.wiki-card__icon {
  display: block;
  width: 48px;
  height: 48px;
  margin: 0 auto 0.35rem;
  object-fit: contain;
  image-rendering: pixelated;
}

.wiki-weapon-icon {
  margin: 0 0 0.5rem;
}

.wiki-weapon-icon .wiki-card__icon {
  margin: 0;
  width: 64px;
  height: 64px;
}

/* Weapon detail — icon + meta table grid */
.wiki-weapon-sheet {
  margin: 0.65rem 0 1rem;
  padding: 0.75rem 0.85rem;
  border-radius: var(--jr-radius-lg);
  border: 1px solid var(--jr-border);
  background: var(--jr-surface);
  box-shadow: var(--jr-shadow-sm);
  width: fit-content;
  max-width: 100%;
}

[data-md-color-scheme="slate"] .wiki-weapon-sheet {
  background: var(--jr-surface);
  border-color: var(--jr-border);
}

.wiki-weapon-sheet__grid {
  display: grid;
  grid-template-columns: auto auto;
  gap: 0.75rem 1rem;
  align-items: center;
  width: fit-content;
  max-width: 100%;
}

@media (max-width: 480px) {
  .wiki-weapon-sheet__grid {
    grid-template-columns: auto minmax(0, 1fr);
    width: 100%;
  }
}

.md-typeset .wiki-weapon-sheet .wiki-weapon-sheet__icon {
  margin: 0;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-sizing: border-box;
  width: 8rem;
  height: 8rem;
  min-width: 8rem;
  min-height: 8rem;
  max-width: 8rem;
  max-height: 8rem;
  aspect-ratio: 1;
  padding: 0.5rem;
  border-radius: var(--jr-radius);
  border: 1px dashed var(--jr-border);
  background: var(--jr-surface-raised);
  overflow: hidden;
}

@media (max-width: 480px) {
  .md-typeset .wiki-weapon-sheet .wiki-weapon-sheet__icon {
    width: 7rem;
    height: 7rem;
    min-width: 7rem;
    min-height: 7rem;
    max-width: 7rem;
    max-height: 7rem;
  }
}

[data-md-color-scheme="slate"] .wiki-weapon-sheet .wiki-weapon-sheet__icon {
  background: var(--jr-bg);
  border-color: var(--jr-border);
}

.md-typeset .wiki-weapon-sheet .wiki-weapon-sheet__icon img {
  display: block;
  width: auto;
  height: auto;
  max-width: 6.5rem;
  max-height: 6.5rem;
  margin: 0;
  object-fit: contain;
  object-position: center;
  image-rendering: pixelated;
}

.wiki-weapon-sheet__meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.md-typeset .wiki-weapon-sheet__meta > p:empty {
  display: none;
}

.md-typeset .wiki-weapon-sheet__meta .md-typeset__table {
  margin: 0;
  display: block;
  width: auto;
  max-width: 100%;
  overflow: visible;
}

.md-typeset .wiki-weapon-sheet__meta table:not([class]) {
  margin: 0;
  width: auto;
  min-width: 14rem;
  max-width: 100%;
  font-size: 0.8125rem;
  line-height: 1.45;
  box-shadow: none;
  border-radius: var(--jr-radius);
  overflow: hidden;
  table-layout: auto;
}

.md-typeset .wiki-weapon-sheet__meta table:not([class]) thead th {
  padding: 0.4rem 0.65rem;
  font-size: 0.75rem;
}

.md-typeset .wiki-weapon-sheet__meta table:not([class]) tbody th,
.md-typeset .wiki-weapon-sheet__meta table:not([class]) td {
  padding: 0.42rem 0.65rem;
}

.md-typeset .wiki-weapon-sheet__meta table:not([class]) th:first-child {
  width: 1%;
  white-space: nowrap;
}

/* Legacy markup (planned pages etc.) */
.wiki-weapon-sheet__top {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  gap: 0.65rem 0.85rem;
  align-items: center;
  margin: 0;
  padding: 0;
}

.wiki-weapon-frame {
  margin: 0;
  padding: 0;
}

.wiki-weapon-frame__media {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 5.5rem;
  height: 5.5rem;
  padding: 0.35rem;
  border-radius: var(--jr-radius);
  border: 1px dashed var(--jr-border);
  background: var(--jr-surface-raised);
}

[data-md-color-scheme="slate"] .wiki-weapon-frame__media {
  background: var(--jr-bg);
  border-color: var(--jr-border);
}

.wiki-weapon-frame__media img {
  display: block;
  width: 64px;
  height: 64px;
  max-width: calc(100% - 0.25rem);
  max-height: calc(100% - 0.25rem);
  object-fit: contain;
  image-rendering: pixelated;
}

.md-typeset .wiki-weapon-sheet .wiki-weapon-frame {
  margin: 0;
}
