{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://codex.glimmerfall.online/schemas/glimmerfall-cards.schema.json",
  "title": "GlimmerFall Oracle Card Checklist",
  "description": "Schema for the 322-card First Edition: The Awakening checklist, generated from the studio Blob manifest. The file is a JSON array of card objects; `number` is the canonical sort key and `id` the stable slug.",
  "type": "array",
  "minItems": 1,
  "maxItems": 322,
  "items": {
    "$ref": "#/$defs/card"
  },
  "$defs": {
    "card": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "number",
        "collectorNumber",
        "code",
        "name",
        "faction",
        "element",
        "type",
        "rarity",
        "cost",
        "power",
        "health",
        "keywords",
        "text",
        "flavor",
        "image",
        "portrait",
        "set"
      ],
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$",
          "description": "Stable kebab-case slug, unique across the set."
        },
        "number": {
          "type": "integer",
          "minimum": 1,
          "maximum": 322,
          "description": "Canonical collector position, 1-322."
        },
        "collectorNumber": {
          "type": "string",
          "pattern": "^[0-9]{3}/322$",
          "description": "Display number, e.g. 001/322."
        },
        "code": {
          "type": "string",
          "pattern": "^AWK_[0-9]{3}$",
          "description": "Print code from the manifest, e.g. AWK_001."
        },
        "name": { "type": "string", "minLength": 1, "maxLength": 80 },
        "faction": {
          "type": "string",
          "enum": ["Solari", "Umbri", "Terra", "Aether"]
        },
        "element": {
          "type": "string",
          "enum": ["Solar Light", "Void", "Verdant Root", "Celestial Mist"]
        },
        "type": {
          "type": "string",
          "enum": ["Entity", "Rite", "Flash", "Relic"]
        },
        "rarity": {
          "type": "string",
          "enum": ["Common", "Uncommon", "Rare", "Epic"]
        },
        "cost": { "type": "integer", "minimum": 0, "maximum": 12 },
        "power": {
          "type": ["integer", "null"],
          "minimum": 0,
          "maximum": 20,
          "description": "Null for Rites, Flashes and Relics."
        },
        "health": {
          "type": ["integer", "null"],
          "minimum": 0,
          "maximum": 20,
          "description": "Null for Rites, Flashes and Relics."
        },
        "keywords": {
          "type": "array",
          "maxItems": 4,
          "items": { "type": "string", "minLength": 1, "maxLength": 40 },
          "description": "Combat keywords such as Guard, Evasive or Overwhelm. Empty when the card has none."
        },
        "text": {
          "type": "string",
          "maxLength": 600,
          "description": "Rules text. May be empty for vanilla cards."
        },
        "flavor": {
          "type": ["string", "null"],
          "maxLength": 400,
          "description": "Lore text from the manifest, or null."
        },
        "image": {
          "type": "string",
          "format": "uri",
          "description": "Public framed-card render in the Blob archive."
        },
        "portrait": {
          "type": "string",
          "format": "uri",
          "description": "Public character portrait art in the Blob archive."
        },
        "set": {
          "type": "string",
          "const": "First Edition: The Awakening"
        }
      }
    }
  }
}
