:root { color-scheme: light; --ink: #303137; --green: #bf0b22; --muted: #6d737b; --paper: #fffafa; --yellow: #f3ca48; --grey-jersey: #98a0a8; }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: radial-gradient(circle at 15% 0, #f6e9ec 0, transparent 40%), var(--paper); color: var(--ink); font-family: "Segoe UI", system-ui, sans-serif; }
body.is-race-expanded { overflow: hidden; }
a { color: var(--green); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #d29812; outline-offset: 4px; }
[hidden] { display: none !important; }
.wrap { width: min(1160px, calc(100% - 64px)); margin-inline: auto; }
.site-header { display: flex; justify-content: space-between; align-items: center; min-height: 100px; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 750; font-size: 27px; letter-spacing: -1px; }
.eden-logo { display: block; width: 105px; height: auto; }
.brand-divider { margin-inline: 8px; font-weight: 300; color: #a8b4a9; }
.brand-event { font-size: 15px; letter-spacing: 0; font-weight: 500; }
.admin-link { font-size: 13px; font-weight: 650; text-decoration: none; white-space: nowrap; }
.tracker-header { min-height: 64px; }
.dashboard { height: calc(100svh - 96px); min-height: 540px; display: flex; flex-direction: column; gap: 12px; padding-bottom: 12px; }
.eyebrow { margin: 0 0 16px; color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: 1.8px; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(36px, 4.5vw, 61px); line-height: 1.08; font-weight: 750; letter-spacing: -2.5px; }
h1 span { color: var(--green); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 22px; border: 0; padding: 14px 22px; border-radius: 9px; background: var(--green); color: white; text-decoration: none; font-size: 14px; font-weight: 650; cursor: pointer; }
.button:hover { background: #91071a; }
.goal-panel { flex: none; border: 1px solid #dce5da; border-radius: 16px; background: white; padding: 16px 24px; }
.goal-heading, .goal-footer, .section-heading, .site-footer { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.goal-heading { margin-bottom: 10px; }
.dashboard h1 { font-size: 25px; letter-spacing: -.8px; }
.campaign-heading { display: grid; grid-template-columns: 42% 1fr; align-items: center; gap: 24px; padding-bottom: 12px; margin-bottom: 10px; border-bottom: 1px solid #efdee0; }
.campaign-art { display: block; width: 100%; height: auto; border-radius: 9px; }
.campaign-copy h1 { margin: 5px 0 7px; color: #bf0b22; }
.campaign-copy p { margin: 0; font-size: 12px; line-height: 1.5; color: var(--muted); }
.campaign-copy .campaign-dates { color: #286348; font-weight: 750; font-size: 11px; }
.goal-heading h2 { font-size: 18px; letter-spacing: -.4px; }
.goal-heading h2 span { color: #bf0b22; }
.goal-number { margin: 0; font-size: 34px; line-height: 1; font-weight: 750; letter-spacing: -1px; text-align: right; }
.goal-number > span:last-child { font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
progress { display: block; width: 100%; height: 8px; border: 0; border-radius: 20px; overflow: hidden; background: #edf1e9; accent-color: var(--green); }
progress::-webkit-progress-bar { background: #edf1e9; border-radius: 20px; }
progress::-webkit-progress-value { background: var(--green); border-radius: 20px; transition: width 1s ease; }
progress::-moz-progress-bar { background: var(--green); border-radius: 20px; }
.goal-footer { margin-top: 7px; color: var(--muted); font-size: 11px; }
.goal-footer span:last-child { color: var(--green); font-weight: 750; }
.celebration { margin: 10px 0 0; padding: 8px 12px; border-radius: 8px; background: #fff3c4; font-size: 12px; font-weight: 650; }
.peloton { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 18px; border: 1px solid #dae3e8; border-radius: 18px; background: radial-gradient(circle at 12% 20%, #ffffffb3 0 10px, transparent 11px), radial-gradient(circle at 90% 12%, #ffffffa6 0 16px, transparent 17px), #f0f5f7; }
h2 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -.9px; }
.section-heading h2 { font-size: 23px; }
.race-controls { display: flex; align-items: center; gap: 12px; }
.view-button { display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; border: 1px solid #b8c9ce; border-radius: 8px; background: white; color: var(--ink); font-size: 11px; font-weight: 650; white-space: nowrap; cursor: pointer; }
.view-button:hover { background: #e9f0f3; }
.view-button:disabled { opacity: .6; cursor: wait; }
.view-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.collapse-icon { display: none; }
.is-expanded .expand-icon { display: none; }
.is-expanded .collapse-icon { display: inline; }
.view-status { flex: none; margin: 8px 0 0; font-size: 11px; line-height: 1.4; color: #994e25; }
.peloton.is-expanded { position: fixed; inset: 0; z-index: 2000; width: 100%; height: 100dvh; margin: 0; padding: 24px; border: 0; border-radius: 0; overflow-y: auto; }
.peloton.is-expanded .road-stage { --bike-width: clamp(110px, 13vw, 180px); --road-center: 62%; --road-depth: 230px; --label-clearance: 40px; min-height: 420px; max-height: 58dvh; }
.peloton.is-expanded .winter-hills { --scene-width: 1540px; --scene-duration: 112s; height: 252px; bottom: calc(100% - var(--road-center) + 50px); }
.peloton.is-expanded .winter-village { --scene-width: 3300px; --scene-duration: 96s; height: 225px; bottom: calc(100% - var(--road-center) + 48px); }
.fullscreen-summary { display: none; flex: none; width: min(960px, 100%); margin: 12px auto 0; padding: 18px 24px; border: 1px solid #d6e1e6; border-radius: 14px; background: white; text-align: center; }
.is-expanded .fullscreen-summary { display: block; }
.fullscreen-summary h3 { margin: 0; color: var(--ink); font-size: 16px; font-weight: 650; }
.fullscreen-total { margin: 4px 0 0; font-size: clamp(32px, 4vw, 54px); line-height: 1.1; color: var(--green); }
.fullscreen-total span { font-size: 16px; color: var(--muted); }
.fullscreen-summary progress { height: 16px; margin-top: 12px; }
.fullscreen-goal-footer { font-size: 12px; }
.encouragement { display: flex; align-items: center; justify-content: center; height: 42px; margin: 12px 0 0; padding: 8px 12px; border-radius: 8px; background: #fff3c4; color: #7d6322; font-size: 15px; line-height: 1.4; font-weight: 650; }
.live-status { margin: 0; max-width: 320px; color: var(--muted); font-size: 11px; line-height: 1.6; text-align: right; }
.live-status::before { content: ""; display: inline-block; margin-right: 7px; width: 6px; height: 6px; border-radius: 100%; background: #408861; }
.live-status.is-stale { color: #994e25; }
.live-status.is-stale::before { background: #c46b37; }
.race-legend { display: flex; justify-content: space-between; gap: 16px; margin-top: 8px; font-size: 10px; color: var(--muted); }
.jersey-swatch { display: inline-block; height: 12px; width: 12px; border-radius: 3px; background: var(--yellow); vertical-align: -2px; margin-right: 5px; }
.jersey-swatch-grey { background: var(--grey-jersey); }
.starting-message { font-size: 11px; padding: 7px 12px; background: #e2ebdb; border-radius: 8px; margin: 8px 0 0; }
.road-stage { --bike-width: clamp(84px, 11vw, 130px); --road-center: 50%; --road-depth: 120px; --label-clearance: 6px; flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column; isolation: isolate; }
.winter-scene { position: absolute; z-index: 0; inset: 12px 0 0; overflow: hidden; pointer-events: none; }
.winter-layer { position: absolute; left: 0; width: calc(100% + var(--scene-width)); background-repeat: repeat-x; background-size: var(--scene-width) 100%; animation: winter-parallax var(--scene-duration) linear infinite; will-change: transform; }
.winter-hills { --scene-width: 1100px; --scene-duration: 80s; height: 180px; bottom: calc(100% - var(--road-center) + 25px); background-image: url("winter-hills.svg"); }
.winter-village { --scene-width: 2200px; --scene-duration: 64s; height: 150px; bottom: calc(100% - var(--road-center) - 8px); background-image: url("winter-village.svg"); }
.winter-foreground { position: absolute; z-index: 1000; top: calc(var(--road-center) - 20px); left: 0; right: 0; height: 120px; overflow: hidden; pointer-events: none; }
.winter-foreground .winter-layer { --scene-width: 1800px; --scene-duration: 18s; height: 100%; background-image: url("winter-festivities.svg"); }
.snowfall { position: absolute; z-index: 1000; inset: 0; overflow: hidden; pointer-events: none; }
.ceo-viewport { position: absolute; z-index: 2000; inset: 0; overflow: hidden; pointer-events: none; }
.ceo-cameo { position: absolute; width: 132px; pointer-events: none; transform-origin: var(--cameo-origin, 0% 100%); transform: rotate(var(--cameo-lean-angle, 12deg)); }
.ceo-figure { position: relative; transform-origin: 50% 100%; transform: scaleX(var(--cameo-flip, 1)); }
.ceo-cameo img, .ceo-figure > svg { display: block; width: 100%; height: auto; }
.ceo-cameo .ceo-head { position: absolute; left: 21.5%; top: 0; width: 50%; }
.ceo-body .wave-arm { transform-origin: 139px 151px; animation: ceo-wave .42s steps(2, end) infinite alternate; }
.ceo-body .ceo-rest-arm { transform-origin: 52px 168px; }
.ceo-body .ceo-leg { transform-origin: 111px 218px; }
.ceo-body .ceo-leg-back { transform-origin: 75px 218px; }
.ceo-body .ceo-knee { transform-origin: 111px 262px; }
.ceo-body .ceo-leg-back .ceo-knee { transform-origin: 75px 262px; }
.ceo-cameo.is-visible { animation: ceo-lean 2s steps(3, end) both; }
.ceo-cameo.is-visible .ceo-figure { animation: ceo-bob .24s steps(2, end) infinite alternate; }
.ceo-cameo.is-running { --cameo-bob-angle: 3deg; --cameo-bob-lift: -5px; transform: none; animation: ceo-run-past var(--cameo-run-duration, 3.5s) linear both; }
.ceo-cameo.is-running .ceo-figure { animation: ceo-bob .18s steps(2, end) infinite alternate; }
.ceo-cameo.is-running .ceo-running-legs, .ceo-cameo.is-waiting .ceo-running-legs { display: inline; }
.ceo-cameo.is-running .ceo-snow-base, .ceo-cameo.is-waiting .ceo-snow-base { display: none; }
.ceo-cameo.is-running .ceo-leg { animation: ceo-stride .36s steps(2, end) infinite; }
.ceo-cameo.is-running .ceo-knee { animation: ceo-running-knee .36s steps(2, end) infinite; }
.ceo-cameo.is-running .ceo-leg-back, .ceo-cameo.is-running .ceo-leg-back .ceo-knee { animation-delay: -.18s; }
.ceo-cameo.is-running .wave-arm { animation: ceo-wave .18s steps(2, end) infinite alternate; }
.ceo-cameo.is-running .ceo-rest-arm { animation: ceo-running-other-arm .18s steps(2, end) infinite alternate; }
.ceo-cameo.is-waiting { transform: translateX(-50%); }
.ceo-cameo.is-waiting .wave-arm { display: none; }
.ceo-cameo.is-waiting .ceo-watch-arm, .ceo-cameo.is-waiting .ceo-waiting-shadow { display: inline; }
.ceo-cameo.is-waiting .ceo-watch-forearm { transform-origin: 152px 184px; transform: rotate(70deg); animation: ceo-check-watch 4.8s ease-in-out infinite; }
.ceo-cameo.is-waiting .ceo-head { transform-origin: 50% 80%; transform: rotate(12deg); animation: ceo-watch-glance 4.8s ease-in-out infinite; }
.ceo-cameo.is-waiting .ceo-leg:not(.ceo-leg-back) .ceo-foot { transform-origin: 105px 306px; animation: ceo-foot-tap .6s ease-in-out infinite; }
.snowfall::before, .snowfall::after { content: ""; position: absolute; inset: -600px -200px 0 0; background-image: radial-gradient(2px 2px at 25px 35px, white 98%, transparent), radial-gradient(2px 2px at 130px 75px, white 98%, transparent), radial-gradient(1px 1px at 80px 140px, white 98%, transparent), radial-gradient(2px 2px at 175px 180px, white 98%, transparent), radial-gradient(1px 1px at 55px 195px, white 98%, transparent); background-size: 200px 200px; opacity: .65; animation: snowfall-far 30s linear infinite; will-change: transform; }
.snowfall::after { inset: -720px -240px 0 0; background-image: radial-gradient(3px 3px at 65px 30px, white 98%, transparent), radial-gradient(2px 2px at 170px 120px, white 98%, transparent), radial-gradient(3px 3px at 110px 205px, white 98%, transparent); background-size: 240px 240px; opacity: .6; animation: snowfall-near 20s linear infinite; }
.road-stage:not(:has(.rider)) .winter-layer { animation-play-state: paused; }
.race-list { --bike-height: 40px; flex: 1; min-height: 0; padding: 0; margin: 12px 32px 0; list-style: none; position: relative; display: flex; flex-direction: row-reverse; }
.race-list::before { content: ""; position: absolute; z-index: 1; left: -32px; right: -32px; top: calc(var(--road-center) - var(--road-depth) / 2 + 16px); height: var(--road-depth); background: url("road-wave.svg") center / 100% 100% no-repeat; }
.rider { position: relative; flex: 0 1 100%; max-width: 16.666667%; min-width: 0; min-height: 0; }
.rider.is-reordering { z-index: 1100; }
.rider::before { content: ""; position: absolute; z-index: 1001; left: 50%; top: max(calc(var(--road-center) - var(--bike-height) - var(--label-clearance)), 64px); bottom: calc(100% - var(--road-center) + var(--bike-height) - 18px - var(--lane-offset, 0px)); width: 1px; background: #9aac9b; }
.rider-identity { position: absolute; z-index: 1100; left: 50%; bottom: min(calc(100% - var(--road-center) + var(--bike-height) + var(--label-clearance)), calc(100% - 64px)); transform: translateX(-50%); width: var(--label-width, 80px); padding: 5px; border: 1px solid #dce4d5; border-radius: 9px; background: white; text-align: center; }
.is-leader .rider-identity { border-color: #d8bc59; background: #fff9e3; }
.rank { position: absolute; top: -7px; left: -6px; min-width: 17px; padding: 2px; border-radius: 20px; background: #e0e9da; font-size: 10px; font-weight: 650; color: #63796a; }
.is-leader .rank { color: #a07914; }
.rider-name { margin: 0; font-size: 10px; line-height: 1.2; font-weight: 650; overflow-wrap: anywhere; }
.rider-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.is-leader .rider-label { color: #89690f; }
.lane { position: absolute; z-index: var(--rider-depth, 2); left: 0; right: 0; bottom: calc(100% - var(--road-center) - 10px - var(--lane-offset, 0px)); display: flex; justify-content: center; }
.bike { flex: none; width: var(--bike-width, 110px); aspect-ratio: 180 / 138; }
.bike svg { display: block; width: 100%; height: auto; }
.rider:nth-child(even)::before { top: calc(var(--road-center) + 5px + var(--lane-offset, 0px)); bottom: calc(85% - var(--road-center)); }
.rider:nth-child(even) .rider-identity { top: calc(var(--road-center) + 15%); bottom: auto; }
.is-leader { --jersey: var(--yellow); }
.rider:last-child:not(.is-leader) { --jersey: var(--grey-jersey); --tears-display: inline; }
.jersey { fill: var(--jersey, #bf0b22); }
.rider-tears { display: var(--tears-display, none); }
.tear-drop { animation: tear-fall 1.1s ease-in infinite; }
.tear-drop-late { animation-delay: -.55s; }
.rear-wheel { transform-origin: 38px 98px; }
.front-wheel { transform-origin: 139px 98px; }
.rear-wheel, .front-wheel { animation: spin calc(var(--pedal-duration, 1.6s) * 1.2) linear infinite; animation-play-state: var(--ride-state, paused); }
.is-moving { --ride-state: running; }
.crank { transform-origin: 93px 98px; animation: spin var(--pedal-duration, 1.6s) linear infinite; animation-play-state: var(--ride-state, paused); }
.rider:first-child { --hip-x: 93px; --hip-y: 45px; --body-x: 20px; --body-y: -6px; --arm-display: none; --standing-arm-display: inline; --thigh-keyframes: standing-thigh; --calf-keyframes: standing-calf; --shoe-keyframes: standing-shoe; --near-thigh-angle: 44.07deg; --near-calf-angle: 67.24deg; --near-shoe-angle: -111.31deg; --far-thigh-angle: 67.52deg; --far-calf-angle: 67.24deg; --far-shoe-angle: -134.76deg; }
.leg-origin { transform: translate(var(--hip-x, 73px), var(--hip-y, 51px)); }
.rider-body { transform: translate(var(--body-x, 0px), var(--body-y, 0px)); }
.rider-arm { display: var(--arm-display, inline); }
.standing-arm { display: var(--standing-arm-display, none); }
.far-leg { --pedal-delay: calc(var(--pedal-duration, 1.6s) * -.5); --thigh-angle: var(--far-thigh-angle, 35.75deg); --calf-angle: var(--far-calf-angle, 85.19deg); --shoe-angle: var(--far-shoe-angle, -120.95deg); }
.leg-thigh, .leg-calf, .leg-shoe {
    transform-origin: 0 0;
    animation-duration: var(--pedal-duration, 1.6s);
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    animation-delay: var(--pedal-delay, 0s);
    animation-play-state: var(--ride-state, paused);
}
.leg-thigh { transform: rotate(var(--thigh-angle, var(--near-thigh-angle, 26.10deg))); animation-name: var(--thigh-keyframes, pedal-thigh); }
.leg-calf { transform: rotate(var(--calf-angle, var(--near-calf-angle, 59.97deg))); animation-name: var(--calf-keyframes, pedal-calf); }
.leg-shoe { transform: rotate(var(--shoe-angle, var(--near-shoe-angle, -86.07deg))); animation-name: var(--shoe-keyframes, pedal-shoe); }
.rider-distance { margin-top: 3px; font-size: 11px; line-height: 1; }
.rider-distance strong { font-size: 11px; font-weight: 750; }
.rider-distance span { margin-left: 3px; font-size: 9px; color: var(--muted); }
.svg-definitions { position: absolute; width: 0; height: 0; overflow: hidden; }
.site-footer { border-top: 1px solid #dce2d7; min-height: 85px; color: var(--muted); font-size: 11px; }
.tracker-footer { min-height: 32px; font-size: 10px; }
.notice { padding: 20px; border-radius: 12px; background: #e5efe3; margin: 20px 0; line-height: 1.6; }
.notice.error { background: #fff0eb; color: #943f26; }
.admin-main { padding-bottom: 60px; }
.admin-title { padding: 30px 0; }
.admin-title h1 { font-size: 40px; }
.admin-title p { color: var(--muted); line-height: 1.6; }
.panel { padding: 28px; border: 1px solid #dce5da; border-radius: 14px; background: white; margin-bottom: 24px; }
.panel h2 { margin-bottom: 20px; font-size: 23px; }
.mileage-form { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
label { display: grid; gap: 8px; font-size: 13px; font-weight: 650; }
input, select, textarea { min-width: 0; width: 100%; padding: 12px; border: 1px solid #bdcdbf; border-radius: 7px; background: white; color: var(--ink); font-weight: 400; }
textarea { resize: vertical; }
.full-width { grid-column: 1 / -1; }
.form-actions { display: flex; align-items: center; gap: 18px; }
.form-hint { margin: 0; font-size: 12px; line-height: 1.6; color: var(--muted); }
.signout { margin: 0; }
.signout button { border: 0; background: transparent; color: var(--green); text-decoration: underline; cursor: pointer; }
.entry { padding: 22px 0; border-top: 1px solid #e3e9de; }
.entry-head { display: flex; justify-content: space-between; gap: 20px; }
.entry-head h3 { margin: 0 0 8px; font-size: 16px; }
.entry-head p { margin: 0; color: var(--muted); font-size: 11px; }
.entry-head strong { white-space: nowrap; }
details { margin-top: 16px; }
summary { font-size: 13px; color: var(--green); cursor: pointer; }
.correction-form { display: grid; grid-template-columns: 1fr 2fr; gap: 16px; padding-top: 18px; }
.history { padding-left: 20px; font-size: 12px; line-height: 1.7; color: var(--muted); }
.history li { margin: 12px 0; }
.history p { margin: 3px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.pagination { display: flex; gap: 24px; align-items: center; justify-content: center; font-size: 13px; margin-top: 24px; }
.site-list { padding: 16px 20px; }
.site-list h2 { margin-bottom: 8px; }
.site-list > .form-hint { margin-bottom: 12px; }
.site-group { padding: 8px 0; border-top: 1px solid #e3e9de; scroll-margin-top: 12px; }
.site-total-form { display: grid; grid-template-columns: minmax(140px, 1fr) 112px minmax(160px, 2fr) 64px 78px; align-items: end; gap: 12px; }
.site-name { align-self: center; }
.site-name h3 { margin: 0; font-size: 14px; line-height: 1.3; }
.site-name p { margin: 3px 0 0; font-size: 11px; color: var(--muted); }
.site-total-form label { gap: 3px; font-size: 11px; }
.site-total-form input { padding: 6px 8px; font-size: 13px; }
.total-field input { text-align: right; }
.site-total-form .button { padding: 7px 10px; font-size: 12px; }
.history-link { align-self: center; font-size: 12px; white-space: nowrap; }
.site-history { margin-top: 8px; padding: 10px 12px; border-radius: 8px; background: #f7f9f5; }
.history-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.history-heading h4 { margin: 0; font-size: 13px; }
.history-heading a { font-size: 12px; }
.site-history > .form-hint { margin: 6px 0 8px; }
.history-entry { margin: 0; border-top: 1px solid #e3e9de; }
.history-entry > summary { display: grid; grid-template-columns: minmax(150px, 1fr) 1fr; gap: 12px; padding: 7px 0; font-size: 12px; }
.history-entry > summary span { color: var(--muted); font-size: 11px; }
.site-history .pagination { margin-top: 12px; gap: 16px; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes winter-parallax { to { transform: translateX(calc(-1 * var(--scene-width))); } }
@keyframes snowfall-far { to { transform: translate(-200px, 600px); } }
@keyframes snowfall-near { to { transform: translate(-240px, 720px); } }
@keyframes ceo-lean {
    0%, 100% { opacity: 0; transform: rotate(var(--cameo-out-angle, -28deg)); }
    12%, 90% { opacity: 0; transform: rotate(0); }
    20% { opacity: 1; transform: rotate(var(--cameo-overshoot-angle, 22deg)); }
    35%, 80% { opacity: 1; transform: rotate(var(--cameo-lean-angle, 12deg)); }
}
@keyframes ceo-bob {
    from { transform: scaleX(var(--cameo-flip, 1)) rotate(calc(-1 * var(--cameo-bob-angle, .6deg))); }
    to { transform: scaleX(var(--cameo-flip, 1)) translateY(var(--cameo-bob-lift, 1px)) rotate(var(--cameo-bob-angle, .6deg)); }
}
@keyframes ceo-wave {
    from { transform: rotate(-8deg); }
    to { transform: rotate(12deg); }
}
@keyframes ceo-run-past {
    from { transform: translateX(var(--cameo-run-start)); }
    to { transform: translateX(var(--cameo-run-end)); }
}
@keyframes ceo-stride {
    0%, 100% { transform: rotate(-28deg); }
    50% { transform: rotate(28deg); }
}
@keyframes ceo-running-knee {
    0%, 100% { transform: rotate(5deg); }
    25% { transform: rotate(10deg); }
    50% { transform: rotate(60deg); }
    75% { transform: rotate(25deg); }
}
@keyframes ceo-running-other-arm {
    from { transform: rotate(-15deg); }
    to { transform: rotate(10deg); }
}
@keyframes ceo-check-watch {
    0%, 15%, 80%, 100% { transform: rotate(0); }
    30%, 65% { transform: rotate(70deg); }
}
@keyframes ceo-watch-glance {
    0%, 20%, 75%, 100% { transform: rotate(0); }
    35%, 60% { transform: rotate(12deg); }
}
@keyframes ceo-foot-tap {
    0%, 55%, 100% { transform: rotate(0); }
    25% { transform: rotate(-18deg); }
}
@keyframes tear-fall {
    0% { opacity: 0; transform: translateY(0); }
    20% { opacity: 1; }
    100% { opacity: 0; transform: translateY(12px); }
}
/* Joint angles keep 32px thighs and 33px calves connected to the 11px pedal orbit. */
@keyframes pedal-thigh {
    0%, 100% { transform: rotate(26.10deg); }
    6.25% { transform: rotate(35.22deg); }
    12.5% { transform: rotate(43.69deg); }
    18.75% { transform: rotate(49.53deg); }
    25% { transform: rotate(51.38deg); }
    31.25% { transform: rotate(49.99deg); }
    37.5% { transform: rotate(46.61deg); }
    43.75% { transform: rotate(41.81deg); }
    50% { transform: rotate(35.75deg); }
    56.25% { transform: rotate(28.58deg); }
    62.5% { transform: rotate(20.80deg); }
    68.75% { transform: rotate(13.73deg); }
    75% { transform: rotate(9.18deg); }
    81.25% { transform: rotate(8.42deg); }
    87.5% { transform: rotate(11.57deg); }
    93.75% { transform: rotate(17.82deg); }
}
@keyframes pedal-calf {
    0%, 100% { transform: rotate(59.97deg); }
    6.25% { transform: rotate(47.78deg); }
    12.5% { transform: rotate(38.22deg); }
    18.75% { transform: rotate(34.49deg); }
    25% { transform: rotate(38.58deg); }
    31.25% { transform: rotate(48.34deg); }
    37.5% { transform: rotate(60.59deg); }
    43.75% { transform: rotate(73.32deg); }
    50% { transform: rotate(85.19deg); }
    56.25% { transform: rotate(95.03deg); }
    62.5% { transform: rotate(101.62deg); }
    68.75% { transform: rotate(103.88deg); }
    75% { transform: rotate(101.39deg); }
    81.25% { transform: rotate(94.61deg); }
    87.5% { transform: rotate(84.65deg); }
    93.75% { transform: rotate(72.71deg); }
}
@keyframes pedal-shoe {
    0%, 100% { transform: rotate(-86.07deg); }
    6.25% { transform: rotate(-83.00deg); }
    12.5% { transform: rotate(-81.91deg); }
    18.75% { transform: rotate(-84.02deg); }
    25% { transform: rotate(-89.96deg); }
    31.25% { transform: rotate(-98.33deg); }
    37.5% { transform: rotate(-107.20deg); }
    43.75% { transform: rotate(-115.13deg); }
    50% { transform: rotate(-120.95deg); }
    56.25% { transform: rotate(-123.61deg); }
    62.5% { transform: rotate(-122.42deg); }
    68.75% { transform: rotate(-117.61deg); }
    75% { transform: rotate(-110.56deg); }
    81.25% { transform: rotate(-103.04deg); }
    87.5% { transform: rotate(-96.21deg); }
    93.75% { transform: rotate(-90.53deg); }
}
@keyframes standing-thigh {
    0%, 100% { transform: rotate(44.07deg); }
    6.25% { transform: rotate(52.85deg); }
    12.5% { transform: rotate(62.90deg); }
    18.75% { transform: rotate(72.86deg); }
    25% { transform: rotate(79.78deg); }
    31.25% { transform: rotate(80.48deg); }
    37.5% { transform: rotate(77.48deg); }
    43.75% { transform: rotate(73.00deg); }
    50% { transform: rotate(67.52deg); }
    56.25% { transform: rotate(61.08deg); }
    62.5% { transform: rotate(53.77deg); }
    68.75% { transform: rotate(46.08deg); }
    75% { transform: rotate(39.20deg); }
    81.25% { transform: rotate(34.85deg); }
    87.5% { transform: rotate(34.25deg); }
    93.75% { transform: rotate(37.55deg); }
}
@keyframes standing-calf {
    0%, 100% { transform: rotate(67.24deg); }
    6.25% { transform: rotate(53.27deg); }
    12.5% { transform: rotate(38.99deg); }
    18.75% { transform: rotate(26.25deg); }
    25% { transform: rotate(20.13deg); }
    31.25% { transform: rotate(26.25deg); }
    37.5% { transform: rotate(38.99deg); }
    43.75% { transform: rotate(53.27deg); }
    50% { transform: rotate(67.24deg); }
    56.25% { transform: rotate(79.89deg); }
    62.5% { transform: rotate(90.20deg); }
    68.75% { transform: rotate(97.08deg); }
    75% { transform: rotate(99.51deg); }
    81.25% { transform: rotate(97.08deg); }
    87.5% { transform: rotate(90.20deg); }
    93.75% { transform: rotate(79.89deg); }
}
@keyframes standing-shoe {
    0%, 100% { transform: rotate(-111.31deg); }
    6.25% { transform: rotate(-106.12deg); }
    12.5% { transform: rotate(-101.89deg); }
    18.75% { transform: rotate(-99.11deg); }
    25% { transform: rotate(-99.91deg); }
    31.25% { transform: rotate(-106.73deg); }
    37.5% { transform: rotate(-116.48deg); }
    43.75% { transform: rotate(-126.26deg); }
    50% { transform: rotate(-134.76deg); }
    56.25% { transform: rotate(-140.97deg); }
    62.5% { transform: rotate(-143.98deg); }
    68.75% { transform: rotate(-143.15deg); }
    75% { transform: rotate(-138.71deg); }
    81.25% { transform: rotate(-131.93deg); }
    87.5% { transform: rotate(-124.46deg); }
    93.75% { transform: rotate(-117.44deg); }
}
@media (max-width: 900px) {
    .rider-name { font-size: 9px; }
    .live-status { max-width: 200px; }
}
@media (max-width: 720px) {
    .site-list { padding: 12px; }
    .site-total-form { grid-template-columns: minmax(0, 1fr) 96px 64px; gap: 8px; }
    .site-total-form .site-name { grid-column: 1; grid-row: 1; }
    .site-total-form .total-field { grid-column: 2; grid-row: 1; }
    .site-total-form .button { grid-column: 3; grid-row: 1; }
    .site-total-form .note-field { grid-column: 1 / 3; grid-row: 2; }
    .site-total-form .history-link { grid-column: 3; grid-row: 2; font-size: 11px; }
    .history-entry > summary { grid-template-columns: 1fr; gap: 3px; }
    .road-stage { --bike-width: clamp(48px, 12vw, 64px); }
    .peloton.is-expanded { padding: 12px; }
    .peloton.is-expanded .road-stage { --bike-width: clamp(48px, 15vw, 80px); --road-center: 50%; --road-depth: 150px; min-height: 500px; max-height: none; }
    .peloton.is-expanded .winter-hills { --scene-width: 1320px; --scene-duration: 96s; height: 216px; bottom: calc(100% - var(--road-center) + 34px); }
    .peloton.is-expanded .winter-village { --scene-width: 2640px; --scene-duration: 77s; height: 180px; bottom: calc(100% - var(--road-center) + 18px); }
    .fullscreen-summary { padding: 12px 16px; }
    .fullscreen-summary h3 { font-size: 14px; }
    .fullscreen-total span, .fullscreen-goal-footer { font-size: 11px; }
    .encouragement { height: 56px; font-size: 12px; }
    .race-controls { gap: 6px; }
    .race-controls .live-status { max-width: 96px; }
    .view-button { padding: 5px; }
    .view-button span { display: none; }
    .rider-identity { width: 80px; }
    .rider:nth-child(6n + 1)::before { top: 15%; bottom: calc(100% - var(--road-center) + var(--bike-height) - 18px - var(--lane-offset, 0px)); }
    .rider:nth-child(6n + 1) .rider-identity { top: auto; bottom: 85%; }
    .rider:nth-child(6n + 2)::before { top: calc(var(--road-center) + 5px + var(--lane-offset, 0px)); bottom: max(13%, 50px); }
    .rider:nth-child(6n + 2) .rider-identity { top: min(87%, calc(100% - 50px)); bottom: auto; }
    .rider:nth-child(6n + 3)::before { top: 30%; bottom: calc(100% - var(--road-center) + var(--bike-height) - 18px - var(--lane-offset, 0px)); }
    .rider:nth-child(6n + 3) .rider-identity { top: auto; bottom: 70%; }
    .rider:nth-child(6n + 4)::before { top: calc(var(--road-center) + 5px + var(--lane-offset, 0px)); bottom: 27.5%; }
    .rider:nth-child(6n + 4) .rider-identity { top: 72.5%; bottom: auto; }
    .rider:nth-child(6n + 5)::before { top: 45%; bottom: calc(100% - var(--road-center) + var(--bike-height) - 18px - var(--lane-offset, 0px)); }
    .rider:nth-child(6n + 5) .rider-identity { top: auto; bottom: 55%; }
    .rider:nth-child(6n + 6)::before { top: calc(var(--road-center) + 5px + var(--lane-offset, 0px)); bottom: 42%; }
    .rider:nth-child(6n + 6) .rider-identity { top: 58%; bottom: auto; }
    .is-expanded .rider:nth-child(6n + 1)::before { top: calc(50% - var(--bike-height) - 132px); }
    .is-expanded .rider:nth-child(6n + 1) .rider-identity { bottom: calc(50% + var(--bike-height) + 132px); }
    .is-expanded .rider:nth-child(6n + 3)::before { top: calc(50% - var(--bike-height) - 80px); }
    .is-expanded .rider:nth-child(6n + 3) .rider-identity { bottom: calc(50% + var(--bike-height) + 80px); }
    .is-expanded .rider:nth-child(6n + 5)::before { top: calc(50% - var(--bike-height) - 28px); }
    .is-expanded .rider:nth-child(6n + 5) .rider-identity { bottom: calc(50% + var(--bike-height) + 28px); }
    .is-expanded .rider:nth-child(6n + 2)::before { bottom: calc(50% - 146px); }
    .is-expanded .rider:nth-child(6n + 2) .rider-identity { top: calc(50% + 146px); }
    .is-expanded .rider:nth-child(6n + 4)::before { bottom: calc(50% - 94px); }
    .is-expanded .rider:nth-child(6n + 4) .rider-identity { top: calc(50% + 94px); }
    .is-expanded .rider:nth-child(6n + 6)::before { bottom: calc(50% - 42px); }
    .is-expanded .rider:nth-child(6n + 6) .rider-identity { top: calc(50% + 42px); }
}
@media (max-width: 640px) {
    .wrap { width: calc(100% - 32px); }
    .site-header { min-height: 80px; }
    .brand { gap: 7px; font-size: 23px; }
    .brand-divider { margin-inline: 2px; }
    .brand-event { font-size: 11px; }
    .eden-logo { width: 80px; }
    .admin-link { font-size: 11px; }
    h1 { letter-spacing: -1.6px; font-size: 43px; }
    .tracker-header { min-height: 56px; }
    .tracker-footer { min-height: 28px; font-size: 9px; line-height: 1.2; }
    .dashboard { height: calc(100svh - 84px); min-height: 680px; gap: 8px; padding-bottom: 8px; }
    .dashboard h1 { font-size: 18px; }
    .goal-panel { padding: 12px 16px; }
    .campaign-heading { grid-template-columns: 1fr; gap: 7px; padding-bottom: 8px; margin-bottom: 8px; }
    .campaign-art { width: min(100%, 230px); margin-inline: auto; }
    .campaign-copy h1 { margin: 3px 0; font-size: 17px; }
    .campaign-copy p { font-size: 10px; }
    .campaign-copy .campaign-dates { font-size: 10px; }
    .goal-heading h2 { font-size: 14px; }
    .celebration { margin-top: 6px; padding: 6px 8px; font-size: 10px; line-height: 1.3; }
    .goal-number { font-size: 28px; }
    .goal-number > span:last-child { display: block; margin-top: 3px; font-size: 10px; }
    .peloton { padding: 10px; }
    .section-heading { gap: 10px; }
    .section-heading h2 { font-size: 16px; }
    h2 { font-size: 25px; }
    .live-status { max-width: 130px; font-size: 9px; }
    .race-legend { flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; font-size: 9px; }
    .race-list { margin-top: 8px; }
    .rider-name { font-size: 9px; }
    .rider-identity { padding: 5px 4px; }
    .rider-distance { margin-top: 3px; font-size: 10px; }
    .rank { font-size: 9px; }
    .rider-distance strong { font-size: 10px; }
    .rider-distance span { font-size: 8px; margin-left: 2px; }
    .site-footer { gap: 12px; font-size: 10px; }
    .mileage-form, .correction-form { grid-template-columns: 1fr; }
    .form-actions { flex-direction: column; align-items: flex-start; }
    .panel { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
