/* Every upper control is anchored to the same player panel. */
#hud .battle-console{width:1280px;grid-template-columns:242px 168px minmax(0,1fr) 156px}
@media(min-width:1101px){
 #hud .battle-console{left:max(322px,calc((100vw / var(--battle-ui-scale) - 1280px) / 2));right:auto;transform:none;width:min(1280px,calc(100vw / var(--battle-ui-scale) - 460px))}
}
#hud .battle-console>.hero-attributes{grid-column:2;grid-row:1;display:grid;grid-template-columns:1fr;align-content:center;gap:10px;padding:10px 8px;border-right:1px solid #596043}
#hud .battle-console>.hero-attributes button{min-height:46px;gap:8px;padding:4px;border:0;background:transparent;box-shadow:none}
#hud .battle-console>.hero-attributes span{font-size:12px}
#hud .battle-console>.hero-attributes b{font-size:16px}
#hud .battle-console>.hero-info{justify-content:center}
#hud .battle-console>.build-slots{grid-column:3}
#hud .battle-console>.inventory{grid-column:4}
#hud .battle-console .attribute-values{display:flex;align-items:baseline;gap:8px;flex:1;min-width:0;font-variant-numeric:tabular-nums}
#hud .battle-console .attribute-total{color:#f2f1e9;min-width:0;white-space:nowrap}
.attribute-symbol{width:25px;height:25px;flex:none;color:#e4b397}
[data-attribute-detail=agility] .attribute-symbol{color:#b6d99a}
[data-attribute-detail=intelligence] .attribute-symbol{color:#9cc7ea}
#hud .battle-console>.shortcut-reminders{left:auto;right:calc(100% + 12px);bottom:12px;width:126px;zoom:1;font-size:13px;gap:9px}
#hud .battle-console>.shortcut-reminders>#auxiliary-dash-action{margin-top:0}
#hud .battle-console>.shortcut-hints{position:absolute;left:calc(100% + 12px);bottom:82px;width:126px;display:grid;gap:9px;zoom:1;color:#e1dfbc;font-size:13px;line-height:21px;text-shadow:0 1px 3px #000,0 0 5px #000;pointer-events:none}
.shortcut-hints>span{white-space:nowrap}
#hud .battle-console>.challenge-tools{left:0;right:auto;top:auto;width:328px;max-width:none;zoom:1}
#hud .battle-console #challenge-row{width:100%;display:flex;flex-wrap:wrap-reverse;align-content:flex-start;gap:5px;overflow:visible}
#hud .battle-console .challenge-tools button{flex:0 0 106px;width:106px;height:64px;padding:5px 7px;font-size:13px}
#hud .battle-console .challenge-tools b{font-size:13px;line-height:17px}
#hud .battle-console .challenge-tools small,#hud .battle-console #challenge-button span{font-size:10px;line-height:13px;margin-top:3px}
#hud .battle-console .challenge-tools small{font-size:9px;white-space:nowrap}
#hud .battle-console .challenge-tools .challenge-scroll{display:none}
#hud .battle-console .challenge-teaser{white-space:normal;width:346px;font-size:11px;line-height:16px;bottom:calc(100% + 6px)}
#hud .battle-console>#hero-status-strip{left:50%;width:240px;align-content:flex-start;align-items:flex-end}
#hud .battle-console>.right-tools{left:auto;right:0;top:auto;width:198px;gap:6px;zoom:1;align-items:flex-end}
#hud .battle-console>.right-tools>button{flex:1 1 96px;height:96px}
#hud .battle-console>:is(.challenge-tools,.right-tools,#hero-status-strip){bottom:calc(100% + 12px);padding:0;min-height:0;border:0;border-radius:0;background:none;box-shadow:none}




#hud .battle-console>.hud-side-tools{position:absolute;left:calc(100% + 8px);top:auto;bottom:0;width:64px;display:flex;flex-direction:column;gap:6px;pointer-events:none}
#hud .battle-console>.hud-side-tools button{pointer-events:auto}
#hud .battle-console .hud-side-tools #bond-view-button{width:64px;min-height:70px}
#special-resource-strip{display:flex;flex-direction:column;align-items:center;gap:6px;pointer-events:none}
#special-resource-strip .hero-status-icon{width:54px;height:44px;flex:none;pointer-events:auto}
#special-resource-strip .hero-status-tip{left:auto;right:calc(100% + 8px);bottom:0;transform:none}
/* Notices own a layer above controls and reserve space above the whole dock. */
#hud>#toast,#hud>#mode-hint{z-index:9500;top:auto;left:50%;right:auto;width:max-content;max-width:min(560px,calc(100vw - 24px));box-sizing:border-box;white-space:normal;overflow-wrap:anywhere;pointer-events:none}
#hud .battle-console>#hero-status-strip:has(.hero-status-icon:is(:hover,:focus-visible,.pointer-hover)){z-index:100}
#hud .battle-console>#hero-status-strip .hero-status-tip{position:fixed;bottom:calc(100% + 9px);z-index:100}
@media(max-width:1100px){
 #hud .battle-console{left:auto;right:150px;transform:none;width:calc(100vw / var(--battle-ui-scale) - 296px);grid-template-columns:190px 150px minmax(0,1fr) 126px}
 #hud .battle-console>.shortcut-reminders{right:calc(100% + 6px);width:138px}
 #hud .battle-console>.hud-side-tools{left:auto;right:0;top:auto;bottom:calc(100% + 110px)}
 #hud .battle-console>.challenge-tools,#hud .battle-console .challenge-teaser{width:217px}
 #hud .battle-console>#hero-status-strip{left:52%}
}
/* The action row is shared across card, hero and body-growth choices. */
body #draw-dialog .draw-footer,body #evolution-dialog .draw-footer,body #upgrade-dialog .choice-actions{display:flex;justify-content:center;align-items:flex-start;gap:12px;margin:20px 0 0;padding:0;width:100%}
body :is(#draw-dialog,#evolution-dialog,#upgrade-dialog) :is(#refresh-draw,#giveup-draw,#fold-draw,#refresh-hero,#fold-hero,#fold-upgrade){position:static;inset:auto;display:inline-flex;align-items:center;justify-content:center;gap:4px;flex:0 0 144px;width:144px;min-width:144px;max-width:144px;height:40px;min-height:40px;margin:0;padding:8px 12px;border:1px solid #a6976b;border-radius:4px;background:linear-gradient(#34443a,#19271f);box-shadow:inset 0 0 0 2px #111c1880;color:#efe5c9;font:14px/20px 'Microsoft YaHei',sans-serif;letter-spacing:1px}
body #draw-dialog .draw-giveup{flex:0 0 144px;width:144px}
body :is(#draw-dialog,#evolution-dialog,#upgrade-dialog) :is(#refresh-draw,#giveup-draw,#fold-draw,#refresh-hero,#fold-hero,#fold-upgrade):is(:hover,:focus-visible){border-color:#e6c981;background:linear-gradient(#455b48,#24372a)}
body :is(#draw-dialog,#evolution-dialog,#upgrade-dialog) :is(#refresh-draw,#giveup-draw,#fold-draw,#refresh-hero,#fold-hero,#fold-upgrade):disabled{opacity:.45;cursor:default;filter:none}

/* Live theme progress sits inside the upper-left safe margin; navigation stays
   beside the player panel. The cluster has no enclosing background panel. */
#hud>#theme-growth-hud{position:absolute;left:clamp(40px,4vw,88px);right:auto;top:clamp(84px,12vh,132px);display:flex;flex-direction:column;align-items:flex-start;gap:14px;width:252px;zoom:var(--battle-ui-scale);z-index:30;pointer-events:none}
#theme-bond-progress{display:flex;flex-direction:column;gap:10px;width:100%}
#theme-bond-progress[hidden],#theme-growth-hud #special-resource-strip[hidden]{display:none}
.theme-progress-entry{position:relative;display:flex;align-items:center;gap:9px;width:100%;min-height:46px;color:#e4e7ce;text-shadow:0 1px 3px #000;pointer-events:auto;cursor:help;outline:none}
.theme-progress-entry>img{width:42px;height:42px;box-sizing:border-box;object-fit:cover;border:1px solid #a7b576;border-radius:3px;box-shadow:0 2px 5px #0008}
.theme-progress-copy{flex:1;min-width:0}.theme-progress-copy>strong{display:block;font-size:14px;line-height:20px;color:#eed99e;letter-spacing:1px}
.theme-progress-entry[data-theme="summon"] .theme-progress-copy>div{white-space:normal}
.theme-progress-benefit{display:block;margin-top:4px;font-size:11px;line-height:16px;color:#d7e4be;overflow-wrap:anywhere}
.theme-progress-entry[data-theme="summon"]>.hero-status-tip{white-space:pre-line}
.theme-progress-copy>div{display:flex;align-items:baseline;justify-content:space-between;gap:6px;font-size:11px;line-height:18px;white-space:nowrap}.theme-progress-copy b{font-size:12px;font-variant-numeric:tabular-nums;color:#e8efd7}
.theme-progress-track{display:block;box-sizing:content-box;height:5px;margin-top:3px;padding:0;border:0;box-shadow:0 0 0 1px #83927560;background:#101c15d9;border-radius:2px;overflow:hidden}.theme-progress-track>i{display:block;height:100%;background:#c4ce8a;transition:width .25s ease}
#theme-growth-hud #special-resource-strip{flex-direction:row;flex-wrap:wrap;justify-content:flex-start;gap:6px;max-width:252px}
#theme-growth-hud #special-resource-strip .hero-status-icon{width:80px;height:42px;padding:4px 3px 4px 4px;display:flex;align-items:center;gap:5px;border:0;background:#14251b66;box-shadow:none;border-radius:3px;margin-bottom:17px}
#theme-growth-hud #special-resource-strip .hero-status-icon>img{width:28px;height:28px;flex:none;border:1px solid #a7b57680}
#theme-growth-hud #special-resource-strip .hero-status-icon>b{position:static;padding:0;background:none;font-size:12px;line-height:16px;overflow:visible}
#theme-growth-hud #special-resource-strip .hero-status-icon:after{content:attr(data-name);position:absolute;top:calc(100% + 2px);left:0;right:0;text-align:center;font-size:11px;line-height:15px;color:#d1d9ba;text-shadow:0 1px 3px #000}
#theme-growth-hud .hero-status-tip{top:0;bottom:auto;left:calc(100% + 12px);right:auto;transform:none;width:252px;max-width:calc(100vw - 320px);font-size:12px;line-height:1.65;z-index:100}
.theme-progress-entry:is(:hover,:focus-visible,.pointer-hover)>.hero-status-tip{display:block}
.theme-progress-entry:focus-visible>img{outline:2px solid #eed99e;outline-offset:2px}
.theme-progress-entry.summon-growth-entry{width:56px;min-height:56px;height:56px;display:block}
.summon-growth-entry>img{width:56px;height:56px;border-color:#b6bc83}
.summon-growth-level{position:absolute;top:1px;right:1px;padding:1px 4px;border-radius:0 2px 0 3px;background:#101c18e8;color:#fff0bf;font:700 12px/17px sans-serif;pointer-events:none}
.summon-growth-entry>.theme-progress-track{position:absolute;left:3px;right:3px;bottom:3px;height:5px;margin:0;background:#09110ef0;box-shadow:0 0 0 1px #000a;pointer-events:none}
.summon-growth-entry>.theme-progress-track>i{background:linear-gradient(90deg,#78b985,#d2e69c)}
#theme-growth-hud .summon-growth-entry>.hero-status-tip{width:370px;max-width:calc(100vw - 140px);white-space:normal;line-height:1.5}
.summon-growth-experience,.summon-growth-base,.summon-growth-rewards{display:block}
.summon-growth-experience{color:#f3df9a;font-variant-numeric:tabular-nums}
.summon-growth-base{margin-top:4px;color:#b5c6ad;font-size:11px}
.summon-growth-rewards{margin-top:9px;border-top:1px solid #82907355;padding-top:5px}
.summon-growth-reward{display:grid;grid-template-columns:38px 1fr;gap:7px;padding:4px 0;color:#c4cebe}
.summon-growth-reward>b{color:#e7d6a0;font-size:11px;white-space:nowrap}
.summon-growth-reward.is-earned{color:#a0dcb0}.summon-growth-reward.is-earned>b{color:#a0dcb0}
@media(max-width:1100px){#hud>#theme-growth-hud{left:36px;top:90px;width:216px}}
.card-slots>.pending-card-slot{bottom:0;height:100%;z-index:4}
