/*
 * The track board on a circuit page (src/pages/tracks/track-board-section.ts; built in only when TRACK_BOARDS=on, and this file
 * is linked only from a page that has it). tracks.css's own tokens, so it follows the page. The rows are drawn by /tracks/board.js.
 */
.board[hidden] { display: none; }
.board-grid { display: grid; gap: 28px; margin-top: 22px; align-items: start; }
.board-main { min-width: 0; }
.board-sub { display: flex; flex-wrap: wrap; gap: 2px 8px; margin: 0 0 14px; color: var(--muted); font-size: 14.5px; }
.board-sub [data-board="season"]:not(:empty)::before { content: '\00b7'; margin-right: 8px; }

.board-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.board-chip { min-height: 44px; padding: 0 14px; border: 1px solid var(--rule); border-radius: 999px; background: var(--surface); color: var(--ink); font: 500 14px/1 var(--body); cursor: pointer; }
.board-chip[aria-pressed="true"] { border-color: var(--accent); background: var(--tint); color: var(--tint-ink); font-weight: 600; }

.board-classes { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: color-mix(in srgb, var(--rule) 55%, var(--paper)); }
.board-class { flex: 1 1 0; display: grid; gap: 2px; align-content: center; justify-items: center; min-width: 0; min-height: 56px; padding: 6px 8px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-family: var(--body); cursor: pointer; }
.board-class-name { font-size: 15px; font-weight: 600; line-height: 1.2; }
.board-class-count { font-size: 12.5px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.board-class-count:empty { display: none; }
.board-class[aria-pressed="true"] { background: var(--surface); color: var(--accent); box-shadow: 0 1px 2px rgb(34 35 31 / .16), 0 0 0 1px var(--rule); }
.board-class[aria-pressed="true"] .board-class-count { color: var(--muted); }

.board-empty { margin: 18px 0 0; color: var(--muted); font-weight: 500; }
.board-list { display: grid; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.board-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 4px 8px; min-height: 56px; padding: 8px 16px 8px 8px; border: 1px solid var(--rule); border-radius: var(--radius-surface); background: var(--surface); }
.board-place { font: 600 24px/1 var(--head); text-align: center; font-variant-numeric: tabular-nums; }
.board-who { min-width: 0; display: grid; gap: 1px; }
.board-name { font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.board-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.board-tag { padding: 0 8px; border-radius: 999px; background: var(--tint); color: var(--tint-ink); font-size: 11.5px; font-weight: 600; line-height: 1.6; white-space: nowrap; }
.board-time { justify-self: end; font: 600 26px/1 var(--head); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.board-you { border-color: var(--accent); background: var(--tint); }
.board-open { border-style: dashed; background: transparent; color: var(--muted); }
.board-open .board-place { font-weight: 500; opacity: .7; }
.board-open .board-name { font-weight: 500; }
.board-more { display: block; width: 100%; min-height: 44px; margin: 8px 0 0; border: 0; background: transparent; color: var(--accent); font: 600 14px/1 var(--body); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.board-more[hidden] { display: none; }

.board-side { display: grid; gap: 16px; }
.board-card { padding: 18px 20px; border: 1px solid var(--rule); border-radius: 12px; background: var(--surface); }
.board-card h3 { margin: 0; font: 600 20px/1.15 var(--head); }
.board-card p { margin: 8px 0 16px; color: var(--muted); font-size: 14.5px; }
.board-card .cta { width: 100%; }
.board-how { justify-self: start; }
.board-how summary { display: grid; place-items: center; width: 44px; height: 44px; list-style: none; cursor: pointer; color: var(--accent); font: italic 600 18px/1 var(--head); }
.board-how summary::-webkit-details-marker { display: none; }
.board-how summary { border-radius: 50%; border: 1px solid var(--rule); background: var(--surface); }
.board-how[open] summary { background: var(--tint); border-color: var(--accent); }
.board-how ul { display: grid; gap: 6px; margin: 8px 0 0; padding-left: 18px; color: var(--muted); font-size: 13.5px; line-height: 1.45; }

/* Step 4: the podium (DOM in place order, `order` puts 2nd left) and picked pictures, as in the app */
.board-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.board-podium { display: flex; align-items: flex-end; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; overflow: hidden; }
.board-podium:empty { display: none; }
.board-step { flex: 1 1 0; display: grid; min-width: 0; order: 1; }
.board-step[data-place="2"] { order: 0; }
.board-step[data-place="3"] { order: 2; }
.board-step[data-place="1"] { flex-grow: 1.12; }
.board-step[data-n="2"] { flex-grow: 2; }
.board-step[data-n="3"] { flex-grow: 3; }
.board-step-who { display: flex; justify-content: center; align-items: flex-end; gap: 6px; padding: 0 2px 8px; min-width: 0; }
.board-person { flex: 1 1 0; display: grid; justify-items: center; gap: 3px; min-width: 0; text-align: center; }
.board-person-pic { position: relative; display: inline-grid; }
.board-person-name { max-width: 100%; font-weight: 600; font-size: 14.5px; line-height: 1.2; overflow: hidden; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.board-person-time { font: 600 22px/1 var(--head); font-variant-numeric: tabular-nums; white-space: nowrap; }
.board-step[data-place="1"] .board-person-time { font-size: 28px; }
.board-open-name { color: var(--muted); font-size: 14.5px; }
.board-block { display: grid; place-items: center; height: 52px; border-radius: 12px 12px 4px 4px; background: color-mix(in srgb, var(--accent) 80%, var(--paper)); color: #fff; font: 600 28px/1 var(--head); }
.board-step[data-place="1"] .board-block { height: 92px; background: var(--accent); font-size: 40px; }
.board-step[data-place="2"] .board-block { height: 68px; background: color-mix(in srgb, var(--accent) 88%, var(--paper)); }
.board-step[data-open] .board-block { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 2px var(--rule); }
.board-medal { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #f3c13a; box-shadow: inset 0 0 0 2px #9a6f00; color: #4a3200; font: 600 15px/1 var(--head); }
.board-step[data-place="2"] .board-medal { background: #d5d9e0; box-shadow: inset 0 0 0 2px #7d8592; color: #2b313b; }
.board-step[data-place="3"] .board-medal { background: #e3a170; box-shadow: inset 0 0 0 2px #b56f3c; color: #4a2408; }
.board-medal[data-badge] { position: absolute; right: -7px; bottom: -5px; width: 20px; height: 20px; font-size: 12px; }
@media (prefers-reduced-motion: no-preference) {
  .board-rise .board-block { animation: board-rise .3s cubic-bezier(.32, .72, 0, 1) both; }
  .board-rise [data-place="1"] .board-block { animation-delay: 60ms; }
  .board-rise .board-step-who { animation: board-up .18s ease-out both .24s; }
  .board-rise [data-place="1"] .board-step-who { animation-delay: .3s; }
}
@keyframes board-rise { from { transform: translateY(100%); } }
@keyframes board-up { from { opacity: 0; transform: translateY(6px); } }
.board-pics .board-row { grid-template-columns: 44px 32px minmax(0, 1fr) auto; }
.board-pic-cell, .board-pic { display: grid; place-items: center; }
.board-pic { width: 32px; height: 32px; border-radius: 50%; background: #ece6ff; --f: #7c5cf0; --e: #4b2fb8; --v: #1d1d27; }
.board-person .board-pic { width: 44px; height: 44px; }
.board-pic svg { width: 86%; }
.board-pic path { fill: var(--f); stroke: var(--e); stroke-width: 1.5; }
.board-pic path + path { fill: var(--v); stroke: none; }
.board-pic path + path + path { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; }
[data-pic="helmet-red"] { --f: #e8483f; --e: #a3231c; background: #fde4e2; }
[data-pic="helmet-green"] { --f: #1f8a5b; --e: #0f5a3a; background: #dcf3e8; }
[data-pic="helmet-yellow"] { --f: #f2b705; --e: #8a6400; background: #fff3c9; }
[data-pic="helmet-blue"] { --f: #2a6fdb; --e: #17449a; background: #e0ebfc; }
[data-pic="helmet-black"] { --f: #2b2b36; --e: #000; --v: #9aa0b5; background: #e6e6ec; }
.board-pic[data-pic="plate"] { border-radius: 7px; height: 26px; background: #fff; box-shadow: inset 0 0 0 2px #1d1d27; color: #1d1d27; font: 600 14px/1 var(--head); font-variant-numeric: tabular-nums; }
.board-pic[data-class="car"] { height: 32px; border-radius: 50%; }
.board-pic[data-class="bike"] { width: 26px; height: 32px; background: #f5c518; }
.board-person .board-pic[data-pic="plate"] { font-size: 18px; }
.board-person .board-pic[data-class="car"] { height: 44px; }

@media (min-width: 900px) {
  .board-grid { grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; }
  .board-side { position: sticky; top: 24px; }
  .board-row { padding-right: 20px; }
}
