/* the race viewer: full screen, the course behind, the homepage's pieces over it: white pills and panels, ink
   outlines, Inter for words and Inter Tight for names and numbers, the green-to-purple gradient for what's won. */
.viewer { --acc: #774ad8; --ink: #090319; --glass: rgba(255, 255, 255, 0.92); --glass2: rgba(255, 255, 255, 0.78); --line: rgba(9, 3, 25, 0.1); --dim: #6b6585; --faint: #9a95ae;
  --gold: #e8b32c; --silver: #a9b0c4; --bronze: #c98546; --win: #23a56e; --out: #e5484d; --grad: linear-gradient(90deg, #31c587, #774ad8);
  --sans: 'Inter', system-ui, sans-serif; --disp: 'Inter Tight', 'Inter', system-ui, sans-serif;
  position: fixed; inset: 0; z-index: 40; background: #090319; overflow: hidden; font-family: var(--sans); color: var(--ink); font-variant-numeric: tabular-nums; }
.viewer canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.viewer button { font-family: inherit; cursor: pointer; }
.v-chip { height: 48px; box-sizing: border-box; border-radius: 99px; border: 0; background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 10px 30px -14px rgba(9, 3, 25, 0.6); }

/* top bar */
.v-top { position: absolute; left: 24px; right: 24px; top: 20px; display: flex; align-items: center; gap: 10px; z-index: 6; pointer-events: none; }   /* above the waiting and results screens, so Back always works */
.v-top > * { pointer-events: auto; }
.v-grow { flex: 1; pointer-events: none; }
.v-x { width: 48px; display: grid; place-items: center; color: var(--ink); padding: 0; transition: background .2s, color .2s; }
.v-x:hover { background: var(--ink); color: #fff; }
.v-title { display: flex; flex-direction: column; justify-content: center; gap: 0; padding: 0 22px 0 18px; min-width: 0; }
.v-name { display: flex; align-items: center; gap: 8px; }
.v-name b { font: 800 17px/1.1 var(--disp); letter-spacing: -0.02em; }
.v-live { width: 8px; height: 8px; border-radius: 50%; background: var(--out); box-shadow: 0 0 0 3px rgba(229, 72, 77, 0.2); animation: v-pulse 1.6s ease-in-out infinite; }
.v-live.off { background: var(--faint); box-shadow: none; animation: none; }
@keyframes v-pulse { 50% { box-shadow: 0 0 0 6px rgba(229, 72, 77, 0.04); } }
.v-title small { font: 500 11.5px var(--sans); color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v-clock { display: flex; align-items: baseline; gap: 6px; padding: 0 22px; }
.v-clock b { font: 800 26px/48px var(--disp); letter-spacing: -0.03em; }
.v-clock small { font: 600 10.5px var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--dim); }
.v-cam { display: flex; gap: 2px; padding: 5px; }
.v-cam button { height: 38px; padding: 0 18px; border: 0; border-radius: 99px; background: transparent; color: var(--dim); font: 600 12px var(--sans); text-transform: uppercase; letter-spacing: .04em; }
.v-cam button:hover { color: var(--ink); }
.v-cam button.on { background: var(--ink); color: #fff; }

/* standings: one white pill per marble, slid into place as the order changes */
.v-side { position: absolute; left: 24px; top: 88px; bottom: 90px; width: 300px; display: flex; flex-direction: column; gap: 8px; z-index: 2; }
.v-side-h { display: flex; align-items: center; justify-content: space-between; height: 30px; padding: 0 14px; border-radius: 99px; background: var(--glass2); backdrop-filter: blur(10px); align-self: flex-start; gap: 14px; }
.v-side-h span { font: 700 11px var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink); }
.v-side-h small { font: 500 11px var(--sans); color: var(--dim); }
.v-stand { position: relative; flex: 1; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; mask-image: linear-gradient(180deg, #000 calc(100% - 40px), transparent); -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 40px), transparent); }
.v-stand::-webkit-scrollbar { display: none; }
.v-card { position: absolute; left: 0; right: 0; top: 0; height: 44px; box-sizing: border-box; display: grid; grid-template-columns: 26px 26px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 0 16px 0 12px;
  border-radius: 99px; border: 0; background: var(--glass2); backdrop-filter: blur(10px); color: var(--ink); text-align: left; font: 600 13px var(--sans);
  transition: transform 0.42s cubic-bezier(0.2, 0.9, 0.2, 1), background 0.25s, box-shadow .25s, opacity 0.3s; will-change: transform; }
.v-card:hover { background: #fff; }
.v-card .rk { font: 800 14px var(--disp); color: var(--faint); text-align: center; }
.v-card .ball { width: 26px; height: 26px; justify-self: center; }
.v-card span.ball { border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff 0 10%, var(--c) 38%, color-mix(in srgb, var(--c) 40%, #000) 100%); }
.v-card .nm { display: flex; align-items: center; gap: 6px; min-width: 0; }
.v-card .nm b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.v-card .you { flex: none; padding: 2px 7px; border-radius: 99px; background: var(--ink); color: #fff; font: 700 9.5px var(--sans); letter-spacing: .05em; }
.v-card .gap { display: flex; align-items: center; gap: 5px; font: 700 12.5px var(--disp); color: var(--dim); }
.v-card .gap svg { display: none; }
.v-card.top { background: var(--glass); }
.v-card.p1 .rk { color: var(--gold); } .v-card.p1 .gap { color: var(--ink); }
.v-card.p1 { background: #fff; box-shadow: inset 0 0 0 2px var(--gold); }
.v-card.p2 .rk { color: var(--silver); }
.v-card.p3 .rk { color: var(--bronze); }
.v-card.done .gap { color: var(--win); }
.v-card.out { opacity: 0.6; }
.v-card.out .nm b { text-decoration: line-through; text-decoration-color: rgba(229, 72, 77, 0.6); }
.v-card.out .gap { padding: 2px 8px; border-radius: 99px; background: rgba(229, 72, 77, 0.12); color: var(--out); font: 700 10px var(--sans); letter-spacing: .05em; }
.v-card.me { box-shadow: inset 0 0 0 2px var(--ink); }
.v-card.picked { box-shadow: inset 0 0 0 2px var(--acc); }
.v-card.picked .gap { color: var(--acc); }
.v-card.picked .gap svg { display: block; }

/* right column: what the camera follows, and the finish / out toasts */
.v-right { position: absolute; right: 24px; top: 88px; width: 310px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; z-index: 2; pointer-events: none; }
.v-speed { height: 40px; display: flex; align-items: baseline; gap: 6px; padding: 0 18px; font: 500 12px/40px var(--sans); color: var(--dim); max-width: 100%; }
.v-speed b { font: 800 20px var(--disp); color: var(--ink); }
.v-speed:empty { display: none; }
.v-toasts { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.v-toast { display: grid; grid-template-columns: 40px 26px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 16px 8px 10px; border-radius: 99px; background: var(--glass); backdrop-filter: blur(14px); box-shadow: 0 10px 30px -14px rgba(9, 3, 25, 0.6);
  font: 600 13px var(--sans); animation: t-in 0.5s cubic-bezier(0.2, 1.2, 0.3, 1) both; }
.v-toast.out { animation: t-out 0.45s ease-in both; }
.v-toast .pl { font: 800 14px var(--disp); color: var(--medal, var(--dim)); text-align: center; }
.v-toast .ball { width: 26px; height: 26px; }
.v-toast .who { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.v-toast .who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v-toast .who small { font: 500 11px var(--sans); color: var(--dim); }
.v-toast .tt { font: 700 12px var(--disp); color: var(--dim); }
.v-toast .tt.won { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-size: 13px; }
.v-toast.dead { grid-template-columns: auto 26px minmax(0, 1fr); }
.v-toast.dead .pl { padding: 3px 8px; border-radius: 99px; background: rgba(229, 72, 77, 0.12); color: var(--out); font: 700 10px var(--sans); letter-spacing: .05em; }
.v-toast.me { box-shadow: inset 0 0 0 2px var(--ink), 0 10px 30px -14px rgba(9, 3, 25, 0.6); }
@keyframes t-in { from { transform: translateX(110%); opacity: 0; } }
@keyframes t-out { to { transform: translateX(110%); opacity: 0; } }

/* the course strip along the bottom: a white pill with the field on it */
.v-strip { position: absolute; left: 348px; right: 348px; bottom: 24px; display: flex; flex-direction: column; gap: 6px; z-index: 2; pointer-events: none; padding: 10px 22px 12px; border-radius: 22px; background: var(--glass2); backdrop-filter: blur(10px); }
.v-strip-l { display: flex; justify-content: space-between; font: 700 10.5px var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); }
.v-track { position: relative; height: 22px; }
.v-track .tk-line { position: absolute; left: 0; right: 0; top: 9px; height: 4px; border-radius: 4px; background: rgba(9, 3, 25, 0.1); }
.v-track .tk-fill { position: absolute; left: 0; top: 9px; height: 4px; border-radius: 4px; background: var(--grad); width: 0; transition: width 0.15s linear; }
.v-track .tk-flag { position: absolute; right: -2px; top: 0; width: 14px; height: 22px; border-radius: 3px; background: repeating-conic-gradient(var(--ink) 0 25%, #fff 0 50%) 0 0 / 7px 7px; }
.v-track i { position: absolute; top: 5px; left: 0; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 1.5px #fff; transition: left 0.15s linear; }
.v-track i.lead { top: 2px; width: 18px; height: 18px; margin-left: -9px; box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--gold); z-index: 2; }
.v-track i.me { top: 2px; width: 18px; height: 18px; margin-left: -9px; box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--ink); z-index: 3; }
.v-track i.dead { opacity: 0.25; }

/* tags over the leaders */
.v-tags { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 1; }
.v-tag { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 6px; margin-top: -36px; padding: 3px 11px 3px 3px; border-radius: 999px; background: var(--glass); font: 600 12px var(--sans); color: var(--ink); white-space: nowrap; translate: -50% 0; box-shadow: 0 6px 18px -8px rgba(9, 3, 25, 0.6); }
.v-tag i, .v-tag em { display: grid; place-items: center; width: 21px; height: 21px; border-radius: 50%; background: rgba(9, 3, 25, 0.08); font: 800 11px var(--disp); font-style: normal; }
.v-tag.p1 i, .v-tag.p1 em { background: var(--gold); color: #1a1300; }
.v-tag.p2 i, .v-tag.p2 em { background: var(--silver); color: #fff; }
.v-tag.p3 i, .v-tag.p3 em { background: var(--bronze); color: #fff; }
.v-tag.me { background: var(--ink); color: #fff; }
.v-tag.picked { box-shadow: 0 0 0 2px var(--acc); }

/* the winner */
.v-winner { position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; pointer-events: none; background: radial-gradient(60% 60% at 50% 45%, rgba(9, 3, 25, 0.5), transparent 75%); }
.v-winner.go { animation: v-in 0.4s ease both; }
.v-winner.bye { animation: v-out 0.6s ease both; }
.win { display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; max-width: min(760px, calc(100vw - 32px)); }
.win-k { padding: 8px 18px; border-radius: 99px; background: var(--gold); color: var(--ink); font: 800 12px var(--sans); letter-spacing: 0.3em; }
.win-ball { width: 150px; height: 150px; filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.5)); }
.win h2 { margin: 0; font: 900 84px/0.95 var(--disp); letter-spacing: -0.045em; color: #fff; text-shadow: 0 4px 40px rgba(0, 0, 0, 0.5); overflow-wrap: anywhere; }
.win-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.win-chips span { padding: 9px 18px; border-radius: 99px; background: var(--glass); font: 700 15px var(--disp); }
.win-chips .prize { background: var(--grad); color: #fff; }
.win p { margin: 0; font-size: 15px; color: #fff; text-shadow: 0 2px 16px rgba(0, 0, 0, 0.8); }
.v-winner.go .win-k { animation: w-up 0.5s 0.05s cubic-bezier(0.2, 1, 0.3, 1) both; }
.v-winner.go .win-ball { animation: w-pop 0.8s 0.1s cubic-bezier(0.2, 1.5, 0.35, 1) both; }
.v-winner.go .win h2 { animation: w-up 0.6s 0.3s cubic-bezier(0.2, 1, 0.3, 1) both; }
.v-winner.go .win-chips, .v-winner.go .win p { animation: w-up 0.6s 0.45s cubic-bezier(0.2, 1, 0.3, 1) both; }
@keyframes w-pop { from { transform: scale(0.2); opacity: 0; } }
@keyframes w-up { from { transform: translateY(18px); opacity: 0; } }
@keyframes v-in { from { opacity: 0; } }
@keyframes v-out { to { opacity: 0; } }

/* the podium, and waiting for a race: a white sheet like the homepage */
.v-end, .v-wait { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; overflow-y: auto; padding: 24px; box-sizing: border-box;
  background: rgba(230, 228, 239, 0.86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); animation: v-in 0.5s ease both; }
.pod { width: min(800px, 100%); display: flex; flex-direction: column; gap: 22px; padding: 34px; box-sizing: border-box; border-radius: 26px; background: #fff; box-shadow: 0 40px 100px -40px rgba(9, 3, 25, 0.5); }
.pod-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.pod-h > div { display: flex; flex-direction: column; gap: 6px; }
.pod-k { font: 700 11.5px var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); }
.pod h3 { margin: 0; font: 900 56px/0.95 var(--disp); letter-spacing: -0.04em; }
.pod-pool { align-items: flex-end; }
.pod-pool small { font: 700 11px var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--dim); }
.pod-pool b { font: 900 30px var(--disp); background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pod-pool b em { font-style: normal; font-size: 15px; }
.pod-note { margin: -10px 0 0; font-size: 13.5px; color: var(--dim); }
.pod-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; align-items: end; padding: 6px 6px 0; border-radius: 22px 22px 0 0; background: var(--ink); }
.pod-col { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; padding-top: 18px; }
.pod-col.empty { visibility: hidden; }
.pod-col .crown { padding: 5px 12px; border-radius: 99px; background: var(--gold); color: var(--ink); font: 800 10px var(--sans); letter-spacing: 0.25em; margin-bottom: 6px; }
.pod-ball { width: 66px; height: 66px; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.45)); animation: pd-drop 0.7s calc(var(--d) + 0.45s) cubic-bezier(0.3, 1.5, 0.4, 1) both; }
.pod-col.p1 .pod-ball { width: 92px; height: 92px; }
.pod-w { display: flex; align-items: center; gap: 6px; margin-top: 6px; max-width: 100%; color: #fff; animation: v-in 0.4s calc(var(--d) + 0.7s) both; }
.pod-w b { font: 800 16px var(--disp); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod-col.p1 .pod-w b { font-size: 19px; }
.pod-w .you { padding: 2px 7px; border-radius: 99px; background: #fff; color: var(--ink); font: 700 9.5px var(--sans); }
.pod-t { font: 500 12px var(--sans); color: rgba(255, 255, 255, 0.6); animation: v-in 0.4s calc(var(--d) + 0.75s) both; }
.pod-pz { display: flex; align-items: center; gap: 8px; font: 800 14px var(--disp); color: #7ff0bd; margin-bottom: 12px; animation: v-in 0.4s calc(var(--d) + 0.8s) both; }
.pod-pz .tx { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 99px; border: 1.5px solid rgba(255, 255, 255, 0.7); color: #fff; font: 700 10.5px var(--sans); letter-spacing: .04em; text-decoration: none; }
.pod-pz .tx:hover { background: #fff; color: var(--ink); }
.pod-pz small { color: rgba(255, 255, 255, 0.6); font-weight: 500; }
.pod-block { width: 100%; box-sizing: border-box; border-radius: 18px 18px 0 0; display: flex; flex-direction: column; align-items: center; padding-top: 16px; gap: 2px; transform-origin: bottom; animation: pd-rise 0.7s var(--d) cubic-bezier(0.2, 1.1, 0.3, 1) both; background: #f4f3f8; }
.pod-block b { font: 900 48px/1 var(--disp); letter-spacing: -.04em; }
.pod-block small { font: 700 11px var(--sans); letter-spacing: 0.08em; color: var(--dim); }
.pod-col.p1 .pod-block { height: 190px; padding-top: 18px; } .pod-col.p1 .pod-block b { font-size: 64px; color: var(--gold); }
.pod-col.p2 .pod-block { height: 140px; } .pod-col.p2 .pod-block b { color: var(--silver); }
.pod-col.p3 .pod-block { height: 110px; padding-top: 14px; } .pod-col.p3 .pod-block b { font-size: 42px; color: var(--bronze); }
@keyframes pd-rise { from { transform: scaleY(0); } }
@keyframes pd-drop { from { transform: translateY(-110px) scale(0.6); opacity: 0; } }
.pod-rows { display: flex; flex-direction: column; gap: 6px; }
.pod-row { display: grid; grid-template-columns: 32px 26px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; height: 48px; padding: 0 18px; border-radius: 99px; background: #f4f3f8; font: 600 14px var(--sans); animation: w-up 0.5s 1.2s both; }
.pod-row .rk { font: 800 14px var(--disp); color: var(--dim); }
.pod-row .ball { width: 26px; height: 26px; }
.pod-row .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod-row .t { font-weight: 500; font-size: 12px; color: var(--dim); }
.pod-row .pz { font: 800 13px var(--disp); color: var(--win); }
.pod-row.me { box-shadow: inset 0 0 0 2px var(--ink); }
.pod-acts { display: flex; align-items: center; gap: 10px; }
.pod-acts button { height: 50px; padding: 0 30px; border-radius: 99px; font: 600 15px var(--sans); border: 0; background: var(--grad); color: #fff; box-shadow: 0 14px 28px -14px rgba(119, 74, 216, 0.8); }
.pod-acts button.ghost { border: 1.5px solid var(--ink); background: transparent; color: var(--ink); box-shadow: none; }
.pod-acts button.ghost:hover { background: var(--ink); color: #fff; }
.pod-acts .next { margin-left: auto; font: 500 13px var(--sans); color: var(--dim); }
.pod-acts .next b { color: var(--ink); font: 800 16px var(--disp); }
.v-wait .pod { width: min(560px, 100%); gap: 14px; }
.v-wait p { margin: 0; color: var(--dim); font-size: 15px; }

/* phone: standings become a sheet along the bottom, the camera switch sits in it */
@media (max-width: 760px) {
  .v-top { left: 12px; right: 12px; top: 12px; gap: 6px; }
  .v-title { flex: 1; padding: 0 14px; }
  .v-grow { display: none; }
  .v-clock { padding: 0 14px; }
  .v-clock b { font-size: 20px; }
  .v-clock small { display: none; }
  .v-cam { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 4; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); height: 50px; }
  .v-cam button { height: 40px; }
  .v-side { left: 0; right: 0; top: auto; bottom: 0; width: auto; height: 300px; padding: 12px 12px 74px; box-sizing: border-box; border-radius: 24px 24px 0 0; background: rgba(230, 228, 239, 0.94); backdrop-filter: blur(14px); }
  .v-side-h { background: transparent; } .v-side-h small { display: none; }
  .v-right { top: 72px; right: 12px; width: min(290px, calc(100vw - 24px)); }
  .v-speed { display: none; }
  .v-strip { left: 12px; right: 12px; bottom: 310px; padding: 8px 14px; }
  .v-strip-l { display: none; }
  .win h2 { font-size: 44px; }
  .win-ball { width: 96px; height: 96px; }
  .pod { padding: 22px 16px; } .pod h3 { font-size: 38px; }
  .pod-col.p1 .pod-block { height: 140px; } .pod-col.p2 .pod-block { height: 104px; } .pod-col.p3 .pod-block { height: 84px; }
  .pod-w b { font-size: 13px; } .pod-col.p1 .pod-w b { font-size: 14px; } .pod-pz { flex-direction: column; gap: 4px; }
  .pod-row { grid-template-columns: 24px 24px minmax(0, 1fr) auto; } .pod-row .t { display: none; }
  .pod-acts { flex-wrap: wrap; } .pod-acts .next { margin-left: 0; width: 100%; }
}

/* while the course's shaders compile: a spinner in the middle */
.viewer.warming::after { content: ""; position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; margin: -24px 0 0 -24px; border-radius: 50%; border: 3px solid rgba(255,255,255,.2); border-top-color: #31c587; animation: vspin .8s linear infinite; z-index: 4; }
@keyframes vspin { to { transform: rotate(360deg); } }
