/* Card field polish: soft frames, side marks that follow the rounded corners,
   a calm cast banner and a centred event card. Loaded after card-field.css. */

/* frame: one rounded body, no inner brackets */
.card-field #battle-root .card-corners{display:none!important}
.card-field #battle-root .battle-field .battle-unit{border-radius:14px!important;border:1px solid #e4dbc0!important;background:linear-gradient(180deg,#fffefa,#fbf7ea)!important;box-shadow:0 1px 0 #fff inset,0 2px 8px #3c3a2a12!important;transition:box-shadow .25s,border-color .25s,opacity .3s,filter .3s}

/* owner / target marks: a colour edge clipped by the card's own corners, so it bends with them */
.card-field #battle-root .card-owner-line,.card-field #battle-root .card-target-lines{inset:0!important;top:0!important;bottom:0!important;left:0!important;right:0!important;width:auto!important;height:auto!important;border-radius:inherit;overflow:hidden;background:none!important;box-shadow:none!important;z-index:4;pointer-events:none}
.card-field #battle-root .card-owner-line::before{content:'';position:absolute;left:0;top:0;bottom:0;width:4px;background:linear-gradient(180deg,color-mix(in srgb,var(--member-color,#659583),#fff 30%),var(--member-color,#659583) 50%,color-mix(in srgb,var(--member-color,#659583),#fff 30%))}
.card-field #battle-root .card-target-lines{display:flex!important;flex-direction:column;align-items:flex-end;gap:0!important}
.card-field #battle-root .card-target-lines i{flex:1;width:4px;min-height:0;border-radius:0!important;background:var(--owner-color,#659583)!important}
.card-field #battle-root .card-target-lines i+i{box-shadow:0 -1px 0 #fffefa}

/* selection: a soft ring that sits on the rounded edge */
.card-field #battle-root .battle-unit.selection-selected{border-color:#7aa996!important;box-shadow:0 0 0 2px #7aa99640,0 3px 10px #2f4a3a1f!important}
.card-field #battle-root .monster-unit.targeted,.card-field #battle-root .monster-unit.selected{border-color:#c98f78!important;box-shadow:0 0 0 2px #c98f7838,0 3px 10px #4a2f2a1f!important}

/* name and health: name on top, a fuller bar with the number at its end */
.card-field #battle-root .card-title{font:700 13px/1.2 Georgia,'Noto Serif',serif!important;letter-spacing:.1px;color:#2f5d50}
.card-field #battle-root .monster-unit .card-title{color:#7f4636}
.card-field #battle-root .card-bar{grid-template-columns:12px minmax(0,1fr) auto!important;gap:5px!important;padding:0!important;align-items:center;font:700 11px/1 Interface,sans-serif!important;color:#5c675a}
.card-field #battle-root .card-bar .card-bar-icon{order:0}
.card-field #battle-root .card-bar i{position:relative!important;inset:auto!important;left:auto!important;order:1;height:6px!important;border-radius:4px;background:#ece5d1!important;box-shadow:inset 0 1px 1px #0000000f}
.card-field #battle-root .card-bar b{order:2;min-width:22px;text-align:right}
.card-field #battle-root .card-bar em{border-radius:4px}
.card-field #battle-root .card-copy{display:grid;gap:5px;align-content:center}
.card-field #battle-root .battle-field.cards-tight .card-bar i{height:4px!important}
.card-field #battle-root .battle-field.cards-tight .card-title{font-size:11.5px!important}

/* effects strip: its own quiet row under portrait and health */
.card-field #battle-root .card-effects{border-top:1px solid #efe7d1;padding-top:4px;margin-top:2px;gap:3px}
.card-field #battle-root .card-effects:empty{border-top-color:transparent}

/* cast banner: the card stays readable, a slim ribbon names the skill */
.card-field #battle-root .battle-unit.card-casting>.card-face{filter:none!important;opacity:.32!important}
.card-field #battle-root .battle-unit.card-casting{border-color:#d8b968!important;box-shadow:0 0 0 2px #d8b96840,0 4px 14px #5a4a1f26!important}
.card-field #battle-root .card-cast{inset:0!important;flex-direction:row!important;gap:9px!important;padding:0 12px;border-radius:inherit;background:linear-gradient(90deg,#fffaf0f2,#fbf2dbf2)!important;animation:cast-in .22s cubic-bezier(.2,.8,.3,1)}
.card-field #battle-root .card-cast-art{flex:none;display:grid;place-items:center;width:42px;height:42px;border-radius:11px;background:#fffdf6;border:1px solid #dcc58a;box-shadow:0 2px 6px #7a632a26;overflow:hidden}
.card-field #battle-root .card-cast-art img{width:100%!important;height:100%!important;object-fit:cover;border:0!important;border-radius:0!important;box-shadow:none!important}
.card-field #battle-root .card-cast.is-wait .card-cast-art img{width:24px!important;height:24px!important;object-fit:contain}
.card-field #battle-root .card-cast-copy{min-width:0;display:grid;gap:2px}
.card-field #battle-root .card-cast-copy small{font:600 9.5px/1 Interface,sans-serif;letter-spacing:.4px;text-transform:uppercase;color:#a58e55}
.card-field #battle-root .card-cast-copy b{font:700 13px/1.15 Georgia,'Noto Serif',serif!important;color:#3d5d4f;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:0!important}
.card-field #battle-root .cards-tight .card-cast-art{width:30px;height:30px}
@keyframes cast-in{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}

/* event card: one centred value, a small caption "source · kind" under it */
.card-field #battle-root .card-event-back{display:none;grid-template-columns:auto minmax(0,1fr)!important;gap:10px!important;padding:8px 14px!important;border-radius:inherit!important;align-items:center}
.card-field #battle-root .card-event-back[data-kind=hit]{background:linear-gradient(135deg,#fff8f3,#fbe6dc)!important}
.card-field #battle-root .card-event-back[data-kind=heal]{background:linear-gradient(135deg,#f7fcf6,#e2f1e2)!important}
.card-field #battle-root .card-event-back[data-kind=guard]{background:linear-gradient(135deg,#f6fafd,#e1ecf4)!important}
.card-field #battle-root .card-event-back[data-kind=resource]{background:linear-gradient(135deg,#fffcf3,#f6eed6)!important}
.card-field #battle-root .card-event-back[data-kind=dodge]{background:linear-gradient(135deg,#fbfaf5,#efece0)!important}
.card-field #battle-root .card-event-portrait{width:38px!important;height:38px!important;border-radius:50%!important;object-fit:cover;object-position:50% 20%;border:2px solid #fff!important;box-shadow:0 1px 4px #0002}
.card-field #battle-root .card-event-copy{align-items:flex-start!important;gap:3px!important}
.card-field #battle-root .card-event-copy>.card-impact-content{font:700 20px/1 Interface,sans-serif!important;gap:5px}
.card-field #battle-root .card-event-copy>.card-impact-content:is(.dodge,.miss,.invulnerable){font:700 14px/1.1 Georgia,'Noto Serif',serif!important;color:#55705f}
.card-field #battle-root .card-event-caption{display:flex;gap:4px;max-width:100%;min-width:0;font:500 10px/1.2 Interface,sans-serif;color:#8b7f65;white-space:nowrap;overflow:hidden}
.card-field #battle-root .card-event-caption strong{font:inherit;font-weight:700;color:#6d6650;overflow:hidden;text-overflow:ellipsis}
.card-field #battle-root .card-event-caption strong+small::before{content:'·';margin-right:4px}
.card-field #battle-root .card-event-caption small{font:inherit;color:inherit}
.card-field #battle-root .cards-dense .card-event-portrait{width:30px!important;height:30px!important}
.card-field #battle-root .cards-dense .card-event-copy>.card-impact-content{font-size:17px!important}
.card-field #battle-root .cards-tight .card-event-caption{display:none}

.card-field #battle-root .battle-unit.card-casting>.card-face{opacity:0!important}
.card-field #battle-root .card-cast-copy b{white-space:normal!important;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;line-height:1.15}
.card-field #battle-root .battle-unit.fx-empty .card-effects{display:none}
.card-field #battle-root .card-event-back[data-kind=dodge]{grid-template-columns:1fr!important;justify-items:center;text-align:center}
.card-field #battle-root .card-event-back[data-kind=dodge] .card-event-portrait{display:none}
.card-field #battle-root .card-event-back[data-kind=dodge] .card-event-copy{align-items:center!important}
.card-field #battle-root .card-event-copy{min-width:0;max-width:100%}
.card-field #battle-root .card-event-copy>.card-impact-content{max-width:100%;min-width:0;overflow:hidden}
.card-field #battle-root .card-impact-content>b,.card-field #battle-root .card-impact-content>span:not([class]){min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.card-field #battle-root .card-event-copy>.card-impact-content>b{flex:0 1 auto!important;min-width:0}
.card-field #battle-root .card-event-copy>.card-impact-content:is(.dodge,.miss,.invulnerable){font-size:12.5px!important}
.card-field #battle-root .card-event-back[data-kind=dodge] .card-event-copy{width:100%}

/* marks: a clear 6px colour edge, clipped by the rounded corners */
.card-field #battle-root .card-owner-line::before{width:6px}
.card-field #battle-root .card-target-lines i{width:6px}
.card-field #battle-root .card-target-lines i+i{box-shadow:0 -2px 0 #fffefa}
/* many enemies: the column scrolls, cards keep their size, a soft fade shows there is more below */
.card-field #battle-root :is(.card-enemy-scroll,.card-ally-scroll){scrollbar-width:none;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
.card-field #battle-root :is(.card-enemy-scroll,.card-ally-scroll)::-webkit-scrollbar{display:none}
.card-field #battle-root :is(.card-enemy-scroll,.card-ally-scroll).has-overflow.has-more-below{-webkit-mask-image:linear-gradient(#000 calc(100% - 26px),#0000);mask-image:linear-gradient(#000 calc(100% - 26px),#0000)}
.card-field #battle-root .card-event-caption{display:none!important}
.card-field #battle-root .battle-unit.fx-empty>.card-face{grid-template-rows:auto!important;align-content:center}
.card-field #battle-root .card-cast-copy b{font-size:12px!important}

/* ===== v3: crisp cards, rounded pill marks, a soft blurred skill banner, events fade over the card ===== */
.card-field #battle-root .battle-field .battle-unit{border-radius:12px!important;border:1px solid #ddd2b2!important;background:#fffefa!important;box-shadow:0 1px 2px #3c3a2a14,0 4px 10px -6px #3c3a2a30!important}
/* marks: separate rounded pills inside the edge, never a strip glued to the border */
.card-field #battle-root .card-owner-line,.card-field #battle-root .card-target-lines{border-radius:0;overflow:visible}
.card-field #battle-root .card-owner-line::before{left:5px;top:14px;bottom:14px;width:5px;border-radius:5px;background:var(--member-color,#659583);box-shadow:0 0 0 2px #fffefa,0 1px 4px color-mix(in srgb,var(--member-color,#659583),#0000 45%)}
.card-field #battle-root .card-target-lines{top:14px!important;bottom:14px!important;right:5px!important;left:auto!important;width:5px!important;gap:5px!important}
.card-field #battle-root .card-target-lines i{width:5px;border-radius:5px!important;background:var(--owner-color,#659583)!important;box-shadow:0 0 0 2px #fffefa,0 1px 4px color-mix(in srgb,var(--owner-color,#659583),#0000 45%)!important}
.card-field #battle-root .card-target-lines i+i{box-shadow:0 0 0 2px #fffefa,0 1px 4px color-mix(in srgb,var(--owner-color,#659583),#0000 45%)!important}
.card-field #battle-root .battle-unit:not(.monster-unit)>.card-face{padding-left:16px}
.card-field #battle-root .monster-unit>.card-face{padding-right:16px}
/* skill banner: the card shows through, softly blurred */
.card-field #battle-root .battle-unit.card-casting>.card-face{opacity:.6!important;filter:blur(2.5px) saturate(.85)!important;transition:filter .2s,opacity .2s}
.card-field #battle-root .card-cast{background:linear-gradient(90deg,#fffaf0c4,#fbf2dbb8)!important;animation:cast-in .28s cubic-bezier(.2,.8,.3,1)}
/* event over the card: a fade, no turning */
.card-field #battle-root .card-event-show>.card-face{visibility:visible!important;filter:blur(2px);opacity:.45;transition:filter .18s,opacity .18s}
.card-field #battle-root .card-event-back{background-color:transparent}
.card-field #battle-root .card-event-show>.card-event-back{animation:event-in .2s ease-out both}
.card-field #battle-root .card-event-leaving>.card-event-back{animation:event-out .18s ease-in both}
.card-field #battle-root .card-event-back[data-kind=hit]{background:linear-gradient(135deg,#fff8f3d9,#fbe6dcd9)!important}
.card-field #battle-root .card-event-back[data-kind=heal]{background:linear-gradient(135deg,#f7fcf6d9,#e2f1e2d9)!important}
.card-field #battle-root .card-event-back[data-kind=guard]{background:linear-gradient(135deg,#f6fafdd9,#e1ecf4d9)!important}
.card-field #battle-root .card-event-back[data-kind=resource]{background:linear-gradient(135deg,#fffcf3d9,#f6eed6d9)!important}
.card-field #battle-root .card-event-back[data-kind=dodge]{background:linear-gradient(135deg,#fbfaf5d9,#efece0d9)!important}
@keyframes event-in{from{opacity:0;transform:scale(.97)}to{opacity:1;transform:none}}
@keyframes event-out{from{opacity:1}to{opacity:0}}
.perf-lite .card-field #battle-root .battle-unit.card-casting>.card-face,.perf-lite .card-field #battle-root .card-event-show>.card-face{filter:blur(1.5px)!important}

/* ===== v4 ===== */
/* enemy content keeps its place: room for the target marks is always reserved */
.card-field #battle-root .monster-unit>.card-face{padding-right:16px!important}
/* a flat 2D card with a fine inner frame that follows the corners */
.card-field #battle-root .battle-field .battle-unit{box-shadow:inset 0 0 0 3px #fffefa,inset 0 0 0 4px #ece2c5,0 1px 2px #3c3a2a14,0 4px 10px -6px #3c3a2a30!important}
.card-field #battle-root .battle-unit.selection-selected{box-shadow:inset 0 0 0 3px #fffefa,inset 0 0 0 4px #b9d3c6,0 0 0 2px #7aa99640,0 3px 10px #2f4a3a1f!important}
.card-field #battle-root .monster-unit.targeted,.card-field #battle-root .monster-unit.selected{box-shadow:inset 0 0 0 3px #fffefa,inset 0 0 0 4px #ecc9bb,0 0 0 2px #c98f7838,0 3px 10px #4a2f2a1f!important}
.card-field #battle-root .battle-unit.card-casting{box-shadow:inset 0 0 0 3px #fffefa,inset 0 0 0 4px #ecd9a4,0 0 0 2px #d8b96840,0 4px 14px #5a4a1f26!important}
/* centre badge: a neat round seal on the divider */
.card-field #battle-root .battle-field::after{width:26px!important;height:26px!important;border-radius:50%!important;font-size:12px!important;line-height:1!important;background:#fffdf6!important;border:1px solid #dccfa7!important;box-shadow:0 0 0 3px #f7f2e4,0 1px 3px #3c3a2a1f;color:#a8925a!important}
/* skill shown on a hit: a small icon on the attacker's portrait */
.card-field #battle-root .card-event-avatar{position:relative;flex:none;display:block;line-height:0}
.card-field #battle-root .card-event-skill{position:absolute;right:-5px;bottom:-4px;width:20px;height:20px;border-radius:6px;object-fit:cover;border:1.5px solid #fffefa;box-shadow:0 1px 3px #0003;background:#fffdf6}
.card-field #battle-root .cards-dense .card-event-skill{width:16px;height:16px}

/* ===== v5: effect events are a quiet line; no badges under the portrait ===== */
.card-field #battle-root .card-event-back .combat-number-source,.card-field #battle-root .card-event-back .potion-bleed-badge,.card-field #battle-root .card-event-back .combat-shield-badge,.card-field #battle-root .card-event-skill{display:none!important}
.card-field #battle-root .card-event-back.is-word .card-event-copy>.card-impact-content{font:700 13px/1.2 Georgia,'Noto Serif',serif!important;color:#3f5f52}
.card-field #battle-root .card-event-back.is-word .card-impact-content>b,.card-field #battle-root .card-event-back.is-word .card-impact-content>span:not([class]){white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.card-field #battle-root .card-event-back.is-word .card-impact-content img,.card-field #battle-root .card-event-back.is-word .card-impact-content .combat-number-icon-wrap>img{width:18px!important;height:18px!important}
.card-field #battle-root .card-event-back.is-word .card-event-portrait{width:32px!important;height:32px!important}
.card-field #battle-root .card-event-back[data-kind=effect]{background:linear-gradient(135deg,#fffcf1d9,#f5edd3d9)!important}
.card-field #battle-root .card-impact-content .combat-number-icon-wrap{position:relative;display:inline-grid;place-items:center;flex:none}

/* ===== v6: effect icons fit their row; resource, block and wait events are small and tidy ===== */
.card-field #battle-root .card-effects{display:flex;align-items:center;height:24px!important;max-height:24px!important;overflow:hidden;padding-top:3px!important;box-sizing:border-box}
.card-field #battle-root .card-effects .combat-effect-icon{width:18px!important;height:18px!important;min-width:18px!important;padding:0!important;box-sizing:border-box;display:grid;place-items:center;position:relative;overflow:visible}
.card-field #battle-root .card-effects .combat-effect-icon img{width:14px!important;height:14px!important;object-fit:contain}
.card-field #battle-root .card-effects .combat-effect-icon small{font-size:8px!important;line-height:1;bottom:-3px!important;right:-3px!important}
/* every picture inside an event is a small icon, never a large painting */
.card-field #battle-root .card-event-copy .card-impact-content img,.card-field #battle-root .card-event-copy .card-impact-content .combat-number-icon-wrap,.card-field #battle-root .card-event-copy .card-impact-content .combat-damage-art{width:18px!important;height:18px!important;max-width:18px!important;max-height:18px!important;flex:none}
.card-field #battle-root .card-event-copy .card-impact-content .combat-popup-glyph{font-size:15px!important}
.card-field #battle-root .card-event-back:is([data-kind=resource],[data-kind=guard]) .card-event-copy>.card-impact-content{font:700 15px/1.1 Interface,sans-serif!important;color:#5c6b4f}
.card-field #battle-root .card-event-back[data-kind=guard] .card-event-copy>.card-impact-content{color:#3f6f8c}
.card-field #battle-root .card-event-copy>.card-impact-content:is(.wait-resource,.resource){font:700 15px/1.1 Interface,sans-serif!important;color:#8a6d22!important;max-width:100%}
.card-field #battle-root .card-event-copy>.card-impact-content:is(.wait-resource,.resource)>*{flex:none}

/* ===== v7 ===== */
/* event: who did it on top, portrait and value below */
.card-field #battle-root .card-event-back{grid-template-columns:auto minmax(0,1fr)!important;grid-template-rows:auto auto;row-gap:3px!important;align-content:center}
.card-field #battle-root .card-event-who{grid-column:1/-1;font:700 10.5px/1.2 Interface,sans-serif;color:#7a6f55;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
.card-field #battle-root .card-event-who:empty{display:none}
.card-field #battle-root .card-event-back.has-who .card-event-portrait{width:32px!important;height:32px!important}
/* resource (wait +10 might) and dodge: a small centred chip, the card stays readable under it */
.card-field #battle-root .card-event-back:is([data-kind=resource],[data-kind=dodge]){grid-template-columns:1fr!important;grid-template-rows:1fr;justify-items:center;align-items:center;background:transparent!important}
.card-field #battle-root .card-event-back:is([data-kind=resource],[data-kind=dodge]) .card-event-avatar{display:none}
.card-field #battle-root .card-event-back:is([data-kind=resource],[data-kind=dodge]) .card-event-copy{align-items:center!important;width:auto}
.card-field #battle-root .card-event-back:is([data-kind=resource],[data-kind=dodge]) .card-impact-content{justify-content:center;padding:6px 12px;border-radius:999px;background:#fffdf6f0;border:1px solid #e3d7b3;box-shadow:0 2px 8px #3c3a2a1f}
.card-field #battle-root .card-event-show.event-quiet>.card-face{filter:none!important;opacity:.75!important}
.card-field #battle-root .card-event-back[data-kind=dodge] .card-impact-content{color:#4f6e60!important;font:700 12.5px/1 Interface,sans-serif!important}
/* a newly applied effect: its square draws itself, then the icon settles in */
.card-field #battle-root .card-effects .combat-effect-icon.fx-arrive{animation:fx-frame .55s cubic-bezier(.2,.8,.3,1) both}
.card-field #battle-root .card-effects .combat-effect-icon.fx-arrive img{animation:fx-icon .55s .2s cubic-bezier(.2,.9,.3,1.3) both}
@keyframes fx-frame{0%{clip-path:inset(50% 50% 50% 50% round 4px);box-shadow:0 0 0 0 #d8b96800}60%{clip-path:inset(0 0 0 0 round 4px);box-shadow:0 0 0 3px #d8b96866}100%{clip-path:inset(0 0 0 0 round 4px);box-shadow:0 0 0 0 #d8b96800}}
@keyframes fx-icon{from{opacity:0;transform:scale(.4)}to{opacity:1;transform:none}}
@media(prefers-reduced-motion:reduce){.card-field #battle-root .card-effects .combat-effect-icon.fx-arrive,.card-field #battle-root .card-effects .combat-effect-icon.fx-arrive img{animation:none}}
.card-field #battle-root .card-event-show.event-quiet>.card-face{opacity:.4!important}

/* ===== v8 ===== */
.card-field #battle-root .card-effects .combat-effect-icon.fx-arrive{animation-delay:var(--fx-delay,0ms)!important}
.card-field #battle-root .card-effects .combat-effect-icon.fx-arrive img{animation-delay:calc(var(--fx-delay,0ms) + 200ms)!important}
/* hit, heal, guard, resource, dodge: one layout — icon on the left, value on the right, over a softly blurred card */
.card-field #battle-root .card-event-back{grid-template-rows:auto!important;row-gap:0!important;justify-content:center;column-gap:10px!important}
.card-field #battle-root .card-event-back .card-event-portrait{width:36px!important;height:36px!important}
.card-field #battle-root .card-event-back:is([data-kind=resource],[data-kind=dodge]){grid-template-columns:auto!important;justify-content:center;background:linear-gradient(135deg,#fffcf3d9,#f6eed6d9)!important}
.card-field #battle-root .card-event-back[data-kind=dodge]{background:linear-gradient(135deg,#f8faf6d9,#e8efe6d9)!important}
.card-field #battle-root .card-event-back:is([data-kind=resource],[data-kind=dodge]) .card-impact-content{padding:0!important;border:0!important;border-radius:0!important;background:none!important;box-shadow:none!important;font:700 17px/1 Interface,sans-serif!important;gap:6px}
.card-field #battle-root .card-event-back[data-kind=dodge] .card-impact-content{font:700 14px/1 Georgia,'Noto Serif',serif!important;color:#3f6a58!important}
.card-field #battle-root .card-event-back:is([data-kind=resource],[data-kind=dodge]) .card-impact-content img{width:20px!important;height:20px!important;max-width:20px!important;max-height:20px!important}
.card-field #battle-root .card-event-show.event-quiet>.card-face{filter:blur(2px)!important;opacity:.45!important}
/* selection: a clearer, brighter ring */
.card-field #battle-root .battle-unit.selection-selected{border-color:#4f9a7f!important;box-shadow:inset 0 0 0 3px #fffefa,inset 0 0 0 4px #9fcbb7,0 0 0 2.5px #4f9a7fa6,0 4px 14px #2f6a5433!important}
.card-field #battle-root .monster-unit.targeted,.card-field #battle-root .monster-unit.selected{border-color:#ba7363!important;box-shadow:inset 0 0 0 1px #f3d5bf,0 0 4px #bd655b38!important}
.card-field #battle-root .monster-unit.selected>.card-face::after{content:"";position:absolute;inset:0;border:1px solid #bc6e62;border-radius:inherit;box-shadow:0 0 4px #bf635b38;pointer-events:none;animation:selected-enemy-breathe 2.6s ease-in-out infinite;}
/* only opacity: a box-shadow here repainted the whole card every frame of the fight */@keyframes selected-enemy-breathe{0%,100%{opacity:.4}50%{opacity:.95}}
@media(prefers-reduced-motion:reduce){.card-field #battle-root .monster-unit.selected>.card-face::after{animation:none;opacity:.7;}}

/* ===== v9 ===== */
/* cards glide when the field rearranges (a death, a summon, a new enemy) */
.card-field #battle-root :is(.battle-field,.card-enemy-scroll,.card-ally-scroll)>.battle-unit.cf-placed{transition:top .42s cubic-bezier(.25,.8,.3,1),left .42s cubic-bezier(.25,.8,.3,1),box-shadow .25s,border-color .25s,opacity .3s,filter .3s!important}
@media(prefers-reduced-motion:reduce){.card-field #battle-root .battle-unit.cf-placed{transition:none!important}}
/* centre seal: crossed swords, smaller so it clears the cards */
.card-field #battle-root .battle-field::after{content:''!important;width:20px!important;height:20px!important;background:#fffdf6 url(art/icons/card-field/crossed-swords.svg) center/13px 13px no-repeat!important;box-shadow:0 0 0 2px #f7f2e4,0 1px 3px #3c3a2a1f!important}
/* event: portrait with the attacker's name under it, value on the right */
.card-field #battle-root .card-event-avatar{display:flex!important;flex-direction:column;align-items:center;gap:3px;line-height:1!important;max-width:64px}
.card-field #battle-root .card-event-avatar .card-event-who{display:block;max-width:64px;font:600 9.5px/1.15 Interface,sans-serif;color:#8a7e62;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.card-field #battle-root .card-event-avatar .card-event-who:empty{display:none}
.card-field #battle-root .card-event-back.has-who .card-event-portrait{width:32px!important;height:32px!important}

/* ===== v10 ===== */
/* resource and dodge: no portrait, one tidy centred row on the blurred card */
.card-field #battle-root .card-event-back:is([data-kind=resource],[data-kind=dodge]) .card-event-avatar{display:none!important}
.card-field #battle-root .card-event-back:is([data-kind=resource],[data-kind=dodge]){display:none;place-items:center!important;padding:0!important}
.card-field #battle-root .card-event-show>.card-event-back:is([data-kind=resource],[data-kind=dodge]){display:grid!important}
.card-field #battle-root .card-event-back:is([data-kind=resource],[data-kind=dodge]) .card-event-copy{display:flex!important;align-items:center!important;justify-content:center!important;width:100%}
.card-field #battle-root .card-event-copy>.card-impact-content.wait-resource{display:inline-flex!important;align-items:center!important;gap:8px!important;line-height:1!important;font:700 18px/1 Interface,sans-serif!important;font-variant-numeric:tabular-nums;color:#8a6d22!important}
.card-field #battle-root .card-impact-content.wait-resource>img{display:block;width:18px!important;height:18px!important;max-width:18px!important;max-height:18px!important;opacity:.7}
.card-field #battle-root .card-impact-content.wait-resource .wait-resource-amount{display:inline-flex!important;align-items:center!important;gap:4px!important;line-height:1!important;padding-left:8px;border-left:1px solid #d9c99c}
.card-field #battle-root .card-impact-content.wait-resource .wait-resource-amount img{display:block;width:18px!important;height:18px!important;max-width:18px!important;max-height:18px!important}
.card-field #battle-root .card-impact-content.wait-resource .wait-resource-amount b{display:block;line-height:1;font:inherit;transform:translateY(.5px)}
.card-field #battle-root .card-impact-content :is(img,b,span){vertical-align:middle}
/* a new effect: the square lights up gold and the icon pops in — clearly visible, about a second */
.card-field #battle-root .card-effects{overflow:clip!important;overflow-clip-margin:6px}
.card-field #battle-root .card-effects .combat-effect-icon.fx-arrive{animation:fx-arrive2 1s cubic-bezier(.2,.8,.3,1) both!important;animation-delay:var(--fx-delay,0ms)!important;z-index:2}
.card-field #battle-root .card-effects .combat-effect-icon.fx-arrive img{animation:fx-icon2 .7s cubic-bezier(.2,.9,.3,1.4) both!important;animation-delay:var(--fx-delay,0ms)!important}
@keyframes fx-arrive2{0%{transform:scale(.3);opacity:0;background:#fff3c8;box-shadow:0 0 0 0 #e0b54a00}30%{transform:scale(1.25);opacity:1;background:#fff3c8;box-shadow:0 0 0 3px #e0b54acc,0 0 10px 2px #f0c86099}60%{transform:scale(.96);box-shadow:0 0 0 2px #e0b54a88,0 0 6px 1px #f0c86055}100%{transform:none;opacity:1;box-shadow:0 0 0 0 #e0b54a00}}
@keyframes fx-icon2{0%{transform:scale(0) rotate(-20deg);opacity:0}60%{transform:scale(1.15) rotate(4deg);opacity:1}100%{transform:none;opacity:1}}

/* a long attacker name runs slowly under the portrait instead of being cut */
.card-field #battle-root .card-event-avatar .card-event-who.is-long{text-overflow:clip;-webkit-mask:linear-gradient(90deg,transparent,#000 6px,#000 calc(100% - 6px),transparent);mask:linear-gradient(90deg,transparent,#000 6px,#000 calc(100% - 6px),transparent);width:64px}
.card-field #battle-root .card-event-avatar .card-event-who.is-long>span{display:inline-block;padding:0 6px;animation:none}
@keyframes who-run{0%,15%{transform:translateX(0)}85%,100%{transform:translateX(calc(-100% + 64px))}}

/* dodge: crisper, readable at a glance */
.card-field #battle-root .card-event-back[data-kind=dodge]{background:linear-gradient(135deg,#f9fbf7f2,#eaf1e8f2)!important}
.card-field #battle-root .card-event-back[data-kind=resource]{background:linear-gradient(135deg,#fffcf3f2,#f6eed6f2)!important}
.card-field #battle-root .card-event-back[data-kind=dodge] .card-event-copy>.card-impact-content{display:inline-flex!important;align-items:center!important;gap:7px!important;font:700 16px/1 Georgia,'Noto Serif',serif!important;color:#2f5a49!important;opacity:1!important}
.card-field #battle-root .card-event-back[data-kind=dodge] .card-impact-content>b{display:block!important;-webkit-line-clamp:unset!important;white-space:nowrap!important;line-height:1}
.card-field #battle-root .card-event-back[data-kind=dodge] .card-impact-content img{display:block;width:22px!important;height:22px!important;max-width:22px!important;max-height:22px!important}

/* ===== v11: a new effect — two lines trace the square from opposite corners, then the icon appears ===== */
.card-field #battle-root .card-effects .combat-effect-icon.fx-arrive{animation:fx-box .62s linear both!important;animation-delay:var(--fx-delay,0ms)!important}
.card-field #battle-root .card-effects .combat-effect-icon.fx-arrive img{animation:fx-pop .22s .4s cubic-bezier(.2,.9,.3,1.2) both!important;animation-delay:calc(var(--fx-delay,0ms) + 400ms)!important}
.card-field #battle-root .card-effects .combat-effect-icon.fx-arrive small{animation:fx-pop .2s .5s ease-out both;animation-delay:calc(var(--fx-delay,0ms) + 500ms)}
.card-field #battle-root .card-effects .combat-effect-icon.fx-arrive::before,.card-field #battle-root .card-effects .combat-effect-icon.fx-arrive::after{content:'';position:absolute;box-sizing:border-box;width:0;height:0;border:0 solid #8f7a46;pointer-events:none;animation:fx-trace .4s linear both,fx-fade .2s .5s ease-out forwards;animation-delay:var(--fx-delay,0ms),calc(var(--fx-delay,0ms) + 500ms)}
.card-field #battle-root .card-effects .combat-effect-icon.fx-arrive::before{top:-1px;left:-1px;border-top-width:1.5px;border-right-width:1.5px;border-top-left-radius:4px}
.card-field #battle-root .card-effects .combat-effect-icon.fx-arrive::after{bottom:-1px;right:-1px;border-bottom-width:1.5px;border-left-width:1.5px;border-bottom-right-radius:4px}
@keyframes fx-box{0%{border-color:transparent;background-color:transparent;box-shadow:none}70%{border-color:transparent;background-color:transparent;box-shadow:none}100%{}}
@keyframes fx-trace{0%{width:0;height:0;opacity:1}50%{width:calc(100% + 2px);height:0;opacity:1}100%{width:calc(100% + 2px);height:calc(100% + 2px);opacity:1}}
@keyframes fx-fade{to{opacity:0}}
@keyframes fx-pop{from{opacity:0;transform:scale(.6)}to{opacity:1;transform:none}}
@media(prefers-reduced-motion:reduce){.card-field #battle-root .card-effects .combat-effect-icon.fx-arrive,.card-field #battle-root .card-effects .combat-effect-icon.fx-arrive *,.card-field #battle-root .card-effects .combat-effect-icon.fx-arrive::before,.card-field #battle-root .card-effects .combat-effect-icon.fx-arrive::after{animation:none!important}}

/* ===== v12 ===== */
.card-field #battle-root .card-effects .combat-effect-icon.fx-pending{visibility:hidden}
/* effect chip: icon with its turns to the right, inside one frame (as in the lower panel) */
.card-field #battle-root .card-effects .combat-effect-icon:has(>small){width:auto!important;min-width:18px!important;display:inline-flex!important;align-items:center;gap:2px;padding:0 3px 0 2px!important}
.card-field #battle-root .card-effects .combat-effect-icon small{position:static!important;inset:auto!important;transform:none!important;display:block;min-width:0;padding:0!important;margin:0!important;background:none!important;border:0!important;box-shadow:none!important;font:700 9px/1 Interface,sans-serif!important;color:#6b6450!important}
/* red ring only on the target you chose; an ally's target keeps only its coloured pill */
.card-field #battle-root .monster-unit.targeted:not(.selected){border-color:#ddd2b2!important;box-shadow:inset 0 0 0 3px #fffefa,inset 0 0 0 4px #ece2c5,0 1px 0 #fff inset,0 2px 8px #3c3a2a12!important}
/* target pills sit inside the inner frame and never cut the border */
.card-field #battle-root .card-target-lines{right:8px!important;top:16px!important;bottom:16px!important;gap:4px!important}
.card-field #battle-root .card-target-lines>i{width:4px!important;border-radius:4px!important;box-shadow:none!important;opacity:.9}
.card-field #battle-root .monster-unit .card-face{padding-right:18px!important}
/* event content stays clear of the owner pill */
.card-field #battle-root .battle-unit.has-owner-line>.card-event-back{padding-left:22px!important;padding-right:10px!important}
.card-field #battle-root .monster-unit>.card-event-back{padding-right:20px!important}

/* ===== v13: the lower panel effect row arrives the same way ===== */
.card-field #battle-root #hero-effects .combat-effect-icon{position:relative}
.card-field #battle-root #hero-effects .combat-effect-icon.fx-pending{visibility:hidden}
.card-field #battle-root #hero-effects .combat-effect-icon.fx-arrive{animation:fx-box .62s linear both!important;animation-delay:var(--fx-delay,0ms)!important}
.card-field #battle-root #hero-effects .combat-effect-icon.fx-arrive img{animation:fx-pop .22s .4s cubic-bezier(.2,.9,.3,1.2) both!important;animation-delay:calc(var(--fx-delay,0ms) + 400ms)!important}
.card-field #battle-root #hero-effects .combat-effect-icon.fx-arrive small{animation:fx-pop .2s .5s ease-out both;animation-delay:calc(var(--fx-delay,0ms) + 500ms)}
.card-field #battle-root #hero-effects .combat-effect-icon.fx-arrive::before,.card-field #battle-root #hero-effects .combat-effect-icon.fx-arrive::after{content:'';position:absolute;box-sizing:border-box;width:0;height:0;border:0 solid #8f7a46;pointer-events:none;animation:fx-trace .4s linear both,fx-fade .2s .5s ease-out forwards;animation-delay:var(--fx-delay,0ms),calc(var(--fx-delay,0ms) + 500ms)}
.card-field #battle-root #hero-effects .combat-effect-icon.fx-arrive::before{top:-1px;left:-1px;border-top-width:1.5px;border-right-width:1.5px;border-top-left-radius:4px}
.card-field #battle-root #hero-effects .combat-effect-icon.fx-arrive::after{bottom:-1px;right:-1px;border-bottom-width:1.5px;border-left-width:1.5px;border-bottom-right-radius:4px}

/* ===== v14: a new notice traces its frame from two corners, like an arriving effect ===== */
.card-field #battle-root .card-event-show>.card-event-back.is-fresh::before,.card-field #battle-root .card-event-show>.card-event-back.is-fresh::after{content:'';position:absolute;box-sizing:border-box;width:0;height:0;border:0 solid var(--impact-source,#b98b6d);pointer-events:none;animation:fx-trace-card .38s cubic-bezier(.3,.6,.4,1) both,fx-fade .25s .5s ease-out forwards}
.card-field #battle-root .card-event-show>.card-event-back.is-fresh::before{top:1px;left:1px;border-top-width:2px;border-right-width:2px;border-top-left-radius:11px;border-bottom-right-radius:0}
.card-field #battle-root .card-event-show>.card-event-back.is-fresh::after{bottom:1px;right:1px;border-bottom-width:2px;border-left-width:2px;border-bottom-right-radius:11px}
@keyframes fx-trace-card{0%{width:0;height:0;opacity:.9}50%{width:calc(100% - 2px);height:0;opacity:.9}100%{width:calc(100% - 2px);height:calc(100% - 2px);opacity:.9}}
.card-field #battle-root .card-event-show>.card-event-back.is-fresh>*{animation:fx-pop .24s .12s cubic-bezier(.2,.9,.3,1.15) both}
@media(prefers-reduced-motion:reduce){.card-field #battle-root .card-event-back.is-fresh::before,.card-field #battle-root .card-event-back.is-fresh::after,.card-field #battle-root .card-event-back.is-fresh>*{animation:none!important;display:none}}

/* ===== v15: the notice frame is drawn along the inner rounded frame, two strokes from opposite corners ===== */
.card-field #battle-root .card-event-show>.card-event-back.is-fresh::before,.card-field #battle-root .card-event-show>.card-event-back.is-fresh::after{content:none!important;display:none!important}
.card-field #battle-root .card-event-trace{position:absolute;inset:3.5px;width:auto;height:auto;overflow:visible;pointer-events:none;z-index:3;animation:fx-fade .3s .95s ease-out forwards!important}
.card-field #battle-root .card-event-trace rect{x:.75px;y:.75px;width:calc(100% - 1.5px);height:calc(100% - 1.5px);rx:8.5px;ry:8.5px;fill:none;stroke:var(--impact-source,#b98b6d);stroke-width:1.5px;stroke-linecap:round;stroke-dasharray:0 100;animation:card-trace .62s cubic-bezier(.35,.1,.3,1) both!important}
.card-field #battle-root .card-event-trace rect+rect{stroke-dashoffset:-50}
@keyframes card-trace{to{stroke-dasharray:50 50}}
.card-field #battle-root .card-event-show>.card-event-back.is-fresh>:not(.card-event-trace){animation:fx-pop .3s .2s cubic-bezier(.2,.9,.3,1.12) both}
@media(prefers-reduced-motion:reduce){.card-field #battle-root .card-event-trace{display:none}}

/* ===== v16: the same calm frame stroke on skill banners; a little slower, it stays a moment before fading ===== */
.card-field #battle-root .card-event-trace{animation:fx-fade .4s ease-out forwards!important;animation-delay:calc(var(--trace-delay,0ms) + 1.15s)!important}
.card-field #battle-root .card-event-trace rect{animation:card-trace .85s cubic-bezier(.4,.1,.3,1) both!important;animation-delay:var(--trace-delay,0ms)!important}
.card-field #battle-root .card-cast>.card-event-trace{inset:-.5px}

/* ===== v17: an svg has an intrinsic 300×150 size; give the frame stroke the exact size of the inner frame ===== */
.card-field #battle-root .card-event-trace{inset:auto!important;top:3.5px!important;left:3.5px!important;width:calc(100% - 7px)!important;height:calc(100% - 7px)!important;overflow:visible}
.card-field #battle-root .card-cast>.card-event-trace{top:-.5px!important;left:-.5px!important;width:calc(100% + 1px)!important;height:calc(100% + 1px)!important}

/* ===== v18: pet cards — the same card as a player's, with the owner's colour pill ===== */
.card-field #battle-root .battle-unit .necro-companions,.card-field #battle-root .battle-unit>.mage-pet{display:none!important}
.card-field #battle-root .card-pet-unit{cursor:pointer}
.card-field #battle-root .card-pet-unit .card-portrait{background:#fbf6e8}
.card-field #battle-root .card-pet-unit .card-portrait img{object-fit:contain!important;padding:3px;box-sizing:border-box}
.card-field #battle-root .card-pet-unit .card-bar.res.turns em{background:linear-gradient(90deg,#c9a24b,#e6c77c)!important}
.card-field #battle-root .card-pet-unit .card-bar.res.turns .card-bar-icon img{width:11px;height:11px;opacity:.8}
.card-field #battle-root .card-pet-unit.card-pet-arriving{animation:pet-in .5s ease-out both}
.card-field #battle-root .card-pet-unit.card-pet-leaving{animation:pet-out .4s ease-in forwards;pointer-events:none}
@keyframes pet-in{from{opacity:0;filter:blur(3px)}to{opacity:1;filter:none}}
@keyframes pet-out{to{opacity:0;filter:blur(3px)}}
.card-field #battle-root .card-pet-unit .card-title{white-space:normal!important;display:-webkit-box!important;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-size:12px!important;line-height:1.12!important;text-overflow:clip!important}

/* pet names a touch smaller; a raised summon wears a glowing skull with its turns */
.card-field #battle-root .card-pet-unit .card-title{font-size:11px!important;line-height:1.12!important;padding-right:44px}
.card-field #battle-root .card-pet-badge{position:absolute;top:8px;right:9px;display:inline-flex;align-items:center;gap:3px;padding:2px 6px 2px 3px;border-radius:999px;background:#f4f0f7;border:1px solid #d8cfe3;font:700 9.5px/1 Interface,sans-serif;color:#5d4f6e;z-index:2;pointer-events:none}
.card-field #battle-root .card-pet-badge[hidden]{display:none}
.card-field #battle-root .card-pet-badge img{width:14px;height:14px;object-fit:contain;animation:skull-glow 2.4s ease-in-out infinite}
.card-field #battle-root .card-pet-badge b{font-variant-numeric:tabular-nums}
@keyframes skull-glow{0%,100%{opacity:.78;filter:drop-shadow(0 0 0 #9d7fd000)}50%{opacity:1;filter:drop-shadow(0 0 3px #9d7fd0cc)}}
.perf-lite .card-field #battle-root .card-pet-badge img,.card-field.perf-lite #battle-root .card-pet-badge img{animation:skull-fade 2.4s ease-in-out infinite}
@keyframes skull-fade{0%,100%{opacity:.7}50%{opacity:1}}
@media(prefers-reduced-motion:reduce){.card-field #battle-root .card-pet-badge img{animation:none}}
.card-field #battle-root .card-event-show>.card-pet-badge{visibility:hidden}
.card-field #battle-root .card-pet-badge img{width:15px;height:15px}
.card-field #battle-root .battle-unit>.card-pet-badge:not([hidden]){display:inline-flex!important}
.card-field #battle-root #battle-field>.card-pet-unit>.card-pet-badge:not([hidden]){display:inline-flex!important}

/* summon mark: a calm glowing skull in the effect row */
.card-field #battle-root .card-pet-unit .card-title{padding-right:0!important}
.card-field #battle-root .card-summon-mark{border-color:#d8cfe3!important;background:#f6f2f9!important}
.card-field #battle-root .card-summon-mark img{animation:skull-glow 2.4s ease-in-out infinite}
@media(prefers-reduced-motion:reduce){.card-field #battle-root .card-summon-mark img{animation:none}}

/* Numeric results must never collapse to an ellipsis beside a summon modifier. */
.card-field #battle-root .card-event-back:not([data-kind=resource]):not([data-kind=dodge]){grid-template-columns:minmax(0,48px) minmax(0,1fr)!important;column-gap:8px!important}
.card-field #battle-root .card-event-copy{width:100%;min-width:0!important}
.card-field #battle-root .card-event-copy>.card-impact-content{width:100%;min-width:0;overflow:visible!important;flex-wrap:nowrap}
.card-field #battle-root .card-event-copy>.card-impact-content>b{flex:0 0 auto!important;overflow:visible!important;text-overflow:clip!important;white-space:nowrap;font-size:clamp(13px,4.4vw,20px)}
.card-field #battle-root .card-impact-content .combat-number-icon-wrap{flex:0 0 18px!important}
.card-field #battle-root .battle-field .card-necro-summon{border-color:#72c8cc!important;background:linear-gradient(130deg,#f4ffff,#e4f3f4 60%,#ece9fa)!important;box-shadow:inset 0 0 0 3px #f4ffff,inset 0 0 0 4px #9fd9dd,0 0 9px #65cbd040!important}
.card-field #battle-root .card-necro-summon .card-owner-line::before{background:linear-gradient(#99edf1,#5dcad6,#baa0ed)!important;box-shadow:0 0 5px #62dce8}
.card-field #battle-root .card-necro-summon .card-portrait{position:relative;background:radial-gradient(#dbfbfa,#e8e5fa)!important;border-color:#94d6d9!important}
.card-field #battle-root .card-necro-summon .card-portrait::after{content:'';position:absolute;right:-3px;bottom:-3px;width:14px;height:14px;border:1px solid #9bcdd4;border-radius:50%;background:#eaffff url('art/icons/card-field/summon-skull-20261029.webp') center/11px 11px no-repeat;box-shadow:0 0 4px #64dfe6}
.card-field #battle-root .card-necro-summon .card-portrait>img{filter:drop-shadow(0 0 2px #60ced8)}
.card-field #battle-root .card-necro-summon .card-summon-mark{border-color:#99d5da!important;background:#eaffff!important}
/* Consistent portrait framing throughout the existing portrait system. */
.portrait-window{overflow:hidden}
.portrait-window>img{object-fit:cover!important;object-position:50% 15%!important}
.card-field #battle-root .card-portrait>img{object-position:50% 15%}



/* Kiwi-lime soul summons, never blue or violet. */
.card-field #battle-root .battle-field .card-necro-summon{border-color:#a6c94d!important;background:linear-gradient(135deg,#fcfff0,#f1f8d9)!important;box-shadow:inset 0 0 0 3px #fcfff0,inset 0 0 0 4px #c8df86,0 0 9px #b4d85055!important}
.card-field #battle-root .card-necro-summon .card-owner-line::before{background:linear-gradient(#d6ef8d,#a5ce38,#c5e26b)!important;box-shadow:0 0 5px #badc53}
.card-field #battle-root .card-necro-summon .card-portrait{background:radial-gradient(#fbffe9,#e8f1c8)!important;border-color:#c1d589!important}
.card-field #battle-root .card-necro-summon .card-portrait::after{display:none!important}
.card-field #battle-root .card-necro-summon .card-portrait>img{filter:drop-shadow(0 0 2px #b7d856)}
.card-field #battle-root .card-necro-summon .card-effects:empty{display:none!important}

/* Restrained dark kiwi border: solid edges, no neon blur. */
.card-field #battle-root .battle-field .card-necro-summon{border-color:#73863f!important;background:linear-gradient(135deg,#fbfcf4,#f0f3e4)!important;box-shadow:inset 0 0 0 3px #fbfcf4,inset 0 0 0 4px #b7c294,0 1px 3px #3d4a2418!important}
.card-field #battle-root .card-necro-summon .card-owner-line::before{background:#73863f!important;box-shadow:none!important}
.card-field #battle-root .card-necro-summon .card-portrait{background:#f1f4e6!important;border-color:#9fac78!important}
.card-field #battle-root .card-necro-summon .card-portrait>img{filter:none}
.card-field #battle-root .card-necro-summon .card-portrait::after{display:block!important;width:12px;height:12px;right:-2px;bottom:-2px;border-color:#8c9c5f;background-color:#f5f8e9;box-shadow:none}
.card-field #battle-root .card-event-back.is-necro-source{outline:1px solid #73863f;outline-offset:-3px;background:linear-gradient(135deg,#fbfcf4eb,#e9efdaeb)!important}
.card-field #battle-root .card-event-back.is-necro-source .card-event-trace rect{stroke:#73863f!important;filter:none!important}
.card-field #battle-root .card-event-back.is-necro-source .card-event-portrait{border-color:#8d9c62!important;box-shadow:none}
.card-field #battle-root .combat-player{position:relative}
.card-field #battle-root .combat-player>img.summon-profile-portrait{border:1px solid #8b9b5f!important;box-shadow:none!important;background:#f1f4e6}
.card-field #battle-root .combat-summon-mark{position:absolute;display:grid;place-items:center;width:13px;height:13px;background:#f5f8e9;border:1px solid #8b9b5f;border-radius:50%;pointer-events:none}
.card-field #battle-root .combat-summon-mark>img{width:10px;height:10px;object-fit:contain}

/* Draw the card outline, then reveal an aligned translucent jaw-opening skull. */
.card-field #battle-root .card-necro-summon.card-pet-arriving{animation:none!important}
@keyframes soul-outline-draw{to{stroke-dashoffset:0}}

/* Legible portrait marks and a border around the whole selected summon profile. */
.card-field #battle-root .card-necro-summon .card-portrait::after{width:18px;height:18px;right:-4px;bottom:-4px;background-size:16px 16px;border-radius:50%;border:1px solid #89995a}
.card-field #battle-root .card-necro-summon .card-portrait>img{object-position:50% 50%!important;padding:2px!important}
.card-field #battle-root .combat-player.summon-profile{outline:1px solid #7b8c48;outline-offset:-1px;border-radius:12px}
.card-field #battle-root .combat-player>img.summon-profile-portrait{border:0!important;background:transparent!important;object-position:50% 50%!important;object-fit:contain!important}
.card-field #battle-root .combat-summon-mark{width:18px;height:18px;box-sizing:border-box}
.card-field #battle-root .combat-summon-mark>img{width:16px;height:16px}

.card-field #battle-root .combat-player.summon-profile{outline-offset:var(--summon-frame-outset,9px)!important;border-radius:14px}

/* The selected summon profile is open at the bottom. */
.card-field #battle-root .combat-player.summon-profile{outline:none!important}
.card-field #battle-root .combat-player.summon-profile::before{content:'';position:absolute;top:calc(-1 * var(--summon-frame-outset,9px));left:calc(-1 * var(--summon-frame-outset,9px));right:calc(-1 * var(--summon-frame-outset,9px));bottom:0;border:1px solid #7b8c48;border-bottom:0;border-radius:22px 22px 0 0;pointer-events:none}

.card-field #battle-root .battle-status{position:relative}
.card-field #battle-root .battle-retreat-open{width:30px;height:30px;min-width:30px;padding:0;display:grid;place-items:center;border:1px solid #d7c9a4;border-radius:8px;background:#faf5e5;color:#8a7152;flex:none}
.card-field #battle-root .battle-retreat-open .icon{font-size:15px}
.card-field #battle-root .battle-retreat-open:disabled{opacity:.38}
.card-field #battle-root .battle-retreat-confirm{position:absolute;right:0;top:calc(100% + 6px);width:205px;box-sizing:border-box;padding:11px;display:grid;gap:7px;border:1px solid #c8b58d;border-radius:11px;background:#fffbee;box-shadow:0 4px 12px #3f392a25;z-index:120;text-align:left;font:11px/1.3 Interface,sans-serif}
.card-field #battle-root .battle-retreat-confirm strong{color:#52644f}
.card-field #battle-root .battle-retreat-confirm span{color:#8a7d61;font-size:10px}
.card-field #battle-root .battle-retreat-confirm>div{display:flex;gap:6px}
.card-field #battle-root .battle-retreat-confirm button{flex:1;min-height:30px;padding:5px;border:1px solid #d5c9a7;border-radius:6px;background:#f8f1df;font:700 10px Interface,sans-serif;color:#596952}
.card-field #battle-root .battle-retreat-confirm [data-retreat-confirm]{background:#9b6256;border-color:#91574e;color:#fffaf0}

/* Follow the console's real outer radius and close the selected profile frame. */
.card-field #battle-root .combat-player.summon-profile::before{top:var(--summon-frame-top,-9px);left:var(--summon-frame-left,-9px);right:var(--summon-frame-right,-9px);bottom:var(--summon-frame-bottom,-4px);border:1.5px solid #758844;border-radius:var(--summon-frame-radius,22px) var(--summon-frame-radius,22px) 0 0;box-sizing:border-box}
.card-field #battle-root .card-event-back .card-event-portrait.is-summon{width:42px!important;height:42px!important;max-width:none!important;object-fit:contain!important;object-position:50% 50%!important;padding:2px!important;border-radius:8px!important;border:1px solid #98a773!important;background:#f3f6e8!important;box-sizing:border-box}
.card-field #battle-root .card-event-avatar:has(>.is-summon){width:44px;overflow:visible;align-self:center}
/* Both sides grow from their centres. Curved top/bottom strokes join the ends. */
@keyframes soul-side-grow{from{transform:scaleY(0)}to{transform:scaleY(1)}}

/* The summon outline now encloses the entire console, down to the chat. */
.card-field #battle-root .combat-player.summon-profile::before{bottom:var(--summon-frame-bottom,-4px);border-radius:var(--summon-frame-radius,22px) var(--summon-frame-radius,22px) 0 0}
.card-field #battle-root .card-event-back .card-event-portrait{border-radius:8px!important}
.card-field #battle-root .card-event-back .card-event-portrait.is-creature{object-fit:contain!important;object-position:center!important;padding:2px;box-sizing:border-box;background:#faf5e6}
.card-field #battle-root .card-event-avatar .card-event-who{max-width:100%;width:100%}
.card-field #battle-root .card-event-avatar .card-event-who.is-long{width:100%}
.card-field #battle-root .card-event-avatar .card-event-who.is-long>span{animation:none!important}
.card-field #battle-root .card-pet-shield{position:relative;border:1px solid #afbf95;border-radius:4px;background:#f4f7eb}
.card-field #battle-root .card-pet-shield small{font:700 8px Interface,sans-serif}

.card-field #battle-root .card-event-avatar .card-event-who.is-long{text-align:left!important}

/* Summons: selection, clickable wards and a distinct application phase. */
.card-field #battle-root .card-necro-summon.selection-selected{border-color:#8aab3b!important;box-shadow:inset 0 0 0 1.5px #a2bd56,0 0 0 2px #a6bf6540!important}
.card-field #battle-root .card-pet-shield{cursor:pointer;pointer-events:auto}
.card-field #battle-root .card-event-copy,.card-field #battle-root .card-impact-content{box-sizing:border-box;max-width:100%;min-width:0}
.card-field #battle-root .card-event-who>span{animation:none!important}

/* Only the effect-row outline is drawn on application, never a central VFX. */
.card-field #battle-root .card-event-copy{padding-right:7px;box-sizing:border-box}

.card-field #battle-root .card-necro-summon>.card-face{transition:opacity .24s ease-out}

/* Dodge and wait stay inside the result card even on narrow screens. */
.card-field #battle-root .card-event-back[data-kind=dodge]{box-sizing:border-box;overflow:hidden;padding:8px 12px!important}
.card-field #battle-root .card-event-back[data-kind=dodge] .card-event-copy{max-width:100%;min-width:0;padding:0}
.card-field #battle-root .card-event-back[data-kind=dodge] .card-impact-content{max-width:100%;gap:4px!important;justify-content:center}
.card-field #battle-root .card-event-back[data-kind=dodge] .card-impact-content>b{font-size:clamp(11px,3.3vw,14px)!important;flex:0 1 auto!important;min-width:0}
.card-field #battle-root .card-event-back[data-kind=dodge] .card-impact-content img{width:18px!important;height:18px!important;max-width:18px!important;max-height:18px!important;flex:0 0 18px}

/* Native horizontal effect strips; vertical participant columns remain independent. */
.card-field #battle-root :is(.card-ally-scroll,.card-enemy-scroll){touch-action:auto}
.card-field #battle-root :is(.card-effects,#hero-effects){overflow-x:auto!important;overflow-y:hidden!important;display:flex;flex-wrap:nowrap!important;justify-content:flex-start!important;min-width:0;max-width:100%;scrollbar-width:none;touch-action:pan-x;overscroll-behavior-x:contain;pointer-events:auto;-webkit-overflow-scrolling:touch}
.card-field #battle-root :is(.card-effects,#hero-effects)::-webkit-scrollbar{display:none}
.card-field #battle-root :is(.card-effects,#hero-effects)>.combat-effect-icon{flex-shrink:0!important}

/* Empty effect rows must not reserve space after enabling horizontal swipes. */
.card-field #battle-root .battle-unit .card-effects:empty{display:none!important;height:0!important;min-height:0!important;margin:0!important;padding:0!important;border:0!important}
.card-field #battle-root .battle-unit.fx-empty>.card-face{grid-template-rows:minmax(0,1fr)!important;align-content:center!important}
.card-field #battle-root .battle-unit.fx-empty>.card-face>.card-main{align-self:center}

/* Result frame finishes within its notice; no idle frame waits after drawing. */
.card-field #battle-root .card-event-back>.card-event-trace rect{animation-duration:.55s!important}
.card-field #battle-root .card-cast.is-result-leaving{animation:event-out .2s ease-in both!important}
/* Compact result geometry stays fixed when party cards are narrow. */
.card-field #battle-root .card-event-back,
.card-field #battle-root .battle-unit.has-owner-line>.card-event-back,
.card-field #battle-root .monster-unit>.card-event-back{grid-template-columns:38px minmax(0,1fr)!important;gap:6px!important;padding:7px 10px!important}
.card-field #battle-root .card-event-avatar{width:38px!important;max-width:38px!important;min-width:0;justify-self:center}
.card-field #battle-root .card-event-avatar .card-event-who,.card-field #battle-root .card-event-avatar .card-event-who.is-long{width:38px!important;max-width:38px!important;font-size:8px;line-height:1.2}
.card-field #battle-root .card-event-avatar .card-event-who>span{padding-inline:2px}
.card-field #battle-root .card-event-copy>.card-impact-content{font:700 18px/1.1 Interface,sans-serif!important;gap:3px;flex-wrap:nowrap}
.card-field #battle-root .card-impact-content>img{width:14px!important;height:14px!important;flex:none}
.card-field #battle-root .card-event-show>.card-event-back.is-fresh>:not(.card-event-trace):not(.notice-slide-track){animation:notice-content-in .18s ease-out both!important;transform:none!important}
.card-field #battle-root .card-event-show>.card-event-back{animation-name:notice-content-in!important}
@keyframes notice-content-in{from{opacity:0}to{opacity:1}}
.card-field #battle-root .card-cast{padding:7px 10px;gap:6px!important;animation-name:notice-content-in!important}
.card-field #battle-root .card-cast-art{width:32px;height:32px;flex:0 0 32px;border-radius:7px}
.card-field #battle-root .card-cast-copy b{font-size:11px!important;line-height:1.2!important}
.card-field #battle-root .card-cast-copy small{font-size:8px;letter-spacing:0}
.card-field #battle-root .card-event-back:is([data-kind=resource],[data-kind=dodge]){grid-template-columns:minmax(0,1fr)!important}
.card-field #battle-root .card-event-avatar:has(>.is-summon){width:38px!important;max-width:38px!important}
.card-field #battle-root .card-event-back .card-event-portrait.is-summon{width:34px!important;height:34px!important}
.card-field #battle-root .card-event-back>.card-event-trace{animation-duration:.16s!important;animation-delay:.64s!important}
.card-field #battle-root .card-cast>.card-event-trace rect{animation-duration:.55s!important}

.card-field #battle-root .card-portrait>img{box-sizing:border-box!important;object-fit:contain!important;object-position:center!important;padding:3px!important}
.card-field #battle-root .combat-player>img.enemy-portrait{width:50px!important;height:50px!important;max-height:50px!important;flex:0 0 50px;object-fit:contain!important;object-position:center!important;padding:4px!important;box-sizing:border-box;align-self:center}
.card-field #battle-root .card-cast>.card-event-trace rect{animation-duration:.2s!important}

.card-field #battle-root .card-event-back>.card-event-trace rect{animation-duration:.75s!important}
.card-field #battle-root .card-event-back>.card-event-trace{animation-duration:.24s!important;animation-delay:.88s!important}
.card-field #battle-root .card-event-leaving>.card-event-back{animation-duration:.24s!important}

/* Portrait squares use the same full, centred bust framing as the lower profile. */
.card-field #battle-root .card-portrait{width:46px;height:46px;flex-basis:46px;overflow:visible}
.card-field #battle-root .card-portrait>img{padding:0!important;object-fit:contain!important;object-position:center!important;border-radius:inherit}
.card-field #battle-root .monster-unit .card-portrait{width:42px;height:42px;flex-basis:42px}
.card-field #battle-root .monster-unit .card-portrait>img{transform:none!important}
.card-field #battle-root .card-necro-summon .card-portrait>img{padding:0!important}
.card-field #battle-root .card-event-show>.card-event-back{animation-duration:.32s!important}
.card-field #battle-root .card-event-leaving>.card-event-back{animation-duration:.32s!important}
.card-field #battle-root .card-event-show>.card-event-back.is-fresh>:not(.card-event-trace){animation-duration:.42s!important;animation-delay:.12s!important}
.card-field #battle-root .card-event-back>.card-event-trace rect{animation-duration:.9s!important}
.card-field #battle-root .card-event-back>.card-event-trace{animation-delay:1.05s!important;animation-duration:.3s!important}
.card-field #battle-root .card-cast{animation-duration:.32s!important}
.card-field #battle-root .card-cast>.card-event-trace rect{animation-duration:.55s!important}
img[src$="/normal-bat.webp"],img[src$="/portraits/bat.png"]{scale:-1 1}
.card-field #battle-root .card-event-copy>.card-event-skill-title{font:700 9px/1.2 Interface,sans-serif!important;white-space:normal;max-width:100%;color:#55715f}
.card-field #battle-root .card-event-show>.card-event-back{animation-duration:.22s!important}
.card-field #battle-root .card-event-leaving>.card-event-back{animation-duration:.2s!important}
.card-field #battle-root .card-event-back>.card-event-trace{animation-delay:.55s!important;animation-duration:.2s!important}
.card-field #battle-root .card-event-back>.card-event-trace rect{animation-duration:.55s!important}

.card-field #battle-root .card-event-show.card-event-leaving>.card-event-back{animation-name:event-out!important}
.card-field #battle-root .card-flipping{pointer-events:auto!important;will-change:auto}

/* Centre words independently of the hidden avatar column; keep hit groups balanced. */
.card-field #battle-root .battle-unit.card-event-show>.card-event-back:is([data-kind=resource],[data-kind=dodge]){display:flex!important;align-items:center!important;justify-content:center!important;text-align:center;padding:7px 12px!important}
.card-field #battle-root .battle-unit.card-event-show>.card-event-back:is([data-kind=resource],[data-kind=dodge]) .card-event-copy{width:auto!important;min-width:0;flex:0 1 auto;align-items:center!important;justify-content:center!important;text-align:center}
.card-field #battle-root .battle-unit.card-event-show>.card-event-back:is([data-kind=resource],[data-kind=dodge]) .card-impact-content{justify-content:center!important;align-items:center!important;text-align:center}
.card-field #battle-root .battle-unit.card-event-show>.card-event-back:not([data-kind=resource]):not([data-kind=dodge]){grid-template-columns:38px minmax(0,max-content)!important;justify-content:center!important}
.card-field #battle-root .card-notice-handoff>.card-event-back{animation:none!important;opacity:1!important}

.card-field #battle-root .card-event-copy{padding-right:0!important}

/* Eldar's hands hover quietly on opposite sides of his central card. */
.card-field #battle-root .card-eldar-left:not(.card-event-show)>.card-face{animation:eldar-card-hover 4.2s ease-in-out infinite}
.card-field #battle-root .card-eldar-right:not(.card-event-show)>.card-face{animation:eldar-card-hover 4.2s -2.1s ease-in-out infinite}
@keyframes eldar-card-hover{0%,100%{transform:translateY(-2px)}50%{transform:translateY(2px)}}
@media(prefers-reduced-motion:reduce){.card-field #battle-root :is(.card-eldar-left,.card-eldar-right)>.card-face{animation:none!important}}

.card-field #battle-root .eldar-hand[data-arrival-state="preparing"]{opacity:0!important}

/* Periodic damage heats the existing card; it never draws perimeter lines. */
.card-field #battle-root .card-event-back[data-periodic]:not([data-periodic=""]){--tick-rgb:176,82,44;--tick-wash:#fff0df;border-color:rgba(var(--tick-rgb),.65)!important;background:radial-gradient(ellipse at 50% 85%,rgba(var(--tick-rgb),.16),transparent 75%),linear-gradient(135deg,#fffdf5,var(--tick-wash))!important}
.card-field #battle-root .card-event-back[data-periodic][data-periodic=curse]{--tick-rgb:135,77,160;--tick-wash:#f3e8f7}
.card-field #battle-root .card-event-back[data-periodic][data-periodic=burn]{--tick-rgb:222,88,36;--tick-wash:#fff0da}
.card-field #battle-root .card-event-back[data-periodic][data-periodic=poison]{--tick-rgb:110,144,52;--tick-wash:#eef3df}
.card-field #battle-root .card-event-back[data-periodic][data-periodic=bleed]{--tick-rgb:176,65,65;--tick-wash:#f7e6e0}
.card-field #battle-root .card-event-show>.card-event-back[data-periodic]:not([data-periodic=""]){animation:periodic-card-heat .99s ease-out both!important}
.card-field #battle-root .card-event-show.card-event-leaving>.card-event-back[data-periodic]:not([data-periodic=""]){animation:event-out .2s ease-in both!important}
.card-field #battle-root .card-event-back[data-periodic]:not([data-periodic=""]) .card-event-trace{display:block!important;animation:periodic-contour-in .32s ease-out both!important;opacity:1}
.card-field #battle-root .card-event-back[data-periodic]:not([data-periodic=""]) .card-impact-content b{color:rgb(var(--tick-rgb))!important}
@keyframes periodic-card-heat{0%{opacity:1;box-shadow:inset 0 0 0 rgba(var(--tick-rgb),0)}32%{opacity:1;box-shadow:inset 0 0 14px rgba(var(--tick-rgb),.2)}65%{opacity:1;box-shadow:inset 0 0 18px rgba(var(--tick-rgb),.14)}100%{opacity:1;box-shadow:inset 0 0 7px rgba(var(--tick-rgb),.08)}}
@media(prefers-reduced-motion:reduce){.card-field #battle-root .card-event-show>.card-event-back[data-periodic]:not([data-periodic=""]){animation:none!important}}

/* Periodic outline appears as a whole and warms gently, instead of tracing around. */
.card-field #battle-root .card-event-back[data-periodic]:not([data-periodic=""]) .card-event-trace rect{stroke:rgba(var(--tick-rgb),.65);filter:none}
.card-field #battle-root .card-event-back[data-periodic]:not([data-periodic=""]) .card-event-trace rect+rect{stroke-opacity:.3}
@keyframes periodic-contour-in{from{opacity:0}to{opacity:1}}
.card-field #battle-root :is(.card-eldar-left,.card-eldar-right):not(.card-event-show)>.card-face{animation:none!important}

/* Slightly slower presentation, with the same fixed tempo for every participant. */
.card-field #battle-root .card-event-show>.card-event-back{animation-duration:.24s!important}
.card-field #battle-root .card-event-show.card-event-leaving>.card-event-back{animation-duration:.22s!important}
.card-field #battle-root .card-cast{animation-duration:.35s!important}
.card-field #battle-root .card-cast.is-result-leaving{animation-duration:.22s!important}
.card-field #battle-root .card-event-back>.card-event-trace rect,.card-field #battle-root .card-cast>.card-event-trace rect{animation-duration:.6s!important}
.card-field #battle-root .card-notice-handoff>.card-event-back{animation:none!important;opacity:1!important}

/* One more small step in notice duration, without queue-based acceleration. */
.card-field #battle-root .card-event-show>.card-event-back{animation-duration:.25s!important}
.card-field #battle-root .card-event-show.card-event-leaving>.card-event-back{animation-duration:.23s!important}
.card-field #battle-root .card-cast{animation-duration:.37s!important}
.card-field #battle-root .card-cast.is-result-leaving{animation-duration:.23s!important}
.card-field #battle-root .card-event-back>.card-event-trace rect,.card-field #battle-root .card-cast>.card-event-trace rect{animation-duration:.63s!important}

/* Burn/curse are a warm flare within the card, never a flashing stroke. */
.card-field #battle-root .card-event-show>.card-event-back[data-periodic]:not([data-periodic=""]){animation:none!important;opacity:1;isolation:isolate;box-shadow:inset 0 0 8px rgba(var(--tick-rgb),.12)}
.card-field #battle-root .card-event-show>.card-event-back[data-periodic]:not([data-periodic=""]) .card-event-trace{display:none!important}
.card-field #battle-root .card-event-back[data-periodic]:not([data-periodic=""])>.card-periodic-heat{position:absolute;inset:0;border-radius:inherit;pointer-events:none;z-index:-1;background:radial-gradient(ellipse at 16% 100%,rgba(var(--tick-rgb),.58),transparent 65%),radial-gradient(ellipse at 85% 95%,rgba(var(--tick-rgb),.45),transparent 64%);animation:periodic-flare .99s cubic-bezier(.2,.65,.3,1) both!important;transform:none!important}
@keyframes periodic-flare{0%{opacity:0;box-shadow:inset 0 -2px 2px rgba(var(--tick-rgb),0)}28%{opacity:.85;box-shadow:inset 0 -8px 23px rgba(var(--tick-rgb),.42)}55%{opacity:.65;box-shadow:inset 0 -5px 17px rgba(var(--tick-rgb),.3)}100%{opacity:0;box-shadow:inset 0 0 6px rgba(var(--tick-rgb),0)}}
.card-field #battle-root .card-event-show.card-event-leaving>.card-event-back[data-periodic]:not([data-periodic=""]){animation:event-out .23s ease-in both!important}
@media(prefers-reduced-motion:reduce){.card-field #battle-root .card-periodic-heat{display:none!important}}

/* Distinct, soft backgrounds for the two periodic damage families. */
.card-field #battle-root .card-event-back[data-periodic][data-periodic=curse]{--tick-rgb:151,104,181;--tick-wash:#f3eaf9;background:radial-gradient(ellipse at 50% 85%,#d8bce842,transparent 78%),linear-gradient(135deg,#fcf8ff,#eee1f6)!important;border-color:#c8add9!important}
.card-field #battle-root .card-event-back[data-periodic][data-periodic=burn]{--tick-rgb:235,103,29;--tick-wash:#ffead0;background:radial-gradient(ellipse at 50% 90%,#ffae5b50,transparent 78%),linear-gradient(135deg,#fff9ef,#ffe1bb)!important;border-color:#e4b17b!important}

/* Soul credit is part of the single lethal-hit notice, never a second portrait. */
.card-field #battle-root .card-event-back.is-fatal{background:linear-gradient(135deg,#f0f0e9,#e2e3dc)!important}
.card-field #battle-root .card-event-back.is-fatal.has-soul-credit{border-color:#768c45!important;--impact-source:#769943}
.card-field #battle-root .card-event-back.is-fatal.has-soul-credit>.card-event-trace rect{stroke:#769943!important;stroke-width:1.8px;filter:drop-shadow(0 0 2px #a0ba65)!important}
.card-field #battle-root .card-soul-credits{position:absolute;top:4px;left:7px;right:7px;display:flex;justify-content:center;gap:3px;z-index:4;pointer-events:none}
.card-field #battle-root .card-soul-credit{display:inline-flex;align-items:center;justify-content:center;gap:2px;min-width:27px;height:16px;padding:0 3px;border:1px solid #a5b58b;border-left:3px solid var(--soul-owner);border-right:3px solid var(--soul-owner);border-radius:4px;background:#f2f5e7;color:#526d30;box-sizing:border-box}
.card-field #battle-root .card-soul-credit img{width:12px;height:12px;object-fit:contain}
.card-field #battle-root .card-soul-credit b{font:700 10px/1 Interface,sans-serif}
.card-field #battle-root .card-event-back.has-soul-credit{padding-top:21px!important}
.card-field #battle-root .card-event-back.has-soul-credit .card-event-portrait{height:33px}
.card-field #battle-root .card-event-back.has-soul-credit .card-event-who{font-size:8px}

/* Keep recipient colors visible after the defeated unit becomes grey. */
.card-field #battle-root .monster-unit.dead:has(>.card-event-back.has-soul-credit):not(.death-finished){filter:none!important;opacity:1}
.card-field #battle-root .card-event-back.is-fatal .card-event-portrait{filter:grayscale(1)}
.card-field #battle-root .card-soul-credits{top:4px;left:7px;right:7px;gap:4px;align-items:center;min-height:22px}
.card-field #battle-root .card-soul-credit{height:22px;min-width:38px;padding:0 5px;gap:3px;background:#e9ebe3;color:#41572d;border:1px solid #b3b9aa;border-left:3px solid var(--soul-owner);border-right:3px solid var(--soul-owner);border-radius:5px;box-shadow:inset 0 1px #ffffff9c;flex:none}
.card-field #battle-root .card-soul-credit img{width:15px;height:15px;display:block;flex:none}
.card-field #battle-root .card-soul-credit b{display:block;font:700 12px/1 Interface,sans-serif;white-space:nowrap}
.card-field #battle-root .battle-unit>.card-event-back.has-soul-credit{padding-top:29px!important;padding-bottom:6px!important}
.card-field #battle-root .card-soul-credits:has(>:nth-child(4)){gap:2px;left:5px;right:5px}
.card-field #battle-root .card-soul-credits:has(>:nth-child(4))>.card-soul-credit{flex:1;min-width:0;padding-inline:2px;gap:1px}
.card-field #battle-root .card-soul-credits:has(>:nth-child(4))>.card-soul-credit img{width:12px;height:12px}
.card-field #battle-root .card-soul-credits:has(>:nth-child(4))>.card-soul-credit b{font-size:11px}

/* Lethal notice: a dedicated credit row above its source and damage. */
.card-field #battle-root .monster-unit:has(>.card-event-back.is-fatal):not(.death-finished){filter:none!important;opacity:1}
.card-field #battle-root .battle-unit.monster-unit.card-event-show>.card-event-back.is-fatal.has-soul-credit{display:grid!important;grid-template-columns:38px minmax(0,1fr)!important;grid-template-rows:24px minmax(0,1fr)!important;padding:4px 9px 6px!important;gap:3px 6px!important;align-content:stretch!important;justify-content:center!important}
.card-field #battle-root .card-event-back.has-soul-credit>.card-soul-credits{position:relative;inset:auto;grid-column:1/-1;grid-row:1;justify-self:center;width:max-content;max-width:100%;height:24px;min-height:24px;align-self:start;animation:none!important}
.card-field #battle-root .card-event-back.has-soul-credit>.card-event-avatar{grid-column:1;grid-row:2;align-self:center}
.card-field #battle-root .card-event-back.has-soul-credit>.card-event-copy{grid-column:2;grid-row:2;align-self:center}
.card-field #battle-root .card-soul-credit{position:relative;border:1px solid #b7bcad!important;padding:0 8px!important;background:#f1f2e9!important;color:#45652b!important}
.card-field #battle-root .card-soul-credit>.soul-owner-mark{position:absolute;top:3px;bottom:3px;width:3px;border-radius:2px;background:var(--soul-owner,#3d8177)!important;box-shadow:0 0 0 1px #ffffff60}
.card-field #battle-root .soul-owner-mark.is-left{left:2px}.card-field #battle-root .soul-owner-mark.is-right{right:2px}
.card-field #battle-root .card-soul-credits:has(>:nth-child(4))>.card-soul-credit{padding-inline:5px!important}
/* Phoenix appearance uses its elemental plumage, never the necromancer skull. */
.card-field #battle-root .card-phoenix>.card-face{border-color:var(--phoenix-color)!important;background:linear-gradient(120deg,color-mix(in srgb,var(--phoenix-color),#fffdf3 93%),#fffdf4)!important}
.card-field #battle-root .card-phoenix .card-portrait{overflow:hidden;border-color:color-mix(in srgb,var(--phoenix-color),#e3dcc2 55%)!important;background:#fffcf0!important}
.card-field #battle-root .card-phoenix .card-portrait img{object-fit:contain!important;object-position:center!important;padding:1px!important;transform:none!important}
.card-field #battle-root .card-phoenix .card-bar.res em{background:linear-gradient(100deg,color-mix(in srgb,var(--phoenix-color),white 24%),var(--phoenix-color),color-mix(in srgb,var(--phoenix-color),white 40%));background-size:200% 100%;animation:phoenix-life-shimmer 2.5s linear infinite}
@keyframes phoenix-life-shimmer{to{background-position:-200% 0}}

/* A receipt has its own colored contour, without wide side-marker gutters. */
.card-field #battle-root .card-event-back.has-soul-credit>.card-soul-credits{display:grid!important;grid-template-columns:repeat(var(--soul-count,1),minmax(0,1fr));gap:4px;justify-self:stretch;width:100%;min-width:0;max-width:100%;box-sizing:border-box}
.card-field #battle-root .card-soul-credits>.card-soul-credit{min-width:0!important;width:100%;height:22px;padding:0 3px!important;gap:2px;border:0!important;box-shadow:none;box-sizing:border-box;overflow:visible}
.card-field #battle-root .card-soul-credits>.card-soul-credit img{width:12px;height:12px;flex:none}
.card-field #battle-root .card-soul-credits>.card-soul-credit b{font-size:11px}
.card-field #battle-root .card-soul-credits:has(>:nth-child(4)){gap:2px}
.card-field #battle-root .card-soul-credits:has(>:nth-child(4))>.card-soul-credit{padding-inline:2px!important;gap:1px}
.card-field #battle-root .card-soul-credits:has(>:nth-child(4))>.card-soul-credit img{width:10px;height:12px}
.card-field #battle-root .card-soul-credits:has(>:nth-child(4))>.card-soul-credit b{font-size:10px}
.card-field #battle-root .soul-credit-trace{position:absolute;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none;fill:none;stroke:var(--soul-owner,#3d8177);stroke-width:2.1;stroke-linecap:round}
.card-field #battle-root .soul-credit-trace rect{x:1px;y:1px;width:calc(100% - 2px);height:calc(100% - 2px);rx:4px;ry:4px;stroke-dasharray:50 50;stroke-dashoffset:25;animation:soul-receipt-trace .78s cubic-bezier(.2,.65,.3,1) both}
.card-field #battle-root .soul-credit-trace rect+rect{stroke-dashoffset:-25;animation-name:soul-receipt-trace-return}
@keyframes soul-receipt-trace{0%{stroke-dasharray:0 100;stroke-dashoffset:75;opacity:0}20%{opacity:.8}100%{stroke-dasharray:50 50;stroke-dashoffset:25;opacity:1}}
@keyframes soul-receipt-trace-return{0%{stroke-dasharray:0 100;stroke-dashoffset:-75;opacity:0}20%{opacity:.8}100%{stroke-dasharray:50 50;stroke-dashoffset:-25;opacity:1}}
/* The target-color rail has constant width, including a party of four. */
.card-field #battle-root .card-target-lines{width:3px!important;right:5px!important;top:13px!important;bottom:13px!important;gap:3px!important}
.card-field #battle-root .card-target-lines>i{width:3px!important;box-shadow:none!important}
.card-field #battle-root .monster-unit>.card-face{padding-right:11px!important}
.card-field #battle-root .monster-unit>.card-event-back:not(.has-soul-credit){padding-right:11px!important}
/* A periodic result warms in, then its contour spreads and gently glows. */
.card-field #battle-root .battle-unit.card-event-show>.card-event-back[data-periodic]:not([data-periodic=""]){animation:periodic-surface-in .28s ease-out both!important}
.card-field #battle-root .battle-unit.card-event-show>.card-event-back[data-periodic]:not([data-periodic=""])>.card-event-trace{display:block!important;opacity:1;animation:none!important}
.card-field #battle-root .battle-unit.card-event-show>.card-event-back[data-periodic]:not([data-periodic=""])>.card-event-trace rect{stroke:rgba(var(--tick-rgb),.78)!important;stroke-width:1.6px;stroke-dasharray:50 50;stroke-dashoffset:25;animation:periodic-line-warm .85s cubic-bezier(.2,.6,.3,1) both!important;filter:none!important}
.card-field #battle-root .battle-unit.card-event-show>.card-event-back[data-periodic]:not([data-periodic=""])>.card-event-trace rect+rect{stroke-opacity:1;stroke-dashoffset:-25!important;animation-name:periodic-line-warm-return!important}
.card-field #battle-root .card-event-back[data-periodic]:not([data-periodic=""])>.card-periodic-heat{animation:periodic-soft-heat 1.05s ease-in-out both!important}
@keyframes periodic-surface-in{from{opacity:0}to{opacity:1}}
@keyframes periodic-line-warm{0%{stroke-dasharray:0 100;opacity:0;stroke-width:1px}30%{opacity:.5}72%{opacity:1;stroke-width:1.8px}100%{stroke-dasharray:50 50;opacity:.8;stroke-width:1.6px}}
@keyframes periodic-line-warm-return{0%{stroke-dasharray:0 100;opacity:0;stroke-width:1px}30%{opacity:.5}72%{opacity:1;stroke-width:1.8px}100%{stroke-dasharray:50 50;opacity:.8;stroke-width:1.6px}}
@keyframes periodic-soft-heat{0%,100%{opacity:0}40%{opacity:.4}68%{opacity:.32}}
/* Reveal the phoenix in a small focus square while elemental veins reach it. */
.card-field #battle-root .phoenix-veins{position:absolute;inset:0;width:100%;height:100%;fill:none;stroke:var(--phoenix-color);stroke-width:1.4;stroke-linecap:round;opacity:.7;filter:drop-shadow(0 0 1px var(--phoenix-color));z-index:2;pointer-events:none}
.card-field #battle-root .phoenix-veins path{stroke-dasharray:100;stroke-dashoffset:100;animation:phoenix-vein-flow 1.15s ease-out both}
.card-field #battle-root .phoenix-veins path+path{animation-delay:.08s}
.card-field #battle-root .phoenix-veins path+path+path{animation-delay:.14s}
@keyframes phoenix-square-reveal{0%,12%{opacity:0;clip-path:circle(0% at 50% 65%);transform:scale(.88)}58%{opacity:.9;clip-path:circle(80% at 50% 50%);transform:scale(1)}85%{opacity:.95}100%{opacity:0;clip-path:circle(85% at 50% 50%);transform:scale(1)}}
@keyframes phoenix-vein-flow{0%{stroke-dashoffset:100;opacity:0}25%{opacity:.6}65%{stroke-dashoffset:0;opacity:.65}100%{stroke-dashoffset:0;opacity:0}}
@keyframes phoenix-card-veins{0%{stroke-dasharray:0 100;opacity:0}22%{opacity:.7}75%,100%{stroke-dasharray:50 50;opacity:1}}
@media(prefers-reduced-motion:reduce){.card-field #battle-root .soul-credit-trace rect{animation:none}.card-field #battle-root .phoenix-veins{display:none}}

/* One quiet receipt strip; no row of miniature rainbow boxes. */
.card-field #battle-root .card-event-back.has-soul-credit>.card-soul-credits{grid-template-columns:16px repeat(var(--soul-count,1),minmax(0,1fr));height:22px;min-height:22px;gap:0!important;padding:0 3px;border:1px solid #c6c9b9;border-radius:5px;background:linear-gradient(#f9faf3,#eeefe6);align-items:center;overflow:hidden}
.card-field #battle-root .card-soul-credits>.soul-receipt-icon{width:13px;height:16px;object-fit:contain;justify-self:center}
.card-field #battle-root .card-soul-credits>.card-soul-credit,.card-field #battle-root .card-soul-credits:has(>:nth-child(4))>.card-soul-credit{display:flex;align-items:center;justify-content:center;width:100%;min-width:0!important;height:20px;background:none!important;border:0!important;box-shadow:none!important;padding:0!important;gap:0!important;border-radius:0;color:#4e6540!important}
.card-field #battle-root .card-soul-credits>.card-soul-credit b,.card-field #battle-root .card-soul-credits:has(>:nth-child(4))>.card-soul-credit b{font:700 11px/1 Interface,sans-serif}
.card-field #battle-root .soul-receipt-contour{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;fill:none;stroke-width:1.7;stroke-linecap:round}
.card-field #battle-root .soul-receipt-contour path{vector-effect:non-scaling-stroke;stroke-dasharray:100;stroke-dashoffset:100;animation:soul-strip-draw .8s cubic-bezier(.2,.65,.3,1) both;opacity:.9}
@keyframes soul-strip-draw{from{stroke-dashoffset:100;opacity:0}35%{opacity:.7}to{stroke-dashoffset:0;opacity:.9}}
@media(prefers-reduced-motion:reduce){.card-field #battle-root .soul-receipt-contour path{animation:none;stroke-dashoffset:0}.card-field #battle-root .battle-unit.card-event-show>.card-event-back[data-periodic]:not([data-periodic=""]){animation:none!important}.card-field #battle-root .battle-unit.card-event-show>.card-event-back[data-periodic]:not([data-periodic=""])>.card-event-trace rect{animation:none!important}}

/* A thin common receipt with quiet separators between personal credits. */
.card-field #battle-root .soul-receipt-contour{stroke-width:1.05;stroke-linecap:round}
.card-field #battle-root .soul-receipt-contour path{opacity:.78}
.card-field #battle-root .card-soul-credits>.card-soul-credit::before{content:"";position:absolute;left:0;top:5px;bottom:5px;width:1px;background:#c1c6b6;opacity:.7}
.card-field #battle-root .card-event-back.has-soul-credit>.card-soul-credits{border-color:#d0d2c5}
/* The painted bust fills the same portrait frame as other participants. */
.card-field #battle-root .card-phoenix .card-portrait{overflow:hidden}
.card-field #battle-root .card-phoenix .card-portrait img{width:100%!important;height:100%!important;max-width:none!important;max-height:none!important;object-fit:cover!important;object-position:50% 46%!important;padding:0!important;transform:scale(1.1)!important;transform-origin:50% 56%;border-radius:0!important}
.card-field #battle-root #combat-profile>img[data-mage-pet-portrait]{object-fit:cover!important;object-position:50% 46%!important;padding:0!important;background:#fff9e9;border:1px solid #d8caaa;border-radius:7px}

/* Short six-pose emergence: the sprite itself is never blended or stretched. */
.card-field #battle-root .phoenix-reveal.is-loading *{animation-play-state:paused!important}

/* The receipt is one fine connected outline, including its colored dividers. */
.card-field #battle-root .card-event-back.has-soul-credit>.card-soul-credits{border:0!important}
.card-field #battle-root .card-soul-credits>.card-soul-credit::before{display:none!important}
.card-field #battle-root .soul-receipt-contour{stroke-width:1;stroke-linecap:butt;stroke-linejoin:round}
.card-field #battle-root .soul-receipt-contour path{opacity:.82}
/* Same six stages and reveal clock as the necromancer skull; only an egg cracks. */




/* Confine the summon outline to the console, below modal/chat layers. */
.card-field #battle-root .combat-player.summon-profile::before{display:none!important}
.card-field #battle-root .battle-console{position:relative;isolation:isolate}
.card-field #battle-root .battle-console.summon-console::after{content:"";position:absolute;inset:0;border:1.5px solid #758844;border-radius:inherit;pointer-events:none;z-index:0;box-sizing:border-box}
#app.app-chat #battle-root .battle-console.summon-console::after{visibility:hidden}
.card-field #battle-root #combat-profile.phoenix-profile>img{width:54px!important;height:64px!important;max-width:54px!important;object-fit:cover!important;object-position:center!important;transform:none!important;align-self:center;box-sizing:border-box}
.card-field #battle-root #combat-profile.phoenix-profile{align-items:center;min-height:78px}
.card-field #battle-root .phoenix-profile .combat-player-name{align-items:center;min-width:0;gap:6px}
.card-field #battle-root .phoenix-profile .combat-player-name>span{min-width:0}
.card-field #battle-root .phoenix-profile .pet-turns{padding-top:3px;margin:0;min-width:0}
.card-field #battle-root .phoenix-profile .pet-turns .vital-row{display:flex;align-items:center;justify-content:space-between;gap:8px;line-height:1.3;margin-bottom:3px}
.card-field #battle-root .phoenix-profile .pet-turns .vital-row strong{white-space:nowrap}
.card-field #battle-root .card-phoenix.selection-selected{border-color:#c6a04d!important;box-shadow:inset 0 0 0 1px #e2c476,0 0 0 2px #d8b65a55,0 0 10px #ddb35933!important}

.card-field #battle-root .card-phoenix.selection-selected{box-shadow:inset 0 0 0 1px #e9ce84,0 0 0 2px #e4bd6777,0 0 12px #edbf554d!important}
.card-field #battle-root .card-pet-unit .card-bar.res em,.card-field #battle-root .pet-turns .progress>span,.mage-pet-life i{transition:width .48s cubic-bezier(.22,.61,.36,1)!important}
@keyframes pet-soft-depart{from{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(3px)}}
.card-field #battle-root .card-pet-unit.card-pet-leaving{animation:pet-soft-depart .56s ease-out forwards!important;pointer-events:none}
@media(prefers-reduced-motion:reduce){.card-field #battle-root .card-pet-unit.card-pet-leaving{animation-duration:.1s!important}.card-field #battle-root .pet-turns .progress>span,.card-field #battle-root .card-pet-unit .card-bar.res em{transition:none!important}}

.card-field #battle-root .card-event-back.has-soul-credit>.card-soul-credits{position:relative!important;inset:auto!important;width:max-content!important;max-width:100%!important;transform:none!important;grid-template-columns:16px repeat(var(--soul-count,1),minmax(24px,max-content));justify-self:center!important;margin-inline:auto!important}
.card-field #battle-root .card-soul-credits>.card-soul-credit{padding:0 6px!important;width:auto!important;box-sizing:border-box}

/* Soul receipt is an overlay; it does not create a second content row. */
.card-field #battle-root .battle-unit.monster-unit.card-event-show>.card-event-back.is-fatal.has-soul-credit{grid-template-rows:minmax(0,1fr)!important;padding:9px 10px!important;gap:6px!important;align-items:center!important;align-content:center!important}
.card-field #battle-root .card-event-back.has-soul-credit>.card-event-avatar,.card-field #battle-root .card-event-back.has-soul-credit>.card-event-copy{grid-row:1!important;align-self:center!important}
.card-field #battle-root .card-event-back.has-soul-credit>.card-soul-credits{position:absolute!important;inset:6px auto auto 50%!important;transform:translateX(-50%)!important;width:max-content!important;max-width:calc(100% - 20px)!important;height:18px!important;min-height:18px!important;margin:0!important;align-self:auto!important}
.card-field #battle-root .card-soul-credits>.card-soul-credit{height:16px!important}
.card-field #battle-root .card-soul-credits>.soul-receipt-icon{height:14px!important}

.card-field #battle-root .card-event-back.has-soul-credit>.card-soul-credits{inset:6px 0 auto 0!important;transform:none!important;margin:0 auto!important;grid-area:auto!important;justify-self:auto!important}

/* Multiple contacts share one result card and one journal row. */
.journal-hit-parts{display:inline-flex;align-items:baseline;gap:3px;white-space:nowrap}
.journal-hit-separator{font-weight:400;color:#9e947b}
.journal-dual-critical,.journal-crit{color:#ed7517!important;font-weight:750!important}
.card-field #battle-root .card-impact-content.has-paired-hits{display:block!important;width:100%;min-width:0}
.card-field #battle-root .paired-hit{display:grid;place-items:center;min-width:0;padding:2px 1px}
.card-field #battle-root .paired-hit b{font:700 clamp(10px,3.1vw,15px)/1.2 Interface,sans-serif!important;white-space:nowrap;color:#b35c4e!important}
.card-field #battle-root .paired-hit.is-critical b,.card-field #battle-root .card-impact-content.critical>b{color:#ed7517!important;text-shadow:0 0 5px #eea13524}
.card-field #battle-root .paired-hit.is-dodged b{font-size:9px!important;color:#7a8765!important}
.card-field #battle-root .card-impact-content.is-blocked:not(.critical)>b,.card-field #battle-root .notice-next.is-blocked:not(.is-critical) b{color:#477c91!important;text-shadow:0 0 6px #8bb6ca42}
.card-field #battle-root .card-impact-content.is-blocked>b{border-bottom:1px solid #83a6b58c}
.card-field #battle-root .notice-next.is-critical b,.combat-popup.critical>b{color:#ed7517!important;text-shadow:0 0 7px #eea13555}

/* Consecutive contacts scroll only their value; the event frame never changes. */
.card-field #battle-root .paired-hit-values{display:block!important;overflow:hidden;width:100%;min-width:0;position:relative}
.card-field #battle-root .paired-hit-track{display:flex;width:100%;will-change:transform}
.card-field #battle-root .paired-hit{flex:0 0 100%;width:100%;box-sizing:border-box;border:0!important;padding:3px 0!important;min-width:0}
.card-field #battle-root .paired-hit b{font:750 clamp(14px,4.8vw,21px)/1.2 Interface,sans-serif!important}
.card-field #battle-root .paired-hit.is-dodged b{font-size:11px!important}

/* Personal preparations occupy no room in the status strip or the card layout. */
.card-field #battle-root .card-portrait{position:relative;overflow:visible!important}
.card-field #battle-root .combat-prep-counter{position:absolute;left:50%;bottom:-5px;transform:translateX(-50%);min-height:15px;min-width:29px;padding:1px 4px;display:grid;place-items:center;border:1px solid #b2bc91;border-radius:5px;background:#eef2da;color:#526747;box-shadow:0 1px 2px #34432a16;font:700 9px/1.15 Interface,sans-serif;white-space:nowrap;z-index:2}
.card-field #battle-root .hunter-focus-eye{position:absolute;left:50%;bottom:-3px;transform:translateX(-50%);width:23px;height:15px;padding:1px 2px;border:1px solid #a6b47c;border-radius:5px;background:#eff1d9;display:grid;place-items:center;z-index:2}
.card-field #battle-root .hunter-focus-eye img{width:18px!important;height:11px!important;object-fit:contain;transform:none!important;border:0!important;border-radius:0!important}
.card-field #battle-root .hunter-private-focus .card-portrait{box-shadow:0 0 0 1px #9aa86d;animation:hunter-private-focus 1.8s ease-in-out 2}
@keyframes hunter-private-focus{0%,100%{box-shadow:0 0 0 1px #9aa86d}50%{box-shadow:0 0 0 2px #b3bb79,0 0 6px #b3bb7930}}
.card-field #battle-root .combat-effect-icon img[src*="/frontier-20261102/"]{width:16px!important;height:16px!important}
.effect-term-link{display:inline-flex;align-items:center;gap:3px;padding:1px 4px;margin:2px 3px;border:1px solid #c7cbae;border-radius:4px;background:#eef0df;color:#486653;font:inherit;line-height:1.35;vertical-align:baseline;white-space:nowrap}
@media(prefers-reduced-motion:reduce){.card-field #battle-root .hunter-private-focus .card-portrait{animation:none}}

.card-field #battle-root .card-portrait>img{border-radius:inherit}
.card-field #battle-root .combat-prep-counter{display:flex;gap:2px;align-items:center;justify-content:center;padding:1px 3px;min-width:29px}
.card-field #battle-root .combat-prep-counter>img{width:12px!important;height:12px!important;object-fit:contain;border:0!important;border-radius:0!important;transform:none!important;flex:none}
.card-field #battle-root .hunter-focus-eye{bottom:-7px;animation:none;opacity:1}
@keyframes hunter-eye-breathe{0%,100%{opacity:1;box-shadow:0 0 0 #a3ba7100}50%{opacity:.55;box-shadow:0 0 4px #a3ba7128}}
.card-field #battle-root .paired-hit-values{border-radius:5px;background:linear-gradient(90deg,#c3b68c0d,#e2cf9222 50%,#c3b68c0d);mask-image:linear-gradient(90deg,transparent,#000 7%,#000 93%,transparent)}
.card-field #battle-root .paired-hit{gap:1px;padding-block:1px!important}
.card-field #battle-root .paired-hit-step{display:block;font:600 7px/1.1 Interface,sans-serif!important;letter-spacing:.04em;color:#9b9479}
#valgard-effect-note>header h3{display:flex;align-items:center;gap:6px;min-width:0}
.effect-note-title-art{width:23px;height:23px;object-fit:contain;flex:none;box-sizing:border-box;padding:1px;border:1px solid #b6bea0;border-radius:5px;background:#f3f1df}
@media(prefers-reduced-motion:reduce){.card-field #battle-root .hunter-focus-eye{animation:none}}

/* Preparation colors ease in and out without restarting card actions. */
.combat-prep-counter{transition:background-color .32s,color .32s,border-color .32s;min-width:29px;}
.combat-prep-counter .combat-prep-old{position:absolute;right:4px;pointer-events:none;}
#battle-actions .battle-action{transition:background-color .42s ease,border-color .42s ease,box-shadow .42s ease,color .42s ease;}
#battle-actions .battle-action.attack-prepared,#battle-actions .battle-action.blades-ready{background-color:#f2e5df!important;border-color:#ba9187!important;box-shadow:inset 0 1px 0 #fffdf7,0 0 5px #ad6c5d25;color:#884c48;}
#battle-actions .battle-action.blades-ready>span{animation:blades-warmth 2.4s ease-in-out infinite;}
@keyframes blades-warmth{0%,100%{filter:brightness(1)}50%{filter:brightness(1.18)}}
@media(prefers-reduced-motion:reduce){#battle-actions .battle-action.blades-ready>span{animation:none}}

/* Only genuinely prepared skills receive this quiet frame, not every passive bonus. */
.combat-skill-cast{transition:border-color .3s,box-shadow .3s;}
.combat-skill-row.is-empowered .combat-skill-cast{border-color:#bda45d!important;animation:prepared-skill-frame 2.5s ease-in-out infinite;}
@keyframes prepared-skill-frame{0%,100%{box-shadow:inset 0 0 0 1px #d6bd7980,0 0 2px #b99e5730}50%{box-shadow:inset 0 0 0 1px #e4cc8eb0,0 0 6px #b99e5760}}
@media(prefers-reduced-motion:reduce){.combat-skill-row.is-empowered .combat-skill-cast{animation:none;box-shadow:inset 0 0 0 1px #d6bd7980}}

.combat-effect-icon.personal-effect{border:1px solid #9271ac!important;box-shadow:inset 0 0 0 1px #b49bc426;background:#f0eaf2!important;}
.card-field #battle-root .card-event-back[data-periodic="wound"]{--event-line:#a85759;--event-line-strong:#8b374c;background:linear-gradient(125deg,#fbf2ed,#f2e0e2)!important;}
.card-field #battle-root .card-event-back[data-periodic="wound"] .card-event-trace rect{stroke:#a65362!important;stroke-width:1.4;stroke-linecap:round;stroke-dasharray:20 4 7 3;}
.card-field #battle-root .card-event-back[data-periodic="wound"] .card-periodic-heat{background:radial-gradient(ellipse at 15% 80%,#a6374b30,transparent 70%)!important;}

.card-field #battle-root .combat-prep-counter{font-size:8.5px!important;line-height:1.15;min-width:24px;padding:1px 3px;gap:2px;}
#valgard-effect-note>header{display:flex;align-items:center;gap:6px;}
#valgard-effect-note>header h3{flex:1;min-width:0;}
.effect-note-private{flex:0 0 auto;font:600 9px/1.2 Interface,sans-serif;color:#80618f;background:#eee6f0;border:1px solid #b7a2c4;border-radius:4px;padding:3px 4px;}

.card-field #battle-root .paired-hit-step{font-size:9px!important;line-height:1.2!important;letter-spacing:0;align-self:center;width:max-content;max-width:100%;padding:0;border-radius:0;background:none;border:0;box-shadow:none;color:#827b61;}
.card-field #battle-root .paired-hit.is-dodged b{font-size:10px!important;line-height:1.15!important;color:#617d78!important;white-space:normal;}
.card-field #battle-root .rogue-private-target .card-portrait{animation:rogue-target-pulse 2.5s ease-in-out infinite;border-color:#ad626a!important;}
@keyframes rogue-target-pulse{0%,100%{box-shadow:0 0 0 1px #ad626a66}50%{box-shadow:0 0 0 1px #ae5555b0,0 0 5px #a34e4e65}}
#battle-actions .battle-action.blades-ready>span{animation:none;}
#battle-actions .battle-action.blades-ready{position:relative;overflow:hidden;}
@keyframes blade-button-warm{0%,100%{opacity:.18}50%{opacity:.46}}
@media(prefers-reduced-motion:reduce){.card-field #battle-root .rogue-private-target .card-portrait,#battle-actions .battle-action.blades-ready::after{animation:none}}

.card-field #battle-root .conditional-enemy-target .card-portrait{border-color:#af6470!important;animation:rogue-target-pulse 2.5s ease-in-out infinite;}
.card-field #battle-root .conditional-ally-target .card-portrait{border-color:#6695b0!important;animation:ally-condition-pulse 2.7s ease-in-out infinite;}
@keyframes ally-condition-pulse{0%,100%{box-shadow:0 0 0 1px #6595b050}50%{box-shadow:0 0 0 1px #6595b0a0,0 0 5px #679db34c}}
@media(prefers-reduced-motion:reduce){.card-field #battle-root .conditional-enemy-target .card-portrait,.card-field #battle-root .conditional-ally-target .card-portrait{animation:none}}

.card-field #battle-root .card-cast{justify-content:center;}
.card-field #battle-root .card-cast-copy{overflow:hidden;min-width:0;flex:0 1 auto;width:max-content;max-width:calc(100% - 38px);}
.source-return-track{display:flex;width:100%;min-width:0;will-change:transform;}
.source-return-step{flex:0 0 100%;width:100%;min-width:0;box-sizing:border-box;display:grid;grid-template-columns:minmax(0,1fr);align-content:center;gap:4px;}
.source-return-step small{font-size:9px!important;white-space:normal;}
.source-return-step b{overflow-wrap:anywhere;}
.card-field #battle-root .paired-hit.is-action b{font-size:12px!important;line-height:1.15!important;}

.card-field #battle-root .card-wound-trace path{fill:none;stroke:#a25663;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;vector-effect:non-scaling-stroke;stroke-dasharray:100;stroke-dashoffset:100;animation:wound-edge-draw 1.1s cubic-bezier(.2,.7,.2,1) both;}
@keyframes wound-edge-draw{to{stroke-dashoffset:0}}
@media(prefers-reduced-motion:reduce){.card-field #battle-root .card-wound-trace path{animation:none;stroke-dashoffset:0}}

/* Preparations occupy one quiet rail instead of creating duplicate status icons. */
.card-field .hunter-preparations{display:flex;flex-wrap:wrap;gap:3px 5px;margin-top:5px;min-width:0;max-height:52px;overflow-y:auto;scrollbar-width:none;}
.card-field .hunter-preparations::-webkit-scrollbar{display:none;}
.card-field .hunter-preparations button{display:flex;align-items:center;gap:5px;padding:3px 6px;border:1px solid #c8d4b1;border-radius:5px;background:#eef2e1;color:#536b53;font:500 9px/1.15 Interface,sans-serif;min-width:0;}
.card-field .hunter-preparations b{font-weight:650;color:#3b6659;white-space:nowrap;}
.card-field #battle-root .combat-prep-counter[data-kind="combo"]{font-size:8px;letter-spacing:.02em;padding:2px 4px;}

/* The selected character owns the preparation rail; one row fits inside the profile. */
.card-field #battle-root .spell-panel-battle #combat-profile.has-preparations{height:auto;min-height:96px;max-height:none;align-items:center;}
.card-field #battle-root #combat-profile .hunter-preparations{display:flex;flex-wrap:nowrap;align-items:center;gap:6px;width:100%;max-width:100%;height:25px;max-height:25px;margin:5px 0 0;overflow:auto hidden;scrollbar-width:none;touch-action:pan-x;overscroll-behavior-x:contain;}
.card-field #battle-root #combat-profile .hunter-preparations button{flex:0 0 auto;align-items:center;gap:5px;white-space:nowrap;min-height:22px;font-size:9px;line-height:12px;padding:4px 7px;box-sizing:border-box;border-color:#cdd6b9;border-radius:6px;background:#f1f4e6;}
.card-field #battle-root #combat-profile .hunter-preparations button span{white-space:nowrap;}
.card-field #battle-root .paired-hit-step{border:0;background:transparent;box-shadow:none;border-radius:0;padding:0;}
@media(max-height:730px){.card-field #battle-root .spell-panel-battle #combat-profile.has-preparations{min-height:89px;}}
#valgard-effect-note.compact-note{width:max-content;min-width:0;max-width:min(310px,calc(100vw - 20px));}
#valgard-effect-note.compact-note>header{gap:18px;}
#valgard-effect-note.compact-note .effect-note-body{min-width:0;}
#valgard-effect-note.compact-note .effect-note-text{max-width:270px;}
#valgard-effect-note{width:max-content;min-width:0;max-width:min(338px,calc(100vw - 20px));}
#valgard-effect-note .effect-note-text,#valgard-effect-note .effect-note-page{max-width:290px;}
#hero{scrollbar-width:none!important;scrollbar-gutter:auto!important;}
#hero::-webkit-scrollbar{display:none!important;width:0!important;height:0!important;}

.effect-hint-links{display:inline-flex;flex-wrap:wrap;gap:4px;vertical-align:baseline;margin:4px 3px 2px;}
.effect-hint-links .effect-term-link{margin:0;}
.effect-mark-link{white-space:normal;}
#valgard-effect-note .effect-mark-preview{display:flex;align-items:center;justify-content:center;width:100%;box-sizing:border-box;margin:2px auto 0;padding:12px 6px 9px;}
#valgard-effect-note .effect-mark-sample{display:block;flex:0 0 auto;width:51px;height:58px;box-sizing:border-box;border:1px solid;border-radius:7px;background:transparent;}
#valgard-effect-note .effect-mark-sample.is-enemy{border-color:#af6470;animation:rogue-target-pulse 2.5s ease-in-out infinite;}
#valgard-effect-note .effect-mark-sample.is-ally{border-color:#6695b0;animation:ally-condition-pulse 2.7s ease-in-out infinite;}
#valgard-effect-note .effect-mark-sample.is-skill{width:48px;height:48px;border-color:#bda45d;animation:prepared-skill-frame 2.5s ease-in-out infinite;}
@media(prefers-reduced-motion:reduce){#valgard-effect-note .effect-mark-sample{animation:none!important;}}

#valgard-effect-note .effect-mark-sample.is-attack{width:90px;height:38px;border-color:#b97869;animation:blade-button-warm 2.6s ease-in-out infinite;}

/* Resource restores use the same numeric scale as the hit carousel. */
.card-field #battle-root .card-cast-art{overflow:hidden;box-sizing:border-box;}
.card-field #battle-root .source-return-art-track{display:flex;width:100%;height:100%;will-change:transform;}
.card-field #battle-root .card-cast .card-cast-art .source-return-art-track>img{display:block;flex:0 0 100%;min-width:100%;max-width:100%;width:100%!important;height:100%!important;object-fit:contain!important;padding:4px;box-sizing:border-box;}
.card-field #battle-root .card-cast.has-source-returns{justify-content:center;}
.card-field #battle-root .card-cast.has-source-returns .card-cast-copy{flex:0 1 auto;max-width:100%;}
.card-field #battle-root .card-cast .source-return-step.is-resource .source-return-number{font:750 clamp(14px,4.8vw,21px)/1.2 Interface,sans-serif!important;color:#a2873c!important;overflow-wrap:normal;white-space:nowrap;}
.card-field #battle-root .card-cast .source-return-step[data-resource="Мана"] .source-return-number{color:#5795ac!important;}
/* Slightly stronger target/ready cues, with the same calm pulse. */
@keyframes rogue-target-pulse{0%,100%{border-color:#b97a82;box-shadow:0 0 2px #bd596818}50%{border-color:#c05d6c;box-shadow:0 0 5px #c65f7348}}
@keyframes prepared-skill-frame{0%,100%{box-shadow:inset 0 0 0 1px #d6bd79b0,0 0 3px #b99e5745}50%{box-shadow:inset 0 0 0 1px #eed298e6,0 0 8px #c6a85985}}
.card-field #battle-root .conditional-enemy-target .card-portrait{border-color:#b75d69!important;}
.combat-skill-row.is-empowered .combat-skill-cast{border-color:#c3a44e!important;}

.card-field #battle-root .conditional-target-mark{position:absolute;left:50%;bottom:-7px;transform:translateX(-50%);width:22px;height:19px;min-height:0;padding:2px;border:1px solid #b87d82;border-radius:5px;background:#fff9ef;display:grid;place-items:center;z-index:2;animation:condition-symbol-breathe 2.7s ease-in-out infinite;}
.card-field #battle-root .conditional-ally-target .conditional-target-mark{border-color:#7e9fb5;background:#f2f8f7;}
.card-field #battle-root .conditional-target-mark img{width:17px!important;height:14px!important;object-fit:contain!important;transform:none!important;padding:0!important;border:0!important;border-radius:0!important;}
@keyframes condition-symbol-breathe{0%,100%{box-shadow:0 0 2px #b2a18b30}50%{box-shadow:0 0 5px #b2a18b55}}
#battle-actions .battle-action.attack-prepared{position:relative;overflow:hidden;}
#battle-actions .battle-action.attack-prepared::after,#battle-actions .battle-action.blades-ready::after,.effect-attack-sample::after{content:"";position:absolute;inset:0;border-radius:inherit;pointer-events:none;background:radial-gradient(ellipse at 75% 30%,#af4d5077,transparent 68%),linear-gradient(110deg,transparent 25%,#bd806335 52%,transparent 78%);animation:attack-sheen-arrive .42s ease-out both,blade-button-warm 2.6s ease-in-out .42s infinite;}
#valgard-effect-note .effect-attack-sample{position:relative;isolation:isolate;display:flex;flex:0 0 auto;align-items:center;justify-content:center;gap:8px;width:145px;height:49px;padding:5px 10px;box-sizing:border-box;overflow:hidden;border:1px solid #487366;border-radius:10px;background:#367365;color:#fff8e8;animation:attack-sample-ready .36s cubic-bezier(.25,.2,.3,1) .04s both;}
@keyframes attack-sample-ready{from{background-color:#367365;border-color:#487366;color:#fff8e8}to{background-color:#f2e5df;border-color:#ba9187;color:#884c48}}
#valgard-effect-note .effect-attack-sample .icon{font-size:19px;}
#valgard-effect-note .effect-attack-sample>span{font:700 13px/1.15 Interface,sans-serif;text-align:center;}
#valgard-effect-note .effect-attack-sample small{display:block;font:500 8px/1.2 Interface,sans-serif;margin-top:3px;}
#valgard-effect-note .effect-attack-sample.is-wait-sample{animation:none;background:linear-gradient(150deg,#a5ada7,#969f98);border:2px solid #e7ece7;box-shadow:inset 0 1px 0 #ffffff55,0 0 0 1px #a4afa5;}
#valgard-effect-note .effect-attack-sample.is-wait-sample::after{content:none;}
#valgard-effect-note .effect-attack-sample.is-wait-sample>img{display:block;width:20px;height:23px;object-fit:contain;}
#valgard-effect-note .effect-mark-sample.is-focus{display:grid;place-items:center;width:29px;height:21px;padding:2px 3px;border:1px solid #a6b47c;border-radius:5px;background:#eff1d9;animation:none;}
#valgard-effect-note .effect-mark-sample.is-focus img{display:block;width:21px;height:13px;object-fit:contain;}
#valgard-effect-note .effect-preparation-preview{display:flex;align-items:center;gap:8px;width:208px;max-width:100%;box-sizing:border-box;padding:8px;border:1px solid #d4dac2;border-radius:10px;background:#f9f9ee;}
#valgard-effect-note .effect-preparation-preview>img{display:block;flex:0 0 36px;width:36px;height:46px;object-fit:contain;border:1px solid #d1d8bd;border-radius:6px;background:#fcfbf2;}
#valgard-effect-note .effect-preparation-copy{display:grid;gap:6px;min-width:0;flex:1;}
#valgard-effect-note .effect-preparation-copy>strong{font:650 11px/1.2 Interface,sans-serif;color:#3f6858;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
#valgard-effect-note .effect-preparation-bar{display:block;width:100%;height:3px;border-radius:3px;background:linear-gradient(90deg,#d5826d 85%,#e1dfcf 85%);}
#valgard-effect-note .effect-preparation-chip{display:flex;align-items:center;justify-content:flex-start;gap:5px;width:max-content;max-width:100%;padding:3px 5px;border:1px solid #cdd6b9;border-radius:5px;background:#f1f4e6;font:500 9px/1.2 Interface,sans-serif;color:#647b56;}
#valgard-effect-note .effect-preparation-chip>b{font-weight:650;color:#426b54;}
.card-field #battle-root .profile-resizing{overflow:hidden;}
.card-field #battle-root #combat-profile{box-sizing:border-box;}
.card-field #battle-root .monster-unit[data-card-dying="true"]{filter:none!important;}
@media(prefers-reduced-motion:reduce){.card-field #battle-root .conditional-target-mark,#battle-actions .battle-action.attack-prepared::after,#valgard-effect-note .effect-attack-sample,#valgard-effect-note .effect-attack-sample::after,#valgard-effect-note .effect-mark-sample.is-focus{animation:none!important;}}

.card-field #battle-root .card-portrait.has-preparation-badge .conditional-target-mark{left:auto;right:-5px;top:-5px;bottom:auto;}

/* Inventory ammunition uses the same 200-item stacks as consumable cards. */
#modal-root .modal-shade:has(>.ammo-picker-sheet){padding:0;align-items:flex-end;}
#modal-root .ammo-picker-sheet{width:100%;max-width:none;max-height:min(380px,70dvh);padding:17px 0 10px;border:1px solid #d6caab;border-bottom:0;border-radius:21px 21px 0 0;overflow:hidden;display:flex;flex-direction:column;animation:ammo-picker-in .3s cubic-bezier(.2,.75,.25,1);}
#modal-root .ammo-picker-sheet .modal-header{flex:none;margin:0 17px 8px;}
.ammo-stack-scroll{display:flex;gap:11px;min-height:0;overflow:auto hidden;padding:5px 17px 11px;scrollbar-width:none;scrollbar-gutter:auto;touch-action:pan-x;overscroll-behavior-x:contain;}
.ammo-stack-scroll::-webkit-scrollbar{display:none;width:0;height:0;}
.ammo-stack-card{position:relative;flex:0 0 126px;min-width:0;min-height:175px;padding:9px 9px 8px;border:1px solid #c8c9a6;border-radius:11px;background:linear-gradient(#fffdf3,#f1efdc);color:#3c6253;display:flex;flex-direction:column;align-items:center;gap:6px;text-align:center;box-sizing:border-box;}
.ammo-stack-card.is-equipped{border-color:#6c9780;box-shadow:inset 0 0 0 1px #8dad8340;}
.ammo-stack-card:disabled{opacity:.62;}
.ammo-stack-count{align-self:flex-end;font:600 10px/1.2 Interface,sans-serif;color:#7f805e;}
.ammo-stack-art{display:grid;place-items:center;width:80px;height:76px;}
.ammo-stack-art img{display:block;width:100%;height:100%;object-fit:contain;}
.ammo-stack-card strong{font:650 12px/1.3 Interface,sans-serif;min-height:31px;display:grid;place-items:center;}
.ammo-stack-card small{margin-top:auto;font:600 10px/1.2 Interface,sans-serif;color:#6c805a;}
.ammo-picker-hint{margin:3px 17px 4px;font:10px/1.4 Interface,sans-serif;color:#8b8268;}
.ammo-stack-empty{margin:12px 0;font:12px/1.5 Interface,sans-serif;color:#7a7c65;}
@keyframes ammo-picker-in{from{opacity:0;transform:translateY(25px)}to{opacity:1;transform:translateY(0)}}
@media(prefers-reduced-motion:reduce){#modal-root .ammo-picker-sheet{animation:none;}}

/* Natural vitals height follows the text scale; boosts keep their own row. */
.card-field #battle-root .spell-panel-battle #combat-profile{display:grid!important;grid-template-columns:50px minmax(0,1fr);grid-template-rows:max-content auto;column-gap:9px;row-gap:0;height:auto!important;min-height:0!important;max-height:none;align-content:start;align-items:stretch!important;position:relative;box-sizing:border-box;}
.card-field #battle-root .spell-panel-battle #combat-profile>img{grid-column:1;grid-row:1;width:50px!important;height:0!important;min-height:100%;max-height:none!important;max-width:50px!important;align-self:stretch!important;box-sizing:border-box;}
.card-field #battle-root .spell-panel-battle #combat-profile>img:not(.enemy-portrait){object-fit:cover!important;object-position:center top!important;padding:0!important;}
.card-field #battle-root .spell-panel-battle #combat-profile>.combat-player-copy{grid-column:2;grid-row:1;display:flex;flex-direction:column;justify-content:flex-start;gap:3px;min-width:0;width:100%;height:auto;}
.card-field #battle-root #combat-profile .combat-player-name{height:auto;min-height:21px;margin:0;padding:0;width:100%;}
.card-field #battle-root #combat-profile .combat-vitals{display:flex!important;flex-direction:column;gap:5px;width:100%;min-width:0;margin:0;}
.card-field #battle-root #combat-profile .combat-vitals>.health,.card-field #battle-root #combat-profile .combat-vitals>.mana,.card-field #battle-root #combat-profile .combat-vitals>.pet-turns{width:100%;min-width:0;flex:0 0 auto;}
.card-field #battle-root #combat-profile .combat-vitals .vital-row{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;}
.card-field #battle-root #combat-profile .combat-vitals .progress{width:100%;}
.card-field #battle-root #combat-profile>.hunter-preparations{grid-column:1/-1;grid-row:2;margin:9px 0 1px;height:26px;max-height:26px;gap:6px;overflow:auto hidden;scrollbar-width:none;touch-action:pan-x;}
.card-field #battle-root #combat-profile .hunter-preparations button{height:24px;min-height:24px;padding:3px 6px;gap:5px;border-color:#c9d3b8;background:#f3f5e9;flex:none;}
.card-field #battle-root #combat-profile .hunter-preparations .preparation-uses{display:inline-flex;align-items:center;justify-content:center;font:600 9px/1.2 Interface,sans-serif;color:#7d886c;}
.card-field #battle-root #combat-profile .hunter-preparations .preparation-turns{align-self:stretch;display:grid;place-items:center;padding-left:5px;margin-left:1px;min-width:12px;border-left:1px solid #d1d9c2;font:650 9px/1.2 Interface,sans-serif;color:#6d805a;}
#valgard-effect-note .effect-lower-panel-preview{width:270px;max-width:100%;box-sizing:border-box;padding:9px;border:1px solid #d4dac2;border-radius:12px;background:#faf9ee;display:grid;gap:7px;}
.effect-preview-profile{display:grid;grid-template-columns:35px minmax(0,1fr);gap:7px;align-items:stretch;}
.effect-preview-profile>img{display:block;width:35px;height:53px;object-fit:contain;box-sizing:border-box;border:1px solid #cdd5ba;border-radius:5px;background:#fdfbf2;}
.effect-preview-profile>div{display:grid;gap:3px;min-width:0;}
.effect-preview-name,.effect-preview-vital{display:flex;justify-content:space-between;align-items:center;gap:4px;}
.effect-preview-name strong{font:650 10px/1.2 Interface,sans-serif;color:#3d6658;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.effect-preview-name small{font:500 6px/1.2 Interface,sans-serif;color:#8d987e;}
.effect-preview-vital{font:500 7px/1.2 Interface,sans-serif;color:#7f826c;}
.effect-preview-vital b{font-weight:600;color:#416953;}
.effect-preview-health,.effect-preview-energy{display:block;width:100%;height:2px;border-radius:2px;background:linear-gradient(90deg,#d57c68 var(--preview-fill),#e4dfca var(--preview-fill));}
.effect-preview-energy{background:linear-gradient(90deg,#76aec0 var(--preview-fill),#e4dfca var(--preview-fill));}
.effect-preview-preparations{display:flex;gap:4px;overflow:hidden;}
.effect-preview-preparations>span{display:flex;align-items:center;gap:3px;white-space:nowrap;padding:3px 4px;border:1px solid #c9d3b8;border-radius:4px;background:#f3f5e9;color:#637b58;font:500 7px/1.15 Interface,sans-serif;}
.effect-preview-preparations img{width:11px;height:11px;object-fit:contain;border-radius:2px;}
.effect-preview-preparations b{font-weight:650;}
.effect-preview-preparations small{font:inherit;}
.effect-preview-preparations em{padding-left:4px;border-left:1px solid #cbd4ba;font:600 7px/1 Interface,sans-serif;}
.effect-preview-tools,.effect-preview-actions{display:grid;grid-template-columns:1fr 1fr;gap:5px;}
.effect-preview-tools>span{display:flex;align-items:center;justify-content:center;gap:4px;border:1px solid #d1d9bf;border-radius:5px;padding:4px;background:#f7f8ec;font:600 8px/1.1 Interface,sans-serif;color:#6d805c;}
.effect-preview-tools img{display:block;width:11px;height:11px;object-fit:contain;}
.effect-preview-actions>span{display:flex;align-items:center;justify-content:center;gap:6px;min-height:34px;border:1px solid #be8f7c;border-radius:6px;background:#f2e5df;color:#884c48;font:600 9px/1.1 Interface,sans-serif;}
.effect-preview-actions>span+span{border-color:#d4cfad;background:#f8f5e5;color:#8c9a7a;}
.effect-preview-actions b{font:inherit;text-align:center;}
.effect-preview-actions small{display:block;font:500 6px/1.2 Interface,sans-serif;margin-top:3px;}

/* The whole return cell slides: its icon frame and its number share one track. */
.card-field #battle-root .card-cast.has-source-returns>.source-return-window{display:block;flex:0 1 auto;max-width:100%;overflow:hidden;}
.card-field #battle-root .source-return-track{display:flex;width:100%;min-width:0;}
.card-field #battle-root .source-return-step{display:flex;flex:0 0 100%;width:100%;min-width:0;align-items:center;justify-content:center;gap:6px;overflow:hidden;}
.card-field #battle-root .source-return-step-art{flex:0 0 32px;width:32px;height:32px;}
.card-field #battle-root .source-return-copy{display:grid;gap:3px;min-width:0;}
.card-field #battle-root .source-return-copy b{white-space:normal;overflow-wrap:normal;}
@keyframes attack-sheen-arrive{from{opacity:0}to{opacity:.18}}

#modal-root .ammo-picker-sheet .modal-header{display:flex;align-items:center;justify-content:space-between;gap:10px}
#modal-root .ammo-picker-sheet .modal-header h2{margin:0;line-height:1.25}
#modal-root .ammo-picker-sheet .modal-header>.icon-button{display:grid;place-items:center;flex:none;width:34px;height:34px;min-height:34px;padding:0;margin:0;line-height:1}
.ammo-stack-scroll{cursor:grab;scroll-behavior:auto;user-select:none}
.ammo-stack-scroll:active{cursor:grabbing}
.card-wound-slice{position:absolute;inset:3px;width:calc(100% - 6px);height:calc(100% - 6px);pointer-events:none;z-index:0;overflow:visible}
.card-wound-slice path{fill:none;stroke-linecap:round;stroke-linejoin:round;vector-effect:non-scaling-stroke}
.card-wound-slice .wound-cut-shadow,.card-wound-slice .wound-cut-line{stroke-dasharray:100;stroke-dashoffset:100;animation:wound-cut-draw .68s cubic-bezier(.25,.4,.3,1) both}
.card-wound-slice .wound-cut-shadow{stroke:#bd626c;stroke-width:3;opacity:.2}
.card-wound-slice .wound-cut-line{stroke:#963d4f;stroke-width:1.35;opacity:.75}
.card-wound-slice .wound-pigment path{stroke:#ad4d5e;stroke-width:2.1;opacity:0;transform-box:fill-box;transform-origin:center;animation:wound-pigment-settle .44s ease-out var(--fleck-delay) both}
@keyframes wound-cut-draw{to{stroke-dashoffset:0}}
@keyframes wound-pigment-settle{0%{opacity:0;transform:scale(.4)}65%{opacity:.48;transform:scale(1.08)}100%{opacity:.3;transform:scale(1)}}
@media(prefers-reduced-motion:reduce){.card-wound-slice .wound-cut-line,.card-wound-slice .wound-cut-shadow{animation:none;stroke-dashoffset:0}.card-wound-slice .wound-pigment path{animation:none;opacity:.3}}

#battle-actions .battle-action>span,#battle-actions .battle-action>.icon{transition:color .36s ease}
#battle-actions .battle-action.attack-prepared>span,#battle-actions .battle-action.attack-prepared>.icon,#battle-actions .battle-action.blades-ready>span,#battle-actions .battle-action.blades-ready>.icon{color:#884c48!important}

.hero-technique-detail>footer{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:stretch;gap:8px}
.hero-technique-detail>footer>button{display:flex;align-items:center;justify-content:center;gap:5px;min-height:36px;height:auto;box-sizing:border-box;line-height:1.25;padding:8px 6px;margin:0}
.hero-technique-facts{display:flex;flex-wrap:wrap;align-items:center;gap:6px 14px}
.hero-technique-facts>span{display:inline-flex;align-items:center;gap:4px;line-height:1.3}
.effect-hint-links{display:contents}

.card-field #battle-root #combat-profile.profile-resizing{overflow:hidden;}
.card-field #battle-root #combat-profile #hero-effects:has(>.no-effects:only-child){display:none!important;}
#battle-actions .battle-action[data-fight="strike"]{background-image:none!important;color:#855f56;}
#battle-actions .battle-action[data-fight="strike"]:not(.attack-prepared):not(.blades-ready){background-color:#f7eee6!important;border-color:#cdb9a3!important;box-shadow:inset 0 1px 0 #fffdf8,0 2px 0 #c2b09b33;}
#battle-actions .battle-action[data-fight="strike"]>span,#battle-actions .battle-action[data-fight="strike"]>.icon{color:inherit;}

/* Prepared necromancy keeps its own restrained violet accent. */
.combat-skill-row.is-empowered[data-ready-style=necromancer] .combat-skill-cast{border-color:#a28bb9!important;animation:necro-prepared-frame 2.5s ease-in-out infinite;}
@keyframes necro-prepared-frame{0%,100%{box-shadow:inset 0 0 0 1px #b5a0c266,0 0 2px #a18cb52b}50%{box-shadow:inset 0 0 0 1px #b5a0c299,0 0 5px #a18cb557}}
@media(prefers-reduced-motion:reduce){.combat-skill-row.is-empowered[data-ready-style=necromancer] .combat-skill-cast{animation:none}}

/* Mobile cards fade on compositor layers instead of repainting blurred faces. */
.card-field.perf-lite #battle-root .battle-unit.card-casting>.card-face,
.card-field.perf-lite #battle-root .card-event-show>.card-face{filter:none!important;transition:opacity .2s ease!important;}
.card-field.perf-lite #battle-root .battle-action.wait-action{animation:none!important;}

/* ===== 2026-11-03: the screen behind the lower panel matches the light field (no dark green strip) ===== */
.card-field #battle-root .spell-panel-battle{background:#f4efdf!important}


/* ===== 2026-11-03: attack button — dark green as before; a prepared attack glows red and back to green ===== */
#battle-actions .battle-action[data-fight="strike"]{background-image:linear-gradient(180deg,#3f7865,#2c5a4a)!important;background-color:#2f5f4f!important;border:1px solid #244c3e!important;color:#fff8ea!important;box-shadow:inset 0 1px 0 #ffffff26,0 2px 6px #1f3d3233!important}
#battle-actions .battle-action[data-fight="strike"]>span,#battle-actions .battle-action[data-fight="strike"]>.icon{color:#fff8ea!important}
#battle-actions .battle-action[data-fight="strike"] small{color:#cfe5da!important;opacity:1!important;font-weight:600}
#battle-actions .battle-action[data-fight="strike"]:is(.attack-prepared,.blades-ready){background-image:none!important;animation:attack-ember 2.6s ease-in-out infinite!important}
#battle-actions .battle-action[data-fight="strike"]:is(.attack-prepared,.blades-ready)::after{display:none!important}
#battle-actions .battle-action[data-fight="strike"]:is(.attack-prepared,.blades-ready)>span,#battle-actions .battle-action[data-fight="strike"]:is(.attack-prepared,.blades-ready)>.icon{color:#fff8ea!important;animation:none!important}
@keyframes attack-ember{0%,100%{background-color:#2f5f4f;border-color:#244c3e;box-shadow:inset 0 1px 0 #ffffff26,0 2px 6px #1f3d3233}50%{background-color:#a2403a;border-color:#7d2c27;box-shadow:inset 0 1px 0 #ffffff2e,0 0 10px #c2483d66}}
@media(prefers-reduced-motion:reduce){#battle-actions .battle-action[data-fight="strike"]:is(.attack-prepared,.blades-ready){animation:none!important;background-color:#8f3b35!important}}
/* skills button: painted sword-and-scroll, same weight as the attack sword */
#battle-actions .skills-button .skills-art{width:30px;height:30px;flex:none;object-fit:contain;filter:drop-shadow(0 1px 1px #3d3a2a33)}
.perf-lite #battle-actions .skills-button .skills-art{filter:none}
/* wait: a calm grey, not the attack green */
#battle-actions .battle-action[data-fight="wait"],#battle-actions .battle-action.wait-action{background-image:linear-gradient(180deg,#9aa19c,#7f8782)!important;background-color:#868d89!important;border:1px solid #6f7672!important;color:#fbfaf6!important;box-shadow:inset 0 1px 0 #ffffff33,0 2px 6px #3a3f3c26!important}
#battle-actions .battle-action:is([data-fight="wait"],.wait-action)>span,#battle-actions .battle-action:is([data-fight="wait"],.wait-action)>.icon{color:#fbfaf6!important}
#battle-actions .battle-action:is([data-fight="wait"],.wait-action) small{color:#e9ece9!important;opacity:1!important}

/* bottom profile: room for two bars (HP and resource) for every target, so switching between an enemy and an ally keeps the panel height */
.card-field #battle-root .spell-panel-battle #combat-profile .combat-vitals{min-height:41px;justify-content:flex-start}

/* victory / defeat: the shade fades in and the result card rises gently instead of appearing at once */
#modal-root .modal-shade.has-combat-result{animation:result-shade-in .34s ease-out both}
#modal-root .modal-shade>.modal.combat-result{animation:result-card-in .46s cubic-bezier(.2,.8,.25,1) .06s both}
@keyframes result-shade-in{from{opacity:0}to{opacity:1}}
@keyframes result-card-in{from{opacity:0;transform:translateY(18px) scale(.97)}to{opacity:1;transform:none}}
@media(prefers-reduced-motion:reduce){#modal-root .modal-shade.has-combat-result,#modal-root .modal-shade>.modal.combat-result{animation:none}}

/* 03.11.2026: "Умения" is shaped like "Атака" — same size, rounding and depth — in a soft parchment-and-sage finish that gives a little under the finger */
#battle-actions .battle-action.skills-button{background-image:linear-gradient(180deg,#fbf7e9,#ece4cb)!important;background-color:#f1ead4!important;border:1px solid #c7bb94!important;color:#3f5f50!important;box-shadow:inset 0 1px 0 #ffffffcc,inset 0 -2px 0 #d9cdaa,0 2px 6px #6b5f3a22!important;transition:transform .14s cubic-bezier(.3,.7,.3,1),box-shadow .14s ease,filter .14s ease}
#battle-actions .battle-action.skills-button:active,#battle-actions .battle-action.skills-button[aria-expanded="true"]{transform:translateY(1px) scale(.985);box-shadow:inset 0 2px 4px #8f804f33,0 1px 2px #6b5f3a1a!important;filter:saturate(1.05)}
#battle-actions .battle-action.skills-button>span,#battle-actions .battle-action.skills-button strong{color:#35574a!important}
#battle-actions .battle-action.skills-button small{color:#7b7a5c!important;opacity:1!important}
#battle-actions .battle-action[data-fight="strike"]{transition:transform .14s cubic-bezier(.3,.7,.3,1),filter .14s ease}
#battle-actions .battle-action[data-fight="strike"]:active{transform:translateY(1px) scale(.985);filter:brightness(.96)}

/* 03.11.2026 wound: one straight, fast knife line from the lower-left to the upper-right corner, then droplets scatter */
.card-wound-slice .wound-cut-shadow,.card-wound-slice .wound-cut-line{animation:wound-cut-draw .2s cubic-bezier(.6,0,.3,1) both!important}
.card-wound-slice .wound-cut-line{stroke:#8f2f3f;stroke-width:1.6;opacity:.85}
.card-wound-slice .wound-cut-shadow{stroke:#c45a66;stroke-width:4;opacity:.22}
.card-wound-drops{position:absolute;inset:3px;pointer-events:none;z-index:0}
.card-wound-drops>i{position:absolute;width:var(--size);height:calc(var(--size) * 1.2);margin:calc(var(--size) / -2) 0 0 calc(var(--size) / -2);border-radius:50% 50% 50% 50%/60% 60% 40% 40%;background:radial-gradient(circle at 35% 30%,#d06a75,#8f2f3f 70%);opacity:0;animation:wound-drop .62s cubic-bezier(.2,.7,.35,1) calc(.14s + var(--delay)) both}
@keyframes wound-drop{0%{opacity:0;transform:translate(0,0) scale(.4)}18%{opacity:.9}100%{opacity:0;transform:translate(var(--dx),var(--dy)) scale(.85)}}
@media(prefers-reduced-motion:reduce){.card-wound-drops{display:none}}

/* 03.11.2026 «Исцелить» (healer staff, replaces «Ждать» on a wounded ally): soft spring green, same shape as «Атака», a slow gentle glow */
#battle-actions .battle-action.sanctify-action{background-image:linear-gradient(180deg,#c9e59a,#9fcb6f)!important;background-color:#b2d683!important;border:1px solid #7fa955!important;color:#2f4a22!important;box-shadow:inset 0 1px 0 #ffffffa8,0 2px 6px #5c8a3a33!important;animation:heal-glow 2.8s ease-in-out infinite;transition:transform .14s cubic-bezier(.3,.7,.3,1)}
#battle-actions .battle-action.sanctify-action>span,#battle-actions .battle-action.sanctify-action strong{color:#2f4a22!important}
#battle-actions .battle-action.sanctify-action small{color:#4f6e37!important;opacity:1!important}
#battle-actions .battle-action.sanctify-action:active{transform:translateY(1px) scale(.985)}
@keyframes heal-glow{0%,100%{box-shadow:inset 0 1px 0 #ffffffa8,0 2px 6px #5c8a3a33}50%{box-shadow:inset 0 1px 0 #ffffffc0,0 0 12px #9ed46a88}}
.perf-lite #battle-actions .battle-action.sanctify-action{animation:none}
@media(prefers-reduced-motion:reduce){#battle-actions .battle-action.sanctify-action{animation:none}}
/* «Умения» opens by a tap only: no swipe hint */
#battle-actions .skills-button .skill-swipe-hint{display:none!important}

#battle-root #combat-vitals .health>.progress{position:relative;overflow:hidden}
#battle-root .hp-vampirism-gain{position:absolute;inset-block:0;min-width:1px;z-index:1;border-radius:inherit;background:#79b578;pointer-events:none;transform-origin:left;animation:hp-vampirism-gain .55s ease-out both}
@keyframes hp-vampirism-gain{from{transform:scaleX(.12);opacity:1}30%{transform:scaleX(1);opacity:1}to{transform:scaleX(1);opacity:0}}
@media(prefers-reduced-motion:reduce){#battle-root .hp-vampirism-gain{animation-name:hp-vampirism-fade}@keyframes hp-vampirism-fade{from{opacity:1}to{opacity:0}}}

/* Keep reward positions stable while the coins, experience and first drops settle into place. */
@media (prefers-reduced-motion:no-preference){
 #app:not(.reduced-motion) #modal-root .result-shade>.result-victory{animation:vg-victory-enter 220ms cubic-bezier(.18,.7,.24,1) both}
 #app:not(.reduced-motion) .result-victory :is(.result-metric,.result-section,.result-items>.result-item:nth-child(-n+4),.result-no-items){animation:vg-reward-arrive 225ms cubic-bezier(.18,.7,.24,1) var(--reward-delay,190ms) backwards}
 #app:not(.reduced-motion) .result-victory .metric-coins{--reward-delay:65ms}
 #app:not(.reduced-motion) .result-victory .metric-xp{--reward-delay:125ms}
 #app:not(.reduced-motion) .result-victory .result-item{--reward-delay:225ms}
 #app:not(.reduced-motion) .result-victory .result-item:nth-child(2){--reward-delay:260ms}
 #app:not(.reduced-motion) .result-victory .result-item:nth-child(n+3){--reward-delay:290ms}
}
@keyframes vg-victory-enter{from{opacity:0;transform:translateY(5px)}to{opacity:1;transform:none}}
@keyframes vg-reward-arrive{0%{opacity:0;transform:translateY(5px) scale(.97)}77%{opacity:1;transform:translateY(-1px) scale(1.006)}100%{transform:none}}
.reduced-motion #modal-root .result-shade,.reduced-motion #modal-root .result-shade>.result-victory,.reduced-motion .result-victory .result-metric,.reduced-motion .result-victory .result-item{animation:none!important}

.card-field #battle-root .card-cast>.card-event-trace{top:2px!important;left:2px!important;width:calc(100% - 4px)!important;height:calc(100% - 4px)!important;overflow:hidden}

/* Count-based combat pacing; keep the native selection outline without side rails. */
.card-field #battle-root .card-owner-line,.card-field #battle-root .card-target-lines{display:none!important;}
.card-field #battle-root .card-event-show>.card-event-back{animation-duration:calc(.25s / var(--combat-tempo,1))!important;}
.card-field #battle-root .card-event-show.card-event-leaving>.card-event-back,
.card-field #battle-root .card-cast.is-result-leaving{animation-duration:calc(.23s / var(--combat-tempo,1))!important;}
.card-field #battle-root .card-cast{animation-duration:calc(.37s / var(--combat-tempo,1))!important;}
.card-field #battle-root .card-event-trace rect{animation-duration:calc(.63s / var(--combat-tempo,1))!important;}
.card-field #battle-root .battle-unit.card-event-show>.card-event-back.is-numeric-impact:not(.is-status-notice),
.card-field #battle-root .is-numeric-impact .notice-slide-face:first-child{
 display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:center!important;
 gap:6px!important;padding:7px!important;box-sizing:border-box!important;
}
.card-field #battle-root .is-numeric-impact .card-event-avatar{flex:0 0 32px!important;width:32px!important;min-width:0!important;margin:0!important;}
.card-field #battle-root .is-numeric-impact .card-event-copy{
 display:flex!important;flex:0 1 auto!important;align-items:center!important;justify-content:center!important;
 width:auto!important;min-width:0!important;max-width:calc(100% - 38px)!important;margin:0!important;padding:0!important;
}
.card-field #battle-root .is-numeric-impact .card-impact-content{width:auto!important;max-width:100%!important;margin:0!important;justify-content:center!important;align-items:center!important;}
.card-field #battle-root .is-numeric-impact .card-impact-content>b{flex:0 0 auto!important;text-align:center!important;}

/* The numeric result pages share the same centre as the initial impact. */
.card-field #battle-root .notice-slide-face.notice-next:is([data-tone="hit"],[data-tone="guard"]){display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:center!important;gap:6px!important;padding:7px!important;box-sizing:border-box!important;text-align:center!important;}
.card-field #battle-root .notice-slide-face.notice-next:is([data-tone="hit"],[data-tone="guard"])>img{position:static!important;flex:0 0 28px!important;width:28px!important;height:28px!important;margin:0!important;object-fit:contain!important;}
.card-field #battle-root .notice-slide-face.notice-next:is([data-tone="hit"],[data-tone="guard"])>span{display:flex!important;flex:0 0 auto!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;width:auto!important;margin:0!important;padding:0!important;}
