/* The march editor's formation screen (client/march-sheet.js). */
.ms { display: flex; flex-direction: column; gap: 10px; padding-bottom: 4px; }
.ms-form { position: relative; padding: 14px 10px 10px; border-radius: 16px; overflow: hidden;
  background: radial-gradient(ellipse at 50% 0%, rgba(240,180,60,.22), transparent 60%), linear-gradient(180deg, #2a2216, #15110b);
  border: 1px solid rgba(240,180,60,.45); box-shadow: inset 0 0 30px rgba(0,0,0,.5); }
.ms-form::before { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .18;
  background: repeating-linear-gradient(135deg, transparent 0 14px, rgba(255,255,255,.05) 14px 16px); }

/* five seats, the Captain in the middle */
.ms-seats { position: relative; display: flex; justify-content: center; align-items: flex-end; gap: clamp(4px, 1.6vw, 10px); }
.ms-seat { position: relative; flex: 0 1 78px; min-width: 0; min-height: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px 5px;
  border-radius: 12px; background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(0,0,0,.35)); border: 1px solid color-mix(in srgb, var(--rc, #888) 70%, transparent);
  box-shadow: 0 0 10px color-mix(in srgb, var(--rc, #888) 35%, transparent); color: #ece8d6; cursor: pointer; }
.ms-seat .pic { width: 54px; height: 54px; border-radius: 50%; overflow: hidden; border: 2px solid var(--rc, #888); background: #0d0d0a; }
.ms-seat .pic > * { width: 100% !important; height: 100% !important; object-fit: cover; object-position: top; }
.ms-seat b { font-size: 11px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-seat small { font-size: 10px; opacity: .75; }
.ms-seat .x { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px;
  background: #3a1b17; border: 1px solid #e0574c; color: #ffcbc4; }
.ms-seat.cap { flex-basis: 100px; padding-top: 14px; transform: translateY(-4px);
  background: linear-gradient(180deg, rgba(240,180,60,.28), rgba(0,0,0,.4)); border: 2px solid #f0b43c; box-shadow: 0 0 18px rgba(240,180,60,.55); }
.ms-seat.cap .pic { width: 70px; height: 70px; border-color: #f0b43c; }
.ms-seat .crown { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); font-style: normal; font-size: 22px; filter: drop-shadow(0 2px 2px #000); }
.ms-seat.empty { cursor: default; border-style: dashed; border-color: rgba(240,180,60,.35); box-shadow: none; justify-content: center; min-height: 92px; }
.ms-seat.empty.cap { min-height: 112px; }
.ms-seat.empty .plus { font: 800 24px/1 system-ui; color: rgba(240,180,60,.7); }

.ms-capt { position: relative; display: flex; gap: 10px; align-items: center; margin-top: 10px; padding: 7px 10px; border-radius: 10px;
  background: rgba(0,0,0,.35); border: 1px solid rgba(240,180,60,.35); color: #ece8d6; }
.ms-capt .ic { font-size: 24px; } .ms-capt b { display: block; color: #f0c860; font-size: 13px; } .ms-capt small { font-size: 12px; opacity: .9; }
.ms-capt.none { justify-content: center; font-size: 12px; color: #c9c3a8; border-style: dashed; }
.ms-squad { position: relative; display: flex; align-items: center; gap: 6px; margin-top: 8px; padding: 6px; border-radius: 10px; background: rgba(78,143,224,.14); border: 1px solid rgba(78,143,224,.45); }
.ms-squad .rig { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; color: #ece8d6; }
.ms-squad .rig .ic { font-size: 26px; } .ms-squad b { display: block; font-size: 13px; } .ms-squad small { font-size: 11px; opacity: .8; }
.ms-squad .arr { flex: none; width: 36px; height: 36px; min-height: 0; padding: 0; border-radius: 50%; font: 800 20px/1 system-ui; }

/* boxes */
.ms-box { padding: 10px; border-radius: 14px; background: linear-gradient(180deg, #1f2a1d, #141b12); border: 1px solid rgba(255,255,255,.1); }
.ms-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; color: #ece8d6; }
.ms-head > b { font-size: 14px; letter-spacing: .02em; } .ms-head > span { margin-right: auto; font-weight: 800; color: #f0c860; font-variant-numeric: tabular-nums; }
.ms-head > span.over { color: #ff8d80; } .ms-tip { opacity: .65; font-size: 11px; }
.ms-mini { min-height: 0; padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.ms-cap { height: 8px; border-radius: 5px; background: rgba(0,0,0,.45); overflow: hidden; margin-bottom: 8px; }
.ms-cap i { display: block; height: 100%; background: linear-gradient(90deg, #6fbf5a, #f0c860); transition: width .15s; } .ms-cap i.over { background: #e0574c; }
.ms-troops { display: flex; flex-direction: column; gap: 6px; }
.ms-troop { display: grid; grid-template-columns: auto minmax(70px, 1fr) minmax(90px, 2fr) 64px auto; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px;
  background: rgba(0,0,0,.25); border-left: 3px solid #888; color: #ece8d6; }
.ms-troop.f-melee { border-left-color: #e0574c; } .ms-troop.f-shooter { border-left-color: #b56ee0; } .ms-troop.f-vehicle { border-left-color: #4e8fe0; }
.ms-troop .nm b { display: block; font-size: 12px; } .ms-troop .nm small { font-size: 10px; opacity: .7; }
.ms-troop input[type=range] { width: 100%; accent-color: #f0b43c; margin: 0; min-height: 0; }
.ms-troop .num { text-align: right; font-variant-numeric: tabular-nums; color: #f0c860; }
@media (max-width: 420px) { .ms-troop { grid-template-columns: auto 1fr 56px auto; } .ms-troop input[type=range] { grid-column: 1 / -1; grid-row: 2; } }

/* hero cards */
.ms-heroes { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.ms-hero { position: relative; min-height: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px 6px; border-radius: 12px; color: #ece8d6;
  background: linear-gradient(180deg, color-mix(in srgb, var(--rc) 30%, #1a1a14), #12120e 70%); border: 1px solid color-mix(in srgb, var(--rc) 60%, transparent); }
.ms-hero .pic { width: 64px; height: 64px; border-radius: 10px; overflow: hidden; border: 2px solid var(--rc); background: #0d0d0a; }
.ms-hero .pic > * { width: 100% !important; height: 100% !important; object-fit: cover; object-position: top; border-radius: 0; }
.ms-hero b { font-size: 12px; } .ms-hero small { font-size: 10px; opacity: .8; } .ms-hero small.cp { color: #f0c860; opacity: 1; text-align: center; line-height: 1.2; }
.ms-hero .fac { position: absolute; top: 4px; left: 5px; font-size: 13px; } .ms-hero .lv { position: absolute; top: 4px; right: 5px; font: 800 10px/1 system-ui; padding: 2px 4px; border-radius: 4px; background: rgba(0,0,0,.6); }
.ms-hero.on { box-shadow: 0 0 0 2px #8fd27a, 0 0 12px rgba(143,210,122,.45); }
.ms-hero.cap { box-shadow: 0 0 0 2px #f0b43c, 0 0 14px rgba(240,180,60,.6); }
.ms-hero .crown, .ms-hero .seatno { position: absolute; top: 50px; right: 10px; font-style: normal; font-size: 18px; filter: drop-shadow(0 1px 2px #000); }
.ms-hero .seatno { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font: 800 11px/1 system-ui; background: #8fd27a; color: #102010; }
.ms-hero.away { opacity: .45; filter: grayscale(.8); }

/* footer */
.ms-foot { position: sticky; bottom: 0; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px;
  background: linear-gradient(180deg, #2a2216, #17120b); border: 1px solid rgba(240,180,60,.5); box-shadow: 0 -6px 16px rgba(0,0,0,.45); }
.ms-stats { display: flex; gap: 14px; color: #ece8d6; } .ms-stats span { display: flex; flex-direction: column; } .ms-stats small { font-size: 10px; opacity: .7; text-transform: uppercase; letter-spacing: .06em; }
.ms-stats b { font-size: 16px; color: #f0c860; font-variant-numeric: tabular-nums; }
.ms-go { margin-left: auto; min-width: 150px; min-height: 52px; font: 900 18px/1 system-ui; border-radius: 12px; color: #2a1a05;
  background: linear-gradient(180deg, #ffd56a, #e8a52a); border: 1px solid #ffe7a3; box-shadow: 0 4px 0 #a86f12, 0 6px 14px rgba(0,0,0,.4); }
.ms-go.attack { background: linear-gradient(180deg, #ff8a6a, #d9432c); color: #fff; border-color: #ffb3a1; box-shadow: 0 4px 0 #8e2414, 0 6px 14px rgba(0,0,0,.4); }
.ms-go:disabled { filter: grayscale(.8); opacity: .7; }

/* a rally: Equalize sits with Fill max and Clear (owner) */
.ms-mini.ms-equal.on { color: #2a1a05; background: linear-gradient(180deg, #ffd56a, #e8a52a); border-color: #ffe7a3; }
.ms-head { flex-wrap: wrap; row-gap: 6px; } .ms-head > b, .ms-head > span { white-space: nowrap; }
.ms-tools { display: flex; gap: 6px; margin-left: auto; }

/* the Captain's card: the crown sits on the top edge where it reads at a glance, and seat 1 is a gold badge (owner) */
.ms-hero .crown { top: -13px; right: auto; left: 50%; transform: translateX(-50%) rotate(-6deg); font-size: 24px; z-index: 2;
  filter: drop-shadow(0 0 6px rgba(255,210,90,.95)) drop-shadow(0 2px 2px #000); }
.ms-hero .seatno.cap { background: linear-gradient(#ffe08a, #e0a12a); color: #3a2304; box-shadow: 0 0 8px rgba(255,200,80,.85); border: 1.5px solid #fff3c4; }
