:root{
  /* OBS / program frame (browser source should match this size) */
  --overlay-width: 1920px;
  --overlay-height: 1080px;
  /* Reserve left edge for a logo; all lower-thirds align above this inset, bottom-left */
  --overlay-buffer-left: 350px;
  /* Lead route progress bar: sits closer to the frame edge than the lower-third card */
  --lead-track-buffer-left: 100px;
  /* Space below the track (clear of lower third) */
  --lead-track-bottom-inset: 33vh;
  /* Pull top up by this much so extra length grows upward, not downward (matches former 33vh→20vh gain) */
  --lead-track-upshift: 13vh;
  /* Visual scale of overlay content (1 = full pixel size of cards/type) */
  --overlay-scale: 0.8;
  --bg: rgba(0,0,0,0);
  --panel: rgba(0,0,0,0.62);
  --panel-2: rgba(0,0,0,0.78);
  --text: #ffffff;
  --muted: rgba(255,255,255,0.75);
  --accent: #7cf0ff;
  --good: #6dff8b;
  --warn: #ffd37c;
  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
}

/* Raconteur website theme (control pages only) */
body.raconteurControl{
  --bg: #030201;
  --panel: rgba(8, 6, 6, 0.45);
  --panel-2: rgba(8, 6, 6, 0.65);
  --text: #f7f4ef;
  --muted: rgba(247, 244, 239, 0.72);
  --accent: #f4c430;
  --warn: #e8732e;
}
body.raconteurControl{
  background-color: #030201;
  background-image:
    radial-gradient(ellipse 150% 100% at 50% -50%, rgba(139, 44, 44,  0.35), transparent 60%),
    radial-gradient(ellipse 120% 80% at 110% 20%, rgba(232, 115, 46,  0.18), transparent 55%),
    radial-gradient(ellipse 100% 70% at -15% 60%, rgba(244, 196, 48,  0.12), transparent 50%),
    radial-gradient(ellipse 90% 60% at 50% 110%, rgba(61,  26,  26,  0.45), transparent 58%),
    conic-gradient(from 200deg at 70% 40%, rgba(139, 44, 44,  0.15), transparent 40%, rgba(232, 115, 46,  0.08), transparent 70%),
    linear-gradient(160deg, rgba(12,  8,  8,  0.9) 0%, transparent 50%),
    linear-gradient(220deg, transparent 50%, rgba(139, 44, 44,  0.1) 100%),
    linear-gradient(180deg, #0a0707 0%, #060405 45%, #030201 100%);
}
body.raconteurControl .card{
  backdrop-filter: blur(18px);
  border-color: rgba(255, 255, 255, 0.10);
  box-shadow: 0 24px 80px -24px rgba(0,0,0,0.75);
}
body.raconteurControl .header{
  background: linear-gradient(135deg, rgba(244, 196, 48, 0.14), rgba(255,255,255,0.04));
}
body.raconteurControl .miniLink{
  border-bottom-color: rgba(244, 196, 48, 0.35);
}

/* Raconteur control-page footer logo (fixed bottom-right) */
body.raconteurControl .raconteurFooterLogo{
  position: fixed;
  right: 36px;
  bottom: 20px;
  width: 280px;
  height: auto;
  opacity: 0.9;
  pointer-events: none;
  z-index: 2;
  /* If the asset has a black backing, remove it visually */
  mix-blend-mode: screen;
  filter: drop-shadow(0 10px 30px rgba(0,0,0,0.55));
}

body.raconteurControl .raconteurFooterNote{
  position: fixed;
  left: 36px;
  bottom: 18px;
  max-width: min(520px, calc(100vw - 36px - 36px - 240px));
  color: rgba(247, 244, 239, 0.72);
  font-size: 12px;
  line-height: 1.35;
  letter-spacing: 0.01em;
  pointer-events: none;
  z-index: 2;
  text-shadow: 0 10px 40px rgba(0,0,0,0.65);
}
body.raconteurControl .raconteurFooterNote strong{
  color: rgba(247, 244, 239, 0.92);
  font-weight: 800;
}

@media (max-width: 1100px){
  body.raconteurControl .raconteurFooterLogo{
    width: 220px;
    right: 16px;
    bottom: 12px;
  }
  body.raconteurControl .raconteurFooterNote{
    left: 16px;
    bottom: 10px;
    max-width: calc(100vw - 16px - 16px);
  }
}

/* Broadcast pages: exact HD frame, no scroll (set OBS browser source to 1920×1080) */
html:has(.safe.broadcast),
html:has(.safe.broadcast) body {
  width: var(--overlay-width);
  height: var(--overlay-height);
  max-width: var(--overlay-width);
  max-height: var(--overlay-height);
  overflow: hidden;
}

.safe {
  padding: 48px 64px;
  width: 100vw;
  height: 100vh;
  box-sizing: border-box;
}

/* Lead / Boulder control pages: centre the panel when short; top-align and scroll when tall */
.safe:has(.card.control) {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  min-height: 100vh;
  height: auto;
}
.safe:has(.card.control) > .card.control {
  margin-top: auto;
}
.safe:has(.card.control) > .error {
  margin-bottom: auto;
}

/* Client portal: same centering behavior as control pages */
.safe:has(.card.portal) {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  min-height: 100vh;
  height: auto;
}
.safe:has(.card.portal) > .card.portal {
  margin-top: auto;
}
.safe:has(.card.portal) > .error,
.safe:has(.card.portal) > .raconteurFooterLogo {
  margin-bottom: auto;
}

/* On the locked/login screen, truly center the portal card in viewport */
body.loginScreen .safe:has(.card.portal) {
  justify-content: center;
}
body.loginScreen .safe:has(.card.portal) > .card.portal {
  margin-top: 0;
}

/* Broadcast / OBS overlays: fixed 1920×1080, content pinned bottom-left (logo strip on left) */
.safe.broadcast {
  width: var(--overlay-width);
  height: var(--overlay-height);
  min-width: var(--overlay-width);
  min-height: var(--overlay-height);
  max-width: var(--overlay-width);
  max-height: var(--overlay-height);
  padding: 48px 64px 48px var(--overlay-buffer-left);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 12px;
  transform: scale(var(--overlay-scale));
  transform-origin: bottom left;
}

/* Leaderboards: centered in the 1920×1080 frame */
.safe.broadcast.leaderboardCenter{
  padding: 0;
  justify-content: center;
  align-items: center;
  transform-origin: center;
}

.card {
  display: inline-block;
  background: var(--panel);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 18px 60px rgba(0,0,0,0.35);
}

.header {
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(124,240,255,0.24), rgba(255,255,255,0.04));
  border-bottom: 1px solid rgba(255,255,255,0.12);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
}
.header .title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.2px;
}
.header .status {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.table {
  width: 960px;
}

.row, .row-head {
  display: grid;
  grid-template-columns: 76px 84px 1.6fr 110px 110px 110px;
  gap: 0;
  padding: 10px 16px;
  align-items: center;
}
.row-head{
  background: rgba(0,0,0,0.22);
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.row{
  border-top: 1px solid rgba(255,255,255,0.10);
  font-size: 16px;
}
.row:nth-child(even){
  background: rgba(255,255,255,0.04);
}

.cell-right{ text-align: right; }
.cell-muted{ color: var(--muted); }

.pill{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  font-size: 13px;
}
.dot{
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--warn);
  box-shadow: 0 0 0 6px rgba(255,211,124,0.14);
}
.dot.good{
  background: var(--good);
  box-shadow: 0 0 0 6px rgba(109,255,139,0.14);
}

.climber {
  width: 720px;
}
.climber .body{
  padding: 16px 18px 18px;
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
}
.nameBlock{
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.nameBlock .name{
  font-size: 28px;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nameBlock .meta{
  font-size: 14px;
  color: var(--muted);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.bigStats{
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.climbs{
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: nowrap;
}
.climb{
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 -10px 18px rgba(0,0,0,0.20);
}
.climb .zoneFill{
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 50%;
  background: rgba(124,240,255,0.40);
}
.climb .topFill{
  position: absolute;
  inset: 0;
  background: rgba(109,255,139,0.36);
}
.climb .label{
  position: absolute;
  top: 6px;
  left: 7px;
  font-size: 11px;
  font-weight: 800;
  color: rgba(255,255,255,0.82);
  text-shadow: 0 2px 10px rgba(0,0,0,0.65);
  letter-spacing: 0.02em;
}
.stat{
  background: var(--panel-2);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 14px;
  padding: 10px 12px;
  min-width: 92px;
  text-align: center;
}
.stat .label{
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.10em;
}
.stat .value{
  font-size: 30px;
  font-weight: 900;
  margin-top: 2px;
}

.error {
  padding: 14px 16px;
  background: rgba(255, 124, 124, 0.14);
  border: 1px solid rgba(255, 124, 124, 0.35);
  color: #ffdede;
  border-radius: 14px;
  font-size: 14px;
  max-width: 960px;
}

.leadTrack{
  position: fixed;
  left: var(--lead-track-buffer-left);
  top: calc(48px - var(--lead-track-upshift));
  bottom: var(--lead-track-bottom-inset);
  width: 88px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  pointer-events: none;
}
.leadTrack .track{
  width: 16px;
  flex: 1;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 -18px 26px rgba(0,0,0,0.22);
}
.leadTrack .fill{
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0%;
  background: linear-gradient(180deg, rgba(124,240,255,0.45), rgba(109,255,139,0.45));
}
.leadTrack .dotMark{
  position: absolute;
  left: 50%;
  transform: translate(-50%, 50%); /* anchor at the dot's bottom */
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.92);
  box-shadow: 0 6px 18px rgba(0,0,0,0.35), 0 0 0 4px rgba(124,240,255,0.18);
}
.leadTrack .caption{
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  padding: 6px 10px;
}

