/* Feet are world coordinates; artwork may overlap above the occupied ground. */
#battleBoard.realtime-board{height:clamp(360px,62vh,650px)}
.realtime-board .rt-waiting{display:none!important}
.realtime-board .combat-unit{--character-height:calc(clamp(120px,15vw,170px) * var(--figure-reference-scale,1) * var(--battle-fit-scale,1));cursor:crosshair;transition:left .04s linear,top .04s linear,opacity .3s}
.rt-facing{display:block;position:absolute;inset:0;transform:scaleX(var(--rt-face,1));transform-origin:center bottom}
.rt-facing .unit-name{transform:translateX(-50%) scaleX(var(--rt-face,1));white-space:nowrap}
.realtime-board .unit-shadow{width:58%;height:9%;left:21%;bottom:-2%;border:1px solid #c5c3a329;background:#02080655}
.realtime-board .rt-target .unit-shadow{border:2px solid #ed6c51;box-shadow:0 0 8px #fd795977}
.realtime-board .combat-unit .unit-selection{display:none!important}
.realtime-board .targetable .unit-target-mark{display:none}
.realtime-board .unit-name{font-size:10px}
.realtime-board .pose-walk{opacity:0}
.realtime-board .walking .pose-idle,.realtime-board .walking .pose-attack,.realtime-board .walking .pose-monster{opacity:0!important}
.realtime-board .walking .pose-walk[data-active="true"]{opacity:1}
.layered-figure{position:absolute;max-width:none;pointer-events:none;opacity:0;filter:drop-shadow(0 2px 1px #0006)}
.realtime-board .layered-ready .layered-figure{opacity:1}
.realtime-board .layered-ready .unit-art{opacity:0!important}
.realtime-board .combat-unit.acting .unit-selection{display:none}
.realtime-board .enemy-overhead-hp{display:block!important}
.realtime-hud{padding-top:10px;color:#ecdfc6}
.rt-vitals{display:grid;grid-template-columns:minmax(200px,1fr) minmax(160px,1fr);gap:18px;margin-bottom:8px}
.rt-hero-vitals,.rt-party-info{padding:10px 14px;border:1px solid #687366;border-radius:8px;background:#17252b;min-width:0}
.rt-hero-vitals>strong{color:#f1d99f;font-size:17px}
.realtime-hud .combat-meter{height:12px;border:1px solid #081017;border-radius:4px;overflow:hidden}
.realtime-hud .combat-meter.hp i{background:linear-gradient(90deg,#a52e32,#df6458)}
.realtime-hud .combat-meter.mp i{background:linear-gradient(90deg,#2e589f,#65a9e7)}
.realtime-hud .combat-meter-row{margin-top:4px}
.rt-party{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px;height:100%;align-content:center}
.rt-party-empty{grid-column:1/-1;color:#9aadaa;font-size:12px;margin:0}
.rt-party-info .rt-member,.rt-member-empty{position:relative;display:block;min-width:0;aspect-ratio:1;overflow:hidden;padding:0;border:1px solid #617570;border-radius:6px;background:#101d23}
.rt-member-face{display:block;position:absolute;inset:0;overflow:hidden}
.rt-member-face>img{position:absolute;width:100%;height:100%;object-fit:cover;object-position:center 24%;inset:0}
.rt-member-face .combat-career-portrait{position:absolute;inset:0;height:100%;width:100%;border-radius:0}
.rt-member-face .career-portrait-tile{top:0;transform:none}
.rt-member-face .career-portrait-tile img{position:absolute;max-width:none;object-fit:fill;border-radius:0}
.rt-party-info .rt-member-name{position:absolute;top:5px;left:6px;right:4px;z-index:1;color:#fff4d7;text-shadow:0 1px 3px #000,0 0 4px #000;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rt-member-bars{position:absolute;bottom:0;left:0;right:0;padding:16px 6px 6px;background:linear-gradient(transparent,#081219ed 45%)}
.rt-member-bars .combat-meter-row{display:grid;grid-template-columns:15px minmax(0,1fr);gap:3px;align-items:center;margin-top:3px;font-size:9px;line-height:1}
.rt-member-bars .combat-meter-row b{display:none}
.rt-member-bars .combat-meter-row .combat-meter{grid-column:2;min-width:0;width:100%;height:6px;margin:0}
.rt-party-info .rt-member.down{filter:grayscale(1)}
.rt-party-info .rt-member.selected{border-color:#edc97c;box-shadow:inset 0 0 0 1px #edc97c}
.rt-member{padding:7px 10px;border:1px solid #4b6265;background:#1d3036;color:#d7e1df;text-align:left;border-radius:6px;cursor:pointer}
.rt-member strong{font-size:12px}.rt-member small{float:right;color:#95b5ab;font-size:10px}
.rt-member.selected{border-color:#d1b66f}.rt-member.down{opacity:.4}.rt-member .combat-meter{height:5px}.rt-member .combat-meter-row{font-size:9px}
.rt-skillbar{display:grid;grid-template-columns:repeat(9,minmax(0,1fr));gap:6px;max-width:900px;margin:auto}
.rt-skill{position:relative;min-width:0;aspect-ratio:1/.98;border:1px solid #a28b5d;border-radius:7px;background:linear-gradient(145deg,#344b53,#101b22);color:#eee3c6;padding:5px 3px;cursor:pointer;display:flex;flex-direction:column;align-items:center;justify-content:center}
.rt-skill img{height:55%;aspect-ratio:1;object-fit:cover;border-radius:3px}.rt-skill strong{font-size:10px;line-height:1.2;margin-top:3px}.rt-skill small{font-size:9px;color:#9bbacc}
.rt-skill kbd{position:absolute;left:4px;top:2px;font:bold 13px system-ui;color:#ffe3a1;text-shadow:0 1px 3px #000;background:#14202ab0;border-radius:3px;padding:0 3px}
.rt-skill:disabled{cursor:default;opacity:.55}.rt-skill.cooling{opacity:1}.rt-skill.cooling img{filter:grayscale(.85) brightness(.42)}
.rt-cooldown{position:absolute;inset:0;display:grid;place-items:center;color:#ff3e36;font-size:clamp(24px,4vw,38px);font-weight:950;text-shadow:0 2px 3px #000;pointer-events:none}
.rt-skill.queued{border-color:#ffe48d;box-shadow:0 0 10px #e8ce7680}.rt-skill.empty{border-color:#394b50;color:#60716e}
.rt-footer{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap;font-size:11px;color:#a0b7b4;margin-top:8px}.rt-footer button{color:#ffe3a4;background:#584829;border:1px solid #c7a25c;padding:8px 20px;border-radius:5px;cursor:pointer}.rt-combat-info{color:#dec48b}
.rt-hero-statuses{display:flex;gap:4px;margin-top:4px}
.rt-hero-vitals{display:flex;flex-direction:column}
.rt-hero-vitals .rt-hero-statuses{margin-top:auto;padding-top:12px;min-height:46px;display:flex;flex-wrap:wrap;align-content:flex-end;align-items:center;gap:6px}
.rt-hero-statuses .rt-effect-icon{position:relative;display:inline-flex;align-items:center;justify-content:center;flex:0 0 32px;width:32px;height:32px;padding:0;border:1px solid #6fa98a;border-radius:4px;background:#173a30;box-sizing:border-box;cursor:help;overflow:visible;font-size:19px}
.rt-effect-icon img{display:block;width:100%;height:100%;object-fit:cover;border-radius:3px;pointer-events:none}
.rt-hero-statuses .rt-effect-icon.debuff{border-color:#e46c69;background:#54232a}
.rt-hero-statuses .rt-effect-icon.passive{border-color:#baa05d;background:#3d3521}
.rt-effect-icon sup{position:absolute;right:-3px;bottom:-3px;top:auto;min-width:13px;height:14px;padding:0 2px;border-radius:3px;background:#071017e8;color:#fff1d0;font:bold 10px/14px system-ui;text-align:center;pointer-events:none}
.rt-effect-icon sup:empty{display:none}
@media(max-width:650px){.rt-vitals{gap:7px;grid-template-columns:1fr 1fr}.rt-skillbar{gap:3px}.rt-skill{min-height:62px;padding:3px 1px}.rt-skill strong{font-size:8px}.rt-skill small{font-size:8px}.rt-party{gap:4px}.rt-member{padding:5px}.rt-member small{display:none}.rt-footer{font-size:9px}.realtime-board .combat-unit{--character-height:calc(115px * var(--figure-reference-scale,1) * var(--battle-fit-scale,1))}}

@media(max-width:650px){.rt-vitals{grid-template-columns:1fr}.rt-party-info{padding:8px}.rt-party{grid-template-columns:repeat(4,minmax(0,1fr))}}

.rt-skill-reservation{position:absolute;inset:28% 0 auto;background:rgba(25,17,2,.85);color:#ffdc79;font-size:16px;font-weight:800;line-height:1.65;text-align:center;pointer-events:none}.rt-skill-reservation[hidden]{display:none}

/* Side-scrolling stages keep one character height equal to one distance unit. */
#battleBoard.stage-board{overflow:hidden;isolation:isolate}
.stage-board .combat-unit{--character-height:var(--stage-character-height,125px)}
.stage-board .battle-scenery>.scenery-art{visibility:hidden}
.stage-scenery-strip{position:absolute;inset:0;will-change:transform}
.stage-scenery-tile{position:absolute;top:0;width:100%;height:100%;overflow:hidden}
.stage-scenery-tile:not(:first-child){mask-image:linear-gradient(to right,transparent,#000 var(--scenery-blend-width,16%),#000);-webkit-mask-image:linear-gradient(to right,transparent,#000 var(--scenery-blend-width,16%),#000)}
.stage-scenery-strip img{position:absolute;left:0;top:0;width:100%;height:100%;object-fit:cover;max-width:none}

/* A walk frame must never override the last hurt frame during a death fade. */
.realtime-board .combat-unit.enemy.defeated .unit-art{opacity:0!important}
.realtime-board .combat-unit.enemy.defeated [data-monster-frame="hurt"]{opacity:1!important}
.realtime-board .combat-unit.enemy.defeated:not(:has([data-monster-frame="hurt"])) .pose-idle{opacity:1!important}
.stage-board .stage-objective .unit-shadow{width:44%;left:28%}
.stage-board .stage-objective .unit-art{filter:drop-shadow(0 4px 4px #0009)}
.stage-progress-hud{position:absolute;z-index:400;top:12px;left:5%;right:5%;height:28px;color:#f2e5ce;pointer-events:none;text-shadow:0 2px 4px #000,0 0 3px #000}
.stage-progress-hud>strong{position:absolute;left:0;top:0;font-size:13px}
.stage-clock{position:absolute;left:50%;top:0;transform:translateX(-50%);font-size:22px;line-height:1;color:#ffe0a1;font-variant-numeric:tabular-nums}
.stage-clock.urgent{color:#ff7e73}
.stage-progress-between{padding:10px 0 2px;pointer-events:none}
.stage-route{position:relative;height:6px;background:#52656d;border-radius:10px;overflow:hidden}
.stage-route>i{display:block;height:100%;border-radius:inherit;background:#d6b879;transition:width .1s linear}
@media(max-width:600px){.stage-progress-hud{left:12px;right:12px}.stage-progress-hud>strong{font-size:10px}.stage-clock{font-size:18px}}

/* Painted banner: the shaft stays planted while only the fabric catches wind. */
.stage-waving-flag .objective-flag-cloth{animation:stage-flag-wave var(--flag-wave-duration,2000ms) ease-in-out infinite;will-change:transform}
.stage-waving-flag .objective-flag-pole{transform:none}
.realtime-board .combat-unit.enemy.defeated.stage-waving-flag .objective-flag-pole,.realtime-board .combat-unit.enemy.defeated.stage-waving-flag .objective-flag-cloth{opacity:1!important}
@keyframes stage-flag-wave{0%,100%{transform:perspective(500px) rotateY(-9deg) skewY(-1.5deg) scaleX(.97)}25%{transform:perspective(500px) rotateY(3deg) skewY(1deg) scaleX(1)}50%{transform:perspective(500px) rotateY(12deg) skewY(2deg) scaleX(.94)}75%{transform:perspective(500px) rotateY(-5deg) skewY(-.5deg) scaleX(.99)}}
@media(prefers-reduced-motion:reduce){.stage-waving-flag .objective-flag-cloth{animation:none}}

/* World sprites stay transparent under global button interaction styles. */
#battleBoard .combat-unit:hover,#battleBoard .combat-unit:focus,#battleBoard .combat-unit:active{background:none;border:none;box-shadow:none}

/* Two-second end-of-battle title, layered over the final combat scene. */
.battle-end-banner{position:absolute;inset:0;z-index:10000;display:grid;place-items:center;pointer-events:none;background:radial-gradient(ellipse at center,#08121a59,transparent 68%);animation:battle-end-appear .35s ease-out both}
.battle-end-banner strong{position:relative;font-family:Georgia,'Times New Roman',serif;font-size:clamp(60px,10vw,120px);font-weight:700;line-height:1.2;letter-spacing:.07em;color:#f3d790;text-shadow:0 3px 0 #5a361b,0 6px 12px #000,0 0 28px #e9ba5755;filter:drop-shadow(0 2px 1px #000);animation:battle-end-title .45s cubic-bezier(.2,.7,.3,1) both}
.battle-end-banner strong::before,.battle-end-banner strong::after{content:'';position:absolute;height:1px;left:-20%;right:-20%;background:linear-gradient(90deg,transparent,currentColor,transparent);opacity:.65}
.battle-end-banner strong::before{top:-12px}.battle-end-banner strong::after{bottom:-12px}
.battle-end-banner.failed strong{color:#df9388;text-shadow:0 3px 0 #602421,0 6px 12px #000,0 0 28px #b7383544}
@keyframes battle-end-appear{from{opacity:0}to{opacity:1}}
@keyframes battle-end-title{from{opacity:0;transform:scale(1.12) translateY(8px)}to{opacity:1;transform:scale(1) translateY(0)}}
@media(prefers-reduced-motion:reduce){.battle-end-banner,.battle-end-banner strong{animation:none}}

/* Desaturate the battlefield scenery during the defeat title. */
#battleBoard:has(.battle-end-banner.failed) .battle-scenery,#battleBoard:has(.battle-end-banner.failed) .battle-atmosphere{filter:grayscale(1)}

/* Manual shots use simulation coordinates and collide with the first enemy. */
.manual-projectile{position:absolute;display:block;pointer-events:none;transform:translate(-50%,-50%) rotate(var(--shot-angle,0deg));will-change:left,top}
.manual-arrow{width:36px;height:3px;background:linear-gradient(90deg,#e5d4a0,#b58b47);box-shadow:0 0 3px #ffe1a077}
.manual-arrow::after{content:'';position:absolute;right:-5px;top:-3px;border-left:9px solid #e3e8e4;border-top:4px solid transparent;border-bottom:4px solid transparent}
.manual-arrow::before{content:'';position:absolute;left:0;top:-3px;width:9px;height:8px;background:#d3c4a1;clip-path:polygon(0 0,100% 35%,100% 65%,0 100%,25% 50%)}
.manual-arrow,.combat-projectile.arrow{width:clamp(38px,3.4vw,62px);height:21px;background:transparent url('projectiles/arrow-v2.png') center/100% 100% no-repeat;box-shadow:none;border:0;border-radius:0;filter:drop-shadow(0 1px 1px #10151cb0)}
.manual-arrow::before,.manual-arrow::after,.combat-projectile.arrow::before,.combat-projectile.arrow::after{display:none}
.combat-projectile.arrow{margin-left:-26px;margin-top:-10px;transform-origin:center}
.manual-magic{width:19px;height:19px;border-radius:50%;background:radial-gradient(circle at 60% 45%,#fff 0 10%,#d5e2ff 25%,#8c8cf4 55%,#526be100 75%);box-shadow:0 0 12px #aa9dff,0 0 22px #6992ed88}

/* Full-window battlefield with a compact control strip. */
#battleVeil{padding:0;overflow:hidden}
#battleVeil .battle-modal{display:flex;flex-direction:column;width:100vw;max-width:none;height:100dvh;max-height:100dvh;min-height:0;padding:0;border:0;border-radius:0;overflow:hidden;box-shadow:none}
#battleVeil #battleBoard.realtime-board{flex:1 1 0;min-height:0;width:100%;height:auto;max-height:none;border:0;border-radius:0}
#battleVeil .stage-progress-between{flex:0 0 12px;padding:3px 8px}
#battleVeil #battleCommandBar.realtime-hud{flex:0 0 auto;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:center;gap:8px 18px;padding:8px 14px;background:#101b23;max-height:34dvh;overflow:auto}
#battleVeil .rt-vitals{gap:8px;margin:0;align-items:stretch}
#battleVeil .rt-hero-vitals{padding:6px 10px}
#battleVeil .rt-party-info{padding:5px}
#battleVeil .rt-party{height:96px}
#battleVeil .rt-party-info .rt-member,#battleVeil .rt-member-empty{height:96px;aspect-ratio:auto}
#battleVeil .rt-hero-statuses{flex-wrap:nowrap;overflow-x:auto;min-height:32px;max-height:36px}
#battleVeil .rt-skillbar{width:100%;margin:0;gap:6px}
#battleVeil .rt-skill{height:88px;min-height:0;aspect-ratio:auto}
#battleVeil .rt-footer{grid-column:1/-1;margin:0;font-size:10px}
#battleVeil .stage-scenery-strip img{object-position:center bottom}
@media(max-width:900px){#battleVeil #battleCommandBar.realtime-hud{grid-template-columns:minmax(0,1fr);gap:5px;padding:5px 8px;max-height:36dvh}#battleVeil .rt-party,#battleVeil .rt-party-info .rt-member,#battleVeil .rt-member-empty{height:64px}#battleVeil .rt-skill{height:62px}#battleVeil .rt-footer{font-size:9px}#battleVeil .rt-hero-vitals>strong{font-size:13px}#battleVeil .rt-hero-statuses{min-height:0;max-height:26px}}

/* Crop distant sky rather than moving the walk plane into the mountains. */
#battleVeil .stage-scenery-strip img{top:var(--scenery-crop-top,-53.846%);height:var(--scenery-crop-height,153.846%);width:100%;object-fit:fill;object-position:center bottom}

.stage-board .boss-health-panel{top:48px}

.stage-board .enemy.large-health-bar:not(.defeated) .unit-name{visibility:visible}

.realtime-board .enemy-overhead-hp[hidden]{display:none!important}

/* v205: party and effects belong to the battlefield's top corners. */
.realtime-board .rt-top-party{position:absolute;z-index:420;top:10px;left:12px;width:min(29%,300px);padding:0;border:0;border-radius:0;background:none}
#battleVeil .realtime-board .rt-top-party .rt-party{height:68px;gap:5px}
#battleVeil .realtime-board .rt-top-party .rt-member,#battleVeil .realtime-board .rt-top-party .rt-member-empty{height:68px;aspect-ratio:auto;border-color:#ae975f;background:#10202a88}
.realtime-board .rt-top-party .rt-member-name{font-size:10px;top:3px;left:3px}
.realtime-board .rt-top-party .rt-member-bars{padding:10px 3px 3px}
.realtime-board .rt-top-party .combat-meter-row{margin-top:2px}
.realtime-board .rt-top-party .combat-meter-row>b{font-size:8px}
.realtime-board .rt-top-party .combat-meter{height:5px}
#battleVeil .realtime-board .rt-top-effects{position:absolute;z-index:420;top:12px;right:12px;display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:flex-start;align-items:center;gap:5px;width:max-content;max-width:29%;min-height:32px;max-height:44px;margin:0;padding:0 0 5px;overflow-x:auto;overflow-y:hidden;scrollbar-width:thin}
.realtime-board .stage-progress-hud{top:16px;left:32%;right:32%;height:30px;display:flex;justify-content:center;align-items:center;gap:12px;white-space:nowrap}
.realtime-board .stage-progress-hud>strong{position:static;font-size:13px;overflow:hidden;text-overflow:ellipsis}
.realtime-board .stage-progress-hud .stage-clock{position:static;transform:none;flex-shrink:0;margin:0}
#battleVeil .rt-vitals{grid-template-columns:minmax(0,1fr)}
.stage-board .boss-health-panel{top:90px}
@media(max-width:700px){
  .realtime-board .rt-top-party{top:8px;left:8px;width:30%}
  #battleVeil .realtime-board .rt-top-party .rt-party,#battleVeil .realtime-board .rt-top-party .rt-member,#battleVeil .realtime-board .rt-top-party .rt-member-empty{height:48px}
  .realtime-board .rt-top-party .rt-member-name{font-size:8px}
  .realtime-board .rt-top-party .combat-meter-row>b{display:none}
  #battleVeil .realtime-board .rt-top-effects{top:8px;right:8px;max-width:29%;min-height:26px}
  .realtime-board .rt-top-effects .rt-effect-icon{flex-basis:26px;width:26px;height:26px}
  .realtime-board .stage-progress-hud{top:12px;left:32%;right:32%;gap:7px}
  .realtime-board .stage-progress-hud>strong{font-size:10px}
  .realtime-board .stage-progress-hud .stage-clock{font-size:18px}
  .stage-board .boss-health-panel{top:68px}
}

.rt-skill.rt-drop-target{transform:scale(1.07);border-color:#ffe3a0!important;box-shadow:0 0 0 2px #f0cf81,0 0 18px #edca7066;z-index:2}

/* Compact battle resources, quick slots and management controls. */
#battleVeil #battleCommandBar.realtime-hud{grid-template-columns:minmax(180px,.75fr) minmax(0,1.8fr) 88px;grid-template-areas:"vitals slots management" "footer footer footer";gap:6px 12px;align-items:stretch}
#battleVeil .rt-vitals{grid-area:vitals;min-width:0;grid-template-columns:minmax(0,1fr)}
#battleVeil .rt-skillbar{grid-area:slots;min-width:0;align-self:stretch;align-content:center;justify-self:start}
#battleVeil .rt-management{grid-area:management;display:flex;flex-direction:column;justify-content:center;gap:5px;min-width:0}
#battleVeil .rt-management button{flex:1;padding:6px 4px;min-height:28px;font-size:12px;white-space:nowrap;border:1px solid #7c765c;border-radius:6px;background:#263f4c;color:#f2dfb5;cursor:pointer}
#battleVeil .rt-management button:hover{background:#3a5560;border-color:#e4bd69}
#battleVeil .rt-footer{grid-area:footer}
@media(max-width:900px){#battleVeil #battleCommandBar.realtime-hud{grid-template-columns:minmax(140px,.7fr) minmax(0,1.8fr) 74px;gap:5px 8px}#battleVeil .rt-management button{font-size:11px;padding:3px}}
@media(max-width:650px){#battleVeil #battleCommandBar.realtime-hud{grid-template-columns:minmax(0,1fr) 72px;grid-template-areas:"vitals management" "slots management" "footer footer"}#battleVeil .rt-skillbar{gap:3px}#battleVeil .rt-skill{height:54px}#battleVeil .rt-hero-vitals{padding:3px 8px}}

/* Let the resource card fill the space left by the nine quick slots. */
#battleVeil #battleCommandBar.realtime-hud{grid-template-columns:minmax(220px,1fr) minmax(0,900px) 88px}
#battleVeil .rt-skillbar{max-width:none}
.realtime-hud .combat-meter.exp i{background:linear-gradient(90deg,#a27d23,#f4d878);transition:width .2s ease-out}
#battleVeil .rt-experience{width:100%}
@media(max-width:900px){#battleVeil #battleCommandBar.realtime-hud{grid-template-columns:minmax(150px,1fr) minmax(0,2fr) 74px}}
@media(max-width:650px){#battleVeil #battleCommandBar.realtime-hud{grid-template-columns:minmax(0,1fr) 72px}}
.rt-level-up{position:absolute;inset:0;pointer-events:none;z-index:30;animation:level-up-lifetime 2.2s linear forwards}
.rt-level-up img{position:absolute;width:150%;max-width:none;height:auto;left:-25%;bottom:103%;object-fit:contain;filter:drop-shadow(0 2px 3px #001b0b);animation:level-up-label 2.2s ease-out forwards}
.rt-level-up .level-up-ring{position:absolute;left:-15%;bottom:0;width:130%;height:22%;border:3px solid #e7ffc8;border-radius:50%;background:radial-gradient(ellipse,#c5ffad50,transparent 70%);box-shadow:0 0 12px #bfff90,inset 0 0 12px #8aff8a;animation:level-up-ring 2.2s ease-out forwards}
.rt-level-up .level-up-light{position:absolute;left:0;bottom:3%;width:100%;height:140%;background:linear-gradient(90deg,transparent,#c3ffab44 25%,#f8ffdbb0 49%,#baff9255 75%,transparent);clip-path:polygon(30% 0,70% 0,100% 100%,0 100%);mix-blend-mode:screen;animation:level-up-beam 2.2s ease-out forwards}
.rt-level-up .level-up-sparks{position:absolute;inset:-35% -20% 0;background:radial-gradient(circle at 15% 75%,#fffedc 0 2px,transparent 3px),radial-gradient(circle at 80% 60%,#baff98 0 3px,transparent 4px),radial-gradient(circle at 35% 35%,#fffedc 0 2px,transparent 3px),radial-gradient(circle at 70% 15%,#f5ffc9 0 2px,transparent 3px);animation:level-up-sparks 2.2s ease-out forwards}
@keyframes level-up-lifetime{0%,85%{opacity:1}100%{opacity:0}}
@keyframes level-up-label{0%{opacity:0;transform:translateY(15px) scale(.65)}15%{opacity:1;transform:translateY(-8px) scale(1.08)}30%,75%{opacity:1;transform:translateY(-12px) scale(1)}100%{opacity:0;transform:translateY(-35px) scale(1)}}
@keyframes level-up-ring{0%{opacity:0;transform:scale(.4)}20%{opacity:1}75%{opacity:1;transform:scale(1.15)}100%{opacity:0;transform:scale(1.4)}}
@keyframes level-up-beam{0%{opacity:0;transform:scaleY(.2);transform-origin:bottom}20%,55%{opacity:1;transform:scaleY(1)}100%{opacity:0;transform:scaleY(1.2)}}
@keyframes level-up-sparks{0%{opacity:0;transform:translateY(20px)}25%,65%{opacity:1}100%{opacity:0;transform:translateY(-55px)}}
@media(prefers-reduced-motion:reduce){.rt-level-up img,.rt-level-up i{animation:none}.rt-level-up{animation:level-up-lifetime 2.2s linear forwards}}

/* Equal resource rows; experience label stays on one line. */
#battleVeil .rt-hero-vitals{gap:6px}
#battleVeil .rt-hero-vitals>.combat-meter-row,#battleVeil .rt-experience>.combat-meter-row{margin:0;row-gap:2px}
#battleVeil .rt-exp-label{grid-column:1/-1;white-space:nowrap}

/* A short body flash confirms HP potion use; low HP keeps the bar pulsing. */
.realtime-board .potion-red-glow .layered-figure,.realtime-board .potion-red-glow .unit-art{animation:hp-potion-body-glow .2s ease-out!important}
@keyframes hp-potion-body-glow{0%{filter:brightness(1.2) sepia(.5) saturate(3) hue-rotate(315deg) drop-shadow(0 0 4px #ff2424)}35%{filter:brightness(1.65) sepia(1) saturate(5) hue-rotate(315deg) drop-shadow(0 0 12px #ff1717) drop-shadow(0 0 22px #ff3939)}100%{filter:drop-shadow(0 2px 1px #0006)}}
.realtime-hud .hp-danger .combat-meter.hp{animation:hp-danger-pulse .8s ease-in-out infinite;border-color:#ff766b}
.realtime-hud .hp-danger>span,.realtime-hud .hp-danger>b{color:#ff9387}
@keyframes hp-danger-pulse{0%,100%{opacity:1;box-shadow:0 0 8px #ff3939aa}50%{opacity:.4;box-shadow:0 0 2px #ff393944}}
@media(prefers-reduced-motion:reduce){.realtime-hud .hp-danger .combat-meter.hp{animation:none;box-shadow:0 0 7px #ff3939aa}.realtime-board .potion-red-glow .layered-figure,.realtime-board .potion-red-glow .unit-art{animation:none!important;filter:drop-shadow(0 0 8px #ff2424)}}

#battleVeil .rt-hero-heading{display:flex;align-items:baseline;gap:12px;flex-wrap:wrap}
#battleVeil .rt-hero-heading .rt-hero-level{font-size:19px;font-weight:800;color:#f4d985;white-space:nowrap}
@media(max-width:900px){#battleVeil .rt-hero-heading .rt-hero-level{font-size:17px}}
