Legal

Terms & Privacy

Effective March 2026 · India

Important: Taara provides astrological content for personal reflection and entertainment only. Nothing here constitutes medical, financial, legal, or psychological advice. By using Taara you accept this fully.

1. What Taara is

Taara is a digital astrology platform that uses Swiss Ephemeris-grade astronomical calculations (Lahiri ayanamsa) combined with traditional Vedic and Western interpretive frameworks. All readings are personalised tools for self-reflection — not predictions, not professional advice, and not guaranteed outcomes of any kind.

2. The service

Taara provides personalised birth charts, planetary readings, monthly forecasts, numerology analysis, and an AI-assisted oracle. All content is generated algorithmically based on the birth data you provide. Taara is not a licensed astrologer, therapist, counsellor, financial adviser, or medical practitioner. No relationship of professional reliance is created by use of this platform.

3. Subscriptions and payments

Monthly plans (Spark ₹145, Taara+ ₹495, Pro ₹995) are billed monthly from your first payment date. You may cancel at any time — access continues until the end of your current billing period.

Annual plans (Spark Annual ₹1,450, Plus Annual ₹3,950, Pro Annual ₹7,950) are billed as a single annual charge. Annual plans may not be cancelled mid-term for a prorated refund.

Year Ahead Report (₹2,500, one-time) is a complete 12-month personalised astrology document that downloads immediately after payment. This is a one-time purchase. It also activates Spark-level app access for 30 days from the date of purchase.

All payments are processed securely by Razorpay. Taara does not store your card details.

4. Refund policy

Because Taara delivers digital content at the moment of purchase, all sales are final except in the following circumstances:

  • You were charged more than once for the same plan in the same billing period
  • A verified technical failure on our platform prevented access for more than 48 consecutive hours
  • You contact us within 24 hours of your very first subscription payment and have not accessed any paid content

Readings that did not resonate personally, felt inaccurate, or did not correspond to real-world events are not grounds for a refund. This is consistent with the standard terms of all major astrology platforms.

5. Accuracy and disclaimer

Planetary positions are calculated using Swiss Ephemeris, accurate to within 1–2 arc-minutes for outer planets. Mercury and Venus positions in the web app are estimated; precise positions require the backend calculation server. You are solely responsible for the accuracy of the birth data you enter — incorrect time, date, or city will produce an inaccurate chart, and this is not grounds for a refund or dispute.

Astrological readings are not prophecy. They are interpretive frameworks based on astronomical positions and traditional symbolism. Taara makes no warranty, express or implied, that any reading will accurately describe past, present, or future events.

6. Your data and privacy

We collect the following data for the sole purpose of generating your chart and providing the service: name, date of birth, time of birth, place of birth, email address, and phone number.

We do not sell, rent, trade, or share your personal data with any third party for commercial purposes. We do not serve advertisements. We do not use your birth data to train AI models. Your data is stored locally in your browser and, where you have provided an email address, in our secure backend systems.

You may request deletion of your personal data at any time by writing to us at the contact address provided in the app. We will action deletion requests within 30 days. We comply with India's Digital Personal Data Protection Act 2023 (DPDPA) and, where applicable, the EU General Data Protection Regulation (GDPR).

7. Intellectual property

All Taara content — including but not limited to readings, brand identity, star map visualisation, calculation engine, and interpretive text — is the exclusive intellectual property of the platform operator. You may download and share your own generated report for personal use. You may not reproduce, resell, or redistribute any Taara content without written permission.

8. User conduct

You agree not to use Taara for any unlawful purpose, to attempt to reverse-engineer or extract the calculation engine, to create derivative works from the platform content, or to use automated means to access the service.

9. Limitation of liability

To the maximum extent permitted by applicable law, Taara's total liability to you in connection with any claim arising out of your use of the service shall not exceed the total amount you paid to Taara in the 30 days immediately preceding the event giving rise to the claim. Taara is not liable for any decisions made in reliance on astrological content, nor for any indirect, consequential, or speculative losses of any kind.

10. Governing law

These terms are governed by and construed in accordance with the laws of India. Any dispute arising from or relating to these terms or your use of Taara shall be subject to the exclusive jurisdiction of the courts of India. Consumer grievances may also be directed to the National Consumer Helpline at 1800-11-4000.

11. Changes to these terms

Taara reserves the right to update these terms at any time. Continued use of the service after any update constitutes acceptance of the revised terms. The effective date above will be updated to reflect any material changes.

Support: [email protected]
Taara · Ancient Precision. Modern Clarity. · © 2026
Choose your plan
Unlock the full power of your chart
₹145/mo
Spark
Full reading · 5 domains · Numerology · 1 oracle question
POPULAR
₹495/mo
Taara+
Everything + next month forecast · 3 oracle questions · 2-month download
₹995/mo
Pro
Everything + 3 months · Unlimited oracle · 9-mo PDF · Kundali Milan
Maybe later
Taara
Ancient precision · Modern clarity

Your Vedic birth chart, Nakshatra reading,
and the sky above — built for you alone.

Vedic birth chart
9 planets · Lagna · Dasha · Panchanga · Nakshatra
Western transits
Weekly planetary digest personalised to your chart
The oracle
Ask the universe directly — Spark, Plus & Pro plans
Continue my reading →
Precision matters

Where & when?

Birth time + city gives you an accurate Ascendant — the most personal point in your chart.

Don't know birth time? Use noon →

Save your chart
This was the sky
when you were born.
Your chart

Vedic · LahiriSidereal at birth
Loading today's sky…
This week
Western · Weekly sky
Your period
Vedic · Dasha

This month
Western · TransitsVedic · Natal

Planets
Vedic · Lahiri
Panchanga at birth
Vedic · Almanac
Ask the universe

3 questions this session

'; // ── Save as .html ──────────────────────────────────────────────── var blob=new Blob([html],{type:'text/html;charset=utf-8'}); var url=URL.createObjectURL(blob); var a=document.createElement('a'); a.href=url; a.download='taara-report-'+name.toLowerCase().replace(/\s+/g,'-')+'-'+new Date().getFullYear()+'.html'; document.body.appendChild(a);a.click();document.body.removeChild(a);URL.revokeObjectURL(url); showToast('Report downloaded ✦ Open in browser to print as PDF'); } // ════════════════════════════════════════════════ // ASK THE UNIVERSE // ════════════════════════════════════════════════ function initAsk(){ S.qLeft=S.plan==='pro'||S.plan==='pro_yr'?9999:S.plan==='plus'||S.plan==='plus_yr'?3:1; document.getElementById('ask-msgs').innerHTML=''; addAskMsg('sys','The universe is listening, '+(S.user.name||'Seeker')+'.'); var q=document.getElementById('ask-quota'); if(q)q.textContent=S.plan==='pro'?'Unlimited questions':S.qLeft+' questions this session'; renderAskFoot(); } function renderAskFoot(){ var foot=document.getElementById('ask-foot');if(!foot)return; if(S.plan!=='pro'&&S.qLeft<=0){ foot.innerHTML='

You\'ve used your questions for this session.

'+(S.plan!=='pro'?'':'')+'
'; }else{ foot.innerHTML='
'; } } function addAskMsg(role,text){ var el=document.getElementById('ask-msgs');if(!el)return; var div=document.createElement('div'); if(role==='sys'){div.className='msys';div.textContent=text;} else if(role==='user'){div.className='muser';div.textContent=text;} else if(role==='oracle'){div.className='moracle';div.innerHTML='
✦ The universe speaks
'+text+'
';} else if(role==='think'){div.className='moracle';div.id='think-msg';div.innerHTML='
Consulting the stars…
';} el.appendChild(div);el.scrollTop=el.scrollHeight;return div; } function sendQ(){ var inp=document.getElementById('ainput');if(!inp)return; var q=inp.value.trim();if(!q)return; inp.value=''; var btn=document.getElementById('abtn');if(btn)btn.disabled=true; addAskMsg('user',q); if(S.plan!=='pro'){S.qLeft--;if(S.qLeft<=0)renderAskFoot();} addAskMsg('think',''); setTimeout(function(){ var k2=S._k||calcKundali(S.user.dob,S.user.tob||'12:00',S.user.city||''); var reply=localOracleResponse(q,S.user,k2); var th=document.getElementById('think-msg');if(th)th.remove(); addAskMsg('oracle',reply); if(btn&&S.qLeft>0)btn.disabled=false; },1500); } // ════════════════════════════════════════════════ // SKY SHARE // ════════════════════════════════════════════════ function shareSky(){ var svg=document.getElementById('sky-svg');if(!svg){showToast('Sky not ready');return;} try{ var xml=new XMLSerializer().serializeToString(svg); var canvas=document.createElement('canvas');canvas.width=400;canvas.height=420; var ctx=canvas.getContext('2d'); var img=new Image(); var blob=new Blob([xml],{type:'image/svg+xml'}); var url=URL.createObjectURL(blob); img.onload=function(){ctx.drawImage(img,0,0);canvas.toBlob(function(b){if(!b){showToast('Take a screenshot to share ✦');return;}var a=document.createElement('a');a.download='my-birth-sky-taara.png';a.href=URL.createObjectURL(b);a.click();URL.revokeObjectURL(a.href);showToast('Birth sky saved ✦');});URL.revokeObjectURL(url);}; img.onerror=function(){URL.revokeObjectURL(url);showToast('Take a screenshot to share ✦');}; img.src=url; }catch(e){showToast('Take a screenshot to share ✦');} } // ════════════════════════════════════════════════ // STARFIELD // ════════════════════════════════════════════════ (function(){ var cvs=document.getElementById('stars');if(!cvs)return; var ctx=cvs.getContext('2d'),stars=[]; function resize(){cvs.width=window.innerWidth;cvs.height=window.innerHeight;} resize();window.addEventListener('resize',resize); for(var i=0;i<120;i++)stars.push({x:Math.random(),y:Math.random(),r:Math.random()*.75+.15,ph:Math.random()*Math.PI*2,sp:Math.random()*.22+.07,rose:i%6===0}); function draw(t){ ctx.clearRect(0,0,cvs.width,cvs.height); stars.forEach(function(s){ var a=.03+.2*Math.abs(Math.sin(t*.0004*s.sp+s.ph)); ctx.beginPath();ctx.arc(s.x*cvs.width,s.y*cvs.height,s.r,0,Math.PI*2); ctx.fillStyle=s.rose?'rgba(200,96,144,'+a.toFixed(3)+')':'rgba(232,160,48,'+a.toFixed(3)+')'; ctx.fill(); }); requestAnimationFrame(draw); } requestAnimationFrame(draw); })(); // ════════════════════════════════════════════════ // TOAST // ════════════════════════════════════════════════ function showToast(msg){var el=document.getElementById('toast');el.textContent=msg;el.classList.add('on');setTimeout(function(){el.classList.remove('on');},2600);} // ════════════════════════════════════════════════ // CITY SEARCH DROPDOWN // ════════════════════════════════════════════════ function filterCities(){ var inp=document.getElementById('f-city'); var list=document.getElementById('city-list'); if(!inp||!list)return; var q=(inp.value||'').toLowerCase().trim(); if(q.length<1){list.style.display='none';return;} var matches=[]; for(var i=0;i=0||city[4].toLowerCase().indexOf(q)>=0||city[5].toLowerCase().indexOf(q)>=0){ matches.push(i);if(matches.length>=12)break; } } if(matches.length===0){list.style.display='none';return;} list.innerHTML=matches.map(function(idx){ var c=CITY_DB[idx]; return '
'+c[0]+'
'+c[4]+', '+c[5]+'
'; }).join(''); list.style.display='block'; } function showCityList(){ var inp=document.getElementById('f-city'); if(inp&&inp.value.length>=1)filterCities(); } function selectCity(idx){ var c=CITY_DB[idx]; var inp=document.getElementById('f-city'); var list=document.getElementById('city-list'); if(inp)inp.value=c[0]+', '+c[4]+', '+c[5]; if(list)list.style.display='none'; S._cityData=c; // cache for instant lookup } // Close dropdown when clicking outside document.addEventListener('click',function(e){ var list=document.getElementById('city-list'); var inp=document.getElementById('f-city'); if(list&&inp&&!inp.contains(e.target)&&!list.contains(e.target))list.style.display='none'; }); // ════════════════════════════════════════════════ // STUBS (for engine compatibility) // ════════════════════════════════════════════════ function t(k){return k;} // go_silent defined below function go(id){goTo(id);} var S_state=S; function saveState(){sv();} // ════ CALCULATION ENGINE ════ // ASTRONOMY ENGINE — verbatim from drishti // ═══════════════════════════════════════════════════ function mod360(x){return((x%360)+360)%360;} function rad(d){return d*Math.PI/180;} // City database: [name, lat, lon, tz_offset, state, country] var CITY_DB=[ ["Port Blair",11.66,92.73,5.5], ["Vijayawada",16.51,80.62,5.5], ["Visakhapatnam",17.69,83.22,5.5], ["Guntur",16.3,80.44,5.5], ["Nellore",14.44,79.99,5.5], ["Kurnool",15.83,78.05,5.5], ["Rajahmundry",17.01,81.78,5.5], ["Tirupati",13.65,79.42,5.5], ["Kadapa",14.47,78.82,5.5], ["Anantapur",14.68,77.6,5.5], ["Eluru",16.71,81.09,5.5], ["Ongole",15.5,80.04,5.5], ["Nandyal",15.48,78.48,5.5], ["Machilipatnam",16.19,81.13,5.5], ["Adoni",15.63,77.27,5.5], ["Chittoor",13.22,79.1,5.5], ["Hindupur",13.83,77.49,5.5], ["Bhimavaram",16.54,81.52,5.5], ["Srikakulam",18.3,83.9,5.5], ["Vizianagaram",18.11,83.42,5.5], ["Proddatur",14.75,78.55,5.5], ["Amaravati",16.51,80.51,5.5], ["Itanagar",27.09,93.62,5.5], ["Naharlagun",27.1,93.7,5.5], ["Pasighat",28.07,95.33,5.5], ["Guwahati",26.19,91.75,5.5], ["Silchar",24.83,92.79,5.5], ["Dibrugarh",27.47,94.9,5.5], ["Jorhat",26.75,94.22,5.5], ["Nagaon",26.35,92.68,5.5], ["Tinsukia",27.49,95.36,5.5], ["Tezpur",26.63,92.8,5.5], ["Bongaigaon",26.48,90.56,5.5], ["Dhubri",26.02,89.98,5.5], ["Karimganj",24.87,92.37,5.5], ["Haflong",25.17,93.02,5.5], ["Diphu",25.84,93.43,5.5], ["Patna",25.6,85.13,5.5], ["Gaya",24.79,85.01,5.5], ["Bhagalpur",25.25,87.0,5.5], ["Muzaffarpur",26.12,85.39,5.5], ["Purnia",25.78,87.47,5.5], ["Darbhanga",26.16,85.9,5.5], ["Bihar Sharif",25.2,85.52,5.5], ["Arrah",25.56,84.66,5.5], ["Begusarai",25.42,86.13,5.5], ["Katihar",25.54,87.57,5.5], ["Munger",25.38,86.47,5.5], ["Chhapra",25.78,84.75,5.5], ["Saharsa",25.88,86.6,5.5], ["Hajipur",25.69,85.21,5.5], ["Samastipur",25.86,85.78,5.5], ["Siwan",26.22,84.36,5.5], ["Nawada",24.89,85.54,5.5], ["Buxar",25.56,83.98,5.5], ["Chandigarh",30.73,76.78,5.5], ["Raipur",21.25,81.63,5.5], ["Bhilai",21.21,81.38,5.5], ["Bilaspur CG",22.09,82.15,5.5], ["Durg",21.19,81.28,5.5], ["Rajnandgaon",21.1,81.03,5.5], ["Jagdalpur",19.08,82.04,5.5], ["Raigarh",21.9,83.4,5.5], ["Ambikapur",23.12,83.2,5.5], ["Korba",22.36,82.7,5.5], ["Silvassa",20.27,73.01,5.5], ["Daman",20.39,72.85,5.5], ["Diu",20.71,70.99,5.5], ["New Delhi",28.61,77.21,5.5], ["Delhi",28.67,77.22,5.5], ["Noida",28.54,77.39,5.5], ["Gurugram",28.46,77.03,5.5], ["Faridabad",28.41,77.31,5.5], ["Dwarka Delhi",28.59,77.05,5.5], ["Panaji",15.5,73.83,5.5], ["Margao",15.28,73.98,5.5], ["Vasco da Gama",15.4,73.81,5.5], ["Mapusa",15.59,73.81,5.5], ["Ponda",15.4,74.0,5.5], ["Ahmedabad",23.03,72.57,5.5], ["Surat",21.17,72.83,5.5], ["Vadodara",22.31,73.19,5.5], ["Rajkot",22.3,70.8,5.5], ["Bhavnagar",21.76,72.15,5.5], ["Jamnagar",22.47,70.07,5.5], ["Junagadh",21.52,70.46,5.5], ["Gandhinagar",23.22,72.64,5.5], ["Anand",22.56,72.95,5.5], ["Navsari",20.95,72.93,5.5], ["Morbi",22.82,70.84,5.5], ["Surendranagar",22.73,71.65,5.5], ["Mehsana",23.6,72.38,5.5], ["Bharuch",21.71,72.99,5.5], ["Patan Gujarat",23.85,72.13,5.5], ["Porbandar",21.64,69.63,5.5], ["Valsad",20.6,72.93,5.5], ["Amreli",21.6,71.22,5.5], ["Dahod",22.83,74.26,5.5], ["Godhra",22.78,73.61,5.5], ["Veraval",20.9,70.37,5.5], ["Gandhidham",23.08,70.12,5.5], ["Panipat",29.39,76.97,5.5], ["Ambala",30.38,76.78,5.5], ["Yamunanagar",30.13,77.27,5.5], ["Rohtak",28.89,76.61,5.5], ["Hisar",29.15,75.72,5.5], ["Karnal",29.69,76.99,5.5], ["Sonipat",28.99,77.01,5.5], ["Panchkula",30.7,76.85,5.5], ["Bhiwani",28.79,76.14,5.5], ["Sirsa",29.54,75.03,5.5], ["Jind",29.32,76.31,5.5], ["Rewari",28.2,76.62,5.5], ["Kaithal",29.8,76.4,5.5], ["Shimla",31.1,77.17,5.5], ["Dharamshala",32.22,76.32,5.5], ["Mandi",31.71,76.93,5.5], ["Solan",30.91,77.1,5.5], ["Kullu",31.96,77.11,5.5], ["Una",31.47,76.27,5.5], ["Hamirpur HP",31.68,76.52,5.5], ["Bilaspur HP",31.33,76.76,5.5], ["Nahan",30.56,77.29,5.5], ["Chamba",32.55,76.13,5.5], ["Srinagar",34.08,74.8,5.5], ["Jammu",32.73,74.87,5.5], ["Anantnag",33.73,75.15,5.5], ["Baramulla",34.2,74.35,5.5], ["Udhampur",32.92,75.14,5.5], ["Kathua",32.38,75.52,5.5], ["Ranchi",23.36,85.33,5.5], ["Jamshedpur",22.8,86.18,5.5], ["Dhanbad",23.8,86.45,5.5], ["Bokaro",23.67,86.15,5.5], ["Deoghar",24.48,86.7,5.5], ["Hazaribagh",23.99,85.37,5.5], ["Giridih",24.19,86.3,5.5], ["Dumka",24.27,87.25,5.5], ["Bengaluru",12.97,77.56,5.5], ["Bangalore",12.97,77.56,5.5], ["Mysuru",12.3,76.65,5.5], ["Mysore",12.3,76.65,5.5], ["Hubballi",15.36,75.14,5.5], ["Hubli",15.36,75.14,5.5], ["Mangaluru",12.87,74.88,5.5], ["Mangalore",12.87,74.88,5.5], ["Belagavi",15.85,74.5,5.5], ["Belgaum",15.85,74.5,5.5], ["Davanagere",14.46,75.92,5.5], ["Ballari",15.14,76.93,5.5], ["Shivamogga",13.93,75.57,5.5], ["Tumakuru",13.34,77.1,5.5], ["Raichur",16.2,77.36,5.5], ["Bidar",17.91,77.52,5.5], ["Vijayapura",16.83,75.72,5.5], ["Kalaburagi",17.33,76.82,5.5], ["Gulbarga",17.33,76.82,5.5], ["Hassan",13.0,76.1,5.5], ["Udupi",13.34,74.75,5.5], ["Dharwad",15.46,75.01,5.5], ["Mandya",12.52,76.9,5.5], ["Chikkamagaluru",13.32,75.78,5.5], ["Chitradurga",14.23,76.4,5.5], ["Gadag",15.42,75.63,5.5], ["Kolar",13.14,78.13,5.5], ["Chikkaballapur",13.44,77.73,5.5], ["Bagalkot",16.18,75.7,5.5], ["Haveri",14.79,75.4,5.5], ["Thiruvananthapuram",8.52,76.94,5.5], ["Trivandrum",8.52,76.94,5.5], ["Kochi",9.93,76.27,5.5], ["Cochin",9.93,76.27,5.5], ["Kozhikode",11.25,75.78,5.5], ["Calicut",11.25,75.78,5.5], ["Thrissur",10.53,76.22,5.5], ["Kollam",8.88,76.61,5.5], ["Palakkad",10.77,76.65,5.5], ["Alappuzha",9.49,76.33,5.5], ["Malappuram",11.07,76.07,5.5], ["Kannur",11.87,75.37,5.5], ["Kasaragod",12.5,74.99,5.5], ["Kottayam",9.59,76.52,5.5], ["Wayanad",11.61,76.08,5.5], ["Leh",34.17,77.58,5.5], ["Kargil",34.56,76.13,5.5], ["Kavaratti",10.56,72.64,5.5], ["Bhopal",23.26,77.41,5.5], ["Indore",22.72,75.86,5.5], ["Jabalpur",23.18,79.99,5.5], ["Gwalior",26.22,78.18,5.5], ["Ujjain",23.18,75.78,5.5], ["Sagar",23.84,78.74,5.5], ["Dewas",22.97,76.06,5.5], ["Satna",24.6,80.83,5.5], ["Ratlam",23.33,75.04,5.5], ["Rewa",24.53,81.3,5.5], ["Singrauli",24.2,82.67,5.5], ["Burhanpur",21.31,76.23,5.5], ["Khandwa",21.83,76.35,5.5], ["Bhind",26.56,78.79,5.5], ["Chhindwara",22.06,78.94,5.5], ["Shivpuri",25.42,77.66,5.5], ["Vidisha",23.52,77.81,5.5], ["Chhatarpur",24.92,79.59,5.5], ["Damoh",23.83,79.44,5.5], ["Mandsaur",24.07,75.07,5.5], ["Khargone",21.82,75.61,5.5], ["Hoshangabad",22.75,77.73,5.5], ["Morena",26.5,78.0,5.5], ["Guna",24.65,77.32,5.5], ["Mumbai",19.08,72.88,5.5], ["Bombay",19.08,72.88,5.5], ["Pune",18.52,73.86,5.5], ["Nagpur",21.15,79.09,5.5], ["Nashik",20.0,73.79,5.5], ["Aurangabad MH",19.88,75.32,5.5], ["Solapur",17.68,75.9,5.5], ["Thane",19.2,72.97,5.5], ["Kolhapur",16.7,74.23,5.5], ["Amravati",20.93,77.75,5.5], ["Navi Mumbai",19.03,73.03,5.5], ["Sangli",16.86,74.57,5.5], ["Malegaon",20.56,74.53,5.5], ["Jalgaon",21.0,75.57,5.5], ["Akola",20.71,77.0,5.5], ["Latur",18.4,76.56,5.5], ["Dhule",20.9,74.78,5.5], ["Ahmednagar",19.09,74.74,5.5], ["Chandrapur",19.96,79.3,5.5], ["Parbhani",19.27,76.78,5.5], ["Nanded",19.17,77.32,5.5], ["Beed",18.99,75.76,5.5], ["Yavatmal",20.4,78.12,5.5], ["Wardha",20.75,78.6,5.5], ["Gondia",21.46,80.2,5.5], ["Ratnagiri",16.99,73.31,5.5], ["Satara",17.69,74.0,5.5], ["Imphal",24.82,93.95,5.5], ["Shillong",25.57,91.88,5.5], ["Tura",25.51,90.2,5.5], ["Aizawl",23.73,92.72,5.5], ["Kohima",25.67,94.12,5.5], ["Dimapur",25.91,93.72,5.5], ["Bhubaneswar",20.3,85.82,5.5], ["Cuttack",20.46,85.88,5.5], ["Rourkela",22.26,84.87,5.5], ["Brahmapur",19.31,84.79,5.5], ["Sambalpur",21.47,83.97,5.5], ["Puri",19.81,85.83,5.5], ["Balasore",21.49,86.93,5.5], ["Baripada",21.93,86.73,5.5], ["Jharsuguda",21.86,84.01,5.5], ["Koraput",18.81,82.71,5.5], ["Sundargarh",22.12,84.02,5.5], ["Kendujhar",21.64,85.58,5.5], ["Puducherry",11.93,79.83,5.5], ["Pondicherry",11.93,79.83,5.5], ["Ludhiana",30.9,75.85,5.5], ["Amritsar",31.63,74.87,5.5], ["Jalandhar",31.33,75.58,5.5], ["Patiala",30.34,76.39,5.5], ["Bathinda",30.21,74.95,5.5], ["Mohali",30.7,76.72,5.5], ["Pathankot",32.27,75.65,5.5], ["Hoshiarpur",31.53,75.91,5.5], ["Moga",30.82,75.17,5.5], ["Gurdaspur",32.04,75.41,5.5], ["Firozpur",30.93,74.61,5.5], ["Faridkot",30.67,74.76,5.5], ["Abohar",30.15,74.2,5.5], ["Barnala",30.38,75.55,5.5], ["Sangrur",30.24,75.84,5.5], ["Jaipur",26.91,75.79,5.5], ["Jodhpur",26.29,73.02,5.5], ["Kota",25.18,75.84,5.5], ["Bikaner",28.01,73.31,5.5], ["Ajmer",26.46,74.64,5.5], ["Udaipur",24.58,73.68,5.5], ["Bhilwara",25.35,74.63,5.5], ["Alwar",27.56,76.61,5.5], ["Bharatpur",27.22,77.49,5.5], ["Sikar",27.62,75.14,5.5], ["Sri Ganganagar",29.92,73.88,5.5], ["Pali",25.77,73.33,5.5], ["Tonk",26.17,75.79,5.5], ["Barmer",25.75,71.39,5.5], ["Jalore",25.35,72.62,5.5], ["Jaisalmer",26.92,70.91,5.5], ["Banswara",23.55,74.44,5.5], ["Dungarpur",23.84,73.72,5.5], ["Bundi",25.44,75.64,5.5], ["Jhalawar",24.6,76.16,5.5], ["Sawai Madhopur",26.0,76.35,5.5], ["Dausa",26.88,76.33,5.5], ["Dholpur",26.7,77.89,5.5], ["Jhunjhunu",28.13,75.4,5.5], ["Churu",28.3,74.97,5.5], ["Nagaur",27.2,73.73,5.5], ["Hanumangarh",29.58,74.33,5.5], ["Chittorgarh",24.88,74.62,5.5], ["Rajsamand",25.07,73.88,5.5], ["Gangtok",27.33,88.62,5.5], ["Namchi",27.17,88.37,5.5], ["Chennai",13.08,80.27,5.5], ["Madras",13.08,80.27,5.5], ["Coimbatore",11.02,76.97,5.5], ["Madurai",9.93,78.12,5.5], ["Tiruchirappalli",10.8,78.69,5.5], ["Trichy",10.8,78.69,5.5], ["Salem",11.66,78.14,5.5], ["Tirunelveli",8.73,77.7,5.5], ["Tiruppur",11.11,77.34,5.5], ["Vellore",12.92,79.13,5.5], ["Erode",11.34,77.73,5.5], ["Thoothukudi",8.76,78.14,5.5], ["Dindigul",10.36,77.97,5.5], ["Thanjavur",10.79,79.14,5.5], ["Karur",10.96,78.08,5.5], ["Ooty",11.41,76.7,5.5], ["Hosur",12.74,77.83,5.5], ["Nagercoil",8.18,77.43,5.5], ["Kanchipuram",12.83,79.71,5.5], ["Kumbakonam",10.96,79.39,5.5], ["Cuddalore",11.75,79.77,5.5], ["Villupuram",11.94,79.49,5.5], ["Ramanathapuram",9.37,78.83,5.5], ["Namakkal",11.22,78.17,5.5], ["Tiruvannamalai",12.23,79.07,5.5], ["Krishnagiri",12.52,78.21,5.5], ["Kanyakumari",8.09,77.55,5.5], ["Hyderabad",17.38,78.47,5.5], ["Secunderabad",17.44,78.5,5.5], ["Warangal",17.98,79.6,5.5], ["Nizamabad",18.67,78.09,5.5], ["Karimnagar",18.43,79.13,5.5], ["Khammam",17.25,80.15,5.5], ["Mahbubnagar",16.74,77.99,5.5], ["Nalgonda",17.05,79.27,5.5], ["Adilabad",19.67,78.53,5.5], ["Agartala",23.84,91.28,5.5], ["Lucknow",26.85,80.95,5.5], ["Kanpur",26.45,80.35,5.5], ["Agra",27.18,78.02,5.5], ["Varanasi",25.32,83.01,5.5], ["Ghaziabad",28.67,77.44,5.5], ["Meerut",28.99,77.71,5.5], ["Prayagraj",25.44,81.84,5.5], ["Allahabad",25.44,81.84,5.5], ["Bareilly",28.35,79.41,5.5], ["Aligarh",27.88,78.08,5.5], ["Moradabad",28.84,78.77,5.5], ["Saharanpur",29.97,77.55,5.5], ["Gorakhpur",26.76,83.37,5.5], ["Jhansi",25.45,78.57,5.5], ["Mathura",27.5,77.67,5.5], ["Muzaffarnagar",29.47,77.69,5.5], ["Shahjahanpur",27.88,79.91,5.5], ["Rampur",28.81,79.03,5.5], ["Farrukhabad",27.39,79.58,5.5], ["Mau",25.94,83.56,5.5], ["Etawah",26.77,79.01,5.5], ["Mirzapur",25.15,82.57,5.5], ["Bulandshahr",28.41,77.85,5.5], ["Firozabad",27.15,78.39,5.5], ["Jaunpur",25.75,82.68,5.5], ["Bahraich",27.57,81.6,5.5], ["Sitapur",27.56,80.68,5.5], ["Unnao",26.54,80.5,5.5], ["Hardoi",27.41,80.13,5.5], ["Raebareli",26.23,81.24,5.5], ["Sultanpur",26.26,82.07,5.5], ["Gonda",27.13,81.96,5.5], ["Ballia",25.75,84.15,5.5], ["Azamgarh",26.07,83.18,5.5], ["Bijnor",29.37,78.14,5.5], ["Fatehpur UP",25.93,80.81,5.5], ["Deoria",26.5,83.78,5.5], ["Basti",26.8,82.73,5.5], ["Kannauj",27.05,79.93,5.5], ["Mainpuri",27.23,79.02,5.5], ["Hapur",28.73,77.78,5.5], ["Dehradun",30.32,78.03,5.5], ["Haridwar",29.96,78.16,5.5], ["Roorkee",29.86,77.89,5.5], ["Haldwani",29.22,79.52,5.5], ["Rudrapur",28.99,79.4,5.5], ["Rishikesh",30.09,78.27,5.5], ["Almora",29.6,79.66,5.5], ["Nainital",29.38,79.46,5.5], ["Mussoorie",30.45,78.06,5.5], ["Kolkata",22.57,88.36,5.5], ["Calcutta",22.57,88.36,5.5], ["Asansol",23.68,86.99,5.5], ["Siliguri",26.71,88.43,5.5], ["Durgapur",23.55,87.32,5.5], ["Bardhaman",23.24,87.86,5.5], ["Malda",25.01,88.14,5.5], ["Kharagpur",22.35,87.33,5.5], ["Cooch Behar",26.32,89.45,5.5], ["Darjeeling",27.04,88.26,5.5], ["Howrah",22.59,88.31,5.5], ["Jalpaiguri",26.54,88.72,5.5], ["New York",40.71,-74.01,-5], ["Los Angeles",34.05,-118.24,-8], ["Chicago",41.88,-87.63,-6], ["Houston",29.76,-95.37,-6], ["Phoenix",33.45,-112.07,-7], ["Philadelphia",39.95,-75.17,-5], ["San Antonio",29.42,-98.49,-6], ["San Diego",32.72,-117.16,-8], ["Dallas",32.78,-96.8,-6], ["San Francisco",37.77,-122.42,-8], ["Austin",30.27,-97.74,-6], ["Seattle",47.61,-122.33,-8], ["Denver",39.74,-104.98,-7], ["Boston",42.36,-71.06,-5], ["Atlanta",33.75,-84.39,-5], ["Miami",25.77,-80.19,-5], ["Washington DC",38.91,-77.04,-5], ["Las Vegas",36.17,-115.14,-8], ["Minneapolis",44.98,-93.27,-6], ["Detroit",42.33,-83.05,-5], ["Portland",45.52,-122.68,-8], ["Nashville",36.17,-86.78,-6], ["New Orleans",29.95,-90.07,-6], ["Memphis",35.15,-90.05,-6], ["Orlando",28.54,-81.38,-5], ["Tampa",27.95,-82.46,-5], ["Pittsburgh",40.44,-79.99,-5], ["Salt Lake City",40.76,-111.89,-7], ["Honolulu",21.31,-157.86,-10], ["Anchorage",61.22,-149.9,-9], ["Kansas City",39.1,-94.58,-6], ["Sacramento",38.58,-121.49,-8], ["San Jose CA",37.34,-121.89,-8], ["Charlotte",35.23,-80.84,-5], ["Indianapolis",39.77,-86.16,-5], ["Columbus OH",39.96,-82.99,-5], ["Toronto",43.65,-79.38,-5], ["Montreal",45.51,-73.57,-5], ["Vancouver",49.25,-123.12,-8], ["Calgary",51.05,-114.07,-7], ["Edmonton",53.55,-113.47,-7], ["Ottawa",45.42,-75.69,-5], ["Winnipeg",49.9,-97.14,-6], ["Quebec City",46.81,-71.21,-5], ["Halifax",44.65,-63.6,-4], ["London",51.51,-0.13,0], ["Birmingham UK",52.48,-1.9,0], ["Manchester",53.48,-2.24,0], ["Leeds",53.8,-1.55,0], ["Glasgow",55.86,-4.25,0], ["Liverpool",53.41,-2.99,0], ["Edinburgh",55.95,-3.19,0], ["Bristol",51.45,-2.59,0], ["Cardiff",51.48,-3.18,0], ["Belfast",54.6,-5.93,0], ["Sheffield",53.38,-1.47,0], ["Paris",48.85,2.35,1], ["Lyon",45.75,4.83,1], ["Marseille",43.3,5.37,1], ["Berlin",52.52,13.4,1], ["Hamburg",53.55,10.0,1], ["Munich",48.14,11.58,1], ["Frankfurt",50.11,8.68,1], ["Cologne",50.94,6.96,1], ["Stuttgart",48.78,9.18,1], ["Madrid",40.42,-3.7,1], ["Barcelona",41.39,2.16,1], ["Valencia",39.47,-0.38,1], ["Seville",37.38,-5.99,1], ["Bilbao",43.26,-2.93,1], ["Rome",41.9,12.48,1], ["Milan",45.47,9.19,1], ["Naples",40.84,14.25,1], ["Turin",45.07,7.69,1], ["Florence",43.77,11.25,1], ["Amsterdam",52.37,4.9,1], ["Rotterdam",51.92,4.48,1], ["Brussels",50.85,4.35,1], ["Antwerp",51.22,4.4,1], ["Zurich",47.38,8.54,1], ["Geneva",46.2,6.15,1], ["Bern",46.95,7.45,1], ["Lisbon",38.72,-9.14,0], ["Porto",41.16,-8.63,0], ["Stockholm",59.33,18.07,1], ["Gothenburg",57.71,11.97,1], ["Oslo",59.91,10.75,1], ["Bergen",60.39,5.32,1], ["Copenhagen",55.68,12.57,1], ["Helsinki",60.17,24.94,2], ["Warsaw",52.23,21.01,1], ["Krakow",50.06,19.94,1], ["Prague",50.08,14.44,1], ["Brno",49.2,16.61,1], ["Budapest",47.5,19.04,1], ["Vienna",48.21,16.37,1], ["Bucharest",44.43,26.1,2], ["Athens",37.98,23.73,2], ["Thessaloniki",40.64,22.94,2], ["Zagreb",45.81,15.98,1], ["Sofia",42.7,23.32,2], ["Kyiv",50.45,30.52,2], ["Minsk",53.9,27.57,3], ["Vilnius",54.69,25.28,2], ["Riga",56.95,24.11,2], ["Tallinn",59.44,24.75,2], ["Ljubljana",46.05,14.51,1], ["Bratislava",48.15,17.11,1], ["Belgrade",44.8,20.46,1], ["Sarajevo",43.85,18.36,1], ["Skopje",41.99,21.43,1], ["Tirana",41.33,19.83,1], ["Podgorica",42.44,19.26,1], ["Valletta",35.9,14.51,1], ["Nicosia",35.17,33.37,2], ["Reykjavik",64.13,-21.82,0], ["Dubai",25.2,55.27,4], ["Abu Dhabi",24.45,54.38,4], ["Sharjah",25.35,55.4,4], ["Riyadh",24.69,46.72,3], ["Jeddah",21.54,39.17,3], ["Mecca",21.42,39.83,3], ["Medina",24.47,39.61,3], ["Dammam",26.43,50.1,3], ["Kuwait City",29.37,47.98,3], ["Doha",25.29,51.53,3], ["Muscat",23.61,58.59,4], ["Manama",26.24,50.59,3], ["Amman",31.96,35.95,2], ["Beirut",33.89,35.5,2], ["Damascus",33.51,36.29,2], ["Baghdad",33.34,44.4,3], ["Basra",30.5,47.78,3], ["Tehran",35.69,51.39,3.5], ["Isfahan",32.66,51.67,3.5], ["Mashhad",36.3,59.6,3.5], ["Tabriz",38.08,46.3,3.5], ["Kabul",34.53,69.17,4.5], ["Jerusalem",31.77,35.23,2], ["Tel Aviv",32.07,34.78,2], ["Haifa",32.82,35.0,2], ["Sanaa",15.37,44.19,3], ["Aden",12.78,45.04,3], ["Singapore",1.35,103.82,8], ["Bangkok",13.75,100.52,7], ["Chiang Mai",18.79,98.98,7], ["Jakarta",-6.21,106.85,7], ["Surabaya",-7.26,112.75,7], ["Bandung",-6.92,107.61,7], ["Kuala Lumpur",3.14,101.69,8], ["Penang",5.41,100.34,8], ["Johor Bahru",1.46,103.74,8], ["Manila",14.6,120.98,8], ["Cebu",10.32,123.89,8], ["Davao",7.07,125.61,8], ["Ho Chi Minh City",10.82,106.63,7], ["Hanoi",21.03,105.85,7], ["Da Nang",16.07,108.22,7], ["Phnom Penh",11.56,104.92,7], ["Vientiane",17.97,102.6,7], ["Yangon",16.87,96.19,6.5], ["Naypyidaw",19.75,96.08,6.5], ["Bandar Seri Begawan",4.94,114.95,8], ["Dili",-8.56,125.58,9], ["Beijing",39.92,116.46,8], ["Shanghai",31.23,121.47,8], ["Guangzhou",23.13,113.26,8], ["Shenzhen",22.55,114.06,8], ["Chengdu",30.66,104.07,8], ["Chongqing",29.56,106.55,8], ["Wuhan",30.6,114.31,8], ["Xi'an",34.27,108.95,8], ["Hangzhou",30.29,120.16,8], ["Nanjing",32.06,118.78,8], ["Tianjin",39.14,117.18,8], ["Zhengzhou",34.75,113.66,8], ["Harbin",45.75,126.65,8], ["Kunming",25.05,102.71,8], ["Qingdao",36.07,120.38,8], ["Dalian",38.91,121.6,8], ["Xiamen",24.48,118.08,8], ["Changsha",28.23,112.94,8], ["Tokyo",35.69,139.69,9], ["Osaka",34.69,135.5,9], ["Yokohama",35.44,139.64,9], ["Nagoya",35.18,136.91,9], ["Sapporo",43.06,141.35,9], ["Kobe",34.69,135.2,9], ["Kyoto",35.01,135.77,9], ["Fukuoka",33.59,130.4,9], ["Hiroshima",34.39,132.45,9], ["Seoul",37.57,126.98,9], ["Busan",35.1,129.04,9], ["Incheon",37.46,126.71,9], ["Daegu",35.87,128.6,9], ["Daejeon",36.35,127.38,9], ["Taipei",25.05,121.53,8], ["Kaohsiung",22.63,120.27,8], ["Taichung",24.15,120.67,8], ["Hong Kong",22.32,114.17,8], ["Macau",22.2,113.55,8], ["Ulaanbaatar",47.91,106.91,8], ["Pyongyang",39.03,125.75,9], ["Colombo",6.93,79.85,5.5], ["Kathmandu",27.72,85.32,5.75], ["Dhaka",23.72,90.41,6], ["Chittagong",22.34,91.84,6], ["Sylhet",24.89,91.87,6], ["Karachi",24.86,67.01,5], ["Lahore",31.55,74.34,5], ["Islamabad",33.72,73.06,5], ["Rawalpindi",33.6,73.05,5], ["Faisalabad",31.42,73.08,5], ["Multan",30.2,71.48,5], ["Peshawar",34.01,71.58,5], ["Quetta",30.19,67.01,5], ["Sialkot",32.49,74.53,5], ["Male",4.17,73.51,5], ["Thimphu",27.47,89.64,6], ["Cairo",30.05,31.25,2], ["Alexandria",31.2,29.92,2], ["Giza",30.01,31.21,2], ["Lagos",6.45,3.4,1], ["Abuja",9.07,7.4,1], ["Kano",12.0,8.52,1], ["Kinshasa",-4.32,15.32,1], ["Luanda",-8.84,13.23,1], ["Khartoum",15.55,32.53,3], ["Addis Ababa",9.03,38.74,3], ["Nairobi",-1.29,36.82,3], ["Accra",5.56,-0.2,0], ["Dar es Salaam",-6.79,39.21,3], ["Casablanca",33.59,-7.62,1], ["Algiers",36.74,3.06,1], ["Tunis",36.82,10.17,1], ["Tripoli",32.9,13.18,2], ["Rabat",34.02,-6.84,1], ["Johannesburg",-26.2,28.04,2], ["Cape Town",-33.93,18.42,2], ["Durban",-29.86,31.02,2], ["Pretoria",-25.74,28.19,2], ["Dakar",14.69,-17.44,0], ["Kampala",0.32,32.58,3], ["Kigali",-1.95,30.06,2], ["Lusaka",-15.42,28.29,2], ["Harare",-17.83,31.05,2], ["Maputo",-25.97,32.59,2], ["Antananarivo",-18.92,47.54,3], ["Windhoek",-22.56,17.08,2], ["Gaborone",-24.65,25.91,2], ["Libreville",0.39,9.45,1], ["Yaounde",3.87,11.52,1], ["Ndjamena",12.11,15.04,1], ["Niamey",13.51,2.12,1], ["Ouagadougou",12.37,-1.53,0], ["Sydney",-33.87,151.21,10], ["Melbourne",-37.81,144.97,10], ["Brisbane",-27.47,153.03,10], ["Perth",-31.95,115.86,8], ["Adelaide",-34.93,138.6,9.5], ["Canberra",-35.28,149.13,10], ["Auckland",-36.86,174.77,12], ["Wellington",-41.29,174.78,12], ["Christchurch",-43.53,172.64,12], ["Tashkent",41.3,69.28,5], ["Almaty",43.25,76.95,6], ["Nur-Sultan",51.18,71.45,6], ["Bishkek",42.87,74.59,6], ["Dushanbe",38.56,68.77,5], ["Ashgabat",37.95,58.38,5], ["Baku",40.41,49.87,4], ["Yerevan",40.18,44.51,4], ["Tbilisi",41.69,44.83,4], ["Mexico City",19.43,-99.13,-6], ["Guadalajara",20.66,-103.35,-6], ["Monterrey",25.67,-100.31,-6], ["Tijuana",32.52,-117.04,-8], ["Puebla",19.05,-98.21,-6], ["Sao Paulo",-23.55,-46.63,-3], ["Rio de Janeiro",-22.91,-43.17,-3], ["Brasilia",-15.78,-47.93,-3], ["Salvador",-12.97,-38.51,-3], ["Fortaleza",-3.72,-38.54,-3], ["Manaus",-3.1,-60.02,-4], ["Curitiba",-25.43,-49.27,-3], ["Recife",-8.05,-34.88,-3], ["Porto Alegre",-30.03,-51.23,-3], ["Belo Horizonte",-19.92,-43.94,-3], ["Buenos Aires",-34.61,-58.37,-3], ["Cordoba",-31.42,-64.19,-3], ["Rosario",-32.95,-60.66,-3], ["Lima",-12.05,-77.04,-5], ["Bogota",4.71,-74.07,-5], ["Medellin",6.25,-75.56,-5], ["Cali",3.44,-76.52,-5], ["Caracas",10.48,-66.88,-4], ["Santiago",-33.46,-70.65,-4], ["Quito",-0.23,-78.51,-5], ["Guayaquil",-2.19,-79.89,-5], ["La Paz",-16.5,-68.15,-4], ["Montevideo",-34.9,-56.19,-3], ["Havana",23.13,-82.38,-5], ["Guatemala City",14.64,-90.51,-6], ["San Jose CR",9.93,-84.08,-6], ["Panama City",8.99,-79.51,-5], ["Moscow",55.75,37.62,3], ["Saint Petersburg",59.93,30.32,3], ["Novosibirsk",55.02,82.93,7], ["Yekaterinburg",56.84,60.6,5], ["Nizhny Novgorod",56.33,44.0,3], ["Kazan",55.8,49.11,3], ["Chelyabinsk",55.16,61.4,5], ["Omsk",54.99,73.37,6], ["Samara",53.2,50.15,4], ["Rostov-on-Don",47.23,39.72,3], ["Vladivostok",43.12,131.9,10], ["Irkutsk",52.29,104.28,8] ]; function getCity(s){ // Use cached city data if set by autocomplete selection if(S._cityData&&s&&(s.toLowerCase().indexOf(S._cityData[0].toLowerCase())>=0)) return{lat:S._cityData[1],lon:S._cityData[2],tz:S._cityData[3]}; if(!s)return{lat:20,lon:78,tz:5.5}; var sl=s.toLowerCase().trim(); // 1. Exact match for(var i=0;i=0||dl.indexOf(sl)>=0) return{lat:CITY_DB[i][1],lon:CITY_DB[i][2],tz:CITY_DB[i][3]}; } // 3. First word match (handles "Bengaluru, Karnataka" → "Bengaluru") var firstWord=sl.split(/[,\s]/)[0]; if(firstWord.length>=3){ for(var i=0;i=0) return{lat:CITY_DB[i][1],lon:CITY_DB[i][2],tz:CITY_DB[i][3]}; } } return{lat:20,lon:78,tz:5.5}; } function julianDay(dob,tob,tz){ tz=tz!==undefined?tz:5.5;var p=(dob||'1990-01-01').split('-'); var Y=parseInt(p[0]),M=parseInt(p[1]),D=parseInt(p[2]); var tp=(tob||'12:00').split(':'),lh=parseInt(tp[0])+parseInt(tp[1]||0)/60,ut=lh-tz; if(ut<0){ut+=24;D-=1;}if(ut>=24){ut-=24;D+=1;} if(M<=2){Y-=1;M+=12;}var A=Math.floor(Y/100),B=2-A+Math.floor(A/4); return Math.floor(365.25*(Y+4716))+Math.floor(30.6001*(M+1))+D+ut/24+B-1524.5; } function calcLons(jd){ var T=(jd-2451545.0)/36525.0; var L0=mod360(280.46646+36000.76983*T),M0=mod360(357.52911+35999.05029*T); var C=(1.914602-0.004817*T-0.000014*T*T)*Math.sin(rad(M0))+(0.019993-0.000101*T)*Math.sin(rad(2*M0))+0.000290*Math.sin(rad(3*M0)); var sun=mod360(L0+C); var Lm=mod360(218.3165+481267.8813*T),Mm=mod360(134.9634+477198.8676*T); var F=mod360(93.2721+483202.0175*T),Dv=mod360(297.8502+445267.1115*T); // Moon: Jean Meeus ch.47 — 15-term series (accurate to ~0.3 degrees) var moon=mod360(Lm +6.2888*Math.sin(rad(Mm)) +1.2740*Math.sin(rad(2*Dv-Mm)) +0.6583*Math.sin(rad(2*Dv)) +0.2136*Math.sin(rad(2*Mm)) -0.1851*Math.sin(rad(Dv)) -0.1143*Math.sin(rad(2*F)) +0.0588*Math.sin(rad(2*Dv-2*Mm)) +0.0533*Math.sin(rad(2*Dv+Mm)) -0.0459*Math.sin(rad(Mm-Dv)) +0.0410*Math.sin(rad(Mm+Dv)) +0.0347*Math.sin(rad(4*Dv-Mm)) +0.0323*Math.sin(rad(4*Dv-2*Mm)) +0.0273*Math.sin(rad(2*Dv+2*Mm)) -0.0250*Math.sin(rad(3*Dv)) +0.0175*Math.sin(rad(Mm-2*F))); var Le=mod360(100.466457+36000.7698278*T),pe=mod360(102.937348+1.7195366*T); var Me=mod360(Le-pe),nue=Me+(360/Math.PI)*0.016708634*Math.sin(rad(Me))+(5/4)*0.016708634*0.016708634*Math.sin(rad(2*Me)); var helE=mod360(nue+pe),rE=1.000001*(1-0.016708634*Math.cos(rad(Me))); var Xe=rE*Math.cos(rad(helE)),Ye=rE*Math.sin(rad(helE)); function geo3d(a,e,L0p,Lr,per0,perR,i,node){ var Lp=mod360(L0p+Lr*T),per=mod360(per0+perR*T),M=mod360(Lp-per); var E=M,em=e*180/Math.PI; for(var k=0;k<8;k++)E=M+em*Math.sin(rad(E)); E=mod360(E); var nu=mod360(2*Math.atan2(Math.sqrt(1+e)*Math.sin(rad(E/2)),Math.sqrt(1-e)*Math.cos(rad(E/2)))*180/Math.PI); var u=mod360(nu+per-node),r=a*(1-e*Math.cos(rad(E))); var ir=i*Math.PI/180,nr=node*Math.PI/180,ur=u*Math.PI/180; var Xp=r*(Math.cos(nr)*Math.cos(ur)-Math.sin(nr)*Math.sin(ur)*Math.cos(ir)); var Yp=r*(Math.sin(nr)*Math.cos(ur)+Math.cos(nr)*Math.sin(ur)*Math.cos(ir)); return mod360(Math.atan2(Yp-Ye,Xp-Xe)*180/Math.PI); } var mer=geo3d(0.387098,0.20563,252.250906,149472.6746,77.456119,1.5564775,7.004986,48.330893); var ven=geo3d(0.723332,0.006773,181.979801,58517.8157,131.563703,1.4022288,3.394662,76.679920); var mar=geo3d(1.523679,0.093405,355.433,19140.2993,336.060228,1.8410449,1.849726,49.558093); var jup=geo3d(5.202887,0.048775,34.396441,3034.9057,14.728480,1.0413768,1.303270,100.464407); var sat=geo3d(9.537070,0.054151,50.077444,1222.1138,93.057209,1.9637694,2.485240,113.642811); var rahu=mod360(125.0445-1934.1363*T); return{sun:sun,moon:moon,mercury:mer,venus:ven,mars:mar,jupiter:jup,saturn:sat,rahu:rahu,ketu:mod360(rahu+180)}; } function calcLagna(jd,lat,geoLon){ var T=(jd-2451545.0)/36525.0; var GMST=mod360(280.46061837+360.98564736629*(jd-2451545.0)+0.000387933*T*T); var LST=mod360(GMST+geoLon); var eps=(23.4392911-0.013004167*T)*Math.PI/180; var latR=lat*Math.PI/180,LSTR=LST*Math.PI/180; var n=Math.cos(LSTR); var d=-(Math.sin(LSTR)*Math.cos(eps)+Math.tan(latR)*Math.sin(eps)); var asc=mod360(Math.atan2(n,d)*180/Math.PI); if(d>0)asc=mod360(asc+180); return asc; } var SIGNS=['Aries','Taurus','Gemini','Cancer','Leo','Virgo','Libra','Scorpio','Sagittarius','Capricorn','Aquarius','Pisces']; var NAKS=['Ashwini','Bharani','Krittika','Rohini','Mrigashira','Ardra','Punarvasu','Pushya','Ashlesha','Magha','Purva Phalguni','Uttara Phalguni','Hasta','Chitra','Swati','Vishakha','Anuradha','Jyeshtha','Mula','Purva Ashadha','Uttara Ashadha','Shravana','Dhanishta','Shatabhisha','Purva Bhadra','Uttara Bhadra','Revati']; function getNak(lon){return NAKS[Math.floor(lon/(360/27))];} function lonToSign(lon){return Math.floor(((lon%360)+360)%360/30);} var VIMSHO=[{l:'Ketu',s:'☋',y:7,c:'#a89868'},{l:'Venus',s:'♀',y:20,c:'#98c898'},{l:'Sun',s:'☉',y:6,c:'#e8c060'},{l:'Moon',s:'☽',y:10,c:'#c8c0b4'},{l:'Mars',s:'♂',y:7,c:'#e08070'},{l:'Rahu',s:'☊',y:18,c:'#d4a843'},{l:'Jupiter',s:'♃',y:16,c:'#7898c8'},{l:'Saturn',s:'♄',y:19,c:'#a880c8'},{l:'Mercury',s:'☿',y:17,c:'#78b898'}]; var NAK_LORDS=[0,4,1,2,6,7,8,3,5,0,4,1,2,6,7,8,3,5,0,4,1,2,6,7,8,3,5]; function calcDasha(moonLon,dob){ var ni=Math.floor(moonLon/(360/27))%27,nf=(moonLon%(360/27))/(360/27); var li=NAK_LORDS[ni],lord=VIMSHO[li],el=nf*lord.y,rem=lord.y-el; var cur=new Date(dob||'1990-01-01');cur.setFullYear(cur.getFullYear()-Math.floor(el)); var out=[]; for(var i=0;i<9;i++){var d=VIMSHO[(li+i)%9],y=i===0?rem:d.y,end=new Date(cur);end.setFullYear(end.getFullYear()+Math.round(y));out.push({lord:d.l,sym:d.s,col:d.c,from:cur.getFullYear(),to:end.getFullYear(),yrs:y.toFixed(1)});cur=new Date(end);} return out; } var MOS=['January','February','March','April','May','June','July','August','September','October','November','December']; var TITHIS=['Pratipada','Dwitiya','Tritiya','Chaturthi','Panchami','Shashthi','Saptami','Ashtami','Navami','Dashami','Ekadashi','Dwadashi','Trayodashi','Chaturdashi','Purnima']; var VARAS=['Ravivara (Sun)','Somavara (Moon)','Mangalavara (Mars)','Budhavara (Mercury)','Guruvara (Jupiter)','Shukravara (Venus)','Shanivara (Saturn)']; var YOGAS=['Vishkambha','Priti','Ayushman','Saubhagya','Shobhana','Atiganda','Sukarma','Dhriti','Shula','Ganda','Vriddhi','Dhruva','Vyaghata','Harshana','Vajra','Siddhi','Vyatipata','Variyan','Parigha','Shiva','Siddha','Sadhya','Shubha','Shukla','Brahma','Indra','Vaidhriti']; var KARANAS=['Bava','Balava','Kaulava','Taitila','Garija','Vanija','Vishti','Shakuni','Chatushpada','Naga','Kimstughna']; function calcPancha(jd,moon,sun){ var tf=mod360(moon-sun)/12,tithi=Math.floor(tf)%15; var vara=Math.floor(jd+1.5)%7,yoga=Math.floor(mod360(moon+sun)/(360/27))%27,karana=Math.floor(tf*2)%11; return{tithi:TITHIS[tithi]||TITHIS[0],tithibNum:tithi+1,vara:VARAS[vara]||VARAS[0],nakshatra:getNak(moon),yoga:YOGAS[yoga]||YOGAS[0],karana:KARANAS[karana]||KARANAS[0]}; } // ═══════════════════════════════════════════════════ // LAHIRI AYANAMSA — corrects tropical → sidereal // This is the single most important Vedic fix. // Lahiri (Chitrapaksha) is the Indian government standard. // ═══════════════════════════════════════════════════ function lahiriAyanamsa(jd){ // Swiss Ephemeris SE_SIDM_LAHIRI standard (matches astro.com) // Epoch: JD 2433282.5 (1950 Jan 0.5 ET), ayanamsa=23deg9'57''=23.16583deg // Precession: 50.2469 arcsec/yr = 0.013957 deg/yr var t_years=(jd-2433282.5)/365.25; return mod360(23.16608+0.013970*t_years); } function siderealLon(tropLon,ayanamsa){return mod360(tropLon-ayanamsa);} function calcKundali(dob,tob,city){ var c=typeof city==='string'?getCity(city):(city||getCity('')); var jd=julianDay(dob||'1990-01-01',tob||'12:00',c.tz); var lo=calcLons(jd); var ayan=lahiriAyanamsa(jd); // Convert ALL tropical longitudes to sidereal (Vedic) var sid={ sun:siderealLon(lo.sun,ayan), moon:siderealLon(lo.moon,ayan), mercury:siderealLon(lo.mercury,ayan), venus:siderealLon(lo.venus,ayan), mars:siderealLon(lo.mars,ayan), jupiter:siderealLon(lo.jupiter,ayan), saturn:siderealLon(lo.saturn,ayan), rahu:siderealLon(lo.rahu,ayan), ketu:siderealLon(mod360(lo.rahu+180),ayan) }; // Lagna also needs ayanamsa correction var lagTrop=calcLagna(jd,c.lat,c.lon); var lagLon=siderealLon(lagTrop,ayan); var ls=lonToSign; return{ sun:ls(sid.sun),moon:ls(sid.moon),lagna:ls(lagLon), rahu:ls(sid.rahu),ketu:ls(sid.ketu), jupiter:ls(sid.jupiter),saturn:ls(sid.saturn), mars:ls(sid.mars),mercury:ls(sid.mercury),venus:ls(sid.venus), sunLon:sid.sun,moonLon:sid.moon,lagnaLon:lagLon, rahuLon:sid.rahu,ketuLon:sid.ketu, jupLon:sid.jupiter,satLon:sid.saturn, marLon:sid.mars,merLon:sid.mercury,venLon:sid.venus, sunSign:SIGNS[ls(sid.sun)],moonSign:SIGNS[ls(sid.moon)],lagnaSign:SIGNS[ls(lagLon)], nakshatra:getNak(sid.moon), // Panchanga: Tithi/Yoga use sidereal moon-sun difference panchanga:calcPancha(jd,sid.moon,sid.sun), dashas:calcDasha(sid.moon,dob), ayanamsa:ayan.toFixed(2) }; } // ═══════════════════════════════════════════════════ // NORTH INDIAN KUNDALI CHART — verbatim drishti // ═══════════════════════════════════════════════════ function drawKundali(svgId,k){ var ns='http://www.w3.org/2000/svg',svg=document.getElementById(svgId); if(!svg)return;svg.innerHTML='';svg.setAttribute('viewBox','0 0 300 300'); var g=75,cx=150,cy=150,lag=k?k.lagna:0; var ES=['Ari','Tau','Gem','Can','Leo','Vir','Lib','Sco','Sag','Cap','Aqu','Pis']; function mk(tag,at){var e=document.createElementNS(ns,tag);Object.keys(at).forEach(function(k){e.setAttribute(k,at[k]);});return e;} svg.appendChild(mk('rect',{width:'300',height:'300',fill:'#0f1511',rx:'4'})); var CELLS=[ {pts:[[g,0],[3*g,0],[cx,2*g]],tx:cx,ty:g*.62,a:'middle'}, {pts:[[3*g,0],[4*g,0],[4*g,g],[3*g,g]],tx:3.5*g,ty:g*.48,a:'middle'}, {pts:[[3*g,g],[4*g,g],[4*g,2*g],[3*g,2*g]],tx:3.5*g,ty:1.5*g,a:'middle'}, {pts:[[cx,2*g],[3*g,g],[3*g,3*g]],tx:2.62*g,ty:cy,a:'middle'}, {pts:[[3*g,2*g],[4*g,2*g],[4*g,3*g],[3*g,3*g]],tx:3.5*g,ty:2.5*g,a:'middle'}, {pts:[[3*g,3*g],[4*g,3*g],[4*g,4*g],[3*g,4*g]],tx:3.5*g,ty:3.5*g,a:'middle'}, {pts:[[g,4*g],[3*g,4*g],[cx,2*g]],tx:cx,ty:3.38*g,a:'middle'}, {pts:[[0,3*g],[g,3*g],[g,4*g],[0,4*g]],tx:.5*g,ty:3.5*g,a:'middle'}, {pts:[[0,2*g],[g,2*g],[g,3*g],[0,3*g]],tx:.5*g,ty:2.5*g,a:'middle'}, {pts:[[cx,2*g],[g,g],[g,3*g]],tx:1.38*g,ty:cy,a:'middle'}, {pts:[[0,g],[g,g],[g,2*g],[0,2*g]],tx:.5*g,ty:1.5*g,a:'middle'}, {pts:[[0,0],[g,0],[g,g],[0,g]],tx:.5*g,ty:.48*g,a:'middle'} ]; CELLS.forEach(function(cell,ci){ var rIdx=(ci+lag)%12,pts=cell.pts.map(function(p){return p.join(',');}).join(' '); svg.appendChild(mk('polygon',{points:pts,fill:'#0f1511',stroke:'rgba(212,168,67,.25)','stroke-width':'.7'})); var hn=mk('text',{x:cell.tx,y:cell.ty-8,'text-anchor':cell.a,'font-size':'5.5',fill:'rgba(212,168,67,.2)','font-family':'Inter,sans-serif'});hn.textContent=ci+1;svg.appendChild(hn); var rn=mk('text',{x:cell.tx,y:cell.ty+2,'text-anchor':cell.a,'font-size':ci===0||ci===3||ci===6||ci===9?'8.5':'7.5',fill:ci===0?'#d4a843':'rgba(212,168,67,.52)','font-family':'Inter,sans-serif','font-weight':ci===0?'600':'400'});rn.textContent=ES[rIdx];svg.appendChild(rn); }); [[g,0,cx,2*g],[3*g,0,cx,2*g],[g,4*g,cx,2*g],[3*g,4*g,cx,2*g]].forEach(function(l){svg.appendChild(mk('line',{x1:l[0],y1:l[1],x2:l[2],y2:l[3],stroke:'rgba(212,168,67,.18)','stroke-width':'.5'}));}); svg.appendChild(mk('circle',{cx:cx,cy:cy,r:'8',fill:'#0f1511',stroke:'rgba(212,168,67,.4)','stroke-width':'.7'})); var ct=mk('text',{x:cx,y:cy+3.5,'text-anchor':'middle','font-size':'7',fill:'rgba(212,168,67,.7)','font-family':'serif'});ct.textContent='✦';svg.appendChild(ct); if(!k)return; var GRAHAS=[{key:'sunLon',sym:'Su',col:'#e8c060'},{key:'moonLon',sym:'Mo',col:'#c8c0b4'},{key:'marLon',sym:'Ma',col:'#e08070'},{key:'merLon',sym:'Me',col:'#78b898'},{key:'jupLon',sym:'Ju',col:'#7898c8'},{key:'venLon',sym:'Ve',col:'#98c898'},{key:'satLon',sym:'Sa',col:'#a880c8'},{key:'rahuLon',sym:'Ra',col:'#d4a843'},{key:'ketuLon',sym:'Ke',col:'#a88850'},{key:'lagnaLon',sym:'As',col:'#ede8da'}]; var grps={};for(var hi=0;hi<12;hi++)grps[hi]=[]; GRAHAS.forEach(function(gr){var lon=k[gr.key];if(lon===undefined)return;var si=lonToSign(lon);grps[(si-lag+12)%12].push(gr);}); CELLS.forEach(function(cell,ci){ var grs=grps[ci];if(!grs||!grs.length)return; var lh=9,sy=cell.ty+14;if(grs.length>3){lh=8;sy=cell.ty+12;} grs.forEach(function(gr,gi){var gt=mk('text',{x:cell.tx,y:sy+gi*lh,'text-anchor':cell.a,'font-size':'7.5',fill:gr.col,'font-family':'Inter,sans-serif','font-weight':gr.sym==='As'||gr.sym==='Su'||gr.sym==='Mo'?'600':'400'});gt.textContent=gr.sym;svg.appendChild(gt);}); }); } // ═══════════════════════════════════════════════════ // BIRTH SKY — verbatim copy from drishti.html // ═══════════════════════════════════════════════════ function buildSky(){ var u=S.user, dob=u.dob||'1990-01-01', tob=u.tob||'12:00', city=u.city||''; var c=getCity(city), jd=julianDay(dob,tob,c.tz), lo=calcLons(jd); var ns='http://www.w3.org/2000/svg'; // Safe DOM writes — only elements that exist in v4 HTML var smeta=document.getElementById('sky-meta'); if(smeta) smeta.textContent=(dob||'')+' · '+(tob||'')+' · '+(city||''); var CX=200, CY=210, R=178; var _seed=Math.abs(Math.floor(jd*137.508))%999983+1; function rng(){_seed=(_seed*16807+0)%2147483647;return(_seed-1)/2147483646;} function Tfn(jd2){return(jd2-2451545.0)/36525.0;} function GMST(jd2){var tv=Tfn(jd2);return mod360(280.46061837+360.98564736629*(jd2-2451545.0)+0.000387933*tv*tv);} function altAz(ra,dec){ var LST=mod360(GMST(jd)+c.lon); var HA=mod360(LST-ra),sinAlt=Math.sin(rad(dec))*Math.sin(rad(c.lat))+Math.cos(rad(dec))*Math.cos(rad(c.lat))*Math.cos(rad(HA)); var alt=Math.asin(Math.max(-1,Math.min(1,sinAlt)))*180/Math.PI; var cosAz=(Math.sin(rad(dec))-Math.sin(rad(alt))*Math.sin(rad(c.lat)))/(Math.cos(rad(alt))*Math.cos(rad(c.lat))); var az=Math.acos(Math.max(-1,Math.min(1,cosAz)))*180/Math.PI; if(Math.sin(rad(HA))>0)az=360-az; return{alt:alt,az:az}; } function toXY(alt,az){ if(alt<-5)return null; var r=R*Math.cos(rad(Math.max(0,alt)))/(1+Math.sin(rad(Math.max(0,alt)))); return[CX+r*Math.sin(rad(az)),CY-r*Math.cos(rad(az))]; } function eclToRaDec(lon){ var eps=23.439*Math.PI/180,lr=rad(lon); var ra=Math.atan2(Math.sin(lr)*Math.cos(eps),Math.cos(lr))*180/Math.PI; var dec=Math.asin(Math.sin(eps)*Math.sin(lr))*180/Math.PI; return{ra:mod360(ra),dec:dec}; } var STARS=[ [101.29,-16.72,-14,'Sirius'],[219.92,-60.83,-9,'Rigil Kent'],[213.91,19.18,-5,'Arcturus'], [78.63,-8.2,-3,'Rigel'],[116.33,28.03,15,'Procyon'],[279.23,38.78,16,'Vega'], [297.7,8.87,17,'Altair'],[114.83,51.68,18,'Capella'],[88.79,7.41,19,'Betelgeuse'], [310.36,45.28,20,'Deneb'],[186.65,-63.1,28,'Mimosa'],[344.41,-29.62,29,'Fomalhaut'], [68.98,16.51,30,'Aldebaran'],[247.35,-26.43,30,'Antares'],[201.3,-11.16,31,'Spica'], [152.09,11.97,32,'Regulus'],[80.89,45.99,32,'Elnath'],[81.57,28.61,33,'Alnilam'], [176.4,14.57,34,'Denebola'],[23.46,89.26,20,'Polaris'],[283.82,36.46,36,'Sheliak'], [307.45,-14.78,38,'Alshain'],[265.62,-39.02,38,'Sargas'],[233.67,-29.78,46,'Graffias'], [60.17,12.49,55,'Hamal'],[106.03,22.51,53,'Alhena'],[113.65,31.89,52,'Pollux'], [116.67,24.4,51,'Castor'],[250.07,9.37,50,'Rasalhague'],[275.25,-29.83,40,'Kaus Aust'], [307.78,30.23,46,'Albireo'],[158.84,-60.6,44,'Avior'] ]; function mk(tag,at){var e=document.createElementNS(ns,tag);Object.keys(at).forEach(function(k2){e.setAttribute(k2,at[k2]);});return e;} var lg=document.getElementById('sky-lines'); var sg=document.getElementById('sky-dots'); var bsg=document.getElementById('sky-bg-stars'); var neb=document.getElementById('sky-nebulae'); var grd=document.getElementById('sky-grid'); var plg=document.getElementById('sky-planets'); var nb=document.getElementById('sky-name-badge'); // Guard: if SVG groups don\u2019t exist, bail if(!lg||!sg||!bsg||!neb||!grd||!plg||!nb)return; lg.innerHTML='';sg.innerHTML='';bsg.innerHTML=''; neb.innerHTML='';grd.innerHTML='';plg.innerHTML='';nb.innerHTML=''; // Compass points N/S/E/W var compass=[['N',0],['E',90],['S',180],['W',270]]; compass.forEach(function(cv){ var p=toXY(0,cv[1]);if(!p)return; var t2=mk('text',{x:p[0].toFixed(1),y:(p[1]-6).toFixed(1),'text-anchor':'middle','font-size':'7', fill:'rgba(232,160,48,.3)','font-family':'DM Sans,sans-serif','letter-spacing':'1'}); t2.textContent=cv[0];grd.appendChild(t2); }); // Altitude rings at 30° and 60° [30,60].forEach(function(alt){ var p=toXY(alt,0);if(!p)return; var r2=Math.sqrt((p[0]-CX)*(p[0]-CX)+(p[1]-CY)*(p[1]-CY)); grd.appendChild(mk('circle',{cx:CX,cy:CY,r:r2.toFixed(1),fill:'none', stroke:'rgba(232,160,48,.06)','stroke-width':'.4','stroke-dasharray':'2 8'})); }); // Nebula wisps (seeded from birth date for uniqueness) for(var ni=0;ni<3;ni++){ var nx=CX+(rng()-.5)*260,ny=CY+(rng()-.5)*260; neb.appendChild(mk('ellipse',{cx:nx.toFixed(0),cy:ny.toFixed(0), rx:(28+rng()*55).toFixed(0),ry:(12+rng()*28).toFixed(0), fill:'rgba(100,80,200,.02)', transform:'rotate('+(rng()*360).toFixed(0)+','+nx.toFixed(0)+','+ny.toFixed(0)+')'})); } // Background stars — 350, seeded from birth JD so position is unique per person for(var bs=0;bs<350;bs++){ var balt=rng()*90,baz=rng()*360,bp=toXY(balt,baz);if(!bp)continue; var bm=rng(),br,bop,bc; if(bm<.015){br=1.0;bop=.72;bc='#e8f0ff';} else if(bm<.06){br=.65;bop=.5;bc='#d8e0ff';} else if(bm<.18){br=.42;bop=.33;bc='#c0c8f0';} else{br=.25;bop=.17;bc='#9898c8';} var bel=mk('circle',{cx:bp[0].toFixed(1),cy:bp[1].toFixed(1),r:br,fill:bc,opacity:bop.toFixed(2)}); if(bm<.04&&rng()<.5)bel.style.animation='twinkle '+(2+rng()*4).toFixed(1)+'s '+(rng()*3).toFixed(1)+'s ease-in-out infinite'; bsg.appendChild(bel); } // Catalog stars — real positions computed from birth lat/lon/time var starAltAz=STARS.map(function(s){return altAz(s[0],s[1]);}); // Constellation lines between brightest pairs var linesStar=[[0,3],[8,3],[4,2],[6,9],[12,13]]; linesStar.forEach(function(pair,i){ var pA=toXY(starAltAz[pair[0]].alt,starAltAz[pair[0]].az); var pB=toXY(starAltAz[pair[1]].alt,starAltAz[pair[1]].az); if(!pA||!pB)return; // glow line lg.appendChild(mk('line',{x1:pA[0].toFixed(1),y1:pA[1].toFixed(1), x2:pB[0].toFixed(1),y2:pB[1].toFixed(1), stroke:'rgba(232,160,48,.08)','stroke-width':'2'})); // bright line with draw animation var ln=mk('line',{x1:pA[0].toFixed(1),y1:pA[1].toFixed(1), x2:pB[0].toFixed(1),y2:pB[1].toFixed(1), stroke:'rgba(232,160,48,.35)','stroke-width':'.6'}); ln.style.strokeDasharray='600'; ln.style.animation='drawLine 1.5s '+(i*.1+.2)+'s ease both'; lg.appendChild(ln); }); // Catalog star dots with labels STARS.forEach(function(star,si){ var aa=starAltAz[si],p=toXY(aa.alt,aa.az);if(!p)return; var mag=star[2]/10,r2,op,col,doLabel; if(mag<.5){r2=3.8;op=1.0;col='#fff8e0';doLabel=true;} else if(mag<1.0){r2=3.0;op=.95;col='#f0e8d0';doLabel=true;} else if(mag<1.5){r2=2.4;op=.88;col='#e8e0cc';doLabel=true;} else if(mag<2.0){r2=1.9;op=.8;col='#ddd5c0';doLabel=false;} else if(mag<2.5){r2=1.5;op=.68;col='#c8c0b0';doLabel=false;} else if(mag<3.0){r2=1.1;op=.55;col='#b0a898';doLabel=false;} else{r2=.75;op=.38;col='#988e80';doLabel=false;} if(['Betelgeuse','Antares','Aldebaran'].indexOf(star[3])>-1)col=mag<2?'#ffc080':'#e89060'; else if(['Rigel','Spica','Vega'].indexOf(star[3])>-1)col=mag<2?'#c0d8ff':'#a8c0f0'; if(r2>1.5)sg.appendChild(mk('circle',{cx:p[0].toFixed(1),cy:p[1].toFixed(1), r:(r2*2.5).toFixed(1),fill:'rgba(232,160,48,.04)'})); var dot=mk('circle',{cx:p[0].toFixed(1),cy:p[1].toFixed(1),r:r2.toFixed(2),fill:col,opacity:op.toFixed(2)}); if(r2>1.5)dot.setAttribute('filter','url(#mg)'); sg.appendChild(dot); if(doLabel&&r2>2.0){ var lbl=mk('text',{x:(p[0]+r2+3).toFixed(1),y:(p[1]-r2-2).toFixed(1), 'text-anchor':'start','font-size':r2>3?'6.5':'5.5', fill:'rgba(232,160,48,.52)','font-family':'DM Sans,sans-serif'}); lbl.textContent=star[3];sg.appendChild(lbl); } }); // Planet markers — actual positions from birth moment var PRENDER={sun:{sym:'☉',col:'#f0c040',r:4.5},moon:{sym:'☽',col:'#d8d0c0',r:3.8}, mars:{sym:'♂',col:'#e08060',r:2.8},jupiter:{sym:'♃',col:'#7090c0',r:3.2}, venus:{sym:'♀',col:'#b0d898',r:3.0},saturn:{sym:'♄',col:'#a080b8',r:2.6}}; Object.keys(PRENDER).forEach(function(g){ var lon=lo[g];if(lon===undefined)return; var rd=eclToRaDec(lon),aa=altAz(rd.ra,rd.dec),p=toXY(aa.alt,aa.az);if(!p)return; var cfg=PRENDER[g]; plg.appendChild(mk('circle',{cx:p[0].toFixed(1),cy:p[1].toFixed(1), r:(cfg.r*3),fill:'rgba(232,160,48,.04)',filter:'url(#sg)'})); plg.appendChild(mk('circle',{cx:p[0].toFixed(1),cy:p[1].toFixed(1), r:(cfg.r*1.8),fill:'none',stroke:cfg.col,'stroke-width':'.7',opacity:'.28'})); var pc=mk('circle',{cx:p[0].toFixed(1),cy:p[1].toFixed(1),r:cfg.r,fill:cfg.col,filter:'url(#mg)'}); plg.appendChild(pc); var ps=mk('text',{x:p[0].toFixed(1),y:(p[1]+cfg.r+8).toFixed(1), 'text-anchor':'middle','font-size':'7',fill:cfg.col,opacity:'.8','font-family':'sans-serif'}); ps.textContent=cfg.sym;plg.appendChild(ps); }); // Name badge at bottom var nameStr=(u.name||'').toUpperCase().slice(0,20); var nakStr='\u2609 '+SIGNS[lonToSign(lo.sun)]+' \u00B7 \u263D '+SIGNS[lonToSign(lo.moon)]; var bw=Math.min(260,nameStr.length*7.5+60),bx=CX-bw/2; nb.appendChild(mk('rect',{x:bx.toFixed(0),y:'376',width:bw.toFixed(0),height:'30',rx:'3', fill:'rgba(20,8,40,.88)',stroke:'rgba(232,160,48,.2)','stroke-width':'.6'})); var nt=mk('text',{x:CX,y:'389','text-anchor':'middle','font-size':'7.5', fill:'rgba(232,160,48,.72)','letter-spacing':'2','font-family':'DM Sans,sans-serif','font-weight':'500'}); nt.textContent=nameStr;nb.appendChild(nt); var nk=mk('text',{x:CX,y:'400','text-anchor':'middle','font-size':'5.5', fill:'rgba(232,160,48,.35)','letter-spacing':'.8','font-family':'DM Sans,sans-serif'}); nk.textContent=nakStr;nb.appendChild(nk); } // ═══════════════════════════════════════════════════ // SIGN & NAKSHATRA DESCRIPTORS — from drishti // ═══════════════════════════════════════════════════ var SD={ 'Aries':{n:"courage, going first, and needing to see results fast",cs:"lead from the front — you spot opportunities faster than almost anyone and act before others have finished deciding",lp:"need direct expressions of love and admiration — you lose interest when things get too comfortable or passive",e:"to start things that genuinely matter and hand them off when they\u2019re running",h:"head, eyes, and stress-related tension",imp:"come across as decisive, direct, and someone who gets things done"}, 'Taurus':{n:"stability, beauty, and building things that actually last",cs:"build slowly but permanently — you\u2019re the person things don\u2019t fall apart around",lp:"love through consistent presence and shared routines — grand gestures mean less to you than showing up reliably",e:"to create something real and lasting that carries your values forward",h:"throat, neck, and stubbornness-related tension in the body",imp:"come across as solid, trustworthy, and genuinely present"}, 'Gemini':{n:"curiosity, connection, and needing to understand everything at once",cs:"communicate, synthesise, and make complex things accessible — you\u2019re the person who can explain anything to anyone",lp:"love through conversation and mental stimulation — boredom is more threatening to you than conflict",e:"to bridge worlds that don\u2019t talk to each other and make information useful",h:"lungs, nervous system, and scattered energy",imp:"come across as quick, curious, and someone who can talk to absolutely anyone"}, 'Cancer':{n:"deep feeling, protection, and creating safe spaces for people",cs:"create environments where people feel genuinely looked after — homes, teams, families, businesses",lp:"love through care and nurturing — you give a lot and need to feel genuinely received",e:"to build homes — literal and emotional — where people feel they truly belong",h:"stomach, chest, and the physical effects of unexpressed emotion",imp:"come across as warm, perceptive, and someone who actually remembers what matters to you"}, 'Leo':{n:"self-expression, leadership, and the need to be genuinely seen",cs:"lead by inspiring — you shine when you\u2019re in front of people and have real authority",lp:"love through loyalty, admiration, and being genuinely celebrated for who you are",e:"to perform, lead, and create in a way that lifts the people around you",h:"heart, spine, and the physical effects of not expressing yourself",imp:"come across as confident, warm, and someone with natural authority"}, 'Virgo':{n:"precision, service, and the need to make things work properly",cs:"analyse, improve, and create systems that actually function — you notice what\u2019s broken before anyone else does",lp:"love through acts of service and thoughtful attention to detail — you show care by doing",e:"to perfect something that matters and serve the people who need that precision",h:"digestive system and the physical effects of perfectionism",imp:"come across as capable, discerning, and someone who will actually sort things out"}, 'Libra':{n:"balance, beauty, and the deep need for fairness in everything",cs:"negotiate, design, and create harmony — you can see every side of an argument and find the solution others miss",lp:"love through partnership and genuine equality — you need to feel truly chosen, not just convenient",e:"to bring genuine fairness and beauty into a world that has too little of both",h:"kidneys, lower back, and the tension of indecision",imp:"come across as charming, fair, and someone who makes difficult situations more graceful"}, 'Scorpio':{n:"intensity, depth, and the need to understand what\u2019s actually happening beneath the surface",cs:"investigate, transform, and see through what others miss — you\u2019re the person who finds out the truth",lp:"love with everything and need the same back — you don\u2019t do casual",e:"to transform — yourself first, then the situations you touch",h:"reproductive system and the physical effects of suppressed intensity",imp:"come across as magnetic, perceptive, and not someone to be taken lightly"}, 'Sagittarius':{n:"freedom, truth, and the constant need to understand the bigger picture",cs:"inspire, teach, and expand — you\u2019re the person who sees how everything connects and can make others see it too",lp:"love with optimism and generosity — you need space to grow and a partner who keeps expanding",e:"to seek truth relentlessly and share what you find in a way that genuinely helps people",h:"hips, thighs, and the restlessness of being confined",imp:"come across as enthusiastic, direct, and someone who makes people feel genuinely optimistic"}, 'Capricorn':{n:"ambition, discipline, and the need to build something that matters and lasts",cs:"lead through competence — you\u2019re the person who shows up consistently and earns authority through results",lp:"love carefully and loyally — you don\u2019t open easily but when you do it\u2019s for keeps",e:"to build structures — businesses, systems, legacies — that outlast the effort that created them",h:"bones, joints, and the physical effects of carrying too much responsibility",imp:"come across as serious, capable, and someone you can actually depend on"}, 'Aquarius':{n:"originality, community, and the need to make things genuinely better for everyone",cs:"innovate and connect people around ideas that matter — you\u2019re the person thinking five steps ahead",lp:"love through shared values and intellectual connection — friendship is the foundation of everything",e:"to change something that needs changing and build the community that makes it possible",h:"circulation, ankles, and the physical effects of being constantly stimulated",imp:"come across as independent, interesting, and someone with a perspective no one else has"}, 'Pisces':{n:"empathy, creativity, and the need to dissolve into something larger than yourself",cs:"create, heal, and intuit — you feel what others miss and bring a kind of compassion that can\u2019t be faked",lp:"love with your whole self and need to feel genuinely merged with another person",e:"to create beauty and healing and remind people that the unseen world is real",h:"feet, immune system, and the physical effects of absorbing others\u2019 emotions",imp:"come across as gentle, perceptive, and someone who seems to understand you without explanation"} }; var ND={ 'Ashwini':{at:"speed and the drive to begin things before others have thought to",h:"head, nervous system — watch for headaches when overextended",gr:"finish what you start before launching the next thing",mq:"rapid, instinctive emotional responses that arrive before logic"}, 'Bharani':{at:"intensity and a creative depth that people find hard to look away from",h:"reproductive and creative energy — needs outlets or it turns inward",gr:"carry what must be carried without turning the weight into resentment",mq:"slow to process, but when the emotion arrives it arrives with full force"}, 'Krittika':{at:"precision and the ability to cut through confusion to the exact truth",h:"eyes and digestive fire — both suffer when you hold back what needs saying",gr:"use your sharpness to illuminate, not just to cut",mq:"clear-eyed emotional perception that others sometimes experience as bluntness"}, 'Rohini':{at:"creativity, sensory richness, and a beauty that draws people naturally",h:"throat and voice — your body registers suppressed desire physically",gr:"release what you\u2019ve created instead of holding it close forever",mq:"deep, sensory emotional life that experiences beauty and disappointment fully"}, 'Mrigashira':{at:"curiosity and a searching quality that makes people want to follow your questions",h:"neck, shoulders — tighten when the search feels endless",gr:"recognise that some questions are answered by living, not by finding",mq:"restless emotional nature that is always looking for something more complete"}, 'Ardra':{at:"raw emotional intelligence and the ability to sit with difficulty others flee from",h:"lungs and respiratory system — your body responds to emotional storms physically",gr:"let the storm transform you rather than just pass through you",mq:"storm-like emotional intensity that processes by going through, not around"}, 'Punarvasu':{at:"warmth, reliability, and the ability to restore people who\u2019ve lost their way",h:"arms, hands — physical manifestation of your need to reach and restore",gr:"trust that you can return from any setback — this is your actual superpower",mq:"hopeful and resilient emotional nature that genuinely believes in recovery"}, 'Pushya':{at:"nurturing and a quality of care that makes people feel genuinely fed",h:"stomach and chest — your body carries others\u2019 burdens when you over-give",gr:"receive with as much generosity as you give",mq:"deep emotional investment in the wellbeing of people you love"}, 'Ashlesha':{at:"perception — you see what\u2019s actually happening when everyone else sees the surface",h:"stomach — sensitive to environments and people that aren\u2019t aligned with your values",gr:"use your perception to understand, not just to protect yourself",mq:"complex, layered emotional intelligence that takes time to reveal itself"}, 'Magha':{at:"natural authority and a presence that makes people sense you\u2019re someone who matters",h:"back and spine — carry the weight of legacy and expectation physically",gr:"honour where you come from without being imprisoned by it",mq:"proud, ceremonial emotional nature that feels things in the context of what they mean"}, 'Purva Phalguni':{at:"joy, pleasure, and a genuine love of life that is contagious",h:"heart and reproductive system — depleted by environments without beauty or ease",gr:"commit fully to what you love instead of keeping one foot out",mq:"playful, pleasure-seeking emotional nature that needs beauty to function well"}, 'Uttara Phalguni':{at:"reliability and a generosity that actually delivers, not just promises",h:"digestive system — processes emotional difficulty through the body",gr:"ask for help with the same ease you give it",mq:"warm, contractual emotional nature — you feel most secure when agreements are clear"}, 'Hasta':{at:"skill with your hands and the ability to create exactly what you envision",h:"hands, nervous system — anxiety manifests physically in the extremities",gr:"trust your skill without needing to control every outcome",mq:"precise, dexterous emotional processing that works things out by doing"}, 'Chitra':{at:"brilliance — you notice beauty and design where others see only function",h:"lower abdomen — creative blocks show up physically",gr:"make the thing first, perfect it second",mq:"aesthetic emotional intelligence that experiences the world as texture and design"}, 'Swati':{at:"independence and the ability to adapt to anything without losing yourself",h:"respiratory system — needs open air and space to breathe emotionally",gr:"choose direction — independence is a strength but becomes isolation without roots",mq:"light, adaptable emotional nature that bends without breaking"}, 'Vishakha':{at:"focused ambition and the rare ability to keep going until the goal is reached",h:"lower back and kidneys — strain when the goal feels unreachable",gr:"celebrate the journey, not just the destination you\u2019ve set",mq:"determined, goal-oriented emotional nature that processes by moving toward something"}, 'Anuradha':{at:"devotion and the ability to maintain deep friendships across any distance or time",h:"chest and heart — can carry others\u2019 pain as your own without realising it",gr:"apply the devotion you give others to yourself",mq:"loyal, feeling-oriented emotional nature that experiences connection as the most real thing"}, 'Jyeshtha':{at:"leadership and the courage to take responsibility when others step back",h:"neck and throat — unexpressed authority creates physical tension",gr:"lead without needing to be the only one who matters",mq:"intense, self-reliant emotional nature that processes difficulty privately"}, 'Mula':{at:"the ability to go to the root of things — you don\u2019t accept surface-level answers",h:"hips and lower spine — literal and metaphorical foundation",gr:"rebuild on stronger ground without mourning what had to go",mq:"deep, transformative emotional nature that needs to understand everything completely"}, 'Purva Ashadha':{at:"invincibility — a quality of early victory that makes people believe you\u2019ll win",h:"thighs and hips — need movement when processing difficult emotions",gr:"know when you\u2019ve already won instead of continuing to fight",mq:"enthusiastic, optimistic emotional nature that charges ahead of fear"}, 'Uttara Ashadha':{at:"long-term success and the ability to outlast obstacles through sheer persistence",h:"knees and lower back — bear the weight of long-term commitments physically",gr:"accept help in the middle of the journey, not just at the start",mq:"steady, persevering emotional nature that processes slowly but completely"}, 'Shravana':{at:"listening — you hear what people mean, not just what they say",h:"ears and auditory system — absorb others\u2019 distress through listening",gr:"integrate what you\u2019ve learned instead of always seeking more",mq:"receptive, empathetic emotional nature that processes by hearing and being heard"}, 'Dhanishta':{at:"rhythm and abundance — you know how to move through the world with ease",h:"ankles and lower legs — physically express emotional restlessness",gr:"slow down enough to let others keep pace",mq:"dynamic, musical emotional nature that processes through activity and rhythm"}, 'Shatabhisha':{at:"healing and the rare ability to hold space for what others can\u2019t face",h:"circulatory system and ankles — sensitive to environments that drain energy",gr:"let others heal you too — your isolation is often chosen, not necessary",mq:"distant, self-sufficient emotional nature that processes by withdrawing and integrating"}, 'Purva Bhadra':{at:"fire and the ability to burn away what no longer serves",h:"feet and immune system — need clear environments to stay healthy",gr:"channel the intensity into building rather than dismantling",mq:"passionate, sometimes extreme emotional nature that feels things at full intensity"}, 'Uttara Bhadra':{at:"oceanic compassion and the wisdom that comes from having already seen everything",h:"feet and lymphatic system — absorb environmental energy easily",gr:"bring your depth into practical daily form",mq:"serene, compassionate emotional nature that processes by going deep and waiting"}, 'Revati':{at:"gentleness and a completeness that makes people feel things are going to be okay",h:"feet and immune system — pick up on others\u2019 energies at close range",gr:"trust that endings carry within them the beginning of something better",mq:"tender, complete emotional nature that processes endings with unusual grace"} }; var DD={ 'Ketu':{n:"a time of releasing — things fall away that you thought you needed, and what\u2019s left turns out to be more essential",m:"financial patterns that no longer serve you are being cleared — this is uncomfortable but corrective"}, 'Venus':{n:"a long period (20 years) where relationships, beauty, and genuine enjoyment become the primary teachers — what you create and who you love matter most",m:"income flows through creativity, relationships, and the things you genuinely love doing"}, 'Sun':{n:"a period of becoming more fully yourself — authority, recognition, and the authentic expression of who you are take centre stage",m:"money comes through expertise, leadership, and doing the thing only you can do"}, 'Moon':{n:"an emotionally deepening period — your instincts, your relationships, and your inner life are the curriculum right now",m:"financial stability is tied to emotional alignment — decisions made from anxiety tend to cost more than they make"}, 'Mars':{n:"a period of action, ambition, and building — Mars rewards clarity and courage; it punishes hesitation and half-measures",m:"income comes through direct effort, courage, and going after what you want explicitly"}, 'Rahu':{n:"an expansive, sometimes overwhelming period of rapid growth and new experiences — the world is getting bigger and you\u2019re being pushed to keep up",m:"financial growth comes through unconventional paths and willingness to do things that haven\u2019t been done before"}, 'Jupiter':{n:"a genuinely fortunate period — wisdom, genuine abundance, and the right connections arrive when you stay aligned with what\u2019s actually true",m:"income comes through teaching, guiding, and the expansion of something you\u2019ve been building"}, 'Saturn':{n:"a long period (19 years) of deep learning through effort and patience — Saturn doesn\u2019t give shortcuts but its results are the ones that actually last",m:"financial progress comes slowly, but what\u2019s built during Saturn is what holds"}, 'Mercury':{n:"a period where intelligence, communication, and the quality of your thinking determine everything — the people you know and the ideas you develop matter most",m:"income comes through your mind — writing, communication, analysis, and the right conversations"} }; function fill(text,k){ var sun=k.sunSign||'Sagittarius',moon=k.moonSign||'Scorpio',lag=k.lagnaSign||'Libra',nak=k.nakshatra||'Jyeshtha',dasha=k.dashas&&k.dashas[0]?k.dashas[0].lord:'Saturn'; var sd=SD[sun]||SD['Sagittarius'],md=SD[moon]||SD['Scorpio'],ld=SD[lag]||SD['Libra'],nd=ND[nak]||ND['Jyeshtha'],dd=DD[dasha]||DD['Saturn'],nm=S.user.name||'Seeker'; return text.replace(/{N}/g,nm).replace(/{SUN}/g,sun).replace(/{MOON}/g,moon).replace(/{LAGNA}/g,lag).replace(/{NAK}/g,nak).replace(/{DASHA}/g,dasha).replace(/{SUN_N}/g,sd.n).replace(/{SUN_CS}/g,sd.cs).replace(/{SUN_E}/g,sd.e).replace(/{MOON_LP}/g,md.lp).replace(/{MOON_H}/g,md.h).replace(/{LAGNA_IMP}/g,ld.imp).replace(/{NAK_AT}/g,nd.at).replace(/{NAK_H}/g,nd.h).replace(/{NAK_GR}/g,nd.gr).replace(/{NAK_MQ}/g,nd.mq).replace(/{DASHA_N}/g,dd.n).replace(/{DASHA_M}/g,dd.m); } var PEVTS=[["Saturn trine Jupiter (Jan 8)","Venus enters Pisces (Jan 17)"],["Mercury retrograde begins (Feb 5)","Full Moon in Leo (Feb 12)"],["Jupiter conjunct Chiron (Mar 3)","Spring equinox — Sun enters Aries (Mar 20)"],["Mars enters Gemini (Apr 2)","New Moon solar eclipse (Apr 20)"],["Pluto retrograde (May 1)","Venus at greatest brilliance (May 19)"],["Saturn stations direct (Jun 4)","Summer solstice (Jun 21)"],["Venus retrograde begins (Jul 22)","Mars opposition Saturn (Jul 30)"],["Jupiter trine Uranus (Aug 14)","Mars enters Virgo (Aug 27)"],["Mercury enters Libra (Sep 5)","Autumnal equinox (Sep 23)"],["Mars square Pluto (Oct 9)","Full Moon lunar eclipse (Oct 28)"],["Jupiter enters Gemini (Nov 9)","Mars enters Sagittarius (Nov 19)"],["Saturn sextile Neptune (Dec 3)","Winter solstice (Dec 21)"]]; var CORES=[ { p1:"Saturn is slowing things down for {N} right now — and that\u2019s actually intentional. Your {SUN} Sun is built to {SUN_CS}, but Saturn is saying: not yet, do the groundwork first. This month, the slow-moving thing you\u2019ve been pushing on finally shows a crack of progress. It won\u2019t feel dramatic. It will feel like something quietly clicking into place.", p2:"Your {MOON} Moon in {MOON} means you tend to {MOON_LP}. Saturn is touching that part of you this month — asking you to stop managing your feelings and just feel them. The thing you\u2019ve been diplomatically avoiding saying to someone? This month, saying it clearly will actually help. Your {NAK} Nakshatra's lesson right now: {NAK_GR}.", love:"Your {MOON} Moon needs {MOON_LP} — and this month that need is loudest. If you\u2019re in a relationship, there\u2019s one conversation you\u2019ve both been circling around. Saturn is pushing it into the open. If you\u2019re single, your {NAK} quality of {NAK_AT} is genuinely attractive right now — people feel your steadiness.", career:"Saturn is watching your work this month, and someone senior is watching too. Your {SUN} Sun instinct to {SUN_CS} is exactly what\u2019s needed. Show up consistently and do solid work — recognition doesn\u2019t come in a rush this month, it comes in a quiet nod from the right person.", money:"Something financial that felt frozen is starting to move. Your current {DASHA} period ({DASHA_M}) is the background energy here. Don't make big speculative bets in the last week of the month — that\u2019s when the energy is least reliable for financial decisions.", health:"Saturn rules discipline, and also over-discipline. The risk this month is working so hard that you deplete yourself before you notice. Your {MOON} Moon's weak spot: {MOON_H}. One proper rest hour per day isn\u2019t laziness — it\u2019s what keeps you going.", growth:"The thing you\u2019re being asked to let go of this month is something you\u2019ve outgrown — a belief, a habit, or an identity that used to serve you but doesn\u2019t anymore. Your {NAK} Nakshatra's current growth edge: {NAK_GR}. The resistance you feel around this is normal. Do it anyway." }, { p1:"Jupiter is opening doors for {N} this month — and this is one of the better months your chart will see this year. Your {SUN} Sun's natural direction is toward {SUN_N}, and right now the universe is actually cooperating with that. New possibilities that appear this month deserve a real look, not a quick dismissal.", p2:"Your {MOON} Moon in {MOON} means you process things by {MOON_LP}. Jupiter is amplifying that this month — your instincts are sharper than usual. Something that\u2019s felt emotionally unresolved for a while reaches a natural conclusion. Not because you forced it, but because the time for it has simply arrived. Your {NAK} quality of {NAK_MQ} is especially heightened.", love:"Jupiter is the planet that makes good things better and brings warmth where things have gone cold. Your {MOON} Moon's core need — {MOON_LP} — has a real chance of being met this month. If you\u2019re in a relationship, receive the warmth being offered instead of second-guessing it. If you\u2019re single, your {NAK} quality of {NAK_AT} is drawing the right people in.", career:"A real professional opportunity is showing up this month — but it might look smaller than it is at first. A conversation, an introduction, a small project. Your {SUN} Sun's gift of being able to {SUN_CS} is visible to the right people right now. Follow up on things that feel slightly too good to be true.", money:"Jupiter brings genuine good luck with money this month. Something positive arrives — likely between the 10th and 20th. Your {DASHA} period ({DASHA_M}) is supporting this. Treat whatever comes as a foundation to build on, not a one-off windfall to spend.", health:"Your body is responding well to whatever you invest in it this month. Your {MOON} Moon's constitution — {MOON_H} — is being supported by the current sky. Anything you start now health-wise will actually stick — better time to build habits than to maintain them.", growth:"Jupiter's growth isn\u2019t about becoming someone different. It's about becoming more fully the person you already are. Your {NAK} Nakshatra's growth edge is available right now: {NAK_GR}. This month you have real access to it — more than usual." }, { p1:"Venus is running things for {N} this month — and Venus is about what makes life actually worth living. Your {LAGNA} Ascendant — you naturally {LAGNA_IMP} — is getting an infusion of warmth and genuine likability this month. People see you as more attractive, more magnetic. How you feel inside and how others experience you are unusually matched right now.", p2:"Your {MOON} Moon in {MOON} processes everything by {MOON_LP}. Venus is making that easier this month — the emotional weather is lighter, the days feel less heavy. Not because your circumstances changed dramatically, but because your orientation shifted from grinding to receiving. Your {NAK} Nakshatra's receptive quality of {NAK_MQ} is fully activated. You're in your {DASHA} Mahadasha, which is shaping your life's biggest themes right now.", love:"This is genuinely one of the most connected months available in your current cycle. What you show the world and what you actually feel inside are aligned — that\u2019s rare, and people feel it. In a relationship: just receive the love being offered. Stop waiting for the other shoe to drop. Single: your {NAK} quality of {NAK_AT} is your actual magnetism this month — lean into it.", career:"The career win this month comes through a conversation, not a process. Something that\u2019s felt like a stuck professional problem resolves itself when you talk to the right person. Your {LAGNA} Ascendant means you {LAGNA_IMP} — and that\u2019s exactly what\u2019s working in your favour right now. Be available. The month's biggest professional moment arrives through a person.", money:"Money that\u2019s been owed to you — or returns on effort you put in months ago — starts arriving. Your {DASHA} period is {DASHA_M}. A financial situation that\u2019s been dragging along reaches its natural end point this month.", health:"The most powerful health move this month is counterintuitive: increase the pleasure in your days. Your {MOON} Moon type — {MOON_H} — needs nourishment right now, not discipline. One thing per day that you do purely because it feels good is not self-indulgence. It's the specific medicine this month.", growth:"You've been giving a lot. Venus this month is asking: can you receive with the same openness you give? Your {SUN} Sun's deepest drive is {SUN_E}. The growth this month is learning to let things come toward you instead of always reaching. Your {NAK} Nakshatra holds the key: {NAK_GR}." }, { p1:"Something is waking up for {N} this month — and it might feel uncomfortable before it feels like freedom. A pattern you\u2019ve been living inside for a long time is becoming visible as a choice, not a given. Your {SUN} Sun in {SUN} is built to seek {SUN_N}, but a habit or belief has been quietly blocking that. This month you can see it clearly for the first time.", p2:"Your {MOON} Moon in {MOON} means you tend to {MOON_LP}. Right now, that instinct is running at full power — your read on people and situations is more accurate than your logical analysis. This is a window, not a permanent state. Trust what you feel over what you think you should feel. Your {DASHA} Mahadasha is {DASHA_N} — that\u2019s the bigger current running underneath everything this month.", love:"The theme in relationships this month is honest vulnerability. Your {MOON} Moon describes what you actually need underneath your composed exterior — specifically, {MOON_LP}. Something real is available if you\u2019re willing to say the true thing instead of the managed thing. In a relationship: one genuine conversation is available that could change the dynamic significantly. Single: your {NAK} quality of {NAK_AT} is what\u2019s genuinely magnetic right now.", career:"Two things are happening professionally at the same time: something needs to be finished, and something new is appearing with a shorter window than feels comfortable. Your {SUN} Sun type — {SUN_CS}. The way through: delegate the unfinished thing and personally handle the new opening.", money:"The financial picture has something ambiguous in it this month — something that doesn\u2019t look clearly good or bad. Give it time. What reads as unclear now will reveal itself as positive within a few weeks. Your {DASHA} period is governing {DASHA_M}.", health:"Unprocessed emotion and physical tension are connected for your {MOON} Moon type. If your body feels tight or heavy this month, it\u2019s worth asking what you haven\u2019t said or felt. Movement that\u2019s also meditative — walking, slow yoga — works better than intense exercise right now.", growth:"Who you\u2019ve told yourself you are and who you actually are — those two things are moving closer together this month. Your {SUN} Sun at its most authentic is oriented toward {SUN_E}. Your {NAK} Nakshatra carries this month's specific growth key: {NAK_GR}." }, { p1:"Mars is energising {N}'s chart this month — this is a month for action, not analysis. Your {SUN} Sun's direction toward {SUN_N} is getting direct fuel. A professional opportunity is in front of you with a shorter decision window than feels comfortable — but it\u2019s real. Mars rewards people who act from clarity. The caution: don\u2019t act from frustration.", p2:"Your {MOON} Moon in {MOON} tends to {MOON_LP} — and Mars is accelerating that tendency right now. Whatever emotions are present are running louder than usual. The invitation is to bring that energy into honesty rather than reaction. Something that\u2019s been circling for months gets resolved this month if you say the thing clearly instead of softening it. Your {NAK} quality of {NAK_MQ} is intensified.", love:"Mars in your relationship zone creates intensity — and the invitation to be direct. Your {MOON} Moon's fundamental need — {MOON_LP} — is asking to be expressed, not managed. A direct, honest conversation available this month has more transformative power than six months of circling.", career:"Someone with actual authority over your career trajectory is noticing you this month. Your {SUN} Sun — {SUN_CS} — is exactly what they're looking for. Be visible. Be prepared. Be available to say yes quickly when the moment arrives.", money:"Something financial moves positively this month — but tell fewer people than you feel like telling. The gain is most durable if it\u2019s not announced before it\u2019s secure. Your {DASHA} period is {DASHA_M}.", health:"Mars brings real energy and the specific risk of burning through it faster than you replenish it. First three weeks: push hard. Final week: recover deliberately. Your {NAK} Nakshatra's physical sensitivity is around {NAK_H} — watch that area.", growth:"The growth this month is using Mars's energy to build something, not to fight something. Your {SUN} Sun at its clearest is oriented toward {SUN_E}. Your {NAK} Nakshatra's edge: {NAK_GR}." } ]; function getSkyPlanet(off){ // Returns the dominant sky planet for month (current + off) // Uses actual transiting positions via calcLons at the 15th of the target month var now=new Date(); var tgtMonth=now.getMonth()+off; var tgtYear=now.getFullYear()+Math.floor(tgtMonth/12); tgtMonth=((tgtMonth%12)+12)%12; var tgtDate=new Date(tgtYear,tgtMonth,15); var dateStr=tgtDate.getFullYear()+'-'+ String(tgtDate.getMonth()+1).padStart(2,'0')+'-'+ String(tgtDate.getDate()).padStart(2,'0'); try{ var jd=julianDay(dateStr,'12:00',5.5); var lo=calcLons(jd); // Sidereal positions of slow planets this month var ayan=lahiriAyanamsa(jd); function sid(lon){return((lon-ayan)%360+360)%360;} var satLon=sid(lo.saturn); var jupLon=sid(lo.jupiter); var marLon=sid(lo.mars); var venLon=sid(lo.venus); var rahuLon=sid(lo.rahu); var sunLon=sid(lo.sun); // Dominant planet = whichever slow planet is most prominently // placed this month (in its own sign, exalted, or aspecting Sun) // Simple heuristic: use the transiting Sun sign to pick the theme // Sun moves ~30 deg/month so each sign = one calendar month var sunSign=Math.floor(sunLon/30)%12; // Map Sun sign to planetary ruler (traditional Vedic rulerships) // Aries=Mars, Taurus=Venus, Gemini=Mercury→Jupiter, Cancer=Moon→Saturn, // Leo=Sun→Jupiter, Virgo=Mercury→Venus, Libra=Venus, Scorpio=Mars→Saturn, // Sagittarius=Jupiter, Capricorn=Saturn, Aquarius=Saturn→Rahu, Pisces=Jupiter var signToPlanet=[4,2,1,0,1,2,2,0,1,0,3,1]; // index into CORES var corePlanet=signToPlanet[sunSign]; // Override: if Mars is very strong this month (in own sign Aries/Scorpio // or exalted Capricorn), use Mars theme var marSign=Math.floor(marLon/30)%12; if(marSign===0||marSign===7||marSign===9) corePlanet=4; // Mars theme // Override: if Jupiter in own/exalt (Sag, Pisces, Cancer), use Jupiter var jupSign=Math.floor(jupLon/30)%12; if(jupSign===8||jupSign===11||jupSign===3) corePlanet=1; // Jupiter theme // Override: if Saturn strong (Capricorn, Aquarius, Libra), use Saturn var satSign=Math.floor(satLon/30)%12; if(satSign===9||satSign===10||satSign===6) corePlanet=0; // Saturn theme return corePlanet; }catch(e){ // Fallback: use month number to cycle through all 5 themes return (now.getMonth()+off)%5; } } function makeReading(dob,off){ var d=new Date(dob||'1990-01-01'); var seed=getSkyPlanet(off||0); var ev=PEVTS[(new Date().getMonth()+(off||0))%12]; var c=CORES[seed]; var k=calcKundali(dob,S.user.tob||'12:00',S.user.city||''); var mn=MOS[(new Date().getMonth()+off)%12],yr=new Date().getFullYear()+(new Date().getMonth()+off>=12?1:0); // p3: birth star quality + lagna instruction + mulank number var nd_entry=(typeof ND!=='undefined'&&ND[k.nakshatra])||{mq:'deep perception',at:'intuitive clarity',gr:'act on what you perceive'}; var ml=mulank(dob); var mlDesc={1:'a number of leadership and independence — trust your own judgment this month',2:'a number of partnership and patience — the right collaboration matters more than going alone',3:'a number of expression and creativity — say the thing, make the thing, put it out',4:'a number of structure and discipline — build the system before you try to scale',5:'a number of change and adaptability — the disruption is pointing somewhere useful',6:'a number of responsibility and care — the people around you need something specific from you',7:'a number of depth and introspection — the answer is inside, not in more information',8:'a number of power and material accomplishment — act decisively, results are available',9:'a number of completion and generosity — something is finishing; let it finish cleanly',11:'a master number of intuition and inspiration — trust the flashes of knowing',22:'a master number of building at scale — think bigger than feels comfortable',33:'a master number of service and teaching — your presence is itself the gift'}[ml.num]||'a number pointing toward renewal'; var yr2=new Date().getFullYear(),ad2=k.dashas&&k.dashas.length?k.dashas.find(function(da){return da.from<=yr2&&da.to>yr2;})||k.dashas[0]:null; var dashaLord=ad2?ad2.lord:'Saturn'; var p3=[ 'Your '+k.nakshatra+' Nakshatra quality this month is your most useful tool: '+nd_entry.mq+'.', 'This is the actual lens through which you process what is happening right now.', 'Your '+k.lagnaSign+' Ascendant means you '+((typeof SD!=='undefined'&&SD[k.lagnaSign])?SD[k.lagnaSign].imp:'show up with your own signature energy')+'.', 'When those two things work together — your '+nd_entry.at.split(' and')[0]+' and your natural way of landing in a room — you have a genuine edge.', 'Numerologically, your birth number is '+ml.num+' — '+mlDesc+'. This month that energy is active, not background noise.' ].join(' '); var p4=[ 'The complete picture for '+mn+': you are in your '+dashaLord+' Mahadasha.', 'That means '+((typeof DD!=='undefined'&&DD[dashaLord])?DD[dashaLord].n:'a period of significant development')+'.', 'Your '+k.sunSign+' Sun and '+k.moonSign+' Moon are both active this month:', 'your Sun wants to '+((typeof SD!=='undefined'&&SD[k.sunSign])?SD[k.sunSign].cs:'move in its natural direction')+',', 'while your Moon needs to '+((typeof SD!=='undefined'&&SD[k.moonSign])?SD[k.moonSign].lp:'feel emotionally grounded')+'.', 'The actions available to you in '+mn+': one honest conversation you have been postponing,', 'one professional step your Sun has been ready for, and one deliberate act of care for your '+((typeof SD!=='undefined'&&SD[k.moonSign])?SD[k.moonSign].h:'constitution')+'.', 'These three taken this month compound forward.' ].join(' '); return{month:mn,year:yr,events:ev,p1:fill(c.p1,k),p2:fill(c.p2,k),p3:p3,p4:p4,love:fill(c.love,k),career:fill(c.career,k),money:fill(c.money,k),health:fill(c.health,k),growth:fill(c.growth,k),sunSign:k.sunSign,moonSign:k.moonSign,lagnaSign:k.lagnaSign,nakshatra:k.nakshatra}; } // ═══════════════════════════════════════════════════ // NUMEROLOGY — verbatim drishti // ═══════════════════════════════════════════════════ var PYTH={A:1,B:2,C:3,D:4,E:5,F:6,G:7,H:8,I:9,J:1,K:2,L:3,M:4,N:5,O:6,P:7,Q:8,R:9,S:1,T:2,U:3,V:4,W:5,X:6,Y:7,Z:8}; var VOWELS={A:1,E:5,I:9,O:6,U:3,Y:7}; function reduce(n){if(n===11||n===22||n===33)return n;while(n>9){var s=0;String(n).split('').forEach(function(d){s+=parseInt(d);});n=s;if(n===11||n===22||n===33)return n;}return n;} function lifePath(dob){if(!dob)return{num:7,f:''};var p=dob.split('-'),y=parseInt(p[0]),m=parseInt(p[1]),d=parseInt(p[2]);var tot=reduce(reduce(y)+reduce(m)+reduce(d));return{num:tot,f:y+' → '+reduce(y)+' | '+m+' → '+reduce(m)+' | '+d+' → '+reduce(d)+' = '+tot};} function destiny(name){if(!name)return{num:3,f:''};var cl=name.toUpperCase().replace(/[^A-Z]/g,''),s=0,ps=[];cl.split('').forEach(function(c){var v=PYTH[c]||0;s+=v;if(v)ps.push(c+'='+v);});var num=reduce(s);return{num:num,f:ps.join('+')+' = '+s+' → '+num};} function soulUrge(name){if(!name)return{num:2,f:''};var cl=name.toUpperCase().replace(/[^A-Z]/g,''),s=0,ps=[];cl.split('').forEach(function(c){if(VOWELS[c]){s+=VOWELS[c];ps.push(c+'='+VOWELS[c]);}});return{num:reduce(s)};} function personality(name){if(!name)return{num:5,f:''};var cl=name.toUpperCase().replace(/[^A-Z]/g,''),s=0,ps=[];cl.split('').forEach(function(c){if(!VOWELS[c]&&PYTH[c]){s+=PYTH[c];ps.push(c+'='+PYTH[c]);}});return{num:reduce(s)};} var NUM_INFO={1:{name:'The Leader',lp:'You are here to forge paths where none exist. Independence, originality, and the courage to stand alone define your deepest purpose.'},2:{name:'The Diplomat',lp:'You are here to build bridges between worlds. Sensitivity, partnership, and the art of making others feel genuinely heard are your highest gifts.'},3:{name:'The Creator',lp:'You are here to express, to create, and to remind the world that joy is a legitimate form of intelligence.'},4:{name:'The Builder',lp:'You are here to build — systems, organisations, and the patient structures that allow others to flourish.'},5:{name:'The Seeker',lp:'You are here to explore the world and the endless variety of human experience. Freedom is what you require.'},6:{name:'The Nurturer',lp:'You are here to love and to be of service. Responsibility is not a burden — it is the expression of your deepest instinct.'},7:{name:'The Mystic',lp:'You are here to know — really know, beneath the surface of things. The search for truth and spiritual depth define your path.'},8:{name:'The Achiever',lp:'You are here to master the material world and demonstrate that power wielded with integrity is a force for genuine good.'},9:{name:'The Sage',lp:'You are here to complete a long journey — to gather everything experience has taught, and to give it back generously and without condition.'},11:{name:'The Intuitive',lp:'You carry a master number — a frequency demanding extraordinary sensitivity and willingness to serve as a conduit for insight.'},22:{name:'The Architect',lp:'You carry the master number of practical transformation — the ability to take vision and build it into lasting real-world form.'},33:{name:'The Teacher',lp:'The master number 33 — the master teacher whose love is unconditional and whose presence itself becomes a form of healing.'}}; // ═══════════════════════════════════════════════════ // TAROT — verbatim drishti // ═══════════════════════════════════════════════════ function drawCard(dob,name){ var seed=0;(dob||'').replace(/-/g,'').split('').forEach(function(c){seed=seed*31+parseInt(c)||0;});(name||'').toUpperCase().split('').forEach(function(c){seed=seed*37+(c.charCodeAt(0)||0);});seed=Math.abs(seed)%999983+1; function rng(){seed=(seed*16807)%2147483647;return(seed-1)/2147483646;} var deck=TAROT.slice();for(var i=deck.length-1;i>0;i--){var j=Math.floor(rng()*(i+1));var tmp=deck[i];deck[i]=deck[j];deck[j]=tmp;} return deck.slice(0,3).map(function(c,i){return{card:c,reversed:rng()>.65,position:['Past','Present','Future'][i]};}); } var SHLOKAS=[{text:'All planets are fruit-givers; those who know their timing are called the truly wise.',src:'— Brihat Parashara Hora Shastra'},{text:'Where there is alignment of cosmic forces, there is victory.',src:'— Bhagavad Gita 18.78'},{text:'All the nakshatras and planets bestow their gifts upon the sincere seeker.',src:'— Atharva Veda 19.8'},{text:'The Self is to be seen, to be heard, to be reflected upon — therein lies all cosmic knowledge.',src:'— Brihadaranyaka Upanishad 2.4.5'},{text:'Your right is to perform your duty; the fruits of action are written in the stars.',src:'— Bhagavad Gita 2.47'}]; // ═══════════════════════════════════════════════════ // FEATURE MENU — new screen after constellation // ═══════════════════════════════════════════════════ /* buildFeatureMenu removed */ // ═══════════════════════════════════════════════════ // FEATURE DETAIL — deep-dive preview with paywall gate // ═══════════════════════════════════════════════════ /* showFeatureDetail removed */ /* flipDetailTarot removed */ /* updateNav removed */ /* go_silent removed */ // ═══════════════════════════════════════════════════ // COMPATIBILITY in detail screen // ═══════════════════════════════════════════════════ /* calcCompatibilityDetail removed */ // ═══════════════════════════════════════════════════ // DAILY ENERGY CARD // ═══════════════════════════════════════════════════ function buildDailyCard(){ var el=document.getElementById('daily-section');if(!el)return; var today=new Date(),jdToday=julianDay(today.toISOString().slice(0,10),'12:00',5.5),loT=calcLons(jdToday); var moonSign=SIGNS[lonToSign(loT.moon)],sunSign=SIGNS[lonToSign(loT.sun)],dow=today.getDay(); var DAY_P=['Sun','Moon','Mars','Mercury','Jupiter','Venus','Saturn']; var THEMES={Sun:'Clarity and authentic self-expression are available today. Leadership qualities are heightened.',Moon:'Emotional intelligence is your greatest asset. Trust intuition over analysis.',Mars:'Energy and initiative are abundant. Begin what you have been delaying.',Mercury:'Communication and negotiation are strongly favoured. Send the message.',Jupiter:'An opportunity for growth presents itself. Generosity returns amplified.',Venus:'Relationships and creative work are blessed. Beauty in the ordinary is available.',Saturn:'Discipline and focused effort produce outsized results. Build something lasting.'}; var PCOLS={Sun:'#e8c060',Moon:'#c8c0b4',Mars:'#e08070',Mercury:'#78b898',Jupiter:'#7898c8',Venus:'#98c898',Saturn:'#a880c8'}; var dayP=DAY_P[dow],theme=THEMES[dayP]||'',nakToday=getNak(loT.moon); var dateStr=today.toLocaleDateString('en-IN',{weekday:'long',day:'numeric',month:'long'}); el.innerHTML='
'+dateStr+'
'+('Today\'s Cosmic Energy')+'
'+theme+'
'+{Sun:'☉',Moon:'☽',Mars:'♂',Mercury:'☿',Jupiter:'♃',Venus:'♀',Saturn:'♄'}[dayP]+''+'Day: '+dayP+'
'+('Moon: ')+moonSign+'
✦ '+nakToday+'
'; } // ═══════════════════════════════════════════════════ // PREDICTION SCREEN (kept for back-compat if needed) // ═══════════════════════════════════════════════════ /* buildPlanetTable removed */ // ═══════════════════════════════════════════════════ // PAYWALL // ═══════════════════════════════════════════════════ /* buildPaywall removed */ /* selectPlan removed */ // ═══════════════════════════════════════════════════ // RICH LOCAL READING GENERATOR // Produces long, personalised, paragraph-form content // for every domain — zero API calls needed // ═══════════════════════════════════════════════════ // Extended domain templates — 5 variants per domain, full paragraphs var LOVE_CORES=[ "The planetary configuration this month places Venus in direct dialogue with your {MOON} Moon — and for {N}, whose emotional landscape is shaped by {MOON_LP}, this creates one of the more genuinely tender passages available in the current cycle. The barriers that have accumulated in your closest relationships are not structural; they are conversational, and the conversation required is simpler than fear has made it appear. For those already in partnership, the specific invitation is to lower the register — to say the quiet thing that has been carefully managed rather than expressed. Your {NAK} Nakshatra carries the energetic quality of {NAK_AT}, and this quality becomes, in this month's relational field, the precise frequency your closest person most needs to receive. For those unattached, the movement available is not pursuit but genuine openness — your {LAGNA} Ascendant, which causes you to {LAGNA_IMP}, is unusually visible and unusually attractive in this window. The cosmic instruction is simply: be present, be honest, and allow what is already moving toward you to arrive.", "Your {MOON} Moon in {MOON} is the governing force of your relational life — and this month, that force is amplified by a rare alignment between your Moon's natal position and the current transiting sky. {MOON} Moon individuals {MOON_LP}, and this month that capacity becomes your greatest relational asset. A relationship that has existed in a kind of pleasant stasis is ready to deepen — the question is whether you are willing to initiate the depth. The initiating energy does not require a grand gesture; it requires the specific courage of saying what is actually true. Your {NAK} Nakshatra's shadow — {NAK_GR} — is the precise growth edge this relational moment is inviting you toward. The health of the body area associated with your Nakshatra ({NAK_H}) often reflects emotional truths before the mind acknowledges them; what has been held in the body in this regard is asking for honest expression this month. For those navigating the complexity of new connection, the {DASHA} Mahadasha's energy ({DASHA_N}) provides both the depth and the discernment to distinguish what is genuinely promising from what merely feels exciting.", "Venus and Jupiter are in conversation this month in a way that touches your {LAGNA} Ascendant directly — and for {N}, this translates as a period of genuine relational grace. The way you {LAGNA_IMP} is being received with unusual warmth. People who matter are seeing you with clarity, and what they see, they value. This is not a month to second-guess the evidence of warmth offered to you; it is a month to receive it with the same generosity you typically extend to others. Your {MOON} Moon's territory — {MOON_H} — is one of the places where stress from relationship ambiguity lands first; notice what your body is telling you about which connections feel nourishing and which feel depleting, because that information is accurate. For those seeking partnership, your {NAK} quality of {NAK_AT} is functioning as genuine magnetism — and the person most likely to recognise it is someone who leads with their own authentic depth rather than their social presentation. Trust the quiet draw over the dramatic pull this month.", "The relational theme of this month for {N} is the movement from familiarity to genuine intimacy. Familiarity — knowing someone\u2019s patterns, preferences, and responses — can masquerade as closeness while actually maintaining distance. Your {MOON} Moon, which {MOON_LP}, has developed a particular skill at creating the warmth of closeness while carefully managing actual exposure. This month's planetary arrangement is specifically targeting that management — not to expose you to harm, but to offer you access to the depth of connection that your {NAK} Nakshatra ({NAK_AT}) is actually capable of creating. The {DASHA} Mahadasha you are currently moving through governs {DASHA_N} — and within that larger theme, the relational strand is: the intimacy you have been protecting yourself from is the intimacy that will actually nourish you. A specific person in your life — one whose feeling for you you have quietly discounted — deserves to be seen more carefully this month.", "Saturn's steadying influence on your relationship sector this month brings a quality of honest reckoning that, while less romantically charged than Venus transits, is considerably more useful for the long-term architecture of your relational life. For {N}, whose {MOON} Moon finds expression through {MOON_LP}, this is the month to address what has been agreed to by default rather than by genuine choice. A pattern in your most significant relationship — one you have accommodated because renegotiating it felt more costly than tolerating it — has reached its natural expiry. Saturn is making it visible precisely because the moment to address it constructively has arrived. Your {LAGNA} Ascendant, which causes you to {LAGNA_IMP}, serves you well in this conversation if you lead with honesty rather than with diplomacy. The diplomatic version will be heard; the honest version will be felt — and only the felt version will produce the shift now available." ]; var CAREER_CORES=[ "The professional domain for {N} this month is governed by a potent alignment between your {SUN} Sun's natal energy and the current transiting sky. Your {SUN} Sun seeks {SUN_N} — and the conditions this month are actively rewarding exactly that orientation. The specific opportunity in focus is not necessarily the largest or most visible project on your current plate; it is the one requiring the most of your particular gift. Your {LAGNA} Ascendant means you {LAGNA_IMP} — and this month, that impression is landing with unusual force on the people whose opinion of your work matters most to the trajectory ahead. A conversation or presentation in the second week carries significantly more weight than its surface appearance suggests. The {DASHA} Mahadasha's professional strand governs {DASHA_M}, and within that context, a commitment made this month has a longer productive lifespan than the immediate circumstances would indicate. The instruction: do the work that is most genuinely yours, and allow it to be seen without managing how it lands.", "Jupiter's expansive gaze falls on your professional sector with unusual directness this month — and for {N}, this translates as a period where ambition and opportunity are unusually well matched. Your {SUN} Sun in {SUN}, which orients toward {SUN_N}, is finding that what once required considerable effort to establish is now simply being recognised. The important caveat with Jupiter transits is that they expand whatever is already present — which means this is not the moment for new strategies but for deepening and presenting the work you have already developed. Your {SUN} Sun's professional mode — you {SUN_CS} — is precisely what is being sought by the people now in your professional orbit. One specific authority figure will revise their understanding of your capabilities based on something they observe directly this month; do not minimise or dilute your presentation on the assumption that the full version is too much. The full version is exactly what is being asked for.", "The career energy this month for {N} has the quality of culmination — something that has been in development for longer than is obvious is approaching a threshold moment. Your {SUN} Sun's drive toward {SUN_N} has been building toward this month's specific conditions, and the work is to recognise the threshold when it arrives rather than stepping past it in the habitual pursuit of the next thing. Your {LAGNA} Ascendant is operating at unusually high visibility — you {LAGNA_IMP}, and that impression is currently reaching people who can act on it. The {DASHA} Mahadasha governs {DASHA_M}, which means the professional moves made in this window carry disproportionate forward momentum. One caution: the opportunity most worth pursuing this month may arrive through a channel you have not been monitoring. Remain available to the unexpected approach.", "Saturn's disciplined energy through your 10th house of career creates the conditions this month that reward exactly the kind of sustained effort your {SUN} Sun in {SUN} has been making. You {SUN_CS} — and Saturn is making this quality visible to the people with structural authority over your trajectory. The professional advancement available this month is not loud or celebratory; it is the quiet, durable kind that changes the baseline. A responsibility that feels like a burden when first assigned will reveal itself as the specific platform from which your next level of contribution becomes possible. Your {DASHA} Mahadasha, governing {DASHA_M}, supports the kind of deliberate, patient professional movement that Saturn rewards. The instruction: do not look for shortcuts this month. The path that looks longest is the one that actually moves fastest.", "Mercury's activation of your communication sector this month creates conditions of unusual professional fluency for {N}. Your {SUN} Sun's orientation toward {SUN_N} finds its most effective expression through the exchange of ideas this month — a presentation, negotiation, or written proposal carries the full weight of your {LAGNA} Ascendant's natural impression. You {LAGNA_IMP}, and in this Mercury window, the medium of communication amplifies that impression rather than diminishing it. The specific professional move available is one that requires you to articulate something you have understood intuitively but have not yet translated into language your professional environment can act on. The {DASHA} Mahadasha governs {DASHA_M} — and within that framework, the financial and professional return on this communication will arrive in a longer arc than the immediate response suggests. Say the full thing, with the confidence that its value will be recognised." ]; var MONEY_CORES=[ "The financial picture for {N} this month is shaped primarily by your {DASHA} Mahadasha's governing energy: {DASHA_M}. This is not a background condition — it is the active force shaping which financial moves will generate sustainable return and which will produce only temporary gain. A development in your income or investment situation that has been unresolved for some time is approaching its natural clarification point, and the clarification is likely to be favourable if you approach it with patience rather than forcing a premature conclusion. Your {SUN} Sun's orientation toward {SUN_N} inclines you toward financial decisions that align with your deeper values — and this month, that alignment is unusually productive. The specific caution: avoid restructuring arrangements that are currently stable in pursuit of something that looks more optimal. Stability has its own compounding value, and the grass is particularly illusory this month.", "Jupiter's expansive influence on your financial sector creates genuine opportunity this month — and for {N}, the key is distinguishing between Jupiter's real gifts and Jupiter's inflated appearances. The real gift is a development that produces durable, compounding return; the inflated appearance is something that looks large in the moment but dissipates quickly. Your {DASHA} Mahadasha governs {DASHA_M}, and within that context, the financial move most worth pursuing is the one that builds infrastructure rather than the one that produces immediate visible gain. Your {MOON} Moon's financial constitution ({MOON_H}) suggests an emotional relationship with money that is worth examining this month: what financial choices have been made from anxiety rather than strategy? This month's clarity allows those patterns to become visible — and visible patterns are changeable patterns. A windfall or positive surprise arrives between the 10th and 20th.", "The financial theme of this month for {N} is consolidation with forward movement — two things that usually feel in tension but are being brought into unusual alignment by the current planetary arrangement. Your {DASHA} Mahadasha's governance of {DASHA_M} means that the financial decisions made in this window will have longer legs than their immediate context suggests. Something from your financial past — a delayed payment, an unresolved arrangement, or a deferred opportunity — arrives at its resolution point, and the resolution includes something valuable. Your {SUN} Sun's orientation toward {SUN_N} means you are at your financially strongest when your material choices align with your purpose; this month, a financial decision that also serves your deeper values will outperform a decision made purely for financial optimisation. The calculation that includes meaning in its variables is the accurate one.", "Saturn's influence on your financial sector this month brings the quality of honest reckoning that, over time, always produces better outcomes than avoidance. For {N}, a financial situation that has been managed carefully rather than addressed directly is ready for honest examination. Your {DASHA} Mahadasha governs {DASHA_M} — and the specific financial wisdom available within that energy is the kind that comes from disciplined accumulation rather than strategic brilliance. The month's financial instruction is precise: reduce complexity where it exists for its own sake, and double down on the one financial practice that has consistently produced return. The compound effect of doing the right simple thing is significantly underestimated in your current financial thinking. One specific action taken in the final ten days of the month locks in a favourable position that would otherwise require renegotiation.", "Mercury's activation of your resource sector creates unusual financial fluency this month — specifically around negotiations, contracts, and agreements. For {N}, whose {DASHA} Mahadasha governs {DASHA_M}, this is the window to have the financial conversations that have been deferred. A renegotiation or revised agreement available this month produces terms considerably more favourable than the current arrangement. Your {SUN} Sun's financial instinct — its orientation toward {SUN_N} — is at its most accurate in conversations rather than solo deliberation; bring your financial questions into dialogue this month, and trust the clarity that emerges from exchange. The specific caution is against over-researching: the information available to you this month is sufficient to make the decisions in front of you. The impulse to gather more data before acting is fear dressed as thoroughness." ]; var HEALTH_CORES=[ "The health and vitality picture for {N} this month is governed by a direct relationship between physical energy and emotional honesty. Your {MOON} Moon in {MOON} connects to the body's territory of {MOON_H} — and the condition of that area this month is a direct readout of the emotional material currently being processed. If there is tension or depletion in that region, it is almost certainly tracking something in the relational or emotional domain that has not yet been given direct expression. This is not a causal claim that requires medical reinterpretation; it is an invitation to notice the correlation and follow it toward whatever needs to be said or felt. Your {NAK} Nakshatra carries specific sensitivity to {NAK_H} — which means your body will signal stress in that territory earlier than most. Take those signals seriously this month rather than managing them with effort. The single most health-supportive action available to you is the one that reduces emotional carrying load.", "Jupiter's supportive transit through your vitality sector creates conditions this month where investment in health produces compounding return — what you begin in terms of physical practice or attention to the body now will carry forward with unusual momentum. For {N}, whose {NAK} Nakshatra carries sensitivity to {NAK_H}, this is precisely the right window to address that area with care rather than waiting for it to demand attention. Your {MOON} Moon's constitution — {MOON_H} — is receiving supportive energy from the current sky, which means the body is more receptive than usual to new health inputs. The specific instruction: begin one deliberate physical practice this month — something small enough to be sustainable and consistent enough to be transformative. The body is ready to respond in a way it has not been for several months. Do not wait for motivation; begin and allow motivation to follow action.", "The vitality theme for {N} this month is the relationship between rest and performance. Mars's activation of your energy sector creates the temptation to push harder across the board — and your {NAK} Nakshatra's quality of {NAK_AT} means that push feels natural and even enjoyable. The caution is structural: sustained high output without commensurate restoration depletes a reserve that takes considerably longer to rebuild than to spend. Your {MOON} Moon in {MOON} governs {MOON_H}, and this area is where depletion lands first and most visibly. The health instruction this month is: push hard in your first three weeks, and treat the final week as active restoration rather than low productivity. The performance available in the month following this one depends directly on the quality of rest taken in this one's final days. Sleep, movement, and genuine nutritional attention — not optimisation, but genuine care — are the three pillars.", "Saturn's steadying influence on your health sector this month creates the conditions that reward consistency over intensity — the cumulative health practice over the occasional heroic effort. For {N}, whose body carries the particular sensitivities associated with {NAK} Nakshatra ({NAK_H}), this is the month to build a sustainable rhythm rather than attempting a dramatic transformation. Your {MOON} Moon in {MOON} governs the body's domain of {MOON_H}, and Saturn is asking you to attend to that area with patient, regular care. One health habit dropped from your life in a previous busy season is worth restoring this month — not because the gap has been catastrophic, but because the restoration will build something more durable than the original practice. The specific health insight available under Saturn: what your body needs most is not more input but better regularity of the inputs already available to it.", "The health message most relevant to {N} this month comes from the direct relationship your {NAK} Nakshatra has with both physical constitution and emotional processing. The territory of {NAK_H} is where your body does its most sensitive work — and this month, with the emotional and relational themes in focus, that territory deserves deliberate support. Your {MOON} Moon in {MOON}, which connects to {MOON_H}, is the secondary signal: what the body holds in these areas this month is telling you something accurate about what the emotional system has been processing silently. The health practice most indicated is one that works with both body and awareness simultaneously — walking in nature, yoga, gentle movement done with presence rather than performance. The {DASHA} Mahadasha you are navigating ({DASHA_N}) has a specific relationship to vitality that rewards the practices that cultivate stillness as much as those that build strength." ]; var GROWTH_CORES=[ "The personal growth invitation available to {N} this month comes directly from your {NAK} Nakshatra's most essential challenge: {NAK_GR}. This is not an abstract spiritual principle — it is the specific edge that your soul's current configuration is working with, and this month's planetary arrangement has arranged the conditions that make genuine movement on this edge possible. The {DASHA} Mahadasha you are moving through governs {DASHA_N} — and within that larger arc, the inner development available now is the kind that changes not what you do but who you are while doing it. Your {SUN} Sun's deepest purpose — {SUN_E} — is the direction the growth is pointing. The practical instruction: identify one pattern in your daily life that you maintain not because it serves you but because it feels like you, and examine it with honest curiosity rather than defensive justification. The pattern will reveal something about the identity you have constructed versus the identity genuinely available to you.", "Jupiter's expansive gaze on your inner development sector creates conditions this month where genuine spiritual and psychological growth is available without the usual resistance and friction. For {N}, whose {NAK} Nakshatra carries the growth edge of {NAK_GR}, this is a window of unusual access to the level beneath ordinary self-improvement — the level at which identity itself is examined and gently revised. Your {SUN} Sun seeks {SUN_E}, and the growth available this month is directly in service of that deepest purpose. The {DASHA} Mahadasha's governance of {DASHA_N} provides both the context and the specific fuel for the inner movement now possible. The invitation is not to become more disciplined or more productive — it is to become more genuinely yourself. One belief about your own limitations that you have treated as a fact about reality is ready to be examined as the story it actually is.", "Saturn's influence on your growth sector this month creates the quality of inner development that lasts — not the peak experience but the permanent revision. For {N}, this means the growth available now is of the specific, unglamorous variety that actually changes the baseline. Your {NAK} Nakshatra's growth edge — {NAK_GR} — has been in the background of your experience for some time, showing up in the same patterns across different contexts. This month, Saturn is making that pattern visible with unusual clarity — not to shame it but to give you the vantage point from which genuine choice becomes possible. Your {SUN} Sun's deepest orientation ({SUN_E}) is the star to navigate by. The inner work available in this window: identify where you have been optimising at the level of behaviour when the actual work is at the level of belief. The behaviour will change permanently when the underlying belief changes; no amount of behavioural effort achieves what one genuine belief revision produces.", "The growth theme available to {N} this month is what the ancient texts call the movement from the constructed self to the essential self — not as a spiritual destination, but as a practical daily orientation. Your {MOON} Moon in {MOON}, which {MOON_LP}, has developed a sophisticated navigation system for maintaining emotional safety — and that system, while serving a genuine function, also maintains certain distances that you have outgrown needing. The {NAK} Nakshatra's quality of {NAK_MQ} is the raw material of the growth available now: it is not being asked to be tamed or transcended but to be understood and directed. Your {DASHA} Mahadasha governs {DASHA_N} — and within that context, the inner work most available is the examination of where depth has been protected rather than expressed. The growth edge: what would you do, say, or create if the protection were no longer necessary?", "The most significant growth available to {N} this month operates at the intersection of your {SUN} Sun's purpose and your {MOON} Moon's emotional truth. Your {SUN} Sun seeks {SUN_E} — this is the authentic direction of your soul's movement. Your {MOON} Moon tends to {MOON_LP} — this is the emotional texture through which that movement is experienced. When these two are in alignment, you are living from your full self; when they are in tension, you experience the specific kind of inner friction that exhausts without being able to name its source. This month's planetary configuration is specifically creating the conditions for alignment — not by resolving the tension intellectually but by creating circumstances in which choosing the {SUN} Sun's direction actually feels emotionally safe rather than emotionally costly. Your {NAK} Nakshatra's growth key is: {NAK_GR}. This is the month to take one genuine step in the direction that has felt too costly to take." ]; function pickVariant(cores,dob,off,domain){ // Combines sky planet + actual month number + birth data // Sky planet gives the theme; month number ensures text varies even // if the same planet rules consecutive months; birth data personalises. var skyPlanet=getSkyPlanet(off||0); // Actual calendar month for this reading (0-11, shifts each month) var now=new Date(); var tgtMonth=((now.getMonth()+(off||0))%12+12)%12; var birthSeed=0; (dob||'').replace(/-/g,'').split('').forEach(function(c){birthSeed=(birthSeed*31+parseInt(c,10))||0;}); var domainSeeds={love:7,career:11,money:13,health:17,growth:19}; // Month number shifts the base — different month = different variant // even if sky planet happens to be the same var seed=Math.abs(birthSeed + skyPlanet*37 + tgtMonth*53 + (domainSeeds[domain]||3)); return cores[seed%cores.length]; } function makeRichReading(dob,off){ var base=makeReading(dob,off); var k=calcKundali(dob,S.user.tob||'12:00',S.user.city||''); base.love =fill(pickVariant(LOVE_CORES, dob,off,'love'), k); base.career=fill(pickVariant(CAREER_CORES,dob,off,'career'),k); base.money =fill(pickVariant(MONEY_CORES, dob,off,'money'), k); base.health=fill(pickVariant(HEALTH_CORES,dob,off,'health'),k); base.growth=fill(pickVariant(GROWTH_CORES,dob,off,'growth'),k); return base; } // ═══════════════════════════════════════════════════ // SUCCESS / FULL READING SCREEN // ═══════════════════════════════════════════════════ /* buildSuccess removed */ /* switchMonthSuccess removed */ /* switchRTab removed */ /* renderMonth removed */ // ═══════════════════════════════════════════════════ // NUMEROLOGY BUILD // ═══════════════════════════════════════════════════ /* buildNumerology removed */ // ═══════════════════════════════════════════════════ // TAROT BUILD // ═══════════════════════════════════════════════════ /* buildTarotFronts removed */ /* buildTarotGrid removed */ /* revealTarot removed */ // Tarot pane is handled inline via revealTarot() — no extra wiring needed // ═══════════════════════════════════════════════════ // DOWNLOAD & SHARE // ═══════════════════════════════════════════════════ /* buildText removed */ /* downloadReading removed */ /* shareReading removed */ /* toast removed */ // ═══════════════════════════════════════════════════ // ONBOARDING // ═══════════════════════════════════════════════════ function setErr(id,msg){document.getElementById('e-'+id).textContent=msg||'';} /* startJourney removed */ // ═══════════════════════════════════════════════════ // ASK THE UNIVERSE — with API key + language // ═══════════════════════════════════════════════════ /* updateQDots removed */ /* addMsg removed */ // ═══════════════════════════════════════════════════ // LOCAL ORACLE — Ask The Universe (no API) // ═══════════════════════════════════════════════════ function localOracleResponse(q,u,k2){ var name=u.name||'friend'; var yr=new Date().getFullYear(); var ad=k2.dashas&&k2.dashas.length?k2.dashas.find(function(d){return d.from<=yr&&d.to>yr;})||k2.dashas[0]:null; var dasha=ad?ad.lord:'Saturn'; var dashaEnd=ad?ad.to:(yr+5); var dashaYrsLeft=dashaEnd-yr; var dd=DD[dasha]||{n:'significant development',m:'growth'}; var sd=SD[k2.sunSign]||{}; var md=SD[k2.moonSign]||{}; var nd=ND[k2.nakshatra]||{}; var ml=mulank(u.dob); var lp=lifePath(u.dob); var venSign=SIGNS_ARR[k2.venus]||'unknown'; var jupSign=SIGNS_ARR[k2.jupiter]||'unknown'; var satSign=SIGNS_ARR[k2.saturn]||'unknown'; var rahuSign=SIGNS_ARR[k2.rahu]||'unknown'; var ql=q.toLowerCase(); // ── Question classifier ─────────────────────────────────────────────── var type=detectQ(ql); // ── Numerology timing helper ────────────────────────────────────────── // Personal Year number = reduce(current year + birth month + birth day) var pyNum=0; if(u.dob){var dp=u.dob.split('-');var py=parseInt(dp[0]),pm=parseInt(dp[1]),pd=parseInt(dp[2]);pyNum=reduce(reduce(yr)+reduce(pm)+reduce(pd));} var pyDesc={1:'a year of new beginnings',2:'a year of patience and partnerships',3:'a year of expression and social energy',4:'a year of hard work and building',5:'a year of change and freedom',6:'a year of responsibility and family',7:'a year of inner work and reflection',8:'a year of power and results',9:'a year of endings and completion',11:'a master year of intuition',22:'a master year of large-scale building'}[pyNum]||'a year of transition'; // ── Per-question response ───────────────────────────────────────────── if(type==='marriage'){ // 7th house lord, Venus, Jupiter for women / Mars for men // Strong marriage indicators: Venus in 7th from Lagna, Jupiter aspect, Venus dasha var venFav=(venSign==='Taurus'||venSign==='Libra'||venSign==='Pisces'); var jupFav=(jupSign==='Cancer'||jupSign==='Sagittarius'||jupSign==='Pisces'); var marriageDasha=(dasha==='Venus'||dasha==='Jupiter'||dasha==='Moon'); var timing=marriageDasha?'the current period is astrologically one of the stronger windows for marriage — especially in the next '+Math.min(dashaYrsLeft,3)+' years':'you are currently in your '+dasha+' period. '+dasha+' governs '+dd.n+'. Marriage is more likely in a Venus or Jupiter Mahadasha — watch for that shift in '+dashaEnd+' onwards'; return [ name+', I looked at your chart for the marriage question.', '', 'Your Venus — the planet that governs marriage, love, and partnerships — is currently in '+venSign+'. '+ (venFav?'This is a strong placement for Venus, which supports relationship fulfilment.':'Venus here is functional — not the most powerful position, but it does not block marriage.'), '', 'Jupiter, which blesses and expands what it touches including marriage, is in '+jupSign+'. '+ (jupFav?'Jupiter is very comfortable here and gives strong support for marriage and family.':'Jupiter here plays a supporting role.'), '', 'Your Dasha (the planetary period you are in) is '+dasha+' until '+dashaEnd+'. '+timing+'.', '', 'Numerologically: you are in Personal Year '+pyNum+' right now — '+pyDesc+'. '+ (pyNum===2||pyNum===6?'A Year 2 or Year 6 is traditionally one of the strongest years for marriage and commitment in numerology. This year carries genuine partnership energy.': pyNum===9?'Year 9 often brings a relationship from the past back, or closes one chapter before the next begins. The marriage year is more likely in the Year 1 or Year 2 coming next.': pyNum===1?'Year 1 brings new beginnings — a new relationship or a formal proposal is very possible this year.': 'Year '+pyNum+' is not the peak marriage year, but a Year 2 (in '+(2-pyNum>0?(yr+(2-pyNum)):(yr+(12-pyNum)))+') or Year 6 will be stronger.'), '', 'Your Nakshatra is '+k2.nakshatra+'. '+nd.at+'. Anuradha, Rohini, Swati, and Uttara Phalguni birth star placements tend to marry when their native environment feels emotionally safe. Your Moon in '+k2.moonSign+' means you need to feel '+md.lp+' before you can fully commit.', '', 'Short answer: '+ (marriageDasha&&(pyNum===2||pyNum===6||pyNum===1)? 'This year and the next 2-3 years are genuinely well-timed. Both your Dasha and your Personal Year support commitment.': 'The strongest window based on your chart is likely '+Math.max(yr+1, dashaEnd-2)+' to '+dashaEnd+'. Use the time before then to build the foundation of what you want the relationship to be.') ].join('\n'); } if(type==='home'){ // 4th house (Cancer rules 4th naturally), Jupiter, Saturn, Mars var satFav=(satSign==='Libra'||satSign==='Capricorn'||satSign==='Aquarius'); var jupFav2=(jupSign==='Cancer'||jupSign==='Taurus'||jupSign==='Sagittarius'); var _li=SIGNS.indexOf(k2.lagnaSign);var lagna4th=((_li+3)%12); // 4th house sign index var fourthSign=SIGNS[lagna4th]||'Cancer'; return [ name+', here is what your chart says about buying or building a home.', '', 'In Vedic astrology, the 4th house is the house of property and home. For your '+k2.lagnaSign+' Ascendant, your 4th house is in '+fourthSign+'. The planet that rules this house is a key indicator for property.', '', 'Saturn — the planet of land, real estate, and durable things — is in '+satSign+'. '+ (satFav?'This is a strong position for Saturn, which typically supports acquiring property in a structured, planned way.': 'Saturn here works, but property decisions need to be made practically and without shortcuts.'), '', 'Jupiter, which expands and blesses, is in '+jupSign+'. Jupiter transiting your 4th or 11th house is one of the classic timing indicators for property purchase.', '', 'You are in your '+dasha+' Mahadasha until '+dashaEnd+'. '+ (dasha==='Jupiter'?'Jupiter Mahadasha is one of the strongest periods for property acquisition — expansion of material life is the theme.': dasha==='Venus'?'Venus Mahadasha often brings comforts, home improvements, and sometimes property — especially if Venus is well-placed in your chart.': dasha==='Saturn'?'Saturn Mahadasha is actually good for property if you approach it with patience and planning — Saturn rules land.': 'Your '+dasha+' period governs '+dd.n+'. Property is possible, but the strongest windows tend to be during Jupiter, Venus, or Saturn periods.'), '', 'Numerologically: your Mulank (birth number) is '+ml.num+'. '+ (ml.num===4||ml.num===8?'Number 4 and 8 people are strongly connected to property and material security — home ownership is a core life theme for you.': ml.num===6?'Number 6 is the number of home and family — this is deeply important to you and will happen.': 'Your Life Path '+lp.num+' suggests material accomplishment is part of your journey.'), '', 'Your current Personal Year is '+pyNum+' — '+pyDesc+'. '+ (pyNum===4?'Year 4 is the strongest year in the numerology cycle for property — foundations, structures, real things.': pyNum===8?'Year 8 is a year of material power and major financial decisions — property transactions are well-supported.': 'A Year 4 or Year 8 in your cycle (next: '+(4-pyNum>0?(yr+(4-pyNum)):(yr+(12-pyNum)))+') is when property becomes most actionable.'), '', 'Short answer: If you are planning to buy or build, the most supported timing based on your chart is '+ (dasha==='Jupiter'||dasha==='Saturn'||dasha==='Venus'? 'in the next 2-3 years while you are still in '+dasha+' Mahadasha.': 'when Jupiter or Saturn activates your 4th house by transit. Watch for '+dashaEnd+' onwards when your Dasha shifts.') ].join('\n'); } if(type==='getback'){ // 7th house, Venus, Moon, Rahu influence return [ name+', this is one of the most common and most painful questions. I will give you a straight answer based on your chart.', '', 'Your Moon is in '+k2.moonSign+'. '+k2.moonSign+' Moon people tend to '+md.lp+'. Once you love someone, you love deeply — which is why this question hurts as much as it does.', '', 'Venus in your chart is in '+venSign+'. '+ (venSign==='Scorpio'||venSign==='Aries'? 'Venus in '+venSign+' gives intense, all-or-nothing love — the highs are very high and the disconnections feel enormous. But this placement also makes reconciliation possible when the timing is right.': 'Your Venus suggests you give and receive love in a genuine and steady way.'), '', 'Rahu (the north node) is in '+rahuSign+'. Rahu in relationship houses creates intense attractions that feel fated — but Rahu connections often require both people to do real inner work before they can be stable.', '', 'You are in your '+dasha+' Mahadasha. '+ (dasha==='Moon'?'Moon Mahadasha intensifies emotional connections and past bonds — someone from your past reconnecting in this period is quite possible.': dasha==='Venus'?'Venus Mahadasha is the most favourable period for relationship reconciliation. If it is going to happen, it is most likely in this period.': dasha==='Rahu'?'Rahu Mahadasha brings past-life connections back into your life, often unexpectedly. A reconnection is possible but may feel intense or unstable at first.': 'Your '+dasha+' period is not the classic period for reconciliation. The more relevant question is: what would need to be different for it to work this time?'), '', 'Numerologically, your Personal Year '+pyNum+' is '+pyDesc+'. '+ (pyNum===9?'Year 9 is a year of endings and returns — past connections frequently reappear. This is one of the strongest years for reunions.': pyNum===2?'Year 2 is about partnership and patience — if there is a genuine foundation, this year supports rebuilding it.': 'The years most associated with returns from the past are Year 9 and Year 2. Your next one is in '+(pyNum<9?(yr+(9-pyNum)):(yr+(12-pyNum)))+'.'), '', 'The honest astrological answer: '+ (dasha==='Venus'||dasha==='Moon'||pyNum===9? 'your chart does support a reconnection — the energy is there. But astrology cannot override free will. The question is whether both of you are willing to address what broke it.': 'the current planetary period is not the strongest for reconciliation. This does not mean it cannot happen — it means it would require significantly more effort from both sides than a naturally supported period would.') ].join('\n'); } if(type==='rich'||type==='wealth'){ var satFav2=(satSign==='Capricorn'||satSign==='Libra'||satSign==='Aquarius'); return [ name+', wealth questions in astrology are answered by looking at three things: the 2nd house (money you earn), the 11th house (money from gains and networks), and the Dasha (which period you are in).', '', 'Your 2nd house — the house of accumulated wealth — is in '+SIGNS[(SIGNS.indexOf(k2.lagnaSign)+1)%12]+'. The planet that rules this sign is the key indicator of how your wealth builds.', '', 'Your current Dasha is '+dasha+' until '+dashaEnd+'. '+ (dasha==='Jupiter'?'Jupiter Mahadasha is the single most powerful period for wealth accumulation in Vedic astrology. If you are in Jupiter period, you are in a genuine wealth window — use it deliberately.': dasha==='Venus'?'Venus Mahadasha brings wealth through creativity, relationships, and the things you genuinely love doing. Income from unexpected or unconventional sources is common.': dasha==='Mercury'?'Mercury Mahadasha brings wealth through communication, business, and intelligence. This is a strong period for business and skill-based income.': dasha==='Saturn'?'Saturn Mahadasha builds wealth slowly but durably. The wealth that comes in a Saturn period tends to stay — unlike Jupiter which can come and go fast. Discipline and consistency are the key.': dasha==='Sun'?'Sun Mahadasha brings wealth through authority, government, or expertise. A leadership position or recognition-based income is the Saturn vehicle.': 'Your '+dasha+' period governs '+dd.n+'. Wealth in this period comes through '+dd.m+'.'), '', 'Jupiter is in '+jupSign+'. '+ (jupFav?'This is a strong position for Jupiter — the planet of abundance is comfortable here and supports wealth creation.': 'Jupiter here is functional. When Jupiter transits your 2nd, 5th, or 11th house, those years tend to be financially stronger — watch those transits.'), '', 'Numerologically: your Mulank is '+ml.num+'. '+ (ml.num===8?'Number 8 is the number most directly associated with wealth and material power. Financial success is literally written into your birth number — the timing is the question.': ml.num===4?'Number 4 people build wealth steadily and durably — not overnight, but solidly.': ml.num===1?'Number 1 people build wealth through leadership and independent action — working for yourself is usually more profitable than working for others.': ml.num===6?'Number 6 often accumulates wealth through family, property, and service-based work.': 'Your Mulank '+ml.num+' suggests wealth comes through your specific path number characteristics.'), '', 'Your Personal Year is '+pyNum+'. '+ (pyNum===8?'Year 8 is the strongest wealth year in the numerology cycle. Major financial moves in Year 8 tend to produce disproportionate results.': pyNum===1?'Year 1 is a year to start new income streams — what you launch now builds for the next 9 years.': pyNum===4?'Year 4 is about financial foundations. What you build now is meant to last.': 'A Year 8 is your peak wealth-building year. Yours is in '+(8-pyNum>0?(yr+(8-pyNum)):(yr+(12-pyNum)))+'.'), '', 'Short answer: '+ (dasha==='Jupiter'||dasha==='Venus'||dasha==='Mercury'? 'You are in one of the stronger Dashas for wealth. The key is to be deliberate about income strategy during this period — the window is open.': 'Real wealth accumulation for you picks up significantly when you enter Jupiter, Venus, or Mercury Mahadasha. In the current '+dasha+' period, build the skills and systems that will generate wealth when that window opens.') ].join('\n'); } if(type==='job_or_biz'){ var sunFav=(k2.sunSign==='Aries'||k2.sunSign==='Leo'||k2.sunSign==='Scorpio'); return [ name+', this is really about the 10th house — the house of career, recognition, and what you are known for.', '', 'For your '+k2.lagnaSign+' Ascendant, your 10th house is in '+SIGNS[(SIGNS.indexOf(k2.lagnaSign)+9)%12]+'. The planet that rules this sign tells you a lot about where your career strength lies.', '', 'Your Sun is in '+k2.sunSign+'. Your Sun tells us your core professional strength: '+sd.cs+'. This is what you do better than most people — lean into it.', '', 'Job vs business: '+ (k2.sunSign==='Aries'||k2.sunSign==='Leo'||k2.sunSign==='Sagittarius'||k2.sunSign==='Capricorn'? 'Your '+k2.sunSign+' Sun strongly suggests you are built for leadership and independence. Business or entrepreneurship tends to suit this placement more than a conventional employment path.': k2.sunSign==='Gemini'||k2.sunSign==='Virgo'||k2.sunSign==='Libra'||k2.sunSign==='Aquarius'? 'Your '+k2.sunSign+' Sun is versatile — you can excel in either path. The key is which environment lets you use your communication and thinking skills most effectively.': 'Your '+k2.sunSign+' Sun is suited to steady roles where depth of expertise is valued. High-quality employment in your field may outperform entrepreneurship until you have built significant domain expertise.'), '', 'Current Dasha: '+dasha+' until '+dashaEnd+'. '+ (dasha==='Sun'?'Sun Mahadasha is the peak period for recognition and authority in your career. If you are going to make your biggest career move, this period supports it.': dasha==='Saturn'?'Saturn Mahadasha rewards consistent, disciplined work. This is the period to do the hard, unglamorous work that builds a career foundation that cannot be taken away.': dasha==='Jupiter'?'Jupiter Mahadasha brings opportunities, growth, and expansion in career. New paths open that were not available before.': dasha==='Mercury'?'Mercury Mahadasha is excellent for communication-based careers, business, and intellectual work.': dasha==='Mars'?'Mars Mahadasha brings drive and the ability to take bold career action. Business ventures started in Mars Mahadasha tend to have strong momentum.': 'Your '+dasha+' period governs '+dd.n+'. Career progress in this period comes through '+dd.m+'.'), '', 'Numerologically: your Mulank is '+ml.num+'. '+ (ml.num===1||ml.num===8?'Mulank 1 and 8 people are typically better in self-employment or leadership than in subordinate roles.': ml.num===2||ml.num===6?'Mulank 2 and 6 people often excel in collaborative or service-based professions.': ml.num===3||ml.num===5?'Mulank 3 and 5 people do best with variety, creativity, and communication — rigid corporate structures often feel limiting.': ml.num===4||ml.num===7?'Mulank 4 and 7 people build expertise deeply and tend to succeed in specialist or technical roles.': 'Your Mulank '+ml.num+' points toward a specific career expression.'), '', 'Short answer: Your chart points toward '+ (sunFav||dasha==='Mars'||dasha==='Sun'? 'entrepreneurship or independent professional work. The planets that dominate your chart favour action, authority, and independence over employment.': 'building genuine expertise in your field first — whether in employment or business. The Dasha period you are in rewards depth and consistency.') ].join('\n'); } if(type==='promotion'){ return [ name+', your chart has some clear things to say about recognition and career advancement.', '', 'The 10th house is the house of career and public recognition. For your '+k2.lagnaSign+' Ascendant, your 10th house falls in '+SIGNS[(SIGNS.indexOf(k2.lagnaSign)+9)%12]+'.', '', 'You are in your '+dasha+' Mahadasha until '+dashaEnd+'. '+ (dasha==='Sun'?'Sun Mahadasha is the single strongest period for career recognition, promotions, and authority. If you are working hard and visible, a promotion in this period is very likely.': dasha==='Jupiter'?'Jupiter Mahadasha brings expansion including career advancement. Opportunities come through mentors, reputation, and wisdom-sharing.': dasha==='Saturn'?'Saturn Mahadasha gives promotions to those who have done sustained, quality work — not to those who have merely been present. If your work is genuinely strong, Saturn will make it visible.': dasha==='Mars'?'Mars Mahadasha supports promotion if you are proactive, visible, and take initiative rather than waiting to be noticed.': dasha==='Mercury'?'Mercury Mahadasha rewards those in intellectual, communication, or business-oriented roles. Promotions through skills demonstration.': 'Your '+dasha+' period: recognition in this period comes through '+dd.m+'.'), '', 'Jupiter, which blesses what it sees, is in '+jupSign+'. When Jupiter transits your natal Sun, your 10th house, or your Ascendant, those years are typically the strongest for career recognition.', '', 'Saturn currently in '+satSign+'. Saturn in the 10th house or aspecting the 10th house makes the career period demanding but productive — recognition comes, but only after genuine contribution.', '', 'Numerologically: you are in Personal Year '+pyNum+'. '+ (pyNum===8?'Year 8 is the peak year for professional authority and promotion. If you are asking about promotion in a Year 8, the timing is as good as it gets.': pyNum===1?'Year 1 brings new beginnings — a new role or new responsibilities are very possible.': pyNum===3?'Year 3 is social and visibility-oriented — being seen and heard this year opens doors.': pyNum===6?'Year 6 is about responsibility — which often means being given more of it, formally.': 'Your strongest promotion years are Year 1, Year 8, and Year 3. Next one: '+(pyNum<8?(yr+(8-pyNum)):(yr+(12-pyNum)))+'.'), '', 'Practical guidance: in Vedic astrology, promotion often comes 3-6 months after Saturn and Jupiter both positively aspect your 10th house. The key action on your side is visibility — Saturn rewards those who are seen doing real work, not those who wait to be discovered.' ].join('\n'); } if(type==='children'){ // 5th house (children), Jupiter, Moon var _li2=SIGNS.indexOf(k2.lagnaSign);var fifthSign=SIGNS[(_li2+4)%12]||SIGNS[(SIGNS.indexOf(k2.lagnaSign)+4)%12]; return [ name+', children are seen through the 5th house in Vedic astrology.', '', 'For your '+k2.lagnaSign+' Ascendant, your 5th house is in '+fifthSign+'. The planet that rules '+fifthSign+' is the key planet for children in your chart.', '', 'Jupiter is the natural planet of children and family expansion. Jupiter is in '+jupSign+'. '+ (jupFav?'Jupiter is strong here — this supports having children and family growth.': 'Jupiter here is functional. The key timing trigger for children is typically when Jupiter transits your 5th house.'), '', 'Your Moon is in '+k2.moonSign+'. The Moon represents fertility, the mother, and nurturing in Vedic astrology. Your Moon placement shows '+md.lp+' — this is how you will naturally approach parenthood.', '', 'You are in '+dasha+' Mahadasha until '+dashaEnd+'. '+ (dasha==='Jupiter'?'Jupiter Mahadasha is the strongest period for having children. Many people have children in Jupiter periods — the planet of expansion blesses the family dimension strongly.': dasha==='Moon'?'Moon Mahadasha supports family creation, emotional bonds, and home life. Children born in Moon period are often deeply emotionally connected to their parents.': dasha==='Venus'?'Venus Mahadasha is positive for family creation, especially for women. It supports the nurturing and comfort dimension.': dasha==='Saturn'?'Saturn Mahadasha can delay but does not deny. Children in Saturn periods are often serious, capable, and become the person you rely on most.': 'Your '+dasha+' period governs '+dd.n+'. Children are possible in any Dasha, but Jupiter and Moon periods are the strongest indicators.'), '', 'Numerologically: your Mulank is '+ml.num+'. '+ (ml.num===6?'Number 6 is the number of home and family — children are one of the most important themes of your life path.': ml.num===2?'Number 2 is deeply family-oriented. Children bring you genuine fulfilment.': ml.num===4?'Number 4 is the builder — you will be a steady, providing parent.': 'Your Mulank '+ml.num+' connects to family in its own way.'), '', 'Your current Personal Year is '+pyNum+'. '+ (pyNum===6?'Year 6 is the strongest year in the numerology cycle for family matters, including having children.': pyNum===3?'Year 3 is creative and expansive — family growth is supported.': 'A Year 6 is the peak for family. Yours is in '+(6-pyNum>0?(yr+(6-pyNum)):(yr+(12-pyNum)))+'.'), '', 'Short answer: '+ (dasha==='Jupiter'||dasha==='Moon'||pyNum===6? 'Both your Dasha and your numerology support family expansion right now. This is a genuinely supported period.': 'The strongest child-timing indicators in your chart are when Jupiter transits your 5th house. In your current '+dasha+' Mahadasha, it is possible but may take a little longer than you expect.') ].join('\n'); } if(type==='sthan'||type==='move'){ // 4th house (home), 9th house (long distance), 12th house (foreign lands), Rahu var _li3=SIGNS.indexOf(k2.lagnaSign);var ninthSign=SIGNS[(_li3+8)%12]; var twelfthSign=SIGNS[(_li3+11)%12]; return [ name+', questions about moving — Sthan Parivartan — are answered by looking at the 4th, 9th, and 12th houses in your chart.', '', 'The 4th house (home and stability), the 9th house (long-distance travel and higher fortune), and the 12th house (foreign lands and settlement abroad) are the three key houses.', '', 'For your '+k2.lagnaSign+' Ascendant:', '— 4th house is '+SIGNS[(_li3+3)%12]+' (your home base — stability vs restlessness here)', '— 9th house is '+ninthSign+' (long journeys and change of fortune)', '— 12th house is '+twelfthSign+' (settlement away from birthplace, foreign lands)', '', 'Rahu is currently in '+rahuSign+'. Rahu is the planet most associated with movement, foreign lands, and unconventional paths. When Rahu is in the 12th house from your Lagna, or aspecting your 9th house lord, movement abroad or to a distant place is strongly indicated.', '', 'You are in '+dasha+' Mahadasha until '+dashaEnd+'. '+ (dasha==='Rahu'?'Rahu Mahadasha is the single strongest period for international movement, settlement abroad, and major place changes. If you are going to relocate significantly, Rahu periods are when it most commonly happens.': dasha==='Moon'?'Moon Mahadasha can bring movement, especially back toward roots — or toward a place that feels emotionally like home.': dasha==='Saturn'?'Saturn Mahadasha sometimes brings a change of city or workplace due to career demands. It tends to be a practical move rather than a chosen one.': dasha==='Mercury'?'Mercury Mahadasha supports movement and change — especially for work or education.': 'Your '+dasha+' period. Movement is possible in any Dasha when the 9th or 12th house is activated. The question is whether the push comes from inside you or from circumstances.'), '', 'Numerologically: your Personal Year '+pyNum+' is '+pyDesc+'. '+ (pyNum===5?'Year 5 is the change year in numerology — more major life changes including place changes happen in Year 5 than in any other. If you are asking about a move in a Year 5, the answer is: this is the year for it.': pyNum===9?'Year 9 is a year of endings — sometimes that means leaving a place behind. A move at the end of Year 9 or start of Year 1 is a classic pattern.': pyNum===1?'Year 1 is the beginning — starting somewhere new in Year 1 is well-supported.': 'Year 5 is the move year in numerology. Yours is in '+(5-pyNum>0?(yr+(5-pyNum)):(yr+(12-pyNum)))+'.'), '', 'Your Nakshatra is '+k2.nakshatra+'. Some Nakshatras are associated with greater mobility — Mrigashira, Ardra, Punarvasu, Swati, and Shatabhisha people tend to move more than others. '+ (k2.nakshatra==='Mrigashira'||k2.nakshatra==='Ardra'||k2.nakshatra==='Punarvasu'||k2.nakshatra==='Swati'||k2.nakshatra==='Shatabhisha'? k2.nakshatra+' is one of the mobile Nakshatras — movement is written into your nature. Staying in one place for too long creates restlessness for you.': k2.nakshatra+' is not typically a restless Nakshatra — your moves tend to be purposeful rather than frequent.'), '', 'Short answer: '+ (dasha==='Rahu'||pyNum===5? 'Your chart strongly supports a place change right now. Both your Dasha and numerology point toward movement. If you have been considering it, the current period is the most supported window.': 'A major move is most likely in Rahu Mahadasha or a Year 5 numerology cycle. Your next Year 5 is in '+(5-pyNum>0?(yr+(5-pyNum)):(yr+(12-pyNum)))+'. If the move question is urgent, it can still happen now — it just may require more active choice rather than circumstance pulling you.') ].join('\n'); } // ── Generic fallback — still astrology-driven, no tarot ───────────── var curYrPlanet=['Sun','Moon','Mars','Mercury','Jupiter','Venus','Saturn'][yr%7]; return [ name+', I looked at your chart for what you asked.', '', 'Your '+k2.nakshatra+' Nakshatra quality — '+nd.at+' — is the lens through which you experience this question. The way you process what is happening is shaped by this quality, and it is worth trusting it.', '', 'You are in your '+dasha+' Mahadasha until '+dashaEnd+'. '+dd.n+'. The questions you are asking right now are the questions this period is specifically designed to bring to you. That is not a coincidence.', '', 'Your '+k2.sunSign+' Sun — built to '+sd.cs+' — and your '+k2.moonSign+' Moon — which needs to '+md.lp+' — are both active in how you are processing this question. Your Sun wants one thing, your Moon wants another. The resolution of that tension is usually the answer.', '', 'Numerologically: you are in Personal Year '+pyNum+' — '+pyDesc+'. The questions that feel most urgent in Year '+pyNum+' are the questions this year was designed to make you face. The answer is usually simpler than the anxiety around it suggests.', '', 'Your Mulank is '+ml.num+'. That number carries the quality of '+ ({1:'independence and leadership',2:'partnership and patience',3:'creativity and expression',4:'structure and discipline',5:'change and adaptability',6:'responsibility and care',7:'depth and reflection',8:'power and results',9:'completion and wisdom',11:'intuition and insight',22:'large-scale building',33:'service and teaching'}[ml.num]||'purposeful movement')+ '. Bring that quality directly to the question you are asking.', '', 'If you want a more specific answer, ask me directly: "When will I get married?" or "Should I do business or job?" or "Will I move to another city?" — I can go much deeper on specific questions.' ].join('\n'); } // Question type detector — keyword based, catches most real questions function detectQ(ql){ if(/marr|shaadi|shadi|wedding|wife|husband|partner|engagement|rishta|vivah/.test(ql))return 'marriage'; if(/home|house|property|ghar|flat|apartment|plot|land|buy.*house|build.*house/.test(ql))return 'home'; if(/get.*back|back.*together|\bex\b|reunion|reconcil|old.*flame|rekindl/.test(ql))return 'getback'; if(/rich|wealth|crorepati|millionaire|money|financially.*free|financially free/.test(ql))return 'rich'; if(/job.*or.*business|business.*or.*job|job.*business|own.*business|start.*business|entrepreneur/.test(ql))return 'job_or_biz'; if(/excel.*job|excel.*career|job.*excel|excel.*business|success.*career|career.*success|promot|appraisal|raise|increment|salary|hike/.test(ql))return 'promotion'; if(/job|career|business|work|profession|income/.test(ql))return 'job_or_biz'; if(/kid|child|baby|son|daughter|bacha|pregnant|pregnanc|family|santaan/.test(ql))return 'children'; if(/move|shift|relocat|city|place|foreign|abroad|migration|sthan|parivartan|overseas/.test(ql))return 'sthan'; return 'generic'; } // ════════════════════════════════════════════════ // ADMIN ACCESS + TRACKING // ════════════════════════════════════════════════ function checkAdminAccess(){ var hash=window.location.hash||''; if(hash.indexOf('#admin-')===0){ var pwd=hash.replace('#admin-',''); if(pwd){showAdmin();} } } function trackDailyVisit(){ try{ var today=new Date().toISOString().slice(0,10); var visits=JSON.parse(localStorage.getItem('nk_visits')||'[]'); // Only record once per day if(!visits.length||visits[visits.length-1].date!==today){ visits.push({date:today,plan:S.plan||'free'}); if(visits.length>365)visits=visits.slice(-365); localStorage.setItem('nk_visits',JSON.stringify(visits)); } trackFunnel('daily_visit'); }catch(e){} } function trackAdSource(){ try{ var qs=window.location.search||''; if(!qs)return; var params={}; qs.replace('?','').split('&').forEach(function(p){ var kv=p.split('='); if(kv[0])params[decodeURIComponent(kv[0])]=decodeURIComponent(kv[1]||''); }); var campaign=params.utm_campaign||''; if(src2!=='direct'||campaign){ var sources=JSON.parse(localStorage.getItem('nk_sources')||'[]'); sources.push({ ts:new Date().toISOString(), source:src2, campaign:campaign, medium:params.utm_medium||'', content:params.utm_content||'' }); if(sources.length>500)sources=sources.slice(-500); localStorage.setItem('nk_sources',JSON.stringify(sources)); } }catch(e){} } // ═══════════════════════════════════════════════════ // FIREBASE AUTH + FIRESTORE — cross-device plan sync // ═══════════════════════════════════════════════════ var OTP_CONFIRM = null; // Stores confirmationResult from Firebase var OTP_PHONE = ''; // Phone number being verified var OTP_AFTER = null; // Callback to run after successful auth // ── Show OTP overlay ────────────────────────────── function showOTPOverlay(afterFn) { OTP_AFTER = afterFn || null; var overlay = document.getElementById('otp-overlay'); if (!overlay) { if (afterFn) afterFn(); return; } // Pre-fill phone from onboarding if available var ph = (S.user.phone || '').replace(/\D/g, '').replace(/^91/, '').slice(-10); var inp = document.getElementById('otp-phone-input'); if (inp && ph.length === 10) inp.value = ph; overlay.style.display = 'flex'; // Reset to step 1 document.getElementById('otp-step1').style.display = 'block'; document.getElementById('otp-step2').style.display = 'none'; document.getElementById('otp-send-err').textContent = ''; document.getElementById('otp-verify-err').textContent = ''; // Init reCAPTCHA (invisible) if (FB_READY && !window._rcapInited) { try { window._rcap = new firebase.auth.RecaptchaVerifier('otp-recaptcha', { size: 'invisible', callback: function() {} }); window._rcapInited = true; } catch(e) {} } } function hideOTPOverlay() { var overlay = document.getElementById('otp-overlay'); if (overlay) overlay.style.display = 'none'; } // ── Send OTP ────────────────────────────────────── function otpSendCode() { var rawPhone = (document.getElementById('otp-phone-input').value || '').replace(/\D/g, ''); if (rawPhone.length < 10) { document.getElementById('otp-send-err').textContent = 'Please enter a valid 10-digit mobile number'; return; } OTP_PHONE = '+91' + rawPhone.slice(-10); var btn = document.getElementById('otp-send-btn'); btn.textContent = 'Sending…'; btn.disabled = true; document.getElementById('otp-send-err').textContent = ''; if (!FB_READY) { // Firebase not configured — skip OTP, proceed directly hideOTPOverlay(); if (OTP_AFTER) OTP_AFTER(); return; } firebase.auth().signInWithPhoneNumber(OTP_PHONE, window._rcap || new firebase.auth.RecaptchaVerifier('otp-recaptcha', {size:'invisible'})) .then(function(confirmationResult) { OTP_CONFIRM = confirmationResult; btn.textContent = 'Send OTP →'; btn.disabled = false; document.getElementById('otp-step1').style.display = 'none'; document.getElementById('otp-step2').style.display = 'block'; document.getElementById('otp-sent-to').textContent = 'Sent to ' + OTP_PHONE; }) .catch(function(err) { btn.textContent = 'Send OTP →'; btn.disabled = false; document.getElementById('otp-send-err').textContent = 'Could not send OTP. Try again in a moment.'; console.error('OTP send error:', err); }); } function otpBack() { document.getElementById('otp-step1').style.display = 'block'; document.getElementById('otp-step2').style.display = 'none'; } // ── Verify OTP ──────────────────────────────────── function otpVerify() { var code = (document.getElementById('otp-code-input').value || '').replace(/\D/g, ''); if (code.length < 6) { document.getElementById('otp-verify-err').textContent = 'Please enter the 6-digit code'; return; } var btn = document.getElementById('otp-verify-btn'); btn.textContent = 'Verifying…'; btn.disabled = true; document.getElementById('otp-verify-err').textContent = ''; if (!OTP_CONFIRM) { // No confirmation object — skip verification hideOTPOverlay(); if (OTP_AFTER) OTP_AFTER(); return; } OTP_CONFIRM.confirm(code) .then(function(result) { btn.textContent = 'Verify & Open My Chart →'; btn.disabled = false; hideOTPOverlay(); S.user.uid = result.user.uid; S.user.phone = OTP_PHONE; // Load any existing plan from Firestore for this user fbLoadUser(result.user.uid, function() { if (OTP_AFTER) OTP_AFTER(); }); }) .catch(function(err) { btn.textContent = 'Verify & Open My Chart →'; btn.disabled = false; document.getElementById('otp-verify-err').textContent = 'Incorrect code. Please try again.'; }); } // ── Firestore: load user data ───────────────────── function fbLoadUser(uid, cb) { if (!FB_READY || !uid) { if (cb) cb(); return; } FB_DB.collection('users').doc(uid).get() .then(function(doc) { if (doc.exists) { var data = doc.data(); // Only restore plan if it is a valid paid plan if (data.plan && data.plan !== 'free' && PLAN_PRICES[data.plan] > 0) { S.plan = data.plan; S.paid = data.paid || PLAN_PRICES[data.plan] || 0; } // Restore user profile if missing if (!S.user.name && data.name) S.user.name = data.name; if (!S.user.dob && data.dob) S.user.dob = data.dob; if (!S.user.tob && data.tob) S.user.tob = data.tob; if (!S.user.city && data.city) S.user.city = data.city; sv(); // sync to localStorage as backup } if (cb) cb(); }) .catch(function() { if (cb) cb(); }); } // ── Firestore: save user data ───────────────────── function fbSaveUser() { if (!FB_READY) return; var uid = S.user.uid || (FB_AUTH && FB_AUTH.currentUser && FB_AUTH.currentUser.uid); if (!uid) return; var data = { name: S.user.name || '', email: S.user.email || '', dob: S.user.dob || '', tob: S.user.tob || '', city: S.user.city || '', phone: OTP_PHONE || S.user.phone || '', plan: S.plan || 'free', paid: S.paid || 0, updatedAt: firebase.firestore.FieldValue.serverTimestamp() }; FB_DB.collection('users').doc(uid).set(data, {merge: true}) .catch(function(e) { console.warn('Firestore save failed:', e); }); } // ── Hook into activatePlan to save to Firestore ─── // Override the existing sv() to also push to Firestore var _sv_orig = sv; sv = function() { _sv_orig(); fbSaveUser(); }; // ── Check if user is already signed in (returning user) ────── function fbCheckExistingAuth(cb) { if (!FB_READY) { if (cb) cb(false); return; } FB_AUTH.onAuthStateChanged(function(user) { if (user) { S.user.uid = user.uid; fbLoadUser(user.uid, function() { if (cb) cb(true); // Already authenticated }); } else { if (cb) cb(false); // Not signed in } }); } function startJourney(){ var name=document.getElementById('f-name').value.trim(); var dob=document.getElementById('f-dob').value; var tob=document.getElementById('f-tob').value; var city=document.getElementById('f-city').value.trim(); var email=document.getElementById('f-email').value.trim(); var dial=document.getElementById('f-dial').value; var phone=document.getElementById('f-phone').value.trim(); ['name','dob','tob','city','email','phone'].forEach(function(x){setErr(x,'');}); var ok=true; if(!name){setErr('name','Please enter your name');ok=false;} if(!dob){setErr('dob','Please enter your date of birth');ok=false;} if(!tob){setErr('tob','Please enter your birth time');ok=false;} if(!city){setErr('city','Please enter your birth city');ok=false;} if(!email||!email.includes('@')){setErr('email','Please enter a valid email');ok=false;} if(phone.replace(/\D/g,'').length<6){setErr('phone','Please enter a valid phone number');ok=false;} if(!ok)return; var btn=document.getElementById('btn-start'); btn.disabled=true;btn.innerHTML='
Consulting the cosmos…'; S.user={name:name,dob:dob,tob:tob,city:city,email:email,phone:dial+' '+phone}; sv(); captureLeadData(S.user); setTimeout(function(){ try{S._k=calcKundali(S.user.dob,tob,city);}catch(e){S._k=calcKundali(S.user.dob,'12:00','');} btn.disabled=false; btn.innerHTML='Reveal my chart'; goTo('birthsky'); },900); } // ── Modified startJourney: OTP before chart ─────── // Override the existing startJourney to add OTP step var _startJourney_orig = startJourney; startJourney = function() { // Run the original validation var name = document.getElementById('f-name').value.trim(); var dob = document.getElementById('f-dob').value; var tob = document.getElementById('f-tob').value; var city = document.getElementById('f-city').value.trim(); var email = document.getElementById('f-email').value.trim(); var dial = document.getElementById('f-dial').value; var phone = document.getElementById('f-phone').value.trim(); ['name','dob','tob','city','email','phone'].forEach(function(x){ setErr(x,''); }); var ok = true; if (!name) { setErr('name', t('err_required')); ok = false; } if (!dob) { setErr('dob', t('err_required')); ok = false; } if (!tob) { setErr('tob', t('err_required')); ok = false; } if (!city) { setErr('city', t('err_required')); ok = false; } if (!email || !email.includes('@')) { setErr('email', t('err_email')); ok = false; } if (phone.replace(/\D/g,'').length < 6) { setErr('phone', t('err_phone')); ok = false; } if (!ok) return; // Save user data S.user = { name:name, dob:dob, tob:tob, city:city, email:email, phone:dial+' '+phone }; sv(); if (FB_READY) { // Show OTP verification before showing chart showOTPOverlay(function() { // After OTP verified — continue to birthsky var btn = document.getElementById('btn-start'); if (btn) { btn.disabled = true; btn.innerHTML = '
Opening your chart…'; } setTimeout(function() { if (btn) { btn.disabled = false; btn.innerHTML = ''+t('btn_start')+''; } go('birthsky'); }, 800); }); } else { // No Firebase — original flow _startJourney_orig(); } }; // ── On page load: check if user is already signed in ───────── function fbInit() { fbCheckExistingAuth(function(signedIn) { if (signedIn && S.user.name && S.plan) { // Returning paid user on a new device — restore their session checkReturn(); if (S.screen === 'home' || S.screen === 'success') { go('home'); } } }); } // ── Returning user: show sign-in OTP to restore plan ────────── function showReturnSignIn() { showOTPOverlay(function() { // After sign-in, if they have a plan, go to home if (S.plan) { go('home'); } else { go('birthsky'); } }); } // ════ INIT ════ checkReturn(); fbInit(); // Always ensure a screen is visible on load (function(){ var saved=false; try{var d=JSON.parse(localStorage.getItem(STORE)||'null');if(d&&d.user&&d.user.name)saved=true;}catch(e){} if(saved&&S.screen&&S.screen!=='onboarding'){ goTo(S.screen); }else{ goTo('onboarding'); } trackDailyVisit(); trackAdSource(); checkAdminAccess(); })();