.race { max-width: 820px; margin: 0 auto; padding: 1rem; display: flex; flex-direction: column; gap: .8rem; user-select: none; }
.race-head { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.race-back { color: var(--muted, #94a3b8); text-decoration: none; font-size: .9rem; }
.race-logo { margin: 0; flex: 1; font-size: 2.6rem; font-weight: 900; font-style: italic; background: linear-gradient(90deg, #22d3ee, #4ade80); -webkit-background-clip: text; background-clip: text; color: transparent; }
.race-scores { display: flex; gap: .5rem; }
.race-score { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); border-radius: 10px; padding: .3rem .8rem; text-align: center; min-width: 64px; }
.race-score span { display: block; font-size: .7rem; text-transform: uppercase; color: var(--muted, #94a3b8); }
.race-score b { font-size: 1.2rem; }
.race-bar { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.race-hint { color: var(--muted, #94a3b8); font-size: .85rem; }
.race-btn { background: linear-gradient(90deg, #22d3ee, #f472b6); border: none; color: #0b1026; font-weight: 700; padding: .55rem 1rem; border-radius: 10px; cursor: pointer; }
.race-help { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); border-radius: 12px; padding: .6rem .9rem; }
.race-help summary { cursor: pointer; font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted, #94a3b8); }
.race-help ul { margin: .6rem 0 0; padding-left: 1.1rem; display: grid; gap: .35rem; font-size: .9rem; line-height: 1.4; }
.race-settings fieldset { border: 0; padding: 0; margin: .6rem 0 0; display: grid; gap: .45rem; font-size: .9rem; }
.race-settings label { display: grid; grid-template-columns: 8.5rem 1fr 7rem; align-items: center; gap: .5rem; }
.race-settings label.check { display: flex; }
.race-settings b { font-variant-numeric: tabular-nums; text-align: right; }
.race-settings fieldset:disabled { opacity: .5; }

.race-track { position: relative; width: min(100%, calc(72vh * 10 / 16)); aspect-ratio: 10 / 16; margin: 0 auto; }
.race-canvas { display: block; width: 100%; height: 100%; border-radius: 16px; border: 1px solid rgba(255,255,255,.1); touch-action: none; }
.race-overlay {
    position: absolute; inset: 0; border-radius: 16px; z-index: 5; text-align: center; padding: 1rem;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem;
    background: rgba(11, 16, 38, .8); backdrop-filter: blur(3px); animation: race-fade .4s ease;
}
.race-overlay h2 { margin: 0; font-size: 2.2rem; }
.race-best { color: #fde047; font-weight: 700; }
@keyframes race-fade { from { opacity: 0; } }

.race.wide { max-width: 1060px; }
.race-btn.ghost { background: rgba(255,255,255,.12); color: inherit; }
.race-btn:disabled, .race-seg button:disabled { opacity: .5; cursor: default; }
.race-seg { display: flex; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); border-radius: 10px; overflow: hidden; }
.race-seg button { background: none; border: none; color: inherit; padding: .5rem .7rem; font-weight: 700; cursor: pointer; }
.race-seg button.on { background: linear-gradient(90deg, #22d3ee, #4ade80); color: #0b1026; }
.race-row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.race-row.spread { justify-content: space-between; }
.race-online { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); border-radius: 12px; padding: .7rem .9rem; display: grid; gap: .5rem; }
.race-online label { display: flex; align-items: center; gap: .5rem; font-size: .9rem; }
.race-online input { flex: 1; background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.15); color: inherit; border-radius: 8px; padding: .4rem .6rem; font-size: 1rem; }
.race-online small { color: var(--muted, #94a3b8); }
.race .code { text-transform: uppercase; letter-spacing: .2em; font-weight: 800; }
.race-chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.race-chips .chip { background: rgba(255,255,255,.1); border-radius: 999px; padding: .2rem .7rem; font-size: .85rem; }
.race-chips .chip.me { background: #22d3ee; color: #0b1026; font-weight: 700; }
.race-results { margin: .3rem 0 .6rem; padding-left: 1.4rem; text-align: left; display: grid; gap: .25rem; min-width: 220px; }
.race-results li.me b { color: #22d3ee; }
.race-results span { color: var(--muted, #94a3b8); margin-left: .4rem; }
.race-track.duo { width: min(100%, calc(72vh * 20 / 16)); aspect-ratio: 20 / 16; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
@media (min-width: 700px) and (pointer: fine) { .race-track:not(.duo) { width: min(100%, 760px, calc(40vh * 16 / 10)); aspect-ratio: 16 / 10; } .race-track.duo { width: min(100%, 1000px, calc(40vh * 2)); aspect-ratio: 2 / 1; } }
/* Help en instellingen onder het speelveld, zodat het veld bovenaan direct in beeld past. */
.race > .race-help { order: 1; }
@media (min-width: 700px) and (pointer: fine) { .race { padding: .5rem 1rem; gap: .5rem; } .race-logo { font-size: 1.8rem; } }
