.wasteland-museum-name { display: none; }

body.theme-wasteland {
  --relic-ink: #26221d;
  --relic-paper: #f1eadc;
  --relic-rust: #842f26;
  --relic-rule: #a39885;
  --relic-serif: "Songti SC", "Noto Serif CJK SC", SimSun, serif;
  --relic-plaster: url("../scenes/wasteland/plaster.webp");
  --relic-enamel: radial-gradient(ellipse at 34% 25%, #faf3e6, #e5dac7 72%, #c4b29c);
  --relic-bolts: radial-gradient(circle at 7px 7px, #3b3027 0 1.3px, #927d62 2.4px, transparent 3px);
  --relic-shelf: url("../scenes/wasteland/shelf.webp");
}

body.theme-wasteland #header {
  background: linear-gradient(#ddd6cded, #bdb3a7ee), var(--relic-plaster);
  border-bottom: 1px solid #82796c;
  box-shadow: 0 4px 12px #211b1740;
}
body.theme-wasteland #header :is(.header-title, button) { color: var(--relic-ink); text-shadow: none; }
body.theme-wasteland #header .header-title { font-family: var(--relic-serif); letter-spacing: .09em; }

body.theme-wasteland #archiveHome {
  --show-text: var(--relic-ink);
  --show-muted: #4c4238;
  --show-card: var(--relic-paper);
  --show-border: var(--relic-rule);
  background: linear-gradient(105deg, #d1cac366, #b3a69b44), var(--relic-plaster) center top / 240px auto repeat #a69b90 !important;
}

body.theme-wasteland #archiveHome .archive-header {
  box-sizing: border-box;
  width: min(660px, 92%);
  min-height: 0 !important;
  margin: clamp(12px, 3vw, 40px) auto 18px !important;
  padding: clamp(26px, 4vw, 48px) 12px clamp(25px, 3vw, 42px) !important;
  align-items: center !important;
  gap: 8px;
  text-align: center !important;
  background: var(--relic-enamel) !important;
  border: 1px solid #8b7660 !important;
  border-radius: 13px 10px 12px 9px !important;
  box-shadow: 0 7px 12px #271e19a6, inset 0 0 0 3px #a8957e38 !important;
  clip-path: none;
  transform: none;
}
body.theme-wasteland #archiveHome .archive-header::before {
  content: "";
  position: absolute;
  inset: 6px;
  background: var(--relic-bolts) left top, var(--relic-bolts) right top,
    var(--relic-bolts) left bottom, var(--relic-bolts) right bottom;
  background-size: 14px 14px;
  background-repeat: no-repeat;
  pointer-events: none;
}
body.theme-wasteland #archiveHome .archive-header::after {
  content: "";
  position: absolute;
  inset: auto 10px 8px;
  height: 6px;
  background: #864034 url("../scenes/wasteland/enamel.webp") center 70% / 100% 15px;
  opacity: .83;
}
body.theme-wasteland #archiveHome .archive-header > :not(.archive-title, .wasteland-museum-subtitle),
body.theme-wasteland #archiveHome .archive-default-name { display: none !important; }
body.theme-wasteland #archiveHome .wasteland-museum-name { display: inline; }
body.theme-wasteland #archiveHome .archive-title {
  margin: 0 !important;
  color: var(--relic-ink) !important;
  font: 800 clamp(44px, 7vw, 89px)/1.08 var(--relic-serif) !important;
  letter-spacing: .07em;
}
body.theme-wasteland #archiveHome .wasteland-museum-subtitle {
  color: var(--relic-ink);
  margin: 0;
  font: 600 clamp(17px, 2.5vw, 30px)/1.4 var(--relic-serif);
  letter-spacing: .23em;
}
body.theme-wasteland #archiveHome .archive-tools {
  align-items: end;
  flex-direction: row;
  width: min(100%, 1060px);
  padding: 0 !important;
  margin: 0 auto 12px !important;
}
body.theme-wasteland #archiveHome .archive-tools h2 { font: 600 16px/1.4 var(--relic-serif); }
body.theme-wasteland #archiveHome .archive-tools .archive-kicker { display: none; }
body.theme-wasteland #archiveHome .archive-search {
  background: #f1eadcf5;
  border-color: #817365;
  color: var(--relic-ink);
}
body.theme-wasteland #archiveHome .archive-search input { color: var(--relic-ink); }
body.theme-wasteland #archiveHome .archive-search input::placeholder { color: #5a4e43; }

body.theme-wasteland #archiveGrid[hidden] { display: none !important; }
body.theme-wasteland #archiveGrid {
  width: min(100%, 1060px);
  margin-inline: auto;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  grid-template-rows: none !important;
  align-items: stretch !important;
  gap: clamp(14px, 2.5vw, 32px) 0 !important;
  padding: 0 !important;
}
body.theme-wasteland #archiveGrid .collection-card:nth-child(n) {
  display: grid !important;
  grid-template: "object" 1fr "plaque" auto "details" auto / minmax(0, 1fr);
  align-items: end !important;
  align-content: end;
  gap: 0;
  justify-items: center;
  grid-column: auto !important;
  grid-row: auto !important;
  min-width: 0;
  min-height: 0 !important;
  max-width: none;
  width: 100%;
  height: auto !important;
  padding: 0 clamp(5px, 1.35vw, 18px) 20px !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  transform: none !important;
  text-align: center !important;
  box-shadow: none !important;
  background: transparent !important;
}
body.theme-wasteland #archiveGrid .collection-card:nth-child(n)::before { content: none !important; }
body.theme-wasteland #archiveGrid .collection-card:nth-child(n)::after {
  content: "" !important;
  position: absolute;
  inset: auto 0 2px;
  height: 15px;
  box-shadow: 0 5px 6px #211b17a8;
  background: var(--relic-shelf) center / auto 100% repeat-x #766b60;
  z-index: 0;
  pointer-events: none;
}
body.theme-wasteland #archiveGrid .collection-card > :is(.card-number, .expo-number, .expo-art, .collection-graphic, .card-tag, .card-subtitle, .celestial-card-caption) { display: none !important; }
body.theme-wasteland #archiveGrid .collection-card .collection-emblem {
  grid-area: object;
  position: static !important;
  display: block !important;
  width: 100% !important;
  height: clamp(105px, 16vw, 205px) !important;
  min-height: 0 !important;
  max-height: none !important;
  margin: 0 !important;
  background: var(--exhibit) center bottom / contain no-repeat;
  filter: drop-shadow(3px 5px 4px #30251d6b);
}
body.theme-wasteland #archiveGrid .collection-emblem svg { display: none; }
body.theme-wasteland #archiveGrid [data-kind="chronicle"] { --exhibit: url("../scenes/wasteland/chronicle.webp"); }
body.theme-wasteland #archiveGrid [data-kind="labyrinth"] { --exhibit: url("../scenes/wasteland/labyrinth.webp"); }
body.theme-wasteland #archiveGrid [data-kind="atlas"] { --exhibit: url("../scenes/wasteland/atlas.webp"); }
body.theme-wasteland #archiveGrid [data-kind="gazetteer"] { --exhibit: url("../scenes/wasteland/gazetteer.webp"); }
body.theme-wasteland #archiveGrid [data-kind="journal"] { --exhibit: url("../scenes/wasteland/journal.webp"); }
body.theme-wasteland #archiveGrid [data-kind="experiment"] { --exhibit: url("../scenes/wasteland/experiment.webp"); }
body.theme-wasteland #archiveGrid [data-kind="general"] .collection-emblem svg { display: block; margin: auto; }

body.theme-wasteland #archiveGrid .collection-card .card-name {
  grid-area: plaque;
  position: relative;
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  margin: 0 !important;
  padding: 6px clamp(9px, 1.7vw, 24px);
  border: 1px solid #8b7660;
  border-radius: 4px;
  background: var(--relic-enamel);
  box-shadow: 0 3px 5px #221b18a0, inset 0 0 0 2px #c1ac943b;
  color: var(--relic-ink) !important;
  font: 700 clamp(17px, 2.3vw, 30px)/1.3 var(--relic-serif) !important;
  letter-spacing: .02em;
  text-align: left;
  overflow-wrap: anywhere;
}
body.theme-wasteland #archiveGrid .card-name::after {
  content: "";
  flex: 0 0 7px;
  height: 7px;
  border-top: 2px solid var(--relic-rust);
  border-right: 2px solid var(--relic-rust);
  transform: rotate(45deg);
}
body.theme-wasteland #archiveGrid .special-collection .card-name {
  background: linear-gradient(#413c36, #292624);
  color: #f6ebd7 !important;
  border-color: #645d54;
}
body.theme-wasteland #archiveGrid .special-collection .card-name::after { border-color: #e2c7ac; }
body.theme-wasteland #archiveGrid .collection-card .card-foot {
  grid-area: details;
  align-self: stretch;
  align-items: center !important;
  margin: 4px 0 0 !important;
  padding: 0 !important;
  border: 0;
  background: #eae1d4;
  width: 100%;
}
body.theme-wasteland #archiveGrid .collection-card .card-count { color: #463b32 !important; font-size: 10px; }
body.theme-wasteland #archiveGrid .collection-card .card-enter { display: none !important; }
body.theme-wasteland #archiveGrid .collection-card:focus-visible {
  outline: 2px solid var(--relic-rust);
  outline-offset: -2px;
}

body.theme-wasteland :is(#bookHome, #volumeHome) {
  background: linear-gradient(#ded6c9cf, #cec2b3de), var(--relic-plaster) center / 240px auto;
  color: var(--relic-ink);
}
body.theme-wasteland :is(#bookHome, #volumeHome) :is(.book-title, .volume-title, .book-count, .volume-count, .book-title-sub, .book-epigraph) {
  color: var(--relic-ink);
  text-shadow: none;
}
body.theme-wasteland #bookHome .volume-directory {
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}
body.theme-wasteland #bookHome .volume-directory-item:nth-child(n) {
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 5px 16px;
  min-height: 0;
  padding: 14px 18px;
  background: var(--relic-enamel);
  border: 1px solid #91826f !important;
  border-radius: 3px;
  color: var(--relic-ink);
  box-shadow: 0 3px 0 #756a5b66;
  text-align: left;
}
body.theme-wasteland #bookHome .volume-directory-item:nth-child(n) .vol-number { grid-column: 1; grid-row: 1; }
body.theme-wasteland #bookHome .volume-directory-item:nth-child(n) .vol-name { grid-column: 2; grid-row: 1; margin: 0; }
body.theme-wasteland #bookHome .volume-directory-item:nth-child(n) .vol-desc { grid-column: 2 / -1; grid-row: 2; }
body.theme-wasteland #bookHome .volume-directory-item:nth-child(n) .vol-chapters { grid-column: 3; grid-row: 1; margin: 0; }
body.theme-wasteland #bookHome .volume-directory-item:nth-child(n) .vol-arrow { grid-column: 4; grid-row: 1; }
body.theme-wasteland :is(#bookHome, #volumeHome) :is(.back-btn, .volume-chapter-item) {
  color: var(--relic-ink);
  background-color: var(--relic-paper);
  border-color: var(--relic-rule);
}

body.theme-wasteland[data-view-layout="article"] #content {
  --text-primary: var(--relic-ink);
  --text-secondary: #544a40;
  --accent: var(--relic-rust);
  --card-bg: var(--relic-paper);
  --border-light: #aa9e8c;
  --archive-metal: #907963;
  --archive-tint: #e2d5c3;
  background: linear-gradient(#c4baaddd, #c4baaddd), var(--relic-plaster) center / 240px auto;
}
body.theme-wasteland[data-view-layout="article"] #reader { padding: 16px 0 54px; }
body.theme-wasteland[data-view-layout="article"] #reader .main-content {
  width: min(calc(100% - 36px), 1120px);
  grid-template-columns: minmax(0, 1fr) minmax(155px, 19%);
  gap: 0 clamp(20px, 3vw, 40px);
  padding: clamp(23px, 4vw, 48px);
  border: 1px solid #a79782;
  background: linear-gradient(150deg, #f7f0e4, var(--relic-paper) 55%, #ece2d2);
  box-shadow: 0 6px 20px #3d30252e, inset 0 3px 0 #9f8b6d69;
  color: var(--relic-ink);
}
body.theme-wasteland[data-view-layout="article"] #reader .main-content.article-no-outline {
  grid-template-columns: minmax(0, 860px);
}
body.theme-wasteland[data-view-layout="article"] #reader :is(#chapterTitle, .page-single) {
  color: var(--relic-ink);
  font-family: var(--relic-serif);
}
body.theme-wasteland[data-view-layout="article"] #reader #chapterTitle { font-weight: 750; }
body.theme-wasteland[data-view-layout="article"] #reader .article-meta { border-bottom: 1px solid var(--relic-rust); }
body.theme-wasteland[data-view-layout="article"] #reader .page-single {
  background: none !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 4px 0 0 !important;
  font-size: 1.075rem;
}
body.theme-wasteland[data-view-layout="article"] #reader .article-outline {
  background: none;
  border-color: var(--relic-rule);
  margin-top: 42px;
}
body.theme-wasteland[data-view-layout="article"] #reader .article-navigation {
  grid-column: 1 / -1;
}
body.theme-wasteland[data-view-layout="article"] #reader :is(.article-back, .article-nav-link) {
  background: transparent !important;
  color: var(--relic-ink) !important;
  border-color: transparent;
}
body.theme-wasteland[data-view-layout="article"] #reader :is(.article-back, .article-nav-link):hover:not(:disabled) {
  border-color: var(--relic-rust);
}
body.theme-wasteland .osi-page :is(.osi-copy, .osi-masthead, figcaption, .osi-book-copy) { color: var(--relic-ink); }
body.theme-wasteland .osi-page .osi-portrait-frame {
  --osi-mat: clamp(6px, 1vw, 11px);
  border: 1px solid #6b5c4d;
  background: var(--relic-paper);
  box-shadow: none;
}
body.theme-wasteland .osi-page button.osi-biography {
  background: var(--relic-enamel);
  border: 1px solid #8b7660;
  color: var(--relic-ink);
}
body.theme-wasteland .osi-page .osi-book-seal { background: #d8c8b3; border-inline-end: 1px solid #8b7660; }

@media (min-width: 901px) and (max-width: 1080px) {
  body.theme-wasteland[data-view-layout="article"] #reader .main-content { display: grid; }
  body.theme-wasteland[data-view-layout="article"] #reader .article-outline:not([hidden]) { display: block; }
}
@media (max-width: 700px) {
  body.theme-wasteland #archiveHome .archive-header {
    margin-block: 12px 13px !important;
    padding-block: 20px 25px !important;
  }
  body.theme-wasteland #archiveHome .archive-title { font-size: clamp(36px, 10vw, 54px) !important; }
  body.theme-wasteland #archiveHome .archive-tools { margin-bottom: 4px !important; }
  body.theme-wasteland #archiveHome .archive-tools > div { display: none; }
  body.theme-wasteland #archiveHome .archive-search { width: 100%; }
  body.theme-wasteland #archiveGrid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 0 !important;
  }
  body.theme-wasteland #archiveGrid .collection-card:nth-child(n) {
    grid-template-columns: minmax(85px, .78fr) minmax(0, 1fr) !important;
    grid-template-rows: minmax(24px, 1fr) auto minmax(22px, 1fr) !important;
    grid-template-areas: "object ." "object plaque" "object details";
    align-items: center !important;
    gap: 0 10px !important;
    min-height: 0 !important;
    padding: 6px 6px 13px !important;
  }
  body.theme-wasteland #archiveGrid .collection-card:nth-child(n)::after { height: 11px; }
  body.theme-wasteland #archiveGrid .collection-card .collection-emblem {
    grid-area: object !important;
    align-self: end !important;
    height: clamp(91px, 25vw, 140px) !important;
  }
  body.theme-wasteland #archiveGrid .collection-card .card-name {
    grid-area: plaque !important;
    font-size: clamp(17px, 5.3vw, 24px) !important;
  }
  body.theme-wasteland #archiveGrid .collection-card .card-foot {
    grid-area: details !important;
    justify-content: center !important;
    align-self: start;
  }
  body.theme-wasteland #bookHome .volume-directory-item:nth-child(n) { gap: 4px 9px; padding-inline: 10px; }
  body.theme-wasteland[data-view-layout="article"] #reader { padding: 9px 0 85px; }
  body.theme-wasteland[data-view-layout="article"] #reader .main-content {
    width: calc(100% - 16px) !important;
    padding: 17px 15px 30px !important;
  }
}

@media (min-width: 701px) {
  body.theme-wasteland #header .header-title { text-align: left; }
  body.theme-wasteland #header .celestial-nav {
    display: flex;
    align-items: center;
    gap: clamp(12px, 2.4vw, 32px);
    margin-inline-end: 20px;
  }
  body.theme-wasteland #header .celestial-nav button {
    border: 0;
    padding: 7px 3px;
    background: transparent;
    font: 600 14px/1.4 var(--relic-serif);
    cursor: pointer;
  }
  body.theme-wasteland #header .celestial-nav [data-icon] { display: none; }
  body.theme-wasteland #header .celestial-nav button:hover { color: var(--relic-rust); }
}

body.theme-wasteland #bookHome .volume-directory-item .vol-dash { display: none; }
body.theme-wasteland #bookHome .volume-directory-item :is(.vol-name, .vol-desc, .vol-chapters) { color: var(--relic-ink); }
body.theme-wasteland #archiveGrid .collection-card .card-foot { justify-content: center !important; }
