/* The Commander's Legacy Infantry Set (Gage 11-03, js/legacy-set.js): one tile in the Locker's Infantry area and the Legacy
   sheet, and the viewer it opens (the fully equipped soldier pinned beside a selector of each piece's own picture).
   Gunmetal, platinum and brass, like the rest of the Legacy set. */

/* ---- the Locker's one tile ---- */
.inf-legacy { position: relative; display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; min-height: 76px; padding: 6px 10px 6px 6px; text-align: left; color: #e7e9ec; cursor: pointer;
  background: linear-gradient(135deg, #2b323a, #0d1013 70%) padding-box, linear-gradient(135deg, #f1dc9c, #7a5b25, #e3e8ee) border-box; border: 2px solid transparent; box-shadow: inset 0 0 0 2px #090b0d, 0 4px 10px -6px #000; }
.inf-legacy:active { transform: translateY(1px); }
.inf-legacy:focus-visible { outline: 2px solid #f1dc9c; outline-offset: 2px; }
.inf-legacy-pic { display: grid; place-items: center; height: 66px; background: radial-gradient(ellipse at 50% 60%, #6c7a8840, transparent 70%); border: 1px solid #c39b5255; }
.inf-legacy-pic img { width: 100%; height: 66px; object-fit: contain; }
.inf-legacy-text { display: grid; gap: 1px; min-width: 0; }
.inf-legacy-text small { font: 11px var(--display); letter-spacing: .1em; text-transform: uppercase; color: #d9b874; }
.inf-legacy-text b { font: 400 19px/1.05 var(--display); text-transform: uppercase; color: #f4f6f8; }
.inf-legacy-text em { font-style: normal; font-size: 11px; color: #b8c0c7; }
.inf-legacy-state { display: inline-flex; align-items: center; gap: 4px; padding: 3px 7px; font: normal 12px var(--display); text-transform: uppercase; color: #1a1305; background: linear-gradient(180deg, #f5e3ae, #c39b52); border: 1px solid #5b3f0c; white-space: nowrap; }
.inf-legacy:not(.owned) .inf-legacy-state { color: #e3e8ee; background: #11151a; border-color: #8a96a2; }
.inf-legacy-state .wi { width: 13px; height: 13px; }

/* ---- the viewer ---- */
.sheet-box.legacy-set { position: relative; width: min(760px, 100%); max-height: calc(100dvh - max(16px, env(safe-area-inset-top)) - max(16px, env(safe-area-inset-bottom))); padding: 14px; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 10px; overflow: hidden; text-align: left; color: #e7e9ec;
  background: linear-gradient(160deg, #262d34, #0b0d10 70%) padding-box, linear-gradient(135deg, #f1dc9c, #6f5221, #e3e8ee, #6f5221) border-box; border: 2px solid transparent; }
.legacy-set > .sheet-x { position: absolute; top: 12px; right: 12px; float: none; margin: 0; }
.ls-head { padding: 0 42px 0 0; }
.ls-head h2 { margin: 4px 0 2px; font-size: clamp(21px, 5vw, 29px); color: #f4f6f8; }
.ls-head > span { font-size: 11px; color: #c9c1ad; }
.ls-body { min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 10px; }
.ls-stage { position: relative; height: clamp(190px, 34dvh, 330px); overflow: hidden; border: 1px solid #8a96a2;
  background: radial-gradient(ellipse at 50% 40%, #56636f55, transparent 70%), repeating-linear-gradient(0deg, transparent 0 23px, #bdc5cb0b 24px), repeating-linear-gradient(90deg, transparent 0 23px, #bdc5cb0b 24px), #101418; box-shadow: inset 0 0 0 2px #07090b; }
.ls-stage canvas { display: block; width: 100%; height: 100%; touch-action: pan-y; cursor: grab; }
.ls-stage canvas:active { cursor: grabbing; }
.ls-badge { position: absolute; top: 8px; left: 8px; max-width: calc(100% - 160px); padding: 2px 8px; background: #000b; border: 1px solid #c39b52aa; color: #f1dc9c; font: 400 15px var(--display); text-transform: uppercase; letter-spacing: .05em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ls-drag { position: absolute; left: 10px; bottom: 10px; color: #c8ced3aa; font-size: 10px; text-transform: uppercase; letter-spacing: .14em; pointer-events: none; }
.ls-step { position: absolute; right: 8px; top: 8px; display: flex; align-items: center; gap: 6px; }
.ls-step .btn { min-width: 44px; min-height: 44px; margin: 0; padding: 0 8px; font-size: 22px; line-height: 1; }
.ls-step span { min-width: 40px; text-align: center; font: 13px var(--display); color: #e3e8ee; text-shadow: 0 1px 2px #000; }
.ls-side { min-height: 0; overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; display: flex; flex-direction: column; gap: 8px; }
.ls-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.ls-mode button { min-height: 40px; color: #c8ced3; background: #15191d; border: 1px solid #4c5560; font: 14px var(--display); text-transform: uppercase; cursor: pointer; }
.ls-mode button[aria-pressed=true] { color: #1a1305; background: linear-gradient(180deg, #f5e3ae, #c39b52); border-color: #5b3f0c; }
.ls-pieces { display: grid; grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); gap: 6px; }
.ls-piece { position: relative; display: grid; grid-template-rows: 64px auto auto; min-width: 0; padding: 4px 4px 6px; text-align: center; color: #e7e9ec; cursor: pointer;
  border: 1px solid #5f5543; background: linear-gradient(145deg, #262c30, #111416); box-shadow: inset 0 0 0 2px #0c0e10; }
.ls-piece img, .ls-piece .ls-swatch { display: block; width: 100%; height: 64px; object-fit: contain; }
.ls-piece .ls-swatch { width: 40px; height: 40px; margin: 12px auto; border: 2px solid #c39b52; }
.ls-piece b { font: 400 13px/1.15 var(--display); text-transform: uppercase; overflow-wrap: anywhere; padding-top: 3px; }
.ls-piece small { font-size: 10px; color: #aeb6bd; }
.ls-piece[aria-pressed=true] { color: #fff6da; border-color: #f1dc9c; box-shadow: inset 0 0 0 2px #9a7635, 0 0 12px #dbb15730; }
.ls-piece:focus-visible { outline: 2px solid #f1dc9c; outline-offset: 1px; }
.ls-palette { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 0; font-size: 11px; color: #c8ced3; }
.ls-palette span { display: inline-flex; align-items: center; gap: 5px; }
.ls-palette i { width: 12px; height: 12px; border: 1px solid #000; box-shadow: 0 0 0 1px #ffffff30; }
.ls-fine { margin: 0; font-size: 11px; color: #9ea6ad; }
.ls-footer.actions { margin: 0; padding: 10px 0 0; border-top: 1px solid #8e7446; display: flex; flex-wrap: wrap; gap: 8px; }
.sheet-box.legacy-set .ls-footer .btn { margin: 0; min-height: 44px; min-width: 0; flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 6px 8px; font-size: 16px; line-height: 1.05; white-space: nowrap; }
.sheet-box.legacy-set .ls-footer #ls-close { flex: 0 0 auto; min-width: 70px; }
.sheet-box.legacy-set .ls-footer .btn.primary { flex: 1.3 1 auto; }
.ls-footer .btn .wi, .ls-footer .btn .ic { width: 18px; height: 18px; }
.ls-footer [hidden] { display: none; }
/* Wide enough: the figure pinned on the left, the selector beside it. */
@media (min-width: 620px) {
  .ls-body { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
  .ls-stage { height: auto; min-height: 320px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .ls-body { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); grid-template-rows: minmax(0, 1fr); }
  .ls-stage { height: auto; min-height: 0; }
  .ls-pieces { grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); }
}
@media (max-width: 350px) { .sheet-box.legacy-set { padding: 10px; } .ls-pieces { grid-template-columns: repeat(3, minmax(0, 1fr)); } .ls-piece { grid-template-rows: 52px auto auto; } .ls-piece img { height: 52px; } }

/* ---- the Legacy sheet's set tile (legacy-showroom.js) ---- */
.lg-items .lg-set { grid-column: span 2; grid-template-columns: 96px minmax(0, 1fr); grid-template-rows: 78px; align-items: center; gap: 6px; text-align: left; border-color: #c39b52; }
.lg-items .lg-set img { width: 96px; height: 78px; object-fit: contain; }
.lg-items .lg-set span small { display: block; font: 10px var(--body); color: #c8b991; margin-top: 2px; }
@media (max-width: 350px) { .lg-items .lg-set { grid-template-rows: 52px; } .lg-items .lg-set img { height: 52px; } }
