/* ===================================================================
   MONDAY MAFIA — Neon Nights
   Black · Neon Pink · Electric Cyan · Glow
   =================================================================== */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --noir:         #09070e;
    --noir-2:       #100c18;
    --card:         #14101d;
    --card-2:       #191322;
    --row:          #1b1526;
    --line:         #2a2438;
    --line-bright:  #3d3352;
    --text:         #f1ecf6;          /* soft white */
    --text-dim:     #a89bbe;
    --text-faint:   #6a5f80;
    --crimson:      #ff2d9b;          /* neon pink (primary) */
    --crimson-deep: #c4007a;
    --crimson-glow: rgba(255, 45, 155, 0.5);
    --gold:         #ff53c8;          /* magenta-pink (champion accent) */
    --gold-bright:  #ff87d8;
    --gold-dim:     rgba(255, 83, 200, 0.14);
    --silver:       #c8cfe0;
    --silver-dim:   rgba(200, 207, 224, 0.10);
    --bronze:       #b98cff;          /* neon violet (3rd) */
    --bronze-dim:   rgba(185, 140, 255, 0.12);
    --cyan:         #4fdcff;          /* electric cyan (secondary neon) */
    --success:      #3ddc84;
}

html { scroll-behavior: smooth; }

body {
    font-family: "Barlow", system-ui, sans-serif;
    background:
        radial-gradient(1100px 480px at 70% -12%, rgba(255,45,155,0.12), transparent 62%),
        radial-gradient(820px 400px at 8% 0%, rgba(79,220,255,0.06), transparent 60%),
        var(--noir);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
}

/* faint pinstripe — the suit */
body::before {
    content: "";
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background: repeating-linear-gradient(
        90deg,
        transparent 0 13px,
        rgba(255,255,255,0.012) 13px 14px
    );
}

.container { position: relative; z-index: 1; max-width: 1560px; margin: 0 auto; padding: 0 28px 60px; }

/* =================================================================
   MASTHEAD
   ================================================================= */
header {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 22px 0 18px;
    position: relative;
    margin-bottom: 20px;
}
/* neon hazard tape under the masthead, fading out to the right */
header::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 7px;
    background: repeating-linear-gradient(-45deg, var(--crimson) 0 12px, #0d0d12 12px 24px);
    -webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.35) 45%, transparent 88%);
    mask-image: linear-gradient(90deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.35) 45%, transparent 88%);
    border-radius: 2px;
    box-shadow: 0 0 12px var(--crimson-glow);
}

.crest {
    width: 50px; height: 50px;
    border: 2px solid var(--crimson);
    border-radius: 4px;
    transform: rotate(45deg);
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #1c1626, #100c16);
    box-shadow: 0 0 22px rgba(255,45,155,0.35), inset 0 0 12px rgba(255,45,155,0.12);
    flex-shrink: 0;
}
.crest span {
    transform: rotate(-45deg);
    font-family: "Cinzel", serif;
    font-weight: 900;
    font-size: 1.45rem;
    color: var(--crimson);
    line-height: 1;
    text-shadow: 0 0 10px var(--crimson-glow);
}

.masthead h1 {
    font-family: "Cinzel", serif;
    font-weight: 900;
    font-size: 1.7rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    line-height: 1;
    color: var(--text);
}
.masthead h1 .red {
    color: var(--crimson);
    text-shadow: 0 0 14px var(--crimson-glow), 0 0 3px rgba(255,45,155,0.6);
}
.masthead .tagline {
    font-family: "Barlow Condensed", sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 5px;
    text-transform: uppercase;
    color: var(--gold-bright);
    margin-top: 3px;
    text-shadow: 0 0 10px rgba(255,83,200,0.4);
}

.header-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.updated-badge {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid rgba(61,220,132,0.35);
    color: var(--success);
    background: rgba(61,220,132,0.07);
}

/* =================================================================
   ROUND STRIP — paired EU/US
   ================================================================= */
.stage-strip {
    display: flex;
    gap: 16px;
    margin-bottom: 26px;
    overflow-x: auto;
    padding: 2px 0 8px;
}
.round-group { display: flex; flex-direction: column; gap: 6px; min-width: 168px; }
.round-label {
    font-family: "Barlow Condensed", sans-serif;
    font-size: 0.7rem; font-weight: 700;
    letter-spacing: 3px; text-transform: uppercase;
    color: var(--text-faint);
    text-align: center;
}
.round-route {
    font-size: 0.66rem;
    color: var(--text-faint);
    text-align: center;
    margin-top: -4px;
}
.round-pair { display: flex; gap: 6px; }

.stage-tab {
    flex: 1;
    display: flex; flex-direction: column; align-items: center;
    gap: 1px;
    padding: 8px 12px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 8px;
    cursor: pointer;
    transition: all .15s;
    text-align: center;
    font-family: inherit;
    color: var(--text);
}
.stage-tab:hover { border-color: var(--line-bright); transform: translateY(-1px); }
.stage-tab .zone {
    font-family: "Barlow Condensed", sans-serif;
    font-weight: 800; font-size: 1rem; letter-spacing: 1.5px;
}
.stage-tab .meta {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.6rem; color: var(--text-faint);
}
.stage-tab.zone-eu .zone { color: var(--crimson); }
.stage-tab.zone-us .zone { color: var(--cyan); }
.stage-tab.active {
    border-color: var(--crimson);
    background: linear-gradient(180deg, rgba(255,45,155,0.18), rgba(255,45,155,0.04));
    box-shadow: 0 0 18px var(--crimson-glow);
}
.stage-tab.active .zone { color: var(--gold-bright); }
.stage-tab.zone-us.active .zone { color: var(--cyan); }

/* =================================================================
   SECTION HEADERS
   ================================================================= */
.section-head {
    display: flex;
    align-items: baseline;
    gap: 14px;
    margin: 10px 0 14px;
    flex-wrap: wrap;
}
.section-head h2 {
    font-family: "Barlow Condensed", sans-serif;
    font-size: 1.45rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    padding-left: 14px;
}
.section-head h2::before {
    content: "";
    position: absolute;
    left: 0; top: 4px; bottom: 4px;
    width: 4px;
    background: var(--crimson);
    transform: skewY(-12deg);
    box-shadow: 0 0 10px var(--crimson-glow);
}
.section-head .sub {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.7rem;
    color: var(--text-faint);
}
/* neon hazard tape trailing off each section label, fading out */
.section-head .tape {
    flex: 1;
    align-self: center;
    height: 15px;
    min-width: 50px;
    margin: 0 10px;
    background:
        linear-gradient(rgba(255,45,155,0.9), rgba(255,45,155,0.9));
    -webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.3) 50%, transparent 90%);
    mask-image: linear-gradient(90deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.3) 50%, transparent 90%);
    border-radius: 2px;
    overflow: hidden;
    white-space: nowrap;
    display: flex;
    align-items: center;
    position: relative;
}
/* diagonal hazard ends baked into the strip edges */
.section-head .tape::after {
    content: "";
    position: absolute; inset: 0;
    background: repeating-linear-gradient(-45deg, transparent 0 12px, rgba(9,7,14,0.6) 12px 18px);
    mix-blend-mode: multiply;
    pointer-events: none;
}
.section-head .tape::before {
    content: "CRIME SCENE · DO NOT CROSS · CRIME SCENE · DO NOT CROSS · CRIME SCENE · DO NOT CROSS · CRIME SCENE · DO NOT CROSS · CRIME SCENE · DO NOT CROSS";
    font-family: "Barlow Condensed", sans-serif;
    font-weight: 800;
    font-size: 9px;
    letter-spacing: 3px;
    color: #0d0a12;
    padding-left: 8px;
    line-height: 1;
}

/* minimal blood splatter beside section labels */
.section-head h2 .splatter {
    position: absolute;
    top: -3px;
    right: -16px;
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--crimson);
    opacity: 0.85;
    box-shadow:
        7px 5px 0 -1.5px rgba(255,45,155,0.7),
        3px 11px 0 -2px rgba(255,45,155,0.55),
        12px -2px 0 -2.2px rgba(196,0,122,0.65),
        -2px 6px 0 -2.4px rgba(196,0,122,0.5);
}
.section-head .filters { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.filters label { font-size: 0.7rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: 1.5px; }
select {
    background: var(--card);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 5px 10px;
    font-family: "Barlow", sans-serif;
    font-size: 0.8rem;
    cursor: pointer;
}
select:focus { outline: none; border-color: var(--crimson); }

/* =================================================================
   PODIUM CARDS
   ================================================================= */
.podium-row {
    display: grid;
    grid-template-columns: 1fr 1.15fr 1fr;
    gap: 14px;
    align-items: end;
    margin-bottom: 22px;
}

.podium-card {
    position: relative;
    border-radius: 10px;
    padding: 16px 16px 13px;
    background: linear-gradient(180deg, var(--card-2), var(--card));
    border: 1px solid var(--line);
    overflow: hidden;
    transition: transform .18s ease;
}
.podium-card:hover { transform: translateY(-3px); }
.podium-card::after {
    content: "";
    position: absolute; inset: 0;
    background: repeating-linear-gradient(-55deg, transparent 0 26px, rgba(255,255,255,0.016) 26px 28px);
    pointer-events: none;
}

.podium-card.p1 {
    border-color: rgba(255,45,155,0.6);
    background:
        radial-gradient(420px 170px at 50% -30%, rgba(255,45,155,0.22), transparent 70%),
        linear-gradient(180deg, var(--card-2), var(--card));
    box-shadow: 0 10px 44px rgba(255,45,155,0.16);
    padding-top: 24px;
    padding-bottom: 18px;
}
.podium-card.p2 { border-color: rgba(200,207,224,0.35); }
.podium-card.p3 { border-color: rgba(185,140,255,0.45); }

.podium-role {
    font-family: "Cinzel", serif;
    font-weight: 800;
    font-size: 0.62rem;
    letter-spacing: 3.5px;
    text-transform: uppercase;
    margin-bottom: 7px;
    position: relative; z-index: 1;
}
.p1 .podium-role { color: var(--crimson); text-shadow: 0 0 10px var(--crimson-glow); }
.p2 .podium-role { color: var(--silver); }
.p3 .podium-role { color: var(--bronze); }

.podium-rank {
    position: absolute;
    top: -16px; right: 0;
    font-family: "Barlow Condensed", sans-serif;
    font-size: 5.6rem;
    font-weight: 800;
    line-height: 1;
    opacity: 0.10;
    user-select: none;
}
.p1 .podium-rank { color: var(--crimson); opacity: .18; }
.p2 .podium-rank { color: var(--silver); }
.p3 .podium-rank { color: var(--bronze); }

.podium-top { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; position: relative; z-index: 1; }
.podium-medal { font-size: 1.45rem; line-height: 1; }
.p1 .podium-medal { font-size: 1.8rem; }
.podium-name {
    font-family: "Barlow Condensed", sans-serif;
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: 0.4px;
    line-height: 1.05;
}
.p1 .podium-name { font-size: 1.45rem; }
.podium-zid { font-family: "JetBrains Mono", monospace; font-size: 0.6rem; color: var(--text-faint); }

.podium-stats { display: flex; gap: 16px; margin-top: 8px; position: relative; z-index: 1; }
.pstat { display: flex; flex-direction: column; }
.pstat .v { font-family: "JetBrains Mono", monospace; font-weight: 700; font-size: 0.92rem; }
.p1 .pstat .v { font-size: 1.02rem; }
.pstat .k { font-size: 0.58rem; text-transform: uppercase; letter-spacing: 1.6px; color: var(--text-faint); }
.p1 .pstat.main .v { color: var(--gold-bright); }
.p2 .pstat.main .v { color: var(--silver); }
.p3 .pstat.main .v { color: var(--bronze); }

.podium-gap {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.66rem;
    color: var(--text-faint);
    margin-top: 6px;
    position: relative; z-index: 1;
}

/* compact variant for stage podium */
.podium-row.compact { gap: 10px; margin-bottom: 0; }
.podium-row.compact .podium-card { padding: 11px 13px 9px; }
.podium-row.compact .podium-card.p1 { padding-top: 15px; padding-bottom: 12px; }
.podium-row.compact .podium-rank { font-size: 3.6rem; top: -10px; }
.podium-row.compact .podium-name { font-size: 1rem; }
.podium-row.compact .podium-card.p1 .podium-name { font-size: 1.12rem; }
.podium-row.compact .podium-medal { font-size: 1.1rem; }
.podium-row.compact .podium-card.p1 .podium-medal { font-size: 1.35rem; }
.podium-row.compact .pstat .v { font-size: 0.8rem; }
.podium-row.compact .podium-role { margin-bottom: 4px; }

/* =================================================================
   VIEW TABS — GC / Stage Results
   ================================================================= */
.view-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--line);
}
.view-tab {
    font-family: "Barlow Condensed", sans-serif;
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-faint);
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 10px 22px 8px;
    cursor: pointer;
    transition: all .15s;
}
.view-tab:hover { color: var(--text-dim); }
.view-tab.active {
    color: var(--text);
    border-bottom-color: var(--crimson);
    text-shadow: 0 0 18px var(--crimson-glow);
}
.view-panel { display: none; }
.view-panel.active { display: block; }

/* =================================================================
   TABLES
   ================================================================= */
.table-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
}
.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 0.83rem; }

thead th {
    font-family: "Barlow Condensed", sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--text-faint);
    text-align: left;
    padding: 9px 8px;
    border-bottom: 1px solid var(--line-bright);
    background: var(--card-2);
    white-space: nowrap;
    position: sticky; top: 0;
    z-index: 2;
}

tbody td {
    padding: 6px 8px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--row); }

tr.row-p1 { background: linear-gradient(90deg, var(--gold-dim), transparent 55%); }
tr.row-p2 { background: linear-gradient(90deg, var(--silver-dim), transparent 55%); }
tr.row-p3 { background: linear-gradient(90deg, var(--bronze-dim), transparent 55%); }
tr.row-p1:hover, tr.row-p2:hover, tr.row-p3:hover { filter: brightness(1.13); }

.rank-cell {
    font-family: "Barlow Condensed", sans-serif;
    font-weight: 800;
    font-size: 0.98rem;
    width: 42px;
    text-align: center;
}
tr.row-p1 .rank-cell { color: var(--crimson); }
tr.row-p2 .rank-cell { color: var(--silver); }
tr.row-p3 .rank-cell { color: var(--bronze); }

.rider-cell { min-width: 130px; max-width: 190px; overflow: hidden; text-overflow: ellipsis; }
.rider-cell .nm { font-weight: 600; }
.rider-cell .zid { font-family: "JetBrains Mono", monospace; font-size: 0.6rem; color: var(--text-faint); }

.cat-badge {
    display: inline-block;
    font-family: "Barlow Condensed", sans-serif;
    font-weight: 800;
    font-size: 0.7rem;
    min-width: 22px;
    text-align: center;
    padding: 1px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}
.cat-Ap { background: rgba(255,45,155,.28);  color: #ff9dd0; }
.cat-A  { background: rgba(255,45,155,.16);  color: #ff8ac6; }
.cat-B  { background: rgba(61,220,132,.14);  color: #7fe8ac; }
.cat-C  { background: rgba(79,220,255,.15);  color: #9fe8ff; }
.cat-D  { background: rgba(185,140,255,.16); color: #cbb0ff; }
.cat-x  { background: rgba(255,255,255,.07); color: var(--text-dim); }

.t-mono  { font-family: "JetBrains Mono", monospace; font-size: 0.74rem; }
.t-dim   { color: var(--text-dim); }
.t-gc    { font-family: "JetBrains Mono", monospace; font-weight: 700; font-size: 0.78rem; color: var(--gold-bright); }
.t-bonus { font-family: "JetBrains Mono", monospace; font-size: 0.74rem; color: var(--crimson); }
.t-bonus .medals { font-size: 0.85rem; }

/* stage header strip */
.stage-strip-title {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(90deg, rgba(255,45,155,0.08), transparent 55%);
    flex-wrap: wrap;
}
.stage-strip-title .big {
    font-family: "Barlow Condensed", sans-serif;
    font-weight: 800; font-size: 1.08rem;
    letter-spacing: 1.5px; text-transform: uppercase;
}
.stage-strip-title .route { font-size: 0.78rem; color: var(--text-dim); }
.stage-strip-title .when {
    margin-left: auto;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.68rem; color: var(--text-faint);
}

.zone-pill {
    font-family: "Barlow Condensed", sans-serif;
    font-weight: 800; font-size: 0.7rem; letter-spacing: 1.8px;
    padding: 2px 9px; border-radius: 999px;
}
.zone-pill.eu { background: rgba(255,45,155,.18); color: var(--gold-bright); }
.zone-pill.us { background: rgba(79,220,255,.15);  color: var(--cyan); }

.stage-podium-wrap { padding: 14px 14px 12px; border-bottom: 1px solid var(--line); }

/* toggles */
.toggle-panel {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 20px;
}
.toggle-panel summary {
    cursor: pointer;
    font-family: "Barlow Condensed", sans-serif;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-dim);
}
.toggle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 4px 16px;
    margin-top: 10px;
}
.toggle-grid label {
    display: flex; align-items: center; gap: 6px;
    font-size: 0.78rem; color: var(--text-dim); cursor: pointer;
}
.toggle-grid input { accent-color: var(--crimson); }

.placeholder-text { padding: 22px; color: var(--text-faint); font-size: 0.85rem; }

/* =================================================================
   CARNIVAL RACE — 2D horse-race replay of the standings
   ================================================================= */
.horse-race {
    position: relative;
    background:
        radial-gradient(600px 200px at 50% -40%, rgba(255,45,155,0.10), transparent 70%),
        linear-gradient(180deg, var(--card-2), var(--card));
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 16px 16px 12px;
    margin-bottom: 22px;
    overflow: hidden;
}
.horse-race.inset {
    border: none;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    margin-bottom: 0;
    background:
        radial-gradient(600px 200px at 50% -40%, rgba(255,45,155,0.07), transparent 70%),
        transparent;
}

/* marquee bulbs across the top — the carnival tell */
.horse-race::before {
    content: "";
    position: absolute;
    top: 6px; left: 14px; right: 14px;
    height: 4px;
    background-image: radial-gradient(circle, var(--crimson) 0 1.6px, transparent 1.9px);
    background-size: 17px 4px;
    opacity: 0.55;
    animation: hr-marquee 1.1s linear infinite;
    pointer-events: none;
}
@keyframes hr-marquee {
    0%   { opacity: 0.5; background-position: 0 0; }
    50%  { opacity: 0.85; }
    100% { opacity: 0.5; background-position: 17px 0; }
}

.hr-head {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin: 6px 0 12px;
    flex-wrap: wrap;
}
.hr-title {
    font-family: "Barlow Condensed", sans-serif;
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--gold-bright);
    text-shadow: 0 0 12px rgba(255,83,200,0.35);
}
.hr-sub {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.66rem;
    color: var(--text-faint);
}
.hr-controls { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.hr-controls select {
    padding: 3px 8px;
    font-size: 0.72rem;
}
.hr-replay {
    font-family: "Barlow Condensed", sans-serif;
    font-weight: 700;
    font-size: 0.72rem;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 999px;
    border: 1px solid var(--line-bright);
    background: var(--card);
    color: var(--text-dim);
    cursor: pointer;
    transition: all .15s;
}
.hr-replay:hover {
    color: #fff;
    border-color: var(--crimson);
    box-shadow: 0 0 14px var(--crimson-glow);
}

.hr-lanes { display: flex; flex-direction: column; gap: 3px; }

.hr-lane {
    display: grid;
    grid-template-columns: 26px minmax(96px, 150px) 1fr 74px;
    align-items: center;
    gap: 8px;
    padding: 1px 0;
}

.hr-slot {
    font-family: "Barlow Condensed", sans-serif;
    font-weight: 800;
    font-size: 0.82rem;
    text-align: center;
    color: var(--text-faint);
}
.hr-lane.p1 .hr-slot,
.hr-lane.p2 .hr-slot,
.hr-lane.p3 .hr-slot { font-size: 0.9rem; }

.hr-rider {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
}
.hr-name {
    font-size: 0.74rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-dim);
}
.hr-lane.p1 .hr-name { color: var(--text); }

/* the track itself */
.hr-track {
    position: relative;
    height: 22px;
    border-radius: 4px;
    background:
        repeating-linear-gradient(90deg,
            transparent 0 28px,
            rgba(255,255,255,0.028) 28px 29px),
        linear-gradient(180deg, rgba(255,255,255,0.022), rgba(0,0,0,0.18));
    border-top: 1px solid rgba(255,255,255,0.035);
    border-bottom: 1px solid rgba(0,0,0,0.35);
    overflow: hidden;
}

/* checkered finish line at the right edge */
.hr-track::after {
    content: "";
    position: absolute;
    right: 0; top: 0; bottom: 0;
    width: 7px;
    background-image:
        linear-gradient(45deg, #e9e4f2 25%, transparent 25%, transparent 75%, #e9e4f2 75%),
        linear-gradient(45deg, #e9e4f2 25%, #14101d 25%, #14101d 75%, #e9e4f2 75%);
    background-size: 7px 7px;
    background-position: 0 0, 3.5px 3.5px;
    opacity: 0.5;
}

.hr-runner {
    position: absolute;
    left: 0;
    top: 50%;
    display: flex;
    align-items: center;
    gap: 4px;
    transform: translate(0, -50%);
    will-change: transform;
}
/* stick-figure road bike; silk = category colour, set inline per rider */
.hr-bike {
    width: 22px;
    height: 17px;
    display: block;
    overflow: visible;
    fill: none;
    stroke: var(--silk);
    stroke-width: 1.3;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 0 5px var(--silk));
}

/* out-of-the-saddle bob while the race is running */
.horse-race.running .hr-bike {
    animation: hr-pedal .26s ease-in-out infinite alternate;
}
@keyframes hr-pedal {
    from { transform: translateY(0); }
    to   { transform: translateY(-1.6px); }
}

.hr-result {
    text-align: right;
    font-family: "JetBrains Mono", monospace;
    line-height: 1.15;
}
.hr-time { display: block; font-size: 0.68rem; color: var(--text-dim); }
.hr-lane.p1 .hr-time { color: var(--gold-bright); font-weight: 700; }
.hr-gap  { display: block; font-size: 0.58rem; color: var(--text-faint); }

/* photo finish flash when the leader hits the line */
.horse-race.finished .hr-lane.p1 .hr-track::after {
    opacity: 1;
    box-shadow: 0 0 16px var(--crimson), 0 0 30px var(--crimson-glow);
    transition: box-shadow .4s ease, opacity .4s ease;
}
.horse-race.finished .hr-lane.p1 .hr-bike {
    animation: hr-win .5s ease-out 2;
}
@keyframes hr-win {
    0%, 100% { transform: translateY(0) scale(1); }
    40%      { transform: translateY(-4px) scale(1.18); }
}

@media (max-width: 720px) {
    .hr-lane { grid-template-columns: 22px minmax(70px, 96px) 1fr 60px; gap: 6px; }
    .hr-name { font-size: 0.68rem; }
}

@media (max-width: 900px) {
    .podium-row { grid-template-columns: 1fr; }
    .podium-card.p1 { order: -1; }
}
