/* A live battlefield overlay. No scene replacement, scrim or full-screen blur. */
#result.match-end{--result-top:max(100px,14vh);--banner-height:76px;position:fixed;inset:0;z-index:24;background:none;backdrop-filter:none;pointer-events:none;padding:0;overflow:hidden;outline:none;}
#result[hidden],#result [hidden]{display:none!important;}
.match-end-masthead{position:absolute;top:50%;left:50%;width:min(980px,calc(100% - 32px));transform:translate(-50%,-50%);transition:top .6s cubic-bezier(.22,1,.36,1),transform .6s cubic-bezier(.22,1,.36,1);}
#result[data-phase=lift] .match-end-masthead,#result[data-phase=ready] .match-end-masthead{top:var(--result-top);transform:translate(-50%,0);}
.match-banner{position:relative;isolation:isolate;height:var(--banner-height);display:flex;align-items:center;justify-content:center;overflow:hidden;}
.match-banner::before{content:'';position:absolute;inset:0;z-index:-1;background:url('assets/menu/match-end/victory-ribbon.png') center/100% auto no-repeat;}
.match-banner::after{content:'';position:absolute;inset:21% auto 21% -35%;width:24%;pointer-events:none;background:linear-gradient(105deg,transparent,#ffd58b24,transparent);transform:skewX(-18deg);opacity:0;}
.match-banner h2{display:flex;align-items:baseline;justify-content:center;gap:.65em;white-space:nowrap;margin:0;padding:0 6%;color:#f7ede0;font:600 clamp(9px,1.5vw,21px)/1.2 var(--mono);letter-spacing:clamp(.1px,.1vw,1.3px);text-shadow:0 2px 8px #000,0 0 15px #f2b45124;}
#result-subtitle{color:#f2b451;font-weight:500;}
.match-banner-divider{color:#e7b569;font-weight:400;}
#result[data-phase=enter] .match-banner{animation:match-banner-pop .3s cubic-bezier(.16,1,.3,1) both;}
#result[data-phase=enter] .match-banner::after{animation:match-banner-sweep 1s .25s ease-out both;}
.match-end-actions{display:flex;justify-content:center;gap:10px;margin:1px auto 0;pointer-events:auto;width:max-content;max-width:100%;animation:match-controls-in .24s ease-out both;}
.match-end-actions button{min-height:44px;min-width:170px;padding:10px 20px;border:1px solid #71828a80;border-radius:3px;background:#0f171be8;box-shadow:0 4px 18px #0003;color:#c6ced0;font:500 10px/1.3 var(--mono);letter-spacing:1.15px;text-transform:uppercase;}
.match-end-actions #result-report{color:#f8d496;border-color:#c48b40;background:linear-gradient(180deg,#5b391c77,#1a1712ee);box-shadow:inset 0 0 18px #cf8a3310,0 2px 12px #0004;}
.match-end-actions button:hover:enabled{color:#fff0d6;border-color:#edb862;background:#38291eee;}
#result button:focus-visible{outline:2px solid #f2b451;outline-offset:4px;}
.match-report{position:absolute;top:calc(var(--result-top) + var(--banner-height) + 66px);left:50%;transform:translateX(-50%);width:min(590px,calc(100% - 36px));max-height:calc(100dvh - var(--result-top) - var(--banner-height) - 86px - env(safe-area-inset-bottom));overflow:auto;overscroll-behavior:contain;pointer-events:auto;background:linear-gradient(135deg,#202426e8,#10171aef);border:1px solid #ad8d5b70;border-radius:4px;box-shadow:0 14px 45px #0005;backdrop-filter:blur(8px);padding:23px 26px 20px;animation:match-report-in .24s cubic-bezier(.2,.8,.2,1) both;scrollbar-width:thin;scrollbar-color:#8d7448 #172024;}
.match-report-header{display:flex;align-items:center;gap:14px;border-bottom:1px solid #c2ced021;padding-bottom:15px;}
.match-report-header>div{flex:1;min-width:0;}
.match-report-context{margin:0 0 6px;color:#a1adae;font:9px/1.3 var(--mono);letter-spacing:1.2px;}
.match-report-header h3{margin:0;color:#f3eee5;font:550 18px/1.2 var(--mono);letter-spacing:2px;text-transform:uppercase;}
.match-report-badge{border:1px solid #bd873a75;border-radius:2px;background:#6b4b1a20;padding:6px 10px;font:500 9px/1 var(--mono);letter-spacing:1px;color:#f2b451;}
.match-report-close{display:grid;place-items:center;flex:0 0 38px;height:38px;padding:0;border:0;background:transparent;color:#b5b9b7;}
.match-report-close svg{width:18px;height:18px;stroke-width:1;}
.match-report-primary,.match-report-secondary{margin:0;}
.match-report-primary>div{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:15px 0;border-bottom:1px solid #c2ced017;}
.match-report-primary dt{display:flex;align-items:center;gap:12px;color:#c6c9c5;font:10px/1.4 var(--mono);letter-spacing:1px;text-transform:uppercase;}
.match-report-primary dt svg{height:20px;width:20px;fill:none;stroke:#c8ac7d;stroke-width:1.25;stroke-linecap:round;stroke-linejoin:round;}
.match-report-primary dd{margin:0;color:#f3dfb8;font:500 19px/1.2 var(--mono);font-variant-numeric:tabular-nums;}
.match-report-secondary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px 12px;padding:19px 0 16px;}
.match-report-secondary dt{font-size:10px;line-height:1.4;color:#9aabae;}
.match-report-secondary dd{margin:4px 0 0;font:500 13px/1.2 var(--mono);color:#dce0db;}
.match-report-detail{margin:0;color:#9eacaf;font-size:11px;line-height:1.6;}
.match-report-extra{display:flex;gap:10px;flex-wrap:wrap;}
.match-report-extra button{min-height:44px;padding:9px 12px;margin-top:14px;font-size:11px;border-radius:3px;}
#result[data-outcome=defeat] .match-banner::before{filter:hue-rotate(-20deg) saturate(.7);}
#result[data-outcome=defeat] #result-subtitle,#result[data-outcome=defeat] .match-report-badge{color:#e6a18b;}
#result[data-outcome=draw] .match-banner::before{filter:saturate(.25);}
#result[data-outcome=draw] #result-subtitle{color:#c6cfd0;}
#app[data-match-end=true] :is(.topbar,.quick-status,.camera-tools,#command-dock,#network-bar){opacity:.28;pointer-events:none;transition:opacity .3s;}
#app[data-match-end=true] :is(#paused-tag,#firmware-alert,#toast){visibility:hidden;}
@keyframes match-banner-pop{0%{opacity:0;transform:scale(.92,.7);}70%{opacity:1;transform:scale(1.012,1.02);}100%{opacity:1;transform:scale(1);}}
@keyframes match-banner-sweep{0%{left:-35%;opacity:0;}20%{opacity:1;}100%{left:115%;opacity:0;}}
@keyframes match-controls-in{from{opacity:0;transform:translateY(7px);}to{opacity:1;transform:translateY(0);}}
@keyframes match-report-in{from{opacity:0;transform:translate(-50%,8px);}to{opacity:1;transform:translate(-50%,0);}}
@media(max-width:600px){
 #result.match-end{--result-top:max(84px,12vh);--banner-height:50px;}
 .match-end-masthead{width:calc(100% - 14px);}
 .match-banner h2{font-size:clamp(8px,2.25vw,13.5px);letter-spacing:.15px;gap:.4em;padding:0 5%;}
 .match-end-actions{gap:8px;}
 .match-end-actions button{min-width:0;padding:10px 14px;letter-spacing:.7px;font-size:9px;}
 .match-report{padding:17px 18px;width:calc(100% - 24px);}
 .match-report-header{gap:8px;}
 .match-report-header h3{font-size:15px;letter-spacing:1.2px;}
 .match-report-primary>div{padding:13px 0;}
 .match-report-primary dt{font-size:9px;letter-spacing:.4px;gap:9px;}
 .match-report-primary dd{font-size:17px;}
 .match-report-secondary{grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media(max-height:560px){
 #result.match-end{--result-top:max(10px,env(safe-area-inset-top));--banner-height:48px;}
 .match-end-masthead{width:min(800px,calc(100% - 24px));}
 .match-end-actions button{min-height:38px;padding:8px 16px;}
 .match-report{top:calc(var(--result-top) + 98px);max-height:calc(100dvh - var(--result-top) - 110px - env(safe-area-inset-bottom));}
}
@media(prefers-reduced-motion:reduce){
 #result *,#result *::after{animation:none!important;transition:none!important;}
}
