/* Festival layer. Everything here ignores the mouse, touch and keyboard. */
.fest-host { position: fixed; left: 0; top: 0; width: 0; height: 0; overflow: visible; z-index: 75; pointer-events: none; }
.fest-item { position: fixed; display: none; pointer-events: none; user-select: none; -webkit-user-select: none; }
.fest-item img { pointer-events: none; -webkit-user-drag: none; }
.fest-image img { display: block; width: 100%; height: 100%; }
.fest-strip { background-repeat: repeat-x; background-position: left bottom; background-size: auto 100%; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .25)); }
.fest-logo-crop { background-repeat: no-repeat; background-size: 100% auto; background-position: top center; }
.fest-hat { position: absolute; display: block; height: auto; }
.fest-flakes { overflow: hidden; }
.fest-flake { position: absolute; top: 0; left: var(--x); width: var(--s); height: var(--s); border-radius: 50%; background: #fff; opacity: 0; box-shadow: 0 0 2px rgba(0, 0, 0, .25); }
.fest-anim .fest-flake { animation: fest-fall var(--t) linear var(--d) infinite; }
.fest-host:not(.fest-anim) .fest-flakes { display: none !important; }
.fest-paused .fest-flake { animation-play-state: paused; }
@keyframes fest-fall {
  0% { opacity: 0; transform: translate3d(0, -4px, 0); }
  10% { opacity: .9; }
  90% { opacity: .9; }
  100% { opacity: 0; transform: translate3d(14px, var(--fall, 40px), 0); }
}
@media (prefers-reduced-motion: reduce) { .fest-flake { animation: none !important; } .fest-flakes { display: none !important; } }

/* String lights: two layers swap brightness for a soft twinkle */
.fest-strip.fest-lights { background-position: left top; filter: none; }
.fest-anim .fest-lights-a { animation: fest-twa 1.2s ease-in-out infinite alternate; }
.fest-anim .fest-lights-b { animation: fest-twb 1.2s ease-in-out infinite alternate; }
.fest-paused .fest-lights-a, .fest-paused .fest-lights-b { animation-play-state: paused; }
@keyframes fest-twa { from { opacity: 1; } to { opacity: .25; } }
@keyframes fest-twb { from { opacity: .25; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .fest-lights-a, .fest-lights-b { animation: none !important; } }

/* Blinking tree lights (same two-group swap as the header lights) */
.fest-bulb { position: absolute; width: var(--bs, 6%); aspect-ratio: 1; border-radius: 50%; background: var(--c); box-shadow: 0 0 4px 1px var(--c); transform: translate(-50%, -50%); }
.fest-anim .fest-bulb-a { animation: fest-bta .9s ease-in-out infinite alternate; }
.fest-anim .fest-bulb-b { animation: fest-btb .9s ease-in-out infinite alternate; }
@keyframes fest-bta { from { opacity: 1; } to { opacity: .12; } }
@keyframes fest-btb { from { opacity: .12; } to { opacity: 1; } }
.fest-paused .fest-bulb { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .fest-bulb { animation: none !important; } }

/* Santa sleigh: outer box flies across, inner box bobs up and down */
.fest-flyer { left: 0; will-change: transform; }
.fest-flyer.fest-fly { animation: fest-fly var(--dur, 14s) linear 1 forwards; }
.fest-host:not(.fest-anim) .fest-flyer { display: none !important; }
@keyframes fest-fly { from { transform: translate3d(var(--x0), 0, 0); } to { transform: translate3d(var(--x1), 0, 0); } }
.fest-bob { position: absolute; left: 0; top: 0; right: 0; bottom: 0; animation: fest-bob 1.1s ease-in-out infinite alternate; }
@keyframes fest-bob { from { transform: translateY(-3px) rotate(-1.5deg); } to { transform: translateY(3px) rotate(1.5deg); } }
.fest-flyer .fest-bob > img { position: absolute; left: 0; top: 0; width: 81.7%; height: 100%; }
.fest-fdragon { position: absolute; left: 79%; top: 12%; width: 21%; aspect-ratio: 4 / 3; background-repeat: no-repeat; background-size: 100% auto; background-position: top center; }
.fest-rnose { position: absolute; left: 90%; top: 54%; width: 12%; aspect-ratio: 1; border-radius: 50%; background: #FF1744; box-shadow: 0 0 5px 2px #FF1744; transform: translate(-50%, -50%); animation: fest-nose .7s ease-in-out infinite alternate; }
@keyframes fest-nose { from { opacity: .55; } to { opacity: 1; } }
.fest-spark { position: absolute; width: 5px; height: 5px; background: #FFE600; box-shadow: 0 0 4px 1px #FFE600; transform: rotate(45deg); animation: fest-spk .7s ease-in-out infinite alternate; }
@keyframes fest-spk { from { opacity: .15; transform: rotate(45deg) scale(.6); } to { opacity: 1; transform: rotate(45deg) scale(1.2); } }
.fest-paused .fest-flyer, .fest-paused .fest-bob, .fest-paused .fest-rnose, .fest-paused .fest-spark { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .fest-flyer { display: none !important; } }

/* Settings rows */
.fest-setting-box { margin: 10px 18px; display: flex; flex-direction: column; gap: 8px; font-family: "M PLUS 1", sans-serif; font-size: 14px; color: #1E1E1E; }
.fest-setting-row { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.fest-setting-box { color: var(--text, #1E1E1E); }
.fest-setting-box.set-sec { margin: 0; padding: 8px 0 12px; }
.fest-title { margin-bottom: 4px; }

/* The standing figure (snowman, diya, clock) is the one clickable decoration */
.fest-click.fest-hot { animation: fest-wiggle .45s ease-in-out infinite alternate; transform-origin: 50% 100%; }
.fest-click.fest-hot[data-fest-id^="tree"] { animation-name: fest-wiggle-s; }
@keyframes fest-wiggle { from { transform: rotate(-3deg); } to { transform: rotate(3deg); } }
@keyframes fest-wiggle-s { from { transform: rotate(-1.2deg); } to { transform: rotate(1.2deg); } }
.fest-fall { position: fixed; z-index: 77; pointer-events: none; }
.fest-fall-ice { background: linear-gradient(135deg, #ffffff, #a9dcf7 70%, #6db6e6); }
.fest-fall-sparks { border-radius: 50%; background: #FFD54F; box-shadow: 0 0 6px 2px #FF9800; }
.fest-fall-confetti { border-radius: 1px; }

/* The visitor: rises from the bottom, blesses, floats up and fades */
.fest-visitor { position: fixed; pointer-events: none; opacity: 0; will-change: transform, opacity; }
.fest-visitor img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; filter: drop-shadow(0 0 10px rgba(255, 244, 180, .9)); }
.fest-vglow { position: absolute; left: 50%; top: 28%; width: 230%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(circle, rgba(255, 249, 200, .7) 0, rgba(255, 236, 150, .3) 38%, rgba(255, 236, 150, 0) 68%); opacity: 0; }
.fest-vrays { position: absolute; left: 50%; top: 28%; width: 260%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; background: repeating-conic-gradient(from 0deg, rgba(255, 240, 170, .5) 0 5deg, rgba(255, 240, 170, 0) 5deg 15deg); -webkit-mask: radial-gradient(circle, #000 0, transparent 68%); mask: radial-gradient(circle, #000 0, transparent 68%); opacity: 0; }
@media (prefers-reduced-motion: reduce) { .fest-visitor { display: none; } }
.fest-bubble { position: fixed; z-index: 77; transform: translate(-50%, -100%); background: #fff; color: #1E1E1E; border: 2px solid #1E1E1E; border-radius: 14px; padding: 6px 12px; font: 700 13px/1.2 'M PLUS 1', system-ui, sans-serif; white-space: nowrap; box-shadow: 0 3px 0 #1E1E1E; pointer-events: none; animation: fest-say 2s ease-out forwards; }
.fest-bubble::after { content: ""; position: absolute; left: 50%; bottom: -8px; width: 10px; height: 10px; background: #fff; border-right: 2px solid #1E1E1E; border-bottom: 2px solid #1E1E1E; transform: translateX(-50%) rotate(45deg); }
@keyframes fest-say { 0% { opacity: 0; transform: translate(-50%, -80%) scale(.7); } 12% { opacity: 1; transform: translate(-50%, -100%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -125%); } }
.fest-drop { position: fixed; z-index: 77; pointer-events: none; background-repeat: no-repeat; background-size: contain; background-position: center; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .3)); }
.fest-puff { position: fixed; z-index: 77; border-radius: 50%; pointer-events: none; box-shadow: 0 0 4px rgba(120, 180, 230, .6); }
@media (prefers-reduced-motion: reduce) { .fest-click.fest-hot { animation: none; } }

/* Falling flakes get the colour of the festival (the host has data-festival="...") */
[data-festival="diwali"] .fest-flake { background: #FFC107; box-shadow: 0 0 5px 1px #FF9800; }
[data-festival="new-year"] .fest-flake { background: #FFD54F; box-shadow: 0 0 4px 1px #EC407A; }

/* The landing page header sits above everything (z-index 100), so the festival layer goes just above it */
.fest-host[data-page="landing"] { z-index: 101; }

/* Hanging pieces (candy canes, lanterns): they swing from the top */
.fest-hang { transform-origin: 50% 0; }
.fest-hang img { display: block; width: 100%; height: 100%; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .25)); }
.fest-anim .fest-hang { animation: fest-swing 3.4s ease-in-out infinite alternate; }
.fest-anim .fest-hang-2 { animation-duration: 2.7s; animation-delay: -1.2s; }
.fest-paused .fest-hang { animation-play-state: paused; }
@keyframes fest-swing { from { transform: rotate(-6deg); } to { transform: rotate(6deg); } }
@media (prefers-reduced-motion: reduce) { .fest-hang { animation: none !important; } }
[data-festival="diwali"] .fest-hang img { filter: drop-shadow(0 0 5px rgba(255, 160, 0, .9)); }
.fest-anim[data-festival="diwali"] .fest-hang img { animation: fest-glow 1.4s ease-in-out infinite alternate; }
@keyframes fest-glow { from { filter: drop-shadow(0 0 3px rgba(255, 160, 0, .6)); } to { filter: drop-shadow(0 0 8px rgba(255, 190, 0, 1)); } }

/* the AI Extension page is z-index 10010: the festival layer must sit above it */
#festival-host { z-index: 10020; }
/* while it is open, show only its own decorations */
body.ai-ext-open .fest-item:not([data-fest-id$="-aiext"]) { display: none !important; }
body:not(.ai-ext-open) .fest-item[data-fest-id$="-aiext"] { display: none !important; }