/* Christmas theme (S110). Loaded only while the theme is on, or while an admin previews it; every rule starts
   with html[data-theme="christmas"], so nothing changes when it's off. Like Halloween (S56) the frame (nav, header,
   stats bar, footer) changes and game cards, ads and Gold keep their normal look: an 8-bit winter village.
   Light mode is a snowy day. Dark mode (the moon / sun button) is a true night: the sky darkens, stars come out,
   the moon rises and every light in the village glows; the button cross-fades between the two on the spot.
   Decorations are aria-hidden, never take clicks and animate only transform / opacity. Sprites and the scene:
   templates/themes/christmas/ (generated by Backups/tests/christmas_pixel_art.py). */

html[data-theme="christmas"] {
  --xm-night: #0C1430;
  --xm-line: #1E2A52;
  --xm-dusk: #1B2550;
  --xm-px: 3px;
}
@media (max-width: 900px) { html[data-theme="christmas"] { --xm-px: 2px; } }
@media (max-width: 480px) { html[data-theme="christmas"] { --xm-px: 1.5px; } }

html[data-theme="christmas"] .xm-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- Nav: a winter night + a Santa hat on the mascot ---------- */
html[data-theme="christmas"] .topnav { background: var(--xm-night); border-bottom-color: var(--xm-line); }
html[data-theme="christmas"] .brand { position: relative; }
html[data-theme="christmas"] .xm-hat {
  position: absolute;
  left: -2px; top: -10px;
  width: 26px; height: auto;
  transform: rotate(-14deg);
  transform-origin: 45% 100%;
  transition: transform .2s ease;
  pointer-events: none;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .5));
}
html[data-theme="christmas"] .brand:hover .xm-hat { transform: translate(-1px, -2px) rotate(-22deg) scale(1.06); }

/* ---------- Header: a snowy village on its bottom edge, fairy lights along the top, snow, the sleigh ---------- */
html[data-theme="christmas"] .hero-banner { --xm-pb: 76px; padding-bottom: var(--xm-pb); background-color: #6F86BE; }
@media (max-width: 720px) { html[data-theme="christmas"] .hero-banner { --xm-pb: 76px; } }
@media (max-width: 480px) { html[data-theme="christmas"] .hero-banner { --xm-pb: 60px; } }
html[data-theme="christmas"][data-mode="dark"] .hero-banner { background-color: #0E1638; }

/* Day: a cool winter light over any header photo (the photo itself is never touched). */
html[data-theme="christmas"] .hero-banner__overlay {
  background: linear-gradient(180deg, #C9D7F2 0%, #AFC1E8 48%, #7D93C9 100%);
  mix-blend-mode: multiply;
}
html[data-theme="christmas"] .xm-scene { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
html[data-theme="christmas"] .xm-frost {
  position: absolute; inset: 0; z-index: 1;
  background:
    radial-gradient(125% 95% at 50% 30%, transparent 55%, rgba(16, 26, 62, .42) 100%),
    linear-gradient(180deg, rgba(12, 20, 50, .26) 0%, rgba(12, 20, 50, 0) 34%, rgba(236, 244, 255, 0) 78%, rgba(236, 244, 255, .26) 100%);
}

/* Falling snow, kept light (the owner: "way more subtile"): tiled pixel flakes, a few near ones and a faint far
   shimmer (about 130 across a desktop header); each layer only moves (transform). */
html[data-theme="christmas"] .xm-snow { position: absolute; inset: 0; z-index: 1; }
html[data-theme="christmas"] .xm-snow--far {
  --tile-w: calc(88 * var(--xm-px)); --tile: calc(66 * var(--xm-px));
  animation: xm-sway 7s ease-in-out infinite alternate;
}
html[data-theme="christmas"] .xm-snow--near {
  --tile-w: calc(160 * var(--xm-px)); --tile: calc(120 * var(--xm-px));
  animation: xm-sway 5.5s ease-in-out -2s infinite alternate;
}
html[data-theme="christmas"] .xm-snow__fall {
  position: absolute; left: -24px; right: -24px; bottom: 0; top: calc(-1 * var(--tile));
  background-repeat: repeat;
  background-size: var(--tile-w) var(--tile);
}
html[data-theme="christmas"] .xm-snow--far .xm-snow__fall { background-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 128 96%22 shape-rendering=%22crispEdges%22%3E%3Cpath fill=%22%23FFFFFF%22 fill-opacity=%22.4%22 d=%22M33 0h1v1h-1zM71 23h1v1h-1zM120 31h1v1h-1zM28 47h1v1h-1zM55 52h1v1h-1zM92 53h1v1h-1zM7 59h1v1h-1zM91 88h1v1h-1z%22/%3E%3Cpath fill=%22%23D3E1F5%22 fill-opacity=%22.4%22 d=%22M13 20h1v1h-1zM99 20h1v1h-1zM26 73h1v1h-1zM65 94h1v1h-1z%22/%3E%3C/svg%3E"); animation: xm-fall 22s linear infinite; }
html[data-theme="christmas"] .xm-snow--near .xm-snow__fall { background-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 160 120%22 shape-rendering=%22crispEdges%22%3E%3Cpath fill=%22%23FFFFFF%22 fill-opacity=%22.7%22 d=%22M141 7h1v1h-1zM71 14h1v1h-1zM6 31h1v1h-1zM107 32h1v1h-1zM43 42h1v1h-1zM77 46h2v1h-2zM77 47h2v1h-2zM133 53h2v1h-2zM133 54h2v1h-2zM29 71h1v1h-1zM138 84h1v1h-1zM35 104h1v1h-1zM98 104h1v1h-1z%22/%3E%3C/svg%3E"); animation: xm-fall 20s linear infinite; }
@keyframes xm-fall { from { transform: translateY(0); } to { transform: translateY(var(--tile)); } }
@keyframes xm-sway { from { transform: translateX(-10px); } to { transform: translateX(10px); } }

/* The village: a left and a right group on the bottom edge (the middle stays open for the buttons and the
   Discord tab). Every layer of a group shares its box, so the lights sit exactly on the sprites. */
html[data-theme="christmas"] .xm-side {
  position: absolute; bottom: calc(3 * var(--xm-px)); z-index: 1;
  width: calc(160 * var(--xm-px)); height: calc(36 * var(--xm-px));
  max-width: 50%;
}
html[data-theme="christmas"] .xm-side--left { left: 0; }
html[data-theme="christmas"] .xm-side--right { right: 0; }
html[data-theme="christmas"] .xm-layer { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
html[data-theme="christmas"] .xm-px { display: block; width: 100%; height: 100%; }
html[data-theme="christmas"] .xm-ground {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1;
  height: calc(5 * var(--xm-px));
  background: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 32 5%22 shape-rendering=%22crispEdges%22%3E%3Cpath fill=%22%23FFFFFF%22 d=%22M4 0h1v1h-1zM12 0h1v1h-1zM22 0h1v1h-1zM1 1h1v1h-1zM3 1h2v1h-2zM7 1h1v1h-1zM11 1h2v1h-2zM15 1h1v1h-1zM19 1h1v1h-1zM21 1h1v1h-1zM23 1h1v1h-1zM29 1h1v1h-1zM0 2h7v1h-7zM8 2h1v1h-1zM10 2h5v1h-5zM16 2h1v1h-1zM18 2h6v1h-6zM26 2h1v1h-1zM28 2h2v1h-2zM0 3h32v1h-32zM0 4h32v1h-32z%22/%3E%3Cpath fill=%22%23D3E1F5%22 d=%22M5 1h1v1h-1zM13 1h1v1h-1zM22 1h1v1h-1zM7 2h1v1h-1zM15 2h1v1h-1zM24 2h1v1h-1zM30 2h1v1h-1z%22/%3E%3Cpath fill=%22%23F2F7FF%22 d=%22M3 0h1v1h-1zM5 0h1v1h-1zM11 0h1v1h-1zM13 0h1v1h-1zM21 0h1v1h-1zM2 1h1v1h-1zM6 1h1v1h-1zM10 1h1v1h-1zM14 1h1v1h-1zM20 1h1v1h-1zM24 1h1v1h-1zM28 1h1v1h-1zM30 1h1v1h-1zM9 2h1v1h-1zM17 2h1v1h-1zM25 2h1v1h-1zM27 2h1v1h-1zM31 2h1v1h-1z%22/%3E%3C/svg%3E") repeat-x left bottom / calc(32 * var(--xm-px)) 100%;
}

/* Chimney smoke: three puffs rise and fade in turn. */
html[data-theme="christmas"] .xm-smoke {
  position: absolute; right: calc(48 * var(--xm-px)); bottom: calc(25 * var(--xm-px));
  width: calc(5 * var(--xm-px)); opacity: 0;
  animation: xm-smoke 6s linear infinite;
}
html[data-theme="christmas"] .xm-smoke svg { display: block; width: 100%; height: auto; }
html[data-theme="christmas"] .xm-smoke--2 { animation-delay: -2s; }
html[data-theme="christmas"] .xm-smoke--3 { width: calc(4 * var(--xm-px)); animation-delay: -4s; }
@keyframes xm-smoke {
  0% { opacity: 0; transform: translate(0, 0) scale(.6); }
  12.5% { opacity: 0.85; transform: translate(calc(-1.64 * var(--xm-px)), calc(-5.62 * var(--xm-px))) scale(0.811); }
  25% { opacity: 0.729; transform: translate(calc(-3.06 * var(--xm-px)), calc(-10.50 * var(--xm-px))) scale(0.994); }
  37.5% { opacity: 0.607; transform: translate(calc(-4.27 * var(--xm-px)), calc(-14.62 * var(--xm-px))) scale(1.148); }
  50% { opacity: 0.486; transform: translate(calc(-5.25 * var(--xm-px)), calc(-18.00 * var(--xm-px))) scale(1.275); }
  62.5% { opacity: 0.364; transform: translate(calc(-6.02 * var(--xm-px)), calc(-20.62 * var(--xm-px))) scale(1.373); }
  75% { opacity: 0.243; transform: translate(calc(-6.56 * var(--xm-px)), calc(-22.50 * var(--xm-px))) scale(1.444); }
  87.5% { opacity: 0.121; transform: translate(calc(-6.89 * var(--xm-px)), calc(-23.62 * var(--xm-px))) scale(1.486); }
  100% { opacity: 0; transform: translate(calc(-7.00 * var(--xm-px)), calc(-24.00 * var(--xm-px))) scale(1.500); }
}

/* ---------- Night (dark mode): darkness over the photo and the village, then the sky and the lights on top ---------- */
html[data-theme="christmas"] .xm-night {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(4, 8, 28, .84) 0%, rgba(7, 13, 42, .76) 45%, rgba(12, 22, 62, .62) 100%);
  opacity: 0;
  transition: opacity 1.4s ease;
}
html[data-theme="christmas"] .xm-sky { position: absolute; inset: 0; z-index: 1; opacity: 0; transition: opacity 1.6s ease; }
html[data-theme="christmas"] .xm-stars {
  position: absolute; left: 0; right: 0; top: 0; height: calc(80 * var(--xm-px));
  background: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 96 80%22 shape-rendering=%22crispEdges%22%3E%3Cpath fill=%22%23FFF7D6%22 d=%22M3 5h1v1h-1zM92 8h1v1h-1zM61 33h1v1h-1z%22/%3E%3Cpath fill=%22%23FFFFFF%22 d=%22M26 0h1v1h-1zM30 0h1v1h-1zM50 0h1v1h-1zM71 20h1v1h-1zM78 38h1v1h-1zM40 44h1v1h-1z%22/%3E%3Cpath fill=%22%23C9D2E6%22 d=%22M37 1h1v1h-1zM42 1h1v1h-1zM83 1h1v1h-1zM3 4h1v1h-1zM2 5h1v1h-1zM4 5h1v1h-1zM3 6h1v1h-1zM92 7h1v1h-1zM91 8h1v1h-1zM93 8h1v1h-1zM92 9h1v1h-1zM11 10h1v1h-1zM15 17h1v1h-1zM25 19h1v1h-1zM3 25h1v1h-1zM75 25h1v1h-1zM61 32h1v1h-1zM60 33h1v1h-1zM62 33h1v1h-1zM61 34h1v1h-1zM67 35h1v1h-1zM23 36h1v1h-1zM86 36h1v1h-1zM63 37h1v1h-1zM51 50h1v1h-1zM41 52h1v1h-1zM57 52h1v1h-1zM60 55h1v1h-1zM81 65h1v1h-1zM87 74h1v1h-1zM50 77h1v1h-1zM10 79h1v1h-1z%22/%3E%3C/svg%3E") repeat-x left top / calc(96 * var(--xm-px)) calc(80 * var(--xm-px));
}
html[data-theme="christmas"] .xm-stars--b {
  background-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 96 80%22 shape-rendering=%22crispEdges%22%3E%3Cpath fill=%22%23FFF7D6%22 d=%22M39 2h1v1h-1zM57 11h1v1h-1zM4 27h1v1h-1z%22/%3E%3Cpath fill=%22%23FFFFFF%22 d=%22M56 0h1v1h-1zM43 3h1v1h-1zM52 19h1v1h-1zM39 25h1v1h-1zM44 28h1v1h-1z%22/%3E%3Cpath fill=%22%23C9D2E6%22 d=%22M39 1h1v1h-1zM38 2h1v1h-1zM40 2h1v1h-1zM39 3h1v1h-1zM35 5h1v1h-1zM57 10h1v1h-1zM56 11h1v1h-1zM58 11h1v1h-1zM57 12h1v1h-1zM53 13h1v1h-1zM93 18h1v1h-1zM4 26h1v1h-1zM3 27h1v1h-1zM5 27h1v1h-1zM4 28h1v1h-1zM20 29h1v1h-1zM82 32h1v1h-1zM11 34h1v1h-1zM19 35h1v1h-1zM59 39h1v1h-1zM38 40h1v1h-1zM67 41h1v1h-1zM47 46h1v1h-1zM86 47h1v1h-1zM52 49h1v1h-1zM10 55h1v1h-1zM33 61h1v1h-1zM89 63h1v1h-1zM69 69h1v1h-1zM60 74h1v1h-1zM28 76h1v1h-1zM81 76h1v1h-1zM42 79h1v1h-1z%22/%3E%3C/svg%3E");
  background-position: calc(37 * var(--xm-px)) calc(11 * var(--xm-px));
}
html[data-theme="christmas"] .xm-moon {
  position: absolute; right: 9%; top: 9%;
  width: calc(21 * var(--xm-px));
  transform: translateY(calc(22 * var(--xm-px)));
  transition: transform 2.4s cubic-bezier(.2, .8, .2, 1);
}
html[data-theme="christmas"] .xm-moon::before {
  content: ""; position: absolute; inset: -150%;
  background: radial-gradient(closest-side, rgba(214, 226, 255, .34), rgba(190, 208, 255, .12) 50%, rgba(190, 208, 255, 0));
}
html[data-theme="christmas"] .xm-moon svg { position: relative; display: block; width: 100%; height: auto; }
html[data-theme="christmas"] .xm-ground--night {
  background-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 32 5%22 shape-rendering=%22crispEdges%22%3E%3Cpath fill=%22%231B2550%22 d=%22M3 1h3v1h-3zM11 1h3v1h-3zM21 1h2v1h-2zM1 2h7v1h-7zM10 2h6v1h-6zM19 2h6v1h-6zM28 2h3v1h-3zM0 3h32v1h-32zM0 4h32v1h-32z%22/%3E%3Cpath fill=%22%2393A8D8%22 d=%22M3 0h3v1h-3zM11 0h3v1h-3zM21 0h2v1h-2zM1 1h2v1h-2zM6 1h2v1h-2zM10 1h1v1h-1zM14 1h2v1h-2zM19 1h2v1h-2zM23 1h2v1h-2zM28 1h3v1h-3zM0 2h1v1h-1zM8 2h2v1h-2zM16 2h3v1h-3zM25 2h3v1h-3zM31 2h1v1h-1z%22/%3E%3C/svg%3E");
  opacity: 0;
  transition: opacity 1.4s ease;
}
html[data-theme="christmas"] .xm-halos { opacity: 0; transition: opacity 1.4s ease; }
html[data-theme="christmas"][data-mode="dark"] .xm-night,
html[data-theme="christmas"][data-mode="dark"] .xm-sky,
html[data-theme="christmas"][data-mode="dark"] .xm-ground--night,
html[data-theme="christmas"][data-mode="dark"] .xm-halos { opacity: 1; }
html[data-theme="christmas"][data-mode="dark"] .xm-moon { transform: none; }
html[data-theme="christmas"][data-mode="dark"] .xm-stars--a { animation: xm-twinkle 5s ease-in-out infinite; }
html[data-theme="christmas"][data-mode="dark"] .xm-stars--b { animation: xm-twinkle 6s ease-in-out -3s infinite; }
@keyframes xm-twinkle { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
/* The moon / sun button cross-fades the site's colours in 0.3 s (style.css: html.mode-fade sets every transition for
   0.4 s, !important); the night here takes its own time, so these keep their transitions through it. */
html[data-theme="christmas"].mode-fade .xm-night,
html[data-theme="christmas"].mode-fade .xm-sky,
html[data-theme="christmas"].mode-fade .xm-ground--night,
html[data-theme="christmas"].mode-fade .xm-halos,
html[data-theme="christmas"].mode-fade .xm-nose,
html[data-theme="christmas"].mode-fade .xm-pennant__night,
html[data-theme="christmas"].mode-fade .xm-pennant__glow { transition: opacity 1.4s ease !important; }
html[data-theme="christmas"].mode-fade .xm-moon { transition: transform 2.4s cubic-bezier(.2, .8, .2, 1) !important; }

/* S111: a sky lane between the fairy lights and the headline at every width: the sleigh and its banner fly level
   through it and never cross the text (below 1300 px the moon sits in it too). */
html[data-theme="christmas"] .hero-banner { padding-top: 92px; }
@media (max-width: 1299px) {
  html[data-theme="christmas"] .xm-moon { top: 12px; right: max(16px, 4%); }
}
@media (max-width: 720px) {
  html[data-theme="christmas"] .hero-banner { padding-top: 84px; }
}
@media (max-width: 480px) {
  html[data-theme="christmas"] .hero-banner { padding-top: 66px; }
}

/* Santa's sleigh: crosses the header once on every page, then again now and then; at night it passes the moon.
   S111: it tows a "Merry Christmas" banner like an airplane ad, so a flight takes 15 s and goes the train's length
   further. */
html[data-theme="christmas"] .xm-flight { position: absolute; inset: 0; z-index: 1; --xm-px: 2px; }
@media (max-width: 480px) { html[data-theme="christmas"] .xm-flight { --xm-px: 1.5px; } }
html[data-theme="christmas"] .xm-sleigh {
  position: absolute; left: 100%; top: 41px;
  width: calc(52 * var(--xm-px));
  opacity: 0;
  animation: xm-fly 15s linear 1.2s 1 both, xm-again 46s linear 23s infinite;
}
/* just under the fairy lights (36 px tall from 901 px, 24 px to 481 px, 18 px below) */
@media (max-width: 900px) { html[data-theme="christmas"] .xm-sleigh { top: 29px; } }
@media (max-width: 480px) { html[data-theme="christmas"] .xm-sleigh { top: 22px; } }
html[data-theme="christmas"] .xm-sleigh__bob { position: relative; display: block; animation: xm-bob 1.5s ease-in-out infinite alternate; }
html[data-theme="christmas"] .xm-sleigh svg { position: relative; display: block; width: 100%; height: auto; }
html[data-theme="christmas"] .xm-sleigh__a { animation: xm-gallop-a .5s steps(1, end) infinite; }
html[data-theme="christmas"] .xm-sleigh__b { animation: xm-gallop-b .5s steps(1, end) infinite; }
html[data-theme="christmas"][data-mode="dark"] .xm-sleigh svg { filter: brightness(.62) saturate(.85); }
html[data-theme="christmas"] .xm-nose {
  position: absolute; left: calc(-3.5 * var(--xm-px)); top: calc(.5 * var(--xm-px));
  width: calc(8 * var(--xm-px)); height: calc(8 * var(--xm-px));
  background: radial-gradient(closest-side, rgba(255, 92, 104, .95), rgba(255, 77, 94, .35) 45%, rgba(255, 77, 94, 0));
  opacity: 0;
  transition: opacity 1.4s ease;
}
html[data-theme="christmas"][data-mode="dark"] .xm-nose { opacity: 1; }
html[data-theme="christmas"] .xm-dust {
  position: absolute; left: 96%; top: 52%;
  width: calc(26 * var(--xm-px)); height: calc(6 * var(--xm-px));
  background: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 26 6%22 shape-rendering=%22crispEdges%22%3E%3Cpath fill=%22%23FFFFFF%22 d=%22M2 1h1v1h-1zM17 3h1v1h-1zM11 4h1v1h-1zM6 5h1v1h-1z%22/%3E%3Cpath fill=%22%23FFF2BF%22 d=%22M8 1h1v1h-1zM0 2h1v1h-1zM13 2h1v1h-1zM3 3h1v1h-1zM23 4h1v1h-1z%22/%3E%3Cpath fill=%22%23FFC83D%22 d=%22M15 0h1v1h-1zM20 1h1v1h-1zM5 2h1v1h-1zM9 3h1v1h-1zM1 4h1v1h-1z%22/%3E%3C/svg%3E") left center / 100% 100% no-repeat;
  animation: xm-dust .5s steps(2, end) infinite;
}
/* The banner (S111): the tow line leaves the sleigh's back, the cloth trails behind it. Drawn as one sprite and shown
   in slices: the line, the bridle and the pole hold still, each slice of cloth after them waves a little more than
   the one before (--k), a quarter second after it, so a soft wave runs from the pole to the swallowtail. */
html[data-theme="christmas"] .xm-pennant {
  position: absolute; left: calc(100% - 1 * var(--xm-px)); top: 0;
  display: flex; width: calc(150 * var(--xm-px));
}
html[data-theme="christmas"] .xm-pennant__s { display: block; flex: none; width: calc(6 * var(--xm-px)); }
html[data-theme="christmas"] .xm-pennant__s svg { display: block; width: 100%; height: auto; }
html[data-theme="christmas"] .xm-pennant__s--wave {
  --xm-amp: calc(min(var(--k), 6) * .25 * var(--xm-px));
  animation: xm-wave 1.5s ease-in-out infinite alternate;
  animation-delay: calc(var(--k) * -.25s);
}
/* The night: a darker copy of the pennant drawn into its own sprite fades in over the day one (no CSS filter: on the
   moving slices Firefox paid about 13 points of a core for one), and a soft gold glow behind the cloth. */
html[data-theme="christmas"] .xm-pennant__night { opacity: 0; transition: opacity 1.4s ease; }
html[data-theme="christmas"][data-mode="dark"] .xm-pennant__night { opacity: 1; }
html[data-theme="christmas"] .xm-pennant__glow {
  position: absolute; left: calc(18 * var(--xm-px)); right: calc(-6 * var(--xm-px));
  top: calc(-4 * var(--xm-px)); bottom: calc(-4 * var(--xm-px));
  background: radial-gradient(closest-side, rgba(255, 214, 120, .3), rgba(255, 214, 120, 0));
  opacity: 0; transition: opacity 1.4s ease;
}
html[data-theme="christmas"][data-mode="dark"] .xm-pennant__glow { opacity: 1; }
@keyframes xm-wave { from { transform: translateY(calc(-1 * var(--xm-amp))); } to { transform: translateY(var(--xm-amp)); } }
@keyframes xm-gallop-a { 0% { opacity: 1; } 50% { opacity: 0; } }
@keyframes xm-gallop-b { 0% { opacity: 0; } 50% { opacity: 1; } }
@keyframes xm-bob { from { transform: translateY(-3px); } to { transform: translateY(3px); } }
@keyframes xm-dust { 0% { opacity: .9; } 50% { opacity: .45; } }
@keyframes xm-fly {
  from { opacity: 1; transform: translate(0, 0); }
  to   { opacity: 1; transform: translate(calc(-100vw - 202 * var(--xm-px) - 40px), 0); }
}
@keyframes xm-again {
  0%          { opacity: 1; visibility: visible; transform: translate(0, 0); }
  32.6%       { opacity: 1; visibility: visible; transform: translate(calc(-100vw - 202 * var(--xm-px) - 40px), 0); }
  32.7%, 100% { opacity: 0; visibility: hidden; transform: translate(calc(-100vw - 202 * var(--xm-px) - 40px), 0); }
}

/* The lights: tree bulbs and the garland twinkle in three turns (slow fades, never a flash), windows and the lamp
   stay lit; their halos show at night. */
html[data-theme="christmas"] .xm-tw { animation: xm-blink 3.5s ease-in-out infinite; }
html[data-theme="christmas"] .xm-tw--2 { animation-delay: -1.25s; }
html[data-theme="christmas"] .xm-tw--3 { animation-delay: -2.5s; }
@keyframes xm-blink { 0%, 100% { opacity: 1; } 50% { opacity: .18; } }

html[data-theme="christmas"] .xm-garland { position: absolute; left: 0; right: 0; top: 0; z-index: 1; height: calc(12 * var(--xm-px)); }
html[data-theme="christmas"] .xm-garland > span {
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 48 12%22 shape-rendering=%22crispEdges%22%3E%3Cpath fill=%22%237E2230%22 d=%22M4 4h2v1h-2zM44 4h2v1h-2zM4 5h2v1h-2zM44 5h2v1h-2zM4 6h2v1h-2zM44 6h2v1h-2zM4 7h1v1h-1zM44 7h1v1h-1z%22/%3E%3Cpath fill=%22%237C6420%22 d=%22M36 6h2v1h-2zM12 7h2v1h-2zM36 7h2v1h-2zM12 8h2v1h-2zM36 8h2v1h-2zM12 9h2v1h-2zM36 9h1v1h-1zM12 10h1v1h-1z%22/%3E%3Cpath fill=%22%231F5C3C%22 d=%22M20 8h2v1h-2zM20 9h2v1h-2zM20 10h2v1h-2zM20 11h1v1h-1z%22/%3E%3Cpath fill=%22%2328407A%22 d=%22M28 8h2v1h-2zM28 9h2v1h-2zM28 10h2v1h-2zM28 11h1v1h-1z%22/%3E%3Cpath fill=%22%230B4029%22 d=%22M0 0h1v1h-1zM47 0h1v1h-1zM1 1h2v1h-2zM45 1h2v1h-2zM3 2h3v1h-3zM42 2h3v1h-3zM6 3h3v1h-3zM39 3h3v1h-3zM9 4h3v1h-3zM36 4h3v1h-3zM12 5h5v1h-5zM31 5h5v1h-5zM17 6h14v1h-14z%22/%3E%3Cpath fill=%22%2316213F%22 d=%22M4 3h1v1h-1zM44 3h1v1h-1zM36 5h1v1h-1zM12 6h1v1h-1zM20 7h1v1h-1zM28 7h1v1h-1z%22/%3E%3C/svg%3E") repeat-x center top / calc(48 * var(--xm-px)) calc(12 * var(--xm-px));
}
html[data-theme="christmas"] .xm-garland > .xm-garland__glow { background-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 48 12%22%3E%3Cdefs%3E%3CradialGradient id=%22red%22%3E%3Cstop offset=%220%22 stop-color=%22%23FF4D5E%22 stop-opacity=%22.7%22/%3E%3Cstop offset=%221%22 stop-color=%22%23FF4D5E%22 stop-opacity=%220%22/%3E%3C/radialGradient%3E%3CradialGradient id=%22gold%22%3E%3Cstop offset=%220%22 stop-color=%22%23FFD84D%22 stop-opacity=%22.7%22/%3E%3Cstop offset=%221%22 stop-color=%22%23FFD84D%22 stop-opacity=%220%22/%3E%3C/radialGradient%3E%3CradialGradient id=%22green%22%3E%3Cstop offset=%220%22 stop-color=%22%235BF08F%22 stop-opacity=%22.7%22/%3E%3Cstop offset=%221%22 stop-color=%22%235BF08F%22 stop-opacity=%220%22/%3E%3C/radialGradient%3E%3CradialGradient id=%22blue%22%3E%3Cstop offset=%220%22 stop-color=%22%236CB2FF%22 stop-opacity=%22.7%22/%3E%3Cstop offset=%221%22 stop-color=%22%236CB2FF%22 stop-opacity=%220%22/%3E%3C/radialGradient%3E%3CradialGradient id=%22pink%22%3E%3Cstop offset=%220%22 stop-color=%22%23F08CFF%22 stop-opacity=%22.7%22/%3E%3Cstop offset=%221%22 stop-color=%22%23F08CFF%22 stop-opacity=%220%22/%3E%3C/radialGradient%3E%3C/defs%3E%3Ccircle cx=%225%22 cy=%225.5%22 r=%224.6%22 fill=%22url%28%23red%29%22/%3E%3Ccircle cx=%2213%22 cy=%228.5%22 r=%224.6%22 fill=%22url%28%23gold%29%22/%3E%3Ccircle cx=%2221%22 cy=%229.5%22 r=%224.6%22 fill=%22url%28%23green%29%22/%3E%3Ccircle cx=%2229%22 cy=%229.5%22 r=%224.6%22 fill=%22url%28%23blue%29%22/%3E%3Ccircle cx=%2237%22 cy=%227.5%22 r=%224.6%22 fill=%22url%28%23gold%29%22/%3E%3Ccircle cx=%2245%22 cy=%225.5%22 r=%224.6%22 fill=%22url%28%23red%29%22/%3E%3C/svg%3E"); opacity: 0; transition: opacity 1.4s ease; }
html[data-theme="christmas"][data-mode="dark"] .xm-garland > .xm-garland__glow { opacity: 1; }
html[data-theme="christmas"].mode-fade .xm-garland > .xm-garland__glow { transition: opacity 1.4s ease !important; }
html[data-theme="christmas"] .xm-garland > .xm-tw--1 { background-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 48 12%22 shape-rendering=%22crispEdges%22%3E%3Cpath fill=%22%23FF4D5E%22 d=%22M5 4h1v1h-1zM4 5h2v1h-2zM4 6h2v1h-2zM4 7h1v1h-1z%22/%3E%3Cpath fill=%22%236CB2FF%22 d=%22M29 8h1v1h-1zM28 9h2v1h-2zM28 10h2v1h-2zM28 11h1v1h-1z%22/%3E%3Cpath fill=%22%23FFFFFF%22 d=%22M4 4h1v1h-1zM28 8h1v1h-1z%22/%3E%3C/svg%3E"); }
html[data-theme="christmas"] .xm-garland > .xm-tw--2 { background-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 48 12%22 shape-rendering=%22crispEdges%22%3E%3Cpath fill=%22%23FFFFFF%22 d=%22M36 6h1v1h-1zM12 7h1v1h-1z%22/%3E%3Cpath fill=%22%23FFD84D%22 d=%22M37 6h1v1h-1zM13 7h1v1h-1zM36 7h2v1h-2zM12 8h2v1h-2zM36 8h2v1h-2zM12 9h2v1h-2zM36 9h1v1h-1zM12 10h1v1h-1z%22/%3E%3C/svg%3E"); }
html[data-theme="christmas"] .xm-garland > .xm-tw--3 { background-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 48 12%22 shape-rendering=%22crispEdges%22%3E%3Cpath fill=%22%23FF4D5E%22 d=%22M45 4h1v1h-1zM44 5h2v1h-2zM44 6h2v1h-2zM44 7h1v1h-1z%22/%3E%3Cpath fill=%22%235BF08F%22 d=%22M21 8h1v1h-1zM20 9h2v1h-2zM20 10h2v1h-2zM20 11h1v1h-1z%22/%3E%3Cpath fill=%22%23FFFFFF%22 d=%22M44 4h1v1h-1zM20 8h1v1h-1z%22/%3E%3C/svg%3E"); }

/* The highlighted word: ornament red with a gold shine instead of purple. */
html[data-theme="christmas"] .hero-banner__hl {
  --primary-bright: #FFE08A;
  background-image: linear-gradient(135deg, #E3263A 0%, #FF4D5E 30%, #FFD98A 50%, #FF4D5E 70%, #E3263A 100%);
  animation-name: hero-caret, xm-glow;
  /* S78b: xm-glow's 0% and 50% for the canvas glow (base.html, style.css .hero-hl) */
  --hero-glow-rest: drop-shadow(0 2px 3px rgba(8, 12, 34, .5)) drop-shadow(0 4px 14px rgba(8, 12, 34, .35))
    drop-shadow(0 0 10px rgba(255, 96, 104, .32)) drop-shadow(0 0 22px rgba(255, 60, 80, .16));
  --hero-glow-peak: drop-shadow(0 2px 3px rgba(8, 12, 34, .5)) drop-shadow(0 4px 14px rgba(8, 12, 34, .35))
    drop-shadow(0 0 18px rgba(255, 116, 116, .58)) drop-shadow(0 0 36px rgba(255, 60, 80, .32));
}
@keyframes xm-glow {
  0%, 100% {
    filter:
      drop-shadow(0 2px 3px  rgba(8, 12, 34, .5))
      drop-shadow(0 4px 14px rgba(8, 12, 34, .35))
      drop-shadow(0 0 10px   rgba(255, 96, 104, .32))
      drop-shadow(0 0 22px   rgba(255, 60, 80, .16));
  }
  50% {
    filter:
      drop-shadow(0 2px 3px  rgba(8, 12, 34, .5))
      drop-shadow(0 4px 14px rgba(8, 12, 34, .35))
      drop-shadow(0 0 18px   rgba(255, 116, 116, .58))
      drop-shadow(0 0 36px   rgba(255, 60, 80, .32));
  }
}

/* ---------- A bauble on a gold thread in the categories panel (desktop), swinging a little ---------- */
@media (min-width: 901px) {
  html[data-theme="christmas"] .cat-panel::after {
    content: "";
    position: absolute; top: -18px; right: 24px;
    width: 20px; height: 54px;
    background:
      linear-gradient(#D9B24C, #D9B24C) center top / 2px 30px no-repeat,
      url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 12 15%22 shape-rendering=%22crispEdges%22%3E%3Cpath fill=%22%23B7791F%22 d=%22M4 3h3v1h-3z%22/%3E%3Cpath fill=%22%237A0F1D%22 d=%22M4 0h3v1h-3zM4 1h1v1h-1zM6 1h1v1h-1zM3 3h1v1h-1zM7 3h1v1h-1zM3 4h5v1h-5zM2 5h1v1h-1zM8 5h1v1h-1zM1 6h1v1h-1zM9 6h1v1h-1zM0 7h1v1h-1zM10 7h1v1h-1zM0 8h1v1h-1zM10 8h1v1h-1zM0 9h1v1h-1zM10 9h1v1h-1zM0 10h1v1h-1zM10 10h1v1h-1zM0 11h1v1h-1zM10 11h1v1h-1zM1 12h1v1h-1zM9 12h1v1h-1zM2 13h1v1h-1zM8 13h1v1h-1zM3 14h5v1h-5z%22/%3E%3Cpath fill=%22%23FFF2BF%22 d=%22M2 9h1v1h-1zM5 9h1v1h-1zM8 9h1v1h-1z%22/%3E%3Cpath fill=%22%23E3263A%22 d=%22M3 5h5v1h-5zM2 6h1v1h-1zM4 6h5v1h-5zM1 7h1v1h-1zM4 7h6v1h-6zM5 8h2v1h-2zM8 8h2v1h-2zM2 10h2v1h-2zM5 10h2v1h-2zM1 11h6v1h-6zM2 12h4v1h-4zM3 13h2v1h-2z%22/%3E%3Cpath fill=%22%23FFD45C%22 d=%22M3 2h5v1h-5z%22/%3E%3Cpath fill=%22%23FF9AA0%22 d=%22M3 6h1v1h-1zM2 7h2v1h-2zM2 8h2v1h-2z%22/%3E%3Cpath fill=%22%23A3172B%22 d=%22M8 10h2v1h-2zM7 11h3v1h-3zM6 12h3v1h-3zM5 13h3v1h-3z%22/%3E%3Cpath fill=%22%23FFD45C%22 d=%22M1 8h1v1h-1zM4 8h1v1h-1zM7 8h1v1h-1zM1 9h1v1h-1zM3 9h2v1h-2zM6 9h2v1h-2zM9 9h1v1h-1zM1 10h1v1h-1zM4 10h1v1h-1zM7 10h1v1h-1z%22/%3E%3C/svg%3E") center bottom / 20px 25px no-repeat;
    transform-origin: 50% 0;
    pointer-events: none;
    animation: xm-swing 7s ease-in-out .6s 1 both;
  }
}
/* It swings when the page opens and comes to rest (the panel follows the page: a swing without end would keep the
   page from resting while people read the list). */
@keyframes xm-swing {
  0%   { transform: rotate(0); }
  10%  { transform: rotate(7deg); }
  25%  { transform: rotate(-5.5deg); }
  40%  { transform: rotate(4deg); }
  55%  { transform: rotate(-2.5deg); }
  70%  { transform: rotate(1.4deg); }
  85%  { transform: rotate(-.6deg); }
  100% { transform: rotate(0); }
}

/* ---------- Top 3: gold, silver and bronze baubles instead of the medals ---------- */
html[data-theme="christmas"] .rank-card__medal--gold,
html[data-theme="christmas"] .rank-card__medal--silver,
html[data-theme="christmas"] .rank-card__medal--bronze { background: center / contain no-repeat; }
html[data-theme="christmas"] .rank-card__medal--gold { background-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 14 17%22 shape-rendering=%22crispEdges%22%3E%3Cpath fill=%22%239AA3B5%22 d=%22M5 3h3v1h-3z%22/%3E%3Cpath fill=%22%237A4B00%22 d=%22M5 0h3v1h-3zM5 1h1v1h-1zM7 1h1v1h-1zM4 3h1v1h-1zM8 3h1v1h-1zM4 4h5v1h-5zM2 5h2v1h-2zM9 5h2v1h-2zM1 6h2v1h-2zM10 6h2v1h-2zM1 7h1v1h-1zM11 7h1v1h-1zM0 8h1v1h-1zM12 8h1v1h-1zM0 9h1v1h-1zM12 9h1v1h-1zM0 10h1v1h-1zM12 10h1v1h-1zM0 11h1v1h-1zM12 11h1v1h-1zM0 12h1v1h-1zM12 12h1v1h-1zM1 13h1v1h-1zM11 13h1v1h-1zM1 14h2v1h-2zM10 14h2v1h-2zM2 15h2v1h-2zM9 15h2v1h-2zM4 16h5v1h-5z%22/%3E%3Cpath fill=%22%23FFFFFF%22 d=%22M2 10h1v1h-1zM5 10h1v1h-1zM8 10h1v1h-1zM11 10h1v1h-1z%22/%3E%3Cpath fill=%22%23F7B731%22 d=%22M4 5h5v1h-5zM3 6h1v1h-1zM5 6h5v1h-5zM2 7h1v1h-1zM5 7h6v1h-6zM1 8h1v1h-1zM5 8h7v1h-7zM5 9h2v1h-2zM8 9h2v1h-2zM2 11h2v1h-2zM5 11h2v1h-2zM8 11h1v1h-1zM1 12h7v1h-7zM2 13h5v1h-5zM3 14h3v1h-3zM4 15h1v1h-1z%22/%3E%3Cpath fill=%22%23E6E9EF%22 d=%22M4 2h5v1h-5z%22/%3E%3Cpath fill=%22%23FFE9A6%22 d=%22M4 6h1v1h-1zM3 7h2v1h-2zM2 8h3v1h-3zM2 9h2v1h-2z%22/%3E%3Cpath fill=%22%23C98A0B%22 d=%22M11 9h1v1h-1zM9 11h1v1h-1zM11 11h1v1h-1zM8 12h4v1h-4zM7 13h4v1h-4zM6 14h4v1h-4zM5 15h4v1h-4z%22/%3E%3Cpath fill=%22%23FFF6D0%22 d=%22M1 9h1v1h-1zM4 9h1v1h-1zM7 9h1v1h-1zM10 9h1v1h-1zM1 10h1v1h-1zM3 10h2v1h-2zM6 10h2v1h-2zM9 10h2v1h-2zM1 11h1v1h-1zM4 11h1v1h-1zM7 11h1v1h-1zM10 11h1v1h-1z%22/%3E%3C/svg%3E"); }
html[data-theme="christmas"] .rank-card__medal--silver { background-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 14 17%22 shape-rendering=%22crispEdges%22%3E%3Cpath fill=%22%23B98B1E%22 d=%22M5 3h3v1h-3z%22/%3E%3Cpath fill=%22%234B5563%22 d=%22M5 0h3v1h-3zM5 1h1v1h-1zM7 1h1v1h-1zM4 3h1v1h-1zM8 3h1v1h-1zM4 4h5v1h-5zM2 5h2v1h-2zM9 5h2v1h-2zM1 6h2v1h-2zM10 6h2v1h-2zM1 7h1v1h-1zM11 7h1v1h-1zM0 8h1v1h-1zM12 8h1v1h-1zM0 9h1v1h-1zM12 9h1v1h-1zM0 10h1v1h-1zM12 10h1v1h-1zM0 11h1v1h-1zM12 11h1v1h-1zM0 12h1v1h-1zM12 12h1v1h-1zM1 13h1v1h-1zM11 13h1v1h-1zM1 14h2v1h-2zM10 14h2v1h-2zM2 15h2v1h-2zM9 15h2v1h-2zM4 16h5v1h-5z%22/%3E%3Cpath fill=%22%23E2E8F0%22 d=%22M2 10h1v1h-1zM5 10h1v1h-1zM8 10h1v1h-1zM11 10h1v1h-1z%22/%3E%3Cpath fill=%22%23D1D5DB%22 d=%22M4 5h5v1h-5zM3 6h1v1h-1zM5 6h5v1h-5zM2 7h1v1h-1zM5 7h6v1h-6zM1 8h1v1h-1zM5 8h7v1h-7zM5 9h2v1h-2zM8 9h2v1h-2zM2 11h2v1h-2zM5 11h2v1h-2zM8 11h1v1h-1zM1 12h7v1h-7zM2 13h5v1h-5zM3 14h3v1h-3zM4 15h1v1h-1z%22/%3E%3Cpath fill=%22%23F2D27A%22 d=%22M4 2h5v1h-5z%22/%3E%3Cpath fill=%22%23F8FAFC%22 d=%22M4 6h1v1h-1zM3 7h2v1h-2zM2 8h3v1h-3zM2 9h2v1h-2z%22/%3E%3Cpath fill=%22%239CA3AF%22 d=%22M11 9h1v1h-1zM9 11h1v1h-1zM11 11h1v1h-1zM8 12h4v1h-4zM7 13h4v1h-4zM6 14h4v1h-4zM5 15h4v1h-4z%22/%3E%3Cpath fill=%22%23FFFFFF%22 d=%22M1 9h1v1h-1zM4 9h1v1h-1zM7 9h1v1h-1zM10 9h1v1h-1zM1 10h1v1h-1zM3 10h2v1h-2zM6 10h2v1h-2zM9 10h2v1h-2zM1 11h1v1h-1zM4 11h1v1h-1zM7 11h1v1h-1zM10 11h1v1h-1z%22/%3E%3C/svg%3E"); }
html[data-theme="christmas"] .rank-card__medal--bronze { background-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 14 17%22 shape-rendering=%22crispEdges%22%3E%3Cpath fill=%22%239AA3B5%22 d=%22M5 3h3v1h-3z%22/%3E%3Cpath fill=%22%235C2E0E%22 d=%22M5 0h3v1h-3zM5 1h1v1h-1zM7 1h1v1h-1zM4 3h1v1h-1zM8 3h1v1h-1zM4 4h5v1h-5zM2 5h2v1h-2zM9 5h2v1h-2zM1 6h2v1h-2zM10 6h2v1h-2zM1 7h1v1h-1zM11 7h1v1h-1zM0 8h1v1h-1zM12 8h1v1h-1zM0 9h1v1h-1zM12 9h1v1h-1zM0 10h1v1h-1zM12 10h1v1h-1zM0 11h1v1h-1zM12 11h1v1h-1zM0 12h1v1h-1zM12 12h1v1h-1zM1 13h1v1h-1zM11 13h1v1h-1zM1 14h2v1h-2zM10 14h2v1h-2zM2 15h2v1h-2zM9 15h2v1h-2zM4 16h5v1h-5z%22/%3E%3Cpath fill=%22%23FFF3E4%22 d=%22M2 10h1v1h-1zM5 10h1v1h-1zM8 10h1v1h-1zM11 10h1v1h-1z%22/%3E%3Cpath fill=%22%23CD7F32%22 d=%22M4 5h5v1h-5zM3 6h1v1h-1zM5 6h5v1h-5zM2 7h1v1h-1zM5 7h6v1h-6zM1 8h1v1h-1zM5 8h7v1h-7zM5 9h2v1h-2zM8 9h2v1h-2zM2 11h2v1h-2zM5 11h2v1h-2zM8 11h1v1h-1zM1 12h7v1h-7zM2 13h5v1h-5zM3 14h3v1h-3zM4 15h1v1h-1z%22/%3E%3Cpath fill=%22%23E6E9EF%22 d=%22M4 2h5v1h-5z%22/%3E%3Cpath fill=%22%23F0BC86%22 d=%22M4 6h1v1h-1zM3 7h2v1h-2zM2 8h3v1h-3zM2 9h2v1h-2z%22/%3E%3Cpath fill=%22%239A5A1F%22 d=%22M11 9h1v1h-1zM9 11h1v1h-1zM11 11h1v1h-1zM8 12h4v1h-4zM7 13h4v1h-4zM6 14h4v1h-4zM5 15h4v1h-4z%22/%3E%3Cpath fill=%22%23FFE2BF%22 d=%22M1 9h1v1h-1zM4 9h1v1h-1zM7 9h1v1h-1zM10 9h1v1h-1zM1 10h1v1h-1zM3 10h2v1h-2zM6 10h2v1h-2zM9 10h2v1h-2zM1 11h1v1h-1zM4 11h1v1h-1zM7 11h1v1h-1zM10 11h1v1h-1z%22/%3E%3C/svg%3E"); }
html[data-theme="christmas"] .rank-card__medal--gold > *,
html[data-theme="christmas"] .rank-card__medal--silver > *,
html[data-theme="christmas"] .rank-card__medal--bronze > * { display: none; }

/* ---------- Stats bar: the snowfield the village stands on (white by day, moonlit blue at night) ---------- */
html[data-theme="christmas"] .hero-stats-bar__inner > div:nth-child(1) .hero-stats-bar__icon { background: #FDE8EA; color: #C8172E; }
html[data-theme="christmas"] .hero-stats-bar__inner > div:nth-child(2) .hero-stats-bar__icon { background: #E2F5E9; color: #15803D; }
html[data-theme="christmas"] .hero-stats-bar__inner > div:nth-child(3) .hero-stats-bar__icon { background: #FFF3D1; color: #A16207; }
html[data-theme="christmas"] .hero-stats-bar__inner > div:nth-child(4) .hero-stats-bar__icon { background: #E4ECFF; color: #2D5BC4; }
html[data-theme="christmas"][data-mode="dark"] .hero-stats-bar {
  background: var(--xm-dusk);
  border-bottom-color: #2A3870;
  box-shadow: 0 16px 30px -22px rgba(6, 10, 30, .8);
}
html[data-theme="christmas"][data-mode="dark"] .hero-stats-bar__inner > div { border-right-color: rgba(214, 228, 255, .12); }
html[data-theme="christmas"][data-mode="dark"] .hero-stats-bar__col strong { color: #F2F7FF; }
html[data-theme="christmas"][data-mode="dark"] .hero-stats-bar__col span { color: #AFC1E6; }
html[data-theme="christmas"][data-mode="dark"] .hero-stats-bar__inner > div:nth-child(1) .hero-stats-bar__icon { background: rgba(255, 77, 94, .16); color: #FF8C96; }
html[data-theme="christmas"][data-mode="dark"] .hero-stats-bar__inner > div:nth-child(2) .hero-stats-bar__icon { background: rgba(91, 240, 143, .13); color: #7BE6A2; }
html[data-theme="christmas"][data-mode="dark"] .hero-stats-bar__inner > div:nth-child(3) .hero-stats-bar__icon { background: rgba(255, 210, 77, .14); color: #FFD66B; }
html[data-theme="christmas"][data-mode="dark"] .hero-stats-bar__inner > div:nth-child(4) .hero-stats-bar__icon { background: rgba(108, 178, 255, .15); color: #8CC2FF; }

/* ---------- Footer: a winter night, snow on its edge, a little tree and presents ---------- */
html[data-theme="christmas"] .footer { position: relative; background: var(--xm-night); border-top-color: var(--xm-line); }
html[data-theme="christmas"] .footer::before {
  content: "";
  position: absolute; left: 0; right: 0; top: calc(-4 * var(--xm-px));
  height: calc(5 * var(--xm-px));
  background: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 32 5%22 shape-rendering=%22crispEdges%22%3E%3Cpath fill=%22%23FFFFFF%22 d=%22M9 0h2v1h-2zM2 1h2v1h-2zM8 1h1v1h-1zM11 1h1v1h-1zM19 1h1v1h-1zM25 1h2v1h-2zM1 2h1v1h-1zM4 2h1v1h-1zM7 2h1v1h-1zM12 2h1v1h-1zM17 2h2v1h-2zM20 2h1v1h-1zM24 2h1v1h-1zM27 2h1v1h-1zM0 3h1v1h-1zM5 3h2v1h-2zM13 3h1v1h-1zM16 3h1v1h-1zM21 3h1v1h-1zM23 3h1v1h-1zM28 3h1v1h-1zM31 3h1v1h-1z%22/%3E%3Cpath fill=%22%23A7BCE0%22 d=%22M10 1h1v1h-1zM3 2h1v1h-1zM11 2h1v1h-1zM26 2h1v1h-1zM4 3h1v1h-1zM12 3h1v1h-1zM20 3h1v1h-1zM27 3h1v1h-1zM1 4h1v1h-1zM5 4h1v1h-1zM9 4h1v1h-1zM13 4h1v1h-1zM17 4h1v1h-1zM21 4h1v1h-1zM25 4h1v1h-1zM29 4h1v1h-1z%22/%3E%3Cpath fill=%22%23D3E1F5%22 d=%22M9 1h1v1h-1zM2 2h1v1h-1zM8 2h1v1h-1zM10 2h1v1h-1zM19 2h1v1h-1zM25 2h1v1h-1zM1 3h1v1h-1zM3 3h1v1h-1zM7 3h1v1h-1zM11 3h1v1h-1zM17 3h1v1h-1zM19 3h1v1h-1zM24 3h1v1h-1zM26 3h1v1h-1zM0 4h1v1h-1zM2 4h3v1h-3zM6 4h3v1h-3zM10 4h3v1h-3zM14 4h3v1h-3zM18 4h3v1h-3zM22 4h3v1h-3zM26 4h3v1h-3zM30 4h2v1h-2z%22/%3E%3Cpath fill=%22%23F2F7FF%22 d=%22M9 2h1v1h-1zM2 3h1v1h-1zM8 3h3v1h-3zM18 3h1v1h-1zM25 3h1v1h-1z%22/%3E%3C/svg%3E") repeat-x left top / calc(32 * var(--xm-px)) 100%;
  pointer-events: none;
}
html[data-theme="christmas"] .xm-patch {
  position: absolute;
  right: max(24px, calc(50% - 666px));
  top: calc(-16 * var(--xm-px));
  width: calc(46 * var(--xm-px));
  pointer-events: none;
}
html[data-theme="christmas"] .xm-patch svg { display: block; width: 100%; height: auto; }
html[data-theme="christmas"] .xm-patch .xm-lit { position: absolute; inset: 0; }

/* S111: the hero's Discord link (S109's tab, base.html: a.hero-community > __new + __body) as a Christmas button centred
   under Browse Toplist and Submit Your Game (the owner's rounds: a present, then a walking character with this button as
   his speech bubble; then "I dont like the character, remove the character. The button in the Christmas theme is nice,
   put that button centered below the 2 other buttons"). CSS only: the link stays the hero's last child (after the two
   buttons in the keyboard order); it is placed a fixed gap under them, from the header's bottom padding (--xm-pb). With
   no theme on it is S109's tab, byte for byte. NEW on pine green (S86's spark and shine kept), "Join our Discord" on red,
   a gold ribbon between them, the buttons' 9 px corners; at night darker paper and a warm glow. White text 4.6:1 or more
   on every colour (s111_test I10). */
html[data-theme="christmas"] .hero-community {
  --xm-cta-h: 30px; --xm-cta-gap: 14px;
  bottom: calc(var(--xm-pb) - var(--xm-cta-gap) - var(--xm-cta-h));
  overflow: visible; background: none; border: 0; border-radius: 9px;
  box-shadow: 0 2px 0 rgba(12, 18, 46, .22), 0 6px 16px rgba(12, 18, 46, .22);
}
html[data-theme="christmas"] .hero-community:hover { background: none; }
html[data-theme="christmas"] .hero-community::after { display: none; }   /* S109's foot shading: the button no longer stands on the bar */
html[data-theme="christmas"] .hero-community__new,
html[data-theme="christmas"] .hero-community__body {
  height: var(--xm-cta-h); padding-top: 0; padding-bottom: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22);
}
html[data-theme="christmas"] .hero-community__new {
  border-radius: 9px 0 0 9px; padding-left: 11px; padding-right: 9px;
  background: linear-gradient(180deg, #17804A 0%, #0E5F36 100%);
}
html[data-theme="christmas"] .hero-community__spark { color: #FFD84D; }
html[data-theme="christmas"] .hero-community__body {
  border-radius: 0 9px 9px 0; border-left: 4px solid #FFC83D; padding-left: 10px; padding-right: 11px;
  background: linear-gradient(180deg, #D21F33 0%, #A3172B 100%);
}
html[data-theme="christmas"] .hero-community:hover .hero-community__body { background: linear-gradient(180deg, #DE2A3E 0%, #B01A2F 100%); }
@media (max-width: 720px) { html[data-theme="christmas"] .hero-community { --xm-cta-gap: 12px; } }
/* the night: darker paper and a warm glow */
html[data-theme="christmas"][data-mode="dark"] .hero-community__new { background: linear-gradient(180deg, #14743F 0%, #0B4F2C 100%); }
html[data-theme="christmas"][data-mode="dark"] .hero-community__body {
  border-left-color: #E0AE35;
  background: linear-gradient(180deg, #C21C2F 0%, #8E1426 100%);
}
html[data-theme="christmas"][data-mode="dark"] .hero-community {
  box-shadow: 0 2px 0 rgba(4, 8, 28, .4), 0 0 18px 2px rgba(255, 190, 80, .3);
}

/* Firefox draws a whole frame for every frame of any smooth animation (S78), and with snow falling the header never
   rests while it is on screen: in Firefox the scene's endless motions run in steps, twelve a second and every one on
   the same beat (each duration and delay above is a whole number of 1/12 s), so Firefox has frames to skip. The sleigh's
   flight stays smooth (it is away three quarters of the time). Measured: the homepage at rest, laptop size, on an M2 core (S110): Firefox 104% smooth -> 73% stepped at night, 93% -> 69% by day (no theme 52%; Halloween 76%); Chrome 48% (no theme 32%), WebKit no extra cost. */
@supports (-moz-appearance: none) {
  html[data-theme="christmas"] .xm-snow--far { animation-timing-function: steps(84); }
  html[data-theme="christmas"] .xm-snow--near { animation-timing-function: steps(66); }
  html[data-theme="christmas"] .xm-snow--far .xm-snow__fall { animation-timing-function: steps(264); }
  html[data-theme="christmas"] .xm-snow--near .xm-snow__fall { animation-timing-function: steps(240); }
  html[data-theme="christmas"] .xm-tw { animation-timing-function: steps(21); }
  html[data-theme="christmas"] .xm-smoke { animation-timing-function: steps(9); }
  html[data-theme="christmas"][data-mode="dark"] .xm-stars--a { animation-timing-function: steps(30); }
  html[data-theme="christmas"][data-mode="dark"] .xm-stars--b { animation-timing-function: steps(36); }
  html[data-theme="christmas"] .xm-sleigh__bob { animation-timing-function: steps(18); }
  html[data-theme="christmas"] .xm-pennant__s--wave { animation-timing-function: steps(18); }
}

/* The admin's preview bar in the theme's colours. */
html[data-theme="christmas"] .theme-preview-bar { background: var(--xm-night); border-color: rgba(227, 38, 58, .6); }
html[data-theme="christmas"] .theme-preview-bar__text strong { color: #FFD98A; }

/* Nothing moves for people who ask for less motion: the snow hangs still, the sleigh stays away, and the day / night
   change happens at once. */
@media (prefers-reduced-motion: reduce) {
  html[data-theme="christmas"] .xm-snow,
  html[data-theme="christmas"] .xm-snow__fall,
  html[data-theme="christmas"] .xm-smoke,
  html[data-theme="christmas"] .xm-sleigh,
  html[data-theme="christmas"] .xm-sleigh__bob,
  html[data-theme="christmas"] .xm-sleigh__a,
  html[data-theme="christmas"] .xm-sleigh__b,
  html[data-theme="christmas"] .xm-dust,
  html[data-theme="christmas"] .xm-pennant__s,
  html[data-theme="christmas"] .xm-tw,
  html[data-theme="christmas"] .xm-stars,
  html[data-theme="christmas"] .cat-panel::after { animation: none !important; }
  html[data-theme="christmas"] .xm-sleigh,
  html[data-theme="christmas"] .xm-smoke { display: none; }
  html[data-theme="christmas"] .xm-night,
  html[data-theme="christmas"] .xm-sky,
  html[data-theme="christmas"] .xm-moon,
  html[data-theme="christmas"] .xm-ground--night,
  html[data-theme="christmas"] .xm-halos,
  html[data-theme="christmas"] .xm-nose,
  html[data-theme="christmas"] .xm-pennant__night,
  html[data-theme="christmas"] .xm-pennant__glow,
  html[data-theme="christmas"] .xm-garland > .xm-garland__glow,
  html[data-theme="christmas"] .xm-hat { transition: none; }
  html[data-theme="christmas"] .hero-banner__hl {
    animation: none;
    filter:
      drop-shadow(0 2px 3px  rgba(8, 12, 34, .5))
      drop-shadow(0 4px 14px rgba(8, 12, 34, .35))
      drop-shadow(0 0 14px   rgba(255, 96, 104, .45))
      drop-shadow(0 0 28px   rgba(255, 60, 80, .24));
  }
}
