/* The battle remains behind the celebration; rewards come from its saved receipt. */
body[data-screen=arena][data-phase]:is([data-phase=victory],[data-phase=defeat],[data-phase=draw]) #arena-screen{grid-template-rows:minmax(0,1fr);grid-template-areas:'battle'}
body[data-screen=arena]:is([data-phase=victory],[data-phase=defeat],[data-phase=draw]) .battle-actions{display:none}
body[data-screen=arena]:is([data-phase=victory],[data-phase=defeat],[data-phase=draw]) .team-banner{visibility:hidden}
body[data-screen=arena]:is([data-phase=victory],[data-phase=defeat],[data-phase=draw]) .battle-toolbar{visibility:hidden}
body[data-screen=arena] .result-overlay{padding:0;background:linear-gradient(#17090896,#100807ba);backdrop-filter:none;overflow-y:auto;overscroll-behavior:contain;justify-content:stretch}
body[data-screen=arena] .result-card{position:relative;isolation:isolate;display:grid;grid-template-rows:30% 48% 22%;width:min(100%,650px);max-width:none;height:100%;min-height:490px;max-height:none;overflow:visible;padding:0;border:0;border-radius:0;background:none;box-shadow:none;flex-shrink:0}
.result-hero{position:relative;display:flex;align-items:flex-end;justify-content:center;z-index:2}
.result-card .result-stage{position:absolute;top:16px;left:10px;right:10px;color:#fff0c5;font-size:11px;font-weight:800;text-shadow:0 2px 3px #180a08;letter-spacing:.4px}
.result-emblem{position:relative;width:clamp(250px,72%,390px);max-height:100%;aspect-ratio:3/2;transform:translateY(20%);filter:drop-shadow(0 7px 5px #20061075)}
.result-emblem::before{content:'';position:absolute;inset:-15% -8% 10%;z-index:-1;background:radial-gradient(ellipse,#ffc14cc9,transparent 65%);pointer-events:none}
.result-emblem img{display:block;width:100%;height:100%;object-fit:contain}
.result-card .result-emblem h2{position:absolute;inset:72% 0 auto;margin:0;color:#fff;font:900 clamp(23px,4.8vw,32px)/1.25 Inter,Arial,sans-serif;letter-spacing:-.5px;text-shadow:0 2px 1px #19345f,1px 0 2px #19345f,-1px 0 2px #19345f}
.result-prize-panel{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:26px;min-height:0;padding:62px 18px 28px;background:radial-gradient(ellipse at 50% 45%,#ca3152a6,transparent 70%),linear-gradient(145deg,#8b1136,#a8133b 55%,#7b0e30);border-top:7px solid #e4bb70;border-bottom:7px solid #e4bb70;box-shadow:0 -2px #7e4319,0 2px #63320e,inset 0 3px #ffefb6,inset 0 -3px #a76c3d}
.result-prize-panel::before,.result-prize-panel::after{content:'';position:absolute;inset:0;pointer-events:none;z-index:-1}
.result-prize-panel::before{background:linear-gradient(150deg,transparent 49%,#e658671b 50%,transparent 77%),linear-gradient(25deg,transparent 35%,#660b3026 35% 65%,transparent 65%);clip-path:polygon(0 0,50% 18%,100% 0,100% 75%,50% 100%,0 75%);z-index:0}
.result-rewards{position:relative;display:flex;flex-wrap:wrap;justify-content:center;gap:14px;width:100%;margin:auto 0 0;z-index:1}
.result-reward{width:clamp(70px,16vw,98px);margin:0;min-width:0}
.result-reward-tile{position:relative;aspect-ratio:1;border:2px solid #d8e1dc;background:radial-gradient(#43405b,#12111e 76%);box-shadow:0 0 0 1px #3a2837,inset 0 0 0 2px #76777b}
.result-reward-tile img{display:block;width:100%;height:100%;padding:5px;object-fit:contain;filter:drop-shadow(0 2px 2px #0009)}
.result-reward-tile b{position:absolute;right:3px;bottom:1px;color:white;font-size:13px;font-weight:900;text-shadow:0 2px #222,1px 0 #222,-1px 0 #222}
.result-reward figcaption{font-size:10px;color:#fff3da;font-weight:700;line-height:1.25;margin:7px -6px 0;overflow-wrap:anywhere;text-shadow:0 1px 2px #520b21}
.result-progress{position:relative;width:100%;margin:0;z-index:1}
.result-card .result-progress p{font-size:12px;font-weight:800;line-height:1.5;color:#fff5e3;text-shadow:0 2px #581327;margin:0}
.result-card .result-progress p:first-child{padding:7px 15px;background:linear-gradient(90deg,transparent,#39081e68,transparent)}
.result-card .result-progress p+p{color:#cfff9a;font-size:11px;margin-top:9px}
.result-card .result-receipt{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.result-data{position:absolute;right:12px;top:10px;z-index:5;text-align:right}
.result-data summary{display:inline-flex;align-items:center;gap:5px;min-height:32px;padding:3px 11px;border:2px solid #ffe396;border-radius:4px;background:linear-gradient(#fff289 0 44%,#ffcd35 45%,#f0a800);box-shadow:0 3px #8a4a1a;color:#443718;font-size:11px;font-weight:900;list-style:none;cursor:pointer}
.result-data summary::-webkit-details-marker{display:none}.result-data summary svg{width:18px;height:18px;fill:none;stroke:#2495ba;stroke-width:2.2;stroke-linejoin:round}
.result-data .result-stats{position:absolute;top:100%;right:0;margin:10px 0 0;width:min(280px,calc(100vw - 40px));padding:16px;gap:14px;border:2px solid #d4b271;border-radius:5px;background:#272840f7;box-shadow:0 7px 20px #20081799;text-align:center}
.result-data .result-stats b{font-size:17px;font-weight:800;color:white}.result-data .result-stats span{font-size:8px;color:#d6d9e8}
.result-actions{display:flex;align-items:center;justify-content:center;padding:18px 14px 10px;gap:12px;min-height:0}
.result-card .result-continue{width:min(230px,64%);min-height:52px;height:52px;flex-shrink:0;margin:0;border:2px solid #d9f79f;border-radius:5px;background:linear-gradient(#dcff90 0 43%,#a3e726 44%,#7fb914);color:#354321;font-size:16px;font-weight:900;text-shadow:0 1px #efffc5;box-shadow:0 4px #416415,inset 0 0 0 2px #bdec5c}
.result-card #next-stage{width:88px;min-height:44px;height:44px;flex-shrink:0;margin:0;padding:0 10px;border:2px solid #ffe396;border-radius:5px;background:linear-gradient(#fff289 0 44%,#ffcd35 45%,#f0a800);color:#443718;font-size:12px;font-weight:900;box-shadow:0 3px #8a4a1a}
.result-card .result-next:disabled{opacity:.6;cursor:wait}
.result-card :is(button,summary):focus-visible{outline:3px solid #fff;outline-offset:4px}
.result-card [hidden]{display:none!important}
.result-confetti{position:absolute;inset:-45% 0 0;overflow:hidden;pointer-events:none;z-index:3}
.result-confetti i{position:absolute;top:-12px;left:8%;width:6px;height:11px;background:#ffa330;animation:result-confetti 2.6s ease-out both}
.result-confetti i:nth-child(2n){background:#97e5ff;width:10px;height:5px;animation-delay:.15s}
.result-confetti i:nth-child(3n){background:#ffeb96;animation-delay:.4s}
.result-confetti i:nth-child(2){left:17%}.result-confetti i:nth-child(3){left:26%}.result-confetti i:nth-child(4){left:34%}.result-confetti i:nth-child(5){left:42%}.result-confetti i:nth-child(6){left:51%}.result-confetti i:nth-child(7){left:60%}.result-confetti i:nth-child(8){left:69%}.result-confetti i:nth-child(9){left:78%}.result-confetti i:nth-child(10){left:87%}.result-confetti i:nth-child(11){left:94%}.result-confetti i:nth-child(12){left:4%}
@keyframes result-confetti{0%{transform:translate(0,0) rotate(0);opacity:0}8%{opacity:1}100%{transform:translate(22px,390px) rotate(400deg);opacity:0}}
body[data-screen=arena] .result-overlay.defeat .result-card{background:none;border:0}
.result-overlay.defeat .result-prize-panel{background:radial-gradient(ellipse at 50% 30%,#77719c55,transparent 75%),linear-gradient(145deg,#424761,#282b45);border-color:#adb9d8;box-shadow:0 -2px #48516d,0 2px #202638,inset 0 3px #e3e8f5,inset 0 -3px #636f8b}
.result-overlay.defeat .result-confetti{display:none}
.result-overlay.defeat .result-emblem::before{background:radial-gradient(ellipse,#adbbdf70,transparent 65%)}
.result-overlay.defeat .result-emblem h2{color:#f0f3ff;text-shadow:0 2px 1px #25213f,1px 0 2px #25213f,-1px 0 2px #25213f}
.result-overlay.defeat .result-progress{margin:auto 0;max-width:410px}
.result-overlay.defeat .result-progress p:first-child{padding:18px 16px;border-top:1px solid #bbc7e238;border-bottom:1px solid #bbc7e238;background:linear-gradient(90deg,transparent,#1b203e88,transparent);text-shadow:0 2px #20233c}
.result-overlay.defeat .result-progress p+p{margin-top:18px;color:#c3d0ed;text-shadow:0 2px #20233c}
@media(min-width:700px){.result-prize-panel{border-radius:3px}.result-card .result-stage{top:24px}.result-rewards{gap:20px}}
@media(max-height:740px){body[data-screen=arena] .result-card{grid-template-rows:29% 46% 25%}.result-emblem{width:260px;max-width:76%}.result-prize-panel{gap:12px;padding:40px 14px 16px}.result-reward{width:70px}.result-actions{gap:10px;padding:12px}.result-card .result-stage{top:12px;font-size:10px}.result-card .result-emblem h2{font-size:23px}}
@media(max-height:500px) and (orientation:landscape){body[data-screen=arena] .result-card{min-height:300px;grid-template-columns:230px minmax(0,1fr);grid-template-rows:1fr 96px;max-width:850px}.result-hero{grid-column:1;grid-row:1;align-items:center}.result-emblem{max-width:100%;transform:none}.result-prize-panel{grid-column:2;grid-row:1;padding:46px 12px 15px}.result-actions{grid-column:1/-1;grid-row:2}.result-reward{width:60px}.result-reward figcaption{font-size:9px}.result-progress p{font-size:10px!important}.result-card .result-stage{top:10px}}
@media(prefers-reduced-motion:reduce){.result-confetti{display:none}.result-card *{animation:none!important;transition:none!important}}
