:root {
  /* Default Theme: Library */
  --shell-bg: #d6cdc0;
  --bg: #f9f3e8;
  --bg-grad: radial-gradient(ellipse at 20% 85%, rgba(196,122,43,0.07) 0%, transparent 55%);
  --surface: rgba(249,243,232,0.92);
  --border: rgba(61,47,30,0.1);
  --text: #3d2f1e;
  --text-muted: #9a7a52;
  --heading: #2a1f0e;
  --accent: #c47a2b;
  --word-hover: rgba(196,122,43,0.13);
  --word-active: #f4d08a;
  --word-active-fg: #2a1f0e;
  --popup-bg: #231806;
  --popup-fg: #f5e6c8;
  --popup-word-fg: #f4d08a;
  --popup-note-fg: #a8896a;
  --popup-pos-fg: #7a6040;
  --popup-shadow: 0 8px 28px rgba(0,0,0,0.32);
  --popup-border-color: rgba(196,122,43,0.25);
  --popup-radius: 10px;
  --btn-bg: #c47a2b;
  --btn-fg: #fff;
  --btn-radius: 10px;
  --progress-bg: rgba(61,47,30,0.1);
  --tag-bg: #c47a2b;
  --tag-fg: #fff;
  --tag-radius: 5px;
  --tag-border: none;
  --settings-icon-color: #9a7a52;
  --header-border: 1px solid rgba(61,47,30,0.1);
  --chapter-num-color: rgba(196,122,43,0.15);

  /* Default Font: Serif */
  --display-font: 'Playfair Display', serif;
  --body-font: 'Lora', serif;
  --body-weight: 400;
  --chapter-title-font: 'Playfair Display', serif;
  --chapter-title-style: italic;
  --chapter-letter-spacing: 0.01em;
  --chapter-text-transform: none;
}

[data-theme="midnight"] {
  --shell-bg: #04090f;
  --bg: #0a1118;
  --bg-grad: radial-gradient(ellipse at 50% 0%, rgba(20,50,80,0.55) 0%, transparent 65%);
  --surface: rgba(10,17,24,0.92);
  --border: rgba(255,255,255,0.07);
  --text: #c0cfe6;
  --text-muted: #3e5670;
  --heading: #dce8f8;
  --accent: #5ce0d8;
  --word-hover: rgba(92,224,216,0.09);
  --word-active: rgba(92,224,216,0.2);
  --word-active-fg: #ffffff;
  --popup-bg: #081622;
  --popup-fg: #dce8f8;
  --popup-word-fg: #5ce0d8;
  --popup-note-fg: #3e5670;
  --popup-pos-fg: #263a4a;
  --popup-shadow: 0 0 0 1px rgba(92,224,216,0.14), 0 16px 40px rgba(0,0,0,0.75);
  --popup-border-color: transparent;
  --popup-radius: 10px;
  --btn-bg: rgba(92,224,216,0.1);
  --btn-fg: #5ce0d8;
  --btn-radius: 10px;
  --btn-border: 1px solid rgba(92,224,216,0.22);
  --progress-bg: rgba(255,255,255,0.06);
  --tag-bg: rgba(92,224,216,0.1);
  --tag-fg: #5ce0d8;
  --tag-radius: 5px;
  --tag-border: 1px solid rgba(92,224,216,0.28);
  --settings-icon-color: #3e5670;
  --header-border: 1px solid rgba(255,255,255,0.07);
  --chapter-num-color: rgba(92,224,216,0.08);
}

[data-theme="studio"] {
  --shell-bg: #cdc8c0;
  --bg: #f4efe9;
  --bg-grad: none;
  --surface: #f4efe9;
  --border: rgba(0,0,0,0.85);
  --text: #1a1a1a;
  --text-muted: #888;
  --heading: #1a1a1a;
  --accent: #e8391a;
  --word-hover: rgba(232,57,26,0.07);
  --word-active: #e8391a;
  --word-active-fg: #fff;
  --popup-bg: #1a1a1a;
  --popup-fg: #f4efe9;
  --popup-word-fg: #e8391a;
  --popup-note-fg: #777;
  --popup-pos-fg: #444;
  --popup-shadow: 4px 4px 0 #e8391a;
  --popup-border-color: #e8391a;
  --popup-radius: 0;
  --btn-bg: #e8391a;
  --btn-fg: #fff;
  --btn-radius: 0;
  --progress-bg: rgba(0,0,0,0.12);
  --tag-bg: #e8391a;
  --tag-fg: #fff;
  --tag-radius: 0;
  --tag-border: none;
  --settings-icon-color: #888;
  --header-border: 2px solid #1a1a1a;
  --chapter-num-color: rgba(232,57,26,0.1);
  --chapter-letter-spacing: 0.08em;
  --chapter-text-transform: uppercase;
}

[data-font="modern"] {
  --display-font: 'DM Serif Display', serif;
  --body-font: Lexend, sans-serif;
  --body-weight: 300;
  --chapter-title-font: 'DM Serif Display', serif;
  --chapter-title-style: normal;
}
