
/* v2.71: Arena and Expedition are still in development: greyed folder tabs and a note on their pages (still playable) */
.fwtabs button.fwdevtab{opacity:.55;font-style:italic}
.fwtabs button.fwdevtab[aria-selected="true"]{opacity:.85}
.fwdev{display:flex;gap:10px;align-items:flex-start;margin:0 0 12px;padding:10px 12px;border:2px dashed var(--accent);border-radius:14px;background:var(--surface);color:var(--ink);font-size:14px;line-height:1.35}
.fwdev svg{flex:none;color:var(--accent);margin-top:1px}
/* v2.73: the Trials battle window keeps one size while a run plays: fixed width and height, a fixed-height log area,
   room for a two-line heading, and the buttons pinned to the bottom. Longer content (the run's rewards) scrolls inside. */
/* v2.74: no fixed window height. The play-by-play is a small box of its own that keeps every move and scrolls (newest at the bottom),
   and the rewards list scrolls in its own box, so the Rest and Collect buttons fit on a phone screen without scrolling the window. */
/* v2.75: one fixed window size for the whole run. Heading, fighters and the button bar have fixed heights; the battle feed
   (play-by-play, the won message, and the rewards at the end) fills all the space left and scrolls inside itself.
   Each button has a set place: left = Skip this fight / Full heal, right = Rest and go on / Collect. */
.modal-box.battle{width:min(560px,calc(100vw - 24px));max-width:none;height:min(640px,calc(100vh - 24px));height:min(640px,calc(100dvh - 24px));max-height:none;display:flex;flex-direction:column;overflow:hidden;box-sizing:border-box}
.modal-box.battle>*{flex:none}
.modal-box.battle h2{height:2.4em;line-height:1.2;margin-top:2px;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.modal-box.battle .blog,.modal-box.battle .pk-result{flex:1 1 0;min-height:0;overflow-y:auto;overscroll-behavior:contain;margin:0;box-sizing:border-box;border:1px solid var(--line);border-radius:10px;font-size:13px;line-height:1.45}
.modal-box.battle .blog{padding:6px 10px 6px 26px;background:var(--surface-2)}
.modal-box.battle .pk-result{padding:10px 12px}
.modal-box.battle>div:has(>.loot){flex:0 1 auto;min-height:0;max-height:42%;overflow-y:auto;overscroll-behavior:contain}
.modal-box.battle .modal-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;height:48px;margin:0;align-items:stretch}
.modal-box.battle .modal-actions>button{grid-row:1;width:100%;min-width:0;margin:0}
.modal-box.battle #battleskip,.modal-box.battle #restheal{grid-column:1}
.modal-box.battle #restgo,.modal-box.battle #battleok{grid-column:2}
/* v2.81: remember the full picture's height so Smaller can be exactly 75% of it */
/* (set from script below) */
/* v2.85: results XP bars. Each bird's bar fills from where it was to where the reward takes it; on a level up it fills,
   flashes gold with a LEVEL UP! badge, then refills to the new level's progress. */
.xprows{display:flex;flex-direction:column;gap:5px;margin-top:6px}
.xprow{position:relative;display:grid;grid-template-columns:minmax(0,1fr) auto minmax(60px,1.4fr) auto;align-items:center;gap:8px;padding:4px 8px;border-radius:10px;background:var(--surface-2);font-size:13px}
.xprow b{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.xplv{font-size:12px;color:var(--muted);white-space:nowrap}.xplv em{font-style:normal;font-weight:900;color:var(--accent)}
.xpbar2{height:8px;border-radius:4px;background:color-mix(in srgb,var(--line) 70%,transparent);overflow:hidden}
.xpbar2 i{display:block;height:100%;width:var(--to2);border-radius:4px;background:var(--good,#5BB37F);animation:xpfill 1s ease-out .3s both}
.xprow.up .xpbar2 i{background:var(--accent);animation:xpfill 1s ease-out .3s both,xpfill2 .8s ease-out 1.6s forwards}
@keyframes xpfill{from{width:var(--from)}to{width:var(--to)}}
@keyframes xpfill2{from{width:0}to{width:var(--to2)}}
.xpgain{font-weight:800;font-size:12px;color:var(--good,#5BB37F);white-space:nowrap}
.xprow.up{animation:lvglow 1.2s ease-out 1.3s both}
@keyframes lvglow{0%{box-shadow:0 0 0 0 color-mix(in srgb,var(--accent) 80%,transparent);background:color-mix(in srgb,var(--accent) 45%,var(--surface-2))}100%{box-shadow:0 0 0 10px transparent;background:color-mix(in srgb,var(--accent) 16%,var(--surface-2))}}
.lvup{position:absolute;right:8px;top:-9px;padding:1px 8px;border-radius:999px;background:var(--accent);color:var(--accent-ink,#1F2421);font-size:10.5px;font-weight:900;letter-spacing:.06em;animation:lvpop .6s cubic-bezier(.2,1.6,.4,1) 1.3s both;pointer-events:none}
@keyframes lvpop{0%{transform:scale(0) rotate(-12deg);opacity:0}100%{transform:scale(1) rotate(0);opacity:1}}
@media (prefers-reduced-motion:reduce){.xpbar2 i,.xprow.up .xpbar2 i,.xprow.up,.lvup{animation:none!important}.xprow.up{background:color-mix(in srgb,var(--accent) 16%,var(--surface-2))}}
/* v2.88: the window uses more of a tall phone screen (same size for the whole run), and tightens itself only when needed:
   fit1 = compact rewards, fit2 = at the end of a run the foe and feed row gives way to the rewards, fit3 = smaller fighters */
.modal-box.battle{height:min(780px,calc(100vh - 24px));height:min(780px,calc(100dvh - 24px))}
.modal-box.battle.fit1 .xprows{gap:3px;margin-top:4px}
.modal-box.battle.fit1 .xprow{padding:2px 8px;font-size:12px}
.modal-box.battle.fit1 .loot{gap:4px!important}
.modal-box.battle.fit1 .loot>*{min-height:30px!important;padding:2px 8px!important;font-size:12px!important}
.modal-box.battle.fit1 .loot img,.modal-box.battle.fit1 .loot canvas,.modal-box.battle.fit1 .loot svg{max-height:20px!important;width:auto!important}
.modal-box.battle.fit1{gap:8px}
.modal-box.battle.fit2:has(#battleok) .arenafloor>.vs,.modal-box.battle.fit2:has(#battleok) .arenafloor>.bside.foe{display:none!important}
.modal-box.battle.fit3 .bfighter canvas,.modal-box.battle.fit3 .bfighter img,.modal-box.battle.fit3 .bfighter svg{max-height:40px!important;width:auto!important}
.modal-box.battle.fit3 .bfighter{gap:2px!important}
/* v2.80: Foe 1 ... Boss all on one row (frees room so Collect isn't pushed to the window's edge) */
.modal-box.battle .runsteps{display:flex!important;flex-wrap:nowrap!important;gap:3px!important;overflow:hidden}
.modal-box.battle .runsteps .runstep{flex:1 1 0;min-width:0;padding:4px 1px!important;font-size:11px!important;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:clip;margin:0!important}
/* v2.76: the feed lives in the gap around VS between your birds and the foe. The space below the fighters holds the rewards at the end of a run, with no scrolling. */
/* v2.78: your birds across the top; the foe bottom-left with the VS label and the feed filling the space to its right */
/* v2.79: feed on the left under your birds, foe on the right. The fighters area no longer stretches to fill the window, so it
   stays the same size from the first fight to the rewards; the feed is as tall as the foe's card. */
.modal-box.battle.feedmid .arenafloor{flex:none;min-height:0;display:grid!important;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto auto;gap:10px 12px;align-items:stretch}
.modal-box.battle.feedmid .arenafloor>.bside{grid-column:1 / -1;grid-row:1;align-self:start;min-width:0}
.modal-box.battle.feedmid .arenafloor>.bside.foe{grid-column:2;grid-row:2;align-self:start}
.modal-box.battle.feedmid .arenafloor>.vs{grid-column:1;grid-row:2;min-width:0;min-height:0;display:flex;flex-direction:column;align-items:stretch;gap:4px;align-self:stretch;font-size:inherit;margin:0;padding:0;width:auto;height:auto}
.modal-box.battle.feedmid .vs .vslbl{flex:none;text-align:center;font-family:var(--display);font-weight:800;font-size:18px;line-height:1;color:var(--muted)}
.modal-box.battle.feedmid .vs .blog,.modal-box.battle.feedmid .vs .pk-result{flex:1 1 0;min-height:0;font-size:12px;line-height:1.4;text-align:left}
.modal-box.battle.feedmid .vs .blog{padding:6px 8px 6px 20px}
.modal-box.battle.feedmid>div:has(>.loot){flex:0 0 auto;max-height:none;overflow:visible}
.modal-box.battle.feedmid .loot{max-height:none;overflow:visible}
