/* Shared metalwork, distinct quality; selection and availability are separate layers. */
body[data-phase="prep"] :is(#offers,#shopOffers) :is(.upgradeCard,.shopCard){--quality:#b9c9b7;--quality-rgb:185,201,183;isolation:isolate;perspective:700px}
body[data-phase="prep"] :is(#offers,#shopOffers) .epic{--quality:#c7a4db;--quality-rgb:199,164,219}
body[data-phase="prep"] :is(#offers,#shopOffers) .ultimate{--quality:#e8cb73;--quality-rgb:232,203,115}
body[data-phase="prep"] :is(#offers,#shopOffers) :is(.upgradeCard,.shopCard){border-color:var(--quality)!important;background:linear-gradient(135deg,rgba(var(--quality-rgb),.075),transparent 65%),#242d26!important;box-shadow:inset 0 0 0 2px #17201b!important;transition:box-shadow .12s,filter .12s}
body[data-phase="prep"] :is(#offers,#shopOffers) .epic{box-shadow:inset 0 0 0 2px #17201b,inset 0 0 0 3px #c7a4db36!important;background:linear-gradient(135deg,#c7a4db14,transparent 65%),#262a2b!important}
body[data-phase="prep"] :is(#offers,#shopOffers) .ultimate{box-shadow:inset 0 0 0 2px #17201b,inset 0 0 0 3px #e8cb7340!important;background:linear-gradient(135deg,#e8cb731b,transparent 65%),#2c2d24!important}
body[data-phase="prep"] :is(#offers,#shopOffers) :is(.upgradeCard,.shopCard):hover{background:linear-gradient(135deg,rgba(var(--quality-rgb),.13),transparent 65%),#2b332c!important;border-color:var(--quality)!important;filter:brightness(1.06)}
body[data-phase="prep"] :is(#offers,#shopOffers) :is(.upgradeCard,.shopCard).selected{outline:0!important;border-color:var(--quality)!important;background:linear-gradient(135deg,rgba(var(--quality-rgb),.12),transparent 65%),#30382f!important;box-shadow:inset 0 0 0 2px #17201b,inset 0 0 0 3px #ecf1df!important}
body[data-phase="prep"] :is(#offers,#shopOffers) :is(.upgradeCard,.shopCard).selected:after{display:block!important;top:auto;bottom:5px;right:7px;background:#e9efdc;color:#243028;border-radius:3px;width:14px;height:14px;text-align:center;line-height:14px;font-size:11px}
body[data-phase="prep"] :is(#offers,#shopOffers) .qualityBadge{position:absolute;right:8px;top:8px;width:7px;height:7px;background:var(--quality);border-radius:50%;pointer-events:none}
body[data-phase="prep"] :is(#offers,#shopOffers) .epic .qualityBadge{border-radius:1px;rotate:45deg}
body[data-phase="prep"] :is(#offers,#shopOffers) .ultimate .qualityBadge{border-radius:0;clip-path:polygon(25% 0,75% 0,100% 50%,75% 100%,25% 100%,0 50%);width:9px;height:9px}
body[data-phase="prep"] :is(#offers,#shopOffers) .cardBody b{padding-right:10px}
body[data-phase="prep"] :is(#offers,#shopOffers) .cardArt{color:var(--quality);background:radial-gradient(circle,rgba(var(--quality-rgb),.15),transparent 75%)!important;border-bottom:0!important;border-radius:6px}
body[data-phase="prep"] :is(#offers,#shopOffers) .unaffordable .shopPrice{color:#d49d8d!important}
body[data-phase="prep"] :is(#offers,#shopOffers) :is(.purchased,.maxed){filter:saturate(.5);border-color:#6d7a68!important;background:#242d26!important}
body[data-phase="prep"] :is(#offers,#shopOffers) :is(.purchased,.maxed) .shopPrice{color:#a8b99d!important}
.cardSeal,.cardRevealFx{display:none;pointer-events:none}
body[data-phase="prep"] :is(#offers,#shopOffers) [data-reveal]:not(.revealFront) :is(.cardArt,.cardBody,.qualityBadge){visibility:hidden}
body[data-phase="prep"] :is(#offers,#shopOffers) :is([data-reveal="empty"],[data-reveal="charging"],[data-reveal="turning"]):not(.revealFront){border-color:#4e5b48!important;background:#1c251f!important;box-shadow:inset 0 0 0 2px #162019!important;filter:none;outline:0!important}
body[data-phase="prep"] :is(#offers,#shopOffers) [data-reveal="empty"]{opacity:.45}
body[data-phase="prep"] :is(#offers,#shopOffers) [data-reveal="empty"]:after{display:none!important}
body[data-phase="prep"] :is(#offers,#shopOffers) :is([data-reveal="charging"],[data-reveal="turning"]):not(.revealFront) .cardSeal{display:block;position:absolute;inset:5px;border:1px solid rgba(var(--quality-rgb),calc(.12 + var(--reveal-charge)*.55));border-radius:4px;background:repeating-linear-gradient(135deg,transparent 0 12px,#a4b39808 12px 13px),radial-gradient(ellipse,rgba(var(--quality-rgb),calc(var(--reveal-charge)*.18)),transparent 70%);opacity:calc(.35 + var(--reveal-charge)*.65)}
body[data-phase="prep"] :is(#offers,#shopOffers) .cardSeal:before{content:'';position:absolute;width:24px;height:24px;left:calc(50% - 12px);top:calc(50% - 12px);border:1px solid rgba(var(--quality-rgb),calc(.2 + var(--reveal-charge)*.7));rotate:45deg;box-shadow:0 0 calc(var(--reveal-charge)*18px) rgba(var(--quality-rgb),.3)}
body[data-phase="prep"] :is(#offers,#shopOffers) [data-reveal="turning"]{transform:rotateY(var(--reveal-turn))!important}
body[data-phase="prep"] :is(#offers,#shopOffers) [data-reveal="settling"] .cardRevealFx{display:block;position:absolute;inset:0;background:linear-gradient(110deg,transparent 20%,rgba(var(--quality-rgb),.25) 48%,transparent 65%);animation:prepSweep .35s ease-out both}
body[data-phase="prep"] :is(#offers,#shopOffers) .ultimate[data-reveal="settling"] .cardRevealFx{background:radial-gradient(ellipse,transparent 28%,#e8cb7360 31%,transparent 35%),radial-gradient(circle at 20% 28%,#fae9a9 0 1px,transparent 2px),radial-gradient(circle at 77% 67%,#fae9a9 0 1px,transparent 2px),linear-gradient(110deg,transparent 20%,#e8cb7338 48%,transparent 65%);animation:prepUltimateRelease .5s ease-out both}
body[data-phase="prep"] :is(#offers,#shopOffers) .ultimate[data-reveal="done"] .cardRevealFx{display:block;position:absolute;inset:3px;border-radius:3px;background:linear-gradient(90deg,#e8cb732e 0 5px,transparent 5px calc(100% - 5px),#e8cb732e calc(100% - 5px)) top/100% 2px no-repeat,linear-gradient(90deg,#e8cb732e 0 5px,transparent 5px calc(100% - 5px),#e8cb732e calc(100% - 5px)) bottom/100% 2px no-repeat;animation:prepEdgeBreath 6s ease-in-out infinite}
body[data-phase="prep"] :is(#offers,#shopOffers) :is(.purchased,.maxed) .cardRevealFx{animation:none!important;opacity:.35}
body #stageUpgrade .skipReveal,body #stageShop .skipReveal{min-width:44px!important;width:44px!important;max-width:44px!important;margin-right:auto!important;padding:0!important;font-size:12px!important}
body #prep.revealing #upgradeReportToggle{display:none!important}
body #prep.revealing :is(.upgradeCard,.shopCard){cursor:default;opacity:1}
.prepExitGhost{box-sizing:border-box;padding:10px;display:flex;flex-direction:column;gap:8px;border:1px solid #52604b;border-radius:12px;background:rgba(22,29,24,.98);overflow:hidden;box-shadow:0 16px 50px #0008;font-size:13px;color:#edf0df}
.prepExitGhost .prepTitle{display:flex;align-items:center;gap:10px;height:44px;flex:none}.prepExitGhost .prepTitle>div:first-child{flex:1}.prepExitGhost .eyebrow,.prepExitGhost .shopHeader,.prepExitGhost #prepWaiting{display:none}
.prepExitGhost .prepStage{display:flex;flex-direction:column;gap:8px;flex:1;min-height:0}.prepExitGhost .shopWorkspace{display:flex;flex:1;min-height:0}.prepExitGhost .shopWorkspace.hasSelection>div{display:none}
.prepExitGhost .upgradeChoice,.prepExitGhost .shopChoice{flex:1;min-width:0;display:flex}.prepExitGhost .upgradeCard,.prepExitGhost .shopCard{flex:1;min-width:0;position:relative;padding:8px;background:#242d26;border:1px solid #7b8b68;border-radius:8px;overflow:hidden;text-align:left}.prepExitGhost .cardBody{display:flex;flex-direction:column;gap:4px}.prepExitGhost .cardBody b{padding-left:34px;font-size:14px}.prepExitGhost .cardArt{position:absolute;top:8px;left:8px}.prepExitGhost .rerollRow,.prepExitGhost .shopActions{display:flex;gap:10px;justify-content:flex-end;height:44px;flex:none}.prepExitGhost button{min-height:44px}.prepExitGhost .hidden{display:none!important}
@keyframes prepSweep{from{opacity:.9;translate:-30% 0}to{opacity:0;translate:35% 0}}
@keyframes prepUltimateRelease{from{opacity:.9;scale:.92}to{opacity:0;scale:1.1}}
@keyframes prepEdgeBreath{0%,100%{opacity:.35}50%{opacity:.8}}
@media(prefers-reduced-motion:reduce){.cardRevealFx{animation:none!important}.prepExitGhost{display:none!important}}
/* Short landscape cards retain the price in a shared level/cost row. */
@media(max-height:320px){
 body[data-phase="prep"] #shopOffers .cardBody{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:minmax(26px,1fr) 18px;gap:2px 4px}
 body[data-phase="prep"] #shopOffers .cardBody b{grid-column:1/-1;grid-row:1}
 body[data-phase="prep"] #shopOffers .rarity{grid-column:1;grid-row:2;font-size:12px!important;line-height:18px}
 body[data-phase="prep"] #shopOffers .shopPrice{grid-column:2;grid-row:2;font-size:12px!important;line-height:18px!important}
}
@media(max-height:300px){body[data-phase="prep"] #offers .shortEffect{display:none!important}}

body[data-phase="prep"] :is(#offers,#shopOffers) :is(.upgradeCard,.shopCard){animation:none!important}
body[data-phase="prep"] :is(#offers,#shopOffers) :is(b,strong,small,.rarity){text-shadow:none!important}
.prepExitGhost{padding:0!important;border:0!important;background:none!important;box-shadow:none!important}
