speakid-hangman 1.0.0 → 1.0.2

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.
@@ -1,5 +1,5 @@
1
- import { jsx as e, jsxs as p } from "react/jsx-runtime";
2
- import { useState as $, useCallback as it, useEffect as at, useMemo as xt } from "react";
1
+ import { jsx as n, jsxs as u, Fragment as X } from "react/jsx-runtime";
2
+ import { useState as m, useMemo as D, useCallback as ae, useEffect as le } from "react";
3
3
  const a = {
4
4
  gmCenterScreen: {
5
5
  position: "relative",
@@ -201,145 +201,145 @@ const a = {
201
201
  display: "block"
202
202
  }
203
203
  };
204
- function bt({
204
+ function ve({
205
205
  mistakes: r,
206
- maxMistakes: f,
207
- size: x = 200
206
+ maxMistakes: Z,
207
+ size: G = 200
208
208
  }) {
209
- const l = x, c = x * 1.25, b = Math.max(2, x / 100), W = 10 * (l / 200), w = 240 * (c / 250), m = 150 * (l / 200), y = 80 * (l / 200), K = 20 * (c / 250), _ = 240 * (c / 250), S = 80 * (l / 200), V = 20 * (c / 250), L = 150 * (l / 200), H = 150 * (l / 200), F = 20 * (c / 250), R = 50 * (c / 250), T = 150 * (l / 200), I = 70 * (c / 250), P = 20 * (l / 200), B = 150 * (l / 200), q = 90 * (c / 250), O = 150 * (c / 250), u = 150 * (l / 200), z = 110 * (c / 250), h = 130 * (l / 200), E = 130 * (c / 250), st = 150 * (l / 200), C = 110 * (c / 250), J = 170 * (l / 200), U = 130 * (c / 250), s = 150 * (l / 200), v = 150 * (c / 250), g = 130 * (l / 200), i = 190 * (c / 250), j = 150 * (l / 200), n = 150 * (c / 250), k = 170 * (l / 200), tt = 190 * (c / 250), M = r === 0 || r <= f * 0.5 ? "#1f2937" : r <= f * 0.75 ? "#f59e0b" : "#ec4c44";
210
- return /* @__PURE__ */ p(
209
+ const l = G, d = G * 1.25, y = Math.max(2, G / 100), T = 10 * (l / 200), b = 240 * (d / 250), f = 150 * (l / 200), x = 80 * (l / 200), K = 20 * (d / 250), Q = 240 * (d / 250), w = 80 * (l / 200), N = 20 * (d / 250), $ = 150 * (l / 200), B = 150 * (l / 200), M = 20 * (d / 250), z = 50 * (d / 250), v = 150 * (l / 200), C = 70 * (d / 250), _ = 20 * (l / 200), S = 150 * (l / 200), q = 90 * (d / 250), Y = 150 * (d / 250), h = 150 * (l / 200), F = 110 * (d / 250), g = 130 * (l / 200), W = 130 * (d / 250), J = 150 * (l / 200), H = 110 * (d / 250), ce = 170 * (l / 200), L = 130 * (d / 250), ee = 150 * (l / 200), V = 150 * (d / 250), p = 130 * (l / 200), te = 190 * (d / 250), I = 150 * (l / 200), ne = 150 * (d / 250), s = 170 * (l / 200), R = 190 * (d / 250), c = r === 0 || r <= Z * 0.5 ? "#1f2937" : r <= Z * 0.75 ? "#f59e0b" : "#ec4c44";
210
+ return /* @__PURE__ */ u(
211
211
  "svg",
212
212
  {
213
213
  width: l,
214
- height: c,
214
+ height: d,
215
215
  style: {
216
216
  display: "block",
217
217
  margin: "0 auto"
218
218
  },
219
219
  children: [
220
- r > 0 && /* @__PURE__ */ e(
220
+ r > 0 && /* @__PURE__ */ n(
221
221
  "line",
222
222
  {
223
- x1: W,
224
- y1: w,
225
- x2: m,
226
- y2: w,
227
- stroke: M,
228
- strokeWidth: b
223
+ x1: T,
224
+ y1: b,
225
+ x2: f,
226
+ y2: b,
227
+ stroke: c,
228
+ strokeWidth: y
229
229
  }
230
230
  ),
231
- r > 1 && /* @__PURE__ */ e(
231
+ r > 1 && /* @__PURE__ */ n(
232
232
  "line",
233
233
  {
234
- x1: y,
234
+ x1: x,
235
235
  y1: K,
236
- x2: y,
237
- y2: _,
238
- stroke: M,
239
- strokeWidth: b
236
+ x2: x,
237
+ y2: Q,
238
+ stroke: c,
239
+ strokeWidth: y
240
240
  }
241
241
  ),
242
- r > 2 && /* @__PURE__ */ e(
242
+ r > 2 && /* @__PURE__ */ n(
243
243
  "line",
244
244
  {
245
- x1: S,
246
- y1: V,
247
- x2: L,
248
- y2: V,
249
- stroke: M,
250
- strokeWidth: b
245
+ x1: w,
246
+ y1: N,
247
+ x2: $,
248
+ y2: N,
249
+ stroke: c,
250
+ strokeWidth: y
251
251
  }
252
252
  ),
253
- r > 3 && /* @__PURE__ */ e(
253
+ r > 3 && /* @__PURE__ */ n(
254
254
  "line",
255
255
  {
256
- x1: H,
257
- y1: F,
258
- x2: H,
259
- y2: R,
260
- stroke: M,
261
- strokeWidth: b
256
+ x1: B,
257
+ y1: M,
258
+ x2: B,
259
+ y2: z,
260
+ stroke: c,
261
+ strokeWidth: y
262
262
  }
263
263
  ),
264
- r > 4 && /* @__PURE__ */ e(
264
+ r > 4 && /* @__PURE__ */ n(
265
265
  "circle",
266
266
  {
267
- cx: T,
268
- cy: I,
269
- r: P,
270
- stroke: M,
267
+ cx: v,
268
+ cy: C,
269
+ r: _,
270
+ stroke: c,
271
271
  fill: "none",
272
- strokeWidth: b
272
+ strokeWidth: y
273
273
  }
274
274
  ),
275
- r > 5 && /* @__PURE__ */ e(
275
+ r > 5 && /* @__PURE__ */ n(
276
276
  "line",
277
277
  {
278
- x1: B,
278
+ x1: S,
279
279
  y1: q,
280
- x2: B,
281
- y2: O,
282
- stroke: M,
283
- strokeWidth: b
280
+ x2: S,
281
+ y2: Y,
282
+ stroke: c,
283
+ strokeWidth: y
284
284
  }
285
285
  ),
286
- r > 6 && /* @__PURE__ */ e(
286
+ r > 6 && /* @__PURE__ */ n(
287
287
  "line",
288
288
  {
289
- x1: u,
290
- y1: z,
291
- x2: h,
292
- y2: E,
293
- stroke: M,
294
- strokeWidth: b
289
+ x1: h,
290
+ y1: F,
291
+ x2: g,
292
+ y2: W,
293
+ stroke: c,
294
+ strokeWidth: y
295
295
  }
296
296
  ),
297
- r > 7 && /* @__PURE__ */ e(
297
+ r > 7 && /* @__PURE__ */ n(
298
298
  "line",
299
299
  {
300
- x1: st,
301
- y1: C,
302
- x2: J,
303
- y2: U,
304
- stroke: M,
305
- strokeWidth: b
300
+ x1: J,
301
+ y1: H,
302
+ x2: ce,
303
+ y2: L,
304
+ stroke: c,
305
+ strokeWidth: y
306
306
  }
307
307
  ),
308
- r > 8 && /* @__PURE__ */ e(
308
+ r > 8 && /* @__PURE__ */ n(
309
309
  "line",
310
310
  {
311
- x1: s,
312
- y1: v,
313
- x2: g,
314
- y2: i,
315
- stroke: M,
316
- strokeWidth: b
311
+ x1: ee,
312
+ y1: V,
313
+ x2: p,
314
+ y2: te,
315
+ stroke: c,
316
+ strokeWidth: y
317
317
  }
318
318
  ),
319
- r > 9 && /* @__PURE__ */ e(
319
+ r > 9 && /* @__PURE__ */ n(
320
320
  "line",
321
321
  {
322
- x1: j,
323
- y1: n,
324
- x2: k,
325
- y2: tt,
326
- stroke: M,
327
- strokeWidth: b
322
+ x1: I,
323
+ y1: ne,
324
+ x2: s,
325
+ y2: R,
326
+ stroke: c,
327
+ strokeWidth: y
328
328
  }
329
329
  )
330
330
  ]
331
331
  }
332
332
  );
333
333
  }
334
- function Mt({
334
+ function Le({
335
335
  gameCubeSize: r = 400,
336
- screenHeight: f = 800,
337
- screenWidth: x = 800,
336
+ screenHeight: Z = 800,
337
+ screenWidth: G = 800,
338
338
  logoUrl: l,
339
- showLogo: c = !0,
340
- baseURL: b
339
+ showLogo: d = !0,
340
+ baseURL: y
341
341
  } = {}) {
342
- const W = {
342
+ const T = {
343
343
  Professions: ["teacher", "doctor", "nurse", "driver", "police", "firefighter", "cook", "waiter", "farmer", "builder", "singer", "actor", "dentist", "pilot", "vet", "artist", "cleaner", "student", "baker", "mechanic"],
344
344
  Family: ["mother", "father", "sister", "brother", "grandmother", "grandfather", "aunt", "uncle", "cousin", "baby", "parents", "children", "wife", "husband", "son", "daughter", "family", "twins", "relatives"],
345
345
  "Farm animals": ["cow", "pig", "horse", "sheep", "goat", "duck", "chicken", "rooster", "turkey", "goose", "rabbit", "mouse", "donkey", "bee", "hen", "lamb", "bull", "pony"],
@@ -357,126 +357,133 @@ function Mt({
357
357
  Environment: ["tree", "forest", "air", "water", "pollution", "recycle", "nature", "clean", "waste", "plastic", "energy", "animal", "climate", "earth", "ocean", "river", "planet", "save", "green", "environment", "litter", "organic"],
358
358
  Space: ["planet", "star", "sun", "moon", "astronaut", "rocket", "space", "galaxy", "universe", "telescope", "comet", "asteroid", "orbit", "gravity", "alien", "spaceship", "mars", "satellite", "sky", "eclipse"],
359
359
  Devices: ["computer", "laptop", "phone", "tablet", "tv", "keyboard", "mouse", "printer", "camera", "headphones", "charger", "screen", "watch", "microphone", "speaker", "console", "router", "battery", "cable", "remote"]
360
- }, [w, m] = $("lobby"), [y, K] = $(""), [_] = $("Normal"), [S, V] = $(0), [L, H] = $(1), [F, R] = $(""), [T, I] = $([]), [P, B] = $(0), [q, O] = $(0), [u, z] = $(null), [h, E] = $(null), [st, C] = $([]), J = _ === "Easy" ? 8 : _ === "Normal" ? 6 : 4, U = b || (typeof window < "u" && window.origin ? `${window.origin}/cloud/speakid/games/hangman` : "/cloud/speakid/games/hangman"), s = (x ?? (typeof window < "u" ? window.innerWidth : 800)) < 768 || (x ?? (typeof window < "u" ? window.innerWidth : 800)) === 926 && (f ?? (typeof window < "u" ? window.innerHeight : 800)) === 428 || (x ?? (typeof window < "u" ? window.innerWidth : 800)) === 932 && (f ?? (typeof window < "u" ? window.innerHeight : 800)) === 430 || r < 600, v = (x ?? (typeof window < "u" ? window.innerWidth : 800)) === 1024 && (f ?? (typeof window < "u" ? window.innerHeight : 800)) === 600, g = r / 400, i = {
361
- headline1: s ? Math.max(24, Math.min(30, 30 * g)) : Math.max(28, Math.min(32, 32 * g)),
362
- // Desktop: 24px
363
- headline3: s ? Math.max(14, Math.min(18, 16 * g)) : Math.max(20, Math.min(26, 24 * g)),
364
- // Desktop: 24px
365
- bodyL: Math.max(14, Math.min(20, 18 * g)),
366
- // Desktop: 18px
367
- bodyM: s ? Math.max(12, Math.min(16, 14 * g)) : Math.max(14, Math.min(18, 16 * g)),
368
- // Desktop: 16px
369
- bodyS: s ? Math.max(10, Math.min(14, 12 * g)) : Math.max(12, Math.min(16, 14 * g)),
370
- // Desktop: 14px
371
- wordDisplay: Math.max(18, Math.min(32, 26 * g)),
372
- // Адаптивный размер
373
- button: Math.max(12, Math.min(18, 16 * g))
374
- // Desktop: 16px
375
- }, j = v ? Math.max(8, Math.min(12, 10 * g)) : Math.max(12, Math.min(24, 16 * g)), n = v ? Math.max(3, Math.min(6, 5 * g)) : Math.max(4, Math.min(12, 8 * g)), k = Math.max(6, Math.min(10, 8 * g)), tt = (t, o) => t.split("").every((d) => o.includes(d)), lt = (t, o) => t.split("").map((d) => o.includes(d) ? d : "_").join(" "), M = (t) => "abcdefghijklmnopqrstuvwxyz".split("").filter((d) => !t.includes(d)), Z = (t, o = []) => {
376
- var pt;
377
- if (!t || !W[t]) {
378
- const A = Object.keys(W)[0];
379
- return ((pt = W[A]) == null ? void 0 : pt[0]) || "";
360
+ }, [b, f] = m("lobby"), [x, K] = m(""), [Q] = m("Normal"), [w, N] = m(0), [$, B] = m(1), [M, z] = m(""), [v, C] = m([]), [_, S] = m(0), [q, Y] = m(0), [h, F] = m(null), [g, W] = m(null), [J, H] = m(1), [ce, L] = m([]), ee = Q === "Easy" ? 8 : Q === "Normal" ? 6 : 4, V = y || (typeof window < "u" && window.origin ? `${window.origin}/cloud/speakid/games/hangman` : "/cloud/speakid/games/hangman"), [p, te] = m(!1), [I, ne] = m(!1), s = D(() => {
361
+ const e = (g || r || 1e3) / 400;
362
+ return {
363
+ headline1: p ? Math.max(24, Math.min(30, 30 * e)) : Math.max(28, Math.min(32, 32 * e)),
364
+ // Desktop: 32px
365
+ headline2: Math.max(20, Math.min(28, 24 * e)),
366
+ // Desktop: 24px
367
+ headline3: p ? Math.max(14, Math.min(18, 16 * e)) : Math.max(20, Math.min(26, 24 * e)),
368
+ // Desktop: 24px
369
+ bodyL: Math.max(14, Math.min(20, 18 * e)),
370
+ // Desktop: 18px
371
+ bodyM: p ? Math.max(12, Math.min(16, 14 * e)) : Math.max(14, Math.min(18, 16 * e)),
372
+ // Desktop: 16px
373
+ bodyS: p ? Math.max(10, Math.min(14, 12 * e)) : Math.max(12, Math.min(16, 14 * e)),
374
+ // Desktop: 14px
375
+ wordDisplay: Math.max(18, Math.min(32, 26 * e)),
376
+ // Адаптивный размер
377
+ button: Math.max(12, Math.min(18, 16 * e))
378
+ // Desktop: 16px
379
+ };
380
+ }, [p, g, r]), R = D(() => {
381
+ const e = (g || r || 1e3) / 400;
382
+ return I ? Math.max(8, Math.min(12, 10 * e)) : Math.max(12, Math.min(24, 16 * e));
383
+ }, [I, g, r]), o = D(() => {
384
+ const e = (g || r || 1e3) / 400;
385
+ return I ? Math.max(3, Math.min(6, 5 * e)) : Math.max(4, Math.min(12, 8 * e));
386
+ }, [I, g, r]), c = D(() => {
387
+ const e = (g || r || 1e3) / 400;
388
+ return Math.max(6, Math.min(10, 8 * e));
389
+ }, [g, r]), he = (e, t) => e.split("").every((i) => t.includes(i)), me = (e, t) => e.split("").map((i) => t.includes(i) ? i : "_").join(" "), fe = (e) => "abcdefghijklmnopqrstuvwxyz".split("").filter((i) => !e.includes(i)), P = (e, t = []) => {
390
+ var U;
391
+ if (!e || !T[e]) {
392
+ const k = Object.keys(T)[0];
393
+ return ((U = T[k]) == null ? void 0 : U[0]) || "";
380
394
  }
381
- const d = W[t];
382
- if (!d || d.length === 0)
395
+ const i = T[e];
396
+ if (!i || i.length === 0)
383
397
  return "";
384
- const Y = d.filter((A) => !o.includes(A)), G = Y.length > 0 ? Y : d;
385
- if (G.length === 0)
398
+ const j = i.filter((k) => !t.includes(k)), E = j.length > 0 ? j : i;
399
+ if (E.length === 0)
386
400
  return "";
387
- let N;
401
+ let O;
388
402
  if (typeof crypto < "u" && crypto.getRandomValues) {
389
- const A = new Uint32Array(1);
390
- crypto.getRandomValues(A);
391
- const yt = A[0] / 4294967295;
392
- N = Math.floor(yt * G.length);
403
+ const k = new Uint32Array(1);
404
+ crypto.getRandomValues(k);
405
+ const ue = k[0] / 4294967295;
406
+ O = Math.floor(ue * E.length);
393
407
  } else
394
- N = Math.floor(Math.random() * G.length);
395
- return G[N];
396
- }, ut = () => {
397
- if (!y) return;
398
- C([]);
399
- const t = Z(y, []);
400
- if (!t) {
401
- m("category");
408
+ O = Math.floor(Math.random() * E.length);
409
+ return E[O];
410
+ }, xe = () => {
411
+ if (!x) return;
412
+ L([]);
413
+ const e = P(x, []);
414
+ if (!e) {
415
+ f("category");
402
416
  return;
403
417
  }
404
- R(t), C([t]), I([]), B(0), H(1), O(0), z(null), m("game");
405
- }, et = it((t) => {
406
- if (w !== "game" || u !== null) return;
407
- const o = t.toLowerCase();
408
- /^[a-z]$/.test(o) && (I((d) => d.includes(o) ? d : [...d, o]), R((d) => (d && !d.includes(o) && B((Y) => Y + 1), d)));
409
- }, [w, u]), nt = it((t) => {
410
- et(t.key);
411
- }, [et]);
412
- at(() => {
413
- if (w === "game")
414
- return window.addEventListener("keydown", nt), () => window.removeEventListener("keydown", nt);
415
- }, [w, nt]);
416
- const mt = F ? lt(F, T) : "", dt = F ? tt(F, T) : !1, ct = P >= 10, ht = M(T), ot = it(() => {
417
- if (!y || L >= S) {
418
- m("result");
418
+ z(e), L([e]), C([]), S(0), B(1), Y(0), F(null), f("game");
419
+ }, oe = ae((e) => {
420
+ if (b !== "game" || h !== null) return;
421
+ const t = e.toLowerCase();
422
+ /^[a-z]$/.test(t) && (C((i) => i.includes(t) ? i : [...i, t]), z((i) => (i && !i.includes(t) && S((j) => j + 1), i)));
423
+ }, [b, h]), re = ae((e) => {
424
+ oe(e.key);
425
+ }, [oe]);
426
+ le(() => {
427
+ if (b === "game")
428
+ return window.addEventListener("keydown", re), () => window.removeEventListener("keydown", re);
429
+ }, [b, re]);
430
+ const ye = M ? me(M, v) : "", de = M ? he(M, v) : !1, ge = _ >= 10, be = fe(v), ie = ae(() => {
431
+ if (!x || $ >= w) {
432
+ f("result");
419
433
  return;
420
434
  }
421
- H((t) => t + 1), C((t) => {
422
- const o = Z(y, t);
423
- return o ? (R(o), [...t, o]) : t;
424
- }), I([]), B(0), z(null);
425
- }, [y, L, S]);
426
- at(() => {
427
- if (dt && u === null) {
428
- z("win"), O((o) => o + 1);
429
- const t = setTimeout(() => {
430
- ot();
435
+ B((e) => e + 1), L((e) => {
436
+ const t = P(x, e);
437
+ return t ? (z(t), [...e, t]) : e;
438
+ }), C([]), S(0), F(null);
439
+ }, [x, $, w]);
440
+ le(() => {
441
+ if (de && h === null) {
442
+ F("win"), Y((t) => t + 1);
443
+ const e = setTimeout(() => {
444
+ ie();
431
445
  }, 2e3);
432
- return () => clearTimeout(t);
446
+ return () => clearTimeout(e);
433
447
  }
434
- if (ct && u === null) {
435
- z("lose");
436
- const t = setTimeout(() => {
437
- ot();
448
+ if (ge && h === null) {
449
+ F("lose");
450
+ const e = setTimeout(() => {
451
+ ie();
438
452
  }, 2e3);
439
- return () => clearTimeout(t);
453
+ return () => clearTimeout(e);
440
454
  }
441
- }, [dt, ct, u, ot]);
442
- const ft = () => {
443
- if (!y || L >= S) {
444
- m("result");
455
+ }, [de, ge, h, ie]);
456
+ const ke = () => {
457
+ if (!x || $ >= w) {
458
+ f("result");
445
459
  return;
446
460
  }
447
- H((t) => t + 1), C((t) => {
448
- const o = Z(y, t);
449
- return o ? (R(o), [...t, o]) : t;
450
- }), I([]), B(0), z(null);
461
+ B((e) => e + 1), L((e) => {
462
+ const t = P(x, e);
463
+ return t ? (z(t), [...e, t]) : e;
464
+ }), C([]), S(0), F(null);
451
465
  };
452
- at(() => {
453
- const t = x ?? window.innerWidth, o = f ?? window.innerHeight, d = o < 700;
454
- if (s)
455
- E(r && r >= 320 ? r : null);
456
- else if (v) {
457
- const Y = r ? Math.max(400, Math.min(950, r)) : Math.min(950, Math.min(t * 0.92, o * 0.92));
458
- E(Y);
459
- } else if (d)
460
- E(r && r >= 400 ? r : null);
461
- else {
462
- const N = r ? Math.max(400, Math.min(1200, r)) : Math.min(1e3, Math.min(t, o) * 0.9);
463
- E(N);
464
- }
465
- }, [x, f, r, s, v]);
466
- const X = {
467
- width: "100%",
468
- height: "100%",
469
- display: "flex",
470
- justifyContent: "center",
471
- alignItems: "center",
472
- background: "transparent",
473
- overflow: "hidden",
474
- position: "absolute",
475
- top: 0,
476
- left: 0,
477
- right: 0,
478
- bottom: 0
479
- }, rt = `
466
+ le(() => {
467
+ const e = () => {
468
+ const t = window.innerWidth, i = window.innerHeight, j = t < 768 || t === 926 && i === 428 || t === 932 && i === 430, E = i < 700, O = t / i > 1.8, U = t === 1024 && i === 600;
469
+ if (te(j), ne(U), r && r >= 320) {
470
+ const $e = Math.max(320, Math.min(1200, r));
471
+ W($e), H(1);
472
+ } else if (j)
473
+ W(null), H(1);
474
+ else if (E)
475
+ W(null), H(1);
476
+ else if (O) {
477
+ const k = Math.min(1e3, Math.min(t, i) * 0.9);
478
+ W(k), H(0.85);
479
+ } else {
480
+ const k = Math.min(1e3, Math.min(t, i) * 0.9);
481
+ W(k), H(1);
482
+ }
483
+ };
484
+ return e(), window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
485
+ }, [r]);
486
+ const se = `
480
487
  <svg width="100%" height="100%" xmlns="http://www.w3.org/2000/svg" style="position: absolute; top: 0; left: 0; pointer-events: none; opacity: 0.2;">
481
488
  <!-- Каракули мелками и фломастерами -->
482
489
 
@@ -520,39 +527,33 @@ function Mt({
520
527
  <path d="M 35% 85% Q 37% 83%, 39% 85% T 43% 85% T 47% 85%"
521
528
  fill="none" stroke="#FF4500" stroke-width="3.5" stroke-linecap="round"/>
522
529
  </svg>
523
- `, D = {
530
+ `, we = {
524
531
  ...a.gmCenterScreen,
525
- width: s ? "100%" : v ? h || r || 950 : h || r || 1e3,
526
- height: s ? "100%" : v ? "auto" : h || r || 1e3,
527
- minHeight: s ? "100%" : v ? "auto" : h || r || 1e3,
528
- maxHeight: s ? "100%" : v ? "92vh" : h || r || 1e3,
529
- padding: `${j}px`,
532
+ width: "100%",
533
+ height: "100%",
534
+ padding: `${R}px`,
530
535
  overflow: "auto",
531
- borderRadius: s ? 0 : "20px",
532
536
  position: "relative",
533
537
  boxSizing: "border-box",
534
- background: "#ffffff",
535
- // Белый фон как на скриншоте
536
- boxShadow: s ? "none" : "0 0 40px rgba(0,0,0,0.1)",
537
- // Легкая тень для десктопа
538
- margin: s ? "0 auto" : "unset"
539
- }, gt = !s && c, Q = xt(
538
+ background: "transparent"
539
+ }, pe = !p && d, A = D(
540
540
  () => {
541
- if (s && (x ?? window.innerWidth) > (f ?? window.innerHeight) || (f ?? window.innerHeight) < 700 || !gt)
541
+ const e = window.innerWidth, t = window.innerHeight;
542
+ if (p && e > t || t < 700 || !pe)
542
543
  return null;
543
- const t = l || (typeof window < "u" && window.origin ? `${window.origin}/cloud/speakid/games/hangman/logo` : "/cloud/speakid/games/hangman/logo");
544
- return /* @__PURE__ */ e("div", { style: { ...a.gmLogoFixed, position: "absolute", top: 16, left: 16, zIndex: 30 }, children: /* @__PURE__ */ p("picture", { children: [
545
- /* @__PURE__ */ e(
544
+ const i = l || (typeof window < "u" && window.origin ? `${window.origin}/cloud/speakid/games/hangman/logo` : "/cloud/speakid/games/hangman/logo");
545
+ return /* @__PURE__ */ n("div", { style: { ...a.gmLogoFixed, position: "absolute", top: 16, left: 16, zIndex: 30 }, children: /* @__PURE__ */ u("picture", { children: [
546
+ /* @__PURE__ */ n(
546
547
  "source",
547
548
  {
548
- srcSet: `${t}.svg`,
549
+ srcSet: `${i}.svg`,
549
550
  type: "image/svg+xml"
550
551
  }
551
552
  ),
552
- /* @__PURE__ */ e(
553
+ /* @__PURE__ */ n(
553
554
  "img",
554
555
  {
555
- src: `${t}.png`,
556
+ src: `${i}.png`,
556
557
  alt: "SPEAKID Logo",
557
558
  style: a.gmLogoImg,
558
559
  loading: "lazy"
@@ -560,29 +561,28 @@ function Mt({
560
561
  )
561
562
  ] }) });
562
563
  },
563
- [s, gt, l, x, f]
564
- );
565
- return w === "lobby" ? /* @__PURE__ */ e("div", { style: X, children: /* @__PURE__ */ p("div", { style: D, children: [
566
- Q,
567
- /* @__PURE__ */ e("div", { dangerouslySetInnerHTML: { __html: rt } }),
568
- /* @__PURE__ */ e("h1", { style: {
564
+ [p, pe, l]
565
+ ), Me = () => b === "lobby" ? /* @__PURE__ */ u(X, { children: [
566
+ A,
567
+ /* @__PURE__ */ n("div", { dangerouslySetInnerHTML: { __html: se } }),
568
+ /* @__PURE__ */ n("h1", { style: {
569
569
  ...a.gmHeadline1,
570
- fontSize: `${i.headline1}px`,
571
- marginBottom: `${n * 3}px`,
570
+ fontSize: `${s.headline1}px`,
571
+ marginBottom: `${o * 3}px`,
572
572
  position: "relative",
573
573
  zIndex: 1
574
574
  }, children: "HANGMAN" }),
575
- /* @__PURE__ */ p(
575
+ /* @__PURE__ */ u(
576
576
  "button",
577
577
  {
578
- onClick: () => m("category"),
578
+ onClick: () => f("category"),
579
579
  style: {
580
580
  fontFamily: '"Onest", system-ui, sans-serif',
581
581
  fontWeight: 500,
582
582
  // Medium для более заметности
583
- fontSize: `${i.button}px`,
584
- padding: `${n * 1.2}px ${n * 3}px`,
585
- borderRadius: `${k * 1.5}px`,
583
+ fontSize: `${s.button}px`,
584
+ padding: `${o * 1.2}px ${o * 3}px`,
585
+ borderRadius: `${c * 1.5}px`,
586
586
  position: "relative",
587
587
  zIndex: 1,
588
588
  display: "flex",
@@ -596,26 +596,26 @@ function Mt({
596
596
  boxShadow: "0 2px 8px rgba(236, 76, 68, 0.2)",
597
597
  minWidth: "120px"
598
598
  },
599
- onMouseEnter: (t) => {
600
- t.currentTarget.style.background = "#d43a32", t.currentTarget.style.transform = "translateY(-2px)", t.currentTarget.style.boxShadow = "0 4px 12px rgba(236, 76, 68, 0.3)";
599
+ onMouseEnter: (e) => {
600
+ e.currentTarget.style.background = "#d43a32", e.currentTarget.style.transform = "translateY(-2px)", e.currentTarget.style.boxShadow = "0 4px 12px rgba(236, 76, 68, 0.3)";
601
601
  },
602
- onMouseLeave: (t) => {
603
- t.currentTarget.style.background = "#ec4c44", t.currentTarget.style.transform = "translateY(0)", t.currentTarget.style.boxShadow = "0 2px 8px rgba(236, 76, 68, 0.2)";
602
+ onMouseLeave: (e) => {
603
+ e.currentTarget.style.background = "#ec4c44", e.currentTarget.style.transform = "translateY(0)", e.currentTarget.style.boxShadow = "0 2px 8px rgba(236, 76, 68, 0.2)";
604
604
  },
605
- onMouseDown: (t) => {
606
- t.currentTarget.style.transform = "translateY(0)";
605
+ onMouseDown: (e) => {
606
+ e.currentTarget.style.transform = "translateY(0)";
607
607
  },
608
608
  children: [
609
- /* @__PURE__ */ e(
609
+ /* @__PURE__ */ n(
610
610
  "svg",
611
611
  {
612
- width: `${i.button * 1.3}px`,
613
- height: `${i.button * 1.3}px`,
612
+ width: `${s.button * 1.3}px`,
613
+ height: `${s.button * 1.3}px`,
614
614
  viewBox: "0 0 24 24",
615
615
  fill: "none",
616
616
  xmlns: "http://www.w3.org/2000/svg",
617
- style: { display: "block", marginRight: `${n}px` },
618
- children: /* @__PURE__ */ e(
617
+ style: { display: "block", marginRight: `${o}px` },
618
+ children: /* @__PURE__ */ n(
619
619
  "path",
620
620
  {
621
621
  d: "M8 5V19L19 12L8 5Z",
@@ -625,11 +625,11 @@ function Mt({
625
625
  )
626
626
  }
627
627
  ),
628
- /* @__PURE__ */ e("span", { style: { fontWeight: 500 }, children: "PLAY" })
628
+ /* @__PURE__ */ n("span", { style: { fontWeight: 500 }, children: "PLAY" })
629
629
  ]
630
630
  }
631
631
  ),
632
- /* @__PURE__ */ p("div", { style: {
632
+ /* @__PURE__ */ u("div", { style: {
633
633
  position: "absolute",
634
634
  top: "50%",
635
635
  left: "50%",
@@ -639,34 +639,34 @@ function Mt({
639
639
  pointerEvents: "none",
640
640
  zIndex: 0
641
641
  }, children: [
642
- /* @__PURE__ */ e(
642
+ /* @__PURE__ */ n(
643
643
  "img",
644
644
  {
645
- src: `${U}/sun.png`,
645
+ src: `${V}/sun.png`,
646
646
  alt: "Sun",
647
647
  style: {
648
648
  position: "absolute",
649
- left: s ? "-10%" : "5%",
649
+ left: p ? "-10%" : "5%",
650
650
  top: "20%",
651
651
  width: "auto",
652
- height: s ? `${Math.min(f * 0.33, 200)}px` : `${Math.min((h || r) * 0.33, 300)}px`,
652
+ height: p ? `${Math.min(window.innerHeight * 0.33, 200)}px` : `${Math.min((g || r || 1e3) * 0.33, 300)}px`,
653
653
  maxHeight: "33vh",
654
654
  objectFit: "contain",
655
655
  opacity: 0.6
656
656
  }
657
657
  }
658
658
  ),
659
- /* @__PURE__ */ e(
659
+ /* @__PURE__ */ n(
660
660
  "img",
661
661
  {
662
- src: `${U}/character.png`,
662
+ src: `${V}/character.png`,
663
663
  alt: "Hangman character",
664
664
  style: {
665
665
  position: "absolute",
666
- right: s ? "5%" : "10%",
666
+ right: p ? "5%" : "10%",
667
667
  bottom: "10%",
668
668
  width: "auto",
669
- height: s ? `${Math.min(f * 0.33, 200)}px` : `${Math.min((h || r) * 0.33, 300)}px`,
669
+ height: p ? `${Math.min(window.innerHeight * 0.33, 200)}px` : `${Math.min((g || r || 1e3) * 0.33, 300)}px`,
670
670
  maxHeight: "33vh",
671
671
  objectFit: "contain",
672
672
  opacity: 0.6
@@ -674,53 +674,54 @@ function Mt({
674
674
  }
675
675
  )
676
676
  ] })
677
- ] }) }) : w === "category" ? /* @__PURE__ */ e("div", { style: X, children: /* @__PURE__ */ p("div", { style: D, children: [
678
- Q,
679
- /* @__PURE__ */ e("div", { dangerouslySetInnerHTML: { __html: rt } }),
680
- /* @__PURE__ */ e(
677
+ ] }) : b === "category" ? /* @__PURE__ */ u(X, { children: [
678
+ A,
679
+ /* @__PURE__ */ n("div", { dangerouslySetInnerHTML: { __html: se } }),
680
+ /* @__PURE__ */ n(
681
681
  "button",
682
682
  {
683
- onClick: () => m("lobby"),
684
- onMouseEnter: (t) => {
685
- t.currentTarget.style.backgroundColor = "#e5e7eb";
683
+ onClick: () => f("lobby"),
684
+ onMouseEnter: (e) => {
685
+ e.currentTarget.style.backgroundColor = "#e5e7eb";
686
686
  },
687
- onMouseLeave: (t) => {
688
- t.currentTarget.style.backgroundColor = "#f9f9f9";
687
+ onMouseLeave: (e) => {
688
+ e.currentTarget.style.backgroundColor = "#f9f9f9";
689
689
  },
690
690
  style: {
691
691
  ...a.gmButton,
692
692
  ...a.gmButtonSecondary,
693
- fontSize: `${i.button}px`,
694
- padding: `${n}px ${n * 1.5}px`,
695
- borderRadius: `${k}px`,
693
+ fontSize: `${s.button}px`,
694
+ padding: `${o}px ${o * 1.5}px`,
695
+ borderRadius: `${c}px`,
696
696
  position: "absolute",
697
- top: `${j}px`,
698
- left: `${j}px`,
697
+ top: `${R}px`,
698
+ left: `${R + 100}px`,
699
+ // ✅ Смещаем правее логотипа
699
700
  zIndex: 10
700
701
  },
701
702
  children: "←"
702
703
  }
703
704
  ),
704
- /* @__PURE__ */ e("div", { style: { ...a.gmButtonGroup, gap: `${n}px`, marginBottom: `${n * 3}px`, marginTop: `${n * 4}px`, position: "relative", zIndex: 1 }, children: Object.keys(W).map((t) => /* @__PURE__ */ e(
705
+ /* @__PURE__ */ n("div", { style: { ...a.gmButtonGroup, gap: `${o}px`, marginBottom: `${o * 3}px`, marginTop: `${o * 4}px`, position: "relative", zIndex: 1 }, children: Object.keys(T).map((e) => /* @__PURE__ */ n(
705
706
  "button",
706
707
  {
707
708
  onClick: () => {
708
- K(t), m("rounds");
709
+ K(e), f("rounds");
709
710
  },
710
- onMouseEnter: (o) => {
711
- o.currentTarget.style.backgroundColor = "#f0f0f0", o.currentTarget.style.borderColor = "#1f2937", o.currentTarget.style.transform = "scale(1.05)";
711
+ onMouseEnter: (t) => {
712
+ t.currentTarget.style.backgroundColor = "#f0f0f0", t.currentTarget.style.borderColor = "#1f2937", t.currentTarget.style.transform = "scale(1.05)";
712
713
  },
713
- onMouseLeave: (o) => {
714
- o.currentTarget.style.backgroundColor = "transparent", o.currentTarget.style.borderColor = "#e5e7eb", o.currentTarget.style.transform = "scale(1)";
714
+ onMouseLeave: (t) => {
715
+ t.currentTarget.style.backgroundColor = "transparent", t.currentTarget.style.borderColor = "#e5e7eb", t.currentTarget.style.transform = "scale(1)";
715
716
  },
716
717
  style: {
717
718
  fontFamily: '"Onest", system-ui, sans-serif',
718
719
  fontWeight: 500,
719
- fontSize: `${i.button}px`,
720
- padding: `${n * 1.2}px ${n * 2}px`,
721
- borderRadius: `${k * 2}px`,
720
+ fontSize: `${s.button}px`,
721
+ padding: `${o * 1.2}px ${o * 2}px`,
722
+ borderRadius: `${c * 2}px`,
722
723
  // Более округлые для облачков
723
- margin: `${n / 2}px`,
724
+ margin: `${o / 2}px`,
724
725
  background: "transparent",
725
726
  border: "2px solid #e5e7eb",
726
727
  color: "#1f2937",
@@ -728,58 +729,59 @@ function Mt({
728
729
  transition: "background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease",
729
730
  boxShadow: "none"
730
731
  },
731
- children: t
732
+ children: e
732
733
  },
733
- t
734
+ e
734
735
  )) })
735
- ] }) }) : w === "rounds" ? /* @__PURE__ */ e("div", { style: X, children: /* @__PURE__ */ p("div", { style: D, children: [
736
- Q,
737
- /* @__PURE__ */ e("div", { dangerouslySetInnerHTML: { __html: rt } }),
738
- /* @__PURE__ */ e(
736
+ ] }) : b === "rounds" ? /* @__PURE__ */ u(X, { children: [
737
+ A,
738
+ /* @__PURE__ */ n("div", { dangerouslySetInnerHTML: { __html: se } }),
739
+ /* @__PURE__ */ n(
739
740
  "button",
740
741
  {
741
- onClick: () => m("category"),
742
- onMouseEnter: (t) => {
743
- t.currentTarget.style.backgroundColor = "#e5e7eb";
742
+ onClick: () => f("category"),
743
+ onMouseEnter: (e) => {
744
+ e.currentTarget.style.backgroundColor = "#e5e7eb";
744
745
  },
745
- onMouseLeave: (t) => {
746
- t.currentTarget.style.backgroundColor = "#f9f9f9";
746
+ onMouseLeave: (e) => {
747
+ e.currentTarget.style.backgroundColor = "#f9f9f9";
747
748
  },
748
749
  style: {
749
750
  ...a.gmButton,
750
751
  ...a.gmButtonSecondary,
751
- fontSize: `${i.button}px`,
752
- padding: `${n}px ${n * 1.5}px`,
753
- borderRadius: `${k}px`,
752
+ fontSize: `${s.button}px`,
753
+ padding: `${o}px ${o * 1.5}px`,
754
+ borderRadius: `${c}px`,
754
755
  position: "absolute",
755
- top: `${j}px`,
756
- left: `${j}px`,
756
+ top: `${R}px`,
757
+ left: `${R + 100}px`,
758
+ // ✅ Смещаем правее логотипа
757
759
  zIndex: 10
758
760
  },
759
761
  children: "←"
760
762
  }
761
763
  ),
762
- /* @__PURE__ */ e("h1", { style: { ...a.gmHeadline1, fontSize: `${i.headline1}px`, marginBottom: `${n * 2}px`, position: "relative", zIndex: 1 }, children: "Choose rounds" }),
763
- /* @__PURE__ */ e("div", { style: { ...a.gmButtonGroup, gap: `${n}px`, marginBottom: `${n * 3}px`, position: "relative", zIndex: 1 }, children: [1, 3, 5].map((t) => /* @__PURE__ */ e(
764
+ /* @__PURE__ */ n("h1", { style: { ...a.gmHeadline1, fontSize: `${s.headline1}px`, marginBottom: `${o * 2}px`, position: "relative", zIndex: 1 }, children: "Choose rounds" }),
765
+ /* @__PURE__ */ n("div", { style: { ...a.gmButtonGroup, gap: `${o}px`, marginBottom: `${o * 3}px`, position: "relative", zIndex: 1 }, children: [1, 3, 5].map((e) => /* @__PURE__ */ n(
764
766
  "button",
765
767
  {
766
768
  onClick: () => {
767
- V(t), ut();
769
+ N(e), xe();
768
770
  },
769
- onMouseEnter: (o) => {
770
- o.currentTarget.style.backgroundColor = "#f0f0f0", o.currentTarget.style.borderColor = "#1f2937", o.currentTarget.style.transform = "scale(1.05)";
771
+ onMouseEnter: (t) => {
772
+ t.currentTarget.style.backgroundColor = "#f0f0f0", t.currentTarget.style.borderColor = "#1f2937", t.currentTarget.style.transform = "scale(1.05)";
771
773
  },
772
- onMouseLeave: (o) => {
773
- o.currentTarget.style.backgroundColor = "transparent", o.currentTarget.style.borderColor = "#e5e7eb", o.currentTarget.style.transform = "scale(1)";
774
+ onMouseLeave: (t) => {
775
+ t.currentTarget.style.backgroundColor = "transparent", t.currentTarget.style.borderColor = "#e5e7eb", t.currentTarget.style.transform = "scale(1)";
774
776
  },
775
777
  style: {
776
778
  fontFamily: '"Onest", system-ui, sans-serif',
777
779
  fontWeight: 500,
778
- fontSize: `${i.button}px`,
779
- padding: `${n * 1.2}px ${n * 2}px`,
780
- borderRadius: `${k * 2}px`,
780
+ fontSize: `${s.button}px`,
781
+ padding: `${o * 1.2}px ${o * 2}px`,
782
+ borderRadius: `${c * 2}px`,
781
783
  // Более округлые для облачков
782
- margin: `${n / 2}px`,
784
+ margin: `${o / 2}px`,
783
785
  background: "transparent",
784
786
  border: "2px solid #e5e7eb",
785
787
  color: "#1f2937",
@@ -787,254 +789,308 @@ function Mt({
787
789
  transition: "background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease",
788
790
  boxShadow: "none"
789
791
  },
790
- children: t
792
+ children: e
791
793
  },
792
- t
794
+ e
793
795
  )) })
794
- ] }) }) : w === "game" ? /* @__PURE__ */ e("div", { style: X, children: /* @__PURE__ */ p("div", { style: D, children: [
795
- Q,
796
- /* @__PURE__ */ p("div", { style: {
796
+ ] }) : b === "game" ? /* @__PURE__ */ u(X, { children: [
797
+ A,
798
+ /* @__PURE__ */ u("div", { style: {
797
799
  ...a.gmInfoBox,
798
- padding: `${n * 0.8}px`,
799
- marginBottom: `${n * 0.5}px`,
800
- maxWidth: `${(h || r) * 0.9}px`
800
+ padding: `${o * 0.8}px`,
801
+ marginBottom: `${o * 0.5}px`,
802
+ maxWidth: `${(g || r) * 0.9}px`
801
803
  }, children: [
802
- /* @__PURE__ */ p("h3", { style: { ...a.gmHeadline3, fontSize: `${i.headline3}px`, marginBottom: `${n * 0.5}px` }, children: [
804
+ /* @__PURE__ */ u("h3", { style: { ...a.gmHeadline3, fontSize: `${s.headline3}px`, marginBottom: `${o * 0.5}px` }, children: [
803
805
  "Category: ",
804
- y
806
+ x
805
807
  ] }),
806
- /* @__PURE__ */ p("p", { style: { ...a.gmBodyM, fontSize: `${i.bodyM}px`, marginBottom: "0px" }, children: [
808
+ /* @__PURE__ */ u("p", { style: { ...a.gmBodyM, fontSize: `${s.bodyM}px`, marginBottom: "0px" }, children: [
807
809
  "Round ",
808
- L,
810
+ $,
809
811
  " of ",
810
- S
812
+ w
811
813
  ] })
812
814
  ] }),
813
- F && /* @__PURE__ */ p("p", { style: {
815
+ M && /* @__PURE__ */ u("p", { style: {
814
816
  ...a.gmBodyS,
815
- fontSize: `${i.bodyS}px`,
816
- marginTop: `${n * 0.5}px`,
817
- marginBottom: `${n}px`
817
+ fontSize: `${s.bodyS}px`,
818
+ marginTop: `${o * 0.5}px`,
819
+ marginBottom: `${o}px`
818
820
  }, children: [
819
821
  "I am thinking of a word that is ",
820
- /* @__PURE__ */ e("strong", { children: F.length }),
822
+ /* @__PURE__ */ n("strong", { children: M.length }),
821
823
  " letters long"
822
824
  ] }),
823
- /* @__PURE__ */ e("div", { style: {
824
- margin: `${n}px 0`,
825
+ /* @__PURE__ */ n("div", { style: {
826
+ margin: `${o}px 0`,
825
827
  display: "flex",
826
828
  justifyContent: "center",
827
829
  alignItems: "center"
828
- }, children: /* @__PURE__ */ e(
829
- bt,
830
+ }, children: /* @__PURE__ */ n(
831
+ ve,
830
832
  {
831
- mistakes: P,
832
- maxMistakes: J,
833
- size: v ? Math.max(80, Math.min(110, (h || r) * 0.16)) : Math.max(100, Math.min(150, (h || r) * 0.2))
833
+ mistakes: _,
834
+ maxMistakes: ee,
835
+ size: I ? Math.max(80, Math.min(110, (g || r) * 0.16)) : Math.max(100, Math.min(150, (g || r) * 0.2))
834
836
  }
835
837
  ) }),
836
- /* @__PURE__ */ e("div", { style: {
838
+ /* @__PURE__ */ n("div", { style: {
837
839
  ...a.gmWordDisplay,
838
- fontSize: `${Math.max(16, Math.min(24, i.wordDisplay * 0.9))}px`,
839
- margin: `${n}px 0`,
840
- letterSpacing: `${n * 0.8}px`,
841
- minHeight: `${Math.max(16, Math.min(24, i.wordDisplay * 0.9)) * 1.2}px`
842
- }, children: mt || "Loading..." }),
843
- /* @__PURE__ */ p("div", { style: {
840
+ fontSize: `${Math.max(16, Math.min(24, s.wordDisplay * 0.9))}px`,
841
+ margin: `${o}px 0`,
842
+ letterSpacing: `${o * 0.8}px`,
843
+ minHeight: `${Math.max(16, Math.min(24, s.wordDisplay * 0.9)) * 1.2}px`
844
+ }, children: ye || "Loading..." }),
845
+ /* @__PURE__ */ u("div", { style: {
844
846
  ...a.gmInfoBox,
845
- padding: `${n}px`,
846
- marginTop: `${n}px`,
847
- marginBottom: `${n}px`,
848
- maxWidth: `${(h || r) * 0.95}px`
847
+ padding: `${o}px`,
848
+ marginTop: `${o}px`,
849
+ marginBottom: `${o}px`,
850
+ maxWidth: `${(g || r) * 0.95}px`
849
851
  }, children: [
850
- /* @__PURE__ */ e("p", { style: {
852
+ /* @__PURE__ */ n("p", { style: {
851
853
  ...a.gmBodyS,
852
- fontSize: `${i.bodyS}px`,
853
- marginBottom: `${n}px`,
854
+ fontSize: `${s.bodyS}px`,
855
+ marginBottom: `${o}px`,
854
856
  fontWeight: 500
855
857
  // Medium
856
858
  }, children: "Available letters:" }),
857
- /* @__PURE__ */ e("div", { style: {
859
+ /* @__PURE__ */ n("div", { style: {
858
860
  display: "flex",
859
861
  flexWrap: "wrap",
860
- gap: `${n / 3}px`,
862
+ gap: `${o / 3}px`,
861
863
  justifyContent: "center",
862
- fontSize: `${Math.max(9, Math.min(12, i.bodyS * 0.75))}px`,
864
+ fontSize: `${Math.max(9, Math.min(12, s.bodyS * 0.75))}px`,
863
865
  fontFamily: '"Onest", system-ui, sans-serif'
864
- }, children: ht.map((t) => /* @__PURE__ */ e(
866
+ }, children: be.map((e) => /* @__PURE__ */ n(
865
867
  "button",
866
868
  {
867
- onClick: () => et(t),
868
- disabled: u !== null,
869
- onMouseEnter: (o) => {
870
- u === null && (o.currentTarget.style.backgroundColor = "#e5e7eb", o.currentTarget.style.cursor = "pointer");
869
+ onClick: () => oe(e),
870
+ disabled: h !== null,
871
+ onMouseEnter: (t) => {
872
+ h === null && (t.currentTarget.style.backgroundColor = "#e5e7eb", t.currentTarget.style.cursor = "pointer");
871
873
  },
872
- onMouseLeave: (o) => {
873
- u === null && (o.currentTarget.style.backgroundColor = "#f9f9f9", o.currentTarget.style.cursor = "pointer");
874
+ onMouseLeave: (t) => {
875
+ h === null && (t.currentTarget.style.backgroundColor = "#f9f9f9", t.currentTarget.style.cursor = "pointer");
874
876
  },
875
877
  style: {
876
- padding: `${n / 4}px ${n / 3}px`,
877
- borderRadius: `${k * 0.5}px`,
878
+ padding: `${o / 4}px ${o / 3}px`,
879
+ borderRadius: `${c * 0.5}px`,
878
880
  background: "#f9f9f9",
879
881
  color: "#1f2937",
880
882
  border: "1px solid #e5e7eb",
881
- minWidth: `${Math.max(n * 1.5, (h || r) * 0.04)}px`,
883
+ minWidth: `${Math.max(o * 1.5, (g || r) * 0.04)}px`,
882
884
  textAlign: "center",
883
885
  display: "inline-block",
884
- cursor: u === null ? "pointer" : "default",
886
+ cursor: h === null ? "pointer" : "default",
885
887
  fontFamily: '"Onest", system-ui, sans-serif',
886
- fontSize: `${Math.max(9, Math.min(12, i.bodyS * 0.75))}px`,
888
+ fontSize: `${Math.max(9, Math.min(12, s.bodyS * 0.75))}px`,
887
889
  transition: "background-color 0.2s ease"
888
890
  },
889
- children: t
891
+ children: e
890
892
  },
891
- t
893
+ e
892
894
  )) })
893
895
  ] }),
894
- T.length > 0 && /* @__PURE__ */ e("div", { style: {
896
+ v.length > 0 && /* @__PURE__ */ n("div", { style: {
895
897
  ...a.gmGuessedLetters,
896
- fontSize: `${Math.max(10, Math.min(12, i.bodyS * 0.85))}px`,
897
- marginTop: `${n * 0.5}px`,
898
+ fontSize: `${Math.max(10, Math.min(12, s.bodyS * 0.85))}px`,
899
+ marginTop: `${o * 0.5}px`,
898
900
  marginBottom: "2px"
899
- }, children: /* @__PURE__ */ p("span", { style: { color: "#6b7280" }, children: [
901
+ }, children: /* @__PURE__ */ u("span", { style: { color: "#6b7280" }, children: [
900
902
  "Guessed letters: ",
901
- /* @__PURE__ */ e("strong", { children: T.join(", ") })
903
+ /* @__PURE__ */ n("strong", { children: v.join(", ") })
902
904
  ] }) }),
903
- u === "win" && /* @__PURE__ */ e("div", { style: {
905
+ h === "win" && /* @__PURE__ */ n("div", { style: {
904
906
  ...a.gmStatusWin,
905
- fontSize: `${i.bodyL}px`,
907
+ fontSize: `${s.bodyL}px`,
906
908
  margin: "2px 0"
907
909
  }, children: "🎉 You won this round!" }),
908
- u === "lose" && /* @__PURE__ */ p("div", { style: {
910
+ h === "lose" && /* @__PURE__ */ u("div", { style: {
909
911
  ...a.gmStatusLose,
910
- fontSize: `${i.bodyL}px`,
912
+ fontSize: `${s.bodyL}px`,
911
913
  margin: "2px 0"
912
914
  }, children: [
913
915
  "The hangman is complete! The word was: ",
914
- /* @__PURE__ */ e("strong", { children: F })
916
+ /* @__PURE__ */ n("strong", { children: M })
915
917
  ] }),
916
- u !== null && L < S && /* @__PURE__ */ e("div", { style: { marginTop: "2px", marginBottom: `${n}px` }, children: /* @__PURE__ */ e(
918
+ h !== null && $ < w && /* @__PURE__ */ n("div", { style: { marginTop: "2px", marginBottom: `${o}px` }, children: /* @__PURE__ */ n(
917
919
  "button",
918
920
  {
919
- onClick: ft,
920
- onMouseEnter: (t) => {
921
- t.currentTarget.style.backgroundColor = "#d43a32";
921
+ onClick: ke,
922
+ onMouseEnter: (e) => {
923
+ e.currentTarget.style.backgroundColor = "#d43a32";
922
924
  },
923
- onMouseLeave: (t) => {
924
- t.currentTarget.style.backgroundColor = "#ec4c44";
925
+ onMouseLeave: (e) => {
926
+ e.currentTarget.style.backgroundColor = "#ec4c44";
925
927
  },
926
928
  style: {
927
929
  ...a.gmButton,
928
- fontSize: `${Math.max(11, Math.min(14, i.button * 0.85))}px`,
929
- padding: `${n * 0.6}px ${n * 1.2}px`,
930
- borderRadius: `${k}px`
930
+ fontSize: `${Math.max(11, Math.min(14, s.button * 0.85))}px`,
931
+ padding: `${o * 0.6}px ${o * 1.2}px`,
932
+ borderRadius: `${c}px`
931
933
  },
932
934
  children: "NEXT"
933
935
  }
934
936
  ) }),
935
- u !== null && L >= S && /* @__PURE__ */ e("div", { style: { marginTop: "2px", marginBottom: `${n}px` }, children: /* @__PURE__ */ e(
937
+ h !== null && $ >= w && /* @__PURE__ */ n("div", { style: { marginTop: "2px", marginBottom: `${o}px` }, children: /* @__PURE__ */ n(
936
938
  "button",
937
939
  {
938
- onClick: () => m("result"),
939
- onMouseEnter: (t) => {
940
- t.currentTarget.style.backgroundColor = "#d43a32";
940
+ onClick: () => f("result"),
941
+ onMouseEnter: (e) => {
942
+ e.currentTarget.style.backgroundColor = "#d43a32";
941
943
  },
942
- onMouseLeave: (t) => {
943
- t.currentTarget.style.backgroundColor = "#ec4c44";
944
+ onMouseLeave: (e) => {
945
+ e.currentTarget.style.backgroundColor = "#ec4c44";
944
946
  },
945
947
  style: {
946
948
  ...a.gmButton,
947
- fontSize: `${i.button}px`,
948
- padding: `${n}px ${n * 1.5}px`,
949
- borderRadius: `${k}px`
949
+ fontSize: `${s.button}px`,
950
+ padding: `${o}px ${o * 1.5}px`,
951
+ borderRadius: `${c}px`
950
952
  },
951
953
  children: "View Results →"
952
954
  }
953
955
  ) }),
954
- u === null && T.length === 0 && /* @__PURE__ */ e("p", { style: {
956
+ h === null && v.length === 0 && /* @__PURE__ */ n("p", { style: {
955
957
  ...a.gmBodyS,
956
- fontSize: `${i.bodyS}px`,
957
- marginTop: `${n}px`,
958
- marginBottom: `${n}px`
958
+ fontSize: `${s.bodyS}px`,
959
+ marginTop: `${o}px`,
960
+ marginBottom: `${o}px`
959
961
  }, children: "Type a letter on your keyboard" })
960
- ] }) }) : w === "result" ? /* @__PURE__ */ e("div", { style: X, children: /* @__PURE__ */ p("div", { style: D, children: [
961
- Q,
962
- /* @__PURE__ */ e("h1", { style: {
962
+ ] }) : b === "result" ? /* @__PURE__ */ u(X, { children: [
963
+ A,
964
+ /* @__PURE__ */ n("h1", { style: {
963
965
  ...a.gmHeadline1,
964
- fontSize: `${i.headline1}px`,
965
- marginBottom: `${n * 2}px`
966
+ fontSize: `${s.headline1}px`,
967
+ marginBottom: `${o * 2}px`
966
968
  }, children: "🎊 Game Finished!" }),
967
- /* @__PURE__ */ p("p", { style: {
969
+ /* @__PURE__ */ u("p", { style: {
968
970
  ...a.gmBodyL,
969
- fontSize: `${i.bodyL}px`,
970
- marginBottom: `${n * 2}px`
971
+ fontSize: `${s.bodyL}px`,
972
+ marginBottom: `${o * 2}px`
971
973
  }, children: [
972
974
  "You guessed ",
973
- /* @__PURE__ */ e("strong", { children: q }),
975
+ /* @__PURE__ */ n("strong", { children: q }),
974
976
  " out of ",
975
- /* @__PURE__ */ e("strong", { children: S }),
977
+ /* @__PURE__ */ n("strong", { children: w }),
976
978
  " words correctly."
977
979
  ] }),
978
- /* @__PURE__ */ p("div", { style: {
980
+ /* @__PURE__ */ u("div", { style: {
979
981
  display: "flex",
980
982
  flexDirection: "column",
981
- gap: `${n}px`,
983
+ gap: `${o}px`,
982
984
  alignItems: "center"
983
985
  }, children: [
984
- /* @__PURE__ */ e(
986
+ /* @__PURE__ */ n(
985
987
  "button",
986
988
  {
987
989
  onClick: () => {
988
- if (!y || S === 0) {
989
- m("lobby");
990
+ if (!x || w === 0) {
991
+ f("lobby");
990
992
  return;
991
993
  }
992
- C([]);
993
- const t = Z(y, []);
994
- t && (R(t), C([t]), I([]), B(0), H(1), O(0), z(null), m("game"));
994
+ L([]);
995
+ const e = P(x, []);
996
+ e && (z(e), L([e]), C([]), S(0), B(1), Y(0), F(null), f("game"));
995
997
  },
996
- onMouseEnter: (t) => {
997
- t.currentTarget.style.backgroundColor = "#d43a32";
998
+ onMouseEnter: (e) => {
999
+ e.currentTarget.style.backgroundColor = "#d43a32";
998
1000
  },
999
- onMouseLeave: (t) => {
1000
- t.currentTarget.style.backgroundColor = "#ec4c44";
1001
+ onMouseLeave: (e) => {
1002
+ e.currentTarget.style.backgroundColor = "#ec4c44";
1001
1003
  },
1002
1004
  style: {
1003
1005
  ...a.gmButton,
1004
- fontSize: `${i.button}px`,
1005
- padding: `${n}px ${n * 1.5}px`,
1006
- borderRadius: `${k}px`,
1006
+ fontSize: `${s.button}px`,
1007
+ padding: `${o}px ${o * 1.5}px`,
1008
+ borderRadius: `${c}px`,
1007
1009
  minWidth: "200px"
1008
1010
  },
1009
1011
  children: "Play again"
1010
1012
  }
1011
1013
  ),
1012
- /* @__PURE__ */ e(
1014
+ /* @__PURE__ */ n(
1013
1015
  "button",
1014
1016
  {
1015
- onClick: () => m("lobby"),
1016
- onMouseEnter: (t) => {
1017
- t.currentTarget.style.backgroundColor = "#e5e7eb";
1017
+ onClick: () => f("lobby"),
1018
+ onMouseEnter: (e) => {
1019
+ e.currentTarget.style.backgroundColor = "#e5e7eb";
1018
1020
  },
1019
- onMouseLeave: (t) => {
1020
- t.currentTarget.style.backgroundColor = "#f9f9f9";
1021
+ onMouseLeave: (e) => {
1022
+ e.currentTarget.style.backgroundColor = "#f9f9f9";
1021
1023
  },
1022
1024
  style: {
1023
1025
  ...a.gmButton,
1024
1026
  ...a.gmButtonSecondary,
1025
- fontSize: `${i.button}px`,
1026
- padding: `${n}px ${n * 1.5}px`,
1027
- borderRadius: `${k}px`,
1027
+ fontSize: `${s.button}px`,
1028
+ padding: `${o}px ${o * 1.5}px`,
1029
+ borderRadius: `${c}px`,
1028
1030
  minWidth: "200px"
1029
1031
  },
1030
1032
  children: "Exit"
1031
1033
  }
1032
1034
  )
1033
1035
  ] })
1034
- ] }) }) : null;
1036
+ ] }) : null;
1037
+ return /* @__PURE__ */ n(
1038
+ "div",
1039
+ {
1040
+ style: {
1041
+ width: "100%",
1042
+ height: "100%",
1043
+ display: "flex",
1044
+ justifyContent: "center",
1045
+ alignItems: "center",
1046
+ background: "transparent",
1047
+ overflow: "hidden",
1048
+ position: "absolute",
1049
+ top: 0,
1050
+ left: 0,
1051
+ right: 0,
1052
+ bottom: 0
1053
+ },
1054
+ children: /* @__PURE__ */ n(
1055
+ "div",
1056
+ {
1057
+ style: {
1058
+ width: p ? "100%" : g || r || 1e3,
1059
+ height: p ? "100%" : g || r || 1e3,
1060
+ display: "flex",
1061
+ justifyContent: "center",
1062
+ alignItems: "center",
1063
+ overflow: "hidden",
1064
+ borderRadius: p ? 0 : "20px",
1065
+ background: "#ffffff",
1066
+ boxShadow: p ? "none" : "0 0 40px rgba(0,0,0,0.1)",
1067
+ margin: p ? "0 auto" : "unset",
1068
+ position: "relative",
1069
+ // needed so absolute logo is inside the square
1070
+ transform: `scale(${J})`
1071
+ },
1072
+ children: /* @__PURE__ */ n(
1073
+ "div",
1074
+ {
1075
+ style: {
1076
+ transform: "translateZ(0)",
1077
+ width: "100%",
1078
+ height: "100%",
1079
+ display: "flex",
1080
+ justifyContent: "center",
1081
+ alignItems: "center"
1082
+ },
1083
+ children: /* @__PURE__ */ n("div", { style: we, children: Me() })
1084
+ }
1085
+ )
1086
+ }
1087
+ )
1088
+ }
1089
+ );
1035
1090
  }
1036
1091
  export {
1037
- Mt as HangmanLobbyGame,
1038
- Mt as default
1092
+ Le as Game,
1093
+ Le as HangmanLobbyGame,
1094
+ Le as default
1039
1095
  };
1040
1096
  //# sourceMappingURL=speakid-hangman.es.js.map