/* Karts: an indoor kart track seen from above. Polished concrete hall floor, a lime header with tyre skid marks over a
   red-and-white kerb, the race as an asphalt straight between tyre walls (blue barrier belt, kerbs), white grid slots
   and a chequered finish line, karts from above with the coin on the nose cone and rubber marks behind them, a pit
   board with a lime lap timer, gold/silver/bronze kart helmets on a diamond-plate podium and a tyre stack full of coins
   that holds the pot. Kart lime is the action colour, kerb red and barrier blue the accents. */
@font-face { font-family: 'Racing Sans One'; src: url(/fonts/racing.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Chakra Petch'; src: url(/fonts/chakra-400.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Chakra Petch'; src: url(/fonts/chakra-500.woff2) format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Chakra Petch'; src: url(/fonts/chakra-600.woff2) format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Chakra Petch'; src: url(/fonts/chakra-700.woff2) format('woff2'); font-weight: 700 900; font-display: swap; }
@font-face { font-family: 'Noto Sans Mono'; src: url(/fonts/noto-mono.woff2) format('woff2'); font-weight: 500 800; font-display: swap; }

:root {
  --wall: #e4e4de;          /* polished concrete */
  --wall-2: #cfd0c9;
  --cream: #fbfbf7;
  --paper: #f2f2ed;
  --ink: #141517;           /* tyre black */
  --ink-2: #3b3e44;
  --ink-3: #62666e;
  --red: #c3ec2f;           /* primary: kart lime */
  --red-dk: #9cc51a;
  --lime: #c3ec2f;
  --lime-dk: #9cc51a;
  --kerb: #e3312b;
  --bulb: #c3ec2f;
  --amber: #f2bd32;
  --cobalt: #2457d6;        /* barrier belt blue */
  --turf: #3b3e43;          /* asphalt */
  --turf-2: #34373c;
  --plank: #cfd0c9;
  --plank-dk: #a9aba5;
  --tin: #c9ced4;
  --up: #1f8a4c;
  --down: #d1302a;
  --edge: 2.5px solid var(--ink);
  --shadow: 4px 4px 0 var(--ink);
  --r: 10px;
  --display: 'Racing Sans One', 'Arial Black', Impact, sans-serif;
  --text: 'Chakra Petch', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Noto Sans Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --tyres: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='16'%3E%3Crect width='15' height='16' fill='%23a3a5a7'/%3E%3Ccircle cx='7.5' cy='8' r='7.3' fill='%231d1e21' stroke='%230c0d0f' stroke-width='1'/%3E%3Ccircle cx='7.5' cy='8' r='3.3' fill='%23878a8e' stroke='%230c0d0f' stroke-width='1'/%3E%3Cpath d='M2.6 6 A5.4 5.4 0 0 1 6.4 2.6' stroke='%23585c62' stroke-width='1.2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  --asphalt: 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 .85 0 0 0 0 .86 0 0 0 0 .88 0 0 0 1.4 -.72'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
  --kerbs: repeating-linear-gradient(90deg, var(--kerb) 0 22px, #fbfbf7 22px 44px);
}

/* the hall floor: polished concrete with a fine aggregate */
body {
  background-color: var(--wall);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .3 0 0 0 0 .31 0 0 0 0 .3 0 0 0 1.1 -.55'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E"),
    radial-gradient(130% 90% at 50% 0%, #ecece7, #dfdfd8 75%);
}
h1, h2, h3 { font-weight: 400; letter-spacing: .005em; line-height: 1.02; }
h1 { font-size: clamp(40px, 5vw, 70px); }
.hero h1 { font-size: clamp(44px, 4.9vw, 70px); line-height: 1.02; }
.hero h1 .h1b { color: var(--kerb); text-shadow: 3px 3px 0 var(--ink); margin-top: 4px; }
.lede { font-weight: 500; }

.btn { color: var(--ink); font-weight: 700; border-radius: 8px; letter-spacing: .02em; }
.btn:hover { background: #d1f45a; }
.btn-cream { background: var(--cream); color: var(--ink); }
.btn-cream:hover { background: #fff; }
.btn-ink { color: var(--lime); }
.btn-ink:hover { background: #26282c; }
.step h3::before { color: var(--kerb); }
.ticket-head .fee-in { color: var(--ink); }
.link { color: var(--ink); text-decoration-color: var(--kerb); }

/* the header: kart lime with tyre skid marks, a red-and-white kerb as its edge */
.top {
  color: var(--ink); border-bottom: 0;
  background-color: var(--lime);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='130'%3E%3Cg fill='none' stroke='%23141517' stroke-opacity='.075' stroke-width='9' stroke-linecap='round'%3E%3Cpath d='M-20 112 C120 96 220 40 380 34 S640 70 760 28'/%3E%3Cpath d='M-20 132 C120 116 220 62 380 56 S640 92 760 50'/%3E%3Cpath d='M560 140 C620 96 720 80 920 92' stroke-opacity='.05'/%3E%3Cpath d='M540 124 C600 80 700 64 920 74' stroke-opacity='.05'/%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(180deg, #ccf246, #bde52a);
}
.top-in { min-height: 100px; padding-bottom: 16px; }
.brand { gap: 12px; color: var(--ink); }
.brand-horse { width: 66px; height: 62px; filter: none; }
.brand-word { font: 400 52px/1 var(--display); letter-spacing: .01em; color: var(--ink); text-shadow: 2px 2px 0 #fbfbf7; translate: 0 -2px; }
.nav a { color: var(--ink); font-weight: 700; }
.nav a:hover { border-color: rgba(20, 21, 23, .35); }
.nav a[aria-current='page'] { background: var(--ink); color: var(--lime); border-color: var(--ink); box-shadow: 2px 2px 0 var(--kerb); }
.top .btn { background: var(--ink); color: var(--lime); }
.top .btn:hover { background: #26282c; }
.mode-note { color: var(--ink-2); }
.bulbs {
  bottom: 0; height: 14px;
  background:
    linear-gradient(var(--ink), var(--ink)) 0 0 / 100% 2.5px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 0 100% / 100% 2.5px no-repeat,
    var(--kerbs) 0 2.5px / 100% 9px no-repeat;
}
.nav-mobile { padding-bottom: 24px; }
.nav-mobile a { color: var(--ink); font-weight: 700; border-color: rgba(20, 21, 23, .3); background: rgba(255, 255, 255, .28); }
.nav-mobile a[aria-current='page'] { background: var(--ink); color: var(--lime); }

/* the booth: a slab of hall floor holding the pit board, the podium and the straight */
.booth {
  border-radius: 14px; padding: 11px;
  background-color: #d2d3cc;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .25 0 0 0 0 .26 0 0 0 0 .25 0 0 0 1 -.5'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.4'/%3E%3C/svg%3E"),
    linear-gradient(165deg, #dcddd6, #cdcec7 60%, #c4c5be);
}
/* the pit board: black board in an aluminium frame, white lettering, the lap timer in lime */
.booth-sign { border-radius: 6px; background: #17181b; color: #fbfbf7; border: 2.5px solid var(--ink); box-shadow: inset 0 0 0 3px #b9bec5, inset 0 0 0 4.5px var(--ink); padding: 12px 16px; }
.booth-sign .t-name { font: 400 25px/1 var(--display); letter-spacing: .02em; }
.booth-sign .t-meta { color: #a3a8b0; font-weight: 600; }
.booth-sign .clock { font: 700 28px/1 var(--mono); color: var(--lime); letter-spacing: -.02em; }
.booth-sign .clock small { color: #a3a8b0; font-family: var(--text); font-weight: 600; letter-spacing: 0; }
.booth-more, .booth-more a { color: var(--ink); text-shadow: none; }

/* prizes: kart helmets on a diamond-plate podium, the tyre stack holds the pot */
.shelf { padding-top: 12px; }
.shelf::after {
  height: 14px; border-radius: 3px;
  background:
    repeating-linear-gradient(45deg, transparent 0 6px, rgba(255, 255, 255, .55) 6px 7.5px, transparent 7.5px 12px),
    repeating-linear-gradient(-45deg, transparent 0 6px, rgba(20, 21, 23, .22) 6px 7.5px, transparent 7.5px 12px),
    linear-gradient(180deg, #dfe3e7, #b3b9c0 55%, #8f959c);
}
.prize { margin-bottom: 8px; }
.prize svg { width: clamp(56px, 6.6vw, 78px); height: clamp(51.5px, 6.07vw, 71.8px); }
.prize b { top: calc(clamp(51.5px, 6.07vw, 71.8px) * .535); translate: 0 -50%; font: 400 clamp(12px, 1.3vw, 16px)/1 var(--display); color: #fbfbf7; letter-spacing: .02em; }
.prize span { margin-top: -1px; border-radius: 4px; font-weight: 700; }
.pot { margin-bottom: 6px; }
.pot svg { width: clamp(72px, 8.6vw, 100px); height: clamp(90px, 10.75vw, 125px); }
.pot .pot-sum { top: 62%; translate: -50% -50%; background: #fbfbf7; border: 1.5px solid var(--ink); border-radius: 3px; padding: 2px 4px; color: var(--ink); font: 700 clamp(10px, 1.02vw, 13px)/1 var(--mono); letter-spacing: -.04em; }
.pot .pot-label { color: var(--ink); text-shadow: none; position: relative; z-index: 2; }

/* the straight: asphalt between tyre walls, a blue barrier belt and kerbs on both sides */
.track {
  --lane-h: 70px; --start: 40px; --fin: 30px; --tw: 16px; --kb: 7px; --rim: calc(var(--tw) + 3px + var(--kb));
  container-type: inline-size;
  margin-top: 11px; border-radius: 6px; border-width: 3px; padding: var(--rim) 0;
  background:
    var(--tyres) 0 0 / 15px var(--tw) repeat-x,
    var(--tyres) 7px 100% / 15px var(--tw) repeat-x,
    linear-gradient(var(--cobalt), var(--cobalt)) 0 var(--tw) / 100% 3px no-repeat,
    linear-gradient(var(--cobalt), var(--cobalt)) 0 calc(100% - var(--tw)) / 100% 3px no-repeat,
    var(--kerbs) 0 calc(var(--tw) + 3px) / 100% var(--kb) no-repeat,
    var(--kerbs) 11px calc(100% - var(--tw) - 3px) / 100% var(--kb) no-repeat,
    var(--asphalt),
    linear-gradient(90deg, #3e4146, #393c41 55%, #35383d);
}
.mini-booth .track { --lane-h: 46px; --tw: 12px; --kb: 5px; }
.lane { border-bottom: 0; background: linear-gradient(180deg, transparent 28%, rgba(0, 0, 0, .14) 44% 56%, transparent 72%); }
.lane:nth-child(even) { background: linear-gradient(180deg, transparent 28%, rgba(0, 0, 0, .14) 44% 56%, transparent 72%); }
.lane::after { display: none; }
.lane + .lane::before { content: ''; position: absolute; z-index: 1; left: 34px; right: 0; top: 0; border-top: 2px dashed rgba(251, 251, 247, .28); }
/* the grid: white painted slots with the number, the start line behind them */
.lane-no {
  width: 34px; background: none; border-right: 3px solid #fbfbf7; color: #fbfbf7; font: 400 18px/1 var(--display);
}
.lane-no::before { content: ''; position: absolute; left: 6px; top: 22%; bottom: 22%; width: 7px; border: 2px solid rgba(251, 251, 247, .55); border-right: 0; }
.lane-empty { color: #c9ccd1; text-shadow: none; }
.zero { top: var(--rim); bottom: var(--rim); border-left: 2.5px dashed var(--lime); }
.zero span { font: 700 12px/1 var(--mono); color: var(--lime); top: 4px; }

/* the finish: a chequered line painted across the asphalt */
.finish {
  top: var(--rim); bottom: var(--rim); right: 0; width: 22px; border-left: 2.5px solid var(--ink);
  background: conic-gradient(var(--ink) 25%, #fbfbf7 0 50%, var(--ink) 0 75%, #fbfbf7 0) 0 0 / 11px 11px;
}

/* the karts: 160 x 100 symbol, coin on the nose cone, rubber marks behind the rear tyres */
.runner.kart {
  --hw: calc((var(--lane-h, 64px) - 10px) * 1.6);
  top: 5px; bottom: 5px;
  left: calc(var(--start) + (100% - var(--start) - var(--fin) - var(--hw)) * var(--x, 0));
}
.runner.kart .horse { inset: 0; height: 100%; transform-origin: 50% 50%; animation: idle .5s steps(2, jump-none) infinite; }
.lane:nth-child(2n) .runner.kart .horse { animation-delay: -.25s; }
@keyframes idle { 0% { transform: translate(0, 0); } 100% { transform: translate(0, .6px); } }
@media (prefers-reduced-motion: reduce) { .runner.kart .horse { animation: none; } }
.runner.kart .disc { left: 77.25%; top: 35.6%; width: 18%; border-width: 2px; border-color: var(--ink); box-shadow: 0 0 0 1.5px var(--silk, #141517); }
.runner.kart .rod {
  --x: inherit; left: auto; right: 81.2%; top: 0; bottom: 0; translate: none; z-index: -1;
  width: calc(var(--x, 0) * (100cqw - var(--start) - var(--fin) - var(--hw)) + 6px); max-width: none; min-width: 0; height: auto;
  border: 0; border-radius: 0;
  background: linear-gradient(180deg, transparent 5%, rgba(8, 8, 10, .5) 5% 21%, transparent 21% 79%, rgba(8, 8, 10, .5) 79% 95%, transparent 95%);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 85%); mask-image: linear-gradient(90deg, transparent, #000 85%);
}
.tag { border-radius: 4px; border-color: var(--ink); background: #fbfbf7; }
.tag em { font: 700 13px/1.1 var(--mono); }
.mono, .addr, .pick .w, .results .when { letter-spacing: -.02em; }
.runner.p1 .tag { background: #ffeeb8; }
.runner.me .tag { background: var(--lime); }

/* panels and paper bits */
.panel { border-radius: 10px; }
.ticket { border-radius: 10px; }
.ticket.sprint { --tk: var(--lime); }
.ticket.heat { --tk: var(--cobalt); }
.ticket.classic { --tk: var(--kerb); }
.ticket.dash { --tk: #ff7a1a; }
.dlg { border-radius: 12px; }
.dlg-head { background: var(--ink); color: var(--lime); border-bottom: 0; padding-bottom: 27px; }
.dlg-head::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 12px; background: var(--kerbs); border-top: 2.5px solid var(--ink); border-bottom: 2.5px solid var(--ink); }
.dlg-head h2 { text-shadow: none; letter-spacing: .02em; }
.seg button b { font-weight: 400; letter-spacing: .02em; }
.seg button[aria-pressed='true'] { box-shadow: 3px 3px 0 var(--lime-dk); }
.seg button[aria-pressed='true'] b { color: var(--lime); }
.inp:focus-within { box-shadow: 0 0 0 3px var(--lime); }
.count .big, .potline b, .standings .place { font-weight: 400; }
.test-note { background: #eef6d2; border-color: #cfe39a; }
.toast { box-shadow: 4px 4px 0 var(--lime-dk); }
.hits button:hover, .hits button:focus-visible, .wallets button:hover, .standings tr.me td { background: #eef9c4; }
.foot {
  border-top: 0; color: #c3c7cd; padding-top: 12px;
  background: linear-gradient(var(--ink), var(--ink)) 0 0 / 100% 2.5px no-repeat, var(--kerbs) 0 2.5px / 100% 9px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 0 11.5px / 100% 2.5px no-repeat, var(--asphalt), #222428;
}
.foot-links a { color: var(--cream); }
.foot-risk { color: var(--cream); }
.launch { background: var(--ink); }
.launch a { color: var(--lime); }

@media (max-width: 640px) {
  .top-in { min-height: 80px; }
  .brand-horse { width: 50px; height: 47px; }
  .brand-word { font-size: 40px; }
  .track { --lane-h: 56px; --start: 26px; --fin: 22px; --tw: 12px; --kb: 5px; }
  .runner.kart { top: 4px; bottom: 4px; --hw: calc((var(--lane-h, 56px) - 8px) * 1.6); }
  .lane-no { width: 24px; font-size: 13px; border-right-width: 2px; }
  .lane-no::before { display: none; }
  .lane + .lane::before { left: 24px; }
  .finish { width: 16px; background-size: 8px 8px; }
  .booth { padding: 7px; border-radius: 10px; }
  .booth-sign { padding: 9px 11px; }
  .booth-sign .clock { font-size: 22px; }
  .hero h1 { font-size: clamp(40px, 11vw, 50px); }
  .tag em { font-size: 11.5px; }
  .prize b { font-size: 11px; }
}
