{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://mantismusic.app/docs/schemas/1.1/theme.schema.json",
  "title": "Mantis theme (theme.json), format 1",
  "type": "object",
  "required": ["mantisTheme", "id", "name", "colours", "fonts"],
  "properties": {
    "mantisTheme": { "const": 1 },
    "id": { "type": "string", "pattern": "^[a-z0-9-]+$" },
    "name": { "type": "string", "minLength": 1 },
    "colours": {
      "type": "object",
      "required": ["mode", "fallback"],
      "properties": {
        "mode": { "enum": ["cover", "fixed"] },
        "fallback": {
          "type": "object",
          "required": ["bg", "ink", "accent", "muted"],
          "properties": {
            "bg": { "$ref": "#/$defs/hex" }, "ink": { "$ref": "#/$defs/hex" },
            "accent": { "$ref": "#/$defs/hex" }, "muted": { "$ref": "#/$defs/hex" }
          }
        }
      }
    },
    "fonts": {
      "type": "object",
      "required": ["poster", "text"],
      "properties": { "poster": { "$ref": "#/$defs/font" }, "text": { "$ref": "#/$defs/font" } }
    },
    "shape": { "type": "object", "properties": { "radius": { "type": "number", "minimum": 0 }, "coverRadius": { "type": "number", "minimum": 0 } } },
    "layout": {
      "type": "object",
      "properties": {
        "stage": { "type": "string" },
        "lyrics": { "type": "string" },
        "wallColumns": { "type": "object", "properties": { "phone": { "type": "integer", "minimum": 1 }, "wide": { "type": "integer", "minimum": 1 } } }
      }
    },
    "visualiser": { "type": "object", "properties": { "look": { "type": "string" } } }
  },
  "$defs": {
    "hex": { "type": "string", "pattern": "^#[0-9a-fA-F]{6}$" },
    "font": {
      "type": "object",
      "required": ["family"],
      "properties": {
        "family": { "type": "string", "minLength": 1 },
        "weight": { "type": "integer", "minimum": 100, "maximum": 900 },
        "url": { "type": "string", "pattern": "^https?://" }
      }
    }
  }
}
