/*
 * The checks race (includes/pieces/race.php): a board-black stage, a split-flap age clock, three
 * tracks in side view, a railcar on each in its start's colour (62 red, full retirement age cream,
 * 70 signal yellow, as in the claiming-age chart), and the paid-so-far line painted on the rail behind it.
 */

.race { --ra: #e0483f; --ra-t: #ff9b8f; --rb: #f3efe5; --rc: #f5c21b; --train: 150px; }

.race__clock { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 0 0 14px; padding: 10px 14px; border-radius: 10px; background: #0a0b0d; box-shadow: inset 0 2px 5px rgba(0, 0, 0, .7), 0 1px 0 #2b2f35; }
.race__clock-k { font: 700 .95rem/1 var(--board-font); letter-spacing: .16em; text-transform: uppercase; color: #c9c4ba; }
.race__clock-v { display: inline-flex; align-items: center; gap: 12px; }
.race__years .flaps__cells i { font-size: 2.1rem; color: var(--signal); }
.race__years .flaps__cells i.is-flip b { color: var(--signal); }
.race__clock-m { font: 700 1.3rem/1 var(--board-font); letter-spacing: .04em; color: var(--flap-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }

.race__lanes { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.race__lane { --c: var(--ra); --ct: var(--ra-t); --line: var(--c); padding: 12px 14px 10px; border-radius: 10px; background: rgba(255, 255, 255, .025); box-shadow: inset 0 0 0 1px #262a30; transition: background-color .4s, box-shadow .4s; }
.race__lane--b { --c: var(--rb); --ct: var(--rb); }
.race__lane--c { --c: var(--rc); --ct: var(--rc); }
.race__lane.is-lead { background: rgba(245, 194, 27, .07); box-shadow: inset 0 0 0 1px #4d4421, inset 4px 0 0 var(--signal); }
.race__meta { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; }
.race__who { display: flex; flex-direction: column; min-width: 0; }
.race__who b { font: 700 1.1rem/1.2 var(--board-font); letter-spacing: .03em; color: var(--flap-ink); }
.race__rate { font-size: .95rem; line-height: 1.35; color: #c9c4ba; }
.race__total { font: 700 1.6rem/1 var(--board-font); letter-spacing: .02em; color: var(--ct); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }

/* The track: a rail with its sleepers' ends, the paid-so-far line painted on it, the railcar above. */
.race__track { --x: 1; position: relative; height: 44px; margin-top: 8px; }
.race__track::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 8px; border-radius: 2px;
	background:
		linear-gradient(#7a8089, #5c626b) 0 0 / 100% 3px no-repeat,
		repeating-linear-gradient(90deg, #3b4047 0 5px, transparent 5px 14px) 0 3px / 100% 5px no-repeat; }
.race__trail { position: absolute; left: 0; bottom: 3px; height: 5px; width: calc(var(--x) * (100% - var(--train)) + var(--train) * .5); border-radius: 3px; background: var(--c); box-shadow: 0 0 0 1px rgba(0, 0, 0, .5); }
.race__train { position: absolute; bottom: 4px; left: calc(var(--x) * (100% - var(--train))); width: var(--train); line-height: 0; transition: opacity .3s; }
.race__svg { display: block; width: 100%; height: auto; overflow: visible; filter: drop-shadow(0 3px 2px rgba(0, 0, 0, .55)); }
.race__body { fill: var(--c); }
.race__roof { fill: rgba(255, 255, 255, .4); }
.race__glass { fill: #101216; }
.race__panes { fill: none; stroke: var(--c); stroke-width: 2.4; }
.race__stripe { fill: #15171a; opacity: .82; }
.race__lane--a .race__stripe, .race__lane--c .race__stripe { fill: #fbfaf6; opacity: .9; }
.race__bogie rect { fill: #24272c; }
.race__bogie circle { fill: #4b5058; stroke: #0b0c0e; stroke-width: 1.6; }
.race__lane.is-waiting .race__train { opacity: .5; }

.race__tags { min-height: 0; }
.race__pass { display: inline-block; margin: 8px 8px 0 0; padding: 4px 8px 3px; border-radius: 4px; background: #0a0b0d; color: var(--signal); box-shadow: inset 0 0 0 1px #4d4421; font: 700 .95rem/1.2 var(--board-font); letter-spacing: .08em; text-transform: uppercase; }

/* The clock's controls: the push-button, and the slider of ages under it. */
/* Shown only with the script (needs-js): its layout is set under .js, so readers without the script never see it. */
.js .race__ctrl { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px 16px; margin-top: 16px; }
.race__scrub { display: block; min-width: 0; }
.race__ends { display: flex; justify-content: space-between; margin-top: -6px; font: 700 .95rem/1 var(--board-font); letter-spacing: .06em; color: #c9c4ba; }

.race__marks { display: grid; gap: 6px; margin: 14px 0 0; padding: 0; list-style: none; }
.race__mark { position: relative; padding-left: 24px; font-size: .98rem; line-height: 1.4; color: #c9c4ba; transition: color .3s; }
.race__mark::before { content: ""; position: absolute; left: 2px; top: .32em; width: 12px; height: 12px; border-radius: 50%; background: #0a0b0d; box-shadow: 0 0 0 3px #4b5058; }
.race__mark--b::before { box-shadow: 0 0 0 3px var(--rb); }
.race__mark--c::before { box-shadow: 0 0 0 3px var(--rc); }
.race__mark b { color: inherit; font-weight: 700; }
.race__mark.is-past { color: var(--flap-ink); }
.race__mark.is-past::before { background: var(--signal); }
.race__mark[data-late] { color: #c9c4ba; font-style: italic; }
.race__say { margin: 14px 0 0; font-size: 1.06rem; line-height: 1.5; color: var(--flap-ink); }

@media (max-width: 599px) {
	.race { --train: 104px; }
	.race__clock { padding: 8px 10px; }
	.race__years .flaps__cells i { font-size: 1.7rem; }
	.race__clock-m { font-size: 1.1rem; }
	.race__lane { padding: 10px 10px 8px; }
	.race__meta { grid-template-columns: auto minmax(0, 1fr); }
	.race__total { grid-column: 2; text-align: left; font-size: 1.4rem; }
	.js .race__ctrl { grid-template-columns: minmax(0, 1fr); }
	.race__ctrl .p-btn { justify-self: start; }
}
@media (prefers-reduced-motion: reduce) {
	.race__lane, .race__train, .race__mark { transition: none; }
}
.race__coupler { fill: #24272c; }
