/* Results + Upgrade Camp (design 08) — portrait 941x1672, separate landscape 1672x941 */
.results { overflow: hidden; background: var(--surface) url(../assets/ui/paper_bg.webp) center/cover; }
.results > * { position: absolute; }
.res-frame { inset: 0; pointer-events: none; z-index: 5;
  box-shadow: inset 0 0 0 10px var(--frame-dark), inset 0 0 0 13px var(--accent), inset 0 0 0 16px var(--bronze-dark), inset 0 0 0 22px var(--frame-dark); }
.res-frame::before, .res-frame::after { content: ''; position: absolute; width: 40px; height: 40px; top: 6px; left: 6px; background: var(--secondary); transform: rotate(45deg); box-shadow: 0 0 0 4px var(--accent), 0 0 0 7px var(--frame-dark); }
.res-frame::after { left: auto; right: 6px; }

.res-head { left: 203px; top: 22px; width: 535px; height: 78px; font-size: 42px; z-index: 6; }

/* illustration */
.res-art { left: 24px; top: 268px; width: 893px; height: 434px; }
.res-art img { position: absolute; display: block; }
.res-bridge { right: 0; top: 52px; width: 445px; height: 380px; object-fit: cover; }
.res-hero { left: 0; top: 30px; width: 446px; height: 404px; object-fit: cover;
  -webkit-mask-image: linear-gradient(90deg, #000 82%, transparent); mask-image: linear-gradient(90deg, #000 82%, transparent); }
.res-defeat .res-hero { filter: grayscale(.85) sepia(.35) brightness(.85); transform: rotate(-4deg) translateY(16px); }
.res-defeat .res-bridge { filter: grayscale(.6) sepia(.3); }
.res-defeat .res-bridge { left: 0; right: auto; width: 893px; top: 40px; height: 394px; filter: grayscale(.55) sepia(.3); -webkit-mask-image: linear-gradient(180deg, transparent, #000 14%, #000 88%, transparent); mask-image: linear-gradient(180deg, transparent, #000 14%, #000 88%, transparent); }
.res-rival { left: 90px; bottom: 0; height: 400px; filter: drop-shadow(0 10px 8px rgba(37, 34, 31, .45)); }
.res-fall { right: 190px; top: 150px; height: 200px; transform: rotate(-62deg); filter: grayscale(.35) drop-shadow(0 6px 6px rgba(37, 34, 31, .4)); animation: resfall 2.4s ease-in-out infinite alternate; }
.res-dust { right: 110px; top: 250px; width: 270px; opacity: .85; }
@keyframes resfall { to { transform: rotate(-78deg) translate(-10px, 14px); } }
#stage.land .res-defeat .res-bridge { width: 780px; height: 380px; }
#stage.land .res-rival { height: 360px; left: 60px; }
.res-draw .res-hero, .res-draw .res-bridge { filter: saturate(.55) sepia(.2); }

/* stamp */
.res-stamp { left: 170px; top: 113px; width: 597px; height: 143px; z-index: 3; display: flex; align-items: center; justify-content: center;
  color: var(--danger); transform: rotate(-2deg); border: 9px solid currentColor; outline: 3px solid currentColor; outline-offset: -20px; background: rgba(253, 243, 232, .35); }
.res-stamp span { font: 400 112px/1 var(--f-stamp); letter-spacing: .005em; text-transform: uppercase; white-space: nowrap; }
.res-stamp::after { content: ''; position: absolute; inset: -9px; pointer-events: none; opacity: .62; /* worn ink speckles */
  background: radial-gradient(circle at 12% 30%, var(--surface) 0 5px, transparent 6px), radial-gradient(circle at 37% 82%, var(--surface) 0 7px, transparent 8px),
    radial-gradient(circle at 63% 14%, var(--surface) 0 4px, transparent 5px), radial-gradient(circle at 81% 70%, var(--surface) 0 6px, transparent 7px),
    radial-gradient(circle at 93% 22%, var(--surface) 0 3px, transparent 4px), radial-gradient(circle at 24% 64%, var(--surface) 0 2px, transparent 3px),
    repeating-linear-gradient(103deg, transparent 0 19px, rgba(231, 198, 159, .5) 19px 21px, transparent 21px 47px); }
.res-defeat .res-stamp { color: var(--primary-dark); }
.res-draw .res-stamp { color: var(--text-muted); }
.res-reason { left: 40px; right: 40px; top: 262px; margin: 0; z-index: 3; text-align: center; font: 900 40px/1.1 var(--f-sans); color: var(--frame-dark); text-shadow: 0 0 6px var(--bg), 0 0 2px var(--bg); }
.res-arena { left: 40px; right: 40px; top: 312px; margin: 0; z-index: 3; text-align: center; font: 800 24px/1 var(--f-sans); color: var(--text); text-shadow: 0 0 4px var(--bg); }

/* score bar */
.res-score { left: 8px; top: 700px; width: 925px; height: 119px; z-index: 4; display: flex; align-items: stretch; }
.rs-half { flex: 1; display: flex; align-items: center; justify-content: center; gap: 20px; color: var(--light-text); padding: 0 26px;
  box-shadow: inset 0 0 0 4px var(--accent), inset 0 0 0 7px var(--bronze-dark), var(--shadow); }
.rs-you { background: var(--primary); clip-path: polygon(22px 0, 100% 0, 100% 100%, 22px 100%, 0 50%); }
.rs-riv { background: var(--secondary); clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 50%, calc(100% - 22px) 100%, 0 100%); }
.rs-emb { width: 80px; height: 70px; object-fit: contain; }
.rs-lbl { font: 900 34px/1 var(--f-sans); text-transform: uppercase; }
.rs-sep { width: 3px; height: 62px; background: var(--accent); opacity: .8; }
.rs-num { font: 900 96px/1 var(--f-slab); letter-spacing: -.02em; }
.rs-vs { flex: none; align-self: center; width: 94px; height: 86px; margin: 0 -14px; z-index: 1; display: flex; align-items: center; justify-content: center;
  font: 900 34px/1 var(--f-slab); color: var(--accent); background: var(--frame-dark); box-shadow: inset 0 0 0 4px var(--accent);
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); }

/* rewards */
.res-rwhead { left: 215px; top: 832px; width: 510px; height: 61px; font-size: 38px; z-index: 2; }
.res-rw { left: 40px; top: 870px; width: 861px; height: 240px; display: flex; align-items: center; padding-top: 18px; box-sizing: border-box; }
.rw-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 10px; border-inline-start: 2px solid var(--text); }
.rw-col:first-child { border-inline-start: 0; }
.rw-ic { width: 150px; height: 120px; object-fit: contain; mix-blend-mode: multiply; }
.rw-lbl { font: 800 34px/1 var(--f-sans); color: var(--frame-dark); white-space: nowrap; }
.rw-note { flex: 1; margin: 0; text-align: center; font: 800 32px/1.2 var(--f-sans); color: var(--text-muted); padding: 0 40px; }

/* upgrade camp */
.res-uphead { left: 47px; top: 1128px; width: 846px; height: 59px; font-size: 36px; justify-content: flex-start; z-index: 2; }
.uh-title { flex: 1; text-align: start; }
.uh-bal { display: flex; align-items: center; gap: 10px; font: 800 28px/1 var(--f-sans); text-transform: none; }
.uh-coin { width: 40px; height: 40px; }
.res-up { left: 40px; top: 1168px; width: 861px; height: 284px; padding: 22px 30px 10px; box-sizing: border-box; }
.up-row { display: flex; align-items: center; gap: 22px; height: 124px; }
.up-row + .up-row { border-top: 2px solid var(--text); }
.up-ic { width: 112px; height: 112px; object-fit: contain; mix-blend-mode: multiply; }
.up-sep { width: 2px; height: 70px; background: var(--text); }
.up-txt { flex: 1; display: flex; flex-direction: column; gap: 6px; color: var(--frame-dark); }
.up-txt b { font: 900 36px/1.05 var(--f-sans); }
.up-txt span { font: 800 29px/1 var(--f-sans); }
.up-buy { width: 244px; height: 73px; font: 900 34px/1 var(--f-sans); text-transform: none; flex: none; }
.up-err { position: absolute; left: 0; right: 0; bottom: -2px; margin: 0; text-align: center; font: 800 24px/1 var(--f-sans); color: var(--danger); }

/* CTAs */
.res-again { left: 63px; top: 1466px; width: 566px; height: 121px; font: 900 60px/1.04 var(--f-sans); letter-spacing: .02em; }
.res-home { left: 648px; top: 1476px; width: 229px; height: 102px; font: 900 40px/1 var(--f-sans); }
.gem-dot { width: 16px; height: 16px; background: var(--primary-bright); transform: rotate(45deg); box-shadow: 0 0 0 3px var(--accent); }
.res-again, .res-home { z-index: 6; }

/* ---------- landscape 1672x941 ---------- */
#stage.land .res-head { left: 160px; top: 22px; width: 520px; height: 70px; font-size: 38px; }
#stage.land .res-stamp { left: 150px; top: 110px; width: 540px; height: 132px; }
#stage.land .res-stamp span { font-size: 100px; }
#stage.land .res-reason { left: 40px; right: auto; width: 760px; top: 256px; font-size: 36px; }
#stage.land .res-arena { left: 40px; right: auto; width: 760px; top: 302px; }
#stage.land .res-art { left: 30px; top: 300px; width: 780px; height: 420px; }
#stage.land .res-hero { width: 420px; height: 390px; }
#stage.land .res-bridge { width: 400px; height: 360px; }
#stage.land .res-score { left: 30px; top: 760px; width: 780px; height: 112px; }
#stage.land .rs-num { font-size: 84px; }
#stage.land .rs-emb { width: 64px; }
#stage.land .res-rwhead { left: 1000px; top: 32px; width: 480px; height: 58px; font-size: 34px; }
#stage.land .res-rw { left: 850px; top: 66px; width: 780px; height: 228px; }
#stage.land .res-uphead { left: 856px; top: 318px; width: 768px; height: 56px; font-size: 32px; }
#stage.land .res-up { left: 850px; top: 354px; width: 780px; height: 284px; }
#stage.land .res-again { left: 860px; top: 676px; width: 500px; height: 118px; font-size: 54px; }
#stage.land .res-home { left: 1386px; top: 684px; width: 236px; height: 102px; }

/* fixes: trim baked-in caption remnants from the cut art, plate sizing, soft icon edges, RTL arrows */
.results .plate { box-sizing: border-box; }
.res-hero { clip-path: inset(30px 0 0 0); -webkit-mask-image: linear-gradient(90deg, #000 78%, transparent), linear-gradient(180deg, transparent 6%, #000 16%, #000 88%, transparent); -webkit-mask-composite: source-in; mask-image: linear-gradient(90deg, #000 78%, transparent), linear-gradient(180deg, transparent 6%, #000 16%, #000 88%, transparent); mask-composite: intersect; }
.res-bridge { -webkit-mask-image: linear-gradient(270deg, #000 80%, transparent), linear-gradient(180deg, transparent 4%, #000 14%, #000 90%, transparent); -webkit-mask-composite: source-in; mask-image: linear-gradient(270deg, #000 80%, transparent), linear-gradient(180deg, transparent 4%, #000 14%, #000 90%, transparent); mask-composite: intersect; }
.res-bridge { clip-path: inset(10px 0 0 0); }
.rw-ic, .up-ic { -webkit-mask-image: radial-gradient(closest-side, #000 72%, transparent); mask-image: radial-gradient(closest-side, #000 72%, transparent); }
:root[dir=rtl] .rs-you { clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 50%, calc(100% - 22px) 100%, 0 100%); }
:root[dir=rtl] .rs-riv { clip-path: polygon(22px 0, 100% 0, 100% 100%, 22px 100%, 0 50%); }
#stage.land .res-art { top: 330px; height: 410px; }
#stage.land .res-score { top: 768px; }
#stage.land .res-rwhead { top: 40px; }
#stage.land .res-rw { top: 76px; height: 250px; }
#stage.land .res-uphead { top: 356px; }
#stage.land .res-up { top: 392px; }
#stage.land .res-again { top: 724px; }
#stage.land .res-home { top: 732px; }

/* Cup duel ribbon (round + outcome) */
.res-cup { position: absolute; inset-inline-end: 34px; top: 96px; z-index: 4; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 210px; padding: 12px 18px 16px; box-sizing: border-box;
  background: var(--frame-dark); color: var(--light-text); box-shadow: inset 0 0 0 4px var(--accent), inset 0 0 0 7px var(--bronze-dark);
  clip-path: polygon(0 0, 100% 0, 100% 86%, 50% 100%, 0 86%); }
.res-cup svg { width: 46px; height: 42px; color: var(--accent); }
.res-cup .rc-r { font: 800 22px/1.1 var(--f-sans); text-transform: uppercase; letter-spacing: .04em; opacity: .9; }
.res-cup .rc-o { font: 400 30px/1.05 var(--f-stamp); text-transform: uppercase; text-align: center; max-width: 230px; }
.res-cup.cup-advanced { background: var(--primary); }
.res-cup.cup-champion { background: var(--gold); color: var(--text); }
.res-cup.cup-champion svg { color: var(--secondary); }
.res-cup.cup-replay { background: var(--surface); color: var(--text); }
.res-cup.cup-replay svg { color: var(--bronze-dark); }
#stage.land .res-cup { inset-inline-end: 24px; top: 90px; }
.res-art:has(.res-cup) .res-fall { right: 300px; top: 190px; }
#stage.land .res-art:has(.res-cup) .res-fall { right: 280px; }
