/* guildle's styles, part 9 of 10 (finishes.css). Card finishes (finish.js) and the finish reveal.
   The parts load in order (index.html) and later rules build on earlier ones. */

/* ================================================================ card finishes (finish.js)
   A few Rare, Epic and Legendary heroes are recruited with a finish: Holo, Foil, Reverse Holo and the rest
   (GameData::FINISHES). cardHTML gives such a card the classes "fin fin-<style>" ("txt" when the writing takes
   the foil, "emb" when the emblem does) and four layers: .fin-back (behind the emblem and writing), .fin-foil and
   .fin-fx (over everything) and .fin-glare (the light). Where a card can be held (.holo-host: the recruit reveal and
   the card view), finish.js moves the light and the tilt with the pointer by setting, on the host:
     --mx, --my  where the light is on the card (0-100%)     --ox, --oy  the same from the middle (-1 to 1)
     --rx, --ry  the tilt                                     --hyp  how far from the middle (0-1)
     --on        0 at rest, 1 while it's held                 --amt  how strong the finish is (1)
   Everywhere else a finish sits still, lit from the middle. */
:root { --mx: 50%; --my: 50%; --ox: 0; --oy: 0; --rx: 0deg; --ry: 0deg; --hyp: 0; --on: 0; --amt: 1; }
.card.fin { isolation: isolate; }
.holo-host { touch-action: none; }
.holo-host.mouse-tilt { touch-action: auto; }
/* In the collection the card tilts in place of the little lift it had on hover. */
.slot.holo-host:hover { transform: none; }
.holo-host .card { transform: perspective(900px) rotateX(var(--ry)) rotateY(var(--rx)) scale(calc(1 + var(--on) * .04)); will-change: transform;
  box-shadow: calc(var(--ox) * -14px) calc(12px + var(--oy) * -10px) 30px rgba(0, 0, 0, calc(.35 + var(--on) * .2)); }
/* The offset: on a card with a finish, the emblem and the writing float above the card, so they drift against it
   as it turns. Plain cards stay flat. */
.holo-host .card.fin .f-emblem { translate: calc(var(--ox) * 2.8cqw) calc(var(--oy) * 2.8cqw); }
.holo-host .card.fin .f-head { translate: calc(var(--ox) * 1.4cqw) calc(var(--oy) * 1.4cqw); }
.holo-host .card.fin .f-foot { translate: calc(var(--ox) * 1.2cqw) calc(var(--oy) * 1.2cqw); }
/* The same in the card view, while the pile is tilted (finish.js attachDeckTilt). */
.deck-tilt > .card.fin.top :is(.f-emblem, .f-head, .f-foot) { transition: translate .18s ease-out; }
.deck-tilt > .card.fin.top .f-emblem { translate: calc(var(--ox) * var(--on) * 2.8cqw) calc(var(--oy) * var(--on) * 2.8cqw); }
.deck-tilt > .card.fin.top .f-head { translate: calc(var(--ox) * var(--on) * 1.4cqw) calc(var(--oy) * var(--on) * 1.4cqw); }
.deck-tilt > .card.fin.top .f-foot { translate: calc(var(--ox) * var(--on) * 1.2cqw) calc(var(--oy) * var(--on) * 1.2cqw); }
/* The same in the party's hand and the dock, while a card is tilted under the pointer (hand.js). */
.hand-tilt .card.fin :is(.f-emblem, .f-head, .f-foot) { transition: translate .18s ease-out; }
.hand-tilt.tilting .card.fin .f-emblem { translate: calc(var(--ox) * 2.8cqw) calc(var(--oy) * 2.8cqw); }
.hand-tilt.tilting .card.fin .f-head { translate: calc(var(--ox) * 1.4cqw) calc(var(--oy) * 1.4cqw); }
.hand-tilt.tilting .card.fin .f-foot { translate: calc(var(--ox) * 1.2cqw) calc(var(--oy) * 1.2cqw); }
/* The writing's own colour, under its foil (styles that recolour the card set their own). */
.card.fin .fx-text { --tx: #fbf3df; --tsh: rgba(0, 0, 0, .6); }
.card.fin.legendary .fx-text { --tx: #3a2604; --tsh: rgba(255, 248, 225, .75); }

  .fin-back, .fin-foil, .fin-fx, .fin-glare { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; }
  .fin-back { z-index: 0; overflow: hidden; opacity: 0; }
  .fin-foil, .fin-fx, .fin-glare { z-index: 2; }
  .fin-fx { opacity: 0; }
  .fin-rot { position: absolute; left: 50%; top: var(--ey, 48%); width: 88%; aspect-ratio: 1; translate: -50% -50%; background: center / contain no-repeat; }
  @keyframes fin-spin { to { rotate: 360deg; } }

  /* Declared again on the writing, so its own --ta (how much foil shows) is used. */
  :root, .fx-text { --rainbow: hsl(2 100% 62% / var(--ta, 1)) 0%, hsl(45 100% 58% / var(--ta, 1)) 5%, hsl(110 90% 55% / var(--ta, 1)) 10%, hsl(180 95% 55% / var(--ta, 1)) 15%, hsl(230 100% 65% / var(--ta, 1)) 20%, hsl(290 95% 65% / var(--ta, 1)) 25%, hsl(2 100% 62% / var(--ta, 1)) 30%; }

  /* ---- Keeping the writing readable: it sits above the foil layers, and every card's writing gets a soft halo
     (--tsh: dark behind light writing, light behind dark) so it stands out whatever is behind it. Styles that
     change the card's colour also set the writing's colour (--tx) to one that reads on it. */
  .card.fin .f-head, .card.fin .f-foot, .card.fin .f-num, .card.fin .f-lvl { z-index: 3; }
  .card.fin .fx-text { filter: drop-shadow(0 0 .2cqw var(--tsh)) drop-shadow(0 0 .5cqw var(--tsh)) drop-shadow(0 .2cqw 1cqw var(--tsh)); }
  .card.fin.common .fx-text { opacity: 1; }
  :root, .fx-text { --rainbow-dk: hsl(2 85% 38% / var(--ta, 1)) 0%, hsl(35 90% 32% / var(--ta, 1)) 5%, hsl(120 70% 28% / var(--ta, 1)) 10%, hsl(185 80% 28% / var(--ta, 1)) 15%, hsl(230 70% 40% / var(--ta, 1)) 20%, hsl(290 60% 38% / var(--ta, 1)) 25%, hsl(2 85% 38% / var(--ta, 1)) 30%; }
  .card.fin-reverse.legendary .fx-text { --tg: repeating-linear-gradient(115deg, var(--rainbow-dk)); }

  /* ---- Rainbow (the default): bands of colour that slide across as the card turns, over fine foil lines. */
  .fin .fin-foil {
    background-image:
      repeating-linear-gradient(-45deg, rgba(0,0,0,.28) 0 2px, rgba(255,255,255,.22) 2px 4px, rgba(0,0,0,.28) 4px 7px),
      repeating-linear-gradient(115deg, var(--rainbow)),
      radial-gradient(farthest-corner circle at var(--mx) var(--my), #fff 0%, #777 45%, #222 100%);
    background-size: 100% 100%, 260% 260%, 100% 100%;
    background-repeat: repeat, no-repeat, no-repeat;
    background-position: calc(var(--mx) * .4) calc(var(--my) * .4), var(--mx) var(--my), 0 0;
    background-blend-mode: soft-light, multiply, normal;
    mix-blend-mode: color-dodge;
    filter: brightness(.8) contrast(1.3) saturate(1.5);
    opacity: calc((.34 + var(--on) * (.3 + var(--hyp) * .3)) * var(--amt));
  }
  .fin .fin-glare {
    background: radial-gradient(farthest-corner circle at var(--mx) var(--my), rgba(255,255,255,.75) 0%, rgba(255,255,255,.15) 30%, rgba(0,0,0,.35) 95%);
    mix-blend-mode: overlay; opacity: calc(var(--on) * .7 * var(--amt));
  }
  /* ---- Glitter: the rainbow, with specks that catch the light. */
  .fin-glitter .fin-fx { opacity: calc((.55 + var(--on) * .45) * var(--amt)); background: var(--glitter) calc(var(--ox) * -5px) calc(var(--oy) * -5px) / 100% 100%;
    mix-blend-mode: color-dodge; filter: hue-rotate(calc(var(--ox) * 90deg)); }

  /* ---- Shared: the writing and the emblem take a foil of their own (--tg, --eg), over their own colour (--tx). */
  /* The writing's foil: rainbow unless the finish sets its own (kept this weak so each finish's own --tg wins). */
  .fx-text { --tg: repeating-linear-gradient(115deg, var(--rainbow)); }
  .card.fin.txt .fx-text { --ta: min(1, calc((.26 + var(--on) * .5) * var(--amt)));
    color: transparent !important; -webkit-background-clip: text; background-clip: text; text-shadow: none !important;
    background-image: var(--tg), linear-gradient(var(--tx), var(--tx));
    background-size: 400% 400%, 100% 100%; background-repeat: no-repeat; background-position: var(--mx) var(--my), 0 0; }
  .card.fin .f-emblem { --eg: repeating-linear-gradient(115deg, var(--rainbow)); --eo: .2; --glow: transparent; }
  .card.fin.emb .f-emblem::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    -webkit-mask: var(--emb) center / contain no-repeat; mask: var(--emb) center / contain no-repeat;
    background-image: var(--eg); background-size: 400% 400%; background-repeat: no-repeat; background-position: var(--mx) var(--my);
    mix-blend-mode: multiply; opacity: calc((var(--eo) + var(--on) * .5) * var(--amt));
  }
  .card.fin .f-emblem svg { filter: drop-shadow(0 0 calc(.5cqw + var(--on) * 2.5cqw) var(--glow)) drop-shadow(0 1.2cqw 1.6cqw rgba(0, 0, 0, .3)); }

  /* ---- Reverse holo: foil only on the border (outside the inner rule), the emblem and the writing. */
  .fin-reverse .fin-foil { padding: 3.7cqw;
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
    opacity: calc((.55 + var(--on) * (.3 + var(--hyp) * .2)) * var(--amt)); }
  .fin-reverse .fin-glare { opacity: calc(var(--on) * .35 * var(--amt)); }
  .card.fin-reverse .f-emblem { --eo: .3; }

  /* ---- Foil: the whole card turns to brushed metal, with a bright streak that slides as it turns. */
  .fin-metal .fin-back { opacity: calc(.85 * var(--amt)); background: linear-gradient(160deg, #eef1f5, #9aa3ad 30%, #f5f7fa 50%, #8c96a1 70%, #e3e7ec); mix-blend-mode: luminosity; }
  .fin-metal .fin-foil {
    background-image: repeating-linear-gradient(90deg, rgba(255,255,255,.14) 0 1px, rgba(0,0,0,.12) 1px 2px),
      linear-gradient(105deg, transparent 32%, rgba(255,255,255,.95) 47%, rgba(255,255,255,.25) 53%, transparent 68%);
    background-size: 100% 100%, 300% 100%; background-repeat: repeat, no-repeat; background-position: 0 0, var(--mx) 0;
    background-blend-mode: normal; mix-blend-mode: overlay; filter: none; opacity: calc((.55 + var(--on) * .45) * var(--amt)); }
  .fin-metal .fx-text { --tx: #20252c !important; --tsh: rgba(255, 255, 255, .6) !important; --tg: linear-gradient(105deg, rgba(90,100,115,0) 34%, rgba(95,108,125,var(--ta)) 48%, rgba(90,100,115,0) 62%); }
  .card.fin-metal .f-emblem { --eg: linear-gradient(105deg, #7d8792 30%, #f4f6f8 46%, #4b535c 55%, #9aa3ad 70%); --eo: .8; --glow: rgba(0, 0, 0, .25); }
  .card.fin-metal::after { border-color: rgba(40, 45, 52, .45); }
  .card.fin-metal .f-lvl { color: #262b33; }
  /* The border: a band of polished chrome, brighter than the brushed face, with a highlight that runs round it as the card turns. */
  .fin-metal .fin-fx { opacity: var(--amt); padding: 3.7cqw;
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
    background-image:
      radial-gradient(farthest-corner circle at var(--mx) var(--my), rgba(255,255,255,calc(.35 + var(--on) * .55)) 0%, rgba(255,255,255,0) 38%),
      repeating-linear-gradient(90deg, rgba(255,255,255,.18) 0 1px, rgba(0,0,0,.14) 1px 2px),
      linear-gradient(125deg, #5f6770 0%, #eef2f6 14%, #8a929b 27%, #fbfcfd 40%, #6d757e 53%, #dfe4e9 66%, #7b838c 80%, #f4f6f8 92%, #5f6770 100%);
    background-size: 100% 100%, 100% 100%, 260% 260%; background-repeat: no-repeat, repeat, no-repeat;
    background-position: 0 0, 0 0, var(--mx) var(--my);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5); }
  .card.fin-metal::after { border: .45cqw solid #3d444c; box-shadow: 0 0 0 .25cqw rgba(255, 255, 255, .55); }

  /* ---- Shadow foil: the card falls into shadow, smoke curls across it, and a dark violet sheen follows the light. */
  .fin-shadow .fin-back { opacity: calc(.9 * var(--amt));
    background: radial-gradient(farthest-corner circle at var(--mx) var(--my), rgba(80, 40, 130, .55) 0%, rgba(10, 4, 20, .95) 70%); mix-blend-mode: multiply; }
  .fin-shadow .fin-fx { opacity: calc((.28 + var(--on) * .2) * var(--amt)); background: var(--smoke) 0 0 / 260px 260px; mix-blend-mode: screen; animation: fin-smoke 40s linear infinite; }
  @keyframes fin-smoke { to { background-position: 260px -260px; } }
  .fin-shadow .fin-foil { background-image: repeating-linear-gradient(115deg, hsl(270 70% 45%) 0%, hsl(200 70% 38%) 8%, hsl(320 60% 42%) 16%, hsl(270 70% 45%) 24%);
    background-size: 300% 300%; background-repeat: no-repeat; background-position: var(--mx) var(--my); background-blend-mode: normal;
    mix-blend-mode: color-dodge; filter: none; opacity: calc((.3 + var(--on) * (.25 + var(--hyp) * .2)) * var(--amt)); }
  .fin-shadow .fx-text { --tx: #f1e8ff !important; --tsh: rgba(0, 0, 0, .85) !important; --tg: repeating-linear-gradient(115deg, hsl(270 90% 78% / var(--ta)) 0%, hsl(190 90% 72% / var(--ta)) 8%, hsl(300 90% 78% / var(--ta)) 16%, hsl(270 90% 78% / var(--ta)) 24%); }
  .card.fin-shadow .f-emblem { --eg: radial-gradient(circle at var(--mx) var(--my), #b98cff, #3a1760 55%, #120622); --eo: .75; --glow: rgba(160, 80, 255, .85); }
  .card.fin-shadow .f-lvl svg, .card.fin-shadow::after { opacity: .5; }

  /* ---- Celestial: a night sky of nebulae and stars; near stars drift more than far ones as the card turns. */
  .fin-celestial .fin-back { opacity: calc(.85 * var(--amt));
    background: radial-gradient(ellipse at 28% 22%, rgba(130, 70, 210, .75), transparent 55%), radial-gradient(ellipse at 76% 72%, rgba(30, 130, 210, .65), transparent 55%),
      radial-gradient(ellipse at 60% 42%, rgba(230, 90, 170, .4), transparent 50%), linear-gradient(#0a0f2c, #1b1448); }
  .fin-celestial .fin-fx { opacity: var(--amt); mix-blend-mode: screen;
    background: var(--stars) calc(var(--ox) * -4px) calc(var(--oy) * -4px) / 100% 100%, var(--stars2) calc(var(--ox) * -11px) calc(var(--oy) * -11px) / 100% 100%;
    animation: fin-twinkle 3.2s ease-in-out infinite alternate; }
  @keyframes fin-twinkle { from { filter: brightness(.8); } to { filter: brightness(1.35); } }
  .fin-celestial .fin-foil { background: radial-gradient(circle at var(--mx) var(--my), rgba(190, 210, 255, .8), transparent 45%); mix-blend-mode: screen; filter: none; opacity: calc(var(--on) * .45 * var(--amt)); }
  .fin-celestial .fx-text { --tx: #f7f2e4 !important; --tsh: rgba(0, 0, 25, .85) !important; --tg: repeating-linear-gradient(115deg, hsl(45 100% 82% / var(--ta)) 0%, hsl(200 100% 84% / var(--ta)) 8%, hsl(280 100% 88% / var(--ta)) 16%, hsl(45 100% 82% / var(--ta)) 24%); }
  .card.fin-celestial .f-emblem { --eg: linear-gradient(115deg, #fff3c4, #bfe0ff 40%, #e6c8ff 70%, #fff3c4); --eo: .5; --glow: rgba(190, 220, 255, .9); }
  .card.fin-celestial::after { border-color: rgba(230, 220, 255, .45); }

  /* ---- Arcane: a magic circle turns slowly behind the emblem and runes run round the border; both glow when the light finds them. */
  .fin-arcane .fin-back { opacity: calc((.55 + var(--on) * .4) * var(--amt)); mix-blend-mode: screen; }
  .fin-arcane .fin-back .fin-rot { background-image: var(--circle); animation: fin-spin 70s linear infinite; filter: drop-shadow(0 0 2px #7fd4ff); }
  .fin-arcane .fin-fx { opacity: calc((.5 + var(--on) * .45) * var(--amt)); background: var(--runes) 0 0 / 100% 100%; mix-blend-mode: screen; filter: drop-shadow(0 0 1.5px #6fc8ff); }
  .fin-arcane .fin-foil { background: radial-gradient(circle at var(--mx) var(--my), rgba(120, 200, 255, .55), transparent 50%); mix-blend-mode: color-dodge; filter: none; opacity: calc(var(--on) * .5 * var(--amt)); }
  .fin-arcane .fx-text { --tx: #f0f9ff !important; --tsh: rgba(10, 20, 70, .85) !important; --tg: repeating-linear-gradient(115deg, hsl(195 100% 75% / var(--ta)) 0%, hsl(250 100% 80% / var(--ta)) 10%, hsl(195 100% 75% / var(--ta)) 20%); }
  .card.fin-arcane .f-emblem { --eg: linear-gradient(115deg, #cdeeff, #6fc8ff 40%, #b9a6ff 70%, #cdeeff); --eo: .45; --glow: rgba(100, 190, 255, .9); }

  /* ---- Dragonscale: the card is covered in scales, with a molten sheen of red, gold and bronze. */
  .fin-dragon .fin-fx { opacity: calc(.9 * var(--amt)); background: var(--scales) 0 0 / 9% 5.4%; mix-blend-mode: soft-light; }
  .fin-dragon .fin-back { opacity: calc(.45 * var(--amt)); background: linear-gradient(160deg, #6b1208, #2a0a05 60%, #7a2a0a); mix-blend-mode: multiply; }
  .fin-dragon .fin-foil { background-image: repeating-linear-gradient(115deg, hsl(5 90% 45%) 0%, hsl(35 100% 55%) 7%, hsl(55 100% 60%) 12%, hsl(150 60% 35%) 18%, hsl(25 90% 40%) 24%, hsl(5 90% 45%) 30%);
    background-size: 300% 300%; background-repeat: no-repeat; background-position: var(--mx) var(--my); background-blend-mode: normal;
    mix-blend-mode: color-dodge; filter: none; opacity: calc((.35 + var(--on) * (.3 + var(--hyp) * .2)) * var(--amt)); }
  .fin-dragon .fx-text { --tx: #fff2d6 !important; --tsh: rgba(45, 6, 0, .9) !important; --tg: repeating-linear-gradient(115deg, hsl(45 100% 62% / var(--ta)) 0%, hsl(20 100% 55% / var(--ta)) 8%, hsl(55 100% 78% / var(--ta)) 16%, hsl(45 100% 62% / var(--ta)) 24%); }
  .card.fin-dragon .f-emblem { --eg: linear-gradient(115deg, #ffd36b, #e2551c 40%, #ffe9a0 60%, #b3261a); --eo: .55; --glow: rgba(255, 120, 30, .8); }

  /* ---- Hellfire: embers rise from a fire burning along the bottom of the card. */
  .fin-hellfire .fin-back { opacity: calc((.55 + var(--on) * .35) * var(--amt)); mix-blend-mode: screen;
    background: linear-gradient(to top, rgba(255, 90, 0, .85), rgba(255, 40, 0, .35) 28%, transparent 58%); animation: fin-flicker 1.7s ease-in-out infinite alternate; }
  @keyframes fin-flicker { 0% { filter: brightness(.85); } 40% { filter: brightness(1.15); } 70% { filter: brightness(.95); } 100% { filter: brightness(1.25); } }
  .fin-hellfire .fin-fx { opacity: calc((.7 + var(--on) * .3) * var(--amt)); mix-blend-mode: screen;
    background: var(--embers) 0 0 / 180px 180px, var(--embers) 60px 0 / 110px 110px; animation: fin-rise 9s linear infinite; }
  @keyframes fin-rise { to { background-position: 0 -180px, 60px -330px; } }
  .fin-hellfire .fin-foil { background: radial-gradient(circle at var(--mx) var(--my), rgba(255, 170, 60, .7), transparent 50%); mix-blend-mode: color-dodge; filter: none; opacity: calc(var(--on) * .45 * var(--amt)); }
  .fin-hellfire .fx-text { --tx: #fff4de !important; --tsh: rgba(55, 6, 0, .9) !important; --tg: repeating-linear-gradient(100deg, hsl(50 100% 65% / var(--ta)) 0%, hsl(25 100% 55% / var(--ta)) 8%, hsl(5 100% 50% / var(--ta)) 14%, hsl(50 100% 65% / var(--ta)) 22%); }
  .card.fin-hellfire .f-emblem { --eg: linear-gradient(to top, #ff3d00, #ff9a1f 45%, #ffe27a); --eo: .6; --glow: rgba(255, 90, 0, .9); }

  /* ---- Rime: frost creeps in from the corners, the card turns icy, and it sparkles where the light hits. */
  .fin-frost .fin-back { opacity: calc(.55 * var(--amt)); background: linear-gradient(160deg, rgba(210, 240, 255, .8), rgba(120, 180, 230, .25) 50%, rgba(210, 240, 255, .6)); mix-blend-mode: screen; }
  .fin-frost .fin-fx { opacity: calc((.55 + var(--on) * .4) * var(--amt)); background: var(--frost) 0 0 / 100% 100%; mix-blend-mode: screen; filter: drop-shadow(0 0 1px #bfe9ff); }
  .fin-frost .fin-foil { background: var(--sparkle) calc(var(--ox) * -6px) calc(var(--oy) * -6px) / 100% 100%, radial-gradient(circle at var(--mx) var(--my), rgba(220, 245, 255, .7), transparent 45%);
    mix-blend-mode: screen; filter: none; opacity: calc((.3 + var(--on) * .65) * var(--amt)); }
  .fin-frost .fx-text { --tx: #0e2a44 !important; --tsh: rgba(255, 255, 255, .8) !important; --tg: repeating-linear-gradient(115deg, hsl(205 85% 28% / var(--ta)) 0%, hsl(190 90% 38% / var(--ta)) 10%, hsl(205 85% 28% / var(--ta)) 20%); }
  .card.fin-frost .f-emblem { --eg: linear-gradient(115deg, #ffffff, #bfe6ff 40%, #7cc0ef 65%, #ffffff); --eo: .55; --glow: rgba(160, 220, 255, .9); }

  /* ---- Radiant: holy light: rays turn slowly behind the emblem, inside a halo. */
  .fin-radiant .fin-back { opacity: calc((.6 + var(--on) * .35) * var(--amt)); mix-blend-mode: screen; }
  .fin-radiant .fin-back .fin-rot { width: 170%; animation: fin-spin 90s linear infinite;
    background-image: radial-gradient(circle, transparent 17%, rgba(255, 236, 170, .95) 18%, rgba(255, 236, 170, .2) 20.5%, transparent 22%),
      repeating-conic-gradient(rgba(255, 240, 190, .6) 0deg 5deg, transparent 5deg 15deg);
    -webkit-mask: radial-gradient(circle, #000 15%, transparent 55%); mask: radial-gradient(circle, #000 15%, transparent 55%); }
  .fin-radiant .fin-foil { background: radial-gradient(circle at var(--mx) var(--my), rgba(255, 240, 200, .8), transparent 45%); mix-blend-mode: color-dodge; filter: none; opacity: calc(var(--on) * .5 * var(--amt)); }
  .fin-radiant .fx-text { --tx: #fffaf0 !important; --tsh: rgba(70, 40, 0, .9) !important; --tg: linear-gradient(105deg, hsl(45 100% 55% / var(--ta)) 30%, hsl(50 100% 90% / var(--ta)) 46%, hsl(38 90% 45% / var(--ta)) 56%, hsl(45 100% 55% / var(--ta)) 70%); }
  .card.fin-radiant .f-emblem { --eg: linear-gradient(105deg, #f7c948 30%, #fffbe6 46%, #c98d12 56%, #f7c948 70%); --eo: .6; --glow: rgba(255, 225, 130, .95); }

  /* ---- Eldritch: something from beyond: a green and violet vortex turns behind the emblem and the edges darken. */
  .fin-eldritch .fin-back { opacity: calc((.45 + var(--on) * .45) * var(--amt)); mix-blend-mode: screen; }
  .fin-eldritch .fin-back .fin-rot { width: 150%; animation: fin-spin 22s linear infinite reverse; filter: blur(3px);
    background-image: repeating-conic-gradient(from 0deg, rgba(60, 255, 150, .55) 0deg 12deg, rgba(120, 30, 200, .5) 24deg 36deg, rgba(60, 255, 150, .55) 48deg);
    -webkit-mask: radial-gradient(circle, transparent 8%, #000 20%, transparent 58%); mask: radial-gradient(circle, transparent 8%, #000 20%, transparent 58%); }
  .fin-eldritch .fin-fx { opacity: calc(.8 * var(--amt)); background: radial-gradient(ellipse at 50% 48%, transparent 35%, rgba(8, 0, 18, .75) 100%); mix-blend-mode: multiply; }
  .fin-eldritch .fin-foil { background: radial-gradient(circle at var(--mx) var(--my), rgba(90, 255, 170, .6), transparent 45%); mix-blend-mode: color-dodge; filter: none; opacity: calc(var(--on) * .45 * var(--amt)); }
  .fin-eldritch .fx-text { --tx: #ecfff4 !important; --tsh: rgba(0, 12, 6, .9) !important; --tg: repeating-linear-gradient(115deg, hsl(140 100% 65% / var(--ta)) 0%, hsl(275 90% 70% / var(--ta)) 10%, hsl(140 100% 65% / var(--ta)) 20%); }
  .card.fin-eldritch .f-emblem { --eg: linear-gradient(115deg, #7dffb5, #3bd17f 35%, #9d5bff 70%, #7dffb5); --eo: .55; --glow: rgba(80, 255, 160, .85); }

  /* On a gold legendary card the lighter styles keep the card's own dark ink, with a light halo. */
  .card.legendary:is(.fin-arcane, .fin-dragon, .fin-hellfire, .fin-radiant, .fin-eldritch) .fx-text { --tx: #3a2604 !important; --tsh: rgba(255, 246, 215, .85) !important; --tg: repeating-linear-gradient(115deg, var(--rainbow-dk)); }




/* ---------------------------------------------------------------- the finish reveal (finish.js playFinish)
   After the usual build-up, a card with a finish floats face down, then its finish fades in over its back from the
   edges to the middle; halfway through, it turns over (diagonally) and the finish fades in over the face the same
   way; it lands, bursts, and its rarity's name changes. A plain copy of each side sits on top with a hole opening
   in it from the edges (--rad: how much of the plain copy is left). */
.stage.floating { animation: fin-float 3.4s ease-in-out infinite; }
@keyframes fin-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }
.cardback.fin { overflow: hidden; }
.cardback .fin-back, .cardback .fin-foil, .cardback .fin-fx, .cardback .fin-glare { border-radius: 8px; }
.fin-bcover { position: absolute; inset: 0; z-index: 5; pointer-events: none; background: inherit; border-radius: 8px; --rad: 200%;
  -webkit-mask: radial-gradient(ellipse 100% 100% at 50% 50%, #000 calc(var(--rad) - 22%), transparent var(--rad)); mask: radial-gradient(ellipse 100% 100% at 50% 50%, #000 calc(var(--rad) - 22%), transparent var(--rad)); }
.card.fin-cover { position: absolute !important; inset: 0; z-index: 5; pointer-events: none; --rad: 96%;
  -webkit-mask: radial-gradient(ellipse 100% 100% at 50% 50%, #000 calc(var(--rad) - 22%), transparent var(--rad)); mask: radial-gradient(ellipse 100% 100% at 50% 50%, #000 calc(var(--rad) - 22%), transparent var(--rad)); }

/* The rainbow styles need a stronger hand on the dark back to show at all. */
.cardback.fin:is(.fin-holo, .fin-glitter, .fin-reverse) .fin-foil { mix-blend-mode: screen; filter: saturate(1.5); opacity: calc((.4 + var(--on) * .5) * var(--amt)); }
.card.face .f-rarity.fin-new { animation: fin-label 1.1s cubic-bezier(.2, 1.5, .4, 1); }
@keyframes fin-label { 0% { scale: .6; } 40% { scale: 1.2; } 100% { scale: 1; } }
.card.face .f-rarity.fin-long { letter-spacing: .08em; font-size: max(7px, 2.9cqw); }
@media (prefers-reduced-motion: reduce) {
  .stage.floating { animation: none; }
  .fin-rot, .fin-fx, .fin-back { animation: none !important; }
}
/* Once the card is face up, its turned-away back mustn't catch the pointer (so the face can be tilted). */
.flipper.shown > .face.back { pointer-events: none; }
/* Holo and Reverse Holo: brighter still, at rest and in the light. */
.card.fin-holo .fin-foil { opacity: calc((.55 + var(--on) * (.3 + var(--hyp) * .15)) * var(--amt)); filter: brightness(.95) contrast(1.35) saturate(1.9); }
.card.fin-reverse .fin-foil { opacity: calc((.8 + var(--on) * .2) * var(--amt)); filter: brightness(1) contrast(1.35) saturate(2); }
.card.fin-reverse.txt .fx-text { --ta: min(1, calc((.5 + var(--on) * .45) * var(--amt))); }
.card.fin-reverse.emb .f-emblem { --eo: .55; }
.card.fin-reverse .fin-fx { padding: 3.7cqw; opacity: calc((.5 + var(--on) * .35) * var(--amt));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  background: repeating-linear-gradient(115deg, var(--rainbow)) var(--mx) var(--my) / 260% 260% no-repeat; mix-blend-mode: hard-light; }

/* Conditions (assets/img/conditions/): in the quest log after the word ("is frightened [icon]"), and as small squared
   icons on the replay's cards while they last (adventure.js setConds; the sim sends the changes with each log line, l.c). */
.dmg-ic.c-blinded, .cond-ic.c-blinded { --m: url(../img/conditions/blinded.svg); color: #d8d8d8; }
.dmg-ic.c-charmed, .cond-ic.c-charmed { --m: url(../img/conditions/charmed.svg); color: #f59ad8; }
.dmg-ic.c-deafened, .cond-ic.c-deafened { --m: url(../img/conditions/deafened.svg); color: #c9b79a; }
.dmg-ic.c-exhaustion, .cond-ic.c-exhaustion { --m: url(../img/conditions/exhaustion.svg); color: #e0b36a; }
.dmg-ic.c-frightened, .cond-ic.c-frightened { --m: url(../img/conditions/frightened.svg); color: #c7a4ff; }
.dmg-ic.c-grappled, .cond-ic.c-grappled { --m: url(../img/conditions/grappled.svg); color: #e0a070; }
.dmg-ic.c-incapacitated, .cond-ic.c-incapacitated { --m: url(../img/conditions/incapacitated.svg); color: #ffb870; }
.dmg-ic.c-invisible, .cond-ic.c-invisible { --m: url(../img/conditions/invisible.svg); color: #9fd8ff; }
.dmg-ic.c-paralyzed, .cond-ic.c-paralyzed { --m: url(../img/conditions/paralyzed.svg); color: #ffe066; }
.dmg-ic.c-petrified, .cond-ic.c-petrified { --m: url(../img/conditions/petrified.svg); color: #b9b3a6; }
.dmg-ic.c-poisoned, .cond-ic.c-poisoned { --m: url(../img/conditions/poisoned.svg); color: #7fd08a; }
.dmg-ic.c-prone, .cond-ic.c-prone { --m: url(../img/conditions/prone.svg); color: #e0a070; }
.dmg-ic.c-restrained, .cond-ic.c-restrained { --m: url(../img/conditions/restrained.svg); color: #e0a070; }
.dmg-ic.c-silenced, .cond-ic.c-silenced { --m: url(../img/conditions/silenced.svg); color: #c7a4ff; }
.dmg-ic.c-sleep, .cond-ic.c-sleep { --m: url(../img/conditions/sleep.svg); color: #9fb8ff; }
.dmg-ic.c-stunned, .cond-ic.c-stunned { --m: url(../img/conditions/stunned.svg); color: #ffe066; }
.dmg-ic.c-unconscious, .cond-ic.c-unconscious { --m: url(../img/conditions/unconscious.svg); color: #bbbbbb; }
.adv-conds { position: absolute; z-index: 4; left: -7px; top: 22px; display: flex; flex-direction: column; gap: 3px; pointer-events: auto; }
.adv-foes .adv-conds { top: auto; bottom: 16px; flex-direction: column-reverse; }
.cond-ic { position: relative; display: block; width: clamp(18px, calc(var(--card-w, 110px) * .2), 28px); aspect-ratio: 1; box-sizing: border-box;
  background: rgba(27, 18, 10, .92); border: 1px solid #6b4f2a; border-radius: 5px; box-shadow: 0 2px 6px rgba(0, 0, 0, .45); }
.cond-ic::before { content: ""; position: absolute; inset: 14%; background: currentColor; -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
.cond-ic b { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cond-ic.new { animation: cond-in .45s cubic-bezier(.2, .9, .3, 1.3) both; }
@keyframes cond-in { from { transform: scale(.2); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .cond-ic.new { animation: none; } }
.cond-ic.show b { width: auto; height: auto; clip: auto; overflow: visible; left: 50%; bottom: calc(100% + 4px); transform: translateX(-50%); z-index: 5;
  padding: 2px 6px; border-radius: 5px; border: 1px solid #6b4f2a; background: #1b120a; color: var(--gold-hi, #f2d38a); font: 700 .62rem/1.2 var(--sans); }

/* Rerolling the quest board (quests.js paintReroll): a button under the board, with what's left today. */
.quests-reroll { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 12px; margin: 18px 0 6px; text-align: center; }
.quests-reroll:empty { display: none; }
.reroll-btn { display: inline-flex; align-items: center; gap: 8px; }
.reroll-btn svg { width: 16px; height: 16px; }
.reroll-btn.armed { background: #7a5410; color: #fff3d6; border-color: #c9994a; }
.quests-reroll small { color: var(--text-dim); font-size: .82rem; }

/* A party's runs today, from Most gold today (leaderboard.js openPlayer). */
.lb-player-sheet { width: min(720px, 100%); }
.lbu-runs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.lbu-run { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "main out gold" "acts acts acts"; align-items: center; gap: 8px 14px;
  padding: 12px 14px; border: 1px solid var(--felt-line); border-left: 4px solid var(--tc, var(--brass-dim)); border-radius: 10px; background: rgba(var(--panel-rgb), .55); }
.lbu-main { grid-area: main; display: grid; gap: 3px; min-width: 0; }
.lbu-kind { font: 700 .68rem/1.2 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--text-dim); }
.lbu-title { font: 400 1.15rem/1.2 var(--serif); }
.lbu-party { font-size: .85rem; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lbu-out { grid-area: out; font: 700 .68rem/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; padding: 4px 7px; border-radius: 5px; border: 1px solid; }
.lbu-out.won { color: #6fcf8a; border-color: rgba(111, 207, 138, .5); background: rgba(63, 143, 85, .15); }
.lbu-out.lost { color: #ff8a7a; border-color: rgba(255, 138, 122, .45); background: rgba(176, 48, 42, .14); }
.lbu-run .lb-score { grid-area: gold; }
.lbu-acts { grid-area: acts; display: flex; align-items: center; gap: 14px; }
.lbu-watch { display: inline-flex; align-items: center; gap: 6px; }
.lbu-watch svg { width: 14px; height: 14px; }
@media (max-width: 560px) {
  .lbu-run { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "main gold" "out out" "acts acts"; }
  .lbu-out { justify-self: start; }
}

/* Today in guildle (feed.js): under the party's hand on the Party tab. */
.feed { width: min(720px, 100%); margin: 34px auto 10px; box-sizing: border-box; }
.feed h3 { margin: 0 0 10px; font: 400 1.35rem/1.2 var(--display, var(--serif)); text-align: center; }
.feed-list { list-style: none; margin: 0; padding: 6px 0; border: 1px solid var(--felt-line); border-radius: 10px; background: rgba(var(--panel-rgb), .5);
  max-height: 340px; overflow-y: auto; overscroll-behavior: contain; }
.feed-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto 26px; align-items: baseline; gap: 0 10px; padding: 7px 14px; font-size: .92rem; line-height: 1.35; }
.feed-row + .feed-row { border-top: 1px solid rgba(var(--panel-rgb), .9); box-shadow: 0 -1px 0 var(--felt-line); }
/* What happened on a quest, indented under it, with a line from the quest's icon down to it. */
.feed-row.in-quest { position: relative; padding-top: 3px; padding-left: 44px; font-size: .88rem; }
.feed-row + .feed-row.in-quest { border-top: 0; box-shadow: none; }
.feed-row.in-quest::before { content: ""; position: absolute; left: 25px; top: -6px; width: 12px; height: calc(50% + 6px); border-left: 1.5px solid var(--brass-dim); border-bottom: 1.5px solid var(--brass-dim); border-bottom-left-radius: 5px; opacity: .8; }
/* The guild's announcements: highlighted in gold, with their tag. */
.feed-row.k-announce { background: linear-gradient(90deg, rgba(217, 164, 65, .2), rgba(217, 164, 65, .06)); border-left: 3px solid #d9a441; padding-left: 11px; }
.feed-row.k-announce .feed-ic { color: #d9a441; }
.feed-row.k-announce .feed-text { color: var(--text); font-weight: 600; }
.feed-tag { display: inline-block; margin-right: 6px; padding: 1px 5px; border: 1px solid rgba(217, 164, 65, .7); border-radius: 5px; background: rgba(217, 164, 65, .15); font: 800 .58rem/1.3 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: #d9a441; vertical-align: 1px; }
/* More under the same quest: the line carries on down to the next one. */
.feed-row.in-quest:has(+ .feed-row.in-quest)::after { content: ""; position: absolute; left: 25px; top: 50%; bottom: 0; border-left: 1.5px solid var(--brass-dim); opacity: .8; }
.feed-ic { align-self: center; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 5px; background: rgba(0, 0, 0, .06); color: var(--text-dim); }
.feed-ic svg { width: 13px; height: 13px; }
.feed-row.k-recruit .feed-ic { color: var(--brass); }
.feed-row.k-quest .feed-ic { color: #3f8f55; }
.feed-row.k-fell .feed-ic, .feed-row.k-fallen .feed-ic { color: #b0302a; }
.feed-row.k-rise .feed-ic { color: var(--r-epic); }
.feed-row.k-raised .feed-ic { color: #c9994a; }
.feed-row.k-bought .feed-ic { color: var(--brass); }
.feed-row.k-finish .feed-ic { color: var(--r-legendary); }
.feed-row.k-raid .feed-ic { color: #d9a441; }
.feed-row.k-together .feed-ic { color: #d9a441; }
.feed-item { font-weight: 800; color: var(--c); }
.feed-fin { margin-left: 3px; font-size: .9em; }
.feed-text { min-width: 0; overflow-wrap: anywhere; }
.feed-hero { display: inline; padding: 0; margin: 0; border: 0; background: none; font: inherit; font-weight: 800; color: var(--c); cursor: pointer;
  text-decoration: underline dotted; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.feed-hero:hover, .feed-hero:focus-visible { text-decoration-style: solid; }
.feed-hero:disabled { cursor: progress; opacity: .7; }
.feed-time { color: var(--text-dim); font-size: .78rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.feed-empty { padding: 14px 16px; color: var(--text-dim); text-align: center; font-size: .9rem; }
@media (max-width: 560px) { .feed { margin-top: 26px; } .feed-row { padding: 7px 10px; gap: 8px; font-size: .88rem; } }
.n-odds.pending span { font-style: italic; animation: odds-wait 1.4s ease-in-out infinite alternate; }
@keyframes odds-wait { from { opacity: .45; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .n-odds.pending span { animation: none; } }

/* "Reading the quest board…" while odds are worked out (quests.js READING): on the board, a notice, and the open quest. */
.quests-note.reading, .qv-chance b.reading { font-style: italic; animation: odds-wait 1.4s ease-in-out infinite alternate; }
.qv-chance b.reading { font: italic 600 .9rem/1.2 var(--serif); color: var(--pv-dim, inherit); white-space: normal; max-width: 16em; }
@media (prefers-reduced-motion: reduce) { .quests-note.reading, .qv-chance b.reading { animation: none; } }

/* The sheet of parchment that grows from a notice into the quest view and back (quests.js grow). */
.qv-sheet { position: fixed; left: 0; top: 0; width: 100vw; height: 100vh; z-index: 10; pointer-events: none; transform-origin: 0 0; will-change: transform;
  background: linear-gradient(170deg, var(--card) 0%, var(--card-edge) 100%); backface-visibility: hidden; contain: strict; }
.qv-sheet { z-index: 9; }
.quest-view.growing #qv-party { visibility: hidden; } /* the party's cards join once the quest has grown (quests.js grow) */
.quest-view.growing { will-change: transform; background-attachment: scroll; }
/* While the quest grows (quests.js grow): the parchment is the sheet underneath; the notice's own text (a copy, .qv-ghost) fades on top. */
.quest-view.growing { background: none; }
.qv-ghost { position: fixed !important; margin: 0 !important; z-index: 9; pointer-events: none; background: none !important; border-color: transparent !important; box-shadow: none !important; transform: none !important; transition: none !important; }
.qv-ghost::before { display: none; }
.qv-sheet { box-sizing: border-box; }
.board.qv-ghost-wrap { display: block; position: static; }

/* Reactions on the news (feed.js): a face on the right to pick one, the ones used under the line, and the little cards. */
.feed-react { align-self: center; display: grid; place-items: center; width: 26px; height: 26px; margin: -4px 0; padding: 0; border: 0; border-radius: 5px; background: none; color: var(--text-dim); cursor: pointer; opacity: .55; transition: opacity .15s, background .15s; }
.feed-react svg { width: 17px; height: 17px; }
.feed-row:hover .feed-react, .feed-react:focus-visible { opacity: 1; }
.feed-react:hover { background: rgba(var(--panel-rgb), .9); color: var(--gold, #e0b04a); }
@media (hover: none) { .feed-react { opacity: .8; } }
.feed-reacts { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.feed-rx { display: inline-flex; align-items: center; gap: 5px; padding: 5px; border: 1px solid var(--felt-line); border-radius: 5px; background: rgba(var(--panel-rgb), .6); color: var(--text-dim); font: 700 .78rem/1 var(--sans); cursor: pointer; }
.feed-rx .rx-e { display: block; font-size: .95rem; line-height: 1; }
.feed-rx b { display: block; line-height: 1; }
.feed-rx:hover { border-color: var(--brass); }
.feed-rx.mine { border-color: var(--gold, #e0b04a); background: color-mix(in srgb, var(--gold, #e0b04a) 16%, transparent); color: var(--text); }
.feed-pop { position: absolute; z-index: 95; padding: 6px; border: 1px solid var(--brass-dim, #6b4f2a); border-radius: 10px; background: rgb(var(--panel-rgb)); box-shadow: 0 10px 28px rgba(0, 0, 0, .45); animation: fadein .15s ease-out both; }
.feed-pop.pick { display: grid; grid-template-columns: repeat(8, 34px); gap: 2px; }
.fp-e { width: 34px; height: 34px; padding: 0; border: 0; border-radius: 8px; background: none; font-size: 1.3rem; line-height: 1; cursor: pointer; transition: transform .1s, background .1s; }
.fp-e:hover, .fp-e:focus-visible { background: rgba(255, 255, 255, .08); transform: scale(1.18); outline: none; }
.fp-e.mine { background: color-mix(in srgb, var(--gold, #e0b04a) 22%, transparent); }
@media (max-width: 400px) { .feed-pop.pick { grid-template-columns: repeat(4, 40px); } .fp-e { width: 40px; height: 40px; } }
.feed-pop.who { min-width: 150px; max-width: 240px; padding: 8px 12px 10px; }
.fw-head { font: 700 .8rem var(--sans); color: var(--text-dim); margin-bottom: 4px; }
.fw-e { font-size: 1.1rem; vertical-align: -2px; }
.fw-list { list-style: none; margin: 0; padding: 0; max-height: 200px; overflow: auto; font: .9rem/1.45 var(--serif); color: var(--text); }
.fw-list li.you { font-weight: 700; }
.fw-undo { margin-top: 6px; padding: 4px 8px; border: 1px solid var(--felt-line); border-radius: 5px; background: none; color: var(--text-dim); font: 700 .74rem var(--sans); cursor: pointer; }
.fw-undo:hover { color: var(--text); border-color: var(--brass); }
.feed-row.own { background: linear-gradient(90deg, color-mix(in srgb, var(--gold) 9%, transparent), transparent 70%); box-shadow: inset 2px 0 0 color-mix(in srgb, var(--gold) 55%, transparent); }
.feed-row.own + .feed-row, .feed-row + .feed-row.own { box-shadow: inset 2px 0 0 color-mix(in srgb, var(--gold) 55%, transparent), 0 -1px 0 var(--felt-line); }
.feed-row.own + .feed-row:not(.own) { box-shadow: 0 -1px 0 var(--felt-line); }

/* Most gold today, by guild (leaderboard.js): a guild's row has its name, who leads it and how many parties and
   quests; tapping it lists its parties (each with its heroes at a glance), and a party opens with its heroes and its
   quest log today. */
.lb-list .lb-row { grid-template-columns: 3.2rem minmax(0, 1fr) auto; }
@media (max-width: 520px) { .lb-list .lb-row { grid-template-columns: 2.4rem minmax(0, 1fr) auto; } .lb-list .lb-row .lb-score { grid-row: auto; } }
.lbg-parties { gap: 8px; }
.lbg-party { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px 16px; padding: 12px 14px;
  border: 1px solid var(--felt-line); border-radius: 10px; background: rgba(var(--panel-rgb), .55); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.lbg-party:hover { border-color: var(--brass-dim); }
.lbg-party:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.lbg-main { display: grid; gap: 3px; min-width: 0; }
.lbg-main b { font: 400 1.2rem/1.15 var(--serif); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lbg-main small { font: 600 .76rem/1.2 var(--sans); letter-spacing: .04em; color: var(--text-dim); }
@media (max-width: 520px) { .lbg-party { grid-template-columns: minmax(0, 1fr) auto; } .lbg-party .lb-pips { grid-column: 1; grid-row: 2; } .lbg-party .lb-score { grid-column: 2; grid-row: 1 / span 2; } }
.lb-pty-sheet { width: min(980px, 100%); }
.lb-sheet #lbt-grid { grid-template-columns: repeat(auto-fill, minmax(min(310px, 100%), 1fr)); gap: 22px 14px; margin-bottom: 6px; }
.lb-sheet #lbt-grid .cd-row { justify-content: start; }
.lbt-h { margin: 18px 0 10px; font: 400 1.3rem/1.2 var(--display, var(--serif)); color: var(--text); }

/* a party's motto, under its name (the leaderboard, and a party's sheet) */
.lb-motto { font: italic 400 .95rem/1.25 var(--serif); color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lbt-motto { margin: -4px 0 6px; white-space: normal; font-size: 1.05rem; }

/* a party's heroes on its sheet (and who went on a run): lined up as on the Guild page, four in a row (two by two
   on a phone), each card over its equipment */
.lb-sheet :is(#lbt-grid, #lbp-grid) { display: block; --cwn: 190; margin: 18px 0 8px; }
.lb-sheet :is(#lbt-grid, #lbp-grid) .rpl-row { gap: 26px 20px; }
.lb-sheet .lbt-power { background: #3a2c12; color: #f3d48a; border-color: rgba(243, 212, 138, .45); }
@media (max-width: 900px) { .lb-sheet :is(#lbt-grid, #lbp-grid) { --cwn: 150; } }
@media (max-width: 760px) { .lb-sheet :is(#lbt-grid, #lbp-grid) { --cwn: 138; } .lb-sheet :is(#lbt-grid, #lbp-grid) .rpl-row { gap: 22px 12px; } }

/* ---- touch screens: cards in a list stay flat and still. Each card's tilt (a 3D transform) and each looping finish
   layer was a layer of its own for the graphics chip; with a whole collection on screen a phone ran out of room for
   them and dropped parts of the page while it scrolled. A card held up on its own (the zoomed card, a new recruit)
   still tilts and shines. */
@media (hover: none) {
  .holo-host.mouse-tilt .card { transform: none; will-change: auto; box-shadow: 0 12px 30px rgba(0, 0, 0, .35); }
  :is(.qv-mini, .hand-card, .rpl-col, .rx-row) :is(.card, .card *, .card::before, .card::after), #grid :is(*, *::before, *::after) { animation: none !important; }
  /* (the glare and the foil follow a pointer that isn't there: in a list they're left off) */
  :is(#grid, .qv-mini, .hand-card, .rpl-col, .rx-row) .card.fin :is(.fin-foil, .fin-glare) { display: none; }
  .deck > .card:not(.top) { will-change: auto; }
  .hand-sway { animation: none; }
  /* heroes off the screen aren't drawn until they're nearly on it (and so hold no layers meanwhile) */
}
/* A card open on a phone: once it has flown in, the page behind the dim isn't drawn (roster.js, stillBehind).
   Under the open card's moving layers every part of the page would need a layer of its own, and a phone's
   graphics memory runs out: parts of the card blink out and back. The dim hides the page almost entirely anyway. */
@media (hover: none) {
  html.zoom-still :is(#view-draw, #view-roster, #view-leaders, #ro-beta .qmap, #ro-beta .ro-parties) { visibility: hidden; }
}
/* the latest announcement, pinned above the day's news */
.feed-row.k-announce.pinned { border-left-width: 4px; background: linear-gradient(90deg, rgba(217, 164, 65, .28), rgba(217, 164, 65, .1)); }
