/* =======================================================================
   LORECRAFT · THE EFFECTS OF THE TABLE (web/public/table-fx.js)
   The canvas the bolts are drawn on, the text rising over what got it,
   the shake of what is hit, and a card flying to its pile. The colors are
   the table's (--hurt and --ok, table.css) and the spells' (color-identity.css).
   ======================================================================= */
.fx-canvas{position:fixed; inset:0; z-index:40; width:100vw; height:100vh; pointer-events:none}

/* the text that rises over what got it and fades (rise in table-fx.js; 15/11/2026: as in games): the damage in red, the healing
   in green, a token put on (or, dimmer, taken off) with its name, smaller; bigger over a player */
.fx-num{--ink:color-mix(in srgb, var(--hurt) 88%, #fff); position:fixed; z-index:41; margin-top:calc(var(--dy, 0px) * -1); pointer-events:none;
  white-space:nowrap; font:800 30px/1 var(--display); color:var(--ink); -webkit-text-stroke:4px rgb(0 0 0 / .8); paint-order:stroke fill;
  text-shadow:0 0 12px color-mix(in srgb, var(--ink) 60%, transparent), 0 3px 4px rgb(0 0 0 / .7);
  transform:translate(-50%, -50%); animation:fx-num 1.7s cubic-bezier(.2, .8, .3, 1) forwards}
.fx-num.big{font-size:38px}
.fx-num.heal{--ink:color-mix(in srgb, var(--ok) 80%, #fff)}
.fx-num.mark{--ink:#fff; font-size:21px; letter-spacing:.02em; -webkit-text-stroke-width:3px}
.fx-num.mark.off{--ink:rgb(255 255 255 / .78)}
@keyframes fx-num{
  0%{opacity:0; transform:translate(-50%, -30%) scale(.5)}
  12%{opacity:1; transform:translate(-50%, -70%) scale(1.25)}
  24%{transform:translate(-50%, -85%) scale(1)}
  60%{opacity:1}
  100%{opacity:0; transform:translate(-50%, calc(-50% - 96px)) scale(.95)}
}

/* what is hit: the translate property, so a card's own transform stays */
.fx-shake{animation:fx-shake .42s ease-in-out}
@keyframes fx-shake{
  0%, 100%{translate:0 0; filter:none}
  15%{translate:-5px 1px; filter:drop-shadow(0 0 8px var(--hurt)) brightness(1.25)}
  35%{translate:5px -1px}
  55%{translate:-3px 0}
  75%{translate:2px 0; filter:drop-shadow(0 0 4px var(--hurt))}
}

/* a card that left the table: its copy flies, the card hides until the table is drawn again */
.pc.fx-flying{position:fixed; z-index:41; margin:0; pointer-events:none; transform-origin:50% 50%}
.fx-gone{visibility:hidden}

/* a resource the Market just got from the Supply */
.pc.fx-new > .face{border-radius:6px; animation:fx-new 2.4s ease-out forwards}
@keyframes fx-new{
  0%, 45%{box-shadow:0 0 0 3px var(--accent), 0 0 18px 6px color-mix(in srgb, var(--accent) 70%, transparent)}
  100%{box-shadow:0 0 0 0 transparent}
}

/* the dice of a move (Critical Strike): in the middle of the table, under the canvas (its gold bursts over them), over every zone */
.fx-dice{--die:86px; position:fixed; inset:0; z-index:39; display:grid; place-content:center; justify-items:center; gap:58px; pointer-events:none;
  background:radial-gradient(closest-side, rgb(10 8 14 / .62), rgb(10 8 14 / .28) 70%, transparent); animation:fx-dice-in .18s ease-out}
@keyframes fx-dice-in{from{opacity:0}}
.fx-dice-title{padding:6px 16px; border-radius:999px; background:rgb(15 12 20 / .82); color:#fff; font:700 17px/1.2 var(--sans); box-shadow:0 4px 18px rgb(0 0 0 / .45)}
.fx-dice-title .kw svg{color:var(--light-fb)}
.fx-dice-row{display:flex; flex-wrap:wrap; justify-content:center; gap:28px 40px; perspective:800px}
.fx-die-slot{position:relative; display:grid; justify-items:center; gap:12px; min-width:180px}   /* room for what each die did, side by side */
.fx-die{position:relative; width:var(--die); height:var(--die); transform-style:preserve-3d}
.fx-cube{position:absolute; inset:0; transform-style:preserve-3d}
.fx-face{position:absolute; inset:0; display:grid; grid-template:repeat(3, 1fr) / repeat(3, 1fr); padding:13%; border-radius:17%;
  background:linear-gradient(145deg, #fbf8f1, #e4ddcf); box-shadow:inset 0 0 0 2px rgb(0 0 0 / .16), inset 0 -7px 14px rgb(0 0 0 / .14);
  backface-visibility:hidden; transition:filter .25s, box-shadow .25s}
.fx-face i{width:66%; aspect-ratio:1; margin:auto; border-radius:50%; background:radial-gradient(circle at 35% 30%, #4a4552, #141118 70%)}
.fx-die-name{max-width:180px; padding:3px 12px; border-radius:999px; background:rgb(15 12 20 / .85); color:#fff; font:700 13px/1.3 var(--sans);
  text-align:center; border:2px solid var(--side, #888)}
.fx-die-slot.mine{--side:var(--mine)}
.fx-die-slot.theirs{--side:var(--theirs)}
/* what the die did rises over it (11/11/2026: it wasn't clear): a 6 shines in gold, with Critical! and the ×2 of the damage it
   doubles flashing as lightning does; any other dims, with Fail in red */
.fx-die-slot.won .fx-face{box-shadow:inset 0 0 0 3px var(--light-fb), 0 0 24px 6px color-mix(in srgb, var(--light-fb) 75%, transparent)}
.fx-verdict{position:absolute; top:-6px; left:50%; z-index:1; opacity:0; translate:-50% 0; white-space:nowrap; font:800 26px/1 var(--display);
  letter-spacing:.03em; text-transform:uppercase; -webkit-text-stroke:1px rgb(0 0 0 / .5)}
.fx-verdict b{font-size:1.15em}
.fx-die-slot.won .fx-verdict{color:#fff; text-shadow:0 0 6px var(--light-fb), 0 0 18px var(--light-fb), 0 0 36px var(--light-fb), 0 2px 2px rgb(0 0 0 / .9);
  animation:fx-rise .9s cubic-bezier(.2, .8, .3, 1) forwards, fx-lightning .7s linear 2}
.fx-die-slot.lost .fx-verdict{color:var(--hurt, #c62a1c); text-shadow:0 0 10px rgb(0 0 0 / .85), 0 2px 2px rgb(0 0 0 / .9);
  animation:fx-rise .6s cubic-bezier(.2, .8, .3, 1) forwards}
@keyframes fx-rise{
  0%{opacity:0; transform:translateY(10px) scale(.4)}
  30%{opacity:1; transform:translateY(-34px) scale(1.25)}
  55%, 100%{opacity:1; transform:translateY(-40px) scale(1)}
}
/* lightning: a few hard flashes, dark between them, then it holds */
@keyframes fx-lightning{
  0%, 7%{filter:brightness(2.8)}
  8%, 15%{filter:brightness(.45)}
  16%, 24%{filter:brightness(2.4)}
  25%, 33%{filter:brightness(.6)}
  34%, 40%{filter:brightness(3)}
  41%, 60%{filter:brightness(1)}
  61%, 66%{filter:brightness(2)}
  67%, 100%{filter:brightness(1)}
}
.fx-die-slot.lost .fx-face{filter:grayscale(1) brightness(.62)}
.fx-die-slot.lost .fx-die-name{opacity:.7}

/* a blow of Combat Damage (blow in table-fx.js; 26/11/2026): the copy of the card that leaps, in 3D, and its shadow on the table, which
   stays down as the card rises and darkens as it does */
.pc.fx-flying.fx-blow{will-change:transform; backface-visibility:hidden}
.fx-blow-shadow{position:fixed; z-index:39; pointer-events:none; opacity:0; border-radius:12%;
  background:radial-gradient(closest-side, rgb(0 0 0 / .7), rgb(0 0 0 / .35) 60%, transparent); will-change:transform, opacity}
