{"id":1548,"date":"2026-07-17T10:47:52","date_gmt":"2026-07-17T10:47:52","guid":{"rendered":"https:\/\/stadiaorg.com\/?page_id=1548"},"modified":"2026-08-19T17:19:31","modified_gmt":"2026-08-19T17:19:31","slug":"stadia-premium-arena","status":"publish","type":"page","link":"https:\/\/staging.stadiaorg.com\/de\/stadia-premium-arena\/","title":{"rendered":"Stadia Premium Arena"},"content":{"rendered":"\n<div id=\"stadia-chess-streamlit-page\">\n<style>\n#stadia-chess-streamlit-page{\n  width:100%;\n  max-width:none;\n  margin:0;\n  padding:0;\n  background:#fff;\n}\n\nbody:has(#stadia-chess-streamlit-page) .entry-title,\nbody:has(#stadia-chess-streamlit-page) .wp-block-post-title,\nbody:has(#stadia-chess-streamlit-page) header.entry-header,\nbody:has(#stadia-chess-streamlit-page) .page-header{\n  display:none!important;\n}\n\nbody:has(#stadia-chess-streamlit-page) .entry-content,\nbody:has(#stadia-chess-streamlit-page) .wp-block-post-content,\nbody:has(#stadia-chess-streamlit-page) main,\nbody:has(#stadia-chess-streamlit-page) article{\n  width:100%!important;\n  max-width:none!important;\n  margin:0!important;\n  padding:0!important;\n}\n\n#stadiaChessFrame{\n  display:block;\n  width:100%;\n  height:1400px;\n  min-height:100vh;\n  border:0;\n  margin:0;\n  padding:0;\n  background:#fff;\n}\n\n@media(max-width:900px){\n  #stadiaChessFrame{\n    height:1450px;\n  }\n}\n<\/style>\n\n<iframe\n  id=\"stadiaChessFrame\"\n  title=\"Stadia Private Chess\"\n  loading=\"eager\"\n  allow=\"clipboard-read; clipboard-write\"\n  src=\"https:\/\/stadia-chess-gui-3uaqqyaagnedaexn3vipja.streamlit.app\/?embed=true&#038;lang=EN\"\n><\/iframe>\n\n<script>\n(function () {\n  const STREAMLIT_APP =\n    'https:\/\/stadia-chess-gui-3uaqqyaagnedaexn3vipja.streamlit.app\/';\n\n  \/*\n   * Robust Stadia bridge:\n   * - New permanent player links use #seat=...&lang=...\n   * - Old ?seat=...&lang=... links remain supported\n   * - The fragment survives WordPress \/ TranslatePress redirects\n   * - A private browser player ID is passed for free\/Premium access\n   *\/\n  const searchParams = new URLSearchParams(window.location.search);\n  const hashText = (window.location.hash || '').replace(\/^#\/, '');\n  const hashParams = new URLSearchParams(hashText);\n\n  const appParams = new URLSearchParams();\n  appParams.set('embed', 'true');\n\n  \/* Persistent random player identity for free\/Premium access. *\/\n  const PLAYER_KEY = 'sv_chess_player_id_v1';\n\n  function validPlayerId(value) {\n    return \/^[A-Za-z0-9_-]{20,80}$\/.test(value || '');\n  }\n\n  function newPlayerId() {\n    if (window.crypto && typeof window.crypto.randomUUID === 'function') {\n      return window.crypto.randomUUID().replace(\/-\/g, '');\n    }\n\n    if (window.crypto && typeof window.crypto.getRandomValues === 'function') {\n      const bytes = new Uint8Array(16);\n      window.crypto.getRandomValues(bytes);\n      return Array.from(bytes)\n        .map(b => b.toString(16).padStart(2, '0'))\n        .join('');\n    }\n\n    return (\n      Date.now().toString(36) +\n      Math.random().toString(36).slice(2) +\n      Math.random().toString(36).slice(2)\n    ).replace(\/[^A-Za-z0-9_-]\/g, '').slice(0, 48);\n  }\n\n  function loadPlayerId() {\n    const explicit =\n      hashParams.get('player') ||\n      searchParams.get('player') ||\n      '';\n\n    if (validPlayerId(explicit)) {\n      try { localStorage.setItem(PLAYER_KEY, explicit); } catch (e) {}\n      return explicit;\n    }\n\n    try {\n      const stored = localStorage.getItem(PLAYER_KEY) || '';\n      if (validPlayerId(stored)) return stored;\n\n      const created = newPlayerId();\n      localStorage.setItem(PLAYER_KEY, created);\n      return created;\n    } catch (e) {\n      if (!window.__svChessPlayerId) {\n        window.__svChessPlayerId = newPlayerId();\n      }\n      return window.__svChessPlayerId;\n    }\n  }\n\n  const playerId = loadPlayerId();\n  if (validPlayerId(playerId)) {\n    appParams.set('player', playerId);\n  }\n\n  const seat =\n    hashParams.get('seat') ||\n    searchParams.get('seat') ||\n    '';\n\n  if (seat) {\n    appParams.set('seat', seat);\n  }\n\n  let lang = (\n    hashParams.get('lang') ||\n    searchParams.get('lang') ||\n    ''\n  ).toUpperCase();\n\n  if (!lang) {\n    const htmlLang = (document.documentElement.lang || 'en').toLowerCase();\n\n    if (htmlLang.indexOf('de') === 0) lang = 'DE';\n    else if (htmlLang.indexOf('it') === 0) lang = 'IT';\n    else if (htmlLang.indexOf('fr') === 0) lang = 'FR';\n    else if (htmlLang.indexOf('es') === 0) lang = 'ES';\n    else lang = 'EN';\n  }\n\n  appParams.set('lang', lang);\n\n  try {\n    const frame = document.getElementById('stadiaChessFrame');\n\n    if (frame) {\n      frame.src =\n        STREAMLIT_APP + '?' + appParams.toString();\n    }\n  } catch (e) {\n    \/*\n     * Safe fallback:\n     * the iframe already has a working src in the HTML,\n     * so Premium Arena never becomes a blank white page.\n     *\/\n    console.warn('Stadia Chess bridge fallback used.', e);\n  }\n})();\n<\/script>\n<\/div>\n\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1548","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/staging.stadiaorg.com\/de\/wp-json\/wp\/v2\/pages\/1548","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/staging.stadiaorg.com\/de\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/staging.stadiaorg.com\/de\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/staging.stadiaorg.com\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/staging.stadiaorg.com\/de\/wp-json\/wp\/v2\/comments?post=1548"}],"version-history":[{"count":13,"href":"https:\/\/staging.stadiaorg.com\/de\/wp-json\/wp\/v2\/pages\/1548\/revisions"}],"predecessor-version":[{"id":1749,"href":"https:\/\/staging.stadiaorg.com\/de\/wp-json\/wp\/v2\/pages\/1548\/revisions\/1749"}],"wp:attachment":[{"href":"https:\/\/staging.stadiaorg.com\/de\/wp-json\/wp\/v2\/media?parent=1548"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}