{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "Pachinball player profile",
  "description": "An exported player profile: settings, key bindings, campaign, bests, achievements, drafts.",
  "type": "object",
  "properties": {
    "$schema": {
      "type": "string"
    },
    "version": {
      "const": 2
    },
    "exportedAt": {
      "type": "string"
    },
    "updatedAt": {
      "type": "integer",
      "minimum": 0
    },
    "settings": {
      "type": "object",
      "properties": {
        "reducedMotion": {
          "type": "boolean"
        },
        "shakeIntensity": {
          "type": "number"
        },
        "photosensitiveMode": {
          "type": "boolean"
        },
        "qualityPreset": {
          "enum": [
            "low",
            "medium",
            "high"
          ],
          "type": "string"
        },
        "enableFog": {
          "type": "boolean"
        },
        "enableShadows": {
          "type": "boolean"
        },
        "scanlineWeight": {
          "type": "number"
        },
        "scanlineEnabled": {
          "type": "boolean"
        },
        "scanlineIntensityMultiplier": {
          "type": "number"
        },
        "enableDebugHUD": {
          "type": "boolean"
        },
        "enablePhysicsTuning": {
          "type": "boolean"
        },
        "masterVolume": {
          "type": "number"
        },
        "musicVolume": {
          "type": "number"
        },
        "sfxVolume": {
          "type": "number"
        },
        "muted": {
          "type": "boolean"
        },
        "audioSource": {
          "enum": [
            "synth",
            "samples"
          ],
          "type": "string"
        },
        "reducedAudio": {
          "type": "boolean"
        },
        "hapticsEnabled": {
          "type": "boolean"
        },
        "scanlineIntensity": {
          "type": "number"
        }
      },
      "required": []
    },
    "keyBindings": {
      "type": "object",
      "propertyNames": {
        "type": "string",
        "pattern": "^[a-zA-Z][a-zA-Z0-9]{0,31}$"
      },
      "additionalProperties": {
        "type": "array",
        "items": {
          "type": "string",
          "pattern": "^[A-Za-z0-9]{1,32}$"
        },
        "maxItems": 4
      }
    },
    "campaign": {
      "type": "object",
      "properties": {
        "version": {
          "type": "number"
        },
        "progression": {
          "type": "object",
          "properties": {
            "completedTracks": {
              "type": "array",
              "items": {}
            },
            "unlockedTracks": {
              "type": "array",
              "items": {}
            },
            "bestScores": {
              "type": "object",
              "propertyNames": {
                "type": "string"
              },
              "additionalProperties": {}
            },
            "currentTrack": {
              "type": "string"
            },
            "totalGoldBallsCollected": {
              "type": "number"
            },
            "totalRewardsEarned": {
              "type": "number"
            }
          },
          "required": []
        },
        "unlockedRewardIds": {
          "type": "array",
          "items": {}
        },
        "equippedRewards": {
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {}
        }
      },
      "required": []
    },
    "adventure": {
      "type": "object",
      "properties": {
        "currentLevel": {
          "type": "string",
          "minLength": 1
        },
        "currentMap": {
          "type": "string",
          "minLength": 1
        },
        "completedLevels": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "unlockedMaps": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "unlockedRewards": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "type": {
                "enum": [
                  "ball-trail",
                  "neon-pattern",
                  "skin"
                ],
                "type": "string"
              },
              "unlockedAt": {
                "type": "string"
              },
              "equipped": {
                "type": "boolean"
              }
            },
            "required": [
              "id",
              "name",
              "type",
              "unlockedAt",
              "equipped"
            ]
          }
        },
        "totalScore": {
          "type": "number"
        },
        "bestScores": {
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {
            "type": "number"
          }
        },
        "lastPlayed": {
          "type": "string"
        }
      },
      "required": []
    },
    "scoringBreakdown": {
      "type": "object",
      "properties": {
        "bumpers": {
          "type": "number"
        },
        "specialObstacles": {
          "type": "number"
        },
        "goldBalls": {
          "type": "number"
        },
        "comboBonus": {
          "type": "number"
        },
        "timeGoalBonus": {
          "type": "number"
        },
        "premiumBonus": {
          "type": "number"
        },
        "other": {
          "type": "number"
        }
      },
      "required": []
    },
    "bests": {
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {
        "type": "integer",
        "minimum": 0
      }
    },
    "achievements": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "maxItems": 512
    },
    "drafts": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Machine"
      },
      "maxItems": 32
    }
  },
  "required": [
    "version",
    "settings"
  ],
  "additionalProperties": false,
  "$defs": {
    "0": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "eq": {
              "type": "array",
              "items": [
                {
                  "anyOf": [
                    {
                      "type": "number",
                      "minimum": -1000000,
                      "maximum": 1000000
                    },
                    {
                      "type": "string",
                      "pattern": "^(?:event|counter|timer|rules)\\.[a-zA-Z][a-zA-Z0-9_-]{0,31}$"
                    }
                  ]
                },
                {
                  "anyOf": [
                    {
                      "type": "number",
                      "minimum": -1000000,
                      "maximum": 1000000
                    },
                    {
                      "type": "string",
                      "pattern": "^(?:event|counter|timer|rules)\\.[a-zA-Z][a-zA-Z0-9_-]{0,31}$"
                    }
                  ]
                }
              ],
              "minItems": 2
            }
          },
          "required": [
            "eq"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "ne": {
              "type": "array",
              "items": [
                {
                  "anyOf": [
                    {
                      "type": "number",
                      "minimum": -1000000,
                      "maximum": 1000000
                    },
                    {
                      "type": "string",
                      "pattern": "^(?:event|counter|timer|rules)\\.[a-zA-Z][a-zA-Z0-9_-]{0,31}$"
                    }
                  ]
                },
                {
                  "anyOf": [
                    {
                      "type": "number",
                      "minimum": -1000000,
                      "maximum": 1000000
                    },
                    {
                      "type": "string",
                      "pattern": "^(?:event|counter|timer|rules)\\.[a-zA-Z][a-zA-Z0-9_-]{0,31}$"
                    }
                  ]
                }
              ],
              "minItems": 2
            }
          },
          "required": [
            "ne"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "gt": {
              "type": "array",
              "items": [
                {
                  "anyOf": [
                    {
                      "type": "number",
                      "minimum": -1000000,
                      "maximum": 1000000
                    },
                    {
                      "type": "string",
                      "pattern": "^(?:event|counter|timer|rules)\\.[a-zA-Z][a-zA-Z0-9_-]{0,31}$"
                    }
                  ]
                },
                {
                  "anyOf": [
                    {
                      "type": "number",
                      "minimum": -1000000,
                      "maximum": 1000000
                    },
                    {
                      "type": "string",
                      "pattern": "^(?:event|counter|timer|rules)\\.[a-zA-Z][a-zA-Z0-9_-]{0,31}$"
                    }
                  ]
                }
              ],
              "minItems": 2
            }
          },
          "required": [
            "gt"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "gte": {
              "type": "array",
              "items": [
                {
                  "anyOf": [
                    {
                      "type": "number",
                      "minimum": -1000000,
                      "maximum": 1000000
                    },
                    {
                      "type": "string",
                      "pattern": "^(?:event|counter|timer|rules)\\.[a-zA-Z][a-zA-Z0-9_-]{0,31}$"
                    }
                  ]
                },
                {
                  "anyOf": [
                    {
                      "type": "number",
                      "minimum": -1000000,
                      "maximum": 1000000
                    },
                    {
                      "type": "string",
                      "pattern": "^(?:event|counter|timer|rules)\\.[a-zA-Z][a-zA-Z0-9_-]{0,31}$"
                    }
                  ]
                }
              ],
              "minItems": 2
            }
          },
          "required": [
            "gte"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "lt": {
              "type": "array",
              "items": [
                {
                  "anyOf": [
                    {
                      "type": "number",
                      "minimum": -1000000,
                      "maximum": 1000000
                    },
                    {
                      "type": "string",
                      "pattern": "^(?:event|counter|timer|rules)\\.[a-zA-Z][a-zA-Z0-9_-]{0,31}$"
                    }
                  ]
                },
                {
                  "anyOf": [
                    {
                      "type": "number",
                      "minimum": -1000000,
                      "maximum": 1000000
                    },
                    {
                      "type": "string",
                      "pattern": "^(?:event|counter|timer|rules)\\.[a-zA-Z][a-zA-Z0-9_-]{0,31}$"
                    }
                  ]
                }
              ],
              "minItems": 2
            }
          },
          "required": [
            "lt"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "lte": {
              "type": "array",
              "items": [
                {
                  "anyOf": [
                    {
                      "type": "number",
                      "minimum": -1000000,
                      "maximum": 1000000
                    },
                    {
                      "type": "string",
                      "pattern": "^(?:event|counter|timer|rules)\\.[a-zA-Z][a-zA-Z0-9_-]{0,31}$"
                    }
                  ]
                },
                {
                  "anyOf": [
                    {
                      "type": "number",
                      "minimum": -1000000,
                      "maximum": 1000000
                    },
                    {
                      "type": "string",
                      "pattern": "^(?:event|counter|timer|rules)\\.[a-zA-Z][a-zA-Z0-9_-]{0,31}$"
                    }
                  ]
                }
              ],
              "minItems": 2
            }
          },
          "required": [
            "lte"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "in": {
              "type": "array",
              "items": [
                {
                  "anyOf": [
                    {
                      "type": "number",
                      "minimum": -1000000,
                      "maximum": 1000000
                    },
                    {
                      "type": "string",
                      "pattern": "^(?:event|counter|timer|rules)\\.[a-zA-Z][a-zA-Z0-9_-]{0,31}$"
                    }
                  ]
                },
                {
                  "type": "array",
                  "items": {
                    "type": "number"
                  },
                  "maxItems": 32
                }
              ],
              "minItems": 2
            }
          },
          "required": [
            "in"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "flag": {
              "type": "string",
              "pattern": "^[a-z][a-zA-Z0-9_-]{0,31}$"
            }
          },
          "required": [
            "flag"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "notFlag": {
              "type": "string",
              "pattern": "^[a-z][a-zA-Z0-9_-]{0,31}$"
            }
          },
          "required": [
            "notFlag"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "lit": {
              "type": "string",
              "pattern": "^[a-z][a-zA-Z0-9_-]{0,31}$"
            }
          },
          "required": [
            "lit"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "unlit": {
              "type": "string",
              "pattern": "^[a-z][a-zA-Z0-9_-]{0,31}$"
            }
          },
          "required": [
            "unlit"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "mode": {
              "type": "string",
              "pattern": "^[a-z][a-zA-Z0-9_-]{0,31}$"
            }
          },
          "required": [
            "mode"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "notMode": {
              "type": "string",
              "pattern": "^[a-z][a-zA-Z0-9_-]{0,31}$"
            }
          },
          "required": [
            "notMode"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "display": {
              "enum": [
                "idle",
                "reach",
                "fever",
                "jackpot"
              ],
              "type": "string"
            }
          },
          "required": [
            "display"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "notDisplay": {
              "enum": [
                "idle",
                "reach",
                "fever",
                "jackpot"
              ],
              "type": "string"
            }
          },
          "required": [
            "notDisplay"
          ],
          "additionalProperties": false
        }
      ]
    },
    "1": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "award": {
              "type": "object",
              "properties": {
                "points": {
                  "anyOf": [
                    {
                      "type": "number",
                      "minimum": -1000000,
                      "maximum": 1000000
                    },
                    {
                      "type": "string",
                      "pattern": "^(?:event|counter|timer|rules)\\.[a-zA-Z][a-zA-Z0-9_-]{0,31}$"
                    }
                  ]
                },
                "scale": {
                  "type": "array",
                  "items": {
                    "anyOf": [
                      {
                        "anyOf": [
                          {
                            "type": "number",
                            "minimum": -1000000,
                            "maximum": 1000000
                          },
                          {
                            "type": "string",
                            "pattern": "^(?:event|counter|timer|rules)\\.[a-zA-Z][a-zA-Z0-9_-]{0,31}$"
                          }
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "tier": {
                            "type": "object",
                            "properties": {
                              "of": {
                                "anyOf": [
                                  {
                                    "type": "number",
                                    "minimum": -1000000,
                                    "maximum": 1000000
                                  },
                                  {
                                    "type": "string",
                                    "pattern": "^(?:event|counter|timer|rules)\\.[a-zA-Z][a-zA-Z0-9_-]{0,31}$"
                                  }
                                ]
                              },
                              "per": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 1000
                              }
                            },
                            "required": [
                              "of",
                              "per"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "tier"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "maxItems": 8
                },
                "source": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9:{}_-]{0,63}$"
                },
                "tally": {
                  "enum": [
                    "chain-bonus",
                    "gold-ball"
                  ],
                  "type": "string"
                }
              },
              "required": [
                "points",
                "source"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "award"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "comboHit": {
              "type": "object",
              "properties": {},
              "required": [],
              "additionalProperties": false
            }
          },
          "required": [
            "comboHit"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "add": {
              "type": "object",
              "properties": {
                "counter": {
                  "type": "string",
                  "pattern": "^[a-z][a-zA-Z0-9_-]{0,31}$"
                },
                "value": {
                  "anyOf": [
                    {
                      "type": "number",
                      "minimum": -1000000,
                      "maximum": 1000000
                    },
                    {
                      "type": "string",
                      "pattern": "^(?:event|counter|timer|rules)\\.[a-zA-Z][a-zA-Z0-9_-]{0,31}$"
                    }
                  ]
                }
              },
              "required": [
                "counter",
                "value"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "add"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "set": {
              "type": "object",
              "properties": {
                "counter": {
                  "type": "string",
                  "pattern": "^[a-z][a-zA-Z0-9_-]{0,31}$"
                },
                "value": {
                  "anyOf": [
                    {
                      "type": "number",
                      "minimum": -1000000,
                      "maximum": 1000000
                    },
                    {
                      "type": "string",
                      "pattern": "^(?:event|counter|timer|rules)\\.[a-zA-Z][a-zA-Z0-9_-]{0,31}$"
                    }
                  ]
                }
              },
              "required": [
                "counter",
                "value"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "set"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "setFlag": {
              "type": "string",
              "pattern": "^[a-z][a-zA-Z0-9_-]{0,31}$"
            }
          },
          "required": [
            "setFlag"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "clearFlag": {
              "type": "string",
              "pattern": "^[a-z][a-zA-Z0-9_-]{0,31}$"
            }
          },
          "required": [
            "clearFlag"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "light": {
              "type": "string",
              "pattern": "^[a-z][a-zA-Z0-9_-]{0,31}$"
            }
          },
          "required": [
            "light"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "unlight": {
              "type": "string",
              "pattern": "^[a-z][a-zA-Z0-9_-]{0,31}$"
            }
          },
          "required": [
            "unlight"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "startMode": {
              "type": "string",
              "pattern": "^[a-z][a-zA-Z0-9_-]{0,31}$"
            }
          },
          "required": [
            "startMode"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "endMode": {
              "type": "string",
              "pattern": "^[a-z][a-zA-Z0-9_-]{0,31}$"
            }
          },
          "required": [
            "endMode"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "startTimer": {
              "type": "string",
              "pattern": "^[a-z][a-zA-Z0-9_-]{0,31}$"
            }
          },
          "required": [
            "startTimer"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "stopTimer": {
              "type": "string",
              "pattern": "^[a-z][a-zA-Z0-9_-]{0,31}$"
            }
          },
          "required": [
            "stopTimer"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "multiplier": {
              "anyOf": [
                {
                  "type": "number",
                  "minimum": -1000000,
                  "maximum": 1000000
                },
                {
                  "type": "string",
                  "pattern": "^(?:event|counter|timer|rules)\\.[a-zA-Z][a-zA-Z0-9_-]{0,31}$"
                }
              ]
            }
          },
          "required": [
            "multiplier"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "multiball": {
              "type": "object",
              "properties": {
                "balls": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 8
                },
                "reason": {
                  "enum": [
                    "jackpot",
                    "gold-threshold"
                  ],
                  "type": "string"
                }
              },
              "required": [
                "balls",
                "reason"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "multiball"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "addBalls": {
              "type": "integer",
              "minimum": 1,
              "maximum": 8
            }
          },
          "required": [
            "addBalls"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "ballSave": {
              "type": "object",
              "properties": {
                "ticks": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 216000
                }
              },
              "required": [
                "ticks"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "ballSave"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kickback": {
              "type": "object",
              "properties": {
                "impulse": {
                  "type": "array",
                  "items": [
                    {
                      "type": "number",
                      "minimum": -50,
                      "maximum": 50
                    },
                    {
                      "type": "number",
                      "minimum": -50,
                      "maximum": 50
                    },
                    {
                      "type": "number",
                      "minimum": -50,
                      "maximum": 50
                    }
                  ],
                  "minItems": 3
                }
              },
              "required": [
                "impulse"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "kickback"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "display": {
              "enum": [
                "idle",
                "reach",
                "fever",
                "jackpot"
              ],
              "type": "string"
            }
          },
          "required": [
            "display"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "emit": {
              "enum": [
                "fever:start",
                "fever:end",
                "reach:start",
                "jackpot:start"
              ],
              "type": "string"
            }
          },
          "required": [
            "emit"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "cue": {
              "$ref": "#/$defs/2"
            }
          },
          "required": [
            "cue"
          ],
          "additionalProperties": false
        }
      ]
    },
    "2": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "lighting": {
              "type": "object",
              "properties": {
                "mode": {
                  "enum": [
                    "normal",
                    "hit",
                    "fever",
                    "reach"
                  ],
                  "type": "string"
                },
                "seconds": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 60
                }
              },
              "required": [
                "mode",
                "seconds"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "lighting"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "atmosphere": {
              "enum": [
                "IDLE",
                "REACH",
                "FEVER",
                "JACKPOT"
              ],
              "type": "string"
            }
          },
          "required": [
            "atmosphere"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "beep": {
              "type": "number",
              "minimum": 20,
              "maximum": 20000
            }
          },
          "required": [
            "beep"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "bloom": {
              "type": "number",
              "minimum": 0,
              "maximum": 10
            }
          },
          "required": [
            "bloom"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "goldPulse": {
              "type": "object",
              "properties": {},
              "required": [],
              "additionalProperties": false
            }
          },
          "required": [
            "goldPulse"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "haptic": {
              "enum": [
                "jackpot",
                "bumper",
                "ballLost"
              ],
              "type": "string"
            }
          },
          "required": [
            "haptic"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "message": {
              "type": "object",
              "properties": {
                "text": {
                  "type": "string",
                  "maxLength": 48
                },
                "ms": {
                  "type": "integer",
                  "minimum": 100,
                  "maximum": 10000
                }
              },
              "required": [
                "text",
                "ms"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "message"
          ],
          "additionalProperties": false
        }
      ]
    },
    "3": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "id": {
              "enum": [
                "NEON_HELIX",
                "PACHINKO_HALL",
                "CYBER_CORE",
                "QUANTUM_GRID",
                "STORM_LATTICE",
                "SINGULARITY_WELL",
                "GLITCH_SPIRE",
                "RETRO_WAVE_HILLS",
                "CHRONO_CORE",
                "HYPER_DRIFT",
                "PACHINKO_SPIRE",
                "ORBITAL_JUNKYARD",
                "FIREWALL_BREACH",
                "CPU_CORE",
                "CRYO_CHAMBER",
                "BIO_HAZARD_LAB",
                "GRAVITY_FORGE",
                "TIDAL_NEXUS",
                "DIGITAL_ZEN_GARDEN",
                "SYNTHWAVE_SURF",
                "SOLAR_FLARE",
                "PRISM_PATHWAY",
                "MAGNETIC_STORAGE",
                "NEURAL_NETWORK",
                "NEON_STRONGHOLD",
                "CASINO_HEIST",
                "TESLA_TOWER",
                "NEON_SKYLINE",
                "POLYCHROME_VOID"
              ],
              "type": "string"
            }
          },
          "required": [
            "id"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "inline": {
              "$ref": "#/$defs/TrackDefinition"
            }
          },
          "required": [
            "inline"
          ],
          "additionalProperties": false
        }
      ]
    },
    "4": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "object",
          "properties": {
            "random": {
              "type": "array",
              "items": [
                {
                  "type": "number"
                },
                {
                  "type": "number"
                }
              ],
              "minItems": 2
            },
            "scale": {
              "type": "number"
            }
          },
          "required": [
            "random"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "start": {
              "type": "number"
            },
            "step": {
              "type": "number"
            }
          },
          "required": [
            "start",
            "step"
          ],
          "additionalProperties": false
        }
      ]
    },
    "Machine": {
      "type": "object",
      "properties": {
        "$schema": {
          "type": "string"
        },
        "schemaVersion": {
          "const": 1
        },
        "id": {
          "type": "string",
          "pattern": "^[a-z0-9][a-z0-9-]{0,47}$"
        },
        "name": {
          "type": "string"
        },
        "cabinet": {
          "enum": [
            "classic",
            "neo",
            "vertical",
            "wide"
          ],
          "type": "string"
        },
        "tracks": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/TrackRef"
          }
        },
        "backbox": {
          "type": "object",
          "properties": {
            "idle": {
              "type": "object",
              "properties": {
                "video": {
                  "type": "string",
                  "pattern": "^(?:[a-z0-9][a-z0-9_-]*\\/){0,3}[a-z0-9][a-z0-9._-]*\\.(?:mp4|webm)$"
                },
                "poster": {
                  "type": "string",
                  "pattern": "^(?:[a-z0-9][a-z0-9_-]*\\/){0,3}[a-z0-9][a-z0-9._-]*\\.(?:png|webp|jpg)$"
                }
              },
              "required": [
                "video"
              ],
              "additionalProperties": false
            },
            "reach": {
              "type": "object",
              "properties": {
                "video": {
                  "type": "string",
                  "pattern": "^(?:[a-z0-9][a-z0-9_-]*\\/){0,3}[a-z0-9][a-z0-9._-]*\\.(?:mp4|webm)$"
                },
                "poster": {
                  "type": "string",
                  "pattern": "^(?:[a-z0-9][a-z0-9_-]*\\/){0,3}[a-z0-9][a-z0-9._-]*\\.(?:png|webp|jpg)$"
                }
              },
              "required": [
                "video"
              ],
              "additionalProperties": false
            },
            "fever": {
              "type": "object",
              "properties": {
                "video": {
                  "type": "string",
                  "pattern": "^(?:[a-z0-9][a-z0-9_-]*\\/){0,3}[a-z0-9][a-z0-9._-]*\\.(?:mp4|webm)$"
                },
                "poster": {
                  "type": "string",
                  "pattern": "^(?:[a-z0-9][a-z0-9_-]*\\/){0,3}[a-z0-9][a-z0-9._-]*\\.(?:png|webp|jpg)$"
                }
              },
              "required": [
                "video"
              ],
              "additionalProperties": false
            },
            "border": {
              "type": "string",
              "pattern": "^#[0-9a-f]{6}$"
            },
            "shaderParams": {
              "type": "object",
              "propertyNames": {
                "type": "string",
                "pattern": "^[a-zA-Z][a-zA-Z0-9]{0,31}$"
              },
              "additionalProperties": {
                "type": "number",
                "minimum": -1000,
                "maximum": 1000
              },
              "maxProperties": 16
            }
          },
          "required": [
            "idle",
            "reach",
            "fever",
            "border",
            "shaderParams"
          ],
          "additionalProperties": false
        },
        "audio": {
          "type": "object",
          "properties": {
            "stems": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "role": {
                    "enum": [
                      "drums",
                      "bass",
                      "lead",
                      "fever"
                    ],
                    "type": "string"
                  },
                  "src": {
                    "type": "string",
                    "pattern": "^(?:[a-z0-9][a-z0-9_-]*\\/){0,3}[a-z0-9][a-z0-9._-]*\\.(?:opus|ogg|webm)$"
                  }
                },
                "required": [
                  "role",
                  "src"
                ],
                "additionalProperties": false
              },
              "maxItems": 8
            },
            "bpm": {
              "type": "number",
              "minimum": 40,
              "maximum": 240
            }
          },
          "required": [
            "stems",
            "bpm"
          ],
          "additionalProperties": false
        },
        "rules": {
          "type": "object",
          "properties": {
            "balls": {
              "type": "object",
              "properties": {
                "weights": {
                  "type": "object",
                  "properties": {
                    "standard": {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 1
                    },
                    "gold_plated": {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 1
                    },
                    "solid_gold": {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 1
                    }
                  },
                  "required": [
                    "standard",
                    "gold_plated",
                    "solid_gold"
                  ],
                  "additionalProperties": false
                },
                "points": {
                  "type": "object",
                  "properties": {
                    "standard": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 1000000
                    },
                    "gold_plated": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 1000000
                    },
                    "solid_gold": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 1000000
                    }
                  },
                  "required": [
                    "standard",
                    "gold_plated",
                    "solid_gold"
                  ],
                  "additionalProperties": false
                },
                "feverMultipliers": {
                  "type": "object",
                  "properties": {
                    "standard": {
                      "type": "number",
                      "minimum": 1,
                      "maximum": 100
                    },
                    "gold_plated": {
                      "type": "number",
                      "minimum": 1,
                      "maximum": 100
                    },
                    "solid_gold": {
                      "type": "number",
                      "minimum": 1,
                      "maximum": 100
                    }
                  },
                  "required": [
                    "standard",
                    "gold_plated",
                    "solid_gold"
                  ],
                  "additionalProperties": false
                }
              },
              "required": [
                "weights",
                "points",
                "feverMultipliers"
              ],
              "additionalProperties": false
            },
            "fever": {
              "type": "object",
              "properties": {
                "threshold": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 100
                }
              },
              "required": [
                "threshold"
              ],
              "additionalProperties": false
            },
            "cascade": {
              "type": "object",
              "properties": {
                "weekly": {
                  "$ref": "#/$defs/WeeklyMachine"
                }
              },
              "required": [],
              "additionalProperties": false
            },
            "program": {
              "type": "object",
              "properties": {
                "counters": {
                  "type": "object",
                  "propertyNames": {
                    "type": "string",
                    "pattern": "^[a-z][a-zA-Z0-9_-]{0,31}$"
                  },
                  "additionalProperties": {
                    "type": "object",
                    "properties": {
                      "initial": {
                        "type": "number",
                        "minimum": -1000000,
                        "maximum": 1000000
                      }
                    },
                    "required": [
                      "initial"
                    ],
                    "additionalProperties": false
                  },
                  "maxProperties": 64
                },
                "timers": {
                  "type": "object",
                  "propertyNames": {
                    "type": "string",
                    "pattern": "^[a-z][a-zA-Z0-9_-]{0,31}$"
                  },
                  "additionalProperties": {
                    "type": "object",
                    "properties": {
                      "ticks": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 216000
                      },
                      "repeat": {
                        "type": "boolean"
                      }
                    },
                    "required": [
                      "ticks"
                    ],
                    "additionalProperties": false
                  },
                  "maxProperties": 64
                },
                "modes": {
                  "type": "object",
                  "propertyNames": {
                    "type": "string",
                    "pattern": "^[a-z][a-zA-Z0-9_-]{0,31}$"
                  },
                  "additionalProperties": {
                    "type": "object",
                    "properties": {
                      "ticks": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 216000
                      },
                      "multiplier": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 100
                      }
                    },
                    "required": [],
                    "additionalProperties": false
                  },
                  "maxProperties": 64
                },
                "handlers": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "on": {
                        "enum": [
                          "bumper",
                          "target",
                          "spinner",
                          "lane",
                          "drain",
                          "saucer",
                          "gate",
                          "launcher",
                          "goldCollect",
                          "jackpot",
                          "comboExpire",
                          "timer",
                          "modeEnd"
                        ],
                        "type": "string"
                      },
                      "id": {
                        "type": "string",
                        "pattern": "^[a-zA-Z0-9][a-zA-Z0-9_:-]{0,47}$"
                      },
                      "kind": {
                        "type": "string",
                        "pattern": "^[a-zA-Z0-9][a-zA-Z0-9_:-]{0,47}$"
                      },
                      "if": {
                        "type": "array",
                        "items": {
                          "$ref": "#/$defs/0"
                        },
                        "maxItems": 16
                      },
                      "do": {
                        "type": "array",
                        "items": {
                          "$ref": "#/$defs/1"
                        },
                        "minItems": 1,
                        "maxItems": 32
                      }
                    },
                    "required": [
                      "on",
                      "do"
                    ],
                    "additionalProperties": false
                  },
                  "maxItems": 256
                }
              },
              "required": [
                "handlers"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "balls",
            "fever",
            "cascade"
          ],
          "additionalProperties": false
        },
        "seedPolicy": {
          "enum": [
            "vanilla",
            "daily",
            "weekly",
            "free"
          ],
          "type": "string"
        }
      },
      "required": [
        "schemaVersion",
        "id",
        "name",
        "cabinet",
        "tracks",
        "backbox",
        "audio",
        "rules",
        "seedPolicy"
      ],
      "additionalProperties": false
    },
    "TrackRef": {
      "$ref": "#/$defs/3"
    },
    "TrackDefinition": {
      "type": "object",
      "properties": {
        "$schema": {
          "type": "string"
        },
        "schemaVersion": {
          "const": 1
        },
        "id": {
          "type": "string",
          "minLength": 1
        },
        "themeProfile": {
          "type": "string"
        },
        "cameraPresetId": {
          "type": "string"
        },
        "gravityMultiplier": {
          "type": "number",
          "exclusiveMinimum": 0
        },
        "initialHeadingDeg": {
          "type": "number"
        },
        "materials": {
          "type": "object",
          "propertyNames": {
            "enum": [
              "structure",
              "accent",
              "energy",
              "glow"
            ],
            "type": "string"
          },
          "additionalProperties": {
            "type": "string",
            "pattern": "^#[0-9A-Fa-f]{6}$"
          }
        },
        "segments": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/TrackSegment"
          },
          "minItems": 1
        }
      },
      "required": [
        "schemaVersion",
        "id",
        "segments"
      ],
      "additionalProperties": false
    },
    "WeeklyMachine": {
      "type": "object",
      "properties": {
        "schemaVersion": {
          "const": 1
        },
        "seed": {
          "type": "integer",
          "minimum": 0,
          "maximum": 4294967295
        },
        "pinField": {
          "type": "object",
          "properties": {
            "rows": {
              "type": "integer",
              "minimum": 8,
              "maximum": 12
            },
            "cols": {
              "type": "integer",
              "minimum": 11,
              "maximum": 15
            },
            "dropout": {
              "type": "number"
            },
            "dropoutSeed": {
              "type": "integer",
              "minimum": 0,
              "maximum": 4294967295
            },
            "keepOuts": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "minX": {
                    "type": "number"
                  },
                  "maxX": {
                    "type": "number"
                  },
                  "minZ": {
                    "type": "number"
                  },
                  "maxZ": {
                    "type": "number"
                  }
                },
                "required": [
                  "minX",
                  "maxX",
                  "minZ",
                  "maxZ"
                ],
                "additionalProperties": false
              },
              "maxItems": 3
            }
          },
          "required": [
            "rows",
            "cols",
            "dropout",
            "dropoutSeed",
            "keepOuts"
          ],
          "additionalProperties": false
        },
        "bumpers": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "dx": {
                "type": "number"
              },
              "dz": {
                "type": "number"
              }
            },
            "required": [
              "dx",
              "dz"
            ],
            "additionalProperties": false
          },
          "minItems": 12,
          "maxItems": 12
        },
        "feeders": {
          "type": "object",
          "properties": {
            "magSpin": {
              "type": "boolean"
            },
            "nanoLoom": {
              "type": "boolean"
            },
            "prismCore": {
              "type": "boolean"
            },
            "gaussCannon": {
              "type": "boolean"
            },
            "quantumTunnel": {
              "type": "boolean"
            }
          },
          "required": [
            "magSpin",
            "nanoLoom",
            "prismCore",
            "gaussCannon",
            "quantumTunnel"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "schemaVersion",
        "seed",
        "pinField",
        "bumpers",
        "feeders"
      ],
      "additionalProperties": false
    },
    "Vec3": {
      "type": "object",
      "properties": {
        "x": {
          "type": "number"
        },
        "y": {
          "type": "number"
        },
        "z": {
          "type": "number"
        }
      },
      "required": [
        "x",
        "y",
        "z"
      ],
      "additionalProperties": false
    },
    "MaterialRef": {
      "anyOf": [
        {
          "enum": [
            "structure",
            "accent",
            "energy",
            "glow"
          ],
          "type": "string"
        },
        {
          "type": "string",
          "pattern": "^#[0-9A-Fa-f]{6}$"
        },
        {
          "type": "string",
          "pattern": "^pbr:#[0-9A-Fa-f]{6}$"
        }
      ]
    },
    "Placement": {
      "type": "object",
      "properties": {
        "from": {
          "enum": [
            "cursor",
            "rampStart",
            "rampCenter",
            "spinner"
          ],
          "type": "string"
        },
        "mark": {
          "type": "string",
          "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,31}$"
        },
        "frame": {
          "enum": [
            "flat",
            "surface"
          ],
          "type": "string"
        },
        "offset": {
          "$ref": "#/$defs/Vec3"
        },
        "along": {
          "type": "number"
        },
        "lateral": {
          "type": "number"
        },
        "normal": {
          "type": "number"
        },
        "up": {
          "type": "array",
          "items": {
            "type": "number"
          }
        }
      },
      "required": [],
      "additionalProperties": false
    },
    "NumberSpec": {
      "$ref": "#/$defs/4"
    },
    "Shape": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "kind": {
              "const": "box"
            },
            "size": {
              "anyOf": [
                {
                  "type": "object",
                  "properties": {
                    "x": {
                      "type": "number",
                      "exclusiveMinimum": 0
                    },
                    "y": {
                      "type": "number",
                      "exclusiveMinimum": 0
                    },
                    "z": {
                      "type": "number",
                      "exclusiveMinimum": 0
                    }
                  },
                  "required": [
                    "x",
                    "y",
                    "z"
                  ],
                  "additionalProperties": false
                },
                {
                  "const": "size"
                }
              ]
            }
          },
          "required": [
            "kind",
            "size"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "const": "cylinder"
            },
            "diameter": {
              "anyOf": [
                {
                  "type": "number",
                  "exclusiveMinimum": 0
                },
                {
                  "const": "size"
                }
              ]
            },
            "height": {
              "anyOf": [
                {
                  "type": "number",
                  "exclusiveMinimum": 0
                },
                {
                  "const": "size"
                }
              ]
            }
          },
          "required": [
            "kind",
            "diameter",
            "height"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "const": "sphere"
            },
            "diameter": {
              "anyOf": [
                {
                  "type": "number",
                  "exclusiveMinimum": 0
                },
                {
                  "const": "size"
                }
              ]
            }
          },
          "required": [
            "kind",
            "diameter"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "const": "prism"
            },
            "diameter": {
              "anyOf": [
                {
                  "type": "number",
                  "exclusiveMinimum": 0
                },
                {
                  "const": "size"
                }
              ]
            },
            "height": {
              "anyOf": [
                {
                  "type": "number",
                  "exclusiveMinimum": 0
                },
                {
                  "const": "size"
                }
              ]
            }
          },
          "required": [
            "kind",
            "diameter",
            "height"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "const": "tetra"
            },
            "size": {
              "anyOf": [
                {
                  "type": "number",
                  "exclusiveMinimum": 0
                },
                {
                  "const": "size"
                }
              ]
            }
          },
          "required": [
            "kind",
            "size"
          ],
          "additionalProperties": false
        }
      ]
    },
    "MeshShape": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "kind": {
              "const": "box"
            },
            "size": {
              "type": "object",
              "properties": {
                "x": {
                  "type": "number",
                  "exclusiveMinimum": 0
                },
                "y": {
                  "type": "number",
                  "exclusiveMinimum": 0
                },
                "z": {
                  "type": "number",
                  "exclusiveMinimum": 0
                }
              },
              "required": [
                "x",
                "y",
                "z"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "kind",
            "size"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "const": "cylinder"
            },
            "diameter": {
              "type": "number",
              "exclusiveMinimum": 0
            },
            "height": {
              "type": "number",
              "exclusiveMinimum": 0
            },
            "tessellation": {
              "type": "integer",
              "minimum": 3,
              "maximum": 128
            }
          },
          "required": [
            "kind",
            "diameter",
            "height"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "const": "sphere"
            },
            "diameter": {
              "type": "number",
              "exclusiveMinimum": 0
            }
          },
          "required": [
            "kind",
            "diameter"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "const": "torus"
            },
            "diameter": {
              "type": "number",
              "exclusiveMinimum": 0
            },
            "thickness": {
              "type": "number",
              "exclusiveMinimum": 0
            },
            "tessellation": {
              "type": "integer",
              "minimum": 3,
              "maximum": 128
            }
          },
          "required": [
            "kind",
            "diameter",
            "thickness"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "const": "tetra"
            },
            "size": {
              "type": "number",
              "exclusiveMinimum": 0
            }
          },
          "required": [
            "kind",
            "size"
          ],
          "additionalProperties": false
        }
      ]
    },
    "VisualMesh": {
      "type": "object",
      "properties": {
        "shape": {
          "$ref": "#/$defs/MeshShape"
        },
        "local": {
          "$ref": "#/$defs/Vec3"
        },
        "material": {
          "$ref": "#/$defs/MaterialRef"
        }
      },
      "required": [
        "shape"
      ],
      "additionalProperties": false
    },
    "Motion": {
      "type": "object",
      "properties": {
        "kind": {
          "enum": [
            "piston",
            "oscillator",
            "rotatingOscillator"
          ],
          "type": "string"
        },
        "frequency": {
          "$ref": "#/$defs/NumberSpec"
        },
        "amplitude": {
          "$ref": "#/$defs/NumberSpec"
        },
        "phase": {
          "$ref": "#/$defs/NumberSpec"
        },
        "axis": {
          "anyOf": [
            {
              "const": "right"
            },
            {
              "$ref": "#/$defs/Vec3"
            }
          ]
        },
        "travel": {
          "type": "array",
          "items": [
            {
              "type": "number"
            },
            {
              "type": "number"
            }
          ],
          "minItems": 2
        },
        "draw": {
          "type": "array",
          "items": {
            "enum": [
              "frequency",
              "amplitude",
              "phase"
            ],
            "type": "string"
          }
        },
        "bindMesh": {
          "type": "boolean"
        }
      },
      "required": [],
      "additionalProperties": false
    },
    "Zone": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "kind": {
              "const": "conveyor"
            },
            "force": {
              "$ref": "#/$defs/Vec3"
            }
          },
          "required": [
            "kind",
            "force"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "const": "rampConveyor"
            },
            "force": {
              "type": "number"
            }
          },
          "required": [
            "kind",
            "force"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "const": "damping"
            },
            "damping": {
              "type": "number",
              "minimum": 0
            }
          },
          "required": [
            "kind",
            "damping"
          ],
          "additionalProperties": false
        }
      ]
    },
    "TrackSegment": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "straight"
            },
            "width": {
              "type": "number",
              "exclusiveMinimum": 0
            },
            "length": {
              "type": "number",
              "exclusiveMinimum": 0
            },
            "inclineDeg": {
              "type": "number"
            },
            "material": {
              "$ref": "#/$defs/MaterialRef"
            },
            "wallHeight": {
              "type": "number"
            },
            "friction": {
              "type": "number"
            },
            "headingOffsetDeg": {
              "type": "number"
            }
          },
          "required": [
            "type",
            "width",
            "length",
            "inclineDeg"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "curve"
            },
            "radius": {
              "type": "number",
              "exclusiveMinimum": 0
            },
            "angleDeg": {
              "type": "number"
            },
            "inclineDeg": {
              "type": "number"
            },
            "width": {
              "type": "number",
              "exclusiveMinimum": 0
            },
            "wallHeight": {
              "type": "number"
            },
            "bankingDeg": {
              "type": "number"
            },
            "segments": {
              "type": "number",
              "minimum": 1
            },
            "material": {
              "$ref": "#/$defs/MaterialRef"
            },
            "friction": {
              "type": "number"
            },
            "conveyor": {
              "type": "object",
              "properties": {
                "segments": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 256
                },
                "force": {
                  "type": "number"
                },
                "halfWidth": {
                  "type": "number",
                  "exclusiveMinimum": 0
                },
                "halfHeight": {
                  "type": "number",
                  "exclusiveMinimum": 0
                },
                "lift": {
                  "type": "number"
                },
                "label": {
                  "type": "string",
                  "maxLength": 48
                }
              },
              "required": [
                "segments",
                "force",
                "halfWidth",
                "halfHeight"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "type",
            "radius",
            "angleDeg",
            "inclineDeg",
            "width"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "gap"
            },
            "length": {
              "type": "number"
            },
            "drop": {
              "type": "number"
            }
          },
          "required": [
            "type",
            "length",
            "drop"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "turn"
            },
            "deltaHeadingDeg": {
              "type": "number"
            }
          },
          "required": [
            "type",
            "deltaHeadingDeg"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "bucket"
            },
            "material": {
              "$ref": "#/$defs/MaterialRef"
            },
            "offset": {
              "$ref": "#/$defs/Vec3"
            },
            "at": {
              "$ref": "#/$defs/Placement"
            }
          },
          "required": [
            "type"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "portal"
            },
            "offset": {
              "$ref": "#/$defs/Vec3"
            }
          },
          "required": [
            "type"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "spinner"
            },
            "radius": {
              "type": "number",
              "exclusiveMinimum": 0
            },
            "angVelDeg": {
              "type": "number"
            },
            "angVel": {
              "type": "number"
            },
            "teeth": {
              "type": "boolean"
            },
            "advance": {
              "type": "boolean"
            },
            "offset": {
              "$ref": "#/$defs/Vec3"
            },
            "at": {
              "$ref": "#/$defs/Placement"
            },
            "material": {
              "$ref": "#/$defs/MaterialRef"
            }
          },
          "required": [
            "type",
            "radius"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "gate"
            },
            "color": {
              "enum": [
                "RED",
                "GREEN",
                "BLUE"
              ],
              "type": "string"
            },
            "offset": {
              "$ref": "#/$defs/Vec3"
            }
          },
          "required": [
            "type",
            "color"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "cylinder"
            },
            "diameter": {
              "type": "number",
              "exclusiveMinimum": 0
            },
            "height": {
              "type": "number",
              "exclusiveMinimum": 0
            },
            "offset": {
              "$ref": "#/$defs/Vec3"
            },
            "material": {
              "$ref": "#/$defs/MaterialRef"
            }
          },
          "required": [
            "type",
            "diameter",
            "height"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "pinField"
            },
            "spacing": {
              "type": "number",
              "exclusiveMinimum": 0
            },
            "evenOffsets": {
              "type": "array",
              "items": {
                "type": "number"
              }
            },
            "oddOffsets": {
              "type": "array",
              "items": {
                "type": "number"
              }
            },
            "diameter": {
              "type": "number",
              "exclusiveMinimum": 0
            },
            "height": {
              "type": "number",
              "exclusiveMinimum": 0
            },
            "material": {
              "$ref": "#/$defs/MaterialRef"
            }
          },
          "required": [
            "type",
            "spacing",
            "evenOffsets",
            "oddOffsets",
            "diameter",
            "height"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "mill"
            },
            "alongRamp": {
              "type": "number"
            },
            "lateral": {
              "type": "number"
            },
            "radius": {
              "type": "number",
              "exclusiveMinimum": 0
            },
            "angVel": {
              "type": "number"
            },
            "surfaceOffset": {
              "type": "number"
            },
            "material": {
              "$ref": "#/$defs/MaterialRef"
            }
          },
          "required": [
            "type",
            "alongRamp",
            "lateral",
            "radius",
            "angVel"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "resetBasin"
            },
            "offset": {
              "$ref": "#/$defs/Vec3"
            },
            "material": {
              "$ref": "#/$defs/MaterialRef"
            }
          },
          "required": [
            "type"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "pinLattice"
            },
            "rows": {
              "type": "integer",
              "minimum": 1,
              "maximum": 9007199254740991
            },
            "cols": {
              "type": "integer",
              "minimum": 1,
              "maximum": 9007199254740991
            },
            "spacing": {
              "type": "number",
              "exclusiveMinimum": 0
            },
            "rowSpacing": {
              "type": "number",
              "exclusiveMinimum": 0
            },
            "rowOffset": {
              "type": "number"
            },
            "startAlong": {
              "type": "number",
              "minimum": 0
            },
            "lateral": {
              "type": "number"
            },
            "diameter": {
              "type": "number",
              "exclusiveMinimum": 0
            },
            "height": {
              "type": "number",
              "exclusiveMinimum": 0
            },
            "restitution": {
              "type": "number",
              "minimum": 0
            },
            "friction": {
              "type": "number",
              "minimum": 0
            },
            "dropout": {
              "type": "number",
              "minimum": 0,
              "exclusiveMaximum": 1
            },
            "dropoutSeed": {
              "type": "integer",
              "minimum": 0,
              "maximum": 4294967295
            },
            "holes": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "row": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "col": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "row",
                  "col"
                ],
                "additionalProperties": false
              }
            },
            "material": {
              "$ref": "#/$defs/MaterialRef"
            }
          },
          "required": [
            "type",
            "rows",
            "cols",
            "spacing",
            "diameter",
            "height"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "forceField"
            },
            "size": {
              "type": "object",
              "properties": {
                "x": {
                  "type": "number",
                  "exclusiveMinimum": 0
                },
                "y": {
                  "type": "number",
                  "exclusiveMinimum": 0
                },
                "z": {
                  "type": "number",
                  "exclusiveMinimum": 0
                }
              },
              "required": [
                "x",
                "y",
                "z"
              ],
              "additionalProperties": false
            },
            "accel": {
              "$ref": "#/$defs/Vec3"
            },
            "space": {
              "enum": [
                "world",
                "field"
              ],
              "type": "string"
            },
            "alongRamp": {
              "type": "number"
            },
            "lateral": {
              "type": "number"
            },
            "surfaceOffset": {
              "type": "number"
            },
            "offset": {
              "$ref": "#/$defs/Vec3"
            },
            "yawDeg": {
              "type": "number"
            },
            "visible": {
              "type": "boolean"
            },
            "material": {
              "$ref": "#/$defs/MaterialRef"
            }
          },
          "required": [
            "type",
            "size",
            "accel"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "cone"
            },
            "radius": {
              "type": "number",
              "exclusiveMinimum": 0
            },
            "halfHeight": {
              "type": "number",
              "exclusiveMinimum": 0
            },
            "offset": {
              "$ref": "#/$defs/Vec3"
            },
            "yawDeg": {
              "type": "number"
            },
            "restitution": {
              "type": "number",
              "minimum": 0
            },
            "friction": {
              "type": "number",
              "minimum": 0
            },
            "material": {
              "$ref": "#/$defs/MaterialRef"
            }
          },
          "required": [
            "type",
            "radius",
            "halfHeight"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "axisPull"
            },
            "offset": {
              "$ref": "#/$defs/Vec3"
            },
            "axis": {
              "$ref": "#/$defs/Vec3"
            },
            "radius": {
              "type": "number",
              "exclusiveMinimum": 0
            },
            "halfHeight": {
              "type": "number",
              "exclusiveMinimum": 0
            },
            "strength": {
              "type": "number",
              "minimum": 0,
              "maximum": 60
            },
            "enabled": {
              "type": "boolean"
            },
            "visible": {
              "type": "boolean"
            },
            "material": {
              "$ref": "#/$defs/MaterialRef"
            }
          },
          "required": [
            "type",
            "radius",
            "strength"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "mark"
            },
            "name": {
              "type": "string",
              "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,31}$"
            }
          },
          "required": [
            "type",
            "name"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "jump"
            },
            "to": {
              "type": "string",
              "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,31}$"
            },
            "midpoint": {
              "type": "array",
              "items": [
                {
                  "type": "string",
                  "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,31}$"
                },
                {
                  "type": "string",
                  "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,31}$"
                }
              ],
              "minItems": 2
            },
            "at": {
              "$ref": "#/$defs/Placement"
            },
            "headingOf": {
              "type": "string",
              "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,31}$"
            }
          },
          "required": [
            "type"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "scatter"
            },
            "seedKey": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9:_-]{0,63}$"
            },
            "count": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1024
            },
            "from": {
              "enum": [
                "cursor",
                "rampStart",
                "rampCenter",
                "spinner"
              ],
              "type": "string"
            },
            "mark": {
              "type": "string",
              "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,31}$"
            },
            "frame": {
              "enum": [
                "flat",
                "surface"
              ],
              "type": "string"
            },
            "along": {
              "$ref": "#/$defs/NumberSpec"
            },
            "lateral": {
              "$ref": "#/$defs/NumberSpec"
            },
            "shapes": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/Shape"
              },
              "minItems": 2
            },
            "size": {
              "type": "array",
              "items": [
                {
                  "type": "number",
                  "exclusiveMinimum": 0
                },
                {
                  "type": "number",
                  "exclusiveMinimum": 0
                }
              ],
              "minItems": 2
            },
            "rotation": {
              "type": "object",
              "properties": {
                "x": {
                  "$ref": "#/$defs/NumberSpec"
                },
                "y": {
                  "$ref": "#/$defs/NumberSpec"
                },
                "z": {
                  "$ref": "#/$defs/NumberSpec"
                }
              },
              "required": [],
              "additionalProperties": false
            },
            "seat": {
              "type": "boolean"
            },
            "up": {
              "type": "array",
              "items": {
                "type": "number"
              }
            },
            "materials": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/MaterialRef"
              },
              "minItems": 1
            },
            "shape": {
              "$ref": "#/$defs/Shape"
            },
            "material": {
              "$ref": "#/$defs/MaterialRef"
            },
            "label": {
              "type": "string",
              "maxLength": 48
            },
            "orient": {
              "enum": [
                "heading",
                "ramp"
              ],
              "type": "string"
            },
            "restitution": {
              "type": "number",
              "minimum": 0
            },
            "friction": {
              "type": "number",
              "minimum": 0
            },
            "collisionColor": {
              "enum": [
                "RED",
                "GREEN",
                "BLUE"
              ],
              "type": "string"
            },
            "local": {
              "$ref": "#/$defs/Vec3"
            },
            "sensor": {
              "type": "boolean"
            },
            "zone": {
              "$ref": "#/$defs/Zone"
            },
            "motion": {
              "$ref": "#/$defs/Motion"
            },
            "mesh": {
              "anyOf": [
                {
                  "const": false
                },
                {
                  "type": "array",
                  "items": {
                    "$ref": "#/$defs/VisualMesh"
                  },
                  "minItems": 1
                }
              ]
            }
          },
          "required": [
            "type",
            "seedKey",
            "count",
            "along"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "obstacle"
            },
            "seedKey": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9:_-]{0,63}$"
            },
            "items": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "at": {
                    "$ref": "#/$defs/Placement"
                  },
                  "shape": {
                    "$ref": "#/$defs/Shape"
                  },
                  "material": {
                    "$ref": "#/$defs/MaterialRef"
                  },
                  "label": {
                    "type": "string",
                    "maxLength": 48
                  },
                  "orient": {
                    "enum": [
                      "heading",
                      "ramp"
                    ],
                    "type": "string"
                  },
                  "restitution": {
                    "type": "number",
                    "minimum": 0
                  },
                  "friction": {
                    "type": "number",
                    "minimum": 0
                  },
                  "collisionColor": {
                    "enum": [
                      "RED",
                      "GREEN",
                      "BLUE"
                    ],
                    "type": "string"
                  },
                  "local": {
                    "$ref": "#/$defs/Vec3"
                  },
                  "sensor": {
                    "type": "boolean"
                  },
                  "zone": {
                    "$ref": "#/$defs/Zone"
                  },
                  "motion": {
                    "$ref": "#/$defs/Motion"
                  },
                  "mesh": {
                    "anyOf": [
                      {
                        "const": false
                      },
                      {
                        "type": "array",
                        "items": {
                          "$ref": "#/$defs/VisualMesh"
                        },
                        "minItems": 1
                      }
                    ]
                  }
                },
                "required": [
                  "at"
                ],
                "additionalProperties": false
              },
              "minItems": 1
            },
            "variants": {
              "type": "array",
              "items": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "at": {
                      "$ref": "#/$defs/Placement"
                    },
                    "shape": {
                      "$ref": "#/$defs/Shape"
                    },
                    "material": {
                      "$ref": "#/$defs/MaterialRef"
                    },
                    "label": {
                      "type": "string",
                      "maxLength": 48
                    },
                    "orient": {
                      "enum": [
                        "heading",
                        "ramp"
                      ],
                      "type": "string"
                    },
                    "restitution": {
                      "type": "number",
                      "minimum": 0
                    },
                    "friction": {
                      "type": "number",
                      "minimum": 0
                    },
                    "collisionColor": {
                      "enum": [
                        "RED",
                        "GREEN",
                        "BLUE"
                      ],
                      "type": "string"
                    },
                    "local": {
                      "$ref": "#/$defs/Vec3"
                    },
                    "sensor": {
                      "type": "boolean"
                    },
                    "zone": {
                      "$ref": "#/$defs/Zone"
                    },
                    "motion": {
                      "$ref": "#/$defs/Motion"
                    },
                    "mesh": {
                      "anyOf": [
                        {
                          "const": false
                        },
                        {
                          "type": "array",
                          "items": {
                            "$ref": "#/$defs/VisualMesh"
                          },
                          "minItems": 1
                        }
                      ]
                    }
                  },
                  "required": [
                    "at"
                  ],
                  "additionalProperties": false
                },
                "minItems": 1
              },
              "minItems": 2
            },
            "shape": {
              "$ref": "#/$defs/Shape"
            },
            "material": {
              "$ref": "#/$defs/MaterialRef"
            },
            "label": {
              "type": "string",
              "maxLength": 48
            },
            "orient": {
              "enum": [
                "heading",
                "ramp"
              ],
              "type": "string"
            },
            "restitution": {
              "type": "number",
              "minimum": 0
            },
            "friction": {
              "type": "number",
              "minimum": 0
            },
            "collisionColor": {
              "enum": [
                "RED",
                "GREEN",
                "BLUE"
              ],
              "type": "string"
            },
            "local": {
              "$ref": "#/$defs/Vec3"
            },
            "sensor": {
              "type": "boolean"
            },
            "zone": {
              "$ref": "#/$defs/Zone"
            },
            "motion": {
              "$ref": "#/$defs/Motion"
            },
            "mesh": {
              "anyOf": [
                {
                  "const": false
                },
                {
                  "type": "array",
                  "items": {
                    "$ref": "#/$defs/VisualMesh"
                  },
                  "minItems": 1
                }
              ]
            }
          },
          "required": [
            "type"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "spinnerParts"
            },
            "ring": {
              "type": "object",
              "properties": {
                "count": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 256
                },
                "gapDeg": {
                  "type": "number",
                  "minimum": 0,
                  "exclusiveMaximum": 360
                },
                "segments": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 256
                }
              },
              "required": [
                "count"
              ],
              "additionalProperties": false
            },
            "points": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "angleDeg": {
                    "type": "number"
                  },
                  "radius": {
                    "type": "number",
                    "exclusiveMinimum": 0
                  }
                },
                "required": [
                  "angleDeg",
                  "radius"
                ],
                "additionalProperties": false
              },
              "minItems": 1
            },
            "radius": {
              "type": "number",
              "exclusiveMinimum": 0
            },
            "radiusFactor": {
              "type": "number",
              "exclusiveMinimum": 0
            },
            "y": {
              "type": "number"
            },
            "shape": {
              "oneOf": [
                {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "const": "box"
                    },
                    "size": {
                      "type": "object",
                      "properties": {
                        "x": {
                          "type": "number",
                          "exclusiveMinimum": 0
                        },
                        "y": {
                          "type": "number",
                          "exclusiveMinimum": 0
                        },
                        "z": {
                          "anyOf": [
                            {
                              "type": "number",
                              "exclusiveMinimum": 0
                            },
                            {
                              "const": "arc"
                            }
                          ]
                        }
                      },
                      "required": [
                        "x",
                        "y",
                        "z"
                      ],
                      "additionalProperties": false
                    },
                    "arcPad": {
                      "type": "number",
                      "minimum": 0
                    }
                  },
                  "required": [
                    "kind",
                    "size"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "const": "cylinder"
                    },
                    "diameter": {
                      "type": "number",
                      "exclusiveMinimum": 0
                    },
                    "height": {
                      "type": "number",
                      "exclusiveMinimum": 0
                    }
                  },
                  "required": [
                    "kind",
                    "diameter",
                    "height"
                  ],
                  "additionalProperties": false
                }
              ]
            },
            "yaw": {
              "type": "boolean"
            },
            "sensor": {
              "type": "boolean"
            },
            "label": {
              "type": "string",
              "maxLength": 48
            },
            "material": {
              "$ref": "#/$defs/MaterialRef"
            },
            "mesh": {
              "anyOf": [
                {
                  "const": false
                },
                {
                  "type": "object",
                  "properties": {
                    "shape": {
                      "$ref": "#/$defs/MeshShape"
                    },
                    "y": {
                      "type": "number"
                    }
                  },
                  "required": [],
                  "additionalProperties": false
                }
              ]
            },
            "body": {
              "enum": [
                "platform",
                "own"
              ],
              "type": "string"
            },
            "reset": {
              "type": "boolean"
            }
          },
          "required": [
            "type",
            "y",
            "shape"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "pinRows"
            },
            "spacing": {
              "type": "number",
              "exclusiveMinimum": 0
            },
            "evenOffsets": {
              "type": "array",
              "items": {
                "type": "number"
              }
            },
            "oddOffsets": {
              "type": "array",
              "items": {
                "type": "number"
              }
            },
            "pinHeight": {
              "type": "number",
              "exclusiveMinimum": 0
            },
            "pinRadius": {
              "type": "number",
              "exclusiveMinimum": 0
            },
            "meshDiameter": {
              "type": "number",
              "exclusiveMinimum": 0
            },
            "lift": {
              "type": "number"
            },
            "edgeMargin": {
              "type": "number",
              "minimum": 0
            },
            "restitution": {
              "type": "number",
              "minimum": 0
            },
            "label": {
              "type": "string",
              "maxLength": 48
            },
            "material": {
              "$ref": "#/$defs/MaterialRef"
            }
          },
          "required": [
            "type",
            "spacing",
            "evenOffsets",
            "oddOffsets",
            "pinHeight",
            "pinRadius"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "arcPylon"
            },
            "at": {
              "$ref": "#/$defs/Placement"
            },
            "material": {
              "$ref": "#/$defs/MaterialRef"
            }
          },
          "required": [
            "type"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "decor"
            },
            "parent": {
              "const": "spinner"
            },
            "items": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "at": {
                    "$ref": "#/$defs/Placement"
                  },
                  "local": {
                    "$ref": "#/$defs/Vec3"
                  },
                  "to": {
                    "$ref": "#/$defs/Placement"
                  },
                  "tubeRadius": {
                    "type": "number",
                    "exclusiveMinimum": 0
                  },
                  "shape": {
                    "$ref": "#/$defs/MeshShape"
                  },
                  "rotationDeg": {
                    "$ref": "#/$defs/Vec3"
                  },
                  "material": {
                    "$ref": "#/$defs/MaterialRef"
                  }
                },
                "required": [],
                "additionalProperties": false
              },
              "minItems": 1
            }
          },
          "required": [
            "type",
            "items"
          ],
          "additionalProperties": false
        }
      ]
    }
  }
}
