:root {
  --brand-secondary: #98613b;
  --brand-background: #f7f1e8;
  --board-light: #f7ead9;
  --board-dark: #e8d6c2;
  --photo-background: radial-gradient(ellipse at 49% 38%, var(--board-light), var(--board-dark));
  --accent-line: #cda899;
}

:root[data-theme="salvia"], .theme-option[data-palette="salvia"] {
  --paper: #eef3ed;
  --surface: #fbfdf9;
  --linen: #dce9df;
  --ink: #21362c;
  --dim: #4e665b;
  --line: #c7d7cb;
  --clay: #285c49;
  --clay-dark: #194737;
  --rose: #dceee2;
  --accent-line: #8fb4a4;
  --brand-secondary: #875f2e;
  --brand-background: #eef3ed;
  --board-light: #eef4e7;
  --board-dark: #d5e6d6;
}

:root[data-theme="inchiostro"], .theme-option[data-palette="inchiostro"] {
  --paper: #ecf0f7;
  --surface: #fafcff;
  --linen: #dde7f5;
  --ink: #212e49;
  --dim: #50617c;
  --line: #c8d5e6;
  --clay: #2e5188;
  --clay-dark: #203c6e;
  --rose: #dfe8fa;
  --accent-line: #9eb1d0;
  --brand-secondary: #986124;
  --brand-background: #ecf0f7;
  --board-light: #edf3fb;
  --board-dark: #d6e3f3;
}

:root[data-theme="malva"], .theme-option[data-palette="malva"] {
  --paper: #f4eef4;
  --surface: #fffaff;
  --linen: #efdfef;
  --ink: #382838;
  --dim: #6b5269;
  --line: #e0cfe0;
  --clay: #784976;
  --clay-dark: #5f315d;
  --rose: #f1def0;
  --accent-line: #c3a1c0;
  --brand-secondary: #536b48;
  --brand-background: #f4eef4;
  --board-light: #f8eef7;
  --board-dark: #ead8e9;
}

:root[data-theme="petrolio"], .theme-option[data-palette="petrolio"] {
  --paper: #eaf3f4;
  --surface: #f7fdfd;
  --linen: #d9eced;
  --ink: #1d3339;
  --dim: #4b6670;
  --line: #c3dadd;
  --clay: #225d6a;
  --clay-dark: #164551;
  --rose: #d9edf1;
  --accent-line: #94b7bf;
  --brand-secondary: #a05032;
  --brand-background: #eaf3f4;
  --board-light: #e8f6f6;
  --board-dark: #cfe7ea;
}

:root[data-theme="lilla"], .theme-option[data-palette="lilla"] {
  --paper: #f2eff9;
  --surface: #fcfaff;
  --linen: #e8e0f5;
  --ink: #302542;
  --dim: #605472;
  --line: #d9cde9;
  --clay: #65428f;
  --clay-dark: #4d3276;
  --rose: #e8def8;
  --accent-line: #b5a1d5;
  --brand-secondary: #4e5da0;
  --brand-background: #f2eff9;
  --board-light: #f5f1fb;
  --board-dark: #e1d8f1;
}

:root[data-theme="ardesia"], .theme-option[data-palette="ardesia"] {
  --paper: #edf0f4;
  --surface: #fafbfc;
  --linen: #e0e5ea;
  --ink: #283039;
  --dim: #505b68;
  --line: #ccd3dc;
  --clay: #404c5a;
  --clay-dark: #2e3846;
  --rose: #e0e7ee;
  --accent-line: #a2afc0;
  --brand-secondary: #536d8c;
  --brand-background: #edf0f4;
  --board-light: #f3f5f7;
  --board-dark: #dbe2ea;
}

:root[data-theme="ghiaccio"], .theme-option[data-palette="ghiaccio"] {
  --paper: #edf5fa;
  --surface: #f9fdff;
  --linen: #deedf6;
  --ink: #203645;
  --dim: #496173;
  --line: #cadce8;
  --clay: #245e7a;
  --clay-dark: #18455f;
  --rose: #dceef9;
  --accent-line: #97bacf;
  --brand-secondary: #4458a6;
  --brand-background: #edf5fa;
  --board-light: #eef8fc;
  --board-dark: #d4e9f6;
}

.theme-option[data-palette="terracotta"] { --clay: #873b2d; --brand-secondary: #98613b; }
.theme-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(138px, 1fr)); gap: 8px; }
.theme-option {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 4px 8px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font-size: .88rem;
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
}
.theme-option input { margin: 0; accent-color: var(--clay); }
.theme-option:has(input:checked) { outline: 2px solid var(--clay); outline-offset: -2px; }
.theme-option > :last-child { grid-column: 2; }
.theme-swatches { display: flex; gap: 3px; }
.theme-swatches i { width: 24px; height: 15px; border-radius: 4px; background: var(--clay); }
.theme-swatches i + i { background: var(--brand-secondary); }
