/* Laps: a club slot-car raceway on a periwinkle carpet. 1960s cigar-shaped formula slot cars run in the slots of a
   charcoal routed track with copper rails; every lane carries its club lane colour. The race board is the lap counter:
   a cream moulded console with a charcoal face and drum-digit windows. Laurel wreaths are the prizes and stand on a
   podium plinth, the set's own red box heaped with gold is the pot. The header is a straight of track with its slot. */
@font-face { font-family: 'Oleo Script'; src: url(/fonts/oleo.woff2) format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Public Sans'; src: url(/fonts/publicsans.woff2) format('woff2'); font-weight: 400 800; font-display: swap; }
@font-face { font-family: 'Inconsolata'; src: url(/fonts/inconsolata.woff2) format('woff2'); font-weight: 500 800; font-stretch: 75% 100%; font-display: swap; }

:root {
  --wall: #dfe1f3;         /* periwinkle carpet */
  --wall-2: #c9cce8;
  --cream: #fbf9f4;
  --paper: #f3f2f8;
  --ink: #17182b;
  --ink-2: #3f4157;
  --ink-3: #5f6178;
  --red: #26272d;          /* track charcoal: header, dialog heads, every button */
  --red-dk: #1a1b20;
  --scx: #e0261f;          /* lane red */
  --copper: #c8743a;       /* the rails */
  --bulb: #ffcc1a;         /* lap-counter yellow */
  --amber: #ffcc1a;
  --cobalt: #2346c8;
  --green: #1f8a45;
  --turf: #2d2e34;         /* the track surface */
  --turf-2: #313238;
  --tin: #d9dbe6;
  --console: #f3f0e6;      /* lap counter plastic */
  --up: #1b7f45;
  --down: #c8302c;
  --edge: 2.5px solid var(--ink);
  --shadow: 4px 4px 0 var(--ink);
  --display: 'Oleo Script', 'Cooper Black', Georgia, serif;
  --text: 'Public Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Inconsolata', ui-monospace, 'SF Mono', Menlo, monospace;
  /* a slot with a copper rail either side, drawn top to bottom in 9px */
  --slot: linear-gradient(180deg, var(--copper) 0 2px, transparent 2px 3px, #0c0c0f 3px 6px, transparent 6px 7px, var(--copper) 7px 9px);
  --checks: conic-gradient(var(--ink) 25%, #f5f4ef 0 50%, var(--ink) 0 75%, #f5f4ef 0);
  --pile: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .2 0 0 0 0 .2 0 0 0 0 .4 0 0 0 .5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* the page: a periwinkle wall-to-wall carpet with a fine pile */
body { font-weight: 450; font-size: 17.5px; background: var(--wall) var(--pile) 0 0 / 180px 180px; }
h1, h2, h3 { font-weight: 700; letter-spacing: 0; line-height: 1.04; }
h1 { font-size: clamp(48px, 5.7vw, 80px); }
h2 { font-size: clamp(32px, 3.6vw, 46px); }
.btn { font-weight: 800; border-radius: 8px; font-size: 18px; box-shadow: inset 0 -3px 0 var(--copper), 4px 4px 0 var(--scx); }
.btn:hover { background: #34353d; }
.btn:active { box-shadow: inset 0 -3px 0 var(--copper), 1px 1px 0 var(--scx); }
.btn[disabled] { box-shadow: inset 0 -3px 0 var(--copper), 4px 4px 0 var(--scx); }
.btn-small { box-shadow: inset 0 -3px 0 var(--copper), 3px 3px 0 var(--scx); }
.btn-cream { background: var(--cream); color: var(--ink); box-shadow: var(--shadow); }
.btn-cream:hover { background: #fff; }
.btn-ink { background: var(--ink); box-shadow: var(--shadow); }
.btn-ink:hover { background: #262842; }
.hero h1 { color: var(--ink); }
.hero h1 .h1b { color: var(--scx); text-shadow: 4px 4px 0 var(--ink); width: fit-content; padding-right: .12em; }

/* header: a straight of charcoal track, its slot with two copper rails running along the foot, white edge line */
.top { background: var(--red) linear-gradient(180deg, rgba(255, 255, 255, .06), transparent 45%, rgba(0, 0, 0, .18)); border-bottom: 5px solid #f2f0ea; box-shadow: 0 2.5px 0 var(--ink); }
.top::after { content: ''; position: absolute; left: 0; right: 0; bottom: 9px; height: 9px; background: var(--slot); pointer-events: none; }
.top-in { padding-bottom: 26px; padding-top: 6px; }
.brand { gap: 6px; }
.brand-horse { width: 120px; height: 44px; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .35)); }
.brand-word { font: 700 50px/1 var(--display); color: var(--cream); text-shadow: 3px 3px 0 var(--scx); padding-right: .1em; }
.nav a { color: var(--cream); font-weight: 700; font-size: 17px; }
.nav a:hover { border-color: rgba(251, 249, 244, .4); }
.nav a[aria-current='page'] { background: var(--cream); color: var(--ink); border-radius: 7px; box-shadow: 2px 2px 0 var(--scx); }
.nav-mobile { padding-bottom: 30px; }
.nav-mobile a { font-weight: 700; border-color: rgba(251, 249, 244, .3); }
.nav-mobile a[aria-current='page'] { box-shadow: 2px 2px 0 var(--scx); }
.top .btn { background: var(--cream); color: var(--ink); box-shadow: 3px 3px 0 var(--scx); }
.top .btn:hover { background: #fff; }
.mode-note { color: #d8d9e2; }
.bulbs { display: none; }
.hero { padding-top: 60px; }
.page-head { padding-top: 8px; }

/* the lap counter: cream moulded console, charcoal face plate, drum-digit window for the clock */
.booth { container-type: inline-size; background: linear-gradient(180deg, #faf8f1, var(--console) 40%, #e4e0d3); border-radius: 20px; padding: 12px; box-shadow: inset 0 2px 0 #fff, 6px 6px 0 var(--ink); }
.booth-sign { background: #222328 linear-gradient(180deg, rgba(255, 255, 255, .07), transparent 50%); color: var(--cream); border-radius: 10px; padding: 12px 16px; box-shadow: inset 0 0 0 3px #3a3b42; }
.booth-sign .t-name { font: 700 27px/1 var(--display); color: var(--cream); }
.booth-sign .center .t-name { color: var(--bulb); }
.booth-sign .t-meta { color: #c3c5d2; font-weight: 600; font-size: 14px; margin-top: 3px; }
.booth-sign .clock { font: 800 27px/1 var(--mono); font-stretch: 85%; }
.booth-sign .clock span[data-until] { display: inline-block; padding: 5px 9px 4px; border-radius: 5px; border: 2px solid #0b0b0e; color: #f7f3e8; letter-spacing: .06em;
  background: linear-gradient(180deg, #050506, #34353c 26%, #2a2b31 50%, #34353c 74%, #050506); box-shadow: 0 0 0 2px #8d909c; }
.booth-sign .clock small { color: #c3c5d2; font-weight: 600; font-size: 13px; margin-top: 6px; }
.shelf { padding: 14px 18px 0; width: fit-content; max-width: 100%; margin-inline: auto; }
/* the podium plinth the wreaths stand on */
.shelf::after { height: 20px; left: 0; right: 0; border-radius: 3px; background: linear-gradient(180deg, #fff 0 6px, #e7e5de 6px calc(100% - 5px), var(--scx) calc(100% - 5px)); }
.prize { margin-bottom: 10px; }
.prize svg { width: clamp(64px, 7.6vw, 92px); height: clamp(64px, 7.6vw, 92px); }
.prize b { top: calc(clamp(64px, 7.6vw, 92px) * .46); left: 0; right: 0; translate: 0 -50%; color: var(--ink); font: 700 clamp(14px, 1.6vw, 20px)/1 var(--display); }
.prize span { margin-top: -2px; border-radius: 5px; font-weight: 700; font-size: 14px; }
.pot { margin-bottom: 10px; }
.pot svg { width: clamp(88px, 10.4vw, 124px); height: clamp(69px, 8.2vw, 97px); }
.pot .pot-sum { top: 62%; translate: -50% -50%; border-radius: 5px; font: 800 clamp(13px, 1.4vw, 16px)/1 var(--text); }
.pot .pot-label { font-weight: 700; color: var(--cream); background: var(--ink); text-shadow: none; border-radius: 5px; padding: 3px 8px; position: relative; z-index: 2; margin-top: -2px; font-size: 13px; }

/* the track: charcoal lanes, a slot with copper rails in each, a white guard rail above, the edge line below */
.track { --lane-h: 76px; margin-top: 14px; border-radius: 8px; background: var(--turf); padding: 14px 0 10px; }
.track::before, .track::after { content: ''; position: absolute; left: 0; right: 0; z-index: 2; }
.track::before { top: 0; height: 14px; border-bottom: 2px solid var(--ink);
  background: repeating-linear-gradient(90deg, transparent 0 44px, #8d909c 44px 48px, transparent 48px 92px), linear-gradient(180deg, #fbfaf6, #d9dae2); }
.track::after { bottom: 0; height: 10px; border-top: 2px solid var(--ink); background: linear-gradient(180deg, #f5f4ef, #d9dae2); }
.lane, .lane:nth-child(even) { border-bottom: 0; background: linear-gradient(90deg, transparent 0 40px, #f5f4ef 40px 44px, transparent 44px) var(--turf); }
.lane:nth-child(even) { background-color: var(--turf-2); }
.lane + .lane { box-shadow: inset 0 1.5px 0 #3e3f47; }
/* the slot, with a copper rail each side */
.lane::after { left: 44px; right: 0; bottom: 6px; height: 9px; border-radius: 0; box-shadow: none; z-index: 1; background: var(--slot); }
/* club lane colours: red, white, green, orange, blue, yellow, purple, black */
.lane-no { width: 34px; color: var(--ink); font: 800 19px/1 var(--text); border-right: var(--edge); background: var(--lc, #e0261f); }
.lane:nth-child(8n + 1) .lane-no { --lc: #e0261f; color: #fff; }
.lane:nth-child(8n + 2) .lane-no { --lc: #f5f4ef; }
.lane:nth-child(8n + 3) .lane-no { --lc: #1f8a45; color: #fff; }
.lane:nth-child(8n + 4) .lane-no { --lc: #f07d1a; }
.lane:nth-child(8n + 5) .lane-no { --lc: #2346c8; color: #fff; }
.lane:nth-child(8n + 6) .lane-no { --lc: #ffcc1a; }
.lane:nth-child(8n + 7) .lane-no { --lc: #7a3fc2; color: #fff; }
.lane:nth-child(8n + 8) .lane-no { --lc: #121216; color: #fff; }
.lane-empty { color: var(--cream); text-shadow: none; font-weight: 700; font-size: 16px; }
.lane-empty > span:not(.lane-no) { position: relative; z-index: 3; padding: 3px 10px; margin: 0 30px 0 44px; max-width: calc(100% - 84px); background: rgba(23, 24, 43, .72); border-radius: 5px; text-align: center; line-height: 1.2; }
/* finish: a black and white chequered line painted across the lanes */
.finish { width: 24px; border-left: 2px solid #f5f4ef; z-index: 3; background: var(--checks) 0 0 / 12px 12px; }
.zero { border-left: 3px dashed rgba(245, 244, 239, .75); }
.zero span { font: 700 13px/1 var(--mono); color: var(--ink); background: var(--cream); border-radius: 3px; padding: 2px 4px; top: 17px; }

.runner.car { --hw: calc((var(--lane-h, 64px) - 8px) * 2.7273); top: 1px; bottom: 3px; --spin: running; }
/* slot cars pivot on the guide blade: the tail swings a hair while it runs */
.runner.car .horse { transform-origin: 92% 94%; animation: wag 1.3s ease-in-out infinite alternate; }
.lane:nth-child(2n) .runner.car .horse { animation-delay: -.6s; }
@keyframes wag { from { rotate: -.7deg; } to { rotate: .5deg; } }
/* wheels turn and the braid sparks only on cars that are in the race (the --spin switch reaches into the sprite) */
.rim { transform-box: fill-box; transform-origin: center; animation: spin .9s linear infinite; animation-play-state: var(--spin, paused); }
.spark { opacity: 0; animation: spark 1.7s steps(1, end) infinite; animation-play-state: var(--spin, paused); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes spark { 0%, 62%, 74%, 100% { opacity: 0; } 64%, 70% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .runner.car .horse, .rim, .spark { animation: none; } }
.runner.car .rod { display: none; }
.runner.car .disc { left: 61.25%; top: 37.3%; width: 10.83%; background: var(--silk); border-width: 1.5px; }
.tag { border-radius: 5px; font-weight: 700; font-size: 14px; }
.tag em { font-weight: 600; }
.runner.me .tag { background: var(--bulb); }
.runner.p1 .tag { background: #ffe9a0; }
.booth-more { color: var(--ink); text-shadow: none; }
.booth-more a { color: var(--ink); }

.step { grid-template-columns: 104px minmax(0, 1fr); }
.step svg.art { width: 104px; height: 72px; }
.step h3 { font-size: 26px; }
.step h3::before { color: var(--scx); }
.ticket-head h3 { font-size: 30px; }
.ticket-head .fee-in { font: 700 23px/1 var(--display); color: var(--scx); }
.ticket dt { font-weight: 600; }
.ticket dd { font-weight: 800; }
.ticket.sprint { --tk: var(--scx); }
.ticket.heat { --tk: var(--cobalt); }
.ticket.classic { --tk: var(--green); }
.ticket.dash { --tk: var(--bulb); }
.panel { border-radius: 10px; }
.count .big, .potline b { font: 800 38px/1 var(--mono); font-stretch: 85%; }
.potline b { font-size: 24px; }
.seg button b { font: 700 20px/1 var(--display); }
.standings .place { font: 700 21px/1 var(--display); }

.dlg { border-radius: 12px; }
.dlg-head { background: var(--red); border-bottom: 5px solid #f2f0ea; box-shadow: 0 2.5px 0 var(--ink); margin-bottom: 2.5px; }
.dlg-head h2 { color: var(--cream); font-size: 30px; text-shadow: 2px 2px 0 var(--scx); }
.seg button { border-radius: 8px; }
.seg button[aria-pressed='true'] { background: var(--red); box-shadow: inset 0 -3px 0 var(--copper), 3px 3px 0 var(--scx); }
.test-note { background: #eceefa; border-color: var(--wall-2); }
.launch { background: var(--ink); }
.launch a { color: var(--bulb); }
/* the page ends on another straight of track: the footer's top edge carries the slot */
.foot { border-top: 0; background: var(--ink); color: #d4d6e2; position: relative; padding-top: 26px; }
.foot::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 26px; border-top: 5px solid #f2f0ea; box-shadow: inset 0 2.5px 0 var(--ink);
  background: var(--slot) 0 9px / 100% 9px no-repeat, var(--red); }
.toast { box-shadow: 4px 4px 0 var(--scx); }
.mine-row .k, .count .sub, .lt-head .lt-meta { font-weight: 700; }

@media (max-width: 640px) {
  .track { --lane-h: 50px; padding: 11px 0 8px; }
  .track::before { height: 11px; }
  .track::after { height: 8px; }
  .lane, .lane:nth-child(even) { background-image: linear-gradient(90deg, transparent 0 26px, #f5f4ef 26px 29px, transparent 29px); }
  .lane::after { left: 29px; bottom: 3px; height: 9px; }
  .zero span { top: 13px; }
  .lane-no { width: 24px; font-size: 14px; }
  .lane-empty { font-size: 14px; }
  .lane-empty > span:not(.lane-no) { margin: 0 18px 0 30px; max-width: calc(100% - 56px); }
  .finish { width: 14px; background-size: 7px 7px; }
  .brand-horse { width: 84px; height: 31px; }
  .brand-word { font-size: 38px; }
  .top-in { padding-bottom: 22px; }
  .count .big { font-size: 30px; }
  .hero h1 .h1b { text-shadow: 3px 3px 0 var(--ink); }
  .hero { padding-top: 46px; }
  .booth-sign .t-name { font-size: 22px; }
  .booth-sign .clock { font-size: 22px; }
  .tag { font-size: 12.5px; }
  .shelf { padding: 12px 2px 0; gap: 5px; }
  .prize span { font-size: 12px; padding: 3px 5px; }
  .pot .pot-label { font-size: 12px; }
}
