/* Hanzi Gacha — post-click battle feedback; mobile-first presentation of actual precomputed results */
body.hgb-open{overflow:hidden;overscroll-behavior:none}
.hgb-overlay{position:fixed;inset:0;z-index:10010;display:flex;align-items:center;justify-content:center;box-sizing:border-box;padding:12px;padding-top:max(12px,env(safe-area-inset-top));padding-bottom:max(12px,env(safe-area-inset-bottom));font-family:system-ui,-apple-system,"Segoe UI",sans-serif}
.hgb-backdrop{position:absolute;inset:0;background:#081a25e8;-webkit-backdrop-filter:blur(9px);backdrop-filter:blur(9px)}
.hgb-panel{position:relative;isolation:isolate;display:flex;flex-direction:column;overflow:hidden;min-width:0;width:min(492px,100%);max-height:calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));border:1px solid #d6a661;border-radius:22px;background:#f7f3e8;box-shadow:0 28px 80px #010e1888}
.hgb-panel button{font:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent}
.hgb-panel button:focus-visible{outline:3px solid #dfab6c;outline-offset:2px}
.hgb-panel button:disabled{opacity:.42;cursor:not-allowed}
.hgb-top{background:#1a3644;color:#f0d1a0;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px 18px;min-height:50px;flex:none;box-sizing:border-box}
.hgb-top span{font-size:11px;letter-spacing:.15em;font-weight:850}
.hgb-top button{font-size:30px!important;background:transparent;color:#f4e2c5;border:none;line-height:1;flex:none;padding:0 4px}
.hgb-content{padding:22px 21px 19px;display:flex;flex-direction:column;align-items:center;flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;text-align:center;box-sizing:border-box}
.hgb-kicker{color:#98713d;font-size:10px;font-weight:900;letter-spacing:.18em}
.hgb-round-head{display:flex;align-items:center;justify-content:space-between;width:100%;margin:15px 0 18px;gap:15px;color:#43695c;font-size:12px;font-weight:850;letter-spacing:.07em}
.hgb-score{font-size:26px;letter-spacing:0;font-variant-numeric:tabular-nums;color:#24534b}
.hgb-score i{font-style:normal;color:#8c9890;margin:0 6px}
.hgb-players{display:grid;grid-template-columns:minmax(0,1fr) 29px minmax(0,1fr);align-items:center;gap:5px;width:100%}
.hgb-fighter{--accent:#6a9b83;min-width:0;min-height:clamp(194px,32dvh,270px);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:17px 9px 15px;border:2px solid var(--accent);border-radius:16px;background:#ecf3e9;box-shadow:0 9px 15px #1d3f3c16;box-sizing:border-box}
.hgb-fighter.enemy{--accent:#ad8c68;background:#f7eee3}
.hgb-fighter-header{display:flex;flex-wrap:wrap;gap:3px;align-items:center;justify-content:center;line-height:1.3;font-size:9px;font-weight:900;letter-spacing:.09em;color:#587668}
.hgb-fighter.enemy .hgb-fighter-header{color:#a07756}
.hgb-fighter-header small{font-size:10px;color:#986e3e}
.hgb-glyph{font-family:"Noto Sans SC","PingFang SC","Microsoft YaHei","Source Han Sans SC",sans-serif;font-weight:800;font-size:clamp(27px,8vw,42px);line-height:1.3;word-break:break-word;overflow-wrap:anywhere;color:#265c50}
.hgb-fighter.enemy .hgb-glyph{color:#9a6549}
.hgb-pinyin{font-size:12px;color:#567970;line-height:1.4;max-height:38px;overflow:hidden}
.hgb-meaning{font-size:10px;line-height:1.45;color:#6e837e;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}
.hgb-versus{font:italic 700 13px Georgia,serif;color:#b78743}
.hgb-round-outcome{margin:21px auto 12px;display:flex;flex-direction:column;gap:6px;min-height:70px;justify-content:center;padding:7px 24px;border-radius:12px;background:#eff1e9;color:#6d8077;width:min(290px,100%);box-sizing:border-box}
.hgb-round-outcome strong{font-size:23px;letter-spacing:.04em}
.hgb-round-outcome span{font-size:12px;font-variant-numeric:tabular-nums}
.hgb-round-outcome.win{background:#e0f1df;color:#2b7955;animation:hgb-impact .34s ease}
.hgb-round-outcome.lose{background:#f8e9e2;color:#ad6851;animation:hgb-impact .34s ease}
.hgb-round-marks{display:flex;justify-content:center;gap:8px}
.hgb-round-marks span{display:grid;place-items:center;width:25px;height:25px;border-radius:50%;font-weight:900;font-size:13px;color:#8a988e;background:#e7eae2}
.hgb-round-marks span.current{background:#f4dcad;color:#906c2a}
.hgb-round-marks span.won{background:#83b69a;color:#fff}
.hgb-round-marks span.lost{background:#d5a18e;color:#fff}
.hgb-action{display:flex;justify-content:center;gap:9px;width:100%;margin-top:auto;padding-top:18px}
.hgb-action button{min-height:47px;border-radius:11px;padding:11px 14px;font-size:14px!important;font-weight:850!important}
.hgb-primary{border:none;color:#fff8e8;background:#b47b3a;flex:1}
.hgb-primary:hover{background:#a16b32}
.hgb-secondary{background:#fffdf6;border:1px solid #aac5b5;color:#2f6658;flex:0 0 38%}
.hgb-finale-icon{font-size:38px;color:#d6a052}
.hgb-finish h2{font-family:Georgia,serif;letter-spacing:-.045em;font-size:clamp(34px,8vw,47px);margin:8px 0 2px;line-height:1.12;color:#22544c}
.hgb-finish.defeat h2{color:#a3644b}
.hgb-finish>p{font-size:13px;color:#6a8075;margin:8px 0 14px;line-height:1.5}
.hgb-round-recap{display:flex;flex-direction:column;width:100%;gap:6px;max-height:36dvh;overflow-y:auto}
.hgb-round-recap>div{display:grid;grid-template-columns:22px 1fr 83px 1fr 38px;gap:5px;align-items:center;padding:9px 6px;background:#f0f0e9;border-radius:8px}
.hgb-round-recap>div>span{font-size:10px;color:#748378;font-variant-numeric:tabular-nums}
.hgb-round-recap strong{font:750 15px/1.4 "Noto Sans SC","PingFang SC","Microsoft YaHei",sans-serif;color:#345e56;min-width:0;word-break:break-word}
.hgb-round-recap b{font-size:10px;letter-spacing:.05em;color:#377b57}.hgb-round-recap b.bad{color:#b86a54}
.hgb-reward{border:1px solid #dcc392;border-radius:13px;background:#f9edcf;padding:13px 17px;width:100%;box-sizing:border-box;margin-top:15px;display:flex;justify-content:space-between;align-items:center;gap:15px}
.hgb-reward span{font-size:11px;font-weight:900;color:#826b43;text-transform:uppercase}
.hgb-reward strong{font-size:15px;color:#9d7136}
.hgb-final-actions{padding-top:15px}
.hgb-close-text{margin:9px auto 0;border:0;background:transparent;color:#647b70;text-decoration:underline;padding:5px;font-size:12px!important}
.hgb-raid .hgb-boss-card{width:100%;display:flex;flex-direction:column;align-items:center;padding:18px;border:2px solid #bb9251;background:radial-gradient(circle at 50% 20%,#496e60,#1c3945 70%);color:#e2c98c;border-radius:17px;margin:14px 0;box-sizing:border-box;gap:6px;min-height:170px}
.hgb-boss-card small{letter-spacing:.16em;font-size:10px;font-weight:900}
.hgb-boss-card>div{font:750 52px/1.2 "Noto Sans SC","PingFang SC","Microsoft YaHei","Source Han Sans SC",sans-serif;color:#f6d49b}
.hgb-boss-card strong{font-size:13px;color:#c8d2c2}
.hgb-boss-card p{font-size:11px;color:#d1dbce;margin:0;line-height:1.4}
.hgb-boss-card span{font-size:12px;color:#f8d6a5}
.hgb-raid h2{font:23px Georgia,serif;color:#31574f;margin:8px 0 16px}
.hgb-charge{width:100%;height:13px;border-radius:10px;background:#d8e2d5;overflow:hidden}
.hgb-charge>span{display:block;height:100%;background:linear-gradient(90deg,#4d977e,#d4ad59);border-radius:10px;transition:width .28s ease}
.hgb-caption{font-size:12px;color:#62756a}
.hgb-raid-roster{display:flex;flex-wrap:wrap;justify-content:center;gap:6px}
.hgb-raid-roster span{font:650 14px "Noto Sans SC","PingFang SC","Microsoft YaHei",sans-serif;border-radius:8px;padding:6px 8px;background:#e0e6dc;color:#8d9a90}
.hgb-raid-roster span.powered{color:#2b6652;background:#d5eadb}
.hgb-raid-compare{display:grid;grid-template-columns:1fr 28px 1fr;align-items:center;width:100%;gap:6px;padding:13px 0}
.hgb-raid-compare>div{display:flex;flex-direction:column;align-items:center;padding:17px;background:#e8efe7;border-radius:10px;gap:8px}
.hgb-raid-compare>div span{font-size:12px;color:#687d71}
.hgb-raid-compare strong{font-size:30px;color:#265c4d;font-variant-numeric:tabular-nums}
.hgb-comparison{font:italic 15px Georgia,serif;color:#ae8853}
@keyframes hgb-impact{from{transform:scale(.94);opacity:.3}to{transform:scale(1);opacity:1}}
@media(max-width:520px){.hgb-overlay{padding:6px;padding-top:max(6px,env(safe-area-inset-top));padding-bottom:max(6px,env(safe-area-inset-bottom))}.hgb-panel{max-height:calc(100dvh - 12px - env(safe-area-inset-top) - env(safe-area-inset-bottom));border-radius:17px}.hgb-content{padding:14px 12px 13px}.hgb-round-head{margin:10px 0 12px}.hgb-fighter{padding:12px 6px;min-height:clamp(175px,31dvh,240px)}.hgb-round-outcome{margin:16px 0 9px;min-height:58px}.hgb-round-recap>div{grid-template-columns:18px 1fr 66px 1fr 32px;gap:3px;padding:8px 4px}.hgb-round-recap strong{font-size:13px}.hgb-action{padding-top:12px}.hgb-raid .hgb-boss-card{min-height:146px}}
@media(max-height:640px){.hgb-fighter{min-height:160px}.hgb-content{padding-top:10px;padding-bottom:8px}.hgb-round-outcome{margin:9px 0}.hgb-round-recap{max-height:25dvh}.hgb-top{min-height:40px;padding:7px 15px}.hgb-raid .hgb-boss-card{min-height:125px;margin:7px 0}}
@media(prefers-reduced-motion:reduce){.hgb-round-outcome,.hgb-charge>span{animation:none!important;transition:none!important}}
