/* Match viewer mockup v2: PM-2026 tokens copied from themes/pm-2026/styles.css.
   Fonts fall back to system fonts offline (the site loads Archivo/Inter). */
:root {
  --display: "Archivo", "Archivo Narrow", system-ui, sans-serif;
  --ui: "Inter", system-ui, sans-serif;
  --pitch:       oklch(0.38 0.16 140);
  --pitch-deep:  oklch(0.24 0.1 145);
  --pitch-ink:   #e8ffdc;
  --cream:       oklch(0.975 0.012 95);
  --cream-2:     oklch(0.955 0.02 120);
  --card:        #ffffff;
  --ink:         oklch(0.22 0.04 140);
  --muted:       oklch(0.52 0.03 140);
  --border:      oklch(0.9 0.02 140);
  --border-2:    oklch(0.85 0.025 140);
  --accent:      oklch(0.63 0.19 138);
  --accent-soft: oklch(0.93 0.11 138);
  --accent-ink:  oklch(0.38 0.16 140);
  --gold:        oklch(0.82 0.15 90);
  --gold-deep:   oklch(0.62 0.16 75);
  --shadow-sm: 0 1px 2px rgba(16,30,20,0.06);
  --shadow-md: 0 6px 20px -8px rgba(16,30,20,0.18), 0 2px 6px -2px rgba(16,30,20,0.08);
  /* viewer-only */
  --track: rgba(0,0,0,0.08);
  --grid-line: oklch(0.9 0.02 140);
  --home: #c00; --away: #880; --home-mark: #c00; --away-mark: #880;
  --home-ink: #fff; --away-ink: #000;
  --gap: 12px;
  color-scheme: light;
}
/* Dark = the site's "bold" theme values */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --cream: oklch(0.17 0.02 155); --cream-2: oklch(0.2 0.025 155); --card: oklch(0.22 0.03 155);
    --ink: oklch(0.96 0.01 95); --muted: oklch(0.7 0.02 150); --border: oklch(0.3 0.03 155);
    --border-2: oklch(0.35 0.03 155); --accent: oklch(0.75 0.18 145); --accent-soft: oklch(0.3 0.12 145);
    --accent-ink: oklch(0.85 0.15 145); --track: rgba(255,255,255,0.1); --grid-line: oklch(0.32 0.03 155);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --cream: oklch(0.17 0.02 155); --cream-2: oklch(0.2 0.025 155); --card: oklch(0.22 0.03 155);
  --ink: oklch(0.96 0.01 95); --muted: oklch(0.7 0.02 150); --border: oklch(0.3 0.03 155);
  --border-2: oklch(0.35 0.03 155); --accent: oklch(0.75 0.18 145); --accent-soft: oklch(0.3 0.12 145);
  --accent-ink: oklch(0.85 0.15 145); --track: rgba(255,255,255,0.1); --grid-line: oklch(0.32 0.03 155);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--ui); color: var(--ink); background: var(--cream); -webkit-font-smoothing: antialiased; font-size: 13px; line-height: 1.4; }
button { font: inherit; color: inherit; }
.ico { width: 16px; height: 16px; flex-shrink: 0; display: inline-block; vertical-align: middle; }

/* ---------- Shared site components (subset) ---------- */
.panel { background: var(--card); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-sm); }
.panel__title { font-family: var(--display); font-size: 12px; margin: 0; text-transform: uppercase; letter-spacing: 1.5px; font-weight: 800; color: var(--ink); }
.btn { font-family: var(--ui); font-size: 12px; font-weight: 600; padding: 8px 14px; border-radius: 8px; border: 1px solid transparent;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: background 0.15s, border-color 0.15s; }
.btn--solid { background: var(--pitch); color: #fff; }
.btn--solid:hover { background: oklch(0.4 0.08 150); }
.btn--ghost { background: transparent; border-color: var(--border-2); color: var(--ink); }
.btn--ghost:hover { background: var(--cream-2); }
.btn--sm { padding: 5px 10px; font-size: 11px; white-space: nowrap; }
.btn:focus-visible, .mv-tab:focus-visible, .mv-seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; font-size: 11px; font-weight: 600;
  background: rgba(0,0,0,0.06); color: var(--ink); border-radius: 999px; white-space: nowrap; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex-shrink: 0; box-shadow: 0 0 0 1px rgba(0,0,0,0.25); }

/* ---------- Page grid: everything fits one viewport (desktop + tablet) ---------- */
.mv { height: 100vh; height: 100dvh; max-width: 1640px; margin: 0 auto; padding: var(--gap); display: grid; gap: var(--gap);
  grid-template-columns: minmax(0, 1fr) clamp(320px, 25vw, 400px); grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas: "board side" "main side"; }
.mv-board { grid-area: board; }
.mv-main { grid-area: main; display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: var(--gap); min-height: 0; min-width: 0; }
.mv-side { grid-area: side; display: flex; flex-direction: column; min-height: 0; min-width: 0; }

/* ---------- Scoreboard (compact) ---------- */
.mv-board { position: relative; border-radius: 14px; overflow: hidden; color: var(--pitch-ink);
  background: radial-gradient(ellipse at top, oklch(0.36 0.1 145) 0%, transparent 70%), linear-gradient(180deg, var(--pitch-deep) 0%, oklch(0.3 0.12 142) 100%);
  border: 1px solid oklch(0.25 0.05 155); box-shadow: var(--shadow-md); }
.mv-board__strip { height: 4px; background: linear-gradient(90deg, var(--home) 0 50%, var(--away) 50% 100%); }
.mv-board__main { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 14px; padding: 8px 16px 4px; }
.mv-team { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mv-team--away { flex-direction: row-reverse; text-align: right; }
.mv-crest { width: 36px; height: 41px; flex-shrink: 0; filter: drop-shadow(0 3px 6px rgba(0,0,0,0.35)); }
.mv-crest svg { width: 100%; height: 100%; display: block; }
.mv-team__txt { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mv-team__name { font-family: var(--display); font-weight: 800; font-size: 19px; line-height: 1.1; color: #fff; overflow-wrap: anywhere; }
.mv-team__scorers { font-size: 11px; color: oklch(0.85 0.04 140); min-height: 15px; }
.mv-team__scorers span { white-space: nowrap; }
.mv-team__scorers .ico { width: 12px; height: 12px; }
.mv-score { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.mv-score__nums { font-family: var(--display); font-weight: 900; font-size: 34px; line-height: 1; color: #fff; font-variant-numeric: tabular-nums;
  display: flex; align-items: center; gap: 8px; padding: 4px 14px; border-radius: 10px; background: rgba(0,0,0,0.28); border: 1px solid rgba(255,255,255,0.1); }
.mv-score__nums .sep { color: var(--gold); font-size: 22px; }
.mv-score__nums .bump { animation: bump 0.8s ease-out; }
@keyframes bump { 0% { transform: scale(1.6); color: var(--gold); } 100% { transform: scale(1); } }
.mv-clock { display: inline-flex; align-items: center; gap: 7px; font-family: var(--display); font-weight: 700; font-size: 11px;
  text-transform: uppercase; letter-spacing: 1.1px; color: var(--gold); white-space: nowrap; }
.mv-clock b { color: #fff; font-size: 14px; letter-spacing: 0.5px; font-variant-numeric: tabular-nums; }
.mv-live { width: 7px; height: 7px; border-radius: 50%; background: oklch(0.72 0.18 145); box-shadow: 0 0 0 3px oklch(0.72 0.18 145 / 0.25); }
.is-playing .mv-live { animation: pulse 2s ease-in-out infinite; }
.is-ended .mv-live { background: oklch(0.7 0.02 140); box-shadow: none; }
.is-live .mv-live { background: #e53935; box-shadow: 0 0 0 3px rgba(229,57,53,0.3); animation: pulse 2s ease-in-out infinite; }
/* live: the Live button beside the clock; filled when playback is at the live minute */
.mv-golive { display: inline-flex; align-items: center; gap: 5px; margin-left: 6px; padding: 2px 8px; border-radius: 999px; border: 1.5px solid #e53935;
  background: none; color: #e53935; font: 800 11px/1.4 var(--ui); text-transform: uppercase; letter-spacing: 0.5px; cursor: pointer; vertical-align: 2px; }
.mv-golive i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.mv-golive.is-edge { background: #e53935; color: #fff; cursor: default; }
.mv-golive.is-edge i { animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px oklch(0.72 0.18 145 / 0); } }
.mv-board__meta { display: flex; justify-content: center; gap: 4px 14px; padding: 0 16px 7px; font-size: 11px; color: oklch(0.85 0.04 140);
  white-space: nowrap; overflow: hidden; }
.mv-board__meta span { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.mv-board__meta .ico { width: 13px; height: 13px; opacity: 0.85; }

/* ---------- Stage (pitch + on-pitch HUD) ---------- */
.mv-stage { position: relative; min-height: 0; display: flex; flex-direction: column;
  background: linear-gradient(180deg, oklch(0.22 0.06 150), oklch(0.18 0.05 155)); border-color: oklch(0.25 0.05 155); color: var(--pitch-ink); }
.mv-pitch { display: block; width: 100%; height: 100%; min-height: 0; flex: 1 1 auto; }
.pl { fill: none; stroke: rgba(255,255,255,0.78); stroke-width: 3; }
.zl { stroke: rgba(255,255,255,0.14); stroke-width: 2; stroke-dasharray: 8 10; }
.zone-glow { transition: x 0.35s ease, y 0.35s ease, opacity 0.3s; }
.pdir { font: 700 24px var(--display); fill: rgba(255,255,255,0.85); letter-spacing: 0.5px; }
.arrow-g.is-pulse .arrow-body { animation: arrowpulse 1.2s ease-in-out infinite; }
@keyframes arrowpulse { 50% { opacity: 0.62; } }
.fx-burst { animation: burst 0.9s ease-out both; transform-box: fill-box; transform-origin: center; }
@keyframes burst { 0% { transform: scale(0.2); opacity: 1; } 100% { transform: scale(2.2); opacity: 0; } }
.fx-shot { animation: fxfade 1.6s ease-out both; }
@keyframes fxfade { 0%, 60% { opacity: 1; } 100% { opacity: 0.25; } }

/* state pill (top centre) */
.mv-hud { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px;
  pointer-events: none; width: min(92%, 520px); z-index: 2; }
.mv-pill { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px 5px 8px; border-radius: 999px; max-width: 100%;
  background: rgba(8,20,12,0.72); border: 1px solid rgba(255,255,255,0.16); color: #fff; font-size: 12px; font-weight: 700;
  backdrop-filter: blur(4px); transition: opacity 0.25s, background 0.3s, border-color 0.3s; white-space: nowrap; }
.mv-pill .dot { width: 10px; height: 10px; }
.mv-pill .st { font-family: var(--display); text-transform: uppercase; letter-spacing: 1px; font-weight: 800; font-size: 11px; }
.mv-pill .tm { font-weight: 600; opacity: 0.9; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.mv-pill.is-hidden { opacity: 0; }
.mv-pill[data-kind="attack"] { border-color: rgba(255,255,255,0.35); }
.mv-pill[data-kind="dangerous"] { background: rgba(150,20,20,0.82); border-color: rgba(255,140,140,0.6); animation: pillpulse 1.2s ease-in-out infinite; }
.mv-pill[data-kind="goal"] { background: var(--pitch); border-color: var(--gold); }
.mv-pill[data-kind="shotOn"], .mv-pill[data-kind="shotOff"], .mv-pill[data-kind="blocked"] { background: rgba(20,20,20,0.85); border-color: var(--gold); }
@keyframes pillpulse { 50% { box-shadow: 0 0 0 5px rgba(255,80,80,0.25); } }

/* event toasts (cards, subs, goals) under the pill */
.mv-toasts { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; }
.mv-toast { display: grid; grid-template-columns: 6px 22px minmax(0, 1fr) auto; align-items: center; gap: 8px; min-width: min(260px, 100%); max-width: 100%;
  background: #0d0f0d; color: #fff; border-radius: 9px; padding: 6px 10px 6px 0; overflow: hidden; box-shadow: 0 10px 24px -10px rgba(0,0,0,0.7);
  animation: toastin 0.3s ease-out; font-size: 12px; }
.mv-toast .bar { align-self: stretch; }
.mv-toast .ico { width: 18px; height: 18px; }
.mv-toast b { display: block; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mv-toast small { display: block; opacity: 0.75; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mv-toast .min { font-family: var(--display); font-weight: 800; font-size: 13px; color: var(--gold); }
@keyframes toastin { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* centre banners: goal / kick-off / half-time / full time */
.mv-banner { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(0.96); opacity: 0; pointer-events: none; z-index: 3;
  transition: opacity 0.25s, transform 0.25s; text-align: center; max-width: 92%; }
.mv-banner.is-on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.mv-banner__box { background: rgba(0,0,0,0.86); color: #fff; border-radius: 10px; padding: 12px 26px; font-family: var(--display); font-weight: 800;
  font-size: 22px; letter-spacing: 0.5px; box-shadow: 0 16px 40px -12px rgba(0,0,0,0.7); }
.mv-banner__box small { display: block; font-family: var(--ui); font-weight: 600; font-size: 13px; letter-spacing: 0; opacity: 0.85; margin-top: 4px; }
/* missed shot: short centre box, the shooting team's colour on top */
.mv-banner--shot .mv-banner__box { border-top: 5px solid var(--shot-team, #fff); text-transform: uppercase; }
.mv-banner--shot small { text-transform: none; }
/* goal: boss0102 / CM 01/02 style - the commentary bar becomes a wide, hard bevelled bar in the scorer's kit,
   its two colours swapping every 100 ms */
.mv-caption.is-goal { transition: none; display: block; width: calc(100% - 20px); padding: 0; background: none; border: 0; backdrop-filter: none; border-radius: 0; }
.mv-goalbar { background: var(--banner-bg, #111); color: var(--banner-ink, #fff); padding: 8px 16px 9px; text-align: center; border: 1px solid #000;
  box-shadow: inset 2px 2px 0 rgba(255,255,255,0.55), inset -2px -2px 0 rgba(0,0,0,0.45), 0 10px 30px -10px rgba(0,0,0,0.7);
  font-family: var(--display); text-transform: uppercase; animation: goalflash 0.2s steps(1, end) infinite; }
.mv-goalbar .shout { font-size: 26px; font-weight: 900; letter-spacing: 1px; line-height: 1.1; }
.mv-goalbar .team { font-size: 22px; font-weight: 800; margin-left: 10px; }
.mv-goalbar small { display: block; font-family: var(--ui); font-size: 13px; font-weight: 700; text-transform: none; margin-top: 2px; }
@keyframes goalflash { 50% { background: var(--banner-ink, #fff); color: var(--banner-bg, #111); } }

/* current commentary: on the pitch (bottom) on desktop/tablet, under it on phones */
.mv-caption { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); width: min(88%, 720px); z-index: 2; pointer-events: none;
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start;
  background: rgba(8,16,10,0.78); color: #fff; border-radius: 10px; padding: 8px 14px; border: 1px solid rgba(255,255,255,0.14);
  backdrop-filter: blur(4px); font-size: 13px; line-height: 1.4; font-weight: 600; transition: opacity 0.35s; }
.mv-caption.is-empty, .mv-caption.is-stale { opacity: 0; }
.mv-caption .min { font-family: var(--display); font-weight: 800; color: var(--gold); font-size: 14px; }
.mv-caption .txt { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.mv-caption.is-new .txt { animation: capin 0.4s ease-out; }
@keyframes capin { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- Timeline (momentum + scrubber + controls) ---------- */
.mv-timeline { display: flex; flex-direction: column; min-width: 0; flex-shrink: 0; }
.mv-tl-head { display: flex; justify-content: space-between; align-items: center; gap: 4px 12px; flex-wrap: wrap; padding: 8px 14px 0; }
.mv-legend { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 11px; color: var(--muted); font-weight: 600; min-width: 0; }
.mv-legend span { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.mv-legend .sw { width: 12px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.mv-momentum { position: relative; flex-shrink: 0; height: clamp(72px, 13dvh, 150px); margin-top: 2px; touch-action: pan-y; }
.mv-momentum svg { display: block; width: 100%; height: 100%; cursor: pointer; }
.m-axis text { font: 600 10px var(--ui); fill: var(--muted); }
.m-grid { stroke: var(--grid-line); stroke-width: 1; }
.m-mid { stroke: var(--border-2); stroke-width: 1.5; }
.m-ht { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.m-ht-l { font: 700 9px var(--ui); fill: var(--muted); letter-spacing: 0.8px; }
.m-future { fill: var(--track); opacity: 0.45; }
.m-head { stroke: var(--ink); stroke-width: 1.5; }
.m-mark { opacity: 0; transition: opacity 0.25s; }
.m-mark.is-on { opacity: 1; }
.m-hover { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 2 2; opacity: 0; }
.mv-tip { position: absolute; top: 4px; pointer-events: none; opacity: 0; background: var(--card); color: var(--ink);
  border: 1px solid var(--border-2); border-radius: 8px; padding: 6px 9px; font-size: 11px; box-shadow: var(--shadow-md);
  min-width: 150px; max-width: 230px; transition: opacity 0.1s; z-index: 3; }
.mv-tip.is-on { opacity: 1; }
.mv-tip b { font-family: var(--display); font-size: 12px; }
.mv-tip .row { display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.mv-tip .row .v { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.mv-tip .ev { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--border); color: var(--muted); }
.mv-range { display: block; width: calc(100% - 10px); margin: 2px 5px 0; height: 18px; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; }
.mv-range::-webkit-slider-runnable-track { height: 6px; border-radius: 999px; background: linear-gradient(90deg, var(--accent) 0 var(--p, 0%), var(--track) var(--p, 0%) 100%); }
.mv-range::-moz-range-track { height: 6px; border-radius: 999px; background: var(--track); }
.mv-range::-moz-range-progress { height: 6px; border-radius: 999px; background: var(--accent); }
.mv-range::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; margin-top: -6px; background: var(--card); border: 3px solid var(--pitch); box-shadow: var(--shadow-md); }
.mv-range::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--card); border: 3px solid var(--pitch); }
.mv-range:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 999px; }
.mv-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 4px 12px 10px; }
.mv-controls .btn--round { width: 34px; height: 34px; padding: 0; border-radius: 50%; }
.mv-controls .btn--play { width: 42px; height: 42px; }
.mv-controls .btn--play .ico { width: 20px; height: 20px; }
.mv-time { font-family: var(--display); font-weight: 800; font-size: 17px; font-variant-numeric: tabular-nums; min-width: 84px; }
.mv-time small { font-size: 12px; color: var(--muted); font-weight: 700; }
.mv-speed { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; }
.mv-speed__lab { font-size: 10px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); font-weight: 700; }
.mv-seg { display: inline-flex; border: 1px solid var(--border-2); border-radius: 8px; overflow: hidden; }
.mv-seg button { border: 0; background: transparent; padding: 6px 10px; font-weight: 700; font-size: 12px; cursor: pointer; font-variant-numeric: tabular-nums; }
.mv-seg button + button { border-left: 1px solid var(--border-2); }
.mv-seg button[aria-pressed="true"] { background: var(--pitch); color: #fff; }

/* ---------- Side panel ---------- */
.mv-tabs { display: flex; gap: 4px; padding: 8px; background: var(--cream-2); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.mv-tab { flex: 1 1 auto; min-width: 0; border: 1px solid transparent; background: transparent; border-radius: 8px; padding: 7px 4px; font-family: var(--display); font-weight: 800;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--muted); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mv-tab:hover { color: var(--ink); }
.mv-tab[aria-selected="true"] { background: var(--card); color: var(--ink); border-color: var(--border-2); box-shadow: var(--shadow-sm); }
.mv-tabpanel { overflow: auto; min-height: 0; flex: 1 1 auto; padding: 12px 14px; overscroll-behavior: contain; }
.mv-tabpanel[hidden] { display: none; }
/* team and player names link to their pages; they keep the text's look until hovered */
.mv-link { color: inherit; text-decoration: none; }
.mv-link:hover, .mv-link:focus-visible { text-decoration: underline; text-underline-offset: 2px; }
.mv-lu .nm .mv-link { display: block; overflow: hidden; text-overflow: ellipsis; }
/* live: speed locked at 1x */
#speeds.is-locked { opacity: 0.55; }
#speeds.is-locked button { cursor: not-allowed; }
.mv-tab__badge { display: inline-block; margin-left: 5px; min-width: 16px; padding: 0 4px; border-radius: 999px; background: var(--border-2); color: var(--ink);
  font: 800 10px/16px var(--ui); vertical-align: 1px; }
/* match chat */
.mv-tab__badge.is-unread { background: #e53935; color: #fff; }
.mv-chat:not([hidden]) { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.mv-chat__list { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 10px 14px; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 6px; }
.mv-chat__msg { font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; min-width: 0; }
.mv-chat__msg .t { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.mv-chat__msg.is-me b { color: var(--accent); }
.mv-chat__msg.is-hidden { opacity: 0.45; text-decoration: line-through; }
.mv-chat__mod { border: 0; background: none; color: var(--muted); font: 700 11px var(--ui); cursor: pointer; padding: 0 2px; text-decoration: underline; }
.mv-chat__foot { flex-shrink: 0; border-top: 1px solid var(--border); padding: 8px 10px; }
.mv-chat__form { display: flex; gap: 6px; }
.mv-chat__form input { flex: 1 1 auto; min-width: 0; font: 500 13px var(--ui); padding: 7px 10px; border-radius: 8px; border: 1px solid var(--border-2);
  background: var(--card); color: var(--ink); }
.mv-chat__note { font-size: 12px; color: var(--muted); padding-top: 4px; }
.mv-chat__note:empty { display: none; }
.mv-side__btns { display: flex; gap: 6px; }
#btnExpand { display: inline-flex; align-items: center; gap: 5px; }
#btnExpand[hidden] { display: none; }
#btnExpand svg { width: 14px; height: 14px; }
.mv-side__foot { flex-shrink: 0; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 12px; border-top: 1px solid var(--border);
  font-size: 10px; color: var(--muted); background: var(--cream-2); }
.mv-h3 { font-family: var(--display); font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px; font-weight: 800; color: var(--muted); margin: 18px 0 8px; }
.mv-h3:first-child { margin-top: 0; }

/* commentary */
.mv-feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.mv-feed li { display: grid; grid-template-columns: 34px 22px minmax(0, 1fr); gap: 6px; padding: 9px 0; border-bottom: 1px solid var(--border); align-items: start; }
.mv-feed li:last-child { border-bottom: 0; }
.mv-feed__min { font-family: var(--display); font-weight: 800; font-size: 13px; font-variant-numeric: tabular-nums; padding-top: 1px; }
.mv-feed__ico { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; background: var(--cream-2); color: var(--muted); }
.mv-feed__ico .ico { width: 14px; height: 14px; }
.mv-feed__txt { line-height: 1.45; min-width: 0; overflow-wrap: anywhere; }
.mv-feed li.is-key { background: linear-gradient(90deg, color-mix(in oklab, var(--team, var(--accent)) 14%, transparent), transparent 70%);
  border-left: 3px solid var(--team, var(--accent)); padding-left: 6px; margin-left: -9px; }
.mv-feed li.is-key .mv-feed__txt { font-weight: 600; }
.mv-feed li.is-key .mv-feed__txt small { display: block; font-weight: 500; color: var(--muted); }
.mv-feed li.is-new { animation: feedin 0.5s ease-out; }
@keyframes feedin { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.mv-feed__ico--goal { background: var(--pitch); color: #fff; }
.mv-feed__ico--whistle { background: var(--ink); color: var(--card); }
.mv-empty { color: var(--muted); padding: 24px 0; text-align: center; }

/* stats */
.mv-stat { padding: 7px 0; }
.mv-stat__top { display: grid; grid-template-columns: 52px minmax(0, 1fr) 52px; align-items: baseline; gap: 6px; }
.mv-stat__top .v { font-family: var(--display); font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; }
.mv-stat__top .v--away { text-align: right; }
.mv-stat__top .k { text-align: center; font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px; }
.mv-stat__bars { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-top: 4px; }
.mv-stat__bar { height: 6px; background: var(--track); border-radius: 999px; overflow: hidden; display: flex; }
.mv-stat__bar--home { justify-content: flex-end; }
.mv-stat__bar i { display: block; height: 100%; border-radius: 999px; transition: width 0.4s ease; }
.mv-stat__bar--home i { background: var(--home-mark); }
.mv-stat__bar--away i { background: var(--away-mark); }
.mv-tac { width: 100%; border-collapse: collapse; font-size: 12px; table-layout: fixed; }
.mv-tac th, .mv-tac td { padding: 6px 4px; border-bottom: 1px solid var(--border); vertical-align: top; overflow-wrap: anywhere; }
.mv-tac th { color: var(--muted); font-weight: 600; text-align: center; font-size: 11px; width: 34%; }
.mv-tac td:first-child { text-align: left; font-weight: 600; }
.mv-tac td:last-child { text-align: right; font-weight: 600; }
.mv-tac thead td { font-family: var(--display); font-weight: 800; font-size: 12px; }

/* lineups */
.mv-lineups { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.mv-lu__head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; min-width: 0; }
.mv-lu__head .mv-crest { width: 24px; height: 27px; filter: none; }
.mv-lu__head b { font-family: var(--display); font-size: 13px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mv-lu__form { margin-bottom: 8px; }
.mv-lu ul { list-style: none; margin: 0; padding: 0; }
.mv-lu li { display: flex; flex-wrap: wrap; gap: 3px 7px; align-items: center; padding: 4px 0; border-bottom: 1px solid var(--border); font-size: 12px; }
.mv-lu li.is-off .nm { color: var(--muted); }
.mv-lu li.is-bench { opacity: 0.5; }
.mv-num { width: 24px; height: 20px; border-radius: 5px; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 11px;
  font-variant-numeric: tabular-nums; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.15); }
.mv-lu .nm { flex: 1 1 60px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.mv-lu .tags { margin-left: auto; display: inline-flex; align-items: center; gap: 3px; font-size: 10px; color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.mv-lu .tags .ico { width: 13px; height: 13px; }
.mv-rating { font-family: var(--display); font-weight: 800; font-size: 11px; color: var(--ink); background: var(--cream-2); border-radius: 4px; padding: 0 4px; }

/* zones */
.mv-mini { width: 100%; height: auto; display: block; border-radius: 8px; }
.mv-form-cap { display: flex; justify-content: space-between; gap: 10px; margin: 0 0 6px; font-size: 12px; min-width: 0; }
.mv-form-cap span { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.mv-form-cap .dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
#tab-lineups .mv-mini { margin-bottom: 14px; }
.mv-zone-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.mv-zone-cap { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; margin-bottom: 4px; min-width: 0; }
.mv-zone-cap span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mv-note { font-size: 11px; color: var(--muted); margin: 6px 0 0; }
.mv-shot-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11px; color: var(--muted); margin-top: 8px; }
.mv-shot-legend span { display: inline-flex; align-items: center; gap: 4px; }
.mv-shot-legend svg { width: 14px; height: 14px; }
.mini-num { font: 800 80px var(--display); fill: #fff; paint-order: stroke; stroke: rgba(0,0,0,0.6); stroke-width: 12px; }

/* ---------- Responsive ---------- */
/* <=1180: stacked; the side panel takes what is left of the viewport and scrolls inside */
@media (max-width: 1180px) {
  .mv { height: auto; min-height: 100dvh; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto; grid-template-areas: "board" "main" "side"; }
  .mv-main { grid-template-rows: auto auto; }
  .mv-stage { height: min(calc((100vw - 2 * var(--gap)) * 0.68), 46dvh); }
  .mv-side { height: min(70dvh, 560px); }
}
/* tall tablets (e.g. 820x1180): everything in one screen, the tabs take the rest and scroll */
@media (min-width: 601px) and (max-width: 1180px) and (min-height: 900px) {
  .mv { height: 100dvh; grid-template-rows: auto auto minmax(160px, 1fr); }
  .mv-side { height: auto; }
}
@media (max-width: 820px) {
  .mv-board__main { padding: 8px 10px 4px; gap: 8px; }
  .mv-team__name { font-size: 16px; }
  .mv-board__meta .opt { display: none; }
  .mv-caption { font-size: 12px; padding: 6px 10px; }
  .mv-banner__box { font-size: 18px; padding: 10px 18px; }
  .mv-goalbar .shout { font-size: 22px; } .mv-goalbar .team { font-size: 18px; }
}
/* phones: scoreboard, pitch, momentum and controls in the first screen; tabs follow below */
@media (max-width: 600px) {
  :root { --gap: 10px; }
  .mv { height: auto; grid-template-rows: auto auto auto; padding: 8px; }
  .mv-side { height: min(78dvh, 640px); }
  .mv-stage { height: auto; }
  .mv-pitch { height: auto; flex: none; }
  .mv-team { flex-direction: column; align-items: center; text-align: center; gap: 4px; }
  .mv-team--away { flex-direction: column; text-align: center; }
  .mv-team__txt { align-items: center; width: 100%; }
  .mv-team__name { font-size: 14px; text-align: center; }
  .mv-team__scorers { font-size: 10px; text-align: center; min-height: 0; }
  .mv-team__scorers span { white-space: normal; }
  .mv-crest { width: 28px; height: 32px; }
  .mv-board__main { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 6px; padding: 6px 8px 2px; }
  .mv-score__nums { font-size: 28px; padding: 3px 10px; }
  .mv-score__nums .sep { font-size: 18px; }
  .mv-board__meta { padding: 0 8px 6px; gap: 2px 10px; flex-wrap: wrap; white-space: normal; }
  .mv-board__meta span { min-width: auto; }
  .mv-caption { position: static; transform: none; width: auto; margin: 0 8px 8px; min-height: 52px; }
  .mv-caption.is-stale { opacity: 0.6; }
  .mv-caption.is-empty { opacity: 0.5; }
  .mv-hud { top: 9%; gap: 4px; } /* below the direction labels */
  .mv-pill { font-size: 11px; padding: 3px 10px 3px 6px; }
  .mv-pill .st { font-size: 10px; }
  .mv-toast { font-size: 11px; padding: 4px 8px 4px 0; min-width: 0; }
  .mv-banner__box { font-size: 15px; padding: 8px 14px; }
  .mv-caption.is-goal { width: auto; } .mv-goalbar .shout { font-size: 19px; } .mv-goalbar .team { font-size: 15px; margin-left: 6px; }
  .mv-momentum { height: 84px; }
  .mv-time { min-width: 0; font-size: 15px; }
  .mv-controls { gap: 6px; padding: 2px 8px 8px; }
  .mv-controls .btn--round { width: 32px; height: 32px; }
  .mv-controls .btn--play { width: 38px; height: 38px; }
  .mv-speed__lab { display: none; }
  .mv-seg button { padding: 6px 8px; }
  .mv-tab { font-size: 10px; letter-spacing: 0.6px; }
}
@media (max-width: 360px) {
  .mv-lineups, .mv-zone-grid { grid-template-columns: minmax(0, 1fr); }
  .mv-score__nums { font-size: 24px; padding: 3px 7px; gap: 5px; }
  .mv-team__name { font-size: 13px; }
  .mv-seg button { padding: 6px 6px; }
}
/* framed in the match report (relatorio.asp, pID=7): stacked at its natural height - the report sizes the frame to it -
   with full-height tabs. No viewport-relative heights here: inside a frame they would follow the frame's own size. */
.is-embed .mv { height: auto; min-height: 0; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto; grid-template-areas: "board" "main" "side"; }
.is-embed .mv-main { grid-template-rows: auto auto; }
.is-embed .mv-stage { height: min(calc((100vw - 2 * var(--gap)) * 0.68), 560px); }
/* the frame grows with the viewer, so Stats, Lineups and Zones show in full; Commentary and Chat grow all match,
   so they keep a scrolling box (Chat's input stays in view) */
.is-embed .mv-side { height: auto; }
.is-embed .mv-tabpanel { flex: 0 0 auto; overflow: visible; }
.is-embed #tab-comm:not([hidden]), .is-embed #tab-chat:not([hidden]) { height: 560px; overflow: auto; }
.is-embed #tab-chat:not([hidden]) { overflow: hidden; }
@media (max-width: 600px) { .is-embed #tab-comm:not([hidden]), .is-embed #tab-chat:not([hidden]) { height: 480px; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  /* the goal box still swaps, once a second, so a goal never looks like a stalled match (as boss0102) */
  .mv-goalbar { animation-duration: 2s !important; }
}
