<!-- RUBY-BACKUP · part 175 -->
": "Special"}, {"code": "spec8", "title": "Temple", "desc": "Sacred space, columns and altar", "cat": "Special"}, {"code": "spec9", "title": "Library", "desc": "Shelves of stone books", "cat": "Special"}, {"code": "spec10", "title": "Observatory", "desc": "Dome open to the stars", "cat": "Special"}, {"code": "spec11", "title": "Playground", "desc": "Swings and slides in stone", "cat": "Special"}, {"code": "spec12", "title": "Statue", "desc": "Figure carved from one block", "cat": "Special"}, {"code": "spec13", "title": "Throne", "desc": "Seat worthy of a King", "cat": "Special"}, {"code": "spec14", "title": "Table", "desc": "Flat surface, four legs", "cat": "Special"}, {"code": "spec15", "title": "Chair", "desc": "Somewhere to sit and think", "cat": "Special"}, {"code": "spec16", "title": "Bed", "desc": "Rest here, dream in stone", "cat": "Special"}, {"code": "spec17", "title": "Door", "desc": "Opens and closes, welcomes", "cat": "Special"}, {"code": "spec18", "title": "Window", "desc": "Frame for the view", "cat": "Special"}, {"code": "spec19", "title": "Stairs", "desc": "Steps upward, one by one", "cat": "Special"}, {"code": "spec20", "title": "Toy Box", "desc": "For the children's treasures", "cat": "Special"},
{"code": "bam", "title": "BAM Direct Build", "desc": "Build straight to the server — bam box 10", "cat": "Special"},
{"code": "bamtest", "title": "BAM Test", "desc": "Test the backup system", "cat": "Special"},
{"code": "solidfast", "title": "Solid Fast", "desc": "100% speed for inspections", "cat": "Special"},
{"code": "whereami", "title": "Where Am I", "desc": "Report exact coordinates", "cat": "Special"},
{"code": "listall", "title": "List All", "desc": "Count every object in the world", "cat": "Special"},
{"code": "again", "title": "Again", "desc": "Repeat your last bam build", "cat": "Special"},
{"code": "intaglio", "title": "Intaglio", "desc": "Ultra-dense gold linework on buildings", "cat": "Special"},
{"code": "nightcity", "title": "Night City", "desc": "Dark sky, glowing windows", "cat": "Special"},
{"code": "daycity", "title": "Day City", "desc": "Bright sky, normal windows", "cat": "Special"},
{"code": "exportfbx", "title": "Export FBX", "desc": "Export selected block as FBX", "cat": "Special"},
{"code": "tp", "title": "Teleport", "desc": "Teleport to coordinates: tp x z", "cat": "Special"}];
var BC_PAGE = 0, BC_CAT = 'All';
function showBuildCodes(){
  var b = document.getElementById('buildcodes');
  if(!b){
    b = document.createElement('div');
    b.id = 'buildcodes';
    b.style.cssText = 'position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);z-index:10000;background:rgba(20,10,0,0.95);border:2px solid #ffcc00;border-radius:12px;padding:15px;color:#fff;font:12px monospace;max-width:500px;max-height:85vh;overflow:auto;';
    document.body.appendChild(b);
  }
  b.style.display = 'block';
  renderBuildCodes();
}
function renderBuildCodes(){
  var b = document.getElementById('buildcodes');
  if(!b) return;
  /* filter by category */
  var filtered = BC_CAT==='All' ? BUILD_CODES : BUILD_CODES.filter(function(x){ return x.cat===BC_CAT; });
  var perPage = 25;
  var pages = Math.ceil(filtered.length/perPage);
  if(BC_PAGE >= pages) BC_PAGE = 0;
  var start = BC_PAGE*perPage;
  var page = filtered.slice(start, start+perPage);
  var html = '<b style="color:#fc0">BUILDING CODES — '+filtered.length+'</b> ';
  html += '<button onclick="hideBuildCodes()">CLOSE</button><br><br>';
  /* category filter */
  var cats = ['All','Foundations','Walls','Towers','Bridges','Domes & Arches','Materials','Colors & Finishes','Scale & Size','Soliditronium','Special'];
  html += 'SIFT: ';
  cats.forEach(function(cat){
    html += '<button onclick="bcCat(\''+cat+'\')"'+(cat===BC_CAT?' style="background:#fc0;color:#000"':'')+'>'+cat+'</button> ';
  });
  html += '<br><br>';
  /* codes */
  page.forEach(function(item){
    html += '<div style="padding:5px;border-bottom:1px solid #430;margin-bottom:3px">';
    html += '<b style="color:#fc0">'+item.title+'</b> <small>('+item.code+')</small><br>';
    html += '<i style="color:#aaa">'+item.desc+'</i><br>';
    html += '<button onclick="runCodeByName(\''+item.code+'\')">USE</button>';
    html += '</div>';
  });
  /* pagination */
  html += '<br><div style="text-align:center">';
  if(BC_PAGE>0) html += '<button onclick="bcPage(-1)">PREV</button> ';
  html += 'Page '+(BC_PAGE+1)+'/'+pages+' ';
  if(BC_PAGE<pages-1) html += '<button onclick="bcPage(1)">NEXT</button>';
  html += '</div>';
  b.innerHTML = html;
}
function bcCat(cat){ BC_CAT=cat; BC_PAGE=0; renderBuildCodes(); }
function bcPage(d){ BC_PAGE+=d; renderBuildCodes(); }
function hideBuildCodes(){
  var b = document.getElementById('buildcodes');
  if(b) b.style.display='none';
}

/* PLACEMENT TARGET — select where items go */
var PLACE_MODE = false;
var PLACE_TARGET = null; /* {x, z} */
var placeMarker = null;
function togglePlaceMode(){
  PLACE_MODE = !PLACE_MODE;
  if(