/* Targets the webOS browser on LG TVs (older Chromium): flexbox with margins (no flex `gap`, no grid),
   no `inset` / `aspect-ratio`. Brand colors: see assets/brand/BRAND.md. */

@font-face { font-family: 'Barlow'; font-weight: 500; src: url(fonts/barlow-latin-500.woff2) format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 600; src: url(fonts/barlow-latin-600.woff2) format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 700; src: url(fonts/barlow-latin-700.woff2) format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 800; src: url(fonts/barlow-latin-800.woff2) format('woff2'); }
@font-face { font-family: 'Heebo'; font-weight: 400; src: url(fonts/heebo-hebrew-400.woff2) format('woff2'); unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: 'Heebo'; font-weight: 400; src: url(fonts/heebo-latin-400.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+2190-21FF; }
@font-face { font-family: 'Heebo'; font-weight: 500; src: url(fonts/heebo-hebrew-500.woff2) format('woff2'); unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: 'Heebo'; font-weight: 500; src: url(fonts/heebo-latin-500.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+2190-21FF; }
@font-face { font-family: 'Heebo'; font-weight: 700; src: url(fonts/heebo-hebrew-700.woff2) format('woff2'); unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: 'Heebo'; font-weight: 700; src: url(fonts/heebo-latin-700.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+2190-21FF; }
@font-face { font-family: 'Secular One'; font-weight: 400; src: url(fonts/secular-one-hebrew-400.woff2) format('woff2'); unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: 'Secular One'; font-weight: 400; src: url(fonts/secular-one-latin-400.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F; }

:root {
  --bg: #0b0f14;
  --panel: #141a22;
  --panel-2: #1b232d;
  --line: #263140;
  --text: #f4f7fa;
  --muted: #8b97a6;
  --green: #6aad3a;
  --green-deep: #109840;
  --blue: #3a6699;
  --blue-bright: #4f8fd6;
  --blue-deep: #106890;
  --amber: #f0b429;
  --red: #e5484d;
  --gradient: linear-gradient(90deg, #6aad3a, #106890);
  --display: 'Barlow', 'Secular One', sans-serif;
  --body: 'Heebo', 'Barlow', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #000; cursor: none; }
body.cursor { cursor: default; }

#stage {
  position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; overflow: hidden;
  transform-origin: 0 0;
  background: radial-gradient(ellipse at 20% 0%, #15202b 0%, var(--bg) 60%);
  color: var(--text); font-family: var(--body);
  -webkit-font-smoothing: antialiased;
}

/* ---------- header ---------- */
#header {
  position: absolute; left: 0; top: 0; width: 1920px; height: 128px; padding: 0 56px;
  display: flex; align-items: center; justify-content: space-between;
}
#header::after {
  content: ''; position: absolute; left: 56px; right: 56px; bottom: 0; height: 4px; border-radius: 2px;
  background: var(--gradient);
}
.brand { display: flex; align-items: center; width: 520px; }
.brand-tile { width: 96px; height: 96px; border-radius: 20px; background: #fff; margin-right: 22px; display: flex; align-items: center; justify-content: center; flex: none; }
.brand-logo { height: 84px; }
.brand-name { font-family: var(--display); font-weight: 800; font-size: 40px; letter-spacing: 0.5px; text-transform: uppercase; line-height: 1; }
.brand-sub { font-size: 24px; color: var(--muted); margin-top: 6px; }
.header-mid { flex: 1; min-width: 0; text-align: center; }
.date { font-family: var(--display); font-weight: 600; font-size: 32px; color: var(--muted); }
.next { margin-top: 10px; font-size: 22px; white-space: nowrap; overflow: hidden; height: 34px; }
.next-label {
  display: inline-block; font-family: var(--display); font-weight: 800; font-size: 18px; letter-spacing: 2px; text-transform: uppercase;
  color: #fff; background: var(--blue); border-radius: 8px; padding: 3px 10px; margin-right: 12px; vertical-align: 2px;
}
.next-item { display: inline-block; margin-right: 22px; }
.next-time { font-family: var(--display); font-weight: 700; font-size: 26px; font-variant-numeric: tabular-nums; margin-right: 8px; }
.next-name { font-family: var(--display); font-weight: 700; font-size: 24px; text-transform: uppercase; }
.next-spots { color: var(--muted); font-size: 19px; margin-left: 8px; }
.next-spots b { color: var(--green); }
.next-stat { display: inline-block; margin-right: 24px; color: var(--muted); }
.next-stat b { color: var(--text); font-family: var(--display); font-size: 26px; margin-right: 6px; }
.clock-wrap { width: 520px; display: flex; flex-direction: column; align-items: flex-end; }
.clock { font-family: var(--display); font-weight: 700; font-size: 84px; line-height: 0.95; font-variant-numeric: tabular-nums; }
.sync { display: flex; align-items: center; font-size: 20px; color: var(--muted); margin-top: 4px; }
.sync-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--green); margin-right: 8px; }
.sync.stale .sync-dot { background: var(--amber); }
.sync.stale { color: var(--amber); }


/* ---------- layout ----------
   With a workout:    class + roster 500 | workout 560 | photo 700×290 / club news 700×320 / leaderboard 700×234
   Without a workout: class + roster 500 | photos 560 (full height) | club news / leaderboard (taller) */
.panel { background: var(--panel); border-radius: 24px; overflow: hidden; position: absolute; }
/* Left: the class + roster, club news under it. With a workout: workout in the middle, photo (700×520) and leaderboard
   on the right. Without: a wide photo over the middle + right, the leaderboard under it. (2026-10-07 layout) */
#main { left: 56px; top: 156px; width: 500px; height: 580px; padding: 26px 26px 20px; }
#messages { left: 56px; top: 756px; width: 500px; height: 284px; }
#workout { left: 580px; top: 156px; width: 560px; height: 884px; }
#photos { left: 580px; top: 156px; width: 1284px; height: 520px; }
#leaderboard { left: 580px; top: 696px; width: 1284px; height: 344px; }
.has-wod #photos { left: 1164px; width: 700px; }
.has-wod #leaderboard { left: 1164px; width: 700px; }
#stage:not(.has-wod) .lb-row { width: 33.33%; }
/* No leaderboard source ticked: the photo takes the leaderboard's place (whole right column / middle + right). */
.no-lb #leaderboard { display: none; }
.no-lb #photos { height: 884px; } /* the wide leaderboard: three columns, names close to their scores */

.panel-title {
  font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--muted); display: flex; justify-content: space-between; align-items: center; flex: none;
}
.empty-note { font-size: 24px; color: var(--muted); margin-top: 14px; }

/* ---------- main: the class in focus ---------- */
.class { height: 100%; display: flex; flex-direction: column; }
.focus-top { display: flex; justify-content: space-between; align-items: flex-start; flex: none; }
.focus-head { min-width: 0; flex: 1; }
.pill {
  display: inline-block; font-family: var(--display); font-weight: 800; font-size: 20px; letter-spacing: 2px;
  text-transform: uppercase; padding: 4px 12px; border-radius: 10px; color: #fff; margin-right: 16px; vertical-align: middle;
}
.pill.live { background: var(--green); }
.pill.soon, .pill.next { background: var(--blue); }
.pill.live::before { content: ''; display: inline-block; width: 11px; height: 11px; border-radius: 50%; background: #fff; margin-right: 10px; vertical-align: 3px; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
.focus-when { font-family: var(--display); font-weight: 600; font-size: 22px; color: var(--muted); vertical-align: middle; }
.focus-name { font-family: var(--display); font-weight: 800; font-size: 54px; line-height: 1; text-transform: uppercase; margin-top: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 20px; }

.count { text-align: right; flex: none; }
.count-num { font-family: var(--display); font-weight: 800; font-size: 60px; line-height: 1; font-variant-numeric: tabular-nums; }
.count-num .cap { color: var(--muted); font-weight: 600; font-size: 34px; }
.count-label { font-size: 19px; color: var(--muted); margin-top: 6px; }
.count-label .full, .full { color: var(--amber); font-weight: 700; }
.count-label b, .later-spots b { color: var(--green); font-weight: 700; }

.meta-row { display: flex; align-items: center; margin-top: 14px; flex: none; }
.coach { display: flex; align-items: center; width: 200px; flex: none; }
.avatar {
  width: 48px; height: 48px; border-radius: 50%; object-fit: cover; margin-right: 12px; flex: none;
  background: var(--panel-2); border: 3px solid var(--green);
  display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 700; font-size: 26px; color: var(--muted);
  position: relative; overflow: hidden;
}
.avatar img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: cover; }
.coach-label { font-size: 15px; color: var(--muted); text-transform: uppercase; letter-spacing: 2px; }
.coach-name { font-size: 22px; font-weight: 500; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 138px; }
.progress-wrap { flex: 1; }
.progress { margin-top: 8px; height: 12px; border-radius: 6px; background: var(--panel-2); overflow: hidden; }
.progress-bar { height: 100%; width: 0; border-radius: 6px; background: var(--gradient); transition: width 1s linear; }
.progress-text { display: flex; justify-content: space-between; font-size: 17px; color: var(--muted); margin-top: 8px; }

.roster { margin-top: 14px; border-top: 2px solid var(--line); padding-top: 12px; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.roster .panel-title { height: 28px; }
.roster-names { display: flex; flex-wrap: wrap; align-content: flex-start; margin-top: 12px; flex: 1; min-height: 0; overflow: hidden; }
.name {
  width: 50%; height: 38px; display: flex; align-items: center; padding-right: 10px;
  font-size: 22px; font-weight: 500; white-space: nowrap; overflow: hidden;
}
.name span { overflow: hidden; text-overflow: ellipsis; }
.tick { flex: none; width: 20px; height: 20px; border-radius: 50%; margin-right: 10px; border: 2px solid var(--line); }
/* Member photo (or initials) next to the name; fits the fixed row height. */
.mav {
  flex: none; position: relative; width: 30px; height: 30px; margin-right: 10px; border-radius: 50%; overflow: hidden;
  background: var(--line); color: var(--muted); font-size: 12px; font-weight: 700; line-height: 30px; text-align: center;
}
.mav img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: cover; }
.name.in .tick { background: var(--green); border-color: var(--green); position: relative; }
.name.in .tick::after {
  content: ''; position: absolute; left: 5px; top: 1px; width: 4px; height: 9px;
  border: solid #fff; border-width: 0 3px 3px 0; transform: rotate(45deg);
}
.pages span { display: inline-block; width: 11px; height: 11px; border-radius: 50%; background: var(--line); margin-left: 8px; }
.pages span.on { background: var(--text); }
.roster-empty { font-size: 22px; color: var(--muted); margin-top: 22px; }

/* Two classes at once: side by side within the main panel. */
.split { display: flex; height: 100%; }
.split-col { width: 50%; padding-right: 16px; }
.split-col + .split-col { padding-right: 0; padding-left: 16px; border-left: 2px solid var(--line); }
.compact .focus-top { display: block; }
.compact .count { text-align: left; margin-top: 10px; }
.compact .focus-name { font-size: 32px; margin-top: 12px; padding-right: 0; }
.compact .count-num { font-size: 40px; }
.compact .count-num .cap { font-size: 26px; }
.compact .focus-when { font-size: 19px; }
.compact .pill { font-size: 17px; padding: 3px 10px; margin-right: 8px; }
.compact .meta-row { display: block; margin-top: 16px; }
.compact .coach { width: auto; }
.compact .avatar { width: 42px; height: 42px; }
.compact .coach-name { font-size: 20px; max-width: 150px; }
.compact .progress-wrap { margin-top: 12px; }
.compact .name { width: 100%; font-size: 20px; height: 34px; }
.compact .tick { width: 24px; height: 24px; margin-right: 12px; }
.compact .mav { width: 28px; height: 28px; line-height: 28px; font-size: 11px; }
.compact .name.in .tick::after { left: 5px; top: 1px; width: 5px; height: 11px; }

/* After the last class: tomorrow's schedule. */
.main-title { font-family: var(--display); font-weight: 800; font-size: 50px; text-transform: uppercase; line-height: 1; }
.main-sub { font-size: 26px; color: var(--muted); margin-top: 8px; }
.day-list { margin-top: 22px; }
.day-item { display: flex; align-items: center; height: 54px; border-top: 2px solid var(--line); }
.day-time { font-family: var(--display); font-weight: 700; font-size: 26px; width: 92px; font-variant-numeric: tabular-nums; }
.day-name { font-family: var(--display); font-weight: 700; font-size: 24px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-transform: uppercase; }
.day-meta { font-size: 20px; color: var(--muted); white-space: nowrap; margin-left: 16px; }
.empty-state { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.empty-logo { width: 220px; height: 220px; border-radius: 44px; background: #fff; display: flex; align-items: center; justify-content: center; margin-bottom: 34px; }
.empty-logo img { height: 190px; }

/* ---------- center: workout, or photos when there is none ---------- */
.workout { display: none; flex-direction: column; padding: 30px 34px; border-top: 6px solid var(--green); }
.has-wod .workout { display: flex; }
.photos { position: absolute; border-radius: 24px; overflow: hidden; background: var(--panel); }
.slide { position: absolute; left: 0; top: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 1.5s ease; overflow: hidden; }
.slide.on { opacity: 1; }
.slide .fg { position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: cover; }
.slide .bg, .slide .caption { display: none; }
/* A member of the class in focus: the whole photo on a blurred copy of itself, with the name. */
.slide.member .fg { object-fit: contain; }
.slide.member .bg {
  display: block; position: absolute; left: -30px; top: -30px; width: calc(100% + 60px); height: calc(100% + 60px);
  object-fit: cover; filter: blur(26px) brightness(0.5);
}
.slide.member .caption {
  display: block; position: absolute; left: 0; right: 0; bottom: 0; padding: 48px 30px 22px; font-size: 36px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.72));
}

.wod-head { display: flex; justify-content: space-between; align-items: baseline; flex: none; }
.wod-label { font-family: var(--display); font-weight: 800; font-size: 26px; letter-spacing: 3px; text-transform: uppercase; color: var(--green); }
.wod-block + .wod-block { margin-top: 0.9em; padding-top: 0.7em; border-top: 3px solid var(--green); }
.wod-class { font-family: var(--display); font-weight: 800; font-size: 0.9em; text-transform: uppercase; margin-bottom: 0.25em; }
.wod-title { font-family: var(--display); font-weight: 800; font-size: 56px; line-height: 1.05; text-transform: uppercase; margin-top: 8px; flex: none; }
.wod-body { flex: 1; min-height: 0; overflow: hidden; margin-top: 16px; }
.wod-text { font-size: 34px; line-height: 1.25; }
.wod-section + .wod-section { margin-top: 0.8em; padding-top: 0.6em; border-top: 2px solid var(--line); }
.wod-section-title {
  font-family: var(--display); font-weight: 700; font-size: 0.7em; letter-spacing: 2px; text-transform: uppercase;
  color: var(--blue-bright); margin-bottom: 0.2em;
}
.wod-section-type { color: var(--muted); }
.wod-line { font-weight: 500; white-space: pre-wrap; tab-size: 2; -moz-tab-size: 2; }
.wod-gap { height: 0.45em; }

/* ---------- club news ---------- */
.messages { padding: 22px 28px; display: flex; flex-direction: column; }
.msg { flex: 1; min-height: 0; display: flex; flex-direction: column; margin-top: 12px; }
.msg-subject { font-size: 30px; font-weight: 700; line-height: 1.2; flex: none; }
/* Long messages scroll slowly (app.js); the fade hints there's more until the end is reached. */
.msg-body {
  font-size: 25px; line-height: 1.45; color: #c9d2dc; margin-top: 8px; flex: 1; min-height: 0; overflow: hidden;
  white-space: pre-line; position: relative;
}
.msg-fade { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.msg-fade::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 34px; background: linear-gradient(rgba(20, 26, 34, 0), var(--panel)); }
.msg-fade.at-end::after, .msg-fade.fits::after { display: none; }
.msg-date { font-size: 18px; color: var(--muted); margin-top: 8px; flex: none; }

/* ---------- leaderboard ---------- */
.leaderboard { padding: 22px 28px; }
.lb-sub { font-size: 18px; color: var(--muted); margin-top: 4px; }
.lb-rows { margin-top: 10px; display: flex; flex-direction: column; flex-wrap: wrap; align-content: flex-start; }
.lb-row { display: flex; align-items: center; height: 36px; font-size: 24px; width: 50%; padding-right: 24px; }
[dir=rtl] .lb-row { padding-right: 0; padding-left: 24px; }
.lb-rank {
  width: 28px; height: 28px; border-radius: 50%; flex: none; margin-right: 12px; font-family: var(--display); font-weight: 700;
  font-size: 16px; display: flex; align-items: center; justify-content: center; background: var(--panel-2); color: var(--muted);
}
.rank-1 .lb-rank { background: #e8b931; color: #1a1300; }
.rank-2 .lb-rank { background: #b8c2cc; color: #10151b; }
.rank-3 .lb-rank { background: #c47f3c; color: #1a0e02; }
.lb-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.lb-score { font-family: var(--display); font-weight: 700; font-size: 25px; margin-left: 10px; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* After the last class: today's totals in the main panel's footer area */
.stats { display: flex; margin-top: 22px; }
.stat { flex: 1; }
.stat-num { font-family: var(--display); font-weight: 800; font-size: 64px; line-height: 1; background: var(--gradient); -webkit-background-clip: text; color: transparent; }
.stat-label { font-size: 18px; color: var(--muted); text-transform: uppercase; letter-spacing: 2px; margin-top: 6px; }

/* ---------- Hebrew ---------- */
/* Hebrew has no capitals; drop the tracking used for English all-caps labels. */
.lang-he .next-label, .lang-he .pill, .lang-he .coach-label, .lang-he .panel-title, .lang-he .stat-label, .lang-he .wod-label, .lang-he .wod-section-title,
.lang-he .focus-name, .lang-he .main-title, .lang-he .brand-name { letter-spacing: 0; }

/* Full right-to-left layout (UI_LANG=he): mirror the per-side margins. */
[dir=rtl] .brand-tile { margin-right: 0; margin-left: 22px; }
[dir=rtl] .pill { margin-right: 0; margin-left: 16px; }
[dir=rtl] .pill.live::before { margin-right: 0; margin-left: 10px; }
[dir=rtl] .sync-dot { margin-right: 0; margin-left: 8px; }
[dir=rtl] .focus-name { padding-right: 0; padding-left: 20px; }
[dir=rtl] .count { text-align: left; }
[dir=rtl] .compact .count { text-align: right; }
[dir=rtl] .avatar { margin-right: 0; margin-left: 12px; }
[dir=rtl] .name { padding-right: 0; padding-left: 16px; }
[dir=rtl] .tick { margin-right: 0; margin-left: 10px; }
[dir=rtl] .mav { margin-right: 0; margin-left: 10px; }
[dir=rtl] .name.in .tick::after { left: 6px; }
[dir=rtl] .pages span { margin-left: 0; margin-right: 8px; }
[dir=rtl] .split-col { padding-right: 0; padding-left: 16px; }
[dir=rtl] .split-col + .split-col { padding-left: 0; padding-right: 16px; border-left: 0; border-right: 2px solid var(--line); }
[dir=rtl] .compact .tick { margin-left: 12px; }
[dir=rtl] .compact .name.in .tick::after { left: 6px; }
[dir=rtl] .next-label { margin-right: 0; margin-left: 12px; }
[dir=rtl] .next-item, [dir=rtl] .next-stat { margin-right: 0; margin-left: 22px; }
[dir=rtl] .next-time { margin-right: 0; margin-left: 8px; }
[dir=rtl] .next-spots { margin-left: 0; margin-right: 8px; }
[dir=rtl] .next-stat b { margin-right: 0; margin-left: 6px; }
[dir=rtl] .day-meta { margin-left: 0; margin-right: 16px; }
[dir=rtl] .lb-rank { margin-right: 0; margin-left: 12px; }
[dir=rtl] .lb-score { margin-left: 0; margin-right: 10px; }
[dir=rtl] .brand-sub, [dir=rtl] .sync { direction: rtl; }

/* Shown while there's no data at all yet. */
.boot { height: 100%; display: flex; align-items: center; justify-content: center; font-size: 32px; color: var(--muted); }
