:root {
  --bg: #0a0a0b;
  --ink: #f3f2ee;
  --soft: rgba(243, 242, 238, 0.54);
  --line: rgba(243, 242, 238, 0.12);
  --best: #b892ff;
  --up: #3ddc84;
  --down: #ffb020;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Mona Sans Variable", "Mona Sans", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.stage {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 10px 18px;
}

.lt { width: min(312px, 100%); }
.lt__roll { display: block; overflow: hidden; }
.lt__roll > span { display: block; }

.lt__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; height: 18px; font-size: 12px; line-height: 18px; font-weight: 620; color: var(--soft); white-space: nowrap; }
.lt__lap { color: var(--ink); font-weight: 700; }
.lt__lap .lt__roll { height: 18px; }

/* the lap time is the whole scene: it gains weight as the lap goes on */
.lt__clock { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: clamp(2px, 1.400vh, 8px); }
.lt__time { font-size: clamp(42px, 13.500vh, 58px); line-height: 1.02; font-weight: 400; letter-spacing: -0.045em; font-variation-settings: "wght" var(--w, 440), "wdth" 88; white-space: nowrap; transform-origin: 0 70%; }
.lt__time i { display: inline-block; width: 0.560em; font-style: normal; text-align: center; }
.lt__gap { --tone: var(--soft); font-size: 14px; font-weight: 700; color: var(--tone); white-space: nowrap; }
.lt__gap .lt__roll { height: 20px; line-height: 20px; }

.lt__sectors { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: clamp(6px, 2.200vh, 12px); }
.lt__sec { --tone: var(--ink); }
.lt__bar { display: block; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.lt__bar i { display: block; height: 100%; border-radius: 3px; background: var(--tone); transform: scaleX(0); transform-origin: 0 50%; }
.lt__sec-row { display: flex; align-items: baseline; justify-content: space-between; margin-top: 5px; font-size: 11px; line-height: 15px; font-weight: 640; color: var(--soft); }
.lt__sec-row b { font-weight: 700; color: var(--tone); }
.lt__sec.is-best { --tone: var(--best); }
.lt__sec.is-up { --tone: var(--up); }
.lt__sec.is-down { --tone: var(--down); }
.lt__sec.is-idle b { color: var(--soft); }

/* the finished laps: three rows, the newest drops in on top */
.lt__list { position: relative; height: 102px; margin-top: clamp(8px, 2.600vh, 16px); border-top: 1px solid var(--line); }
.lt__row { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 2px; border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 620; white-space: nowrap; cursor: default; }
.lt__row span:first-child { width: 46px; color: var(--soft); }
.lt__row b { font-weight: 400; font-variation-settings: "wght" 640, "wdth" 92; letter-spacing: -0.01em; }
.lt__row em { margin-left: auto; font-style: normal; font-weight: 680; color: var(--soft); }
.lt__row.is-best em { height: 20px; padding: 0 8px; border-radius: 6px; background: color-mix(in srgb, var(--best) 18%, transparent); color: var(--best); line-height: 20px; font-size: 11.5px; }
.lt__row.is-seen { background: linear-gradient(90deg, rgba(243, 242, 238, 0.07), transparent); }
.lt__row.is-seen span:first-child { color: var(--ink); }

.ghost {
  position: fixed;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  pointer-events: none;
  fill: #ffffff;
  stroke: #000000;
  stroke-width: 1.4;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
  opacity: 0;
  visibility: hidden;
  z-index: 5;
}

/* on a large screen the scene is drawn bigger, so the poster and the preview video are not small in a big room */
@media (min-width: 900px) and (min-height: 680px) {
  .lt { zoom: 1.7; }
}
@media (min-width: 1100px) and (min-height: 800px) {
  .lt { zoom: 2.1; }
}
