/* Festival art, greeting and the spin wheel (assets/js/festival.js). Loaded only on pages that show one of them (inc/festival.php). */
.fest-fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.hero.has-fest > .container { position: relative; z-index: 1; }
.fest-lamps { display: flex; gap: 12px; align-items: flex-end; margin: 14px 0 4px; pointer-events: none; }
.fest-lamps svg { width: 58px; height: 44px; overflow: visible; }
/* lit diyas: the flame sways and flickers from its base, the core flickers faster, the glow breathes */
.fest-lamps .fl { transform-box: fill-box; transform-origin: 50% 100%; animation: fest-flick 1.3s ease-in-out infinite; }
.fest-lamps .fi { animation-duration: .9s; }
.fest-lamps .gl { transform-box: fill-box; transform-origin: center; animation: fest-glow 2.4s ease-in-out infinite; }
.fest-lamps svg:nth-child(2) .fl, .fest-lamps svg:nth-child(2) .gl { animation-delay: -.5s; }
.fest-lamps svg:nth-child(3) .fl, .fest-lamps svg:nth-child(3) .gl { animation-delay: -1.1s; }
.fest-lamps svg:nth-child(4) .fl, .fest-lamps svg:nth-child(4) .gl { animation-delay: -.8s; }
.fest-lamps svg:nth-child(5) .fl, .fest-lamps svg:nth-child(5) .gl { animation-delay: -.3s; }
@keyframes fest-flick { 0%, 100% { transform: scale(1, 1) rotate(-2deg); opacity: .95; } 25% { transform: scale(.92, 1.12) rotate(3deg); opacity: 1; }
  50% { transform: scale(1.05, .93) rotate(-3deg); opacity: .9; } 75% { transform: scale(.97, 1.07) rotate(2deg); opacity: 1; } }
.fest-art svg { width: auto; height: 46px; max-width: 100%; overflow: visible; }
.fest-art .sw { transform-box: view-box; animation: fest-swing 3.2s ease-in-out infinite; }
.fest-art--navratri .sw { transform-box: fill-box; transform-origin: 50% 0; }
.fest-art--eid .sw { transform-box: fill-box; transform-origin: 50% 0; }
.fest-art .sw:nth-child(odd) { animation-delay: -1.2s; }
.fest-art .ff { transform-box: fill-box; transform-origin: 50% 0; animation: fest-flutter 1.7s ease-in-out infinite; }
.fest-art .ff:nth-child(3n) { animation-delay: -.6s; } .fest-art .ff:nth-child(3n+1) { animation-delay: -1.1s; }
.fest-art .tw { transform-box: fill-box; transform-origin: center; animation: fest-twinkle 2.2s ease-in-out infinite; }
.fest-art .tw:nth-child(2n) { animation-delay: -1s; } .fest-art .tw:nth-child(3n) { animation-delay: -1.6s; }
.fest-art .rot { animation: fest-turnslow 26s linear infinite; }
@keyframes fest-swing { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
@keyframes fest-flutter { 0%, 100% { transform: skewX(0) scaleY(1); } 50% { transform: skewX(-8deg) scaleY(.94); } }
@keyframes fest-twinkle { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.8); opacity: .6; } }
@keyframes fest-turnslow { to { transform: rotate(360deg); } }
@keyframes fest-glow { 0%, 100% { transform: scale(1); opacity: .7; } 50% { transform: scale(1.18); opacity: 1; } }

.fest-greet { position: fixed; top: calc(var(--header-h) + 52px); right: 18px; z-index: 70; width: min(380px, calc(100% - 24px)); background: #fff; border-radius: 16px; box-shadow: 0 16px 38px rgba(18, 22, 51, .22);
  padding: 12px 42px 14px 12px; display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; align-items: center; overflow: hidden; animation: fest-in .5s cubic-bezier(.2, .8, .2, 1); }
.fest-greet[hidden] { display: none !important; }
@keyframes fest-in { from { opacity: 0; transform: translateY(-12px); } }
.fest-greet__icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: #FFF4E3; overflow: hidden; }
.fest-greet__icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fest-greet__body { min-width: 0; display: grid; gap: 3px; transition: opacity .3s ease; }   /* English and the visitor's language take turns */
.fest-greet__body.is-out { opacity: 0; }
.fest-greet__title { font-family: var(--font-head); font-weight: 700; color: var(--saffron); font-size: 17px; line-height: 1.25; margin: 0; }
.fest-greet__text { font-size: 13px; color: var(--body); line-height: 1.45; margin: 0; }
.fest-greet__text a { color: var(--teal); font-weight: 600; white-space: nowrap; }
.fest-greet__x { position: absolute; right: 6px; top: 6px; width: 32px; height: 32px; border: 0; background: transparent; font-size: 20px; line-height: 1; color: var(--muted); cursor: pointer; border-radius: 50%; }
.fest-greet__bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--warm); transform-origin: left; animation: fest-bar 8s linear forwards; }
@keyframes fest-bar { to { transform: scaleX(0); } }

.fest-wheel { position: fixed; left: 16px; bottom: calc(82px + env(safe-area-inset-bottom, 0px)); z-index: 54; width: 60px; height: 60px; border-radius: 50%; border: 0; padding: 0; background: #fff;
  box-shadow: 0 8px 22px rgba(28, 28, 60, .28); cursor: pointer; display: grid; place-items: center; }
.fest-wheel[hidden] { display: none !important; }
.fest-wheel svg { width: 52px; height: 52px; display: block; }
.fest-wheel .wh { transform-box: fill-box; transform-origin: center; animation: fest-turn 7s ease-in-out infinite; }
@keyframes fest-turn { 0% { transform: rotate(0); } 50% { transform: rotate(360deg); } 100% { transform: rotate(360deg); } }
.fest-wheel__pin { position: absolute; top: -3px; left: 50%; transform: translateX(-50%); border-left: 7px solid transparent; border-right: 7px solid transparent; border-top: 12px solid var(--saffron); }
.fest-bubble { position: fixed; left: 88px; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); z-index: 54; background: var(--saffron); color: #fff; font-size: 13px; font-weight: 600; padding: 8px 14px; border-radius: 20px;
  box-shadow: 0 8px 20px rgba(129, 17, 135, .35); white-space: nowrap; cursor: pointer; border: 0; font-family: inherit; animation: fest-pop .4s ease-out; }
.fest-bubble[hidden] { display: none !important; }
.fest-bubble::before { content: ""; position: absolute; left: -6px; top: 50%; transform: translateY(-50%); border: 6px solid transparent; border-right-color: var(--saffron); border-left: 0; }
@keyframes fest-pop { from { opacity: 0; transform: translateX(-8px); } }

.fest-modal { position: fixed; inset: 0; z-index: 95; background: rgba(18, 22, 51, .55); display: grid; place-items: center; padding: 16px; }
.fest-modal[hidden] { display: none !important; }
.fest-dlg { position: relative; width: min(420px, 100%); max-height: calc(100% - 8px); overflow: auto; background: #fff; border-radius: 20px; padding: 24px 22px 20px; display: grid; gap: 12px; text-align: center; box-shadow: 0 22px 48px rgba(0, 0, 0, .3); }
.fest-dlg h2 { font-size: 22px; margin: 0; }
.fest-dlg p { font-size: 13.5px; color: var(--muted); margin: 0; }
.fest-dlg .fest-x { position: absolute; right: 8px; top: 8px; width: 36px; height: 36px; border: 0; background: transparent; font-size: 22px; color: var(--muted); cursor: pointer; border-radius: 50%; }
.fest-step[hidden] { display: none !important; }
.fest-step { display: grid; gap: 12px; }
.fest-wheelbox { position: relative; width: 250px; max-width: 100%; margin: 0 auto; }
.fest-wheelbox svg { width: 100%; height: auto; display: block; }
.fest-wheelbox .wg, .fest-wheelbox .lb { transition: transform 7s cubic-bezier(.1, .55, .12, 1); }   /* slow, calm stop */
.fest-wheelbox .lb { transform-box: fill-box; transform-origin: center; }
.fest-wheelbox__ptr { position: absolute; top: -4px; left: 50%; transform: translateX(-50%); border-left: 13px solid transparent; border-right: 13px solid transparent; border-top: 24px solid var(--saffron); filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .3)); }
.fest-won { font-family: var(--font-head); font-size: 26px; font-weight: 700; color: var(--saffron); }
.fest-dlg .field { text-align: left; margin: 0; }
.fest-phone { display: grid; grid-template-columns: 104px 1fr; gap: 8px; }
.fest-check { display: flex; gap: 8px; text-align: left; font-size: 12.5px; color: var(--body); align-items: flex-start; }
.fest-check input { margin-top: 3px; }
.fest-err { color: var(--error); font-size: 13px; text-align: left; margin: 0; }
.fest-left { font-size: 13px; color: var(--body); background: #FFF6E5; border-radius: 10px; padding: 7px 10px; margin: 0 0 4px; text-align: center; }
.fest-left b { color: #811187; }
.fest-code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 24px; letter-spacing: .08em; font-weight: 700; color: var(--ink); background: #FFF4E3; border: 2px dashed var(--warm); border-radius: 12px; padding: 10px; }
.fest-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fest-link { background: none; border: 0; color: var(--teal); font: inherit; font-size: 13px; cursor: pointer; text-decoration: underline; }

@media (max-width: 760px) {
  .fest-greet { top: calc(var(--header-h) + 10px); right: 12px; left: 12px; width: auto; }
  .fest-greet__text .fest-greet__s { display: none; }
  .fest-greet__icon { width: 36px; height: 36px; }
  .fest-wheel { width: 52px; height: 52px; left: 12px; bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
  .fest-wheel svg { width: 44px; height: 44px; }
  .template-tour .fest-wheel, .has-book-bar .fest-wheel { bottom: calc(148px + env(safe-area-inset-bottom, 0px)); }
  .fest-bubble { left: 74px; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
  .template-tour .fest-bubble, .has-book-bar .fest-bubble { bottom: calc(160px + env(safe-area-inset-bottom, 0px)); }
  .fest-lamps svg { width: 46px; height: 35px; }
  .fest-art svg { width: auto; height: 40px; }
  .fest-modal { place-items: end center; padding: 0; }
  .fest-dlg { width: 100%; border-radius: 20px 20px 0 0; max-height: 92%; }
}
@media (prefers-reduced-motion: reduce) {
  .fest-lamps .fl, .fest-lamps .gl, .fest-art .sw, .fest-art .ff, .fest-art .tw, .fest-art .rot, .fest-wheel .wh, .fest-greet, .fest-greet__bar, .fest-bubble { animation: none !important; }
  .fest-wheelbox .wg, .fest-wheelbox .lb { transition-duration: .01s; }
}
@media print { .fest-fx, .fest-greet, .fest-wheel, .fest-bubble, .fest-modal { display: none !important; } }
