{
 "note": "Layout contract for in-game windows (engine + wiki). Sizes are CSS/UI pixels at the 1920×1080 reference with UI scale 100%. Cells are square. The wiki's Inventory mockup reads this file.",
 "reference": {
  "width": 1920,
  "height": 1080
 },
 "scaleRule": "cell = round(48 × uiScale × screenHeight / 1080); phones (touch) clamp cell ≥ 44 and open the window full screen with the bag beside the equipment.",
 "cell": 48,
 "inventory": {
  "anchor": "right",
  "openKey": "I",
  "marginTop": 24,
  "marginRight": 0,
  "padding": 22,
  "header": 112,
  "tabs": [
   "Inventory",
   "Cosmetics"
  ],
  "width": 620,
  "height": 912,
  "equipmentGrid": {
   "cols": 12,
   "rows": 7
  },
  "equipment": [
   {
    "slot": "helmet",
    "x": 5,
    "y": 0,
    "w": 2,
    "h": 2
   },
   {
    "slot": "earring",
    "x": 4,
    "y": 1,
    "w": 1,
    "h": 1
   },
   {
    "slot": "necklace",
    "x": 7,
    "y": 1,
    "w": 1,
    "h": 1
   },
   {
    "slot": "main_hand",
    "x": 0,
    "y": 2,
    "w": 2,
    "h": 3,
    "offsetPx": {"left": 74, "top": 70}
   },
   {
    "slot": "off_hand",
    "x": 10,
    "y": 2,
    "w": 2,
    "h": 3,
    "offsetPx": {"right": 74, "top": 70}
   },
   {
    "slot": "armour",
    "x": 5,
    "y": 2,
    "w": 2,
    "h": 3
   },
   {
    "slot": "ring_1",
    "x": 4,
    "y": 3,
    "w": 1,
    "h": 1
   },
   {
    "slot": "ring_2",
    "x": 7,
    "y": 3,
    "w": 1,
    "h": 1
   },
   {
    "slot": "belt",
    "x": 5,
    "y": 5,
    "w": 2,
    "h": 1
   },
   {
    "slot": "gloves",
    "x": 2,
    "y": 5,
    "w": 2,
    "h": 2
   },
   {
    "slot": "boots",
    "x": 8,
    "y": 5,
    "w": 2,
    "h": 2
   }
  ],
  "quickSlots": {
   "count": 8,
   "keys": [
    "1",
    "2",
    "3",
    "4",
    "5",
    "6",
    "7",
    "8"
   ]
  },
  "bag": {
   "cols": 12,
   "rows": 5
  },
  "dropRules": [
   "An item fits a slot only if its type matches (any weapon → main hand; shields → off hand; rings → either ring slot).",
   "Its stat requirements must be met by the character (shown red in the popup when not).",
   "A two-handed weapon in the main hand blocks the off hand; equipping one sends the off-hand item to the bag.",
   "Dropping on a bag area that overlaps exactly one item swaps them; more than one overlap is refused.",
   "Invalid targets turn the slot background red (slot_invalid), valid ones jade (slot_valid).",
   "Quick slots 1–8 accept potions and scrolls only (drag in from the bag, drag between slots to swap, drag out to the bag); anything else turns the slot red and is refused.",
   "Sockets: hovering an equipped weapon or belt shows its sockets over the art. Clicking a socketed gem picks it up and holds it on the cursor (it leaves the socket only when placed; Esc puts it back); dragging a gem onto the item or a socket inserts it (weapon: socket 1 primary, 2–3 weapon supports; belt: socket 1 movement, 2–3 belt supports); a gem already there swaps to the bag.",
   "Item art is scaled by its painted content, not its square canvas: long weapons stand upright and reach the top and bottom of their 2×3 slot; belts fill 2×1 (apps/wiki/lib/icon-fit.json from tools/build-icon-fit.py).",
   "Every equipped weapon or belt holds exactly one main gem (socket 1) and up to two supports; a second main gem is refused until the first is taken out. A gem can be dragged out of a socket and into another; a plain click picks it up and holds it."
  ],
  "headerPlate": {
   "art": "ui/window-plate (ART-UIK-window-plate)",
   "width": 440,
   "height": 92,
   "note": "Fixed plate inside the framed panel, centred; title auto-fits 16→10 px; close button in the rail's right ring. 112 = top frame 14 + plate 92 + gap 6."
  },
  "tabsRule": "Inventory tab on the left; Cosmetics tab right-aligned and disabled (greyed, forbidden cursor) until costumes ship.",
  "equipmentArea": {
   "backdrop": "ui/inventory-backdrop (ART-UIK-inventory-backdrop, 1152×672 = 12×7 cells at 2x)",
   "slotBox": "code-drawn recessed box: dark translucent fill, 1 px black + 2 px muted bronze inner line, inner shadow; blue-tinted when filled; jade/red outline on drag (valid/invalid)",
   "weaponSlots": "Main hand and off hand are 2×3 cells (round 8, owner: exactly the 2×3 a weapon takes in the bag). offsetPx places them (left/right 74 px, top 70 px inside the equipment panel at 48 px cells, scaled with the cell); x/y stay the grid cell for the overlap rules. Upright weapon art fills the slot and the three sockets never overlap. The equipment panel has an 8 px gutter around the 12×7 grid and its backdrop runs down through the quick-slot (potion) row, ending just above the bag."
  },
  "grid": {
   "tile": "ui/grid-tile (one repeatable 48 px cell, faint rosette, bronze right/bottom line)",
   "usable": "ui/grid-tile-usable (blue) behind items whose requirements are met",
   "unusable": "ui/grid-tile-unusable (red) behind items whose requirements are not met",
   "rule": "Tile colour shows usability, never rarity (rarity is the name colour in the popup).",
   "container": "1 px black + 2 px dark bronze + 1 px black outline, inner shadow"
  },
  "currencyBoxes": "Below the bag: a gold box (stack-of-coins art) and a Zoe box (sun coin), then the character line 'Name · STR · AGI · INT' with the stats icon. No help text; action feedback is a short toast over the grid.",
  "chromeNote": "Round 8: padding 22 = outer rim 6 + inner panel 8 + equipment gutter 8 per side (outer container padding 0, inner panel 12 / 8 / 8), so the 12×48 grid is never cut; width 620. The Character window uses the same width and padding."
 },
 "footprints": {
  "weapon": [
   2,
   3
  ],
  "shield": [
   2,
   3
  ],
  "armour": [
   2,
   3
  ],
  "helmet": [
   2,
   2
  ],
  "gloves": [
   2,
   2
  ],
  "boots": [
   2,
   2
  ],
  "belt": [
   2,
   1
  ],
  "necklace": [
   1,
   1
  ],
  "earring": [
   1,
   1
  ],
  "ring": [
   1,
   1
  ],
  "orb": [
   1,
   1
  ],
  "shard": [
   1,
   1
  ],
  "consumable": [
   1,
   1
  ],
  "material": [
   1,
   1
  ],
  "gem": [
   1,
   1
  ]
 },
 "stash": {
  "tabs": 4,
  "cols": 12,
  "rows": 10,
  "anchor": "left",
  "width": 620,
  "grid": "same tiles as the bag; packed row by row"
 }
}
