/* zRedemption field guide: ink, old-paper highlights, brass and client artwork. */
:root {
  --ref-bg: #10191e;
  --ref-panel: #19272b;
  --ref-line: #385055;
  --ref-ink: #edf0e9;
  --ref-muted: #b6c3be;
  --ref-accent: #d7ae72;
  --ref-teal: #9dc9bc;
}
body:has(.wiki-home, .reference-content) {
  background:
    radial-gradient(800px 430px at 15% -100px, #263b3a5e, transparent 75%),
    linear-gradient(90deg, transparent calc(50% - 660px), #cda86d0b calc(50% - 659px), #cda86d0b calc(50% - 658px), transparent calc(50% - 657px)),
    #10191e;
}
body:has(.wiki-home, .reference-content) .topbar {
  background: #111d21f7;
  border-bottom: 1px solid #536257;
  box-shadow: 0 8px 35px #06121680;
}
.topbar-inner { max-width: 1320px; min-height: 74px; gap: clamp(1rem, 2.4vw, 2.3rem); }
.brand-mark {
  width: 56px; height: 56px; border: 0; border-radius: 50%;
  background: none; box-shadow: 0 2px 9px #0008;
}
.brand-mark img { display: block; width: 100%; height: 100%; object-fit: contain; }
.brand-text { color: #f3eadb; font-size: 19px; line-height: 1.15; }
.brand-text small { margin-top: 3px; color: #c2b79d; font-size: 10px; }
.nav a { font-weight: 600; color: #d5d9ce; border-bottom-width: 1px; }
.nav a.active { color: #f2d5a4; border-bottom-color: #e9c18a; }
.nav-search input { min-height: 39px; border-radius: 3px; }
.content { max-width: 1240px; padding-top: 36px; }
.reference-kicker, .eyebrow { color: #a7d6c3; letter-spacing: .14em; }
.wiki-masthead { min-height: clamp(390px, 36vw, 495px); border-radius: 3px; border-color: #6b7969; box-shadow: 0 25px 60px #03101475; }
.wiki-masthead::before { background: linear-gradient(90deg, #102126f5 0%, #102126c7 35%, #1021261a 72%), linear-gradient(0deg,#0d1d23c9,transparent 58%), url('/static/art/observatory.webp') center right / cover no-repeat; }
.wiki-masthead h1 { font-size: clamp(3.2rem, 7vw, 6.5rem); line-height: .94; }
.wiki-masthead p { max-width: 31rem; color: #e0e5da; }
.reference-button { border-radius: 3px; background: #e5bf89; border-color: #e5bf89; color: #192125; }
.reference-button.secondary { border-color: #c4c6b6; border-radius: 3px; background: #182b2cca; }
.wiki-home .wiki-masthead + .section { margin-top: 2.2rem; }
.section-head { margin-bottom: 1.15rem; padding-bottom: .48rem; border-bottom: 1px solid #586258; }
.section-head h2, .reference-section-title h2 { color: #f0e2cd; font-size: clamp(1.7rem, 2.3vw, 2.2rem); font-weight: 400; }
.section-head .more, .reference-section-title a { color: #a7d6c3; }
.wiki-home .icon-grid { grid-template-columns: repeat(4,minmax(0,1fr)); gap: .75rem; }
.wiki-home .icon-card { padding: 1.15rem .8rem 1rem; border: 1px solid #40565a; border-top-color: #9e865e; border-radius: 2px; background: linear-gradient(160deg,#203337,#17272b); }
.wiki-home .icon-card:hover { border-color: #d3b480; background: #294044; }
.wiki-home .icon-card img { width: 86px; height: 86px; object-fit: contain; border-radius: 2px; background: radial-gradient(circle,#3c5650,#17292a 70%); }
.wiki-home .icon-card .icon-name { color: #f1e8d9 !important; font: normal 1.08rem/1.26 Georgia,serif; }
.wiki-home .icon-card .icon-sub { color: #bec9c0; }
.wiki-home .icon-card .rank-badge { border-radius: 2px; }

/* Catalog entries use a compact illustrated index instead of tiny boxed tiles. */
.catalog-content .icon-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 1.1rem; border-top: 1px solid #40565a; }
.catalog-content .icon-card {
  display: grid; grid-template-columns: 90px minmax(0,1fr); grid-template-rows: repeat(4,auto);
  align-content: center; column-gap: .85rem; row-gap: .1rem; min-height: 122px;
  padding: .8rem .35rem; text-align: left; align-items: center;
  background: transparent; border: 0; border-bottom: 1px solid #34494d; border-radius: 0;
  transition: background .15s, padding-left .15s;
}
.catalog-content .icon-card:hover { transform: none; padding-left: .7rem; background: #233437; }
.catalog-content .icon-card img { grid-column: 1; grid-row: 1 / 5; width: 86px; height: 86px; object-fit: contain; border-radius: 4px; background: radial-gradient(circle,#405451 0%,#1d3033 70%); }
.catalog-content .icon-card .rank-badge { grid-column: 2; justify-self: start; margin: 0; padding: 1px 8px; border-radius: 2px; font-size: .64rem; }
.catalog-content .icon-card .icon-name { grid-column: 2; color: #f4eddd !important; font: normal 1.17rem/1.2 Georgia,serif; overflow-wrap: anywhere; }
.catalog-content .icon-card .icon-sub { grid-column: 2; font-size: .79rem; color: #b9c9c4; }
.catalog-content .icon-card .icon-sub.dim { color: #9faeab; }
.catalog-content .page-head { padding: .35rem 0 1.3rem; margin-bottom: 1.25rem; border-bottom: 1px solid #536258; }
.catalog-content .page-head h1 { color: #f3e7d2; }
.catalog-content .page-head p { color: #c5d0ca; }
.catalog-content .filters { padding: .55rem 0; gap: .55rem; }
.catalog-content .filters input, .catalog-content .filters select { min-height: 39px; border-radius: 3px; background: #15252a; border-color: #506165; }
.catalog-content .filters button { min-height: 39px; border-radius: 3px; background: #d5ad76; color: #182226; }
.catalog-content .result-count { margin-top: .5rem; color: #a7c7bc; }

/* The bestiary profile is a portrait and facts, with no empty stretched card. */
.monster-detail { align-items: start; grid-template-columns: 1fr; gap: 1rem; }
.catalog-content .monster-main { align-self: start; min-height: 245px; padding: clamp(1.2rem,2.4vw,2rem); background: linear-gradient(125deg,#24383b,#17282c); border: 1px solid #546a65; border-radius: 3px; }
.catalog-content .monster-info h1 { color: #f4e9d8 !important; font-size: clamp(2.1rem,3.8vw,3.5rem); line-height: 1.02; }
.catalog-content .portrait { display: flex; flex-direction: column; align-items: center; width: 156px; }
.catalog-content .portrait img { width: 148px; height: 148px; object-fit: contain; background: radial-gradient(circle,#425b51,#172c2d 72%); border: 1px solid #65766b; border-radius: 3px; }
.catalog-content .portrait .rarity-ribbon { position: static; transform: none; margin-top: .35rem; border-radius: 2px; }
.catalog-content .portrait-source { width: 100%; margin-top: .55rem; text-align: center; color: #c9d6cb; font-size: .74rem; }
.catalog-content .quick-facts { margin-top: 1rem; }
.catalog-content .chip { border-radius: 2px; background: #152528; border-color: #52635b; color: #e1ded1; }
.catalog-content .stat-panel { border-radius: 3px; border-color: #688176; background: linear-gradient(130deg,#203638,#192c30); color: #ecf1e7; }
.catalog-content .stat-panel h2 { color: #f2e7d5; font: normal 1.45rem Georgia,serif; }
.catalog-content .stat-panel .reference-note { color: #c5d3c8; }
.catalog-content .stat-panel .stat-table td { color: #e8eee5; border-color: #526a62; }
.catalog-content .stat-panel .stat-table b { color: #f0e9db; }
.catalog-content .stat-panel .stat-table td:first-child { color: #c2d2c7; }
.catalog-content .stat-panel .stat-table { display: block; width: 100%; }
.catalog-content .stat-panel .stat-table tbody { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 2.5rem; }
.catalog-content .stat-panel .stat-table tr { display: flex; justify-content: space-between; gap: 1.2rem; min-width: 0; border-bottom: 1px solid #526a62; }
.catalog-content .stat-panel .stat-table td { min-width: 0; overflow-wrap: anywhere; border: 0; }
.catalog-content .stat-panel .stat-table td:last-child { text-align: right; }
.catalog-content .stat-panel .stat-rank { display: inline-flex; align-items: center; gap: .45rem; color: #f0e9db; }
.catalog-content .stat-panel .stat-rank::before { content: ""; width: .65rem; height: .65rem; flex: none; border: 1px solid #d5dacd; border-radius: 50%; background: var(--rank); }

/* Map imagery is the atlas index; area names stay readable beside it. */
.atlas-directory-grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 0 1.2rem; border-top: 1px solid #43575b; }
.atlas-area-card { min-height: 115px; padding: .75rem .3rem; border: 0; border-bottom: 1px solid #34494d; border-radius: 0; background: transparent; gap: .95rem; }
.atlas-area-card:hover, .atlas-area-card:focus-visible { background: #24383b; border-color: #b6a075; }
.atlas-area-image { flex-basis: 95px; width: 95px; height: 88px; border-color: #827658; border-radius: 2px; }
.atlas-area-info { gap: .25rem; }
.atlas-area-info strong { color: #f5ead7; font: normal 1.18rem/1.16 Georgia,serif; }
.atlas-area-info > span { color: #c1d0c9; font-size: .78rem; }
.atlas-area-info small { color: #a9cdb6; font-size: .75rem; }
.atlas-region-list, .spawn-records { border-radius: 2px; }
.spawn-map-section { border-radius: 3px; border-color: #586860; background: linear-gradient(145deg,#17272b,#142126); }
.spawn-map-canvas { border-radius: 2px; border-color: #9a8b68; }
.spawn-map-controls { border-radius: 2px; }
.spawn-map-inspector, .spawn-map-placement { border-radius: 2px; }
.spawn-map-detail-head img { width: 58px; height: 58px; object-fit: contain; background: #2a403e; border: 1px solid #768278; }
.spawn-map-key { padding-top: .35rem; border-top: 1px solid #4b625d; }
.spawn-map-icon-frame { fill: #102124f0; stroke: color-mix(in srgb, var(--marker-color) 38%, #607c73); stroke-width: 1.15; filter: drop-shadow(0 1px 2px #071219a6); }
.spawn-map-marker:hover .spawn-map-icon-frame, .spawn-map-marker.is-selected .spawn-map-icon-frame { stroke-width: 2; }
.footer { border-top: 1px solid #596659 !important; }

/* Questbook, item and loot pages share the atlas' editorial hierarchy. */
.field-index { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); margin: 1.15rem 0 2.8rem; border-block: 1px solid #59695d; }
.field-index a { display: grid; gap: .12rem; padding: 1rem 1.15rem; border-right: 1px solid #354c4d; color: #f0e5d3; }
.field-index a:last-child { border-right: 0; }
.field-index a:hover { background: #24383a; }
.field-index strong { font: normal 1.25rem Georgia,serif; }
.field-index span { color: #b4c9bd; font-size: .79rem; }
.player-reference .page-head { padding: .3rem 0 1.3rem; margin-bottom: 1.25rem; border-bottom: 1px solid #59695d; }
.player-reference .page-head h1, .item-page-heading h1 { margin: .25rem 0; color: #f2e4cd; font: normal clamp(2.5rem,5vw,4.2rem)/1.05 Georgia,serif; }
.player-reference .page-head p, .item-page-heading p { margin: .3rem 0 0; color: #bbc9c1; }
.player-reference .page-head a { color: #a7d6c3; font-weight: 650; }
.player-reference .filters { display: flex; flex-wrap: wrap; align-items: end; gap: .55rem; margin-bottom: 1rem; }
.player-reference .filters input, .player-reference .filters select { min-height: 40px; padding: .48rem .65rem; border: 1px solid #52676a; border-radius: 2px; background: #16282b; color: #edf0e9; }
.player-reference .filters button { min-height: 40px; padding: .48rem .85rem; border: 1px solid #d5ad76; border-radius: 2px; background: #d5ad76; color: #172326; font-weight: 700; }
.player-reference .result-count { margin-bottom: .65rem; color: #a7c7bc; }
.quest-directory { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 2rem; border-top: 1px solid #42595a; }
.quest-directory-entry { display: grid; grid-template-columns: 72px minmax(0,1fr); align-content: center; align-items: start; gap: .15rem 1rem; min-height: 96px; padding: 1rem .25rem; border-bottom: 1px solid #344d50; color: #f1e7d8; }
.quest-directory-entry:hover { background: #223539; }
.quest-level { grid-row: span 2; display: inline-block; padding: .25rem .4rem; border-left: 2px solid #d3ae79; color: #e7c796; white-space: nowrap; font-size: .83rem; }
.quest-directory-entry h2, .quest-directory-entry h3 { margin: 0; color: #f3eadc; font: normal 1.24rem/1.2 Georgia,serif; }
.quest-directory-entry p { margin: .4rem 0 0; color: #b6c8c0; font-size: .86rem; }
.quest-directory-entry > span:not(.quest-level) { grid-column: 2; color: #d4bd90; font-size: .75rem; }
.quest-detail-layout { display: grid; grid-template-columns: minmax(0,1fr) 300px; align-items: start; gap: 2.5rem; }
.quest-detail-layout .reference-section { margin: 1.7rem 0 2.5rem; }
.quest-detail-layout .reference-section h2, .player-reference .reference-section > h2 { margin: 0 0 1rem; padding-bottom: .45rem; border-bottom: 1px solid #59695d; color: #f0e2cd; font: normal 2rem/1.2 Georgia,serif; }
.quest-goal { margin: 1rem 0 1.7rem; max-width: 68ch; padding: .8rem 1.1rem; border-left: 3px solid #d2ae7b; background: #203439; color: #e5e9dd; font-size: 1.05rem; }
.quest-objectives { margin: 0; padding-left: 2.2rem; }
.quest-objectives > li { padding: .4rem 0 1.3rem .6rem; border-bottom: 1px solid #33494b; }
.quest-objectives > li::marker { color: #d8b381; font: normal 1.35rem Georgia,serif; }
.quest-objectives h3 { margin: .15rem 0 .65rem; color: #eee8d8; font: normal 1.25rem Georgia,serif; }
.item-reference { display: inline-flex; align-items: center; gap: .55rem; padding: .35rem .55rem; border: 1px solid #526460; border-radius: 2px; background: #1c3032; color: #e9dac4; font-weight: 600; }
.item-reference:hover { border-color: #bba06f; background: #294041; }
.item-reference img { width: 36px; height: 36px; object-fit: contain; }
.item-reference small { color: #a9cab8; }
.quest-drop-sources { margin: .6rem 0 0; padding-left: 1rem; color: #c1d0c8; }
.quest-drop-sources li { display: flex; flex-wrap: wrap; gap: .3rem .65rem; margin: .35rem 0; }
.quest-drop-sources strong { margin-left: auto; color: #e9c794; }
.quest-exp { margin: .2rem 0 1rem; color: #edcc91; font: normal 1.5rem Georgia,serif; }
.quest-rewards { display: flex; flex-wrap: wrap; gap: .55rem; }
.quest-aside { display: grid; gap: .8rem; }
.quest-aside section { display: grid; gap: .35rem; padding: 1rem; border: 1px solid #ab9b7a; background: #ded0b3; color: #263337; }
.quest-aside h2 { margin: 0 0 .35rem; color: #27353a; font: normal 1.45rem Georgia,serif; }
.quest-aside strong { font-size: 1.07rem; }
.quest-aside a { color: #315d60; font-weight: 600; }
.quest-aside .reference-evidence { margin: 0; }
.reference-notice { padding: .8rem 1rem; border-left: 3px solid #dbb26d; background: #3a3028; color: #f0dbc0; }
.reference-evidence { margin: 1rem 0; padding: .6rem .8rem; border: 1px solid #435b58; color: #b9c9bf; }
.reference-evidence summary { color: #acd0c0; cursor: pointer; }
.item-page-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 1.4rem; padding: 1.3rem 0 1.6rem; margin-bottom: 2rem; border-bottom: 1px solid #59695d; }
.item-page-heading > img { width: 100px; height: 100px; object-fit: contain; padding: .8rem; border: 1px solid #5b6b5c; background: #203538; }
.item-page-heading .reference-button { margin-left: auto; }
.monster-loot .loot-controls label { display: grid; gap: .2rem; color: #cbd9ce; font-size: .85rem; }
.loot-table-scroll { width: 100%; overflow-x: auto; border: 1px solid #435a58; }
.loot-table-scroll .data-table { min-width: 600px; margin: 0; }
.loot-table-scroll .data-table th { background: #24383a; }
.loot-table-scroll .data-table td { border-color: #3b5452; }
.loot-chance { color: #f0ce99; font-weight: 700; }
.loot-condition { display: block; color: #a9c5b7; font-size: .77rem; }

/* The model gallery belongs to the same field guide, with the viewer kept dark. */
.model-catalog-content .model-intro { max-width: 92ch; padding-bottom: 1.3rem; border-bottom: 1px solid #59695d; }
.model-catalog-content .model-intro h1 { color: #f2e4cd; font: normal clamp(2.5rem,5vw,4.2rem)/1.04 Georgia,serif; }
.model-catalog-content .model-intro p { color: #c4d0c8; }
.model-catalog-content .model-search input, .model-catalog-content .model-search select { background: #16282b; border-color: #52676a; border-radius: 2px; }
.model-catalog-content .model-search button { background: #d5ad76; border-color: #d5ad76; border-radius: 2px; color: #172326; font-weight: 700; }
.model-catalog-content .model-grid { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 0 1rem; border-top: 1px solid #42595a; }
.model-catalog-content .model-card { padding: 1rem .3rem; border: 0; border-bottom: 1px solid #34494d; border-radius: 0; background: transparent; color: #f0e5d3; }
.model-catalog-content .model-card:hover { background: #223539; }
.model-catalog-content .model-card-icon { color: #d5ad76; font-size: 1rem; }
.model-catalog-content .model-card small { color: #bad0c2; }
.model-catalog-content .model-card code { color: #a7b9b1; }
.model-catalog-content .model-stage { border: 1px solid #62736c; border-radius: 2px; background: radial-gradient(circle,#355052,#111e24 70%); }
.model-catalog-content .model-details { padding: 1.25rem; border: 1px solid #536a64; background: #1d3033; }
.model-catalog-content .model-details h2 { color: #f0e5d3; font: normal 1.8rem Georgia,serif; }
.model-catalog-content .model-controls button { border-color: #a5bba9; border-radius: 2px; background: #203536; }

@media (max-width: 1050px) {
  .wiki-home .icon-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .catalog-content .icon-grid, .atlas-directory-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .monster-detail { grid-template-columns: 1fr; }
  .model-catalog-content .model-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 760px) {
  .topbar-inner { gap: .7rem; }
  .content { padding-top: 1.2rem; }
  .wiki-masthead { min-height: 420px; }
  .wiki-masthead h1 { font-size: clamp(3.5rem,12vw,5rem); }
  .monster-detail { grid-template-columns: 1fr; }
  .catalog-content .stat-panel .stat-table tbody { grid-template-columns: 1fr; }
  .catalog-content .monster-main { min-height: auto; }
  .quest-detail-layout { grid-template-columns: 1fr; }
  .model-catalog-content .model-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 600px) {
  .brand-mark { width: 46px; height: 46px; }
  .topbar-inner .nav { display: grid; width: 100%; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .1rem .35rem; }
  .topbar-inner .nav a { justify-self: stretch; text-align: center; font-size: .79rem; }
  .field-index { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .field-index a:nth-child(2) { border-right: 0; }
  .field-index a:nth-child(-n+2) { border-bottom: 1px solid #354c4d; }
  .wiki-home .icon-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .catalog-content .icon-grid, .atlas-directory-grid { grid-template-columns: 1fr; }
  .catalog-content .icon-card { min-height: 110px; grid-template-columns: 78px 1fr; }
  .catalog-content .icon-card img { width: 74px; height: 74px; }
  .atlas-area-card { flex-direction: row; align-items: center; }
  .atlas-area-image { flex-basis: 83px; width: 83px; height: 75px; }
  .atlas-area-info > span { display: block; }
  .wiki-masthead-copy { padding: 1.4rem; }
  .wiki-masthead h1 { font-size: 3.5rem; }
  .catalog-content .monster-main { flex-direction: column; }
  .catalog-content .portrait { width: 100%; align-items: flex-start; }
  .catalog-content .portrait-source { text-align: left; }
  .quest-directory { grid-template-columns: 1fr; }
  .item-page-heading .reference-button { margin-left: 0; }
  .model-catalog-content .model-grid { grid-template-columns: 1fr; }
}
