/* Crabs: a crab race on the beach at low tide. Dry sand with wind ripples, an ocean-blue sea with a foam edge up top,
   raked sand lanes that turn wet toward the waterline, crabs running sideways with the coin on the shell,
   starfish for 1st/2nd/3rd on a driftwood log and a sandcastle heaped with coins as the pot. */
@font-face { font-family: 'Gluten'; src: url(/fonts/gluten.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Asap'; src: url(/fonts/asap.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Share Tech Mono'; src: url(/fonts/sharetechmono.woff2) format('woff2'); font-display: swap; }

:root {
  --wall: #f4e6c7;          /* dry sand */
  --wall-2: #e7d0a2;
  --cream: #fffaf0;         /* shell white */
  --paper: #fbf0dc;
  --ink: #162036;           /* squid ink */
  --ink-2: #434a5e;
  --ink-3: #6b6f7d;
  --red: #1d5591;           /* primary buttons: the sea */
  --red-dk: #153f6e;
  --bulb: #ffc94a;          /* sun */
  --amber: #f2a93b;
  --cobalt: #e0533a;        /* crab coral: second accent */
  --turf: #e3c78f;          /* raked sand lanes */
  --turf-2: #d8b97f;
  --plank: #cbb898;         /* driftwood */
  --plank-dk: #9c876a;
  --tin: #d7dde3;
  --sea: #1d5591;
  --sea-2: #2b6db0;
  --glass: #2b8f86;         /* sea glass */
  --up: #1e7a4c;
  --down: #c8382b;
  --edge: 2.5px solid var(--ink);
  --shadow: 4px 4px 0 var(--ink);
  --r: 14px;
  --display: 'Gluten', 'Cooper Black', Georgia, serif;
  --text: 'Asap', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Share Tech Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

/* dry sand with wind ripples */
body {
  background-color: var(--wall);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='64'%3E%3Cpath d='M0 18 C30 10 50 26 80 18 S130 10 160 18 S210 26 240 18 M-40 50 C-10 42 10 58 40 50 S90 42 120 50 S170 58 200 50 S250 42 280 50' fill='none' stroke='%23a87b3c' stroke-opacity='.13' stroke-width='2'/%3E%3C/svg%3E");
}
h1, h2, h3 { font-weight: 750; letter-spacing: 0; line-height: 1.06; }
h1 { font-size: clamp(40px, 4.4vw, 62px); font-weight: 800; }
.hero h1 { line-height: 1.08; }
h2 { font-size: clamp(30px, 3.6vw, 44px); }
.hero h1 .h1b { color: var(--cobalt); text-shadow: 3px 3px 0 var(--ink); }
.lede { font-weight: 500; }

.btn { font-weight: 700; border-radius: 12px; }
.btn:hover { background: #2463a8; }
.btn-cream:hover { background: #fff; }
.step h3::before { color: var(--cobalt); }
.ticket-head .fee-in { color: var(--red); }

/* the header: open sea, the foam edge where it meets the sand */
.top {
  background-color: var(--sea);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='40'%3E%3Cpath d='M0 14 q22 -7 45 0 t45 0 t45 0 t45 0 M-22 34 q22 -7 45 0 t45 0 t45 0 t45 0 t45 0' fill='none' stroke='%23ffffff' stroke-opacity='.08' stroke-width='2.5'/%3E%3C/svg%3E");
  border-bottom: 0;
}
.top-in { padding-bottom: 20px; }
.brand { gap: 12px; }
.brand-horse { width: 84px; height: 55px; filter: drop-shadow(2px 3px 0 var(--ink)); }
.brand-word { font: 900 46px/1 var(--display); letter-spacing: 0; color: var(--cream); text-shadow: 3px 3px 0 var(--ink); translate: 0 4px; }
.nav a { color: var(--cream); font-weight: 700; }
.nav a:hover { border-color: rgba(255, 250, 240, .45); }
.top .btn { background: var(--bulb); color: var(--ink); }
.top .btn:hover { background: #ffd66e; }
.bulbs {
  bottom: 0; height: 18px; border-bottom: var(--edge);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='18'%3E%3Cpath d='M0 18 V11 C8 6 14 12 23 8 C32 4 38 11 49 7 C60 3 66 12 77 8 C88 4 96 11 106 8 C112 6 116 9 120 11 V18 Z' fill='%23fffaf0'/%3E%3Cpath d='M0 11 C8 6 14 12 23 8 C32 4 38 11 49 7 C60 3 66 12 77 8 C88 4 96 11 106 8 C112 6 116 9 120 11' fill='none' stroke='%23162036' stroke-width='1.6' stroke-opacity='.35'/%3E%3Cg fill='%23fffaf0'%3E%3Ccircle cx='14' cy='4' r='1.8'/%3E%3Ccircle cx='41' cy='2.5' r='1.3'/%3E%3Ccircle cx='70' cy='3.5' r='2'/%3E%3Ccircle cx='98' cy='2' r='1.4'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 120px 18px repeat-x;
}
.nav-mobile { padding-bottom: 24px; }
.nav-mobile a { font-weight: 700; }

/* the frame around the race: the sea */
.booth {
  background-color: var(--sea); border-radius: 20px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='34'%3E%3Cpath d='M0 17 q17.5 -7 35 0 t35 0 t35 0 t35 0' fill='none' stroke='%23ffffff' stroke-opacity='.1' stroke-width='2.5'/%3E%3C/svg%3E");
}
.booth-sign { border-radius: 12px 12px 6px 6px; }
.booth-sign .t-name, .booth-sign .clock { font-weight: 800; }
.booth-sign .clock { font-size: 28px; }

/* prizes: starfish and the sandcastle on a driftwood log */
.shelf { padding-top: 14px; }
.shelf::after {
  height: 16px; border-radius: 9px; left: 2%; right: 2%;
  background: linear-gradient(180deg, #ddd0b8, var(--plank) 45%, var(--plank-dk));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15);
}
.shelf::before { content: ''; position: absolute; left: 6%; right: 6%; bottom: 6px; height: 2px; z-index: 0;
  background: repeating-linear-gradient(90deg, rgba(22, 32, 54, .3) 0 30px, transparent 30px 52px); }
.prize { margin-bottom: 8px; }
.prize svg { width: clamp(52px, 6.6vw, 74px); height: clamp(54px, 6.9vw, 77px); }
.prize b { top: 39%; font: 900 clamp(12px, 1.3vw, 15px)/1 var(--display); color: var(--cream); text-shadow: 1px 1px 0 var(--ink), -1px -1px 0 var(--ink), 1px -1px 0 var(--ink), -1px 1px 0 var(--ink); }
.prize span { margin-top: -2px; border-radius: 6px; }
.pot { margin-bottom: 6px; }
.pot svg { width: clamp(72px, 9vw, 106px); height: clamp(90px, 11.2vw, 132px); }
.pot .pot-sum { top: 40%; border-radius: 8px; font-weight: 900; }
.pot .pot-label { text-shadow: 1px 1px 0 var(--ink); }

/* the beach: raked sand lanes, drier at the start, wet at the waterline */
.track {
  --lane-h: 72px; --start: 42px; --fin: 40px;
  container-type: inline-size;
  margin-top: 12px; border-radius: 10px;
  background-color: var(--turf);
  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='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .3 0 0 0 0 .12 0 0 0 .5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.45'/%3E%3C/svg%3E"),
    linear-gradient(90deg, #ecd6a6 0%, #e3c78f 55%, #cfab72 88%, #bf9a62 100%);
}
.mini-booth .track { --lane-h: 50px; }
.lane { border-bottom: 0; }
.lane:nth-child(even) { background: rgba(255, 245, 220, .16); }
/* the groove a crab runs along, raked with a stick */
.lane::after { left: 42px; right: 40px; bottom: 5px; height: 4px; border-radius: 2px; background: rgba(120, 82, 36, .32); box-shadow: 0 1.5px 0 rgba(255, 248, 228, .55); }
.lane + .lane::before { content: ''; position: absolute; left: 34px; right: 40px; top: -1px; height: 0; border-top: 2px dotted rgba(120, 82, 36, .38); }
.lane-no {
  background: var(--plank) linear-gradient(90deg, rgba(255, 255, 255, .18), transparent 40%, rgba(0, 0, 0, .06));
  color: var(--ink); font: 900 22px/1 var(--display);
}
.lane-empty { color: var(--ink-2); text-shadow: none; }
.zero { border-left: 3px dashed rgba(96, 64, 26, .55); }
.zero span { font: 400 13px/1 var(--mono); color: var(--ink-2); top: 4px; }

/* the waterline: foam, then the sea */
.finish {
  width: 40px; border-left: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='56'%3E%3Cpath d='M16 0 C7 8 19 18 10 28 C3 37 17 46 16 56 H40 V0 Z' fill='%232b6db0'/%3E%3Cpath d='M26 0 C20 10 30 18 24 28 C19 38 29 46 26 56 H40 V0 Z' fill='%231d5591'/%3E%3Cpath d='M16 0 C7 8 19 18 10 28 C3 37 17 46 16 56' fill='none' stroke='%23fffaf0' stroke-width='5' stroke-linecap='round'/%3E%3Cg fill='%23fffaf0'%3E%3Ccircle cx='6' cy='14' r='1.8'/%3E%3Ccircle cx='4' cy='44' r='1.4'/%3E%3Ccircle cx='22' cy='38' r='1.3'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 40px 56px repeat-y;
}

/* the crabs: 200 x 130 symbol, coin on the shell, footprints behind */
.runner.crab {
  --hw: calc((var(--lane-h, 64px) - 8px) * 1.5385);
  top: 4px; bottom: 4px;
  left: calc(var(--start) + (100% - var(--start) - var(--fin) - var(--hw)) * var(--x, 0));
}
.runner.crab .horse { inset: 0; height: 100%; transform-origin: 50% 92%; animation: scuttle 1.4s ease-in-out infinite; }
.lane:nth-child(2n) .runner.crab .horse { animation-delay: -.5s; }
.lane:nth-child(3n) .runner.crab .horse { animation-delay: -.9s; }
@keyframes scuttle { 0%, 100% { transform: translateX(-1px) rotate(-1.2deg); } 50% { transform: translateX(1px) rotate(1.2deg); } }
@media (prefers-reduced-motion: reduce) { .runner.crab .horse { animation: none; } }
.runner.crab .disc { left: 39.5%; top: 44.6%; width: 21%; border-width: 2px; }
.runner.crab .rod {
  --x: inherit; left: auto; right: 86%; bottom: 8%; width: calc(var(--x, 0) * (100cqw - var(--start) - var(--fin) - var(--hw))); max-width: none; min-width: 0; height: 10px;
  border: 0; border-radius: 0;
  background:
    radial-gradient(circle at 50% 25%, rgba(110, 72, 30, .42) 0 1.7px, transparent 2.3px) 0 0 / 10px 10px repeat-x,
    radial-gradient(circle at 50% 80%, rgba(110, 72, 30, .42) 0 1.7px, transparent 2.3px) 5px 0 / 10px 10px repeat-x;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 70%); mask-image: linear-gradient(90deg, transparent, #000 70%);
}
.tag { border-radius: 8px; }
.runner.p1 .tag { background: #ffe6a8; }
.runner.me .tag { background: var(--bulb); }

/* paper bits */
.panel { border-radius: 14px; }
.ticket { border-radius: 12px; }
.ticket.sprint { --tk: var(--sea); }
.ticket.heat { --tk: var(--cobalt); }
.ticket.classic { --tk: var(--glass); }
.ticket.dash { --tk: var(--bulb); }
.dlg { border-radius: 16px; }
.dlg-head { background: var(--sea); }
.dlg-head h2 { font-weight: 900; }
.seg button b { font-weight: 800; }
.seg button[aria-pressed='true'] { box-shadow: 3px 3px 0 var(--cobalt); }
.count .big, .potline b, .standings .place { font-weight: 800; }
.test-note { background: #fdf0d2; border-color: var(--wall-2); }
.toast { box-shadow: 4px 4px 0 var(--cobalt); }
.foot { border-top: 6px solid var(--sea); background: var(--ink); color: #cfd3dd; }
.hits button:hover, .hits button:focus-visible, .wallets button:hover, .standings tr.me td { background: #fdeccc; }
.launch a { color: var(--bulb); }

@media (max-width: 640px) {
  .brand-horse { width: 62px; height: 40px; }
  .brand-word { font-size: 34px; }
  .track { --lane-h: 52px; --start: 28px; --fin: 22px; }
  .lane-no { font-size: 17px; }
  .lane::after { left: 28px; right: 22px; }
  .lane + .lane::before { left: 24px; right: 22px; }
  .finish { width: 22px; background-size: 22px 31px; }
  .booth { border-radius: 14px; }
}
