/* One main background for every website page and the Windows / Mac app (owner 2026-11-14). Static (stays while the page
   scrolls); the picture fills the whole window under the navigation
   bar; v3 below builds it from a dark centre layer and separate bull / bear side layers.
   The phone app (html.is-app) and the Control Panel keep their own look. The picture already holds the bull, bear and
   Earth, so the separate bull / bear / Earth layers are hidden on these pages. */
html:not(.is-app):has(body.cosmos:not(.control-page):not(.app-home)){--m1y-bg:url('assets/m1y-bg-1920.webp');--m1y-head:78px;background:#020806!important}
/* Navigation bar height per window size. Owner 2026-11-15: the background layers start at the very top (under the bar),
   so no black strip shows when the bar hides on scroll; only the world map is moved down by the bar height. */
@media (max-width:860px){html:not(.is-app){--m1y-head:62px}}
@media (min-width:861px) and (max-width:1079px){html:not(.is-app){--m1y-head:106px}}
@media (max-width:900px){html:not(.is-app):has(body.cosmos:not(.control-page):not(.app-home)){--m1y-bg:url('assets/m1y-bg-1280.webp')}}
@media (min-width:2000px),(min-width:1200px) and (min-resolution:1.5dppx){html:not(.is-app):has(body.cosmos:not(.control-page):not(.app-home)){--m1y-bg:url('assets/m1y-bg-3344.webp')}}
/* Owner 2026-11-15 (v4, "tieši kā bildē"): the background is the owner's reference picture taken apart into its art
   pieces (2× AI-upscaled): left strip (bull, gold, silver, oil, candles), right strip (bear, coins, candles), the gold
   world map at the top and the light grid floor at the bottom, over one continuous dark emerald / gold digital field (see below). Every art piece fades out softly at its inner
   edges, so there are no cut lines. The strips stand on the side
   edges at window height (natural proportions); map and floor span the width. Tuned on 1920 × 1080. */
html:not(.is-app):has(body.cosmos:not(.control-page):not(.app-home))::before,
html:not(.is-app):has(body.cosmos:not(.control-page):not(.app-home))::after{content:"";position:fixed;inset:0;z-index:-1;pointer-events:none;background-repeat:no-repeat}
/* One continuous environment (owner 2026-11-15, fix for the empty black middle on short pages): the map and the floor sit
   on a seamless dark emerald / gold digital field that fills the whole window at every size — fine gold grid, soft emerald
   and gold glows, faint light lines — so there is no gap between the map band, the content and the floor, however long
   or short the page is (the layer is fixed, so it is always behind what is on screen). Pure CSS: sharp on any DPI. */
html:not(.is-app):has(body.cosmos:not(.control-page):not(.app-home))::before{top:0;
 background-image:
  url('assets/ref-map-band-v2.webp'),
  url('assets/ref-floor-v2.webp'),
  radial-gradient(48% 40% at 50% 50%,rgba(2,7,5,.55),rgba(2,7,5,0) 100%),
  radial-gradient(60% 45% at 50% 0%,rgba(233,180,70,.10),transparent 70%),
  radial-gradient(70% 40% at 50% 100%,rgba(233,180,70,.12),rgba(47,224,138,.06) 50%,transparent 80%),
  radial-gradient(55% 70% at 18% 55%,rgba(16,92,58,.22),transparent 70%),
  radial-gradient(55% 70% at 82% 55%,rgba(16,92,58,.22),transparent 70%),
  repeating-linear-gradient(90deg,rgba(233,196,106,.045) 0 1px,transparent 1px 72px),
  repeating-linear-gradient(0deg,rgba(233,196,106,.035) 0 1px,transparent 1px 72px),
  linear-gradient(180deg,#04140e 0%,#030d09 45%,#041510 100%);
 background-size:min(80.7vw,2600px) auto,100% auto,100% 100%,100% 100%,100% 100%,100% 100%,100% 100%,auto,auto,100% 100%;
 background-position:center var(--m1y-head),center bottom,center,center,center,center,center,center top,center top,center}
html:not(.is-app):has(body.cosmos:not(.control-page):not(.app-home))::after{top:0;
 background-image:url('assets/ref-side-left-v2.webp'),url('assets/ref-side-right-v2.webp');background-size:auto calc(100% - var(--m1y-head)),auto calc(100% - var(--m1y-head));background-position:left bottom,right bottom}
@media (max-width:1499px){html:not(.is-app):has(body.cosmos:not(.control-page):not(.app-home))::after{opacity:.6}}
html:not(.is-app):not(#m1y) body.cosmos:not(.control-page):not(.app-home){background:transparent!important}
html:not(.is-app):not(#m1y) body.cosmos:not(.control-page):not(.app-home)::before,
html:not(.is-app):not(#m1y) body.cosmos:not(.control-page):not(.app-home)::after,
html:not(.is-app):not(#m1y) body.cosmos:not(.control-page):not(.app-home) .site-footer::before,
html:not(.is-app):not(#m1y) body.cosmos .mk-deco,
html:not(.is-app):not(#m1y) body.cosmos.home-page main.cosmos-home::before,
html:not(.is-app):not(#m1y) body.cosmos.home-page .cz-emblem{display:none!important}
/* Text straight on the picture stays readable. */
html:not(.is-app):not(#m1y) body.cosmos:not(.control-page):not(.app-home) main :is(p,small,li,label,time){text-shadow:0 1px 3px rgba(0,0,0,.9),0 0 12px rgba(0,0,0,.6)}
/* Gold gradient headings (transparent text) must never get a shadow — it would show through and dim them. */
