/* ===== Telugu Radio – per-mode immersive animation layer ===== */
#fx, #frames { position:fixed; inset:0; pointer-events:none; }
#fx { width:100%; height:100%; }
.bg { scale:calc(1 + var(--pulse, 0) * .03); transform-origin:50% 55%; }
.fr { position:absolute; inset:0; animation:frIn .6s ease both; }
@keyframes frIn { from { opacity:0; } to { opacity:1; } }

/* ---------- shared: hanging nimmakaya-mirchi charm ---------- */
.charm { position:absolute; width:clamp(44px,3.6vw,72px); transform-origin:50% 0; animation:swing 1.9s ease-in-out infinite alternate; filter:drop-shadow(0 0 10px rgba(255,230,120,.35)) drop-shadow(0 8px 10px rgba(0,0,0,.6)); }
.charm svg { display:block; width:100%; height:auto; }
@keyframes swing { from { transform:rotate(-13deg); } to { transform:rotate(13deg); } }

/* ---------- AUTO: inside the auto ---------- */
.fr-auto .charm { animation:swing 1.1s ease-in-out infinite alternate; }
@keyframes bump  { 0%{transform:translate(0,0) rotate(0)} 20%{transform:translate(-1.5px,2px) rotate(-.12deg)} 40%{transform:translate(1px,-1px) rotate(.08deg)} 60%{transform:translate(-.5px,1.5px) rotate(.1deg)} 80%{transform:translate(1.5px,-.5px) rotate(-.06deg)} 100%{transform:translate(0,0) rotate(0)} }
@keyframes bump2 { 0%{transform:translate(0,0) rotate(0)} 25%{transform:translate(2px,3px) rotate(.2deg)} 50%{transform:translate(-2px,-2px) rotate(-.15deg)} 75%{transform:translate(1px,2.5px) rotate(.12deg)} 100%{transform:translate(0,0) rotate(0)} }
@keyframes pothole { 0%{transform:translateY(0)} 15%{transform:translateY(14px) rotate(.6deg)} 35%{transform:translateY(-9px) rotate(-.5deg)} 55%{transform:translateY(5px)} 75%{transform:translateY(-2px)} 100%{transform:translateY(0)} }
.auto-top { position:absolute; left:-2vw; right:-2vw; top:-2px; height:12vh; min-height:70px; background:linear-gradient(180deg,#050505,#151515 70%,#1d1d1d); border-radius:0 0 50% 50% / 0 0 46px 46px; box-shadow:0 5px 0 #f4c20d, 0 10px 0 #157a34, 0 18px 30px rgba(0,0,0,.6); display:flex; align-items:flex-end; justify-content:center; padding-bottom:1.4vh; }
.auto-top span { font-family:"Yatra One",serif; font-size:clamp(14px,1.8vw,22px); color:#f4c20d; letter-spacing:.06em; text-shadow:0 0 10px rgba(244,194,13,.35); }
.auto-post { position:absolute; top:9vh; bottom:-2vh; width:clamp(18px,3vw,44px); background:linear-gradient(90deg,#000,#1e1e1e 45%,#070707); box-shadow:0 0 30px rgba(0,0,0,.7); }
.auto-post.l { left:0; transform:skewX(4deg); transform-origin:top; border-right:4px solid #f4c20d; }
.auto-post.r { right:0; transform:skewX(-4deg); transform-origin:top; border-left:4px solid #f4c20d; }
.fr-auto .charm { top:0; left:50%; }
.bubble { position:fixed; z-index:4; pointer-events:none; padding:9px 15px; border-radius:16px 16px 16px 4px; background:#fff8ee; color:#2a1206; font-weight:700; font-size:15px; box-shadow:0 10px 30px rgba(0,0,0,.4); opacity:0; transform:scale(.6) rotate(-4deg); transition:opacity .25s, transform .35s cubic-bezier(.3,1.6,.5,1); }
.bubble.show { opacity:1; transform:scale(1) rotate(-4deg); }

/* ---------- LORRY: cabin windshield ---------- */
body.fx-lorry .bg { animation:sway 7s ease-in-out infinite; }
.fr-lorry { animation:frIn .6s ease both, sway2 7s ease-in-out infinite; }
@keyframes sway  { 0%,100%{transform:rotate(0) translateX(0)} 50%{transform:rotate(.35deg) translateX(4px)} }
@keyframes sway2 { 0%,100%{transform:rotate(0)} 50%{transform:rotate(-.5deg) translateY(2px)} }
.ws { position:absolute; left:4.5vw; right:4.5vw; top:8vh; bottom:24vh; border-radius:56px 56px 16px 16px; box-shadow:0 0 0 200vmax rgba(9,8,10,.9), inset 0 0 80px rgba(0,0,0,.55), inset 0 0 0 3px rgba(255,255,255,.05); }
.garland { position:absolute; left:4.5vw; right:4.5vw; top:calc(8vh - 6px); width:91vw; height:auto; filter:drop-shadow(0 6px 6px rgba(0,0,0,.5)); transform-origin:50% 0; animation:garland 3.4s ease-in-out infinite alternate; }
@keyframes garland { from { transform:rotate(-.6deg); } to { transform:rotate(.6deg); } }
.fr-lorry .charm { top:calc(8vh + 40px); left:66%; }
.dash { position:absolute; left:0; right:0; bottom:0; height:24vh; background:linear-gradient(180deg,#141210,#060505); border-top:2px solid rgba(255,255,255,.06); }
.dash i { position:absolute; bottom:6vh; width:64px; height:64px; border-radius:50%; border:3px solid rgba(255,170,60,.7); box-shadow:0 0 18px rgba(255,150,40,.45), inset 0 0 14px rgba(255,150,40,.35); }
.dash i:nth-child(1) { left:7vw; } .dash i:nth-child(2) { left:calc(7vw + 80px); width:48px; height:48px; bottom:7vh; }
.dash i::after { content:""; position:absolute; left:50%; top:50%; width:2px; height:42%; background:#ffb347; transform-origin:50% 0; animation:needle 2.6s ease-in-out infinite alternate; }
@keyframes needle { from { transform:rotate(120deg); } to { transform:rotate(200deg); } }

/* ---------- BARBER SHOP ---------- */
.fan-shadow { position:absolute; left:50%; top:-40vmax; width:150vmax; height:150vmax; margin-left:-75vmax; border-radius:50%;
  background:conic-gradient(rgba(0,0,0,.28) 0 18deg, transparent 18deg 120deg, rgba(0,0,0,.28) 120deg 138deg, transparent 138deg 240deg, rgba(0,0,0,.28) 240deg 258deg, transparent 258deg);
  filter:blur(22px); animation:fan 1.1s linear infinite; mix-blend-mode:multiply; }
@keyframes fan { to { transform:rotate(360deg); } }
.pole { position:absolute; top:16vh; height:44vh; width:30px; border-radius:15px; overflow:hidden;
  background:repeating-linear-gradient(-45deg,#d72631 0 12px,#fff 12px 24px,#1d4ed8 24px 36px,#fff 36px 48px); background-size:100% 135.76px; animation:pole 1.6s linear infinite;
  box-shadow:inset -8px 0 12px rgba(0,0,0,.35), inset 6px 0 8px rgba(255,255,255,.5), 0 0 30px rgba(255,255,255,.15); }
.pole::before, .pole::after { content:""; position:absolute; left:-4px; right:-4px; height:18px; background:linear-gradient(90deg,#8c8c8c,#f4f4f4,#8c8c8c); border-radius:9px; }
.pole::before { top:0; } .pole::after { bottom:0; }
.pole.l { left:3vw; } .pole.r { right:3vw; }
@keyframes pole { to { background-position:0 135.76px; } }
.glint { position:absolute; inset:-20%; background:linear-gradient(115deg,transparent 42%,rgba(255,255,255,.14) 48%,rgba(255,255,255,.04) 52%,transparent 58%); animation:glint 7s ease-in-out infinite; }
@keyframes glint { 0%,70% { transform:translateX(-70%); } 100% { transform:translateX(70%); } }

/* ---------- VILLAGE CHAI SHOP ---------- */
.rays { position:absolute; inset:-10%; background:repeating-linear-gradient(110deg,transparent 0 70px,rgba(255,214,140,.10) 70px 120px,transparent 120px 200px);
  -webkit-mask-image:radial-gradient(ellipse at 20% 0%,#000 10%,transparent 70%); mask-image:radial-gradient(ellipse at 20% 0%,#000 10%,transparent 70%);
  animation:rays 9s ease-in-out infinite alternate; mix-blend-mode:screen; }
@keyframes rays { from { opacity:.55; transform:translateX(-2%); } to { opacity:1; transform:translateX(2%); } }

/* ---------- 90s MELODIES: old film ---------- */
body.fx-melody .bg .photo, body.fx-melody .bg .vid { filter:sepia(.45) saturate(.85) contrast(1.06); }
body.fx-melody .bg { animation:weave .16s steps(2) infinite; }
@keyframes weave { 0%{transform:translate(0,0)} 50%{transform:translate(.6px,-.8px)} 100%{transform:translate(0,0)} }

/* ---------- NIGHT DRIVE ---------- */
body.fx-drive .bg { animation:push 14s ease-in-out infinite alternate; }
@keyframes push { from { transform:scale(1); } to { transform:scale(1.07); } }
.dashglow { position:absolute; left:0; right:0; bottom:0; height:30vh; background:radial-gradient(ellipse at 50% 120%,rgba(80,160,255,.22),transparent 60%); }

/* ---------- DJ / PARTY / MASS ---------- */
.haze { position:absolute; left:0; right:0; bottom:0; height:45vh; background:linear-gradient(0deg,rgba(140,80,255,.18),transparent); animation:haze 6s ease-in-out infinite alternate; }
@keyframes haze { from { opacity:.5; } to { opacity:1; } }
body.fx-dj .bg .photo, body.fx-party .bg .photo { filter:saturate(1.25); }

/* ---------- illustrated scene (art/<mode>.jpg): bring a still painting to life ---------- */
body.art-scene .bg .photo.show { animation:artdrift 34s ease-in-out infinite alternate; }
@keyframes artdrift { from { transform:scale(1.03) translate(0,0); } to { transform:scale(1.11) translate(-2%,-1.2%); } }
body.art-scene .bg::before { content:""; position:absolute; inset:0; z-index:1; pointer-events:none; mix-blend-mode:screen;
  background:radial-gradient(ellipse at 52% 12%, rgba(255,196,110,.28), transparent 55%), radial-gradient(ellipse at 50% 100%, rgba(255,150,60,.12), transparent 60%);
  animation:bulb 5s steps(1,end) infinite; }
@keyframes bulb { 0%{opacity:.92} 38%{opacity:1} 40%{opacity:.55} 41%{opacity:1} 43%{opacity:.7} 44%{opacity:1} 72%{opacity:.88} 100%{opacity:.95} }

/* a painting already shows the vehicle / shop – hide the drawn frames and road lines over it */
body.art-scene.fx-lorry #fx, body.art-scene.fx-auto #fx, body.art-scene.fx-drive #fx, body.art-scene .dashglow,
body.art-scene .fr-lorry .ws, body.art-scene .fr-lorry .garland, body.art-scene .fr-lorry .dash, body.art-scene .fr-lorry .charm,
body.art-scene .fr-auto .charm, body.art-scene .fr-barber .pole, body.art-scene .fr-barber .glint { display:none; }
body.art-scene.fx-lorry .bg, body.art-scene .fr-lorry, body.art-scene.fx-drive .bg { animation:none; }

@media (prefers-reduced-motion:reduce) { .fr, .fr *, body[class*="fx-"] .bg { animation:none !important; } }
