/* Fantasy Stat Studio broadcast graphics: shared components.
   Scene-specific rules live inside each scenes/*.js file (injected once via Gfx.css). */

html.gfx-page, html.gfx-page body {
  margin: 0; padding: 0; background: transparent; overflow: hidden; cursor: none;
}

.gfx-root {
  position: relative; overflow: hidden;
  font-family: var(--f-body); color: var(--text-hi);
  font-variant-numeric: tabular-nums lining-nums; font-feature-settings: "tnum" 1, "lnum" 1;
  -webkit-font-smoothing: antialiased; text-rendering: geometricPrecision;
  font-kerning: normal; font-synthesis: none;
  user-select: none; pointer-events: none;
  transform-origin: 0 0;
}
.gfx-root *, .gfx-root *::before, .gfx-root *::after { box-sizing: border-box; }
.gfx-stage { position: absolute; inset: 0; }
.gfx-bdl { position: absolute; inset: 0; contain: strict; will-change: transform; }
.gfx-layer { position: absolute; inset: 0; }
.gfx-scene { position: absolute; }           /* left/top/width/height = its region (set by engine) */
.gfx-fx { position: absolute; overflow: hidden; }

/* ---------- type primitives ---------- */
.g-num {
  font-family: var(--f-display); font-weight: 700;
  font-variant-numeric: tabular-nums lining-nums; font-feature-settings: "tnum" 1, "lnum" 1;
  letter-spacing: 0;
}
.g-label {
  font-family: var(--f-label); font-weight: 600; font-size: var(--fs-sm); line-height: 1;
  text-transform: uppercase; letter-spacing: var(--track-label); color: var(--text-lo);
}
.g-display {
  font-family: var(--f-display); font-weight: 800; text-transform: uppercase;
  line-height: var(--lh-tight); letter-spacing: var(--track-display);
}
.g-body { font-family: var(--f-body); font-weight: 500; font-size: 30px; line-height: 1.2; color: var(--text-mid); }
.g-nowrap { white-space: nowrap; overflow: hidden; }

/* masked reveal: wrap a line in .g-mask, animate its child */
.g-mask { display: block; overflow: hidden; padding: 0.06em 0.04em 0.08em; margin: -0.06em -0.04em -0.08em; }
.g-mask > * { display: block; }

/* ---------- panels ----------
   One card = .g-shadow > .g-card.g-cut > [plate header] [6px accent rule] [.g-panel body] [.g-foot band].
   The cut corners (top-right, bottom-left) belong to the card, so header, body and footer share one silhouette. */
/* panel shadow as a static box-shadow layer (a drop-shadow filter on a big card re-renders every animated frame) */
.g-shadow { position: relative; isolation: isolate; }
.g-shadow::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.42), 0 2px 6px rgba(0, 0, 0, 0.35); }
.g-cut {
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
}
.g-cut-sm {
  clip-path: polygon(0 0, calc(100% - var(--cut-sm)) 0, 100% var(--cut-sm), 100% 100%, var(--cut-sm) 100%, 0 calc(100% - var(--cut-sm)));
}
.g-card { position: relative; display: flex; flex-direction: column; }
.g-panel {
  position: relative;
  /* lit from the top-left: a soft sheen, a vertical falloff, then the 1px top highlight + 1px dark bottom edge */
  /* flat matte graphite (redesign): no sheen, no gradient, one hairline of light on the top edge */
  background: var(--ink-800);
  box-shadow: var(--hl);
}
.g-panel::after, .g-plate::after { content: none; }
/* team-color plate: ~20% steeper falloff: lighter at the top-left falling off to the plate colour at the bottom-right */
.g-plate {
  position: relative; overflow: hidden; color: var(--tc-ink, #fff);
  /* a solid team-colour block (redesign): flat, no sheen or falloff */
  background: var(--tc-plate, var(--ink-600));
  box-shadow: none;
}
.g-plate .g-label { color: var(--tc-ink-soft, rgba(255, 255, 255, 0.8)); }
/* hatch on the right 30% of a plate only */
.g-pin { display: none !important;
  position: absolute; top: 0; bottom: 0; right: 0; width: 34%; pointer-events: none; opacity: 0.10;
  background: repeating-linear-gradient(104deg, currentColor 0 2px, transparent 2px 12px);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 60%); mask-image: linear-gradient(90deg, transparent, #000 60%);
}
/* one solid, bottom-cropped team mark (replaces headshots); 6% of the ink colour */
.g-mark { display: none !important;
  position: absolute; right: 24px; bottom: -0.2em; pointer-events: none; white-space: nowrap;
  font-family: var(--f-display); font-weight: 900; line-height: 1; letter-spacing: -0.02em;
  color: var(--tc-ink, #fff); opacity: 0.07;
}
.g-arule { height: 6px; background: var(--tc-accent, var(--accent)); transform-origin: 0 50%; flex: none; }

/* light sweep retired (kept as an inert class so old markup is harmless) */
.g-sweep { display: none; }
.g-jersey { display: none; }
.g-chev { display: none; }

/* small badges */
.g-badge {
  display: inline-flex; align-items: center; justify-content: center; height: 36px; padding: 0 12px;
  font-family: var(--f-label); font-weight: 700; font-size: var(--fs-sm); letter-spacing: 0.06em; text-transform: uppercase;
  background: transparent; color: var(--text-hi); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.28);
}
.g-badge.on-plate { background: transparent; color: var(--tc-ink, #fff); box-shadow: inset 0 0 0 2px currentColor; }
.g-plate-light .g-badge.on-plate { background: transparent; color: var(--tc-ink, #0a0b0e); }

/* injury tags */
.g-inj.t-Q { background: #f4b400; color: #1d1400; }
.g-inj.t-D { background: #ff7a1a; color: #1f0c00; }
.g-inj.t-O, .g-inj.t-IR { background: var(--bad); color: #fff; }

/* deltas */
.g-up { color: var(--good); }
.g-down { color: var(--bad); }
.g-tri { display: inline-block; width: 0; height: 0; border-left: 8px solid transparent; border-right: 8px solid transparent; vertical-align: middle; }
.g-tri.up { border-bottom: 12px solid currentColor; }
.g-tri.down { border-top: 12px solid currentColor; }

/* live dot: static, no ring */
.g-live-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--live); flex: none; }

/* reflow helper: .g-opt elements are secondary and get dropped when a scene runs out of room */
.is-tight .g-opt { display: none !important; }

/* every scene fills its region: a design box (region / k) scaled by k; its single child is the scene and fills it */
.gfx-fit { position: absolute; left: 0; top: 0; transform-origin: 0 0; display: flex; flex-direction: column; will-change: transform; }
.gfx-fit > * { flex: 1 1 auto; width: 100%; min-height: 0; }
.gfx-fit > .g-shadow > .g-card, .gfx-fit > .g-shadow > div:only-child { height: 100%; }
.gfx-fit.measuring { height: auto !important; }
/* composed: rows were grown to at most 1.5x natural height; the panel keeps its natural height and is centred */
.gfx-fit.composed { justify-content: center; }
.gfx-fit.composed > * { flex: none !important; height: auto !important; }
.gfx-fit.composed > * > .g-card, .gfx-fit.composed > * > div:only-child { height: auto !important; }
/* companion slot beside a corner cam */
.gfx-comp { position: absolute; overflow: visible; display: flex; flex-direction: column; }
/* standard companion module (Gfx.ui.comp) */
.gc-wrap { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
.gc { flex: 1 1 auto; min-height: 0; }
.gc-top { flex: none; padding: 26px 30px 24px; display: flex; flex-direction: column; }
.gc-k { display: block; font-family: var(--f-label); font-weight: 700; font-size: 24px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--tc-ink-soft, var(--text-mid)); white-space: nowrap; position: relative; z-index: 2; }
.gc-hero { display: block; margin-top: 10px; font-family: var(--f-display); font-weight: 800; font-size: 150px; line-height: 0.86; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; position: relative; z-index: 2; }
.gc-hs { display: block; margin-top: 12px; font-family: var(--f-label); font-weight: 700; font-size: 26px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--tc-ink-soft, var(--text-mid)); white-space: nowrap; position: relative; z-index: 2; }
.gc-short .gc-top { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 26px; align-items: end; }
.gc-short .gc-k { grid-column: 1 / -1; }
.gc-short .gc-hs { margin: 0 0 6px; white-space: normal; font-size: 30px; line-height: 1.08; text-align: right; }
.gc-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; padding: 4px 30px; }
.gc-row { flex: 1 1 0; min-height: 64px; max-height: 340px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.gc-row:last-child { border-bottom: 0; }
.gc-row .l { font-family: var(--f-label); font-weight: 700; font-size: 24px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-lo); white-space: normal; flex: 0 1 auto; min-width: 0; line-height: 1.1; }
.gc-row .l em { display: block; font-style: normal; font-weight: 600; font-size: 22px; letter-spacing: 0.04em; color: var(--text-mid); margin-top: 4px; }
.gc-row .v { flex: none; max-width: 62%; font-family: var(--f-display); font-weight: 800; font-size: 50px; line-height: 1; color: var(--text-hi); white-space: nowrap; overflow: hidden; text-align: right; min-width: 0; }
.gc-row .v.t-good { color: var(--good); } .gc-row .v.t-bad { color: var(--bad); } .gc-row .v.t-gold { color: var(--gold); }
.gc-row.has-c .l::before { content: ''; display: inline-block; width: 6px; height: 0.95em; margin-right: 14px; vertical-align: -0.12em; background: var(--rc); }
.gc-row.gc-tm { margin: 3px -30px 0; padding: 0 30px; border-bottom: 0; }
.gc-row.gc-tm .gb { background: rgba(0, 0, 0, 0.25); }
.gc-row.gc-tm .gb b { background: var(--tc-ink); opacity: 0.85; }
.gc-row.gc-tm .l { color: var(--tc-ink); font-family: var(--f-display); font-weight: 800; font-size: 76px; line-height: 0.9; letter-spacing: 0.02em; }
.gc-row.gc-tm .l em { color: var(--tc-ink-soft); font-family: var(--f-label); font-size: 22px; }
.gc-row.gc-tm .v { color: var(--tc-ink); font-size: 120px; }
.gc-row.dim > * { opacity: 0.35; }
.gc-row .gld { flex: 1 1 auto; min-width: 24px; height: 4px; align-self: center; margin-top: 8px; opacity: 0.8; background: radial-gradient(circle, rgba(255, 255, 255, 0.30) 1.6px, transparent 2.2px) 0 50% / 10px 4px repeat-x; }
.gc-row .gb { flex: 1 1 auto; min-width: 40px; height: 12px; background: var(--ticks), var(--track); }
.gc-row .gb b { display: block; height: 100%; transform-origin: 0 50%; background: var(--rc, var(--tc-accent, var(--accent))); }
.gc-row .gb + .v { flex: none; min-width: 1.3em; }
.gc-row { transition: none; }
.gc-gh { flex: none; display: flex; align-items: center; height: 46px; margin: 0 -30px; padding: 0 30px; background: var(--ink-850); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-family: var(--f-label); font-weight: 700; font-size: 22px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-mid); white-space: nowrap; }
.gc-gh:first-child { margin-top: -4px; border-top: 0; }
.gc-gh ~ .gc-gh { margin-top: 0; }
.gc-x { flex: 1 1 0; min-height: 0; position: relative; }
.gc-foot { flex: none; display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 20px 30px 22px; background: var(--ink-850); border-top: 1px solid var(--line); }
.gc-foot .k { font-family: var(--f-label); font-weight: 700; font-size: 24px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-lo); white-space: nowrap; }
.gc-foot.g-plate .k { color: var(--tc-ink-soft); }
.gc-foot:not(.g-plate) .v { color: var(--text-hi); }
.gc-foot .v { font-family: var(--f-display); font-weight: 800; font-size: 44px; line-height: 1; text-transform: uppercase; white-space: nowrap; overflow: hidden; min-width: 0; text-align: right; }
/* one brand per frame: the backdrop bug carries the show name, panel footers do not */
.g-foot .br { display: none !important; }
.gfx-fit.measuring > * { flex: none; height: auto !important; }
.gfx-fit.measuring > * > .g-card, .gfx-fit.measuring > * > div:only-child { height: auto !important; }

/* ---------- setup mode overlay (drawn outside the clipped stage) ---------- */
.gfx-setup { position: absolute; inset: 0; pointer-events: none; z-index: 50; font-family: var(--f-label); }
.gfx-setup .sb { position: absolute; border: 3px dashed; }
.gfx-setup .sb.cam { border-color: #ff4f7b; background: rgba(255, 79, 123, 0.10); }
.gfx-setup .sb.main { border-color: #2fd6ff; }
.gfx-setup .sb.band { border-color: #ffc83d; border-style: dotted; }
.gfx-setup .sb > b {
  position: absolute; left: 8px; top: 8px; padding: 6px 10px; font-size: 26px; font-weight: 700; letter-spacing: 0.04em;
  background: rgba(3, 6, 12, 0.85); color: #fff; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.gfx-setup .sb.cam > b { color: #ff9db5; }
.gfx-setup .sb.main > b { color: #8fe9ff; }
.gfx-setup .sb.band > b { color: #ffe08a; top: auto; bottom: 8px; }
.gfx-setup .grid {
  position: absolute; inset: 0; opacity: 0.25;
  background-image: linear-gradient(rgba(255,255,255,.18) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.18) 1px, transparent 1px);
  background-size: 120px 120px;
}

/* ---------- shared scene header / footer (Gfx.ui.head / Gfx.ui.foot) ---------- */
.g-head { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 24px 32px 22px 40px; overflow: hidden; flex: none; }
.g-head > .g-rule { position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--accent); }
.g-head .h-kick::before { content: ''; display: inline-block; width: 0.5em; height: 0.5em; margin-right: 0.45em; vertical-align: 0.08em; background: currentColor; }
.g-head .h-kick { display: block; font-family: var(--f-label); font-weight: 700; font-size: 26px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; white-space: nowrap; }
.g-head .h-title { display: block; font-family: var(--f-display); font-weight: 800; font-size: 68px; line-height: 0.92; letter-spacing: -0.015em; text-transform: uppercase; color: var(--text-hi); white-space: nowrap; }
.g-head .h-right { position: relative; z-index: 2; font-family: var(--f-label); font-weight: 600; font-size: 24px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-mid); white-space: nowrap; }
.g-head .h-l { min-width: 0; flex: 1 1 auto; }
.g-foot { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 14px; height: 44px; padding: 0 28px 0 40px; flex: none;
  background: var(--ink-850); border-top: 1px solid var(--line);
  font-family: var(--f-label); font-weight: 600; font-size: 22px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-lo); }
.g-foot .lhs { display: flex; align-items: center; gap: 16px; white-space: nowrap; }
.g-foot .lhs b { color: var(--text-mid); font-weight: 700; }
.g-foot .sc { color: var(--accent); }
.g-foot .br { color: var(--text-lo); letter-spacing: 0.12em; }
.size-column .g-foot .br, .size-vertical .g-foot .br { display: none; }

/* ---------- vertical (phone) floors: labels 32, values 56, headline names 72. Scenes drop content instead. ---------- */
.size-vertical .g-foot { height: 60px; font-size: 32px; }
.size-vertical .g-badge { font-size: 32px; height: 46px; }
.size-vertical .g-foot .sc { font-size: 32px; }
.size-vertical .g-head .h-kick, .size-vertical .g-head .h-right { font-size: 32px; }
.size-vertical .g-head .h-title { font-size: 76px; }
/* column / vertical: scenes use the full region width */

.gc-few .gc-row { max-height: 250px; }

/* material: a soft glass sheen on every card and a team-colour edge light on the active (team) card; static gradients only */
/* redesign: matte cards (no glass sheen, no light sweep, no edge glow). Depth comes from one soft shadow and the 1px top hairline. */
.g-card::after { content: none; }
.g-sweepfx { display: none !important; }
.g-card[style*="--tc-accent"]::before { content: none; }
.gc-row .v.wrap { white-space: normal; overflow: visible; font-size: 36px; line-height: 1.02; text-wrap: balance; max-width: 66%; }

/* ---------- redesign: neutral companion (no team on the graphic) = graphite top with the key number in the signal colour ---------- */
.gc[style*="--tc:#2a3a5c"] .gc-top { background: var(--ink-700); box-shadow: inset 0 -1px 0 var(--line); }
.gc[style*="--tc:#2a3a5c"] .gc-k, .gc[style*="--tc:#2a3a5c"] .gc-hs { color: var(--text-lo); }
.gc[style*="--tc:#2a3a5c"] .gc-hero { color: var(--accent); }
.gc[style*="--tc:#2a3a5c"] .g-arule { background: var(--accent); height: 4px; }
/* kickers on team plates get the same square marker as the list headers */
.gc-k::before { content: ''; display: inline-block; width: 0.5em; height: 0.5em; margin-right: 0.45em; vertical-align: 0.08em; background: currentColor; opacity: 0.9; }
