${t.symbolism}`).style("left",e.pageX+10+"px").style("top",e.pageY-28+"px")}).on("mouseout",function(){d3.selectAll(".tooltip").remove()})}function initializeSymbolExercise(){const e=document.getElementById("mandala-drop-zone"),t=document.getElementById("analysis-result");let n=[];function a(t,a,i){const r=document.createElement("div");r.className="placed-symbol",r.style.position="absolute",r.style.left=a-15+"px",r.style.top=i-15+"px",r.style.width="30px",r.style.height="30px",r.style.display="flex",r.style.alignItems="center",r.style.justifyContent="center",r.style.background="var(--accent)",r.style.color="white",r.style.borderRadius="50%",r.style.fontSize="18px",r.style.cursor="pointer",r.style.zIndex="10";r.textContent={cross:"✝",circle:"○",triangle:"△",square:"□",shadow:"●",light:"☉",feminine:"☽",masculine:"☉"}[t]||"?",r.addEventListener("click",()=>{e.removeChild(r),n=n.filter(e=>e.element!==r),o()}),e.appendChild(r),n.push({type:t,x:a,y:i,element:r}),o()}function o(){if(0===n.length)return void(t.innerHTML="
Create a mandala to see psychological interpretation...
");const e={};n.forEach(t=>{e[t.type]=(e[t.type]||0)+1});let a="✅ Light/Shadow Balance: Good integration of opposites.
":i&&!o&&(a+="⚠️ Missing Shadow: Consider integrating darker elements.
"),r&&l&&(a+="✅ Gender Balance: Anima/Animus integration present.
");const s=n.length;3===s?a+="🔺 Trinity Pattern: Spiritual perfection, but missing earthly completion.
":4===s?a+="◼️ Quaternity Pattern: Psychological wholeness and completion.
":s%4==0&&(a+="◼️ Quaternary Multiple: Strong foundation for psychological integration.
"),t.innerHTML=a}document.querySelectorAll(".symbol-item").forEach(e=>{e.addEventListener("dragstart",e=>{e.dataTransfer.setData("text/plain",e.target.dataset.symbol)})}),e.addEventListener("dragover",t=>{t.preventDefault(),e.style.borderColor="var(--accent)"}),e.addEventListener("dragleave",t=>{e.style.borderColor="var(--border-default)"}),e.addEventListener("drop",t=>{t.preventDefault(),e.style.borderColor="var(--border-default)";const n=t.dataTransfer.getData("text/plain"),o=e.getBoundingClientRect();a(n,t.clientX-o.left,t.clientY-o.top)}),document.getElementById("clear-mandala").addEventListener("click",()=>{n.forEach(t=>{e.removeChild(t.element)}),n=[],o()}),document.getElementById("load-example").addEventListener("click",()=>{document.getElementById("clear-mandala").click(),setTimeout(()=>{a("light",150,50),a("shadow",150,250),a("masculine",250,150),a("feminine",50,150),a("cross",150,150)},100)})}document.addEventListener("DOMContentLoaded",()=>{initializeTrinityMandala(),initializeSymbolTimeline(),initializeSymbolExercise()})