@sensiblestats/widget-react 0.55.0 → 0.57.0

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.cjs CHANGED
@@ -1724,18 +1724,19 @@ function computeGameDay(timezone) {
1724
1724
  return new Intl.DateTimeFormat("en-CA", { timeZone: timezone }).format(/* @__PURE__ */ new Date());
1725
1725
  }
1726
1726
  function useGames(conversation, { activeTab, operatorTimezone }) {
1727
- const [enabled, setEnabled] = (0, import_react6.useState)(true);
1727
+ const [enabled, setEnabled] = (0, import_react6.useState)(false);
1728
1728
  const [games, setGames] = (0, import_react6.useState)([]);
1729
1729
  const [loading, setLoading] = (0, import_react6.useState)(false);
1730
1730
  const [refreshCount, setRefreshCount] = (0, import_react6.useState)(0);
1731
1731
  const inFlightRef = (0, import_react6.useRef)(false);
1732
- const enabledRef = (0, import_react6.useRef)(true);
1732
+ const hardOffRef = (0, import_react6.useRef)(false);
1733
1733
  const conversationRef = (0, import_react6.useRef)(conversation);
1734
1734
  conversationRef.current = conversation;
1735
1735
  const tzRef = (0, import_react6.useRef)(operatorTimezone ?? DEFAULT_TZ);
1736
1736
  tzRef.current = operatorTimezone ?? DEFAULT_TZ;
1737
+ const ready = conversation != null;
1737
1738
  (0, import_react6.useEffect)(() => {
1738
- if (!enabledRef.current) return;
1739
+ if (hardOffRef.current) return;
1739
1740
  let active = true;
1740
1741
  const doFetch = async () => {
1741
1742
  const conv = conversationRef.current;
@@ -1747,10 +1748,12 @@ function useGames(conversation, { activeTab, operatorTimezone }) {
1747
1748
  const result = await conv.getGames(gameDay);
1748
1749
  if (!active) return;
1749
1750
  if (result === null) {
1750
- enabledRef.current = false;
1751
+ hardOffRef.current = true;
1751
1752
  setEnabled(false);
1753
+ setGames([]);
1752
1754
  } else {
1753
1755
  setGames(result.games);
1756
+ setEnabled(result.games.length > 0);
1754
1757
  }
1755
1758
  } catch {
1756
1759
  } finally {
@@ -1762,7 +1765,7 @@ function useGames(conversation, { activeTab, operatorTimezone }) {
1762
1765
  let intervalId;
1763
1766
  if (activeTab === "games") {
1764
1767
  intervalId = window.setInterval(() => {
1765
- if (!enabledRef.current) {
1768
+ if (hardOffRef.current) {
1766
1769
  window.clearInterval(intervalId);
1767
1770
  return;
1768
1771
  }
@@ -1771,9 +1774,10 @@ function useGames(conversation, { activeTab, operatorTimezone }) {
1771
1774
  }
1772
1775
  return () => {
1773
1776
  active = false;
1777
+ inFlightRef.current = false;
1774
1778
  if (intervalId !== void 0) window.clearInterval(intervalId);
1775
1779
  };
1776
- }, [activeTab, refreshCount]);
1780
+ }, [activeTab, refreshCount, ready]);
1777
1781
  const refresh = (0, import_react6.useCallback)(() => {
1778
1782
  setRefreshCount((c) => c + 1);
1779
1783
  }, []);
@@ -4399,43 +4403,65 @@ function MysteryTigerGame({
4399
4403
  " left"
4400
4404
  ] })
4401
4405
  ] }),
4402
- guessResults.length === 0 && !isOver && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "ss-w-gt-lead", children: "Guess any squad player \u2014 each guess reveals how close you are on position, nationality, age, shirt and apps." }),
4403
- guessResults.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "ss-w-gtrows", children: guessResults.map((gr, i) => {
4404
- const player = config.squadPlayers.find((p) => p.id === gr.playerId);
4405
- return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "ss-w-gtguess", children: [
4406
- /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "ss-w-gtguess-nm", children: [
4407
- i + 1,
4408
- " \xB7 ",
4409
- player?.name ?? `#${gr.playerId}`
4410
- ] }),
4411
- /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "ss-w-gtrow", children: ATTR_KEYS.map((key) => {
4412
- const v = gr[key];
4413
- const arrow = directionArrow(v);
4414
- return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
4415
- "div",
4416
- {
4417
- className: `ss-w-gtile ss-w-gtile--${v.verdict}`,
4418
- "data-testid": `verdict-${key}-${i}`,
4419
- "data-verdict": v.verdict,
4420
- "aria-label": `${ATTR_LABELS[key]}: ${v.value ?? v.verdict}${v.direction ? ` ${v.direction}` : ""}`,
4421
- children: [
4422
- /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "ss-w-gtile-lab", children: ATTR_LABELS[key] }),
4423
- /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("span", { className: "ss-w-gtile-v", "aria-hidden": "true", children: [
4424
- tileFace(key, v),
4425
- arrow && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "ss-w-gtile-dir", children: arrow })
4426
- ] })
4427
- ]
4428
- },
4429
- key
4430
- );
4431
- }) })
4432
- ] }, gr.playerId);
4433
- }) }),
4434
- clientState?.hintLine && !isOver && /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "ss-w-gt-hint", children: [
4435
- "\u{1F4A1} ",
4436
- clientState.hintLine
4406
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "ss-w-gscroll", children: [
4407
+ !isOver && /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "ss-w-gt-lead", children: [
4408
+ guessResults.length === 0 ? "Guess a squad player \u2014 each guess compares it to the mystery player on Pos, Nat, Age, Shirt & Apps: " : "Tiles: ",
4409
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("span", { className: "ss-w-gt-key", children: [
4410
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("b", { className: "ss-w-gt-key-ok", children: "\u2713" }),
4411
+ " match \xB7 ",
4412
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("b", { children: "\u25B2" }),
4413
+ " higher \xB7 ",
4414
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("b", { children: "\u25BC" }),
4415
+ " lower"
4416
+ ] })
4417
+ ] }),
4418
+ guessResults.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "ss-w-gtrows", children: guessResults.map((gr, i) => {
4419
+ const player = config.squadPlayers.find((p) => p.id === gr.playerId);
4420
+ return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "ss-w-gtguess", children: [
4421
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "ss-w-gtguess-nm", children: [
4422
+ i + 1,
4423
+ " \xB7 ",
4424
+ player?.name ?? `#${gr.playerId}`
4425
+ ] }),
4426
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "ss-w-gtrow", children: ATTR_KEYS.map((key) => {
4427
+ const v = gr[key];
4428
+ const arrow = directionArrow(v);
4429
+ return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
4430
+ "div",
4431
+ {
4432
+ className: `ss-w-gtile ss-w-gtile--${v.verdict}`,
4433
+ "data-testid": `verdict-${key}-${i}`,
4434
+ "data-verdict": v.verdict,
4435
+ "aria-label": `${ATTR_LABELS[key]}: ${v.value ?? v.verdict}${v.direction ? ` ${v.direction}` : ""}`,
4436
+ children: [
4437
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "ss-w-gtile-lab", children: ATTR_LABELS[key] }),
4438
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("span", { className: "ss-w-gtile-v", "aria-hidden": "true", children: [
4439
+ tileFace(key, v),
4440
+ arrow && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "ss-w-gtile-dir", children: arrow })
4441
+ ] })
4442
+ ]
4443
+ },
4444
+ key
4445
+ );
4446
+ }) })
4447
+ ] }, gr.playerId);
4448
+ }) }),
4449
+ clientState?.hintLine && !isOver && /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "ss-w-gt-hint", children: [
4450
+ "\u{1F4A1} ",
4451
+ clientState.hintLine
4452
+ ] }),
4453
+ isOver && clientState && /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: `ss-w-gt-banner ss-w-gt-banner--${clientState.solved ? "solved" : "failed"}`, children: [
4454
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "ss-w-gt-banner-label", children: clientState.solved ? "\u{1F42F} You found them!" : "\u{1F614} Out of guesses" }),
4455
+ clientState.revealedPlayerName && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "ss-w-gt-banner-name", children: clientState.revealedPlayerName }),
4456
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "ss-w-gt-banner-sub", children: [
4457
+ clientState.guessesUsed,
4458
+ " guess",
4459
+ clientState.guessesUsed === 1 ? "" : "es",
4460
+ " \xB7 come back tomorrow"
4461
+ ] })
4462
+ ] })
4437
4463
  ] }),
4438
- !isOver && /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "ss-w-gtta", children: [
4464
+ !isOver && /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "ss-w-gpin ss-w-gtta", children: [
4439
4465
  /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
4440
4466
  "input",
4441
4467
  {
@@ -4467,16 +4493,6 @@ function MysteryTigerGame({
4467
4493
  },
4468
4494
  p.id
4469
4495
  )) })
4470
- ] }),
4471
- isOver && clientState && /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: `ss-w-gt-banner ss-w-gt-banner--${clientState.solved ? "solved" : "failed"}`, children: [
4472
- /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "ss-w-gt-banner-label", children: clientState.solved ? "\u{1F42F} You found them!" : "\u{1F614} Out of guesses" }),
4473
- clientState.revealedPlayerName && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "ss-w-gt-banner-name", children: clientState.revealedPlayerName }),
4474
- /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "ss-w-gt-banner-sub", children: [
4475
- clientState.guessesUsed,
4476
- " guess",
4477
- clientState.guessesUsed === 1 ? "" : "es",
4478
- " \xB7 come back tomorrow"
4479
- ] })
4480
4496
  ] })
4481
4497
  ] })
4482
4498
  ] });
@@ -4588,11 +4604,16 @@ function HigherOrLowerGame({
4588
4604
  ] })
4589
4605
  ] }),
4590
4606
  isOver && /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "ss-w-hl-over", children: [
4591
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "ss-w-hl-over-title", children: runEndedWrong ? "Run over" : "Nice run!" }),
4592
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "ss-w-hl-over-score", children: score }),
4607
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "ss-w-hl-over-title", children: runEndedWrong ? "\u{1F6AB} Run over" : "\u{1F389} Perfect run!" }),
4608
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "ss-w-hl-over-score", children: [
4609
+ score,
4610
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "ss-w-hl-over-unit", children: " pts" })
4611
+ ] }),
4593
4612
  /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "ss-w-hl-over-sub", children: [
4594
4613
  correctCount,
4595
- " correct \xB7 come back tomorrow for a new run"
4614
+ " correct in a row",
4615
+ runEndedWrong ? " before a wrong pick" : "",
4616
+ " \xB7 come back tomorrow for a new run"
4596
4617
  ] })
4597
4618
  ] })
4598
4619
  ] })
@@ -4657,22 +4678,34 @@ function CareerPathGame({
4657
4678
  /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "ss-w-cpath-head", children: [
4658
4679
  /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { children: [
4659
4680
  /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "ss-w-cpath-title", children: "Career Path" }),
4660
- /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "ss-w-cpath-sub", children: "Which player had this career?" })
4681
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "ss-w-cpath-sub", children: "Guess the mystery player from the clubs they've played for, oldest first." })
4661
4682
  ] }),
4662
4683
  clientState && !isOver && /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("span", { className: "ss-w-cpath-left", children: [
4663
4684
  clientState.guessesRemaining,
4664
4685
  " left"
4665
4686
  ] })
4666
4687
  ] }),
4667
- /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "ss-w-cpath-seq", children: visiblePath.map((spell, i) => /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_react30.Fragment, { children: [
4668
- i > 0 && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "ss-w-cpath-arrow", "aria-hidden": "true", children: "\u203A" }),
4669
- /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(ClubSpellCard, { spell })
4670
- ] }, `${spell.clubName}-${i}`)) }),
4671
- clientState?.hintLine && !isOver && /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "ss-w-cpath-hint", children: [
4672
- "\u{1F4A1} ",
4673
- clientState.hintLine
4688
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "ss-w-gscroll", children: [
4689
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "ss-w-cpath-seq", children: visiblePath.map((spell, i) => /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_react30.Fragment, { children: [
4690
+ i > 0 && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "ss-w-cpath-arrow", "aria-hidden": "true", children: "\u203A" }),
4691
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(ClubSpellCard, { spell })
4692
+ ] }, `${spell.clubName}-${i}`)) }),
4693
+ clientState?.hintLine && !isOver && /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "ss-w-cpath-hint", children: [
4694
+ "\u{1F4A1} ",
4695
+ clientState.hintLine
4696
+ ] }),
4697
+ isOver && clientState && /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: `ss-w-cpath-banner ss-w-cpath-banner--${clientState.solved ? "solved" : "failed"}`, children: [
4698
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "ss-w-cpath-banner-label", children: clientState.solved ? "\u2705 Career traced!" : "\u{1F614} Out of guesses" }),
4699
+ clientState.revealedPlayerName && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "ss-w-cpath-banner-name", children: clientState.revealedPlayerName }),
4700
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "ss-w-cpath-banner-sub", children: [
4701
+ clientState.guessesUsed,
4702
+ " guess",
4703
+ clientState.guessesUsed === 1 ? "" : "es",
4704
+ " \xB7 come back tomorrow"
4705
+ ] })
4706
+ ] })
4674
4707
  ] }),
4675
- !isOver && /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "ss-w-gtta", children: [
4708
+ !isOver && /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "ss-w-gpin ss-w-gtta", children: [
4676
4709
  /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
4677
4710
  "input",
4678
4711
  {
@@ -4704,16 +4737,6 @@ function CareerPathGame({
4704
4737
  },
4705
4738
  p.id
4706
4739
  )) })
4707
- ] }),
4708
- isOver && clientState && /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: `ss-w-cpath-banner ss-w-cpath-banner--${clientState.solved ? "solved" : "failed"}`, children: [
4709
- /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "ss-w-cpath-banner-label", children: clientState.solved ? "\u2705 Career traced!" : "\u{1F614} Out of guesses" }),
4710
- clientState.revealedPlayerName && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "ss-w-cpath-banner-name", children: clientState.revealedPlayerName }),
4711
- /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "ss-w-cpath-banner-sub", children: [
4712
- clientState.guessesUsed,
4713
- " guess",
4714
- clientState.guessesUsed === 1 ? "" : "es",
4715
- " \xB7 come back tomorrow"
4716
- ] })
4717
4740
  ] })
4718
4741
  ] })
4719
4742
  ] });
@@ -4859,59 +4882,61 @@ function BeatTheGridGame({
4859
4882
  ] })
4860
4883
  ] })
4861
4884
  ] }),
4862
- /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
4863
- "div",
4864
- {
4865
- className: "ss-w-btg-grid",
4866
- style: { gridTemplateColumns: `auto repeat(${cols.length}, 1fr)` },
4867
- role: "grid",
4868
- children: [
4869
- /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "ss-w-btg-gc ss-w-btg-gc--corner" }),
4870
- cols.map((col) => /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "ss-w-btg-gc ss-w-btg-gc--colhdr", children: col }, col)),
4871
- rows.map((rowLabel, rowIdx) => /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(import_react31.default.Fragment, { children: [
4872
- /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "ss-w-btg-gc ss-w-btg-gc--rowhdr", children: rowLabel }),
4873
- cols.map((colLabel, colIdx) => {
4874
- const filled = findCellResult(filledCells, rowIdx, colIdx);
4875
- const isActive = activeCell?.row === rowIdx && activeCell?.col === colIdx;
4876
- return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
4877
- "button",
4878
- {
4879
- type: "button",
4880
- "data-testid": `btg-cell-${rowIdx}-${colIdx}`,
4881
- "aria-label": `${rowLabel} ${colLabel}`,
4882
- className: [
4883
- "ss-w-btg-gc ss-w-btg-cell",
4884
- filled ? filled.isCorrect ? "ss-w-btg-cell--correct" : "ss-w-btg-cell--wrong" : "",
4885
- isActive ? "ss-w-btg-cell--active" : ""
4886
- ].filter(Boolean).join(" "),
4887
- disabled: isLocked2 || submitting,
4888
- onClick: () => handleCellClick(rowIdx, colIdx),
4889
- children: filled ? /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(import_jsx_runtime58.Fragment, { children: [
4890
- /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: "ss-w-btg-cell-nm", children: shortName(playerPool.find((p) => p.id === filled.playerId)?.name) }),
4891
- /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("span", { className: "ss-w-btg-cell-score", children: [
4892
- filled.rarityScore,
4893
- filled.isCorrect && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: "ss-w-btg-cell-check", "aria-hidden": "true", children: " \u2713" })
4894
- ] })
4895
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: "ss-w-btg-cell-empty", "aria-hidden": "true", children: "+" })
4896
- },
4897
- `cell-${rowIdx}-${colIdx}`
4898
- );
4899
- })
4900
- ] }, rowIdx))
4901
- ]
4902
- }
4903
- ),
4904
- isLocked2 && /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "ss-w-btg-done", children: [
4905
- /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "ss-w-btg-done-label", children: "\u{1F532} Grid complete" }),
4906
- /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "ss-w-btg-done-score", children: clientState?.totalScore ?? 0 }),
4907
- /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "ss-w-btg-done-sub", children: [
4908
- filledCells.filter((c) => c.isCorrect).length,
4909
- "/",
4910
- filledCells.length,
4911
- " correct \xB7 come back tomorrow"
4885
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "ss-w-gscroll", children: [
4886
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
4887
+ "div",
4888
+ {
4889
+ className: "ss-w-btg-grid",
4890
+ style: { gridTemplateColumns: `auto repeat(${cols.length}, 1fr)` },
4891
+ role: "grid",
4892
+ children: [
4893
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "ss-w-btg-gc ss-w-btg-gc--corner" }),
4894
+ cols.map((col) => /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "ss-w-btg-gc ss-w-btg-gc--colhdr", children: col }, col)),
4895
+ rows.map((rowLabel, rowIdx) => /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(import_react31.default.Fragment, { children: [
4896
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "ss-w-btg-gc ss-w-btg-gc--rowhdr", children: rowLabel }),
4897
+ cols.map((colLabel, colIdx) => {
4898
+ const filled = findCellResult(filledCells, rowIdx, colIdx);
4899
+ const isActive = activeCell?.row === rowIdx && activeCell?.col === colIdx;
4900
+ return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
4901
+ "button",
4902
+ {
4903
+ type: "button",
4904
+ "data-testid": `btg-cell-${rowIdx}-${colIdx}`,
4905
+ "aria-label": `${rowLabel} ${colLabel}`,
4906
+ className: [
4907
+ "ss-w-btg-gc ss-w-btg-cell",
4908
+ filled ? filled.isCorrect ? "ss-w-btg-cell--correct" : "ss-w-btg-cell--wrong" : "",
4909
+ isActive ? "ss-w-btg-cell--active" : ""
4910
+ ].filter(Boolean).join(" "),
4911
+ disabled: isLocked2 || submitting,
4912
+ onClick: () => handleCellClick(rowIdx, colIdx),
4913
+ children: filled ? /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(import_jsx_runtime58.Fragment, { children: [
4914
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: "ss-w-btg-cell-nm", children: shortName(playerPool.find((p) => p.id === filled.playerId)?.name) }),
4915
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("span", { className: "ss-w-btg-cell-score", children: [
4916
+ filled.rarityScore,
4917
+ filled.isCorrect && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: "ss-w-btg-cell-check", "aria-hidden": "true", children: " \u2713" })
4918
+ ] })
4919
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: "ss-w-btg-cell-empty", "aria-hidden": "true", children: "+" })
4920
+ },
4921
+ `cell-${rowIdx}-${colIdx}`
4922
+ );
4923
+ })
4924
+ ] }, rowIdx))
4925
+ ]
4926
+ }
4927
+ ),
4928
+ isLocked2 && /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "ss-w-btg-done", children: [
4929
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "ss-w-btg-done-label", children: "\u{1F532} Grid complete" }),
4930
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "ss-w-btg-done-score", children: clientState?.totalScore ?? 0 }),
4931
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "ss-w-btg-done-sub", children: [
4932
+ filledCells.filter((c) => c.isCorrect).length,
4933
+ "/",
4934
+ filledCells.length,
4935
+ " correct \xB7 come back tomorrow"
4936
+ ] })
4912
4937
  ] })
4913
4938
  ] }),
4914
- activeCell !== null && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
4939
+ activeCell !== null && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "ss-w-gpin", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
4915
4940
  SearchSheet,
4916
4941
  {
4917
4942
  row: activeCell.row,
@@ -4923,7 +4948,7 @@ function BeatTheGridGame({
4923
4948
  onPick: handlePick,
4924
4949
  onDismiss: () => setActiveCell(null)
4925
4950
  }
4926
- )
4951
+ ) })
4927
4952
  ] });
4928
4953
  }
4929
4954
 
@@ -4947,13 +4972,48 @@ function toRows(positions) {
4947
4972
  bucket.push(p);
4948
4973
  byRow.set(rowKey, bucket);
4949
4974
  });
4950
- return [...byRow.keys()].sort((a, b) => a - b).map((k) => byRow.get(k));
4975
+ return [...byRow.keys()].sort((a, b) => b - a).map((k) => byRow.get(k));
4976
+ }
4977
+ function formationLabel(rows) {
4978
+ if (rows.length < 2) return "";
4979
+ const gkFirst = [...rows].reverse();
4980
+ return gkFirst.slice(1).map((r) => r.length).join("-");
4981
+ }
4982
+ var FORMATION_POSITIONS = {
4983
+ "4-4-2": [["GK"], ["LB", "CB", "CB", "RB"], ["LM", "CM", "CM", "RM"], ["ST", "ST"]],
4984
+ "4-3-3": [["GK"], ["LB", "CB", "CB", "RB"], ["CM", "CM", "CM"], ["LW", "ST", "RW"]],
4985
+ "4-2-3-1": [["GK"], ["LB", "CB", "CB", "RB"], ["CDM", "CDM"], ["LW", "CAM", "RW"], ["ST"]],
4986
+ "4-1-4-1": [["GK"], ["LB", "CB", "CB", "RB"], ["CDM"], ["LM", "CM", "CM", "RM"], ["ST"]],
4987
+ "4-5-1": [["GK"], ["LB", "CB", "CB", "RB"], ["LM", "CM", "CM", "CM", "RM"], ["ST"]],
4988
+ "4-4-1-1": [["GK"], ["LB", "CB", "CB", "RB"], ["LM", "CM", "CM", "RM"], ["CAM"], ["ST"]],
4989
+ "4-1-2-1-2": [["GK"], ["LB", "CB", "CB", "RB"], ["CDM"], ["LM", "RM"], ["CAM"], ["ST", "ST"]],
4990
+ "3-5-2": [["GK"], ["CB", "CB", "CB"], ["LWB", "CM", "CM", "CM", "RWB"], ["ST", "ST"]],
4991
+ "3-4-3": [["GK"], ["CB", "CB", "CB"], ["LM", "CM", "CM", "RM"], ["LW", "ST", "RW"]],
4992
+ "5-3-2": [["GK"], ["LWB", "CB", "CB", "CB", "RWB"], ["CM", "CM", "CM"], ["ST", "ST"]],
4993
+ "5-4-1": [["GK"], ["LWB", "CB", "CB", "CB", "RWB"], ["LM", "CM", "CM", "RM"], ["ST"]]
4994
+ };
4995
+ function lineFallback(lineIdx, totalLines) {
4996
+ if (lineIdx === 0) return "GK";
4997
+ if (lineIdx === totalLines - 1) return "FWD";
4998
+ if (lineIdx === 1) return "DEF";
4999
+ return "MID";
5000
+ }
5001
+ function positionsBySlot(formation, rowsAttackFirst) {
5002
+ const gkFirst = [...rowsAttackFirst].reverse();
5003
+ const template = FORMATION_POSITIONS[formation];
5004
+ const map = /* @__PURE__ */ new Map();
5005
+ gkFirst.forEach((line, li) => {
5006
+ line.forEach((entry, ci) => {
5007
+ if (!entry.slot) return;
5008
+ const label = template?.[li]?.[ci] ?? lineFallback(li, gkFirst.length);
5009
+ map.set(entry.slot, label);
5010
+ });
5011
+ });
5012
+ return map;
4951
5013
  }
4952
- function RevealCard({ reveal }) {
4953
- return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "ss-w-gxi-reveal", "data-reveal-type": reveal.type ?? "", children: [
4954
- reveal.slot && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "ss-w-gxi-reveal-slot", children: reveal.slot }),
4955
- /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "ss-w-gxi-reveal-val", children: reveal.value })
4956
- ] });
5014
+ function surname(name) {
5015
+ const parts = name.trim().split(/\s+/).filter(Boolean);
5016
+ return parts.length ? parts[parts.length - 1] : name;
4957
5017
  }
4958
5018
  function GuessTheXiGame({
4959
5019
  config,
@@ -4968,6 +5028,12 @@ function GuessTheXiGame({
4968
5028
  const solved = clientState?.status === "solved";
4969
5029
  const guessedTeamIds = new Set(clientState?.guessHistory.map((g) => g.teamId) ?? []);
4970
5030
  const rows = config ? toRows(config.positions) : [];
5031
+ const formation = config?.hasRealFormation ? formationLabel(rows) : "";
5032
+ const posBySlot = config?.hasRealFormation ? positionsBySlot(formation, rows) : /* @__PURE__ */ new Map();
5033
+ const nameBySlot = /* @__PURE__ */ new Map();
5034
+ (clientState?.earnedReveals ?? []).forEach((r) => {
5035
+ if (r.slot && r.type !== "position") nameBySlot.set(r.slot, r.value);
5036
+ });
4971
5037
  const filtered = config && !isOver ? config.teamPool.filter(
4972
5038
  (t) => !guessedTeamIds.has(t.teamId) && t.teamName.toLowerCase().includes(query.toLowerCase())
4973
5039
  ) : [];
@@ -4979,14 +5045,18 @@ function GuessTheXiGame({
4979
5045
  onSubmit(JSON.stringify({ guesses: newGuesses }));
4980
5046
  }
4981
5047
  const wrongGuesses = (clientState?.guessHistory ?? []).filter((g) => !g.wasCorrect);
5048
+ const revealCount = nameBySlot.size;
4982
5049
  return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "ss-w-gxi", "data-testid": "game-screen-guess-the-xi", children: [
4983
5050
  !config && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "ss-w-gscreen-body", children: "Loading\u2026" }),
4984
5051
  config && /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(import_jsx_runtime59.Fragment, { children: [
4985
5052
  /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "ss-w-gxi-head", children: [
4986
5053
  /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { children: [
4987
- /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "ss-w-gxi-title", children: "Guess the XI" }),
5054
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "ss-w-gxi-title", children: [
5055
+ "Guess the XI",
5056
+ formation && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "ss-w-gxi-form", "aria-label": `Formation ${formation}`, children: formation })
5057
+ ] }),
4988
5058
  /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "ss-w-gxi-sub", children: [
4989
- "Which team? \xB7 flags only \xB7 ",
5059
+ "Name the team \xB7 flags are each player's nationality \xB7 ",
4990
5060
  config.poolLabel
4991
5061
  ] })
4992
5062
  ] }),
@@ -4995,64 +5065,78 @@ function GuessTheXiGame({
4995
5065
  " left"
4996
5066
  ] })
4997
5067
  ] }),
4998
- rows.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "ss-w-gxi-pitch", children: rows.map((row, r) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "ss-w-gxi-prow", children: row.map((pos, c) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
4999
- "div",
5000
- {
5001
- className: "ss-w-gxi-flag",
5002
- title: pos.nationality,
5003
- "aria-label": pos.nationality,
5004
- children: nationalityFlag(pos.nationality)
5005
- },
5006
- `${pos.slot}-${c}`
5007
- )) }, r)) }),
5008
- clientState && clientState.earnedReveals.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "ss-w-gxi-reveals", children: clientState.earnedReveals.map((r, i) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(RevealCard, { reveal: r }, i)) }),
5009
- !isOver ? /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(import_jsx_runtime59.Fragment, { children: [
5010
- wrongGuesses.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "ss-w-gxi-wrong", children: wrongGuesses.map((g) => {
5068
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "ss-w-gscroll", children: [
5069
+ rows.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "ss-w-gxi-pitch", children: rows.map((row, r) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "ss-w-gxi-prow", children: row.map((pos, c) => {
5070
+ const posLabel = pos.slot ? posBySlot.get(pos.slot) ?? "" : "";
5071
+ const name = pos.slot ? nameBySlot.get(pos.slot) : void 0;
5072
+ return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "ss-w-gxi-slot", children: [
5073
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
5074
+ "div",
5075
+ {
5076
+ className: `ss-w-gxi-flag${name ? " ss-w-gxi-flag--revealed" : ""}`,
5077
+ title: pos.nationality,
5078
+ "aria-label": `${posLabel ? posLabel + " \u2014 " : ""}${pos.nationality}${name ? " \u2014 " + name : ""}`,
5079
+ children: nationalityFlag(pos.nationality)
5080
+ }
5081
+ ),
5082
+ posLabel && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "ss-w-gxi-pos", children: posLabel }),
5083
+ name && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "ss-w-gxi-flag-lab", children: surname(name) })
5084
+ ] }, `${pos.slot}-${c}`);
5085
+ }) }, r)) }),
5086
+ revealCount > 0 && !isOver && /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "ss-w-gxi-revnote", children: [
5087
+ "\u{1F50E} ",
5088
+ revealCount,
5089
+ " player",
5090
+ revealCount === 1 ? "" : "s",
5091
+ " revealed \u2014 highlighted on the pitch"
5092
+ ] }),
5093
+ !isOver && wrongGuesses.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "ss-w-gxi-wrong", children: wrongGuesses.map((g) => {
5011
5094
  const team = config.teamPool.find((t) => t.teamId === g.teamId);
5012
5095
  return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "ss-w-gxi-wrong-pill", children: team?.teamName ?? `#${g.teamId}` }, g.teamId);
5013
5096
  }) }),
5014
- /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "ss-w-gtta", children: [
5015
- /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
5016
- "input",
5017
- {
5018
- id: inputId,
5019
- type: "text",
5020
- role: "textbox",
5021
- className: "ss-w-gtta-i",
5022
- placeholder: "Name the team\u2026",
5023
- value: query,
5024
- disabled: submitting || isOver,
5025
- onChange: (e) => setQuery(e.target.value),
5026
- autoComplete: "off",
5027
- "aria-label": "Name the team",
5028
- "aria-autocomplete": "list"
5029
- }
5030
- ),
5031
- query.length > 0 && filtered.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "ss-w-gtta-drop", role: "listbox", children: filtered.map((t) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
5032
- "div",
5033
- {
5034
- className: "ss-w-gtta-opt",
5035
- role: "option",
5036
- "aria-selected": false,
5037
- onClick: () => handlePick(t.teamId),
5038
- onKeyDown: (e) => {
5039
- if (e.key === "Enter") handlePick(t.teamId);
5040
- },
5041
- tabIndex: 0,
5042
- children: t.teamName
5043
- },
5044
- t.teamId
5045
- )) })
5046
- ] })
5047
- ] }) : clientState && /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: `ss-w-gxi-banner ss-w-gxi-banner--${solved ? "solved" : "failed"}`, children: [
5048
- /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "ss-w-gxi-banner-label", children: solved ? "\u2705 Solved!" : "\u{1F614} Out of guesses" }),
5049
- /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "ss-w-gxi-banner-score", children: clientState.score }),
5050
- /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "ss-w-gxi-banner-sub", children: [
5051
- clientState.guessesUsed,
5052
- " guess",
5053
- clientState.guessesUsed === 1 ? "" : "es",
5054
- " \xB7 come back tomorrow"
5097
+ isOver && clientState && /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: `ss-w-gxi-banner ss-w-gxi-banner--${solved ? "solved" : "failed"}`, children: [
5098
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "ss-w-gxi-banner-label", children: solved ? "\u2705 Solved!" : "\u{1F614} Out of guesses" }),
5099
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "ss-w-gxi-banner-score", children: clientState.score }),
5100
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "ss-w-gxi-banner-sub", children: [
5101
+ clientState.guessesUsed,
5102
+ " guess",
5103
+ clientState.guessesUsed === 1 ? "" : "es",
5104
+ " \xB7 come back tomorrow"
5105
+ ] })
5055
5106
  ] })
5107
+ ] }),
5108
+ !isOver && /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "ss-w-gpin ss-w-gtta", children: [
5109
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
5110
+ "input",
5111
+ {
5112
+ id: inputId,
5113
+ type: "text",
5114
+ role: "textbox",
5115
+ className: "ss-w-gtta-i",
5116
+ placeholder: "Name the team\u2026",
5117
+ value: query,
5118
+ disabled: submitting || isOver,
5119
+ onChange: (e) => setQuery(e.target.value),
5120
+ autoComplete: "off",
5121
+ "aria-label": "Name the team",
5122
+ "aria-autocomplete": "list"
5123
+ }
5124
+ ),
5125
+ query.length > 0 && filtered.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "ss-w-gtta-drop", role: "listbox", children: filtered.map((t) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
5126
+ "div",
5127
+ {
5128
+ className: "ss-w-gtta-opt",
5129
+ role: "option",
5130
+ "aria-selected": false,
5131
+ onClick: () => handlePick(t.teamId),
5132
+ onKeyDown: (e) => {
5133
+ if (e.key === "Enter") handlePick(t.teamId);
5134
+ },
5135
+ tabIndex: 0,
5136
+ children: t.teamName
5137
+ },
5138
+ t.teamId
5139
+ )) })
5056
5140
  ] })
5057
5141
  ] })
5058
5142
  ] });
@@ -5749,7 +5833,7 @@ function GamesPanel({
5749
5833
  const [selected, setSelected] = (0, import_react37.useState)(null);
5750
5834
  if (!loggedIn) return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(GamesLoginWall, { ui });
5751
5835
  if (selected !== null) {
5752
- return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "ss-w-mon-list", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
5836
+ return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "ss-w-gscreen-wrap", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
5753
5837
  GameScreenHost,
5754
5838
  {
5755
5839
  selected,
@@ -6934,7 +7018,24 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
6934
7018
  .ss-w-tile-chip--fun { color: var(--ss-w-faint); background: var(--ss-w-bubble); border: 1px solid var(--ss-w-line); }
6935
7019
 
6936
7020
  /* Game screen host: back-row + placeholder body */
6937
- .ss-w-gscreen { display: flex; flex-direction: column; gap: 0; }
7021
+ /* Game screen fills the panel; the board scrolls internally and the search/input bar stays
7022
+ pinned at the bottom so the fan never has to scroll to reach it. */
7023
+ .ss-w-gscreen-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 14px; overflow: hidden; }
7024
+ .ss-w-gscreen { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 0; }
7025
+ .ss-w-gscreen > .ss-w-gxi, .ss-w-gscreen > .ss-w-gt, .ss-w-gscreen > .ss-w-cpath,
7026
+ .ss-w-gscreen > .ss-w-btg, .ss-w-gscreen > .ss-w-hl { flex: 1; min-height: 0; }
7027
+ /* Scrollable board + guess-history region. */
7028
+ .ss-w-gscroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 10px; padding-bottom: 2px; }
7029
+ /* Bottom-pinned bar (search input / action). */
7030
+ .ss-w-gpin { flex-shrink: 0; padding-top: 10px; }
7031
+ /* Heads stay put above the scroll region. */
7032
+ .ss-w-gxi-head, .ss-w-gt-head, .ss-w-cpath-head, .ss-w-btg-head { flex-shrink: 0; }
7033
+ /* Mystery Tiger explainer key (\u2713 / \u25B2 / \u25BC). */
7034
+ .ss-w-gt-key { white-space: nowrap; }
7035
+ .ss-w-gt-key b { font-weight: 800; color: var(--ss-w-ink); }
7036
+ .ss-w-gt-key-ok { color: var(--ss-w-correct) !important; }
7037
+ /* Higher or Lower terminal score unit. */
7038
+ .ss-w-hl-over-unit { font-size: 14px; font-weight: 700; color: var(--ss-w-faint); }
6938
7039
  .ss-w-gscreen-back { display: inline-flex; align-items: center; gap: 5px; background: none; border: none; color: var(--ss-w-accent); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; padding: 6px 0 10px; align-self: flex-start; }
6939
7040
  .ss-w-gscreen-back-arrow { font-size: 11px; font-weight: 700; }
6940
7041
  .ss-w-gscreen-body { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 16px; color: var(--ss-w-faint); font-size: 13px; text-align: center; }
@@ -6988,7 +7089,9 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
6988
7089
  .ss-w-gtta-i { width: 100%; box-sizing: border-box; padding: 9px 12px; border-radius: 10px; border: 1.5px solid var(--ss-w-line); background: var(--ss-w-panel); color: var(--ss-w-ink); font: inherit; font-size: 13px; outline: none; transition: border-color .12s; }
6989
7090
  .ss-w-gtta-i:focus { border-color: var(--ss-w-accent); }
6990
7091
  .ss-w-gtta-i:disabled { opacity: .5; cursor: not-allowed; }
6991
- .ss-w-gtta-drop { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 10; background: var(--ss-w-panel); border: 1px solid var(--ss-w-line); border-radius: 10px; max-height: 180px; overflow-y: auto; box-shadow: 0 4px 16px rgba(0,0,0,.12); }
7092
+ /* Opens UPWARD (bottom-anchored) because the input is pinned to the panel's bottom edge \u2014 a
7093
+ downward menu would be clipped off-screen. */
7094
+ .ss-w-gtta-drop { position: absolute; left: 0; right: 0; bottom: calc(100% + 4px); top: auto; z-index: 10; background: var(--ss-w-panel); border: 1px solid var(--ss-w-line); border-radius: 10px; max-height: 200px; overflow-y: auto; box-shadow: 0 -4px 16px rgba(0,0,0,.16); }
6992
7095
  .ss-w-gtta-opt { padding: 9px 12px; font-size: 13px; cursor: pointer; color: var(--ss-w-ink); border-bottom: 1px solid var(--ss-w-line); }
6993
7096
  .ss-w-gtta-opt:last-child { border-bottom: none; }
6994
7097
  .ss-w-gtta-opt:hover { background: var(--ss-w-bubble); }
@@ -7138,7 +7241,9 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
7138
7241
  .ss-w-gxi { display: flex; flex-direction: column; gap: 12px; }
7139
7242
  /* Header */
7140
7243
  .ss-w-gxi-head { display: flex; align-items: flex-start; gap: 8px; }
7141
- .ss-w-gxi-title { font-size: 18px; font-weight: 800; text-transform: uppercase; letter-spacing: .02em; color: var(--ss-w-ink); line-height: 1; }
7244
+ .ss-w-gxi-title { font-size: 18px; font-weight: 800; text-transform: uppercase; letter-spacing: .02em; color: var(--ss-w-ink); line-height: 1; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
7245
+ /* Formation pill next to the title, e.g. "4-2-3-1". */
7246
+ .ss-w-gxi-form { font-size: 12px; font-weight: 800; letter-spacing: .06em; color: var(--ss-w-accent); background: color-mix(in srgb, var(--ss-w-accent) 12%, var(--ss-w-panel)); border: 1px solid color-mix(in srgb, var(--ss-w-accent) 26%, var(--ss-w-line)); border-radius: 999px; padding: 2px 9px; font-variant-numeric: tabular-nums; }
7142
7247
  .ss-w-gxi-sub { font-size: 11px; color: var(--ss-w-faint); margin-top: 4px; }
7143
7248
  .ss-w-gxi-left { margin-left: auto; flex: none; font-size: 11px; font-weight: 700; color: var(--ss-w-accent); background: color-mix(in srgb, var(--ss-w-accent) 11%, var(--ss-w-panel)); border: 1px solid color-mix(in srgb, var(--ss-w-accent) 22%, var(--ss-w-line)); border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
7144
7249
  /* Pitch: a flag per slot laid out in formation rows on a green field. A real min-height plus
@@ -7147,13 +7252,22 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
7147
7252
  /* A football pitch is grass-green regardless of the operator accent, so the field uses fixed
7148
7253
  green values (not --ss-w-correct, which is a muted per-operator token that vanished on dark
7149
7254
  themes) plus visible horizontal yard-lines and a brighter halfway line. */
7150
- .ss-w-gxi-pitch { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; min-height: 300px; padding: 18px 10px; border-radius: 14px; border: 1px solid rgba(46, 160, 86, .38);
7255
+ .ss-w-gxi-pitch { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 6px; min-height: 210px; padding: 14px 10px; border-radius: 14px; border: 1px solid rgba(46, 160, 86, .38);
7151
7256
  background:
7152
7257
  linear-gradient(180deg, rgba(46, 160, 86, .015) 0, rgba(46, 160, 86, .015) 49.5%, rgba(255,255,255,.14) 49.5%, rgba(255,255,255,.14) 50.5%, rgba(46, 160, 86, .015) 50.5%),
7153
7258
  repeating-linear-gradient(180deg, transparent 0 31px, rgba(255,255,255,.045) 31px 32px),
7154
7259
  linear-gradient(180deg, rgba(46, 160, 86, .28), rgba(38, 132, 71, .16)); }
7155
- .ss-w-gxi-prow { display: flex; justify-content: center; align-items: center; gap: 12px; }
7260
+ .ss-w-gxi-prow { display: flex; justify-content: center; align-items: flex-start; gap: 12px; }
7261
+ .ss-w-gxi-slot { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 46px; }
7156
7262
  .ss-w-gxi-flag { width: 32px; height: 32px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 17px; line-height: 1; background: rgba(9, 12, 10, .55); border: 1px solid rgba(255,255,255,.16); box-shadow: 0 1px 3px rgba(0,0,0,.3); overflow: hidden; }
7263
+ /* A slot whose player has been revealed by a wrong guess. */
7264
+ .ss-w-gxi-flag--revealed { border-color: var(--ss-w-accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--ss-w-accent) 45%, transparent); }
7265
+ /* Position label shown under every flag (GK, CB, CM, ST\u2026) \u2014 reads the formation and marks the
7266
+ keeper's end. Muted so it sits behind the flag, not competing with it. */
7267
+ .ss-w-gxi-pos { font-size: 8.5px; line-height: 1.05; font-weight: 800; letter-spacing: .04em; text-align: center; color: rgba(255,255,255,.82); text-shadow: 0 1px 2px rgba(0,0,0,.5); }
7268
+ /* Player surname, shown under the position once a wrong guess reveals it \u2014 in the accent colour. */
7269
+ .ss-w-gxi-flag-lab { font-size: 8px; line-height: 1.05; font-weight: 700; text-align: center; color: var(--ss-w-accent); max-width: 46px; word-break: break-word; }
7270
+ .ss-w-gxi-revnote { font-size: 11px; color: var(--ss-w-faint); }
7157
7271
  /* Wrong-guess trail */
7158
7272
  .ss-w-gxi-wrong { display: flex; flex-wrap: wrap; gap: 6px; }
7159
7273
  .ss-w-gxi-wrong-pill { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: color-mix(in srgb, var(--ss-w-wrong) 10%, var(--ss-w-panel)); border: 1px solid var(--ss-w-line); color: var(--ss-w-faint); text-decoration: line-through; }