/* Glory cosmetics share the original sprite atlas. No combat values are changed. */
.bf-title{display:inline-block;vertical-align:baseline;font:inherit;font-weight:700;color:var(--title-color,#ffe08b);padding:0 4px;margin-right:4px;border:1px solid color-mix(in srgb,var(--title-color) 55%,transparent);border-radius:3px;background:#122619e8;text-shadow:0 0 8px color-mix(in srgb,var(--title-color) 40%,transparent);white-space:normal;overflow-wrap:anywhere}
.bf-title-preview{display:flex;justify-content:center;align-items:center;flex-wrap:wrap;gap:4px;min-height:80px;font-size:13px!important;color:#f1e5be!important}
[data-glory-title]:not([data-glory-title=""]):before{content:attr(data-glory-title);display:inline-block;color:var(--title-color);font-size:.85em;border:1px solid var(--title-color);padding:0 4px;margin-right:5px;border-radius:3px;text-shadow:0 0 7px var(--title-color)}
.bf-party small .bf-title{font-size:9px;white-space:nowrap;padding:0 2px}.bf-summary .bf-title{font-size:10px}
.bf-glory-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:18px}.bf-glory-item{min-width:0;display:flex;flex-direction:column;padding:13px;border:1px solid #8d8053;background:linear-gradient(150deg,#213b2c,#10231b);border-radius:7px;overflow:hidden;content-visibility:auto;contain-intrinsic-size:auto 310px}.bf-glory-item-head{display:flex;justify-content:space-between;gap:6px;font-size:10px;color:#ccc399}.bf-glory-item-head .earned{color:#b8efb2}.bf-glory-item h3{margin:7px 0;color:#f1dda2;font-size:16px;overflow-wrap:anywhere}.bf-glory-item p{font-size:12px;color:#c8ccae;margin:5px 0 12px;white-space:pre-wrap;overflow-wrap:anywhere;flex:1}.bf-glory-item>small{font-size:11px;color:#dccc9b;overflow-wrap:anywhere}.bf-glory-item .bf-lobby-links{margin-top:10px}.bf-glory-item button{margin:0;font-size:11px;padding:5px 9px;flex:1}.bf-glory-item .bf-troop-preview{margin:4px auto 10px}.bf-glory-notice{padding:9px;border:1px solid #8ba87a;background:#2c4b30;color:#e2f3be}.bf-glory-tabs{position:sticky;top:-14px;z-index:5;background:#1c3225;padding:6px 0}.bf-glory-tabs button{margin:0;flex:1;font-size:12px;padding:5px}.bf-glory .bf-result-stats{grid-template-columns:repeat(2,minmax(0,1fr))}
.bf-glory-editor form{display:grid;gap:14px}.bf-glory-editor label{display:flex;flex-direction:column;gap:5px;font-size:13px;color:#f2e4b9}.bf-glory-editor input,.bf-glory-editor textarea,.bf-glory-editor select{box-sizing:border-box;min-width:0;width:100%;max-width:100%;font:inherit;font-size:14px;line-height:1.5;padding:9px;color:#f5e9c7;background:#0b2118;border:1px solid #8d8057;border-radius:4px}.bf-glory-editor textarea{resize:vertical}.bf-glory-editor fieldset{min-width:0;margin:0;padding:12px;border:1px solid #8d8057}.bf-glory-editor legend{color:#ead18f}.bf-glory-editor p{font-size:12px;color:#c7caac}.bf-glory-rules{display:grid;gap:9px}.bf-glory-rule{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(0,1fr) minmax(0,.8fr) 34px;gap:5px;align-items:end;padding-bottom:9px;border-bottom:1px solid #77815b55}.bf-glory-rule label{font-size:11px}.bf-glory-rule input,.bf-glory-rule select{font-size:12px;padding:8px 3px;min-height:40px}.bf-glory-rule button{margin:0;width:34px;padding:3px;font-size:20px}.bf-glory-filters{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin-top:12px}.bf-glory-filters select{font-size:12px;padding:7px 3px}.bf-glory-editor .bf-glory-check{flex-direction:row;align-items:center}.bf-glory-check input{width:20px;height:20px;flex:none;accent-color:#d7b966}.bf-glory-form-error{padding:10px;background:#6b2d27;color:#ffdbb8!important;border:1px solid #b77c5d}.bf-glory-form-error[hidden]{display:none}
.bf-reward{min-width:0}.bf-reward.title>span{border:0}.bf-reward .bf-title-preview{font-size:12px}.bf-reward h3{overflow-wrap:anywhere}.bf-preview strong{overflow-wrap:anywhere}.bf-reward>.bf-effect-preview{font-size:inherit}
/* All eight skins use the same original march-units-v04 atlas and walking cycle. */
.bf-party[data-troop] .bf-soldier,.bf-troop-preview[data-troop] .bf-soldier{filter:var(--skin-filter,none) drop-shadow(0 0 3px var(--skin-glow,transparent)) drop-shadow(1px 3px 2px #07180baa)}
.bf-party[data-troop=violet-riders] .bf-soldier,.bf-party[data-troop=aurora-riders] .bf-soldier{width:60px;height:60px;top:calc(var(--unit-y,0px) - 7px)}
.bf-troop-preview[data-troop=violet-riders] .bf-soldier,.bf-troop-preview[data-troop=aurora-riders] .bf-soldier{width:60px;height:60px;top:calc(12px + var(--unit-y,0px))}
.bf-party[data-troop=prismatic-guard] .bf-soldier,.bf-troop-preview[data-troop=prismatic-guard] .bf-soldier{animation:bf-march .8s steps(3) infinite,bf-prismatic 4s linear infinite}
.bf-party[data-troop=aurora-riders] .bf-soldier,.bf-troop-preview[data-troop=aurora-riders] .bf-soldier{animation:bf-march .8s steps(3) infinite,bf-aurora 3s ease-in-out infinite}
@keyframes bf-prismatic{0%,100%{filter:sepia(.8) saturate(2.8) hue-rotate(0deg) brightness(1.3) drop-shadow(0 0 4px #ffd48b)}50%{filter:sepia(.8) saturate(2.8) hue-rotate(180deg) brightness(1.3) drop-shadow(0 0 5px #c699ff)}}
@keyframes bf-aurora{0%,100%{filter:sepia(.8) saturate(2.6) hue-rotate(125deg) brightness(1.3) drop-shadow(0 0 4px #87ffe5)}50%{filter:sepia(.8) saturate(2.6) hue-rotate(245deg) brightness(1.5) drop-shadow(0 0 6px #dc8fff)}}
/* The effect stays mounted on the moving party for both outbound and return travel. */
.bf-effect-preview{display:block!important;position:relative;width:132px;height:126px;margin:0 auto;padding:0!important;isolation:isolate;pointer-events:none}
.bf-effect-preview>.bf-soldier{left:42px;top:49px;z-index:2}.bf-effect-preview>.bf-march-fx{left:10px;top:4px}
.bf-march-fx{display:block;position:absolute;width:112px;height:112px;left:-32px;top:-42px;z-index:-1;pointer-events:none;--fx:#ff8a36;--fx-core:#fff5b7;filter:drop-shadow(0 0 5px var(--fx));isolation:isolate}
.bf-fx-ring{position:absolute;left:8px;right:8px;bottom:12px;height:26px;border:2px solid var(--fx);border-radius:50%;box-shadow:0 0 12px var(--fx),inset 0 0 8px var(--fx);animation:bf-fx-pulse 1.4s ease-in-out infinite}
.bf-fx-particle{position:absolute;left:calc(8px + var(--p)*12px);top:67px;width:18px;height:34px;border-radius:70% 20% 65% 35%;background:linear-gradient(0deg,transparent,var(--fx) 40%,var(--fx-core));transform-origin:center bottom;animation:bf-fire-rise 1.25s ease-out var(--delay) infinite;mix-blend-mode:screen}
.bf-fx-bolts{display:none;position:absolute;inset:0;width:100%;height:100%;overflow:visible;fill:none;stroke:var(--fx-core);stroke-width:2;stroke-linecap:round;stroke-linejoin:round;filter:drop-shadow(0 0 4px var(--fx))}
.bf-fx-flames{display:none;position:absolute;inset:0;width:100%;height:100%;overflow:visible;fill:var(--fx);opacity:.65;transform-origin:50% 85%;animation:bf-flame-surge .9s ease-in-out infinite alternate}.bf-march-fx[data-fx=flame] .bf-fx-flames,.bf-march-fx[data-fx=nether] .bf-fx-flames{display:block}.bf-fx-flames path+path{fill:var(--fx-core);opacity:.55;transform-origin:50% 85%;animation:bf-flame-surge .6s ease-in-out -.2s infinite alternate}
@keyframes bf-flame-surge{0%{transform:scale(.88,.7) skewX(-7deg);opacity:.45}100%{transform:scale(1.03,1.1) skewX(5deg);opacity:.8}}
.bf-march-fx[data-fx=lightning]{--fx:#65baff;--fx-core:#dbfaff}.bf-march-fx[data-fx=nether]{--fx:#a45cff;--fx-core:#ffc6ff}
.bf-march-fx[data-fx=lightning] .bf-fx-bolts,.bf-march-fx[data-fx=nether] .bf-fx-bolts{display:block;stroke-dasharray:140 65;animation:bf-lightning .65s linear infinite}
.bf-march-fx[data-fx=lightning] .bf-fx-bolts path+path,.bf-march-fx[data-fx=nether] .bf-fx-bolts path+path{stroke:var(--fx);stroke-width:3;animation:bf-lightning .9s linear -.3s infinite}
.bf-march-fx[data-fx=lightning] .bf-fx-particle{width:4px;height:14px;border-radius:1px;animation:bf-electric-spark 1s linear var(--delay) infinite}
.bf-march-fx[data-fx=nether] .bf-fx-particle{width:13px;height:26px;animation-duration:1.7s}
.bf-march-fx[data-fx=nether] .bf-fx-ring{border-style:dashed;animation:bf-fx-pulse 1.8s ease-in-out infinite}
.bf-march-fx[data-fx=astral]{--fx:#e7b74f;--fx-core:#fffbd3}.bf-march-fx[data-fx=astral] .bf-fx-ring{height:65px;bottom:13px;transform:rotate(-25deg);border-width:1px 3px;animation:bf-star-ring 3s linear infinite}
.bf-march-fx[data-fx=astral] .bf-fx-particle{width:12px;height:12px;clip-path:polygon(50% 0,60% 37%,100% 50%,60% 62%,50% 100%,39% 62%,0 50%,39% 38%);background:var(--fx-core);animation:bf-star-fly 1.7s ease-out var(--delay) infinite}
@keyframes bf-fire-rise{0%{opacity:0;transform:translate(0,12px) rotate(-15deg) scale(.3)}20%{opacity:.9}65%{opacity:.75;transform:translate(calc((var(--p) - 3.5)*2px),-25px) rotate(15deg) scale(.85)}100%{opacity:0;transform:translate(calc((var(--p) - 3.5)*4px),-55px) rotate(-20deg) scale(.15)}}
@keyframes bf-fx-pulse{0%,100%{opacity:.45;scale:.85}50%{opacity:.95;scale:1.08}}
@keyframes bf-lightning{0%,100%{opacity:.2;stroke-dashoffset:0}15%,45%{opacity:1}30%,60%{opacity:.1}85%{opacity:1;stroke-dashoffset:-205}}
@keyframes bf-electric-spark{0%{opacity:0;transform:translate(0,8px) rotate(-30deg)}25%{opacity:1}100%{opacity:0;transform:translate(calc((var(--p) - 3.5)*6px),-55px) rotate(40deg)}}
@keyframes bf-star-ring{0%{opacity:.6;transform:rotate(-25deg) scaleX(.7)}50%{opacity:1;transform:rotate(155deg) scaleX(1)}100%{opacity:.6;transform:rotate(335deg) scaleX(.7)}}
@keyframes bf-star-fly{0%{opacity:0;transform:translate(0,10px) rotate(0deg) scale(.3)}25%{opacity:1}100%{opacity:0;transform:translate(calc((var(--p) - 3.5)*7px),-65px) rotate(180deg) scale(.8)}}
@media(max-width:480px){.bf-glory-grid{gap:8px}.bf-glory-item{padding:9px}.bf-glory-item-head{flex-wrap:wrap;gap:1px}.bf-glory-item .bf-lobby-links{flex-direction:column}.bf-glory-item h3{font-size:14px}.bf-glory-item .bf-title-preview{font-size:11px!important}.bf-glory-item .bf-effect-preview{transform:scale(.9);transform-origin:center}.bf-glory-editor fieldset{padding:8px}.bf-glory-filters{grid-template-columns:1fr}.bf-glory-filters label{flex-direction:row;align-items:center;justify-content:space-between}.bf-glory-filters select{width:65%}}
@media(prefers-reduced-motion:reduce){.bf-march-fx *{animation:none!important}.bf-fx-particle{opacity:.6;transform:translateY(-12px) scale(.65)}.bf-fx-bolts{stroke-dasharray:none;opacity:.8}.bf-party[data-troop] .bf-soldier,.bf-troop-preview[data-troop] .bf-soldier{animation:none}}

/* Single cavalry sprites are 60px wide; center previews independently of the 48px march anchor. */
.bf-troop-preview[data-troop=ember-riders] .bf-soldier,.bf-troop-preview[data-troop=violet-riders] .bf-soldier,.bf-troop-preview[data-troop=aurora-riders] .bf-soldier{left:26px}

/* Cavalry occupies atlas y=448..730 / 730..1012 rather than the nominal 256px row.
   Keep the full helmet, lance and hooves; use the same frame in previews and live marches. */
.bf-party[data-troop] .bf-soldier[data-sprite-unit=cavalry],.bf-troop-preview[data-troop] .bf-soldier[data-sprite-unit=cavalry]{width:60px;height:66px;background-size:240px 360px;background-position-y:-105px;clip-path:none}
.bf-party[data-back=true] .bf-soldier[data-sprite-unit=cavalry]{background-position-y:-171px}
.bf-troop-preview:has(.bf-soldier[data-sprite-unit=cavalry]),.bf-reward>.bf-troop-preview:has(.bf-soldier[data-sprite-unit=cavalry]){height:100px;overflow:visible}
.bf-troop-preview[data-troop] .bf-soldier[data-sprite-unit=cavalry]{left:26px;top:14px;transform:scale(1.1);transform-origin:center bottom}
.bf-party:has(.bf-soldier[data-sprite-unit=cavalry]) small{top:65px}

/* Acquisition notes occupy their own row instead of wrapping beside equipment controls. */
.bf-rewards:not(.bf-classes)>.bf-reward>small{display:block;font-size:11px;line-height:1.6;margin-top:8px;overflow-wrap:anywhere}

/* In-game title rendering shares the author preview's explicit effect selection. */
.bf-title,[data-glory-title]:before{animation:var(--title-animation,none)}
.bf-title[data-title-effect=none],[data-glory-title][data-title-effect=none]:before{text-shadow:none;box-shadow:none}
[data-title-effect=pulse]{--title-animation:bf-title-pulse 2s ease-in-out infinite}
[data-title-effect=rainbow]{--title-animation:bf-title-rainbow 4s linear infinite}
[data-title-effect=shimmer]{--title-animation:bf-title-shimmer 2.4s ease-in-out infinite}
[data-title-effect=lightning]{--title-animation:bf-title-lightning 1.5s linear infinite}
@keyframes bf-title-pulse{50%{text-shadow:0 0 10px var(--title-color);box-shadow:0 0 10px var(--title-color)}}
@keyframes bf-title-rainbow{to{filter:hue-rotate(360deg)}}
@keyframes bf-title-shimmer{50%{filter:brightness(1.8);text-shadow:0 0 9px var(--title-color)}}
@keyframes bf-title-lightning{28%,33%,70%{text-shadow:0 0 12px white;box-shadow:0 0 12px var(--title-color)}}
#owner-title-preview{position:fixed;z-index:2000;left:8px;bottom:76px;max-width:calc(100vw - 16px);padding:6px 10px;background:#163422ed;border:1px solid #b49c62;color:#e9dfb8;font-size:11px;box-sizing:border-box}#owner-title-preview a{color:#c2ffa8;margin-left:8px}
@media(prefers-reduced-motion:reduce){.bf-title,[data-glory-title]:before{animation:none!important}}

.bf-title[data-title-effect=shimmer]{position:relative;overflow:hidden;isolation:isolate}
.bf-title[data-title-effect=shimmer]:after{content:'';position:absolute;inset:-60% -100%;background:linear-gradient(110deg,transparent 43%,#ffffff99 50%,transparent 57%);animation:bf-title-sweep 2.4s linear infinite;pointer-events:none}
@keyframes bf-title-sweep{from{transform:translateX(-40%)}to{transform:translateX(40%)}}
@media(prefers-reduced-motion:reduce){.bf-title[data-title-effect=shimmer]:after{animation:none}}

/* Keep each achievement requirement on its own readable bullet line. */
.bf-condition-list{margin:8px 0 12px;padding-left:20px;list-style:disc;text-align:left;font-size:12px;line-height:1.7;color:#c8ccae;overflow-wrap:anywhere}.bf-condition-list li{margin:3px 0}.bf-glory-item>.bf-condition-list{flex:1}.bf-acquisition{margin-top:10px;text-align:left}.bf-acquisition>small{font-size:11px;color:#dccc9b}.bf-acquisition .bf-condition-list{margin-top:4px;font-size:11px}
