/* Each historical renderer has its own vocabulary. Bind those values at
   their original scopes so map controls, disclosures and local progress
   can keep their existing state and behavior. */
html[data-phase-theme] {
  --world-brass-ink: #482f0d;
  --world-cta: var(--accent-ruby);
  --world-on-cta: #fffafa;
  --world-boss-rule: var(--accent-ruby);
  --world-pad: max(clamp(18px, 3.5vw, 48px), calc((100% - 1320px) / 2));
}
html[data-phase-theme="dark"] {
  --world-brass-ink: var(--accent-gold);
  --world-cta: var(--ruby-deep);
}
html[data-phase-theme] :is(body, .atlas-shell, .editorial-page, .atlas-content, .s2-guide, .guide-reader, .series-game, .series-library, .alttp-page, .guide-tabs, .cp-page, .nl-page, .fa-page) {
  --archive-ink: var(--text-primary);
  --archive-muted: var(--text-muted);
  --archive-surface: var(--bg-paper);
  --archive-deep: var(--bg-canvas);
  --archive-line: var(--border-hairline);
  --archive-stone: var(--text-primary);
  --archive-rose: var(--world-brass-ink);
  --archive-moss: var(--reading-link, var(--accent-shield));
  --atlas-ink: var(--text-primary);
  --atlas-muted: var(--text-muted);
  --atlas-line: var(--border-hairline);
  --atlas-gold: var(--world-brass-ink);
  --ed-gold: var(--world-brass-ink);
  --ed-ink: var(--text-primary);
  --ed-muted: var(--text-muted);
  --ed-line: var(--border-hairline);
  --ed-panel: var(--bg-paper);
  --article-cream: var(--text-primary);
  --article-muted: var(--text-muted);
  --article-line: var(--border-hairline);
  --article-gold: var(--world-brass-ink);
  --series-surface: var(--bg-paper);
  --series-border: var(--border-hairline);
  --series-gold: var(--world-brass-ink);
  --series-soft: var(--text-muted);
  --series-ink: var(--text-primary);
  --series-deep: var(--bg-canvas);
  --s2-ink: var(--text-primary);
  --s2-muted: var(--text-muted);
  --s2-blue: var(--reading-link, var(--accent-shield));
  --s2-paper: var(--bg-paper);
  --s2-line: var(--border-hairline);
  --s2-ruby: var(--world-boss-rule);
  --guide-surface: var(--bg-paper);
  --guide-ink: var(--text-primary);
  --guide-muted: var(--text-muted);
  --guide-gold: var(--reading-link, var(--accent-shield));
  --guide-line: var(--border-hairline);
  --tab-ink: var(--text-primary);
  --tab-gold: var(--world-brass-ink);
  --fa-muted: var(--text-muted);
  --fa-line: var(--border-hairline);
  --fa-gold: var(--world-brass-ink);
  --cp-muted: var(--text-muted);
  --cp-line: var(--border-hairline);
  --cp-gold: var(--world-brass-ink);
  --nl-muted: var(--text-muted);
  --nl-line: var(--border-hairline);
  --nl-gold: var(--world-brass-ink);
}
html[data-phase-theme] .alttp-page,
html[data-phase-theme] .alttp-page[data-world] {
  --alttp-ink: var(--bg-canvas);
  --alttp-muted: var(--text-muted);
  --alttp-paper: var(--text-primary);
  --alttp-panel: var(--bg-paper);
  --alttp-line: var(--border-hairline);
  --alttp-gold: var(--world-brass-ink);
  --alttp-accent: var(--reading-link, var(--accent-shield));
}
html[data-phase-theme] #atlas-main {
  --reading-paper: var(--text-primary);
  --reading-ink: var(--text-primary);
  --reading-copy: var(--text-primary);
  --reading-brass: var(--world-brass-ink);
  --reading-rule: var(--border-hairline);
  --reading-done: color-mix(in srgb, var(--accent-ruby) 9%,var(--bg-paper));
  --reading-panel: var(--bg-paper);
  --reading-line: var(--border-hairline);
  --reading-muted: var(--text-muted);
  --reading-gold: var(--world-brass-ink);
  --reading-serif: var(--phase-serif);
}
html[data-phase-theme] body .atlas-shell,
html[data-phase-theme] .alttp-page,
html[data-phase-theme] .atlas-shell:has(.forum--community) {
  color: var(--text-primary);
  background-color: transparent;
}
html[data-phase-theme] .archive-body .atlas-content {
  color: var(--text-primary);
  --archive-rose: var(--world-brass-ink);
  --archive-muted: var(--text-muted);
}

/* Full-bleed title band and a separately framed plate. Keep the credit
   with the image, outside the title and description's reading measure. */
html[data-phase-theme] :is(.atlas-lead, .guide-reader__hero, .alttp-search-heading, .alttp-hero) {
  --world-band: var(--surface-classic);
  --world-title: #fff7e6;
  --world-caption: #e7e5df;
  --world-crumb: #ebc268;
}
html[data-phase-theme] :is(.s2-guide, .s2-map-page, .remake-hub) :is(.atlas-lead, .guide-reader__hero),
html[data-phase-theme] .atlas-lead[data-section="remake"] { --world-band: var(--surface-switch2); }
html[data-phase-theme] body .atlas-shell :is(#atlas-main, main) .atlas-lead,
html[data-phase-theme] body .atlas-shell :is(#atlas-main, main) .atlas-lead:has(>figure) {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  width: 100%; max-width: none; min-height: 0; margin: 0;
  padding: clamp(18px, 2vw, 30px) var(--world-pad);
  gap: 0; background: var(--world-band);
  border-block-end: 2px solid #c4902e;
  color: var(--world-title);
  isolation: isolate;
}
html[data-phase-theme] body .atlas-shell :is(#atlas-main, main) .atlas-lead:has(>figure) {
  grid-template-columns: minmax(0, 1.65fr) minmax(0, .75fr);
  gap: clamp(20px, 4vw, 64px);
}
html[data-phase-theme] body .atlas-shell :is(#atlas-main, main) .atlas-lead .atlas-lead__copy,
html[data-phase-theme] body .atlas-shell :is(#atlas-main, main) .atlas-lead:has(>figure) .atlas-lead__copy {
  grid-area: auto; align-self: center; justify-self: stretch;
  display: block; margin: 0; width: 100%; max-width: 85ch; padding: 0;
  position: relative; z-index: 2;
}
html[data-phase-theme] body .atlas-shell :is(#atlas-main, main) .atlas-lead :is(h1,.atlas-intro,.atlas-breadcrumb,.atlas-eyebrow),
html[data-phase-theme] body .atlas-shell :is(#atlas-main, main) .atlas-lead:has(>figure) :is(h1,.atlas-intro,.atlas-breadcrumb,.atlas-eyebrow) {
  text-align: start; padding: 0; border: 0;
}
html[data-phase-theme] body .atlas-shell :is(#atlas-main, main) .atlas-lead h1,
html[data-phase-theme] body .atlas-shell :is(#atlas-main, main) .atlas-lead:has(>figure) h1 {
  max-width: 32ch; margin: .16em 0 .22em;
  color: var(--world-title); font: 400 clamp(1.9rem, 3.35vw, 3rem)/1.09 var(--phase-serif);
  letter-spacing: -.027em; overflow-wrap: anywhere; text-wrap: balance;
}
html[data-phase-theme] body .atlas-shell :is(#atlas-main, main) .atlas-lead .atlas-breadcrumb,
html[data-phase-theme] body .atlas-shell :is(#atlas-main, main) .atlas-lead:has(>figure) .atlas-breadcrumb {
  margin: 0 0 8px; color: var(--world-caption); font: 500 .77rem/1.45 var(--phase-sans);
}
html[data-phase-theme] body .atlas-shell :is(#atlas-main, main) .atlas-lead .atlas-eyebrow {
  color: var(--world-crumb); margin: 0; font: 600 .7rem/1.5 var(--phase-mono);
  letter-spacing: .045em;
}
html[data-phase-theme] body .atlas-shell :is(#atlas-main, main) .atlas-lead .atlas-intro,
html[data-phase-theme] body .atlas-shell :is(#atlas-main, main) .atlas-lead:has(>figure) .atlas-intro {
  margin: 0; max-width: 70ch; color: var(--world-caption); font: 450 clamp(.92rem,1.04vw,1.02rem)/1.52 var(--phase-sans);
}
html[data-phase-theme] body .atlas-shell :is(#atlas-main, main) .atlas-lead figure.atlas-lead-art,
html[data-phase-theme] body .atlas-shell :is(#atlas-main, main) .atlas-lead figure.atlas-section-art {
  display: grid; grid-area: auto; align-self: center; justify-self: end;
  margin: 0; padding: 0; position: relative; inset: auto; z-index: 1;
  width: 100%; max-width: 380px; height: auto; min-height: 0; max-height: none;
  border: 1px solid #ebc26852; border-radius: 3px; background: #18181d;
}
html[data-phase-theme] body .atlas-shell :is(#atlas-main, main) .atlas-lead figure.atlas-lead-art > img,
html[data-phase-theme] body .atlas-shell :is(#atlas-main, main) .atlas-lead figure.atlas-section-art > img {
  box-sizing: border-box; position: static; grid-area: 1/1; display: block;
  width: 100%; height: clamp(86px,10vw,142px); min-height: 0; max-height: none;
  object-fit: cover; object-position: 50% 48%; transform: none; animation: none;
}
html[data-phase-theme] body .atlas-shell :is(#atlas-main, main) .atlas-lead figure.atlas-lead-art--official > img {
  object-fit: contain; padding: 3px; background: var(--plate-ground, #18181d);
}
html[data-phase-theme] body .atlas-shell :is(#atlas-main, main) .atlas-lead figure::after { display: none; }
html[data-phase-theme] body .atlas-shell :is(#atlas-main, main) .atlas-lead figure figcaption {
  grid-area: auto; position: static; max-width: 100%; width: 100%; margin: 0; padding: 3px 7px;
  color: #ebe2cb; background: #17171c; text-align: end; font: 400 .66rem/1.5 var(--phase-sans);
}
html[data-phase-theme] body .atlas-shell :is(#atlas-main, main) .atlas-lead figure figcaption a { color: inherit; }
html[data-phase-theme] .guide-reader:not([data-bottle-guide]) {
  width: 100%; max-width: none; padding-block-start: 0;
}
html[data-phase-theme] .guide-reader:not([data-bottle-guide]) .guide-reader__hero,
html[data-phase-theme] .alttp-search-heading {
  position: relative; box-sizing: border-box; width: 100%; max-width: none; margin: 0;
  padding: clamp(18px,2vw,30px) var(--world-pad);
  background-color: var(--world-band); border-block-end: 2px solid #c4902e;
  --guide-ink: #fff7e6; --guide-muted: #e7e5df; --guide-gold: #ebc268;
  color: var(--world-title);
}
html[data-phase-theme] .guide-reader:not([data-bottle-guide]) .guide-reader__hero h1,
html[data-phase-theme] body .alttp-search-heading h1 {
  color: var(--world-title); font: 400 clamp(1.85rem,3vw,2.65rem)/1.12 var(--phase-serif);
  margin: .15em 0 .3em; max-width: 32ch;
}
html[data-phase-theme] .guide-reader__hero :is(.guide-reader__lede,figcaption),
html[data-phase-theme] .alttp-search-heading p { color: var(--world-caption); }
html[data-phase-theme] .guide-reader__hero .atlas-breadcrumb,
html[data-phase-theme] .alttp-search-heading a { color: var(--world-crumb); }
html[data-phase-theme] .alttp-hero {
  --alttp-paper: #fff7e6; --alttp-muted: #e7e5df; --alttp-gold: #ebc268; --alttp-ink: #18181d;
}
html[data-phase-theme] body .atlas-shell .alttp-hero h1 { font-size: clamp(2rem,3.3vw,3rem); }
html[data-phase-theme]:is(:lang(zh),:lang(ja)) body .atlas-shell :is(#atlas-main, main) .atlas-lead h1 {
  letter-spacing: 0; line-height: 1.18; word-break: normal;
}
@media(max-width: 650px) {
  html[data-phase-theme] body .atlas-shell :is(#atlas-main, main) .atlas-lead:has(>figure) {
    grid-template-columns: minmax(0,1fr); gap: 12px;
  }
  html[data-phase-theme] body .atlas-shell :is(#atlas-main, main) .atlas-lead figure:is(.atlas-section-art,.atlas-lead-art) {
    max-width: none; justify-self: stretch;
  }
  html[data-phase-theme] body .atlas-shell :is(#atlas-main, main) .atlas-lead figure:is(.atlas-section-art,.atlas-lead-art) > img {
    height: clamp(82px,24vw,125px);
  }
}

/* On older guides "reading paper" meant both the colour of the page and
   white lettering. A page and its ink need independent surfaces here. */
html[data-phase-theme] #atlas-main :is(.s2-steps, .z64-steps, .alttp-search-steps, .ed-comparisons),
html[data-phase-theme] .archive-body .atlas-shell :is(.ed-prose,.archive-article__body,.journal-hints) {
  --carnet-encre: var(--text-primary); --carnet-texte: var(--text-primary);
  --carnet-rouille: var(--world-brass-ink); --ed-line: var(--border-hairline);
  --article-line: var(--border-hairline); --article-cream: var(--text-primary);
  background: var(--bg-paper); color: var(--text-primary); border-color: var(--border-hairline);
}
html[data-phase-theme] .archive-body .atlas-shell .atlas-content {
  --archive-rose: var(--world-brass-ink); --archive-muted: var(--text-muted);
}
html[data-phase-theme] body .atlas-shell :is(.ed-prose,.archive-article__body,.journal-hints,.z64-steps,.s2-steps) a {
  color: var(--reading-link, var(--accent-shield));
}
html[data-phase-theme] #atlas-main :is(.s2-boss, .z64-boss, .alttp-boss, .series-boss) {
  border-inline-start: 3px solid var(--world-boss-rule); background: var(--bg-paper);
}
html[data-phase-theme] #atlas-main :is(.s2-boss, .z64-boss, .alttp-boss, .series-boss) :is(.ed-kicker,.z64-kicker,.atlas-eyebrow) {
  color: var(--ruby-ink);
}
html[data-phase-theme] .atlas-content .atlas-eyebrow,
html[data-phase-theme] .atlas-share .atlas-eyebrow,
html[data-phase-theme] .ed-dossier-number { color: var(--world-brass-ink); }
html[data-phase-theme] .atlas-shell .atlas-share { border-color: var(--border-hairline); }
html[data-phase-theme] .atlas-shell .atlas-share p,
html[data-phase-theme] .guide-site-search a { color: var(--text-primary); }
html[data-phase-theme] .archive-body .guide-tabs a:is(:hover,[aria-selected=true],[aria-current=location]) {
  background: var(--bg-parchment); color: var(--text-primary); border-color: var(--border-hairline);
  box-shadow: inset 0 -2px 0 var(--world-boss-rule);
}
html[data-phase-theme] .archive-body .guide-tabs a { color: var(--text-primary); }
html[data-phase-theme] #atlas-main .guide-bar {
  --guide-bar-ink: var(--text-primary); --guide-bar-surface: var(--bg-paper);
  --guide-bar-line: var(--border-hairline); --guide-bar-gold: var(--ruby-ink); --guide-bar-muted: var(--text-muted);
}
html[data-phase-theme] #atlas-main .guide-bar .guide-bar__next,
html[data-phase-theme] body .atlas-shell :is(.s2-button:not(.s2-button--quiet), .z64-button, .series-button,.atlas-finder__submit,.alttp-hero-actions button) {
  background: var(--world-cta); color: var(--world-on-cta); border-color: var(--accent-ruby);
}
html[data-phase-theme] #atlas-main progress,
html[data-phase-theme] #atlas-main .guide-bar .guide-bar__meter progress {
  accent-color: var(--accent-ruby); color: var(--accent-ruby); background: var(--bg-parchment);
}
html[data-phase-theme] #atlas-main progress::-webkit-progress-bar { background: var(--bg-parchment); }
html[data-phase-theme] #atlas-main progress::-webkit-progress-value { background: var(--accent-ruby); }
html[data-phase-theme] #atlas-main progress::-moz-progress-bar { background: var(--accent-ruby); }
html[data-phase-theme] #atlas-main input[type="checkbox"] { accent-color: var(--accent-ruby); }
html[data-phase-theme] #atlas-main .guide-bar__panel { scrollbar-color: var(--text-muted) var(--bg-paper); }
html[data-phase-theme] #atlas-main .guide-bar__panel li > a,
html[data-phase-theme] #atlas-main :is(.s2-sidebar,.z64-reader__sidebar) > ul > li { border-color: var(--border-hairline); }
html[data-phase-theme] #atlas-main .guide-bar .guide-bar__next:hover {
  background: var(--ruby-deep); border-color: var(--accent-ruby); color: var(--world-on-cta);
}
html[data-phase-theme] #atlas-main .guide-bar .guide-bar__next:focus-visible {
  outline: 2px solid var(--accent-ruby); outline-offset: 3px;
}
html[data-phase-theme] #atlas-main .guide-bar :is(.guide-bar__toggle, li a):hover,
html[data-phase-theme] #atlas-main .guide-bar .guide-bar__toggle[aria-expanded=true],
html[data-phase-theme] .s2-directory a:hover {
  background: var(--bg-parchment); color: var(--text-primary);
}
html[data-phase-theme] .atlas-breadcrumb span { color: inherit; }
html[data-phase-theme] .guide-reader:not([data-bottle-guide]) .guide-reader__hero figure img {
  max-height: 170px; width: 100%; object-fit: contain;
}
html[data-phase-theme] .guide-reader:not([data-bottle-guide]) .guide-reader__hero .guide-reader__media { max-width: 430px; }
html[data-phase-theme] body .alttp-hero {
  min-height: 0; background-color: #18181d; color: #fff7e6;
}
html[data-phase-theme] body .alttp-hero-copy { box-sizing: border-box; padding: 22px var(--world-pad); width: 100%; }
html[data-phase-theme] body .alttp-hero .alttp-kicker { margin: 12px 0 5px; }
html[data-phase-theme] body .alttp-hero h1 span { font-size: clamp(1rem,1.8vw,1.45rem); margin: 4px 0 9px; }
html[data-phase-theme] .alttp-hero .alttp-hero-actions { margin-top: 10px; }
html[data-phase-theme] .alttp-hero .alttp-hero-copy > p { margin-block: 6px; }
html[data-phase-theme] .alttp-hero .alttp-hero-copy a { color: #ebc268; }
html[data-phase-theme] .alttp-hero .alttp-edition-stamp { color: #fff7e6; }
html[data-phase-theme] .alttp-hero .alttp-edition-stamp :is(small,span) { color: #ede3cd; }
html[data-phase-theme] .alttp-hero .alttp-world-plate { max-width: 100%; }
html[data-phase-theme] .alttp-page .alttp-workbench,
html[data-phase-theme] .editorial-page .archive-article__facts {
  background: var(--bg-paper); color: var(--text-primary); border-color: var(--border-hairline);
}
html[data-phase-theme] .alttp-chapter-number { color: var(--world-brass-ink); }
html[data-phase-theme] .atlas-shell :is(.ed-legend-card,.ed-blog-card,.journal-card,.ed-verdict) {
  border-color: var(--border-hairline); background: var(--bg-paper);
}
html[data-phase-theme] .atlas-shell .ed-status { color: var(--world-brass-ink); }
html[data-phase-theme] .atlas-shell .ed-status--true { color: var(--reading-link, var(--accent-ruby)); }
html[data-phase-theme] .atlas-shell .ed-segmented button[aria-pressed=true],
html[data-phase-theme] .journal-filters button[aria-pressed=true],
html[data-phase-theme] .alttp-categories button[aria-pressed=true],
html[data-phase-theme] .journal-complete button:not([aria-pressed=true]) {
  color: var(--ruby-ink); background: var(--ruby-wash); border-color: var(--accent-ruby);
}
html[data-phase-theme] .atlas-shell :is(.atlas-finder,.atlas-resume-hub) {
  --finder-paper: var(--text-primary); --finder-secondary: var(--text-muted);
  --finder-forest: var(--bg-paper); --finder-surface: var(--bg-parchment);
  --finder-line: var(--border-hairline); --finder-focus: var(--accent-shield); --finder-gold: var(--world-brass-ink);
}
html[data-phase-theme] :is(.oot-map-era-filter,.oot-map-supplement) {
  --supplement-line: var(--border-hairline); --supplement-muted: var(--text-muted);
  --supplement-link: var(--reading-link, var(--accent-shield)); color: var(--text-primary);
}
html[data-phase-theme] :is(.oot-map-era-filter,.oot-map-supplement) select,
html[data-phase-theme] .s2-map-page .s2-map-region-select select {
  color-scheme: inherit; background: var(--bg-paper); color: var(--text-primary);
}
html[data-phase-theme] .s2-map-page {
  --s2-map-gold: var(--world-brass-ink);
}
html[data-phase-theme] .s2-map-page :is(.s2-map-total,.s2-map-filters button small) { color: var(--text-muted); }
html[data-phase-theme] .s2-map-page .s2-map-filters button:is(:hover,[aria-pressed=true]) {
  background: var(--bg-parchment); color: var(--text-primary); border-color: var(--accent-ruby);
}
html[data-phase-theme] .s2-map-page .s2-map-check span {
  background: var(--bg-paper); color: var(--text-primary); border-color: var(--border-hairline);
}
html[data-phase-theme] .s2-map-page .s2-map-check input:checked + span { color: var(--world-on-cta); background: var(--world-cta); }
html[data-phase-theme] .s2-map-page .region-atlas__pin[aria-pressed=true] .region-atlas__dot,
html[data-phase-theme] .n64-atlas__pin[aria-current] b,
html[data-phase-theme] .alttp-pin[aria-pressed=true],
html[data-phase-theme] .collectible-explorer .map-pin[aria-pressed=true] {
  background: var(--world-cta); color: var(--world-on-cta); border-color: var(--accent-ruby);
}
html[data-phase-theme] .s2-map-page :is(.s2-map-pin-name,.s2-map-pin-count, .s2-map-caption) {
  color: #fff7e6;
}
html[data-phase-theme] .region-atlas .region-atlas__bar { color: #fff7e6; }
html[data-phase-theme] .atlas-shell .launch-method p { color: var(--text-muted); }
html[data-phase-theme] :is(.companion-current,.companion-next,.companion-backup,.companion-choose select,.companion-collection a) {
  color: var(--text-primary); background: var(--bg-paper); border-color: var(--border-hairline);
}
html[data-phase-theme] .atlas-shell :is(.companion-current__body,.companion-next,.companion-collection,.companion-backup,.companion-layout,.companion-help) :is(p,small,label,summary) { color: var(--text-muted); }
html[data-phase-theme] .atlas-shell :is(.companion-current__body,.companion-next,.companion-backup,.companion-layout) :is(h2,h3,strong) { color: var(--text-primary); }
html[data-phase-theme] .atlas-shell :is(.companion-next,.companion-help,.companion-choose,.companion-current__body) :is(a,summary) { color: var(--world-brass-ink); }
html[data-phase-theme] .companion-collection { background: var(--border-hairline); }
html[data-phase-theme] .atlas-shell .cp-card,
html[data-phase-theme] .atlas-shell :is(.cp-feature,.cp-choices,.cp-contact form,.fa-empty,.fa-card,.fa-signin,.fa-form,.nl-preview,.nl-subscribe) {
  background: var(--bg-paper); border-color: var(--border-hairline); color: var(--text-primary);
}
html[data-phase-theme] .atlas-shell :is(.cp-page,.nl-page,.fa-page) :is(h2,h3,strong,label) { color: var(--text-primary); }
html[data-phase-theme] .atlas-shell :is(.cp-page,.nl-page,.fa-page) :is(p:not([class*="kicker"]),li) { color: var(--text-muted); }
html[data-phase-theme] .atlas-shell :is(.cp-page,.nl-page,.fa-page) :is(input:not([type=checkbox]),textarea,select) {
  color: var(--text-primary); background: var(--bg-paper); border-color: var(--border-hairline);
}
html[data-phase-theme] .atlas-shell :is(.cp-contact button,.nl-form button,.fa-signin a,.fa-button) {
  background: var(--world-cta); color: var(--world-on-cta); border-color: var(--accent-ruby);
}
html[data-phase-theme] .atlas-shell .nl-preview__hero { background: var(--surface-brand); color: #fff7e6; }
html[data-phase-theme] .atlas-shell .nl-preview__hero :is(p,h2) { color: #fff7e6; }
html[data-phase-theme] .atlas-shell .nl-preview__hero .nl-kicker { color: #ebc268; }
html[data-phase-theme] .atlas-shell .nl-status { color: var(--text-muted) !important; }
html[data-phase-theme] .atlas-shell :is(.nl-status--error,.fa-notice--error) { color: var(--ruby-ink) !important; }
html[data-phase-theme] .atlas-shell .forum--community {
  --forum-ink: var(--text-primary); --forum-muted: var(--text-muted); --forum-gold: var(--world-brass-ink);
  --forum-line: var(--border-hairline); --forum-input: var(--bg-paper); --forum-control-border: var(--text-muted);
  --forum-green: var(--bg-parchment); --forum-blue: var(--reading-link,var(--accent-shield));
  --forum-ruby: var(--world-boss-rule); --forum-leaf: var(--text-muted);
  color: var(--text-primary); background: transparent;
}
html[data-phase-theme] .forum--community :is(.forum-topline,.forum-empty,.forum-editor,.forum-modal,.forum-thread-detail,.forum-panel,.forum-panel--account,.forum-panel--rules,.forum-statbar,.forum-statbar>div:nth-child(n)) {
  color: var(--text-primary); background: var(--bg-paper); border-color: var(--border-hairline);
}
html[data-phase-theme] .forum--community :is(p, label) { color: var(--text-muted); }
html[data-phase-theme] .forum--community :is(h2,h3,.forum-statbar strong) { color: var(--text-primary); }
html[data-phase-theme] main.system-page { color: var(--text-primary); background: var(--bg-paper); }
html[data-phase-theme] main.system-page a { color: var(--reading-link,var(--accent-shield)); }
@media(max-width: 650px) {
  html[data-phase-theme] .alttp-hero-copy { padding-block: 16px; }
  html[data-phase-theme] .guide-reader:not([data-bottle-guide]) .guide-reader__hero figure img { max-height: 115px; }
}
html[data-phase-theme] .alttp-page .alttp-workbench {
  --alttp-ink: var(--bg-canvas); --alttp-panel: var(--bg-paper);
  --alttp-line: var(--border-hairline); --alttp-muted: var(--text-muted);
  --alttp-gold: var(--world-brass-ink);
}
html[data-phase-theme] .alttp-page .alttp-body .atlas-eyebrow,
html[data-phase-theme] .alttp-page .book-emblem { color: var(--world-brass-ink); }
html[data-phase-theme] .alttp-page .adventure-book {
  color: var(--text-primary); background: var(--bg-parchment); border-color: var(--border-hairline);
}
html[data-phase-theme] .alttp-page .adventure-book :is(.book-spread,.book-page,.book-frontispiece,.book-dungeons article,.book-satchel li) {
  background: var(--bg-paper); border-color: var(--border-hairline); color: var(--text-primary);
}
html[data-phase-theme] .alttp-page .adventure-book :is(p,small,.book-footnote,.alttp-kicker) { color: var(--text-muted); }
html[data-phase-theme] .alttp-page .book-tabs button,
html[data-phase-theme] .alttp-page :is(.book-dungeons,.book-satchel,.book-records) button:not(.book-action) {
  color: var(--text-primary) !important;
}
html[data-phase-theme] .alttp-page .book-tabs button[aria-pressed=true] {
  background: var(--bg-paper); border-color: var(--accent-ruby); box-shadow: inset 0 -2px var(--accent-ruby);
}
html[data-phase-theme] .alttp-page .book-page .book-action {
  color: var(--world-on-cta); background: var(--world-cta); border-color: var(--accent-ruby);
}
html[data-phase-theme] .alttp-page .alttp-lead-credit,
html[data-phase-theme] .alttp-page .alttp-edition-stamp {
  background: #18181d; color: #f3f1ec;
}
html[data-phase-theme] .totk-explorer {
  --totk-border: var(--border-hairline); --totk-ink: var(--text-primary);
  --totk-muted: var(--text-muted); --totk-accent: var(--world-brass-ink);
}
html[data-phase-theme] .totk-explorer :is(.totk-explorer__detail, input:not([type=checkbox]),select,button) {
  background: var(--bg-paper); color: var(--text-primary); border-color: var(--border-hairline);
}
html[data-phase-theme] .totk-explorer button:enabled:hover { background: var(--bg-parchment); }
html[data-phase-theme] .guide-reader:not([data-bottle-guide]) .guide-reader__hero > img {
  max-height: 164px; object-fit: cover;
}
html[data-phase-theme] .guide-tabs a:is([aria-selected=true],[aria-current=location],:hover) {
  background: var(--bg-parchment); color: var(--text-primary);
  border-color: var(--border-hairline); box-shadow: inset 0 -2px 0 var(--world-boss-rule);
}
html[data-phase-theme] .forum--community :is(.forum-presence,.forum-state span,.forum-state p,.forum-panel--account p,.forum-panel--rules p,.forum-login label span) { color: var(--text-muted); }
html[data-phase-theme] .forum--community .forum-state--closed h2 { color: var(--text-primary); }
html[data-phase-theme] .forum--community .forum-rule-links a { color: var(--reading-link); }
html[data-phase-theme] .atlas-shell .nl-page .nl-preview__hero p:not([class*="kicker"]) { color: #e7e5df; }
html[data-phase-theme] .companion-collection a span { color: var(--world-brass-ink); }
html[data-phase-theme] .companion-current__art > span { color: #ebc268; background: #18181d; }
html[data-phase-theme] .archive-body .atlas-shell .atlas-content .atlas-breadcrumb span,
html[data-phase-theme] body .atlas-shell main .atlas-lead .atlas-breadcrumb span { color: inherit; }

html[data-phase-theme] #atlas-main .s2-shortcuts > span,
html[data-phase-theme] #atlas-main .atlas-content .s2-shortcuts > span {
  color: var(--text-muted);
}
html[data-phase-theme] #atlas-main .z64-steps .z64-step-marker span,
html[data-phase-theme] #atlas-main .s2-steps .s2-check > span {
  color: var(--world-brass-ink);
}
html[data-phase-theme] #atlas-main .z64-boss .z64-kicker { color: var(--ruby-ink); }
html[data-phase-theme] #atlas-main .series-start a.series-button { color: var(--world-on-cta); }
html[data-phase-theme] .atlas-shell .ed-legend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  align-items: start;
  column-gap: clamp(14px, 2vw, 24px);
}
html[data-phase-theme] .atlas-shell .ed-legend-grid .ed-legend-card {
  min-width: 0; height: auto; align-self: start;
}
@media (min-width: 1024px) {
  html[data-phase-theme] .atlas-shell .ed-legend-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  html[data-phase-theme] .atlas-shell .ed-legend-grid { grid-template-columns: minmax(0,1fr); }
}
html[data-phase-theme] .atlas-shell .series-start a.series-button { --series-gold: var(--world-on-cta); }
html[data-phase-theme] .atlas-shell .atlas-resume-hub { --finder-gold: var(--reading-link); }
html[data-phase-theme] .atlas-shell .forum.forum--community .forum-state--closed {
  background: var(--bg-paper); color: var(--text-primary); border-color: var(--border-hairline);
}
html[data-phase-theme] .atlas-shell .forum.forum--community .forum-filters label,
html[data-phase-theme] .atlas-shell .forum.forum--community .forum-panel p:not(.forum-overline) { color: var(--text-muted); }
html[data-phase-theme] .atlas-shell .forum .forum-button:not(.forum-button--secondary,.forum-button--danger) { background: var(--world-cta); color: var(--world-on-cta); border-color: var(--accent-ruby); }
html[data-phase-theme] .atlas-shell :is(.nl-status--error,.fa-notice--error) { color: var(--ruby-ink) !important; }
html[data-phase-theme] .archive-article__body .archive-sources li span { color: var(--text-muted); }
html[data-phase-theme] .remake-hub .remake-feature {
  --atlas-ink: #fff7e6; --atlas-muted: #e7e5df; --atlas-gold: #ebc268;
  color: var(--atlas-ink);
}
html[data-phase-theme] .archive-body .carnet-object { background: var(--bg-paper); color: var(--text-primary); }
html[data-phase-theme] .archive-body .carnet-object :is(h2,p) { color: var(--text-primary); }
html[data-phase-theme] .carnet-object__plate .carnet-model-credit { background: var(--bg-parchment); color: var(--text-primary); }
html[data-phase-theme] .atlas-shell .adventure-book :is(h2,h3,h4,strong),
html[data-phase-theme] .atlas-shell .adventure-book .book-emblem { color: var(--text-primary); }
html[data-phase-theme] .atlas-shell .adventure-book .book-frontispiece a { color: var(--reading-link); }
html[data-phase-theme] .ocarina-page-shell .atlas-shell .ocarina-atelier__console {
  --atelier-muted: #f3f1ec; --atelier-gold: #ebc268; background-color: #25252b;
}
html[data-phase-theme] .ocarina-page-shell .atlas-shell .ocarina-visual__views button[aria-pressed=true],
html[data-phase-theme] .ocarina-page-shell .atlas-shell .ocarina-cadence__slots li {
  background-color: #37373f; color: #fff7e6;
}
html[data-phase-theme] .atlas-shell .forum.community-admin {
  --forum-ink: var(--text-primary); --forum-muted: var(--text-muted); --forum-gold: var(--world-brass-ink);
  --forum-line: var(--border-hairline); --forum-green: var(--bg-parchment);
}
html[data-phase-theme] .atlas-shell .forum.community-admin .forum-panel { color: var(--text-primary); background-color: var(--bg-paper); }
html[data-phase-theme] .atlas-shell .forum.community-admin .forum-panel :is(h2,h3) { color: var(--text-primary); }
html[data-phase-theme] .atlas-shell .forum.community-admin .forum-panel p { color: var(--text-muted); }
html[data-phase-theme] .atlas-shell .forum.community-admin .forum-panel a,
html[data-phase-theme] .atlas-shell .journal-version .journal-version__switch2,
html[data-phase-theme] .atlas-shell .journal-quick-links .journal-quick-links__switch2 { color: var(--reading-link); }
html[data-phase-theme] #atlas-main .journal-hints :is(.journal-solution-link:not([data-atlas-monocle]),.journal-kicker) {
  color: var(--world-brass-ink);
}
html[data-phase-theme] .alttp-page .adventure-book .book-frontispiece a { color: var(--reading-link) !important; }
html[data-phase-theme] .archive-body .carnet-object .carnet-play { color: var(--reading-link); }
html[data-phase-theme] .atlas-shell .journal-version .journal-version__switch2 { color: var(--reading-link) !important; }
html[data-phase-theme] #atlas-main .journal-hints .journal-solution-link[data-atlas-monocle] { color: var(--accent-lens); }
html[data-phase-theme="dark"] #atlas-main .journal-hints .journal-solution-link[data-atlas-monocle] { color: var(--accent-lens); }

/* Game catalogue plates and the two original games' map directories. */
html[data-phase-theme] #atlas-main .series-library .alttp-featured,
html[data-phase-theme] .series-library #atlas-main .alttp-featured {
  background: #18181d; color: #f3f1ec;
}
html[data-phase-theme] #atlas-main .alttp-featured .alttp-featured__art,
html[data-phase-theme] #atlas-main .alttp-featured .alttp-featured__thumbnail { background: #18181d; }
html[data-phase-theme] #atlas-main .alttp-featured figcaption,
html[data-phase-theme] #atlas-main .series-card-art > span { background: rgb(20 20 24 / .92); color: #fffafa; }
html[data-phase-theme] #atlas-main .series-grid .series-card-art {
  background: #18181d !important;
}
html[data-phase-theme] #atlas-main .series-card-art > small { color: #fffafa; text-shadow: 0 1px 4px #141418; }
html[data-phase-theme] #atlas-main .remake-plates__images,
html[data-phase-theme] #atlas-main .remake-feature { background-color: #18181d; }
html[data-phase-theme] #atlas-main .remake-feature--wide::after,
html[data-phase-theme] #atlas-main .remake-feature--art::after {
  background: linear-gradient(transparent 25%,rgb(20 20 24 / .72) 65%,#141418);
}
html[data-phase-theme] #atlas-main .remake-return {
  background: var(--bg-paper); color: var(--text-primary); border-color: var(--border-hairline);
}
html[data-phase-theme] #atlas-main .edition-selector button[aria-pressed="true"] {
  color: var(--ruby-ink); background: var(--ruby-wash); border-color: var(--accent-ruby);
}
html[data-phase-theme] #atlas-main .atlas-plan-detail,
html[data-phase-theme] #atlas-main .z64-map,
html[data-phase-theme] #atlas-main .z64-map__directory {
  background: var(--bg-paper); color: var(--text-primary); border-color: var(--border-hairline);
}
html[data-phase-theme] #atlas-main .z64-map__header :is(p,h2),
html[data-phase-theme] #atlas-main .z64-map__directory :is(label,h3,strong,select) { color: var(--text-primary); }
html[data-phase-theme] #atlas-main .z64-map__directory select { background: var(--bg-paper); border-color: var(--border-hairline); }
html[data-phase-theme] #atlas-main .z64-map__directory :is(a,a>span) { color: var(--reading-link); }
html[data-phase-theme] #atlas-main .z64-map__directory small { color: var(--text-muted); }
html[data-phase-theme] #atlas-main .atlas-plan-detail :is(p,h3,summary,label) { color: var(--text-primary); }
html[data-phase-theme] #atlas-main .atlas-plan-detail small { color: var(--text-muted); }
html[data-phase-theme] #atlas-main .atlas-plan-detail a { color: var(--reading-link); }

/* The classic and remake preparation cards share the same typographic hierarchy. */
#pz-content[data-atlas-guide-layout] .z64-reader__sidebar .z64-sidebar-inner :is(h2,.z64-reward > span) {
  font: 650 1.05rem/1.4 var(--phase-sans);
  text-transform: none;
}
#pz-content[data-atlas-guide-layout] .z64-sidebar-inner > h2 {
  color: var(--text-primary); letter-spacing: -.025em;
}
#pz-content[data-atlas-guide-layout] :is(.s2-sidebar > h3,.z64-sidebar-inner .z64-reward > span) {
  color: var(--sheet-muted); letter-spacing: normal;
}
