/* bracket-view.css - Styles for the bracket view (js/bracket-view.js)
 *
 * Light only, desktop first. Colour tokens are scoped to the bracket page so the
 * rest of the app is unaffected. See Docs/BRACKET-REDESIGN.md, "Design Language".
 */

/* aliases into the shared tokens (css/design-tokens.css); the bracket-only fills stay here */
.bracket-container {
  --bv-band: var(--nt-band);
  --bv-surface: var(--nt-surface);
  --bv-surface-2: var(--nt-surface-2);
  --bv-ink: var(--nt-ink);
  --bv-ink-2: var(--nt-ink-2);
  --bv-muted: var(--nt-muted);
  --bv-faint: var(--nt-faint);
  --bv-line: var(--nt-line-2);
  --bv-line-strong: var(--nt-line-strong);
  --bv-card-line: var(--nt-card-line);
  --bv-accent: var(--nt-accent);
  --bv-accent-soft: var(--nt-accent-soft);
  --bv-ready: var(--nt-ready);
  --bv-ready-soft: var(--nt-ready-soft);
  --bv-done-meta: #f7faf8;
  --bv-done-border: #6fa684;
  --bv-done-win: #e3f2e8;
  --bv-ready-fill: #fffaea;
  --bv-live-fill: #ffeee4;
  --bv-pending-fill: #f1f0ee;
  --bv-header: var(--nt-header);
  --bv-header-ink: var(--nt-header-ink);
  --bv-shadow: 0 1px 2px rgba(17,24,39,.06), 0 2px 8px rgba(17,24,39,.05);
  --bv-sans: var(--nt-sans);
  --bv-mono: var(--nt-mono);
}

/* Pinch and drag are handled by the view, not the browser */
.bracket-viewport.bv-active { touch-action: none; }
.bracket-viewport.bv-dragging { cursor: grabbing; }

/* ---- world layer (inside the zoomed canvas) ---- */
.bv-world { position: absolute; left: 0; top: 0; --inv: 1; font-family: var(--bv-sans); color: var(--bv-ink); }
.bv-world svg { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.bv-band { position: absolute; background: var(--bv-band); border-radius: 10px; }
.bv-col-label { position: absolute; font-size: 15px; line-height: 1.2; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--bv-muted); white-space: nowrap; }
.bv-col-label span, .bv-col-label.bv-sub-label { font-weight: 500; letter-spacing: .02em; text-transform: none; }
.bv-finals-label { z-index: 1; background: var(--bv-surface-2); padding: 0 6px; }
.bv-side-label { position: absolute; font-size: 24px; line-height: 1; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--bv-ink-2); white-space: nowrap; }
.bv-club { position: absolute; font-size: 34px; line-height: 1; font-weight: 800; letter-spacing: -.02em; color: var(--bv-ink); white-space: nowrap; }
.bv-signature { position: absolute; font-size: 16px; letter-spacing: 1px; color: rgba(17,24,39,.5); pointer-events: none; white-space: nowrap; }

/* ---- cards ---- */
.bv-card {
  /* Border never drops below 1px on screen (1.5px for live/ready/final) when zoomed out */
  --bw: max(1px, calc(1px * var(--inv, 1)));
  --bw2: max(2px, calc(1.5px * var(--inv, 1)));
  position: absolute; width: var(--w); height: var(--h);
  background: var(--bv-surface); border: var(--bw) solid var(--bv-card-line); border-radius: 6px;
  box-shadow: var(--bv-shadow); cursor: pointer; overflow: hidden;
  display: grid; grid-template-rows: 20px 1fr 1fr;
  transition: opacity .15s, box-shadow .15s, border-color .15s;
}
.bv-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: transparent; }
.bv-card:hover { border-color: var(--bv-ink-2); }
.bv-card:focus-visible { outline: 2px solid var(--bv-accent); outline-offset: 2px; }
.bv-card .bv-meta {
  display: flex; align-items: center; gap: 6px; padding: 0 8px 0 12px; white-space: nowrap; overflow: hidden;
  font-size: 11px; color: var(--bv-muted); border-bottom: 1px solid var(--bv-line); background: var(--bv-surface-2);
}
.bv-card .bv-id { font-family: var(--bv-mono); font-weight: 700; color: var(--bv-ink-2); font-size: 11px; flex: none; }
.bv-card .bv-grow { flex: 1; }
.bv-chip { font-family: var(--bv-mono); font-size: 10px; font-weight: 700; padding: 0 5px; border-radius: 3px; border: 1px solid var(--bv-line); color: var(--bv-ink-2); line-height: 13px; }
.bv-state { font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: 9.5px; }
.bv-row { display: flex; align-items: center; gap: 6px; padding: 0 9px 0 12px; font-size: var(--fs, 20px); line-height: 1.15; min-width: 0; overflow: hidden; }
.bv-row + .bv-row { border-top: 1px solid color-mix(in srgb, var(--bv-line) 55%, transparent); }
.bv-row .bv-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.bv-row .bv-score { font-family: var(--bv-mono); font-weight: 700; min-width: 12px; text-align: right; font-variant-numeric: tabular-nums; }
.bv-row.bv-tbd .bv-name { color: var(--bv-faint); font-style: italic; font-weight: 400; font-size: calc(var(--fs, 20px) * .72); }
.bv-row.bv-bye .bv-name { color: var(--bv-faint); font-style: italic; font-weight: 400; }
.bv-row.bv-win .bv-name { font-weight: 800; }
.bv-row.bv-lose .bv-name, .bv-row.bv-lose .bv-score { color: var(--bv-muted); font-weight: 500; }
.bv-row.bv-out .bv-name { text-decoration: line-through; text-decoration-color: var(--bv-faint); }
.bv-throw { width: 6px; height: 6px; border-radius: 50%; background: var(--bv-accent); flex: none; }
.bv-throw.bv-off { background: transparent; }

.bv-card.bv-pending { border: var(--bw) dashed var(--bv-faint); box-shadow: none; background: var(--bv-pending-fill); }
.bv-card.bv-pending .bv-meta { background: transparent; }
.bv-card.bv-completed { border-color: var(--bv-done-border); }
.bv-card.bv-completed .bv-meta { background: var(--bv-done-meta); }
.bv-card.bv-completed .bv-row.bv-win { background: var(--bv-done-win); }
.bv-card.bv-walkover { opacity: .55; box-shadow: none; }
.bv-card.bv-ready { background: var(--bv-ready-fill); border: var(--bw2) solid var(--bv-ready); }
.bv-card.bv-ready::before { background: var(--bv-ready); }
.bv-card.bv-ready .bv-meta { background: var(--bv-ready-soft); }
.bv-card.bv-ready .bv-state { color: var(--bv-ink-2); }
.bv-card.bv-live { background: var(--bv-live-fill); border: var(--bw2) solid var(--bv-accent); }
.bv-card.bv-live::before { background: var(--bv-accent); }
.bv-card.bv-live .bv-meta { background: var(--bv-accent-soft); }
.bv-card.bv-live .bv-state { color: var(--bv-accent); display: inline-flex; align-items: center; gap: 4px; }
.bv-card.bv-live .bv-state::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--bv-accent); animation: bv-pulse 1.6s ease-in-out infinite; }
.bv-card.bv-final:not(.bv-live) { border-width: var(--bw2); }
.bv-card.bv-conflict .bv-meta { color: #b91c1c; }
@keyframes bv-pulse { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .bv-card.bv-live .bv-state::before { animation: none; } }

/* ---- selection and follow ---- */
.bv-world.bv-dim .bv-card { opacity: .3; }
.bv-world.bv-dim .bv-card.bv-on, .bv-world.bv-dim .bv-card.bv-selected, .bv-world.bv-dim .bv-card.bv-target { opacity: 1; }
.bv-world.bv-dim .bv-edge:not(.bv-on) { opacity: .25; }
.bv-card.bv-on { border-color: var(--bv-accent); }
.bv-card.bv-target { border-color: var(--bv-accent); box-shadow: 0 0 0 calc(2px * var(--inv)) var(--bv-accent); }
.bv-card.bv-selected { border-color: var(--bv-accent); box-shadow: 0 0 0 calc(4px * var(--inv)) var(--bv-accent); }

/* Lines keep a constant on-screen width at any zoom */
.bv-edge { fill: none; stroke: var(--bv-line); stroke-width: calc(2px * var(--inv)); transition: opacity .15s; }
.bv-edge.bv-known { stroke: var(--bv-line-strong); }
.bv-edge.bv-dashed { stroke-dasharray: calc(7px * var(--inv)) calc(5px * var(--inv)); }
.bv-edge.bv-on { stroke: var(--bv-accent); stroke-width: calc(3px * var(--inv)); opacity: 1; }
.bv-drop { fill: none; stroke: var(--bv-accent); stroke-width: calc(2.5px * var(--inv)); stroke-dasharray: calc(7px * var(--inv)) calc(5px * var(--inv)); opacity: 0; }
.bv-drop.bv-on { opacity: 1; }
.bv-droptag { font-family: var(--bv-mono); font-size: calc(11px * var(--inv)); font-weight: 700; fill: var(--bv-accent); opacity: 0; }
.bv-droptag.bv-on { opacity: 1; }

/* ---- screen layer (over the viewport, not zoomed) ---- */
.bv-overlay { position: absolute; inset: 0; pointer-events: none; z-index: 50; font-family: var(--bv-sans); }
.bv-marker {
  position: absolute; transform: translate(-50%, -50%); pointer-events: auto; cursor: pointer;
  font: 600 12px/1 var(--bv-sans); white-space: nowrap; padding: 6px 10px; border-radius: 99px; border: 0;
  background: var(--bv-header); color: var(--bv-header-ink); box-shadow: 0 2px 10px rgba(17,24,39,.25);
  display: inline-flex; align-items: center; gap: 6px;
}
.bv-marker b { font-family: var(--bv-mono); font-size: 11px; }
.bv-marker.bv-loser { background: var(--bv-accent); color: #fff; }
.bv-marker.bv-from { background: var(--bv-surface); color: var(--bv-ink); border: 1px solid var(--bv-line); }

.bv-selbar {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); max-width: calc(100% - 24px);
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 8px 10px 8px 14px; pointer-events: auto;
  background: var(--bv-surface); border: 1px solid var(--bv-line); border-radius: 10px; box-shadow: 0 6px 24px rgba(17,24,39,.18);
  font-size: 13px; color: var(--bv-ink-2); cursor: default;
}
.bv-selbar[hidden] { display: none; }
.bv-readonly { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--bv-muted); border: 1px dashed var(--bv-faint); border-radius: 6px; padding: 3px 8px; }
.bv-selbar .bv-sid { font-family: var(--bv-mono); font-weight: 700; color: var(--bv-ink); }
.bv-selbar button { font: inherit; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 6px; border: 1px solid var(--bv-line); background: var(--bv-surface-2); color: var(--bv-ink); cursor: pointer; }
.bv-selbar button:hover { border-color: var(--bv-accent); color: var(--bv-accent); }
.bv-selbar button.bv-on { background: var(--bv-accent-soft); border-color: var(--bv-accent); color: var(--bv-accent); }
.bv-selbar button.bv-primary { background: var(--bv-header); border-color: var(--bv-header); color: var(--bv-header-ink); }
.bv-selbar button.bv-primary:hover { background: var(--bv-accent); border-color: var(--bv-accent); color: #fff; }
.bv-selbar button.bv-x { border: 0; background: transparent; font-size: 16px; padding: 2px 6px; color: var(--bv-muted); }

.bv-mag { position: absolute; width: 300px; pointer-events: none; filter: drop-shadow(0 14px 30px rgba(17,24,39,.3)); --inv: 1; }
.bv-mag[hidden] { display: none; }
.bv-mag .bv-card { position: relative; width: 300px; height: 118px; --fs: 24px; box-shadow: none; }
.bv-mag .bv-foot { margin-top: 6px; background: var(--bv-header); color: var(--bv-header-ink); font-size: 12px; line-height: 1.4; padding: 6px 10px; border-radius: 6px; }
.bv-mag .bv-foot b { font-family: var(--bv-mono); font-size: 11px; }
.bv-mag.bv-tip { width: max-content; max-width: 320px; filter: drop-shadow(0 6px 16px rgba(17,24,39,.25)); }
.bv-mag.bv-tip .bv-foot { margin-top: 0; }

/* ---- page frame: header above, bracket below, nothing floating over the bracket ---- */
.bracket-container {
  position: relative; width: 100%; height: 100vh; overflow: hidden;
  display: flex; flex-direction: column; gap: 8px; padding: 10px 16px 12px;
  /* a deeper shade than the other pages: the bracket page is the stage */
  background: #e4e0d9; font-family: var(--bv-sans);
}
/* the views share this stage: the bracket, with Match Controls as a layer over it */
.bv-stage { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
/* Match Controls as a sheet over the bracket, from the right: the bracket's first rounds show to its
   left, dimmed; clicking them, or the pill on the sheet's corner, shows the bracket */
.bv-scrim, .bv-layer-close { display: none; }
.bv-on-controls .bv-scrim { display: block; position: absolute; inset: 0; z-index: 19; border-radius: 10px;
  background: rgba(28, 25, 22, .22); cursor: pointer; }
.bv-on-controls #matchCommandCenterModal.mc-view { inset: 0 0 0 clamp(140px, 16%, 260px); padding: 16px 18px 0;
  border-radius: 14px; box-shadow: -12px 0 40px rgba(17, 15, 13, .28); }
/* at the top of the strip, beside the sheet's edge, in the accent: it opens the bracket, and says the
   arrow key does too (it grows to the left on hover, never over the sheet) */
.bv-on-controls .bv-layer-close { display: block; position: absolute; top: 12px; left: calc(clamp(140px, 16%, 260px) - 12px); z-index: 21;
  transform: translateX(-100%); padding: 7.5px 15.5px; border: 1.5px solid var(--bv-ink); border-radius: 999px; background: var(--bv-accent); color: #fff;
  font-size: 14px; font-weight: 700; white-space: nowrap; cursor: pointer; box-shadow: 0 0 0 1.5px #fff, 0 6px 16px rgba(17, 15, 13, .3); }
.bv-hint-hover, .bv-layer-close:hover .bv-hint-rest, .bv-scrim:hover + .bv-layer-close .bv-hint-rest { display: none; }
.bv-layer-close:hover .bv-hint-hover, .bv-scrim:hover + .bv-layer-close .bv-hint-hover { display: inline; }
.bracket-viewport {
  position: relative; flex: 1; min-height: 0; overflow: hidden; cursor: grab;
  contain: layout paint; /* redrawing the bracket never repaints the rest of the page */
  background: var(--bv-surface-2); border: 1px solid var(--bv-line); border-radius: 10px;
  user-select: none; -webkit-user-select: none;
}
/* The zoomed layer: the bracket view sets its transform; everything in it is positioned in world units.
   No will-change: as one GPU layer, a large bracket above 100% outgrows the graphics memory and the
   whole page flickers while Chrome redraws it. Painted normally, only the visible part is drawn,
   and text stays sharp at every zoom. */
.bracket-canvas { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.bracket-canvas, .bracket-canvas * { user-select: none; -webkit-user-select: none; }

/* ---- header ---- */
.bv-header { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px 16px; align-items: center; flex: none; }
.bv-head-left { grid-column: 1; grid-row: 1 / span 2; align-self: stretch; display: flex; gap: 16px; min-width: 0; }
/* name and date centred vertically in the header, like the clock; the links stay on the top row */
.bv-head-left .bv-title-block { align-self: center; }
.bv-head-left .bv-nav { align-self: flex-start; }
/* Match Controls and Leaderboard, centred on the page */
.bv-head-center { grid-column: 2; grid-row: 1; display: flex; align-items: center; gap: 8px;
  /* the top row's height: kept when the buttons are hidden (analytics-only mode), so the
     status row stays under the Finals and zoom tools instead of rising into them */
  min-height: 38px; }
/* tools on the top row; the clock spans both rows, centred vertically in the header */
.bv-head-right { grid-column: 3; grid-row: 1 / span 2; align-self: stretch; display: flex; justify-content: flex-end; gap: 16px; min-width: 0; }
/* the top row's height (as .bv-head-center), so the smaller tools are centred on the same line as the view buttons */
.bv-head-right .bv-tools { align-self: flex-start; min-height: 38px; }
.bv-head-right .bv-clock { align-self: center; }
/* the status row is centred on the page, under all three groups */
.bv-header > .bv-status-row { grid-column: 1 / -1; grid-row: 2; }
/* the clock's divider, mirrored: the name and date framed at the left as the clock is at the right */
.bv-title-block { min-width: 0; padding: 4px 16px 4px 0; border-right: 1px solid var(--bv-line); }
.bv-title { font-weight: 800; font-size: 24px; line-height: 1.1; letter-spacing: -.02em; color: var(--bv-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  /* stop before the centred status line (about 960px wide, centred on the page); long names end in … */
  max-width: max(160px, calc(50vw - 500px)); }
.bv-subtitle { font-weight: 600; font-size: 14px; color: var(--bv-ink-2); margin-top: 2px; font-variant-numeric: tabular-nums; }
.bv-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.bv-links { display: inline-flex; align-items: center; gap: 2px; }
.bv-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

.bv-btn {
  font: inherit; font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--bv-line); background: var(--bv-surface); color: var(--bv-ink-2);
}
.bv-btn:hover { background: var(--bv-surface-2); border-color: var(--bv-ink-2); }
.bv-btn-primary { background: var(--bv-header); border-color: var(--bv-header); color: var(--bv-header-ink); }
.bv-badge { margin-left: 8px; padding: 1px 7px; border-radius: 99px; background: var(--bv-accent); color: #fff; font-size: 12px; font-weight: 700; }
.bv-badge[hidden] { display: none; }
.bv-btn-primary:hover { background: var(--bv-accent); border-color: var(--bv-accent); color: #fff; }
.bv-link { font: inherit; font-size: 13px; font-weight: 600; padding: 6px 8px; border: 0; border-radius: 6px; background: transparent; color: var(--bv-muted); cursor: pointer; }
.bv-link:hover { color: var(--bv-ink); background: var(--bv-surface); }
.bv-header .analytics-back-btn { display: none; }
.mode-analytics .bv-header .analytics-back-btn { display: inline-flex; }
.mode-analytics .bv-header .bv-nav-btn:not(.analytics-back-btn) { display: none; }
/* nor from a selected match: an analytics-only instance only shows the bracket */
.mode-analytics .bv-selbar [data-act="controls"] { display: none; }

.bv-seg { display: inline-flex; align-items: center; border: 1px solid var(--bv-line); border-radius: 8px; overflow: hidden; background: var(--bv-surface); }
.bv-seg[hidden] { display: none; }
.bv-seg button, .bv-seg output { font: inherit; font-size: 13px; font-weight: 600; padding: 6px 12px; border: 0; background: transparent; color: var(--bv-ink-2); }
.bv-seg button { cursor: pointer; }
.bv-seg > button + button, .bv-seg > output, .bv-seg > output + button { border-left: 1px solid var(--bv-line); }
.bv-seg button[aria-pressed="true"] { background: var(--bv-header); color: var(--bv-header-ink); }
.bv-seg button:hover:not([aria-pressed="true"]) { background: var(--bv-surface-2); }
.bv-seg output { min-width: 58px; text-align: center; font-family: var(--bv-mono); font-size: 12px; font-variant-numeric: tabular-nums; }
.bv-seglabel { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--bv-muted); padding: 0 8px 0 10px; }

.bv-clock {
  font-family: var(--bv-sans); font-size: 30px; font-weight: 800; line-height: 1; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; color: var(--bv-ink);
  padding: 4px 0 4px 16px; border-left: 1px solid var(--bv-line);
}
.bv-status-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 22px; }
.bv-status { font-size: 13px; color: var(--bv-ink-2); }
.bv-status b { color: var(--bv-ink); }
.bv-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: 12px; color: var(--bv-muted); }
.bv-legend span { display: inline-flex; align-items: center; gap: 6px; }
.bv-legend .bv-throw { display: inline-block; }
.bv-sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; border: 1px solid var(--bv-line); }
.bv-sw-live { background: var(--bv-live-fill); border: 2px solid var(--bv-accent); }
.bv-sw-ready { background: var(--bv-ready-fill); border: 2px solid var(--bv-ready); }
.bv-sw-done { background: var(--bv-surface); border: 2px solid var(--bv-done-border); }
.bv-sw-pending { background: var(--bv-pending-fill); border: 1px dashed var(--bv-faint); }
.bv-sw-walkover { background: var(--bv-surface); border-color: var(--bv-done-border); opacity: .55; }

/* ---- views: Bracket | Match Controls | Console (showBracketView in js/bracket-rendering.js) ---- */
.bv-views button { padding: 8px 16px; font-size: 14px; }
/* Leaderboard beside the tabs: the same height and text size, so it reads as an equal button */
.bv-head-center > .bv-btn { padding: 8px 16px; font-size: 14px; }
.bv-views .bv-badge { background: #16a34a; } /* results waiting: green, as on the Match Controls tile */
/* on Match Controls or the Console, the bracket's own tools and the colour legend have nothing to act on */
.bracket-container.bv-on-layer .bv-tools,
.bracket-container.bv-on-layer .bv-legend { display: none; }

/* ---- groups and cups: the group stage (Docs/GROUPS-AND-CUPS.md) ----
   A page of group cards in the viewport instead of the bracket under the camera; it scrolls. */
.bracket-viewport.bv-groups-on { cursor: default; touch-action: auto; user-select: text; -webkit-user-select: text; }
.bracket-viewport.bv-groups-on .bracket-canvas { display: none; }
.bv-groups { position: absolute; inset: 0; overflow: auto; font-family: var(--bv-sans); color: var(--bv-ink); }
.bv-gwrap { margin: 0 auto; padding: 18px 18px 28px; display: grid; gap: 14px; }
.bv-ggrid { display: grid; grid-template-columns: repeat(var(--gcols, 2), minmax(0, 1fr)); gap: 16px; }
.bv-gcard { background: var(--bv-surface); border: 1px solid var(--nt-line); border-radius: 12px; overflow: hidden; box-shadow: var(--bv-shadow); }
.bv-gcard h3 { margin: 0; padding: 12px 16px 8px; font-size: 16px; font-weight: 800; display: flex; justify-content: space-between; align-items: baseline; }
.bv-gcard h3 small { font-weight: 500; font-size: 12px; color: var(--bv-muted); }
.bv-gtable { width: 100%; border-collapse: collapse; font-size: 13px; }
.bv-gtable th { text-align: right; font-size: 11px; font-weight: 600; color: var(--bv-muted); padding: 4px 8px; border-bottom: 1px solid var(--nt-line); }
.bv-gtable td { text-align: right; padding: 6px 8px; border-bottom: 1px solid var(--nt-line); font-variant-numeric: tabular-nums; }
.bv-gtable th:first-child, .bv-gtable td:first-child { text-align: left; padding-left: 16px; width: 22px; color: var(--bv-muted); }
.bv-gtable th:nth-child(2), .bv-gtable td:nth-child(2) { text-align: left; width: 100%; }
.bv-gtable th:last-child, .bv-gtable td:last-child { padding-right: 16px; }
.bv-gname b { font-weight: 600; }
.bv-glevel { font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--nt-warn); background: var(--nt-warn-soft); border-radius: 4px; padding: 1px 5px; margin-left: 4px; }
.bv-gtable tr.bv-to-a td:first-child { box-shadow: inset 3px 0 0 var(--nt-ok); }
.bv-gtable tr.bv-to-b td:first-child { box-shadow: inset 3px 0 0 var(--nt-card-line); }
.bv-gkey { display: flex; gap: 14px; padding: 6px 16px 8px; font-size: 11px; color: var(--bv-muted); }
.bv-gkey i { display: inline-block; width: 3px; height: 10px; margin-right: 5px; vertical-align: -1px; }
.bv-gkey-a { background: var(--nt-ok); }
.bv-gkey-b { background: var(--nt-card-line); }
.bv-glist { border-top: 1px solid var(--nt-line); }
.bv-gmatch { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto auto auto; gap: 10px; align-items: center; padding: 6px 16px; font-size: 13px; cursor: pointer; }
.bv-gmatch.bv-gdone { cursor: default; }
.bv-gmatch + .bv-gmatch { border-top: 1px dashed var(--nt-line); }
.bv-gmatch:not(.bv-gdone):hover { background: var(--bv-surface-2); }
.bv-glive-row { background: var(--bv-live-fill); }
.bv-gno { font-family: var(--bv-mono); font-size: 11px; color: var(--bv-muted); }
.bv-gwho { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bv-gwin { color: var(--nt-ok); font-weight: 700; }
.bv-gref { font-size: 12px; color: var(--bv-muted); white-space: nowrap; }
.bv-gres { font-family: var(--bv-mono); font-weight: 700; font-size: 12px; min-width: 44px; text-align: right; }
.bv-gchip { display: inline-block; font-size: 11px; font-weight: 700; border-radius: 99px; padding: 1px 8px; white-space: nowrap; text-align: center; min-width: 44px; }
.bv-glive { background: var(--bv-accent-soft); color: #b2410f; }
.bv-gready { background: var(--bv-ready-soft); color: #8a6a0a; }
.bv-gwait { background: var(--nt-inset); color: var(--bv-muted); }
.bv-gundo { font: inherit; font-size: 11px; font-weight: 600; border: 1px solid var(--nt-line-2); border-radius: 6px; background: var(--bv-surface); color: var(--bv-ink-2); padding: 1px 8px; cursor: pointer; }
.bv-gundo:hover { border-color: var(--nt-line-strong); }
.bv-gnote { margin: 0; text-align: center; font-size: 13px; color: var(--bv-muted); }
.bv-gsig { position: static; text-align: center; }
/* one group (Round Robin, one group): a single card, not stretched across the page */
.bv-gcard.bv-gsingle { width: 100%; max-width: 760px; justify-self: center; }
/* the cups: each cup's name over its final */
.bv-cup-name { font-size: 30px; }
