Girgie commited on
Commit
dfcca3c
·
verified ·
1 Parent(s): 519d00e

Fix poker table zoom scaling

Browse files
SPEC.md CHANGED
@@ -61,7 +61,7 @@ Proposed default model IDs:
61
  - Nemotron Nano: `nvidia/NVIDIA-Nemotron-3-Nano-4B-GGUF`
62
  - Qwen: `lm-kit/qwen-3-0.6b-instruct-gguf` or an official `Qwen/Qwen3-0.6B` runtime-compatible variant if preferred after spike
63
  - Gemma: `google/gemma-3-270m-it` or `unsloth/gemma-3-270m-it-GGUF`
64
- - Cohere Command R7B: `CohereLabs/c4ai-command-r7b-12-2024`
65
  - Mistral: `TheBloke/Mistral-7B-Instruct-v0.2-GGUF` or a smaller compatible Mistral-family GGUF if found
66
  - OpenAI Open Model 20B: `openai/gpt-oss-20b` or `unsloth/gpt-oss-20b-GGUF`
67
 
@@ -126,7 +126,7 @@ The six named model agents should not be forced into identical templates. Each r
126
  - Qwen: analytical and precise.
127
  - Gemma: cautious and methodical.
128
  - Mistral: sharp and aggressive.
129
- - Cohere Command R7B: commanding, multilingual, and tactical.
130
  - Nemotron: logical and controlled.
131
  - OpenAI Open Model 20B: confident, strategic, occasionally theatrical.
132
 
 
61
  - Nemotron Nano: `nvidia/NVIDIA-Nemotron-3-Nano-4B-GGUF`
62
  - Qwen: `lm-kit/qwen-3-0.6b-instruct-gguf` or an official `Qwen/Qwen3-0.6B` runtime-compatible variant if preferred after spike
63
  - Gemma: `google/gemma-3-270m-it` or `unsloth/gemma-3-270m-it-GGUF`
64
+ - Cohere North Mini: `CohereLabs/North-Mini-Code-1.0` or `unsloth/North-Mini-Code-1.0-GGUF`
65
  - Mistral: `TheBloke/Mistral-7B-Instruct-v0.2-GGUF` or a smaller compatible Mistral-family GGUF if found
66
  - OpenAI Open Model 20B: `openai/gpt-oss-20b` or `unsloth/gpt-oss-20b-GGUF`
67
 
 
126
  - Qwen: analytical and precise.
127
  - Gemma: cautious and methodical.
128
  - Mistral: sharp and aggressive.
129
+ - Cohere North Mini: creative and unpredictable.
130
  - Nemotron: logical and controlled.
131
  - OpenAI Open Model 20B: confident, strategic, occasionally theatrical.
132
 
assets/token-holdem/manifest.json CHANGED
@@ -314,7 +314,7 @@
314
  "promptRef": "docs/token-holdem-avatar-personas.md",
315
  "source": "generated with Codex image generation, 2026-06-15",
316
  "usedBy": [
317
- "token_holdem/render.py AVATAR_PERSONAS Cohere Command R7B"
318
  ],
319
  "qa": [
320
  "No logos or wordmarks.",
@@ -451,32 +451,6 @@
451
  "Trickster read is clear through green face, patched hat, grin, chip gesture, and cards."
452
  ]
453
  },
454
- {
455
- "id": "avatar-gobbo-trickster-transparent",
456
- "file": "/gradio_api/file=assets/token-holdem/avatar-gobbo-trickster-transparent-512.png",
457
- "role": "avatar",
458
- "dimensions": {
459
- "width": 512,
460
- "height": 512
461
- },
462
- "format": "png",
463
- "alpha": true,
464
- "anchor": "seat",
465
- "safeArea": "Transparent cutout for large table-seat avatar use; no square or circular portrait backing.",
466
- "states": [
467
- "neutral"
468
- ],
469
- "promptRef": "docs/token-holdem-avatar-personas.md",
470
- "source": "derived from avatar-gobbo-trickster-neutral-512.png with background removal and alpha cleanup, 2026-06-15",
471
- "usedBy": [
472
- "token_holdem/render.py AVATAR_PERSONAS OpenAI Open Model 20B"
473
- ],
474
- "qa": [
475
- "RGBA alpha channel present.",
476
- "Old tavern portrait backing removed for table-seat compositing.",
477
- "Readable at large table-seat scale."
478
- ]
479
- },
480
  {
481
  "id": "ambient-candle-prop",
482
  "file": null,
 
314
  "promptRef": "docs/token-holdem-avatar-personas.md",
315
  "source": "generated with Codex image generation, 2026-06-15",
316
  "usedBy": [
317
+ "token_holdem/render.py AVATAR_PERSONAS Cohere North Mini"
318
  ],
319
  "qa": [
320
  "No logos or wordmarks.",
 
451
  "Trickster read is clear through green face, patched hat, grin, chip gesture, and cards."
452
  ]
453
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
454
  {
455
  "id": "ambient-candle-prop",
456
  "file": null,
docs/token-holdem-avatar-personas.md CHANGED
@@ -50,13 +50,13 @@ Reusable non-infringing persona and prompt notes for future AI player portraits.
50
  - Sprite Prompt: `Token Hold'em AI poker avatar sprite, diplomat archetype, small steady full-body token, shawl, open palm, tidy chip rows, kind calculating expression, readable at small size, cozy pixel-art tavern lighting, transparent background, no text, no logos, no brand marks.`
51
  - Naming: `avatar_gemma-diplomat_portrait.png`, `avatar_gemma-diplomat_<state>.png`.
52
 
53
- ## Cohere Command R7B
54
 
55
- - Seed: commanding, multilingual, tactical.
56
- - Persona: cartographer commander.
57
- - Display Name: Command R7B.
58
- - Read: decisive route-maker with lantern, scarf, and hidden-card misdirection.
59
- - Concept: A tactical table navigator who turns chip stacks into routes and pressure points. The character can stay whimsical, but the face must stay unobscured and non-branded.
60
  - Signature Motifs: small lantern, loose scarf, mismatched gloves, hidden-card gesture, asymmetrical trim, playful wink, travel cloak.
61
  - Palette: lantern amber for drama, pine green for northward cue, plum for mischief, pale brass for highlights.
62
  - Portrait Prompt: `Token Hold'em AI poker avatar, trickster archetype, lively asymmetrical silhouette, playful wink, travel cloak, loose scarf, mismatched gloves, small lantern, hidden-card gesture away from the face, cozy tavern poker room mood, readable charming pixel-art game portrait, centered bust, warm rim light, transparent background, no text, no logos, no brand marks, no UI screenshots, no exact mascot likeness.`
 
50
  - Sprite Prompt: `Token Hold'em AI poker avatar sprite, diplomat archetype, small steady full-body token, shawl, open palm, tidy chip rows, kind calculating expression, readable at small size, cozy pixel-art tavern lighting, transparent background, no text, no logos, no brand marks.`
51
  - Naming: `avatar_gemma-diplomat_portrait.png`, `avatar_gemma-diplomat_<state>.png`.
52
 
53
+ ## Cohere North Mini
54
 
55
+ - Seed: creative, unpredictable, poetic.
56
+ - Persona: trickster.
57
+ - Display Name: Northwind Riddle.
58
+ - Read: playful wanderer with lantern, scarf, and hidden-card misdirection.
59
+ - Concept: A poetic table improviser who turns chip stacks into stage props. The character can be whimsical, but the face must stay unobscured and non-branded.
60
  - Signature Motifs: small lantern, loose scarf, mismatched gloves, hidden-card gesture, asymmetrical trim, playful wink, travel cloak.
61
  - Palette: lantern amber for drama, pine green for northward cue, plum for mischief, pale brass for highlights.
62
  - Portrait Prompt: `Token Hold'em AI poker avatar, trickster archetype, lively asymmetrical silhouette, playful wink, travel cloak, loose scarf, mismatched gloves, small lantern, hidden-card gesture away from the face, cozy tavern poker room mood, readable charming pixel-art game portrait, centered bust, warm rim light, transparent background, no text, no logos, no brand marks, no UI screenshots, no exact mascot likeness.`
tests/test_table_render.py CHANGED
@@ -56,3 +56,10 @@ def test_dealer_button_uses_slot_coordinates():
56
 
57
  def test_poker_stage_paints_above_side_rails():
58
  assert ".poker-stage {\n grid-area: stage;\n z-index: calc(var(--z-hud) + 1);" in CSS
 
 
 
 
 
 
 
 
56
 
57
  def test_poker_stage_paints_above_side_rails():
58
  assert ".poker-stage {\n grid-area: stage;\n z-index: calc(var(--z-hud) + 1);" in CSS
59
+
60
+
61
+ def test_table_scales_to_stage_container_not_viewport():
62
+ assert "container-type: inline-size;" in CSS
63
+ assert ".token-table {\n position: relative;\n width: 100%;" in CSS
64
+ assert "height: clamp(500px, 62.5cqw, 700px);" in CSS
65
+ assert "width: clamp(132px, 14cqw, 206px);" in CSS
token_holdem/render.py CHANGED
@@ -57,12 +57,12 @@ AVATAR_PERSONAS: dict[str, dict[str, str]] = {
57
  "talk": "Small folds keep stacks warm.",
58
  "avatar": "/gradio_api/file=assets/token-holdem/avatar-gemma-hearth-halfbody-768.png",
59
  },
60
- "Cohere Command R7B": {
61
- "display": "Command R7B",
62
- "role": "Cartographer commander",
63
- "initials": "CO",
64
  "accent": "#c982bc",
65
- "talk": "A precise detour enters the pot.",
66
  "avatar": "/gradio_api/file=assets/token-holdem/avatar-north-cartographer-halfbody-768.png",
67
  },
68
  "Mistral": {
@@ -79,7 +79,7 @@ AVATAR_PERSONAS: dict[str, dict[str, str]] = {
79
  "initials": "OM",
80
  "accent": "#f2c45d",
81
  "talk": "Expected value takes the stage.",
82
- "avatar": "/gradio_api/file=assets/token-holdem/avatar-gobbo-trickster-transparent-512.png",
83
  },
84
  "Llama Scout": {
85
  "display": "Llama Scout",
@@ -585,6 +585,7 @@ CSS = """
585
  .poker-stage {
586
  grid-area: stage;
587
  z-index: calc(var(--z-hud) + 1);
 
588
  display: flex;
589
  align-items: center;
590
  justify-content: center;
@@ -674,9 +675,12 @@ CSS = """
674
  .table-status-bar span { min-height: 26px; display: inline-flex; align-items: center; padding: 2px 9px; border: 1px solid rgba(196,147,78,.48); border-radius: 6px; background: rgba(18,12,16,.70); box-shadow: 0 2px 0 rgba(0,0,0,.46); }
675
  .token-table {
676
  position: relative;
 
 
 
677
  overflow: visible;
678
- aspect-ratio: 16 / 10;
679
- min-height: clamp(560px, 59dvh, 720px);
680
  border: 0;
681
  border-radius: 26px;
682
  background: transparent;
@@ -724,7 +728,7 @@ CSS = """
724
  position: absolute;
725
  inset: 13% 4% 7%;
726
  z-index: var(--z-table);
727
- border: clamp(22px, 3.1vw, 36px) solid var(--walnut);
728
  border-radius: 50%;
729
  background:
730
  linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px),
@@ -809,9 +813,9 @@ CSS = """
809
  .pot { color: #ffe29a; font: 900 24px ui-monospace, monospace; text-shadow: 0 0 12px rgba(255,211,122,.3); }
810
  .street { color: #b7f7c1; font: 800 13px ui-monospace, monospace; margin-bottom: 8px; }
811
  .result-banner { margin-top: 8px; padding: 7px 9px; border-radius: 6px; color: #120b17; background: linear-gradient(180deg, #ffe29a, #dca861); font: 900 12px ui-monospace, monospace; box-shadow: 0 3px 0 #5b331c; }
812
- .card-row { position: relative; z-index: calc(var(--z-table) + 14); display: flex; justify-content: center; align-items: center; gap: clamp(5px, .8vw, 10px); min-height: clamp(58px, 8vw, 78px); }
813
  .card, .mini-card { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; background: linear-gradient(180deg, #fff9e8, #ead7b4); color: #1b1520; border: 3px solid #3b2a24; border-radius: 4px; font-weight: 900; font-family: ui-monospace, monospace; box-shadow: 4px 4px 0 #000, 0 0 0 2px rgba(255,255,255,.18) inset; image-rendering: pixelated; }
814
- .card { width: clamp(44px, 5.2vw, 58px); height: clamp(62px, 7.3vw, 78px); font-size: clamp(16px, 2vw, 20px); }
815
  .mini-card { width: 28px; height: 38px; font-size: 12px; }
816
  .red-card { color: #a72828; }
817
  .hidden-card { background:
@@ -828,8 +832,8 @@ CSS = """
828
  left: var(--seat-x);
829
  top: var(--seat-y);
830
  transform: translate(-50%, -50%);
831
- width: clamp(150px, 14vw, 206px);
832
- min-height: 202px;
833
  display: block;
834
  padding: 0;
835
  text-align: center;
@@ -840,11 +844,11 @@ CSS = """
840
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease, opacity 180ms ease, filter 180ms ease;
841
  pointer-events: auto;
842
  }
843
- .seat-2, .seat-6 { width: clamp(138px, 12.2vw, 178px); }
844
- .human-seat { width: clamp(210px, 20vw, 286px); min-height: 240px; border-color: rgba(255,211,122,.8); }
845
  .seat-layer > .human-seat { z-index: calc(var(--z-avatars) + 2); }
846
- .avatar-layer { position: relative; z-index: 2; min-width: 0; height: clamp(132px, 13vw, 184px); pointer-events: none; }
847
- .human-seat .avatar-layer { height: clamp(160px, 16vw, 222px); }
848
  .avatar-slot {
849
  width: 100%;
850
  height: 100%;
@@ -915,7 +919,7 @@ CSS = """
915
  left: var(--bubble-x);
916
  top: var(--bubble-y);
917
  transform: translate(-50%, -100%);
918
- width: clamp(150px, 16vw, 210px);
919
  max-height: 76px;
920
  overflow: hidden;
921
  padding: 8px 10px;
@@ -1053,7 +1057,7 @@ button:focus-visible { outline: 3px solid var(--ember) !important; outline-offse
1053
  }
1054
  .tavern-left-rail .setup-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
1055
  .rail-plaque { display: none; }
1056
- .token-table { min-height: 660px; aspect-ratio: auto; }
1057
  .table-felt { inset: 3% 4% 21%; border-width: 12px; }
1058
  .center-hud { top: 38%; width: min(76%, 460px); min-width: 280px; }
1059
  .seat { width: 136px; min-height: 128px; padding: 6px; grid-template-columns: 36px minmax(0, 1fr); }
@@ -1071,12 +1075,16 @@ button:focus-visible { outline: 3px solid var(--ember) !important; outline-offse
1071
  .tavern-left-rail .setup-panel { grid-template-columns: 1fr; }
1072
  .token-table-shell { margin-top: 6px; }
1073
  .table-status-bar { justify-content: flex-start; overflow-x: auto; padding-bottom: 3px; }
1074
- .token-table { min-height: 800px; border-width: 4px; }
1075
  .table-felt { inset: 6% 3% 32%; border-width: 10px; }
1076
  .center-hud { top: 27%; width: calc(100% - 28px); min-width: 0; padding: 10px; }
1077
  .seat-ring { position: absolute; left: 10px; right: 10px; top: 43%; bottom: 172px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; overflow: auto; align-content: start; }
1078
- .seat { position: relative; left: auto; top: auto; transform: none; width: auto; min-height: 108px; }
1079
- .human-seat { position: absolute; left: 50%; right: auto; top: auto !important; bottom: 10px; transform: translateX(-50%); width: calc(100% - 28px); min-height: 134px; }
 
 
 
 
1080
  .seat-0 { order: 8; }
1081
  .dealer-button { width: 30px; height: 30px; font-size: 14px; }
1082
  .table-speech-layer { display: none; }
 
57
  "talk": "Small folds keep stacks warm.",
58
  "avatar": "/gradio_api/file=assets/token-holdem/avatar-gemma-hearth-halfbody-768.png",
59
  },
60
+ "Cohere North Mini": {
61
+ "display": "North",
62
+ "role": "Cartographer monk",
63
+ "initials": "NO",
64
  "accent": "#c982bc",
65
+ "talk": "A side quest enters the pot.",
66
  "avatar": "/gradio_api/file=assets/token-holdem/avatar-north-cartographer-halfbody-768.png",
67
  },
68
  "Mistral": {
 
79
  "initials": "OM",
80
  "accent": "#f2c45d",
81
  "talk": "Expected value takes the stage.",
82
+ "avatar": "/gradio_api/file=assets/token-holdem/avatar-open-model-savant-halfbody-768.png",
83
  },
84
  "Llama Scout": {
85
  "display": "Llama Scout",
 
585
  .poker-stage {
586
  grid-area: stage;
587
  z-index: calc(var(--z-hud) + 1);
588
+ container-type: inline-size;
589
  display: flex;
590
  align-items: center;
591
  justify-content: center;
 
675
  .table-status-bar span { min-height: 26px; display: inline-flex; align-items: center; padding: 2px 9px; border: 1px solid rgba(196,147,78,.48); border-radius: 6px; background: rgba(18,12,16,.70); box-shadow: 0 2px 0 rgba(0,0,0,.46); }
676
  .token-table {
677
  position: relative;
678
+ width: 100%;
679
+ max-width: 100%;
680
+ height: clamp(500px, 62.5cqw, 700px);
681
  overflow: visible;
682
+ aspect-ratio: auto;
683
+ min-height: 0;
684
  border: 0;
685
  border-radius: 26px;
686
  background: transparent;
 
728
  position: absolute;
729
  inset: 13% 4% 7%;
730
  z-index: var(--z-table);
731
+ border: clamp(18px, 3.1cqw, 34px) solid var(--walnut);
732
  border-radius: 50%;
733
  background:
734
  linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px),
 
813
  .pot { color: #ffe29a; font: 900 24px ui-monospace, monospace; text-shadow: 0 0 12px rgba(255,211,122,.3); }
814
  .street { color: #b7f7c1; font: 800 13px ui-monospace, monospace; margin-bottom: 8px; }
815
  .result-banner { margin-top: 8px; padding: 7px 9px; border-radius: 6px; color: #120b17; background: linear-gradient(180deg, #ffe29a, #dca861); font: 900 12px ui-monospace, monospace; box-shadow: 0 3px 0 #5b331c; }
816
+ .card-row { position: relative; z-index: calc(var(--z-table) + 14); display: flex; justify-content: center; align-items: center; gap: clamp(5px, .8cqw, 10px); min-height: clamp(52px, 8cqw, 78px); }
817
  .card, .mini-card { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; background: linear-gradient(180deg, #fff9e8, #ead7b4); color: #1b1520; border: 3px solid #3b2a24; border-radius: 4px; font-weight: 900; font-family: ui-monospace, monospace; box-shadow: 4px 4px 0 #000, 0 0 0 2px rgba(255,255,255,.18) inset; image-rendering: pixelated; }
818
+ .card { width: clamp(40px, 5.2cqw, 58px); height: clamp(56px, 7.3cqw, 78px); font-size: clamp(15px, 2cqw, 20px); }
819
  .mini-card { width: 28px; height: 38px; font-size: 12px; }
820
  .red-card { color: #a72828; }
821
  .hidden-card { background:
 
832
  left: var(--seat-x);
833
  top: var(--seat-y);
834
  transform: translate(-50%, -50%);
835
+ width: clamp(132px, 14cqw, 206px);
836
+ min-height: 184px;
837
  display: block;
838
  padding: 0;
839
  text-align: center;
 
844
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease, opacity 180ms ease, filter 180ms ease;
845
  pointer-events: auto;
846
  }
847
+ .seat-2, .seat-6 { width: clamp(124px, 12.2cqw, 178px); }
848
+ .human-seat { width: clamp(190px, 20cqw, 286px); min-height: 216px; border-color: rgba(255,211,122,.8); }
849
  .seat-layer > .human-seat { z-index: calc(var(--z-avatars) + 2); }
850
+ .avatar-layer { position: relative; z-index: 2; min-width: 0; height: clamp(112px, 13cqw, 184px); pointer-events: none; }
851
+ .human-seat .avatar-layer { height: clamp(138px, 16cqw, 222px); }
852
  .avatar-slot {
853
  width: 100%;
854
  height: 100%;
 
919
  left: var(--bubble-x);
920
  top: var(--bubble-y);
921
  transform: translate(-50%, -100%);
922
+ width: clamp(142px, 16cqw, 210px);
923
  max-height: 76px;
924
  overflow: hidden;
925
  padding: 8px 10px;
 
1057
  }
1058
  .tavern-left-rail .setup-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
1059
  .rail-plaque { display: none; }
1060
+ .token-table { height: clamp(600px, 86cqw, 660px); min-height: 0; aspect-ratio: auto; }
1061
  .table-felt { inset: 3% 4% 21%; border-width: 12px; }
1062
  .center-hud { top: 38%; width: min(76%, 460px); min-width: 280px; }
1063
  .seat { width: 136px; min-height: 128px; padding: 6px; grid-template-columns: 36px minmax(0, 1fr); }
 
1075
  .tavern-left-rail .setup-panel { grid-template-columns: 1fr; }
1076
  .token-table-shell { margin-top: 6px; }
1077
  .table-status-bar { justify-content: flex-start; overflow-x: auto; padding-bottom: 3px; }
1078
+ .token-table { height: min(760px, max(640px, calc(100dvh - 84px))); min-height: 0; border-width: 4px; }
1079
  .table-felt { inset: 6% 3% 32%; border-width: 10px; }
1080
  .center-hud { top: 27%; width: calc(100% - 28px); min-width: 0; padding: 10px; }
1081
  .seat-ring { position: absolute; left: 10px; right: 10px; top: 43%; bottom: 172px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; overflow: auto; align-content: start; }
1082
+ .seat { position: relative; left: auto; top: auto; transform: none; width: auto; min-height: 104px; }
1083
+ .human-seat { position: absolute; left: 50%; right: auto; top: auto !important; bottom: 10px; transform: translateX(-50%); width: calc(100% - 28px); min-height: 124px; }
1084
+ .avatar-layer { height: 86px; }
1085
+ .human-seat .avatar-layer { height: 104px; }
1086
+ .avatar-slot img { width: 112%; height: 112%; }
1087
+ .seat-plaque { margin-top: -12px; padding: 5px 6px 6px; }
1088
  .seat-0 { order: 8; }
1089
  .dealer-button { width: 30px; height: 30px; font-size: 14px; }
1090
  .table-speech-layer { display: none; }