/* Halloween week (19 October to 1 November), switched on by the head script
   with html[data-season="halloween"]. Out of season nothing here applies.
   Every colour comes from the pixel engine palette. */
html[data-season="halloween"] {
  --band-1: #0b0a18;
  --band-2: #170b2e;
  --band-3: #2c1656;
  --band-4: #170b2e;
  --trees: #0a0a12;
  --orb: #ff9a4a;
  --orb-halo: #ffd09a;
  --orb-mark: #e8662a;
}

/* The harvest moon: the same pixel disc, twice the size, low and orange. */
html[data-season="halloween"] .moon { top: 9vh; right: 9vw; width: 96px; height: 96px; }
html[data-season="halloween"] .moon::before { inset: -64px; opacity: 0.55; }
html[data-season="halloween"] .moon::after {
  background:
    linear-gradient(var(--orb-mark) 0 0) 24px 28px / 8px 8px no-repeat,
    linear-gradient(var(--orb-mark) 0 0) 56px 52px / 16px 8px no-repeat,
    linear-gradient(var(--orb-mark) 0 0) 40px 72px / 8px 8px no-repeat,
    linear-gradient(var(--orb-mark) 0 0) 64px 24px / 4px 4px no-repeat,
    var(--orb);
}
/* Luna 3's flag stays planted on the bigger moon. */
html[data-season="halloween"] .moon-fact { top: 9vh; right: 9vw; width: 96px; height: 96px; }
html[data-season="halloween"] .moon-fact::before { left: 60px; }
html[data-season="halloween"] .moon-fact::after { left: 64px; }

/* The horizon glows like embers behind black pines; the grass goes dark. */
html[data-season="halloween"] .trees { filter: drop-shadow(0 -4px 0 #6b260d); }
html[data-season="halloween"] .ground { filter: saturate(0.55) brightness(0.62) hue-rotate(-18deg); }

/* Bats crossing the sky (drawn by season.js). */
.hw-bat {
  position: absolute;
  z-index: 0;
  width: 44px;
  height: 20px;
  pointer-events: none;
  animation: hw-fly 22s linear infinite;
}
.hw-bat canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.hw-bat-1 { animation-duration: 29s; animation-delay: -11s; transform: scale(0.75); }
.hw-bat-2 { animation-duration: 35s; animation-delay: -23s; transform: scale(0.6); }
@keyframes hw-fly {
  0%   { left: -60px; top: 18vh; }
  25%  { top: 9vh; }
  50%  { top: 16vh; }
  75%  { top: 6vh; }
  100% { left: calc(100% + 60px); top: 12vh; }
}

/* A pumpkin sits on top of each account button, like on a shelf. */
html[data-season="halloween"] .accounts { margin-top: 44px; }
html[data-season="halloween"] .accounts ul { row-gap: 56px; }
html[data-season="halloween"] .accounts li { position: relative; }
html[data-season="halloween"] .accounts li::before {
  content: "";
  position: absolute;
  bottom: calc(100% - 8px);
  right: 6px;
  width: 64px;
  height: 56px;
  background: url("/static/img/pumpkin-0.png") 0 0 / 100% 100% no-repeat;
  image-rendering: pixelated;
  pointer-events: none;
}
html[data-season="halloween"] .accounts li:nth-child(2)::before { background-image: url("/static/img/pumpkin-1.png"); right: auto; left: 8px; }
html[data-season="halloween"] .accounts li:nth-child(3)::before { background-image: url("/static/img/pumpkin-2.png"); right: 10px; }

/* Dot's costume rides on her sprite: one layer behind (a cape), one in front. */
.hw-costume {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--dot-size);
  height: var(--dot-size);
  pointer-events: none;
}
.hw-costume[hidden] { display: none; }
.hw-costume canvas {
  position: absolute;
  left: 0;
  top: -64px;
  width: 96px;
  height: 160px;
  image-rendering: pixelated;
}
html[data-season="halloween"] .dot-layer { isolation: isolate; }
html[data-season="halloween"] .planet-dot,
html[data-season="halloween"] .dot-actor { z-index: 2; }
.hw-costume.back { z-index: 1; }
.hw-costume.front { z-index: 3; }
/* Whatever Dot says stays over her costume (the witch hat is tall). */
html[data-season="halloween"] .bubble,
html[data-season="halloween"] .planet-say { z-index: 4; }

@media (max-width: 600px) {
  html[data-season="halloween"] .moon,
  html[data-season="halloween"] .moon-fact { width: 64px; height: 64px; }
  html[data-season="halloween"] .moon-fact::before { left: 40px; }
  html[data-season="halloween"] .moon-fact::after { left: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .hw-bat { animation: none; left: 30vw; top: 12vh; }
}
