.card-detail-sheet{box-sizing:border-box;width:min(354px,calc(100vw - 24px));max-height:calc(100dvh - 24px);padding:18px;color:#f5f6ff;border:1px solid var(--detail-color);border-radius:18px;background:linear-gradient(145deg,#1c2335,#111427 70%);overflow:auto;font-family:system-ui,sans-serif;box-shadow:0 18px 60px #000a}
.card-detail-sheet::backdrop{background:#030712c9}
.card-detail-sheet *{box-sizing:border-box}
.card-detail-sheet h2,.card-detail-sheet h3,.card-detail-sheet p{margin:0}
.card-detail-sheet button{font:inherit;cursor:pointer}
.card-detail-sheet button:disabled{opacity:.5;cursor:default}
.card-detail-sheet .detail-close{position:absolute;right:8px;top:8px;width:30px;height:30px;border:0;border-radius:50%;background:#ffffff12;color:#fff;font-size:24px}
.detail-head{display:flex;align-items:center;gap:10px;padding-right:12px;margin-bottom:14px}
.detail-head>div{flex:1;min-width:0}.detail-head h2{font-size:23px;line-height:1.1;overflow-wrap:anywhere}
.detail-head b,.detail-head small{display:block;font-size:10px;margin-top:3px}.detail-head b{color:#78baff}.detail-head small{color:var(--detail-color)}
.detail-avatar{width:60px;height:60px;border:1px solid var(--detail-color);border-radius:12px;image-rendering:pixelated}
.detail-sprite{width:50px;height:50px;image-rendering:pixelated}
.detail-skill{padding:10px 12px;border:1px solid #ffffff16;border-radius:11px;background:#ffffff05}
.detail-skill-title{display:flex;align-items:center;gap:9px;margin-bottom:5px}
.detail-skill-title>span{width:30px;height:30px;flex:none}.detail-skill-title svg{width:100%;height:100%}
.card-detail-sheet h3{font-size:11px;font-weight:800}.detail-skill h3{font-size:13px;color:var(--detail-color)}
.card-detail-sheet p{font-size:11px;line-height:1.45}
.detail-behavior{padding:9px 2px}.detail-behavior h3{color:#c5cedf;margin-bottom:3px}.detail-behavior p{color:#adb9ce;font-size:10px}
.detail-attributes{margin:5px 0 12px}.detail-section-title{display:flex;justify-content:space-between;margin-bottom:7px}
.detail-section-title small{font-size:9px;color:#8c9ab3}
.detail-stat{display:grid;grid-template-columns:80px 1fr 26px 24px;gap:7px;align-items:center;margin:5px 0;font-size:11px}
.detail-stat>i{height:5px;border-radius:4px;background:#ffffff0c;overflow:hidden}.detail-stat>i>i{display:block;height:100%;border-radius:4px}
.detail-stat b{text-align:right;font-variant-numeric:tabular-nums}.detail-stat small{text-align:right;color:#b5f56b;font-size:10px}
.detail-upgrade{display:grid;grid-template-columns:1fr auto;gap:5px 10px;padding:10px 0;border-top:1px solid #ffffff18;border-bottom:1px solid #ffffff18}
.detail-progress{display:flex;align-items:center;gap:9px}.detail-progress>b{font-size:13px;white-space:nowrap;color:var(--detail-color)}
.detail-progress>div{flex:1;min-width:0}.detail-progress progress{width:100%;height:6px;display:block;accent-color:#b5f56b}
.detail-progress small,.detail-wallet{display:block;font-size:9px;color:#b6c3d7;margin-top:3px}.detail-wallet{grid-column:1/-1;text-align:right}
.detail-upgrade-button{min-height:40px;padding:7px 10px;border:1px solid #a1cb74;border-radius:8px;color:#e8ffcf;background:#294531;font-size:11px!important;font-weight:800!important}
.detail-lineup{padding-top:10px}.detail-lineup h3{margin-bottom:6px;color:#b5f56b}
.detail-lineup button{width:100%;min-height:40px;display:flex;justify-content:space-between;align-items:center;gap:5px;padding:8px 10px;margin-top:5px;border:1px solid #405c57;border-radius:8px;background:#1a302e;color:#fff;font-size:11px}
.detail-lineup small{font-size:9px;white-space:nowrap;color:#b4c7c1}
.card-detail-sheet .detail-demo{font-size:9px;text-align:center;color:#8794aa;margin-top:9px}
.card-detail-sheet .detail-status{font-size:10px;color:#b5f56b;margin-top:5px}.detail-status:empty{display:none}
@media(prefers-reduced-motion:no-preference){.card-detail-sheet[open]{animation:detail-in .16s ease-out}@keyframes detail-in{from{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:none}}}
/* Card-back treatment: the original card's lower artwork, with native portrait retained. */
.card-detail-sheet{
 position:fixed;inset:0;margin:auto;height:fit-content;transform:none;
 width:min(362px,calc(100vw - 24px));max-height:calc(100dvh - 24px);
 padding:21px 20px 15px;border:3px solid var(--detail-color);border-radius:12px;
 background-image:linear-gradient(90deg,#070d1b55,#070d1b99 35%,#070d1b99 65%,#070d1b55),var(--detail-art);
 background-size:100% 100%,125% 400%;background-position:center,center 90%;background-repeat:no-repeat;
 box-shadow:inset 0 0 0 2px #050914,inset 0 0 0 4px color-mix(in srgb,var(--detail-color) 45%,transparent),0 0 24px color-mix(in srgb,var(--detail-color) 20%,transparent),0 20px 65px #000c;
}
.card-detail-sheet .detail-head{padding:0 18px 12px 0;margin-bottom:11px;border-bottom:1px solid color-mix(in srgb,var(--detail-color) 40%,transparent)}
.card-detail-sheet .detail-head h2{text-shadow:0 2px 0 #000;font-weight:900}
.card-detail-sheet .detail-avatar{border:2px solid var(--detail-color);background:#080d1c;box-shadow:0 0 0 2px #030610,0 0 12px color-mix(in srgb,var(--detail-color) 20%,transparent)}
.card-detail-sheet .detail-skill{background:linear-gradient(120deg,color-mix(in srgb,var(--detail-color) 14%,#090d20),#090d20d9);border:1px solid color-mix(in srgb,var(--detail-color) 55%,transparent);box-shadow:inset 0 1px #ffffff15,0 3px 0 #0004}
.card-detail-sheet .detail-skill-title>span{width:36px;height:36px;filter:drop-shadow(0 0 6px color-mix(in srgb,var(--detail-color) 35%,transparent))}
.card-detail-sheet .detail-skill h3{letter-spacing:.4px;text-shadow:0 1px #000}
.card-detail-sheet .detail-behavior{padding:9px 3px}
.card-detail-sheet .detail-attributes{padding:10px 10px 8px;background:#070d1bd9;border:1px solid #ffffff18;border-radius:8px;margin:0 0 10px}
.card-detail-sheet .detail-stat{grid-template-columns:77px 1fr 25px 21px;gap:6px}
.card-detail-sheet .detail-stat>i{height:6px;box-shadow:inset 0 1px 2px #0008}
.card-detail-sheet .detail-stat>i>i{box-shadow:inset 0 1px #ffffff50}
.card-detail-sheet .detail-progress>.detail-level-medal{position:relative;display:flex;align-items:center;justify-content:center;isolation:isolate;flex:none;width:38px;height:43px;padding:10px 0 0;background:var(--detail-color);color:#fff;font-size:21px;font-weight:900;clip-path:polygon(50% 0,100% 23%,100% 75%,50% 100%,0 75%,0 23%)}
.card-detail-sheet .detail-level-medal:before{content:'';position:absolute;inset:2px;background:linear-gradient(#263849,#0c1824);clip-path:inherit;z-index:-1}
.card-detail-sheet .detail-level-medal small{position:absolute;top:5px;margin:0;color:var(--detail-color);font-size:8px;line-height:1}
.card-detail-sheet .detail-upgrade{border-color:color-mix(in srgb,var(--detail-color) 35%,transparent)}
.card-detail-sheet .detail-upgrade-button{background:linear-gradient(#486332,#263e23);border-color:#b1db7e;box-shadow:inset 0 1px #eaffb54a,0 3px 0 #102216;text-shadow:0 1px #000}
.card-detail-sheet .detail-lineup button{background:linear-gradient(#203c3b,#142828);box-shadow:inset 0 1px #ffffff12,0 2px 0 #030b0b}
@media(prefers-reduced-motion:no-preference){.card-detail-sheet[open]{animation:detail-reveal .16s ease-out}@keyframes detail-reveal{from{opacity:0}to{opacity:1}}}

#player-modal{box-sizing:border-box}
#player-modal>.card-detail-sheet{position:relative!important;inset:auto!important;margin:auto!important;box-sizing:border-box!important;width:min(362px,100%)!important;max-width:362px!important;max-height:calc(100dvh - 28px)!important;padding:21px 20px 15px!important;display:block!important;gap:0!important;border:3px solid var(--detail-color)!important;border-radius:12px!important;background-color:#101226!important;background-image:linear-gradient(90deg,#070d1b55,#070d1b99 35%,#070d1b99 65%,#070d1b55),var(--detail-art)!important;background-size:100% 100%,125% 400%!important;background-position:center,center 90%!important;background-repeat:no-repeat!important}
.card-detail-sheet .upgrade-control{display:grid;grid-template-columns:1fr auto;gap:7px 10px;margin:0;padding:10px 0;border-block:1px solid #ffffff25}
.card-detail-sheet .upgrade-control .card-progress{grid-column:1;min-width:0}
.card-detail-sheet .upgrade-control>span{grid-column:2;grid-row:2;font-size:10px;justify-self:end}
.card-detail-sheet .upgrade-control>button{grid-column:2;grid-row:1;min-height:42px;font-size:11px;padding:7px 9px;background:linear-gradient(#486332,#263e23);box-shadow:inset 0 1px #eaffb54a,0 3px 0 #102216}
.card-detail-sheet .upgrade-control .juice-card-top,.card-detail-sheet .upgrade-control .juice-card-shine{display:none}
.card-detail-sheet .card-level{width:38px;height:43px;font-size:21px;padding-top:10px}
.card-detail-sheet .card-level small{top:5px;font-size:8px}
.card-detail-sheet .detail-lineup{display:grid!important;gap:6px!important;padding-top:10px!important;border:0!important}
#roster-view .collection-card.illustrated-collection{width:100%!important;height:auto!important;min-height:0!important;padding:0!important;border:0!important;border-radius:8px!important;background:transparent!important;display:block!important;gap:0!important;box-shadow:none!important}
.illustrated-face{position:relative;aspect-ratio:134/288;overflow:hidden;border-radius:8px;container-type:inline-size}
.illustrated-face>img{display:block;width:100%;height:100%;transform-origin:top;transform:scaleY(var(--art-scale,1));pointer-events:none;image-rendering:pixelated}
.illustrated-role,.illustrated-level{position:absolute;top:4%;padding:3px 4px;background:#09131dee;border:1px solid #ffffff55;border-radius:4px;color:#fff;font-size:8cqw;font-weight:800}
.illustrated-role{left:9%}.illustrated-level{right:9%}
.illustrated-special{position:absolute;top:65%;left:12%;right:12%;display:flex;align-items:center;justify-content:center;gap:3cqw;font-size:7.2cqw;line-height:1.15;font-weight:800;color:var(--art-color);min-height:12cqw;text-align:center}
.illustrated-special svg{width:12cqw;height:12cqw;flex:none}
#roster-view .illustrated-face .mini-stats{position:absolute;top:75%;left:13%;right:13%;width:auto;gap:2.5cqw 2cqw}
#roster-view .illustrated-face .mini-stats span{font-size:11cqw;line-height:1.05}
#roster-view .illustrated-face .mini-stats i{font-size:6.2cqw;line-height:1.2;margin-bottom:1cqw}
.illustrated-collection>.card-progress{margin:5px 4px 0;width:calc(100% - 8px)}
.illustrated-collection>.card-progress>.card-level{display:none}
.illustrated-collection>.card-progress .card-copy-count{font-size:9px;text-align:center}
.illustrated-collection>.collection-status{text-align:center;margin-top:3px}

#player-modal .detail-head>div:first-child{flex:0 0 64px!important;width:64px!important;height:64px!important}

/* Keep the original legendary sweep over the artwork, above the copy counter. */
.illustrated-collection>.juice-card-shine{bottom:auto;width:100%;aspect-ratio:134/288}

/* Nine-slice the actual illustrated frame: every card keeps its own ornamentation. */
#player-modal>.card-detail-sheet{
 border:12px solid transparent!important;
 border-image-source:var(--detail-art)!important;
 border-image-slice:12 6 12 6!important;
 border-image-width:12px!important;
 border-image-repeat:stretch!important;
 /* The source art has a dark outer margin: clip it after nine-slice scaling. */
 clip-path:polygon(12px 2px,calc(100% - 12px) 2px,calc(100% - 4px) 10px,calc(100% - 4px) calc(100% - 10px),calc(100% - 12px) calc(100% - 2px),12px calc(100% - 2px),4px calc(100% - 10px),4px 10px);
 border-radius:0!important;
 padding:16px 12px 12px!important;
 background-image:linear-gradient(90deg,#070d1b88,#070d1baa 35%,#070d1baa 65%,#070d1b88),var(--detail-art)!important;
 background-size:100% 100%,125% 400%!important;
 background-position:center,center 90%!important;
 background-clip:padding-box!important;
 /* Old inset strokes formed a rectangle across the illustrated frame. */
 box-shadow:0 20px 65px #0009!important;
 overflow-x:hidden;
}
.card-opening-front{backface-visibility:hidden;will-change:transform;box-shadow:0 20px 65px #0009}
.card-opening-front .mini-stats{position:absolute;top:75%;left:13%;right:13%;width:auto;gap:2.5cqw 2cqw}
.card-opening-front .mini-stats span{font-size:11cqw;line-height:1.05}
.card-opening-front .mini-stats i{font-size:6.2cqw;line-height:1.2;margin-bottom:1cqw}

/* Locked cards remain readable while their art and rarity colors are muted. */
#player-modal.card-is-locked>.card-detail-sheet,#player-modal.card-is-locked>.card-opening-front{filter:grayscale(.85)}

/* Approved individual reverse artwork; original front supplies the frame. */
#player-modal>.card-detail-sheet{
 background-image:var(--back-art)!important;
 background-size:100% 100%!important;
 background-position:center!important;
 background-origin:padding-box!important;
}
#player-modal .card-detail-sheet :is(.detail-head,.detail-skill,.detail-behavior,.detail-attributes,.upgrade-control,.detail-lineup){
 background:linear-gradient(135deg,rgba(5,13,32,.96),rgba(8,22,46,.93));
 border:1px solid #688eb34d;border-radius:9px;padding:12px;
 box-shadow:0 3px 10px #0005,inset 0 1px #ffffff08;margin-bottom:10px;
}
#player-modal .card-detail-sheet .detail-behavior p{color:#e5edf7}
