Compare commits

...

83 Commits

Author SHA1 Message Date
funman300 396ba6bc97 fix(ci): always install Java regardless of SDK cache hit; harden release creation
Android Build / build-apk (push) Failing after 13s
Build and Deploy / build-and-push (push) Successful in 38s
Android Release / build-release-apk (push) Failing after 11s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-14 10:11:42 -07:00
Gitea CI 88298206bb chore(deploy): bump image to 0f650311 [skip ci] 2026-05-14 17:11:05 +00:00
funman300 0f65031114 ci: add Android release workflow — sign and publish APK on version tag
Android Build / build-apk (push) Failing after 11s
Build and Deploy / build-and-push (push) Successful in 23s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-14 10:10:27 -07:00
funman300 c91ce9436e fix(deploy): copy classic theme assets into Docker runtime image
Build and Deploy / build-and-push (push) Failing after 27s
solitaire_engine/assets/themes/classic/ was absent from the container
because only the workspace-root assets/ directory was copied. The
AssetServer serves themes/classic/ from that same root, so the classic
theme manifested as a missing-asset load failure at runtime.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 23:00:43 -07:00
Gitea CI ace96b4a47 chore(deploy): bump image to ea079af9 [skip ci] 2026-05-14 05:58:01 +00:00
funman300 ea079af9e1 ci: add Android APK build workflow
Android Build / build-apk (push) Failing after 59s
Build and Deploy / build-and-push (push) Successful in 26s
Triggers on every master push that touches app/engine/asset code
(ignores deploy/, argocd/, solitaire_server/, *.md).

Three-layer cache strategy:
  1. Android SDK + NDK keyed by NDK + build-tools versions (~2 GB, stable)
  2. cargo-apk binary keyed by OS + toolchain (avoids recompiling the tool)
  3. Cargo registry + build artifacts keyed by Cargo.lock + SHA

Outputs a debug APK as a workflow artifact retained for 30 days.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 22:56:34 -07:00
Gitea CI c66d81c73a chore(deploy): bump image to 20b7a617 [skip ci] 2026-05-14 05:53:08 +00:00
funman300 20b7a617e0 feat(engine): rename themes — Classic is default, Dark replaces Default
Build and Deploy / build-and-push (push) Successful in 33s
- Rename assets/themes/default/ → assets/themes/dark/; update theme.ron
  id/name to "dark"/"Dark"
- Rename all DEFAULT_THEME_* constants → DARK_THEME_* and
  default_theme_svg_bytes / populate_embedded_default_theme → dark_*
- Add bundled_theme_url() helper for URL resolution without needing the
  registry (used by Startup systems where ordering isn't guaranteed)
- Registry now lists Classic first (new player default), Dark second
- settings.rs default_theme_id() returns "classic" so fresh installs
  start on the white card theme

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 22:52:44 -07:00
funman300 7a0d57b2b1 feat(engine): add Classic card theme
White/cream card faces with traditional red (hearts/diamonds) and black
(clubs/spades) colours, plus a navy diamond-pattern card back. Shipped
as a bundled AssetServer theme alongside the existing Default theme.

Registry updated to include the Classic entry; registry tests updated
to reflect the new BUNDLED_COUNT of 2.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 22:52:44 -07:00
Gitea CI 93ec4a7478 chore(deploy): bump image to 72dfd741 [skip ci] 2026-05-14 05:34:53 +00:00
funman300 72dfd741c4 fix(web): add Matomo tracking snippet to all pages
Build and Deploy / build-and-push (push) Successful in 4m10s
Only game.html had the snippet; the other five pages were missing it,
causing the Matomo installation verification check to fail.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 22:30:08 -07:00
funman300 3837a10b15 fix(deploy): use matomo.php for liveness/readiness probes
/index.php returns 302 after tables are created (installer redirect),
which fails k8s HTTP probes. /matomo.php is the tracker endpoint and
always returns 200 regardless of installation state. Also add
timeoutSeconds: 5 since PHP startup can exceed the 1s default.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 22:03:07 -07:00
funman300 574115cb71 fix(deploy): switch matomo to official image 5.10.0
bitnami/matomo was removed from Docker Hub (0 tags). Switch to the
official matomo:5.10.0 image; update port 8080→80, volume path to
/var/www/html, and env var names to match the official image schema.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 21:52:00 -07:00
Gitea CI 1707553790 chore(deploy): bump image to 6905f26b [skip ci] 2026-05-14 04:37:19 +00:00
funman300 6905f26b56 security: remove secrets from git, gitignore k8s secret files
Build and Deploy / build-and-push (push) Successful in 35s
Secrets committed in prior commits (matomo-secret.yaml,
secret-analytics-auth.yaml) have been scrubbed from history via
filter-branch — rotate those credentials immediately.

Going forward:
- deploy/*-secret.yaml is gitignored; apply manually with kubectl
- deploy/matomo-secret.yaml.example shows the required shape
- ArgoCD ignoreDifferences on matomo-secret prevents it pruning a
  manually-applied secret
- Remove matomo-secret.yaml from kustomization.yaml so ArgoCD never
  manages it again

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 21:36:46 -07:00
funman300 1b7c4d92aa fix(web): auto-complete now works with cards remaining in waste
check_auto_complete no longer requires the waste pile to be empty —
only the stock must be exhausted and all tableau cards face-up.
next_auto_complete_move checks the waste top card before scanning
tableau, and auto_complete_step falls back to draw() when no direct
foundation move is available so the waste drains automatically.

Fixes the end-game state where the player could see a clear win but
the auto-complete interval never fired because the waste was non-empty.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 21:30:46 -07:00
Gitea CI d685224ce6 chore(deploy): bump image to 3e006a1e [skip ci] 2026-05-14 04:14:55 +00:00
funman300 539779d78b feat(analytics): replace custom pipeline with Matomo
Removes the hand-rolled analytics endpoint and SQLite event table in favour
of Matomo — a self-hosted, full-featured analytics platform.

k8s:
- Deploy MariaDB 11 + Bitnami Matomo 5 in the solitaire namespace
- Route analytics.aleshym.co ingress to the Matomo service
- Remove Datasette sidecar and its BasicAuth middleware/secret
- Remove the analytics port from the solitaire-server Service

Rust:
- Replace AnalyticsClient (custom HTTP endpoint) with MatomoClient (Matomo
  HTTP Tracking API bulk endpoint); maps game events to Matomo categories
- Add matomo_url + matomo_site_id fields to Settings (serde default → None/1)
- Privacy toggle in Settings now activates when matomo_url is set (not tied
  to SyncBackend::SolitaireServer)
- Remove POST /api/analytics route from solitaire_server

Web:
- Add Matomo JS tracking snippet to game.html (/play page)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 21:10:15 -07:00
funman300 f6506c57e5 feat(deploy): Datasette analytics sidecar + analytics.aleshym.co ingress
Adds a Datasette container alongside the existing server in the same pod so
it can read the SQLite PVC without a second ReadWriteOnce mount. Protected
by a Traefik BasicAuth middleware at analytics.aleshym.co.

Also fixes the ArgoCD repoURL to point to the migrated Gitea hostname
(git.aleshym.co) instead of the old bare IP.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 20:17:20 -07:00
Gitea CI b88f3df119 chore(deploy): bump image to 3cec200a [skip ci] 2026-05-14 03:10:52 +00:00
funman300 0dcb783e94 feat(analytics): opt-in usage analytics with server ingest and settings toggle
- Server: POST /api/analytics endpoint with per-IP rate limit (5/min),
  batch validation (≤50 events, event_type regex, UUID dedup, clock check),
  INSERT OR IGNORE for idempotency, and migration 004_analytics.sql
- Client (solitaire_data): AnalyticsClient with in-memory Mutex buffer,
  UUID session_id per launch, async flush via background task
- Engine: AnalyticsPlugin records game_won, game_forfeit, game_start,
  achievement_unlocked; flushes immediately on game-end, every 60 s otherwise
- Settings UI: Privacy section with ON/OFF toggle, hidden in local-only mode
- Default: analytics_enabled = false (explicit opt-in required)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 20:06:34 -07:00
Gitea CI ea17f94b6c chore(deploy): bump image to 09fcd209 [skip ci] 2026-05-14 02:43:38 +00:00
funman300 d60dc18add fix(server): add CSP/security headers middleware, gitignore jks.bak*
Content-Security-Policy, X-Content-Type-Options, and X-Frame-Options are
now injected by a single Axum middleware on the web router subtree, so
all HTML pages get consistent headers without touching each file.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 19:41:50 -07:00
funman300 38eefb22e8 fix(server): XSS, missing score submission, leaderboard never updated, no LIMIT
- leaderboard.html, replays.html: escape user-supplied display_name and
  username before inserting into innerHTML to prevent stored XSS
- game.js: call POST /api/replays on win so browser-game completions are
  recorded; scores were never submitted before this fix
- replays.rs: after replay insert, upsert leaderboard best_score /
  best_time_secs for opted-in users when the new score beats their current
  best (classic mode only); scores were never updated before this fix
- leaderboard.rs: add LIMIT 100 to GET /api/leaderboard to prevent
  unbounded query growth

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 19:32:14 -07:00
Gitea CI a579c25d5c chore(deploy): bump image to d5c95f9a [skip ci] 2026-05-14 00:21:16 +00:00
funman300 c40817d845 fix(web): preload card images to prevent white-flash on flip
When a card flipped face-up, the browser fetched the PNG on demand,
showing the cream fallback colour until the image arrived. Preloading
all 52 faces and the back at module load ensures they are cached before
any flip can occur.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 17:17:33 -07:00
Gitea CI c6c03b8bff chore(deploy): bump image to b0478117 [skip ci] 2026-05-14 00:14:00 +00:00
funman300 5b3925a619 feat(web): account page with sign in / sign up tabs
- Add account.html: tabbed form for login and registration, signed-in
  state with sign-out, links to leaderboard and replays
- Wire /account route in build_router_inner
- Add Account card to landing page
- Link leaderboard login prompt to /account for new users

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 17:09:57 -07:00
Gitea CI 8485b3d1e0 chore(deploy): bump image to e6c67d03 [skip ci] 2026-05-14 00:09:08 +00:00
funman300 8325bf6cf7 chore: rename app from Solitaire Quest to Ferrous Solitaire
Replace all display-name occurrences across web pages, Rust source,
docs, and Cargo metadata. Update localStorage token key from sq_token
to fs_token. Tagline "Klondike Solitaire" retained as genre descriptor.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 17:04:45 -07:00
Gitea CI ea58f5dd64 chore(deploy): bump image to 4315c0ae [skip ci] 2026-05-13 23:54:33 +00:00
funman300 c518255a2d feat(web): leaderboard and replays pages with nav from landing
- Add leaderboard.html: JWT login form + localStorage token + table
- Add replays.html: public listing of recent replays, row click to viewer
- Wire /leaderboard and /replays routes in build_router_inner
- Fix home.html Recent Replays link from /api/replays/recent to /replays

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 16:50:54 -07:00
Gitea CI f5da9398f2 chore(deploy): bump image to 31d0a1b6 [skip ci] 2026-05-13 23:43:30 +00:00
funman300 b82573e7b1 feat(web): add home arrow link to game page header
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 16:38:58 -07:00
Gitea CI 40818f5bd2 chore(deploy): bump image to 56dbc3ff [skip ci] 2026-05-13 23:37:19 +00:00
funman300 228ebbad8a fix(ci): rebase before kustomization push to handle concurrent runs
Two runs for the same SHA racing to push the kustomization update
caused the second to fail with "failed to push some refs".

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 16:36:42 -07:00
Gitea CI 2b33feafc9 chore(deploy): bump image to 3e98872f [skip ci] 2026-05-13 23:33:23 +00:00
funman300 f8c8c9158e ci: add Docker BuildKit registry cache to speed up Rust builds
Caches compiled dependency layers in the Gitea registry under
:buildcache. Subsequent builds that only touch solitaire_server/src/
skip recompiling the full workspace dependency tree.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 16:28:10 -07:00
Gitea CI 9cc0837088 chore(deploy): bump image to 98f9933e [skip ci] 2026-05-13 23:28:10 +00:00
funman300 b47462bd27 fix(web): apply Terminal palette and UX fixes to game page
Aligns /play with the landing page and app color scheme — same
bg, panel, accent, and felt tokens from ui_theme.rs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 16:26:51 -07:00
Gitea CI 08d22c822a chore(deploy): bump image to a6030f4b [skip ci] 2026-05-13 23:24:43 +00:00
funman300 feb581005c fix(web): align replay and landing page to Terminal (base16-eighties) palette
Replay viewer was using the old midnight-purple palette. Both pages now
use the exact color tokens from ui_theme.rs — matching the desktop and
Android app exactly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 16:23:16 -07:00
funman300 00f2d890f1 feat(web): add landing page at / with links to play, leaderboard, replays
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 16:21:38 -07:00
Gitea CI 9533a7d420 chore(deploy): bump image to 022a749f [skip ci] 2026-05-13 22:45:42 +00:00
funman300 5ec5ac1a19 fix(server): create SQLite database file if missing on first start
SqlitePool::connect defaults create_if_missing=false in SQLx 0.8, causing
SQLITE_CANTOPEN (error 14) when the PVC is empty on first deploy.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 15:44:22 -07:00
Gitea CI 86aea206b8 chore(deploy): bump image to 0c673e3b [skip ci] 2026-05-13 22:32:46 +00:00
funman300 1bd1c0f927 fix(docker): add libsqlite3-0 to runtime image to fix SQLite CANTOPEN error
The server binary dynamically links against libsqlite3.so.0, which is not
present in debian:bookworm-slim by default, causing SQLite error code 14
at startup when connecting to the database.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 15:32:09 -07:00
Gitea CI 7be7f4395c chore(deploy): bump image to 597aba20 [skip ci] 2026-05-13 15:04:01 -07:00
funman300 66c2907c25 fix(docker): rename binary to ./server to avoid collision with solitaire_server/web dir 2026-05-13 15:03:45 -07:00
funman300 c2811fa661 ci: trigger with dockerfile change for debug 2026-05-13 14:46:09 -07:00
funman300 933cc55ea9 fix(docker): copy web/ to builder stage for include_str! macros 2026-05-13 14:18:05 -07:00
funman300 58faae1911 fix(docker): stub all workspace crates for cargo fetch in CI 2026-05-13 14:15:24 -07:00
funman300 96be1b85fb ci: retrigger after fixing runner instance URL 2026-05-13 14:11:54 -07:00
funman300 bbf7709912 ci: retrigger build after enabling Actions 2026-05-13 14:05:23 -07:00
funman300 9983b873f9 feat(ops): add k3s + ArgoCD GitOps pipeline
- Dockerfile: copy web/ and assets/ to runtime stage so ServeDir routes work
- .gitea/workflows/docker-build.yml: build/push image on master push, pin SHA
  tag back into deploy/kustomization.yaml so ArgoCD sees a real manifest change
- deploy/: Kustomize manifests — Namespace, PVC, Deployment (Recreate for
  SQLite), Service, Traefik Ingress at klondike.aleshym.co
- argocd/application.yaml: auto-sync Application watching deploy/ on Gitea

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 13:53:09 -07:00
funman300 079349dc0f fix(web): explicit top/left on .slot and .recycle-label
Without top:0;left:0, Firefox and other non-Chrome engines place
absolute elements at the content edge (padding offset = 20px) before
the JS transform is applied, shifting slots 20px below/right of cards.
Cards already had explicit top:0;left:0; slots now match.

.recycle-label also had top:50%;left:50% which combined with the JS
inline transform would place the ↺ symbol halfway across the board.
Changed to top:0;left:0 so JS transform is the sole position source.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 11:20:56 -07:00
funman300 8f82b9fcb5 fix(web): sticky header, correct bottom-corner suit glyphs, main min-width
- header: position sticky so HUD/controls never scroll off screen
- .card .corner.bottom: remove rotate(180deg) — ♠ rotated looks like ♥,
  causing players to misread suit on the bottom corner
- main: add min-width:0 so flex container doesn't push board off-edge

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 11:06:15 -07:00
funman300 0ebe87a411 fix(web): browser game UX pass — shake feedback, timer, stock count, HUD
- game.js fully rewritten: correct coordinate system (PAD baked into
  PILE_ORIGIN), undo driven by undo_stack_len, flashIllegal shake with
  --card-tx CSS variable, game timer, stock count HUD, URL seed persist,
  foundation suit hints, auto-complete step loop
- game.html: adds hud-timer, hud-stock, win-time elements
- game.css: @keyframes illegal-shake, .slot-hint, overflow-x on main
- solitaire_wasm: adds undo_stack_len to GameSnapshot

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 10:27:05 -07:00
funman300 1e6d153cd0 feat(wasm): playable browser game at /play
Add `SolitaireGame` WASM binding to `solitaire_wasm` exposing draw(),
move_cards(), undo(), auto_complete_step(), and state() — all backed by
the real solitaire_core rules engine.

Add /play route to solitaire_server serving a full vanilla-JS
interactive Klondike game (game.html / game.css / game.js). Features:
drag-and-drop card moves (mouse + touch via PointerEvents), click stock
to draw, double-click card to auto-move to foundation, undo, draw-1/3
toggle, new game, auto-complete animation, win overlay, seed display.
Rebuild solitaire_wasm.js + solitaire_wasm_bg.wasm.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 09:42:56 -07:00
funman300 af5ac68947 feat(core): take-from-foundation house rule
Add `GameState::take_from_foundation` flag (default false). When off,
Foundation→Tableau moves are blocked at the core rule layer. When on,
the top card of a foundation pile may be moved back to a compatible
tableau column (one card at a time).

Wire the matching `Settings::take_from_foundation` field through
`handle_new_game` so the player's preference applies to every new deal.
Four targeted tests cover: blocked-by-default, allowed-when-enabled,
illegal-tableau-placement, and count>1 rejection.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 23:16:54 -07:00
funman300 859b69b3c5 fix(android): A2/A3/A4 — APK build doc, dead refs, modal hit targets
A2: docs/ANDROID.md — remove stale "permanent fix to come" note;
    clarify --lib is the canonical command; root-cause the upstream
    cargo-apk bug. SESSION_HANDOFF.md closes the open item.

A3: Remove dead CARD_PLAN.md references from four source module
    doc comments (theme/importer.rs, theme/plugin.rs, assets/mod.rs,
    assets/svg_loader.rs). Also fix stale "future picker UI" language
    in plugin.rs (picker shipped in Phase 7).

A4: ui_modal.rs spawn_modal_button — add min_height: Val::Px(48.0)
    so every modal action button meets Material's 48 dp touch target
    minimum. Modal button height was 42 px (2×SPACE_3 + TYPE_BODY_LG);
    now clamped to 48 px minimum. Cards at 40 dp on 360 dp phones are
    layout-constrained (7 columns) and cannot be widened.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 22:55:30 -07:00
funman300 24ab25b0b7 feat(android): tap-to-toggle HUD visibility (A1)
On Android, a short tap on the empty game area (not on a card) toggles
the HUD band, info column, and action bar between Visible and Hidden.
Layout recomputes with band_h=0 when hidden so cards fill the full
screen. Any modal open restores the HUD to Visible automatically.

- hud_plugin: HudVisibility resource, HudBand/HudColumn/HudActionBar
  markers, apply_hud_visibility (fires synthetic WindowResized),
  restore_hud_on_modal, and Android-only toggle_hud_on_tap +
  HudTapTracker (15 px slop, skips card taps via DragState.is_idle())
- layout: compute_layout gains hud_visible: bool; passes band_h=0.0
  when hidden; all callers updated
- input_plugin: TouchDragSet (AfterStartDrag / BeforeEndDrag) public
  system-set anchors for cross-plugin ordering
- table_plugin: setup_table + on_window_resized read HudVisibility and
  pass hud_visible to compute_layout
- Desktop behaviour is unchanged (HudVisibility always Visible, tap
  system is #[cfg(target_os = "android")] gated)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 22:46:36 -07:00
funman300 918d83420b docs: update all project docs to reflect Phase 8 + Android work
- CLAUDE.md unified-3.1 → unified-4.0: narrowed error policy, relaxed
  ECS/embed/API rules, added Android pitfalls, modal conventions (§14),
  Android build guide (§15), context injection system (§16), auto-hide
  HUD chrome exception in UI-first rule
- ARCHITECTURE.md: Android → Active platform; add Android to sync table;
  add SafeAreaInsets + HudVisibility to Key Resources; add solitaire_wasm
- CLAUDE_SPEC.md: add solitaire_wasm crate; communication: events → events and resources
- CLAUDE_PROMPT_PACK.md: fix §8 typo; narrow dep rule to core/sync only
- SESSION_HANDOFF.md: add §5b Android UX punch list; resume prompt unified-4.0
- docs/android/PLAYABILITY_TODO.md: add P5 section (UX-1/UX-5b/UX-7/BUG-3)
- docs/SESSION_HANDOFF.md: mark as archived (Phase 2 era)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 22:21:01 -07:00
funman300 a381a42f21 fix(android): UX-1/UX-5b/UX-7/BUG-3 — safe-area modals, glyph, help wrap, modal guard
- UX-1 (safe_area.rs): apply_safe_area_to_modal_scrims pads ModalScrim
  bottom by insets.bottom / scale_factor so Done buttons clear the
  gesture bar; fires on inset change + Added<ModalScrim>
- UX-5b (home_plugin.rs): replace Geometric Shapes (U+25xx, missing
  from FiraMono) with card suits U+2660/2665/2666
- UX-7 (help_plugin.rs): shorten Android ≡ button description to
  "Open menu (Stats, Settings, Profile...)" — fits one line at 360 dp
- BUG-3 (hud_plugin.rs): guard spawn_menu_popover with
  scrims.is_empty() so tapping ≡ while a modal is open is a no-op

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 22:20:07 -07:00
funman300 04f3dab563 fix(android): UX pass — pause stacking, timer, help content, achievement glyphs
BUG-1: pause_plugin — auto_resume_on_overlay system despawns PauseScreen
whenever any other ModalScrim becomes live; fixes Pause modal stacking on
top of Stats / Settings / Help / Achievements / Profile overlays opened
from the HUD menu while paused.

BUG-2: game_plugin — tick_elapsed_time skips the first delta_secs after
AppLifecycle::WillSuspend/Suspended so the Android post-resume frame spike
(equal to the full suspension duration) no longer inflates the in-game timer.

UX-2: help_plugin — Android build gets a touch-specific CONTROL_SECTIONS
(Tap / New Game / HUD buttons); desktop sections (Mouse, Keyboard drag,
Mode Launcher, Overlays) remain on non-Android builds only.

UX-3: achievement_plugin — replace \u{25CB} (○) and \u{2713} (✓) prefixes
with ASCII "- " / "+ "; both Geometric Shapes codepoints are absent from
FiraMono and rendered as the fallback letter "o".

Phase 8 work from previous session (already compiled, not yet committed):
hud_plugin — HUD visual hierarchy (Undo/Pause bright, nav buttons dim);
  menu popover — Help + Game Modes entries added (7 items total).
card_plugin — stock badge drops "·" prefix, shows plain count.
pause_plugin — Draw Mode segmented control (Draw 1 / Draw 3 explicit buttons).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 20:02:39 -07:00
funman300 d204662415 fix(android): close HUD popovers on Escape instead of opening Pause
When the Menu or Modes popover was open, pressing Escape (Android back)
fired the Pause system instead of closing the popover, because both
systems listened to the same key with no coordination.

Fix:
- Add HudPopoverOpen marker to both popover entities on spawn.
- Add close_menu/modes_popover_on_escape systems in HudPlugin that
  despawn the popover + backdrop when Escape is pressed.
- Guard toggle_pause with an open_hud_popovers query: bail if any
  HudPopoverOpen entity exists, preventing Pause from stacking behind
  the closing popover.
- Init ButtonInput<KeyCode> in HudPlugin::build() so the new systems
  work under MinimalPlugins in tests.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 19:10:27 -07:00
funman300 4f0080dfbc fix(android): replace broken HUD glyphs and restore FiraMono font
‖ (U+2016) and ▾ (U+25BE) are absent from FiraMono and rendered as
boxes on device. Replace with || (ASCII) and ↓ (U+2193, Arrows block)
which are confirmed FiraMono-safe alongside the existing ≡ ← →.

Also removes the erroneous Android-only TextFont split introduced in
22303c6: that split accidentally used Bevy's built-in ASCII-only bitmap
font instead of FiraMono on Android, causing ALL non-ASCII HUD glyphs
to render as boxes. Now both platforms use the same FiraMono handle.

Separately, suppress the "Tab = next field" hint in the sync login
modal on Android (no Tab key on mobile).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 18:58:07 -07:00
funman300 46c3bf4bb2 fix(engine): profile achievement count derived from ALL_ACHIEVEMENTS
Hardcoded 18 in the profile summary line diverged from the actual count
of 19. Use ALL_ACHIEVEMENTS.len() so the count stays in sync when new
achievements are added.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 17:54:59 -07:00
funman300 6beb9f68ac fix(engine): help panel scrollable via touch on Android
Register touch_scroll_panel::<HelpScrollable> so the Controls overlay
can be scrolled by swipe on Android. Without it, the Mode Launcher and
Overlays sections (rows 2–19) were unreachable via touch.

Also add 96px bottom padding to HelpScrollable — same fix applied to
settings_plugin — so the last row clears the scroll-container edge.
Register TouchInput message so existing headless tests continue to pass.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 17:49:40 -07:00
funman300 a0081a251c fix(engine): settings sync section scrollable + flaky midnight test
Add 96px bottom padding to SettingsPanelScrollable so the Sync section
is fully reachable by scrolling on Android (was clipped at container edge).

Fix check_system_fires_warning_event_only_once_per_day flakiness: Bevy
0.18 Messages<T> keeps events visible for two frames, so tests running
near UTC midnight saw a stale WarningToastEvent from headless_app()'s
initial update. Clear the buffer with .clear() before each assertion.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 17:11:34 -07:00
funman300 7411468e10 fix(engine): extend touch scroll to achievements and stats panels via generic helper
Extracts touch_scroll_panel<M: Component> into ui_modal.rs and wires it
to SettingsPanelScrollable, AchievementsScrollable, and StatsScrollable
so all three panels respond to finger swipe on Android.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 16:03:20 -07:00
funman300 9af4046ac3 fix(engine): modal action buttons wrap to next row on narrow screens
On high-DPI Android (Pixel 7: 420 DPI → ~411 dp logical width), the
modal card fits at ~363 dp wide. The stats modal's three-button row
("Watch replay" + "Copy share link" + "Done") totals ~455 dp, causing
text to wrap inside each button (2–3 lines per button label).

Added flex_wrap: FlexWrap::Wrap + row_gap: VAL_SPACE_2 to
spawn_modal_actions so buttons that don't fit flow onto a second line
as whole units instead of wrapping text inside them. Affects all modals
uniformly; desktop (wide modal) is unaffected since buttons fit in one
line with room to spare.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 15:55:49 -07:00
funman300 d06af28aef fix(engine): settings panel scrollable via touch on Android
scroll_settings_panel only read MouseWheel, which is generated by desktop
scroll wheels and two-finger OS-level scroll gestures. On Android, a
single-finger swipe generates TouchInput, not MouseWheel, leaving the
settings panel unscrollable on real touchscreen devices.

Added touch_scroll_settings_panel: tracks touch start Y, applies the
vertical delta from each Moved event to ScrollPosition, resets on lift.
Registered TouchInput messages in SettingsPlugin::build so tests that use
MinimalPlugins (which omit InputPlugin) don't fail with "Message not
initialized".

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 15:49:17 -07:00
funman300 27b58a5b71 fix(engine): pause game timer while onboarding modal is visible
tick_elapsed_time already stopped the clock for PausedResource and
HomeScreen, but not for the first-run onboarding modal. A new player
reading the three welcome slides would see their first-game time inflated
by however long they spent on the tutorial. Added OnboardingScreen to the
early-return guard using the same pattern as HomeScreen.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 15:29:33 -07:00
funman300 3b6c8d2aab fix(engine): has_legal_moves treats non-empty stock/waste as always-legal
Drawing from a non-empty stock and recycling a non-empty waste are always
legal moves in standard Klondike (unlimited recycles). The old implementation
only scanned face-up tableau cards and the waste top for valid placements,
returning false for any fresh deal where the initial 7 face-up cards had no
immediate destination — causing a spurious "No more moves" game-over dialog
at Moves: 0. The correct stuck condition is stock=0 AND waste=0 AND no
visible card can be placed.

Updated the "false when stock unplayable" test to assert true instead, since
a non-empty stock means drawing is always legal.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 15:17:55 -07:00
funman300 51fc8f65b1 docs(handoff): mark Android AVD tests done; Phase 8 punch list fully closed
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 14:46:31 -07:00
funman300 65cb41461f docs(handoff): mark best-score auto-post done (303c78a); only AVD tests remain
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 14:44:41 -07:00
funman300 24f5d140df docs(handoff): mark display name done; update HEAD to 03be4fc
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 14:44:04 -07:00
funman300 03be4fcc67 feat(leaderboard): add custom public display name
Adds `leaderboard_display_name: Option<String>` to `Settings` (serde
default = None, backwards-compatible). When set, this name is submitted
to the server on opt-in instead of the player's username, giving players
a separate public identity on the leaderboard.

Engine changes:
- `handle_opt_in_button` prefers `leaderboard_display_name` over username
- Leaderboard panel shows "Public name: X" row with "Set Name" button
- "Set Name" opens a modal with a single text-input field (32-char max)
- Save/Cancel buttons write to SettingsResource and persist to disk

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 14:38:53 -07:00
funman300 9564f54fc0 docs(handoff): mark WASM winning-sequence test complete; update HEAD state
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 14:21:51 -07:00
funman300 b4ada2a07e test(wasm): add full winning-sequence step-through test
Adds `replay_player_completes_full_winning_sequence` to `solitaire_wasm`.
A greedy solver runs over seeds 1–200 to find the first deterministically
winnable DrawOne Classic game, serialises the move list as a Replay JSON,
and feeds it to `ReplayPlayer::from_json`. Every move is stepped with
`step_native`; the test asserts `is_won = true` on the final snapshot.

Regression target: any change to `GameState` move semantics or `ReplayMove`
serialisation that breaks a historically valid replay will fail this test.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 14:21:29 -07:00
funman300 d44cedbea0 docs(handoff): mark password reset complete; update HEAD state
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 14:12:34 -07:00
funman300 75146847f6 feat(server): add --reset-password admin subcommand
Self-hosters can now run:
  ./solitaire_server --reset-password <username>
to update a player's password and invalidate all their refresh tokens
(forcing re-login on every device). Password is read from stdin so it
can be piped from scripts or a password manager without appearing in
shell history.

Implementation:
- reset_password() in auth.rs: validates length, bcrypt-hashes new
  password, updates users.password_hash, deletes all refresh_tokens
  rows for the user.
- main.rs: --reset-password dispatch before HTTP server startup;
  JWT_SECRET not required for this path.
- 4 integration tests covering: login works after reset, old password
  rejected, refresh tokens invalidated, unknown user → NotFound,
  short password → BadRequest.
- README_SERVER.md: admin password-reset section with examples.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 14:10:13 -07:00
218 changed files with 6921 additions and 688 deletions
+118
View File
@@ -0,0 +1,118 @@
name: Android Build
on:
push:
branches: [master]
# Rebuild whenever app/engine/asset code changes.
# Skip server-only, deploy, and doc changes.
paths-ignore:
- 'deploy/**'
- 'argocd/**'
- 'solitaire_server/**'
- '**.md'
env:
ANDROID_SDK_ROOT: /opt/android-sdk
NDK_VERSION: "25.2.9519653"
BUILD_TOOLS_VERSION: "34.0.0"
jobs:
build-apk:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set short SHA
id: meta
run: echo "sha=${GITHUB_SHA::8}" >> "$GITHUB_OUTPUT"
# ── Android SDK + NDK ──────────────────────────────────────────────
# Cache the entire SDK root so subsequent runs skip the ~2 GB download.
- name: Cache Android SDK
uses: actions/cache@v4
id: sdk-cache
with:
path: ${{ env.ANDROID_SDK_ROOT }}
key: android-sdk-ndk${{ env.NDK_VERSION }}-bt${{ env.BUILD_TOOLS_VERSION }}
- name: Install system dependencies
run: sudo apt-get install -y openjdk-17-jdk-headless unzip
- name: Install Android SDK + NDK
if: steps.sdk-cache.outputs.cache-hit != 'true'
run: |
mkdir -p "$ANDROID_SDK_ROOT/cmdline-tools"
curl -sL \
"https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip" \
-o /tmp/cmdtools.zip
unzip -q /tmp/cmdtools.zip -d /tmp/cmdtools
mv /tmp/cmdtools/cmdline-tools "$ANDROID_SDK_ROOT/cmdline-tools/latest"
# Accept all SDK licences non-interactively.
yes | "$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager" --licenses \
> /dev/null 2>&1 || true
"$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager" \
"build-tools;$BUILD_TOOLS_VERSION" \
"platforms;android-34" \
"ndk;$NDK_VERSION"
- name: Export Android environment
run: |
echo "ANDROID_HOME=$ANDROID_SDK_ROOT" >> "$GITHUB_ENV"
echo "ANDROID_NDK_HOME=$ANDROID_SDK_ROOT/ndk/$NDK_VERSION" >> "$GITHUB_ENV"
# ── Rust toolchain ─────────────────────────────────────────────────
- name: Install Rust stable
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \
| sh -s -- -y --default-toolchain stable --no-modify-path
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
- name: Add Android cross-compilation targets
run: |
rustup target add \
aarch64-linux-android \
armv7-linux-androideabi \
x86_64-linux-android
# ── Cargo caches ───────────────────────────────────────────────────
- name: Cache Cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
key: cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: cargo-registry-
- name: Cache cargo-apk binary
uses: actions/cache@v4
id: apk-tool-cache
with:
path: ~/.cargo/bin/cargo-apk
key: cargo-apk-${{ runner.os }}-stable
- name: Cache build artifacts
uses: actions/cache@v4
with:
path: target
key: android-target-${{ hashFiles('**/Cargo.lock') }}-${{ github.sha }}
restore-keys: android-target-${{ hashFiles('**/Cargo.lock') }}-
# ── Build ──────────────────────────────────────────────────────────
- name: Install cargo-apk
if: steps.apk-tool-cache.outputs.cache-hit != 'true'
run: cargo install cargo-apk --locked
- name: Build debug APK
run: cargo apk build --package solitaire_app --lib
# ── Artifact ───────────────────────────────────────────────────────
- name: Upload APK
uses: actions/upload-artifact@v4
with:
name: solitaire-quest-debug-${{ steps.meta.outputs.sha }}
path: target/debug/apk/solitaire-quest.apk
retention-days: 30
+168
View File
@@ -0,0 +1,168 @@
name: Android Release
on:
push:
tags:
- 'v*.*.*'
env:
ANDROID_SDK_ROOT: /opt/android-sdk
NDK_VERSION: "25.2.9519653"
BUILD_TOOLS_VERSION: "34.0.0"
GITEA_API: https://git.aleshym.co/api/v1
REPO: funman300/Rusty_Solitare
jobs:
build-release-apk:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Extract version from tag
id: meta
run: echo "tag=${GITHUB_REF_NAME}" >> "$GITHUB_OUTPUT"
# ── Android SDK + NDK ──────────────────────────────────────────────
# Shared cache key with the debug workflow so a warm debug run
# saves the ~2 GB SDK download for the release run too.
- name: Cache Android SDK
uses: actions/cache@v4
id: sdk-cache
with:
path: ${{ env.ANDROID_SDK_ROOT }}
key: android-sdk-ndk${{ env.NDK_VERSION }}-bt${{ env.BUILD_TOOLS_VERSION }}
# Java and jq are always needed (apksigner requires Java even on cache hits).
- name: Install system dependencies
run: sudo apt-get install -y openjdk-17-jdk-headless unzip jq
- name: Install Android SDK + NDK
if: steps.sdk-cache.outputs.cache-hit != 'true'
run: |
mkdir -p "$ANDROID_SDK_ROOT/cmdline-tools"
curl -sL \
"https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip" \
-o /tmp/cmdtools.zip
unzip -q /tmp/cmdtools.zip -d /tmp/cmdtools
mv /tmp/cmdtools/cmdline-tools "$ANDROID_SDK_ROOT/cmdline-tools/latest"
yes | "$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager" --licenses \
> /dev/null 2>&1 || true
"$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager" \
"build-tools;$BUILD_TOOLS_VERSION" \
"platforms;android-34" \
"ndk;$NDK_VERSION"
- name: Export Android environment
run: |
echo "ANDROID_HOME=$ANDROID_SDK_ROOT" >> "$GITHUB_ENV"
echo "ANDROID_NDK_HOME=$ANDROID_SDK_ROOT/ndk/$NDK_VERSION" >> "$GITHUB_ENV"
# ── Rust toolchain ─────────────────────────────────────────────────
- name: Install Rust stable
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \
| sh -s -- -y --default-toolchain stable --no-modify-path
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
- name: Add Android cross-compilation targets
run: |
rustup target add \
aarch64-linux-android \
armv7-linux-androideabi \
x86_64-linux-android
# ── Cargo caches ───────────────────────────────────────────────────
- name: Cache Cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
key: cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: cargo-registry-
- name: Cache cargo-apk binary
uses: actions/cache@v4
id: apk-tool-cache
with:
path: ~/.cargo/bin/cargo-apk
key: cargo-apk-${{ runner.os }}-stable
- name: Cache build artifacts
uses: actions/cache@v4
with:
path: target
key: android-release-target-${{ hashFiles('**/Cargo.lock') }}-${{ github.sha }}
restore-keys: android-release-target-${{ hashFiles('**/Cargo.lock') }}-
# ── Build ──────────────────────────────────────────────────────────
- name: Install cargo-apk
if: steps.apk-tool-cache.outputs.cache-hit != 'true'
run: cargo install cargo-apk --locked
- name: Build release APK
run: cargo apk build --release --package solitaire_app --lib
# ── Sign ───────────────────────────────────────────────────────────
- name: Decode keystore
run: echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 -d > /tmp/solitaire-release.jks
- name: Align and sign APK
run: |
TAG="${{ steps.meta.outputs.tag }}"
UNSIGNED="target/release/apk/solitaire-quest.apk"
ALIGNED="/tmp/solitaire-quest-aligned.apk"
SIGNED="ferrous-solitaire-${TAG}.apk"
"$ANDROID_SDK_ROOT/build-tools/$BUILD_TOOLS_VERSION/zipalign" -v 4 \
"$UNSIGNED" "$ALIGNED"
"$ANDROID_SDK_ROOT/build-tools/$BUILD_TOOLS_VERSION/apksigner" sign \
--ks /tmp/solitaire-release.jks \
--ks-pass "pass:${{ secrets.KEYSTORE_PASS }}" \
--ks-key-alias "${{ secrets.KEY_ALIAS }}" \
--key-pass "pass:${{ secrets.KEY_PASS }}" \
--out "$SIGNED" \
"$ALIGNED"
- name: Verify APK signature
run: |
TAG="${{ steps.meta.outputs.tag }}"
"$ANDROID_SDK_ROOT/build-tools/$BUILD_TOOLS_VERSION/apksigner" verify \
--verbose "ferrous-solitaire-${TAG}.apk"
# ── Publish ────────────────────────────────────────────────────────
- name: Create Gitea release
id: release
run: |
TAG="${{ steps.meta.outputs.tag }}"
# Try to create; fall back to fetching the existing release on 409.
RESPONSE=$(curl -s -o /tmp/release.json -w "%{http_code}" \
-X POST "$GITEA_API/repos/$REPO/releases" \
-H "Authorization: token ${{ secrets.CI_TOKEN }}" \
-H "Content-Type: application/json" \
-d "{\"tag_name\":\"$TAG\",\"name\":\"$TAG\",\"draft\":false,\"prerelease\":false}")
if [ "$RESPONSE" = "409" ]; then
curl -sf "$GITEA_API/repos/$REPO/releases/tags/$TAG" \
-H "Authorization: token ${{ secrets.CI_TOKEN }}" \
> /tmp/release.json
elif [ "$RESPONSE" != "201" ]; then
echo "Release creation failed with HTTP $RESPONSE"
cat /tmp/release.json
exit 1
fi
RELEASE_ID=$(jq -r '.id' /tmp/release.json)
echo "release_id=$RELEASE_ID" >> "$GITHUB_OUTPUT"
- name: Upload signed APK
run: |
TAG="${{ steps.meta.outputs.tag }}"
APK="ferrous-solitaire-${TAG}.apk"
curl -sf -X POST \
"$GITEA_API/repos/$REPO/releases/${{ steps.release.outputs.release_id }}/assets?name=$APK" \
-H "Authorization: token ${{ secrets.CI_TOKEN }}" \
-H "Content-Type: application/octet-stream" \
--data-binary @"$APK"
+73
View File
@@ -0,0 +1,73 @@
name: Build and Deploy
on:
push:
branches: [master]
# Only run when server code changes, not when CI itself updates deploy/.
paths-ignore:
- 'deploy/**'
- 'argocd/**'
- '**.md'
env:
REGISTRY: git.aleshym.co
IMAGE: git.aleshym.co/funman300/solitaire-server
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# Need full history so we can push the tag-update commit back.
fetch-depth: 0
token: ${{ secrets.CI_TOKEN }}
- name: Set image tag
id: meta
run: echo "sha=${GITHUB_SHA::8}" >> "$GITHUB_OUTPUT"
- name: Log in to Gitea registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ gitea.actor }}
password: ${{ secrets.CI_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver-opts: network=host
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: solitaire_server/Dockerfile
push: true
tags: |
${{ env.IMAGE }}:${{ steps.meta.outputs.sha }}
${{ env.IMAGE }}:latest
cache-from: type=registry,ref=${{ env.IMAGE }}:buildcache
cache-to: type=registry,ref=${{ env.IMAGE }}:buildcache,mode=max
- name: Install kustomize
run: |
curl -sL "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash
sudo mv kustomize /usr/local/bin/kustomize
- name: Pin image tag in deploy manifests
run: |
cd deploy
kustomize edit set image solitaire-server=${{ env.IMAGE }}:${{ steps.meta.outputs.sha }}
- name: Commit and push updated kustomization
run: |
git config user.email "ci@gitea.local"
git config user.name "Gitea CI"
git add deploy/kustomization.yaml
git commit -m "chore(deploy): bump image to ${{ steps.meta.outputs.sha }} [skip ci]" || true
git pull --rebase origin master
git push
+6
View File
@@ -14,4 +14,10 @@ data/
# Android signing keystores — never commit # Android signing keystores — never commit
*.jks *.jks
*.jks.bak *.jks.bak
*.jks.bak*
*.keystore *.keystore
# Kubernetes secrets — apply manually, never commit
deploy/matomo-secret.yaml
deploy/*-secret.yaml
deploy/*-auth-secret.yaml
@@ -0,0 +1,12 @@
{
"db_name": "SQLite",
"query": "UPDATE leaderboard\n SET best_score = ?,\n best_time_secs = ?,\n recorded_at = ?\n WHERE user_id = ?\n AND (\n best_score IS NULL\n OR ? > best_score\n OR (? = best_score AND (best_time_secs IS NULL OR ? < best_time_secs))\n )",
"describe": {
"columns": [],
"parameters": {
"Right": 7
},
"nullable": []
},
"hash": "0e199cafab7e71b0c7f28ede85a622e38649d2fe5a73a5c715f2319f5450f729"
}
@@ -1,6 +1,6 @@
{ {
"db_name": "SQLite", "db_name": "SQLite",
"query": "SELECT l.display_name, l.best_score, l.best_time_secs, l.recorded_at\n FROM leaderboard l\n JOIN users u ON u.id = l.user_id\n WHERE u.leaderboard_opt_in = 1\n ORDER BY\n CASE WHEN l.best_score IS NULL THEN 1 ELSE 0 END ASC,\n l.best_score DESC,\n CASE WHEN l.best_time_secs IS NULL THEN 1 ELSE 0 END ASC,\n l.best_time_secs ASC", "query": "SELECT l.display_name, l.best_score, l.best_time_secs, l.recorded_at\n FROM leaderboard l\n JOIN users u ON u.id = l.user_id\n WHERE u.leaderboard_opt_in = 1\n ORDER BY\n CASE WHEN l.best_score IS NULL THEN 1 ELSE 0 END ASC,\n l.best_score DESC,\n CASE WHEN l.best_time_secs IS NULL THEN 1 ELSE 0 END ASC,\n l.best_time_secs ASC\n LIMIT 100",
"describe": { "describe": {
"columns": [ "columns": [
{ {
@@ -34,5 +34,5 @@
false false
] ]
}, },
"hash": "57c93a6acd7eea44d00412e62f0d3fed7ffbe4cd759353d29f38a8eb37f69112" "hash": "2b814989a6632ca930ae1e895f97a7fc3389c91d1d2abf6900a21fb0d6e94ef3"
} }
@@ -0,0 +1,12 @@
{
"db_name": "SQLite",
"query": "DELETE FROM refresh_tokens WHERE user_id = ?",
"describe": {
"columns": [],
"parameters": {
"Right": 1
},
"nullable": []
},
"hash": "40db0910531d4418d4d58d31f0f8ea3894248406cc016020a6e211ed66da91c0"
}
@@ -0,0 +1,12 @@
{
"db_name": "SQLite",
"query": "UPDATE users SET password_hash = ? WHERE id = ?",
"describe": {
"columns": [],
"parameters": {
"Right": 2
},
"nullable": []
},
"hash": "e4eb622073cbdf868ec1568a6bdb132e962480b0530d542102c05aa9e901463b"
}
@@ -0,0 +1,12 @@
{
"db_name": "SQLite",
"query": "INSERT OR IGNORE INTO analytics_events\n (id, user_id, session_id, event_type, payload, client_time, received_at)\n VALUES (?, ?, ?, ?, ?, ?, ?)",
"describe": {
"columns": [],
"parameters": {
"Right": 7
},
"nullable": []
},
"hash": "f23630e78ae88e72d7930184f7cd8fc67e71f3930609f1cf14061d35d6de8ec3"
}
+10 -3
View File
@@ -1,4 +1,4 @@
# Solitaire Quest — Architecture Document # Ferrous Solitaire — Architecture Document
> **Version:** 1.3 > **Version:** 1.3
> **Language:** Rust (Edition 2024) > **Language:** Rust (Edition 2024)
@@ -34,7 +34,7 @@
## 1. Project Overview ## 1. Project Overview
Solitaire Quest is a cross-platform Klondike Solitaire game written in Rust, targeting macOS, Windows, and Linux desktops. It features a full progression system with XP, levels, achievements, daily challenges, and an optional self-hosted sync server so statistics and progress are available across all of a player's devices. Ferrous Solitaire is a cross-platform Klondike Solitaire game written in Rust, targeting macOS, Windows, and Linux desktops. It features a full progression system with XP, levels, achievements, daily challenges, and an optional self-hosted sync server so statistics and progress are available across all of a player's devices.
### Sync Backend by Platform ### Sync Backend by Platform
@@ -43,6 +43,7 @@ Solitaire Quest is a cross-platform Klondike Solitaire game written in Rust, tar
| macOS | Self-hosted server | Full feature set | | macOS | Self-hosted server | Full feature set |
| Windows | Self-hosted server | Full feature set | | Windows | Self-hosted server | Full feature set |
| Linux | Self-hosted server | Full feature set | | Linux | Self-hosted server | Full feature set |
| Android | Self-hosted server | Touch input; safe-area insets via JNI; `cargo-apk` build |
### Design Principles ### Design Principles
@@ -322,6 +323,12 @@ struct FontResource(Handle<Font>);
struct BackgroundImageSet { struct BackgroundImageSet {
handles: Vec<Handle<Image>>, // indices 04 match selected_background setting handles: Vec<Handle<Image>>, // indices 04 match selected_background setting
} }
// OS-reserved edge insets (physical px); zero on desktop
struct SafeAreaInsets { top: f32, bottom: f32, left: f32, right: f32 }
// Whether the HUD band is visible (auto-hide chrome feature)
enum HudVisibility { Visible, Hidden }
``` ```
### Key Bevy Events ### Key Bevy Events
@@ -900,7 +907,7 @@ All sound effect WAV files are embedded at compile time via `include_bytes!()` i
| macOS | Primary | Self-hosted server | x86_64 + Apple Silicon (universal binary via `cargo-lipo`) | | macOS | Primary | Self-hosted server | x86_64 + Apple Silicon (universal binary via `cargo-lipo`) |
| Windows | Primary | Self-hosted server | x86_64, MSVC toolchain | | Windows | Primary | Self-hosted server | x86_64, MSVC toolchain |
| Linux | Primary | Self-hosted server | x86_64, tested on Ubuntu 22.04+ and Fedora 39+ | | Linux | Primary | Self-hosted server | x86_64, tested on Ubuntu 22.04+ and Fedora 39+ |
| Android | Stretch | Self-hosted server | `cargo-mobile2`, touch input | | Android | Active | Self-hosted server | `cargo-apk`; touch + long-press + double-tap; safe-area JNI; portrait layout |
| iOS | Stretch | Self-hosted server | `cargo-mobile2`, touch input | | iOS | Stretch | Self-hosted server | `cargo-mobile2`, touch input |
Minimum Bevy window size enforced: 800×600. Desktop windows are freely resizable; layout recomputes on `WindowResized`. Minimum Bevy window size enforced: 800×600. Desktop windows are freely resizable; layout recomputes on `WindowResized`.
+22 -1
View File
@@ -1,11 +1,32 @@
# Changelog # Changelog
All notable changes to Solitaire Quest are documented here. The format is All notable changes to Ferrous Solitaire are documented here. The format is
based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and this based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and this
project follows [Semantic Versioning](https://semver.org/). project follows [Semantic Versioning](https://semver.org/).
## [Unreleased] ## [Unreleased]
### Fixed
- **BUG-3: Multi-modal stacking** (`hud_plugin.rs`). `handle_menu_button`
now checks `scrims.is_empty()` — a `Query<(), With<ModalScrim>>` guard —
before calling `spawn_menu_popover`. Tapping ≡ while any modal (Stats,
Settings, Profile, Help) is open is now a no-op. Previously Stats + Profile
could be open simultaneously.
- **UX-7: Help text single-line overflow** (`help_plugin.rs`). The HUD menu
button description "Menu: Stats, Settings, Profile, Achievements" wrapped to
two lines on Android. Shortened to "Open menu (Stats, Settings, Profile...)"
which fits on one line. Verified on device.
- **UX-5b: Home mode glyph corruption** (`home_plugin.rs`). Mode selector icons
were using Geometric Shapes block (U+25xx) absent from the bundled FiraMono
font — rendered as missing-glyph rectangles on Android. Replaced with card
suits (U+26602666) which FiraMono covers: ♦ Daily, ♥ Zen, ♠ Challenge.
- **UX-1: Modal Done button in gesture zone** (`safe_area.rs`). New
`apply_safe_area_to_modal_scrims` Bevy system pads every `ModalScrim` bottom
by `SafeAreaInsets.bottom / scale_factor`. Modal cards are now centred over
the safe area, not the full physical screen. The Settings / Help / Stats Done
buttons are reachable on gesture-nav Android devices. Verified on device.
--- ---
## [0.23.0] — 2026-05-12 ## [0.23.0] — 2026-05-12
+148 -26
View File
@@ -1,6 +1,6 @@
# CLAUDE.md # CLAUDE.md
version: unified-3.0 version: unified-4.0
--- ---
@@ -29,8 +29,9 @@ solitaire_sync/ # Shared API + merge logic
solitaire_data/ # Persistence + sync client solitaire_data/ # Persistence + sync client
solitaire_engine/ # Bevy ECS + UI + gameplay orchestration solitaire_engine/ # Bevy ECS + UI + gameplay orchestration
solitaire_server/ # Axum backend (optional sync layer) solitaire_server/ # Axum backend (optional sync layer)
solitaire_wasm/ # WASM bindings for browser-side replay player
solitaire_app/ # Entry binary solitaire_app/ # Entry binary
assets/ # Runtime assets (except audio) assets/ # Runtime assets (except audio + default theme)
``` ```
--- ---
@@ -72,12 +73,16 @@ These override all other instructions.
* NO `unwrap()` * NO `unwrap()`
* NO `panic!()` in runtime/game logic * NO `panic!()` in runtime/game logic
* All state transitions: * Core game state mutations MUST return:
```rust id="err_model" ```rust id="err_model"
Result<T, MoveError> Result<T, MoveError>
``` ```
* Engine / UI state changes follow ECS patterns (Resources, Events) —
they do not return `MoveError`
* Use `thiserror`-derived types for any new error enums outside `solitaire_core`
--- ---
## 2.4 Threading Rules ## 2.4 Threading Rules
@@ -126,10 +131,15 @@ trait SyncProvider
## 3.1 ECS Design ## 3.1 ECS Design
* systems = single responsibility * systems = single responsibility
* communication = Events only * cross-system communication = Events (fire-and-forget triggers)
* shared state = Resources only * persistent shared state = Resources (polled every frame or on change)
* per-entity state = Components only * per-entity state = Components only
Events and Resources are both valid communication paths — use Events when
the receiver needs to react once; use Resources when the receiver polls
or when multiple systems read the same value (e.g. `SafeAreaInsets`,
`HudVisibility`, `LayoutResource`).
--- ---
## 3.2 Game State Authority ## 3.2 Game State Authority
@@ -149,11 +159,22 @@ Every player action MUST:
Keyboard shortcuts are: Keyboard shortcuts are:
→ optional accelerators only → optional accelerators only
**Exception — UI chrome gestures:**
Tap-to-toggle visibility of UI chrome (e.g. auto-hiding HUD band) is
permitted without a visible button. The gesture MUST:
* affect only chrome visibility, never game state
* restore chrome automatically when any modal opens
* be purely additive (game remains fully playable with chrome always visible)
--- ---
## 3.4 Layout System ## 3.4 Layout System
* recompute on `WindowResized` * recompute on `WindowResized`
* recompute on `SafeAreaInsets` changed
* recompute on `HudVisibility` changed
* `compute_layout` MUST accept `hud_visible: bool`; pass `HUD_BAND_HEIGHT`
when `true`, `0.0` when `false`
* no fixed resolution assumptions * no fixed resolution assumptions
--- ---
@@ -178,11 +199,18 @@ Includes:
## 4.2 Embedded Assets ## 4.2 Embedded Assets
Only audio: Embed via `include_bytes!()` only when ALL of the following are true:
```text id="audio_rule" * the asset is small (< 500 KB uncompressed)
include_bytes!() * it changes rarely (not user-customisable)
``` * a missing file would be a hard crash, not a graceful degradation
Currently embedded:
* **Audio** — all `.wav` files in `audio_plugin.rs`
* **Default card theme** — shipped via `embedded://` scheme in `ThemePlugin`
Do NOT embed card face PNGs, background images, or user fonts —
these are loaded via `AssetServer` so art can be swapped without recompile.
--- ---
@@ -210,7 +238,9 @@ Must degrade gracefully under `MinimalPlugins`.
## 5.2 Public API Rules ## 5.2 Public API Rules
* prefer `Into<T>` over concrete types * prefer `Into<T>` over concrete types
* all public items require doc comments * publicly exported functions, traits, and non-trivial types require doc comments
* simple marker components, newtype wrappers, and internal `pub` items
used only within the same crate are exempt from doc comment requirements
--- ---
@@ -276,11 +306,13 @@ NEVER commit otherwise
Claude must request confirmation before: Claude must request confirmation before:
* adding dependencies * adding dependencies to `solitaire_core` or `solitaire_sync`
* modifying `solitaire_sync` (engine/server crates may add deps without confirmation)
* changing DB schema * modifying `solitaire_sync` types or the `SyncProvider` trait
* changing DB schema (migrations are append-only)
* introducing `unsafe` * introducing `unsafe`
* changing merge strategy * changing the merge strategy in `solitaire_sync::merge`
* changing the `SyncPayload` wire format (breaking change for existing servers)
--- ---
@@ -304,10 +336,29 @@ Core is always the source of truth.
Must always be handled explicitly: Must always be handled explicitly:
**All platforms**
* Bevy `Time` uses `f32` * Bevy `Time` uses `f32`
* `sqlx::migrate!()` path is crate-relative * `sqlx::migrate!()` path is crate-relative
* `dirs::data_dir()` may return `None` * `dirs::data_dir()` may return `None`
* Linux may lack keyring backend * Linux may lack keyring backend — handle `keyring::Error` gracefully
**Android (active target — not stretch)**
* Safe-area insets arrive in frames 13 via JNI polling, not at startup;
UI that depends on them must handle the zero-inset initial state
* Physical pixels ≠ logical pixels: `SafeAreaInsets` values are physical
(from `WindowInsets` API); divide by `window.scale_factor()` before
passing to Bevy `Val::Px`
* `adb shell input tap` uses physical pixel coordinates
* FiraMono (bundled font) covers: ASCII, card suits U+26602666,
Arrows U+219021FF. It does NOT cover Geometric Shapes (U+25xx) —
those render as missing-glyph rectangles on Android
* The gesture/navigation bar at the bottom (≈132px physical on common
devices) is inside the Bevy viewport; use `SafeAreaInsets.bottom` to
avoid placing interactive elements in that zone
* `HUD_BAND_HEIGHT` is 128px on Android (two-row wrap) vs 64px on desktop;
layout constants are `#[cfg(target_os = "android")]` gated
* JNI calls must use `attach_current_thread_permanently` — not
`attach_current_thread` — to avoid detach-on-drop panics
--- ---
@@ -318,6 +369,12 @@ Must always be handled explicitly:
* blocking async calls in ECS * blocking async calls in ECS
* insecure credential storage * insecure credential storage
* bypassing core logic layer * bypassing core logic layer
* hardcoded pixel coordinates in layout — always derive from `compute_layout`
* Unicode Geometric Shapes block (U+25xx) in UI text — not in FiraMono
* spawning a second `ModalScrim` while one already exists without first
dismissing the existing one (use `scrims.is_empty()` guard)
* reading `SafeAreaInsets` physical values directly into `Val::Px` without
dividing by `window.scale_factor()`
--- ---
@@ -345,9 +402,74 @@ If unclear:
| Both combined | full system understanding | | Both combined | full system understanding |
--- ---
# 14. Context Injection System (AUTOMATIC SCOPE FILTER) # 14. Modal System Conventions
## 14.1 Purpose All full-screen overlay panels MUST use the `spawn_modal` / `ModalScrim` pattern
from `solitaire_engine::ui_modal`.
## 14.1 Spawn pattern
```rust
let scrim = spawn_modal(commands, MyScreenMarker, Z_MODAL_PANEL, |card| {
spawn_modal_header(card, "Title", font_res);
// ... body nodes ...
spawn_modal_actions(card, |actions| {
spawn_modal_button(actions, MyCloseButton, "Done", None,
ButtonVariant::Primary, font_res);
});
});
// Optional: allow clicking the scrim outside the card to dismiss
commands.entity(scrim).insert(ScrimDismissible);
```
## 14.2 Guard rule
Before spawning a new modal, check `scrims: Query<(), With<ModalScrim>>`
and return early if `!scrims.is_empty()` — unless the new modal is
explicitly replacing the current one (despawn first, then spawn).
## 14.3 Safe area
Every `ModalScrim` automatically receives `padding.bottom` equal to the
logical gesture-bar height via `apply_safe_area_to_modal_scrims` in
`SafeAreaInsetsPlugin`. Do not manually add bottom padding to scrim nodes.
## 14.4 Z-ordering
Use `Z_MODAL_PANEL` from `ui_theme` for all modal scrims. Do not use
raw `z_index` values — they drift and cause ordering bugs.
---
# 15. Android Build & Verification
## 15.1 Build command
```bash
cargo apk build --package solitaire_app --lib
adb install -r target/debug/apk/solitaire-quest.apk
```
## 15.2 Coordinate system reminder
Device physical: 1080×2400. Bevy logical: 900×2000. Scale factor: 1.20.
`adb shell input tap X Y` takes PHYSICAL coordinates.
To convert from what you see on screen (logical): multiply by 1.20.
## 15.3 Android-specific test checklist
Before shipping any Android build:
- [ ] Safe area insets arrive and shift HUD correctly (check after 3s)
- [ ] All modal Done buttons are above the gesture bar
- [ ] No Geometric Shapes glyphs in UI text
- [ ] HUD band does not overlap the top status bar
- [ ] Touch drag-and-drop works on all pile types
---
# 16. Context Injection System (AUTOMATIC SCOPE FILTER)
## 16.1 Purpose
Before generating any response, Claude MUST construct a **minimal relevant context set**. Before generating any response, Claude MUST construct a **minimal relevant context set**.
@@ -360,7 +482,7 @@ This prevents:
--- ---
## 14.2 Input Classification Step (MANDATORY) ## 16.2 Input Classification Step (MANDATORY)
Every request MUST be classified into exactly one task type: Every request MUST be classified into exactly one task type:
@@ -381,13 +503,13 @@ If uncertain → ask clarification.
--- ---
## 14.3 Context Selection Engine ## 16.3 Context Selection Engine
After classification, Claude MUST include ONLY the relevant sections below. After classification, Claude MUST include ONLY the relevant sections below.
--- ---
## 14.4 Context Map (CORE RULESET) ## 16.4 Context Map (CORE RULESET)
### feature ### feature
@@ -495,7 +617,7 @@ Include:
--- ---
## 14.5 Context Compression Rules ## 16.5 Context Compression Rules
Claude MUST obey: Claude MUST obey:
@@ -506,7 +628,7 @@ Claude MUST obey:
--- ---
## 14.6 Context Priority Order ## 16.6 Context Priority Order
When space is limited: When space is limited:
@@ -517,7 +639,7 @@ When space is limited:
--- ---
## 14.7 “No Context Pollution” Rule ## 16.7 “No Context Pollution” Rule
Claude must NOT include: Claude must NOT include:
@@ -529,7 +651,7 @@ Claude must NOT include:
--- ---
## 14.8 Self-Check Before Execution ## 16.8 Self-Check Before Execution
Before writing code, Claude MUST verify: Before writing code, Claude MUST verify:
@@ -542,7 +664,7 @@ If any fail → revise context selection.
--- ---
## 14.9 Injection Output Format (Internal Model) ## 16.9 Injection Output Format (Internal Model)
Claude should behave as if it constructed: Claude should behave as if it constructed:
@@ -560,7 +682,7 @@ Claude should behave as if it constructed:
--- ---
## 14.10 Relationship to ARCHITECTURE.md ## 16.10 Relationship to ARCHITECTURE.md
* ARCHITECTURE.md = source of truth * ARCHITECTURE.md = source of truth
* CLAUDE.md = execution constraints * CLAUDE.md = execution constraints
+2 -2
View File
@@ -12,7 +12,7 @@ You must follow CLAUDE_SPEC.md strictly.
Rules: Rules:
- Do not expand scope beyond what is defined - Do not expand scope beyond what is defined
- Do not refactor unrelated code - Do not refactor unrelated code
- Do not introduce new dependencies - Do not introduce new dependencies to solitaire_core or solitaire_sync without confirmation
- Prefer minimal, surgical changes - Prefer minimal, surgical changes
- Use existing patterns in the codebase - Use existing patterns in the codebase
- Return minimal diffs or changed functions only - Return minimal diffs or changed functions only
@@ -360,7 +360,7 @@ notes:
target: target:
"<what is slow>" "<what is slow>"
constraints:CLAUDE_WORKFLOW.md constraints:
- no behavior change - no behavior change
- no architecture change - no architecture change
- minimal code changes - minimal code changes
+5 -1
View File
@@ -41,6 +41,10 @@ solitaire_server:
depends_on: [solitaire_sync, axum, sqlx, jsonwebtoken] depends_on: [solitaire_sync, axum, sqlx, jsonwebtoken]
role: "backend" role: "backend"
solitaire_wasm:
depends_on: [solitaire_core, wasm-bindgen, serde-wasm-bindgen]
role: "wasm_replay_player"
solitaire_app: solitaire_app:
depends_on: [solitaire_engine] depends_on: [solitaire_engine]
role: "entrypoint" role: "entrypoint"
@@ -180,7 +184,7 @@ threading:
plugins: plugins:
pattern: "feature_isolation" pattern: "feature_isolation"
communication: "events" communication: "events and resources"
--- ---
+3 -3
View File
@@ -1,6 +1,6 @@
# Credits # Credits
Solitaire Quest is MIT-licensed (see [LICENSE](LICENSE)). It is built on top of Ferrous Solitaire is MIT-licensed (see [LICENSE](LICENSE)). It is built on top of
the work of many open-source projects and a small handful of third-party the work of many open-source projects and a small handful of third-party
assets. This file lists every component that ships in the binary or in the assets. This file lists every component that ships in the binary or in the
`assets/` directory. `assets/` directory.
@@ -43,7 +43,7 @@ copyleft code is statically linked into the game binary.
| File(s) | Source | License | | File(s) | Source | License |
|---|---|---| |---|---|---|
| `solitaire_engine/assets/themes/default/{suit}_{rank}.svg` (52 SVGs) | [hayeah/playing-cards-assets](https://github.com/hayeah/playing-cards-assets) | MIT | | `solitaire_engine/assets/themes/default/{suit}_{rank}.svg` (52 SVGs) | [hayeah/playing-cards-assets](https://github.com/hayeah/playing-cards-assets) | MIT |
| `solitaire_engine/assets/themes/default/back.svg` | Original — Solitaire Quest | MIT (this project) | | `solitaire_engine/assets/themes/default/back.svg` | Original — Ferrous Solitaire | MIT (this project) |
| `assets/cards/faces/{RANK}{SUIT}.png` (52 PNGs) | Pre-rendered from the same `playing-cards-assets` SVGs | MIT (passed through from hayeah) | | `assets/cards/faces/{RANK}{SUIT}.png` (52 PNGs) | Pre-rendered from the same `playing-cards-assets` SVGs | MIT (passed through from hayeah) |
| `assets/cards/backs/back_0.png` `back_4.png` | Original — generated by `solitaire_assetgen::gen_art` | MIT (this project) | | `assets/cards/backs/back_0.png` `back_4.png` | Original — generated by `solitaire_assetgen::gen_art` | MIT (this project) |
@@ -107,6 +107,6 @@ Audio files are MIT-licensed alongside the rest of this project.
backs, every audio file) are original work covered by this project's MIT backs, every audio file) are original work covered by this project's MIT
license. license.
If you redistribute Solitaire Quest, you must ship this `CREDITS.md` and the If you redistribute Ferrous Solitaire, you must ship this `CREDITS.md` and the
`LICENSE` file alongside the binary so the MIT (project + hayeah card art) `LICENSE` file alongside the binary so the MIT (project + hayeah card art)
and OFL (FiraMono) notices remain visible to end users. and OFL (FiraMono) notices remain visible to end users.
Generated
+1
View File
@@ -7018,6 +7018,7 @@ dependencies = [
"resvg", "resvg",
"ron", "ron",
"serde", "serde",
"serde_json",
"solitaire_core", "solitaire_core",
"solitaire_data", "solitaire_data",
"solitaire_sync", "solitaire_sync",
+1 -1
View File
@@ -1,4 +1,4 @@
# Solitaire Quest # Ferrous Solitaire
A cross-platform Klondike Solitaire game written in Rust, with a card-theme A cross-platform Klondike Solitaire game written in Rust, with a card-theme
system, full progression (XP / levels / achievements / daily challenges), and system, full progression (XP / levels / achievements / daily challenges), and
+27 -1
View File
@@ -1,4 +1,4 @@
# Solitaire Quest — Self-Hosting Guide # Ferrous Solitaire — Self-Hosting Guide
## Prerequisites ## Prerequisites
@@ -42,3 +42,29 @@ git pull
docker compose build docker compose build
docker compose up -d docker compose up -d
``` ```
## Admin — Password Reset
If a player loses access to their account, the server binary includes a
built-in password reset command. Run it on the host (or inside the container)
with `DATABASE_URL` pointing at your database:
```bash
# Interactive (prompts for the new password):
DATABASE_URL=sqlite://./data/solitaire.db \
./solitaire_server --reset-password <username>
# Non-interactive (piped from a script or password manager):
echo "new_password" | \
DATABASE_URL=sqlite://./data/solitaire.db \
./solitaire_server --reset-password <username>
# Inside a running Docker container:
docker compose exec server sh -c \
'echo "new_password" | ./solitaire_server --reset-password alice'
```
On success the user's `password_hash` is updated and **all active refresh
tokens are deleted**, so every open session must log in again with the new
password. `JWT_SECRET` does not need to be set for this command.
+56 -39
View File
@@ -1,6 +1,6 @@
# Solitaire Quest — Session Handoff # Ferrous Solitaire — Session Handoff
**Last updated:** 2026-05-12 — WASM build script + push-retry test shipped (`198df75`). HEAD locally: `198df75`. Push pending. **Last updated:** 2026-05-12 — Leaderboard display name shipped (`03be4fc`). All commits pushed to origin.
Phase 8 closes the self-hosted-server connection arc end-to-end: login/register Phase 8 closes the self-hosted-server connection arc end-to-end: login/register
modal, re-auth on token expiry, account deletion flow, server deployment modal, re-auth on token expiry, account deletion flow, server deployment
@@ -12,9 +12,9 @@ and full server integration tests.
## Current state ## Current state
- **HEAD locally:** `198df75` (test: push retry + build_test_pool). - **HEAD locally:** `03be4fc` (feat: leaderboard custom display name).
- **HEAD on origin:** `08f74d1` (pushed — 3 commits ahead). - **HEAD on origin:** `03be4fc` (fully pushed).
- **Working tree:** `SESSION_HANDOFF.md` modified, uncommitted. - **Working tree:** clean (only `solitaire-release.jks.bak2` untracked — intentional).
- **Build:** `cargo clippy --workspace --all-targets -- -D warnings` clean. - **Build:** `cargo clippy --workspace --all-targets -- -D warnings` clean.
- **Tests:** **1300+ passing / 0 failing** across the workspace. - **Tests:** **1300+ passing / 0 failing** across the workspace.
- **Tags on origin:** `v0.9.0` through `v0.22.0`. - **Tags on origin:** `v0.9.0` through `v0.22.0`.
@@ -49,15 +49,12 @@ Also shipped (pre-Phase 8 but post-v0.22.0, already in CHANGELOG):
- [x] SESSION_HANDOFF.md update — this file - [x] SESSION_HANDOFF.md update — this file
### 2. Leaderboard wiring gaps ### 2. Leaderboard wiring gaps
- **Best-score auto-post missing.** `POST /api/sync/push` merges stats/achievements/ - [x] **Best-score auto-post.** Done (`303c78a`): `update_leaderboard_if_opted_in`
progress but never touches the `leaderboard` table. Players who opt in never called from both first-push and merge paths in `sync.rs`; uses SQLite `MIN`/`MAX`
have their `best_time_secs` / `best_score` updated automatically. Fix: update in the UPDATE so scores never regress on stale data.
the leaderboard row inside the server's sync push handler (or on `GameWonEvent` - [x] **Display name = username.** Done (`03be4fc`): `leaderboard_display_name:
via a new async task in `sync_plugin`). Option<String>` added to `Settings`; editor modal in leaderboard panel; persists
- **Display name = username.** `handle_opt_in_button` uses the `SyncBackend` to `settings.json`; `handle_opt_in_button` prefers custom name over username.
username as the leaderboard display name. Consider adding
`leaderboard_display_name: Option<String>` to `Settings` for players who
want a different public identity.
### 3. Security hardening ### 3. Security hardening
- [x] **Refresh token rotation.** Done (`b129664`): `refresh_tokens` table - [x] **Refresh token rotation.** Done (`b129664`): `refresh_tokens` table
@@ -68,13 +65,15 @@ Also shipped (pre-Phase 8 but post-v0.22.0, already in CHANGELOG):
steady-state; integration test passes. steady-state; integration test passes.
### 4. Android validation ### 4. Android validation
- **Android Keystore functional test** — JNI AES-GCM code ships (`f281425`) but - [x] **Android Keystore functional test.** Done (2026-05-11, Pixel 7 AVD,
no AVD round-trip test has been run. Required before Phase 8 sync goes live on Android 14): `load_access_token()` exercised via `start_pull`; logcat confirmed
Android. `NotFound` returned cleanly — no JNI panic. See `docs/android/PLAYABILITY_TODO.md` P4.
- **JNI clipboard functional test** — same status (`2c822ba`). Note: `adb tap` - [x] **JNI clipboard functional test.** Done (2026-05-11): temporary `KEYCODE_C`
doesn't work in headless AVD (see memory); requires a touch-gesture path. hook confirmed `ClipboardManager.setPrimaryClip()` succeeds on Android 14.
- **`cargo apk build --lib` noisy stderr** — post-sign panic doesn't affect the Hook reverted. Production path requires Interaction::Pressed + non-null `share_url`.
APK but pollutes CI output. Document `--lib` as canonical or upstream a fix. Note: `adb shell input tap` doesn't deliver touch events on headless AVD (documented).
- [x] **`cargo apk build --lib` noisy stderr** — upstream cargo-apk bug; `--lib`
is the canonical command (CLAUDE.md §15.1, docs/ANDROID.md). No in-repo fix possible.
### 5. Feature completeness ### 5. Feature completeness
- [x] **Theme importer UI.** Done (`613bbf8`): "Scan for new themes" button in - [x] **Theme importer UI.** Done (`613bbf8`): "Scan for new themes" button in
@@ -86,18 +85,34 @@ Also shipped (pre-Phase 8 but post-v0.22.0, already in CHANGELOG):
- [x] **WASM build script.** Done (`40d0712`): `build_wasm.sh` at repo root - [x] **WASM build script.** Done (`40d0712`): `build_wasm.sh` at repo root
documents `wasm-pack build --target web`, cleans up pkg metadata files, documents `wasm-pack build --target web`, cleans up pkg metadata files,
includes dependency guard + install instructions. includes dependency guard + install instructions.
- **Server password reset.** No admin endpoint or CLI tool for resetting a - [x] **Server password reset.** Done (`7514684`): `--reset-password <username>`
user's password. Self-hosters have no recovery path short of direct SQLite subcommand reads new password from stdin, bcrypt-hashes it, invalidates all
edits. active sessions for the user.
### 5b. Android UX polish (2026-05-12)
- [x] **UX-1 — Modal Done button in gesture zone.** `apply_safe_area_to_modal_scrims` system
added to `SafeAreaInsetsPlugin` (`safe_area.rs`). Pads every `ModalScrim` bottom by
`insets.bottom / scale`. Fires on resource change + `Added<ModalScrim>`. Verified on device.
- [x] **UX-5b — Home mode glyph corruption.** Geometric Shapes (U+25xx, absent from FiraMono)
replaced with card suits U+26602666 in `home_plugin.rs`. Affects Zen/Challenge/Daily mode
selector buttons at level 5+.
- [x] **UX-7 — Help text wrap.** Android HUD entry shortened to
`"Open menu (Stats, Settings, Profile...)"` in `help_plugin.rs` — fits one line.
- [x] **BUG-3 — Multi-modal stacking.** `handle_menu_button` now checks
`scrims: Query<(), With<ModalScrim>>` and guards `spawn_menu_popover` with `scrims.is_empty()`.
Verified on device: ≡ tap while Stats open does nothing.
**Note:** These 4 fixes are implemented and verified but not yet committed.
### 6. Testing gaps ### 6. Testing gaps
- [x] **Server 401 → refresh → retry path.** Done (`198df75`): both - [x] **Server 401 → refresh → retry path.** Done (`198df75`): both
`jwt_refresh_on_401_succeeds` (pull) and `jwt_refresh_on_401_succeeds` (pull) and
`push_retries_after_401_on_expired_access_token` (push) in `push_retries_after_401_on_expired_access_token` (push) in
`solitaire_data/tests/sync_round_trip.rs`. `solitaire_data/tests/sync_round_trip.rs`.
- **WASM winning-replay step-through** — current tests cover 2 stock clicks; - [x] **WASM winning-replay step-through.** Done (`b4ada2a`): greedy solver
a test stepping through a full winning sequence would catch searches seeds 1200 at test time; steps every move through `ReplayPlayer`;
`GameState`/`ReplayMove` compatibility regressions. asserts `is_won = true` on the final `StateSnapshot`.
--- ---
@@ -135,26 +150,28 @@ Items missing from the doc:
## Resume prompt ## Resume prompt
``` ```
You are a senior Rust + Bevy developer working on Solitaire Quest. You are a senior Rust + Bevy developer working on Ferrous Solitaire.
Working directory: <Rusty_Solitaire clone path>. Working directory: <Rusty_Solitaire clone path>.
Branch: master. v0.23.0 is the current version (HEAD locally: bd388fe). Branch: master. v0.23.0 is the current version (HEAD: 03be4fc). Fully pushed.
Phase 8 sync is fully shipped. ARCHITECTURE.md is now v1.3 (all Phase 8 gaps closed).
Push to origin pending (bd388fe + ARCHITECTURE.md + SESSION_HANDOFF.md commits).
READ FIRST (in order): READ FIRST (in order):
1. SESSION_HANDOFF.md — this file 1. SESSION_HANDOFF.md — this file
2. CHANGELOG.md — [0.23.0] section has the full Phase 8 detail 2. CHANGELOG.md — [0.23.0] section has full Phase 8 detail
3. CLAUDE.md — unified-3.0 rule set 3. CLAUDE.md — unified-4.0 rule set
4. ARCHITECTURE.md — v1.3, fully up to date 4. ARCHITECTURE.md — v1.3, fully up to date
5. docs/ui-mockups/ — design system + mockup library 5. docs/ui-mockups/ — design system + mockup library
6. docs/android/ — Android setup + build runbook 6. docs/android/ — Android setup + build runbook
7. ~/.claude/projects/<this-project>/memory/MEMORY.md 7. ~/.claude/projects/<this-project>/memory/MEMORY.md
OPEN WORK (in priority order): OPEN WORK:
D. Android AVD functional tests (Keystore + clipboard) Phase 8 punch list is fully closed. All items verified complete.
E. Theme importer UI button in Settings Remaining nuisance: `cargo apk build --lib` noisy stderr (cosmetic, non-blocking).
F. mirror_achievement: decide + implement or remove from trait
G. Sync endpoint rate limiting (POST /api/sync/push has no per-user throttle)
Ask which to start. All are independent; any is a valid next arc. 4 Android UX fixes are implemented and verified but NOT YET COMMITTED:
- BUG-3 (hud_plugin.rs): multi-modal stacking guard
- UX-7 (help_plugin.rs): help text wrap on Android
- UX-5b (home_plugin.rs): FiraMono glyph corruption in mode selector
- UX-1 (safe_area.rs): modal Done button in gesture zone
Commit those first, then suggest Phase 9 planning.
``` ```
+28
View File
@@ -0,0 +1,28 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: solitaire-server
namespace: argocd
spec:
project: default
source:
repoURL: https://git.aleshym.co/funman300/Rusty_Solitare.git
targetRevision: master
path: deploy
destination:
server: https://kubernetes.default.svc
namespace: solitaire
# Secrets are applied manually and must not be pruned by ArgoCD.
ignoreDifferences:
- group: ""
kind: Secret
name: matomo-secret
namespace: solitaire
jsonPointers:
- /data
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true
+62
View File
@@ -0,0 +1,62 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: solitaire-server
namespace: solitaire
spec:
replicas: 1
selector:
matchLabels:
app: solitaire-server
# SQLite is single-writer; Recreate avoids two pods owning the PVC at once.
strategy:
type: Recreate
template:
metadata:
labels:
app: solitaire-server
spec:
imagePullSecrets:
- name: gitea-registry
containers:
- name: server
image: solitaire-server
imagePullPolicy: Always
ports:
- containerPort: 8080
env:
- name: DATABASE_URL
value: sqlite:///data/sol.db
- name: JWT_SECRET
valueFrom:
secretKeyRef:
name: solitaire-secrets
key: jwt-secret
- name: SERVER_PORT
value: "8080"
volumeMounts:
- name: db-data
mountPath: /data
livenessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 5
periodSeconds: 30
readinessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 3
periodSeconds: 10
resources:
requests:
cpu: 50m
memory: 64Mi
limits:
cpu: 500m
memory: 256Mi
volumes:
- name: db-data
persistentVolumeClaim:
claimName: solitaire-db
+25
View File
@@ -0,0 +1,25 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: solitaire-analytics
namespace: solitaire
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
traefik.ingress.kubernetes.io/router.entrypoints: websecure
spec:
ingressClassName: traefik
rules:
- host: analytics.aleshym.co
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: matomo
port:
name: http
tls:
- hosts:
- analytics.aleshym.co
secretName: analytics-tls
+27
View File
@@ -0,0 +1,27 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: solitaire-server
namespace: solitaire
annotations:
# Remove the next two lines if you are not using cert-manager.
cert-manager.io/cluster-issuer: letsencrypt-prod
traefik.ingress.kubernetes.io/router.entrypoints: websecure
spec:
ingressClassName: traefik
rules:
- host: klondike.aleshym.co
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: solitaire-server
port:
name: http
# Remove the tls block if you are not using cert-manager.
tls:
- hosts:
- klondike.aleshym.co
secretName: solitaire-tls
+23
View File
@@ -0,0 +1,23 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- namespace.yaml
- pvc.yaml
- deployment.yaml
- service.yaml
- ingress.yaml
- mariadb-pvc.yaml
- mariadb-deployment.yaml
- mariadb-service.yaml
- matomo-pvc.yaml
- matomo-deployment.yaml
- matomo-service.yaml
- ingress-analytics.yaml
# CI updates this block automatically via `kustomize edit set image`.
# The image name here matches the `image: solitaire-server` stub in deployment.yaml.
images:
- name: solitaire-server
newName: git.aleshym.co/funman300/solitaire-server
newTag: 0f650311
+72
View File
@@ -0,0 +1,72 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: mariadb
namespace: solitaire
spec:
replicas: 1
selector:
matchLabels:
app: mariadb
strategy:
type: Recreate
template:
metadata:
labels:
app: mariadb
spec:
containers:
- name: mariadb
image: mariadb:11
env:
- name: MYSQL_ROOT_PASSWORD
valueFrom:
secretKeyRef:
name: matomo-secret
key: MYSQL_ROOT_PASSWORD
- name: MYSQL_DATABASE
valueFrom:
secretKeyRef:
name: matomo-secret
key: MYSQL_DATABASE
- name: MYSQL_USER
valueFrom:
secretKeyRef:
name: matomo-secret
key: MYSQL_USER
- name: MYSQL_PASSWORD
valueFrom:
secretKeyRef:
name: matomo-secret
key: MYSQL_PASSWORD
ports:
- containerPort: 3306
volumeMounts:
- name: mariadb-data
mountPath: /var/lib/mysql
livenessProbe:
exec:
command:
- healthcheck.sh
- --connect
- --innodb_initialized
initialDelaySeconds: 30
periodSeconds: 30
readinessProbe:
exec:
command:
- healthcheck.sh
- --connect
initialDelaySeconds: 10
periodSeconds: 10
resources:
requests:
cpu: 100m
memory: 256Mi
limits:
cpu: 500m
memory: 512Mi
volumes:
- name: mariadb-data
persistentVolumeClaim:
claimName: mariadb-data
+11
View File
@@ -0,0 +1,11 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: mariadb-data
namespace: solitaire
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 2Gi
+13
View File
@@ -0,0 +1,13 @@
apiVersion: v1
kind: Service
metadata:
name: mariadb
namespace: solitaire
spec:
selector:
app: mariadb
ports:
- name: mysql
port: 3306
targetPort: 3306
clusterIP: None
+79
View File
@@ -0,0 +1,79 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: matomo
namespace: solitaire
spec:
replicas: 1
selector:
matchLabels:
app: matomo
strategy:
type: Recreate
template:
metadata:
labels:
app: matomo
spec:
containers:
- name: matomo
image: matomo:5.10.0
env:
- name: MATOMO_DATABASE_HOST
value: mariadb
- name: MATOMO_DATABASE_PORT
value: "3306"
- name: MATOMO_DATABASE_ADAPTER
value: PDO\MYSQL
- name: MATOMO_DATABASE_DBNAME
valueFrom:
secretKeyRef:
name: matomo-secret
key: MYSQL_DATABASE
- name: MATOMO_DATABASE_USERNAME
valueFrom:
secretKeyRef:
name: matomo-secret
key: MYSQL_USER
- name: MATOMO_DATABASE_PASSWORD
valueFrom:
secretKeyRef:
name: matomo-secret
key: MYSQL_PASSWORD
# Traefik terminates SSL; tell Matomo to trust X-Forwarded-* headers
- name: MATOMO_GENERAL_ASSUME_SECURE_PROTOCOL
value: "1"
- name: MATOMO_GENERAL_PROXY_CLIENT_HEADERS
value: HTTP_X_FORWARDED_FOR
- name: MATOMO_GENERAL_PROXY_HOST_HEADERS
value: HTTP_X_FORWARDED_HOST
ports:
- containerPort: 80
volumeMounts:
- name: matomo-data
mountPath: /var/www/html
livenessProbe:
httpGet:
path: /matomo.php
port: 80
initialDelaySeconds: 60
periodSeconds: 30
timeoutSeconds: 5
readinessProbe:
httpGet:
path: /matomo.php
port: 80
initialDelaySeconds: 30
periodSeconds: 10
timeoutSeconds: 5
resources:
requests:
cpu: 100m
memory: 256Mi
limits:
cpu: 500m
memory: 512Mi
volumes:
- name: matomo-data
persistentVolumeClaim:
claimName: matomo-data
+11
View File
@@ -0,0 +1,11 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: matomo-data
namespace: solitaire
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
+22
View File
@@ -0,0 +1,22 @@
# DO NOT COMMIT THE REAL VERSION OF THIS FILE.
# deploy/matomo-secret.yaml is gitignored — apply it manually once:
#
# cp deploy/matomo-secret.yaml.example deploy/matomo-secret.yaml
# # edit the passwords below, then:
# kubectl apply -f deploy/matomo-secret.yaml
# kubectl annotate secret matomo-secret -n solitaire \
# argocd.argoproj.io/sync-options=Prune=false --overwrite
#
# Generate strong passwords with:
# python3 -c "import secrets; print(secrets.token_urlsafe(18))"
apiVersion: v1
kind: Secret
metadata:
name: matomo-secret
namespace: solitaire
stringData:
MYSQL_ROOT_PASSWORD: "CHANGE_ME"
MYSQL_DATABASE: matomo
MYSQL_USER: matomo
MYSQL_PASSWORD: "CHANGE_ME"
MATOMO_ADMIN_PASSWORD: "CHANGE_ME"
+12
View File
@@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: matomo
namespace: solitaire
spec:
selector:
app: matomo
ports:
- name: http
port: 80
targetPort: 80
+4
View File
@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: solitaire
+11
View File
@@ -0,0 +1,11 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: solitaire-db
namespace: solitaire
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
+12
View File
@@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: solitaire-server
namespace: solitaire
spec:
selector:
app: solitaire-server
ports:
- name: http
port: 80
targetPort: 8080
+8 -6
View File
@@ -143,16 +143,18 @@ After the APK is signed cargo-apk panics with:
thread 'main' panicked: Bin is not compatible with Cdylib thread 'main' panicked: Bin is not compatible with Cdylib
``` ```
This happens AFTER the APK is on disk and signed. cargo-apk is This happens AFTER the APK is on disk and signed. cargo-apk tries to
trying to also wrap the desktop `[[bin]]` target. The APK is still also wrap the desktop `[[bin]]` target alongside the `[lib]`. The APK
valid. Work around with `--lib`: is valid — the panic is cosmetic. **Always use `--lib`**, which is the
canonical build command (see `CLAUDE.md §15.1`):
```bash ```bash
cargo apk build -p solitaire_app --target x86_64-linux-android --lib cargo apk build -p solitaire_app --lib
``` ```
(Permanent fix to come — likely a `[[bin]] required-features = ["desktop"]` Root cause: upstream cargo-apk bug — it does not skip `[[bin]]` targets
gate so cargo-apk skips the bin target on Android.) when building for Android. No in-repo fix is possible; `--lib` is the
accepted workaround.
--- ---
+6 -2
View File
@@ -1,4 +1,8 @@
# Solitaire Quest — Session Handoff # Ferrous Solitaire — Session Handoff (ARCHIVED)
> **This file is from Phase 2 (2026-04-25, 242 tests). It is kept for historical
> reference only. The authoritative session handoff is at the repo root:
> `SESSION_HANDOFF.md`.**
> Last updated: 2026-04-25 > Last updated: 2026-04-25
> Branch: `master` — pushed to https://github.com/funman300/Rusty_Solitaire.git > Branch: `master` — pushed to https://github.com/funman300/Rusty_Solitaire.git
@@ -20,7 +24,7 @@ All seven Cargo crates created and compiling cleanly:
| `solitaire_engine` | Stub | Bevy ECS systems — all plugins added in Phase 3 | | `solitaire_engine` | Stub | Bevy ECS systems — all plugins added in Phase 3 |
| `solitaire_server` | Stub | Axum sync server — implemented in Phase 8C | | `solitaire_server` | Stub | Axum sync server — implemented in Phase 8C |
| `solitaire_gpgs` | Compile-time stub | Google Play Games bridge — Android only, JNI in Phase: Android | | `solitaire_gpgs` | Compile-time stub | Google Play Games bridge — Android only, JNI in Phase: Android |
| `solitaire_app` | Working | Opens blank Bevy window titled "Solitaire Quest" at 1280×800 | | `solitaire_app` | Working | Opens blank Bevy window titled "Ferrous Solitaire" at 1280×800 |
Fast compile profiles, `assets/` directory structure, and `.env.example` are all in place. Fast compile profiles, `assets/` directory structure, and `.env.example` are all in place.
+25
View File
@@ -230,6 +230,31 @@ rewrites required.
--- ---
## P5 — UX polish (2026-05-12)
- [x] **UX-1 — Modal Done button unreachable in gesture zone.** *Closed
2026-05-12.* New `apply_safe_area_to_modal_scrims` system in
`safe_area.rs` pads every `ModalScrim` bottom by `insets.bottom /
window.scale_factor()` (logical pixels). Fires when `SafeAreaInsets`
changes AND when a new `ModalScrim` is spawned (`Added<ModalScrim>`
filter). Verified on device: Settings Done button reachable at physical
y ≈ 18002000 (was y ≈ 2232+, inside gesture zone).
- [x] **UX-5b — Home mode selector glyph corruption.** *Closed
2026-05-12.* `home_plugin.rs` mode glyphs changed from Geometric Shapes
block (U+25xx — absent from FiraMono, renders as rectangles) to card
suits U+2660 ♠ / U+2665 ♥ / U+2666 ♦. Affects Zen, Challenge, and
Daily mode selector buttons shown at level 5+.
- [x] **UX-7 — Help screen HUD button entry wraps to two lines.** *Closed
2026-05-12.* Android `CONTROL_SECTIONS` entry for ≡ button shortened
from `"Menu: Stats, Settings, Profile, Achievements"` to
`"Open menu (Stats, Settings, Profile...)"` in `help_plugin.rs`.
Fits on one line at 360 dp.
- [x] **BUG-3 — Multi-modal stacking (Stats + Profile simultaneously).** *Closed
2026-05-12.* `handle_menu_button` in `hud_plugin.rs` now checks
`scrims: Query<(), With<ModalScrim>>` and only calls
`spawn_menu_popover` when `scrims.is_empty()`. Tapping ≡ while any
modal is open is a no-op. Verified on device.
## Notes / decisions ## Notes / decisions
* This list is screenshot-driven; expect more items to surface once * This list is screenshot-driven; expect more items to surface once
+1 -1
View File
@@ -2,7 +2,7 @@
> **Date:** 2026-04-28 > **Date:** 2026-04-28
> **Author:** Claude Code > **Author:** Claude Code
> **Scope:** Feasibility analysis for porting Solitaire Quest to Android using cargo-mobile2 > **Scope:** Feasibility analysis for porting Ferrous Solitaire to Android using cargo-mobile2
--- ---
@@ -1,4 +1,4 @@
# Solitaire Quest — Phase 1 + 2: Workspace & Core Game Engine # Ferrous Solitaire — Phase 1 + 2: Workspace & Core Game Engine
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. > **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
@@ -555,7 +555,7 @@ fn main() {
.add_plugins( .add_plugins(
DefaultPlugins.set(WindowPlugin { DefaultPlugins.set(WindowPlugin {
primary_window: Some(Window { primary_window: Some(Window {
title: "Solitaire Quest".into(), title: "Ferrous Solitaire".into(),
resolution: (1280.0, 800.0).into(), resolution: (1280.0, 800.0).into(),
..default() ..default()
}), }),
@@ -571,7 +571,7 @@ fn main() {
```bash ```bash
cargo run -p solitaire_app --features bevy/dynamic_linking cargo run -p solitaire_app --features bevy/dynamic_linking
``` ```
Expected: A blank Bevy window titled "Solitaire Quest" opens. Press Escape or close the window to exit. No panics or errors in the terminal. Expected: A blank Bevy window titled "Ferrous Solitaire" opens. Press Escape or close the window to exit. No panics or errors in the terminal.
--- ---
@@ -1210,7 +1210,7 @@ fn main() {
.add_plugins( .add_plugins(
DefaultPlugins.set(WindowPlugin { DefaultPlugins.set(WindowPlugin {
primary_window: Some(Window { primary_window: Some(Window {
title: "Solitaire Quest".into(), title: "Ferrous Solitaire".into(),
resolution: (1280.0, 800.0).into(), resolution: (1280.0, 800.0).into(),
..default() ..default()
}), }),
+1 -1
View File
@@ -11,7 +11,7 @@
### Infrastructure ### Infrastructure
- Two machines (or VMs) referred to as **Machine A** and **Machine B** throughout this runbook. Both must be able to reach the sync server over the network. - Two machines (or VMs) referred to as **Machine A** and **Machine B** throughout this runbook. Both must be able to reach the sync server over the network.
- A running Solitaire Quest sync server reachable at a known URL, e.g. `https://solitaire.example.com`. See `README_SERVER.md` for setup. - A running Ferrous Solitaire sync server reachable at a known URL, e.g. `https://solitaire.example.com`. See `README_SERVER.md` for setup.
- Verify the server is live before starting: - Verify the server is live before starting:
```bash ```bash
+1 -1
View File
@@ -3,7 +3,7 @@
> **Why this exists.** The 24 mockups in this directory are mobile > **Why this exists.** The 24 mockups in this directory are mobile
> (390 × 844 logical, iPhone 14 Pro frame) with one exception > (390 × 844 logical, iPhone 14 Pro frame) with one exception
> (`home-menu-desktop.html`). The Stitch project that produced them > (`home-menu-desktop.html`). The Stitch project that produced them
> is named "Solitaire Quest *Mobile* Redesign" — the mobile-first > is named "Ferrous Solitaire *Mobile* Redesign" — the mobile-first
> framing was deliberate when the new Android target opened, but > framing was deliberate when the new Android target opened, but
> desktop is still the primary delivery surface. Porting the mobile > desktop is still the primary delivery surface. Porting the mobile
> mockups 1:1 would land a 390-px-wide column floating in the middle > mockups 1:1 would land a 390-px-wide column floating in the middle
+1 -1
View File
@@ -87,7 +87,7 @@ required = true
name = "android.permission.INTERNET" name = "android.permission.INTERNET"
[package.metadata.android.application] [package.metadata.android.application]
label = "Solitaire Quest" label = "Ferrous Solitaire"
# Launcher icon — references the density-bucketed mipmap resource above. # Launcher icon — references the density-bucketed mipmap resource above.
icon = "@mipmap/ic_launcher" icon = "@mipmap/ic_launcher"
# `debuggable` defaults to false on release builds; cargo-apk flips it # `debuggable` defaults to false on release builds; cargo-apk flips it
+3 -2
View File
@@ -25,7 +25,7 @@ use bevy::window::{Monitor, PrimaryMonitor, PrimaryWindow};
use bevy::winit::WinitWindows; use bevy::winit::WinitWindows;
use solitaire_data::{load_settings_from, provider_for_backend, settings_file_path, Settings}; use solitaire_data::{load_settings_from, provider_for_backend, settings_file_path, Settings};
use solitaire_engine::{ use solitaire_engine::{
register_theme_asset_sources, AchievementPlugin, AnimationPlugin, AssetSourcesPlugin, register_theme_asset_sources, AchievementPlugin, AnalyticsPlugin, AnimationPlugin, AssetSourcesPlugin,
AudioPlugin, AutoCompletePlugin, CardAnimationPlugin, CardPlugin, ChallengePlugin, AudioPlugin, AutoCompletePlugin, CardAnimationPlugin, CardPlugin, ChallengePlugin,
CursorPlugin, DailyChallengePlugin, DiagnosticsHudPlugin, DifficultyPlugin, FeedbackAnimPlugin, CursorPlugin, DailyChallengePlugin, DiagnosticsHudPlugin, DifficultyPlugin, FeedbackAnimPlugin,
FontPlugin, GamePlugin, HelpPlugin, HomePlugin, HudPlugin, InputPlugin, LeaderboardPlugin, FontPlugin, GamePlugin, HelpPlugin, HomePlugin, HudPlugin, InputPlugin, LeaderboardPlugin,
@@ -106,7 +106,7 @@ pub fn run() {
DefaultPlugins DefaultPlugins
.set(WindowPlugin { .set(WindowPlugin {
primary_window: Some(Window { primary_window: Some(Window {
title: "Solitaire Quest".into(), title: "Ferrous Solitaire".into(),
// X11/Wayland WM_CLASS so taskbar managers group // X11/Wayland WM_CLASS so taskbar managers group
// multiple windows of this app correctly. // multiple windows of this app correctly.
name: Some("solitaire-quest".into()), name: Some("solitaire-quest".into()),
@@ -194,6 +194,7 @@ pub fn run() {
.add_plugins(OnboardingPlugin) .add_plugins(OnboardingPlugin)
.add_plugins(SyncPlugin::new(sync_provider)) .add_plugins(SyncPlugin::new(sync_provider))
.add_plugins(SyncSetupPlugin) .add_plugins(SyncSetupPlugin)
.add_plugins(AnalyticsPlugin)
.add_plugins(LeaderboardPlugin) .add_plugins(LeaderboardPlugin)
.add_plugins(WinSummaryPlugin) .add_plugins(WinSummaryPlugin)
.add_plugins(UiModalPlugin) .add_plugins(UiModalPlugin)
+1 -1
View File
@@ -1,4 +1,4 @@
//! Generates PNG assets for Solitaire Quest. //! Generates PNG assets for Ferrous Solitaire.
//! //!
//! Produces: //! Produces:
//! - 52 card face PNGs (120×168) — one per card, with rank, suit symbol, and //! - 52 card face PNGs (120×168) — one per card, with rank, suit symbol, and
+131 -37
View File
@@ -145,6 +145,10 @@ pub struct GameState {
/// Used by the `comeback` achievement condition. /// Used by the `comeback` achievement condition.
#[serde(default)] #[serde(default)]
pub recycle_count: u32, pub recycle_count: u32,
/// When `true`, the player may move the top card of a foundation pile back
/// onto a compatible tableau column. Off by default — non-standard house rule.
#[serde(default)]
pub take_from_foundation: bool,
/// Save-file schema version. Defaults to `1` for older files that pre-date /// Save-file schema version. Defaults to `1` for older files that pre-date
/// the field. The loader refuses any value other than /// the field. The loader refuses any value other than
/// [`GAME_STATE_SCHEMA_VERSION`]. /// [`GAME_STATE_SCHEMA_VERSION`].
@@ -187,6 +191,7 @@ impl GameState {
is_auto_completable: false, is_auto_completable: false,
undo_count: 0, undo_count: 0,
recycle_count: 0, recycle_count: 0,
take_from_foundation: false,
schema_version: GAME_STATE_SCHEMA_VERSION, schema_version: GAME_STATE_SCHEMA_VERSION,
undo_stack: VecDeque::new(), undo_stack: VecDeque::new(),
} }
@@ -312,6 +317,18 @@ impl GameState {
} }
} }
PileType::Tableau(_) => { PileType::Tableau(_) => {
if matches!(&from, PileType::Foundation(_)) {
if !self.take_from_foundation {
return Err(MoveError::RuleViolation(
"take-from-foundation rule is disabled".into(),
));
}
if count != 1 {
return Err(MoveError::RuleViolation(
"only one card can return from foundation at a time".into(),
));
}
}
let dest = self.piles.get(&to).ok_or(MoveError::InvalidDestination)?; let dest = self.piles.get(&to).ok_or(MoveError::InvalidDestination)?;
if !can_place_on_tableau(&bottom_card, dest) { if !can_place_on_tableau(&bottom_card, dest) {
return Err(MoveError::RuleViolation("invalid tableau placement".into())); return Err(MoveError::RuleViolation("invalid tableau placement".into()));
@@ -409,12 +426,11 @@ impl GameState {
/// Returns `true` when stock and waste are empty and all tableau cards are face-up. /// Returns `true` when stock and waste are empty and all tableau cards are face-up.
/// At that point the game can be completed without further player input. /// At that point the game can be completed without further player input.
pub fn check_auto_complete(&self) -> bool { pub fn check_auto_complete(&self) -> bool {
// Stock must be empty; waste may still have cards (they are resolved
// by draw() calls inside next_auto_complete_move / auto_complete_step).
if !self.piles[&PileType::Stock].cards.is_empty() { if !self.piles[&PileType::Stock].cards.is_empty() {
return false; return false;
} }
if !self.piles[&PileType::Waste].cards.is_empty() {
return false;
}
(0..7).all(|i| { (0..7).all(|i| {
self.piles[&PileType::Tableau(i)] self.piles[&PileType::Tableau(i)]
.cards .cards
@@ -442,42 +458,53 @@ impl GameState {
if !self.is_auto_completable || self.is_won { if !self.is_auto_completable || self.is_won {
return None; return None;
} }
// Check waste top first — when stock is exhausted the waste may still
// contain cards that can go directly to a foundation.
let waste = PileType::Waste;
if let Some((card, slot)) = self.piles[&waste].cards.last()
.and_then(|c| self.foundation_slot_for(c).map(|s| (c, s)))
{
let _ = card; // borrow ends here
return Some((waste, PileType::Foundation(slot)));
}
for i in 0..7 { for i in 0..7 {
let tableau = PileType::Tableau(i); let tableau = PileType::Tableau(i);
if let Some(card) = self.piles[&tableau].cards.last() { if let Some(slot) = self.piles[&tableau].cards.last()
// Prefer the slot that already claims this card's suit so .and_then(|c| self.foundation_slot_for(c))
// Aces don't sometimes land in slot 0 and then leave the {
// matching suit-claimed slot empty. return Some((tableau, PileType::Foundation(slot)));
let mut candidate: Option<u8> = None;
let mut empty_slot: Option<u8> = None;
for slot in 0..4_u8 {
let foundation = PileType::Foundation(slot);
let pile = &self.piles[&foundation];
if pile.cards.is_empty() {
if empty_slot.is_none() {
empty_slot = Some(slot);
}
} else if pile.claimed_suit() == Some(card.suit) {
candidate = Some(slot);
break;
}
}
let target_slot = candidate.or_else(|| {
// Only fall back to an empty slot if the card is an Ace,
// which is the only rank that can claim an empty slot.
if card.rank.value() == 1 { empty_slot } else { None }
});
if let Some(slot) = target_slot {
let foundation = PileType::Foundation(slot);
if can_place_on_foundation(card, &self.piles[&foundation]) {
return Some((tableau, foundation));
}
}
} }
} }
None None
} }
/// Return the foundation slot index that `card` can legally move to, or
/// `None` if no such slot exists.
///
/// Prefers the slot already claiming this card's suit so Aces always land
/// in a consistent column. Falls back to an empty slot only for Aces.
fn foundation_slot_for(&self, card: &crate::card::Card) -> Option<u8> {
let mut candidate: Option<u8> = None;
let mut empty_slot: Option<u8> = None;
for slot in 0..4_u8 {
let pile = &self.piles[&PileType::Foundation(slot)];
if pile.cards.is_empty() {
if empty_slot.is_none() {
empty_slot = Some(slot);
}
} else if pile.claimed_suit() == Some(card.suit) {
candidate = Some(slot);
break;
}
}
let target = candidate.or_else(|| {
if card.rank.value() == 1 { empty_slot } else { None }
});
target.filter(|&slot| {
can_place_on_foundation(card, &self.piles[&PileType::Foundation(slot)])
})
}
/// Time bonus added to score on win: `700_000 / elapsed_seconds` (0 if elapsed is 0). /// Time bonus added to score on win: `700_000 / elapsed_seconds` (0 if elapsed is 0).
pub fn compute_time_bonus(&self) -> i32 { pub fn compute_time_bonus(&self) -> i32 {
scoring_time_bonus(self.elapsed_seconds) scoring_time_bonus(self.elapsed_seconds)
@@ -1005,24 +1032,24 @@ mod tests {
} }
#[test] #[test]
fn auto_complete_false_when_waste_not_empty() { fn auto_complete_true_when_stock_empty_waste_has_cards() {
// Waste no longer blocks auto-complete — draw() drains it during
// auto-complete steps. Only stock-not-empty and face-down tableau
// cards block the flag.
let mut g = new_game(); let mut g = new_game();
g.piles.get_mut(&PileType::Stock).unwrap().cards.clear(); g.piles.get_mut(&PileType::Stock).unwrap().cards.clear();
// Leave the waste pile untouched (it may be empty after clearing stock,
// so add a card explicitly to ensure the waste guard is exercised).
g.piles.get_mut(&PileType::Waste).unwrap().cards.push(Card { g.piles.get_mut(&PileType::Waste).unwrap().cards.push(Card {
id: 99, id: 99,
suit: Suit::Clubs, suit: Suit::Clubs,
rank: Rank::Ace, rank: Rank::Ace,
face_up: true, face_up: true,
}); });
// Make all tableau cards face-up so only the waste guard is the blocker.
for i in 0..7 { for i in 0..7 {
for c in g.piles.get_mut(&PileType::Tableau(i)).unwrap().cards.iter_mut() { for c in g.piles.get_mut(&PileType::Tableau(i)).unwrap().cards.iter_mut() {
c.face_up = true; c.face_up = true;
} }
} }
assert!(!g.check_auto_complete()); assert!(g.check_auto_complete());
} }
#[test] #[test]
@@ -1258,4 +1285,71 @@ mod tests {
"must target the Hearts-claimed slot, not the empty slot 0", "must target the Hearts-claimed slot, not the empty slot 0",
); );
} }
fn setup_take_from_foundation_game() -> GameState {
let mut g = new_game();
// Clear the board so we control the layout exactly.
g.piles.get_mut(&PileType::Stock).unwrap().cards.clear();
g.piles.get_mut(&PileType::Waste).unwrap().cards.clear();
for i in 0..7 {
g.piles.get_mut(&PileType::Tableau(i)).unwrap().cards.clear();
}
// Foundation slot 0: A♠, 2♠ (top = 2♠)
let f = g.piles.get_mut(&PileType::Foundation(0)).unwrap();
f.cards.push(Card { id: 1, suit: Suit::Spades, rank: Rank::Ace, face_up: true });
f.cards.push(Card { id: 2, suit: Suit::Spades, rank: Rank::Two, face_up: true });
// Tableau 0: 3♥ face-up (2♠ can go on 3♥ — different colour, rank-1)
g.piles.get_mut(&PileType::Tableau(0)).unwrap().cards.push(Card {
id: 3, suit: Suit::Hearts, rank: Rank::Three, face_up: true,
});
g
}
#[test]
fn take_from_foundation_blocked_by_default() {
let mut g = setup_take_from_foundation_game();
assert!(!g.take_from_foundation);
let err = g
.move_cards(PileType::Foundation(0), PileType::Tableau(0), 1)
.unwrap_err();
assert!(
matches!(err, MoveError::RuleViolation(_)),
"expected RuleViolation, got {err:?}",
);
}
#[test]
fn take_from_foundation_allowed_when_enabled() {
let mut g = setup_take_from_foundation_game();
g.take_from_foundation = true;
g.move_cards(PileType::Foundation(0), PileType::Tableau(0), 1).unwrap();
// Foundation slot 0 should now hold only the Ace.
assert_eq!(g.piles[&PileType::Foundation(0)].cards.len(), 1);
assert_eq!(g.piles[&PileType::Foundation(0)].cards[0].rank, Rank::Ace);
// The 2♠ should be on top of tableau 0 above the 3♥.
let t0 = &g.piles[&PileType::Tableau(0)].cards;
assert_eq!(t0.len(), 2);
assert_eq!(t0[1].rank, Rank::Two);
}
#[test]
fn take_from_foundation_rejects_illegal_tableau_placement() {
let mut g = setup_take_from_foundation_game();
g.take_from_foundation = true;
// Tableau 1 is empty — only a King can go there; 2♠ is not a King.
let err = g
.move_cards(PileType::Foundation(0), PileType::Tableau(1), 1)
.unwrap_err();
assert!(matches!(err, MoveError::RuleViolation(_)));
}
#[test]
fn take_from_foundation_rejects_count_gt_1() {
let mut g = setup_take_from_foundation_game();
g.take_from_foundation = true;
let err = g
.move_cards(PileType::Foundation(0), PileType::Tableau(0), 2)
.unwrap_err();
assert!(matches!(err, MoveError::RuleViolation(_)));
}
} }
+1
View File
@@ -15,6 +15,7 @@ async-trait = { workspace = true }
dirs = { workspace = true } dirs = { workspace = true }
reqwest = { workspace = true } reqwest = { workspace = true }
tokio = { workspace = true } tokio = { workspace = true }
uuid = { workspace = true }
# `keyring-core` is the typed Entry/Error API used by # `keyring-core` is the typed Entry/Error API used by
# `auth_tokens`. The crate's own dependency tree pulls in # `auth_tokens`. The crate's own dependency tree pulls in
+3
View File
@@ -163,5 +163,8 @@ pub use replay::{
REPLAY_HISTORY_CAP, REPLAY_HISTORY_SCHEMA_VERSION, REPLAY_SCHEMA_VERSION, REPLAY_HISTORY_CAP, REPLAY_HISTORY_SCHEMA_VERSION, REPLAY_SCHEMA_VERSION,
}; };
pub mod matomo_client;
pub use matomo_client::MatomoClient;
pub mod platform; pub mod platform;
pub use platform::data_dir; pub use platform::data_dir;
+122
View File
@@ -0,0 +1,122 @@
//! Matomo HTTP Tracking API client.
//!
//! Buffers game-play events and flushes them via the Matomo bulk tracking
//! endpoint. Errors are silently discarded — analytics must never affect
//! gameplay or block the UI.
use std::sync::Mutex;
use reqwest::Client;
use uuid::Uuid;
/// Sends game-play events to a self-hosted Matomo instance via the
/// [HTTP Tracking API](https://developer.matomo.org/api-reference/tracking-api).
///
/// Construct once per session and share via `Arc`. `event` is cheap and
/// can be called from the Bevy main thread; `flush` is async and must be
/// called from a background task.
pub struct MatomoClient {
tracking_url: String,
site_id: u32,
/// 16 hex-char visitor ID, stable for the lifetime of this client.
visitor_id: String,
uid: Option<String>,
client: Client,
/// Pre-encoded query strings, one per buffered event.
pending: Mutex<Vec<String>>,
}
impl MatomoClient {
/// Create a new client targeting `base_url` (e.g. `"https://analytics.example.com"`).
pub fn new(base_url: impl AsRef<str>, site_id: u32, uid: Option<String>) -> Self {
let base = base_url.as_ref().trim_end_matches('/');
let tracking_url = format!("{}/matomo.php", base);
// Take the lower 64 bits of a v4 UUID and format as 16 hex chars.
let visitor_id = format!("{:016x}", Uuid::new_v4().as_u128() as u64);
Self {
tracking_url,
site_id,
visitor_id,
uid,
client: Client::new(),
pending: Mutex::new(Vec::new()),
}
}
/// Buffer one Matomo custom event. Never blocks; never fails visibly.
///
/// When the buffer exceeds 100 events the oldest 50 are dropped to
/// prevent unbounded memory growth during extended offline play.
pub fn event(
&self,
category: &str,
action: &str,
name: Option<&str>,
value: Option<f64>,
) {
let Ok(mut guard) = self.pending.lock() else {
return;
};
let mut qs = format!(
"idsite={}&rec=1&apiv=1&send_image=0\
&url=game%3A%2F%2Fsolitaire%2Fevent\
&_id={}&e_c={}&e_a={}",
self.site_id,
self.visitor_id,
url_encode(category),
url_encode(action),
);
if let Some(n) = name {
qs.push_str(&format!("&e_n={}", url_encode(n)));
}
if let Some(v) = value {
qs.push_str(&format!("&e_v={v}"));
}
if let Some(uid) = &self.uid {
qs.push_str(&format!("&uid={}", url_encode(uid)));
}
guard.push(qs);
if guard.len() > 100 {
guard.drain(0..50);
}
}
/// Drain the pending buffer and POST it to Matomo's bulk tracking endpoint.
///
/// The buffer is drained *before* the HTTP call so events recorded during
/// an in-flight flush are not lost. Network errors are silently discarded.
pub async fn flush(&self) {
let pending = {
let Ok(mut guard) = self.pending.lock() else {
return;
};
if guard.is_empty() {
return;
}
std::mem::take(&mut *guard)
};
let requests: Vec<String> = pending.into_iter().map(|qs| format!("?{qs}")).collect();
let body = serde_json::json!({ "requests": requests });
let _ = self
.client
.post(&self.tracking_url)
.json(&body)
.send()
.await;
}
}
fn url_encode(s: &str) -> String {
s.chars()
.flat_map(|c| match c {
'A'..='Z' | 'a'..='z' | '0'..='9' | '-' | '_' | '.' | '~' => {
vec![c]
}
c => format!("%{:02X}", c as u32).chars().collect(),
})
.collect()
}
+42 -7
View File
@@ -49,7 +49,7 @@ pub enum SyncBackend {
#[default] #[default]
#[serde(rename = "local")] #[serde(rename = "local")]
Local, Local,
/// Sync with a self-hosted Solitaire Quest server. /// Sync with a self-hosted Ferrous Solitaire server.
#[serde(rename = "solitaire_server")] #[serde(rename = "solitaire_server")]
SolitaireServer { SolitaireServer {
/// Base URL of the server, e.g. `"https://solitaire.example.com"`. /// Base URL of the server, e.g. `"https://solitaire.example.com"`.
@@ -143,11 +143,10 @@ pub struct Settings {
#[serde(default)] #[serde(default)]
pub window_geometry: Option<WindowGeometry>, pub window_geometry: Option<WindowGeometry>,
/// Identifier of the active card-art theme. Matches `meta.id` from /// Identifier of the active card-art theme. Matches `meta.id` from
/// the theme's `theme.ron` manifest. `"default"` is the bundled /// the theme's `theme.ron` manifest. `"classic"` and `"dark"` are
/// theme and is always present in the registry; user-supplied /// always present; user-supplied themes register under their own ids.
/// themes register under their own ids when they're imported. /// Older `settings.json` files that stored `"default"` will fall
/// Older `settings.json` files default cleanly to `"default"` via /// back to the dark embedded theme at runtime.
/// `#[serde(default = ...)]`.
#[serde(default = "default_theme_id")] #[serde(default = "default_theme_id")]
pub selected_theme_id: String, pub selected_theme_id: String,
/// Set to `true` once the achievement-onboarding info-toast has been /// Set to `true` once the achievement-onboarding info-toast has been
@@ -231,6 +230,33 @@ pub struct Settings {
/// cleanly to `None` via `#[serde(default)]`. /// cleanly to `None` via `#[serde(default)]`.
#[serde(default)] #[serde(default)]
pub last_difficulty: Option<DifficultyLevel>, pub last_difficulty: Option<DifficultyLevel>,
/// Custom public name displayed on the leaderboard. When `None`, the
/// player's server `username` is used instead. Trimmed to 32 characters
/// before submission. Older `settings.json` files written before this
/// field existed deserialize cleanly to `None` via `#[serde(default)]`.
#[serde(default)]
pub leaderboard_display_name: Option<String>,
/// When `true`, the player may drag the top card of a completed foundation
/// pile back onto a compatible tableau column — a non-standard house rule.
/// Off by default. Older `settings.json` files deserialize cleanly to
/// `false` via `#[serde(default)]`.
#[serde(default)]
pub take_from_foundation: bool,
/// When `true`, anonymous game-play events (game start, game won, etc.)
/// are sent to the configured Matomo instance. Opt-in; defaults to `false`.
/// Requires `matomo_url` to be set. Older `settings.json` files deserialize
/// cleanly to `false` via `#[serde(default)]`.
#[serde(default)]
pub analytics_enabled: bool,
/// Base URL of the Matomo instance to send events to, e.g.
/// `"https://analytics.example.com"`. When `None` the analytics toggle has
/// no effect. Older `settings.json` files deserialize cleanly to `None`.
#[serde(default)]
pub matomo_url: Option<String>,
/// Matomo site ID assigned when the tracked site was created in Matomo.
/// Defaults to `1` (the first site created in a fresh Matomo install).
#[serde(default = "default_matomo_site_id")]
pub matomo_site_id: u32,
} }
fn default_draw_mode() -> DrawMode { fn default_draw_mode() -> DrawMode {
@@ -246,7 +272,7 @@ fn default_music_volume() -> f32 {
} }
fn default_theme_id() -> String { fn default_theme_id() -> String {
"default".to_string() "classic".to_string()
} }
/// Default tooltip-hover dwell delay in seconds. Mirrors /// Default tooltip-hover dwell delay in seconds. Mirrors
@@ -299,6 +325,10 @@ fn default_replay_move_interval_secs() -> f32 {
0.45 0.45
} }
fn default_matomo_site_id() -> u32 {
1
}
/// Lower bound of the player-tunable replay-playback per-move interval, /// Lower bound of the player-tunable replay-playback per-move interval,
/// in seconds. Below this the cards barely register visually before /// in seconds. Below this the cards barely register visually before
/// the next move fires; the cap keeps the playback legible. /// the next move fires; the cap keeps the playback legible.
@@ -350,6 +380,11 @@ impl Default for Settings {
disable_smart_default_size: false, disable_smart_default_size: false,
replay_move_interval_secs: default_replay_move_interval_secs(), replay_move_interval_secs: default_replay_move_interval_secs(),
last_difficulty: None, last_difficulty: None,
leaderboard_display_name: None,
take_from_foundation: false,
analytics_enabled: false,
matomo_url: None,
matomo_site_id: default_matomo_site_id(),
} }
} }
} }
+2 -2
View File
@@ -6,7 +6,7 @@
//! | Struct | Backend | //! | Struct | Backend |
//! |---|---| //! |---|---|
//! | [`LocalOnlyProvider`] | No-op; used when sync is disabled | //! | [`LocalOnlyProvider`] | No-op; used when sync is disabled |
//! | [`SolitaireServerClient`] | Self-hosted Solitaire Quest server (JWT auth) | //! | [`SolitaireServerClient`] | Self-hosted Ferrous Solitaire server (JWT auth) |
//! //!
//! Use [`provider_for_backend`] to obtain a `Box<dyn SyncProvider + Send + Sync>` //! Use [`provider_for_backend`] to obtain a `Box<dyn SyncProvider + Send + Sync>`
//! without matching on [`SyncBackend`] anywhere else in the codebase. //! without matching on [`SyncBackend`] anywhere else in the codebase.
@@ -55,7 +55,7 @@ impl SyncProvider for LocalOnlyProvider {
// SolitaireServerClient // SolitaireServerClient
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
/// HTTP sync client for the self-hosted Solitaire Quest server. /// HTTP sync client for the self-hosted Ferrous Solitaire server.
/// ///
/// Authenticates via JWT stored in the OS keychain. On a 401 response the /// Authenticates via JWT stored in the OS keychain. On a 401 response the
/// client automatically attempts a token refresh and retries the request once /// client automatically attempts a token refresh and retries the request once
+1
View File
@@ -14,6 +14,7 @@ chrono = { workspace = true }
uuid = { workspace = true } uuid = { workspace = true }
tokio = { workspace = true } tokio = { workspace = true }
serde = { workspace = true } serde = { workspace = true }
serde_json = { workspace = true }
thiserror = { workspace = true } thiserror = { workspace = true }
usvg = { workspace = true } usvg = { workspace = true }
resvg = { workspace = true } resvg = { workspace = true }
@@ -0,0 +1,19 @@
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="384" viewBox="0 0 256 384">
<defs>
<pattern id="dp" x="0" y="0" width="28" height="28" patternUnits="userSpaceOnUse">
<rect width="28" height="28" fill="#1a3a6e"/>
<polygon points="14,2 26,14 14,26 2,14" fill="#2255aa"/>
<polygon points="14,7 21,14 14,21 7,14" fill="#1a3a6e"/>
</pattern>
</defs>
<!-- White card background -->
<rect x="2" y="2" width="252" height="380" rx="14" ry="14" fill="#FAFAF8"/>
<!-- Red outer border -->
<rect x="2" y="2" width="252" height="380" rx="14" ry="14"
fill="none" stroke="#CC1111" stroke-width="4"/>
<!-- Navy diamond pattern inset -->
<rect x="16" y="16" width="224" height="352" rx="8" ry="8" fill="url(#dp)"/>
<!-- Thin red frame around pattern -->
<rect x="16" y="16" width="224" height="352" rx="8" ry="8"
fill="none" stroke="#CC1111" stroke-width="2"/>
</svg>

After

Width:  |  Height:  |  Size: 924 B

@@ -0,0 +1,25 @@
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="384" viewBox="0 0 256 384">
<rect x="2" y="2" width="252" height="380" rx="14" ry="14"
fill="#FAFAF8" stroke="#AAAAAA" stroke-width="1.5"/>
<!-- Top-left corner: rank label + small suit -->
<text x="11" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#111111">10</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,4 C 13,4 10,7 10,10 C 10,12 11,13 12,14 C 9,14 4,17 4,21 C 4,24 7,27 10,27 C 12,27 14,26 14,24 L 13,30 L 19,30 L 18,24 C 18,26 20,27 22,27 C 25,27 28,24 28,21 C 28,17 23,14 20,14 C 21,13 22,12 22,10 C 22,7 19,4 16,4 Z" fill="#111111"/>
</g>
<!-- Centre: large suit, 64x64 in 256x384 card -->
<g transform="translate(96 160) scale(2)">
<path d="M16,4 C 13,4 10,7 10,10 C 10,12 11,13 12,14 C 9,14 4,17 4,21 C 4,24 7,27 10,27 C 12,27 14,26 14,24 L 13,30 L 19,30 L 18,24 C 18,26 20,27 22,27 C 25,27 28,24 28,21 C 28,17 23,14 20,14 C 21,13 22,12 22,10 C 22,7 19,4 16,4 Z" fill="#111111"/>
</g>
<!-- Bottom-right corner: mirrored via 180° rotation around card centre -->
<g transform="rotate(180 128 192)">
<text x="11" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#111111">10</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,4 C 13,4 10,7 10,10 C 10,12 11,13 12,14 C 9,14 4,17 4,21 C 4,24 7,27 10,27 C 12,27 14,26 14,24 L 13,30 L 19,30 L 18,24 C 18,26 20,27 22,27 C 25,27 28,24 28,21 C 28,17 23,14 20,14 C 21,13 22,12 22,10 C 22,7 19,4 16,4 Z" fill="#111111"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

@@ -0,0 +1,25 @@
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="384" viewBox="0 0 256 384">
<rect x="2" y="2" width="252" height="380" rx="14" ry="14"
fill="#FAFAF8" stroke="#AAAAAA" stroke-width="1.5"/>
<!-- Top-left corner: rank label + small suit -->
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#111111">2</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,4 C 13,4 10,7 10,10 C 10,12 11,13 12,14 C 9,14 4,17 4,21 C 4,24 7,27 10,27 C 12,27 14,26 14,24 L 13,30 L 19,30 L 18,24 C 18,26 20,27 22,27 C 25,27 28,24 28,21 C 28,17 23,14 20,14 C 21,13 22,12 22,10 C 22,7 19,4 16,4 Z" fill="#111111"/>
</g>
<!-- Centre: large suit, 64x64 in 256x384 card -->
<g transform="translate(96 160) scale(2)">
<path d="M16,4 C 13,4 10,7 10,10 C 10,12 11,13 12,14 C 9,14 4,17 4,21 C 4,24 7,27 10,27 C 12,27 14,26 14,24 L 13,30 L 19,30 L 18,24 C 18,26 20,27 22,27 C 25,27 28,24 28,21 C 28,17 23,14 20,14 C 21,13 22,12 22,10 C 22,7 19,4 16,4 Z" fill="#111111"/>
</g>
<!-- Bottom-right corner: mirrored via 180° rotation around card centre -->
<g transform="rotate(180 128 192)">
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#111111">2</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,4 C 13,4 10,7 10,10 C 10,12 11,13 12,14 C 9,14 4,17 4,21 C 4,24 7,27 10,27 C 12,27 14,26 14,24 L 13,30 L 19,30 L 18,24 C 18,26 20,27 22,27 C 25,27 28,24 28,21 C 28,17 23,14 20,14 C 21,13 22,12 22,10 C 22,7 19,4 16,4 Z" fill="#111111"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

@@ -0,0 +1,25 @@
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="384" viewBox="0 0 256 384">
<rect x="2" y="2" width="252" height="380" rx="14" ry="14"
fill="#FAFAF8" stroke="#AAAAAA" stroke-width="1.5"/>
<!-- Top-left corner: rank label + small suit -->
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#111111">3</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,4 C 13,4 10,7 10,10 C 10,12 11,13 12,14 C 9,14 4,17 4,21 C 4,24 7,27 10,27 C 12,27 14,26 14,24 L 13,30 L 19,30 L 18,24 C 18,26 20,27 22,27 C 25,27 28,24 28,21 C 28,17 23,14 20,14 C 21,13 22,12 22,10 C 22,7 19,4 16,4 Z" fill="#111111"/>
</g>
<!-- Centre: large suit, 64x64 in 256x384 card -->
<g transform="translate(96 160) scale(2)">
<path d="M16,4 C 13,4 10,7 10,10 C 10,12 11,13 12,14 C 9,14 4,17 4,21 C 4,24 7,27 10,27 C 12,27 14,26 14,24 L 13,30 L 19,30 L 18,24 C 18,26 20,27 22,27 C 25,27 28,24 28,21 C 28,17 23,14 20,14 C 21,13 22,12 22,10 C 22,7 19,4 16,4 Z" fill="#111111"/>
</g>
<!-- Bottom-right corner: mirrored via 180° rotation around card centre -->
<g transform="rotate(180 128 192)">
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#111111">3</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,4 C 13,4 10,7 10,10 C 10,12 11,13 12,14 C 9,14 4,17 4,21 C 4,24 7,27 10,27 C 12,27 14,26 14,24 L 13,30 L 19,30 L 18,24 C 18,26 20,27 22,27 C 25,27 28,24 28,21 C 28,17 23,14 20,14 C 21,13 22,12 22,10 C 22,7 19,4 16,4 Z" fill="#111111"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

@@ -0,0 +1,25 @@
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="384" viewBox="0 0 256 384">
<rect x="2" y="2" width="252" height="380" rx="14" ry="14"
fill="#FAFAF8" stroke="#AAAAAA" stroke-width="1.5"/>
<!-- Top-left corner: rank label + small suit -->
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#111111">4</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,4 C 13,4 10,7 10,10 C 10,12 11,13 12,14 C 9,14 4,17 4,21 C 4,24 7,27 10,27 C 12,27 14,26 14,24 L 13,30 L 19,30 L 18,24 C 18,26 20,27 22,27 C 25,27 28,24 28,21 C 28,17 23,14 20,14 C 21,13 22,12 22,10 C 22,7 19,4 16,4 Z" fill="#111111"/>
</g>
<!-- Centre: large suit, 64x64 in 256x384 card -->
<g transform="translate(96 160) scale(2)">
<path d="M16,4 C 13,4 10,7 10,10 C 10,12 11,13 12,14 C 9,14 4,17 4,21 C 4,24 7,27 10,27 C 12,27 14,26 14,24 L 13,30 L 19,30 L 18,24 C 18,26 20,27 22,27 C 25,27 28,24 28,21 C 28,17 23,14 20,14 C 21,13 22,12 22,10 C 22,7 19,4 16,4 Z" fill="#111111"/>
</g>
<!-- Bottom-right corner: mirrored via 180° rotation around card centre -->
<g transform="rotate(180 128 192)">
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#111111">4</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,4 C 13,4 10,7 10,10 C 10,12 11,13 12,14 C 9,14 4,17 4,21 C 4,24 7,27 10,27 C 12,27 14,26 14,24 L 13,30 L 19,30 L 18,24 C 18,26 20,27 22,27 C 25,27 28,24 28,21 C 28,17 23,14 20,14 C 21,13 22,12 22,10 C 22,7 19,4 16,4 Z" fill="#111111"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

@@ -0,0 +1,25 @@
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="384" viewBox="0 0 256 384">
<rect x="2" y="2" width="252" height="380" rx="14" ry="14"
fill="#FAFAF8" stroke="#AAAAAA" stroke-width="1.5"/>
<!-- Top-left corner: rank label + small suit -->
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#111111">5</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,4 C 13,4 10,7 10,10 C 10,12 11,13 12,14 C 9,14 4,17 4,21 C 4,24 7,27 10,27 C 12,27 14,26 14,24 L 13,30 L 19,30 L 18,24 C 18,26 20,27 22,27 C 25,27 28,24 28,21 C 28,17 23,14 20,14 C 21,13 22,12 22,10 C 22,7 19,4 16,4 Z" fill="#111111"/>
</g>
<!-- Centre: large suit, 64x64 in 256x384 card -->
<g transform="translate(96 160) scale(2)">
<path d="M16,4 C 13,4 10,7 10,10 C 10,12 11,13 12,14 C 9,14 4,17 4,21 C 4,24 7,27 10,27 C 12,27 14,26 14,24 L 13,30 L 19,30 L 18,24 C 18,26 20,27 22,27 C 25,27 28,24 28,21 C 28,17 23,14 20,14 C 21,13 22,12 22,10 C 22,7 19,4 16,4 Z" fill="#111111"/>
</g>
<!-- Bottom-right corner: mirrored via 180° rotation around card centre -->
<g transform="rotate(180 128 192)">
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#111111">5</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,4 C 13,4 10,7 10,10 C 10,12 11,13 12,14 C 9,14 4,17 4,21 C 4,24 7,27 10,27 C 12,27 14,26 14,24 L 13,30 L 19,30 L 18,24 C 18,26 20,27 22,27 C 25,27 28,24 28,21 C 28,17 23,14 20,14 C 21,13 22,12 22,10 C 22,7 19,4 16,4 Z" fill="#111111"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

@@ -0,0 +1,25 @@
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="384" viewBox="0 0 256 384">
<rect x="2" y="2" width="252" height="380" rx="14" ry="14"
fill="#FAFAF8" stroke="#AAAAAA" stroke-width="1.5"/>
<!-- Top-left corner: rank label + small suit -->
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#111111">6</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,4 C 13,4 10,7 10,10 C 10,12 11,13 12,14 C 9,14 4,17 4,21 C 4,24 7,27 10,27 C 12,27 14,26 14,24 L 13,30 L 19,30 L 18,24 C 18,26 20,27 22,27 C 25,27 28,24 28,21 C 28,17 23,14 20,14 C 21,13 22,12 22,10 C 22,7 19,4 16,4 Z" fill="#111111"/>
</g>
<!-- Centre: large suit, 64x64 in 256x384 card -->
<g transform="translate(96 160) scale(2)">
<path d="M16,4 C 13,4 10,7 10,10 C 10,12 11,13 12,14 C 9,14 4,17 4,21 C 4,24 7,27 10,27 C 12,27 14,26 14,24 L 13,30 L 19,30 L 18,24 C 18,26 20,27 22,27 C 25,27 28,24 28,21 C 28,17 23,14 20,14 C 21,13 22,12 22,10 C 22,7 19,4 16,4 Z" fill="#111111"/>
</g>
<!-- Bottom-right corner: mirrored via 180° rotation around card centre -->
<g transform="rotate(180 128 192)">
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#111111">6</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,4 C 13,4 10,7 10,10 C 10,12 11,13 12,14 C 9,14 4,17 4,21 C 4,24 7,27 10,27 C 12,27 14,26 14,24 L 13,30 L 19,30 L 18,24 C 18,26 20,27 22,27 C 25,27 28,24 28,21 C 28,17 23,14 20,14 C 21,13 22,12 22,10 C 22,7 19,4 16,4 Z" fill="#111111"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

@@ -0,0 +1,25 @@
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="384" viewBox="0 0 256 384">
<rect x="2" y="2" width="252" height="380" rx="14" ry="14"
fill="#FAFAF8" stroke="#AAAAAA" stroke-width="1.5"/>
<!-- Top-left corner: rank label + small suit -->
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#111111">7</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,4 C 13,4 10,7 10,10 C 10,12 11,13 12,14 C 9,14 4,17 4,21 C 4,24 7,27 10,27 C 12,27 14,26 14,24 L 13,30 L 19,30 L 18,24 C 18,26 20,27 22,27 C 25,27 28,24 28,21 C 28,17 23,14 20,14 C 21,13 22,12 22,10 C 22,7 19,4 16,4 Z" fill="#111111"/>
</g>
<!-- Centre: large suit, 64x64 in 256x384 card -->
<g transform="translate(96 160) scale(2)">
<path d="M16,4 C 13,4 10,7 10,10 C 10,12 11,13 12,14 C 9,14 4,17 4,21 C 4,24 7,27 10,27 C 12,27 14,26 14,24 L 13,30 L 19,30 L 18,24 C 18,26 20,27 22,27 C 25,27 28,24 28,21 C 28,17 23,14 20,14 C 21,13 22,12 22,10 C 22,7 19,4 16,4 Z" fill="#111111"/>
</g>
<!-- Bottom-right corner: mirrored via 180° rotation around card centre -->
<g transform="rotate(180 128 192)">
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#111111">7</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,4 C 13,4 10,7 10,10 C 10,12 11,13 12,14 C 9,14 4,17 4,21 C 4,24 7,27 10,27 C 12,27 14,26 14,24 L 13,30 L 19,30 L 18,24 C 18,26 20,27 22,27 C 25,27 28,24 28,21 C 28,17 23,14 20,14 C 21,13 22,12 22,10 C 22,7 19,4 16,4 Z" fill="#111111"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

@@ -0,0 +1,25 @@
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="384" viewBox="0 0 256 384">
<rect x="2" y="2" width="252" height="380" rx="14" ry="14"
fill="#FAFAF8" stroke="#AAAAAA" stroke-width="1.5"/>
<!-- Top-left corner: rank label + small suit -->
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#111111">8</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,4 C 13,4 10,7 10,10 C 10,12 11,13 12,14 C 9,14 4,17 4,21 C 4,24 7,27 10,27 C 12,27 14,26 14,24 L 13,30 L 19,30 L 18,24 C 18,26 20,27 22,27 C 25,27 28,24 28,21 C 28,17 23,14 20,14 C 21,13 22,12 22,10 C 22,7 19,4 16,4 Z" fill="#111111"/>
</g>
<!-- Centre: large suit, 64x64 in 256x384 card -->
<g transform="translate(96 160) scale(2)">
<path d="M16,4 C 13,4 10,7 10,10 C 10,12 11,13 12,14 C 9,14 4,17 4,21 C 4,24 7,27 10,27 C 12,27 14,26 14,24 L 13,30 L 19,30 L 18,24 C 18,26 20,27 22,27 C 25,27 28,24 28,21 C 28,17 23,14 20,14 C 21,13 22,12 22,10 C 22,7 19,4 16,4 Z" fill="#111111"/>
</g>
<!-- Bottom-right corner: mirrored via 180° rotation around card centre -->
<g transform="rotate(180 128 192)">
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#111111">8</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,4 C 13,4 10,7 10,10 C 10,12 11,13 12,14 C 9,14 4,17 4,21 C 4,24 7,27 10,27 C 12,27 14,26 14,24 L 13,30 L 19,30 L 18,24 C 18,26 20,27 22,27 C 25,27 28,24 28,21 C 28,17 23,14 20,14 C 21,13 22,12 22,10 C 22,7 19,4 16,4 Z" fill="#111111"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

@@ -0,0 +1,25 @@
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="384" viewBox="0 0 256 384">
<rect x="2" y="2" width="252" height="380" rx="14" ry="14"
fill="#FAFAF8" stroke="#AAAAAA" stroke-width="1.5"/>
<!-- Top-left corner: rank label + small suit -->
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#111111">9</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,4 C 13,4 10,7 10,10 C 10,12 11,13 12,14 C 9,14 4,17 4,21 C 4,24 7,27 10,27 C 12,27 14,26 14,24 L 13,30 L 19,30 L 18,24 C 18,26 20,27 22,27 C 25,27 28,24 28,21 C 28,17 23,14 20,14 C 21,13 22,12 22,10 C 22,7 19,4 16,4 Z" fill="#111111"/>
</g>
<!-- Centre: large suit, 64x64 in 256x384 card -->
<g transform="translate(96 160) scale(2)">
<path d="M16,4 C 13,4 10,7 10,10 C 10,12 11,13 12,14 C 9,14 4,17 4,21 C 4,24 7,27 10,27 C 12,27 14,26 14,24 L 13,30 L 19,30 L 18,24 C 18,26 20,27 22,27 C 25,27 28,24 28,21 C 28,17 23,14 20,14 C 21,13 22,12 22,10 C 22,7 19,4 16,4 Z" fill="#111111"/>
</g>
<!-- Bottom-right corner: mirrored via 180° rotation around card centre -->
<g transform="rotate(180 128 192)">
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#111111">9</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,4 C 13,4 10,7 10,10 C 10,12 11,13 12,14 C 9,14 4,17 4,21 C 4,24 7,27 10,27 C 12,27 14,26 14,24 L 13,30 L 19,30 L 18,24 C 18,26 20,27 22,27 C 25,27 28,24 28,21 C 28,17 23,14 20,14 C 21,13 22,12 22,10 C 22,7 19,4 16,4 Z" fill="#111111"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

@@ -0,0 +1,25 @@
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="384" viewBox="0 0 256 384">
<rect x="2" y="2" width="252" height="380" rx="14" ry="14"
fill="#FAFAF8" stroke="#AAAAAA" stroke-width="1.5"/>
<!-- Top-left corner: rank label + small suit -->
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#111111">A</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,4 C 13,4 10,7 10,10 C 10,12 11,13 12,14 C 9,14 4,17 4,21 C 4,24 7,27 10,27 C 12,27 14,26 14,24 L 13,30 L 19,30 L 18,24 C 18,26 20,27 22,27 C 25,27 28,24 28,21 C 28,17 23,14 20,14 C 21,13 22,12 22,10 C 22,7 19,4 16,4 Z" fill="#111111"/>
</g>
<!-- Centre: large suit, 64x64 in 256x384 card -->
<g transform="translate(96 160) scale(2)">
<path d="M16,4 C 13,4 10,7 10,10 C 10,12 11,13 12,14 C 9,14 4,17 4,21 C 4,24 7,27 10,27 C 12,27 14,26 14,24 L 13,30 L 19,30 L 18,24 C 18,26 20,27 22,27 C 25,27 28,24 28,21 C 28,17 23,14 20,14 C 21,13 22,12 22,10 C 22,7 19,4 16,4 Z" fill="#111111"/>
</g>
<!-- Bottom-right corner: mirrored via 180° rotation around card centre -->
<g transform="rotate(180 128 192)">
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#111111">A</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,4 C 13,4 10,7 10,10 C 10,12 11,13 12,14 C 9,14 4,17 4,21 C 4,24 7,27 10,27 C 12,27 14,26 14,24 L 13,30 L 19,30 L 18,24 C 18,26 20,27 22,27 C 25,27 28,24 28,21 C 28,17 23,14 20,14 C 21,13 22,12 22,10 C 22,7 19,4 16,4 Z" fill="#111111"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

@@ -0,0 +1,25 @@
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="384" viewBox="0 0 256 384">
<rect x="2" y="2" width="252" height="380" rx="14" ry="14"
fill="#FAFAF8" stroke="#AAAAAA" stroke-width="1.5"/>
<!-- Top-left corner: rank label + small suit -->
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#111111">J</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,4 C 13,4 10,7 10,10 C 10,12 11,13 12,14 C 9,14 4,17 4,21 C 4,24 7,27 10,27 C 12,27 14,26 14,24 L 13,30 L 19,30 L 18,24 C 18,26 20,27 22,27 C 25,27 28,24 28,21 C 28,17 23,14 20,14 C 21,13 22,12 22,10 C 22,7 19,4 16,4 Z" fill="#111111"/>
</g>
<!-- Centre: large suit, 64x64 in 256x384 card -->
<g transform="translate(96 160) scale(2)">
<path d="M16,4 C 13,4 10,7 10,10 C 10,12 11,13 12,14 C 9,14 4,17 4,21 C 4,24 7,27 10,27 C 12,27 14,26 14,24 L 13,30 L 19,30 L 18,24 C 18,26 20,27 22,27 C 25,27 28,24 28,21 C 28,17 23,14 20,14 C 21,13 22,12 22,10 C 22,7 19,4 16,4 Z" fill="#111111"/>
</g>
<!-- Bottom-right corner: mirrored via 180° rotation around card centre -->
<g transform="rotate(180 128 192)">
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#111111">J</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,4 C 13,4 10,7 10,10 C 10,12 11,13 12,14 C 9,14 4,17 4,21 C 4,24 7,27 10,27 C 12,27 14,26 14,24 L 13,30 L 19,30 L 18,24 C 18,26 20,27 22,27 C 25,27 28,24 28,21 C 28,17 23,14 20,14 C 21,13 22,12 22,10 C 22,7 19,4 16,4 Z" fill="#111111"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

@@ -0,0 +1,25 @@
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="384" viewBox="0 0 256 384">
<rect x="2" y="2" width="252" height="380" rx="14" ry="14"
fill="#FAFAF8" stroke="#AAAAAA" stroke-width="1.5"/>
<!-- Top-left corner: rank label + small suit -->
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#111111">K</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,4 C 13,4 10,7 10,10 C 10,12 11,13 12,14 C 9,14 4,17 4,21 C 4,24 7,27 10,27 C 12,27 14,26 14,24 L 13,30 L 19,30 L 18,24 C 18,26 20,27 22,27 C 25,27 28,24 28,21 C 28,17 23,14 20,14 C 21,13 22,12 22,10 C 22,7 19,4 16,4 Z" fill="#111111"/>
</g>
<!-- Centre: large suit, 64x64 in 256x384 card -->
<g transform="translate(96 160) scale(2)">
<path d="M16,4 C 13,4 10,7 10,10 C 10,12 11,13 12,14 C 9,14 4,17 4,21 C 4,24 7,27 10,27 C 12,27 14,26 14,24 L 13,30 L 19,30 L 18,24 C 18,26 20,27 22,27 C 25,27 28,24 28,21 C 28,17 23,14 20,14 C 21,13 22,12 22,10 C 22,7 19,4 16,4 Z" fill="#111111"/>
</g>
<!-- Bottom-right corner: mirrored via 180° rotation around card centre -->
<g transform="rotate(180 128 192)">
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#111111">K</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,4 C 13,4 10,7 10,10 C 10,12 11,13 12,14 C 9,14 4,17 4,21 C 4,24 7,27 10,27 C 12,27 14,26 14,24 L 13,30 L 19,30 L 18,24 C 18,26 20,27 22,27 C 25,27 28,24 28,21 C 28,17 23,14 20,14 C 21,13 22,12 22,10 C 22,7 19,4 16,4 Z" fill="#111111"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

@@ -0,0 +1,25 @@
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="384" viewBox="0 0 256 384">
<rect x="2" y="2" width="252" height="380" rx="14" ry="14"
fill="#FAFAF8" stroke="#AAAAAA" stroke-width="1.5"/>
<!-- Top-left corner: rank label + small suit -->
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#111111">Q</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,4 C 13,4 10,7 10,10 C 10,12 11,13 12,14 C 9,14 4,17 4,21 C 4,24 7,27 10,27 C 12,27 14,26 14,24 L 13,30 L 19,30 L 18,24 C 18,26 20,27 22,27 C 25,27 28,24 28,21 C 28,17 23,14 20,14 C 21,13 22,12 22,10 C 22,7 19,4 16,4 Z" fill="#111111"/>
</g>
<!-- Centre: large suit, 64x64 in 256x384 card -->
<g transform="translate(96 160) scale(2)">
<path d="M16,4 C 13,4 10,7 10,10 C 10,12 11,13 12,14 C 9,14 4,17 4,21 C 4,24 7,27 10,27 C 12,27 14,26 14,24 L 13,30 L 19,30 L 18,24 C 18,26 20,27 22,27 C 25,27 28,24 28,21 C 28,17 23,14 20,14 C 21,13 22,12 22,10 C 22,7 19,4 16,4 Z" fill="#111111"/>
</g>
<!-- Bottom-right corner: mirrored via 180° rotation around card centre -->
<g transform="rotate(180 128 192)">
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#111111">Q</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,4 C 13,4 10,7 10,10 C 10,12 11,13 12,14 C 9,14 4,17 4,21 C 4,24 7,27 10,27 C 12,27 14,26 14,24 L 13,30 L 19,30 L 18,24 C 18,26 20,27 22,27 C 25,27 28,24 28,21 C 28,17 23,14 20,14 C 21,13 22,12 22,10 C 22,7 19,4 16,4 Z" fill="#111111"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

@@ -0,0 +1,25 @@
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="384" viewBox="0 0 256 384">
<rect x="2" y="2" width="252" height="380" rx="14" ry="14"
fill="#FAFAF8" stroke="#AAAAAA" stroke-width="1.5"/>
<!-- Top-left corner: rank label + small suit -->
<text x="11" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#CC1111">10</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,2 L 30,16 L 16,30 L 2,16 Z" fill="#CC1111"/>
</g>
<!-- Centre: large suit, 64x64 in 256x384 card -->
<g transform="translate(96 160) scale(2)">
<path d="M16,2 L 30,16 L 16,30 L 2,16 Z" fill="#CC1111"/>
</g>
<!-- Bottom-right corner: mirrored via 180° rotation around card centre -->
<g transform="rotate(180 128 192)">
<text x="11" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#CC1111">10</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,2 L 30,16 L 16,30 L 2,16 Z" fill="#CC1111"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

@@ -0,0 +1,25 @@
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="384" viewBox="0 0 256 384">
<rect x="2" y="2" width="252" height="380" rx="14" ry="14"
fill="#FAFAF8" stroke="#AAAAAA" stroke-width="1.5"/>
<!-- Top-left corner: rank label + small suit -->
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#CC1111">2</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,2 L 30,16 L 16,30 L 2,16 Z" fill="#CC1111"/>
</g>
<!-- Centre: large suit, 64x64 in 256x384 card -->
<g transform="translate(96 160) scale(2)">
<path d="M16,2 L 30,16 L 16,30 L 2,16 Z" fill="#CC1111"/>
</g>
<!-- Bottom-right corner: mirrored via 180° rotation around card centre -->
<g transform="rotate(180 128 192)">
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#CC1111">2</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,2 L 30,16 L 16,30 L 2,16 Z" fill="#CC1111"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

@@ -0,0 +1,25 @@
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="384" viewBox="0 0 256 384">
<rect x="2" y="2" width="252" height="380" rx="14" ry="14"
fill="#FAFAF8" stroke="#AAAAAA" stroke-width="1.5"/>
<!-- Top-left corner: rank label + small suit -->
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#CC1111">3</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,2 L 30,16 L 16,30 L 2,16 Z" fill="#CC1111"/>
</g>
<!-- Centre: large suit, 64x64 in 256x384 card -->
<g transform="translate(96 160) scale(2)">
<path d="M16,2 L 30,16 L 16,30 L 2,16 Z" fill="#CC1111"/>
</g>
<!-- Bottom-right corner: mirrored via 180° rotation around card centre -->
<g transform="rotate(180 128 192)">
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#CC1111">3</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,2 L 30,16 L 16,30 L 2,16 Z" fill="#CC1111"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

@@ -0,0 +1,25 @@
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="384" viewBox="0 0 256 384">
<rect x="2" y="2" width="252" height="380" rx="14" ry="14"
fill="#FAFAF8" stroke="#AAAAAA" stroke-width="1.5"/>
<!-- Top-left corner: rank label + small suit -->
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#CC1111">4</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,2 L 30,16 L 16,30 L 2,16 Z" fill="#CC1111"/>
</g>
<!-- Centre: large suit, 64x64 in 256x384 card -->
<g transform="translate(96 160) scale(2)">
<path d="M16,2 L 30,16 L 16,30 L 2,16 Z" fill="#CC1111"/>
</g>
<!-- Bottom-right corner: mirrored via 180° rotation around card centre -->
<g transform="rotate(180 128 192)">
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#CC1111">4</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,2 L 30,16 L 16,30 L 2,16 Z" fill="#CC1111"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

@@ -0,0 +1,25 @@
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="384" viewBox="0 0 256 384">
<rect x="2" y="2" width="252" height="380" rx="14" ry="14"
fill="#FAFAF8" stroke="#AAAAAA" stroke-width="1.5"/>
<!-- Top-left corner: rank label + small suit -->
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#CC1111">5</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,2 L 30,16 L 16,30 L 2,16 Z" fill="#CC1111"/>
</g>
<!-- Centre: large suit, 64x64 in 256x384 card -->
<g transform="translate(96 160) scale(2)">
<path d="M16,2 L 30,16 L 16,30 L 2,16 Z" fill="#CC1111"/>
</g>
<!-- Bottom-right corner: mirrored via 180° rotation around card centre -->
<g transform="rotate(180 128 192)">
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#CC1111">5</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,2 L 30,16 L 16,30 L 2,16 Z" fill="#CC1111"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

@@ -0,0 +1,25 @@
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="384" viewBox="0 0 256 384">
<rect x="2" y="2" width="252" height="380" rx="14" ry="14"
fill="#FAFAF8" stroke="#AAAAAA" stroke-width="1.5"/>
<!-- Top-left corner: rank label + small suit -->
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#CC1111">6</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,2 L 30,16 L 16,30 L 2,16 Z" fill="#CC1111"/>
</g>
<!-- Centre: large suit, 64x64 in 256x384 card -->
<g transform="translate(96 160) scale(2)">
<path d="M16,2 L 30,16 L 16,30 L 2,16 Z" fill="#CC1111"/>
</g>
<!-- Bottom-right corner: mirrored via 180° rotation around card centre -->
<g transform="rotate(180 128 192)">
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#CC1111">6</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,2 L 30,16 L 16,30 L 2,16 Z" fill="#CC1111"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

@@ -0,0 +1,25 @@
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="384" viewBox="0 0 256 384">
<rect x="2" y="2" width="252" height="380" rx="14" ry="14"
fill="#FAFAF8" stroke="#AAAAAA" stroke-width="1.5"/>
<!-- Top-left corner: rank label + small suit -->
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#CC1111">7</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,2 L 30,16 L 16,30 L 2,16 Z" fill="#CC1111"/>
</g>
<!-- Centre: large suit, 64x64 in 256x384 card -->
<g transform="translate(96 160) scale(2)">
<path d="M16,2 L 30,16 L 16,30 L 2,16 Z" fill="#CC1111"/>
</g>
<!-- Bottom-right corner: mirrored via 180° rotation around card centre -->
<g transform="rotate(180 128 192)">
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#CC1111">7</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,2 L 30,16 L 16,30 L 2,16 Z" fill="#CC1111"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

@@ -0,0 +1,25 @@
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="384" viewBox="0 0 256 384">
<rect x="2" y="2" width="252" height="380" rx="14" ry="14"
fill="#FAFAF8" stroke="#AAAAAA" stroke-width="1.5"/>
<!-- Top-left corner: rank label + small suit -->
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#CC1111">8</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,2 L 30,16 L 16,30 L 2,16 Z" fill="#CC1111"/>
</g>
<!-- Centre: large suit, 64x64 in 256x384 card -->
<g transform="translate(96 160) scale(2)">
<path d="M16,2 L 30,16 L 16,30 L 2,16 Z" fill="#CC1111"/>
</g>
<!-- Bottom-right corner: mirrored via 180° rotation around card centre -->
<g transform="rotate(180 128 192)">
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#CC1111">8</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,2 L 30,16 L 16,30 L 2,16 Z" fill="#CC1111"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

@@ -0,0 +1,25 @@
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="384" viewBox="0 0 256 384">
<rect x="2" y="2" width="252" height="380" rx="14" ry="14"
fill="#FAFAF8" stroke="#AAAAAA" stroke-width="1.5"/>
<!-- Top-left corner: rank label + small suit -->
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#CC1111">9</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,2 L 30,16 L 16,30 L 2,16 Z" fill="#CC1111"/>
</g>
<!-- Centre: large suit, 64x64 in 256x384 card -->
<g transform="translate(96 160) scale(2)">
<path d="M16,2 L 30,16 L 16,30 L 2,16 Z" fill="#CC1111"/>
</g>
<!-- Bottom-right corner: mirrored via 180° rotation around card centre -->
<g transform="rotate(180 128 192)">
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#CC1111">9</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,2 L 30,16 L 16,30 L 2,16 Z" fill="#CC1111"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

@@ -0,0 +1,25 @@
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="384" viewBox="0 0 256 384">
<rect x="2" y="2" width="252" height="380" rx="14" ry="14"
fill="#FAFAF8" stroke="#AAAAAA" stroke-width="1.5"/>
<!-- Top-left corner: rank label + small suit -->
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#CC1111">A</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,2 L 30,16 L 16,30 L 2,16 Z" fill="#CC1111"/>
</g>
<!-- Centre: large suit, 64x64 in 256x384 card -->
<g transform="translate(96 160) scale(2)">
<path d="M16,2 L 30,16 L 16,30 L 2,16 Z" fill="#CC1111"/>
</g>
<!-- Bottom-right corner: mirrored via 180° rotation around card centre -->
<g transform="rotate(180 128 192)">
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#CC1111">A</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,2 L 30,16 L 16,30 L 2,16 Z" fill="#CC1111"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

@@ -0,0 +1,25 @@
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="384" viewBox="0 0 256 384">
<rect x="2" y="2" width="252" height="380" rx="14" ry="14"
fill="#FAFAF8" stroke="#AAAAAA" stroke-width="1.5"/>
<!-- Top-left corner: rank label + small suit -->
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#CC1111">J</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,2 L 30,16 L 16,30 L 2,16 Z" fill="#CC1111"/>
</g>
<!-- Centre: large suit, 64x64 in 256x384 card -->
<g transform="translate(96 160) scale(2)">
<path d="M16,2 L 30,16 L 16,30 L 2,16 Z" fill="#CC1111"/>
</g>
<!-- Bottom-right corner: mirrored via 180° rotation around card centre -->
<g transform="rotate(180 128 192)">
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#CC1111">J</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,2 L 30,16 L 16,30 L 2,16 Z" fill="#CC1111"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

@@ -0,0 +1,25 @@
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="384" viewBox="0 0 256 384">
<rect x="2" y="2" width="252" height="380" rx="14" ry="14"
fill="#FAFAF8" stroke="#AAAAAA" stroke-width="1.5"/>
<!-- Top-left corner: rank label + small suit -->
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#CC1111">K</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,2 L 30,16 L 16,30 L 2,16 Z" fill="#CC1111"/>
</g>
<!-- Centre: large suit, 64x64 in 256x384 card -->
<g transform="translate(96 160) scale(2)">
<path d="M16,2 L 30,16 L 16,30 L 2,16 Z" fill="#CC1111"/>
</g>
<!-- Bottom-right corner: mirrored via 180° rotation around card centre -->
<g transform="rotate(180 128 192)">
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#CC1111">K</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,2 L 30,16 L 16,30 L 2,16 Z" fill="#CC1111"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

@@ -0,0 +1,25 @@
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="384" viewBox="0 0 256 384">
<rect x="2" y="2" width="252" height="380" rx="14" ry="14"
fill="#FAFAF8" stroke="#AAAAAA" stroke-width="1.5"/>
<!-- Top-left corner: rank label + small suit -->
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#CC1111">Q</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,2 L 30,16 L 16,30 L 2,16 Z" fill="#CC1111"/>
</g>
<!-- Centre: large suit, 64x64 in 256x384 card -->
<g transform="translate(96 160) scale(2)">
<path d="M16,2 L 30,16 L 16,30 L 2,16 Z" fill="#CC1111"/>
</g>
<!-- Bottom-right corner: mirrored via 180° rotation around card centre -->
<g transform="rotate(180 128 192)">
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#CC1111">Q</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,2 L 30,16 L 16,30 L 2,16 Z" fill="#CC1111"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

@@ -0,0 +1,25 @@
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="384" viewBox="0 0 256 384">
<rect x="2" y="2" width="252" height="380" rx="14" ry="14"
fill="#FAFAF8" stroke="#AAAAAA" stroke-width="1.5"/>
<!-- Top-left corner: rank label + small suit -->
<text x="11" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#CC1111">10</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,28 C 8,22 2,17 2,11 C 2,7 5,4 9,4 C 12,4 14,6 16,9 C 18,6 20,4 23,4 C 27,4 30,7 30,11 C 30,17 24,22 16,28 Z" fill="#CC1111"/>
</g>
<!-- Centre: large suit, 64x64 in 256x384 card -->
<g transform="translate(96 160) scale(2)">
<path d="M16,28 C 8,22 2,17 2,11 C 2,7 5,4 9,4 C 12,4 14,6 16,9 C 18,6 20,4 23,4 C 27,4 30,7 30,11 C 30,17 24,22 16,28 Z" fill="#CC1111"/>
</g>
<!-- Bottom-right corner: mirrored via 180° rotation around card centre -->
<g transform="rotate(180 128 192)">
<text x="11" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#CC1111">10</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,28 C 8,22 2,17 2,11 C 2,7 5,4 9,4 C 12,4 14,6 16,9 C 18,6 20,4 23,4 C 27,4 30,7 30,11 C 30,17 24,22 16,28 Z" fill="#CC1111"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

@@ -0,0 +1,25 @@
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="384" viewBox="0 0 256 384">
<rect x="2" y="2" width="252" height="380" rx="14" ry="14"
fill="#FAFAF8" stroke="#AAAAAA" stroke-width="1.5"/>
<!-- Top-left corner: rank label + small suit -->
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#CC1111">2</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,28 C 8,22 2,17 2,11 C 2,7 5,4 9,4 C 12,4 14,6 16,9 C 18,6 20,4 23,4 C 27,4 30,7 30,11 C 30,17 24,22 16,28 Z" fill="#CC1111"/>
</g>
<!-- Centre: large suit, 64x64 in 256x384 card -->
<g transform="translate(96 160) scale(2)">
<path d="M16,28 C 8,22 2,17 2,11 C 2,7 5,4 9,4 C 12,4 14,6 16,9 C 18,6 20,4 23,4 C 27,4 30,7 30,11 C 30,17 24,22 16,28 Z" fill="#CC1111"/>
</g>
<!-- Bottom-right corner: mirrored via 180° rotation around card centre -->
<g transform="rotate(180 128 192)">
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#CC1111">2</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,28 C 8,22 2,17 2,11 C 2,7 5,4 9,4 C 12,4 14,6 16,9 C 18,6 20,4 23,4 C 27,4 30,7 30,11 C 30,17 24,22 16,28 Z" fill="#CC1111"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

@@ -0,0 +1,25 @@
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="384" viewBox="0 0 256 384">
<rect x="2" y="2" width="252" height="380" rx="14" ry="14"
fill="#FAFAF8" stroke="#AAAAAA" stroke-width="1.5"/>
<!-- Top-left corner: rank label + small suit -->
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#CC1111">3</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,28 C 8,22 2,17 2,11 C 2,7 5,4 9,4 C 12,4 14,6 16,9 C 18,6 20,4 23,4 C 27,4 30,7 30,11 C 30,17 24,22 16,28 Z" fill="#CC1111"/>
</g>
<!-- Centre: large suit, 64x64 in 256x384 card -->
<g transform="translate(96 160) scale(2)">
<path d="M16,28 C 8,22 2,17 2,11 C 2,7 5,4 9,4 C 12,4 14,6 16,9 C 18,6 20,4 23,4 C 27,4 30,7 30,11 C 30,17 24,22 16,28 Z" fill="#CC1111"/>
</g>
<!-- Bottom-right corner: mirrored via 180° rotation around card centre -->
<g transform="rotate(180 128 192)">
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#CC1111">3</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,28 C 8,22 2,17 2,11 C 2,7 5,4 9,4 C 12,4 14,6 16,9 C 18,6 20,4 23,4 C 27,4 30,7 30,11 C 30,17 24,22 16,28 Z" fill="#CC1111"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

@@ -0,0 +1,25 @@
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="384" viewBox="0 0 256 384">
<rect x="2" y="2" width="252" height="380" rx="14" ry="14"
fill="#FAFAF8" stroke="#AAAAAA" stroke-width="1.5"/>
<!-- Top-left corner: rank label + small suit -->
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#CC1111">4</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,28 C 8,22 2,17 2,11 C 2,7 5,4 9,4 C 12,4 14,6 16,9 C 18,6 20,4 23,4 C 27,4 30,7 30,11 C 30,17 24,22 16,28 Z" fill="#CC1111"/>
</g>
<!-- Centre: large suit, 64x64 in 256x384 card -->
<g transform="translate(96 160) scale(2)">
<path d="M16,28 C 8,22 2,17 2,11 C 2,7 5,4 9,4 C 12,4 14,6 16,9 C 18,6 20,4 23,4 C 27,4 30,7 30,11 C 30,17 24,22 16,28 Z" fill="#CC1111"/>
</g>
<!-- Bottom-right corner: mirrored via 180° rotation around card centre -->
<g transform="rotate(180 128 192)">
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#CC1111">4</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,28 C 8,22 2,17 2,11 C 2,7 5,4 9,4 C 12,4 14,6 16,9 C 18,6 20,4 23,4 C 27,4 30,7 30,11 C 30,17 24,22 16,28 Z" fill="#CC1111"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

@@ -0,0 +1,25 @@
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="384" viewBox="0 0 256 384">
<rect x="2" y="2" width="252" height="380" rx="14" ry="14"
fill="#FAFAF8" stroke="#AAAAAA" stroke-width="1.5"/>
<!-- Top-left corner: rank label + small suit -->
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#CC1111">5</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,28 C 8,22 2,17 2,11 C 2,7 5,4 9,4 C 12,4 14,6 16,9 C 18,6 20,4 23,4 C 27,4 30,7 30,11 C 30,17 24,22 16,28 Z" fill="#CC1111"/>
</g>
<!-- Centre: large suit, 64x64 in 256x384 card -->
<g transform="translate(96 160) scale(2)">
<path d="M16,28 C 8,22 2,17 2,11 C 2,7 5,4 9,4 C 12,4 14,6 16,9 C 18,6 20,4 23,4 C 27,4 30,7 30,11 C 30,17 24,22 16,28 Z" fill="#CC1111"/>
</g>
<!-- Bottom-right corner: mirrored via 180° rotation around card centre -->
<g transform="rotate(180 128 192)">
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#CC1111">5</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,28 C 8,22 2,17 2,11 C 2,7 5,4 9,4 C 12,4 14,6 16,9 C 18,6 20,4 23,4 C 27,4 30,7 30,11 C 30,17 24,22 16,28 Z" fill="#CC1111"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

@@ -0,0 +1,25 @@
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="384" viewBox="0 0 256 384">
<rect x="2" y="2" width="252" height="380" rx="14" ry="14"
fill="#FAFAF8" stroke="#AAAAAA" stroke-width="1.5"/>
<!-- Top-left corner: rank label + small suit -->
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#CC1111">6</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,28 C 8,22 2,17 2,11 C 2,7 5,4 9,4 C 12,4 14,6 16,9 C 18,6 20,4 23,4 C 27,4 30,7 30,11 C 30,17 24,22 16,28 Z" fill="#CC1111"/>
</g>
<!-- Centre: large suit, 64x64 in 256x384 card -->
<g transform="translate(96 160) scale(2)">
<path d="M16,28 C 8,22 2,17 2,11 C 2,7 5,4 9,4 C 12,4 14,6 16,9 C 18,6 20,4 23,4 C 27,4 30,7 30,11 C 30,17 24,22 16,28 Z" fill="#CC1111"/>
</g>
<!-- Bottom-right corner: mirrored via 180° rotation around card centre -->
<g transform="rotate(180 128 192)">
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#CC1111">6</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,28 C 8,22 2,17 2,11 C 2,7 5,4 9,4 C 12,4 14,6 16,9 C 18,6 20,4 23,4 C 27,4 30,7 30,11 C 30,17 24,22 16,28 Z" fill="#CC1111"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

@@ -0,0 +1,25 @@
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="384" viewBox="0 0 256 384">
<rect x="2" y="2" width="252" height="380" rx="14" ry="14"
fill="#FAFAF8" stroke="#AAAAAA" stroke-width="1.5"/>
<!-- Top-left corner: rank label + small suit -->
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#CC1111">7</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,28 C 8,22 2,17 2,11 C 2,7 5,4 9,4 C 12,4 14,6 16,9 C 18,6 20,4 23,4 C 27,4 30,7 30,11 C 30,17 24,22 16,28 Z" fill="#CC1111"/>
</g>
<!-- Centre: large suit, 64x64 in 256x384 card -->
<g transform="translate(96 160) scale(2)">
<path d="M16,28 C 8,22 2,17 2,11 C 2,7 5,4 9,4 C 12,4 14,6 16,9 C 18,6 20,4 23,4 C 27,4 30,7 30,11 C 30,17 24,22 16,28 Z" fill="#CC1111"/>
</g>
<!-- Bottom-right corner: mirrored via 180° rotation around card centre -->
<g transform="rotate(180 128 192)">
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#CC1111">7</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,28 C 8,22 2,17 2,11 C 2,7 5,4 9,4 C 12,4 14,6 16,9 C 18,6 20,4 23,4 C 27,4 30,7 30,11 C 30,17 24,22 16,28 Z" fill="#CC1111"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

@@ -0,0 +1,25 @@
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="384" viewBox="0 0 256 384">
<rect x="2" y="2" width="252" height="380" rx="14" ry="14"
fill="#FAFAF8" stroke="#AAAAAA" stroke-width="1.5"/>
<!-- Top-left corner: rank label + small suit -->
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#CC1111">8</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,28 C 8,22 2,17 2,11 C 2,7 5,4 9,4 C 12,4 14,6 16,9 C 18,6 20,4 23,4 C 27,4 30,7 30,11 C 30,17 24,22 16,28 Z" fill="#CC1111"/>
</g>
<!-- Centre: large suit, 64x64 in 256x384 card -->
<g transform="translate(96 160) scale(2)">
<path d="M16,28 C 8,22 2,17 2,11 C 2,7 5,4 9,4 C 12,4 14,6 16,9 C 18,6 20,4 23,4 C 27,4 30,7 30,11 C 30,17 24,22 16,28 Z" fill="#CC1111"/>
</g>
<!-- Bottom-right corner: mirrored via 180° rotation around card centre -->
<g transform="rotate(180 128 192)">
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#CC1111">8</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,28 C 8,22 2,17 2,11 C 2,7 5,4 9,4 C 12,4 14,6 16,9 C 18,6 20,4 23,4 C 27,4 30,7 30,11 C 30,17 24,22 16,28 Z" fill="#CC1111"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

@@ -0,0 +1,25 @@
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="384" viewBox="0 0 256 384">
<rect x="2" y="2" width="252" height="380" rx="14" ry="14"
fill="#FAFAF8" stroke="#AAAAAA" stroke-width="1.5"/>
<!-- Top-left corner: rank label + small suit -->
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#CC1111">9</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,28 C 8,22 2,17 2,11 C 2,7 5,4 9,4 C 12,4 14,6 16,9 C 18,6 20,4 23,4 C 27,4 30,7 30,11 C 30,17 24,22 16,28 Z" fill="#CC1111"/>
</g>
<!-- Centre: large suit, 64x64 in 256x384 card -->
<g transform="translate(96 160) scale(2)">
<path d="M16,28 C 8,22 2,17 2,11 C 2,7 5,4 9,4 C 12,4 14,6 16,9 C 18,6 20,4 23,4 C 27,4 30,7 30,11 C 30,17 24,22 16,28 Z" fill="#CC1111"/>
</g>
<!-- Bottom-right corner: mirrored via 180° rotation around card centre -->
<g transform="rotate(180 128 192)">
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#CC1111">9</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,28 C 8,22 2,17 2,11 C 2,7 5,4 9,4 C 12,4 14,6 16,9 C 18,6 20,4 23,4 C 27,4 30,7 30,11 C 30,17 24,22 16,28 Z" fill="#CC1111"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

@@ -0,0 +1,25 @@
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="384" viewBox="0 0 256 384">
<rect x="2" y="2" width="252" height="380" rx="14" ry="14"
fill="#FAFAF8" stroke="#AAAAAA" stroke-width="1.5"/>
<!-- Top-left corner: rank label + small suit -->
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#CC1111">A</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,28 C 8,22 2,17 2,11 C 2,7 5,4 9,4 C 12,4 14,6 16,9 C 18,6 20,4 23,4 C 27,4 30,7 30,11 C 30,17 24,22 16,28 Z" fill="#CC1111"/>
</g>
<!-- Centre: large suit, 64x64 in 256x384 card -->
<g transform="translate(96 160) scale(2)">
<path d="M16,28 C 8,22 2,17 2,11 C 2,7 5,4 9,4 C 12,4 14,6 16,9 C 18,6 20,4 23,4 C 27,4 30,7 30,11 C 30,17 24,22 16,28 Z" fill="#CC1111"/>
</g>
<!-- Bottom-right corner: mirrored via 180° rotation around card centre -->
<g transform="rotate(180 128 192)">
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#CC1111">A</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,28 C 8,22 2,17 2,11 C 2,7 5,4 9,4 C 12,4 14,6 16,9 C 18,6 20,4 23,4 C 27,4 30,7 30,11 C 30,17 24,22 16,28 Z" fill="#CC1111"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

@@ -0,0 +1,25 @@
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="384" viewBox="0 0 256 384">
<rect x="2" y="2" width="252" height="380" rx="14" ry="14"
fill="#FAFAF8" stroke="#AAAAAA" stroke-width="1.5"/>
<!-- Top-left corner: rank label + small suit -->
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#CC1111">J</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,28 C 8,22 2,17 2,11 C 2,7 5,4 9,4 C 12,4 14,6 16,9 C 18,6 20,4 23,4 C 27,4 30,7 30,11 C 30,17 24,22 16,28 Z" fill="#CC1111"/>
</g>
<!-- Centre: large suit, 64x64 in 256x384 card -->
<g transform="translate(96 160) scale(2)">
<path d="M16,28 C 8,22 2,17 2,11 C 2,7 5,4 9,4 C 12,4 14,6 16,9 C 18,6 20,4 23,4 C 27,4 30,7 30,11 C 30,17 24,22 16,28 Z" fill="#CC1111"/>
</g>
<!-- Bottom-right corner: mirrored via 180° rotation around card centre -->
<g transform="rotate(180 128 192)">
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#CC1111">J</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,28 C 8,22 2,17 2,11 C 2,7 5,4 9,4 C 12,4 14,6 16,9 C 18,6 20,4 23,4 C 27,4 30,7 30,11 C 30,17 24,22 16,28 Z" fill="#CC1111"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

@@ -0,0 +1,25 @@
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="384" viewBox="0 0 256 384">
<rect x="2" y="2" width="252" height="380" rx="14" ry="14"
fill="#FAFAF8" stroke="#AAAAAA" stroke-width="1.5"/>
<!-- Top-left corner: rank label + small suit -->
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#CC1111">K</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,28 C 8,22 2,17 2,11 C 2,7 5,4 9,4 C 12,4 14,6 16,9 C 18,6 20,4 23,4 C 27,4 30,7 30,11 C 30,17 24,22 16,28 Z" fill="#CC1111"/>
</g>
<!-- Centre: large suit, 64x64 in 256x384 card -->
<g transform="translate(96 160) scale(2)">
<path d="M16,28 C 8,22 2,17 2,11 C 2,7 5,4 9,4 C 12,4 14,6 16,9 C 18,6 20,4 23,4 C 27,4 30,7 30,11 C 30,17 24,22 16,28 Z" fill="#CC1111"/>
</g>
<!-- Bottom-right corner: mirrored via 180° rotation around card centre -->
<g transform="rotate(180 128 192)">
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#CC1111">K</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,28 C 8,22 2,17 2,11 C 2,7 5,4 9,4 C 12,4 14,6 16,9 C 18,6 20,4 23,4 C 27,4 30,7 30,11 C 30,17 24,22 16,28 Z" fill="#CC1111"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

@@ -0,0 +1,25 @@
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="384" viewBox="0 0 256 384">
<rect x="2" y="2" width="252" height="380" rx="14" ry="14"
fill="#FAFAF8" stroke="#AAAAAA" stroke-width="1.5"/>
<!-- Top-left corner: rank label + small suit -->
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#CC1111">Q</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,28 C 8,22 2,17 2,11 C 2,7 5,4 9,4 C 12,4 14,6 16,9 C 18,6 20,4 23,4 C 27,4 30,7 30,11 C 30,17 24,22 16,28 Z" fill="#CC1111"/>
</g>
<!-- Centre: large suit, 64x64 in 256x384 card -->
<g transform="translate(96 160) scale(2)">
<path d="M16,28 C 8,22 2,17 2,11 C 2,7 5,4 9,4 C 12,4 14,6 16,9 C 18,6 20,4 23,4 C 27,4 30,7 30,11 C 30,17 24,22 16,28 Z" fill="#CC1111"/>
</g>
<!-- Bottom-right corner: mirrored via 180° rotation around card centre -->
<g transform="rotate(180 128 192)">
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#CC1111">Q</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,28 C 8,22 2,17 2,11 C 2,7 5,4 9,4 C 12,4 14,6 16,9 C 18,6 20,4 23,4 C 27,4 30,7 30,11 C 30,17 24,22 16,28 Z" fill="#CC1111"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

@@ -0,0 +1,25 @@
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="384" viewBox="0 0 256 384">
<rect x="2" y="2" width="252" height="380" rx="14" ry="14"
fill="#FAFAF8" stroke="#AAAAAA" stroke-width="1.5"/>
<!-- Top-left corner: rank label + small suit -->
<text x="11" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#111111">10</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,4 C 9,9 2,14 2,21 C 2,25 5,28 9,28 C 13,28 14,26 14,24 L 13,30 L 19,30 L 18,24 C 18,26 19,28 23,28 C 27,28 30,25 30,21 C 30,14 23,9 16,4 Z" fill="#111111"/>
</g>
<!-- Centre: large suit, 64x64 in 256x384 card -->
<g transform="translate(96 160) scale(2)">
<path d="M16,4 C 9,9 2,14 2,21 C 2,25 5,28 9,28 C 13,28 14,26 14,24 L 13,30 L 19,30 L 18,24 C 18,26 19,28 23,28 C 27,28 30,25 30,21 C 30,14 23,9 16,4 Z" fill="#111111"/>
</g>
<!-- Bottom-right corner: mirrored via 180° rotation around card centre -->
<g transform="rotate(180 128 192)">
<text x="11" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#111111">10</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,4 C 9,9 2,14 2,21 C 2,25 5,28 9,28 C 13,28 14,26 14,24 L 13,30 L 19,30 L 18,24 C 18,26 19,28 23,28 C 27,28 30,25 30,21 C 30,14 23,9 16,4 Z" fill="#111111"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

@@ -0,0 +1,25 @@
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="384" viewBox="0 0 256 384">
<rect x="2" y="2" width="252" height="380" rx="14" ry="14"
fill="#FAFAF8" stroke="#AAAAAA" stroke-width="1.5"/>
<!-- Top-left corner: rank label + small suit -->
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#111111">2</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,4 C 9,9 2,14 2,21 C 2,25 5,28 9,28 C 13,28 14,26 14,24 L 13,30 L 19,30 L 18,24 C 18,26 19,28 23,28 C 27,28 30,25 30,21 C 30,14 23,9 16,4 Z" fill="#111111"/>
</g>
<!-- Centre: large suit, 64x64 in 256x384 card -->
<g transform="translate(96 160) scale(2)">
<path d="M16,4 C 9,9 2,14 2,21 C 2,25 5,28 9,28 C 13,28 14,26 14,24 L 13,30 L 19,30 L 18,24 C 18,26 19,28 23,28 C 27,28 30,25 30,21 C 30,14 23,9 16,4 Z" fill="#111111"/>
</g>
<!-- Bottom-right corner: mirrored via 180° rotation around card centre -->
<g transform="rotate(180 128 192)">
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#111111">2</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,4 C 9,9 2,14 2,21 C 2,25 5,28 9,28 C 13,28 14,26 14,24 L 13,30 L 19,30 L 18,24 C 18,26 19,28 23,28 C 27,28 30,25 30,21 C 30,14 23,9 16,4 Z" fill="#111111"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

@@ -0,0 +1,25 @@
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="384" viewBox="0 0 256 384">
<rect x="2" y="2" width="252" height="380" rx="14" ry="14"
fill="#FAFAF8" stroke="#AAAAAA" stroke-width="1.5"/>
<!-- Top-left corner: rank label + small suit -->
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#111111">3</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,4 C 9,9 2,14 2,21 C 2,25 5,28 9,28 C 13,28 14,26 14,24 L 13,30 L 19,30 L 18,24 C 18,26 19,28 23,28 C 27,28 30,25 30,21 C 30,14 23,9 16,4 Z" fill="#111111"/>
</g>
<!-- Centre: large suit, 64x64 in 256x384 card -->
<g transform="translate(96 160) scale(2)">
<path d="M16,4 C 9,9 2,14 2,21 C 2,25 5,28 9,28 C 13,28 14,26 14,24 L 13,30 L 19,30 L 18,24 C 18,26 19,28 23,28 C 27,28 30,25 30,21 C 30,14 23,9 16,4 Z" fill="#111111"/>
</g>
<!-- Bottom-right corner: mirrored via 180° rotation around card centre -->
<g transform="rotate(180 128 192)">
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#111111">3</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,4 C 9,9 2,14 2,21 C 2,25 5,28 9,28 C 13,28 14,26 14,24 L 13,30 L 19,30 L 18,24 C 18,26 19,28 23,28 C 27,28 30,25 30,21 C 30,14 23,9 16,4 Z" fill="#111111"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

@@ -0,0 +1,25 @@
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="384" viewBox="0 0 256 384">
<rect x="2" y="2" width="252" height="380" rx="14" ry="14"
fill="#FAFAF8" stroke="#AAAAAA" stroke-width="1.5"/>
<!-- Top-left corner: rank label + small suit -->
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#111111">4</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,4 C 9,9 2,14 2,21 C 2,25 5,28 9,28 C 13,28 14,26 14,24 L 13,30 L 19,30 L 18,24 C 18,26 19,28 23,28 C 27,28 30,25 30,21 C 30,14 23,9 16,4 Z" fill="#111111"/>
</g>
<!-- Centre: large suit, 64x64 in 256x384 card -->
<g transform="translate(96 160) scale(2)">
<path d="M16,4 C 9,9 2,14 2,21 C 2,25 5,28 9,28 C 13,28 14,26 14,24 L 13,30 L 19,30 L 18,24 C 18,26 19,28 23,28 C 27,28 30,25 30,21 C 30,14 23,9 16,4 Z" fill="#111111"/>
</g>
<!-- Bottom-right corner: mirrored via 180° rotation around card centre -->
<g transform="rotate(180 128 192)">
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#111111">4</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,4 C 9,9 2,14 2,21 C 2,25 5,28 9,28 C 13,28 14,26 14,24 L 13,30 L 19,30 L 18,24 C 18,26 19,28 23,28 C 27,28 30,25 30,21 C 30,14 23,9 16,4 Z" fill="#111111"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

@@ -0,0 +1,25 @@
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="384" viewBox="0 0 256 384">
<rect x="2" y="2" width="252" height="380" rx="14" ry="14"
fill="#FAFAF8" stroke="#AAAAAA" stroke-width="1.5"/>
<!-- Top-left corner: rank label + small suit -->
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#111111">5</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,4 C 9,9 2,14 2,21 C 2,25 5,28 9,28 C 13,28 14,26 14,24 L 13,30 L 19,30 L 18,24 C 18,26 19,28 23,28 C 27,28 30,25 30,21 C 30,14 23,9 16,4 Z" fill="#111111"/>
</g>
<!-- Centre: large suit, 64x64 in 256x384 card -->
<g transform="translate(96 160) scale(2)">
<path d="M16,4 C 9,9 2,14 2,21 C 2,25 5,28 9,28 C 13,28 14,26 14,24 L 13,30 L 19,30 L 18,24 C 18,26 19,28 23,28 C 27,28 30,25 30,21 C 30,14 23,9 16,4 Z" fill="#111111"/>
</g>
<!-- Bottom-right corner: mirrored via 180° rotation around card centre -->
<g transform="rotate(180 128 192)">
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#111111">5</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,4 C 9,9 2,14 2,21 C 2,25 5,28 9,28 C 13,28 14,26 14,24 L 13,30 L 19,30 L 18,24 C 18,26 19,28 23,28 C 27,28 30,25 30,21 C 30,14 23,9 16,4 Z" fill="#111111"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

@@ -0,0 +1,25 @@
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="384" viewBox="0 0 256 384">
<rect x="2" y="2" width="252" height="380" rx="14" ry="14"
fill="#FAFAF8" stroke="#AAAAAA" stroke-width="1.5"/>
<!-- Top-left corner: rank label + small suit -->
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#111111">6</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,4 C 9,9 2,14 2,21 C 2,25 5,28 9,28 C 13,28 14,26 14,24 L 13,30 L 19,30 L 18,24 C 18,26 19,28 23,28 C 27,28 30,25 30,21 C 30,14 23,9 16,4 Z" fill="#111111"/>
</g>
<!-- Centre: large suit, 64x64 in 256x384 card -->
<g transform="translate(96 160) scale(2)">
<path d="M16,4 C 9,9 2,14 2,21 C 2,25 5,28 9,28 C 13,28 14,26 14,24 L 13,30 L 19,30 L 18,24 C 18,26 19,28 23,28 C 27,28 30,25 30,21 C 30,14 23,9 16,4 Z" fill="#111111"/>
</g>
<!-- Bottom-right corner: mirrored via 180° rotation around card centre -->
<g transform="rotate(180 128 192)">
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#111111">6</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,4 C 9,9 2,14 2,21 C 2,25 5,28 9,28 C 13,28 14,26 14,24 L 13,30 L 19,30 L 18,24 C 18,26 19,28 23,28 C 27,28 30,25 30,21 C 30,14 23,9 16,4 Z" fill="#111111"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

@@ -0,0 +1,25 @@
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="384" viewBox="0 0 256 384">
<rect x="2" y="2" width="252" height="380" rx="14" ry="14"
fill="#FAFAF8" stroke="#AAAAAA" stroke-width="1.5"/>
<!-- Top-left corner: rank label + small suit -->
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#111111">7</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,4 C 9,9 2,14 2,21 C 2,25 5,28 9,28 C 13,28 14,26 14,24 L 13,30 L 19,30 L 18,24 C 18,26 19,28 23,28 C 27,28 30,25 30,21 C 30,14 23,9 16,4 Z" fill="#111111"/>
</g>
<!-- Centre: large suit, 64x64 in 256x384 card -->
<g transform="translate(96 160) scale(2)">
<path d="M16,4 C 9,9 2,14 2,21 C 2,25 5,28 9,28 C 13,28 14,26 14,24 L 13,30 L 19,30 L 18,24 C 18,26 19,28 23,28 C 27,28 30,25 30,21 C 30,14 23,9 16,4 Z" fill="#111111"/>
</g>
<!-- Bottom-right corner: mirrored via 180° rotation around card centre -->
<g transform="rotate(180 128 192)">
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#111111">7</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,4 C 9,9 2,14 2,21 C 2,25 5,28 9,28 C 13,28 14,26 14,24 L 13,30 L 19,30 L 18,24 C 18,26 19,28 23,28 C 27,28 30,25 30,21 C 30,14 23,9 16,4 Z" fill="#111111"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

@@ -0,0 +1,25 @@
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="384" viewBox="0 0 256 384">
<rect x="2" y="2" width="252" height="380" rx="14" ry="14"
fill="#FAFAF8" stroke="#AAAAAA" stroke-width="1.5"/>
<!-- Top-left corner: rank label + small suit -->
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#111111">8</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,4 C 9,9 2,14 2,21 C 2,25 5,28 9,28 C 13,28 14,26 14,24 L 13,30 L 19,30 L 18,24 C 18,26 19,28 23,28 C 27,28 30,25 30,21 C 30,14 23,9 16,4 Z" fill="#111111"/>
</g>
<!-- Centre: large suit, 64x64 in 256x384 card -->
<g transform="translate(96 160) scale(2)">
<path d="M16,4 C 9,9 2,14 2,21 C 2,25 5,28 9,28 C 13,28 14,26 14,24 L 13,30 L 19,30 L 18,24 C 18,26 19,28 23,28 C 27,28 30,25 30,21 C 30,14 23,9 16,4 Z" fill="#111111"/>
</g>
<!-- Bottom-right corner: mirrored via 180° rotation around card centre -->
<g transform="rotate(180 128 192)">
<text x="14" y="44" font-family="Fira Mono" font-size="36" font-weight="700"
fill="#111111">8</text>
<g transform="translate(14 50) scale(0.625)">
<path d="M16,4 C 9,9 2,14 2,21 C 2,25 5,28 9,28 C 13,28 14,26 14,24 L 13,30 L 19,30 L 18,24 C 18,26 19,28 23,28 C 27,28 30,25 30,21 C 30,14 23,9 16,4 Z" fill="#111111"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

Some files were not shown because too many files have changed in this diff Show More