/* Shared layout; distinct environment art selected by faction AND operating domain. */
body[data-environment] { --scene-art:url("../../../assets/mow-my-world/environments/v2/human/space.jpg"); --scene-accent:#e7c77c; --scene-tint:15,26,42; --scene-panel:10,17,28; --scene-pattern:repeating-linear-gradient(90deg,transparent 0 110px,#e7c77c12 111px 112px); }
body[data-faction="bugvex"] { --scene-accent:#c2e85b; --scene-tint:29,47,15; --scene-panel:12,21,12; --scene-pattern:repeating-radial-gradient(ellipse at 110% 70%,transparent 0 55px,#c2e85b14 57px 58px,transparent 61px 100px); }
body[data-faction="cryvum"] { --scene-accent:#bca3ff; --scene-tint:41,25,68; --scene-panel:19,14,32; --scene-pattern:repeating-linear-gradient(60deg,transparent 0 95px,#bca3ff14 96px 97px),repeating-linear-gradient(-60deg,transparent 0 95px,#86ebef10 96px 97px); }
body[data-faction="other"] { --scene-accent:#ff819b; --scene-tint:64,22,48; --scene-panel:27,13,26; --scene-pattern:repeating-radial-gradient(ellipse at 90% 45%,transparent 0 80px,#ff819b15 81px 82px,transparent 84px 115px); }
body[data-faction="human"][data-domain="space"] { --scene-art:url("../../../assets/mow-my-world/environments/v2/human/space.jpg"); }
body[data-faction="human"][data-domain="ground"] { --scene-art:url("../../../assets/mow-my-world/environments/v2/human/ground.jpg"); }
body[data-faction="human"][data-domain="surface"] { --scene-art:url("../../../assets/mow-my-world/environments/v2/human/surface.jpg"); }
body[data-faction="human"][data-domain="underwater"] { --scene-art:url("../../../assets/mow-my-world/environments/v2/human/underwater.jpg"); }
body[data-faction="human"][data-domain="air"] { --scene-art:url("../../../assets/mow-my-world/environments/v2/human/air.jpg"); }
body[data-faction="bugvex"][data-domain="space"] { --scene-art:url("../../../assets/mow-my-world/environments/v2/bugvex/space.jpg"); }
body[data-faction="bugvex"][data-domain="ground"] { --scene-art:url("../../../assets/mow-my-world/environments/v2/bugvex/ground.jpg"); }
body[data-faction="bugvex"][data-domain="surface"] { --scene-art:url("../../../assets/mow-my-world/environments/v2/bugvex/surface.jpg"); }
body[data-faction="bugvex"][data-domain="underwater"] { --scene-art:url("../../../assets/mow-my-world/environments/v2/bugvex/underwater.jpg"); }
body[data-faction="bugvex"][data-domain="air"] { --scene-art:url("../../../assets/mow-my-world/environments/v2/bugvex/air.jpg"); }
body[data-faction="cryvum"][data-domain="space"] { --scene-art:url("../../../assets/mow-my-world/environments/v2/cryvum/space.jpg"); }
body[data-faction="cryvum"][data-domain="ground"] { --scene-art:url("../../../assets/mow-my-world/environments/v2/cryvum/ground.jpg"); }
body[data-faction="cryvum"][data-domain="surface"] { --scene-art:url("../../../assets/mow-my-world/environments/v2/cryvum/surface.jpg"); }
body[data-faction="cryvum"][data-domain="underwater"] { --scene-art:url("../../../assets/mow-my-world/environments/v2/cryvum/underwater.jpg"); }
body[data-faction="cryvum"][data-domain="air"] { --scene-art:url("../../../assets/mow-my-world/environments/v2/cryvum/air.jpg"); }
body[data-faction="other"][data-domain="space"] { --scene-art:url("../../../assets/mow-my-world/environments/v2/other/space.jpg"); }
body[data-faction="other"][data-domain="ground"] { --scene-art:url("../../../assets/mow-my-world/environments/v2/other/ground.jpg"); }
body[data-faction="other"][data-domain="surface"] { --scene-art:url("../../../assets/mow-my-world/environments/v2/other/surface.jpg"); }
body[data-faction="other"][data-domain="underwater"] { --scene-art:url("../../../assets/mow-my-world/environments/v2/other/underwater.jpg"); }
body[data-faction="other"][data-domain="air"] { --scene-art:url("../../../assets/mow-my-world/environments/v2/other/air.jpg"); }
body[data-environment="entry"] { background:linear-gradient(rgba(var(--scene-panel),.8),rgba(var(--scene-panel),.88)),var(--scene-art) center top / cover fixed; }
.entry-environment { display:flex;align-items:center;gap:15px;margin:0 0 28px;padding:0; }
.environment-eyebrow { display:block;color:var(--scene-accent);font:600 11px/1.5 system-ui,sans-serif;letter-spacing:.18em;text-transform:uppercase; }
.environment-emblem { width:48px;height:56px;object-fit:contain;filter:drop-shadow(0 3px 12px #000); }
.environment-choices { display:flex; flex-wrap:wrap; gap:8px;margin-top:10px; }
.environment-choices button { appearance:none; cursor:pointer; padding:8px 14px; border:1px solid #ffffff66; border-radius:3px; background:#07101dcc; color:#ecf1f8; font:500 12px/1.3 system-ui,sans-serif; }
.environment-choices button[aria-pressed="true"] { color:#0b1119; background:var(--scene-accent); border-color:var(--scene-accent); }
.environment-choices button:focus-visible { outline:2px solid white; outline-offset:4px; }
body[data-environment="entry"] > main { background:rgba(var(--scene-panel),.84); }
body[data-environment="entry"] > .hero { isolation:isolate; background:linear-gradient(90deg,rgba(var(--scene-panel),.90) 0%,rgba(var(--scene-panel),.68) 38%,rgba(var(--scene-panel),.52) 75%),var(--scene-art) center / cover; }
body[data-environment="entry"] > .hero::before { content:"";position:absolute;inset:0;z-index:0;pointer-events:none;background:var(--scene-pattern);opacity:.5; }
body[data-environment="entry"] > .hero::after { pointer-events:none;background:linear-gradient(0deg,rgb(var(--scene-panel)),transparent 25%); }
body[data-environment="entry"] .heroCopy { text-shadow:0 2px 18px #000; }
body[data-environment="entry"] .heroCopy > small { display:none; }
body[data-environment="entry"] .heroCopy h1 { margin-top:0; }
body.wiki-page[data-environment="directory"] .faction-environment-hero { min-height:480px; background:linear-gradient(90deg,rgba(var(--scene-tint),.88),rgba(var(--scene-tint),.38) 58%,rgba(var(--scene-tint),.1)),var(--scene-art) center / cover; }
body.wiki-page[data-environment="directory"] #directory { scroll-margin-top:110px; background:linear-gradient(180deg,rgba(var(--scene-panel),.42),rgba(var(--scene-panel),.97) 900px),var(--scene-art) center top / auto 1000px no-repeat, rgb(var(--scene-panel)); }
body.wiki-page[data-environment="directory"] .directory-controls { background:rgba(var(--scene-panel),.94); border:1px solid var(--theme-line); padding:22px; border-radius:8px; }
/* Keep the editorial copy and the original model view in separate readable columns. */
body[data-environment="entry"] > .hero { display:grid;grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr);gap:4%;padding:70px 5%;min-height:630px;align-items:center; }
body[data-environment="entry"] .heroCopy { grid-column:1;grid-row:1;width:auto;max-width:none;margin:0; }
body[data-environment="entry"] .heroCopy h1 { font-size:clamp(36px,4.4vw,68px); }
body[data-environment="entry"] .heroArt { position:relative;grid-column:2;grid-row:1;width:100%;height:auto;mask-image:none;border:1px solid #ffffff20;border-radius:10px;background:rgba(var(--scene-panel),.78);overflow:hidden;box-shadow:0 24px 70px #0006; }
body[data-environment="entry"] .heroArt img { display:block;width:100%;height:auto;object-fit:contain; }
@media(max-width:700px) {
 body[data-environment="entry"] > .hero { grid-template-columns:1fr;padding:34px 6% 45px;gap:26px;min-height:0; }
 body[data-environment="entry"] .heroCopy { grid-column:1;grid-row:1; }
 body[data-environment="entry"] .heroArt { grid-column:1;grid-row:2; }
 .entry-environment { margin-bottom:22px;gap:12px; }.environment-emblem { width:38px;height:44px; }.environment-eyebrow { font-size:10px; }
 body[data-environment="entry"] { background-attachment:scroll; }
 body[data-environment="entry"] > .hero { background:linear-gradient(0deg,rgba(var(--scene-panel),.95) 10%,rgba(var(--scene-panel),.82) 50%,rgba(var(--scene-panel),.55)),var(--scene-art) center top / auto 650px; }
 body.wiki-page[data-environment="directory"] .faction-environment-hero { min-height:430px; }
}
@media print { .environment-choices { display:none; }body[data-environment="entry"] .heroArt { mix-blend-mode:normal; } }

/* Civilization overview: framed emblem, environmental art, continuous backdrop. */
body.wiki-page[data-environment="directory"] .faction-hero-icon { box-sizing:border-box;width:160px;height:160px;padding:18px;border:2px solid var(--scene-accent);border-radius:50%;background:radial-gradient(circle,var(--theme-glow),rgb(var(--scene-panel)) 75%);box-shadow:0 0 0 7px #ffffff08,0 0 36px var(--theme-line),0 14px 36px #0008; }
body.wiki-page[data-environment="directory"] .wiki-faction-summary { position:relative;background:linear-gradient(180deg,rgba(var(--scene-panel),.96),rgba(var(--scene-panel),.78) 50%,rgb(var(--scene-panel))),var(--scene-art) center/cover;padding:70px 0; }
.faction-overview-grid { display:grid;grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr);gap:48px;align-items:center; }
.faction-overview-copy h2 { margin:0 0 24px;color:var(--theme-text);font-size:clamp(28px,3.4vw,44px);line-height:1.15;letter-spacing:-.035em; }
.faction-overview-copy .wiki-copy { color:var(--theme-muted);line-height:1.8; }
.faction-overview-art { aspect-ratio:16/10;border:1px solid var(--theme-line);border-radius:12px;background:linear-gradient(0deg,rgba(var(--scene-panel),.28),transparent 55%),var(--scene-art) center/cover;box-shadow:0 20px 55px #0005; }
body.wiki-page[data-environment="directory"] #directory { background:linear-gradient(180deg,rgb(var(--scene-panel)),rgba(var(--scene-panel),.72) 260px,rgba(var(--scene-panel),.97) 900px),var(--scene-art) center top / auto 1000px no-repeat,rgb(var(--scene-panel)); }
@media(max-width:760px) { .faction-overview-grid { grid-template-columns:minmax(0,1fr);gap:28px; } body.wiki-page[data-environment="directory"] .wiki-faction-summary { padding:48px 0; } body.wiki-page[data-environment="directory"] .faction-hero-icon { width:118px;height:118px;padding:14px; } }

body[data-faction="human"] { --civilization-art:url("../../../assets/mow-my-world/civilizations/v1/human.jpg"); }

body[data-faction="bugvex"] { --civilization-art:url("../../../assets/mow-my-world/civilizations/v1/bugvex.jpg"); }

body[data-faction="cryvum"] { --civilization-art:url("../../../assets/mow-my-world/civilizations/v1/cryvum.jpg"); }

body[data-faction="other"] { --civilization-art:url("../../../assets/mow-my-world/civilizations/v1/other.jpg"); }

body.wiki-page[data-environment="directory"] .faction-hero-icon { border:1px solid var(--theme-line);border-radius:20px;padding:22px;background:linear-gradient(145deg,rgba(var(--scene-panel),.92),rgba(var(--scene-panel),.72));box-shadow:inset 0 1px #ffffff14,0 12px 30px #0004;filter:none; }
body.wiki-page[data-environment="directory"] .wiki-faction-summary { background:linear-gradient(180deg,rgba(var(--scene-panel),.97),rgba(var(--scene-panel),.84) 50%,rgb(var(--scene-panel))),var(--civilization-art) center/cover; }
body.wiki-page[data-environment="directory"] .faction-overview-art { background:var(--civilization-art) center/cover; }
@media(max-width:760px) { body.wiki-page[data-environment="directory"] .faction-hero-icon { padding:16px;border-radius:16px; } }
