/* ============================================================================
   FOOTBALLANALYZER · review deck — "Village Gaming"
   The Village Gaming house palette: the mascot on a deep-navy floodlit night,
   an ice-cyan PRIMARY accent (selected/active/primary actions), a neon-green
   glow for "live / confirmed", purple sparingly, red for goals (⚽/alert), a
   blue dot for Camera 2. Monospace broadcast timecodes, condensed scoreboard
   headers, film grain.
   ============================================================================ */
:root {
  /* deep-navy night */
  --ink:        #071029;          /* deepest background */
  --pitch:      #0a1838;          /* base surface (deep navy) */
  --turf-0:     #0d2350;          /* panels */
  --turf-1:     #102a5e;          /* raised cards */
  --turf-2:     #163472;          /* hover / inset */
  --line:       #1c3566;          /* slate-blue hairline */
  --line-hi:    #2a4a86;          /* lighter slate-blue */

  /* Village Gaming accents */
  --cyan:       #5ec8ff;          /* PRIMARY — ice-cyan: selected / active / primary actions */
  --cyan-dim:   #2f86c8;          /* dimmed cyan for borders */
  --green:      #86ff5e;          /* neon-green GLOW — "live / confirmed" */
  --green-dim:  #4cb33a;
  --purple:     #7c5cff;          /* secondary, sparingly */
  --blue:       #3bb0ff;          /* Camera 2 dot */
  --red:        #ff4d4d;          /* GOAL / ⚽ / alert */

  /* type */
  --ink-0:      #eaf2ff;          /* primary text — ice white */
  --ink-1:      #b8c8e6;          /* secondary */
  --ink-2:      #8fa6c8;          /* muted — WCAG body text on navy panels */
  --ink-3:      #6c84ac;          /* faint TEXT; decorative hairlines use --line/--line-hi */

  --display: "Saira Condensed", "Arial Narrow", sans-serif;
  --body:    "Saira", system-ui, sans-serif;
  --mono:    "Spline Sans Mono", ui-monospace, monospace;

  /* tier identity */
  --t-goal:      var(--red);
  --t-highlight: var(--green);
  --t-moment:    var(--cyan);
  --t-filler:    var(--ink-2);

  --radius: 9px;
  --radius-sm: 6px;
  --shadow: 0 18px 50px -28px rgba(0,0,0,.9), 0 2px 8px -4px rgba(0,0,0,.6);
  --glow-cyan:  0 0 0 1px rgba(94,200,255,.40), 0 0 22px -6px rgba(94,200,255,.55);
  --glow-green: 0 0 0 1px rgba(134,255,94,.38), 0 0 22px -6px rgba(134,255,94,.55);
  --glow-gold:  0 0 0 1px rgba(255,77,77,.42), 0 0 22px -6px rgba(255,77,77,.6);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--body);
  color: var(--ink-0);
  background: var(--ink);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* ── atmosphere ───────────────────────────────────────────────────────────── */
.floods {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(120% 80% at 20% -10%, rgba(94,200,255,.12), transparent 55%),
    radial-gradient(120% 80% at 85% -15%, rgba(124,92,255,.09), transparent 50%),
    radial-gradient(140% 120% at 50% 120%, rgba(134,255,94,.05), transparent 60%),
    linear-gradient(180deg, #0b1c44 0%, var(--ink) 60%);
}
.grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: .045; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── layout shell ─────────────────────────────────────────────────────────── */
/* Content MUST sit above the fixed .floods/.grain atmosphere (z 0/1), or the gradient overlay paints
   over the lower part of the page and hides the transport controls. (v2 renamed `.deck`→`.watch`; the
   z-index rule wasn't updated, so the controls were being occluded — the "missing buttons" bug.) */
.scoreboard, .watch, .menu { position: relative; z-index: 2; }   /* .menu was missing → cards sat BEHIND the atmosphere overlay (only visible on hover) */
body { display: grid; grid-template-rows: auto 1fr; }

.scoreboard {
  display: flex; align-items: center; gap: 24px;     /* flex so the (often-hidden) match picker doesn't disturb the grid */
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(16,42,94,.7), rgba(10,24,56,.7));
  backdrop-filter: blur(8px);
}
#infoBtn { margin-left: auto; }                       /* start the right-aligned group (info + count) */
#infoBtn[hidden] { display: none; }
.count { margin-left: auto; }                         /* keep the count pinned right whether or not the picker shows */
/* published-mode match switcher (hidden until there's >1 match) */
.match-pick[hidden] { display: none; }
.match-picker {
  font-family: var(--mono); font-size: 12px; color: var(--ink-1); letter-spacing: .04em;
  background: rgba(10,24,56,.8); border: 1px solid var(--line-hi); border-radius: 7px; padding: 5px 9px;
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand__logo { height: 30px; width: auto; border-radius: 5px; box-shadow: 0 0 14px -4px rgba(94,200,255,.5); }
.brand__lockup { display: flex; flex-direction: column; line-height: 1.1; }
.brand__name { font-family: var(--display); font-weight: 800; letter-spacing: .12em; font-size: 27px; color: var(--ink-0); line-height: 1; }
.brand__name b { color: var(--blue); font-weight: 800; }
.brand__sub { font-family: var(--mono); font-size: 11px; color: var(--ink-2); letter-spacing: .06em; }
.brand__sub--match { font-family: var(--display); font-size: 13px; font-weight: 600; color: var(--cyan); letter-spacing: .08em; }

/* one quiet count, centred (no tier pills) */
.count {
  display: flex; justify-content: flex-end; align-items: baseline; gap: 6px;
  font-family: var(--display); letter-spacing: .08em; font-size: 13px; color: var(--ink-1);
}
.count b { font-family: var(--mono); font-weight: 700; font-size: 17px; color: var(--cyan); }

/* ── watch page: video LEFT, ranked list + details RIGHT (YouTube-style) ──── */
.watch {
  display: grid; grid-template-columns: 1fr minmax(320px, 400px);
  gap: 1px; background: var(--line); height: 100%; min-height: 0; overflow: hidden;
}
.watch[hidden], .menu[hidden] { display: none; }   /* explicit: override the grid/block display when toggled off */
/* hide the clips side panel → video goes full width */
.watch.side-hidden { grid-template-columns: 1fr; }
.watch.side-hidden .side { display: none; }
/* clips off → the extra width naturally enlarges the same tiling (2×2 etc. just get bigger) */
.watch.side-hidden .stage { gap: 14px; }
.watch.side-hidden .main { padding: 16px 22px 20px; }
.side-toggle { margin-left: auto; appearance: none; cursor: pointer; background: var(--turf-1); border: 1px solid var(--line-hi);
  color: var(--ink-1); border-radius: 8px; padding: 6px 11px; font-family: var(--display); letter-spacing: .06em; font-size: 12px; }
.side-toggle:hover { border-color: var(--blue); color: var(--ink-0); }
.beta { font-family: var(--display); font-weight: 800; font-size: 9px; letter-spacing: .08em; vertical-align: middle;
  color: var(--cyan); background: rgba(94,200,255,.14); border: 1px solid var(--cyan-dim); border-radius: 999px; padding: 1px 5px; }
.side-toggle[hidden] { display: none; }

/* ── MENU: the pichangas landing (published, multi-match) ──────────────────── */
.menu { background: var(--pitch); padding: 30px 26px; overflow-y: auto; min-height: 0; }
.menu__head { display: flex; align-items: baseline; gap: 20px; flex-wrap: wrap; margin: 0 0 20px; }
.menu__title { font-family: var(--display); font-weight: 800; letter-spacing: .16em; font-size: 22px;
  color: var(--ink-0); text-transform: uppercase; margin: 0; }
.menu__search { font-family: var(--body); font-size: 14px; color: var(--ink-0); background: var(--turf-1);
  border: 1px solid var(--line-hi); border-radius: 9px; padding: 8px 14px; min-width: 280px; flex: 0 1 360px; }
.menu__search:focus { outline: none; border-color: var(--blue); }
.menu__results { font-family: var(--mono); font-size: 13px; color: var(--ink-2); letter-spacing: .03em; margin: 0 0 14px; }
.menu__results:empty { display: none; }
.pcard__mvp-row { font-family: var(--mono); font-size: 12px; color: var(--green); }
/* a single VERTICAL list of pichangas (not a multi-column grid) */
.menu__grid { display: flex; flex-direction: column; gap: 14px; max-width: 560px; }
.pcard {
  appearance: none; cursor: pointer; text-align: left; display: flex; flex-direction: column;
  padding: 0; overflow: hidden; border-radius: 12px; border: 1px solid var(--line-hi);
  background: var(--turf-1); color: var(--ink-0);              /* solid surface — clearly visible at rest */
  box-shadow: 0 3px 12px -7px rgba(0,0,0,.6); transition: transform .15s, border-color .15s, box-shadow .15s;
}
.pcard:hover { border-color: var(--blue); transform: translateY(-3px); box-shadow: 0 12px 30px -14px rgba(59,176,255,.65); }
.pcard__thumb { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; background: var(--pitch); border-bottom: 1px solid var(--line); }
.pcard__body { display: flex; flex-direction: column; gap: 6px; padding: 13px 15px 15px; }
.pcard__title { font-family: var(--display); font-weight: 800; letter-spacing: .06em; font-size: 17px; color: var(--ink-0); }
.pcard__meta { font-family: var(--mono); font-size: 12px; color: var(--ink-2); letter-spacing: .02em; line-height: 1.55; }
.brand.is-link { cursor: pointer; }

/* ── match INFO modal (lineups / venue / rules) ──────────────────────────── */
.info-btn { appearance: none; cursor: pointer; font-family: var(--display); letter-spacing: .06em; font-size: 12px;
  padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line-hi); background: var(--turf-1); color: var(--ink-1); }
.info-btn:hover { border-color: var(--blue); color: var(--ink-0); }
.info-modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center;
  background: rgba(4,10,26,.78); backdrop-filter: blur(4px); padding: 24px; }
.info-modal[hidden] { display: none; }
.info-card { background: var(--pitch); border: 1px solid var(--line-hi); border-radius: 14px; max-width: 720px;
  width: 100%; max-height: 86vh; overflow-y: auto; padding: 22px 24px; box-shadow: 0 20px 60px -20px #000; }
.info-card__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 6px; }
.info-card__title { font-family: var(--display); font-weight: 800; letter-spacing: .12em; font-size: 22px; color: var(--ink-0); }
.info-close { appearance: none; cursor: pointer; background: none; border: 0; color: var(--ink-2); font-size: 22px; line-height: 1; }
.info-facts { font-family: var(--mono); font-size: 13px; color: var(--ink-1); line-height: 1.7; margin: 4px 0 16px; }
/* teams cluster at a readable width instead of stretching edge-to-edge across the whole panel. */
.info-teams { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 260px));
  justify-content: start; gap: 16px 44px; }
.info-team__name { font-family: var(--display); font-weight: 800; letter-spacing: .08em; font-size: 14px; color: var(--ink-0); margin-bottom: 6px; }
.info-team__players { list-style: none; margin: 0; padding: 0; font-family: var(--mono); font-size: 12.5px; color: var(--ink-1); line-height: 1.9; }
.player-out { color: var(--ink-2); opacity: .6; text-decoration: line-through; }   /* a no-show (~~name~~) */
.player-mvp { display: inline-block; margin-left: 8px; color: #06122b; background: var(--green); border-radius: 999px;
  font-family: var(--display); font-weight: 700; font-size: 9.5px; letter-spacing: .06em; padding: 1px 7px; vertical-align: middle; }

/* ── share-a-moment modal (YouTube-style start-at link) ──────────────────── */
.share-modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center;
  background: rgba(4,10,26,.78); backdrop-filter: blur(4px); padding: 24px; }
.share-modal[hidden] { display: none; }
.share-card { background: var(--pitch); border: 1px solid var(--line-hi); border-radius: 14px; width: 100%; max-width: 460px;
  padding: 20px 22px; box-shadow: 0 20px 60px -20px #000; }
.share-card__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.share-card__title { font-family: var(--display); font-weight: 800; letter-spacing: .1em; font-size: 18px; color: var(--ink-0); }
.share-close { appearance: none; cursor: pointer; background: none; border: 0; color: var(--ink-2); font-size: 20px; line-height: 1; }
.share-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; font-family: var(--display); letter-spacing: .06em; font-size: 13px; color: var(--ink-1); }
.share-time { width: 120px; font-family: var(--mono); font-size: 14px; color: var(--ink-0); background: var(--turf-1); border: 1px solid var(--line-hi); border-radius: 8px; padding: 7px 11px; }
.share-url { width: 100%; box-sizing: border-box; font-family: var(--mono); font-size: 12.5px; color: var(--cyan); background: var(--turf-1); border: 1px solid var(--line-hi); border-radius: 8px; padding: 9px 11px; }
.share-actions { display: flex; justify-content: flex-end; margin-top: 14px; }
/* clip builder (reuses .share-modal / .share-card / .share-row) */
.clip-durs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.clip-dur.is-on { outline: 2px solid var(--green); outline-offset: 1px; }
.clip-custom { width: 74px; padding: 6px 8px; border-radius: 8px; background: var(--turf-0);
  border: 1px solid var(--line-hi); color: var(--ink-0); font-family: var(--display); }
.clip-status { margin-top: 12px; font-family: var(--body); font-size: 13px; color: var(--ink-1); min-height: 18px; }
.clip-link { margin-top: 10px; display: flex; justify-content: flex-end; }
.clip-note { margin-top: 12px; font-family: var(--body); font-size: 12px; color: var(--ink-2); }
.tbtn:disabled, .tbtn[disabled] { opacity: .55; cursor: default; pointer-events: none; }
.info-rules { margin: 16px 0 0; padding: 0; list-style: none; font-family: var(--body); font-size: 13px; color: var(--ink-2); line-height: 1.7; }

/* lineups INLINE under the video (not a modal) — same sub-styles, panel chrome */
.info-panel { margin: 6px 0 2px; padding: 16px 18px 18px; border-radius: 12px; border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--turf-1), var(--pitch)); }
.info-panel[hidden] { display: none; }
/* collapsible: the head is a full-width toggle button; the body hides when collapsed */
.info-panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; appearance: none; background: none; border: 0; padding: 0; cursor: pointer; color: inherit; text-align: left; }
.info-panel__chevron { color: var(--ink-2); font-size: 13px; transition: transform .15s; }
.info-panel.is-collapsed .info-panel__chevron { transform: rotate(-90deg); }
.info-panel.is-collapsed .info-panel__body { display: none; }
.info-panel__body { margin-top: 10px; }
.info-panel__title { font-family: var(--display); font-weight: 800; letter-spacing: .12em; font-size: 16px; color: var(--ink-0); text-transform: uppercase; }
.info-mvp { display: inline-flex; align-items: center; gap: 6px; font-family: var(--display); font-weight: 700;
  letter-spacing: .06em; font-size: 13px; color: #06122b; background: var(--green); padding: 3px 10px; border-radius: 999px; }
.pcard__mvp { color: var(--green); }
.main { background: var(--pitch); display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 16px; min-height: 0; overflow-y: auto; }
.side { background: var(--pitch); display: flex; flex-direction: column; min-height: 0; }
.side__head { padding: 12px 14px 6px; }
/* the view tabs (⭐ Destacados / Todos / 😂 Leide) already label the panel, so the redundant header is hidden. */
.side__title { display: none; }
/* Destacados | Todos view switch (curated highlights vs every moment) */
.view-toggle { display: inline-flex; margin: 2px 0 6px; border: 1px solid var(--line-hi); border-radius: 8px; overflow: hidden; }
.view-btn {
  appearance: none; cursor: pointer; font-family: var(--display); letter-spacing: .06em; font-size: 12px;
  padding: 5px 12px; border: 0; border-right: 1px solid var(--line-hi); background: var(--turf-1); color: var(--ink-1);
  transition: all .15s;
}
.view-btn:last-child { border-right: 0; }
.view-btn:hover { background: var(--turf-2); color: var(--ink-0); }
.view-btn.is-on { background: var(--cyan); color: #06122b; font-weight: 700; }

/* ── the ranked clip list ("up next") ─────────────────────────────────────── */
.clips { overflow-y: auto; padding: 4px 12px 12px; min-height: 0; flex: 1; }
.clip {
  display: grid; grid-template-columns: 24px 1fr; gap: 10px; align-items: start;
  padding: 9px 10px; margin-bottom: 6px; border-radius: var(--radius-sm);
  background: var(--turf-0); border: 1px solid var(--line); border-left: 2px solid var(--line-hi); cursor: pointer;
  transition: transform .12s, border-color .15s, background .15s;
  animation: rise .35s both;
}
.clip:hover { background: var(--turf-1); border-color: var(--line-hi); transform: translateX(2px); }
.clip.is-active { border-color: var(--cyan-dim); box-shadow: var(--glow-cyan); background: var(--turf-1); }
.clip.is-goal { border-left-color: var(--red); }
.clip.is-highlight { border-left-color: var(--green); }
.clip.is-ignore, .clip.is-false { border-left-color: var(--ink-3); opacity: .55; }
.clip__rank { font-family: var(--mono); font-size: 12px; color: var(--ink-3); text-align: right; padding-top: 2px; }
.clip__body { min-width: 0; }
.clip__title { font-family: var(--display); font-weight: 600; font-size: 15px; letter-spacing: .02em; color: var(--ink-0); }
.clip__flag { font-size: 13px; }
.clip__star { color: #ffd23f; margin-right: 5px; font-size: .95em; text-shadow: 0 0 8px rgba(255, 210, 63, .45); }
.clip__leide { margin-right: 5px; font-size: .95em; }   /* 😂 Leide flag */
.clip__why { font-size: 11.5px; color: var(--ink-2); margin-top: 3px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ── the dual-camera stage (side-by-side: Main | Camera 2) ─────────────────── */
.screen { display: flex; flex-direction: column; gap: 8px; }
/* two equal columns by default; one camera → a single full-width column. */
/* MANY-camera stage: a responsive grid that WRAPS into rows (no fixed 2/3/4 count, no cramped single
 * row). auto-fit + minmax means 1 angle → full width, a few → side by side, many → wrap to extra rows.
 * Hidden figures (.cam[hidden], the focus control in JS) collapse out so the visible ones fill the grid. */
/* deterministic tiling by the number of VISIBLE angles (data-cams, set in JS) so the cameras fill the
 * space instead of a cramped single row: 1→full, 2→side-by-side, 3→row of 3, 4→2×2, 5-6→3-up. */
/* DESKTOP layout is owned by JS (layoutStage in app.js): it picks the rows×cols that maximise each 16:9
   tile for the window shape (the conference "tile view" algorithm) and sets the grid-template + size inline,
   so there are NO per-count grid rules here — and crucially no child grid-column span (an old 3-cam "hero"
   rule used to force tile #1 full-width, which collided with the JS columns). These base rules are just the
   fallback for phones / no-JS: a single column that the data-cams count widens. */
.stage { display: grid; grid-template-columns: 1fr; gap: 10px; }
.stage[data-cams="2"] { grid-template-columns: repeat(2, 1fr); }
.stage[data-cams="3"], .stage[data-cams="5"], .stage[data-cams="6"] { grid-template-columns: repeat(3, 1fr); }
.stage[data-cams="4"] { grid-template-columns: repeat(2, 1fr); }
.cam { margin: 0; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.cam[hidden] { display: none; }

/* DESKTOP/TABLET: size the camera stage to the WINDOW HEIGHT (scales with the window) rather than letting
   width drive it — a wide window otherwise makes the videos gigantic and pushes everything off-screen.
   The stage gets a viewport-relative height, its rows share it, and each player letterboxes inside its
   tile. Controls stay visible; the description/lineups scroll just below. (Phones keep their own layout.) */
@media (min-width: 641px) {
  /* DEFAULT ("fit"): size the stage to the GRID'S OWN aspect ratio and grow it to the largest box that fits
     the available height — so every tile lands at ~16:9 and the provider iframe STOPS letterboxing (the old
     black bars were a 16:9 video sitting inside a wide-short tile). --grid-ar = (cols·16)/(rows·9), set per
     data-cams; width:min() caps the box by both the column width and what the height budget allows, then
     aspect-ratio derives the height. Net: full-frame feeds, no per-tile bars, the grid centred in any margin. */
  .stage {
    --avail-h: calc(100vh - 210px);
    --grid-ar: 16 / 9;
    aspect-ratio: var(--grid-ar);
    width: min(100%, calc(var(--avail-h) * (var(--grid-ar))));
    height: auto;
    max-height: var(--avail-h);
    margin-inline: auto;
  }
  .stage[data-cams="2"] { --grid-ar: 32 / 9; }              /* 2×1 */
  .stage[data-cams="3"] { --grid-ar: 32 / 27; }             /* hero on top + two halves below */
  .stage[data-cams="5"], .stage[data-cams="6"] { --grid-ar: 24 / 9; }  /* 3×2 */
  .stage .cam { min-height: 0; }
  .stage .screen__frame { aspect-ratio: auto; flex: 1 1 auto; min-height: 0; height: auto; }
  .stage[data-cams="1"], .stage[data-cams="2"] { grid-template-rows: minmax(0, 1fr); }
  .stage[data-cams="3"], .stage[data-cams="4"],
  .stage[data-cams="5"], .stage[data-cams="6"] { grid-template-rows: repeat(2, minmax(0, 1fr)); }
  /* clips hidden (the default) → the stage owns the full width, so spend a touch more height on it too */
  .watch.side-hidden .stage { --avail-h: calc(100vh - 188px); }

  /* "fill": drop the aspect cap — the grid fills the WHOLE available area and each feed is cropped to cover
     (see the data-fit="fill" cover rules below). Edge-to-edge, zero bars, trims the frame edges. */
  .stage[data-fit="fill"] { aspect-ratio: auto; width: 100%; height: var(--avail-h); }
}

/* ── "fill" cover-crop (any breakpoint, so a "fill" default holds on phones too) ──────────────────────
   The local <video> can object-fit. The provider IFRAMES can't (the inner video letterboxes itself), so we
   over-size the iframe to a 16:9 box bigger than the tile and clip it. --tile-ar (each tile's width/height)
   is measured in JS so the cover maths is exact for ANY tile shape with NO distortion (see measureTiles). */
.stage[data-fit="fill"] #player { object-fit: cover; }
/* the track-box overlay (served mode only) is drawn in UNCROPPED tile coords, so it can't follow a
   cover-crop — hide it in fill rather than show misaligned boxes. */
.stage[data-fit="fill"] #overlay { display: none; }
.stage[data-fit="fill"] .screen__frame { overflow: hidden; }
.stage[data-fit="fill"] .screen__frame iframe,
.stage[data-fit="fill"] .ytplayer iframe {
  position: absolute; inset: auto; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width:  max(100%, calc(100% * (16 / 9) / var(--tile-ar, 1.7778)));
  height: max(100%, calc(100% * var(--tile-ar, 1.7778) / (16 / 9)));
}

/* ── THEATER: the whole grid fills the browser window (hide the header/clips/details, keep the tabs, the
   seek bar and the transport). Works everywhere — no OS fullscreen prompt. Toggle with the ⛶ button or Esc. */
body.theater { overflow: hidden; }
body.theater .scoreboard, body.theater .side, body.theater .vinfo { display: none !important; }
body.theater .watch { display: block; padding: 0; margin: 0; }
body.theater .main { width: 100%; max-width: none; }
body.theater .videodock {
  position: fixed; inset: 0; z-index: 9000; background: #000;
  display: flex; flex-direction: column; justify-content: flex-start; gap: 8px;
  padding: 10px clamp(12px, 2vw, 30px) 14px;
}
body.theater .stage { --avail-h: calc(100vh - 150px); }
/* the grid fills the open space; the controls cluster at the BOTTOM. The camera tabs (#focus) are moved by
   JS INTO the transport bar (relocateAngleTabs), so the whole bottom strip is ONE control bar — tabs next to
   the playback controls and Llenar/Salir. The now-empty floating angle row is hidden. */
body.theater .screen { order: 1; flex: 1 1 auto; min-height: 0; justify-content: center; }
body.theater .seekrow { order: 2; }
body.theater .anglebar { display: none; }
body.theater .transport { order: 3; }
/* the relocated tabs sit inline in the bar; a hair of left space sets them off from "Compartir" */
.focus--intransport { margin-left: 6px; }
.cam__label {
  font-family: var(--display); font-weight: 700; letter-spacing: .14em; font-size: 12px;
  color: var(--ink-1); text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 7px;
}
/* the live dot's colour is a per-camera CSS var (--dot) set in mountCameras from a cycling palette, so
 * any number of cameras get distinct colours — not a hardcoded #cam2/#cam3 rule. Main keeps the green. */
.cam__label::before { content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--dot, var(--green)); box-shadow: 0 0 8px var(--dot-glow, rgba(134,255,94,.7)); }
/* letterbox bars read as a floodlit "feed" surface, not dead black, for near-square alt angles (panel #25) */
.screen__frame { position: relative; aspect-ratio: 16/9; background: radial-gradient(130% 100% at 50% -10%, rgba(94,200,255,.07), transparent 55%), #050a18; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); }
.screen__frame.flash { animation: frameflash .5s ease; }
@keyframes frameflash { 0% { box-shadow: var(--shadow), inset 0 0 0 2px var(--green); } 100% { box-shadow: var(--shadow); } }
.screen__frame::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 140px -40px rgba(0,0,0,.95); }
#player { width: 100%; height: 100%; display: block; object-fit: contain; background: #000; }
/* the YouTube IFrame fills the frame; the API replaces #ytplayer with the <iframe> */
.ytplayer, .screen__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
/* the hls.js secondary <video> fills its slot like the iframe; unlike an iframe it CAN object-fit, so the
   fill cover-crop is a simple object-fit swap (no over-size hack). */
.ytplayer video.stream-frame, .screen__frame video.stream-frame {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; object-fit: contain; background: #000; }
.stage[data-fit="fill"] .ytplayer video.stream-frame,
.stage[data-fit="fill"] .screen__frame video.stream-frame { object-fit: cover; }
/* our own fullscreen control (native provider bars are hidden) — top-right of each tile, over the iframe */
.cam__fs { position: absolute; top: 8px; right: 8px; z-index: 4; appearance: none; cursor: pointer;
  width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line-hi);
  background: rgba(7,16,41,.62); color: var(--ink-0); font-size: 15px; line-height: 1;
  display: grid; place-items: center; opacity: 0; transition: opacity .12s, background .12s; }
.cam:hover .cam__fs, .cam__fs:focus-visible { opacity: 1; }
.cam__fs:hover { background: var(--cyan); color: #06122b; border-color: var(--cyan); }
@media (hover: none) { .cam__fs { opacity: .85; } }   /* touch: no hover, so keep it visible */
/* CSS pseudo-fullscreen (works on iOS, unlike iframe requestFullscreen): pin ONE tile over the whole
   viewport and HIDE all other chrome, so stacking/letterboxing can't leave the header showing. */
body.has-fs { overflow: hidden; }
body.has-fs .scoreboard, body.has-fs .seekrow, body.has-fs .transport, body.has-fs .vinfo,
body.has-fs .side, body.has-fs .cam:not(.cam--fs) { display: none !important; }
.cam--fs { position: fixed; inset: 0; z-index: 100000; margin: 0; background: #000; }
.cam--fs .cam__label { display: none; }
.cam--fs .screen__frame { position: absolute; inset: 0; height: auto; aspect-ratio: auto; min-height: 0; border-radius: 0; }
/* exit button: fixed to the viewport corner, always reachable (NOT inside the rotated video) */
.cam--fs .cam__fs { position: fixed; top: max(12px, env(safe-area-inset-top)); right: 14px; z-index: 100001;
  width: 44px; height: 44px; font-size: 20px; opacity: 1; background: rgba(7,16,41,.82); }
/* PORTRAIT phone: rotate the video 90° so a 16:9 clip FILLS the screen (iOS can't lock orientation) */
@media (orientation: portrait) {
  .cam--fs .screen__frame iframe, .cam--fs .screen__frame #player,
  .cam--fs .screen__frame video.stream-frame {
    position: absolute; top: 0; left: 0; width: 100vh; height: 100vw;
    transform-origin: top left; transform: rotate(90deg) translateY(-100vw);
  }
}

/* DETAILS box toggle — hidden on desktop (title shows inline); a collapse header on phones (see ≤640). */
.vinfo__toggle { display: none; }
.overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.tcode { position: absolute; top: 10px; left: 12px; font-family: var(--mono); font-weight: 700; font-size: 17px; letter-spacing: .06em; color: var(--green); background: rgba(7,16,41,.7); padding: 3px 9px; border-radius: 6px; text-shadow: 0 0 12px rgba(134,255,94,.5); }
.screen__empty { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; color: var(--ink-2); font-family: var(--mono); font-size: 13px; }
.screen__frame.is-empty .screen__empty { display: flex; }
.screen__frame.is-empty #player { opacity: 0; }
code { font-family: var(--mono); color: var(--cyan); }

/* the summary title under the video */
.vtitle { font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: .02em; margin: 12px 0 0; color: var(--ink-0); }
.vsub { font-size: 12.5px; color: var(--ink-2); margin: 0; line-height: 1.4; }

/* focus control (Side-by-side / Main / Camera 2) — a segmented view toggle in the transport row.
   Rendered as a clearly-bordered pill group so "one video vs two" is obvious + visible on navy. */
/* angle selector row, ABOVE the video (camera tabs/switcher) */
.anglebar { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.anglebar[hidden] { display: none; }
.focus { display: flex; gap: 0; border: 1px solid var(--line-hi); border-radius: 8px; overflow: hidden; }
.focus[hidden] { display: none; }
.focus__btn {
  appearance: none; cursor: pointer; font-family: var(--display); letter-spacing: .06em; font-size: 12px;
  padding: 7px 13px; border: 0; border-right: 1px solid var(--line-hi); background: var(--turf-1); color: var(--ink-1);
  transition: all .15s; white-space: nowrap;
}
.focus__btn:last-child { border-right: 0; }
.focus__btn:hover { background: var(--turf-2); color: var(--ink-0); }
.focus__btn.is-on { background: var(--cyan); color: #06122b; font-weight: 700; }
/* a small "View" label so the segmented control reads as the one-vs-two-video switch */
.ctl-label { font-family: var(--display); letter-spacing: .1em; font-size: 11px; color: var(--ink-2); text-transform: uppercase; margin-right: 2px; }

/* TRANSPORT = a clearly-framed control toolbar so the buttons stand out from the navy stage. */
/* SEEK BAR — scrub the whole match (click or drag). Sits above the transport buttons. */
.seekrow { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.seektime { font-family: var(--mono); font-size: 12px; color: var(--ink-2); min-width: 52px; text-align: center; flex: none; }
.seekbar { position: relative; flex: 1; height: 16px; display: flex; align-items: center; cursor: pointer; touch-action: none; }
.seekbar::before { content: ""; position: absolute; left: 0; right: 0; height: 5px; border-radius: 3px;
  background: var(--turf-2); border: 1px solid var(--line-hi); }
.seekbar__fill { position: absolute; left: 0; height: 5px; width: 0; border-radius: 3px;
  background: var(--cyan); box-shadow: var(--glow-cyan); }
.seekbar__knob { position: absolute; left: 0; width: 13px; height: 13px; margin-left: -6px; border-radius: 50%;
  background: var(--cyan); border: 2px solid #06122b; box-shadow: var(--glow-cyan); opacity: 0; transition: opacity .12s; }
.seekbar:hover .seekbar__knob, .seekbar:focus-visible .seekbar__knob { opacity: 1; }
/* highlight ticks — a chapter/heatmap cue of where the action is. Visual only (no pointer-events). */
.seekbar__mark { position: absolute; top: 50%; transform: translate(-50%, -50%);
  width: 3px; height: 12px; border-radius: 1px; background: var(--gold, #ffce5c);
  box-shadow: 0 0 5px rgba(255,206,92,.6); pointer-events: none; z-index: 2; }

.transport {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 8px; padding: 9px 12px; border-radius: 10px;
  background: var(--turf-0); border: 1px solid var(--line-hi); box-shadow: var(--shadow);
}
.tbtn {
  appearance: none; cursor: pointer; border: 1px solid var(--line-hi); background: var(--turf-2);
  color: var(--ink-0); font-family: var(--mono); font-size: 13px; font-weight: 500;
  padding: 7px 12px; border-radius: 7px; min-width: 42px; transition: all .12s;
}
.tbtn:hover { background: var(--cyan); color: #06122b; border-color: var(--cyan); }
.tbtn--play { color: #06122b; background: var(--cyan); border-color: var(--cyan); min-width: 50px; font-size: 15px; box-shadow: var(--glow-cyan); }
.tbtn--play:hover { background: #7fd4ff; }
.tbtn--reel { color: var(--cyan); background: rgba(94,200,255,.10); border-color: var(--cyan-dim); font-family: var(--display); letter-spacing: .08em; }
.tbtn--reel:hover { color: #06122b; background: var(--cyan); }
/* a toggled-on transport button (theater on / fill mode) reads as active */
.tbtn.is-on { color: #06122b; background: var(--cyan); border-color: var(--cyan); box-shadow: var(--glow-cyan); }
/* the layout controls sit to the RIGHT of the transport (push them over) */
.tbtn--layout { margin-left: auto; }
.tbtn--layout + .tbtn--layout { margin-left: 8px; }
/* a theater-mode button stays reachable pinned over the fixed dock */
body.theater #theaterBtn { z-index: 9001; }
.transport .spacer { flex: 1; min-width: 8px; }

/* ── details panel (bottom-right): title, why, inline confirm, optional disclosure ── */
.details { overflow-y: auto; padding: 12px 14px 18px; min-height: 0; border-top: 1px solid var(--line); flex: 0 0 auto; max-height: 46%; }
.details__empty { color: var(--ink-3); font-family: var(--mono); font-size: 13px; padding: 24px 0; text-align: center; }
.dh { padding: 2px 0 6px; }
.dh__title { font-family: var(--display); font-weight: 700; font-size: 17px; color: var(--ink-0); }
.dh__why { font-size: 12.5px; color: var(--ink-1); line-height: 1.5; margin: 4px 0 10px; }

.acts { display: flex; gap: 6px; margin: 0 0 8px; flex-wrap: wrap; }
.act { appearance: none; cursor: pointer; flex: 1; min-width: 90px; padding: 9px; border-radius: 7px; border: 1px solid var(--line); background: var(--turf-0); color: var(--ink-1); font-family: var(--display); letter-spacing: .04em; font-size: 13px; transition: all .14s; }
.act:hover { border-color: var(--line-hi); color: var(--ink-0); }
.act.is-on { border-color: var(--cyan-dim); color: var(--cyan); box-shadow: var(--glow-cyan); }

/* optional "details" disclosure — analytics for the curious, NOT front-and-centre */
.more { margin-top: 8px; }
.more > summary { cursor: pointer; font-family: var(--mono); font-size: 11px; color: var(--ink-2); letter-spacing: .04em; }
.more__body { padding-top: 10px; }
.kv { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 6px 0; }
.kv__k { font-family: var(--mono); font-size: 11px; color: var(--ink-2); }
.kv__v { font-family: var(--mono); font-size: 13px; color: var(--ink-0); }

.bars { display: flex; flex-direction: column; gap: 7px; margin-bottom: 8px; }
.bar { display: grid; grid-template-columns: 110px 1fr 52px; align-items: center; gap: 10px; }
.bar__k { font-family: var(--mono); font-size: 11px; color: var(--ink-2); }
.bar__track { height: 8px; border-radius: 4px; background: var(--turf-2); overflow: hidden; }
.bar__fill { height: 100%; border-radius: 4px; }
.bar__v { font-family: var(--mono); font-size: 11px; color: var(--ink-1); text-align: right; }
.bar--ev .bar__fill { background: linear-gradient(90deg, var(--green-dim), var(--green)); }

/* ── toast ────────────────────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%) translateY(20px);
  z-index: 50; background: var(--turf-2); border: 1px solid var(--line-hi); color: var(--ink-0);
  padding: 9px 16px; border-radius: 8px; font-family: var(--mono); font-size: 12px; box-shadow: var(--shadow);
  opacity: 0; transition: all .25s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* scrollbars */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--line-hi); border-radius: 6px; }
::-webkit-scrollbar-track { background: transparent; }

/* the <1100px fallback linearizes video → list → details (single column);
   the two cameras STACK vertically (Main above Camera 2). */
@media (max-width: 1100px) {
  .watch { grid-template-columns: 1fr; grid-auto-rows: minmax(0, auto); overflow-y: auto; }
  .main { overflow: visible; }
  .clips { max-height: 50vh; }
  .details { max-height: none; }
  body { overflow: auto; }
  .stage { grid-template-columns: 1fr; }
  /* never let a stray wide element cause horizontal scrolling on small screens */
  html, body { overflow-x: hidden; max-width: 100%; }
}

/* ── PHONE (≤640px): compact header, full-bleed stacked cameras, touch-sized controls ──── */
@media (max-width: 640px) {
  /* wrap so the Clips toggle can never be shoved off the right edge once the match picker appears
     (≥2 matches): brand + picker fill row 1, Clips drops to a right-aligned row 2 if they don't fit. */
  .scoreboard { gap: 8px 10px; padding: 8px 12px; flex-wrap: wrap; }
  .brand { gap: 8px; min-width: 0; flex: 1 1 auto; }
  .brand__logo { height: 22px; }
  .brand__name { font-size: 16px; letter-spacing: .06em; }
  .brand__sub:not(.brand__sub--match) { display: none; }   /* drop the tagline; keep the match name */
  .brand__sub--match { font-size: 11px; }
  .count { font-size: 11px; gap: 4px; }
  .count b { font-size: 14px; }
  .side-toggle { padding: 6px 9px; font-size: 11px; flex: 0 0 auto; }   /* row 1, pinned right by its margin-left:auto */
  /* With ≥2 matches the picker <select> appears; left inline it auto-sizes to the match TITLE and
     shoves the (margin-left:auto) Clips toggle off the right edge (brand alone is ~210px). So drop the
     picker to its OWN full-width row below — brand + Clips own row 1 (Clips always reachable), the
     match switcher spans row 2. order:3 puts it after brand+toggle; flex-basis:100% forces the wrap. */
  .match-pick { order: 3; flex: 1 1 100%; min-width: 0; }
  .match-picker { max-width: 100%; width: 100%; }

  /* MENU: stack the head, full-width search, edge-to-edge cards */
  .menu { padding: 18px 14px; }
  .menu__head { flex-direction: column; align-items: stretch; gap: 10px; }
  .menu__search { min-width: 0; flex: 1 1 auto; }
  .menu__grid { max-width: none; }

  /* WATCH: tighter padding; .main is the flow, .watch is the scroll container (set in the ≤1100 tier) */
  .main, .watch.side-hidden .main { padding: 10px 12px 14px; }
  .clips { max-height: none; }   /* it's a full-width section on phones — let it flow, the page scrolls */
  /* CLIPS panel declutter on phones: no keyboard hints, no redundant bottom detail (the Details box
     already shows the moment), tighter head — so revealing clips is a clean list, not a jumble. */
  .kbd-legend { display: none; }
  .cam__fs { display: none; }   /* fullscreen disabled on phones for now (the rotate overlay was janky) */
  .side .details { display: none; }
  .side__head { padding: 10px 12px 2px; }
  .search { margin: 4px 0 8px; }

  /* PINNED VIDEO DOCK (YouTube-mobile): cameras + seek + transport stick to the top of the viewport as
     the description below scrolls. Full-bleed + opaque so scrolling content passes cleanly underneath. */
  .videodock { position: sticky; top: 0; z-index: 5; background: var(--pitch);
    margin: -10px -12px 10px; padding: 8px 12px 10px; box-shadow: 0 8px 20px -14px #000; }

  /* DESCRIPTION CARD: "what's happening" (moment title + analysis) + the collapsible lineups, as ONE box
     (YouTube's description). Scrolls beneath the pinned video. */
  .vinfo { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
    background: linear-gradient(180deg, var(--turf-1), var(--pitch)); }
  /* Details collapses the WHOLE box (title + analysis + lineups) under a "Detalles" toggle, default closed */
  .vinfo__toggle { display: flex; align-items: center; justify-content: space-between; width: 100%;
    appearance: none; background: none; border: 0; padding: 0; cursor: pointer; color: var(--ink-0);
    font-family: var(--display); font-weight: 800; letter-spacing: .12em; text-transform: uppercase; font-size: 14px; }
  .vinfo__chevron { color: var(--ink-2); font-size: 13px; transition: transform .15s; }
  .vinfo.is-collapsed .vinfo__chevron { transform: rotate(-90deg); }
  .vinfo.is-collapsed .vinfo__body { display: none; }
  .vinfo__body { margin-top: 12px; }
  .vinfo .vtitle { font-size: 17px; margin-top: 0; }
  .vinfo .vsub { margin-top: 4px; }
  .vinfo .info-panel { border: 0; background: none; border-radius: 0; margin: 12px 0 0;
    padding: 12px 0 0; border-top: 1px solid var(--line); }

  /* ANGLE STRIP: the focus chips become a horizontal, scrollable, single-select switcher (tap = swap). */
  .focus { flex-wrap: nowrap; overflow-x: auto; gap: 6px; -webkit-overflow-scrolling: touch; }
  .focus__btn { white-space: nowrap; flex: none; }
  .anglebar { margin-bottom: 6px; }
  .anglebar .ctl-label { display: none; }   /* tabs above the video are self-evident; reclaim the width */

  /* camera tiling on phones — needs to MATCH the .stage[data-cams] specificity to win: 1–2 angles
     stack full-width (big + tappable); 3+ go 2-up so they fit without a giant scroll. */
  .stage[data-cams="2"] { grid-template-columns: 1fr; }
  .stage[data-cams="3"], .stage[data-cams="4"],
  .stage[data-cams="5"], .stage[data-cams="6"] { grid-template-columns: repeat(2, 1fr); }

  /* TRANSPORT: compact so it doesn't dominate — tappable but tight; "Vista" flows inline (no spacer) */
  .transport { gap: 5px; padding: 6px; margin-top: 6px; }
  .tbtn { min-height: 38px; padding: 7px 10px; font-size: 12.5px; min-width: 38px; }
  .tbtn--play { min-width: 46px; }
  /* phones show one big video (swap angles via the tabs) + per-tile fullscreen — the grid layout controls
     don't apply, so keep them off the cramped transport row. */
  .tbtn--layout { display: none; }
  .transport .spacer { display: none; }
  .seekrow { margin-top: 6px; }
  .seektime { min-width: 42px; font-size: 11px; }
  .seekbar { height: 22px; }   /* a fatter hit area for the thumb */

  .info-panel { padding: 13px 14px 15px; }
  .info-teams { grid-template-columns: 1fr; }
  .share-card, .info-card { padding: 18px 16px; }
  .share-modal, .info-modal { padding: 14px; }
  .share-time { width: 100%; }
  .share-row { flex-wrap: wrap; gap: 8px; }

  /* inputs ≥16px so iOS Safari doesn't auto-zoom the page on focus */
  .menu__search, .search__input, .share-time, .share-url, .match-picker { font-size: 16px; }
}

/* TOUCH devices (no hover): the seek knob can't depend on :hover — always show it so it's draggable. */
@media (hover: none) {
  .seekbar__knob { opacity: 1; }
}

/* visible keyboard focus everywhere */
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: var(--radius-sm); }

/* keyboard legend */
.kbd-legend { font-family: var(--mono); font-size: 10px; color: var(--ink-3); letter-spacing: .02em; }
.kbd-legend b { color: var(--ink-1); font-weight: 500; }

/* honour reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .clip, .screen__frame.flash { animation: none; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}

/* "no Camera 2 footage for this moment" — shown instead of jumping the embed to 0 (out of coverage). */
.screen__frame { position: relative; }
.cam__msg {
  display: none; position: absolute; inset: 0; z-index: 3;
  align-items: center; justify-content: center; text-align: center; padding: 18px;
  font-family: var(--display); letter-spacing: .08em; font-size: 13px; line-height: 1.5;
  color: var(--ink-1); background: rgba(7, 16, 41, .85); border-radius: 8px;
}
/* no-footage overlay — generic for ANY secondary camera (was #cam2-only, so Camera 3 showed a frozen
 * wrong frame for moments past its coverage, e.g. highlight #1 at 1:44:55 vs cam3 ending 1:41). The YT
 * API replaces the slot <div> with an <iframe> (keeping the id but not the class), so dim the iframe. */
.cam.is-nocov .cam__msg { display: flex; }
.cam.is-nocov .screen__frame iframe { opacity: .15; }

/* SYNCING overlay — a quick YouTube-style spinner while a FOLLOWER camera catches up to Main: the
   settle window right after a seek, or a buffering stall while Main plays. Replaces the raw play/pause
   "boogy" with a clean loading state. Fades in after a short delay so an instant catch-up never flashes;
   z-index sits BELOW the no-coverage message so that always wins. */
.cam__sync {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  opacity: 0; transition: opacity .18s ease; background: rgba(5, 10, 24, .34);
}
.cam.is-syncing .cam__sync { opacity: 1; transition-delay: .25s; }   /* delay → no flash on a fast resync */
.cam.is-nocov .cam__sync { opacity: 0 !important; }                  /* the no-footage message wins */
.cam__sync__spin {
  width: 40px; height: 40px; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .22); border-top-color: #fff;
  animation: camspin .8s linear infinite;
}
.cam__sync__txt {
  font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: rgba(255, 255, 255, .82); text-shadow: 0 1px 6px rgba(0, 0, 0, .6);
}
@keyframes camspin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .cam__sync__spin { animation: camspin 1.6s steps(8) infinite; }   /* gentler step-rotation, not a smooth blur */
}

/* ── transcript text-search (find clips by what was said) ───────────────── */
.search { display: flex; align-items: center; gap: .5rem; margin: .15rem 0 .6rem; }
.search__input {
  flex: 1; min-width: 0; padding: .5rem .7rem;
  background: var(--turf-0); color: var(--text, #e8eefc);
  border: 1px solid var(--line); border-radius: 7px;
  font: inherit; font-size: .92rem;
}
.search__input::placeholder { color: #6f86b8; }
.search__input:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 2px rgba(94,200,255,.2); }
.search__count { color: var(--cyan); font-size: .8rem; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* matched transcript excerpt shown in search results */
.clip__quote { margin-top: .35rem; font-size: .82rem; color: #aab8d8; line-height: 1.35; font-style: italic; }
.clip__hit { background: rgba(94,200,255,.28); color: #eaf6ff; border-radius: 3px; padding: 0 2px; font-style: normal; font-weight: 700; }

/* roster name tags on a clip (players mentioned in its transcript) */
.clip__tags { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .4rem; }
.tag {
  font: inherit; font-size: .72rem; font-weight: 600; cursor: pointer;
  color: var(--cyan); background: rgba(94,200,255,.12);
  border: 1px solid var(--cyan-dim); border-radius: 999px; padding: .1rem .5rem;
  line-height: 1.4; white-space: nowrap;
}
.tag:hover { background: rgba(94,200,255,.24); color: #eaf6ff; }

/* explainable goal-confidence: value + verdict badge + per-lever contribution bars */
.gc { margin: .5rem 0; }
.gc__head { display: flex; align-items: center; gap: .5rem; }
.gc__val { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--cyan); }
.gc__badge { font-size: .7rem; font-weight: 700; padding: .05rem .45rem; border-radius: 999px;
  background: rgba(124,92,255,.2); color: var(--purple); border: 1px solid var(--purple); }
.gc__badge.is-conf { background: rgba(255,77,77,.18); color: var(--red); border-color: var(--red); }
.gc__lever { display: grid; grid-template-columns: 9rem 1fr 2.6rem; align-items: center; gap: .4rem;
  margin-top: .25rem; font-size: .76rem; color: #aab8d8; }
.gc__bar { height: 6px; background: var(--turf-0); border-radius: 3px; overflow: hidden; }
.gc__fill { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan-dim), var(--cyan)); }
.gc__c { text-align: right; font-variant-numeric: tabular-nums; color: var(--cyan); }
