<!-- SAGA-SOLID · part 91 -->
ever become support.
   */
  WF.supportBelow = function(position, options){
    options = options || {};

    if(!position) return {
      hit:false,
      valid:false,
      reason:'no_position'
    };

    var startOffset =
      options.startOffset === undefined ? 2.0 : options.startOffset;

    var maxDrop =
      options.maxDrop === undefined ? 8.0 : options.maxDrop;

    var maxSlope =
      options.maxSlope === undefined ? 60 : options.maxSlope;

    if(WF.colliders.length === 0){
      return {
        hit:false,
        valid:false,
        reason:'no_surfaces'
      };
    }

    var origin = new THREE.Vector3(
      position.x,
      position.y + startOffset,
      position.z
    );

    var meshes = WF.colliders.map(function(e){
      return e.mesh;
    });

    ray.set(origin, DOWN);
    ray.near = 0;
    ray.far = startOffset + maxDrop;

    var hits = ray.intersectObjects(meshes, false);

    if(!hits.length){
      return {
        hit:false,
        valid:false,
        reason:'no_support_in_range',
        origin:origin,
        maxDrop:maxDrop
      };
    }

    /* v198: choose nearest hit at or below player support height. */
    var hit = null;
    for(var hi=0; hi<hits.length; hi++){
      if(hits[hi].point.y <= position.y + 0.05){ hit = hits[hi]; break; }
    }
    if(!hit) return {hit:false, valid:false, reason:"no_support_below"};
    var entry = WF.colliderByUUID[hit.object.uuid] || null;

    var normal = hit.face
      ? hit.face.normal.clone().transformDirection(hit.object.matrixWorld)
      : new THREE.Vector3(0,1,0);

    normal.normalize();

    var dot = Math.max(-1, Math.min(1, normal.dot(new THREE.Vector3(0,1,0))));
    var slope = Math.acos(dot) * 180 / Math.PI;

    return {
      hit:true,
      valid:slope <= maxSlope,

      point:hit.point.clone(),
      height:hit.point.y,
      normal:normal,
      slope:slope,

      surface:entry,
      kind:entry ? entry.kind : 'unknown',

      playerDelta:position.y - hit.point.y,
      rayDistance:hit.distance
    };
  };

  /*
   * Separate long-range query.
   *
   * This is intentionally NOT supportBelow().
   * Later this can be used for spawning, LAND, teleport validation,
   * recovery, etc.
   */
  WF.findLandingSurface = function(x, z, searchTopY, options){
    options = options || {};

    var maxSlope =
      options.maxSlope === undefined ? 60 : options.maxSlope;

    if(WF.colliders.length === 0){
      return {
        hit:false,
        valid:false,
        reason:'no_surfaces'
      };
    }

    var origin = new THREE.Vector3(x, searchTopY, z);
    var meshes = WF.colliders.map(function(e){ return e.mesh; });

    ray.set(origin, DOWN);
    ray.near = 0;
    ray.far = Math.max(0, searchTopY - WF.killY);

    var hits = ray.intersectObjects(meshes, false);

    if(!hits.length){
      return {
        hit:false,
        valid:false,
        reason:'no_landing_surface'
      };
    }

    var hit = hits[0];
    var entry = WF.colliderByUUID[hit.object.uuid] || null;

    var normal = hit.face
      ? hit.face.normal.clone().transformDirection(hit.object.matrixWorld)
      : new THREE.Vector3(0,1,0);

    normal.normalize();

    var dot = Math.max(-1, Math.min(1, normal.y));
    var slope = Math.acos(dot) * 180 / Math.PI;

    return {
      hit:true,
      valid:slope <= maxSlope,
      point:hit.point.clone(),
      height:hit.point.y,
      normal:normal,
      slope:slope,
      surface:entry,
      kind:entry ? entry.kind : 'unknown'
    };
  };

  /*
   * Register the known 20,000 x 20,000 base plane.
   * Observation only — nothing on the mesh is changed.
   */
  WF.findBasePlane = function(){
    var candidate = null;

    scene.traverse(function(obj){
      if(candidate) return;

      if(
        obj &&
        obj.isMesh &&
        obj.geometry &&
        obj.geometry.type === 'PlaneGeometry'
      ){
        var params = obj.geometry.parameters || {};
        var w = Number(params.width || 0);
        var h = Number(params.height || 0);

        if(w >= 19000 && h >= 19000){
          candidate = obj;
        }
      }
    });

    return candidate;
  };

  WF.registerBasePlane = function(){
    var plane = WF.findBasePlane();
    if(!plane) return null;

    return WF.registerSurface(
      plane,
      'ground',
      {name:'base_plane'}
    );
  };

  /*
   * Mountains already have an existing authoritative runtime list:
   * window._mountains.
   *
   * We observe that list. We DO NOT sweep arbitrary scene geometry
   * and declare it walkable.
   */
  WF.syncMountains = function(){
    var list = window._mountains || [];
    var added = 0;

    for(var i=0; i<list.length; i++){
      var mesh = list[i];

      if(
        mesh &&
        mesh.isMesh &&
        mesh.userData &&
        mesh.userData.isSolidTerrain &&
        !WF.colliderByUUID[mesh.uuid]
      ){
        WF.registerSurface(
          mesh,
          'terrain',
          {name:'mountain'}
        