/* ============================================================
   FEATURE CSS: BOSS FIGHT
   Colours, fonts and corners come from the active theme. The boss's own
   colour arrives as --boss on the hero card.
   ============================================================ */

.boss-page { gap: var(--s-4); }

/* ── The boss ─────────────────────────────────────────────── */
.boss-hero {
  position: relative; overflow: hidden; padding: var(--s-5) var(--s-5) var(--s-4);
  border-color: color-mix(in srgb, var(--boss, var(--accent)) 45%, var(--rim));
  background:
    radial-gradient(120% 90% at 85% 0%, color-mix(in srgb, var(--boss, var(--accent)) 22%, transparent), transparent 60%),
    var(--surface);
}
.boss-mark {
  position: absolute; right: var(--s-4); top: var(--s-3); font-size: 4.6rem; line-height: 1;
  filter: drop-shadow(0 0 18px color-mix(in srgb, var(--boss, var(--accent)) 60%, transparent));
  animation: boss-float 4s ease-in-out infinite;
}
.boss-hero.is-hit .boss-mark { animation: boss-hit 0.4s ease-out; }
.boss-hero.is-dead .boss-mark { animation: none; filter: grayscale(1) opacity(0.45); }
@keyframes boss-float { 50% { transform: translateY(-5px) rotate(-2deg); } }
@keyframes boss-hit { 0% { transform: translateX(0); } 25% { transform: translateX(-7px) rotate(-6deg); } 60% { transform: translateX(5px) rotate(4deg); } 100% { transform: translateX(0); } }

.boss-name { margin: 2px 0 0; padding-right: 5rem; font-size: calc(1.7rem * var(--display-scale, 1)); line-height: 1.05; }
.boss-title { margin: 4px 0 var(--s-4); padding-right: 5rem; color: var(--text-dim); font-size: 0.8rem; }

.boss-hp { height: 12px; border-radius: var(--r-pill); background: color-mix(in srgb, var(--text) 10%, transparent); overflow: hidden; border: var(--border-w) solid var(--rim); }
.boss-hp-fill {
  height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--boss, var(--accent)), color-mix(in srgb, var(--boss, var(--accent)) 55%, #fff));
  box-shadow: 0 0 12px color-mix(in srgb, var(--boss, var(--accent)) 70%, transparent);
  transition: width 0.7s var(--ease, ease-out);
}
.boss-hp-meta { display: flex; justify-content: space-between; gap: var(--s-2); margin-top: 6px; font-size: 0.7rem; color: var(--text-dimmer); }

/* ── Brief / lore / facts ─────────────────────────────────── */
.boss-brief { padding: var(--s-4); display: grid; gap: var(--s-3); }
.boss-brief .section-label { margin: 0; }
.boss-lore { margin: 0; color: var(--text-dim); font-size: 0.86rem; line-height: 1.5; }
.boss-how { margin: 0; color: var(--text-dimmer); font-size: 0.74rem; line-height: 1.5; }
.boss-how b { color: var(--text); }
.boss-facts { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-2); }
.boss-facts li { padding: var(--s-3) var(--s-2); border: var(--border-w) solid var(--rim); border-radius: var(--r-md); text-align: center; }
.boss-facts b { display: block; font-size: 0.92rem; color: var(--text); font-variant-numeric: tabular-nums; }
.boss-facts span { display: block; margin-top: 2px; font-size: 0.64rem; color: var(--text-dimmer); }
.boss-go { width: 100%; }

.boss-won { text-align: center; }
.boss-won-xp { margin: 0; font-family: var(--font-display, inherit); font-weight: var(--display-weight, 700); font-size: calc(2.2rem * var(--display-scale, 1)); color: var(--support); }

/* ── Kill record ──────────────────────────────────────────── */
.boss-kills { padding: var(--s-4); }
.boss-kills .section-label { margin: 0 0 var(--s-2); }
.boss-kills ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.boss-kills li { display: flex; align-items: baseline; gap: var(--s-2); padding: 6px 0; font-size: 0.8rem; border-top: var(--border-w) solid var(--rim); }
.boss-kills li:first-child { border-top: 0; }
.boss-kills li span { flex: 1; color: var(--text); }
.boss-kills li small { color: var(--text-dimmer); }
.boss-kills li b { color: var(--support); font-variant-numeric: tabular-nums; }

/* ── Summoning + loading ──────────────────────────────────── */
.boss-summoning { display: flex; align-items: center; justify-content: center; gap: 10px; }
.boss-spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--rim-strong); border-top-color: var(--accent); animation: boss-spin 0.8s linear infinite; }
@keyframes boss-spin { to { transform: rotate(360deg); } }
.boss-retry { align-self: center; }
.boss-skeleton { display: grid; gap: var(--s-3); padding: var(--s-5); }
.boss-sk { border-radius: var(--r-md); background: color-mix(in srgb, var(--text) 7%, transparent); animation: boss-pulse 1.3s ease-in-out infinite; }
.boss-sk-hero { height: 170px; } .boss-sk-body { height: 210px; }
@keyframes boss-pulse { 50% { opacity: 0.5; } }

/* ── Victory ──────────────────────────────────────────────── */
.boss-victory {
  position: fixed; inset: 0; z-index: 400; display: grid; place-items: center; padding: var(--s-5);
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--boss, var(--accent)) 28%, #000), #000 75%);
  animation: boss-fade 0.4s ease-out;
}
.boss-victory-in { display: grid; justify-items: center; gap: var(--s-3); text-align: center; }
.boss-victory-mark { font-size: 5rem; filter: grayscale(1) opacity(0.5); animation: boss-fall 0.9s ease-in both; }
.boss-victory-kicker { margin: 0; letter-spacing: 0.3em; text-transform: uppercase; font-size: 0.72rem; color: var(--boss, var(--accent)); }
.boss-victory-name { margin: 0; font-size: calc(1.5rem * var(--display-scale, 1)); color: var(--text); }
.boss-victory-xp { margin: var(--s-2) 0; font-family: var(--font-display, inherit); font-weight: var(--display-weight, 700); font-size: calc(3rem * var(--display-scale, 1)); color: var(--support); animation: boss-pop 0.6s 0.4s var(--ease, ease-out) both; }
@keyframes boss-fade { from { opacity: 0; } }
@keyframes boss-fall { from { transform: translateY(-24px) scale(1.25); filter: none; } }
@keyframes boss-pop { from { transform: scale(0.5); opacity: 0; } }

:root[data-motion="off"] .boss-page *, :root[data-motion="reduced"] .boss-page *,
:root[data-motion="off"] .boss-victory *, :root[data-motion="reduced"] .boss-victory * { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) {
  .boss-mark, .boss-hero.is-hit .boss-mark, .boss-spin, .boss-sk, .boss-victory, .boss-victory-mark, .boss-victory-xp { animation: none; }
  .boss-hp-fill { transition: none; }
}
