/* BkL: «Гонка с тенью» (race.js). Цвета только из переменных темы; зелёный и красный для «быстрее» и «медленнее тени». */
:root { --rg: #3fb865; --rb: #ee6a62; }
:root[data-theme="light"] { --rg: #1f7a3c; --rb: #b3261e; }
.racev { max-width: 720px; margin: 0 auto; }
.rtop { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; }
.rtop .gback { margin: 0; flex: none; }
.rtop h2 { margin: 0; font-size: 21px; font-weight: 800; letter-spacing: -.02em; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rload { padding: 24px 0; text-align: center; color: var(--muted); }
.rcard { margin: 0 0 12px; padding: 14px 14px 12px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); border-radius: 10px; }
.rcard h3 { margin: 0 0 4px; font-size: 18px; font-weight: 800; letter-spacing: -.015em; }
.rcard p { margin: 4px 0; font-size: 14px; line-height: 1.4; }
.rsub { color: var(--muted); }
.rsub.bad { color: var(--rb); font-weight: 700; }
.rmine { font-weight: 800; }
.rwarn { color: var(--muted); font-size: 13px; }
.rh { margin: 12px 0 6px; font-size: 13px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.rrow { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.rrow .btn { min-height: 44px; }
.rcol { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.rcol .btn { min-height: 46px; }
.rnote { margin: 0 0 12px; padding: 10px 12px; font-weight: 800; border-radius: 10px; background: var(--surface2); box-shadow: inset 0 0 0 1px var(--line); }
.rnote.good { color: var(--rg); }
.rrules { margin: 4px 0 0; padding-left: 18px; font-size: 13.5px; line-height: 1.45; color: var(--muted); }
.ryl { color: var(--text); font-size: 14px; }
.ryl.me { font-weight: 800; color: var(--gold); }
:root[data-theme="light"] .ryl.me { color: var(--red); }
.rmy { display: block; width: 100%; margin-top: 6px; padding: 10px 12px; text-align: left; font-weight: 700; background: var(--surface2); border-radius: 8px; box-shadow: inset 0 0 0 1px var(--line); }
.rtable { display: flex; flex-direction: column; }
.rt { display: grid; grid-template-columns: 26px minmax(0, 1fr) 62px 62px; gap: 6px; align-items: baseline; padding: 6px 4px; border-top: 1px solid var(--line); font-size: 14px; font-variant-numeric: tabular-nums; }
.rt:first-child { border-top: 0; }
.rt .rp { font-weight: 800; color: var(--muted); }
.rt .rn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.rt .ro, .rt .rm { text-align: right; color: var(--muted); font-size: 13px; }
.rt.me { background: var(--surface2); }
.rt.me .rn, .rt.me .rp { color: var(--gold); }
:root[data-theme="light"] .rt.me .rn, :root[data-theme="light"] .rt.me .rp { color: var(--red); }
.rnone { color: var(--muted); font-size: 13.5px; margin: 2px 0; }

/* итог */
.rcard.final { text-align: center; }
.rplace { font-size: 34px; font-weight: 800; line-height: 1.1; color: var(--gold); letter-spacing: -.02em; }
:root[data-theme="light"] .rplace { color: var(--red); }
.rbig { font-size: 20px; font-weight: 800; margin-top: 2px; font-variant-numeric: tabular-nums; }
.rcard.final .rrow { justify-content: center; }
.rghost { font-weight: 800; font-size: 14px; }
.rghost.up, .rsong .rd.up { color: var(--rg); }
.rghost.down, .rsong .rd.down { color: var(--rb); }
.rghost.eq { color: var(--muted); }
.rsong { display: grid; grid-template-columns: 18px minmax(0, 1fr) 54px 54px 48px; gap: 5px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.rsong.head { border-top: 0; font-size: 11.5px; font-weight: 800; color: var(--muted); text-transform: uppercase; }
.rsong .ri { color: var(--muted); font-weight: 800; }
.rsong .rsn { min-width: 0; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 12px; }
.rsong .rt1 { text-align: right; font-weight: 700; }
.rsong .rt1.ok { color: var(--rg); }
.rsong .rt1.bad { color: var(--rb); }
.rsong .rd { text-align: right; font-weight: 800; }

/* заход */
.racerun .rruntop { gap: 8px; }
.playing.racerun .stage { height: auto; min-height: 120px; overflow: visible; }
.racerun .rpos { flex: 1 1 auto; text-align: center; font-weight: 800; font-size: 14px; }
.racerun .rtally { flex: none; font-size: 12px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.racerun .stage .state.verdict.ok { color: var(--rg); }
.racerun .stage .state.verdict.bad { color: var(--rb); }
.racerun .stage .rghost { margin-top: 2px; font-size: 14.5px; }
.racerun .stage .rghostlive { font-size: 13px; color: var(--text); opacity: .85; font-weight: 700; margin-top: 3px; }
.racerun .stage .rnextbtn { min-height: 34px; }
.racerun .stage .big { font-variant-numeric: tabular-nums; }
.racebtn { padding: 0 14px; white-space: nowrap; }

/* окно вызова и выхода */
.rsheet { position: fixed; inset: 0; z-index: 70; display: flex; align-items: flex-end; justify-content: center; background: rgba(0, 0, 0, .55); }
.rsc { width: 100%; max-width: 520px; padding: 18px 16px 22px; background: var(--surface); border-radius: 14px 14px 0 0; box-shadow: 0 -8px 30px rgba(0, 0, 0, .35); }
.rsc h3 { margin: 0 0 6px; font-size: 19px; font-weight: 800; }
.rsc p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.4; }
.racev .picker { margin-bottom: 8px; }
.rnote.bad { color: var(--rb); }
.rmsg { margin: 10px 0 0; }
.rmsg:empty { display: none; }
.rbtn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 52px; width: 100%; line-height: 1.15; }
.rbtn b { font-size: 17px; }
.rbtn small { font-size: 12.5px; font-weight: 600; opacity: .8; }
.rbtn.busy { opacity: .6; }
.rmy small { display: block; font-weight: 600; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.rmy.fin small { color: var(--gold); }
