:root {
  color-scheme: dark;
  --ink: #eee5d1;
  --muted: #b8ad9d;
  --gold: #e2bf63;
  --gold-bright: #f6dda0;
  --violet: #7650a6;
  --violet-deep: #26173c;
  --night: #100b1b;
  --panel: #191226;
  --panel-soft: #21172f;
  --line: rgba(226, 191, 99, .23);
  --shadow: 0 22px 70px rgba(0, 0, 0, .42);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 10%, rgba(111, 70, 157, .12), transparent 28rem),
    linear-gradient(180deg, #120c1e, #0d0916 55%, #120c1c);
  font-family: "Alegreya", Georgia, serif;
  font-size: 18px;
  line-height: 1.55;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .15;
  background-image: repeating-linear-gradient(0deg, transparent 0 3px, rgba(255,255,255,.015) 3px 4px);
  z-index: 10;
}
a { color: inherit; }
button, input, select { font: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 100; padding: .7rem 1rem; color: #140e20; background: var(--gold-bright); }
.skip-link:focus { top: 1rem; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 78px;
  padding: .75rem clamp(1rem, 4vw, 4.5rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: rgba(14, 9, 23, .9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: .8rem; text-decoration: none; font: 600 clamp(.78rem, 1.4vw, 1rem)/1.25 "Cinzel", serif; letter-spacing: .04em; }
.brand small { display: block; margin-bottom: .22rem; color: var(--gold); font: .46rem/1 "Press Start 2P", monospace; letter-spacing: .09em; }
.brand-mark { display: grid; place-items: center; width: 45px; height: 45px; color: var(--gold-bright); border: 1px solid var(--gold); transform: rotate(45deg); background: linear-gradient(135deg, #3e275a, #1b102c); box-shadow: inset 0 0 0 3px rgba(14,9,23,.8), 0 0 22px rgba(124,78,167,.25); font: 700 1.15rem "Cinzel", serif; }
.brand-mark::first-letter { transform: rotate(-45deg); }
.brand-mark { text-shadow: 0 0 10px #fff0b4; }
.header-actions { display: flex; align-items: center; gap: .35rem; font: 600 .78rem "Cinzel", serif; letter-spacing: .05em; }
.header-actions a { padding: .65rem .85rem; color: #cfc4b4; text-decoration: none; }
.header-actions a:hover { color: var(--gold-bright); }
.header-actions .play-link { color: #180f25; background: var(--gold); border: 1px solid var(--gold-bright); }

.wiki-nav { position: sticky; top: 78px; z-index: 19; display: flex; gap: .15rem; padding: .55rem clamp(1rem, 4vw, 4.5rem); overflow-x: auto; background: rgba(16, 10, 25, .96); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); scrollbar-width: thin; }
.wiki-nav a { flex: 0 0 auto; padding: .5rem .85rem; color: #cfc4b4; text-decoration: none; font: 600 .7rem "Cinzel", serif; letter-spacing: .05em; white-space: nowrap; border: 1px solid transparent; }
.wiki-nav a:hover { color: var(--gold-bright); }
.wiki-nav a.active { color: #180f25; background: var(--gold); border-color: var(--gold-bright); }

.breadcrumb { width: min(1480px, calc(100% - 2.4rem)); margin: 1.3rem auto 0; color: var(--muted); font-size: .8rem; }
.breadcrumb a { color: var(--gold); text-decoration: none; }
.breadcrumb a:hover { color: var(--gold-bright); }
.breadcrumb span[aria-hidden] { margin: 0 .45rem; color: #776a86; }
.breadcrumb span[aria-current] { color: var(--ink); }

.back-button { display: inline-flex; align-items: center; gap: .5rem; margin: 1.3rem 0; padding: .65rem 1.05rem; color: var(--gold-bright); background: #201531; border: 1px solid rgba(226, 191, 99, .45); text-decoration: none; font: 600 .76rem "Cinzel", serif; letter-spacing: .04em; cursor: pointer; }
.back-button:hover { border-color: var(--gold-bright); background: #2a1b3f; }

.category-hero { width: min(1480px, calc(100% - 2.4rem)); margin: 1.4rem auto 0; padding: clamp(1.6rem, 4vw, 2.8rem); display: flex; align-items: center; gap: 1.6rem; background: linear-gradient(145deg, #1d142b, #171020); border: 1px solid var(--line); }
.category-hero .category-icon { width: 64px; height: 64px; flex: 0 0 auto; font-size: 1.6rem; }
.category-hero h1 { margin: 0 0 .4rem; font-size: clamp(1.6rem, 4vw, 2.6rem); }
.category-hero p { margin: 0; color: var(--muted); }
.category-hero small { display: block; margin-top: .5rem; color: var(--gold); font: .66rem "Cinzel", serif; letter-spacing: .1em; text-transform: uppercase; }

.category-intro { width: min(1480px, calc(100% - 2.4rem)); margin: 1.4rem auto 0; padding: clamp(1.4rem, 3vw, 2rem); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.2rem; background: linear-gradient(110deg, rgba(44,27,63,.96), rgba(24,16,34,.98)); border: 1px solid var(--line); }
.category-intro p { margin: 0; width: min(760px, 100%); color: #d4c9ba; }
.category-intro .play-cta { flex: 0 0 auto; padding: .85rem 1.2rem; color: #171020; background: var(--gold-bright); border: 1px solid #fff0bf; text-decoration: none; font: 600 .75rem "Cinzel", serif; letter-spacing: .04em; white-space: nowrap; }

.entry-group-section { width: min(1480px, calc(100% - 2.4rem)); margin: 0 auto 3.5rem; }
.entry-group-section h2 { margin: 0 0 1.2rem; color: var(--gold-bright); font-size: 1.25rem; border-bottom: 1px solid var(--line); padding-bottom: .6rem; }

.fiche-main { width: min(1100px, calc(100% - 2.4rem)); margin: 0 auto 6rem; }
.fiche-card { background: #171020; border: 1px solid rgba(226, 191, 99, .35); box-shadow: var(--shadow); overflow: hidden; }

.search-results { width: min(650px, 100%); margin-top: .5rem; color: var(--ink); background: rgba(18, 11, 31, .96); border: 1px solid rgba(246, 221, 160, .4); box-shadow: var(--shadow); }
.search-results a { display: block; padding: .7rem .9rem; text-decoration: none; border-bottom: 1px solid var(--line); }
.search-results a:last-child { border-bottom: 0; }
.search-results a:hover, .search-results a:focus { background: #241632; }
.search-results .result-group { color: var(--gold); font: .62rem "Cinzel", serif; letter-spacing: .08em; text-transform: uppercase; }
.search-results .result-name { display: block; margin-top: .15rem; font: 600 .95rem "Cinzel", serif; }
.search-results .result-empty { padding: .9rem; color: var(--muted); font-size: .85rem; }

main { overflow: hidden; }
.hero { position: relative; min-height: min(720px, 82vh); display: grid; align-items: center; padding: 5.5rem clamp(1.2rem, 7vw, 8rem) 6rem; isolation: isolate; }
.hero-art { position: absolute; z-index: -2; inset: 0; background: url('/assets/accueil-chateau-v3.webp') center 35% / cover no-repeat; filter: saturate(.82) brightness(.58); transform: scale(1.01); }
.hero::before { content: ""; position: absolute; z-index: -1; inset: 0; background: linear-gradient(90deg, rgba(11,7,19,.97) 0%, rgba(12,8,21,.85) 37%, rgba(12,8,21,.28) 72%), linear-gradient(0deg, #100b1b 0%, transparent 42%); }
.hero-copy { width: min(720px, 100%); }
.eyebrow { margin: 0 0 .7rem; color: var(--gold); font: 600 .69rem/1.5 "Cinzel", serif; letter-spacing: .2em; text-transform: uppercase; }
h1, h2, h3 { font-family: "Cinzel", serif; }
h1 { margin: 0; font-size: clamp(2.6rem, 7vw, 6.4rem); font-weight: 600; line-height: .98; letter-spacing: -.035em; text-wrap: balance; text-shadow: 0 8px 28px rgba(0,0,0,.65); }
h1 em { color: var(--gold-bright); font-weight: 500; font-style: normal; }
.hero-intro { width: min(620px, 100%); margin: 1.5rem 0 1.8rem; color: #d4c9ba; font-size: clamp(1.06rem, 2vw, 1.3rem); }
.search { width: min(650px, 100%); min-height: 60px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .85rem; padding: .2rem 1rem; color: var(--gold); background: rgba(18,11,31,.88); border: 1px solid rgba(246,221,160,.45); box-shadow: 0 16px 50px rgba(0,0,0,.42), inset 0 0 0 3px rgba(95,59,132,.17); }
.search > span { font-size: 1.55rem; transform: translateY(-2px); }
.search input { width: 100%; height: 56px; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 1rem; }
.search input::placeholder { color: #9f958a; }
kbd { padding: .25rem .42rem; color: #bfb4a6; background: #241830; border: 1px solid #554264; border-radius: 3px; font: .7rem monospace; }
.hero-stats { display: flex; flex-wrap: wrap; gap: .8rem 1.8rem; margin-top: 1.5rem; color: #bdb1a2; font-size: .88rem; }
.hero-stats strong { margin-right: .3rem; color: var(--gold-bright); font: 600 1.05rem "Cinzel", serif; }

.category-section, .codex { width: min(1480px, calc(100% - 2.4rem)); margin-inline: auto; padding: 6rem 0; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 2rem; margin-bottom: 2.3rem; }
.section-heading h2, .codex-toolbar h2, .history-banner h2 { margin: 0; font-size: clamp(1.8rem, 4vw, 3.4rem); font-weight: 600; line-height: 1.1; }
.section-heading > p { width: min(430px, 100%); margin: 0; color: var(--muted); }
.category-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; padding: 1px; background: var(--line); }
.category-card { position: relative; min-height: 215px; padding: 1.5rem; display: flex; flex-direction: column; align-items: flex-start; text-align: left; color: var(--ink); text-decoration: none; background: linear-gradient(145deg, #1d142b, #171020); border: 0; cursor: pointer; overflow: hidden; }
.category-card:hover { z-index: 1; background: linear-gradient(145deg, #2b1b3f, #1b1228); box-shadow: inset 0 0 0 1px var(--gold); }
.category-icon { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 1.2rem; color: var(--gold-bright); border: 1px solid rgba(226,191,99,.5); background: #251735; font: 1.15rem "Cinzel", serif; }
.category-card strong { font: 600 1.08rem "Cinzel", serif; }
.category-card p { margin: .45rem 0 1rem; color: var(--muted); font-size: .88rem; line-height: 1.4; }
.category-card small { margin-top: auto; color: var(--gold); font: .67rem "Cinzel", serif; letter-spacing: .08em; text-transform: uppercase; }

.realm-map-section { width: min(1480px, calc(100% - 2.4rem)); margin: 0 auto 6rem; }
.realm-map-copy { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 520px); align-items: end; gap: 1rem 3rem; margin-bottom: 1.5rem; }
.realm-map-copy .eyebrow { grid-column: 1 / -1; margin-bottom: -.2rem; }
.realm-map-copy h2 { margin: 0; font-size: clamp(1.8rem, 4vw, 3.4rem); font-weight: 600; line-height: 1.1; }
.realm-map-copy > p:last-child { margin: 0; color: var(--muted); }
.realm-map-card { width: 50%; margin: 0 auto; padding: 0; display: block; color: var(--ink); background: #171020; border: 1px solid rgba(226,191,99,.45); cursor: zoom-in; box-shadow: var(--shadow); overflow: hidden; }
.realm-map-stage { position: relative; display: block; width: 100%; aspect-ratio: 16 / 15; overflow: hidden; background: #8b6a3e; }
.realm-map-stage img { position: absolute; display: block; max-width: none; pointer-events: none; }
.realm-map-base { inset: 0; width: 100%; height: 100%; object-fit: fill; }
.realm-map-rift { left: 65.625%; top: 22%; width: 37.5%; height: 20%; object-fit: fill; transform: translate(-50%, -50%) rotate(17.76deg); transform-origin: center; }
.realm-map-hint { min-height: 54px; padding: .8rem 1rem; display: flex; align-items: center; justify-content: center; gap: .55rem; color: var(--gold-bright); background: linear-gradient(90deg, #241632, #171020); font: 600 .68rem "Cinzel", serif; letter-spacing: .09em; text-transform: uppercase; }
.realm-map-card:hover, .realm-map-card:focus-visible { border-color: var(--gold-bright); outline: 0; }
.realm-map-card:hover .realm-map-hint { background: #2d1b3e; }
.realm-map-dialog { width: min(1280px, calc(100% - 2rem)); max-height: calc(100vh - 2rem); padding: 0; color: var(--ink); background: #120c1d; border: 1px solid rgba(226,191,99,.65); box-shadow: 0 30px 100px rgba(0,0,0,.8); overflow: hidden; }
.realm-map-dialog::backdrop { background: rgba(6,4,10,.9); backdrop-filter: blur(6px); }
.realm-map-dialog-head { min-height: 82px; padding: 1rem 1.2rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--line); }
.realm-map-dialog-head .eyebrow { margin-bottom: .15rem; }
.realm-map-dialog-head h2 { margin: 0; font-size: clamp(1.2rem, 3vw, 2rem); }
.realm-map-close { flex: 0 0 auto; width: 44px; height: 44px; color: var(--gold-bright); background: #241632; border: 1px solid rgba(226,191,99,.55); cursor: pointer; font-size: 1.6rem; }
.realm-map-scroll { max-height: calc(100vh - 116px); padding: 1rem; overflow: auto; }
.realm-map-stage-large { width: 100%; min-width: 850px; border: 1px solid rgba(226,191,99,.3); }

.codex { padding-top: 2rem; }
.codex-toolbar { padding: 2rem 0 1.4rem; display: flex; align-items: end; justify-content: space-between; gap: 2rem; border-top: 1px solid var(--line); }
.codex-toolbar h2 { font-size: clamp(1.8rem, 3vw, 2.8rem); }
#results-description { margin: .55rem 0 0; color: var(--muted); }
.filter-wrap { min-width: 230px; }
.filter-wrap label { display: block; margin-bottom: .4rem; color: var(--gold); font: .62rem "Cinzel", serif; letter-spacing: .12em; text-transform: uppercase; }
.filter-wrap select { width: 100%; padding: .75rem 2.3rem .75rem .8rem; color: var(--ink); background: #1c1327; border: 1px solid #51405e; border-radius: 0; }
.active-filter { margin-bottom: 1rem; color: var(--gold-bright); font: .78rem "Cinzel", serif; }
.entry-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.entry-card { min-width: 0; display: flex; flex-direction: column; color: var(--ink); text-decoration: none; background: linear-gradient(180deg, rgba(34,24,47,.98), rgba(22,15,31,.98)); border: 1px solid rgba(226,191,99,.16); cursor: pointer; box-shadow: 0 12px 32px rgba(0,0,0,.18); transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; overflow: hidden; }
.entry-card:hover { transform: translateY(-5px); border-color: rgba(226,191,99,.65); box-shadow: var(--shadow); }
.entry-visual { position: relative; height: 190px; display: grid; place-items: center; background: radial-gradient(circle, #352349, #171020 70%); overflow: hidden; }
.entry-visual::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 -35px 35px rgba(14,9,23,.28); pointer-events: none; }
.entry-visual img { width: 100%; height: 100%; align-self: stretch; justify-self: stretch; object-fit: contain; }
.entry-card[data-category="lieux"] .entry-visual img { object-fit: cover; filter: saturate(.83) contrast(1.04); }
.entry-card[data-category="sorts"] .entry-visual img, .entry-card[data-category="objets"] .entry-visual img { width: 72%; height: 72%; filter: drop-shadow(0 10px 18px rgba(0,0,0,.55)); }
.entry-card[data-category="equipement"] .entry-visual img { width: 86%; height: 86%; filter: drop-shadow(0 12px 20px rgba(0,0,0,.62)); }
.sprite-preview { height: 92%; max-width: 88%; aspect-ratio: var(--sprite-ratio, 4 / 7); background-image: var(--sprite-image); background-repeat: no-repeat; background-size: var(--sprite-size-x) var(--sprite-size-y); background-position: var(--sprite-x) var(--sprite-y); filter: drop-shadow(0 12px 18px rgba(0,0,0,.6)); }
.entry-symbol { position: relative; z-index: 1; display: grid; place-items: center; width: 88px; height: 88px; color: var(--gold-bright); border: 1px solid rgba(226,191,99,.48); transform: rotate(45deg); background: linear-gradient(135deg, #35214b, #21142f); box-shadow: 0 16px 30px rgba(0,0,0,.35), inset 0 0 0 5px rgba(12,8,20,.5); font: 2rem "Cinzel", serif; }
.entry-symbol span { transform: rotate(-45deg); }
.entry-copy { flex: 1; padding: 1.15rem 1.15rem 1.25rem; display: flex; flex-direction: column; }
.entry-group { color: var(--gold); font: .58rem "Cinzel", serif; letter-spacing: .13em; text-transform: uppercase; }
.entry-card h3 { margin: .45rem 0 .5rem; font-size: 1.02rem; line-height: 1.25; }
.entry-card p { margin: 0; display: -webkit-box; overflow: hidden; color: var(--muted); font-size: .9rem; line-height: 1.42; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.entry-more { margin-top: auto; padding-top: 1rem; color: #cdbb91; font: .62rem "Cinzel", serif; letter-spacing: .08em; text-transform: uppercase; }
.empty-state { padding: 5rem 1rem; text-align: center; color: var(--muted); border: 1px solid var(--line); }
.empty-state > span { color: var(--gold); font-size: 3rem; }
.empty-state h3 { color: var(--ink); }
.empty-state button { padding: .7rem 1rem; color: #160f21; background: var(--gold); border: 0; cursor: pointer; }

.history-banner { width: min(1480px, calc(100% - 2.4rem)); margin: 1rem auto 7rem; padding: clamp(2rem, 5vw, 4.5rem); display: flex; justify-content: space-between; align-items: center; gap: 3rem; background: linear-gradient(110deg, rgba(44,27,63,.96), rgba(24,16,34,.98)), url('/assets/academy-hall-v3-ground.webp') center / cover; border: 1px solid var(--line); box-shadow: var(--shadow); }
.history-banner > div { width: min(760px, 100%); }
.history-banner p:last-child { color: #c6baaa; }
.history-banner > a { flex: 0 0 auto; padding: 1rem 1.3rem; color: #171020; background: var(--gold-bright); border: 1px solid #fff0bf; text-decoration: none; font: 600 .75rem "Cinzel", serif; }

footer { min-height: 190px; padding: 3rem clamp(1.2rem, 6vw, 7rem); display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .5rem 2rem; color: #9e9386; background: #0a0710; border-top: 1px solid var(--line); }
.footer-brand { color: var(--gold); text-decoration: none; font: 600 1.1rem "Cinzel", serif; }
footer p { margin: 0; }
footer > div { grid-row: 1 / 3; grid-column: 2; display: flex; gap: 1.2rem; }
footer > div a { color: #bdb2a5; text-decoration: none; }

.entry-dialog { width: min(900px, calc(100% - 2rem)); max-height: min(860px, calc(100vh - 2rem)); padding: 0; color: var(--ink); background: #171020; border: 1px solid rgba(226,191,99,.55); box-shadow: 0 30px 100px rgba(0,0,0,.75); overflow: auto; }
.entry-dialog::backdrop { background: rgba(6,4,10,.84); backdrop-filter: blur(6px); }
.dialog-close { position: sticky; top: .8rem; z-index: 3; float: right; width: 42px; height: 42px; margin: .8rem .8rem -3.4rem 0; color: var(--gold-bright); background: rgba(19,12,29,.9); border: 1px solid rgba(226,191,99,.5); cursor: pointer; font-size: 1.5rem; }
.dialog-hero { min-height: 310px; display: grid; grid-template-columns: minmax(230px, .85fr) 1.3fr; background: linear-gradient(135deg, #281a38, #15101e); }
.dialog-visual { min-height: 310px; display: grid; place-items: center; background: radial-gradient(circle, #3c2852, #171020 72%); overflow: hidden; }
.dialog-visual img { width: 100%; height: 100%; align-self: stretch; justify-self: stretch; object-fit: contain; }
.dialog-visual .sprite-preview { height: 92%; max-width: 86%; }
.dialog-visual.location img { object-fit: cover; }
.dialog-visual .entry-symbol { width: 120px; height: 120px; font-size: 2.8rem; }
.dialog-title { align-self: end; padding: 2.2rem; }
.dialog-title h2 { margin: .35rem 0 .9rem; font-size: clamp(1.8rem, 4vw, 3rem); line-height: 1.08; }
.dialog-title p { margin: 0; color: #c4b9aa; font-size: 1.05rem; }
.dialog-body { padding: 2rem 2.2rem 2.5rem; }
.facts { margin: 0 0 2rem; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); }
.fact { min-height: 78px; padding: .9rem; background: #21162e; }
.fact dt { color: #9e9386; font: .58rem "Cinzel", serif; letter-spacing: .1em; text-transform: uppercase; }
.fact dd { margin: .35rem 0 0; color: var(--gold-bright); font: 600 .9rem "Cinzel", serif; }
.lore-block { position: relative; padding: 1.5rem 1.5rem 1.5rem 2.2rem; color: #d4c8b8; background: rgba(226,191,99,.055); border-left: 2px solid var(--gold); }
.lore-block::before { content: "“"; position: absolute; left: .55rem; top: .1rem; color: rgba(226,191,99,.35); font: 3rem Georgia, serif; }
.lore-block h3 { margin: 0 0 .5rem; color: var(--gold); font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; }
.lore-block p { margin: 0; }

@media (max-width: 1100px) {
  .category-grid, .entry-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .site-header { min-height: 66px; }
  .brand { font-size: .68rem; }
  .brand-mark { width: 36px; height: 36px; }
  .header-actions > a:first-child { display: none; }
  .wiki-nav { top: 66px; padding: .5rem clamp(1rem, 4vw, 2rem); }
  .category-hero { flex-direction: column; align-items: flex-start; text-align: left; }
  .hero { min-height: 690px; padding-top: 4rem; align-items: end; }
  .hero-art { background-image: url('/assets/accueil-chateau-v3-mobile.webp'); }
  .hero::before { background: linear-gradient(0deg, #100b1b 0%, rgba(12,8,21,.82) 64%, rgba(12,8,21,.28)); }
  .section-heading, .codex-toolbar, .history-banner { align-items: flex-start; flex-direction: column; }
  .realm-map-copy { grid-template-columns: 1fr; }
  .realm-map-card { width: 100%; }
  .realm-map-copy .eyebrow { grid-column: auto; }
  .category-grid, .entry-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-wrap { width: 100%; }
  .dialog-hero { grid-template-columns: 1fr; }
  .dialog-visual { min-height: 260px; max-height: 340px; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  footer { grid-template-columns: 1fr; }
  footer > div { grid-row: auto; grid-column: auto; flex-wrap: wrap; }
}
@media (max-width: 480px) {
  body { font-size: 17px; }
  .brand span:last-child { max-width: 180px; }
  .brand small { display: none; }
  .hero { padding-inline: 1rem; }
  h1 { font-size: 2.55rem; }
  .search { padding-inline: .7rem; }
  .search kbd { display: none; }
  .category-section, .codex, .history-banner, .realm-map-section { width: min(100% - 1.2rem, 1480px); }
  .category-grid, .entry-grid { grid-template-columns: 1fr; }
  .category-card { min-height: 185px; }
  .entry-visual { height: 220px; }
  .facts { grid-template-columns: 1fr; }
  .dialog-title, .dialog-body { padding-inline: 1.25rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}
