/* page config — consumed by master.js */
window.PAGE = {
  loadMeta: "36 of 2,418",
  lobbyImages: [
      "203590-sun-of-egypt-3.jpg",
      "209594-elvis-frog-trueways.jpg",
      "210522-snoop-dogg-dollars.jpg",
      "212040-wildstock.jpg",
      "200083-raptor-doublemax.jpg",
      "200647-illogicool.jpg",
      "205864-power-of-zeus.jpg",
      "176368-fist-of-destruction.jpg",
      "200854-vikings-go-berzerk.jpg",
      "214449-sweet-bazaar.jpg",
      "200870-golden-fishtank.jpg",
      "203651-3-hot-chillies.jpg",
      "175628-royal-fortunator-hold-and-win.jpg",
      "200769-champions-of-rome.jpg",
      "211982-raging-lion.jpg",
      "212002-throne-of-camelot.jpg",
      "205166-royalty-of-olympus.jpg",
      "209575-bonanza-billion.jpg",
      "175060-mystery-dragons.jpg",
      "174976-elephants-gold-bonus-combo.jpg",
      "175072-rich-piggies-bonus-combo.jpg",
      "175472-hit-coins-hold-and-spin.jpg",
      "176268-rip-city.jpg",
      "199466-big-catch-bonanza-perfect-haul.jpg",
      "200743-cazino-zeppelin.jpg",
      "200744-valley-of-the-gods-2.jpg",
      "200797-pacific-gold.jpg",
      "200866-multifly.jpg",
      "208138-coin-win-hold-the-spin.jpg",
      "209324-fruit-million.jpg",
      "209413-lady-wolf-moon.jpg",
      "211979-sea-secret.jpg",
      "211980-max-miner.jpg",
      "211983-buffalo-trail.jpg",
      "212000-tritons-realm.jpg",
      "212021-wolf-of-wild-street.jpg"
    ],
};

/* ===== hero slider engine (casino only) ===== */

(function(){
  var root=document.getElementById('k1-slider'); if(!root) return;
  /* hero-v6 set: one desktop + one portrait render per promo */
  var PROMOS=[
   {title:'Welcome Bonus Pack',  pct:'450%',    segs:[['Up to','€6,000'],['Free Spins','+200']], bonus:'Claim your fresh bonus across the first four deposits.', cta:'Claim 450% Bonus'},
   {title:'Highroller Bonus',    pct:'200%',    segs:[['Up to','€3,000']],                       bonus:'A bigger welcome boost for our VIP players.', cta:'Claim VIP Bonus'},
   {title:'First Deposit Bonus', pct:'200%',    segs:[['Up to','€1,000'],['Free Spins','+200']], bonus:'Boost your first deposit with this welcome offer pack.', cta:'Claim 200% Bonus'},
   {title:'Lucky Day',           pct:'Today',   segs:[['Daily','Mystery Prize']],                 bonus:'Follow the lucky map today to grab a major top prize.', cta:'Follow The Map'},
   {title:'Double Cashback',     pct:'50%',     segs:[['Up to','€200']],                         bonus:'Get half your weekend losses back every Monday.', cta:'Claim 50% Cashback'},
   {title:'Welcome Sport Bonus', pct:'100%',    segs:[['Up to','€300']],                         bonus:'Start your sports journey with a welcome boost.', cta:'Claim Sport Bonus'},
   {title:'Pragmatic Tournament',pct:'€30,000', segs:[['Top Prize','€5,000']],                   bonus:'Spin daily and climb the board for the top prize.', cta:'Join The Tournament'},
   {title:'Weekly Cashback',     pct:'25%',     segs:[['Up to','€100']],                         bonus:'Get 25% of your losses back every single Monday.', cta:'Claim 25% Cashback'}
  ];
  var artsBox=root.querySelector('.k1-arts');
  artsBox.innerHTML=PROMOS.map(function(p,x){
    var n='0'+(x+1);
    /* absolute URLs: relative url() inside a custom property resolves against
       the consuming stylesheet's base, which breaks once CSS moves to css/ */
    var d=new URL('assets-new/hero-v6/hero-v6-'+n+'.webp', document.baseURI).href;
    var m=new URL('assets-new/hero-v6/hero-v6-'+n+'-m.webp', document.baseURI).href;
    return '<div class="k1-art'+(x?'':' on')+'" style="--art-d:url(\''+d+'\');--art-m:url(\''+m+'\')"></div>';}).join('');
  var arts=[].slice.call(artsBox.children);
  var eb=root.querySelector('.k1-eb'), pct=root.querySelector('.k1-pct'),
      duo=root.querySelector('.k1-duo'), bline2=root.querySelector('.k1-bline2'),
      dots=[].slice.call(root.querySelectorAll('.k1-dots .d'));
  var i=0, t=null, busy=false, AUTO=5000;
  function paint(p){
    eb.textContent=p.title;
    bline2.textContent=p.bonus;
    root.querySelector('.k1-cta .lbl').textContent=p.cta;
    pct.textContent=p.pct;
    duo.innerHTML=p.segs.map(function(sg,x){
      return (x?'<span class="dvd" aria-hidden="true"></span>':'')+
        '<span class="seg"><span class="k">'+sg[0]+'</span><span class="v">'+sg[1]+'</span></span>';
    }).join('');
    dots.forEach(function(d,x){d.classList.toggle('active',x===i);});
  }
  function go(n){
    if(busy) return; busy=true;
    i=(n+PROMOS.length)%PROMOS.length;
    root.classList.add('swap');
    arts.forEach(function(a,x){a.classList.toggle('on',x===i);});
    setTimeout(function(){paint(PROMOS[i]); root.classList.remove('swap'); busy=false;},360);
  }
  function arm(){clearInterval(t); t=setInterval(function(){go(i+1);}, AUTO);}
  dots.forEach(function(d){d.addEventListener('click',function(){go(+d.dataset.i); arm();});});
  var sx=null;
  root.addEventListener('touchstart',function(e){sx=e.touches[0].clientX;},{passive:true});
  root.addEventListener('touchend',function(e){if(sx===null)return;var dx=e.changedTouches[0].clientX-sx;if(Math.abs(dx)>40){go(i+(dx<0?1:-1));arm();}sx=null;},{passive:true});
  document.addEventListener('visibilitychange',function(){document.hidden?clearInterval(t):arm();});
  paint(PROMOS[0]); arm();
})();

