/* Match-analysis page, Round 2 (ai-docs/MATCH_ANALYSIS_PAGE_REDESIGN.md): key numbers, the shot
   map (admin top-down court style: navy court, lighter kitchen, white lines) and the serve +
   return depth donuts. Tokens in layout.css. */

/* Key numbers under the player header */
.ma-keys { display: flex; margin-top: 16px; background: #fff; border: 1px solid var(--ma-line);
  border-radius: 14px; }
.ma-keyn { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 10px 6px;
  min-width: 0; }
.ma-keyn + .ma-keyn { border-left: 1px solid var(--ma-line); }
.ma-keyn b { font-family: 'Sora', sans-serif; font-size: 24px; font-weight: 800; color: var(--ma-navy);
  line-height: 1.1; white-space: nowrap; }
.ma-keyn small { font-size: 12px; font-weight: 700; color: var(--ma-muted); margin-left: 3px; }
.ma-keyn span { font-size: 12px; font-weight: 700; color: var(--ma-muted); margin-top: 2px; }
.ma-h2h-v small { font-size: 11px; font-weight: 700; margin-left: 2px; opacity: .8; }

/* Shot-type tabs: one row that scrolls sideways; arrow buttons show when it overflows (tabs.js) */
.ma-segx { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.ma-segx .ma-seg-scroll { flex: 1; min-width: 0; }
.ma-segx-btn { display: none; flex: 0 0 auto; width: 34px; height: 46px; padding: 0; align-items: center;
  justify-content: center; border: 1px solid var(--ma-line); border-radius: 12px; background: #fff;
  color: var(--ma-navy); cursor: pointer; }
.ma-segx.is-over .ma-segx-btn { display: inline-flex; }
.ma-segx-btn:hover { border-color: var(--ma-soft); }
.ma-segx-btn:disabled { opacity: .35; cursor: default; border-color: var(--ma-line); }
.ma-segx-btn .ma-ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4;
  stroke-linecap: round; stroke-linejoin: round; }
.ma-seg-scroll { overflow-x: auto; scrollbar-width: none; }
.ma-seg-scroll::-webkit-scrollbar { display: none; }
.ma-seg-scroll .ma-seg-btn { flex: 0 0 auto; padding: 0 12px; white-space: nowrap; font-size: 13px; }
.ma-seg-n { font-weight: 800; color: var(--ma-soft); margin-left: 2px; }
.ma-seg-btn[aria-selected="true"] .ma-seg-n { color: var(--ma-teal-d); }

/* Top / Side view buttons: the active one solid */
.ma-view { display: inline-flex; gap: 4px; }
.ma-view-btn { height: 32px; padding: 0 14px; border: 1px solid var(--ma-line); border-radius: 9px;
  background: #fff; color: var(--ma-navy); font-size: 13px; font-weight: 700; cursor: pointer; }
.ma-view-btn:hover { border-color: var(--ma-soft); }
.ma-view-btn[aria-selected="true"] { background: var(--ma-navy); border-color: var(--ma-navy); color: #fff; }
/* Admins only: Estimates (shotmap.js) draws estimated landings and hit spots dotted */
.ma-smap-ctl { display: inline-flex; align-items: center; gap: 8px; }
.ma-smap .ma-sec-head:has(.ma-smap-ctl) { flex-wrap: wrap; row-gap: 8px; }
.ma-smap .ma-sec-head:has(.ma-smap-ctl) .ma-h3 { white-space: nowrap; }
.ma-est-btn[aria-pressed="true"] { background: var(--ma-navy); border-color: var(--ma-navy); color: #fff; }

/* The selected type's averages: the biggest numbers on the map */
.ma-avg { display: flex; gap: 24px; margin-top: 14px; }
.ma-avg[hidden] { display: none; }
.ma-avg-n { display: flex; flex-direction: column; }
.ma-avg-n b { font-family: 'Sora', sans-serif; font-size: 30px; font-weight: 800; line-height: 1.05;
  white-space: nowrap; }
.ma-avg-n small { font-size: 14px; font-weight: 700; margin-left: 3px; color: var(--ma-muted); }
.ma-avg-n span { font-size: 12px; font-weight: 700; color: var(--ma-muted); margin-top: 3px; }

/* The court (top: map feet x 0..44 along, y 0..20 across, viewBox -3 -3 54 26; side: x along,
   y = -2 x height in feet, ground at 0) */
.ma-court { display: block; width: 100%; height: auto; margin-top: 10px; border-radius: 12px;
  user-select: none; -webkit-tap-highlight-color: transparent; }
.ma-court[hidden], .ma-court [hidden] { display: none; }
.ma-ct-apron { fill: #0B1626; }
.ma-ct-court { fill: #123C52; }
.ma-ct-kitchen { fill: #175066; }
.ma-ct-line { fill: none; stroke: rgba(226, 240, 248, .82); stroke-width: 1.4px;
  vector-effect: non-scaling-stroke; }
.ma-ct-net { stroke: rgba(241, 245, 249, .95); stroke-width: 3px; vector-effect: non-scaling-stroke; }
.ma-ct-zone { fill: none; stroke: rgba(241, 245, 249, .55); stroke-width: 1.2px; stroke-dasharray: 4 3;
  vector-effect: non-scaling-stroke; }
.ma-ct-zl { fill: rgba(226, 240, 248, .75); font-size: 1.35px; font-weight: 700; text-anchor: middle; }
.ma-ct-who { fill: rgba(226, 240, 248, .7); font-size: 1.6px; font-weight: 700; text-anchor: middle; }

/* Markers: team colour; ring = the opponent volleyed it there; red = into the net */
.ma-mk-s1 { --ma-mk: #22D3EE; }
.ma-mk-s2 { --ma-mk: #FBBF24; }
.ma-mk-s0 { --ma-mk: #CBD5E1; }
.ma-mk-hit { fill: transparent; }
.ma-mk { cursor: pointer; }
.ma-mk-dot { fill: var(--ma-mk); stroke: #0B1626; stroke-width: .16; }
.ma-mk.is-v .ma-mk-dot { fill: #123C52; stroke: var(--ma-mk); stroke-width: .3; }
.ma-mk.is-n .ma-mk-dot { fill: #F43F5E; }
.ma-mk-ln { stroke: var(--ma-mk); stroke-width: 1px; opacity: .4; vector-effect: non-scaling-stroke; }
.ma-court.has-sel .ma-mk:not(.is-sel) { opacity: .2; }
.ma-mk.is-sel .ma-mk-dot { stroke: #fff; stroke-width: .4; }
.ma-mk.is-sel .ma-mk-ln { stroke: #fff; stroke-width: 2px; opacity: 1; }
.ma-sd-floor { fill: #123C52; }
.ma-sd-net { stroke: rgba(241, 245, 249, .95); stroke-width: 3px; vector-effect: non-scaling-stroke; }
.ma-arc-ln { fill: none; stroke: var(--ma-mk); stroke-width: 1.5px; opacity: .75; vector-effect: non-scaling-stroke; }
.ma-arc-hit { fill: none; stroke: transparent; stroke-width: 14px; vector-effect: non-scaling-stroke; }
.ma-arc.is-sel .ma-arc-ln { stroke: #fff; stroke-width: 3px; opacity: 1; }
.ma-mk-o { display: none; }
.ma-smap.is-est .ma-mk.is-el .ma-mk-dot { fill: var(--ma-mk); fill-opacity: .35; stroke: var(--ma-mk); stroke-width: .28;
  stroke-dasharray: .32 .3; stroke-linecap: round; }
.ma-smap.is-est .ma-mk.is-eo .ma-mk-ln { stroke-dasharray: 2 3; stroke-linecap: round; opacity: .9; }
.ma-smap.is-est .ma-mk-o { display: inline; fill: none; stroke: var(--ma-mk); stroke-width: .2;
  stroke-dasharray: .3 .28; stroke-linecap: round; }
.ma-smap.is-est .ma-mk.is-sel.is-el .ma-mk-dot, .ma-smap.is-est .ma-mk.is-sel .ma-mk-o { stroke: #fff; }

/* Under the map: the tapped shot's numbers as plain text (not buttons), or the key, and one Watch button */
.ma-smap-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 10px; min-height: 36px; }
.ma-smap-chips { display: flex; flex-wrap: wrap; column-gap: 16px; row-gap: 2px; }
.ma-smap-chips[hidden], .ma-chip[hidden], .ma-smap-key[hidden] { display: none; }
.ma-chip { display: inline-flex; align-items: baseline; gap: 4px; color: var(--ma-navy); font-size: 20px;
  font-weight: 800; white-space: nowrap; }
.ma-chip small { font-size: 12px; font-weight: 700; color: var(--ma-muted); }
.ma-smap-w { flex: none; }
.ma-smap-key { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ma-muted); }
.ma-key-dot, .ma-key-ring, .ma-key-net { width: 10px; height: 10px; border-radius: 999px; flex: none; }
.ma-key-dot { background: var(--ma-navy); }
.ma-key-ring { border: 2px solid var(--ma-navy); margin-left: 8px; }
.ma-key-net { background: #F43F5E; margin-left: 8px; }
.ma-key-est { width: 10px; height: 10px; border-radius: 999px; flex: none; border: 2px dotted var(--ma-navy); }

/* Serve + return depth donuts: darkest = deep */
.ma-side-1 { --ma-z1: #0E7490; --ma-z2: #22D3EE; --ma-z3: #A5F3FC; }
.ma-side-2 { --ma-z1: #B45309; --ma-z2: #F59E0B; --ma-z3: #FDE68A; }
.ma-side-0 { --ma-z1: #334155; --ma-z2: #94A3B8; --ma-z3: #E2E8F0; }
.ma-depth { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.ma-dn { background: #fff; border: 1px solid var(--ma-line); border-radius: 14px; padding: 12px 10px;
  display: flex; flex-direction: column; align-items: center; }
.ma-dn-title { font-size: 14px; font-weight: 800; color: var(--ma-navy); }
.ma-dn-svg { width: 112px; height: 112px; margin: 6px 0 8px; }
.ma-dn-track { fill: none; stroke: var(--ma-bg); stroke-width: 6; }
.ma-dn-seg { fill: none; stroke-width: 6; }
.ma-dn-seg.ma-z-deep { stroke: var(--ma-z1); }
.ma-dn-seg.ma-z-medium { stroke: var(--ma-z2); }
.ma-dn-seg.ma-z-short { stroke: var(--ma-z3); }
.ma-dn-n { font-family: 'Sora', sans-serif; font-size: 10px; font-weight: 800; fill: var(--ma-navy);
  text-anchor: middle; }
.ma-dn-l { font-size: 3.6px; font-weight: 700; fill: var(--ma-muted); text-anchor: middle; }
.ma-dn-l.ma-dn-none { font-size: 4.4px; }
.ma-dn-legend { list-style: none; margin: 0; padding: 0; width: 100%; max-width: 150px; display: grid; gap: 4px; }
.ma-dn-legend li { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #334155; }
.ma-dn-legend span { flex: 1; }
.ma-dn-legend b { font-weight: 800; color: var(--ma-navy); }
.ma-dn-legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.ma-dn-legend .ma-z-deep { background: var(--ma-z1); }
.ma-dn-legend .ma-z-medium { background: var(--ma-z2); }
.ma-dn-legend .ma-z-short { background: var(--ma-z3); }

/* Hit spots: the player's own half upright (viewBox -3 -2 26 30), the glow (an image hitspots.js draws)
   under the lines, a ring where the court was tapped */
.ma-hs-court { max-width: 380px; margin: 12px auto 0; cursor: pointer; }
.ma-hs-court image { pointer-events: none; }
.ma-hs-net { fill: rgba(226, 240, 248, .7); font-size: 1.05px; font-weight: 700; text-anchor: middle; }
.ma-hs-pick { fill: rgba(255, 255, 255, .1); stroke: #fff; stroke-width: 2px; stroke-dasharray: 5 4;
  vector-effect: non-scaling-stroke; pointer-events: none; }
.ma-hs-key { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 10px;
  font-size: 12px; font-weight: 700; color: var(--ma-muted); }
.ma-hs-off { margin-top: 6px; text-align: center; font-size: 12px; color: var(--ma-muted); }
.ma-hs-key[hidden], .ma-hs-off[hidden], .ma-hs .ma-watch[hidden] { display: none; }
.ma-hs-ramp { width: 72px; height: 10px; border-radius: 5px; flex: none;
  background: linear-gradient(90deg, #123C52, #22D3EE 60%, #ECFEFF); }
.ma-hs-ramp-q { background: linear-gradient(90deg, #F43F5E, #94A3B8 50%, #34D378); }
.ma-hs-line { font-size: 14px; font-weight: 700; color: var(--ma-navy); }
