1. 17 Jun, 2026 2 commits
    • Mahmoud Aglan's avatar
      feat(ludo): dice visibility, capture SFX/VFX, ranking system, finish fix · 6d1a8ac5
      Mahmoud Aglan authored
      - Hide dice + roll button when not player's turn; show only on active turn
      - Distinct capture feedback: cheerful SFX+confetti for the capturer,
        sad SFX+red flash+shake for the victim whose pawn got sent home
      - Game continues until 3 players finish — 1st/2nd/3rd get podium screen,
        4th gets loser screen. Finished players are dimmed and auto-skipped
      - Fix finish position: pawns now land on the outer middle of the center
        3x3 grid (squares 2/4/6/8 per color), not the dead center square 5
      - Result screen shows Arabic ranking labels and medals per placement
      Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
      6d1a8ac5
    • Mahmoud Aglan's avatar
      feat(ludo): capture-boost dice, skip-corner path, and firework finish · c55124cc
      Mahmoud Aglan authored
      - Add "lucky roll" mechanic: when an opponent pawn is exposed directly
        ahead (1-6 squares), boost probability of rolling the exact capture
        value by ~+1.0 weight, plus +0.6 for any die value that enables capture
      - Change pawn path: pieces enter home column from position 50 (the square
        before the corner), treating the corner as dead space for their own
        color — matches standard Ludo turn geometry
      - Add multi-wave firework particle burst (player-colored) when a pawn
        lands exactly on the Home finish position
      Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
      c55124cc
  2. 16 Jun, 2026 4 commits
  3. 15 Jun, 2026 5 commits
  4. 14 Jun, 2026 7 commits
  5. 06 Jun, 2026 22 commits
    • Mahmoud Aglan's avatar
    • Mahmoud Aglan's avatar
      feat: multiplayer dominoes — fix invite/accept flow + add domino to challenge menus · 25a80cf0
      Mahmoud Aglan authored
      - friends.php: create domino invites in domino_matches table (not chess matches)
      - friends.php: check-invites scans domino_matches + ludo_matches tables
      - friends.php: accept/decline route to correct game table by game_key
      - domino-match.php: merge hands on move (preserve other player's hand data)
      - game.js: host deals and syncs both hands; guest waits for deal via polling
      - game.js: new rounds in live mode dealt by host only
      - lobby.js: pass playerIndex from accept response
      - chat.js: add domino option to in-chat challenge dialog
      - friends.js: pass game_key on accept/decline calls
      Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
      25a80cf0
    • Mahmoud Aglan's avatar
    • Mahmoud Aglan's avatar
      fix: domino endpoint hit radius increased + only check active endpoints · b742fc99
      Mahmoud Aglan authored
      - Snap radius 45→60 for easier endpoint tapping
      - hitTestEndpoints only checks currently active (highlighted) endpoints
      - Empty board returns hit on any canvas tap when endpoint is active
      - Simplified pointerdown handler (no early endpoint intercept)
      Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
      b742fc99
    • Mahmoud Aglan's avatar
      fix: domino layout — correct tile orientation and chain connectivity · 7ef3695b
      Mahmoud Aglan authored
      Layout engine:
      - Non-doubles are landscape (w=48, h=24) in horizontal chains
      - Doubles are portrait (w=24, h=48) perpendicular to horizontal chains
      - Tiles positioned touching each other with GAP=3px between
      - Properly computes half-extents for advance distance
      - Endpoints positioned beyond last tile in chain direction
      
      Tile renderer:
      - Uses w>h to detect landscape orientation (no rotation param needed)
      - Left/right pips in landscape, top/bottom pips in portrait
      - Doubles get accent background
      
      Board:
      - Ghost and animate tiles compute orientation from layout dirIdx
      - No rotation applied (dimensions are pre-computed correctly)
      Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
      7ef3695b
    • Mahmoud Aglan's avatar
      fix: domino endpoint tap on empty board + status update on select · 75aa69e3
      Mahmoud Aglan authored
      - Empty board now returns hit on any board tap when active endpoint set
      - Status text updates immediately when tile is selected/deselected
      Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
      75aa69e3
    • Mahmoud Aglan's avatar
      feat: domino visual overhaul + tap-to-confirm + pan/zoom · 0bc5a2fb
      Mahmoud Aglan authored
      Theme:
      - Replace green felt table with dark navy (#0f1623) matching app identity
      - Gold accent (#E4AC38) replaces green for highlights and UI elements
      - Tiles have warm ivory (#F5F0E8) with subtle shadows on dark bg
      - All UI bars/controls use app's #0f0f1e background
      
      Layout engine rewrite:
      - Chain starts from center, grows outward naturally
      - Proper double placement (perpendicular to chain direction)
      - Non-doubles align correctly with chain direction
      - Snake path with smooth turns at virtual bounds
      
      Interaction (tap-to-confirm):
      - Tap tile → highlights valid endpoints on board
      - Tap highlighted endpoint → confirms placement
      - NEVER auto-places on tap — always requires explicit destination
      - Tap same tile again → deselects it
      - Status shows "اختر مكان الوضع" when tile is selected
      
      Board improvements:
      - Pan gesture: drag on empty board area to scroll
      - Auto-zoom: smoothly zooms out as chain grows large
      - Endpoint glow uses gold dashed-ring indicator
      Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
      0bc5a2fb
    • Mahmoud Aglan's avatar
      fix: domino drag-drop re-evaluates hit on touchend · c8ffafd0
      Mahmoud Aglan authored
      When touchend fires without updating pointer coordinates (common in
      headless environments and some mobile browsers), the proxy position
      is used to re-check endpoint hit test before deciding placement.
      Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
      c8ffafd0
    • Mahmoud Aglan's avatar
      fix: domino double-tap places tile on right end when both ends valid · 8487c466
      Mahmoud Aglan authored
      Previously, tapping a tile that could play on both ends would highlight
      board endpoints and require a separate canvas tap. Now a second tap on
      the same tile auto-places it on the right end, matching mobile UX
      expectations.
      Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
      8487c466
    • Mahmoud Aglan's avatar
      fix: domino drag-drop touchend fallback + auto-pass when blocked · 0abd3f92
      Mahmoud Aglan authored
      - Added touchend listener as fallback in DominoDrag for browsers/envs
        where pointerup doesn't fire after touch events
      - Added auto-pass (1.5s timeout) when player is blocked and boneyard
        is empty — prevents game from stalling
      Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
      0abd3f92
    • Mahmoud Aglan's avatar
      fix: inject hand/drag styles after component creation · 18c0006d
      Mahmoud Aglan authored
      Styles were injected before hand/drag were instantiated, resulting in
      zero-dimension tiles (CSS classes never added to page).
      Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
      18c0006d
    • Mahmoud Aglan's avatar
      feat: complete domino game — multiplayer, bot AI, Elo, lobby · fcff8eb1
      Mahmoud Aglan authored
      Full mobile domino implementation with all 6 phases:
      - Canvas board with snake-path layout, endpoint glow, ghost preview
      - HTML fan hand with drag-and-snap + tap-to-play controls
      - 3-level bot AI (beginner/intermediate/expert) with server records
      - Live multiplayer via polling (match-live.js integration)
      - Emote system, resign sync, disconnect handling
      - Multi-round scoring (first to 100), round overlays
      - Server API (domino-match.php) with Elo, coins, XP rewards
      - Bot difficulty picker, friend challenge flow, lobby integration
      Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
      fcff8eb1
    • Mahmoud Aglan's avatar
      fix: chess resign/draw sync — opponent now sees both actions · 7372dc29
      Mahmoud Aglan authored
      - match-live.js: always forward poll data to game (not only on move_count change)
        This was the root cause — resign/draw don't increment move_count, so the
        game never processed the status change or game_state update
      - game.php: all match operations now use supabaseService() to bypass RLS
        (handleGameMove, handleResign, handleComplete all failed silently with user token)
      - Add dedicated 'draw' action in game.php that atomically marks match completed
      - Draw acceptance now calls action:'draw' instead of writing game_state only
      - handleResign validates match isn't already completed (prevents double-resign)
      Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
      7372dc29
    • Mahmoud Aglan's avatar
      feat: friend chat, game lobby, challenge button + fix chess/ludo layouts · d63a4517
      Mahmoud Aglan authored
      - Add friend_messages table + chat.php API (send, history, unread)
      - Add chat scene with real-time polling, day dividers, invite from chat
      - Add game lobby scene (waiting room before match starts)
      - Add "Challenge Friend" button on play home screen
      - Add challenge-friend scene with friend picker + game/time selector
      - Remove ad banner from chess, polish layout for all screen sizes
      - Fix Ludo layout (broken #ludo-wrap div, board now fills space properly)
      - Route invite acceptance through lobby instead of direct game push
      - Add 💬 chat button on friend cards in social scene
      Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
      d63a4517
    • Mahmoud Aglan's avatar
      kokowawas · 431518eb
      Mahmoud Aglan authored
      431518eb
    • Mahmoud Aglan's avatar
      fix: opponent bar friend request shows feedback + opens profile · 6d88756f
      Mahmoud Aglan authored
      - Add friend button shows success/already-sent/already-friends status
      - Profile button navigates to player profile view
      - Report button shows confirmation before dismissing
      Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
      6d88756f
    • Mahmoud Aglan's avatar
      fix: friendship system + friend invite/challenge lobby · 1ae4c0ac
      Mahmoud Aglan authored
      Friendship bugs fixed:
      - Accept now uses service key (bypasses RLS that blocked updates)
      - Duplicate request prevention (checks both directions)
      - Reject uses proper POST action instead of broken DELETE call
      - Cleaned up stale duplicate rows in DB
      
      New features:
      - Friend invite system: challenge dialog with game/time selection
      - Match created as 'friendly' with status 'waiting'
      - Opponent sees invite banner (polls every 5s), can accept/decline
      - Accept starts the match, both players enter the game
      - 2-minute invite expiry
      Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
      1ae4c0ac
    • Mahmoud Aglan's avatar
      fix: daily rewards streak tracking + achievements system · 432f8feb
      Mahmoud Aglan authored
      Daily rewards:
      - Server now tracks streak, prevents double-claim, resets on missed day
      - GET endpoint returns current state (streak, claimed status, today's reward)
      - Updates profile daily_streak + last_daily_reward columns
      - Frontend fetches state from server instead of relying on local store
      
      Achievements:
      - New scene with category filters, progress bars, tier badges
      - POST check action recalculates all progress from player stats
      - game.php now tracks win_streak and checks achievements on game end
      - Rewards (coins/XP) auto-granted when achievement completes
      
      Challenges:
      - Claim tracking via economy_transactions prevents double-claims
      - Fixed column name (reason, not description)
      Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
      432f8feb
    • Mahmoud Aglan's avatar
      feat: profile edit + org application with proof upload · 8b31a26d
      Mahmoud Aglan authored
      Players can now fill all profile fields (bio, country, city, FIDE info)
      from their profile tab and apply for organizations with document proof.
      Also fixes avatar.php to use SERVICE_KEY for storage uploads.
      Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
      8b31a26d
    • Mahmoud Aglan's avatar
      fix: comprehensive chess multiplayer sync overhaul · ed1fc3ce
      Mahmoud Aglan authored
      - Eliminate double polling: removed game.js own poller, use match-session's
        single 2s poll via handleLivePollData callback (halves network requests)
      - Send last_move (from/to/san/promotion) in game_state so opponent gets
        exact move data — fixes castling, en passant, promotion animations
      - Opponent moves now animate (piece slides) instead of board snap
      - Capture particles now fire on opponent's captures too
      - Castling sound+haptic plays for opponent's castles
      - Draw flow: sender sees "sent" confirmation, receiver sees accept/deny
        dialog (30s timeout), both sides see result via game_state merge
      - Emote dedup: timestamp tracking prevents repeated display on same emote
      - Emotes use correct emoji lookup (getEmojiForKey) instead of 3 hardcoded
      - Polling runs even during player's turn (emotes + draws must arrive anytime)
      - Game end detection covers draw result ('draw' + 'aborted')
      Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
      ed1fc3ce
    • Mahmoud Aglan's avatar
      fix: chess multiplayer sync — draw offers, emotes, and polling · 86b39890
      Mahmoud Aglan authored
      - Draw offer now syncs: sender sees confirmation, receiver sees
        accept/deny dialog with 30s timeout
      - Emotes now show the correct emoji (was hardcoded to 3 mappings,
        now uses actual emote key lookup)
      - Emote dedup via timestamp tracking — no repeated display
      - game_state is now MERGED server-side instead of overwritten,
        so emotes don't wipe draw offers and vice versa
      - Polling runs regardless of whose turn it is (emotes/draws
        need to arrive during your own turn too)
      - Draw accept/decline response properly detected by offerer
      Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
      86b39890
    • Mahmoud Aglan's avatar