<!doctype html>
<html lang="en">
<meta charset="utf-8">
<title>16×16 Pixel Axe</title>
<style>
  body { background: #e5e7eb; display: grid; justify-items: center; gap: 20px; padding: 40px; }
  canvas { width: 256px; height: 256px; image-rendering: pixelated; }
  button { padding: 10px 18px; cursor: pointer; }
</style>

<canvas id="axe" width="16" height="16" aria-label="Diagonal pixel axe"></canvas>
<button id="download">Download 16×16 PNG</button>

<script>
const pixels = [
  "................",
  ".......#####....",
  "......#LLLLS#...",
  ".....#LSSSSSS#..",
  "....#LSSSSDDD#..",
  "....#LSSSD###...",
  ".....#DDD#Ww#...",
  "......###Ww#....",
  ".......#Ww#.....",
  "......#Ww#......",
  ".....#Ww#.......",
  "....#Ww#........",
  "...#Ww#.........",
  "..#Ww#..........",
  "..#w#...........",
  "...#............"
];

const palette = {
  "#": "#202732", // Outline
  L: "#edf7fa",   // Steel highlight
  S: "#a7bdc9",   // Steel
  D: "#607989",   // Steel shadow
  W: "#d99b50",   // Wood highlight
  w: "#85502d"    // Wood shadow
};

const canvas = document.getElementById("axe");
const ctx = canvas.getContext("2d");

pixels.forEach((row, y) => {
  [...row].forEach((pixel, x) => {
    if (!palette[pixel]) return;
    ctx.fillStyle = palette[pixel];
    ctx.fillRect(x, y, 1, 1);
  });
});

document.getElementById("download").onclick = () => {
  const link = document.createElement("a");
  link.download = "axe-16x16.png";
  link.href = canvas.toDataURL("image/png");
  link.click();
};
</script>
</html>
