/* One phase clock and weather source: atmosphere.js owns the data attributes. */
:root, :root[data-daynight=night] {
  color-scheme:dark; --bg:#0b0709; --surface:#140d12; --surface-raised:#1c1219;
  --ink:#f2ece4; --muted:#bdb5ac; --line:#f2ece4;
  --neon-pink:#ff2bd6; --neon-cyan:#00f0ff; --neon-yellow:#f5ff00; --neon-green:#39ff6a;
  --accent:var(--neon-cyan); --accent-soft:#20232a; --accent-rgb:0,240,255; --amber:#f5ff00;
  --tape-bg:var(--neon-yellow); --tape-ink:#0b0709; --glow:1;
  --rain-color:rgba(190,225,255,.42); --rain-secondary:rgba(255,180,240,.28); --snow-color:#ded8e0; --fog-color:rgba(210,215,230,.26);
}
:root[data-daynight=dusk] {
  color-scheme:dark; --bg:#1a0f1c; --surface:#241526; --surface-raised:#2e1b30;
  --ink:#ffefe2; --muted:#d7bfb4; --line:#ffefe2;
  --neon-pink:#ff4fd8; --neon-cyan:#5ef2ff; --neon-yellow:#ffb347; --neon-green:#6bff8e;
  --accent:var(--neon-cyan); --accent-soft:#38263b; --accent-rgb:94,242,255; --amber:#ffb347;
  --tape-bg:var(--neon-yellow); --tape-ink:#0b0709; --glow:1;
}
:root[data-daynight=day] {
  color-scheme:light; --bg:#eae4d8; --surface:#f7f3ea; --surface-raised:#fff;
  --ink:#0b0709; --muted:#4a423c; --line:#0b0709;
  --neon-pink:#bf008c; --neon-cyan:#006b7a; --neon-yellow:#f5ff00; --neon-green:#08702b;
  --accent:var(--neon-cyan); --accent-soft:#e0e7e4; --accent-rgb:0,107,122; --amber:#665000;
  --tape-bg:var(--neon-yellow); --tape-ink:#0b0709; --glow:0;
  --rain-color:rgba(34,64,82,.45); --rain-secondary:rgba(34,64,82,.24); --snow-color:#53515b; --fog-color:rgba(112,103,91,.25);
}
html body { background:var(--bg); }
html[data-daynight=dusk] body { background:linear-gradient(180deg,#ff603f40,#aa3c9640 35vh,transparent 85vh),var(--bg); }
/* Background effects never paint over the opaque application surfaces. */
body::before,html::before,html::after { content:""; position:fixed; inset:-8%; pointer-events:none; z-index:0; }
body::before,html::before { opacity:0; }
html[data-weather=cloud] body::before,html[data-weather=cloud]::before { opacity:.34; background:radial-gradient(ellipse at 20% 18%,#787183 0,transparent 50%); filter:blur(30px); animation:weather-drift 24s ease-in-out infinite alternate; }
html[data-weather=cloud]::before { background:radial-gradient(ellipse at 80% 38%,#787183 0,transparent 48%); animation-duration:30s; animation-direction:alternate-reverse; }
html[data-weather=rain] body::before,html[data-weather=storm] body::before { opacity:1; background:repeating-linear-gradient(98deg,transparent 0 26px,var(--rain-color) 26px 27px); mask-image:repeating-linear-gradient(180deg,#000 0 26px,transparent 26px 84px); animation:weather-rain .32s linear infinite; }
html[data-weather=rain]::before,html[data-weather=storm]::before { opacity:1; background:repeating-linear-gradient(97deg,transparent 0 41px,var(--rain-secondary) 41px 42px); mask-image:repeating-linear-gradient(180deg,#000 0 40px,transparent 40px 130px); animation:weather-rain-back .46s linear infinite; }
html[data-weather=storm] body::before { background:repeating-linear-gradient(98deg,transparent 0 18px,var(--rain-color) 18px 19px); animation-duration:.2s; }
html[data-weather=storm]::before { animation-duration:.3s; }
html::after { opacity:0; }
html[data-weather=storm]::after { background:#d8ecff; mix-blend-mode:screen; animation:weather-flash 6s linear infinite; }
html[data-weather=storm] body { background-image:linear-gradient(#080e1c61,#080e1c61); }
html[data-weather=snow] body::before { opacity:.75; background-image:radial-gradient(circle at 20px 30px,var(--snow-color) 0 2px,transparent 3px),radial-gradient(circle at 90px 120px,var(--snow-color) 0 1px,transparent 2px),radial-gradient(circle at 150px 60px,var(--snow-color) 0 2px,transparent 3px),radial-gradient(circle at 60px 170px,var(--snow-color) 0 1px,transparent 2px); background-size:200px 200px; animation:weather-snow 6s linear infinite; }
html[data-weather=snow]::before { opacity:.6; background-image:radial-gradient(circle at 40px 60px,var(--snow-color) 0 3px,transparent 4px),radial-gradient(circle at 220px 200px,var(--snow-color) 0 2px,transparent 3px),radial-gradient(circle at 280px 40px,var(--snow-color) 0 2px,transparent 3px); background-size:320px 320px; animation:weather-snow-back 11s linear infinite; }
html[data-weather=fog] body::before,html[data-weather=fog]::before { opacity:1; background:radial-gradient(ellipse at 25% 70%,var(--fog-color),transparent 65%),radial-gradient(ellipse at 75% 30%,var(--fog-color),transparent 60%); filter:blur(20px); animation:weather-drift 16s ease-in-out infinite alternate; }
html[data-weather=fog]::before { animation-duration:22s; animation-direction:alternate-reverse; }
html[data-daynight=day][data-weather=cloud] body::before,html[data-daynight=day][data-weather=cloud]::before { mix-blend-mode:multiply; }
html[data-daynight=day][data-weather=storm]::after { animation-name:weather-flash-day; }
html[data-daynight=day][data-weather=storm] body { background-image:linear-gradient(#080e1c20,#080e1c20); }
body>main,body>header,body>footer,body>aside { position:relative; z-index:1; }
html body.market>aside { position:fixed; background:var(--bg); }
.atmosphere-panel { margin:20px 0; border:2px solid var(--line); border-radius:0; background:var(--surface); padding:12px 16px; font-size:12px; box-shadow:4px 4px 0 var(--neon-cyan); }
.atmosphere-panel summary { cursor:pointer; color:var(--ink); font:11px/1.9 var(--mono); min-height:44px; display:list-item; padding:10px 0; }
.atmosphere-panel summary span { color:var(--muted); }
.atmosphere-controls { display:flex; align-items:end; flex-wrap:wrap; gap:12px; padding-top:8px; }
.atmosphere-controls label { display:grid; gap:6px; margin:0; font-size:11px; flex:1 1 150px; }
.atmosphere-controls select { width:100%; padding:8px; font-size:12px; }
.atmosphere-controls .atmosphere-check { display:flex; align-items:center; gap:8px; padding:10px 0; min-height:44px; }
.atmosphere-check input { width:18px; height:18px; min-height:0; margin:0; }
.atmosphere-controls button { padding:12px; font-size:10px; }
.atmosphere-panel p { margin:10px 0 0; font-size:11px; line-height:1.8; color:var(--muted); }
.atmosphere-panel .atmosphere-explanation,.atmosphere-panel .atmosphere-attribution { font-size:10px; }
@keyframes weather-rain { to { mask-position:0 84px; } }
@keyframes weather-rain-back { to { mask-position:0 130px; } }
@keyframes weather-snow { to { background-position:60px 200px; } }
@keyframes weather-snow-back { to { background-position:-80px 320px; } }
@keyframes weather-drift { from { transform:translateX(-6%); } to { transform:translateX(6%); } }
@keyframes weather-flash { 0%,86%,92%,100% { opacity:0; } 87% { opacity:.45; } 88% { opacity:.04; } 89.5% { opacity:.6; } }
@keyframes weather-flash-day { 0%,86%,92%,100% { opacity:0; } 87% { opacity:.15; } 88% { opacity:.02; } 89.5% { opacity:.22; } }
@media(max-width:760px) { html body.market>aside { position:relative; } .atmosphere-controls { align-items:stretch; } .atmosphere-controls label { flex-basis:100%; } }
@media(prefers-reduced-motion:reduce) { body::before,html::before,html::after { animation:none!important; } html[data-weather=storm]::after { opacity:0; } }
