/* Portrait faction selector: seven banners per page, one expanded at a time. */
.gallery-heading{display:flex;align-items:center;justify-content:space-between;gap:20px;margin:0 0 16px}.gallery-heading>span{font-size:9px;letter-spacing:1.7px;color:var(--muted)}.gallery-heading i{font-style:normal;color:var(--gold);margin:0 8px}.gallery-navigation{display:flex;align-items:center;gap:17px}.gallery-navigation button{background:transparent;border:1px solid var(--line);width:35px;height:33px;color:var(--gold);font-size:18px}.gallery-navigation button:hover:not(:disabled){border-color:var(--gold);background:#27271e}.gallery-navigation button:disabled{opacity:.25;cursor:default}.gallery-navigation>span{font-size:10px;letter-spacing:2px;color:var(--muted);min-width:60px;text-align:center}
.faction-row{display:flex;gap:9px;height:clamp(430px,62vh,600px);overflow:visible;isolation:isolate}
#grid .card{flex:1 1 0;min-width:0;transition:flex .45s cubic-bezier(.2,.7,.2,1),border-color .25s;transform:none;height:100%;background:#171b1b}
#grid .card.expanded{flex:3.25 1 0;border-color:var(--gold)}
#grid .card-main{height:100%;position:relative;overflow:hidden}
#grid .card-art{height:100%;position:absolute;inset:0}
#grid .card-art img{height:100%;width:100%;transform:none;filter:saturate(.72) brightness(.8);transition:filter .35s,transform .6s}
#grid .expanded .card-art img{filter:saturate(1.04) brightness(1.05);transform:scale(1.025)}
#grid .card-art:after{background:linear-gradient(0deg,#080c0cf2,transparent 70%),linear-gradient(90deg,#070a0a40,transparent 70%)}
#grid .expanded .card-art:after{background:linear-gradient(0deg,#080c0c 0%,#080c0ce8 17%,#080c0c60 43%,transparent 75%)}
#grid .card-body{position:absolute;left:16px;right:14px;bottom:23px;margin:0;padding:0}
#grid .card h3{font-size:clamp(24px,2.35vw,36px);line-height:1.02;writing-mode:vertical-rl;transform:rotate(180deg);max-height:360px;margin:0;text-shadow:0 2px 14px #000}
#grid .card .group,#grid .card p,#grid .card-bottom{display:none}
#grid .card.expanded h3{writing-mode:horizontal-tb;transform:none;max-height:none;margin:10px 0 12px;font-size:clamp(27px,3vw,43px)}
#grid .card.expanded .group{display:block;font-size:8px;line-height:1.6}
#grid .card.expanded p{display:block;min-height:0;font-size:12px;line-height:1.65;color:#d0d3c8}
#grid .card.expanded .card-bottom{display:flex;margin-top:18px;padding-top:13px;border-color:#777b6355;font-size:8px;gap:8px}
#grid .heart{right:10px;top:12px;width:29px;height:29px;font-size:18px;background:#101313a9}
#grid .faction-no{top:19px;left:12px;font-size:8px;letter-spacing:1px}
#grid .card:not(.expanded) .faction-no{font-size:0}
#grid .card:not(.expanded) .faction-no:first-letter{font-size:9px}
.swipe-hint{display:none}.roster-note{margin-top:24px}
@media(min-width:1600px){#grid .card-body{left:23px;right:20px}#grid .card.expanded{flex:2.8 1 0}}
@media(max-width:900px) and (min-width:641px){.faction-row{gap:6px;height:490px}#grid .card-body{left:10px;right:10px}#grid .card h3{font-size:23px}#grid .card.expanded{flex:4.3 1 0}#grid .card.expanded h3{font-size:30px}#grid .heart{width:25px;height:25px;right:6px;top:8px}#grid .faction-no{top:12px;left:9px}}
@media(max-width:640px){.gallery-heading>span{font-size:0}.gallery-heading>span:before{content:'CHOOSE YOUR FACTION';font-size:8px;letter-spacing:1px}.gallery-heading i{display:none}.gallery-navigation{gap:9px}.gallery-navigation>span{font-size:9px;min-width:50px}.gallery-navigation button{width:30px;height:30px}.faction-row{height:490px;gap:10px;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x proximity;overscroll-behavior-x:contain;padding-bottom:10px;scrollbar-color:var(--gold) #242a25;scrollbar-width:thin}#grid .card,#grid .card.expanded{flex:0 0 min(76vw,290px);scroll-snap-align:start;border-color:var(--line)}#grid .card-art img{filter:none}#grid .card-body{left:19px;right:18px;bottom:23px}#grid .card h3,#grid .card.expanded h3{writing-mode:horizontal-tb;transform:none;font-size:34px;max-height:none;margin:10px 0 12px}#grid .card .group,#grid .card p{display:block}#grid .card .group{font-size:8px}#grid .card p{min-height:0;font-size:12px;color:#d0d3c8;line-height:1.65}#grid .card .card-bottom{display:flex;font-size:8px;margin-top:18px;padding-top:13px}#grid .card-art:after{background:linear-gradient(0deg,#080c0c 0%,#080c0ce8 17%,#080c0c60 43%,transparent 75%)}#grid .card .faction-no{font-size:8px}.swipe-hint{display:block;font-size:10px;color:var(--muted);letter-spacing:.6px;text-align:center;margin-top:15px}.subbar{gap:12px}.subbar label{white-space:nowrap}.roster-note{font-size:9px}}
@media(prefers-reduced-motion:reduce){#grid .card,#grid .card-art img{transition:none}}

#grid.grid{display:block;height:auto;overflow:visible;padding:0}.faction-section{margin-bottom:48px}.faction-section:last-child{margin-bottom:0}.row-heading{display:flex;justify-content:space-between;align-items:center;gap:20px;margin:28px 0 18px;padding-top:25px;border-top:1px solid var(--line)}.row-index{font-size:9px;letter-spacing:1.8px;color:var(--gold)}.row-heading h3{font:500 37px 'Barlow Condensed',sans-serif;text-transform:uppercase;margin:7px 0}.row-heading p{font-size:11px;color:var(--muted);margin:0;line-height:1.6}.group-scroll-note{font-size:9px;letter-spacing:1px;color:var(--gold)}@media(max-width:640px){.row-heading{gap:12px;align-items:flex-start}.row-heading h3{font-size:31px}.row-heading p{font-size:10px}.row-heading .gallery-navigation{margin-top:20px}.group-scroll-note{display:none}.faction-section{margin-bottom:32px}}

/* The official AoS portrait assets contain a baked-in dark treatment.
   Compensate only the artwork; keep interface text and controls untouched. */
#grid .card[data-art-world="aos"] .card-art img{filter:brightness(1.65) saturate(1.06)}
#grid .card[data-art-world="aos"].expanded .card-art img{filter:brightness(1.85) saturate(1.06)}
.profile-hero[data-art-world="aos"]{position:relative;isolation:isolate;overflow:hidden}
.profile-hero[data-art-world="aos"]::before{content:'';position:absolute;inset:0;background:inherit;background-size:cover;background-position:inherit;filter:brightness(1.85) saturate(1.06);z-index:0}
.profile-hero[data-art-world="aos"]>div{position:relative;z-index:1}
@media(max-width:640px){#grid .card[data-art-world="aos"] .card-art img,#grid .card[data-art-world="aos"].expanded .card-art img{filter:brightness(1.8) saturate(1.06)}}


/* The wider Ogor source needs a stronger face-anchored zoom than portrait art. */
#grid .card[data-faction="aos-ogor-mawtribes"] .card-art img{transform-origin:44% 25%}
@media(min-width:641px){#grid .card[data-faction="aos-ogor-mawtribes"].expanded .card-art img{transform:scale(1.8)}}


/* Emblems are separate from artwork so exposure and zoom never affect them. */
#grid .faction-emblem{position:absolute;z-index:3;top:57px;left:50%;transform:translateX(-50%);width:49px;height:49px;display:grid;place-items:center;padding:9px;background:#0b1010d9;border:1px solid #d8bc7866;border-radius:50%;box-shadow:0 3px 16px #0006;pointer-events:none;transition:width .35s,height .35s,background .35s}
#grid .faction-emblem img{display:block;width:100%;height:100%;object-fit:contain;filter:brightness(0) invert(1);opacity:.92}
#grid .expanded .faction-emblem{width:64px;height:64px;padding:11px;border-color:var(--gold);background:#111711ed}
.profile-emblem{display:block;width:60px;height:60px;object-fit:contain;margin:0 0 14px;filter:brightness(0) invert(1);opacity:.95}
@media(max-width:640px){#grid .faction-emblem,#grid .expanded .faction-emblem{left:20px;transform:none;width:60px;height:60px;top:51px;padding:10px}}

/* Keep each identity badge clearly separated from the full-bleed artwork. */
#grid .faction-emblem{width:60px;height:60px;padding:10px;background:#080d0df5;border-color:#d8bc78cc;box-shadow:0 2px 14px #000b}
#grid .expanded .faction-emblem{width:72px;height:72px;padding:12px}
#grid .faction-emblem img{opacity:1;min-width:0;max-width:none}
@media(max-width:640px){#grid .faction-emblem,#grid .expanded .faction-emblem{width:64px;height:64px;padding:10px}}

/* Faction emblems belong to the title block, away from the character artwork. */
#grid .faction-identity{display:flex;flex-direction:column;align-items:flex-start;gap:12px}
#grid .faction-emblem,#grid .expanded .faction-emblem{position:static;inset:auto;transform:none;width:38px;height:38px;padding:3px;background:none;border:0;border-radius:0;box-shadow:none;flex:0 0 38px;transition:none}
#grid .faction-identity h3{margin:0;max-height:300px}
#grid .expanded .faction-identity{flex-direction:row;align-items:center;gap:12px;margin:10px 0 12px}
#grid .expanded .faction-identity h3{margin:0;min-width:0;max-height:none;flex:1}
#grid .expanded .faction-emblem{width:44px;height:44px;flex-basis:44px}
@media(max-width:640px){#grid .faction-identity,#grid .expanded .faction-identity{flex-direction:row;align-items:center;gap:11px;margin:10px 0 12px}#grid .faction-identity h3,#grid .expanded .faction-identity h3{margin:0;min-width:0;flex:1;max-height:none}#grid .faction-emblem,#grid .expanded .faction-emblem{position:static;transform:none;width:40px;height:40px;flex-basis:40px;padding:3px}}

/* Fixed, clipped emblem slots prevent intrinsic image sizes from escaping. */
#grid .card .faction-emblem,#grid .card.expanded .faction-emblem{display:flex;align-items:center;justify-content:center;position:static;transform:none;box-sizing:border-box;width:44px;height:44px;min-width:44px;max-width:44px;min-height:44px;max-height:44px;flex:0 0 44px;padding:4px;overflow:hidden;contain:size layout;align-self:start}
#grid .card .faction-emblem img{display:block;position:static;width:36px;height:36px;min-width:0;min-height:0;max-width:36px;max-height:36px;object-fit:contain;object-position:center;flex:none;transform:none}
#grid .card .faction-identity{display:grid;grid-template-columns:44px;align-items:start;gap:12px;min-height:44px;margin-bottom:14px}
#grid .card.expanded .faction-identity{grid-template-columns:44px minmax(0,1fr);align-items:center;margin:10px 0 14px}
#grid .card .faction-identity h3{min-width:0;overflow-wrap:break-word}
#grid .card .faction-identity+p{clear:both;margin-top:0}
@media(max-width:640px){#grid .card .faction-identity,#grid .card.expanded .faction-identity{grid-template-columns:44px minmax(0,1fr);align-items:center;margin:10px 0 14px}}

/* Lore-led faction dossiers with separate illustration and miniature galleries. */
#profile{width:min(1120px,94vw)}
#profile .close{background:#101514f2;box-shadow:0 2px 12px #0008}
.profile-copy{padding:20px 38px 38px}
.profile-intro{max-width:850px}
.profile-intro h3{margin:10px 0 5px}
.profile-intro>p{margin:6px 0}
.profile-lore{display:grid;grid-template-columns:1fr 1.1fr;gap:32px;align-items:center;margin:35px 0 40px;padding-top:32px;border-top:1px solid var(--line)}
.lore-text h3{font-size:31px;margin:14px 0}
.lore-text p{font-size:15px;line-height:1.9;margin:0 0 18px;color:#c5cabe}
.source-link{font-size:11px;color:var(--gold);display:inline-block;padding:6px 0;border-bottom:1px solid #6b6448}
.lore-illustration{margin:0;min-width:0}
.lore-illustration>a{display:block;background:#191d1a;border:1px solid var(--line)}
.lore-illustration img{display:block;width:100%;height:320px;object-fit:contain}
.lore-illustration figcaption{font-size:10px;line-height:1.7;color:#a4afa0;margin:10px 0 0}
.lore-illustration figcaption a{display:block;color:var(--gold);font-size:9px}
.profile-models{border-top:1px solid var(--line);padding-top:30px;margin-top:20px}
.profile-models h3{margin:13px 0 6px;font-size:32px}
.profile-models .models-intro{font-size:12px;color:var(--muted);line-height:1.8;margin:0 0 22px}
.miniature-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}
.miniature-card{margin:0;min-width:0;border:1px solid var(--line);background:#181d19}
.miniature-image{display:flex;align-items:center;justify-content:center;height:230px;padding:10px;background:radial-gradient(ellipse at center,#eeeee5,#c4cbc2)}
.miniature-image img{display:block;width:100%;height:100%;object-fit:contain}
.miniature-card figcaption{padding:14px;line-height:1.5}
.miniature-card figcaption strong{display:block;font-size:12px;font-weight:500;color:var(--text)}
.miniature-card figcaption span{display:block;color:var(--muted);font-size:9px;margin-top:7px}
.miniature-card figcaption a{font-size:9px;color:var(--gold);display:inline-block;margin-top:10px}
@media(max-width:740px){.profile-lore{grid-template-columns:1fr;gap:24px;margin-top:26px}.lore-illustration img{height:auto;max-height:430px}.miniature-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.miniature-image{height:190px}.profile-copy{padding:18px 25px 30px}}
@media(max-width:420px){.miniature-grid{grid-template-columns:1fr}.miniature-image{height:240px}.profile-lore{padding-top:24px}.lore-text p{font-size:14px}}

.profile-army{border-top:1px solid var(--line);padding-top:28px;margin-top:20px}
.profile-army h3{font-size:32px;margin:13px 0 22px}
.army-showcase{margin:0}
.army-showcase>a{display:block;background:#0b1010;border:1px solid var(--line)}
.army-showcase img{display:block;width:100%;height:auto;max-height:650px;object-fit:contain}
.army-showcase figcaption{display:flex;justify-content:space-between;gap:18px;align-items:start;margin-top:12px;font-size:11px;line-height:1.7;color:var(--muted)}
.army-showcase figcaption a{color:var(--gold);font-size:10px;white-space:nowrap}
.profile-intro .roster-relation{font-size:12px;line-height:1.8;padding:12px 15px;border-left:2px solid var(--gold);background:#24271d;color:#d9d9bd;margin:0 0 20px}
.roster-relation button{border:0;background:none;cursor:pointer;padding:0;font:inherit;color:var(--gold);text-align:left}
@media(min-width:641px){#grid .card[data-faction="aos-khazalite-holds"].expanded .card-art img{transform:scale(1.6);transform-origin:55% 100%}}
@media(max-width:640px){.army-showcase figcaption{flex-direction:column;gap:5px}.profile-army h3{font-size:29px}.army-showcase img{max-height:none}}

/* Preserve the official Khazalite medallion rather than flattening its colours. */
#grid .card[data-faction="aos-khazalite-holds"] .faction-emblem img,.profile-emblem[src*="aos-khazalite-holds"]{filter:none;clip-path:circle(46% at 50% 48%)}

/* Zero-height close toolbar overlays the content instead of narrowing the hero. */
dialog .dialog-toolbar{position:sticky;top:14px;height:0;width:100%;z-index:20;pointer-events:none}
dialog .dialog-toolbar>.close{position:absolute;float:none;top:0;right:14px;margin:0;pointer-events:auto}
#profileContent{display:flow-root;width:100%;min-width:0}
#profile .profile-hero{width:100%;margin:0}
dialog{scrollbar-color:#69715d #111714;scrollbar-width:thin}
dialog::-webkit-scrollbar{width:8px}dialog::-webkit-scrollbar-track{background:#111714}dialog::-webkit-scrollbar-thumb{background:#69715d;border:2px solid #111714;border-radius:10px}
.army-showcase .army-inspector{--pan-x:50%;--pan-y:50%;position:relative;display:block;width:100%;height:clamp(300px,44vw,560px);padding:0;overflow:hidden;border:1px solid var(--line);background:#0b1010;cursor:zoom-in;touch-action:pan-y;text-align:left;isolation:isolate}
.army-showcase .army-inspector img{display:block;width:100%;height:100%;max-height:none;object-fit:cover;object-position:var(--pan-x) var(--pan-y);transform-origin:var(--pan-x) var(--pan-y);transform:scale(1);transition:transform .22s ease;pointer-events:none;user-select:none}
.army-showcase .army-inspector.is-zoomed img{transform:scale(2.35)}
.army-showcase .army-inspector.is-pinned{cursor:move;touch-action:none}
.inspector-badge{position:absolute;left:16px;bottom:16px;z-index:2;display:flex;align-items:center;gap:8px;padding:8px 11px;background:#0a0f0fe6;border:1px solid #d8bc7880;color:var(--gold);font-size:19px;pointer-events:none}
.inspector-state{font-size:8px;letter-spacing:1.5px;line-height:1.5}
.profile-copy .inspector-help{display:flex;flex-wrap:wrap;gap:7px 15px;justify-content:space-between;margin:12px 0 0;font-size:10px;line-height:1.7;color:var(--muted)}
.inspector-help a{color:var(--gold);white-space:nowrap}.touch-help{display:none}.keyboard-help{flex-basis:100%;font-size:9px;opacity:.8}
@media(hover:none){.mouse-help{display:none}.touch-help{display:inline}}
@media(max-width:640px){.army-showcase .army-inspector{height:360px}.inspector-badge{left:10px;bottom:10px}.inspector-state{font-size:7px;letter-spacing:1px}}
@media(prefers-reduced-motion:reduce){.army-showcase .army-inspector img{transition:none}}

/* Selected current-sculpt units are editorial close-ups, not a product grid. */
.profile-units{margin-top:40px;padding-top:32px;border-top:1px solid var(--line)}
.profile-units>h3{font-size:34px;margin:14px 0 8px}
.profile-copy .units-intro{font-size:13px;color:var(--muted);line-height:1.8;margin:0 0 28px}
.unit-feature{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);gap:32px;align-items:center;padding:28px 0;border-top:1px solid var(--line)}
.unit-feature:nth-child(even){grid-template-columns:minmax(0,1fr) minmax(0,1.2fr)}
.unit-feature:nth-child(even) .unit-portrait{order:2}
.unit-portrait{margin:0;min-width:0}
.unit-portrait>a{display:block;height:390px;padding:15px;border:1px solid #a4afa155;background:radial-gradient(ellipse at center,#e9ebe2,#c4ccc1)}
.unit-portrait img{display:block;width:100%;height:100%;object-fit:contain;transition:filter .2s}
.unit-portrait>a:hover img{filter:brightness(1.04)}
.unit-portrait figcaption{font-size:9px;line-height:1.7;color:#8e9a8b;margin-top:9px}
.unit-story{min-width:0;padding:10px 0}
.unit-number{display:block;font-size:9px;letter-spacing:2px;color:#7e8a7b;margin-bottom:20px}
.unit-role{display:inline-block;font-size:9px;line-height:1.7;letter-spacing:1.5px;text-transform:uppercase;color:var(--gold);border-bottom:1px solid #716644;padding-bottom:6px}
.unit-story h4{font:500 36px/1.05 'Barlow Condensed',sans-serif;text-transform:uppercase;color:var(--text);margin:15px 0 16px;overflow-wrap:break-word}
.profile-copy .unit-story p{font-size:14px;line-height:1.85;color:#bdc6b7;margin:0 0 18px}
.unit-story .unit-release{display:block;font-size:10px;line-height:1.6;color:#8e9a8b;margin:0 0 13px}
.unit-story .source-link{font-size:10px}
@media(max-width:740px){.unit-feature,.unit-feature:nth-child(even){grid-template-columns:1fr;gap:16px;padding:25px 0}.unit-feature:nth-child(even) .unit-portrait{order:0}.unit-portrait>a{height:360px}.unit-story{padding:4px 0 8px}.unit-number{margin-bottom:12px}.unit-story h4{font-size:32px;margin-top:12px}.profile-copy .unit-story p{font-size:13px}.profile-units>h3{font-size:31px}}
@media(max-width:420px){.unit-portrait>a{height:310px;padding:10px}}
/* Three settings, each with its own metal, atmosphere and title treatment. */
body[data-setting="40k"],dialog[data-setting="40k"]{--gold:#c5d4e0;--bg:#101418;--panel:#181e24;--line:#39434d;--text:#e8edf0;--muted:#a8b3bc;--accent-rgb:164,191,214;--accent-wash:#27333f;--accent-edge:#667b8d}
body[data-setting="aos"],dialog[data-setting="aos"]{--gold:#dfbc78;--bg:#151310;--panel:#211c16;--line:#494033;--text:#f1eadb;--muted:#b9afa0;--accent-rgb:213,166,87;--accent-wash:#34291c;--accent-edge:#927347}
body[data-setting="old"],dialog[data-setting="old"]{--gold:#83c8c9;--bg:#0d1719;--panel:#152326;--line:#2d4d50;--text:#e3eeea;--muted:#a2b9b6;--accent-rgb:86,172,177;--accent-wash:#183b40;--accent-edge:#417e83}
body{transition:background-color .3s,color .3s}
.worlds{gap:12px;border:0;margin-top:8px;align-items:stretch}
.worlds button[data-world]{--metal:#c5d4e0;--metal-rgb:164,191,214;--metal-dark:#27333f;--title-light:#f3f6fa;--title-mid:#aabccc;--title-shadow:#4c6273;--plaque-bg:#151c24;border:1px solid #46525d;background:linear-gradient(135deg,rgba(var(--metal-rgb),.13),transparent 55%),var(--plaque-bg);padding:24px 26px 21px;overflow:hidden;isolation:isolate;transition:border-color .25s,box-shadow .25s,background .25s,transform .25s;min-height:211px}
.worlds button[data-world="aos"]{--metal:#dfbc78;--metal-rgb:213,166,87;--metal-dark:#37291b;--title-light:#fff0c9;--title-mid:#ca9d57;--title-shadow:#795026;--plaque-bg:#211a13;border-color:#5b4931}
.worlds button[data-world="old"]{--metal:#83c8c9;--metal-rgb:86,172,177;--metal-dark:#16383c;--title-light:#d6f4ef;--title-mid:#76b6bc;--title-shadow:#31626b;--plaque-bg:#112327;border-color:#31575d}
.worlds button[data-world]::before{content:'';position:absolute;inset:5px;border:1px solid rgba(var(--metal-rgb),.15);pointer-events:none;z-index:-1}
.worlds button[data-world]::after{content:'';position:absolute;top:0;right:0;width:90px;height:90px;background:repeating-linear-gradient(135deg,transparent 0 8px,rgba(var(--metal-rgb),.07) 8px 9px);mask-image:linear-gradient(225deg,#000,transparent 75%);pointer-events:none}
.worlds button[data-world]:hover{border-color:var(--metal);transform:translateY(-3px);box-shadow:0 8px 25px #0004}
.worlds button[data-world].selected{background:linear-gradient(135deg,rgba(var(--metal-rgb),.23),transparent 65%),var(--plaque-bg);border-color:var(--metal);box-shadow:inset 0 -3px var(--metal),0 0 28px rgba(var(--metal-rgb),.08)}
.worlds button[data-world] small{color:var(--metal);font-size:8px;letter-spacing:1.7px;display:block;opacity:.8}
.worlds .setting-title{height:108px;display:flex;flex-direction:column;justify-content:center;margin:5px 0 9px;position:relative;line-height:1}
.worlds .setting-title>span{display:block;color:var(--metal);font:600 10px/1.3 'Barlow Condensed',sans-serif;letter-spacing:5px;padding-left:3px}
.worlds .setting-title em{display:block;font-style:normal;background:linear-gradient(180deg,var(--title-light) 10%,var(--title-mid) 60%,var(--title-light) 67%,var(--title-shadow) 100%);color:var(--metal);background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;filter:drop-shadow(0 2px 1px #000);white-space:nowrap}
.worlds .setting-title-40k em{font:700 clamp(38px,4.6vw,68px)/1 'Barlow Condensed',sans-serif;letter-spacing:3px}
.worlds .setting-title-aos em{font:700 clamp(24px,3vw,43px)/1.15 'Barlow Condensed',sans-serif;letter-spacing:.6px}
.worlds .setting-title-aos i{font:italic 17px Georgia,serif;vertical-align:3px}
.worlds .setting-title-old em{font:600 clamp(21px,2.5vw,36px)/1.25 Georgia,serif;letter-spacing:-1.4px}
.worlds .setting-description{padding-top:13px;border-top:1px solid rgba(var(--metal-rgb),.25);font-size:10px;color:#b5c0c0}
.worlds .setting-description b{color:var(--metal)}
.filters button.active,.heart.on,.profile-actions button,.profile-actions a{background:var(--accent-wash);border-color:var(--accent-edge)}
.gallery-navigation button:hover:not(:disabled){background:var(--accent-wash)}
.closing{background:radial-gradient(ellipse at center,rgba(var(--accent-rgb),.1),var(--bg) 70%)}
dialog{border-color:var(--accent-edge)}
.unit-role{border-color:var(--accent-edge)}
.inspector-badge{border-color:var(--accent-edge);color:var(--gold)}
@media(max-width:900px){.worlds{gap:8px}.worlds button[data-world]{padding:20px 16px}.worlds .setting-description{min-height:42px;line-height:1.6}.worlds .setting-title>span{letter-spacing:3px}}
@media(max-width:560px){.worlds{gap:10px}.worlds button[data-world]{min-height:0;padding:18px 22px}.worlds .setting-title{height:87px;margin:5px 0}.worlds .setting-title-40k em{font-size:55px}.worlds .setting-title-aos em{font-size:37px}.worlds .setting-title-old em{font-size:31px}.worlds .setting-description{min-height:0}.worlds button[data-world].selected{box-shadow:inset 3px 0 var(--metal)}}
@media(prefers-reduced-motion:reduce){body,.worlds button[data-world]{transition:none}}


/* Continuous faction rails replace paged groups. */
.faction-section{container-type:inline-size;min-width:0}
.rail-hint{flex:none;font-size:9px;letter-spacing:1.4px;color:var(--gold);border-bottom:1px solid var(--accent-edge);padding:10px 0;white-space:nowrap}
.rail-hint>span:last-child{font-size:19px;vertical-align:-2px;margin-left:12px}.swipe-rail-hint{display:none}
.faction-row{overflow-x:auto;overflow-y:hidden;padding-bottom:18px;scrollbar-width:thin;scrollbar-color:var(--gold) var(--panel);overscroll-behavior-x:contain;scroll-behavior:auto;max-width:100%;touch-action:pan-x pan-y}
.faction-row::-webkit-scrollbar{height:11px}.faction-row::-webkit-scrollbar-track{background:var(--panel);border:1px solid var(--line);border-radius:9px}.faction-row::-webkit-scrollbar-thumb{background:var(--accent-edge);border:2px solid var(--panel);border-radius:9px}.faction-row::-webkit-scrollbar-thumb:hover{background:var(--gold)}
#grid .faction-row.is-scrollable{--expanded-width:clamp(270px,29cqw,390px);--collapsed-width:max(100px,calc((100cqw - var(--expanded-width) - 54px)/5.5));cursor:grab}
#grid .is-scrollable .card{flex:0 0 var(--collapsed-width);transition:flex-basis .35s ease,border-color .25s}
#grid .is-scrollable .card.expanded{flex:0 0 var(--expanded-width)}
#grid .is-scrollable .card-main{cursor:grab}
#grid .is-dragging,#grid .is-dragging .card-main{cursor:grabbing}
#grid .is-dragging .card{transition:none}
.faction-row,.faction-row img{user-select:none;-webkit-user-select:none}
@media(min-width:641px){#grid .faction-row:not(.is-scrollable) .card{flex:1 1 0}#grid .faction-row:not(.is-scrollable) .card.expanded{flex:3.25 1 0}}
@media(max-width:900px) and (min-width:641px){#grid .faction-row.is-scrollable{--expanded-width:280px;--collapsed-width:110px}}
@media(max-width:640px){.rail-hint{font-size:8px;letter-spacing:.7px}.rail-hint>span:last-child{margin-left:5px}.drag-hint{display:none}.swipe-rail-hint{display:inline}#grid .faction-row .card,#grid .faction-row .card.expanded,#grid .faction-row.is-scrollable .card,#grid .faction-row.is-scrollable .card.expanded{flex:0 0 min(76vw,290px)}.faction-row{scroll-snap-type:x proximity;padding-bottom:18px}.faction-row .card{scroll-snap-align:start}}
/* Small, decorative worlds behind the title plaques. */
.worlds .world-atmosphere{position:absolute;inset:0;z-index:0;overflow:hidden;pointer-events:none;display:block;contain:strict}
.worlds button>small,.worlds button>.setting-title,.worlds button>.setting-description{position:relative;z-index:2}
.worlds .world-atmosphere>span,.worlds .world-atmosphere>i{position:absolute;display:block;margin:0;pointer-events:none;animation-play-state:paused!important}
.worlds button[data-fx-active="true"]:is(.selected,:hover,:focus-visible) .world-atmosphere>span,.worlds button[data-fx-active="true"]:is(.selected,:hover,:focus-visible) .world-atmosphere>i{animation-play-state:running!important}
.worlds .atmosphere-space{background:radial-gradient(ellipse at 90% 10%,#27385c55,transparent 65%),linear-gradient(135deg,#02060e55,transparent 75%)}
.worlds .nebula{inset:-45%;background:radial-gradient(ellipse at 68% 44%,#6787a644,transparent 35%),radial-gradient(ellipse at 40% 64%,#664c9c33,transparent 32%);animation:nebula-drift 24s ease-in-out infinite alternate;filter:blur(12px)}
.worlds .star{left:var(--x);top:var(--y);width:var(--size);height:var(--size);border-radius:50%;background:#e0edff;box-shadow:0 0 5px #bdd6ff88;opacity:.45;transform:none;animation:star-twinkle .68s linear var(--delay) infinite}
.worlds .star:nth-of-type(5n){box-shadow:0 0 8px 1px #badbff66;opacity:.7}
.worlds .space-horizon{width:220px;height:220px;border-radius:50%;right:-110px;bottom:-175px;box-shadow:0 -2px 20px #719dca33;border-top:1px solid #779ec955;transform:rotate(-25deg)}
.worlds .atmosphere-embers{background:radial-gradient(ellipse at 75% 120%,#be451b26,transparent 70%)}
.worlds .ember-glow{inset:25% -15% -70%;background:radial-gradient(ellipse at center,#e283283d,transparent 64%);animation:forge-breath 7s ease-in-out infinite alternate}
.worlds .ember{left:var(--x);bottom:-10px;width:var(--size);height:calc(var(--size)*1.8);border-radius:50%;background:#ffc66d;box-shadow:0 0 5px #f97c31,0 0 10px #df4c1744;animation:ember-rise var(--duration) linear var(--delay) infinite;opacity:0}
.worlds .ember:nth-of-type(3n){background:#ec9149;box-shadow:0 0 4px #ef6c39}
.worlds .atmosphere-wind{background:radial-gradient(ellipse at 5% 80%,#76d2cc16,transparent 70%)}
.worlds .wind-mist{inset:-50%;background:radial-gradient(ellipse at 15% 45%,#b4efeb16,transparent 48%),radial-gradient(ellipse at 75% 65%,#71c4ca1c,transparent 40%);animation:wind-mist 18s ease-in-out infinite alternate;filter:blur(12px)}
.worlds .wind-trail{left:-65%;width:110%;height:44%;border-top:3px solid #cdf7efcc;border-radius:50%;opacity:0;mask-image:linear-gradient(90deg,transparent,#000 40%,transparent);filter:drop-shadow(0 0 3px #c2f5ec55);animation:wind-cross 6.5s linear infinite}
.worlds .wind-one{top:22%;transform:rotate(-8deg);animation-delay:-3s}
.worlds .wind-two{top:62%;width:120%;height:29%;border-color:#c4f1ecaa;animation-duration:8.5s;animation-delay:-8s}
.worlds .wind-three{top:43%;width:95%;height:60%;border-color:#b4e8eacc;animation-duration:7.5s;animation-delay:-6s}
.worlds .wind-mote{width:var(--size);height:var(--size);left:var(--x);top:var(--y);background:#bfebe4;border-radius:50%;opacity:.18;animation:wind-dust var(--duration) ease-in-out var(--delay) infinite alternate}
@keyframes nebula-drift{from{transform:translate(-3%,-2%) rotate(-8deg);opacity:.45}to{transform:translate(7%,4%) rotate(8deg);opacity:.85}}
@keyframes star-drift{from{transform:translate(-8px,10px)}to{transform:translate(14px,-12px)}}
@keyframes star-twinkle{0%,100%{opacity:.42}14%{opacity:.9}25%{opacity:.58}31%{opacity:1}46%{opacity:.7}63%{opacity:.94}74%{opacity:.45}83%{opacity:.82}92%{opacity:.6}}
.worlds .star:nth-of-type(3n){animation-duration:.47s}.worlds .star:nth-of-type(4n){animation-duration:.83s}.worlds .star:nth-of-type(5n){animation-duration:.59s}
@keyframes forge-breath{from{transform:translate(-4%,3%) scale(.95);opacity:.5}to{transform:translate(4%,-3%) scale(1.08);opacity:.9}}
@keyframes ember-rise{0%{transform:translate(0,0) rotate(25deg);opacity:0}12%{opacity:.8}38%{transform:translate(calc(var(--wind)*.34),-85px) rotate(48deg)}70%{transform:translate(calc(var(--wind)*.72),-165px) rotate(28deg);opacity:.5}100%{transform:translate(var(--wind),-245px) rotate(55deg);opacity:0}}
@keyframes wind-cross{0%{translate:0 8px;opacity:0}12%{opacity:.7}70%{opacity:.55}100%{translate:165% -18px;opacity:0}}
@keyframes wind-mist{from{transform:translateX(-9%) rotate(-6deg)}to{transform:translateX(9%) rotate(5deg)}}
@keyframes wind-dust{from{transform:translate(-16px,5px);opacity:.1}to{transform:translate(32px,-8px);opacity:.35}}
@media(prefers-reduced-motion:reduce){.worlds .world-atmosphere>span,.worlds .world-atmosphere>i{animation:none!important}.worlds .ember{bottom:var(--y);opacity:.3}.worlds .wind-trail{left:4%;opacity:.2;translate:0 0}.worlds .wind-two{left:24%}}


/* A rare fast streak crosses the otherwise slow star field. */
.worlds .shooting-star{left:-110px;top:12%;width:100px;height:1.5px;border-radius:50%;background:linear-gradient(90deg,transparent,#bddbff88 65%,#fff);box-shadow:3px 0 6px #badbff66;transform-origin:right center;opacity:0;animation:meteor-cross 17s linear -12s infinite}
.worlds .shooting-star::after{content:'';position:absolute;right:0;top:-1px;width:3px;height:3px;border-radius:50%;background:#eff8ff;box-shadow:0 0 6px #c8eaff}
@keyframes meteor-cross{0%,72.9%{transform:translate(0,-18px) rotate(16deg);opacity:0}73.2%{opacity:.9}76%{opacity:.85}78%{transform:translate(650px,165px) rotate(16deg);opacity:0}100%{transform:translate(650px,165px) rotate(16deg);opacity:0}}

/* Soft overlapping banks of fog, without drawn wind ribbons or particles. */
.worlds .atmosphere-fog{background:radial-gradient(ellipse at 15% 100%,#93cbc718,transparent 75%)}
.worlds .fog-bank{left:-45%;width:180%;height:140%;top:-15%;background:radial-gradient(ellipse at 20% 65%,#bcd8d244,transparent 35%),radial-gradient(ellipse at 46% 54%,#bcd8d233,transparent 31%),radial-gradient(ellipse at 75% 65%,#d8e8df3d,transparent 36%);filter:blur(15px);opacity:0;animation:fog-pass 19s linear -8s infinite}
.worlds .fog-middle{top:-40%;height:155%;background:radial-gradient(ellipse at 25% 52%,#c6dfd82b,transparent 31%),radial-gradient(ellipse at 65% 40%,#c1ded436,transparent 38%);filter:blur(20px);animation-duration:25s;animation-delay:-19s}
.worlds .fog-far{top:22%;height:100%;background:radial-gradient(ellipse at 28% 60%,#d8e9e244,transparent 40%),radial-gradient(ellipse at 72% 60%,#a2cdc33d,transparent 38%);filter:blur(12px);animation-duration:15s;animation-delay:-4s}
@keyframes fog-pass{0%{transform:translate(-25%,4%);opacity:0}20%{opacity:.6}55%{transform:translate(4%,-3%);opacity:.85}80%{opacity:.55}100%{transform:translate(29%,2%);opacity:0}}
@media(prefers-reduced-motion:reduce){.worlds .fog-bank{animation:none!important;opacity:.45;transform:none}}

/* A mixture of constant stars, quick scintillation and slow faint shimmer. */
.worlds .world-atmosphere .star{animation-name:var(--star-pattern,star-twinkle);animation-duration:var(--star-cycle,.68s);opacity:var(--star-rest,.5)}
@keyframes star-shimmer{0%,100%{opacity:.48}18%{opacity:.7}43%{opacity:.52}62%{opacity:.85}79%{opacity:.62}}
.worlds .ember{animation-name:var(--ember-path,ember-rise)}
@keyframes ember-gust{0%{transform:translate(0,0) rotate(15deg);opacity:0}15%{opacity:.85}22%{transform:translate(calc(var(--wind)*.12),-38px) rotate(35deg)}45%{transform:translate(calc(var(--wind)*.6),-92px) rotate(75deg)}64%{transform:translate(calc(var(--wind)*.64),-142px) rotate(30deg);opacity:.65}100%{transform:translate(var(--wind),-245px) rotate(65deg);opacity:0}}
@keyframes ember-tumble{0%{transform:translate(0,0) rotate(10deg);opacity:0}12%{opacity:.75}28%{transform:translate(calc(var(--wind)*.22),-50px) rotate(60deg)}45%{transform:translate(calc(var(--wind)*.18),-98px) rotate(-20deg)}72%{transform:translate(calc(var(--wind)*.78),-163px) rotate(70deg);opacity:.6}100%{transform:translate(var(--wind),-245px) rotate(25deg);opacity:0}}
@keyframes ember-lift{0%{transform:translate(0,0) rotate(15deg);opacity:0}13%{opacity:.7}40%{transform:translate(calc(var(--wind)*.14),-105px) rotate(30deg)}67%{transform:translate(calc(var(--wind)*.65),-149px) rotate(65deg);opacity:.5}100%{transform:translate(var(--wind),-245px) rotate(40deg);opacity:0}}
/* Sparse dust crosses the fog horizontally, with a slight uneven lift. */
.worlds .fog-dust{left:-8%;top:var(--dust-y);width:var(--dust-size);height:var(--dust-size);border-radius:50%;background:#d5dcd1;box-shadow:0 0 3px #d7e8dc44;opacity:0;animation:fog-dust-cross var(--dust-time) linear var(--dust-delay) infinite}
@keyframes fog-dust-cross{0%{transform:translate(0,0);opacity:0}14%{opacity:.38}45%{transform:translate(175px,calc(var(--dust-rise)*.6));opacity:.5}78%{opacity:.32}100%{transform:translate(510px,var(--dust-rise));opacity:0}}
@media(prefers-reduced-motion:reduce){.worlds .fog-dust{animation:none!important;left:45%;opacity:0}}

/* Lead directly from the settings into the armies. */
#atlas{padding-top:28px}
#grid>.faction-section:first-child>.row-heading{margin-top:0;padding-top:0;border-top:0}
.header-search{margin-left:auto;margin-right:22px;border-bottom:1px solid var(--line);width:clamp(180px,24vw,290px)}
.header-search input{width:100%;min-width:0;padding:11px 0;font-size:12px}
header #saved[aria-pressed="true"]{border-color:var(--gold);background:var(--accent-wash);color:var(--gold)}
@media(max-width:640px){header{height:auto;min-height:75px;flex-wrap:wrap;gap:12px;padding-top:17px;padding-bottom:13px}.header-search{order:3;width:100%;margin:0;flex:1 0 100%;border-bottom:0}.header-search input{font-size:12px;padding:7px 0}.header-search>span{font-size:20px}header #saved{margin-left:auto}#atlas{padding-top:22px}}

/* Textured cloud bodies keep a softly broken silhouette instead of a flat wash. */
.worlds .fog-bank{background:url('atmosphere/fog-cloud.svg') center/100% 100% no-repeat;filter:none;left:-35%;width:170%;height:125%;top:-8%}
.worlds .fog-middle{top:-26%;height:115%;background-size:115% 100%;background-position:75% center;filter:none;opacity:.45}
.worlds .fog-far{top:26%;height:95%;background-size:90% 100%;background-position:20% center;filter:none}
.worlds .ember-field{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
/* Keep the setting choices in view and let lore inhabit its artwork. */
.worlds{scroll-margin-top:20px}
.profile-lore{position:relative;isolation:isolate;display:flex;align-items:center;min-height:470px;padding:44px 36px 86px;overflow:hidden;border:1px solid var(--line);gap:0}
.profile-lore .lore-illustration{position:absolute;inset:0;z-index:-2}
.profile-lore .lore-illustration>a{position:absolute;inset:0;border:0;background:none}
.profile-lore .lore-illustration img{width:100%;height:100%;max-height:none;object-fit:cover;object-position:center}
.profile-lore::after{content:'';position:absolute;inset:0;z-index:-1;pointer-events:none;background:linear-gradient(90deg,rgba(8,13,14,.96) 0%,rgba(8,13,14,.89) 32%,rgba(8,13,14,.65) 52%,rgba(8,13,14,.08) 78%),linear-gradient(0deg,rgba(8,13,14,.85),transparent 35%)}
.profile-lore .lore-text{width:56%;max-width:620px;text-shadow:0 1px 8px #0008}
.profile-lore .lore-text p{color:#e0e3dc}
.profile-lore .lore-illustration figcaption{position:absolute;bottom:20px;right:24px;max-width:38%;text-align:right;color:#e0e3dc;text-shadow:0 1px 5px #000}
.profile-lore .lore-illustration figcaption a{position:relative;z-index:2;display:inline-block;margin-left:12px;font-size:10px}
@media(max-width:740px){.profile-lore{min-height:560px;padding:170px 24px 80px;align-items:flex-end}.profile-lore .lore-text{width:100%;max-width:none}.profile-lore::after{background:linear-gradient(0deg,rgba(8,13,14,.97) 0%,rgba(8,13,14,.9) 40%,rgba(8,13,14,.6) 68%,rgba(8,13,14,.06) 100%)}.profile-lore .lore-illustration img{object-position:65% center}.profile-lore .lore-illustration figcaption{left:24px;right:24px;max-width:none;text-align:left;bottom:18px}}

/* Low horizons frame each setting without crowding its title. */
.worlds .setting-landscape{position:absolute;right:-2%;bottom:0;width:78%;height:49%;pointer-events:none;opacity:.9}
.worlds .landscape-citadel{width:76%;height:55%}
.worlds .fog-bank{top:8%}
.worlds .fog-middle{top:-10%}
.worlds .fog-far{top:42%}

.worlds .setting-planets{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;opacity:.85}

/* Preserve the tall proportions of the clock tower and its flanking spires. */
.worlds .landscape-citadel{width:68%;height:65%}

.support-atlas{margin:0;padding:36px 5%;display:flex;align-items:center;justify-content:space-between;gap:32px;border-top:1px solid var(--line);background:linear-gradient(110deg,var(--accent-soft),transparent 75%)}.support-atlas .eyebrow{font-size:9px;letter-spacing:1.7px;color:var(--gold)}.support-atlas h2{font:500 31px 'Barlow Condensed',sans-serif;text-transform:uppercase;margin:10px 0}.support-atlas p{max-width:580px;color:var(--muted);font-size:12px;line-height:1.8;margin:0}.support-action{flex-shrink:0;text-align:center}.support-action button{padding:14px 22px;background:var(--accent-soft);border:1px solid var(--accent-edge);color:var(--gold);font:inherit;font-size:12px}.support-action button:disabled{opacity:.65;cursor:default}.support-action small{display:block;font-size:10px;line-height:1.6;color:var(--muted);margin-top:10px}@media(max-width:740px){.support-atlas{flex-direction:column;align-items:flex-start;padding:30px 5%;gap:22px}.support-action{text-align:left}}

.support-action .donation-link{display:inline-block;padding:14px 22px;background:var(--accent-soft);border:1px solid var(--accent-edge);color:var(--gold);font-size:12px;text-decoration:none;transition:background .2s,border-color .2s}.support-action .donation-link:hover{background:var(--accent-edge);border-color:var(--gold)}.support-action .donation-link:focus-visible{outline:2px solid var(--gold);outline-offset:4px}

.profile-lore .lore-illustration img{object-position:var(--lore-focus,center)}

.profile-lore .lore-illustration img{width:var(--lore-width,100%);margin-left:auto}@media(max-width:740px){.profile-lore .lore-illustration img{width:100%}}

.profile-lore .lore-text{width:var(--lore-text-width,56%)}@media(max-width:740px){.profile-lore .lore-text{width:100%}}
