/* Troop tiers T1-T10: the tier icon (the class icon in a frame with a tier badge, all drawn here) and the
   camp's training sheet (tier strip, tier card, Train / Promote). Used by client/troops.js. */

/* ---------- tier icon ---------- */
.tr-ico { --tc: #6f7d74; --tc2: #2c3731; --tk: #e9f0e6; position: relative; display: inline-grid; place-items: center; flex: none; width: 30px; height: 30px; vertical-align: middle;
  border-radius: 8px; background: radial-gradient(circle at 50% 35%, rgba(255,255,255,.14), transparent 62%), linear-gradient(160deg, var(--tc2), #121a15);
  border: 2px solid var(--tc); box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 1px 2px rgba(0,0,0,.5); font-style: normal; line-height: 1; }
.tr-ico .tr-em { font-size: 17px; line-height: 1; display: grid; place-items: center; }
.tr-ico .tr-em .ico { width: 1.15em; height: 1.15em; vertical-align: 0; filter: drop-shadow(0 1px 1px rgba(0,0,0,.5)); }
/* the badge: a small plate on the lower right corner with the tier's number */
.tr-ico > i { position: absolute; right: -5px; bottom: -5px; min-width: 15px; height: 15px; padding: 0 3px; box-sizing: border-box; display: grid; place-items: center;
  font: 900 10px/1 var(--font); font-style: normal; color: var(--tk); background: linear-gradient(#26302a, #0d130f); border: 1.5px solid var(--tc); border-radius: 5px 2px 5px 2px;
  text-shadow: 0 1px 0 rgba(0,0,0,.6); letter-spacing: -.3px; }
/* veteran tiers: one chevron per tier above T5, stacked on the upper left corner like rank stripes */
.tr-ico > u { position: absolute; left: 2px; top: 2px; display: grid; gap: 1px; text-decoration: none; }
.tr-ico > u > s { display: block; width: 8px; height: 3px; background: var(--tc); clip-path: polygon(0 0, 50% 55%, 100% 0, 100% 45%, 50% 100%, 0 45%); filter: drop-shadow(0 1px 0 rgba(0,0,0,.6)); }
.tr-ico.tr-t2 { --tc: #7d8c55; } .tr-ico.tr-t3 { --tc: #5f9a78; } .tr-ico.tr-t4 { --tc: #4e8fe0; --tc2: #1d3048; } .tr-ico.tr-t5 { --tc: #b56ee0; --tc2: #33204a; }
.tr-ico.tr-t6 { --tc: #c98a4c; --tc2: #4a3018; --tk: #ffe1bd; }
.tr-ico.tr-t7 { --tc: #c3ccd4; --tc2: #3a434b; --tk: #fff; }
.tr-ico.tr-t8 { --tc: #f0b43c; --tc2: #55390c; --tk: #ffe39a; }
.tr-ico.tr-t9 { --tc: #ff6a5c; --tc2: #561b1b; --tk: #ffd2cc; }
.tr-ico.tr-t10 { --tc: #ffe39a; --tc2: #6b3a08; --tk: #241a05; box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 0 0 1px #7a4f10, 0 0 8px rgba(255,215,106,.65); }
.tr-ico.tr-t10 > i { background: linear-gradient(#ffe39a, #f0b43c); border-color: #7a4f10; text-shadow: none; }
.tr-ico.sm { width: 24px; height: 24px; border-radius: 7px; border-width: 1.5px; } .tr-ico.sm .tr-em { font-size: 13px; }
.tr-ico.sm > i { min-width: 13px; height: 13px; font-size: 9px; right: -4px; bottom: -4px; } .tr-ico.sm > u { display: none; }
.tr-ico.lg { width: 46px; height: 46px; border-radius: 11px; } .tr-ico.lg .tr-em { font-size: 27px; }
.tr-ico.lg > i { min-width: 19px; height: 18px; font-size: 12px; right: -6px; bottom: -6px; } .tr-ico.lg > u > s { width: 10px; height: 4px; }
.tr-ico.xl { width: 62px; height: 62px; border-radius: 14px; border-width: 3px; } .tr-ico.xl .tr-em { font-size: 36px; }
.tr-ico.xl > i { min-width: 24px; height: 22px; font-size: 14px; right: -7px; bottom: -7px; border-width: 2px; } .tr-ico.xl > u { left: 4px; top: 4px; gap: 2px; } .tr-ico.xl > u > s { width: 13px; height: 5px; }
.tr-ico.locked { filter: grayscale(1) brightness(.6); }
/* icon + name as one inline piece (lists, rows, reports) */
.tr-lab { display: inline-flex; align-items: center; gap: 9px; min-width: 0; vertical-align: middle; }
.tr-lab > b, .tr-lab > span.nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.troop-pick .tr-lab { margin-right: 4px; } .troop-pick > span { display: flex; align-items: center; gap: 4px; min-width: 0; }

/* ---------- training sheet ---------- */
.trn-strip { display: flex; gap: 6px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; margin: 0 -14px; padding: 4px 14px 10px; scrollbar-width: none; }
.trn-strip::-webkit-scrollbar { display: none; }
.trn-chip { flex: none; width: 62px; min-height: 84px; padding: 7px 2px 5px; display: grid; justify-items: center; align-content: start; gap: 5px; scroll-snap-align: center;
  color: var(--c-text); background: var(--c-panel-2); border: 1.5px solid var(--c-line); border-radius: var(--r-md); box-shadow: var(--bevel); font: inherit; cursor: pointer; }
.trn-chip b { font-size: var(--fs-md); font-weight: 800; line-height: 1; }
.trn-chip small { font-size: var(--fs-xs); line-height: 1; color: var(--c-muted); white-space: nowrap; }
.trn-chip.on { border-color: var(--c-amber); background: linear-gradient(#3a2f16, #241c0c); box-shadow: var(--sh-glow), var(--bevel); }
.trn-chip.on b { color: var(--c-amber-hi); }
.trn-chip.locked { background: var(--c-ink); border-style: dashed; } .trn-chip.locked b { color: var(--c-faint); } .trn-chip.locked small { color: var(--c-faint); }
.trn-chip.locked.on { border-color: var(--c-steel-5); box-shadow: var(--bevel); background: var(--c-steel-1); }
.trn-fade { position: relative; }
.trn-fade::after { content: ''; position: absolute; right: -14px; top: 0; bottom: 10px; width: 26px; pointer-events: none; background: linear-gradient(90deg, transparent, var(--c-panel)); opacity: .9; }
.trn-fade.end::after { display: none; }

.trn-card { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; align-items: start; padding: 12px 12px 10px; margin-top: 2px; background: var(--c-ink); border: 1px solid var(--c-line); border-radius: var(--r-lg); box-shadow: var(--well); }
.trn-card h3 { margin: 0; font-size: var(--fs-lg); color: var(--c-amber-pale); }
.trn-card .own { font-size: var(--fs-sm); color: var(--c-muted); margin-top: 2px; } .trn-card .own b { color: var(--c-text); }
.trn-card p { margin: 5px 0 0; font-size: var(--fs-sm); line-height: 1.35; color: var(--c-text-2); }
.trn-stats { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.trn-stats div { padding: 4px 1px 4px; text-align: center; background: var(--c-panel); border: 1px solid var(--c-line); border-radius: var(--r-sm); min-width: 0; }
.trn-stats small { display: block; font-size: 9px; letter-spacing: .3px; text-transform: uppercase; color: var(--c-muted); }
.trn-stats b { display: block; font-size: var(--fs-md); white-space: nowrap; letter-spacing: -.2px; }
.trn-stats em { display: block; font-style: normal; font-size: 9px; line-height: 1.1; color: var(--c-good-hi); min-height: 10px; }

.trn-lock { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 12px; color: var(--c-text-2); background: var(--c-steel-1); border: 1px dashed var(--c-steel-4); border-radius: var(--r-md); font-size: var(--fs-md); line-height: 1.35; }
.trn-lock b { color: var(--c-text); } .trn-lock .lk { font-size: 22px; flex: none; }
.trn-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin-top: 12px; padding: 3px; background: var(--c-ink); border: 1px solid var(--c-line); border-radius: var(--r-md); }
.trn-modes button { min-height: var(--tap-sm); padding: 4px 6px; font: 800 var(--fs-md)/1.15 var(--font); color: var(--c-muted); background: none; border: 0; border-radius: var(--r-sm); box-shadow: none; }
.trn-modes button small { display: block; font-weight: 600; font-size: var(--fs-xs); opacity: .85; margin-top: 2px; }
.trn-modes button.on { color: var(--c-amber-ink); background: linear-gradient(var(--c-amber-hi), var(--c-amber)); box-shadow: var(--bevel-hi); }
.trn-modes button:disabled { opacity: .45; }
.trn-what { margin-top: 8px; display: flex; align-items: center; justify-content: center; gap: 4px 10px; font-size: var(--fs-md); color: var(--c-text-2); min-height: 28px; flex-wrap: wrap; text-align: center; }
.trn-what .arrow { color: var(--c-amber); font-weight: 900; }
.trn-amt { display: grid; grid-template-columns: 1fr 96px auto; gap: 8px; align-items: center; margin-top: 6px; }
.trn-amt input[type=range] { width: 100%; min-width: 0; margin: 0; accent-color: var(--c-amber); height: var(--tap-sm); }
.trn-amt input[type=number] { width: 100%; min-width: 0; min-height: var(--tap-sm); text-align: right; box-sizing: border-box; }
.trn-amt button { min-height: var(--tap-sm); padding: 0 12px; }
.trn-sum { margin-top: 4px; padding: 0 2px; }
.trn-sum .row { padding: 5px 0; font-size: var(--fs-md); } .trn-sum .row > span:first-child { white-space: nowrap; }
.trn-sum .cost { justify-content: flex-end; }
.trn-sum .gain { color: var(--c-good-hi); font-weight: 700; }
.trn-note { margin-top: 8px; font-size: var(--fs-sm); line-height: 1.35; color: var(--c-muted); }
.trn-job { margin-top: 12px; padding: 10px 12px; background: var(--c-panel-2); border: 1px solid var(--c-line-hi); border-radius: var(--r-md); }
.trn-job .row { padding: 2px 0; border: 0; gap: 10px; }
.trn-job .row > span:first-child { min-width: 0; }
.trn-job small { display: block; color: var(--c-muted); font-size: var(--fs-sm); margin-top: 2px; }
.trn-sel { display: none; }
#sheet-body .actions.trn-act { margin-top: 12px; } .trn-act button { flex: 1; min-height: var(--tap); }

/* ---------- army rows / hospital / reports ---------- */
.tr-row > span:first-child { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tr-txt { min-width: 0; display: grid; gap: 1px; justify-items: start; text-align: left; }
.tr-txt b { font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.tr-txt small { font-size: var(--fs-sm); line-height: 1.3; color: var(--c-muted); text-align: left; }
.troop-pick .tr-txt b { font-size: var(--fs-base); } .troop-pick > span { gap: 9px; }
.cw-troop .tr-lab { gap: 7px; }
.tr-row > b, .tr-row > .tr-end { flex: none; text-align: right; }
.tr-row.dim { opacity: .55; }
.tr-cost { display: inline-flex; flex-wrap: wrap; gap: 0 8px; } .tr-cost > span { white-space: nowrap; }
.tr-fac-none { font-size: var(--fs-md); color: var(--c-muted); padding: 6px 0; }
