* { box-sizing: border-box; margin: 0; }
:root {
  --bg: #0b0e13;
  --panel: #12161d;
  --panel2: #1a2029;
  --line: #232b36;
  --text: #e6ecf3;
  --dim: #77839200;
  --dim2: #b4c0ce;
  --accent: #4cc2ff;
  --ok: #3fd68c;
  --warn: #ffcc66;
  --bad: #ff6a6a;
  /* масштаб интерфейса (ui-scale.js): 1 в окне ~1280×760 и на телефоне, больше — на большом экране и в полном экране.
     Под zoom vh/vw элемента тоже умножаются на --ui — внутри масштабируемых слоёв высоты от окна пишутся через --vh/--vw */
  --ui: 1;
  --vh: calc(1vh / var(--ui));
  --dvh: calc(1dvh / var(--ui));
  --vw: calc(1vw / var(--ui));
}
/* масштабируемые слои: экраны, плашки, карточки и окна поверх холста. Не масштабируются холсты, затемнение, свечение
   машины и полёт монет (координаты экрана); метки карты и подсказка обучения масштабируются сами, их координаты делят
   на масштаб (map.js, tutorial.js) */
#hud, #raceHud, #racePlate, #orderInfo, #failBanner, #stallBanner, #introPlate, #flipBanner, #rewardToast, #finishBanner,
#story, #moneyHud, #mapStatus, #zoneNav, #mapBack, #mapShop, #garage, #menu, #trackLoad, #langLoad, #pauseOverlay, #loading, #dash,
#adMock, #fatal, #noGpu, dialog, #zoneLabels > *, #farmTags > *, #callouts > *, body > #tut { zoom: var(--ui); }
html, body { height: 100%; overscroll-behavior: none; }   /* без overscroll резинка iOS открывает пустоту под канвасом */
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 -apple-system, "SF Pro Text", Segoe UI, Roboto, sans-serif;
  overflow: hidden;
}
/* 100vh на телефоне — БОЛЬШОЙ вьюпорт (как будто адресной строки нет), поэтому низ
   экрана уезжал под неё. dvh — фактически видимая высота; браузеры постарше второго
   объявления не понимают и остаются на 100vh. */
#app { display: flex; height: 100vh; height: 100dvh; }
/* баннер площадки на экранах гаража и карты (main.js syncBanner): игра короче на высоту полосы (с запасом под вырез снизу),
   баннер — в полосе, интерфейс он не закрывает */
body.adBanner #app { height: calc(100vh - var(--adBanH, 0px) - env(safe-area-inset-bottom)); height: calc(100dvh - var(--adBanH, 0px) - env(safe-area-inset-bottom)); }
#adBanner { position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--adBanH, 0px) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  display: flex; align-items: center; justify-content: center; background: #07090c; z-index: 4; overflow: hidden; }
#adBanner[hidden] { display: none; }
/* баннер поверх сцены (caps.bannerOverlay — CrazyGames, отказ 09.11.2026: «the banner must blend with the game without black
   bars»): игра во весь экран, у #adBanner нет фона и полосы — только сам баннер внизу по центру. Кнопки нижних углов гаража
   и карты поднимаются над ним (translate — поверх их собственных правил расположения; под zoom слоя — делённое на масштаб),
   лист деталей гаража в портрете кончается над ним, выноски карты его обходят (map.js) */
body.adOverlay { --adLift: calc(var(--adBanH, 0px) / var(--ui, 1)); }
body.adOverlay #adBanner { z-index: 31; } /* остаётся видимым над меню (14), обучением (25) и переходом сцены (30) */
body.adOverlay #adBanner, body.adKeep #adBanner { left: 50%; right: auto; width: max-content; transform: translateX(-50%); background: none; padding-bottom: 0;
  bottom: env(safe-area-inset-bottom); height: auto; pointer-events: none; }
body.adOverlay #adBanner > *, body.adKeep #adBanner > * { pointer-events: auto; }
/* Keep the CG slot inside the edge even when the browser rounds fractional viewport pixels. */
body.adOverlay #adBanner:has(#cgBanner) { bottom: calc(env(safe-area-inset-bottom) + 2px); }
/* один баннер на сеанс (caps.bannerKeep): вне гаража и карты — невидим и не ловит нажатий, но остаётся в раскладке, и SDK его
   не удаляет; на экране с баннером — тот же самый, без нового запроса */
#adBanner.off { visibility: hidden; }
/* над модальным окном игры (main.js raiseBanner, CrazyGames 11.11.2026): полоса в верхнем слое как popover — без его рамки,
   фона и растяжки на весь экран, на прежнем месте внизу по центру */
#adBanner[popover] { top: auto; margin: 0; border: 0; padding: 0; overflow: visible; background: none; color: inherit; }
/* главное меню с баннером (caps.bannerMenu): карточка — по центру места над ним */
body.adOverlay #menu { padding-bottom: calc(var(--adBanH, 0px) / var(--ui, 1)); box-sizing: border-box; }
@media (orientation: landscape) {
  /* компьютер: кнопки нижних углов ставит на линию баннера main.js placeCornerButtons (CrazyGames 11.11.2026); телефон — над ним */
  body.adOverlay.touch #mapBack, body.adOverlay.touch #mapShop, body.adOverlay.touch #toMapBtn { translate: 0 calc(-1 * var(--adLift)); }
}
@media (orientation: portrait) {
  body.adOverlay.touch #mapBack, body.adOverlay.touch #mapShop { translate: 0 calc(-1 * var(--adLift)); }
  body.adOverlay #garagePanel { bottom: var(--adLift); }
}
#adBanner .mock { display: flex; align-items: center; justify-content: center; border: 1px dashed #ffffff4d; border-radius: 4px; color: #ffffff80; font-size: 12px; }
/* поле игры не шире --max-aspect:1 на компьютере (caps.maxAspect, Playgama — 2:1): на сверхшироком окне поля по бокам,
   интерфейс (всё внутри #canvasWrap) — вместе с полем; телефон и планшет (грубый указатель) — во весь экран */
@media (pointer: fine) {
  body.maxAspect #app { max-width: calc(100vh * var(--max-aspect, 2)); max-width: calc(100dvh * var(--max-aspect, 2)); margin: 0 auto; }
}

/* полосы прокрутки в стиле игры (карточка заказа, панель гаража, настройки, карточка финиша). Серый бегунок на
   прозрачной дорожке CrazyGames принял за системную полосу (Full Launch 06.11.2026: «custom scrollbar instead of the
   default») — теперь бегунок в цвет акцента игры на тёмной скруглённой дорожке с рамкой, как панели. Blink/WebKit —
   через ::-webkit-scrollbar (стандартные scrollbar-* в Chrome их отключили бы), Firefox — стандартные. Бегунок уже
   полосы на рамку прозрачного бордюра (background-clip), при наведении светлее, при перетаскивании — жёлтый */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: #0b0e13b3; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--line); }
::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-button { display: none; }
::-webkit-scrollbar-thumb { background: linear-gradient(#6fd0ff, #2f9be0); background-clip: padding-box; border: 3px solid transparent; border-radius: 10px; min-height: 40px; }
::-webkit-scrollbar-thumb:hover { background: linear-gradient(#9be0ff, #4cc2ff); background-clip: padding-box; }
::-webkit-scrollbar-thumb:active { background: var(--warn); background-clip: padding-box; }
@supports not selector(::-webkit-scrollbar) { * { scrollbar-width: thin; scrollbar-color: var(--accent) #0b0e13b3; } }

#canvasWrap { position: relative; flex: 1; min-width: 0; }
#gpu { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
#gpu:active { cursor: grabbing; }

/* карточка сбоя (main.js fatal): видеокарта потеряна или старт не удался — поверх всего, с перезапуском */
#fatal {
  position: absolute; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center;
  padding: 16px; background: linear-gradient(180deg, #0b0e13, #12161d);
}
#fatal .menuCard { text-align: left; max-width: 440px; }
#fatal .menuTitle { font-size: 22px; }
#fatal p { font-size: 14.5px; color: #c2ccd8; line-height: 1.5; margin: 8px 0 14px; }
#fatal .why { margin-top: 10px; font-size: 11px; color: var(--dim2); font-family: ui-monospace, Menlo, monospace; overflow-wrap: anywhere; }
#fatal[hidden], [hidden] { display: none !important; }
/* экран возможностей: WebGPU недоступен — спокойная карточка, а не красный текст */
#noGpu {
  position: absolute; inset: 0; z-index: 15; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #0b0e13, #12161d);
}
#noGpu .menuCard { text-align: left; }
#noGpu p { font-size: 14.5px; color: #c2ccd8; line-height: 1.5; margin: 8px 0; }
#noGpu ul { font-size: 14.5px; color: #c2ccd8; line-height: 1.6; margin: 6px 0 12px; padding-left: 20px; }
#noGpu .why { font-size: 11px; color: var(--dim2); font-family: ui-monospace, Menlo, monospace; }

/* ── HUD поверх канваса ── */
#hud {
  position: absolute; top: 12px; left: 12px; display: flex;
  flex-direction: column; gap: 8px; max-width: 480px;
}
.hudRow { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.hudGroup { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.hudLabel { font-size: 12.5px; color: var(--dim2); width: 42px; text-shadow: 0 1px 3px #000, 0 0 2px #000; }
#hud button, #hud select {
  background: #12161dd9; color: var(--text); border: 1px solid var(--line);
  border-radius: 7px; padding: 5px 11px; font-size: 13.5px; cursor: pointer;
  backdrop-filter: blur(6px);
}
#hud button:hover { border-color: var(--accent); }
#hud button.on { background: #14405c; border-color: var(--accent); color: #cdefff; }
#paramBox {
  background: #12161dd9; border: 1px solid var(--line); border-radius: 9px;
  padding: 6px 10px; backdrop-filter: blur(6px); width: 300px;
}
#paramBox summary { cursor: pointer; font-size: 12px; color: var(--dim2); }
#paramBox label {
  display: grid; grid-template-columns: 96px 1fr 38px; gap: 8px;
  align-items: center; font-size: 11px; color: var(--dim2); margin: 7px 0;
}
#paramBox output { text-align: right; color: var(--text); font-variant-numeric: tabular-nums; }
#paramBox input[type=range] { accent-color: var(--accent); }
#hint {
  font-size: 12.5px; color: var(--dim2); text-shadow: 0 1px 3px #000;
  background: #0b0e13d6; border-radius: 7px; padding: 4px 8px; width: fit-content;
}
#hint b { color: var(--text); }

/* ── панель статистики ── */
#stats {
  width: 348px; flex: none; background: var(--panel);
  border-left: 1px solid var(--line); padding: 14px 16px 20px;
  overflow-y: auto; display: flex; flex-direction: column; gap: 14px;
}
#stats h1 { font-size: 16px; font-weight: 650; }
#stats h1 .sub { display: block; font-size: 11px; font-weight: 400; color: var(--dim2); margin-top: 2px; }
#stats h2 { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--dim2); margin-bottom: 8px; }
#stats h2 .dim { text-transform: none; letter-spacing: 0; font-weight: 400; }
section { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
section.off { opacity: .72; }

.bigRow { display: flex; gap: 10px; }
.bigRow > div { flex: 1; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; text-align: center; }
.big { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.big.ok { color: var(--ok); } .big.warn { color: var(--warn); } .big.bad { color: var(--bad); }
.big2 { font-size: 20px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.cap { font-size: 12px; color: var(--dim2); margin-top: 1px; }
.mem { font-size: 13px; font-weight: 600; margin-top: 6px; font-variant-numeric: tabular-nums; }

.loadRow { display: flex; gap: 12px; align-items: stretch; }
#utilSpark { flex: 1; height: 74px; min-width: 0; }
.loadVals { width: 96px; flex: none; text-align: right; }
.note { font-size: 12.5px; color: var(--dim2); margin-top: 8px; }
.note code { background: #0b0e13; padding: 1px 5px; border-radius: 4px; }

.kv div { display: flex; justify-content: space-between; gap: 10px; padding: 2.5px 0; }
.kv span { color: var(--dim2); }
.kv b { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.badges { margin-top: 6px; display: flex; gap: 5px; flex-wrap: wrap; }
.badge { font-size: 12px; padding: 2px 7px; border-radius: 20px; border: 1px solid var(--line); color: var(--dim2); }
.badge.on { border-color: #2c6e4f; color: var(--ok); }

table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
th { text-align: left; color: var(--dim2); font-weight: 500; font-size: 10px; padding: 0 4px 4px 0; }
td { padding: 2.5px 4px 2.5px 0; border-top: 1px solid #1d242e; }
td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.dim, .dim { color: var(--dim2); }
.bar { width: 46px; height: 5px; background: #0b0e13; border-radius: 3px; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, #2b8fd0, var(--accent)); }


#loading {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: var(--bg); color: var(--dim2); font-size: 15px; z-index: 31;   /* поверх затемнения (#fade z 30) */
}
#loading .ldBox { text-align: center; }
#loadingText { min-height: 20px; }   /* подпись появляется под спиннером, когда язык выбран — спиннер при этом не прыгает */
/* стрелочный спидометр: шкала 0–120, стрелка, обороты кольцом внутри, цифры и передача в вырезе снизу */
#gauge { width: 150px; height: 150px; display: block; }
.gFace { fill: #0b0e13d9; stroke: var(--line); stroke-width: 1.2; }
.gArc { fill: none; stroke: #2a3441; stroke-width: 3; stroke-linecap: round; }
.gArc.red { stroke: #b8404a; }
.gRpmTrack { fill: none; stroke: #1a2029; stroke-width: 3.5; stroke-dasharray: 117.3 175.9; }
.gRpm { fill: none; stroke: var(--ok); stroke-width: 3.5; stroke-dasharray: 0 175.9; }
#gaugeTicks line { stroke: #8a97a8; stroke-width: 1.2; stroke-linecap: round; }
#gaugeTicks line.major { stroke: #d7dee8; stroke-width: 2; }
#gaugeTicks line.red { stroke: var(--bad); }
#gaugeTicks text { fill: var(--dim2); font-size: 6.5px; font-weight: 600; text-anchor: middle; }
#gaugeTicks text.red { fill: var(--bad); }
.gUnit { fill: var(--dim2); font-size: 5.5px; text-anchor: middle; letter-spacing: .3px; }
#speed { fill: var(--text); font-size: 19px; font-weight: 800; text-anchor: middle; font-variant-numeric: tabular-nums; }
#needle { fill: #ff6a6a; filter: drop-shadow(0 0 1.5px #ff6a6a88); }
.gHub { fill: #1a2029; stroke: #ff6a6a; stroke-width: 1.5; }
.gGearBox { fill: #0b0e13; stroke: var(--line); stroke-width: 1; }
#gear { fill: var(--accent); font-size: 9.5px; font-weight: 800; text-anchor: middle; }

/* подготовка трассы (генерация в воркере): оверлей по центру, карта под ним размыта */
#trackLoad, #langLoad {
  position: absolute; inset: 0; display: grid; place-items: center; pointer-events: auto;
  background: #0b0e1370; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
#trackLoad { z-index: 14; }
/* смена языка: поверх затемнения смены сцены (#fade z30) и меню, ниже ролика (#adMock z40) */
#langLoad { z-index: 35; }
#langLoad .tlCard { animation: tuIn .3s ease; }
#langLoad.bad .tlSpin { display: none; }
#langLoad.bad .tlTitle { color: var(--warn); font-weight: 600; font-size: 15px; }
.langRow.busy { pointer-events: none; opacity: .55; }
.tlCard {
  width: min(calc(88 * var(--vw)), 340px); text-align: center; padding: 28px 30px 24px;
  background: #12161df2; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 20px 70px #000c;
}
.tlSpin {
  width: 48px; height: 48px; margin: 0 auto 16px; border-radius: 50%;
  border: 4px solid var(--line); border-top-color: var(--accent); animation: spin 0.9s linear infinite;
}
.tlTitle { font-size: 17px; font-weight: 700; }
.tlSub { margin-top: 4px; font-size: 14.5px; color: var(--dim2); min-height: 16px; }
.tlBar { height: 8px; margin-top: 16px; background: #0b0e13; border-radius: 4px; overflow: hidden; border: 1px solid var(--line); }
.tlBar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #2b8fd0, var(--accent)); transition: width .15s; }
.tlPct { margin-top: 7px; font-size: 13.5px; color: var(--dim2); font-variant-numeric: tabular-nums; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── затемнение и главное меню ── */
#fade {
  position: absolute; inset: 0; background: #000; opacity: 1;
  z-index: 30; pointer-events: auto;
}
#menu {
  position: absolute; inset: 0; display: grid; place-items: center; z-index: 12;
  background: radial-gradient(ellipse at center, #0b0e1355 0%, #0b0e13cc 70%, #0b0e13f2 100%);
}
.menuCard {
  width: min(calc(92 * var(--vw)), 440px); text-align: center; padding: 30px 32px 26px;
  background: #12161df0; border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 20px 70px #000c; backdrop-filter: blur(8px);
}
.menuKicker { font-size: 12.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--dim2); }
.menuTitle { font-size: 34px; font-weight: 800; margin: 6px 0 8px; letter-spacing: .01em; }
.menuSub { font-size: 14.5px; color: var(--dim2); line-height: 1.5; margin: 0 0 18px; }
#menu {
  position: absolute; inset: 0; z-index: 14; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #0b0e1355, #0b0e13aa);
}
#menuContinue, #pauseResume {
  width: 100%; padding: 13px; font-size: 16px; font-weight: 700; cursor: pointer;
  background: linear-gradient(180deg, #8ae0ff, #2fa9e4); color: #06131c;
  border: 1px solid #9fe4ff; border-radius: 12px; box-shadow: 0 10px 30px #4cc2ff44;
}
#menuContinue:hover, #pauseResume:hover { filter: brightness(1.07); }
.menuSecondary {
  margin-top: 8px; width: 100%; padding: 11px; font-size: 14px; font-weight: 700; cursor: pointer;
  background: linear-gradient(180deg, #1c5a80, #14405c); color: #e6f6ff;
  border: 1px solid var(--accent); border-radius: 12px;
}
.menuSecondary:hover { background: linear-gradient(180deg, #226b98, #175074); }
.ghost {
  margin-top: 8px; width: 100%; background: transparent; color: var(--dim2);
  border: 1px solid var(--line); border-radius: 9px; padding: 8px; font-size: 13.5px; cursor: pointer;
}
#finishBanner .ghost:hover { color: var(--text); border-color: var(--dim2); }

/* ── гонка: таймер, прогресс, финиш ── */
#raceHud {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
/* пауза и звук — крупные, над плашкой */
#topBtns { display: flex; gap: 8px; }
#topBtns button {
  width: 42px; height: 42px; font-size: 19px; line-height: 1; padding: 0; cursor: pointer;
  background: #12161dd9; color: var(--text); border: 1px solid #3a4655; border-radius: 10px;
  backdrop-filter: blur(6px);
}
#topBtns button:hover { border-color: var(--accent); }
#topBtns button svg { width: 22px; height: 22px; vertical-align: middle; }   /* ⛶ полного экрана — SVG, у Android/Windows нет глифа U+26F6 */
/* прогресс заезда — одна строка: время · полоса с машинкой · проценты (до старта — «газуй!»); было три строки
   (~85 px), плашка закрывала дорогу — теперь ~30 px. Срок заказа, если есть, — второй строкой. Телефон — свой вид (body.touch) */
#racePlate {
  position: absolute; top: calc(max(12px, env(safe-area-inset-top)) + 50px); left: 50%; transform: translateX(-50%);   /* под кнопками #raceHud */
  width: 320px; display: flex; flex-wrap: wrap; align-items: center; gap: 0 10px;
  background: #0b0e13aa; border: 1px solid var(--line); border-radius: 9px;
  padding: 5px 12px; backdrop-filter: blur(6px);
}
/* маркер-машинка на краю заполненной части прогресса */
.progWrap { position: relative; flex: 1 1 auto; min-width: 60px; margin: 0; }
#progCar {
  position: absolute; top: -8px; left: 0; width: 24px; height: 12px;
  transform: translateX(-50%); fill: #fff; filter: drop-shadow(0 1px 2px #000c);
  transition: left .2s;
}
#progCar .pcHub { fill: #0b0e13; }
/* заказ: полупрозрачные подписи в правом верхнем углу */
#orderInfo {
  position: absolute; top: 14px; right: 16px; text-align: right; pointer-events: none;
  color: var(--text); font-size: 13.5px; line-height: 1.45; text-shadow: 0 1px 2px #000;
  background: #0b0e13d6; border: 1px solid var(--line); border-radius: 9px; padding: 6px 11px;
}
#oiFarm { font-size: 14.5px; font-weight: 600; }
#raceTime {
  flex: none; min-width: 3.6em; text-align: left;
  font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 20px;
  letter-spacing: .02em; color: var(--text);
}
#progText { flex: none; margin: 0; font-size: 12.5px; white-space: nowrap; }
/* заказ, на который не пускают (брод через реку без шноркеля): причина в карточке, значок-замок в тегах */
.oBlock { display: flex; align-items: flex-start; gap: 8px; margin: 10px 0 2px; padding: 9px 11px; border: 1px solid #a8433a; border-radius: 9px; background: #3a1714; color: #ffd0c8; font-size: 14.5px; line-height: 1.35; }
.oBlock svg { width: 18px; height: 18px; flex: none; margin-top: 1px; color: #ff7a66; }
.oTag.blk { color: #ff7a66; border-color: #a8433a; }
#odGo:disabled { opacity: .45; cursor: not-allowed; }
/* гараж → Декор: карточка звёзд за рейсы */
.cIcon.star svg { color: #ffd34d; }
.swatch.star { border-radius: 50%; }
/* монеты трассы в плашке заезда — своя строка под полосой: значок-монета, собрано / всего, «+сумма» к оплате */
#raceCoins { flex-basis: 100%; display: flex; align-items: center; justify-content: center; gap: 5px; margin: 3px 0 1px; font-size: 13.5px; color: var(--dim2); font-variant-numeric: tabular-nums; }
#raceCoins[hidden] { display: none; }
#raceCoins b { color: #ffd34d; font-size: 14px; font-weight: 800; }
#rcSum { margin-left: 6px; color: #ffd34d; font-weight: 600; }
.rcIco, .pickFly { width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle at 38% 34%, #fff3b0 0 18%, #ffcf3f 34%, #e39a12 70%, #9a6408 100%); box-shadow: 0 0 6px #ffc83c99; flex: none; }
#raceCoins.pop .rcIco { animation: rcPop .28s ease-out; }
#raceCoins.pop b { animation: rcPop .28s ease-out; }
@keyframes rcPop { 0% { transform: scale(1); } 40% { transform: scale(1.5); } 100% { transform: scale(1); } }
/* монета, летящая от места подбора к счётчику */
.pickFly { position: fixed; left: -7px; top: -7px; width: 16px; height: 16px; pointer-events: none; z-index: 40; box-shadow: 0 0 12px #ffd24ccc, 0 0 3px #fff; }
/* звёзды рейса на карточке финиша: зажигаются по одной. Со звёздами кубок не рисуется — они и есть награда, а
   карточка с ними не выше прежней (кадр CrazyGames — 636 px: оплата, монеты, эвакуаторы, новая земля, кнопка ролика) */
#finishBanner:has(#finishStars:not([hidden])) .fbTrophy { display: none; }
#finishBanner { max-height: calc(98 * var(--vh)); max-height: calc(98 * var(--dvh)); overflow-y: auto; }   /* полоса прокрутки — общая (::-webkit-scrollbar выше): стандартное scrollbar-width в Chrome её отключило бы */
/* низ карточки финиша — кнопка ролика и кнопки «В гараж / К заказам» — всегда на виду (.fbFoot): длинная карточка
   (звёзды, монеты, новая земля, анонс) прокручивается над ним. Подложка — сплошная, в цвет низа карточки, с линией сверху:
   прокручиваемый текст уходит под край, а не просвечивает сквозь кнопку ролика (CrazyGames, отказ 09.11.2026: на маленьком
   экране кнопка «Watch an ad: double the pay» лежала поверх строки «1 more delivery… unlocks…» — подложка начиналась с
   прозрачного градиента) */
#finishBanner .fbFoot { position: sticky; bottom: 0; z-index: 1; margin: 6px -22px 0; padding: 10px 22px 18px; background: #0f131a; border-top: 1px solid #ffffff14; border-radius: 0 0 18px 18px; }
#finishBanner .fbFoot .fbButtons { margin-top: 0; }
#finishBanner .fbFoot > #adOffer:first-child { margin-top: 0; }   /* Poki (modestAds): блок ролика переезжает под кнопки — там отступ свой */
#finishStars { margin: 4px 0 4px; text-align: center; }
#finishStars .fsRow { display: flex; justify-content: center; gap: 6px; font-size: 32px; line-height: 1; }
#finishStars .fsStar { color: #ffffff22; text-shadow: none; }
#finishStars .fsStar.on { color: #ffd34d; text-shadow: 0 0 12px #ffb40099, 0 1px 0 #7a4b00; animation: fsPop .45s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes fsPop { 0% { transform: scale(0) rotate(-40deg); opacity: 0; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
#finishStars .fsCap { margin-top: 3px; font-size: 13.5px; color: var(--dim2); }
#finishStars .fsCap b { color: #ffd34d; }
#raceTime.idle { color: var(--dim2); }
#raceTime.done { color: var(--ok); }
.progTrack {
  height: 6px; background: #0b0e13; border: 1px solid var(--line);
  border-radius: 4px; overflow: hidden;
}
#progFill {
  height: 100%; width: 0; transition: width .2s;
  background: linear-gradient(90deg, #2b8fd0, var(--accent));
}
#finishBanner {
  position: absolute; inset: 0; margin: auto; width: 340px; height: max-content;
  background: linear-gradient(180deg, #171d27f6, #0f131af6); border: 1px solid #2c5a7a; border-radius: 18px;
  padding: 22px 22px 0; text-align: center; z-index: 12;   /* выше тачпада (9) и HUD: на телефоне джойстик лежал поверх карточки; нижнее поле (18 px) — у липкого блока кнопок */
  box-shadow: 0 18px 60px #000c, inset 0 1px 0 #ffffff14;
  animation: fbIn .45s cubic-bezier(.2, .9, .3, 1.2) both;
}
#finishBanner.win { border-color: #e9b636aa; box-shadow: 0 18px 60px #000c, 0 0 46px #e9b63633, inset 0 1px 0 #ffffff14; }
@keyframes fbIn { from { opacity: 0; transform: translateY(14px) scale(.92); } to { opacity: 1; transform: none; } }
.fbTrophy { width: 70px; height: 70px; margin: -6px auto 2px; filter: drop-shadow(0 6px 14px #e9b63655); animation: fbTrophy .7s cubic-bezier(.2, .9, .3, 1.35) both; }
.fbTrophy svg { width: 100%; height: 100%; }
#finishBanner:not(.win) .fbTrophy { filter: saturate(.25) drop-shadow(0 6px 14px #0006); opacity: .8; }
@keyframes fbTrophy { from { transform: scale(.3) rotate(-14deg); opacity: 0; } 60% { transform: scale(1.12) rotate(4deg); opacity: 1; } to { transform: none; } }
.fbTitle { font-size: 14px; letter-spacing: .28em; color: var(--ok); font-weight: 800; }
#finishBanner.win .fbTitle { color: #f2c34a; }
#finishTime {
  font-size: 42px; font-weight: 800; font-variant-numeric: tabular-nums; margin: 2px 0 0; letter-spacing: -.01em;
}
#finishBest { font-size: 12.5px; margin-bottom: 8px; }
.fbButtons { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.fbButtons button { margin: 0; }
.fbPrimary {
  width: 100%; padding: 11px 12px; font-size: 14px; font-weight: 700; cursor: pointer;
  background: linear-gradient(180deg, #2b8fd0, #1a6aa0); color: #eef8ff;
  border: 1px solid #5cb8f0; border-radius: 12px; box-shadow: 0 6px 18px #2b8fd044;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.fbPrimary:hover { filter: brightness(1.08); }
.fbPrimary.bad { background: linear-gradient(180deg, #a83a3a, #7a2424); border-color: #ff8a8a; box-shadow: 0 6px 18px #ff6a6a33; color: #ffe9e9; }
.fbSecondary {
  width: 100%; padding: 9px 12px; font-size: 14.5px; font-weight: 600; cursor: pointer;
  background: #ffffff08; color: var(--text); border: 1px solid var(--line); border-radius: 12px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.fbSecondary:hover { background: #ffffff12; border-color: var(--dim2); }
/* вход в аккаунт площадки с карточки финиша (caps.authNudge — CrazyGames): облако со стрелкой; где кнопки в ряд — своим рядом */
#finishSignIn svg { width: 18px; height: 18px; flex: none; color: var(--accent); }
.fbButtons kbd {
  font: 600 12px/1 ui-sans-serif, system-ui, sans-serif; color: #ffffffb0; padding: 3px 6px;
  border: 1px solid #ffffff33; border-bottom-width: 2px; border-radius: 5px; background: #00000033; letter-spacing: 0;
}
/* кнопка входа через Яндекс в меню: подпись с выгодой под названием (1.2.1) */
.menuSecondary.signIn { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.menuSecondary.signIn small { font-size: 12.5px; color: var(--dim2); font-weight: 500; }
/* монеты и баланс: летят из выплаты в плашку, цифры набегают и пульсируют */
#coinLayer { position: fixed; inset: 0; pointer-events: none; z-index: 14; }   /* над плашкой денег (13) и карточкой финиша (12) */
.coin {
  position: absolute; left: 0; top: 0; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff3b0, #f2c34a 45%, #b8811a 100%);
  border: 1px solid #7d5410; box-shadow: 0 2px 6px #0008, inset 0 0 0 2px #e9b63666;
  color: #6b4608; font: 800 11px/18px ui-sans-serif, system-ui, sans-serif; text-align: center;
  will-change: transform;
}
#moneyVal { display: inline-block; transition: color .2s; }
#moneyVal.pop { animation: moneyPop .38s cubic-bezier(.2, .9, .3, 1.3); color: #fff0a8; }
@keyframes moneyPop { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
#moneyHud.glow { border-color: #e9b636; box-shadow: 0 0 22px #e9b63666; }
#fxCanvas { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 7; }

/* ── приборка машины ── */
#dash {
  position: absolute; left: 16px; bottom: 14px; display: flex;
  align-items: flex-end; gap: 14px;
}
#speedBox { filter: drop-shadow(0 2px 6px #0008); }
/* схема повреждений: пикап сверху, зоны красятся от зелёного к красному */
#dmgBox { display: flex; flex-direction: column; align-items: center; gap: 3px; padding-bottom: 2px; }
#dmgSvg { width: 74px; height: 120px; display: block; filter: drop-shadow(0 2px 5px #0008); }
#dmgBox .cap { text-shadow: 0 1px 3px #000; }
.dBody { fill: #12161de6; stroke: #3a4655; stroke-width: 1.2; }
.dCabin { fill: #1a2029; stroke: #3a4655; stroke-width: .8; }
.dGlass { fill: #274c66; }
.dRoof { fill: #202834; }
.dz { fill: #1f5f43; stroke: #0b0e13; stroke-width: .8; transition: fill .3s; }
.dz.crit { animation: dmgPulse 1s ease-in-out infinite; }
.dz.gone { fill: none !important; stroke: #ff6a6a88; stroke-dasharray: 2 1.5; animation: none; }
@keyframes dmgPulse { 50% { opacity: .45; } }
#dashCol { display: flex; flex-direction: column; gap: 6px; }
/* подпись под схемой повреждений — поверх сцены: светлее и с тенью (ревью Playgama 02.10.2026: «текст трудно читать») */
#dmgBox .cap { color: var(--text); text-shadow: 0 1px 3px #000, 0 0 2px #000; }
#keysHint {
  font-size: 12.5px; color: #d2dae4; background: #0b0e13d6; border-radius: 7px;
  padding: 5px 9px; margin-bottom: 4px; text-shadow: 0 1px 3px #000; max-width: 520px; line-height: 1.55;
}
#keysHint b { color: #fff; }
.waterLink {
  display: block; text-align: center; font-size: 13px; color: var(--dim2);
  text-decoration: none; padding: 4px;
}
.waterLink:hover { color: var(--accent); }

/* ── диалог ──
   Единственное правило для <dialog>. Их было два — здесь и в блоке настроек ниже:
   одинаковая специфичность, побеждало нижнее, и настоящие padding / width / фон
   приходилось вычислять по порядку строк в файле. Собраны победившие значения,
   поэтому вид диалогов не изменился. */
dialog {
  width: min(calc(92 * var(--vw)), 440px); max-width: 800px;
  max-height: calc(86 * var(--vh)); max-height: calc(86 * var(--dvh));
  background: #12161df8; color: var(--text); border: 1px solid var(--line);
  border-radius: 16px; padding: 22px 24px; box-shadow: 0 20px 70px #000c;
}
dialog::backdrop { background: #0009; backdrop-filter: blur(3px); }
/* шапка / тело / подвал: тело — единственная растяжимая часть. Только для диалогов
   с такой разметкой; display:flex нельзя вешать на голый dialog — авторское правило
   бьёт UA-шное dialog:not([open]){display:none}, и закрытые диалоги стали бы видны. */
#setDlg[open], #howDlg[open] { display: flex; flex-direction: column; }
.dlgHead {
  display: flex; justify-content: space-between; align-items: center;
  flex: none; padding: 14px 20px; border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.dlgHead h2 { font-size: 16px; }
#howClose, #setClose { background: none; border: none; color: var(--dim2); font-size: 16px; cursor: pointer; }
#howClose:hover, #setClose:hover { color: var(--text); }
/* было max-height: calc(86vh - 54px): вычиталась только шапка, а поля (44) и рамка (2)
   нет. Тело оказывалось выше самого диалога, и на низком экране подвал срезало —
   у <dialog> нет overflow, прокручивать нечему. Теперь высоту раздаёт флекс. */
.dlgBody { padding: 6px 22px 22px; overflow-y: auto; flex: 1 1 auto; min-height: 0; }
.dlgBody h3 { font-size: 14px; margin: 18px 0 8px; color: var(--accent); }
.dlgBody p, .dlgBody li { font-size: 14.5px; color: #c2ccd8; margin: 6px 0; }
.dlgBody ol { padding-left: 22px; }
.dlgBody b { color: var(--text); }
.dlgBody code { background: #0b0e13; padding: 1px 5px; border-radius: 4px; font-size: 13.5px; }
.formula {
  text-align: center; font-size: 15px !important; color: var(--text) !important;
  background: #0b0e13; border: 1px solid var(--line); border-radius: 8px;
  padding: 10px !important; margin: 10px 0 !important;
  font-family: "SF Mono", ui-monospace, monospace;
}

/* ── гараж и деньги ── */
#moneyHud {
  position: absolute; top: 12px; right: 14px; z-index: 13;   /* выше #garage (12): на телефоне полоса вкладок закрывала баланс */
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px; background: #12161df0; border: 1px solid var(--line); border-radius: 9px;
  font-size: 14px; font-variant-numeric: tabular-nums; backdrop-filter: blur(6px);
}
#moneyHud .mIcon { color: var(--warn); font-weight: 700; }
/* «+» у плашки денег — магазин (покупки за ян); скрыт, если покупки на площадке не подключены */
#moneyHud .mAdd {
  width: 22px; height: 22px; margin: -2px -5px -2px 0; padding: 0; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; font: 800 16px/1 inherit; color: #ffe9b0;
  background: #5a3d0e; border: 1px solid var(--warn);
}
#moneyHud .mAdd:hover { background: #6e4a12; }
/* кнопка магазина: золото с мягким пульсом. В гараже и на карте (#gShop, #mapShop) — под плашкой денег,
   в меню — #menuShop в карточке; без покупок на площадке все скрыты (refreshShopEntry) */
@keyframes shopGlow {
  0%, 100% { box-shadow: 0 0 0 1px #e9b63699, 0 0 10px #e9b63633, 0 8px 24px #0008; }
  50% { box-shadow: 0 0 0 1px #ffd76a, 0 0 22px #e9b63688, 0 8px 24px #0008; }
}
.shopGlow { color: #ffe9b0; border: 1px solid #e9b636; background: linear-gradient(180deg, #6b4a12, #3d2a09); animation: shopGlow 2.6s ease-in-out infinite; cursor: pointer; }
.shopGlow:hover { background: linear-gradient(180deg, #7d5716, #4a330b); }
.shopGlow svg { width: 20px; height: 20px; flex: none; }
@media (prefers-reduced-motion: reduce) { .shopGlow { animation: none; box-shadow: 0 0 0 1px #e9b636, 0 0 16px #e9b63666, 0 8px 24px #0008; } }
.menuSecondary.shopGlow { display: flex; align-items: center; justify-content: center; gap: 8px; }
.menuSecondary.shopGlow svg { width: 18px; height: 18px; }
.shopBtn {
  position: absolute; top: 54px; right: 14px; z-index: 13; pointer-events: auto; min-width: 112px;   /* 54 = низ плашки денег (12 + 36) + 6 */
  display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 7px 13px 7px 10px; border-radius: 9px; font-size: 14px; font-weight: 700; line-height: 1.2;
}

/* ── магазин: окно покупок за ян (цена и иконка валюты — из каталога площадки, 1.13.2/1.13.4) ── */
#shopDlg { width: min(calc(94 * var(--vw)), 520px); }
#shopDlg[open] { display: flex; flex-direction: column; }
.shopHead { display: flex; align-items: center; gap: 10px; }
.shopHead h3 { margin: 0; }
.shopIcon { width: 26px; height: 26px; color: var(--warn); display: flex; }
.shopIcon svg { width: 100%; height: 100%; }
#shopDlg > .cap { color: var(--dim2); margin: 4px 0 12px; font-size: 13.5px; }
#shopList { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 6px; margin-right: -14px; padding-right: 8px; }
#shopDlg .dlgFoot { flex: none; }
/* гостю: вход через Яндекс, чтобы покупки жили в аккаунте */
.shopAuth { flex: none; display: flex; align-items: center; gap: 10px; margin: 0 0 10px; padding: 8px 10px; font-size: 13.5px; line-height: 1.35; border: 1px solid var(--accent); border-radius: 10px; background: #14405c55; }
.shopAuth span { flex: 1; }
/* комбо-товар (сейф + без рекламы): два значка рядом через «+» — «деньги плюс без рекламы» */
.cIcon.duo { width: auto; gap: 2px; }
.cIcon.duo > svg, .cIcon.duo .cIcon2 svg { width: 22px; height: 22px; }
.cIcon.duo .cPlus { font-weight: 800; font-size: 13px; color: var(--dim2); }
.cIcon.duo .cIcon2 { display: flex; color: #ff8a5c; }
#shopList .card.owned { border-color: #2e6b47; }   /* только в магазине: в гараже «owned» — обычная карточка */
.card.shopCard { border-color: var(--warn); }
.card.shopCard .cIcon { color: var(--warn); }
.yanPrice { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: 14px; color: var(--warn); font-variant-numeric: tabular-nums; white-space: nowrap; }
.yanPrice img { width: 16px; height: 16px; display: block; }
/* тестовая оплата вне площадки (выше затемнения и роликов-заглушек) */
#payMock { position: fixed; inset: 0; z-index: 41; background: #000e; display: flex; align-items: center; justify-content: center; }
.pmBtns { display: flex; gap: 10px; justify-content: center; }
#garage { position: absolute; inset: 0; z-index: 12; pointer-events: none; }
/* категории — сверху по центру */
#gTop {
  position: absolute; top: 12px; left: 0; right: 0; margin: 0 auto; width: fit-content;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: center;
  max-width: calc(calc(100 * var(--vw)) - 320px); padding: 8px 12px 8px 16px; pointer-events: auto;
  background: #12161df0; border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 12px 40px #000a; backdrop-filter: blur(8px);
}
#gTop .gTitle h2 { margin: 0; font-size: 18px; line-height: 1.1; }
#gTop .gTitle .cap { margin-top: 2px; white-space: nowrap; }
/* детали категории — слева. Верх — на 20 px ниже полосы вкладок: --gtop-b (нижний край #gTop) ставит
   garage.js по ResizeObserver — на узком окне вкладки переносятся во вторую строку */
#garagePanel {
  position: absolute; left: 16px; top: calc(var(--gtop-b, 64px) + 20px); width: min(430px, calc(40 * var(--vw)));
  max-height: calc(calc(100 * var(--vh)) - var(--gtop-b, 64px) - 20px - var(--gbot-res, 16px)); max-height: calc(calc(100 * var(--dvh)) - var(--gtop-b, 64px) - 20px - var(--gbot-res, 16px));   /* --gbot-res — место под «В главное меню» (garage.js); --adBanH — полоса баннера (main.js syncBanner) */
  display: flex; flex-direction: column; gap: 12px; overflow-y: auto; pointer-events: auto;
  padding: 18px 20px; background: #12161df0; border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 20px 70px #000c; backdrop-filter: blur(8px);
}
/* переход к заказам — отдельная заметная кнопка справа внизу */
#toMapBtn {
  position: absolute; right: 20px; bottom: 20px; pointer-events: auto;
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  padding: 14px 26px 12px 22px; border-radius: 16px; cursor: pointer;
  color: #06131c; border: 1px solid #9fe4ff;
  background: linear-gradient(180deg, #8ae0ff, #2fa9e4);
  box-shadow: 0 0 0 4px #4cc2ff22, 0 14px 44px #4cc2ff66;
  transition: transform .12s, filter .12s, box-shadow .12s;
}
#toMapBtn .big { font-size: 22px; font-weight: 800; letter-spacing: .01em; line-height: 1; }
#toMapBtn .hint { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #06131c99; }
#toMapBtn:hover { filter: brightness(1.07); transform: translateY(-2px); box-shadow: 0 0 0 4px #4cc2ff33, 0 18px 50px #4cc2ff88; }
#toMapBtn:active { transform: translateY(0); }
/* в главное меню — та же форма слева внизу, спокойная палитра */
.cornerBtn {
  position: absolute; left: 20px; bottom: 20px; pointer-events: auto;
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  padding: 14px 24px 12px 20px; border-radius: 16px; cursor: pointer;
  color: var(--text); border: 1px solid #3a4756;
  background: linear-gradient(180deg, #232c38, #151a22);
  box-shadow: 0 14px 40px #0009;
  transition: transform .12s, filter .12s, border-color .12s;
}
.cornerBtn .big { font-size: 18px; font-weight: 800; letter-spacing: .01em; line-height: 1; }
.cornerBtn .hint { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--dim2); }
.cornerBtn:hover { transform: translateY(-2px); border-color: var(--dim2); filter: brightness(1.12); }
.cornerBtn:active { transform: translateY(0); }

.gTabs { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.gTab {
  display: flex; align-items: center; gap: 6px; padding: 8px 12px; font-size: 14.5px; cursor: pointer;
  background: var(--panel2); color: var(--dim2); border: 1px solid var(--line); border-radius: 9px;
}
.gTab svg { width: 16px; height: 16px; }
.gTab.on { color: var(--text); border-color: var(--accent); background: #14405c; }
.gTab:hover { border-color: var(--accent); }
#gCards { display: flex; flex-direction: column; gap: 6px; }
.card {
  display: flex; gap: 10px; align-items: center; padding: 7px 10px 7px 8px;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 10px;
}
.card.next { border-color: #2c5a7a; }
.card.locked { opacity: 0.8; }
.card.sum { border-color: var(--ok); }
.cIcon { flex: none; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; color: var(--accent); }
.cIcon svg { width: 24px; height: 24px; }
.card.locked .cIcon { color: var(--dim2); }
.cBody { flex: 1; min-width: 0; }
.cTitle { font-weight: 700; font-size: 14.5px; line-height: 1.2; }
.cTitle .pct { font-weight: 500; color: var(--dim2); font-size: 12.5px; margin-left: 4px; }
.cDesc { font-size: 12.5px; color: var(--dim2); line-height: 1.3; margin-top: 1px; }
.cSpecs { font-size: 12px; color: var(--accent); margin-top: 2px; }
.cLevel { display: flex; gap: 4px; margin-top: 4px; }
.cLevel i { width: 14px; height: 4px; border-radius: 2px; background: var(--line); }
.cLevel i.on { background: var(--ok); }
.cLevel i.cur { outline: 1px solid var(--text); }
.cSide { flex: none; display: flex; flex-direction: row; align-items: center; justify-content: flex-end; gap: 10px; min-width: 96px; }
.cPrice { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--warn); font-size: 14.5px; }
.cState { display: flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--ok); }
.cState.dim { color: var(--dim2); }
.cState.wait { color: var(--dim2); font-variant-numeric: tabular-nums; white-space: nowrap; }   /* награда за рекламу: пауза до следующего просмотра */
.cState svg { width: 14px; height: 14px; }
.cBuy {
  padding: 6px 10px; font-size: 13.5px; font-weight: 700; cursor: pointer; border-radius: 8px;
  background: #14405c; color: #cdefff; border: 1px solid var(--accent); white-space: nowrap;
}
.cBuy:hover { background: #175074; }
.cBuy[disabled] { opacity: 0.45; cursor: not-allowed; border-color: var(--line); }
.cBuy.bad { background: #5a1c1c; border-color: var(--bad); color: #ffd6d6; }
.hpBar { height: 5px; background: var(--line); border-radius: 3px; margin-top: 5px; overflow: hidden; }
.hpBar i { display: block; height: 100%; background: var(--ok); }
.hpBar i.warn { background: var(--warn); }
.hpBar i.bad { background: var(--bad); }
/* сводка характеристик — отдельная панель справа под деньгами; по вертикали — как панель деталей
   слева, на 20 px ниже полосы вкладок (было top: 54px — под деньгами, и правый край вкладок на неё налезал) */
/* 10.11.2026: четыре главных параметра 2×2, плашка по содержимому (было 8 строк на 320 px) */
#gStats {
  position: absolute; right: 14px; top: calc(var(--gtop-b, 64px) + 20px); width: max-content; pointer-events: auto;
  display: grid; grid-template-columns: auto auto; gap: 2px 16px; padding: 7px 12px;
  background: #12161de6; border: 1px solid var(--line); border-radius: 10px; backdrop-filter: blur(6px);
}
#garage.shopOn #gStats { top: max(calc(var(--gtop-b, 64px) + 20px), 104px); }   /* сводка — под кнопкой магазина (54 + 36 + 14) */
#gStats .kv span, #gStats .kv b { white-space: nowrap; }
#gStats .kv { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; line-height: 1.35; color: var(--dim2); }
#gStats .kv b { color: var(--text); font-variant-numeric: tabular-nums; }
#gStats .kv b.warn { color: var(--warn); }
#gStats .kv b.bad { color: var(--bad); }

#driveBadges { display: flex; gap: 6px; margin-top: 0; flex-wrap: wrap; max-width: 260px; }
/* оффер лебёдки: значок у заголовка, «не хватает» жёлтым, кнопка ролика — фиолетовая как в каталоге */
.wdHead { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.wdHead h3 { margin: 0; }
.wdIcon svg { width: 30px; height: 30px; color: var(--accent); display: block; }
#wdNeed { margin-top: 6px; font-size: 13.5px; color: var(--warn); }
#wdNeed:empty { display: none; }
.dlgFoot button.ad { background: #3a2a63; border-color: #8f6cf0; color: #efe8ff; }
/* награда за возвращение: лесенка дней серии (сегодняшний подсвечен), сумма дня крупно, ниже — что будет завтра */
#dailyDlg { width: min(calc(94 * var(--vw)), 470px); text-align: center; }
#dailyDlg .wdHead { justify-content: center; text-align: left; margin-bottom: 14px; }
#dailyDlg .wdHead h3 { margin: 0 0 2px; }
#dailyDlg .cap { font-size: 13.5px; }
.ddIcon svg { color: var(--warn); }
#ddLadder { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.ddDay { padding: 7px 2px 6px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel2); color: var(--dim2); font-size: 12.5px; line-height: 1.25; }
.ddDay b { display: block; margin-top: 2px; font-size: 13.5px; color: var(--text); white-space: nowrap; }
.ddDay.done { opacity: .72; }
.ddDay .ddPlus { display: flex; align-items: center; justify-content: center; gap: 3px; min-height: 22px; margin-top: 4px; padding-top: 3px; border-top: 1px dashed var(--line); font-size: 14px; font-weight: 800; color: var(--accent); }
.ddDay .ddPlus svg { width: 19px; height: 19px; }
.ddDay .ddPlus:empty { border-top-color: transparent; }
.ddDay.done .ddPlus { color: var(--ok); }
.ddDay.now { border-color: var(--warn); background: #3a2c10; color: var(--warn); box-shadow: 0 0 18px #e9b63633; }
.ddDay.now b { color: var(--warn); }
#ddSum { margin: 14px 0 2px; font-size: 34px; line-height: 1.1; font-weight: 800; color: var(--warn); }
#ddNext b { color: var(--text); }
/* доход «пока вас не было» — строкой под подарком: зелёная иконка денег, сумма золотом */
#ddAway { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 8px 0 0; font-size: 14.5px; color: var(--dim2); }
#ddAway svg { width: 17px; height: 17px; flex: none; color: var(--ok); }
#ddAway b { color: var(--warn); }
#ddNext { margin-top: 8px; }
/* окно «пока вас не было» без награды дня (×2 за ролик): без лесенки и анонса завтрашнего */
#dailyDlg.awayOnly #ddLadder, #dailyDlg.awayOnly #ddNext { display: none; }
#bonusDlg { width: min(calc(92 * var(--vw)), 420px); }
/* подарок-апгрейд: «+ иконка название» — в окне под суммой (крупнее, с подписью) и в строках-анонсах */
.dGift { display: inline-flex; align-items: center; gap: 5px; margin-left: 5px; white-space: nowrap; }
.dGift svg { width: 14px; height: 14px; flex: none; color: var(--accent); }
.dailyLine .dGift b, #ddNext .dGift b { color: var(--accent); }
#ddGift { display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 4px 0 2px; }
#ddGift .dGift { margin: 0; font-size: 16px; color: var(--accent); }
#ddGift .dGift svg { width: 20px; height: 20px; }
#ddGift .dGift b { color: var(--accent); }
/* магнит для монет — третья часть награды: свой цвет (красная подкова), в клетке лесенки — рядом с иконкой подарка */
.dGift.dMagnet svg, .dGift.dMagnet b, .dailyLine .dGift.dMagnet b, #ddNext .dGift.dMagnet b, #ddGift .dGift.dMagnet, #ddGift .dGift.dMagnet b, .ddDay .ddMag svg { color: #ff7a66; }
.ddDay .ddMag { display: inline-flex; }
.ddDay .ddMag svg { width: 17px; height: 17px; }
.dailyLine { flex-wrap: wrap; row-gap: 0; }
#dailyDlg .dlgFoot { justify-content: center; margin-top: 14px; }
#dailyDlg .dlgFoot button { min-width: 180px; }
@media (max-width: 480px) { #ddLadder { grid-template-columns: repeat(3, 1fr); } }
/* строка-анонс «загляните завтра: +N» — меню, шапка карты, карточки финиша и срыва */
.dailyLine { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 13.5px; line-height: 1.3; color: var(--dim2); }
.dailyLine svg { width: 14px; height: 14px; flex: none; color: var(--warn); }
.dailyLine b { color: var(--warn); }
#menuDaily { margin: -8px 0 16px; }
#mapDaily { margin-top: 4px; }
#bdDaily { justify-content: flex-start; margin: 2px 100px 0 0; }   /* справа сверху — плашка денег */
/* ближайшая цель под выплатой: доставки до новой земли или касса моста */
#finishGoal { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0 0 6px; font-size: 13.5px; line-height: 1.3; color: var(--text); }
#finishGoal svg { width: 15px; height: 15px; flex: none; color: var(--accent); }
#finishGoal b { color: var(--warn); }
#failDaily { margin: 0 0 4px; }
/* самый низкий кадр (Poki 640×360): меню и шапка карты и без анонса в рост кадра — он остаётся на карточке срыва */
@media (max-height: 420px) {
  #menuDaily, body:not(.touch) #mapDaily { display: none; }
  /* окно награды с подарком и магнитом — без прокрутки в кадре 640×360 */
  #dailyDlg .wdHead { margin-bottom: 6px; }
  #ddSum { margin-top: 6px; font-size: 28px; }
  #dailyDlg .dlgFoot { margin-top: 8px; }
}
/* кнопки столбиком: реклама (главная), купить, позже — в строку они разъезжались (тестер) */
#winchDlg { width: min(calc(92 * var(--vw)), 440px); }
#winchDlg .dlgFoot { flex-direction: column; align-items: stretch; gap: 8px; }
#winchDlg .dlgFoot button { width: 100%; }
#wdAd { order: 1; } #wdBuy { order: 2; } #wdLater { order: 3; }
#wdBuy[disabled] { opacity: 0.45; cursor: not-allowed; }
/* груз: две строки без цифр — стяжки (сегмент на место, ширина = hp стяжки) и сам груз (hp места);
   значок слева, лопнувшая стяжка / разбитое место — пустой красный сегмент; виден и на телефоне */
#cargoBar { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; padding: 4px 7px; border-radius: 6px; border: 1px solid var(--line); background: #0b0e1380; width: max-content; max-width: min(calc(72 * var(--vw)), 420px); }
#cargoBar .cbRow { display: flex; align-items: center; gap: 6px; }
#cargoBar .cbRow svg { width: 16px; height: 16px; color: var(--dim2); flex: none; }
#cargoBar .cbRow.deny svg { color: var(--bad); }
#cargoBar .cbRow.warn svg { color: var(--warn); }
#cargoBar .cbSeg { display: flex; gap: 2px; }
/* сегмент — по ширине экрана: телефон 44 px, ландшафт ~65, десктоп 80 (было 26 везде — не разглядеть) */
#cargoBar .cbSeg i { display: block; width: clamp(44px, calc(8 * var(--vw)), 80px); height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; position: relative; }
#cargoBar .cbSeg i::before { content: ''; position: absolute; inset: 0; width: var(--hp, 100%); background: var(--ok); }
#cargoBar .cbSeg i.warn::before { background: var(--warn); }
#cargoBar .cbSeg i.bad::before { background: var(--bad); }
#cargoBar .cbSeg i.gone { background: #3a1a1a; box-shadow: inset 0 0 0 1px var(--bad); }
#cargoBar .cbSeg i.gone::before { width: 0; }
#cargoBar .cbFlash { font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--bad); white-space: nowrap; }
#cargoBar .cbFlash:empty { display: none; }
/* груз закреплён фирмой: замочек и подпись вместо сегментов */
#cargoBar .cbRow.pinned svg { color: #8fe0a8; }
#cargoBar .cbLock { font-size: 12px; font-weight: 700; letter-spacing: .04em; color: #8fe0a8; white-space: nowrap; }
body.touch #cargoBar { align-self: flex-end; }
/* телефон: полоски строп и груза вдвое уже (просьба пользователя 02.10.2026: «не занимать столько места, компактнее раза в 2
   по горизонтали») — сегмент 4 % ширины вместо 8 %, 22…40 px вместо 44…80 */
body.touch #cargoBar .cbSeg i { width: clamp(22px, calc(4 * var(--vw)), 40px); }
#driveBadges .badge { white-space: nowrap; }
#driveBadges .badge { font-size: 12px; padding: 2px 7px; border-radius: 6px; border: 1px solid var(--line); color: var(--dim2); background: #0b0e13d6; }
#driveBadges .badge.on { color: #e6f6ff; background: #14405c; border-color: var(--accent); }
#driveBadges .badge.deny { border-color: var(--bad); color: var(--bad); }
#driveBadges .badge.warn { border-color: #7a5a1e; color: var(--warn); }
#fpsBox { font: 11px ui-monospace, Menlo, monospace; color: var(--ok); background: #0b0e13aa; border-radius: 6px; padding: 3px 8px; }

/* ── карта заказов ── */
#mapUi { position: absolute; inset: 0; pointer-events: none; }
/* телефон (body.touch): 3D-карту — метки, выноски, подписи земель, строку дня — заменяет доска
   заказов; десктоп — наоборот. Кнопка «В гараж» общая, на доске поверх неё */
body.touch #zoneLabels, body.touch #farmTags, body.touch #callouts, body.touch #mapTop { display: none !important; }
body:not(.touch) #mapBoard { display: none !important; }
body.touch #mapBack { z-index: 11; }
body.touch #mapShop { top: auto; bottom: 20px; right: 20px; min-height: 60px; padding: 0 20px 0 16px; border-radius: 16px; font-size: 17px; font-weight: 800; }   /* ростом с «В гараж» */
body.touch #mapShop svg { width: 22px; height: 22px; }
/* ── доска заказов: непрозрачный DOM поверх холста (холст под ней не рисуется), шапка вне прокрутки ── */
#mapBoard {
  position: absolute; inset: 0; z-index: 10; display: flex; flex-direction: column; pointer-events: auto;   /* ниже #moneyHud (13) и оверлеев */
  background: linear-gradient(180deg, #0b0e13, #12161d 40%, #0f131a);
}
#mapHead {
  flex: none; display: grid; grid-template-columns: minmax(0, 960px); justify-content: center; row-gap: 4px;
  padding: max(10px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 10px max(14px, env(safe-area-inset-left));
  background: #12161df0; border-bottom: 1px solid var(--line); box-shadow: 0 8px 30px #0008;
}
#bdDay { font-weight: 700; font-size: 14px; line-height: 1.3; padding-right: 100px; }   /* справа сверху — плашка денег */
#mapHead .fund { margin: 2px 100px 0 0; }
/* прокручиваемая часть: колонка секций до 960 px по центру; снизу запас под угловую кнопку «В гараж» */
#board {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y;
  display: grid; grid-template-columns: minmax(0, 960px); justify-content: center; align-content: start; gap: 12px;
  padding: 12px max(14px, env(safe-area-inset-right)) calc(92px + env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
}
/* секция земли: открытая — заголовок с линией и сетка карточек; следующая — полоска прогресса и
   описание; дальняя — свёрнутый <details> с замком, раскрывается описанием и условием */
.zoneSec { min-width: 0; }
.zsHead { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 6px 0; }
.zsHead i { display: inline-flex; width: 14px; height: 14px; color: var(--warn); }
.zsHead i svg { width: 100%; height: 100%; }
.zsHead b { font-size: 14.5px; letter-spacing: .04em; text-transform: uppercase; }
.zsState { font-size: 13.5px; color: var(--dim2); }
.zoneSec.open .zsHead { border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.zoneSec.open .zsHead i { display: none; }
.zoneSec.open .zsState { margin-left: auto; }
.zoneSec.next, .zoneSec.locked { padding: 8px 12px 10px; border: 1px dashed #8a7a4f; border-radius: 12px; background: #0b0e13b0; color: var(--warn); }
.zoneSec.next .zsHead, .zoneSec.locked .zsHead { padding: 2px 0; }
.zsDesc { margin: 6px 0 0; font-size: 13.5px; line-height: 1.4; color: var(--dim2); }
.zsEmpty { margin: 0; padding: 4px 0 8px; font-size: 13.5px; color: var(--dim2); }
.zoneSec .zProg { height: 4px; margin-top: 6px; background: var(--line); border-radius: 2px; overflow: hidden; }
.zoneSec .zProg i { display: block; height: 100%; background: var(--warn); }
summary.zsHead { cursor: pointer; list-style: none; min-height: 44px; }        /* цель тапа ≥ 44 px */
summary.zsHead::-webkit-details-marker { display: none; }
summary.zsHead::after { content: '›'; margin-left: auto; font-size: 18px; color: var(--dim2); transform: rotate(90deg); transition: transform .15s; }
details[open] > summary.zsHead::after { transform: rotate(-90deg); }
/* карточки: одна сетка на все экраны — 1 колонка в портрете, 2 в ландшафте телефона, 3 на широком */
.zsCards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.oCard {
  appearance: none; -webkit-appearance: none; display: block; width: 100%; min-height: 44px; text-align: left;
  font: inherit; color: var(--text); cursor: pointer; padding: 10px 12px; border-radius: 12px;
  background: #12161df0; border: 1px solid #3a4655; box-shadow: 0 8px 16px #0006;
  transition: border-color .15s, box-shadow .15s, transform .08s;
}
.oCard:hover, .oCard:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 2px #4cc2ff33, 0 8px 16px #0006; outline: none; }
.oCard:active { transform: scale(.99); }
.oCard .oHead { gap: 9px; }
.oCard .oIcon { width: 26px; height: 26px; }
.oCard .oTitle { font-size: 14.5px; }
.oCard .oTo { font-size: 12.5px; margin-top: 2px; }
.oCard .oTo svg { width: 11px; height: 11px; vertical-align: -1px; }
.oCard .oReward { font-size: 14px; }
.oCard .oTags { margin-top: 6px; }
.oCard .oTag { font-size: 12px; padding: 2px 6px; }
.oCard .oTag svg { width: 13px; height: 13px; }
.oCard .oDesc { margin: 6px 0 0; font-size: 13.5px; }
.oCard.final { border-color: #e9b636; background: #1c1811f4; }   /* золотая карточка финального заказа */
.oCard.final .oIcon { color: #e9b636; }
/* карточка заказа на низком экране: тело прокручивается, подвал с «Поехали!» на месте */
#orderDlg[open] { display: flex; flex-direction: column; }
#odBody { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin-right: -14px; padding-right: 8px; }   /* полоса прокрутки — в правом поле диалога, а не вплотную к тексту */
#orderDlg .dlgFoot { flex: none; }
@media (max-height: 520px) {
  /* ландшафт телефона: шапка в одну строку, компактная угловая кнопка */
  #mapHead { grid-template-columns: minmax(0, 1fr) minmax(200px, 300px); column-gap: 16px; align-items: center; padding-top: max(6px, env(safe-area-inset-top)); padding-bottom: 6px; padding-right: calc(110px + env(safe-area-inset-right)); }   /* справа — плашка денег */
  #bdDay { font-size: 13.5px; padding-right: 0; }
  #mapHead .fund { margin: 0; }
  #board { gap: 8px; padding-top: 8px; padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .zsCards { gap: 8px; }
  body.touch #mapBack { left: max(10px, env(safe-area-inset-left)); bottom: max(10px, env(safe-area-inset-bottom)); padding: 8px 14px; }
  body.touch #mapBack .big { font-size: 14px; }
  body.touch #mapBack .hint { display: none; }
  body.touch #mapShop { bottom: max(10px, env(safe-area-inset-bottom)); right: max(10px, env(safe-area-inset-right)); min-height: 0; padding: 8px 14px; border-radius: 12px; font-size: 14px; line-height: 1; }   /* ростом с компактную «В гараж» */
  body.touch #mapShop svg { width: 16px; height: 16px; }
}
#farmTags { position: absolute; inset: 0; overflow: hidden; }
/* подписи ферм — светлый текст без плашки, с тёмной тенью (решение владельца 09.11.2026, вариант «C»: тёмные плашки подписей
   сливались с тёмными плашками заказов); ферма с заказом — голубая, выбранная — подсветка плашкой, как раньше */
.farmTag {
  position: absolute; transform: translate(-50%, -100%); display: flex; align-items: center; gap: 6px;
  padding: 5px 11px; font-size: 13.5px; font-weight: 800; white-space: nowrap; color: #fff;
  background: none; border: 1px solid transparent; border-radius: 999px;
  text-shadow: 0 0 2px #000, 0 0 4px #000, 0 1px 3px #000e;
  transition: transform .15s, background .15s;
}
.farmTag i { display: inline-flex; width: 14px; height: 14px; color: #fff; filter: drop-shadow(0 0 2px #000) drop-shadow(0 1px 2px #000); }
.farmTag i svg { width: 100%; height: 100%; }
.farmTag.busy { color: #bfe9ff; }
.farmTag.busy i { color: var(--accent); }
.farmTag.sel { transform: translate(-50%, -100%) scale(1.12); background: var(--accent); color: #0b0e13; text-shadow: none; }
.farmTag.sel i { color: #0b0e13; filter: none; }
.farmTag.locked { opacity: 0.78; }
/* подпись фермы без заказа или земли, на которую легла плашка заказа (map.js placeCallouts), — не торчит из-под неё */
.farmTag.underCallout, .zoneLabel.underCallout { opacity: 0 !important; pointer-events: none; }   /* сильнее .locked и прочих состояний */
/* шапка карты — узкие плашки, а не одна широкая посередине (просмотр владельца 09.11.2026: широкая закрывала заказы у верха
   кадра — CrazyGames, отказ 09.11.2026): слева сверху — день с прогрессом земли и фонд ремонта моста, по центру — вкладки
   земель одной строкой; справа — деньги и магазин. Анонса награды на завтра на карте нет (там же). #mapTop — слой без
   размеров и фона, масштабируются сами плашки (zoom) */
#mapTop { position: absolute; top: 12px; left: 0; right: 0; display: flex; align-items: flex-start; gap: 10px; padding: 0 16px; pointer-events: none; }
/* справа — место под плашку денег и магазин (их ширина ~150 px × масштаб): вкладки встают между левыми плашками и ним */
#mapTop::after { content: ''; flex: none; width: calc(160px * var(--ui, 1)); }
/* слева сверху — текст без плашек, светлый с тенью, как подписи ферм (просмотр владельца 09.11.2026), и полоса фонда моста —
   с дорожкой на всю ширину и процентом (без дорожки 1 % был просто точкой) */
#mapStatus { flex: none; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; max-width: 260px; padding-top: 4px; pointer-events: auto;
  color: #fff; text-shadow: 0 0 2px #000, 0 0 4px #000, 0 1px 3px #000e; }
.mapPlate { padding: 6px 12px; background: #0b0e13cc; border: 1px solid var(--line); border-radius: 10px; backdrop-filter: blur(6px); pointer-events: auto; }
#dayLabel { font-weight: 800; font-size: 14px; line-height: 1.35; text-wrap: balance; }   /* не влезла — две ровные строки, а не «… · 1 / total» */
/* порядок — вариант «D» (выбор владельца 09.11.2026): строка дня, под ней полоса фонда с процентом, под полосой — сумма фонда */
#dayLabel { order: 0; }
#mapFundRow { order: 1; display: flex; align-items: center; gap: 8px; width: 240px; }
#mapFundRow[hidden] { display: none; }
#mapStatus .fund { order: 2; margin-top: 0; min-width: 0; padding-bottom: 0; font-size: 12.5px; color: #e8edf2; font-weight: 600; }
.fundTrack { position: relative; flex: 1; height: 8px; border-radius: 4px; background: #ffffff38; box-shadow: 0 0 0 1px #0008, 0 1px 3px #0009; overflow: hidden; }
.fundTrack i { position: absolute; left: 0; top: 0; bottom: 0; min-width: 4px; border-radius: 4px; background: linear-gradient(90deg, #e9a92c, #ffd34d); }
.fundPct { font-size: 12.5px; font-weight: 800; color: #fff; }
#mapTop #mapDaily { display: none !important; }
/* вкладки земель: перелёт камеры; закрытые — с замком; .new — земля, открывшаяся на прошлом рейсе */
#zoneNav { flex: 0 1 auto; margin: 0 auto; flex-wrap: wrap; justify-content: center; gap: 4px; padding: 4px; }   /* тесно — переносится строкой ниже, на левые плашки не заходит */
/* место есть (вкладки ~470 + левые плашки до 260 с каждой стороны) — ровно по центру ширины экрана (просмотр владельца
   09.11.2026); --ui растёт только вместе с окном, так что по ширине окна в CSS px порог верен и в полном экране */
@media (min-width: 1050px) {
  #zoneNav { position: absolute; top: 0; left: 50%; transform: translateX(-50%); margin: 0; flex-wrap: nowrap; }
}
@media (min-width: 1250px) { #mapStatus { max-width: 340px; } }   /* строка дня — одной строкой: до вкладок по центру места хватает */
#zoneNav button { white-space: nowrap; }
#zoneNav button { min-height: 30px; padding: 4px 10px; font-size: 13.5px; display: inline-flex; align-items: center; gap: 5px; }
#zoneNav button svg { width: 12px; height: 12px; }
#zoneNav button[disabled] { opacity: .72; cursor: default; }
#zoneNav button[disabled]:hover { border-color: var(--line); }
#zoneNav button.new { border-color: var(--warn); color: var(--warn); animation: tpPulse .9s ease-in-out infinite alternate; }
/* выноски заказов: пузыри вокруг метки фермы (JS раскладывает по углам), хвост —
   треугольник в SVG-слое под пузырями, как в комиксах; наведение — подсветка,
   клик — окно подтверждения с подробностями */
#mapTop { z-index: 9; }   /* плашки дня, фонда и вкладки земель — над выносками заказов: на узком кадре (Poki 640×360…836×470) выноска закрывала текст и вкладки */
#callouts { position: absolute; inset: 0; overflow: hidden; z-index: 8; transition: opacity .2s; }
/* камера сама летит (map.js settling) — плашек заказов не видно: появляются (плавно) уже на месте, а исчезают сразу */
#callouts.settling { opacity: 0; transition: none; pointer-events: none; }
body.keepCallout #callouts { z-index: 10; }   /* обучение, шаг «возьми этот заказ»: плашка учебного заказа поверх шапки карты (map.js keepOrder) */   /* свой стековый контекст: inline z-index плашек (map.js updateTags, до ~800) иначе выходил выше #fade (30) — при затемнении карты плашки не гасли */
/* плашка с хвостиком — один SVG-контур под содержимым (.cbg), хвост растёт из края,
   обращённого к ферме; положение относительно метки фиксируется при создании */
.callout {
  position: absolute; transform: translate(-50%, -50%); width: 200px; padding: 8px 10px; pointer-events: auto; cursor: pointer;
  background: none; border: none; filter: drop-shadow(0 8px 16px #000a);
}
.callout .cbg { position: absolute; pointer-events: none; z-index: 0; overflow: visible; }
.callout .cbg path { fill: #12161df0; stroke: #8a97a8; stroke-width: 1.2; stroke-linejoin: round; transition: stroke .15s, fill .15s; }
.callout .cbody { position: relative; z-index: 1; }
.callout:hover .cbg path { stroke: var(--accent); fill: #161c26f8; }
.callout:hover { z-index: 3; filter: drop-shadow(0 0 6px #4cc2ff66) drop-shadow(0 8px 16px #000a); }
.callout .oHead { gap: 9px; }
.callout .oIcon { width: 26px; height: 26px; }
.callout .oTitle { font-size: 14.5px; }
.callout .oTags { margin-top: 5px; }
.callout .oTag { font-size: 12px; padding: 2px 6px; }
.callout .oTag svg { width: 13px; height: 13px; }
.callout .oTo { font-size: 12.5px; margin-top: 2px; }
.oHead { display: flex; align-items: center; gap: 12px; }
.oIcon { width: 34px; height: 34px; flex: none; color: var(--accent); }
.oIcon svg { width: 100%; height: 100%; }
.oMain { min-width: 0; }
.oTitle { font-weight: 700; font-size: 14px; }
.oTo { font-size: 13.5px; color: var(--dim2); display: flex; align-items: center; gap: 4px; }
.oTo svg { width: 12px; height: 12px; flex: none; }
.oReward { margin-left: auto; font-weight: 800; font-size: 15px; color: var(--accent); white-space: nowrap; }
.oTags { display: flex; flex-wrap: wrap; gap: 5px; }
.oTag {
  position: relative; display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; padding: 3px 7px;
  border-radius: 20px; border: 1px solid var(--line); color: var(--dim2); background: #0b0e1380; cursor: default;
}
.oTag svg { width: 15px; height: 15px; }
.oTag.trk { color: #d6dde6; }
.oTag.stars { color: var(--warn); letter-spacing: 1px; padding: 2px 8px; }
.oTag.night { color: #b9c6ff; border-color: #3b4a8a; }
.oTag.rain { color: #8fd0ff; border-color: #2f6a8a; }
.oTag.zone { color: var(--warn); border-color: #6a5a2f; }
.oTag.pinned { color: #8fe0a8; border-color: #2f7a4a; }   /* груз закреплён фирмой (Опушка); красный .blk с замком — «без шноркеля» */
.oTag:hover { border-color: var(--accent); color: var(--text); }
/* подпись тега — при наведении */
.oTag[data-tip]::after {
  content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%);
  padding: 4px 9px; white-space: nowrap; font-size: 12.5px; letter-spacing: 0; color: var(--text);
  background: #0b0e13f2; border: 1px solid var(--line); border-radius: 7px; box-shadow: 0 6px 20px #000a;
  opacity: 0; pointer-events: none; transition: opacity .12s; z-index: 5;
}
.oTag[data-tip]:hover::after { opacity: 1; }
.oPay { color: var(--text); }
/* карточка заказа: условия крупно с подписями, «что поможет» */
.oTags.big { gap: 6px; margin-top: 10px; }
.oTags.big .oTag { font-size: 14.5px; padding: 5px 11px; gap: 6px; color: var(--text); }
.oTags.big .oTag svg { width: 18px; height: 18px; }
.oTags.big .oTag.stars { font-size: 15px; }
.oHelp { margin-top: 14px; }
.oHelpT { font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--dim2); margin-bottom: 4px; }
.oHelpRow { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); }
.oHelpRow .oIcon { width: 24px; height: 24px; flex: none; color: var(--accent); }
.oHelpRow .oIcon svg { width: 24px; height: 24px; }
.oHelpRow .oMain { min-width: 0; }
.oHelpRow .oAct { margin-left: auto; flex: none; display: flex; align-items: center; gap: 6px; }
.oHelpRow .cState { font-size: 13.5px; }
.oNotes { display: flex; flex-direction: column; gap: 4px; }
.oNote { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--dim2); }
.oNote svg { width: 13px; height: 13px; flex: none; }
.oNote.urgent { color: var(--warn); }
.oNote.fragile { color: var(--bad); }
.oNote.pinned { color: #8fe0a8; }
.oTake {
  align-self: flex-end; padding: 7px 14px; border-radius: 8px; border: none;
  background: var(--accent); color: #0b0e13; font-weight: 700; cursor: pointer;
}
.oTake:hover { filter: brightness(1.1); }
.oDesc { margin: 8px 0 0; font-size: 14.5px; color: var(--dim2); line-height: 1.45; }
dialog h3 { margin: 0 0 8px; font-size: 18px; }
dialog p { margin: 0; line-height: 1.5; }
.dlgFoot { display: flex; align-items: center; gap: 10px; justify-content: flex-end; margin-top: 18px; }   /* без center «Готово» растягивается по соседней ghost-кнопке и меняет высоту, когда та скрыта */
/* Подвалы диалогов и кнопки сюжета: обе кнопки одной высоты (44 px) и на одной линии. Общий
   класс .ghost несёт margin-top, width: 100 % и font-size 12px для вертикального стека главного
   меню — в ряду они давали кнопку ниже соседней, шире и на другой высоте (особенно на iOS, где
   у кнопок ещё и свой системный размер шрифта); здесь всё перебивается явно. */
.dlgFoot button, .sButtons button {
  margin: 0; width: auto; min-height: 44px; padding: 0 18px; font-size: 14px; line-height: 1.2; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9px; border: 1px solid transparent; background: var(--accent); color: #0b0e13; cursor: pointer;
}
.dlgFoot button.ghost, .sButtons button.ghost { background: transparent; border-color: var(--line); color: var(--dim2); }
.dlgFoot button.ghost:hover, .sButtons button.ghost:hover { color: var(--text); border-color: var(--dim2); }
/* диалог «Графика»: строка = подпись + сегментные кнопки; «Авто» показывает текущее значение лестницы */
/* два раздела: слева список, справа содержимое. Ширина поднята с 640 — сайдбар
   съедает 148 px, иначе сегментные кнопки стали бы теснее прежнего */
/* Высота постоянна и не зависит от раздела: dialog[open] центрируется margin:auto,
   и от скачка (Графика ≈540 px содержимого против Звука ≈200) кнопки разделов
   уезжали из-под курсора. 690 = 126 хрома (поля 44 + рамка 2 + шапка 52 + поля тела
   28) + самый высокий раздел. Потолок по вьюпорту не дублируем: max-height из
   dialog{} всегда бьёт height, так что фактически это min(690px, 86dvh) — и в
   @media (max-height: 520px) само становится min(690px, 96dvh). */
#setDlg { width: min(94vw, 800px); max-width: 800px; height: 690px; }
/* «Сбросить на авто» скрывается вне «Графики», и без min-height подвал становился
   ниже, а «Готово» уезжало на несколько пикселей — та же болезнь, что и у окна */
#setDlg .dlgFoot { min-height: 40px; }
/* grid-template-rows: 1fr вместо align-items: start — колонки тянутся на всю высоту
   тела, иначе #setPane обжался бы по содержимому и под ним осталась бы пустота */
#setDlg .dlgBody { display: grid; grid-template-columns: 132px 1fr; grid-template-rows: 1fr; column-gap: 16px; }
/* position: sticky убран: тело больше не прокручивается, меню физически не уедет */
#setNav { display: flex; flex-direction: column; gap: 4px; border-right: 1px solid var(--line); padding: 8px 12px 8px 0; }
#setNav button { width: 100%; text-align: left; min-height: 40px; padding: 9px 12px; font-size: 14.5px; cursor: pointer;
  background: transparent; color: var(--dim2); border: 1px solid transparent; border-radius: 9px; }
#setNav button:hover { color: var(--text); }
#setNav button.on { color: var(--text); background: var(--panel2); border-color: var(--accent); }
/* Колонка раздела — рамка постоянной высоты, строки в ней единственные растяжимые:
   в «Звуке» пустота собирается ВНИЗУ, перед подвалом, в «Графике» там же живёт
   прокрутка. Прокрутку перенесли сюда с .dlgBody намеренно: подвал («Сбросить»,
   «Готово») остаётся вне прокручиваемой области и держится сам, без sticky.
   flex: none у #setInfo и .dlgFoot обязателен — при нехватке места флекс сжимает
   ВСЕ элементы пропорционально, и строка про железо с кнопками поехали бы тоже. */
#setPane { min-width: 0; display: flex; flex-direction: column; min-height: 0; }   /* min-width — без него длинная .seg распирает колонку */
#setPane > #setInfo, #setPane > .dlgFoot { flex: none; }
#setRows {
  flex: 1 1 auto; min-height: 0; overflow-y: auto;
  overscroll-behavior: contain;                /* прокрутка не утекает на страницу под диалогом */
  scrollbar-gutter: stable;                    /* место под полосу зарезервировано всегда, иначе ширина колонки прыгала бы между разделами */
}
.setVal { font-size: 14.5px; color: var(--dim2); }
.setVol { display: flex; align-items: center; gap: 10px; }
.setVol input[type="range"] { flex: 1 1 auto; min-width: 0; height: 24px; accent-color: var(--accent); }
.setVol output { flex: none; width: 48px; text-align: right; font-size: 13.5px; color: var(--dim2); font-variant-numeric: tabular-nums; }
/* иконка — сосед переводимого <span>, поэтому applyStaticMarkup её не стирает */
#menuSettings { display: flex; align-items: center; justify-content: center; gap: 8px; }
#menuSettings svg { width: 15px; height: 15px; flex: none; }
/* узкий экран: сайдбар становится горизонтальной полосой */
@media (max-width: 620px) {
  #setDlg .dlgBody { grid-template-columns: 1fr; grid-template-rows: auto 1fr; row-gap: 10px; }   /* полоса разделов по содержимому, панель забирает остаток */
  #setNav { flex-direction: row; border-right: none; border-bottom: 1px solid var(--line); padding: 0 0 8px; }
  #setNav button { width: auto; flex: 1 1 0; text-align: center; }
}
#setInfo { font: 12px ui-monospace, Menlo, monospace; color: var(--dim2); margin: 10px 0 6px; white-space: pre-line; }
.setRow { display: grid; grid-template-columns: 130px 1fr; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.setRow:last-child { border-bottom: none; }   /* в коротком разделе обрыв пунктира над пустотой читается как обрезанный список */
.setLabel { font-size: 14.5px; font-weight: 700; }
.setHint { font-size: 12.5px; font-weight: 400; color: var(--dim2); margin-top: 2px; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.seg button {
  min-height: 40px; padding: 8px 12px; font-size: 14.5px; cursor: pointer;
  background: var(--panel2); color: var(--dim2); border: 1px solid var(--line); border-radius: 9px;
}
.seg button.on { color: var(--text); border-color: var(--accent); background: #14405c; }
.seg button:hover { border-color: var(--accent); }

/* Ряд выбора языка в главном меню: переиспользует .seg из настроек, но сеткой 3 + 3 —
   шесть плашек «флаг + код» в 376 px одной строкой не влезают, а flex-wrap давал 5 + 1.
   Флаг — инлайн-SVG (icons.js FLAGS): эмодзи-флаги Windows не рисует. */
.langRow { display: grid; grid-template-columns: repeat(3, max-content); justify-content: center; margin-top: 8px; }   /* число колонок ставит mountLangRow по числу языков: flex-wrap давал 5 + 1 */
.langRow button { min-height: 34px; padding: 6px 10px; font-size: 13.5px; letter-spacing: .04em; }
/* SVG-флаг вместо эмодзи (Windows их не рисует): 3:2, тонкий кант, чтобы белая полоса не сливалась с плашкой */
.langRow .flag { display: inline-block; width: 18px; height: 12px; border-radius: 2px; vertical-align: -1px; margin-right: 5px; box-shadow: 0 0 0 1px #ffffff22; }
.setCustom { font-size: 12.5px; color: var(--warn); margin-left: 4px; }
/* выплата на финише */
#finishPay, #failPay { margin: 6px auto 12px; width: 100%; max-width: 340px; text-align: left; font-size: 14.5px; }
#finishPay .row, #failPay .row { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px dashed var(--line); }
#finishPay .row b.neg, #failPay .row b.neg { color: var(--bad); }
#finishPay .row.total { font-weight: 800; border-bottom: none; font-size: 15px; color: var(--accent); }
#finishPay .row.hint, #failPay .row.hint { border-bottom: none; color: var(--dim2); font-size: 13.5px; }
/* срыв заказа */
#failBanner {
  position: absolute; inset: 0; margin: auto; width: 340px; height: max-content;
  background: linear-gradient(180deg, #1d1416f6, #120f10f6); border: 1px solid #7a2424; border-radius: 18px;
  padding: 22px 22px 18px; text-align: center; z-index: 12; box-shadow: 0 18px 60px #000c, 0 0 40px #ff6a6a22;
  animation: fbFade .8s ease-out both;                 /* срыв: плавно, без «выскока» */
}
@keyframes fbFade { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.fbTitle.bad { color: var(--bad); }
.fbReason { margin: 8px 0 6px; font-size: 14px; font-weight: 600; }
#raceTime.fail { color: var(--bad); }
#raceDeadline { flex-basis: 100%; font-size: 12.5px; margin: 2px 0 1px; }   /* своя строка под полосой */
#raceDeadline.warn { color: var(--bad); font-weight: 700; }
/* крупные кнопки заезда: эвакуатор (пиктограмма с крюком, R, цена; красная, когда вызов
   сорвёт заказ) и отказ от заказа (белый флаг, Esc, штраф) */
#hud .bigBtn {
  display: flex; align-items: center; gap: 9px; padding: 4px 13px 4px 9px; min-height: 58px;
  border-radius: 11px; border-color: #3a4655; background: #12161de6;
}
#hud .towBtn:hover { border-color: var(--warn); background: #1a2029; }
#hud .giveBtn:hover { border-color: var(--bad); background: #1a2029; }
.giveIco { width: 40px; height: 40px; display: block; }
.giveIco .gFlag { fill: #f2f4f7; }
.giveIco .gPole, .giveIco .gBase { stroke: #c8ced8; stroke-width: 2.4; stroke-linecap: round; fill: none; }
#hud .giveBtn .bigCap { color: var(--bad); }
.towIco { width: 60px; height: 38px; display: block; }
.towIco .tBed { fill: #d9a441; }
.towIco .tCab { fill: #e9b636; }
.towIco .tGlass { fill: #7fd0ff; }
.towIco .tBeacon { fill: #ff6a6a; }
.towIco .tBoom { stroke: #c8ced8; stroke-width: 4; stroke-linecap: round; fill: none; }
.towIco .tCable { stroke: #c8ced8; stroke-width: 1.4; fill: none; }
.towIco .tHook { stroke: #ffe08a; stroke-width: 2.2; stroke-linecap: round; fill: none; }
.towIco .tWheel { fill: #0b0e13; stroke: #5b6675; stroke-width: 1.2; }
.towIco .tHub { fill: #8a97a8; }
.bigText { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; line-height: 1; }
.bigText kbd {
  font: 700 14.5px/1 system-ui, sans-serif; color: #0b0e13; background: #ffe08a;
  border-radius: 4px; padding: 2px 6px; min-width: 10px; text-align: center;
}
#hud .giveBtn kbd { background: #dfe5ee; }
.bigCap { font-size: 13.5px; color: var(--dim2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.bigCap:empty { display: none; }
#hud .towBtn.warn { border-color: var(--bad); }
#hud .towBtn.warn .bigCap { color: var(--bad); font-weight: 700; }
#hud .towBtn.warn .tBeacon { animation: dmgPulse .6s infinite; }

#finishUnlock { margin: 2px auto 12px; padding: 8px 10px; font-weight: 700; font-size: 14.5px; color: var(--warn); border: 1px dashed var(--warn); border-radius: 10px; }
#finishUnlock .cap { display: block; margin-top: 3px; font-weight: 500; }
/* реклама за награду: предложение на финише и заглушка ролика */
#adOffer { margin: 2px 0 10px; }
/* «продолжить с места» за ролик на карточке срыва — как ролик на карточке финиша */
#reviveOffer { margin: 10px 0 4px; }
#reviveOffer .cap { margin-top: 4px; font-size: 12.5px; color: var(--dim2); }
#reviveBtn { width: 100%; background: #5a3d0e; border-color: var(--warn); color: #ffe9b0; }
#reviveBtn:hover { background: #6e4a12; }
body.modestAds #reviveBtn { width: auto; display: block; margin: 0 auto; padding: 6px 12px; font-size: 13.5px; font-weight: 600; }
#adOfferBtn {
  width: 100%; background: #5a3d0e; color: #ffe9b0; border: 1px solid var(--warn); border-radius: 9px;
  padding: 9px; font-size: 14.5px; font-weight: 700; cursor: pointer;
}
#adOfferBtn:hover { background: #6e4a12; }
/* кнопка «за ролик» не крупнее обычной (caps.modestRewarded — Poki): под основными кнопками, компактная */
body.modestAds #adOffer { margin: 10px 0 0; }
body.modestAds #adOfferBtn { width: auto; max-width: calc(50% - 4px); display: block; margin: 0 auto; padding: 6px 12px; font-size: 13.5px; font-weight: 600; }
body.modestAds .dlgFoot:has(button.ad) button { flex: 1 1 0; }   /* выбор с роликом в диалоге (заряд лебёдки: за ролик / купить / позже) — кнопки одной ширины */
/* Esc — пауза (caps.escPause — Poki): на кнопке отказа от заказа бейджа Esc нет */
body.escPause #giveUpBtn kbd { display: none; }
/* Esc игре не нужен (caps.noEsc — CrazyGames: им выходят из полного экрана): бейджей Esc нет и на кнопках «назад» */
body.noEsc #giveUpBtn kbd, body.noEsc #mapBack .hint, body.noEsc #toMenuBtn .hint { display: none; }
#adMock { position: fixed; inset: 0; z-index: 40; background: #000e; display: flex; align-items: center; justify-content: center; }
.amCard { width: 360px; padding: 26px 24px; text-align: center; background: #12161d; border: 1px solid var(--warn); border-radius: 14px; box-shadow: 0 12px 50px #000c; }
.amKicker { font-size: 12.5px; letter-spacing: .2em; color: var(--warn); font-weight: 700; }
.amBody { margin: 14px 0 16px; font-size: 15px; line-height: 1.4; }
.amBody b { font-size: 22px; color: var(--warn); }
.card.ad { border-color: var(--warn); }
.cBuy.ad { background: #5a3d0e; border-color: var(--warn); color: #ffe9b0; }
.cBuy.ad:hover { background: #6e4a12; }
/* декор: палитра и превью деколей */
.swatches { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #0008; cursor: pointer; padding: 0; }
.swatch.on { border-color: #fff; box-shadow: 0 0 0 2px var(--accent); }
.swatch.custom { position: relative; background: conic-gradient(#f33, #ff3, #3f3, #3ff, #33f, #f3f, #f33); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; }
.swatch.custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.pAct { display: flex; align-items: center; gap: 10px; min-height: 30px; margin-top: 8px; }   /* строка действия покраски: высота постоянна, сетка образцов не прыгает */
.cIcon.decal { border-radius: 8px; background: #7a2418; }
.cIcon.decal-stripes { background: linear-gradient(90deg, #7a2418 0 30%, #eee 30% 42%, #7a2418 42% 58%, #eee 58% 70%, #7a2418 70%); }
.cIcon.decal-flames { background: linear-gradient(20deg, #f2a11b 0 35%, #ffd23a 35% 55%, #7a2418 55%); }
.cIcon.decal-number { background: radial-gradient(circle at 50% 50%, #eee 0 34%, #7a2418 36%); }
.cIcon.decal-camo { background: radial-gradient(circle at 30% 30%, #2a4a22 0 22%, transparent 24%), radial-gradient(circle at 70% 60%, #5a4a2a 0 24%, transparent 26%), radial-gradient(circle at 40% 75%, #1b221a 0 18%, transparent 20%), #7a2418; }
.cIcon.decal-tribal { background: linear-gradient(35deg, transparent 0 40%, #111 40% 46%, transparent 46% 58%, #111 58% 63%, transparent 63%), #7a2418; }
.cIcon.decal-sunset { background: linear-gradient(180deg, #7a2418 0 34%, #f9d933 34% 50%, #f2801a 50% 66%, #c0268c 66% 82%, #7a2418 82%); }

/* заглох в воде */
#stallBanner {
  position: absolute; left: 50%; top: 22%; transform: translateX(-50%); width: 320px;
  background: #12161df2; border: 1px solid var(--bad); border-radius: 14px;
  padding: 14px 18px; text-align: center; z-index: 8; box-shadow: 0 12px 50px #000a;
}
#stallBanner .sbTitle { font-size: 18px; font-weight: 800; color: var(--bad); }
#stallBanner .sbKey { margin-top: 8px; font-size: 14.5px; }
/* стартовая плашка первого рейса: клавиши управления и задача */
#introPlate {
  position: absolute; left: 0; right: 0; top: 20%; margin: 0 auto; width: max-content; z-index: 8; pointer-events: none;
  padding: 18px 28px 16px; border-radius: 16px; background: #12161df2; border: 1.4px solid #c8d0dc;
  box-shadow: 0 16px 50px #000c; text-align: center; transition: opacity .5s ease, transform .5s ease;
}
#introPlate.out { opacity: 0; transform: translateY(10px); }
/* переворот: подсказка как у заглохшего мотора */
#flipBanner {
  position: absolute; left: 50%; top: 22%; transform: translateX(-50%); width: 320px;
  background: #12161df2; border: 1px solid var(--warn); border-radius: 14px;
  padding: 14px 18px; text-align: center; z-index: 8; box-shadow: 0 12px 50px #000a; animation: tuIn .3s ease;
}
#flipBanner .sbTitle { font-size: 18px; font-weight: 800; color: var(--warn); }
#flipBanner .sbKey { margin-top: 8px; font-size: 14.5px; }
/* награда за рекламу: тост сверху по центру, ненавязчиво */
#rewardToast {
  position: absolute; left: 0; right: 0; top: 64px; margin: 0 auto; width: max-content; max-width: calc(94 * var(--vw)); z-index: 20; pointer-events: none;
  display: flex; align-items: center; gap: 10px; padding: 9px 16px 9px 12px; border-radius: 12px;
  background: #12161df2; border: 1.4px solid var(--warn); box-shadow: 0 10px 30px #000a, 0 0 24px #e9b63633;
  opacity: 0; transform: translateY(-8px); transition: opacity .35s ease, transform .35s ease;
}
#rewardToast.in { opacity: 1; transform: none; }
#rewardToast .rtIcon { width: 26px; height: 26px; color: var(--warn); }
#rewardToast .rtIcon svg { width: 26px; height: 26px; }
#rewardToast .rtText { display: flex; flex-direction: column; line-height: 1.2; }
#rewardToast .rtText b { font-size: 14px; }
#rewardToast .rtText span { font-size: 13.5px; color: var(--dim2); }
.ipKeys { display: flex; align-items: center; justify-content: center; gap: 22px; }
.ipGroup { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.ipRow { display: flex; gap: 4px; }
.ipKeys kbd {
  display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 7px;
  background: #e8edf5; color: #0b0e13; font: 700 15px/1 system-ui, sans-serif; box-shadow: 0 3px 0 #8a97a8, inset 0 -2px 0 #c2cad6;
}
.ipOr { font-size: 14.5px; color: var(--dim2); }
.ipText { margin-top: 14px; font-size: 18px; font-weight: 800; color: var(--warn); }
#stallBanner .sbKey b { color: var(--text); padding: 2px 6px; border: 1px solid var(--line); border-radius: 6px; }

/* модальные диалоги — по центру экрана (глобальный сброс margin ломал центрирование) */
dialog[open] { position: fixed; inset: 0; margin: auto; }

/* ── сюжет: касса моста, подписи земель, подсказки заезда-хука, кат-сцены ── */
.fund { position: relative; font-size: 13.5px; color: var(--dim2); margin-top: 3px; padding-bottom: 6px; min-width: 220px; }
.fund b { color: var(--warn); }
.fund i { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--warn); border-radius: 2px; max-width: 100%; }
#zoneLabels { position: absolute; inset: 0; overflow: hidden; }
.zoneLabel {
  position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 12px; border-radius: 10px; background: #0b0e13d9; border: 1px dashed #8a7a4f; color: var(--warn);
  font-size: 13.5px; text-align: center; max-width: 220px; pointer-events: auto; cursor: pointer; backdrop-filter: blur(3px);
}
.zoneLabel i { display: inline-flex; width: 14px; height: 14px; }
.zoneLabel i svg { width: 100%; height: 100%; }
.zoneLabel b { font-size: 14.5px; letter-spacing: .04em; text-transform: uppercase; }
.zoneLabel .zl { font-size: 12.5px; color: var(--dim2); }
.zoneLabel .zProg { width: 100%; height: 4px; margin-top: 3px; background: var(--line); border-radius: 2px; overflow: hidden; }
.zoneLabel .zProg i { display: block; height: 100%; background: var(--warn); }
.zoneLabel.open i { display: none; }
.zoneLabel.open { border: 1px solid #3a4655; color: var(--text); background: #0b0e1370; cursor: pointer; }   /* клик — перелёт камеры к земле */
.zoneLabel.open:hover { border-color: var(--accent); background: #0b0e13a8; }
.zoneLabel.open i { display: none; }
.zoneLabel.open .zl { display: none; }
/* золотая плашка финального заказа */
.callout.final .cbg path { stroke: #e9b636; stroke-width: 1.6; fill: #1c1811f4; }
.callout.final .oIcon { color: #e9b636; }
@keyframes tuIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
/* кат-сцена: облачко-реплика внизу, точки кадров */
#story { position: absolute; inset: 0; z-index: 15; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding: 16px 0 36px; pointer-events: none; }
body.adOverlay #story { padding-bottom: calc(36px + (var(--adBanH, 0px) + env(safe-area-inset-bottom)) / var(--ui)); }
.sbubble {
  pointer-events: auto; width: min(640px, calc(86 * var(--vw))); padding: 16px 20px 14px; border-radius: 16px;
  background: #12161df4; border: 1.6px solid #c8d0dc; box-shadow: 0 16px 50px #000c;
  display: flex; flex-direction: column; min-height: 0;
}
.sBody { min-height: 0; overflow-y: auto; }
.sWho, .sButtons, .sDots { flex-shrink: 0; }
/* плавное появление/уход реплик: класс fade на #story */
.sbubble, .sDots { transition: opacity .3s ease, transform .3s ease; }
#story.fade .sbubble, #story.fade .sDots { opacity: 0; transform: translateY(8px); }
.sWho { font-size: 13.5px; color: var(--warn); letter-spacing: .06em; text-transform: uppercase; margin-bottom: 4px; }
.sWho:empty { display: none; }
.sText { font-size: 16px; line-height: 1.5; }
.sStats { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; margin-top: 10px; font-size: 14.5px; color: var(--dim2); }
.sStats b { color: var(--text); font-variant-numeric: tabular-nums; }
.sButtons { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 12px; }   /* вид кнопок — общий с .dlgFoot */
.sDots { display: flex; gap: 6px; margin-top: 10px; }
.sDots i { width: 7px; height: 7px; border-radius: 50%; background: #3a4655; }
.sDots i.on { background: var(--accent); }
body.story #callouts, body.story #mapTop, body.story #mapBack, body.story #farmTags, body.story #mapBoard, body.story #gTop, body.story #garagePanel, body.story #gStats, body.story #gBottom, body.story #moneyHud, body.story #topBtns, body.story .cornerBtn, body.story .shopBtn { visibility: hidden; }
/* совет в карточках финиша и срыва */
.tip { margin-top: 8px; padding: 8px 12px; border-left: 3px solid var(--warn); background: #e9b63614; border-radius: 0 8px 8px 0; font-size: 14.5px; color: var(--text); text-align: left; font-style: italic; }


/* ── мобильные: экранное управление (touch.js), режим body.touch ── */
#app { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
/* панель во весь холст, сама указатели не ловит — только зона джойстика и кнопки.
   --joyR/--joyA пишет touch.js (радиус с учётом экрана, заливка из настроек); --safe* читает
   он же для «дома» круга: env() из JS недоступен */
#touchPad {
  position: absolute; inset: 0; z-index: 9; pointer-events: none; --joyR: 72px; --joyA: .35;
  --safeL: env(safe-area-inset-left); --safeR: env(safe-area-inset-right); --safeB: env(safe-area-inset-bottom);
}
body:not(.touch) #touchPad { display: none !important; }
/* круг на фиксированном месте (inline left/top пишет touch.js: у края по центру высоты, в портрете по
   центру снизу); касание начинается на круге — ::after даёт запас 22 px вокруг контура */
#joy {
  position: absolute; width: calc(var(--joyR) * 2); height: calc(var(--joyR) * 2); transform: translate(-50%, -50%);
  pointer-events: auto; touch-action: none; transition: left .15s ease-out, top .15s ease-out;
}
#joy::after { content: ''; position: absolute; inset: -22px; border-radius: 50%; }
.joyBase {
  position: absolute; inset: 0; border-radius: 50%; border: 2px solid #ffffffcc;
  background: rgba(11, 14, 19, var(--joyA)); box-shadow: 0 0 0 1px #0006, 0 6px 20px #0008;
}
.joyBase .ja { position: absolute; font-style: normal; font-size: 11px; color: #ffffff66; line-height: 1; }
.joyBase .ja.n { top: 7px; left: 50%; transform: translateX(-50%); }
.joyBase .ja.s { bottom: 7px; left: 50%; transform: translateX(-50%); }
.joyBase .ja.w { left: 8px; top: 50%; transform: translateY(-50%); }
.joyBase .ja.e { right: 8px; top: 50%; transform: translateY(-50%); }
.joyKnob {
  position: absolute; left: 50%; top: 50%; width: calc(var(--joyR) * .84); height: calc(var(--joyR) * .84); border-radius: 50%;
  background: linear-gradient(180deg, #8ae0ffee, #2fa9e4ee); box-shadow: 0 4px 14px #0008, inset 0 1px 0 #ffffff66;
  transform: translate(-50%, -50%) translate(var(--kx, 0px), var(--ky, 0px)); transition: transform .12s ease-out;
}
#joy.on .joyKnob { transition: none; }
/* кнопки удержания у противоположного от джойстика края снизу (#touchPad.right — слева), и в портрете тоже */
#tpBtns {
  position: absolute; right: max(14px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center; gap: 12px; pointer-events: auto;
}
#touchPad.right #tpBtns { right: auto; left: max(14px, env(safe-area-inset-left)); }
#touchPad > * { touch-action: none; }
.tpBtn {
  border: 1px solid #3a4655; background: #12161dd9; color: var(--text); font-weight: 800; cursor: pointer;
  backdrop-filter: blur(6px); box-shadow: 0 6px 18px #0008; padding: 0;
}
.tpBtn.hold { width: 64px; height: 64px; border-radius: 50%; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; line-height: 1.1; padding: 0 5px; display: flex; align-items: center; justify-content: center; }
.tpBtn.hold svg { width: 32px; height: 32px; stroke: currentColor; pointer-events: none; }   /* значок вместо надписи: цвет состояния (on/near/pull) идёт в обводку */
.tpBtn.on { background: #14405c; border-color: var(--accent); color: #cdefff; }
.tpBtn.near { border-color: var(--warn); color: var(--warn); animation: tpPulse .9s ease-in-out infinite alternate; }
.tpBtn.pull { border-color: var(--ok); color: var(--ok); animation: none; }
.tpBtn.empty { opacity: .55; }
#tpWinch[data-n]::after { content: attr(data-n); position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; border-radius: 9px; background: #0b0e13; border: 1px solid var(--line); color: var(--text); font-size: 11px; font-weight: 700; line-height: 16px; text-align: center; letter-spacing: 0; }
/* сияние машины при покупке в гараже (main.js garageFx): ореол над холстом, ниже HUD */
#carGlow { position: absolute; left: 50%; top: 50%; width: min(96vmin, 760px); height: min(96vmin, 760px); border-radius: 50%; pointer-events: none; z-index: 6; mix-blend-mode: screen; opacity: 0;
  background: radial-gradient(circle, #fffbe6 0%, #ffe38a 14%, #ffc24fcc 30%, #f2a53a66 50%, #f2a53a00 72%); transform: translate(-50%, -50%); filter: saturate(1.2); }
@keyframes tpPulse { from { box-shadow: 0 6px 18px #0008; } to { box-shadow: 0 0 0 4px #ffcc6644, 0 6px 18px #0008; } }

/* в тач-режиме клавиатурные подсказки не нужны, приборы уходят выше руля, бейджи — кнопки */
body.touch #keysHint, body.touch .bigText kbd, body.touch .fbButtons kbd, body.touch .sbKey, body.touch #introPlate .ipKeys { display: none; }
#introPlate .ipTouch { display: none; }
body.touch #introPlate .ipTouch { display: flex; gap: 22px; justify-content: center; font-size: 20px; font-weight: 800; margin-bottom: 8px; }
body.touch #driveBadges .badge { font-size: 13.5px; padding: 8px 12px; cursor: pointer; }
#driveBadges .badge { cursor: pointer; }

/* ── мини-HUD на телефоне: тонкая полоса прогресса во всю ширину сверху, таймер слева, кнопки справа;
   спидометр, схема повреждений, название локации, подсказки и бейджи лебёдки/груза скрыты — состояние
   лебёдки живёт в подсветке кнопки панели (touch.js setWinchNear) ── */
body.touch #racePlate { display: block; top: 0; left: 0; right: 0; width: auto; transform: none; background: none; border: 0; border-radius: 0; padding: 0; backdrop-filter: none; }
/* полоса под самым верхом: отступ 7 px (или под чёлку), чтобы машинка над ней была видна целиком; сама
   полоса ярче и на пиксель толще — на солнце её не было видно (тестеры) */
body.touch #racePlate .progWrap { margin: max(7px, env(safe-area-inset-top)) 0 0; }
body.touch .progTrack { height: 4px; background: #ffffff55; border: 0; border-radius: 0; box-shadow: 0 0 4px #0009; }
body.touch #progFill { background: #fff; transition: width .3s linear; }
body.touch #progCar { top: -6px; width: 18px; height: 9px; }
body.touch #progText { display: none; }
body.touch #raceTime { position: absolute; top: calc(max(8px, env(safe-area-inset-top)) + 8px); left: max(10px, env(safe-area-inset-left)); font-size: 14px; font-weight: 600; text-shadow: 0 1px 3px #000; }
body.touch #raceDeadline { position: absolute; top: calc(max(8px, env(safe-area-inset-top)) + 48px); left: max(10px, env(safe-area-inset-left)); font-size: 12.5px; text-shadow: 0 1px 3px #000; }
/* монеты — под таймером слева (срок срочного заказа — строкой ниже) */
body.touch #raceCoins { position: absolute; top: calc(max(8px, env(safe-area-inset-top)) + 28px); left: max(10px, env(safe-area-inset-left)); margin: 0; justify-content: flex-start; text-shadow: 0 1px 3px #000; color: #fff; }
body.touch #raceHud { left: auto; right: max(10px, env(safe-area-inset-right)); top: calc(max(8px, env(safe-area-inset-top)) + 8px); transform: none; align-items: flex-end; }   /* таймер и кнопки — под полосой прогресса */
body.touch #topBtns { gap: 6px; }
body.touch #topBtns button { width: 36px; height: 36px; font-size: 16px; }
body.touch #topBtns button svg { width: 18px; height: 18px; }
body.touch #speedBox, body.touch #dmgBox, body.touch #orderInfo, body.touch #bWinch, body.touch #bCargo { display: none !important; }   /* #cargoBar на телефоне остаётся: стропы и груз без цифр */
/* понижайка и блокировка — пилюли под кнопками справа сверху (тап переключает, как и раньше) */
body.touch #dash { left: auto; right: max(10px, env(safe-area-inset-right)); top: calc(max(8px, env(safe-area-inset-top)) + 44px); bottom: auto; transform: none; align-items: flex-end; }
body.touch #dashCol { align-items: flex-end; }
body.touch #driveBadges { justify-content: flex-end; max-width: none; }
/* джойстик справа — полоски HP груза и бейджи уходят наверх слева, под таймер (тестер: напротив джойстика) */
body.touch.joyRight #dash { right: auto; left: max(10px, env(safe-area-inset-left)); top: calc(max(8px, env(safe-area-inset-top)) + 62px); align-items: flex-start; }
body.touch.joyRight #dashCol { align-items: flex-start; }
body.touch.joyRight #driveBadges { justify-content: flex-start; }
body.touch #driveBadges .badge { font-size: 13.5px; padding: 8px 12px; cursor: pointer; }
/* эвакуатор и «сдаться» — круглые иконки в ряд слева от кнопок панели у нижнего края (колонка над
   ними на низком экране Chrome iOS наезжала на кнопки сверху), на противоположной от джойстика стороне */
body.touch #hud { top: auto; left: auto; right: calc(max(14px, env(safe-area-inset-right)) + 76px); bottom: max(14px, env(safe-area-inset-bottom)); flex-direction: row; align-items: flex-end; gap: 10px; max-width: none; }
body.touch.joyRight #hud { right: auto; left: calc(max(14px, env(safe-area-inset-left)) + 76px); }
body.touch #hud .hudRow { flex-direction: row; gap: 10px; }
body.touch #hud .bigBtn { flex-direction: column; justify-content: center; gap: 1px; padding: 4px; min-height: 0; width: 64px; height: 64px; border-radius: 50%; }
body.touch .towIco { width: 38px; height: 24px; }
body.touch .giveIco { width: 24px; height: 24px; }
body.touch .bigText { align-items: center; }
body.touch .bigCap { font-size: 11px; }
body.touch #stallBanner, body.touch #flipBanner { top: 14%; width: min(320px, calc(90 * var(--vw))); }
/* заезд окончен (body.raceOver ставит finishRace/failRace): панель и эвакуатор/«сдаться» прячутся — джойстик
   лежал поверх карточки и перехватывал тап по «В гараж»; плашка денег — слева под таймером, а не поверх ⚙ ⏸ 🔊 */
body.touch.raceOver #touchPad, body.touch.raceOver #hud { display: none; }
body.touch.raceOver #moneyHud { top: calc(max(8px, env(safe-area-inset-top)) + 30px); left: max(10px, env(safe-area-inset-left)); right: auto; }
/* гараж на телефоне: полоса вкладок не масштабируется, а листается пальцем, и отступает от правого угла,
   чтобы плашка денег (z 13, выше #garage) не закрывала последнюю вкладку */
body.touch #gTop { transform: none; margin: 0 0 0 10px; max-width: calc(calc(100 * var(--vw)) - 130px); }
body.touch #gTop .gTabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; justify-content: flex-start; }
body.touch #gTop .gTab { white-space: nowrap; flex: none; }
@media (orientation: landscape) {
  /* «В главное меню» — справа сверху под плашкой денег, «К заказам» — справа снизу компактнее: в ландшафте телефона
     обе кнопки закрывали машину (тестер); панель деталей тянется до низа экрана */
  body.touch #garage .cornerBtn { left: auto; right: 14px; top: calc(max(8px, env(safe-area-inset-top)) + 52px); bottom: auto; padding: 8px 12px; }
  body.touch #toMapBtn { right: 14px; bottom: 12px; padding: 8px 14px; }
  body.touch #toMapBtn .hint { display: none; }
  body.touch #garage .cornerBtn .big { font-size: 14px; }
  body.touch #garage .cornerBtn .hint { display: none; }
  body.touch #gShop { top: calc(max(8px, env(safe-area-inset-top)) + 96px); }   /* под «В главное меню» (52 + ~36 + 8) */
  body.touch #garage.shopOn #gStats { top: calc(max(8px, env(safe-area-inset-top)) + 144px); }   /* сводка — под магазином (96 + ~40 + 8): кнопка лежала на строке «Скорость» */
}
/* отладка на телефоне: строка fps — сверху по центру вне потока, селект вида и слайдеры не раздувают колонку кнопок */
body.touch #fpsBox { position: fixed; left: max(10px, env(safe-area-inset-left)); top: calc(max(8px, env(safe-area-inset-top)) + 26px); max-width: calc(60 * var(--vw)); font-size: 10px; white-space: normal; text-align: left; }   /* под таймером, не поверх кнопок */
body.touch #hud .hudRow:not(:first-child), body.touch #paramBox { display: none; }
@media (orientation: portrait) {
  /* портрет: джойстик снизу у своего края, кнопки панели снизу у другого, эвакуатор/сдаться — колонкой над
     кнопками панели с зазором (две кнопки 64 + 12 + 64 и 24 px): в углу рядом с джойстиком их жали случайно */
  body.touch #hud { right: max(14px, env(safe-area-inset-right)); left: auto; bottom: calc(max(14px, env(safe-area-inset-bottom)) + 164px); flex-direction: column; align-items: center; }
  body.touch.joyRight #hud { right: auto; left: max(14px, env(safe-area-inset-left)); }
  body.touch #hud .hudRow { flex-direction: column; }
}
/* пауза: карточка поверх сцены, плашек, тачпада и HUD (z 8…15), но НИЖЕ затемнения
   смены сцены (30). Накрывает всё: пока карточка висит, ⚙ и 🔊 недоступны, зато
   «нажми куда угодно — поедешь дальше» работает без исключений. */
#pauseOverlay {
  position: absolute; inset: 0; z-index: 16; display: flex; align-items: center; justify-content: center;
  background: #0b0e13b8; backdrop-filter: blur(2px); cursor: pointer;
}
#pauseOverlay .menuCard { text-align: center; width: min(calc(92 * var(--vw)), 360px); pointer-events: none; }
#pauseOverlay .menuTitle { font-size: 30px; }
#pauseOverlay .menuSub { margin: 0; }
#pauseOverlay .pauseBtns { margin-top: 16px; pointer-events: auto; }   /* кнопки — в карточке, которая сама клики пропускает */
/* безопасные зоны (вырез, скруглённые углы) */
#hud { top: max(12px, env(safe-area-inset-top)); left: max(12px, env(safe-area-inset-left)); }
#raceHud { top: max(12px, env(safe-area-inset-top)); }
#orderInfo { right: max(14px, env(safe-area-inset-right)); }
/* узкий кадр на компьютере (Poki 640×360, 836×470): восемь вкладок гаража с подписями не помещаются — край уходил
   под плашку денег и за экран; одни значки, подпись — подсказкой (garage.js: title) */
@media (max-width: 900px) {
  body:not(.touch) #gTop .gTab span { display: none; }
  body:not(.touch) #gTop .gTab { padding-left: 10px; padding-right: 10px; }
}
/* средний по высоте кадр (CrazyGames — 636 px): карточка со звёздами, монетами, новой землёй и роликом помещается
   целиком — кнопки в ряд, цифры и поля скромнее */
@media (max-height: 700px) {
  #finishBanner { padding-top: 14px; }
  #finishTime { font-size: 34px; }
  #finishBest { margin-bottom: 4px; }
  #finishStars .fsRow { font-size: 28px; }
  #finishUnlock { margin-bottom: 8px; }
  #finishBanner .fbButtons { flex-direction: row; flex-wrap: wrap; }
  #finishBanner .fbButtons button { flex: 1 1 40%; width: auto; padding-left: 8px; padding-right: 8px; gap: 6px; }
  #finishBanner .fbButtons #finishSignIn { flex-basis: 100%; }
  #finishBanner .fbFoot { padding-bottom: 14px; }
}
/* низкое, но широкое окно (CrazyGames, отказ 09.11.2026: «on a small screen size, it can appear overlapped»): карточка финиша
   шире — строки и кнопка ролика переносятся реже, и карточка с новой землёй помещается без прокрутки; совсем низкое — ещё
   плотнее звёзды и плашка новой земли */
@media (max-height: 700px) and (min-width: 600px) and (orientation: landscape) {
  #finishBanner { width: min(440px, calc(94 * var(--vw))); }
}
@media (max-height: 600px) {
  #finishTime { font-size: 30px; }
  #finishStars { margin: 2px 0; }
  #finishStars .fsRow { font-size: 24px; }
  #finishBest { margin-bottom: 2px; }
  #finishUnlock { padding: 6px 10px; margin-bottom: 6px; }
}
/* маленькие экраны: плотнее HUD, панель гаража уже, диалоги во всю высоту */
@media (max-height: 520px) {
  body:not(.touch) #hud { gap: 5px; transform: scale(.82); transform-origin: left top; }
  body:not(.touch) #raceHud { transform: translateX(-50%) scale(.82); transform-origin: top center; }
  body:not(.touch) #racePlate { transform: translateX(-50%) scale(.82); transform-origin: top center; }
  body:not(.touch) #orderInfo { transform: scale(.82); transform-origin: right top; }
  #introPlate { top: 10%; padding: 10px 18px 8px; }
  #flipBanner, #stallBanner { top: 12%; }
  #garagePanel { top: 54px; left: 10px; width: min(430px, calc(48 * var(--vw)));
    max-height: calc(calc(100 * var(--vh)) - 54px - var(--gbot-res, 8px)); max-height: calc(calc(100 * var(--dvh)) - 54px - var(--gbot-res, 8px)); padding: 10px 12px; gap: 8px; }
  body:not(.touch) #gTop { transform: scale(.8); transform-origin: top center; max-width: calc(calc(125 * var(--vw)) - 30px); }   /* на телефоне полоса листается (см. body.touch #gTop) */
  #gTop .gTabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  #gTop .gTab { white-space: nowrap; flex: none; }
  #gStats { display: none; }
  #callouts { transform: scale(.85); transform-origin: top left; width: 117.6%; height: 117.6%; }
  .menuCard { padding: 16px 20px 14px; }
  .menuTitle { font-size: 26px; margin: 4px 0 6px; }
  .menuSub { margin-bottom: 10px; }
  #menuContinue { padding: 10px; }
  dialog { max-height: calc(96 * var(--vh)); max-height: calc(96 * var(--dvh)); padding: 12px 14px; }
  .dlgHead { padding: 8px 14px; }
  .dlgBody { padding: 4px 14px 14px; }     /* max-height убран — высоту раздаёт флекс */
  #setInfo { display: none; }             /* диагностика железа на ландшафтный телефон не помещается */
  .setRow { grid-template-columns: 104px 1fr; padding: 6px 0; }
  #setDlg .dlgBody { grid-template-columns: 104px 1fr; column-gap: 12px; }
  #setNav button { min-height: 36px; padding: 6px 10px; font-size: 13.5px; }
  .seg button { min-height: 36px; padding: 6px 10px; font-size: 13.5px; }
  /* карточки финиша и срыва: центрируются через inset/margin, translate(-50%) уводил их за край; масштаб
     через transform не работает — анимация fbIn/fbFade с fill both навсегда ставит transform: none.
     Поэтому компактная раскладка: мельче трофей и цифры, кнопки в ряд, при переполнении — прокрутка */
  #finishBanner, #failBanner { max-height: calc(96 * var(--vh)); max-height: calc(96 * var(--dvh)); overflow-y: auto; padding: 10px 14px; }
  #finishBanner { padding-bottom: 0; }
  .fbTrophy { width: 44px; height: 44px; margin: -2px auto 0; }
  .fbTitle { font-size: 13.5px; }
  #finishTime { font-size: 26px; margin: 0; }
  #finishBest { font-size: 12px; margin-bottom: 4px; }
  #finishStars { margin: 0 0 2px; }
  #finishStars .fsRow { font-size: 22px; gap: 4px; }
  #finishStars .fsCap { margin-top: 1px; font-size: 12.5px; }
  #finishPay, #failPay { margin: 4px auto 6px; font-size: 13.5px; }
  #finishPay .row, #failPay .row { padding: 2px 0; }
  #finishPay .row.total { font-size: 14.5px; }
  #finishUnlock { margin: 2px auto 6px; padding: 5px 8px; font-size: 13.5px; }
  #adOffer { margin: 2px 0 6px; }
  .fbReason { margin: 4px 0 2px; font-size: 14.5px; }
  #finishPay .tip, #failPay .tip, #finishUnlock .tip { margin-top: 5px; padding: 5px 10px; font-size: 13.5px; }
  .fbButtons { flex-direction: row; gap: 8px; margin-top: 8px; }
  #finishBanner .fbFoot { margin: 0 -14px 0; padding: 8px 14px 10px; }
  #finishBanner .fbFoot .fbButtons { margin-top: 0; }
  .fbButtons button { flex: 1; width: auto; padding: 8px; font-size: 14.5px; }
  .fbButtons { flex-wrap: wrap; }
  #finishBanner .fbButtons #finishSignIn { flex-basis: 100%; }
}

/* ── портрет (телефон вертикально): полноценный режим, оверлея «поверните» больше нет ── */
@media (orientation: portrait) {
  .menuTitle { font-size: 26px; }
  dialog { width: min(calc(94 * var(--vw)), 440px); }
  #setDlg { height: min(690px, calc(88 * var(--dvh))); }
  #introPlate { max-width: calc(92 * var(--vw)); }
  #finishBanner, #failBanner { width: min(340px, calc(92 * var(--vw))); }
  #stallBanner, #flipBanner { width: min(320px, calc(90 * var(--vw))); }
  /* гараж: панель деталей — нижний лист, вкладки в одну прокручиваемую строку, сводка скрыта,
     «К заказам» — справа сверху под плашкой денег */
  #garagePanel { left: 0; right: 0; top: auto; bottom: 0; width: auto; max-height: calc(42 * var(--dvh)); border-radius: 16px 16px 0 0; padding-bottom: max(10px, env(safe-area-inset-bottom)); }   /* 42dvh (было 48): машине нужна полоса кадра между кнопками и листом */
  #gTop { max-width: calc(calc(100 * var(--vw)) - 20px); }
  #gTop .gTabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; justify-content: flex-start; }   /* по центру обрезало бы оба края */
  #gTop .gTab { white-space: nowrap; flex: none; }
  #gStats { display: none; }
  /* угловые кнопки — под строкой вкладок, а не поверх нижнего листа; компактнее, чтобы не наезжать друг на друга */
  #toMapBtn { right: 12px; bottom: auto; top: 76px; padding: 9px 14px; }
  #toMapBtn .big { font-size: 17px; }
  #garage .cornerBtn { left: 12px; bottom: auto; top: 76px; padding: 9px 12px; }
  #garage .cornerBtn .big { font-size: 14px; }
  #toMapBtn .hint, #garage .cornerBtn .hint { display: none; }
  #gShop { top: 122px; right: 12px; }   /* под «К заказам» (76 + ~37 + 9) */
}

/* ── обучение первого запуска (tutorial.js): затенение с «окном» вокруг цели, заслонки, рука, подсказка ──
   z 25: поверх сцены, плашек и панели заезда (≤ 16), под затемнением смены сцены (30) и заглушкой рекламы (40); шаг в
   модальном окне рисуется внутри окна (верхний слой) */
#tut { position: fixed; inset: 0; z-index: 25; pointer-events: none; }
#tut[hidden] { display: none; }
#tut .tBlk { position: absolute; display: none; }
#tut.block .tBlk { display: block; pointer-events: auto; }
#tut .tHole { position: absolute; pointer-events: none; box-shadow: 0 0 0 200vmax #05080cad; outline: 3px solid #f2c34a; outline-offset: 0;
  animation: tutGlow 1.4s ease-in-out infinite; }
#tut:not(.block) .tHole { box-shadow: none; outline-color: #f2c34acc; }   /* последняя подсказка — без затенения */
@keyframes tutGlow { 0%, 100% { outline-color: #f2c34a; } 50% { outline-color: #fff2b8; } }
#tut .tHand { position: absolute; left: 0; top: 0; width: 52px; height: 65px; pointer-events: none; }
#tut .tSvg { width: 52px; height: 65px; animation: tutTap 1.1s ease-in-out infinite; filter: drop-shadow(0 3px 4px #000a); }
#tut .tSvg svg { display: block; width: 100%; height: 100%; }
/* «нажатие»: палец уходит к цели и обратно, в момент касания — расходящееся кольцо у кончика */
@keyframes tutTap { 0%, 100% { transform: translateY(16px); } 45%, 55% { transform: translateY(0); } }
#tut .tRing { position: absolute; left: calc(27.5px * 52 / 64 - 14px); top: calc(3px * 52 / 64 - 14px); width: 28px; height: 28px;
  border-radius: 50%; border: 3px solid #fff; opacity: 0; animation: tutRing 1.1s ease-out infinite; }
@keyframes tutRing { 0%, 44% { transform: scale(.3); opacity: 0; } 50% { transform: scale(.5); opacity: .9; } 100% { transform: scale(1.6); opacity: 0; } }
#tut .tTip { position: absolute; max-width: min(320px, calc(calc(100 * var(--vw)) - 32px)); padding: 10px 14px; border-radius: 12px; background: #fffaf0;
  color: #1b222b; font-size: 15px; font-weight: 700; line-height: 1.35; box-shadow: 0 6px 22px #000a; pointer-events: none; text-align: center; }
#tut .tSkip { position: absolute; left: 50%; top: max(10px, env(safe-area-inset-top)); transform: translateX(-50%); pointer-events: auto;
  padding: 7px 14px; border-radius: 999px; border: 1px solid #ffffff55; background: #0b0e13cc; color: var(--dim2); font-size: 13px; font-weight: 600; cursor: pointer; }
#tut .tSkip:hover { color: var(--text); border-color: #ffffff99; }
#tut .tSkip[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { #tut .tSvg, #tut .tRing, #tut .tHole { animation: none; } }
/* мотор в подарок на шаге обучения: зачёркнутая цена и зелёная кнопка */
.cBuy.free { background: #1f5a2c; border-color: var(--ok); color: #d9ffe0; }
.cBuy.free:hover { background: #26703a; }
.cPrice s { color: var(--dim2); }

/* QA: награда за возвращение, карточки заказа и результатов располагаются целиком над нижним баннером.
   Прокручивается только содержимое; кнопки всегда доступны, включая узкий экран и длинный перевод. */
#dailyDlg[open] { display: flex; flex-direction: column; overflow: hidden; }
#dailyDlg .ddBody { min-height: 0; overflow-y: auto; }
#dailyDlg .wdHead, #dailyDlg .dlgFoot { flex-shrink: 0; }
#dailyDlg .dlgFoot { flex-wrap: wrap; }
#dailyDlg .dlgFoot button { min-width: 0; max-width: 100%; }
body.adOverlay #dailyDlg[open], body.adOverlay #orderDlg[open], body.adOverlay #finishBanner {
  bottom: calc((var(--adBanH, 0px) + env(safe-area-inset-bottom)) / var(--ui));
  max-height: calc(100 * var(--dvh) - (var(--adBanH, 0px) + env(safe-area-inset-bottom)) / var(--ui) - 24px);
}

/* popover внутри модального окна не наследует увеличение UI: реклама остаётся строго размера SDK. */
dialog #adBanner { zoom: calc(1 / var(--ui)); }
/* Тост не закрывает заголовок меню и остаётся над его карточкой. */
body:has(#menu:not([hidden])) #rewardToast { top: calc(8px / var(--ui)); }
