/**
 * Критические переменные палитры — до основного theme.css и inline.
 */
html[data-palette="guild-dark"] {
  color-scheme: dark;
  --gv-page-bg: #1a1410;
  --gv-page-bg-gradient-1: rgba(212, 168, 75, 0.08);
  --gv-page-bg-gradient-2: rgba(155, 127, 212, 0.06);
  --gv-ink: #f4e4c1;
  --gv-ink-70: rgba(244, 228, 193, 0.78);
  --gv-ink-60: rgba(244, 228, 193, 0.66);
  --gv-ink-55: rgba(244, 228, 193, 0.6);
  --gv-ink-50: rgba(244, 228, 193, 0.54);
  --gv-gold: #d4a84b;
  --gv-mana: #9b7fd4;
  --gv-parchment-from: rgba(58, 48, 36, 0.95);
  --gv-parchment-to: rgba(42, 34, 24, 0.98);
  --gv-parchment-border: rgba(212, 168, 75, 0.35);
  --gv-parchment-inset: rgba(255, 235, 200, 0.08);
  --gv-parchment-shadow: rgba(0, 0, 0, 0.5);
  --gv-toolbar-bg: rgba(0, 0, 0, 0.85);
  --gv-border-gold-25: rgba(212, 168, 75, 0.25);
}

/* Молочный голубой — 60-30-10 */
html[data-palette="guild-milk"] {
  color-scheme: light;
  --gv-page-bg: #e4eef6;
  --gv-page-bg-gradient-1: rgba(184, 207, 226, 0.5);
  --gv-page-bg-gradient-2: rgba(143, 184, 210, 0.28);
  --gv-ink: #1a2d42;
  --gv-ink-70: #2f4156;
  --gv-ink-60: #3d5268;
  --gv-ink-55: #455a70;
  --gv-ink-50: #4d6378;
  --gv-gold: #0d6e7a;
  --gv-mana: #5b7fa8;
  --gv-parchment-from: #f6fafc;
  --gv-parchment-to: #c5d8e8;
  --gv-parchment-border: rgba(91, 127, 168, 0.42);
  --gv-parchment-inset: rgba(255, 255, 255, 0.92);
  --gv-parchment-shadow: rgba(26, 45, 66, 0.1);
  --gv-toolbar-bg: rgba(232, 242, 250, 0.98);
  --gv-border-gold-25: rgba(13, 110, 122, 0.3);
  --gv-surface-40: rgba(255, 255, 255, 0.72);
  --gv-surface-50: rgba(248, 252, 255, 0.82);
  --gv-border-gold-30: rgba(13, 110, 122, 0.36);
  --gv-mobile-nav-from: #e8f2f8;
  --gv-mobile-nav-to: #d4e4f0;
}

html[data-palette="guild-milk"] .mode-toolbar-nav-link,
html[data-palette="guild-milk"] .mode-toolbar [data-top-nav] {
  color: var(--gv-ink-70) !important;
  background: var(--gv-surface-50) !important;
  border-color: var(--gv-border-gold-25) !important;
}

html[data-palette="guild-milk"] .scene-guildhall::before,
html[data-palette="guild-milk"] .scene-quests::before,
html[data-palette="guild-milk"] .scene-boss::before,
html[data-palette="guild-milk"] .scene-achievements::before,
html[data-palette="guild-milk"] .scene-shop::before {
  background-image: linear-gradient(180deg, #eef4f9 0%, #c5d8e8 100%) !important;
  filter: none !important;
}

html[data-palette="guild-milk"] .section-scene::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.35) 0%,
    rgba(197, 216, 232, 0.25) 100%
  ) !important;
}

html[data-palette="guild-milk"] .scene-quests::after {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.2) 0%,
    rgba(197, 216, 232, 0.12) 56%,
    rgba(197, 216, 232, 0.06) 100%
  ) !important;
}

html[data-palette="guild-milk"] .section-scene {
  border-color: var(--gv-border-gold-25) !important;
}

html[data-palette="guild-milk"][data-mobile-ui] .mobile-chrome p.text-\[10px\] {
  color: var(--gv-ink-55) !important;
}

html[data-palette="guild-milk"][data-mobile-ui] #section-home > h2.text-gold,
html[data-palette="guild-milk"][data-mobile-ui] #section-home .parchment-card,
html[data-palette="guild-milk"][data-mobile-ui] #section-home .parchment-card p,
html[data-palette="guild-milk"][data-mobile-ui] #section-home .text-ink\/90 {
  color: var(--gv-ink) !important;
}

/* Пыльная роза (#c4a493) — 60-30-10 */
html[data-palette="guild-dust"] {
  color-scheme: light;
  --gv-page-bg: #f0e6e0;
  --gv-page-bg-gradient-1: rgba(196, 164, 147, 0.38);
  --gv-page-bg-gradient-2: rgba(180, 150, 130, 0.24);
  --gv-ink: #3d2c24;
  --gv-ink-70: #57443a;
  --gv-ink-60: #655248;
  --gv-ink-55: #756258;
  --gv-ink-50: #857268;
  --gv-gold: #7c4a2d;
  --gv-mana: #9a7b6a;
  --gv-parchment-from: #faf5f2;
  --gv-parchment-to: #c4a493;
  --gv-parchment-border: rgba(124, 74, 45, 0.34);
  --gv-parchment-inset: rgba(255, 252, 250, 0.92);
  --gv-parchment-shadow: rgba(61, 44, 36, 0.12);
  --gv-toolbar-bg: rgba(240, 230, 224, 0.98);
  --gv-border-gold-25: rgba(124, 74, 45, 0.28);
  --gv-surface-40: rgba(255, 252, 250, 0.78);
  --gv-surface-50: rgba(250, 245, 242, 0.88);
  --gv-border-gold-30: rgba(124, 74, 45, 0.36);
  --gv-mobile-nav-from: #ede4df;
  --gv-mobile-nav-to: #dcc9be;
}

html[data-palette="guild-dust"] .mode-toolbar-nav-link,
html[data-palette="guild-dust"] .mode-toolbar [data-top-nav] {
  color: var(--gv-ink-70) !important;
  background: var(--gv-surface-50) !important;
  border-color: var(--gv-border-gold-25) !important;
}

html[data-palette="guild-dust"] .scene-guildhall::before,
html[data-palette="guild-dust"] .scene-quests::before,
html[data-palette="guild-dust"] .scene-boss::before,
html[data-palette="guild-dust"] .scene-achievements::before,
html[data-palette="guild-dust"] .scene-shop::before {
  background-image: linear-gradient(180deg, #faf5f2 0%, #c4a493 100%) !important;
  filter: none !important;
}

html[data-palette="guild-dust"] .section-scene::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(255, 252, 250, 0.4) 0%,
    rgba(196, 164, 147, 0.22) 100%
  ) !important;
}

html[data-palette="guild-dust"] .scene-quests::after {
  background: linear-gradient(
    90deg,
    rgba(255, 252, 250, 0.22) 0%,
    rgba(196, 164, 147, 0.14) 56%,
    rgba(196, 164, 147, 0.08) 100%
  ) !important;
}

html[data-palette="guild-dust"] .section-scene {
  border-color: var(--gv-border-gold-25) !important;
}

html[data-palette="guild-dust"][data-mobile-ui] .mobile-chrome p.text-\[10px\] {
  color: var(--gv-ink-55) !important;
}

html[data-palette="guild-dust"][data-mobile-ui] #section-home > h2.text-gold,
html[data-palette="guild-dust"][data-mobile-ui] #section-home .parchment-card,
html[data-palette="guild-dust"][data-mobile-ui] #section-home .parchment-card p,
html[data-palette="guild-dust"][data-mobile-ui] #section-home .text-ink\/90 {
  color: var(--gv-ink) !important;
}

/* Лесная изумруд — 60% #edf3ed · 30% #b8c9b0 · 10% #1b6b4a */
html[data-palette="guild-forest"] {
  color-scheme: light;
  --gv-page-bg: #edf3ed;
  --gv-page-bg-gradient-1: rgba(168, 196, 168, 0.42);
  --gv-page-bg-gradient-2: rgba(120, 160, 130, 0.26);
  --gv-ink: #1a2e24;
  --gv-ink-70: #2a4236;
  --gv-ink-60: #3d5248;
  --gv-ink-55: #4a6256;
  --gv-ink-50: #5a7266;
  --gv-gold: #1b6b4a;
  --gv-mana: #5b8a72;
  --gv-parchment-from: #f4faf4;
  --gv-parchment-to: #b8c9b0;
  --gv-parchment-border: rgba(27, 107, 74, 0.32);
  --gv-parchment-inset: rgba(255, 255, 255, 0.9);
  --gv-parchment-shadow: rgba(26, 46, 36, 0.1);
  --gv-toolbar-bg: rgba(237, 243, 237, 0.98);
  --gv-border-gold-25: rgba(27, 107, 74, 0.26);
  --gv-surface-40: rgba(255, 255, 255, 0.76);
  --gv-surface-50: rgba(244, 250, 244, 0.88);
  --gv-border-gold-30: rgba(27, 107, 74, 0.34);
  --gv-mobile-nav-from: #e8f0e8;
  --gv-mobile-nav-to: #d4e4d4;
}

html[data-palette="guild-forest"] .mode-toolbar-nav-link,
html[data-palette="guild-forest"] .mode-toolbar [data-top-nav] {
  color: var(--gv-ink-70) !important;
  background: var(--gv-surface-50) !important;
  border-color: var(--gv-border-gold-25) !important;
}

html[data-palette="guild-forest"] .scene-guildhall::before,
html[data-palette="guild-forest"] .scene-quests::before,
html[data-palette="guild-forest"] .scene-boss::before,
html[data-palette="guild-forest"] .scene-achievements::before,
html[data-palette="guild-forest"] .scene-shop::before {
  background-image: linear-gradient(180deg, #f4faf4 0%, #b8c9b0 100%) !important;
  filter: none !important;
}

html[data-palette="guild-forest"] .section-scene::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.38) 0%,
    rgba(168, 196, 168, 0.2) 100%
  ) !important;
}

html[data-palette="guild-forest"] .scene-quests::after {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.2) 0%,
    rgba(168, 196, 168, 0.12) 56%,
    rgba(168, 196, 168, 0.06) 100%
  ) !important;
}

html[data-palette="guild-forest"] .section-scene {
  border-color: var(--gv-border-gold-25) !important;
}

html[data-palette="guild-forest"][data-mobile-ui] .mobile-chrome p.text-\[10px\] {
  color: var(--gv-ink-55) !important;
}

html[data-palette="guild-forest"][data-mobile-ui] #section-home > h2.text-gold,
html[data-palette="guild-forest"][data-mobile-ui] #section-home .parchment-card,
html[data-palette="guild-forest"][data-mobile-ui] #section-home .parchment-card p,
html[data-palette="guild-forest"][data-mobile-ui] #section-home .text-ink\/90 {
  color: var(--gv-ink) !important;
}
