"""Card details and interpretations for all 78 Tarot cards.

This module provides interpretive data (explanations, keywords, guidance) for cards.
Registry is keyed by card position (1-78), independent of deck-specific names.

Deck order: Cups (1-14), Pentacles (15-28), Swords (29-42),
           Major Arcana (43-64), Wands (65-78)

Minor suit sequencing (per suit): Ace, 2-10, Prince, Knight, Princess, Queen.

Usage:
    from tarot.card.details import CardDetailsRegistry

    registry = CardDetailsRegistry()
    details = registry.get_by_position(44)  # Get details for card at position 44

    # Or load into a card object:
    from tarot.deck import Deck
    deck = Deck()
    card = deck.cards[43]  # Card at position 44 (0-indexed)
    registry.load_into_card(card)
"""

from typing import TYPE_CHECKING, Any, Dict, Optional

from tarot.constants import build_position_map

if TYPE_CHECKING:
    from tarot.deck import Card


class CardDetailsRegistry:
    """Registry for storing interpretive data for all 78 Tarot cards.

    Uses card position (1-78) as the unique identifier, independent of deck names.
    This allows the same card details to apply across different deck variants.

    Deck order:
    - 1-14: Cups (Ace, Ten, 2-9, Knight, Prince, Princess, Queen)
    - 15-28: Pentacles (same structure)
    - 29-42: Swords (same structure)
    - 43-64: Major Arcana (Fool through Universe)
    - 65-78: Wands (same structure)
    """

    def __init__(self) -> None:
        """Initialize the card details registry with interpretive data."""
        self._details: Dict[str, Dict[str, Any]] = self._build_registry()
        # Map card positions (1-78) to registry keys
        self._position_map = self._build_position_map()

    @staticmethod
    def key_to_roman(key: int) -> str:
        """
        Convert a numeric key to Roman numerals.

        Args:
            key: The numeric key (0-21 for major arcana)

        Returns:
            Roman numeral representation (e.g., 21 -> "XXI", 0 -> "o")
        """
        # Special case: 0 -> "o" (letter O for The Fool)
        if key == 0:
            return "o"

        val = [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1]
        syms = ["M", "CM", "D", "CD", "C", "XC", "L", "XL", "X", "IX", "V", "IV", "I"]
        roman_num = ""
        i = 0
        while key > 0:
            for _ in range(key // val[i]):
                roman_num += syms[i]
                key -= val[i]
            i += 1
        return roman_num if roman_num else "o"

    def _build_position_map(self) -> Dict[int, str]:
        """
        Build a mapping from card position (1-78) to registry key.

        Returns:
            Dictionary mapping position to registry key
        """
        return build_position_map()

    def get_by_position(self, position: int) -> Optional[Dict[str, Any]]:
        """
        Get details for a card by its position (1-78).

        Args:
            position: Card position (1-78)

        Returns:
            Dictionary containing card details, or None if not found
        """
        registry_key = self._position_map.get(position)
        if registry_key is None:
            return None
        return self._details.get(registry_key)

    def _build_registry(self) -> Dict[str, Dict[str, Any]]:
        """Build the interpretive data registry (card structure comes from Deck).

        Stores only unique interpretive data (explanation, keywords, guidance).
        Card names and structure are sourced from Deck for DRY compliance.
        """
        return {
            # Major Arcana (0-21) - Interpretive data only
            "o": {
                "explanation": {
                    "summary": "The Fool represents new beginnings, innocence, and spontaneity. This card signifies a fresh start or embarking on a new journey with optimism and faith.",
                    "waite": "The Fool, Mate, or Unwise Man. Court de Gebelin places it at the head of the whole series as the zero or negative which is presupposed by numeration, and as this is a simpler so also it is a better arrangement. It has been abandoned because in later times the cards have been attributed to the letters of the Hebrew alphabet, and there has been apparently some difficulty about allocating the zero symbol satisfactorily in a sequence of letters all of which signify numbers. In the present reference of the card to the letter Shin, which corresponds to 200, the difficulty or the unreason remains. The truth is that the real arrangement of the cards has never transpired. The Fool carries a wallet; he is looking over his shoulder and does not know that he is on the brink of a precipice; but a dog or other animal--some call it a tiger--is attacking him from behind, and he is hurried to his destruction unawares.",
                },
                "interpretation": "Beginning of the Great Work, innocence; a fool for love; divine madness. Reason is transcended. Take the leap. Gain or loss through foolish actions.",
                "keywords": ["new beginnings", "innocence", "faith", "spontaneity", "potential"],
                "reversed_keywords": ["recklessness", "naivety", "poor judgment", "folly"],
                "guidance": "Trust in the unfolding of your path. Embrace new opportunities with awareness and openness.",
            },
            "I": {
                "explanation": {
                    "summary": "The Magician embodies manifestation, resourcefulness, and personal power. This card shows mastery of skills and the ability to turn ideas into reality.",
                    "waite": "The Magus, Magician, or juggler, the caster of the dice and mountebank, in the world of vulgar trickery. This is the colportage interpretation, and it has the same correspondence with the real symbolical meaning that the use of the Tarot in fortune-telling has with its mystic construction according to the secret science of symbolism. I should add that many independent students of the subject, following their own lights, have produced individual sequences of meaning in respect of the Trumps Major, and their lights are sometimes suggestive, but they are not the true lights.",
                },
                "interpretation": "Communication; Conscious Will; the process of continuous creation; ambiguity; deceptionl Things may not be as they appear. Concentration, meditation; mind used to direct the Will. Manipulation; crafty maneuverings.",
                "keywords": [
                    "manifestation",
                    "resourcefulness",
                    "power",
                    "inspired action",
                    "concentration",
                ],
                "reversed_keywords": [
                    "manipulation",
                    "poor planning",
                    "untapped talents",
                    "lack of direction",
                ],
                "guidance": "Focus your energy and intention on what you want to manifest. You have the tools and talents you need.",
            },
            "II": {
                "explanation": {
                    "summary": "The High Priestess represents intuition, sacred knowledge, and the subconscious mind. She embodies mystery and inner wisdom.",
                    "waite": "The High Priestess, the Pope Joan, or Female Pontiff; early expositors have sought to term this card the Mother, or Pope's Wife, which is opposed to the symbolism. It is sometimes held to represent the Divine Law and the Gnosis, in which case the Priestess corresponds to the idea of the Shekinah. She is the Secret Tradition and the higher sense of the instituted Mysteries.",
                },
                "interpretation": "Symbol of highest initiation; link between the archetypal and Formative Worlds. An initiatrixl Wooing by enchantment. possibility. The Idea behind the Form. Fluctuationl Time may not be right for a decision concerning mundane matters.",
                "keywords": [
                    "intuition",
                    "sacred knowledge",
                    "divine feminine",
                    "the subconscious",
                    "mystery",
                ],
                "reversed_keywords": [
                    "hidden information",
                    "silence",
                    "disconnection from intuition",
                    "superficiality",
                ],
                "guidance": "Listen to your inner voice. The answers you seek lie within. Trust the wisdom of your intuition.",
            },
            "III": {
                "explanation": {
                    "summary": "The Empress symbolizes abundance, fertility, and nurturing energy. She represents creativity, sensuality, and the power of manifestation through nurturing.",
                    "waite": "The Empress, who is sometimes represented with full face, while her correspondence, the Emperor, is in profile. As there has been some tendency to ascribe a symbolical significance to this distinction, it seems desirable to say that it carries no inner meaning. The Empress has been connected with the ideas of universal fecundity and in a general sense with activity.",
                },
                "interpretation": "The Holy Grail. love unites the Will. Love; beauty; friendship; success; passive balance. The feminine point of view. The door is open. Disregard the details and concentrate on the big picture.",
                "keywords": [
                    "abundance",
                    "fertility",
                    "femininity",
                    "beauty",
                    "nature",
                    "creativity",
                ],
                "reversed_keywords": [
                    "dependency",
                    "creative block",
                    "neediness",
                    "underdevelopment",
                ],
                "guidance": "Nurture yourself and others. Allow yourself to enjoy the fruits of your labor and appreciate beauty.",
            },
            "IV": {
                "explanation": {
                    "summary": "The Emperor represents authority, leadership, and established power. He embodies structure, discipline, and protection through strength and control.",
                    "waite": "The Emperor, by imputation the spouse of the former. He is occasionally represented as wearing, in addition to his personal insignia, the stars or ribbons of some order of chivalry. I mention this to shew that the cards are a medley of old and new emblems.",
                },
                "interpretation": "Creative wisdom radiating upon the organized man and woman. Domination after conquest; quarrelsomeness; paternal love; ambition. Thought ruled by creative, masculine, fiery energy. Stubbornness; war; authority; energy in its most temporal form. Swift immpermaent action over confidence.",
                "keywords": [
                    "authority",
                    "leadership",
                    "power",
                    "structure",
                    "protection",
                    "discipline",
                ],
                "reversed_keywords": [
                    "weakness",
                    "ineffectual leadership",
                    "lack of discipline",
                    "tyranny",
                ],
                "guidance": "Step into your power with confidence. Establish clear boundaries and structure. Lead by example.",
            },
            "V": {
                "explanation": {
                    "summary": "The Hierophant represents tradition, conventional wisdom, and spiritual authority. This card embodies education, ceremony, and moral values.",
                    "waite": "The High Priest or Hierophant, called also Spiritual Father, and more commonly and obviously the Pope. It seems even to have been named the Abbot, and then its correspondence, the High Priestess, was the Abbess or Mother of the Convent. Both are arbitrary names. The insignia of the figures are papal, and in such case the High Priestess is and can be only the Church, to whom Pope and priests are married by the spiritual rite of ordination.",
                },
                "interpretation": "The Holy Guardian Angel. The uniting of t hat which is above with that which is below. Love is indicated, but the nature of that love is not yet to be revealed. Inspiration; teaching; organization; discipline; strength; endurance; toil; help from superiors.",
                "keywords": ["tradition", "spirituality", "wisdom", "ritual", "morality", "ethics"],
                "reversed_keywords": [
                    "rebellion",
                    "unconventionality",
                    "questioning authority",
                    "dogmatism",
                ],
                "guidance": "Seek guidance from established wisdom. Respect traditions while finding your own spiritual path.",
            },
            "VI": {
                "explanation": {
                    "summary": "The Lovers represents relationships, values alignment, and the union of opposites. It signifies choice, intimacy, and deep connection.",
                    "waite": "The Lovers or Marriage. This symbol has undergone many variations, as might be expected from its subject. In the eighteenth century form, by which it first became known to the world of archæological research, it is really a card of married life, shewing father and mother, with their child placed between them; and the pagan Cupid above, in the act of flying his shaft, is, of course, a misapplied emblem.",
                },
                "interpretation": "Intuition. Be open to your own inner voice. A well-intended, arranged marriage. An artificial union. The need to make a choice with awareness of consequences union; analysis followed by synthesis; indecision; instability; superficiality.",
                "keywords": ["relationships", "love", "union", "values", "choice", "alignment"],
                "reversed_keywords": [
                    "disharmony",
                    "misalignment",
                    "conflict",
                    "communication breakdown",
                ],
                "guidance": "Choose with your heart aligned with your values. Deep connection requires vulnerability and honesty.",
            },
            "VII": {
                "explanation": {
                    "summary": "The Chariot embodies willpower, determination, and control through focused intention. It represents triumph through discipline and forward momentum.",
                    "waite": "The Chariot. This is represented in some extant codices as being drawn by two sphinxes, and the device is in consonance with the symbolism, but it must not be supposed that such was its original form; the variation was invented to support a particular historical hypothesis. In the eighteenth century white horses were yoked to the car. As regards its usual name, the lesser stands for the greater; it is really the King in his triumph.",
                },
                "interpretation": "Light in the darkness. The burden you carry may be the Holy Grail. Faithfulness; hope; obedience; a protective relationship; firm, even violent adherance to dogma or tradition. Glory; riches; englightened civilization; victory; triumph; chain of command.",
                "keywords": [
                    "determination",
                    "willpower",
                    "control",
                    "momentum",
                    "victory",
                    "focus",
                ],
                "reversed_keywords": ["lack of control", "haste", "resistance", "moving backward"],
                "guidance": "Take the reins of your life. Move forward with determination and clear direction. You have the power.",
            },
            "VIII": {
                "explanation": {
                    "summary": "Strength represents inner power, courage, and compassion. It shows mastery through gentleness and the ability to face challenges with calm confidence.",
                    "waite": "Fortitude. This is one of the cardinal virtues, of which I shall speak later. The female figure is usually represented as closing the mouth of a lion. In the earlier form which is printed by Court de Gebelin, she is obviously opening it. The first alternative is better symbolically, but either is an instance of strength in its conventional understanding, and conveys the idea of mastery.",
                },
                "interpretation": "Equilibrium; karmic law; the dance of life; all possibilities. The woman satisfied. Balance; weigh each thought against its opposite. Lawsuits; treaties. Pause and look before you leap.",
                "keywords": [
                    "strength",
                    "courage",
                    "patience",
                    "compassion",
                    "control",
                    "confidence",
                ],
                "reversed_keywords": [
                    "weakness",
                    "self-doubt",
                    "lack of composure",
                    "poor control",
                ],
                "guidance": "True strength comes from within. Face challenges with courage and compassion for yourself and others.",
            },
            "IX": {
                "explanation": {
                    "summary": "The Hermit represents introspection, spiritual seeking, and inner guidance. This card embodies solitude, wisdom gained through reflection, and self-discovery.",
                    "waite": "The Hermit, as he is termed in common parlance, stands next on the list; he is also the Capuchin, and in more philosophical language the Sage. He is said to be in search of that Truth which is located far off in the sequence, and of justice which has preceded him on the way. But this is a card of attainment, as we shall see later, rather than a card of quest.",
                },
                "interpretation": "Divine seed of all things. By silence comes inspiration and wisdom. Wandering alone; temporary solitude; creative contemplation; a virgin. Retirement from involvement in current events.",
                "keywords": [
                    "introspection",
                    "spiritual seeking",
                    "inner light",
                    "wisdom",
                    "solitude",
                    "truth",
                ],
                "reversed_keywords": [
                    "loneliness",
                    "isolation",
                    "lost",
                    "paranoia",
                    "disconnection",
                ],
                "guidance": "Take time for introspection and self-discovery. Your inner light guides your path. Seek solitude for wisdom.",
            },
            "X": {
                "explanation": {
                    "summary": "The Wheel of Fortune represents cycles, destiny, and the turning points of life. It embodies luck, karma, and the natural ebb and flow of existence.",
                    "waite": "The Wheel of Fortune. There is a current Manual of Cartomancy which has obtained a considerable vogue in England, and amidst a great scattermeal of curious things to no purpose has intersected a few serious subjects. In its last and largest edition it treats in one section of the Tarot; which--if I interpret the author rightly--it regards from beginning to end as the Wheel of Fortune.",
                },
                "interpretation": "Continual change. In the midst of revolving phenomena, reaach joyously the motionless center. Carefree love; wanton pleasure; amusement; fun; change of fortune, usually good.",
                "keywords": ["fate", "destiny", "cycles", "fortune", "karma", "turning point"],
                "reversed_keywords": [
                    "bad luck",
                    "resistance to change",
                    "broken cycles",
                    "misfortune",
                ],
                "guidance": "Trust in the cycles of life. What goes up must come down. Embrace change as part of your journey.",
            },
            "XI": {
                "explanation": {
                    "summary": "Justice represents fairness, truth, and balance. It embodies accountability, clear judgment, and the consequences of actions both past and present.",
                    "waite": "Justice. That the Tarot, though it is of all reasonable antiquity, is not of time immemorial, is shewn by this card, which could have been presented in a much more archaic manner. Those, however, who have gifts of discernment in matters of this kind will not need to be told that age is in no sense of the essence of the consideration.",
                },
                "interpretation": "Understanding; the Will of New Aeon; passion; sense smitten with ecstasy. let love devour all. Energy independent of reason. Strength; courage; utilization of magical power.",
                "keywords": [
                    "justice",
                    "fairness",
                    "truth",
                    "cause and effect",
                    "balance",
                    "accountability",
                ],
                "reversed_keywords": ["injustice", "bias", "lack of accountability", "dishonesty"],
                "guidance": "Seek the truth and act with fairness. Take responsibility for your actions. Balance is key.",
            },
            "XII": {
                "explanation": {
                    "summary": "The Hanged Man represents suspension, letting go, and seeing things from a new perspective. It embodies surrender, pause, and gaining wisdom through sacrifice.",
                    "waite": "The Hanged Man. This is the symbol which is supposed to represent Prudence, and Éliphas Lévi says, in his most shallow and plausible manner, that it is the adept bound by his engagements. The figure of a man is suspended head-downwards from a gibbet, to which he is attached by a rope about one of his ankles.",
                },
                "interpretation": "Redemption, sacrifice, annihilation in the beloved; martyrdom; loss; torment; suspension; death; suffering.",
                "keywords": [
                    "suspension",
                    "restriction",
                    "letting go",
                    "new perspective",
                    "surrender",
                    "pause",
                ],
                "reversed_keywords": [
                    "resistance",
                    "stalling",
                    "unwillingness to change",
                    "impatience",
                ],
                "guidance": "Pause and reflect. What are you holding onto? Surrender control and trust the process.",
            },
            "XIII": {
                "explanation": {
                    "summary": "Death represents transformation, endings, and new beginnings. This card embodies major life transitions, the release of the old, and inevitable change.",
                    "waite": "Death. The method of presentation is almost invariable, and embodies a bourgeois form of symbolism. The scene is the field of life, and amidst ordinary rank vegetation there are living arms and heads protruding from the ground. One of the heads is crowned, and a skeleton with a great scythe is in the act of mowing it.",
                },
                "interpretation": "End of cycle; transformation; raw sexuality. Sex is death. Stress becomes intolerable. Any change is welcome. Time; age; unexpected change; death.",
                "keywords": [
                    "transformation",
                    "transition",
                    "endings",
                    "beginnings",
                    "change",
                    "acceptance",
                ],
                "reversed_keywords": [
                    "resistance to change",
                    "stagnation",
                    "missed opportunity",
                    "delay",
                ],
                "guidance": "Release what no longer serves you. Transformation is inevitable. Trust in the cycle of death and rebirth.",
            },
            "XIV": {
                "explanation": {
                    "summary": "Temperance represents balance, moderation, and harmony. It embodies blending of opposites, inner peace through balance, and finding your rhythm.",
                    "waite": "Temperance. The winged figure of a female--who, in opposition to all doctrine concerning the hierarchy of angels, is usually allocated to this order of ministering spirits--is pouring liquid from one pitcher to another. In his last work on the Tarot, Dr. Papus abandons the traditional form and depicts a woman wearing an Egyptian head-dress.",
                },
                "interpretation": "Transmutation through union of opposites. A perfect marriage exalts and transforms each partner. The scientific method. Success follows complex maneuvers.",
                "keywords": ["balance", "moderation", "harmony", "patience", "timing", "peace"],
                "reversed_keywords": ["imbalance", "excess", "conflict", "intemperance", "discord"],
                "guidance": "Seek balance in all things. Blend opposing forces. Find your rhythm through moderation and patience.",
            },
            "XV": {
                "explanation": {
                    "summary": "The Devil represents bondage, materialism, and shadow aspects of self. It embodies addictions, illusions, and the consequences of giving away personal power.",
                    "waite": "The Devil. In the eighteenth century this card seems to have been rather a symbol of merely animal impudicity. Except for a fantastic head-dress, the chief figure is entirely naked; it has bat-like wings, and the hands and feet are represented by the claws of a bird.",
                },
                "interpretation": "Thou hast no right but to do thy will. Obession; temptation; ecstasy found in every phenomenon; creative action, yet sublimely careless of result; unscrupulous ambition; strength.",
                "keywords": [
                    "bondage",
                    "materialism",
                    "playfulness",
                    "shadow self",
                    "sexuality",
                    "excess",
                ],
                "reversed_keywords": ["freedom", "detachment", "reclaiming power", "breaking free"],
                "guidance": "Examine what binds you. Acknowledge your shadow. You hold the key to your own freedom.",
            },
            "XVI": {
                "explanation": {
                    "summary": "The Tower represents sudden disruption, revelation, and breakthrough through crisis. It embodies sudden change, truth revealed, and necessary destruction.",
                    "waite": "The Tower struck by Lightning. Its alternative titles are: Castle of Plutus, God's House and the Tower of Babel. In the last case, the figures falling therefrom are held to be Nimrod and his minister. It is assuredly a card of confusion, and the design corresponds, broadly speaking, to any of the designations except Maison Dieu.",
                },
                "interpretation": "Escape from the prison of organized life; renunciation of love; quarreling. Plans are destroyed. War; danger; sudden death.",
                "keywords": [
                    "sudden change",
                    "upheaval",
                    "revelation",
                    "breakdown",
                    "breakthrough",
                    "chaos",
                ],
                "reversed_keywords": [
                    "resistance to change",
                    "averted crisis",
                    "delay",
                    "stagnation",
                ],
                "guidance": "Crisis brings clarity. Though change is sudden and jarring, it clears away the false and brings truth.",
            },
            "XVII": {
                "explanation": {
                    "summary": "The Star represents hope, guidance, and inspiration. It embodies clarity of purpose, spiritual insight, and the light that guides your path forward.",
                    "waite": "The Star, Dog-Star, or Sirius, also called fantastically the Star of the Magi. Grouped about it are seven minor luminaries, and beneath it is a naked female figure, with her left knee upon the earth and her right foot upon the water. She is in the act of pouring fluids from two vessels.",
                },
                "interpretation": "Clairvoyance; visions; drams; hope; love; yearning; realization of inexhaustible possibilities; dreaminess; unexpected help; renewal.",
                "keywords": ["hope", "faith", "inspiration", "vision", "guidance", "spirituality"],
                "reversed_keywords": [
                    "hopelessness",
                    "despair",
                    "lack of direction",
                    "lost",
                    "obscured",
                ],
                "guidance": "Let your inner light shine. Trust in your vision. Hope and guidance light your path forward.",
            },
            "XVIII": {
                "explanation": {
                    "summary": "The Moon represents illusion, intuition, and the subconscious mind. It embodies mystery, dreams, and navigating by inner knowing rather than sight.",
                    "waite": "The Moon. Some eighteenth-century cards shew the luminary on its waning side; in the debased edition of Etteilla, it is the moon at night in her plenitude, set in a heaven of stars; of recent years the moon is shewn on the side of her increase. In nearly all presentations she is shining brightly and shedding the moisture of fertilizing dew in great drops.",
                },
                "interpretation": "The Dark night of the soul; deception; falsehood; illusion; madness; the threshold of significant change.",
                "keywords": [
                    "illusion",
                    "intuition",
                    "uncertainty",
                    "subconscious",
                    "dreams",
                    "mystery",
                ],
                "reversed_keywords": [
                    "clarity",
                    "truth revealed",
                    "release from illusion",
                    "awakening",
                ],
                "guidance": "Trust your intuition to navigate mystery. What appears illusory contains deeper truths worth exploring.",
            },
            "XIX": {
                "explanation": {
                    "summary": "The Sun represents joy, clarity, and vitality. It embodies success, positive energy, and the radiance of authentic self-expression.",
                    "waite": "The Sun. The luminary is distinguished in older cards by chief rays that are waved and salient alternately and by secondary salient rays. It appears to shed its influence on earth not only by light and heat, but--like the moon--by drops of dew.",
                },
                "interpretation": "Lord of the New Aeon. Spiritual emancipation. Pleasure; shamelessness; vanity; frankness. Freedom brings sanity. Glory; riches; enlightened civilization.",
                "keywords": ["success", "joy", "clarity", "vitality", "warmth", "authenticity"],
                "reversed_keywords": ["temporary darkness", "lost vitality", "setback", "sadness"],
                "guidance": "Celebrate your success. Let your authentic self shine. Joy and clarity light your way.",
            },
            "XX": {
                "explanation": {
                    "summary": "Judgement represents awakening, calling, and significant decisions. It embodies reckoning, rebirth, and responding to a higher calling.",
                    "waite": "The Last judgment. I have spoken of this symbol already, the form of which is essentially invariable, even in the Etteilla set. An angel sounds his trumpet per sepulchra regionum, and the dead arise. It matters little that Etteilla omits the angel, or that Dr. Papus substitutes a ridiculous figure.",
                },
                "interpretation": "Let every act be an act of Worship; let every act be an act of Love. Final decision; judgement. Learn from the past. Prepare for the future.",
                "keywords": [
                    "awakening",
                    "calling",
                    "judgment",
                    "rebirth",
                    "evaluation",
                    "absolution",
                ],
                "reversed_keywords": [
                    "doubt",
                    "self-doubt",
                    "harsh judgment",
                    "reluctance to change",
                ],
                "guidance": "Answer your higher calling. Evaluate with compassion. A significant awakening or decision awaits.",
            },
            "XXI": {
                "explanation": {
                    "summary": "The World represents completion, wholeness, and fulfillment. It embodies the end of a cycle, achievement of goals, and a sense of unity.",
                    "waite": "The World, the Universe, or Time. The four living creatures of the Apocalypse and Ezekiel's vision, attributed to the evangelists in Christian symbolism, are grouped about an elliptic garland, as if it were a chain of flowers intended to symbolize all sensible things; within this garland there is the figure of a woman, whom the wind has girt about the loins with a light scarf, and this is all her vesture.",
                },
                "interpretation": "Completion of the Greatk Work; patience; perseverance; stubbornness; serious meditation. Work accomplished.",
                "keywords": [
                    "completion",
                    "fulfillment",
                    "wholeness",
                    "travel",
                    "unity",
                    "achievement",
                ],
                "reversed_keywords": ["incomplete", "blocked", "separation", "seeking closure"],
                "guidance": "A significant cycle completes. You have achieved wholeness. Yet every ending is a new beginning.",
            },
            # Minor Arcana - Swords
            "Ace of Swords": {
                "explanation": {
                    "summary": "A hand issues from a cloud, grasping as word, the point of which is encircled by a crown.",
                    "waite": "A hand issues from a cloud, grasping as word, the point of which is encircled by a crown. Divinatory Meanings: Triumph, the excessive degree in everything, conquest, triumph of force. It is a card of great force, in love as well as in hatred. The crown may carry a much higher significance than comes usually within the sphere of fortune-telling. Reversed: The same, but the results are disastrous; another account says--conception, childbirth, augmentation, multiplicity.",
                },
                "interpretation": "",
                "keywords": [],
                "reversed_keywords": [],
                "guidance": "",
            },
            "Two of Swords": {
                "explanation": {
                    "summary": "A hoodwinked female figure balances two swords upon her shoulders.",
                    "waite": "A hoodwinked female figure balances two swords upon her shoulders. Divinatory Meanings: Conformity and the equipoise which it suggests, courage, friendship, concord in a state of arms; another reading gives tenderness, affection, intimacy. The suggestion of harmony and other favourable readings must be considered in a qualified manner, as Swords generally are not symbolical of beneficent forces in human affairs. Reversed: Imposture, falsehood, duplicity, disloyalty.",
                },
                "interpretation": "",
                "keywords": [],
                "reversed_keywords": [],
                "guidance": "",
            },
            "Three of Swords": {
                "explanation": {
                    "summary": "Three swords piercing a heart; cloud and rain behind.",
                    "waite": "Three swords piercing a heart; cloud and rain behind. Divinatory Meanings: Removal, absence, delay, division, rupture, dispersion, and all that the design signifies naturally, being too simple and obvious to call for specific enumeration. Reversed: Mental alienation, error, loss, distraction, disorder, confusion.",
                },
                "interpretation": "",
                "keywords": [],
                "reversed_keywords": [],
                "guidance": "",
            },
            "Four of Swords": {
                "explanation": {
                    "summary": "The effigy of a knight in the attitude of prayer, at full length upon his tomb.",
                    "waite": "The effigy of a knight in the attitude of prayer, at full length upon his tomb. Divinatory Meanings: Vigilance, retreat, solitude, hermit's repose, exile, tomb and coffin. It is these last that have suggested the design. Reversed: Wise administration, circumspection, economy, avarice, precaution, testament.",
                },
                "interpretation": "",
                "keywords": [],
                "reversed_keywords": [],
                "guidance": "",
            },
            "Five of Swords": {
                "explanation": {
                    "summary": "A disdainful man looks after two retreating and dejected figures.",
                    "waite": "A disdainful man looks after two retreating and dejected figures. Their swords lie upon the ground. He carries two others on his left shoulder, and a third sword is in his right hand, point to earth. He is the master in possession of the field. Divinatory Meanings: Degradation, destruction, revocation, infamy, dishonour, loss, with the variants and analogues of these. Reversed: The same; burial and obsequies.",
                },
                "interpretation": "",
                "keywords": [],
                "reversed_keywords": [],
                "guidance": "",
            },
            "Six of Swords": {
                "explanation": {
                    "summary": "A ferryman carrying passengers in his punt to the further shore.",
                    "waite": "A ferryman carrying passengers in his punt to the further shore. The course is smooth, and seeing that the freight is light, it may be noted that the work is not beyond his strength. Divinatory Meanings: journey by water, route, way, envoy, commissionary, expedient. Reversed: Declaration, confession, publicity; one account says that it is a proposal of love.",
                },
                "interpretation": "",
                "keywords": [],
                "reversed_keywords": [],
                "guidance": "",
            },
            "Seven of Swords": {
                "explanation": {
                    "summary": "A man in the act of carrying away five swords rapidly; the two others of the card remain stuck in the ground.",
                    "waite": "A man in the act of carrying away five swords rapidly; the two others of the card remain stuck in the ground. A camp is close at hand. Divinatory Meanings: Design, attempt, wish, hope, confidence; also quarrelling, a plan that may fail, annoyance. The design is uncertain in its import, because the significations are widely at variance with each other. Reversed: Good advice, counsel, instruction, slander, babbling.",
                },
                "interpretation": "",
                "keywords": [],
                "reversed_keywords": [],
                "guidance": "",
            },
            "Eight of Swords": {
                "explanation": {
                    "summary": "A woman, bound and hoodwinked, with the swords of the card about her.",
                    "waite": "A woman, bound and hoodwinked, with the swords of the card about her. Yet it is rather a card of temporary durance than of irretrievable bondage. Divinatory Meanings: Bad news, violent chagrin, crisis, censure, power in trammels, conflict, calumny; also sickness. Reversed: Disquiet, difficulty, opposition, accident, treachery; what is unforeseen; fatality.",
                },
                "interpretation": "",
                "keywords": [],
                "reversed_keywords": [],
                "guidance": "",
            },
            "Nine of Swords": {
                "explanation": {
                    "summary": "One seated on her couch in lamentation, with the swords over her.",
                    "waite": "One seated on her couch in lamentation, with the swords over her. She is as one who knows no sorrow which is like unto hers. It is a card of utter desolation. Divinatory Meanings: Death, failure, miscarriage, delay, deception, disappointment, despair. Reversed: Imprisonment, suspicion, doubt, reasonable fear, shame.",
                },
                "interpretation": "",
                "keywords": [],
                "reversed_keywords": [],
                "guidance": "",
            },
            "Ten of Swords": {
                "explanation": {
                    "summary": "A prostrate figure, pierced by all the swords belonging to the card.",
                    "waite": "A prostrate figure, pierced by all the swords belonging to the card. Divinatory Meanings: Whatsoever is intimated by the design; also pain, affliction, tears, sadness, desolation. It is not especially a card of violent death. Reversed: Advantage, profit, success, favour, but none of these are permanent; also power and authority.",
                },
                "interpretation": "",
                "keywords": [],
                "reversed_keywords": [],
                "guidance": "",
            },
            "Page of Swords": {
                "explanation": {
                    "summary": "A lithe, active figure holds a sword upright in both hands, while in the act of swift walking.",
                    "waite": "A lithe, active figure holds a sword upright in both hands, while in the act of swift walking. He is passing over rugged land, and about his way the clouds are collocated wildly. He is alert and lithe, looking this way and that, as if an expected enemy might appear at any moment. Divinatory Meanings: Authority, overseeing, secret service, vigilance, spying, examination, and the qualities thereto belonging. Reversed: More evil side of these qualities; what is unforeseen, unprepared state; sickness is also intimated.",
                },
                "interpretation": "",
                "keywords": [],
                "reversed_keywords": [],
                "guidance": "",
            },
            "Knight of Swords": {
                "explanation": {
                    "summary": "He is riding in full course, as if scattering his enemies.",
                    "waite": "He is riding in full course, as if scattering his enemies. In the design he is really a prototypical hero of romantic chivalry. He might almost be Galahad, whose sword is swift and sure because he is clean of heart. Divinatory Meanings: Skill, bravery, capacity, defence, address, enmity, wrath, war, destruction, opposition, resistance, ruin. There is therefore a sense in which the card signifies death, but it carries this meaning only in its proximity to other cards of fatality. Reversed: Imprudence, incapacity, extravagance.",
                },
                "interpretation": "",
                "keywords": [],
                "reversed_keywords": [],
                "guidance": "",
            },
            "Queen of Swords": {
                "explanation": {
                    "summary": "Her right hand raises the weapon vertically and the hilt rests on an arm of her royal chair the left hand is extended, the arm raised her countenance is severe but chastened; it suggests familiarity with sorrow.",
                    "waite": "Her right hand raises the weapon vertically and the hilt rests on an arm of her royal chair the left hand is extended, the arm raised her countenance is severe but chastened; it suggests familiarity with sorrow. It does not represent mercy, and, her sword notwithstanding, she is scarcely a symbol of power. Divinatory Meanings: Widowhood, female sadness and embarrassment, absence, sterility, mourning, privation, separation. Reversed: Malice, bigotry, artifice, prudery, bale, deceit.",
                },
                "interpretation": "",
                "keywords": [],
                "reversed_keywords": [],
                "guidance": "",
            },
            "King of Swords": {
                "explanation": {
                    "summary": "Whatsoever arises out of the idea of judgment and all its connexions-power, command, authority, militant intelligence, law, offices of the crown, and so forth.",
                    "waite": "Whatsoever arises out of the idea of judgment and all its connexions-power, command, authority, militant intelligence, law, offices of the crown, and so forth.",
                },
                "interpretation": "",
                "keywords": [],
                "reversed_keywords": [],
                "guidance": "",
            },
            # Minor Arcana - Cups
            "Ace of Cups": {
                "explanation": {
                    "summary": "The waters are beneath, and thereon are water-lilies; the hand issues from the cloud, holding in its palm the cup, from which four streams are pouring; a dove, bearing in its bill a cross-marked Host, descends to place the Wafer in the Cup; the dew of water is falling on all sides.",
                    "waite": "The waters are beneath, and thereon are water-lilies; the hand issues from the cloud, holding in its palm the cup, from which four streams are pouring; a dove, bearing in its bill a cross-marked Host, descends to place the Wafer in the Cup; the dew of water is falling on all sides. It is an intimation of that which may lie behind the Lesser Arcana. Divinatory Meanings: House of the true heart, joy, content, abode, nourishment, abundance, fertility; Holy Table, felicity hereof. Reversed: House of the false heart, mutation, instability, revolution.",
                },
                "interpretation": "",
                "keywords": [],
                "reversed_keywords": [],
                "guidance": "",
            },
            "Two of Cups": {
                "explanation": {
                    "summary": "A youth and maiden are pledging one another, and above their cups rises the Caduceus of Hermes, between the great wings of which there appears a lion's head.",
                    "waite": "A youth and maiden are pledging one another, and above their cups rises the Caduceus of Hermes, between the great wings of which there appears a lion's head. It is a variant of a sign which is found in a few old examples of this card. Some curious emblematical meanings are attached to it, but they do not concern us in this place. Divinatory Meanings: Love, passion, friendship, affinity, union, concord, sympathy, the interrelation of the sexes, and--as a suggestion apart from all offices of divination--that desire which is not in Nature, but by which Nature is sanctified.",
                },
                "interpretation": "",
                "keywords": [],
                "reversed_keywords": [],
                "guidance": "",
            },
            "Three of Cups": {
                "explanation": {
                    "summary": "Maidens in a garden-ground with cups uplifted, as if pledging one another.",
                    "waite": "Maidens in a garden-ground with cups uplifted, as if pledging one another. Divinatory Meanings: The conclusion of any matter in plenty, perfection and merriment; happy issue, victory, fulfilment, solace, healing, Reversed: Expedition, dispatch, achievement, end. It signifies also the side of excess in physical enjoyment, and the pleasures of the senses.",
                },
                "interpretation": "",
                "keywords": [],
                "reversed_keywords": [],
                "guidance": "",
            },
            "Four of Cups": {
                "explanation": {
                    "summary": "A young man is seated under a tree and contemplates three cups set on the grass before him; an arm issuing from a cloud offers him another cup.",
                    "waite": "A young man is seated under a tree and contemplates three cups set on the grass before him; an arm issuing from a cloud offers him another cup. His expression notwithstanding is one of discontent with his environment. Divinatory Meanings: Weariness, disgust, aversion, imaginary vexations, as if the wine of this world had caused satiety only; another wine, as if a fairy gift, is now offered the wastrel, but he sees no consolation therein. This is also a card of blended pleasure. Reversed: Novelty, presage, new instruction, new relations.",
                },
                "interpretation": "",
                "keywords": [],
                "reversed_keywords": [],
                "guidance": "",
            },
            "Five of Cups": {
                "explanation": {
                    "summary": "A dark, cloaked figure, looking sideways at three prone cups two others stand upright behind him; a bridge is in the background, leading to a small keep or holding.",
                    "waite": "A dark, cloaked figure, looking sideways at three prone cups two others stand upright behind him; a bridge is in the background, leading to a small keep or holding. Divinatory Meanings: It is a card of loss, but something remains over; three have been taken, but two are left; it is a card of inheritance, patrimony, transmission, but not corresponding to expectations; with some interpreters it is a card of marriage, but not without bitterness or frustration. Reversed: News, alliances, affinity, consanguinity, ancestry, return, false projects.",
                },
                "interpretation": "",
                "keywords": [],
                "reversed_keywords": [],
                "guidance": "",
            },
            "Six of Cups": {
                "explanation": {
                    "summary": "Children in an old garden, their cups filled with flowers.",
                    "waite": "Children in an old garden, their cups filled with flowers. Divinatory Meanings: A card of the past and of memories, looking back, as--for example--on childhood; happiness, enjoyment, but coming rather from the past; things that have vanished. Another reading reverses this, giving new relations, new knowledge, new environment, and then the children are disporting in an unfamiliar precinct. Reversed: The future, renewal, that which will come to pass presently.",
                },
                "interpretation": "",
                "keywords": [],
                "reversed_keywords": [],
                "guidance": "",
            },
            "Seven of Cups": {
                "explanation": {
                    "summary": "Strange chalices of vision, but the images are more especially those of the fantastic spirit.",
                    "waite": "Strange chalices of vision, but the images are more especially those of the fantastic spirit. Divinatory Meanings: Fairy favours, images of reflection, sentiment, imagination, things seen in the glass of contemplation; some attainment in these degrees, but nothing permanent or substantial is suggested. Reversed: Desire, will, determination, project.",
                },
                "interpretation": "",
                "keywords": [],
                "reversed_keywords": [],
                "guidance": "",
            },
            "Eight of Cups": {
                "explanation": {
                    "summary": "A man of dejected aspect is deserting the cups of his felicity, enterprise, undertaking or previous concern.",
                    "waite": "A man of dejected aspect is deserting the cups of his felicity, enterprise, undertaking or previous concern. Divinatory Meanings: The card speaks for itself on the surface, but other readings are entirely antithetical--giving joy, mildness, timidity, honour, modesty. In practice, it is usually found that the card shews the decline of a matter, or that a matter which has been thought to be important is really of slight consequence--either for good or evil. Reversed: Great joy, happiness, feasting.",
                },
                "interpretation": "",
                "keywords": [],
                "reversed_keywords": [],
                "guidance": "",
            },
            "Nine of Cups": {
                "explanation": {
                    "summary": "A goodly personage has feasted to his heart's content, and abundant refreshment of wine is on the arched counter behind him, seeming to indicate that the future is also assured.",
                    "waite": "A goodly personage has feasted to his heart's content, and abundant refreshment of wine is on the arched counter behind him, seeming to indicate that the future is also assured. The picture offers the material side only, but there are other aspects. Divinatory Meanings: Concord, contentment, physical bien-être; also victory, success, advantage; satisfaction for the Querent or person for whom the consultation is made. Reversed: Truth, loyalty, liberty; but the readings vary and include mistakes, imperfections, etc.",
                },
                "interpretation": "",
                "keywords": [],
                "reversed_keywords": [],
                "guidance": "",
            },
            "Ten of Cups": {
                "explanation": {
                    "summary": "Appearance of Cups in a rainbow; it is contemplated in wonder and ecstacy by a man and woman below, evidently husband and wife.",
                    "waite": "Appearance of Cups in a rainbow; it is contemplated in wonder and ecstacy by a man and woman below, evidently husband and wife. His right arm is about her; his left is raised upward; she raises her right arm. The two children dancing near them have not observed the prodigy but are happy after their own manner. There is a home-scene beyond. Divinatory Meanings: Contentment, repose of the entire heart; the perfection of that state; also perfection of human love and friendship; if with several picture-cards, a person who is taking charge of the Querent's interests; also the town, village or country inhabited by the Querent. Reversed: Repose of the false heart, indignation, violence.",
                },
                "interpretation": "",
                "keywords": [],
                "reversed_keywords": [],
                "guidance": "",
            },
            "Page of Cups": {
                "explanation": {
                    "summary": "A fair, pleasing, somewhat effeminate page, of studious and intent aspect, contemplates a fish rising from a cup to look at him.",
                    "waite": "A fair, pleasing, somewhat effeminate page, of studious and intent aspect, contemplates a fish rising from a cup to look at him. It is the pictures of the mind taking form. Divinatory Meanings: Fair young man, one impelled to render service and with whom the Querent will be connected; a studious youth; news, message; application, reflection, meditation; also these things directed to business. Reversed: Taste, inclination, attachment, seduction, deception, artifice.",
                },
                "interpretation": "",
                "keywords": [],
                "reversed_keywords": [],
                "guidance": "",
            },
            "Knight of Cups": {
                "explanation": {
                    "summary": "Graceful, but not warlike; riding quietly, wearing a winged helmet, referring to those higher graces of the imagination which sometimes characterize this card.",
                    "waite": "Graceful, but not warlike; riding quietly, wearing a winged helmet, referring to those higher graces of the imagination which sometimes characterize this card. He too is a dreamer, but the images of the side of sense haunt him in his vision. Divinatory Meanings: Arrival, approach--sometimes that of a messenger; advances, proposition, demeanour, invitation, incitement. Reversed: Trickery, artifice, subtlety, swindling, duplicity, fraud.",
                },
                "interpretation": "",
                "keywords": [],
                "reversed_keywords": [],
                "guidance": "",
            },
            "Queen of Cups": {
                "explanation": {
                    "summary": "Beautiful, fair, dreamy--as one who sees visions in a cup.",
                    "waite": "Beautiful, fair, dreamy--as one who sees visions in a cup. This is, however, only one of her aspects; she sees, but she also acts, and her activity feeds her dream. Divinatory Meanings: Good, fair woman; honest, devoted woman, who will do service to the Querent; loving intelligence, and hence the gift of vision; success, happiness, pleasure; also wisdom, virtue; a perfect spouse and a good mother. Reversed: The accounts vary; good woman; otherwise, distinguished woman but one not to be trusted; perverse woman; vice, dishonour, depravity.",
                },
                "interpretation": "",
                "keywords": [],
                "reversed_keywords": [],
                "guidance": "",
            },
            "King of Cups": {
                "explanation": {
                    "summary": "Fair man, man of business, law, or divinity; responsible, disposed to oblige the Querent; also equity, art and science, including those who profess science, law and art; creative intelligence.",
                    "waite": "Fair man, man of business, law, or divinity; responsible, disposed to oblige the Querent; also equity, art and science, including those who profess science, law and art; creative intelligence.",
                },
                "interpretation": "",
                "keywords": [],
                "reversed_keywords": [],
                "guidance": "",
            },
            # Minor Arcana - Pentacles
            "Ace of Pentacles": {
                "explanation": {
                    "summary": "A hand--issuing, as usual, from a cloud--holds up a pentacle.",
                    "waite": "A hand--issuing, as usual, from a cloud--holds up a pentacle. Divinatory Meanings: Perfect contentment, felicity, ecstasy; also speedy intelligence; gold. Reversed: The evil side of wealth, bad intelligence; also great riches. In any case it shews prosperity, comfortable material conditions, but whether these are of advantage to the possessor will depend on whether the card is reversed or not.",
                },
                "interpretation": "",
                "keywords": [],
                "reversed_keywords": [],
                "guidance": "",
            },
            "Two of Pentacles": {
                "explanation": {
                    "summary": "A young man, in the act of dancing, has a pentacle in either hand, and they are joined by that endless cord which is like the number 8 reversed.",
                    "waite": "A young man, in the act of dancing, has a pentacle in either hand, and they are joined by that endless cord which is like the number 8 reversed. Divinatory Meanings: On the one hand it is represented as a card of gaiety, recreation and its connexions, which is the subject of the design; but it is read also as news and messages in writing, as obstacles, agitation, trouble, embroilment. Reversed: Enforced gaiety, simulated enjoyment, literal sense, handwriting, composition, letters of exchange.",
                },
                "interpretation": "",
                "keywords": [],
                "reversed_keywords": [],
                "guidance": "",
            },
            "Three of Pentacles": {
                "explanation": {
                    "summary": "A sculptor at his work in a monastery.",
                    "waite": "A sculptor at his work in a monastery. Compare the design which illustrates the Eight of Pentacles. The apprentice or amateur therein has received his reward and is now at work in earnest. Divinatory Meanings: Métier, trade, skilled labour; usually, however, regarded as a card of nobility, aristocracy, renown, glory. Reversed: Mediocrity, in work and otherwise, puerility, pettiness, weakness.",
                },
                "interpretation": "",
                "keywords": [],
                "reversed_keywords": [],
                "guidance": "",
            },
            "Four of Pentacles": {
                "explanation": {
                    "summary": "A crowned figure, having a pentacle over his crown, clasps another with hands and arms; two pentacles are under his feet.",
                    "waite": "A crowned figure, having a pentacle over his crown, clasps another with hands and arms; two pentacles are under his feet. He holds to that which he has. Divinatory Meanings: The surety of possessions, cleaving to that which one has, gift, legacy, inheritance. Reversed: Suspense, delay, opposition.",
                },
                "interpretation": "",
                "keywords": [],
                "reversed_keywords": [],
                "guidance": "",
            },
            "Five of Pentacles": {
                "explanation": {
                    "summary": "Two mendicants in a snow-storm pass a lighted casement.",
                    "waite": "Two mendicants in a snow-storm pass a lighted casement. Divinatory Meanings: The card foretells material trouble above all, whether in the form illustrated--that is, destitution--or otherwise. For some cartomancists, it is a card of love and lovers-wife, husband, friend, mistress; also concordance, affinities. These alternatives cannot be harmonized. Reversed: Disorder, chaos, ruin, discord, profligacy.",
                },
                "interpretation": "",
                "keywords": [],
                "reversed_keywords": [],
                "guidance": "",
            },
            "Six of Pentacles": {
                "explanation": {
                    "summary": "A person in the guise of a merchant weighs money in a pair of scales and distributes it to the needy and distressed.",
                    "waite": "A person in the guise of a merchant weighs money in a pair of scales and distributes it to the needy and distressed. It is a testimony to his own success in life, as well as to his goodness of heart. Divinatory Meanings: Presents, gifts, gratification another account says attention, vigilance now is the accepted time, present prosperity, etc. Reversed: Desire, cupidity, envy, jealousy, illusion.",
                },
                "interpretation": "",
                "keywords": [],
                "reversed_keywords": [],
                "guidance": "",
            },
            "Seven of Pentacles": {
                "explanation": {
                    "summary": "A young man, leaning on his staff, looks intently at seven pentacles attached to a clump of greenery on his right; one would say that these were his treasures and that his heart was there.",
                    "waite": "A young man, leaning on his staff, looks intently at seven pentacles attached to a clump of greenery on his right; one would say that these were his treasures and that his heart was there. Divinatory Meanings: These are exceedingly contradictory; in the main, it is a card of money, business, barter; but one reading gives altercation, quarrels--and another innocence, ingenuity, purgation. Reversed: Cause for anxiety regarding money which it may be proposed to lend.",
                },
                "interpretation": "",
                "keywords": [],
                "reversed_keywords": [],
                "guidance": "",
            },
            "Eight of Pentacles": {
                "explanation": {
                    "summary": "An artist in stone at his work, which he exhibits in the form of trophies.",
                    "waite": "An artist in stone at his work, which he exhibits in the form of trophies. Divinatory Meanings: Work, employment, commission, craftsmanship, skill in craft and business, perhaps in the preparatory stage. Reversed: Voided ambition, vanity, cupidity, exaction, usury. It may also signify the possession of skill, in the sense of the ingenious mind turned to cunning and intrigue.",
                },
                "interpretation": "",
                "keywords": [],
                "reversed_keywords": [],
                "guidance": "",
            },
            "Nine of Pentacles": {
                "explanation": {
                    "summary": "A woman, with a bird upon her wrist, stands amidst a great abundance of grapevines in the garden of a manorial house.",
                    "waite": "A woman, with a bird upon her wrist, stands amidst a great abundance of grapevines in the garden of a manorial house. It is a wide domain, suggesting plenty in all things. Possibly it is her own possession and testifies to material well-being. Divinatory Meanings: Prudence, safety, success, accomplishment, certitude, discernment. Reversed: Roguery, deception, voided project, bad faith.",
                },
                "interpretation": "",
                "keywords": [],
                "reversed_keywords": [],
                "guidance": "",
            },
            "Ten of Pentacles": {
                "explanation": {
                    "summary": "A man and woman beneath an archway which gives entrance to a house and domain.",
                    "waite": "A man and woman beneath an archway which gives entrance to a house and domain. They are accompanied by a child, who looks curiously at two dogs accosting an ancient personage seated in the foreground. The child's hand is on one of them. Divinatory Meanings: Gain, riches; family matters, archives, extraction, the abode of a family. Reversed: Chance, fatality, loss, robbery, games of hazard; sometimes gift, dowry, pension.",
                },
                "interpretation": "",
                "keywords": [],
                "reversed_keywords": [],
                "guidance": "",
            },
            "Page of Pentacles": {
                "explanation": {
                    "summary": "A youthful figure, looking intently at the pentacle which hovers over his raised hands.",
                    "waite": "A youthful figure, looking intently at the pentacle which hovers over his raised hands. He moves slowly, insensible of that which is about him. Divinatory Meanings: Application, study, scholarship, reflection another reading says news, messages and the bringer thereof; also rule, management. Reversed: Prodigality, dissipation, liberality, luxury; unfavourable news.",
                },
                "interpretation": "",
                "keywords": [],
                "reversed_keywords": [],
                "guidance": "",
            },
            "Knight of Pentacles": {
                "explanation": {
                    "summary": "He rides a slow, enduring, heavy horse, to which his own aspect corresponds.",
                    "waite": "He rides a slow, enduring, heavy horse, to which his own aspect corresponds. He exhibits his symbol, but does not look therein. Divinatory Meanings: Utility, serviceableness, interest, responsibility, rectitude-all on the normal and external plane. Reversed: inertia, idleness, repose of that kind, stagnation; also placidity, discouragement, carelessness.",
                },
                "interpretation": "",
                "keywords": [],
                "reversed_keywords": [],
                "guidance": "",
            },
            "Queen of Pentacles": {
                "explanation": {
                    "summary": "The face suggests that of a dark woman, whose qualities might be summed up in the idea of greatness of soul; she has also the serious cast of intelligence; she contemplates her symbol and may see worlds therein.",
                    "waite": "The face suggests that of a dark woman, whose qualities might be summed up in the idea of greatness of soul; she has also the serious cast of intelligence; she contemplates her symbol and may see worlds therein. Divinatory Meanings: Opulence, generosity, magnificence, security, liberty. Reversed: Evil, suspicion, suspense, fear, mistrust.",
                },
                "interpretation": "",
                "keywords": [],
                "reversed_keywords": [],
                "guidance": "",
            },
            "King of Pentacles": {
                "explanation": {
                    "summary": "Valour, realizing intelligence, business and normal intellectual aptitude, sometimes mathematical gifts and attainments of this kind; success in these paths.",
                    "waite": "Valour, realizing intelligence, business and normal intellectual aptitude, sometimes mathematical gifts and attainments of this kind; success in these paths.",
                },
                "interpretation": "",
                "keywords": [],
                "reversed_keywords": [],
                "guidance": "",
            },
            # Minor Arcana - Wands
            "Ace of Wands": {
                "explanation": {
                    "summary": "Creation, invention, enterprise, the powers which result in these; principle, beginning, source; birth, family, origin, and in a sense the virility which is behind them; the starting point of enterprises; according to another account, money, fortune, inheritance.",
                    "waite": "Creation, invention, enterprise, the powers which result in these; principle, beginning, source; birth, family, origin, and in a sense the virility which is behind them; the starting point of enterprises; according to another account, money, fortune, inheritance.",
                },
                "interpretation": "",
                "keywords": [],
                "reversed_keywords": [],
                "guidance": "",
            },
            "Two of Wands": {
                "explanation": {
                    "summary": "Between the alternative readings there is no marriage possible; on the one hand, riches, fortune, magnificence; on the other, physical suffering, disease, chagrin, sadness, mortification.",
                    "waite": "Between the alternative readings there is no marriage possible; on the one hand, riches, fortune, magnificence; on the other, physical suffering, disease, chagrin, sadness, mortification. The design gives one suggestion; here is a lord overlooking his dominion and alternately contemplating a globe; it looks like the malady, the mortification, the sadness of Alexander amidst the grandeur of this world's wealth.",
                },
                "interpretation": "",
                "keywords": [],
                "reversed_keywords": [],
                "guidance": "",
            },
            "Three of Wands": {
                "explanation": {
                    "summary": "He symbolizes established strength, enterprise, effort, trade, commerce, discovery; those are his ships, bearing his merchandise, which are sailing over the sea.",
                    "waite": "He symbolizes established strength, enterprise, effort, trade, commerce, discovery; those are his ships, bearing his merchandise, which are sailing over the sea. The card also signifies able co-operation in business, as if the successful merchant prince were looking from his side towards yours with a view to help you.",
                },
                "interpretation": "",
                "keywords": [],
                "reversed_keywords": [],
                "guidance": "",
            },
            "Four of Wands": {
                "explanation": {
                    "summary": "They are for once almost on the surface--country life, haven of refuge, a species of domestic harvest-home, repose, concord, harmony, prosperity, peace, and the perfected work of these.",
                    "waite": "They are for once almost on the surface--country life, haven of refuge, a species of domestic harvest-home, repose, concord, harmony, prosperity, peace, and the perfected work of these.",
                },
                "interpretation": "",
                "keywords": [],
                "reversed_keywords": [],
                "guidance": "",
            },
            "Five of Wands": {
                "explanation": {
                    "summary": "Imitation, as, for example, sham fight, but also the strenuous competition and struggle of the search after riches and fortune.",
                    "waite": "Imitation, as, for example, sham fight, but also the strenuous competition and struggle of the search after riches and fortune. In this sense it connects with the battle of life. Hence some attributions say that it is a card of gold, gain, opulence.",
                },
                "interpretation": "",
                "keywords": [],
                "reversed_keywords": [],
                "guidance": "",
            },
            "Six of Wands": {
                "explanation": {
                    "summary": "The card has been so designed that it can cover several significations; on the surface, it is a victor triumphing, but it is also great news, such as might be carried in state by the King's courier; it is expectation crowned with its own desire, the crown of hope, and so forth.",
                    "waite": "The card has been so designed that it can cover several significations; on the surface, it is a victor triumphing, but it is also great news, such as might be carried in state by the King's courier; it is expectation crowned with its own desire, the crown of hope, and so forth.",
                },
                "interpretation": "",
                "keywords": [],
                "reversed_keywords": [],
                "guidance": "",
            },
            "Seven of Wands": {
                "explanation": {
                    "summary": "It is a card of valour, for, on the surface, six are attacking one, who has, however, the vantage position.",
                    "waite": "It is a card of valour, for, on the surface, six are attacking one, who has, however, the vantage position. On the intellectual plane, it signifies discussion, wordy strife; in business--negotiations, war of trade, barter, competition. It is further a card of success, for the combatant is on the top and his enemies may be unable to reach him.",
                },
                "interpretation": "",
                "keywords": [],
                "reversed_keywords": [],
                "guidance": "",
            },
            "Eight of Wands": {
                "explanation": {
                    "summary": "Activity in undertakings, the path of such activity, swiftness, as that of an express messenger; great haste, great hope, speed towards an end which promises assured felicity; generally, that which is on the move; also the arrows of love.",
                    "waite": "Activity in undertakings, the path of such activity, swiftness, as that of an express messenger; great haste, great hope, speed towards an end which promises assured felicity; generally, that which is on the move; also the arrows of love.",
                },
                "interpretation": "",
                "keywords": [],
                "reversed_keywords": [],
                "guidance": "",
            },
            "Nine of Wands": {
                "explanation": {
                    "summary": "The card signifies strength in opposition.",
                    "waite": "The card signifies strength in opposition. If attacked, the person will meet an onslaught boldly; and his build shews, that he may prove a formidable antagonist. With this main significance there are all its possible adjuncts--delay, suspension, adjournment.",
                },
                "interpretation": "",
                "keywords": [],
                "reversed_keywords": [],
                "guidance": "",
            },
            "Ten of Wands": {
                "explanation": {
                    "summary": "A card of many significances, and some of the readings cannot be harmonized.",
                    "waite": "A card of many significances, and some of the readings cannot be harmonized. I set aside that which connects it with honour and good faith. The chief meaning is oppression simply, but it is also fortune, gain, any kind of success, and then it is the oppression of these things. It is also a card of false-seeming, disguise, perfidy. The place which the figure is approaching may suffer from the rods that he carries. Success is stultified if the Nine of Swords follows, and if it is a question of a lawsuit, there will be certain loss.",
                },
                "interpretation": "",
                "keywords": [],
                "reversed_keywords": [],
                "guidance": "",
            },
            "Page of Wands": {
                "explanation": {
                    "summary": "Dark young man, faithful, a lover, an envoy, a postman.",
                    "waite": "Dark young man, faithful, a lover, an envoy, a postman. Beside a man, he will bear favourable testimony concerning him. A dangerous rival, if followed by the Page of Cups. Has the chief qualities of his suit. He may signify family intelligence.",
                },
                "interpretation": "",
                "keywords": [],
                "reversed_keywords": [],
                "guidance": "",
            },
            "Knight of Wands": {
                "explanation": {
                    "summary": "Departure, absence, flight, emigration.",
                    "waite": "Departure, absence, flight, emigration. A dark young man, friendly. Change of residence.",
                },
                "interpretation": "",
                "keywords": [],
                "reversed_keywords": [],
                "guidance": "",
            },
            "Queen of Wands": {
                "explanation": {
                    "summary": "A dark woman, countrywoman, friendly, chaste, loving, honourable.",
                    "waite": "A dark woman, countrywoman, friendly, chaste, loving, honourable. If the card beside her signifies a man, she is well disposed towards him; if a woman, she is interested in the Querent. Also, love of money, or a certain success in business.",
                },
                "interpretation": "",
                "keywords": [],
                "reversed_keywords": [],
                "guidance": "",
            },
            "King of Wands": {
                "explanation": {
                    "summary": "Dark man, friendly, countryman, generally married, honest and conscientious.",
                    "waite": "Dark man, friendly, countryman, generally married, honest and conscientious. The card always signifies honesty, and may mean news concerning an unexpected heritage to fall in before very long.",
                },
                "interpretation": "",
                "keywords": [],
                "reversed_keywords": [],
                "guidance": "",
            },
        }

    def get(self, card_name: str) -> Optional[Dict[str, Any]]:
        """
        Get details for a specific card by name.

        Args:
            card_name: The card's name (e.g., "Princess of Swords", "Ace of Cups")

        Returns:
            Dictionary containing card details, or None if not found
        """
        return self._details.get(card_name)

    def get_key_as_roman(self, card_name: str) -> Optional[str]:
        """
        Get the card's key displayed as Roman numerals.

        Args:
            card_name: The card's name (e.g., "The Fool", "The Magician")

        Returns:
            Roman numeral representation of the key (e.g., "XXI" for 21), or None if not found
        """
        details = self.get(card_name)
        if details and "key" in details:
            return self.key_to_roman(details["key"])
        return None

    def get_all_by_suit(self, suit_name: str) -> Dict[str, Dict[str, Any]]:
        """
        Get all details for cards in a specific suit.

        Args:
            suit_name: The suit name ("Cups", "Pentacles", "Swords", "Wands")

        Returns:
            Dictionary of card details for that suit
        """
        return {
            name: details
            for name, details in self._details.items()
            if suit_name.lower() in name.lower()
        }

    def _get_registry_key_for_card(self, card: "Card") -> Optional[str]:
        """
        Get the registry key for a card based on deck position (1-78).

        Card position is independent of deck-specific names, allowing different
        deck variants to use the same registry entries.

        Args:
            card: The Card object to look up

        Returns:
            Registry key string, or None if card cannot be mapped
        """
        return self._position_map.get(card.number)

    def load_into_card(self, card: "Card") -> bool:
        """
        Load details from registry into a Card object using its position.

        Args:
            card: The Card object to populate

        Returns:
            True if details were found and loaded, False otherwise
        """
        # Use position-based lookup instead of name-based
        details = self.get_by_position(card.number)
        if not details:
            return False

        card.explanation = details.get("explanation", {})
        card.interpretation = details.get("interpretation", "")
        card.keywords = details.get("keywords", [])
        card.reversed_keywords = details.get("reversed_keywords", [])
        card.guidance = details.get("guidance", "")

        return True

    def __getitem__(self, card_name: str) -> Optional[Dict[str, Any]]:
        """Allow dict-like access: registry['Princess of Swords']"""
        return self.get(card_name)
