/* ==========================================================================
   Font fallback layer for systems without the fonts this app assumes
   (bare Linux: no Segoe UI, no Myanmar script font, no color emoji).

   Technique: @font-face ALIASES for the families the stylesheets already
   name ('Segoe UI', 'Consolas', 'Cascadia Mono'), split by unicode-range
   with local() sources first. On Windows/mac/Android local() wins and
   NOTHING changes; elsewhere the bundled files fill in — Latin via Inter,
   Burmese via Noto Sans Myanmar, emoji via a 208 KB subset of Noto Color
   Emoji. This reaches EVERY rule that names these families, including
   `font:` shorthands and js-injected styles, which per-element fallback
   lists never could. Fonts are SIL OFL — see fonts/OFL.txt.

   CRITICAL STRUCTURE RULE — uniform weight buckets:
   Blink picks the best-matching WEIGHT bucket for a family first and only
   then applies unicode-range within that bucket; if the winning bucket
   doesn't cover the character, the whole family is skipped (no retry at
   another weight). So every family here has exactly two buckets, 100-500
   and 600-900, and EACH bucket carries all three segments (Latin catch-all,
   emoji, Myanmar). A face with a different weight descriptor (or none,
   which means exact 400) would form its own bucket, win for some weights,
   and silently knock out every script it doesn't cover.
   Also: every unicode-range token must be valid — one bad token drops the
   whole descriptor and the face then claims U+0-10FFFF.
   ========================================================================== */

/* ---- 'Segoe UI' alias ----------------------------------------------------
   Latin/symbol ranges deliberately EXCLUDE the Myanmar blocks
   (U+1000-109F, A9E0-A9FF, AA60-AA7F) and the emoji set used by the app
   (U+1F000-1FAFF, 2600-27BF, 2B00-2BFF, FE0F, 200D, 203C, 2049). */

/* -- bucket 100-500 -- */
@font-face {
  font-family: 'Segoe UI';
  src: local('Segoe UI'), url('../fonts/Inter-Variable.ttf') format('truetype');
  unicode-range: U+0000-0FFF, U+10A0-1FFF, U+2000-203B, U+203D-2048, U+204A-25FF, U+2800-2AFF, U+2C00-A9DF, U+AA80-FE0E, U+FE10-1EFFF;
  font-weight: 100 500;
  font-display: swap;
}
@font-face {
  font-family: 'Segoe UI';
  src: local('Segoe UI Emoji'), url('../fonts/NotoColorEmoji.ttf') format('truetype');
  unicode-range: U+1F000-1FAFF, U+2600-27BF, U+2B00-2BFF, U+FE0F, U+200D, U+2049, U+203C;
  font-weight: 100 500;
  font-display: swap;
}
@font-face {
  font-family: 'Segoe UI';
  src: local('Myanmar Text'), url('../fonts/NotoSansMyanmar-Regular.ttf') format('truetype');
  unicode-range: U+1000-109F, U+A9E0-A9FF, U+AA60-AA7F;
  font-weight: 100 500;
  font-display: swap;
}
/* -- bucket 600-900 -- */
@font-face {
  font-family: 'Segoe UI';
  src: local('Segoe UI'), url('../fonts/Inter-Variable.ttf') format('truetype');
  unicode-range: U+0000-0FFF, U+10A0-1FFF, U+2000-203B, U+203D-2048, U+204A-25FF, U+2800-2AFF, U+2C00-A9DF, U+AA80-FE0E, U+FE10-1EFFF;
  font-weight: 600 900;
  font-display: swap;
}
@font-face {
  font-family: 'Segoe UI';
  src: local('Segoe UI Emoji'), url('../fonts/NotoColorEmoji.ttf') format('truetype');
  unicode-range: U+1F000-1FAFF, U+2600-27BF, U+2B00-2BFF, U+FE0F, U+200D, U+2049, U+203C;
  font-weight: 600 900;
  font-display: swap;
}
@font-face {
  font-family: 'Segoe UI';
  src: local('Myanmar Text Bold'), local('Myanmar Text'), url('../fonts/NotoSansMyanmar-Bold.ttf') format('truetype');
  unicode-range: U+1000-109F, U+A9E0-A9FF, U+AA60-AA7F;
  font-weight: 600 900;
  font-display: swap;
}

/* ---- 'Arial' alias --------------------------------------------------------
   Buttons/inputs never get a font-family from the app's stylesheets, so they
   sit on the UA default (Arial). Windows resolves local('Arial') and is
   untouched; Linux maps Arial to DejaVu (no Myanmar, no emoji), so these
   faces route button text to the bundled fonts. */
/* -- bucket 100-500 -- */
@font-face {
  font-family: 'Arial';
  src: local('Arial'), url('../fonts/Inter-Variable.ttf') format('truetype');
  unicode-range: U+0000-0FFF, U+10A0-1FFF, U+2000-203B, U+203D-2048, U+204A-25FF, U+2800-2AFF, U+2C00-A9DF, U+AA80-FE0E, U+FE10-1EFFF;
  font-weight: 100 500;
  font-display: swap;
}
@font-face {
  font-family: 'Arial';
  src: local('Segoe UI Emoji'), url('../fonts/NotoColorEmoji.ttf') format('truetype');
  unicode-range: U+1F000-1FAFF, U+2600-27BF, U+2B00-2BFF, U+FE0F, U+200D, U+2049, U+203C;
  font-weight: 100 500;
  font-display: swap;
}
@font-face {
  font-family: 'Arial';
  src: local('Myanmar Text'), url('../fonts/NotoSansMyanmar-Regular.ttf') format('truetype');
  unicode-range: U+1000-109F, U+A9E0-A9FF, U+AA60-AA7F;
  font-weight: 100 500;
  font-display: swap;
}
/* -- bucket 600-900 -- */
@font-face {
  font-family: 'Arial';
  src: local('Arial Bold'), local('Arial'), url('../fonts/Inter-Variable.ttf') format('truetype');
  unicode-range: U+0000-0FFF, U+10A0-1FFF, U+2000-203B, U+203D-2048, U+204A-25FF, U+2800-2AFF, U+2C00-A9DF, U+AA80-FE0E, U+FE10-1EFFF;
  font-weight: 600 900;
  font-display: swap;
}
@font-face {
  font-family: 'Arial';
  src: local('Segoe UI Emoji'), url('../fonts/NotoColorEmoji.ttf') format('truetype');
  unicode-range: U+1F000-1FAFF, U+2600-27BF, U+2B00-2BFF, U+FE0F, U+200D, U+2049, U+203C;
  font-weight: 600 900;
  font-display: swap;
}
@font-face {
  font-family: 'Arial';
  src: local('Myanmar Text Bold'), local('Myanmar Text'), url('../fonts/NotoSansMyanmar-Bold.ttf') format('truetype');
  unicode-range: U+1000-109F, U+A9E0-A9FF, U+AA60-AA7F;
  font-weight: 600 900;
  font-display: swap;
}

/* ---- 'Consolas' alias ----------------------------------------------------- */
/* -- bucket 100-500 -- */
@font-face {
  font-family: 'Consolas';
  src: local('Consolas'), local('DejaVu Sans Mono'), local('Liberation Mono'), url('../fonts/Inter-Variable.ttf') format('truetype');
  unicode-range: U+0000-0FFF, U+10A0-1FFF, U+2000-203B, U+203D-2048, U+204A-25FF, U+2800-2AFF, U+2C00-A9DF, U+AA80-FE0E, U+FE10-1EFFF;
  font-weight: 100 500;
  font-display: swap;
}
@font-face {
  font-family: 'Consolas';
  src: local('Segoe UI Emoji'), url('../fonts/NotoColorEmoji.ttf') format('truetype');
  unicode-range: U+1F000-1FAFF, U+2600-27BF, U+2B00-2BFF, U+FE0F, U+200D, U+2049, U+203C;
  font-weight: 100 500;
  font-display: swap;
}
@font-face {
  font-family: 'Consolas';
  src: local('Myanmar Text'), url('../fonts/NotoSansMyanmar-Regular.ttf') format('truetype');
  unicode-range: U+1000-109F, U+A9E0-A9FF, U+AA60-AA7F;
  font-weight: 100 500;
  font-display: swap;
}
/* -- bucket 600-900 -- */
@font-face {
  font-family: 'Consolas';
  src: local('Consolas'), local('DejaVu Sans Mono'), local('Liberation Mono'), url('../fonts/Inter-Variable.ttf') format('truetype');
  unicode-range: U+0000-0FFF, U+10A0-1FFF, U+2000-203B, U+203D-2048, U+204A-25FF, U+2800-2AFF, U+2C00-A9DF, U+AA80-FE0E, U+FE10-1EFFF;
  font-weight: 600 900;
  font-display: swap;
}
@font-face {
  font-family: 'Consolas';
  src: local('Segoe UI Emoji'), url('../fonts/NotoColorEmoji.ttf') format('truetype');
  unicode-range: U+1F000-1FAFF, U+2600-27BF, U+2B00-2BFF, U+FE0F, U+200D, U+2049, U+203C;
  font-weight: 600 900;
  font-display: swap;
}
@font-face {
  font-family: 'Consolas';
  src: local('Myanmar Text Bold'), local('Myanmar Text'), url('../fonts/NotoSansMyanmar-Bold.ttf') format('truetype');
  unicode-range: U+1000-109F, U+A9E0-A9FF, U+AA60-AA7F;
  font-weight: 600 900;
  font-display: swap;
}

/* ---- 'Cascadia Mono' alias (single face = single bucket, safe) ------------ */
@font-face {
  font-family: 'Cascadia Mono';
  src: local('Cascadia Mono'), local('DejaVu Sans Mono'), url('../fonts/Inter-Variable.ttf') format('truetype');
  unicode-range: U+0000-0FFF, U+10A0-1FFF, U+2000-203B, U+203D-2048, U+204A-25FF, U+2800-2AFF, U+2C00-A9DF, U+AA80-FE0E, U+FE10-1EFFF;
  font-weight: 100 900;
  font-display: swap;
}

/* ---- plain-name faces (used by anything that names them directly) -------- */
@font-face {
  font-family: 'Inter';
  src: url('../fonts/Inter-Variable.ttf') format('truetype');
  unicode-range: U+0000-0FFF, U+10A0-1FFF, U+2000-203B, U+203D-2048, U+204A-25FF, U+2800-2AFF, U+2C00-A9DF, U+AA80-FE0E, U+FE10-1EFFF;
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'Noto Sans Myanmar';
  src: url('../fonts/NotoSansMyanmar-Regular.ttf') format('truetype');
  font-weight: 100 500;
  font-display: swap;
}
@font-face {
  font-family: 'Noto Sans Myanmar';
  src: url('../fonts/NotoSansMyanmar-Bold.ttf') format('truetype');
  font-weight: 600 900;
  font-display: swap;
}
@font-face {
  font-family: 'Noto Color Emoji';
  src: url('../fonts/NotoColorEmoji.ttf') format('truetype');
  font-display: swap;
}
