@energy8platform/platform-core 0.25.4 → 0.26.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -710,7 +710,7 @@ const GRADIENT_DEFS = `
710
710
  <stop stop-color="#316FB0"/><stop stop-color="#1FCDE6" offset=".5"/><stop stop-color="#29FEE7" offset="1"/>
711
711
  </linearGradient>`;
712
712
  /** Max width of the loader bar in SVG units */
713
- const LOADER_BAR_MAX_WIDTH = 174;
713
+ const LOADER_BAR_MAX_WIDTH$1 = 174;
714
714
  /**
715
715
  * Build the Energy8 SVG logo with a loader bar, using unique IDs.
716
716
  *
@@ -743,61 +743,27 @@ ${defs}
743
743
  </svg>`;
744
744
  }
745
745
 
746
- const PRELOADER_ID = '__ge-css-preloader__';
747
- const RECT_ID = 'ge-pl-loader-rect';
748
- const TEXT_ID = 'ge-pl-loader-text';
749
- const REMOVE_FADE_TIMEOUT_MS = 600;
750
- const LOGO_SVG = buildLogoSVG({
746
+ /** Element ids the lifecycle handle binds to (also asserted by tests). */
747
+ const RECT_ID$1 = 'ge-pl-loader-rect';
748
+ const TEXT_ID$1 = 'ge-pl-loader-text';
749
+ const LOGO_SVG$1 = buildLogoSVG({
751
750
  idPrefix: 'pl',
752
751
  svgClass: 'ge-logo-svg',
753
752
  clipRectClass: 'ge-clip-rect',
754
- clipRectId: RECT_ID,
753
+ clipRectId: RECT_ID$1,
755
754
  textClass: 'ge-preloader-svg-text',
756
- textId: TEXT_ID,
755
+ textId: TEXT_ID$1,
757
756
  });
758
- let state = null;
759
- function clampProgress(p) {
760
- if (!Number.isFinite(p))
761
- return 0;
762
- return Math.max(0, Math.min(1, p));
763
- }
764
- function createCSSPreloader(container, config) {
765
- if (document.getElementById(PRELOADER_ID))
766
- return;
767
- const bgColor = typeof config?.backgroundColor === 'string'
768
- ? config.backgroundColor
769
- : typeof config?.backgroundColor === 'number'
770
- ? `#${config.backgroundColor.toString(16).padStart(6, '0')}`
771
- : '#0a0a1a';
772
- const bgGradient = config?.backgroundGradient ?? `linear-gradient(135deg, ${bgColor} 0%, #1a1a3e 100%)`;
773
- const customHTML = config?.cssPreloaderHTML ?? '';
774
- const overlay = document.createElement('div');
775
- overlay.id = PRELOADER_ID;
776
- overlay.innerHTML = customHTML || `
757
+ /** The default Energy8-branded preloader: animated wordmark + shimmering loader bar. */
758
+ const energy8Variant = {
759
+ buildContentHTML() {
760
+ return `
777
761
  <div class="ge-preloader-content">
778
- ${LOGO_SVG}
762
+ ${LOGO_SVG$1}
779
763
  </div>
780
764
  `;
781
- const styleEl = document.createElement('style');
782
- styleEl.textContent = `
783
- #${PRELOADER_ID} {
784
- position: absolute;
785
- top: 0; left: 0;
786
- width: 100%; height: 100%;
787
- background: ${bgGradient};
788
- display: flex;
789
- align-items: center;
790
- justify-content: center;
791
- z-index: 10000;
792
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
793
- transition: opacity 0.4s ease-out;
794
- }
795
-
796
- #${PRELOADER_ID}.ge-preloader-hidden {
797
- opacity: 0;
798
- pointer-events: none;
799
- }
800
-
765
+ },
766
+ css: `
801
767
  .ge-preloader-content {
802
768
  display: flex;
803
769
  flex-direction: column;
@@ -848,6 +814,219 @@ function createCSSPreloader(container, config) {
848
814
  0%, 100% { opacity: 0.5; }
849
815
  50% { opacity: 1; }
850
816
  }
817
+ `,
818
+ mount(overlay) {
819
+ const rectEl = overlay.querySelector(`#${RECT_ID$1}`);
820
+ const textEl = overlay.querySelector(`#${TEXT_ID$1}`);
821
+ // Custom HTML mode (or missing logo) — no progress target; lifecycle inert.
822
+ if (!rectEl || !textEl)
823
+ return null;
824
+ let driven = false;
825
+ return {
826
+ setProgress(p, showPercentage) {
827
+ if (!driven) {
828
+ rectEl.classList.add('driven');
829
+ driven = true;
830
+ }
831
+ rectEl.setAttribute('width', String(p * LOADER_BAR_MAX_WIDTH$1));
832
+ if (showPercentage) {
833
+ textEl.textContent = `${Math.round(p * 100)}%`;
834
+ }
835
+ },
836
+ showTapText(text) {
837
+ textEl.textContent = text;
838
+ textEl.classList.add('ge-svg-pulse');
839
+ },
840
+ };
841
+ },
842
+ };
843
+
844
+ /** Element ids the lifecycle handle binds to. */
845
+ const RECT_ID = 'ge-vm-loader-rect';
846
+ const TEXT_ID = 'ge-vm-loader-text';
847
+ /** Max width (SVG units) of the voidmoon loader bar fill. Spans the first 'o' → end of the crescent. */
848
+ const LOADER_BAR_MAX_WIDTH = 751;
849
+ /**
850
+ * "voidmoon" wordmark — the official logo, embedded verbatim as SVG outlines:
851
+ * thin white letters with the final "o" of "moon" rendered as a purple crescent
852
+ * (#9D63FE). The glyphs live in a flipped group (`translate(0,941) scale(1,-1)`)
853
+ * exactly as exported; the loader bar + status text are added beneath it in the
854
+ * outer (un-flipped) viewBox space.
855
+ */
856
+ const LOGO_SVG = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="301 339 1075 335" class="ge-vm-logo-svg" style="overflow:visible" role="img">
857
+ <title>voidmoon</title>
858
+ <g transform="translate(0,941) scale(1,-1)">
859
+ <g fill="#ffffff" fill-rule="evenodd">
860
+ <path d="M627 562 c-4 -2 -7 -6 -7 -12 0 -13 14 -18 23 -10 3 3 3 5 4 9 0 7 -2 11 -7 13 -5 2 -9 2 -13 0z"/>
861
+ <path d="M780 531 l0 -31 -6 5 c-14 14 -35 17 -56 10 -24 -8 -40 -28 -42 -53 0 -11 1 -19 6 -30 8 -16 22 -27 40 -32 8 -2 23 -2 31 0 18 4 34 17 42 33 2 5 4 11 5 14 1 3 1 24 1 61 l0 55 -10 0 -11 0 0 -32z m-24 -38 c20 -10 28 -31 20 -50 -3 -6 -13 -16 -19 -19 -21 -10 -45 -2 -56 18 -2 4 -2 7 -3 14 -1 14 4 24 15 33 8 6 15 8 27 8 9 -1 10 -1 16 -4z"/>
862
+ <path d="M520 518 c-26 -6 -45 -25 -50 -51 -1 -9 -1 -11 0 -19 3 -12 7 -21 15 -30 8 -8 16 -13 28 -17 6 -2 9 -2 19 -2 10 0 13 0 20 2 21 8 36 24 41 46 1 8 1 13 0 22 -5 23 -21 40 -44 47 -6 2 -23 3 -29 2z m29 -25 c9 -4 16 -11 20 -19 2 -5 3 -6 3 -15 0 -10 -1 -11 -3 -16 -8 -15 -23 -24 -40 -23 -9 1 -15 3 -22 8 -22 15 -21 48 2 63 7 4 14 6 24 6 8 -1 10 -1 16 -4z"/>
863
+ <path d="M869 518 c-21 -4 -35 -18 -40 -38 -1 -6 -1 -14 -1 -43 l1 -35 10 0 11 0 0 37 c0 33 1 38 2 41 3 7 7 11 13 14 5 2 8 3 13 3 11 0 20 -5 25 -16 l3 -5 0 -37 1 -37 10 0 10 0 0 37 c0 35 1 37 3 42 5 10 14 16 26 16 11 0 21 -7 25 -17 2 -5 2 -7 2 -41 0 -19 0 -36 1 -37 0 -1 3 -1 11 -1 l10 1 0 35 c0 23 0 38 -1 42 -2 9 -8 21 -14 27 -20 17 -51 17 -68 -1 l-5 -5 -5 5 c-9 9 -19 13 -31 14 -5 0 -10 0 -12 -1z"/>
864
+ <path d="M1077 517 c-9 -1 -20 -7 -27 -12 -7 -6 -14 -16 -18 -25 -4 -11 -5 -25 -3 -35 5 -21 21 -37 42 -44 38 -12 78 14 81 53 1 15 -4 31 -14 43 -14 17 -38 25 -61 20z m25 -22 c19 -5 31 -24 28 -42 -4 -26 -34 -41 -59 -29 -20 10 -27 32 -17 52 8 16 29 25 48 19z"/>
865
+ <path d="M1282 516 c-18 -5 -34 -21 -38 -39 -1 -4 -1 -18 -1 -40 l1 -35 10 -1 10 0 0 32 c0 20 0 35 1 38 2 11 8 18 18 23 7 3 18 3 26 0 6 -3 12 -9 15 -16 2 -4 3 -6 3 -40 l1 -36 10 0 11 0 0 33 c0 38 0 43 -6 54 -7 14 -19 24 -34 28 -7 1 -20 1 -27 -1z"/>
866
+ <path d="M329 515 c0 -1 2 -5 4 -9 2 -5 13 -28 24 -53 12 -24 21 -45 22 -46 2 -4 10 -7 15 -7 4 0 11 3 13 6 3 2 50 105 50 108 0 1 -3 1 -11 1 l-11 0 -7 -14 c-3 -8 -12 -28 -20 -45 -7 -17 -13 -31 -14 -31 -1 -1 -3 5 -17 35 -19 43 -23 53 -24 54 -1 1 -5 1 -13 1 -6 0 -11 0 -11 0z"/>
867
+ <path d="M623 514 c0 -1 0 -26 0 -57 l1 -55 10 0 10 0 0 56 0 57 -10 0 c-7 0 -10 0 -11 -1z"/>
868
+ </g>
869
+ <g fill="#9D63FE" fill-rule="evenodd">
870
+ <path d="M1150 515 c-3 0 -6 -1 -6 -1 0 -1 2 -2 5 -2 10 -4 26 -17 31 -27 11 -21 8 -44 -7 -62 -5 -7 -17 -16 -24 -18 -3 -1 -5 -2 -4 -2 0 -2 16 -3 24 -3 35 3 59 40 49 74 -2 8 -7 18 -13 24 -5 6 -15 13 -23 16 -8 3 -24 4 -32 1z"/>
871
+ </g>
872
+ </g>
873
+
874
+ <rect x="469" y="600" width="751" height="9" rx="4.5" fill="rgba(255,255,255,0.12)"/>
875
+ <clipPath id="vm-loader-clip">
876
+ <rect id="${RECT_ID}" x="469" y="600" width="0" height="9" rx="4.5" class="ge-vm-clip-rect"/>
877
+ </clipPath>
878
+ <rect x="469" y="600" width="751" height="9" rx="4.5" fill="#9D63FE" clip-path="url(#vm-loader-clip)"/>
879
+
880
+ <text id="${TEXT_ID}" x="844.5" y="650" text-anchor="middle" class="ge-vm-text">Loading...</text>
881
+ </svg>`;
882
+ const voidmoonVariant = {
883
+ buildContentHTML() {
884
+ return `
885
+ <div class="ge-vm-content">
886
+ ${LOGO_SVG}
887
+ </div>
888
+ `;
889
+ },
890
+ css: `
891
+ .ge-vm-content {
892
+ display: flex;
893
+ flex-direction: column;
894
+ align-items: center;
895
+ width: 82%;
896
+ max-width: 680px;
897
+ }
898
+
899
+ .ge-vm-logo-svg {
900
+ width: 100%;
901
+ height: auto;
902
+ filter: drop-shadow(0 0 26px rgba(157, 99, 254, 0.3));
903
+ }
904
+
905
+ /* Shimmer the loader bar while waiting */
906
+ .ge-vm-clip-rect {
907
+ animation: ge-vm-fill 2s ease-in-out infinite;
908
+ }
909
+
910
+ @keyframes ge-vm-fill {
911
+ 0% { width: 0; }
912
+ 50% { width: 751; }
913
+ 100% { width: 0; }
914
+ }
915
+
916
+ /* Stop shimmer once JS-driven progress takes over. */
917
+ .ge-vm-clip-rect.driven {
918
+ animation: none;
919
+ }
920
+
921
+ .ge-vm-text {
922
+ fill: rgba(255, 255, 255, 0.6);
923
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
924
+ font-size: 20px;
925
+ font-weight: 600;
926
+ letter-spacing: 3px;
927
+ animation: ge-vm-pulse 1.5s ease-in-out infinite;
928
+ }
929
+
930
+ @keyframes ge-vm-pulse {
931
+ 0%, 100% { opacity: 0.4; }
932
+ 50% { opacity: 1; }
933
+ }
934
+
935
+ /* Tap-to-start CTA pulse. Compound selector outweighs the ambient
936
+ .ge-vm-text rule, swapping the animation cleanly. */
937
+ .ge-vm-text.ge-vm-tap-pulse {
938
+ animation: ge-vm-tap 1.2s ease-in-out infinite;
939
+ }
940
+
941
+ @keyframes ge-vm-tap {
942
+ 0%, 100% { opacity: 0.5; }
943
+ 50% { opacity: 1; }
944
+ }
945
+ `,
946
+ mount(overlay) {
947
+ const rectEl = overlay.querySelector(`#${RECT_ID}`);
948
+ const textEl = overlay.querySelector(`#${TEXT_ID}`);
949
+ if (!rectEl || !textEl)
950
+ return null;
951
+ let driven = false;
952
+ return {
953
+ setProgress(p, showPercentage) {
954
+ if (!driven) {
955
+ rectEl.classList.add('driven');
956
+ driven = true;
957
+ }
958
+ rectEl.setAttribute('width', String(p * LOADER_BAR_MAX_WIDTH));
959
+ if (showPercentage) {
960
+ textEl.textContent = `${Math.round(p * 100)}%`;
961
+ }
962
+ },
963
+ showTapText(text) {
964
+ textEl.textContent = text;
965
+ textEl.classList.add('ge-vm-tap-pulse');
966
+ },
967
+ };
968
+ },
969
+ };
970
+
971
+ /**
972
+ * Registry of selectable preloader variants. Add a new variant by writing a
973
+ * file in this folder and adding one entry here — `PreloaderVariantName` and
974
+ * `LoadingScreenConfig.preloaderVariant` widen automatically.
975
+ */
976
+ const VARIANTS = {
977
+ energy8: energy8Variant,
978
+ voidmoon: voidmoonVariant,
979
+ };
980
+ /** Default variant used when `preloaderVariant` is omitted or unknown. */
981
+ const DEFAULT_VARIANT_NAME = 'energy8';
982
+
983
+ const PRELOADER_ID = '__ge-css-preloader__';
984
+ const REMOVE_FADE_TIMEOUT_MS = 600;
985
+ let state = null;
986
+ function clampProgress(p) {
987
+ if (!Number.isFinite(p))
988
+ return 0;
989
+ return Math.max(0, Math.min(1, p));
990
+ }
991
+ function createCSSPreloader(container, config) {
992
+ if (document.getElementById(PRELOADER_ID))
993
+ return;
994
+ const bgColor = typeof config?.backgroundColor === 'string'
995
+ ? config.backgroundColor
996
+ : typeof config?.backgroundColor === 'number'
997
+ ? `#${config.backgroundColor.toString(16).padStart(6, '0')}`
998
+ : '#0a0a1a';
999
+ const bgGradient = config?.backgroundGradient ?? `linear-gradient(135deg, ${bgColor} 0%, #1a1a3e 100%)`;
1000
+ const customHTML = config?.cssPreloaderHTML ?? '';
1001
+ // Pick the visual identity. Unknown names fall back to the default so a bad
1002
+ // config value degrades to a working preloader rather than a blank overlay.
1003
+ const variant = VARIANTS[config?.preloaderVariant ?? DEFAULT_VARIANT_NAME] ??
1004
+ VARIANTS[DEFAULT_VARIANT_NAME];
1005
+ const overlay = document.createElement('div');
1006
+ overlay.id = PRELOADER_ID;
1007
+ overlay.innerHTML = customHTML || variant.buildContentHTML(config);
1008
+ const styleEl = document.createElement('style');
1009
+ // Shared overlay infrastructure (positioning / background / fade) plus the
1010
+ // variant's own content styling and animations.
1011
+ styleEl.textContent = `
1012
+ #${PRELOADER_ID} {
1013
+ position: absolute;
1014
+ top: 0; left: 0;
1015
+ width: 100%; height: 100%;
1016
+ background: ${bgGradient};
1017
+ display: flex;
1018
+ align-items: center;
1019
+ justify-content: center;
1020
+ z-index: 10000;
1021
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
1022
+ transition: opacity 0.4s ease-out;
1023
+ }
1024
+
1025
+ #${PRELOADER_ID}.ge-preloader-hidden {
1026
+ opacity: 0;
1027
+ pointer-events: none;
1028
+ }
1029
+ ${variant.css}
851
1030
  `;
852
1031
  // The absolute overlay needs a positioned ancestor. Only override a STATIC container, and
853
1032
  // remember the prior inline value so removeCSSPreloader can restore it (an inline `relative`
@@ -856,41 +1035,18 @@ function createCSSPreloader(container, config) {
856
1035
  container.style.position = container.style.position || 'relative';
857
1036
  container.appendChild(styleEl);
858
1037
  container.appendChild(overlay);
859
- const rectEl = overlay.querySelector(`#${RECT_ID}`);
860
- const textEl = overlay.querySelector(`#${TEXT_ID}`);
861
- if (!rectEl || !textEl) {
862
- // Custom HTML mode — no logo SVG, lifecycle API becomes mostly inert.
863
- // We still record state so removeCSSPreloader works.
864
- state = {
865
- container,
866
- prevPosition,
867
- overlay,
868
- styleEl,
869
- rectEl: null,
870
- textEl: null,
871
- showPercentage: false,
872
- tapToStart: config?.tapToStart !== false,
873
- tapToStartText: config?.tapToStartText ?? 'TAP TO START',
874
- driven: false,
875
- tapState: 'idle',
876
- tapPromise: null,
877
- tapResolve: null,
878
- tapHandler: null,
879
- removed: false,
880
- };
881
- return;
882
- }
1038
+ // Custom HTML bypasses the variant's content, so there is no progress target
1039
+ // to bind to and the handle stays null (lifecycle API becomes inert).
1040
+ const handle = customHTML ? null : variant.mount(overlay, config);
883
1041
  state = {
884
1042
  container,
885
1043
  prevPosition,
886
1044
  overlay,
887
1045
  styleEl,
888
- rectEl,
889
- textEl,
1046
+ handle,
890
1047
  showPercentage: config?.showPercentage === true,
891
1048
  tapToStart: config?.tapToStart !== false,
892
1049
  tapToStartText: config?.tapToStartText ?? 'TAP TO START',
893
- driven: false,
894
1050
  tapState: 'idle',
895
1051
  tapPromise: null,
896
1052
  tapResolve: null,
@@ -903,17 +1059,9 @@ function setCSSPreloaderProgress(progress) {
903
1059
  return;
904
1060
  if (state.tapState === 'waiting' || state.tapState === 'resolved')
905
1061
  return;
906
- if (!state.rectEl)
1062
+ if (!state.handle)
907
1063
  return;
908
- const p = clampProgress(progress);
909
- if (!state.driven) {
910
- state.rectEl.classList.add('driven');
911
- state.driven = true;
912
- }
913
- state.rectEl.setAttribute('width', String(p * LOADER_BAR_MAX_WIDTH));
914
- if (state.showPercentage && state.textEl) {
915
- state.textEl.textContent = `${Math.round(p * 100)}%`;
916
- }
1064
+ state.handle.setProgress(clampProgress(progress), state.showPercentage);
917
1065
  }
918
1066
  function waitCSSPreloaderTap() {
919
1067
  if (!state) {
@@ -925,10 +1073,7 @@ function waitCSSPreloaderTap() {
925
1073
  return Promise.resolve();
926
1074
  if (state.tapPromise)
927
1075
  return state.tapPromise;
928
- if (state.textEl) {
929
- state.textEl.textContent = state.tapToStartText;
930
- state.textEl.classList.add('ge-svg-pulse');
931
- }
1076
+ state.handle?.showTapText(state.tapToStartText);
932
1077
  state.overlay.style.cursor = 'pointer';
933
1078
  state.tapState = 'waiting';
934
1079
  state.tapPromise = new Promise((resolve) => {
@@ -982,6 +1127,221 @@ function removeCSSPreloader(_container) {
982
1127
  });
983
1128
  }
984
1129
 
1130
+ // Bet key detection: bet-up needs Shift for arrow/equal, NumpadAdd is bare; same logic for down.
1131
+ // Exported so overlays with their own bet stepper (Buy bonus) honour the SAME keys as the bar.
1132
+ function betDir(e) {
1133
+ if (e.code === 'ArrowUp' && e.shiftKey)
1134
+ return 1;
1135
+ if (e.code === 'Equal' && e.shiftKey)
1136
+ return 1;
1137
+ if (e.code === 'NumpadAdd')
1138
+ return 1;
1139
+ if (e.code === 'ArrowDown' && e.shiftKey)
1140
+ return -1;
1141
+ if (e.code === 'Minus' && e.shiftKey)
1142
+ return -1;
1143
+ if (e.code === 'NumpadSubtract')
1144
+ return -1;
1145
+ return null;
1146
+ }
1147
+ class KeyboardController {
1148
+ host;
1149
+ doc;
1150
+ spaceHeld = false;
1151
+ holdTimer = null;
1152
+ // Bet hold-repeat state
1153
+ betHeldCode = null;
1154
+ betTimer = null;
1155
+ constructor(host, doc) {
1156
+ this.host = host;
1157
+ this.doc = doc ?? (typeof document !== 'undefined' ? document : null);
1158
+ }
1159
+ isSpinAllowed() {
1160
+ const h = this.host;
1161
+ const s = h.state;
1162
+ return (h.spacebarEnabled &&
1163
+ h.hotkeysEnabled &&
1164
+ !h.hasOpenLayer() &&
1165
+ s.mode === 'base' &&
1166
+ !s.autoplay.active);
1167
+ }
1168
+ isBetAllowed() {
1169
+ const h = this.host;
1170
+ const s = h.state;
1171
+ return (h.hotkeysEnabled &&
1172
+ !h.hasOpenLayer() &&
1173
+ s.mode === 'base' &&
1174
+ !s.busy);
1175
+ }
1176
+ clearBetTimer() {
1177
+ if (this.betTimer !== null) {
1178
+ clearTimeout(this.betTimer);
1179
+ this.betTimer = null;
1180
+ }
1181
+ }
1182
+ startBetRepeat(dir, elapsed) {
1183
+ // elapsed is ms already spent holding; use it to accelerate toward 45ms floor.
1184
+ // Start at 90ms, decrease ~1ms per 10ms held after the first repeat, floor at 45ms.
1185
+ const interval = Math.max(45, 90 - Math.floor(elapsed / 10));
1186
+ this.betTimer = setTimeout(() => {
1187
+ this.betTimer = null;
1188
+ if (this.betHeldCode !== null && this.isBetAllowed()) {
1189
+ this.host.stepBet(dir);
1190
+ this.startBetRepeat(dir, elapsed + interval);
1191
+ }
1192
+ }, interval);
1193
+ }
1194
+ onKeyDown = (e) => {
1195
+ const target = e.target;
1196
+ // Editable element guard — never intercept keyboard input
1197
+ if (target && (target.isContentEditable || /^(INPUT|TEXTAREA|SELECT)$/.test(target.tagName)))
1198
+ return;
1199
+ // For Space: claim preventDefault early (before layer/mode/busy bail) so the browser's
1200
+ // native "Space activates focused button" can't re-fire a shell control and flicker a modal.
1201
+ if (e.code === 'Space' && !e.repeat) {
1202
+ if (!this.host.spacebarEnabled || !this.host.hotkeysEnabled)
1203
+ return;
1204
+ e.preventDefault();
1205
+ if (this.host.hasOpenLayer()) {
1206
+ this.host.routeToLayer(e);
1207
+ return;
1208
+ }
1209
+ const s = this.host.state;
1210
+ if (s.mode !== 'base' || s.busy || s.autoplay.active)
1211
+ return;
1212
+ this.spaceHeld = true;
1213
+ this.host.spin();
1214
+ return;
1215
+ }
1216
+ // Bet step keys (Shift+arrows, Shift+=/-, NumpadAdd/Subtract) — non-repeat only
1217
+ if (!e.repeat) {
1218
+ const dir = betDir(e);
1219
+ if (dir !== null && this.isBetAllowed()) {
1220
+ this.betHeldCode = e.code;
1221
+ this.host.stepBet(dir);
1222
+ // First repeat after 350ms initial delay
1223
+ this.clearBetTimer();
1224
+ const capturedDir = dir;
1225
+ this.betTimer = setTimeout(() => {
1226
+ this.betTimer = null;
1227
+ if (this.betHeldCode !== null && this.isBetAllowed()) {
1228
+ this.host.stepBet(capturedDir);
1229
+ this.startBetRepeat(capturedDir, 350);
1230
+ }
1231
+ }, 350);
1232
+ return;
1233
+ }
1234
+ }
1235
+ // Non-Space keys: give the open layer first refusal. If it consumes the key, done; Escape closes
1236
+ // it. Anything the layer does NOT consume falls through to the chrome hotkeys below — so the
1237
+ // Settings/Info pages still honour Shift+I (Game info), Shift+M (sound), Shift+S, etc.
1238
+ if (this.host.hasOpenLayer()) {
1239
+ const consumed = this.host.routeToLayer(e);
1240
+ if (consumed)
1241
+ return;
1242
+ if (e.code === 'Escape') {
1243
+ this.host.closeLayer();
1244
+ return;
1245
+ }
1246
+ // not consumed → fall through to the Shift+letter chrome hotkeys
1247
+ }
1248
+ // Shift+letter bar hotkeys — fire when no layer is open, OR when an open layer left the key
1249
+ // unconsumed (see fall-through above); gated on hotkeys being enabled.
1250
+ if (!e.repeat && e.shiftKey && this.host.hotkeysEnabled) {
1251
+ const h = this.host;
1252
+ const s = h.state;
1253
+ switch (e.code) {
1254
+ case 'KeyA':
1255
+ if (h.autoplayEnabled && !s.replay) {
1256
+ h.toggleAutoplay();
1257
+ return;
1258
+ }
1259
+ break;
1260
+ case 'KeyT':
1261
+ if (h.turboLevels > 0 && !s.replay) {
1262
+ h.cycleTurbo();
1263
+ return;
1264
+ }
1265
+ break;
1266
+ case 'KeyB':
1267
+ if (h.buyBonusEnabled && s.mode === 'base' && !s.replay) {
1268
+ h.openBuyBonus();
1269
+ return;
1270
+ }
1271
+ break;
1272
+ case 'KeyI':
1273
+ h.openInfo();
1274
+ return;
1275
+ case 'KeyS':
1276
+ h.openMenu();
1277
+ return;
1278
+ case 'KeyM':
1279
+ h.toggleMute();
1280
+ return;
1281
+ }
1282
+ }
1283
+ };
1284
+ onKeyUp = (e) => {
1285
+ if (e.code === 'Space') {
1286
+ this.spaceHeld = false;
1287
+ this.clearHoldTimer();
1288
+ }
1289
+ // Stop bet repeat on key release
1290
+ if (e.code === this.betHeldCode) {
1291
+ this.betHeldCode = null;
1292
+ this.clearBetTimer();
1293
+ }
1294
+ };
1295
+ onBlur = () => {
1296
+ // Window blur — stop bet repeat AND hold-to-spin (same as releasing both keys)
1297
+ this.betHeldCode = null;
1298
+ this.clearBetTimer();
1299
+ this.spaceHeld = false;
1300
+ this.clearHoldTimer();
1301
+ };
1302
+ clearHoldTimer() {
1303
+ if (this.holdTimer !== null) {
1304
+ clearTimeout(this.holdTimer);
1305
+ this.holdTimer = null;
1306
+ }
1307
+ }
1308
+ attach() {
1309
+ this.doc.addEventListener('keydown', this.onKeyDown);
1310
+ this.doc.addEventListener('keyup', this.onKeyUp);
1311
+ // Use window if available for blur events
1312
+ if (typeof window !== 'undefined') {
1313
+ window.addEventListener('blur', this.onBlur);
1314
+ }
1315
+ }
1316
+ detach() {
1317
+ this.doc.removeEventListener('keydown', this.onKeyDown);
1318
+ this.doc.removeEventListener('keyup', this.onKeyUp);
1319
+ if (typeof window !== 'undefined') {
1320
+ window.removeEventListener('blur', this.onBlur);
1321
+ }
1322
+ this.spaceHeld = false;
1323
+ this.clearHoldTimer();
1324
+ this.betHeldCode = null;
1325
+ this.clearBetTimer();
1326
+ }
1327
+ notifyBusyChanged(busy) {
1328
+ if (busy)
1329
+ return;
1330
+ if (!this.spaceHeld)
1331
+ return;
1332
+ if (!this.isSpinAllowed())
1333
+ return;
1334
+ // Schedule the next spin after the 120 ms floor (gap between completion and next spin).
1335
+ this.clearHoldTimer();
1336
+ this.holdTimer = setTimeout(() => {
1337
+ this.holdTimer = null;
1338
+ if (this.spaceHeld && this.isSpinAllowed()) {
1339
+ this.host.spin();
1340
+ }
1341
+ }, 120);
1342
+ }
1343
+ }
1344
+
985
1345
  function createInitialState(config) {
986
1346
  return {
987
1347
  mode: config.mode,
@@ -1251,6 +1611,21 @@ const SHELL_CSS = SHELL_FONT_CSS + `
1251
1611
  #${SHELL_ROOT_ID} .ge-gi-version { text-align:center; color:var(--shell-muted); font-size:11px;
1252
1612
  letter-spacing:.08em; opacity:.7; margin:4px 0 2px; }
1253
1613
 
1614
+ /* hotkeys — keycap chips → localized action label, mirrors controls row layout */
1615
+ #${SHELL_ROOT_ID} .ge-gi-hk-block { display:flex; flex-direction:column; }
1616
+ #${SHELL_ROOT_ID} .ge-gi-hk { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:9px 0; }
1617
+ #${SHELL_ROOT_ID} .ge-gi-hk + .ge-gi-hk { border-top:1px solid var(--shell-plaque-line); }
1618
+ #${SHELL_ROOT_ID} .ge-gi-hk-chips { display:flex; align-items:center; flex-wrap:wrap; gap:4px; flex:0 0 auto; }
1619
+ #${SHELL_ROOT_ID} .ge-gi-hk-combo { display:inline-flex; align-items:center; gap:4px; }
1620
+ #${SHELL_ROOT_ID} .ge-gi-hk-chip { display:inline-flex; align-items:center; justify-content:center;
1621
+ padding:2px 7px; border-radius:6px; border:1px solid var(--shell-plaque-line);
1622
+ background:var(--shell-plaque-dark); color:#fff;
1623
+ font-family:'SFMono-Regular',Consolas,'Liberation Mono',Menlo,monospace; font-size:12px;
1624
+ font-weight:600; line-height:1.5; white-space:nowrap; min-width:1.6em; text-align:center; }
1625
+ #${SHELL_ROOT_ID} .ge-gi-hk-sep { color:var(--shell-plaque-label); font-size:11px; padding:0 1px; }
1626
+ #${SHELL_ROOT_ID} .ge-gi-hk-sep2 { color:var(--shell-plaque-label); font-size:11px; padding:0 4px; }
1627
+ #${SHELL_ROOT_ID} .ge-gi-hk-tx { color:rgba(255,255,255,.88); font-size:14px; font-weight:600; text-align:right; flex:1; }
1628
+
1254
1629
  /* controls — two blocks (gameplay / menu & info), icon/name/description per control */
1255
1630
  #${SHELL_ROOT_ID} .ge-gi-ctl-block + .ge-gi-ctl-block { margin-top:16px; padding-top:4px; border-top:1px solid var(--shell-plaque-line); }
1256
1631
  #${SHELL_ROOT_ID} .ge-gi-ctl-block-h { color:var(--shell-plaque-label); font-size:11px; letter-spacing:.12em;
@@ -1345,20 +1720,26 @@ const SHELL_CSS = SHELL_FONT_CSS + `
1345
1720
  #${SHELL_ROOT_ID} [data-ge="buybonus-overlay"] .ge-ov-body { max-width:none; padding:clamp(6px,2.5cqh,16px) clamp(12px,3vw,28px); }
1346
1721
  #${SHELL_ROOT_ID} .ge-bb-grid { display:flex; gap:14px; justify-content:safe center; overflow-x:auto; overflow-y:hidden; padding-bottom:6px;
1347
1722
  scroll-snap-type:x proximity; -webkit-overflow-scrolling:touch; }
1348
- /* the one knob that scales the whole card cqh measures the overlay (popout frame), not the
1349
- browser window, so cards shrink to fit the real container height. The floor is deliberately tiny:
1350
- on a 400×225 popout the whole card (incl. the CTA) only fits below ~5px, and a fully visible,
1351
- single-axis-scrolling card beats a bigger one whose button is clipped or needs a 2nd scrollbar. */
1723
+ /* the one knob that scales the whole card (its whole layout is em-relative). It is the SMALLER of two
1724
+ fits, so the card is always fully visible:
1725
+ 3.4cqh height: the card stays inside the band between the header and the bet footer (cqh
1726
+ measures the overlay popout frame, not the browser window);
1727
+ • 84cqw / (N*18) — width: the N cards (each 18em) fit the frame width side-by-side instead of
1728
+ overflowing into an X-scroll. --ge-bb-n is the live card count, set in BuyBonus.ts.
1729
+ Floor is deliberately tiny: on a 400×225 popout a fully visible card beats a bigger clipped one. */
1352
1730
  #${SHELL_ROOT_ID} .ge-bb-grid .ge-bonus-card { flex:0 0 18em; scroll-snap-align:start;
1353
- font-size:clamp(4px, 3.4cqh, 12px); }
1354
- /* mobile: vertical stack at a fixed, readable size — scroll the list, don't shrink the cards */
1731
+ font-size:clamp(4px, min(3.4cqh, calc(84cqw / (var(--ge-bb-n,3) * 18))), 12px); }
1732
+ /* mobile: vertical stack at a fixed, readable size — scroll the list; only shrink if the card would
1733
+ be wider than the frame (very narrow viewport), so it never overflows horizontally. */
1355
1734
  #${SHELL_ROOT_ID}.ge-mobile .ge-bb-grid { display:flex; flex-direction:column; gap:14px; overflow:visible; }
1356
- #${SHELL_ROOT_ID}.ge-mobile .ge-bb-grid .ge-bonus-card { flex:0 0 auto; font-size:12px; }
1735
+ #${SHELL_ROOT_ID}.ge-mobile .ge-bb-grid .ge-bonus-card { flex:0 0 auto; font-size:min(12px, calc(92cqw / 18)); }
1357
1736
  #${SHELL_ROOT_ID} .ge-bonus-card { display:flex; flex-direction:column; border-radius:1.4em; overflow:hidden;
1358
1737
  background:var(--shell-plaque-glass); border:1px solid var(--shell-plaque-line); color:#fff; text-align:center;
1359
1738
  pointer-events:auto; cursor:pointer; transition:box-shadow .12s ease, background .12s ease; }
1360
1739
  #${SHELL_ROOT_ID} .ge-bonus-card:hover:not(.ge-bonus-off) {
1361
1740
  box-shadow:0 0 0 1px var(--card-acc), 0 12px 34px -12px var(--card-acc); }
1741
+ #${SHELL_ROOT_ID} .ge-bonus-card--kbd-focus:not(.ge-bonus-off) {
1742
+ box-shadow:0 0 0 1px var(--card-acc), 0 12px 34px -12px var(--card-acc); }
1362
1743
  /* custom card (BonusOption.custom): keep grid sizing + accent vars, drop the default chrome so the game owns the UI */
1363
1744
  #${SHELL_ROOT_ID} .ge-bonus-card--custom { background:none; border:none; cursor:default; }
1364
1745
  #${SHELL_ROOT_ID} .ge-bonus-body { display:flex; flex-direction:column; align-items:center; flex:1; padding:1.25em 1.1em .9em; }
@@ -1414,13 +1795,15 @@ const SHELL_CSS = SHELL_FONT_CSS + `
1414
1795
  #${SHELL_ROOT_ID} [data-ge="buybonus-overlay"] .ge-ov-spacer { width:clamp(24px,7cqh,32px); }
1415
1796
  #${SHELL_ROOT_ID} [data-ge="buybonus-overlay"] .ge-ov-nav { width:clamp(24px,7cqh,32px); height:clamp(24px,7cqh,32px);
1416
1797
  font-size:clamp(14px,4cqh,18px); border-radius:clamp(7px,2cqh,9px); }
1417
- #${SHELL_ROOT_ID} [data-ge="buybonus-overlay"] .ge-bb-betbar { padding:clamp(2px,.9cqh,4px); }
1418
- #${SHELL_ROOT_ID} [data-ge="buybonus-overlay"] .ge-bb-betpill { padding:clamp(2px,.67cqh,3px) clamp(4px,1.1cqh,5px); }
1419
- #${SHELL_ROOT_ID} [data-ge="buybonus-overlay"] .ge-bb-betstep { width:clamp(24px,7cqh,32px); height:clamp(24px,7cqh,32px);
1420
- font-size:clamp(15px,4.4cqh,20px); }
1421
- #${SHELL_ROOT_ID} [data-ge="buybonus-overlay"] .ge-bb-betval { min-width:clamp(62px,17.5cqh,80px); }
1422
- #${SHELL_ROOT_ID} [data-ge="buybonus-overlay"] .ge-bb-betval b { font-size:clamp(11px,3.1cqh,14px); }
1423
- #${SHELL_ROOT_ID} [data-ge="buybonus-overlay"] .ge-bb-betval span { font-size:clamp(6px,1.55cqh,7px); }
1798
+ /* the bet pill read too large next to the shrunk cards — size it ~0. across the board (the floors
1799
+ stay readable; the maxima are what dominate on Popout L / wide frames). */
1800
+ #${SHELL_ROOT_ID} [data-ge="buybonus-overlay"] .ge-bb-betbar { padding:clamp(2px,.75cqh,3px); }
1801
+ #${SHELL_ROOT_ID} [data-ge="buybonus-overlay"] .ge-bb-betpill { padding:clamp(2px,.55cqh,3px) clamp(3px,.9cqh,4px); }
1802
+ #${SHELL_ROOT_ID} [data-ge="buybonus-overlay"] .ge-bb-betstep { width:clamp(20px,5.7cqh,26px); height:clamp(20px,5.7cqh,26px);
1803
+ font-size:clamp(12px,3.5cqh,16px); }
1804
+ #${SHELL_ROOT_ID} [data-ge="buybonus-overlay"] .ge-bb-betval { min-width:clamp(50px,14cqh,66px); }
1805
+ #${SHELL_ROOT_ID} [data-ge="buybonus-overlay"] .ge-bb-betval b { font-size:clamp(9px,2.5cqh,11px); }
1806
+ #${SHELL_ROOT_ID} [data-ge="buybonus-overlay"] .ge-bb-betval span { font-size:clamp(5px,1.25cqh,6px); }
1424
1807
 
1425
1808
  /* ═══ base/wide plaque bar — grouped dark + glass panels (reference-style) ═══ */
1426
1809
  #${SHELL_ROOT_ID} .ge-zone-plaques { gap:0; } /* panels connect; buttons overlap */
@@ -1637,7 +2020,8 @@ function createCardModal(opts) {
1637
2020
  }
1638
2021
  return { root, card, body };
1639
2022
  }
1640
- /** Full-screen overlay. Returns { root, body }; append content to body. */
2023
+ /** Full-screen overlay. Returns { root, body, scroll }; append content to body.
2024
+ * The `scroll` element is the scrollable container (overflow-y: auto). */
1641
2025
  function createOverlay(opts) {
1642
2026
  const root = document.createElement('div');
1643
2027
  root.className = 'ge-shell-overlay';
@@ -1675,7 +2059,7 @@ function createOverlay(opts) {
1675
2059
  body.className = 'ge-ov-body';
1676
2060
  scroll.appendChild(body);
1677
2061
  root.append(head, scroll);
1678
- return { root, body };
2062
+ return { root, body, scroll };
1679
2063
  }
1680
2064
 
1681
2065
  /** A floating labelled money readout (balance/win/bet). */
@@ -1927,24 +2311,22 @@ function applyBusy(shell, bar) {
1927
2311
  function openSettingsModal(shell) {
1928
2312
  const { root, body } = createOverlay({ title: shell.t('Settings'), onClose: () => root.remove() });
1929
2313
  root.dataset.ge = 'settings-modal';
1930
- // Sound on/off (starts on) full-width row with a speaker icon button
2314
+ // Sound on/off backed by the shell's shared `soundOn` state so this toggle and the Shift+M
2315
+ // hotkey stay in sync; `setSound` emits `settingChange({ key: 'sound' })` and refreshes the icon.
1931
2316
  const sound = (() => {
1932
- let on = true;
1933
2317
  const btn = document.createElement('button');
1934
- btn.className = 'ge-snd ge-active';
2318
+ btn.className = 'ge-snd';
1935
2319
  btn.dataset.ge = 'setting-sound';
1936
- btn.setAttribute('aria-label', 'Sound');
1937
- const paint = () => {
2320
+ btn.setAttribute('aria-label', shell.t('Sound'));
2321
+ const paint = (on) => {
1938
2322
  btn.innerHTML = icon(on ? 'soundOn' : 'soundOff');
1939
2323
  btn.classList.toggle('ge-active', on);
1940
2324
  btn.setAttribute('aria-pressed', String(on));
1941
2325
  };
1942
- paint();
1943
- btn.addEventListener('click', () => {
1944
- on = !on;
1945
- paint();
1946
- shell.emit('settingChange', { key: 'sound', value: on });
1947
- });
2326
+ paint(shell.soundOn);
2327
+ btn.addEventListener('click', () => shell.setSound(!shell.soundOn));
2328
+ // Live-update the icon when sound changes from here OR via Shift+M (shell clears on close).
2329
+ shell.setSoundRefresh(paint);
1948
2330
  const row = document.createElement('div');
1949
2331
  row.className = 'ge-ov-row';
1950
2332
  row.innerHTML = `<span class="ge-grow">${shell.t('Sound')}</span>`;
@@ -1994,17 +2376,25 @@ function openSettingsModal(shell) {
1994
2376
 
1995
2377
  // AUTO-GENERATED by scripts/gen-version.mjs — do not edit. Mirrors package.json "version".
1996
2378
  /** The @energy8platform/platform-core package version, stamped at build time. */
1997
- const PACKAGE_VERSION = '0.25.4';
2379
+ const PACKAGE_VERSION = '0.26.1';
1998
2380
 
2381
+ /** Default order key for the auto-injected hotkeys section: just after `controls` (-1). */
2382
+ const HOTKEYS_DEFAULT_ORDER = -0.5;
1999
2383
  const SVG_NS = 'http://www.w3.org/2000/svg';
2000
2384
  function openGameInfoModal(shell) {
2001
- const { root, body } = createOverlay({
2385
+ const { root, body, scroll } = createOverlay({
2002
2386
  title: shell.t('Game info'),
2003
2387
  onClose: () => root.remove(),
2004
2388
  onBack: () => { root.remove(); shell.openSettings(); },
2005
2389
  });
2006
2390
  root.dataset.ge = 'info-modal';
2007
- const sections = shell.config.gameInfo.sections ?? [];
2391
+ const rawSections = shell.config.gameInfo.sections ?? [];
2392
+ // Auto-inject a hotkeys section unless the game already provides one or features.hotkeys === false.
2393
+ const sectionsWithHotkeys = [...rawSections];
2394
+ if (shell.config.features.hotkeys !== false && !rawSections.some((s) => s.type === 'hotkeys')) {
2395
+ sectionsWithHotkeys.push({ type: 'hotkeys', order: HOTKEYS_DEFAULT_ORDER });
2396
+ }
2397
+ const sections = sectionsWithHotkeys;
2008
2398
  // Default placement: modes first, controls second, the rest in declaration order.
2009
2399
  // An explicit `order` overrides; ties keep declaration order (stable).
2010
2400
  const base = (s, i) => s.order ?? (s.type === 'modes' ? -2 : s.type === 'controls' ? -1 : i);
@@ -2013,7 +2403,40 @@ function openGameInfoModal(shell) {
2013
2403
  .sort((a, b) => a.k - b.k || a.i - b.i)
2014
2404
  .forEach(({ s }) => body.appendChild(renderSection(shell, s)));
2015
2405
  body.appendChild(versionFooter(shell));
2016
- return root;
2406
+ const LINE = 60;
2407
+ const PAGE = () => Math.floor(scroll.clientHeight * 0.9) || Math.floor(540 * 0.9);
2408
+ const onKey = (e) => {
2409
+ switch (e.code) {
2410
+ case 'ArrowDown':
2411
+ scroll.scrollTop += LINE;
2412
+ return true;
2413
+ case 'ArrowUp':
2414
+ scroll.scrollTop = Math.max(0, scroll.scrollTop - LINE);
2415
+ return true;
2416
+ case 'PageDown':
2417
+ scroll.scrollTop += PAGE();
2418
+ return true;
2419
+ case 'PageUp':
2420
+ scroll.scrollTop = Math.max(0, scroll.scrollTop - PAGE());
2421
+ return true;
2422
+ case 'Space':
2423
+ if (e.shiftKey) {
2424
+ scroll.scrollTop = Math.max(0, scroll.scrollTop - PAGE());
2425
+ }
2426
+ else {
2427
+ scroll.scrollTop += PAGE();
2428
+ }
2429
+ return true;
2430
+ case 'Home':
2431
+ scroll.scrollTop = 0;
2432
+ return true;
2433
+ case 'End':
2434
+ scroll.scrollTop = scroll.scrollHeight - scroll.clientHeight;
2435
+ return true;
2436
+ default: return false;
2437
+ }
2438
+ };
2439
+ return { root, onKey };
2017
2440
  }
2018
2441
  /** A muted version stamp pinned to the bottom of the game-info modal:
2019
2442
  * `${config.version ?? '1.0.0'}.${engine version without dots}` (e.g. '1.0.0.0246'). */
@@ -2029,9 +2452,11 @@ function renderSection(shell, s) {
2029
2452
  switch (s.type) {
2030
2453
  case 'modes': return sectionModes(shell, s.modes, sec('info-modes', s.title, shell.t('Modes')));
2031
2454
  case 'controls': return sectionControls(shell, sec('info-controls', s.title, shell.t('Controls')));
2455
+ case 'hotkeys': return sectionHotkeys(shell, sec('info-hotkeys', s.title, shell.t('Hotkeys')));
2032
2456
  case 'paytable': return sectionPaytable(s.rows, sec('info-paytable', s.title, shell.t('Paytable')));
2033
2457
  case 'wins': return sectionWins(s, sec('info-wins', s.title, shell.t(winFallbackTitle(s.kind))));
2034
- case 'custom': return sectionCustom(s, sec('info-custom', s.title, ''));
2458
+ // Translate the heading (e.g. the host-built DISCLAIMER title); the body stays verbatim.
2459
+ case 'custom': return sectionCustom(s, sec('info-custom', s.title != null ? shell.t(s.title) : undefined, ''));
2035
2460
  }
2036
2461
  }
2037
2462
  /** A titled glass-plaque section shell. */
@@ -2113,6 +2538,57 @@ function ctlBlock(shell, label, rows) {
2113
2538
  }
2114
2539
  return block;
2115
2540
  }
2541
+ function sectionHotkeys(shell, el) {
2542
+ const { features } = shell.config;
2543
+ /** Render one or more key names as keycap chips joined by " / ". */
2544
+ const chips = (...keys) => keys.map((k) => `<span class="ge-gi-hk-chip">${k}</span>`).join('<span class="ge-gi-hk-sep"> / </span>');
2545
+ const rows = [
2546
+ { chips: ['Space'], name: 'Spin', on: true },
2547
+ { chips: ['Shift', '↑', 'Shift', '='], name: 'Raise bet', on: true },
2548
+ { chips: ['Shift', '↓', 'Shift', '-'], name: 'Lower bet', on: true },
2549
+ { chips: ['Shift', 'A'], name: 'Autoplay', on: features.autoplay != null },
2550
+ { chips: ['Shift', 'T'], name: 'Turbo', on: features.turbo > 0 },
2551
+ { chips: ['Shift', 'B'], name: 'Buy bonus', on: features.buyBonus !== false },
2552
+ { chips: ['Shift', 'I'], name: 'Game info', on: true },
2553
+ { chips: ['Shift', 'S'], name: 'Menu', on: true },
2554
+ { chips: ['Shift', 'M'], name: 'Mute', on: true },
2555
+ { chips: ['←', '→'], name: 'Navigate', on: true },
2556
+ { chips: ['Enter'], name: 'Confirm', on: true },
2557
+ { chips: ['Esc'], name: 'Close', on: true },
2558
+ ];
2559
+ const block = document.createElement('div');
2560
+ block.className = 'ge-gi-hk-block';
2561
+ for (const r of rows.filter((x) => x.on)) {
2562
+ const row = document.createElement('div');
2563
+ row.className = 'ge-gi-hk';
2564
+ // Build the chips column
2565
+ const chipsEl = document.createElement('div');
2566
+ chipsEl.className = 'ge-gi-hk-chips';
2567
+ if (r.name === 'Raise bet' || r.name === 'Lower bet') {
2568
+ // Two combos separated by " / ": Shift+↑ / Shift+= and Shift+↓ / Shift+-
2569
+ const [k1, k2, k3, k4] = r.chips;
2570
+ chipsEl.innerHTML =
2571
+ `<span class="ge-gi-hk-combo">${chips(k1, k2)}</span>` +
2572
+ `<span class="ge-gi-hk-sep2"> / </span>` +
2573
+ `<span class="ge-gi-hk-combo">${chips(k3, k4)}</span>`;
2574
+ }
2575
+ else if (r.chips.length > 1) {
2576
+ // Chord: Shift + X
2577
+ chipsEl.innerHTML = `<span class="ge-gi-hk-combo">${chips(...r.chips)}</span>`;
2578
+ }
2579
+ else {
2580
+ chipsEl.innerHTML = chips(...r.chips);
2581
+ }
2582
+ const tx = document.createElement('div');
2583
+ tx.className = 'ge-gi-hk-tx';
2584
+ tx.textContent = shell.t(r.name);
2585
+ row.appendChild(chipsEl);
2586
+ row.appendChild(tx);
2587
+ block.appendChild(row);
2588
+ }
2589
+ el.appendChild(block);
2590
+ return el;
2591
+ }
2116
2592
  // ── paytable (cards — image on top, name, then win tiers "<count> x<mult>") ────
2117
2593
  function sectionPaytable(rows, el) {
2118
2594
  const grid = document.createElement('div');
@@ -2311,25 +2787,168 @@ function sectionCustom(s, el) {
2311
2787
  return el;
2312
2788
  }
2313
2789
 
2314
- /** Buy-bonus overlay — a grid of art-forward cards, one per option. */
2790
+ /** Buy-bonus overlay — a grid of art-forward cards, one per option.
2791
+ * Returns the overlay element + a keyboard handler for the shell's `showModal`. */
2315
2792
  function openBuyBonusOverlay(shell) {
2316
2793
  const bonuses = shell.config.features.buyBonus;
2317
2794
  if (bonuses === false || bonuses.length === 0)
2318
2795
  return null;
2319
- const { root, body } = createOverlay({ title: shell.t('Buy bonus'), onClose: () => root.remove() });
2796
+ const st = { focusIndex: -1, confirmBonus: undefined };
2797
+ const { root, body } = createOverlay({ title: shell.t('Buy bonus'), onClose: () => shell.closeModal() });
2320
2798
  root.dataset.ge = 'buybonus-overlay';
2321
2799
  // Re-render the grid whenever the bet changes so every card's price stays live.
2322
2800
  const renderGrid = () => {
2323
2801
  body.innerHTML = '';
2324
2802
  const grid = document.createElement('div');
2325
2803
  grid.className = 'ge-bb-grid';
2326
- for (const bonus of bonuses)
2327
- grid.appendChild(buildCard(shell, bonus, root));
2804
+ // Card count drives the width-fit clamp in CSS (each card is 18em; N cards must fit the frame
2805
+ // width), so the row scales to the available width instead of overflowing into an X-scroll.
2806
+ grid.style.setProperty('--ge-bb-n', String(bonuses.length));
2807
+ const affordable = [];
2808
+ for (const bonus of bonuses) {
2809
+ const card = buildCard(shell, bonus, root, st);
2810
+ grid.appendChild(card);
2811
+ if (isAffordable(shell, bonus))
2812
+ affordable.push(bonus);
2813
+ }
2328
2814
  body.appendChild(grid);
2815
+ // Initialize or restore focus index
2816
+ if (affordable.length > 0) {
2817
+ if (st.focusIndex < 0)
2818
+ st.focusIndex = 0;
2819
+ else
2820
+ st.focusIndex = Math.min(st.focusIndex, affordable.length - 1);
2821
+ applyFocusClass(root, bonuses, affordable, st.focusIndex);
2822
+ }
2823
+ else {
2824
+ st.focusIndex = -1;
2825
+ }
2329
2826
  };
2330
2827
  renderGrid();
2331
2828
  root.appendChild(buildBetBar(shell, renderGrid)); // thin bottom footer, only as tall as the pill
2332
- return root;
2829
+ /** Step the bet by `dir` and re-render the grid (live prices + affordability) when it changed.
2830
+ * Shared by the keyboard bet keys (the footer ± buttons keep their own copy). */
2831
+ const stepBetBy = (dir) => {
2832
+ const next = stepBet(shell.state, dir);
2833
+ if (next === shell.state.bet)
2834
+ return;
2835
+ shell.state.bet = next;
2836
+ shell.emit('betChange', next);
2837
+ shell.render();
2838
+ renderGrid();
2839
+ };
2840
+ /** Keyboard handler for both browse and confirm phases. */
2841
+ const onKey = (e) => {
2842
+ const affordable = bonuses.filter((b) => isAffordable(shell, b));
2843
+ // ── Confirm phase ──
2844
+ if (st.confirmBonus) {
2845
+ switch (e.code) {
2846
+ case 'Enter':
2847
+ case 'Space': {
2848
+ const bonus = st.confirmBonus;
2849
+ if (!isAffordable(shell, bonus))
2850
+ return true;
2851
+ if (bonus.type === 'feature')
2852
+ shell.activateFeature(bonus);
2853
+ else
2854
+ shell.emit('buyBonusSelect', { id: bonus.id });
2855
+ shell.closeModal();
2856
+ return true;
2857
+ }
2858
+ case 'Escape':
2859
+ // Remove the confirm dialog, return to browse
2860
+ closeConfirm(root, st);
2861
+ return true;
2862
+ default:
2863
+ return false;
2864
+ }
2865
+ }
2866
+ // ── Browse phase ──
2867
+ const last = affordable.length - 1;
2868
+ const mobile = shell.layout === 'mobile';
2869
+ // Bet stepping mirrors the bar's keys (Shift+↑/↓, Shift+=/-, Numpad ±). Checked BEFORE arrow
2870
+ // navigation so a bare arrow still moves card focus while a Shift+arrow changes the bet.
2871
+ const bet = betDir(e);
2872
+ if (bet !== null) {
2873
+ stepBetBy(bet);
2874
+ return true;
2875
+ }
2876
+ // Determine navigation direction from key code + layout (mobile uses vertical arrows)
2877
+ const fwdKey = e.code === 'ArrowRight' || (mobile && e.code === 'ArrowDown');
2878
+ const bwdKey = e.code === 'ArrowLeft' || (mobile && e.code === 'ArrowUp');
2879
+ if (fwdKey) {
2880
+ if (last < 0)
2881
+ return true;
2882
+ if (st.focusIndex < last) {
2883
+ st.focusIndex++;
2884
+ applyFocusClass(root, bonuses, affordable, st.focusIndex);
2885
+ }
2886
+ return true;
2887
+ }
2888
+ if (bwdKey) {
2889
+ if (last < 0)
2890
+ return true;
2891
+ if (st.focusIndex > 0) {
2892
+ st.focusIndex--;
2893
+ applyFocusClass(root, bonuses, affordable, st.focusIndex);
2894
+ }
2895
+ return true;
2896
+ }
2897
+ switch (e.code) {
2898
+ case 'Enter':
2899
+ case 'Space':
2900
+ if (last < 0 || st.focusIndex < 0)
2901
+ return true;
2902
+ {
2903
+ const bonus = affordable[st.focusIndex];
2904
+ openConfirm(shell, bonus, root, st);
2905
+ }
2906
+ return true;
2907
+ // Bare =/- also step the bet (the Shift+=/- and Numpad variants are handled by betDir above).
2908
+ case 'Equal':
2909
+ stepBetBy(1);
2910
+ return true;
2911
+ case 'Minus':
2912
+ stepBetBy(-1);
2913
+ return true;
2914
+ case 'Escape':
2915
+ shell.closeModal();
2916
+ return true;
2917
+ default:
2918
+ return false;
2919
+ }
2920
+ };
2921
+ return { root, onKey };
2922
+ }
2923
+ /** Apply a CSS keyboard-focus class to the currently focused affordable card. */
2924
+ function applyFocusClass(overlay, bonuses, affordable, focusIndex) {
2925
+ for (const b of bonuses) {
2926
+ const card = overlay.querySelector(`[data-ge="bonus-card-${b.id}"]`);
2927
+ if (!card)
2928
+ continue;
2929
+ card.classList.remove('ge-bonus-card--kbd-focus');
2930
+ }
2931
+ const focused = affordable[focusIndex];
2932
+ if (!focused)
2933
+ return;
2934
+ const card = overlay.querySelector(`[data-ge="bonus-card-${focused.id}"]`);
2935
+ if (card)
2936
+ card.classList.add('ge-bonus-card--kbd-focus');
2937
+ }
2938
+ /** Open the confirm dialog for the given bonus and track it in overlay state. */
2939
+ function openConfirm(shell, bonus, overlay, st) {
2940
+ closeConfirm(overlay, st); // remove any existing confirm
2941
+ st.confirmBonus = bonus;
2942
+ overlay.appendChild(buildConfirm(shell, bonus, overlay, st));
2943
+ shell.fitModals();
2944
+ }
2945
+ /** Remove the confirm dialog and clear the overlay state. */
2946
+ function closeConfirm(overlay, st) {
2947
+ // The confirm dialog is a .ge-sheet with data-ge="bonus-confirm" appended directly to overlay.
2948
+ const sheet = overlay.querySelector('[data-ge="bonus-confirm"]');
2949
+ if (sheet)
2950
+ sheet.remove();
2951
+ st.confirmBonus = undefined;
2333
2952
  }
2334
2953
  /** Bet control — a compact −/+ pill around the live stake, in a thin footer at the screen bottom.
2335
2954
  * Stepping repaints the value, re-prices the cards, and updates the control bar. */
@@ -2376,7 +2995,7 @@ function stepButton(ge, name) {
2376
2995
  }
2377
2996
  /** A grid card: title → thumbnail → description → volatility → price → full-bleed CTA.
2378
2997
  * Clicking (when affordable) opens the confirmation modal. */
2379
- function buildCard(shell, bonus, overlay) {
2998
+ function buildCard(shell, bonus, overlay, st) {
2380
2999
  const accent = effectiveAccent(bonus);
2381
3000
  const card = document.createElement('div');
2382
3001
  card.className = 'ge-bonus-card';
@@ -2389,8 +3008,7 @@ function buildCard(shell, bonus, overlay) {
2389
3008
  const select = () => {
2390
3009
  if (!isAffordable(shell, bonus))
2391
3010
  return;
2392
- overlay.appendChild(buildConfirm(shell, bonus, overlay));
2393
- shell.fitModals();
3011
+ openConfirm(shell, bonus, overlay, st);
2394
3012
  };
2395
3013
  // Game-supplied card UI: the shell keeps the wrapper (grid sizing + accent vars) and runs the
2396
3014
  // buy flow when the game calls ctx.select(); the game owns everything inside.
@@ -2435,9 +3053,9 @@ function cardBody(shell, bonus) {
2435
3053
  }
2436
3054
  /** Confirmation modal — the shared card chrome (accent title heading, no ✕) with a bonus
2437
3055
  * preview body and a full-bleed Cancel + action footer. */
2438
- function buildConfirm(shell, bonus, overlay) {
3056
+ function buildConfirm(shell, bonus, overlay, st) {
2439
3057
  const accent = effectiveAccent(bonus);
2440
- const ui = createCardModal({ ge: 'bonus-confirm', title: bonus.title, accent, onClose: () => ui.root.remove() });
3058
+ const ui = createCardModal({ ge: 'bonus-confirm', title: bonus.title, accent, onClose: () => { closeConfirm(overlay, st); } });
2441
3059
  const price = bonus.priceMultiplier * shell.state.bet;
2442
3060
  const preview = document.createElement('div');
2443
3061
  preview.className = 'ge-confirm-preview';
@@ -2453,7 +3071,7 @@ function buildConfirm(shell, bonus, overlay) {
2453
3071
  cancel.className = 'ge-modal-btn ge-modal-btn--ghost';
2454
3072
  cancel.dataset.ge = 'bonus-confirm-cancel';
2455
3073
  cancel.textContent = shell.t('Cancel');
2456
- cancel.addEventListener('click', () => ui.root.remove());
3074
+ cancel.addEventListener('click', () => closeConfirm(overlay, st));
2457
3075
  const buy = document.createElement('button');
2458
3076
  buy.className = 'ge-modal-btn ge-modal-btn--accent';
2459
3077
  buy.dataset.ge = 'bonus-confirm-buy';
@@ -2468,8 +3086,7 @@ function buildConfirm(shell, bonus, overlay) {
2468
3086
  shell.activateFeature(bonus);
2469
3087
  else
2470
3088
  shell.emit('buyBonusSelect', { id: bonus.id });
2471
- ui.root.remove();
2472
- overlay.remove();
3089
+ shell.closeModal();
2473
3090
  });
2474
3091
  actions.append(cancel, buy);
2475
3092
  ui.card.appendChild(actions);
@@ -2498,36 +3115,79 @@ function isAffordable(shell, bonus) {
2498
3115
 
2499
3116
  /** A centred picker (chips grid + accent Confirm) on the shared card modal. */
2500
3117
  function buildSheet(opts) {
2501
- const ui = createCardModal({ ge: opts.ge, title: opts.title, onClose: () => ui.root.remove() });
3118
+ const ui = createCardModal({ ge: opts.ge, title: opts.title, onClose: () => opts.onClose() });
2502
3119
  const grid = document.createElement('div');
2503
3120
  grid.className = 'ge-sheet-grid';
2504
3121
  const cols = typeof opts.columns === 'number' ? { wide: opts.columns, mobile: opts.columns } : opts.columns;
2505
3122
  grid.style.setProperty('--cols', String(cols.wide));
2506
3123
  grid.style.setProperty('--cols-m', String(cols.mobile));
2507
3124
  let selected = opts.selected;
3125
+ let focusIndex = opts.choices.findIndex((c) => c.id === selected);
3126
+ if (focusIndex < 0)
3127
+ focusIndex = 0;
2508
3128
  const chips = [];
2509
- for (const c of opts.choices) {
3129
+ /** Update chip visuals to reflect the current selected/focused index. */
3130
+ function setHighlight(newIndex) {
3131
+ focusIndex = newIndex;
3132
+ selected = opts.choices[focusIndex].id;
3133
+ for (let i = 0; i < chips.length; i++) {
3134
+ chips[i].classList.toggle('ge-on', i === focusIndex);
3135
+ }
3136
+ }
3137
+ for (let i = 0; i < opts.choices.length; i++) {
3138
+ const c = opts.choices[i];
2510
3139
  const chip = document.createElement('button');
2511
- chip.className = 'ge-chip' + (c.id === selected ? ' ge-on' : '');
3140
+ chip.className = 'ge-chip' + (i === focusIndex ? ' ge-on' : '');
2512
3141
  chip.dataset.id = c.id;
2513
3142
  chip.textContent = c.label;
3143
+ const idx = i; // capture for closure
2514
3144
  chip.addEventListener('click', () => {
2515
- selected = c.id;
2516
- for (const x of chips)
2517
- x.classList.toggle('ge-on', x.dataset.id === selected);
3145
+ setHighlight(idx);
2518
3146
  });
2519
3147
  chips.push(chip);
2520
3148
  grid.appendChild(chip);
2521
3149
  }
2522
3150
  ui.body.appendChild(grid);
3151
+ function doConfirm() {
3152
+ opts.onConfirm(selected);
3153
+ opts.onClose();
3154
+ }
2523
3155
  // Single full-bleed Confirm; dismissal is the ✕ (top-right). No Cancel button.
2524
3156
  const confirm = document.createElement('button');
2525
3157
  confirm.className = 'ge-modal-btn ge-modal-btn--accent';
2526
3158
  confirm.dataset.ge = 'sheet-confirm';
2527
3159
  confirm.textContent = opts.confirmLabel;
2528
- confirm.addEventListener('click', () => { opts.onConfirm(selected); ui.root.remove(); });
3160
+ confirm.addEventListener('click', doConfirm);
2529
3161
  ui.card.appendChild(confirm);
2530
- return ui.root;
3162
+ function onKey(e) {
3163
+ const last = opts.choices.length - 1;
3164
+ switch (e.code) {
3165
+ case 'ArrowRight':
3166
+ case 'ArrowDown':
3167
+ case 'Equal': // + on most keyboards
3168
+ case 'NumpadAdd':
3169
+ if (focusIndex < last)
3170
+ setHighlight(focusIndex + 1);
3171
+ return true;
3172
+ case 'ArrowLeft':
3173
+ case 'ArrowUp':
3174
+ case 'Minus':
3175
+ case 'NumpadSubtract':
3176
+ if (focusIndex > 0)
3177
+ setHighlight(focusIndex - 1);
3178
+ return true;
3179
+ case 'Enter':
3180
+ case 'Space':
3181
+ doConfirm();
3182
+ return true;
3183
+ case 'Escape':
3184
+ opts.onClose();
3185
+ return true;
3186
+ default:
3187
+ return false;
3188
+ }
3189
+ }
3190
+ return { root: ui.root, onKey };
2531
3191
  }
2532
3192
  /** Bet picker — all available bets as chips (6 per row, 3 on mobile), accent Confirm applies it. */
2533
3193
  function openBetModal(shell) {
@@ -2535,6 +3195,7 @@ function openBetModal(shell) {
2535
3195
  ge: 'bet-modal', title: shell.t('Bet'), columns: { wide: 6, mobile: 3 }, confirmLabel: shell.t('Confirm'),
2536
3196
  choices: shell.state.availableBets.map((b) => ({ id: String(b), label: formatCurrency(b, shell.config.currency) })),
2537
3197
  selected: String(shell.state.bet),
3198
+ onClose: () => shell.closeModal(),
2538
3199
  onConfirm: (id) => {
2539
3200
  const v = Number(id);
2540
3201
  if (v !== shell.state.bet) {
@@ -2565,6 +3226,7 @@ function openAutoplayModal(shell) {
2565
3226
  ge: 'autoplay-modal', title: shell.t('Autoplay'), columns: 3, confirmLabel: shell.t('Start'),
2566
3227
  choices: counts.map((n) => ({ id: String(n), label: Number.isFinite(n) ? String(n) : '∞' })),
2567
3228
  selected: String(shell.state.autoplay.remaining || counts[0]),
3229
+ onClose: () => shell.closeModal(),
2568
3230
  onConfirm: (id) => {
2569
3231
  let remaining = Number(id); // "Infinity" → Infinity
2570
3232
  if (maxCount != null)
@@ -2712,6 +3374,868 @@ function countUp(el, from, to, fmt, durationMs = 450) {
2712
3374
  };
2713
3375
  }
2714
3376
 
3377
+ // MACHINE-TRANSLATED — native QA required before production use.
3378
+ // Keys are the English source strings exactly as they appear at t('…') call sites.
3379
+ // Entries within each language block are sorted alphabetically by key for diff stability.
3380
+ // 'en' is omitted: the resolver returns the source string unchanged for English.
3381
+ const LOCALES = {
3382
+ da: {
3383
+ DISCLAIMER: 'Ansvarsfraskrivelse',
3384
+ Activate: 'Aktivér',
3385
+ Autoplay: 'Autoplay',
3386
+ Balance: 'Saldo',
3387
+ Bet: 'Indsats',
3388
+ 'BUY BONUS': 'KØB BONUS',
3389
+ Buy: 'Køb',
3390
+ 'Buy bonus': 'Køb bonus',
3391
+ Cancel: 'Annuller',
3392
+ Close: 'Luk',
3393
+ 'Cluster pays': 'Klyngeudbetaling',
3394
+ Confirm: 'Bekræft',
3395
+ Controls: 'Kontroller',
3396
+ 'Decrease your stake.': 'Reducer din indsats.',
3397
+ DISABLE: 'DEAKTIVER',
3398
+ 'Dismiss the current overlay.': 'Luk det aktuelle overlay.',
3399
+ 'Free spins': 'Gratisspins',
3400
+ Game: 'Spil',
3401
+ 'Game info': 'Spilinfo',
3402
+ Hotkeys: 'Tastaturgenveje',
3403
+ 'Increase your stake.': 'Forøg din indsats.',
3404
+ 'Lower bet': 'Lavere indsats',
3405
+ 'Master volume': 'Hovedvolumen',
3406
+ 'Max win': 'Maks gevinst',
3407
+ Menu: 'Menu',
3408
+ 'Menu & info': 'Menu og info',
3409
+ Modes: 'Tilstande',
3410
+ Music: 'Musik',
3411
+ Mute: 'Lydløs',
3412
+ 'Mute or unmute the game.': 'Slå lyden til/fra.',
3413
+ Navigate: 'Naviger',
3414
+ 'Open settings and game info.': 'Åbn indstillinger og spilinfo.',
3415
+ 'Open the paytable and rules.': 'Åbn gevinsttabel og regler.',
3416
+ 'Pay a fixed cost to enter a bonus feature.': 'Betal en fast pris for at aktivere en bonusfunktion.',
3417
+ Paylines: 'Gevinstlinjer',
3418
+ Paytable: 'Gevinsttabel',
3419
+ 'Pays anywhere': 'Udbetaler overalt',
3420
+ Price: 'Pris',
3421
+ 'Raise bet': 'Hæv indsats',
3422
+ Replay: 'Genspil',
3423
+ RTP: 'RTP',
3424
+ SFX: 'Lydeffekter',
3425
+ Settings: 'Indstillinger',
3426
+ Sound: 'Lyd',
3427
+ Spin: 'Drej',
3428
+ 'Spin automatically a set number of times.': 'Spin automatisk et bestemt antal gange.',
3429
+ 'Speed up spin animations.': 'Gør spilanimationer hurtigere.',
3430
+ Start: 'Start',
3431
+ 'Start a spin at the current bet.': 'Start et spin med den aktuelle indsats.',
3432
+ 'Start replay': 'Start genspil',
3433
+ 'Total win': 'Samlet gevinst',
3434
+ Turbo: 'Turbo',
3435
+ 'Ways to win': 'Vindermuligheder',
3436
+ Win: 'Gevinst',
3437
+ 'Winning shapes': 'Vindende former',
3438
+ },
3439
+ de: {
3440
+ DISCLAIMER: 'Haftungsausschluss',
3441
+ Activate: 'Aktivieren',
3442
+ Autoplay: 'Autoplay',
3443
+ Balance: 'Kontostand',
3444
+ Bet: 'Einsatz',
3445
+ 'BUY BONUS': 'BONUS KAUFEN',
3446
+ Buy: 'Kaufen',
3447
+ 'Buy bonus': 'Bonus kaufen',
3448
+ Cancel: 'Abbrechen',
3449
+ Close: 'Schließen',
3450
+ 'Cluster pays': 'Cluster-Gewinne',
3451
+ Confirm: 'Bestätigen',
3452
+ Controls: 'Steuerung',
3453
+ 'Decrease your stake.': 'Einsatz verringern.',
3454
+ DISABLE: 'DEAKTIVIEREN',
3455
+ 'Dismiss the current overlay.': 'Aktuelles Overlay schließen.',
3456
+ 'Free spins': 'Freispiele',
3457
+ Game: 'Spiel',
3458
+ 'Game info': 'Spielinfo',
3459
+ Hotkeys: 'Tastenkürzel',
3460
+ 'Increase your stake.': 'Einsatz erhöhen.',
3461
+ 'Lower bet': 'Einsatz senken',
3462
+ 'Master volume': 'Gesamtlautstärke',
3463
+ 'Max win': 'Max. Gewinn',
3464
+ Menu: 'Menü',
3465
+ 'Menu & info': 'Menü & Info',
3466
+ Modes: 'Modi',
3467
+ Music: 'Musik',
3468
+ Mute: 'Stummschalten',
3469
+ 'Mute or unmute the game.': 'Ton stummschalten oder aktivieren.',
3470
+ Navigate: 'Navigieren',
3471
+ 'Open settings and game info.': 'Einstellungen und Spielinfo öffnen.',
3472
+ 'Open the paytable and rules.': 'Gewinntabelle und Regeln öffnen.',
3473
+ 'Pay a fixed cost to enter a bonus feature.': 'Zahle einen festen Betrag, um ein Bonus-Feature zu aktivieren.',
3474
+ Paylines: 'Gewinnlinien',
3475
+ Paytable: 'Gewinntabelle',
3476
+ 'Pays anywhere': 'Zahlt überall',
3477
+ Price: 'Preis',
3478
+ 'Raise bet': 'Einsatz erhöhen',
3479
+ Replay: 'Wiederholen',
3480
+ RTP: 'RTP',
3481
+ SFX: 'Soundeffekte',
3482
+ Settings: 'Einstellungen',
3483
+ Sound: 'Ton',
3484
+ Spin: 'Drehen',
3485
+ 'Spin automatically a set number of times.': 'Automatisch eine festgelegte Anzahl von Runden spielen.',
3486
+ 'Speed up spin animations.': 'Animationen beschleunigen.',
3487
+ Start: 'Start',
3488
+ 'Start a spin at the current bet.': 'Mit dem aktuellen Einsatz drehen.',
3489
+ 'Start replay': 'Wiederholen',
3490
+ 'Total win': 'Gesamtgewinn',
3491
+ Turbo: 'Turbo',
3492
+ 'Ways to win': 'Gewinnwege',
3493
+ Win: 'Gewinn',
3494
+ 'Winning shapes': 'Gewinnmuster',
3495
+ },
3496
+ es: {
3497
+ DISCLAIMER: 'Aviso legal',
3498
+ Activate: 'Activar',
3499
+ Autoplay: 'Giro automático',
3500
+ Balance: 'Saldo',
3501
+ Bet: 'Apuesta',
3502
+ 'BUY BONUS': 'COMPRAR BONO',
3503
+ Buy: 'Comprar',
3504
+ 'Buy bonus': 'Comprar bono',
3505
+ Cancel: 'Cancelar',
3506
+ Close: 'Cerrar',
3507
+ 'Cluster pays': 'Pago en racimo',
3508
+ Confirm: 'Confirmar',
3509
+ Controls: 'Controles',
3510
+ 'Decrease your stake.': 'Reducir apuesta.',
3511
+ DISABLE: 'DESACTIVAR',
3512
+ 'Dismiss the current overlay.': 'Cerrar el panel actual.',
3513
+ 'Free spins': 'Giros gratis',
3514
+ Game: 'Juego',
3515
+ 'Game info': 'Info del juego',
3516
+ Hotkeys: 'Atajos de teclado',
3517
+ 'Increase your stake.': 'Aumentar apuesta.',
3518
+ 'Lower bet': 'Bajar apuesta',
3519
+ 'Master volume': 'Volumen principal',
3520
+ 'Max win': 'Ganancia máxima',
3521
+ Menu: 'Menú',
3522
+ 'Menu & info': 'Menú e info',
3523
+ Modes: 'Modos',
3524
+ Music: 'Música',
3525
+ Mute: 'Silenciar',
3526
+ 'Mute or unmute the game.': 'Activar o silenciar el sonido.',
3527
+ Navigate: 'Navegar',
3528
+ 'Open settings and game info.': 'Abrir ajustes e info del juego.',
3529
+ 'Open the paytable and rules.': 'Abrir tabla de pagos y reglas.',
3530
+ 'Pay a fixed cost to enter a bonus feature.': 'Paga un coste fijo para acceder a una función de bono.',
3531
+ Paylines: 'Líneas de pago',
3532
+ Paytable: 'Tabla de pagos',
3533
+ 'Pays anywhere': 'Paga en cualquier lugar',
3534
+ Price: 'Precio',
3535
+ 'Raise bet': 'Subir apuesta',
3536
+ Replay: 'Repetir',
3537
+ RTP: 'RTP',
3538
+ SFX: 'Efectos de sonido',
3539
+ Settings: 'Ajustes',
3540
+ Sound: 'Sonido',
3541
+ Spin: 'Girar',
3542
+ 'Spin automatically a set number of times.': 'Girar automáticamente un número determinado de veces.',
3543
+ 'Speed up spin animations.': 'Acelerar las animaciones de giro.',
3544
+ Start: 'Iniciar',
3545
+ 'Start a spin at the current bet.': 'Iniciar un giro con la apuesta actual.',
3546
+ 'Start replay': 'Iniciar repetición',
3547
+ 'Total win': 'Ganancia total',
3548
+ Turbo: 'Turbo',
3549
+ 'Ways to win': 'Formas de ganar',
3550
+ Win: 'Premio',
3551
+ 'Winning shapes': 'Figuras ganadoras',
3552
+ },
3553
+ fi: {
3554
+ DISCLAIMER: 'Vastuuvapauslauseke',
3555
+ Activate: 'Aktivoi',
3556
+ Autoplay: 'Automaattipeli',
3557
+ Balance: 'Saldo',
3558
+ Bet: 'Panos',
3559
+ 'BUY BONUS': 'OSTA BONUS',
3560
+ Buy: 'Osta',
3561
+ 'Buy bonus': 'Osta bonus',
3562
+ Cancel: 'Peruuta',
3563
+ Close: 'Sulje',
3564
+ 'Cluster pays': 'Ryhmävoitto',
3565
+ Confirm: 'Vahvista',
3566
+ Controls: 'Ohjaimet',
3567
+ 'Decrease your stake.': 'Pienennä panostasi.',
3568
+ DISABLE: 'POISTA KÄYTÖSTÄ',
3569
+ 'Dismiss the current overlay.': 'Sulje nykyinen näkymä.',
3570
+ 'Free spins': 'Ilmaiskierrokset',
3571
+ Game: 'Peli',
3572
+ 'Game info': 'Pelitiedot',
3573
+ Hotkeys: 'Pikanäppäimet',
3574
+ 'Increase your stake.': 'Kasvata panostasi.',
3575
+ 'Lower bet': 'Pienennä panosta',
3576
+ 'Master volume': 'Pääänenvoimakkuus',
3577
+ 'Max win': 'Maksimivoitto',
3578
+ Menu: 'Valikko',
3579
+ 'Menu & info': 'Valikko ja tiedot',
3580
+ Modes: 'Tilat',
3581
+ Music: 'Musiikki',
3582
+ Mute: 'Mykistä',
3583
+ 'Mute or unmute the game.': 'Mykistä tai poista mykistys.',
3584
+ Navigate: 'Navigoi',
3585
+ 'Open settings and game info.': 'Avaa asetukset ja pelitiedot.',
3586
+ 'Open the paytable and rules.': 'Avaa voittotaulukko ja säännöt.',
3587
+ 'Pay a fixed cost to enter a bonus feature.': 'Maksa kiinteä summa päästäksesi bonusominaisuuteen.',
3588
+ Paylines: 'Voittolinjat',
3589
+ Paytable: 'Voittotaulukko',
3590
+ 'Pays anywhere': 'Voittaa missä tahansa',
3591
+ Price: 'Hinta',
3592
+ 'Raise bet': 'Nosta panosta',
3593
+ Replay: 'Toista uudelleen',
3594
+ RTP: 'RTP',
3595
+ SFX: 'Ääniefektit',
3596
+ Settings: 'Asetukset',
3597
+ Sound: 'Ääni',
3598
+ Spin: 'Pyöräytä',
3599
+ 'Spin automatically a set number of times.': 'Pyöräytä automaattisesti määritetty määrä kertoja.',
3600
+ 'Speed up spin animations.': 'Nopeuta pyöräytysanimaatioita.',
3601
+ Start: 'Aloita',
3602
+ 'Start a spin at the current bet.': 'Aloita pyöräytys nykyisellä panoksella.',
3603
+ 'Start replay': 'Aloita uudelleentoisto',
3604
+ 'Total win': 'Kokonaisvoitto',
3605
+ Turbo: 'Turbo',
3606
+ 'Ways to win': 'Voittotavat',
3607
+ Win: 'Voitto',
3608
+ 'Winning shapes': 'Voittokuviot',
3609
+ },
3610
+ fr: {
3611
+ DISCLAIMER: 'Avertissement',
3612
+ Activate: 'Activer',
3613
+ Autoplay: 'Jeu automatique',
3614
+ Balance: 'Solde',
3615
+ Bet: 'Mise',
3616
+ 'BUY BONUS': 'ACHETER BONUS',
3617
+ Buy: 'Acheter',
3618
+ 'Buy bonus': 'Acheter un bonus',
3619
+ Cancel: 'Annuler',
3620
+ Close: 'Fermer',
3621
+ 'Cluster pays': 'Gains en grappe',
3622
+ Confirm: 'Confirmer',
3623
+ Controls: 'Commandes',
3624
+ 'Decrease your stake.': 'Diminuer votre mise.',
3625
+ DISABLE: 'DÉSACTIVER',
3626
+ 'Dismiss the current overlay.': 'Fermer le panneau actuel.',
3627
+ 'Free spins': 'Tours gratuits',
3628
+ Game: 'Jeu',
3629
+ 'Game info': 'Infos du jeu',
3630
+ Hotkeys: 'Raccourcis clavier',
3631
+ 'Increase your stake.': 'Augmenter votre mise.',
3632
+ 'Lower bet': 'Baisser la mise',
3633
+ 'Master volume': 'Volume principal',
3634
+ 'Max win': 'Gain maximum',
3635
+ Menu: 'Menu',
3636
+ 'Menu & info': 'Menu et info',
3637
+ Modes: 'Modes',
3638
+ Music: 'Musique',
3639
+ Mute: 'Couper le son',
3640
+ 'Mute or unmute the game.': 'Couper ou rétablir le son.',
3641
+ Navigate: 'Naviguer',
3642
+ 'Open settings and game info.': 'Ouvrir les paramètres et infos du jeu.',
3643
+ 'Open the paytable and rules.': 'Ouvrir la table des gains et les règles.',
3644
+ 'Pay a fixed cost to enter a bonus feature.': 'Payez un coût fixe pour accéder à une fonctionnalité bonus.',
3645
+ Paylines: 'Lignes de paiement',
3646
+ Paytable: 'Table des gains',
3647
+ 'Pays anywhere': 'Gains sur toute la grille',
3648
+ Price: 'Prix',
3649
+ 'Raise bet': 'Augmenter la mise',
3650
+ Replay: 'Revoir',
3651
+ RTP: 'RTP',
3652
+ SFX: 'Effets sonores',
3653
+ Settings: 'Paramètres',
3654
+ Sound: 'Son',
3655
+ Spin: 'Tourner',
3656
+ 'Spin automatically a set number of times.': 'Tourner automatiquement un nombre de fois défini.',
3657
+ 'Speed up spin animations.': 'Accélérer les animations de spin.',
3658
+ Start: 'Lancer',
3659
+ 'Start a spin at the current bet.': 'Lancer un tour avec la mise actuelle.',
3660
+ 'Start replay': 'Lancer le replay',
3661
+ 'Total win': 'Gain total',
3662
+ Turbo: 'Turbo',
3663
+ 'Ways to win': 'Façons de gagner',
3664
+ Win: 'Gain',
3665
+ 'Winning shapes': 'Figures gagnantes',
3666
+ },
3667
+ hi: {
3668
+ DISCLAIMER: 'अस्वीकरण',
3669
+ Activate: 'सक्रिय करें',
3670
+ Autoplay: 'ऑटोप्ले',
3671
+ Balance: 'बैलेंस',
3672
+ Bet: 'दांव',
3673
+ 'BUY BONUS': 'बोनस खरीदें',
3674
+ Buy: 'खरीदें',
3675
+ 'Buy bonus': 'बोनस खरीदें',
3676
+ Cancel: 'रद्द करें',
3677
+ Close: 'बंद करें',
3678
+ 'Cluster pays': 'क्लस्टर भुगतान',
3679
+ Confirm: 'पुष्टि करें',
3680
+ Controls: 'नियंत्रण',
3681
+ 'Decrease your stake.': 'अपना दांव कम करें।',
3682
+ DISABLE: 'बंद करें',
3683
+ 'Dismiss the current overlay.': 'वर्तमान ओवरले बंद करें।',
3684
+ 'Free spins': 'फ्री स्पिन',
3685
+ Game: 'खेल',
3686
+ 'Game info': 'गेम जानकारी',
3687
+ Hotkeys: 'कीबोर्ड शॉर्टकट',
3688
+ 'Increase your stake.': 'अपना दांव बढ़ाएं।',
3689
+ 'Lower bet': 'दांव घटाएं',
3690
+ 'Master volume': 'मुख्य वॉल्यूम',
3691
+ 'Max win': 'अधिकतम जीत',
3692
+ Menu: 'मेनू',
3693
+ 'Menu & info': 'मेनू और जानकारी',
3694
+ Modes: 'मोड',
3695
+ Music: 'संगीत',
3696
+ Mute: 'म्यूट करें',
3697
+ 'Mute or unmute the game.': 'गेम को म्यूट या अनम्यूट करें।',
3698
+ Navigate: 'नेविगेट करें',
3699
+ 'Open settings and game info.': 'सेटिंग और गेम जानकारी खोलें।',
3700
+ 'Open the paytable and rules.': 'पेटेबल और नियम खोलें।',
3701
+ 'Pay a fixed cost to enter a bonus feature.': 'बोनस फीचर में प्रवेश के लिए एक निश्चित राशि दें।',
3702
+ Paylines: 'पेलाइन',
3703
+ Paytable: 'पेटेबल',
3704
+ 'Pays anywhere': 'कहीं भी जीत',
3705
+ Price: 'मूल्य',
3706
+ 'Raise bet': 'दांव बढ़ाएं',
3707
+ Replay: 'दोबारा खेलें',
3708
+ RTP: 'RTP',
3709
+ SFX: 'ध्वनि प्रभाव',
3710
+ Settings: 'सेटिंग',
3711
+ Sound: 'ध्वनि',
3712
+ Spin: 'स्पिन',
3713
+ 'Spin automatically a set number of times.': 'एक निश्चित संख्या में स्वचालित रूप से स्पिन करें।',
3714
+ 'Speed up spin animations.': 'स्पिन एनिमेशन को तेज़ करें।',
3715
+ Start: 'शुरू करें',
3716
+ 'Start a spin at the current bet.': 'वर्तमान दांव पर स्पिन शुरू करें।',
3717
+ 'Start replay': 'रीप्ले शुरू करें',
3718
+ 'Total win': 'कुल जीत',
3719
+ Turbo: 'टर्बो',
3720
+ 'Ways to win': 'जीत के तरीके',
3721
+ Win: 'जीत',
3722
+ 'Winning shapes': 'जीत के आकार',
3723
+ },
3724
+ id: {
3725
+ DISCLAIMER: 'Penafian',
3726
+ Activate: 'Aktifkan',
3727
+ Autoplay: 'Putar Otomatis',
3728
+ Balance: 'Saldo',
3729
+ Bet: 'Taruhan',
3730
+ 'BUY BONUS': 'BELI BONUS',
3731
+ Buy: 'Beli',
3732
+ 'Buy bonus': 'Beli bonus',
3733
+ Cancel: 'Batal',
3734
+ Close: 'Tutup',
3735
+ 'Cluster pays': 'Bayar kluster',
3736
+ Confirm: 'Konfirmasi',
3737
+ Controls: 'Kontrol',
3738
+ 'Decrease your stake.': 'Kurangi taruhan Anda.',
3739
+ DISABLE: 'NONAKTIFKAN',
3740
+ 'Dismiss the current overlay.': 'Tutup overlay saat ini.',
3741
+ 'Free spins': 'Putaran gratis',
3742
+ Game: 'Permainan',
3743
+ 'Game info': 'Info permainan',
3744
+ Hotkeys: 'Pintasan keyboard',
3745
+ 'Increase your stake.': 'Tingkatkan taruhan Anda.',
3746
+ 'Lower bet': 'Turunkan taruhan',
3747
+ 'Master volume': 'Volume utama',
3748
+ 'Max win': 'Kemenangan maks',
3749
+ Menu: 'Menu',
3750
+ 'Menu & info': 'Menu & info',
3751
+ Modes: 'Mode',
3752
+ Music: 'Musik',
3753
+ Mute: 'Bisukan',
3754
+ 'Mute or unmute the game.': 'Bisukan atau aktifkan suara permainan.',
3755
+ Navigate: 'Navigasi',
3756
+ 'Open settings and game info.': 'Buka pengaturan dan info permainan.',
3757
+ 'Open the paytable and rules.': 'Buka tabel pembayaran dan aturan.',
3758
+ 'Pay a fixed cost to enter a bonus feature.': 'Bayar biaya tetap untuk masuk ke fitur bonus.',
3759
+ Paylines: 'Garis pembayaran',
3760
+ Paytable: 'Tabel pembayaran',
3761
+ 'Pays anywhere': 'Menang di mana saja',
3762
+ Price: 'Harga',
3763
+ 'Raise bet': 'Naikkan taruhan',
3764
+ Replay: 'Putar ulang',
3765
+ RTP: 'RTP',
3766
+ SFX: 'Efek suara',
3767
+ Settings: 'Pengaturan',
3768
+ Sound: 'Suara',
3769
+ Spin: 'Putar',
3770
+ 'Spin automatically a set number of times.': 'Putar otomatis sejumlah kali yang ditentukan.',
3771
+ 'Speed up spin animations.': 'Percepat animasi putaran.',
3772
+ Start: 'Mulai',
3773
+ 'Start a spin at the current bet.': 'Mulai putaran dengan taruhan saat ini.',
3774
+ 'Start replay': 'Mulai putar ulang',
3775
+ 'Total win': 'Total kemenangan',
3776
+ Turbo: 'Turbo',
3777
+ 'Ways to win': 'Cara menang',
3778
+ Win: 'Menang',
3779
+ 'Winning shapes': 'Bentuk kemenangan',
3780
+ },
3781
+ ja: {
3782
+ DISCLAIMER: '免責事項',
3783
+ Activate: '有効化',
3784
+ Autoplay: 'オートプレイ',
3785
+ Balance: '残高',
3786
+ Bet: 'ベット',
3787
+ 'BUY BONUS': 'ボーナス購入',
3788
+ Buy: '購入',
3789
+ 'Buy bonus': 'ボーナス購入',
3790
+ Cancel: 'キャンセル',
3791
+ Close: '閉じる',
3792
+ 'Cluster pays': 'クラスター配当',
3793
+ Confirm: '確認',
3794
+ Controls: '操作方法',
3795
+ 'Decrease your stake.': 'ベットを減らす。',
3796
+ DISABLE: '無効',
3797
+ 'Dismiss the current overlay.': '現在のオーバーレイを閉じる。',
3798
+ 'Free spins': 'フリースピン',
3799
+ Game: 'ゲーム',
3800
+ 'Game info': 'ゲーム情報',
3801
+ Hotkeys: 'キーボードショートカット',
3802
+ 'Increase your stake.': 'ベットを増やす。',
3803
+ 'Lower bet': 'ベットを下げる',
3804
+ 'Master volume': 'マスターボリューム',
3805
+ 'Max win': '最大当選',
3806
+ Menu: 'メニュー',
3807
+ 'Menu & info': 'メニューと情報',
3808
+ Modes: 'モード',
3809
+ Music: 'ミュージック',
3810
+ Mute: 'ミュート',
3811
+ 'Mute or unmute the game.': 'ゲームをミュート/ミュート解除する。',
3812
+ Navigate: 'ナビゲート',
3813
+ 'Open settings and game info.': '設定とゲーム情報を開く。',
3814
+ 'Open the paytable and rules.': '配当表とルールを開く。',
3815
+ 'Pay a fixed cost to enter a bonus feature.': 'ボーナス機能に入るために固定料金を支払う。',
3816
+ Paylines: 'ペイライン',
3817
+ Paytable: '配当表',
3818
+ 'Pays anywhere': 'どこでも当選',
3819
+ Price: '価格',
3820
+ 'Raise bet': 'ベットを上げる',
3821
+ Replay: 'リプレイ',
3822
+ RTP: 'RTP',
3823
+ SFX: '効果音',
3824
+ Settings: '設定',
3825
+ Sound: 'サウンド',
3826
+ Spin: 'スピン',
3827
+ 'Spin automatically a set number of times.': '設定した回数だけ自動でスピンする。',
3828
+ 'Speed up spin animations.': 'スピンアニメーションを高速化する。',
3829
+ Start: 'スタート',
3830
+ 'Start a spin at the current bet.': '現在のベットでスピンを開始する。',
3831
+ 'Start replay': 'リプレイ開始',
3832
+ 'Total win': '合計当選',
3833
+ Turbo: 'ターボ',
3834
+ 'Ways to win': '当選方法',
3835
+ Win: '当選',
3836
+ 'Winning shapes': '当選形状',
3837
+ },
3838
+ ko: {
3839
+ DISCLAIMER: '면책 조항',
3840
+ Activate: '활성화',
3841
+ Autoplay: '자동 플레이',
3842
+ Balance: '잔액',
3843
+ Bet: '베팅',
3844
+ 'BUY BONUS': '보너스 구매',
3845
+ Buy: '구매',
3846
+ 'Buy bonus': '보너스 구매',
3847
+ Cancel: '취소',
3848
+ Close: '닫기',
3849
+ 'Cluster pays': '클러스터 페이',
3850
+ Confirm: '확인',
3851
+ Controls: '조작법',
3852
+ 'Decrease your stake.': '베팅을 줄이세요.',
3853
+ DISABLE: '비활성화',
3854
+ 'Dismiss the current overlay.': '현재 오버레이를 닫습니다.',
3855
+ 'Free spins': '무료 스핀',
3856
+ Game: '게임',
3857
+ 'Game info': '게임 정보',
3858
+ Hotkeys: '키보드 단축키',
3859
+ 'Increase your stake.': '베팅을 늘리세요.',
3860
+ 'Lower bet': '베팅 낮추기',
3861
+ 'Master volume': '마스터 볼륨',
3862
+ 'Max win': '최대 당첨',
3863
+ Menu: '메뉴',
3864
+ 'Menu & info': '메뉴 & 정보',
3865
+ Modes: '모드',
3866
+ Music: '음악',
3867
+ Mute: '음소거',
3868
+ 'Mute or unmute the game.': '게임 소리를 켜거나 끕니다.',
3869
+ Navigate: '이동',
3870
+ 'Open settings and game info.': '설정 및 게임 정보를 엽니다.',
3871
+ 'Open the paytable and rules.': '페이테이블 및 규칙을 엽니다.',
3872
+ 'Pay a fixed cost to enter a bonus feature.': '고정 비용을 지불하고 보너스 기능에 진입하세요.',
3873
+ Paylines: '페이라인',
3874
+ Paytable: '페이테이블',
3875
+ 'Pays anywhere': '어디서나 당첨',
3876
+ Price: '가격',
3877
+ 'Raise bet': '베팅 올리기',
3878
+ Replay: '다시보기',
3879
+ RTP: 'RTP',
3880
+ SFX: '효과음',
3881
+ Settings: '설정',
3882
+ Sound: '사운드',
3883
+ Spin: '스핀',
3884
+ 'Spin automatically a set number of times.': '정해진 횟수만큼 자동으로 스핀합니다.',
3885
+ 'Speed up spin animations.': '스핀 애니메이션을 빠르게 합니다.',
3886
+ Start: '시작',
3887
+ 'Start a spin at the current bet.': '현재 베팅으로 스핀을 시작합니다.',
3888
+ 'Start replay': '다시보기 시작',
3889
+ 'Total win': '총 당첨',
3890
+ Turbo: '터보',
3891
+ 'Ways to win': '당첨 방법',
3892
+ Win: '당첨',
3893
+ 'Winning shapes': '당첨 패턴',
3894
+ },
3895
+ pl: {
3896
+ DISCLAIMER: 'Zastrzeżenie',
3897
+ Activate: 'Aktywuj',
3898
+ Autoplay: 'Autoplay',
3899
+ Balance: 'Saldo',
3900
+ Bet: 'Zakład',
3901
+ 'BUY BONUS': 'KUP BONUS',
3902
+ Buy: 'Kup',
3903
+ 'Buy bonus': 'Kup bonus',
3904
+ Cancel: 'Anuluj',
3905
+ Close: 'Zamknij',
3906
+ 'Cluster pays': 'Wypłaty klastrowe',
3907
+ Confirm: 'Potwierdź',
3908
+ Controls: 'Sterowanie',
3909
+ 'Decrease your stake.': 'Zmniejsz swój zakład.',
3910
+ DISABLE: 'WYŁĄCZ',
3911
+ 'Dismiss the current overlay.': 'Zamknij bieżące okno.',
3912
+ 'Free spins': 'Darmowe spiny',
3913
+ Game: 'Gra',
3914
+ 'Game info': 'Informacje o grze',
3915
+ Hotkeys: 'Skróty klawiaturowe',
3916
+ 'Increase your stake.': 'Zwiększ swój zakład.',
3917
+ 'Lower bet': 'Obniż zakład',
3918
+ 'Master volume': 'Głośność główna',
3919
+ 'Max win': 'Maks. wygrana',
3920
+ Menu: 'Menu',
3921
+ 'Menu & info': 'Menu i informacje',
3922
+ Modes: 'Tryby',
3923
+ Music: 'Muzyka',
3924
+ Mute: 'Wycisz',
3925
+ 'Mute or unmute the game.': 'Wycisz lub odcisz dźwięk gry.',
3926
+ Navigate: 'Nawiguj',
3927
+ 'Open settings and game info.': 'Otwórz ustawienia i informacje o grze.',
3928
+ 'Open the paytable and rules.': 'Otwórz tabelę wygranych i zasady.',
3929
+ 'Pay a fixed cost to enter a bonus feature.': 'Zapłać stałą kwotę, aby wejść do funkcji bonusowej.',
3930
+ Paylines: 'Linie wygrywające',
3931
+ Paytable: 'Tabela wygranych',
3932
+ 'Pays anywhere': 'Wypłaca wszędzie',
3933
+ Price: 'Cena',
3934
+ 'Raise bet': 'Podnieś zakład',
3935
+ Replay: 'Odtwórz ponownie',
3936
+ RTP: 'RTP',
3937
+ SFX: 'Efekty dźwiękowe',
3938
+ Settings: 'Ustawienia',
3939
+ Sound: 'Dźwięk',
3940
+ Spin: 'Zakręć',
3941
+ 'Spin automatically a set number of times.': 'Obracaj automatycznie określoną liczbę razy.',
3942
+ 'Speed up spin animations.': 'Przyspiesz animacje obrotów.',
3943
+ Start: 'Start',
3944
+ 'Start a spin at the current bet.': 'Rozpocznij obrót przy bieżącym zakładzie.',
3945
+ 'Start replay': 'Rozpocznij odtwarzanie',
3946
+ 'Total win': 'Łączna wygrana',
3947
+ Turbo: 'Turbo',
3948
+ 'Ways to win': 'Sposoby wygrywania',
3949
+ Win: 'Wygrana',
3950
+ 'Winning shapes': 'Wzory wygrywające',
3951
+ },
3952
+ pt: {
3953
+ DISCLAIMER: 'Aviso legal',
3954
+ Activate: 'Ativar',
3955
+ Autoplay: 'Giro automático',
3956
+ Balance: 'Saldo',
3957
+ Bet: 'Aposta',
3958
+ 'BUY BONUS': 'COMPRAR BÔNUS',
3959
+ Buy: 'Comprar',
3960
+ 'Buy bonus': 'Comprar bônus',
3961
+ Cancel: 'Cancelar',
3962
+ Close: 'Fechar',
3963
+ 'Cluster pays': 'Pagamento em cluster',
3964
+ Confirm: 'Confirmar',
3965
+ Controls: 'Controles',
3966
+ 'Decrease your stake.': 'Diminuir aposta.',
3967
+ DISABLE: 'DESATIVAR',
3968
+ 'Dismiss the current overlay.': 'Fechar o painel atual.',
3969
+ 'Free spins': 'Giros grátis',
3970
+ Game: 'Jogo',
3971
+ 'Game info': 'Info do jogo',
3972
+ Hotkeys: 'Atalhos de teclado',
3973
+ 'Increase your stake.': 'Aumentar aposta.',
3974
+ 'Lower bet': 'Baixar aposta',
3975
+ 'Master volume': 'Volume principal',
3976
+ 'Max win': 'Ganho máximo',
3977
+ Menu: 'Menu',
3978
+ 'Menu & info': 'Menu e info',
3979
+ Modes: 'Modos',
3980
+ Music: 'Música',
3981
+ Mute: 'Silenciar',
3982
+ 'Mute or unmute the game.': 'Ativar ou silenciar o som do jogo.',
3983
+ Navigate: 'Navegar',
3984
+ 'Open settings and game info.': 'Abrir configurações e info do jogo.',
3985
+ 'Open the paytable and rules.': 'Abrir tabela de pagamentos e regras.',
3986
+ 'Pay a fixed cost to enter a bonus feature.': 'Pague um custo fixo para entrar numa funcionalidade de bônus.',
3987
+ Paylines: 'Linhas de pagamento',
3988
+ Paytable: 'Tabela de pagamentos',
3989
+ 'Pays anywhere': 'Paga em qualquer posição',
3990
+ Price: 'Preço',
3991
+ 'Raise bet': 'Aumentar aposta',
3992
+ Replay: 'Repetir',
3993
+ RTP: 'RTP',
3994
+ SFX: 'Efeitos sonoros',
3995
+ Settings: 'Configurações',
3996
+ Sound: 'Som',
3997
+ Spin: 'Girar',
3998
+ 'Spin automatically a set number of times.': 'Girar automaticamente um número definido de vezes.',
3999
+ 'Speed up spin animations.': 'Acelerar as animações de giro.',
4000
+ Start: 'Iniciar',
4001
+ 'Start a spin at the current bet.': 'Iniciar um giro com a aposta atual.',
4002
+ 'Start replay': 'Iniciar repetição',
4003
+ 'Total win': 'Ganho total',
4004
+ Turbo: 'Turbo',
4005
+ 'Ways to win': 'Formas de ganhar',
4006
+ Win: 'Ganho',
4007
+ 'Winning shapes': 'Figuras vencedoras',
4008
+ },
4009
+ ru: {
4010
+ DISCLAIMER: 'Отказ от ответственности',
4011
+ Activate: 'Активировать',
4012
+ Autoplay: 'Автоигра',
4013
+ Balance: 'Баланс',
4014
+ Bet: 'Ставка',
4015
+ 'BUY BONUS': 'КУПИТЬ БОНУС',
4016
+ Buy: 'Купить',
4017
+ 'Buy bonus': 'Купить бонус',
4018
+ Cancel: 'Отмена',
4019
+ Close: 'Закрыть',
4020
+ 'Cluster pays': 'Кластерные выплаты',
4021
+ Confirm: 'Подтвердить',
4022
+ Controls: 'Управление',
4023
+ 'Decrease your stake.': 'Уменьшить ставку.',
4024
+ DISABLE: 'ОТКЛЮЧИТЬ',
4025
+ 'Dismiss the current overlay.': 'Закрыть текущее окно.',
4026
+ 'Free spins': 'Бесплатные вращения',
4027
+ Game: 'Игра',
4028
+ 'Game info': 'Информация об игре',
4029
+ Hotkeys: 'Горячие клавиши',
4030
+ 'Increase your stake.': 'Увеличить ставку.',
4031
+ 'Lower bet': 'Уменьшить ставку',
4032
+ 'Master volume': 'Общая громкость',
4033
+ 'Max win': 'Макс. выигрыш',
4034
+ Menu: 'Меню',
4035
+ 'Menu & info': 'Меню и информация',
4036
+ Modes: 'Режимы',
4037
+ Music: 'Музыка',
4038
+ Mute: 'Отключить звук',
4039
+ 'Mute or unmute the game.': 'Включить или отключить звук.',
4040
+ Navigate: 'Навигация',
4041
+ 'Open settings and game info.': 'Открыть настройки и информацию об игре.',
4042
+ 'Open the paytable and rules.': 'Открыть таблицу выплат и правила.',
4043
+ 'Pay a fixed cost to enter a bonus feature.': 'Заплатите фиксированную сумму для входа в бонусный раунд.',
4044
+ Paylines: 'Линии выплат',
4045
+ Paytable: 'Таблица выплат',
4046
+ 'Pays anywhere': 'Выплачивает в любом месте',
4047
+ Price: 'Цена',
4048
+ 'Raise bet': 'Повысить ставку',
4049
+ Replay: 'Повтор',
4050
+ RTP: 'RTP',
4051
+ SFX: 'Звуковые эффекты',
4052
+ Settings: 'Настройки',
4053
+ Sound: 'Звук',
4054
+ Spin: 'Вращение',
4055
+ 'Spin automatically a set number of times.': 'Автоматически вращать заданное количество раз.',
4056
+ 'Speed up spin animations.': 'Ускорить анимацию вращений.',
4057
+ Start: 'Начать',
4058
+ 'Start a spin at the current bet.': 'Начать вращение с текущей ставкой.',
4059
+ 'Start replay': 'Начать повтор',
4060
+ 'Total win': 'Общий выигрыш',
4061
+ Turbo: 'Турбо',
4062
+ 'Ways to win': 'Способы выигрыша',
4063
+ Win: 'Выигрыш',
4064
+ 'Winning shapes': 'Выигрышные комбинации',
4065
+ },
4066
+ tr: {
4067
+ DISCLAIMER: 'Yasal uyarı',
4068
+ Activate: 'Etkinleştir',
4069
+ Autoplay: 'Otomatik Oyun',
4070
+ Balance: 'Bakiye',
4071
+ Bet: 'Bahis',
4072
+ 'BUY BONUS': 'BONUS SATIN AL',
4073
+ Buy: 'Satın al',
4074
+ 'Buy bonus': 'Bonus satın al',
4075
+ Cancel: 'İptal',
4076
+ Close: 'Kapat',
4077
+ 'Cluster pays': 'Küme ödemeleri',
4078
+ Confirm: 'Onayla',
4079
+ Controls: 'Kontroller',
4080
+ 'Decrease your stake.': 'Bahsinizi azaltın.',
4081
+ DISABLE: 'DEVRE DIŞI',
4082
+ 'Dismiss the current overlay.': 'Mevcut pencereyi kapat.',
4083
+ 'Free spins': 'Ücretsiz dönüşler',
4084
+ Game: 'Oyun',
4085
+ 'Game info': 'Oyun bilgisi',
4086
+ Hotkeys: 'Klavye kısayolları',
4087
+ 'Increase your stake.': 'Bahsinizi artırın.',
4088
+ 'Lower bet': 'Bahsi düşür',
4089
+ 'Master volume': 'Ana ses',
4090
+ 'Max win': 'Maks kazanç',
4091
+ Menu: 'Menü',
4092
+ 'Menu & info': 'Menü ve bilgi',
4093
+ Modes: 'Modlar',
4094
+ Music: 'Müzik',
4095
+ Mute: 'Sessiz',
4096
+ 'Mute or unmute the game.': 'Oyun sesini aç ya da kapat.',
4097
+ Navigate: 'Gezin',
4098
+ 'Open settings and game info.': 'Ayarları ve oyun bilgisini aç.',
4099
+ 'Open the paytable and rules.': 'Ödeme tablosunu ve kuralları aç.',
4100
+ 'Pay a fixed cost to enter a bonus feature.': 'Bonus özelliğine girmek için sabit bir ücret ödeyin.',
4101
+ Paylines: 'Ödeme çizgileri',
4102
+ Paytable: 'Ödeme tablosu',
4103
+ 'Pays anywhere': 'Her yerde kazandırır',
4104
+ Price: 'Fiyat',
4105
+ 'Raise bet': 'Bahsi artır',
4106
+ Replay: 'Tekrar oynat',
4107
+ RTP: 'RTP',
4108
+ SFX: 'Ses efektleri',
4109
+ Settings: 'Ayarlar',
4110
+ Sound: 'Ses',
4111
+ Spin: 'Döndür',
4112
+ 'Spin automatically a set number of times.': 'Belirlenen sayıda otomatik döndür.',
4113
+ 'Speed up spin animations.': 'Döndürme animasyonlarını hızlandır.',
4114
+ Start: 'Başlat',
4115
+ 'Start a spin at the current bet.': 'Mevcut bahisle döndürmeyi başlat.',
4116
+ 'Start replay': 'Tekrarı başlat',
4117
+ 'Total win': 'Toplam kazanç',
4118
+ Turbo: 'Turbo',
4119
+ 'Ways to win': 'Kazanma yolları',
4120
+ Win: 'Kazanç',
4121
+ 'Winning shapes': 'Kazanan şekiller',
4122
+ },
4123
+ vi: {
4124
+ DISCLAIMER: 'Tuyên bố miễn trừ trách nhiệm',
4125
+ Activate: 'Kích hoạt',
4126
+ Autoplay: 'Tự động quay',
4127
+ Balance: 'Số dư',
4128
+ Bet: 'Cược',
4129
+ 'BUY BONUS': 'MUA THƯỞNG',
4130
+ Buy: 'Mua',
4131
+ 'Buy bonus': 'Mua thưởng',
4132
+ Cancel: 'Hủy',
4133
+ Close: 'Đóng',
4134
+ 'Cluster pays': 'Trả theo cụm',
4135
+ Confirm: 'Xác nhận',
4136
+ Controls: 'Điều khiển',
4137
+ 'Decrease your stake.': 'Giảm mức cược.',
4138
+ DISABLE: 'TẮT',
4139
+ 'Dismiss the current overlay.': 'Đóng lớp phủ hiện tại.',
4140
+ 'Free spins': 'Quay miễn phí',
4141
+ Game: 'Trò chơi',
4142
+ 'Game info': 'Thông tin trò chơi',
4143
+ Hotkeys: 'Phím tắt',
4144
+ 'Increase your stake.': 'Tăng mức cược.',
4145
+ 'Lower bet': 'Giảm cược',
4146
+ 'Master volume': 'Âm lượng chính',
4147
+ 'Max win': 'Thắng tối đa',
4148
+ Menu: 'Menu',
4149
+ 'Menu & info': 'Menu & thông tin',
4150
+ Modes: 'Chế độ',
4151
+ Music: 'Âm nhạc',
4152
+ Mute: 'Tắt âm',
4153
+ 'Mute or unmute the game.': 'Tắt hoặc bật âm thanh trò chơi.',
4154
+ Navigate: 'Điều hướng',
4155
+ 'Open settings and game info.': 'Mở cài đặt và thông tin trò chơi.',
4156
+ 'Open the paytable and rules.': 'Mở bảng trả thưởng và quy tắc.',
4157
+ 'Pay a fixed cost to enter a bonus feature.': 'Trả một khoản phí cố định để tham gia tính năng thưởng.',
4158
+ Paylines: 'Đường thắng',
4159
+ Paytable: 'Bảng trả thưởng',
4160
+ 'Pays anywhere': 'Trả bất cứ đâu',
4161
+ Price: 'Giá',
4162
+ 'Raise bet': 'Tăng cược',
4163
+ Replay: 'Xem lại',
4164
+ RTP: 'RTP',
4165
+ SFX: 'Hiệu ứng âm thanh',
4166
+ Settings: 'Cài đặt',
4167
+ Sound: 'Âm thanh',
4168
+ Spin: 'Quay',
4169
+ 'Spin automatically a set number of times.': 'Tự động quay một số lần nhất định.',
4170
+ 'Speed up spin animations.': 'Tăng tốc độ hoạt ảnh quay.',
4171
+ Start: 'Bắt đầu',
4172
+ 'Start a spin at the current bet.': 'Bắt đầu quay với mức cược hiện tại.',
4173
+ 'Start replay': 'Bắt đầu xem lại',
4174
+ 'Total win': 'Tổng thắng',
4175
+ Turbo: 'Turbo',
4176
+ 'Ways to win': 'Cách thắng',
4177
+ Win: 'Thắng',
4178
+ 'Winning shapes': 'Hình thắng',
4179
+ },
4180
+ zh: {
4181
+ DISCLAIMER: '免责声明',
4182
+ Activate: '激活',
4183
+ Autoplay: '自动游戏',
4184
+ Balance: '余额',
4185
+ Bet: '投注',
4186
+ 'BUY BONUS': '购买奖励',
4187
+ Buy: '购买',
4188
+ 'Buy bonus': '购买奖励',
4189
+ Cancel: '取消',
4190
+ Close: '关闭',
4191
+ 'Cluster pays': '集群赔付',
4192
+ Confirm: '确认',
4193
+ Controls: '控制',
4194
+ 'Decrease your stake.': '降低投注额。',
4195
+ DISABLE: '禁用',
4196
+ 'Dismiss the current overlay.': '关闭当前弹窗。',
4197
+ 'Free spins': '免费旋转',
4198
+ Game: '游戏',
4199
+ 'Game info': '游戏信息',
4200
+ Hotkeys: '快捷键',
4201
+ 'Increase your stake.': '提高投注额。',
4202
+ 'Lower bet': '降低投注',
4203
+ 'Master volume': '主音量',
4204
+ 'Max win': '最大奖金',
4205
+ Menu: '菜单',
4206
+ 'Menu & info': '菜单与信息',
4207
+ Modes: '模式',
4208
+ Music: '音乐',
4209
+ Mute: '静音',
4210
+ 'Mute or unmute the game.': '静音或取消静音。',
4211
+ Navigate: '导航',
4212
+ 'Open settings and game info.': '打开设置和游戏信息。',
4213
+ 'Open the paytable and rules.': '打开赔付表和规则。',
4214
+ 'Pay a fixed cost to enter a bonus feature.': '支付固定费用以进入奖励功能。',
4215
+ Paylines: '赔付线',
4216
+ Paytable: '赔付表',
4217
+ 'Pays anywhere': '任意位置赢',
4218
+ Price: '价格',
4219
+ 'Raise bet': '提高投注',
4220
+ Replay: '重播',
4221
+ RTP: 'RTP',
4222
+ SFX: '音效',
4223
+ Settings: '设置',
4224
+ Sound: '声音',
4225
+ Spin: '旋转',
4226
+ 'Spin automatically a set number of times.': '自动旋转设定次数。',
4227
+ 'Speed up spin animations.': '加速旋转动画。',
4228
+ Start: '开始',
4229
+ 'Start a spin at the current bet.': '以当前投注额开始旋转。',
4230
+ 'Start replay': '开始重播',
4231
+ 'Total win': '总奖金',
4232
+ Turbo: '急速',
4233
+ 'Ways to win': '赢法',
4234
+ Win: '奖金',
4235
+ 'Winning shapes': '赢利图形',
4236
+ },
4237
+ };
4238
+
2715
4239
  // Social-casino language. English is the source (and, for now, the only) language; `socialize`
2716
4240
  // rewrites the restricted gambling vocabulary into social-safe phrasing while preserving case.
2717
4241
  //
@@ -2784,6 +4308,21 @@ function socialize(text) {
2784
4308
  return repl == null ? m : applyCase(m, repl);
2785
4309
  });
2786
4310
  }
4311
+ const LANGS = ['de', 'en', 'es', 'fi', 'fr', 'hi', 'id', 'ja', 'ko', 'pl', 'pt', 'ru', 'tr', 'vi', 'zh', 'da'];
4312
+ const LANG_SET = new Set(LANGS);
4313
+ function normalizeLang(code) {
4314
+ const base = (code ?? '').toLowerCase().split(/[-_]/)[0];
4315
+ return (LANG_SET.has(base) ? base : 'en');
4316
+ }
4317
+ function createI18n(opts) {
4318
+ const lang = normalizeLang(opts.language);
4319
+ const t = (src) => {
4320
+ if (lang === 'en')
4321
+ return opts.isSocial ? socialize(src) : src;
4322
+ return opts.messages?.[lang]?.[src] ?? LOCALES[lang]?.[src] ?? src;
4323
+ };
4324
+ return { lang, t };
4325
+ }
2787
4326
 
2788
4327
  const REMOVE_FADE_MS = 300;
2789
4328
  class GameShell extends EventEmitter {
@@ -2799,10 +4338,19 @@ class GameShell extends EventEmitter {
2799
4338
  prevBalance = 0;
2800
4339
  prevWin = 0;
2801
4340
  moneyAnims = [];
2802
- keysBound = false;
4341
+ kbd;
4342
+ i18n;
4343
+ /** onKey handler of the currently open modal/overlay, if any (set in showModal, cleared in closeModal). */
4344
+ modalOnKey = undefined;
4345
+ /** Shared sound on/off state — Settings speaker toggle and the Shift+M hotkey stay in sync. The
4346
+ * game listens to `settingChange({ key: 'sound' })` to (un)mute audio. */
4347
+ soundOn = true;
4348
+ /** Set by the open Settings modal so Shift+M live-updates its speaker icon; cleared on close. */
4349
+ soundRefresh = null;
2803
4350
  constructor(config) {
2804
4351
  super();
2805
4352
  this.config = config;
4353
+ this.i18n = createI18n({ language: config.language, isSocial: config.isSocial });
2806
4354
  this.state = createInitialState(config);
2807
4355
  this.styleEl = document.createElement('style');
2808
4356
  this.styleEl.textContent = SHELL_CSS;
@@ -2818,12 +4366,54 @@ class GameShell extends EventEmitter {
2818
4366
  this.prevWin = this.state.win;
2819
4367
  this.observeLayout();
2820
4368
  if (typeof document !== 'undefined') {
2821
- document.addEventListener('keydown', this.handleKeyDown);
4369
+ // eslint-disable-next-line @typescript-eslint/no-this-alias
4370
+ const shell = this;
4371
+ const host = {
4372
+ get state() { return shell.state; },
4373
+ get hotkeysEnabled() { return shell.config.features.hotkeys !== false; },
4374
+ get spacebarEnabled() { return shell.config.features.spacebar !== false; },
4375
+ get turboLevels() { return shell.config.features.turbo; },
4376
+ get autoplayEnabled() { return shell.config.features.autoplay != null; },
4377
+ get buyBonusEnabled() { return shell.config.features.buyBonus !== false; },
4378
+ hasOpenLayer: () => shell.modalHost.childElementCount > 0,
4379
+ routeToLayer: (e) => shell.modalOnKey?.(e) ?? false,
4380
+ spin: () => shell.emit('spin'),
4381
+ stepBet: (dir) => {
4382
+ const next = stepBet(shell.state, dir);
4383
+ if (next === shell.state.bet)
4384
+ return;
4385
+ shell.state.bet = next;
4386
+ shell.emit('betChange', next);
4387
+ shell.render();
4388
+ },
4389
+ toggleAutoplay: () => {
4390
+ if (shell.state.autoplay.active) {
4391
+ shell.state.autoplay = { active: false, remaining: 0 };
4392
+ shell.emit('autoplayStop');
4393
+ shell.render();
4394
+ }
4395
+ else {
4396
+ shell.openAutoplayPicker();
4397
+ }
4398
+ },
4399
+ cycleTurbo: () => {
4400
+ const next = nextTurbo(shell.state.turbo, shell.config.features.turbo);
4401
+ shell.state.turbo = next;
4402
+ shell.emit('turboChange', next);
4403
+ shell.render();
4404
+ },
4405
+ openBuyBonus: () => shell.openBuyBonus(),
4406
+ openInfo: () => shell.openInfo(),
4407
+ openMenu: () => shell.openMenu(),
4408
+ toggleMute: () => shell.setSound(!shell.soundOn),
4409
+ closeLayer: () => shell.closeModal(),
4410
+ };
4411
+ this.kbd = new KeyboardController(host);
4412
+ this.kbd.attach();
2822
4413
  // Stake serves the game in an iframe; on first paint focus is on the HOST page, so a `document`
2823
4414
  // keydown never fires and Space scrolls the parent. Pull window focus into the iframe on the
2824
4415
  // first pointer interaction so the spacebar shortcut works. Harmless on full-page Energy8.
2825
4416
  document.addEventListener('pointerdown', this.pullFocus, true);
2826
- this.keysBound = true;
2827
4417
  }
2828
4418
  this.render();
2829
4419
  // re-fit once the bundled webfont swaps in (text metrics change → row width changes)
@@ -2926,46 +4516,32 @@ class GameShell extends EventEmitter {
2926
4516
  zoomBar(s * (bar.clientWidth / bar.scrollWidth));
2927
4517
  }
2928
4518
  }
2929
- /** Spacebar starts a spin — same path as the spin disc. Ignored when `features.spacebar` is
2930
- * false, while a spin is running, while autoplay is active, outside base mode, when an
2931
- * overlay/modal is open, or when an editable element is focused. `repeat` (held key) is
2932
- * ignored so it can't spam. */
2933
4519
  /** Pull window focus into the iframe on first pointer interaction so `document` keydown (the
2934
4520
  * spacebar shortcut) fires. No-op / harmless when already focused or full-page. */
2935
4521
  pullFocus = () => { try {
2936
4522
  window.focus();
2937
4523
  }
2938
4524
  catch { /* cross-origin / non-browser */ } };
2939
- handleKeyDown = (e) => {
2940
- if (this.destroyed || e.code !== 'Space' || e.repeat)
2941
- return;
2942
- if (this.config.features.spacebar === false)
2943
- return; // shortcut disabled (e.g. jurisdiction)
2944
- const t = e.target;
2945
- if (t && (t.isContentEditable || /^(INPUT|TEXTAREA|SELECT)$/.test(t.tagName)))
2946
- return;
2947
- // Space is ours now — swallow the browser default before any no-op bail. Otherwise the
2948
- // native "Space activates the focused button" still fires and re-clicks whichever shell
2949
- // <button> (menu/buy/auto) opened the overlay, tearing down + rebuilding the modal: a
2950
- // visible flicker. (Also stops the page from scrolling on Space.)
2951
- e.preventDefault();
2952
- if (this.modalHost.childElementCount > 0)
2953
- return; // an overlay/modal is open
2954
- if (this.state.mode !== 'base' || this.state.busy || this.state.autoplay.active)
2955
- return;
2956
- this.emit('spin');
2957
- };
2958
4525
  setLayout(layout) {
2959
4526
  if (layout === this.layout)
2960
4527
  return;
2961
4528
  this.layout = layout;
2962
4529
  this.render();
2963
4530
  }
2964
- /** Resolve a built-in shell string. English is the source; with `isSocial` it is run through
2965
- * the social-casino word-swap. Game-supplied strings should NOT be passed through this. */
2966
- t(text) { return this.config.isSocial ? socialize(text) : text; }
2967
- /** Toggle the social vocabulary at runtime (re-renders the bar; reopen overlays to refresh them). */
2968
- setSocial(isSocial) { this.config.isSocial = isSocial; this.render(); }
4531
+ /** Resolve a built-in shell string through the i18n resolver (translation + optional socialize). */
4532
+ t(text) { return this.i18n.t(text); }
4533
+ /** Toggle the social vocabulary at runtime (rebuilds resolver, re-renders bar). */
4534
+ setSocial(isSocial) {
4535
+ this.config.isSocial = isSocial;
4536
+ this.i18n = createI18n({ language: this.config.language, isSocial });
4537
+ this.render();
4538
+ }
4539
+ /** Swap the active language at runtime (rebuilds resolver, re-renders bar). */
4540
+ setLanguage(lang) {
4541
+ this.config.language = lang;
4542
+ this.i18n = createI18n({ language: lang, isSocial: this.config.isSocial });
4543
+ this.render();
4544
+ }
2969
4545
  /** Recolour the shell at runtime (e.g. switch dark/light scheme). */
2970
4546
  setTheme(theme) {
2971
4547
  this.config.theme = theme;
@@ -3006,7 +4582,7 @@ class GameShell extends EventEmitter {
3006
4582
  this.state.mode = mode;
3007
4583
  this.render();
3008
4584
  }
3009
- setBusy(busy) { this.state.busy = busy; this.render(); }
4585
+ setBusy(busy) { this.state.busy = busy; this.render(); this.kbd?.notifyBusyChanged(busy); }
3010
4586
  setAutoplay(a) { this.state.autoplay = a; this.render(); }
3011
4587
  setTurbo(level) { this.state.turbo = level; this.render(); }
3012
4588
  /** Currency-aware money formatter for WIN amounts (variable decimals: 0.0041 stays 0.0041, not
@@ -3014,7 +4590,7 @@ class GameShell extends EventEmitter {
3014
4590
  formatWin(value) { return formatCurrency(value, this.config.currency, true); }
3015
4591
  setBuyBonusEnabled(enabled) { this.state.buyBonusEnabled = enabled; this.render(); }
3016
4592
  setFreeSpins(fs) { this.state.freeSpins = fs; this.render(); }
3017
- showModal(el) {
4593
+ showModal(el, onKey) {
3018
4594
  // The control that opened this overlay (menu/buy/auto) keeps DOM focus. Drop it, or a
3019
4595
  // stray Space/Enter would natively re-activate that <button> and rebuild the modal — a
3020
4596
  // visible flicker. Only relinquish focus we own (a shell control), never the host page's.
@@ -3023,6 +4599,7 @@ class GameShell extends EventEmitter {
3023
4599
  active.blur();
3024
4600
  this.modalHost.innerHTML = '';
3025
4601
  this.modalHost.appendChild(el);
4602
+ this.modalOnKey = onKey;
3026
4603
  this.fitModals();
3027
4604
  }
3028
4605
  /** Uniformly scale every open centred card modal (`.ge-sheet`) down so it fits a short/narrow
@@ -3075,22 +4652,31 @@ class GameShell extends EventEmitter {
3075
4652
  }
3076
4653
  openMenu() { this.emit('menuOpen'); this.openSettings(); }
3077
4654
  openSettings() { this.emit('settingsOpen'); this.showModal(openSettingsModal(this)); }
3078
- openInfo() { this.emit('infoOpen'); this.showModal(openGameInfoModal(this)); }
4655
+ openInfo() { this.emit('infoOpen'); const { root, onKey } = openGameInfoModal(this); this.showModal(root, onKey); }
3079
4656
  openBuyBonus() {
3080
4657
  if (this.config.onBonusBuy) {
3081
4658
  this.config.onBonusBuy();
3082
4659
  return;
3083
4660
  } // game handles it (own UI)
3084
- const overlay = openBuyBonusOverlay(this);
3085
- if (overlay)
3086
- this.showModal(overlay);
4661
+ const result = openBuyBonusOverlay(this);
4662
+ if (result)
4663
+ this.showModal(result.root, result.onKey);
3087
4664
  }
3088
4665
  /** Open a generic, externally-driven modal (title + body + optional action buttons).
3089
4666
  * Each action runs its `on` then closes; the ✕ shows when `availableClose` is true. */
3090
- openModal(opts) { this.showModal(buildModal(opts)); }
4667
+ openModal(opts) { this.showModal(buildModal(opts), opts.onKey); }
3091
4668
  /** Programmatically dismiss whatever modal/overlay is currently shown (e.g. auto-close the
3092
4669
  * reconnect overlay once the link is restored). No-op when nothing is open. */
3093
- closeModal() { this.modalHost.innerHTML = ''; }
4670
+ closeModal() { this.modalOnKey = undefined; this.soundRefresh = null; this.modalHost.innerHTML = ''; }
4671
+ /** Flip the shared sound state, notify the game (`settingChange({ key: 'sound' })`), and live-update
4672
+ * the Settings speaker icon if that modal is open. Used by both the Settings toggle and Shift+M. */
4673
+ setSound(on) {
4674
+ this.soundOn = on;
4675
+ this.emit('settingChange', { key: 'sound', value: on });
4676
+ this.soundRefresh?.(on);
4677
+ }
4678
+ /** The Settings modal registers an icon-updater while open (cleared on close). */
4679
+ setSoundRefresh(fn) { this.soundRefresh = fn; }
3094
4680
  /** Open the non-dismissable replay summary modal (START REPLAY → onReplay → reopen). */
3095
4681
  openReplay(opts) {
3096
4682
  if (this.destroyed)
@@ -3098,19 +4684,18 @@ class GameShell extends EventEmitter {
3098
4684
  this.showModal(buildReplayModal(this, opts));
3099
4685
  }
3100
4686
  /** Bet picker — list of available bets with an accent Confirm. */
3101
- openBetPicker() { this.showModal(openBetModal(this)); }
4687
+ openBetPicker() { const { root, onKey } = openBetModal(this); this.showModal(root, onKey); }
3102
4688
  /** Autoplay picker — spin-count list; Confirm starts autoplay. */
3103
- openAutoplayPicker() { this.showModal(openAutoplayModal(this)); }
4689
+ openAutoplayPicker() { const { root, onKey } = openAutoplayModal(this); this.showModal(root, onKey); }
3104
4690
  destroy() {
3105
4691
  if (this.destroyed)
3106
4692
  return Promise.resolve();
3107
4693
  this.destroyed = true;
3108
4694
  this.ro?.disconnect();
3109
4695
  this.ro = null;
3110
- if (this.keysBound) {
3111
- document.removeEventListener('keydown', this.handleKeyDown);
4696
+ if (typeof document !== 'undefined') {
4697
+ this.kbd?.detach();
3112
4698
  document.removeEventListener('pointerdown', this.pullFocus, true);
3113
- this.keysBound = false;
3114
4699
  }
3115
4700
  this.cancelMoneyAnims();
3116
4701
  this.removeAllListeners();
@@ -3154,5 +4739,5 @@ function removeGameShell() {
3154
4739
  return shell.destroy();
3155
4740
  }
3156
4741
 
3157
- export { DevBridge, EventEmitter, GameShell, LOADER_BAR_MAX_WIDTH, PlatformSession, buildLogoSVG, createCSSPreloader, createGameShell, createPlatformSession, removeCSSPreloader, removeGameShell, setCSSPreloaderProgress, waitCSSPreloaderTap };
4742
+ export { DevBridge, EventEmitter, GameShell, LOADER_BAR_MAX_WIDTH$1 as LOADER_BAR_MAX_WIDTH, PlatformSession, buildLogoSVG, createCSSPreloader, createGameShell, createPlatformSession, removeCSSPreloader, removeGameShell, setCSSPreloaderProgress, waitCSSPreloaderTap };
3158
4743
  //# sourceMappingURL=index.esm.js.map