/* One sheet of the player's design system (tickets/T19-room-for-two.md).
   style.css keeps the fonts, the tokens and the reset; every area has its
   own file from there, linked in index.html in this order — the cascade is
   the order of the <link>s, not of a bundler. A ticket works in its sheet.
   No @import: it serialises the requests, which is the cost being avoided. */

/* ---------- Water + grain (from bestmate.fr) ---------- */
#ripple { position: fixed; inset: 0; z-index: 0; width: 100%; height: 100%; pointer-events: none; }
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  /* Relative to THIS sheet, not to the page: css/ is one level down. */
  background: url("../assets/grain.webp") repeat;
  background-size: 256px 256px;
  mix-blend-mode: hard-light;
  opacity: var(--grain-base-opacity);
  transition: opacity 320ms ease;
  animation: grain-jump 800ms steps(1, end) infinite;
  will-change: opacity;
}
body.is-graining::after { opacity: var(--grain-opacity); transition-duration: 140ms; }
@keyframes grain-jump {
  0%   { background-position: 0 0; }
  12%  { background-position: -151px -216px; }
  25%  { background-position: 194px 86px; }
  37%  { background-position: -86px 237px; }
  50%  { background-position: 259px -108px; }
  62%  { background-position: -237px 151px; }
  75%  { background-position: 108px -259px; }
  87%  { background-position: 216px 194px; }
  100% { background-position: -129px -65px; }
}
