/* Chat effects from js/fxlib.js and the new grid modes of js/gridfx.js.
   The first effects (wave, aurora, scan, message flashes) are in app.css.

   Screen layers (.cflow …) cover the chat: position absolute, inset 0,
   z-index 30, pointer-events none (from app.css). Their strength follows
   --fxk: 0.55 soft, 1 normal, 1.45 bright — use it in alphas,
   e.g. rgba(140, 216, 255, calc(.6 * var(--fxk, 1))), or in opacity.
   Under-layers sit in .fxback: behind the messages, over the grid.
   Only transform and opacity are animated; nothing moves with reduced
   motion or energy saving (the rules at the end of each region: each
   reduced-motion rule has its twin for :root.eco, the class power.js puts
   on <html> while energy saving is on). */

.fxback { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
/* The voice effect's holder: like .fxscreen, it must not group its layer. */
.fxairbox, .fxframebox { display: contents; }

/* ---------- tiles of the screen effects in the settings sheet ---------- */
.fxtiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.fxtile { display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 5px 5px 7px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2);
  color: var(--text-2); font-size: 12px; text-align: center; transition: border-color .15s, background .15s; }
.fxtile.on { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); box-shadow: 0 0 14px -6px var(--accent-glow); font-weight: 600; }
.fxtile:active { transform: scale(.97); }
.fxtname { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* The frame's colours: round chips; all colours; one's own (a hidden
   colour picker opens from it). */
.fxsub { font-size: 12px; color: var(--text-3); padding: 10px 2px 6px; }
.fxcolors { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; position: relative; }
.fxcolor { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--line); background: var(--surface-2); transition: border-color .15s, box-shadow .15s; }
.fxcolor i { width: 24px; height: 24px; border-radius: 50%; display: block; box-shadow: 0 0 10px -2px currentColor; }
.fxcolor .c-rainbow { background: conic-gradient(rgb(255, 60, 190), rgb(150, 96, 255), rgb(50, 200, 255), rgb(100, 255, 150), rgb(255, 178, 60), rgb(255, 60, 190)); }
.fxcolor.own i { border: 1.5px dashed var(--text-3); background: none; position: relative; }
.fxcolor.own:not(.on) i::before, .fxcolor.own:not(.on) i::after { content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 1.5px; margin: -.75px 0 0 -5px; background: var(--text-2); }
.fxcolor.own:not(.on) i::after { transform: rotate(90deg); }
.fxcolor.own.on i { border-style: solid; border-color: rgba(255, 255, 255, .5); }
.fxcolor.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-dim), 0 0 14px -4px var(--accent-glow); }
.fxcolor:active { transform: scale(.94); }
/* «Original» (theme.js): the look's own light, and its name. */
.fxcolor.orig { width: auto; border-radius: 19px; display: inline-flex; gap: 7px; padding: 0 12px 0 6px; color: var(--text); font: 600 13px/1 var(--font); }
.fxpick { position: absolute; left: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; border: 0; padding: 0; }
/* A small picture of each effect: a dark screen with the grid, painted. */
.fxsw { position: relative; display: block; height: 44px; border-radius: 10px; overflow: hidden; background-color: #050806;
  background-image: linear-gradient(rgba(159, 232, 112, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(159, 232, 112, .07) 1px, transparent 1px);
  background-size: 8px 8px; }
.fxsw i { position: absolute; display: none; }
.sw-flow { background-image: linear-gradient(transparent 15%, rgba(140, 216, 255, .55) 38%, rgba(160, 140, 255, .6) 62%, transparent 85%),
  linear-gradient(rgba(159, 232, 112, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(159, 232, 112, .07) 1px, transparent 1px); background-size: auto, 8px 8px, 8px 8px; }
.sw-aurora { background-image: radial-gradient(50% 60% at 25% 30%, rgba(140, 216, 255, .7), transparent), radial-gradient(50% 60% at 75% 55%, rgba(170, 130, 255, .7), transparent),
  radial-gradient(45% 50% at 45% 95%, rgba(255, 110, 200, .55), transparent); background-size: auto; }
.sw-polar { background-image: linear-gradient(transparent 55%, #050806), repeating-linear-gradient(90deg, rgba(120, 255, 170, .55) 0 2px, rgba(120, 255, 170, .12) 2px 5px),
  linear-gradient(rgba(170, 120, 255, .5), rgba(120, 255, 170, .3) 45%, transparent 70%); background-size: auto; }
.sw-prism { background-image: linear-gradient(120deg, rgba(255, 80, 120, .6), rgba(255, 200, 80, .6), rgba(120, 255, 140, .6), rgba(80, 200, 255, .6), rgba(170, 110, 255, .6)); background-size: auto; }
.sw-sunset { background-image: linear-gradient(transparent 5%, rgba(170, 110, 255, .45) 40%, rgba(255, 110, 160, .55) 70%, rgba(255, 190, 80, .7)); background-size: auto; }
.sw-lava { background-image: radial-gradient(40% 45% at 30% 70%, rgba(255, 110, 52, .8), transparent), radial-gradient(35% 40% at 70% 40%, rgba(255, 52, 120, .75), transparent),
  radial-gradient(30% 30% at 55% 90%, rgba(255, 178, 48, .7), transparent); background-size: auto; }
.sw-deep { background-image: linear-gradient(100deg, transparent 18%, rgba(190, 245, 255, .28) 24%, transparent 30%, transparent 52%, rgba(190, 245, 255, .22) 58%, transparent 64%),
  linear-gradient(rgba(40, 190, 210, .5), rgba(40, 90, 220, .65)); background-size: auto; }
.sw-nebula { background-image: radial-gradient(45% 55% at 30% 35%, rgba(150, 90, 255, .7), transparent), radial-gradient(40% 50% at 70% 60%, rgba(255, 70, 190, .55), transparent),
  radial-gradient(40% 45% at 40% 95%, rgba(70, 110, 255, .55), transparent); background-size: auto; }
.sw-beams { background-image: linear-gradient(160deg, transparent 30%, rgba(170, 120, 255, .55) 38%, transparent 46%), linear-gradient(200deg, transparent 32%, rgba(70, 220, 255, .5) 40%, transparent 48%),
  linear-gradient(176deg, transparent 52%, rgba(255, 80, 200, .45) 58%, transparent 64%); background-size: auto; }
.sw-pearl { background-image: linear-gradient(115deg, rgba(255, 170, 225, .55), rgba(170, 235, 255, .55) 25%, rgba(185, 255, 215, .5) 50%, rgba(255, 240, 165, .5) 70%, rgba(215, 180, 255, .55)),
  linear-gradient(100deg, transparent 40%, rgba(255, 255, 255, .35) 50%, transparent 60%); background-size: auto; }
.sw-matrix { background-image: repeating-linear-gradient(rgba(159, 232, 112, .75) 0 2px, transparent 2px 5px); background-size: 2px 100%; background-repeat: repeat-x;
  -webkit-mask-image: linear-gradient(90deg, #000 0 20%, transparent 20% 35%, #000 35% 45%, transparent 45% 62%, #000 62% 70%, transparent 70% 85%, #000 85%), linear-gradient(transparent, #000);
  mask-image: linear-gradient(90deg, #000 0 20%, transparent 20% 35%, #000 35% 45%, transparent 45% 62%, #000 62% 70%, transparent 70% 85%, #000 85%); }
.sw-off::after { content: ""; position: absolute; left: 50%; top: 8px; bottom: 8px; width: 1.5px; background: var(--text-3); transform: rotate(35deg); }

/* ---- region: screens-d (Lava, Deep, Nebula, Beams, Pearl) ---- */
/* Soft washes in the family of the glow (.cfaur in app.css). A "color"
   layer keeps what it passes as bright as it was and gives it its hue, so
   the dark stays dark and text stays readable; a "screen" layer adds a
   little light where the screen is dark. One slow transform animation per
   element; fxlib.js gives each its own length and phase. The wave's rule
   (.cflow i in app.css) sizes every <i> of a screen layer; those placed by
   inset here take their height from it again (height: auto). */

/* Lava: blobs of a lava lamp rise from the bottom, stretch as they go and
   sink back. */
.cflow.cflava { mix-blend-mode: color; }
.cflow.cflavalit { mix-blend-mode: screen; }
.cflava i, .cflavalit i { position: absolute; left: 8%; top: 62%; width: 84%; height: 46%; border-radius: 50%; will-change: transform; --c: 255, 110, 52;
  background: radial-gradient(closest-side, rgba(var(--c), calc(.86 * var(--fxk, 1))), rgba(var(--c), calc(.42 * var(--fxk, 1))) 52%, rgba(var(--c), 0));
  animation: cflava 27s ease-in-out infinite alternate; }
.cflava i:nth-child(2), .cflavalit i:nth-child(2) { --c: 255, 52, 120; left: -22%; top: 74%; width: 78%; animation-name: cflava2; }
.cflava i:nth-child(3), .cflavalit i:nth-child(3) { --c: 255, 178, 48; left: 44%; top: 80%; width: 70%; height: 40%; }
.cflava i:nth-child(4), .cflavalit i:nth-child(4) { --c: 236, 60, 200; left: 18%; top: 92%; width: 64%; height: 38%; animation-name: cflava2; }
/* The glow of a blob: a soft core, so the blob shows on the dark screen. */
.cflavalit i { background: radial-gradient(closest-side, rgba(var(--c), calc(.24 * var(--fxk, 1))), rgba(var(--c), calc(.1 * var(--fxk, 1))) 45%, rgba(var(--c), 0) 80%); }
@keyframes cflava {
  0% { transform: translate(0, 18%) scale(1.05, .82); }
  28% { transform: translate(7%, -38%) scale(.84, 1.18); }
  56% { transform: translate(-5%, -96%) scale(1.12, .9); }
  100% { transform: translate(5%, -150%) scale(.9, 1.12); }
}
@keyframes cflava2 {
  0% { transform: translate(0, 10%) scale(.92, 1.08); }
  35% { transform: translate(-6%, -52%) scale(1.16, .86); }
  70% { transform: translate(8%, -112%) scale(.86, 1.16); }
  100% { transform: translate(-4%, -160%) scale(1.05, .95); }
}
.cflow.cflavaglow { mix-blend-mode: screen; }
.cflavaglow i { position: absolute; left: -20%; bottom: -24%; width: 140%; height: 60%; border-radius: 50%; will-change: transform;
  background: radial-gradient(closest-side, rgba(255, 96, 40, calc(.16 * var(--fxk, 1))), rgba(255, 70, 90, calc(.06 * var(--fxk, 1))) 60%, rgba(255, 70, 90, 0));
  animation: cfdrift 31s ease-in-out infinite alternate; }
.cflavaglow i + i { left: 10%; bottom: -30%; width: 110%; background: radial-gradient(closest-side, rgba(255, 170, 60, calc(.11 * var(--fxk, 1))), rgba(255, 170, 60, 0)); }
@keyframes cfdrift { 0% { transform: translate(-8%, 0) scale(1); } 50% { transform: translate(6%, -6%) scale(1.1); } 100% { transform: translate(10%, 2%) scale(.95); } }

/* Deep: sea colour, deeper blue below; shafts of light sway down from the
   surface; the shimmer of light on water passes over everything. */
.cflow.cfdeep { mix-blend-mode: color;
  background: linear-gradient(rgba(60, 220, 230, calc(.62 * var(--fxk, 1))), rgba(40, 160, 255, calc(.66 * var(--fxk, 1))) 45%, rgba(48, 92, 230, calc(.7 * var(--fxk, 1)))); }
.cflow.cfrays { mix-blend-mode: screen;
  -webkit-mask-image: linear-gradient(#000, rgba(0, 0, 0, .55) 45%, transparent 85%); mask-image: linear-gradient(#000, rgba(0, 0, 0, .55) 45%, transparent 85%); }
.cfrays i { position: absolute; top: -6%; left: 12%; width: 13%; height: 115%; transform-origin: 50% 0; will-change: transform;
  background: linear-gradient(90deg, rgba(170, 240, 255, 0), rgba(170, 240, 255, calc(.17 * var(--fxk, 1))) 50%, rgba(170, 240, 255, 0));
  -webkit-clip-path: polygon(30% 0, 70% 0, 100% 100%, 0 100%); clip-path: polygon(30% 0, 70% 0, 100% 100%, 0 100%);
  animation: cfray 12s ease-in-out infinite alternate; }
.cfrays i:nth-child(2) { left: 32%; width: 9%; }
.cfrays i:nth-child(3) { left: 50%; width: 16%; }
.cfrays i:nth-child(4) { left: 68%; width: 8%; }
.cfrays i:nth-child(5) { left: 82%; width: 12%; }
@keyframes cfray { 0% { transform: rotate(-9deg) scaleX(.85); } 50% { transform: rotate(2deg) scaleX(1.15); } 100% { transform: rotate(8deg) scaleX(.9); } }
.cflow.cfcaust { mix-blend-mode: screen; }
.cfcaust i { position: absolute; inset: -40%; height: auto; will-change: transform;
  background: radial-gradient(closest-side, rgba(190, 250, 255, calc(.07 * var(--fxk, 1))), rgba(190, 250, 255, 0)) 0 0 / 74px 58px,
    radial-gradient(closest-side, rgba(190, 250, 255, calc(.06 * var(--fxk, 1))), rgba(190, 250, 255, 0)) 37px 29px / 74px 58px;
  animation: cfcaust 26s linear infinite alternate; }
.cfcaust i + i { background-size: 96px 76px, 96px 76px; animation-name: cfcaust2; }
@keyframes cfcaust { 0% { transform: translate(-6%, -4%) rotate(0deg); } 100% { transform: translate(6%, 5%) rotate(4deg); } }
@keyframes cfcaust2 { 0% { transform: translate(5%, 4%) rotate(3deg); } 100% { transform: translate(-6%, -5%) rotate(-2deg); } }

/* Nebula: big clouds of violet, magenta and deep blue drift very slowly;
   they tint the chat ("color") and glow faintly in the dark ("screen"). */
.cflow.cfneb { mix-blend-mode: color; }
.cfneb i, .cfnebglow i { position: absolute; border-radius: 50%; will-change: transform; animation: cfneb 48s ease-in-out infinite alternate; }
.cfneb i { left: -25%; top: -15%; width: 120%; height: 70%; --c: 150, 90, 255;
  background: radial-gradient(closest-side, rgba(var(--c), calc(.85 * var(--fxk, 1))), rgba(var(--c), calc(.34 * var(--fxk, 1))) 58%, rgba(var(--c), 0)); }
.cfneb i:nth-child(2) { --c: 255, 70, 190; left: 20%; top: 30%; width: 110%; height: 62%; }
.cfneb i:nth-child(3) { --c: 70, 110, 255; left: -30%; top: 58%; width: 125%; height: 66%; }
.cflow.cfnebglow { mix-blend-mode: screen; }
.cfnebglow i { left: -10%; top: 4%; width: 90%; height: 46%; --c: 160, 110, 255;
  background: radial-gradient(closest-side, rgba(var(--c), calc(.13 * var(--fxk, 1))), rgba(var(--c), calc(.05 * var(--fxk, 1))) 60%, rgba(var(--c), 0)); }
.cfnebglow i:nth-child(2) { --c: 255, 90, 200; left: 34%; top: 38%; width: 80%; height: 40%; }
.cfnebglow i:nth-child(3) { --c: 90, 140, 255; left: -6%; top: 66%; width: 96%; height: 44%; }
@keyframes cfneb {
  0% { transform: translate(-10%, -6%) rotate(-6deg) scale(1); }
  33% { transform: translate(8%, 6%) rotate(4deg) scale(1.12); }
  66% { transform: translate(-4%, 12%) rotate(10deg) scale(.94); }
  100% { transform: translate(12%, -4%) rotate(-2deg) scale(1.06); }
}

/* Beams: coloured stage lights from above the screen sweep slowly from side
   to side; where they cross, the light adds up. A faint haze at the top. */
.cflow.cfhaze { mix-blend-mode: screen; background: radial-gradient(90% 34% at 50% 0, rgba(190, 170, 255, calc(.12 * var(--fxk, 1))), rgba(190, 170, 255, 0)); }
.cflow.cfbeams { mix-blend-mode: screen; }
.cfbeams i { position: absolute; top: -14%; left: 8%; width: 44%; height: 135%; transform-origin: 50% 0; will-change: transform; --c: 170, 120, 255;
  background: linear-gradient(rgba(var(--c), calc(.26 * var(--fxk, 1))), rgba(var(--c), calc(.1 * var(--fxk, 1))) 55%, rgba(var(--c), 0) 92%);
  -webkit-clip-path: polygon(46% 0, 54% 0, 100% 100%, 0 100%); clip-path: polygon(46% 0, 54% 0, 100% 100%, 0 100%);
  animation: cfbeam 14s ease-in-out infinite alternate; }
.cfbeams i:nth-child(2) { --c: 70, 220, 255; left: 46%; animation-name: cfbeam2; }
.cfbeams i:nth-child(3) { --c: 255, 80, 200; left: 26%; width: 40%; }
.cfbeams i:nth-child(4) { --c: 140, 255, 150; left: 60%; width: 36%; animation-name: cfbeam2; }
@keyframes cfbeam { 0% { transform: rotate(-28deg); } 100% { transform: rotate(24deg); } }
@keyframes cfbeam2 { 0% { transform: rotate(26deg); } 100% { transform: rotate(-26deg); } }

/* Pearl: a pale iridescent film drifts across the screen; a soft sheen
   glides over it now and then. */
.cflow.cfpearl { mix-blend-mode: color; }
.cflow.cfpearlit { mix-blend-mode: screen; }
.cfpearl i, .cfpearlit i { position: absolute; inset: -60% -100%; height: auto; will-change: transform; --a: calc(.66 * var(--fxk, 1));
  background: repeating-linear-gradient(115deg, rgba(255, 90, 205, var(--a)), rgba(70, 215, 255, var(--a)) 9%, rgba(80, 255, 175, var(--a)) 18%,
    rgba(255, 210, 80, var(--a)) 27%, rgba(170, 120, 255, var(--a)) 36%, rgba(255, 90, 205, var(--a)) 45%);
  animation: cfpearl 18s ease-in-out infinite alternate; }
/* The film itself, faintly lit where the chat is dark. */
.cfpearlit i { --a: calc(.1 * var(--fxk, 1)); }
@keyframes cfpearl { 0% { transform: translate(-22%, -8%); } 100% { transform: translate(22%, 8%); } }
.cflow.cfsheen { mix-blend-mode: screen; }
.cfsheen i { position: absolute; top: -50%; left: 0; width: 70%; height: 200%; will-change: transform;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 230, 250, calc(.07 * var(--fxk, 1))) 35%, rgba(235, 250, 255, calc(.16 * var(--fxk, 1))) 50%, rgba(255, 245, 225, calc(.07 * var(--fxk, 1))) 65%, rgba(255, 255, 255, 0));
  transform: translateX(-120%) rotate(18deg); animation: cfsheen 10s cubic-bezier(.45, 0, .55, 1) infinite; }
@keyframes cfsheen { 0% { transform: translateX(-120%) rotate(18deg); } 55%, 100% { transform: translateX(260%) rotate(18deg); } }
@media (prefers-reduced-motion: reduce) { .cflava i, .cflavalit i, .cflavaglow i, .cfpearlit i, .cfrays i, .cfcaust i, .cfneb i, .cfnebglow i, .cfbeams i, .cfpearl i, .cfsheen i { animation: none; } }
:root.eco :is(.cflava i, .cflavalit i, .cflavaglow i, .cfpearlit i, .cfrays i, .cfcaust i, .cfneb i, .cfnebglow i, .cfbeams i, .cfpearl i, .cfsheen i) { animation: none; }
/* ---- end region: screens-d ---- */

/* ---- region: screens-b (Aurora, Shimmer, Sunset) ---- */
/* Aurora: two curtains of rays in the upper part of the screen (light,
   "screen"), the far one higher and fainter; over them soft bands of hue
   ("color") that colour the rays and everything up there: green low,
   violet, then pink at the top. A ray is one small element with two
   streaks; each streak is an elliptic gradient that falls off like a bell
   both ways, so it stays a straight streak that fades upwards. Its foot
   rises and falls with the wave along the curtain, it leans a little, and
   it slowly brightens and dims. A lit hem rides the same wave along the
   feet and joins them into one edge.
   The light (--pk) grows less than --fxk at bright (1.11, not 1.45): the
   hue layer gives bright its colour, and text over the rays stays easy to
   read. */
.cflow.plsky { mix-blend-mode: screen; --pk: min(var(--fxk, 1), calc(.75 + .25 * var(--fxk, 1))); }
.cflow.plhue { mix-blend-mode: color; }
.plhue b { position: absolute; border-radius: 50%; will-change: transform; animation: plhue 23s ease-in-out infinite alternate; }
.plhue b:nth-child(1) { left: -30%; top: -20%; width: 160%; height: 36%; animation-duration: 29s; animation-delay: -7s;
  background: radial-gradient(closest-side, rgba(255, 105, 200, calc(.6 * var(--fxk, 1))), rgba(255, 105, 200, calc(.32 * var(--fxk, 1))) 60%, rgba(255, 105, 200, 0)); }
.plhue b:nth-child(2) { left: -20%; top: -6%; width: 140%; height: 38%; animation-duration: 34s; animation-direction: alternate-reverse;
  background: radial-gradient(closest-side, rgba(160, 115, 255, calc(.62 * var(--fxk, 1))), rgba(160, 115, 255, calc(.3 * var(--fxk, 1))) 60%, rgba(160, 115, 255, 0)); }
.plhue b:nth-child(3) { left: -30%; top: 17%; width: 160%; height: 30%; animation-duration: 26s; animation-delay: -11s;
  background: radial-gradient(closest-side, rgba(70, 255, 170, calc(.55 * var(--fxk, 1))), rgba(70, 255, 170, calc(.25 * var(--fxk, 1))) 60%, rgba(70, 255, 170, 0)); }
@keyframes plhue { 0% { transform: translate(-8%, -5%) scale(1, .95); } 50% { transform: translate(5%, 4%) scale(1.06, 1.1); } 100% { transform: translate(9%, -2%) scale(.96, 1); } }

/* A curtain: its colours as "r, g, b" — the foot, above it, the top. */
.plcurt { position: absolute; left: -15%; width: 130%; will-change: transform; animation: pldrift 26s ease-in-out infinite alternate;
  --g: 120, 255, 180; --g2: 80, 235, 190; --m: 150, 120, 255; }
.plcurt.near { top: 3%; height: 36%; }
.plcurt.far { top: -7%; height: 28%; animation-duration: 37s; animation-direction: alternate-reverse; --g: 100, 240, 210; --g2: 120, 170, 255; --m: 190, 110, 255; }
@keyframes pldrift { 0% { transform: translateX(-6%) rotate(-1.2deg); } 100% { transform: translateX(6%) rotate(1.2deg); } }
.plray { position: absolute; left: var(--x); bottom: 0; width: var(--w); height: 100%; margin-left: calc(var(--w) / -2); transform-origin: 50% 100%; will-change: transform, opacity;
  /* The core of a foot is capped, so text over it stays readable at bright. */
  --s: rgba(225, 255, 235, min(.42, calc(.42 * var(--k) * var(--pk)))), rgba(var(--g), min(.4, calc(.4 * var(--k) * var(--pk)))) 12%, rgba(var(--g), calc(.32 * var(--k) * var(--pk))) 30%,
    rgba(var(--g2), calc(.19 * var(--k) * var(--pk))) 50%, rgba(var(--m), calc(.1 * var(--k) * var(--pk))) 70%, rgba(var(--m), calc(.035 * var(--k) * var(--pk))) 86%, rgba(var(--m), 0);
  --f: rgba(225, 255, 235, min(.42, calc(.42 * var(--k) * var(--pk)))), rgba(var(--g), min(.38, calc(.37 * var(--k) * var(--pk)))) 15%, rgba(var(--g), calc(.2 * var(--k) * var(--pk))) 40%,
    rgba(var(--g), calc(.05 * var(--k) * var(--pk))) 70%, rgba(var(--g), 0);
  /* Each streak: its body above the foot, and a short fade below it, so
     the lower edge is bright but not cut off. */
  background:
    radial-gradient(17% var(--hh) at 50% 100%, var(--s)) top / 100% 93% no-repeat,
    radial-gradient(17% 100% at 50% 0%, var(--f)) bottom / 100% 7% no-repeat,
    radial-gradient(8% calc(var(--hh) * .7) at var(--sx) 100%, var(--s)) top / 100% 93% no-repeat,
    radial-gradient(8% 100% at var(--sx) 0%, var(--f)) bottom / 100% 7% no-repeat;
  animation: plwave var(--d) ease-in-out var(--dl) infinite alternate, plshim var(--sd) ease-in-out var(--sdl) infinite alternate; }
@keyframes plwave {
  0% { transform: translateY(calc(var(--a) * -1)) skewX(var(--sk)) scaleY(.86); }
  100% { transform: translateY(var(--a)) skewX(calc(var(--sk) * -.6)) scaleY(1.08); }
}
@keyframes plshim { 0% { opacity: 1; } 100% { opacity: .55; } }
/* The hem: wide soft glows along the feet, each riding the wave at its
   place (the same keyframes as the rays): a thin bright line where the
   feet are and a faint haze above it. Every gradient ends inside the box,
   or its edge would show. */
.plhem { position: absolute; left: var(--x); width: var(--w); margin-left: calc(var(--w) / -2); bottom: -8.2%; height: 40%; transform-origin: 50% 62%; will-change: transform;
  background:
    radial-gradient(50% 15% at 50% 62%, rgba(var(--g), calc(.12 * var(--k) * var(--pk))), rgba(var(--g), calc(.055 * var(--k) * var(--pk))) 50%, rgba(var(--g), 0)),
    radial-gradient(50% 50% at 50% 50%, rgba(var(--g), calc(.075 * var(--k) * var(--pk))), rgba(var(--g2), calc(.035 * var(--k) * var(--pk))) 50%, rgba(var(--m), 0));
  animation: plwave var(--d) ease-in-out var(--dl) infinite alternate; }

/* Shimmer: one wide band of all the hues, repeating every 795.6px along
   its 104° line, drifts right by exactly 820px (795.6 / sin 104°) and
   starts again unseen; in 26 s every place on the screen passes through
   the whole rainbow, about three quarters of it on the screen at once.
   Green, the colour of the chat itself, gets a narrower part of the band,
   so the screen rarely looks plain. */
.cflow.pzhue { mix-blend-mode: color; }
.pzhue b { position: absolute; left: 0; top: 0; bottom: 0; width: calc(100% + 820px); will-change: transform; --pa: calc(.5 * var(--fxk, 1));
  background: repeating-linear-gradient(104deg,
    rgba(255, 70, 110, var(--pa)) 0px,
    rgba(255, 150, 60, var(--pa)) 99.5px,
    rgba(255, 225, 70, var(--pa)) 198.9px,
    rgba(110, 240, 120, var(--pa)) 274.5px,
    rgba(60, 220, 230, var(--pa)) 362px,
    rgba(80, 140, 255, var(--pa)) 469.4px,
    rgba(165, 105, 255, var(--pa)) 576.8px,
    rgba(240, 90, 210, var(--pa)) 684.3px,
    rgba(255, 70, 110, var(--pa)) 795.6px);
  animation: pzflow 26s linear infinite; }
@keyframes pzflow { 0% { transform: translateX(-820px); } 100% { transform: translateX(0); } }
/* The glow behind the messages: neutral light, stronger in the middle; the
   band over it turns it into the passing colour. It does not move. */
.pzglow { position: absolute; inset: 0;
  background: radial-gradient(120% 75% at 50% 45%, rgba(235, 235, 235, calc(.09 * var(--fxk, 1))), rgba(235, 235, 235, calc(.045 * var(--fxk, 1))) 60%, rgba(235, 235, 235, calc(.02 * var(--fxk, 1)))); }

/* Sunset: the sky is one tall gradient ("color") anchored at the bottom
   that slowly grows and settles, with two warm patches drifting low; the
   light ("screen") is the horizon's glow, the sun's haze with its rays, and
   a few soft clouds. The top keeps only a faint cool blue. */
.cflow.sshue { mix-blend-mode: color; }
.cflow.sslight { mix-blend-mode: screen; }
.sshue b { position: absolute; will-change: transform; }
.sshue b:nth-child(1) { left: 0; right: 0; bottom: 0; height: 115%; transform-origin: 50% 100%; animation: sssky 19s ease-in-out infinite alternate;
  background: linear-gradient(to top, rgba(255, 175, 70, calc(.62 * var(--fxk, 1))), rgba(255, 170, 72, calc(.6 * var(--fxk, 1))) 7%, rgba(255, 128, 92, calc(.58 * var(--fxk, 1))) 19%,
    rgba(255, 105, 160, calc(.52 * var(--fxk, 1))) 33%, rgba(190, 135, 255, calc(.42 * var(--fxk, 1))) 49%, rgba(120, 140, 255, calc(.3 * var(--fxk, 1))) 68%, rgba(90, 120, 240, calc(.3 * var(--fxk, 1)))); }
@keyframes sssky { 0% { transform: scaleY(.9); } 100% { transform: scaleY(1.04); } }
.sshue b:nth-child(2), .sshue b:nth-child(3) { bottom: -18%; width: 110%; height: 45%; border-radius: 50%; animation: sswarm 27s ease-in-out infinite alternate; }
.sshue b:nth-child(2) { left: -45%; background: radial-gradient(closest-side, rgba(255, 190, 80, calc(.55 * var(--fxk, 1))), rgba(255, 190, 80, 0)); }
.sshue b:nth-child(3) { left: 35%; animation-duration: 33s; animation-direction: alternate-reverse; background: radial-gradient(closest-side, rgba(255, 95, 140, calc(.5 * var(--fxk, 1))), rgba(255, 95, 140, 0)); }
@keyframes sswarm { 0% { transform: translate(-6%, 4%) scale(1); } 100% { transform: translate(18%, -6%) scale(1.15); } }

.sslight b { position: absolute; will-change: transform, opacity; }
/* The horizon: a wide glow from under the bottom edge, breathing. */
.sshorizon { left: -30%; width: 160%; bottom: -26%; height: 62%; border-radius: 50%; transform-origin: 50% 100%;
  background: radial-gradient(closest-side, rgba(255, 185, 95, calc(.3 * var(--fxk, 1))), rgba(255, 140, 100, calc(.15 * var(--fxk, 1))) 45%, rgba(255, 110, 150, calc(.05 * var(--fxk, 1))) 75%, rgba(255, 110, 150, 0));
  animation: sshorizon 11s ease-in-out infinite alternate; }
@keyframes sshorizon { 0% { transform: scale(.94, .88); opacity: .75; } 100% { transform: scale(1.05, 1.06); opacity: 1; } }
/* The sun's haze low on the screen, wandering a little sideways. */
.sssun { left: 18%; width: 64%; bottom: -10%; height: 34%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 215, 140, calc(.2 * var(--fxk, 1))), rgba(255, 170, 100, calc(.08 * var(--fxk, 1))) 50%, rgba(255, 170, 100, 0));
  animation: sssun 23s ease-in-out infinite alternate; }
@keyframes sssun { 0% { transform: translate(-14%, 3%) scale(.95); } 100% { transform: translate(14%, -3%) scale(1.05); } }
/* Faint rays fan up from the sun (its centre on the bottom edge of the
   screen) and sway; an elliptic mask, W wide and 0.3 H high, fades them
   out. The box holds only what the mask lets through. */
.ssrays { left: -50%; width: 200%; bottom: -6%; height: 36%; transform-origin: 50% 83%;
  background: repeating-conic-gradient(from -90deg at 50% 83%, rgba(255, 190, 120, 0) 0deg, rgba(255, 190, 120, calc(.055 * var(--fxk, 1))) 3deg, rgba(255, 190, 120, 0) 6deg, rgba(255, 190, 120, 0) 11deg);
  -webkit-mask-image: radial-gradient(50% 83% at 50% 83%, #000 10%, rgba(0, 0, 0, .5) 45%, transparent);
  mask-image: radial-gradient(50% 83% at 50% 83%, #000 10%, rgba(0, 0, 0, .5) 45%, transparent);
  animation: ssrays 29s ease-in-out infinite alternate; }
@keyframes ssrays { 0% { transform: rotate(-4deg); opacity: .7; } 100% { transform: rotate(4deg); opacity: 1; } }
/* Soft clouds lit pink and amber from below, drifting across: each is two
   round lobes side by side, every lobe ending inside the box. */
.sscloud { left: -10%; width: 80%; height: 7.5%; top: 55%; --c1: 255, 160, 140; --c2: 255, 120, 160;
  background: radial-gradient(34% 44% at 34% 56%, rgba(var(--c1), calc(.12 * var(--fxk, 1))), rgba(var(--c2), calc(.05 * var(--fxk, 1))) 55%, rgba(var(--c2), 0)),
    radial-gradient(36% 46% at 64% 46%, rgba(var(--c1), calc(.1 * var(--fxk, 1))), rgba(var(--c2), calc(.04 * var(--fxk, 1))) 55%, rgba(var(--c2), 0));
  animation: sscloud 47s ease-in-out infinite alternate; }
.sscloud:nth-child(5) { top: 65%; left: 34%; width: 90%; height: 8%; animation-duration: 61s; animation-direction: alternate-reverse; }
.sscloud:nth-child(6) { top: 76%; left: -22%; width: 70%; height: 6%; animation-duration: 53s; animation-delay: -20s; --c1: 255, 190, 110; --c2: 255, 160, 110; }
@keyframes sscloud { 0% { transform: translateX(-12%); } 100% { transform: translateX(18%); } }

@media (prefers-reduced-motion: reduce) {
  .plhue, .plsky, .pzhue, .pzglow, .sshue, .sslight { display: none; }
  .plhue b, .plcurt, .plray, .plhem, .pzhue b, .sshue b, .sslight b { animation: none; }
}
:root.eco :is(.plhue, .plsky, .pzhue, .pzglow, .sshue, .sslight) { display: none; }
:root.eco :is(.plhue b, .plcurt, .plray, .plhem, .pzhue b, .sshue b, .sslight b) { animation: none; }
/* ---- end region: screens-b ---- */

/* ---- region: screens-c (Matrix) ---- */
/* Matrix: columns of letters fall behind the messages (the cards are
   opaque, so it shows only between them). The letters of a column are
   tinted by a gradient clipped to the text: the tail fades out at the top,
   the lead letter below is white-hot with a green bloom. The rain comes out
   from under the band and sinks away above the composer: a still mask
   fades it at both ends. Mirrored columns use the scale property, which
   adds to the falling transform. */
.cflow.cfmatrix { container-type: size;
  -webkit-mask-image: linear-gradient(transparent min(36px, 8%), #000 min(130px, 34%), #000 calc(100% - min(130px, 24%)), transparent calc(100% - min(44px, 8%)));
  mask-image: linear-gradient(transparent min(36px, 8%), #000 min(130px, 34%), #000 calc(100% - min(130px, 24%)), transparent calc(100% - min(44px, 8%))); }
.cfmatrix i { position: absolute; top: 0; right: auto; width: 1ch; height: auto; margin-left: -.5ch; font: normal 400 var(--fs, 13px)/1.18 var(--mono); text-align: center; white-space: pre;
  /* The gradient in a custom property, so the interface colour (theme.js)
     can read it: a background with var() in it cannot be read back. */
  --mxg: linear-gradient(rgba(120, 210, 90, 0), rgba(120, 210, 90, calc(.2 * var(--fxk, 1))) 35%, rgba(159, 232, 112, calc(.46 * var(--fxk, 1))) 85%, rgba(190, 250, 160, calc(.6 * var(--fxk, 1))));
  color: transparent; background: var(--mxg);
  -webkit-background-clip: text; background-clip: text;
  transform: translateY(-100%); animation: cfmatrix 12s linear infinite; will-change: transform; }
.cfmatrix i.mir { scale: -1 1; }
.cfmatrix b { display: block; font-weight: 400; color: rgba(240, 255, 232, calc(.95 * var(--fxk, 1)));
  text-shadow: 0 0 3px rgba(220, 255, 200, calc(.8 * var(--fxk, 1))), 0 0 10px rgba(159, 232, 112, calc(.7 * var(--fxk, 1))); }
@keyframes cfmatrix { from { transform: translateY(-100%); } to { transform: translateY(100vh); transform: translateY(100cqh); } }
/* The small preview: smaller letters. */
@container (max-height: 320px) { .cfmatrix i { font-size: calc(var(--fs, 13px) * .72); } }
@media (prefers-reduced-motion: reduce) { .cfmatrix i { animation: none; } }
:root.eco .cfmatrix i { animation: none; }
/* Forced colours drop the gradient and paint the letters solid, right
   through the cards. */
@media (forced-colors: active) { .cflow.cfmatrix { display: none; } }
/* ---- end region: screens-c ---- */

/* ---- region: frame (the screen's frame) ---- */
/* A tube of light just inside the screen's edge, with a soft glow into the
   screen, in the chosen colour (--fc, its lighter --fcl and darker --fcd
   from fxlib.js; all colours with .rainbow). The whole layer only adds
   light ("screen" blend, black is nothing). Inside it:
   - .nr: four rails, one along each edge (turned so their x runs round the
     screen clockwise and their y goes into it), cut on the diagonal at the
     corners. Each holds a long strip of colour (.nk) and a white light
     (.nl) that slide along it (transform, timed in fxlib.js). They add up
     (plus-lighter), so the diagonal seams do not show.
   - .nmirror: the second set of lights of «twin», mirrored, so it runs the
     other way.
   - .np: a still frame, painted once: on black, the tube and its glow in
     white. It multiplies the colours under it, so they show only as the
     tube and its glow, with round corners. Its depth: .fg-thin/mid/wide.
   - .nt: the tube's whiter core.
   Breathing, beating and the neon lamp's flicker fade the whole layer. */
.cflow.cfframe { mix-blend-mode: screen; background: #000; --nr: 34px; --ng: 110px; --fc: 159, 232, 112; --fcl: 214, 245, 194; --fcd: 87, 128, 62; }
/* Forced colours paint the black as the page's own colour (white in a light
   theme), which a "screen" blend would spread over the whole chat. */
@media (forced-colors: active) { .cflow.cfframe { display: none; } }
.cfframe .nr, .cfframe .nmirror { position: absolute; left: 0; top: 0; }
.cfframe .nmirror { width: 100%; height: 100%; transform: scaleX(-1); mix-blend-mode: plus-lighter; }
.cfframe .nr { width: 0; height: var(--ng); transform-origin: 0 0; mix-blend-mode: plus-lighter;
  -webkit-clip-path: polygon(0 0, 100% 0, calc(100% - var(--ng)) 100%, var(--ng) 100%); clip-path: polygon(0 0, 100% 0, calc(100% - var(--ng)) 100%, var(--ng) 100%); }
.cfframe .nr.r { left: 100%; transform: rotate(90deg); }
.cfframe .nr.b { left: 100%; top: 100%; transform: rotate(180deg); }
.cfframe .nr.l { top: 100%; transform: rotate(-90deg); }
.cfframe .nk { position: absolute; left: 0; top: 0; height: 100%; will-change: transform; background: rgb(var(--fc)); }
/* Flowing: shades of the colour pass along the tube, twice per round. */
.cfframe.fm-flow .nk { background: linear-gradient(90deg, rgb(var(--fc)), rgb(var(--fcl)) 24%, rgb(var(--fc)) 50%, rgb(var(--fcd)) 76%, rgb(var(--fc))) 0 0 / calc(var(--np, 1200px) / 2) 100% repeat-x; }
/* All colours: the wheel once in --np (the length of the tube); neighbours
   on the wheel only, so no blend between them turns grey. */
.cfframe.rainbow .nk { background: linear-gradient(90deg, rgb(255, 60, 190), rgb(150, 96, 255) 20%, rgb(50, 200, 255) 40%, rgb(100, 255, 150) 60%, rgb(255, 178, 60) 80%, rgb(255, 60, 190)) 0 0 / var(--np, 1200px) 100% repeat-x; }
/* A light: its head at 76%, a long tail behind, a short fall ahead. */
.cfframe .nl { position: absolute; left: 0; top: 0; height: 100%; width: var(--nl, 260px); transform: translateX(-100%); will-change: transform;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .14) 38%, rgba(255, 255, 255, .5) 64%, rgba(255, 255, 255, .92) 74.5%, rgba(255, 255, 255, .92) 76%, rgba(255, 255, 255, 0) 81%); }
.cfframe:not(.fm-run):not(.fm-twin) .nl { display: none; }
.cfframe .np { position: absolute; inset: 0; background: #000; mix-blend-mode: multiply; }
.cfframe .np::before { content: ""; position: absolute; inset: 2px; border-radius: var(--nr);
  box-shadow: 0 0 2px 1px rgba(255, 255, 255, .5), 0 0 8px 2px rgba(255, 255, 255, .3),
    inset 0 0 0 2px rgba(255, 255, 255, .92), inset 0 0 6px 1px rgba(255, 255, 255, .55),
    inset 0 0 28px 2px rgba(255, 255, 255, .34), inset 0 0 80px 10px rgba(255, 255, 255, .16); }
.cfframe.fg-thin .np::before { box-shadow: 0 0 2px 1px rgba(255, 255, 255, .45), inset 0 0 0 1.5px rgba(255, 255, 255, .9), inset 0 0 5px 1px rgba(255, 255, 255, .5),
    inset 0 0 16px 1px rgba(255, 255, 255, .26), inset 0 0 40px 4px rgba(255, 255, 255, .1); }
.cfframe.fg-wide .np::before { box-shadow: 0 0 3px 1px rgba(255, 255, 255, .55), 0 0 12px 3px rgba(255, 255, 255, .34),
    inset 0 0 0 2.5px rgba(255, 255, 255, .95), inset 0 0 8px 2px rgba(255, 255, 255, .62),
    inset 0 0 40px 4px rgba(255, 255, 255, .42), inset 0 0 120px 18px rgba(255, 255, 255, .22); }
.cfframe .nt { position: absolute; inset: 2px; border-radius: var(--nr); box-shadow: inset 0 0 0 1px rgba(255, 250, 255, .3); }
/* The small preview: a thinner tube and a shorter glow. */
.cfframe.sm .np::before { box-shadow: 0 0 2px 1px rgba(255, 255, 255, .5), inset 0 0 0 1px rgba(255, 255, 255, .92),
  inset 0 0 5px 1px rgba(255, 255, 255, .5), inset 0 0 22px 1px rgba(255, 255, 255, .24); }
.cfframe.sm.fg-wide .np::before { box-shadow: 0 0 2px 1px rgba(255, 255, 255, .55), inset 0 0 0 1.5px rgba(255, 255, 255, .95),
  inset 0 0 7px 1px rgba(255, 255, 255, .58), inset 0 0 34px 3px rgba(255, 255, 255, .32); }
.cfframe.sm .nt { box-shadow: inset 0 0 0 .5px rgba(255, 250, 255, .3); }
/* Breathing: glows up and fades, slowly and softly. */
.cflow.cfframe.fm-breathe { animation: cfbreathe 5.2s ease-in-out infinite; }
@keyframes cfbreathe { 0%, 100% { opacity: .22; } 50% { opacity: 1; } }
/* Pulse: two soft beats, then a rest, like a heart. */
.cflow.cfframe.fm-beat { animation: cfbeat 1.9s ease-out infinite; }
@keyframes cfbeat { 0% { opacity: .38; } 9% { opacity: 1; } 19% { opacity: .55; } 28% { opacity: .9; } 55%, 100% { opacity: .38; } }
/* Neon lamp: steady, and now and then it dips twice, gently. */
.cflow.cfframe.fm-neon { animation: cfneon 8.5s infinite; }
@keyframes cfneon { 0%, 70% { opacity: 1; } 71.5% { opacity: .62; } 73% { opacity: 1; } 74.8% { opacity: .78; } 77%, 100% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .cflow.cfframe { animation: none; } }
:root.eco .cflow.cfframe { animation: none; }
/* ---- end region: frame ---- */


/* ---- region: messages (Reveal, Drop, Letter wave; Signal, Confetti) ---- */
/* The row of a card effect holds its lights (::before, ::after) over the
   card's place (--fxl, --fxt, --fxw, --fxh from fxlib.js). */
.mrow.fx-reveal, .mrow.fx-drop { position: relative; }

/* Reveal: the card is clipped to what the scan line has crossed (from
   12 px before the card to 12 px after it, for its tail and shadow). The
   line (::after) moves by transform in step with the clip: a white core in
   a soft green halo, a little taller than the card; at the end it folds
   up. Behind it a green afterglow (::before) lies over the fresh part of
   the card and fades with distance, so the card seems to develop. */
.mrow.fx-reveal .mcard { animation: fxreveal .7s cubic-bezier(.3, .1, .35, 1) both; }
.mrow.fx-reveal::after { content: ""; position: absolute; top: calc(var(--fxt, 0px) - 10px); height: calc(var(--fxh, 40px) + 20px); left: calc(var(--fxl, 0px) - 12px); width: 44px; margin-left: -22px;
  z-index: 2; pointer-events: none;
  background: linear-gradient(90deg, rgba(159, 232, 112, 0), rgba(159, 232, 112, .08) 18%, rgba(159, 232, 112, .2) 33%, rgba(190, 255, 160, .58) 44%, #f4ffee 48.8% 51.2%,
    rgba(190, 255, 160, .58) 56%, rgba(159, 232, 112, .2) 67%, rgba(159, 232, 112, .08) 82%, rgba(159, 232, 112, 0));
  -webkit-mask-image: linear-gradient(transparent, #000 12px, #000 calc(100% - 12px), transparent);
  mask-image: linear-gradient(transparent, #000 12px, #000 calc(100% - 12px), transparent);
  animation: fxrevline .9s both; will-change: transform, opacity; }
.mrow.fx-reveal::before { content: ""; position: absolute; top: calc(var(--fxt, 0px) + 3px); height: calc(var(--fxh, 40px) - 6px); left: calc(var(--fxl, 0px) - 12px);
  width: min(100px, var(--fxw, 200px) * .55); margin-left: max(-100px, var(--fxw, 200px) * -.55); transform-origin: 100% 50%; z-index: 1; pointer-events: none;
  background: linear-gradient(90deg, rgba(159, 232, 112, 0), rgba(159, 232, 112, .05) 35%, rgba(170, 245, 130, .13) 75%, rgba(200, 255, 170, .22));
  -webkit-mask-image: linear-gradient(transparent, #000 8px, #000 calc(100% - 8px), transparent);
  mask-image: linear-gradient(transparent, #000 8px, #000 calc(100% - 8px), transparent);
  opacity: 0; animation: fxrevglow .9s both; will-change: transform, opacity; }
@keyframes fxreveal { from { clip-path: inset(-12px calc(100% + 12px) -12px -12px); } to { clip-path: inset(-12px); } }
@keyframes fxrevline {
  0% { transform: translateX(0); opacity: 1; animation-timing-function: cubic-bezier(.3, .1, .35, 1); }
  77.78% { transform: translateX(calc(var(--fxw, 200px) + 24px)); opacity: 1; animation-timing-function: ease-out; }
  100% { transform: translateX(calc(var(--fxw, 200px) + 24px)) scaleY(0); opacity: 0; }
}
@keyframes fxrevglow {
  0% { transform: translateX(0) scaleX(0); opacity: 1; animation-timing-function: cubic-bezier(.3, .1, .35, 1); }
  60% { opacity: 1; }
  77.78% { transform: translateX(calc(var(--fxw, 200px) + 24px)) scaleX(1); animation-timing-function: ease-out; }
  100% { transform: translateX(calc(var(--fxw, 200px) + 24px)) scaleX(1); opacity: 0; }
}

/* Drop: the card and its avatar fall, see-through while they pass the
   row above; the card squashes on landing, bounces once and settles. A
   streak of light (::before) trails the fall and is gone when it lands;
   then its lower edge lights up (the card's ::after) over a soft spread of
   light on the floor (the row's ::after). Dust pixels: fxlib.js. */
.mrow.fx-drop .mcard { transform-origin: 50% 100%; animation: fxdrop .8s both; }
.mrow.fx-drop > .micon { animation: fxdropicon .8s both; }
.mrow.fx-drop::before { content: ""; position: absolute; top: calc(var(--fxt, 0px) - 46px); height: 46px; left: calc(var(--fxl, 0px) + 10px); width: calc(var(--fxw, 200px) - 20px);
  pointer-events: none; transform-origin: 50% 100%;
  background: linear-gradient(rgba(159, 232, 112, 0), rgba(159, 232, 112, .13) 60%, rgba(200, 255, 170, .3));
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 25%, #000 75%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 25%, #000 75%, transparent);
  opacity: 0; animation: fxdroptrail .8s both; will-change: transform, opacity; }
.mrow.fx-drop .mcard::after { content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none;
  border-bottom: 1.5px solid #eaffdc; opacity: 0; animation: fxdroprim .8s both; will-change: opacity; }
/* A sticker has no frame to light. */
.mrow.fx-drop .mcard.stickercard::after { display: none; }
.mrow.fx-drop::after { content: ""; position: absolute; top: calc(var(--fxt, 0px) + var(--fxh, 40px) - 9px); height: 22px; left: var(--fxl, 0px); width: var(--fxw, 200px);
  z-index: -1; pointer-events: none; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(210, 255, 180, .5), rgba(159, 232, 112, .22) 50%, rgba(159, 232, 112, 0));
  opacity: 0; animation: fxdropglow .8s both; will-change: transform, opacity; }
@keyframes fxdrop {
  0% { transform: translateY(-32px) scale(.97, 1.06); opacity: 0; animation-timing-function: cubic-bezier(.55, 0, .9, .45); }
  30% { opacity: 1; }
  36% { transform: translateY(0) scale(1); animation-timing-function: cubic-bezier(.2, .6, .4, 1); }
  47% { transform: translateY(0) scale(1.015, .9); animation-timing-function: cubic-bezier(.3, 0, .4, 1); }
  64% { transform: translateY(-7px) scale(.995, 1.03); animation-timing-function: cubic-bezier(.6, 0, .8, .5); }
  78% { transform: translateY(0) scale(1.006, .975); animation-timing-function: ease-out; }
  89% { transform: translateY(-1.5px) scale(1); animation-timing-function: ease-in-out; }
  100% { transform: none; opacity: 1; }
}
@keyframes fxdropicon {
  0% { transform: translateY(-32px); opacity: 0; animation-timing-function: cubic-bezier(.55, 0, .9, .45); }
  30% { opacity: 1; }
  36% { transform: none; animation-timing-function: cubic-bezier(.2, .6, .4, 1); }
  52% { transform: translateY(-4px); animation-timing-function: cubic-bezier(.6, 0, .8, .5); }
  66%, 100% { transform: none; opacity: 1; }
}
@keyframes fxdroptrail {
  0% { transform: translateY(-32px) scaleY(.4); opacity: 0; animation-timing-function: cubic-bezier(.55, 0, .9, .45); }
  14% { opacity: 1; }
  36%, 100% { transform: translateY(0) scaleY(0); opacity: 0; }
}
@keyframes fxdroprim { 0%, 34% { opacity: 0; } 42% { opacity: 1; } 100% { opacity: 0; } }
@keyframes fxdropglow {
  0%, 33% { opacity: 0; transform: scaleX(.35); }
  44% { opacity: 1; transform: scaleX(1); }
  100% { opacity: 0; transform: scaleX(1.3); }
}
.fxdust { position: absolute; width: var(--z, 2px); height: var(--z, 2px); margin: calc(var(--z, 2px) / -2) 0 0 calc(var(--z, 2px) / -2); background: rgb(var(--c, 223, 255, 204));
  box-shadow: 0 0 5px rgba(159, 232, 112, .85); opacity: 0; will-change: transform, opacity; }

/* Letter wave: the real text is see-through meanwhile; over it each letter
   (or word, in a long text) of the copy, placed by fxlib.js, jumps 4 px in
   its turn (--d), brightening with a glow — one animation, one layer per
   piece. Amber on a message to me. Without motion, or in forced colours
   (where the copy cannot be styled), the real text simply stays. The
   emoji of the real text are only see-through, so screen readers keep
   them. */
@media (prefers-reduced-motion: no-preference) and (forced-colors: none) {
  :root:not(.eco) .mtext.fxwaving, :root:not(.eco) .mtext.fxwaving * { color: transparent !important; transition: none !important; }
  :root:not(.eco) .mtext.fxwaving img { opacity: 0; }
}
@media (forced-colors: active) { .fxwave { display: none; } }
.fxwave { position: absolute; left: 0; top: 0; width: 0; height: 0; z-index: 2; pointer-events: none; white-space: pre; line-height: normal;
  --wc: 244, 255, 236; --wg: 159, 232, 112; }
.mrow.tome .fxwave { --wc: 255, 246, 222; --wg: 255, 200, 90; }
.fxwave > * { position: absolute; display: block; animation: fxwavej .46s cubic-bezier(.3, .6, .35, 1) var(--d, 0ms) both; }
.fxwave.words > * { animation-duration: .54s; }
.fxwave > img { image-rendering: pixelated; image-rendering: crisp-edges; filter: drop-shadow(0 0 3px rgba(255, 255, 255, .22)); }
@keyframes fxwavej {
  0% { transform: none; filter: none; }
  34% { transform: translateY(-4px); filter: brightness(1.45) drop-shadow(0 0 3px rgba(var(--wg), .95)); }
  68% { transform: translateY(.6px); filter: brightness(1.1) drop-shadow(0 0 1px rgba(var(--wg), .4)); }
  100% { transform: none; filter: none; }
}

/* Signal: each arc is the top of a ring centred on the button (a radial
   gradient: a bright core in a soft halo, as thin at every size), cut to a
   wedge with soft ends and turned toward the middle of the screen (--a).
   Sizes and turns come from fxlib.js; they light up from the inside out,
   hold as the whole sign, then drift outward and fade. A small light
   glows at the source meanwhile. */
.fxsig { position: absolute; border-radius: 50%; opacity: 0;
  background: radial-gradient(closest-side, rgba(159, 232, 112, 0) calc(100% - 16px), rgba(159, 232, 112, .16) calc(100% - 12px), rgba(190, 255, 160, .62) calc(100% - 8.5px),
    #effee6 calc(100% - 7px) calc(100% - 5.5px), rgba(190, 255, 160, .62) calc(100% - 4px), rgba(159, 232, 112, .16) calc(100% - 1.5px), rgba(159, 232, 112, 0));
  -webkit-mask-image: conic-gradient(from -44deg, transparent, #000 16deg 72deg, transparent 88deg);
  mask-image: conic-gradient(from -44deg, transparent, #000 16deg 72deg, transparent 88deg);
  animation: fxsig 1.15s both; will-change: transform, opacity; }
@keyframes fxsig {
  0% { opacity: 0; transform: rotate(var(--a, 0deg)) scale(.72); animation-timing-function: cubic-bezier(.2, .8, .3, 1); }
  20% { opacity: var(--o, 1); transform: rotate(var(--a, 0deg)) scale(1); animation-timing-function: linear; }
  52% { opacity: var(--o, 1); transform: rotate(var(--a, 0deg)) scale(1.02); animation-timing-function: cubic-bezier(.4, 0, .6, 1); }
  100% { opacity: 0; transform: rotate(var(--a, 0deg)) scale(1.2); }
}
.fxsigdot { position: absolute; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; opacity: 0;
  background: radial-gradient(closest-side, rgba(244, 255, 238, .9), rgba(200, 255, 170, .5) 26%, rgba(159, 232, 112, .16) 58%, rgba(159, 232, 112, 0));
  animation: fxsigdot 1s ease-out both; will-change: transform, opacity; }
@keyframes fxsigdot { 0% { opacity: 0; transform: scale(.4); } 14% { opacity: 1; transform: scale(1); } 55% { opacity: .7; } 100% { opacity: 0; transform: scale(.8); } }

/* Confetti: pixels, square or oblong (--z by --zh), with a little glow of
   their own colour (--c); their flight is the Web Animations API from
   fxlib.js. A soft pop of light at the button as they leave. */
.fxconf { position: absolute; width: var(--z, 5px); height: var(--zh, var(--z, 5px)); margin: calc(var(--zh, var(--z, 5px)) / -2) 0 0 calc(var(--z, 5px) / -2); border-radius: 1px;
  background: rgb(var(--c, 159, 232, 112)); box-shadow: 0 0 6px rgba(var(--c, 159, 232, 112), .65), inset 0 0 0 1px rgba(255, 255, 255, .25); opacity: 0; will-change: transform, opacity; }
.fxconfpop { position: absolute; width: 90px; height: 90px; margin: -45px 0 0 -45px; border-radius: 50%; opacity: 0;
  background: radial-gradient(closest-side, rgba(236, 255, 226, .75), rgba(159, 232, 112, .3) 40%, rgba(185, 162, 255, .12) 70%, rgba(185, 162, 255, 0));
  animation: fxconfpop .6s ease-out both; will-change: transform, opacity; }
@keyframes fxconfpop { 0% { opacity: 0; transform: scale(.25); } 18% { opacity: 1; } 100% { opacity: 0; transform: scale(1.15); } }

@media (prefers-reduced-motion: reduce) {
  .mrow.fx-reveal .mcard, .mrow.fx-drop .mcard, .mrow.fx-drop > .micon { animation: none !important; clip-path: none; transform: none; }
  .mrow.fx-reveal::before, .mrow.fx-reveal::after, .mrow.fx-drop::before, .mrow.fx-drop::after, .mrow.fx-drop .mcard::after,
  .fxwave, .fxdust, .fxsig, .fxsigdot, .fxconf, .fxconfpop { display: none; }
}
:root.eco :is(.mrow.fx-reveal .mcard, .mrow.fx-drop .mcard, .mrow.fx-drop > .micon) { animation: none !important; clip-path: none; transform: none; }
:root.eco .mrow.fx-reveal::before, :root.eco .mrow.fx-reveal::after, :root.eco .mrow.fx-drop::before, :root.eco .mrow.fx-drop::after, :root.eco .mrow.fx-drop .mcard::after,
:root.eco :is(.fxwave, .fxdust, .fxsig, .fxsigdot, .fxconf, .fxconfpop) { display: none; }
/* ---- end region: messages ---- */

/* ---- region: mention-air (Beacon, Bloom; Equalizer, Edge glow; sparks while typing) ---- */
.fxair { position: absolute; inset: 0; z-index: 33; pointer-events: none; }
/* Light over the whole screen, next to .fxtop (fxlib.js: lightLayer): it
   blends with the chat under it, and "screen" only adds light. A "back"
   one lies behind the messages, over the grid. Alphas follow --fxk. */
.fxlit { position: absolute; inset: 0; z-index: 34; pointer-events: none; overflow: hidden; mix-blend-mode: screen; }
.fxlit.back { z-index: -1; }

/* Beacon: two beams turn round the middle; the mask lets their light
   through at the edges (--bw deep, soft inward) and only a trace of it in
   the middle. Each beam is a quarter disc with its corner in the middle:
   a hot amber core at the leading edge and a long tail behind it. */
.fxbeacon { --bw: 60px; --mm: rgba(0, 0, 0, .3);
  -webkit-mask-image: linear-gradient(#000, var(--mm) calc(var(--bw) * .42), transparent var(--bw)), linear-gradient(0deg, #000, var(--mm) calc(var(--bw) * .42), transparent var(--bw)),
    linear-gradient(90deg, #000, var(--mm) calc(var(--bw) * .42), transparent var(--bw)), linear-gradient(270deg, #000, var(--mm) calc(var(--bw) * .42), transparent var(--bw)),
    linear-gradient(rgba(0, 0, 0, .04), rgba(0, 0, 0, .04));
  mask-image: linear-gradient(#000, var(--mm) calc(var(--bw) * .42), transparent var(--bw)), linear-gradient(0deg, #000, var(--mm) calc(var(--bw) * .42), transparent var(--bw)),
    linear-gradient(90deg, #000, var(--mm) calc(var(--bw) * .42), transparent var(--bw)), linear-gradient(270deg, #000, var(--mm) calc(var(--bw) * .42), transparent var(--bw)),
    linear-gradient(rgba(0, 0, 0, .04), rgba(0, 0, 0, .04)); }
/* A faint warm spill on the whole frame while the beacon turns. */
.fxbeacon::before { content: ""; position: absolute; inset: 0; background: rgba(255, 176, 70, calc(.17 * var(--fxk, 1))); }
.fxbeacon i { position: absolute; left: 50%; bottom: 50%; transform-origin: 0 100%; will-change: transform;
  background: conic-gradient(from 0deg at 0 100%, rgba(255, 160, 40, 0), rgba(255, 165, 50, calc(.1 * var(--fxk, 1))) 30deg, rgba(255, 180, 65, calc(.36 * var(--fxk, 1))) 62deg,
    rgba(255, 205, 105, calc(.8 * var(--fxk, 1))) 79deg, rgba(255, 228, 165, 1) 84deg, rgba(255, 214, 120, calc(.5 * var(--fxk, 1))) 86.6deg,
    rgba(255, 196, 90, calc(.12 * var(--fxk, 1))) 88.6deg, rgba(255, 190, 80, 0) 90deg); }

/* Bloom: behind the messages a big soft glow and a wheel of rays (its
   spokes are drawn in JS); over them a faint wash, a glow on the card's
   edge and motes. Every light is full in the middle, never a ring. */
.fxbloom i { position: absolute; will-change: transform, opacity; }
.fxb-glow, .fxb-wash, .fxb-mote { border-radius: 50%; }
.fxb-glow { background: radial-gradient(closest-side, rgba(255, 204, 118, calc(.5 * var(--fxk, 1))), rgba(255, 190, 92, calc(.36 * var(--fxk, 1))) 24%,
  rgba(255, 172, 66, calc(.17 * var(--fxk, 1))) 52%, rgba(255, 160, 56, calc(.05 * var(--fxk, 1))) 78%, rgba(255, 150, 50, 0)); }
.fxb-rays { -webkit-mask-image: radial-gradient(closest-side, transparent 3%, rgba(0, 0, 0, .9) 16%, rgba(0, 0, 0, .55) 50%, transparent 97%);
  mask-image: radial-gradient(closest-side, transparent 3%, rgba(0, 0, 0, .9) 16%, rgba(0, 0, 0, .55) 50%, transparent 97%); }
.fxb-rays i { inset: 0; border-radius: 50%; }
.fxb-wash { background: radial-gradient(closest-side, rgba(255, 206, 120, calc(.2 * var(--fxk, 1))), rgba(255, 190, 90, calc(.15 * var(--fxk, 1))) 28%,
  rgba(255, 172, 66, calc(.07 * var(--fxk, 1))) 56%, rgba(255, 160, 56, calc(.02 * var(--fxk, 1))) 80%, rgba(255, 150, 50, 0)); }
.fxb-rim { box-shadow: 0 0 0 1px rgba(255, 218, 140, calc(.5 * var(--fxk, 1))), 0 0 14px 2px rgba(255, 192, 92, calc(.4 * var(--fxk, 1))),
  0 0 36px 6px rgba(255, 172, 70, calc(.16 * var(--fxk, 1))); }
.fxb-mote { background: radial-gradient(circle, #fffaf0 0 10%, rgba(255, 220, 130, .95) 20%, rgba(255, 190, 75, .38) 40%, rgba(255, 180, 60, .1) 58%, rgba(255, 180, 60, 0) 72%); }

/* Equalizer: over the grid, behind the messages (z-index -1 in the
   screen), standing on the composer (JS sets bottom and height), clear of
   the prompt on the left; the top of the row fades out. */
.fxair.fxeq { inset: auto 0 0 0; height: 48px; z-index: -1; transition: opacity .3s; }
.fxeq-row { position: absolute; inset: 0 34px; display: flex; justify-content: space-between;
  -webkit-mask-image: linear-gradient(to top, #000 55%, transparent); mask-image: linear-gradient(to top, #000 55%, transparent); }
.fxeq-row span { position: relative; width: 3px; height: 100%; --c: 159, 232, 112; }
.fxeq-row i { position: absolute; inset: 0; border-radius: 1.5px 1.5px 0 0; transform-origin: 50% 100%; transform: scaleY(0); will-change: transform;
  background: linear-gradient(0deg, rgba(var(--c), calc(.12 * var(--fxk, 1))), rgba(var(--c), calc(.55 * var(--fxk, 1))) 40%,
    rgba(var(--c), calc(.85 * var(--fxk, 1))) 90%, rgba(236, 255, 244, calc(.95 * var(--fxk, 1)))); }
/* A soft glow round each bar, scaled with it (no element of its own). */
.fxeq-row i::before { content: ""; position: absolute; left: -6px; right: -6px; top: -3px; bottom: 0;
  background: radial-gradient(closest-side, rgba(var(--c), calc(.3 * var(--fxk, 1))), rgba(var(--c), calc(.09 * var(--fxk, 1))) 60%, rgba(var(--c), 0)); }
.fxeq-row b { position: absolute; left: -1px; right: -1px; bottom: 3px; height: 2px; border-radius: 1px; will-change: transform;
  background: rgba(230, 255, 235, calc(.55 * var(--fxk, 1))); box-shadow: 0 0 4px rgba(var(--c), calc(.4 * var(--fxk, 1))); }
/* The light the bars throw on the grid round them. */
.fxeq-glow { position: absolute; left: 4%; right: 4%; bottom: -45%; height: 160%; border-radius: 50%; opacity: 0; will-change: opacity;
  background: radial-gradient(closest-side, rgba(140, 216, 255, calc(.2 * var(--fxk, 1))), rgba(150, 226, 180, calc(.12 * var(--fxk, 1))) 40%,
    rgba(159, 232, 112, calc(.05 * var(--fxk, 1))) 72%, rgba(159, 232, 112, 0)); }
/* The line the bars stand on. */
.fxeq::after { content: ""; position: absolute; left: 18px; right: 18px; bottom: 0; height: 1px;
  background: linear-gradient(90deg, rgba(159, 232, 112, 0), rgba(159, 232, 112, .35) 18%, rgba(159, 232, 112, .35) 82%, rgba(159, 232, 112, 0)); }
/* Off air: the bars and caps fall, then the row fades out and is hidden. */
.fxeq.off { opacity: 0; visibility: hidden; transition: opacity .5s .3s, visibility 0s .8s; }
.fxeq.off i { transform: scaleY(0) !important; transition: transform .45s cubic-bezier(.5, 0, .8, .6); }
.fxeq.off b { transform: none !important; transition: transform .65s cubic-bezier(.5, 0, .8, .6); }
.fxeq.off .fxeq-glow { opacity: 0 !important; transition: opacity .4s; }

/* Equaliser to the sound (eqfx.js): one canvas over the grid, behind the
   messages, standing on the composer (JS sets bottom, height and opacity
   as it fades in and out); its top softens so a peak never sits hard on a
   line of text, and a glow under it lights the grid. */
.fxspec { position: absolute; left: 0; right: 0; bottom: 0; height: 48px; z-index: -1; pointer-events: none; }
.fxspec canvas { display: block; -webkit-mask-image: linear-gradient(to top, #000 62%, rgba(0, 0, 0, .45)); mask-image: linear-gradient(to top, #000 62%, rgba(0, 0, 0, .45)); }
.fxspec::after { content: ""; position: absolute; left: 6%; right: 6%; bottom: -10px; height: 26px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(140, 216, 255, .16), rgba(159, 232, 112, .06) 60%, rgba(159, 232, 112, 0)); }
.fxspec.off { visibility: hidden; }
@media (prefers-reduced-motion: reduce) { .fxspec { display: none; } }
:root.eco .fxspec { display: none; }

/* Edge glow: four edges of soft light in the colours of the app, flowing
   round the frame (each edge's band slides along it, FLOW = 420px in
   FLOW_S = 9 s in fxlib.js; JS scales each edge's depth with the voice),
   a thin neon rim and a warm rim for loud peaks (JS sets their opacity). */
.fxair.fxedge { mix-blend-mode: screen; }
.fxedge-c, .fxedge i { position: absolute; inset: 0; opacity: 0; will-change: opacity; }
.fxedge-c { overflow: hidden; }
.fxprev .fxedge-c, .fxprev .fxedge i { border-radius: 13px; }
.fxedge-f { position: absolute; overflow: hidden; will-change: transform; --ed: 50px; }
.fxedge-f.t { left: 0; right: 0; top: 0; height: var(--ed); transform-origin: 50% 0; }
.fxedge-f.b { left: 0; right: 0; bottom: 0; height: var(--ed); transform-origin: 50% 100%; }
.fxedge-f.l { top: 0; bottom: 0; left: 0; width: var(--ed); transform-origin: 0 50%; }
.fxedge-f.r { top: 0; bottom: 0; right: 0; width: var(--ed); transform-origin: 100% 50%; }
/* The band: one period of colour repeats along it, and it fades inward. */
.fxedge-f b { position: absolute; display: block; will-change: transform; --g: rgba(159, 232, 112, calc(.72 * var(--fxk, 1))) 0, rgba(140, 216, 255, calc(.6 * var(--fxk, 1))) 92px,
  rgba(140, 216, 255, calc(.14 * var(--fxk, 1))) 151px, rgba(185, 162, 255, calc(.66 * var(--fxk, 1))) 235px, rgba(159, 232, 112, calc(.2 * var(--fxk, 1))) 336px,
  rgba(159, 232, 112, calc(.72 * var(--fxk, 1))) 420px; animation: 9s linear infinite; }
.fxedge-f.t b { top: 0; bottom: 0; left: -420px; right: 0; background: repeating-linear-gradient(90deg, var(--g)); animation-name: fxedget;
  -webkit-mask-image: linear-gradient(#000, rgba(0, 0, 0, .4) 30%, transparent); mask-image: linear-gradient(#000, rgba(0, 0, 0, .4) 30%, transparent); }
.fxedge-f.r b { left: 0; right: 0; top: -420px; bottom: 0; background: repeating-linear-gradient(180deg, var(--g)); animation-name: fxedger;
  -webkit-mask-image: linear-gradient(270deg, #000, rgba(0, 0, 0, .4) 30%, transparent); mask-image: linear-gradient(270deg, #000, rgba(0, 0, 0, .4) 30%, transparent); }
.fxedge-f.b b { top: 0; bottom: 0; left: 0; right: -420px; background: repeating-linear-gradient(270deg, var(--g)); animation-name: fxedgeb;
  -webkit-mask-image: linear-gradient(0deg, #000, rgba(0, 0, 0, .4) 30%, transparent); mask-image: linear-gradient(0deg, #000, rgba(0, 0, 0, .4) 30%, transparent); }
.fxedge-f.l b { left: 0; right: 0; top: 0; bottom: -420px; background: repeating-linear-gradient(0deg, var(--g)); animation-name: fxedgel;
  -webkit-mask-image: linear-gradient(90deg, #000, rgba(0, 0, 0, .4) 30%, transparent); mask-image: linear-gradient(90deg, #000, rgba(0, 0, 0, .4) 30%, transparent); }
@keyframes fxedget { from { transform: translateX(0); } to { transform: translateX(420px); } }
@keyframes fxedger { from { transform: translateY(0); } to { transform: translateY(420px); } }
@keyframes fxedgeb { from { transform: translateX(0); } to { transform: translateX(-420px); } }
@keyframes fxedgel { from { transform: translateY(0); } to { transform: translateY(-420px); } }
.fxedge-r { box-shadow: inset 0 0 0 1.5px rgba(190, 245, 150, calc(.6 * var(--fxk, 1))), inset 0 0 10px 1px rgba(159, 232, 112, calc(.4 * var(--fxk, 1))); }
.fxedge-w { box-shadow: inset 0 0 0 1.5px rgba(255, 216, 125, calc(.75 * var(--fxk, 1))), inset 0 0 16px 2px rgba(255, 196, 90, calc(.45 * var(--fxk, 1))),
  inset 0 0 44px 4px rgba(255, 176, 70, calc(.16 * var(--fxk, 1))); }
.fxedge.off { visibility: hidden; transition: visibility 0s .65s; }
.fxedge.off i, .fxedge.off .fxedge-c { opacity: 0 !important; transition: opacity .6s ease-out; }
.fxedge.off .fxedge-f b { animation-play-state: paused; }

/* Sparks while typing: a tiny four-pointed glint. */
.fxkey { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; --c: 205, 255, 175; will-change: transform, opacity;
  background: radial-gradient(circle, #fff 0 1.4px, rgba(var(--c), .95) 2.1px, rgba(var(--c), .38) 3.6px, rgba(var(--c), .1) 5.6px, rgba(var(--c), 0) 8px),
    linear-gradient(rgba(var(--c), 0), rgba(var(--c), .9) 50%, rgba(var(--c), 0)) 50% 50% / 1.5px 100% no-repeat,
    linear-gradient(90deg, rgba(var(--c), 0), rgba(var(--c), .9) 50%, rgba(var(--c), 0)) 50% 50% / 100% 1.5px no-repeat; }
.fxkey.ice { --c: 165, 225, 255; }

@media (prefers-reduced-motion: reduce) { .fxlit, .fxair { display: none; } .fxedge-f b { animation: none; } }
:root.eco :is(.fxlit, .fxair) { display: none; }
:root.eco .fxedge-f b { animation: none; }
/* ---- end region: mention-air ---- */

/* ---- region: grid (Nodes, Scanner) ---- */
/* Nodes: lights on the crossings of the grid. A node is a box of 3x3 cells
   centred on a crossing: the vertical lines sit at 50% - 12px + 24px·n,
   the horizontal ones at 24px·m. round() takes its place (fractions --x,
   --y) to the nearest crossing of its own screen; where CSS has no
   round(), n and m counted by the script (--n, --m) are used. The box is
   masked to the two lines through its middle and a small dot there; a
   soft light inside grows along the lines, holds and fades. */
.gfnodes { position: absolute; inset: 0; }
.gfnode { position: absolute; width: 73px; height: 73px; --c: 159, 232, 112;
  left: calc(50% - 48px + 24px * var(--n, 0)); top: calc(24px * var(--m, 8) - 36px);
  -webkit-mask: radial-gradient(circle at 36.5px 36.5px, #000 1.4px, rgba(0, 0, 0, .4) 3px, transparent 9px) no-repeat,
    linear-gradient(90deg, #000 1px, transparent 1px) 12px 0 / 24px 24px, linear-gradient(#000 1px, transparent 1px) 0 12px / 24px 24px;
  mask: radial-gradient(circle at 36.5px 36.5px, #000 1.4px, rgba(0, 0, 0, .4) 3px, transparent 9px) no-repeat,
    linear-gradient(90deg, #000 1px, transparent 1px) 12px 0 / 24px 24px, linear-gradient(#000 1px, transparent 1px) 0 12px / 24px 24px; }
@supports (top: round(1px, 1px)) {
  .gfnode { left: calc(50% - 48px + round(var(--x) * 100% - 50% + 12px, 24px)); top: calc(round(var(--y) * 100%, 24px) - 36px); }
}
.gfnode.ice { --c: 140, 216, 255; }
.gfnode.amb { --c: 255, 205, 110; }
.gfnode b { position: absolute; inset: 0; border-radius: 50%; opacity: 0; transform: scale(.35);
  background: radial-gradient(closest-side, rgba(235, 255, 225, .95), rgba(var(--c), .75) 12%, rgba(var(--c), .3) 45%, rgba(var(--c), 0));
  animation: gfnode 9s ease-in-out infinite; will-change: transform, opacity; }
@keyframes gfnode { 0% { opacity: 0; transform: scale(.35); } 35% { opacity: 1; transform: scale(1); } 55% { opacity: .85; } 100% { opacity: 0; transform: scale(.8); } }

/* Sweep: a scanner over the lines (masked like the other grid layers).
   A mover (a line of no height) goes down and back up with ease-in-out,
   turning just under the chat's band and just over the composer. On it sit a soft ice-white lead line and
   the trail: green light on the lines just passed, scaled from the lead
   by how fast the mover goes (a sine-like bump: long in the middle of the
   screen, almost none at the turns), and flipped to the other side when
   the scanner turns. A faint glow over the grid rides on the lead. */
.gfsweep { position: absolute; inset: 0; container-type: size; }
.gfsl { position: absolute; inset: 0;
  -webkit-mask-image: linear-gradient(90deg, #000 1px, transparent 1px), linear-gradient(#000 1px, transparent 1px);
  mask-image: linear-gradient(90deg, #000 1px, transparent 1px), linear-gradient(#000 1px, transparent 1px);
  -webkit-mask-size: 24px 24px; mask-size: 24px 24px; -webkit-mask-position: 50% 0; mask-position: 50% 0; }
.gfsl i, .gfsg { position: absolute; left: 0; right: 0; top: 0; animation: gfsweep 12s infinite; will-change: transform; }
.gfsl i { height: 0; }
.gfsl b { position: absolute; left: 0; right: 0; }
.gftr { bottom: 0; height: min(250px, 45cqh); transform-origin: 50% 100%; animation: gfsweeptail 12s infinite; will-change: transform;
  background: linear-gradient(rgba(159, 232, 112, 0), rgba(159, 232, 112, .07) 30%, rgba(159, 232, 112, .22) 70%, rgba(170, 238, 190, .36) 92%, rgba(200, 240, 255, .44)); }
.gfld { top: -16px; height: 32px;
  background: linear-gradient(rgba(200, 240, 255, 0), rgba(200, 240, 255, .28) 25%, rgba(230, 250, 255, .8) 50%, rgba(200, 240, 255, .28) 75%, rgba(200, 240, 255, 0)); }
.gfsg { top: -55px; height: 110px;
  background: linear-gradient(rgba(140, 216, 255, 0), rgba(140, 216, 255, .03) 30%, rgba(190, 240, 255, .07) 50%, rgba(140, 216, 255, .03) 70%, rgba(140, 216, 255, 0)); }
@keyframes gfsweep {
  0% { transform: translateY(12vh); transform: translateY(12cqh); animation-timing-function: cubic-bezier(.42, 0, .58, 1); }
  50% { transform: translateY(89vh); transform: translateY(89cqh); animation-timing-function: cubic-bezier(.42, 0, .58, 1); }
  100% { transform: translateY(12vh); transform: translateY(12cqh); }
}
@keyframes gfsweeptail {
  0% { transform: scaleY(.04); animation-timing-function: cubic-bezier(.25, .6, .5, 1); }
  25% { transform: scaleY(1); animation-timing-function: cubic-bezier(.5, 0, .75, .4); }
  50% { transform: scaleY(.04); }
  50.01% { transform: scaleY(-.04); animation-timing-function: cubic-bezier(.25, .6, .5, 1); }
  75% { transform: scaleY(-1); animation-timing-function: cubic-bezier(.5, 0, .75, .4); }
  100% { transform: scaleY(-.04); }
}
@media (prefers-reduced-motion: reduce) { .gfnode b, .gfsl i, .gftr, .gfsg { animation: none; opacity: 0; } }
:root.eco :is(.gfnode b, .gfsl i, .gftr, .gfsg) { animation: none; opacity: 0; }
/* ---- end region: grid ---- */

/* ---- region: energy saving (the chat effects sheet) ---- */
/* «Energy saving» heads the sheet; under it a word on the battery, amber
   like the sheet's note on reduced motion. */
.fxbatt { display: flex; align-items: flex-start; gap: 8px; margin: 10px 0 12px; padding: 8px 10px; border-radius: 10px;
  font-size: 12.5px; line-height: 1.4; color: #ffd24a; background: rgba(255, 200, 90, .08); border: 1px solid rgba(255, 200, 90, .25); }
.fxbatt .icon { flex: none; margin-top: 1px; }
/* With energy saving on, a note says why the choices are dimmed. They can
   still be tapped (a choice turns energy saving off); the buzz on a mention
   is not an effect on the screen and stays as bright as it is. */
.fxeconote { display: none; margin-top: 10px; padding: 8px 10px; border-radius: 10px; font-size: 12.5px; line-height: 1.4;
  color: var(--accent); background: var(--accent-dim); border: 1px solid var(--accent-line); }
.fxsheet.eco .fxeconote { display: block; }
.fxopts > * { transition: opacity .2s; }
.fxsheet.eco .fxopts .fxgbody > :not(.fxkeep) { opacity: .45; }
/* The folding groups of the sheet: a header with what is on, the controls under it. */
.fxgroup { margin: 8px 0; border-radius: 16px; border: 1px solid var(--line); background: var(--sheen), var(--surface); overflow: hidden; }
.fxghead { width: 100%; display: flex; align-items: center; gap: 12px; padding: 11px 12px; text-align: left; color: var(--text); }
.fxghead:active { background: rgba(159, 232, 112, .05); }
.fxgtitle { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fxgtitle b { font-weight: 600; font-size: 15px; }
.fxgsum { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fxgchev { flex: none; color: var(--text-3); transition: transform .2s var(--ease); display: grid; }
.fxgroup.open .fxgchev { transform: rotate(180deg); }
.fxgroup.open > .fxghead { border-bottom: 1px solid var(--line); }
.fxgbody { padding: 4px 12px 12px; }
.fxgbody > .setting { padding-left: 0; padding-right: 0; }
.fxsheet.eco .fxopts .fxgsum::before { content: "⏸ "; }
/* ---- end region: energy saving ---- */
