html[data-season] body {
  background: var(--season-sky);
  background-attachment: fixed;
  background-size: 240% 240%;
  animation: season-drift 40s ease-in-out infinite alternate;
}

@keyframes season-drift {
  0% { background-position: 0% 20%; }
  50% { background-position: 70% 60%; }
  100% { background-position: 100% 0%; }
}

body[data-season="spring"] {
  --season-sky: linear-gradient(155deg, #2a1c2e 0%, #43243a 38%, #1e2e26 72%, #2b1f33 100%);
  --text: #fff0f6; --dim: #d9b3c6;
  --acc: #9be8b0; --acc2: #ff9ec7; --err: #ff7a91;
  --line: #4d3550; --card: rgba(45, 30, 46, .78);
  --season-inset: rgba(22, 13, 24, .72);
  --season-side: linear-gradient(180deg, #3a2433, #2a1c2b);
  --season-side-text: #ffd7e8;
  --season-bar: linear-gradient(90deg, #4a2a3e, #3a2433 60%, #2c2030);
  --season-glow: rgba(255, 158, 199, .28);
}

body[data-season="summer"] {
  --season-sky: linear-gradient(155deg, #04202c 0%, #0b3d4d 40%, #10423a 72%, #062a36 100%);
  --text: #eafcff; --dim: #9ed3e0;
  --acc: #ffd166; --acc2: #5fe3d2; --err: #ff8f6b;
  --line: #1d4f5b; --card: rgba(8, 36, 44, .78);
  --season-inset: rgba(4, 22, 28, .72);
  --season-side: linear-gradient(180deg, #0a2f3b, #08242e);
  --season-side-text: #d7fbff;
  --season-bar: linear-gradient(90deg, #0d3a46, #0a2f3b 60%, #08232c);
  --season-glow: rgba(255, 209, 102, .22);
}

body[data-season="autumn"] {
  --season-sky: linear-gradient(155deg, #2b1508 0%, #4b2510 38%, #2a1b0b 72%, #3a1d0c 100%);
  --text: #ffeedd; --dim: #d9a97f;
  --acc: #ffb347; --acc2: #ff8b5c; --err: #ff6b5b;
  --line: #5c361d; --card: rgba(46, 27, 14, .80);
  --season-inset: rgba(24, 13, 7, .75);
  --season-side: linear-gradient(180deg, #40230f, #2c190c);
  --season-side-text: #ffd9b3;
  --season-bar: linear-gradient(90deg, #4f2b12, #40230f 60%, #2e1b0c);
  --season-glow: rgba(255, 139, 92, .26);
}

body[data-season="winter"] {
  --season-sky: linear-gradient(155deg, #06111f 0%, #0f2438 40%, #0a1d2e 72%, #061321 100%);
  --text: #eaf4ff; --dim: #a8c3dc;
  --acc: #9fd8ff; --acc2: #c9e8ff; --err: #ff8f9b;
  --line: #233f59; --card: rgba(12, 28, 45, .82);
  --season-inset: rgba(7, 18, 30, .75);
  --season-side: linear-gradient(180deg, #0d2537, #0a1c2b);
  --season-side-text: #dbeaff;
  --season-bar: linear-gradient(90deg, #12314a, #0d2537 60%, #0a1a28);
  --season-glow: rgba(159, 216, 255, .24);
}

body[data-season] #app,
body[data-season] .ide { position: relative; z-index: 1; }

.season-fx {
  position: fixed; inset: 0; z-index: 0; overflow: hidden;
  pointer-events: none; contain: strict;
}
.season-fx .p {
  position: absolute; top: 0; left: var(--x);
  font-size: var(--size); line-height: 1;
  opacity: 0; will-change: transform, opacity;
  animation-duration: var(--dur);
  animation-delay: var(--delay);
  animation-iteration-count: infinite;
  animation-timing-function: linear;
}
.season-fx .p.fall { animation-name: season-fall; }
.season-fx .p.swing { animation-name: season-swing; }
.season-fx .p.rise { animation-name: season-rise; }

@keyframes season-fall {
  0% { transform: translate3d(0, -12vh, 0) rotate(0deg); opacity: 0; }
  8% { opacity: .9; }
  92% { opacity: .8; }
  100% { transform: translate3d(var(--drift), 108vh, 0) rotate(var(--rot)); opacity: 0; }
}
@keyframes season-swing {
  0% { transform: translate3d(0, -12vh, 0) rotate(0deg); opacity: 0; }
  10% { opacity: .95; }
  50% { transform: translate3d(calc(var(--drift) * -0.6), 50vh, 0) rotate(calc(var(--rot) * .5)); }
  90% { opacity: .85; }
  100% { transform: translate3d(var(--drift), 108vh, 0) rotate(var(--rot)); opacity: 0; }
}
@keyframes season-rise {
  0% { transform: translate3d(0, 108vh, 0) scale(.85); opacity: 0; }
  12% { opacity: .85; }
  50% { transform: translate3d(calc(var(--drift) * -0.7), 52vh, 0) scale(1); }
  88% { opacity: .75; }
  100% { transform: translate3d(var(--drift), -14vh, 0) scale(.9); opacity: 0; }
}

body[data-season]::after {
  content: ""; position: fixed; z-index: 0; pointer-events: none;
  width: 46vmax; height: 46vmax; border-radius: 50%;
  right: -12vmax; top: -14vmax;
  background: radial-gradient(circle, var(--season-glow), transparent 68%);
  animation: season-breathe 12s ease-in-out infinite alternate;
}
@keyframes season-breathe {
  from { transform: scale(1); opacity: .85; }
  to { transform: scale(1.18); opacity: .55; }
}

body[data-season] .card,
body[data-season] .modal { background: var(--card); border-color: var(--line); }
body[data-season] .modal-backdrop { background: rgba(2, 4, 8, .66); }
body[data-season] input,
body[data-season] .chatbox,
body[data-season] .hwrow,
body[data-season] .changelogbox,
body[data-season] .uncrow code,
body[data-season] .oshelp .cmdline,
body[data-season] .bar,
body[data-season] .chk,
body[data-season] .drop,
body[data-season] .btn:not(.primary):not(.update-btn) { background: var(--season-inset); }

body[data-season] .titlebar { background: var(--season-bar); border-bottom-color: rgba(0, 0, 0, .45); }
body[data-season] .sidebar { background: var(--season-side); border-right-color: rgba(0, 0, 0, .45); }
body[data-season] .tabs { background: var(--season-side); }
body[data-season] .brand,
body[data-season] .sidehead,
body[data-season] .sidetitle,
body[data-season] .tree .row,
body[data-season] .tree .row.dir .name { color: var(--season-side-text); }
body[data-season] .tree .row:hover { background: rgba(255, 255, 255, .07); }
body[data-season] .tree .row.active { background: rgba(255, 255, 255, .13); color: #fff; }
body[data-season] .statusbar { background: var(--season-bar); }
body[data-season] .sidebar .empty { color: var(--season-side-text); opacity: .7; }

@media (prefers-reduced-motion: reduce) {
  html[data-season] body,
  body[data-season]::after { animation: none !important; }
  .season-fx { display: none; }
}
