/* Heroes of Blight — bone & blood over deep violet-black. IM Fell English SC display,
   Spectral text. Distinct register from Legion (gold Cinzel): crimson, parchment, woodcut. */
:root {
  --ground: #0e0a10;
  --panel: #171019;
  --panel2: #1f1520;
  --line: #3a2433;
  --bone: #ddd3c2;
  --bone-dim: #9a8f80;
  --blood: #9e2434;
  --blood-bright: #d33a4e;
  --gold: #b08d3f;
  --heal: #7fdc9a;
  --shield: #7fb3dc;
  --poison: #9bc352;
  --fire: #e58a3a;
  --shadowc: #a06bd8;
  --font-display: "IM Fell English SC", serif;
  --font-body: "Spectral", Georgia, serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  background: var(--ground) radial-gradient(1200px 700px at 50% -200px, #241322 0%, var(--ground) 70%);
  color: var(--bone); font-family: var(--font-body); font-size: 15px; line-height: 1.45;
  height: 100vh; overflow: hidden;
}
#app { height: 100vh; display: flex; flex-direction: column; }
/* the bordered frame */
body::before {
  content: ""; position: fixed; inset: 8px; pointer-events: none; z-index: 60;
  border: 1px solid var(--line); outline: 3px double #4a2c3d; outline-offset: 4px;
}
button { font-family: var(--font-body); cursor: pointer; background: var(--panel2); color: var(--bone); border: 1px solid var(--line); border-radius: 3px; padding: 7px 14px; font-size: 14px; transition: all .15s; }
button:hover { border-color: var(--blood-bright); color: #fff; }
button.big { font-family: var(--font-display); font-size: 19px; padding: 12px 26px; background: linear-gradient(180deg, #2a1622, #1a0e16); border: 1px solid var(--blood); }
button.big:hover { box-shadow: 0 0 18px rgba(211, 58, 78, .35); }
button.ghost { background: transparent; font-size: 13px; }
button.mini { font-size: 11px; padding: 2px 7px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; letter-spacing: .04em; }
.hint { color: var(--bone-dim); font-style: italic; font-size: 13px; }

/* HUD */
.hud { display: flex; align-items: center; gap: 14px; padding: 8px 20px 6px; border-bottom: 1px solid var(--line); flex: 0 0 auto; }
.hud-brand { font-family: var(--font-display); font-size: 20px; color: var(--blood-bright); letter-spacing: .06em; }
.hud-brand i { color: var(--bone-dim); font-size: 14px; }
.hud-run { display: flex; gap: 16px; align-items: center; flex: 1; flex-wrap: nowrap; white-space: nowrap; overflow: hidden; }
.hud-act { font-family: var(--font-display); font-size: 15px; }
.hud-souls { color: var(--gold); font-weight: 600; }
.hud-ash { color: var(--bone-dim); }
.hud-resolve { color: var(--blood-bright); letter-spacing: 3px; }
.hud-traits i { display: inline-block; background: var(--panel2); border: 1px solid var(--line); border-radius: 2px; padding: 1px 7px; margin-right: 5px; font-size: 11px; font-style: normal; color: var(--bone-dim); }
.hud-snd { display: flex; gap: 6px; align-items: center; }
.hud-snd input { width: 80px; accent-color: var(--blood); }

/* screens */
.screen { width: min(1060px, 96vw); margin: 0 auto; padding: 10px 12px 14px; flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.title-screen, .over-screen, .sanctum-screen, .event-screen, .start-screen { overflow-y: auto; }
.title-screen { text-align: center; padding-top: 10vh; }
.title-screen h1 { font-size: 64px; color: var(--blood-bright); text-shadow: 0 0 40px rgba(158, 36, 52, .5); }
.title-screen h1 i { color: var(--bone-dim); font-size: 36px; }
.tagline { margin: 16px 0 40px; font-size: 18px; font-style: italic; color: var(--bone-dim); }
.title-actions { display: flex; gap: 18px; justify-content: center; }
.credit { margin-top: 60px; color: #5c5164; font-size: 13px; }

.start-screen { text-align: center; }
.start-screen h2 { font-size: 34px; margin: 26px 0 6px; }
.offer-row { display: flex; gap: 22px; justify-content: center; margin-top: 26px; flex-wrap: wrap; }
.offer-row .card { cursor: pointer; }
.offer-row .card:hover { transform: translateY(-6px); }

/* cards */
.card { width: 300px; flex: 0 0 auto; transition: transform .15s; }
.card-frame { background: linear-gradient(180deg, #241826, #160e17); border: 1px solid #503a4a; border-radius: 7px; overflow: hidden; box-shadow: 0 4px 16px rgba(0,0,0,.55), inset 0 0 0 1px #0a060b; }
.aff-card .card-frame { border-color: var(--blood); box-shadow: 0 0 14px rgba(158,36,52,.35); }
.card.cant { opacity: .45; }
.card-name { display: flex; justify-content: space-between; align-items: center; padding: 8px 11px; font-family: var(--font-display); font-size: 17px; background: linear-gradient(180deg, #33202f, #241626); border-bottom: 1px solid var(--line); }
.cost { background: var(--gold); color: #16100a; border-radius: 50%; min-width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-family: var(--font-body); }
.cost.free { border-radius: 3px; background: var(--blood); color: #ffdfe2; padding: 0 6px; font-size: 11px; }
.card-art { position: relative; aspect-ratio: 520 / 775; overflow: hidden; background: #0a060b; }
.card-art img, .card-art video, .prep-tile img, .prep-tile video, .mini-art img, .mini-art video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
.aff-badge { position: absolute; top: 6px; right: 6px; font-size: 20px; filter: drop-shadow(0 0 6px #000); }
.aff-art img { object-fit: cover; filter: saturate(1.2) contrast(1.05); }
.shard-art { display: flex; align-items: center; justify-content: center; font-size: 64px; color: var(--gold); aspect-ratio: 832/1000; text-shadow: 0 0 30px var(--gold); }
.card-type { display: flex; justify-content: space-between; padding: 4px 9px; font-size: 11.5px; color: var(--bone-dim); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #1c1220; }
.pips { color: var(--gold); font-style: normal; letter-spacing: 1px; }
.card-text { padding: 7px 9px; min-height: 58px; }
.card-text .rule { font-size: 13.5px; line-height: 1.4; }
.card-text .techs { font-size: 11px; color: var(--shield); margin-top: 3px; }
.card-text .flavor { font-size: 11px; font-style: italic; color: #776c5f; margin-top: 4px; }
.card-stats { display: flex; gap: 6px; padding: 6px 9px 9px; }
.st { flex: 1; text-align: center; border-radius: 3px; padding: 3px 0; font-weight: 600; font-size: 14px; background: #241626; border: 1px solid var(--line); }
.st.atk { color: var(--blood-bright); } .st.hp { color: var(--heal); } .st.arm { color: var(--shield); } .st.init { color: var(--gold); }
.copies { text-align: center; font-size: 11px; color: var(--bone-dim); padding-bottom: 6px; }
.wounds { text-align: center; font-size: 11px; color: var(--blood-bright); padding-bottom: 6px; }

/* prep layout — one centered symmetric column */
.prep-screen { gap: 8px; }
.node-banner { border: 1px solid var(--line); border-top: 3px solid var(--blood); background: var(--panel); padding: 6px 14px; border-radius: 4px; text-align: center; flex: 0 0 auto; }
.node-banner b { font-family: var(--font-display); font-size: 17px; letter-spacing: .05em; }
.node-banner.boss b, .node-banner.finale b { color: var(--blood-bright); }
.node-banner .loc { margin-top: 1px; font-size: 12.5px; color: var(--bone-dim); }
.node-banner .loc i { color: var(--gold); font-style: normal; font-family: var(--font-display); }
#altloc { margin-top: 8px; }
.battlefield { background: radial-gradient(1000px 480px at 50% 45%, #221226 0%, #130b15 85%) center/cover; border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px 10px; display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; min-height: 0; justify-content: space-evenly; }
.bf-side { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.bf-side h3 { font-size: 12.5px; color: var(--bone-dim); }
.insider { color: var(--shadowc); font-size: 12px; font-style: normal; }
.bf-row { display: flex; gap: 10px; justify-content: center; min-height: 30px; }
.p-empty { color: #4a4152; align-self: center; }
.battle-line { width: 82%; height: 1px; background: linear-gradient(90deg, transparent, var(--blood), transparent); margin: 4px 0; position: relative; text-align: center; flex: 0 0 auto; }
.battle-line span { position: relative; top: -11px; background: #150d17; padding: 0 16px; color: #5c4a56; font-size: 11px; font-style: italic; letter-spacing: .3em; }
.slot { width: clamp(96px, 14vh, 160px); height: clamp(130px, 18.5vh, 215px); border: 1px dashed #4a3346; border-radius: 7px; background: rgba(30, 19, 32, .5); position: relative; }
.slot.sealed { border-color: #241a26; background: repeating-linear-gradient(45deg, #140d16, #140d16 6px, #1a1020 6px, #1a1020 12px); }
.slot.target { border-color: var(--gold); box-shadow: 0 0 12px rgba(176, 141, 63, .35); cursor: pointer; }
.bench { margin-top: 2px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: center; border-top: 1px dotted var(--line); padding-top: 12px; width: 82%; }
.bench b { font-size: 13px; color: var(--bone-dim); }
.prep-tile { width: clamp(92px, 13.5vh, 156px); height: clamp(126px, 18vh, 210px); border: 1px solid #503a4a; border-radius: 7px; background: linear-gradient(180deg, #241826, #160e17); cursor: pointer; position: relative; display: flex; align-items: flex-end; justify-content: center; overflow: hidden; box-shadow: 0 3px 10px rgba(0,0,0,.5); }

.prep-tile.selected { border-color: var(--gold); box-shadow: 0 0 14px rgba(176, 141, 63, .55); }
.prep-tile.anchored::after { content: "⚓"; position: absolute; top: 4px; left: 6px; font-size: 14px; }
.pt-lvl { position: absolute; top: 4px; right: 6px; color: var(--gold); font-size: 11px; font-style: normal; text-shadow: 0 0 4px #000; }
.pt-aff { position: absolute; bottom: 4px; left: 6px; font-size: 16px; font-style: normal; }
.fight-btn { margin-top: 4px; font-size: 20px; padding: 8px 44px; flex: 0 0 auto; }

/* mini cards — battle tiles and enemy preview */
.mini-card { width: clamp(92px, 13.5vh, 156px); border-radius: 7px; overflow: hidden; background: linear-gradient(180deg, #241826, #160e17); border: 1px solid #503a4a; box-shadow: 0 3px 10px rgba(0,0,0,.55); position: relative; }
.mini-card.enemy { border-color: #5a2430; }
.mini-name { display: flex; justify-content: space-between; align-items: center; padding: 3px 7px; font-family: var(--font-display); font-size: 11.5px; background: linear-gradient(180deg, #33202f, #241626); border-bottom: 1px solid var(--line); white-space: nowrap; overflow: hidden; }
.mini-name i { color: var(--gold); font-style: normal; font-size: 10px; }
.mini-art { position: relative; aspect-ratio: 832 / 940; display: flex; align-items: flex-end; justify-content: center; background: radial-gradient(circle at 50% 70%, #2c1b2e, #140c16); }
.mini-art.token img { max-height: 104%; max-width: 96%; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(0,0,0,.75)); }
.mini-art.painted img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; }
.pv-icon { position: absolute; top: 4px; right: 5px; font-size: 15px; font-style: normal; filter: drop-shadow(0 0 4px #000); }
.mini-stats { display: flex; justify-content: space-between; padding: 3px 8px 5px; background: #1c1220; border-top: 1px solid var(--line); font-size: 12px; }
.mini-stats b.ms-atk { color: var(--blood-bright); } .mini-stats b.ms-hp { color: var(--heal); }
.mini-stats span { color: var(--bone-dim); font-size: 11px; }

/* battle */
.battle-screen { gap: 6px; }
.battle-top { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.battle-top b { font-family: var(--font-display); font-size: 20px; }
.loc-mini { color: var(--bone-dim); font-size: 13px; flex: 1; }
.speed { display: flex; gap: 5px; margin-left: auto; }
.spd.on { border-color: var(--gold); color: var(--gold); }
.ribbon { flex: 0 0 auto; display: flex; gap: 6px; padding: 5px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 5px; min-height: 58px; overflow-x: auto; justify-content: center; }
.ribbon-chip { position: relative; width: clamp(30px, 4.4vh, 46px); height: clamp(30px, 4.4vh, 46px); border-radius: 50%; border: 2px solid var(--line); overflow: hidden; flex: 0 0 auto; background: #0a060b; }
.ribbon-chip.player { border-color: var(--shield); }
.ribbon-chip.enemy { border-color: var(--blood); }
.ribbon-chip.acted { opacity: .35; }
.ribbon-chip.dead { opacity: .18; filter: grayscale(1); }
.ribbon-chip img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; }
.ribbon-chip i { position: absolute; bottom: -1px; right: 2px; font-size: 9px; font-style: normal; color: var(--gold); text-shadow: 0 0 3px #000; }
.arena { position: relative; background: radial-gradient(1000px 420px at 50% 50%, #221226 0%, #120b14 82%); border: 1px solid var(--line); border-radius: 8px; padding: 22px 18px; }
.act-2 .arena { background: radial-gradient(1000px 420px at 50% 50%, #2a1512 0%, #120b14 82%); }
.act-3 .arena { background: radial-gradient(1000px 420px at 50% 50%, #101a24 0%, #0d0b14 82%); }
.act-4 .arena { background: radial-gradient(1000px 420px at 50% 50%, #24101f 0%, #0f0a12 82%); }
.act-5 .arena { background: radial-gradient(1000px 420px at 50% 50%, #260d0d 0%, #0d0a10 82%); }
.a-row { display: flex; gap: 12px; justify-content: center; min-height: 4vh; margin: 2px 0; }
.arena .mini-card, .tile-unit { width: clamp(92px, 13.5vh, 172px); }
.arena .mini-name { font-size: clamp(9px, 1.35vh, 13px); padding: 4px 8px; }
.arena .mini-stats { font-size: clamp(11px, 1.6vh, 15px); padding: 3px 9px 5px; }
.arena .tile-hp { height: 9px; }
.battle-main { flex: 1; min-height: 0; position: relative; display: flex; }
.battle-main .arena { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: space-evenly; }
.battle-main .battle-log { position: absolute; right: 0; top: 0; bottom: 0; width: 250px; overflow-y: auto; background: rgba(23,16,25,.92); border: 1px solid var(--line); border-radius: 5px; font-size: 11px; }
.tile-lvl { font-style: normal; }
.tile-shield { position: absolute; top: 4px; left: 5px; color: var(--shield); font-size: 12px; font-style: normal; text-shadow: 0 0 4px #000; }
.tile-status { position: absolute; bottom: 4px; left: 5px; font-size: 11px; font-style: normal; text-shadow: 0 0 4px #000; }
.tile-hp { height: 7px; background: #241322; overflow: hidden; border-top: 1px solid #000; border-bottom: 1px solid #000; }
.tile-hp i { display: block; height: 100%; background: linear-gradient(90deg, var(--blood-bright), #e0788a); transition: width .25s; }
.tile-unit.player .tile-hp i { background: linear-gradient(90deg, #3f9e63, var(--heal)); }
.battle-log { max-height: 150px; overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 5px; padding: 8px 14px; font-size: 12.5px; }
.bl { padding: 1px 0; color: var(--bone-dim); }
.bl-round { color: var(--gold); font-family: var(--font-display); border-top: 1px dotted var(--line); margin-top: 3px; }
.bl-damage { color: #cf8a95; } .bl-heal { color: var(--heal); } .bl-death { color: var(--blood-bright); }
.bl-ability, .bl-gift { color: var(--shadowc); } .bl-transform { color: var(--fire); }
.impact { position: fixed; z-index: 82; width: 80px; height: 80px; border-radius: 50%; pointer-events: none; background: radial-gradient(circle, #fff 0%, #ffd27f 30%, transparent 70%); mix-blend-mode: screen; }
.impact-fire { background: radial-gradient(circle, #fff 0%, var(--fire) 35%, transparent 70%); }
.impact-shadow { background: radial-gradient(circle, #e8d5ff 0%, var(--shadowc) 35%, transparent 70%); }
.impact-poison { background: radial-gradient(circle, #eaffd0 0%, var(--poison) 35%, transparent 70%); }
.impact-big { width: 150px; height: 150px; }
.slashfx { position: fixed; z-index: 83; width: 90px; height: 6px; border-radius: 3px; background: linear-gradient(90deg, transparent, #fff, transparent); pointer-events: none; box-shadow: 0 0 14px rgba(255,255,255,.8); }
.castring { position: fixed; z-index: 81; width: 120px; height: 120px; border-radius: 50%; border: 3px solid var(--shadowc); pointer-events: none; box-shadow: 0 0 26px var(--shadowc), inset 0 0 20px var(--shadowc); }

/* carousel & mgmt */
.carousel { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; text-align: center; flex: 0 0 auto; }
.carousel h3 { font-size: 14px; margin-bottom: 6px; }
.shop-row { display: flex; gap: 8px; overflow: visible; padding-bottom: 4px; justify-content: center; }
.shop-row .card { width: clamp(120px, 15.5vh, 170px); cursor: pointer; flex: 0 1 auto; font-size: 12px; }
.shop-row .card .flavor, .shop-row .card .copies { display: none; }
.shop-row .card .card-text { min-height: 0; max-height: 76px; overflow: hidden; }
.shop-row .card .card-name { font-size: 12.5px; padding: 4px 7px; }
.shop-row .card .rule { font-size: 10.5px; }
.shop-row .card:hover { transform: translateY(-5px); }
.shop-slot.selected .card-frame { outline: 2px solid var(--blood-bright); }
.shop-actions { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; justify-content: center; }
.shop-actions button { font-size: 12px; padding: 4px 10px; }
.mgmt { position: fixed; right: 16px; bottom: 60px; width: 400px; max-height: 60vh; overflow-y: auto; z-index: 70; background: var(--panel); border: 1px solid var(--blood); border-radius: 6px; padding: 12px 16px; box-shadow: 0 12px 44px rgba(0,0,0,.7); }
.mgmt.hidden { display: none; }
.mgmt-toggle { position: fixed; right: 16px; bottom: 18px; z-index: 70; }
.mgmt-grid { grid-template-columns: 1fr !important; }
.mgmt h3 { font-size: 15px; margin-bottom: 6px; text-align: center; }
.mgmt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 2px 26px; }
.mgmt-row { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px; border-bottom: 1px dotted #2c1f2e; font-size: 13.5px; cursor: pointer; }
.mgmt-row:hover { background: var(--panel2); }
.mgmt-row .aff { color: var(--blood-bright); font-size: 11px; }
.mgmt-row .wnd { color: var(--blood); font-size: 11px; }
.mgmt-row i { font-style: normal; color: var(--bone-dim); }

.proj { position: fixed; width: 16px; height: 16px; border-radius: 50%; z-index: 80; pointer-events: none; }
.proj-bolt { background: #cfd6ff; box-shadow: 0 0 10px #cfd6ff; }
.proj-fire { background: var(--fire); box-shadow: 0 0 12px var(--fire); }
.proj-holy { background: #ffeaa0; box-shadow: 0 0 12px #ffeaa0; }
.floatnum { position: fixed; z-index: 85; font-weight: 700; font-size: 26px; font-family: var(--font-display); pointer-events: none; transform: translateX(-50%); text-shadow: 0 0 8px #000, 0 2px 4px #000; }
.fn-physical, .fn-shadow { color: #f0c0c8; } .fn-fire { color: var(--fire); } .fn-poison { color: var(--poison); }
.fn-heal { color: var(--heal); } .fn-buff { color: var(--gold); } .fn-debuff { color: var(--shadowc); } .fn-holy { color: #ffeaa0; }
.battle-banner { position: fixed; top: 42%; left: 50%; transform: translate(-50%, -50%); z-index: 90; font-family: var(--font-display); font-size: 58px; color: var(--blood-bright); text-shadow: 0 0 30px rgba(158,36,52,.8), 0 2px 4px #000; pointer-events: none; white-space: nowrap; }

/* modals */
.modal-back { position: fixed; inset: 0; background: rgba(8, 4, 10, .8); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal { background: var(--panel); border: 1px solid var(--blood); border-radius: 6px; padding: 28px 34px; max-width: 560px; text-align: center; box-shadow: 0 0 60px rgba(158, 36, 52, .3); }
.modal h2, .modal h3 { margin-bottom: 12px; }
.modal button { margin: 8px 6px 0; display: inline-block; }
.modal .tech-pick { display: block; width: 100%; margin: 8px 0; font-size: 15px; text-align: left; }
.outcome.won h2 { color: var(--heal); } .outcome.lost h2 { color: var(--blood-bright); }
.wounds-note { color: var(--blood-bright); font-size: 13px; margin-top: 6px; }

/* sanctum / event / over */
.sanctum-screen, .event-screen { text-align: center; padding-top: 40px; }
.sanctum-screen h2 { font-size: 34px; }
.sanctum-choices { display: flex; gap: 18px; justify-content: center; margin: 30px 0; }
.sanctum-choices .big i { display: block; font-size: 12px; color: var(--bone-dim); margin-top: 5px; }
.event-screen .modal { margin: 0 auto; }
.over-screen { text-align: center; padding-top: 14vh; }
.over-screen h1 { font-size: 52px; }
.over-screen.won h1 { color: var(--heal); } .over-screen.lost h1 { color: var(--blood-bright); }
.over-screen p { max-width: 560px; margin: 18px auto; font-size: 17px; }
.ledger { color: var(--bone-dim); font-size: 13.5px !important; }

#flash { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); background: var(--panel2); border: 1px solid var(--gold); color: var(--bone); padding: 9px 20px; border-radius: 4px; opacity: 0; transition: opacity .25s; z-index: 120; pointer-events: none; font-size: 14px; }
#flash.on { opacity: 1; }

@media (max-width: 1180px) { .arena .mini-card, .tile-unit, .slot, .prep-tile, .mini-card { width: 150px; } .slot, .prep-tile { height: 200px; } }

/* drag & drop */
.prep-tile.dragging { opacity: .45; transform: scale(.96); }
@keyframes dropPulse {
  0%, 100% { border-color: var(--gold); box-shadow: 0 0 10px rgba(176,141,63,.25), inset 0 0 12px rgba(176,141,63,.12); }
  50% { border-color: #ffd985; box-shadow: 0 0 26px rgba(255,217,133,.55), inset 0 0 22px rgba(176,141,63,.3); }
}
.slot.droppable, .bench.droppable { animation: dropPulse 1.1s ease-in-out infinite; border-style: solid; }
.slot.dragover, .bench.dragover { animation: none; border-color: var(--heal); box-shadow: 0 0 30px rgba(127,220,154,.6), inset 0 0 24px rgba(127,220,154,.25); }
.slot.target { animation: dropPulse 1.1s ease-in-out infinite; }

img { -webkit-user-drag: none; user-select: none; }
.shop-slot[draggable=true] { cursor: grab; }
.shop-slot.dragging { opacity: .5; }
.mgmt-row.droppable, .prep-tile.droppable { animation: dropPulse 1.1s ease-in-out infinite; border: 1px solid var(--gold); }
.mgmt-row.dragover, .prep-tile.dragover { animation: none; border-color: var(--heal); box-shadow: 0 0 22px rgba(127,220,154,.55); }

/* juice */
.spark { position: fixed; z-index: 84; width: 7px; height: 7px; border-radius: 50%; pointer-events: none; box-shadow: 0 0 8px currentColor; }
@keyframes statPop { 0% { transform: scale(1); } 40% { transform: scale(1.6); } 100% { transform: scale(1); } }
.mini-stats b.stat-pop { display: inline-block; animation: statPop .35s ease-out; }
.mini-stats b.ms-hp.hurt { color: var(--blood-bright); }

.proj-arrow { width: 26px; height: 4px; border-radius: 2px; background: linear-gradient(90deg, transparent, #e8dcc0 40%, #fff); box-shadow: 0 0 8px rgba(232,220,192,.8); }
.proj-shadow { background: var(--shadowc); box-shadow: 0 0 14px var(--shadowc); }

/* celebration */
.celebrate-back { background: rgba(6,3,8,.88); }
.celebrate { text-align: center; position: relative; }
.celebrate h2 { font-family: var(--font-display); font-size: 44px; color: #ffd985; text-shadow: 0 0 40px rgba(255,217,133,.6); margin-bottom: 16px; }
.celebrate-card { position: relative; width: min(340px, 40vh); margin: 0 auto; border: 2px solid var(--gold); border-radius: 10px; overflow: hidden; box-shadow: 0 0 60px rgba(255,217,133,.45); animation: celebrateIn .5s cubic-bezier(.2,1.4,.4,1); }
.celebrate-card { aspect-ratio: 2 / 3; }
.celebrate-card img, .celebrate-card video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.celebrate-pips { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); color: var(--gold); font-size: 22px; font-style: normal; text-shadow: 0 0 8px #000; }
@keyframes celebrateIn { 0% { transform: scale(.5) rotate(-4deg); opacity: 0; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
.celebrate p { margin-top: 12px; color: var(--bone); }


/* hover tooltip */
#hovertip { position: fixed; z-index: 130; max-width: 320px; background: linear-gradient(180deg, #241826, #150d17); border: 1px solid var(--gold); border-radius: 6px; padding: 10px 13px; font-size: 12.5px; line-height: 1.45; pointer-events: none; opacity: 0; transition: opacity .12s; box-shadow: 0 10px 34px rgba(0,0,0,.75); }
#hovertip.on { opacity: 1; }
#hovertip b { font-family: var(--font-display); font-size: 14px; color: #ffd985; }
#hovertip i { display: block; color: var(--bone-dim); font-size: 11px; margin: 2px 0 6px; text-transform: capitalize; }
#hovertip p { margin: 0 0 5px; }
#hovertip .tip-aff { color: var(--blood-bright); }
#hovertip .tip-stats { color: var(--bone-dim); font-size: 12px; }

/* side-by-side battlefield — heroes left, enemies right */
.bf-columns { flex: 1; min-height: 0; width: 100%; display: grid; grid-template-columns: 1fr 1fr 26px 1fr 1fr; gap: 10px; align-items: stretch; justify-items: center; }
.bf-stack, .a-col { display: flex; flex-direction: column; gap: 8px; justify-content: center; align-items: center; min-width: 0; }
.stack-label { font-size: 10px; letter-spacing: .2em; color: #5c4a56; font-style: italic; text-transform: uppercase; }
.battle-line-v { width: 1px; height: 92%; align-self: center; background: linear-gradient(180deg, transparent, var(--blood), transparent); position: relative; }
.battle-line-v span { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%) rotate(90deg); background: transparent; padding: 0 10px; color: #5c4a56; font-size: 10px; font-style: italic; letter-spacing: .3em; white-space: nowrap; }
.bf-foot { display: flex; align-items: center; gap: 18px; justify-content: center; width: 100%; flex: 0 0 auto; flex-wrap: wrap; }
.bf-foot .bench { margin: 0; border: 0; padding: 0; width: auto; }
.arena { display: grid !important; grid-template-columns: 1fr 1fr 26px 1fr 1fr; gap: 10px; justify-items: center; align-items: center; }
.arena .battle-line-v { height: 92%; }
/* enemies face the heroes on their left — per-painting: only right-facing art flips */
.is-enemy .mini-art img:not(.noflip), .mini-card.pv .mini-art img:not(.noflip) { transform: scaleX(-1); }
/* stacks size cards down when tall */
.bf-stack .slot, .a-col .mini-card { max-height: 21vh; }

/* combat effect notifications */
#fx-toasts { position: fixed; top: 96px; left: 50%; transform: translateX(-50%); z-index: 95; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; }
.fx-toast { display: flex; align-items: center; gap: 9px; background: linear-gradient(180deg, rgba(36,24,38,.96), rgba(21,13,23,.96)); border: 1px solid var(--line); border-left: 3px solid var(--gold); border-radius: 5px; padding: 6px 16px; font-size: 13.5px; box-shadow: 0 6px 24px rgba(0,0,0,.6); max-width: 560px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-toast i { font-style: normal; font-size: 15px; }
.fx-toast span { overflow: hidden; text-overflow: ellipsis; }
.t-ability { border-left-color: var(--shadowc); } .t-fire { border-left-color: var(--fire); }
.t-poison { border-left-color: var(--poison); } .t-heal { border-left-color: var(--heal); }
.t-shield { border-left-color: var(--shield); } .t-dark { border-left-color: var(--blood-bright); }
.t-debuff { border-left-color: #8a7f92; } .t-kill { border-left-color: var(--blood-bright); }
.t-undying { border-left-color: var(--poison); } .t-summon { border-left-color: var(--gold); }
.t-wild { border-left-color: #c8c2ff; } .t-buff { border-left-color: var(--gold); }

.offer-row .card { width: min(300px, 34vh * 0.67); }

/* living painting — enemies breathe like the hero clips do */
@keyframes kenburns {
  0% { transform: scale(1) translate(0, 0); filter: brightness(1); }
  35% { transform: scale(1.10) translate(-1.5%, -2%); filter: brightness(1.12); }
  70% { transform: scale(1.07) translate(1.5%, -1%); filter: brightness(1.06); }
  100% { transform: scale(1) translate(0, 0); filter: brightness(1); }
}
.mini-art img.kenburns, .prep-tile img.kenburns, .card-art img.kenburns { animation: kenburns 3s ease-in-out; }
.is-enemy .mini-art img.kenburns:not(.noflip) { animation: kenburnsFlip 3s ease-in-out; }
@keyframes kenburnsFlip {
  0% { transform: scaleX(-1) scale(1); filter: brightness(1); }
  35% { transform: scaleX(-1) scale(1.10) translate(1.5%, -2%); filter: brightness(1.12); }
  70% { transform: scaleX(-1) scale(1.07) translate(-1.5%, -1%); filter: brightness(1.06); }
  100% { transform: scaleX(-1) scale(1); filter: brightness(1); }
}

.lockbtn { position: absolute; top: -8px; left: -8px; z-index: 5; font-size: 13px; padding: 2px 6px; border-radius: 50%; }
.shop-slot { position: relative; }
.shop-slot.locked .card-frame { outline: 2px solid var(--gold); }
