/* Mouse: a lab maze race. White glazed lab tiles, a header cut from a slice of Emmental with its rind, a birch-plywood
   maze seen from above (ply edges on every wall, doors and dead ends between the corridors), white lab mice with
   coloured ear tags and the coin on the back, a tracking line behind each one, a cheese wedge at every exit,
   waxed cheese wedges for 1st/2nd/3rd on a steel shelf and a lab balance that weighs the pot. */
@font-face { font-family: 'Cherry Bomb One'; src: url(/fonts/cherrybomb.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: 'Host Grotesk'; src: url(/fonts/hostgrotesk.woff2) format('woff2'); font-weight: 300 800; font-display: swap; }
@font-face { font-family: 'Lekton'; src: url(/fonts/lekton.woff2) format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --wall: #f1f2ee;          /* glazed lab tile */
  --wall-2: #dfe2da;
  --cream: #fdfdfb;         /* lab white */
  --paper: #f7f6f0;
  --ink: #1f2328;           /* graphite */
  --ink-2: #474c54;
  --ink-3: #6b7078;
  --red: #f5be2e;           /* primary: cheese */
  --red-dk: #d99a12;
  --bulb: #ffd65c;
  --amber: #e2a516;
  --cobalt: #4352c8;        /* nitrile-glove blue: second accent */
  --wax: #c7392b;           /* cheese wax */
  --turf: #ecece5;          /* maze floor */
  --turf-2: #e3e3db;
  --plank: #e6c995;         /* birch plywood */
  --plank-dk: #b98f52;
  --tin: #d8dce0;           /* steel */
  --herb: #2f9a6a;
  --up: #1e7a4c;
  --down: #c8382b;
  --edge: 2.5px solid var(--ink);
  --shadow: 4px 4px 0 var(--ink);
  --r: 14px;
  --display: 'Cherry Bomb One', 'Arial Rounded MT Bold', 'Cooper Black', sans-serif;
  --text: 'Host Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Lekton', ui-monospace, 'SF Mono', Menlo, monospace;
}

/* glazed white tiles with pale grout */
body {
  background-color: var(--wall);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='104' height='104'%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%23fff' stop-opacity='.55'/%3E%3Cstop offset='.6' stop-color='%23fff' stop-opacity='0'/%3E%3C/linearGradient%3E%3Crect x='1' y='1' width='101' height='101' rx='3' fill='url(%23g)'/%3E%3Cpath d='M0 103 H104 M103 0 V104' stroke='%23b9beb5' stroke-opacity='.42' stroke-width='2'/%3E%3C/svg%3E");
}
h1, h2, h3 { letter-spacing: .005em; line-height: 1.08; }
h1 { font-size: clamp(38px, 4.4vw, 62px); }
.hero h1 { font-size: clamp(38px, 3.9vw, 54px); line-height: 1.12; }
.hero h1 .h1b { color: var(--red); -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; text-shadow: 4px 4px 0 var(--ink); margin-top: 4px; }
h2 { font-size: clamp(28px, 3.3vw, 40px); }
.lede { font-weight: 450; }

.btn { color: var(--ink); font-weight: 750; border-radius: 12px; }
.btn:hover { background: #ffcb45; }
.btn-cream:hover { background: #fff; }
.btn-ink { color: var(--cream); }
.btn-ink:hover { background: #333941; }
.step h3::before { color: var(--cobalt); }
.ticket-head .fee-in { color: var(--cobalt); }
.link { color: var(--ink); }

/* the header: a slice of Emmental, holes and all, the rind along its lower edge */
.top {
  color: var(--ink); border-bottom: 0;
  background-color: var(--red);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='460' height='150'%3E%3Cg fill='%23de9f15'%3E%3Cellipse cx='44' cy='34' rx='15' ry='11'/%3E%3Cellipse cx='142' cy='98' rx='23' ry='17'/%3E%3Cellipse cx='226' cy='28' rx='9' ry='7'/%3E%3Cellipse cx='318' cy='76' rx='17' ry='13'/%3E%3Cellipse cx='402' cy='124' rx='10' ry='8'/%3E%3Cellipse cx='270' cy='132' rx='7' ry='5.5'/%3E%3Cellipse cx='86' cy='136' rx='8' ry='6'/%3E%3Cellipse cx='430' cy='26' rx='12' ry='9'/%3E%3C/g%3E%3Cg fill='%23f9cd52'%3E%3Cellipse cx='44' cy='37' rx='12' ry='7.5'/%3E%3Cellipse cx='142' cy='102' rx='19' ry='12'/%3E%3Cellipse cx='226' cy='30' rx='7' ry='4.6'/%3E%3Cellipse cx='318' cy='79.5' rx='14' ry='9'/%3E%3Cellipse cx='402' cy='126.5' rx='8' ry='5.4'/%3E%3Cellipse cx='270' cy='134' rx='5.5' ry='3.5'/%3E%3Cellipse cx='86' cy='138' rx='6.4' ry='4'/%3E%3Cellipse cx='430' cy='28.5' rx='9.6' ry='6'/%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(180deg, #f8c93f, #f2b624);
}
.top-in { min-height: 98px; padding-bottom: 18px; }
.brand { gap: 12px; color: var(--ink); }
.brand-horse { width: 64px; height: 60px; filter: drop-shadow(3px 3px 0 var(--ink)); }
.brand-word { font: 400 46px/1 var(--display); letter-spacing: .01em; color: var(--ink); text-shadow: 3px 3px 0 #fff3c9; translate: 0 2px; }
.nav a { color: var(--ink); font-weight: 750; }
.nav a:hover { border-color: rgba(31, 35, 40, .35); }
.top .btn { background: var(--cream); color: var(--ink); }
.top .btn:hover { background: #fff; }
.mode-note { color: var(--ink); }
.bulbs {
  bottom: 0; height: 13px; border-bottom: var(--edge);
  background: linear-gradient(180deg, rgba(31, 35, 40, .18) 0 1.5px, #e9ad36 1.5px, #c98a2a);
}
.nav-mobile { padding-bottom: 24px; }
.nav-mobile a { color: var(--ink); font-weight: 750; border-color: rgba(31, 35, 40, .3); }

/* the maze: birch plywood, seen from above */
.booth {
  border-radius: 14px; padding: 11px;
  background-color: var(--plank);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='240'%3E%3Cfilter id='w'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.003 .07' numOctaves='3' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 .55 0 0 0 0 .36 0 0 0 0 .14 0 0 0 .9 -.32'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23w)'/%3E%3C/svg%3E"),
    linear-gradient(170deg, #efd6a8, #e3c48c 60%, #dcba7e);
}
.booth-sign { border-radius: 8px; background: var(--cream); border-top: 8px solid var(--red); }
.booth-sign .clock { font-size: 26px; }
.booth-sign .t-meta { color: var(--ink-3); }
.booth-more, .booth-more a { color: var(--ink); text-shadow: none; }

/* prizes: waxed cheese wedges and the balance on a steel shelf */
.shelf { padding-top: 12px; }
.shelf::after { height: 14px; border-radius: 4px; background: linear-gradient(180deg, #f6f8f9, #ccd2d7 50%, #9ea6ad); }
.prize { margin-bottom: 9px; }
.prize svg { width: clamp(58px, 7vw, 82px); height: clamp(53px, 6.45vw, 75px); }
.prize b { top: 37%; font: 400 clamp(12px, 1.25vw, 15px)/1 var(--display); color: var(--ink); }
.prize span { margin-top: 0; border-radius: 6px; }
.pot { margin-bottom: 5px; }
.pot svg { width: clamp(72px, 8.6vw, 100px); height: clamp(90px, 10.75vw, 125px); }
.pot .pot-sum { top: 60.5%; background: #25332a; color: #c8f5a6; border: 0; border-radius: 3px; padding: 2px 4px; font: 400 clamp(10px, 1.05vw, 13px)/1 var(--mono); letter-spacing: -.02em; }
.pot .pot-label { color: var(--ink); text-shadow: none; }

/* the maze floor and its corridors */
.track {
  --lane-h: 72px; --start: 42px; --fin: 46px;
  container-type: inline-size;
  margin-top: 11px; border-radius: 8px; border-width: 3px;
  background-color: var(--turf);
  background-image:
    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='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .35 0 0 0 0 .3 0 0 0 .35 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.4'/%3E%3C/svg%3E"),
    linear-gradient(90deg, #f3f3ee, #ebebe4 60%, #f2efdf);
}
.mini-booth .track { --lane-h: 50px; }
.lane { border-bottom: 0; }
.lane:nth-child(even) { background: none; }
/* wall between two corridors, ply edge showing, with a door in it */
.lane + .lane::before {
  content: ''; position: absolute; z-index: 2; left: 34px; right: 0; top: -5px; height: 10px;
  background: linear-gradient(180deg, #7d5b2c 0 1.2px, #ead1a1 1.2px 3px, #c59a5c 3px 4.2px, #f0dbb1 4.2px 5.8px, #c59a5c 5.8px 7px, #e3c58f 7px 8.8px, #7d5b2c 8.8px);
  box-shadow: 0 3px 0 rgba(60, 50, 30, .1);
  -webkit-mask: linear-gradient(90deg, #000 0 var(--d1, 26%), transparent 0 var(--d2, 33%), #000 0 var(--d3, 68%), transparent 0 var(--d4, 74%), #000 0);
          mask: linear-gradient(90deg, #000 0 var(--d1, 26%), transparent 0 var(--d2, 33%), #000 0 var(--d3, 68%), transparent 0 var(--d4, 74%), #000 0);
}
.lane:nth-child(3n) { --d1: 44%; --d2: 51%; --d3: 88%; --d4: 88%; }
.lane:nth-child(3n+1) { --d1: 14%; --d2: 21%; --d3: 79%; --d4: 85%; }
/* a dead end hanging off the wall */
.lane::after {
  left: var(--s, 38%); right: auto; top: 0; bottom: auto; width: 10px; height: 36%; border-radius: 0 0 2px 2px; z-index: 2;
  background: linear-gradient(90deg, #7d5b2c 0 1.2px, #ead1a1 1.2px 3px, #c59a5c 3px 4.2px, #f0dbb1 4.2px 5.8px, #c59a5c 5.8px 7px, #e3c58f 7px 8.8px, #7d5b2c 8.8px);
  box-shadow: 2px 2px 0 rgba(60, 50, 30, .1);
}
.lane:nth-child(4n+2)::after { --s: 61%; top: auto; bottom: 0; border-radius: 2px 2px 0 0; }
.lane:nth-child(4n+3)::after { --s: 24%; }
.lane:nth-child(4n)::after { --s: 74%; top: auto; bottom: 0; border-radius: 2px 2px 0 0; }
/* the start box: numbered, its door the blue line */
.lane-no { width: 34px; background: var(--cream); border-right: 4px solid var(--cobalt); font: 400 20px/1 var(--display); color: var(--ink); box-shadow: 1px 0 0 var(--ink); }
.lane-empty { color: var(--ink-2); text-shadow: none; }
.zero { border-left: 2.5px dashed rgba(31, 35, 40, .45); }
.zero span { font: 400 12px/1 var(--mono); color: var(--ink-2); top: 4px; }

/* the exit: a cheese wedge waiting at the end of every corridor */
.finish {
  width: 46px; border-left: 2.5px solid var(--ink);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 46 72'%3E%3Cpath d='M6 40 L38 26 V50 L6 54 Z' fill='%23f5be2e' stroke='%231f2328' stroke-width='2.2' stroke-linejoin='round'/%3E%3Cpath d='M6 40 L26 22 L38 26 Z' fill='%23ffe28e' stroke='%231f2328' stroke-width='2.2' stroke-linejoin='round'/%3E%3Cpath d='M34 27.7 L38 26 V50 L34 50.5 Z' fill='%23c7392b'/%3E%3Cg fill='%23d89a12'%3E%3Cellipse cx='16' cy='47' rx='2.6' ry='2'/%3E%3Cellipse cx='27' cy='42' rx='2.2' ry='1.7'/%3E%3C/g%3E%3C/svg%3E") 50% 0 / 46px var(--lane-h, 72px) repeat-y, #fbf1cf;
}

/* the mice: 240 x 100 symbol, coin on the back, ear tag, tracking line behind */
.runner.mouse {
  --hw: calc((var(--lane-h, 64px) - 18px) * 2.4);
  top: 9px; bottom: 9px;
  left: calc(var(--start) + (100% - var(--start) - var(--fin) - var(--hw)) * var(--x, 0));
}
.runner.mouse .horse { inset: 0; height: 100%; transform-origin: 30% 50%; animation: sniff 1.1s ease-in-out infinite; }
.lane:nth-child(2n) .runner.mouse .horse { animation-delay: -.4s; }
.lane:nth-child(3n) .runner.mouse .horse { animation-delay: -.75s; }
@keyframes sniff { 0%, 100% { transform: rotate(-1.4deg); } 50% { transform: rotate(1.4deg) translateX(1px); } }
@media (prefers-reduced-motion: reduce) { .runner.mouse .horse { animation: none; } }
.runner.mouse .disc { left: 41.2%; top: 31%; width: 15.8%; border-width: 2px; box-shadow: 0 1px 0 rgba(255, 255, 255, .6); }
.runner.mouse .rod {
  --x: inherit; left: auto; right: 55%; top: 50%; bottom: auto; translate: 0 -50%; z-index: -1;
  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: var(--trk, #f5be2e); opacity: .85;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='10'%3E%3Cpath d='M0 5 L6 2.5 L11 6.5 L17 3 L23 7 L28 4 L34 6.5 L39 2.8 L44 5' fill='none' stroke='%23000' stroke-width='2.6' stroke-linejoin='round'/%3E%3C/svg%3E") 0 50% / 44px 10px repeat-x;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='10'%3E%3Cpath d='M0 5 L6 2.5 L11 6.5 L17 3 L23 7 L28 4 L34 6.5 L39 2.8 L44 5' fill='none' stroke='%23000' stroke-width='2.6' stroke-linejoin='round'/%3E%3C/svg%3E") 0 50% / 44px 10px repeat-x;
}
.lane:nth-child(8n+1) { --trk: #f5be2e; } .lane:nth-child(8n+2) { --trk: #4352c8; } .lane:nth-child(8n+3) { --trk: #c7392b; } .lane:nth-child(8n+4) { --trk: #2f9a6a; }
.lane:nth-child(8n+5) { --trk: #8a4fb8; } .lane:nth-child(8n+6) { --trk: #ee7d22; } .lane:nth-child(8n+7) { --trk: #1f2328; } .lane:nth-child(8n) { --trk: #36a3c9; }
.tag { border-radius: 6px; }
.tag em { font: 700 13.5px/1.1 var(--mono); }
.mono, .addr, .pick .w, .results .when { letter-spacing: 0; }
.runner.p1 .tag { background: #fff0bf; }
.runner.me .tag { background: var(--bulb); }

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

@media (max-width: 640px) {
  .top-in { min-height: 78px; }
  .brand-horse { width: 48px; height: 45px; }
  .brand-word { font-size: 34px; }
  .track { --lane-h: 58px; --start: 28px; --fin: 28px; }
  .runner.mouse { top: 8px; bottom: 8px; --hw: calc((var(--lane-h, 58px) - 16px) * 2.4); }
  .lane-no { width: 24px; font-size: 15px; border-right-width: 3px; }
  .lane + .lane::before { left: 24px; height: 8px; top: -4px; }
  .lane::after { width: 8px; }
  .finish { width: 28px; background-size: 28px var(--lane-h, 58px); }
  .booth { padding: 7px; border-radius: 12px; }
  .hero h1 { font-size: clamp(34px, 9.6vw, 44px); }
  .tag em { font-size: 12px; }
}
