/* ArcaneMetriX Classic — deep midnight blue */
:root,
[data-theme="midnight"] {
    /* Background surfaces */
    --bg-color: #0d1117;
    --bg-gradient: linear-gradient(135deg, #0d1117 0%, #161b22 50%, #0d1117 100%);
    --panel-bg: #161b22f2;
    --panel-bg-opaque: #161b22;
    --card-bg: #161b22cc;
    --list-bg: #161b2299;
    --entry-bg: #21262dcc;
    --entry-hover-bg: #30363de6;
    --canvas-bg: rgba(13, 17, 23, 0.86);
    --bg-secondary: #161b22;
    --bg-tertiary: #0d1117;
    --bg-primary: #0d1117;
    --hero-scrim: #000000;
    --border-primary: #30363d;
    --text-accent: #58a6ff;

    /* Text */
    --text-color: #e6edf3;
    --text-primary: #e6edf3;
    --text-muted: #7d8590;
    --text-secondary: #8b949e;

    /* Accent */
    --accent-color: #58a6ff;
    --color-accent: #58a6ff;
    --accent-primary: #58a6ff;
    --accent-gradient: linear-gradient(135deg, #58a6ff 0%, #1f6feb 50%, #388bfd 100%);
    --accent-glow: #58a6ff33;
    --accent-hover: #58a6ff66;
    --accent-bg: #58a6ff1a;
    --accent-bg-hover: #58a6ff33;
    --accent-light: #a5c8ff;
    --highlight: #58a6ff33;

    /* Borders */
    --border-color: #30363dcc;
    --border-hover: #58a6ff;
    --glass-border: #30363d99;

    /* Inputs and forms */
    --input-bg: #0d1117;
    --input-border: #30363d;
    --select-option-bg: #161b22;
    --widget-bg: color-mix(in srgb, var(--bg-color) 86%, transparent);

    /* Buttons */
    --button-bg: #21262d;
    --button-border: #f0f6fc1a;
    --button-text: #c9d1d9;
    --button-primary-text: #ffffff;

    /* Tabs */
    --tab-bg: #21262d;
    --tab-text: #8b949e;
    --tab-active-text: #f0f6fc;

    /* Scrollbars */
    --scrollbar-track: #30363d4d;
    --scrollbar-thumb: #30363d;
    --scrollbar-thumb-hover: #484f58;

    /* Deck group headers */
    --deck-header-bg: linear-gradient(to right, rgba(88, 166, 255, 0.15), transparent);
    --deck-header-border: #58a6ff4d;
    --deck-header-text: var(--accent-color);

    /* Popups and modals */
    --popup-bg: #161b22;
    --popup-border: #30363d;
    --popup-shadow: #010409cc;
    --popup-section-border: #30363d;

    /* Charts and stats */
    --chart-bg: #161b2299;
    --chart-title-color: #7d8590;

    /* Dividers and collapse controls */
    --divider-border: #30363d;
    --divider-btn-bg: #21262d;
    --divider-btn-text: #8b949e;

    /* Scanning and loading */
    --scanning-bg: #0d1117fa;
    --scanning-text: #e6edf3;

    /* PRO gates */
    --pro-overlay-bg: #0d1117d9;
    --pro-overlay-border: #58a6ff66;
    --pro-text: #7d8590;

    /* Chips and tags */
    --chip-bg: #58a6ff;
    --chip-text: #ffffff;
    --chip-or-bg: #39d0d8;
    --chip-or-text: #0d1117;
    --chip-exclude-bg: #f85149;
    --chip-exclude-text: #ffffff;
    --tag-bg: #21262d;
    --tag-text: #e6edf3;
    --tag-border: #30363d;
    --favorite-color: #d29922;
    --favorite-bg: #d2992233;

    /* Card type colors */
    --type-creature: #3fb950;
    --type-land: #a0522d;
    --type-instant: #58a6ff;
    --type-sorcery: #fa7970;
    --type-enchantment: #bc8cff;
    --type-artifact: #8b949e;
    --type-planeswalker: #d29922;
    --type-other: #6e7681;

    /* MTG mana colors (canonical, never themed) */
    --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-gold: #E69F00;

    /* Drawn over a live camera picture (the card scanner's outlines, badges and readout).
       The picture is not themed, so neither are these: light ink on a dark scrim reads
       over any table. */
    --on-media-ink: #ffffff;
    --on-media-scrim: #000000;

    /* MTG rarity colors (canonical) */
    --rarity-common: #373737;
    --rarity-uncommon: #BBC5D5;
    --rarity-rare: #FFE182;
    --rarity-mythic: #FF9550;
    --rarity-special: #A77BD6;
    --rarity-bonus: #5CC8C0;

    /* MTG archetype colors (canonical) */
    --archetype-aggro: #e74c3c;
    --archetype-tribal: #e67e22;
    --archetype-protection: #1abc9c;
    --archetype-control: #3498db;
    --archetype-ramp: #27ae60;
    --archetype-draw: #f39c12;
    --archetype-combo: #9b59b6;
    --archetype-balanced: #2ecc71;

    /* Semantic: success */
    --success-color: #3fb950;
    --success-bg: #3fb9501a;
    --success-border: #3fb9504d;
    --success-bg-hover: #3fb95033;

    /* Semantic: danger */
    --danger-color: #f85149;
    --danger: #f85149;
    --error-color: #f85149;
    --danger-bg: #f851491a;
    --danger-border: #f8514966;
    --error-border: #f8514966;
    --danger-bg-hover: #f8514933;

    /* Semantic: warning */
    --warning-color: #d29922;
    --warning-bg: #d299221a;
    --warning-border: #d299224d;

    /* Semantic: info */
    --info-color: #39d0d8;
    --info-bg: #39d0d81a;
    --info-border: #39d0d84d;
    --info-bg-hover: #39d0d833;

    /* Social */
    --discord-color: #5865F2;

    /* Functional curve (cast timing) */
    --fc-sweet-spot: #2dd4c4;
    --fc-less-value: #d29922;
    --fc-reactive: #fa7970;
    --fc-face: #c084fc;

    /* Accent as RGB triplets, for rgba() */
    --accent-rgb: 88, 166, 255;
    --color-accent-rgb: 88, 166, 255;

    /* Overlays and banners */
    --overlay-bg: #010409b3;
    --impersonation-bg: linear-gradient(135deg, #f59e0b, #d97706);

    /* Effects */
    --glass-blur: blur(12px);

    /* Breakpoints and chrome sizes (identical in every theme) */
    --mobile-width: 768px;
    --tablet-width: 1024px;
    --desktop-width: 1440px;
    --header-height: 60px;
    --mobile-header-height: 50px;
}
