/* Festivals on their real dates (festivals.js). These pieces only exist while a festival is on.
   Decoration never takes taps; only the kites, the flag, the diyas, the tree, the plate of colours
   and the New Year banner do. */

:root,
html[data-scene="day"] {
  --fs-clay: #b4552f;
  --fs-oil: #5e2610;
  --fs-clay-dot: #f3d9a4;
  --fs-flame: #ff9f1c;
  --fs-flame-in: #fff1a8;
  --fs-glow: #ffcf6a;
  --fs-glow-op: 0;
  --fs-kn-body: #d8342c;
  --fs-kn-cap: #f08a24;
  --fs-kn-trim: #f6c445;
  --fs-kn-win: #fff2b8;
  --fs-mari: #f28a12;
  --fs-mari-in: #ffc12e;
  --fs-mango: #2f8a3f;
  --fs-pink: #ec3f8c;
  --fs-yellow: #f4c20d;
  --fs-green: #22a95a;
  --fs-blue: #2f7fe0;
  --fs-orange: #ff7a21;
  --fs-purple: #9450d8;
  --fs-splat-op: 0.82;
  --fs-splat-blend: multiply;
  --fs-pine: #2e7a45;
  --fs-pine2: #3c9457;
  --fs-trunk: #6b4226;
  --fs-tinsel: #f2c14e;
  --fs-red: #c8283a;
  --fs-star: #ffc93a;
  --fs-star-in: #fff4c2;
  --fs-bamboo: #b08850;
  --fs-cloth: #b5202c;
  --fs-cloth-ink: #ffe39a;
  --fs-wire: rgba(40, 34, 38, 0.55);
  --fs-kite-filter: none;
  --fs-flag-filter: none;
  --fs-brass: #d1a640;
  --fs-brass-d: #a87d24;
  --fs-r-base: rgba(255, 250, 240, 0.65);
  --fs-kid-shirt: #e8a33a;
  --fs-kid-shorts: #3d5a8a;
  --fs-bulb-op: 0.85;
}

html[data-scene="night"] {
  --fs-clay: #93432a;
  --fs-oil: #4a1d0c;
  --fs-clay-dot: #e0b97a;
  --fs-glow-op: 0.55;
  --fs-kn-body: #c22a22;
  --fs-kn-cap: #e07a1c;
  --fs-kn-win: #ffe48a;
  --fs-mari: #d9780e;
  --fs-mari-in: #f0ad22;
  --fs-mango: #23692f;
  --fs-splat-op: 0.55;
  --fs-splat-blend: normal;
  --fs-pine: #22593a;
  --fs-pine2: #2c6c45;
  --fs-trunk: #4f3220;
  --fs-bamboo: #7d6340;
  --fs-cloth: #8f1b25;
  --fs-wire: rgba(230, 220, 200, 0.4);
  --fs-kite-filter: brightness(0.72) saturate(0.9);
  --fs-flag-filter: brightness(0.82);
  --fs-brass: #b48c34;
  --fs-brass-d: #8a6420;
  --fs-r-base: rgba(255, 245, 225, 0.35);
  --fs-kid-shirt: #b9822e;
  --fs-kid-shorts: #2f4670;
  --fs-bulb-op: 1;
}

/* ---------- Shared colours ---------- */
.fs-c-pink, .fs-c-pink > * { fill: var(--fs-pink); }
.fs-c-yellow, .fs-c-yellow > * { fill: var(--fs-yellow); }
.fs-c-green, .fs-c-green > * { fill: var(--fs-green); }
.fs-c-blue, .fs-c-blue > * { fill: var(--fs-blue); }
.fs-c-orange, .fs-c-orange > * { fill: var(--fs-orange); }
.fs-c-purple, .fs-c-purple > * { fill: var(--fs-purple); }
.fs-glow { fill: var(--fs-glow); opacity: var(--fs-glow-op); }
.fs-cord, .fs-thread, .fs-rope { fill: none; stroke: var(--fs-wire); stroke-width: 1; }
.fs-roof svg, .fs-door svg, .fs-street svg, .fs-diya svg, .fs-flag svg, .fs-wstar svg, .fs-splashes svg { pointer-events: none; }

/* ---------- Roof layer (kites, banner, fireworks). It sits behind the tank, lights and rooftop room. ---------- */
.roof-scene > .fs-roof { position: absolute; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; }
.fs-sky { position: absolute; left: 0; width: 100%; top: -250px; bottom: 25%; height: auto; z-index: -1; pointer-events: none; }

/* Kites */
.fs-rig { position: absolute; bottom: 0; width: 0; transform-origin: 0 100%; transform: rotate(var(--a, 0deg)); pointer-events: none; }
.fs-string { position: absolute; left: -10px; top: 0; width: 20px; height: 100%; overflow: visible; }
.fs-string path { fill: none; stroke: var(--fs-wire); stroke-width: 1; }
.fs-kite {
  position: absolute; left: calc(var(--kw, 38px) / -2); top: calc(var(--kw, 38px) * -0.65);
  width: var(--kw, 38px); height: calc(var(--kw, 38px) * 1.35); padding: 0; border: 0; background: none;
  cursor: pointer; pointer-events: auto; transform-origin: 50% 48%; transform: rotate(calc(var(--a, 0deg) * -0.75));
  filter: var(--fs-kite-filter); -webkit-tap-highlight-color: transparent;
}
.fs-kite svg { display: block; width: 100%; height: 100%; overflow: visible; }
.fs-k1 { fill: var(--k1); }
.fs-k2 { fill: var(--k2); }
.fs-k3 { fill: var(--k3); }
.fs-stick { fill: none; stroke: rgba(70, 45, 25, 0.7); stroke-width: 1; }
.fs-tassel { fill: none; stroke: var(--k3); stroke-width: 1.4; stroke-linecap: round; }
/* At night, Uttarayan kites carry little paper lanterns (tukkal) up their strings. */
.fs-tukkal { display: none; position: absolute; left: -4px; top: 34%; width: 8px; height: 10px; border-radius: 3px 3px 4px 4px; background: #ffd27a; box-shadow: 0 0 10px 3px rgba(255, 190, 90, 0.55); }
html[data-scene="night"] .fs-tukkal { display: block; }
.fs-kid { position: absolute; bottom: 0; width: 30px; height: 46px; pointer-events: none; }
.fs-kid svg { display: block; width: 100%; height: 100%; overflow: visible; }
.fs-kid-leg { fill: none; stroke: var(--skin); stroke-width: 2.6; stroke-linecap: round; }
.fs-kid-shoe { fill: none; stroke: #2a1f25; stroke-width: 2; stroke-linecap: round; }
.fs-kid-shorts { fill: var(--fs-kid-shorts); }
.fs-kid-shirt { fill: var(--fs-kid-shirt); }
.fs-kid-sleeve { fill: none; stroke: var(--fs-kid-shirt); stroke-width: 3.6; stroke-linecap: round; }
.fs-kid-fore { fill: none; stroke: var(--skin); stroke-width: 2.4; stroke-linecap: round; }
.fs-kid-smile { fill: none; stroke: #6b2f2a; stroke-width: 0.8; stroke-linecap: round; }
.fs-kid-thread { fill: none; stroke: var(--fs-wire); stroke-width: 0.6; }
.fs-firki-h { fill: none; stroke: #8a5a35; stroke-width: 1.6; stroke-linecap: round; }
.fs-firki-b { fill: #e04a5f; }
.fs-firki-t { fill: none; stroke: #fff4dc; stroke-width: 0.7; }

/* New Year banner on two bamboo poles */
.fs-banner { position: absolute; bottom: 0; pointer-events: none; }
.fs-poles, .fs-poles svg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.fs-bamboo { fill: none; stroke: var(--fs-bamboo); stroke-width: 3; stroke-linecap: round; }
.fs-bamboo-n { fill: none; stroke: rgba(0, 0, 0, 0.25); stroke-width: 1; }
.fs-cloth {
  position: absolute; left: 6px; right: 6px; top: 0; height: 38px; padding: 0; border: 0; background: none;
  cursor: pointer; pointer-events: auto; -webkit-tap-highlight-color: transparent;
}
.fs-cloth svg { display: block; width: 100%; height: 100%; overflow: visible; }
.fs-cloth-bg { fill: var(--fs-cloth); }
.fs-cloth-trim { fill: none; stroke: var(--fs-cloth-ink); stroke-width: 0.8; stroke-dasharray: 2 2; opacity: 0.8; }
.fs-cloth-ink { fill: var(--fs-cloth-ink); }
.fs-cloth-text { fill: var(--fs-cloth-ink); font-family: "Fraunces", Georgia, serif; font-weight: 700; letter-spacing: 0.06em; }

/* ---------- Tricolour on the water tank ---------- */
.tank-wrap .fs-flag {
  position: absolute; left: calc(50% - 4.4px); bottom: 93%; width: 58px; height: auto; padding: 0; border: 0;
  background: none; cursor: pointer; filter: var(--fs-flag-filter); -webkit-tap-highlight-color: transparent;
}
.tank-wrap .fs-flag svg { display: block; width: 100%; height: auto; overflow: visible; }
@media (max-width: 719px) { .tank-wrap .fs-flag { width: 44px; left: calc(50% - 3.3px); } }
.fs-saffron { fill: #ff9933; }
.fs-white { fill: #ffffff; }
.fs-green { fill: #138808; }
.fs-chakra { fill: none; stroke: #000080; stroke-width: 0.8; }
.fs-spokes { fill: none; stroke: #000080; stroke-width: 0.35; }
.fs-hub { fill: #000080; }
.fs-pole { fill: none; stroke: #8d8f96; stroke-width: 2.2; stroke-linecap: round; }
.fs-finial { fill: #d8b25a; }

/* ---------- Diyas on the window sills ---------- */
.fs-diya {
  position: absolute; left: 6%; bottom: 7px; z-index: 5; width: 30px; height: 11px; padding: 0; border: 0;
  background: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
span.fs-diya { pointer-events: none; }
/* The tap box covers only the bowl on the sill; the flame above it lets taps through to the window. */
.fs-diya svg { position: absolute; left: 0; bottom: 0; display: block; width: 100%; height: 25px; overflow: visible; }
@media (max-width: 719px) { .fs-diya { width: 20px; height: 8px; left: 4%; bottom: 6px; } .fs-diya svg { height: 17px; } }
.fs-clay { fill: var(--fs-clay); }
.fs-oil { fill: var(--fs-oil); }
.fs-clay-dots { fill: none; stroke: var(--fs-clay-dot); stroke-width: 1.4; stroke-linecap: round; }
.fs-wick { fill: none; stroke: #2a1a12; stroke-width: 0.9; stroke-linecap: round; }
.fs-fl { fill: var(--fs-flame); }
.fs-fl-in { fill: var(--fs-flame-in); }
html[data-scene="night"] .fs-fire { filter: drop-shadow(0 0 3px #ffb347); }

/* ---------- The door: toran, akash kandil, star lantern, tree, plate of colours ---------- */
.fs-door { position: absolute; pointer-events: none; }
.fs-toran { position: absolute; left: -11px; right: -11px; top: -7px; height: 34px; z-index: 2; }
.fs-toran svg { display: block; width: 100%; height: 100%; overflow: visible; }
.fs-mari { fill: var(--fs-mari); }
.fs-mari-in { fill: var(--fs-mari-in); }
.fs-mango { fill: var(--fs-mango); }
.fs-hook { position: absolute; right: calc(100% + 13px); top: -2px; width: 14px; height: 4px; border-radius: 2px; background: var(--post, #3d4250); }
.fs-kandil, .fs-xstar { position: absolute; right: calc(100% + 7px); top: 0; width: 32px; transform-origin: 50% 0; }
.fs-kandil svg, .fs-xstar svg { display: block; width: 100%; height: auto; overflow: visible; }
@media (max-width: 719px) { .fs-kandil, .fs-xstar { width: 24px; } }
.fs-kn-body { fill: var(--fs-kn-body); }
.fs-kn-cap { fill: var(--fs-kn-cap); }
.fs-kn-win { fill: var(--fs-kn-win); }
.fs-kn-win2 { fill: var(--fs-kn-win); opacity: 0.6; }
.fs-kn-trim { fill: none; stroke: var(--fs-kn-trim); stroke-width: 1.4; }
.fs-kn-tails path { fill: none; stroke: var(--fs-kn-body); stroke-width: 1.8; stroke-linecap: round; }
.fs-kn-tails path:nth-child(even) { stroke: var(--fs-kn-trim); }
.fs-kn-bead { fill: var(--fs-kn-trim); }
html[data-scene="night"] .fs-kandil svg, html[data-scene="night"] .fs-xstar svg, html[data-scene="night"] .fs-wstar svg { filter: drop-shadow(0 0 6px rgba(255, 190, 90, 0.6)); }
.fs-xs { fill: var(--fs-star); }
.fs-xs-in { fill: var(--fs-star-in); }
.fs-xs-tail { fill: none; stroke: var(--fs-red); stroke-width: 1.6; stroke-linecap: round; }
.fs-tree {
  position: absolute; right: calc(100% + 4px); bottom: 14px; width: 54px; height: 86px; padding: 0; border: 0;
  background: none; cursor: pointer; pointer-events: auto; -webkit-tap-highlight-color: transparent;
}
.fs-tree svg { display: block; width: 100%; height: 100%; overflow: visible; }
/* On a phone the chai cart stands left of the door, so the tree moves under the letterbox. */
@media (max-width: 719px) { .fs-tree { right: auto; left: calc(100% + 10px); width: 32px; height: 51px; } }
.fs-trunk { fill: var(--fs-trunk); }
.fs-tpot { fill: var(--fs-red); }
.fs-pine { fill: var(--fs-pine); }
.fs-pine2 { fill: var(--fs-pine2); }
.fs-tinsel { fill: none; stroke: var(--fs-tinsel); stroke-width: 1.2; stroke-linecap: round; }
.fs-orn .o1 { fill: var(--fs-red); }
.fs-orn .o2 { fill: var(--fs-tinsel); }
.fs-orn .o3 { fill: #4a8fe0; }
.fs-tw circle { fill: #fff6c8; }
html[data-scene="night"] .fs-tw circle { filter: drop-shadow(0 0 2px #ffe08a); }
.fs-tstar { fill: var(--fs-star); }
.fs-thali {
  position: absolute; left: calc(100% + 10px); bottom: 15px; width: 58px; height: 27px; padding: 0; border: 0;
  background: none; cursor: pointer; pointer-events: auto; -webkit-tap-highlight-color: transparent;
}
.fs-thali svg { display: block; width: 100%; height: 100%; overflow: visible; }
.fs-brass { fill: var(--fs-brass); }
.fs-brass-d { fill: var(--fs-brass-d); }

/* ---------- Star lanterns hanging in some windows (Christmas) ---------- */
.fs-wstar { position: absolute; top: 5px; left: 16%; z-index: 5; width: 28px; pointer-events: none; transform-origin: 50% 0; }
.fs-wstar svg { display: block; width: 100%; height: auto; overflow: visible; }
@media (max-width: 719px) { .fs-wstar { width: 20px; } }

/* ---------- Fairy lights under the ledges (Christmas) ---------- */
.fs-ledge {
  position: absolute; left: -8px; right: -8px; bottom: -19px; height: 14px; z-index: 3; pointer-events: none;
  background: radial-gradient(circle at 50% 0, transparent 9px, var(--fs-wire) 9.5px 10.4px, transparent 11px) 0 -2px / 22px 14px repeat-x;
}
.fs-ledge.fs-roofline { left: -6px; right: -6px; bottom: -20px; z-index: 4; }
.fs-ledge i { position: absolute; inset: 0; opacity: var(--fs-bulb-op); }
.fs-ledge i:nth-child(1) {
  background:
    radial-gradient(circle at 11px 8px, #ff5a5a 0 2.4px, transparent 3px) 0 0 / 88px 14px repeat-x,
    radial-gradient(circle at 55px 8px, #6fe08a 0 2.4px, transparent 3px) 0 0 / 88px 14px repeat-x;
}
.fs-ledge i:nth-child(2) {
  background:
    radial-gradient(circle at 33px 8px, #ffd36b 0 2.4px, transparent 3px) 0 0 / 88px 14px repeat-x,
    radial-gradient(circle at 77px 8px, #7fc8ff 0 2.4px, transparent 3px) 0 0 / 88px 14px repeat-x;
}
html[data-scene="night"] .fs-ledge i { filter: drop-shadow(0 0 3px rgba(255, 220, 150, 0.9)); }

/* ---------- Holi colour on the walls and the street ---------- */
.fs-splashes { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.fs-splash { position: absolute; display: block; aspect-ratio: 1; transform: translate(-50%, -50%); opacity: var(--fs-splat-op); mix-blend-mode: var(--fs-splat-blend); }
.fs-splash svg { display: block; width: 100%; height: 100%; }
.fs-street { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.fs-rangoli { position: absolute; left: 50%; top: 1px; width: 132px; height: 27px; transform: translateX(-50%); }
@media (max-width: 719px) { .fs-rangoli { width: 108px; height: 24px; } }
.fs-rangoli svg { display: block; width: 100%; height: 100%; }
.fs-r-base { fill: var(--fs-r-base); }
.fs-r-ring { fill: none; stroke: #ffffff; stroke-width: 2.4; stroke-dasharray: 1 4; stroke-linecap: round; }
.fs-r-star { fill: #fff4c2; }
.fs-r-dot { fill: #ffffff; }
.fs-puff { position: absolute; top: 34px; width: 74px; height: 54px; margin-left: -37px; pointer-events: none; }
.fs-puff i { position: absolute; border-radius: 50%; background: var(--c1); filter: blur(5px); opacity: 0; }
.fs-puff i:nth-child(1) { left: 6px; top: 16px; width: 36px; height: 30px; }
.fs-puff i:nth-child(2) { left: 30px; top: 6px; width: 38px; height: 36px; background: var(--c2); }
.fs-puff i:nth-child(3) { left: 18px; top: 22px; width: 32px; height: 28px; }
.fs-puff b {
  position: absolute; inset: -6px; opacity: 0; border-radius: 50%;
  background:
    radial-gradient(circle, var(--c1) 0 1.3px, transparent 1.8px) 0 0 / 9px 8px,
    radial-gradient(circle, var(--c2) 0 1.3px, transparent 1.8px) 4px 3px / 11px 10px;
  -webkit-mask: radial-gradient(closest-side, #000 40%, transparent);
  mask: radial-gradient(closest-side, #000 40%, transparent);
}

/* ---------- Motion (none of it with reduced motion: everything above is the still pose) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .fs-rig { animation: fs-sway var(--sd, 5s) ease-in-out infinite alternate; animation-delay: var(--d, 0s); }
  @keyframes fs-sway { from { transform: rotate(calc(var(--a, 0deg) - 2.5deg)); } to { transform: rotate(calc(var(--a, 0deg) + 2.5deg)); } }
  .fs-kite { animation: fs-dip 3.6s ease-in-out infinite; animation-delay: var(--d, 0s); }
  @keyframes fs-dip {
    0%, 100% { transform: rotate(calc(var(--a, 0deg) * -0.75)); }
    30% { transform: rotate(calc(var(--a, 0deg) * -0.75 + 10deg)) translateY(2px); }
    62% { transform: rotate(calc(var(--a, 0deg) * -0.75 - 7deg)) translateY(-1px); }
  }
  .fs-rig.fs-swoop { animation: fs-swoop 2.6s cubic-bezier(0.45, 0, 0.3, 1) 1; }
  @keyframes fs-swoop {
    0% { transform: rotate(var(--a, 0deg)); }
    38% { transform: rotate(calc(var(--a, 0deg) - 30deg)); }
    66% { transform: rotate(calc(var(--a, 0deg) + 12deg)); }
    100% { transform: rotate(var(--a, 0deg)); }
  }
  .fs-swoop .fs-kite { animation: fs-loop 2.6s ease-in-out 1; }
  @keyframes fs-loop { 0% { transform: rotate(calc(var(--a, 0deg) * -0.75)); } 55%, 100% { transform: rotate(calc(var(--a, 0deg) * -0.75 - 360deg)); } }
  .fs-kid-arm { transform-box: view-box; transform-origin: 10.5px 20.5px; animation: fs-tug 1.8s ease-in-out infinite; }
  @keyframes fs-tug { 0%, 60%, 100% { transform: none; } 70% { transform: rotate(-12deg); } 80% { transform: rotate(4deg); } }

  .fs-wave { animation: fs-wave 1.5s ease-in-out infinite; animation-delay: calc(var(--k) * -0.14s); }
  @keyframes fs-wave { 0%, 100% { transform: translateY(calc(var(--amp) * -1px)); } 50% { transform: translateY(calc(var(--amp) * 1px)); } }

  .fs-fire { transform-box: fill-box; transform-origin: 50% 100%; animation: fs-flicker 0.9s ease-in-out infinite alternate; animation-delay: var(--d, 0s); }
  @keyframes fs-flicker {
    0% { transform: scale(1, 1) rotate(0); }
    35% { transform: scale(0.88, 1.12) rotate(-4deg); }
    70% { transform: scale(1.06, 0.92) rotate(3deg); }
    100% { transform: scale(0.95, 1.06) rotate(-1deg); }
  }
  html[data-scene="night"] .fs-diya .fs-glow { animation: fs-glow 1.3s ease-in-out infinite alternate; animation-delay: var(--d, 0s); }
  @keyframes fs-glow { to { opacity: calc(var(--fs-glow-op) * 0.6); } }

  .fs-kandil, .fs-xstar, .fs-wstar { animation: fs-swing 3.4s ease-in-out infinite alternate; animation-delay: var(--d, 0s); }
  @keyframes fs-swing { from { transform: rotate(-4deg); } to { transform: rotate(4deg); } }

  .fs-ledge i:nth-child(1) { animation: fs-blink 1.6s steps(1) infinite; }
  .fs-ledge i:nth-child(2) { animation: fs-blink 1.6s steps(1) infinite; animation-delay: -0.8s; }
  @keyframes fs-blink { 50% { opacity: 0.25; } }
  .fs-tw circle { animation: fs-blink 1.4s steps(1) infinite; }
  .fs-tw circle:nth-child(even) { animation-delay: -0.7s; }

  .fs-puff i { animation: fs-puff 2.8s ease-out forwards; }
  .fs-puff i:nth-child(2) { animation-delay: 0.08s; }
  .fs-puff i:nth-child(3) { animation-delay: 0.16s; }
  .fs-puff b { animation: fs-speck 2.4s ease-out forwards; }
  @keyframes fs-puff { 0% { opacity: 0; transform: scale(0.2) translateY(14px); } 14% { opacity: 0.85; } 100% { opacity: 0; transform: scale(1.7) translateY(-16px); } }
  @keyframes fs-speck { 0% { opacity: 0; transform: scale(0.3); } 18% { opacity: 0.9; } 100% { opacity: 0; transform: scale(1.5) translateY(-6px); } }
}
