/* DERBY — tote board. Light chalk page, black tote panels with amber figures,
   skewed racing plates, horizontal lanes. */

:root {
  --chalk: #f3f2ee;
  --chalk-2: #eae9e3;
  --card: #ffffff;
  --ink: #0e0f12;
  --ink-2: #44474f;
  --mute: #868993;
  --rule: #dfded7;
  --rule-2: #c8c7bf;
  --tote: #0e0f12;
  --tote-2: #1a1c21;
  --tote-line: #2b2e35;
  --amber: #ffb21a;
  --hot: #ff4d12;
  --hot-ink: #c73a06;
  --win: #0a8a4a;
  --win-bg: #e3f4ea;
  --loss: #d1203c;
  --loss-bg: #fbe6ea;
  --disp: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Barlow", system-ui, sans-serif;
  --mono: "Red Hat Mono", ui-monospace, monospace;
  --skew: -12deg;
  --wrap: 1240px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--chalk);
  color: var(--ink);
  font: 500 15px/1.5 var(--body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
img { display: block; }
h1, h2, h3, h4 { margin: 0; font-family: var(--disp); font-weight: 800; font-style: italic; text-transform: uppercase; letter-spacing: .005em; line-height: .95; }
h1 { font-size: clamp(40px, 6vw, 68px); }
h2 { font-size: 30px; }
h3 { font-size: 19px; letter-spacing: .02em; }
h4 { font-size: 21px; }
p { margin: 0 0 12px; }
code, .mono { font-family: var(--mono); font-size: .92em; letter-spacing: -.01em; }
.num { font-family: var(--disp); font-weight: 700; font-variant-numeric: tabular-nums; }
.dim { color: var(--mute); }
.small { font-size: 13px; }
.up { color: var(--win); }
.down { color: var(--loss); }
.hot { color: var(--hot-ink); }
.eyebrow { font: 600 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--mute); }
:focus-visible { outline: 2px solid var(--hot); outline-offset: 2px; }
::selection { background: var(--amber); color: var(--ink); }

/* ---------------- header ---------------- */

.top { position: sticky; top: 0; z-index: 30; background: rgba(243, 242, 238, .92); backdrop-filter: blur(10px); border-bottom: 2px solid var(--ink); }
.top-in { max-width: var(--wrap); margin: 0 auto; height: 64px; padding: 0 20px; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-word {
  font: italic 900 30px/1 var(--disp); letter-spacing: .02em;
  padding: 4px 14px 3px 10px; background: var(--ink); color: var(--chalk);
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}
.brand-word::after { content: ""; display: inline-block; width: 7px; height: 7px; background: var(--hot); margin-left: 4px; transform: skewX(var(--skew)); vertical-align: 2px; }
.brand-net:empty { display: none; }
.brand-net { font: 600 10px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--hot-ink); border: 1.5px solid var(--hot); padding: 4px 6px 3px; }
.nav { display: flex; gap: 2px; height: 100%; }
.nav a {
  display: flex; align-items: center; padding: 0 14px; height: 100%;
  font: italic 700 18px/1 var(--disp); text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2);
  border-bottom: 4px solid transparent; margin-bottom: -2px;
}
.nav a:hover { color: var(--ink); }
.nav a.on { color: var(--ink); border-bottom-color: var(--hot); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-link { width: 36px; height: 36px; display: grid; place-items: center; color: var(--ink-2); }
.icon-link:hover { color: var(--ink); }
.icon-link svg { width: 18px; height: 18px; }

/* wallet: a skewed black plate with the wallet's silks in the leading edge */
.slip {
  position: relative; isolation: isolate; display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 20px 0 0;
  border: 0; background: none; color: #fff; cursor: pointer;
}
.slip::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--ink); transform: skewX(var(--skew)); box-shadow: 3px 3px 0 var(--hot); transition: box-shadow .15s; }
.slip:hover::before { box-shadow: 5px 4px 0 var(--hot); }
.slip:active { transform: translateY(1px); }
.slip-silk { width: 30px; height: 42px; margin-left: -4px; transform: skewX(var(--skew)); background: var(--hot); flex: none; overflow: hidden; border-right: 2px solid var(--chalk); }
.slip-silk svg { width: 140%; height: 100%; margin-left: -20%; display: block; transform: skewX(12deg); }
.slip-text { display: flex; flex-direction: column; line-height: 1; text-align: left; }
.slip-text b { font: italic 800 17px/1 var(--disp); text-transform: uppercase; letter-spacing: .04em; }
.slip-text small { font: 500 10px/1.2 var(--mono); color: #a3a6ae; letter-spacing: .06em; margin-top: 3px; }
.slip.on .slip-text b { font: 600 14px/1 var(--mono); text-transform: none; letter-spacing: 0; font-style: normal; }

.burger { display: none; width: 42px; height: 42px; border: 2px solid var(--ink); background: transparent; cursor: pointer; padding: 10px 9px; flex-direction: column; justify-content: space-between; }
.burger i { display: block; width: 100%; height: 2px; background: var(--ink); }

/* ---------------- layout ---------------- */

.view { flex: 1; width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 28px 20px 64px; outline: none; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 44px 0 16px; }
.section-head h2, .section-head h1 { margin-top: 6px; }
.grid { display: grid; gap: 18px; align-content: start; }

.card { background: var(--card); border: 1px solid var(--rule); border-top: 3px solid var(--ink); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--rule); }
.card-head h3 { font-size: 18px; }

/* ---------------- buttons ---------------- */

/* skewed plates: only the ::before backing is slanted, the text stays upright */
.btn, .badge, .plate { position: relative; isolation: isolate; }
.btn::before, .badge::before, .plate::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--b, transparent); box-shadow: var(--sh, none);
  transform: skewX(var(--skew)); transition: box-shadow .15s, background .15s, transform .12s;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 26px; border: 0; background: none; cursor: pointer; white-space: nowrap;
  font: italic 800 18px/1 var(--disp); text-transform: uppercase; letter-spacing: .05em;
  transition: color .15s, transform .12s;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-go { --b: var(--hot); --sh: 4px 4px 0 var(--ink); color: #fff; }
.btn-go:hover:not(:disabled) { --sh: 7px 6px 0 var(--ink); }
.btn-ghost { --sh: inset 0 0 0 2px var(--ink); color: var(--ink); }
.btn-ghost:hover { --b: var(--ink); color: #fff; }
.btn-win { --b: var(--win); --sh: 4px 4px 0 var(--ink); color: #fff; }
.btn-loss { --b: var(--loss); --sh: 4px 4px 0 var(--ink); color: #fff; }
.btn-sm { height: 34px; padding: 0 18px; font-size: 15px; }
.btn-lg { height: 54px; font-size: 22px; }
.btn-block { display: flex; width: calc(100% - 12px); margin-left: 6px; }

.badge {
  display: inline-flex; align-items: center; height: 22px; padding: 0 10px;
  font: italic 800 13px/1 var(--disp); text-transform: uppercase; letter-spacing: .06em;
  --b: var(--chalk-2); color: var(--ink-2);
}
.badge.hot { --b: var(--amber); color: var(--ink); }
.badge.win { --b: var(--win); color: #fff; }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.chip { display: inline-flex; align-items: center; height: 28px; padding: 0 11px; border: 1.5px solid var(--rule-2); font-size: 13px; font-weight: 600; background: var(--card); }
.chip:hover { border-color: var(--ink); }

/* silks */
.silk { position: relative; display: inline-block; width: 26px; height: 26px; flex: none; outline: 1px solid rgba(14, 15, 18, .18); outline-offset: -1px; }
.silk svg { width: 100%; height: 100%; display: block; }
.silk-num {
  position: absolute; right: -5px; bottom: -5px; min-width: 16px; height: 16px; padding: 0 3px;
  background: var(--ink); color: #fff; font: italic 800 11px/16px var(--disp); text-align: center;
}

/* ---------------- tote (race header) ---------------- */

.tote { background: var(--tote); color: #fff; display: grid; grid-template-columns: 1.1fr 1.6fr; position: relative; overflow: hidden; }
.tote::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 8px; background: var(--hot); }
.tote-head { padding: 30px 30px 28px 38px; display: flex; flex-direction: column; gap: 14px; border-right: 1px solid var(--tote-line); }
.tote-head h1 { color: #fff; font-size: clamp(38px, 4.6vw, 60px); }
.tote-head h1 em { color: var(--amber); font-style: italic; }
.tote-head p { color: #a3a6ae; max-width: 440px; margin: 0; font-size: 15px; }
.live { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; font: 600 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--amber); }
.live i { width: 8px; height: 8px; background: var(--win); box-shadow: 0 0 0 0 rgba(10, 138, 74, .7); animation: ping 1.8s infinite; }
.live.photo { color: var(--hot); }
.live.photo i { background: var(--hot); }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(36, 196, 110, .6); } 100% { box-shadow: 0 0 0 9px rgba(36, 196, 110, 0); } }
.tote-cells { display: grid; grid-template-columns: 1.4fr 1fr; grid-template-rows: 1fr 1fr; }
.tc { padding: 20px 24px; border-bottom: 1px solid var(--tote-line); border-right: 1px solid var(--tote-line); display: flex; flex-direction: column; justify-content: space-between; gap: 8px; min-width: 0; }
.tc:nth-child(2n) { border-right: 0; }
.tc:nth-child(n+3) { border-bottom: 0; }
.tc .eyebrow { color: #7d808a; }
.tc b { font: italic 800 44px/1 var(--disp); color: var(--amber); font-variant-numeric: tabular-nums; letter-spacing: .01em; white-space: nowrap; }
.tc b small { font-size: .45em; color: #a3a6ae; margin-left: 6px; letter-spacing: .06em; }
.tc span.sub { font-size: 13px; color: #a3a6ae; }
.tc-purse { grid-row: span 2; background: var(--tote-2); justify-content: center; gap: 14px; }
.tc-purse b { font-size: clamp(64px, 8vw, 104px); }
.tc-purse .split { display: flex; gap: 6px; }
.tc-purse .split span { font: italic 800 14px/1 var(--disp); padding: 5px 10px; --b: #2b2e35; color: #e6e7ea; letter-spacing: .05em; }
.tc-purse .split span:first-child { --b: var(--amber); color: var(--ink); }
.tc .pulse { color: var(--hot); animation: blink 1.1s steps(2, start) infinite; }
@keyframes blink { 50% { opacity: .45; } }

/* ---------------- the straight ---------------- */

.straight { margin-top: 18px; background: var(--card); border: 1px solid var(--rule); border-top: 3px solid var(--ink); position: relative; }
.straight-head { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--rule); }
.straight-head h2 { font-size: 24px; }
.straight-head .dim { margin-left: auto; }
.photo-flag { display: none; font: italic 900 15px/1 var(--disp); letter-spacing: .14em; padding: 6px 12px; --b: var(--hot); color: #fff; animation: blink 1s steps(2, start) infinite; }
.straight.photo .photo-flag { display: inline-block; }

.lanes-scale, .lane { display: grid; grid-template-columns: 52px minmax(120px, 190px) 1fr 132px; align-items: center; }
.lanes-scale { height: 30px; border-bottom: 1px solid var(--rule); font: 500 10px/1 var(--mono); color: var(--mute); letter-spacing: .1em; }
.lanes-scale .scale { grid-column: 3; display: flex; justify-content: space-between; padding: 0 16px 0 24px; position: relative; height: 100%; align-items: center; }
.lanes-scale .scale span { width: 0; display: flex; justify-content: center; white-space: nowrap; }
.lanes-scale .scale span:last-child { color: var(--ink); font-weight: 600; }

.lanes { position: relative; }
.lane { height: 58px; border-bottom: 1px solid var(--rule); cursor: pointer; position: relative; background: var(--card); transition: background .2s; }
.lane:nth-child(even) { background: #fafaf7; }
.lane:hover { background: #fff7e6; }
.lane:last-child { border-bottom: 0; }
.post {
  --c1: #ccc; --c2: #999;
  height: 100%; display: grid; place-items: center; color: #fff;
  font: italic 900 24px/1 var(--disp);
  background: linear-gradient(135deg, var(--c1) 0 55%, var(--c2) 55% 100%);
  text-shadow: 0 1px 0 rgba(0, 0, 0, .55), 0 0 6px rgba(0, 0, 0, .35);
}
.lane-name { padding: 0 14px; display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.lane-name b { font: italic 800 20px/1 var(--disp); text-transform: uppercase; letter-spacing: .02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lane-name small { color: var(--mute); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 3px; }
.lane-run {
  position: relative; height: 100%;
  background: repeating-linear-gradient(90deg, transparent 0 calc(25% - 1px), var(--rule) calc(25% - 1px) 25%);
  margin: 0 16px 0 24px;
}
.lane-run::before { /* gate line */
  content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 2px; background: var(--rule-2);
}
.lane-run::after { /* finish post */
  content: ""; position: absolute; right: -16px; top: 0; bottom: 0; width: 8px;
  background: repeating-linear-gradient(180deg, var(--ink) 0 6px, #fff 6px 12px);
}
.trail {
  position: absolute; left: 0; top: 50%; height: 10px; margin-top: -5px; width: var(--x, 0%);
  background: linear-gradient(90deg, rgba(14, 15, 18, 0), rgba(14, 15, 18, .14));
  transition: width 1.4s cubic-bezier(.2, .8, .2, 1);
}
.lane.placed .trail { background: linear-gradient(90deg, rgba(255, 178, 26, 0), rgba(255, 178, 26, .7)); }
.lane.lead .trail { background: linear-gradient(90deg, rgba(255, 77, 18, 0), rgba(255, 77, 18, .85)); }
.runner {
  position: absolute; bottom: 2px; left: calc((100% - 66px) * var(--xf, 0)); width: 66px; height: 46px; z-index: 1;
  transition: left 1.4s cubic-bezier(.2, .8, .2, 1);
}
.runner .horse { width: 100%; height: 100%; display: block; overflow: visible; }
.lane.lead .runner::after {
  content: "LEAD"; position: absolute; right: -6px; top: -3px; padding: 2px 5px 1px; background: var(--hot); color: #fff;
  font: italic 900 10px/1 var(--disp); letter-spacing: .1em; transform: skewX(var(--skew));
}
.runner.kick { animation: kick .5s cubic-bezier(.2, .8, .2, 1); }
@keyframes kick { 30% { transform: translateX(6px) rotate(-3deg); } }
.dust {
  position: absolute; bottom: 4px; left: calc((100% - 66px) * var(--xf, 0) + 8px); width: 8px; height: 8px; border-radius: 50%;
  background: #c9b48a; opacity: 0; pointer-events: none; animation: dust 1.1s ease-out forwards;
}
@keyframes dust { 0% { opacity: .8; transform: translate(0, 0) scale(.6); } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(2.2); } }

/* gallop strip at the foot of the tote */
.tote-run {
  grid-column: 1 / -1; position: relative; height: 92px; overflow: hidden; border-top: 1px solid var(--tote-line);
  background:
    linear-gradient(180deg, transparent 0 74px, #2a1d12 74px 100%),
    linear-gradient(180deg, #14161b, #101216);
}
.tote-run .rail { position: absolute; left: 0; right: 0; top: 18px; height: 4px; background: #e9e7df; opacity: .85; }
.tote-run .posts { position: absolute; left: 0; top: 18px; width: 200%; height: 56px;
  background: repeating-linear-gradient(90deg, transparent 0 116px, rgba(233, 231, 223, .55) 116px 120px);
  -webkit-mask: linear-gradient(180deg, #000 0 100%); animation: rail 1.1s linear infinite; }
.tote-run .turf { position: absolute; left: 0; bottom: 0; width: 200%; height: 18px;
  background: repeating-linear-gradient(90deg, #2a1d12 0 22px, #34241a 22px 44px); animation: rail .55s linear infinite; }
@keyframes rail { to { transform: translateX(-120px); } }
.tote-run .pack { position: absolute; left: 0; right: 0; bottom: 8px; height: 70px; }
.tote-run .pony { position: absolute; bottom: 0; width: 96px; height: 67px; transition: left 1.6s cubic-bezier(.2, .8, .2, 1); --hc: #f3f2ee; --mane: #c9c6ba; --hoof: #8a877c; }
.tote-run .pony .horse { width: 100%; height: 100%; overflow: visible; }
.tote-run .pony .shadow { fill: rgba(0, 0, 0, .5); }
.tote-run .pony .tag {
  position: absolute; left: 50%; top: -10px; transform: translateX(-50%) skewX(var(--skew)); white-space: nowrap;
  padding: 3px 7px 2px; background: #22252c; color: #fff; font: italic 800 13px/1 var(--disp); letter-spacing: .04em;
}
.tote-run .pony.p1 .tag { background: var(--amber); color: var(--ink); }
.tote-run .pony.p1 { --hc: #fff; }
.tote-run .finish-post { position: absolute; right: 22px; top: 6px; bottom: 0; width: 10px; background: repeating-linear-gradient(180deg, #fff 0 8px, var(--ink) 8px 16px); box-shadow: 0 0 0 2px var(--ink); }
.tote-run .finish-post::before { content: "FINISH"; position: absolute; right: 16px; top: 0; font: 500 10px/1 var(--mono); letter-spacing: .16em; color: #7d808a; }

.icon-link[hidden] { display: none !important; }

/* confetti */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 90; overflow: hidden; }
.confetti i { position: absolute; display: block; border-radius: 1px; }
.confetti i.fall { animation: cfall linear forwards; }
.confetti i.burst { animation: cburst cubic-bezier(.15, .7, .3, 1) forwards; }
@keyframes cfall { 0% { transform: translate(0, 0) rotate(0); opacity: 1; } 100% { transform: translate(var(--dx), var(--fall)) rotate(var(--rot)); opacity: .9; } }
@keyframes cburst { 0% { transform: translate(0, 0) rotate(0); opacity: 1; } 45% { transform: translate(var(--dx), var(--dy)) rotate(calc(var(--rot) / 2)); opacity: 1; } 100% { transform: translate(calc(var(--dx) * 1.2), calc(var(--dy) + 340px)) rotate(var(--rot)); opacity: 0; } }

/* the bell: race-result overlay */
.bell { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: rgba(14, 15, 18, .72); animation: fadein .25s ease-out; }
.bell.out { animation: fadeout .35s ease-in forwards; }
@keyframes fadein { from { opacity: 0; } }
@keyframes fadeout { to { opacity: 0; } }
.bell-flash { position: fixed; inset: 0; background: #fff; pointer-events: none; animation: flash .7s ease-out forwards; }
@keyframes flash { 0% { opacity: 1; } 100% { opacity: 0; } }
.bell-card {
  width: min(640px, 100%); background: var(--ink); color: #fff; padding: 26px 26px 20px; position: relative;
  box-shadow: 10px 10px 0 var(--hot); animation: pop .5s cubic-bezier(.2, 1.3, .4, 1);
  background-image: repeating-linear-gradient(-45deg, rgba(255, 255, 255, .025) 0 14px, transparent 14px 28px);
}
@keyframes pop { from { transform: scale(.86) translateY(20px); opacity: 0; } }
.bell-kicker { font: 600 11px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--amber); }
.bell-card h2 { color: #fff; font-size: clamp(40px, 8vw, 64px); margin: 8px 0 18px; }
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: end; gap: 8px; }
.step { display: flex; flex-direction: column; align-items: center; min-width: 0; animation: rise .7s cubic-bezier(.2, .9, .3, 1) backwards; }
.step.p1 { animation-delay: .35s; } .step.p2 { animation-delay: .2s; } .step.p3 { animation-delay: .5s; }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }
.step .pony { width: 100%; max-width: 132px; aspect-ratio: 120 / 84; --hc: #f3f2ee; --mane: #c9c6ba; --hoof: #8a877c; }
.step .pony .horse { width: 100%; height: 100%; overflow: visible; }
.step .block { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 6px; background: #22252c; text-align: center; min-width: 0; }
.step .block b { font: italic 900 46px/1 var(--disp); color: #fff; }
.step .block strong { font: italic 800 20px/1.1 var(--disp); text-transform: uppercase; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 5px; }
.step .block small { font: 500 11px/1.3 var(--mono); color: #a3a6ae; }
.step.p1 .block { background: var(--amber); color: var(--ink); padding-top: 26px; }
.step.p1 .block b { color: var(--ink); font-size: 60px; }
.step.p1 .block small { color: #3a2a00; }
.step.p2 .block { padding-top: 16px; }
.step.empty .block { opacity: .45; }
.bell-foot { display: flex; align-items: center; gap: 16px; margin-top: 20px; flex-wrap: wrap; font-size: 14px; color: #a3a6ae; }
.bell-foot a { color: #fff; text-decoration: underline; }
.bell-foot .btn { margin-left: auto; }

/* trade-on terminals */
.terminals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.terminals a { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border: 2px solid var(--ink); background: #fff; transition: transform .15s, box-shadow .15s; }
.terminals a:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--ink); }
.terminals b { font: italic 800 18px/1 var(--disp); text-transform: uppercase; }
.terminals small { font: 500 10px/1 var(--mono); color: var(--mute); letter-spacing: .06em; }

/* grazing horse for empty states */
.idle-pony { width: 120px; height: 84px; margin: 0 auto 10px; --hc: var(--ink); }
.idle-pony .horse { width: 100%; height: 100%; overflow: visible; }

@media (prefers-reduced-motion: reduce) {
  .tote-run .posts, .tote-run .turf, .wire-run { animation: none; }
  .bell-card, .step, .bell-flash { animation: none; }
}
.lane-score { padding: 0 16px 0 18px; text-align: right; display: flex; flex-direction: column; line-height: 1; border-left: 1px solid var(--rule); height: 100%; justify-content: center; }
.lane-score b { font: italic 800 24px/1 var(--disp); font-variant-numeric: tabular-nums; }
.lane-score b.neg { color: var(--loss); }
.lane-score small { font: 500 10px/1 var(--mono); color: var(--mute); letter-spacing: .06em; margin-top: 5px; text-transform: uppercase; }
.lane.lead .lane-score b { color: var(--hot-ink); }
.lane.hit { animation: hit 1.1s ease-out; }
.lane.hit-down { animation: hitdown 1.1s ease-out; }
@keyframes hit { 0% { background: #c9f0d8; } 100% { } }
@keyframes hitdown { 0% { background: #f9d3da; } 100% { } }
.floater { position: absolute; top: 4px; left: var(--x, 0%); font: italic 800 15px/1 var(--disp); pointer-events: none; animation: floatup 1.6s ease-out forwards; white-space: nowrap; margin-left: 18px; }
@keyframes floatup { 0% { opacity: 0; transform: translateY(8px); } 15% { opacity: 1; } 100% { opacity: 0; transform: translateY(-10px); } }
.lanes-more { padding: 12px 20px; border-top: 1px solid var(--rule); font: 500 12px/1 var(--mono); color: var(--mute); letter-spacing: .06em; }
.lanes-empty { padding: 44px 20px; text-align: center; }
.lanes-empty h3 { font-size: 26px; margin-bottom: 8px; }

/* wire: one-line tape of trades */
.wire { margin-top: 18px; background: var(--ink); color: #e6e7ea; overflow: hidden; height: 40px; display: flex; align-items: center; position: relative; }
.wire::before { content: "WIRE"; position: relative; z-index: 2; height: 100%; display: flex; align-items: center; padding: 0 16px; background: var(--amber); color: var(--ink); font: italic 900 16px/1 var(--disp); letter-spacing: .12em; flex: none; }
.wire-run { display: flex; gap: 34px; white-space: nowrap; animation: wire 60s linear infinite; padding-left: 24px; }
.wire:hover .wire-run { animation-play-state: paused; }
@keyframes wire { to { transform: translateX(-50%); } }
.tick { display: inline-flex; gap: 9px; align-items: baseline; font-size: 13px; }
.tick b { font: italic 800 15px/1 var(--disp); letter-spacing: .03em; }
.tick .up { color: #4fdc93; }
.tick .down { color: #ff7a8c; }
.tick .mono { color: #868993; }

/* ---------------- home: field + side ---------------- */

.board { display: grid; grid-template-columns: 1fr 380px; gap: 18px; margin-top: 18px; align-items: start; }
.field { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.entry { display: grid; grid-template-columns: 8px 64px 1fr; background: var(--card); border: 1px solid var(--rule); transition: border-color .15s, transform .15s; position: relative; }
.entry:hover { border-color: var(--ink); transform: translateY(-2px); }
.entry-band { background: linear-gradient(180deg, var(--c1) 0 50%, var(--c2) 50% 100%); }
.entry .pic { width: 64px; height: 64px; object-fit: cover; margin: 14px 0 0 14px; background: var(--chalk-2); }
.entry-body { padding: 14px 14px 12px 28px; min-width: 0; display: grid; gap: 10px; }
.entry-top { display: flex; align-items: flex-start; gap: 8px; }
.entry-top b { font: italic 800 22px/1 var(--disp); text-transform: uppercase; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry-top small { color: var(--mute); font-size: 12px; display: block; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry-top > div { min-width: 0; flex: 1; }
.entry-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.entry-stats small { display: block; font: 500 10px/1 var(--mono); letter-spacing: .1em; color: var(--mute); text-transform: uppercase; }
.entry-stats b { font: italic 700 18px/1.2 var(--disp); font-variant-numeric: tabular-nums; }

.meter { height: 6px; background: var(--chalk-2); position: relative; overflow: hidden; }
.meter i { position: absolute; inset: 0 auto 0 0; background: var(--ink); }
.meter.hot i { background: var(--amber); }
.meter::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), rgba(255, 255, 255, .9) calc(10% - 1px) 10%); }
.meter-row { display: flex; justify-content: space-between; font: 500 11px/1 var(--mono); color: var(--mute); margin-top: 6px; letter-spacing: .04em; }

.slipcard { background: var(--card); border: 1px solid var(--rule); border-top: 3px solid var(--ink); }
.result-row { display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 12px; padding: 12px 18px 12px 0; border-bottom: 1px solid var(--rule); }
.result-row:last-child { border-bottom: 0; }
.result-row .place { font: italic 900 38px/1 var(--disp); text-align: center; color: var(--rule-2); }
.result-row.p1 .place { color: var(--hot); }
.result-row.p2 .place, .result-row.p3 .place { color: var(--ink); }
.result-row .who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.result-row .who b { font: italic 800 19px/1 var(--disp); text-transform: uppercase; }
.result-row .amt { text-align: right; font-size: 12px; color: var(--mute); }
.result-row .amt b { display: block; font: italic 800 19px/1 var(--disp); color: var(--ink); }
.slip-foot { display: flex; justify-content: space-between; gap: 12px; padding: 12px 18px; background: var(--chalk-2); font-size: 13px; }
.slip-foot a { font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

.how { display: grid; gap: 0; background: var(--card); border: 1px solid var(--rule); border-top: 3px solid var(--ink); }
.how > div { padding: 16px 18px; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: 48px 1fr; gap: 6px 12px; }
.how > div:last-child { border-bottom: 0; }
.how .k { grid-row: span 2; font: italic 900 40px/1 var(--disp); color: transparent; -webkit-text-stroke: 1.5px var(--ink); }
.how h4 { font-size: 18px; align-self: end; }
.how p { margin: 0; font-size: 13.5px; color: var(--ink-2); }

/* ---------------- horse ---------------- */

.horse-head { display: grid; grid-template-columns: 120px 1fr; gap: 22px; align-items: center; margin-bottom: 22px; }
.horse-pic { width: 120px; height: 120px; object-fit: cover; border: 3px solid var(--ink); box-shadow: 6px 6px 0 var(--hot); background: var(--chalk-2); }
.horse-title h1 { font-size: clamp(38px, 5vw, 60px); overflow-wrap: anywhere; }
.horse-title h1 .dim { font-weight: 700; }
.horse-title .eyebrow a { color: var(--ink-2); }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; align-items: start; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); }
.kpi { padding: 16px 20px; border-right: 1px solid var(--rule); min-width: 0; }
.kpi:last-child { border-right: 0; }
.kpi small { display: block; font: 500 10px/1 var(--mono); letter-spacing: .12em; color: var(--mute); text-transform: uppercase; margin-bottom: 8px; }
.kpi b { font: italic 800 26px/1 var(--disp); font-variant-numeric: tabular-nums; white-space: nowrap; }
.chart { height: 240px; position: relative; }
.chart canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.trade { position: sticky; top: 84px; }

.tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--rule); }
.tabs button { height: 50px; border: 0; background: transparent; cursor: pointer; font: italic 800 20px/1 var(--disp); text-transform: uppercase; letter-spacing: .06em; color: var(--mute); border-bottom: 4px solid transparent; margin-bottom: -1px; }
.tabs button.on.buy { color: var(--win); border-bottom-color: var(--win); }
.tabs button.on.sell { color: var(--loss); border-bottom-color: var(--loss); }
.lbl { display: block; font: 600 10px/1 var(--mono); letter-spacing: .14em; color: var(--mute); text-transform: uppercase; margin-bottom: 8px; }
.field-in { display: flex; align-items: center; height: 56px; border: 2px solid var(--ink); background: var(--card); padding: 0 16px; gap: 10px; }
.field-in:focus-within { box-shadow: 4px 4px 0 var(--amber); }
.field-in input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: italic 800 28px/1 var(--disp); font-variant-numeric: tabular-nums; }
.field-in span { font: italic 800 16px/1 var(--disp); color: var(--mute); text-transform: uppercase; letter-spacing: .06em; }
.presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; }
.presets button { height: 34px; border: 1.5px solid var(--rule-2); background: var(--card); cursor: pointer; font: italic 700 15px/1 var(--disp); letter-spacing: .03em; }
.presets button:hover { border-color: var(--ink); background: var(--ink); color: #fff; }
.qline { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; padding: 3px 0; color: var(--ink-2); }
.qline b { color: var(--ink); }
.note { padding: 12px 14px; border-left: 4px solid var(--ink); background: var(--chalk-2); font-size: 13.5px; }
.note.hot { border-left-color: var(--amber); background: #fff4dc; color: var(--ink); }
.note.loss { border-left-color: var(--loss); background: var(--loss-bg); color: var(--ink); }

/* tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font: 600 10px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--mute); padding: 12px 20px; border-bottom: 2px solid var(--ink); white-space: nowrap; }
.table td { padding: 12px 20px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tr[data-href]:hover td { background: #fff7e6; }
.table .r { text-align: right; }
.table a:not(.btn) { text-decoration: underline; text-decoration-color: var(--rule-2); text-underline-offset: 3px; }
.table b { font-weight: 700; }
.cellh { display: inline-flex; align-items: center; gap: 10px; }
.cellh .silk { width: 22px; height: 22px; }
.cellh .silk-num { display: none; }

/* ---------------- launch ---------------- */

.launch { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.form { display: grid; gap: 18px; }
.drop { display: flex; align-items: center; gap: 16px; padding: 14px; border: 2px dashed var(--rule-2); cursor: pointer; background: #fafaf7; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--ink); background: #fff7e6; }
.drop input { display: none; }
.ph { width: 76px; height: 76px; background: var(--chalk-2); display: grid; place-items: center; flex: none; overflow: hidden; }
.ph img { width: 100%; height: 100%; object-fit: cover; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.inp, .ta { width: 100%; border: 2px solid var(--rule-2); background: var(--card); padding: 0 14px; height: 48px; outline: 0; font-size: 15px; transition: border-color .15s, box-shadow .15s; }
.ta { height: 96px; padding: 12px 14px; resize: vertical; }
.inp:focus, .ta:focus { border-color: var(--ink); box-shadow: 4px 4px 0 var(--amber); }
.preview { position: sticky; top: 84px; }
.gate { padding: 22px; display: grid; justify-items: center; gap: 12px; text-align: center; background: var(--tote); color: #fff; border-top-color: var(--hot); }
.gate .eyebrow { color: #7d808a; }
.gate .pic { width: 132px; height: 132px; object-fit: cover; border: 3px solid #fff; background: var(--tote-2); }
.gate h2 { color: var(--amber); font-size: 34px; overflow-wrap: anywhere; }
.gate .dim { color: #a3a6ae; }
.gate .mono { color: #fff; }
#pv-silk { position: absolute; right: -12px; bottom: -12px; }
#pv-silk .silk { width: 36px; height: 36px; outline: 2px solid #fff; }
.steps { display: grid; gap: 4px; margin-top: 12px; }
.stepline { display: flex; align-items: center; gap: 12px; padding: 8px 0; font-weight: 600; color: var(--mute); }
.stepline i { width: 28px; height: 28px; display: grid; place-items: center; font: italic 800 15px/1 var(--disp); border: 2px solid var(--rule-2); }
.stepline.run { color: var(--ink); }
.stepline.run i { border-color: var(--hot); color: var(--hot); animation: blink 1s steps(2, start) infinite; }
.stepline.done { color: var(--ink); }
.stepline.done i { background: var(--win); border-color: var(--win); color: #fff; }

/* ---------------- prose / formula ---------------- */

.prose { max-width: 760px; }
.prose h2 { font-size: 28px; margin: 34px 0 10px; padding-top: 14px; border-top: 3px solid var(--ink); }
.prose p { font-size: 16px; color: var(--ink-2); line-height: 1.65; }
.prose b { color: var(--ink); }
.formula { font: 500 13px/1.7 var(--mono); background: var(--tote); color: var(--amber); padding: 14px 16px; overflow-x: auto; margin: 12px 0 16px; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------------- misc ---------------- */

.skeleton { background: linear-gradient(90deg, var(--chalk-2), #f8f8f5, var(--chalk-2)); background-size: 200% 100%; animation: sk 1.2s linear infinite; }
@keyframes sk { to { background-position: -200% 0; } }

.foot { border-top: 2px solid var(--ink); background: var(--chalk); }
.foot-in { max-width: var(--wrap); margin: 0 auto; padding: 22px 20px 30px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; font-size: 13px; }
.foot-brand { font: italic 900 22px/1 var(--disp); letter-spacing: .03em; }
.foot-links { margin-left: auto; display: flex; gap: 18px; align-items: center; }
.foot-links a { text-decoration: underline; text-underline-offset: 3px; }

.sheet { position: fixed; inset: 0; z-index: 60; background: rgba(14, 15, 18, .55); display: grid; place-items: center; padding: 16px; }
.sheet[hidden] { display: none; }
.sheet-card { width: 100%; max-width: 400px; background: var(--card); border-top: 4px solid var(--hot); box-shadow: 10px 10px 0 var(--ink); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--rule); }
.sheet-head h3 { font-size: 22px; }
.x { width: 34px; height: 34px; border: 0; background: transparent; font-size: 24px; cursor: pointer; }
.sheet-body { padding: 12px; display: grid; gap: 8px; }
.wopt { display: flex; align-items: center; gap: 12px; height: 54px; padding: 0 14px; border: 2px solid var(--rule); background: var(--card); cursor: pointer; text-align: left; font-size: 16px; }
.wopt:hover { border-color: var(--ink); box-shadow: 4px 4px 0 var(--amber); }
.wopt img { width: 28px; height: 28px; }

.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 70; display: grid; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-left: 5px solid var(--amber); font-size: 14px; box-shadow: 6px 6px 0 rgba(14, 15, 18, .2); }
.toast.ok { border-left-color: #24c46e; }
.toast.bad { border-left-color: var(--loss); }
.toast a { text-decoration: underline; color: var(--amber); }

/* ---------------- responsive ---------------- */

@media (max-width: 1080px) {
  .board, .cols, .launch { grid-template-columns: 1fr; }
  .trade, .preview { position: static; }
  .tote { grid-template-columns: 1fr; }
  .tote-head { border-right: 0; border-bottom: 1px solid var(--tote-line); }
}
@media (max-width: 860px) {
  .top-in { gap: 12px; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 64px; height: auto; flex-direction: column; background: var(--chalk); border-bottom: 2px solid var(--ink); padding: 8px 20px 14px; }
  .nav.open { display: flex; }
  .nav a { height: 46px; border-bottom: 1px solid var(--rule); margin: 0; }
  .nav a.on { border-bottom-color: var(--rule); color: var(--hot-ink); }
  .burger { display: flex; }
  .icon-link { display: none; }
  .field { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi:nth-child(2) { border-right: 0; }
  .kpi:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }
}
@media (max-width: 640px) {
  .view { padding: 16px 16px 48px; }
  .top-in { padding: 0 16px; }
  .brand-word { font-size: 26px; }
  .slip-text small { display: none; }
  .slip { height: 40px; padding-right: 14px; }
  .slip-silk { width: 24px; height: 40px; }
  .tote-head { padding: 22px 18px 20px 26px; }
  .tote-cells { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
  .tc { padding: 14px 16px; }
  .tc b { font-size: 30px; }
  .tc-purse { grid-column: span 2; grid-row: auto; border-right: 0; }
  .tc-purse b { font-size: 64px; }
  .tc:nth-child(2) { border-right: 1px solid var(--tote-line); }
  .tc:nth-child(3) { border-right: 0; }
  .tc:nth-child(n+2) { border-bottom: 0; }
  .lanes-scale, .lane { grid-template-columns: 40px minmax(0, 1fr) 92px; }
  .lane { height: auto; grid-template-rows: 30px 34px; }
  .post { grid-row: span 2; font-size: 20px; }
  .lane-name { grid-column: 2; flex-direction: row; align-items: baseline; gap: 8px; padding: 0 12px; }
  .lane-name b { font-size: 17px; }
  .lane-score { grid-column: 3; grid-row: 1 / span 2; padding: 0 12px; }
  .lane-score b { font-size: 20px; }
  .lane-score small { font-size: 9px; white-space: nowrap; letter-spacing: .02em; }
  .lane-run { grid-column: 2; grid-row: 2; margin: 0 22px 0 14px; }
  .lane-run::after { right: -16px; width: 6px; }
  .runner { width: 46px; height: 32px; bottom: 1px; left: calc((100% - 46px) * var(--xf, 0)); }
  .dust { left: calc((100% - 46px) * var(--xf, 0) + 4px); }
  .lane.lead .runner::after { display: none; }
  .tote-run { height: 78px; }
  .tote-run .pack { height: 56px; }
  .tote-run .pony { width: 78px; height: 55px; }
  .tote-run .finish-post::before { display: none; }
  .terminals { grid-template-columns: 1fr 1fr 1fr; }
  .terminals b { font-size: 15px; }
  .podium .step .block strong { font-size: 15px; }
  .step .block b { font-size: 34px; }
  .step.p1 .block b { font-size: 44px; }
  .lanes-scale { display: none; }
  .straight-head .dim { display: none; }
  .row2, .row3 { grid-template-columns: 1fr; }
  .horse-head { grid-template-columns: 84px 1fr; gap: 16px; }
  .horse-pic { width: 84px; height: 84px; box-shadow: 4px 4px 0 var(--hot); }
  .kpi { padding: 14px 16px; }
  .kpi b { font-size: 22px; }
  .table th, .table td { padding: 10px 14px; }
  .section-head { margin-top: 34px; }
  .foot-links { margin-left: 0; }
}
