/* V1.6.6o – 4-card public/personal market, classification colors + level chips. */
.legion-game .recruit-switcher{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin:14px 0 6px}
.legion-game .recruit-switcher button{border:1px solid #516a70;padding:9px 4px;color:#9fb9bf;background:#152a34;cursor:pointer;font-size:11px;border-radius:5px}
.legion-game .recruit-switcher button.active{border-color:#8ee2c9;color:#d9fff4;background:#205050;box-shadow:inset 0 -2px #68bca9}
.legion-game .shop-status{font:10px/1.5 Consolas,monospace;letter-spacing:.6px;color:#a4c7bd;margin:9px 0}
.legion-game .shop-roster{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin:5px 0 11px}
.legion-game .shop-unit-card{--rarity:#657f8a;position:relative;isolation:isolate;min-width:0;min-height:174px;overflow:hidden;border:1px solid var(--rarity);border-radius:7px;background:linear-gradient(150deg,#30434b,#101e27);box-shadow:inset 0 0 1px 1px #ffffff0b,0 7px 16px #0005;display:flex;flex-direction:column}
.legion-game .shop-unit-card[data-class="elite"]{--rarity:#af86d9;background:linear-gradient(150deg,#453456,#1a1f32)}
.legion-game .shop-unit-card[data-class="leader"]{--rarity:#dbb672;background:linear-gradient(150deg,#57452f,#201b1d)}
.legion-game .shop-unit-card[data-class="special"]{--rarity:#b3394e;background:linear-gradient(150deg,#4b1b2a,#12090f)}
.legion-game .shop-unit-card.is-empty{border:1px dashed #3b5559;background:#14262c;min-height:174px;display:grid;place-items:center;color:#6d858e;font-size:12px}
.legion-game .shop-unit-card.is-selected{outline:1px solid #c2fff0;outline-offset:1px}
.legion-game .shop-card-select{display:flex;position:relative;z-index:2;flex:1;flex-direction:column;justify-content:space-between;align-items:stretch;width:100%;min-height:138px;border:0;background:transparent;text-align:left;color:#f4f7f5;padding:9px;cursor:pointer}
.legion-game .shop-card-select:disabled{cursor:not-allowed}
.legion-game .shop-card-select:focus-visible,.legion-game .shop-buy:focus-visible{outline:2px solid #baf4e7;outline-offset:-2px}
.legion-game .shop-card-head{display:flex;align-items:center;justify-content:space-between;gap:4px;font:700 10px/1.3 sans-serif;color:#e2f4ee;text-shadow:0 1px 4px #000}
.legion-game .shop-class{color:#effffb;background:#0008;border:1px solid var(--rarity);border-radius:2px;padding:2px 4px}
.legion-game .shop-level{background:#142c33d9;border:1px solid #6c9da5;padding:2px 4px;border-radius:2px}
.legion-game .shop-card-avatar{position:absolute;inset:26px 14px 46px;max-width:calc(100% - 28px);width:calc(100% - 28px);height:calc(100% - 72px);object-fit:contain;object-position:center;filter:drop-shadow(0 2px 8px #000b);pointer-events:none;opacity:.96}
.legion-game .shop-card-fullart{position:absolute;inset:0;z-index:-2;width:100%;height:100%;object-fit:cover;object-position:50% 19%;pointer-events:none;opacity:.99}
.legion-game .shop-unit-card.is-hero:after{content:'';position:absolute;z-index:-1;inset:0;pointer-events:none;background:linear-gradient(180deg,#050a0d55 0%,transparent 32%,#05090a88 63%,#060b0fe8 100%)}
.legion-game .shop-unit-card.is-hero .shop-card-info{backdrop-filter:blur(5px);background:#070a0c66;border-top:1px solid #ffffff16;margin:0 -9px -9px;padding:7px 9px 8px}
.legion-game .shop-card-info{display:flex;flex-direction:column;gap:3px;margin-top:auto;position:relative;z-index:2;text-shadow:0 1px 3px #000f}
.legion-game .shop-card-name{font-size:12px;font-weight:750;line-height:1.2;overflow-wrap:anywhere}
.legion-game .shop-card-desc{font-size:9px;line-height:1.2;color:#c4d6d6;max-height:2.5em;overflow:hidden}
/* The Inner Guard's promise must remain readable on the full-portrait card. */
.legion-game .shop-unit-card[data-class="special"] .shop-card-desc{max-height:none;overflow:visible;font-size:10px;line-height:1.4;color:#f2dee4}
.legion-game .shop-buy{z-index:3;position:relative;min-height:32px;flex-shrink:0;border:0;border-top:1px solid #ffffff24;background:#132a33ea;color:#e9d49f;font-size:11px;font-weight:700;cursor:pointer}
.legion-game .shop-buy:hover:not(:disabled){background:#27605b;color:#fff7de}
.legion-game .shop-buy:disabled{opacity:.4;cursor:not-allowed}
.legion-game .shop-details{min-height:42px;line-height:1.55;font-size:11px;color:#c3d3d3;border-left:2px solid #69b7a7;background:#101f29;padding:8px 10px}
.legion-game #shop-refresh{width:100%;border:1px solid #518d84;border-radius:4px;background:#193a40;color:#c4f0e6;opacity:1;cursor:pointer;min-height:35px}
.legion-game #shop-refresh:disabled{opacity:.4;cursor:not-allowed}
.legion-game #shop-upgrade{margin-top:12px}
.legion-game .shop-unit-card .shop-card-select:disabled{opacity:.72}
@media(min-width:1600px){.legion-game.mode-formal .shop-unit-card{min-height:202px}.legion-game.mode-formal .shop-card-select{min-height:162px}}
@media(max-width:600px){.legion-game .shop-unit-card{min-height:155px}.legion-game .shop-card-select{min-height:126px}.legion-game .shop-card-name{font-size:11px}}

/* V1.6.6p: Debug testing controls live in the primary nav, never obscure the battlefield. */
.legion-game .formal-debug-rolls{display:none;align-items:center;gap:4px}
.legion-game.mode-formal .formal-debug-rolls{display:flex}
.legion-game.mode-formal .formal-debug-rolls button{min-width:0;padding:6px 8px;font-size:10px;min-height:32px;color:#f2dda7;background:#453729;border:1px solid #b29a61;white-space:nowrap;cursor:pointer}
.legion-game.mode-formal .formal-debug-rolls button:disabled{opacity:.4;cursor:not-allowed}
.legion-game.mode-formal .formal-debug-rolls button:hover:not(:disabled){background:#6e4d30;color:#fff0c0}
@media(max-width:1050px){.legion-game.mode-formal .formal-debug-rolls button{font-size:9px;padding:5px 6px}}

/* Guard timers are diagnostic, never normal inventory-card information. */
.legion-game .guard-contract-debug{display:block;margin:8px 0;color:#c9e3de;font:11px/1.5 Consolas,monospace;overflow-wrap:anywhere;opacity:.9}

/* V1.6.6x: Both shop windows freeze independently across automatic round rolls. */
.legion-game .shop-roll-actions{display:grid;grid-template-columns:minmax(0,1fr) 86px;gap:6px}
.legion-game #shop-freeze{border:1px solid #718b93;border-radius:4px;cursor:pointer;min-height:35px;color:#bdd0d4;background:#23323b;font-weight:600}
.legion-game #shop-freeze[aria-pressed="true"]{color:#ffe7ad;border-color:#bd9f5a;background:#4c3c24}
.legion-game #shop-freeze:disabled{opacity:.45;cursor:not-allowed}
.legion-game #shop-freeze-tip{margin:4px 0 9px;font-size:10px;color:#8ca7aa}

/* 《根深蒂固》：shop tags + the player's persistent progression ledger. */
.legion-game .shop-card-tags{display:flex;flex-wrap:wrap;gap:3px;margin-top:2px}
.legion-game .shop-card-tags i{font-style:normal;font-size:8px;line-height:1.2;color:#d5eee8;background:#172e34d9;border:1px solid #6b938a;border-radius:3px;padding:2px 4px}
.legion-game .shop-card-trait{font-size:9px;line-height:1.25;color:#f2b36c}
.legion-game .inventory-trait-tags{display:block;color:#e9b474;font-size:9px;line-height:1.2;text-align:center}
.legion-game .terra-progression-panel{margin:10px 0 12px;padding:9px;border:1px solid #647e75;border-radius:6px;background:linear-gradient(145deg,#1b3033,#111f29);color:#dbe9e4}
.legion-game .terra-progression-panel-head{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:7px}
.legion-game .terra-progression-panel-head strong{font-size:10px;letter-spacing:1px;color:#d5e8df}
.legion-game .terra-progression-panel-head small{font-size:9px;color:#8fa9a5}
.legion-game .terra-core-progression{padding:7px 8px;margin-bottom:7px;border-left:2px solid #d5a45f;background:#253337}
.legion-game .terra-progression-core-head{display:flex;justify-content:space-between;gap:6px;align-items:center}
.legion-game .terra-progression-core-head strong{font-size:11px;color:#f1d3a0}
.legion-game .terra-progression-core-head b{font-size:10px;color:#efb66d;white-space:nowrap}
.legion-game .terra-core-progression>small{display:block;margin-top:4px;color:#9fb6b2;font-size:9px}
.legion-game .terra-small-progression{display:grid;grid-template-columns:1fr 1fr;gap:4px}
.legion-game .terra-progression-item{display:flex;align-items:center;justify-content:space-between;gap:4px;min-width:0;padding:5px 6px;border:1px solid #435b5d;border-radius:3px;background:#18292f;font-size:9px}
.legion-game .terra-progression-item strong{color:#cbdad4;font-size:9px}
.legion-game .terra-progression-item span{color:#8fa8a5;font-size:8px;white-space:nowrap}
.legion-game .terra-progression-item b{color:#e7b878;font-size:9px;white-space:nowrap}
.legion-game .terra-progression-item.is-active{border-color:#8b9f70;background:#28392f}
.legion-game .terra-progression-item.is-active span{color:#b5d98b}
.legion-game .terra-progression-item.is-advanced{border-color:#c59b5f;background:#3a3025}
.legion-game .terra-progression-item.is-advanced span{color:#f0c47e}
.legion-game .terra-special-progression{margin-top:5px}
.legion-game .terra-progression-note{display:block;margin-top:6px;color:#829b9a;font-size:8px;line-height:1.4}
.legion-game .terra-progression-panel[data-frozen="true"] .terra-progression-panel-head:after{content:'LOCKED';color:#e0b875;font:8px Consolas,monospace;letter-spacing:1px}

/* V1.6.6ab4: tags are the only progression metadata on the shop card. */
.legion-game .shop-card-tags{gap:5px;margin-top:5px}
.legion-game .shop-card-tags i{font-size:11px;font-weight:700;line-height:1.25;padding:3px 7px;border-radius:4px}
.legion-game .shop-details .shop-detail-unit-name{display:block;color:#f1f9ef;font-size:13px;margin-bottom:5px}
.legion-game .shop-details .shop-detail-tags{margin:3px 0 7px}
.legion-game .shop-details p{margin:5px 0;line-height:1.5}
.legion-game .shop-detail-ability{color:#b5d8ed}
.legion-game .shop-detail-trait{color:#d6c4a8}
.legion-game .shop-detail-trait b{color:#ffbb78;margin-right:5px}
