/* The kit rack on the selection scroll (kitrack.js): four round tokens for what the selected soldiers wear and carry, and the slip of paper a token
   opens. Same vocabulary as the rest of the interface: ink discs, gold hairlines, vermilion for what can be acted on, torn washi for the sheet. */

/* ---------------------------------------------------------------------------------------------- the rack: a row of tokens at the scroll's upper right,
   beside the name (one soldier) or the count (several): the lines there have room to spare, the stats and the portraits below keep their full width */
.kitrack { position: absolute; right: 26px; top: 22px; display: flex; gap: 8px; --k: 34px; }
.kitrack[hidden] { display: none; }
.selscroll .paper.kit .pane.one h3, .selscroll .paper.kit .pane.one .role { padding-right: 172px; box-sizing: border-box; }
.selscroll .paper.kit .pane.one h3 > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }       /* a long name gives way to the rack, it does not run under it */
.selscroll .paper.kit.many .kitrack { top: 13px; gap: 7px; --k: 26px; }
.selscroll .paper.kit .pane.many h3 { padding-right: 140px; box-sizing: border-box; }

.ktok { position: relative; width: var(--k); height: var(--k); flex: none; border-radius: 50%; display: grid; place-items: center; color: var(--paper-text); cursor: default;
  background: radial-gradient(circle at 38% 32%, #3b2c24, var(--sumi) 72%); box-shadow: 0 0 0 1.5px var(--kin-lo), 0 3px 6px rgba(0, 0, 0, .3);
  transition: transform .16s var(--ease-ink), box-shadow .16s; }
.ktok .kanji { font-size: calc(var(--k) * .53); transform: translateY(1px); }
/* an empty slot: a brushed ring on the bare paper */
.ktok.knone { color: var(--washi-faint); background: none; box-shadow: none; }
.ktok.knone::before { content: ""; position: absolute; inset: 1px; border-radius: 50%; border: 1.5px dashed rgba(42, 31, 24, .42); }
.ktok.knone .kanji { font-size: calc(var(--k) * .44); opacity: .7; }
/* a slot the player can change: a vermilion bead on its rim, and it answers the hand */
.ktok.open { cursor: pointer; }
.ktok.open::after { content: ""; position: absolute; right: -1px; top: -1px; width: calc(var(--k) * .26); height: calc(var(--k) * .26); border-radius: 50%; background: radial-gradient(circle at 35% 30%, #e06a55, var(--shu) 60%, var(--shu-deep));
  box-shadow: 0 0 0 1.5px var(--washi); }
.ktok.open:hover, .ktok.on { transform: scale(1.1); box-shadow: 0 0 0 2px var(--shu), 0 4px 9px rgba(0, 0, 0, .35); }
.ktok.knone.open:hover, .ktok.knone.on { box-shadow: 0 0 0 2px var(--shu); }
/* a man is on his way to a store for a piece of this slot: the bead turns to gold and breathes until he has it */
.ktok.busy::after { background: radial-gradient(circle at 35% 30%, #fff0c0, var(--kin-hi) 55%, var(--kin-lo)); animation: ktok-busy 1.4s ease-in-out infinite; }
@keyframes ktok-busy { 50% { transform: scale(1.5); } }
/* several men, not all in the piece shown: how many are (under the token; the bead is at its upper rim) */
.ktok .kn { position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%); font: 700 9.5px/1 var(--font); font-style: normal; letter-spacing: .02em; white-space: nowrap;
  color: var(--washi); background: var(--sumi-3); padding: 2px 5px 2.5px; border-radius: 8px; box-shadow: 0 0 0 1px rgba(201, 162, 74, .4); }
.ktok .kn:empty { display: none; }

@container (max-width: 440px) {
  .kitrack { right: 18px; top: 13px; gap: 6px; --k: 25px; }
  .selscroll .paper.kit .pane.one h3 { padding-right: 126px; }
  .selscroll .paper.kit.many .kitrack { top: 12px; --k: 23px; gap: 5px; }
  .selscroll .paper.kit .pane.many h3 { padding-right: 116px; }
}
/* the narrowest scroll: only the pieces that can be changed stay (weapon and armour are told by the portrait) */
@container (max-width: 292px) {
  .ktok:not(.open) { display: none; }
  .selscroll .paper.kit .pane.one h3 { padding-right: 64px; }
  .selscroll .paper.kit .pane.many h3 { padding-right: 60px; }
}

/* ---------------------------------------------------------------------------------------------- the slip: the pieces the armoury could issue */
.kitslip { position: fixed; z-index: 58; width: 286px; pointer-events: auto; animation: kitslip-in .18s var(--ease-ink); }
.kitslip[hidden] { display: none; }
.kitslip .sheet { padding: 15px 15px 14px; box-sizing: border-box; }
@keyframes kitslip-in { from { opacity: 0; transform: translateY(6px) rotate(-.6deg); } to { opacity: 1; transform: none; } }
.kitslip h4 { margin: 0 4px 7px; font-size: 15.5px; font-weight: 800; color: var(--washi-ink); display: flex; align-items: baseline; gap: 8px; }
.kitslip h4 .kanji { font-size: 21px; color: var(--shu-deep); }
.kitslip h4 em { margin-left: auto; font-style: normal; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--washi-faint); font-weight: 800; }

.kopt { display: flex; align-items: center; gap: 11px; width: 100%; padding: 6px 8px 6px 5px; border-radius: 22px; text-align: left; color: var(--washi-ink); transition: background .14s; }
.kopt + .kopt { margin-top: 2px; }
.kopt:hover { background: rgba(42, 31, 24, .09); }
.kopt .kdisc { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--paper-text);
  background: radial-gradient(circle at 38% 32%, #3b2c24, var(--sumi) 72%); box-shadow: 0 0 0 1.5px var(--kin-lo); transition: box-shadow .14s; }
.kopt .kdisc .kanji { font-size: 18px; transform: translateY(1px); }
.kopt .kdisc.knone { color: var(--washi-faint); background: none; box-shadow: inset 0 0 0 1.5px rgba(42, 31, 24, .35); }
.kopt:hover .kdisc { box-shadow: 0 0 0 2px var(--shu); }
.kopt .kbody { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.kopt .kbody b { font-size: 14px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kopt .kbody i { font-style: normal; font-size: 11.5px; color: var(--washi-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kopt .kside { flex: none; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.05; font-size: 9px; letter-spacing: .12em; text-transform: uppercase; color: var(--washi-faint); font-weight: 800; }
.kopt .kside b { font-size: 15px; letter-spacing: 0; color: var(--washi-ink); font-variant-numeric: tabular-nums; }
/* what he has on: sealed in vermilion */
.kopt.cur .kdisc { box-shadow: 0 0 0 2px var(--shu), 0 0 0 3.5px var(--washi), 0 0 0 4.5px var(--shu-deep); }
/* nothing to do with it: none in store, or everyone has it */
.kopt.dis { cursor: default; opacity: .5; }
.kopt.dis:hover { background: none; } .kopt.dis:hover .kdisc { box-shadow: 0 0 0 1.5px var(--kin-lo); }
.kopt.dis.cur { opacity: 1; } .kopt.dis.cur:hover .kdisc { box-shadow: 0 0 0 2px var(--shu), 0 0 0 3.5px var(--washi), 0 0 0 4.5px var(--shu-deep); }
.kopt.dis .kside b { color: var(--shu-deep); }
.kopt.dis.cur .kside b { color: var(--washi-ink); }

/* ---------------------------------------------------------------------------------------------- painted pieces (assets/art/items): the token shows the
   piece itself instead of its kanji, a little larger so it can be read */
.kitrack { --k: 40px; }
.selscroll .paper.kit.many .kitrack { --k: 32px; }
.ktok.art, .kopt .kdisc.art { background: var(--art) center / cover; }
.ktok.art .kanji, .kopt .kdisc.art .kanji { display: none; }
.kopt .kdisc.art { width: 46px; height: 46px; }
.kitslip { width: 304px; }
