/* Match-analysis page: shell (ai-docs/MATCH_ANALYSIS_PAGE_REDESIGN.md). Tokens, pinned stage
   (video + now-playing bar), tabs, buttons, bottom sheet. Self-contained: main.css is a
   precompiled Tailwind subset. Tab content styles live in content.css. */
.ma {
  --ma-navy: #0B1D33; --ma-teal: #0891B2; --ma-teal-d: #0E7490; --ma-teal-soft: #ECFEFF;
  --ma-amber: #D97706; --ma-amber-d: #B45309; --ma-bg: #F1F5F9; --ma-line: #E2E8F0;
  --ma-text: #0F172A; --ma-muted: #64748B; --ma-soft: #94A3B8;
  --ma-stage-h: calc(56.25vw + 52px);
  max-width: 1280px; margin: 0 auto; padding: 0 0 40px; color: var(--ma-text);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 15px; line-height: 1.45;
}
.ma *, .ma *::before, .ma *::after { box-sizing: border-box; }
.ma button { font-family: inherit; }
.ma-side-1 { --ma-side: #0891B2; --ma-side-soft: #CFFAFE; }
.ma-side-2 { --ma-side: #D97706; --ma-side-soft: #FEF3C7; }
.ma-side-0 { --ma-side: #94A3B8; --ma-side-soft: #F1F5F9; }
.ma-c1 { color: var(--ma-teal-d); }
.ma-c2 { color: var(--ma-amber-d); }
.ma-c0 { color: var(--ma-navy); }
.ma-ico { width: 18px; height: 18px; fill: currentColor; flex: none; }
.ma-chev path, .ma-acc-chev path, .ma-step path, .ma-won path {
  fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* Header + banners */
.ma-preview { background: #FEF3C7; border-bottom: 1px solid #F59E0B; color: #78350F;
  padding: 8px 16px; font-size: 13px; }
.ma-head { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; }
.ma-head-text { min-width: 0; }
.ma-head-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.ma-swing-switch { display: inline-flex; align-items: center; gap: 4px; }
.ma-swing-label { font-size: 12px; font-weight: 600; color: var(--ma-muted); margin-right: 2px; white-space: nowrap; }
.ma-title { font-family: 'Sora', sans-serif; font-size: 18px; font-weight: 700; color: var(--ma-navy);
  margin: 0; letter-spacing: -.01em; }
.ma-partial { display: inline-block; vertical-align: middle; margin-left: 8px; padding: 2px 8px; border-radius: 999px;
  background: #FEF3C7; color: var(--ma-amber-d); font-family: inherit; font-size: 11px; font-weight: 700;
  letter-spacing: .02em; cursor: help; }
/* Court notice (court_note.py, Bryan 11-16 "dont hide things"): the amber pill + its tooltip after the title */
.ma-court-flag { cursor: default; }
.ma-title .ma-tip-btn { margin-left: 2px; }
/* Admin tab: Show court (court_overlay.js) */
.ma-court-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.ma-court-row .ma-note { margin: 0; }
.ma-sub { color: var(--ma-muted); font-size: 13px; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; }
.ma-h2 { font-family: 'Sora', sans-serif; font-size: 17px; font-weight: 700; color: var(--ma-navy);
  margin: 0; letter-spacing: -.01em; }
.ma-h3 { font-family: 'Sora', sans-serif; font-size: 15px; font-weight: 700; color: var(--ma-navy);
  margin: 0 0 8px; }
.ma-note { color: var(--ma-muted); font-size: 13px; margin: 6px 0 0; }
.ma-empty { margin: 16px; background: #fff; border: 1px solid var(--ma-line); border-radius: 16px;
  padding: 24px 20px; text-align: center; }
.ma-empty p { color: var(--ma-muted); margin: 6px 0 0; }
.ma-empty-admin { margin: 16px; }

/* Buttons */
.ma-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 8px 16px; border-radius: 10px; border: 1.5px solid transparent;
  font-size: 14px; font-weight: 700; text-decoration: none; cursor: pointer; white-space: nowrap; }
.ma-btn-sm { min-height: 34px; padding: 5px 12px; font-size: 13px; }
.ma-btn-outline { background: #fff; border-color: var(--ma-line); color: var(--ma-navy); }
.ma-btn-outline:hover { border-color: var(--ma-soft); }
.ma-btn-primary { background: var(--ma-teal); color: #fff; }
.ma-btn-primary:hover { background: var(--ma-teal-d); }
.ma-btn-block { width: 100%; }
.ma-watch { display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; cursor: pointer; background: var(--ma-teal); color: #fff; font-weight: 700;
  font-size: 13px; border-radius: 999px; min-height: 36px; padding: 6px 14px; }
.ma-watch:hover { background: var(--ma-teal-d); }
.ma-watch .ma-ico { width: 14px; height: 14px; }
.ma-watch-block { width: 100%; margin-top: 10px; }
.ma-watch-icon { width: 36px; height: 36px; padding: 0; background: var(--ma-teal-soft);
  color: var(--ma-teal-d); }
.ma-watch-icon:hover { background: #CFFAFE; }
.ma-watch.is-now { background: var(--ma-navy); color: #fff; }
.ma button:focus-visible, .ma a:focus-visible, .ma summary:focus-visible {
  outline: 3px solid rgba(8, 145, 178, .45); outline-offset: 2px; }

/* Stage: pinned video + now-playing bar */
.ma-stage { position: sticky; top: 0; z-index: 30; background: #000; }
.ma-video { position: relative; aspect-ratio: 16 / 9; background: #000; }
.ma-video .video-js { position: absolute; inset: 0; width: 100%; height: 100%; }
/* Skip breaks pill (top left, shown with the video's controls) and the rally tag (top right, stays on),
   inside the player so full screen keeps them (player.js) */
.ma .ma-skip { position: absolute; top: 8px; left: 8px; z-index: 3; height: 30px; padding: 0 12px;
  border-radius: 999px; border: 1px solid rgba(255, 255, 255, .7); background: rgba(11, 29, 51, .55); color: #fff;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif; font-size: 12px; font-weight: 700; cursor: pointer;
  transition: opacity .6s, background .15s; }
.ma .ma-skip:hover { background: rgba(11, 29, 51, .75); }
.ma .ma-skip[aria-pressed="true"] { background: var(--ma-teal); border-color: var(--ma-teal); }
.ma .ma-skip[aria-pressed="true"]:hover { background: var(--ma-teal-d); }
.video-js.vjs-has-started.vjs-user-inactive.vjs-playing .ma-skip { opacity: 0; pointer-events: none; }
.ma .ma-rtag { position: absolute; top: 8px; right: 8px; z-index: 3; padding: 5px 10px; border-radius: 999px;
  background: rgba(11, 29, 51, .7); color: #fff; font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 12px; font-weight: 700; line-height: 1.2; pointer-events: none; }
.ma .ma-rtag[hidden] { display: none; }
/* -5 / +5 double tap bubble (player_seek.js); manipulation = no double-tap zoom on the video */
.ma .ma-video .video-js { touch-action: manipulation; }
.ma .ma-seekbub { position: absolute; top: 50%; left: 14%; z-index: 3; width: 64px; height: 64px;
  margin: -32px 0 0 -32px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: rgba(11, 29, 51, .6); color: #fff; font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 17px; font-weight: 700; pointer-events: none; }
.ma .ma-seekbub.is-right { left: 86%; }
.ma .ma-seekbub[hidden] { display: none; }
.ma .ma-seekbub.is-on { animation: ma-seekbub .7s ease-out forwards; }
@keyframes ma-seekbub { 0% { opacity: 0; transform: scale(.8); } 15% { opacity: 1; transform: none; }
  70% { opacity: 1; } 100% { opacity: 0; } }
/* Phones: -5 / +5 take the room of volume (hardware buttons) and picture in picture, so the seek bar keeps its width */
@media (max-width: 479px) {
  .ma .ma-video .vjs-volume-panel, .ma .ma-video .vjs-picture-in-picture-control { display: none; }
}
.ma-video-missing { display: flex; align-items: center; justify-content: center; color: var(--ma-soft);
  font-size: 14px; aspect-ratio: auto; min-height: 64px; background: var(--ma-navy); }
.ma-now { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 6px 8px;
  background: var(--ma-navy); color: #fff; }
.ma-now-text { flex: 1; min-width: 0; text-align: center; }
.ma-now-title { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; }
.ma-now-sub { font-size: 12px; color: #CBD5E1; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; min-height: 0; }
.ma-now-sub:empty { display: none; }
.ma-now-row { display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; }
/* Made / missed switch (ai-docs/MATCH_ANALYSIS_MATCH_BARS_AND_MISSES_PLAN.md): button-styled, the playing set solid */
.ma-now-sw { display: flex; gap: 6px; flex: none; margin-top: 4px; }
.ma-now-sw[hidden] { display: none; }
.ma-now-set { height: 28px; padding: 0 10px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .4);
  background: none; color: #fff; font: inherit; font-size: 12px; font-weight: 600; white-space: nowrap;
  cursor: pointer; }
.ma-now-set b { margin-left: 4px; font-weight: 800; }
.ma-now-set:hover:not(:disabled) { background: rgba(255, 255, 255, .14); }
.ma-now-set[aria-pressed="true"] { background: var(--ma-teal); border-color: var(--ma-teal); }
.ma-now-set:disabled { opacity: .4; cursor: default; }
.ma-now-sw:not([hidden]) + .ma-now-sub { margin-top: 4px; font-weight: 600; }
.ma-now.is-idle .ma-now-title { font-weight: 600; color: #CBD5E1; }
.ma-step { width: 40px; height: 40px; flex: none; border-radius: 999px; border: 0; cursor: pointer;
  background: rgba(255, 255, 255, .12); color: #fff; display: flex; align-items: center;
  justify-content: center; }
.ma-step svg { width: 22px; height: 22px; }
.ma-step:hover:not(:disabled) { background: rgba(255, 255, 255, .22); }
.ma-step:disabled { opacity: .3; cursor: default; }
.ma-step.is-ready { background: var(--ma-teal); box-shadow: 0 0 0 4px rgba(8, 145, 178, .35); }

/* Tabs */
.ma-tabs { position: sticky; top: var(--ma-stage-h); z-index: 20; display: flex; gap: 6px; padding: 5px 12px 6px; background: #fff;
  border-bottom: 1px solid var(--ma-line); }
.ma-novideo .ma-tabs { top: 0; }
.ma-tab { flex: 1; min-width: 0; height: 36px; padding: 0 4px; border: 1px solid var(--ma-line); border-radius: 10px; background: #fff;
  cursor: pointer; font-size: 14px; font-weight: 700; color: var(--ma-navy); }
.ma-tab:hover { border-color: var(--ma-soft); }
.ma-tab[aria-selected="true"] { background: var(--ma-navy); border-color: var(--ma-navy); color: #fff; }
.ma-tab-admin { flex: 0 0 auto; padding: 0 10px; font-size: 13px; color: var(--ma-amber-d); }
.ma-tabpanel { padding: 16px; }
.ma-tabpanel[hidden] { display: none; }

/* Desktop: video left (sticky), tabs right */
@media (min-width: 1024px) {
  .ma { padding: 0 16px 48px; }
  .ma-head { padding: 16px 0; }
  .ma-title { font-size: 22px; }
  .ma-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 24px;
    align-items: start; }
  .ma-stage { top: 16px; border-radius: 16px; overflow: hidden;
    box-shadow: 0 10px 30px rgba(11, 29, 51, .18); }
  .ma-now { min-height: 60px; padding: 8px 12px; }
  .ma-now-title { font-size: 15px; }
  .ma-panel { background: #fff; border: 1px solid var(--ma-line); border-radius: 16px; min-height: 60vh; }
  .ma-tabs, .ma-novideo .ma-tabs { top: 0; border-radius: 16px 16px 0 0; }
  .ma-tabpanel { padding: 20px; }
}

/* Bottom sheet (About) */
.ma-sheet { position: fixed; inset: 0; z-index: 1100; display: flex; align-items: flex-end;
  justify-content: center; }
.ma-sheet[hidden] { display: none; }
.ma-sheet-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .5); }
.ma-sheet-panel { position: relative; width: 100%; max-width: 32rem; margin: 0 auto; background: #fff;
  border-radius: 20px 20px 0 0; padding: 10px 20px calc(20px + env(safe-area-inset-bottom));
  box-shadow: 0 -10px 30px rgba(15, 23, 42, .2); }
.ma-sheet-grip { width: 40px; height: 4px; border-radius: 999px; background: var(--ma-line);
  margin: 0 auto 14px; }
.ma-about { margin: 12px 0 18px; padding: 0; list-style: none; display: grid; gap: 10px;
  font-size: 14px; color: #334155; }
.ma-about li { padding-left: 16px; position: relative; }
.ma-about li::before { content: ''; position: absolute; left: 0; top: .6em; width: 6px; height: 6px;
  border-radius: 999px; background: var(--ma-teal); }
@media (min-width: 1024px) {
  .ma-sheet { align-items: center; }
  .ma-sheet-panel { border-radius: 20px; padding-bottom: 20px; }
}

/* The site-wide floating Back button would cover the tab content here; "Match page" in the
   header is the way back (this stylesheet only loads on this page). */
.page-back-link { display: none !important; }
