/* Streambar ticker overlay — portrait / Whatnot variant, 980 × 190 (MVP).
 *
 * Every rule is scoped to .sb-* so this same file can be loaded by the control
 * panel to render the live preview through the SAME module viewers get. The
 * page-level rules (transparent body, 980×190, overflow) live in overlay.html —
 * they must never leak into the panel.
 *
 * TWO HEIGHTS, one gate. `[data-ticker="on"]` is the full two-row bar the
 * reference documents (banner 90 + scores/ticker 110 = 200, stage 300); the MVP
 * mounts with `showTicker: false`, which stamps `[data-ticker="off"]` and
 * collapses the stage to logo overhang 100 + banner 90 = 190. NOTHING below is
 * deleted — the ticker rules wait here for live scores.
 *
 * Colours arrive as CSS variables only. The module sets --primary/--secondary/
 * --accent/--text (validated #RRGGBB, server-side) plus the --*-rgb triplets it
 * derives from them, so every translucent shade re-skins with the theme — the
 * one pattern worth copying from the reference overlay.
 *
 * THREE MOTIONS, one row. `[data-motion]` on .sb picks what moves in the banner:
 * `fade` cross-fades the two slots, `vertical` rolls them up, `horizontal` hides
 * them and scrolls .sb-mq-track across the message area instead. Only `transform`
 * and `opacity` are ever transitioned — no filter, no box-shadow, no geometry —
 * and nothing on this row uses a CSS animation (the marquee is rAF-driven).
 *
 * THREE LAYOUTS, one row. `[data-layout]` on .sb picks the CHROME: `broadcast`
 * (the default, and the only one with rules + texture + the 190px overhanging
 * logo), `minimal` (no rule, no texture, 30px/400 type, 150px circular logo,
 * quieter type) and `scorebug` (a rounded secondary cell with a 2px accent inset
 * line, a 150px accent logo block, 32px type). No layout changes the 980 × 190
 * stage, the 90px bar or a single timing — and none adds a DOM node: the cell is
 * a pseudo-element and the gutters are one CSS variable.
 *
 * Each message may lead with an emoji (.sb-e). In Scroll motion that emoji is
 * the spacer: .sb-mq-sep is a 34px gap before an emoji-led item and a 55% dot
 * before one without. No ◆ anywhere any more.
 *
 * Dimensions/timings: see docs/overlay-dimensions.md.
 */

/* Fonts are NOT declared here. The display face is a per-tenant choice
   (fonts.js): overlay.js registers exactly one FontFace — the face in the
   config — with the FontFace API, and the page preloads the same file, so the
   first paint waits on one request and nothing else is ever fetched. The bar
   reads it through --font, set inline by the module (a validated family name,
   never anything else). The panel's own UI face lives in the panel. */

:root {
  --primary: #7B2FBE;
  --secondary: #1a0a2e;
  --accent: #E5B800;
  --text: #FFFFFF;
  --accent-rgb: 229, 184, 0;
  --text-rgb: 255, 255, 255;
  --fade: 700ms;
}

/* ---- shell ---- */
.sb, .sb *, .sb *::before, .sb *::after { margin: 0; padding: 0; box-sizing: border-box; }
.sb {
  /* Same defaults as :root, re-declared so a mount inside a themed page (the
     panel) is never tinted by its host. The module overwrites them inline. */
  --primary: #7B2FBE;
  --secondary: #1a0a2e;
  --accent: #E5B800;
  --text: #FFFFFF;
  --accent-rgb: 229, 184, 0;
  --text-rgb: 255, 255, 255;
  --primary-rgb: 123, 47, 190;
  --secondary-rgb: 26, 10, 46;
  --fade: 700ms;
  /* ---- COLOUR ROLES (overlays.colour_roles, migration 031) ----
     The four theme colours above say what the bar IS; a role says what one
     PART of it is. Every role is OPTIONAL, and the whole compatibility story
     is one rule: overlay.js writes `--r-<group>-<key>` (and its `-rgb` triple)
     ONLY for a role that is set, and every declaration below reads it as
     `var(--r-…, <what it drew before>)`. So a bar with no roles is the bar as
     it was, to the pixel, and there is nothing to migrate.

     These two hold the MESSAGE ROW's paint in one place, because three things
     read it: the row itself, the Scroll marquee's edge fade (which must be a
     flat colour, never a gradient) and Stacked, whose one message line is the
     bar's "bottom" and therefore takes the SCORES roles. */
  --sb-bar-bg: var(--r-bar-bg, var(--primary));      /* always a colour: the fades read this */
  --sb-banner-paint: var(--sb-bar-bg);               /* what the row is painted with (Stacked makes it a gradient) */
  position: relative;
  width: 980px;
  height: 300px;                 /* two-row default; the off-gate below trims it */
  /* The stage clips its own bar, exactly as the page box used to: the drop
     shadow spills past the bottom edge and a scaled-up logo past the top, and
     both stop here. It also means a layout switched over SSE (190 ⇄ 342) is
     right immediately, without waiting for the page to be re-served. */
  overflow: hidden;
  --font: 'Barlow Condensed';
  /* ---- THE PHONE SAFE AREA (overlays.safe_area_px, migration 034) ----
     A streaming phone (Whatnot / TikTok on an iPhone) crops about 100px off
     each side of its 1080-wide portrait canvas, and everything in those two
     bands is simply not on the stream. So the bar WRITES this far in from
     both edges, and nothing else moves: every background, band, rule,
     gradient and strip still paints the full 980. One variable, folded into
     the gutters below, so a layout that already reads --gut-l / --gut-r
     follows for free. Declared here as 0 so the stylesheet is correct on its
     own; the module writes the real number (0-200, 110 by default) inline. */
  --safe-x: 0px;
  --logo-scale: 1;
  --finish: 1;                   /* 0 flat … 1 the full gloss: the hatching and the rule glow */
  font-family: var(--font), system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--text);
  text-transform: uppercase;
  -webkit-font-smoothing: antialiased;
}

/* Logo overhangs 100px above the bar (reference: body padding-top 100px).
   Size is a transform (--logo-scale, 0.5–1.2) anchored at the bar's bottom
   corner on the logo's side, so a bigger logo grows up and inward and never
   re-flows the bar; the gutter below follows the same number. */
.sb-logo {
  position: absolute;
  top: 0; left: calc(16px + var(--safe-x));
  width: 190px; height: 190px;
  object-fit: contain;
  z-index: 50;
  pointer-events: none;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, .85));
  transform: scale(var(--logo-scale));
  transform-origin: bottom left;
}
.sb[data-logo="right"] .sb-logo { left: auto; right: calc(16px + var(--safe-x)); transform-origin: bottom right; }
/* Text case: uppercase is the bar's default; `asis` renders what was typed. */
.sb[data-case="asis"] { text-transform: none; }
/* No logo, or one that has not decoded yet: opacity only, so the swap never
   touches layout. overlay.js preloads the new file in a detached Image() and
   only then points this element at it — there is no empty frame in between. */
.sb-logo { transition: opacity 180ms ease; }
.sb-logo.is-off { opacity: 0; }
.sb-logo[hidden] { display: none; }

.sb-bar {
  position: absolute;
  left: 0; top: 100px;
  width: 980px; height: 200px;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 4px 32px rgba(0, 0, 0, .8);
}

/* ---- MVP gate: scores/ticker row OFF ----
   The row is not in the DOM at all (overlay.js never appends it), so this is
   belt-and-braces plus the two heights that matter. The bar shrinks to the
   banner exactly, which hands the banner row the bar's bottom edge — the 4px
   radius and the drop shadow — with no leftover strip, border or gap below it.
   `display:none` (not height:0) so a stray row can never reserve space. */
/* ---- message-area gutters, one source of truth ----
   --gut-l clears the logo treatment, --gut-r is the right edge — a plain 28px in
   every layout now that the corner badge is gone (free plans carry a locked
   MESSAGE instead, which rides the rotation). The slots pad by them and the
   Scroll window insets by them, so a layout never has to restate either.
   Order matters: .no-logo comes last so it wins the tie.
   --edge-in is the INTERIOR air — the gap between the words and whatever is
   beside them — and --edge is that air plus the phone safe area, which is the
   inset from the bar's own edge. A rule that stops short of something INSIDE
   the bar (Broadcast Scores' brand tab, which carries the safe area itself)
   reads --edge-in; everything that stops short of the EDGE reads --edge. */
.sb { --logo-box: 190px; --logo-gap: 10px; --edge-in: 28px; --edge: calc(var(--edge-in) + var(--safe-x)); }   /* 16 + 190 + 10 = 216 */
.sb[data-layout="minimal"], .sb[data-layout="scorebug"] { --logo-box: 150px; --logo-gap: 16px; }  /* 16 + 150 + 16 = 182 */
.sb { --logo-gut: calc(16px + var(--safe-x) + var(--logo-box) * var(--logo-scale) + var(--logo-gap)); }
.sb.no-logo { --logo-gut: var(--edge); }
/* Logo left (default): the logo gutter is the left inset. Logo right: the
   gutters swap and the messages flow from the left edge — every rule below
   reads --gut-l / --gut-r, so nothing else has to know which side it is. */
.sb { --gut-l: var(--logo-gut); --gut-r: var(--edge); }
.sb[data-logo="right"] { --gut-l: var(--edge); --gut-r: var(--logo-gut); }

.sb[data-ticker="off"] { height: 190px; }        /* 100 overhang + 90 banner */
.sb[data-ticker="off"] .sb-bar { height: 90px; } /* banner only, no dead space */
.sb[data-ticker="off"] .sb-ticker { display: none; }

/* ---- row 1: banner (90px) ---- */
.sb-banner {
  position: relative;
  height: 90px;
  background: var(--sb-banner-paint);
  overflow: hidden;
}
/* Static hatching — costs one paint, never animates (OBS repaint cost). Its
   opacity IS the finish: 0 leaves the raw theme colour, 1 is the full gloss. */
.sb-banner::before {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 80px, rgba(var(--r-bar-accent-rgb, var(--accent-rgb)), .04) 80px 81px);
  opacity: var(--finish);
  pointer-events: none;
}
.sb-rule-top {
  position: absolute; top: 0; left: 0; right: 0; height: 2px; z-index: 3;
  background: linear-gradient(90deg, transparent, var(--r-bar-accent, var(--accent)) 20%, var(--r-bar-accent, var(--accent)) 80%, transparent);
}
.sb-rule-bot {
  position: absolute; bottom: 0; left: 0; right: 0; height: 3px; z-index: 3;
  background: var(--r-bar-accent, var(--accent));
  box-shadow: 0 0 12px rgba(var(--r-bar-accent-rgb, var(--accent-rgb)), calc(.6 * var(--finish)));   /* the glow follows the finish */
}

/* Two stacked slots show one message at a time, for BOTH the fade and the
   vertical motions — same hold (dwell), same transition (fade), different
   transform. transform + opacity only: the reference's blur(6px) is deliberately
   dropped (an animated filter is the single most expensive thing an OBS browser
   source can be asked to repaint).
     fade     enter opacity 0→1 + scale 1.06→1 · exit 0 / scale .94
     vertical enter opacity 0→1 + translateY 45%→0 · exit 0 / translateY -45% */
.sb-slot {
  position: absolute; inset: 0; z-index: 1;
  display: flex; align-items: center;
  padding: 3px var(--gut-r) 3px var(--gut-l);
  opacity: 0;
  transform: scale(1.06);
  transition: opacity var(--fade) ease, transform var(--fade) ease;
}
.sb-slot.is-in { opacity: 1; transform: none; }
.sb-slot.is-out { opacity: 0; transform: scale(.94); }
/* The roll gets a decelerating curve — it reads as broadcast motion rather than
   a linear slide. Same duration, same properties: no runtime cost. */
.sb[data-motion="vertical"] .sb-slot { transform: translateY(45%); transition-timing-function: cubic-bezier(.22, 1, .36, 1); }
.sb[data-motion="vertical"] .sb-slot.is-in { transform: none; }
.sb[data-motion="vertical"] .sb-slot.is-out { transform: translateY(-45%); }
/* The message's optional leading emoji — one class for every row and layout.
   `em` resolves against whichever type size the layout gave the parent, so the
   emoji is always 0.9 of the text it leads. It must not change the line box:
   no line-height of its own, vertical-align middle, a fixed 0.35em run-in. */
.sb-e {
  font-size: .9em;
  vertical-align: middle;
  margin-right: .35em;
  line-height: 1;
}
.sb-e[hidden] { display: none; }
/* The Socials line's platform mark: an inline <svg> in the emoji slot, 1em of
   the slot's own .9em, drawn in the text's colour. */
.sb-e > svg { display: inline-block; width: 1em; height: 1em; fill: currentColor; vertical-align: -.12em; }

/* The slot's window: what a scrolling message is clipped by (the slot's own
   padding is the gutter, so the text never shows under the logo). */
.sb-slot-win { flex: 1; min-width: 0; overflow: hidden; display: flex; align-items: center; }
/* A message marked to scroll: the span stops shrinking to the window (so it
   sits at the text's natural width), stops clipping, and moves on transform;
   the window does the clipping, at the gutter. */
.sb-slot-t.is-scroll { flex: 0 0 auto; max-width: none; overflow: visible; text-overflow: clip; will-change: transform; }
.sb-slot-t {
  min-width: 0;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1.1;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  /* NEVER an ellipsis: a line too wide for its window glides in it instead
     (fit() in overlay.js); `clip` is only the backstop for a slot not yet laid out. */
  text-overflow: clip;
}

/* ---- banner, Scroll motion: a continuous marquee of every message ----
   The window is inset by POSITION, not padding, so `overflow:hidden` clips at
   the logo gutter and the right edge (overflow is clipped at the PADDING edge,
   so a padded window would let the text run under the logo). 980 − 216 − 28 =
   736px in broadcast with a logo. Shown only in `horizontal`, and the slots step
   aside. */
.sb-mq {
  position: absolute; z-index: 1;
  top: 0; bottom: 0; left: var(--gut-l); right: var(--gut-r);
  display: none; align-items: center;
  overflow: hidden;
}
.sb[data-motion="horizontal"] .sb-mq { display: flex; }
.sb[data-motion="horizontal"] .sb-slot { display: none; }
/* Translated by rAF (exact px/s), never by a CSS animation. */
.sb-mq-track { display: flex; align-items: center; width: max-content; will-change: transform; }
.sb-mq-item {
  font-size: 34px; font-weight: 700;
  letter-spacing: .02em; line-height: 1.1;
  color: var(--r-bar-text, var(--text));
  white-space: nowrap;
}
/* The gap IS the separator. 17px each side = the ~34px run-in a leading emoji
   needs; when the next item has no emoji the same span carries a subtle dot.
   Text colour at 55%, never accent — the accent belongs to the chrome. */
.sb-mq-sep { font-size: 20px; line-height: 1; color: rgba(var(--r-bar-text-rgb, var(--text-rgb)), .55); padding: 0 17px; }
/* Over the node budget a whole block is one span (see NODE_BUDGET in
   overlay.js): the gaps are real spaces, so they must not collapse. */
.sb-run { white-space: pre; }
/* Soft right edge into the row colour, as the ticker window has. Static. */
.sb-mq::after {
  content: '';
  position: absolute; top: 0; right: 0; bottom: 0; width: 28px; z-index: 2;
  background: linear-gradient(to left, var(--sb-bar-bg), transparent);
  pointer-events: none;
}

/* The Streambar mark, drawn in a message's emoji slot (`icon: 'streambar'`).
   It is CSS, not an <img> and not a DOM subtree: a data: URI costs no request
   and — unlike an inline <svg>, which is 2+ nodes in every duplicated marquee
   block — no nodes at all, which is what keeps a full free overlay inside the
   50-node budget. Same box as an emoji: 0.9em, centred, 0.35em before the text.
   (Simplified from assets/icon/streambar-icon.svg: the gradient is flattened to
   --brand and the dim bar dropped — at 30px they are invisible anyway.) */
.sb-e.sb-icon {
  display: inline-block;
  width: 1em; height: 1em;                 /* 1em of .sb-e's own 0.9em */
  vertical-align: -.12em;
  /* The field carries a faint light ring: the mark's own purple is the brand
     purple, and a tenant whose banner IS that colour would otherwise see the
     field vanish and the gold pill float. Baked into the data URI, so it costs
     nothing and works on any theme. */
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 96 96'%3E%3Crect x='2' y='2' width='92' height='92' rx='23' fill='%237B2FBE' stroke='%23FFFFFF' stroke-opacity='.35' stroke-width='4'/%3E%3Crect x='18' y='37' width='60' height='22' rx='7' fill='%23E5B800'/%3E%3Cpath d='M27 42 L36 48 L27 54 Z' fill='%231A0A2E'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ======================================================================
   LAYOUTS — chrome only. Same stage, same bar, same timings, no extra DOM.
   `broadcast` is everything above: it needs no rules of its own.
   ====================================================================== */

/* ---- minimal: no rule, no texture, quieter type, a round logo ---- */
.sb[data-layout="minimal"] .sb-banner::before,
.sb[data-layout="minimal"] .sb-rule-top,
.sb[data-layout="minimal"] .sb-rule-bot { display: none; }
.sb[data-layout="minimal"] .sb-slot-t,
.sb[data-layout="minimal"] .sb-mq-item {
  font-size: 30px;                 /* the JS fit ladder starts here too */
  font-weight: 400;                /* Sora 400; 700 is kept for emphasis only */
  letter-spacing: .05em;
}
.sb[data-layout="minimal"] .sb-logo {
  top: 24px; width: 150px; height: 150px;    /* smaller, still overhanging */
  border-radius: 50%;
  object-fit: cover;                          /* fill the circle, don't letterbox */
  filter: none;                               /* quiet: no drop shadow */
}

/* ---- scorebug: the message area in a boxed cell, the logo a crest on it ----
   The cell is .sb-banner::after — a pseudo-element, so the boxed look costs no
   DOM node. z-index 0 puts it over the hatching and under the slots (z-index 1).
   Its 2px accent border IS the inset line. On the logo's side the cell tucks
   24px UNDER the badge (which sits at z-index 50), so the crest reads as pinned
   onto the bug rather than parked beside it; the far side keeps its 14px inset.
   max() keeps the no-logo case (gutter = edge) at the plain 14px. */
.sb[data-layout="scorebug"] .sb-banner::after {
  content: '';
  position: absolute; z-index: 0;
  top: 9px; bottom: 11px;
  /* The cell is chrome, but it is a BOX: a border cut off by the phone's crop
     reads as broken in a way a bled background never does, so its 14px floor
     is 14px from where the bar WRITES, not from the canvas. With a logo the
     gutter is wider than either floor and nothing here moves. */
  left: max(calc(14px + var(--safe-x)), calc(var(--gut-l) - 40px));
  right: max(calc(14px + var(--safe-x)), calc(var(--gut-r) - 40px));
  background: var(--r-bar-bg, var(--secondary));
  border: 2px solid var(--r-bar-accent, var(--accent));
  border-radius: 10px;
  pointer-events: none;
}
.sb[data-layout="scorebug"] .sb-rule-top { display: none; }
.sb[data-layout="scorebug"] .sb-rule-bot { height: 2px; box-shadow: none; }
.sb[data-layout="scorebug"] .sb-slot-t,
.sb[data-layout="scorebug"] .sb-mq-item { font-size: 32px; }
/* The marquee runs over the cell, so its right fade is the CELL's colour. */
.sb[data-layout="scorebug"] .sb-mq::after { background: linear-gradient(to left, var(--r-bar-bg, var(--secondary)), transparent); }
/* The crest: a rounded badge in the secondary colour with an accent ring and a
   soft halo, overhanging the bar by 80px like Broadcast's logo does by 100 —
   the same confidence, at the bug's compact 150px. Bottom-anchored (the scale
   origin is the bar's bottom corner on its side), so logo size grows it up and
   inward and left/right mirrors it with everything else. Static shadow only;
   the transitions on this element stay opacity, and scale is a transform. */
.sb[data-layout="scorebug"] .sb-logo {
  top: 20px; width: 150px; height: 150px;    /* 20 → 170: sits on the cell, clears the bar's bottom edge */
  padding: 18px;
  background: var(--r-badge-bg, var(--secondary));
  border: 3px solid var(--r-badge-ring, var(--accent));
  border-radius: 30px;
  box-shadow: 0 0 0 4px rgba(var(--r-badge-ring-rgb, var(--accent-rgb)), .22), 0 10px 26px rgba(0, 0, 0, .6);
  object-fit: contain;
  filter: none;
}

/* ---- the fill: solid (the primary colour, the default) or one static
   gradient from primary to secondary, painted once. Direction is an angle. ---- */
.sb { --fill-angle: 90deg; }
.sb[data-fill-dir="down"] { --fill-angle: 180deg; }
.sb[data-fill-dir="diagonal"] { --fill-angle: 135deg; }
.sb[data-fill="gradient"] .sb-banner { background: linear-gradient(var(--fill-angle), var(--sb-bar-bg), var(--secondary)); }
/* Glass keeps its translucency, Neon its black, Strip its transparency: those
   layouts own the fill. The gradient reads through the finish's hatching. */
.sb[data-fill="gradient"][data-layout="glass"] .sb-banner { background: linear-gradient(var(--fill-angle), rgba(var(--r-bar-bg-rgb, var(--primary-rgb)), .62), rgba(var(--secondary-rgb), .55)); }
.sb[data-fill="gradient"][data-layout="neon"] .sb-banner { background: var(--r-bar-bg, #0b0810); }
.sb[data-fill="gradient"][data-layout="strip"] .sb-banner { background: transparent; }

/* ---- the kill switch: the whole bar fades, nothing else changes ---- */
.sb { transition: opacity 320ms ease; }
.sb[data-hidden="on"] { opacity: 0; }

/* ---- flash: a one-off message in a slot, over whatever the row was doing.
   In Scroll motion the slots are display:none and the marquee owns the row;
   a flash brings the slots back and dims the marquee (opacity only) for its
   ten seconds. In the other motions the slots are already the row. ---- */
.sb[data-flash="on"] .sb-mq { opacity: 0; transition: opacity var(--fade) ease; }
.sb[data-motion="horizontal"][data-flash="on"] .sb-slot { display: flex; }

/* A flash is unmistakable: the message in the accent colour with a glow, a
   faster cut-in (220 ms on the same opacity/transform transition), and the
   rules lit up for its ten seconds. Static styles switched by class; the only
   things that move are still opacity and transform. */
.sb-slot.is-flash { transition-duration: 220ms; }
.sb-slot.is-flash .sb-slot-t { color: var(--accent); text-shadow: 0 0 14px rgba(var(--r-bar-flash-rgb, var(--r-bar-accent-rgb, var(--accent-rgb))), .75), 0 2px 4px rgba(0, 0, 0, .6); }
.sb[data-flash="on"] .sb-rule-bot { box-shadow: 0 0 22px rgba(var(--r-bar-accent-rgb, var(--accent-rgb)), .95); }
.sb[data-flash="on"] .sb-rule-top { background: var(--r-bar-accent, var(--accent)); }

/* ---- the brand node: hidden unless a layout below uses it ---- */
.sb-brand { display: none; }

/* ======================================================================
   STARTER LAYOUTS — same DOM, same stage; the plan flag decides whether the
   config ever names them (buildConfig renders Broadcast without it).
   ====================================================================== */

/* ---- ticker: a 46px news strip at the bottom, the brand tab on the logo's
   side, every message on the marquee (the module forces Scroll motion).
   The banner turns into a flex row: tab, then the window, which stops being
   gutter-positioned and simply fills. The logo shrinks into the tab. ---- */
.sb[data-layout="ticker"] .sb-bar { top: 144px; height: 46px; border-radius: 3px; box-shadow: 0 -4px 24px rgba(0, 0, 0, .6); }
.sb[data-layout="ticker"] .sb-banner { height: 46px; display: flex; align-items: stretch; }
.sb[data-layout="ticker"] .sb-banner::before { display: none; }
.sb[data-layout="ticker"] .sb-rule-top { background: var(--r-bar-accent, var(--accent)); }
.sb[data-layout="ticker"] .sb-rule-bot { display: none; }
.sb[data-layout="ticker"] .sb-brand {
  display: flex; align-items: center; flex: 0 0 auto; z-index: 2;
  /* The tab is a COLOURED BLOCK anchored to the bar's edge: its fill stays
     flush (it is a background) and its TEXT pads in by the safe area. */
  padding: 0 26px 0 calc(54px + var(--safe-x));
  background: var(--secondary); color: var(--r-bar-brand, var(--text));
  font-size: 19px; font-weight: 700; letter-spacing: .1em; white-space: nowrap;
  clip-path: polygon(0 0, 100% 0, calc(100% - 12px) 100%, 0 100%);
}
.sb.no-logo[data-layout="ticker"] .sb-brand { padding-left: calc(18px + var(--safe-x)); }
/* The window fills what the tab leaves. Its far end is the bar's own edge, so
   that end insets; the tab's end needs nothing — the tab carries the inset. */
.sb[data-layout="ticker"] .sb-mq { position: relative; top: auto; bottom: auto; left: auto; right: auto; flex: 1; height: 46px; margin-right: var(--safe-x); }
.sb[data-layout="ticker"] .sb-mq-track { padding-left: 20px; }
.sb[data-layout="ticker"] .sb-mq-item { font-size: 24px; }
.sb[data-layout="ticker"] .sb-mq-sep { font-size: 18px; }
.sb[data-layout="ticker"] .sb-logo {
  top: 151px; left: calc(12px + var(--safe-x)); width: 32px; height: 32px;
  border-radius: 50%; object-fit: cover; background: var(--primary);
  filter: none; transform-origin: center;
}
/* Logo right: the row reverses, the tab's cut mirrors, the logo moves over. */
.sb[data-logo="right"][data-layout="ticker"] .sb-banner { flex-direction: row-reverse; }
.sb[data-logo="right"][data-layout="ticker"] .sb-brand { padding: 0 calc(54px + var(--safe-x)) 0 26px; clip-path: polygon(12px 0, 100% 0, 100% 100%, 0 100%); }
.sb[data-logo="right"][data-layout="ticker"] .sb-mq { margin-right: 0; margin-left: var(--safe-x); }
.sb[data-logo="right"][data-layout="ticker"] .sb-logo { left: auto; right: calc(12px + var(--safe-x)); }
.sb[data-logo="right"][data-layout="ticker"] .sb-mq::after { right: auto; left: 0; background: linear-gradient(to right, var(--primary), transparent); }

/* ---- stacked: brand name over the message on a 100px bar, Broadcast's
   overhanging logo and gutters. The slots and the window drop below the
   brand line by 36px; nothing else moves. ---- */
/* Its message line is the bar's BOTTOM — there is no scores strip under it —
   so it takes the SCORES roles, falling back to the bar's own and then to what
   it always drew (the primary fill, the text colour). That is why the two
   variables exist: the paint may become a gradient here (scores.bgEnd), while
   the marquee's edge fade needs the flat colour. */
.sb[data-layout="stacked"] {
  --sb-bar-bg: var(--r-scores-bg, var(--r-bar-bg, var(--primary)));
  --sb-banner-paint: linear-gradient(to bottom, var(--sb-bar-bg), var(--r-scores-bg-end, var(--sb-bar-bg)));
}
.sb[data-layout="stacked"] .sb-bar { top: 90px; height: 100px; }
.sb[data-layout="stacked"] .sb-banner { height: 100px; }
.sb[data-layout="stacked"] .sb-rule-top { display: none; }
.sb[data-layout="stacked"] .sb-brand {
  display: flex; align-items: center; gap: 12px; position: absolute; z-index: 2;
  top: 10px; left: var(--gut-l); right: var(--gut-r); height: 24px;
  color: var(--r-bar-brand, var(--accent)); font-size: 17px; font-weight: 700; letter-spacing: .22em; white-space: nowrap;
}
.sb[data-layout="stacked"] .sb-brand::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(var(--r-bar-brand-rgb, var(--accent-rgb)), .6), transparent); }
.sb[data-logo="right"][data-layout="stacked"] .sb-brand { flex-direction: row-reverse; }
.sb[data-logo="right"][data-layout="stacked"] .sb-brand::after { background: linear-gradient(270deg, rgba(var(--r-bar-brand-rgb, var(--accent-rgb)), .6), transparent); }
.sb[data-layout="stacked"] .sb-slot { padding-top: 36px; }
.sb[data-layout="stacked"] .sb-mq { top: 36px; }
.sb[data-layout="stacked"] .sb-slot-t,
.sb[data-layout="stacked"] .sb-mq-item { font-size: 36px; line-height: 1.05; color: var(--r-scores-text, var(--r-bar-text, var(--text))); }

/* ---- strip: text only. No logo, no fill: a hairline, the brand as a small
   prefix, the message with a shadow so it reads over anything. ---- */
/* No logo here, so both gutters are the plain edge — which is the interior air
   plus the safe area, exactly as --edge has it. */
.sb[data-layout="strip"] { --gut-l: var(--edge); --gut-r: var(--edge); }
.sb[data-layout="strip"] .sb-logo { display: none; }
.sb[data-layout="strip"] .sb-bar { top: 100px; height: 90px; box-shadow: none; border-radius: 0; }
.sb[data-layout="strip"] .sb-banner { background: transparent; }
.sb[data-layout="strip"] .sb-banner::before { display: none; }
.sb[data-layout="strip"] .sb-rule-top { top: 26px; left: 28px; right: 28px; height: 2px; background: rgba(var(--r-bar-accent-rgb, var(--accent-rgb)), .9); }
.sb[data-layout="strip"] .sb-rule-bot { display: none; }
.sb[data-layout="strip"] .sb-brand {
  display: block; position: absolute; z-index: 3; top: 6px; left: var(--gut-l);
  color: var(--r-bar-brand, var(--accent)); font-size: 15px; font-weight: 700; letter-spacing: .24em; white-space: nowrap;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .9);
}
.sb[data-logo="right"][data-layout="strip"] .sb-brand { left: auto; right: var(--gut-r); }
.sb[data-layout="strip"] .sb-slot { padding-top: 26px; }
.sb[data-layout="strip"] .sb-mq { top: 26px; }
.sb[data-layout="strip"] .sb-mq::after { background: none; }
.sb[data-layout="strip"] .sb-slot-t,
.sb[data-layout="strip"] .sb-mq-item { text-shadow: 0 2px 4px rgba(0, 0, 0, .95), 0 8px 24px rgba(0, 0, 0, .7); }

/* ---- glass: Broadcast's geometry, a translucent panel instead of a fill.
   A plain alpha gradient, a one-pixel light border and a top highlight — no
   backdrop-filter, which would re-blur the video behind it every frame. The
   slots keep their gutters, so the message starts clear of the logo. ---- */
.sb[data-layout="glass"] .sb-bar {
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 6px 30px rgba(0, 0, 0, .45);
}
.sb[data-layout="glass"] .sb-banner { background: linear-gradient(180deg, rgba(var(--r-bar-bg-rgb, var(--primary-rgb)), .62), rgba(var(--r-bar-bg-rgb, var(--primary-rgb)), .48)); }
.sb[data-layout="glass"] .sb-banner::before,
.sb[data-layout="glass"] .sb-rule-top,
.sb[data-layout="glass"] .sb-rule-bot { display: none; }
.sb[data-layout="glass"] .sb-mq::after { background: linear-gradient(to left, rgba(var(--r-bar-bg-rgb, var(--primary-rgb)), .7), transparent); }
.sb[data-layout="glass"] .sb-slot-t,
.sb[data-layout="glass"] .sb-mq-item { text-shadow: 0 2px 6px rgba(0, 0, 0, .6); }

/* ---- neon: a near-black bar, the accent as a lit edge, the type carrying the
   same light, the logo ringed to match. Every glow is a static shadow, painted
   once; only opacity/transform ever animate. ---- */
.sb[data-layout="neon"] .sb-bar {
  border-radius: 6px;
  border: 2px solid var(--r-bar-accent, var(--accent));
  box-shadow: 0 0 18px rgba(var(--r-bar-accent-rgb, var(--accent-rgb)), .55), inset 0 0 22px rgba(var(--r-bar-accent-rgb, var(--accent-rgb)), .18), 0 8px 30px rgba(0, 0, 0, .7);
}
.sb[data-layout="neon"] .sb-banner { background: var(--r-bar-bg, #0b0810); }
.sb[data-layout="neon"] .sb-banner::before,
.sb[data-layout="neon"] .sb-rule-top,
.sb[data-layout="neon"] .sb-rule-bot { display: none; }
.sb[data-layout="neon"] .sb-mq::after { background: linear-gradient(to left, var(--r-bar-bg, #0b0810), transparent); }
.sb[data-layout="neon"] .sb-slot-t,
.sb[data-layout="neon"] .sb-mq-item {
  color: var(--accent);
  letter-spacing: .04em;
  text-shadow: 0 0 10px rgba(var(--r-bar-text-rgb, var(--accent-rgb)), .8), 0 0 26px rgba(var(--r-bar-text-rgb, var(--accent-rgb)), .45);
}
.sb[data-layout="neon"] .sb-mq-sep { color: rgba(var(--r-bar-text-rgb, var(--accent-rgb)), .7); }
.sb[data-layout="neon"] .sb-logo { filter: drop-shadow(0 0 10px rgba(var(--r-bar-accent-rgb, var(--accent-rgb)), .55)) drop-shadow(0 4px 12px rgba(0, 0, 0, .85)); }

/* ---- slim: Broadcast — the overhanging logo, the hatching, the gold rule —
   on a 56px bar with one line of smaller type. The logo keeps its 190px, so it
   overhangs by 134 and the gutters are unchanged. ---- */
.sb[data-layout="slim"] .sb-bar { top: 134px; height: 56px; }
.sb[data-layout="slim"] .sb-banner { height: 56px; }
.sb[data-layout="slim"] .sb-rule-top { display: none; }
.sb[data-layout="slim"] .sb-rule-bot { height: 2px; box-shadow: 0 0 10px rgba(var(--r-bar-accent-rgb, var(--accent-rgb)), .6); }
.sb[data-layout="slim"] .sb-slot-t,
.sb[data-layout="slim"] .sb-mq-item { font-size: 28px; letter-spacing: .03em; }

/* ======================================================================
   BROADCAST SCORES (Pro) — the one layout that STACKS.

   Ported from the rbreaks reference's double bar (`rbreaks-overlay.html`):
   its floating logo (190 × 190, overhanging 100 — lines 30–55), its social
   banner (980 × 90, the gold gradient rule, the 80px hatching, 34px type —
   90–155, 740), its ticker section (980 × 110, a full-width window with a
   32px fade — 336–390; the reference's 60 + 4px LIVE rail is NOT ported, so
   the window is the whole 980) and its bottom bar (42px, a 1px accent rule
   above it, a 28px label │ a 28px line — 757, 852–936).

     100 overhang + 90 messages + 110 scores + 42 extras = 342.

   Strip one is Broadcast's own banner wearing Ticker's brand tab, but it
   HONOURS the overlay's own message motion (Fade / Vertical / Scroll) like
   every other layout — only Ticker itself forces Scroll, because that layout
   IS a news ticker (CLAUDE.md §6).

   The tab is ABSOLUTE at the far end of the banner, opposite the logo, in all
   three motions — it is not a flex item. (It was, with order:2; but in Fade
   and Vertical the two message slots are absolute, so the tab was the row's
   only in-flow item and `order` had nothing to order it against: it landed at
   x=0, on top of the messages.) The marquee and the slots then both stop short
   of it by --tab-w, the tab's width, which the module measures off the tab and
   writes onto the root on a layout / brand-name / face change. One number,
   one side, three motions — and the logo keeps the gutter it already reserves,
   so nothing about the gutter maths changes.
   ====================================================================== */
.sb[data-layout="broadcast-scores"] { height: 342px; }
.sb[data-layout="broadcast-scores"] .sb-bar { height: 200px; }          /* 90 + 110 */
/* The tab: absolute, far end, above the messages. Logo left -> tab right. */
.sb[data-layout="broadcast_duo"] .sb-brand,
.sb[data-layout="broadcast-scores"] .sb-brand {
  display: flex; align-items: center; z-index: 2;
  position: absolute; top: 0; bottom: 0; right: 0; left: auto;
  /* The tab is a COLOURED BLOCK on the bar's edge: its fill stays flush (it is
     a background) and its TEXT pads in by the safe area. --tab-w is measured
     off this node, so the messages beside it stop short of the WHOLE tab. */
  padding: 0 calc(22px + var(--safe-x)) 0 34px;
  background: var(--secondary); color: var(--r-bar-brand, var(--text));
  font-size: 19px; font-weight: 700; letter-spacing: .1em; white-space: nowrap;
  clip-path: polygon(22px 0, 100% 0, 100% 100%, 0 100%);
}
/* The marquee and the slots both stop short of it, by the same number.
   BROADCAST DUO wears the very same banner, so it takes each of these rules
   too — scoped to `.sb-banner >` so its BOTTOM strip, which has no tab and no
   logo gutter to clear, is left to its own 22px either side. */
/* The air here is --edge-in, not --edge: what the message stops short of is
   the TAB, which is inside the bar and carries the safe area in its own
   padding. Adding --safe-x again would take it off the bar twice.
   --edge is the FLOOR under it, and that floor is the whole of this fix:
   --tab-w is the one gutter number on the bar that comes from a MEASUREMENT,
   and applyTabWidth REMOVES it whenever the tab measures zero — a mount that
   has not been laid out, or the re-measure a layout switch fires while the bar
   is not rendering. The stylesheet's own `var(--tab-w, 0px)` then left the
   message 28px from the bar's edge, inside the phone's crop, and on the LEFT
   whenever the logo is on the right. With a tab there the tab always wins this
   max; with none, the message keeps the plain edge every other layout has. */
.sb[data-layout="broadcast_duo"] .sb-banner > .sb-mq,
.sb[data-layout="broadcast-scores"] .sb-mq { right: max(var(--edge), calc(var(--edge-in) + var(--tab-w, 0px))); }
.sb[data-layout="broadcast_duo"] .sb-banner > .sb-slot,
.sb[data-layout="broadcast-scores"] .sb-slot { padding-right: max(var(--edge), calc(var(--edge-in) + var(--tab-w, 0px))); }
/* Logo right -> tab left, the cut mirrored, and the insets swap with it. */
.sb[data-logo="right"][data-layout="broadcast_duo"] .sb-brand,
.sb[data-logo="right"][data-layout="broadcast-scores"] .sb-brand { right: auto; left: 0; padding: 0 34px 0 calc(22px + var(--safe-x)); clip-path: polygon(0 0, 100% 0, calc(100% - 22px) 100%, 0 100%); }
.sb[data-logo="right"][data-layout="broadcast_duo"] .sb-banner > .sb-mq,
.sb[data-logo="right"][data-layout="broadcast-scores"] .sb-mq { right: var(--gut-r); left: max(var(--edge), calc(var(--edge-in) + var(--tab-w, 0px))); }
.sb[data-logo="right"][data-layout="broadcast_duo"] .sb-banner > .sb-slot,
.sb[data-logo="right"][data-layout="broadcast-scores"] .sb-slot { padding-right: var(--gut-r); padding-left: max(var(--edge), calc(var(--edge-in) + var(--tab-w, 0px))); }

/* ---- strip two: the scores (the reference's ticker-section, 110px) ---- */
/* The strip's own text is OURS, not the creator's copy, so the text-case
   setting never reaches it: scores read as caps, as the reference's do. */
.sb-scores, .sb-extras { text-transform: uppercase; }
/* Its background is a top-to-bottom GRADIENT so `scores.bgEnd` has somewhere
   to land; with neither role set both stops are --secondary, which paints
   exactly the flat fill this rule used to declare. The two variables are
   declared here rather than inline so the window's edge fades (children of
   this element) inherit the same colour. */
/* The PADDING is the safe area: the gradient below paints the whole 980 (a
   background is not clipped by padding) while the window — the flex child that
   clips the cells — is 980 less both bands, so a score cell can never scroll
   into the cropped zone and the edge fades sit at the INSET edge. */
.sb-scores {
  position: relative;
  height: 110px;
  padding: 0 var(--safe-x);
  display: flex;
  --sb-sc-bg: var(--r-scores-bg, var(--secondary));
  --sb-sc-bg-end: var(--r-scores-bg-end, var(--sb-sc-bg));
  background: linear-gradient(to bottom, var(--sb-sc-bg), var(--sb-sc-bg-end));
  color: var(--r-scores-text, var(--text));
}
/* No LIVE rail. There was one — the reference's `.label`, 60px of --primary
   with a 4px accent border, "LIVE" over a pip that pulsed while a followed
   game was in play — and it came off: it cost 64px of every flow, and the live
   cells' own flashing clock already says which game is on. `data-live` is
   still written on the strip (it is free, and an indicator may want it again);
   nothing styles it today. */
/* The window is the whole 980 now — the strip's only child. */
.sb-sc-win { position: relative; z-index: 1; flex: 1; min-width: 0; overflow: hidden; display: flex; align-items: stretch; }
/* Ticker motion: the track never hard-cuts at either edge. A 56px fade into
   the row colour on the right, where a cell leaves, and a 12px one on the
   left, at the bar's own edge, where it arrives. Pages (Vertical / Fade) get
   neither — a page is measured to FIT the window, so nothing of it is ever
   at the edge to fade. */
.sb-scores[data-motion="ticker"] .sb-sc-win::after,
.sb-scores[data-motion="ticker"] .sb-sc-win::before {
  content: '';
  position: absolute; top: 0; bottom: 0; z-index: 2;
  pointer-events: none;
}
.sb-scores[data-motion="ticker"] .sb-sc-win::after { right: 0; width: 56px; background: linear-gradient(to left, var(--secondary), transparent); }
.sb-scores[data-motion="ticker"] .sb-sc-win::before { left: 0; width: 12px; background: linear-gradient(to right, var(--secondary), transparent); }
/* Ticker motion: rAF-translated, never a CSS animation (exact px/s).
   `flex: 0 0 auto` on BOTH the track and its repeat blocks is load-bearing, not
   tidiness. They are flex items of the 980px window and their natural width is
   thousands of pixels; with the default `flex-shrink: 1` the flex algorithm
   squeezed their BOXES while the cells inside (which are `flex: 0 0 auto`) kept
   their size — so the second block's box began long before the first block's
   cells ended, and its league header was painted on top of a game. */
.sb-sc-track { display: flex; align-items: stretch; flex: 0 0 auto; width: max-content; will-change: transform; }
.sb-sc-track > .sb-block { flex: 0 0 auto; align-items: stretch; }
/* Vertical / Fade: two stacked cells taking turns, on the banner's own dwell
   and fade. Same two properties, same curves — nothing new moves. */
/* A page is AS MANY GAME cells as FIT the window at the widths they render —
   three at most, two when the scores are double-digit, one for a 3-digit NBA
   score in a wide face — centred, each preceded by its competition chip. The
   module measures every cell in the measuring slot below and paginateScores
   stops the page where the next cell would not fit: THE STRIP NEVER CLIPS A
   CELL. The chip is extra - it never counts as one of the three, and it is
   never the last thing on a page (paginateScores in overlay.js guarantees it).
   Children carry an explicit `order`, so one fixed set of nodes lays out any
   page without a node ever being created or destroyed. */
.sb-sc-slot {
  position: absolute; inset: 0; z-index: 1;
  display: flex; align-items: stretch;
  /* SAFE centring. A page centred while it is wider than the 980px window puts
     half its overflow off the LEFT edge, so the first cell was cut at the bar's
     edge. `safe` centres while it fits and falls back to the start when it
     does not, so nothing ever begins before the window. The plain value first,
     for an engine that does not know the keyword. */
  justify-content: center;
  justify-content: safe center;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity var(--fade) ease, transform var(--fade) ease;
}
.sb-sc-slot.is-in { opacity: 1; transform: none; }
.sb-sc-slot.is-out { opacity: 0; transform: scale(.94); }
.sb-scores[data-motion="vertical"] .sb-sc-slot { transform: translateY(45%); transition-timing-function: cubic-bezier(.22, 1, .36, 1); }
.sb-scores[data-motion="vertical"] .sb-sc-slot.is-in { transform: none; }
.sb-scores[data-motion="vertical"] .sb-sc-slot.is-out { transform: translateY(-45%); }
/* The measuring slot: laid out exactly as a page (same cells, same styles) but
   never painted and never animated, so offsetWidth is the truth and nothing
   flashes. Flush left, so a batch wider than the window overflows to the right
   at natural widths instead of shrinking. */
.sb-sc-slot.sb-sc-measure,
.sb-scores[data-motion="vertical"] .sb-sc-slot.sb-sc-measure {
  visibility: hidden; opacity: 1; transform: none;   /* never in, never out: nothing to transition */
  justify-content: flex-start; z-index: 0;
}

/* ---- one game (the reference's .game / .team-col / .score-col) ----
   Drawn as a 5 × 2 grid instead of three flex columns: same picture, ten
   nodes instead of thirteen, which is what keeps six games affordable.
   Rows are the reference's own split of the 110px — the score's 82px over the
   28px name line — so the badge, the numbers and the status badge land where
   they land there. */
.sb-game {
  position: relative;
  flex: 0 0 auto;
  height: 110px;
  display: grid;
  /* The team columns SIZE THEMSELVES to the name: 60px is the reference's own
     width at its condensed Bebas Neue, and it is the floor here - a wide
     display face (Bungee, Russo One) needs nearly twice that for three caps at
     28px, and a clipped "AV..." is not a scoreboard. max-content means the cell
     grows instead of the name shrinking, so there is no ellipsis to hit and
     nothing to measure at runtime. `shortTeam` caps the name at five
     characters, which is what keeps the growth bounded. */
  /* The score columns size to their digits too, from the same 46px floor the
     reference's score-col has: "112" in a wide face is wider than "7", and the
     column follows — the pager measures the cell, so a wider cell means fewer
     to a page, never a clipped one. */
  grid-template-columns: minmax(60px, max-content) minmax(46px, max-content) auto minmax(46px, max-content) minmax(60px, max-content);
  grid-template-rows: 82px 28px;
  align-items: center; justify-items: center;
  column-gap: 5px;
  padding: 0 10px;
  border-right: 2px solid rgba(var(--r-scores-divider-rgb, var(--text-rgb)), .15);
}
/* ---- the competition header (the reference's .league-block, 393–399, and its
   per-sport variants at 489–500): the league's own badge over its short name,
   a 3px accent bar down its leading edge. Its colours are the theme's, since a
   tenant's bar is not the reference's purple and gold. ---- */
.sb-group {
  position: relative;
  flex: 0 0 auto;
  height: 110px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 5px;
  padding: 0 16px;
  border-right: 3px solid rgba(var(--r-scores-chip-rgb, var(--accent-rgb)), .35);
  background: rgba(var(--r-scores-chip-rgb, var(--accent-rgb)), .06);
}
/* It stays NARROW — the reference's block is ~80px, a badge over a short code,
   never a cell the width of a game. `.sb-gr-name` shows the competition's short
   label (shortLeague), so the 48px badge is what sets the width. */
.sb-group { max-width: 96px; }
.sb-group::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--r-scores-chip, var(--accent)); opacity: .8; }
.sb-group[hidden] { display: none; }
.sb-gr-badge { width: 48px; height: 48px; object-fit: contain; }
.sb-gr-badge[hidden] { display: none; }
.sb-gr-name {
  max-width: 100%;
  font-size: 12px; font-weight: 700; letter-spacing: .1em; line-height: 1;
  color: var(--r-scores-chip, var(--accent));
  white-space: nowrap; overflow: hidden;
}
/* On a PAGE it is narrower still — three games have to fit beside it — but the
   same stack: a 26px badge over a 10px code, ~44px. */
.sb-sc-slot .sb-group {
  gap: 4px; padding: 0 9px;
  max-width: 52px;
  border-right: 2px solid rgba(var(--r-scores-chip-rgb, var(--accent-rgb)), .35);
}
.sb-sc-slot .sb-gr-badge { width: 26px; height: 26px; }
.sb-sc-slot .sb-gr-name { font-size: 10px; letter-spacing: .06em; }
/* The page is centred, so the cell that ends up last drops its separator. */
.sb-sc-slot .is-last { border-right: none; }
.sb-game[hidden] { display: none; }
.sb-g-badge { width: 38px; height: 38px; object-fit: contain; align-self: start; margin-top: 10px; }
.sb-g-badge[hidden] { display: none; }
.sb-g-badge.is-h { grid-area: 1 / 1; }
.sb-g-badge.is-a { grid-area: 1 / 5; }
.sb-g-name {
  font-size: 28px; letter-spacing: .06em; line-height: 1;
  color: var(--r-scores-abbr, var(--r-scores-text, var(--text)));
  white-space: nowrap;          /* no max-width, no overflow, NO ellipsis: the column follows the name */
}
.sb-g-name.is-h { grid-area: 2 / 1; }
.sb-g-name.is-a { grid-area: 2 / 5; }
.sb-g-score { font-size: 82px; line-height: 1; min-width: 46px; text-align: center; color: var(--r-scores-score, var(--r-scores-text, var(--text))); }
.sb-g-score.is-h { grid-area: 1 / 2; }
.sb-g-score.is-a { grid-area: 1 / 4; }
/* The reference's --c-score-dash is its purple at 45%: the theme's primary. */
.sb-g-dash { grid-area: 1 / 3; font-size: 44px; line-height: 1; color: var(--r-scores-divider, rgba(var(--primary-rgb), .45)); }
.sb-g-time {
  grid-area: 2 / 2 / 3 / 5;
  font-size: 13px; letter-spacing: .08em; line-height: 1.3; white-space: nowrap;
  background: var(--r-scores-status, var(--accent)); color: #000;
  padding: 2px 8px; border-radius: 2px;
}
.sb-g-time[hidden] { display: none; }
.sb-game[data-status="live"] .sb-g-time { background: var(--r-scores-live, var(--r-scores-status, var(--accent))); animation: sbFlash 1.4s ease-in-out infinite; }
.sb-game[data-status="final"] .sb-g-time { background: rgba(var(--r-scores-status-rgb, var(--text-rgb)), .08); color: rgba(var(--r-scores-status-rgb, var(--text-rgb)), .3); }
.sb-game[data-status="scheduled"] .sb-g-time { background: transparent; color: rgba(var(--r-scores-status-rgb, var(--text-rgb)), .3); border: 1px solid rgba(var(--r-scores-status-rgb, var(--primary-rgb)), .3); }
/* The sport's extras (NFL down & distance, NHL power play, MLB outs/runners).
   The reference shows none, so this slot is ours: a muted line along the
   bottom of the cell, with the rows giving up 12px for it when it is there. */
.sb-g-note {
  position: absolute; left: 6px; right: 6px; bottom: 3px;
  text-align: center;
  font-size: 10px; font-weight: 700; letter-spacing: .08em; line-height: 1;
  color: rgba(var(--accent-rgb), .85);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sb-g-note[hidden] { display: none; }
.sb-game[data-note="on"] { grid-template-rows: 70px 26px; }
.sb-game[data-note="on"] .sb-g-score { font-size: 66px; }

/* ---- strip three: the extras (the reference's .fantasy-np / .spotify-np) ----
   A 42px bar under the scores, its own 1px accent rule above it, one fixed
   label, a "│" and one line that pages. It holds its 42px whether or not it
   has anything to say — opacity and a 4px lift are the only things that move,
   so a fantasy league that starts mid-stream never shifts the bar above it.

   The line shows only WHOLE ENTRIES: the module measures this very body and
   composes a screen of the table rows (or matches, or movers) that fit at
   22px, paging the rest on the dwell — so `text-overflow` is `clip`, not
   `ellipsis`. The ellipsis is what this fixes ("6 TZ…" at the end of a table);
   clip is the backstop for the one case nothing can page, a single entry too
   wide even with its name shortened at a word break. */
.sb-extras {
  position: absolute; left: 0; right: 0; top: 300px; height: 42px; z-index: 40;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 calc(10px + var(--safe-x));
  /* Each role here inherits from the scores strip's counterpart first and only
     then from what it always drew, so colouring the strip above carries this
     one with it unless the creator says otherwise. */
  --sb-x-bg: var(--r-fpl-bg, var(--r-scores-bg, var(--secondary)));
  --sb-x-bg-end: var(--r-fpl-bg-end, var(--r-scores-bg-end, var(--sb-x-bg)));
  background: linear-gradient(to bottom, var(--sb-x-bg), var(--sb-x-bg-end));
  border-top: 1px solid rgba(var(--r-fpl-accent-rgb, var(--r-scores-chip-rgb, var(--accent-rgb))), .35);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .5s ease, transform .4s ease;
  pointer-events: none;
}
.sb-extras.is-on { opacity: 1; transform: translateY(0); }
.sb-x-label {
  flex-shrink: 0;
  font-size: 22px; letter-spacing: .12em; line-height: 1.2; white-space: nowrap;
  color: var(--r-fpl-accent, var(--r-scores-chip, var(--accent)));
}
.sb-x-sep { flex-shrink: 0; font-size: 14px; line-height: 1; color: rgba(var(--r-fpl-accent-rgb, var(--r-scores-chip-rgb, var(--accent-rgb))), .3); }
.sb-x-body {
  flex: 0 1 auto; min-width: 0;
  font-size: 22px; line-height: 1.2;
  color: var(--r-fpl-text, var(--r-scores-text, rgba(var(--text-rgb), .9)));
  white-space: nowrap; overflow: hidden; text-overflow: clip;
  transition: opacity .18s ease;
}
.sb-x-body.is-swap { opacity: 0; }
/* A Now playing line too long for the body GLIDES in it, as a bar line does:
   this run is attached only then, and moves on transform alone. */
.sb-x-run { display: inline-block; will-change: transform; }
/* The seam: a page's KIND picks the strip's colour. Fantasy is the theme's
   accent (the reference's gold); Spotify — when it lands — brings its own
   green, and nothing in overlay.js changes for it. */
.sb-extras[data-kind="spotify"] { border-top-color: rgba(30, 215, 96, .35); }
.sb-extras[data-kind="spotify"] .sb-x-label { color: #1DB954; }
.sb-extras[data-kind="spotify"] .sb-x-sep { color: rgba(30, 215, 96, .3); }
/* NOW PLAYING (056): the line carries its own prefix, so no label and no rule. */
.sb-extras[data-kind="music"] .sb-x-label, .sb-extras[data-kind="music"] .sb-x-sep { display: none; }

/* ---- eBay third strip: the team ticker (the ONLY rules for it; scoped to it) ----
   The count stays put in .sb-x-body; the window beside it holds every live
   team and, when they are wider than the room, the track slides left by one
   pass in a seamless loop. Transform only; reduced motion keeps it still. */
[data-ebay-strip] .sb-x-body { flex-shrink: 0; }
.ebay-strip {
  flex: 1 1 0; min-width: 0; overflow: hidden;
  font-size: 22px; line-height: 1.2;
  color: var(--r-fpl-text, var(--r-scores-text, rgba(var(--text-rgb), .9)));
  transition: opacity .18s ease;
}
.ebay-strip.is-swap { opacity: 0; }
.ebay-strip > div { display: inline-block; white-space: pre; }
@keyframes ebayStripTick { to { transform: translateX(var(--ebay-x)); } }
@media (prefers-reduced-motion: no-preference) {
  .ebay-strip > div[data-run] { animation: ebayStripTick var(--ebay-dur) linear infinite; will-change: transform; }
}

/* ---- The bottom strip's scrolling ticker (ADR 0021; the ONLY rules for it; scoped to it) ----
   Only while the config sends one: the strip's label, rule and body are off it
   and this window holds one line that scrolls right to left, two copies of the
   same text side by side for a seamless loop, item 1 always entering from the
   right edge. Moved by transform from the rAF loop; the text is never cut and
   never gets an ellipsis. */
.sb-x-tk {
  flex: 1 1 0; min-width: 0; overflow: hidden;
  font-size: 22px; line-height: 1.2; white-space: nowrap;
  color: var(--r-fpl-text, var(--r-scores-text, rgba(var(--text-rgb), .9)));
  /* A soft fade at the window's two ends, inside the strip's padding (so
     inside the safe area). The window alone: nothing else has a mask. */
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 32px, #000 calc(100% - 32px), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 32px, #000 calc(100% - 32px), transparent 100%);
}
.sb-x-tk-track { display: inline-block; white-space: pre; will-change: transform; }
.sb-x-tk-copy { display: inline-block; white-space: pre; }

@keyframes sbFlash { 0%, 100% { opacity: 1; } 50% { opacity: .7; } }

/* ======================================================================
   CENTRE STAGE (Pro, beta) — Broadcast Scores' three strips under a
   different top bar.

   The same scores strip and the same extras strip, in the same order and
   with the same visibility rules; only strip one changes. A round crest
   BADGE sits centred on the bar's top edge — 1.4 x the 90px bar, so 126px
   across, its centre ON that edge and its bottom at 63 of the bar's 90 —
   with the brand name in small caps in the 27px band under it and a
   message either side of it.

     63 badge overhang + 90 messages + 110 scores + 42 extras = 305.

   A circle, not a shield: it is Minimal's round-logo treatment at broadcast
   scale, and the finish's gloss reads better on one.

   The module writes --cs-badge / --cs-overhang (arithmetic off one
   constant) and --cs-zone (the EXCLUSION ZONE: the badge plus its air, or
   the measured brand name plus its own, whichever is wider) onto the root,
   and removes all three on every other layout — so nothing below costs a
   layout that is not this one. The two halves span from their gutter to
   the zone's edge, which is what keeps a message from ever running under
   the badge.

   data-logo (left/right) and --logo-scale are IGNORED here: the badge is
   centred by definition and its size is the bar's, not the creator's.

   The BADGE's own rules — the circle, the fallback initial, the pulse ring
   and the brand-name band — are SHARED with SPOTLIGHT (the section after
   this one), which raises the same badge over one full-width message line.
   Its selector leads each of those lists; only --cs-overhang differs, and
   the module writes it.
   ====================================================================== */
.sb[data-layout="centre_stage"] { height: 305px; }
.sb[data-layout="centre_stage"] .sb-bar { top: var(--cs-overhang, 63px); height: 200px; }   /* 90 + 110 */
.sb[data-layout="centre_stage"] .sb-extras { top: 263px; }                                  /* 63 + 200 */
/* The badge: the SAME <img> the other layouts hang in the corner, drawn as a
   circle on the bar's top edge. The later rule wins the tie with the
   data-logo one above; the mirrored selector below settles it outright. */
.sb[data-layout="spotlight_duo"] .sb-logo,
.sb[data-logo="right"][data-layout="spotlight_duo"] .sb-logo,
.sb[data-layout="spotlight"] .sb-logo,
.sb[data-logo="right"][data-layout="spotlight"] .sb-logo,
.sb[data-layout="centre_stage"] .sb-logo,
.sb[data-logo="right"][data-layout="centre_stage"] .sb-logo {
  top: 0; left: 50%; right: auto;
  width: var(--cs-badge, 126px); height: var(--cs-badge, 126px);
  margin-left: calc(var(--cs-badge, 126px) / -2);
  border-radius: 50%;
  object-fit: cover;
  background: var(--r-badge-bg, var(--secondary));
  border: 3px solid var(--r-badge-ring, var(--accent));
  transform: none;
  z-index: 50;
}
/* No logo: the brand's first letter on the same circle, in the overlay's own
   face. One node, attached only while a badge layout is on, textContent only. */
.sb-cs-initial { display: none; }
.sb[data-layout="spotlight_duo"] .sb-cs-initial,
.sb[data-layout="spotlight"] .sb-cs-initial,
.sb[data-layout="centre_stage"] .sb-cs-initial {
  display: flex; align-items: center; justify-content: center;
  position: absolute;
  top: 0; left: 50%;
  width: var(--cs-badge, 126px); height: var(--cs-badge, 126px);
  margin-left: calc(var(--cs-badge, 126px) / -2);
  border-radius: 50%;
  background: var(--r-badge-bg, var(--secondary));
  border: 3px solid var(--r-badge-ring, var(--accent));
  font-size: 64px; font-weight: 700; line-height: 1;
  color: var(--r-bar-text, var(--text));
  z-index: 49;
  pointer-events: none;
}
.sb[data-layout="spotlight_duo"] .sb-cs-initial[hidden],
.sb[data-layout="spotlight"] .sb-cs-initial[hidden],
.sb[data-layout="centre_stage"] .sb-cs-initial[hidden] { display: none; }
/* The brand name, in the 27px band between the badge's bottom and the bar's
   rule. UNDER the badge rather than beside it, so both message halves keep
   the same width. Uppercase at 11px with wide tracking rather than
   `font-variant-caps`: not all twelve display faces carry small caps. */
/* It is SHRINK-TO-FIT, and that is load-bearing twice over. The module measures
   this node's offsetWidth to size the exclusion zone, so a box stretched from
   left:0 to right:0 would measure 980 and push both halves to nothing; `width:
   max-content` (with `margin: auto` between the two zero insets doing the
   centring, no transform) makes offsetWidth the NAME's own width.
   And the cap: a 40-character name — the most safeName takes — in the widest of
   the thirty faces (Orbitron, whose widest cap is 1.18em) measures ~600px at
   11px with .18em tracking, which would leave the zone eating 64 % of the bar.
   408px holds the zone to 408 + 2 x 16 = 440, 44.9 % of 980, so each half keeps
   (980 - 440) / 2 - 22 = 248px. Past that the name ellipses — the last resort,
   but the alternative is a bar with no room for a message on it. */
.sb[data-layout="spotlight_duo"] .sb-brand,
.sb[data-layout="spotlight"] .sb-brand,
.sb[data-layout="centre_stage"] .sb-brand {
  display: block;
  position: absolute; z-index: 4;
  left: 0; right: 0; top: var(--cs-overhang, 63px);
  width: max-content; max-width: 408px; margin-left: auto; margin-right: auto;
  height: calc(90px - var(--cs-overhang, 63px));
  line-height: calc(90px - var(--cs-overhang, 63px));
  text-align: center;
  font-size: 11px; font-weight: 700; letter-spacing: .18em; text-indent: .18em;
  color: var(--r-bar-brand, var(--accent));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  pointer-events: none;
}
/* The two halves: from the outer gutter (22px — there is no overhanging logo
   to clear on this layout — plus the phone safe area) to the edge of the
   exclusion zone. csHalfWidth() in overlay.js is this very arithmetic, which
   is why the character cap shrinks as the safe area grows. */
.sb-cs-half { display: none; }
.sb[data-layout="centre_stage"] .sb-cs-half {
  display: block;
  position: absolute; top: 0; bottom: 0; z-index: 1;
}
.sb[data-layout="centre_stage"] .sb-cs-half.is-l { left: calc(22px + var(--safe-x)); right: calc(50% + var(--cs-zone, 174px) / 2); }
.sb[data-layout="centre_stage"] .sb-cs-half.is-r { left: calc(50% + var(--cs-zone, 174px) / 2); right: calc(22px + var(--safe-x)); }
/* Inside a half the half IS the window: no logo gutter to reserve, and the
   message is centred in its own column. */
.sb[data-layout="centre_stage"] .sb-cs-half .sb-slot { padding: 3px 0; justify-content: center; }
/* SAFE centring, as the scores strip's pages have. A line WIDER than its
   window is `flex: 0 0 auto` in a centred flex box, so plain `center` hung half
   its overflow off the LEFT: the first words were never drawn, at either end of
   the glide. `safe` centres while it fits and starts at the window's own left
   edge when it does not — which is where the rotor's travel starts from. The
   plain value first, for an engine that does not know the keyword. */
.sb[data-layout="centre_stage"] .sb-cs-half .sb-slot-win { justify-content: center; justify-content: safe center; }
.sb[data-layout="centre_stage"] .sb-cs-half .sb-mq { left: 0; right: 0; }
.sb[data-layout="centre_stage"] .sb-cs-half .sb-mq::after { width: 20px; }
/* ONE SIZE, both halves, every step: there is no type ladder on this layout
   (BANNER_SIZES.centre_stage is this one number, CS_TEXT_PX). A half that
   auto-sized to its own content put a short word on one side at 30px beside a
   longer line at 22px on the other, which reads as broken; what does not fit
   is split across the two halves instead. */
.sb[data-layout="centre_stage"] .sb-cs-half .sb-slot-t,
.sb[data-layout="centre_stage"] .sb-cs-half .sb-mq-item { font-size: 30px; }
/* A HALF NEVER ELLIPSES (and since 16 Oct 2026 no `.sb-slot-t` does: a line
   too wide for its window glides). Here the module knows how many characters a half holds (it
   measures the ruler below) and shows a longer message ACROSS BOTH HALVES
   instead, so there is nothing for an ellipsis to say. `clip` is the backstop
   under it, never the treatment. */
.sb[data-layout="centre_stage"] .sb-cs-half .sb-slot-t { text-overflow: clip; }
/* The RULER: the module writes a string in here and reads how wide it renders,
   in the bar's own face at the one size a half draws at — laid out, never
   painted. That is how a half knows what it can hold: the real string as well
   as a character cap (all-caps copy runs wider than any average). Same weight and
   tracking as a message, and it inherits `text-transform` from `.sb`, so what
   it measures is what a half will draw; `width: max-content` so the read is the
   TEXT's width. SPOTLIGHT measures its one line off the very same run, so the
   selector leads this rule too; it is attached only while one of those two
   layouts is on, like every node of either. */
.sb-cs-ruler { display: none; }
.sb[data-layout="spotlight_duo"] .sb-cs-ruler,
.sb[data-layout="spotlight"] .sb-cs-ruler,
.sb[data-layout="centre_stage"] .sb-cs-ruler {
  display: block;
  position: absolute; top: 0; left: 0;
  width: max-content;
  visibility: hidden; pointer-events: none;
  font-weight: 700; letter-spacing: .02em; line-height: 1.1;
  white-space: pre;
}
/* The banner's own rotor is parked while the halves have the row: its slots
   and its marquee stay in the DOM, empty, and out of the way. */
.sb[data-layout="centre_stage"] .sb-banner > .sb-slot,
.sb[data-layout="centre_stage"] .sb-banner > .sb-mq { display: none; }

/* ---- MOTION (Centre Stage only) --------------------------------------
   The one layout with animation of its own, and all of it lives below:
   three ONE-SHOT keyframes, every one of them inside the reduced-motion
   query and every one of them on `transform` and `opacity` alone.

     sheen  a 2s diagonal highlight crossing the 90px message strip, once
            every 45s. The module adds .is-sheen on its interval and
            `animationend` takes it off, so BETWEEN sweeps nothing at all
            is running — a single long keyframe with a hold would have the
            compositor awake for three quarters of a minute at a time.
     pulse  600ms on the badge when a flash cuts in or a followed score
            moves: the crest scales, and a ring behind it carries the glow
            as OPACITY over a static box-shadow (an animated shadow is the
            second most expensive thing an OBS source can be asked to do,
            after an animated filter).
     swap   250ms as a half takes a new message — opacity and a 4px rise,
            under the slot's own cross-fade.

   Every one runs exactly once — no rule on this layout repeats a keyframe,
   none of them transitions, and `will-change` is set only while a one-shot
   class is on. A viewer who asks for less motion gets none of it: the keyframes
   are not declared for them at all, so the classes are inert, and the
   module does not arm the interval either.
   ---------------------------------------------------------------------- */
/* The band. Its own opacity is 0, so it is invisible — and inert — until a
   sweep runs. Inside .sb-banner, which is `overflow: hidden`, so it can
   never reach the scores strip; at z-index 0, so it passes UNDER the two
   message halves (z-index 1) and the badge (50) rather than over them. */
.sb-cs-sheen { display: none; }
.sb[data-layout="centre_stage"] .sb-cs-sheen {
  display: block;
  position: absolute; top: 0; bottom: 0; left: 0; width: 45%; z-index: 0;
  background: linear-gradient(100deg, transparent, rgba(var(--text-rgb), .08) 42%, rgba(var(--text-rgb), .08) 58%, transparent);
  opacity: 0;
  pointer-events: none;
}
/* The pulse's ring: the badge's own circle, behind it (z-index 48, under the
   crest at 50 and the fallback initial at 49), with a STATIC shadow. Only its
   opacity ever moves. */
.sb-cs-glow { display: none; }
.sb[data-layout="spotlight_duo"] .sb-cs-glow,
.sb[data-layout="spotlight"] .sb-cs-glow,
.sb[data-layout="centre_stage"] .sb-cs-glow {
  display: block;
  position: absolute;
  top: 0; left: 50%;
  width: var(--cs-badge, 126px); height: var(--cs-badge, 126px);
  margin-left: calc(var(--cs-badge, 126px) / -2);
  border-radius: 50%;
  box-shadow: 0 0 28px var(--accent);
  opacity: 0;
  z-index: 48;
  pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
  .sb[data-layout="centre_stage"] .sb-cs-sheen.is-sheen {
    animation: sbCsSheen 2s ease-in-out 1;
    will-change: transform, opacity;
  }
  .sb[data-layout="centre_stage"].is-pulse .sb-logo,
  .sb[data-layout="centre_stage"].is-pulse .sb-cs-initial,
  .sb[data-layout="spotlight_duo"].is-pulse .sb-logo,
  .sb[data-layout="spotlight_duo"].is-pulse .sb-cs-initial,
  .sb[data-layout="spotlight"].is-pulse .sb-logo,
  .sb[data-layout="spotlight"].is-pulse .sb-cs-initial {
    animation: sbCsPulse 600ms cubic-bezier(.22, 1, .36, 1) 1;
    transform-origin: 50% 50%;
    will-change: transform;
  }
  .sb[data-layout="spotlight_duo"].is-pulse .sb-cs-glow,
  .sb[data-layout="spotlight"].is-pulse .sb-cs-glow,
  .sb[data-layout="centre_stage"].is-pulse .sb-cs-glow {
    animation: sbCsGlow 600ms ease-out 1;
    will-change: opacity;
  }
  .sb[data-layout="centre_stage"] .sb-cs-half .sb-slot-t.is-swap {
    animation: sbCsSwap 250ms cubic-bezier(.22, 1, .36, 1) 1;
  }
  /* -100% is clear of the left edge, 240% is clear of the right: the band
     crosses the whole strip and fades at both ends. */
  @keyframes sbCsSheen {
    0% { opacity: 0; transform: translateX(-100%); }
    15% { opacity: 1; }
    85% { opacity: 1; }
    100% { opacity: 0; transform: translateX(240%); }
  }
  @keyframes sbCsPulse {
    0% { transform: scale(1); }
    45% { transform: scale(1.06); }
    100% { transform: scale(1); }
  }
  @keyframes sbCsGlow {
    0% { opacity: 0; }
    40% { opacity: .6; }
    100% { opacity: 0; }
  }
  @keyframes sbCsSwap {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
  }
}

/* ======================================================================
   SPOTLIGHT (Pro, beta) — the same crest badge, RAISED, over ONE
   full-width message line.

   Centre Stage puts the badge's CENTRE on the bar's top edge and a
   message either side of it. Spotlight lifts the badge nearly clear
   instead — three quarters of it above the bar, the last quarter
   overlapping into it — and gives the whole width to ONE line under the
   brand name. Strips two and three are Broadcast Scores' own, as Centre
   Stage's are, and the line itself is the banner's OWN rotor (its two
   slots and its marquee window), exactly as Broadcast Scores' strip one.

     95 badge overhang + 90 messages + 110 scores + 42 extras = 337.

   The badge, its fallback initial, its pulse ring and the brand name are
   the SAME rules Centre Stage draws (above); only --cs-overhang differs,
   and the module writes it. What is below is what is new: the stage, the
   two bands inside the 90px message strip, and the line.

     0  ->  95   the badge, above the bar
     95 -> 126   its last quarter, overlapping the strip
     31 ->  49   the brand name's band (the badge less the overhang, 18px)
     49 ->  90   the message line, 22px gutters, centred

   data-logo and --logo-scale are ignored here for the same reason they
   are there: the badge is centred by definition and its size is the
   bar's, not the creator's.
   ====================================================================== */
.sb[data-layout="spotlight"] { height: 337px; }
.sb[data-layout="spotlight"] .sb-bar { top: var(--cs-overhang, 95px); height: 200px; }   /* 90 + 110 */
.sb[data-layout="spotlight"] .sb-extras { top: 295px; }                                  /* 95 + 200 */
/* The name's band: Centre Stage's own rules, moved under the OVERLAP — it
   starts where the badge ends (126 - 95 = 31) and holds 18px of the strip. */
.sb[data-layout="spotlight_duo"] .sb-brand,
.sb[data-layout="spotlight"] .sb-brand {
  top: calc(var(--cs-badge, 126px) - var(--cs-overhang, 95px));
  height: 18px;
  line-height: 18px;
}
/* The message line, under the name: the full width less a plain 22px either
   side. There is no logo gutter to clear (the badge is above the bar, not
   beside the message) and no brand tab to stop short of, so --gut-l / --gut-r
   are not read here at all. Centred, because the badge over it is. */
/* SPOTLIGHT DUO draws the same line, so it takes these three rules too —
   the two that place the line scoped to `.sb-banner >`, because its BOTTOM
   strip has a band of its own and must not be pushed down 49px into it. */
.sb[data-layout="spotlight_duo"] .sb-banner > .sb-slot,
.sb[data-layout="spotlight"] .sb-slot { top: 49px; padding: 0 calc(22px + var(--safe-x)); justify-content: center; }
/* SAFE centring (see Centre Stage's halves): this line GLIDES when it is
   wider than its window, and it has to glide from the window's left edge. */
.sb[data-layout="spotlight_duo"] .sb-slot-win,
.sb[data-layout="spotlight"] .sb-slot-win { justify-content: center; justify-content: safe center; }
.sb[data-layout="spotlight_duo"] .sb-banner > .sb-mq,
.sb[data-layout="spotlight"] .sb-mq { top: 49px; left: calc(22px + var(--safe-x)); right: calc(22px + var(--safe-x)); }
/* ONE SIZE, as on Centre Stage's halves — BANNER_SIZES.spotlight is this one
   number: the line has 41px of the strip and nothing to be grown into. */
.sb[data-layout="spotlight_duo"] .sb-slot-t,
.sb[data-layout="spotlight_duo"] .sb-mq-item,
.sb[data-layout="spotlight"] .sb-slot-t,
.sb[data-layout="spotlight"] .sb-mq-item { font-size: 30px; }
/* THE LINE NEVER ELLIPSES either — the same rule Centre Stage's halves get,
   for the same reason and with a different answer under it: there is no second
   half here to spill into, so a message wider than the window GLIDES inside its
   slot instead (the rotor's fit(), the transform-only per-slot scroll). `clip`
   is the backstop under that glide, never the treatment. */
.sb[data-layout="spotlight_duo"] .sb-slot-t,
.sb[data-layout="spotlight"] .sb-slot-t { text-overflow: clip; }

/* ---- row 2: ticker (110px) — the SCORES row, gated off for the MVP ----
   Kept whole, and unchanged, so switching `showTicker` back on restores the
   reference layout: 110px row, 64px LIVE rail, 916px marquee window. ---- */
.sb-ticker {
  position: relative;
  height: 110px;
  display: flex;
  background: var(--secondary);
}
.sb-rail {
  /* 60px of rail + a 4px gold border beside it = 64px, leaving the 916px
     marquee window the reference measures. (border-box, so 64 total.) */
  flex: 0 0 64px; width: 64px;
  background: var(--primary);
  border-right: 4px solid var(--accent);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 6px;
}
.sb-rail-live {
  font-size: 13px; font-weight: 700;
  letter-spacing: .22em; text-indent: .22em;   /* indent cancels the trailing space */
  line-height: 1; white-space: nowrap;
  color: var(--accent);
}
.sb-pip {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
  animation: sbPip 1.4s ease-in-out infinite;
}
.sb-rail-plat {
  font-size: 9px; font-weight: 700;
  letter-spacing: .05em; text-indent: .05em;
  line-height: 1; white-space: nowrap;
  color: rgba(var(--text-rgb), .55);
}
.sb-rail-plat[hidden] { display: none; }
/* Off air: dimmed, no pulse. */
.sb.is-off .sb-rail-live { font-size: 10px; letter-spacing: .04em; text-indent: .04em; color: rgba(var(--text-rgb), .45); }
.sb.is-off .sb-pip { animation: none; background: rgba(var(--text-rgb), .22); box-shadow: none; }

/* Marquee window = 980 − 60 rail − 4 border = 916px. */
.sb-window {
  position: relative;
  flex: 1; min-width: 0;
  overflow: hidden;
  display: flex; align-items: center;
}
.sb-window::after {
  content: '';
  position: absolute; top: 0; right: 0; bottom: 0; width: 32px; z-index: 2;
  background: linear-gradient(to left, var(--secondary), transparent);
  pointer-events: none;
}
/* Translated by rAF (exact px/s), never by a CSS animation. */
.sb-track { display: flex; align-items: center; width: max-content; will-change: transform; }
.sb-block { display: flex; align-items: center; }
.sb-item {
  font-size: 26px; font-weight: 700;
  letter-spacing: .02em; line-height: 1.1;
  color: var(--text);
  white-space: nowrap;
}
.sb-sep { font-size: 18px; line-height: 1; color: rgba(var(--text-rgb), .55); padding: 0 17px; }
/* (No static-content rule: an empty message list renders nothing at all, in
   every motion and on this row too — there is no tenant-name fallback.) */

@keyframes sbPip { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

/* ======================================================================
   THE DUO LAYOUTS (Pro)  —  spotlight_duo  ·  broadcast_duo
   ----------------------------------------------------------------------
   Two top bars the overlay already draws, with a SECOND MESSAGES STRIP
   under them instead of the scores and the extras. Neither STACKS: there
   is no `.sb-scores` and no `.sb-extras` node on either of them, and the
   module never attaches one (they are not in STRIP_LAYOUTS).

     spotlight_duo   Spotlight's top bar — the raised badge, the brand
                     band, the one full-width measured line — over the
                     strip.   95 overhang + 90 messages + 70 bottom = 255
     broadcast_duo   Broadcast Scores' banner — the overhanging logo, the
                     brand tab, the messages — over the same strip.
                     100 overhang + 90 messages + 70 bottom = 260

   Everything the two TOP bars draw is their parent layout's own rule with
   the new selector added to it (search `spotlight_duo` and
   `broadcast_duo` above): not one number is restated. The rules that
   PLACE the top line are scoped `.sb-banner >` there, because the bottom
   strip runs the same `.sb-slot` / `.sb-mq` nodes and must keep its own
   band and its own gutters.

   The ACCENT RULE between the two lines costs nothing: it is the banner's
   own `.sb-rule-bot`, which sits at the bottom of the 90px strip — the
   very line that divides Broadcast Scores' messages from its scores.
   ====================================================================== */
.sb[data-layout="spotlight_duo"] { height: 255px; }
.sb[data-layout="spotlight_duo"] .sb-bar { top: var(--cs-overhang, 95px); height: 160px; }   /* 90 + 70 */
.sb[data-layout="broadcast_duo"] { height: 260px; }
.sb[data-layout="broadcast_duo"] .sb-bar { height: 160px; }                                  /* 90 + 70 */

/* ---- the bottom messages strip (70px) ----
   INSIDE the bar, exactly where `.sb-scores` goes, so it shares the bar's
   4px radius and its clip. It is the creator's copy, not ours, so unlike
   the scores strip it inherits `text-transform` from `.sb` — the Text case
   setting reaches this line as it reaches the one above it.
   Its paint is the SCORES colour roles (031): the strip under the bar is
   the strip under the bar, whichever layout draws it, so a palette that
   darkens Broadcast Scores' strip darkens this one by the same role. Both
   stops are --secondary with nothing set, which is the flat fill the bar
   would have drawn anyway. */
.sb-bottom {
  position: relative;
  height: 70px;
  --sb-bt-bg: var(--r-scores-bg, var(--secondary));
  --sb-bt-bg-end: var(--r-scores-bg-end, var(--sb-bt-bg));
  background: linear-gradient(to bottom, var(--sb-bt-bg), var(--sb-bt-bg-end));
  color: var(--r-scores-text, var(--text));
  overflow: hidden;
}
/* The line: ONE fixed size, centred, the full width less a plain 22px either
   side — there is no logo gutter to clear (the logo overhangs the banner, not
   this strip) and no brand tab to stop short of, so --gut-l / --gut-r are not
   read here at all. The rotor's nodes and their motion are the banner's own,
   node for node: Fade, Vertical and Scroll all work by the very same CSS. */
.sb-bottom .sb-slot { padding: 0 calc(22px + var(--safe-x)); justify-content: center; }
/* SAFE centring again: the strip's line glides from its left edge. */
.sb-bottom .sb-slot-win { justify-content: center; justify-content: safe center; }
.sb-bottom .sb-mq { left: calc(22px + var(--safe-x)); right: calc(22px + var(--safe-x)); }
.sb-bottom .sb-slot-t,
.sb-bottom .sb-mq-item { font-size: 30px; color: var(--r-scores-text, var(--text)); }
/* THIS LINE NEVER ELLIPSES either — the same rule Spotlight's line gets, for
   the same reason: a message wider than the strip GLIDES inside its slot
   (the rotor's fit(), the transform-only per-slot scroll). `clip` is the
   backstop under that glide, never the treatment. */
.sb-bottom .sb-slot-t { text-overflow: clip; }
/* Its marquee's soft right edge fades into the STRIP's colour, not the bar's. */
.sb-bottom .sb-mq::after { background: linear-gradient(to left, var(--sb-bt-bg), transparent); }
/* A flash aimed at this line (`target: 'bottom'`) dims THIS marquee and brings
   THIS strip's slots back in Scroll motion — the banner above carries on. Its
   own attribute, on the strip, for exactly that reason. */
.sb-bottom[data-flash="on"] .sb-mq { opacity: 0; transition: opacity var(--fade) ease; }
.sb[data-motion="horizontal"] .sb-bottom[data-flash="on"] .sb-slot { display: flex; }


/* A sponsored bar's paced "Powered by" message (`is-accent` on its slot or
   marquee item) is drawn EXACTLY as the other messages are — the message
   colour of the theme, or whatever the layout gives its type (Neon's accent) —
   and so is the partner line on the end of it. It used to take the accent
   colour, which on a Manual palette is whatever the creator picked for the
   rule: a dark blue over a light bar, on Kay's own stream. No colour, no glow:
   the class is kept for the module and the tests, and adds nothing here. The
   mark in its emoji slot is the same CSS mark the free message uses. */

/* ======================================================================
   CREST (Starter)  —  a centred mark, a message spot either side of it
   ----------------------------------------------------------------------
   Not a banner. A dark strip inside a thin outline box, the creator's mark
   centred ON that strip at 2.3 x its height so it overhangs above and
   below, a stepped TRIM along each of the strip's long edges, and a MESSAGE
   SPOT either side of the mark — the left one left-aligned, the right one
   right-aligned. The bar's own message list rotates through the two spots
   in PAIRS (crestPairs in overlay.js), on the same dwell and the same
   cross-fade every other layout uses; two or fewer messages make one step
   and the bar stands perfectly still, and a spot the list never reaches
   draws the standing line saved for it (config.crest.left / right).

   THE GEOMETRY IS FIXED. `data-logo` and `--logo-scale` are ignored here:
   the mark is centred by definition and its size is the strip's, not the
   creator's. Everything is arithmetic off two numbers —

     160 stage = 4 air + 152 mark + 4 air, the mark centred on the stage
      66 strip, centred on the same middle, so its top is (160 - 66) / 2 = 47
     370 spot  = 980/2 - 152/2 (half the mark) - 18 (air beside it)
                       - 26 (air inside the strip's edge), at --safe-x: 0

   — and every one of them is a variable below, because server.js holds the
   same arithmetic (CREST_GEOMETRY) for the panel's type sizing and the
   per-font spot limits. THE PAINT IS FULL WIDTH and the SPOTS are not: a
   phone's crop comes off a spot's outer edge alone (var(--safe-x)), while
   the strip, the outline and both trims still cover the whole 980.

   THE SPLIT, and it is strict: everything in this block is GEOMETRY —
   where the mark, the spots, the strip, the outline and the trims sit and
   how big they are. Everything in the [data-skin] block after it is LOOKS —
   colours, the shape the trims are clipped to, the corner cut. A skin may
   never move a word; a new skin adds its own block and changes nothing
   here, so `default` draws exactly what it drew before it had company.
   ====================================================================== */
.sb[data-layout="crest"] {
  --crest-stage-h: 160px;
  --crest-strip-h: 66px;          /* the outlined strip, its border included */
  --crest-strip-top: 47px;        /* (160 - 66) / 2: centred on the stage */
  --crest-logo-h: 152px;          /* the mark: 2.3 x the strip */
  --crest-trim-h: 16px;           /* the stepped trim above and below it */
  --crest-zone: 188px;            /* the mark plus its clear air: 152 + 2 x 18 */
  --crest-inset: 26px;            /* a spot's air inside the strip's own edge */
  --crest-outline-w: 2px;
  --crest-text: 28px;             /* the FALLBACK size — what a spot draws at when no per-font size was sent */
  --crest-scale: 1;               /* the TEXT SIZE step: what that size is multiplied by (the steps are below, on [data-crest-text]) */
  height: var(--crest-stage-h);
}
/* The strip: the bar's own box, thinner, squared off and wearing an outline.
   Its FILL is the bar's own paint (--sb-banner-paint, so the theme, the colour
   roles and the Fill setting all reach it unchanged); the outline's COLOUR and
   the corner cut are the skin's. */
.sb[data-layout="crest"] .sb-bar {
  top: var(--crest-strip-top);
  height: var(--crest-strip-h);
  border-radius: 0;
  border-style: solid;
  border-width: var(--crest-outline-w);
  box-sizing: border-box;
}
.sb[data-layout="crest"] .sb-banner { height: 100%; }
/* The mark, centred and vertically CENTRED ON THE STRIP, which is what makes it
   overhang both edges. `left: 50%` with half its own width pulled back, as the
   two badge layouts centre theirs — and `transform: none`, because the creator's
   logo size does not apply to a fixed geometry.

   The DRESS — the round badge the mark wears — is five hooks read here and set
   one rule down. They all fall back to nothing, so a skin that wants the bare
   mark simply never sets them and this box is the plain 152px square it always
   was. `box-sizing: border-box` is what keeps the ring INSIDE --crest-logo-h:
   dressed or bare, the mark's box is the same box, in the same place. */
.sb[data-layout="crest"] .sb-logo,
.sb[data-logo="right"][data-layout="crest"] .sb-logo {
  top: calc(var(--crest-stage-h) / 2 - var(--crest-logo-h) / 2);
  left: 50%; right: auto;
  width: var(--crest-logo-h); height: var(--crest-logo-h);
  margin-left: calc(var(--crest-logo-h) / -2);
  box-sizing: border-box;
  border: var(--crest-badge-ring-w, 0px) solid var(--crest-badge-ring, transparent);
  border-radius: var(--crest-badge-r, 0);
  background: var(--crest-badge-bg, transparent);
  object-fit: var(--crest-badge-fit, contain);
  transform: none;
  transform-origin: center;
  z-index: 50;
}
/* The CIRCLE, and it is the badge layouts' own, to the declaration: the
   --r-badge-* roles with the theme's secondary and accent behind them, the same
   3px ring Spotlight and Centre Stage draw, and their `object-fit: cover` — so
   the mark FILLS the circle right up to the ring, with no band of bar colour
   between the two, and is clipped to it exactly as a raised badge's is. No air
   of any kind: a Crest mark is dressed the way Spotlight dresses one, and there
   is only one answer in this product to "a logo in a ring". */
.sb[data-layout="crest"] {
  --crest-badge-ring-w: 3px;
  --crest-badge-r: 50%;
  --crest-badge-bg: var(--r-badge-bg, var(--secondary));
  --crest-badge-ring: var(--r-badge-ring, var(--accent));
  --crest-badge-fit: cover;
}
/* …and the skin that wants the mark BARE dresses it in nothing: every hook back
   to the zero it already falls back to, so that mark is the plain square it
   always was — no ring, no fill, fitted whole rather than cropped — and the
   letter below has no circle to sit on. No place and no size moves either way:
   only what is drawn in them. */
.sb[data-layout="crest"][data-skin="skcards"] {
  --crest-badge-ring-w: 0px;
  --crest-badge-r: 0;
  --crest-badge-bg: transparent;
  --crest-badge-ring: transparent;
  --crest-badge-fit: contain;
}
/* No logo: the brand's first letter on that same circle, the same node the
   badge layouts use and the same one character of textContent. It reads the
   very same hooks (all but the crop, which a letter has no use for), so a skin
   that dresses nothing shows nothing — and the skin that keeps the bare mark
   takes the node off the picture outright. */
.sb[data-layout="crest"] .sb-cs-initial {
  display: flex; align-items: center; justify-content: center;
  position: absolute;
  top: calc(var(--crest-stage-h) / 2 - var(--crest-logo-h) / 2);
  left: 50%;
  width: var(--crest-logo-h); height: var(--crest-logo-h);
  margin-left: calc(var(--crest-logo-h) / -2);
  box-sizing: border-box;
  border-radius: var(--crest-badge-r, 0);
  background: var(--crest-badge-bg, transparent);
  border: var(--crest-badge-ring-w, 0px) solid var(--crest-badge-ring, transparent);
  font-size: 76px; font-weight: 700; line-height: 1;
  color: var(--r-bar-text, var(--text));
  z-index: 49;
  pointer-events: none;
}
.sb[data-layout="crest"][data-skin="skcards"] .sb-cs-initial,
.sb[data-layout="crest"] .sb-cs-initial[hidden] { display: none; }
/* The banner's own furniture has nothing to do on this layout: the two rules,
   the brand name, and the rotor the banner hosts (the spots run their own). */
.sb[data-layout="crest"] .sb-rule-top,
.sb[data-layout="crest"] .sb-rule-bot,
.sb[data-layout="crest"] .sb-brand,
.sb[data-layout="crest"] .sb-banner > .sb-slot,
.sb[data-layout="crest"] .sb-banner > .sb-mq { display: none; }
/* ---- the two spots ----
   Children of the STAGE, not the strip, so their `50%` is the canvas's own
   middle and the strip's outline and clip never cut a word. Each runs from its
   outer inset (plus the phone's crop) to the edge of the mark's zone, and each
   holds a ROTOR of its own: two stacked slots that cross-fade the message list
   through in PAIRS (crestPairs in overlay.js), left and right changing together
   on one dwell. The left one is left-aligned and the right one right-aligned,
   which is the whole of the difference between them. */
.sb-crest-spot { display: none; }
.sb[data-layout="crest"] .sb-crest-spot {
  display: flex; align-items: center;
  position: absolute;
  top: var(--crest-strip-top);
  height: var(--crest-strip-h);
  overflow: hidden;
  z-index: 45;
}
.sb[data-layout="crest"] .sb-crest-spot.is-l { left: calc(var(--crest-inset) + var(--safe-x)); right: calc(50% + var(--crest-zone) / 2); justify-content: flex-start; }
.sb[data-layout="crest"] .sb-crest-spot.is-r { left: calc(50% + var(--crest-zone) / 2); right: calc(var(--crest-inset) + var(--safe-x)); justify-content: flex-end; }
/* Inside a spot, THE SPOT IS THE WINDOW: it carries the inset itself (that air
   is `--crest-inset`, already spent in the run the save measures against), so
   the slot adds none of its own — a slot's usual 3px/gutter padding would take
   room the measure has already promised the creator. The slots are shown in
   EVERY motion here: Scroll builds no marquee on this layout, because two fixed
   boxes measured to the glyph have nothing to scroll. */
.sb[data-layout="crest"] .sb-crest-spot .sb-slot { padding: 0; }
.sb[data-motion="horizontal"][data-layout="crest"] .sb-crest-spot .sb-slot { display: flex; }
/* Left spot left-aligned, right spot right-aligned — and the right one SAFELY,
   the same keyword the scores pages and Centre Stage's halves use: a line wider
   than its window would otherwise hang its START off the left edge, where the
   clip is. `safe` aligns to the end while it fits and to the start when it does
   not. The plain value first, for an engine that does not know the keyword. */
.sb[data-layout="crest"] .sb-crest-spot .sb-slot-win { justify-content: flex-start; }
.sb[data-layout="crest"] .sb-crest-spot.is-r .sb-slot-win { justify-content: flex-end; justify-content: safe flex-end; }
/* ONE SIZE in both spots, and it is PER FACE — `--crest-fs`, written by the
   module from the config (crestType in server.js, off the real glyph metrics).
   Every face is set so that its CAPITALS are the same height on the strip
   rather than its font-size being the same number, which is what stops a
   narrow face reading as a smaller one; `--crest-shift-y` is the nudge that
   centres those capitals, since a flex box centres the line box and the two
   are not the same middle. Both are GEOMETRY: no skin may touch either, and
   textCase does not move them. Without them (an older server, the panel's own
   draft) `--crest-text` stands.

   A line longer than its spot is CLIPPED here and nothing else — it does not
   glide, shrink or ellipse — because the check that makes it impossible is the
   server's: a line whose glyph advances overrun the spot's own run is refused
   on save (crestFits — the two standing lines and every message a Crest bar
   rotates alike), and one stored before the face or the crop moved is dropped
   from the rotation rather than drawn cut. So overflow is the backstop under
   that refusal and never a treatment the creator is meant to see. The tracking
   below is part of that arithmetic (CREST_TRACKING): change it here and the
   measure moves with it.

   ---- THE TEXT SIZE ----
   Three STEPS off that per-face size, and they are one multiplier: LARGE is the
   size the face was given (1, what Crest has always drawn), and the two smaller
   steps take it down. One attribute, three factors, and the same factor moves
   the NUDGE with the type — shiftY is a share of the size, so scaling both
   keeps the capitals on the strip's middle line at every step.

   THE FACTORS ARE THE MEASURE'S. CREST_TEXT_SCALE in panel/crest.js holds the
   same three numbers, and the save, the panel's live word and the sieve
   buildConfig runs all multiply by them — so a line that fits at Small really
   is a line that draws at Small. A test pins these three against that map. */
.sb[data-layout="crest"][data-crest-text="medium"] { --crest-scale: .85; }
.sb[data-layout="crest"][data-crest-text="small"] { --crest-scale: .7; }
.sb[data-layout="crest"] .sb-crest-t {
  font-size: calc(var(--crest-fs, var(--crest-text)) * var(--crest-scale, 1));
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1.1;
  color: var(--r-bar-text, var(--text));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  transform: translateY(calc(var(--crest-shift-y, 0px) * var(--crest-scale, 1)));
}
/* ---- the trims ----
   Full-width bands hugging the strip's two long edges. They carry no text and
   no size of their own beyond their height: what makes them a SHAPE — the step
   in toward the mark, the slant at each end, the gap the mark sits in — is the
   skin's clip-path. */
.sb-crest-trim { display: none; }
.sb[data-layout="crest"] .sb-crest-trim {
  display: block;
  position: absolute;
  left: 0; right: 0;
  height: var(--crest-trim-h);
  pointer-events: none;
  z-index: 1;
}
.sb[data-layout="crest"] .sb-crest-trim.is-top { top: calc(var(--crest-strip-top) - var(--crest-trim-h)); }
.sb[data-layout="crest"] .sb-crest-trim.is-bot { top: calc(var(--crest-strip-top) + var(--crest-strip-h)); }

/* ---- CREST skins: paint and cut paths only; content stays on --safe-x. ---- */
.sb[data-layout="crest"][data-skin="default"] .sb-bar {
  border-color: transparent;
  --crest-edge: rgba(var(--r-bar-text-rgb, var(--text-rgb)), .92);
  background: var(--crest-edge);
  clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
}
.sb[data-layout="crest"][data-skin="default"] .sb-banner {
  clip-path: polygon(12.828px 0, 100% 0, 100% calc(100% - 12.828px), calc(100% - 12.828px) 100%, 0 100%, 0 12.828px);
  box-shadow: inset 0 12px 16px -12px #ffffff26, inset 0 -12px 16px -12px #00000050;
}
.sb[data-layout="crest"][data-skin="default"] .sb-crest-trim {
  background: linear-gradient(180deg, #ffffff26, transparent 30%, #00000030),
    linear-gradient(110deg, var(--secondary) 0 30%, var(--r-bar-accent, var(--accent)) 30% 70%, var(--secondary) 70%);
}
.sb[data-layout="crest"][data-skin="default"] .sb-crest-trim.is-top {
  clip-path: polygon(0 11px, 28% 11px, calc(28% + 8px) 6px, 36% 6px, calc(36% + 8px) 0,
    calc(50% - var(--crest-logo-h) / 2) 0, calc(50% - var(--crest-logo-h) / 2) 100%,
    calc(50% + var(--crest-logo-h) / 2) 100%, calc(50% + var(--crest-logo-h) / 2) 0,
    calc(64% - 8px) 0, 64% 6px, calc(72% - 8px) 6px, 72% 11px, 100% 11px, 100% 100%, 0 100%);
}
.sb[data-layout="crest"][data-skin="default"] .sb-crest-trim.is-bot {
  clip-path: polygon(0 5px, 28% 5px, calc(28% + 8px) 10px, 36% 10px, calc(36% + 8px) 100%,
    calc(50% - var(--crest-logo-h) / 2) 100%, calc(50% - var(--crest-logo-h) / 2) 0,
    calc(50% + var(--crest-logo-h) / 2) 0, calc(50% + var(--crest-logo-h) / 2) 100%,
    calc(64% - 8px) 100%, 64% 10px, calc(72% - 8px) 10px, 72% 5px, 100% 5px, 100% 0, 0 0);
}
.sb[data-layout="crest"][data-skin="skcards"] .sb-bar {
  border-color: #fff;
  background: linear-gradient(#101112, #242526);
  box-shadow: inset 0 1px 2px #ffffff66, inset 0 -1px 2px #00000080;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}
.sb[data-layout="crest"][data-skin="skcards"] .sb-banner { background: transparent; }
.sb[data-layout="crest"][data-skin="skcards"] .sb-crest-trim {
  background: linear-gradient(180deg, #ffffff55, transparent 25%, #00000055),
    linear-gradient(115deg, #fff 0 7%, #701b32 7.15% 29%, #8fc4e8 29.15% 36%,
      #701b32 36.15% 64%, #8fc4e8 64.15% 71%, #701b32 71.15% 93%, #fff 93.15%);
}
.sb[data-layout="crest"][data-skin="skcards"] .sb-crest-trim.is-top {
  clip-path: polygon(0 10px, 11% 10px, calc(11% + 6px) 3px, 26% 3px, calc(26% - 5px) 9px,
    37% 9px, calc(37% + 12px) 0, calc(50% - var(--crest-logo-h) / 2) 0,
    calc(50% - var(--crest-logo-h) / 2) 100%, calc(50% + var(--crest-logo-h) / 2) 100%,
    calc(50% + var(--crest-logo-h) / 2) 0, calc(63% - 12px) 0, 63% 9px,
    calc(74% + 5px) 9px, 74% 3px, calc(89% - 6px) 3px, 89% 10px, 100% 10px, 100% 100%, 0 100%);
}
.sb[data-layout="crest"][data-skin="skcards"] .sb-crest-trim.is-bot {
  clip-path: polygon(0 6px, 7% 6px, calc(7% + 6px) 100%, 26% 100%, calc(26% - 5px) 10px,
    39% 10px, calc(39% + 10px) 100%, calc(50% - var(--crest-logo-h) / 2) 100%,
    calc(50% - var(--crest-logo-h) / 2) 0, calc(50% + var(--crest-logo-h) / 2) 0,
    calc(50% + var(--crest-logo-h) / 2) 100%, calc(61% - 10px) 100%, 61% 10px,
    calc(74% + 5px) 10px, 74% 100%, calc(93% - 6px) 100%, 93% 6px, 100% 6px, 100% 0, 0 0);
}

/* CREST motion desk: periods, entrance/swap times, travel and light strength. */
.sb[data-layout="crest"] {
  /* Two independently timed, oppositely travelling bands per trim. One tile
     per band makes the wrap exact; counts also control sparkle density. */
  --crest-band-count: 1;
  --crest-band-a-speed: 7.3s;
  --crest-band-b-speed: 11.9s;
  --crest-band-a-phase: -2.1s;
  --crest-band-b-phase: -8.4s;
  --crest-bottom-phase: -4.7s;
  --crest-band-strength: .72;
  --crest-spark-count: 7;
  --crest-spark-speed: 2.7s;
  --crest-edge-spark-speed: 3.9s;
  --crest-spark-phase: -1.6s;
  --crest-spark-strength: .85;
  --crest-orbit-speed: 17.3s;
  --crest-orbit-strength: .62;
  --crest-outline-shade: .32;
  --crest-sheen-speed: 23.1s;
  --crest-sheen-strength: .035;
  --crest-shine-speed: 8s;
  --crest-shine-strength: .8;
  --crest-breathe-speed: 6s;
  --crest-enter-speed: .85s;
  --crest-text-speed: .25s;
  --crest-swap-speed: 180ms;
  --crest-travel: 12px;
  --crest-glow-floor: .06;
  --crest-glow-strength: .38;
  --crest-flash-strength: .9;
  --crest-glow: var(--r-bar-accent, var(--accent));
}
.sb[data-layout="crest"][data-skin="skcards"] { --crest-glow: #8fc4e8; }
@media (prefers-reduced-motion: no-preference) {
  .sb[data-layout="crest"]:not([data-motion="off"]) .sb-crest-trim {
    animation: crestTrimIn var(--crest-enter-speed) cubic-bezier(.16,1,.3,1) both;
  }
  .sb[data-layout="crest"]:not([data-motion="off"]) .sb-crest-trim::before,
  .sb[data-layout="crest"]:not([data-motion="off"]) .sb-crest-trim::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
  }
  .sb[data-layout="crest"]:not([data-motion="off"]) .sb-crest-trim::before {
    background: linear-gradient(110deg, transparent 46%, #fff 49.8%, transparent 53%), var(--crest-glow);
    background-size: calc(100% / var(--crest-band-count)) 100%;
    animation: crestFoilForward var(--crest-band-a-speed) linear var(--crest-band-a-phase) infinite,
      crestBreathe var(--crest-breathe-speed) ease-in-out infinite;
  }
  .sb[data-layout="crest"]:not([data-motion="off"]) .sb-crest-trim::after {
    background: linear-gradient(70deg, transparent 46%, #fff 50%, transparent 54%);
    background-size: calc(100% / var(--crest-band-count)) 100%;
    opacity: var(--crest-band-strength);
    animation: crestFoilBackward var(--crest-band-b-speed) linear var(--crest-band-b-phase) infinite;
  }
  .sb[data-layout="crest"]:not([data-motion="off"]) .sb-crest-trim.is-bot::before {
    animation-direction: reverse, normal;
    animation-delay: var(--crest-bottom-phase), var(--crest-bottom-phase);
  }
  .sb[data-layout="crest"]:not([data-motion="off"]) .sb-crest-trim.is-bot::after {
    animation-direction: reverse;
    animation-delay: var(--crest-bottom-phase);
  }
  /* Stationary points in two offset rows, with a separate clock on the box.
     The stage layer sits under the spots/logo; no light is laid over text. */
  .sb[data-layout="crest"]:not([data-motion="off"])::before {
    content: ""; position: absolute; left: 0; right: 0; z-index: 2; pointer-events: none;
    top: calc(var(--crest-strip-top) - var(--crest-outline-w));
    height: calc(var(--crest-strip-h) + 2 * var(--crest-outline-w));
    background: radial-gradient(circle at 23% 50%, #fff 0 .6px, transparent 2px) left top,
      radial-gradient(circle at 71% 50%, #fff 0 .6px, transparent 2px) left bottom;
    background-size: calc(100% / var(--crest-spark-count)) var(--crest-outline-w);
    background-repeat: repeat-x;
    animation: crestTwinkle var(--crest-spark-speed) ease-in-out var(--crest-spark-phase) infinite;
  }
  /* The skin clip still contains all paint. Let the hollow layers reach the
     border rather than clipping them at the padding box. */
  .sb[data-layout="crest"]:not([data-motion="off"]) .sb-bar { overflow: visible; }
  /* A hollow paint layer follows the existing box, including its skin clip.
     Shading gives the light headroom even on the skcards white outline. */
  .sb[data-layout="crest"]:not([data-motion="off"]) .sb-bar::before,
  .sb[data-layout="crest"]:not([data-motion="off"]) .sb-bar::after {
    content: ""; position: absolute; inset: calc(-1 * var(--crest-outline-w));
    padding: var(--crest-outline-w); z-index: 2; pointer-events: none;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
  }
  .sb[data-layout="crest"]:not([data-motion="off"]) .sb-bar::before {
    background: radial-gradient(ellipse, #fff, transparent 70%) 0 0 / 30% 200% no-repeat,
      rgba(0, 0, 0, var(--crest-outline-shade));
    opacity: var(--crest-orbit-strength);
    animation: crestOutlineOrbit var(--crest-orbit-speed) linear infinite;
  }
  .sb[data-layout="crest"]:not([data-motion="off"]) .sb-bar::after {
    background: radial-gradient(circle at 57% 0%, #fff 0 .6px, transparent 2px),
      radial-gradient(circle at 11% 100%, #fff 0 .6px, transparent 2px);
    background-size: calc(100% / var(--crest-spark-count)) 100%;
    animation: crestTwinkle var(--crest-edge-spark-speed) ease-in-out infinite reverse;
  }
  .sb[data-layout="crest"]:not([data-motion="off"]) .sb-banner::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(110deg, transparent 20%, #fff 50%, transparent 80%);
    background-size: 100% 100%;
    opacity: var(--crest-sheen-strength);
    animation: crestStripSheen var(--crest-sheen-speed) linear infinite;
  }
  .sb[data-layout="crest"]:not([data-motion="off"]) .sb-crest-spot {
    animation: crestTextIn var(--crest-text-speed) ease-out var(--crest-enter-speed) both;
  }
  .sb[data-layout="crest"]:not([data-motion="off"]) .sb-crest-spot .sb-slot {
    transform: translateX(var(--crest-travel));
    transition: transform var(--crest-swap-speed) cubic-bezier(.16,1,.3,1), opacity var(--crest-swap-speed) ease-out;
  }
  .sb[data-layout="crest"]:not([data-motion="off"]) .sb-crest-spot .sb-slot.is-in { transform: none; }
  .sb[data-layout="crest"]:not([data-motion="off"]) .sb-crest-spot .sb-slot.is-out { transform: translateX(calc(-1 * var(--crest-travel))); }
  .sb[data-layout="crest"]:not([data-motion="off"]) .sb-crest-spot .sb-slot.is-in::after {
    content: ""; position: absolute; left: 0; right: 0; top: 0;
    height: var(--crest-outline-w); background: #fff; pointer-events: none;
    animation: crestEdgeFlash var(--crest-swap-speed) ease-out both;
  }
}
/* The mask uses the loaded logo's alpha; failed/CORS-blocked masks paint nothing. */
@media (prefers-reduced-motion: no-preference) {
  .sb[data-layout="crest"]:not(.no-logo):not([data-motion="off"])::after {
    content: ""; position: absolute; pointer-events: none; z-index: 51;
    width: var(--crest-logo-h); height: var(--crest-logo-h);
    top: calc(var(--crest-stage-h) / 2 - var(--crest-logo-h) / 2);
    left: calc(50% - var(--crest-logo-h) / 2);
    mask: var(--crest-logo-mask, linear-gradient(transparent, transparent)) center / contain no-repeat;
    background: linear-gradient(110deg, transparent 42%, #fff 50%, transparent 58%) 150% 0 / 300% 100% no-repeat;
    animation: crestLogoShine var(--crest-shine-speed) ease-in-out var(--crest-enter-speed) infinite;
  }
  /* …and where the mark is DRESSED, the light sweeps the CIRCLE instead: the
     ring is the shape it travels round, so the alpha mask gives way to the same
     radius the mark is wearing. The skin that keeps the bare mark keeps the
     mask above, and with it the rule that a failed mask paints nothing. */
  .sb[data-layout="crest"]:not([data-skin="skcards"]):not(.no-logo):not([data-motion="off"])::after {
    mask: none;
    border-radius: 50%;
  }
}
@keyframes crestLogoShine {
  0%, 2% { background-position: 150% 0; opacity: 0; }
  4% { opacity: var(--crest-shine-strength); }
  18% { background-position: -50% 0; opacity: var(--crest-shine-strength); }
  19%, 100% { background-position: -50% 0; opacity: 0; }
}
@keyframes crestTrimIn { from { transform: scaleX(0); opacity: 0; } to { transform: scaleX(1); opacity: 1; } }
@keyframes crestTextIn { from { opacity: 0; } to { opacity: 1; } }
/* Pixel distances are derived from the unchanged bar width and tile count.
   Percentage positions on a same-size background would otherwise not move. */
@keyframes crestFoilForward {
  from { background-position: 0 0; }
  to { background-position: calc(980px / var(--crest-band-count)) 0; }
}
@keyframes crestFoilBackward {
  from { background-position: 0 0; }
  to { background-position: calc(-980px / var(--crest-band-count)) 0; }
}
@keyframes crestStripSheen {
  from { background-position: 0 0; }
  to { background-position: calc(-980px + 2 * var(--crest-outline-w)) 0; }
}
@keyframes crestOutlineOrbit {
  0%, 100% { background-position: -21.4286% 100%; }
  46% { background-position: 121.4286% 100%; }
  50% { background-position: 121.4286% 0%; }
  96% { background-position: -21.4286% 0%; }
}
@keyframes crestTwinkle {
  0%, 14%, 100% { opacity: 0; }
  35%, 62% { opacity: var(--crest-spark-strength); }
  82% { opacity: 0; }
}
@keyframes crestBreathe { 0%, 100% { opacity: var(--crest-glow-floor); } 50% { opacity: var(--crest-glow-strength); } }
@keyframes crestEdgeFlash { from { opacity: var(--crest-flash-strength); } to { opacity: 0; } }
.sb[data-layout="crest"][data-motion="off"] .sb-crest-spot .sb-slot { transition: none; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .sb[data-layout="crest"] .sb-crest-spot .sb-slot { transition: none; transform: none; }
}

/* ======================================================================
   BAR BLING — the gloss sweep (5 Oct 2026). Kept here, ahead of the brand-off
   block, which holds nothing that moves; the other effects are at the end.
   ====================================================================== */
/* Gloss sweep: a band of light crosses the bar once every 8 s — transform
   only, over the fills and under the words. The band is the old Strong one,
   scaled by the one Strength (--fx-k, 0–.4) as its opacity. Never under
   reduced motion, and never with the overlay's motion off. */
@media (prefers-reduced-motion: no-preference) {
  .sb[data-fx-gloss]:not([data-motion="off"]) .sb-bar::before {
    content: '';
    position: absolute; top: 0; bottom: 0; left: -240px; width: 200px; z-index: 1;
    background: linear-gradient(105deg, rgba(255, 255, 255, 0) 20%, rgba(255, 255, 255, .3) 50%, rgba(255, 255, 255, 0) 80%);
    opacity: var(--fx-k, .18);
    animation: sbFxGloss 8s linear infinite;
    will-change: transform;
    pointer-events: none;
  }
}
@keyframes sbFxGloss {
  0% { transform: translateX(0); }
  22%, 100% { transform: translateX(1460px); }
}

/* ======================================================================
   BAR BLING 6 (5 Oct 2026) — TEXTURE MOTION, three kinds (BAR BLING 8), set
   per tile in overlay.js's TEX_MOTION, the one preset table. Every kind moves
   THE TEXTURE ITSELF — nothing is laid over it:
     smoke — two planes on opposite diagonals, each eased through three sway
             points to a net travel of whole tiles (1024 × 256), so the loop
             point is pixel-identical.
     float — ONE layer on a slow curved closed path, a tilt of at most ±2°
             and a zoom of 1.00–1.06, grown past the banner (texReach) so no
             edge ever shows.
     roll  — ONE layer up and down with a slight sideways sway, on a closed
             path, so the reflection bands roll like light over metal.
   overlay.js writes data-tex-mo, --tm-k (Speed: ONE multiplier on every
   duration and delay) and --tm-w1/--tm-w2 (smoke's plane weights) or --tm-a
   (float and roll: Amount, multiplied into every waypoint's transform) ONLY
   while motion is on, and puts ONE node, .sb-tex, first in the banner, one
   .sb-tl child per animated layer (at most two), each carrying its own --x
   --y --w --h --t --d and --k0… (transforms) from the table. Clipped by the
   banner, under the words, the logo and the rules (they never move). The
   keyframes animate transform only; every blend and brightness is static.
   Eased segments, never a linear crawl, and mismatched seconds per layer.
   Never under reduced motion and never with the bar's motion off: then
   .sb-tex is not drawn and the still tile in .sb-banner::before stays
   exactly as it was.
   ====================================================================== */
.sb-tex { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .sb[data-tex][data-tex-mo]:not([data-motion="off"]) .sb-tex {
    display: block;
    position: absolute; inset: 0;
    overflow: hidden; isolation: isolate;
    pointer-events: none;
  }
  /* The moving layers ARE the texture, so the still one steps aside. */
  .sb[data-tex][data-tex-mo]:not([data-motion="off"]) .sb-banner::before { display: none; }
  .sb[data-tex="full"][data-tex-mo]:not([data-motion="off"]) .sb-tex { filter: brightness(var(--tex-lift, 1)); }
  .sb[data-tex][data-tex-mo]:not([data-motion="off"]) .sb-tl {
    position: absolute; left: var(--x, 0); top: var(--y, 0); width: var(--w, 0); height: var(--h, 0);
    background: var(--tex-img) 0 0 / 1024px 256px repeat;
    opacity: var(--tex-a, .18);
    animation-duration: calc(var(--t, 30s) * var(--tm-k, 1));
    animation-delay: calc(var(--d, 0s) * var(--tm-k, 1));
    animation-iteration-count: infinite;
    animation-timing-function: cubic-bezier(.37, 0, .63, 1);
    will-change: transform;
  }
  /* Smoke: the pair ADDED, weights summing to 1 — never less texture. */
  .sb[data-tex][data-tex-mo="smoke"]:not([data-motion="off"]) .sb-tl {
    mix-blend-mode: plus-lighter;
    opacity: calc(var(--tex-a, .18) * var(--tm-w1, .6));
    animation-name: sbTexSmoke;
  }
  .sb[data-tex][data-tex-mo="smoke"]:not([data-motion="off"]) .sb-tl + .sb-tl { opacity: calc(var(--tex-a, .18) * var(--tm-w2, .4)); }
  .sb[data-tex][data-tex-mo="float"]:not([data-motion="off"]) .sb-tl { animation-name: sbTexFloat; }
  .sb[data-tex][data-tex-mo="roll"]:not([data-motion="off"]) .sb-tl { animation-name: sbTexRoll; }
  /* STORM (Lightning alone; overlay.js writes data-tex-storm with its smoke).
     The still tile STAYS under the planes as the cloud base: a static double
     brightness caps every channel near 12/255, so the bolts flatten into the
     storm while the near-black clouds keep their shape. The two smoke planes
     over it keep their transforms and ALSO flicker in bursts on one fixed
     9.7 s cycle (sbTexBolt) — opacity only, each stop a share of the plane's
     own smoke weight (--tl-a), so a peak is exactly the moving texture and
     never brighter. The planes add inside .sb-tex (isolated), never onto the
     base. Still two animated layers; the base never animates. */
  .sb[data-tex][data-tex-mo="smoke"][data-tex-storm]:not([data-motion="off"]) .sb-banner::before { display: block; filter: brightness(21.25) brightness(.047); }
  .sb[data-tex][data-tex-mo="smoke"][data-tex-storm]:not([data-motion="off"]) .sb-tl {
    --tl-a: calc(var(--tex-a, .18) * var(--tm-w1, .6));
    animation-name: sbTexSmoke, sbTexBolt;
    animation-duration: calc(var(--t, 30s) * var(--tm-k, 1)), 9.7s;
    animation-delay: calc(var(--d, 0s) * var(--tm-k, 1)), 0s;
    animation-timing-function: cubic-bezier(.37, 0, .63, 1), linear;
    will-change: transform, opacity;
  }
  .sb[data-tex][data-tex-mo="smoke"][data-tex-storm]:not([data-motion="off"]) .sb-tl + .sb-tl { --tl-a: calc(var(--tex-a, .18) * var(--tm-w2, .4)); }
}
@keyframes sbTexSmoke { 0% { transform: var(--k0); } 25% { transform: var(--k1); } 50% { transform: var(--k2); } 75% { transform: var(--k3); } 100% { transform: var(--k4); } }
@keyframes sbTexFloat { 0%, 100% { transform: var(--k0); } 19% { transform: var(--k1); } 38% { transform: var(--k2); } 59% { transform: var(--k3); } 79% { transform: var(--k4); } }
@keyframes sbTexRoll { 0%, 100% { transform: var(--k0); } 31% { transform: var(--k1); } 62% { transform: var(--k2); } 83% { transform: var(--k3); } }
@keyframes sbTexBolt { 0%, 11%, 32%, 43%, 67%, 77%, 100% { opacity: 0; } 15%, 47%, 81% { opacity: calc(var(--tl-a, 1) * .28); } 18%, 50% { opacity: var(--tl-a, 1); } 19%, 51% { opacity: calc(var(--tl-a, 1) * .58); } 20.5%, 52.5% { opacity: calc(var(--tl-a, 1) * .92); } 25%, 58% { opacity: calc(var(--tl-a, 1) * .3); } 84% { opacity: calc(var(--tl-a, 1) * .85); } 90% { opacity: calc(var(--tl-a, 1) * .28); } }

/* ======================================================================
   SHOW BRAND NAME — OFF  (config.showBrand, overlays.show_brand, 025)
   ----------------------------------------------------------------------
   The creator's display name is on the bar in five of the nine layouts, and
   this switch takes it off. It is ONE attribute on `.sb` — `data-brand`,
   written by apply() — and everything below is CSS: the name goes, and so
   does the element it sits on, and the layout CLOSES THE SPACE UP rather
   than leaving a hole where the name was. The node itself is never removed
   (it keeps its textContent, so a rename still lands under it), and no
   stage height changes: every one of these bands is painted INSIDE a strip
   the layout already has.

   These rules sit at the foot of the file on purpose. Each layout's own
   `.sb-brand` rule is (0,3,0) too, so source order is what decides — and
   nothing above may be edited to make this work.

   What 'off' hides, layout by layout:
     ticker            the brand TAB (its --secondary fill and its clipped
                       edge with it). It was a flex item, so the marquee —
                       flex: 1 — simply takes the row; it is inset by the
                       logo's own 56px on the logo's side, which is the
                       clearance the tab used to hold.
     stacked           the name line AND its ::after rule (a child of the
                       node, so it goes with it). The message's 36px
                       top-offset goes too, so it re-centres in the 100px bar.
     strip             the small prefix. The hairline and the message move up
                       to 6px — the 26px they were pushed down by was the
                       prefix's band.
     broadcast-scores  the brand TAB, as Ticker's. The module writes no
                       --tab-w with the brand off, so the stylesheet's own
                       `var(--tab-w, 0px)` fallback already gives the width
                       back; these two rules say it outright, so the strip is
                       right from the first paint and not only after a measure.
     spotlight         the name in the 18px band under the badge's overlap.
                       THE BADGE STAYS here too, and the one message line
                       moves up into the band the name had (49 -> 31). The
                       stage is still 337: both bands are inside the 90px
                       message strip.
     centre_stage      the name in the 27px band under the badge. THE BADGE
                       STAYS — it is the logo, not the name. The band is
                       inside the 90px message strip (63 → 90), so the stage
                       is still 305: what closes up is the EXCLUSION ZONE,
                       which applyCentreVars drops to the badge's own 174px
                       floor (the name is not measured at all when it is off),
                       widening both message halves to 381px each.
     broadcast · minimal · scorebug · glass · neon · slim
                       nothing — they never render the name.
   ====================================================================== */
.sb[data-brand="off"] .sb-brand { display: none; }

/* ticker: the tab is gone, the marquee has the row — keep it off the logo, and
   off the phone's crop at both ends (there is no tab left to carry it). */
.sb[data-brand="off"][data-layout="ticker"] .sb-mq { margin-left: calc(56px + var(--safe-x)); margin-right: var(--safe-x); }
.sb[data-logo="right"][data-brand="off"][data-layout="ticker"] .sb-mq { margin-left: var(--safe-x); margin-right: calc(56px + var(--safe-x)); }
.sb.no-logo[data-brand="off"][data-layout="ticker"] .sb-mq { margin-left: var(--safe-x); margin-right: var(--safe-x); }

/* stacked: the message drops back to the middle of its 100px bar. */
.sb[data-brand="off"][data-layout="stacked"] .sb-slot { padding-top: 0; }
.sb[data-brand="off"][data-layout="stacked"] .sb-mq { top: 0; }

/* strip: the rule and the message rise by the prefix's own 20px. */
.sb[data-brand="off"][data-layout="strip"] .sb-rule-top { top: 6px; }
.sb[data-brand="off"][data-layout="strip"] .sb-slot { padding-top: 6px; }
.sb[data-brand="off"][data-layout="strip"] .sb-mq { top: 6px; }

/* spotlight: the message line rises into the name's band — 49 -> 31, the
   badge's own overlap. The badge stays and no stage height moves. */
.sb[data-brand="off"][data-layout="spotlight_duo"] .sb-banner > .sb-slot,
.sb[data-brand="off"][data-layout="spotlight"] .sb-slot { top: 31px; }
.sb[data-brand="off"][data-layout="spotlight_duo"] .sb-banner > .sb-mq,
.sb[data-brand="off"][data-layout="spotlight"] .sb-mq { top: 31px; }

/* broadcast-scores: no tab, so no tab inset — plain gutters, both sides. */
.sb[data-brand="off"][data-layout="broadcast_duo"] .sb-banner > .sb-mq,
.sb[data-logo="right"][data-brand="off"][data-layout="broadcast_duo"] .sb-banner > .sb-mq,
.sb[data-brand="off"][data-layout="broadcast-scores"] .sb-mq,
.sb[data-logo="right"][data-brand="off"][data-layout="broadcast-scores"] .sb-mq { left: var(--gut-l); right: var(--gut-r); }
.sb[data-brand="off"][data-layout="broadcast_duo"] .sb-banner > .sb-slot,
.sb[data-logo="right"][data-brand="off"][data-layout="broadcast_duo"] .sb-banner > .sb-slot,
.sb[data-brand="off"][data-layout="broadcast-scores"] .sb-slot,
.sb[data-logo="right"][data-brand="off"][data-layout="broadcast-scores"] .sb-slot { padding-left: var(--gut-l); padding-right: var(--gut-r); }

/* ======================================================================
   COLOUR ROLES — the five declarations gathered rather than written in place
   ----------------------------------------------------------------------
   Almost every role reads inside the declaration it belongs to (search
   `var(--r-`); these five are together because the cascade is the point, and
   each falls back to the very value the rule it overrides declares — so with
   no role set this whole block is a no-op.

   THE MESSAGE TYPE'S COLOUR. Three rules give the type a colour — the slot
   itself, Neon (whose type IS the accent) and a flash (a cut-in, not a
   message) — and one role replaces all three. The flash has a role of its own
   since 21 Sep 2026 (--r-bar-flash, the panel's "Instant message" colour): it
   is read FIRST and falls through to --r-bar-accent and then --accent, so a
   bar that does not set it draws the cut-in it always drew. They are re-stated here, in the
   same order the cascade reads them above (slot, then flash, then Neon, which
   is why a flash on Neon looks like Neon's own type and always has), so the
   whole of "what colour is a message" is one paragraph instead of three
   hundred lines apart.

   THE SCORES STRIP'S EDGE FADES. A fade has to be the colour of the thing it
   fades INTO. The rules above own their geometry and the reference's own
   colour; these two point them at the strip's background variable, whatever a
   role has made it.
   ====================================================================== */
.sb-slot-t { color: var(--r-bar-text, var(--text)); }
.sb-slot.is-flash .sb-slot-t { color: var(--r-bar-flash, var(--r-bar-accent, var(--accent))); }
.sb[data-layout="neon"] .sb-slot-t,
.sb[data-layout="neon"] .sb-mq-item { color: var(--r-bar-text, var(--accent)); }
.sb-scores[data-motion="ticker"] .sb-sc-win::after { background: linear-gradient(to left, var(--sb-sc-bg), transparent); }
.sb-scores[data-motion="ticker"] .sb-sc-win::before { background: linear-gradient(to right, var(--sb-sc-bg), transparent); }

/* ======================================================================
   BAR BLING (5 Oct 2026) — a background PICTURE behind the banner.
   overlay.js writes data-bg (stretch | tile) and three variables ONLY while a
   picture is on, and only on a layout with a plain fill (Glass, Neon, Strip
   and Crest are never given one) — so a bar without one matches none of this.
   Three layers: the darken (black at --bg-dim), the picture, and the bar's
   own colour under it while the picture loads. Painted once, never animated.
   Last in the file so it wins the tie with the gradient fill's rule.
   ====================================================================== */
.sb[data-bg] .sb-banner {
  background:
    linear-gradient(rgba(0, 0, 0, var(--bg-dim, 0)), rgba(0, 0, 0, var(--bg-dim, 0))),
    var(--bg-img) center / cover no-repeat,
    var(--sb-bar-bg);
}
.sb[data-bg="tile"] .sb-banner {
  background:
    linear-gradient(rgba(0, 0, 0, var(--bg-dim, 0)), rgba(0, 0, 0, var(--bg-dim, 0))),
    var(--bg-img) 0 0 / var(--bg-tile, 96px) auto repeat,
    var(--sb-bar-bg);
}
/* Scorebug's boxed cell keeps its border and lets the picture (or texture) through. */
.sb[data-tex][data-layout="scorebug"] .sb-banner::after,
.sb[data-bg][data-layout="scorebug"] .sb-banner::after { background: transparent; }
/* The message window's soft right edge is a flat BAR-colour fade (.sb-mq::after),
   which over a picture paints a bar-coloured smear. With a picture on, the
   window fades its own text out instead (a static mask), and the smear goes.
   A texture (BAR BLING 3) is the same case: the flat fade would wipe it out. */
.sb[data-tex] .sb-banner .sb-mq::after,
.sb[data-bg] .sb-banner .sb-mq::after { display: none; }
.sb[data-tex] .sb-banner .sb-mq,
.sb[data-bg] .sb-banner .sb-mq {
  -webkit-mask-image: linear-gradient(to left, transparent, #000 28px);
  mask-image: linear-gradient(to left, transparent, #000 28px);
}

/* ======================================================================
   BAR BLING (5 Oct 2026) — the EFFECTS. overlay.js writes data-fx-shadow
   (drop | inner), data-fx-shine, data-fx-bevel, data-fx-depth and
   data-fx-gloss (on) ONLY for an effect that is on, on a plain-fill layout,
   and the one Strength as --fx-k (0–.4) beside them — so a bar with every
   effect off matches none of this and the stage is exactly as it was. Every
   value below is the old STRONG one, scaled by --fx-k: as the opacity of the
   layer that draws it, or (text depth, which has no layer of its own) inside
   its shadow's alpha. 100 % would be Strong; the slider stops at 40 %. No new
   node: the drop shadow is .sb::after, shine + bevel + inner shadow share
   .sb-bar::after (over the fills, under the words), the gloss is
   .sb-bar::before. Crest, the one layout that draws those pseudo-elements
   itself, is never given an effect.
   ====================================================================== */

/* DROP shadow: only where the server found the room under the bar inside the
   980 × 342 OBS box (barShadowKind; the bar's bottom is the stage's own). The
   stage lets out EXACTLY 40px below — BAR_SHADOW_REACH, the shadow's whole
   reach — and its sides and top stay clipped as before; the margin makes the
   page tall enough not to cut it either. The Strength fades it, never sizes
   it. Off: none of it. */
.sb[data-fx-shadow="drop"] {
  overflow: visible;
  clip-path: inset(0 0 -40px 0);
  margin-bottom: 40px;
}
.sb[data-fx-shadow="drop"]::after {
  content: '';
  position: absolute; left: 0; right: 0; top: 100%;
  height: 40px;
  background: linear-gradient(rgba(0, 0, 0, .62), rgba(0, 0, 0, .24) 40%, rgba(0, 0, 0, 0));
  opacity: var(--fx-k, .18);
  pointer-events: none;
}

/* The Gloss sweep sits ABOVE the brand-off block, which holds nothing that
   moves — see "BAR BLING — the gloss sweep". */

/* Shine, bevel and the INNER shadow: three values on one layer, which the
   Strength fades as a whole. */
.sb[data-fx-shine] { --fx-shine: linear-gradient(rgba(255, 255, 255, .24), rgba(255, 255, 255, .06) 48%, rgba(255, 255, 255, 0) 70%); --fx-hi: inset 0 1px 0 rgba(255, 255, 255, .5); }
.sb[data-fx-bevel] { --fx-bev: inset 0 3px 1px rgba(255, 255, 255, .3), inset 0 -3px 1px rgba(0, 0, 0, .45); }
.sb[data-fx-shadow="inner"] { --fx-in: inset 0 -18px 20px -10px rgba(0, 0, 0, .65); }
.sb[data-fx-shine] .sb-bar::after,
.sb[data-fx-bevel] .sb-bar::after,
.sb[data-fx-shadow="inner"] .sb-bar::after {
  content: '';
  position: absolute; inset: 0; z-index: 0;
  border-radius: inherit;
  background: var(--fx-shine, none);
  box-shadow: var(--fx-hi, 0 0 transparent), var(--fx-bev, 0 0 transparent), var(--fx-in, 0 0 transparent);
  opacity: var(--fx-k, .18);
  pointer-events: none;
}

/* Text depth: a small shadow under the words, its alpha the old Strong one
   times the Strength. One attribute and a class, so it loses to the flash's
   own glow (.sb-slot.is-flash .sb-slot-t) and wins over nothing else — the
   four layouts with text shadows of their own never carry it. */
[data-fx-depth] .sb-slot-t,
[data-fx-depth] .sb-mq-item { text-shadow: 0 2px 2px rgba(0, 0, 0, calc(.6 * var(--fx-k, .18))), 0 4px 10px rgba(0, 0, 0, calc(.35 * var(--fx-k, .18))); }

/* ======================================================================
   BAR BLING 3 (5 Oct 2026) — TEXTURES. overlay.js writes data-tex (the
   tile's kind, tint | full — the id itself is re-checked in the module),
   --tex-img (the ONE tile's URL, /o/static/textures/<id>.webp?v=<hash>),
   --tex-a (its opacity) and, on a full tile, --tex-lift (a static
   brightness) ONLY while one is on, on a plain-fill layout, and never with a
   picture — so a bar without one matches none of this and fetches no tile.
   No node: the tile takes the banner's own hatching layer (.sb-banner::before,
   under the words, the logo and the rules) in place of the hatching, at its
   native 1024 × 256, repeated (the tiles are periodic both ways). Nothing
   here moves. A TINT tile is neutral light and shade over the bar's own
   colour; a FULL tile replaces the banner's colour with its matte base and
   fades in over it — trim and text keep their colours.
   ====================================================================== */
.sb[data-tex] .sb-banner::before {
  content: ''; display: block;
  position: absolute; inset: 0;
  background: var(--tex-img) 0 0 / 1024px 256px repeat;
  opacity: var(--tex-a, .18);
  pointer-events: none;
}
.sb[data-tex="full"] .sb-banner { background: #14191c; }
.sb[data-tex="full"] .sb-banner::before { filter: brightness(var(--tex-lift, 1)); }
/* SMOKE COLOUR (6 Oct 2026) — on the seven Dark tiles with light veins only
   (Championship gold and the Colour tiles never carry it). overlay.js writes
   data-tex-smoke (accent | custom) and, for Custom, --tex-smoke (a validated
   #RRGGBB) ONLY when it is not White, so a White bar matches none of this.
   The colour is MULTIPLIED into the tile inside the tile's own layers
   (background-blend-mode, never mix-blend-mode): the bright veins take the
   colour, the dark stays dark, and it blends with nothing but the tile — never
   the page under a transparent OBS source, never the words, the logo or the
   rules. The Dark tiles' veins are mid-grey, so a plain multiply was faint:
   the same tile is first COLOUR-DODGED onto itself four times (each pass
   divides by 1 - tile, so a vein near 0.2 about doubles while the near-black
   ground barely moves), then the colour, a flat gradient on top, multiplies
   in. Contrast, not a lift: no grey wash, and only the rare brightest vein
   cores reach the full colour. No node, static, the same on the still tile
   and on the moving layers, whose transforms are untouched. Match accent is
   the bar's own --accent, so it follows the colour live. The tiles are
   opaque. */
.sb[data-tex="full"][data-tex-smoke] .sb-banner::before,
.sb[data-tex="full"][data-tex-smoke][data-tex-mo] .sb-tex .sb-tl {
  background:
    linear-gradient(var(--tex-smoke, var(--accent)), var(--tex-smoke, var(--accent))),
    var(--tex-img) 0 0 / 1024px 256px repeat,
    var(--tex-img) 0 0 / 1024px 256px repeat,
    var(--tex-img) 0 0 / 1024px 256px repeat,
    var(--tex-img) 0 0 / 1024px 256px repeat,
    var(--tex-img) 0 0 / 1024px 256px repeat;
  background-blend-mode: multiply, color-dodge, color-dodge, color-dodge, color-dodge, normal;
}

/* ======================================================================
   LOGO FRAME (6 Oct 2026) — a ring or a rounded tile behind the corner logo,
   on the layouts that hang it bare (LOGO_FRAME_LAYOUTS in overlay.js and
   server.js: Broadcast, Minimal, Stacked, Glass, Neon, Slim, Broadcast Scores,
   Broadcast Duo). overlay.js writes data-logo-frame (circle | rounded) ONLY
   for a frame that is on, on one of those, so a bar without one matches none
   of this. It is the SAME <img>: its box, side, --logo-scale and safe-area
   inset are untouched, so no gutter, stage or browser-source size moves. The
   look is Spotlight's badge, to the declaration where it can be: a 3px
   accent ring, `object-fit: cover` and the clip, so the logo FILLS the frame
   right up to the ring with no band between — a square logo's corners are
   cropped by the circle exactly as a raised badge's are, and the rounded tile
   clips it to its corners. The backing is only the fill behind a transparent
   PNG, never a border. The colour roles reach it as before: the badge's own
   first, then the bar's, then the theme (Spotlight has no bar step). Static;
   it is on the logo (z-index 50), so every texture, effect and the gloss sweep
   stay under it inside .sb-bar. Last in the file so it wins the tie with
   Minimal's own circle crop. */
.sb[data-logo-frame] .sb-logo {
  background: var(--r-badge-bg, var(--r-bar-bg, var(--secondary)));
  border: 3px solid var(--r-badge-ring, var(--r-bar-accent, var(--accent)));
  object-fit: cover;
}
.sb[data-logo-frame="circle"] .sb-logo { border-radius: 50%; }
.sb[data-logo-frame="rounded"] .sb-logo { border-radius: calc(var(--logo-box) * .2); }

/* ======================================================================
   KEEP SPOTS LEFT ON SCREEN (15 Nov 2026) — Broadcast and Broadcast Scores
   One fixed pill at one end of the banner (`.sb-spots`, data-spots on the
   root names the end), sent only while a Whatnot break fills and the
   watcher's level is fresh. The message slots and the Scroll window stop
   short of it by --spots-room (its measured width plus the gap), on top of
   whatever that end already clears: the plain edge, the logo gutter, or
   Broadcast Scores' brand tab. Static: nothing here moves, so reduced
   motion has nothing to stop; a new count is a text change in place.
   Last spot and sold out take the flash's own accent and glow. A bar
   without the counter carries no attribute here and matches none of it. */
.sb[data-spots] { --sp-l: var(--gut-l); --sp-r: var(--gut-r); }
.sb[data-spots][data-layout="broadcast-scores"] { --sp-r: max(var(--edge), calc(var(--edge-in) + var(--tab-w, 0px))); }
.sb[data-spots][data-logo="right"][data-layout="broadcast-scores"] { --sp-r: var(--gut-r); --sp-l: max(var(--edge), calc(var(--edge-in) + var(--tab-w, 0px))); }
.sb[data-spots="right"] .sb-banner > .sb-slot { padding-right: calc(var(--sp-r) + var(--spots-room, 0px)); }
.sb[data-spots="right"] .sb-banner > .sb-mq { right: calc(var(--sp-r) + var(--spots-room, 0px)); }
.sb[data-spots="left"] .sb-banner > .sb-slot { padding-left: calc(var(--sp-l) + var(--spots-room, 0px)); }
.sb[data-spots="left"] .sb-banner > .sb-mq { left: calc(var(--sp-l) + var(--spots-room, 0px)); }
.sb-spots {
  position: absolute; z-index: 2; top: 0; bottom: 0; margin: auto 0;
  height: 46px; box-sizing: border-box; padding: 0 16px;
  display: flex; align-items: center;
  border: 2px solid rgba(var(--r-bar-accent-rgb, var(--accent-rgb)), .9);
  border-radius: 23px;
  background: rgba(0, 0, 0, .28);
  color: var(--r-bar-text, var(--text));
  font-size: 22px; font-weight: 700; letter-spacing: .04em; line-height: 1;
  text-transform: uppercase; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.sb[data-spots="right"] .sb-spots { right: var(--sp-r); }
.sb[data-spots="left"] .sb-spots { left: var(--sp-l); }
.sb-spots[data-state="last"],
.sb-spots[data-state="sold"] {
  color: var(--accent);
  text-shadow: 0 0 14px rgba(var(--r-bar-flash-rgb, var(--r-bar-accent-rgb, var(--accent-rgb))), .75), 0 2px 4px rgba(0, 0, 0, .6);
}
