/* The Nightmap base layer: what every new-interface page gets before any component. Reads css/nm-tokens.css only (no literal colours: npm run lint:ui).
   Scoped to .ui (put it on <body> of a page built on the new system) so it cannot touch a legacy page that happens to load it. */
@layer ui.base {
  .ui, .ui *, .ui *::before, .ui *::after { box-sizing: border-box; }
  body.ui { margin: 0; background: var(--ui-night); }
  /* .ui also goes on a piece of the new interface placed in an old page (the sheet, a toast), so it carries type and colour but no background */
  .ui {
    color: var(--ui-text);
    font: 400 var(--ui-size-body) / var(--ui-lh-body) var(--ui-font-sans);
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
    text-rendering: optimizeLegibility;
  }
  @media (min-width: 1024px) { .ui { --ui-gutter: 24px; } }

  /* The seven type steps. Use the class, not a font-size. */
  .ui-display { font: 700 var(--ui-size-display) / var(--ui-lh-display) var(--ui-font-serif); letter-spacing: -0.02em; margin: 0; }
  .ui-title   { font: 700 var(--ui-size-title) / var(--ui-lh-title) var(--ui-font-serif); letter-spacing: -0.01em; margin: 0; }
  .ui-heading { font: 600 var(--ui-size-heading) / var(--ui-lh-heading) var(--ui-font-sans); margin: 0; }
  .ui-body    { font: 400 var(--ui-size-body) / var(--ui-lh-body) var(--ui-font-sans); }
  .ui-small   { font: 400 var(--ui-size-small) / var(--ui-lh-small) var(--ui-font-sans); }
  .ui-label   { font: 600 var(--ui-size-label) / var(--ui-lh-label) var(--ui-font-sans); color: var(--ui-muted); }
  .ui-data    { font-family: var(--ui-font-mono); font-variant-numeric: tabular-nums; font-feature-settings: "zero" 0; }
  @media (max-width: 599px) { .ui-display { font-size: 34px; line-height: 36px; } }

  .ui-text-2 { color: var(--ui-text-2); }
  .ui-muted  { color: var(--ui-muted); }

  .ui p { margin: 0 0 var(--ui-space-3); color: var(--ui-text-2); }
  .ui a { color: var(--ui-accent); text-underline-offset: 3px; }
  .ui :focus-visible { outline: 2px solid var(--ui-focus); outline-offset: 2px; }
  .ui ::selection { background: var(--ui-accent); color: var(--ui-on-accent); }
  .ui hr { border: 0; border-top: 1px solid var(--ui-line); margin: var(--ui-space-5) 0; }

  /* Icons: one family, drawn from the sprite (images/nm-icons.svg, built by scripts/build-icon-sprite.js).
     <svg class="ui-icon" aria-hidden="true"><use href="/images/nm-icons.svg#i-map"></use></svg> */
  .ui-icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
  .ui-icon--small { width: 16px; height: 16px; }
  .ui-icon--large { width: 24px; height: 24px; }

  /* No spaced capitals: these labels are still set that way by the pages' older styles */
  html.ui2 :is(.nmw-group, .nmw-tag, .nm-fov-stat-label, #panel h3, #panel h4, .tag, .lbl, .card-label, .result-label, .hud-label, #new-card label) { text-transform: none; letter-spacing: 0; }

  .ui-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
