/* Layer order is declared here, in the first stylesheet the page loads, so the
   cascade does not depend on the order the <link> tags happen to be in. */
@layer tokens, reset, layout, components, animations;

@layer reset {
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

  * {
    margin: 0;
  }

  html {
    -webkit-text-size-adjust: 100%;
  }

  body {
    min-height: 100svh;
    font-family: var(--font-ui);
    font-size: var(--text-body);
    line-height: 1.5;
    color: var(--ink);
    background: var(--void);
    -webkit-font-smoothing: antialiased;
  }

  img,
  svg {
    display: block;
    max-width: 100%;
  }

  button {
    font: inherit;
    color: inherit;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
  }

  /* The whole game is played by keyboard, so the focus ring is not negotiable.
     Gold rather than the UA default because the UA blue vanishes on the panel. */
  :focus-visible {
    outline: 2px solid var(--gold-bright);
    outline-offset: 3px;
    border-radius: 4px;
  }

  [hidden] {
    display: none !important;
  }

  /* Visible only to screen readers. Used for the live region that narrates
     hit/miss, which must not take space next to the spell card. */
  .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }

  /* The player holds the orb buttons down in fast succession; a double-tap
     zoom or a text selection in the middle of a run is pure damage. */
  .orb-key,
  .orb-slot {
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
  }
}
