<m-prompt
  id="tb-ick-prompt"
  message="Play ice Checkers. Type FROM TO, like B3 C4 or C4 E6. RESET clears the board."
  placeholder="B3 C4"
  prefill="B3 C4"
  debug="false"
>
  <m-model
    id="tb-ick-board-model"
    src="/assets/tb_ice_checkers_board_downloads.glb"
    x="0"
    y="0.96"
    z="3.84"
    rx="-90"
    sx="8"
    sy="8"
    sz="8"
  ></m-model>
<m-cube id="tb-ick-slab-0-0" x="-2.52" y="1.56" z="-2.52" width="0.58" height="0.2" depth="0.58" color="#aeefff" opacity="0.9" visible="false"></m-cube>
<m-label id="tb-ick-cell-0-0" x="-2.52" y="1.68" z="-2.52" rx="-90" width="0.58" height="0.58" font-size="52" alignment="center" color="#e9f7fb" font-color="#061827" emissive="0" visible="false" content=""></m-label>
<m-cube id="tb-ick-slab-0-1" x="-1.8" y="1.56" z="-2.52" width="0.58" height="0.2" depth="0.58" color="#aeefff" opacity="0.9" visible="false"></m-cube>
<m-label id="tb-ick-cell-0-1" x="-1.8" y="1.68" z="-2.52" rx="-90" width="0.58" height="0.58" font-size="52" alignment="center" color="#e9f7fb" font-color="#061827" emissive="0" visible="false" content=""></m-label>
<m-cube id="tb-ick-slab-0-2" x="-1.08" y="1.56" z="-2.52" width="0.58" height="0.2" depth="0.58" color="#aeefff" opacity="0.9" visible="false"></m-cube>
<m-label id="tb-ick-cell-0-2" x="-1.08" y="1.68" z="-2.52" rx="-90" width="0.58" height="0.58" font-size="52" alignment="center" color="#e9f7fb" font-color="#061827" emissive="0" visible="false" content=""></m-label>
<m-cube id="tb-ick-slab-0-3" x="-0.36" y="1.56" z="-2.52" width="0.58" height="0.2" depth="0.58" color="#aeefff" opacity="0.9" visible="false"></m-cube>
<m-label id="tb-ick-cell-0-3" x="-0.36" y="1.68" z="-2.52" rx="-90" width="0.58" height="0.58" font-size="52" alignment="center" color="#e9f7fb" font-color="#061827" emissive="0" visible="false" content=""></m-label>
<m-cube id="tb-ick-slab-0-4" x="0.36" y="1.56" z="-2.52" width="0.58" height="0.2" depth="0.58" color="#aeefff" opacity="0.9" visible="false"></m-cube>
<m-label id="tb-ick-cell-0-4" x="0.36" y="1.68" z="-2.52" rx="-90" width="0.58" height="0.58" font-size="52" alignment="center" color="#e9f7fb" font-color="#061827" emissive="0" visible="false" content=""></m-label>
<m-cube id="tb-ick-slab-0-5" x="1.08" y="1.56" z="-2.52" width="0.58" height="0.2" depth="0.58" color="#aeefff" opacity="0.9" visible="false"></m-cube>
<m-label id="tb-ick-cell-0-5" x="1.08" y="1.68" z="-2.52" rx="-90" width="0.58" height="0.58" font-size="52" alignment="center" color="#e9f7fb" font-color="#061827" emissive="0" visible="false" content=""></m-label>
<m-cube id="tb-ick-slab-0-6" x="1.8" y="1.56" z="-2.52" width="0.58" height="0.2" depth="0.58" color="#aeefff" opacity="0.9" visible="false"></m-cube>
<m-label id="tb-ick-cell-0-6" x="1.8" y="1.68" z="-2.52" rx="-90" width="0.58" height="0.58" font-size="52" alignment="center" color="#e9f7fb" font-color="#061827" emissive="0" visible="false" content=""></m-label>
<m-cube id="tb-ick-slab-0-7" x="2.52" y="1.56" z="-2.52" width="0.58" height="0.2" depth="0.58" color="#aeefff" opacity="0.9" visible="false"></m-cube>
<m-label id="tb-ick-cell-0-7" x="2.52" y="1.68" z="-2.52" rx="-90" width="0.58" height="0.58" font-size="52" alignment="center" color="#e9f7fb" font-color="#061827" emissive="0" visible="false" content=""></m-label>
<m-cube id="tb-ick-slab-1-0" x="-2.52" y="1.56" z="-1.8" width="0.58" height="0.2" depth="0.58" color="#aeefff" opacity="0.9" visible="false"></m-cube>
<m-label id="tb-ick-cell-1-0" x="-2.52" y="1.68" z="-1.8" rx="-90" width="0.58" height="0.58" font-size="52" alignment="center" color="#e9f7fb" font-color="#061827" emissive="0" visible="false" content=""></m-label>
<m-cube id="tb-ick-slab-1-1" x="-1.8" y="1.56" z="-1.8" width="0.58" height="0.2" depth="0.58" color="#aeefff" opacity="0.9" visible="false"></m-cube>
<m-label id="tb-ick-cell-1-1" x="-1.8" y="1.68" z="-1.8" rx="-90" width="0.58" height="0.58" font-size="52" alignment="center" color="#e9f7fb" font-color="#061827" emissive="0" visible="false" content=""></m-label>
<m-cube id="tb-ick-slab-1-2" x="-1.08" y="1.56" z="-1.8" width="0.58" height="0.2" depth="0.58" color="#aeefff" opacity="0.9" visible="false"></m-cube>
<m-label id="tb-ick-cell-1-2" x="-1.08" y="1.68" z="-1.8" rx="-90" width="0.58" height="0.58" font-size="52" alignment="center" color="#e9f7fb" font-color="#061827" emissive="0" visible="false" content=""></m-label>
<m-cube id="tb-ick-slab-1-3" x="-0.36" y="1.56" z="-1.8" width="0.58" height="0.2" depth="0.58" color="#aeefff" opacity="0.9" visible="false"></m-cube>
<m-label id="tb-ick-cell-1-3" x="-0.36" y="1.68" z="-1.8" rx="-90" width="0.58" height="0.58" font-size="52" alignment="center" color="#e9f7fb" font-color="#061827" emissive="0" visible="false" content=""></m-label>
<m-cube id="tb-ick-slab-1-4" x="0.36" y="1.56" z="-1.8" width="0.58" height="0.2" depth="0.58" color="#aeefff" opacity="0.9" visible="false"></m-cube>
<m-label id="tb-ick-cell-1-4" x="0.36" y="1.68" z="-1.8" rx="-90" width="0.58" height="0.58" font-size="52" alignment="center" color="#e9f7fb" font-color="#061827" emissive="0" visible="false" content=""></m-label>
<m-cube id="tb-ick-slab-1-5" x="1.08" y="1.56" z="-1.8" width="0.58" height="0.2" depth="0.58" color="#aeefff" opacity="0.9" visible="false"></m-cube>
<m-label id="tb-ick-cell-1-5" x="1.08" y="1.68" z="-1.8" rx="-90" width="0.58" height="0.58" font-size="52" alignment="center" color="#e9f7fb" font-color="#061827" emissive="0" visible="false" content=""></m-label>
<m-cube id="tb-ick-slab-1-6" x="1.8" y="1.56" z="-1.8" width="0.58" height="0.2" depth="0.58" color="#aeefff" opacity="0.9" visible="false"></m-cube>
<m-label id="tb-ick-cell-1-6" x="1.8" y="1.68" z="-1.8" rx="-90" width="0.58" height="0.58" font-size="52" alignment="center" color="#e9f7fb" font-color="#061827" emissive="0" visible="false" content=""></m-label>
<m-cube id="tb-ick-slab-1-7" x="2.52" y="1.56" z="-1.8" width="0.58" height="0.2" depth="0.58" color="#aeefff" opacity="0.9" visible="false"></m-cube>
<m-label id="tb-ick-cell-1-7" x="2.52" y="1.68" z="-1.8" rx="-90" width="0.58" height="0.58" font-size="52" alignment="center" color="#e9f7fb" font-color="#061827" emissive="0" visible="false" content=""></m-label>
<m-cube id="tb-ick-slab-2-0" x="-2.52" y="1.56" z="-1.08" width="0.58" height="0.2" depth="0.58" color="#aeefff" opacity="0.9" visible="false"></m-cube>
<m-label id="tb-ick-cell-2-0" x="-2.52" y="1.68" z="-1.08" rx="-90" width="0.58" height="0.58" font-size="52" alignment="center" color="#e9f7fb" font-color="#061827" emissive="0" visible="false" content=""></m-label>
<m-cube id="tb-ick-slab-2-1" x="-1.8" y="1.56" z="-1.08" width="0.58" height="0.2" depth="0.58" color="#aeefff" opacity="0.9" visible="false"></m-cube>
<m-label id="tb-ick-cell-2-1" x="-1.8" y="1.68" z="-1.08" rx="-90" width="0.58" height="0.58" font-size="52" alignment="center" color="#e9f7fb" font-color="#061827" emissive="0" visible="false" content=""></m-label>
<m-cube id="tb-ick-slab-2-2" x="-1.08" y="1.56" z="-1.08" width="0.58" height="0.2" depth="0.58" color="#aeefff" opacity="0.9" visible="false"></m-cube>
<m-label id="tb-ick-cell-2-2" x="-1.08" y="1.68" z="-1.08" rx="-90" width="0.58" height="0.58" font-size="52" alignment="center" color="#e9f7fb" font-color="#061827" emissive="0" visible="false" content=""></m-label>
<m-cube id="tb-ick-slab-2-3" x="-0.36" y="1.56" z="-1.08" width="0.58" height="0.2" depth="0.58" color="#aeefff" opacity="0.9" visible="false"></m-cube>
<m-label id="tb-ick-cell-2-3" x="-0.36" y="1.68" z="-1.08" rx="-90" width="0.58" height="0.58" font-size="52" alignment="center" color="#e9f7fb" font-color="#061827" emissive="0" visible="false" content=""></m-label>
<m-cube id="tb-ick-slab-2-4" x="0.36" y="1.56" z="-1.08" width="0.58" height="0.2" depth="0.58" color="#aeefff" opacity="0.9" visible="false"></m-cube>
<m-label id="tb-ick-cell-2-4" x="0.36" y="1.68" z="-1.08" rx="-90" width="0.58" height="0.58" font-size="52" alignment="center" color="#e9f7fb" font-color="#061827" emissive="0" visible="false" content=""></m-label>
<m-cube id="tb-ick-slab-2-5" x="1.08" y="1.56" z="-1.08" width="0.58" height="0.2" depth="0.58" color="#aeefff" opacity="0.9" visible="false"></m-cube>
<m-label id="tb-ick-cell-2-5" x="1.08" y="1.68" z="-1.08" rx="-90" width="0.58" height="0.58" font-size="52" alignment="center" color="#e9f7fb" font-color="#061827" emissive="0" visible="false" content=""></m-label>
<m-cube id="tb-ick-slab-2-6" x="1.8" y="1.56" z="-1.08" width="0.58" height="0.2" depth="0.58" color="#aeefff" opacity="0.9" visible="false"></m-cube>
<m-label id="tb-ick-cell-2-6" x="1.8" y="1.68" z="-1.08" rx="-90" width="0.58" height="0.58" font-size="52" alignment="center" color="#e9f7fb" font-color="#061827" emissive="0" visible="false" content=""></m-label>
<m-cube id="tb-ick-slab-2-7" x="2.52" y="1.56" z="-1.08" width="0.58" height="0.2" depth="0.58" color="#aeefff" opacity="0.9" visible="false"></m-cube>
<m-label id="tb-ick-cell-2-7" x="2.52" y="1.68" z="-1.08" rx="-90" width="0.58" height="0.58" font-size="52" alignment="center" color="#e9f7fb" font-color="#061827" emissive="0" visible="false" content=""></m-label>
<m-cube id="tb-ick-slab-3-0" x="-2.52" y="1.56" z="-0.36" width="0.58" height="0.2" depth="0.58" color="#aeefff" opacity="0.9" visible="false"></m-cube>
<m-label id="tb-ick-cell-3-0" x="-2.52" y="1.68" z="-0.36" rx="-90" width="0.58" height="0.58" font-size="52" alignment="center" color="#e9f7fb" font-color="#061827" emissive="0" visible="false" content=""></m-label>
<m-cube id="tb-ick-slab-3-1" x="-1.8" y="1.56" z="-0.36" width="0.58" height="0.2" depth="0.58" color="#aeefff" opacity="0.9" visible="false"></m-cube>
<m-label id="tb-ick-cell-3-1" x="-1.8" y="1.68" z="-0.36" rx="-90" width="0.58" height="0.58" font-size="52" alignment="center" color="#e9f7fb" font-color="#061827" emissive="0" visible="false" content=""></m-label>
<m-cube id="tb-ick-slab-3-2" x="-1.08" y="1.56" z="-0.36" width="0.58" height="0.2" depth="0.58" color="#aeefff" opacity="0.9" visible="false"></m-cube>
<m-label id="tb-ick-cell-3-2" x="-1.08" y="1.68" z="-0.36" rx="-90" width="0.58" height="0.58" font-size="52" alignment="center" color="#e9f7fb" font-color="#061827" emissive="0" visible="false" content=""></m-label>
<m-cube id="tb-ick-slab-3-3" x="-0.36" y="1.56" z="-0.36" width="0.58" height="0.2" depth="0.58" color="#aeefff" opacity="0.9" visible="false"></m-cube>
<m-label id="tb-ick-cell-3-3" x="-0.36" y="1.68" z="-0.36" rx="-90" width="0.58" height="0.58" font-size="52" alignment="center" color="#e9f7fb" font-color="#061827" emissive="0" visible="false" content=""></m-label>
<m-cube id="tb-ick-slab-3-4" x="0.36" y="1.56" z="-0.36" width="0.58" height="0.2" depth="0.58" color="#aeefff" opacity="0.9" visible="false"></m-cube>
<m-label id="tb-ick-cell-3-4" x="0.36" y="1.68" z="-0.36" rx="-90" width="0.58" height="0.58" font-size="52" alignment="center" color="#e9f7fb" font-color="#061827" emissive="0" visible="false" content=""></m-label>
<m-cube id="tb-ick-slab-3-5" x="1.08" y="1.56" z="-0.36" width="0.58" height="0.2" depth="0.58" color="#aeefff" opacity="0.9" visible="false"></m-cube>
<m-label id="tb-ick-cell-3-5" x="1.08" y="1.68" z="-0.36" rx="-90" width="0.58" height="0.58" font-size="52" alignment="center" color="#e9f7fb" font-color="#061827" emissive="0" visible="false" content=""></m-label>
<m-cube id="tb-ick-slab-3-6" x="1.8" y="1.56" z="-0.36" width="0.58" height="0.2" depth="0.58" color="#aeefff" opacity="0.9" visible="false"></m-cube>
<m-label id="tb-ick-cell-3-6" x="1.8" y="1.68" z="-0.36" rx="-90" width="0.58" height="0.58" font-size="52" alignment="center" color="#e9f7fb" font-color="#061827" emissive="0" visible="false" content=""></m-label>
<m-cube id="tb-ick-slab-3-7" x="2.52" y="1.56" z="-0.36" width="0.58" height="0.2" depth="0.58" color="#aeefff" opacity="0.9" visible="false"></m-cube>
<m-label id="tb-ick-cell-3-7" x="2.52" y="1.68" z="-0.36" rx="-90" width="0.58" height="0.58" font-size="52" alignment="center" color="#e9f7fb" font-color="#061827" emissive="0" visible="false" content=""></m-label>
<m-cube id="tb-ick-slab-4-0" x="-2.52" y="1.56" z="0.36" width="0.58" height="0.2" depth="0.58" color="#aeefff" opacity="0.9" visible="false"></m-cube>
<m-label id="tb-ick-cell-4-0" x="-2.52" y="1.68" z="0.36" rx="-90" width="0.58" height="0.58" font-size="52" alignment="center" color="#e9f7fb" font-color="#061827" emissive="0" visible="false" content=""></m-label>
<m-cube id="tb-ick-slab-4-1" x="-1.8" y="1.56" z="0.36" width="0.58" height="0.2" depth="0.58" color="#aeefff" opacity="0.9" visible="false"></m-cube>
<m-label id="tb-ick-cell-4-1" x="-1.8" y="1.68" z="0.36" rx="-90" width="0.58" height="0.58" font-size="52" alignment="center" color="#e9f7fb" font-color="#061827" emissive="0" visible="false" content=""></m-label>
<m-cube id="tb-ick-slab-4-2" x="-1.08" y="1.56" z="0.36" width="0.58" height="0.2" depth="0.58" color="#aeefff" opacity="0.9" visible="false"></m-cube>
<m-label id="tb-ick-cell-4-2" x="-1.08" y="1.68" z="0.36" rx="-90" width="0.58" height="0.58" font-size="52" alignment="center" color="#e9f7fb" font-color="#061827" emissive="0" visible="false" content=""></m-label>
<m-cube id="tb-ick-slab-4-3" x="-0.36" y="1.56" z="0.36" width="0.58" height="0.2" depth="0.58" color="#aeefff" opacity="0.9" visible="false"></m-cube>
<m-label id="tb-ick-cell-4-3" x="-0.36" y="1.68" z="0.36" rx="-90" width="0.58" height="0.58" font-size="52" alignment="center" color="#e9f7fb" font-color="#061827" emissive="0" visible="false" content=""></m-label>
<m-cube id="tb-ick-slab-4-4" x="0.36" y="1.56" z="0.36" width="0.58" height="0.2" depth="0.58" color="#aeefff" opacity="0.9" visible="false"></m-cube>
<m-label id="tb-ick-cell-4-4" x="0.36" y="1.68" z="0.36" rx="-90" width="0.58" height="0.58" font-size="52" alignment="center" color="#e9f7fb" font-color="#061827" emissive="0" visible="false" content=""></m-label>
<m-cube id="tb-ick-slab-4-5" x="1.08" y="1.56" z="0.36" width="0.58" height="0.2" depth="0.58" color="#aeefff" opacity="0.9" visible="false"></m-cube>
<m-label id="tb-ick-cell-4-5" x="1.08" y="1.68" z="0.36" rx="-90" width="0.58" height="0.58" font-size="52" alignment="center" color="#e9f7fb" font-color="#061827" emissive="0" visible="false" content=""></m-label>
<m-cube id="tb-ick-slab-4-6" x="1.8" y="1.56" z="0.36" width="0.58" height="0.2" depth="0.58" color="#aeefff" opacity="0.9" visible="false"></m-cube>
<m-label id="tb-ick-cell-4-6" x="1.8" y="1.68" z="0.36" rx="-90" width="0.58" height="0.58" font-size="52" alignment="center" color="#e9f7fb" font-color="#061827" emissive="0" visible="false" content=""></m-label>
<m-cube id="tb-ick-slab-4-7" x="2.52" y="1.56" z="0.36" width="0.58" height="0.2" depth="0.58" color="#aeefff" opacity="0.9" visible="false"></m-cube>
<m-label id="tb-ick-cell-4-7" x="2.52" y="1.68" z="0.36" rx="-90" width="0.58" height="0.58" font-size="52" alignment="center" color="#e9f7fb" font-color="#061827" emissive="0" visible="false" content=""></m-label>
<m-cube id="tb-ick-slab-5-0" x="-2.52" y="1.56" z="1.08" width="0.58" height="0.2" depth="0.58" color="#aeefff" opacity="0.9" visible="false"></m-cube>
<m-label id="tb-ick-cell-5-0" x="-2.52" y="1.68" z="1.08" rx="-90" width="0.58" height="0.58" font-size="52" alignment="center" color="#e9f7fb" font-color="#061827" emissive="0" visible="false" content=""></m-label>
<m-cube id="tb-ick-slab-5-1" x="-1.8" y="1.56" z="1.08" width="0.58" height="0.2" depth="0.58" color="#aeefff" opacity="0.9" visible="false"></m-cube>
<m-label id="tb-ick-cell-5-1" x="-1.8" y="1.68" z="1.08" rx="-90" width="0.58" height="0.58" font-size="52" alignment="center" color="#e9f7fb" font-color="#061827" emissive="0" visible="false" content=""></m-label>
<m-cube id="tb-ick-slab-5-2" x="-1.08" y="1.56" z="1.08" width="0.58" height="0.2" depth="0.58" color="#aeefff" opacity="0.9" visible="false"></m-cube>
<m-label id="tb-ick-cell-5-2" x="-1.08" y="1.68" z="1.08" rx="-90" width="0.58" height="0.58" font-size="52" alignment="center" color="#e9f7fb" font-color="#061827" emissive="0" visible="false" content=""></m-label>
<m-cube id="tb-ick-slab-5-3" x="-0.36" y="1.56" z="1.08" width="0.58" height="0.2" depth="0.58" color="#aeefff" opacity="0.9" visible="false"></m-cube>
<m-label id="tb-ick-cell-5-3" x="-0.36" y="1.68" z="1.08" rx="-90" width="0.58" height="0.58" font-size="52" alignment="center" color="#e9f7fb" font-color="#061827" emissive="0" visible="false" content=""></m-label>
<m-cube id="tb-ick-slab-5-4" x="0.36" y="1.56" z="1.08" width="0.58" height="0.2" depth="0.58" color="#aeefff" opacity="0.9" visible="false"></m-cube>
<m-label id="tb-ick-cell-5-4" x="0.36" y="1.68" z="1.08" rx="-90" width="0.58" height="0.58" font-size="52" alignment="center" color="#e9f7fb" font-color="#061827" emissive="0" visible="false" content=""></m-label>
<m-cube id="tb-ick-slab-5-5" x="1.08" y="1.56" z="1.08" width="0.58" height="0.2" depth="0.58" color="#aeefff" opacity="0.9" visible="false"></m-cube>
<m-label id="tb-ick-cell-5-5" x="1.08" y="1.68" z="1.08" rx="-90" width="0.58" height="0.58" font-size="52" alignment="center" color="#e9f7fb" font-color="#061827" emissive="0" visible="false" content=""></m-label>
<m-cube id="tb-ick-slab-5-6" x="1.8" y="1.56" z="1.08" width="0.58" height="0.2" depth="0.58" color="#aeefff" opacity="0.9" visible="false"></m-cube>
<m-label id="tb-ick-cell-5-6" x="1.8" y="1.68" z="1.08" rx="-90" width="0.58" height="0.58" font-size="52" alignment="center" color="#e9f7fb" font-color="#061827" emissive="0" visible="false" content=""></m-label>
<m-cube id="tb-ick-slab-5-7" x="2.52" y="1.56" z="1.08" width="0.58" height="0.2" depth="0.58" color="#aeefff" opacity="0.9" visible="false"></m-cube>
<m-label id="tb-ick-cell-5-7" x="2.52" y="1.68" z="1.08" rx="-90" width="0.58" height="0.58" font-size="52" alignment="center" color="#e9f7fb" font-color="#061827" emissive="0" visible="false" content=""></m-label>
<m-cube id="tb-ick-slab-6-0" x="-2.52" y="1.56" z="1.8" width="0.58" height="0.2" depth="0.58" color="#aeefff" opacity="0.9" visible="false"></m-cube>
<m-label id="tb-ick-cell-6-0" x="-2.52" y="1.68" z="1.8" rx="-90" width="0.58" height="0.58" font-size="52" alignment="center" color="#e9f7fb" font-color="#061827" emissive="0" visible="false" content=""></m-label>
<m-cube id="tb-ick-slab-6-1" x="-1.8" y="1.56" z="1.8" width="0.58" height="0.2" depth="0.58" color="#aeefff" opacity="0.9" visible="false"></m-cube>
<m-label id="tb-ick-cell-6-1" x="-1.8" y="1.68" z="1.8" rx="-90" width="0.58" height="0.58" font-size="52" alignment="center" color="#e9f7fb" font-color="#061827" emissive="0" visible="false" content=""></m-label>
<m-cube id="tb-ick-slab-6-2" x="-1.08" y="1.56" z="1.8" width="0.58" height="0.2" depth="0.58" color="#aeefff" opacity="0.9" visible="false"></m-cube>
<m-label id="tb-ick-cell-6-2" x="-1.08" y="1.68" z="1.8" rx="-90" width="0.58" height="0.58" font-size="52" alignment="center" color="#e9f7fb" font-color="#061827" emissive="0" visible="false" content=""></m-label>
<m-cube id="tb-ick-slab-6-3" x="-0.36" y="1.56" z="1.8" width="0.58" height="0.2" depth="0.58" color="#aeefff" opacity="0.9" visible="false"></m-cube>
<m-label id="tb-ick-cell-6-3" x="-0.36" y="1.68" z="1.8" rx="-90" width="0.58" height="0.58" font-size="52" alignment="center" color="#e9f7fb" font-color="#061827" emissive="0" visible="false" content=""></m-label>
<m-cube id="tb-ick-slab-6-4" x="0.36" y="1.56" z="1.8" width="0.58" height="0.2" depth="0.58" color="#aeefff" opacity="0.9" visible="false"></m-cube>
<m-label id="tb-ick-cell-6-4" x="0.36" y="1.68" z="1.8" rx="-90" width="0.58" height="0.58" font-size="52" alignment="center" color="#e9f7fb" font-color="#061827" emissive="0" visible="false" content=""></m-label>
<m-cube id="tb-ick-slab-6-5" x="1.08" y="1.56" z="1.8" width="0.58" height="0.2" depth="0.58" color="#aeefff" opacity="0.9" visible="false"></m-cube>
<m-label id="tb-ick-cell-6-5" x="1.08" y="1.68" z="1.8" rx="-90" width="0.58" height="0.58" font-size="52" alignment="center" color="#e9f7fb" font-color="#061827" emissive="0" visible="false" content=""></m-label>
<m-cube id="tb-ick-slab-6-6" x="1.8" y="1.56" z="1.8" width="0.58" height="0.2" depth="0.58" color="#aeefff" opacity="0.9" visible="false"></m-cube>
<m-label id="tb-ick-cell-6-6" x="1.8" y="1.68" z="1.8" rx="-90" width="0.58" height="0.58" font-size="52" alignment="center" color="#e9f7fb" font-color="#061827" emissive="0" visible="false" content=""></m-label>
<m-cube id="tb-ick-slab-6-7" x="2.52" y="1.56" z="1.8" width="0.58" height="0.2" depth="0.58" color="#aeefff" opacity="0.9" visible="false"></m-cube>
<m-label id="tb-ick-cell-6-7" x="2.52" y="1.68" z="1.8" rx="-90" width="0.58" height="0.58" font-size="52" alignment="center" color="#e9f7fb" font-color="#061827" emissive="0" visible="false" content=""></m-label>
<m-cube id="tb-ick-slab-7-0" x="-2.52" y="1.56" z="2.52" width="0.58" height="0.2" depth="0.58" color="#aeefff" opacity="0.9" visible="false"></m-cube>
<m-label id="tb-ick-cell-7-0" x="-2.52" y="1.68" z="2.52" rx="-90" width="0.58" height="0.58" font-size="52" alignment="center" color="#e9f7fb" font-color="#061827" emissive="0" visible="false" content=""></m-label>
<m-cube id="tb-ick-slab-7-1" x="-1.8" y="1.56" z="2.52" width="0.58" height="0.2" depth="0.58" color="#aeefff" opacity="0.9" visible="false"></m-cube>
<m-label id="tb-ick-cell-7-1" x="-1.8" y="1.68" z="2.52" rx="-90" width="0.58" height="0.58" font-size="52" alignment="center" color="#e9f7fb" font-color="#061827" emissive="0" visible="false" content=""></m-label>
<m-cube id="tb-ick-slab-7-2" x="-1.08" y="1.56" z="2.52" width="0.58" height="0.2" depth="0.58" color="#aeefff" opacity="0.9" visible="false"></m-cube>
<m-label id="tb-ick-cell-7-2" x="-1.08" y="1.68" z="2.52" rx="-90" width="0.58" height="0.58" font-size="52" alignment="center" color="#e9f7fb" font-color="#061827" emissive="0" visible="false" content=""></m-label>
<m-cube id="tb-ick-slab-7-3" x="-0.36" y="1.56" z="2.52" width="0.58" height="0.2" depth="0.58" color="#aeefff" opacity="0.9" visible="false"></m-cube>
<m-label id="tb-ick-cell-7-3" x="-0.36" y="1.68" z="2.52" rx="-90" width="0.58" height="0.58" font-size="52" alignment="center" color="#e9f7fb" font-color="#061827" emissive="0" visible="false" content=""></m-label>
<m-cube id="tb-ick-slab-7-4" x="0.36" y="1.56" z="2.52" width="0.58" height="0.2" depth="0.58" color="#aeefff" opacity="0.9" visible="false"></m-cube>
<m-label id="tb-ick-cell-7-4" x="0.36" y="1.68" z="2.52" rx="-90" width="0.58" height="0.58" font-size="52" alignment="center" color="#e9f7fb" font-color="#061827" emissive="0" visible="false" content=""></m-label>
<m-cube id="tb-ick-slab-7-5" x="1.08" y="1.56" z="2.52" width="0.58" height="0.2" depth="0.58" color="#aeefff" opacity="0.9" visible="false"></m-cube>
<m-label id="tb-ick-cell-7-5" x="1.08" y="1.68" z="2.52" rx="-90" width="0.58" height="0.58" font-size="52" alignment="center" color="#e9f7fb" font-color="#061827" emissive="0" visible="false" content=""></m-label>
<m-cube id="tb-ick-slab-7-6" x="1.8" y="1.56" z="2.52" width="0.58" height="0.2" depth="0.58" color="#aeefff" opacity="0.9" visible="false"></m-cube>
<m-label id="tb-ick-cell-7-6" x="1.8" y="1.68" z="2.52" rx="-90" width="0.58" height="0.58" font-size="52" alignment="center" color="#e9f7fb" font-color="#061827" emissive="0" visible="false" content=""></m-label>
<m-cube id="tb-ick-slab-7-7" x="2.52" y="1.56" z="2.52" width="0.58" height="0.2" depth="0.58" color="#aeefff" opacity="0.9" visible="false"></m-cube>
<m-label id="tb-ick-cell-7-7" x="2.52" y="1.68" z="2.52" rx="-90" width="0.58" height="0.58" font-size="52" alignment="center" color="#e9f7fb" font-color="#061827" emissive="0" visible="false" content=""></m-label>
  <m-label id="tb-ick-notice" x="0" y="2.05" z="4.65" rx="-24" width="7.2" height="0.48" font-size="20" alignment="center" color="#0b2334" font-color="#f5fbff" emissive="0" visible="false" content=""></m-label>
</m-prompt>

<script>

(function () {
  const SIZE = 8;
  const RED = "R";
  const BLUE = "B";
  const board = Array.from({ length: SIZE }, function () {
return Array(SIZE).fill("");
  });
  const prompt = document.getElementById("tb-ick-prompt");
  const notice = document.getElementById("tb-ick-notice");
  let noticeTimer = null;
  let currentPlayer = RED;
  let finished = false;
  let mustContinueFrom = null;
  let lastPromptKey = "";
  let lastPromptAt = 0;

  function debug(message) {
try {
  if (typeof console !== "undefined" && console && typeof console.log === "function") {
    console.log(String(message));
  }
} catch (error) {
  // Debug output must never break gameplay.
}
  }

  function setText(el, text) {
if (el) el.setAttribute("content", String(text));
  }

  function clearNoticeTimer() {
if (!noticeTimer) return;
const clearTimer =
  typeof clearTimeout === "function"
    ? clearTimeout
    : typeof window !== "undefined" && typeof window.clearTimeout === "function"
      ? window.clearTimeout.bind(window)
      : null;
if (clearTimer) clearTimer(noticeTimer);
noticeTimer = null;
  }

  function showNotice(message, kind) {
if (!notice) return;
clearNoticeTimer();
setText(notice, message);
notice.setAttribute("visible", "true");
notice.setAttribute("emissive", "0");
if (kind === "error") {
  notice.setAttribute("color", "#220711");
  notice.setAttribute("font-color", "#ffb7ce");
} else if (kind === "success") {
  notice.setAttribute("color", "#062317");
  notice.setAttribute("font-color", "#b8ffe5");
} else {
  notice.setAttribute("color", "#0b2334");
  notice.setAttribute("font-color", "#f5fbff");
}
const setTimer =
  typeof setTimeout === "function"
    ? setTimeout
    : typeof window !== "undefined" && typeof window.setTimeout === "function"
      ? window.setTimeout.bind(window)
      : null;
if (setTimer) {
  noticeTimer = setTimer(function () {
    notice.setAttribute("visible", "false");
  }, 3600);
}
  }

  function clean(value) {
return String(value || "").toUpperCase().replace(/[^A-Z0-9 ]/g, " ").replace(/\s+/g, " ").trim();
  }

  function firstString() {
for (let i = 0; i < arguments.length; i += 1) {
  const value = arguments[i];
  if (typeof value === "string" && value.trim()) return value;
  if (typeof value === "number") return String(value);
}
return "";
  }

  function readPromptValue(event) {
const detail = event && event.detail ? event.detail : {};
const value = firstString(
  detail.value,
  detail.text,
  detail.prompt,
  detail.input,
  detail.message,
  detail.result,
  event && event.value,
  event && event.text,
  typeof event === "string" ? event : ""
);
if (value) return value;
if (prompt && typeof prompt.getAttribute === "function") {
  return firstString(prompt.getAttribute("value"), prompt.getAttribute("text"));
}
return "";
  }

  function isDuplicatePrompt(rawValue) {
const key = clean(rawValue);
const now = typeof Date !== "undefined" && Date && typeof Date.now === "function" ? Date.now() : 0;
if (key && key === lastPromptKey && now && lastPromptAt && now - lastPromptAt < 750) {
  return true;
}
lastPromptKey = key;
lastPromptAt = now;
return false;
  }

  function parseCell(token) {
let match = /^([A-H])([1-8])$/.exec(token);
if (match) {
  return {
    row: Number(match[2]) - 1,
    col: match[1].charCodeAt(0) - 65,
    label: match[1] + match[2]
  };
}
match = /^([1-8])([A-H])$/.exec(token);
if (match) {
  return {
    row: Number(match[1]) - 1,
    col: match[2].charCodeAt(0) - 65,
    label: match[2] + match[1]
  };
}
return null;
  }

  function parseMove(rawValue) {
const value = clean(rawValue);
if (!value) return { error: "Type a move like B3 C4." };
if (value === "RESET" || value === "CLEAR" || value === "NEW") return { reset: true };
const cells = [];
for (const token of value.split(" ")) {
  if (token === "MOVE" || token === "PLAY" || token === "FROM" || token === "TO" || token === "JUMP") continue;
  const cell = parseCell(token);
  if (cell) cells.push(cell);
}
if (cells.length < 2) return { error: "Use FROM TO, like B3 C4." };
return { from: cells[0], to: cells[1] };
  }

  function inBounds(row, col) {
return row >= 0 && row < SIZE && col >= 0 && col < SIZE;
  }

  function owner(piece) {
return piece ? piece[0] : "";
  }

  function isKing(piece) {
return piece && piece.length > 1;
  }

  function opponent(player) {
return player === RED ? BLUE : RED;
  }

  function directionsFor(piece, capture) {
if (isKing(piece)) {
  return [[1, 1], [1, -1], [-1, 1], [-1, -1]];
}
const step = owner(piece) === RED ? 1 : -1;
return [[step, 1], [step, -1]];
  }

  function cellElement(row, col) {
return document.getElementById("tb-ick-cell-" + row + "-" + col);
  }

  function slabElement(row, col) {
return document.getElementById("tb-ick-slab-" + row + "-" + col);
  }

  function cellName(row, col) {
return String.fromCharCode(65 + col) + (row + 1);
  }

  function renderPiece(row, col) {
const el = cellElement(row, col);
if (!el) return;
const piece = board[row][col];
if (!piece) {
  el.setAttribute("content", "");
  el.setAttribute("visible", "false");
  el.setAttribute("emissive", "0");
  const slab = slabElement(row, col);
  if (slab) {
    slab.setAttribute("visible", "false");
    slab.setAttribute("color", "#aeefff");
    slab.setAttribute("opacity", "0.9");
  }
  return;
}
const player = owner(piece);
el.setAttribute("content", piece);
el.setAttribute("visible", "true");
el.setAttribute("color", player === RED ? "#ffd7d7" : "#dff1ff");
el.setAttribute("font-color", player === RED ? "#5a0710" : "#062a53");
el.setAttribute("emissive", "0");
const slab = slabElement(row, col);
if (slab) {
  slab.setAttribute("visible", "true");
  slab.setAttribute("color", player === RED ? "#ffcaca" : "#aeefff");
  slab.setAttribute("opacity", "0.92");
}
  }

  function renderAll() {
for (let row = 0; row < SIZE; row += 1) {
  for (let col = 0; col < SIZE; col += 1) {
    renderPiece(row, col);
  }
}
  }

  function setupBoard() {
for (let row = 0; row < SIZE; row += 1) {
  for (let col = 0; col < SIZE; col += 1) {
    board[row][col] = "";
    if ((row + col) % 2 === 1 && row <= 2) board[row][col] = RED;
    if ((row + col) % 2 === 1 && row >= 5) board[row][col] = BLUE;
  }
}
currentPlayer = RED;
finished = false;
mustContinueFrom = null;
renderAll();
  }

  function legalCapturesFrom(row, col) {
const piece = board[row][col];
if (!piece || owner(piece) !== currentPlayer) return [];
const captures = [];
for (const dir of directionsFor(piece, true)) {
  const midRow = row + dir[0];
  const midCol = col + dir[1];
  const landRow = row + dir[0] * 2;
  const landCol = col + dir[1] * 2;
  if (!inBounds(landRow, landCol) || !inBounds(midRow, midCol)) continue;
  const middle = board[midRow][midCol];
  if (middle && owner(middle) === opponent(currentPlayer) && !board[landRow][landCol]) {
    captures.push({ fromRow: row, fromCol: col, toRow: landRow, toCol: landCol, midRow, midCol });
  }
}
return captures;
  }

  function allCaptures() {
const captures = [];
for (let row = 0; row < SIZE; row += 1) {
  for (let col = 0; col < SIZE; col += 1) {
    captures.push.apply(captures, legalCapturesFrom(row, col));
  }
}
return captures;
  }

  function allMovesFor(player) {
const savedPlayer = currentPlayer;
currentPlayer = player;
const captures = allCaptures();
const moves = captures.slice();
if (captures.length === 0) {
  for (let row = 0; row < SIZE; row += 1) {
    for (let col = 0; col < SIZE; col += 1) {
      const piece = board[row][col];
      if (!piece || owner(piece) !== player) continue;
      for (const dir of directionsFor(piece, false)) {
        const toRow = row + dir[0];
        const toCol = col + dir[1];
        if (inBounds(toRow, toCol) && !board[toRow][toCol]) {
          moves.push({ fromRow: row, fromCol: col, toRow, toCol });
        }
      }
    }
  }
}
currentPlayer = savedPlayer;
return moves;
  }

  function findCapture(fromRow, fromCol, toRow, toCol) {
return legalCapturesFrom(fromRow, fromCol).find(function (move) {
  return move.toRow === toRow && move.toCol === toCol;
});
  }

  function promote(piece, row) {
if (piece === RED && row === SIZE - 1) return "RK";
if (piece === BLUE && row === 0) return "BK";
return piece;
  }

  function countPieces(player) {
let count = 0;
for (let row = 0; row < SIZE; row += 1) {
  for (let col = 0; col < SIZE; col += 1) {
    if (owner(board[row][col]) === player) count += 1;
  }
}
return count;
  }

  function checkGameEnd() {
const other = opponent(currentPlayer);
if (countPieces(other) === 0) {
  finished = true;
  showNotice(currentPlayer + " wins. Type RESET.", "success");
  debug("ice-checkers win: " + currentPlayer + " pieces");
  return true;
}
if (allMovesFor(other).length === 0) {
  finished = true;
  showNotice(currentPlayer + " wins. " + other + " has no moves. RESET.", "success");
  debug("ice-checkers win: " + currentPlayer + " no-moves");
  return true;
}
return false;
  }

  function resetBoard() {
setupBoard();
showNotice("Reset. R starts. Try B3 C4.", "info");
debug("ice-checkers reset");
  }

  function handlePrompt(event) {
try {
  const rawValue = readPromptValue(event);
  if (isDuplicatePrompt(rawValue)) return;
  const parsed = parseMove(rawValue);
  debug("ice-checkers prompt: " + String(rawValue || ""));

  if (parsed.reset) {
    resetBoard();
    return;
  }
  if (parsed.error) {
    showNotice(parsed.error, "error");
    debug("ice-checkers error: " + parsed.error);
    return;
  }
  if (finished) {
    showNotice("Game finished. Type RESET.", "info");
    return;
  }

  const fromRow = parsed.from.row;
  const fromCol = parsed.from.col;
  const toRow = parsed.to.row;
  const toCol = parsed.to.col;
  const piece = board[fromRow][fromCol];
  if (!piece) {
    showNotice(parsed.from.label + " is empty.", "error");
    debug("ice-checkers error: empty " + parsed.from.label);
    return;
  }
  if (owner(piece) !== currentPlayer) {
    showNotice(currentPlayer + " turn. Use your own piece.", "error");
    debug("ice-checkers error: wrong-turn");
    return;
  }
  if (mustContinueFrom && (fromRow !== mustContinueFrom.row || fromCol !== mustContinueFrom.col)) {
    showNotice("Continue jump from " + cellName(mustContinueFrom.row, mustContinueFrom.col) + ".", "error");
    debug("ice-checkers error: must-continue");
    return;
  }
  if (!inBounds(toRow, toCol) || board[toRow][toCol]) {
    showNotice(parsed.to.label + " is not open.", "error");
    debug("ice-checkers error: blocked " + parsed.to.label);
    return;
  }

  const captures = allCaptures();
  const forced = captures.length > 0;
  const capture = findCapture(fromRow, fromCol, toRow, toCol);
  const dr = toRow - fromRow;
  const dc = toCol - fromCol;
  const absDr = Math.abs(dr);
  const absDc = Math.abs(dc);

  if (forced && !capture) {
    showNotice("Capture required this turn.", "error");
    debug("ice-checkers error: capture-required");
    return;
  }
  if (!capture) {
    if (absDr !== 1 || absDc !== 1) {
      showNotice("Move one diagonal square, or jump to capture.", "error");
      debug("ice-checkers error: bad-distance");
      return;
    }
    const legalDir = directionsFor(piece, false).some(function (dir) {
      return dir[0] === dr && dir[1] === dc;
    });
    if (!legalDir) {
      showNotice(piece + " cannot move that direction.", "error");
      debug("ice-checkers error: bad-direction");
      return;
    }
  }

  board[fromRow][fromCol] = "";
  let movedPiece = promote(piece, toRow);
  board[toRow][toCol] = movedPiece;
  renderPiece(fromRow, fromCol);
  if (capture) {
    board[capture.midRow][capture.midCol] = "";
    renderPiece(capture.midRow, capture.midCol);
  }
  renderPiece(toRow, toCol);

  const fromLabel = parsed.from.label;
  const toLabel = parsed.to.label;
  if (capture) {
    const moreCaptures = legalCapturesFrom(toRow, toCol);
    if (moreCaptures.length > 0) {
      mustContinueFrom = { row: toRow, col: toCol };
      showNotice(currentPlayer + " jumps " + fromLabel + "-" + toLabel + ". Jump again.", "success");
      debug("ice-checkers jump-again: " + fromLabel + " " + toLabel);
      return;
    }
  }

  mustContinueFrom = null;
  if (checkGameEnd()) return;
  currentPlayer = opponent(currentPlayer);
  showNotice((capture ? "Jump " : "Move ") + fromLabel + "-" + toLabel + ". " + currentPlayer + " turn.", capture ? "success" : "info");
  debug("ice-checkers move: " + fromLabel + " " + toLabel + " " + board[toRow][toCol]);
} catch (error) {
  const message = error && error.message ? error.message : "Prompt handler failed.";
  showNotice("Command error: " + message, "error");
  debug("ice-checkers exception: " + message);
}
  }

  if (prompt) {
prompt.addEventListener("prompt", handlePrompt);
prompt.addEventListener("submit", handlePrompt);
  }
  setupBoard();
  showNotice("R starts. Move like B3 C4.", "info");
})();

</script>
