/* Fixed signage canvas: 1080 x 1920 portrait (same as estorilopen26-jcdecaux).
   No scroll, no overflow, no responsive reflow — internal layout is absolute. */

:root {
  --neon: #7dff5e;
  --bg: #071007;
}

@font-face {
  font-family: "DM Mono";
  font-weight: 300;
  font-display: swap;
  src: url("/assets/fonts/dm-mono/DMMono-Light.ttf") format("truetype");
}
@font-face {
  font-family: "DM Mono";
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/dm-mono/DMMono-Regular.ttf") format("truetype");
}
@font-face {
  font-family: "DM Mono";
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/dm-mono/DMMono-Medium.ttf") format("truetype");
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body, #root { height: 100%; }

body {
  background: #000;
  color: #fff;
  font-family: "DM Mono", ui-monospace, monospace;
  overflow: hidden;
}

.signage-viewport {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.canvas {
  position: relative;
  width: 1080px;
  height: 1920px;
  flex: 0 0 auto;
  overflow: hidden;
  background: var(--bg);
  transform: scale(var(--fit-scale, 1));
  transform-origin: center center;
}

/* MUPI mode: landscape-mounted player shows the portrait canvas rotated. */
body.make-it-mupi .canvas {
  transform: rotate(-90deg) scale(var(--fit-scale, 1));
}

.screen {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 1080px;
  height: 1920px;
  overflow: hidden;
}

/* ---------- Screen 1 : idle ---------- */
.idle-screen { background: #000; }
.idle-fullbleed {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 1080px;
  height: 1920px;
  object-fit: cover;
}
.idle-bg {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  /* Fallback while 01-packshot.jpg is missing. */
  background: radial-gradient(ellipse at 50% 30%, #142514 0%, #070b07 70%);
}
.idle-text {
  position: absolute;
  bottom: 120px;
  width: 100%;
  text-align: center;
  letter-spacing: 0.3em;
  color: #5a6b5a;
  font-size: 32px;
  font-weight: 400;
}

/* ---------- Screen 2 : leaderboard ---------- */
/* Artwork bg already has logo + title + badge; rows sit in the empty middle. */
.leaderboard {
  background: #000 url("/assets/02-high-fives-per-athlete.jpg") center top / 1080px 1920px no-repeat;
  display: flex;
  flex-direction: column;
  padding: 540px 0 100px 0;
}

.lb-rows {
  list-style: none;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  padding-left: 50px;
}

.lb-row {
  position: relative;
  flex: 0 0 auto;
  height: 250px;
  min-height: 0;
  will-change: transform;
}

/* Fixed track: same width every row. Info card follows the photo.
   Zero values render photo-only (transparent track). */
.lb-track {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 600px;
  height: 168px;
  border-radius: 999px;
  background: #0c1229;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Zero values: no pill, photo parked at the left. Slot keeps info aligned. */
.lb-track-empty {
  background: transparent;
  border-color: transparent;
}

.lb-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 100%;
  border-radius: 999px;
  transform-origin: left center;
  transition: transform 2s ease-in-out, box-shadow 1s ease;
  will-change: transform;
}

.lb-photo {
  position: absolute;
  top: 50%;
  left: 0;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  border: 6px solid var(--neon);
  background: #12202f;
  transition: transform 2s ease-in-out, box-shadow 1s ease, border-color 1s ease;
  will-change: transform;
}

.lb-info {
  position: absolute;
  top: 50%;
  left: 0;
  display: flex;
  flex-direction: column;
  line-height: 1;
  flex-shrink: 0;
  transition: transform 2s ease-in-out;
  will-change: transform;
}
.lb-name {
  display: flex;
  align-items: center;
  font-size: 34px;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--neon);
}
.lb-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-right: 12px;
  background: var(--neon);
}
.lb-number {
  font-size: 118px;
  font-weight: 500;
  color: #fff;
  letter-spacing: 0.02em;
  line-height: 1;
}
/* Odometer digits: each rolls inside its own 1em window. */
.odo-number {
  display: inline-flex;
  line-height: 1;
}
.odo-digit {
  display: inline-block;
  height: 1em;
  overflow: hidden;
  line-height: 1;
}
.odo-strip {
  display: flex;
  flex-direction: column;
  transition: transform 0.6s ease;
  will-change: transform;
}
.odo-cell {
  height: 1em;
  line-height: 1;
}
.odo-sep {
  line-height: 1;
}

/* ---------- Screen 3 : totals ---------- */
.total-screen {
  background: #000 url("/assets/03-high-fives-total.jpeg") center top / 1080px 1920px no-repeat;
}
.total-hifives-block {
  position: absolute;
  left: 80px;
  top: 960px;
  display: flex;
  flex-direction: column;
}
.total-hifives {
  font-size: 190px;
  font-weight: 500;
  color: #fff;
  letter-spacing: 0.02em;
}
.total-kwh-block {
  position: absolute;
  right: 70px;
  top: 1530px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
}
.total-kwh {
  font-size: 170px;
  font-weight: 500;
  color: #fff;
  letter-spacing: 0.02em;
}
.total-label {
  margin-top: 10px;
  font-size: 40px;
  font-weight: 400;
  letter-spacing: 0.22em;
  color: var(--neon);
}
.lb-label {
  font-size: 26px;
  font-weight: 400;
  letter-spacing: 0.28em;
  color: #c9d4c9;
  margin-top: 6px;
}

/* Debug overlay (?debug=1): basic props only, must work on old Chromium. */
.debug-overlay {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 50;
  max-width: 1040px;
  margin: 0;
  padding: 20px;
  background: #000;
  opacity: 0.82;
  color: #7dff5e;
  font-family: monospace;
  font-size: 24px;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-all;
  pointer-events: none;
}
