{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://supercards.io/schemas/deck-v1.json",
  "title": "SuperCards Deck File",
  "description": "Deck metadata written by the SuperCards desktop app at {DeckFolder}/deck.json. Card content lives in one file per card under cards/ (see https://supercards.io/schemas/card-v1.json); ordering lives in card_order.json. Unknown fields are ignored by readers. All timestamps are Unix epoch milliseconds.",
  "type": "object",
  "required": ["formatVersion", "id", "title", "style", "settings", "stats", "createdAt", "updatedAt"],
  "properties": {
    "$schema": {
      "type": "string",
      "description": "Reference to this schema."
    },
    "formatVersion": {
      "type": "string",
      "pattern": "^1\\.",
      "description": "Native deck format version (currently \"1.0.0\")."
    },
    "id": {
      "type": "string",
      "description": "Stable deck identifier. The Brain Dump capture deck always uses \"brain_dump_deck\"."
    },
    "title": { "type": "string" },
    "summary": { "type": "string" },
    "coverImage": {
      "type": "string",
      "description": "Cover image filename, when set."
    },
    "source": {
      "type": "string",
      "description": "Provenance, e.g. \"Generated by Claude from workout.pdf\" for imported decks."
    },
    "style": {
      "type": "object",
      "required": ["color", "pattern"],
      "properties": {
        "color": {
          "type": "string",
          "description": "Deck color as a hex string, e.g. \"#FFFFFF\"."
        },
        "pattern": {
          "type": "string",
          "enum": ["blank", "classic", "grid"],
          "description": "Default paper-style background pattern."
        }
      }
    },
    "settings": {
      "type": "object",
      "required": ["defaultCardSize", "isLocked"],
      "properties": {
        "defaultCardSize": {
          "type": "string",
          "enum": ["small", "medium", "large"]
        },
        "isLocked": {
          "type": "boolean",
          "description": "When true, card order is locked (sequence matters for this deck)."
        },
        "defaultTemplateId": { "type": "string" }
      }
    },
    "stats": {
      "type": "object",
      "required": ["cardCount"],
      "properties": {
        "cardCount": { "type": "integer" }
      }
    },
    "thumbnails": {
      "type": "array",
      "items": { "type": "string" },
      "description": "Preview thumbnail paths, when generated."
    },
    "createdAt": {
      "type": "integer",
      "description": "Unix epoch milliseconds."
    },
    "updatedAt": {
      "type": "integer",
      "description": "Unix epoch milliseconds."
    }
  }
}
