/* The set's two layers (src/renderer/set-layer.ts). Colours and fonts come from the theme as
   --tb-* variables; sizes are stream pixels on the 1080×1920 canvas. */

.tb-layer { position: absolute; left: 0; top: 0; width: 1080px; height: 1920px; overflow: hidden; color: var(--tb-text); font-family: var(--tb-font-body); pointer-events: none; }
.tb-layer *, .tb-layer *::before { box-sizing: border-box; }
.tb-under { background: var(--tb-space) center / cover no-repeat; }
/* The plan's art (docs/09, M7): pictures crossfade in once loaded; a still with no clip drifts slowly. */
.tb-art { position: absolute; inset: 0; }
.tb-pic, .tb-clip { position: absolute; inset: 0; width: 100%; height: 100%; background: center / cover no-repeat; object-fit: cover; opacity: 0; transition: opacity 1.2s ease; }
.tb-pic.tb-in, .tb-clip.tb-in { opacity: 1; }
.tb-drift .tb-pic { animation: tb-drift 48s ease-in-out infinite alternate; }
@keyframes tb-drift { from { transform: scale(1.02) translate(0, 0); } to { transform: scale(1.09) translate(-1.2%, -1.6%); } }
.tb-card { position: absolute; inset: 0; background: center / cover no-repeat; opacity: .38; }
.tb-carded .tb-core > :not(.tb-card) { position: relative; }
.tb-live .tb-card { opacity: .62; }
.tb-won .tb-card, .tb-opened .tb-card { opacity: .8; }
.tb-won .tb-card::after, .tb-opened .tb-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(12, 10, 32, .15), rgba(12, 10, 32, .7)); }
/* The cinematics (docs/09, M8): over everything, in once they're playing. A still standing in for one zooms slowly. */
.tb-cines { position: absolute; inset: 0; pointer-events: none; z-index: 10; /* over the camera tags and the moment too */ }
.tb-cine { position: absolute; inset: 0; overflow: hidden; background: #000; opacity: 0; transition: opacity .35s ease; }
.tb-cine-pic { position: absolute; inset: 0; background: center / cover no-repeat; }
.tb-cine.tb-in { opacity: 1; }
.tb-cine video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tb-cine.tb-in .tb-cine-pic { animation: tb-cine-zoom 4s ease-out both; }
@keyframes tb-cine-zoom { from { transform: scale(1); } to { transform: scale(1.1); } }
.tb-cine-name { position: absolute; left: 110px; right: 110px; top: 640px; text-align: center; font-family: var(--tb-font-display); font-size: 88px; line-height: 1; color: var(--tb-gold); text-shadow: 0 4px 24px rgba(0, 0, 0, .85), 0 0 2px rgba(0, 0, 0, .9); overflow-wrap: anywhere; animation: tb-cine-name 1s .4s ease-out both; }
@keyframes tb-cine-name { from { opacity: 0; transform: translateY(24px) scale(.92); } to { opacity: 1; transform: none; } }
.tb-tint { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10, 8, 24, .25), rgba(10, 8, 24, .45) 55%, rgba(10, 8, 24, .7)); }

.tb-star { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: #fff; box-shadow: 0 0 6px 2px rgba(190, 210, 255, .7); animation: tb-twinkle 3s ease-in-out infinite; }
.tb-star.big { width: 4px; height: 4px; }
@keyframes tb-twinkle { 0%, 100% { opacity: .15 } 50% { opacity: 1 } }

/* A camera's silver rim. The camera's picture covers the hole exactly, so the hole is square
   (a rounded hole would show the picture's corners over the rim). */
.tb-frame { position: absolute; border-radius: 24px; background: linear-gradient(145deg, var(--tb-silver), var(--tb-silverMid) 40%, var(--tb-silverDark) 60%, var(--tb-silver));
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .15), 0 0 40px var(--tb-accent), 0 20px 50px rgba(0, 0, 0, .6); }
.tb-hole { position: absolute; inset: 10px; background: #110c28; }

/* Title: drawn at its natural size, then scaled into its rectangle. */
.tb-title { position: absolute; width: max-content; transform-origin: 0 0; }
.tb-lockup { display: block; height: 70px; margin-left: -6px; }
.tb-kicker { font: 800 18px/1 var(--tb-font-body); letter-spacing: .42em; text-transform: uppercase; color: var(--tb-accentHi); margin: 14px 0 6px 4px; }
.tb-heading { font: 900 74px/.98 var(--tb-font-display); letter-spacing: -.01em; text-transform: uppercase;
  background: linear-gradient(180deg, var(--tb-goldHi), var(--tb-gold) 45%, var(--tb-goldDeep)); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 18px rgba(246, 201, 69, .35)) drop-shadow(0 3px 0 rgba(60, 30, 0, .6)); }

/* The vault: a honeycomb of rimmed cells. --tb-cw is a cell's width (unitless) for sizing its words. */
.tb-vault { position: absolute; }
.tb-vault-head { position: absolute; left: 0; right: 0; top: 0; height: 44px; display: flex; justify-content: space-between; align-items: center; }
.tb-vault-label { font: 900 26px/1 var(--tb-font-display); letter-spacing: .06em; text-transform: uppercase; color: #fff; text-shadow: 0 0 18px var(--tb-accentHi); display: flex; align-items: center; gap: 10px; }
.tb-emblem { height: 36px; width: 36px; }
.tb-vault-count { font: 700 22px/1 var(--tb-font-body); letter-spacing: .04em; color: var(--tb-accentHi); }
.tb-num { font: 800 30px/1 var(--tb-font-numbers); color: var(--tb-gold); text-shadow: 0 0 14px rgba(246, 201, 69, .6); }
.tb-lines { position: absolute; left: 0; top: 0; overflow: visible; filter: drop-shadow(0 0 4px var(--tb-gold)); }
.tb-lines line { stroke: var(--tb-goldHi); stroke-opacity: .9; stroke-width: 3; stroke-dasharray: 5 6; stroke-linecap: round; }

.tb-cell { position: absolute; }
.tb-rim, .tb-core { position: absolute; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.tb-rim { inset: 0; background: linear-gradient(150deg, rgba(244, 246, 250, .35), rgba(91, 100, 120, .35)); }
.tb-core { inset: calc(var(--tb-cw) * .045px); background: rgba(12, 10, 32, .72); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.tb-n { font: 800 calc(var(--tb-cw) * .19px)/1 var(--tb-font-numbers); color: rgba(255, 255, 255, .38); }
.tb-user { font: 700 calc(var(--tb-cw) * .112px)/1.1 var(--tb-font-body); max-width: 82%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: calc(var(--tb-cw) * .05px); }
.tb-box { width: calc(var(--tb-cw) * .26px); height: calc(var(--tb-cw) * .22px); margin: calc(var(--tb-cw) * .03px) 0 0; }
.tb-box-fill { fill: var(--tb-gold); opacity: .9; }
.tb-box-edge { fill: none; stroke: var(--tb-goldDeep); stroke-width: 1.6; }

.tb-won .tb-rim { background: linear-gradient(150deg, var(--tb-goldHi), var(--tb-gold) 35%, var(--tb-goldDeep) 65%, var(--tb-goldHi)); }
.tb-won .tb-core { background: radial-gradient(circle at 50% 30%, #3b2a6e, #1a1238 75%); }
.tb-won .tb-n { color: var(--tb-gold); font-size: calc(var(--tb-cw) * .15px); }
.tb-won { filter: drop-shadow(0 0 10px rgba(246, 201, 69, .45)); }
.tb-live .tb-rim { background: linear-gradient(150deg, var(--tb-liveHi), var(--tb-live) 50%, var(--tb-liveHi)); }
.tb-live .tb-core { background: radial-gradient(circle at 50% 40%, #4c6dff, #1d2a8a 60%, #120f3a); }
.tb-live .tb-n { color: #fff; font-size: calc(var(--tb-cw) * .26px); }
.tb-live .tb-user { color: var(--tb-liveHi); letter-spacing: .12em; font-size: calc(var(--tb-cw) * .1px); }
.tb-live { animation: tb-pulse 1.6s ease-in-out infinite; }
@keyframes tb-pulse { 0%, 100% { filter: drop-shadow(0 0 8px var(--tb-liveHi)) } 50% { filter: drop-shadow(0 0 26px var(--tb-liveHi)) } }
.tb-closed .tb-rim { background: linear-gradient(150deg, var(--tb-goldDeep), rgba(91, 100, 120, .6)); }
.tb-closed .tb-user { color: var(--tb-gold); font: 800 calc(var(--tb-cw) * .2px)/1 var(--tb-font-numbers); }

/* Over the cameras. */
.tb-over { background: none; }
.tb-tag { position: absolute; transform: translateY(-50%); padding: 6px 12px; border-radius: 999px; font: 800 15px/1 var(--tb-font-body); letter-spacing: .14em; text-transform: uppercase;
  background: rgba(10, 8, 24, .8); border: 1px solid rgba(255, 255, 255, .25); white-space: nowrap; }
.tb-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--tb-onAir); margin-right: 8px; box-shadow: 0 0 8px var(--tb-onAir); vertical-align: 1px; }
/* The badge and what's selling share the first row (the box's name truncates beside it); the note
   takes the second. In a short rectangle a column would squeeze the name out of sight. */
.tb-lower { position: absolute; display: flex; flex-flow: row wrap; align-content: flex-end; align-items: center; column-gap: 14px; row-gap: 6px; padding: 14px 20px 16px;
  background: linear-gradient(0deg, rgba(10, 8, 24, .92), rgba(10, 8, 24, 0)); }
.tb-lower[hidden], .tb-ticker[hidden] { display: none; }
.tb-badge { padding: 8px 14px; border-radius: 12px; font: 800 20px/1 var(--tb-font-numbers); letter-spacing: .08em; text-transform: uppercase; color: #fff;
  background: linear-gradient(135deg, var(--tb-accent), var(--tb-accentDeep)); border: 1px solid rgba(255, 255, 255, .3); box-shadow: 0 0 22px var(--tb-accentHi); }
.tb-prize { flex: 1 1 0; min-width: 0; font: 900 26px/1.1 var(--tb-font-display); color: var(--tb-gold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-note { flex-basis: 100%; font: 600 21px/1.25 var(--tb-font-body); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-narrow .tb-badge { font-size: 16px; padding: 6px 10px; }
.tb-narrow .tb-prize { font-size: 20px; }
.tb-narrow .tb-note { font-size: 16px; }
.tb-ticker { position: absolute; display: flex; align-items: center; gap: 18px; padding: 0 26px; border-radius: 20px; overflow: hidden; white-space: nowrap;
  background: rgba(10, 8, 24, .78); border: 1px solid rgba(167, 139, 250, .35); font: 600 26px/1.2 var(--tb-font-body); }
.tb-ticker-star { color: var(--tb-gold); font-size: 30px; }
.tb-ticker-text { overflow: hidden; text-overflow: ellipsis; }
.tb-ticker b { color: var(--tb-gold); }

/* A box locking in (2.6s, LOCKIN_MS): the cell flashes gold and swells, its line draws itself,
   the ticker slides in. A redraw mid-way carries on (a negative animation-delay). */
.tb-lockin { animation: tb-lockin 2.6s cubic-bezier(.2, .8, .2, 1) both; z-index: 2; }
@keyframes tb-lockin {
  0% { transform: scale(1); filter: drop-shadow(0 0 0 transparent) brightness(1); }
  12% { transform: scale(1.32); filter: drop-shadow(0 0 40px var(--tb-goldHi)) brightness(1.9); }
  40% { transform: scale(1.12); filter: drop-shadow(0 0 30px var(--tb-gold)) brightness(1.3); }
  100% { transform: scale(1); filter: drop-shadow(0 0 10px rgba(246, 201, 69, .45)) brightness(1); }
}
.tb-lines line.tb-draw { stroke-dasharray: calc(var(--tb-len) * 1px); stroke-dashoffset: calc(var(--tb-len) * 1px); stroke-width: 4; animation: tb-draw 2.6s ease-out both; }
@keyframes tb-draw { 0%, 15% { stroke-dashoffset: calc(var(--tb-len) * 1px); } 55% { stroke-dashoffset: 0; } 99% { stroke-dasharray: calc(var(--tb-len) * 1px); } 100% { stroke-dashoffset: 0; stroke-dasharray: 5 6; stroke-width: 3; } }
.tb-ticker.tb-news { animation: tb-news 2.6s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes tb-news { 0% { transform: translateY(140%); } 18% { transform: translateY(0); box-shadow: 0 0 40px var(--tb-gold); border-color: var(--tb-gold); } 100% { box-shadow: none; } }
/* The vault crossing a quarter (and filling): one shimmer over the whole thing. */
.tb-vault.tb-mark::after { content: ""; position: absolute; inset: 40px -20px -10px; border-radius: 30px; pointer-events: none;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 233, 160, .35) 50%, transparent 70%) -200% 0 / 200% 100% no-repeat; animation: tb-shimmer 2.6s ease-in-out both; }
@keyframes tb-shimmer { to { background-position: 200% 0; } }

/* Opening night. A won box is sealed (gold, dimmed), being opened (pulses), or opened (bright, a
   star if it gave a giant hit). */
.tb-sealed { filter: drop-shadow(0 0 6px rgba(246, 201, 69, .3)) saturate(.7) brightness(.85); }
.tb-opening { animation: tb-opening 1.4s ease-in-out infinite; z-index: 2; }
@keyframes tb-opening { 0%, 100% { filter: drop-shadow(0 0 12px var(--tb-goldHi)) brightness(1.1); transform: scale(1.06); } 50% { filter: drop-shadow(0 0 34px var(--tb-goldHi)) brightness(1.5); transform: scale(1.14); } }
.tb-opened .tb-core { background: radial-gradient(circle at 50% 30%, #5b3fb0, #24185a 75%); }
.tb-star-hit { color: var(--tb-goldHi); font-size: calc(var(--tb-cw) * .2px); line-height: 1; text-shadow: 0 0 10px var(--tb-gold); }
/* A box starting to open (1.8s): it lifts and flashes. */
.tb-unlock { animation: tb-unlock 1.8s cubic-bezier(.2, .8, .2, 1) both, tb-opening 1.4s ease-in-out 1.8s infinite; }
@keyframes tb-unlock { 0% { transform: scale(1); } 25% { transform: scale(1.4) rotate(-4deg); filter: drop-shadow(0 0 50px var(--tb-goldHi)) brightness(2.2); } 60% { transform: scale(1.1) rotate(2deg); } 100% { transform: scale(1.06); } }

/* The hits board: the giant hits first, then the nice pulls (newest first), as chips. */
.tb-hits { position: absolute; display: flex; flex-direction: column; gap: 10px; padding: 14px 18px; border-radius: 22px;
  background: rgba(12, 10, 32, .72); border: 1px solid rgba(167, 139, 250, .35); box-shadow: inset 0 0 30px rgba(124, 58, 237, .25); overflow: hidden; }
.tb-hits[hidden] { display: none; }
.tb-hits-head { display: flex; justify-content: space-between; align-items: center; font: 900 22px/1 var(--tb-font-display); letter-spacing: .06em; text-transform: uppercase; color: #fff; text-shadow: 0 0 14px var(--tb-accentHi); }
.tb-hits-count { font: 800 22px/1 var(--tb-font-numbers); color: var(--tb-gold); }
.tb-hits-list { display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; overflow: hidden; }
.tb-hit { display: flex; align-items: baseline; gap: 8px; max-width: 100%; padding: 8px 14px; border-radius: 12px; font: 600 19px/1.15 var(--tb-font-body); white-space: nowrap; overflow: hidden;
  background: rgba(124, 58, 237, .28); border: 1px solid rgba(167, 139, 250, .45); }
.tb-hit-text { overflow: hidden; text-overflow: ellipsis; }
.tb-hit-who { color: var(--tb-accentHi); font-weight: 700; }
.tb-hit-value { font: 800 18px/1 var(--tb-font-numbers); color: var(--tb-gold); }
.tb-hit.tb-giant { background: linear-gradient(135deg, rgba(246, 201, 69, .3), rgba(183, 133, 27, .25)); border-color: var(--tb-gold); font-weight: 800; box-shadow: 0 0 16px rgba(246, 201, 69, .35); }
.tb-hit.tb-giant .tb-hit-text { color: var(--tb-goldHi); }
.tb-hit.tb-new { animation: tb-new-hit 1.6s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes tb-new-hit { 0% { transform: translateY(40px) scale(.8); opacity: 0; } 30% { transform: none; opacity: 1; box-shadow: 0 0 36px var(--tb-goldHi); } 100% { } }

/* Over the cameras: a giant hit's banner over the product cam (4.5s, GIANT_MS). */
.tb-giant-banner { position: absolute; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 26px 30px;
  border-radius: 28px; background: radial-gradient(ellipse at 50% 40%, rgba(60, 40, 110, .92), rgba(10, 8, 24, .94) 75%); border: 3px solid var(--tb-gold);
  box-shadow: 0 0 60px var(--tb-gold), inset 0 0 40px rgba(246, 201, 69, .25); animation: tb-giant 4.5s cubic-bezier(.2, .8, .2, 1) both; }
.tb-giant-banner[hidden] { display: none; }
.tb-giant-kicker { font: 900 54px/1 var(--tb-font-display); letter-spacing: .04em; text-transform: uppercase;
  background: linear-gradient(180deg, var(--tb-goldHi), var(--tb-gold) 45%, var(--tb-goldDeep)); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 16px rgba(246, 201, 69, .6)); }
.tb-giant-text { font: 800 38px/1.15 var(--tb-font-body); color: #fff; max-width: 100%; overflow-wrap: anywhere; }
.tb-giant-value { font: 800 40px/1 var(--tb-font-numbers); color: var(--tb-gold); text-shadow: 0 0 18px rgba(246, 201, 69, .7); }
.tb-giant-who { font: 700 26px/1 var(--tb-font-body); color: var(--tb-accentHi); }
@keyframes tb-giant { 0% { transform: scale(.3); opacity: 0; } 10% { transform: scale(1.08); opacity: 1; } 16% { transform: scale(1); } 85% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(.96); } }

/* The closing reel's cards: the title ("36 hours in 60 seconds"), the marathon's hour, the end. */
.tb-reel { position: absolute; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 20px 30px; border-radius: 30px;
  background: rgba(10, 8, 24, .86); border: 2px solid rgba(167, 139, 250, .6); box-shadow: 0 0 50px var(--tb-accent); animation: tb-reel-in .8s cubic-bezier(.2, .8, .2, 1) both; }
.tb-reel[hidden] { display: none; }
.tb-reel-title { font: 900 52px/1.05 var(--tb-font-display); text-transform: uppercase;
  background: linear-gradient(180deg, var(--tb-goldHi), var(--tb-gold) 45%, var(--tb-goldDeep)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tb-reel-sub { font: 700 26px/1.2 var(--tb-font-body); color: var(--tb-accentHi); letter-spacing: .06em; }
.tb-reel.tb-hour { padding: 14px 22px; border-radius: 22px; animation: none; }
.tb-reel.tb-hour .tb-reel-title { font: 800 64px/1 var(--tb-font-numbers); }
@keyframes tb-reel-in { from { transform: translateY(30px) scale(.9); opacity: 0; } }

/* Under the cameras: the vault's count in the title (the vault itself may only show at its moments). */
.tb-title-count { font: 700 30px/1 var(--tb-font-body); letter-spacing: .04em; color: var(--tb-accentHi); margin: 16px 0 0 4px; }
.tb-title-count .tb-num { font-size: 42px; }
.tb-title-count[hidden], .tb-vault[hidden] { display: none; }
.tb-title.tb-compact .tb-lockup { display: none; }
.tb-title.tb-compact .tb-kicker { margin-top: 0; }

/* Over the cameras: the vault's moments (a layout's `moment`), a caption strip and the vault under it.
   Timed ones (a box locking in, MOMENT_MS; a box starting to open) fade in and out over their length;
   held ones (a catch-up, the closing reel) fade in. */
.tb-moment { position: absolute; border-radius: 28px; background: rgba(10, 8, 24, .9); border: 2px solid rgba(167, 139, 250, .6);
  box-shadow: 0 0 50px rgba(124, 58, 237, .55); }
.tb-moment[hidden] { display: none; }
.tb-moment.tb-timed { animation-name: tb-moment; animation-timing-function: linear; animation-fill-mode: both; }
.tb-moment.tb-held { animation: tb-reel-in .6s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes tb-moment { 0% { opacity: 0; transform: scale(.92); } 6% { opacity: 1; transform: none; } 92% { opacity: 1; transform: none; } 100% { opacity: 0; transform: scale(.97); } }
.tb-moment-caption { position: absolute; left: 0; right: 0; top: 0; height: 84px; display: flex; align-items: center; justify-content: center; gap: 14px; padding: 0 26px;
  font: 600 28px/1.2 var(--tb-font-body); white-space: nowrap; overflow: hidden; border-bottom: 1px solid rgba(167, 139, 250, .3); }
.tb-moment-caption b { color: var(--tb-gold); }
.tb-moment-caption .tb-reel-title { font-size: 34px; }
.tb-moment-caption.tb-hour .tb-reel-title { font: 800 48px/1 var(--tb-font-numbers); }
.tb-moment-title { font: 900 32px/1 var(--tb-font-display); letter-spacing: .04em; text-transform: uppercase; color: var(--tb-gold); }
/* The one talking, while the vault is on show: over the caption and the vault's heading, like his bubble (two lines, scrolling). */
.tb-speech { position: absolute; left: 0; right: 0; top: 0; height: 132px; padding: 14px 26px 0; border-radius: 26px 26px 0 0;
  background: #fff; color: #14122b; border-bottom: 4px solid #14122b; z-index: 3; }
.tb-speech[hidden] { display: none; }
.tb-speech-tag { font: 900 15px/1 "Segoe UI", system-ui, sans-serif; letter-spacing: .14em; color: #6a4cff; margin-bottom: 9px; }
.tb-speech-text { position: relative; height: 80px; overflow: hidden; font: 800 32px/40px "Segoe UI", system-ui, sans-serif; letter-spacing: -.01em; }
.tb-speech .tb-w { opacity: .18; transition: opacity 90ms linear; }
.tb-speech .tb-w.on { opacity: 1; }

/* The show plan's big sets (docs/09-set-constructor.md, "The conductor"): a headline glows gold,
   in the vault and on the product cam's badge; its box locking in stays on show longer. */
/* (The hexagon is a clip-path, which would cut a box-shadow off: a drop-shadow follows its shape.) */
.tb-cell.tb-tier-big { filter: drop-shadow(0 0 8px var(--tb-accentHi)); }
.tb-cell.tb-tier-headline { filter: drop-shadow(0 0 10px var(--tb-gold)) drop-shadow(0 0 3px var(--tb-goldHi)); }
.tb-lower[data-tier="headline"] .tb-badge { background: linear-gradient(135deg, var(--tb-gold), var(--tb-goldDeep)); color: var(--tb-space); box-shadow: 0 0 26px var(--tb-gold); }
.tb-lower[data-tier="big"] .tb-badge { box-shadow: 0 0 30px var(--tb-accentHi); }
.tb-moment-caption.tb-headline { color: var(--tb-goldHi); }
