/* Shared typographic contract: sprite pixels stay inside a bounded line box. */
#stage .ui-uniform-number{height:1em;min-height:0;display:inline-flex;align-items:center;justify-content:center;gap:.025em;line-height:1;vertical-align:middle;letter-spacing:0;white-space:nowrap;max-width:100%}
#stage .ui-digit{display:inline-block;flex:none;height:1em;background-repeat:no-repeat}
#stage .ui-label{display:inline-block;flex:0 1 auto;height:1em;max-width:100%;background-repeat:no-repeat;vertical-align:middle;line-height:1;pointer-events:none}
#stage :is(.reward-heading,.reward-continue,.if-dialog-title){display:flex;align-items:center;justify-content:center;line-height:1.15;letter-spacing:0}
#stage :is(.if-dialog-body,.modal-card,.reward-panel) :is(p,small,label,dt,dd){font-family:'DDFS Sans',sans-serif;font-weight:600;letter-spacing:0;line-height:1.5;overflow-wrap:break-word;text-shadow:none}
#stage .rp-page>.if-resources .if-resource{display:block;overflow:hidden;box-sizing:border-box;line-height:1}
#stage .rp-page>.if-resources .if-resource-value{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;width:100%;height:100%;min-height:0;padding:0;margin:0;font-size:2.7cqw;line-height:1;transform:none;overflow:hidden}
#stage .rp-page>.if-resources .if-resource-value .image-number{height:1em;font-size:inherit;line-height:1}
#stage .rp-page:is(.if-page-signin,.if-page-balls)>.if-resources .if-resource:nth-child(2){left:76%;top:1.3%;width:12%;height:2.4%}
#stage .rp-page:is(.if-page-signin,.if-page-balls)>.if-resources .if-resource:nth-child(1){top:1.3%;height:2.4%}
#stage .rp-page .pp-coins{overflow:hidden;line-height:1;min-height:0}
#stage .if-resource-value{line-height:1;overflow:hidden;align-items:center;justify-content:center}
#stage .reward-panel{padding:5cqw 6cqw;max-height:90%;width:100%;overflow-x:hidden}
#stage .reward-heading{width:94%;height:11cqw;font-size:5cqw;margin:0 auto 3cqw;padding:2cqw 4cqw;background:url('./assets/interface/buttonPurple.png') center/100% 100% no-repeat}
#stage .reward-cards{display:flex;gap:2cqw;align-items:stretch;justify-content:center;margin:3cqw 0;flex-wrap:wrap}
#stage .reward-card{width:29%;min-width:21cqw;max-width:30cqw;padding:4cqw 2cqw;gap:2cqw;border:0;border-radius:0;background:url('./assets/fidelity/frame.svg') center/100% 100% no-repeat,linear-gradient(#593569,#251333);box-shadow:none}
#stage .reward-icon{width:15cqw;height:15cqw}
#stage .reward-amount{display:flex;align-items:center;justify-content:center;width:100%;font-size:4.6cqw;line-height:1;overflow:hidden}
#stage .reward-name{font-size:3.4cqw;line-height:1.2}
#stage .reward-seal{transform:none;animation:none;font-size:3.6cqw;line-height:1.2;padding:1cqw 3cqw;background:#21362dcc}
#stage .reward-status{font-size:3cqw;line-height:1.6;padding:0 2cqw;margin:3cqw 0}
#stage .reward-continue{width:85%;min-width:0;height:12cqw;min-height:0;font-size:4.5cqw;padding:3cqw 6cqw}
#stage .if-dialog-panel{overflow-x:hidden;max-width:100%;box-sizing:border-box}
#stage .if-dialog-title{white-space:nowrap;max-width:80%;margin-left:auto;margin-right:auto}
#stage .if-purchase-confirm{min-width:0;display:flex;flex-direction:column;align-items:center;gap:2cqw}
#stage .if-purchase-confirm>p{max-width:100%;padding:0 2cqw}
#stage .modal-card .ui-label{max-width:100%}
#stage .rp-page:is(.if-page-signin,.if-page-balls)>.if-resources .if-resource:nth-child(3){display:none}
#stage .reward-seal .signin-letter{display:inline-block;height:1em;background-image:url('./assets/reference-pages/signin-lettering.png');background-repeat:no-repeat;vertical-align:middle}
#stage .reward-heading{font-size:10cqw;height:14cqw;padding:2cqw 3cqw}
#stage .reward-continue{font-size:7cqw;height:13cqw;padding:2.5cqw 5cqw}
#stage .reward-seal{font-size:4.7cqw}
#stage .modal-card button .ui-label{font-size:1.45em}
#stage :is(.if-dialog-panel button,.hf-setting-card,.hf-save-actions,.hf-nickname-row) .ui-label{font-size:1.25em}
#stage .if-page:not(.if-page-home):not(.rp-page) .if-resource-value{font-size:3.2cqw;flex:1;min-width:0}
#stage .if-page{isolation:isolate}
#stage .if-dialog-layer{z-index:60}
/* Upgrade is a bounded two-line control, not a floating price over the library. */
#stage .rp-page .cf-ball-actions>.cf-upgrade-ball{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0;padding:.2cqw 1cqw;overflow:hidden}
#stage .rp-page .cf-ball-actions .cf-upgrade-caption{display:flex;align-items:center;justify-content:center;gap:.4cqw;font-size:2.7cqw;line-height:1;height:2.8cqw;margin:0}
#stage .rp-page .cf-ball-actions .cf-up-arrow{font-size:2.8cqw;line-height:1;height:2.8cqw;display:inline-flex;align-items:center}
#stage .rp-page .cf-ball-actions .cf-button-price{position:static;inset:auto;display:flex;align-items:center;justify-content:center;width:auto;height:1.9cqw;min-height:0;font-size:1.8cqw;line-height:1;gap:.3cqw;margin:0;padding:0;transform:none}
#stage .rp-page .cf-ball-actions .cf-button-price>img{width:1.9cqw;height:1.9cqw}
#stage .rp-page .cf-library-heading{align-items:center;box-sizing:border-box;padding:0 .8cqw}
#stage .rp-page .cf-library-heading .cf-sort{height:5cqw;min-height:0;padding:.3cqw .8cqw;font-size:2.6cqw;line-height:1.2;margin:0}
#stage .rp-page .cf-library-heading .cf-search-toggle{height:5cqw;width:5cqw;min-height:0;padding:0;margin:0;line-height:1}
#stage .rp-page .cf-ball-actions .cf-upgrade-caption{position:static;inset:auto;transform:none}
/* All three shop categories share real painted card assets, including gifts. */
#stage .rp-page .hf-shop-items{grid-template-rows:30cqw;grid-auto-rows:46cqw;gap:2cqw;padding:1.3cqw}
#stage .rp-page .hf-shop-item{height:46cqw;min-height:0;display:block;padding:0;background:url('./assets/interface/shopCard.png') center/100% 100% no-repeat;border:0;border-radius:0;box-shadow:none;overflow:hidden}
#stage .rp-page .hf-shop-item:before,#stage .rp-page .hf-shop-item:after{display:none}
#stage .rp-page .hf-shop-item>img{position:absolute;top:11%;left:22%;width:56%;height:42%;max-height:none;object-fit:contain}
#stage .rp-page .hf-shop-item>h3{position:absolute;left:9%;top:58%;width:82%;height:8%;display:flex;align-items:center;justify-content:center;margin:0;background:none;font-size:3.8cqw;line-height:1;color:#fff0c9;text-shadow:none}
#stage .rp-page .hf-shop-item>p{position:absolute;left:10%;top:68%;width:80%;height:13%;margin:0;padding:0;font-size:2.55cqw;line-height:1.3;color:#ebd8ee;display:flex;align-items:center;justify-content:center;text-align:center}
#stage .rp-page .hf-shop-item>.hf-action{position:absolute;left:12%;bottom:5%;top:auto;width:76%;height:12%;min-height:0;max-height:none;margin:0;padding:0;background:url('./assets/interface/buttonPurple.png') center/100% 100% no-repeat;font-size:3.2cqw;display:flex;align-items:center;justify-content:center}
#stage .rp-page .hf-shop-item.is-wide{height:30cqw;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:3cqw 3cqw 3cqw 26cqw;background:url('./assets/fidelity/frame.svg') center/100% 100% no-repeat,linear-gradient(#5b2874,#261238)}
#stage .rp-page .hf-shop-item.is-wide>img{left:3cqw;top:4cqw;width:21cqw;height:21cqw}
#stage .rp-page .hf-shop-item.is-wide>h3{position:static;width:100%;height:5cqw;font-size:4.5cqw;flex:none}
#stage .rp-page .hf-shop-item.is-wide>p{position:static;width:100%;height:auto;min-height:7cqw;margin:1cqw 0;font-size:2.8cqw;line-height:1.4;flex:1;color:#f3e3f4}
#stage .rp-page .hf-shop-item.is-wide>.hf-action{position:static;width:100%;height:6cqw;font-size:3.4cqw;flex:none}
#stage .rp-page .hf-shop-item>.hf-action:disabled{filter:saturate(.2);opacity:.7}
#stage .rp-page .hf-shop-mini{font-size:3cqw}
#stage .rp-page .hf-shop-item:not(.is-wide)>p{top:66%;height:16%;font-size:3cqw;line-height:1.2}
#stage .rp-page .cf-card-ball{position:absolute;left:22%;top:18%;width:56%;height:52%;max-height:none;margin:0;transform:none;object-fit:contain}
#stage .rp-page .cf-card-name{position:absolute;left:5%;top:70%;bottom:auto;width:90%;height:14%;display:flex;align-items:center;justify-content:center;margin:0;padding:0;background:#24132edb;border-radius:1cqw;font-size:2.8cqw;line-height:1;white-space:nowrap;text-shadow:none}
#stage .rp-page .cf-card-level{position:absolute;left:5%;right:5%;bottom:3%;height:10%;margin:0;font-size:2cqw;line-height:1}
/* The three card illustrations share a 320 × 510 viewBox. Anchor the content
   to its title (39–91), icon well (107–303) and lower inset (317–468). */
#stage .bless-dialog .blessing-choice {
  position:relative;
  display:block;
  height:58cqw;
  min-height:0;
  padding:0;
}
#stage .bless-dialog .blessing-choice>strong,
#stage .bless-dialog .blessing-effect,
#stage .bless-dialog .blessing-value,
#stage .bless-dialog .blessing-note,
#stage .bless-dialog .blessing-limit {
  position:absolute;
  inset-inline:12%;
  width:auto;
  min-height:0;
  margin:0;
  padding:0;
  display:flex;
  align-items:center;
  justify-content:center;
}
#stage .bless-dialog .blessing-choice>strong {
  top:7.65%;
  height:10.2%;
  font-size:3.2cqw;
}
#stage .bless-dialog .blessing-choice>img {
  position:absolute;
  top:23%;
  left:50%;
  transform:translateX(-50%);
  width:15cqw;
  height:26%;
  min-height:0;
  margin:0;
}
#stage .bless-dialog .blessing-rule { display:contents }
#stage .bless-dialog .blessing-effect {
  top:49%;
  height:9.5%;
  font-size:2.8cqw;
  line-height:1.25;
  white-space:normal;
}
#stage .bless-dialog .blessing-effect>span {
  display:flex;
  justify-content:center;
  width:100%;
}
#stage .bless-dialog .blessing-value {
  top:63.5%;
  height:9.5%;
  font-size:4.3cqw;
  gap:.5cqw;
}
#stage .bless-dialog .blessing-value small { font-size:2.5cqw }
#stage .bless-dialog .blessing-note {
  top:73%;
  height:7%;
  font-size:2.6cqw;
  line-height:1.2;
  gap:.5cqw;
}
#stage .bless-dialog .blessing-limit {
  top:80%;
  height:11%;
  font-size:2.55cqw;
  line-height:1.1;
  gap:.22cqw;
}
#stage .bless-dialog .is-selected>.blessing-limit { visibility:hidden }
#stage .bless-dialog .is-selected>.blessing-select-hint {
  display:grid;
  place-items:center;
  top:80%;
  height:11%;
  bottom:auto;
  margin:0;
}
#stage .bless-dialog .owned-bless-panel>h3{display:flex;align-items:center;justify-content:center;height:5cqw;font-size:3.5cqw;margin:0 0 1cqw}
#stage .bless-dialog>.owned-bless-panel:has(.owned-bless-grid) {
  padding:2.8cqw 5cqw 3.4cqw;
}
#stage .bless-dialog .owned-bless-grid {
  grid-auto-rows:9.5cqw;
  gap:1cqw 1.2cqw;
  max-height:31.5cqw;
  scrollbar-color:#a380b9 #362042;
}
#stage:has(.bless-dialog) .battle-ui :is(.wall-status,.phase-hint,.ball-counter,.skill-bar,.speed-button){visibility:hidden}
#stage .rp-page .hf-shop-item.is-wide>p{display:block;align-content:center;overflow-wrap:break-word}
#stage .rp-page .hf-shop-item>.hf-action img{display:inline-block;position:static;width:3.2cqw;height:3.2cqw;object-fit:contain;margin:0 .5cqw 0 0;opacity:1;visibility:visible}
#stage .rp-page .hf-shop[data-shop-mode="balls"] .hf-shop-items{grid-auto-rows:62cqw}
#stage .rp-page .hf-shop[data-shop-mode="balls"] .hf-shop-item:not(.is-wide){height:62cqw}
#stage .rp-page .hf-shop[data-shop-mode="balls"] .hf-shop-item:not(.is-wide)>img{top:9%;height:35%}
#stage .rp-page .hf-shop[data-shop-mode="balls"] .hf-shop-item:not(.is-wide)>h3{top:47%;height:8%;font-size:3.2cqw}
#stage .rp-page .hf-shop[data-shop-mode="balls"] .hf-shop-item:not(.is-wide)>p{top:57%;height:23%;display:block;align-content:center;font-size:2.6cqw;line-height:1.45;overflow-wrap:break-word}
#stage .rp-page .hf-shop[data-shop-mode="balls"] .hf-shop-item:not(.is-wide)>.hf-action{height:9%;bottom:5%}
#stage .rp-page .hf-shop-category.is-active{outline:2px solid #ffe889;outline-offset:-3px;border-radius:2cqw;filter:drop-shadow(0 0 1cqw #ffd75d)}
#stage .bless-dialog .blessing-choice>strong .ui-label{font-size:1.3em}
#stage .bless-dialog .blessing-effect .ui-label,#stage .bless-dialog .blessing-note .ui-label,#stage .bless-dialog .blessing-limit .ui-label{font-size:1.3em}
#stage .bless-dialog .owned-bless-panel>h3 .ui-label{font-size:1.35em}
#stage :is(.bless-dialog,.pause-dialog) .owned-bless-name .ui-label{font-size:1.3em}
#stage .battle-header .coin-pill #coin-number{min-width:0;max-width:100%;font-size:2.7cqw;overflow:hidden}
/* Anchors in the selected 941 x 1672 prepare artwork. */
#stage .rp-page .pp-monsters { overflow:hidden; scrollbar-width:none }
#stage .rp-page .pp-cards { left:15%; top:60.3%; width:69.7%; height:13.1%; align-items:stretch }
#stage .rp-page .pp-card { flex:0 0 28.2%; margin:0; padding:0; border:0 }
#stage .rp-page .pp-card>img { position:absolute; inset:1% 5% auto; width:90%; height:65%; margin:0 }
#stage .rp-page .pp-card>strong { inset:69.5% 0 auto; height:30%; margin:0; padding:0; display:grid; place-items:center; line-height:1; font-size:3.25cqw }
#stage .rp-page .pp-coins { left:76.1%; top:2.6%; width:11.1%; height:2.9%; padding:0 .5cqw; gap:0; display:flex; align-items:center; justify-content:center; font-size:2.65cqw }
#stage .pp-coins .image-number[data-compact="dense"] { font-size:.85em }
#stage .if-resource-value .image-number[data-compact="dense"],#stage #coin-number .image-number[data-compact="dense"] {font-size:.87em}
/* Only the illustration belongs inside the gold socket; the source also contains a caption plate. */
#stage .rp-page .pp-card>img {
  inset:-3% auto auto -5%;
  width:110%;
  height:88%;
  max-width:none;
  object-fit:fill!important;
  clip-path:inset(8% 12% 25% round 2.2cqw);
}
