/* J-1001-TYPING-HERO-AURA: hidden streak bonus (js/hero-aura.js). Tier k = 10k clean clears in a row.
   Layers sit inside #hero-rect and get per-frame landmark vars (px) from hero-aura.js. */
.aura-layer { position: absolute; inset: 0; pointer-events: none; transform: rotate(var(--pose-rot, 0deg)); opacity: 0; transition: opacity .5s; }
.aura-back { z-index: -1; }
.aura-front { z-index: 2; }
.viewport.aura-on .aura-layer { opacity: 1; }
.aura-layer > * { position: absolute; opacity: 0; transition: opacity .4s; }
.aura-front .aura-motes { inset: 0; opacity: 1; overflow: visible; }
.aura-staffs { position: absolute; inset: 0; pointer-events: none; }
.aura-staffs .aura-staff { position: absolute; }
.hero-ov-gold { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; opacity: 0; transform: rotate(var(--pose-rot, 0deg)); z-index: 1; }
/* J-1010-KNIGHT-SCALE-FIX: tall knight frames (1500x1648) at the 1328 box's scale and
   feet line: the img rises 320/1328 above #hero-rect, never squeezed, never clipped. */
.ph-rect img#hero-img.knight-tall, .ph-rect img.hero-ov-gold.knight-tall { position: absolute; left: 0; top: -24.096%; width: 100%; height: 124.096%; max-width: none; max-height: none; object-fit: fill; }
/* J-1011-TYPING-PERF-WINS item 7: idle-trim = idle rows 544..1504 of the tall canvas (game.js KNIGHT_TRIM),
   so its box is just those rows of the tall box: same scale, same pixels, same feet. */
.ph-rect img#hero-img.knight-tall[src*="/knight-tall/idle-trim/"], .ph-rect img.hero-ov-gold.knight-tall[src*="/knight-tall/idle-trim/"] { top: 16.8677%; height: 72.2889%; }
/* J-1011-TYPING-PERF-WINS item 7 stage 3c: block rows 576..1512, power-up rows 504..1512 (game.js KNIGHT_TRIM). */
.ph-rect img#hero-img.knight-tall[src*="/knight-tall/block-trim/"], .ph-rect img.hero-ov-gold.knight-tall[src*="/knight-tall/block-trim/"] { top: 19.2774%; height: 70.4817%; }
.ph-rect img#hero-img.knight-tall[src*="/knight-tall/power-up-trim/"], .ph-rect img.hero-ov-gold.knight-tall[src*="/knight-tall/power-up-trim/"] { top: 13.8557%; height: 75.9034%; }
/* J-1011-TYPING-PERF-WINS item 7 stage 3d: death rows 568..1536, impact rows 576..1504 (game.js KNIGHT_TRIM). */
.ph-rect img#hero-img.knight-tall[src*="/knight-tall/death-trim/"], .ph-rect img.hero-ov-gold.knight-tall[src*="/knight-tall/death-trim/"] { top: 18.6750%; height: 72.8913%; }
.ph-rect img#hero-img.knight-tall[src*="/knight-tall/impact-trim/"], .ph-rect img.hero-ov-gold.knight-tall[src*="/knight-tall/impact-trim/"] { top: 19.2774%; height: 69.8793%; }
/* J-1011-TYPING-PERF-WINS item 7 stage 3e: slash, slash-2, inward-slash, outward-slash, kick, kill rows (game.js KNIGHT_TRIM). */
.ph-rect img#hero-img.knight-tall[src*="/knight-tall/slash-trim/"], .ph-rect img.hero-ov-gold.knight-tall[src*="/knight-tall/slash-trim/"] { top: -0.6021%; height: 90.3612%; }
.ph-rect img#hero-img.knight-tall[src*="/knight-tall/slash-2-trim/"], .ph-rect img.hero-ov-gold.knight-tall[src*="/knight-tall/slash-2-trim/"] { top: -15.0599%; height: 104.8190%; }
.ph-rect img#hero-img.knight-tall[src*="/knight-tall/inward-slash-trim/"], .ph-rect img.hero-ov-gold.knight-tall[src*="/knight-tall/inward-slash-trim/"] { top: 16.2653%; height: 72.8913%; }
.ph-rect img#hero-img.knight-tall[src*="/knight-tall/outward-slash-trim/"], .ph-rect img.hero-ov-gold.knight-tall[src*="/knight-tall/outward-slash-trim/"] { top: 12.0485%; height: 77.1082%; }
.ph-rect img#hero-img.knight-tall[src*="/knight-tall/kick-trim/"], .ph-rect img.hero-ov-gold.knight-tall[src*="/knight-tall/kick-trim/"] { top: 7.8316%; height: 81.9275%; }
.ph-rect img#hero-img.knight-tall[src*="/knight-tall/kill-trim/"], .ph-rect img.hero-ov-gold.knight-tall[src*="/knight-tall/kill-trim/"] { top: 15.6629%; height: 74.0962%; }
.ph-rect img#hero-img.knight-tall[src*="/knight-tall/casting-trim/"], .ph-rect img.hero-ov-gold.knight-tall[src*="/knight-tall/casting-trim/"] { top: -16.8671%; height: 106.6262%; }
/* J-1010-KNIGHT-HOLY-SMITE: casting light/dust over the knight's tall canvas.
   J-1011-TYPING-ENDGAME-FX: padded frames (-pad: +300 px per side on 1500x1648, small set to
   scale, fading to 0 at the border) in page-level fixed layers that game.js placeSmite lays on
   #hero-rect each frame, so #viewport's overflow no longer cuts the flare. z 40: over the
   scene and HUD panels, under menus (80) and the loading overlay (1000). */
img.hero-smite { position: fixed; left: 0; top: 0; width: 0; height: 0; z-index: 40; max-width: none; max-height: none; object-fit: fill;
  pointer-events: none; filter: none; transform: rotate(var(--pose-rot, 0deg)); visibility: hidden; }
img.hero-smite.on { visibility: visible; }   /* visibility, not display: placeSmite measures the placed box */
img.hero-smite.smite-light { z-index: 41; mix-blend-mode: plus-lighter; }
/* J-1010-TYPING-POLISH: small-hit spray (game.js hitSpray). A box centred on the contact
   point inside #monster-rect; each <i> is a soft dark-red droplet thrown out along
   its angle --a, away from the knight, and fading as it lands. */
.hit-spray { position: absolute; z-index: 3; pointer-events: none; margin: 0; translate: -50% -50%; overflow: visible; }
.hit-spray i { position: absolute; left: 50%; top: 50%; width: calc(var(--s) * 100%); aspect-ratio: 1.6; border-radius: 50%;
  background: radial-gradient(circle at 38% 34%, rgba(230, 120, 120, .55) 0 9%, transparent 16%),
    radial-gradient(closest-side, rgba(120, 8, 14, 1), rgba(78, 4, 8, .92) 55%, rgba(40, 2, 4, 0) 100%);
  filter: blur(.8px) drop-shadow(0 0 2px rgba(0, 0, 0, .6)); opacity: 0; translate: -50% -50%;
  transform: rotate(var(--a)) translateX(0) scale(.4);
  animation: hit-spray .52s cubic-bezier(.2, .7, .3, 1) forwards; }
@keyframes hit-spray {
  0% { opacity: .95; transform: rotate(var(--a)) translateX(0) scale(.4); }
  45% { opacity: .9; }
  100% { opacity: 0; transform: rotate(var(--a)) translateX(var(--d)) scale(1.15, .8); } }
@media (prefers-reduced-motion: reduce) { .hit-spray i { animation-duration: .3s; } }
/* J-1010-KNIGHT-FX-EXTRA: level-up holy light (game.js levelUpGlory). The layer is
   #hero-rect's box; the beam reaches from far above down to the feet. */
.levelup-fx { position: absolute; inset: 0; pointer-events: none; z-index: 3; overflow: visible; }
.levelup-fx .lu-beam { position: absolute; left: 14%; right: 14%; top: -320%; bottom: 2%; transform-origin: 50% 0; mix-blend-mode: screen;
  background: linear-gradient(180deg, rgba(255,245,200,0) 0%, rgba(255,236,170,.22) 35%, rgba(255,244,205,.5) 75%, rgba(255,250,230,.6) 92%, rgba(255,240,200,0));
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 30%, #000 70%, transparent); mask-image: linear-gradient(90deg, transparent, #000 30%, #000 70%, transparent);
  filter: blur(6px); }
.levelup-fx .lu-core { position: absolute; left: -12%; right: -12%; top: 4%; bottom: 8%; border-radius: 50%; mix-blend-mode: screen;
  background: radial-gradient(ellipse at 50% 42%, rgba(255,250,225,.55), rgba(255,215,120,.25) 40%, rgba(255,200,80,0) 66%); }
.levelup-fx .lu-ground { position: absolute; left: -30%; right: -30%; bottom: -6%; height: 16%; border-radius: 50%; mix-blend-mode: plus-lighter;
  background: radial-gradient(ellipse at center, rgba(255,250,215,.95), rgba(255,210,100,.5) 45%, transparent 72%); }
.levelup-fx i { position: absolute; left: 50%; top: 0; margin: -3px 0 0 -3px; border-radius: 50%; mix-blend-mode: plus-lighter; }
.levelup-fx .lu-spark { background: radial-gradient(circle, #fff 0 22%, rgba(255,240,180,.9) 35%, transparent 70%);
  box-shadow: 0 0 6px 2px rgba(255,236,170,.9); }
.levelup-fx .lu-spark::before, .levelup-fx .lu-spark::after { content: ""; position: absolute; left: 50%; top: 50%; width: 320%; height: 2px; translate: -50% -50%;
  background: linear-gradient(90deg, transparent, #fff 50%, transparent); }
.levelup-fx .lu-spark::after { width: 2px; height: 320%; background: linear-gradient(180deg, transparent, #fff 50%, transparent); }
.levelup-fx .lu-dust { background: rgba(255,214,140,.85); box-shadow: 0 0 4px 1px rgba(255,190,90,.6); filter: blur(.5px); }

/* line helpers: a box from (x,y) along len at ang */
.aura-blade, .aura-fire, .aura-staff { left: var(--sword-x); top: var(--sword-y); width: var(--sword-len); transform-origin: 0 50%; rotate: var(--sword-ang); }
.aura-staff { left: var(--staff-x); top: var(--staff-y); width: var(--staff-len); rotate: var(--staff-ang); }

/* ---------- knight ---------- */
.viewport.class-warrior.aura-1 #hero-img { animation: aura-k1 2.2s ease-in-out infinite; }
@keyframes aura-k1 {
  0%, 100% { filter: drop-shadow(0 10px 12px rgba(0,0,0,.55)) drop-shadow(0 0 5px rgba(255,140,40,.35)); }
  50% { filter: drop-shadow(0 10px 12px rgba(0,0,0,.55)) drop-shadow(0 0 11px rgba(255,140,40,.75)); }
}
.viewport.class-warrior.aura-2 #hero-img { animation: aura-k2 1.9s ease-in-out infinite; }
@keyframes aura-k2 {
  0%, 100% { filter: drop-shadow(0 10px 12px rgba(0,0,0,.5)) drop-shadow(0 0 8px rgba(255,190,60,.55)) drop-shadow(0 0 18px rgba(255,200,80,.25)); }
  50% { filter: drop-shadow(0 10px 12px rgba(0,0,0,.5)) drop-shadow(0 0 14px rgba(255,205,70,.95)) drop-shadow(0 0 28px rgba(255,215,90,.5)); }
}
/* 30: sword + shield glow */
.viewport.class-warrior.aura-3 .aura-blade { opacity: var(--sword-on); animation: aura-throb-sw 1.4s ease-in-out infinite; }
.aura-blade { height: 12px; translate: 0 -50%; border-radius: 50%;
  background: linear-gradient(90deg, rgba(120,200,255,.35), rgba(170,225,255,.95) 30%, rgba(225,245,255,1) 80%, rgba(140,210,255,0));
  filter: blur(2px) drop-shadow(0 0 8px #3aa0ff) drop-shadow(0 0 18px #1e7bff); mix-blend-mode: screen; }
.viewport.class-warrior.aura-3 .aura-shield { opacity: 1; animation: aura-throb 1.4s ease-in-out infinite; }
.aura-shield { left: var(--shield-x); top: var(--shield-y); width: calc(var(--shield-r) * 2.3); height: calc(var(--shield-r) * 2.6); translate: -50% -50%; border-radius: 50%;
  border: 4px solid rgba(150,215,255,.95); box-shadow: 0 0 16px 6px rgba(60,150,255,.8), 0 0 34px 10px rgba(30,110,255,.45), inset 0 0 22px rgba(120,200,255,.6); filter: blur(1px);
  mix-blend-mode: screen; }
/* 40: halo */
.viewport.class-warrior.aura-4 .aura-halo { opacity: 1; }
/* J-1010-KNIGHT-BUFFS: no anchor on this knight frame yet -> hide, never park on a stale spot */
.aura-front.no-halo .aura-halo, .aura-front.no-shield .aura-shield { visibility: hidden; }
.aura-halo { left: var(--head-x); top: calc(var(--head-y) - var(--u) * 34px); width: calc(var(--u) * 150px); aspect-ratio: 3.2 / 1; translate: -50% -50%;
  border-radius: 50%; border: 3px solid rgba(255,236,160,.95);
  box-shadow: 0 0 10px 3px rgba(255,210,90,.85), 0 0 26px 6px rgba(255,190,60,.45), inset 0 0 8px rgba(255,245,200,.9);
  animation: aura-halo 2.4s ease-in-out infinite; }
@keyframes aura-halo { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
/* 50: deliberately oversized holy flame along the sword */
.viewport.class-warrior.aura-5 .aura-fire { opacity: var(--sword-on); }
.aura-fire { height: 34px; translate: 0 -72%;
  background: linear-gradient(90deg, rgba(255,105,20,0), rgba(255,125,25,.95) 12%, rgba(255,185,45,1) 34%, rgba(255,239,135,1) 62%, rgba(255,255,225,.82) 84%, transparent);
  border-radius: 55%; filter: blur(4px) drop-shadow(0 0 8px rgba(255,100,15,.95)) drop-shadow(0 0 20px rgba(255,175,35,.8)); mix-blend-mode: screen; animation: aura-flame .13s steps(2) infinite alternate; }
@keyframes aura-flame { from { transform: scaleY(1.12) translateY(0); } to { transform: scaleY(1.8) translateY(-7px); } }
/* 70: float (both): bob in hero-aura.js; swirling mist on the floor under the feet
   (--float-dy undoes the lift so the mist stays on the ground) */
.aura-mist { transform: scaleY(.28); left: calc(var(--feet-x) + var(--float-dx, 0px)); top: calc(var(--feet-y) + var(--float-dy, 0px)); width: calc(var(--body-w) * 1.35); aspect-ratio: 1; translate: -50% -50%; }
.viewport.aura-7 .aura-mist { opacity: 1; }
.aura-mist i { position: absolute; inset: 0; border-radius: 50%; filter: blur(7px); mix-blend-mode: screen;
  background: conic-gradient(from 0deg, transparent 0 10%, var(--mist) 22%, transparent 38%, var(--mist) 58%, transparent 72%, var(--mist) 86%, transparent);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 25%, transparent 70%); mask-image: radial-gradient(ellipse at center, #000 25%, transparent 70%);
  animation: aura-mist 5.5s linear infinite; }
.aura-mist i:nth-child(2) { inset: 12% 8%; animation-duration: 3.8s; animation-direction: reverse; opacity: .8; }
.aura-mist i:nth-child(3) { inset: -10% -6%; animation-duration: 8s; opacity: .55; filter: blur(11px); }
.viewport.class-warrior .aura-mist { --mist: rgba(255,232,170,.55); }
.viewport.class-mage .aura-mist { --mist: rgba(170,190,255,.55); }
/* rotate in the floor plane: spin a circle, squash it flat */
@keyframes aura-mist { to { transform: rotate(360deg); } }

/* ---------- mage ---------- */
.aura-floor { left: var(--feet-x); top: var(--feet-y); width: calc(var(--body-w) * 1.25); height: calc(var(--body-w) * .14); translate: -50% -50%; border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(140,200,255,.45), rgba(90,150,255,.18) 55%, transparent 72%); filter: blur(2px); }
.viewport.class-mage.aura-1 .aura-floor { animation: aura-throb-55 2.6s ease-in-out infinite; }
@keyframes aura-throb-55 { 0%, 100% { opacity: .35; } 50% { opacity: .6; } }
.viewport.class-mage.aura-2 .aura-floor {
  background: radial-gradient(ellipse at center, rgba(255,255,255,.4), transparent 65%), conic-gradient(from 0deg, rgba(255,90,200,.45), rgba(90,170,255,.45), rgba(90,255,190,.45), rgba(255,220,90,.45), rgba(255,90,200,.45));
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 70%); mask-image: radial-gradient(ellipse at center, #000 30%, transparent 70%);
  animation: aura-throb 2.2s ease-in-out infinite, aura-hue 6s linear infinite; }
/* 30: a narrow, staff-bound magic coat.  The landmarks are orb → lower pole for
   every idle, zap, and fireball frame; keeping this narrow prevents a floating bar. */
.viewport.class-mage.aura-3 .aura-staffs { opacity: 1; }
.viewport.class-mage.aura-3 .aura-staff { opacity: calc(var(--staff-on) * .95); animation: aura-throb-st 1.5s ease-in-out infinite, aura-staff-charge 1.05s ease-in-out infinite alternate; }
/* The orb landmark was useful before calibration, but it reads as a detached
   white ball now that the full staff itself is charged. */
.viewport.class-mage.aura-3 .aura-orb { opacity: 0; }
.aura-staff { height: 6px; translate: 0 -50%; border-radius: 3px;
  background: linear-gradient(90deg, rgba(30,80,220,.45), rgba(78,155,255,.95) 16%, rgba(210,247,255,1) 50%, rgba(78,155,255,.95) 84%, rgba(30,80,220,.45));
  box-shadow: 0 0 5px 1px rgba(135,215,255,1), 0 0 13px 4px rgba(65,120,255,.85), 0 0 26px 7px rgba(62,80,255,.45);
  filter: none; mix-blend-mode: screen; overflow: visible; }
.aura-staff::before { content:""; position:absolute; inset:-2px 0; border-radius:inherit; background:linear-gradient(90deg, transparent, rgba(255,255,255,.82) 50%, transparent); filter:blur(1px); opacity:.8; }
.aura-staff::after { content:""; position:absolute; inset:-11px -8px; pointer-events:none; opacity:.88;
  background:radial-gradient(circle, #fff 0 1px, transparent 2px) 8% 35% / 20px 18px, radial-gradient(circle, #bcefff 0 1.5px, transparent 2.8px) 48% 70% / 29px 24px, radial-gradient(circle, #72baff 0 1px, transparent 2px) 86% 22% / 23px 20px;
  animation:aura-staff-spark .72s linear infinite; }
@keyframes aura-staff-charge { from { filter:brightness(1) saturate(1.05); } to { filter:brightness(1.4) saturate(1.35); } }
@keyframes aura-staff-spark { from { background-position:8% 35%,48% 70%,86% 22%; } to { background-position:32% 5%,76% 42%,112% 68%; } }
.aura-orb { left: var(--orb-x); top: var(--orb-y); width: calc(var(--u) * 70px); aspect-ratio: 1; translate: -50% -50%; border-radius: 50%;
  background: radial-gradient(circle, rgba(230,248,255,.95), rgba(110,190,255,.55) 45%, transparent 70%); mix-blend-mode: screen;
}
/* 40: gold trim glow */
.viewport.class-mage.aura-4 .hero-ov-gold { opacity: 1; filter: url(#aura-gold) drop-shadow(0 0 4px rgba(255,210,100,.9)); animation: aura-flicker 1.3s steps(6) infinite; }
/* 50 / 60: rune */
.aura-rune { left: var(--feet-x); top: var(--feet-y); width: calc(var(--body-w) * 1.15); translate: -50% -50%; transform: scaleY(.3); overflow: visible;
  fill: none; stroke: #8fd0ff; stroke-width: 2.2; filter: drop-shadow(0 0 3px #6ab8ff); }
.aura-rune .g { fill: #bfe6ff; stroke: none; font: 600 15px serif; text-anchor: middle; }
.aura-rune .r2 { stroke-dasharray: 6 5; }
.viewport.class-mage.aura-5 .aura-rune { animation: aura-runecol 2.4s steps(1) infinite, aura-flicker-7 1.1s steps(5) infinite; }
.viewport.class-mage.aura-6 .aura-rune { opacity: 1; stroke-width: 3.4; filter: drop-shadow(0 0 4px #fff) drop-shadow(0 0 12px #6ab8ff) drop-shadow(0 0 24px #a070ff);
  animation: aura-runecol 2.4s steps(1) infinite, aura-flicker 1.1s steps(5) infinite; }
@keyframes aura-runecol { 0% { stroke: #8fd0ff; } 25% { stroke: #c58cff; } 50% { stroke: #7dffcf; } 75% { stroke: #ffd27a; } }
@keyframes aura-flicker-7 { 0%, 100% { opacity: .75; } 20% { opacity: .4; } 45% { opacity: .65; } 70% { opacity: .3; } }

/* ---------- 90: near white ---------- */
.viewport.aura-9 #hero-img { animation: aura-white 1.4s ease-in-out infinite !important; }
@keyframes aura-white {
  0%, 100% { filter: brightness(1.75) saturate(.3) drop-shadow(0 0 10px rgba(255,255,255,.9)) drop-shadow(0 0 24px rgba(255,240,200,.6)); }
  50% { filter: brightness(2.05) saturate(.2) drop-shadow(0 0 16px #fff) drop-shadow(0 0 34px rgba(255,245,215,.8)); }
}

/* motes */
.aura-motes .mote-streak, .aura-motes .mote-dust, .aura-motes .mote-ember {
  position: absolute; border-radius: 50%; translate: -50% -50%;
  background: hsl(var(--hue) 95% 72%); box-shadow: 0 0 6px 1px hsl(var(--hue) 95% 65%);
  animation-name: mote-rise; animation-timing-function: cubic-bezier(.3,.6,.4,1); animation-fill-mode: forwards; opacity: 0; }
.aura-motes .mote-streak { border-radius: 40%; filter: blur(.6px); }
.aura-motes .mote-ember { background: hsl(var(--hue) 100% 62%); box-shadow: 0 0 8px 2px hsl(var(--hue) 100% 55%); }
@keyframes mote-rise { 0% { opacity: 0; transform: translate(0, 0) scale(.6); } 15% { opacity: var(--op); } 100% { opacity: 0; transform: translate(var(--sway), var(--rise)) scale(.25); } }
@keyframes aura-throb { 0%, 100% { opacity: .6; } 50% { opacity: 1; } }
@keyframes aura-flicker { 0%, 100% { opacity: 1; } 20% { opacity: .55; } 45% { opacity: .9; } 70% { opacity: .4; } }
@keyframes aura-hue { to { filter: hue-rotate(360deg); } }

/* developer panel */
.developer-aura { margin-top: .6rem; }
.developer-aura-head { font-weight: 700; font-size: .8rem; margin-bottom: .25rem; }
.developer-aura-toggle { font-size: .74rem; }
@media (prefers-reduced-motion: reduce) {
  .aura-motes { display: none; }
  .viewport.aura-on #hero-img, .aura-layer > *, .hero-ov-gold { animation: none !important; }
}

/* aura 80: the queued foe behind takes the overflow */
.monster-queue-slot.queue-hit img { animation: queue-hit .42s ease-out; }
@keyframes queue-hit {
  0% { translate: 0 0; filter: brightness(1); }
  20% { translate: 5% 0; filter: brightness(2.2) sepia(1) hue-rotate(-30deg) saturate(4); }
  55% { translate: -2% 0; filter: brightness(1.3); }
  100% { translate: 0 0; filter: brightness(1); }
}
.monster-damage-popup.queue-dmg { position: absolute; translate: -50% 0; font-size: 1.5em; z-index: 30; }

/* pulses that keep a frame with no sword/staff (on = 0) hidden */
@keyframes aura-throb-sw { 0%, 100% { opacity: calc(var(--sword-on) * .6); } 50% { opacity: var(--sword-on); } }
@keyframes aura-throb-st { 0%, 100% { opacity: calc(var(--staff-on) * .6); } 50% { opacity: var(--staff-on); } }
