/* Default palette. Components reference roles; themes override these values. */
:root {
  --page-bg: #f6f5f1;
  --surface-bg: #fff;
  --surface-soft: #fafaf7;
  --text-primary: #25332f;
  --text-muted: #7c8580;
  --border-default: #e8eae4;
  --action-primary: #963f43;
  --action-primary-hover: #813237;
  --action-secondary: #203c32;
  --text-on-action: #fff;
  --focus-ring: #ae8477;
  --danger: #963f45;
  --score-positive: #28784f;
  --score-negative: #b33a3d;
  --team-home: #315e86;
  --team-away: #984850;
  --suit-red: #a3484c;
  --entry-suit-red: var(--suit-red);
  --entry-suit-black: var(--text-primary);
  --switch-off: #b6bfb8;
  --switch-thumb: #fff;
  --sidebar-text: #e9eee8;
  --sidebar-brand: #d6aaa0;
  --sidebar-muted: #a9bbb0;
  --sidebar-section: #92a79b;
  --sidebar-group-bg: #355045;
  --sidebar-group-border: #466052;
  --sidebar-group-text: #eef3ec;
  --sidebar-icon: #b8c9be;
  --sidebar-hover-bg: #2b483b;
  --sidebar-active-bg: #456152;
  --sidebar-active-marker: #c2d7b9;
  --surface-table-stripe: #fafbf8;
  --surface-table-heading: #fafbf7;
  --surface-control-hover: #f1f4ed;
  --border-control: #dfe4dc;
  --mini-score-selected-bg: #e8efe8;
  --selection-indicator: #7a9c85;
  --follow-star: #8a641c;

  /* Compatibility aliases for existing components. */
  --paper: var(--page-bg);
  --ink: var(--text-primary);
  --muted: var(--text-muted);
  --line: var(--border-default);
  --accent: var(--action-primary);
  --forest: var(--action-secondary);
  --white: var(--surface-bg);
  --soft: var(--surface-soft);
}

/* Adapted UI palettes: Nord (nordtheme.com), Dracula (draculatheme.com). */
:root[data-theme="light"] {
  color-scheme: light;
  --page-bg: #f4f6f8;
  --surface-bg: #ffffff;
  --surface-soft: #f1f5f9;
  --text-primary: #1e293b;
  --text-muted: #586779;
  --border-default: #dce2e9;
  --action-primary: #2563eb;
  --action-primary-hover: #1d4ed8;
  --action-secondary: #334155;
  --text-on-action: #ffffff;
  --focus-ring: #2563eb;
  --danger: #b33645;
  --score-positive: #237548;
  --score-negative: #b33645;
  --team-home: #275d9c;
  --team-away: #b33645;
  --suit-red: #ff0000;
  --entry-suit-red: #a3484c;
  --entry-suit-black: var(--text-primary);
  --suit-S: #000000;
  --suit-H: #ff0000;
  --suit-D: #ff0000;
  --suit-C: #000000;
  --switch-off: #dce2e9;
  --switch-thumb: #ffffff;
  --sidebar-bg: #1e293b;
  --manual-sidebar-bg: #1e293b;
  --sidebar-text: #edf0f3;
  --sidebar-brand: #e6bfa0;
  --sidebar-muted: #bbc4ce;
  --sidebar-section: #bbc4ce;
  --sidebar-group-bg: color-mix(in srgb, #1e293b 80%, white);
  --sidebar-group-border: #647180;
  --sidebar-group-text: #edf0f3;
  --sidebar-icon: #d3dae0;
  --sidebar-hover-bg: color-mix(in srgb, #1e293b 85%, white);
  --sidebar-active-bg: color-mix(in srgb, #1e293b 78%, white);
  --sidebar-active-marker: #2563eb;
  --sidebar-on-active: #ffffff;
  --surface-table-stripe: #f1f5f9;
  --surface-table-heading: #f1f5f9;
  --surface-control-hover: #f1f5f9;
  --border-control: #dce2e9;
  --mini-score-selected-bg: color-mix(in srgb, #334155 14%, #ffffff);
  --selection-indicator: #334155;
  --follow-star: #8a5a00;
  --theme-surface: #ffffff;
  --theme-surface-muted: #f1f5f9;
  --theme-surface-selected: color-mix(in srgb, #334155 15%, #ffffff);
  --theme-text: #1e293b;
  --theme-muted: #586779;
  --theme-border: #dce2e9;
  --theme-focus: #334155;
  --theme-positive: #237548;
  --theme-negative: #b33645;
  --theme-warning: #93631d;
  --theme-info: #275d9c;
  --theme-positive-bg: color-mix(in srgb, #237548 13%, #ffffff);
  --theme-negative-bg: color-mix(in srgb, #b33645 13%, #ffffff);
  --theme-warning-bg: color-mix(in srgb, #93631d 13%, #ffffff);
  --theme-info-bg: color-mix(in srgb, #275d9c 13%, #ffffff);
  --theme-solid: #334155;
  --theme-shadow: #00000012;
  --theme-backdrop: #00000050;
}
:root[data-theme="sepia"] {
  --seat-nonvul-bg: color-mix(in srgb, var(--sidebar-bg) 13%, var(--surface-bg));
  --seat-nonvul-text: var(--sidebar-bg);
  --seat-nonvul-badge: var(--sidebar-bg);
  --seat-nonvul-badge-text: var(--sidebar-text);
  --seat-vul-bg: color-mix(in srgb, var(--sidebar-brand) 24%, var(--surface-bg));
  --seat-vul-text: var(--sidebar-bg);
  --seat-vul-badge: var(--sidebar-brand);
  --seat-vul-badge-text: var(--sidebar-bg);

  color-scheme: light;
  --page-bg: #f5f0e4;
  --surface-bg: #fffbf1;
  --surface-soft: #eee8d9;
  --text-primary: #353b4b;
  --text-muted: #66616a;
  --border-default: #d7cfbd;
  --action-primary: #a14f42;
  --action-primary-hover: #853d33;
  --action-secondary: #485675;
  --text-on-action: #fffbf1;
  --focus-ring: #485675;
  --danger: #a43e44;
  --score-positive: #326749;
  --score-negative: #a43e44;
  --team-home: #38617e;
  --team-away: #a43e44;
  --suit-red: #a43e44;
  --switch-off: #c7c9ba;
  --switch-thumb: #ffffff;
  --sidebar-bg: #343c52;
  --manual-sidebar-bg: #343c52;
  --sidebar-text: #f7f0df;
  --sidebar-brand: #e4b878;
  --sidebar-muted: #c9c6d0;
  --sidebar-section: #c9c6d0;
  --sidebar-group-bg: #434c64;
  --sidebar-group-border: #73798d;
  --sidebar-group-text: #f7f0df;
  --sidebar-icon: #d4d0db;
  --sidebar-hover-bg: #434c64;
  --sidebar-active-bg: #525e7b;
  --sidebar-active-marker: #efd295;
  --sidebar-on-active: #fffbf1;
  --surface-table-stripe: #f4eedf;
  --surface-table-heading: #fbf5e7;
  --surface-control-hover: #e9e5e1;
  --border-control: #cec7c2;
  --mini-score-selected-bg: #e3e5ec;
  --selection-indicator: #485675;
  --follow-star: #8b6017;
  --theme-surface: #fffbf1;
  --theme-surface-muted: #eee8d9;
  --theme-surface-selected: #e3e5ec;
  --theme-text: #353b4b;
  --theme-muted: #66616a;
  --theme-border: #d7cfbd;
  --theme-focus: #485675;
  --theme-positive: #326749;
  --theme-negative: #a43e44;
  --theme-warning: #8b6017;
  --theme-info: #38617e;
  --theme-positive-bg: color-mix(in srgb, #486b35 13%, #fff8e9);
  --theme-negative-bg: color-mix(in srgb, #aa4140 13%, #fff8e9);
  --theme-warning-bg: color-mix(in srgb, #8a641e 13%, #fff8e9);
  --theme-info-bg: color-mix(in srgb, #3e6381 13%, #fff8e9);
  --theme-solid: #594936;
  --theme-shadow: #00000012;
  --theme-backdrop: #00000050;
}
:root[data-theme="nord"] {
  --suit-solid-display: none;
  --suit-outline-display: inline;
  --seat-nonvul-text: var(--theme-solid);

  color-scheme: dark;
  --page-bg: #2e3440;
  --surface-bg: #3b4252;
  --surface-soft: #343b49;
  --text-primary: #eceff4;
  --text-muted: #b7c2d3;
  --border-default: #566176;
  --action-primary: #88c0d0;
  --action-primary-hover: #a1d1de;
  --action-secondary: #8fbcbb;
  --text-on-action: #242a35;
  --focus-ring: #88c0d0;
  --danger: #f09aa6;
  --score-positive: #a3be8c;
  --score-negative: #f09aa6;
  --team-home: #8cbbe5;
  --team-away: #f09aa6;
  --suit-red: #f09aa6;
  --switch-off: #566176;
  --switch-thumb: #eceff4;
  --sidebar-bg: #242a35;
  --manual-sidebar-bg: #242a35;
  --sidebar-text: #edf0f3;
  --sidebar-brand: #88c0d0;
  --sidebar-muted: #bbc4ce;
  --sidebar-section: #bbc4ce;
  --sidebar-group-bg: #3b4252;
  --sidebar-group-border: #566176;
  --sidebar-group-text: #edf0f3;
  --sidebar-icon: #d3dae0;
  --sidebar-hover-bg: color-mix(in srgb, #242a35 85%, white);
  --sidebar-active-bg: color-mix(in srgb, #242a35 78%, white);
  --sidebar-active-marker: #88c0d0;
  --sidebar-on-active: #ffffff;
  --surface-table-stripe: #343b49;
  --surface-table-heading: #343b49;
  --surface-control-hover: #343b49;
  --border-control: #566176;
  --mini-score-selected-bg: color-mix(in srgb, #8fbcbb 14%, #3b4252);
  --selection-indicator: #8fbcbb;
  --follow-star: #ebcb8b;
  --theme-surface: #3b4252;
  --theme-surface-muted: #343b49;
  --theme-surface-selected: color-mix(in srgb, #8fbcbb 15%, #3b4252);
  --theme-text: #eceff4;
  --theme-muted: #b7c2d3;
  --theme-border: #566176;
  --theme-focus: #8fbcbb;
  --theme-positive: #a3be8c;
  --theme-negative: #f09aa6;
  --theme-warning: #ebcb8b;
  --theme-info: #8cbbe5;
  --theme-positive-bg: color-mix(in srgb, #a3be8c 13%, #3b4252);
  --theme-negative-bg: color-mix(in srgb, #f09aa6 13%, #3b4252);
  --theme-warning-bg: color-mix(in srgb, #ebcb8b 13%, #3b4252);
  --theme-info-bg: color-mix(in srgb, #8cbbe5 13%, #3b4252);
  --theme-solid: #8fbcbb;
  --theme-shadow: #00000035;
  --theme-backdrop: #00000050;
}
:root[data-theme="dracula"] {
  --seat-nonvul-bg: var(--theme-info-bg);
  --seat-nonvul-text: var(--theme-solid);

  color-scheme: dark;
  --page-bg: #282a36;
  --surface-bg: #303341;
  --surface-soft: #282a36;
  --text-primary: #f8f8f2;
  --text-muted: #b9b8ce;
  --border-default: #53566c;
  --action-primary: #bd93f9;
  --action-primary-hover: #d0b1fc;
  --action-secondary: #8be9fd;
  --text-on-action: #282a36;
  --focus-ring: #bd93f9;
  --danger: #ff929d;
  --score-positive: #80e89d;
  --score-negative: #ff929d;
  --team-home: #8be9fd;
  --team-away: #ff929d;
  --suit-red: #ff7f7f;
  --suit-S: #7aa2ff;
  --suit-H: #ff7f7f;
  --suit-D: #bd93f9;
  --suit-C: #f1d58c;
  --switch-off: #53566c;
  --switch-thumb: #f8f8f2;
  --sidebar-bg: #21222c;
  --manual-sidebar-bg: #21222c;
  --sidebar-text: #edf0f3;
  --sidebar-brand: #bd93f9;
  --sidebar-muted: #bbc4ce;
  --sidebar-section: #bbc4ce;
  --sidebar-group-bg: #303341;
  --sidebar-group-border: #53566c;
  --sidebar-group-text: #edf0f3;
  --sidebar-icon: #d3dae0;
  --sidebar-hover-bg: color-mix(in srgb, #21222c 85%, white);
  --sidebar-active-bg: color-mix(in srgb, #21222c 78%, white);
  --sidebar-active-marker: #bd93f9;
  --sidebar-on-active: #ffffff;
  --surface-table-stripe: #282a36;
  --surface-table-heading: #282a36;
  --surface-control-hover: #282a36;
  --border-control: #53566c;
  --mini-score-selected-bg: color-mix(in srgb, #8be9fd 14%, #303341);
  --selection-indicator: #8be9fd;
  --follow-star: #f1fa8c;
  --theme-surface: #303341;
  --theme-surface-muted: #282a36;
  --theme-surface-selected: color-mix(in srgb, #8be9fd 15%, #303341);
  --theme-text: #f8f8f2;
  --theme-muted: #b9b8ce;
  --theme-border: #53566c;
  --theme-focus: #8be9fd;
  --theme-positive: #80e89d;
  --theme-negative: #ff929d;
  --theme-warning: #f1d58c;
  --theme-info: #8be9fd;
  --theme-positive-bg: color-mix(in srgb, #80e89d 13%, #303341);
  --theme-negative-bg: color-mix(in srgb, #ff929d 13%, #303341);
  --theme-warning-bg: color-mix(in srgb, #f1d58c 13%, #303341);
  --theme-info-bg: color-mix(in srgb, #8be9fd 13%, #303341);
  --theme-solid: #8be9fd;
  --theme-shadow: #00000035;
  --theme-backdrop: #00000050;
}

/* Shared presentation roles: theme values belong here, not in components. */
:root {
  --suit-solid-display: inline;
  --suit-outline-display: none;
  --suit-outline-size: .78em;
  --suit-outline-stroke: .025em;
  --seat-nonvul-bg: var(--theme-surface-muted, #e7efe9);
  --seat-nonvul-text: var(--text-primary);
  --seat-nonvul-badge: var(--theme-solid, #2b5a48);
  --seat-nonvul-badge-text: var(--text-on-action);
  --seat-vul-bg: var(--theme-negative-bg, #f5dfdd);
  --seat-vul-text: var(--theme-negative, #863630);
  --seat-vul-badge: var(--theme-negative, #a84540);
  --seat-vul-badge-text: var(--text-on-action);
}
