/* ═══════════════════════════════════════════════════════════════
   ⚔️ MATCHUP tab (/home) — mu- prefix. Loaded by home.html only.

   Chart marks follow the dataviz specs: bars ≤24px with a 4px
   rounded data-end, 2px surface gaps between stacked segments,
   values in text tokens at every tip (that label also pays for the
   light-mode contrast WARN on the validated pair #0aa85c/#5083f0).

   The 3D treatment is lighting, not geometry: every fill carries a
   top-lit gradient + inset highlight, cards get layered shadows and
   a hover lift, and the VS badge is a coin. Pure CSS — nothing here
   costs a phone anything.
   ═══════════════════════════════════════════════════════════════ */

/* ── the 3D card treatment ── */
.mu-3d {
  position: relative;
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, .06);
}

/* ── mode toggle ── */
.mu-mode { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 14px;
  border-radius: 999px; background: var(--bg-1);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .35); }
.mu-mode-b {
  padding: 8px 16px; border-radius: 999px; border: none; cursor: pointer;
  background: none; color: var(--text-2); font-size: 13px; font-weight: 600;
  transition: all .15s ease;
}
.mu-mode-b.on {
  color: var(--text-1); background: linear-gradient(180deg, var(--bg-3), var(--bg-2));
  box-shadow: 0 2px 6px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .08);
}

/* ── format picker ── */
.mu-formats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; perspective: 900px; }
.mu-fmt {
  display: flex; flex-direction: column; gap: 4px; align-items: flex-start;
  padding: 16px; border-radius: var(--r-lg); cursor: pointer; text-align: left;
  background: linear-gradient(165deg, var(--glass-bg-2), var(--glass-bg));
  border: 1px solid var(--border-2); color: var(--text-1);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, .07);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  transform-style: preserve-3d;
}
.mu-fmt:hover {
  border-color: var(--accent-border);
  transform: translateY(-3px) rotateX(2.5deg);
  box-shadow: var(--shadow-lg), 0 0 18px var(--accent-glow-2), inset 0 1px 0 rgba(255, 255, 255, .1);
}
.mu-fmt-name { font-size: 20px; font-weight: 800; }
.mu-fmt-sub { font-size: 12px; color: var(--text-2); }
.mu-fmt-sizes { display: flex; gap: 6px; margin-top: 6px; }
.mu-fmt-size {
  min-width: 30px; padding: 4px 8px; border-radius: 999px; text-align: center;
  font-family: var(--font-data); font-size: 12.5px;
  background: var(--glass-bg-3); border: 1px solid var(--border-2); color: var(--text-2);
}
.mu-fmt-size.on { color: var(--accent); border-color: var(--accent-border); background: var(--accent-glow-2); }

/* ── slot filling ── */
.mu-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.mu-head-r { display: flex; gap: 14px; }
.mu-link { background: none; border: none; padding: 0; cursor: pointer; font-size: 12.5px; color: var(--accent); }
.mu-link:hover { text-decoration: underline; }
.mu-sides { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: start; }
.mu-side { display: grid; gap: 8px; }
.mu-side-h {
  display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase; color: var(--text-2);
}
.mu-side-h i, .mu-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 1px 2px rgba(0, 0, 0, .4); }
.mu-vs { align-self: center; }
.mu-vs span {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 50%;
  font-size: 13px; font-weight: 800; color: var(--text-1);
  background: linear-gradient(160deg, var(--bg-3), var(--bg-1));
  border: 1px solid var(--border-3);
  box-shadow: 0 4px 10px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .12), inset 0 -2px 4px rgba(0, 0, 0, .4);
}
.mu-slot { display: flex; align-items: center; gap: 8px; }
.mu-slot-n { font-family: var(--font-data); font-size: 11.5px; color: var(--text-2); min-width: 26px; }
.mu-slot input {
  width: 100%; min-width: 0; padding: 9px 10px; border-radius: var(--r-md);
  background: var(--glass-bg-3); border: 1px solid var(--border-2); color: var(--text-1);
  font-family: var(--font-data); font-size: 14px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, .25);
}
.mu-in-wz { flex: 0 1 84px; }
.mu-in-ally { flex: 1 1 auto; text-transform: uppercase; }
.mu-slot-a input:focus { border-color: #0aa85c; outline: none; }
.mu-slot-b input:focus { border-color: #5083f0; outline: none; }
.mu-ffa-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.mu-actions { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.mu-run { box-shadow: 0 3px 10px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, .2); }
.mu-err { font-size: 12.5px; color: var(--red); }

/* ── legend ── */
.mu-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 4px 0 14px; font-size: 12px; color: var(--text-2); }
.mu-legend span { display: inline-flex; align-items: center; gap: 6px; }
.mu-legend-tiers { text-transform: capitalize; }

/* ── verdict ── */
.mu-verdict { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.mu-v-num {
  font-size: 52px; font-weight: 800; line-height: 1; color: var(--vc, var(--text-1));
  text-shadow: 0 1px 0 rgba(255, 255, 255, .12), 0 3px 10px rgba(0, 0, 0, .5);
}
.mu-v-num span { font-size: 26px; font-weight: 700; }
.mu-v-txt { font-size: 13.5px; color: var(--text-2); max-width: 340px; }
.mu-v-txt b { color: var(--text-1); }
.mu-meter {
  display: flex; height: 24px; border-radius: 7px; overflow: hidden; gap: 2px;
  background: var(--bg-1); box-shadow: inset 0 2px 5px rgba(0, 0, 0, .45);
  position: relative;
}
.mu-meter::after {
  /* glass shine across the whole meter */
  content: ''; position: absolute; inset: 0 0 55% 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0));
  border-radius: 7px 7px 0 0;
}
.mu-meter-a { border-radius: 5px 0 0 5px; }
.mu-meter-b { flex: 1; border-radius: 0 5px 5px 0; }
.mu-meter-lbls {
  display: flex; justify-content: space-between; margin-top: 6px;
  font-family: var(--font-data); font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums;
}

/* ── metric chips ── */
.mu-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.mu-chip {
  padding: 6px 14px; border-radius: 999px; cursor: pointer;
  font-family: var(--font-data); font-size: 12.5px;
  background: var(--glass-bg-3); border: 1px solid var(--border-2); color: var(--text-2);
  transition: all .15s ease;
}
.mu-chip.on {
  color: var(--text-1); border-color: var(--accent-border);
  background: linear-gradient(180deg, var(--accent-glow), var(--accent-glow-2));
  box-shadow: 0 2px 8px var(--accent-glow-2), inset 0 1px 0 rgba(255, 255, 255, .1);
}

/* ── bars (one bar row, everywhere) ── */
.mu-bars { display: grid; gap: 7px; }
.mu-bar-row { display: flex; align-items: center; gap: 10px; min-height: 24px; }
.mu-bar-lbl {
  flex: none; width: 108px; font-family: var(--font-data); font-size: 12px;
  color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mu-bar-track {
  flex: 1; height: 16px; border-radius: 4px; background: var(--glass-bg-3);
  display: flex; overflow: hidden; gap: 2px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .3);
}
.mu-bar-lg { height: 20px; }
.mu-bar-track i {
  display: block; height: 100%; border-radius: 0 4px 4px 0;
  /* top-lit: the same fill colour, lit above, shaded below */
  background-image: linear-gradient(180deg, rgba(255, 255, 255, .28), rgba(255, 255, 255, 0) 45%, rgba(0, 0, 0, .18));
  box-shadow: 0 1px 3px rgba(0, 0, 0, .35);
}
.mu-bar-track i:first-child { border-radius: 4px; }
.mu-stack i { border-radius: 2px; }
.mu-bar-val {
  flex: none; min-width: 62px; text-align: right; font-family: var(--font-data);
  font-size: 12.5px; color: var(--text-1); font-variant-numeric: tabular-nums;
}
.mu-chev { flex: none; width: 14px; color: var(--text-3); font-size: 11px; }

/* ── KPI head-to-head ── */
.mu-kpis { display: grid; gap: 16px; }
.mu-kpi-name { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-2); margin-bottom: 6px; }
.mu-kpi .mu-bar-row { min-height: 20px; }
.mu-kpi .mu-bar-track { height: 14px; }

/* ── entity rows + drilldown ── */
.mu-wzrow { border-radius: var(--r-md); transition: background .15s ease; }
.mu-wzrow.open {
  background: var(--glass-bg-3); padding: 8px; margin: 0 -8px;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, .25);
}
.mu-click { cursor: pointer; }
.mu-click:hover .mu-bar-lbl { color: var(--accent); }
.mu-drill { padding: 10px 4px 4px; }
.mu-allies { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.mu-ally {
  font-family: var(--font-data); font-size: 11.5px; color: var(--text-2);
  padding: 3px 8px; border-radius: 999px; background: var(--glass-bg-2); border: 1px solid var(--border-1);
}
.mu-players { display: grid; gap: 2px; }
.mu-pl {
  display: flex; align-items: center; gap: 9px; padding: 6px 8px;
  border-radius: var(--r-sm); cursor: pointer; transition: background .12s ease, transform .12s ease;
}
.mu-pl:hover { background: var(--glass-bg-2); transform: translateX(2px); }
.mu-pl-rank { flex: none; width: 16px; font-family: var(--font-data); font-size: 11px; color: var(--text-3); text-align: right; }
.mu-pl-av {
  flex: none; width: 26px; height: 26px; border-radius: 50%; overflow: hidden; position: relative;
  background: var(--bg-3); color: var(--text-2); font-size: 10px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .1);
}
.mu-pl-av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mu-pl-name { flex: 1; min-width: 0; font-size: 13px; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mu-pl-ally { flex: none; font-family: var(--font-data); font-size: 11px; color: var(--text-2); }
.mu-pl-thp { flex: none; min-width: 58px; text-align: right; font-family: var(--font-data); font-size: 12.5px; color: var(--text-1); font-variant-numeric: tabular-nums; }

.mu-note { font-size: 11.5px; line-height: 1.55; color: var(--text-2); margin: 4px 2px 0; }

/* ── phones ── */
@media (max-width: 620px) {
  .mu-formats { grid-template-columns: 1fr; }
  .mu-fmt:hover { transform: none; }              /* no tilt where there's no hover */
  .mu-sides { grid-template-columns: 1fr; }
  .mu-vs { justify-self: center; margin: 2px 0; }
  .mu-vs span { width: 34px; height: 34px; font-size: 11px; }
  .mu-bar-lbl { width: 84px; font-size: 11px; }
  .mu-bar-val { min-width: 52px; font-size: 11.5px; }
  .mu-v-num { font-size: 42px; }
  .mu-pl-ally { display: none; }
  .mu-mode-b { padding: 7px 12px; font-size: 12px; }
  .mu-chip { padding: 5px 11px; font-size: 11.5px; }
}
@media (max-width: 400px) {
  .mu-bar-lbl { width: 70px; }
  .mu-in-wz { flex-basis: 68px; }
}
