/* Elemental atmosphere layer. Purely decorative, never interactive. One scalar,
   --fx-intensity (0..1), scales SIZE/WIDTH/CHAOS (never colour) and maps onto
   the dominant element's level. Element is set via a body class (.fx-el-*). */
:root {
  --fx-intensity: 0;
  /* flavour-only accent channel, kept separate from functional colours.
     An element overrides --identity; titles snap to it (blue↔orange can't lerp
     without going grey). The brand + stat numbers stay blue for contrast. */
  --identity: var(--accent2);
  --title-ink: var(--identity);
}

#app { position: relative; z-index: 1; }

.fx-back, .fx-embers { position: fixed; inset: 0; pointer-events: none; }
.fx-back { z-index: 0; }
.fx-embers { z-index: 5; }            /* above cards (auto), below topbar (10) */
.fx-defs { position: absolute; }

/* per-card wavering border. screen blend => black interior is a no-op, only the
   glowing edge adds light, so text under it stays readable. */
.card { position: relative; }
.fx-edge { position: absolute; inset: 1px; z-index: 2; pointer-events: none; mix-blend-mode: screen; }
.fx-edge svg { width: 100%; height: 100%; display: block; overflow: visible; }

/* ---- backdrops (one per element) ---- */
.fx-back::before { content: ""; position: absolute; inset: 0; will-change: opacity; }

/* fire: a pit of heat under the sheet; reach scales with intensity */
.fx-el-fire .fx-back::before {
  mix-blend-mode: screen;
  background:
    radial-gradient(150% calc(26% + 46% * var(--fx-intensity)) at 50% 114%,
      rgba(255,120,20,0.60), rgba(201,51,0,0.20) 44%, transparent 70%),
    radial-gradient(90% calc(18% + 30% * var(--fx-intensity)) at 50% -10%,
      rgba(150,40,0,0.32), transparent 60%);
  animation: fx-flicker 3.7s ease-in-out infinite;
}
@keyframes fx-flicker { 0%, 100% { opacity: 0.82; } 40% { opacity: 1; } 68% { opacity: 0.72; } }
/* a card occasionally catches fire — a WAN vertical flame loop (transparent,
   alpha-keyed) creeps up ONE random side, in the gutter OUTSIDE the edge and
   BEHIND the card (z-index:-1), overlapping ~14px inward so a little licks over
   the top corner. Constant-size flames tiled down the edge with overlap. */
.fx-burn {
  position: absolute; pointer-events: none; z-index: 0; opacity: 0;
  animation-name: fx-burn-fade; animation-timing-function: ease-in-out; animation-fill-mode: forwards;
}
/* fade top & bottom so the tiled column doesn't hard-cut at the strip edges */
.fx-burn-side {
  position: absolute; top: -22%; bottom: 6%; width: 116px; overflow: hidden;   /* band sits higher; wide
    enough to fit the whole flame (115px at 200px tall) so its outer flare isn't clipped */
}
.fx-burn-side img { position: absolute; width: auto; display: block; }
/* mask = vertical fade (top/bottom) ∩ a radial that fades the lower-OUTSIDE corner,
   so the flame tapers away at its bottom-outer edge rather than cutting flat. */
.fx-burn-l {
  right: calc(100% - 22px);                            /* left gutter, 22px overlap into card */
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 6%, #000 85%, transparent), radial-gradient(135% 82% at 0% 100%, transparent 0%, #000 60%);
          mask-image: linear-gradient(to bottom, transparent, #000 6%, #000 85%, transparent), radial-gradient(135% 82% at 0% 100%, transparent 0%, #000 60%);
  -webkit-mask-composite: source-in; mask-composite: intersect;
}
.fx-burn-l img { right: 0; transform: scaleX(-1); }    /* root at card edge, flames lean outward (left) */
.fx-burn-r {
  left: calc(100% - 22px);                             /* right gutter */
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 6%, #000 85%, transparent), radial-gradient(135% 82% at 100% 100%, transparent 0%, #000 60%);
          mask-image: linear-gradient(to bottom, transparent, #000 6%, #000 85%, transparent), radial-gradient(135% 82% at 100% 100%, transparent 0%, #000 60%);
  -webkit-mask-composite: source-in; mask-composite: intersect;
}
.fx-burn-r img { left: 0; }                            /* root at card edge, flames lean outward (right) */
@keyframes fx-burn-fade { 0%, 100% { opacity: 0; } 12%, 72% { opacity: 0.9; } }

/* shadow: a breathing dark vignette closing in from the margins */
.fx-el-shadow .fx-back::before {
  background:
    radial-gradient(120% calc(52% - 18% * var(--fx-intensity)) at 50% 50%, transparent 38%, rgba(8,6,16,0.62) 100%);
  animation: fx-breathe 7s ease-in-out infinite;
}
@keyframes fx-breathe { 0%, 100% { opacity: 0.7; } 50% { opacity: 1; } }

/* shadow casts long, slowly-creeping shadows off every card (no glowing edge).
   --fx-sway (0..1) animates the throw; --fx-intensity scales its length. */
@property --fx-sway { syntax: "<number>"; inherits: true; initial-value: 0; }
:root.fx-el-shadow { animation: fx-sway 13s ease-in-out infinite; }
@keyframes fx-sway { 0%, 100% { --fx-sway: 0; } 50% { --fx-sway: 1; } }
.fx-el-shadow .card {
  box-shadow:
    0 2px 7px var(--shadow),
    calc(46px * (0.55 + 0.45 * var(--fx-intensity)) + 46px * var(--fx-sway) * var(--fx-intensity))
    calc(60px * (0.55 + 0.45 * var(--fx-intensity)) + 22px * var(--fx-sway) * var(--fx-intensity))
    calc(40px * (0.6 + 0.4 * var(--fx-intensity)) + 18px * var(--fx-sway) * var(--fx-intensity))
    -12px rgba(4, 3, 10, 0.84);
}

/* inner elements throw their own smaller cast-shadows. Add .fx-cast to opt any
   element in. Drift is mostly downward now (x kept small so it sits *below*). */
.fx-el-shadow .fx-lit {
  box-shadow:
    calc(5px * (0.55 + 0.45 * var(--fx-intensity)) + 11px * var(--fx-sway) * var(--fx-intensity))
    calc(18px * (0.55 + 0.45 * var(--fx-intensity)) + 9px * var(--fx-sway) * var(--fx-intensity))
    calc(11px * (0.6 + 0.4 * var(--fx-intensity)) + 7px * var(--fx-sway) * var(--fx-intensity))
    -7px rgba(4, 3, 10, 0.68);
}
/* the labels themselves cast a soft shadow too (section titles + field labels) */
.fx-el-shadow :is(.section-title, .field-label, .pill-label, .vital-label, .mods-label) {
  text-shadow:
    calc(2px * (0.55 + 0.45 * var(--fx-intensity)) + 4px * var(--fx-sway) * var(--fx-intensity))
    calc(5px * (0.55 + 0.45 * var(--fx-intensity)) + 5px * var(--fx-sway) * var(--fx-intensity))
    calc(3px * var(--fx-intensity)) rgba(4, 3, 10, 0.85);
}

/* a dark figure haunting ONE card at a time, INSIDE its bounds and BEHIND its
   content (glimpsed through gaps). isolate makes the card a stacking context so
   the z-index:-1 haunt sits above the card background but under the content. */
.fx-el-shadow .card { isolation: isolate; }
.fx-haunt { position: absolute; inset: 0; z-index: -1; overflow: hidden; border-radius: 8px; pointer-events: none; }
.fx-haunt-fig { position: absolute; bottom: -6%; left: 0; height: 100%; color: rgba(12, 10, 22, 0.92); filter: blur(3px); will-change: left, opacity; }
.fx-haunt-fig svg { height: 122%; width: auto; display: block; }
/* creepy purple eyes — injected into the figure only while it stops to watch */
.fx-haunt-fig .fx-eyes circle {
  fill: #d38bff; filter: drop-shadow(0 0 2.5px #a94bff);
  opacity: 0; animation: fx-eyes-open 0.6s ease-out forwards;
}
@keyframes fx-eyes-open { from { opacity: 0; } to { opacity: 0.95; } }

/* dark humanoid silhouettes creeping the gutters (behind the cards, z0) */
.fx-sils { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; opacity: var(--fx-intensity); }
.fx-sil { position: absolute; color: rgba(6, 5, 12, 0.92); filter: blur(3px); opacity: 0; animation: fx-creep 19s ease-in-out infinite; }
.fx-sil svg { display: block; height: 260px; width: auto; }
@keyframes fx-creep {
  0%, 100% { opacity: 0; transform: translateY(34px) scale(0.97); }
  50%      { opacity: 0.9; transform: translateY(-8px) scale(1.03); }
}
.fx-sil:nth-child(1) { left: 1%;  bottom: -40px;  animation-delay: 0s; }
.fx-sil:nth-child(2) { right: 1%; bottom: -52px;  animation-delay: -6.5s; }
.fx-sil:nth-child(3) { left: 5%;  bottom: -96px;  animation-delay: -12s; }
.fx-sil:nth-child(4) { right: 6%; bottom: -22px;  animation-delay: -3s; }
.fx-sil:nth-child(5) { left: 9%;  bottom: -128px; animation-delay: -15s; }
.fx-sil:nth-child(6) { right: 10%; bottom: -74px; animation-delay: -9s; }
.fx-sil:nth-child(even) svg { transform: scaleX(-1); }
.fx-sil:nth-child(3) svg, .fx-sil:nth-child(5) svg { height: 340px; }
.fx-sil:nth-child(6) svg { height: 210px; }

/* ---- earth: static, encrusted, present (asset-based, Krea2 archipel LoRA) ---- */
/* the rock texture fades into the whole-page background as intensity builds */
.fx-el-earth .fx-back {
  background: url("../assets/fx/earth/rock_texture.png") repeat;
  background-size: 300px;
  opacity: calc(0.1 + 0.34 * var(--fx-intensity));
  filter: saturate(0.85);
}
.fx-el-earth .fx-back::before {           /* static grounding vignette */
  background: radial-gradient(120% 62% at 50% 50%, transparent 50%, rgba(14, 10, 4, 0.55) 100%);
  mix-blend-mode: normal; animation: none;
}
/* scattered pebbles → stones → gems on the page (behind cards, in the gutters) */
.fx-rocks { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
/* many small pebbles, tinted + semi-transparent so they sink into the soil */
.fx-rock { position: absolute; height: auto; opacity: 0.55; filter: brightness(0.8) sepia(0.28) drop-shadow(0 1px 1px rgba(0, 0, 0, 0.4)); }
.fx-rock-gem { opacity: 0.82; filter: saturate(1.1) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45)); }
/* stalactites/stalagmites encrust each card's corners, behind the content,
   sized by intensity. isolate makes the z-index:-1 sit above bg, under content. */
.fx-el-earth .card { isolation: isolate; }
.fx-crust { position: absolute; inset: 0; z-index: -1; overflow: hidden; border-radius: 8px; pointer-events: none; }
/* size grows with intensity, but opacity is CAPPED at ~0.5 (its value around
   knob-25) so the crust never becomes distracting as the element levels up. */
.fx-spike { position: absolute; width: calc((22px + 52px * var(--fx-intensity)) * var(--sm, 1)); height: auto; opacity: min(0.5, calc(0.4 + 0.5 * var(--fx-intensity))); filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.55)); }
/* the two smaller corner spikes appear at ~level 2 and ~level 3; the off-centre
   mid-edge ones only near full intensity. all share the 0.5 opacity cap. */
.fx-spike-2 { opacity: clamp(0, calc((var(--fx-intensity) - 0.44) * 3), 0.5); }
.fx-spike-3 { opacity: clamp(0, calc((var(--fx-intensity) - 0.62) * 3), 0.5); }
.fx-spike-mid { opacity: clamp(0, calc((var(--fx-intensity) - 0.78) * 3.5), 0.5); }

/* borders: deeper brown + slightly wider — the shadow cast-targets, plus card
   borders and separators. Width grows a touch with intensity. */
.fx-el-earth .fx-lit {
  border-color: #4a2f14;
  border-width: calc(1px + 1px * var(--fx-intensity));
}
.fx-el-earth .attr-col:not(:last-child) { border-right-color: #4a2f14; border-right-width: calc(1px + 1px * var(--fx-intensity)); }
.fx-el-earth .hero-resources { border-color: #4a2f14; }

/* ---- air: shifting, near-invisible — felt, not seen ---- */
/* cards go airy/semi-transparent so the dust + current show through; at MAX
   intensity the border fully vanishes (revealed again only on hover). */
.fx-el-air .card {
  background: color-mix(in srgb, var(--panel) calc(88% - 12% * var(--fx-intensity)), transparent);
  border-color: color-mix(in srgb, var(--border), transparent calc(var(--fx-intensity) * 100%));
  transition: transform .3s ease, filter .3s ease, border-color .3s ease;
}
/* leaves / seeds / feathers carried on the wind, BEHIND the sheet (like the dust) */
.fx-carried { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.fx-carried-item { position: absolute; top: 0; left: 0; height: auto; opacity: calc(0.42 + 0.34 * var(--fx-intensity)); filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.25)); will-change: transform; }

/* brush an element and a white glow blooms on its edge, then gets swept off
   downwind — air disturbed by your touch. Size + opacity scale with level. */
@keyframes fx-air-sweep {
  0% {
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, calc(0.35 + 0.55 * var(--fx-intensity))),
      0 0 calc(6px + 16px * var(--fx-intensity)) calc(1px + 3px * var(--fx-intensity)) rgba(255, 255, 255, calc(0.2 + 0.45 * var(--fx-intensity)));
  }
  100% {
    box-shadow:
      calc(24px + 40px * var(--fx-intensity)) 0 calc(16px + 24px * var(--fx-intensity)) -6px rgba(255, 255, 255, 0),
      0 0 0 1px rgba(255, 255, 255, 0);
  }
}
.fx-el-air .fx-lit:hover { animation: fx-air-sweep 0.7s ease-out; }

/* ---- light: the cursor is a point light ---- */
/* the warm pool that follows the cursor (JS sets transform); centred via margin */
.fx-lantern {
  position: fixed; left: 0; top: 0; width: 320px; height: 320px; margin: -160px 0 0 -160px;
  z-index: 6; pointer-events: none; mix-blend-mode: screen; will-change: transform;
  opacity: calc(0.13 * var(--fx-intensity));      /* linear, no floor */
  background: radial-gradient(circle at center, rgba(255, 224, 160, 0.75), rgba(255, 190, 110, 0.28) 34%, transparent 62%);
}
/* majestic warm shafts fanning from a top-corner "sun", gently shimmering */
.fx-godrays {
  position: fixed; inset: -20% -10%; z-index: 0; pointer-events: none; mix-blend-mode: screen;
  opacity: calc(0.11 * var(--fx-intensity));
  /* rays FAN OUT from the top-right "sun" (conic) — slightly radial, not parallel */
  background: repeating-conic-gradient(from 205deg at 88% -8%,
    transparent 0deg, rgba(255, 224, 165, 0.5) 0.5deg, transparent 2deg, transparent 6deg);
  -webkit-mask-image: radial-gradient(130% 95% at 82% -12%, #000 28%, transparent 76%);
          mask-image: radial-gradient(130% 95% at 82% -12%, #000 28%, transparent 76%);
  filter: blur(3px);
  animation: fx-godrays 15s ease-in-out infinite alternate;
}
@keyframes fx-godrays { from { transform: rotate(-1.2deg); } to { transform: rotate(1.2deg); } }
/* a four-point sparkle: central dot + two crossing bright bars (JS animates it) */
.fx-glint {
  position: fixed; z-index: 7; pointer-events: none; width: 3px; height: 3px;
  background: radial-gradient(circle, rgba(255, 250, 232, 1), rgba(255, 220, 150, 0.6) 40%, transparent 72%);
  filter: drop-shadow(0 0 4px rgba(255, 226, 162, 0.9));
}
.fx-glint::before, .fx-glint::after {
  content: ""; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  background: linear-gradient(rgba(255, 246, 214, 0), rgba(255, 246, 214, 0.95), rgba(255, 246, 214, 0));
}
.fx-glint::before { width: 2px; height: 26px; }
.fx-glint::after { width: 26px; height: 2px; background: linear-gradient(90deg, rgba(255, 246, 214, 0), rgba(255, 246, 214, 0.95), rgba(255, 246, 214, 0)); }
/* ---- water: calm ↔ fury ---- */
/* flowing teal caustics (JS drifts background-position); brighter when agitated */
.fx-water-caustics {
  position: fixed; inset: 0; z-index: 4; pointer-events: none; mix-blend-mode: screen;
  opacity: calc((0.08 + 0.16 * var(--fx-agitation, 0)) * var(--fx-intensity));
  background-repeat: repeat; background-size: 520px 520px;
  /* anisotropic noise (low X freq, higher Y) → horizontal ripples that read as a wavy
     water surface rather than chaotic speckle. */
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='520' height='520'><filter id='c' filterUnits='userSpaceOnUse' x='0' y='0' width='520' height='520'><feTurbulence type='fractalNoise' baseFrequency='0.006 0.024' numOctaves='2' seed='9' stitchTiles='stitch' result='n'/><feColorMatrix in='n' type='matrix' values='0 0 0 0 0.42  0 0 0 0 0.8  0 0 0 0 0.86  2.6 0 0 0 -1.6'/></filter><rect width='520' height='520' filter='url(%23c)'/></svg>");
}
/* a ripple ring radiating from an edited element (JS animates scale+fade) */
.fx-ripple {
  position: fixed; z-index: 6; pointer-events: none; width: 64px; height: 64px; border-radius: 50%;
  border: 2px solid rgba(150, 226, 236, 0.7);
  box-shadow: 0 0 9px rgba(150, 226, 236, 0.45), inset 0 0 9px rgba(150, 226, 236, 0.4);
}

/* ---- body: the living sheet (breath + heartbeat) ---- */
/* warm coral ambient that BREATHES (slow swell, JS drives --fx-breath) */
.fx-body-glow {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; mix-blend-mode: screen;
  opacity: calc((0.08 + 0.22 * var(--fx-breath, 0.5)) * var(--fx-intensity));   /* wider pulse so the breath reads */
  background: radial-gradient(120% 95% at 50% 62%, rgba(224, 120, 96, 0.5), rgba(200, 90, 69, 0.14) 45%, transparent 72%);
}
/* whole-sheet warmth that THUMPS on the heartbeat, closing INWARD from the edges
   (Body is magic internalized — the pulse moves toward the interior) */
.fx-body-veil {
  position: fixed; inset: 0; z-index: 5; pointer-events: none; mix-blend-mode: screen;
  opacity: calc(0.04 * var(--fx-pulse, 0) * var(--fx-intensity));   /* −50% */
  background: radial-gradient(120% 100% at 50% 50%, transparent 42%, rgba(226, 140, 110, 0.5) 100%);
}
/* each card's warmth pulses on its INNER edges (inset), glowing toward the interior */
.fx-el-body .card {
  box-shadow: 0 2px 7px var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.045),
    inset 0 0 calc(36px * var(--fx-pulse, 0)) calc(2px * var(--fx-pulse, 0)) rgba(226, 140, 110, calc(0.25 * var(--fx-pulse, 0) * var(--fx-intensity)));
}
/* UNCONSCIOUS (hp<0): page + card + field backgrounds sink to near-black */
html.fx-body-out { --bg: #060505; --page: #0a0806; --panel: #0b0908; --field: #090705; }
.fx-el-body body, .fx-el-body .card, .fx-el-body .fx-lit { transition: background-color 1s ease, background 1s ease; }
/* exertion (moving/editing) flexes each title underline wider + thicker, like a
   muscle contracting — decoupled from the heartbeat so nothing flashes. */
.fx-el-body .section-title {
  background: linear-gradient(to right, var(--title-ink) 0%,
    var(--title-ink) calc(38% + 48% * var(--fx-exertion, 0)), transparent 100%)
    left bottom / 100% calc(2px + 2px * var(--fx-exertion, 0)) no-repeat;
}

@media (prefers-reduced-motion: reduce) {
  .fx-back::before, :root.fx-el-shadow { animation: none; }
  .fx-sil { animation: none; opacity: 0.5; }
  .fx-godrays { animation: none; }
}

/* ---- temporary dev controls (final build keys off char.bestElement) ---- */
.fx-knob {
  position: fixed; left: 12px; bottom: 12px; z-index: 60;
  display: flex; align-items: center; gap: 9px;
  padding: 6px 11px; border-radius: 9px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border: 1px solid var(--border); backdrop-filter: blur(6px);
  font: 700 0.8rem var(--sans); color: var(--muted);
}
.fx-knob span { min-width: 3.6rem; text-transform: uppercase; letter-spacing: 0.03em; }
.fx-knob select { font: 600 0.78rem var(--sans); background: var(--field); color: var(--ink); border: 1px solid var(--border); border-radius: 6px; padding: 2px 4px; }
.fx-knob input { width: 120px; accent-color: var(--identity); }
.fx-knob .fx-fps { min-width: 4.6rem; text-align: right; font: 600 0.72rem var(--mono, monospace); text-transform: none; letter-spacing: 0; opacity: 0.75; }

/* ============================================================================
   LIGHT THEME adaptation. The additive atmospheres use mix-blend-mode: screen —
   they ADD light, which is ~invisible on a light page. On light theme, flip the
   colour layers to MULTIPLY so their warm/teal/coral hues TINT the parchment and
   become visible again. (Dark normal-blend FX already show fine on light.) */
:root[data-theme="light"] :is(
  .fx-el-fire .fx-back::before,
  .fx-water-caustics,
  .fx-body-glow,
  .fx-body-veil,
  .fx-lantern,
  .fx-godrays,
  .fx-edge
) { mix-blend-mode: multiply; }

/* These layers were tuned faint for screen-blend on a dark page; multiplied onto a
   light page they need ~2× the opacity to read. (Fire's backdrop + edge already carry.) */
:root[data-theme="light"] .fx-water-caustics { opacity: calc((0.17 + 0.30 * var(--fx-agitation, 0)) * var(--fx-intensity)); }
/* Water click-ripple: pale teal → invisible on parchment; deepen to the chip teal. */
:root[data-theme="light"] .fx-ripple {
  border-color: rgba(38,128,160,0.85);
  box-shadow: 0 0 9px rgba(38,128,160,0.55), inset 0 0 9px rgba(38,128,160,0.5);
}
/* Light element: the warm pale gold lantern & god-rays multiply to a washed beige
   on parchment, and the rays barely register. Use a deeper, saturated gold and
   push the opacity so they read as real warm light. */
:root[data-theme="light"] .fx-lantern {
  background: radial-gradient(circle at center, rgba(201,168,63,0.8), rgba(201,168,63,0.32) 34%, transparent 62%);
  opacity: calc(0.28 * var(--fx-intensity));
}
:root[data-theme="light"] .fx-godrays {
  background: repeating-conic-gradient(from 205deg at 88% -8%,
    transparent 0deg, rgba(201,168,63,0.9) 0.5deg, transparent 2deg, transparent 6deg);
  opacity: calc(0.55 * var(--fx-intensity));
}
:root[data-theme="light"] .fx-body-glow { opacity: calc((0.12 + 0.26 * var(--fx-breath, 0.5)) * var(--fx-intensity)); }
:root[data-theme="light"] .fx-body-veil { opacity: calc(0.08 * var(--fx-pulse, 0) * var(--fx-intensity)); }

/* --- per-element light-theme fixes (2026-07-14 pass) ------------------------
   Some effects are near-WHITE and additive; multiply can't rescue them (white ×
   light = still white). These get recoloured to a warm/tinted tone that reads on
   parchment, and fire's multiplied edge is dialed back. */

/* Section titles snap to the element's --identity, which is tuned pale for a dark
   page (e.g. air #cfe8f0) and vanishes on parchment. On light, darken the ink
   toward the page text so titles keep the element hue but stay legible. */
:root[data-theme="light"] { --title-ink: color-mix(in srgb, var(--identity) 52%, #201b14); }

/* Light: the glint sparkle is cream-white → invisible on parchment. Recolour to
   warm amber-gold (a struck-gilt sparkle) with a saturated core so it reads. */
:root[data-theme="light"] .fx-glint {
  background: radial-gradient(circle, rgba(201,168,63,1), rgba(201,168,63,0.6) 40%, transparent 72%);
  filter: drop-shadow(0 0 4px rgba(201,168,63,0.85));
}
:root[data-theme="light"] .fx-glint::before { background: linear-gradient(rgba(201,168,63,0), rgba(201,168,63,0.92), rgba(201,168,63,0)); }
:root[data-theme="light"] .fx-glint::after  { background: linear-gradient(90deg, rgba(201,168,63,0), rgba(201,168,63,0.92), rgba(201,168,63,0)); }

/* Air: the hover sweep is a white edge-glow → invisible. Give light theme its own
   keyframe in a cool slate-blue (disturbed air), so the sweep reads as a tinted
   ripple flicking downwind rather than a white bloom. */
@keyframes fx-air-sweep-light {
  0% {
    box-shadow:
      0 0 0 1.5px rgba(46,82,110, calc(0.5 + 0.42 * var(--fx-intensity))),
      0 0 calc(10px + 22px * var(--fx-intensity)) calc(2px + 4px * var(--fx-intensity)) rgba(46,82,110, calc(0.3 + 0.42 * var(--fx-intensity)));
  }
  100% {
    box-shadow:
      calc(28px + 44px * var(--fx-intensity)) 0 calc(18px + 26px * var(--fx-intensity)) -6px rgba(46,82,110, 0),
      0 0 0 1.5px rgba(46,82,110, 0);
  }
}
:root[data-theme="light"] .fx-el-air .fx-lit:hover { animation-name: fx-air-sweep-light; }

/* Fire: the wavering card edge multiplied onto parchment reads a touch heavy —
   ease it back so it glows rather than outlines. */
:root[data-theme="light"] .fx-el-fire .fx-edge { opacity: 0.6; }

/* Fire furnace: the dark-tuned radial multiplied onto parchment at low alpha goes
   peachy-pink. Use a deeper, higher-alpha orange on light so it reads as a proper
   furnace glow (keeps the multiply blend + flicker from the base rule). */
:root[data-theme="light"] .fx-el-fire .fx-back::before {
  background:
    radial-gradient(150% calc(26% + 46% * var(--fx-intensity)) at 50% 114%,
      rgba(228,92,10,0.85), rgba(184,44,0,0.5) 44%, transparent 72%),
    radial-gradient(90% calc(18% + 30% * var(--fx-intensity)) at 50% -10%,
      rgba(150,40,0,0.42), transparent 60%);
}
