/* Theme default atmospheres — layered CSS in place of the old bundled background videos.
   Sits at z-index:-2, the same depth as #backdrop-video, behind #vid-scrim and the UI.
   Hidden when the user attaches custom ART (body.aut-has-art) or on the solid VOID theme.
   Palettes match the existing theme colour tokens; names and accents are unchanged.
   html[data-aut-theme] and html[data-aut-atmosphere] cover the first paint (set in <head>) before body.theme-* is applied.
   AUTO/system resolves to day or night via data-aut-atmosphere from prefers-color-scheme. */

html{background-color:#000}

#theme-backdrop{
  position:fixed;inset:0;z-index:-2;pointer-events:none;
  background-color:#020a14;
  background-repeat:no-repeat;
  background-size:cover;
  transition:opacity .45s ease;
  overflow:hidden;
  /* DAY as the unthemed default so the layer is never a flat fill */
  background-image:
    radial-gradient(ellipse 90% 60% at 16% 8%, rgba(126,207,255,.28) 0%, transparent 58%),
    radial-gradient(ellipse 70% 50% at 88% 10%, rgba(191,80,255,.18) 0%, transparent 55%),
    radial-gradient(ellipse 80% 40% at 50% 100%, rgba(0,255,204,.14) 0%, transparent 60%),
    radial-gradient(ellipse 50% 30% at 70% 70%, rgba(0,136,255,.10) 0%, transparent 70%),
    linear-gradient(165deg,#07182c 0%,#020a14 40%,#0a1628 72%,#041018 100%);
}
#theme-backdrop::after{
  content:"";
  position:absolute;inset:0;pointer-events:none;
  opacity:.045;
  mix-blend-mode:overlay;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
  background-size:160px 160px;
}

body.aut-has-art #theme-backdrop,
html.aut-art-visible #theme-backdrop,
html[data-aut-theme="void"] #theme-backdrop,
html[data-aut-atmosphere="void"] #theme-backdrop,
body.theme-void #theme-backdrop{
  opacity:0!important;
  visibility:hidden!important;
  transition:none;
}

/* An empty #backdrop-video must never paint over the CSS atmosphere. */
#backdrop-video:not([src]){
  opacity:0!important;visibility:hidden!important;
}

/* DAY — frosted cyan / violet over deep navy */
html[data-aut-theme="day"] #theme-backdrop,
html[data-aut-atmosphere="day"] #theme-backdrop,
body.theme-day #theme-backdrop{
  background-color:#020a14;
  background-image:
    radial-gradient(ellipse 90% 60% at 16% 8%, rgba(126,207,255,.28) 0%, transparent 58%),
    radial-gradient(ellipse 70% 50% at 88% 10%, rgba(191,80,255,.18) 0%, transparent 55%),
    radial-gradient(ellipse 80% 40% at 50% 100%, rgba(0,255,204,.14) 0%, transparent 60%),
    radial-gradient(ellipse 50% 30% at 70% 70%, rgba(0,136,255,.10) 0%, transparent 70%),
    linear-gradient(165deg,#07182c 0%,#020a14 40%,#0a1628 72%,#041018 100%);
}

/* NIGHT — near-black indigo with neon violet bloom */
html[data-aut-atmosphere="night"] #theme-backdrop,
html[data-aut-theme="night"] #theme-backdrop,
body.theme-night #theme-backdrop{
  background-color:#06040f;
  background-image:
    radial-gradient(ellipse 70% 55% at 78% 12%, rgba(180,139,255,.32) 0%, transparent 58%),
    radial-gradient(ellipse 50% 40% at 12% 80%, rgba(123,79,255,.20) 0%, transparent 60%),
    radial-gradient(ellipse 40% 30% at 40% 30%, rgba(255,45,120,.10) 0%, transparent 65%),
    radial-gradient(ellipse 100% 45% at 50% 100%, rgba(20,8,40,.85) 0%, transparent 70%),
    linear-gradient(168deg,#0b0618 0%,#06040f 45%,#0d0820 100%);
}

/* STEALTH — dark alley, cold steel-blue shafts */
html[data-aut-atmosphere="stealth"] #theme-backdrop,
html[data-aut-theme="stealth"] #theme-backdrop,
body.theme-stealth #theme-backdrop{
  background-color:#03040a;
  background-image:
    linear-gradient(105deg, transparent 0%, rgba(74,136,204,.07) 36%, transparent 38%, transparent 62%, rgba(42,80,144,.10) 64%, transparent 78%),
    radial-gradient(ellipse 50% 80% at 8% 50%, rgba(74,136,204,.16) 0%, transparent 60%),
    radial-gradient(ellipse 40% 50% at 92% 20%, rgba(106,172,238,.10) 0%, transparent 55%),
    radial-gradient(ellipse 80% 40% at 50% 100%, rgba(8,12,24,.9) 0%, transparent 65%),
    linear-gradient(180deg,#07090f 0%,#03040a 48%,#050814 100%);
}

/* DEPARTURE — amber dusk, warm horizon */
html[data-aut-atmosphere="departure"] #theme-backdrop,
html[data-aut-theme="departure"] #theme-backdrop,
body.theme-departure #theme-backdrop{
  background-color:#0a0500;
  background-image:
    radial-gradient(ellipse 90% 45% at 50% 100%, rgba(255,157,74,.36) 0%, rgba(255,85,0,.12) 42%, transparent 70%),
    radial-gradient(ellipse 50% 30% at 78% 78%, rgba(255,60,60,.18) 0%, transparent 70%),
    radial-gradient(ellipse 40% 25% at 18% 70%, rgba(255,180,80,.12) 0%, transparent 70%),
    linear-gradient(180deg,#1a0a02 0%,#120800 38%,#2a1004 72%,#3a1606 100%);
}

/* ASH TREE — forest floor, bioluminescent green bloom */
html[data-aut-atmosphere="ashtree"] #theme-backdrop,
html[data-aut-theme="ashtree"] #theme-backdrop,
body.theme-ashtree #theme-backdrop{
  background-color:#010a04;
  background-image:
    radial-gradient(ellipse 40% 40% at 22% 78%, rgba(125,220,142,.26) 0%, transparent 60%),
    radial-gradient(ellipse 35% 30% at 78% 30%, rgba(168,230,61,.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 35% at 50% 100%, rgba(58,158,85,.22) 0%, transparent 65%),
    radial-gradient(ellipse 20% 50% at 48% 60%, rgba(80,220,100,.10) 0%, transparent 70%),
    linear-gradient(168deg,#04150a 0%,#010a04 42%,#040f06 100%);
}

/* ARIEL — desert night sky, sand-gold ground wash */
html[data-aut-atmosphere="ariel"] #theme-backdrop,
html[data-aut-theme="ariel"] #theme-backdrop,
body.theme-ariel #theme-backdrop{
  background-color:#081420;
  background-image:
    radial-gradient(ellipse 70% 40% at 50% 0%, rgba(126,200,232,.20) 0%, transparent 60%),
    radial-gradient(ellipse 90% 40% at 50% 100%, rgba(196,163,106,.28) 0%, rgba(196,163,106,.06) 50%, transparent 75%),
    radial-gradient(ellipse 30% 25% at 82% 18%, rgba(232,238,244,.10) 0%, transparent 70%),
    linear-gradient(180deg,#0c1a28 0%,#081420 48%,#1a1610 100%);
}

/* SKYBOARD — holographic HUD, icy cyan depth */
html[data-aut-atmosphere="skyboard"] #theme-backdrop,
html[data-aut-theme="skyboard"] #theme-backdrop,
body.theme-skyboard #theme-backdrop{
  background-color:#040c16;
  background-image:
    radial-gradient(ellipse 60% 50% at 70% 18%, rgba(95,212,255,.26) 0%, transparent 58%),
    radial-gradient(ellipse 45% 40% at 16% 70%, rgba(42,90,120,.28) 0%, transparent 60%),
    linear-gradient(115deg, transparent 0%, rgba(95,212,255,.06) 46%, transparent 48%, transparent 70%, rgba(95,212,255,.05) 72%, transparent 100%),
    radial-gradient(ellipse 80% 35% at 50% 100%, rgba(10,26,44,.9) 0%, transparent 70%),
    linear-gradient(165deg,#071422 0%,#040c16 40%,#0a1a2c 100%);
}

/* LOUNGE — low-lit warm amber pools */
html[data-aut-atmosphere="lounge"] #theme-backdrop,
html[data-aut-theme="lounge"] #theme-backdrop,
body.theme-lounge #theme-backdrop{
  background-color:#0a0604;
  background-image:
    radial-gradient(ellipse 55% 40% at 20% 82%, rgba(232,168,106,.28) 0%, transparent 62%),
    radial-gradient(ellipse 40% 30% at 84% 30%, rgba(232,168,106,.14) 0%, transparent 65%),
    radial-gradient(ellipse 30% 20% at 50% 50%, rgba(138,90,48,.12) 0%, transparent 70%),
    linear-gradient(180deg,#140c08 0%,#0a0604 45%,#1a1008 100%);
}

/* SUMMIT — icy alpine night, misted cyan peaks */
html[data-aut-atmosphere="summit"] #theme-backdrop,
html[data-aut-theme="summit"] #theme-backdrop,
body.theme-summit #theme-backdrop{
  background-color:#050a10;
  background-image:
    radial-gradient(ellipse 80% 35% at 50% 0%, rgba(238,251,255,.10) 0%, transparent 60%),
    radial-gradient(ellipse 50% 45% at 28% 100%, rgba(95,212,255,.22) 0%, transparent 60%),
    radial-gradient(ellipse 45% 40% at 78% 88%, rgba(58,143,196,.20) 0%, transparent 60%),
    radial-gradient(ellipse 20% 15% at 60% 42%, rgba(223,243,255,.08) 0%, transparent 70%),
    linear-gradient(180deg,#0a141c 0%,#050a10 40%,#0f1620 100%);
}
