/* Koko on-screen chat: cosmetics (bubble frames, name effects, message entries, title tag, profile icon).
   Loaded by overlay/chat.html ONLY with ?cos=1, and served as is to the web preview (contract: plan_cosmeticos/G_contrato.md f.2).
   One rule ".msg.c-<id>" per catalogue item of the slots bubble (19), name_fx (15) and entry_fx (13): cosmeticos/tests/test_chat.py checks the 47, none missing, none extra.

   Markup this file expects (everything inside .msg, nothing outside is needed):
     <div class="msg cos c-<bubble> c-<name_fx> c-<entry_fx> [still]">
       <div class="av"> initial | <canvas class="cav" width=24 height=24> [<span class="rk">role emoji</span>] </div>
       <div class="bw"><div class="bub"><span class="tx">text</span></div><svg class="tail">...</svg></div>
       <div class="nm"><span> name | one <i> per letter when there is a name effect (class "e" on the first O; with no O, class "e i" on the initial) </span></div>
       with a title:  <div class="nmr"> .nm  <div class="tt [gold]"><span>Title</span></div> </div>
   Rules of the house: the bubble stays black, nothing sticks out of it (frames live inside the clip-path of .bub), the comic look stays (no pixel art here but the icon),
   entries last < 0.6 s and move only transform / opacity, every entry keyframe of .msg carries scaleX(var(--fx, 1)) (mirror mode), no blur, no animated box-shadow,
   no particles in the DOM (decorations are pseudo-elements). Loops stop on rows with class "still" (chat.html keeps two rows running at most).
   Layers used:  frames = .bub background, .bub::before (inner black), .bub::after  ·  names = .nm, .nm::after, .nm span::before/::after, .nm i  ·
                 entries = .msg, .msg::before/::after, .bw::before/::after, .tx::after */

/* ------------------------------------------------------------------ shared pieces */
.msg.cos .bub { background: var(--fbg, #fff); }
.msg.cos .bub::before { inset: var(--fw, 4px); }
.msg.cos .tail polygon { stroke: var(--fa, #fff); }
.msg.cos .bub::after, .msg.cos::before, .msg.cos::after, .msg.cos .bw::before, .msg.cos .bw::after { pointer-events: none; }

/* profile icon: 24x24 art shown at 72x72, hard pixels; the role emoji moves to the corner of the tile */
.msg.cos .av .cav { display: block; width: 72px; height: 72px; image-rendering: pixelated; image-rendering: crisp-edges; }
.msg.cos .av .rk { position: absolute; right: 7px; bottom: 5px; font-size: 19px; line-height: 1; text-shadow: 0 1px 0 rgba(0,0,0,.6); }

/* title tag at the right of the name (max 14 characters) */
.msg.cos .nmr { position: absolute; z-index: 3; left: 118px; top: -19px; display: flex; align-items: center; gap: 5px; white-space: nowrap; pointer-events: none; }
.msg.cos .nmr .nm { position: relative; left: auto; top: auto; flex: 0 1 auto; min-width: 0; }
.msg.cos .tt { position: relative; flex: 0 0 auto; padding: 1px 9px 2px; background: #d9d9e6; color: #f2f2f8; font-size: 14px; line-height: 17px; letter-spacing: .3px;
               clip-path: polygon(3% 0, 100% 10%, 97% 100%, 0 90%); transform: rotate(1.2deg); }
.msg.cos .tt::before { content: ""; position: absolute; inset: 2px; background: #26262e; clip-path: polygon(3% 0, 100% 10%, 97% 100%, 0 90%); }
.msg.cos .tt span { position: relative; display: block; }
.msg.cos .tt.gold { background: #ffd34a; color: #ffe89a; }
.msg.cos .tt.gold::before { background: #3a2a08; }
body.mirror .msg.cos .tt span { transform: scaleX(-1); }

/* letters of a name with an effect: --i = index of the letter (delays) */
.msg.cos .nm i { font-style: normal; display: inline-block; }
.msg.cos .nm i:nth-child(2) { --i: 1; } .msg.cos .nm i:nth-child(3) { --i: 2; } .msg.cos .nm i:nth-child(4) { --i: 3; } .msg.cos .nm i:nth-child(5) { --i: 4; }
.msg.cos .nm i:nth-child(6) { --i: 5; } .msg.cos .nm i:nth-child(7) { --i: 6; } .msg.cos .nm i:nth-child(8) { --i: 7; } .msg.cos .nm i:nth-child(9) { --i: 8; }
.msg.cos .nm i:nth-child(10) { --i: 9; } .msg.cos .nm i:nth-child(11) { --i: 10; } .msg.cos .nm i:nth-child(12) { --i: 11; } .msg.cos .nm i:nth-child(13) { --i: 12; }
.msg.cos .nm i:nth-child(14) { --i: 13; } .msg.cos .nm i:nth-child(15) { --i: 14; } .msg.cos .nm i:nth-child(16) { --i: 15; } .msg.cos .nm i:nth-child(17) { --i: 16; }
.msg.cos .nm i:nth-child(18) { --i: 17; } .msg.cos .nm i:nth-child(19) { --i: 18; } .msg.cos .nm i:nth-child(20) { --i: 19; } .msg.cos .nm i:nth-child(21) { --i: 20; }
.msg.cos .nm i:nth-child(22) { --i: 21; } .msg.cos .nm i:nth-child(23) { --i: 22; } .msg.cos .nm i:nth-child(24) { --i: 23; } .msg.cos .nm i:nth-child(n+25) { --i: 24; }

/* a "rune" drawn with two strokes, used by the name effects that turn letters into runes (no font needed) */
.msg.cos { --rune: linear-gradient(90deg, transparent 38%, var(--rc, #5af0d0) 38% 60%, transparent 60%) 50% 60% / 100% 62% no-repeat,
                    linear-gradient(40deg, transparent 43%, var(--rc, #5af0d0) 43% 57%, transparent 57%) 50% 34% / 100% 40% no-repeat; }

/* ================================================================== BUBBLE FRAMES (19)
   --fa / --fb = art.vars.a / b of the catalogue, --fw = width of the frame, --fbg = the pattern. The tail takes --fa. */

/* --- tizne */
.msg.c-bubble_bone { --fa: #e8e0cc; --fb: #b8ac90; --fw: 5px;                                  /* short strokes like little bones */
  --fbg: repeating-linear-gradient(135deg, var(--fa) 0 10px, var(--fb) 10px 12px, #4a4234 12px 14px); }
.msg.c-bubble_soot { --fa: #3a3a44; --fb: #1e1e24; --fw: 5px;                                  /* soot black with specks */
  --fbg: radial-gradient(circle, #7a7a88 0 1px, transparent 1.4px) 0 0 / 7px 7px, radial-gradient(circle, var(--fb) 0 1.7px, transparent 2.1px) 3px 4px / 9px 9px, var(--fa); }
.msg.c-bubble_parchment { --fa: #d8c090; --fb: #7a4a1e; --fw: 5px;                             /* beige with the four corners scorched */
  --fbg: radial-gradient(circle at 6% 0, #2a1608 0 13px, var(--fb) 13px 30px, transparent 30.5px), radial-gradient(circle at 100% 4%, #2a1608 0 13px, var(--fb) 13px 30px, transparent 30.5px),
         radial-gradient(circle at 97% 100%, #2a1608 0 13px, var(--fb) 13px 30px, transparent 30.5px), radial-gradient(circle at 0 94%, #2a1608 0 13px, var(--fb) 13px 30px, transparent 30.5px), var(--fa); }
.msg.c-bubble_form { --fa: #f2f2e8; --fb: #3a6ad8; --fw: 5px;                                  /* office sheet: blue ruled lines and the red margin */
  --fbg: linear-gradient(90deg, transparent 0 9%, #e8445c 9% calc(9% + 2px), transparent calc(9% + 2px)), repeating-linear-gradient(0deg, var(--fa) 0 6px, var(--fb) 6px 8px); }
.msg.c-bubble_brick { --fa: #b8452a; --fb: #7a2a1a; --fw: 6px;                                 /* red bricks */
  --fbg: repeating-linear-gradient(90deg, transparent 0 13px, var(--fb) 13px 15px), repeating-linear-gradient(0deg, var(--fa) 0 5px, var(--fb) 5px 6px); }

/* --- brasa */
.msg.c-bubble_magma { --fa: #2a1a1a; --fb: #ff7a1e; --fw: 6px;                                 /* black rock, orange cracks that beat in 2 steps */
  --fcr: linear-gradient(115deg, transparent 45%, var(--fk, var(--fb)) 45% 55%, transparent 55%) 0 0 / 22px 14px, linear-gradient(50deg, transparent 46%, var(--fk, var(--fb)) 46% 54%, transparent 54%) 7px 3px / 17px 11px;
  --fbg: var(--fcr), var(--fa); }
.msg.c-bubble_magma .bub::after { content: ""; position: absolute; inset: 0; z-index: -2; --fk: #ffe27a; background: var(--fcr); animation: c-f-pulse 1.4s steps(1) infinite; }
.msg.c-bubble_chains { --fa: #8a8f9c; --fb: #4a4e5a; --fw: 6px;                                /* grey links */
  --fbg: radial-gradient(circle, var(--fb) 0 1.3px, var(--fa) 1.3px 2.9px, var(--fb) 3.1px) 0 0 / 6px 6px; }
.msg.c-bubble_riveted { --fa: #7a7f8a; --fb: #b86a3a; --fw: 6px;                               /* iron sheet with rivets and rust */
  --fbg: radial-gradient(circle, #e6eaf2 0 1.2px, #2a2c34 1.2px 2.2px, transparent 2.4px) 0 0 / 12px 6px,
         radial-gradient(ellipse 46px 16px at 22% 0, var(--fb) 0 99%, transparent 100%), radial-gradient(ellipse 54px 18px at 80% 100%, var(--fb) 0 99%, transparent 100%),
         radial-gradient(ellipse 14px 30px at 0 62%, var(--fb) 0 99%, transparent 100%), radial-gradient(ellipse 12px 24px at 100% 30%, var(--fb) 0 99%, transparent 100%), var(--fa); }
.msg.c-bubble_grill { --fa: #3a3a3a; --fb: #ff5a1e; --fw: 6px;                                 /* grill bars, embers on the bottom side */
  --fbg: repeating-linear-gradient(90deg, #5a5a5a 0 1px, var(--fa) 1px 4px, transparent 4px 7px), linear-gradient(0deg, var(--fb) 0 6px, #ffd34a 6px 7px, #141414 7px); }
.msg.c-bubble_yarn { --fa: #8a4ad8; --fb: #c89aff; --fw: 6px;                                  /* wavy purple thread */
  --fbg: radial-gradient(circle at 50% 0, var(--fb) 0 2.6px, transparent 3px) 0 0 / 8px 6px, radial-gradient(circle at 50% 100%, var(--fb) 0 2.6px, transparent 3px) 4px 0 / 8px 6px, var(--fa); }

/* --- fatuo */
.msg.c-bubble_runes { --fa: #5a5a6a; --fb: #5af0d0; --fw: 6px;                                 /* stone with marks that light up one after another */
  --frn: linear-gradient(90deg, transparent 10px, var(--fk, #34343f) 10px 12px, transparent 12px) 0 0 / 24px 12px, linear-gradient(45deg, transparent 44%, var(--fk, #34343f) 44% 56%, transparent 56%) 0 0 / 24px 12px;
  --fbg: var(--frn), var(--fa); }
.msg.c-bubble_runes .bub::after { content: ""; position: absolute; top: 0; bottom: 0; width: 72px; z-index: -2; --fk: var(--fb); background: var(--frn), var(--fa);
  left: 72px; animation: c-f-chase 2s steps(8) infinite; }
.msg.c-bubble_cobweb { --fa: #d8d8e0; --fb: #6a6a78; --fw: 5px; --fbg: var(--fa);              /* grey frame, a cobweb in each corner (inside, behind the text) */
  --fwr: transparent 0 8px, var(--fb) 8px 9px, transparent 9px 16px, var(--fb) 16px 17px, transparent 17px 24px, var(--fb) 24px 25px, transparent 25.5px;
  --fws: var(--fb) 0 2deg, transparent 2deg 28deg, var(--fb) 28deg 30deg, transparent 30deg 58deg, var(--fb) 58deg 60deg, transparent 60deg 88deg, var(--fb) 88deg 90deg, transparent 90deg; }
.msg.c-bubble_cobweb .bub::after { content: ""; position: absolute; inset: 0; z-index: -1; background-repeat: no-repeat; background-size: 28px 26px;
  background-image: radial-gradient(circle at 0 0, var(--fwr)), conic-gradient(from 90deg at 0 0, var(--fws)), radial-gradient(circle at 100% 0, var(--fwr)), conic-gradient(from 180deg at 100% 0, var(--fws)),
                    radial-gradient(circle at 100% 100%, var(--fwr)), conic-gradient(from 270deg at 100% 100%, var(--fws)), radial-gradient(circle at 0 100%, var(--fwr)), conic-gradient(from 0deg at 0 100%, var(--fws));
  background-position: 6% 0, 6% 0, 100% 4%, 100% 4%, 97% 100%, 97% 100%, 0 94%, 0 94%; }
.msg.c-bubble_drip { --fa: #c81e2a; --fb: #7a0f14; --fw: 5px;                                  /* red frame that drips on the inside (3 steps) */
  --fbg: linear-gradient(var(--fb), var(--fb)) 0 100% / 100% 2px no-repeat, var(--fa); }
.msg.c-bubble_drip .bub::after { content: ""; position: absolute; left: 0; right: 0; top: 3px; height: 15px; z-index: -1; background-repeat: repeat-x;
  background-image: radial-gradient(ellipse 3px 100% at 50% 0, var(--fa) 0 99%, transparent 100%), radial-gradient(ellipse 2.5px 100% at 50% 0, var(--fa) 0 99%, transparent 100%), radial-gradient(ellipse 2px 100% at 50% 0, var(--fa) 0 99%, transparent 100%);
  background-size: 37px 14px, 53px 10px, 29px 7px; background-position: 6px 0, 21px 0, 30px 0; animation: c-f-drip 1.5s steps(1) infinite; }
.msg.c-bubble_plank { --fa: #8a5a2a; --fb: #5a3a1a; --fw: 6px;                                 /* old ship planks with nails */
  --fbg: radial-gradient(circle, #e0d8c8 0 1px, #2a1a0a 1px 1.9px, transparent 2.1px) 13px 0 / 32px 6px, repeating-linear-gradient(90deg, transparent 0 30px, #2a1a0a 30px 32px), repeating-linear-gradient(0deg, var(--fa) 0 2px, var(--fb) 2px 3px); }

/* --- maldito */
.msg.c-bubble_royal_scroll { --fa: #a81e2a; --fb: #ffc83a; --fw: 7px; --fbg: var(--fa); }      /* double frame, red outside and gold inside, a shine runs along the gold */
.msg.c-bubble_royal_scroll .bub::after { content: ""; position: absolute; inset: 3px; z-index: -2; clip-path: var(--bp, polygon(2% 2%, 99% 0, 100% 96%, 0 100%));
  background: linear-gradient(110deg, transparent 0 42%, #fff7d0 42% 58%, transparent 58%) 150% 0 / 300% 100% no-repeat, var(--fb); animation: c-f-sweep 2.6s steps(10) infinite; }
.msg.c-bubble_hellgate { --fa: #1e1e24; --fb: #ff7a1e; --fw: 7px;                              /* black bars with spikes, an orange glow that trembles behind */
  --fbg: repeating-linear-gradient(90deg, var(--fa) 0 5px, transparent 5px 8px), linear-gradient(#8a3408, #8a3408); }
.msg.c-bubble_hellgate .bub::before { background: conic-gradient(from -30deg at 50% 100%, #3c3c48 0 60deg, transparent 60deg) 0 0 / 10px 7px repeat-x,
                                                 conic-gradient(from 150deg at 50% 0, #3c3c48 0 60deg, transparent 60deg) 5px 100% / 10px 7px repeat-x, var(--bg, var(--ink, #0a0a0a)); }
.msg.c-bubble_hellgate .bub::after { content: ""; position: absolute; inset: 0; z-index: -2; background: repeating-linear-gradient(90deg, var(--fa) 0 5px, var(--fb) 5px 8px); animation: c-f-flick 1.1s steps(1) infinite; }
.msg.c-bubble_obsidian { --fa: #1e1428; --fb: #a44be0; --fw: 7px;                              /* faceted black, a purple edge that shines in steps */
  --fbg: linear-gradient(120deg, transparent 0 47%, #7a44a8 47% 53%, transparent 53%) 0 0 / 18px 14px, linear-gradient(60deg, #32224a 0 50%, transparent 50%) 0 0 / 18px 14px, var(--fa); }
.msg.c-bubble_obsidian .bub::after { content: ""; position: absolute; inset: 5px; z-index: -2; clip-path: var(--bp, polygon(2% 2%, 99% 0, 100% 96%, 0 100%));
  background: linear-gradient(110deg, transparent 0 40%, #f0d8ff 40% 60%, transparent 60%) 150% 0 / 300% 100% no-repeat, var(--fb); animation: c-f-sweep 2.2s steps(7) infinite; }

/* --- primigenio */
.msg.c-bubble_void { --fa: #0f0a18; --fb: #a44be0; --fw: 8px; --fbg: var(--fb);                /* black with little purple eyes that blink inside the frame */
  --fey: radial-gradient(ellipse 5px 2.6px at 50% 50%, #0f0a18 0 24%, #f0dcff 24% 44%, var(--fb) 44% 99%, transparent 100%); }
.msg.c-bubble_void .bub::after { content: ""; position: absolute; inset: 2px; z-index: -2; clip-path: var(--bp, polygon(2% 2%, 99% 0, 100% 96%, 0 100%));
  background-color: var(--fa); background-image: var(--fey), var(--fey), var(--fey), var(--fey); background-size: 44px 6px; background-repeat: repeat-x;
  background-position: 0 0, 22px 0, 11px 100%, 33px 100%; animation: c-f-blink 4.4s steps(1) infinite; }

/* --- reliquia (level 15) */
.msg.c-bubble_lvl_ember { --fa: #7a1e0f; --fb: #ff8a1e; --fw: 6px;                             /* embers that throb */
  --fbg: radial-gradient(circle, var(--fb) 0 1.7px, transparent 2.1px) 0 0 / 8px 6px, var(--fa); }
.msg.c-bubble_lvl_ember .bub::after { content: ""; position: absolute; inset: 0; z-index: -2; background: radial-gradient(circle, #ffe27a 0 1.9px, transparent 2.3px) 0 0 / 16px 6px; animation: c-f-pulse 1s steps(1) infinite; }

/* frame loops change only paint properties in steps (visibility, left, background-*): a few repaints per second and no extra compositor layer inside the clipped bubble */
@keyframes c-f-pulse { 0% { visibility: hidden; } 50% { visibility: visible; } }
@keyframes c-f-chase { from { left: -72px; } to { left: 504px; } }
@keyframes c-f-drip { 0% { background-size: 37px 7px, 53px 5px, 29px 4px; } 33% { background-size: 37px 11px, 53px 8px, 29px 5px; } 66% { background-size: 37px 14px, 53px 10px, 29px 7px; } }
@keyframes c-f-sweep { from { background-position: 150% 0, 0 0; } to { background-position: -50% 0, 0 0; } }
@keyframes c-f-flick { 0% { visibility: visible; } 18% { visibility: hidden; } 30% { visibility: visible; } 55% { visibility: hidden; } 62% { visibility: visible; } 85% { visibility: hidden; } 92% { visibility: visible; } }
@keyframes c-f-blink { 0% { background-position: 0 0, 22px 0, 11px 100%, 33px 100%; } 40% { background-position: 0 -9px, 22px 0, 11px 100%, 33px calc(100% + 9px); }
                       44% { background-position: 0 0, 22px 0, 11px 100%, 33px 100%; } 72% { background-position: 0 0, 22px -9px, 11px calc(100% + 9px), 33px 100%; } 76% { background-position: 0 0, 22px 0, 11px 100%, 33px 100%; } }

/* ================================================================== NAME EFFECTS (15)
   --na / --nb = art.vars.a / b. The name tag keeps its ink plate; some effects tint its border. */

/* --- tizne */
.msg.c-name_fx_bold_ink { --na: #ffffff; --nb: #0a0a0a; }                                      /* double ink outline */
.msg.c-name_fx_bold_ink .nm span { padding: 0 3px; margin: 0 -3px; letter-spacing: 3px; }
.msg.c-name_fx_bold_ink .nm i { color: var(--na); text-shadow: 1px 0 var(--nb), -1px 0 var(--nb), 0 1px var(--nb), 0 -1px var(--nb), 1px 1px var(--nb), -1px -1px var(--nb), 1px -1px var(--nb), -1px 1px var(--nb),
  2px 0 var(--na), -2px 0 var(--na), 0 2px var(--na), 0 -2px var(--na); }
.msg.c-name_fx_underline_bone { --na: #e8e0cc; --nb: #b8ac90; }                                /* a long bone under the name */
.msg.c-name_fx_underline_bone .nm { padding-bottom: 8px; }
.msg.c-name_fx_underline_bone .nm::after { content: ""; position: absolute; left: 11px; right: 11px; bottom: 4px; height: 6px;
  background: radial-gradient(circle at 3px 50%, var(--na) 0 2.8px, transparent 3px), radial-gradient(circle at calc(100% - 3px) 50%, var(--na) 0 2.8px, transparent 3px),
              linear-gradient(var(--na), var(--nb)) 50% 50% / calc(100% - 6px) 2px no-repeat; }
.msg.c-name_fx_tiny_horns { --na: #e8445c; --nb: #ffffff; }                                    /* two horns on the first letter */
.msg.c-name_fx_tiny_horns .nm i { color: var(--nb); }
.msg.c-name_fx_tiny_horns .nm i:first-child { position: relative; color: var(--na); }
.msg.c-name_fx_tiny_horns .nm i:first-child::before, .msg.c-name_fx_tiny_horns .nm i:first-child::after { content: ""; position: absolute; top: 0; width: 0; height: 0; border-style: solid; border-color: transparent transparent var(--na); border-width: 0 2.5px 6px; }
.msg.c-name_fx_tiny_horns .nm i:first-child::before { left: -2px; transform: rotate(-24deg); }
.msg.c-name_fx_tiny_horns .nm i:first-child::after { right: -2px; transform: rotate(24deg); }

/* --- brasa */
.msg.c-name_fx_ember_flicker { --na: #ff8a1e; --nb: #ffd34a; }                                 /* the letters swap between two warm tones */
.msg.c-name_fx_ember_flicker .nm i { color: var(--na); animation: c-n-ember .8s steps(1) infinite; animation-delay: calc(var(--i, 0) * -.27s); }
.msg.c-name_fx_shake { --na: #ffffff; --nb: #ffffff; }                                         /* the name trembles for a moment when it comes in */
.msg.c-name_fx_shake .nm i { color: var(--na); animation: c-n-shake .5s steps(1) .3s 1; }
.msg.c-name_fx_shake .nm i:nth-child(even) { animation-direction: reverse; }
.msg.c-name_fx_two_tone { --na: #ffffff; --nb: #9aa0b8; }                                      /* upper half light, lower half dark */
.msg.c-name_fx_two_tone .nm i { background: linear-gradient(var(--na) 0 56%, var(--nb) 56%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.msg.c-name_fx_spark_ends { --na: #ffd34a; --nb: #ffffff; }                                    /* a spark at each side of the name */
.msg.c-name_fx_spark_ends .nm span { color: var(--nb); }
.msg.c-name_fx_spark_ends .nm span::before, .msg.c-name_fx_spark_ends .nm span::after { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 6px 0 2px; vertical-align: 2px; background: var(--na); transform: rotate(45deg); animation: c-n-spark 1s steps(1) infinite; }
.msg.c-name_fx_spark_ends .nm span::after { margin: 0 2px 0 6px; animation-delay: -.5s; }

/* --- fatuo */
.msg.c-name_fx_flame_top { --na: #ff7a1e; --nb: #ffd34a; }                                     /* little flames on top of the letters (2 frames) */
.msg.c-name_fx_flame_top .nm i { color: var(--nb); }
.msg.c-name_fx_flame_top .nm span::before { content: ""; position: absolute; left: 0; right: -8px; top: 0; height: 5px; background: conic-gradient(from 153deg at 50% 0, var(--na) 0 54deg, transparent 54deg) 0 0 / 8px 5px repeat-x; transform-origin: 50% 100%; animation: c-n-flame .44s steps(1) infinite; }
.msg.c-name_fx_wave { --na: #ff8a1e; --nb: #ffd34a; }                                          /* the letters rise in a wave */
.msg.c-name_fx_wave .nm i { color: var(--na); animation: c-n-wave 1.2s steps(1) infinite; animation-delay: calc(var(--i, 0) * .12s - 2.4s); }
.msg.c-name_fx_glitch { --na: #5af0d0; --nb: #ffffff; --rc: #5af0d0; }                         /* now and then a letter turns into a rune for an instant */
.msg.c-name_fx_glitch .nm i { color: var(--nb); }
.msg.c-name_fx_glitch .nm i:nth-child(3n+2) { animation: c-n-glitch 4.6s steps(1) infinite; animation-delay: calc(var(--i, 0) * -.83s); }

/* --- maldito */
.msg.c-name_fx_molten_gold { --na: #ffc83a; --nb: #fff0a0; }                                   /* a golden shine that walks along the letters in steps */
.msg.c-name_fx_molten_gold .nm { background: var(--na); }
.msg.c-name_fx_molten_gold .nm i { color: var(--na); animation: c-n-gold 1.6s steps(1) infinite; animation-delay: calc(var(--i, 0) * .1s - 3.2s); }
.msg.c-name_fx_runic { --na: #5af0d0; --nb: #a44be0; --rc: #a44be0; }                          /* the name comes in written in runes and translates itself */
.msg.c-name_fx_runic .nm i { color: var(--na); animation: c-n-runic .12s steps(1) backwards; animation-delay: calc(.5s + var(--i, 0) * 70ms); }

/* --- primigenio */
.msg.c-name_fx_void { --na: #a44be0; --nb: #0f0a18; }                                          /* black letters, a purple edge that beats, an eye in the O (or the initial) */
.msg.c-name_fx_void .nm { background: var(--na); }
.msg.c-name_fx_void .nm::before { background: #24123a; }
.msg.c-name_fx_void .nm span { padding: 0 2px; margin: 0 -2px; letter-spacing: 1.5px; }
.msg.c-name_fx_void .nm i { color: var(--nb); --ne: #c890ff; text-shadow: 1px 0 var(--ne), -1px 0 var(--ne), 0 1px var(--ne), 0 -1px var(--ne), 1px 1px var(--ne), -1px -1px var(--ne), 1px -1px var(--ne), -1px 1px var(--ne); animation: c-n-void 1.4s steps(1) infinite; }
.msg.c-name_fx_void .nm i.e { position: relative; }
.msg.c-name_fx_void .nm i.e::after { content: ""; position: absolute; left: 50%; top: 52%; width: 8px; height: 6px; margin: -3px 0 0 -4px; border-radius: 50%; background: radial-gradient(circle, #0f0a18 0 1.3px, #ffffff 1.5px 2.3px, var(--na) 2.5px); animation: c-n-eye 3.2s steps(1) infinite; }
.msg.c-name_fx_void .nm i.e.i::after { left: 0; top: 3px; margin: 0 0 0 -3px; width: 7px; height: 5px; }

/* --- reliquia (set Sangre, level 40) */
.msg.c-name_fx_blood_drip { --na: #c81e2a; --nb: #ffffff; }                                    /* red drops fall from the letters */
.msg.c-name_fx_blood_drip .nm { padding-bottom: 6px; background: var(--na); }
.msg.c-name_fx_blood_drip .nm i { background: linear-gradient(var(--nb) 0 68%, #ff5a66 68%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.msg.c-name_fx_blood_drip .nm span { padding-bottom: 3px; margin-bottom: -3px; }
.msg.c-name_fx_blood_drip .nm span::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: radial-gradient(ellipse 1.7px 2.5px at 50% 50%, var(--na) 0 98%, transparent 100%) 4px 0 / 13px 5px repeat-x; animation: c-n-drop 1.2s steps(1) infinite; }
.msg.c-name_fx_lvl_brand { --na: #ff5a1e; --nb: #ffd34a; }                                     /* branded with fire, smoke on top */
.msg.c-name_fx_lvl_brand .nm { background: var(--na); }
.msg.c-name_fx_lvl_brand .nm::before { background: #2a0f08; }
.msg.c-name_fx_lvl_brand .nm i { background: linear-gradient(var(--nb) 0 40%, var(--na) 75%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.msg.c-name_fx_lvl_brand .nm span::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: radial-gradient(circle, #c8c8d4 0 1.7px, transparent 2.1px) 2px 0 / 11px 6px repeat-x; animation: c-n-smoke 1.5s steps(1) infinite; }

@keyframes c-n-ember { 0% { color: var(--na); } 50% { color: var(--nb); } }
@keyframes c-n-shake { 0% { transform: translate(1px, 0); } 25% { transform: translate(-1px, 1px); } 50% { transform: translate(1px, -1px); } 75% { transform: translate(-1px, 0); } 100% { transform: none; } }
@keyframes c-n-spark { 0% { transform: rotate(45deg) scale(1); } 50% { transform: rotate(45deg) scale(.45); } }
@keyframes c-n-flame { 0% { transform: none; } 50% { transform: translateX(-4px) scaleY(.6); } }
@keyframes c-n-wave { 0% { transform: translateY(-2px); color: var(--nb); } 22% { transform: none; color: var(--na); } }
@keyframes c-n-glitch { 0% { color: var(--nb); background: none; } 90% { color: transparent; background: var(--rune); } 96% { color: var(--nb); background: none; } }
@keyframes c-n-gold { 0% { color: var(--nb); } 14% { color: var(--na); } }
@keyframes c-n-runic { from { color: transparent; background: var(--rune); } to { color: var(--na); background: none; } }
@keyframes c-n-void { 0% { --ne: #c890ff; } 50% { --ne: #f0dcff; } }
@keyframes c-n-eye { 0% { transform: none; } 90% { transform: scaleY(.15); } 95% { transform: none; } }
@keyframes c-n-drop { 0% { transform: translateY(-4px); opacity: 1; } 33% { transform: translateY(-2px); opacity: 1; } 66% { transform: none; opacity: .7; } }
@keyframes c-n-smoke { 0% { transform: translateY(4px); opacity: .9; } 25% { transform: translateY(2px); opacity: .7; } 50% { transform: none; opacity: .45; } 75% { transform: translateY(-2px); opacity: .2; } }

/* rows that are no longer one of the two newest: every loop stops (the resting look of each effect is its base style) */
.msg.cos.still .bub::after, .msg.cos.still .nm::after, .msg.cos.still .nm span, .msg.cos.still .nm span::before, .msg.cos.still .nm span::after, .msg.cos.still .nm i, .msg.cos.still .nm i::after { animation: none !important; }

/* ================================================================== MESSAGE ENTRIES (13)
   Each one replaces the "pop" of chat.html. Decorations are pseudo-elements that end invisible. Where a decoration has to be seen before the row,
   the content (tile, bubble, tail, name, title) is shown late with c-e-in instead of fading the whole row. */

/* --- tizne */
.msg.c-entry_pop { animation: c-e-pop .32s cubic-bezier(.3, 1.5, .5, 1) both; }                                    /* a little hop */
.msg.c-entry_slide_ash { animation: c-e-slide .44s ease-out both; }                                                 /* slides in, three grey specks stay behind */
.msg.c-entry_slide_ash::after { content: ""; position: absolute; left: -16px; bottom: 12px; width: 6px; height: 6px; background: #9a9aa8; box-shadow: -17px -9px 0 #c4c4d0, -36px 4px 0 #6a6a78; opacity: 0; animation: c-e-ash .58s ease-out both; }
.msg.c-entry_stamp { animation: c-e-stamp .44s ease-in both; }                                                      /* falls like a rubber stamp and trembles */

/* --- brasa */
.msg.c-entry_fire_wipe { animation: c-e-none .5s both; }                                                            /* a column of fire uncovers the bubble */
.msg.c-entry_fire_wipe .av, .msg.c-entry_fire_wipe .bub, .msg.c-entry_fire_wipe .tail, .msg.c-entry_fire_wipe .nm, .msg.c-entry_fire_wipe .tt { animation: c-e-in .12s linear .16s both; }
.msg.c-entry_fire_wipe .bw::after { content: ""; position: absolute; left: 0; top: -9px; bottom: -9px; width: 100%; z-index: 4; opacity: 0;
  clip-path: polygon(0 8px, 6px 0, 12px 9px, 18px 1px, 24px 10px, 30px 2px, 36px 9px, 36px calc(100% - 8px), 30px 100%, 24px calc(100% - 9px), 18px 100%, 12px calc(100% - 8px), 6px 100%, 0 calc(100% - 9px));
  background: linear-gradient(90deg, #ff5a1e 0 8px, #ffd34a 8px 28px, #ff5a1e 28px 36px, transparent 36px); animation: c-e-firecol .56s linear both; }
.msg.c-entry_drop_bounce { animation: c-e-drop .56s both; }                                                         /* falls from above and bounces twice */
.msg.c-entry_smoke_puff { animation: c-e-none .5s both; }                                                           /* comes out of a little dithered grey cloud */
.msg.c-entry_smoke_puff .av, .msg.c-entry_smoke_puff .bub, .msg.c-entry_smoke_puff .tail, .msg.c-entry_smoke_puff .nm, .msg.c-entry_smoke_puff .tt { animation: c-e-in .14s linear .2s both; }
.msg.c-entry_smoke_puff .bw::after { content: ""; position: absolute; inset: -12px -8px; z-index: 4; border-radius: 46%; opacity: 0; background: repeating-conic-gradient(#a8a8b6 0 25%, transparent 0 50%) 0 0 / 8px 8px; animation: c-e-cloud .58s ease-out both; }
.msg.c-entry_typewriter { animation: c-e-quick .14s ease-out both; }                                                /* the text is typed out */
.msg.c-entry_typewriter .tx { display: inline-block; position: relative; clip-path: inset(0); }
.msg.c-entry_typewriter .tx::after { content: ""; position: absolute; inset: -2px; background: var(--bg, var(--ink, #0a0a0a)); transform: translateX(102%); animation: c-e-type .58s steps(14) both; }

/* --- fatuo */
.msg.c-entry_portal { animation: c-e-none .5s both; }                                                               /* a purple oval opens and the bubble comes out */
.msg.c-entry_portal .av, .msg.c-entry_portal .tail, .msg.c-entry_portal .nm, .msg.c-entry_portal .tt { animation: c-e-in .12s linear .3s both; }
.msg.c-entry_portal .bub { animation: c-e-grow .3s cubic-bezier(.2, 1.4, .4, 1) .2s both; }
.msg.c-entry_portal .bw::before { content: ""; position: absolute; inset: -10px 4%; z-index: 0; border-radius: 50%; opacity: 0; background: radial-gradient(ellipse at center, #1a0828 0 52%, #a44be0 52% 64%, #5a2a8a 64% 70%, transparent 71%); animation: c-e-portal .58s ease-in-out both; }
.msg.c-entry_bat_swarm { animation: c-e-none .5s both; }                                                            /* four bats fly across and leave the bubble */
.msg.c-entry_bat_swarm .av, .msg.c-entry_bat_swarm .bub, .msg.c-entry_bat_swarm .tail, .msg.c-entry_bat_swarm .nm, .msg.c-entry_bat_swarm .tt { animation: c-e-in .12s linear .26s both; }
.msg.c-entry_bat_swarm::before, .msg.c-entry_bat_swarm::after, .msg.c-entry_bat_swarm .bw::before, .msg.c-entry_bat_swarm .bw::after { content: ""; position: absolute; left: 0; top: 40%; width: 30px; height: 16px; z-index: 6; opacity: 0; background: #8a4ad8;
  clip-path: polygon(0 20%, 18% 0, 30% 30%, 42% 8%, 50% 34%, 58% 8%, 70% 30%, 82% 0, 100% 20%, 88% 58%, 72% 50%, 62% 88%, 50% 62%, 38% 88%, 28% 50%, 12% 58%); animation: c-e-bat .56s linear both; }
.msg.c-entry_bat_swarm::before { --x0: -50px; --y0: 26px; --x1: 380px; --y1: -34px; }
.msg.c-entry_bat_swarm::after { --x0: -20px; --y0: -30px; --x1: 420px; --y1: 22px; animation-delay: .04s; background: #5a2a8a; }
.msg.c-entry_bat_swarm .bw::before { --x0: -170px; --y0: 0px; --x1: 250px; --y1: -40px; animation-delay: .02s; background: #5a2a8a; }
.msg.c-entry_bat_swarm .bw::after { --x0: -130px; --y0: -36px; --x1: 300px; --y1: 30px; }
.msg.c-entry_chain_drag { animation: c-e-drag .56s linear both; }                                                   /* a chain pulls the bubble into place */
.msg.c-entry_chain_drag::before { content: ""; position: absolute; left: 100%; top: 50%; width: 240px; height: 10px; margin-top: -5px; opacity: 0; background: radial-gradient(circle, transparent 0 2px, #9a9fac 2px 4.3px, transparent 4.7px) 0 0 / 11px 10px repeat-x; animation: c-e-chain .58s linear both; }

/* --- maldito */
.msg.c-entry_meteor { animation: c-e-quake .3s ease-out .27s both; }                                                /* a burning rock falls, the bubble is what is left */
.msg.c-entry_meteor .av, .msg.c-entry_meteor .bub, .msg.c-entry_meteor .tail, .msg.c-entry_meteor .nm, .msg.c-entry_meteor .tt { animation: c-e-in .06s linear .27s both; }
.msg.c-entry_meteor::after { content: ""; position: absolute; left: 55%; top: 50%; width: 28px; height: 28px; margin: -14px; border-radius: 50%; z-index: 6; opacity: 0;
  background: radial-gradient(circle at 62% 62%, #5a2a1a 0 48%, #ff7a1e 48% 70%, #ffd34a 70%); box-shadow: -11px -12px 0 -5px #ff7a1e, -21px -23px 0 -9px #ffd34a; animation: c-e-rock .3s ease-in both; }
.msg.c-entry_meteor::before { content: ""; position: absolute; left: 55%; top: 50%; width: 150px; height: 70px; margin: -35px -75px; border-radius: 50%; z-index: 5; opacity: 0;
  background: radial-gradient(ellipse at center, #ffffff 0 20%, #ffd34a 20% 44%, #ff7a1e 44% 62%, transparent 63%); animation: c-e-impact .3s ease-out .27s both; }

/* --- primigenio */
.msg.c-entry_hell_gate { animation: c-e-gate .5s ease-out both; }                                                   /* the two leaves of a gate open and the bubble comes out between flames */
.msg.c-entry_hell_gate .bw::before, .msg.c-entry_hell_gate .bw::after { content: ""; position: absolute; top: -7px; bottom: -7px; width: calc(50% + 5px); z-index: 4; opacity: 0;
  background: linear-gradient(#1e1e24, #1e1e24) 0 0 / 100% 6px no-repeat, linear-gradient(#1e1e24, #1e1e24) 0 100% / 100% 6px no-repeat, repeating-linear-gradient(90deg, #3c3c48 0 2px, #1e1e24 2px 7px, transparent 7px 13px); animation: c-e-leaf .56s ease-in both; }
.msg.c-entry_hell_gate .bw::before { left: -5px; transform-origin: 0 50%; }
.msg.c-entry_hell_gate .bw::after { right: -5px; transform-origin: 100% 50%; }
.msg.c-entry_hell_gate::after { content: ""; position: absolute; left: 140px; right: 0; bottom: -5px; height: 24px; z-index: 5; opacity: 0; transform-origin: 50% 100%;
  background: conic-gradient(from 160deg at 50% 0, #ffd34a 0 40deg, transparent 40deg) 0 100% / 14px 15px repeat-x, conic-gradient(from 156deg at 50% 0, #ff7a1e 0 48deg, transparent 48deg) 7px 100% / 22px 24px repeat-x; animation: c-e-flames .58s ease-out both; }

/* --- reliquia (level 45) */
.msg.c-entry_lvl_fanfare { animation: c-e-fan .4s cubic-bezier(.3, 1.4, .5, 1) both; }                              /* two horned trumpets at the sides */
.msg.c-entry_lvl_fanfare .bw::before, .msg.c-entry_lvl_fanfare .bw::after { content: ""; position: absolute; top: 50%; width: 40px; height: 24px; margin-top: -12px; z-index: 4; opacity: 0;
  clip-path: polygon(0 40%, 50% 40%, 74% 16%, 78% 0, 86% 12%, 100% 0, 100% 100%, 86% 88%, 78% 100%, 74% 84%, 50% 60%, 0 60%); background: linear-gradient(#fff0a0 0 34%, #ffd34a 34% 68%, #c8922a 68%); animation: c-e-toot .58s ease-out both; }
.msg.c-entry_lvl_fanfare .bw::before { right: 100%; margin-right: 2px; --tf: -1; }
.msg.c-entry_lvl_fanfare .bw::after { left: 100%; margin-left: 2px; --tf: 1; }

@keyframes c-e-none { from { transform: scaleX(var(--fx, 1)); } to { transform: scaleX(var(--fx, 1)); } }
@keyframes c-e-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes c-e-quick { from { opacity: 0; transform: scaleX(var(--fx, 1)) translateY(4px); } to { opacity: 1; transform: scaleX(var(--fx, 1)); } }
@keyframes c-e-pop { 0% { opacity: 0; transform: scaleX(var(--fx, 1)) translateY(9px) scale(.94); } 55% { opacity: 1; transform: scaleX(var(--fx, 1)) translateY(-4px); } 100% { opacity: 1; transform: scaleX(var(--fx, 1)); } }
@keyframes c-e-slide { 0% { opacity: 0; transform: scaleX(var(--fx, 1)) translateX(-120px); } 70% { opacity: 1; transform: scaleX(var(--fx, 1)) translateX(6px); } 100% { opacity: 1; transform: scaleX(var(--fx, 1)); } }
@keyframes c-e-ash { 0% { opacity: 0; transform: none; } 35% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translate(-16px, -5px); } }
@keyframes c-e-stamp { 0% { opacity: 0; transform: scaleX(var(--fx, 1)) scale(1.6) rotate(-5deg); } 45% { opacity: 1; transform: scaleX(var(--fx, 1)) scale(.96); } 60% { transform: scaleX(var(--fx, 1)) translate(3px, -2px); }
                       75% { transform: scaleX(var(--fx, 1)) translate(-3px, 1px); } 90% { transform: scaleX(var(--fx, 1)) translate(1px, 0); } 100% { opacity: 1; transform: scaleX(var(--fx, 1)); } }
@keyframes c-e-firecol { 0% { opacity: 1; transform: translateX(-36px); } 80% { opacity: 1; transform: translateX(100%); } 100% { opacity: 0; transform: translateX(100%); } }
@keyframes c-e-drop { 0% { opacity: 0; transform: scaleX(var(--fx, 1)) translateY(-80px); animation-timing-function: ease-in; } 34% { opacity: 1; transform: scaleX(var(--fx, 1)); animation-timing-function: ease-out; }
                      54% { transform: scaleX(var(--fx, 1)) translateY(-18px); animation-timing-function: ease-in; } 72% { transform: scaleX(var(--fx, 1)); animation-timing-function: ease-out; }
                      86% { transform: scaleX(var(--fx, 1)) translateY(-6px); animation-timing-function: ease-in; } 100% { opacity: 1; transform: scaleX(var(--fx, 1)); } }
@keyframes c-e-cloud { 0% { opacity: 1; transform: scale(.45); } 45% { opacity: 1; transform: scale(1.05); } 100% { opacity: 0; transform: scale(1.3); } }
@keyframes c-e-type { from { transform: translateX(0); } to { transform: translateX(102%); } }
@keyframes c-e-grow { from { opacity: 0; transform: rotate(var(--rb, 0deg)) scale(.25); } to { opacity: 1; transform: rotate(var(--rb, 0deg)); } }
@keyframes c-e-portal { 0% { opacity: 1; transform: scale(0, .2); } 35% { opacity: 1; transform: scale(1.08, 1.25); } 70% { opacity: 1; transform: scale(1.08, 1.25); } 100% { opacity: 0; transform: scale(.3, 1.5); } }
@keyframes c-e-bat { 0% { opacity: 1; transform: translate(var(--x0), var(--y0)); } 20% { transform: translate(calc(var(--x0) * .8 + var(--x1) * .2), calc(var(--y0) * .8 + var(--y1) * .2 - 8px)) scaleY(.4); }
                     40% { transform: translate(calc(var(--x0) * .6 + var(--x1) * .4), calc(var(--y0) * .6 + var(--y1) * .4)); } 60% { transform: translate(calc(var(--x0) * .4 + var(--x1) * .6), calc(var(--y0) * .4 + var(--y1) * .6 - 8px)) scaleY(.4); }
                     80% { opacity: 1; transform: translate(calc(var(--x0) * .2 + var(--x1) * .8), calc(var(--y0) * .2 + var(--y1) * .8)); } 100% { opacity: 0; transform: translate(var(--x1), var(--y1)) scaleY(.4); } }
@keyframes c-e-drag { 0% { opacity: 0; transform: scaleX(var(--fx, 1)) translateX(-170px); } 14% { opacity: 1; } 68% { transform: scaleX(var(--fx, 1)) translateX(10px); } 84% { transform: scaleX(var(--fx, 1)) translateX(-4px); } 100% { opacity: 1; transform: scaleX(var(--fx, 1)); } }
@keyframes c-e-chain { 0% { opacity: 1; } 70% { opacity: 1; } 100% { opacity: 0; } }
@keyframes c-e-quake { 0% { transform: scaleX(var(--fx, 1)) translate(0, 7px); } 30% { transform: scaleX(var(--fx, 1)) translate(-4px, -3px); } 60% { transform: scaleX(var(--fx, 1)) translate(3px, 1px); } 100% { transform: scaleX(var(--fx, 1)); } }
@keyframes c-e-rock { 0% { opacity: 1; transform: translate(-150px, -170px) scale(.6); } 90% { opacity: 1; transform: none; } 100% { opacity: 0; transform: none; } }
@keyframes c-e-impact { 0% { opacity: 1; transform: scale(.2); } 100% { opacity: 0; transform: scale(1.5); } }
@keyframes c-e-gate { 0% { opacity: 0; transform: scaleX(var(--fx, 1)) scale(.92); } 12% { opacity: 1; transform: scaleX(var(--fx, 1)) scale(.92); } 30% { transform: scaleX(var(--fx, 1)) scale(.92); } 100% { opacity: 1; transform: scaleX(var(--fx, 1)); } }
@keyframes c-e-leaf { 0% { opacity: 1; transform: none; } 25% { opacity: 1; transform: none; } 82% { opacity: 1; transform: scaleX(.07); } 100% { opacity: 0; transform: scaleX(.07); } }
@keyframes c-e-flames { 0% { opacity: 0; transform: scaleY(.2); } 30% { opacity: 1; transform: scaleY(1); } 62% { opacity: 1; transform: scaleY(.7); } 100% { opacity: 0; transform: scaleY(.3); } }
@keyframes c-e-fan { 0% { opacity: 0; transform: scaleX(var(--fx, 1)) scale(.8); } 60% { opacity: 1; transform: scaleX(var(--fx, 1)) scale(1.05); } 100% { opacity: 1; transform: scaleX(var(--fx, 1)); } }
@keyframes c-e-toot { 0% { opacity: 0; transform: scaleX(var(--tf, 1)) scale(.2); } 24% { opacity: 1; transform: scaleX(var(--tf, 1)) scale(1.25); } 40% { transform: scaleX(var(--tf, 1)) rotate(-8deg); } 56% { transform: scaleX(var(--tf, 1)) rotate(8deg); }
                      72% { opacity: 1; transform: scaleX(var(--tf, 1)) rotate(-5deg); } 100% { opacity: 0; transform: scaleX(var(--tf, 1)); } }

/* a row that leaves (?life=N) keeps its fade whatever entry it had */
@keyframes c-away { to { opacity: 0; transform: scaleX(var(--fx, 1)) translateX(50px); } }
.msg.cos.out { animation: c-away .35s ease-in forwards; }
