/* ==========================================================================
   Design tokens — Obsidian & Crown Amber Dark / Warm Alabaster & Burnished Bronze Light
   Every colour, radius and type size in the v2 console resolves through these
   names. Dark is the primary palette; light is a full equivalent so the
   shared "crTheme" preference keeps working.
   ========================================================================== */

:root {
  color-scheme: light dark;

  &:has(> head > meta[name="color-scheme"][content="dark"]) {
    color-scheme: dark;
  }
  &:has(> head > meta[name="color-scheme"][content="light"]) {
    color-scheme: light;
  }

  /* Surfaces — Warm Alabaster */
  --bg: #F6F4EE;
  --surface: #FFFFFF;
  --surface-1: #FFFFFF;
  --surface-2: #EEECE4;
  --surface-3: #E5E1D6;
  --surface-hover: #DDD8CA;
  --line: rgba(21, 20, 17, 0.10);
  --line-strong: rgba(21, 20, 17, 0.18);
  --card-matte-depth: linear-gradient(180deg, rgba(255, 255, 255, 0.72) 0%, rgba(255, 255, 255, 0) 100%);

  /* Text */
  --text: #161411;
  --text-1: #161411;
  --text-2: #57534B;
  --text-3: #837D72;
  --text-inverse: #FFFFFF;

  /* Brand + semantic — Burnished Bronze */
  --accent: #9A6406;
  --accent-hover: #7D5004;
  --accent-ink: #FFFFFF;
  --accent-soft: rgba(154, 100, 6, 0.11);
  --btn-primary-bg: linear-gradient(180deg, #A97009 0%, #865705 100%);
  --btn-primary-text: #FFFFFF;
  --btn-primary-shadow: 0 1px 2px rgba(21, 20, 17, 0.18), 0 2px 8px rgba(154, 100, 6, 0.25);
  --brand: #9A6406;
  --pos: #15803D;
  --pos-soft: rgba(21, 128, 61, 0.11);
  --warn: #B45309;
  --warn-soft: rgba(180, 83, 9, 0.11);
  --neg: #DC2626;
  --neg-soft: rgba(220, 38, 38, 0.10);
  --info: #0F766E;
  --info-soft: rgba(15, 118, 110, 0.10);
  --short: #B45309;          /* 3-day (shortened) war marker — warm bronze amber */
  --short-soft: rgba(180, 83, 9, 0.12);
  --gold: #B47B0A;
  --silver: #68635A;
  --bronze: #9A5318;

  /* Effects */
  --scrim: rgba(22, 20, 17, 0.56);
  --shadow-1: 0 1px 3px rgba(21, 20, 17, 0.08);
  --shadow-card: 0 2px 10px rgba(21, 20, 17, 0.05), 0 1px 2px rgba(21, 20, 17, 0.04);
  --shadow-hover: 0 8px 22px rgba(21, 20, 17, 0.09), 0 2px 6px rgba(21, 20, 17, 0.05);
  --shadow-topbar: 0 1px 4px rgba(21, 20, 17, 0.05);
  --shadow-bottom: 0 -4px 18px rgba(21, 20, 17, 0.08);
  --shadow-inset: inset 0 1px 2px rgba(21, 20, 17, 0.06);
  --shadow-pop: 0 18px 42px rgba(21, 20, 17, 0.16);
  --border-subtle: rgba(21, 20, 17, 0.06);
  --stripe-bg: rgba(21, 20, 17, 0.022);
  --sticky-shadow: 6px 0 12px -6px rgba(21, 20, 17, 0.12);
  --focus: 0 0 0 3px rgba(154, 100, 6, 0.32);

  /* Shape + type */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-pill: 999px;
  --font-sans: "Plus Jakarta Sans", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
  --fs-xs: 11px;
  --fs-sm: 12.5px;
  --fs-md: 14px;
  --fs-lg: 16px;
  --fs-xl: 20px;
  --fs-2xl: 28px;

  /* Layout */
  --topbar-h: 56px;
  --gutter: clamp(12px, 2vw, 28px);

  /* War-log tiles */
  --wl-w: 46px;
  --wl-h: 30px;
  --wl-gap: 3px;
}

.theme-dark {
  color-scheme: dark;

  /* Surfaces — Obsidian Slate */
  --bg: #0A0B0E;
  --surface: #12141C;
  --surface-1: #12141C;
  --surface-2: #181B25;
  --surface-3: #202431;
  --surface-hover: #282D3D;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.15);
  --card-matte-depth: linear-gradient(180deg, rgba(255, 244, 222, 0.03) 0%, rgba(255, 255, 255, 0) 100%);

  /* Text — Warm Ivory Contrast */
  --text: #F4F2ED;
  --text-1: #F4F2ED;
  --text-2: #ADA89F;
  --text-3: #757068;
  --text-inverse: #120E05;

  /* Crown Amber Primary + Emerald/Teal Secondary */
  --accent: #E5A93B;
  --accent-hover: #F0BC58;
  --accent-ink: #120E05;
  --accent-soft: rgba(229, 169, 59, 0.14);
  --btn-primary-bg: linear-gradient(180deg, #EFC05B 0%, #D99B26 100%);
  --btn-primary-text: #120E05;
  --btn-primary-shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 2px 10px rgba(229, 169, 59, 0.24);
  --brand: #E5A93B;

  /* Semantic Status Palette */
  --pos: #22C58E;
  --pos-soft: rgba(34, 197, 142, 0.12);
  --warn: #F59E0B;
  --warn-soft: rgba(245, 158, 11, 0.13);
  --neg: #F25F68;
  --neg-soft: rgba(242, 95, 104, 0.13);
  --info: #2DD4BF;
  --info-soft: rgba(45, 212, 191, 0.12);
  --short: #D97706;
  --short-soft: rgba(217, 119, 6, 0.14);
  --gold: #E5A93B;
  --silver: #A8A298;
  --bronze: #D97724;

  /* Effects */
  --scrim: rgba(6, 7, 10, 0.78);
  --shadow-1: 0 1px 3px rgba(0, 0, 0, 0.42), 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.36), inset 0 1px 0 rgba(255, 248, 232, 0.04);
  --shadow-hover: 0 10px 26px rgba(0, 0, 0, 0.48), 0 2px 8px rgba(0, 0, 0, 0.28);
  --shadow-topbar: 0 1px 8px rgba(0, 0, 0, 0.34);
  --shadow-bottom: 0 -4px 22px rgba(0, 0, 0, 0.50);
  --shadow-inset: inset 0 1px 2px rgba(0, 0, 0, 0.32);
  --shadow-pop: 0 20px 48px rgba(0, 0, 0, 0.68);
  --border-subtle: rgba(255, 255, 255, 0.055);
  --stripe-bg: rgba(255, 255, 255, 0.022);
  --sticky-shadow: 6px 0 14px -6px rgba(0, 0, 0, 0.60);
  --focus: 0 0 0 3px rgba(229, 169, 59, 0.38);

  /* Shape aliases kept symmetric */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-pill: 999px;
}
