/* 《根深蒂固》 V1.6.6ab3: bond HUD and flowing layer-gain popups. */
.rooted-bonds{display:none}
.legion-game.mode-formal .rooted-bonds:not([hidden]){
 position:absolute;z-index:27;left:50%;top:123px;transform:translateX(-50%);
 width:min(680px,calc(100vw - 24px));display:flex;flex-direction:column;align-items:center;
 pointer-events:none;color:#e9f9f4;font-family:'Microsoft YaHei','Segoe UI',sans-serif;
}
.legion-game.mode-formal .rooted-bond-strip{
 display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:center;gap:7px;max-width:100%;min-height:64px;
 /* The orb glow and hover lift MUST NOT be cropped by an invisible scroll rectangle.
    Wrap on very narrow screens instead of creating a clipped horizontal scroller. */
 overflow:visible;
 pointer-events:auto;padding:2px 5px 4px;
}
.legion-game.mode-formal .rooted-bond{flex:none;display:flex;flex-direction:column;align-items:center;gap:3px;
 border:0;background:transparent;color:#b4c7c8;cursor:pointer;padding:0 2px;font-family:inherit;font-weight:600;font-size:10px;line-height:1.1;
 -webkit-tap-highlight-color:transparent;outline-offset:2px;}
.rooted-bond-orb{display:grid;place-items:center;position:relative;width:47px;height:47px;border-radius:50%;
 background:radial-gradient(circle at 40% 28%,#334a4e,#151f28 72%);border:2px solid #4d6065;
 box-shadow:inset 0 0 0 3px #060f17d9,0 2px 10px #000a;transition:transform .15s,box-shadow .15s,border-color .15s;}
.rooted-icon{display:inline-grid;place-items:center;width:24px;height:24px;color:inherit;line-height:0}
.rooted-icon svg{width:100%;height:100%;overflow:visible}
.rooted-bond .rooted-icon{width:24px;height:24px;color:#a8b6bb}
.rooted-bond.is-inactive .rooted-icon{filter:grayscale(1);opacity:.75}
.rooted-bond.is-active .rooted-bond-orb{border-color:#7cdbca;
 background:radial-gradient(circle at 40% 25%,#57b2a3,#15585f 64%,#082b35);
 box-shadow:inset 0 0 0 3px #07282fe0,0 0 0 1px #a8e5d794,0 0 16px #55e6d27b;}
.rooted-bond.is-active .rooted-icon{color:#e2fff5;filter:drop-shadow(0 0 5px #b2fff2a0)}
.rooted-bond.is-advanced .rooted-bond-orb{border-color:#eac78b;box-shadow:inset 0 0 0 3px #07282fe0,0 0 0 1px #e4bc7c,0 0 17px #f3d29c78}
.rooted-bond.is-advanced .rooted-icon{color:#e2fff5} /* Gold belongs ONLY to the outer border. */
/* The commander core uses the same teal active center as every other bond. */
.rooted-bond-orb .rooted-bond-count{position:absolute;right:-7px;top:-7px;z-index:2;min-width:28px;
 padding:2px 3px;border:1px solid #638183;border-radius:3px;background:#101a21ec;color:#e4f0ec;
 font:bold 9px/1.1 Consolas,monospace;letter-spacing:-.35px;white-space:nowrap;}
.rooted-bond-orb .rooted-bond-layers{position:absolute;bottom:-8px;left:50%;transform:translateX(-50%);
 border:1px solid #6d9a91;background:#0c1c22ed;border-radius:3px;min-width:24px;padding:1px 4px;
 color:#c8fff0;text-align:center;font:bold 11px/1.25 Consolas,monospace;white-space:nowrap;}
.rooted-bond-name{margin-top:5px;color:#bdced1;font-size:10px;white-space:nowrap;text-shadow:0 1px 3px #000f}
.rooted-bond.is-active .rooted-bond-name{color:#baf5e8}
.rooted-bond:hover:not(.is-selected) .rooted-bond-orb{transform:translateY(-1px);filter:brightness(1.10)}
/* White halo signals an OPEN detail (or keyboard focus), not mere mouse hover. */
.rooted-bond:is(:focus-visible,.is-selected) .rooted-bond-orb{transform:translateY(-2px);box-shadow:0 0 0 2px #e8fcf1,0 0 22px #67f6d2a3,inset 0 0 0 3px #07313c}
.rooted-bond:focus-visible{outline:2px solid #e8fcf1}
.rooted-bond-detail{pointer-events:auto;position:relative;margin-top:6px;width:min(480px,calc(100vw - 32px));max-height:min(61vh,560px);
 color:#e0ece7;background:linear-gradient(145deg,#111f22f4,#101820f7);border:1px solid #7ab6a7;
 box-shadow:0 14px 38px #000c,0 0 0 1px #071414;display:flex;flex-direction:column;overflow:hidden;}
.rooted-bond-detail[hidden]{display:none!important}
.rooted-detail-head{display:flex;gap:13px;align-items:center;flex:none;padding:15px 16px 12px;border-bottom:1px solid #43675c;background:linear-gradient(90deg,#1b4444,#16262b)}
.rooted-detail-head>.rooted-icon{width:46px;height:46px;color:#8ce0cc;background:#205a58;border:2px solid #7de0c5;border-radius:50%;padding:8px}
.rooted-detail-title{flex:1;display:flex;flex-direction:column;gap:4px}
.rooted-detail-title small{font:600 10px Consolas,monospace;letter-spacing:1.6px;color:#86c1b5}
.rooted-detail-title strong{font-size:25px;letter-spacing:2px;color:#f8fffc}
.legion-game.mode-formal .rooted-detail-close{appearance:none;width:31px;height:31px;padding:0;border:1px solid #63837d;background:#0c1b20;color:#a7c4c3;font:25px/1 sans-serif;cursor:pointer}
.legion-game.mode-formal .rooted-detail-close:hover{border-color:#c4f7e4;color:white}
.rooted-detail-status{flex:none;display:flex;flex-wrap:wrap;align-items:baseline;gap:9px;padding:9px 16px;background:#0d2928;border-bottom:1px solid #31534b}
.rooted-detail-status b{color:#80e3c7;font-size:14px}.rooted-detail-status span{color:#b6cfc8;font-size:11px}
.rooted-detail-scroll{overflow-y:auto;overscroll-behavior:contain;padding:5px 16px 14px;scrollbar-color:#4c8883 #13272c;line-height:1.6}
.rooted-detail-scroll h4{font-size:12px;color:#8ce8d0;margin:12px 0 4px}
.rooted-detail-scroll p{font-size:11px;color:#ccdcd5;margin:3px 0 9px}
.rooted-detail-tier{display:flex;flex-direction:column;gap:3px;border-left:2px solid #56726c;padding:5px 8px;margin:5px 0;background:#1c2a2e}
.rooted-detail-tier b{font-size:11px;color:#d9efdf}.rooted-detail-tier span{font-size:10px;color:#b0c5be}
.rooted-detail-tier.is-current{border-color:#e4bc74;background:#393127}
/* The reference game's grammar: faction/tag in brackets, effect values in blue,
   and explanatory notes in muted gray. All values are refreshed from live state. */
.rooted-description{line-height:1.7;overflow-wrap:anywhere}
.rooted-description-value,.rooted-live-number{color:#6ecdf4;font-weight:750;font-style:normal;font-variant-numeric:tabular-nums}
.rooted-description-tag{color:#e5f6ee;font-weight:700;white-space:nowrap}
.rooted-description-note{color:#869ba2;font-weight:400}
.rooted-detail-scroll .rooted-description{font-size:11px;margin:5px 0 9px}
.rooted-detail-tier .rooted-description{font-size:10px;margin:2px 0}
.rooted-detail-status .rooted-live-number{font-size:12px}
.rooted-detail-scroll .rooted-detail-concept{color:#bdced2}
.rooted-detail-scroll .rooted-detail-pending{color:#eac58b;border:1px solid #806947;padding:6px 8px;background:#3c3325}
.rooted-detail-members{border-top:1px solid #37534c;margin-top:13px;padding-top:2px}
.rooted-member-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(64px,1fr));gap:6px;max-height:280px;overflow-y:auto}
.rooted-member{position:relative;min-width:0;display:flex;flex-direction:column;gap:3px;text-align:center;opacity:.42;filter:grayscale(1)}
.rooted-member.is-deployed{opacity:1;filter:none}
.rooted-member-portrait{height:62px;border:1px solid #526d6c;background:#25383b;display:grid;place-items:center;overflow:hidden}
.rooted-member.is-deployed .rooted-member-portrait{border-color:#8ce9cf;box-shadow:inset 0 0 7px #4ad4a955}
.rooted-member-portrait img{width:100%;height:100%;object-fit:contain}
.rooted-member-portrait span{font-size:22px;color:#a4c7c3}
.rooted-member small{display:block;font-size:9px;line-height:1.25;color:#d1e1dc;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.rooted-member-count{position:absolute;right:2px;top:2px;padding:2px 3px;font:10px Consolas,monospace;color:#0c1b1a;background:#9aeacc}
.rooted-empty{grid-column:1/-1}
.legion-game.mode-formal .terra-progression-panel{display:none!important} /* Debug market retains the original ledger. */
.legion-game.mode-formal.duel-active .formal-duel-toggle:not([hidden]){top:207px}
.legion-game.mode-formal.duel-active .duel-overlay{top:243px!important}
@media(max-width:1050px){
 .legion-game.mode-formal .rooted-bonds:not([hidden]){top:113px}
 .rooted-bond-orb{width:41px;height:41px}
 .rooted-bond .rooted-icon{width:22px;height:22px}
 .legion-game.mode-formal .rooted-bond-strip{gap:5px;min-height:58px}
}
@media(max-width:720px){
 .legion-game.mode-formal .rooted-bonds:not([hidden]){top:95px}
 .rooted-bond-orb{width:37px;height:37px}
 .rooted-bond .rooted-icon{width:19px;height:19px}
 .rooted-bond-orb .rooted-bond-count{font-size:8px;right:-4px;top:-6px}
 .rooted-bond-orb .rooted-bond-layers{font-size:9px;bottom:-6px}
 .rooted-bond-name{font-size:9px}
 .legion-game.mode-formal .rooted-bond-strip{gap:2px;min-height:54px}
 .legion-game.mode-formal .rooted-bond-detail{margin-top:2px;max-height:58vh}
 .rooted-detail-head{padding:10px 12px}.rooted-detail-title strong{font-size:20px}
 .legion-game.mode-formal.duel-active .formal-duel-toggle:not([hidden]){top:158px}
 .legion-game.mode-formal.duel-active .duel-overlay{top:196px!important}
}
@media(prefers-reduced-motion:reduce){.rooted-bond-orb{transition:none}}
/* Fallback on the debug inventory if the physical 3D shelf is not visible. */
.rooted-inventory-earned{position:relative;overflow:visible!important}
/* Staggered layer sparks: an actual round bond icon + unified +N text.
   No surrounding dark rectangle, no buff-specific colors. */
.rooted-inventory-gain{position:absolute;left:50%;top:-4px;z-index:6;
 display:inline-flex;align-items:center;gap:3px;white-space:nowrap;pointer-events:none;
 color:#d8fff4;font:700 11px/1 Consolas,monospace;text-shadow:0 1px 3px #031518,0 0 3px #031518;
 transform:translate(-50%,-70%);opacity:0;
 animation:rootedInventoryPop .83s ease-out var(--pop-delay,0s) both}
.rooted-inventory-gain .rooted-icon{width:19px;height:19px;box-sizing:border-box;padding:3px;border-radius:50%;
 color:#dcfff7;background:radial-gradient(circle at 40% 25%,#317e81,#10333b);
 border:1px solid #76dfce;box-shadow:0 0 6px #56d8b855}
.rooted-inventory-gain .rooted-icon svg{width:100%;height:100%}
@keyframes rootedInventoryPop{0%{opacity:0;translate:0 7px}20%{opacity:1}76%{opacity:1}100%{opacity:0;translate:0 -26px}}
@media(prefers-reduced-motion:reduce){.rooted-inventory-gain{animation-duration:.85s}}
