/* Snail: a garden snail race. Terracotta garden wall, walnut sign board, a wooden race board with chalk lanes,
   a lettuce finish, seed-packet prizes and a flower pot of coins on the potting bench. */
@font-face { font-family: 'Coustard'; src: url(/fonts/coustard.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Urbanist'; src: url(/fonts/urbanist.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Anonymous Pro'; src: url(/fonts/anonpro.woff2) format('woff2'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: 'Caveat Brush'; src: url(/fonts/caveatbrush.woff2) format('woff2'); font-display: swap; }

:root {
  --wall: #f3ddd0;
  --wall-2: #e8c7b4;
  --cream: #fdf6ee;
  --paper: #f8ebdc;
  --ink: #2b1a14;
  --ink-2: #5a4136;
  --ink-3: #7d6458;
  --red: #3f8a2a;          /* primary buttons: lettuce green */
  --red-dk: #2f6a1e;
  --bulb: #e8b04a;
  --amber: #e0913a;
  --cobalt: #c4513a;       /* tomato: second accent */
  --turf: #a8703f;         /* the race board */
  --turf-2: #9d6738;
  --plank: #8a5a32;
  --plank-dk: #6b4223;
  --tin: #e2d3c0;
  --moss: #2f4a28;
  --walnut: #5b3a22;
  --chalk: rgba(253, 246, 238, .86);
  --up: #2f7d32;
  --down: #c0392b;
  --display: 'Coustard', Georgia, serif;
  --text: 'Urbanist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Anonymous Pro', ui-monospace, Menlo, monospace;
  --chalkfont: 'Caveat Brush', 'Comic Sans MS', cursive;
}

/* a garden wall: soft brick courses in the plaster */
body {
  background-color: var(--wall);
  background-image: repeating-linear-gradient(180deg, transparent 0 46px, rgba(160, 82, 50, .07) 46px 48px);
}
h1, h2, h3 { font-weight: 900; letter-spacing: -.005em; }
h1 { font-size: clamp(44px, 6vw, 80px); }
.hero h1 .h1b { color: var(--red); text-shadow: 3px 3px 0 var(--ink); }
.lede { font-weight: 500; }

.btn { font-weight: 800; }
.btn:hover { background: #4b9b33; }
.step h3::before { color: var(--red); }
.ticket-head .fee-in { color: var(--cobalt); }

/* the header: a walnut sign board, the bottom edge a row of lettuce leaves */
.top { background: var(--walnut); background-image: repeating-linear-gradient(90deg, rgba(0, 0, 0, .07) 0 3px, transparent 3px 41px, rgba(255, 255, 255, .04) 41px 43px, transparent 43px 97px); }
.brand-horse { width: 80px; height: 50px; }
.brand-word { font-weight: 900; letter-spacing: 0; }
.bulbs {
  bottom: -1px; height: 14px;
  background: radial-gradient(ellipse 13px 9px at 50% 100%, #6cbf3b 0 92%, var(--ink) 94% 100%, transparent 101%) 0 0 / 24px 14px repeat-x;
}
.nav a:hover { border-color: rgba(253, 246, 238, .45); }

/* the booth: a green-painted potting bench around the board */
.booth { background: var(--moss); background-image: linear-gradient(180deg, rgba(255, 255, 255, .06), transparent 40%); }
.booth-sign { background: var(--cream); border-radius: 6px; }
.booth-sign .t-name { font-weight: 900; }
.booth-sign .clock { font-weight: 900; }
.shelf::after { background: linear-gradient(var(--plank), var(--plank-dk)); }
.pot .pot-label { color: var(--cream); }

/* the race board: planks of wood, chalk lanes */
.track {
  background-color: var(--turf);
  background-image:
    repeating-linear-gradient(90deg, rgba(60, 30, 10, .12) 0 2px, transparent 2px 120px),
    repeating-linear-gradient(180deg, rgba(255, 230, 200, .05) 0 6px, transparent 6px 13px);
  border-radius: 6px;
  --lane-h: 74px;
}
.mini-booth .track { --lane-h: 50px; }
.lane { border-bottom: 0; }
.lane:nth-child(even) { background: transparent; }
.lane + .lane::before { content: ''; position: absolute; left: 34px; right: 30px; top: -1px; height: 0; border-top: 2.5px dashed var(--chalk); opacity: .7; }
/* the chalk line each snail slides along */
.lane::after { left: 46px; right: 32px; bottom: 9px; height: 3px; border-radius: 2px; background: var(--chalk); box-shadow: none; opacity: .5; }
.lane-no { background: var(--plank-dk); color: var(--cream); border-right: 2.5px solid var(--ink); font: 400 26px/1 var(--chalkfont); }
.lane-empty { color: var(--cream); }
.zero { border-left: 3px dashed var(--chalk); }
.zero span { font: 400 16px/1 var(--chalkfont); color: var(--cream); top: 2px; }

/* the lettuce finish */
.finish {
  width: 30px; border-left: 2.5px solid var(--ink);
  background: #4f9a2b url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath d='M2 15 C2 5 12 1 18 6 C26 2 31 10 27 16 C31 23 24 30 16 27 C8 30 2 24 2 15 Z' fill='%237cc243' stroke='%232b1a14' stroke-width='1.6'/%3E%3Cpath d='M8 16 C12 13 17 13 24 15 M14 10 C15 14 15 19 13 24' fill='none' stroke='%232f6a1e' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E") 0 0 / 30px 26px repeat-y;
}

/* the snails: 240 x 150 symbol, coin on the shell, a slime trail behind */
.runner.snail { --hw: calc((var(--lane-h, 64px) - 8px) * 1.6); left: calc(46px + (100% - 46px - 32px - var(--hw)) * var(--x, 0)); bottom: 6px; }
.runner.snail .disc { left: 37.1%; top: 27.5%; width: 18.3%; border-width: 2px; }
.runner.snail .rod {
  --x: inherit; left: auto; right: 84%; bottom: 1px; width: calc(var(--x, 0) * 900%); max-width: 700%; min-width: 0; height: 7px;
  border: 0; border-radius: 4px; background: linear-gradient(90deg, rgba(235, 245, 248, 0), rgba(235, 245, 248, .7)); box-shadow: 0 1px 0 rgba(255, 255, 255, .25);
}
.tag { border-radius: 4px; }
.runner.p1 .tag { background: #dff0c8; }
.runner.me .tag { background: #ffe1a8; }

/* paper bits */
.panel, .ticket { border-radius: 8px; }
.dlg-head { background: var(--moss); }
.seg button[aria-pressed='true'] { box-shadow: 3px 3px 0 var(--red); }
.test-note { background: #f9e6d9; border-color: var(--wall-2); }
.toast { box-shadow: 4px 4px 0 var(--red); }
.foot { border-top-color: var(--red); background: #2b1a14; color: #e2d0c4; }
.hits button:hover, .hits button:focus-visible, .wallets button:hover, .standings tr.me td { background: #fbe6c8; }

@media (max-width: 640px) {
  .track { --lane-h: 54px; }
  .brand-horse { width: 60px; height: 38px; }
  .lane-no { font-size: 20px; }
  .lane::after { left: 32px; right: 22px; }
  .lane + .lane::before { left: 24px; right: 22px; }
  .runner.snail { left: calc(30px + (100% - 30px - 22px - var(--hw)) * var(--x, 0)); }
  .finish { width: 20px; background-size: 20px 18px; }
}
