/* KnightForever design tokens: colour, type, spacing, depth and motion, shared by the website (portal, register, patch notes),
   the WarFareWeb game page (its own copy, web/css/kf-tokens.css) and the retired Electron launcher's local pages.
   Canonical file: web/LauncherWebAppCore/wwwroot/css/kf-tokens.css. app/assets/kf-tokens.css is a byte-identical copy
   (node tools/brand/sync.js writes it, `npm run check` fails when the two differ). Fonts: ./fonts (SIL OFL 1.1, licences there). */
@font-face { font-family: 'Cinzel'; src: url('fonts/cinzel-kf.woff2') format('woff2'); font-weight: 400 800; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('fonts/inter-kf.woff2') format('woff2'); font-weight: 400 700; font-style: normal; font-display: swap; }

:root {
  color-scheme: dark;

  /* Charcoal, stone and aged brass; artwork supplies the faction colours. */
  --kf-ink-950: #0b0c0b;
  --kf-ink-900: #111310;
  --kf-ink-850: #171915;
  --kf-ink-800: #1d201a;
  --kf-ink-700: #292c23;
  --kf-ink-600: #353a2f;
  --kf-ink-500: #4e5545;

  /* gold: accents, primary actions, ornaments */
  --kf-gold-100: #f2e5c7;
  --kf-gold-200: #e2c99b;
  --kf-gold-300: #c9aa71;
  --kf-gold-400: #b9965e;
  --kf-gold-500: #a17c45;
  --kf-gold-600: #866333;
  --kf-gold-700: #5a4529;
  --kf-gold-gradient: linear-gradient(180deg, #d9bc85, #b68e50);
  --kf-gold-gradient-hover: linear-gradient(180deg, #e8cea0, #c7a066);

  /* Warm paper text on charcoal. */
  --kf-text: #eee8dc;
  --kf-text-muted: #b9b6aa;
  --kf-text-subtle: #96988a;
  --kf-text-on-gold: #1b1407;

  /* the two nations: secondary details only (badges, banners, gems, rules) */
  --kf-elmorad: #5b97f2;
  --kf-elmorad-deep: #1d3f7a;
  --kf-elmorad-tint: rgba(91, 151, 242, .14);
  --kf-karus: #e8625a;
  --kf-karus-deep: #6e1f1c;
  --kf-karus-tint: rgba(232, 98, 90, .14);

  /* state */
  --kf-success: #86d9a3;
  --kf-danger: #f39383;
  --kf-danger-tint: rgba(243, 147, 131, .1);
  --kf-warning: #f1c76e;

  /* surfaces and lines */
  --kf-surface: #191c17;
  --kf-surface-raised: #22251e;
  --kf-surface-sunken: #10120f;
  --kf-surface-glass: rgba(20, 23, 18, .94);
  --kf-line: rgba(201, 170, 113, .22);
  --kf-line-soft: rgba(241, 234, 216, .08);
  --kf-line-strong: rgba(201, 170, 113, .48);

  /* type */
  --kf-font-display: 'Cinzel', 'Trajan Pro', Georgia, 'Times New Roman', serif;
  --kf-font-text: 'Inter', 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --kf-font-mono: 'Cascadia Mono', Consolas, 'SFMono-Regular', monospace;
  --kf-fs-2xs: .6875rem;  /* 11 */
  --kf-fs-xs: .75rem;     /* 12 */
  --kf-fs-s: .8125rem;    /* 13 */
  --kf-fs-m: .9375rem;    /* 15 */
  --kf-fs-l: 1.125rem;    /* 18 */
  --kf-fs-xl: 1.5rem;     /* 24 */
  --kf-fs-2xl: 2rem;      /* 32 */
  --kf-fs-3xl: clamp(2.125rem, 1.4rem + 2.6vw, 3.5rem);
  --kf-tracking-caps: .14em;
  --kf-tracking-display: .04em;
  --kf-leading: 1.6;

  /* spacing (4 px steps) */
  --kf-space-1: 4px;
  --kf-space-2: 8px;
  --kf-space-3: 12px;
  --kf-space-4: 16px;
  --kf-space-5: 24px;
  --kf-space-6: 32px;
  --kf-space-7: 48px;
  --kf-space-8: 64px;
  --kf-gutter: clamp(16px, 4vw, 56px);

  /* shape, depth, motion */
  --kf-radius-1: 2px;
  --kf-radius-2: 2px;
  --kf-radius-3: 3px;
  --kf-shadow-1: 0 2px 10px rgba(0, 0, 0, .35);
  --kf-shadow-2: 0 18px 48px rgba(0, 0, 0, .55);
  --kf-glow-gold: 0 0 0 1px rgba(201, 170, 113, .3), 0 4px 14px rgba(0, 0, 0, .3);
  --kf-focus-ring: 0 0 0 2px var(--kf-ink-900), 0 0 0 4px var(--kf-gold-200);
  --kf-ease: cubic-bezier(.2, .7, .2, 1);
  --kf-duration: 160ms;
}

/* Korean, Chinese and Japanese: Cinzel and Inter are Latin subsets (fonts/*.woff2), so the CJK glyphs come from the system. Each
   language names its own platform fonts (macOS / iOS, Windows, Android / Linux) right after the Latin face: the Han characters
   of zh, ja and ko differ in form, and an unnamed fallback may pick another language's font. Matched per element (lang), so the
   Korean or Japanese item of the language menu gets its font on a page in any language. */
:lang(ko) {
  --kf-font-display: 'Cinzel', 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', 'Noto Sans CJK KR', 'Source Han Sans K', sans-serif;
  --kf-font-text: 'Inter', 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', 'Noto Sans CJK KR', 'Source Han Sans K', sans-serif;
}
:lang(zh) {
  --kf-font-display: 'Cinzel', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', 'Noto Sans SC', 'Noto Sans CJK SC', 'Source Han Sans SC', sans-serif;
  --kf-font-text: 'Inter', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', 'Noto Sans SC', 'Noto Sans CJK SC', 'Source Han Sans SC', sans-serif;
}
:lang(ja) {
  --kf-font-display: 'Cinzel', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic UI', 'Yu Gothic', 'Meiryo', 'Noto Sans JP', 'Noto Sans CJK JP', 'Source Han Sans', sans-serif;
  --kf-font-text: 'Inter', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic UI', 'Yu Gothic', 'Meiryo', 'Noto Sans JP', 'Noto Sans CJK JP', 'Source Han Sans', sans-serif;
}

/* Corner-bracket frame: a thin gold hairline with brighter L-shaped corners (cards, dialogs, panels).
   Set --kf-frame-fill for the panel background; the brackets are drawn as background layers, so ::before/::after stay free. */
.kf-frame {
  --kf-frame-fill: var(--kf-surface);
  --kf-frame-corner: var(--kf-gold-300);
  --kf-frame-size: 14px;
  --kf-frame-weight: 1.5px;
  border: 1px solid var(--kf-line);
  background:
    linear-gradient(var(--kf-frame-corner) 0 0) top left / var(--kf-frame-size) var(--kf-frame-weight) no-repeat,
    linear-gradient(var(--kf-frame-corner) 0 0) top left / var(--kf-frame-weight) var(--kf-frame-size) no-repeat,
    linear-gradient(var(--kf-frame-corner) 0 0) top right / var(--kf-frame-size) var(--kf-frame-weight) no-repeat,
    linear-gradient(var(--kf-frame-corner) 0 0) top right / var(--kf-frame-weight) var(--kf-frame-size) no-repeat,
    linear-gradient(var(--kf-frame-corner) 0 0) bottom left / var(--kf-frame-size) var(--kf-frame-weight) no-repeat,
    linear-gradient(var(--kf-frame-corner) 0 0) bottom left / var(--kf-frame-weight) var(--kf-frame-size) no-repeat,
    linear-gradient(var(--kf-frame-corner) 0 0) bottom right / var(--kf-frame-size) var(--kf-frame-weight) no-repeat,
    linear-gradient(var(--kf-frame-corner) 0 0) bottom right / var(--kf-frame-weight) var(--kf-frame-size) no-repeat,
    var(--kf-frame-fill);
}

/* Ornamental rule: a gold line with a diamond in the middle (section dividers, headings). */
.kf-rule {
  display: flex; align-items: center; gap: var(--kf-space-3); color: var(--kf-gold-300);
}
.kf-rule::before, .kf-rule::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--kf-line-strong)); }
.kf-rule::after { background: linear-gradient(90deg, var(--kf-line-strong), transparent); }

/* Hide visually, keep for screen readers. */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

@media (prefers-reduced-motion: reduce) {
  :root { --kf-duration: 0ms; }
}
