/* Shared finishing layer. Card dimensions, framing and direction anchors stay native. */
body #battle .bigav{position:relative;overflow:hidden;flex-shrink:0;border:1px solid #baa47788;border-radius:5px;background:#162737}
body #battle .bigav .artclip{inset:0;border-radius:0}
body #battle .bigav .prof-ph{width:100%;height:100%;object-fit:cover}
body #battle .nick{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body #battle .hprow .heart{font-size:0;width:20px;height:20px;flex:0 0 20px;background:url('illustrated/health.webp') center/contain no-repeat}
body #battle .result{padding:20px;background:radial-gradient(ellipse at 50% 20%,#294760cc,transparent 65%),#081523ed;backdrop-filter:blur(9px);overflow:auto;max-width:none}
body #battle .res-title{width:min(660px,100%);padding:28px 30px;gap:12px;border:1px solid #a99b774f;border-radius:8px;background:linear-gradient(140deg,#20374bd9,#0e1d2bd9);box-shadow:0 24px 80px #0006;flex-shrink:0}
body #battle .res-title .big2,body.pc #battle .res-title .big2{margin:0;font:500 clamp(32px,3.6vw,46px)/1.2 var(--font-display);color:#f7e4b9;letter-spacing:0}
body #battle .res-title .sub,body.pc #battle .res-title .sub{max-width:490px;text-align:center;font:400 15px/1.6 var(--font-ui);color:#c9d7e0}
body #battle .res-title::before,body.pc #battle .res-title::before{display:none}
body #battle .res-emblem,body #battle .result.lose .res-emblem,body.pc #battle .res-emblem,body.pc #battle .result.lose .res-emblem{width:170px;height:170px;margin:0}
body #battle .res-tap{margin-top:10px;padding:13px 28px;border:1px solid #c4a7759c;border-radius:4px;background:linear-gradient(#536479,#273f53);font:600 15px var(--font-ui);letter-spacing:0;color:#f7e8c9;animation:none;opacity:1}
body #battle .result:focus-visible .res-tap{outline:2px solid #f4d99c;outline-offset:4px}
body #battle .res-xp,body.pc #battle .res-xp{width:min(900px,100%);max-width:900px;max-height:100%;overflow:auto;padding:28px;gap:22px;flex-shrink:0;border:1px solid #a99b775f;border-image:none;border-radius:8px;background:linear-gradient(135deg,#233a4e,#102233 75%);box-shadow:0 24px 80px #0007}
.result-heading p{margin:0 0 8px;color:#b7c8d5;font-size:15px;font-weight:600;letter-spacing:.12em;text-transform:uppercase}
.result-heading h2{margin:0;color:#f5e3bb;font:500 29px/1.3 var(--font-display)}
.result-columns{display:grid;grid-template-columns:minmax(170px,.8fr) minmax(0,1.6fr);gap:28px}
.result-columns h3{margin:0 0 16px;color:#c0cfda;font-size:15px;letter-spacing:.025em;font-weight:500}
.result-rewards{padding-right:24px;border-right:1px solid #96acba26}
body #battle .rewline{align-items:stretch;gap:16px;margin:0;text-align:left;font-size:15px;line-height:1.5}
body #battle .rewline>span{display:flex;align-items:center;gap:12px}
body #battle .rewline>span>img{width:38px;height:38px;object-fit:contain;flex:0 0 38px}
body #battle .rewline b{color:#f1d799;font-weight:600}
body #battle .xprows{gap:8px;margin:0}
body #battle .xprow,body.pc #battle .xprow{gap:12px;padding:7px 12px 7px 7px;border:1px solid #a3b8c322;border-radius:5px;background:#0c1e2b6e;min-width:0}
body #battle .xprow .fcard{width:43px;padding:2px;border-radius:4px;background:#9b8553}
body #battle .xprow .fcard .art{aspect-ratio:1;border-radius:2px}
body #battle .xprow .barwrap{min-width:0;flex:1}
.xp-card-label{display:flex;align-items:baseline;flex-wrap:wrap;justify-content:space-between;gap:2px 8px;margin-bottom:9px}
.xp-card-label strong{font-size:15px;font-weight:500;color:#e5eaf0;overflow-wrap:anywhere}
.xp-card-label>span{color:#aabecb;font-size:15px;white-space:nowrap}
body #battle .xpbar{height:5px;border:0;border-radius:3px;background:#050e19}
body #battle .xpbar .barfill{background:linear-gradient(90deg,#8c743e,#e6ca89)}
body #battle .xpbar.is-max .barfill{background:linear-gradient(90deg,#427964,#9ad3b7)}
body #battle .xpnum,body #battle .xpnum:has(.xp-level-up){min-width:56px;font-size:15px;text-align:right;color:#ead19a}
body #battle .xp-level-up{margin:3px 0 0;justify-content:flex-end;font-size:15px}
body #battle .res-xp>.bbtn{align-self:flex-end;min-width:200px;margin:0}
body:not(.pc) #battle .res-xp>.bbtn{border:1px solid #bda57788;border-radius:4px;background:linear-gradient(#426578,#254153);color:#f2e4c7;font:600 15px var(--font-ui)}

/* Existing modal actions still own saving, charging, granting and dismissing. */
body :is(#nicksheet,#savesheet,#seasonsheet,#eventsheet,#chestchoice,#resetmodal,#rshort){background:#071523d9;backdrop-filter:blur(8px);padding:24px}
body :is(#nicksheet,#savesheet,#seasonsheet,#eventsheet,#chestchoice)>.card,
body .rm-box,body .rshort-card{width:min(480px,100%);max-width:480px;max-height:calc(100% - 16px);overflow:auto;padding:30px;border:1px solid #ad9b6e88;border-radius:8px;background:radial-gradient(ellipse at 10% 0,#35526b66,transparent 70%),linear-gradient(135deg,#213549,#102334);box-shadow:0 24px 90px #0009;color:#d2dde5}
body :is(#nicksheet,#savesheet,#seasonsheet,#eventsheet,#chestchoice) h2,
body .rm-title,body .rshort-title{margin:0 0 14px;font:500 24px/1.35 var(--font-display);letter-spacing:0;color:#f0dfbb}
.dialog-emblem{display:block;width:64px;height:64px;object-fit:contain;margin:0 0 18px;filter:drop-shadow(0 4px 5px #0008)}
.dialog-label{display:block;font-size:15px;margin:20px 0 8px;color:#d2dce3}
body #nicksheet .nickin{width:100%;min-height:48px;background:#0b1c2b;border:1px solid #849baf77;border-radius:4px;padding:12px;font:500 17px var(--font-ui);color:#eff2ec}
.dialog-hint{font-size:15px;line-height:1.5;color:#aabfcd;margin:9px 0 24px}
.dialog-actions{display:flex;gap:12px}
body #seasonstatus{font:15px/1.5 var(--font-ui);color:#e6cc9c;padding:12px;margin:12px 0 16px;border:1px solid #b9a16c66;border-radius:4px;background:#0f2233}
body #seasonsheet[data-claim-state="busy"] #seasonstatus,body #seasonsheet[data-claim-state="saving"] #seasonstatus{color:#bacddd;border-color:#809ca866}
body :is(#nicksheet,#savesheet,#seasonsheet,#eventsheet,#chestchoice) :is(.actbtn,.x),
body .rm-acts button,body .rshort-actions button{flex:1;min-height:44px;margin:0;padding:12px 16px;border:1px solid #b5a07877;border-radius:4px;background:linear-gradient(#426578,#254153);color:#f2e4c7;font:600 15px/1.35 var(--font-ui);letter-spacing:0;box-shadow:0 3px 6px #0003;cursor:pointer}
body :is(#nicksheet,#savesheet,#seasonsheet,#eventsheet,#chestchoice) :is(.ghost),body .rm-acts .rm-cancel,body .rshort-actions .rshort-later{background:#102333;border-color:#7b97a95c;color:#c9d8e2}
body :is(#nicksheet,#savesheet,#seasonsheet,#eventsheet,#chestchoice,#resetmodal,#rshort) :is(button,input):focus-visible{outline:2px solid #efcd88;outline-offset:3px}
body #savesheet>.card{width:min(600px,100%);max-width:600px}
body #savesheet .svlist{margin:18px 0;max-height:min(52vh,440px)}
body #savesheet .svrec{padding:18px;background:#0c2131;border-radius:5px;border-color:#7b97a94f}
body #savesheet .svrec.now{border-color:#c1a36d80;opacity:1}
body #savesheet .svic img{display:block;width:28px;height:28px;object-fit:contain}
body #savesheet .svhead{flex-wrap:wrap;margin-bottom:8px}
body #savesheet .svnums>div{background:#071724;border-color:#71889b36;border-radius:3px;padding:10px 2px}
body #savesheet .svnums b{font-size:18px}
body #savesheet .svnums i{font-size:15px;opacity:1}
body #savesheet :is(.svdate,.svxp){font-size:15px;color:#afc3d0;opacity:1}
body #savesheet .svtag{font-size:15px;letter-spacing:0;white-space:normal}
body .rm-body p{font:400 15px/1.65 var(--font-ui);color:#c1d1dc}
body .rm-cost{padding:14px 0;color:#ecd29a!important;border-block:1px solid #9bafbb26}
body .rm-acts{gap:12px;margin-top:24px}
body .rshort-head{gap:18px;margin:0 0 20px;padding-right:25px}
body .rshort-title{font-size:23px;margin:0}
body .rshort-vial{width:56px;height:64px}
body .rshort-x{right:12px;top:12px;width:32px;height:32px;font-size:0;border-radius:3px;background:url('illustrated/close.webp') center/22px no-repeat}
body .rshort-x:hover{background:#ffffff0a url('illustrated/close.webp') center/22px no-repeat}
body .rshort-desc{font-size:15px;line-height:1.6;color:#b8ccda;margin:0 0 22px}
body .rshort-wait{background:#0b1d2c;border:1px solid #7f9bb43b;border-radius:4px;margin-bottom:22px;padding:16px;font-size:15px;color:#b8ccda}
body .rshort-time{font-size:22px;letter-spacing:.01em;color:#eedab0}
body .rshort-actions{gap:10px}
body :is(.notice,.pride-toast){position:fixed;z-index:600;left:50%;bottom:30px;max-width:min(520px,calc(100vw - 32px));width:max-content;padding:14px 20px;border:1px solid #b2986888;border-radius:5px;background:#142b3bf5;box-shadow:0 8px 28px #0007;font:500 15px/1.5 var(--font-ui);color:#f2e6ce;text-align:center;pointer-events:none;opacity:0;transform:translate(-50%,12px);transition:opacity .2s,transform .2s}
body .notice{border-color:#d5978288}
body :is(.notice,.pride-toast).on{opacity:1;transform:translate(-50%,0)}
body .pride-sync{position:fixed;inset:0;z-index:9999;display:grid;place-content:center;gap:24px;text-align:center;background:radial-gradient(ellipse at 50% 30%,#243e54,#091726 70%);color:#eedfbd;font:500 16px var(--font-ui)}
body .pride-sync::before{content:'';display:block;width:90px;height:90px;margin:auto;background:url('illustrated/crest-loaded.webp') center/contain no-repeat}
body .guide-card{background:linear-gradient(135deg,#233b50fa,#102334fc);border-color:#b59e737f;border-radius:6px;box-shadow:0 12px 35px #0009}
body .guide-title{color:#f1dfb9;font-family:var(--font-display);letter-spacing:0}
body .guide-text{color:#c9d8e1;line-height:1.6}
body .guide-btn,body .work-skip{background:#193346;border:1px solid #9dafb562;border-radius:4px;color:#e5dfcf;font-family:var(--font-ui)}
body #cardview{background:#061320d9;backdrop-filter:blur(8px)}
body #cardview .cv-card{background:linear-gradient(135deg,#233a4f,#102334);border-color:#aa976877}
body #cardview .cv-back{font-size:0;background:#11283b url('illustrated/close.webp') center/20px no-repeat;border-color:#9aafbd55}

/* The chest keeps its reveal sequence and its generated art, with the game's own stage. */
body #chestshow,body #chestshow.reveal{background:radial-gradient(ellipse at 50% 32%,#29425b,#061321 75%)}
body #chestshow .cs-backdrop{background:radial-gradient(ellipse at 50% 50%,#233b50,transparent 75%)}
body #chestshow .cs-vignette{background:radial-gradient(ellipse,transparent 30%,#030c1677)}
body #chestshow .cs-tier{font:500 clamp(20px,2vw,28px)/1.35 var(--font-display);letter-spacing:0;white-space:nowrap;color:#efd9ab}
body #chestshow .cs-kicker{top:calc(65px + env(safe-area-inset-top,0px));font:400 15px/1.5 var(--font-ui);letter-spacing:0;color:#c1d3df}
body #chestshow .cs-title{font:500 19px var(--font-display);color:#eddbb4;letter-spacing:0}
body #chestshow .cs-chip{background:#10283d;border-color:#af9d6b66;border-radius:5px;color:#e0e8ec}
body #chestshow .cs-btn{padding:14px 28px;min-height:46px;border:1px solid #d2b87888;border-radius:4px;background:linear-gradient(#426479,#213b50);font:600 15px var(--font-ui);color:#f5e5bf;letter-spacing:0}
body #chestshow .cs-hint{font:400 15px var(--font-ui);color:#b4c9d8}
body #chestshow .ps-seat::before{content:'';display:block;width:100%;height:100%;background:url('illustrated/potential.webp') center/contain no-repeat;filter:grayscale(1) brightness(.55)}
body #chestshow .ps-seat.is-lit::before{filter:drop-shadow(0 0 5px #ecc77577)}
@media(max-width:700px){
 body #battle .result{padding:12px}
 body #battle .res-title{padding:24px 18px}
 body #battle .res-emblem,body #battle .result.lose .res-emblem,body.pc #battle .res-emblem,body.pc #battle .result.lose .res-emblem{width:140px;height:140px}
 body #battle .res-xp,body.pc #battle .res-xp{padding:20px 16px;gap:18px}
 .result-heading h2{font-size:25px}
 .result-columns{grid-template-columns:minmax(0,1fr);gap:20px}
 .result-columns h3{margin-bottom:10px}
 .result-rewards{padding:0 0 16px;border-right:0;border-bottom:1px solid #96acba26}
 body #battle .rewline{flex-direction:row;flex-wrap:wrap;gap:12px 18px;font-size:15px}
 body #battle .rewline>span{gap:7px}
 body #battle .rewline>span>img{width:28px;height:28px;flex-basis:28px}
 body #battle .xprow,body.pc #battle .xprow{gap:8px;padding:6px}
 .xp-card-label strong{font-size:15px}
 body #battle .res-xp>.bbtn{align-self:stretch}
 body :is(#nicksheet,#savesheet,#seasonsheet,#eventsheet,#chestchoice,#resetmodal,#rshort){padding:14px}
 body :is(#nicksheet,#savesheet,#seasonsheet,#eventsheet,#chestchoice)>.card,body .rm-box,body .rshort-card{padding:24px 20px}
 body :is(.notice,.pride-toast){bottom:88px;font-size:15px}
}
@media(max-height:600px){
 body #battle .res-title{padding:16px;gap:6px}
 body #battle .res-emblem,body #battle .result.lose .res-emblem,body.pc #battle .res-emblem,body.pc #battle .result.lose .res-emblem{width:90px;height:90px}
 body #battle .res-title .big2,body.pc #battle .res-title .big2{font-size:28px}
 body #battle .res-title .sub,body.pc #battle .res-title .sub{font-size:15px}
 body #battle .res-tap{padding:10px 20px;margin:3px 0 0}
 body #battle .res-xp,body.pc #battle .res-xp{padding:18px;gap:14px}
 .result-heading h2{font-size:23px}
 body #battle .xprow,body.pc #battle .xprow{padding:4px 8px}
 body #battle .xprow .fcard{width:34px}
}
@media(prefers-reduced-motion:reduce){body :is(.notice,.pride-toast){transition:none}}
