/* Julpynt över hela portalen. Laddas bara 1 december – 6 januari (SHOWCASE.themes i worker/index.js)
   och gäller sidor med <html data-tema="jul">. Ta bort pyntet: radera raden i themes eller den här filen. */

/* ---------- Snöfall: två lager som faller i olika fart. Mönstren upprepas, så flytten är en hel rutstorlek (600 px) ---------- */
html[data-tema="jul"]::before,
html[data-tema="jul"]::after {
  content: ""; position: fixed; left: 0; right: 0; top: -600px; height: calc(100vh + 600px);
  pointer-events: none; z-index: 5;
}
/* Små snökorn */
html[data-tema="jul"]::before {
  opacity: .5;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='600'%3E%3Cg fill='white'%3E%3Ccircle cx='101' cy='70' r='0.9' opacity='0.86'/%3E%3Ccircle cx='78' cy='149' r='1.3' opacity='0.92'/%3E%3Ccircle cx='48' cy='270' r='1.5' opacity='0.93'/%3E%3Ccircle cx='492' cy='518' r='1.1' opacity='0.65'/%3E%3Ccircle cx='215' cy='531' r='1.9' opacity='0.49'/%3E%3Ccircle cx='106' cy='139' r='1.1' opacity='0.69'/%3E%3Ccircle cx='353' cy='158' r='0.8' opacity='0.65'/%3E%3Ccircle cx='222' cy='340' r='1.9' opacity='0.81'/%3E%3Ccircle cx='309' cy='371' r='1.6' opacity='0.43'/%3E%3Ccircle cx='540' cy='468' r='1.8' opacity='0.88'/%3E%3Ccircle cx='235' cy='239' r='0.9' opacity='0.78'/%3E%3Ccircle cx='37' cy='40' r='1.1' opacity='0.50'/%3E%3Ccircle cx='204' cy='32' r='0.8' opacity='0.49'/%3E%3Ccircle cx='61' cy='218' r='0.8' opacity='0.92'/%3E%3Ccircle cx='368' cy='89' r='1.1' opacity='0.61'/%3E%3Ccircle cx='218' cy='74' r='1.8' opacity='1.00'/%3E%3Ccircle cx='280' cy='290' r='0.9' opacity='0.46'/%3E%3Ccircle cx='206' cy='159' r='1.8' opacity='0.50'/%3E%3Ccircle cx='14' cy='571' r='1.4' opacity='0.49'/%3E%3Ccircle cx='326' cy='16' r='1.4' opacity='0.99'/%3E%3Ccircle cx='518' cy='418' r='1.1' opacity='0.62'/%3E%3Ccircle cx='100' cy='463' r='1.4' opacity='0.87'/%3E%3Ccircle cx='198' cy='134' r='1.8' opacity='0.99'/%3E%3Ccircle cx='512' cy='484' r='1.8' opacity='0.84'/%3E%3Ccircle cx='136' cy='311' r='1.2' opacity='0.42'/%3E%3Ccircle cx='17' cy='168' r='1.1' opacity='0.82'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 600px 600px;
  animation: jul-sno 46s linear infinite;
}
/* Riktiga snöflingor, sexuddiga */
html[data-tema="jul"]::after {
  opacity: .42;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='600'%3E%3Cg stroke='white' stroke-width='1.3' stroke-linecap='round' fill='none'%3E%3Cpath transform='translate(198 97) rotate(32) scale(1.05)' opacity='0.49' d='M-7 0H7M-3.5 -6L3.5 6M-3.5 6L3.5 -6M-5 0l-2 -2M-5 0l-2 2M5 0l2 -2M5 0l2 2M2.5 4.3l2.8 -.6M2.5 4.3l.9 2.7M-2.5 -4.3l-2.8 .6M-2.5 -4.3l-.9 -2.7'/%3E%3Cpath transform='translate(222 44) rotate(26) scale(0.93)' opacity='0.47' d='M-7 0H7M-3.5 -6L3.5 6M-3.5 6L3.5 -6M-5 0l-2 -2M-5 0l-2 2M5 0l2 -2M5 0l2 2M2.5 4.3l2.8 -.6M2.5 4.3l.9 2.7M-2.5 -4.3l-2.8 .6M-2.5 -4.3l-.9 -2.7'/%3E%3Cpath transform='translate(51 63) rotate(7) scale(0.86)' opacity='0.90' d='M-7 0H7M-3.5 -6L3.5 6M-3.5 6L3.5 -6'/%3E%3Cpath transform='translate(139 374) rotate(24) scale(1.31)' opacity='0.77' d='M-7 0H7M-3.5 -6L3.5 6M-3.5 6L3.5 -6M-5 0l-2 -2M-5 0l-2 2M5 0l2 -2M5 0l2 2M2.5 4.3l2.8 -.6M2.5 4.3l.9 2.7M-2.5 -4.3l-2.8 .6M-2.5 -4.3l-.9 -2.7'/%3E%3Cpath transform='translate(576 37) rotate(9) scale(1.23)' opacity='0.61' d='M-7 0H7M-3.5 -6L3.5 6M-3.5 6L3.5 -6M-5 0l-2 -2M-5 0l-2 2M5 0l2 -2M5 0l2 2M2.5 4.3l2.8 -.6M2.5 4.3l.9 2.7M-2.5 -4.3l-2.8 .6M-2.5 -4.3l-.9 -2.7'/%3E%3Cpath transform='translate(78 189) rotate(35) scale(1.19)' opacity='0.55' d='M-7 0H7M-3.5 -6L3.5 6M-3.5 6L3.5 -6M-5 0l-2 -2M-5 0l-2 2M5 0l2 -2M5 0l2 2M2.5 4.3l2.8 -.6M2.5 4.3l.9 2.7M-2.5 -4.3l-2.8 .6M-2.5 -4.3l-.9 -2.7'/%3E%3Cpath transform='translate(381 226) rotate(4) scale(0.97)' opacity='0.48' d='M-7 0H7M-3.5 -6L3.5 6M-3.5 6L3.5 -6M-5 0l-2 -2M-5 0l-2 2M5 0l2 -2M5 0l2 2M2.5 4.3l2.8 -.6M2.5 4.3l.9 2.7M-2.5 -4.3l-2.8 .6M-2.5 -4.3l-.9 -2.7'/%3E%3Cpath transform='translate(129 405) rotate(35) scale(0.86)' opacity='0.62' d='M-7 0H7M-3.5 -6L3.5 6M-3.5 6L3.5 -6'/%3E%3Cpath transform='translate(273 184) rotate(15) scale(1.18)' opacity='0.83' d='M-7 0H7M-3.5 -6L3.5 6M-3.5 6L3.5 -6M-5 0l-2 -2M-5 0l-2 2M5 0l2 -2M5 0l2 2M2.5 4.3l2.8 -.6M2.5 4.3l.9 2.7M-2.5 -4.3l-2.8 .6M-2.5 -4.3l-.9 -2.7'/%3E%3Cpath transform='translate(343 315) rotate(17) scale(1.24)' opacity='0.85' d='M-7 0H7M-3.5 -6L3.5 6M-3.5 6L3.5 -6M-5 0l-2 -2M-5 0l-2 2M5 0l2 -2M5 0l2 2M2.5 4.3l2.8 -.6M2.5 4.3l.9 2.7M-2.5 -4.3l-2.8 .6M-2.5 -4.3l-.9 -2.7'/%3E%3Cpath transform='translate(579 78) rotate(9) scale(0.86)' opacity='0.87' d='M-7 0H7M-3.5 -6L3.5 6M-3.5 6L3.5 -6'/%3E%3Cpath transform='translate(294 33) rotate(34) scale(1.07)' opacity='0.87' d='M-7 0H7M-3.5 -6L3.5 6M-3.5 6L3.5 -6M-5 0l-2 -2M-5 0l-2 2M5 0l2 -2M5 0l2 2M2.5 4.3l2.8 -.6M2.5 4.3l.9 2.7M-2.5 -4.3l-2.8 .6M-2.5 -4.3l-.9 -2.7'/%3E%3Cpath transform='translate(518 192) rotate(35) scale(1.09)' opacity='0.78' d='M-7 0H7M-3.5 -6L3.5 6M-3.5 6L3.5 -6M-5 0l-2 -2M-5 0l-2 2M5 0l2 -2M5 0l2 2M2.5 4.3l2.8 -.6M2.5 4.3l.9 2.7M-2.5 -4.3l-2.8 .6M-2.5 -4.3l-.9 -2.7'/%3E%3Cpath transform='translate(275 497) rotate(40) scale(1.30)' opacity='0.71' d='M-7 0H7M-3.5 -6L3.5 6M-3.5 6L3.5 -6M-5 0l-2 -2M-5 0l-2 2M5 0l2 -2M5 0l2 2M2.5 4.3l2.8 -.6M2.5 4.3l.9 2.7M-2.5 -4.3l-2.8 .6M-2.5 -4.3l-.9 -2.7'/%3E%3Cpath transform='translate(45 417) rotate(49) scale(1.05)' opacity='1.00' d='M-7 0H7M-3.5 -6L3.5 6M-3.5 6L3.5 -6M-5 0l-2 -2M-5 0l-2 2M5 0l2 -2M5 0l2 2M2.5 4.3l2.8 -.6M2.5 4.3l.9 2.7M-2.5 -4.3l-2.8 .6M-2.5 -4.3l-.9 -2.7'/%3E%3Cpath transform='translate(175 234) rotate(28) scale(1.07)' opacity='0.46' d='M-7 0H7M-3.5 -6L3.5 6M-3.5 6L3.5 -6M-5 0l-2 -2M-5 0l-2 2M5 0l2 -2M5 0l2 2M2.5 4.3l2.8 -.6M2.5 4.3l.9 2.7M-2.5 -4.3l-2.8 .6M-2.5 -4.3l-.9 -2.7'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 600px 600px;
  animation: jul-sno 30s linear infinite, jul-vind 9s ease-in-out infinite alternate;
}
@keyframes jul-sno { from { translate: 0 0; } to { translate: 0 600px; } }
@keyframes jul-vind { from { transform: translateX(-14px); } to { transform: translateX(14px); } }

/* ---------- Ljusslinga över hela sidans överkant ---------- */
html[data-tema="jul"] .top::before {
  content: ""; position: absolute; top: 0; left: calc(50% - 50vw); right: calc(50% - 50vw); height: 26px;
  pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='26'%3E%3Cpath d='M0 3 Q35 17 70 3 T140 3' stroke='%23253a2c' stroke-width='1.6' fill='none'/%3E%3Cg stroke='%23253a2c' stroke-width='1'%3E%3Cellipse cx='17' cy='15' rx='3.6' ry='5' fill='%23ff4b3e'/%3E%3Cellipse cx='52' cy='15' rx='3.6' ry='5' fill='%23ffd166'/%3E%3Cellipse cx='87' cy='15' rx='3.6' ry='5' fill='%2347d37a'/%3E%3Cellipse cx='122' cy='15' rx='3.6' ry='5' fill='%236ec6ff'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 140px 26px repeat-x;
  filter: drop-shadow(0 0 4px rgba(255, 220, 140, .55));
  animation: jul-blink 3.2s ease-in-out infinite alternate;
}
@keyframes jul-blink { from { opacity: .75; } to { opacity: 1; } }

/* ---------- Julstjärna som hänger i slingan och gungar ---------- */
html[data-tema="jul"] .top::after {
  content: ""; position: absolute; top: 8px; left: 44%; width: 36px; height: 74px; pointer-events: none;
  transform-origin: 50% 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 74'%3E%3Cpath d='M18 0V40' stroke='%23c9a24a' stroke-width='1'/%3E%3Cpath d='M18 38 L22.3 49.2 L34.2 49.8 L24.9 57.3 L28 68.9 L18 62.3 L8 68.9 L11.1 57.3 L1.8 49.8 L13.7 49.2Z' fill='%23ffd166' stroke='%23b8892c' stroke-width='1.2' stroke-linejoin='round'/%3E%3Cpath d='M18 44 L20.5 51 L27 51.4 L21.8 55.5' fill='none' stroke='%23fff6d0' stroke-width='1' opacity='.8'/%3E%3C/svg%3E") center / contain no-repeat;
  filter: drop-shadow(0 0 10px rgba(255, 209, 102, .6));
  animation: jul-gunga 5.5s ease-in-out infinite alternate;
}
@keyframes jul-gunga { from { rotate: -5deg; } to { rotate: 5deg; } }
@media (max-width: 560px) { html[data-tema="jul"] .top::after { left: 64%; width: 28px; height: 58px; } }

/* ---------- Tomteluva på loggan ---------- */
html[data-tema="jul"] .brand { position: relative; }
html[data-tema="jul"] .brand::before {
  content: ""; position: absolute; left: -9px; top: -15px; width: 32px; height: 27px; z-index: 1; pointer-events: none;
  rotate: -22deg;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 27'%3E%3Cpath d='M4 21 C6 12 12 4 22 3 C26 3 28 6 29 10 C26 8 22 9 20 13 C18 16 18 19 19 21Z' fill='%23d8322a' stroke='%238e1b15' stroke-width='1'/%3E%3Crect x='2' y='19' width='20' height='6' rx='3' fill='%23fbf7ef' stroke='%23d9d2c4' stroke-width='.8'/%3E%3Ccircle cx='29' cy='11' r='3' fill='%23fbf7ef' stroke='%23d9d2c4' stroke-width='.8'/%3E%3C/svg%3E") center / contain no-repeat;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .5));
}

/* ---------- Snö på spelkortens och minispelsbrickornas överkant ---------- */
html[data-tema="jul"] .game::after,
html[data-tema="jul"] .mini::after {
  content: ""; position: absolute; top: -1px; left: 30px; right: 30px; height: 18px; z-index: 2; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='18'%3E%3Cpath d='M0 0H150V5 Q144 10 136 8 Q128 17 117 11 Q108 6 98 9 Q88 15 76 9 Q66 4 56 10 Q44 17 33 10 Q25 6 17 9 Q8 13 0 6Z' fill='%23f4f8ff'/%3E%3Cpath d='M8 3 Q40 6 70 3 Q100 6 140 3' stroke='white' stroke-width='1.4' fill='none' opacity='.8'/%3E%3C/svg%3E") 0 0 / 150px 18px repeat-x;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .35));
  opacity: .92;
}
html[data-tema="jul"] .mini::after { left: 18px; right: 18px; height: 12px; background-size: 100px 12px; }

/* ---------- Snödriva ovanför sidfoten ---------- */
html[data-tema="jul"] .foot::before {
  content: ""; position: absolute; left: calc(50% - 50vw); right: calc(50% - 50vw); top: -22px; height: 24px; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='24'%3E%3Cpath d='M0 24V14 Q22 2 48 12 Q70 20 95 9 Q122 0 150 11 Q166 17 180 14V24Z' fill='%23e8eef8' opacity='.13'/%3E%3C/svg%3E") 0 100% / 180px 24px repeat-x;
}

/* Den som inte vill ha rörelse får stillastående snö och pynt */
@media (prefers-reduced-motion: reduce) {
  html[data-tema="jul"]::before, html[data-tema="jul"]::after,
  html[data-tema="jul"] .top::before, html[data-tema="jul"] .top::after { animation: none; }
}
