/* Theme contract: palette, semantic roles and typography. Override variables under
   [data-theme="..."] for future themes; component files contain no color literals. */
:root {
  --sheet-critical-border: #e08a58;
  --map-success:#80b794;--map-error:#ef9b90;--map-swatch-edge:#0006;--map-status-bg:#111b;--map-status-text:#fff;--map-backdrop:#07100cbb;--map-canvas-bg:#131c1b;--map-tile-placeholder:#293330;--map-ink-0:#ffffff;--map-ink-1:#111111;--map-ink-2:#ef5350;--map-ink-3:#ff8a45;--map-ink-4:#ffc247;--map-ink-5:#fff176;--map-ink-6:#b2de45;--map-ink-7:#58ad60;--map-ink-8:#29bc91;--map-ink-9:#42d3c7;--map-ink-10:#55cef4;--map-ink-11:#4b97ef;--map-ink-12:#9295ff;--map-ink-13:#c47dff;--map-ink-14:#f381bc;--map-ink-15:#b78c65;

  --bg: #111b19;
  --panel: #192320;
  --paper: #ede9df;
  --ink: #26372f;
  --muted: #9ca89c;
  --gold: #c8aa75;
  --line: rgba(200,170,117,.24);
  --serif: Georgia,'Times New Roman',serif;
  --sans: 'Segoe UI',Arial,sans-serif;
  --rules-reader-bg: var(--paper);
  --rules-reader-text: var(--ink);
  --rules-reader-muted: #59604f;
  --rules-reader-accent: #694723;
  --rules-reader-line: rgba(38,55,47,.22);
  --rules-reader-control: #f5f0e5;
  --rules-table-stripe: rgba(105,71,35,.055);
  --rules-paper-texture: url('/assets/rules-paper.webp');
  --rules-paper-wash: rgba(237,233,223,.82);
  --rules-filter-shadow: 8px 8px 30px rgba(0,0,0,.25);
  /* Existing palette, preserved without changing the current appearance. */
  --palette-001: transparent;
  --palette-002: #101917;
  --text-secondary: #c3c7bd;
  --palette-004: rgba(10,20,19,.92);
  --palette-005: rgba(10,20,19,.58);
  --palette-006: rgba(10,20,19,.03);
  --palette-007: #10191744;
  --palette-008: #d8ba84;
  --palette-009: #d1d4c9;
  --palette-010: #15221e;
  --palette-011: #dfc594;
  --palette-012: #c2c7b266;
  --palette-013: #c5c8b7;
  --palette-014: #15201c;
  --palette-015: #aab4a8;
  --palette-016: #a2aea0;
  --palette-017: #0c1416cf;
  --palette-018: #e1cfab;
  --palette-019: #c8aa7555;
  --palette-020: #aeb7ac;
  --palette-021: #eed3a0;
  --palette-022: #99a497;
  --palette-023: #8e9278;
  --palette-024: #8c998c;
  --palette-025: #84704b;
  --palette-026: #87704b;
  --palette-027: #687065;
  --palette-028: #b2b49f99;
  --palette-029: #5d695c;
  --palette-030: #5b6648;
  --palette-031: #a8ac98;
  --palette-032: #b4b19a55;
  --palette-033: #a9b1a3;
  --palette-034: #7b8c78;
  --palette-035: #202b24;
  --palette-036: #141f1c;
  --palette-037: #9a9f83;
  --palette-038: #374333;
  --palette-039: #18241e;
  --palette-040: #bba575;
  --palette-041: #17221c;
  --palette-042: #8f9d8c;
  --palette-043: #132019;
  --palette-044: #f0ece1;
  --palette-045: #29372f;
  --palette-046: #0009;
  --palette-047: #06100cdb;
  --palette-048: #e8e3d6;
  --palette-049: #b4b4a3;
  --palette-050: #c2beab;
  --palette-051: #827044;
  --palette-052: #68715f;
  --palette-053: #a58d58;
  --palette-054: #806738;
  --palette-055: #b6b6a2;
  --palette-056: #747b69;
  --reader-muted: #596044;
  --palette-058: #a79872;
  --palette-059: #18241d;
  --palette-060: #e4e3d6;
  --palette-061: #202d24;
  --palette-062: #44523c;
  --palette-063: #b1b9a5;
  --palette-064: #cdbb8d;
  --palette-065: #556047;
  --palette-066: #0a1413e8;
  --palette-067: #0a141377;
  --palette-068: #0a141333;
  --palette-069: white;
  --palette-070: rgba(10,20,19,.94);
  --palette-071: rgba(10,20,19,.68);
  --palette-072: rgba(10,20,19,.05);
  --palette-073: #10191722;
  --palette-074: #0a1413ee;
  --palette-075: #0a141399;
  --palette-076: #0a141355;
  --palette-077: #67725c;
  --palette-078: #a6ae98;
  --palette-079: #82704418;
  --palette-080: #a7987277;
  --palette-081: #253125;
  --danger-border: #c47764;
  --danger-surface: #392722;
  --danger-on-dark: #ffd7c4;
  --palette-085: #d0d6c9;
  --palette-086: #101a17;
  --palette-087: #4b5849;
  --palette-088: #f0eee2;
  --palette-089: #8b9987;
  --palette-090: #2d3929;
  --palette-091: #1a251f;
  --palette-092: #aab69f;
  --palette-093: #fff9eb;
  --palette-094: #203025;
  --dialog-border: #a9ad96;
  --palette-096: #36472e;
  --palette-097: #6d754d;
  --danger-text: #9c3b27;
  --palette-099: #162516;
  --palette-100: #283724;
  --palette-101: #142019;
  --palette-102: #627057;
  --palette-103: #e8e7db;
  --palette-104: #243322;
  --palette-105: #35472c;
  --palette-106: #fff3c9;
  --palette-107: #d28b72;
  /* Review and notification roles shared by all review components. */
  --review-remove-fg: #923f41;
  --review-remove-bg: #f7dfda;
  --review-add-fg: #285e43;
  --review-add-bg: #d9eee0;
  --review-focus: var(--ink);
  --review-document-bg: var(--paper);
  --review-input-bg: var(--paper);
  --message-unread-bg: #c8aa7518;
  --review-toolbar-shadow: 0 4px 12px #26372f22;
  /* Character collection and tabletop-sheet roles. */
  --item-rarity-common: #bcbcc5;
  --item-rarity-uncommon: #76d449;
  --item-rarity-rare: #73b3ff;
  --item-rarity-very-rare: #d397ff;
  --item-rarity-legendary: #ffad52;
  --item-rarity-artifact: #c48c91;
  --coin-cp: #d69a70;
  --coin-sp: #d2dde5;
  --coin-ep: #cbd39b;
  --coin-gp: #ecc463;
  --coin-pp: #bde6e4;
  --sheet-font: 'Arial Narrow','Segoe UI',Arial,sans-serif;
  --sheet-paper: #e7e3d8;
  --sheet-panel: #303735;
  --sheet-header: #222b28;
  --sheet-card-header: linear-gradient(120deg,#35423a,#26332d);
  --sheet-strip: #101a17;
  --sheet-text: #e6e8df;
  --sheet-ink: #27362f;
  --sheet-muted: #afb8b1;
  --sheet-edge: #7f8778;
  --sheet-inner-edge: #596359;
  --sheet-input: #26302c;
  --sheet-link: #c7b585;
  --sheet-heal: #7ccca2;
  --sheet-damage: #f1a497;
  --hp-full: #7ed69a;
  --hp-yellow: #e6ce70;
  --hp-orange: #efaa65;
  --hp-red: #f08080;
  --sheet-card-shadow: 0 5px 18px #00000024;
  --sheet-panel-shadow: inset 0 0 0 1px #c2c2ad33;
  --sheet-modal-backdrop: #08100cbb;
  --sheet-tooltip-bg: #111d17;
}

/* Text editor surfaces from the approved Sagas e Crônicas reference. */
:root{--editor-bg:#1c2420;--editor-card:#202823;--editor-input:#161d1a;--editor-line:#38433e;--editor-text:#e6e4dc;--editor-muted:#9aa59e;--editor-accent:#cfa77f;--editor-ring:#8a7556;--editor-selected:#2c3632}

/* Shared form roles for every encounter surface. Theme changes override these
   roles once; panels, dialogs and detached windows inherit the same contract. */
:root{--control-bg:var(--bg);--control-text:var(--paper);--control-border:var(--line);--control-placeholder:var(--muted);--control-selection-bg:var(--gold);--control-selection-text:var(--bg);--control-scheme:dark;--encounter-shadow:#0009;--encounter-fog:#080e0a}
