<!DOCTYPE html><html lang="it"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>MANGIA & VINCI</title><link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&display=swap" rel="stylesheet"><script src="js/gsap.min.js"></script><script src="js/pixi.min.js"></script><script src="js/canvas-confetti.min.js"></script><script src="js/qrious.min.js"></script><style>body,html{height:100%;margin:0}#logo-container{position:fixed;top:5%;left:50%;transform:translateX(-50%);display:flex;justify-content:center;align-items:center;z-index:9999}#logo-container img{display:block;border-radius:50%;box-shadow:0 0 10px rgba(0,0,0,.3)}</style><style>*{box-sizing:border-box;margin:0;padding:0}body{font-family:Arial,sans-serif;text-align:center;background-color:#f5f5f5}.scratch-container{position:relative;display:inline-block;margin-top:50px;width:300px;height:200px;border-radius:10px;box-shadow:0 4px 10px rgba(0,0,0,.3);overflow:hidden}.game-area{width:100%;height:100%;position:absolute;top:0;left:0;background:url(img/compo/sc_ga_002.jpg) no-repeat center center;background-size:cover;border-radius:10px}.grid-container{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;pointer-events:none}table{width:100%;height:100%;border-collapse:collapse}td{border:0 solid #000;text-align:center;position:relative}td img{width:100%;height:100%;object-fit:fill}canvas{position:absolute;top:0;left:0;width:100%;height:100%;border-radius:10px}#qrContainer{display:block;pointer-events:none;opacity:0;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:200px;height:200px}.balloon{position:absolute;display:inline-block;user-select:none;pointer-events:none;text-shadow:2px 2px 5px rgba(0,0,0,.2)}.star{position:absolute;display:inline-block;user-select:none;pointer-events:none;text-shadow:2px 2px 5px rgba(255,215,0,.8)}</style><style>.burger-menu{position:fixed;top:10px;left:10px;z-index:1000}.menu-icon{font-size:18px;cursor:pointer;background:#333;color:#fff;padding:10px;border-radius:5px}.menu-content{display:none;position:fixed;top:50px;left:10px;background:rgba(255,255,255,.8);color:#000;padding:15px;border-radius:8px;width:200px;background-color:green;opacity:1;color:#000;font-size:12px;font-family:Poppins,sans-serif;padding:15px;border-radius:10px;font-family:Poppins,sans-serif;font-weight:400}.menu-content ul{list-style:none;padding:0}.menu-content li{padding:10px;cursor:pointer;transition:background .3s}.menu-content li:hover{background:rgba(255,255,255,.2)}.has-submenu ul{display:none;background:rgba(255,255,255,.1);margin-top:5px;padding:10px}.has-submenu:hover ul{display:block}input{width:50px;margin:5px 0}button{padding:5px;background:#fc0;border:none;cursor:pointer}</style><style>#posiziona-bottoni{z-index:99;position:absolute;top:10px;left:10px;display:none}#confirm-button,#drag-button{width:40px;height:40px;border:none;border-radius:50%;cursor:pointer;margin-right:5px;font-weight:700;font-size:18px}#drag-button{background-color:red}#confirm-button{background-color:green}</style><style>#resize-handle{position:absolute;bottom:5px;right:5px;width:20px;height:20px;background:rgba(0,0,0,.5);color:#fff;display:flex;align-items:center;justify-content:center;cursor:nwse-resize;border-radius:50%;font-size:16px;user-select:none;z-index:1000}</style><style>#footer{position:fixed;bottom:0;left:0;width:100%;height:50px;background-color:#333;color:#fff;display:flex;justify-content:center;align-items:center;font-size:14px;font-family:Poppins,sans-serif;z-index:1000}</style></head><body><div class="burger-menu"><div id="menu-burger" class="menu-icon" onclick="toggleMenu()">☰</div><nav class="menu-content"><ul><li><a href="#">Home</a></li><li class="has-submenu"><a href="#">Test ▼</a><ul class="submenu"><li onclick="rigeneraScratch()">Rigenera Scratch</li><li onclick="attivaEffettoVittoria()">Effetto Vittoria</li><li onclick="attivaEffettoFuochi()">Fuochi d’Artificio</li><li onclick="attivaEffettoPalloncini()">Palloncini</li><li onclick="attivaEffettoStelle()">Stelle Scintillanti</li><li onclick="attivaModalitaPosizionamento()">Posiziona</li><li><label>Numero icone vincenti:</label> <input type="number" id="numVincite" min="0" max="4" value="2"> <button onclick="rigeneraConVincite()">Applica</button></li></ul></li></ul></nav></div><div id="logo-container"></div><div class="scratch-container"><div id="posiziona-bottoni"><button id="drag-button">🔴</button> <button id="confirm-button">🟢</button></div><div id="resize-handle">↔️</div><div class="game-area"></div><div class="grid-container"><table id="gameTable"></table></div><canvas id="scratchCanvas"></canvas><div id="qrContainer" style="width:200px;height:200px"></div></div><script>function initCanvas(){ctx.fillStyle="#c0c0c0",ctx.fillRect(0,0,canvas.width,canvas.height);var t=ctx.createLinearGradient(0,0,canvas.width,canvas.height);t.addColorStop(0,"#bbbbbb"),t.addColorStop(1,"#999999"),ctx.fillStyle=t,ctx.fillRect(0,0,canvas.width,canvas.height)}function SizeGriglia(t="90%",e="60%"){var a=document.querySelector(".scratch-container"),n=document.querySelector("#gameTable");if(a){if(a.style.width=t,a.style.height=e,n){n.style.width="100%",n.style.height="100%";let e=n.querySelectorAll("td");e.forEach(t=>{t.style.width=100/e.length+"%",t.style.height=100/e.length+"%"})}t=document.getElementById("scratchCanvas");t&&(t.width=a.clientWidth,t.height=a.clientHeight,initCanvas())}else console.warn("Scratch container non trovato!")}function createGrid(e,a){var n=document.getElementById("gameTable");n.innerHTML="";for(let t=0;t<e;t++){var o=document.createElement("tr");for(let t=0;t<a;t++){var i=document.createElement("td");o.appendChild(i)}n.appendChild(o)}caricaIconeGiocoAAA(void 0,void 0,void 0,"white",!0,2,"large"),mescolaGrigliaGioco()}function verificaVincita(t){var e,a=document.querySelectorAll("#gameTable td");let n={};for(e in a.forEach(t=>{let e="";var a=t.querySelector("img");(e=a?a.alt||a.src:t.textContent.trim())&&(n[e]?n[e]++:n[e]=1)}),n)if(n[e]>=t)return!0;return!1}function mescolaGrigliaGioco(){var t=document.querySelectorAll("#gameTable td");let a=[];t.forEach(t=>{""!==t.textContent.trim()&&a.push(t.textContent.trim())}),a=a.sort(()=>Math.random()-.5),t.forEach((t,e)=>{e<a.length&&(t.textContent=a[e])})}function caricaIconeGiocoAAA(t="002",e="final_computer",h=0,a="black",n=!1,o=0,i="large"){let d=document.querySelectorAll("#gameTable td");var r=d.length;let s=1,g=("large"===i?s=1.5:"small"===i&&(s=.7),{r:0,g:0,b:0});"white"===a?g={r:255,g:255,b:255}:"object"==typeof a&&(g=a);var c={symbols:["★","❤","⚡","♠","♻","☀","❄","☎","✈","♟","☕","☂","⚽","🏆","🎖","🔔","🔮","🎲","🎵","🌀","🏵","🎗","🔆","🔅","♾","🕉","☯","☮","⚛"],emoji:["😀","😂","🥳","😎","👑","🐱","🐶","🦄","🍕","🎸","🚀","🎯","🤖","👻","🎃","💀","😇","🤡","🦊","🐼","🐵","🐉","🐸","🦀","🐍","🦜","🐧","🐢","🦆","🦋","🦩","🐺","🦍","🦄","🦝","🐲"],cards:["♠","♣","♥","♦","🃏","🂡","🂱","🂭","🂮","🃁","🃑","🃘","🃚","🃛","🃜","🃝","🂦","🂫","🂠"],arrows:["←","→","↑","↓","↔","↕","↩","↪","⤴","⤵","⏪","⏩","🔼","🔽","⬅","➡","⬆","⬇","↖","↗","↘","↙","🔄","🔃","⏫","⏬"],tools:["🔨","🔧","🛠","⚙","🖊","📌","🔎","📢","💡","💰","🗝","🔑","🔩","🔗","🔓","🔒","🛡","🛠","🚪","🔦","🔬","🔭","📡","🛢"],fruits:["🍎","🍌","🍉","🍇","🍒","🍑","🥭","🍍","🍊","🥝","🥥","🍐","🍓","🥕","🌽","🍅","🥒","🍈","🍏","🍑","🍋","🍠"],vehicles:["🚗","🚕","🚙","🚌","🚎","🏎","🚓","🚑","🚒","🚐","🚚","🚛","🚜","🚲","🛴","🏍","🚤","✈","🚀","🛸","🚠","🚡","🚂","🚆","🚇","🚊","🛶","🚢"],weather:["☀","⛅","🌦","🌧","⛈","🌩","❄","🌨","🌪","🌬","🌈","☔","🌙","🌑","🌕","🌓","🌟","🔥","💨","🌊"],food:["🍔","🍟","🌭","🍕","🥪","🍗","🥩","🍚","🍜","🍣","🍤","🥗","🍩","🍪","🎂","🍫","🍮","🍯","🥞","🥓","🧀","🥖","🍿","🥜","🍲","🍵","🍼","🥥","🥚"],sports:["⚽","🏀","🏈","⚾","🎾","🏐","🏉","🥏","🎱","🥊","⛳","🏓","🏸","🎿","🏂","🏋","🚴","🤺","🤾","🏹","⛷","🏄","🏊","🛹","🧗"],flags:["🇮🇹","🇫🇷","🇩🇪","🇺🇸","🇬🇧","🇪🇸","🇯🇵","🇨🇦","🇧🇷","🇦🇺","🇨🇳","🇮🇳","🇷🇺","🇲🇽","🇿🇦","🇰🇷","🇦🇷","🇪🇬","🇳🇬","🇵🇭","🇸🇦","🇸🇪","🇳🇱","🇳🇴","🇨🇭","🇵🇹"],animals:["🐶","🐱","🐭","🐹","🐰","🦊","🐻","🐼","🦁","🐯","🐨","🐮","🐷","🐸","🐵","🦄","🦓","🦒","🦘","🐊","🐍","🦎","🐙","🦑","🐠","🐟","🐬","🐳","🦆"],music:["🎵","🎶","🎼","🎤","🎧","🎹","🥁","🎷","🎺","🎸","🪕","🎻","📯","🎙","🎚","🎛"],tech:["💻","🖥","📱","📲","⌚","🖨","🎥","📸","📹","📺","📡","🔌","🔋","🖱","⌨","📠","💾","💿","📀"]},l=Object.keys(c),m=[];if(0<o){var v,i=c[l[Math.floor(Math.random()*l.length)]],u=i[Math.floor(Math.random()*i.length)];for(let t=0;t<Math.min(o,r);t++)m.push(u);for(v of new Set)m[v]=u}var f=new Set;if(n){let e;for(let t=0;t<r;t++){if(0<o&&0<m.length)e=m.pop();else{do{var y=c[l[Math.floor(Math.random()*l.length)]];e=y[Math.floor(Math.random()*y.length)]}while(o<0&&f.has(e));f.add(e)}d[t].textContent=e,d[t].style.fontSize=2*s+"rem",d[t].style.fontWeight="bold",d[t].style.textAlign="center",d[t].style.verticalAlign="middle"}}if(!n)for(let l=0;l<r;l++){var p=`img/compo/icone/${t}/${e}-01-${Math.floor(30*Math.random()).toString().padStart(3,"0")}.png`;let c=new Image;c.src=p,c.crossOrigin="anonymous",c.onload=function(){var t=document.createElement("canvas"),e=t.getContext("2d"),a=(t.width=d[l].clientWidth,t.height=d[l].clientHeight,e.drawImage(c,0,0,t.width,t.height),e.getImageData(0,0,t.width,t.height)),n=a.data;for(let t=0;t<n.length;t+=4){var o=n[t],i=n[t+1],r=n[t+2],o=Math.sqrt(Math.pow(o-g.r,2)+Math.pow(i-g.g,2)+Math.pow(r-g.b,2));o<40?n[t+3]=0:o<50&&(n[t+3]=Math.max(0,255*(1-o/50)))}e.putImageData(a,0,0);e=document.createElement("canvas"),a=e.getContext("2d"),e.width=t.width,e.height=t.height,a.filter=`blur(${h}px)`,a.drawImage(t,0,0),a=new Image;a.src=e.toDataURL("image/png"),a.style.width=100*s+"%",a.style.height=100*s+"%",a.style.objectFit="cover",a.style.position="absolute",a.style.top="50%",a.style.left="50%",a.style.transform="translate(-50%, -50%)",d[l].style.overflow="hidden",d[l].appendChild(a)}}}let canvas,qrContainer,scratchContainer,container,ctx;document.addEventListener("DOMContentLoaded",function(){qrContainer=document.getElementById("qrContainer"),scratchContainer=document.querySelector(".scratch-container"),canvas=document.getElementById("scratchCanvas"),ctx=canvas.getContext("2d"),container=document.querySelector(".scratch-container");let n=!1;function t(t){var e,a;n&&(e=canvas.getBoundingClientRect(),a=(t.touches?t.touches[0]:t).clientX-e.left,t=(t.touches?t.touches[0]:t).clientY-e.top,ctx.globalCompositeOperation="destination-out",ctx.beginPath(),ctx.arc(a,t,15,0,2*Math.PI),ctx.fill())}function e(){var e=ctx.getImageData(0,0,canvas.width,canvas.height).data;let a=0;for(let t=3;t<e.length;t+=4)0===e[t]&&a++;50<a/(e.length/4)*100&&(gsap.to(canvas,{opacity:0,duration:1,onComplete:()=>canvas.style.display="none"}),verificaVincita(2))&&(evidenziaVincita(),generateQRCode("https://lomazzifederico.it/gratta/"),ShakeScratchArea(5e3),RulliDiTamburo(5e3),qrContainer.addEventListener("click",function(){var t=.1===parseFloat(window.getComputedStyle(qrContainer).opacity);gsap.to(qrContainer,{opacity:t?1:.1,duration:.8})}))}canvas.width=container.clientWidth,canvas.height=container.clientHeight,canvas.addEventListener("mousedown",()=>n=!0),canvas.addEventListener("mouseup",()=>{n=!1,e()}),canvas.addEventListener("mousemove",t),canvas.addEventListener("touchstart",()=>n=!0),canvas.addEventListener("touchend",()=>{n=!1,e()}),canvas.addEventListener("touchmove",t)})</script><script>function RulliDiTamburo(t=2e3,e,o=!0){let a=document.querySelectorAll(".winning-cell"),n=(o&&(document.body.style.pointerEvents="none"),a.forEach(t=>{gsap.fromTo(t,{opacity:.5,scale:1},{opacity:1,scale:1.2,repeat:-1,yoyo:!0,duration:.3,ease:"power1.inOut"})}),document.createElement("div"));n.textContent="🎉 Hai vinto! 🎉",n.style.position="fixed",n.style.top="50%",n.style.left="50%",n.style.transform="translate(-50%, -50%)",n.style.fontSize="50px",n.style.fontWeight="bold",n.style.color="orange",n.style.textShadow="0px 0px 10px white",n.style.opacity="0",document.body.appendChild(n),gsap.to(n,{opacity:1,scale:1.2,duration:.8,ease:"elastic.out(1, 0.3)"}),Math.random()<.5?confetti({particleCount:100,spread:70,origin:{y:.6}}):Math.random()<.5?palloncini(25,"red"):Math.random()<.5?palloncini(25,"*"):stelleScintillanti(35,"gold"),setTimeout(()=>{gsap.to(a,{opacity:1,scale:1,clearProps:"all"}),document.body.removeChild(n),o&&(document.body.style.pointerEvents="auto")},t)}function FireworksEffect(){let e=document.createElement("canvas"),o=(e.style.position="fixed",e.style.top="0",e.style.left="0",e.style.width="100vw",e.style.height="100vh",e.style.pointerEvents="none",document.body.appendChild(e),e.getContext("2d")),a=(e.width=window.innerWidth,e.height=window.innerHeight,[]);for(let t=0;t<5;t++)a.push({x:Math.random()*e.width,y:Math.random()*e.height*.5,radius:3*Math.random()+2,color:`hsl(${360*Math.random()}, 100%, 60%)`,life:50});!function t(){o.clearRect(0,0,e.width,e.height),a.forEach(t=>{o.beginPath(),o.arc(t.x,t.y,t.radius,0,2*Math.PI),o.fillStyle=t.color,o.fill(),--t.life,t.radius+=.5}),0<(a=a.filter(t=>0<t.life)).length?requestAnimationFrame(t):document.body.removeChild(e)}()}function palloncini(e,o="*"){let a=document.body;for(let t=0;t<e;t++){let t=document.createElement("div");t.classList.add("balloon");var n=["red","blue","green","orange","purple","yellow"],n="*"===o?n[Math.floor(Math.random()*n.length)]:o,l=40*Math.random()+20,l=(t.style.fontSize=l+"px",t.style.position="absolute",t.style.left=100*Math.random()+"vw",t.style.bottom="-10vh",t.style.opacity="0.9",t.innerHTML="🎈",t.style.filter=`drop-shadow(2px 2px 2px ${n})`,a.appendChild(t),5*Math.random()+3),n=50*Math.random()+20,i=Math.random()<.5?1:-1;gsap.to(t,{y:"-120vh",x:"+="+i*n,duration:l,ease:"sine.inOut",onComplete:()=>a.removeChild(t)})}}function stelleScintillanti(e,o="*"){let a=document.body;var n=window.innerWidth/2;for(let t=0;t<e;t++){let t=document.createElement("div");t.classList.add("star");var l=["gold","yellow","white","lightblue","pink"],l="*"===o?l[Math.floor(Math.random()*l.length)]:o,i=20*Math.random()+10,i=(t.style.fontSize=i+"px",t.style.position="absolute",t.style.left=n+"px",t.style.top="50px",t.style.opacity="1",t.innerHTML="⭐",t.style.filter=`drop-shadow(2px 2px 2px ${l})`,a.appendChild(t),4*Math.random()+2),l=360*Math.random(),r=Math.random()*window.innerWidth*.5+50,d=n+r*Math.cos(l),r=50+r*Math.sin(l)+.4*window.innerHeight;gsap.to(t,{x:d-n,y:r,opacity:0,duration:i,ease:"power1.out",onComplete:()=>a.removeChild(t)})}}function ShakeScratchArea(n=1e3,l=5){let i=document.querySelector(".scratch-container");if(i){let o=0,a=setInterval(()=>{var t=Math.random()*l*2-l,e=Math.random()*l*2-l;i.style.transform=`translate(${t}px, ${e}px)`,(o+=50)>=n&&(clearInterval(a),i.style.transform="translate(0, 0)")},50)}}function evidenziaVincita(){var t,e=document.querySelectorAll("#gameTable td");let a={},n=new Set;for(t in e.forEach(t=>{let e="";var o=t.querySelector("img");(e=o?o.alt||o.src:t.textContent.trim())&&(a[e]||(a[e]=[]),a[e].push(t))}),a)2<=a[t].length&&n.add(t);e.forEach(t=>{let e=t.textContent.trim();var o=t.querySelector("img");o&&(e=o.alt||o.src),n.has(e)&&gsap.to(t,{opacity:.5,scale:1.2,repeat:-1,yoyo:!0,duration:.5,ease:"power1.inOut"})}),console.log("Effetto evidenziazione vincita attivato!")}</script><script>function generateQRCodeORIGINALE(e,n=200,t="#000000",o="#ffffff"){(qrContainer=document.getElementById("qrContainer"))?qrContainer.innerHTML="":((qrContainer=document.createElement("div")).id="qrContainer",qrContainer.style.textAlign="center",qrContainer.style.marginTop="20px",document.body.appendChild(qrContainer)),canvas=document.createElement("canvas"),qrContainer.appendChild(canvas),new QRious({element:canvas,value:e,size:n,level:"H",foreground:t,background:o})}function generateQRCode(e,n=200,t="#000000",o="#ffffff"){let a=document.getElementById("qrContainer");a?a.innerHTML="":((a=document.createElement("div")).id="qrContainer",a.style.position="absolute",a.style.top="50%",a.style.left="50%",a.style.transform="translate(-50%, -50%)",a.style.width=n+"px",a.style.height=n+"px",a.style.pointerEvents="none",document.body.appendChild(a));var r=document.createElement("canvas");a.appendChild(r),new QRious({element:r,value:e,size:n,level:"H",foreground:t,background:o}),gsap.to(a,{opacity:1,duration:.8,pointerEvents:"auto"})}</script><script>function impostaSfondoPagina(e,o="cover"){switch(document.body.style.backgroundImage=`url('${e}')`,document.body.style.backgroundRepeat="tile"===o?"repeat":"no-repeat",o){case"stretch":document.body.style.backgroundSize="100% 100%";break;case"contain":document.body.style.backgroundSize="contain",document.body.style.backgroundPosition="center";break;case"cover":document.body.style.backgroundSize="cover",document.body.style.backgroundPosition="center";break;case"tile":document.body.style.backgroundSize="auto";break;case"center":document.body.style.backgroundSize="auto",document.body.style.backgroundPosition="center";break;default:console.warn("Modalità non riconosciuta. Impostazione di default: 'cover'."),document.body.style.backgroundSize="cover",document.body.style.backgroundPosition="center"}}</script><script>function inizializzaPagina(a){"complete"===document.readyState||"interactive"===document.readyState?setTimeout(a,0):document.addEventListener("DOMContentLoaded",a)}inizializzaPagina(function(){impostaSfondoPagina("img/compo/patterns/002/pattern01.jpg","tile"),caricaLogo("img/compo/logos/002/logo001.webp",25,"auto","white","4px",1,"RD"),initCanvas(),createGrid(6,3),SizeGriglia("80%","70%"),console.log("La pagina è stata caricata con successo!")})</script><script>function caricaLogo(e,t=25,l="auto",o="white",s="5px",n=0,a="CH"){let i=document.getElementById("logo-container");i||(console.warn("Il contenitore #logo-container non esiste! Creazione automatica..."),(i=document.createElement("div")).id="logo-container",document.body.appendChild(i)),i.innerHTML="";var r=document.createElement("img"),e=(r.src=e,r.alt="Logo",r.style.width=t+"vw",r.style.height="auto"===l?"auto":l+"px",r.style.border=s+" solid "+o,r.style.filter="blur(0.3px)",r.style.borderRadius=0===n?"50%":"10px",i.style.position="fixed",i.style.display="flex",i.style.justifyContent="center",i.style.alignItems="center",i.style.zIndex="9999",i.style.width="100%",i.style.top="",i.style.bottom="",i.style.left="",i.style.right="",i.style.transform="none",document.getElementById("footer")),t=e?e.offsetTop:window.innerHeight,l=i.offsetHeight||50,y=Math.min(t-l-10,window.innerHeight-l);switch(a){case"CH":i.style.top="20px",i.style.left="50%",i.style.transform="translateX(-50%)";break;case"CD":i.style.top=y+"px",i.style.left="50%",i.style.transform="translateX(-50%)";break;case"LH":i.style.top="20px",i.style.left="20px";break;case"LD":i.style.top=y+"px",i.style.left="0",i.style.transform="none",i.style.justifyContent="flex-start",i.style.paddingLeft="10px";break;case"RH":i.style.top="20px",i.style.right="20px";break;case"RD":var f=document.getElementById("footer"),d=f?f.offsetTop:window.innerHeight,f=f?f.offsetHeight:0,p=i.offsetWidth,c=i.offsetHeight;i.style.position="absolute",i.style.top=d-f-c-10+"px",i.style.left=`calc(100% - ${p+10}px)`,i.style.transform="none",i.style.overflow="visible",i.style.display="flex",i.style.alignItems="center",i.style.justifyContent="flex-end";break;default:console.warn("Allineamento non valido, uso default 'CH' (centrato in alto)."),i.style.top="20px",i.style.left="50%",i.style.transform="translateX(-50%)"}i.appendChild(r)}</script><script>function toggleMenu(t=!1){var e=document.querySelector(".menu-content");e.style.display=t||"block"===e.style.display?"none":"block"}function chiudiMenuEDisattivaBurger(){toggleMenu(!0);let t=document.querySelector(".menu-icon");t.style.display="none",setTimeout(()=>{t.style.display="block"},2e3)}function rigeneraScratch(){chiudiMenuEDisattivaBurger(),console.log("Rigenerazione Scratch"),createGrid(4,4)}function attivaEffettoVittoria(){chiudiMenuEDisattivaBurger(),console.log("Attivato effetto vittoria!"),RulliDiTamburo(3e3)}function attivaEffettoFuochi(){chiudiMenuEDisattivaBurger(),console.log("Attivati fuochi d’artificio!"),FireworksEffect()}function attivaEffettoPalloncini(){chiudiMenuEDisattivaBurger(),console.log("Attivato effetto palloncini!"),palloncini(50,"*")}function attivaEffettoStelle(){chiudiMenuEDisattivaBurger(),console.log("Attivato effetto stelle scintillanti!"),stelleScintillanti(100)}function rigeneraConVincite(){var t=parseInt(document.getElementById("numVincite").value);chiudiMenuEDisattivaBurger(),console.log(`Rigenera con ${t} icone vincenti`),createGrid(4,4),caricaIconeGiocoAAA(void 0,void 0,void 0,"white",!0,t,"large")}function attivaModalitaPosizionamento(){chiudiMenuEDisattivaBurger();let e=document.querySelector(".scratch-container");var t=document.getElementById("drag-button"),i=document.getElementById("confirm-button");let o=document.getElementById("posiziona-bottoni"),n=document.getElementById("menu-burger"),c=(o.style.display="flex",n.style.display="none",setTimeout(()=>{n.style.display="block"},2e3),!1),l=0,u=0;t.onmousedown=function(t){c=!0,l=t.clientX-e.offsetLeft,u=t.clientY-e.offsetTop},document.onmousemove=function(t){c&&(e.style.position="absolute",e.style.left=t.clientX-l+"px",e.style.top=t.clientY-u+"px")},document.onmouseup=function(){c=!1},i.onclick=function(){o.style.display="none",document.onmousemove=null,document.onmouseup=null}}</script><script>document.addEventListener("DOMContentLoaded",function(){let n=document.querySelector(".scratch-container");var e=document.getElementById("resize-handle");let o=!1,d,i,c,u;function t(e){var t;o&&(t=c+(e.clientX-d),e=u+(e.clientY-i),150<t&&(n.style.width=t+"px"),100<e)&&(n.style.height=e+"px")}function m(){o=!1,document.removeEventListener("mousemove",t),document.removeEventListener("mouseup",m)}e.addEventListener("mousedown",function(e){o=!0,d=e.clientX,i=e.clientY,c=n.offsetWidth,u=n.offsetHeight,document.addEventListener("mousemove",t),document.addEventListener("mouseup",m)})})</script><div id="footer">© 2025 Mangia & Vinci - Tutti i diritti riservati.</div></body></html>