/* Match-analysis page: tab content (Match, Players, Rallies, Admin). Tokens in layout.css. */
.ma-sec { margin-top: 26px; }
.ma-sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.ma-hint { font-size: 12px; color: var(--ma-muted); }
.ma-dot { display: inline-block; width: 10px; height: 10px; border-radius: 999px;
  background: var(--ma-side); margin-right: 6px; vertical-align: 0; flex: none; }
.ma-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 12px;
  color: var(--ma-muted); }
.ma-legend > span { display: inline-flex; align-items: center; }

/* Result: the biggest thing on the page */
.ma-result { background: #fff; border: 1px solid var(--ma-line); border-radius: 16px;
  box-shadow: 0 2px 10px rgba(11, 29, 51, .05); overflow: hidden; }
.ma-res-row { display: grid; grid-template-columns: 5px minmax(0, 1fr) auto; align-items: center;
  gap: 12px; padding: 14px 16px 14px 0; }
.ma-res-row + .ma-res-row { border-top: 1px solid var(--ma-line); }
.ma-res-edge { align-self: stretch; background: var(--ma-side); border-radius: 0 4px 4px 0; }
.ma-res-name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-width: 0;
  font-family: 'Sora', sans-serif; font-size: 18px; font-weight: 700; color: var(--ma-navy);
  line-height: 1.25; }
.ma-res-row.is-lose .ma-res-name { color: var(--ma-muted); font-weight: 600; }
.ma-won { display: inline-flex; align-items: center; gap: 3px; font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px; font-weight: 800; color: var(--ma-teal-d); background: var(--ma-teal-soft);
  border-radius: 999px; padding: 2px 9px 2px 6px; }
.ma-won .ma-ico { width: 14px; height: 14px; }
.ma-res-games { display: flex; gap: 4px; }
.ma-game { min-width: 40px; text-align: center; font-family: 'Sora', sans-serif; font-size: 28px;
  font-weight: 600; color: var(--ma-soft); line-height: 1; }
.ma-game.is-win { color: var(--ma-navy); font-weight: 800; }
.ma-beta { display: flex; align-items: center; gap: 8px; margin: 8px 2px 0; font-size: 12px; color: var(--ma-muted); }

/* Analysis quality (quality.py): a button by the result and its sheet; green / amber / red by band */
.ma-quality { margin: 10px 2px 0; }
.ma-q-dot { display: inline-block; width: 8px; height: 8px; border-radius: 999px; flex: none; background: var(--ma-soft); }
.ma-q-dot.is-good, .ma-q-parts .is-good .ma-q-bar > span { background: #16A34A; }
.ma-q-dot.is-fair, .ma-q-parts .is-fair .ma-q-bar > span { background: var(--ma-amber); }
.ma-q-dot.is-low, .ma-q-parts .is-low .ma-q-bar > span { background: #DC2626; }
.ma-q-lead { display: flex; align-items: center; gap: 8px; margin: 2px 0 0; font-size: 16px; color: #334155; }
.ma-q-lead strong { color: var(--ma-navy); }
.ma-q-warn { margin: 8px 0 0; font-size: 13px; color: #B91C1C; }
.ma-q-parts { list-style: none; margin: 14px 0 18px; padding: 0; display: grid; gap: 10px; }
.ma-q-parts li { display: grid; grid-template-columns: minmax(0, 1fr) 30% 42px; align-items: center; gap: 10px;
  font-size: 13px; color: #334155; }
.ma-q-bar { height: 8px; border-radius: 999px; background: var(--ma-bg); overflow: hidden; }
.ma-q-bar > span { display: block; height: 100%; border-radius: inherit; }
.ma-q-pct { text-align: right; font-weight: 700; color: var(--ma-navy); font-variant-numeric: tabular-nums; }

/* The story: plain sentences under the score, the first one a touch stronger */
.ma-story { background: #fff; border: 1px solid var(--ma-line); border-radius: 16px; padding: 14px 16px; }
.ma-story p { margin: 6px 0 0; font-size: 14px; line-height: 1.5; color: var(--ma-text); }
.ma-story p.is-lead { font-weight: 700; color: var(--ma-navy); }
.ma-story p:first-child { margin-top: 0; }

/* Match flow: one block per rally, in the winner's colour */
.ma-flow-game { margin-top: 12px; }
.ma-flow-label { font-size: 12px; font-weight: 700; color: var(--ma-muted); margin-bottom: 5px; }
.ma-flow-label span { font-weight: 600; color: var(--ma-soft); margin-left: 4px; }
.ma-flow { display: grid; gap: 3px; }
.ma-blk { height: 30px; border: 0; padding: 0; border-radius: 3px; background: var(--ma-side);
  cursor: pointer; transition: transform .1s; }
.ma-blk:hover:not(:disabled) { transform: scaleY(1.12); }
.ma-blk:disabled { opacity: .28; cursor: default; }
.ma-blk.is-now { outline: 2.5px solid var(--ma-navy); outline-offset: 2px; position: relative; z-index: 1; }

/* Head to head */
.ma-h2h-teams { display: flex; justify-content: space-between; gap: 10px; margin: 12px 0 2px;
  font-size: 13px; font-weight: 800; }
.ma-h2h-teams span:last-child { text-align: right; }
.ma-h2h { padding: 12px 0 10px; border-top: 1px solid var(--ma-line); }
.ma-h2h-teams + .ma-h2h { border-top: 0; }
.ma-h2h-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) 64px; align-items: center; }
.ma-h2h-v { font-family: 'Sora', sans-serif; font-size: 22px; font-weight: 800; line-height: 1.1; }
.ma-h2h-v:last-child { text-align: right; }
.ma-h2h-v.is-behind { opacity: .55; font-weight: 700; }
.ma-h2h-l { text-align: center; font-size: 13px; font-weight: 700; color: #334155; }
.ma-split { display: flex; height: 8px; border-radius: 999px; overflow: hidden; margin-top: 8px;
  background: var(--ma-amber); }
.ma-split span { background: var(--ma-teal); border-right: 2px solid #fff; }
.ma-h2h-sub { display: flex; justify-content: space-between; margin-top: 5px; font-size: 12px;
  color: var(--ma-muted); }
.ma-longest { width: 100%; display: flex; align-items: center; gap: 12px; margin-top: 8px;
  padding: 12px; border: 1px solid var(--ma-line); border-radius: 14px; background: #F8FAFC;
  cursor: pointer; text-align: left; }
.ma-longest:hover { border-color: var(--ma-soft); }
.ma-longest-play { width: 40px; height: 40px; border-radius: 999px; background: var(--ma-teal);
  color: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.ma-longest-text { display: flex; flex-direction: column; font-size: 13px; color: var(--ma-muted); }
.ma-longest-text strong { font-size: 15px; color: var(--ma-navy); }
.ma-longest.is-now { border-color: var(--ma-teal); background: var(--ma-teal-soft); }

/* Insights: each line opens the Compare stat it reads (tabs.js) */
.ma-ins { margin-top: 10px; background: #fff; border: 1px solid var(--ma-line); border-radius: 16px; overflow: hidden; }
.ma-ins-row { width: 100%; display: flex; align-items: flex-start; gap: 10px; padding: 12px 12px 12px 14px;
  background: #fff; border: 0; text-align: left; font: inherit; color: var(--ma-text); }
.ma-ins-row + .ma-ins-row { border-top: 1px solid var(--ma-line); }
button.ma-ins-row { cursor: pointer; }
button.ma-ins-row:hover { background: #F8FAFC; }
.ma-ins-row .ma-dot { margin-top: 5px; flex: none; }
.ma-ins-text { flex: 1; min-width: 0; font-size: 14px; line-height: 1.45; }
.ma-ins-row .ma-chev { margin-top: 1px; }
@keyframes ma-flash { from { background: var(--ma-teal-soft); box-shadow: inset 0 0 0 1.5px var(--ma-teal); } }
.is-flash { animation: ma-flash 1.6s ease-out; border-radius: 12px; }
@keyframes ma-enter { from { opacity: 0; transform: translateY(8px); } }
.ma-tabpanel.is-enter { animation: ma-enter .28s ease-out; }
/* After an insight jump: one floating button back to the line (sticks to the bottom of the Compare tab) */
.ma-back { position: sticky; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 15; display: flex;
  justify-content: center; margin-top: 16px; pointer-events: none; }
.ma-back[hidden] { display: none; }
.ma-back-btn { pointer-events: auto; min-height: 44px; padding: 8px 18px 8px 14px; border-radius: 999px;
  background: var(--ma-navy); color: #fff; box-shadow: 0 8px 20px rgba(11, 29, 51, .28); }
.ma-back-btn:hover { background: #17304F; }
.ma-back-btn .ma-ico { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round;
  stroke-linejoin: round; }

/* Avatars + player tiles */
.ma-av { width: 42px; height: 42px; border-radius: 999px; flex: none; display: inline-flex;
  align-items: center; justify-content: center; background: var(--ma-side); color: #fff;
  font-family: 'Sora', sans-serif; font-size: 14px; font-weight: 700; letter-spacing: .02em; }
.ma-av-lg { width: 58px; height: 58px; font-size: 19px; }
.ma-ptiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.ma-ptile { display: flex; align-items: center; gap: 10px; min-height: 66px; padding: 10px 10px 10px 12px;
  background: #fff; border: 1px solid var(--ma-line); border-radius: 14px; cursor: pointer;
  text-align: left; }
.ma-ptile:hover { border-color: var(--ma-soft); box-shadow: 0 4px 12px rgba(11, 29, 51, .06); }
.ma-ptile-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ma-ptile-name { font-size: 15px; font-weight: 700; color: var(--ma-navy); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.ma-ptile-sub { font-size: 12px; color: var(--ma-muted); }
.ma-chev { color: var(--ma-soft); }
.ma-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 30px; padding-top: 14px; border-top: 1px solid var(--ma-line); font-size: 13px;
  color: var(--ma-muted); }

/* Players tab */
.ma-picker { display: flex; align-items: stretch; gap: 4px; overflow-x: auto; padding-bottom: 2px; }
.ma-picker-gap { width: 1px; background: var(--ma-line); margin: 10px 4px; flex: none; }
.ma-pick { flex: 1 0 68px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px 4px 8px; border: 2px solid transparent; border-radius: 14px; background: transparent;
  cursor: pointer; }
.ma-pick .ma-av { opacity: .55; }
.ma-pick-name { font-size: 13px; font-weight: 600; color: var(--ma-muted); max-width: 88px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ma-pick[aria-selected="true"] { border-color: var(--ma-navy); background: #fff; }
.ma-pick[aria-selected="true"] .ma-av { opacity: 1; }
.ma-pick[aria-selected="true"] .ma-pick-name { color: var(--ma-navy); font-weight: 800; }
.ma-player[hidden] { display: none; }
.ma-phead { display: flex; align-items: center; gap: 14px; margin-top: 18px; }
.ma-phead-text { min-width: 0; }
.ma-pname { font-family: 'Sora', sans-serif; font-size: 19px; font-weight: 700; color: var(--ma-navy);
  line-height: 1.25; }
.ma-pmeta { font-size: 13px; color: var(--ma-muted); margin-top: 2px; }
.ma-hl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px;
  margin-top: 18px; }                    /* the same 3 cards for everyone: the 3rd spans the row on phones */
.ma-hl:last-child:nth-child(odd) { grid-column: 1 / -1; }
@media (min-width: 560px) {
  .ma-hl-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ma-hl:last-child:nth-child(odd) { grid-column: auto; }
}
.ma-hl { display: flex; flex-direction: column; align-items: center; text-align: center;
  background: #fff; border: 1px solid var(--ma-line); border-radius: 14px; padding: 14px 10px 10px; }
.ma-hl-n { font-family: 'Sora', sans-serif; font-size: 28px; font-weight: 800; line-height: 1.1; }
.ma-hl-n.ma-hl-none { color: var(--ma-muted); }
.ma-hl-l { font-size: 13px; font-weight: 700; color: var(--ma-navy); line-height: 1.25; margin-top: 4px; }
.ma-hl-sub { font-size: 12px; color: var(--ma-muted); margin: 2px 0 10px; }
.ma-hl .ma-watch-block { margin-top: auto; }
/* Speed-ups: a won / reset / lost bar per starter (counts inside) */
.ma-su-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ma-info { width: 28px; height: 28px; flex: none; border: 1px solid var(--ma-line); border-radius: 999px;
  background: #fff; color: var(--ma-navy); font: 800 14px/1 'Sora', sans-serif; cursor: pointer; }
.ma-info:hover { border-color: var(--ma-soft); }
.ma-su-legend { display: flex; gap: 14px; margin: 4px 0 6px; font-size: 12px; font-weight: 700; color: var(--ma-muted); }
.ma-su-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; }
.ma-su-row { display: grid; grid-template-columns: 100px minmax(0, 1fr) 26px 36px; align-items: center;
  gap: 10px; min-height: 46px; border-top: 1px solid #F1F5F9; }
.ma-su-l { font-size: 13px; font-weight: 600; color: #334155; }
.ma-su-bar { display: flex; height: 20px; border-radius: 6px; overflow: hidden; background: var(--ma-bg); }
.ma-su-bar span { display: flex; align-items: center; justify-content: center; font-size: 11px;
  font-weight: 800; color: #fff; }
.ma-su-bar span + span { border-left: 2px solid #fff; }
.ma-su-none { font-size: 13px; color: var(--ma-soft); }
.ma-su-n { font-size: 15px; font-weight: 800; color: var(--ma-navy); text-align: right; }
.ma-mix { display: grid; gap: 2px; }
.ma-mix-row { display: grid; grid-template-columns: 76px minmax(0, 1fr) 30px; align-items: center;
  gap: 10px; min-height: 30px; }
.ma-mix-l { font-size: 13px; font-weight: 600; color: #334155; }
.ma-mix-bar { height: 10px; background: var(--ma-bg); border-radius: 999px; overflow: hidden; }
.ma-mix-bar span { display: block; height: 100%; border-radius: 999px; }
.ma-bg1 { background: var(--ma-teal); }
.ma-bg2 { background: var(--ma-amber); }
.ma-bg0 { background: var(--ma-soft); }
.ma-mix-n { font-size: 13px; font-weight: 800; color: var(--ma-navy); text-align: right; }
.ma-move .ma-mix-row { grid-template-columns: 96px minmax(0, 1fr) 64px; }
.ma-move-most { padding-left: 106px; margin-top: -4px; }
.ma-ath .ma-mix-row { grid-template-columns: 96px minmax(0, 1fr) 64px; }
.ma-ath-top { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.ma-ath-top .ma-keyn { flex: none; align-items: flex-start; padding: 0; }
.ma-detail { background: #fff; border: 1px solid var(--ma-line); border-radius: 14px; }
.ma-acc + .ma-acc { border-top: 1px solid var(--ma-line); }
.ma-acc summary { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 14px;
  cursor: pointer; list-style: none; }
.ma-acc summary::-webkit-details-marker { display: none; }
.ma-acc-t { flex: 1; font-size: 15px; font-weight: 700; color: var(--ma-navy); }
.ma-acc-n { font-size: 13px; font-weight: 800; color: var(--ma-muted); background: var(--ma-bg);
  border-radius: 999px; padding: 2px 10px; }
.ma-acc-chev { color: var(--ma-soft); transition: transform .15s; }
.ma-acc[open] .ma-acc-chev { transform: rotate(180deg); }
.ma-acc-body { padding: 0 14px 10px; }
.ma-subt { font-size: 12px; font-weight: 800; color: var(--ma-muted); text-transform: uppercase;
  letter-spacing: .04em; margin: 12px 0 2px; }
.ma-subt span { color: var(--ma-navy); margin-left: 4px; }
.ma-drow { display: grid; grid-template-columns: minmax(0, 1fr) auto 36px; align-items: center;
  gap: 10px; min-height: 46px; border-top: 1px solid #F1F5F9; }
.ma-drow-l { font-size: 14px; color: #334155; }
.ma-drow-v { font-size: 15px; font-weight: 800; color: var(--ma-navy); text-align: right; }
.ma-drow-v small { font-size: 12px; font-weight: 600; color: var(--ma-muted); }

/* Rallies tab */
.ma-seg { display: flex; background: var(--ma-line); border-radius: 12px; padding: 4px; gap: 4px; }
.ma-seg-btn { flex: 1; height: 38px; border: 0; border-radius: 9px; background: transparent;
  cursor: pointer; font-size: 14px; font-weight: 700; color: var(--ma-muted); }
.ma-seg-btn[aria-selected="true"] { background: #fff; color: var(--ma-navy);
  box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
.ma-legend-top { margin: 12px 0 10px; }
.ma-rlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ma-rlist[hidden] { display: none; }
.ma-rrow { width: 100%; display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center;
  gap: 10px; min-height: 58px; padding: 8px 10px 8px 12px; background: #fff; text-align: left;
  border: 1px solid var(--ma-line); border-left: 5px solid var(--ma-soft); border-radius: 12px;
  cursor: pointer; scroll-margin: 120px 0 80px; }
.ma-edge-1 { border-left-color: var(--ma-teal); }
.ma-edge-2 { border-left-color: var(--ma-amber); }
.ma-rrow:hover:not(:disabled) { border-color: var(--ma-soft); }
.ma-edge-1:hover:not(:disabled) { border-left-color: var(--ma-teal); }
.ma-edge-2:hover:not(:disabled) { border-left-color: var(--ma-amber); }
.ma-rno { font-family: 'Sora', sans-serif; font-size: 12px; font-weight: 700; color: var(--ma-soft); }
.ma-rmain { display: flex; flex-direction: column; min-width: 0; }
.ma-rscore { font-family: 'Sora', sans-serif; font-size: 18px; font-weight: 800; color: var(--ma-navy);
  line-height: 1.2; }
.ma-rsub { font-size: 12px; color: var(--ma-muted); white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; }
.ma-rplay { width: 36px; height: 36px; border-radius: 999px; background: var(--ma-teal-soft);
  color: var(--ma-teal-d); display: flex; align-items: center; justify-content: center; }
.ma-rplay .ma-ico { width: 16px; height: 16px; }
.ma-rmiss { font-size: 12px; color: var(--ma-soft); }
.ma-rrow:disabled { background: #F8FAFC; cursor: default; }
.ma-rrow:disabled .ma-rscore { color: var(--ma-soft); }
.ma-rrow.is-now { background: var(--ma-teal-soft); border-color: var(--ma-teal); border-left-color: var(--ma-soft); }
.ma-rrow.is-now.ma-edge-1 { border-left-color: var(--ma-teal); }
.ma-rrow.is-now.ma-edge-2 { border-left-color: var(--ma-amber); }
.ma-rrow.is-now .ma-rplay { background: var(--ma-navy); color: #fff; }

/* Admin tab */
.ma-admin .ma-h3 { margin-top: 18px; }
.ma-kv > div { display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 8px 0; border-top: 1px solid var(--ma-line); font-size: 13px; }
.ma-kv > div > span:first-child { color: var(--ma-muted); }
.ma-kv > div > span:last-child { text-align: right; overflow-wrap: anywhere; }
.ma-list { margin: 0; padding-left: 18px; font-size: 13px; color: #334155; display: grid; gap: 4px; }
.ma-tag { font-size: 12px; font-weight: 800; color: var(--ma-teal-d); background: var(--ma-teal-soft);
  border-radius: 999px; padding: 3px 10px; }
