/* Deliberate two-item merging, shared by pointer, keyboard and touch. */
#panel-bag .panel-heading p{line-height:1.6}
#merge-btn[aria-pressed="true"]{background:#e6ddf7;border-color:#a38abc;color:#765b91;box-shadow:0 3px #bfacd0}
.forge{margin:0 0 14px;padding:11px;background:#f1e8fb;border:2px solid #b69aca;border-radius:16px;box-shadow:0 3px #d2bedf;color:#725879;overflow:hidden}
.forge-heading{display:flex;align-items:center;justify-content:space-between;gap:5px}
.forge-heading strong{font-size:11px;line-height:1.4}
.forge-heading button{border:0;background:transparent;color:#846994;font-size:10px;min-height:32px;padding:3px;white-space:nowrap}
.forge-heading button:disabled{opacity:.45}
.forge-instruction{font-size:10px;line-height:1.5;margin:5px 0 9px;color:#8b6c92}
.forge-recipe{display:grid;grid-template-columns:minmax(0,1fr) 11px minmax(0,1fr) 11px minmax(0,1fr);align-items:center;gap:3px}
.forge-recipe>b{text-align:center;font-size:13px;color:#ac89bd}
.forge-ingredient,.forge-output{position:relative;min-width:0;height:85px;display:flex;flex-direction:column;align-items:center;justify-content:center;border:1.5px dashed #b29abb;border-radius:11px;background:#fff9f2;color:#8e719e;gap:3px;padding:3px}
.forge-ingredient.filled{border-style:solid;background:#ffedf4;border-color:#c298af}
.forge-ingredient>span,.forge-output>span{font-size:25px;line-height:34px}
.forge-ingredient img,.forge-output img,.forge-ingredient svg,.forge-output svg{width:100%;height:37px;object-fit:contain}
.forge-ingredient small,.forge-output small{font-size:8px;line-height:1.4;text-align:center;overflow-wrap:anywhere;color:#8a668a}
.forge-ingredient i{position:absolute;right:2px;top:0;font-style:normal;color:#b2879a;font-size:13px}
.forge-output[data-result-id]{border:2px solid #c2a066;background:#fff0bd;box-shadow:inset 0 0 9px #fff9}
.forge-output[data-result-id] small{color:#8d6834}
.forge-comparison{display:flex;justify-content:space-between;gap:6px;align-items:center;font-size:10px;margin:10px 0 5px;color:#846b78}
.forge-comparison b,.forge-result-power b{background:#d4edbc;padding:3px 5px;border-radius:6px;font-size:11px;color:#597b48;white-space:nowrap}
.forge-comparison .power-down,.forge-result-power .power-down{background:#f5ddca;color:#a17242}
.forge-explain{font-size:9px;line-height:1.6;margin:5px 0 9px;color:#896d86}
#forge-confirm{font-size:11px;min-height:39px;padding:9px 7px;justify-content:center}
.slot.merge-compatible,.bag-open .slot.merge-compatible{border-color:#83a979;background:#f3f9df;box-shadow:0 2px #b0c499,0 0 0 1px #bdd6a6}
.slot.merge-incompatible,.bag-open .slot.merge-incompatible{opacity:.48}
.slot.merge-selected,.bag-open .slot.merge-selected{border:3px solid #b381ad;background:#f3d7f0;box-shadow:0 2px #be9bbb}
.slot .merge-check{position:absolute;bottom:5px;right:4px;background:#b183b0;color:white;border-radius:50%;width:17px;height:17px;font-size:12px;font-weight:900;line-height:17px}
.forge.is-merging,.forge.is-revealed{text-align:center;padding:15px 10px}
.forge.is-merging{min-height:184px;display:flex;flex-direction:column;justify-content:center;background:radial-gradient(#fff7cf,#eedbf7)}
.forge-fusion{display:flex;align-items:center;justify-content:center;gap:8px;margin:9px 0}
.forge-fusion img,.forge-fusion svg{width:65px;height:49px;object-fit:contain}
.forge-fusion>span{animation:forge-fuse-left .65s ease-in both}
.forge-fusion>span:last-child{animation-name:forge-fuse-right}
.forge-fusion>b{font-size:28px;color:#b48bbb;animation:forge-spark .65s ease-in both}
.forge.is-merging p{font-size:12px;font-weight:800;margin:14px 0}
.forge-result-art{margin:0 auto 3px;width:110px;height:75px;display:grid;place-items:center;border-radius:50%;background:radial-gradient(#fffac5,transparent 70%);animation:forge-reveal .35s ease-out both}
.forge-result-art img,.forge-result-art svg{width:105px;height:73px;object-fit:contain}
.forge-result-title{font-size:10px;color:#aa7798}
.forge.is-revealed h3{font-size:15px;margin:5px 0;color:#7f5b84}
.forge-result-power{font-size:17px;font-weight:900;margin:8px 0 5px;color:#7c6886}
.forge.is-revealed>small{font-size:9px;color:#997f9c}
#forge-result-status{font-size:10px;line-height:1.6;margin:8px 0 10px}
#forge-again{width:100%;background:#e0eecb;color:#708254;font-size:11px}
@keyframes forge-fuse-left{0%{transform:translateX(-8px) rotate(-10deg)}70%{transform:translateX(26px) rotate(12deg)}100%{transform:translateX(29px) scale(.5);opacity:.1}}
@keyframes forge-fuse-right{0%{transform:translateX(8px) rotate(10deg)}70%{transform:translateX(-26px) rotate(-12deg)}100%{transform:translateX(-29px) scale(.5);opacity:.1}}
@keyframes forge-spark{0%,30%{transform:scale(.7)}80%{transform:scale(2.2)}100%{transform:scale(3.1);color:#fff8c4}}
@keyframes forge-reveal{from{opacity:.2;transform:scale(.7) rotate(-12deg)}to{opacity:1;transform:scale(1) rotate(0)}}
@media(max-width:730px){.forge{padding:9px;margin-bottom:12px}.forge-ingredient,.forge-output{height:76px}.forge-ingredient img,.forge-output img{height:38px}.forge-ingredient small,.forge-output small{font-size:9px}.forge-recipe{grid-template-columns:minmax(0,1fr) 14px minmax(0,1fr) 14px minmax(0,1fr);gap:5px}.forge-heading strong{font-size:12px}.forge-instruction,.forge-explain{font-size:10px}.forge-comparison{font-size:11px}.forge.is-merging{min-height:180px}.slot.merge-selected,.bag-open .slot.merge-selected{border-width:2px}#forge-confirm{min-height:42px}}
@media(prefers-reduced-motion:reduce){.forge-fusion>span,.forge-fusion>b,.forge-result-art{animation:none}}

/* The phone forge borrows room from the battlefield so materials stay in reach. */
@media(max-width:730px){body.forging.bag-open:not(.site-page) .game-shell{height:calc(42dvh - 70px);min-height:170px}body.forging.bag-open:not(.site-page) .panel-column{height:calc(58dvh - 62px);min-height:240px}.forge{padding:8px;margin-bottom:9px}.forge-ingredient,.forge-output{height:63px}.forge-ingredient img,.forge-output img{height:32px}.forge-heading button{min-height:25px}.forge-instruction{margin:3px 0 6px}.forge-explain{margin:4px 0 6px;font-size:9px}#forge-confirm{min-height:37px;padding:7px}.forge-comparison{margin:6px 0 4px}.forge.is-revealed{padding:10px}.forge-result-art{height:55px}.forge-result-art img{height:53px}.forge.is-revealed h3{margin:3px 0}.forge-result-power{margin:5px 0 3px}#forge-result-status{margin:5px 0 7px}}
