:root {
  color-scheme: only light;
  --gfx-font: "Bebas Neue", Impact, "Arial Narrow", sans-serif;
  --gfx-ease: cubic-bezier(0.22, 0.72, 0.16, 1);
  --row-pitch: 28px;
  --row-height: 26px;
}

@font-face {
  font-family: "Bebas Neue";
  src: url("/assets/BebasNeue-Regular.otf") format("opentype");
  font-display: block;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: transparent !important; }
body { position: relative; -webkit-font-smoothing: antialiased; }

#canvas { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; overflow: hidden; transform-origin: 0 0; }
body.preview #canvas { background: transparent; }

.graphic-anchor { position: absolute; left: 0; top: 0; transform: translate3d(var(--x), var(--y), 0); transform-origin: 0 0; pointer-events: none; }
.graphic-content { position: relative; visibility: hidden; opacity: 0; }
.graphic-anchor.is-on .graphic-content { visibility: visible; opacity: 1; }
.graphic-content img { position: absolute; display: block; user-select: none; }

.gt-text {
  position: absolute; overflow: hidden; padding-top: 2px;
  color: #fff; font-family: var(--gfx-font); white-space: nowrap; text-transform: uppercase;
}

/* ---------- Left slab (MadSpeed left_slab look, compact rows) ---------- */
.slab-anchor { --x: 17.5px; --y: 119.5px; z-index: 20; }
.slab-content {
  width: 212px;
  height: var(--slab-height, 420px);
  clip-path: inset(-105px 0 calc(100% + 105px) 0);
  transition: clip-path 800ms var(--gfx-ease) 300ms, opacity 0s linear 1100ms, visibility 0s linear 1100ms;
}
.slab-anchor.is-on .slab-content { clip-path: inset(-105px -10px -10px 0); transition: clip-path 800ms var(--gfx-ease); }

.ls-logo { left: 5.5px; top: -104.5px; width: 205px; height: 100px; object-fit: contain; }
.ls-event-box, .ls-flag-box { position: absolute; left: 0; width: 212px; }
.ls-event-box { top: 0; height: 40px; }
.ls-flag-box { top: 42.5px; height: 38px; }
.ls-bg { inset: 0; width: 212px; height: 100%; object-fit: contain; }
.ls-event, .ls-laps { left: 2.5px; top: 0; width: 206px; height: 39px; font-size: 34px; line-height: 37px; text-align: center; }
.ls-flag { position: absolute; inset: 0 2.5px; border-radius: 5px; background: var(--flag-fill, transparent); transition: background 300ms linear; }
.ls-flag-box[data-flag="green"] { --flag-fill: linear-gradient(#00ff00, #00b400); }
.ls-flag-box[data-flag="yellow"] { --flag-fill: linear-gradient(#ffee00, #d6b800); }
.ls-flag-box[data-flag="red"] { --flag-fill: linear-gradient(#ff2a2a, #b80000); }
.ls-flag-box[data-flag="white"] { --flag-fill: linear-gradient(#ffffff, #cfcfcf); }
.ls-flag-box[data-flag="checkered"] { --flag-fill: repeating-conic-gradient(#111 0 25%, #f2f2f2 0 50%) 0 0 / 19px 19px; }
.ls-laps { color: #000; }
.ls-flag-box:is([data-flag=""], [data-flag="red"], [data-flag="checkered"]) .ls-laps { color: #fff; }
.ls-flag-box[data-flag="checkered"] .ls-laps { text-shadow: 0 0 3px #000, 0 0 6px #000; }

.ls-rows { position: absolute; left: 3.5px; top: 83.5px; width: 208px; }
.slab-row {
  position: absolute; left: 0; top: 0; width: 208px; height: var(--row-height);
  opacity: 0;
  transition: transform 600ms var(--gfx-ease), opacity 260ms linear;
}
.slab-row.is-visible { opacity: 1; }
.slab-row .row-bg { left: 0; top: 0; width: 208px; height: var(--row-height); }
.slab-row.is-dnf { opacity: 0.55; }
.slab-cell { top: 1px; height: calc(var(--row-height) - 1px); font-size: 23px; line-height: calc(var(--row-height) - 2px); }
.slab-cell.position { left: -1px; width: 25px; text-align: center; }
.slab-cell.number { left: 29px; width: 34px; color: #000; text-align: center; }
.slab-cell.name { left: 69px; width: 104px; }
.slab-cell.extra { left: 172px; width: 33px; text-align: right; color: #ffb63a; font-size: 19px; }
.slab-row.is-punched .slab-cell.number { animation: punch 500ms ease; }
@keyframes punch { 0% { transform: scale(1.35); } 100% { transform: scale(1); } }

/* ---------- Lineup / results board (MadSpeed lineups look) ---------- */
.board-anchor { --x: 413px; --y: 152px; z-index: 50; }
.board-content { width: 1095px; height: 735px; transition: visibility 0s linear 1000ms; }
.board-anchor.is-on .board-content { transition: none; }
.lu-header, .lu-bg { clip-path: inset(0 50% 0 50%); transition: clip-path 500ms var(--gfx-ease) 200ms; }
.lu-bg { clip-path: inset(50% 50% 50% 50%); }
.board-anchor.is-on :is(.lu-header, .lu-bg) { clip-path: inset(0 0 0 0); transition: clip-path 500ms var(--gfx-ease); }
.lu-text { opacity: 0; transition: opacity 300ms linear; }
.board-anchor.is-on .lu-text { opacity: 1; transition: opacity 500ms linear 500ms; }

.lu-header { position: absolute; inset: 0 0 auto 0; height: 120px; }
.lu-logo-bg, .lu-event-bg, .lu-dist-bg { position: absolute; }
.lu-logo-bg { left: 0; top: 0; width: 243px; height: 120px; background: #d9d9d9; }
.lu-event-bg { left: 243px; top: 0; width: 850px; height: 69px; background: #3075ff; }
.lu-dist-bg { left: 243px; top: 69px; width: 850px; height: 51px; background: #595959; }
.lu-logo { left: 14px; top: 10px; width: 220px; height: 105px; object-fit: contain; }
.lu-event { left: 244px; top: 1px; width: 847px; height: 69px; font-size: 62px; line-height: 67px; text-align: center; }
.lu-dist { left: 244px; top: 72px; width: 847px; height: 46px; font-size: 41px; line-height: 44px; text-align: center; }

.lu-cells { position: absolute; inset: 0; }
.lu-cell { position: absolute; width: 543px; height: 97px; visibility: hidden; }
.lu-cell.is-filled { visibility: visible; }
.lu-bg { position: absolute; left: 0; top: 0; width: 543px; height: 97px; }
.lu-cell .lu-text { position: absolute; inset: 0; }
.lu-number { left: 17px; top: 18px; width: 65px; height: 40px; font-size: 37px; line-height: 38px; color: #000; text-align: center; }
.lu-name { left: 96px; top: 8px; width: 434px; height: 60px; font-size: 54px; line-height: 58px; }
.lu-sub { left: 98px; top: 63px; width: 434px; height: 34px; font-size: 30px; line-height: 32px; color: #d8dde5; }
.lu-place { left: 17px; top: 60px; width: 65px; height: 32px; font-size: 26px; line-height: 30px; text-align: center; color: #ffd24a; }
