/* New Year theme (loaded only while holiday_active(): see app/holiday.php) */

/* falling snow: canvas over the whole page, clicks go through */
#snow { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 60; }
.snow-off #snow { display: none; }

/* snow toggle in the header */
.snow-toggle { background: none; border: 1px solid var(--line2, rgba(255,255,255,.14)); color: #cfe8ff; border-radius: 9px;
  padding: 4px 8px; font-size: 15px; line-height: 1; cursor: pointer; transition: background .15s, opacity .15s; }
.snow-toggle:hover { background: rgba(255,255,255,.08); }
.snow-off .snow-toggle { opacity: .45; }

/* ---------- garland under the header ----------
   each <i> is a piece of wire (::before) with a bulb (::after); --i = its number (set by holiday.js).
   Look: class g-<name> from config 'holiday_garland'. */
.top { position: sticky; }
.garland { position: absolute; left: 0; right: 0; top: 100%; margin-top: -3px; height: 18px; display: flex; pointer-events: none; overflow: hidden; z-index: 1; }
.garland i { position: relative; flex: 1 1 0; min-width: 34px; }
.garland i::before { content: ""; position: absolute; left: 0; right: 0; top: -9px; height: 12px;
  border-bottom: 1.5px solid rgba(40,52,40,.95); border-radius: 0 0 50% 50%; }
.garland i::after { content: ""; position: absolute; left: 50%; top: 3px; width: 7px; height: 10px; margin-left: -3.5px;
  border-radius: 50% 50% 45% 45%; background: var(--b, #ffcc33); box-shadow: 0 0 8px 2px var(--b, #ffcc33); }
.garland i:nth-child(5n+1) { --b: #ff4d4d; }
.garland i:nth-child(5n+2) { --b: #ffcc33; }
.garland i:nth-child(5n+3) { --b: #3ddc84; }
.garland i:nth-child(5n+4) { --b: #4ea1ff; }
.garland i:nth-child(5n+5) { --b: #ff7ad9; }
@keyframes g-blink { 0%, 100% { opacity: 1; } 50% { opacity: .35; box-shadow: 0 0 2px 0 var(--b); } }

/* 1. classic: colored bulbs blinking at random */
.g-classic i::after { animation: g-blink 2.4s ease-in-out infinite; animation-delay: calc(var(--i, 0) * -.37s); }

/* 2. chase: a wave of light runs from left to right */
.g-chase i::after { opacity: .25; animation: g-chase 2.4s linear infinite; animation-delay: calc(var(--i, 0) * .1s - 20s); }
@keyframes g-chase { 0%, 22%, 100% { opacity: .25; box-shadow: 0 0 2px 0 var(--b); } 8% { opacity: 1; box-shadow: 0 0 14px 4px var(--b); } }

/* 3. warm: warm white/amber bulbs, soft flicker */
.garland.g-warm i { --b: #ffc46b; }
.garland.g-warm i:nth-child(3n) { --b: #ffe0a3; }
.garland.g-warm i:nth-child(4n+1) { --b: #ffa53a; }
.g-warm i::after { width: 6px; height: 8px; margin-left: -3px; animation: g-flicker 3.2s ease-in-out infinite; animation-delay: calc(var(--i, 0) * -.53s); }
@keyframes g-flicker { 0%, 100% { opacity: 1; } 30% { opacity: .75; } 45% { opacity: .95; } 70% { opacity: .6; } }

/* 4. brand: site orange and gold, slow shimmer */
.garland.g-brand i { --b: #ffb000; }
.garland.g-brand i:nth-child(3n+2) { --b: #ff6a00; }
.garland.g-brand i:nth-child(3n) { --b: #ffd84d; }
.g-brand i::before { border-bottom-color: rgba(255,176,0,.35); }
.g-brand i::after { animation: g-blink 3s ease-in-out infinite; animation-delay: calc(var(--i, 0) * .15s - 20s); }

/* 5. retro: big old-style bulbs with a cap, two groups blink in turn */
.garland.g-retro { height: 28px; }
.garland.g-retro i:nth-child(4n+1) { --b: #ff3b3b; }
.garland.g-retro i:nth-child(4n+2) { --b: #2fd36f; }
.garland.g-retro i:nth-child(4n+3) { --b: #3d8bff; }
.garland.g-retro i:nth-child(4n+4) { --b: #ffd23d; }
.g-retro i::before { border-bottom: 2px solid #1d2a1d; }
.g-retro i::after { top: 2px; width: 10px; height: 17px; margin-left: -5px; border-radius: 3px 3px 50% 50% / 3px 3px 60% 60%;
  background: linear-gradient(#59606b 0 4px, #2a2f36 4px 5px, var(--b) 5px); box-shadow: 0 6px 12px 1px var(--b);
  animation: g-blink 1.6s steps(1, end) infinite; }
.g-retro i:nth-child(2n)::after { animation-delay: -.8s; }

/* 6. tinsel and balls: gold tinsel, glass balls on threads of different length, swaying */
.garland.g-tinsel { height: 40px; }
.garland.g-tinsel i { --len: 8px; background: linear-gradient(rgba(255,255,255,.35), rgba(255,255,255,.35)) 50% 0 / 1px var(--len) no-repeat; }
.garland.g-tinsel i:nth-child(3n+2) { --len: 16px; }
.garland.g-tinsel i:nth-child(3n) { --len: 23px; }
.garland.g-tinsel i:nth-child(5n+1) { --b: #e53935; }
.garland.g-tinsel i:nth-child(5n+2) { --b: #f2b705; }
.garland.g-tinsel i:nth-child(5n+3) { --b: #1e88e5; }
.garland.g-tinsel i:nth-child(5n+4) { --b: #2e9e5b; }
.garland.g-tinsel i:nth-child(5n+5) { --b: #b8c4d0; }
.g-tinsel i::before { top: -8px; border-bottom: 4px dotted #ffcf40; filter: drop-shadow(0 0 2px rgba(255,200,60,.8)); }
.g-tinsel i::after { top: var(--len); width: 12px; height: 12px; margin-left: -6px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.9) 0 1.5px, var(--b) 3px, rgba(0,0,0,.55) 120%);
  box-shadow: 0 2px 3px rgba(0,0,0,.5); transform-origin: 50% calc(-1 * var(--len));
  animation: g-sway 3.6s ease-in-out infinite; animation-delay: calc(var(--i, 0) * -.41s); }
@keyframes g-sway { 0%, 100% { transform: rotate(-7deg); } 50% { transform: rotate(7deg); } }

/* 7. LED string: thin straight wire with small LEDs, a rainbow runs along it */
.g-led i::before { top: 2px; height: 0; border-radius: 0; border-bottom: 1px solid rgba(120,120,120,.6); }
.g-led i::after { left: 0; width: 100%; margin: 0; top: 0; height: 6px; border-radius: 0; box-shadow: none;
  background: radial-gradient(circle, #ff4d4d 0 1.4px, transparent 2.2px) 4px 50% / 9px 6px repeat-x; }
.g-led i { filter: drop-shadow(0 0 3px #ff4d4d); animation: g-rainbow 6s linear infinite; animation-delay: calc(var(--i, 0) * -.15s); }
@keyframes g-rainbow { from { filter: hue-rotate(0deg) drop-shadow(0 0 3px #ff4d4d); } to { filter: hue-rotate(360deg) drop-shadow(0 0 3px #ff4d4d); } }

/* 8. icicles: an ice edge with icicles, now and then a drop falls */
.garland.g-icicle { height: 44px; margin-top: -1px; }
.garland.g-icicle i { --len: 14px; }
.garland.g-icicle i:nth-child(2n) { --len: 20px; }
.garland.g-icicle i:nth-child(3n) { --len: 28px; }
.garland.g-icicle i:nth-child(5n) { --len: 10px; }
.g-icicle i::before { top: 0; height: 4px; border: 0; border-radius: 0 0 3px 3px; background: rgba(225,242,255,.85); }
.g-icicle i::after { top: 3px; width: 10px; height: var(--len); margin-left: -5px; border-radius: 0; box-shadow: none;
  clip-path: polygon(0 0, 100% 0, 55% 100%, 45% 100%);
  background: linear-gradient(90deg, rgba(170,210,240,.55), #fff 40%, rgba(160,205,240,.75)); opacity: .9; }
.garland.g-icicle i:nth-child(7n+3) { background: radial-gradient(circle, #e3f3ff 0 1.6px, transparent 2.2px) no-repeat;
  background-size: 6px 6px; background-position: 50% calc(var(--len) + 2px); animation: g-drip 5s ease-in infinite; animation-delay: calc(var(--i, 0) * -.7s); }
@keyframes g-drip { 0%, 70% { background-position: 50% calc(var(--len) + 2px); } 100% { background-position: 50% 60px; } }

/* server block on the home page: frost on the edges and a snowdrift along the bottom */
.hero { box-shadow: inset 0 0 40px rgba(190,225,255,.10), inset 0 1px 0 rgba(220,240,255,.25), var(--shadow, 0 10px 30px rgba(0,0,0,.35)); }
.hero { padding-bottom: 44px; }
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 30px; pointer-events: none; opacity: .92;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 30' preserveAspectRatio='none'%3E%3Cpath d='M0 18 C25 8 50 9 75 15 C100 21 120 12 150 10 C180 8 200 19 230 17 C260 15 280 6 310 9 C340 12 365 20 400 13 L400 30 L0 30 Z' fill='%23eef6ff'/%3E%3Cpath d='M0 22 C40 16 70 20 110 23 C150 26 190 17 240 21 C290 25 330 18 400 20 L400 30 L0 30 Z' fill='%23d4e6f7'/%3E%3C/svg%3E") bottom / 100% 100% no-repeat; }

@media (prefers-reduced-motion: reduce) {
  .garland i, .garland i::after { animation: none !important; }
  #snow { display: none; }
}
