/* «Машинка в пути» — индикатор загрузки (docs/41). Цвета — переменные сайта. */
:root { --wk-car: var(--gold); --wk-pin: var(--brand); --wk-tree: color-mix(in oklab, var(--ok) 75%, var(--night)); --wk-hill: var(--bg-2);
  --wk-road: var(--night); --wk-paper: var(--bg); --wk-tx: var(--ink-2); }
@media (prefers-color-scheme: dark) { :root:not([data-scheme=light]) { --wk-road: color-mix(in oklab, var(--ink) 30%, var(--bg)); --wk-tree: color-mix(in oklab, var(--ok) 70%, #fff); } }
:root[data-scheme=dark] { --wk-road: color-mix(in oklab, var(--ink) 30%, var(--bg)); --wk-tree: color-mix(in oklab, var(--ok) 70%, #fff); }

.wk-scene, .wk-car { overflow: hidden; }
.wk-scene { display: block; width: 240px; max-width: 70vw; height: auto; margin: auto;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 22%, #000 78%, transparent 100%);
          mask-image: linear-gradient(to right, transparent 0, #000 22%, #000 78%, transparent 100%); }
.wk-scene .hills { fill: var(--wk-hill); animation: wk-scroll 9s linear infinite; }
.wk-scene .near { animation: wk-scroll 2.6s linear infinite; }
.wk-scene .near .t { fill: var(--wk-tree); }
.wk-scene .near .p path { fill: var(--wk-pin); } .wk-scene .near .p circle { fill: var(--wk-paper); }
.wk-scene .road { fill: var(--wk-road); }
.wk-scene .lane { stroke: var(--wk-paper); stroke-width: 1.6; stroke-dasharray: 9 9; animation: wk-lane .45s linear infinite; }
:is(.wk-scene, .wk-car) .bob { animation: wk-bob .42s ease-in-out infinite alternate; }
:is(.wk-scene, .wk-car) .paint { fill: var(--wk-car); }
:is(.wk-scene, .wk-car) .win { fill: var(--wk-paper); opacity: .9; }
:is(.wk-scene, .wk-car) .rail { stroke: var(--wk-road); stroke-width: 1.4; stroke-linecap: round; }
:is(.wk-scene, .wk-car) .lamp { fill: #fde68a; } :is(.wk-scene, .wk-car) .tail { fill: #ef4444; }
:is(.wk-scene, .wk-car) .tyre { fill: #1f2937; } :is(.wk-scene, .wk-car) .hub { fill: #e5e7eb; }
:is(.wk-scene, .wk-car) .spokes { stroke: #1f2937; stroke-width: 1; transform-box: fill-box; transform-origin: center; animation: wk-spin .35s linear infinite; }
:is(.wk-scene, .wk-car) .puff { fill: var(--wk-tx); opacity: 0; transform-box: fill-box; transform-origin: center; animation: wk-puff 1.2s ease-out infinite; }
:is(.wk-scene, .wk-car) .puff.b { animation-delay: .4s; } :is(.wk-scene, .wk-car) .puff.c { animation-delay: .8s; }
@keyframes wk-scroll { to { transform: translateX(-200px); } }
@keyframes wk-lane { to { stroke-dashoffset: 18; } }
@keyframes wk-bob { from { transform: translateY(0); } to { transform: translateY(-1.2px); } }
@keyframes wk-spin { to { transform: rotate(360deg); } }
@keyframes wk-puff { 0% { opacity: .35; transform: translate(0,0) scale(.4); } 100% { opacity: 0; transform: translate(-14px,-4px) scale(1.6); } }

/* 1. дорога-прогресс по нижнему краю шапки: машина посередине линии, позади — золотой шлейф, впереди — приглушённый пунктир */
.wk-road { position: fixed; left: 0; right: 0; top: var(--wk-top, 0px); z-index: 9998; height: 20px; pointer-events: none; opacity: 0; transition: opacity .2s; }
.wk-road.on { opacity: 1; }
.wk-road .wk-ahead { position: absolute; left: 0; right: 0; top: 9px; height: 2px;
  background: repeating-linear-gradient(90deg, color-mix(in oklab, var(--wk-tx) 40%, transparent) 0 6px, transparent 6px 13px); }
.wk-road .wk-trail { position: absolute; left: 0; top: 8px; height: 4px; width: 0; border-radius: 0 2px 2px 0;
  background: linear-gradient(90deg, color-mix(in oklab, var(--wk-car) 35%, transparent), var(--wk-car));
  box-shadow: 0 0 8px color-mix(in oklab, var(--wk-car) 60%, transparent); }
.wk-road .wk-car { position: absolute; top: 1px; left: 0; width: 44px; height: 18px; }
.wk-road.on .wk-trail { animation: wk-trail 6s cubic-bezier(.3,.1,.3,1) forwards; }
.wk-road.on .wk-car { animation: wk-drive 6s cubic-bezier(.3,.1,.3,1) forwards; }
@keyframes wk-trail { from { width: 0; } to { width: 85vw; } }
@keyframes wk-drive { from { transform: translateX(-26px); } to { transform: translateX(calc(85vw - 26px)); } }

/* 2. маршрут: сцена по центру; нажатия проходят насквозь (кнопка «Обновить» — исключение) */
.wk-loader { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; pointer-events: none;
  background: color-mix(in srgb, var(--wk-paper) 82%, transparent); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  opacity: 0; transition: opacity .25s; }
.wk-loader.on { opacity: 1; }
.wk-loader[hidden], .wk-road[hidden] { display: none; }
.wk-box { text-align: center; padding: 1rem; }
.wk-caption { margin: .6rem 0 0; min-height: 1.5em; font-weight: 500; color: var(--wk-tx); transition: opacity .3s; }
.wk-slow { margin: .8rem 0 0; } .wk-slow .btn { pointer-events: auto; }

/* 3–4. внутри карты и подсказок */
.wk-inline { position: absolute; inset: 0; z-index: 2; display: grid; place-content: center; gap: .3rem; text-align: center; color: var(--wk-tx); font-size: .9rem; pointer-events: none; background: var(--bg-2); }
.wk-inline .wk-scene { width: 150px; }
li.wk-searching { display: flex; align-items: center; gap: .5rem; color: var(--wk-tx); cursor: default; }
li.wk-searching .wk-car { width: 40px; height: 16px; flex: none; }

@media (prefers-reduced-motion: reduce) {
  .wk-scene *, .wk-car *, .wk-road * { animation: none !important; }
  .wk-road .wk-car { transform: translateX(calc(40vw - 26px)); } .wk-road .wk-trail { width: 40vw; }
}
