diff --git a/client-src/package.json b/client-src/package.json
index e0c89b2..27b9a7a 100644
--- a/client-src/package.json
+++ b/client-src/package.json
@@ -1,6 +1,6 @@
{
"name": "chess-client",
- "version": "1.4.0",
+ "version": "1.6.0",
"private": true,
"type": "module",
"scripts": {
diff --git a/client-src/src/main.ts b/client-src/src/main.ts
index 3c1b90c..c78f129 100644
--- a/client-src/src/main.ts
+++ b/client-src/src/main.ts
@@ -62,15 +62,31 @@ const host = connectHost({
prevS = S;
S = env.body as GameSnapshot;
- detectMoveEvents(prevS, S);
-
if (S.turn !== S.me) {
selectedSquare = "";
legalTargets = [];
pendingPromo = null;
}
+ // Pre-compute lastMove so cell highlight renders immediately in updateUI
+ if (prevS && S) {
+ const oldBoard = new Map(prevS.board.map((c) => [c.square, c]));
+ const newBoard = new Map(S.board.map((c) => [c.square, c]));
+ let f = "";
+ let t = "";
+ for (const [sq, newCell] of newBoard.entries()) {
+ const oldCell = oldBoard.get(sq);
+ if (!oldCell) continue;
+ if (oldCell.color && !newCell.color) f = sq;
+ else if (newCell.color && (!oldCell.color || oldCell.color !== newCell.color || oldCell.type !== newCell.type)) t = sq;
+ }
+ if (f && t) {
+ lastMove = { from: f, to: t };
+ }
+ }
+
updateUI();
+ detectMoveEvents(prevS, S);
}
},
onAck(a) {
@@ -93,6 +109,7 @@ function detectMoveEvents(oldState: GameSnapshot | null, newState: GameSnapshot)
let movedFrom = "";
let movedTo = "";
let capturedPiece: CellInfo | null = null;
+ let capturedSquare = "";
for (const [sq, newCell] of newBoard.entries()) {
const oldCell = oldBoard.get(sq);
@@ -106,13 +123,30 @@ function detectMoveEvents(oldState: GameSnapshot | null, newState: GameSnapshot)
movedTo = sq;
if (oldCell.color && oldCell.color !== newCell.color) {
capturedPiece = oldCell;
+ capturedSquare = sq;
+ }
+ }
+ }
+
+ // Handle en-passant where captured pawn square is different from movedTo
+ if (!capturedPiece && movedFrom && movedTo) {
+ for (const [sq, newCell] of newBoard.entries()) {
+ const oldCell = oldBoard.get(sq);
+ if (!oldCell) continue;
+ if (oldCell.color && !newCell.color && sq !== movedFrom) {
+ capturedPiece = oldCell;
+ capturedSquare = sq;
+ break;
}
}
}
if (movedFrom && movedTo) {
lastMove = { from: movedFrom, to: movedTo };
- const targetCellEl = document.querySelector(`[data-square="${movedTo}"]`) as HTMLElement;
+ const targetCellEl = document.querySelector(`[data-square="${movedTo}"]`) as HTMLElement | null;
+ const fromCellEl = document.querySelector(`[data-square="${movedFrom}"]`) as HTMLElement | null;
+ const boardGridEl = document.getElementById("board-grid");
+ const ghostLayerEl = document.getElementById("ghost-layer");
if (targetCellEl) {
const rect = targetCellEl.getBoundingClientRect();
@@ -124,17 +158,61 @@ function detectMoveEvents(oldState: GameSnapshot | null, newState: GameSnapshot)
if (capturedPiece) {
vfx.captureImpact(x, y, capturedPiece.color as "w" | "b");
+ setTimeout(() => {
+ vfx?.dissolvePuff(x, y, capturedPiece!.color as "w" | "b");
+ }, 440);
} else {
vfx.landingPuff(x, y);
}
}
- // Add landing squash animation to arrived piece
- const pieceEl = targetCellEl.querySelector(".piece-wrapper");
+ // Add strike / land animation to arrived piece
+ const pieceEl = targetCellEl.querySelector(".piece-wrapper") as HTMLElement | null;
if (pieceEl) {
- pieceEl.classList.remove("anim-land");
- void (pieceEl as HTMLElement).offsetWidth;
- pieceEl.classList.add("anim-land");
+ pieceEl.classList.remove("anim-land", "anim-strike");
+ void pieceEl.offsetWidth;
+ if (capturedPiece) {
+ pieceEl.classList.add("anim-strike");
+ targetCellEl.classList.remove("anim-shudder");
+ void targetCellEl.offsetWidth;
+ targetCellEl.classList.add("anim-shudder");
+ } else {
+ pieceEl.classList.add("anim-land");
+ }
+ }
+ }
+
+ // Dramatic Topple & Dissolve animation for captured piece
+ if (capturedPiece && boardGridEl && ghostLayerEl) {
+ const toppleOnSq = capturedSquare || movedTo;
+ const capturedCellEl = document.querySelector(`[data-square="${toppleOnSq}"]`) as HTMLElement | null;
+ if (capturedCellEl) {
+ const boardRect = boardGridEl.getBoundingClientRect();
+ const cellRect = capturedCellEl.getBoundingClientRect();
+
+ // Determine knock-over direction (attacker kinetic force direction)
+ let toppleDir: "right" | "left" = "right";
+ if (fromCellEl) {
+ const fromRect = fromCellEl.getBoundingClientRect();
+ if (cellRect.left < fromRect.left - 4) {
+ toppleDir = "left";
+ }
+ }
+
+ const ghost = document.createElement("div");
+ ghost.className = `captured-ghost topple-${toppleDir}`;
+ ghost.style.left = `${cellRect.left - boardRect.left}px`;
+ ghost.style.top = `${cellRect.top - boardRect.top}px`;
+ ghost.style.width = `${cellRect.width}px`;
+ ghost.style.height = `${cellRect.height}px`;
+
+ const pieceSvg = getPieceSvg(capturedPiece.type as PieceType, capturedPiece.color as PieceColor);
+ ghost.innerHTML = `
${pieceSvg}
`;
+ ghostLayerEl.appendChild(ghost);
+
+ setTimeout(() => {
+ ghost.remove();
+ }, 800);
}
}
}
@@ -156,6 +234,7 @@ function setupDOM() {
diff --git a/client-src/src/pieces.ts b/client-src/src/pieces.ts
index 4d1044a..7d0cff5 100644
--- a/client-src/src/pieces.ts
+++ b/client-src/src/pieces.ts
@@ -1,119 +1,264 @@
/**
- * High-quality vector SVGs for standard Chess pieces (Staunton design).
- * Provides clean, crisp rendering at all DPRs and sizes.
+ * Dazzling 2D Chess Pieces — Master Artisan Imperial Edition
+ * Rich volumetric gradients, gold filigree, faceted gemstones, and crisp specular highlights.
*/
export type PieceType = "k" | "q" | "r" | "b" | "n" | "p";
export type PieceColor = "w" | "b";
-const PIECE_SVGS: Record = {
- k: {
- w: `
-
-
-
-
-
-
- `,
- b: `
-
-
-
-
-
-
- `,
- },
- q: {
- w: `
-
-
-
-
-
-
-
- `,
- b: `
-
-
-
-
-
-
-
- `,
- },
- r: {
- w: `
-
-
-
-
-
-
- `,
- b: `
-
-
-
-
-
-
- `,
- },
- b: {
- w: `
-
-
-
-
-
-
-
-
- `,
- b: `
-
-
-
-
-
-
-
-
- `,
- },
- n: {
- w: `
-
-
-
-
-
-
- `,
- b: `
-
-
-
-
-
-
- `,
- },
- p: {
- w: `
-
- `,
- b: `
-
- `,
- },
+const WHITE_DEFS = `
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+`;
+
+const BLACK_DEFS = `
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+`;
+
+function buildPawnSvg(isWhite: boolean): string {
+ const defs = isWhite ? WHITE_DEFS : BLACK_DEFS;
+ const stroke = isWhite ? "#0f172a" : "#020617";
+ const bodyGrad = isWhite ? "url(#cp-w-body)" : "url(#cp-b-body)";
+ const specGrad = isWhite ? "url(#cp-w-spec)" : "url(#cp-b-spec)";
+ const goldGrad = isWhite ? "url(#cp-w-gold)" : "url(#cp-b-gold)";
+ const rimStroke = isWhite ? "#e2e8f0" : "#64748b";
+
+ return `
+ ${defs}
+
+
+
+
+
+
+
+
+
+
+
+
+ `;
+}
+
+function buildKnightSvg(isWhite: boolean): string {
+ const defs = isWhite ? WHITE_DEFS : BLACK_DEFS;
+ const stroke = isWhite ? "#0f172a" : "#020617";
+ const bodyGrad = isWhite ? "url(#cp-w-body)" : "url(#cp-b-body)";
+ const specGrad = isWhite ? "url(#cp-w-spec)" : "url(#cp-b-spec)";
+ const goldGrad = isWhite ? "url(#cp-w-gold)" : "url(#cp-b-gold)";
+ const eyeColor = isWhite ? "url(#cp-ruby)" : "url(#cp-sapphire)";
+
+ return `
+ ${defs}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ `;
+}
+
+function buildBishopSvg(isWhite: boolean): string {
+ const defs = isWhite ? WHITE_DEFS : BLACK_DEFS;
+ const stroke = isWhite ? "#0f172a" : "#020617";
+ const bodyGrad = isWhite ? "url(#cp-w-body)" : "url(#cp-b-body)";
+ const specGrad = isWhite ? "url(#cp-w-spec)" : "url(#cp-b-spec)";
+ const goldGrad = isWhite ? "url(#cp-w-gold)" : "url(#cp-b-gold)";
+ const gemColor = isWhite ? "url(#cp-ruby)" : "url(#cp-sapphire)";
+
+ return `
+ ${defs}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ `;
+}
+
+function buildRookSvg(isWhite: boolean): string {
+ const defs = isWhite ? WHITE_DEFS : BLACK_DEFS;
+ const stroke = isWhite ? "#0f172a" : "#020617";
+ const bodyGrad = isWhite ? "url(#cp-w-body)" : "url(#cp-b-body)";
+ const specGrad = isWhite ? "url(#cp-w-spec)" : "url(#cp-b-spec)";
+ const goldGrad = isWhite ? "url(#cp-w-gold)" : "url(#cp-b-gold)";
+
+ return `
+ ${defs}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ `;
+}
+
+function buildQueenSvg(isWhite: boolean): string {
+ const defs = isWhite ? WHITE_DEFS : BLACK_DEFS;
+ const stroke = isWhite ? "#0f172a" : "#020617";
+ const bodyGrad = isWhite ? "url(#cp-w-body)" : "url(#cp-b-body)";
+ const specGrad = isWhite ? "url(#cp-w-spec)" : "url(#cp-b-spec)";
+ const goldGrad = isWhite ? "url(#cp-w-gold)" : "url(#cp-b-gold)";
+ const gemColor = isWhite ? "url(#cp-ruby)" : "url(#cp-sapphire)";
+ const pearlColor = isWhite ? "url(#cp-pearl)" : "url(#cp-amethyst)";
+
+ return `
+ ${defs}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ `;
+}
+
+function buildKingSvg(isWhite: boolean): string {
+ const defs = isWhite ? WHITE_DEFS : BLACK_DEFS;
+ const stroke = isWhite ? "#0f172a" : "#020617";
+ const bodyGrad = isWhite ? "url(#cp-w-body)" : "url(#cp-b-body)";
+ const specGrad = isWhite ? "url(#cp-w-spec)" : "url(#cp-b-spec)";
+ const goldGrad = isWhite ? "url(#cp-w-gold)" : "url(#cp-b-gold)";
+ const gemColor = isWhite ? "url(#cp-ruby)" : "url(#cp-sapphire)";
+
+ return `
+ ${defs}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ `;
+}
+
+const PIECE_BUILDERS: Record string> = {
+ p: buildPawnSvg,
+ n: buildKnightSvg,
+ b: buildBishopSvg,
+ r: buildRookSvg,
+ q: buildQueenSvg,
+ k: buildKingSvg,
};
+// Cached SVG strings for instant performance
+const PIECE_CACHE: Record = {};
+
export function getPieceSvg(type: PieceType | null, color: PieceColor | null): string {
if (!type || !color) return "";
- return PIECE_SVGS[type]?.[color] ?? "";
+ const key = `${type}-${color}`;
+ if (!PIECE_CACHE[key]) {
+ const builder = PIECE_BUILDERS[type];
+ if (builder) {
+ PIECE_CACHE[key] = builder(color === "w");
+ }
+ }
+ return PIECE_CACHE[key] ?? "";
}
diff --git a/client-src/src/style.css b/client-src/src/style.css
index 4549b49..ae56e94 100644
--- a/client-src/src/style.css
+++ b/client-src/src/style.css
@@ -142,9 +142,13 @@ html, body {
}
.captured-tray .mini-piece {
- width: 18px;
- height: 18px;
- opacity: 0.85;
+ width: 21px;
+ height: 21px;
+ opacity: 0.95;
+ filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.45));
+ display: flex;
+ align-items: center;
+ justify-content: center;
}
.advantage-score {
@@ -254,36 +258,59 @@ html, body {
========================================================================== */
.piece-wrapper {
- width: 90%;
- height: 90%;
+ width: 92%;
+ height: 92%;
display: flex;
align-items: center;
justify-content: center;
pointer-events: none;
- transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.2s ease;
+ transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.22s ease;
}
.piece-svg {
width: 100%;
height: 100%;
- filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.28));
display: block;
+ filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.38));
+ transition: filter 0.25s ease;
+}
+
+.piece-svg.piece-w {
+ filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.35)) drop-shadow(0 1px 2px rgba(254, 240, 138, 0.2));
+}
+
+.piece-svg.piece-b {
+ filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.52)) drop-shadow(0 1px 2px rgba(129, 140, 248, 0.25));
}
.cell:not(:disabled):hover .piece-wrapper {
- transform: translateY(-3px) scale(1.06);
- filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.35));
+ transform: translateY(-4px) scale(1.09);
+}
+
+.cell:not(:disabled):hover .piece-svg.piece-w {
+ filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.45)) drop-shadow(0 0 10px rgba(245, 158, 11, 0.65));
+}
+
+.cell:not(:disabled):hover .piece-svg.piece-b {
+ filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 10px rgba(168, 85, 247, 0.7));
}
.cell.selected .piece-wrapper {
- transform: translateY(-5px) scale(1.14);
- filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.45));
+ transform: translateY(-6px) scale(1.15);
animation: piece-hover-breath 1.8s ease-in-out infinite alternate;
}
+.cell.selected .piece-svg.piece-w {
+ filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 16px rgba(251, 191, 36, 0.9));
+}
+
+.cell.selected .piece-svg.piece-b {
+ filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.7)) drop-shadow(0 0 16px rgba(192, 132, 252, 0.9));
+}
+
@keyframes piece-hover-breath {
0% { transform: translateY(-5px) scale(1.14); }
- 100% { transform: translateY(-7px) scale(1.18); }
+ 100% { transform: translateY(-8px) scale(1.18); }
}
/* Physical animation classes */
@@ -308,6 +335,160 @@ html, body {
100% { transform: translateY(0) scale(1); }
}
+/* Attacking piece strike animation */
+.piece-wrapper.anim-strike {
+ animation: piece-strike-lunge 0.38s cubic-bezier(0.34, 1.56, 0.64, 1);
+ z-index: 10;
+}
+
+@keyframes piece-strike-lunge {
+ 0% {
+ transform: scale(0.88) translateY(-6px);
+ filter: brightness(1.25);
+ }
+ 30% {
+ transform: scale(1.22) translateY(2px);
+ filter: brightness(1.35) drop-shadow(0 8px 16px rgba(0, 0, 0, 0.6));
+ }
+ 60% {
+ transform: scale(0.94, 1.06) translateY(-2px);
+ }
+ 80% {
+ transform: scale(1.03, 0.97) translateY(0);
+ }
+ 100% {
+ transform: scale(1, 1) translateY(0);
+ filter: none;
+ }
+}
+
+/* Board square impact shudder */
+.cell.anim-shudder {
+ animation: cell-shudder 0.22s ease-out;
+}
+
+@keyframes cell-shudder {
+ 0% { transform: translate(0, 0); }
+ 25% { transform: translate(2px, 1px); }
+ 50% { transform: translate(-2px, -1px); }
+ 75% { transform: translate(1px, -1px); }
+ 100% { transform: translate(0, 0); }
+}
+
+/* ==========================================================================
+ Capture Topple & Dissolve Layer
+ ========================================================================== */
+
+.ghost-layer {
+ position: absolute;
+ inset: 4px;
+ pointer-events: none;
+ z-index: 15;
+ overflow: visible;
+}
+
+.captured-ghost {
+ position: absolute;
+ pointer-events: none;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ z-index: 20;
+}
+
+.captured-ghost .piece-wrapper {
+ width: 92%;
+ height: 92%;
+}
+
+.captured-ghost.topple-right {
+ transform-origin: 45% 90%;
+ animation: piece-topple-right 0.78s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
+}
+
+.captured-ghost.topple-left {
+ transform-origin: 55% 90%;
+ animation: piece-topple-left 0.78s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
+}
+
+@keyframes piece-topple-right {
+ 0% {
+ transform: translate(0, 0) rotate(0deg) scale(1);
+ opacity: 1;
+ filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.45));
+ }
+ 14% {
+ /* Impact shock: jolt up and lean back */
+ transform: translate(6px, -12px) rotate(22deg) scale(1.05);
+ opacity: 1;
+ filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.4)) brightness(1.2);
+ }
+ 38% {
+ /* Falling over past balance point */
+ transform: translate(16px, -2px) rotate(60deg) scale(1);
+ opacity: 0.96;
+ }
+ 58% {
+ /* Slam onto the board surface */
+ transform: translate(24px, 12px) rotate(92deg) scale(0.96, 0.9);
+ opacity: 0.92;
+ filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
+ }
+ 70% {
+ /* Physical ground rebound / rattle */
+ transform: translate(26px, 8px) rotate(84deg) scale(0.97, 0.94);
+ opacity: 0.88;
+ }
+ 80% {
+ /* Rest flat on board */
+ transform: translate(27px, 12px) rotate(90deg) scale(0.95);
+ opacity: 0.8;
+ filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
+ }
+ 100% {
+ /* Dissolve and vanish into thin air */
+ transform: translate(30px, 16px) rotate(90deg) scale(0.68) scaleY(0.4);
+ opacity: 0;
+ filter: blur(5px) brightness(1.8) drop-shadow(0 0 12px rgba(255, 255, 255, 0.9));
+ }
+}
+
+@keyframes piece-topple-left {
+ 0% {
+ transform: translate(0, 0) rotate(0deg) scale(1);
+ opacity: 1;
+ filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.45));
+ }
+ 14% {
+ transform: translate(-6px, -12px) rotate(-22deg) scale(1.05);
+ opacity: 1;
+ filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.4)) brightness(1.2);
+ }
+ 38% {
+ transform: translate(-16px, -2px) rotate(-60deg) scale(1);
+ opacity: 0.96;
+ }
+ 58% {
+ transform: translate(-24px, 12px) rotate(-92deg) scale(0.96, 0.9);
+ opacity: 0.92;
+ filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
+ }
+ 70% {
+ transform: translate(-26px, 8px) rotate(-84deg) scale(0.97, 0.94);
+ opacity: 0.88;
+ }
+ 80% {
+ transform: translate(-27px, 12px) rotate(-90deg) scale(0.95);
+ opacity: 0.8;
+ filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
+ }
+ 100% {
+ transform: translate(-30px, 16px) rotate(-90deg) scale(0.68) scaleY(0.4);
+ opacity: 0;
+ filter: blur(5px) brightness(1.8) drop-shadow(0 0 12px rgba(255, 255, 255, 0.9));
+ }
+}
+
/* ==========================================================================
Move Indicators: Dots & Capture Reticles
========================================================================== */
diff --git a/client-src/src/vfx.ts b/client-src/src/vfx.ts
index 0dacbab..d25420f 100644
--- a/client-src/src/vfx.ts
+++ b/client-src/src/vfx.ts
@@ -228,6 +228,33 @@ export class VfxEngine {
}
}
+ /**
+ * Dissolution / ether particles when defeated piece vanishes
+ */
+ public dissolvePuff(x: number, y: number, capturedColor: "w" | "b" = "w") {
+ const colors = capturedColor === "w"
+ ? ["#fef08a", "#fbbf24", "#ffffff", "rgba(254, 240, 138, 0.7)"]
+ : ["#c084fc", "#a855f7", "#60a5fa", "rgba(192, 132, 252, 0.7)"];
+
+ for (let i = 0; i < 16; i++) {
+ const angle = Math.random() * Math.PI * 2;
+ const speed = 12 + Math.random() * 38;
+ this.particles.push({
+ x: x + (Math.random() - 0.5) * 22,
+ y: y + 8 + (Math.random() - 0.5) * 12,
+ vx: Math.cos(angle) * speed,
+ vy: Math.sin(angle) * speed - 22,
+ radius: 1.5 + Math.random() * 2.8,
+ color: colors[Math.floor(Math.random() * colors.length)],
+ alpha: 0.85,
+ decay: 1.5 + Math.random() * 0.8,
+ gravity: -18,
+ drag: 0.91,
+ shape: "circle",
+ });
+ }
+ }
+
/**
* Magical ascension / burst on Pawn Promotion
*/
diff --git a/client/assets/index-8tGLzrk3.js b/client/assets/index-8tGLzrk3.js
new file mode 100644
index 0000000..04791a5
--- /dev/null
+++ b/client/assets/index-8tGLzrk3.js
@@ -0,0 +1,206 @@
+(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))t(r);new MutationObserver(r=>{for(const e of r)if(e.type==="childList")for(const c of e.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&t(c)}).observe(document,{childList:!0,subtree:!0});function s(r){const e={};return r.integrity&&(e.integrity=r.integrity),r.referrerPolicy&&(e.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?e.credentials="include":r.crossOrigin==="anonymous"?e.credentials="omit":e.credentials="same-origin",e}function t(r){if(r.ep)return;r.ep=!0;const e=s(r);fetch(r.href,e)}})();function ot(o){const a=new URLSearchParams(location.search).get("host")??"*",s=r=>window.parent.postMessage({m3:1,...r},a);let t=0;return window.addEventListener("message",r=>{var c,l,m;if(r.source!==window.parent||a!=="*"&&r.origin!==a)return;const e=r.data;if(!(!e||e.m3!==1))switch(e.type){case"init":o.onInit(e),s({type:"ready"});break;case"state":o.onState(e.env);break;case"ack":(c=o.onAck)==null||c.call(o,e);break;case"view_changed":(l=o.onViewChanged)==null||l.call(o,e.view);break;case"cmd_failed":(m=o.onCmdFailed)==null||m.call(o,e.req_id,e.code);break}}),s({type:"loaded"}),{cmd(r,e={}){const c=++t;return s({type:"cmd",cmd_type:r,payload:e,req_id:c}),c},toast(r,e,c="info"){s({type:"toast",text_fa:r,text_en:e,kind:c})}}}const G=`
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+`,S=`
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+`;function rt(o){const a=o?G:S,s=o?"#0f172a":"#020617",t=o?"url(#cp-w-body)":"url(#cp-b-body)",r=o?"url(#cp-w-spec)":"url(#cp-b-spec)",e=o?"url(#cp-w-gold)":"url(#cp-b-gold)";return`
+ ${a}
+
+
+
+
+
+
+
+
+
+
+
+
+ `}function st(o){const a=o?G:S,s=o?"#0f172a":"#020617",t=o?"url(#cp-w-body)":"url(#cp-b-body)",r=o?"url(#cp-w-spec)":"url(#cp-b-spec)",e=o?"url(#cp-w-gold)":"url(#cp-b-gold)",c=o?"url(#cp-ruby)":"url(#cp-sapphire)";return`
+ ${a}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ `}function at(o){const a=o?G:S,s=o?"#0f172a":"#020617",t=o?"url(#cp-w-body)":"url(#cp-b-body)",r=o?"url(#cp-w-spec)":"url(#cp-b-spec)",e=o?"url(#cp-w-gold)":"url(#cp-b-gold)";return`
+ ${a}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ `}function ct(o){const a=o?G:S,s=o?"#0f172a":"#020617",t=o?"url(#cp-w-body)":"url(#cp-b-body)",r=o?"url(#cp-w-spec)":"url(#cp-b-spec)",e=o?"url(#cp-w-gold)":"url(#cp-b-gold)";return`
+ ${a}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ `}function nt(o){const a=o?G:S,s=o?"#0f172a":"#020617",t=o?"url(#cp-w-body)":"url(#cp-b-body)",r=o?"url(#cp-w-spec)":"url(#cp-b-spec)",e=o?"url(#cp-w-gold)":"url(#cp-b-gold)",c=o?"url(#cp-ruby)":"url(#cp-sapphire)",l=o?"url(#cp-pearl)":"url(#cp-amethyst)";return`
+ ${a}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ `}function lt(o){const a=o?G:S,s=o?"#0f172a":"#020617",t=o?"url(#cp-w-body)":"url(#cp-b-body)",r=o?"url(#cp-w-spec)":"url(#cp-b-spec)",e=o?"url(#cp-w-gold)":"url(#cp-b-gold)";return`
+ ${a}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ `}const it={p:rt,n:st,b:at,r:ct,q:nt,k:lt},O={};function _(o,a){if(!o||!a)return"";const s=`${o}-${a}`;if(!O[s]){const t=it[o];t&&(O[s]=t(a==="w"))}return O[s]??""}class dt{constructor(a){this.particles=[],this.shockwaves=[],this.animId=null,this.lastTime=0,this.canvas=a,this.ctx=a.getContext("2d"),this.resize(),window.addEventListener("resize",()=>this.resize()),this.startLoop()}resize(){var t,r,e;const a=(t=this.canvas.parentElement)==null?void 0:t.getBoundingClientRect();if(!a)return;const s=window.devicePixelRatio||1;this.canvas.width=Math.round(a.width*s),this.canvas.height=Math.round(a.height*s),this.canvas.style.width=`${a.width}px`,this.canvas.style.height=`${a.height}px`,(e=(r=this.ctx).resetTransform)==null||e.call(r),this.ctx.scale(s,s)}startLoop(){if(this.animId)return;const a=s=>{const t=this.lastTime?Math.min((s-this.lastTime)/1e3,.1):.016;this.lastTime=s,this.update(t),this.render(),this.animId=requestAnimationFrame(a)};this.animId=requestAnimationFrame(a)}update(a){for(let s=this.shockwaves.length-1;s>=0;s--){const t=this.shockwaves[s];t.radius+=(t.maxRadius-t.radius)*12*a,t.alpha-=t.decay*a,(t.alpha<=0||t.radius>=t.maxRadius*.98)&&this.shockwaves.splice(s,1)}for(let s=this.particles.length-1;s>=0;s--){const t=this.particles[s];t.x+=t.vx*a,t.y+=t.vy*a,t.vx*=Math.pow(t.drag,a*60),t.vy*=Math.pow(t.drag,a*60),t.vy+=t.gravity*a,t.vRot&&t.rotation!==void 0&&(t.rotation+=t.vRot*a),t.alpha-=t.decay*a,t.alpha<=0&&this.particles.splice(s,1)}}render(){const a=this.canvas.width/(window.devicePixelRatio||1),s=this.canvas.height/(window.devicePixelRatio||1);this.ctx.clearRect(0,0,a,s);for(const t of this.shockwaves)this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(t.x,t.y,Math.max(1,t.radius),0,Math.PI*2),this.ctx.strokeStyle=t.color,this.ctx.globalAlpha=Math.max(0,t.alpha),this.ctx.lineWidth=t.lineWidth,this.ctx.stroke(),this.ctx.restore();for(const t of this.particles){if(this.ctx.save(),this.ctx.globalAlpha=Math.max(0,t.alpha),this.ctx.fillStyle=t.color,t.shape==="rect"||t.shape==="spark"){this.ctx.translate(t.x,t.y),t.rotation!==void 0&&this.ctx.rotate(t.rotation);const r=t.size||t.radius*2;t.shape==="spark"?this.ctx.fillRect(-r,-r*.25,r*2,r*.5):this.ctx.fillRect(-r*.5,-r*.5,r,r)}else this.ctx.beginPath(),this.ctx.arc(t.x,t.y,Math.max(.5,t.radius),0,Math.PI*2),this.ctx.fill();this.ctx.restore()}}captureImpact(a,s,t="w"){this.shockwaves.push({x:a,y:s,radius:4,maxRadius:48,color:t==="w"?"rgba(255, 235, 180, 0.9)":"rgba(120, 140, 180, 0.9)",alpha:.9,decay:2.8,lineWidth:3});const r=t==="w"?["#ffffff","#fef08a","#f59e0b","#fbbf24"]:["#94a3b8","#cbd5e1","#64748b","#38bdf8"],e=18;for(let c=0;c{if(n<0||n>7||g<0||g>7)return!1;const u=b(n,g),d=t.get(u);return!d||!d.color?(l.push({target:u,isCapture:!1}),!0):(d.color!==s&&l.push({target:u,isCapture:!0}),!1)};switch(r.type){case"p":{const n=s==="w"?1:-1,g=s==="w"?1:6,u=b(e,c+n),d=t.get(u);if(d&&!d.color&&(l.push({target:u,isCapture:!1}),c===g)){const f=b(e,c+n*2),p=t.get(f);p&&!p.color&&l.push({target:f,isCapture:!1})}for(const f of[-1,1])if(e+f>=0&&e+f<=7){const p=b(e+f,c+n),h=t.get(p);h&&h.color&&h.color!==s&&l.push({target:p,isCapture:!0})}break}case"n":{const n=[[-2,-1],[-2,1],[-1,-2],[-1,2],[1,-2],[1,2],[2,-1],[2,1]];for(const[g,u]of n){const d=e+g,f=c+u;if(d>=0&&d<=7&&f>=0&&f<=7){const p=b(d,f),h=t.get(p);!h||!h.color?l.push({target:p,isCapture:!1}):h.color!==s&&l.push({target:p,isCapture:!0})}}break}case"b":{const n=[[-1,-1],[-1,1],[1,-1],[1,1]];for(const[g,u]of n){let d=e+g,f=c+u;for(;m(d,f);)d+=g,f+=u}break}case"r":{const n=[[-1,0],[1,0],[0,-1],[0,1]];for(const[g,u]of n){let d=e+g,f=c+u;for(;m(d,f);)d+=g,f+=u}break}case"q":{const n=[[-1,-1],[-1,1],[1,-1],[1,1],[-1,0],[1,0],[0,-1],[0,1]];for(const[g,u]of n){let d=e+g,f=c+u;for(;m(d,f);)d+=g,f+=u}break}case"k":{for(let g=-1;g<=1;g++)for(let u=-1;u<=1;u++){if(g===0&&u===0)continue;const d=e+g,f=c+u;if(d>=0&&d<=7&&f>=0&&f<=7){const p=b(d,f),h=t.get(p);!h||!h.color?l.push({target:p,isCapture:!1}):h.color!==s&&l.push({target:p,isCapture:!0})}}const n=s==="w"?0:7;if(c===n&&e===4){const g=t.get(b(5,n)),u=t.get(b(6,n)),d=t.get(b(7,n));g&&!g.color&&u&&!u.color&&(d==null?void 0:d.type)==="r"&&d.color===s&&l.push({target:b(6,n),isCapture:!1});const f=t.get(b(3,n)),p=t.get(b(2,n)),h=t.get(b(1,n)),y=t.get(b(0,n));f&&!f.color&&p&&!p.color&&h&&!h.color&&(y==null?void 0:y.type)==="r"&&y.color===s&&l.push({target:b(2,n),isCapture:!1})}break}}return l.filter(n=>!ft(o,n.target,a,s))}function ft(o,a,s,t){const r=s.map(d=>{if(d.square===o)return{square:o,type:null,color:null};if(d.square===a){const f=s.find(p=>p.square===o);return{square:a,type:(f==null?void 0:f.type)??null,color:t}}return{...d}}),e=r.find(d=>d.type==="k"&&d.color===t);if(!e)return!1;const{f:c,r:l}=z(e.square),m=t==="w"?"b":"w",n=new Map;for(const d of r)n.set(d.square,d);const g=[[-2,-1],[-2,1],[-1,-2],[-1,2],[1,-2],[1,2],[2,-1],[2,1]];for(const[d,f]of g){const p=c+d,h=l+f;if(p>=0&&p<=7&&h>=0&&h<=7){const y=n.get(b(p,h));if(y&&y.color===m&&y.type==="n")return!0}}const u=m==="w"?1:-1;for(const d of[-1,1]){const f=c-d,p=l-u;if(f>=0&&f<=7&&p>=0&&p<=7){const h=n.get(b(f,p));if(h&&h.color===m&&h.type==="p")return!0}}for(const[d,f]of[[-1,0],[1,0],[0,-1],[0,1]]){let p=c+d,h=l+f;for(;p>=0&&p<=7&&h>=0&&h<=7;){const y=n.get(b(p,h));if(y&&y.color){if(y.color===m&&(y.type==="r"||y.type==="q"))return!0;break}p+=d,h+=f}}for(const[d,f]of[[-1,-1],[-1,1],[1,-1],[1,1]]){let p=c+d,h=l+f;for(;p>=0&&p<=7&&h>=0&&h<=7;){const y=n.get(b(p,h));if(y&&y.color){if(y.color===m&&(y.type==="b"||y.type==="q"))return!0;break}p+=d,h+=f}}for(let d=-1;d<=1;d++)for(let f=-1;f<=1;f++){if(d===0&&f===0)continue;const p=c+d,h=l+f;if(p>=0&&p<=7&&h>=0&&h<=7){const y=n.get(b(p,h));if(y&&y.color===m&&y.type==="k")return!0}}return!1}let i=null,Z=null,T=null,x=null,M="",$=[],L=null,R=null,F=!1;const C=(o,a)=>(T==null?void 0:T.locale)==="en"?a:o,A=ot({onInit(o){T=o,document.documentElement.lang=o.locale,document.documentElement.dir=o.dir,document.getElementById("board-grid")||H(),I()},onState(o){if(o.t==="snap"){if(document.getElementById("board-grid")||H(),Z=i,i=o.body,i.turn!==i.me&&(M="",$=[],L=null),Z&&i){const a=new Map(Z.board.map(e=>[e.square,e])),s=new Map(i.board.map(e=>[e.square,e]));let t="",r="";for(const[e,c]of s.entries()){const l=a.get(e);l&&(l.color&&!c.color?t=e:c.color&&(!l.color||l.color!==c.color||l.type!==c.type)&&(r=e))}t&&r&&(R={from:t,to:r})}I(),pt(Z,i)}},onAck(o){o.status==="rejected"&&A.toast("حرکت پذیرفته نشد","Move not accepted","warn")}});function pt(o,a){var m;if(!o||!a||!x)return;const s=new Map(o.board.map(n=>[n.square,n])),t=new Map(a.board.map(n=>[n.square,n]));let r="",e="",c=null,l="";for(const[n,g]of t.entries()){const u=s.get(n);u&&(u.color&&!g.color?r=n:g.color&&(!u.color||u.color!==g.color||u.type!==g.type)&&(e=n,u.color&&u.color!==g.color&&(c=u,l=n)))}if(!c&&r&&e)for(const[n,g]of t.entries()){const u=s.get(n);if(u&&u.color&&!g.color&&n!==r){c=u,l=n;break}}if(r&&e){R={from:r,to:e};const n=document.querySelector(`[data-square="${e}"]`),g=document.querySelector(`[data-square="${r}"]`),u=document.getElementById("board-grid"),d=document.getElementById("ghost-layer");if(n){const f=n.getBoundingClientRect(),p=(m=document.getElementById("vfx-canvas"))==null?void 0:m.getBoundingClientRect();if(p){const y=f.left-p.left+f.width/2,v=f.top-p.top+f.height/2;c?(x.captureImpact(y,v,c.color),setTimeout(()=>{x==null||x.dissolvePuff(y,v,c.color)},440)):x.landingPuff(y,v)}const h=n.querySelector(".piece-wrapper");h&&(h.classList.remove("anim-land","anim-strike"),h.offsetWidth,c?(h.classList.add("anim-strike"),n.classList.remove("anim-shudder"),n.offsetWidth,n.classList.add("anim-shudder")):h.classList.add("anim-land"))}if(c&&u&&d){const f=l||e,p=document.querySelector(`[data-square="${f}"]`);if(p){const h=u.getBoundingClientRect(),y=p.getBoundingClientRect();let v="right";if(g){const q=g.getBoundingClientRect();y.left${k}`,d.appendChild(w),setTimeout(()=>{w.remove()},800)}}}a.phase==="over"&&a.winner!==null&&!F&&(F=!0,setTimeout(()=>x==null?void 0:x.victoryConfetti(),350))}function H(){const o=document.getElementById("app");o.innerHTML=`
+
+
+
+
+ `;const a=document.getElementById("vfx-canvas");x=new dt(a);const s=document.getElementById("board-grid");s.addEventListener("click",t=>{const r=t.target.closest(".cell");r&&r.dataset.square&&!r.disabled&&yt(r.dataset.square)});for(let t=0;t<64;t++){const r=document.createElement("button");r.className="cell",r.dataset.index=String(t),s.appendChild(r)}}function I(){var y;if(!i)return;const o=i.me,a=o!=null&&i.players[o]!==void 0;let s,t;a?(s=i.players[o],t=i.players.find(v=>v.seat!==o)||i.players[1-o]):(s=i.players.find(v=>v.color==="w")||i.players[0],t=i.players.find(v=>v.color==="b")||i.players[1]);const r=(s==null?void 0:s.color)||"w",e=r==="b",c=s?i.turn===s.seat&&i.phase==="play":!1,l=t?i.turn===t.seat&&i.phase==="play":!1;j("top-bar",t,l,!1),j("bottom-bar",s,c,a);const m=new Map;for(const v of i.board)m.set(v.square,v);const n=e?[7,6,5,4,3,2,1,0]:[0,1,2,3,4,5,6,7],g=e?[0,1,2,3,4,5,6,7]:[7,6,5,4,3,2,1,0],u=document.getElementById("board-grid");if(!u)return;const d=u.children;let f=0;const p=i.phase==="play"&&i.turn===o,h=i.check&&i.phase==="play"?(y=i.board.find(v=>{var w;return v.type==="k"&&v.color===((w=i.players[i.turn])==null?void 0:w.color)}))==null?void 0:y.square:null;for(const v of g)for(const w of n){const k=String.fromCharCode(97+w)+(v+1),q=m.get(k)||{type:null,color:null},P=d[f++];P.dataset.square=k,P.dataset.color=q.color||"";const K=(w+v)%2===0?"dark":"light",D=M===k,U=R&&(R.from===k||R.to===k),V=h===k;P.className=`cell ${K}`+(D?" selected":"")+(U?" last-move":"")+(V?" in-check":"");const Y=$.some(E=>E.target===k),Q=$.some(E=>E.target===k&&E.isCapture);let B="";const J=e?w===7:w===0,X=e?v===7:v===0;if(J&&(B+=`${v+1} `),X&&(B+=`${String.fromCharCode(97+w)} `),q.type&&q.color){const E=_(q.type,q.color),et=q.type==="n"&&D?" anim-knight":"";B+=`${E}
`}Q?B+='
':Y&&(B+='
'),P.innerHTML=B;const W=p&&!0&&q.color===r,tt=M?p:W;P.disabled=!tt}gt()}function j(o,a,s,t){const r=document.getElementById(o);if(!r||!a||!i)return;r.className="player-bar"+(s?" active":"");const e=ut(a.color),c=ht(a.color),l=c>0?`+${c} `:"",m=a.bot?'BOT ':"",n=t?`${C("شما","YOU")} `:"",g=i.phase==="over"?i.winner===a.seat?C("برنده 🏆","Winner 🏆"):i.winner===null?C("تساوی 🤝","Draw 🤝"):"":s?t?C("نوبت شماست","Your turn"):C("در حال تفکر…","Thinking…"):"";r.innerHTML=`
+
+
+ ${a.color==="w"?"♔":"♚"}
+
+
+
+
+ ${e.map(u=>`
${_(u.type,u.color)}
`).join("")}
+ ${l}
+
+ `}function ut(o){if(!i)return[];const a=o==="w"?"b":"w",s={p:8,n:2,b:2,r:2,q:1},t={p:0,n:0,b:0,r:0,q:0};for(const e of i.board)e.color===a&&e.type&&t[e.type]!==void 0&&t[e.type]++;const r=[];for(const e of["q","r","b","n","p"]){const c=s[e]-(t[e]||0);for(let l=0;l
+
+
+ `,o.querySelectorAll("[data-promo]").forEach(e=>{e.addEventListener("click",()=>{var l;const c=e.dataset.promo;if(L&&c){A.cmd("move",{from:L.from,to:L.to,promotion:c});const m=document.querySelector(`[data-square="${L.to}"]`);if(m){const n=m.getBoundingClientRect(),g=(l=document.getElementById("vfx-canvas"))==null?void 0:l.getBoundingClientRect();g&&(x==null||x.promotionBurst(n.left-g.left+n.width/2,n.top-g.top+n.height/2))}L=null,M="",$=[],I()}})}),(s=o.querySelector("[data-cancel-promo]"))==null||s.addEventListener("click",()=>{L=null,I()});return}if(i.phase==="over"){i.winner!==null&&(i.winner,i.me);const r=i.winner===null;let e="",c="";r?i.result_reason==="stalemate"?(e=C("پات — مساوی!","Stalemate — Draw!"),c=C("شاه راه حرکتی ندارد","King has no legal moves")):i.result_reason==="insufficient_material"?(e=C("تساوی — عدم کفایت مهرهها","Draw — Insufficient Material"),c=C("مهره کافی برای مات کردن در صفحه وجود ندارد","Neither side has sufficient pieces to force checkmate")):(e=C("بازی مساوی شد","Draw!"),c=C("هیچکدام از طرفین برنده نشد","No side achieved victory")):(e=`${(t=i.players[i.winner])==null?void 0:t.name} ${C("برنده شد! 🏆","Wins! 🏆")}`,c=i.result_reason==="checkmate"?C("با کیش و مات حریف","By checkmate"):i.result_reason==="abandoned"?C("به دلیل ترک حریف","By abandonment"):""),o.innerHTML=`
+
+ `;return}o.innerHTML=""}}function yt(o){var r;if(!i||i.phase!=="play"||L)return;const a=i.me;if(a==null||i.turn!==a)return;const s=(r=i.players[a])==null?void 0:r.color;if(!s)return;const t=i.board.find(e=>e.square===o);if(M){if(M===o){M="",$=[],I();return}if(t!=null&&t.color&&t.color===s){M=o;try{$=N(o,i.board,s)}catch{$=[]}I();return}const e=i.board.find(l=>l.square===M),c=s==="b"?"1":"8";if((e==null?void 0:e.type)==="p"&&o[1]===c){L={from:M,to:o},M="",$=[],I();return}A.cmd("move",{from:M,to:o}),M="",$=[],I()}else if(t&&t.color===s){M=o;try{$=N(o,i.board,s)}catch{$=[]}I()}}
diff --git a/client/assets/index-B4rUxhLC.js b/client/assets/index-B4rUxhLC.js
new file mode 100644
index 0000000..5008801
--- /dev/null
+++ b/client/assets/index-B4rUxhLC.js
@@ -0,0 +1,205 @@
+(function(){const c=document.createElement("link").relList;if(c&&c.supports&&c.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))t(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&t(a)}).observe(document,{childList:!0,subtree:!0});function r(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function t(s){if(s.ep)return;s.ep=!0;const o=r(s);fetch(s.href,o)}})();function ot(e){const c=new URLSearchParams(location.search).get("host")??"*",r=s=>window.parent.postMessage({m3:1,...s},c);let t=0;return window.addEventListener("message",s=>{var a,d,u;if(s.source!==window.parent||c!=="*"&&s.origin!==c)return;const o=s.data;if(!(!o||o.m3!==1))switch(o.type){case"init":e.onInit(o),r({type:"ready"});break;case"state":e.onState(o.env);break;case"ack":(a=e.onAck)==null||a.call(e,o);break;case"view_changed":(d=e.onViewChanged)==null||d.call(e,o.view);break;case"cmd_failed":(u=e.onCmdFailed)==null||u.call(e,o.req_id,o.code);break}}),r({type:"loaded"}),{cmd(s,o={}){const a=++t;return r({type:"cmd",cmd_type:s,payload:o,req_id:a}),a},toast(s,o,a="info"){r({type:"toast",text_fa:s,text_en:o,kind:a})}}}const E=`
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+`,P=`
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+`;function rt(e){const c=e?E:P,r=e?"#0f172a":"#020617",t=e?"url(#cp-w-body)":"url(#cp-b-body)",s=e?"url(#cp-w-spec)":"url(#cp-b-spec)",o=e?"url(#cp-w-gold)":"url(#cp-b-gold)";return`
+ ${c}
+
+
+
+
+
+
+
+
+
+
+
+
+ `}function st(e){const c=e?E:P,r=e?"#0f172a":"#020617",t=e?"url(#cp-w-body)":"url(#cp-b-body)",s=e?"url(#cp-w-spec)":"url(#cp-b-spec)",o=e?"url(#cp-w-gold)":"url(#cp-b-gold)",a=e?"url(#cp-ruby)":"url(#cp-sapphire)";return`
+ ${c}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ `}function ct(e){const c=e?E:P,r=e?"#0f172a":"#020617",t=e?"url(#cp-w-body)":"url(#cp-b-body)",s=e?"url(#cp-w-spec)":"url(#cp-b-spec)",o=e?"url(#cp-w-gold)":"url(#cp-b-gold)";return`
+ ${c}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ `}function at(e){const c=e?E:P,r=e?"#0f172a":"#020617",t=e?"url(#cp-w-body)":"url(#cp-b-body)",s=e?"url(#cp-w-spec)":"url(#cp-b-spec)",o=e?"url(#cp-w-gold)":"url(#cp-b-gold)";return`
+ ${c}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ `}function nt(e){const c=e?E:P,r=e?"#0f172a":"#020617",t=e?"url(#cp-w-body)":"url(#cp-b-body)",s=e?"url(#cp-w-spec)":"url(#cp-b-spec)",o=e?"url(#cp-w-gold)":"url(#cp-b-gold)",a=e?"url(#cp-ruby)":"url(#cp-sapphire)",d=e?"url(#cp-pearl)":"url(#cp-amethyst)";return`
+ ${c}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ `}function lt(e){const c=e?E:P,r=e?"#0f172a":"#020617",t=e?"url(#cp-w-body)":"url(#cp-b-body)",s=e?"url(#cp-w-spec)":"url(#cp-b-spec)",o=e?"url(#cp-w-gold)":"url(#cp-b-gold)";return`
+ ${c}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ `}const it={p:rt,n:st,b:ct,r:at,q:nt,k:lt},T={};function _(e,c){if(!e||!c)return"";const r=`${e}-${c}`;if(!T[r]){const t=it[e];t&&(T[r]=t(c==="w"))}return T[r]??""}class dt{constructor(c){this.particles=[],this.shockwaves=[],this.animId=null,this.lastTime=0,this.canvas=c,this.ctx=c.getContext("2d"),this.resize(),window.addEventListener("resize",()=>this.resize()),this.startLoop()}resize(){var t,s,o;const c=(t=this.canvas.parentElement)==null?void 0:t.getBoundingClientRect();if(!c)return;const r=window.devicePixelRatio||1;this.canvas.width=Math.round(c.width*r),this.canvas.height=Math.round(c.height*r),this.canvas.style.width=`${c.width}px`,this.canvas.style.height=`${c.height}px`,(o=(s=this.ctx).resetTransform)==null||o.call(s),this.ctx.scale(r,r)}startLoop(){if(this.animId)return;const c=r=>{const t=this.lastTime?Math.min((r-this.lastTime)/1e3,.1):.016;this.lastTime=r,this.update(t),this.render(),this.animId=requestAnimationFrame(c)};this.animId=requestAnimationFrame(c)}update(c){for(let r=this.shockwaves.length-1;r>=0;r--){const t=this.shockwaves[r];t.radius+=(t.maxRadius-t.radius)*12*c,t.alpha-=t.decay*c,(t.alpha<=0||t.radius>=t.maxRadius*.98)&&this.shockwaves.splice(r,1)}for(let r=this.particles.length-1;r>=0;r--){const t=this.particles[r];t.x+=t.vx*c,t.y+=t.vy*c,t.vx*=Math.pow(t.drag,c*60),t.vy*=Math.pow(t.drag,c*60),t.vy+=t.gravity*c,t.vRot&&t.rotation!==void 0&&(t.rotation+=t.vRot*c),t.alpha-=t.decay*c,t.alpha<=0&&this.particles.splice(r,1)}}render(){const c=this.canvas.width/(window.devicePixelRatio||1),r=this.canvas.height/(window.devicePixelRatio||1);this.ctx.clearRect(0,0,c,r);for(const t of this.shockwaves)this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(t.x,t.y,Math.max(1,t.radius),0,Math.PI*2),this.ctx.strokeStyle=t.color,this.ctx.globalAlpha=Math.max(0,t.alpha),this.ctx.lineWidth=t.lineWidth,this.ctx.stroke(),this.ctx.restore();for(const t of this.particles){if(this.ctx.save(),this.ctx.globalAlpha=Math.max(0,t.alpha),this.ctx.fillStyle=t.color,t.shape==="rect"||t.shape==="spark"){this.ctx.translate(t.x,t.y),t.rotation!==void 0&&this.ctx.rotate(t.rotation);const s=t.size||t.radius*2;t.shape==="spark"?this.ctx.fillRect(-s,-s*.25,s*2,s*.5):this.ctx.fillRect(-s*.5,-s*.5,s,s)}else this.ctx.beginPath(),this.ctx.arc(t.x,t.y,Math.max(.5,t.radius),0,Math.PI*2),this.ctx.fill();this.ctx.restore()}}captureImpact(c,r,t="w"){this.shockwaves.push({x:c,y:r,radius:4,maxRadius:48,color:t==="w"?"rgba(255, 235, 180, 0.9)":"rgba(120, 140, 180, 0.9)",alpha:.9,decay:2.8,lineWidth:3});const s=t==="w"?["#ffffff","#fef08a","#f59e0b","#fbbf24"]:["#94a3b8","#cbd5e1","#64748b","#38bdf8"],o=18;for(let a=0;a{if(l<0||l>7||p<0||p>7)return!1;const g=v(l,p),i=t.get(g);return!i||!i.color?(d.push({target:g,isCapture:!1}),!0):(i.color!==r&&d.push({target:g,isCapture:!0}),!1)};switch(s.type){case"p":{const l=r==="w"?1:-1,p=r==="w"?1:6,g=v(o,a+l),i=t.get(g);if(i&&!i.color&&(d.push({target:g,isCapture:!1}),a===p)){const f=v(o,a+l*2),h=t.get(f);h&&!h.color&&d.push({target:f,isCapture:!1})}for(const f of[-1,1])if(o+f>=0&&o+f<=7){const h=v(o+f,a+l),y=t.get(h);y&&y.color&&y.color!==r&&d.push({target:h,isCapture:!0})}break}case"n":{const l=[[-2,-1],[-2,1],[-1,-2],[-1,2],[1,-2],[1,2],[2,-1],[2,1]];for(const[p,g]of l){const i=o+p,f=a+g;if(i>=0&&i<=7&&f>=0&&f<=7){const h=v(i,f),y=t.get(h);!y||!y.color?d.push({target:h,isCapture:!1}):y.color!==r&&d.push({target:h,isCapture:!0})}}break}case"b":{const l=[[-1,-1],[-1,1],[1,-1],[1,1]];for(const[p,g]of l){let i=o+p,f=a+g;for(;u(i,f);)i+=p,f+=g}break}case"r":{const l=[[-1,0],[1,0],[0,-1],[0,1]];for(const[p,g]of l){let i=o+p,f=a+g;for(;u(i,f);)i+=p,f+=g}break}case"q":{const l=[[-1,-1],[-1,1],[1,-1],[1,1],[-1,0],[1,0],[0,-1],[0,1]];for(const[p,g]of l){let i=o+p,f=a+g;for(;u(i,f);)i+=p,f+=g}break}case"k":{for(let p=-1;p<=1;p++)for(let g=-1;g<=1;g++){if(p===0&&g===0)continue;const i=o+p,f=a+g;if(i>=0&&i<=7&&f>=0&&f<=7){const h=v(i,f),y=t.get(h);!y||!y.color?d.push({target:h,isCapture:!1}):y.color!==r&&d.push({target:h,isCapture:!0})}}const l=r==="w"?0:7;if(a===l&&o===4){const p=t.get(v(5,l)),g=t.get(v(6,l)),i=t.get(v(7,l));p&&!p.color&&g&&!g.color&&(i==null?void 0:i.type)==="r"&&i.color===r&&d.push({target:v(6,l),isCapture:!1});const f=t.get(v(3,l)),h=t.get(v(2,l)),y=t.get(v(1,l)),m=t.get(v(0,l));f&&!f.color&&h&&!h.color&&y&&!y.color&&(m==null?void 0:m.type)==="r"&&m.color===r&&d.push({target:v(2,l),isCapture:!1})}break}}return d.filter(l=>!ft(e,l.target,c,r))}function ft(e,c,r,t){const s=r.map(i=>{if(i.square===e)return{square:e,type:null,color:null};if(i.square===c){const f=r.find(h=>h.square===e);return{square:c,type:(f==null?void 0:f.type)??null,color:t}}return{...i}}),o=s.find(i=>i.type==="k"&&i.color===t);if(!o)return!1;const{f:a,r:d}=H(o.square),u=t==="w"?"b":"w",l=new Map;for(const i of s)l.set(i.square,i);const p=[[-2,-1],[-2,1],[-1,-2],[-1,2],[1,-2],[1,2],[2,-1],[2,1]];for(const[i,f]of p){const h=a+i,y=d+f;if(h>=0&&h<=7&&y>=0&&y<=7){const m=l.get(v(h,y));if(m&&m.color===u&&m.type==="n")return!0}}const g=u==="w"?1:-1;for(const i of[-1,1]){const f=a-i,h=d-g;if(f>=0&&f<=7&&h>=0&&h<=7){const y=l.get(v(f,h));if(y&&y.color===u&&y.type==="p")return!0}}for(const[i,f]of[[-1,0],[1,0],[0,-1],[0,1]]){let h=a+i,y=d+f;for(;h>=0&&h<=7&&y>=0&&y<=7;){const m=l.get(v(h,y));if(m&&m.color){if(m.color===u&&(m.type==="r"||m.type==="q"))return!0;break}h+=i,y+=f}}for(const[i,f]of[[-1,-1],[-1,1],[1,-1],[1,1]]){let h=a+i,y=d+f;for(;h>=0&&h<=7&&y>=0&&y<=7;){const m=l.get(v(h,y));if(m&&m.color){if(m.color===u&&(m.type==="b"||m.type==="q"))return!0;break}h+=i,y+=f}}for(let i=-1;i<=1;i++)for(let f=-1;f<=1;f++){if(i===0&&f===0)continue;const h=a+i,y=d+f;if(h>=0&&h<=7&&y>=0&&y<=7){const m=l.get(v(h,y));if(m&&m.color===u&&m.type==="k")return!0}}return!1}let n=null,F=null,Z=null,$=null,C="",M=[],x=null,R=null,N=!1;const w=(e,c)=>(Z==null?void 0:Z.locale)==="en"?c:e,O=ot({onInit(e){Z=e,document.documentElement.lang=e.locale,document.documentElement.dir=e.dir,document.getElementById("board-grid")||j(),k()},onState(e){e.t==="snap"&&(document.getElementById("board-grid")||j(),F=n,n=e.body,pt(F,n),n.turn!==n.me&&(C="",M=[],x=null),k())},onAck(e){e.status==="rejected"&&O.toast("حرکت پذیرفته نشد","Move not accepted","warn")}});function pt(e,c){var d;if(!e||!c||!$)return;const r=new Map(e.board.map(u=>[u.square,u])),t=new Map(c.board.map(u=>[u.square,u]));let s="",o="",a=null;for(const[u,l]of t.entries()){const p=r.get(u);p&&(p.color&&!l.color?s=u:l.color&&(!p.color||p.color!==l.color||p.type!==l.type)&&(o=u,p.color&&p.color!==l.color&&(a=p)))}if(s&&o){R={from:s,to:o};const u=document.querySelector(`[data-square="${o}"]`);if(u){const l=u.getBoundingClientRect(),p=(d=document.getElementById("vfx-canvas"))==null?void 0:d.getBoundingClientRect();if(p){const i=l.left-p.left+l.width/2,f=l.top-p.top+l.height/2;a?$.captureImpact(i,f,a.color):$.landingPuff(i,f)}const g=u.querySelector(".piece-wrapper");g&&(g.classList.remove("anim-land"),g.offsetWidth,g.classList.add("anim-land"))}}c.phase==="over"&&c.winner!==null&&!N&&(N=!0,setTimeout(()=>$==null?void 0:$.victoryConfetti(),350))}function j(){const e=document.getElementById("app");e.innerHTML=`
+
+
+
+
+ `;const c=document.getElementById("vfx-canvas");$=new dt(c);const r=document.getElementById("board-grid");r.addEventListener("click",t=>{const s=t.target.closest(".cell");s&&s.dataset.square&&!s.disabled&&yt(s.dataset.square)});for(let t=0;t<64;t++){const s=document.createElement("button");s.className="cell",s.dataset.index=String(t),r.appendChild(s)}}function k(){var m;if(!n)return;const e=n.me,c=e!=null&&n.players[e]!==void 0;let r,t;c?(r=n.players[e],t=n.players.find(b=>b.seat!==e)||n.players[1-e]):(r=n.players.find(b=>b.color==="w")||n.players[0],t=n.players.find(b=>b.color==="b")||n.players[1]);const s=(r==null?void 0:r.color)||"w",o=s==="b",a=r?n.turn===r.seat&&n.phase==="play":!1,d=t?n.turn===t.seat&&n.phase==="play":!1;z("top-bar",t,d,!1),z("bottom-bar",r,a,c);const u=new Map;for(const b of n.board)u.set(b.square,b);const l=o?[7,6,5,4,3,2,1,0]:[0,1,2,3,4,5,6,7],p=o?[0,1,2,3,4,5,6,7]:[7,6,5,4,3,2,1,0],g=document.getElementById("board-grid");if(!g)return;const i=g.children;let f=0;const h=n.phase==="play"&&n.turn===e,y=n.check&&n.phase==="play"?(m=n.board.find(b=>{var L;return b.type==="k"&&b.color===((L=n.players[n.turn])==null?void 0:L.color)}))==null?void 0:m.square:null;for(const b of p)for(const L of l){const I=String.fromCharCode(97+L)+(b+1),q=u.get(I)||{type:null,color:null},S=i[f++];S.dataset.square=I,S.dataset.color=q.color||"";const K=(L+b)%2===0?"dark":"light",A=C===I,U=R&&(R.from===I||R.to===I),V=y===I;S.className=`cell ${K}`+(A?" selected":"")+(U?" last-move":"")+(V?" in-check":"");const Y=M.some(B=>B.target===I),Q=M.some(B=>B.target===I&&B.isCapture);let G="";const J=o?L===7:L===0,X=o?b===7:b===0;if(J&&(G+=`${b+1} `),X&&(G+=`${String.fromCharCode(97+L)} `),q.type&&q.color){const B=_(q.type,q.color),et=q.type==="n"&&A?" anim-knight":"";G+=`${B}
`}Q?G+='
':Y&&(G+='
'),S.innerHTML=G;const W=h&&!0&&q.color===s,tt=C?h:W;S.disabled=!tt}gt()}function z(e,c,r,t){const s=document.getElementById(e);if(!s||!c||!n)return;s.className="player-bar"+(r?" active":"");const o=ut(c.color),a=ht(c.color),d=a>0?`+${a} `:"",u=c.bot?'BOT ':"",l=t?`${w("شما","YOU")} `:"",p=n.phase==="over"?n.winner===c.seat?w("برنده 🏆","Winner 🏆"):n.winner===null?w("تساوی 🤝","Draw 🤝"):"":r?t?w("نوبت شماست","Your turn"):w("در حال تفکر…","Thinking…"):"";s.innerHTML=`
+
+
+ ${c.color==="w"?"♔":"♚"}
+
+
+
+
+ ${o.map(g=>`
${_(g.type,g.color)}
`).join("")}
+ ${d}
+
+ `}function ut(e){if(!n)return[];const c=e==="w"?"b":"w",r={p:8,n:2,b:2,r:2,q:1},t={p:0,n:0,b:0,r:0,q:0};for(const o of n.board)o.color===c&&o.type&&t[o.type]!==void 0&&t[o.type]++;const s=[];for(const o of["q","r","b","n","p"]){const a=r[o]-(t[o]||0);for(let d=0;d
+
+
+ `,e.querySelectorAll("[data-promo]").forEach(o=>{o.addEventListener("click",()=>{var d;const a=o.dataset.promo;if(x&&a){O.cmd("move",{from:x.from,to:x.to,promotion:a});const u=document.querySelector(`[data-square="${x.to}"]`);if(u){const l=u.getBoundingClientRect(),p=(d=document.getElementById("vfx-canvas"))==null?void 0:d.getBoundingClientRect();p&&($==null||$.promotionBurst(l.left-p.left+l.width/2,l.top-p.top+l.height/2))}x=null,C="",M=[],k()}})}),(r=e.querySelector("[data-cancel-promo]"))==null||r.addEventListener("click",()=>{x=null,k()});return}if(n.phase==="over"){n.winner!==null&&(n.winner,n.me);const s=n.winner===null;let o="",a="";s?n.result_reason==="stalemate"?(o=w("پات — مساوی!","Stalemate — Draw!"),a=w("شاه راه حرکتی ندارد","King has no legal moves")):n.result_reason==="insufficient_material"?(o=w("تساوی — عدم کفایت مهرهها","Draw — Insufficient Material"),a=w("مهره کافی برای مات کردن در صفحه وجود ندارد","Neither side has sufficient pieces to force checkmate")):(o=w("بازی مساوی شد","Draw!"),a=w("هیچکدام از طرفین برنده نشد","No side achieved victory")):(o=`${(t=n.players[n.winner])==null?void 0:t.name} ${w("برنده شد! 🏆","Wins! 🏆")}`,a=n.result_reason==="checkmate"?w("با کیش و مات حریف","By checkmate"):n.result_reason==="abandoned"?w("به دلیل ترک حریف","By abandonment"):""),e.innerHTML=`
+
+ `;return}e.innerHTML=""}}function yt(e){var s;if(!n||n.phase!=="play"||x)return;const c=n.me;if(c==null||n.turn!==c)return;const r=(s=n.players[c])==null?void 0:s.color;if(!r)return;const t=n.board.find(o=>o.square===e);if(C){if(C===e){C="",M=[],k();return}if(t!=null&&t.color&&t.color===r){C=e;try{M=D(e,n.board,r)}catch{M=[]}k();return}const o=n.board.find(d=>d.square===C),a=r==="b"?"1":"8";if((o==null?void 0:o.type)==="p"&&e[1]===a){x={from:C,to:e},C="",M=[],k();return}O.cmd("move",{from:C,to:e}),C="",M=[],k()}else if(t&&t.color===r){C=e;try{M=D(e,n.board,r)}catch{M=[]}k()}}
diff --git a/client/assets/index-CJ1BuKCF.css b/client/assets/index-CJ1BuKCF.css
new file mode 100644
index 0000000..1cd4130
--- /dev/null
+++ b/client/assets/index-CJ1BuKCF.css
@@ -0,0 +1 @@
+:root{--bg-primary: #14151b;--bg-card: #1e2029;--bg-card-hover: #282a36;--text-main: #f3f4f6;--text-muted: #9ca3af;--gold-accent: #f59e0b;--gold-light: #fbbf24;--danger: #ef4444;--board-light: #f0d9b5;--board-dark: #b58863;--board-border: #3b2818;--coord-light: #b58863;--coord-dark: #f0d9b5}*,*:before,*:after{box-sizing:border-box}html,body{margin:0;padding:0;width:100%;height:100%;background:radial-gradient(circle at center,#1b1c26,#101117);color:var(--text-main);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Vazirmatn,sans-serif;overflow:hidden;user-select:none;-webkit-user-select:none}#app{width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:8px 12px;gap:8px}.player-bar{width:min(88vmin,540px);display:flex;align-items:center;justify-content:space-between;padding:6px 12px;background:#1e2029d9;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);border-radius:8px;border:1px solid rgba(255,255,255,.08);box-shadow:0 4px 12px #0000004d;transition:border-color .25s ease,box-shadow .25s ease}.player-bar.active{border-color:var(--gold-accent);box-shadow:0 0 14px #f59e0b59}.player-profile{display:flex;align-items:center;gap:10px}.player-badge{width:28px;height:28px;border-radius:6px;display:flex;align-items:center;justify-content:center;font-size:16px;box-shadow:0 2px 4px #0003}.player-badge.w{background:#f8fafc;color:#1e293b;border:1px solid #cbd5e1}.player-badge.b{background:#1e2029;color:#f8fafc;border:1px solid #475569}.player-meta{display:flex;flex-direction:column;gap:2px}.player-name{font-size:14px;font-weight:700;display:flex;align-items:center;gap:6px}.bot-tag{font-size:10px;font-weight:800;padding:1px 5px;background:#334155;color:#94a3b8;border-radius:4px;letter-spacing:.5px}.bot-tag.you-tag{background:#1e3a8a;color:#60a5fa;border:1px solid rgba(96,165,250,.4)}.player-status{font-size:11px;color:var(--text-muted)}.captured-tray{display:flex;align-items:center;gap:2px;min-height:22px;flex-wrap:wrap}.captured-tray .mini-piece{width:21px;height:21px;opacity:.95;filter:drop-shadow(0 2px 3px rgba(0,0,0,.45));display:flex;align-items:center;justify-content:center}.advantage-score{font-size:11px;font-weight:800;color:var(--gold-accent);margin-inline-start:4px}.board-container{position:relative;width:min(88vmin,540px);aspect-ratio:1;border-radius:8px;box-shadow:0 12px 32px #0009,0 2px 6px #0006;padding:4px;background:var(--board-border);direction:ltr!important}.board-grid{display:grid;grid-template-columns:repeat(8,1fr);grid-template-rows:repeat(8,1fr);width:100%;height:100%;border-radius:6px;overflow:hidden;direction:ltr!important}.cell{position:relative;aspect-ratio:1;padding:0;margin:0;border:0;background:transparent;cursor:pointer;display:flex;align-items:center;justify-content:center;outline:none;transition:background-color .15s ease}.cell.light{background-color:var(--board-light)}.cell.dark{background-color:var(--board-dark)}.cell.selected{background-color:#baca44!important}.cell.last-move{background-color:#f59e0b6b!important}.cell.in-check{background:radial-gradient(circle at center,rgba(239,68,68,.95) 0%,rgba(220,38,38,.4) 60%,transparent 75%)!important;animation:king-check-pulse 1.2s ease-in-out infinite}@keyframes king-check-pulse{0%,to{filter:drop-shadow(0 0 4px rgba(239,68,68,.8))}50%{filter:drop-shadow(0 0 14px rgba(239,68,68,1))}}.coord-rank,.coord-file{position:absolute;font-size:10px;font-weight:800;pointer-events:none;opacity:.75;line-height:1}.coord-rank{top:3px;left:4px}.coord-file{bottom:3px;right:4px}.cell.light .coord-rank,.cell.light .coord-file{color:var(--coord-light)}.cell.dark .coord-rank,.cell.dark .coord-file{color:var(--coord-dark)}.piece-wrapper{width:92%;height:92%;display:flex;align-items:center;justify-content:center;pointer-events:none;transition:transform .22s cubic-bezier(.34,1.56,.64,1),filter .22s ease}.piece-svg{width:100%;height:100%;display:block;filter:drop-shadow(0 3px 5px rgba(0,0,0,.38));transition:filter .25s ease}.piece-svg.piece-w{filter:drop-shadow(0 4px 6px rgba(0,0,0,.35)) drop-shadow(0 1px 2px rgba(254,240,138,.2))}.piece-svg.piece-b{filter:drop-shadow(0 4px 6px rgba(0,0,0,.52)) drop-shadow(0 1px 2px rgba(129,140,248,.25))}.cell:not(:disabled):hover .piece-wrapper{transform:translateY(-4px) scale(1.09)}.cell:not(:disabled):hover .piece-svg.piece-w{filter:drop-shadow(0 8px 12px rgba(0,0,0,.45)) drop-shadow(0 0 10px rgba(245,158,11,.65))}.cell:not(:disabled):hover .piece-svg.piece-b{filter:drop-shadow(0 8px 12px rgba(0,0,0,.6)) drop-shadow(0 0 10px rgba(168,85,247,.7))}.cell.selected .piece-wrapper{transform:translateY(-6px) scale(1.15);animation:piece-hover-breath 1.8s ease-in-out infinite alternate}.cell.selected .piece-svg.piece-w{filter:drop-shadow(0 10px 18px rgba(0,0,0,.5)) drop-shadow(0 0 16px rgba(251,191,36,.9))}.cell.selected .piece-svg.piece-b{filter:drop-shadow(0 10px 18px rgba(0,0,0,.7)) drop-shadow(0 0 16px rgba(192,132,252,.9))}@keyframes piece-hover-breath{0%{transform:translateY(-5px) scale(1.14)}to{transform:translateY(-8px) scale(1.18)}}.piece-wrapper.anim-land{animation:piece-land-squash .22s ease-out}@keyframes piece-land-squash{0%{transform:scale(1.12,.88)}50%{transform:scale(.96,1.04)}to{transform:scale(1)}}.piece-wrapper.anim-knight{animation:knight-arc-leap .28s cubic-bezier(.25,.46,.45,.94)}@keyframes knight-arc-leap{0%{transform:translateY(0) scale(1)}50%{transform:translateY(-16px) scale(1.22)}85%{transform:translateY(0) scale(1.08,.92)}to{transform:translateY(0) scale(1)}}.piece-wrapper.anim-strike{animation:piece-strike-lunge .38s cubic-bezier(.34,1.56,.64,1);z-index:10}@keyframes piece-strike-lunge{0%{transform:scale(.88) translateY(-6px);filter:brightness(1.25)}30%{transform:scale(1.22) translateY(2px);filter:brightness(1.35) drop-shadow(0 8px 16px rgba(0,0,0,.6))}60%{transform:scale(.94,1.06) translateY(-2px)}80%{transform:scale(1.03,.97) translateY(0)}to{transform:scale(1) translateY(0);filter:none}}.cell.anim-shudder{animation:cell-shudder .22s ease-out}@keyframes cell-shudder{0%{transform:translate(0)}25%{transform:translate(2px,1px)}50%{transform:translate(-2px,-1px)}75%{transform:translate(1px,-1px)}to{transform:translate(0)}}.ghost-layer{position:absolute;top:4px;right:4px;bottom:4px;left:4px;pointer-events:none;z-index:15;overflow:visible}.captured-ghost{position:absolute;pointer-events:none;display:flex;align-items:center;justify-content:center;z-index:20}.captured-ghost .piece-wrapper{width:92%;height:92%}.captured-ghost.topple-right{transform-origin:45% 90%;animation:piece-topple-right .78s cubic-bezier(.25,.46,.45,.94) forwards}.captured-ghost.topple-left{transform-origin:55% 90%;animation:piece-topple-left .78s cubic-bezier(.25,.46,.45,.94) forwards}@keyframes piece-topple-right{0%{transform:translate(0) rotate(0) scale(1);opacity:1;filter:drop-shadow(0 4px 6px rgba(0,0,0,.45))}14%{transform:translate(6px,-12px) rotate(22deg) scale(1.05);opacity:1;filter:drop-shadow(0 10px 14px rgba(0,0,0,.4)) brightness(1.2)}38%{transform:translate(16px,-2px) rotate(60deg) scale(1);opacity:.96}58%{transform:translate(24px,12px) rotate(92deg) scale(.96,.9);opacity:.92;filter:drop-shadow(0 2px 4px rgba(0,0,0,.6))}70%{transform:translate(26px,8px) rotate(84deg) scale(.97,.94);opacity:.88}80%{transform:translate(27px,12px) rotate(90deg) scale(.95);opacity:.8;filter:drop-shadow(0 2px 4px rgba(0,0,0,.4))}to{transform:translate(30px,16px) rotate(90deg) scale(.68) scaleY(.4);opacity:0;filter:blur(5px) brightness(1.8) drop-shadow(0 0 12px rgba(255,255,255,.9))}}@keyframes piece-topple-left{0%{transform:translate(0) rotate(0) scale(1);opacity:1;filter:drop-shadow(0 4px 6px rgba(0,0,0,.45))}14%{transform:translate(-6px,-12px) rotate(-22deg) scale(1.05);opacity:1;filter:drop-shadow(0 10px 14px rgba(0,0,0,.4)) brightness(1.2)}38%{transform:translate(-16px,-2px) rotate(-60deg) scale(1);opacity:.96}58%{transform:translate(-24px,12px) rotate(-92deg) scale(.96,.9);opacity:.92;filter:drop-shadow(0 2px 4px rgba(0,0,0,.6))}70%{transform:translate(-26px,8px) rotate(-84deg) scale(.97,.94);opacity:.88}80%{transform:translate(-27px,12px) rotate(-90deg) scale(.95);opacity:.8;filter:drop-shadow(0 2px 4px rgba(0,0,0,.4))}to{transform:translate(-30px,16px) rotate(-90deg) scale(.68) scaleY(.4);opacity:0;filter:blur(5px) brightness(1.8) drop-shadow(0 0 12px rgba(255,255,255,.9))}}.move-dot{position:absolute;width:32%;height:32%;border-radius:50%;background:#0000003d;pointer-events:none;animation:dot-spawn .18s cubic-bezier(.34,1.56,.64,1);transition:transform .15s ease,background-color .15s ease}.cell:hover .move-dot{transform:scale(1.3);background:#0000005c}@keyframes dot-spawn{0%{transform:scale(0);opacity:0}to{transform:scale(1);opacity:1}}.capture-ring{position:absolute;top:0;right:0;bottom:0;left:0;border:4px solid rgba(239,68,68,.72);border-radius:50%;pointer-events:none;animation:ring-spawn .2s cubic-bezier(.34,1.56,.64,1)}@keyframes ring-spawn{0%{transform:scale(.5);opacity:0}to{transform:scale(1);opacity:1}}#vfx-canvas{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;z-index:10}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background:#000000a6;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);display:flex;align-items:center;justify-content:center;z-index:50;animation:fade-in .2s ease}.promo-card{background:var(--bg-card);border:1px solid rgba(255,255,255,.12);border-radius:12px;padding:16px 20px;display:flex;flex-direction:column;align-items:center;gap:14px;box-shadow:0 16px 36px #000000b3;animation:modal-spring .26s cubic-bezier(.34,1.56,.64,1)}.promo-title{font-size:15px;font-weight:700;color:var(--text-main)}.promo-options{display:flex;gap:10px}.promo-piece-btn{width:58px;height:58px;background:#2a2c38;border:1px solid rgba(255,255,255,.1);border-radius:10px;cursor:pointer;padding:6px;display:flex;align-items:center;justify-content:center;transition:transform .18s cubic-bezier(.34,1.56,.64,1),background-color .15s ease,box-shadow .18s ease}.promo-piece-btn:hover{transform:translateY(-4px) scale(1.12);background:#373a4a;box-shadow:0 8px 18px #0006}.promo-cancel-btn{background:transparent;border:0;color:var(--text-muted);font-size:13px;font-weight:600;cursor:pointer;padding:4px 12px;transition:color .15s ease}.promo-cancel-btn:hover{color:var(--text-main)}@keyframes modal-spring{0%{transform:scale(.6);opacity:0}to{transform:scale(1);opacity:1}}@keyframes fade-in{0%{opacity:0}to{opacity:1}}.game-over-banner{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);background:#181922f0;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);border:2px solid var(--gold-accent);border-radius:14px;padding:16px 28px;display:flex;flex-direction:column;align-items:center;gap:8px;box-shadow:0 16px 40px #000c,0 0 24px #f59e0b66;z-index:40;animation:banner-spring .35s cubic-bezier(.34,1.56,.64,1);text-align:center}.game-over-title{font-size:22px;font-weight:800;color:var(--gold-light);display:flex;align-items:center;gap:8px}.game-over-subtitle{font-size:14px;color:var(--text-muted);font-weight:600}@keyframes banner-spring{0%{transform:translate(-50%,-50%) scale(.4);opacity:0}to{transform:translate(-50%,-50%) scale(1);opacity:1}}
diff --git a/client/assets/index-i2DmTxxD.css b/client/assets/index-i2DmTxxD.css
new file mode 100644
index 0000000..86987e1
--- /dev/null
+++ b/client/assets/index-i2DmTxxD.css
@@ -0,0 +1 @@
+:root{--bg-primary: #14151b;--bg-card: #1e2029;--bg-card-hover: #282a36;--text-main: #f3f4f6;--text-muted: #9ca3af;--gold-accent: #f59e0b;--gold-light: #fbbf24;--danger: #ef4444;--board-light: #f0d9b5;--board-dark: #b58863;--board-border: #3b2818;--coord-light: #b58863;--coord-dark: #f0d9b5}*,*:before,*:after{box-sizing:border-box}html,body{margin:0;padding:0;width:100%;height:100%;background:radial-gradient(circle at center,#1b1c26,#101117);color:var(--text-main);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Vazirmatn,sans-serif;overflow:hidden;user-select:none;-webkit-user-select:none}#app{width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:8px 12px;gap:8px}.player-bar{width:min(88vmin,540px);display:flex;align-items:center;justify-content:space-between;padding:6px 12px;background:#1e2029d9;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);border-radius:8px;border:1px solid rgba(255,255,255,.08);box-shadow:0 4px 12px #0000004d;transition:border-color .25s ease,box-shadow .25s ease}.player-bar.active{border-color:var(--gold-accent);box-shadow:0 0 14px #f59e0b59}.player-profile{display:flex;align-items:center;gap:10px}.player-badge{width:28px;height:28px;border-radius:6px;display:flex;align-items:center;justify-content:center;font-size:16px;box-shadow:0 2px 4px #0003}.player-badge.w{background:#f8fafc;color:#1e293b;border:1px solid #cbd5e1}.player-badge.b{background:#1e2029;color:#f8fafc;border:1px solid #475569}.player-meta{display:flex;flex-direction:column;gap:2px}.player-name{font-size:14px;font-weight:700;display:flex;align-items:center;gap:6px}.bot-tag{font-size:10px;font-weight:800;padding:1px 5px;background:#334155;color:#94a3b8;border-radius:4px;letter-spacing:.5px}.bot-tag.you-tag{background:#1e3a8a;color:#60a5fa;border:1px solid rgba(96,165,250,.4)}.player-status{font-size:11px;color:var(--text-muted)}.captured-tray{display:flex;align-items:center;gap:2px;min-height:22px;flex-wrap:wrap}.captured-tray .mini-piece{width:21px;height:21px;opacity:.95;filter:drop-shadow(0 2px 3px rgba(0,0,0,.45));display:flex;align-items:center;justify-content:center}.advantage-score{font-size:11px;font-weight:800;color:var(--gold-accent);margin-inline-start:4px}.board-container{position:relative;width:min(88vmin,540px);aspect-ratio:1;border-radius:8px;box-shadow:0 12px 32px #0009,0 2px 6px #0006;padding:4px;background:var(--board-border);direction:ltr!important}.board-grid{display:grid;grid-template-columns:repeat(8,1fr);grid-template-rows:repeat(8,1fr);width:100%;height:100%;border-radius:6px;overflow:hidden;direction:ltr!important}.cell{position:relative;aspect-ratio:1;padding:0;margin:0;border:0;background:transparent;cursor:pointer;display:flex;align-items:center;justify-content:center;outline:none;transition:background-color .15s ease}.cell.light{background-color:var(--board-light)}.cell.dark{background-color:var(--board-dark)}.cell.selected{background-color:#baca44!important}.cell.last-move{background-color:#f59e0b6b!important}.cell.in-check{background:radial-gradient(circle at center,rgba(239,68,68,.95) 0%,rgba(220,38,38,.4) 60%,transparent 75%)!important;animation:king-check-pulse 1.2s ease-in-out infinite}@keyframes king-check-pulse{0%,to{filter:drop-shadow(0 0 4px rgba(239,68,68,.8))}50%{filter:drop-shadow(0 0 14px rgba(239,68,68,1))}}.coord-rank,.coord-file{position:absolute;font-size:10px;font-weight:800;pointer-events:none;opacity:.75;line-height:1}.coord-rank{top:3px;left:4px}.coord-file{bottom:3px;right:4px}.cell.light .coord-rank,.cell.light .coord-file{color:var(--coord-light)}.cell.dark .coord-rank,.cell.dark .coord-file{color:var(--coord-dark)}.piece-wrapper{width:92%;height:92%;display:flex;align-items:center;justify-content:center;pointer-events:none;transition:transform .22s cubic-bezier(.34,1.56,.64,1),filter .22s ease}.piece-svg{width:100%;height:100%;display:block;filter:drop-shadow(0 3px 5px rgba(0,0,0,.38));transition:filter .25s ease}.piece-svg.piece-w{filter:drop-shadow(0 4px 6px rgba(0,0,0,.35)) drop-shadow(0 1px 2px rgba(254,240,138,.2))}.piece-svg.piece-b{filter:drop-shadow(0 4px 6px rgba(0,0,0,.52)) drop-shadow(0 1px 2px rgba(129,140,248,.25))}.cell:not(:disabled):hover .piece-wrapper{transform:translateY(-4px) scale(1.09)}.cell:not(:disabled):hover .piece-svg.piece-w{filter:drop-shadow(0 8px 12px rgba(0,0,0,.45)) drop-shadow(0 0 10px rgba(245,158,11,.65))}.cell:not(:disabled):hover .piece-svg.piece-b{filter:drop-shadow(0 8px 12px rgba(0,0,0,.6)) drop-shadow(0 0 10px rgba(168,85,247,.7))}.cell.selected .piece-wrapper{transform:translateY(-6px) scale(1.15);animation:piece-hover-breath 1.8s ease-in-out infinite alternate}.cell.selected .piece-svg.piece-w{filter:drop-shadow(0 10px 18px rgba(0,0,0,.5)) drop-shadow(0 0 16px rgba(251,191,36,.9))}.cell.selected .piece-svg.piece-b{filter:drop-shadow(0 10px 18px rgba(0,0,0,.7)) drop-shadow(0 0 16px rgba(192,132,252,.9))}@keyframes piece-hover-breath{0%{transform:translateY(-5px) scale(1.14)}to{transform:translateY(-8px) scale(1.18)}}.piece-wrapper.anim-land{animation:piece-land-squash .22s ease-out}@keyframes piece-land-squash{0%{transform:scale(1.12,.88)}50%{transform:scale(.96,1.04)}to{transform:scale(1)}}.piece-wrapper.anim-knight{animation:knight-arc-leap .28s cubic-bezier(.25,.46,.45,.94)}@keyframes knight-arc-leap{0%{transform:translateY(0) scale(1)}50%{transform:translateY(-16px) scale(1.22)}85%{transform:translateY(0) scale(1.08,.92)}to{transform:translateY(0) scale(1)}}.move-dot{position:absolute;width:32%;height:32%;border-radius:50%;background:#0000003d;pointer-events:none;animation:dot-spawn .18s cubic-bezier(.34,1.56,.64,1);transition:transform .15s ease,background-color .15s ease}.cell:hover .move-dot{transform:scale(1.3);background:#0000005c}@keyframes dot-spawn{0%{transform:scale(0);opacity:0}to{transform:scale(1);opacity:1}}.capture-ring{position:absolute;top:0;right:0;bottom:0;left:0;border:4px solid rgba(239,68,68,.72);border-radius:50%;pointer-events:none;animation:ring-spawn .2s cubic-bezier(.34,1.56,.64,1)}@keyframes ring-spawn{0%{transform:scale(.5);opacity:0}to{transform:scale(1);opacity:1}}#vfx-canvas{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;z-index:10}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background:#000000a6;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);display:flex;align-items:center;justify-content:center;z-index:50;animation:fade-in .2s ease}.promo-card{background:var(--bg-card);border:1px solid rgba(255,255,255,.12);border-radius:12px;padding:16px 20px;display:flex;flex-direction:column;align-items:center;gap:14px;box-shadow:0 16px 36px #000000b3;animation:modal-spring .26s cubic-bezier(.34,1.56,.64,1)}.promo-title{font-size:15px;font-weight:700;color:var(--text-main)}.promo-options{display:flex;gap:10px}.promo-piece-btn{width:58px;height:58px;background:#2a2c38;border:1px solid rgba(255,255,255,.1);border-radius:10px;cursor:pointer;padding:6px;display:flex;align-items:center;justify-content:center;transition:transform .18s cubic-bezier(.34,1.56,.64,1),background-color .15s ease,box-shadow .18s ease}.promo-piece-btn:hover{transform:translateY(-4px) scale(1.12);background:#373a4a;box-shadow:0 8px 18px #0006}.promo-cancel-btn{background:transparent;border:0;color:var(--text-muted);font-size:13px;font-weight:600;cursor:pointer;padding:4px 12px;transition:color .15s ease}.promo-cancel-btn:hover{color:var(--text-main)}@keyframes modal-spring{0%{transform:scale(.6);opacity:0}to{transform:scale(1);opacity:1}}@keyframes fade-in{0%{opacity:0}to{opacity:1}}.game-over-banner{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);background:#181922f0;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);border:2px solid var(--gold-accent);border-radius:14px;padding:16px 28px;display:flex;flex-direction:column;align-items:center;gap:8px;box-shadow:0 16px 40px #000c,0 0 24px #f59e0b66;z-index:40;animation:banner-spring .35s cubic-bezier(.34,1.56,.64,1);text-align:center}.game-over-title{font-size:22px;font-weight:800;color:var(--gold-light);display:flex;align-items:center;gap:8px}.game-over-subtitle{font-size:14px;color:var(--text-muted);font-weight:600}@keyframes banner-spring{0%{transform:translate(-50%,-50%) scale(.4);opacity:0}to{transform:translate(-50%,-50%) scale(1);opacity:1}}
diff --git a/client/index.html b/client/index.html
index 5bfc4f6..681820a 100644
--- a/client/index.html
+++ b/client/index.html
@@ -4,8 +4,8 @@
Chess — 3miz
-
-
+
+
…