/* Compendium pages (/compendium, /classes, /classes/<id>, /races, … generated by tools/site/compendium.ts).
   Loaded after site.css on those pages only; same tokens, same pixel language (stepped borders, crisp art). */
.page-cx .page-hero { padding-bottom: var(--s5); }
.page-cx .page-hero h1 { margin-bottom: var(--s3); }
.cx-hero .section-lead { max-width: 46em; }
.crumbs { list-style: none; margin: 0 0 var(--s3); padding: 0; display: flex; flex-wrap: wrap; gap: 4px 0; font-size: 14px; color: var(--dim); }
.crumbs li + li::before { content: "›"; margin: 0 8px; color: var(--line2); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--gold); }
.cx-hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s5) var(--s6); align-items: center; }
.cx-hero-art { display: grid; justify-items: center; gap: var(--s3); min-width: 220px; }
.cx-sprite { image-rendering: pixelated; width: var(--w); height: auto; filter: drop-shadow(0 6px 0 rgba(0,0,0,.45)) drop-shadow(0 0 22px rgba(255,122,44,.28)); }
.cx-unlock { margin: 0; text-align: center; max-width: 280px; }

/* Section bar under the site header (sticky only when there's height to spare). */
.cx-bar { background: #110c18; box-shadow: 0 2px 0 var(--line), 0 4px 0 #0b0810; position: relative; z-index: 40; }
@media (min-height: 720px) and (min-width: 760px) { .cx-bar { position: sticky; top: 62px; } html { scroll-padding-top: 130px; } }
.cx-bar-row { display: flex; align-items: center; gap: var(--s4); min-height: 52px; }
.cx-sections { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.cx-sections::-webkit-scrollbar { display: none; }
.cx-sections a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; white-space: nowrap; color: var(--muted); text-decoration: none; font: 400 19px/1 var(--display); letter-spacing: .3px; }
.cx-sections a:hover { color: #fff; }
.cx-sections a[aria-current="page"] { color: var(--gold); box-shadow: inset 0 -3px 0 var(--gold); }
.cx-find { position: relative; flex: 0 1 300px; min-width: 200px; }
.cx-find-btn { display: none; }
@media (min-width: 760px) { .cx-bar:not(.is-compact) .cx-sections { flex: 0 0 auto; } .cx-bar:not(.is-compact) .cx-find { flex: 1 1 200px; max-width: 320px; margin-left: auto; } }
/* Compact bar (set by compendium.js when the section links don't fit beside a full search box, so no link is ever
   hidden under it): the search collapses to a button; opening it lays the box over the links until it closes. */
.cx-bar-row { position: relative; }
.cx-bar.is-compact .cx-find { flex: 0 0 44px; min-width: 44px; position: static; }
.cx-bar.is-compact .cx-find-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; cursor: pointer; color: var(--text); background: #120d19; box-shadow: 0 0 0 2px var(--line2); }
.cx-bar.is-compact .cx-find-btn:hover { color: var(--gold); box-shadow: 0 0 0 2px var(--gold); }
.cx-bar.is-compact .cx-find > input { position: absolute; left: var(--gutter); right: calc(var(--gutter) + 56px); top: 4px; width: auto; opacity: 0; pointer-events: none; }
.cx-bar.is-compact .cx-find.is-open > input { opacity: 1; pointer-events: auto; background: #120d19; }
.cx-bar.is-compact .cx-find.is-open .cx-find-btn { color: var(--gold); }
.cx-bar.is-compact .cx-pop { right: var(--gutter); }
/* Section links that scroll sideways fade at the clipped edge. */
.cx-sections.fade-r { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); }
.cx-sections.fade-l { -webkit-mask-image: linear-gradient(90deg, transparent, #000 40px); mask-image: linear-gradient(90deg, transparent, #000 40px); }
.cx-sections.fade-l.fade-r { -webkit-mask-image: linear-gradient(90deg, transparent, #000 40px, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(90deg, transparent, #000 40px, #000 calc(100% - 40px), transparent); }
.cx-find input { width: 100%; min-height: 44px; padding: 6px 10px; font: 400 16px var(--ui); color: var(--text); background: #120d19; border: 0; box-shadow: 0 0 0 2px var(--line2); }
.cx-find input:focus { outline: 3px solid var(--gold); outline-offset: 2px; }
.cx-pop { position: absolute; right: 0; top: calc(100% + 8px); width: min(460px, calc(100vw - 2 * var(--gutter))); max-height: min(70vh, 520px); overflow-y: auto; background: #0f0b15; box-shadow: 0 0 0 2px var(--line2), 0 16px 40px rgba(0,0,0,.7); padding: 6px; z-index: 60; }
.cx-pop[hidden] { display: none; }
@media (max-width: 759px) {
  .cx-bar-row { flex-wrap: wrap; gap: 0; padding-bottom: 8px; }
  .cx-sections { flex-basis: 100%; }
  .cx-find { flex: 1 1 100%; min-width: 0; }
  .cx-pop { left: 0; right: auto; width: 100%; max-height: 60vh; }
}

/* Search results (hub list + bar pop-up) */
.cx-search .search-row input { font-size: 18px; }
.cx-results { display: grid; gap: 4px; }
.cx-search .cx-results { margin-top: var(--s3); }
.cx-results:empty { display: none; }
.cx-hit { display: grid; gap: 2px; padding: 8px 10px; min-height: 44px; text-decoration: none; color: var(--text); background: var(--bg3); box-shadow: inset 0 0 0 1px #2d2239; }
.cx-hit:hover, .cx-hit.on, .cx-hit:focus-visible { background: #2d2140; box-shadow: inset 0 0 0 2px var(--gold); color: #fff; }
.cx-hit-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.cx-hit-head b { font: 400 21px/1.1 var(--display); color: #fff3d6; }
.cx-hit-t { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--ember); }
.cx-hit-c { font-size: 13px; color: var(--violet); }
.cx-hit-d { font-size: 14px; color: var(--muted); line-height: 1.35; }
.cx-none { color: var(--muted); margin: 8px; }

/* Sections + shared bits */
.cx-sec { padding: clamp(28px, 5vw, 56px) 0; }
.cx-sec + .cx-sec { padding-top: 0; }
.cx-sec .section-title { margin-bottom: var(--s3); }
.cx-sec .section-lead { margin-bottom: var(--s5); max-width: 52em; }
.cx-h3 { font-size: clamp(26px, 3vw, 32px); margin: var(--s6) 0 var(--s4); color: var(--gold); }
.cx-sec .wrap > .cx-h3:first-of-type { margin-top: 0; }
.cx-h3 a { color: inherit; text-decoration: none; }
.cx-k { font: 400 16px/1 var(--display); letter-spacing: .16em; text-transform: uppercase; color: var(--ember); margin: var(--s3) 0 var(--s2); }
.cx-meta { color: var(--muted); font-size: 14px; margin-bottom: var(--s2); }
.cx-flavor { color: var(--dim); font-style: italic; font-size: 14px; margin: var(--s2) 0 0; }
.cx-power { font-size: 15px; color: #e9dcc2; margin-bottom: var(--s2); }
.cx-power b { color: var(--gold); }
.cx-mods { list-style: none; margin: var(--s2) 0; padding: 0; display: grid; gap: 2px; font-size: 15px; }
.cx-mods li { padding-left: 14px; position: relative; color: #bfe8c0; }
.cx-mods li::before { content: ""; position: absolute; left: 0; top: .6em; width: 6px; height: 6px; background: #5acb6a; }
.cx-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.cx-links li { background: var(--bg3); box-shadow: 0 0 0 2px var(--line); padding: 4px 10px; font-size: 15px; }
.cx-links a { display: inline-block; padding: 6px 0; }
.cx-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.cx-chips li { padding: 4px 10px; font-size: 14px; background: var(--bg3); box-shadow: 0 0 0 2px var(--line); color: var(--c, var(--text)); }
.cx-chips li.cx-prestige { color: var(--gold); box-shadow: 0 0 0 2px #8a6a2a; }
.cx-badge { font: 400 13px/1 var(--ui); padding: 3px 6px; vertical-align: middle; color: #1b1200; background: var(--gold); }
.cx-lv { font: 400 16px/1 var(--display); color: var(--ember); white-space: nowrap; }
.cx-tag { font-size: 12px; padding: 2px 7px; text-transform: uppercase; letter-spacing: .08em; background: #1b1424; box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); }
.cx-tag.cx-sub { color: var(--violet); box-shadow: inset 0 0 0 1px #5a4a8a; }
.cx-dt[data-dt="fire"] { color: #ff7a3c; } .cx-dt[data-dt="cold"] { color: #7ad0ff; } .cx-dt[data-dt="lightning"] { color: #f5e04a; }
.cx-dt[data-dt="poison"] { color: #7ae05a; } .cx-dt[data-dt="necrotic"] { color: #b08ad8; } .cx-dt[data-dt="radiant"] { color: #ffe08a; }
.cx-dt[data-dt="force"] { color: #c0a0ff; } .cx-dt[data-dt="psychic"] { color: #ff80c0; } .cx-dt[data-dt="thunder"] { color: #a0c0ff; } .cx-dt[data-dt="acid"] { color: #a0e040; }

/* Fact lists */
.cx-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 2px; margin: 0; background: #2d2239; box-shadow: 0 0 0 2px #2d2239; }
.cx-facts > div { background: var(--panel); padding: 8px 12px; min-width: 0; }
.cx-facts dt { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.cx-facts dd { margin: 2px 0 0; color: #fff3d6; font-size: 15px; line-height: 1.35; overflow-wrap: anywhere; }
.cx-facts-sm { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin-top: var(--s3); }
.cx-over { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: var(--s5); align-items: start; }
.cx-over .cx-facts { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.cx-note { padding: var(--s4); }
.cx-features { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3); }
.cx-features > li { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: var(--s2); font-size: 15px; color: #e2d5bd; }
.cx-features b { color: #fff3d6; }
.cx-features .cx-mods { margin: 2px 0 0; font-size: 14px; }
.cx-jump { padding-top: var(--s3); padding-bottom: var(--s4); }
.cx-jump ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.cx-jump a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; font: 400 19px/1 var(--display); color: var(--text); text-decoration: none; background: var(--panel2); box-shadow: 0 0 0 2px var(--line2); }
.cx-jump a:hover { box-shadow: 0 0 0 2px var(--gold); color: #fff; }

/* Tables */
.cx-tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cx-tablewrap.frame { padding: var(--s2) var(--s3); }
.cx-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.cx-table th, .cx-table td { padding: 8px; text-align: left; vertical-align: top; border-bottom: 2px solid #2d2239; }
.cx-table thead th { font: 400 16px/1 var(--display); letter-spacing: .1em; text-transform: uppercase; color: var(--ember); white-space: nowrap; }
.cx-table tbody th { font: 400 20px/1.1 var(--display); color: #fff3d6; white-space: nowrap; }
.cx-table tbody th a { color: var(--gold); text-decoration: none; }
.cx-table tbody tr:hover { background: rgba(255,255,255,.025); }
.cx-table tr:target { background: rgba(245,197,66,.1); box-shadow: inset 3px 0 0 var(--gold); }
.cx-prog { background: var(--panel); box-shadow: 0 0 0 2px var(--line); }
.cx-prog tbody th { text-align: center; width: 56px; }
.cx-prog td:nth-child(2) { width: 52px; color: var(--muted); }
.cx-gains { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.cx-g { display: inline-block; padding: 3px 8px; font-size: 14px; line-height: 1.3; background: #1b1424; box-shadow: inset 3px 0 0 var(--gc, var(--line2)), inset 0 0 0 1px #2d2239; color: #efe3c8; }
.cx-g a { color: #fff3d6; text-decoration: none; } .cx-g a:hover { color: var(--gold); text-decoration: underline; }
.cx-g small { color: var(--violet); font-size: 12px; margin-left: 4px; }
.cx-g-f { --gc: var(--gold); } .cx-g-s { --gc: var(--ember); } .cx-g-d { --gc: var(--violet); } .cx-g-c { --gc: #d06ad8; } .cx-g-a { --gc: #5acb6a; } .cx-g-p { --gc: var(--mana); color: var(--muted); }
.cx-legend { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: var(--s3); }

/* Skill cards */
.cx-skills { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s5); }
.cx-skill { background: var(--panel); box-shadow: 0 0 0 2px var(--line), inset 0 2px 0 rgba(255,255,255,.05); padding: var(--s4); min-width: 0; align-self: start; }
.cx-skill:target { box-shadow: 0 0 0 2px var(--gold), 0 0 24px rgba(245,197,66,.25); }
.cx-skill-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; margin-bottom: var(--s2); }
.cx-skill-head h3 { font-size: 30px; margin: 0; }
.cx-skill-text { color: #e2d5bd; font-size: 15px; }
.cx-dice { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin: var(--s3) 0 0; font-size: 15px; }
.cx-dice .cx-k { margin: 0 6px 0 0; font-size: 14px; }
.cx-dice b { font: 400 16px/1 var(--display); color: var(--ember); }
.cx-dice i { font-style: normal; color: var(--line2); }
.cx-mastery { margin-top: var(--s3); box-shadow: 0 0 0 2px #2d2239; }
.cx-mastery > summary { cursor: pointer; list-style: none; min-height: 44px; display: flex; align-items: center; gap: 10px; padding: 6px 12px; font: 400 19px/1.1 var(--display); color: var(--gold); background: #1b1424; }
.cx-mastery > summary::-webkit-details-marker { display: none; }
.cx-mastery > summary::before { content: "+"; color: var(--ember); font-size: 22px; width: 12px; }
.cx-mastery[open] > summary::before { content: "−"; }
.cx-mastery > summary:hover { color: #ffe08a; }
.cx-mastery > :not(summary) { margin-left: 12px; margin-right: 12px; }
.cx-mastery > p.small { margin-top: var(--s3); }
.cx-mastery-table { font-size: 14px; }
.cx-mastery-table th, .cx-mastery-table td { padding: 6px; }
.cx-mastery-table tbody th { font-size: 18px; text-align: center; }
.cx-mastery-table td:nth-child(2), .cx-mastery-table td:nth-child(3), .cx-mastery-table td:nth-child(4), .cx-mastery-table td:nth-child(5) { white-space: nowrap; font-variant-numeric: tabular-nums; }
.cx-mastery-table td:last-child { color: #e2d5bd; }
.cx-mastery-table tr.cx-mastered { background: rgba(245,197,66,.08); }
.cx-perks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; }
.cx-perks li { padding: 8px 10px; font-size: 14px; color: #e2d5bd; background: #1b1424; box-shadow: inset 0 0 0 1px var(--line); }
.cx-perks b { display: block; font: 400 18px/1.1 var(--display); color: #fff3d6; margin-bottom: 2px; }
.cx-mastered-line { font-size: 15px; padding: 8px 10px; margin-top: var(--s3); margin-bottom: var(--s3); background: rgba(245,197,66,.08); box-shadow: inset 3px 0 0 var(--gold); }
.cx-mastered-line b { color: var(--gold); }
.cx-subs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s5); }
.cx-subclass { padding: var(--s4); }
.cx-subclass h3 { color: var(--gold); }
.cx-subclass > p:not(.cx-k) { color: #e2d5bd; }
.cx-pager { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s3); padding-bottom: var(--s7); }
.cx-pager .btn { font-size: 22px; min-height: 48px; }

/* Card grids */
.cx-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--s4); }
.cx-card { display: block; background: var(--panel); box-shadow: 0 0 0 2px var(--line), inset 0 2px 0 rgba(255,255,255,.05); padding: var(--s4); min-width: 0; color: var(--text); }
.cx-card:target { box-shadow: 0 0 0 2px var(--gold), 0 0 24px rgba(245,197,66,.25); }
.cx-card h3 { font-size: 28px; margin-bottom: 4px; }
.cx-card h3 small { font: 400 15px var(--ui); color: var(--muted); }
.cx-card > p:not(.cx-meta):not(.cx-flavor):not(.cx-k):not(.cx-power) { font-size: 15px; color: #e2d5bd; }
a.cx-card { text-decoration: none; transition: transform .12s var(--px); }
a.cx-card:hover { transform: translateY(-3px); box-shadow: 0 0 0 2px var(--gold), 0 0 24px rgba(255,122,44,.3); }
.cx-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s4); }
.cx-grid > li { display: flex; } .cx-grid > li > .cx-card { flex: 1; }
.cx-class-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.cx-class { display: flex; flex-direction: column; }
.cx-class h3 { color: var(--gold); }
.cx-class > p:nth-of-type(2) { flex: 1; }
.cx-class .cx-sprite-sm { image-rendering: pixelated; height: auto; width: var(--w); align-self: flex-start; margin-bottom: var(--s2); filter: drop-shadow(0 4px 0 rgba(0,0,0,.4)); }
.cx-role { font-weight: 400; color: #fff3d6; }
.cx-subline { font-size: 13px; color: var(--violet); margin: 0 0 4px; }
.cx-class .cx-unlock { text-align: left; color: var(--dim); margin: 0; max-width: none; }
.cx-compare { min-width: 720px; }
.cx-unique { box-shadow: 0 0 0 2px var(--line), inset 3px 0 0 var(--uc, #2ff5d8); }
.cx-unique h3 { color: #b6fff2; }
.cx-unique .cx-mods li { color: #b6fff2; } .cx-unique .cx-mods li::before { background: #2ff5d8; }

/* Races */
.cx-races { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 520px), 1fr)); gap: var(--s4); }
.cx-race { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s4); align-items: start; }
.cx-race-art { background: radial-gradient(ellipse at 50% 60%, rgba(255,122,44,.18), transparent 70%), #1b1424; box-shadow: inset 0 0 0 1px var(--line); padding: 6px; }
.cx-portrait { image-rendering: pixelated; display: block; width: var(--w); max-width: 100%; height: auto; }
.cx-race h3 { color: var(--gold); }
.cx-bonus { font: 400 22px/1.1 var(--display); color: var(--ember); margin-bottom: var(--s2); }
.cx-race .cx-unlock { text-align: left; max-width: none; color: var(--muted); margin-bottom: 0; }
.cx-looks > summary { cursor: pointer; min-height: 44px; display: inline-flex; align-items: center; font: 400 19px/1 var(--display); color: var(--gold); }
.cx-swatches { display: flex; flex-wrap: wrap; gap: 4px; }
.cx-swatches i { width: 20px; height: 20px; box-shadow: 0 0 0 2px #0b0810, inset 0 2px 0 rgba(255,255,255,.18); }

/* Abilities, stats, statuses */
.cx-ab { display: inline-block; min-width: 56px; padding: 2px 6px; margin-right: 8px; text-align: center; color: #1b1200; background: var(--gold); font-size: 22px; }
.cx-abilities .cx-card h3 { display: flex; align-items: center; }
.cx-using { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
.cx-gloss { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--s3); margin: 0; }
.cx-gloss > div { background: var(--panel); box-shadow: 0 0 0 2px var(--line); padding: var(--s3) var(--s4); }
.cx-gloss dt { font: 400 22px/1.1 var(--display); color: var(--gold); margin-bottom: 4px; }
.cx-gloss dd { margin: 0; font-size: 15px; color: #e2d5bd; }
.cx-status { box-shadow: 0 0 0 2px var(--line), inset 3px 0 0 var(--sc); }
.cx-status h3 { display: flex; align-items: center; gap: 10px; color: var(--sc); }
.cx-dot { width: 14px; height: 14px; background: var(--sc); box-shadow: 0 0 0 2px #0b0810, 0 0 10px var(--sc); flex: none; }

/* Legendaries, sets, pets, bosses */
.cx-leg h3 { color: #ff8a1c; }
.cx-sets { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: var(--s5); }
.cx-set { padding: var(--s4); box-shadow: 0 0 0 2px var(--setc), 0 0 0 4px var(--bg), 0 0 0 6px #0b0810; }
.cx-set h3 { color: var(--setc); }
.cx-pieces, .cx-bonuses { list-style: none; margin: var(--s3) 0 0; padding: 0; display: grid; gap: 4px; font-size: 14px; }
.cx-bonuses li { padding: 6px 8px; background: #1b1424; color: #e2d5bd; }
.cx-bonuses b { color: var(--setc); }
.cx-pet { box-shadow: 0 0 0 2px var(--line), inset 3px 0 0 var(--rc); }
.cx-rar { color: var(--rc); }
.cx-act-bosses { grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); }
.cx-boss-act { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: var(--s4); align-items: start; }
.cx-boss-art { display: grid; place-items: center; min-height: 170px; background: radial-gradient(ellipse at 50% 70%, rgba(255,110,40,.28), transparent 65%), var(--bg3); }
.cx-boss-img { image-rendering: pixelated; width: var(--w); height: auto; max-width: 100%; filter: drop-shadow(0 6px 0 rgba(0,0,0,.45)); }
.cx-rarities { justify-content: flex-start; margin-top: var(--s4); }
.cx-boss-art-card:not(.cx-boss-act) { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: var(--s3) var(--s4); align-items: start; }
.cx-boss-art-card:not(.cx-boss-act) .cx-boss-art { min-height: 120px; padding: 6px; }
.cx-boss-art-card:not(.cx-boss-act) { align-items: center; }
.cx-boss-art-card:not(.cx-boss-act) > .cx-facts { grid-column: 1 / -1; margin-top: 0; }
.cx-boss-head p { margin-bottom: 4px; }

/* Game art: item icons (in-game slot look), creature sprites, pet evolutions, race looks. Always crisp pixels. */
.cx-icon, .cx-mon-img, .cx-pet-img, .cx-look { image-rendering: pixelated; image-rendering: crisp-edges; }
.cx-icon { --rc: #6b5580; display: inline-grid; place-items: center; flex: none; width: 76px; height: 76px; background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--rc) 22%, transparent), transparent 70%), #16101f; box-shadow: inset 0 0 0 2px var(--rc), inset 0 0 0 4px #0b0810; }
.cx-icon img { image-rendering: pixelated; width: var(--w); height: auto; max-width: 64px; filter: drop-shadow(0 2px 0 rgba(0,0,0,.5)); }
.cx-icon[data-r="unique"] { --rc: #2ff5d8; } .cx-icon[data-r="legendary"] { --rc: #ff8a1c; } .cx-icon[data-r="set"] { --rc: var(--setc, #6ae08a); }
.cx-icon-sm { width: 44px; height: 44px; box-shadow: inset 0 0 0 2px #3a2c4a; }
.cx-icon-sm img { max-width: 34px; }
.cx-has-icon { display: grid; grid-template-columns: 76px minmax(0, 1fr); column-gap: var(--s4); align-content: start; }
.cx-has-icon > .cx-icon { grid-row: 1 / span 2; }
.cx-has-icon > :not(.cx-icon) { grid-column: 2; }
.cx-has-icon > .cx-mods, .cx-has-icon > .cx-power, .cx-has-icon > .cx-flavor { grid-column: 1 / -1; }
.cx-item-name { display: inline-flex; align-items: center; gap: 10px; }
.cx-pieces li { display: flex; align-items: center; gap: 10px; }
.cx-pieces li > span:last-child { min-width: 0; line-height: 1.35; }
.cx-mons { grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.cx-mon { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: var(--s3) var(--s4); align-items: start; }
.cx-mon h3 { font-size: 26px; color: #fff3d6; }
.cx-mon-art { display: grid; place-items: center; min-height: 112px; padding: 6px; background: radial-gradient(ellipse at 50% 75%, rgba(255,110,40,.18), transparent 65%), var(--bg3); box-shadow: inset 0 -6px 0 #1b1424; }
.cx-mon-img { width: var(--w); height: auto; max-width: 100%; filter: drop-shadow(0 4px 0 rgba(0,0,0,.45)); }
.cx-mon { align-items: center; }
.cx-mon > .cx-facts { grid-column: 1 / -1; }
.cx-mon-body { align-self: center; }
.cx-mon-body .cx-meta { margin: 0; }
.cx-facts-xs { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); margin-top: 0; }
.cx-facts-xs > div:nth-last-child(1):nth-child(odd) { grid-column: span 1; }
.cx-facts-xs > div { padding: 6px 8px; }
.cx-facts-xs dd { font-size: 14px; }
.cx-evo { list-style: none; margin: 0 0 var(--s3); padding: 10px 8px 6px; display: flex; align-items: flex-end; justify-content: space-around; gap: 4px; background: radial-gradient(ellipse at 50% 85%, color-mix(in srgb, var(--rc) 20%, transparent), transparent 70%), var(--bg3); box-shadow: inset 0 -6px 0 #1b1424; }
.cx-evo li { display: grid; justify-items: center; gap: 4px; min-width: 0; text-align: center; }
.cx-evo span { font-size: 12px; line-height: 1.15; color: var(--muted); }
.cx-evo small { display: block; color: var(--dim); font-size: 11px; }
.cx-pet-img { width: var(--w); height: auto; max-width: 100%; filter: drop-shadow(0 3px 0 rgba(0,0,0,.45)); }
.cx-looks > summary::before { content: "▸"; display: inline-block; width: 1em; transition: transform .1s var(--px); }
.cx-looks[open] > summary::before { transform: rotate(90deg); }
.cx-looks > summary { gap: 8px; flex-wrap: wrap; }
.cx-looks > summary span { font: 400 14px var(--ui); }
.cx-looks > summary:hover { color: #fff; }
.cx-look-grid { list-style: none; margin: var(--s2) 0 var(--s2); padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.cx-look-grid li { background: #1b1424; box-shadow: inset 0 0 0 1px var(--line); padding: 3px; }
.cx-look { display: block; width: 100%; height: auto; }

/* Hub */
.cx-search-sec { padding-bottom: 0; }
.cx-search label { font-size: 28px; }
.cx-hub { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.cx-hubcard h3 { color: var(--gold); display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.cx-count { font-size: 22px; color: var(--ember); }
.cx-classrow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: var(--s3); }
.cx-classrow a { display: grid; justify-items: center; gap: 4px; padding: 10px 6px; min-height: 44px; text-decoration: none; color: var(--text); background: var(--panel); box-shadow: 0 0 0 2px var(--line); font: 400 19px/1 var(--display); text-align: center; }
.cx-classrow a:hover { box-shadow: 0 0 0 2px var(--gold); color: var(--gold); }
.cx-sprite-xs { image-rendering: pixelated; width: var(--w); height: auto; }

@media (max-width: 1099px) {
  .cx-skills { grid-template-columns: minmax(0, 1fr); }
  .cx-over { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 899px) {
  .cx-subs { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 699px) {
  /* Mastery ranks as stacked rows: rank + four numbers on one line, what changes below. */
  .cx-mastery-table thead { display: none; }
  .cx-mastery-table tr { display: grid; grid-template-columns: 30px minmax(0, .9fr) minmax(0, .7fr) minmax(0, 1.1fr) minmax(0, 1.4fr); column-gap: 4px; border-bottom: 2px solid #2d2239; padding: 4px 0; }
  .cx-mastery-table th, .cx-mastery-table td { border: 0; padding: 2px 4px; }
  .cx-mastery-table tbody th { grid-row: span 2; align-self: center; }
  .cx-mastery-table td[data-l]::before { content: attr(data-l); display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); }
  .cx-mastery-table td:last-child { grid-column: 2 / -1; }
  .cx-mastery-table td:last-child:empty { display: none; }
  .cx-hero-grid { grid-template-columns: minmax(0, 1fr); }
  .cx-hero-grid .cx-hero-art { grid-template-columns: auto minmax(0, 1fr); justify-self: stretch; justify-items: start; align-items: center; gap: var(--s2) var(--s4); min-width: 0; }
  .cx-hero-art .cx-sprite { grid-row: span 2; }
  .cx-hero-art .cx-chips { justify-content: flex-start; align-self: end; }
  .cx-hero-art .cx-unlock { text-align: left; align-self: start; }
  .cx-sprite { width: calc(var(--w) / 2); }
  .cx-race { grid-template-columns: minmax(0, 1fr); }
  .cx-race-art { justify-self: start; }
  .cx-boss-act { grid-template-columns: minmax(0, 1fr); }
  .cx-boss-art-card:not(.cx-boss-act) { grid-template-columns: 96px minmax(0, 1fr); }
  .cx-boss-art-card:not(.cx-boss-act) .cx-boss-img { width: calc(var(--w) * .8); }
  .cx-mon { grid-template-columns: 88px minmax(0, 1fr); }
  .cx-mon-art { min-height: 88px; }
  .cx-has-icon { grid-template-columns: 60px minmax(0, 1fr); column-gap: var(--s3); }
  .cx-icon:not(.cx-icon-sm) { width: 60px; height: 60px; }
  .cx-icon:not(.cx-icon-sm) img { max-width: 48px; }
  .cx-evo span { font-size: 11px; }
  .cx-cards, .cx-sets, .cx-gloss { grid-template-columns: minmax(0, 1fr); }
  .cx-skill-head h3 { font-size: 26px; }
  .cx-facts, .cx-over .cx-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cx-pager .btn { flex: 1 1 40%; font-size: 20px; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .page-cx .page-hero { padding-top: 20px; }
  .page-cx .page-hero h1 { font-size: 48px; }
  .cx-sprite { width: calc(var(--w) / 2); }
}
