/* PLAZA4: result presentation only. Existing town backdrop and button art unchanged. */
#modal .battle-result .br-header{width:min(100%,1100px);gap:2px;padding:1px 8px 0}
#modal .battle-result .br-banner{height:clamp(66px,12dvh,130px);width:min(70vw,380px)}
#modal .battle-result .br-stage-caption{gap:5px;padding:1px 9px}
#modal .battle-result .br-tabs button{min-height:29px;padding:3px 13px}
#modal .battle-result .br-body{width:min(100%,1440px);max-width:1440px;justify-content:flex-start;gap:4px;padding:2px clamp(6px,2vw,22px);outline:none}
#modal .battle-result .br-body:focus-visible{outline:2px solid #f3c96a;outline-offset:-2px}
#modal .battle-result .br-overview{display:flex;flex-direction:column;justify-content:flex-end;flex:1 1 0;min-height:96px;gap:3px}
#modal .battle-result .br-overview[hidden]{display:none}
#modal .battle-result .br-lineup{flex:1 1 0;align-items:end;gap:clamp(2px,1vw,14px);padding:0 2px;min-height:0}
#modal .battle-result .br-unit{flex:0 1 auto;width:clamp(90px,calc(100dvh - 200px),390px);max-width:none;min-width:0;height:100%;gap:1px;justify-content:flex-end}
#modal .battle-result .br-sprite{display:block;width:100%;height:0;min-height:0;flex:1 1 0;max-height:390px;object-fit:contain;object-position:center bottom;filter:drop-shadow(0 4px 2px #24302048)}
#modal .battle-result .br-unit-name{font-size:clamp(11px,1.35vw,18px);line-height:1.1;padding:2px 8px;background:#204b42e8;color:#fff6dc}
#modal .battle-result .br-unit-status{display:none}
#modal .battle-result .br-down .br-unit-status{display:block;background:#6b4141e8;color:#fff1df}
#modal .battle-result .br-metrics{margin:0;padding:0;gap:0;background:#fff0d3ef;border:1px solid #c8a16a;border-radius:6px;overflow:hidden}
#modal .battle-result .br-metrics>div{flex-direction:row;gap:5px;background:none;border:0;border-right:1px solid #c5a26880;border-radius:0;padding:3px 4px}
#modal .battle-result .br-metrics>div:last-child{border-right:0}
#modal .battle-result .br-metrics small{color:#725b3b;font-size:clamp(9px,1vw,14px)}
#modal .battle-result .br-metrics strong{color:#493319;font-size:clamp(12px,1.4vw,19px)!important}
#modal .battle-result .br-rating-rule{display:none}
#modal .battle-result .br-rewards{display:grid;grid-template-columns:auto minmax(0,1fr);gap:2px 10px;padding:4px 9px;text-align:center;align-items:center;background:#fff0d3f5;box-shadow:inset 0 0 0 1px #c5a268}
#modal .battle-result .br-rewards[hidden]{display:none}
#modal .battle-result .br-reward-heading{grid-column:1;grid-row:1;min-width:0;width:auto;white-space:nowrap;padding:4px 12px;margin:0;font-size:clamp(10px,1.3vw,15px)}
#modal .battle-result .br-gem{grid-column:1;grid-row:2;min-width:0;width:auto;min-height:0;margin:0;padding:2px 6px;background:none;color:#684a26;gap:2px}
#modal .battle-result .br-gem-number{color:#674015;text-shadow:none;font-size:clamp(15px,2vw,27px)}
#modal .battle-result .br-gem>span{font-size:10px;white-space:nowrap}
#modal .battle-result .br-reward-slot{background:none;width:clamp(22px,3vw,38px);height:clamp(22px,3vw,38px)}
#modal .battle-result .br-reward-slot .br-gem-icon{width:100%;height:100%}
#modal .battle-result .br-rewards .battle-material-loot{grid-column:2;grid-row:1 / span 2;gap:3px 5px;align-items:center;justify-content:center}
#modal .battle-result .battle-material-cell{position:relative;display:flex;flex-direction:column;gap:0;line-height:1;min-width:0;color:#493319;font-size:clamp(10px,1.2vw,15px)}
#modal .battle-result .battle-material-cell img{width:clamp(26px,4.1vw,52px);height:clamp(26px,4.1vw,52px);object-fit:contain}
#modal .battle-result .br-records{grid-column:1/-1;display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:2px 10px;color:#775b35}
#modal .battle-result .br-record{font-size:clamp(10px,1vw,13px);line-height:1.05;margin:0!important}
#modal .battle-result .br-new{height:15px;width:34px;font-size:8px;margin-left:3px}
#modal .battle-result .br-note,#modal .battle-result .br-save-warning,#modal .battle-result .bond-result-milestone{grid-column:1/-1}
#modal .battle-result .br-growth-pane{margin:auto 0;max-width:900px;align-self:center}
#modal .battle-result .br-actions{width:min(100%,1120px);max-width:1120px;gap:5px}
@media(max-height:450px){
 #modal .battle-result .br-banner{height:49px;width:230px}
 #modal .battle-result .br-header{gap:1px;padding:0 4px}
 #modal .battle-result .br-tabs button{min-height:24px;padding:2px 10px}
 #modal .battle-result .br-body{gap:2px;padding:0 6px}
 #modal .battle-result .br-overview{gap:1px}
 #modal .battle-result .br-sprite{height:0;max-height:240px}
 #modal .battle-result .br-unit-name{padding:1px 5px;font-size:11px}
 #modal .battle-result .br-metrics>div{padding:2px 3px;gap:3px}
 #modal .battle-result .br-rewards{padding:2px 5px;gap:1px 6px}
 #modal .battle-result .br-reward-heading{padding:2px 9px;font-size:10px}
 #modal .battle-result .br-gem{padding:0 2px}
 #modal .battle-result .battle-material-cell img{width:28px;height:28px}
 #modal .battle-result .br-records{gap:1px 8px}
 #modal .battle-result .br-record{font-size:9px}
 #modal .battle-result .br-actions{padding:2px 4px;gap:4px}
}
@media(max-width:520px){#modal .battle-result .br-metrics>div{flex-direction:column;gap:1px}#modal .battle-result .br-unit-name{padding-inline:3px;white-space:normal}#modal .battle-result .br-actions button,#modal .battle-result .br-actions button.primary{padding-inline:5px;font-size:10px}}

/* Keep stars readable next to the stage caption instead of competing with the victory ribbon. */
#modal .battle-result .br-stage-caption .br-stars{position:static;display:flex;height:clamp(14px,2.3dvh,25px);gap:2px;flex:none;align-items:center}
#modal .battle-result .br-stage-caption .br-star{display:block;width:clamp(14px,2.3dvh,25px);height:100%;max-width:none;flex:none;object-fit:contain}
#modal .battle-result .br-unit-name,#modal .battle-result .br-unit-status{flex:none}
#modal .battle-result .br-metrics{flex:none}
#modal .battle-result .br-rewards{flex:none}
#modal .battle-result.br-lose .br-rewards{grid-template-columns:auto minmax(0,1fr)}
#modal .battle-result.br-lose .br-note{grid-column:2;grid-row:1;margin:0!important}
/* Keep the rewards grouped around the center, with immediate readable counts. */
#modal .battle-result .br-rewards{grid-template-columns:max-content minmax(0,max-content);justify-content:center;column-gap:clamp(10px,3vw,30px)}
#modal .battle-result .br-gem{opacity:1;animation:none!important;transform:none}
