/* Effects and animation for Sales Report. Everything here is decoration on top of app.css:
   the pages must read and work exactly the same with this file empty.

   fx.js adds every "fx-" class and element. Nothing is hidden by this file alone: the rules
   that hide something need a class that fx.js adds and then takes away.
   Movement uses the scale / translate / rotate properties so it never fights the transforms
   app.css already gives a ticket, its coin, the ribbon or the wordmark stamp. */

/* ---- raid themes --------------------------------------------------------------------------- */

/* A profile takes its mood from the raid its member clears most, and a report from its own
   raid. Three layers sit behind the page, back to front:
   1. the raid's picture, fixed to the window so the place stays put while the page scrolls,
      a little out of focus, under a wash of the raid's own colour and a soft vignette, and
      sinking into the ground toward the bottom of the window;
   2. a dark band down the middle, as wide as the column of words, so everything written on
      the bare ground reads as it did on plain black. It is thinner over the first 420px of
      the page, where the picture shows through behind the header;
   3. the weather fx.js draws on a canvas.
   Panels keep their solid ground. The body goes see-through so the layers show; the same
   ground colour is on <html>. Nothing here moves, so it all stays with reduced motion.
   The band is in two pieces so that only the short top piece needs a mask: measured, a mask
   on a layer as tall as the page cost more than everything else here put together. */
body[data-theme] {
  --fx-wash: #8f8d88;
  /* Half the width of the dark band behind the words. A page with something wider than the
     column (the raid cards on a wide screen, app.css) sets --band-half to match. */
  --fx-half: var(--band-half, 606px);
  --fx-band: linear-gradient(90deg, transparent calc(50% - var(--fx-half) - 94px), rgba(15, 15, 16, 0.92) calc(50% - var(--fx-half)), rgba(15, 15, 16, 0.92) calc(50% + var(--fx-half)), transparent calc(50% + var(--fx-half) + 94px));
  position: relative; background: transparent;
}
body[data-theme="deep-stone-crypt"] { --fx-wash: #9cc3ec; }
body[data-theme="vault-of-glass"] { --fx-wash: #6fb7ae; }
body[data-theme="garden-of-salvation"] { --fx-wash: #7fae5a; }
body[data-theme="last-wish"] { --fx-wash: #c98bd8; }
body[data-theme="vow-of-the-disciple"] { --fx-wash: #86a04e; }
body[data-theme="kings-fall"] { --fx-wash: #b3bd9c; }
body[data-theme="root-of-nightmares"] { --fx-wash: #e88fc0; }
body[data-theme="crotas-end"] { --fx-wash: #4fd17a; }
body[data-theme="salvations-edge"] { --fx-wash: #e4613c; }
body[data-theme^="the-desert-perpetual"] { --fx-wash: #cfa767; }
body[data-theme="leviathan"], body[data-theme="eater-of-worlds"], body[data-theme="spire-of-stars"] { --fx-wash: #b78fd8; }
body[data-theme="scourge-of-the-past"] { --fx-wash: #e3843a; }
body[data-theme="crown-of-sorrow"] { --fx-wash: #9a6fe2; }
body[data-theme^="pantheon"] { --fx-wash: #e0c56f; }
/* the dungeons */
body[data-theme="shattered-throne"] { --fx-wash: #9fb4d8; }
body[data-theme="pit-of-heresy"] { --fx-wash: #c8483c; }
body[data-theme="prophecy"] { --fx-wash: #e58fc7; }
body[data-theme="grasp-of-avarice"] { --fx-wash: #d9a73c; }
body[data-theme="duality"] { --fx-wash: #b3506f; }
body[data-theme="spire-of-the-watcher"] { --fx-wash: #d6a45a; }
body[data-theme="ghosts-of-the-deep"] { --fx-wash: #4fb3b0; }
body[data-theme="warlords-ruin"] { --fx-wash: #aab8cc; }
body[data-theme="vespers-host"] { --fx-wash: #5aa8d8; }
body[data-theme="sundered-doctrine"] { --fx-wash: #7fae5f; }
body[data-theme="equilibrium"] { --fx-wash: #b9a8e6; }
body[data-theme]::before {
  /* a little bigger than the window, so the blur has picture to work with at the edges, and
     longer at the bottom for when a phone's address bar slides away */
  content: ""; position: fixed; inset: -28px -28px -120px; z-index: -3; pointer-events: none;
  background-image:
    linear-gradient(180deg, transparent 35%, rgba(15, 15, 16, 0.68)),
    radial-gradient(ellipse 80% 90% at 50% 30%, transparent 45%, rgba(8, 8, 9, 0.7)),
    linear-gradient(180deg, color-mix(in srgb, var(--fx-wash) 30%, transparent), color-mix(in srgb, var(--fx-wash) 10%, transparent) 75%),
    var(--theme-art, none);
  background-position: center, center, center, center 30%; background-size: cover; background-repeat: no-repeat;
  filter: blur(5px) saturate(1.1) brightness(0.72);
}
body[data-theme]::after, body[data-theme] main::before {
  content: ""; position: absolute; left: 0; right: 0; z-index: -2; pointer-events: none; background: var(--fx-band);
}
/* from 420px down: as tall as the rest of the page, and never shorter than the window */
body[data-theme]::after { top: 420px; bottom: 0; min-height: calc(100svh - 420px); }
/* the first 420px: thinner at the top */
body[data-theme] main::before {
  top: 0; height: 420px;
  -webkit-mask-image: linear-gradient(rgba(0, 0, 0, 0.45), #000); mask-image: linear-gradient(rgba(0, 0, 0, 0.45), #000);
}
@media (max-width: 680px) {
  /* A phone has no room beside the column, so the picture gets more of the top of the page.
     The band is whole again by 300px: the first words on the bare ground start just under
     that on a phone (a report's small labels), and measured they were hard to read through a thin one. */
  body[data-theme] main::before { -webkit-mask-image: linear-gradient(rgba(0, 0, 0, 0.3), #000 300px); mask-image: linear-gradient(rgba(0, 0, 0, 0.3), #000 300px); }
}
/* The few words that sit on the bare ground up there get a soft dark edge, as titles on art do. */
body[data-theme] .who-head .lately, body[data-theme] .who-head .links { text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9), 0 0 10px rgba(0, 0, 0, 0.8); }
.fx-weather { position: fixed; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; }

/* ---- things fx.js draws on the pages ------------------------------------------------------- */

/* One canvas over the whole window, for bursts and fireworks. */
.fx-sky { position: fixed; inset: 0; z-index: 60; width: 100%; height: 100%; pointer-events: none; }

/* A clipped layer over a raid's picture and scrim. It comes first in the art, so the title,
   the tags and the ribbon (later, same or higher z-index) stay on top of it. */
.fx-layer { position: absolute; inset: 0; z-index: 1; overflow: hidden; pointer-events: none; }
.fx-layer > * { position: absolute; }

/* Contest and day one: embers on a canvas and a low glow in the brand's vermilion. */
.fx-embers { inset: 0; width: 100%; height: 100%; mix-blend-mode: screen; }
.fx-glow {
  inset: 35% 0 0; opacity: 0;
  background: radial-gradient(90% 100% at 50% 100%, color-mix(in srgb, var(--brand) 44%, transparent), color-mix(in srgb, var(--brand) 13%, transparent) 50%, transparent 76%);
}
[data-dayone] .fx-glow { inset: 15% 0 0; }

/* The light that follows the pointer over the picture. fx.js moves it with a transform. */
.fx-sheen {
  left: 0; top: 0; width: 80%; aspect-ratio: 1; margin: -40% 0 0 -40%; border-radius: 50%; opacity: 0;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--text) 29%, transparent), color-mix(in srgb, var(--text) 8%, transparent) 55%, transparent);
}

/* Server fastest: lines that cross the picture. Each is as wide as the picture and starts
   just off its left edge; the gradient decides how long the visible line is. */
.fx-streaks { inset: 0; }
.fx-streaks i {
  position: absolute; left: -100%; width: 100%; height: 2px; border-radius: 2px; opacity: 0;
  background: linear-gradient(90deg, transparent 35%, var(--text) 92%, #fff);
}
.fx-streaks i:nth-child(1) { top: 17%; }
.fx-streaks i:nth-child(2) { top: 30%; animation-delay: 90ms; background: linear-gradient(90deg, transparent 60%, var(--text)); }
.fx-streaks i:nth-child(3) { top: 46%; height: 3px; animation-delay: 30ms; background: linear-gradient(90deg, transparent 25%, var(--brand)); }
.fx-streaks i:nth-child(4) { top: 59%; animation-delay: 170ms; background: linear-gradient(90deg, transparent 50%, var(--text)); }
.fx-streaks i:nth-child(5) { top: 73%; height: 1px; animation-delay: 60ms; }
.fx-streaks i:nth-child(6) { top: 87%; animation-delay: 220ms; background: linear-gradient(90deg, transparent 65%, var(--text)); }

/* The word from the wordmark's stamp, huge, for the easter egg. It is asked for (five passes
   over the stamp), a little see-through, and gone again in a second and a half. */
.fx-big {
  position: fixed; left: 50%; top: 44%; z-index: 61; pointer-events: none;
  translate: -50% -50%; rotate: -9deg; opacity: 0;
  padding: 0.06em 0.22em 0; border: 0.07em solid var(--brand); border-radius: 0.12em; color: var(--brand);
  font-size: clamp(4.5rem, 22vw, 15rem); font-stretch: 72%; font-weight: 800; line-height: 1; letter-spacing: 0.1em;
  text-transform: uppercase; white-space: nowrap;
}

/* ---- the shower joke ----------------------------------------------------------------------- */

/* A shower head bolted to the note's top right corner, water falling from it, and the smell
   coming off the number. All of it sits behind the words (z-index -1 inside the note), so
   the note reads the same. Without movement this is a still drawing. */
.note.shower { position: relative; isolation: isolate; }
.note.shower b { position: relative; }
.fx-shower { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.fx-head { position: absolute; right: -1px; top: -13px; width: 64px; height: 40px; overflow: visible; color: var(--faint); transform-origin: 100% 18%; }
.fx-head .fx-bell { fill: var(--panel-2); }
.fx-drop {
  --fx-o: 0.5;
  position: absolute; top: 17px; right: calc(27px - var(--fx-x)); width: 2px; height: 9px; border-radius: 2px;
  background: var(--text); opacity: calc(var(--fx-o) * 0.8);
  transform: translate(calc(var(--fx-x) * 0.6 * var(--fx-p)), calc(58px * var(--fx-p)));
}
.fx-stink { position: absolute; left: 3px; bottom: 100%; width: 34px; height: 12px; pointer-events: none; color: var(--faint); }
.fx-stink svg { display: block; width: 100%; height: 100%; overflow: visible; }
.fx-stink path { opacity: 0.75; }
@media (max-width: 680px) {
  /* The words wrap under the shower head on a phone, so it steps back. */
  .fx-head { opacity: 0.6; }
  .fx-drop { --fx-o: 0.3; }
}

/* ---- the sticker book ------------------------------------------------------------------------ */

/* Once fx.js has the book: the spreads lie on top of one another and only the open one shows.
   The others keep their place (hidden, not taken away), so the book is as tall as its tallest
   spread and nothing under it jumps as the pages turn. (The pages themselves are the book
   section of app.css.) */
.tome.fx-book { position: relative; gap: 0; touch-action: pan-y; }
/* a link that lands on a spread, or the book being brought into view, leaves room above it for
   the small pictures and the buttons */
.fx-book .spread { grid-area: 1 / 1; visibility: hidden; scroll-margin-top: 176px; }
.fx-book .fx-here, .fx-book .fx-from { visibility: visible; }
/* over the book: where you are, and back and on */
.fx-turner { display: flex; align-items: center; gap: var(--s2); margin-bottom: var(--s3); color: var(--muted); font-size: 0.8125rem; }
.fx-turner span { margin-right: auto; }
/* The outer edge of each page also turns it, as a real page would be taken by its edge. These
   two are for the pointer only; the buttons above do the same for the keyboard. */
.fx-edge { position: absolute; z-index: 6; top: 0; bottom: 0; width: 30px; padding: 0; border: 0; background: none; cursor: pointer; }
.fx-edge:first-of-type { left: 0; border-radius: 10px 0 0 10px; }
.fx-edge:last-of-type { right: 0; border-radius: 0 10px 10px 0; }
.fx-edge::before {
  content: ""; position: absolute; top: calc(50% - 7px); left: calc(50% - 7px); width: 14px; height: 14px; rotate: 90deg; opacity: 0;
  background: var(--text); -webkit-mask: url("/assets/chevron.svg") center / contain no-repeat; mask: url("/assets/chevron.svg") center / contain no-repeat;
}
.fx-edge:last-of-type::before { rotate: -90deg; }
.fx-edge:hover { background: rgba(255, 255, 255, 0.04); }
.fx-edge:hover::before { opacity: 0.8; }
.fx-edge:disabled { display: none; }
@media (max-width: 900px) { .fx-edge { display: none; } }
.fx-turner .btn:disabled { background: transparent; color: var(--faint); cursor: default; }
/* On a narrow screen a spread is one long page, and they are not all one length: there the
   book is as tall as the page that is open, and the others are taken out of the way. */
@media (max-width: 900px) { .fx-book .spread:not(.fx-here, .fx-from) { display: none; } }

/* ---- run strips ------------------------------------------------------------------------------ */

/* Once fx.js has hold of a raid card's strip: a hand for dragging it, a fade on whichever side
   has more runs, and the link to history kept back until every run has been drawn, since it
   stands for the old end. (The strip's own layout is the "run strip" part of app.css.) */
.strip.fx-strip {
  --fx-l: 0px; --fx-r: 0px; cursor: grab;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 var(--fx-l), #000 calc(100% - var(--fx-r)), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 var(--fx-l), #000 calc(100% - var(--fx-r)), transparent);
}
/* The strip's own slim bar, drawn by fx.js just under it: where you are among every run of the
   raid. The handle can be dragged and the track pressed. It takes the space whether or not
   there is anything to scroll, so every card keeps the same height. */
.fx-bar { position: relative; height: 14px; margin: calc(6px - var(--s4)) 0 -5px; cursor: pointer; touch-action: none; }
.fx-bar::before { content: ""; position: absolute; left: 0; right: 0; top: 6px; height: 2px; border-radius: 1px; background: var(--line); }
.fx-thumb { position: absolute; right: 0; top: 4px; height: 6px; min-width: 28px; border-radius: 3px; background: var(--line-2); cursor: grab; }
.fx-bar:hover .fx-thumb { background: var(--faint); }
.fx-bar.fx-held .fx-thumb { background: var(--muted); cursor: grabbing; }
.fx-bar.fx-idle { visibility: hidden; }
@media (pointer: coarse) {
  /* Under a finger the bar sits clear of the strip's own band, and it and its handle are
     taller to the touch than they look. */
  .fx-bar { height: 30px; margin: -2px 0 -17px; }
  .fx-thumb::after { content: ""; position: absolute; inset: -6px 0 -20px; }
}
.strip.fx-older { --fx-l: 26px; }
.strip.fx-newer { --fx-r: 26px; }
.strip.fx-strip a { -webkit-user-drag: none; -webkit-user-select: none; user-select: none; }
.strip.fx-strip:not(.fx-whole) .all { display: none; }
.strip.fx-drag { cursor: grabbing; }
.strip.fx-drag .dot { pointer-events: none; }

/* The card about one run, beside the mark that is pointed at or focused. It never takes the
   pointer, so the mark under it still opens the report. Marks and team colours in it are the
   site's own. */
.fx-runcard {
  position: fixed; left: 0; top: 0; z-index: 45; pointer-events: none; display: grid; gap: 1px;
  padding: 8px 12px 9px; border: 1px solid var(--line-2); border-radius: var(--radius);
  background: var(--panel-2); color: var(--muted); font-size: 0.8125rem; line-height: 1.45; white-space: nowrap;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.55);
}
.fx-runcard[hidden] { display: none; }
/* Held open by a touch (fx.js): it takes the finger, and carries the way into the report. */
.fx-runcard.fx-held { pointer-events: auto; }
.fx-rc-open { justify-content: center; height: 40px; margin-top: 8px; }
.strip .dot.fx-picked { outline: 2px solid var(--text); outline-offset: 2px; }
.fx-rc-top { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 0.9375rem; font-weight: 650; }
.fx-rc-top .tier.t0 { color: var(--text); font-weight: 650; }
.fx-rc-facts { display: flex; }
.fx-rc-facts span + span::before { content: "\00b7"; margin: 0 6px; color: var(--faint); }
/* its pointer toward the mark; fx.js says how far along the edge it sits */
.fx-runcard::after {
  content: ""; position: absolute; left: var(--fx-ax, 50%); bottom: -5px; width: 8px; height: 8px; margin-left: -4px; rotate: 45deg;
  background: inherit; border: solid var(--line-2); border-width: 0 1px 1px 0;
}
.fx-runcard.fx-below::after { top: -5px; bottom: auto; border-width: 1px 0 0 1px; }

/* ---- pigeons on a cheated clear -------------------------------------------------------------- */

/* A roost is a row of pigeons standing on the top edge of the thing it is put on. The report's
   picture clips what is inside it, so its roost is a row of no height just above it instead. */
.cheatnote, tr.cheated td.lead { position: relative; }
.fx-roost { position: absolute; left: 0; right: 0; bottom: 100%; height: 0; pointer-events: none; }
.fx-roost.fx-top { position: relative; z-index: 2; display: block; bottom: auto; }
.fx-pigeon { position: absolute; bottom: -3px; width: 38px; height: 34px; overflow: visible; scale: var(--fx-way) 1; }
.fx-small .fx-pigeon { width: 28px; height: 25px; }
.fx-tiny .fx-pigeon { width: 22px; height: 19px; bottom: -2px; }
/* on a raid's name: its feet on the capitals, not on the headroom above them */
.raid .art h2 .fx-pigeon { bottom: -7px; }

/* The checkpoint king's car, parked on the raid's name: a small yellow hatchback with one red
   door. Its yellow is a plain car yellow, not the solo gold, and the door is the brand's red.
   It takes the pointer so its title shows; nothing else sits under it. */
.fx-car { position: absolute; left: 2px; bottom: -6px; width: 39px; height: 22px; overflow: visible; pointer-events: auto; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.7)); }
.fx-car .y { fill: #f4d63c; }
.fx-car .d { fill: var(--brand); }
.fx-car .w { fill: #232326; }
.fx-car .a { fill: var(--text); }
.fx-car .k { fill: #1c1c1f; stroke: #f1efe9; stroke-width: 0.7; }
.fx-car .h { fill: var(--muted); }
@media (max-width: 680px) {
  /* A phone's picture has room for half of them. */
  .fx-top .fx-pigeon:nth-child(2n) { display: none; }
}
/* grey birds, red feet, an orange eye */
.fx-pigeon .r { fill: var(--muted); }
.fx-pigeon .q { fill: #6a6966; }
.fx-pigeon .s { fill: var(--faint); }
.fx-pigeon .a { fill: var(--text); }
.fx-pigeon .d { fill: var(--brand); }
.fx-pigeon .l { fill: none; stroke: var(--brand); stroke-width: 1.3; stroke-linecap: round; }

/* ---- George -------------------------------------------------------------------------------- */

/* The plain note becomes the owner's own picture of George, cut out of its background and
   leaning in from the bottom corner of the window, with a paper speech bubble. Three states: fx-off (out of sight, before he first
   comes up), plain (smaller, peeking over the edge, bubble shut) and fx-up (up and talking).
   Print keeps the plain note. */
@media screen {
  .george.fx-george {
    position: fixed; right: 0; bottom: 0; z-index: 40; display: flex; align-items: flex-end; gap: 8px;
    margin: 0; padding: 0; border: 0; background: none; pointer-events: none;
  }
  .fx-george > * { pointer-events: auto; }
  .fx-bubble {
    position: relative; display: grid; gap: 2px; width: min(310px, 100vw - 220px); margin-bottom: 78px;
    padding: 11px 40px 12px 14px; border-radius: 10px; background: #f1efe9; color: #121213;
    opacity: 0; visibility: hidden; scale: 0.85; transform-origin: 100% 100%;
  }
  /* the bubble's tail, pointing at his mouth */
  .fx-bubble::after {
    content: ""; position: absolute; right: -11px; bottom: 14px; width: 20px; height: 16px; background: inherit;
    clip-path: polygon(0 0, 100% 75%, 0 100%);
  }
  .fx-up .fx-bubble { opacity: 1; visibility: visible; scale: 1; }
  /* the brand's vermilion and the muted grey, darkened so they read on paper */
  .fx-george .who { color: #b23a25; }
  .fx-george .why { color: #57554f; }
  .fx-gx {
    position: absolute; top: 4px; right: 4px; display: grid; place-content: center; width: 30px; height: 30px;
    padding: 0; border: 0; border-radius: 6px; background: none; color: #57554f; cursor: pointer;
  }
  .fx-gx:hover { background: rgba(18, 18, 19, 0.1); color: #121213; }
  .fx-gx svg { width: 14px; height: 14px; }
  /* Peeking, he is smaller and a little under half of him is below the edge of the window. */
  .fx-gface {
    flex: none; width: 172px; padding: 0; border: 0; border-radius: 10px; background: none; cursor: pointer;
    transform-origin: 100% 100%; scale: 0.62; translate: 0 27%;
  }
  .fx-up .fx-gface { scale: 1; translate: 0 0; }
  .fx-off .fx-gface { translate: 0 108%; }
  /* closed with a finger: gone from the page, once he has slid away */
  .george.fx-gone { display: none; }
  /* No frame: the picture is a cut-out (its background is transparent), with a paper-white
     edge drawn round the cut like a die-cut sticker. Its own bottom and right edges are where
     the photograph ends, so he sits hard against the corner of the window and they never show.
     The picture is 398 by 383 and is never shown bigger than that. */
  .fx-gframe {
    position: relative; display: block; aspect-ratio: 398 / 383;
    filter: drop-shadow(2px 0 0 #f1efe9) drop-shadow(-2px 0 0 #f1efe9) drop-shadow(0 -2px 0 #f1efe9) drop-shadow(0 0 9px rgba(0, 0, 0, 0.55));
  }
  .fx-gframe > * { position: absolute; inset: 0; width: 100%; height: 100%; }
  /* The cut-out jaw. The cut runs along the bottom of his top teeth, so they stay put while
     his lower lip and chin drop; it keeps clear of his hand and the phone. The dark patch is
     the mouth behind it, and lies wholly under the jaw while the jaw is up. Both shapes were
     measured on the picture's own pixels and are written as percentages of it. */
  .fx-gjaw { clip-path: polygon(46.98% 35.38%, 49.25% 36.16%, 51.76% 36.5%, 54.52% 36.5%, 57.04% 36.03%, 59.3% 35.12%, 61.81% 33.94%, 64.32% 34.2%, 66.08% 38.64%, 65.33% 44.91%, 62.31% 50.13%, 56.78% 53.26%, 52.01% 53%, 50% 49.61%, 49.25% 43.34%, 47.49% 39.16%); }
  .fx-gmouth { background: #1a0907; clip-path: polygon(47.24% 35.64%, 49.25% 36.16%, 51.76% 36.5%, 54.52% 36.5%, 57.04% 36.03%, 59.3% 35.12%, 61.43% 34.2%, 60.55% 36.29%, 58.29% 38.12%, 54.52% 39.16%, 51.26% 39.16%, 47.86% 39.03%); }
  .fx-jaw-open .fx-gjaw { translate: 0 2.6%; }
  /* while a line is being typed, the letters still to come and the second line wait */
  .fx-typing .fx-ch:not(.fx-on), .fx-typing .why { opacity: 0; }

  @media (max-width: 680px) {
    .george.fx-george { left: 8px; right: 0; bottom: 0; }
    .fx-bubble { flex: 1; width: auto; margin-bottom: 40px; }
    .fx-gface { width: 108px; }
    /* peeking on a phone he is smaller still: the corner he sits in is somebody's last row */
    .fx-george:not(.fx-up) .fx-gface { scale: 0.5; }
    .fx-gx { width: 40px; height: 40px; }
  }
  /* A phone on its side: he only peeks there unless he is pressed (fx.js), and smaller. */
  @media (max-height: 520px) { .fx-george:not(.fx-up) .fx-gface { scale: 0.36; } }
  @media (pointer: coarse) { .fx-gx { width: 40px; height: 40px; } }
}

/* ---- everything that moves ----------------------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {

  /* Sold: the ribbon is held back until its card is on screen, then stamped on. */
  .art.fx-wait .sold { opacity: 0; }
  .sold.fx-stamp { animation: fx-stamp 440ms cubic-bezier(0.25, 0.8, 0.3, 1) backwards; }
  @keyframes fx-stamp {
    0% { opacity: 0; scale: 2.6; }
    40% { opacity: 1; scale: 0.9; }
    62% { scale: 1.06; }
    100% { scale: 1; }
  }
  /* The picture takes the knock. (Clipped, not hidden: a box that scrolls keeps to its shape
     whatever is in it, and on a phone the picture has to grow for its tags, app.css.) */
  .art.fx-thud { overflow: clip; }
  .art.fx-thud img { animation: fx-thud 320ms ease-out; }
  @keyframes fx-thud { 0% { scale: 1.05; } }
  /* Now and then the ribbon catches the light. */
  .art .sold { overflow: hidden; }
  .art .sold::after {
    content: ""; position: absolute; inset: 0; translate: -100% 0;
    background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, 0.54) 50%, transparent 62%);
  }
  .art .sold.fx-glint::after { animation: fx-sweep 900ms ease-in-out; }
  @keyframes fx-sweep { to { translate: 100% 0; } }

  /* The book's pages turn about the spine. While a leaf turns, the spread it leaves and the one
     it goes to are both on show: the leaf is the right page of one and the left page of the
     other, back to back, and each is hidden while its back is toward you. The other two pages
     lie still, one being uncovered and one being covered. */
  @media (min-width: 901px) {
    .fx-book .fx-from .page, .fx-book .fx-to .page { z-index: 1; }
    .fx-book .page.left { transform-origin: 100% 50%; }
    .fx-book .page.right { transform-origin: 0 50%; }
    .fx-next .fx-from .page.right, .fx-next .fx-to .page.left, .fx-prev .fx-from .page.left, .fx-prev .fx-to .page.right {
      z-index: 3; backface-visibility: hidden; animation: 720ms cubic-bezier(0.45, 0.05, 0.3, 1) both;
    }
    .fx-next .fx-from .page.right { animation-name: fx-leaf-away-left; }
    .fx-next .fx-to .page.left { animation-name: fx-leaf-down-left; }
    .fx-prev .fx-from .page.left { animation-name: fx-leaf-away-right; }
    .fx-prev .fx-to .page.right { animation-name: fx-leaf-down-right; }
    /* the paper goes into shade as it stands on edge */
    @keyframes fx-leaf-away-left {
      from { transform: perspective(2600px) rotateY(0deg); }
      50% { filter: brightness(0.5); }
      to { transform: perspective(2600px) rotateY(-180deg); }
    }
    @keyframes fx-leaf-down-left {
      from { transform: perspective(2600px) rotateY(180deg); }
      50% { filter: brightness(0.5); }
      to { transform: perspective(2600px) rotateY(0deg); }
    }
    @keyframes fx-leaf-away-right {
      from { transform: perspective(2600px) rotateY(0deg); }
      50% { filter: brightness(0.5); }
      to { transform: perspective(2600px) rotateY(180deg); }
    }
    @keyframes fx-leaf-down-right {
      from { transform: perspective(2600px) rotateY(-180deg); }
      50% { filter: brightness(0.5); }
      to { transform: perspective(2600px) rotateY(0deg); }
    }
  }
  /* A narrow screen shows one page at a time, so there the page slips out and the next slips in. */
  @media (max-width: 900px) {
    .fx-book .fx-from { position: absolute; top: 0; left: 0; right: 0; }
    .fx-book .fx-from, .fx-book .fx-to { animation: 300ms ease-out both; }
    .fx-book .fx-to { z-index: 2; }
    .fx-next .fx-from { animation-name: fx-slip-out-left; }
    .fx-next .fx-to { animation-name: fx-slip-in-right; }
    .fx-prev .fx-from { animation-name: fx-slip-out-right; }
    .fx-prev .fx-to { animation-name: fx-slip-in-left; }
    @keyframes fx-slip-out-left { to { opacity: 0; translate: -32px 0; } }
    @keyframes fx-slip-in-right { from { opacity: 0; translate: 32px 0; } }
    @keyframes fx-slip-out-right { to { opacity: 0; translate: 32px 0; } }
    @keyframes fx-slip-in-left { from { opacity: 0; translate: -32px 0; } }
  }

  /* Tickets are held back the same way, then stuck in one after another. */
  .sheet.fx-wait a.stk { opacity: 0; }
  .sheet.fx-in a.stk {
    animation: fx-stick 400ms cubic-bezier(0.2, 0.8, 0.3, 1) backwards;
    animation-delay: calc(var(--fx-i, 0) * 80ms);
  }
  @keyframes fx-stick {
    0% { opacity: 0; scale: 1.5; translate: 0 -11px; }
    55% { opacity: 1; scale: 0.94; translate: 0 0; }
    78% { scale: 1.035; }
    100% { scale: 1; }
  }
  /* In the book the stickers of a newly opened spread go in once its page has landed. */
  .fx-book .sheet.fx-in a.stk { animation-delay: calc(var(--fx-i, 0) * 80ms + 420ms); }
  .fx-book .sheet.fx-in .foil:not(.missing) { animation-delay: calc(var(--fx-i, 0) * 80ms + 680ms); }
  /* The coin is flipped onto its ticket. Turning about its upright axis, it thins to an edge
     and comes round again, which is all a flat coin does. */
  .sheet.fx-in .foil:not(.missing) {
    animation: fx-coin-in 560ms cubic-bezier(0.2, 0.7, 0.3, 1) backwards;
    animation-delay: calc(var(--fx-i, 0) * 80ms + 260ms);
  }
  @keyframes fx-coin-in {
    0% { scale: 0; rotate: y -540deg; translate: 0 -14px; }
    60% { scale: 1.16; translate: 0 0; }
    100% { scale: 1; rotate: y 0deg; }
  }
  @keyframes fx-flip {
    0% { rotate: y 0deg; }
    50% { scale: 1.18; filter: brightness(1.45); }
    100% { rotate: y 360deg; }
  }

  /* Light crossing a ticket: a band over the paper, cut to the ticket's outline (the torn
     half is shorter). It sits off the left edge until it is played. */
  a.stk::after {
    content: ""; position: absolute; inset: 0; pointer-events: none; clip-path: inset(6.3% 1.9% round 6.5% / 14.6%);
    background: linear-gradient(105deg, transparent 42%, rgba(255, 255, 255, 0.5) 50%, transparent 58%) 100% 0 / 300% 100% no-repeat;
  }
  a.stk.half::after { clip-path: inset(6.3% 47.3% 6.3% 1.9% round 6.5% 0 0 6.5% / 14.6% 0 0 14.6%); }
  a.stk.fx-glint::after { animation: fx-shine 800ms ease-out; }
  @keyframes fx-shine { to { background-position: 0 0; } }

  /* A glint: one ticket, coin, star, diamond, ribbon or lowman day at a time, picked by fx.js. */
  .fx-glint:not(.sold, .stk) { animation: fx-glint 800ms ease-in-out; }
  @keyframes fx-glint { 50% { scale: 1.27; filter: brightness(1.62); } }
  .stk .foil.fx-glint { animation: fx-flip 800ms ease-in-out; }
  /* The diamond turns half way round, which leaves it looking the same. */
  a.tag > svg.fx-glint { animation-name: fx-facet; }
  @keyframes fx-facet {
    50% { scale: 1.54; rotate: 90deg; filter: brightness(1.7); }
    100% { rotate: 180deg; }
  }

  /* A flawless report: a band of light crosses its banner now and then, under the title. */
  .report-art[data-flawless]::before {
    content: ""; position: absolute; inset: 0 -60%; z-index: 1; pointer-events: none; translate: -60% 0;
    background: linear-gradient(105deg, transparent 46%, rgba(255, 255, 255, 0.2) 50%, transparent 54%);
    animation: fx-banner 8s ease-in-out 900ms infinite;
  }
  @keyframes fx-banner {
    0% { translate: -60% 0; }
    24%, 100% { translate: 60% 0; }
  }

  /* Contest and day one: the glow flickers while the picture is on screen. */
  .fx-live .fx-glow { animation: fx-flicker 3.1s ease-in-out infinite; }
  @keyframes fx-flicker {
    0%, 100% { opacity: 0.38; }
    18% { opacity: 0.56; }
    31% { opacity: 0.34; }
    47% { opacity: 0.63; }
    63% { opacity: 0.41; }
    80% { opacity: 0.54; }
  }

  /* Server fastest: the lines cross, and the tag darts and catches the light. The tag is a
     link with a hover of its own in app.css (it fills and lifts), so the dart uses translate,
     which adds to that lift, and the light is clipped without clipping the hover's shadow. */
  .raid.fx-zip .fx-streaks i {
    animation-name: fx-zip; animation-duration: 560ms; animation-timing-function: cubic-bezier(0.4, 0, 0.9, 0.5); animation-fill-mode: both;
  }
  @keyframes fx-zip {
    0% { opacity: 0; transform: translateX(0); }
    20%, 70% { opacity: 0.76; }
    100% { opacity: 0; transform: translateX(200%); }
  }
  .tag.fastest { position: relative; overflow: hidden; }
  .tag.fastest::after {
    content: ""; position: absolute; inset: 0 auto 0 -45%; width: 45%; opacity: 0;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  }
  .fx-live .tag.fastest::after { animation: fx-tagsweep 4.6s ease-in infinite; }
  @keyframes fx-tagsweep {
    0%, 78% { opacity: 0; transform: translateX(0) skewX(-18deg); }
    80% { opacity: 1; }
    100% { opacity: 1; transform: translateX(330%) skewX(-18deg); }
  }
  .raid.fx-zip .tag.fastest { animation: fx-dart 340ms cubic-bezier(0.2, 0.8, 0.3, 1); }
  @keyframes fx-dart {
    0% { translate: -11px 0; }
    60% { translate: 2px 0; }
  }

  /* The shower: the head squeaks as it comes on, the water falls, the smell rises. */
  .note.shower.fx-on .fx-head { animation: fx-squeak 700ms ease-out; }
  @keyframes fx-squeak {
    0% { rotate: -14deg; }
    35% { rotate: 6deg; }
    65% { rotate: -3deg; }
    100% { rotate: 0deg; }
  }
  .fx-drop { opacity: 0; animation: fx-rain var(--fx-t) linear var(--fx-d) infinite; }
  .note.shower:not(.fx-on) .fx-drop, .note.shower:not(.fx-on) .fx-stink path { animation-play-state: paused; }
  @keyframes fx-rain {
    0% { opacity: 0; transform: translate(0, 0) scaleY(0.5); }
    15% { opacity: var(--fx-o); }
    75% { opacity: calc(var(--fx-o) * 0.6); }
    100% { opacity: 0; transform: translate(calc(var(--fx-x) * 0.6), 58px) scaleY(1.2); }
  }
  .fx-stink path { opacity: 0; animation: fx-waft 2.6s ease-in-out infinite; }
  .fx-stink path:nth-child(2) { animation-delay: -0.9s; }
  .fx-stink path:nth-child(3) { animation-delay: -1.7s; }
  @keyframes fx-waft {
    0% { opacity: 0; transform: translateY(3px); }
    35% { opacity: 0.85; }
    100% { opacity: 0; transform: translateY(-4px); }
  }

  /* Pigeons shuffle along and back, nod as they go and peck at the ledge, each in its own
     time. Two on the picture keep still, and now and then fx.js sends one flapping off. */
  .fx-pigeon { animation: fx-shuffle 11s ease-in-out infinite; animation-delay: calc(var(--fx-n) * -2.3s); }
  @keyframes fx-shuffle {
    0%, 22% { translate: 0 0; scale: var(--fx-way) 1; }
    34%, 58% { translate: calc(13px * var(--fx-way)) 0; scale: var(--fx-way) 1; }
    58.1% { translate: calc(13px * var(--fx-way)) 0; scale: calc(-1 * var(--fx-way)) 1; }
    72% { translate: 0 0; scale: calc(-1 * var(--fx-way)) 1; }
    72.1%, 100% { translate: 0 0; scale: var(--fx-way) 1; }
  }
  .fx-ph { transform-origin: 20px 15px; animation: fx-peck 5.2s ease-in-out infinite; animation-delay: calc(var(--fx-n) * -1.3s); }
  @keyframes fx-peck {
    0%, 8%, 16%, 60%, 78%, 100% { transform: none; }
    4%, 12% { transform: translateX(1.6px); }
    66%, 74% { transform: rotate(60deg) translate(1px, 2px); }
    70% { transform: rotate(18deg); }
  }
  .fx-pigeon.fx-flyer { animation: none; }
  /* The one on a card with a cheated clear is calm: no walking, a head bob now and then. */
  /* The car bounces on its springs now and then, and its red door swings open and shut. */
  .fx-cbody { animation: fx-springs 8s ease-in-out infinite; animation-delay: calc(var(--fx-n, 0) * -1.7s); }
  @keyframes fx-springs {
    0%, 14%, 100% { transform: none; }
    4% { transform: translateY(1.3px); }
    9% { transform: translateY(-0.7px); }
  }
  .fx-cdoor { transform-origin: 34.7px 12px; animation: fx-door 8s ease-in-out infinite; animation-delay: calc(var(--fx-n, 0) * -1.7s); }
  @keyframes fx-door {
    0%, 48%, 66%, 100% { transform: none; }
    54%, 60% { transform: scaleX(0.66); }
  }
  .fx-calm .fx-pigeon { animation: none; }
  .fx-calm .fx-ph { animation: fx-bob 7s ease-in-out infinite; animation-delay: calc(var(--fx-n) * -1.9s); }
  @keyframes fx-bob {
    0%, 6%, 12%, 100% { transform: none; }
    3%, 9% { transform: translateX(1.8px); }
  }
  .fx-pigeon.fx-fly { animation: fx-flyoff 4.2s ease-in-out; }
  @keyframes fx-flyoff {
    30% { translate: 46px -70px; opacity: 1; }
    42% { translate: 90px -120px; opacity: 0; }
    58% { translate: -70px -110px; opacity: 0; }
    72% { translate: -26px -44px; opacity: 1; }
  }
  .fx-fly .fx-pw { transform-origin: 13px 14px; animation: fx-flap 150ms ease-in-out infinite alternate; }
  @keyframes fx-flap { to { transform: scaleY(-1.7); } }

  /* George comes up over the edge and grows to his full size, his bubble pops open once he is
     up, and while he talks his jaw flaps and the frame rocks a little. */
  .fx-gface { transition: translate 480ms cubic-bezier(0.2, 0.9, 0.3, 1.25), scale 320ms ease-out; }
  .fx-bubble { transition: opacity 180ms ease-out, scale 260ms cubic-bezier(0.3, 1.4, 0.5, 1), visibility 0s linear 180ms; }
  .fx-up .fx-bubble { transition-delay: 320ms; }
  .fx-gjaw { transition: translate 70ms ease-out; }
  .fx-typing .fx-gframe { transform-origin: 100% 100%; animation: fx-natter 460ms ease-in-out infinite alternate; }
  @keyframes fx-natter {
    0% { scale: 1; }
    100% { scale: 1.035; }
  }
  .fx-george .why { transition: opacity 320ms ease-out; }

  /* The nameplate's hologram: a band of light that burns the emblem's own colours brighter
     as it passes (colour dodge), so no new colour comes onto the page. Three plates wide,
     slid by fx.js through --fx-x. */
  .plate::after {
    content: ""; position: absolute; inset: 0 -100%; pointer-events: none; opacity: 0; mix-blend-mode: color-dodge;
    background: linear-gradient(105deg, transparent 44.5%, rgba(255, 255, 255, 0.2) 47.5%, rgba(255, 255, 255, 0.54) 50%, rgba(255, 255, 255, 0.2) 52.5%, transparent 55.5%);
    transform: translateX(calc((var(--fx-x, 0.5) - 0.5) * 33.34%));
    transition: opacity 220ms ease-out;
  }
  .plate.fx-tilt::after { opacity: 1; }
  /* Once across the profile's own plate on arrival, for screens with no pointer to follow. */
  .plate.fx-sweep::after { animation: fx-holo 1200ms ease-in-out 350ms backwards; }
  @keyframes fx-holo {
    0% { opacity: 0; translate: -22% 0; }
    25%, 75% { opacity: 1; }
    100% { opacity: 0; translate: 22% 0; }
  }

  /* Home: the run marks of the latest clears pop in down the list, and a clear from the
     last few hours keeps a slow ring going out from its mark. */
  .feed.fx-in li .dot { animation: fx-pop 340ms cubic-bezier(0.3, 1.5, 0.5, 1) backwards; animation-delay: calc(var(--fx-i, 0) * 40ms); }
  @keyframes fx-pop { 0% { scale: 0; } }
  .dot.fx-new:not(.star) { position: relative; }
  .dot.fx-new:not(.star)::after {
    content: ""; position: absolute; inset: -2px; border-radius: 50%; border: 2px solid var(--tier);
    animation: fx-ping 2.4s ease-out infinite;
  }
  @keyframes fx-ping {
    0% { scale: 1; opacity: 0.72; }
    70%, 100% { scale: 2.5; opacity: 0; }
  }
  .dot.star.fx-new { animation: fx-breathe 2.4s ease-in-out infinite; }
  @keyframes fx-breathe { 50% { scale: 1.25; } }

  /* Rankings: the row you came from pulses in the brand colour's wash when it is on screen. */
  .rank tr.fx-here { animation: fx-you 2.2s ease-in-out 250ms; }
  @keyframes fx-you {
    0%, 100% { background-color: rgba(255, 90, 61, 0.07); }
    20%, 60% { background-color: rgba(255, 90, 61, 0.25); }
    40% { background-color: rgba(255, 90, 61, 0.1); }
  }
  @media (max-width: 680px) {
    /* On a phone the row is a card with a ground of its own: the pulse starts and ends there. */
    .rank tr.fx-here { animation-name: fx-you-card; }
    @keyframes fx-you-card {
      20%, 60% { background-color: color-mix(in srgb, var(--brand) 24%, var(--panel)); }
      40% { background-color: color-mix(in srgb, var(--brand) 11%, var(--panel)); }
    }
  }

  /* The wordmark's stamp lifts and comes down again; five in a row stamps the whole page. */
  .mark .stamp.fx-restamp { animation: fx-restamp 440ms cubic-bezier(0.3, 0.8, 0.3, 1); }
  @keyframes fx-restamp {
    35% { scale: 1.5; rotate: -8deg; translate: 0 -3px; }
    60% { scale: 0.84; rotate: 2deg; translate: 0 0; }
    80% { scale: 1.06; }
  }
  .fx-big { animation: fx-big 1500ms cubic-bezier(0.2, 0.9, 0.3, 1) both; }
  @keyframes fx-big {
    0% { opacity: 0; scale: 2.4; }
    14% { opacity: 0.82; scale: 0.94; }
    20% { scale: 1.03; }
    26% { scale: 1; }
    72% { opacity: 0.82; }
    100% { opacity: 0; scale: 1; }
  }

  /* Run marks ripple from the newest back to the oldest when the pointer comes onto a strip. */
  .strip .dot.fx-rip { animation: fx-ripple 380ms ease-out backwards; animation-delay: calc(var(--fx-i, 0) * 16ms); }
  /* the card about a run comes in quietly */
  .fx-runcard { animation: fx-card 110ms ease-out; }
  @keyframes fx-card { from { opacity: 0; } }
  @keyframes fx-ripple {
    40% { scale: 0.6; }
    75% { scale: 1.18; }
  }
}

/* ---- under a mouse ------------------------------------------------------------------------- */

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {

  /* Cards and nameplates lean toward the pointer; fx.js sets the transform. */
  .raid, div.plate { transition: transform 200ms cubic-bezier(0.2, 0.7, 0.3, 1); }
  a.plate { transition: transform 200ms cubic-bezier(0.2, 0.7, 0.3, 1), filter 150ms ease-out; }
  .fx-sheen { transition: opacity 260ms ease-out; }
  .raid.fx-tilt .fx-sheen { opacity: 1; }

  /* A ticket lifts off the page and light crosses it; its coin flips over. */
  a.stk { transition: translate 150ms ease-out, scale 150ms ease-out, filter 150ms ease-out; }
  a.stk:hover, a.stk:focus-visible { translate: 0 -3px; scale: 1.054; filter: drop-shadow(0 6px 5px rgba(0, 0, 0, 0.4)); }
  a.stk:active { translate: 0 0; scale: 0.97; }
  a.stk:hover::after { animation: fx-shine 650ms ease-out; }
  a.stk:hover .foil:not(.missing) { animation: fx-flip 700ms cubic-bezier(0.3, 0.6, 0.3, 1); }
  /* A whole ticket's stub flexes along the perforation, as if about to tear. The stub is not
     a piece of its own in the drawing, so fx.js lays a second copy over the ticket: here the
     first copy is cut down to the main part and the second to the stub, which bends. */
  .stk .fx-stub { display: none; position: absolute; top: 0; left: 0; transform-origin: 74.1% 50%; }
  a.stk.fx-split:hover .tkt { clip-path: inset(-30% 25.9% -30% -30%); }
  a.stk.fx-split:hover .fx-stub { display: block; clip-path: inset(-30% -30% -30% 74.1%); animation: fx-flex 950ms ease-in-out infinite; }
  @keyframes fx-flex {
    0%, 100% { transform: perspective(170px) rotateY(0deg); }
    30% { transform: perspective(170px) rotateY(-27deg); }
    52% { transform: perspective(170px) rotateY(-9deg); }
    76% { transform: perspective(170px) rotateY(-34deg); }
  }
  /* An empty place shakes its head. */
  .stk.none:hover { animation: fx-nope 320ms ease-in-out; }
  @keyframes fx-nope {
    25% { translate: -1.8px 0; }
    75% { translate: 1.8px 0; }
  }

  /* Run marks and calendar days swell under the pointer, inside the room they already have. */
  .strip a.dot, .cal .grid a { transition: scale 130ms cubic-bezier(0.3, 1.6, 0.5, 1); }
  .strip a.dot:hover, .cal .grid a:hover { scale: 1.25; }

  /* George, peeking: he comes up a little to meet the pointer. */
  .fx-george:not(.fx-up):not(.fx-off) .fx-gface:hover { translate: 0 12%; }
}

@media print {
  .fx-sky, .fx-weather, .fx-layer, .fx-big, .fx-shower, .fx-stink, .fx-gface, .fx-gx, .fx-roost, .fx-runcard, .fx-turner, .fx-edge { display: none; }
  /* every spread of the book prints, one after another */
  .tome.fx-book { display: block; }
  .fx-book .spread { visibility: visible; margin-bottom: 16px; break-inside: avoid; }
  .fx-wait .sold, .fx-wait .stk { opacity: 1 !important; }
  body[data-theme]::before, body[data-theme]::after, body[data-theme] main::before { display: none; }
}
