.card-fusion-page .su-forge-main { min-height: 65vh; }
.card-fusion-page .su-resource-panel .cf-balance:last-child { grid-template-columns: 1fr auto; }
.card-fusion-page .su-resource-panel .cf-balance:last-child :is(strong, span) { grid-column: auto; }
.card-fusion-page .su-resource-panel .cf-balance strong span { font: inherit; color: inherit; }
.cf-me { display: inline-flex; align-items: center; justify-content: center; gap: .35em; white-space: nowrap; vertical-align: middle; }
.cf-me img, .card-fusion-page .su-resource-panel .cf-me img { width: 1.3em; height: 1.3em; object-fit: contain; }
.card-fusion-page .su-list-head p { margin: 6px 0 0; }
.card-fusion-page #cf-pool { color: var(--forge-muted); font-size: .82rem; }
.cf-status { color: #e6caef; margin: 0 0 18px; }
.cf-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(270px, 1fr); gap: 20px; align-items: start; }
.cf-side { display: grid; gap: 16px; min-width: 0; }
.cf-panel { display: grid; gap: 14px; }
.cf-panel h3 { margin: 0; color: #efd9f8; font-size: 1.15rem; font-weight: 500; }
.cf-panel p, .cf-dialog p { margin: 0; color: var(--forge-muted); line-height: 1.5; }
.cf-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.cf-tools input { flex: 1 1 175px; }
.card-fusion-page input[type="search"], .card-fusion-page select, .cf-control {
    min-width: 0; min-height: 38px; padding: 7px 11px; border: 1px solid var(--forge-edge);
    border-radius: 8px; color: #eee1f8; background: #150e22; font: inherit; font-size: .85rem; color-scheme: dark;
}
.cf-control { cursor: pointer; }
.cf-control:hover:not(:disabled) { background: #34213f; }
.cf-control:disabled, .card-fusion-page .su-forge-menu button:disabled { opacity: .65; cursor: default; }
.cf-control[aria-pressed="true"] { border-color: #cb9aef; background: #39204d; }
.cf-card-grid, .cf-heroes { display: grid; align-content: start; gap: 11px; overflow: auto; scrollbar-color: #9269b4 #110b1f; color: var(--forge-muted); }
.cf-card-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 112px), 1fr)); max-height: 64vh; padding: 9px; }
.cf-face { display: block; container-type: inline-size; }
.card-fusion-page .hc-art { z-index: 0; }
.card-fusion-page .hc-card-shade { z-index: 1; }
.card-fusion-page .hc-card-edition { z-index: 2; }
.cf-card-tile, .cf-hero, .cf-hero-slot {
    position: relative; display: block; min-width: 0; color: #fff1fb; background: #110b22; cursor: pointer;
    border: 1px solid #76519775; border-radius: 8px; transition: border-color .2s, box-shadow .2s, transform .2s, opacity .2s;
}
.cf-card-tile { padding: 5px; }
.cf-card-tile:hover, .cf-hero:hover, .cf-hero-slot:hover { border-color: #cf9cfa; }
:is(.cf-card-tile, .cf-hero):has(:checked) { border-color: #ffdfa0; box-shadow: 0 0 12px #cc91fa66, inset 0 0 15px #a84bef36; }
:is(.cf-card-tile, .cf-hero):has(:disabled:not(:checked)) { opacity: .48; cursor: default; }
:is(.cf-card-tile, .cf-hero):focus-within { outline: 2px solid #b1fff2; outline-offset: 2px; }
.cf-choice-input { position: absolute; width: 1px; height: 1px; padding: 0; margin: 0; overflow: hidden; clip-path: inset(50%); }
.cf-choice-mark { position: absolute; z-index: 6; top: 5px; right: 5px; display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid #ffdda3; border-radius: 50%; background: #20122b; color: #ffe2a8; font: 600 15px/1 Outfit,sans-serif; opacity: 0; transform: scale(.7); transition: opacity .2s, transform .2s; }
:is(.cf-card-tile, .cf-hero):has(:checked) .cf-choice-mark { opacity: 1; transform: scale(1); }
.cf-card-tile .cf-choice-mark { top: -5px; right: -5px; }
.cf-card-tile .hc-card-bonus { padding: 2px; gap: 1px; max-width: 38%; }
.cf-card-tile .hc-card-stat-icon { width: 11px; height: 11px; }
.cf-card-tile .hc-card-stat-value { font-size: clamp(12px, 11cqw, 18px); }
.cf-card-tile .hc-card-stat-label { font-size: 7px; }
.cf-card-tile .hc-card-edition { font-size: clamp(8px, 7cqw, 12px); }
.cf-card-tile .hc-card-caption>small { letter-spacing: .08em; font-size: 7px; }
.cf-card-tile .hc-card-caption>strong { font-size: clamp(9px, 8.2cqw, 13px); }
.cf-rates b { color: var(--cf-rarity, #e2c6f3); }
.card-fusion-page [data-rarity="GR"] { --cf-rarity: #92d8fc; }
.card-fusion-page [data-rarity="LR"] { --cf-rarity: #f2cf83; }
.card-fusion-page [data-rarity="UR"] { --cf-rarity: #dcb4ff; }
.card-fusion-page [data-rarity="SR"] { --cf-rarity: #efb9e6; }
.card-fusion-page [data-rarity="R"] { --cf-rarity: #a5ffea; }
.card-fusion-page [data-rarity="TSR"] { --cf-rarity: #ffddad; }
.cf-rates { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.cf-rates div { display: grid; gap: 4px; padding: 9px; text-align: center; background: #130d22; border: 1px solid var(--forge-edge); border-radius: 8px; }
.cf-rates span { color: #eeddf5; font-size: .85rem; white-space: nowrap; }
.cf-heroes { grid-template-columns: repeat(auto-fill, minmax(min(100%, 88px), 1fr)); grid-auto-rows: max-content; gap: 8px; max-height: clamp(185px, 29vh, 350px); padding: 4px; }
.cf-hero-slots { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.cf-hero, .cf-hero-slot { width: 100%; aspect-ratio: 1; isolation: isolate; overflow: hidden; padding: 0; }
.cf-hero img, .cf-hero-slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.cf-hero::after, button.cf-hero-slot::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(transparent 40%, #090411e8); }
.cf-hero>span, .cf-hero-slot>span { display: block; position: absolute; bottom: 5px; inset-inline: 2px; text-align: center; font-size: .8rem; font-weight: 600; text-shadow: 0 1px 3px #000; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-hero-slot { border-color: #ddb879; }
.cf-hero-slot>span { font-size: clamp(.6rem, .85vw, .76rem); }
.cf-hero-slot i { position: absolute; top: 3px; right: 3px; display: grid; place-items: center; width: 18px; aspect-ratio: 1; border-radius: 50%; color: #fff; background: #201329cc; font-size: .85rem; font-style: normal; }
.cf-slot-empty { display: grid; place-items: center; background: radial-gradient(circle, #4f2d6755, #110b20); border: 1px dashed #a26fc1a0; color: #cb9bea; cursor: default; }
.cf-slot-empty b { font: clamp(16px, 2vw, 27px)/1 Georgia,serif; }
.cf-submit p + p { margin-top: 5px; }
.cf-submit .cf-payout { color: #9cebd9; font-size: 1.3rem; font-weight: 600; }
.cf-submit .cf-warning { color: #f1b6bf; }
.cf-offer-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(12px, 3vw, 42px); width: min(100%, 880px); margin: 0 auto; padding: 14px 10px 4px; }
.cf-reveal-scene { position: relative; isolation: isolate; background: radial-gradient(ellipse at 50% 45%, #432465 0, #171029 47%, #0b0818 83%); }
.cf-reward-card { display: grid; align-content: start; gap: 16px; text-align: center; z-index: 3; }
.cf-reward-card .su-upgrade-btn { margin: 0; padding: 6px; min-width: 0; transition: opacity .3s, background .3s; }
.cf-revealing .cf-reward-card .su-upgrade-btn { opacity: .3; }
.cf-reveal-scene .cpw-flip-card { container-type: inline-size; cursor: default; }
.cf-reveal-scene .cpw-flip-card .cpw-flip-inner { transform: none; transition: none; }
.cf-reveal-scene .cpw-card-front { transform: none; opacity: 0; z-index: 1; }
.cf-reveal-scene .cpw-card-back { z-index: 2; }
.cf-reveal-scene .is-revealed .cpw-card-front { opacity: 1; }
.cf-reveal-scene :is(.is-cracking, .is-revealed)>.cpw-flip-inner>.cpw-card-back { opacity: 0; }
.cf-reveal-scene .is-revealed::after { content: none; }
.cf-reveal-scene .is-cracking:not(.is-shattering) .cpw-flip-inner { animation: cpw-seal-breathe 1.65s ease-in-out infinite; }
.cf-reveal-scene .is-shattering .cpw-card-front { animation: cpw-art-emerge 900ms cubic-bezier(.15,.6,.2,1) both; }
.cf-reveal-scene [data-reveal-tier="UR"] .is-shattering .cpw-card-front { animation-duration: 1250ms; }
.cf-reveal-scene .is-quick-reveal .cpw-card-front { animation-duration: 120ms; }
.cf-reveal-scene .cpw-reveal-grid.is-arriving>.cpw-reveal-slot { animation: cpw-orbit-deal var(--cp-deal-duration,1550ms) cubic-bezier(.16,.65,.25,1) both; animation-delay: calc(var(--cp-index) * var(--cp-deal-stagger,85ms)); }
.cf-reveal-scene .hc-card-edition { font-size: clamp(8px, 5.8cqw, 16px); }
.cf-reveal-scene .hc-card-caption>strong { font-size: clamp(10px, 6.5cqw, 20px); }
.cf-reveal-scene .hc-card-caption>small { font-size: clamp(7px, 3.8cqw, 10px); letter-spacing: .12em; }
.cf-reveal-scene .hc-card-stat-value { font-size: clamp(12px, 10cqw, 30px); }
.cf-reveal-scene .hc-card-stat-icon { width: clamp(8px, 7cqw, 19px); height: clamp(8px, 7cqw, 19px); }
.cf-reveal-scene .hc-card-stat-label { font-size: clamp(6px, 3.8cqw, 10px); }
.cf-result { width: min(740px, calc(100% - 26px)); max-height: calc(100dvh - 24px); inset: 0; margin: auto; border: 1px solid #ba8cdf91; border-radius: 18px; padding: clamp(16px, 3vw, 28px); color: #faeaff; text-align: center; box-shadow: 0 0 80px #a46bdc48, inset 0 0 64px #64348836; overflow: auto; }
.cf-result::backdrop { background: #05030de3; backdrop-filter: blur(7px); }
.cf-result h2 { margin: 0 0 12px; font: 600 clamp(24px, 4vw, 43px)/1.15 Outfit,sans-serif; }
.cf-result form { position: relative; z-index: 4; margin: 12px auto 0; }
.cf-result form .su-upgrade-btn { width: min(100%, 220px); margin: 0; }
.cf-single-result { grid-template-columns: minmax(0, min(270px, 34dvh)); margin-inline: auto; padding: 10px; }
.cf-essence-stage { position: relative; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 5px; padding: 12px 0 0; }
.cf-coin-slot { z-index: 3; width: clamp(112px, 23vw, 200px); }
.cf-coin-slot .cpw-flip-card { aspect-ratio: 1; }
.cf-coin-slot .cpw-card-back { border-radius: 50%; border-color: #ba8ce5; box-shadow: inset 0 0 45px #a679f270, 0 0 42px #ae78f169; }
.cf-coin-slot .cpw-card-back>small { display: none; }
.cf-essence-stage .cpw-card-front { overflow: visible; }
.cf-essence-coin { position: absolute; display: grid; place-items: center; inset: 0; }
.cf-essence-coin::before { position: absolute; content: ''; inset: -33%; z-index: -1; border-radius: 50%; background: radial-gradient(circle, #e4b3ff8c, #a247f854 38%, transparent 68%); filter: blur(7px); }
.cf-essence-coin img { width: 82%; aspect-ratio: 1; object-fit: contain; filter: drop-shadow(0 0 16px #f8c1ffb3); }
.cf-essence-total { position: relative; z-index: 4; font-size: clamp(27px, 5.3vw, 54px); color: #f9e7ff; text-shadow: 0 0 22px #cd78ff; }
.cf-revealing .cf-essence-total { opacity: 0; }
.cf-revealing:has(.is-revealed) .cf-essence-total { animation: cf-amount-in .85s ease-out both; }
.cf-sacrifices { position: absolute; inset: 0; pointer-events: none; }
.cf-sacrifice { position: absolute; z-index: 4; top: 40%; left: 50%; width: clamp(42px, 11vw, 92px); opacity: 0; }
.cf-revealing .cf-sacrifice { animation: cf-sacrifice .82s cubic-bezier(.28,.15,.42,1) var(--cf-delay) both; }
.cf-sacrifice .hc-card-edition, .cf-sacrifice .hc-card-bonus, .cf-sacrifice .hc-card-caption { display: none; }
@keyframes cf-sacrifice {
    0% { opacity: 0; transform: translate(-50%,-50%) translate(calc(var(--cf-x) * var(--cf-offset-scale, 1)), var(--cf-y)) rotate(var(--cf-angle)) scale(.72); }
    24% { opacity: 1; transform: translate(-50%,-50%) translate(calc(var(--cf-x) * var(--cf-offset-scale, 1) * .84), calc(var(--cf-y) - 18px)) rotate(var(--cf-angle)) scale(1.05); }
    58% { opacity: .9; filter: brightness(1.45); }
    100% { opacity: 0; transform: translate(-50%,-55%) rotateY(65deg) scale(.06); filter: brightness(2.4); }
}
@keyframes cf-amount-in { from { opacity: 0; transform: translateY(14px) scale(.88); } to { opacity: 1; transform: none; } }
.cf-dialog { width: min(440px, calc(100% - 30px)); color: #f4e1fa; }
.cf-dialog::backdrop { background: #080410b8; }
.cf-dialog h2 { margin: 0 0 8px; }
.cf-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.cf-dialog-actions .su-upgrade-btn, .cf-button { width: auto; margin: 0; padding: 8px 16px; }

@media (max-width: 740px) {
    .cf-layout { grid-template-columns: minmax(0, 1fr); gap: 14px; }
    .cf-rates { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .card-fusion-page .su-resource-panel { grid-template-columns: 1fr; }
    .cf-offer-cards { padding-inline: 0; }
    .cf-reveal-scene .cf-reward-card .su-upgrade-btn { font-size: .68rem; letter-spacing: .02em; }
    .cf-reveal-scene .hc-card-bonus { padding: 1px; gap: 1px; max-width: 38%; }
    .cf-hero-slot>span { font-size: .65rem; }
    .cf-sacrifice { --cf-offset-scale: .56; }
}
@media (max-width: 460px) {
    .cf-card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .cf-heroes { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .cf-reveal-scene .cf-reward-card .su-upgrade-btn { padding-inline: 2px; }
}
@media (prefers-reduced-motion: reduce) {
    .cf-card-tile, .cf-hero, .cf-hero-slot, .cf-choice-mark { transition: none; }
}
