/* The championship, race results, schedule and season leaders (js/race-view.js). Everything is in em, so the same markup
   is big on the 1920x1080 TV screen (.lv-screen) and small in the control room tab (.lv-pane). */
.lv {
  --lv-ink: var(--ink, var(--text, #eef1f6));
  --lv-muted: var(--muted, #8b94a7);
  --lv-gold: var(--gold, #d3a64f);
  --lv-up: #6fe39a; --lv-dn: #ff6b66; --lv-ot: #ffbe3b;
  --lv-row: rgba(255,255,255,.055);
  --lv-hl: color-mix(in srgb, var(--lv-gold) 36%, #0d1424);
  font-family: "Saira Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  font-size: 26px; line-height: 1.1; color: var(--lv-ink); font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.lv *, .lv *::before, .lv *::after { box-sizing: border-box; }

/* where it sits on the TV */
.lv-screen { position: absolute; left: 50px; right: 50px; top: 168px; bottom: 76px; }
.lv-stamp { position: absolute; right: 50px; bottom: 24px; font: 700 22px/1 "Saira Condensed", sans-serif; letter-spacing: .12em; text-transform: uppercase; color: var(--muted, #8b94a7); }
.lv-stamp i { display: inline-block; width: 11px; height: 11px; margin-right: 10px; border-radius: 50%; background: #6fe39a; box-shadow: 0 0 10px #6fe39a; vertical-align: 1px; animation: lv-pulse 2s ease-in-out infinite; }
@keyframes lv-pulse { 50% { opacity: .35; } }

.lv-msg { padding: 1.4em; text-align: center; color: var(--lv-muted); font-size: 1.1em; letter-spacing: .04em; }
.lv-msg.bad { color: var(--lv-ot); }
.lv-screen .lv-msg { margin-top: 5em; font-size: 1.5em; }

/* ---------- tables ---------- */
.lv-grid { display: grid; grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr)); grid-template-rows: repeat(var(--rows, 1), auto); grid-auto-flow: column; gap: .5em 1.6em; align-content: start; }
.lv-grid.n1 { max-width: 46em; margin: 0 auto; width: 100%; }
.lv-t { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0 .13em; }
.lv-t.dense { font-size: .92em; }
.lv-t th { padding: 0 .35em .1em; text-align: right; font-weight: 700; white-space: nowrap; }
.lv-t th .hd { font-size: .7em; letter-spacing: .12em; color: var(--lv-muted); }
.lv-t th.tm { text-align: left; padding-left: 0; }
.lv-t th.tm .hd { font-size: .95em; letter-spacing: .06em; font-weight: 800; color: var(--lv-ink); text-transform: uppercase; }
.lv-t th.tm small { margin-left: .7em; font-size: .62em; letter-spacing: .16em; font-weight: 700; color: var(--lv-gold); }
.lv-t td { padding: .2em .35em; text-align: right; background: var(--lv-row); white-space: nowrap; line-height: 1.15; }
.lv-t td:first-child { border-radius: .3em 0 0 .3em; box-shadow: inset .2em 0 0 var(--tc, #5a6275); }
.lv-t td:last-child { border-radius: 0 .3em .3em 0; }
.lv-t td.r { padding-left: .55em; text-align: left; color: var(--lv-muted); font-size: .8em; font-weight: 700; }
.lv-t td.tm { text-align: left; padding-left: .2em; overflow: hidden; text-overflow: ellipsis; font-weight: 800; letter-spacing: .02em; }
.lv-t td.pts { font-weight: 900; color: #fff; }
.lv-t td.l10, .lv-t td.stk, .lv-t td.pct { color: #c4cbda; }
.lv-t th.r { width: 1.9em; } .lv-t th.pts { width: 1.9em; } .lv-t th.pct { width: 2.5em; } .lv-t th.diff { width: 2.2em; } .lv-t th.l10 { width: 3.1em; } .lv-t th.stk { width: 2.3em; }
.lv-t:not(.teams) th:not(.r):not(.tm):not(.pts):not(.pct):not(.diff):not(.l10):not(.stk) { width: 1.6em; }
.lv-t .up { color: var(--lv-up); } .lv-t .dn { color: var(--lv-dn); } .lv-t .ot { color: var(--lv-ot); }
.lv-t tr.cut td { border-bottom: .09em dashed var(--lv-gold); }
.lv-t tr.hl td { background: var(--lv-hl); color: #fff; }
.lv-t tr.hl td.r { color: var(--lv-gold); }
.lv-t tr.lv-sep td { padding: .5em 0 .08em; background: none; box-shadow: none; text-align: left; font-size: .62em; letter-spacing: .22em; text-transform: uppercase; color: var(--lv-gold); font-weight: 800; }
.lv-t.teams th { width: 2.4em; } .lv-t.teams th.r { width: 1.9em; } .lv-t.teams th.tm { width: auto; }
.lv-t.teams th:nth-child(3) { width: 1.7em; }
.lv-t.teams td { font-size: .94em; padding-top: .3em; padding-bottom: .3em; }
.lv-t.teams td.sorted, .lv-t.teams th.sorted { color: var(--lv-gold); }
.lv-t.teams td.sorted { background: color-mix(in srgb, var(--lv-gold) 13%, var(--lv-row)); }
.lv-t.teams th button { all: unset; cursor: pointer; padding: .2em .1em; border-radius: .25em; font-size: 1em; }
.lv-t.teams th button:hover { color: var(--lv-ink); }
.lv-logo { width: 1.25em; height: 1.25em; object-fit: contain; vertical-align: middle; margin: -.2em .4em -.2em 0; }
.lv-badge { display: inline-grid; place-items: center; width: 1.25em; height: 1.25em; margin: -.2em .4em -.2em 0; border-radius: 50%; background: #3a4358; font-size: .5em; font-weight: 800; vertical-align: middle; }
.lv-cl { margin-left: .3em; font-size: .62em; font-weight: 900; color: var(--lv-gold); vertical-align: .55em; }
.lv-cl.cl-e { color: var(--lv-dn); } .lv-cl.cl-p, .lv-cl.cl-z { color: #fff; }
.lv-legend { display: flex; flex-wrap: wrap; gap: .3em 1.4em; margin-top: .7em; font-size: .62em; letter-spacing: .1em; text-transform: uppercase; color: var(--lv-muted); }
.lv-legend .lv-cl { margin: 0 .3em 0 0; vertical-align: 0; font-size: 1em; }

/* ---------- playoff picture ---------- */
.lv-pic { font-size: 1.04em; display: grid; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); gap: 1.6em; align-items: start; }
.lv-pic.n1 { grid-template-columns: minmax(0, 52em); justify-content: center; }
.lv-panel { padding: .9em 1em 1em; border-radius: .7em; background: rgba(255,255,255,.04); border: .08em solid rgba(255,255,255,.08); }
.lv-panel h2 { margin: 0 0 .5em; display: flex; align-items: baseline; gap: .8em; font-size: 1.3em; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.lv-panel h2 small { font-size: .5em; letter-spacing: .18em; color: var(--lv-gold); }
.lv-brk { display: grid; grid-template-columns: 1fr 1fr; gap: 1em; }
.lv-bcol { display: grid; gap: .7em; align-content: start; }
.lv-panel h3 { margin: 0; font-size: .64em; letter-spacing: .24em; text-transform: uppercase; color: var(--lv-muted); font-weight: 800; }
.lv-mu { display: grid; gap: .1em; padding: .35em; border-radius: .5em; background: rgba(0,0,0,.25); }
.lv-mu .lv-vs { text-align: center; font-size: .55em; letter-spacing: .3em; color: var(--lv-muted); text-transform: uppercase; line-height: 1; padding: .12em 0; }
.lv-sr { display: grid; grid-template-columns: 2.1em 1.4em minmax(0, 1fr) auto; align-items: center; gap: .4em; padding: .4em .45em; border-radius: .35em; background: var(--lv-row); box-shadow: inset .2em 0 0 var(--tc, #5a6275); }
.lv-sr.hl, .lv-bb.hl, .lv-list li.hl, .lv-lead.hl { background: var(--lv-hl); }
.lv-sr i { font-style: normal; font-size: .7em; font-weight: 800; letter-spacing: .06em; text-align: center; padding: .25em 0; border-radius: .3em; background: rgba(255,255,255,.1); color: var(--lv-gold); }
.lv-sr .lv-logo, .lv-bb .lv-logo { width: 1.5em; height: 1.5em; margin: 0; }
.lv-sr b, .lv-bb b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; letter-spacing: .02em; }
.lv-sr small, .lv-bb small { font-size: .62em; color: var(--lv-muted); letter-spacing: .06em; white-space: nowrap; }
.lv-sr em { font-style: normal; font-weight: 900; font-size: 1.05em; min-width: 1.6em; text-align: right; }
.lv-sr em span { margin-left: .25em; font-size: .5em; letter-spacing: .1em; color: var(--lv-muted); }
.lv-sr.empty { grid-template-columns: 2.1em 1fr; color: var(--lv-muted); }
.lv-bubble { margin-top: .9em; display: grid; gap: .22em; }
.lv-bubble h3 { margin-bottom: .2em; }
.lv-bb { display: grid; grid-template-columns: 1.5em minmax(0, 1fr) auto auto; align-items: center; gap: .5em; padding: .3em .5em; border-radius: .35em; background: var(--lv-row); box-shadow: inset .2em 0 0 var(--tc, #5a6275); }
.lv-bb em { font-style: normal; font-size: .75em; font-weight: 700; letter-spacing: .06em; color: var(--lv-ot); text-transform: uppercase; min-width: 7em; text-align: right; }

/* ---------- leaders ---------- */
.lv-cards { display: grid; grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr)); gap: 1em; }
.lv-cards.c5 { --n: 5; } .lv-cards.c4 { --n: 4; }
.lv-card { padding: .8em .8em .6em; border-radius: .7em; background: rgba(255,255,255,.04); border: .08em solid rgba(255,255,255,.08); min-width: 0; }
.lv-card h2 { margin: 0 0 .5em; font-size: .85em; font-weight: 900; letter-spacing: .18em; text-transform: uppercase; color: var(--lv-gold); }
.lv-lead { position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-areas: "mug val" "who who"; align-items: center; gap: .35em .6em; padding: .5em; margin-bottom: .45em; border-radius: .5em; background: linear-gradient(135deg, color-mix(in srgb, var(--tc, #5a6275) 55%, #0d1424), rgba(0,0,0,.3)); }
.lv-lead .lv-mug { grid-area: mug; width: 4.2em; height: 4.2em; }
.lv-lead strong { grid-area: val; text-align: right; font-size: 2.7em; line-height: 1; font-weight: 900; color: #fff; text-shadow: 0 .06em 0 rgba(0,0,0,.4); }
.lv-lead .t { position: absolute; right: .6em; top: .35em; font-size: .5em; letter-spacing: .18em; text-transform: uppercase; color: var(--lv-gold); }
.lv-lead .who { grid-area: who; display: grid; gap: .1em; min-width: 0; }
.lv-lead .who b { font-size: 1.15em; font-weight: 900; letter-spacing: .02em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lv-lead .who span { font-size: .72em; letter-spacing: .08em; color: #d5dbe8; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lv-lead .who .lv-logo { width: 1.3em; height: 1.3em; margin-right: .35em; }
.lv-mug { border-radius: 50%; object-fit: cover; object-position: center 12%; background: #1c2538; display: block; }
.lv-list { margin: 0; padding: 0; list-style: none; display: grid; gap: .15em; }
.lv-list li { display: grid; grid-template-columns: 1.7em 1.7em minmax(0, 1fr) 1.3em 2.3em; align-items: center; gap: .4em; padding: .2em .4em; border-radius: .35em; background: var(--lv-row); box-shadow: inset .18em 0 0 var(--tc, #5a6275); }
.lv-list i { font-style: normal; font-size: .75em; font-weight: 700; color: var(--lv-muted); }
.lv-list .lv-mug { width: 1.7em; height: 1.7em; }
.lv-list b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; }
.lv-list .lv-logo { width: 1.3em; height: 1.3em; margin: 0; }
.lv-list em { font-style: normal; text-align: right; font-weight: 900; color: #fff; }

/* five narrow cards on the TV: the list rows give the width to the names */
.lv-screen .lv-cards.c5 .lv-list li { grid-template-columns: 1.5em minmax(0, 1fr) 1.3em 2em; }
.lv-screen .lv-cards.c5 .lv-list .lv-mug { display: none; }
.lv-screen .lv-cards.c4 { font-size: 1.1em; }

/* animate in when the screen first appears or the view changes (the TV defines `rise`) */
.lv-t.anim tbody tr, .lv-mu.anim, .lv-cards.anim .lv-card { animation: rise .55s var(--ease, ease) both; animation-delay: calc(var(--i, 0) * 28ms + .1s); }
.lv-mu.anim:nth-child(3), .lv-mu.anim:nth-child(4) { animation-delay: .3s; }
@media (prefers-reduced-motion: reduce) { .lv-t.anim tbody tr, .lv-mu.anim, .lv-cards.anim .lv-card { animation: none; } }

/* ---------- the control room tab: small, and wraps to fit the pane ---------- */
.lv-pane { font-size: 13px; min-width: 0; }
.lv-pane .lv-grid { grid-template-columns: repeat(auto-fit, minmax(31em, 1fr)); grid-template-rows: none; grid-auto-flow: row; gap: 1em 1.4em; }
.lv-pane .lv-grid.n1 { max-width: none; }
.lv-pane .lv-t td, .lv-pane .lv-t th { padding-top: .2em; padding-bottom: .2em; }
.lv-pane .lv-pic { font-size: 1em; grid-template-columns: repeat(auto-fit, minmax(28em, 1fr)); gap: 1em; }
.lv-pane .lv-pic.n1 { grid-template-columns: minmax(0, 1fr); }
.lv-pane .lv-cards { grid-template-columns: repeat(auto-fit, minmax(17em, 1fr)); }
.lv-pane .lv-msg { font-size: 1.2em; }
.lv-pane .lv-legend { font-size: .72em; }
.lv-pane .lv-lead .lv-mug { width: 3.6em; height: 3.6em; }
.lv-pane .lv-lead strong { font-size: 2.3em; }

/* ---------- points & results (league.css builds the tables; these are the racing columns) ---------- */
.lv-t.race th.no, .lv-t.race td.no { width: 2.6em !important; text-align: center; }
.lv-t.race th.tm { width: auto; }
.lv-t.race th.team { width: 6.6em !important; text-align: left; } .lv-t.race td.team { text-align: left; color: #c9cbd3; font-size: .8em; letter-spacing: .04em; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; }
.lv-t.race th:not(.r):not(.no):not(.tm):not(.team) { width: 2.9em !important; }
.lv-t.race th.pts { width: 3em !important; } .lv-t.race th.gap { width: 4.2em !important; } .lv-t.race th.eng { width: 3.4em !important; } .lv-t.race th.st { width: 3.9em !important; }
.lv-t.race td.tm b { text-transform: uppercase; }
.lv-t.race td.tm small { margin-left: .4em; font-size: .62em; color: var(--lv-muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.lv-t.race td.gap { color: #c9cbd3; font-size: .9em; } .lv-t.race td.gap em { font-style: normal; color: var(--lv-gold); font-size: .8em; letter-spacing: .08em; text-transform: uppercase; }
.lv-t.race td.st i { font-style: normal; margin-left: .3em; font-size: .7em; } .lv-t.race td.st i.up { color: var(--lv-up); } .lv-t.race td.st i.dn { color: var(--lv-dn); }
.lv-t.race tr.win td { background: color-mix(in srgb, var(--lv-gold) 16%, var(--lv-row)); }
.lv-num { display: inline-grid; place-items: center; min-width: 2em; padding: .06em .25em; border-radius: .28em; background: var(--tc); font-style: italic; font-weight: 900; color: #fff; text-shadow: -.05em -.05em 0 #000, .05em -.05em 0 #000, -.05em .05em 0 #000, .05em .05em 0 #000; box-shadow: inset 0 0 0 .08em rgba(255,255,255,.65); line-height: 1.05; }
.lv-flag { width: 1.05em; height: .72em; object-fit: cover; border-radius: .1em; margin-right: .4em; vertical-align: .02em; }
.lv-grid.wide { max-width: 64em; margin: 0 auto; width: 100%; }
.lv-legend { justify-content: center; }
.lv-racehead { display: flex; flex-wrap: wrap; justify-content: center; gap: .3em 1.4em; margin-bottom: .6em; font-size: .8em; letter-spacing: .08em; text-transform: uppercase; color: var(--lv-muted); }
.lv-racehead b { color: var(--lv-ink); } .lv-racehead b.live { color: #ff6b66; }
.lv-sched { display: grid; grid-template-columns: repeat(var(--n, 6), minmax(0, 1fr)); gap: .55em; }
.lv-rc { display: grid; gap: .25em; align-content: start; padding: .55em .6em .6em; border-radius: .5em; background: var(--lv-row); box-shadow: inset 0 .2em 0 var(--tc); min-width: 0; }
.lv-rc.next { background: color-mix(in srgb, var(--lv-gold) 22%, #121216); box-shadow: inset 0 .2em 0 var(--lv-gold), 0 0 0 .08em var(--lv-gold); }
.lv-rc.future { opacity: .7; }
.lv-rc.hl { background: var(--lv-hl); }
.rc-top { display: flex; align-items: center; gap: .4em; font-size: .62em; letter-spacing: .1em; text-transform: uppercase; color: var(--lv-muted); white-space: nowrap; }
.rc-top i { font-style: normal; font-weight: 900; color: var(--lv-gold); }
.rc-top em { margin-left: auto; font-style: normal; padding: .05em .4em; border-radius: .3em; background: rgba(255,255,255,.08); }
.rc-top em.ty-oval { color: var(--lv-gold); }
.rc-name { font-weight: 900; font-size: .95em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-win { display: flex; align-items: center; gap: .4em; font-weight: 800; font-size: .9em; text-transform: uppercase; min-width: 0; }
.rc-win span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lv-rc small { font-size: .6em; letter-spacing: .06em; color: var(--lv-muted); text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-next { font-weight: 900; font-size: .8em; letter-spacing: .12em; color: var(--lv-gold); text-transform: uppercase; }
.lv-sched.anim .lv-rc { animation: rise .5s var(--ease, ease) both; animation-delay: calc(var(--i, 0) * 30ms + .1s); }
.lv-lead .lv-num { grid-area: mug; font-size: 1.8em; }
.lv-list li { grid-template-columns: 2.2em minmax(0, 1fr) 2.6em; }
.lv-screen .lv-cards.c4 .lv-list li { grid-template-columns: 2.2em minmax(0, 1fr) 2.6em; }
.lv { --lv-hl: color-mix(in srgb, var(--lv-gold) 30%, #141419); }


/* car numbers in the control room too */
.carnum { --sz: 40px; display: inline-grid; place-items: center; width: var(--sz); height: calc(var(--sz) * .78); border-radius: calc(var(--sz) * .14); background: var(--tc);
  font-weight: 900; font-style: italic; font-size: calc(var(--sz) * .6); color: #fff; text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000; }
.lv-pane .lv-t.race th.team, .lv-pane .lv-t.race td.team { display: none; }

/* on the TV the racing tables and the season grid read from across the room */
.lv-screen .lv-grid.wide .lv-t.race { font-size: 1.5em; }
.lv-screen .lv-grid.n2 .lv-t.race { font-size: 1.05em; }
.lv-screen .lv-grid.wide { max-width: 46em; }
.lv-screen .lv-sched { font-size: 1.32em; gap: .5em; }
.lv-screen .lv-racehead { font-size: 1.05em; }
.lv-screen .lv-legend { font-size: .8em; margin-top: 1em; }
.lv-screen .lv-cards.c4 { font-size: 1.45em !important; gap: .8em; } .lv-screen .lv-cards .lv-list li { padding: .3em .45em; }
