/* ============================================
   MTG CANONICAL COLORS
   These are fixed Magic: The Gathering color identity colors.
   They never change between themes — they are part of the
   game's visual language and must remain recognizable.
   ============================================ */
:root {
    /* Monospace text (keys, codes). Not a theme token: the same in every theme. */
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    /* Mobile bottom-bar heights (shared by the fixed nav, sub-tab bar, and tab content padding) */
    --mobile-nav-height: 47px;
    --mobile-subtab-height: 49px;
    --mobile-bottom-bars: calc(var(--mobile-nav-height) + var(--mobile-subtab-height));

    /* Stacking layers: the page-level order of everything that can cover the
       page, lowest first (docs/reference/css-design-system.md, "Stacking").
       A component orders its own children with small numbers inside its
       own stacking context; these are for what competes across the page. On
       desktop the right panel is a stacking context of its own (its backdrop
       filter), except in Lens of Clarity and in the side pane; on phones it is
       not, so there panel content meets these layers directly.

       The phone bars sit above everything a panel's content can raise itself
       to (the highest is the pod deck autocomplete's dropdown at 400): panels
       no longer clip their content, and a pod participant card lifted to 200
       by :focus-within used to paint its deck art over the sub-tabs. A sticky
       wrapper around a sub-tab bar is a stacking context, so on phones it
       takes the bar's layer, or it traps the bar at its own level. */
    --z-sticky: 30;            /* sticky bars inside a panel */
    --z-player-banner: 150;    /* the fixed podcast and video player banners */
    --mobile-subnav-z: 439;    /* phone sub-tab bar */
    --mobile-nav-z: 440;       /* phone nav */
    --z-dropdown: 1000;        /* menus off the header; page-level hover previews */
    --z-sheet-backdrop: 1150;  /* behind the phone notepad sheet */
    --z-popover: 1200;         /* the phone command popover */
    --z-overlay: 3000;         /* full-surface tools: Playtest */
    --z-presenting: 5000;      /* Free Form presentation and its widget picker */
    --z-cookie-banner: 5500;   /* above the page, under the dialogs it opens */
    --z-modal: 6000;           /* BaseModal and the other dialogs */
    --z-sheet: 7000;           /* the phone notepad sheet; lists placed in viewport coordinates */
    --z-modal-stacked: 9000;   /* a dialog opened over another (notifications, profile) */
    --z-pointer-preview: 9999; /* previews that follow the pointer */
    --z-card-modal: 10000;     /* the Card Detail Modal, which opens from anywhere */
    --z-tutorial: 10001;       /* the tour, and the two layers it adds above it */
    --z-toast: 20000;          /* toasts, above every dialog */
    --z-drag: 30000;           /* drag ghosts */
    --z-context-menu: 40000;   /* context menus: the one thing nothing may cover */

    /* Corner radii. Card images keep their own ratio (4.75%). A pill only
       needs half the element's height, so --radius-pill fits any height. */
    --radius-xs: 2px;
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 10px;
    --radius-2xl: 12px;
    --radius-3xl: 16px;
    --radius-4xl: 20px;
    --radius-pill: 999px;
    --radius-round: 50%;
    /* A Magic card's own corner, so a card image shows its printed curve and
       none of the scan's square corner around it. */
    --radius-card: 4.75% / 3.5%;

    /* Spacing for gap, padding, margin and inset. In rem, so it follows the
       reader's font-size setting; a step's name counts 4px at the default
       16px root (--space-2 is 8px, --space-2-5 is 10px). --space-px is a
       hairline and stays 1px. Negative offsets and em values (relative to
       the element's own font on purpose) stay literal. */
    --space-px: 1px;
    --space-0-5: 0.125rem;
    --space-1: 0.25rem;
    --space-1-5: 0.375rem;
    --space-2: 0.5rem;
    --space-2-5: 0.625rem;
    --space-3: 0.75rem;
    --space-3-5: 0.875rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-7: 1.75rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;

    /* MTG Mana Production UI Colors (slightly different from pure identity) */
    --mtg-white-mana: #F0EFD8;
    --mtg-blue-mana: #4a90d9;
    --mtg-black-mana: #20242a;
    --mtg-red-mana: #e05c4b;
    --mtg-green-mana: #5cb85c;
    --mtg-generic-mana: #706e6eff;
    --mtg-multicolor: #CFB53B;

    /* MTG Two-Color Guild Pairs */
    --mtg-azorius: #70A1D7;    /* WU - white/blue */
    --mtg-dimir: #4B4D7F;      /* UB - blue/black */
    --mtg-rakdos: #A65257;     /* BR - black/red */
    --mtg-gruul: #8E9D5E;      /* RG - red/green */
    --mtg-selesnya: #96B18D;   /* GW - green/white */
    --mtg-orzhov: #A69F9D;     /* WB - white/black */
    --mtg-izzet: #7F9FB8;      /* UR - blue/red */
    --mtg-golgari: #607253;    /* BG - black/green */
    --mtg-boros: #D38A7F;      /* RW - red/white */
    --mtg-simic: #529785;      /* GU - green/blue */
    --mtg-gold: #D4AF37;       /* Shards/Wedges/WUBRG multicolor */

    /* MTG Card Rarities */
    --rarity-common: #373737;
    --rarity-uncommon: #BBC5D5;
    --rarity-rare: #FFE182;
    --rarity-mythic: #FF9550;
    --rarity-special: #A77BD6;
    --rarity-bonus: #5CC8C0;

    /* The text tile's frame styles (styles/card-tile.css, TileFrame): fixed
       palettes, so a card is the same picture on every theme. Classic is
       Midnight's surfaces and text, Classic Light Azorius's, and the
       borderless frame's sky a night deeper than either. The rarity marks
       keep Midnight's colors in every frame. */
    --frame-classic-surface: #161b22;
    --frame-classic-deep: #0d1117;
    --frame-classic-line: #30363d;
    --frame-classic-line-soft: #30363dcc;
    --frame-classic-text: #e6edf3;
    --frame-classic-text-muted: #8b949e;
    --frame-light-surface: #ffffff;
    --frame-light-deep: #e9edf4;
    --frame-light-line: #d5dbe6;
    --frame-light-line-soft: #d5dbe6cc;
    --frame-light-text: #131a26;
    --frame-light-text-muted: #3f4a5c;
    --frame-sky: #05070d;
    --frame-rarity-uncommon: #BBC5D5;
    --frame-rarity-rare: #FFE182;
    --frame-rarity-mythic: #FF9550;
    --frame-rarity-special: #A77BD6;
    --frame-rarity-bonus: #5CC8C0;

    /* ============================================
       SYNERGY TYPE COLORS
       Each synergy category has a fixed color identity used
       across all chart visualizations and badge indicators.
       ============================================ */
    --synergy-keyword: #3498db;
    --synergy-tribal: #27ae60;
    --synergy-etb: #9b59b6;
    --synergy-trigger: #e74c3c;
    --synergy-conditional: #f39c12;
    --synergy-combo: #e91e63;
    --synergy-color-match: #95a5a6;
    --synergy-treasure: #FFD700;
    --synergy-tokens: #8BC34A;
    --synergy-artifact-tokens: #AED581;
    --synergy-artifacts: #607D8B;
    --synergy-aristocrats: #4A0080;
    --synergy-lifegain: #F8BBD0;
    --synergy-counters: #00BCD4;
    --synergy-poison: #4CAF50;
    --synergy-energy: #03A9F4;
    --synergy-graveyard: #3E2723;
    --synergy-blink: #E1BEE7;
    --synergy-spellslinger: #FF5722;
    --synergy-enchantments: #AB47BC;
    --synergy-landfall: #795548;
    --synergy-ramp: #43A047;
    --synergy-equipment: #BDBDBD;
    --synergy-draw: #1E88E5;
    --synergy-exile: #FF8A65;
    --synergy-protection: #81C784;
    --synergy-tutors: #FFF176;
    --synergy-removal: #EF5350;
    --synergy-stax: #90A4AE;
    --synergy-combat: #D32F2F;
    --synergy-copy: #4DB6AC;
    --synergy-tap-untap: #64B5F6;
    --synergy-legendary: #FFB300;
    --synergy-planeswalkers: #BA68C8;
    --synergy-keywords: #CDDC39;
    --synergy-stats: #A1887F;
    --synergy-commander: #FF5252;
    --synergy-theft: #673AB7;
    --synergy-politics: #009688;

    /* ============================================
       CATEGORICAL CHART PALETTE
       14-color palette for pie charts, bar charts,
       and other multi-series data visualizations.
       ============================================ */
    --chart-cat-1: #3b82f6;
    --chart-cat-2: #10b981;
    --chart-cat-3: #f59e0b;
    --chart-cat-4: #ef4444;
    --chart-cat-5: #8b5cf6;
    --chart-cat-6: #ec4899;
    --chart-cat-7: #06b6d4;
    --chart-cat-8: #f97316;
    --chart-cat-9: #14b8a6;
    --chart-cat-10: #6366f1;
    --chart-cat-11: #d946ef;
    --chart-cat-12: #84cc16;
    --chart-cat-13: #22d3ee;
    --chart-cat-14: #64748b;

    /* The colors a reader marks Free Form cards, frames and arrows with: data,
       the same in every theme, each defined once. */
    --table-red: #ef4444;
    --table-orange: #f97316;
    --table-yellow: #eab308;
    --table-green: #22c55e;
    --table-blue: #3b82f6;
    --table-purple: #a855f7;

    /* The one color the daily games (styles/games.css) need that the default
       theme does not define. Games always renders in Midnight, so each game
       takes a color from Midnight's own palette: its blue, its white, and this
       violet from the same family, which sits beside that blue without fighting
       it. */
    --games-violet: #bc8cff;

    /* Shared horizontal chart bars */
    --chart-bar-track: rgba(148, 163, 184, 0.24);
    --chart-bar-track-border: rgba(148, 163, 184, 0.08);
    --chart-bar-fill-outline: rgba(255, 255, 255, 0.36);

    /* ============================================
       DECK ARCHETYPE RADAR COLORS
       Fixed colors for the archetype radar/spider chart.
       ============================================ */
    --archetype-aggro: #e74c3c;
    --archetype-tribal: #e67e22;
    --archetype-protection: #1abc9c;
    --archetype-control: #3498db;
    --archetype-ramp: #27ae60;
    --archetype-draw: #f39c12;
    --archetype-combo: #9b59b6;
    --archetype-balanced: #2ecc71;

    /* Favorite Colors */
    --favorite-color: #f472b6;
    --favorite-bg: rgba(244, 114, 182, 0.1);

    /* Chip Colors */
    --chip-bg: var(--accent-gradient);
    --chip-text: var(--button-primary-text);
    --chip-exclude-bg: var(--danger-color);
    --chip-exclude-text: var(--button-primary-text);
    --chip-or-bg: var(--accent-light);
    --chip-or-text: var(--button-primary-text);

    /* Actor effect focus colors */
    --actor-opponents-color: var(--danger-color);
    --actor-each-player-color: var(--warning-color);
    --actor-you-color: var(--accent-color);

    /* Rarity Colors */
    --rarity-common: #000000;
    --rarity-uncommon: #A0A0A0;
    --rarity-rare: #C4A429;
    --rarity-mythic: #FF8400;
    --rarity-special: #A77BD6;
    --rarity-bonus: #5CC8C0;

    /* Button Colors */
    --button-primary-text: white;
}
