/* Layers of the drawn effects (src/render/vfx.js, vfx-cast.js). All of them are born, play once and are removed.
   Nothing here is positioned with transform on a posed piece (.card, .hero): they are children of .c-in or .hero. */
/* the flash is a white copy of the struck art itself (the critter, or the face of the hero): no shape over the card */
.c-art.vfx-flash {
  filter: brightness(0) invert(1) !important;
  animation: none !important;
  opacity: 0;
  pointer-events: none;
}
.face.vfx-hflash {
  filter: brightness(0) invert(1) !important;
  animation: none !important;
  opacity: 0;
  pointer-events: none;
}
.vfx-ghost {
  pointer-events: none;
}
/* a card that has just become playable: one twinkle of the star sprite on its top corner */
.vfx-twinkle {
  position: absolute;
  right: -4%;
  top: -3%;
  width: 30%;
  pointer-events: none;
  scale: 0;
}
/* low life: the heart of the medallion beats slowly (one element at a time, and never with "Less motion") */
/* one beat every 2 s, only the heart (no double beat, nothing blinks) */
.hero.lowhp .life img {
  animation: vfx-beat 2s ease-in-out infinite;
}
@keyframes vfx-beat {
  0%,
  30%,
  100% {
    scale: 1;
  }
  12% {
    scale: 1.1;
  }
}
body.calm .hero.lowhp .life img {
  animation: none;
}
/* ---- the fight ---- */
/* a shard of a broken shield lies beside the slot (placed by a transform, like every piece: it is only faded, never scaled) */
.rest-shard {
  width: calc(var(--cw) * 0.38);
  margin: calc(var(--cw) * -0.19) 0 0 calc(var(--cw) * -0.19);
  pointer-events: none;
  filter: drop-shadow(0 calc(var(--cw) * 0.015) calc(var(--cw) * 0.02) rgba(0, 20, 40, 0.55));
}
/* the heart of a hero fills from the bottom with fresh green: a copy of the heart art, turned green (static filter) */
.heart-fill {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  filter: hue-rotate(115deg) saturate(1.3) brightness(1.15);
}
/* a wounded critter shrinks toward its feet; at 1 life it also leans (the lean sign is set per card) */
.card.on-board .c-art {
  transition:
    scale 0.3s var(--pop),
    translate 0.3s var(--pop);
}
.card.worry .c-art {
  scale: 0.9;
  translate: 0 4%;
}
.card.on-board .c-in {
  transition: rotate 0.3s var(--pop);
}
.card.crook .c-in {
  rotate: calc(var(--lean, 1) * 3deg);
}
/* ---- group 2: the hand ---- */
/* the shadow of a raised card grows and moves away from it; over a valid lane it comes back close (the card settles) */
.c-in::before {
  transition:
    transform 0.14s,
    filter 0.14s,
    background-color 0.14s;
}
.card.held .c-in::before {
  transform: translate(calc(var(--cw) * 0.05), calc(var(--cw) * 0.16)) scale(1.06);
  filter: blur(calc(var(--cw) * 0.085));
  background: rgba(0, 0, 0, 0.42);
}
.card.held.near .c-in::before {
  transform: translateY(calc(var(--cw) * 0.07));
  filter: blur(calc(var(--cw) * 0.055));
  background: rgba(0, 0, 0, 0.3);
}
/* only the dearest playable card glows gold: a still glow (no loop: a breathing glow cost frames in Safari); the last card of the hand glows a bit more */
.in-hand.can.rich .c-in::after {
  box-shadow:
    0 0 calc(var(--cw) * 0.04) calc(var(--cw) * 0.03) #fff3b0,
    0 0 calc(var(--cw) * 0.14) calc(var(--cw) * 0.07) rgba(255, 184, 36, 0.95);
}
.in-hand.can.last .c-in::after {
  box-shadow:
    0 0 calc(var(--cw) * 0.04) calc(var(--cw) * 0.03) #fffbe0,
    0 0 calc(var(--cw) * 0.13) calc(var(--cw) * 0.07) rgba(255, 226, 122, 0.95);
}
/* ---- group 3: the table ---- */
/* thinking bubble over the opponent: the bubble art with its three dots (placed by left/top, so it may use scale); its tail points down-left at the medallion */
.think {
  position: absolute;
  width: calc(var(--u) * 15);
  height: auto;
  margin: calc(var(--u) * -9) 0 0 0;
  z-index: 40;
  pointer-events: none;
  transform-origin: 0 100%;
  filter: drop-shadow(0 calc(var(--u) * 0.5) calc(var(--u) * 0.4) rgba(3, 30, 26, 0.35));
}
/* the critters of the side that is not playing rest: a little lower, a little darker, and they stop breathing (fewer moving pieces too) */
.card.snooze .c-art {
  translate: 0 7%;
  filter: drop-shadow(0 calc(var(--cw) * 0.02) calc(var(--cw) * 0.02) rgba(0, 0, 0, 0.35)) brightness(0.88);
  animation-play-state: paused;
}
.card.worry.snooze .c-art {
  translate: 0 8%;
}
/* ---- group 4: heroes and tricks ---- */
/* boss entry: its pose rises behind a banner with its name (centred with the translate property; only scale/opacity animate) */
.boss-intro {
  position: absolute;
  z-index: 44;
  pointer-events: none;
  translate: -50% -50%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.boss-pose {
  height: var(--ph);
  width: auto;
  margin-bottom: calc(var(--u) * 0.3); /* the feet stand on the name tag, never under it */
  filter: drop-shadow(0 calc(var(--u) * 0.8) calc(var(--u) * 0.8) rgba(0, 20, 16, 0.5));
}
/* a short line of the boss: the panel art (like the tip of the duel), white text, next to the medallion */
.say {
  position: absolute;
  z-index: 41;
  pointer-events: none;
  transform-origin: 0 50%;
  translate: 0 -50%;
}
.say .panel {
  --k: calc(var(--u) * 0.034);
  width: max-content;
  max-width: 100%;
}
.say p {
  margin: calc(var(--ft) - var(--bt)) calc(var(--fr) - var(--br)) calc(var(--fb) - var(--bb))
    calc(var(--fl) - var(--bl));
  padding: calc(var(--u) * 0.6) calc(var(--u) * 0.6);
  font-size: calc(var(--u) * 3.7);
  text-align: center;
  --o: 0.13em;
  line-height: 1.18;
  white-space: normal;
}
/* a card opponent (one picture) with low life leans, worried */
.hero.worried .face.cardface {
  rotate: -3deg;
  translate: 0 2%;
}
/* ---- juice of the duel (src/render/juice-duel*.js). Every piece is art; they are born on an
   event, play once and go. A .d4 is a zero-size box on a point: its children are centred on that point. ---- */
.d4 {
  position: absolute;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 46;
}
.d4 > * {
  position: absolute;
  left: 0;
  top: 0;
  translate: -50% -50%;
}
.d4-plate > img {
  width: var(--pw);
  height: auto;
  filter: drop-shadow(0 calc(var(--cw) * 0.02) calc(var(--cw) * 0.03) rgba(20, 10, 0, 0.45));
}
.d4-plate > b {
  width: var(--pw);
  text-align: center;
  font-size: calc(var(--cw) * 0.12);
  white-space: nowrap;
  padding-bottom: var(--cap, 0);
}
.d4-seal {
  position: absolute;
  right: -12%;
  top: -9%;
  width: calc(var(--cw) * 0.5);
  aspect-ratio: 206 / 256;
  z-index: 8;
  rotate: 10deg;
  pointer-events: none;
}
.d4-seal img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.d4-seal b {
  position: absolute;
  inset: 14% 4% 34%;
  display: grid;
  place-items: center;
  font-size: calc(var(--cw) * 0.085);
  white-space: nowrap;
}
.d4-paw {
  width: var(--pw);
  height: auto;
  margin: calc(var(--pw) * -0.45) 0 0 calc(var(--pw) * -0.5);
  opacity: 0.7;
  z-index: 2;
  pointer-events: none;
}
.d4-pose > img {
  height: var(--ph);
  width: auto;
  translate: 0 -50%;
  filter: drop-shadow(0 calc(var(--u) * 0.6) calc(var(--u) * 0.8) rgba(0, 0, 0, 0.4));
}
.d4-pose.left > img {
  translate: -100% -50%;
}
.hero .life img.d4-crack {
  inset: auto;
  left: 50%;
  top: 6%;
  width: auto;
  height: 88%;
  translate: -50% 0;
  pointer-events: none;
}
.hero .d4-laurel {
  position: absolute;
  left: -15%;
  width: 130%;
  bottom: -14%;
  height: auto;
  pointer-events: none;
}
.d4-max {
  z-index: 47;
}
.d4-max .tag {
  --h: calc(var(--u) * 7);
  white-space: nowrap;
}
/* End of css/vfx.css (complete file). */
