<!DOCTYPE html><!-- Last Published: Wed Jun 10 2026 14:26:07 GMT+0000 (Coordinated Universal Time) --><html data-wf-domain="ags-dev.webflow.io" data-wf-page="6a296df6f65567c39e5fefc3" data-wf-site="6a296df6f65567c39e5fefe7" lang="en-US"><head><meta charset="utf-8"/><link href="https://cdn.prod.website-files.com" rel="preconnect" crossorigin="anonymous"/><title>Not Found</title><meta content="Not Found" property="og:title"/><meta content="https://cdn.prod.website-files.com/6a296df6f65567c39e5fefe7/6a296df6f65567c39e5ff2b4_Open_Graph_Image.png" property="og:image"/><meta content="Not Found" name="twitter:title"/><meta content="width=device-width, initial-scale=1" name="viewport"/><link href="https://cdn.prod.website-files.com/6a296df6f65567c39e5fefe7/css/ags-dev.webflow.shared.5c00a0735.min.css" rel="stylesheet" type="text/css" integrity="sha384-XACgc1kGNvRbSzkcB/8dOfiHcyAZ6zJ4Te5qoc82hMWn2vFFVmhFXNLIUTS4t0Lh" crossorigin="anonymous"/><style>html.w-mod-js:not(.w-mod-ix3) :is([data-stack-card="card"], .timeline_paragraph-wrapper, .timeline_extention, .footer_background-image, .navbar_search-element) {visibility: hidden !important;}</style><script type="text/javascript">!function(o,c){var n=c.documentElement,t=" w-mod-";n.className+=t+"js",("ontouchstart"in o||o.DocumentTouch&&c instanceof DocumentTouch)&&(n.className+=t+"touch")}(window,document);</script><link href="https://cdn.prod.website-files.com/6893c2c851dca9d751167409/6899a38844254b6323cf7b13_Favicon.png" rel="shortcut icon" type="image/x-icon"/><link href="https://cdn.prod.website-files.com/6893c2c851dca9d751167409/6899a38a9671b226730d1c79_Webclip.png" rel="apple-touch-icon"/><link href="https://playags.com/404" rel="canonical"/><!-- OPTIMIZED HEADER CODE FOR VERCEL -->
<!-- DNS prefetch and preconnect for faster external resource loading -->
<!-- Preconnect to CDNs and external resources -->
<link rel="preconnect" href="https://cdn.jsdelivr.net" crossorigin>
<link rel="dns-prefetch" href="https://cdn.jsdelivr.net">
<link rel="preconnect" href="https://www.googletagmanager.com">
<link rel="dns-prefetch" href="https://www.googletagmanager.com">
<link rel="preconnect" href="https://use.typekit.net" crossorigin>
<link rel="dns-prefetch" href="https://use.typekit.net">
<link rel="preconnect" href="https://cdn.prod.website-files.com">
<link rel="dns-prefetch" href="https://cdn.prod.website-files.com">

<!-- PERFORMANCE FIX #1: Preload LCP images with high priority -->
<!-- Note: Removed preload links - they may be causing display issues -->
<!-- The fetchpriority will be set via JavaScript instead -->

<!-- Defer GTM - Load it after page interactive -->
<script>
// Defer GTM to reduce main thread blocking
window.addEventListener('load', function() {
  setTimeout(function() {
    (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
    new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
    j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
    'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
    })(window,document,'script','dataLayer','GTM-WG7CSMRW');
  }, 1000);
});
</script>

<!-- Critical inline CSS - Keep this to prevent render blocking -->
<style>
  /* Splide core styles */
  .splide,
  .splide__track {
    overflow: visible;
  }
  .splide__sr{
    display: none !important;
  }
  
  /* Swiper styles */
  .swiper-pagination-bullets.swiper-pagination-horizontal {
    width: auto;
  }
  
  /* Hide elements during load */
  [data-hide-load]{
    opacity: 0;
  }
  
  /* Font smoothing for better rendering */
  body {
    -webkit-font-smoothing: antialiased; 
    -moz-osx-font-smoothing: grayscale; 
    text-rendering: optimizeLegibility;
  }
  
  /* PERFORMANCE FIX #2: Critical CSS for hero images */
  .slots-header_element {
    display: block;
    max-width: 100%;
  }
  .slots-header_element img {
    display: block;
    width: 100%;
    height: auto;
  }
  .games_image {
    display: block;
    max-width: 100%;
  }
</style>

<!-- Defer non-critical CSS with preload + print trick -->
<!-- This prevents render-blocking while still loading the styles -->
<link rel="preload" href="https://cdn.jsdelivr.net/npm/@splidejs/splide@3.2.2/dist/css/splide-core.min.css" as="style" onload="this.onload=null;this.rel='stylesheet'">
<noscript><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@splidejs/splide@3.2.2/dist/css/splide-core.min.css"></noscript>
<link rel="preload" href="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css" as="style" onload="this.onload=null;this.rel='stylesheet'">
<noscript><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css"></noscript>

<!-- Fallback polyfill for preload -->
<script>
/*! loadCSS. [c]2017 Filament Group, Inc. MIT License */
!function(n){"use strict";n.loadCSS||(n.loadCSS=function(){});var o=loadCSS.relpreload={};if(o.support=function(){var e;try{e=n.document.createElement("link").relList.supports("preload")}catch(t){e=!1}return function(){return e}}(),o.bindMediaToggle=function(t){var e=t.media||"all";function a(){t.addEventListener?t.removeEventListener("load",a):t.attachEvent&&t.detachEvent("onload",a),t.setAttribute("onload",null),t.media=e}t.addEventListener?t.addEventListener("load",a):t.attachEvent&&t.attachEvent("onload",a),setTimeout(function(){t.rel="stylesheet",t.media="only x"}),setTimeout(a,3e3)},!o.support()){o.poly=function(){if(!n.document.getElementsByTagName("link"))return;for(var t=n.document.getElementsByTagName("link"),e=0;e<t.length;e++){var a=t[e];"preload"!==a.rel||"style"!==a.getAttribute("as")||a.getAttribute("data-loadcss")||(a.setAttribute("data-loadcss",!0),o.bindMediaToggle(a))}},o.poly();var t=n.setInterval(o.poly,500);n.addEventListener?n.addEventListener("load",function(){o.poly(),n.clearInterval(t)}):n.attachEvent&&n.attachEvent("onload",function(){o.poly(),n.clearInterval(t)})}"undefined"!=typeof exports?exports.loadCSS=loadCSS:n.loadCSS=loadCSS}("undefined"!=typeof global?global:this);
</script></head><body><div class="page-wrapper"><div class="global-styles"><div class="style-overrides w-embed"><style>
  * {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -o-font-smoothing: antialiased;
  }

  /* Ensure all elements inherit the color from its parent */
  a,
  .w-input,
  .w-select,
  .w-tab-link,
  .w-nav-link,
  .w-nav-brand,
  .w-dropdown-btn,
  .w-dropdown-toggle,
  .w-slider-arrow-left,
  .w-slider-arrow-right,
  .w-dropdown-link {
    color: inherit;
    text-decoration: inherit;
  }

  /* Focus state style for keyboard navigation for the focusable elements */
  *[tabindex]:focus-visible,
  input[type="file"]:focus-visible {
    outline: 0.125rem solid #4d65ff;
    outline-offset: 0.125rem;
  }

  /* Get rid of top margin on first element in any rich text element */
  .w-richtext > :not(div):first-child, .w-richtext > div:first-child > :first-child {
    margin-top: 0 !important;
  }

  /* Get rid of bottom margin on last element in any rich text element */
  .w-richtext>:last-child, .w-richtext ol li:last-child, .w-richtext ul li:last-child {
    margin-bottom: 0 !important;
  }

  /* Prevent all click and hover interaction with an element */
  .pointer-events-off {
    pointer-events: none;
  }

  /* Enables all click and hover interaction with an element */
  .pointer-events-on {
    pointer-events: auto;
  }

  /* Create a class of .div-square which maintains a 1:1 dimension of a div */
  .div-square::after {
    content: "";
    display: block;
    padding-bottom: 100%;
  }

  /* Make sure containers never lose their center alignment */
  .container-medium,.container-small, .container-large {
    margin-right: auto !important;
    margin-left: auto !important;
  }

  /* Apply "..." after 4 lines of text */
  .text-style-4lines {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
  }

  /* Apply "..." after 3 lines of text */
  .text-style-3lines {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
  }

  /* Apply "..." after 2 lines of text */
  .text-style-2lines {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  /* Adds inline flex display */
  .display-inlineflex {
    display: inline-flex;
  }

  /* These classes are never overwritten */
  .hide {
    display: none !important;
  }

  /* Remove default Webflow chevron from form select */
  select{
    -webkit-appearance:none;
  }


  @media screen and (max-width: 991px) {
    .hide, .hide-tablet {
      display: none !important;
    }
  }
  @media screen and (max-width: 767px) {
    .hide-mobile-landscape{
      display: none !important;
    }
  }
  @media screen and (max-width: 479px) {
    .hide-mobile{
      display: none !important;
    }
  }

  .margin-0 {
    margin: 0rem !important;
  }

  .padding-0 {
    padding: 0rem !important;
  }

  .spacing-clean {
    padding: 0rem !important;
    margin: 0rem !important;
  }

  .margin-top {
    margin-right: 0rem !important;
    margin-bottom: 0rem !important;
    margin-left: 0rem !important;
  }

  .padding-top {
    padding-right: 0rem !important;
    padding-bottom: 0rem !important;
    padding-left: 0rem !important;
  }

  .margin-right {
    margin-top: 0rem !important;
    margin-bottom: 0rem !important;
    margin-left: 0rem !important;
  }

  .padding-right {
    padding-top: 0rem !important;
    padding-bottom: 0rem !important;
    padding-left: 0rem !important;
  }

  .margin-bottom {
    margin-top: 0rem !important;
    margin-right: 0rem !important;
    margin-left: 0rem !important;
  }

  .padding-bottom {
    padding-top: 0rem !important;
    padding-right: 0rem !important;
    padding-left: 0rem !important;
  }

  .margin-left {
    margin-top: 0rem !important;
    margin-right: 0rem !important;
    margin-bottom: 0rem !important;
  }

  .padding-left {
    padding-top: 0rem !important;
    padding-right: 0rem !important;
    padding-bottom: 0rem !important;
  }

  .margin-horizontal {
    margin-top: 0rem !important;
    margin-bottom: 0rem !important;
  }

  .padding-horizontal {
    padding-top: 0rem !important;
    padding-bottom: 0rem !important;
  }

  .margin-vertical {
    margin-right: 0rem !important;
    margin-left: 0rem !important;
  }

  .padding-vertical {
    padding-right: 0rem !important;
    padding-left: 0rem !important;
  }

  /* Apply "..." at 100% width */
  .truncate-width { 
    width: 100%; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
  }
  /* Removes native scrollbar */
  .no-scrollbar {
    -ms-overflow-style: none;
    overflow: -moz-scrollbars-none; 
  }

  .no-scrollbar::-webkit-scrollbar {
    display: none;
  }

  .is-disabed{
    opacity: 0.5;
    pointer-events: none;
  }

  .wf-empty {
    outline: 0px dashed #555 !important;
    outline-offset: -1px !important;
    box-shadow: inset 0 0 0 4px rgba(0, 0, 0, 0), inset 0 0 0 4px rgba(255, 255, 255, 0), inset 0 0 0 1px rgba(255, 255, 255, 0);
    padding-bottom: 75px;
    padding-right: 75px;
    font-size: 0;
    line-height: 0;
    vertical-align: middle;
  }

  /*Fluid Responsive Code*/
  html { font-size: 1rem; }
  @media screen and (max-width:1440px) { html { font-size: calc(0.4977678571428572rem + 0.5580357142857142vw); } }
  @media screen and (max-width:992px) { html { font-size: 1rem; } }


  /*
  html { font-size: 1rem; }
  @media screen and (max-width:1440px) { html { font-size:  calc(0.0758928571428572rem + 1.0267857142857142vw); } }
  @media screen and (max-width:991px) { html { font-size: calc(0.0006608280254774002rem + 1.9171974522293vw); } }
  @media screen and (max-width:834px) { html { font-size: calc(-0.003600746268656141rem + 1.925373134328357vw); } }
  @media screen and (max-width:767px) { html { font-size: calc(0.0007485029940121901rem + 2.6646706586826343vw); } }
  @media screen and (max-width:600px) { html { font-size: calc(-0.0010330578512397492rem + 2.669421487603306vw); } }
  @media screen and (max-width:479px) { html { font-size: calc(0.00035112359550615313rem + 4.101123595505616vw); } }
  @media screen and (max-width:390px) { html { font-size: calc(-0.26587499999999975rem + 5.1933333333333325vw); } }
  @media screen and (max-width:240px) { html { font-size: 0.513125rem; } }
  */
  /* Base: all highlighted countries dimmed */
  .locations_map-block .highcharts-point {
    opacity: 0.7;
    transition: opacity .2s ease;
  }
  /* Active (clicked) country */
  .locations_map-block .highcharts-point.is-active {
    opacity: 1;
  }

  .locations_map-block .custom-tooltip {
    border-radius: 0.2rem;
    background: #FF6D00;
    color: #000;
    font-size: 0.8rem;
    font-family: var(--_typography---font-styles--tagline);
    font-weight: 600;
    line-height: 0.7rem; /* 89% of font size */
    letter-spacing: 0.035rem;
    text-transform: uppercase;
    padding: 0.6rem;
  }

  .is-disabled{
    opacity: 0.3;
  }

  .wf-design-mode .fs-consent_component{
    display: none;
  }
</style></div><div class="color-schemes w-embed"><style>
.color-scheme-1 {}
  

.w-slider-dot {
  background-color: var(--color-scheme-1--text);
  opacity: 0.20;
}

.w-slider-dot.w-active {
  background-color: var(--color-scheme-1--text);
  opacity: 1;
}

/* Override .w-slider-nav-invert styles */
.w-slider-nav-invert .w-slider-dot {
  background-color: var(--color-scheme-1--text) !important;
  opacity: 0.20 !important;
}

.w-slider-nav-invert .w-slider-dot.w-active {
  background-color: var(--color-scheme-1--text) !important;
  opacity: 1 !important;
}

</style></div><div class="css-animations w-embed"><style>

  [data-image-global-ease]{
    transition-property: all;
    transition-duration: 380ms;
    transition-timing-function: cubic-bezier(0.165, 0.84, 0.44, 1);
  }

  .is-active-accordion .benefits-perks_accordion-overlay{
    opacity: 1;
  }

  .is-active-accordion .benefits-perks_chevron{
    transform: rotate(90deg);
    color: black;
  }


  @media only screen and (min-width: 992px){
    /*Blog Hover*/
    .newsroom-render_item:hover .newsroom-render_image, 
    [data-hover-card="item"]:hover [data-hover-card="image"]{
      filter: grayscale(0%);
    }

    [data-hover-card="item"]:hover{
      transform: translateY(-0.625rem);
    }

    /*Card Hover Interaction*/
    [data-image-scale='image'] {
      transition-property: transform;
      transition-duration: 540ms;
      transition-timing-function: cubic-bezier(0.165, 0.84, 0.44, 1);
    }  

    [data-image-scale='card']:hover [data-image-scale='image'] {
      transform: scale(1.1);
    } 

    /*Opacity Interactions*/
    .feature-style-1_card:hover .feature-style-1_background-wrapper,
    .feature-style-1_card:hover .feature-style-1_image.is-absolute,
    .game-bacon_item:hover .game-bacon_background-wrapper,
    .games_item:hover .games_background-wrapper,
    .games_item:hover .data-games-item,
    .stats_card:hover .stats_card-overlay,
    [data-opacity-element="card"]:hover [data-opacity-element="overlay"] {
      opacity: 1;
    }

    .games_item:hover .text-style-tagline,
    [data-hover-card="item"]:hover [data-hover-card="tagline-dark"]{
      color: black !important;
    }


    .awards-champs_item:hover .awards-champs_shape, 
    .awards-champs_item:hover .awards-champs_tagline,
    .programs_item:hover .programs_icon
    {
      color: white;
    }

    .feature-style-1_card:hover .feature-style-1_background-flash,
    .games_item:hover .games_background-flash{
      /* transform: translateY(0%); */
      transform: scale(1);
    }

    .feature-style-1_card:hover .button, 
    .games_item:hover .button {
      background-image: linear-gradient(to bottom, var(--_primitives---colors--white), var(--_primitives---colors--white));
      color: var(--_primitives---colors--neutral-darkest);
    }
  }

  @media only screen and (max-width: 992px){
    .games_item .games_background-wrapper,
    .games_item .data-games-item,
    .feature-style-1_card .button-overlay, 
    .games_item .button-overlay
    {
      opacity: 1;
    }

    .games_item .text-style-tagline {
      color: var(--_primitives---colors--blaze-orange);
    }

    .feature-style-1_card .feature-style-1_background-flash,
    .games_item .games_background-flash{
      /* transform: translateY(0%); */
      transform: scale(1);
    }

  }


</style></div></div><main class="main-wrapper"><header class="section_header-style-4"><div class="padding-global"><div class="container-large"><div class="header-style-4_component is-full"><div class="header-style-4_content"><h1 class="heading-style-h0">OUT OF CREDITS</h1><div class="spacer-xsmall"></div><p class="text-size-large">This page doesn’t exist or has been moved.</p><div class="spacer-medium"></div><a data-opacity-element="card" data-wf--button--variant="base" href="/" class="button w-inline-block"><div class="button-text">GO TO HOMEPAGE</div><div data-opacity-element="overlay" class="button-overlay"></div></a></div></div></div></div><img src="https://cdn.prod.website-files.com/6a296df6f65567c39e5fefe7/6a296df6f65567c39e5ff095_BG%20Shape.svg" loading="eager" alt="" class="header-style-4_background-element"/><div class="header-style-4_image-group"><div id="w-node-_5aa91b9d-6ffe-a34a-1937-337f49af79e8-9e5fefc3" class="header-style-4_image-wrapper is-1"></div><div id="w-node-_5aa91b9d-6ffe-a34a-1937-337f49af79ea-9e5fefc3" class="header-style-4_image-wrapper"></div></div></header></main></div><div fs-consent-styledCategories="true" fs-consent-element="internal-component" class="fs-consent_component"><div class="w-embed w-script"><!-- CookieYes -->
<script id="cookieyes" type="text/javascript" src="https://cdn-cookieyes.com/client_data/68ee36e78c58dd1c60da61e258d7893b/script.js"></script></div></div><script src="https://d3e54v103j8qbb.cloudfront.net/js/jquery-3.5.1.min.dc5e7f18c8.js?site=6a296df6f65567c39e5fefe7" type="text/javascript" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script><script src="https://cdn.prod.website-files.com/6a296df6f65567c39e5fefe7/js/webflow.schunk.36b8fb49256177c8.js" type="text/javascript" integrity="sha384-4abIlA5/v7XaW1HMXKBgnUuhnjBYJ/Z9C1OSg4OhmVw9O3QeHJ/qJqFBERCDPv7G" crossorigin="anonymous"></script><script src="https://cdn.prod.website-files.com/6a296df6f65567c39e5fefe7/js/webflow.schunk.c15a5beb890db85e.js" type="text/javascript" integrity="sha384-aJdsCsyZKg69t31TtXzfIZbo4jN17KZjnnU8PAjXSKCz+t5jdblPRtO+QGbJulWt" crossorigin="anonymous"></script><script src="https://cdn.prod.website-files.com/6a296df6f65567c39e5fefe7/js/webflow.19305cb5.ef7f1c07297cc5be.js" type="text/javascript" integrity="sha384-imokQb0SnWCh+G23u4bfekIiDD0QF3kpKB4TmZx7dnEr5jNVdajRxs2+6+gRn9Wn" crossorigin="anonymous"></script><script src="https://cdn.prod.website-files.com/gsap/3.15.0/gsap.min.js" type="text/javascript"></script><script src="https://cdn.prod.website-files.com/gsap/3.15.0/ScrollTrigger.min.js" type="text/javascript"></script><script src="https://cdn.prod.website-files.com/gsap/3.15.0/SplitText.min.js" type="text/javascript"></script><script src="https://cdn.prod.website-files.com/gsap/3.15.0/TextPlugin.min.js" type="text/javascript"></script><script type="text/javascript">gsap.registerPlugin(ScrollTrigger,SplitText,TextPlugin);</script><!-- OPTIMIZED WEBFLOW FOOTER - ALL FEATURES WORKING + PERFORMANCE IMPROVEMENTS -->
<!-- Copy this ENTIRE block to Webflow → Project Settings → Custom Code → Footer Code (before </body>) -->

<style>
  a[href*="webflow.com"][href*="badge"] { display: none !important; }
  .w-webflow-badge { display: none !important; }
</style>

<!-- Load libraries with defer for non-blocking (except Highcharts which is needed immediately) -->
<script defer src="https://cdn.jsdelivr.net/npm/@splidejs/splide@3.2.2/dist/js/splide.min.js"></script>
<script defer src="https://cdn.jsdelivr.net/npm/@splidejs/splide-extension-auto-scroll@0.5.3/dist/js/splide-extension-auto-scroll.min.js"></script>
<script defer src="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.js"></script>
<script defer src="https://cdn.jsdelivr.net/npm/@finsweet/attributes-accordion@1/accordion.js"></script>
<script defer src="https://unpkg.com/@rive-app/canvas@2.9.1"></script>

<!-- Highcharts - Load immediately (map needs this) -->
<script src="https://code.highcharts.com/maps/highmaps.js"></script>
<script src="https://code.highcharts.com/maps/modules/data.js"></script>
<script src="https://code.highcharts.com/maps/modules/accessibility.js"></script>

<!-- CRITICAL: Super aggressive Elfsight lazy load -->
<script>
(function() {
  let elfsightLoaded = false;
  
  function loadElfsight() {
    if (elfsightLoaded) return;
    elfsightLoaded = true;
    
    console.log('⏰ Loading Elfsight widget...');
    
    var elfsightScript = document.createElement('script');
    elfsightScript.src = 'https://static.elfsight.com/platform/platform.js';
    elfsightScript.async = true;
    elfsightScript.setAttribute('data-use-service-core', '');
    
    elfsightScript.onload = function() {
      console.log('✅ Elfsight loaded');
    };
    
    document.body.appendChild(elfsightScript);
  }
  
  // Load on scroll (after user starts scrolling)
  let scrollTimer;
  let hasScrolled = false;
  
  window.addEventListener('scroll', function() {
    if (!hasScrolled) {
      hasScrolled = true;
      clearTimeout(scrollTimer);
      scrollTimer = setTimeout(loadElfsight, 2000);
    }
  }, { passive: true });
  
  // Load on any user interaction
  const interactions = ['click', 'touchstart', 'keydown'];
  interactions.forEach(function(event) {
    document.addEventListener(event, function() {
      setTimeout(loadElfsight, 1000);
    }, { once: true, passive: true });
  });
  
  // Fallback - load after 8 seconds if no interaction
  window.addEventListener('load', function() {
    setTimeout(function() {
      if (!elfsightLoaded) {
        console.log('⏰ Loading Elfsight (fallback timer)');
        loadElfsight();
      }
    }, 8000);
  });
})();
</script>

<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-WG7CSMRW" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>

<script>
// ============================================
// SEARCH FUNCTIONALITY
// ============================================
document.addEventListener("DOMContentLoaded", () => {
  const form = document.querySelector('[data-search-canvas="form"]');
  const input = document.querySelector('[data-search-canvas="input"]');
  const button = document.querySelector('[data-search-canvas="button"]');

  if (!form || !input || !button) return;

  form.addEventListener("submit", (e) => {
    e.preventDefault();
    const value = input.value.trim();
    if (value) {
      window.open(`/directory/?search=${encodeURIComponent(value)}`, "_blank");
    }
  });

  button.addEventListener("click", (e) => {
    e.preventDefault();
    const value = input.value.trim();
    if (value) {
      window.open(`/directory/?search=${encodeURIComponent(value)}`, "_blank");
    }
  });

  input.addEventListener("input", () => {
    if (input.value.trim() !== "") {
      button.classList.add("is-active");
    } else {
      button.classList.remove("is-active");
    }
  });
});

// ============================================
// GSAP OPACITY REVEAL
// ============================================
window.addEventListener("load", function () {
  if (typeof gsap !== 'undefined') {
    gsap.set("[data-hide-load]", { opacity: 1 });
  }
});
</script>

<noscript><style>[data-hide-load]{opacity: 1;}</style></noscript>

<script>
// ============================================
// UNIVERSAL SWIPER SLIDER
// ============================================
(function UniversalSwiperSlider() {
  document.addEventListener("DOMContentLoaded", function () {
    if (typeof Swiper === "undefined") {
      console.warn("[UniversalSwiperSlider] Swiper not found. Load swiper-bundle.min.js before this script.");
      return;
    }

    const ussParse = (val) => {
      if (val === undefined || val === null || val === "") return undefined;
      if (val === "true") return true;
      if (val === "false") return false;
      if (!isNaN(val)) return Number(val);
      return val;
    };
    
    const ussParseJSON = (str) => {
      if (!str) return undefined;
      try { return JSON.parse(str); } 
      catch (e) { 
        console.warn("[UniversalSwiperSlider] Invalid JSON:", str); 
        return undefined; 
      }
    };

    document.querySelectorAll("[data-universal-swiper-slider]").forEach(function (ussSliderEl) {
      const ussSwiperSelector = ussSliderEl.getAttribute("data-swiper-container") || ".swiper";
      const ussNextSelector   = ussSliderEl.getAttribute("data-swiper-nav-next") || ".swiper-next";
      const ussPrevSelector   = ussSliderEl.getAttribute("data-swiper-nav-prev") || ".swiper-prev";

      const ussContainerEl = ussSliderEl.querySelector(ussSwiperSelector);
      const ussNextEl      = ussSliderEl.querySelector(ussNextSelector);
      const ussPrevEl      = ussSliderEl.querySelector(ussPrevSelector);

      if (!ussContainerEl) {
        console.warn("[UniversalSwiperSlider] Container not found for", ussSliderEl);
        return;
      }

      const ussSpeed          = ussParse(ussSliderEl.getAttribute("data-swiper-speed"));
      const ussLoop           = ussParse(ussSliderEl.getAttribute("data-swiper-loop"));
      const ussRewind         = ussParse(ussSliderEl.getAttribute("data-swiper-rewind"));
      const ussAutoHeight     = ussParse(ussSliderEl.getAttribute("data-swiper-auto-height"));
      const ussCenteredSlides = ussParse(ussSliderEl.getAttribute("data-swiper-centered"));
      const ussFollowFinger   = ussParse(ussSliderEl.getAttribute("data-swiper-follow-finger"));
      const ussFreeMode       = ussParse(ussSliderEl.getAttribute("data-swiper-free-mode"));
      const ussSlideToClicked = ussParse(ussSliderEl.getAttribute("data-swiper-slide-to-clicked"));
      const ussSlidesPerView  = ussParse(ussSliderEl.getAttribute("data-swiper-slides-per-view"));
      const ussSpaceBetween   = ussParse(ussSliderEl.getAttribute("data-swiper-space-between"));
      const ussMousewheel     = ussParse(ussSliderEl.getAttribute("data-swiper-mousewheel"));
      const ussKeyboard       = ussParse(ussSliderEl.getAttribute("data-swiper-keyboard"));

      const ussBreakpointsJSON = ussParseJSON(ussSliderEl.getAttribute("data-swiper-breakpoints"));
      const ussOptionsJSON     = ussParseJSON(ussSliderEl.getAttribute("data-swiper-options"));

      const ussNavigation = ussNextEl && ussPrevEl
        ? { nextEl: ussNextEl, prevEl: ussPrevEl, disabledClass: "is-disabled" }
        : undefined;

      const ussDefaults = {
        speed: 500,
        loop: false,
        rewind: false,
        autoHeight: false,
        centeredSlides: false,
        followFinger: true,
        freeMode: false,
        slideToClickedSlide: false,
        slidesPerView: 1,
        spaceBetween: 16,
        mousewheel: { forceToAxis: true },
        keyboard: { enabled: true, onlyInViewport: true },
        navigation: ussNavigation,
        breakpoints: {
          480: { slidesPerView: 1,   spaceBetween: 16 },
          768: { slidesPerView: 2,   spaceBetween: 16 },
          992: { slidesPerView: 2.5, spaceBetween: 16 }
        }
      };

      const ussAttrOverrides = {
        ...(ussSpeed !== undefined ? { speed: ussSpeed } : {}),
        ...(ussLoop !== undefined ? { loop: ussLoop } : {}),
        ...(ussRewind !== undefined ? { rewind: ussRewind } : {}),
        ...(ussAutoHeight !== undefined ? { autoHeight: ussAutoHeight } : {}),
        ...(ussCenteredSlides !== undefined ? { centeredSlides: ussCenteredSlides } : {}),
        ...(ussFollowFinger !== undefined ? { followFinger: ussFollowFinger } : {}),
        ...(ussFreeMode !== undefined ? { freeMode: ussFreeMode } : {}),
        ...(ussSlideToClicked !== undefined ? { slideToClickedSlide: ussSlideToClicked } : {}),
        ...(ussSlidesPerView !== undefined ? { slidesPerView: ussSlidesPerView } : {}),
        ...(ussSpaceBetween !== undefined ? { spaceBetween: ussSpaceBetween } : {}),
        ...(ussMousewheel !== undefined
            ? (ussMousewheel ? { mousewheel: { forceToAxis: true } } : { mousewheel: false })
            : {}),
        ...(ussKeyboard !== undefined
            ? (ussKeyboard ? { keyboard: { enabled: true, onlyInViewport: true } } : { keyboard: false })
            : {}),
        ...(ussBreakpointsJSON ? { breakpoints: ussBreakpointsJSON } : {})
      };

      const ussFinalOptions = Object.assign({}, ussDefaults, ussAttrOverrides, ussOptionsJSON || {});
      const ussSwiperInstance = new Swiper(ussContainerEl, ussFinalOptions);
      ussSliderEl._universalSwiper = ussSwiperInstance;
    });
  });
})();
</script>

<script>
// ============================================
// HIGHCHARTS MAP (Your Original Code)
// ============================================
(() => {
  let topoPromise;
  function getWorldTopo() {
    if (!topoPromise) {
      topoPromise = fetch('https://code.highcharts.com/mapdata/custom/world.topo.json')
        .then(r => r.json());
    }
    return topoPromise;
  }

  function getSelectors(block) {
    return Array.from(block.querySelectorAll('[data-map-country-selector]'));
  }

  function buildHighlightSet(block) {
    const set = new Set();
    getSelectors(block).forEach(el => {
      const code = (el.getAttribute('data-code') || '').trim().toUpperCase();
      if (code) set.add(code);
    });
    return set;
  }

  function buildValuesMap(block) {
    const values = {};
    getSelectors(block).forEach(el => {
      const code = (el.getAttribute('data-code') || '').trim().toUpperCase();
      if (!code) return;
      values[code] = (el.getAttribute('data-value') || '').trim();
    });
    return values;
  }

  function setActive(series, point, block, valuesMap) {
    const DIM_OPACITY = 0.8;

    // Reset classes and opacities
    series.points.forEach(p => {
      if (p.graphic) {
        p.graphic.removeClass('is-active');
        p.graphic.attr({ opacity: 1 });
      }
    });

    // If we have a selected point, mark it active and dim the rest
    if (point && point.graphic) {
      point.graphic.addClass('is-active');
      // Dim others
      series.points.forEach(p => {
        if (p !== point && p.graphic) {
          p.graphic.attr({ opacity: DIM_OPACITY });
        }
      });
    }

    // Update readout
    const out = block.querySelector('[data-country-value]');
    if (out && point) {
      const iso = point.code || point['iso-a3'];
      const v = (valuesMap[iso] || '').trim();
      out.textContent = v.length ? v : (point.name || '');
    }
  }

  function initBlock(block, topology) {
    const mapEl = block.querySelector('[data-map-container]');
    if (!mapEl) return;

    const highlightSet = buildHighlightSet(block);
    const valuesMap = buildValuesMap(block);
    const data = Array.from(highlightSet).map(code => ({ code, value: 1 }));

    const chart = Highcharts.mapChart(mapEl, {
      chart: { map: topology, backgroundColor: 'transparent' },
      title: { text: '' },
      credits: { enabled: false },
      legend: { enabled: false },
      accessibility: { enabled: false, keyboardNavigation: { enabled: false } },
      mapNavigation: { enabled: false },
      tooltip: {
        useHTML: true,
        backgroundColor: 'transparent',
        borderWidth: 0,
        shadow: false,
        formatter: function () {
          return `<div class="custom-tooltip">${this.point?.name || ''}</div>`;
        }
      },
      series: [{
        data,
        joinBy: ['iso-a3','code'],
        borderColor: 'rgba(134,134,134,0.5)',
        borderWidth: 0.5,
        color: {
          linearGradient: { x1: 0, y1: 0, x2: 1, y2: 0 },
          stops: [[0,'#FFA912'], [1,'#EF3800']]
        },
        nullColor: 'rgba(0,0,0,0)',
        states: {
          hover:   { borderColor: 'rgba(134,134,134,0.5)', borderWidth: 0.5 },
          select:  { enabled: false },
          inactive:{ enabled: false }
        },
        point: {
          events: {
            click: function () {
              setActive(this.series, this, block, valuesMap);
              chart.tooltip.refresh(this);
            }
          }
        }
      }]
    });

    const series = chart.series[0];

    const findPointByISO = (iso) => series.points.find(p => (p.code || p['iso-a3']) === iso);

    // Bind list interactions
    getSelectors(block).forEach(el => {
      const getISO = () => (el.getAttribute('data-code') || '').trim().toUpperCase();

      el.addEventListener('click', () => {
        const iso = getISO();
        if (!iso) return;
        const pt = findPointByISO(iso);
        if (!pt) return;
        setActive(series, pt, block, valuesMap);
        chart.tooltip.refresh(pt);
      });

      const showTip = () => {
        const iso = getISO();
        if (!iso) return;
        const pt = findPointByISO(iso);
        if (!pt) return;
        pt.setState('hover');
        chart.tooltip.refresh(pt);
      };

      const hideTip = () => {
        const iso = getISO();
        if (!iso) return;
        const pt = findPointByISO(iso);
        if (pt) pt.setState();
        chart.tooltip.hide(0);
      };

      el.addEventListener('mouseenter', showTip);
      el.addEventListener('mouseleave', hideTip);
      el.addEventListener('focusin', showTip);
      el.addEventListener('focusout', hideTip);
    });
  }

  getWorldTopo().then(topology => {
    document.querySelectorAll('.locations_map-block').forEach(block => initBlock(block, topology));
  });
})();
</script>

<script>
// ============================================
// NEWSROOM INTEGRATION
// ============================================
const jsonUrl = "https://rss.globenewswire.com/JsonFeed/organization/aRc3VEsdJx4qXYUc-W1GfA==/content/fulltext/attachments/all/StartDate/20240822"; 

fetch(jsonUrl)
  .then(response => response.json())
  .then(data => {
    const list = document.querySelector(".newsroom-render_list");
    if (!list) return;
    
    list.innerHTML = "";

    data.slice(0, 3).forEach(item => {
      const newsItem = document.createElement("div");
      newsItem.classList.add("newsroom-render_item");

      const imageUrl = item.Attachments?.[0]?.Url 
        || "https://cdn.prod.website-files.com/6893c2c851dca9d751167409/6894ddaf39fa3a2fde6541ad_greyimg.jpg";

      newsItem.innerHTML = `
        <a data-hover-card="card" href="${item.Url}" class="newsroom-render_link w-inline-block">
          <div class="newsroom-render_image-wrapper" data-hover-card="image">
            <img loading="lazy" alt="${item.Title}" src="${imageUrl}" class="newsroom-render_image">
          </div>
          <div class="newsroom-render_item-content">
            <h3 class="newsroom-render_heading">${item.Title}</h3>
            <div class="spacer-xsmall"></div>
            <p class="newsroom-render_summary">${item.ContentSummary}</p>
            <div class="spacer-small"></div>
            <div class="button-group">
              <div class="button is-link">
                <div>Read more</div>
                <div class="icon-embed-xxsmall w-embed">
                  <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
                    <path d="M6 3L11 8L6 13" stroke="CurrentColor" stroke-width="1.5"></path>
                  </svg>
                </div>
              </div>
            </div>
          </div>
        </a>
      `;

      list.appendChild(newsItem);
    });
  })
  .catch(error => {
    console.error("Error fetching newsroom JSON:", error);
  });
</script>

<script>
// ============================================
// RIVE ANIMATIONS
// ============================================
document.addEventListener('DOMContentLoaded', function () {
  const riveElements = document.querySelectorAll('.rive-animation');

  riveElements.forEach(canvas => {
    const src = canvas.getAttribute('data-src');
    const type = canvas.getAttribute('data-type');
    const stateMachine = canvas.getAttribute('data-state-machine');
    const artboard = canvas.getAttribute('data-artboard');
    const autoplay = canvas.getAttribute('data-autoplay') === 'true';
    const scrollThreshold = parseFloat(canvas.getAttribute('data-scroll-threshold')) || 0.4;

    let riveInstance = null;
    let hasPlayed = false;

    function fitCanvasToCSS() {
      const dpr = window.devicePixelRatio || 1;
      const rect = canvas.getBoundingClientRect();
      canvas.width = rect.width * dpr;
      canvas.height = rect.height * dpr;
    }

    function loadRive() {
      if (riveInstance) {
        riveInstance.cleanup();
      }
      fitCanvasToCSS();
      riveInstance = new rive.Rive({
        src: src,
        canvas: canvas,
        autoplay: autoplay,
        artboard: artboard,
        stateMachines: stateMachine ? [stateMachine] : []
      });
    }

    function init() {
      if (hasPlayed) return;
      hasPlayed = true;
      loadRive();
    }

    if (type === 'page-load') {
      init();
    } else if (type === 'scroll') {
      const observer = new IntersectionObserver((entries, obs) => {
        entries.forEach(entry => {
          if (entry.isIntersecting && entry.intersectionRatio >= scrollThreshold) {
            init();
            obs.unobserve(canvas);
          }
        });
      }, {
        threshold: buildThresholdList(scrollThreshold)
      });
      observer.observe(canvas);
    }

    let resizeTimer;
    window.addEventListener('resize', () => {
      clearTimeout(resizeTimer);
      resizeTimer = setTimeout(() => {
        if (hasPlayed && riveInstance) {
          fitCanvasToCSS();
          riveInstance.resizeDrawingSurfaceToCanvas();
        }
      }, 200);
    });
  });

  function buildThresholdList(mainThreshold) {
    const thresholds = [];
    for (let i = 0; i <= 1.0; i += 0.1) {
      thresholds.push(i);
    }
    if (!thresholds.includes(mainThreshold)) {
      thresholds.push(mainThreshold);
    }
    return thresholds.sort();
  }
});
</script></body></html>