{"id":339,"date":"2025-08-18T17:19:25","date_gmt":"2025-08-18T17:19:25","guid":{"rendered":"https:\/\/swen-mercer.com\/de\/?page_id=339"},"modified":"2025-09-17T13:41:53","modified_gmt":"2025-09-17T13:41:53","slug":"blockade","status":"publish","type":"page","link":"https:\/\/swen-mercer.com\/de\/blockade\/","title":{"rendered":"Blockade"},"content":{"rendered":"<style>.kadence-column339_3c31e0-44 > .kt-inside-inner-col,.kadence-column339_3c31e0-44 > .kt-inside-inner-col:before{border-top-left-radius:0px;border-top-right-radius:0px;border-bottom-right-radius:0px;border-bottom-left-radius:0px;}.kadence-column339_3c31e0-44 > .kt-inside-inner-col{column-gap:var(--global-kb-gap-sm, 1rem);}.kadence-column339_3c31e0-44 > .kt-inside-inner-col{flex-direction:column;}.kadence-column339_3c31e0-44 > .kt-inside-inner-col > .aligncenter{width:100%;}.kadence-column339_3c31e0-44 > .kt-inside-inner-col:before{opacity:0.3;}.kadence-column339_3c31e0-44{position:relative;}@media all and (max-width: 1024px){.kadence-column339_3c31e0-44 > .kt-inside-inner-col{flex-direction:column;justify-content:center;}}@media all and (max-width: 767px){.kadence-column339_3c31e0-44 > .kt-inside-inner-col{flex-direction:column;justify-content:center;}}<\/style>\n<div class=\"wp-block-kadence-column kadence-column339_3c31e0-44\"><div class=\"kt-inside-inner-col\"><style>.kb-row-layout-id339_81d234-5c > .kt-row-column-wrap{align-content:start;}:where(.kb-row-layout-id339_81d234-5c > .kt-row-column-wrap) > .wp-block-kadence-column{justify-content:start;}.kb-row-layout-id339_81d234-5c > .kt-row-column-wrap{column-gap:var(--global-kb-gap-md, 2rem);row-gap:var(--global-kb-gap-md, 2rem);padding-top:var(--global-kb-spacing-sm, 1.5rem);padding-bottom:var(--global-kb-spacing-sm, 1.5rem);grid-template-columns:minmax(0, 1fr);}.kb-row-layout-id339_81d234-5c > .kt-row-layout-overlay{opacity:0.30;}@media all and (max-width: 1024px){.kb-row-layout-id339_81d234-5c > .kt-row-column-wrap{grid-template-columns:minmax(0, 1fr);}}@media all and (max-width: 767px){.kb-row-layout-id339_81d234-5c > .kt-row-column-wrap{grid-template-columns:minmax(0, 1fr);}}<\/style><div class=\"kb-row-layout-wrap kb-row-layout-id339_81d234-5c alignnone wp-block-kadence-rowlayout\"><div class=\"kt-row-column-wrap kt-has-1-columns kt-row-layout-equal kt-tab-layout-inherit kt-mobile-layout-row kt-row-valign-top\">\n<style>.kadence-column339_254e77-11 > .kt-inside-inner-col,.kadence-column339_254e77-11 > .kt-inside-inner-col:before{border-top-left-radius:0px;border-top-right-radius:0px;border-bottom-right-radius:0px;border-bottom-left-radius:0px;}.kadence-column339_254e77-11 > .kt-inside-inner-col{column-gap:var(--global-kb-gap-sm, 1rem);}.kadence-column339_254e77-11 > .kt-inside-inner-col{flex-direction:column;}.kadence-column339_254e77-11 > .kt-inside-inner-col > .aligncenter{width:100%;}.kadence-column339_254e77-11 > .kt-inside-inner-col:before{opacity:0.3;}.kadence-column339_254e77-11{position:relative;}@media all and (max-width: 1024px){.kadence-column339_254e77-11 > .kt-inside-inner-col{flex-direction:column;justify-content:center;}}@media all and (max-width: 767px){.kadence-column339_254e77-11 > .kt-inside-inner-col{flex-direction:column;justify-content:center;}}<\/style>\n<div class=\"wp-block-kadence-column kadence-column339_254e77-11\"><div class=\"kt-inside-inner-col\">        <div id=\"exact-blockade-container\">\n            <style>\n                #exact-blockade-container {\n                    max-width: 1050px;\n                    margin: 20px auto;\n                    font-family: 'Trebuchet MS', Arial, sans-serif;\n                    background: linear-gradient(135deg, #B8860B, #DAA520);\n                    padding: 20px;\n                    border-radius: 15px;\n                    box-shadow: 0 8px 16px rgba(0,0,0,0.3);\n                }\n                \n                #blockade-board-container {\n                    position: relative;\n                    width: 950px;\n                    height: 850px;\n                    margin: 20px auto;\n                    background: linear-gradient(45deg, #F0E68C 0%, #BDB76B 50%, #B8860B 100%);\n                    border: 8px solid #654321;\n                    border-radius: 20px;\n                    box-shadow: inset 0 0 20px rgba(0,0,0,0.2);\n                }\n                \n                .path-space {\n                    position: absolute;\n                    width: 32px;\n                    height: 32px;\n                    background: radial-gradient(circle, #2F2F2F 60%, #000000 100%);\n                    border: 3px solid #654321;\n                    border-radius: 50%;\n                    cursor: pointer;\n                    transition: all 0.2s ease;\n                    box-shadow: 2px 2px 4px rgba(0,0,0,0.4);\n                    display: flex;\n                    align-items: center;\n                    justify-content: center;\n                }\n                \n                .path-space:hover {\n                    transform: scale(1.1);\n                    box-shadow: 0 0 10px rgba(255,215,0,0.6);\n                }\n                \n                .connection-line {\n                    position: absolute;\n                    z-index: 1;\n                    border-radius: 2px;\n                    opacity: 0.8;\n                    box-shadow: 1px 1px 2px rgba(0,0,0,0.3);\n                }\n                \n                .path-space.barricade {\n                    color: transparent !important;\n                    font-size: 0 !important;\n                    font-weight: bold;\n                    background: transparent !important;\n                    border: none !important;\n                    box-shadow: none !important;\n                    animation: barricade-pulse 2s ease-in-out infinite alternate;\n                }\n                \n                .barricade-image {\n                    display: inline-block;       \n                    max-width: 58px;            \n                    object-fit: contain;         \n                    vertical-align: middle;      \n                }\n                \n                .path-space.barricade.highlight-move {\n                    box-shadow: 0 0 15px rgba(255,165,0,0.8) !important;\n                    border: 3px solid #FFA500 !important;\n                    animation: barricade-highlight 1s ease-in-out infinite alternate !important;\n                }\n                \n                @keyframes barricade-highlight {\n                    from { \n                        box-shadow: 0 0 15px rgba(255,165,0,0.8) !important;\n                        border-color: #FFA500 !important;\n                    }\n                    to { \n                        box-shadow: 0 0 25px rgba(255,165,0,1.0) !important;\n                        border-color: #FF8C00 !important;\n                    }\n                }\n\n                @keyframes barricade-pulse {\n                    from { box-shadow: 0 0 10px rgba(220, 20, 60, 0.8); }\n                    to { box-shadow: 0 0 20px rgba(220, 20, 60, 1.0); }\n                }\n\n                .barricade-placement-mode {\n                    background: linear-gradient(145deg, #FFD700, #FFA500) !important;\n                    border: 3px solid #FF4500 !important;\n                    animation: placement-highlight 0.5s ease-in-out infinite alternate !important;\n                }\n\n                @keyframes placement-highlight {\n                    from { box-shadow: 0 0 8px rgba(255, 215, 0, 0.8); }\n                    to { box-shadow: 0 0 16px rgba(255, 215, 0, 1.0); }\n                }\n                \n                .starting-area {\n                    position: absolute;\n                    width: 120px;\n                    height: 60px;\n                    border-radius: 15px;\n                    border: 4px solid;\n                    display: flex;\n                    flex-direction: column;\n                    align-items: center;\n                    justify-content: space-between;\n                    padding: 6px;\n                    background: linear-gradient(145deg, rgba(255,255,255,0.8), rgba(255,255,255,0.4));\n                    box-shadow: 0 4px 8px rgba(0,0,0,0.2);\n                }\n                \n                .starting-area.player-1 { \n                    border-color: #DC143C; \n                    background: linear-gradient(145deg, rgba(220,20,60,0.3), rgba(220,20,60,0.1));\n                }\n                .starting-area.player-2 { \n                    border-color: #228B22; \n                    background: linear-gradient(145deg, rgba(34,139,34,0.3), rgba(34,139,34,0.1));\n                }\n                .starting-area.player-3 { \n                    border-color: #FFD700; \n                    background: linear-gradient(145deg, rgba(255,215,0,0.3), rgba(255,215,0,0.1));\n                }\n                .starting-area.player-4 { \n                    border-color: #4169E1; \n                    background: linear-gradient(145deg, rgba(65,105,225,0.3), rgba(65,105,225,0.1));\n                }\n                \n                .player-character {\n                    width: 30px;\n                    height: 30px;\n                    border-radius: 50%;\n                    border: 2px solid #000;\n                    display: flex;\n                    align-items: center;\n                    justify-content: center;\n                    font-size: 14px;\n                    font-weight: bold;\n                    margin-bottom: 3px;\n                    box-shadow: 2px 2px 4px rgba(0,0,0,0.3);\n                }\n                \n                .character-1 { background: linear-gradient(145deg, #FF6B6B, #DC143C); }\n                .character-2 { background: linear-gradient(145deg, #51CF66, #228B22); }\n                .character-3 { background: linear-gradient(145deg, #FFE066, #FFD700); }\n                .character-4 { background: linear-gradient(145deg, #74C0FC, #4169E1); }\n                \n                .starting-spaces {\n                    display: flex;\n                    gap: 4px;\n                    flex-wrap: wrap;\n                    justify-content: center;\n                }\n                \n                .start-space {\n                    width: 16px;\n                    height: 16px;\n                    border-radius: 50%;\n                    border: 1px solid rgba(101, 67, 33, 0.3);\n                    cursor: pointer;\n                    opacity: 0.1;\n                }\n                \n                .finish-target {\n                    position: absolute;\n                    top: 60px;\n                    left: 414px;\n                    width: 50px;\n                    height: 50px;\n                    background: radial-gradient(circle, #FFD700 0%, #DC143C 25%, #FFFFFF 35%, #DC143C 45%, #FFFFFF 55%, #DC143C 65%, #FFFFFF 75%, #8B0000 100%);\n                    border: 4px solid #654321;\n                    border-radius: 50%;\n                    display: flex;\n                    align-items: center;\n                    justify-content: center;\n                    box-shadow: 0 0 15px rgba(255,215,0,0.6);\n                    animation: target-glow 2s ease-in-out infinite alternate;\n                    cursor: pointer;\n                }\n                \n                @keyframes target-glow {\n                    from { box-shadow: 0 0 15px rgba(255,215,0,0.6); }\n                    to { box-shadow: 0 0 25px rgba(255,215,0,0.9); }\n                }\n                \n                .game-piece {\n                    position: absolute;\n                    width: 32px;\n                    height: 32px;\n                    border-radius: 50%;\n                    border: 3px solid #000;\n                    display: flex;\n                    align-items: center;\n                    justify-content: center;\n                    cursor: pointer;\n                    transition: all 0.2s ease;\n                    z-index: 10;\n                    box-shadow: 2px 2px 4px rgba(0,0,0,0.4);\n                    transform: translate(-50%, -50%);\n                    background: rgba(255, 255, 255, 0.9);\n                    overflow: hidden;\n                }\n                \n                .game-piece img {\n                    width: 26px;\n                    height: 26px;\n                    object-fit: contain;\n                    border-radius: 50%;\n                }\n                \n                .game-piece:hover {\n                    transform: translate(-50%, -50%) scale(1.15);\n                }\n                \n                .game-piece.selected {\n                    border-color: #FFD700;\n                    border-width: 4px;\n                    box-shadow: 0 0 12px rgba(255,215,0,0.8);\n                    animation: piece-pulse 1s ease-in-out infinite alternate;\n                }\n                \n                @keyframes piece-pulse {\n                    from { transform: translate(-50%, -50%) scale(1); }\n                    to { transform: translate(-50%, -50%) scale(1.1); }\n                }\n                \n                .piece-1 { border-color: #DC143C; }\n                .piece-2 { border-color: #228B22; }\n                .piece-3 { border-color: #FFD700; }\n                .piece-4 { border-color: #4169E1; }\n                \n                #game-controls {\n                    text-align: center;\n                    margin: 20px 0;\n                    background: rgba(255,255,255,0.9);\n                    padding: 20px;\n                    border-radius: 15px;\n                    box-shadow: 0 4px 8px rgba(0,0,0,0.2);\n                }\n                \n                #game-status {\n                    padding: 15px;\n                    border-radius: 10px;\n                    margin: 10px 0;\n                    border: 2px solid #000000;\n                    box-shadow: 0 2px 4px rgba(0,0,0,0.1);\n                }\n                \n                .dice {\n                    font-size: 32px;\n                    background: linear-gradient(145deg, #FFFFFF, #F0F0F0);\n                    border: 3px solid #654321;\n                    padding: 15px;\n                    border-radius: 10px;\n                    margin: 0 10px;\n                    box-shadow: 3px 3px 6px rgba(0,0,0,0.3);\n                    display: inline-block;\n                    min-width: 60px;\n                    text-align: center;\n                }\n                \n                button {\n                    background: linear-gradient(145deg, #4CAF50, #45a049);\n                    color: white;\n                    border: none;\n                    padding: 12px 24px;\n                    border-radius: 8px;\n                    cursor: pointer;\n                    margin: 5px;\n                    font-size: 16px;\n                    font-weight: bold;\n                    box-shadow: 3px 3px 6px rgba(0,0,0,0.2);\n                    transition: all 0.2s ease;\n                }\n                \n                button:hover {\n                    transform: translateY(-2px);\n                    box-shadow: 3px 5px 8px rgba(0,0,0,0.3);\n                }\n                \n                button:disabled {\n                    background: linear-gradient(145deg, #cccccc, #999999);\n                    cursor: not-allowed;\n                    transform: none;\n                }\n                \n                .highlight-move {\n                    animation: move-highlight 1s ease-in-out infinite alternate;\n                }\n                \n                @keyframes move-highlight {\n                    from { \n                        box-shadow: 0 0 8px rgba(0,255,0,0.6);\n                        border-color: #00FF00;\n                    }\n                    to { \n                        box-shadow: 0 0 15px rgba(0,255,0,0.9);\n                        border-color: #32CD32;\n                    }\n                }\n                \n                .game-title {\n                    text-align: center;\n                    font-size: 32px;\n                    font-weight: bold;\n                    color: #000000;\n                    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);\n                    margin-bottom: 20px;\n                }\n\n                .player-setup {\n                    background: rgba(255,255,255,0.9);\n                    padding: 15px;\n                    border-radius: 10px;\n                    margin: 10px 0;\n                    text-align: center;\n                }\n\n                .player-setup select {\n                    padding: 8px 12px;\n                    font-size: 16px;\n                    border-radius: 5px;\n                    border: 2px solid #4169E1;\n                    margin: 0 10px;\n                }\n\n                .ai-indicator {\n                    display: inline-block;\n                    background: linear-gradient(145deg, #FF6B6B, #DC143C);\n                    color: white;\n                    padding: 2px 8px;\n                    border-radius: 12px;\n                    font-size: 12px;\n                    font-weight: bold;\n                    margin-left: 5px;\n                }\n\n                .ai-thinking {\n                    animation: ai-pulse 1s ease-in-out infinite alternate;\n                }\n\n                @keyframes ai-pulse {\n                    from { opacity: 0.7; }\n                    to { opacity: 1.0; }\n                }\n\n                #game-status {\n                    width: 100%;\n                }\n\n                .game-controls {\n                    display: flex;\n                    align-items: center;\n                    justify-content: space-between;\n                    margin-top: 10px;\n                }\n\n                .left-controls {\n                    display: flex;\n                    align-items: center;\n                    gap: 10px;\n                }\n\n                .center-controls {\n                    flex-grow: 1;\n                    display: flex;\n                    justify-content: center;\n                }\n\n                .right-controls {\n                    display: flex;\n                    gap: 10px;\n                }\n            <\/style>\n            \n            <h2 class=\"game-title\">\ud83c\udff0 Blocade \ud83d\udde1\ufe0f<\/h2>\n            \n            <div id=\"game-status\">\n                <div><strong>Current Player:<\/strong> \n                    <span id=\"current-player\">Player 1<\/span>\n                    <span id=\"ai-indicator\" class=\"ai-indicator\" style=\"display: none;\">\ud83e\udd16 AI<\/span>\n                <\/div>\n                <div class=\"game-controls\">\n                    <div class=\"left-controls\">\n                        <strong>Last Roll:<\/strong> \n                        <span id=\"dice-result\" class=\"dice\">\ud83c\udfb2<\/span>\n                        <button id=\"roll-dice\" onclick=\"rollDice()\">\ud83c\udfb2 Roll Dice<\/button>\n                    <\/div>\n\n                    <div class=\"center-controls\">\n                        <select id=\"human-players\" onchange=\"updatePlayerSetup()\">\n                            <option value=\"1\" selected>1 Human + 3 AI<\/option>\n                            <option value=\"2\" >2 Human + 2 AI<\/option>\n                            <option value=\"3\" >3 Human + 1 AI<\/option>\n                            <option value=\"4\" >4 Human Players<\/option>\n                        <\/select>\n                    <\/div>\n\n                    <div class=\"right-controls\">\n                        <button onclick=\"startNewGame()\">\ud83c\udfae Start Game<\/button>\n                        <button id=\"reset-game\" onclick=\"resetGame()\">\ud83d\udd04 New Game<\/button>\n                    <\/div>\n                <\/div>\n            <\/div>\n\n            <div id=\"blockade-board-container\">\n                <!-- Finish target (no number displayed) -->\n                <div class=\"finish-target\"><\/div>\n                \n                <!-- Board spaces will be generated by JavaScript -->\n            <\/div>\n            \n            <div id=\"game-instructions\"><\/div>\n        <\/div>\n        \n        <script>\n            \/\/ Get localized strings from PHP\n            const L10n = blocadeL10n || {};\n            \n            \/\/ Pass the image URLs to JavaScript\n            const STOP_IMAGE_URL = 'https:\/\/swen-mercer.com\/de\/wp-content\/plugins\/blocade\/img\/stop.png';\n            const TRUCK_IMAGES = {\n                1: 'https:\/\/swen-mercer.com\/de\/wp-content\/plugins\/blocade\/img\/fire-truck.png',      \/\/ Red - Fire Truck\n                2: 'https:\/\/swen-mercer.com\/de\/wp-content\/plugins\/blocade\/img\/deliver-truck.png',   \/\/ Green - Delivery Truck\n                3: 'https:\/\/swen-mercer.com\/de\/wp-content\/plugins\/blocade\/img\/taxi.png',            \/\/ Yellow - Taxi\n                4: 'https:\/\/swen-mercer.com\/de\/wp-content\/plugins\/blocade\/img\/family-van.png'       \/\/ Blue - Family Van\n            };\n\n            let gameState = {\n                currentPlayer: 1,\n                humanPlayers: 1,\n                totalPlayers: 4, \/\/ Always 4 players\n                diceRoll: 0,\n                turnPhase: 'roll',\n                selectedPiece: null,\n                boardSpaces: {},\n                playerPieces: {},\n                gameWon: false,\n                barricadeRelocationMode: false,\n                aiPlayers: [], \/\/ Will store which players are AI\n                aiThinking: false\n            };\n\n            \/\/ Helper function for string formatting\n            function sprintf(str, ...args) {\n                return str.replace(\/%[sd]\/g, function() {\n                    return args.shift();\n                });\n            }\n\n            function updatePlayerSetup() {\n                const humanCount = parseInt(document.getElementById('human-players').value);\n                gameState.humanPlayers = humanCount;\n                \n                \/\/ Update AI players array\n                gameState.aiPlayers = [];\n                for (let i = humanCount + 1; i <= 4; i++) {\n                    gameState.aiPlayers.push(i);\n                }\n                \n                console.log(`Updated: ${humanCount} humans, AI players: ${gameState.aiPlayers.join(', ')}`);\n            }\n\n            function startNewGame() {\n                updatePlayerSetup();\n                \n                \/\/ Clear ALL existing barricades first before reset\n                Object.values(gameState.boardSpaces).forEach(space => {\n                    if (space.isBarricade) {\n                        removeBarricadeStyle(space.element);\n                        space.isBarricade = false;\n                    }\n                });\n                \n                resetGame();\n            }\n\n            function isCurrentPlayerAI() {\n                return gameState.aiPlayers.includes(gameState.currentPlayer);\n            }\n\n            function updateAIIndicator() {\n                const aiIndicator = document.getElementById('ai-indicator');\n                if (isCurrentPlayerAI()) {\n                    aiIndicator.style.display = 'inline-block';\n                    if (gameState.aiThinking) {\n                        aiIndicator.classList.add('ai-thinking');\n                    } else {\n                        aiIndicator.classList.remove('ai-thinking');\n                    }\n                } else {\n                    aiIndicator.style.display = 'none';\n                    aiIndicator.classList.remove('ai-thinking');\n                }\n            }\n        \n            \/\/ Exact original Blockade board layout with correct 112 positions (centered and corrected)\n            const EXACT_BOARD_LAYOUT = {\n                \/\/ Bottom row: positions 1-17 (shifted right to center)\n                1: [\n                    {pos: 1, x: 100, y: 620}, {pos: 2, x: 140, y: 620}, {pos: 3, x: 180, y: 620}, \n                    {pos: 4, x: 220, y: 620}, {pos: 5, x: 260, y: 620}, {pos: 6, x: 300, y: 620}, \n                    {pos: 7, x: 340, y: 620}, {pos: 8, x: 380, y: 620}, {pos: 9, x: 420, y: 620}, \n                    {pos: 10, x: 460, y: 620}, {pos: 11, x: 500, y: 620}, {pos: 12, x: 540, y: 620}, \n                    {pos: 13, x: 580, y: 620}, {pos: 14, x: 620, y: 620}, {pos: 15, x: 660, y: 620}, \n                    {pos: 16, x: 700, y: 620}, {pos: 17, x: 740, y: 620}\n                ],\n                \n                \/\/ Vertical connectors: positions 18-22\n                2: [\n                    {pos: 18, x: 100, y: 580}, {pos: 19, x: 260, y: 580}, {pos: 20, x: 420, y: 580}, \n                    {pos: 21, x: 580, y: 580}, {pos: 22, x: 740, y: 580}\n                ],\n                \n                \/\/ Second row: positions 23-39\n                3: [\n                    {pos: 23, x: 100, y: 540, barricade: true}, {pos: 24, x: 140, y: 540}, {pos: 25, x: 180, y: 540}, \n                    {pos: 26, x: 220, y: 540}, {pos: 27, x: 260, y: 540, barricade: true}, {pos: 28, x: 300, y: 540}, \n                    {pos: 29, x: 340, y: 540}, {pos: 30, x: 380, y: 540}, {pos: 31, x: 420, y: 540, barricade: true}, \n                    {pos: 32, x: 460, y: 540}, {pos: 33, x: 500, y: 540}, {pos: 34, x: 540, y: 540}, \n                    {pos: 35, x: 580, y: 540, barricade: true}, {pos: 36, x: 620, y: 540}, {pos: 37, x: 660, y: 540}, \n                    {pos: 38, x: 700, y: 540}, {pos: 39, x: 740, y: 540, barricade: true}\n                ],\n                \n                \/\/ Connectors: positions 40-43 (fixed positioning)\n                4: [\n                    {pos: 40, x: 180, y: 500}, {pos: 41, x: 340, y: 500}, {pos: 42, x: 500, y: 500}, \n                    {pos: 43, x: 660, y: 500}\n                ],\n                \n                \/\/ Middle section: positions 44-56\n                5: [\n                    {pos: 44, x: 180, y: 460}, {pos: 45, x: 220, y: 460}, {pos: 46, x: 260, y: 460}, \n                    {pos: 47, x: 300, y: 460}, {pos: 48, x: 340, y: 460}, {pos: 49, x: 380, y: 460}, \n                    {pos: 50, x: 420, y: 460}, {pos: 51, x: 460, y: 460}, {pos: 52, x: 500, y: 460}, \n                    {pos: 53, x: 540, y: 460}, {pos: 54, x: 580, y: 460}, {pos: 55, x: 620, y: 460}, \n                    {pos: 56, x: 660, y: 460}\n                ],\n                \n                \/\/ Connectors: positions 57-58\n                6: [\n                    {pos: 57, x: 260, y: 420}, {pos: 58, x: 580, y: 420}\n                ],\n                \n                \/\/ Upper middle: positions 59-67\n                7: [\n                    {pos: 59, x: 260, y: 380}, {pos: 60, x: 300, y: 380}, {pos: 61, x: 340, y: 380, barricade: true}, \n                    {pos: 62, x: 380, y: 380}, {pos: 63, x: 420, y: 380}, {pos: 64, x: 460, y: 380}, \n                    {pos: 65, x: 500, y: 380, barricade: true}, {pos: 66, x: 540, y: 380}, {pos: 67, x: 580, y: 380}\n                ],\n                \n                \/\/ Connectors: positions 68-69\n                8: [\n                    {pos: 68, x: 340, y: 340}, {pos: 69, x: 500, y: 340}\n                ],\n                \n                \/\/ Small upper section: positions 70-74\n                9: [\n                    {pos: 70, x: 340, y: 300}, {pos: 71, x: 380, y: 300}, {pos: 72, x: 420, y: 300, barricade: true}, \n                    {pos: 73, x: 460, y: 300}, {pos: 74, x: 500, y: 300}\n                ],\n                \n                \/\/ Connector: position 75\n                10: [\n                    {pos: 75, x: 420, y: 260, barricade: true}\n                ],\n                \n                \/\/ Upper row: positions 76-92\n                11: [\n                    {pos: 76, x: 100, y: 220}, {pos: 77, x: 140, y: 220}, {pos: 78, x: 180, y: 220}, \n                    {pos: 79, x: 220, y: 220}, {pos: 80, x: 260, y: 220}, {pos: 81, x: 300, y: 220}, \n                    {pos: 82, x: 340, y: 220}, {pos: 83, x: 380, y: 220}, {pos: 84, x: 420, y: 220, barricade: true}, \n                    {pos: 85, x: 460, y: 220}, {pos: 86, x: 500, y: 220}, {pos: 87, x: 540, y: 220}, \n                    {pos: 88, x: 580, y: 220}, {pos: 89, x: 620, y: 220}, {pos: 90, x: 660, y: 220}, \n                    {pos: 91, x: 700, y: 220}, {pos: 92, x: 740, y: 220}\n                ],\n                \n                \/\/ Connectors: positions 93-94\n                12: [\n                    {pos: 93, x: 100, y: 180}, {pos: 94, x: 740, y: 180}\n                ],\n                \n                \/\/ Top row: positions 95-111\n                13: [\n                    {pos: 95, x: 100, y: 140}, {pos: 96, x: 140, y: 140}, {pos: 97, x: 180, y: 140}, \n                    {pos: 98, x: 220, y: 140}, {pos: 99, x: 260, y: 140}, {pos: 100, x: 300, y: 140}, \n                    {pos: 101, x: 340, y: 140}, {pos: 102, x: 380, y: 140}, {pos: 103, x: 420, y: 140, barricade: true}, \n                    {pos: 104, x: 460, y: 140}, {pos: 105, x: 500, y: 140}, {pos: 106, x: 540, y: 140}, \n                    {pos: 107, x: 580, y: 140}, {pos: 108, x: 620, y: 140}, {pos: 109, x: 660, y: 140}, \n                    {pos: 110, x: 700, y: 140}, {pos: 111, x: 740, y: 140}\n                ]\n                \n                \/\/ Position 112 is the target\n            };\n            \n            \/\/ Starting area positions for 4 players (adjusted to match centered board and smaller height)\n            const STARTING_AREAS = {\n                1: {x: 130, y: 720, color: 'player-1', entry: 3},   \/\/ Red connects to position 3 (moved down 10px)\n                2: {x: 290, y: 720, color: 'player-2', entry: 7},  \/\/ Green connects to position 7 (moved down 10px)\n                3: {x: 450, y: 720, color: 'player-3', entry: 11}, \/\/ Yellow connects to position 11 (moved down 10px)\n                4: {x: 610, y: 720, color: 'player-4', entry: 15}  \/\/ Blue connects to position 15 (moved down 10px)\n            };\n            \n            \/\/ CORRECTED Blockade board path connections - NO DUPLICATE KEYS!\n            const BOARD_PATHS = {\n                \/\/ Starting area connections to entry points\n                'start-1-0': [3], 'start-1-1': [3], 'start-1-2': [3], 'start-1-3': [3], 'start-1-4': [3],\n                'start-2-0': [7], 'start-2-1': [7], 'start-2-2': [7], 'start-2-3': [7], 'start-2-4': [7], \n                'start-3-0': [11], 'start-3-1': [11], 'start-3-2': [11], 'start-3-3': [11], 'start-3-4': [11],\n                'start-4-0': [15], 'start-4-1': [15], 'start-4-2': [15], 'start-4-3': [15], 'start-4-4': [15],\n                \n                \/\/ Bottom row (1-17) with bidirectional horizontal and vertical connections\n                1: [2, 18],\n                2: [1, 3], \n                3: [2, 4],\n                4: [3, 5],\n                5: [4, 6, 19], \n                6: [5, 7],\n                7: [6, 8],\n                8: [7, 9],\n                9: [8, 10, 20],\n                10: [9, 11],\n                11: [10, 12], \n                12: [11, 13],\n                13: [12, 14, 21],\n                14: [13, 15],\n                15: [14, 16],\n                16: [15, 17],\n                17: [16, 22],\n                \n                \/\/ Vertical connectors (18-22)\n                18: [1, 23],\n                19: [5, 27], \n                20: [9, 31],\n                21: [13, 35],\n                22: [17, 39],\n                \n                \/\/ Second row (23-39) with bidirectional horizontal and upward connections\n                23: [18, 24],\n                24: [23, 25],\n                25: [24, 26, 40],\n                26: [25, 27],\n                27: [19, 26, 28],\n                28: [27, 29],\n                29: [28, 30, 41], \n                30: [29, 31],\n                31: [20, 30, 32],\n                32: [31, 33],\n                33: [32, 34, 42],\n                34: [33, 35], \n                35: [21, 34, 36],\n                36: [35, 37],\n                37: [36, 38, 43],\n                38: [37, 39],\n                39: [22, 38],\n                \n                \/\/ Connectors to middle (40-43)\n                40: [25, 44],\n                41: [29, 48],\n                42: [33, 52], \n                43: [37, 56],\n                \n                \/\/ Middle row (44-56) with bidirectional horizontal and upward connections\n                44: [40, 45],\n                45: [44, 46],\n                46: [45, 47, 57],\n                47: [46, 48],\n                48: [41, 47, 49],\n                49: [48, 50],\n                50: [49, 51],\n                51: [50, 52],\n                52: [42, 51, 53],\n                53: [52, 54],\n                54: [53, 55, 58],\n                55: [54, 56],\n                56: [43, 55],\n                \n                \/\/ Connectors upward (57-58)\n                57: [46, 59],\n                58: [54, 67],\n                \n                \/\/ Upper middle (59-67) with bidirectional horizontal and upward connections  \n                59: [57, 60],\n                60: [59, 61],\n                61: [60, 62, 68],\n                62: [61, 63],\n                63: [62, 64],\n                64: [63, 65],\n                65: [64, 66, 69],\n                66: [65, 67],\n                67: [58, 66],\n                \n                \/\/ Connectors to small upper (68-69)\n                68: [61, 70],\n                69: [65, 74],\n                \n                \/\/ Small upper section (70-74) with bidirectional horizontal and connector to 75\n                70: [68, 71], \n                71: [70, 72],\n                72: [71, 73, 75],\n                73: [72, 74],\n                74: [69, 73],\n                \n                \/\/ Connector down to upper row\n                75: [72, 84],\n                \n                \/\/ Upper row (76-92) with bidirectional horizontal and side connections\n                76: [77, 93],\n                77: [76, 78],\n                78: [77, 79],\n                79: [78, 80],\n                80: [79, 81],\n                81: [80, 82], \n                82: [81, 83],\n                83: [82, 84],\n                84: [75, 83, 85],\n                85: [84, 86],\n                86: [85, 87],\n                87: [86, 88],\n                88: [87, 89],\n                89: [88, 90],\n                90: [89, 91],\n                91: [90, 92],\n                92: [91, 94],\n                \n                \/\/ Side connectors (93-94)\n                93: [76, 95],\n                94: [92, 111],\n                \n                \/\/ Top row (95-111) with bidirectional horizontal and final target connection\n                95: [93, 96],\n                96: [95, 97],\n                97: [96, 98], \n                98: [97, 99],\n                99: [98, 100],\n                100: [99, 101],\n                101: [100, 102],\n                102: [101, 103],\n                103: [102, 104, 112], \/\/ Connection to target!\n                104: [103, 105],\n                105: [104, 106],\n                106: [105, 107],\n                107: [106, 108],\n                108: [107, 109],\n                109: [108, 110],\n                110: [109, 111],\n                111: [94, 110],\n                \n                \/\/ Target (final position)\n                112: []\n            };\n\n            \/\/ Function to apply barricade styling with image\n            function applyBarricadeStyle(element) {\n                \/\/ Remove any existing barricade images first to prevent duplicates\n                const existingImg = element.querySelector('.barricade-image');\n                if (existingImg) {\n                    existingImg.remove();\n                }\n                \n                element.classList.add('barricade');\n                \n                \/\/ Create and add the stop sign image\n                const stopImg = document.createElement('img');\n                stopImg.src = STOP_IMAGE_URL;\n                stopImg.className = 'barricade-image';\n                stopImg.alt = L10n.stopAlt || 'Stop';\n                element.appendChild(stopImg);\n            }\n\n            \/\/ Function to remove barricade styling\n            function removeBarricadeStyle(element) {\n                element.classList.remove('barricade');\n                \n                \/\/ Remove ALL stop sign images to prevent any leftovers\n                const stopImgs = element.querySelectorAll('.barricade-image');\n                stopImgs.forEach(img => img.remove());\n                \n                \/\/ Also remove any inline styles that might have been added\n                element.style.removeProperty('box-shadow');\n                element.style.removeProperty('border');\n                element.style.removeProperty('animation');\n                element.style.removeProperty('background');\n                element.style.removeProperty('transform');\n                element.style.removeProperty('z-index');\n            }\n\n            \/\/ AI DECISION MAKING FUNCTIONS\n            function makeAIMove() {\n                if (!isCurrentPlayerAI() || gameState.turnPhase !== 'move' || gameState.gameWon) {\n                    return;\n                }\n\n                gameState.aiThinking = true;\n                updateAIIndicator();\n                \n                console.log(sprintf(L10n.aiThinking || '\ud83e\udd16 AI Player %d is thinking...', gameState.currentPlayer));\n                \n                setTimeout(() => {\n                    const aiMove = chooseAIMove();\n                    if (aiMove) {\n                        console.log(`\ud83e\udd16 AI chose to move piece ${aiMove.piece.id} to position ${aiMove.destination}`);\n                        \n                        \/\/ Execute the move\n                        gameState.selectedPiece = aiMove.piece;\n                        aiMove.piece.element.classList.add('selected');\n                        \n                        setTimeout(() => {\n                            attemptMove(aiMove.piece, aiMove.destination);\n                            gameState.aiThinking = false;\n                            updateAIIndicator();\n                        }, 500);\n                    } else {\n                        console.log(`\ud83e\udd16 AI Player ${gameState.currentPlayer} has no valid moves`);\n                        gameState.aiThinking = false;\n                        updateAIIndicator();\n                        setTimeout(() => {\n                            endTurn();\n                        }, 1000);\n                    }\n                }, 1500); \/\/ AI thinking delay\n            }\n\n            function chooseAIMove() {\n                const aiPlayerPieces = gameState.playerPieces[gameState.currentPlayer];\n                const allMoves = [];\n\n                \/\/ Generate all possible moves for AI player\n                aiPlayerPieces.forEach(piece => {\n                    if (!piece.finished && canPieceMove(piece)) {\n                        let possibleMoves = [];\n                        \n                        if (String(piece.position).startsWith('start-')) {\n                            possibleMoves = getPossibleMoves(piece.position, gameState.diceRoll);\n                        } else {\n                            const currentPos = parseInt(piece.position);\n                            possibleMoves = getPossibleMoves(currentPos, gameState.diceRoll);\n                        }\n\n                        possibleMoves.forEach(destination => {\n                            const space = gameState.boardSpaces[destination];\n                            if (space && (!space.piece || space.piece.player !== piece.player)) {\n                                const moveData = {\n                                    piece: piece,\n                                    destination: destination,\n                                    space: space,\n                                    priority: calculateMovePriority(piece, destination, space)\n                                };\n                                allMoves.push(moveData);\n                            }\n                        });\n                    }\n                });\n\n                if (allMoves.length === 0) {\n                    return null;\n                }\n\n                \/\/ Sort moves by priority (highest first)\n                allMoves.sort((a, b) => b.priority - a.priority);\n                \n                console.log(`\ud83e\udd16 AI evaluating ${allMoves.length} possible moves:`);\n                allMoves.forEach(move => {\n                    console.log(`  - Move piece ${move.piece.id} to ${move.destination} (priority: ${move.priority})`);\n                });\n\n                return allMoves[0]; \/\/ Return highest priority move\n            }\n\n            function calculateMovePriority(piece, destination, space) {\n                let priority = 0;\n\n                \/\/ Priority 1: WINNING THE GAME (absolute highest priority!)\n                if (destination === 112) {\n                    priority += 10000; \/\/ Massively high priority for winning\n                    console.log(`\ud83c\udfc6 WINNING MOVE to target gets +10000 priority!`);\n                    return priority; \/\/ Return immediately - nothing beats winning!\n                }\n\n                \/\/ STRATEGIC ENTRY POINT PROTECTION: Never remove barricades from opponent entry points!\n                const opponentEntryPoints = [];\n                for (let player = 1; player <= 4; player++) {\n                    if (player !== gameState.currentPlayer) {\n                        opponentEntryPoints.push(STARTING_AREAS[player].entry);\n                    }\n                }\n                \n                if (space.isBarricade && opponentEntryPoints.includes(destination)) {\n                    priority -= 5000; \/\/ MASSIVE penalty for removing strategic barricades\n                    console.log(`\ud83d\udeab NEVER remove barricade from opponent entry point ${destination}! -5000 priority`);\n                    return priority; \/\/ This should almost never happen\n                }\n\n                \/\/ Priority 2: STRATEGIC ADVANCEMENT - Major bonus for forward progress\n                const destPos = parseInt(destination || 0);\n                const currentPos = String(piece.position).startsWith('start-') ? 0 : parseInt(piece.position || 0);\n                \n                \/\/ Big bonus for advancing significantly\n                if (destPos > currentPos) {\n                    const advancement = destPos - currentPos;\n                    priority += Math.min(advancement * 30, 1200); \/\/ Increased multiplier and cap\n                    console.log(`\ud83d\ude80 Advancement by ${advancement} spaces gets +${Math.min(advancement * 30, 1200)} priority`);\n                }\n\n                \/\/ Extra bonus for reaching higher sections of the board\n                if (destPos >= 95) {\n                    priority += 600; \/\/ Top row bonus (increased)\n                    console.log(`\ud83c\udfaf Top section bonus +600 priority`);\n                } else if (destPos >= 76) {\n                    priority += 500; \/\/ Upper row bonus (increased)\n                    console.log(`\u2b06\ufe0f Upper section bonus +500 priority`);\n                } else if (destPos >= 44) {\n                    priority += 400; \/\/ Middle section bonus (increased)\n                    console.log(`\u27a1\ufe0f Middle section bonus +400 priority`);\n                } else if (destPos >= 23) {\n                    priority += 200; \/\/ Second row bonus\n                    console.log(`\ud83d\udcc8 Second section bonus +200 priority`);\n                }\n\n                \/\/ HEAVY penalty for fighting on the first line (positions 1-17)\n                if (destPos >= 1 && destPos <= 17 && !String(piece.position).startsWith('start-')) {\n                    priority -= 300; \/\/ Heavy penalty for staying on first line\n                    console.log(`\ud83e\udd4a First line fighting penalty -300 priority`);\n                }\n\n                \/\/ Priority 3: Landing on barricades (but not on entry points)\n                if (space.isBarricade && !opponentEntryPoints.includes(destination)) {\n                    priority += 400; \/\/ Reduced from 600\n                    console.log(`\ud83d\udee1\ufe0f Barricade move to ${destination} gets +400 priority`);\n                }\n\n                \/\/ Priority 4: Sending opponent home (but avoid first line battles)\n                if (space.piece && space.piece.player !== piece.player) {\n                    if (destPos >= 1 && destPos <= 17) {\n                        priority += 100; \/\/ Reduced priority for first line attacks\n                        console.log(`\u2694\ufe0f First line attack gets only +100 priority`);\n                    } else {\n                        priority += 400; \/\/ Normal attack priority elsewhere\n                        console.log(`\u2694\ufe0f Attack move on player ${space.piece.player} at ${destination} gets +400 priority`);\n                    }\n                }\n\n                \/\/ Priority 5: Getting pieces out of starting area\n                if (String(piece.position).startsWith('start-')) {\n                    priority += 400; \/\/ Increased from 350\n                    console.log(`\ud83d\ude80 Moving out of start gets +400 priority`);\n                }\n\n                \/\/ Priority 6: Encourage spreading pieces across the board\n                const aiPlayerPieces = gameState.playerPieces[gameState.currentPlayer] || [];\n                const piecesInBottomTwoRows = aiPlayerPieces.filter(p => {\n                    const pos = String(p.position).startsWith('start-') ? 0 : parseInt(p.position || 0);\n                    return pos > 0 && pos <= 39; \/\/ Bottom two rows\n                }).length;\n                \n                if (piecesInBottomTwoRows >= 3 && destPos > 39) {\n                    priority += 500; \/\/ Increased bonus for advancing when clustering\n                    console.log(`\ud83d\udcc8 Anti-clustering advancement bonus +500 priority`);\n                }\n\n                \/\/ Bonus for getting past the crowded starting area quickly\n                if (destPos >= 40 && currentPos <= 17) {\n                    priority += 300; \/\/ Bonus for jumping past the first area\n                    console.log(`\ud83c\udfc3 Escaping starting area bonus +300 priority`);\n                }\n\n                return priority;\n            }\n        \n            function initGame() {\n                \/\/ Clear any existing board content first\n                const container = document.getElementById('blockade-board-container');\n                const existingSpaces = container.querySelectorAll('.path-space, .game-piece');\n                existingSpaces.forEach(el => el.remove());\n                \n                \/\/ Reset boardSpaces to prevent duplicates\n                gameState.boardSpaces = {};\n                \n                createBoard();\n                setupStartingAreas();\n                initializePieces();\n                updatePlayerSetup(); \/\/ Set up AI players\n                updateDisplay();\n            }\n            \n            function createBoard() {\n                const container = document.getElementById('blockade-board-container');\n                \n                \/\/ Make sure we only have the finish target and clear everything else\n                const finishTarget = document.querySelector('.finish-target');\n                finishTarget.onclick = () => handleSpaceClick(112);\n                \n                \/\/ Create all numbered path spaces (1-111) - WITHOUT NUMBERS\n                Object.values(EXACT_BOARD_LAYOUT).forEach(row => {\n                    row.forEach(space => {\n                        const spaceElement = document.createElement('div');\n                        spaceElement.className = space.barricade ? 'path-space barricade' : 'path-space';\n                        spaceElement.style.left = space.x + 'px';\n                        spaceElement.style.top = space.y + 'px';\n                        spaceElement.onclick = () => handleSpaceClick(space.pos);\n                        \n                        \/\/ Ensure barricades have proper styling from the start\n                        if (space.barricade) {\n                            applyBarricadeStyle(spaceElement);\n                        }\n                        \n                        gameState.boardSpaces[space.pos] = {\n                            element: spaceElement,\n                            x: space.x,\n                            y: space.y,\n                            piece: null,\n                            position: space.pos,\n                            isBarricade: space.barricade || false\n                        };\n                        \n                        container.appendChild(spaceElement);\n                    });\n                });\n                \n                \/\/ Add target position (112)\n                gameState.boardSpaces[112] = {\n                    element: document.querySelector('.finish-target'),\n                    x: 420, y: 85, piece: null, position: 112, isTarget: true\n                };\n                \n                createConnectionLines();\n            }\n            \n            function createConnectionLines() {\n                const container = document.getElementById('blockade-board-container');\n                \n                \/\/ Remove any existing connection lines first\n                const existingLines = container.querySelectorAll('.connection-line');\n                existingLines.forEach(line => line.remove());\n                \n                const connections = [\n                    {from: {x: 196, y: 720}, to: {x: 196, y: 660}, color: 'player-1'},\n                    {from: {x: 356, y: 720}, to: {x: 356, y: 660}, color: 'player-2'},\n                    {from: {x: 516, y: 720}, to: {x: 516, y: 660}, color: 'player-3'},\n                    {from: {x: 676, y: 720}, to: {x: 676, y: 660}, color: 'player-4'}\n                ];\n                \n                connections.forEach(conn => {\n                    const line = document.createElement('div');\n                    line.className = `connection-line ${conn.color}`;\n                    line.style.left = conn.from.x + 'px';\n                    line.style.top = conn.to.y + 'px';\n                    line.style.width = '4px';\n                    line.style.height = (conn.from.y - conn.to.y) + 'px';\n                    line.style.background = getConnectionColor(conn.color);\n                    container.appendChild(line);\n                });\n            }\n            \n            function getConnectionColor(playerColor) {\n                const colors = {\n                    'player-1': 'linear-gradient(to bottom, #DC143C, #DC143C)',\n                    'player-2': 'linear-gradient(to bottom, #228B22, #228B22)', \n                    'player-3': 'linear-gradient(to bottom, #FFD700, #FFD700)',\n                    'player-4': 'linear-gradient(to bottom, #4169E1, #4169E1)'\n                };\n                return colors[playerColor] || '#666666';\n            }\n            \n            function setupStartingAreas() {\n                const container = document.getElementById('blockade-board-container');\n                \n                \/\/ Remove any existing starting areas first\n                const existingAreas = container.querySelectorAll('.starting-area');\n                existingAreas.forEach(area => area.remove());\n                \n                Object.keys(STARTING_AREAS).forEach(playerNum => {\n                    const area = STARTING_AREAS[playerNum];\n                    const startingArea = document.createElement('div');\n                    startingArea.className = `starting-area ${area.color}`;\n                    startingArea.style.left = area.x + 'px';\n                    startingArea.style.top = area.y + 'px';\n                    \n                    const character = document.createElement('div');\n                    character.className = `player-character character-${playerNum}`;\n                    \n                    const spacesContainer = document.createElement('div');\n                    spacesContainer.className = 'starting-spaces';\n                    \n                    for (let i = 0; i < 5; i++) {\n                        const startSpace = document.createElement('div');\n                        startSpace.className = `start-space ${area.color}`;\n                        startSpace.dataset.player = playerNum;\n                        startSpace.dataset.startIndex = i;\n                        startSpace.onclick = () => handleStartSpaceClick(playerNum, i);\n                        spacesContainer.appendChild(startSpace);\n                        \n                        const spaceId = `start-${playerNum}-${i}`;\n                        const startPositions = [\n                            {x: 20, y: 40}, {x: 35, y: 40}, {x: 50, y: 40}, {x: 65, y: 40}, {x: 80, y: 40}\n                        ];\n                        \n                        gameState.boardSpaces[spaceId] = {\n                            element: startSpace,\n                            x: area.x + startPositions[i].x,\n                            y: area.y + startPositions[i].y,\n                            piece: null, isStart: true, player: parseInt(playerNum), startIndex: i\n                        };\n                    }\n                    \n                    startingArea.appendChild(spacesContainer);\n                    container.appendChild(startingArea);\n                });\n            }\n            \n            function initializePieces() {\n                gameState.playerPieces = {};\n                \n                for (let player = 1; player <= gameState.totalPlayers; player++) {\n                    gameState.playerPieces[player] = [];\n                    \n                    for (let i = 0; i < 5; i++) {\n                        const piece = {\n                            id: `piece-${player}-${i}`, player: player,\n                            position: `start-${player}-${i}`, finished: false, element: null\n                        };\n                        \n                        const pieceElement = document.createElement('div');\n                        pieceElement.className = `game-piece piece-${player}`;\n                        \n                        \/\/ Create truck image instead of text\n                        const truckImg = document.createElement('img');\n                        truckImg.src = TRUCK_IMAGES[player];\n                        truckImg.alt = sprintf(L10n.truckAlt || 'Player %d Truck %d', player, i + 1);\n                        truckImg.title = sprintf(L10n.truckAlt || 'Player %d Truck %d', player, i + 1);\n                        pieceElement.appendChild(truckImg);\n                        \n                        pieceElement.onclick = () => selectPiece(piece);\n                        piece.element = pieceElement;\n                        \n                        const startSpace = gameState.boardSpaces[`start-${player}-${i}`];\n                        pieceElement.style.left = (startSpace.x + 8) + 'px';\n                        pieceElement.style.top = (startSpace.y + 8) + 'px';\n                        startSpace.piece = piece;\n                        \n                        gameState.playerPieces[player].push(piece);\n                        document.getElementById('blockade-board-container').appendChild(pieceElement);\n                    }\n                }\n            }\n\n            function rollDice() {\n                if (gameState.turnPhase !== 'roll' || gameState.gameWon) return;\n                \n                gameState.diceRoll = Math.floor(Math.random() * 6) + 1;\n                gameState.turnPhase = 'move';\n                \n                \/\/ Check for rolling a 6 - player gets another turn\n                if (gameState.diceRoll === 6) {\n                    console.log(sprintf(L10n.playerRolledSix || 'Player %d rolled a 6! Gets another turn!', gameState.currentPlayer));\n                }\n                \n                console.log(sprintf(L10n.playerRolled || 'Player %d rolled %d', gameState.currentPlayer, gameState.diceRoll));\n                \n                updateDisplay(); \/\/ This will handle button state\n                \n                if (isCurrentPlayerAI()) {\n                    \/\/ AI player - automatically make move\n                    setTimeout(() => {\n                        makeAIMove();\n                    }, 1000);\n                } else {\n                    \/\/ Human player - highlight movable pieces\n                    highlightMovablePieces();\n                    \n                    \/\/ Check if player has any valid moves\n                    setTimeout(() => {\n                        console.log(`\\n\ud83d\udd0d === CHECKING VALID MOVES FOR PLAYER ${gameState.currentPlayer} ===`);\n                        \n                        const hasValidMoves = playerHasValidMoves(gameState.currentPlayer);\n                        \n                        if (!hasValidMoves) {\n                            console.log(`\\n\u274c === NO VALID MOVES - ENDING TURN ===`);\n                            \n                            \/\/ Show alert for feedback\n                            setTimeout(() => {\n                                alert(sprintf(L10n.noValidMoves || 'Player %d has no valid moves with roll %d! Turn ends.', gameState.currentPlayer, gameState.diceRoll));\n                            }, 100);\n                            \n                            \/\/ Clear highlights\n                            document.querySelectorAll('.highlight-move').forEach(el => el.classList.remove('highlight-move'));\n                            \n                            \/\/ End turn after alert\n                            setTimeout(() => {\n                                console.log(`\u23ed\ufe0f Auto-ending turn for player ${gameState.currentPlayer}`);\n                                endTurn();\n                            }, 1500);\n                        } else {\n                            console.log(`\\n\u2705 === PLAYER ${gameState.currentPlayer} HAS VALID MOVES ===`);\n                        }\n                    }, 300);\n                }\n            }\n                    \n            function highlightMovablePieces() {\n                document.querySelectorAll('.game-piece.highlight-move').forEach(el => {\n                    el.classList.remove('highlight-move');\n                });\n                \n                const currentPlayerPieces = gameState.playerPieces[gameState.currentPlayer];\n                currentPlayerPieces.forEach(piece => {\n                    if (!piece.finished && canPieceMove(piece)) {\n                        piece.element.classList.add('highlight-move');\n                    }\n                });\n            }\n\n            function getPossibleMoves(startPosition, steps) {\n                if (steps === 0) return [startPosition];\n                \n                \/\/ Handle starting positions\n                if (String(startPosition).startsWith('start-')) {\n                    const playerNum = startPosition.split('-')[1];\n                    const entryPosition = STARTING_AREAS[playerNum].entry;\n                    const entrySpace = gameState.boardSpaces[entryPosition];\n                    \n                    let possibleDestinations = [];\n                    \n                    \/\/ If entry position has a barricade, can ONLY land on it with roll of 1\n                    if (entrySpace.isBarricade) {\n                        if (steps === 1) {\n                            possibleDestinations.push(entryPosition);\n                        }\n                        \/\/ Can't pass through barricades, so no other moves possible\n                        return possibleDestinations;\n                    }\n                    \n                    \/\/ Normal entry handling (no barricade at entry)\n                    \n                    \/\/ Can land on entry position if not occupied by own piece\n                    if (!(entrySpace.piece && entrySpace.piece.player == playerNum)) {\n                        possibleDestinations.push(entryPosition);\n                    }\n                    \n                    \/\/ Calculate further moves from entry (can jump over own pieces)\n                    const remainingSteps = steps - 1;\n                    if (remainingSteps > 0) {\n                        const furtherMoves = getPossibleMoves(entryPosition, remainingSteps);\n                        possibleDestinations = [...possibleDestinations, ...furtherMoves];\n                    }\n                    \n                    return [...new Set(possibleDestinations)];\n                }\n                \n                let allPaths = [];\n                \n                function findPaths(currentPos, remainingSteps, currentPath) {\n                    if (remainingSteps === 0) {\n                        allPaths.push(currentPath[currentPath.length - 1]);\n                        return;\n                    }\n                    \n                    const connections = BOARD_PATHS[currentPos] || [];\n                    for (let nextPos of connections) {\n                        \/\/ Avoid immediate backtracking\n                        if (currentPath.length >= 2 && nextPos === currentPath[currentPath.length - 2]) {\n                            continue;\n                        }\n                        \n                        const space = gameState.boardSpaces[nextPos];\n                        if (space) {\n                            \/\/ Avoid loops\n                            if (currentPath.includes(nextPos)) continue;\n                            \n                            \/\/ FIXED: Allow landing on spaces with opponent pieces OR empty spaces\n                            if (remainingSteps === 1) {\n                                \/\/ This is the final step - can land here if not blocked by own piece\n                                if (!space.piece || space.piece.player !== gameState.currentPlayer) {\n                                    allPaths.push(nextPos);\n                                }\n                            } else {\n                                \/\/ Not final step - can pass through if not barricade\n                                if (space.isBarricade) {\n                                    continue; \/\/ Can't pass through barricades\n                                }\n                                findPaths(nextPos, remainingSteps - 1, [...currentPath, nextPos]);\n                            }\n                        }\n                    }\n                }\n                \n                findPaths(startPosition, steps, [startPosition]);\n                \n                \/\/ Remove duplicates and exclude starting position\n                const uniquePaths = [...new Set(allPaths)].filter(pos => pos !== startPosition);\n                \n                return uniquePaths;\n            }\n\n            function canPieceMove(piece) {\n                if (String(piece.position).startsWith('start-')) {\n                    const possibleMoves = getPossibleMoves(piece.position, gameState.diceRoll);\n                    \n                    return possibleMoves.some(dest => {\n                        const space = gameState.boardSpaces[dest];\n                        return !space.piece || space.piece.player !== piece.player;\n                    });\n                } else {\n                    const currentPos = parseInt(piece.position);\n                    const possibleDestinations = getPossibleMoves(currentPos, gameState.diceRoll);\n                    return possibleDestinations.some(dest => {\n                        const space = gameState.boardSpaces[dest];\n                        return !space.piece || space.piece.player !== piece.player;\n                    });\n                }\n            }\n\n            function selectPiece(piece) {\n                \/\/ Prevent human interaction during AI turn\n                if (isCurrentPlayerAI()) {\n                    return;\n                }\n\n                \/\/ DESELECTION: If clicking the same piece, deselect it\n                if (gameState.selectedPiece === piece) {\n                    piece.element.classList.remove('selected');\n                    gameState.selectedPiece = null;\n                    clearDestinationHighlight();\n                    console.log(`\ud83d\udd04 Piece deselected`);\n                    return;\n                }\n                            \n                \/\/ ATTACK LOGIC: If we have a piece selected and click an opponent, try to attack\n                if (gameState.turnPhase === 'move' && gameState.selectedPiece && gameState.selectedPiece !== piece) {\n                    if (String(piece.position).startsWith('start-')) return;\n                    \n                    let targetPosition = parseInt(piece.position);\n                    let validDestinations = [];\n                    \n                    if (String(gameState.selectedPiece.position).startsWith('start-')) {\n                        validDestinations = getPossibleMoves(gameState.selectedPiece.position, gameState.diceRoll);\n                    } else {\n                        const currentPos = parseInt(gameState.selectedPiece.position);\n                        validDestinations = getPossibleMoves(currentPos, gameState.diceRoll);\n                    }\n                    \n                    if (validDestinations.includes(targetPosition)) {\n                        attemptMove(gameState.selectedPiece, targetPosition);\n                        return;\n                    }\n                }\n                            \n                \/\/ NORMAL SELECTION\n                if (gameState.turnPhase !== 'move' || piece.player !== gameState.currentPlayer) return;\n                \n                if (gameState.selectedPiece && gameState.selectedPiece.element) {\n                    gameState.selectedPiece.element.classList.remove('selected');\n                }\n                clearDestinationHighlight();\n                \n                gameState.selectedPiece = piece;\n                piece.element.classList.add('selected');\n                highlightValidDestination(piece);\n                updateDisplay();\n            }\n                                \n\n            function highlightValidDestination(piece) {\n                let validDestinations = [];\n                \n                if (String(piece.position).startsWith('start-')) {\n                    \/\/ FIXED: From start, calculate moves properly including entry step\n                    validDestinations = getPossibleMoves(piece.position, gameState.diceRoll);\n                } else {\n                    const currentPos = parseInt(piece.position);\n                    validDestinations = getPossibleMoves(currentPos, gameState.diceRoll);\n                }\n\n                console.log(`Valid destinations for piece at ${piece.position}:`, validDestinations);\n\n                validDestinations.forEach(destination => {\n                    const space = gameState.boardSpaces[destination];\n                    if (space) {\n                        console.log(`Adding highlight-move to position ${destination}, isBarricade: ${space.isBarricade}`);\n                        space.element.classList.add('highlight-move');\n                        \n                        \/\/ Force the highlighting to be visible - EXTREME VERSION\n                        if (space.isBarricade) {\n                            console.log(`\ud83d\udee1\ufe0f Forcing EXTREME barricade highlight at position ${destination}`);\n                            \/\/ Create a massive visual effect that can't be missed\n                            space.element.style.setProperty('box-shadow', '0 0 30px #FF4500, 0 0 60px #FF4500, 0 0 90px #FF4500', 'important');\n                            space.element.style.setProperty('border', '5px solid #FF4500', 'important');\n                            space.element.style.setProperty('background', 'radial-gradient(circle, #FFD700, #FF4500)', 'important');\n                            space.element.style.setProperty('transform', 'scale(1.3)', 'important');\n                            space.element.style.setProperty('z-index', '999', 'important');\n                            space.element.style.setProperty('animation', 'none', 'important');\n                            \n                            \/\/ Flash effect\n                            let flashCount = 0;\n                            const flashInterval = setInterval(() => {\n                                if (flashCount < 6) {\n                                    space.element.style.setProperty('background', \n                                        flashCount % 2 === 0 ? 'radial-gradient(circle, #FFD700, #FF4500)' : 'radial-gradient(circle, #FF0000, #FFD700)', \n                                        'important');\n                                    flashCount++;\n                                } else {\n                                    clearInterval(flashInterval);\n                                }\n                            }, 200);\n                        }\n                        \n                        \/\/ Highlight opponent pieces for attack (red glow) - only for non-barricades\n                        if (space.piece && space.piece.player !== piece.player && !space.isBarricade) {\n                            space.element.style.boxShadow = '0 0 15px rgba(255,0,0,0.8)';\n                        }\n                    }\n                });\n            }\n                                \n            function clearDestinationHighlight() {\n                document.querySelectorAll('.path-space.highlight-move, .finish-target.highlight-move').forEach(el => {\n                    el.classList.remove('highlight-move');\n                    \n                    \/\/ Clear ALL custom inline styles for any highlighted element\n                    el.style.removeProperty('box-shadow');\n                    el.style.removeProperty('border');\n                    el.style.removeProperty('animation');\n                    el.style.removeProperty('background');\n                    el.style.removeProperty('transform');\n                    el.style.removeProperty('z-index');\n                    \n                    \/\/ Reset to default styling if not a barricade\n                    if (!el.classList.contains('barricade')) {\n                        el.style.boxShadow = '';\n                    }\n                });\n                \n                \/\/ Also clear any lingering highlights from all path spaces\n                document.querySelectorAll('.path-space').forEach(el => {\n                    if (!el.classList.contains('highlight-move') && !el.classList.contains('barricade')) {\n                        el.style.removeProperty('box-shadow');\n                        el.style.removeProperty('border');\n                        el.style.removeProperty('animation');\n                        el.style.removeProperty('background');\n                        el.style.removeProperty('transform');\n                        el.style.removeProperty('z-index');\n                    }\n                });\n            }\n                    \n            function highlightBarricadePlacementSpaces() {\n                clearDestinationHighlight();\n                \n                Object.keys(gameState.boardSpaces).forEach(position => {\n                    const space = gameState.boardSpaces[position];\n                    \n                    if (space.isStart || space.isTarget || space.piece || space.isBarricade) {\n                        return;\n                    }\n                    \n                    if (String(position).startsWith('start-') || position == 112) {\n                        return;\n                    }\n                    \n                    const pos = parseInt(position);\n                    if (pos >= 1 && pos <= 111) {\n                        space.element.classList.add('barricade-placement-mode');\n                    }\n                });\n            }\n            \n            function clearBarricadePlacementHighlights() {\n                document.querySelectorAll('.barricade-placement-mode').forEach(el => {\n                    el.classList.remove('barricade-placement-mode');\n                });\n            }\n            \n\n            function handleSpaceClick(position) {\n                \/\/ Prevent interaction during AI turn (except for barricade placement)\n                if (isCurrentPlayerAI() && !gameState.barricadeRelocationMode) {\n                    return;\n                }\n\n                \/\/ BARRICADE PLACEMENT MODE\n                if (gameState.barricadeRelocationMode) {\n                    const space = gameState.boardSpaces[position];\n                    \n                    if (space.isStart || space.isTarget || space.piece || space.isBarricade) {\n                        if (isCurrentPlayerAI()) {\n                            console.log('\ud83e\udd16 AI: Invalid barricade placement, choosing another location');\n                            \/\/ For AI, automatically choose a valid location\n                            const validSpaces = Object.keys(gameState.boardSpaces).filter(pos => {\n                                const s = gameState.boardSpaces[pos];\n                                const p = parseInt(pos);\n                                return !s.isStart && !s.isTarget && !s.piece && !s.isBarricade && \n                                    !String(pos).startsWith('start-') && pos != 112 && p >= 1 && p <= 111;\n                            });\n                            \n                            if (validSpaces.length > 0) {\n                                const randomSpace = validSpaces[Math.floor(Math.random() * validSpaces.length)];\n                                setTimeout(() => handleSpaceClick(parseInt(randomSpace)), 500);\n                            }\n                            return;\n                        } else {\n                            alert(L10n.cannotPlaceHere || '\u274c Cannot place barricade here! Choose an empty space.');\n                            return;\n                        }\n                    }\n                    \n                    if (String(position).startsWith('start-') || position == 112) {\n                        if (isCurrentPlayerAI()) {\n                            console.log('\ud83e\udd16 AI: Invalid placement location');\n                            return;\n                        } else {\n                            alert(L10n.cannotPlaceStartOrTarget || '\u274c Cannot place barricade in starting areas or target!');\n                            return;\n                        }\n                    }\n                    \n                    const pos = parseInt(position);\n                    if (pos < 1 || pos > 111) {\n                        if (!isCurrentPlayerAI()) {\n                            alert(L10n.invalidPlacement || '\u274c Invalid placement location!');\n                        }\n                        return;\n                    }\n\n                    \/\/ Place barricade at new location using the image\n                    applyBarricadeStyle(space.element);\n                    space.isBarricade = true;\n\n                    clearBarricadePlacementHighlights();\n                    clearDestinationHighlight(); \/\/ Extra cleanup after barricade placement\n                    gameState.barricadeRelocationMode = false;\n                    \n                    \/\/ Force cleanup of any lingering visual effects\n                    setTimeout(() => {\n                        clearDestinationHighlight();\n                        document.querySelectorAll('.highlight-move').forEach(el => el.classList.remove('highlight-move'));\n                    }, 100);\n                    \n                    checkWinCondition();\n                    if (!gameState.gameWon) {\n                        setTimeout(() => { endTurn(); }, 500);\n                    }\n                    \n                    return;\n                }\n\n                \/\/ NORMAL MOVE MODE\n                if (gameState.turnPhase === 'move' && gameState.selectedPiece) {\n                    const targetSpace = gameState.boardSpaces[position];\n                    \n                    let validDestinations = [];\n                    \n                    if (String(gameState.selectedPiece.position).startsWith('start-')) {\n                        \/\/ FIXED: From start, use proper move calculation\n                        validDestinations = getPossibleMoves(gameState.selectedPiece.position, gameState.diceRoll);\n                    } else {\n                        const currentPos = parseInt(gameState.selectedPiece.position);\n                        validDestinations = getPossibleMoves(currentPos, gameState.diceRoll);\n                    }\n                    \n                    console.log(`Clicked position ${position}, valid destinations:`, validDestinations);\n                    \n                    if (validDestinations.includes(position)) {\n                        attemptMove(gameState.selectedPiece, position);\n                    } else {\n                        console.log(`\u274c Position ${position} not in valid destinations`);\n                    }\n                }\n            }\n            \n            function handleStartSpaceClick(player, startIndex) {\n                if (isCurrentPlayerAI()) {\n                    return; \/\/ AI handles its own pieces\n                }\n\n                const spaceId = `start-${player}-${startIndex}`;\n                const space = gameState.boardSpaces[spaceId];\n                \n                if (space.piece && space.piece.player === gameState.currentPlayer) {\n                    selectPiece(space.piece);\n                }\n            }\n\n            function playerHasValidMoves(playerNum) {\n                const playerPieces = gameState.playerPieces[playerNum];\n                if (!playerPieces) {\n                    console.log(`\u274c No pieces found for player ${playerNum}`);\n                    return false;\n                }\n                \n                console.log(`\\n\ud83d\udd0d Checking valid moves for player ${playerNum} with roll ${gameState.diceRoll}`);\n                \n                for (let piece of playerPieces) {\n                    if (piece.finished) {\n                        console.log(`\u2b50 Piece ${piece.id} already finished`);\n                        continue;\n                    }\n                    \n                    console.log(`\ud83d\udd0d Checking piece ${piece.id} at position ${piece.position}`);\n                    \n                    \/\/ Get possible moves for this piece\n                    let possibleMoves = [];\n                    \n                    try {\n                        possibleMoves = getPossibleMoves(piece.position, gameState.diceRoll);\n                        console.log(`\ud83d\udccd Piece ${piece.id} possible moves:`, possibleMoves);\n                    } catch (error) {\n                        console.log(`\u274c Error getting moves for piece ${piece.id}:`, error);\n                        continue;\n                    }\n                    \n                    \/\/ Check if any destination is available (not blocked by own pieces)\n                    for (let dest of possibleMoves) {\n                        const space = gameState.boardSpaces[dest];\n                        if (!space) {\n                            console.log(`\u274c Invalid destination ${dest}`);\n                            continue;\n                        }\n                        \n                        const blocked = space.piece && space.piece.player === piece.player;\n                        console.log(`\ud83c\udfaf Destination ${dest}: ${space.piece ? `occupied by player ${space.piece.player}` : 'empty'} - ${blocked ? 'BLOCKED' : 'AVAILABLE'}`);\n                        \n                        if (!blocked) {\n                            console.log(`\u2705 Player ${playerNum} CAN move piece ${piece.id} to ${dest}`);\n                            return true;\n                        }\n                    }\n                }\n                \n                console.log(`\u274c Player ${playerNum} has NO valid moves with roll ${gameState.diceRoll}`);\n                return false;\n            }      \n\n            function attemptMove(piece, destinationPosition) {\n                let validMove = false;\n                \n                if (String(piece.position).startsWith('start-')) {\n                    const possibleMoves = getPossibleMoves(piece.position, gameState.diceRoll);\n                    \n                    if (possibleMoves.includes(destinationPosition)) {\n                        validMove = true;\n                    }\n                } else {\n                    const currentPos = parseInt(piece.position);\n                    const possibleMoves = getPossibleMoves(currentPos, gameState.diceRoll);\n                    \n                    if (possibleMoves.includes(destinationPosition)) {\n                        validMove = true;\n                    }\n                }\n                \n                if (validMove) {\n                    movePiece(piece, destinationPosition);\n                    if (gameState.selectedPiece) {\n                        gameState.selectedPiece.element.classList.remove('selected');\n                        gameState.selectedPiece = null;\n                    }\n                    clearDestinationHighlight();\n                }\n            }\n            \n            function movePiece(piece, destinationPosition) {\n                const currentSpace = gameState.boardSpaces[piece.position];\n                if (currentSpace) currentSpace.piece = null;\n                \n                const destSpace = gameState.boardSpaces[destinationPosition];\n                \n                \/\/ Send opponent home\n                if (destSpace.piece && destSpace.piece.player !== piece.player) {\n                    returnPieceToStart(destSpace.piece);\n                }\n                \n                \/\/ Move piece to destination FIRST - with robust positioning\n                piece.position = String(destinationPosition);\n                destSpace.piece = piece;\n                \n                \/\/ Calculate proper piece position\n                const pieceX = destSpace.x + 16;\n                const pieceY = destSpace.y + 16;\n                \n                console.log(`\ud83d\ude9b Moving piece ${piece.id} to position ${destinationPosition} at (${pieceX}, ${pieceY})`);\n                console.log(`\ud83d\udd0d Piece element before move:`, piece.element.style.cssText);\n                \n                \/\/ BARRICADE RELOCATION: If landing exactly on a barricade, enter relocation mode\n                if (destSpace.isBarricade) {\n                    console.log(`\ud83d\udee1\ufe0f Piece landed on barricade at ${destinationPosition}, entering relocation mode`);\n                    \n                    \/\/ FIRST: Position the piece element BEFORE removing barricade\n                    piece.element.style.position = 'absolute';\n                    piece.element.style.left = pieceX + 'px';\n                    piece.element.style.top = pieceY + 'px';\n                    piece.element.style.zIndex = '1000';\n                    piece.element.style.display = 'flex';\n                    piece.element.style.visibility = 'visible';\n                    piece.element.style.opacity = '1';\n                    piece.element.style.pointerEvents = 'auto';\n                    \n                    console.log(`\ud83d\udd0d Piece element after positioning:`, piece.element.style.cssText);\n                    \n                    \/\/ THEN: Remove barricade from current position\n                    removeBarricadeStyle(destSpace.element);\n                    destSpace.isBarricade = false;\n                    \n                    \/\/ FINALLY: Re-confirm piece positioning after barricade removal\n                    setTimeout(() => {\n                        console.log(`\ud83d\udd27 Re-checking piece ${piece.id} after barricade removal`);\n                        console.log(`\ud83d\udd0d Piece element visibility:`, {\n                            display: piece.element.style.display,\n                            visibility: piece.element.style.visibility,\n                            opacity: piece.element.style.opacity,\n                            zIndex: piece.element.style.zIndex,\n                            left: piece.element.style.left,\n                            top: piece.element.style.top\n                        });\n                        \n                        \/\/ Force all properties again\n                        piece.element.style.position = 'absolute';\n                        piece.element.style.left = pieceX + 'px';\n                        piece.element.style.top = pieceY + 'px';\n                        piece.element.style.zIndex = '1000';\n                        piece.element.style.display = 'flex';\n                        piece.element.style.visibility = 'visible';\n                        piece.element.style.opacity = '1';\n                        \n                        console.log(`\ud83d\udd27 Piece ${piece.id} final state:`, piece.element.style.cssText);\n                    }, 100);\n                    \n                    \/\/ Enter barricade relocation mode\n                    gameState.barricadeRelocationMode = true;\n                    \n                    if (isCurrentPlayerAI()) {\n                        \/\/ AI automatically handles barricade placement\n                        setTimeout(() => {\n                            \/\/ STRATEGIC BARRICADE PLACEMENT: Prioritize opponent entry points\n                            const opponentEntryPoints = [];\n                            for (let player = 1; player <= 4; player++) {\n                                if (player !== gameState.currentPlayer) {\n                                    opponentEntryPoints.push(STARTING_AREAS[player].entry);\n                                }\n                            }\n                            \n                            \/\/ Find valid spaces for barricade placement\n                            const validSpaces = Object.keys(gameState.boardSpaces).filter(pos => {\n                                const space = gameState.boardSpaces[pos];\n                                const p = parseInt(pos);\n                                return !space.isStart && !space.isTarget && !space.piece && !space.isBarricade && \n                                    !String(pos).startsWith('start-') && pos != 112 && p >= 1 && p <= 111;\n                            });\n                            \n                            let chosenSpace = null;\n                            \n                            \/\/ Priority 1: Place on opponent entry points if available\n                            const availableEntryPoints = opponentEntryPoints.filter(entry => validSpaces.includes(String(entry)));\n                            if (availableEntryPoints.length > 0) {\n                                chosenSpace = availableEntryPoints[Math.floor(Math.random() * availableEntryPoints.length)];\n                                console.log(`\ud83c\udfaf AI strategically placing barricade on opponent entry point ${chosenSpace}`);\n                            }\n                            \/\/ Priority 2: Place on strategic positions (middle to upper board)\n                            else {\n                                const strategicSpaces = validSpaces.filter(pos => {\n                                    const p = parseInt(pos);\n                                    return p >= 40 && p <= 100; \/\/ Middle to upper board area\n                                });\n                                \n                                if (strategicSpaces.length > 0) {\n                                    chosenSpace = strategicSpaces[Math.floor(Math.random() * strategicSpaces.length)];\n                                    console.log(`\ud83c\udfb2 AI placing barricade strategically at position ${chosenSpace}`);\n                                } else if (validSpaces.length > 0) {\n                                    chosenSpace = validSpaces[Math.floor(Math.random() * validSpaces.length)];\n                                    console.log(`\ud83c\udfb2 AI placing barricade randomly at position ${chosenSpace}`);\n                                }\n                            }\n                            \n                            if (chosenSpace) {\n                                handleSpaceClick(parseInt(chosenSpace));\n                            }\n                        }, 1000);\n                    } else {\n                        highlightBarricadePlacementSpaces();\n                    }\n                    \n                } else {\n                    \/\/ Normal move - not on barricade\n                    piece.element.style.left = pieceX + 'px';\n                    piece.element.style.top = pieceY + 'px';\n                    piece.element.style.zIndex = '10';\n                }\n                \n                if (destinationPosition === 112) {\n                    piece.finished = true;\n                }\n                \n                \/\/ If not in barricade mode, check win and end turn normally\n                if (!gameState.barricadeRelocationMode) {\n                    checkWinCondition();\n                    if (!gameState.gameWon) {\n                        setTimeout(() => { endTurn(); }, 500);\n                    }\n                }\n            }\n            \n            function returnPieceToStart(piece) {\n                for (let i = 0; i < 5; i++) {\n                    const startSpaceId = `start-${piece.player}-${i}`;\n                    const startSpace = gameState.boardSpaces[startSpaceId];\n                    if (!startSpace.piece) {\n                        const currentSpace = gameState.boardSpaces[piece.position];\n                        if (currentSpace) currentSpace.piece = null;\n                        \n                        piece.position = startSpaceId;\n                        piece.finished = false;\n                        startSpace.piece = piece;\n                        \n                        piece.element.style.left = (startSpace.x + 8) + 'px';\n                        piece.element.style.top = (startSpace.y + 8) + 'px';\n                        break;\n                    }\n                }\n            }\n            \n            function checkWinCondition() {\n                const currentPlayerPieces = gameState.playerPieces[gameState.currentPlayer];\n                if (currentPlayerPieces.some(piece => piece.finished)) {\n                    gameState.gameWon = true;\n                    setTimeout(() => {\n                        const playerType = isCurrentPlayerAI() ? (L10n.aiText || 'AI') : (L10n.humanText || 'Human');\n                        alert(sprintf(L10n.playerWins || '\ud83c\udf89 Player %d (%s) wins! Reached position 112! \ud83c\udfc6', gameState.currentPlayer, playerType));\n                    }, 500);\n                }\n            }\n\n            function endTurn() {\n                \/\/ Check if player rolled a 6 and should get another turn\n                const rolledSix = gameState.diceRoll === 6;\n                \n                if (!rolledSix) {\n                    \/\/ Normal turn change\n                    gameState.currentPlayer = (gameState.currentPlayer % gameState.totalPlayers) + 1;\n                } else {\n                    \/\/ Same player continues (they rolled a 6)\n                    console.log(`\ud83c\udfb2 Player ${gameState.currentPlayer} continues (rolled 6)`);\n                }\n                \n                gameState.turnPhase = 'roll';\n                gameState.barricadeRelocationMode = false;\n                gameState.aiThinking = false;\n                \n                if (gameState.selectedPiece) {\n                    gameState.selectedPiece.element.classList.remove('selected');\n                    gameState.selectedPiece = null;\n                }\n                \n                gameState.diceRoll = 0;\n                \n                document.querySelectorAll('.highlight-move').forEach(el => el.classList.remove('highlight-move'));\n                clearDestinationHighlight();\n                clearBarricadePlacementHighlights();\n                \n                updateDisplay(); \/\/ This will now handle button enabling\/disabling\n\n                \/\/ If next player is AI, automatically roll dice after a short delay\n                if (isCurrentPlayerAI() && !gameState.gameWon) {\n                    setTimeout(() => {\n                        rollDice();\n                    }, 1500);\n                }\n            }\n\n            function resetGame() {\n                document.querySelectorAll('.game-piece').forEach(el => el.remove());\n                \n                gameState = {\n                    currentPlayer: 1, \n                    humanPlayers: gameState.humanPlayers,\n                    totalPlayers: 4,\n                    diceRoll: 0,\n                    turnPhase: 'roll', \n                    selectedPiece: null, \n                    boardSpaces: gameState.boardSpaces,\n                    playerPieces: {}, \n                    gameWon: false, \n                    barricadeRelocationMode: false,\n                    aiPlayers: gameState.aiPlayers,\n                    aiThinking: false\n                };\n                \n                Object.values(gameState.boardSpaces).forEach(space => { space.piece = null; });\n                \n                clearBarricadePlacementHighlights();\n                clearDestinationHighlight();\n                \n                \/\/ FIRST: Clear ALL existing barricades from the board\n                Object.values(gameState.boardSpaces).forEach(space => {\n                    if (space.isBarricade) {\n                        removeBarricadeStyle(space.element);\n                        space.isBarricade = false;\n                    }\n                });\n                \n                \/\/ THEN: Restore only the original barricades with proper styling\n                [23, 27, 31, 35, 39, 61, 65, 72, 75, 84, 103].forEach(pos => {\n                    const space = gameState.boardSpaces[pos];\n                    if (space) {\n                        applyBarricadeStyle(space.element);\n                        space.isBarricade = true;\n                    }\n                });\n                \n                document.getElementById('roll-dice').disabled = false;\n                \n                initializePieces();\n                updateDisplay();\n\n                \/\/ If starting player is AI, auto-roll after a delay\n                if (isCurrentPlayerAI()) {\n                    setTimeout(() => {\n                        rollDice();\n                    }, 2000);\n                }\n            }\n            \n            function updateDisplay() {\n                const currentPlayerElement = document.getElementById('current-player');\n                currentPlayerElement.textContent = L10n.playerNames ? L10n.playerNames[gameState.currentPlayer - 1] : `Player ${gameState.currentPlayer}`;\n                \n                const diceDisplay = gameState.diceRoll ? gameState.diceRoll : '\ud83c\udfb2';\n                document.getElementById('dice-result').textContent = diceDisplay;\n\n                \/\/ Disable Roll Dice button if it's an AI player's turn or not in roll phase\n                const rollButton = document.getElementById('roll-dice');\n                const isAITurn = isCurrentPlayerAI();\n                const canRoll = gameState.turnPhase === 'roll' && !gameState.gameWon;\n                \n                rollButton.disabled = !canRoll || isAITurn;\n                \n                \/\/ Visual feedback for disabled state\n                if (isAITurn && canRoll) {\n                    rollButton.style.opacity = '0.5';\n                    rollButton.title = L10n.aiPlayerTurnTitle || 'AI Player Turn';\n                } else if (!canRoll) {\n                    rollButton.style.opacity = '0.5';\n                    rollButton.title = L10n.notYourTurnTitle || 'Not your turn to roll';\n                } else {\n                    rollButton.style.opacity = '1';\n                    rollButton.title = L10n.rollDiceTitle || 'Roll the dice';\n                }\n\n                updateAIIndicator();\n            }\n            \n\n            document.addEventListener('DOMContentLoaded', function() {\n                initGame();\n            });\n        <\/script>\n        \n<\/div><\/div>\n\n<\/div><\/div><\/div><\/div>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":11,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_kad_blocks_custom_css":"","_kad_blocks_head_custom_js":"","_kad_blocks_body_custom_js":"","_kad_blocks_footer_custom_js":"","_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"footnotes":""},"class_list":["post-339","page","type-page","status-publish","hentry"],"taxonomy_info":[],"featured_image_src_large":false,"author_info":{"display_name":"mike","author_link":"https:\/\/swen-mercer.com\/de\/author\/mike\/"},"comment_info":0,"_links":{"self":[{"href":"https:\/\/swen-mercer.com\/de\/wp-json\/wp\/v2\/pages\/339","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/swen-mercer.com\/de\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/swen-mercer.com\/de\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/swen-mercer.com\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/swen-mercer.com\/de\/wp-json\/wp\/v2\/comments?post=339"}],"version-history":[{"count":1,"href":"https:\/\/swen-mercer.com\/de\/wp-json\/wp\/v2\/pages\/339\/revisions"}],"predecessor-version":[{"id":340,"href":"https:\/\/swen-mercer.com\/de\/wp-json\/wp\/v2\/pages\/339\/revisions\/340"}],"wp:attachment":[{"href":"https:\/\/swen-mercer.com\/de\/wp-json\/wp\/v2\/media?parent=339"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}