/* ==========================================================================
   BASE — shared by the TV and the phone.
   Self-hosted typeface, surface texture, and the z-index scale.
   Loaded FIRST, before host.css / play.css.
   ========================================================================== */

/* Outfit variable, self-hosted so a bad venue connection can never leave the
   game rendering in Arial mid-party. One file covers weights 100-900. */
@font-face {
  font-family: 'Outfit';
  src: url('/fonts/outfit-variable.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-ui: 'Outfit', 'Segoe UI', system-ui, -apple-system, sans-serif;

  /* Weighted easing. Browser default ase feels weightless on press;
     this curve settles like something with mass behind it. */
  --ease: cubic-bezier(.32, .72, 0, 1);

  /* One z-index scale, so nothing has to guess at 9999. */
  --z-base: 0;
  --z-raised: 10;
  --z-sticky: 30;
  --z-overlay: 50;
  --z-modal: 60;
  --z-toast: 70;
  --z-grain: 100;
}

/* Dark scrollbars, dark native form controls. */
:root { color-scheme: dark; }

/* --------------------------------------------------------------------------
   Surface grain.
   Flat vector surfaces read as cheap on a large TV. This is a fixed, inert
   noise layer that breaks up the flatness without costing a request - the
   texture is generated by an SVG filter in a data URI.
   -------------------------------------------------------------------------- */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: var(--z-grain);
  pointer-events: none;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------------------
   Motion.
   The game leans on slams, pops and pulses. Anyone who has asked their OS to
   calm motion down gets a still version rather than no game.
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  body::after { opacity: .02; }
}

/* --------------------------------------------------------------------------
   Focus.
   Everything here is tap-driven, but the TV screen advances on Space/Enter,
   so keyboard users need to see where they are. `:focus-visible` keeps the
   ring off mouse clicks.
   -------------------------------------------------------------------------- */
:where(button, a, input, textarea, select, [tabindex]):focus-visible {
  outline: 3px solid var(--gold, #ebc95a);
  outline-offset: 3px;
  border-radius: 8px;
}

/* Skip link for keyboard users on the phone client. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: var(--z-toast);
  background: var(--surface, #1b1b28);
  color: var(--text, #f4f4fa);
  padding: 12px 18px;
  border-radius: 0 0 10px 0;
  font-weight: 700;
}
.skip-link:focus {
  left: 0;
}

/* Numbers that change in place must not jitter as digit widths shift. */
.tabular {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}