/* ===== GarageRaceGame — стиль iOS ===== */
/* двойной тап не приближает экран (быстрые нажатия на кнопки, кейсы); у элементов с touch-action: none — своё */
html, body, * { touch-action: manipulation; }
/* ТОКЕНЫ — см. css/theme.css (дизайн-система «Asphalt») */

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; background: var(--bg); }
body {
  color: var(--text);
  font: 17px/1.3 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  letter-spacing: -.2px;
  user-select: none; -webkit-user-select: none;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; letter-spacing: inherit; padding: 0; }

/* весь экран приложения — уменьшается, когда выезжает шторка (как в iOS) */
#app {
  min-height: 100vh; background: var(--bg);
  transform-origin: 50% 0;
  transition: transform .5s var(--ios), border-radius .5s var(--ios), filter .5s var(--ios);
}
body.sheet-open #app { transform: scale(.94) translateY(10px); border-radius: 14px; overflow: hidden; filter: brightness(.85); }

/* ---------- эмодзи как на iPhone ---------- */
.emo { display: inline-block; vertical-align: -0.15em; line-height: 1; font-family: "Apple Color Emoji", sans-serif; }
img.emo { object-fit: contain; }

/* ---------- шапка ---------- */
.header {
  display: flex; align-items: flex-end; justify-content: space-between;
  padding: 18px 16px 10px; max-width: 600px; margin: 0 auto;
}
.large-title { font-size: 34px; font-weight: 700; letter-spacing: .3px; line-height: 1.1; }
.balance {
  font-size: 15px; font-weight: 600; padding: 7px 13px; border-radius: 999px;
  background: var(--card); font-variant-numeric: tabular-nums;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  border: 1px solid transparent; box-sizing: border-box;
  transition: transform .3s var(--spring), background .2s, border-color .2s;
  cursor: pointer;
}
.balance.stars-mode {
  background: rgba(255, 196, 0, 0.12);
  border-color: rgba(255, 196, 0, 0.35);
}
.balance.bump { transform: scale(1.1); }

main { padding: 0 16px 120px; max-width: 600px; margin: 0 auto; }
.enter { animation: enter .35s var(--ios); }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } }

/* ---------- жидкое стекло: нижняя панель ---------- */
.tabbar {
  position: fixed; z-index: 10; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex; padding: 5px; border-radius: 999px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(190%);
  backdrop-filter: blur(22px) saturate(190%);
  box-shadow:
    inset 0 1px 0 var(--glass-hi),
    inset 0 -1px 1px rgba(255, 255, 255, .12),
    inset 0 0 0 .5px rgba(255, 255, 255, .25),
    var(--shadow);
  transition: transform .5s var(--ios), opacity .3s;
}
/* блик по краю стекла */
.tabbar::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255,255,255,.75), rgba(255,255,255,0) 35%, rgba(255,255,255,0) 65%, rgba(255,255,255,.35));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
body.sheet-open .tabbar { transform: translateX(-50%) translateY(140%); }
body.kbd .tabbar { transform: translateX(-50%) translateY(140%); pointer-events: none; }   /* клавиатура открыта */
.tabbar button {
  position: relative; z-index: 1;
  padding: 11px 13px; font-size: 14px; font-weight: 600; color: var(--hint);
  border-radius: 999px; transition: color .3s, transform .25s var(--spring);
}
.tabbar button.active { color: var(--text); }
.tabbar button:active { transform: scale(.92); }
.tab-thumb {
  position: absolute; top: 5px; bottom: 5px; left: 0; border-radius: 999px;
  background: var(--glass-thumb);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 2px 8px rgba(0,0,0,.08);
  transition: transform .5s var(--spring), width .5s var(--spring);
}

/* ---------- общие элементы ---------- */
.card { background: var(--card); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.section-h { font-size: 13px; color: var(--hint); text-transform: uppercase; margin: 22px 16px 7px; display: flex; justify-content: space-between; }
.muted { color: var(--hint); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.btn {
  display: block; width: 100%; padding: 15px; border-radius: 14px;
  background: var(--accent); color: var(--on-accent); font-size: 17px; font-weight: 600; text-align: center;
  transition: transform .2s var(--spring), opacity .2s;
}
.btn:active { transform: scale(.97); opacity: .85; }
.btn:disabled { opacity: .35; transform: none; }
.btn.gray { background: var(--fill); color: var(--accent); }
.btn.danger { background: var(--fill); color: var(--bad); }
.btn + .btn { margin-top: 10px; }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 7px; color: #fff; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 3px 7px; border-radius: 7px; background: var(--fill); color: var(--hint); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }

/* ---------- iOS-переключатель ---------- */
.segmented {
  --n: 2;
  position: relative; display: grid; grid-template-columns: repeat(var(--n), 1fr);
  background: var(--fill); border-radius: 9px; padding: 2px; margin-bottom: 16px;
}
.segmented button { position: relative; z-index: 1; padding: 7px 0; font-size: 14px; font-weight: 500; }
.segmented .thumb {
  position: absolute; top: 2px; bottom: 2px; left: 2px; width: calc((100% - 4px) / var(--n)); border-radius: 7px;
  background: var(--card); box-shadow: 0 3px 8px rgba(0,0,0,.12), 0 3px 1px rgba(0,0,0,.04);
  transition: transform .4s var(--spring);
}
[data-scheme=dark] .segmented .thumb { background: #636366; }
.segmented[data-v="1"] .thumb { transform: translateX(100%); }
.segmented[data-v="2"] .thumb { transform: translateX(200%); }
.segmented button.on { font-weight: 600; }

/* ---------- изображение машины ---------- */
.car-pic { position: relative; width: 100%; aspect-ratio: 200 / 82; }
.car-pic img, .car-pic svg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.car-pic img ~ svg { display: none; }
.pic.locked > img, .pic.locked > svg, .pic.locked > .fb { filter: brightness(0); opacity: .16; }
[data-scheme=dark] .pic.locked > img, [data-scheme=dark] .pic.locked > svg, [data-scheme=dark] .pic.locked > .fb { filter: brightness(0) invert(1); opacity: .13; }

/* ---------- гараж ---------- */
.income .big { font-size: 34px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.5px; margin: 2px 0; }
.bar { height: 6px; border-radius: 3px; background: var(--fill); overflow: hidden; margin: 12px 0 14px; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width .6s var(--ios); }
.small { font-size: 13px; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.car-card {
  background: var(--card); border-radius: var(--radius); padding: 12px; text-align: left;
  position: relative; overflow: hidden; transition: transform .25s var(--spring);
}
button.car-card:active { transform: scale(.96); }
.car-card .name { font-weight: 600; font-size: 14px; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.car-card .sub { font-size: 13px; color: var(--hint); margin-top: 1px; }
.car-card .cls {
  position: absolute; top: 10px; left: 10px; font-size: 11px; font-weight: 700;
  min-width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; color: #fff;
}
.car-card.empty {
  display: grid; place-items: center; min-height: 128px; color: var(--hint); font-size: 14px;
  background: transparent; border: 1.5px dashed var(--sep);
}
.car-card.new::after {
  content: 'NEW'; position: absolute; top: 10px; right: 10px; font-size: 10px; font-weight: 700;
  color: #fff; background: var(--bad); padding: 2px 6px; border-radius: 6px;
}

/* ---------- коллекция ---------- */
.filter { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 4px; padding: 0 16px 4px; scrollbar-width: none; }
.filter::-webkit-scrollbar { display: none; }
.filter button {
  flex: none; padding: 7px 13px; border-radius: 999px; background: var(--card); font-size: 14px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px; transition: background .25s, color .25s;
}
.filter button.on { background: var(--text); color: var(--bg); }

/* ---------- экран кейса ---------- */
.case-screen { display: flex; flex-direction: column; align-items: center; min-height: calc(100vh - 190px); }
.case-switch {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: 999px; background: var(--card);
  font-size: 17px; font-weight: 600; transition: transform .25s var(--spring);
}
.case-switch:active { transform: scale(.95); }
.case-switch svg { width: 12px; height: 12px; opacity: .5; }
.case-switch .emo { margin-right: 2px; }
/* сцена: серая машина / рулетка / выпавшая машина */
.stage { position: relative; flex: 1; width: 100%; min-height: 330px; }
.stage-item {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  transition: transform .5s var(--ios), opacity .4s;
}
.stage-item.leave { transform: translateX(115%); opacity: 0; }
.stage-item.fade { opacity: 0; transform: scale(.92); }
.stage-item.appear { animation: appear .35s var(--ios); }
@keyframes appear { from { opacity: 0; transform: scale(.92); } }
.stage-pic { position: relative; width: min(240px, 66%); transition: width .7s var(--spring); }
.stage-pic.big { width: min(360px, 100%); }
.stage-pic .q {
  position: absolute; left: 50%; top: 44%; transform: translate(-50%, -50%);
  font-size: 48px; font-weight: 700; color: var(--hint); line-height: 1; transition: opacity .3s;
}
.stage-pic .glow {
  position: absolute; inset: -35% -12%; pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--rc) 38%, transparent), transparent);
  opacity: 0; transition: opacity .7s;
}
.result.ready .glow, .morph.s2 .glow { opacity: 1; }
.result-info { text-align: center; margin-top: 18px; opacity: 0; transform: translateY(10px); transition: opacity .45s, transform .45s var(--ios); }
.result.ready .result-info { opacity: 1; transform: none; }
.result-info .title { font-size: 24px; font-weight: 700; }

/* быстрое открытие: силуэт перетекает в выпавшую машину */
.morph .layer { transition: opacity .45s; }
.morph .layer.b { position: absolute; inset: 0; opacity: 0; }
.morph.s1 .layer.a { opacity: 0; }
.morph.s1 .layer.b { opacity: 1; }
.morph.s1 .q { opacity: 0; }
.morph .pic > img, .morph .pic > .fb { transition: filter .8s ease, opacity .8s ease; }

/* рулетка на сцене */
.stage .roulette {
  position: absolute; left: -16px; right: -16px; top: 50%; margin: 0;
  transform: translate(-60px, -50%); opacity: 0;
  transition: opacity .35s, transform .55s var(--ios);
}
.stage .roulette.in { opacity: 1; transform: translate(0, -50%); }
.stage .roulette.out { opacity: 0; transition: opacity .3s; }

.case-actions { width: 100%; transition: opacity .3s; }
.case-actions.hide { opacity: 0; pointer-events: none; }
.case-actions .note { text-align: center; font-size: 13px; color: var(--hint); margin-top: 10px; }
.btn-row { display: flex; gap: 10px; margin-top: 10px; }
.btn-row > .btn { flex: 1 1 0; min-width: 0; }
.btn-row .btn + .btn { margin-top: 0; }
.btn-row .btn { font-size: 15px; padding: 13px 8px; }
body.spinning .tabbar { opacity: .9; }
body.spinning .case-switch { pointer-events: none; opacity: .5; }
body.spinning .menu-back { pointer-events: none; opacity: .5; }

/* iOS-переключатель (switch) */
.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 14px; padding: 9px 12px 9px 16px; background: var(--card); border-radius: 12px; font-size: 16px;
}
.switch { width: 51px; height: 31px; border-radius: 16px; background: var(--fill); position: relative; flex: none; transition: background .25s; }
.switch::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff;
  box-shadow: 0 3px 8px rgba(0,0,0,.15), 0 1px 1px rgba(0,0,0,.16); transition: transform .35s var(--spring);
}
.switch.on { background: var(--ok); }
.switch.on::after { transform: translateX(20px); }

/* ---------- шторка (bottom sheet) ---------- */
.backdrop {
  position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.35);
  opacity: 0; pointer-events: none; transition: opacity .5s var(--ios);
}
body.sheet-open .backdrop { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; z-index: 21; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 600px;
  max-height: 90vh; display: flex; flex-direction: column;
  background: var(--bg); border-radius: 14px 14px 0 0;
  transform: translateY(105%); transition: transform .5s var(--ios);
  box-shadow: 0 -10px 40px rgba(0,0,0,.2);
}
body.sheet-open .sheet { transform: translateY(0); }
.sheet.dragging { transition: none; }
.grabber-zone { padding: 6px 0 4px; touch-action: none; cursor: grab; flex: none; }
.grabber { width: 36px; height: 5px; border-radius: 3px; background: var(--sep); margin: 0 auto; }
.sheet-body { overflow-y: auto; padding: 4px 16px calc(20px + env(safe-area-inset-bottom)); overscroll-behavior: contain; }
.sheet-nav { display: flex; align-items: center; justify-content: space-between; padding: 6px 0 12px; }
.sheet-nav .t { font-size: 17px; font-weight: 600; flex: 1; text-align: center; }
.sheet-nav .x {
  width: 30px; height: 30px; border-radius: 50%; background: var(--fill); color: var(--hint);
  display: grid; place-items: center; font-size: 15px; font-weight: 700;
}
.sheet-nav .sp { width: 30px; }

/* сгруппированные списки как в Настройках iOS */
.list { background: var(--card); border-radius: 12px; overflow: hidden; }
.list-row {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 10px 16px; position: relative; transition: background .15s;
}
.list-row:active { background: var(--fill); }
.list-row + .list-row::before { content: ''; position: absolute; top: 0; left: 62px; right: 0; height: .5px; background: var(--sep); }
.list-row .ic { width: 34px; height: 34px; display: grid; place-items: center; flex: none; }
.list-row .info { flex: 1; min-width: 0; }
.list-row .t { font-size: 17px; }
.list-row .s { display: flex; gap: 4px; margin-top: 3px; flex-wrap: wrap; }
.list-row .r { color: var(--hint); font-size: 15px; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.list-row .check { color: var(--accent); font-weight: 700; width: 14px; }

/* карточка машины в шторке */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0; }
.stat { background: var(--card); border-radius: 12px; padding: 12px 6px; text-align: center; }
.stat .v { font-weight: 600; font-size: 16px; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 12px; color: var(--hint); margin-top: 2px; }
.car-head { text-align: center; }
.car-head .title { font-size: 22px; font-weight: 700; }
.car-head .tags { display: flex; gap: 6px; justify-content: center; margin-top: 8px; }

/* ---------- рулетка ---------- */
.roulette {
  position: relative; overflow: hidden; height: 132px; margin: 8px -16px 0;
  mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
}
.roulette::after {
  content: ''; position: absolute; left: 50%; top: 4px; bottom: 4px; width: 3px; margin-left: -1.5px;
  background: var(--accent); border-radius: 2px;
}
.strip { display: flex; gap: 8px; position: absolute; top: 12px; left: 0; will-change: transform; }
.r-item {
  flex: none; width: 104px; height: 108px; border-radius: 14px; background: var(--card);
  padding: 10px 6px 8px; display: flex; flex-direction: column; justify-content: center; position: relative;
}
.r-item::after { content: ''; position: absolute; left: 14px; right: 14px; bottom: 6px; height: 3px; border-radius: 2px; background: var(--rc); }
.r-item .n { font-size: 10px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 6px; color: var(--hint); }


/* ---------- уведомление ---------- */
.toast {
  position: fixed; left: 50%; top: calc(12px + var(--sat) + var(--cst)); z-index: 40;
  transform: translate(-50%, -150%);
  background: var(--glass); color: var(--text);
  -webkit-backdrop-filter: blur(22px) saturate(190%); backdrop-filter: blur(22px) saturate(190%);
  box-shadow: inset 0 1px 0 var(--glass-hi), var(--shadow);
  padding: 11px 18px; border-radius: 999px; font-size: 15px; font-weight: 600;
  pointer-events: none; transition: transform .5s var(--spring), opacity .3s; max-width: 90vw; text-align: center;
  opacity: 0;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

.empty-state { text-align: center; padding: 34px 16px; }
.empty-state h3 { margin: 12px 0 6px; font-size: 20px; }
.empty-state p { margin: 0 0 18px; }

/* ===================== ШАГ 2: детали и тюнинг ===================== */

/* картинка детали: фото или эмодзи слота */
.part-pic { position: relative; width: 100%; aspect-ratio: 1 / 1; container-type: inline-size; }
.part-pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.part-pic .fb { position: absolute; inset: 0; display: grid; place-items: center; }
.part-pic .fb img.emo { position: static; width: 64%; height: 64%; }
.part-pic .fb span.emo { font-size: 58cqw !important; }
.part-pic img:not(.emo) ~ .fb { display: none; }

/* деталь на сцене кейса и в ленте рулетки */
.stage-item.part .stage-pic { width: min(150px, 42%); }
.stage-item.part .stage-pic.big { width: min(210px, 58%); }
.r-item.part .part-pic { width: 64px; margin: 0 auto; }
.case-screen.in-shop { min-height: calc(100vh - 250px); }

/* награды из контейнеров: звёзды, деньги, опыт, випка */
.reward-pic { position: relative; width: 100%; aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; }
.reward-pic .fb { display: flex; align-items: center; justify-content: center; font-size: 58px; }
.r-item .reward-pic { width: 56px; height: 56px; margin: 0 auto; }
.r-item .reward-pic .fb { font-size: 36px; }
.stage-item.stars .stage-pic,
.stage-item.money .stage-pic,
.stage-item.xp .stage-pic,
.stage-item.vip .stage-pic {
  width: min(160px, 45%);
}
.stage-item.stars .stage-pic.big,
.stage-item.money .stage-pic.big,
.stage-item.xp .stage-pic.big,
.stage-item.vip .stage-pic.big {
  width: min(220px, 60%);
}
.mtile .reward-pic { width: 64px; height: 64px; margin: 0 auto; }
.mtile .reward-pic .fb { font-size: 40px; }

/* значок тюнинга на карточке машины */
.car-card .tuned {
  position: absolute; top: 10px; right: 10px; font-size: 11px; font-weight: 600;
  padding: 2px 6px; border-radius: 6px; background: var(--fill); color: var(--hint);
  display: inline-flex; align-items: center; gap: 3px;
}
.stat .plus { color: var(--ok); font-weight: 600; }

/* строки списков для деталей */
.list-row.static:active { background: none; }
.list-row.disabled .info, .list-row.disabled .ic { opacity: .45; }
.list-row .sub { font-size: 13px; color: var(--hint); margin-top: 2px; }
.list-row .t .muted { font-weight: 400; }
.chev { width: 7px; height: 12px; opacity: .3; flex: none; }
.part-ic {
  width: 40px !important; height: 40px !important; border-radius: 10px; padding: 4px;
  background: color-mix(in srgb, var(--rc) 18%, transparent);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--rc) 55%, transparent);
}
.list-row + .list-row::before { left: 64px; }
.pills { display: flex; gap: 6px; flex: none; }
.pill {
  flex: none; padding: 7px 13px; border-radius: 999px; font-size: 14px; font-weight: 600;
  background: var(--accent); color: var(--on-accent); transition: transform .2s var(--spring), opacity .2s;
}
.pill.gray { background: var(--fill); color: var(--accent); }
.pill:active { transform: scale(.94); }
.pill:disabled { opacity: .35; }
.merge-dot { font-size: 12px; font-weight: 700; color: #fff; background: var(--ok); padding: 2px 7px; border-radius: 999px; }

/* шапка шторки с кнопкой «Назад» */
.sheet-nav .back {
  display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-size: 17px; min-width: 30px;
}
.sheet-nav .back svg { width: 9px; height: 15px; }
.sheet-body.swap { animation: swap .3s var(--ios); }
@keyframes swap { from { opacity: 0; transform: translateX(14px); } }

/* анимация слияния 3 → 1 */
.merge-fx { position: relative; height: 230px; margin-bottom: 8px; }
.merge-fx .trio { position: absolute; inset: 0; }
.merge-fx .m {
  position: absolute; top: 40px; left: 50%; width: 72px; margin-left: -36px; padding: 6px; border-radius: 16px;
  background: color-mix(in srgb, var(--c) 18%, transparent);
  animation: m-join .55s var(--ios) forwards;
}
.merge-fx .m0 { --x: -110px; }
.merge-fx .m2 { --x: 110px; }
.merge-fx .m1 { --x: 0px; }
@keyframes m-join {
  from { transform: translateX(var(--x)); }
  70%  { transform: translateX(0) scale(.9); opacity: 1; }
  to   { transform: translateX(0) scale(.4); opacity: 0; }
}
.merge-fx .outcome {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  text-align: center; opacity: 0; animation: m-out .5s var(--spring) .5s forwards;
}
.merge-fx .big-pic {
  width: 110px; padding: 10px; border-radius: 24px; margin-bottom: 10px;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--rc) 45%, transparent), transparent);
}
.merge-fx .title { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
@keyframes m-out { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
.merge-fx.lose .big-pic { background: none; filter: grayscale(1) brightness(.6); opacity: .5; }
.merge-fx.lose .outcome { animation: m-out .5s var(--spring) .5s forwards, shake .4s ease 1s; }
@keyframes shake { 25% { translate: -8px 0; } 50% { translate: 7px 0; } 75% { translate: -4px 0; } }

.part-ic.plain { background: var(--fill); box-shadow: none; }

/* подтверждение продажи повторным нажатием */
.btn.armed, .pill.armed {
  background: var(--bad) !important; color: #fff !important;
  animation: armed .35s var(--spring);
}
@keyframes armed { 0% { transform: scale(1); } 40% { transform: scale(.95); } 100% { transform: scale(1); } }

/* ===================== несколько кейсов и автопродажа ===================== */

/* выбор количества ×1 ×3 ×5 ×10 */
.count-picker { position: relative; display: grid; grid-template-columns: repeat(var(--n, 4), 1fr); background: var(--fill); padding: 3px; border-radius: 11px; margin-bottom: 10px; }
.count-picker .thumb { position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc((100% - 6px) / var(--n, 4)); border-radius: 8px;
  background: var(--card); box-shadow: 0 2px 6px rgba(0,0,0,.12); transform: translateX(calc(var(--i, 0) * 100%)); transition: transform .35s var(--ios); }
[data-scheme=dark] .count-picker .thumb { background: #636366; }
.count-picker button { position: relative; z-index: 1; padding: 7px 0; border-radius: 8px; font-size: 15px; font-weight: 600; color: var(--hint); transition: color .25s, transform .2s var(--spring); }
.count-picker button.on { color: var(--text); }
.count-picker button:active { transform: scale(.93); }

/* настройки под кнопкой: быстрое открытие, автопродажа */
.list.settings { margin-top: 14px; }
.list-row.setting { padding: 9px 12px 9px 16px; min-height: 49px; }
.list-row.setting .t { font-size: 16px; }
.list-row.setting + .list-row.setting::before { left: 16px; }
.as-body { transition: opacity .3s; }
.as-body.off { opacity: .4; pointer-events: none; }
.multi-sum { text-align: center; font-size: 14px; color: var(--hint); margin-top: 10px; }
.multi-sum b { color: var(--text); }

/* сетка нескольких деталей */
.stage-item.multi { padding: 0 2px; }
.mgrid { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; width: 100%; }
.mtile {
  position: relative; width: calc((100% - 16px) / 3); padding: 10px 8px 8px; border-radius: 16px;
  background: var(--card); transition: background .4s, opacity .4s, transform .35s var(--spring);
}
.mgrid.n10 .mtile { width: calc((100% - 32px) / 5); padding: 7px 5px 6px; border-radius: 12px; }
.mtile .layer { transition: opacity .3s; }
.mtile .layer.b { position: absolute; top: 10px; left: 8px; right: 8px; opacity: 0; }
.mgrid.n10 .mtile .layer.b { top: 7px; left: 5px; right: 5px; }
.mtile .pic > img, .mtile .pic > .fb { transition: filter .45s ease, opacity .45s ease; }
.mtile .q { position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%); font-size: 22px; font-weight: 700; color: var(--hint); transition: opacity .25s; }
.mtile .tl {
  position: absolute; top: 6px; left: 6px; z-index: 1; font-size: 10px; font-weight: 700; color: #fff;
  min-width: 17px; height: 17px; border-radius: 5px; display: grid; place-items: center;
  background: var(--rc); opacity: 0; transition: opacity .3s;
}
.mtile .mn { font-size: 11px; text-align: center; color: var(--hint); margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; transition: opacity .3s; }
.mgrid.n10 .mtile .mn { font-size: 9px; }
.mtile.s1 .layer.a, .mtile.s1 .q { opacity: 0; }
.mtile.s1 .layer.b { opacity: 1; }
.mtile.s2 { background: color-mix(in srgb, var(--rc) 22%, var(--card)); transform: scale(1.04); }
.multi.ready .mtile.s2, .mtile.s2.done { transform: none; }
.mtile.s2 .tl, .mtile.s2 .mn { opacity: 1; }
.mtile.sold.s2 { opacity: .45; }
.mtile.sold .mn { color: var(--ok); font-weight: 600; }

/* выбор конкретной детали в шторке кейсов */
.slot-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.slot-tile {
  background: var(--card); border-radius: 14px; padding: 10px 6px 8px; text-align: center;
  box-shadow: inset 0 0 0 2px transparent; transition: box-shadow .25s, transform .2s var(--spring);
}
.slot-tile:active { transform: scale(.95); }
.slot-tile.on { box-shadow: inset 0 0 0 2px var(--accent); }
.slot-tile .st-pic { width: 52px; margin: 0 auto; }
.slot-tile .any { width: 52px; height: 52px; display: grid; place-items: center; }
.slot-tile .st-n { font-size: 12px; margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot-tile.on .st-n { color: var(--accent); font-weight: 600; }
.case-switch { max-width: 100%; }
.case-switch .cs-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.btn.sell-all { margin-top: 10px; }

/* ===================== ШАГ 3: гонки ===================== */

/* выбор своей машины — горизонтальная лента */
.race-cars { display: flex; gap: 10px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 6px; scrollbar-width: none; }
.race-cars::-webkit-scrollbar { display: none; }
.rc-card {
  flex: none; width: 138px; background: var(--card); border-radius: 16px; padding: 10px; text-align: left; position: relative;
  box-shadow: inset 0 0 0 2px transparent; transition: box-shadow .25s, transform .2s var(--spring);
}
.rc-card.on { box-shadow: inset 0 0 0 2px var(--accent); }
.rc-card:active { transform: scale(.96); }
.rc-card .cls { position: absolute; top: 8px; left: 8px; font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; color: #fff; }
.rc-card .name { font-weight: 600; font-size: 13px; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-card .sub { font-size: 12px; color: var(--hint); }
.fuel { display: flex; gap: 3px; margin-top: 6px; }
.fuel i { flex: 1; height: 4px; border-radius: 2px; background: var(--fill); }
.fuel i.on { background: var(--ok); }
.fuel-card { margin-top: 10px; }

/* соперники */
.opp .opp-pic, .rr-row .opp-pic { width: 76px; flex: none; }
.chip.diff { color: var(--dc); background: color-mix(in srgb, var(--dc) 16%, transparent); font-weight: 600; }
.chip b { color: var(--text); }
.list-row .r.col { flex-direction: column; align-items: flex-end; gap: 2px; }
.prize { color: var(--ok); font-size: 15px; }
.fee { font-size: 12px; color: var(--hint); }
.list-row .s { margin-top: 5px; }

/* заезд: ТВ-табло */
body.racing .tabbar { transform: translateX(-50%) translateY(140%); }
.race { display: flex; flex-direction: column; gap: 14px; padding-top: 2px; }
.tvb {
  padding: 12px 12px 10px; border-radius: 18px; background: #0d0f14; color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); font-variant-numeric: tabular-nums;
}
.tv-head { display: flex; justify-content: space-between; padding: 0 2px 10px; border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 10px; }
.tv-col { display: flex; flex-direction: column; }
.tv-col.r { text-align: right; }
.tv-l { font-size: 10px; text-transform: uppercase; letter-spacing: .6px; color: rgba(255,255,255,.5); }
.tv-col b { font-size: 24px; font-weight: 700; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
#tv-gap.ahead { color: #30d158; }
#tv-gap.behind { color: #ff453a; }
.tv-row { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-radius: 12px; transition: background .3s, box-shadow .3s; }
.tv-row + .tv-row { margin-top: 4px; }
.tv-car { width: 78px; flex: none; }
.tv-info { flex: 1; min-width: 0; }
.tv-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; margin-bottom: 6px; }
.tv-top b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-v { color: rgba(255,255,255,.7); font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; white-space: nowrap; }
.tv-bar { position: relative; height: 10px; border-radius: 5px; background: rgba(255,255,255,.1); overflow: hidden; }
.tv-bar .fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 5px; }
#row-you .fill { background: linear-gradient(90deg, var(--accent), #64d2ff); }
#row-bot .fill { background: linear-gradient(90deg, #ff453a, #ff9f0a); }
.tv-bar .tick { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(255,255,255,.35); z-index: 1; }
.tv-bar::after {
  content: ''; position: absolute; right: 0; top: 0; bottom: 0; width: 8px; z-index: 1;
  background: repeating-conic-gradient(#fff 0 25%, #111 0 50%) 0 0 / 4px 4px;
}
.tv-marks { position: relative; height: 14px; margin: 6px 4px 0 96px; font-size: 9px; color: rgba(255,255,255,.45); }
.tv-marks span { position: absolute; translate: -50% 0; white-space: nowrap; }
.tv-marks span:last-child { translate: -100% 0; }
.tv-row.winner { background: rgba(48,209,88,.14); box-shadow: inset 0 0 0 1.5px rgba(48,209,88,.6); }
.tv-row.winner .tv-v { color: #30d158; font-weight: 700; }
.tv-row.loser { opacity: .7; }

.lights { display: flex; justify-content: center; gap: 12px; padding: 12px 16px; background: var(--card); border-radius: 999px; align-self: center; transition: opacity .4s, transform .4s var(--ios); }
.lights.gone { opacity: .35; }
.lights i { width: 28px; height: 28px; border-radius: 50%; background: var(--fill); transition: background .1s, box-shadow .1s; }
.lights i.on { background: #ffcc00; box-shadow: 0 0 18px #ffcc00; }
.lights i.g.on { background: #30d158; box-shadow: 0 0 22px #30d158; }

/* спидометр */
.hud { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; background: var(--card); }
.hud .speed { display: flex; align-items: baseline; gap: 4px; min-width: 96px; }
.hud .speed b { font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -1px; }
.hud .speed span { font-size: 13px; color: var(--hint); }
.hud .rpm { flex: 1; height: 8px; border-radius: 4px; background: var(--fill); overflow: hidden; }
.hud .rpm i { display: block; height: 100%; width: 0; border-radius: 4px; background: linear-gradient(90deg, #30d158, #ffd60a 70%, #ff453a); transition: width .08s linear; }
.hud .gear { display: flex; flex-direction: column; align-items: center; min-width: 58px; }
.hud .gear span { font-size: 10px; text-transform: uppercase; color: var(--hint); letter-spacing: .4px; }
.hud .gear b { font-size: 26px; font-weight: 800; line-height: 1; }

.race-msg { text-align: center; font-size: 16px; font-weight: 600; min-height: 21px; }
.race-msg.bad { color: var(--bad); }
.btn.go { padding: 20px; font-size: 22px; font-weight: 800; letter-spacing: 1px; background: var(--ok); }
.btn.go:disabled { opacity: .3; }

/* итог гонки */
.race-result { text-align: center; padding: 18px 0 16px; }
.race-result .rr-title { font-size: 34px; font-weight: 800; }
.race-result.win .rr-title { color: var(--ok); }
.race-result.lose .rr-title { color: var(--bad); }
.rr-money { font-size: 28px; font-weight: 700; margin-top: 10px; font-variant-numeric: tabular-nums; }
.race-result.win .rr-money { color: var(--ok); }
.race-result + .list + .card + .btn { margin-top: 4px; }

/* ===================== ШАГ 4: награды ===================== */
.head-r { display: flex; align-items: center; gap: 8px; }
.gift {
  position: relative; width: 36px; height: 36px; border-radius: 50%; background: var(--card);
  display: grid; place-items: center; transition: transform .25s var(--spring);
}
.gift:active { transform: scale(.9); }
.gift.dot::after {
  content: ''; position: absolute; top: 1px; right: 1px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--bad); box-shadow: 0 0 0 2px var(--bg);
}
.gift.dot .emo { animation: wiggle 2.4s ease-in-out infinite; }
@keyframes wiggle { 0%, 80%, 100% { rotate: 0deg; } 85% { rotate: -14deg; } 90% { rotate: 12deg; } 95% { rotate: -6deg; } }

/* календарь ежедневного бонуса */
.days { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.day {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 2px 7px; border-radius: 12px; background: var(--fill); text-align: center;
}
.day.big { grid-column: span 2; background: color-mix(in srgb, #ff9f0a 18%, var(--fill)); }
.day .dn { font-size: 10px; color: var(--hint); text-transform: uppercase; }
.day .dl { font-size: 11px; font-weight: 600; white-space: nowrap; }
.day.taken { opacity: .45; }
.day.cur { box-shadow: inset 0 0 0 2px var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--card)); }
.day .tick { position: absolute; top: 4px; right: 6px; font-size: 11px; color: var(--ok); font-weight: 700; }

/* показ полученных наград */
.rw-fx { text-align: center; margin-bottom: 6px; }
.rw-title { font-size: 20px; font-weight: 700; margin: 2px 0 12px; }
.rw-items { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.rw-item {
  width: calc((100% - 16px) / 3); min-width: 100px; padding: 10px 6px; border-radius: 16px;
  background: color-mix(in srgb, var(--rc) 16%, var(--card)); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--rc) 45%, transparent);
  animation: rw-in .5s var(--spring) both;
}
@keyframes rw-in { from { opacity: 0; transform: scale(.6) translateY(10px); } }
.rw-emo { height: 52px; display: grid; place-items: center; }
.rw-pic { height: 52px; display: grid; place-items: center; }
.rw-pic .pic { max-height: 52px; }
.rw-pic.part .pic { width: 52px; }
.rw-l { display: flex; flex-direction: column; gap: 4px; align-items: center; margin-top: 6px; font-size: 12px; }
.rw-l b { font-size: 13px; }
.rw-l span { color: var(--hint); font-size: 11px; }

/* цели коллекции */
.goal .goal-bar { margin: 6px 0 0; height: 4px; }
.goal.ready { background: color-mix(in srgb, var(--ok) 10%, var(--card)); }

/* покупка места в гараже */
.car-card.buy { border-color: color-mix(in srgb, var(--accent) 45%, transparent); color: var(--accent); }
.car-card.buy:disabled { color: var(--hint); border-color: var(--sep); }
.buy-plus { font-size: 26px; font-weight: 300; line-height: 1; }
.buy-price { font-weight: 700; margin-top: 2px; }
.car-card.buy.armed { color: #fff; background: var(--bad); border-color: var(--bad); }
.list-row.more .t { color: var(--accent); font-size: 15px; text-align: center; }

/* секретные машины (класс X) */
.car-card.secret { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, #d4a017 45%, transparent); }
.car-card.secret.got { background: linear-gradient(160deg, color-mix(in srgb, #d4a017 22%, var(--card)), var(--card) 60%); }
.secret-note { text-align: center; margin-top: 18px; color: var(--hint); }

/* ===================== покраска ===================== */
.paint-dot { width: 14px; height: 14px; border-radius: 50%; display: inline-block; box-shadow: inset 0 0 0 1px rgba(128,128,128,.4); }
.paint-preview { padding: 6px 0 2px; }
.paint-name { text-align: center; font-weight: 600; margin: 4px 0 12px; }
.swatches { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px 4px; margin-bottom: 16px; }
.swatch { display: flex; flex-direction: column; align-items: center; gap: 4px; transition: transform .2s var(--spring); }
.swatch:active { transform: scale(.9); }
.swatch i {
  width: 40px; height: 40px; border-radius: 50%; display: block;
  box-shadow: inset 0 -6px 10px rgba(0,0,0,.25), inset 0 4px 8px rgba(255,255,255,.35), 0 0 0 1px rgba(128,128,128,.3);
}
.swatch i.orig { background: conic-gradient(#c8202a, #f5c518, #7cc11e, #1e5bdc, #6c2bb8, #c8202a); }
.swatch.on i { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
.swatch span { font-size: 10px; color: var(--hint); white-space: nowrap; }
.swatch.on span { color: var(--accent); font-weight: 600; }

/* ===================== музей (витрина) ===================== */
.museum-head b { display: inline-flex; align-items: center; gap: 6px; }
.museum-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.exhibit {
  position: relative; overflow: hidden; border-radius: 18px; padding: 26px 10px 12px; text-align: center;
  background: radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--rc) 22%, #2a2a33), #101015 70%);
  color: #fff; transition: transform .25s var(--spring);
}
.exhibit:active { transform: scale(.96); }
.exhibit .spot {
  position: absolute; left: 50%; top: -20px; width: 140%; height: 120px; translate: -50% 0; pointer-events: none;
  background: radial-gradient(50% 100% at 50% 0%, rgba(255,255,255,.28), transparent 75%);
}
.exhibit .ex-pic { position: relative; z-index: 1; }
.exhibit .pedestal {
  height: 10px; margin: -4px 10px 8px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255,255,255,.35), transparent);
}
.exhibit .ex-name { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exhibit .ex-sub { font-size: 11px; color: rgba(255,255,255,.65); margin-top: 2px; display: flex; align-items: center; justify-content: center; gap: 5px; }
.exhibit.empty {
  display: grid; place-items: center; min-height: 150px; background: transparent; color: var(--hint);
  border: 1.5px dashed var(--sep); font-size: 14px;
}
.exhibit.empty.buy { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.exhibit.empty.buy:disabled { color: var(--hint); border-color: var(--sep); }
.exhibit.empty.buy.armed { color: #fff; background: var(--bad); border-color: var(--bad); }
.exhibit-big {
  position: relative; overflow: hidden; border-radius: 20px; padding: 34px 14px 6px; margin-top: 14px;
  background: radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--rc) 25%, #2a2a33), #101015 70%);
}
.exhibit-big .spot { position: absolute; left: 50%; top: -30px; width: 120%; height: 180px; translate: -50% 0; background: radial-gradient(50% 100% at 50% 0%, rgba(255,255,255,.3), transparent 75%); }
.exhibit-big .pic { position: relative; z-index: 1; }
.exhibit-big .pedestal { height: 14px; margin: -6px 20px 10px; border-radius: 50%; background: radial-gradient(closest-side, rgba(255,255,255,.4), transparent); }
.list-row[disabled] { opacity: .5; }

/* ===================== админ-панель ===================== */
.admin-note { margin: 0 16px 4px; }
.admin-card { display: flex; flex-direction: column; gap: 10px; }
.pills.wrap { flex-wrap: wrap; }
.pill.danger { background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); }
.pill.danger.armed { background: var(--bad) !important; color: #fff !important; }
.admin-row { display: flex; gap: 8px; align-items: center; }
.admin-input {
  flex: 1; min-width: 0; font: inherit; font-size: 15px; color: var(--text); background: var(--fill);
  border: 0; border-radius: 10px; padding: 9px 11px; outline: none; -webkit-user-select: text; user-select: text;
}
.admin-input.short { flex: 0 0 auto; max-width: 140px; }
.admin-input.area { min-height: 64px; resize: vertical; font-size: 12px; font-family: ui-monospace, Menlo, Consolas, monospace; }
.admin-input:focus { box-shadow: 0 0 0 2px var(--accent); }
.admin-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.admin-stats div { background: var(--fill); border-radius: 10px; padding: 8px; text-align: center; display: flex; flex-direction: column; }
.admin-stats b { font-size: 16px; }
.admin-stats span { font-size: 11px; color: var(--hint); }

.loading { display: grid; place-items: center; gap: 10px; padding-top: 30vh; text-align: center; }

/* ===================== профиль и уровни ===================== */
.head-l { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 auto; }
.head-l .large-title { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar {
  position: relative; display: block; flex: 0 0 38px; width: 38px; height: 38px; min-width: 38px;
  padding: 0; transition: transform .25s var(--spring);
}
.avatar > .ava { position: absolute; inset: 0; }
.avatar:active { transform: scale(.9); }
.avatar.dot::after {
  content: ''; position: absolute; top: 0; right: 0; width: 10px; height: 10px; border-radius: 50%;
  background: var(--bad); box-shadow: 0 0 0 2px var(--bg);
}
/* кольцо уровня: заполнение = прогресс опыта */
.ava {
  --lc: #8e8e93; --p: 0%;
  position: relative; width: 38px; height: 38px; border-radius: 50%; padding: 3px;
  background: conic-gradient(var(--lc) var(--p), color-mix(in srgb, var(--lc) 22%, transparent) 0);
}
.ava-in { width: 100%; height: 100%; border-radius: 50%; background: var(--card); display: grid; place-items: center; overflow: hidden; position: relative; }
.ava-in .ava-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; z-index: 1; }
.ava .sil { width: 78%; height: 78%; fill: var(--text); opacity: .28; margin-top: 18%; z-index: 0; }
.ava-lv {
  position: absolute; right: -4px; bottom: -3px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
  background: var(--lc); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center;
  line-height: 1;
  box-shadow: 0 0 0 2.5px var(--bg, #060a12);
  z-index: 10;
  pointer-events: none;
}
.ava.big { width: 88px; height: 88px; padding: 5px; margin: 0 auto; }
.ava.big .ava-lv {
  min-width: 28px; height: 28px; border-radius: 14px; font-size: 14px;
  right: -4px; bottom: -4px;
  box-shadow: 0 0 0 3.5px var(--bg2, #0c121d), 0 2px 8px rgba(0, 0, 0, 0.5);
  z-index: 10;
}
.prof-head { text-align: center; padding: 4px 0 6px; }
.prof-name { font-size: 22px; font-weight: 700; margin-top: 10px; }
.prof-id { opacity: .55; cursor: pointer; font-variant-numeric: tabular-nums; }
.prof-bar { margin: 10px 24px 6px; height: 8px; }
.prof-bar > i { background: var(--lc); }
.quest.ready { background: color-mix(in srgb, var(--ok) 10%, var(--card)); }
.quest .goal-bar { margin: 6px 0 0; height: 4px; }
.prof-stats { display: grid; }
.lvl-up { text-align: center; padding: 6px 0 14px; }
.lvl-burst { position: relative; display: inline-block; padding: 16px; border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--lc) 45%, transparent), transparent); animation: rw-in .6s var(--spring) both; }
.lvl-title { font-size: 30px; font-weight: 800; margin-top: 6px; color: var(--lc); }

/* технические работы и админка игроков */
body.maintenance .tabbar, body.maintenance .head-r, body.maintenance .avatar { display: none; }
.empty-state.maint { margin-top: 18vh; }
.adm-target { margin-bottom: 4px; }
.adm-target .row b { font-size: 17px; }
.adm-cars { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- авторынок: категории, выкуп у продавцов, торг, вторичка ---------- */
.dlr-market-root {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.dlr-main-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 4px 0 16px;
}
.dlr-main-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px 10px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--text);
  text-align: center;
  cursor: pointer;
  transition: all .16s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}
.dlr-main-btn:active {
  transform: scale(0.97);
}
.dlr-main-btn.on {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, var(--card));
  box-shadow: 0 4px 18px color-mix(in srgb, var(--accent) 24%, transparent), inset 0 0 12px color-mix(in srgb, var(--accent) 10%, transparent);
}
.dlr-main-btn.on .dlr-main-btn-t {
  color: #fff;
}
.dlr-main-btn-ic {
  font-size: 26px;
  margin-bottom: 6px;
  line-height: 1;
}
.dlr-main-btn-t {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
}
.dlr-main-btn-sub {
  font-size: 11px;
  color: var(--hint);
  margin-top: 3px;
}
.dlr-classes-block {
  padding: 16px 14px;
  border-radius: 20px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  margin-bottom: 16px;
}
.dlr-classes-head {
  text-align: center;
  margin-bottom: 14px;
}
.dlr-classes-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  padding: 3px 8px;
  border-radius: 8px;
  margin-bottom: 6px;
}
.dlr-classes-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.2px;
}
.dlr-classes-subtitle {
  font-size: 12px;
  color: var(--hint);
  margin-top: 3px;
}
.dlr-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0;
  width: 100%;
}
.dlr-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px 10px 14px;
  border-radius: 16px;
  background: var(--fill);
  border: 1px solid color-mix(in srgb, var(--cc) 28%, var(--line));
  color: var(--text);
  cursor: pointer;
  transition: all .16s ease;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.dlr-tile.locked {
  opacity: 0.78;
}
.dlr-tile.locked .dlr-tile-arrow {
  color: var(--hint);
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}
.dlr-tile.armed {
  border-color: var(--bad);
  box-shadow: 0 0 16px color-mix(in srgb, var(--bad) 45%, transparent);
  transform: scale(1.02);
  background: color-mix(in srgb, var(--bad) 10%, var(--card));
}
.dlr-tile.armed .dlr-tile-arrow {
  background: rgba(255, 59, 48, 0.18);
  color: var(--bad);
  border-color: var(--bad);
  font-weight: 800;
}
.dlr-tile:active {
  transform: scale(0.96);
}
.dlr-tile::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--cc);
  box-shadow: 0 0 10px var(--cc);
}
.dlr-tile-icon {
  font-size: 28px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--cc) 18%, var(--card));
  border: 1px solid color-mix(in srgb, var(--cc) 35%, transparent);
  line-height: 1;
}
.dlr-tile-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 3px;
}
.dlr-tile-sub {
  font-size: 11px;
  font-weight: 500;
  color: var(--hint);
  line-height: 1.25;
}
.dlr-tile-arrow {
  margin-top: 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--cc);
  background: color-mix(in srgb, var(--cc) 12%, transparent);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid color-mix(in srgb, var(--cc) 25%, transparent);
}
.dlr-offer-screen {
  animation: enter .2s ease;
}
.dlr-offer-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.dlr-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s ease;
}
.dlr-back-btn:active {
  transform: scale(0.96);
}
.dlr-cur-class-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--cc) 14%, var(--card));
  border: 1px solid color-mix(in srgb, var(--cc) 32%, transparent);
  font-size: 13px;
}
.dlr-loading-card {
  padding: 36px 16px;
  text-align: center;
}
.dlr-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: dlr-spin .8s linear infinite;
  margin: 0 auto 12px;
}
@keyframes dlr-spin {
  to { transform: rotate(360deg); }
}
.dlr-loading-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}
.dlr-stats-container {
  animation: enter .2s ease;
}
.dlr-profit-hero {
  text-align: center;
  padding: 18px 14px;
  margin-bottom: 12px;
  background: var(--card);
  border-radius: 18px;
  border: 1px solid var(--line);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}
.dlr-profit-badge {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--hint);
  margin-bottom: 4px;
}
.dlr-profit-val {
  font-size: 28px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
}
.dlr-profit-val.plus {
  color: var(--ok);
}
.dlr-profit-val.bad {
  color: var(--bad);
}
.dlr-profit-desc {
  margin-top: 4px;
}
.dlr-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.dlr-stat-box {
  background: var(--card);
  border-radius: 16px;
  padding: 14px 10px;
  border: 1px solid var(--line);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.dlr-stat-icon {
  font-size: 20px;
  margin-bottom: 4px;
  line-height: 1;
}
.dlr-stat-val {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
}
.dlr-stat-lbl {
  font-size: 11px;
  color: var(--hint);
  margin-top: 3px;
}
.car-prep-sheet {
  animation: enter .2s ease;
}
.car-prep-row {
  padding: 8px 14px;
  gap: 10px;
  transition: background .15s ease;
}
.car-prep-row .info {
  flex: 1;
  min-width: 0;
}
.car-prep-row .info .t {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.car-prep-row .info .sub {
  font-size: 12px;
  margin-top: 2px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.car-prep-row .r {
  flex: none;
  min-width: 146px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}
.car-prep-row .pill {
  width: 146px;
  min-width: 146px;
  max-width: 146px;
  box-sizing: border-box;
  text-align: center;
  justify-content: center;
  display: inline-flex;
  align-items: center;
  padding: 8px 6px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.prep-timer-btn,
.car-prep-row .pill.prep-timer-btn:disabled {
  opacity: 1 !important;
  background: rgba(255, 159, 10, 0.16) !important;
  color: #ff9f0a !important;
  border: 1px solid rgba(255, 159, 10, 0.45) !important;
  cursor: wait !important;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.3px;
  user-select: none;
}
.prep-blocked-btn,
.car-prep-row .pill.prep-blocked-btn:disabled {
  opacity: 0.42 !important;
  filter: grayscale(0.5);
  cursor: not-allowed !important;
  pointer-events: none;
}
.sale-timer-btn,
.btn.sale-timer-btn:disabled {
  opacity: 1 !important;
  background: rgba(255, 159, 10, 0.16) !important;
  color: #ff9f0a !important;
  border: 1px solid rgba(255, 159, 10, 0.45) !important;
  cursor: wait !important;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.3px;
  user-select: none;
}
.car-prep-row.done {
  background: color-mix(in srgb, var(--ok) 6%, var(--card));
}
.car-prep-row.done .sub {
  color: var(--ok);
}
.dlr-prep-summary {
  border-radius: 16px;
  border: 1px solid var(--line);
}
.dlr-categories {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 8px 0 14px;
  width: 100%;
}
.dlr-cat-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: all .15s ease;
  box-sizing: border-box;
}
.dlr-cat-btn:active {
  transform: scale(0.985);
}
.dlr-cat-btn.on {
  border-color: var(--cc);
  background: color-mix(in srgb, var(--cc) 12%, var(--card));
  box-shadow: 0 0 16px color-mix(in srgb, var(--cc) 22%, transparent);
}
.dlr-cat-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.dlr-cat-icon {
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--cc) 18%, var(--fill));
}
.dlr-cat-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.dlr-cat-range {
  font-size: 12px;
  color: var(--hint);
  margin-top: 1px;
}
.dlr-cat-badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--cc);
}
.dlr-cls button { flex: none; display: flex; align-items: center; gap: 6px; }
.dlr-cls .dlr-sub { font-size: 11px; font-weight: 600; opacity: .75; }
.dlr-card { background: var(--card); border-radius: 14px; padding: 12px 14px; margin: 10px 0; text-align: center;
  box-shadow: 0 0 22px color-mix(in srgb, var(--rc) 14%, transparent); }
.dlr-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.dlr-seller { font-size: 12px; color: var(--hint); }
.dlr-name { font-size: 19px; font-weight: 800; margin-top: 6px; }
.dlr-price { margin: 4px 0 10px; font-size: 24px; font-variant-numeric: tabular-nums; }
.dlr-price .mk-d { font-size: 13px; margin-left: 6px; }
.dlr-price.big { font-size: 30px; }
.dlr-checks { justify-content: center; margin-bottom: 4px; }
.dlr-body.warn .sub { color: var(--bad); }
.dlr-body.bad .sub { color: var(--bad); }
.dlr-body .r b.bad { color: var(--bad); } .dlr-body .r b.ok { color: var(--ok); }
.dlr-hist.bad .t { color: var(--bad); } .dlr-hist.good .t { color: var(--ok); }
.dlr-sell-card { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 12px; padding: 10px 12px; }
.dlr-sell-card .mk-pic { width: 64px; }
.dlr-sell-card .info { min-width: 0; flex: 1; }
.dlr-sell-card .t { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dlr-sell-card .dlr-prep-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.dlr-sell-card .dlr-offer { margin-top: 6px; font-size: 13px; background: var(--fill); border-radius: 8px; padding: 6px 8px; }
.dlr-actions { display: flex; flex-direction: column; gap: 6px; flex: none; }
.dlr-actions .pill { padding: 6px 10px; }
.dlr-offer-card { text-align: center; margin-bottom: 12px; }
.dlr-active-offer { display: block; text-align: left; margin: 10px 0; cursor: pointer; }

/* Реестр сделок, финансовая аналитика перекупов */
.dlr-deal-card {
  background: var(--card);
  border-radius: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  margin-bottom: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.dlr-deal-formula {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  background: var(--fill);
  border-radius: 10px;
  padding: 8px 6px;
  margin: 8px 0;
  text-align: center;
}
.dlr-deal-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dlr-deal-col b {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.dlr-formula-card {
  background: color-mix(in srgb, var(--accent) 8%, var(--card));
  border: 1px dashed color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.dlr-formula-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}
.dlr-formula-text {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text);
}
.dlr-loan-card {
  background: var(--card);
  border-radius: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.dlr-param-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 6px 0 10px;
}
.dlr-diag-prompt {
  background: color-mix(in srgb, var(--accent) 10%, var(--card));
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 14px;
  padding: 12px;
  margin: 10px 0;
}
.dlr-haggle-prompt {
  background: color-mix(in srgb, #ff9f0a 8%, var(--card));
  border: 1px solid color-mix(in srgb, #ff9f0a 28%, transparent);
  border-radius: 14px;
  padding: 12px;
  margin: 10px 0;
}
.dlr-diag-btn {
  width: 100%;
  font-weight: 700;
}
.dlr-diag-report {
  background: var(--card);
  border-radius: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  margin: 10px 0;
  text-align: left;
}
.dlr-diag-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  background: var(--fill);
  padding: 8px 10px;
  border-radius: 10px;
  margin-bottom: 8px;
}
.dlr-diag-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
}
.dlr-diag-cell b {
  font-size: 11px;
  line-height: 1.2;
}
.dlr-diag-defects {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dlr-defect-item {
  background: color-mix(in srgb, var(--bad) 8%, var(--fill));
  border-left: 3px solid var(--bad);
  padding: 6px 8px;
  border-radius: 6px;
}
.defect-row {
  border: 1px solid rgba(255, 69, 58, 0.45) !important;
  background: rgba(255, 69, 58, 0.08) !important;
}
.defect-slot-row {
  border: 1px solid rgba(255, 69, 58, 0.5) !important;
  background: rgba(255, 69, 58, 0.09) !important;
  border-radius: 12px;
}
.stat .minus {
  color: var(--bad, #ff453a);
}
.chip.bad {
  color: var(--bad, #ff453a);
  border-color: rgba(255, 69, 58, 0.4);
  background: rgba(255, 69, 58, 0.08);
}
.plate-mini {
  display: inline-block;
  padding: 1px 6px;
  background: #fff;
  color: #000;
  font-family: monospace;
  font-size: 11px;
  font-weight: 800;
  border-radius: 4px;
  border: 1px solid #333;
  margin-left: 6px;
  vertical-align: middle;
}

/* ---------- вкладка «Меню»: стеклянные плитки с неоновым свечением ---------- */
.menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding-top: 4px; }
.menu-tile {
  position: relative; overflow: hidden; text-align: left;
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  min-height: 132px; padding: 14px; border-radius: 22px;
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(var(--glow), .28), transparent 60%),
    linear-gradient(160deg, rgba(var(--glow), .14), rgba(var(--glow), .04)),
    var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(var(--glow), .55);
  box-shadow:
    inset 0 1px 0 var(--glass-hi),
    inset 0 0 18px rgba(var(--glow), .18),
    0 0 18px rgba(var(--glow), .35),
    0 6px 20px rgba(0, 0, 0, .12);
  transition: transform .25s var(--spring), box-shadow .3s;
}
/* блик по краю стекла */
.menu-tile::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; padding: 1px;
  background: linear-gradient(135deg, rgba(255,255,255,.7), rgba(255,255,255,0) 35%, rgba(255,255,255,0) 65%, rgba(255,255,255,.3));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.menu-tile:active { transform: scale(.96); box-shadow: inset 0 1px 0 var(--glass-hi), 0 0 28px rgba(var(--glow), .55); }
.menu-tile .mt-icon { margin-bottom: auto; filter: drop-shadow(0 0 8px rgba(var(--glow), .7)); }
.menu-tile .mt-name { font-size: 17px; font-weight: 700; color: var(--text); }
.menu-tile .mt-sub { font-size: 13px; color: var(--hint); min-height: 16px; }
.menu-tile.soon { filter: saturate(.55); opacity: .7; }
.menu-tile .soon-tag {
  position: absolute; top: 12px; right: 12px; padding: 3px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  color: rgb(var(--glow)); background: rgba(var(--glow), .16); border: 1px solid rgba(var(--glow), .45);
}
.menu-back {
  display: inline-flex; align-items: center; gap: 4px; margin: 0 0 10px -2px;
  padding: 6px 4px; font-size: 16px; color: var(--accent);
}
.menu-back svg { width: 9px; height: 15px; }
.large-title .long { font-size: 28px; }

/* ---------- переходы в стиле iOS ---------- */
.enter-tab { animation: enter-tab .32s var(--ios); }
@keyframes enter-tab { from { opacity: 0; transform: scale(.97); } }
.seg-in { animation: seg-in .32s var(--ios); }
@keyframes seg-in { from { opacity: 0; transform: translateX(calc(var(--dir, 1) * 28px)); } }
/* снимок старого экрана поверх/под новым на время анимации */
.nav-ghost {
  position: fixed; z-index: 4; margin: 0; pointer-events: none;
  padding: 0 16px; max-width: 600px; box-sizing: border-box;
}
#screen.nav-in, #screen.nav-back, #screen.nav-drag { position: relative; z-index: 5; }
#screen.nav-in { animation: nav-in .44s var(--ios); background: var(--bg); }
@keyframes nav-in {
  from { transform: translateX(100%); box-shadow: -10px 0 30px rgba(0,0,0,.25); }
  to { box-shadow: -10px 0 30px rgba(0,0,0,0); }
}
.nav-under-out { animation: nav-under-out .44s var(--ios) forwards; }
@keyframes nav-under-out { to { transform: translateX(-30%); filter: brightness(.7); opacity: .6; } }
.nav-top-out { z-index: 6; background: var(--bg); box-shadow: -10px 0 30px rgba(0,0,0,.25); animation: nav-top-out .44s var(--ios) forwards; }
@keyframes nav-top-out { to { transform: translateX(100%); } }
#screen.nav-back { animation: nav-back .44s var(--ios); }
@keyframes nav-back { from { transform: translateX(-30%); filter: brightness(.7); } }
/* свайп назад пальцем */
#screen.nav-drag { background: var(--bg); box-shadow: -10px 0 30px rgba(0,0,0,.25); will-change: transform; }
.nav-under { transform: translateX(-30%); filter: brightness(.7); }
.nav-settle { transition: transform .3s var(--ios), filter .3s var(--ios); }
.menu-admin {
  display: block; margin: 22px auto 0; padding: 6px 10px;
  font-size: 13px; color: var(--hint); opacity: .7;
}

/* смена заголовка: уезжает и размывается у края */
#title { position: relative; display: block; }
#title > span { display: inline-block; }
#title.t-anim {
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
  padding: 0 6px; margin: 0 -6px;
}
#title.t-anim .t-cur { animation: t-in .4s var(--ios); }
#title .t-old { position: absolute; left: 6px; top: 0; animation: t-out .4s var(--ios) forwards; pointer-events: none; }
@keyframes t-in { from { transform: translateX(calc(var(--d) * -90px)); filter: blur(6px); opacity: 0; } }
@keyframes t-out { to { transform: translateX(calc(var(--d) * 90px)); filter: blur(6px); opacity: 0; } }

/* ---------- приветствие-истории ---------- */
body.stories-open .tabbar { transform: translateX(-50%) translateY(140%); }
.stories {
  position: fixed; inset: 0; z-index: 100; color: #fff; overflow: hidden;
  background: radial-gradient(120% 70% at 50% 30%, color-mix(in srgb, var(--a) 38%, transparent), transparent 70%), #07080b;
  transition: background .5s; touch-action: none; user-select: none; -webkit-user-select: none;
  animation: st-open .35s var(--ios);
  padding: calc(10px + env(safe-area-inset-top)) 14px calc(20px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column;
}
.stories.out { animation: st-close .3s var(--ios) forwards; }
@keyframes st-open { from { opacity: 0; transform: scale(.96); } }
@keyframes st-close { to { opacity: 0; transform: scale(.96); } }
.stories.paused, .stories.paused * { animation-play-state: paused !important; }
.st-bars { display: flex; gap: 4px; }
.st-bars i { flex: 1; height: 3px; border-radius: 2px; background: rgba(255,255,255,.28); overflow: hidden; }
.st-bars b { display: block; height: 100%; width: 0; background: #fff; border-radius: inherit; }
.st-bars b.done { width: 100%; }
.st-bars b.run { animation: st-bar var(--ms, 6500ms) linear forwards; }
@keyframes st-bar { to { width: 100%; } }
.st-top { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.st-brand { font-weight: 800; font-size: 14px; letter-spacing: .5px; opacity: .85; }
.st-skip { color: #fff; font-size: 14px; font-weight: 600; padding: 7px 12px; border-radius: 999px; background: rgba(255,255,255,.14); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.st-view { flex: 1; display: flex; min-height: 0; }
.st-slide { flex: 1; display: flex; flex-direction: column; animation: st-in .45s var(--ios); min-height: 0; }
@keyframes st-in { from { opacity: 0; transform: translateX(30px); } }
.st-stage { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0; position: relative; }
.st-text h2 { font-size: 28px; font-weight: 800; margin: 0 0 8px; line-height: 1.15; animation: st-up .5s .15s var(--ios) backwards; }
.st-text p { font-size: 16px; line-height: 1.4; color: rgba(255,255,255,.78); margin: 0; animation: st-up .5s .25s var(--ios) backwards; }
.st-text .btn { margin-top: 18px; animation: st-up .5s .4s var(--ios) backwards; }
@keyframes st-up { from { opacity: 0; transform: translateY(14px); } }
.st-stage img:not(.emo) { display: block; width: 100%; height: auto; pointer-events: none; }
.st-stage .emo { display: inline-block; vertical-align: middle; }

/* карточка машины */
.st-card { position: relative; flex: 0 0 96px; box-sizing: border-box; width: 96px; padding: 8px 6px 6px; border-radius: 14px; background: rgba(255,255,255,.08);
  border: 1.5px solid var(--rc); box-shadow: inset 0 -18px 30px -18px var(--rc); }
.st-card .st-cls { position: absolute; top: 5px; left: 6px; font-size: 10px; font-weight: 800; padding: 1px 5px; border-radius: 5px; background: var(--rc); }
.st-card img { margin-top: 10px; }
.st-cn { font-size: 10px; font-weight: 600; text-align: center; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 1 — вступление */
.st-intro { width: 100%; text-align: center; }
.st-logo { font-size: 44px; font-weight: 900; letter-spacing: 1px; text-shadow: 0 0 24px var(--a); animation: st-up .6s var(--ios) backwards; }
.st-logo span { display: block; font-size: 18px; letter-spacing: 12px; color: var(--a); margin-top: 2px; }
.st-fleet { position: relative; height: 170px; margin-top: 24px; }
.st-fl { position: absolute; left: 50%; width: 62%; bottom: calc(var(--i) * 46px);
  transform: translateX(calc(-50% + (var(--i) - 1) * 18%)); animation: st-drive 1s calc(.3s + var(--i) * .35s) cubic-bezier(.2,.9,.25,1) backwards;
  filter: drop-shadow(0 10px 16px rgba(0,0,0,.6)); z-index: calc(3 - var(--i)); }
@keyframes st-drive { from { transform: translateX(120vw); } }

/* 2 — рулетка */
.st-stage:has(.st-roll) { flex-direction: column; gap: 16px; }
.st-roll { position: relative; width: calc(100% + 28px); margin: 0 -14px; height: 150px; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent); mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent); }
.st-marker { position: absolute; left: 50%; top: 0; bottom: 0; width: 3px; margin-left: -1.5px; background: #ffd60a; z-index: 2; border-radius: 2px; box-shadow: 0 0 12px #ffd60a; }
.st-strip { position: absolute; left: 50%; top: 22px; display: flex; gap: 8px; transform: translateX(-48px);
  animation: st-spin 3.4s .4s cubic-bezier(.1,.75,.15,1) forwards; }
@keyframes st-spin { to { transform: translateX(-984px); } }
.st-card.win { animation: st-glow 1.2s 3.8s ease-out both; }
@keyframes st-glow { 0% { transform: scale(1); } 40% { transform: scale(1.12); box-shadow: 0 0 34px var(--rc); } 100% { transform: scale(1.06); box-shadow: 0 0 22px var(--rc); } }
.st-drop { font-weight: 700; font-size: 18px; animation: st-up .5s 4s var(--ios) backwards; }

/* 3 — доход */
.st-income { width: 100%; }
.st-garage { display: flex; gap: 8px; margin-bottom: 14px; }
.st-gc { flex: 1; padding: 10px 4px; border-radius: 14px; background: rgba(255,255,255,.08); animation: st-up .5s calc(var(--i) * .15s) var(--ios) backwards; }
.st-panel { position: relative; padding: 16px; border-radius: 20px; background: rgba(255,255,255,.1); }
.st-row { display: flex; justify-content: space-between; font-size: 13px; color: rgba(255,255,255,.7); }
.st-big { font-size: 34px; font-weight: 800; margin: 6px 0 10px; font-variant-numeric: tabular-nums; }
.st-bar { height: 6px; border-radius: 3px; background: rgba(255,255,255,.15); overflow: hidden; }
.st-bar i { display: block; height: 100%; width: 0; background: #30d158; animation: st-fill 3.6s .3s cubic-bezier(.33,1,.68,1) forwards; }
@keyframes st-fill { to { width: 100%; } }
.st-btn { margin-top: 14px; text-align: center; padding: 12px; border-radius: 14px; background: #30d158; font-weight: 700; animation: st-press .5s 4.3s both; }
@keyframes st-press { 50% { transform: scale(.93); filter: brightness(1.2); } }
.st-big.taken { color: rgba(255,255,255,.5); }
.st-bar.taken i { animation: none; width: 0; transition: width .4s; }
.st-fly { position: absolute; left: 0; right: 0; top: -14px; text-align: center; font-weight: 800; font-size: 22px; color: #30d158; opacity: 0; animation: st-flyup 1.2s 4.5s ease-out forwards; }
@keyframes st-flyup { 0% { opacity: 0; transform: translateY(10px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(-50px); } }

/* 4 — слияние деталей */
.st-merge { width: 100%; }
.st-parts { position: relative; height: 120px; }
.st-part { position: absolute; top: 0; left: 50%; box-sizing: border-box; width: 84px; margin-left: -42px; padding: 8px; border-radius: 16px; text-align: center;
  background: rgba(var(--accent-rgb),.18); border: 1.5px solid var(--accent);
  transform: translateX(calc((var(--i) - 1) * 100px)); animation: st-join 1s 1.2s cubic-bezier(.5,0,.75,0) forwards; }
.st-part b { display: block; font-size: 11px; margin-top: 4px; }
@keyframes st-join { to { transform: translateX(0) scale(.6); opacity: 0; } }
.st-part.res { background: rgba(191,90,242,.22); border-color: #bf5af2; box-shadow: 0 0 26px #bf5af2;
  opacity: 0; transform: scale(.4); animation: st-pop .6s 2.25s var(--spring) forwards; }
@keyframes st-pop { to { opacity: 1; transform: scale(1.1); } }
.st-flash { position: absolute; left: 50%; top: 45px; width: 20px; height: 20px; margin: -10px; border-radius: 50%; background: #fff;
  opacity: 0; animation: st-flash .6s 2.15s ease-out; }
@keyframes st-flash { 0% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(12); } }
.st-tune { position: relative; margin: 26px auto 0; width: 70%; animation: st-up .5s 2.9s var(--ios) backwards; }
.st-hp { text-align: center; font-size: 20px; font-weight: 800; margin-top: 6px; font-variant-numeric: tabular-nums; }
.st-hp em { font-style: normal; color: #30d158; font-size: 16px; opacity: 0; display: inline-block; animation: st-show .4s 3.3s var(--ios) forwards; }
@keyframes st-show { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* 5 — гонка */
.st-race { width: 100%; text-align: center; }
.st-lights { display: inline-flex; gap: 10px; padding: 10px 14px; border-radius: 999px; background: rgba(0,0,0,.6); border: 1px solid rgba(255,255,255,.12); }
.st-lights i { width: 22px; height: 22px; border-radius: 50%; background: #2a2a2e; }
.st-lights i:nth-child(1) { animation: st-red 1.2s .3s steps(1) both; }
.st-lights i:nth-child(2) { animation: st-yel 1.2s .3s steps(1) both; }
.st-lights i:nth-child(3) { animation: st-grn .1s 1.5s forwards; }
@keyframes st-red { 0% { background: #ff453a; box-shadow: 0 0 14px #ff453a; } 50%, 100% { background: #2a2a2e; box-shadow: none; } }
@keyframes st-yel { 0% { background: #2a2a2e; } 50% { background: #ffd60a; box-shadow: 0 0 14px #ffd60a; } 100% { background: #2a2a2e; box-shadow: none; } }
@keyframes st-grn { to { background: #30d158; box-shadow: 0 0 18px #30d158; } }
.st-board { margin-top: 18px; padding: 14px; border-radius: 18px; background: rgba(0,0,0,.55); border: 1px solid rgba(255,255,255,.1); text-align: left; }
.st-lane + .st-lane { margin-top: 12px; }
.st-lane span { font-size: 12px; color: rgba(255,255,255,.75); }
.st-track { height: 10px; margin-top: 5px; border-radius: 5px; background: rgba(255,255,255,.1); overflow: hidden; }
.st-track i { display: block; height: 100%; width: 0; border-radius: inherit; }
.st-lane.me i { background: linear-gradient(90deg, var(--accent), #64d2ff); animation: st-run 2.4s 1.6s cubic-bezier(.4,0,.6,1) forwards; }
.st-lane.bot i { background: linear-gradient(90deg, #ff453a, #ff9f0a); animation: st-run-b 2.4s 1.6s cubic-bezier(.4,0,.6,1) forwards; }
@keyframes st-run { to { width: 100%; } }
@keyframes st-run-b { to { width: 84%; } }
.st-win { margin-top: 16px; font-weight: 800; font-size: 20px; animation: st-up .5s 4.1s var(--spring) backwards; }

/* 6 — награды */
.st-rewards { width: 100%; text-align: center; }
.st-gift { display: inline-block; animation: wiggle 1.6s .4s ease-in-out infinite; filter: drop-shadow(0 0 20px rgba(255,214,10,.5)); }
.st-days { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 18px; }
.st-day { padding: 8px 4px; border-radius: 12px; background: rgba(255,255,255,.08); border: 1.5px solid transparent;
  display: flex; flex-direction: column; align-items: center; gap: 4px; animation: st-lit .4s calc(.6s + var(--i) * .35s) both; }
.st-day small { font-size: 10px; color: rgba(255,255,255,.7); }
.st-day.big { grid-column: span 2; }
@keyframes st-lit { from { opacity: .35; transform: scale(.9); } to { border-color: #ffd60a; background: rgba(255,214,10,.14); } }

/* 7 — коллекция */
.st-col { width: 100%; }
.st-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.st-cc { padding: 10px 4px; border-radius: 12px; background: rgba(255,255,255,.07); }
.st-cc img { filter: brightness(0) opacity(.45); animation: st-reveal .5s calc(.4s + var(--i) * .3s) forwards; }
@keyframes st-reveal { to { filter: none; } }
.st-secret { position: relative; width: 150px; height: 120px; margin: 18px auto 0; perspective: 600px; }
.st-secret > * { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.st-q { display: flex; align-items: center; justify-content: center; font-size: 54px; font-weight: 900; border-radius: 16px;
  background: rgba(255,214,10,.12); border: 1.5px dashed #ffd60a; color: #ffd60a; animation: st-flip-a .7s 2.6s ease-in forwards; }
.st-secret .st-card { width: auto; transform: rotateY(180deg); animation: st-flip-b .7s 2.6s ease-out forwards; }
@keyframes st-flip-a { to { transform: rotateY(-180deg); } }
@keyframes st-flip-b { to { transform: rotateY(0); box-shadow: 0 0 26px var(--rc); } }

/* 8 — музей */
.st-museum { position: relative; width: 100%; height: 260px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }
.st-spot { position: absolute; top: -20px; left: 50%; width: 240px; height: 280px; margin-left: -120px;
  background: radial-gradient(50% 100% at 50% 0%, rgba(255,255,255,.35), transparent 75%);
  clip-path: polygon(40% 0, 60% 0, 100% 100%, 0 100%); opacity: 0; animation: st-on .6s .5s forwards; }
@keyframes st-on { 30% { opacity: .5; } 45% { opacity: .1; } to { opacity: 1; } }
.st-ped { position: relative; width: 78%; padding-bottom: 18px; animation: st-float 3s 1s ease-in-out infinite alternate; }
.st-ped::after { content: ''; position: absolute; left: 4%; right: 4%; bottom: 0; height: 16px; border-radius: 50%; background: radial-gradient(rgba(100,210,255,.45), transparent 70%); }
@keyframes st-float { to { transform: translateY(-8px); } }
.st-plate { margin-top: 10px; font-size: 13px; padding: 6px 12px; border-radius: 8px; background: rgba(255,255,255,.1); animation: st-up .5s 1s var(--ios) backwards; }

/* 9 — финал */
.st-final { animation: st-pop2 .8s var(--spring) backwards; filter: drop-shadow(0 0 30px var(--a)); }
@keyframes st-pop2 { from { transform: scale(.3) rotate(-20deg); opacity: 0; } }
.sub-gate .btn { margin-top: 10px; }

/* ---------- промокоды ---------- */
.menu-tile.wide { grid-column: span 2; min-height: 0; flex-direction: row; align-items: center; gap: 12px; }
.menu-tile.wide .mt-icon { margin: 0; }
.menu-tile.wide .mt-name { margin-right: auto; }
.menu-tile.wide { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; row-gap: 0; }
.menu-tile.wide .mt-icon { grid-row: span 2; align-self: center; }
.promo-card { text-align: center; padding: 22px 18px; }
.promo-card h3 { margin: 6px 0 4px; font-size: 22px; }
.promo-card p { margin: 0 0 16px; }
.promo-hero { filter: drop-shadow(0 0 16px rgba(var(--accent-rgb),.55)); }
.promo-input {
  width: 100%; box-sizing: border-box; padding: 14px; margin-bottom: 12px; border-radius: 14px; border: 1.5px solid var(--sep);
  background: var(--card2); color: var(--text); font-size: 20px; font-weight: 700; text-align: center; letter-spacing: 2px; text-transform: uppercase;
}
.promo-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent); }
.promo-input::placeholder { letter-spacing: 0; text-transform: none; font-weight: 500; color: var(--hint); }
.link { color: var(--accent); font: inherit; padding: 0; }
#promo-result { margin-top: 14px; }
.apr-l { flex: none; width: 24px; text-align: center; }
.admin-input.tiny { flex: 0 0 56px; max-width: 56px; }
.pill.on { background: var(--accent); color: var(--on-accent); }
.promo-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.promo-row.off { opacity: .6; }
.promo-code { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 800; font-size: 17px; color: var(--text); padding: 0; letter-spacing: 1px; }
.promo-row .ok { color: var(--ok); font-weight: 600; }
#balance { white-space: nowrap; flex: none; }

/* ---------- друзья ---------- */
.friends-card { text-align: center; padding: 22px 18px; }
.friends-card h3 { margin: 6px 0 4px; font-size: 22px; }
.friends-card p { margin: 0 0 14px; }
.friends-hero { filter: drop-shadow(0 0 16px rgba(255,55,95,.55)); }
.ref-link { display: block; width: 100%; padding: 12px; border-radius: 12px; background: var(--card2); color: var(--text);
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; word-break: break-all; margin-bottom: 12px; }
.row-btns { display: flex; gap: 10px; }
.row-btns .btn { flex: 1; margin: 0 !important; }
.friends-stats { grid-template-columns: 1fr 1fr !important; margin: 14px 0 4px; }
.list-row .r.ok { color: var(--ok); font-weight: 600; font-size: 14px; }

/* ---------- истории «Что нового» ---------- */
.st-new { text-align: center; width: 100%; }
.st-newtag { display: inline-block; padding: 6px 16px; border-radius: 999px; font-weight: 900; letter-spacing: 3px;
  background: linear-gradient(90deg, #bf5af2, #ff375f); box-shadow: 0 0 24px rgba(191,90,242,.6); animation: st-pop2 .7s var(--spring) backwards; }
.st-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 26px; }
.st-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; padding: 16px; border-radius: 22px; text-align: left;
  background: radial-gradient(120% 90% at 0% 0%, rgba(var(--g), .35), transparent 60%), rgba(255,255,255,.06);
  border: 1px solid rgba(var(--g), .7); box-shadow: 0 0 22px rgba(var(--g), .45), inset 0 0 18px rgba(var(--g), .2);
  animation: st-tile-in .7s calc(.5s + var(--i) * .3s) var(--spring) backwards; }
.st-tile b { font-size: 17px; }
@keyframes st-tile-in { from { opacity: 0; transform: translateY(30px) scale(.8); } }
.st-promo { width: 100%; text-align: center; }
.st-input { display: flex; align-items: center; justify-content: center; height: 54px; border-radius: 14px; background: rgba(255,255,255,.08);
  border: 1.5px solid var(--accent); box-shadow: 0 0 0 4px rgba(var(--accent-rgb),.2); font-size: 22px; font-weight: 800; letter-spacing: 3px; }
.st-type { display: inline-block; overflow: hidden; white-space: nowrap; width: 0; font-family: ui-monospace, Menlo, Consolas, monospace;
  animation: st-typing 1.4s .5s steps(8) forwards; }
@keyframes st-typing { to { width: calc(8ch + 26px); } }
.st-caret { width: 2px; height: 26px; background: #fff; margin-left: 2px; animation: st-blink .8s steps(1) infinite; }
@keyframes st-blink { 50% { opacity: 0; } }
.st-btn.blue { background: var(--accent); animation: st-press .5s 2.1s both; }
.st-gets { display: flex; gap: 8px; margin-top: 18px; }
.st-get { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; min-height: 92px; padding: 10px 6px;
  border-radius: 14px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12);
  animation: st-tile-in .6s calc(2.6s + var(--i) * .25s) var(--spring) backwards; }
.st-get b { font-size: 12px; }
.st-get.car img, .st-get .st-pimg { width: 100%; max-width: 90px; }
.st-get .st-pimg { max-width: 48px; }
.st-ref { position: relative; width: 100%; height: 280px; }
.st-me { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -60%); display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 16px; border-radius: 50%; background: rgba(255,55,95,.2); box-shadow: 0 0 30px rgba(255,55,95,.6); animation: st-pulse 1.2s 1s ease-in-out infinite alternate; }
.st-me span { font-size: 12px; font-weight: 700; }
@keyframes st-pulse { to { box-shadow: 0 0 46px rgba(255,55,95,.9); } }
.st-fr { position: absolute; top: 0; display: flex; flex-direction: column; align-items: center; gap: 2px;
  left: calc(12% + var(--i) * 33%); animation: st-join-me 1.1s calc(.8s + var(--i) * 1s) cubic-bezier(.5,0,.3,1) forwards; }
.st-plus { position: absolute; left: 0; right: 0; top: 34px; text-align: center; font-style: normal; font-weight: 800; font-size: 20px; color: #30d158; opacity: 0;
  animation: st-flyup 1.2s calc(1.75s + var(--i) * 1s) ease-out forwards; }
@keyframes st-join-me { 70% { opacity: 1; } to { left: 46%; top: 96px; opacity: .0; transform: scale(.6); } }
.st-link { position: absolute; left: 0; right: 0; bottom: 0; text-align: center; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px;
  padding: 10px; border-radius: 12px; background: rgba(255,255,255,.08); color: rgba(255,255,255,.8); }

/* кейсы с машинами ×3 / ×5 */
.mgrid.cars .mtile { padding: 14px 6px 8px; }
.mgrid.cars .mtile .layer.b { top: 14px; left: 6px; right: 6px; }
.mtile.car { cursor: pointer; }
.mtile .tnew { position: absolute; top: 5px; right: 6px; opacity: 0; transition: opacity .3s; }
.mtile.s2 .tnew { opacity: 1; }
.mtile.car.sold .mn { color: var(--hint); }

/* истории: кейсы ×3 и снять все детали */
.st-multi { width: 100%; text-align: center; }
.st-counts { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: rgba(255,255,255,.08); margin-bottom: 16px; }
.st-counts span { padding: 6px 14px; border-radius: 9px; font-weight: 700; font-size: 14px; color: rgba(255,255,255,.6); }
.st-counts span.on { background: #ff9f0a; color: #fff; animation: st-press .5s .4s both; }
.st-mgrid { display: flex; gap: 8px; }
.st-mt { position: relative; flex: 1; padding: 16px 6px 8px; border-radius: 14px; background: rgba(255,255,255,.07); min-height: 92px;
  display: flex; flex-direction: column; justify-content: flex-end; animation: st-mt-bg .4s calc(1.4s + var(--i) * .55s) forwards; }
@keyframes st-mt-bg { to { background: color-mix(in srgb, var(--rc) 28%, transparent); box-shadow: 0 0 18px color-mix(in srgb, var(--rc) 60%, transparent); } }
.st-mq { position: absolute; left: 0; right: 0; top: 30%; font-size: 26px; font-weight: 800; color: rgba(255,255,255,.5); animation: st-hide .2s calc(1.4s + var(--i) * .55s) forwards; }
@keyframes st-hide { to { opacity: 0; } }
.st-mcar img { filter: brightness(0) opacity(.35); animation: st-reveal .45s calc(1.4s + var(--i) * .55s) forwards; }
.st-mt small { font-size: 10px; margin-top: 4px; opacity: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: st-hide-r .3s calc(1.6s + var(--i) * .55s) forwards; }
@keyframes st-hide-r { to { opacity: 1; } }
.st-btn.orange { background: #ff9f0a; animation: st-press .5s 1s both; }
.st-strip-parts { width: 100%; text-align: center; }
.st-scar { position: relative; width: 78%; margin: 0 auto; }
.st-sp { position: absolute; width: 46px; height: 46px; padding: 6px; border-radius: 12px; box-sizing: border-box;
  background: rgba(191,90,242,.25); border: 1.5px solid #bf5af2; box-shadow: 0 0 14px rgba(191,90,242,.6);
  left: calc(4% + var(--i) * 24%); top: -52px; animation: st-sp-off .9s calc(1.6s + var(--i) * .18s) cubic-bezier(.5,0,.6,1) forwards; }
.st-sp img { width: 100%; }
@keyframes st-sp-off { 30% { transform: translateY(-14px) rotate(-8deg); } to { transform: translateY(240px) scale(.4); opacity: 0; left: 40%; } }
.st-btn.gray2 { background: rgba(255,255,255,.14); animation: st-press .5s 1.1s both; margin-top: 18px; }
.st-stock { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; padding: 10px 16px; border-radius: 14px; background: rgba(255,255,255,.08); font-weight: 700; }
.st-stock b { color: #30d158; opacity: 0; animation: st-hide-r .3s 2.9s forwards; }

/* ---------- номера ---------- */
.plate { display: inline-flex; align-items: stretch; background: #fff; color: #121212; border: .06em solid #121212; border-radius: .14em;
  padding: .04em; font-family: 'Roboto Condensed', 'Arial Narrow', Arial, sans-serif; font-weight: 700; font-size: 16px; line-height: 1;
  box-shadow: inset 0 0 0 .04em #fff; flex: none; user-select: none; }
.plate.big { font-size: 50px; transition: box-shadow .5s; }
.plate.mini { font-size: 17px; }
.pl-main { display: flex; align-items: flex-end; padding: .08em .14em .06em; border-right: .05em solid #121212; }
.pc { display: inline-block; height: 1em; line-height: 1em; overflow: hidden; width: .6em; text-align: center; }
.pc.l { font-size: .78em; width: .66em; }
.pl-reg { display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: .06em .12em .04em; }
.pl-rn { display: flex; }
.pl-rn .pc { font-size: .66em; }
.pl-rus { display: flex; align-items: center; gap: .25em; font-size: .2em; letter-spacing: .04em; }
.pl-flag { width: 1.7em; height: 1.1em; border: .06em solid #999; background: linear-gradient(#fff 33.3%, #0039a6 33.3% 66.6%, #d52b1e 66.6%); }
.reel { display: block; }
.reel b { display: block; height: 1em; line-height: 1em; font-weight: inherit; }
.plate-stage { position: relative; display: flex; justify-content: center; align-items: center; padding: 34px 0; margin-bottom: 6px; border-radius: 22px;
  transition: background .6s; }
.plate-stage.lit { background: radial-gradient(60% 80% at 50% 50%, color-mix(in srgb, var(--rc) 45%, transparent), transparent 75%); }
.plate-stage.lit .plate { box-shadow: inset 0 0 0 .04em #fff, 0 0 18px var(--rc), 0 0 60px color-mix(in srgb, var(--rc) 65%, transparent); }
.plate-stage.flash { animation: pl-flash .9s var(--spring); }
@keyframes pl-flash { 0% { transform: scale(1); } 30% { transform: scale(1.08); } 100% { transform: scale(1); } }
.plate-stage.sheet { padding: 22px 0; }
.plate-stage.sheet .plate.big { font-size: 42px; }
.plate-info { text-align: center; margin: 4px 0 14px; }
.pi-val { font-size: 26px; font-weight: 800; margin: 6px 0 2px; }
.pl-row .plate.mini { margin-right: 12px; }
.list-row .r .plate.mini { margin-right: 6px; font-size: 12px; }
.pl-build { margin-bottom: 10px; }
.pl-fields { display: grid; grid-template-columns: 1fr 1.5fr 1fr 1fr 1.3fr; gap: 6px; margin-bottom: 8px; }
.pl-fields .admin-input { text-align: center; font-size: 18px; font-weight: 700; padding-left: 4px; padding-right: 4px; }
.note.ok { color: var(--ok); font-weight: 600; }
.note.bad { color: var(--bad); }
.ic.car-ic { width: 72px; height: auto; }
.plate.ghost .pc { opacity: .18; }
.car-plate { display: flex; justify-content: center; margin-top: 8px; }
.car-plate .plate { font-size: 24px; }
.car-plate.tiny { margin: 4px 0 2px; }
.car-plate.tiny .plate { font-size: 12px; }
.plate .pc, .plate .pl-rus { color: #121212 !important; }

/* ---------- номер: реалистичная объёмная табличка ---------- */
.plate3d { display: inline-block; perspective: 700px; touch-action: none; }
.plate { position: relative; overflow: hidden;
  background: linear-gradient(180deg, #ffffff 0%, #f3f4f6 55%, #e4e7eb 100%);
  border: .055em solid #161616; border-radius: .16em; padding: .035em;
  box-shadow: inset 0 0 0 .035em #fdfdfd, inset 0 0 0 .07em rgba(0,0,0,.08), 0 .05em .12em rgba(0,0,0,.35); }
.plate .pc, .plate .pl-rus { font-family: -apple-system, 'SF Pro Display', system-ui, sans-serif; font-weight: 600; }
.plate .pc { overflow: visible; position: relative; }
.plate .real, .plate:not(.rolling):not(.stamped):not(.blank) .pc {
  font-family: 'Roboto Condensed', 'Arial Narrow', sans-serif; font-weight: 700; }
/* выдавленные символы: светлый блик снизу, тень сверху */
.plate .real, .plate:not(.rolling) .pc { text-shadow: 0 .025em 0 rgba(255,255,255,.95), 0 -.02em .01em rgba(0,0,0,.35); }
.plate .real { display: inline-block; animation: pl-stamp .55s calc(var(--i) * 45ms) cubic-bezier(.2,.9,.3,1.3) backwards; }
@keyframes pl-stamp { from { opacity: 0; filter: blur(.08em); transform: scale(1.35); } }
.plate .bolt { width: .14em; height: .14em; margin: 0 .08em; align-self: center; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 35% 35%, #fafafa, #9aa0a6 60%, #5f6368); box-shadow: 0 .01em .02em rgba(0,0,0,.4); }
.plate.mini .bolt, .car-plate.tiny .bolt, .list-row .r .bolt { display: none; }
.plate .pl-flag { box-shadow: 0 0 0 .01em rgba(0,0,0,.2); }
/* барабан при прокрутке — выходит за табличку и тает сверху и снизу */
.plate.rolling { overflow: visible; }
.plate.rolling .pc { perspective: 4em; }
.drum { position: absolute; inset: 0; transform-style: preserve-3d; }
.drum b { position: absolute; left: 0; right: 0; top: 0; height: 1em; line-height: 1em; text-align: center; font-weight: 600; backface-visibility: hidden; will-change: transform, opacity; }
/* блик плёнки: переливается при наклоне и покачивании */
.pl-sheen { position: absolute; inset: 0; pointer-events: none; border-radius: inherit; mix-blend-mode: multiply;
  background:
    linear-gradient(115deg, transparent 30%, rgba(120, 190, 255, .28) 42%, rgba(255, 255, 255, 0) 50%, rgba(255, 150, 210, .24) 58%, transparent 70%),
    linear-gradient(180deg, rgba(0,0,0,0) 60%, rgba(0,0,0,.05));
  background-size: 260% 260%, 100% 100%; background-position: var(--sx, 50%) var(--sy, 50%), 0 0; transition: background-position .5s ease; }
.plate::after { content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: radial-gradient(60% 120% at var(--sx, 50%) var(--sy, 30%), rgba(255,255,255,.75), transparent 60%); mix-blend-mode: soft-light; transition: background .5s ease; }
.plate3d .plate { transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .6s var(--spring), box-shadow .5s;
  transform-style: preserve-3d; animation: pl-sway 6s ease-in-out infinite; }
.plate3d .plate.dragging, .plate3d .plate.rolling { animation: none; transition: none; }
.plate3d .plate.dragging .pl-sheen, .plate3d .plate.dragging::after { transition: none; }
@keyframes pl-sway {
  0%, 100% { transform: rotateX(var(--rx, 0deg)) rotateY(calc(var(--ry, 0deg) - 7deg)); --sx: 34%; }
  50% { transform: rotateX(calc(var(--rx, 0deg) + 4deg)) rotateY(calc(var(--ry, 0deg) + 7deg)); --sx: 66%; }
}
@property --sx { syntax: '<percentage>'; inherits: true; initial-value: 50%; }
@property --sy { syntax: '<percentage>'; inherits: true; initial-value: 40%; }

/* ---------- номер: как настоящий (светоотражающая плёнка, выдавленные символы, шрифт ближе к ГОСТ) ---------- */
.plate { background: #f6f6f3; border: .035em solid #47463f; border-radius: .13em; padding: .045em;
  box-shadow: inset 0 0 0 .03em #f6f6f3, inset 0 0 0 .05em #8d8b82, inset 0 0 0 .065em #fbfbf8, 0 .05em .14em rgba(0,0,0,.4); }
.pl-main { border-right: .035em solid #57554d; padding: .07em .1em .05em; }
.plate .pc, .plate .real, .plate:not(.rolling):not(.stamped):not(.blank) .pc { font-family: 'Roboto', 'Arial', sans-serif; font-weight: 500; }
.pc { width: .66em; }
.pc.l { width: .74em; }
/* выдавленный символ: тёмно-серая краска, светлая грань снизу-справа, тень сверху-слева */
.plate .pc, .plate .pl-rus, .plate .real { color: #34332d !important; }
.plate .real, .plate:not(.rolling) .pc { text-shadow: .014em .02em 0 rgba(255,255,255,.95), -.012em -.014em .005em rgba(0,0,0,.45), 0 0 .03em rgba(0,0,0,.15); }
.plate .bolt { display: none; }
.plate .hole { width: .085em; height: .085em; margin: 0 .05em; align-self: center; border-radius: 50%; flex: none;
  background: #3a3a35; box-shadow: inset .01em .015em .02em #000, 0 .012em 0 rgba(255,255,255,.9); }
.plate.mini .hole, .car-plate.tiny .hole, .list-row .r .hole { display: none; }
/* барабан не выходит за ячейку символа */
.plate.rolling { overflow: hidden; }
.plate.rolling .pc { overflow: hidden; }
/* светоотражение: яркое пятно там, куда «светят», края темнее — без цветной радуги */
.pl-sheen { mix-blend-mode: multiply; background:
  radial-gradient(75% 140% at var(--sx, 50%) var(--sy, 40%), rgba(255,255,255,1) 0%, rgba(255,255,255,1) 25%, rgba(196,195,186,.9) 80%, rgba(170,168,158,.9) 100%);
  background-size: 100% 100%; background-position: 0 0; transition: background .5s ease; }
.plate::after { background: radial-gradient(40% 90% at var(--sx, 50%) var(--sy, 35%), rgba(255,255,255,.95), transparent 70%); mix-blend-mode: screen; opacity: .55; }
.plate3d .plate:not(.dragging):not(.rolling) { transition: transform .6s var(--spring), box-shadow .5s, --sx .6s ease, --sy .6s ease; }

/* правки номера: толще окантовка, мягче блики на символах, плавный возврат после наклона */
.plate { border-width: .06em; box-shadow: inset 0 0 0 .035em #f6f6f3, inset 0 0 0 .06em #8d8b82, inset 0 0 0 .075em #fbfbf8, 0 .05em .14em rgba(0,0,0,.4); }
.pl-main { border-right-width: .055em; }
.plate .real, .plate:not(.rolling) .pc { text-shadow: .01em .014em 0 rgba(255,255,255,.45), -.008em -.01em .004em rgba(0,0,0,.25); }
.plate .hole { display: none; }
.plate3d .plate.settling { animation: none; transition: transform 1.4s cubic-bezier(.45,.05,.2,1), --sx 1.4s ease, --sy 1.4s ease; }
@keyframes pl-sway {
  0%, 100% { transform: rotateX(0deg) rotateY(0deg); --sx: 50%; }
  25% { transform: rotateX(2deg) rotateY(-6deg); --sx: 36%; }
  75% { transform: rotateX(-2deg) rotateY(6deg); --sx: 64%; }
}
#pl-result .btn-row { margin-bottom: 10px; }

/* совсем слабые блики на символах */
.plate .real, .plate:not(.rolling) .pc { text-shadow: .008em .01em 0 rgba(255,255,255,.22), -.006em -.008em .003em rgba(0,0,0,.14); }


/* истории «Повышаем ставки» */
.st-boost { position: relative; width: 100%; text-align: center; }
.st-old { display: inline-block; position: relative; font-size: 34px; font-weight: 800; color: rgba(255,255,255,.55); }
.st-old::after { content: ''; position: absolute; left: -6%; top: 52%; height: 4px; width: 0; background: #ff453a; border-radius: 2px;
  transform: rotate(-8deg); animation: st-strike .4s .7s ease-out forwards; }
@keyframes st-strike { to { width: 112%; } }
.st-old.small { font-size: 24px; display: block; width: max-content; margin: 10px auto 0; }
.st-x10 { display: block; width: max-content; margin: 16px auto 6px; padding: 4px 14px; border-radius: 999px; font-weight: 900; font-size: 20px; color: #000;
  background: linear-gradient(90deg, #ffd60a, #ff9f0a); box-shadow: 0 0 24px rgba(255,214,10,.7); animation: st-pop2 .6s 1.2s var(--spring) backwards; }
.st-new-sum { font-size: 40px; white-space: nowrap; font-weight: 900; color: #ffd60a; text-shadow: 0 0 28px rgba(255,214,10,.8);
  animation: st-slam .7s 1.6s cubic-bezier(.2,1.6,.4,1) backwards; }
.st-new-sum.pink { color: #ff6b8e; text-shadow: 0 0 28px rgba(255,55,95,.85); font-size: 40px; margin-top: 6px; }
.friend .st-new-sum { animation-delay: 1.3s; }
@keyframes st-slam { from { opacity: 0; transform: scale(2.4); filter: blur(6px); } }
.st-coins { position: absolute; inset: -40px 0 auto; height: 0; pointer-events: none; }
.st-coins span { position: absolute; left: calc(8% + var(--i) * 16%); top: -30px; opacity: 0; animation: st-rain 1.6s calc(2s + var(--i) * .18s) ease-in infinite; }
@keyframes st-rain { 0% { opacity: 0; transform: translateY(0) rotate(0); } 15% { opacity: 1; } 100% { opacity: 0; transform: translateY(320px) rotate(40deg); } }
.st-gift-big { display: inline-block; animation: wiggle 1.4s .3s ease-in-out infinite; filter: drop-shadow(0 0 22px rgba(255,55,95,.6)); }

/* ---------- рейтинг ---------- */
.rt-head { margin-bottom: 12px; }
.rt-head .row { margin-bottom: 4px; }
.rt-prizes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 12px; }
.rt-prizes > div { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 2px; border-radius: 12px; background: var(--fill); font-size: 12px; text-align: center; }
.rt-note { margin: 0 4px 10px; }
.rt-list { margin-bottom: 70px; }
.rt-row .rt-place { width: 34px; flex: none; text-align: center; font-weight: 700; color: var(--hint); font-variant-numeric: tabular-nums; }
.rt-row .rt-val { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.rt-row.top1 { background: linear-gradient(90deg, rgba(255,214,10,.18), transparent 70%); }
.rt-row.top2 { background: linear-gradient(90deg, rgba(200,200,210,.18), transparent 70%); }
.rt-row.top3 { background: linear-gradient(90deg, rgba(205,127,50,.2), transparent 70%); }
.rt-row.me { box-shadow: inset 3px 0 0 var(--accent); }
.rt-badge { margin-left: 4px; }
.rt-me { position: fixed; z-index: 9; left: 50%; transform: translateX(-50%); bottom: calc(86px + env(safe-area-inset-bottom)); width: min(560px, calc(100% - 32px));
  display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-radius: 16px; box-sizing: border-box;
  background: var(--glass); -webkit-backdrop-filter: blur(22px) saturate(190%); backdrop-filter: blur(22px) saturate(190%);
  box-shadow: inset 0 1px 0 var(--glass-hi), var(--shadow); font-variant-numeric: tabular-nums; }
body.sheet-open .rt-me { display: none; }
.rt-car { padding: 8px 20px 0; }
.rt-car-name { display: flex; justify-content: center; align-items: center; gap: 8px; font-size: 20px; font-weight: 700; margin: 10px 0 2px; }

/* витрина: номер под машиной, чужая витрина — без нажатий */
.exhibit .car-plate.tiny { margin: 2px 0 4px; }
.exhibit.view { cursor: default; }

/* ---------- плавные окна (шторки) ---------- */
.sheet { transition: transform .55s cubic-bezier(.32,.72,0,1); }
.sheet.resizing { transition: transform .55s cubic-bezier(.32,.72,0,1), height .45s cubic-bezier(.32,.72,0,1); overflow: hidden; }
#app { transition: transform .55s cubic-bezier(.32,.72,0,1), border-radius .55s, filter .55s; }
.backdrop { transition: opacity .55s cubic-bezier(.32,.72,0,1); }
/* содержимое шторки при открытии появляется по очереди сверху вниз */
.sheet-body.opening > * { animation: sheet-item .5s cubic-bezier(.32,.72,0,1) backwards; }
.sheet-body.opening > :nth-child(1) { animation-delay: .04s; }
.sheet-body.opening > :nth-child(2) { animation-delay: .08s; }
.sheet-body.opening > :nth-child(3) { animation-delay: .12s; }
.sheet-body.opening > :nth-child(4) { animation-delay: .16s; }
.sheet-body.opening > :nth-child(5) { animation-delay: .2s; }
.sheet-body.opening > :nth-child(6) { animation-delay: .24s; }
.sheet-body.opening > :nth-child(n+7) { animation-delay: .28s; }
@keyframes sheet-item { from { opacity: 0; transform: translateY(18px); } }
/* переход внутри шторки: мягче и чуть дальше */
.sheet-body.swap { animation: swap2 .42s cubic-bezier(.32,.72,0,1); }
@keyframes swap2 { from { opacity: 0; transform: translateX(26px); } }
/* профиль: полоска опыта заполняется, аватар появляется с пружинкой */
.sheet-body.opening .prof-bar i, .sheet-body.swap .prof-bar i { animation: prof-fill 1s .25s cubic-bezier(.32,.72,0,1) backwards; }
@keyframes prof-fill { from { width: 0; } }
.sheet-body.opening .prof-head .ava { animation: prof-ava .6s .1s var(--spring) backwards; }
@keyframes prof-ava { from { transform: scale(.6); opacity: 0; } }
.sheet-body.opening .prof-stats > div { animation: sheet-item .5s cubic-bezier(.32,.72,0,1) backwards; }
.sheet-body.opening .prof-stats > div:nth-child(2) { animation-delay: .05s; }
.sheet-body.opening .prof-stats > div:nth-child(3) { animation-delay: .1s; }
.sheet-body.opening .prof-stats > div:nth-child(4) { animation-delay: .15s; }
.sheet-body.opening .prof-stats > div:nth-child(5) { animation-delay: .2s; }
.sheet-body.opening .prof-stats > div:nth-child(6) { animation-delay: .25s; }
@media (prefers-reduced-motion: reduce) { .sheet-body.opening > *, .sheet-body.swap { animation: none !important; } }

/* ---------- переходы в Меню без рывков ---------- */
/* снимок старого экрана: без стеклянного размытия и анимаций внутри — их перерисовка на каждом кадре и давала рывки */
.nav-ghost { will-change: transform; contain: layout paint; }
.nav-ghost * { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; animation: none !important; transition: none !important; }
.nav-ghost::after { content: ''; position: absolute; inset: 0; background: #000; opacity: var(--dim, 0); pointer-events: none; }
@keyframes nav-under-out { to { transform: translateX(-30%); } }
.nav-under-out::after { animation: nav-dim .44s var(--ios) forwards; }
@keyframes nav-dim { from { opacity: 0; } to { opacity: .35; } }
.nav-under { filter: none; --dim: .35; }
#screen.nav-in { animation: nav-in2 .44s var(--ios); box-shadow: -10px 0 30px rgba(0,0,0,.25); will-change: transform; }
@keyframes nav-in2 { from { transform: translateX(100%); } }
#screen.nav-back { animation: nav-back2 .44s var(--ios); will-change: transform; }
@keyframes nav-back2 { from { transform: translateX(-30%); } }
#screen.nav-back::after { content: ''; position: absolute; inset: 0; background: #000; pointer-events: none; animation: nav-undim .44s var(--ios) forwards; }
@keyframes nav-undim { from { opacity: .35; } to { opacity: 0; } }
/* «Ты: #…» в рейтинге — прилипает к низу, а не закреплена на экране (иначе прыгает при переходе) */
.rt-me { position: sticky; left: auto; transform: none; width: 100%; margin-top: 10px; bottom: calc(96px + env(safe-area-inset-bottom)); }
.rt-list { margin-bottom: 0; }
.fade-in { animation: fade-in .3s ease; }
@keyframes fade-in { from { opacity: 0; } }

/* во время перехода между экранами — без размытия «стекла» (тяжело для телефона) */
body.navigating .tabbar, body.navigating .rt-me, body.navigating .menu-tile, body.navigating .st-skip {
  -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
body.navigating .tabbar, body.navigating .rt-me { background: color-mix(in srgb, var(--card) 96%, transparent); }
.app-ver { text-align: center; font-size: 11px; color: var(--hint); opacity: .5; margin-top: 14px; }

/* ---------- переходы Меню v2: сцена внутри страницы (без position: fixed — для Safari на iPhone) ---------- */
.nav-stage { position: relative; overflow: hidden; margin: 0 -16px; }
.nav-layer { position: relative; padding: 0 16px; background: var(--bg); will-change: transform; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.nav-layer::after { content: ''; position: absolute; inset: 0; background: #000; opacity: var(--dim, 0); pointer-events: none; }
.nav-abs { position: absolute; left: 0; right: 0; }
.nav-stage .nav-layer * { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
/* стартовые позиции (один кадр до начала движения) */
.nav-stage.prep-push .nav-flow { transform: translateX(100%); z-index: 2; }
.nav-stage.prep-pop .nav-abs { z-index: 2; }
.nav-stage.prep-pop .nav-flow { transform: translateX(-30%); --dim: .35; }
/* вперёд: новый (в потоке) наезжает справа, старый уходит влево и темнеет */
.nav-stage.push .nav-flow { z-index: 2; animation: nl-in .44s var(--ios) both; box-shadow: -10px 0 30px rgba(0,0,0,.25); }
.nav-stage.push .nav-abs { z-index: 1; animation: nl-out-left .44s var(--ios) both; }
.nav-stage.push .nav-abs::after { animation: nl-dim .44s var(--ios) both; }
@keyframes nl-in { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes nl-out-left { from { transform: translateX(0); } to { transform: translateX(-30%); } }
@keyframes nl-dim { from { opacity: 0; } to { opacity: .35; } }
/* назад: раздел (поверх) уезжает вправо, меню выходит из-под него */
.nav-stage.pop .nav-abs { z-index: 2; animation: nl-out-right .44s var(--ios) both; box-shadow: -10px 0 30px rgba(0,0,0,.25); }
.nav-stage.pop .nav-flow { z-index: 1; animation: nl-back .44s var(--ios) both; }
.nav-stage.pop .nav-flow::after { animation: nl-undim .44s var(--ios) both; }
@keyframes nl-out-right { from { transform: translateX(0); } to { transform: translateX(100%); } }
@keyframes nl-back { from { transform: translateX(-30%); } to { transform: translateX(0); } }
@keyframes nl-undim { from { opacity: .35; } to { opacity: 0; } }
/* свайп пальцем */
.nav-stage.dragging .nav-flow { z-index: 2; box-shadow: -10px 0 30px rgba(0,0,0,.25); }
.nav-stage.dragging .nav-abs { z-index: 1; transform: translateX(-30%); --dim: .35; }
.nav-stage.settle .nav-layer { transition: transform .3s var(--ios); }
.nav-stage.settle .nav-layer::after { transition: opacity .3s var(--ios); }
body { overflow-x: hidden; }
/* «Ты: #…» в рейтинге: во время перехода спрятана, потом плавно всплывает */
.nav-stage .rt-me { opacity: 0; }
.rt-me.appear { animation: rt-me-in .45s cubic-bezier(.32,.72,0,1) both; }
@keyframes rt-me-in { from { opacity: 0; transform: translateY(24px) scale(.97); } }

/* истории большого обновления */
.st-tiles.three { grid-template-columns: repeat(3, 1fr); gap: 8px; }
.st-tiles.three .st-tile { padding: 12px; gap: 12px; }
.st-tiles.three .st-tile b { font-size: 14px; }
.st-plate { display: flex; flex-direction: column; align-items: center; gap: 16px; width: 100%; padding: 30px 0; border-radius: 22px; transition: background .6s; }
.st-plate .plate { font-size: 42px; }
.st-plate.lit { background: radial-gradient(60% 80% at 50% 40%, rgba(255,55,95,.45), transparent 75%); }
.st-plate.lit .plate { box-shadow: 0 0 22px #ff375f, 0 0 60px rgba(255,55,95,.6); }
.st-pl-val { display: flex; align-items: center; gap: 10px; font-size: 26px; opacity: 0; animation: st-show .5s 2.3s forwards; }
.st-onc { width: 100%; text-align: center; }
.st-onc-car { width: 86%; margin: 0 auto; animation: st-up .5s .2s var(--ios) backwards; }
.st-onc-plate { display: flex; justify-content: center; margin-top: 8px; }
.st-onc-plate .plate { font-size: 26px; animation: st-plate-in .7s 1s var(--spring) backwards; }
@keyframes st-plate-in { from { opacity: 0; transform: translateY(-60px) scale(1.4) rotate(-6deg); } }
.st-onc-sum { margin-top: 18px; font-size: 18px; color: rgba(255,255,255,.7); opacity: 0; animation: st-show .5s 1.7s forwards; }
.st-onc-sum span { text-decoration: line-through; }
.st-onc-sum b { color: #30d158; font-size: 26px; display: block; margin-top: 4px; text-shadow: 0 0 18px rgba(48,209,88,.6); }
.st-rating { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.st-rt-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,.07);
  animation: st-tile-in .6s calc(.4s + var(--i) * .25s) var(--spring) backwards; }
.st-rt-row span { width: 26px; text-align: center; font-weight: 800; }
.st-rt-row b { flex: 1; }
.st-rt-row em { font-style: normal; font-weight: 800; color: #ffd60a; }
.st-rt-row.top1 { background: linear-gradient(90deg, rgba(255,214,10,.3), rgba(255,255,255,.05)); }
.st-rt-row.top2 { background: linear-gradient(90deg, rgba(200,200,210,.25), rgba(255,255,255,.05)); }
.st-rt-row.top3 { background: linear-gradient(90deg, rgba(205,127,50,.3), rgba(255,255,255,.05)); }
.st-rt-me { margin-top: 6px; padding: 12px 14px; border-radius: 14px; background: rgba(var(--accent-rgb),.25); border: 1px solid rgba(var(--accent-rgb),.6);
  animation: st-tile-in .6s 1.8s var(--spring) backwards; }
.st-museum .car-plate { position: relative; z-index: 1; }
.st-museum .car-plate .plate { font-size: 22px; }
.st-grid.four { grid-template-columns: 1fr 1fr; }
.st-grid.four .st-cc small { display: block; text-align: center; font-size: 11px; margin-top: 4px; opacity: 0; animation: st-hide-r .3s calc(.7s + var(--i) * .3s) forwards; }

/* админка: номера игрока */
.adm-plates { display: flex; flex-direction: column; gap: 8px; }
.adm-plate { display: flex; align-items: center; gap: 10px; }
.adm-plate .info { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.fuel-bar { height: 6px; margin-top: 8px; border-radius: 3px; background: var(--fill); overflow: hidden; }
.fuel-bar i { display: block; height: 100%; background: linear-gradient(90deg, #ff9f0a, #ffd60a); border-radius: inherit; transition: width .4s; }

.cd-note { font-size: 14px; margin-bottom: 10px; border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }

/* номер в шторке: не едет вместе со всеми, а мягко появляется сам; покачивание — когда шторка уже открылась */
.sheet-body.opening > .plate-stage { animation: none; }
.plate-stage.sheet .plate3d { will-change: transform, opacity; }
.sheet-body.opening .plate-stage.sheet .plate3d { animation: pl-in .55s .12s cubic-bezier(.32,.72,0,1) backwards; }
@keyframes pl-in { from { opacity: 0; transform: translateY(14px) scale(.94); } }
.plate-stage.sheet .plate3d .plate { animation-delay: .8s; }


/* ---------- магазин ---------- */
.st-hero { position: relative; overflow: hidden; border-radius: 22px; padding: 18px 16px 16px; margin-bottom: 14px; color: #fff;
  background: radial-gradient(120% 100% at 100% 0%, rgba(255, 196, 0, .55), transparent 55%), linear-gradient(150deg, #5b2bd6, #2a1170 70%);
  box-shadow: 0 0 22px rgba(124, 77, 255, .45), inset 0 1px 0 rgba(255,255,255,.25); }
.st-hero-tag { position: absolute; top: 14px; right: 14px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px;
  padding: 3px 8px; border-radius: 999px; background: rgba(255,255,255,.18); }
.st-hero-t { font-size: 22px; font-weight: 800; margin-bottom: 10px; }
.st-hero-items { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; font-size: 14px; font-weight: 600; margin-bottom: 14px; }
.st-hero-items span { display: flex; align-items: center; gap: 6px; }
.btn.gold { background: linear-gradient(180deg, #ffd54a, #f5a400); color: #3a2400; }
.btn .emo, .pill .emo { vertical-align: -2px; }
.st-buy b, .st-price b, .st-pill b, .vip-card .btn b { margin-left: 4px; }
.vip-card { border-radius: 22px; padding: 16px; margin-bottom: 6px; display: flex; flex-direction: column; gap: 10px;
  background: linear-gradient(160deg, rgba(255, 196, 0, .22), rgba(255, 196, 0, .05)), var(--card);
  border: 1px solid rgba(255, 196, 0, .55); box-shadow: 0 0 18px rgba(255, 196, 0, .25); }
.vip-card.on { box-shadow: 0 0 26px rgba(255, 196, 0, .5); }
.vip-top { display: flex; align-items: center; gap: 10px; }
.vip-t { font-size: 22px; font-weight: 900; letter-spacing: 1px; background: linear-gradient(180deg, #ffe07a, #e09a00); -webkit-background-clip: text; background-clip: text; color: transparent; }
.vip-sub { font-size: 13px; color: var(--hint); }
.vip-perks { display: flex; flex-direction: column; gap: 7px; font-size: 14px; }
.vip-perks div { display: flex; align-items: center; gap: 8px; }
.vip-note { font-size: 13px; color: var(--hint); text-align: center; }
.vip-badge { display: inline-block; vertical-align: 3px; font-size: 11px; font-weight: 900; letter-spacing: .5px; padding: 2px 6px; border-radius: 6px;
  color: #3a2400; background: linear-gradient(180deg, #ffe07a, #f5a400); box-shadow: 0 0 10px rgba(255, 196, 0, .6); }
.st-packs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.st-pack { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 8px 12px; border-radius: 18px;
  background: var(--card); border: 1px solid rgba(52, 199, 89, .35); box-shadow: 0 0 14px rgba(52, 199, 89, .15);
  transition: transform .25s var(--spring); }
.st-pack:active { transform: scale(.96); }
.st-pack:last-child:nth-child(odd) { grid-column: span 2; }
.st-pack-m { font-size: 18px; font-weight: 800; }
.st-price { display: inline-flex; align-items: center; padding: 6px 14px; border-radius: 999px; background: var(--fill); font-size: 15px; }
.st-bonus { position: absolute; top: 8px; right: 8px; font-size: 11px; font-weight: 800; padding: 2px 6px; border-radius: 6px; color: #fff; background: var(--ok); }
.st-pill { display: inline-flex; align-items: center; white-space: nowrap; }
.st-pack.armed .st-price { background: var(--bad); color: #fff; }

/* ---------- торговая площадка ---------- */
.mk-filters { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 12px; }
.mk-search { margin: 0; }
.mk-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
.mk-chips::-webkit-scrollbar { display: none; }
.mk-chips button { flex: none; padding: 7px 13px; border-radius: 999px; background: var(--fill); font-size: 14px; font-weight: 600; color: var(--hint); transition: background .2s, color .2s; }
.mk-chips button.on { background: var(--accent); color: var(--on-accent); }
.mk-chips.sm button { padding: 5px 11px; font-size: 13px; }
.sheet-body .mk-chips { margin: 0 0 12px; padding: 0; }
.mk-row .info { min-width: 0; }
.mk-row .info .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mk-pic { width: 72px; flex: none; margin-right: 10px; display: flex; justify-content: center; }
.mk-pic img { width: 100%; height: auto; }
.mk-pic.plate-pic { width: auto; }
.mk-pic.plate-pic .plate.mini { font-size: 14px; }
.mk-row .ic.part-ic { margin-right: 10px; }
.mk-plate { margin-top: 4px; }
.mk-plate .plate.mini { font-size: 11px; }
.mk-row .r.col { align-items: flex-end; gap: 3px; text-align: right; flex: none; }
.mk-d { font-size: 12px; font-weight: 700; color: var(--hint); }
.mk-d.good { color: var(--ok); }
.mk-d.bad { color: var(--bad); }
.mk-big { display: flex; justify-content: center; padding: 6px 0; }
.mk-big > .pic { width: 84%; }
.mk-big.part img { filter: drop-shadow(0 0 18px var(--rc)); }
.mk-center { text-align: center; margin: 6px 0 10px; }
.mk-parts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 10px; }
.mk-price { margin: 4px 0 12px; text-align: center; }
.mk-price-v { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; }
.mk-price-k { font-size: 13px; color: var(--hint); margin: 2px 0 10px; }
.mk-price input[type=range] { width: 100%; accent-color: var(--accent); }
.mk-range-l { display: flex; justify-content: space-between; font-size: 11px; color: var(--hint); margin-bottom: 6px; }
.mk-price .list-row { padding-left: 0; padding-right: 0; background: none; }
.mk-qty { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 10px; }
.promo-input.mk-search { font-size: 16px; font-weight: 500; text-align: left; padding: 10px 14px; letter-spacing: 0; text-transform: none; }
.mk-big.part { height: 150px; }
.mk-big.part > .pic { width: 150px; height: 150px; }
.mk-range-l { position: relative; height: 14px; }
.mk-range-l span { position: absolute; top: 0; }
.mk-range-l span:nth-child(1) { left: 0; }
.mk-range-l span:nth-child(2) { left: calc(20% - 6px); transform: translateX(-50%); }
.mk-range-l span:nth-child(3) { right: 0; }

/* рынок плиткой: квадраты по 2 в ряд */
.mk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mk-card { position: relative; aspect-ratio: 1; display: flex; flex-direction: column; align-items: stretch; text-align: left;
  padding: 10px 11px 10px; border-radius: 18px; background: var(--card); overflow: hidden; min-width: 0;
  border: 1px solid color-mix(in srgb, var(--rc) 35%, transparent);
  background-image: radial-gradient(90% 60% at 50% 30%, color-mix(in srgb, var(--rc) 18%, transparent), transparent 70%);
  transition: transform .25s var(--spring); animation: sheet-item .45s calc(var(--i) * 25ms) cubic-bezier(.32,.72,0,1) backwards; }
.mk-card:active { transform: scale(.96); }
.mk-dot { position: absolute; top: 9px; left: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--rc); box-shadow: 0 0 8px var(--rc); }
.mk-card-pic { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.mk-card.k-car .mk-card-pic .pic { width: 100%; }
.mk-card.k-part .mk-card-pic .pic { width: auto; height: 100%; aspect-ratio: 1; }
.mk-card.k-part .mk-card-pic img { filter: drop-shadow(0 0 10px color-mix(in srgb, var(--rc) 70%, transparent)); }
.mk-card.k-plate .plate.mini { font-size: 19px; }
.mk-card-plate { position: absolute; top: 6px; right: 8px; }
.mk-card-plate .plate.mini { font-size: 10px; }
.mk-card-t { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 4px; }
.mk-card-s { font-size: 12px; color: var(--hint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mk-card-s .badge { font-size: 10px; }
.mk-card-p { display: flex; align-items: baseline; justify-content: space-between; gap: 4px; margin-top: 4px; }
.mk-card-p b { font-size: 15px; white-space: nowrap; }
.mk-card-p .mk-d { font-size: 11px; white-space: nowrap; }

/* ---------- контейнеры (аукционы) ---------- */
.auc-hero { padding: 14px 16px; border-radius: 20px; margin-bottom: 4px;
  background: radial-gradient(100% 120% at 0% 0%, rgba(191, 90, 242, .3), transparent 60%), var(--card); border: 1px solid rgba(191, 90, 242, .4); }
.auc-hero-t { font-size: 20px; font-weight: 800; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.auc-list { display: flex; flex-direction: column; gap: 10px; }
.auc-card { display: flex; gap: 14px; align-items: center; text-align: left; padding: 12px; border-radius: 18px; background: var(--card);
  border: 1px solid rgba(191, 90, 242, .3); transition: transform .25s var(--spring); }
.auc-card:active { transform: scale(.97); }
.auc-card.done { opacity: .75; }
.auc-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.auc-t { font-size: 17px; font-weight: 800; }
.auc-p { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.auc-time { font-size: 13px; color: var(--hint); font-variant-numeric: tabular-nums; }
.auc-time.big { font-size: 17px; font-weight: 700; color: var(--text); margin-top: 6px; }
.auc-st { font-size: 13px; font-weight: 700; color: var(--hint); }
.auc-st.good { color: var(--ok); }
.auc-st.bad { color: var(--bad); }
.auc-stage { display: flex; justify-content: center; padding: 10px 0 6px; }
.auc-now { text-align: center; margin: 6px 0 12px; }
.auc-price { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; }
.auc-x { margin-bottom: 6px; }
.auc-bids { display: flex; flex-direction: column; gap: 8px; }
.auc-lead { display: flex; align-items: center; gap: 10px; font-size: 14px; }

/* контейнер спереди: рифлёные двери, запоры, номер */
.cont { --w: 260px; position: relative; width: var(--w); aspect-ratio: 1.15; border-radius: 6px; perspective: 900px;
  background: #111; box-shadow: 0 12px 30px rgba(0,0,0,.45), 0 0 0 3px color-mix(in srgb, var(--cc) 70%, #000); flex: none; }
.cont.mini { --w: 96px; border-radius: 4px; box-shadow: 0 4px 12px rgba(0,0,0,.35), 0 0 0 2px color-mix(in srgb, var(--cc) 70%, #000); }
.auc-stage.big .cont { --w: 290px; }
.cont-in { position: absolute; inset: 6%; display: flex; align-items: center; justify-content: center; overflow: hidden; border-radius: 3px;
  background: radial-gradient(70% 60% at 50% 60%, #3a3326, #0b0a08); }
.cont-in .pic { width: 92%; opacity: 0; transform: scale(.7); transition: opacity .6s .5s, transform .9s .5s var(--spring); }
.cont.open .cont-in .pic, .cont.opening .cont-in .pic { opacity: 1; transform: none; }
.cont-light { position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(60% 50% at 50% 55%, rgba(255, 230, 160, .7), transparent 70%); transition: opacity .8s .3s; }
.cont.opening .cont-light, .cont.open .cont-light { opacity: .55; }
.cont-door { position: absolute; top: 0; bottom: 0; width: 50%; display: flex; justify-content: space-evenly;
  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,.28) 0 2px, transparent 2px 9%, rgba(255,255,255,.12) 9% calc(9% + 2px), transparent calc(9% + 2px) 18%),
    linear-gradient(180deg, color-mix(in srgb, var(--cc) 100%, #fff 12%), color-mix(in srgb, var(--cc) 75%, #000));
  border: 2px solid color-mix(in srgb, var(--cc) 55%, #000); backface-visibility: hidden;
  transition: transform 1.1s cubic-bezier(.5,.05,.25,1); }
.cont-door.l { left: 0; transform-origin: left center; border-right-width: 1px; }
.cont-door.r { right: 0; transform-origin: right center; border-left-width: 1px; }
.cont-door i { width: 5%; margin: 4% 0; border-radius: 3px; background: linear-gradient(90deg, #8d9399, #e3e6ea 50%, #7d8287); box-shadow: 0 1px 2px rgba(0,0,0,.5); }
.cont-no { position: absolute; top: 8%; left: 50%; transform: translateX(-50%); font-size: calc(var(--w) * .085); font-weight: 900; color: rgba(255,255,255,.85);
  text-shadow: 0 1px 2px rgba(0,0,0,.5); letter-spacing: .5px; }
.cont-lock { position: absolute; left: 6%; top: 50%; transform: translateY(-50%); }
.cont.mini .cont-lock .emo { width: 11px; height: 11px; font-size: 11px; }
.cont.open .cont-door.l, .cont.opening .cont-door.l { transform: rotateY(-105deg); }
.cont.open .cont-door.r, .cont.opening .cont-door.r { transform: rotateY(105deg); }
.cont.opening { animation: cont-shake .45s ease-in-out; }
@keyframes cont-shake { 0%, 100% { translate: 0; } 25% { translate: -3px 0; } 50% { translate: 3px 0; } 75% { translate: -2px 0; } }

/* плашка аукциона сверху гаража */
#auc-banners:empty { display: none; }
#auc-banners { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.auc-banner { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px 12px; border-radius: 16px;
  background: linear-gradient(100deg, color-mix(in srgb, var(--cc) 30%, var(--card)), var(--card) 75%);
  border: 1px solid color-mix(in srgb, var(--cc) 60%, transparent); box-shadow: 0 0 16px color-mix(in srgb, var(--cc) 30%, transparent);
  transition: transform .25s var(--spring); animation: sheet-item .5s cubic-bezier(.32,.72,0,1) backwards; }
.auc-banner:active { transform: scale(.97); }
.auc-banner.won { animation: auc-pulse 1.6s ease-in-out infinite; }
@keyframes auc-pulse { 50% { box-shadow: 0 0 26px color-mix(in srgb, var(--cc) 70%, transparent); } }
.auc-b-ic { flex: none; }
.auc-b-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.auc-b-txt b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.auc-b-txt em { font-style: normal; color: #ff5a5f; }
.auc-banner.lead .auc-b-txt em { color: var(--ok); }
.auc-b-txt span { font-size: 13px; color: var(--hint); font-variant-numeric: tabular-nums; }
.auc-banner svg { width: 8px; height: 14px; color: var(--hint); flex: none; }
.cont.tiny { --w: 44px; border-radius: 4px; box-shadow: 0 0 0 2px color-mix(in srgb, var(--cc) 70%, #000); }
.cont.tiny .cont-no, .cont.tiny .cont-lock { display: none; }
.cont.tiny .cont-door i { width: 7%; margin: 10% 0; }

/* контейнер: фото вместо рисунка; номер поверх */
#auc-banners { width: 100%; }
.cont-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.cont.has-photo { background: none; box-shadow: none; }
.cont.has-photo .cont-door { display: none; }
.cont.has-photo .cont-photo { filter: drop-shadow(0 10px 18px rgba(0,0,0,.45)); }
.cont-no { z-index: 2; }
.cont.tiny .cont-photo { filter: none; }
/* открытие: контейнер тает, под ним серый силуэт, затем машина в цвете */
.auc-reveal { position: relative; display: grid; place-items: center; min-height: 250px; }
.auc-reveal > * { grid-area: 1 / 1; }
.auc-reveal .cont { z-index: 1; transition: opacity 2.2s cubic-bezier(.4,0,.2,1), transform 2.4s cubic-bezier(.2,.7,.2,1), filter 2.2s ease; }
.auc-reveal.vanish .cont { opacity: 0; transform: scale(1.06); filter: blur(6px); }
.auc-car { position: relative; width: 300px; max-width: 92%; }
.auc-car .pic { width: 100%; }
.auc-car .pic > img, .auc-car .pic > svg { transition: filter 1s ease, opacity 1s ease; }
.auc-car .pic { transition: transform 1s var(--spring); }
.auc-car.shown .pic { transform: scale(1.06); }
.auc-glow { position: absolute; inset: -20% -10%; border-radius: 50%; opacity: 0; transition: opacity 1s ease;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--cc, #ffd60a) 55%, transparent), transparent); pointer-events: none; }
.auc-car.shown .auc-glow { opacity: .9; }
.auc-stage > .auc-car { margin: 10px 0; }
.auc-reveal .auc-car { transition: opacity 1.4s .5s ease; }
.auc-reveal:not(.vanish) .auc-car { opacity: 0; }
a.btn { display: flex; align-items: center; justify-content: center; text-decoration: none; }

/* ---------- подарок от админа ---------- */
#gift-banner-slot:empty { display: none; }
#gift-banner-slot { margin-bottom: 12px; }
.gift-banner { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px 12px; border-radius: 16px;
  background: linear-gradient(100deg, rgba(255, 196, 0, .32), var(--card) 80%); border: 1px solid rgba(255, 196, 0, .6);
  box-shadow: 0 0 18px rgba(255, 196, 0, .3); animation: gift-glow 2s ease-in-out infinite; transition: transform .25s var(--spring); }
.gift-banner:active { transform: scale(.97); }
@keyframes gift-glow { 50% { box-shadow: 0 0 28px rgba(255, 196, 0, .6); } }
.gift-ic { position: relative; flex: none; animation: gift-wobble 2.4s ease-in-out infinite; }
@keyframes gift-wobble { 0%, 70%, 100% { transform: none; } 76% { transform: rotate(-10deg); } 82% { transform: rotate(9deg); } 88% { transform: rotate(-5deg); } }
.gift-case { position: absolute; right: -8px; bottom: -6px; }
.gift-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.gift-txt b { font-size: 16px; }
.gift-txt em { font-style: normal; color: #f5a400; }
.gift-txt span { font-size: 13px; color: var(--hint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gift-pill { flex: none; background: linear-gradient(180deg, #ffd54a, #f5a400) !important; color: #3a2400 !important; font-weight: 700; }
.gift-stage { display: grid; place-items: center; height: 150px; }
.gift-big { filter: drop-shadow(0 0 22px rgba(255, 196, 0, .7)); animation: gift-float 3s ease-in-out infinite; }
@keyframes gift-float { 50% { transform: translateY(-8px) scale(1.04); } }
.gift-stage.opening .gift-big { animation: gift-burst .9s ease-in forwards; }
@keyframes gift-burst { 0% { transform: none; } 15% { transform: rotate(-12deg) scale(1.05); } 30% { transform: rotate(12deg) scale(1.1); }
  45% { transform: rotate(-10deg) scale(1.15); } 60% { transform: rotate(8deg) scale(1.2); filter: drop-shadow(0 0 30px #ffd60a) brightness(1.3); }
  100% { transform: scale(1.8); opacity: 0; filter: drop-shadow(0 0 60px #fff) brightness(2); } }
.gift-head { text-align: center; margin: 4px 0 16px; }
.gift-name { font-size: 20px; font-weight: 800; margin-bottom: 4px; }

/* ---------- уведомление сверху «островок»: из таблетки раскрывается в карточку ---------- */
.island { position: fixed; z-index: 900; top: calc(var(--sat) + var(--cst) + 8px); left: 0; right: 0; margin: 0 auto;   /* по центру без translate(-50%): в Safari он отставал от анимации ширины */
  width: 118px; height: 34px; border-radius: 20px; overflow: hidden; pointer-events: none;
  background: #050506; box-shadow: 0 10px 30px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.08);
  opacity: 0; transform: translateY(-48px) scale(.7);
  transition: width .55s cubic-bezier(.32,1.25,.5,1), height .55s cubic-bezier(.32,1.25,.5,1), border-radius .5s ease,
    transform .5s cubic-bezier(.32,1.2,.5,1), opacity .3s ease; }
.island.pop { opacity: 1; transform: none; }
.island.show { width: min(calc(100vw - 20px), 440px); height: 70px; border-radius: 26px; pointer-events: auto;
  box-shadow: 0 14px 36px rgba(0,0,0,.5), 0 0 0 1px rgba(255, 196, 0, .35), 0 0 24px rgba(255, 196, 0, .22); }
.isl-in { display: flex; align-items: center; gap: 12px; height: 70px; padding: 0 12px 0 16px; opacity: 0; filter: blur(4px);
  transform: scale(.94); transition: opacity .3s ease, filter .3s ease, transform .4s cubic-bezier(.32,1.2,.5,1); }
.island.show .isl-in { opacity: 1; filter: none; transform: none; transition-delay: .18s; }
.isl-ic { position: relative; flex: none; animation: gift-wobble 2.4s ease-in-out infinite; }
.isl-case { position: absolute; right: -7px; bottom: -5px; }
.isl-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; color: #fff; }
.isl-txt b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.isl-txt span { font-size: 13px; color: rgba(255,255,255,.6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.isl-btn { flex: none; padding: 9px 16px; border-radius: 999px; font-size: 15px; font-weight: 700; color: #3a2400;
  background: linear-gradient(180deg, #ffd54a, #f5a400); transition: transform .2s var(--spring); }
.isl-btn:active { transform: scale(.94); }

/* контейнер сбоку (окно аукциона): длинный рифлёный борт, угловые фитинги, номер */
.cont.side { --w: 320px; width: min(var(--w), 92vw); aspect-ratio: 2.35; border-radius: 4px; perspective: none; background: none;
  box-shadow: 0 14px 30px rgba(0,0,0,.45); }
.auc-stage.big .cont.side { --w: 340px; }
.cont-ribs { position: absolute; inset: 0; border-radius: 4px; border: 3px solid color-mix(in srgb, var(--cc) 55%, #000);
  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,.30) 0 2px, transparent 2px 3.2%, rgba(255,255,255,.14) 3.2% calc(3.2% + 2px), transparent calc(3.2% + 2px) 6.4%),
    linear-gradient(180deg, color-mix(in srgb, var(--cc) 100%, #fff 14%), color-mix(in srgb, var(--cc) 72%, #000)); }
.cont-corner { position: absolute; width: 5%; height: 12%; background: color-mix(in srgb, var(--cc) 45%, #000); border-radius: 2px; }
.cont-corner.tl { left: 0; top: 0; } .cont-corner.tr { right: 0; top: 0; } .cont-corner.bl { left: 0; bottom: 0; } .cont-corner.br { right: 0; bottom: 0; }
.cont.side .cont-no { top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 30px; color: rgba(255,255,255,.88); letter-spacing: 2px; }
.cont.side.has-photo .cont-ribs, .cont.side.has-photo .cont-corner { display: none; }
.cont.side.has-photo { box-shadow: none; }
.cont.side.has-photo .cont-no { top: 18%; font-size: 22px; }
.cont.has-photo .cont-photo { filter: var(--tint) drop-shadow(0 10px 18px rgba(0,0,0,.45)); }
.cont.tiny.has-photo .cont-photo { filter: var(--tint); }

/* покраска: машина плавно перетекает в новый цвет, кружки выбираются плавно */
.paint-preview .pic img.paint-layer { opacity: 0; filter: saturate(1.4) brightness(1.1); transition: opacity .6s ease, filter .9s ease; }
.paint-preview .pic img.paint-layer.show { opacity: 1; filter: none; }
.paint-preview .pic.pulse { animation: paint-pulse .6s cubic-bezier(.32,.72,0,1); }
@keyframes paint-pulse { 40% { transform: scale(1.025); } }
.paint-name.swap { animation: paint-name .35s ease; }
@keyframes paint-name { from { opacity: 0; transform: translateY(4px); } }
.swatch i { transition: box-shadow .3s ease, transform .35s var(--spring); }
.swatch.on i { transform: scale(1.12); }
.swatch span { transition: color .25s ease; }
.swatch:active i { transform: scale(.88); }

/* кнопка «Поддержка» внизу Меню */
.menu-support { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 18px auto 0; padding: 11px 22px; border-radius: 999px;
  font-size: 15px; font-weight: 600; color: var(--text); background: var(--glass); border: 1px solid rgba(var(--accent-rgb), .35);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); box-shadow: 0 0 14px rgba(var(--accent-rgb), .18); transition: transform .25s var(--spring); }
.menu-support:active { transform: scale(.95); }

/* ---------- сезоны ---------- */
.rt-season { border: 1px solid rgba(255, 196, 0, .35); }
.rt-sprizes { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.rt-sp { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.rt-sp-place { flex: none; min-width: 52px; font-weight: 700; display: inline-flex; gap: 2px; align-items: center; }
.ss-hero { text-align: center; margin: 6px 0; animation: gift-float 3s ease-in-out infinite; }
.ss-title { text-align: center; font-size: 22px; font-weight: 800; }
.ss-place { text-align: center; color: var(--hint); margin: 4px 0 14px; }
.ss-place b { color: var(--text); font-size: 18px; }
.st-balance { display: flex; align-items: center; gap: 8px; padding: 12px 14px; margin-bottom: 12px; border-radius: 16px; background: var(--card);
  border: 1px solid rgba(255, 196, 0, .35); font-size: 15px; }
.st-balance span { flex: 1; color: var(--hint); }
.st-balance b { font-size: 20px; }
.hall-head { border: 1px solid rgba(212, 160, 23, .45); margin-bottom: 10px; }
.hall-grid { margin-bottom: 16px; }
.prof-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 6px 0; }
.prof-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px;
  background: rgba(255, 196, 0, .15); color: #f5a400; border: 1px solid rgba(255, 196, 0, .4); }

/* плитка «Рейтинг» за сутки до конца сезона — пульсирует */
.menu-tile.hot { animation: tile-hot 1.6s ease-in-out infinite; }
@keyframes tile-hot { 50% { box-shadow: inset 0 1px 0 var(--glass-hi), 0 0 34px rgba(var(--glow), .8); } }

/* «Что внутри» кейса */
.case-top { display: flex; align-items: center; justify-content: center; gap: 8px; max-width: 100%; }
.case-info { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--card); font: 700 italic 17px Georgia, serif;
  color: var(--hint); transition: transform .25s var(--spring); }
.case-info:active { transform: scale(.9); }
body.spinning .case-info { pointer-events: none; opacity: .5; }
.odds-head { display: flex; align-items: center; gap: 8px; font-size: 18px; margin: 2px 4px 6px; }
.odds-cls { display: flex; align-items: center; justify-content: space-between; margin: 16px 4px 8px; font-size: 16px; }
.odds-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.odds-car { background: var(--card); border-radius: 14px; padding: 8px 6px; text-align: center; border-bottom: 2px solid var(--rc); min-width: 0; }
.odds-car img:not(.emo), .odds-car svg { width: 100%; height: 52px; object-fit: contain; }
.odds-car .n { font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 4px; }
.odds-car .p { font-size: 12px; color: var(--hint); margin-top: 2px; }
.odds-row .ic img { width: 44px; height: 44px; object-fit: contain; }
.odds-car .p .emo { width: 11px; height: 11px; vertical-align: -1px; }

/* бонус за машины одной страны */
.inc-sets { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; margin-top: 8px; text-align: center; }
.inc-set { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px;
  background: rgba(52, 199, 89, .15); color: #30d158; border: 1px solid rgba(52, 199, 89, .4); }

/* полный комплект деталей */
.full-set { width: fit-content; margin: 8px auto 0; font-size: 13px; font-weight: 700; padding: 5px 12px; border-radius: 999px;
  color: #fff; background: color-mix(in srgb, var(--rc) 35%, transparent); border: 1px solid var(--rc); }

/* ---------- гонки с друзьями ---------- */
.duel-head { margin-top: 12px; }
.duel-code { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: rgba(127,127,127,.12); }
.duel-code b { flex: 1; font-size: 17px; letter-spacing: .5px; }
.link-btn { color: var(--accent); font-size: 14px; font-weight: 600; }
.duel-ava { position: relative; }
.duel-ava .dot { position: absolute; right: 2px; bottom: 2px; width: 11px; height: 11px; border-radius: 50%; background: #8e8e93; border: 2px solid var(--card); }
.duel-ava .dot.on { background: #30d158; }
.ok { color: #30d158; } .bad { color: #ff453a; }
.duel-active { margin-top: 12px; text-align: center; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.duel-active.go { border: 1px solid rgba(255, 59, 48, .5); box-shadow: 0 0 24px rgba(255, 59, 48, .25); }
.duel-active.in { border: 1px solid rgba(255, 196, 0, .5); }
.duel-active .btn, .duel-active .row-btns { width: 100%; margin-top: 4px; }
.duel-vs { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; }
.duel-vs img, .duel-vs svg { width: 42%; max-height: 70px; object-fit: contain; }
.duel-vs.big img, .duel-vs.big svg { max-height: 96px; }
.duel-vs .vs { font-weight: 900; font-style: italic; font-size: 22px; color: #ff453a; }
.duel-active .duel-vs img:only-child, .duel-active .duel-vs svg:only-child { width: 55%; }
.duel-names { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; padding: 0 6px; }
.duel-bet input { width: 100%; font-size: 22px; font-weight: 700; padding: 10px 12px; border-radius: 12px; border: 0; background: rgba(127,127,127,.14); color: var(--text); }
.duel-bet .duel-quick { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 8px; }
.duel-bet-fixed { display: flex; justify-content: space-between; align-items: center; font-size: 18px; margin: 12px 0; }
.duel-active + .duel-head, .duel-friend .pill { flex: none; }

/* магазин в Telegram до релиза: одна крупная кнопка */
.st-live-wrap { display: flex; justify-content: center; }
.st-pack.st-live { width: 100%; max-width: 340px; padding: 22px 16px; }
.st-pack.st-live .st-pack-m { font-size: 26px; }

/* бонус за все задания дня */
.quest.all { border-top: 1px solid rgba(255, 196, 0, .3); }
.quest.all .ic { flex: none; }

/* ---------- сезонный пропуск ---------- */
.btn.pass-open { margin-top: 12px; background: linear-gradient(135deg, #5e5ce6, #bf5af2); }
.btn.pass-open.prem { background: linear-gradient(135deg, #f5a400, #ff9f0a); }
.pass-head.prem { border: 1px solid rgba(255, 196, 0, .45); }
.pass-prem-on { margin-top: 10px; text-align: center; font-weight: 700; color: #f5a400; }
.pass-cols { display: grid; grid-template-columns: 34px 1fr 1fr; gap: 6px; margin: 14px 0 6px; font-size: 12px; color: var(--hint); text-transform: uppercase; text-align: center; }
.pass-list { display: flex; flex-direction: column; gap: 6px; }
.pass-row { display: grid; grid-template-columns: 34px 1fr 1fr; gap: 6px; align-items: stretch; }
.pass-lv { display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; border-radius: 10px; background: var(--card); color: var(--hint); }
.pass-row.got .pass-lv { background: #5e5ce6; color: #fff; }
.pass-row.next .pass-lv { outline: 2px solid #5e5ce6; color: var(--text); }
.pass-cell { position: relative; display: flex; align-items: center; gap: 6px; padding: 8px; border-radius: 12px; background: var(--card); font-size: 12px; font-weight: 600; min-width: 0; }
.pass-cell span { overflow: hidden; text-overflow: ellipsis; }
.pass-cell.prem { background: color-mix(in srgb, #ff9f0a 14%, var(--card)); }
.pass-cell.locked { opacity: .55; }
.pass-row.big .pass-cell { padding: 12px 8px; font-size: 13px; }
.pass-row.got .pass-cell { opacity: .6; }
.pass-ok { position: absolute; right: 6px; top: 4px; font-style: normal; color: #30d158; font-weight: 800; }

/* островок пропуска — цвета пропуска (фиолетовый, у премиума — золото с фиолетовым) */
.island.pass.show { box-shadow: 0 14px 36px rgba(0,0,0,.5), 0 0 0 1px rgba(191, 90, 242, .55), 0 0 26px rgba(124, 92, 255, .35); }
.island.pass .isl-btn { color: #fff; background: linear-gradient(135deg, #5e5ce6, #bf5af2); }
.island.pass.prem .isl-btn { color: #3a2400; background: linear-gradient(135deg, #ffd54a, #f5a400); }
.island.pass.prem.show { box-shadow: 0 14px 36px rgba(0,0,0,.5), 0 0 0 1px rgba(191, 90, 242, .55), 0 0 26px rgba(255, 196, 0, .3); }

/* выбор плиток после открытия ×N */
.mtile[data-act="mpick"] { cursor: pointer; transition: transform .2s var(--spring), box-shadow .2s ease; }
.mtile.sel { transform: scale(.94); box-shadow: 0 0 0 3px var(--accent), 0 0 18px rgba(var(--accent-rgb), .5); }
.mtile.sel::after { content: '✓'; position: absolute; right: 6px; top: 6px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent); color: var(--on-accent); font-size: 13px; font-weight: 800; display: flex; align-items: center; justify-content: center; z-index: 3; }
/* продать детали по редкости */
.bulk-open { margin-bottom: 12px; }
.bulk-row .bulk-check { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--hint); display: flex; align-items: center;
  justify-content: center; font-size: 14px; font-weight: 800; color: #fff; transition: background .2s, border-color .2s; }
.bulk-row.on .bulk-check { background: var(--accent); border-color: var(--accent); }
.bulk-row[disabled] { opacity: .45; }

/* ---------- апгрейд ---------- */
.up-wrap { padding-top: 4px; }
.up-wheel { position: relative; width: min(78vw, 300px); aspect-ratio: 1; margin: 6px auto 18px; border-radius: 50%; transition: filter .4s; }
.up-wheel svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.up-track { fill: none; stroke: rgba(127,127,127,.22); stroke-width: 22; }
.up-arc { fill: none; stroke: #30d158; stroke-width: 22; stroke-linecap: butt; filter: drop-shadow(0 0 8px rgba(48,209,88,.6)); transition: d .25s ease; }
.up-ticks i { position: absolute; left: 50%; top: 0; width: 2px; height: 50%; margin-left: -1px; transform-origin: 50% 100%; }
.up-ticks i::before { content: ''; position: absolute; top: 3px; left: 0; width: 2px; height: 6px; border-radius: 1px; background: rgba(127,127,127,.35); }
.up-needle { position: absolute; inset: 0; pointer-events: none; }
.up-needle i { position: absolute; left: 50%; top: 4px; width: 0; height: 0; margin-left: -10px; border: 10px solid transparent; border-top: 26px solid #fff;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.6)); }
.up-center { position: absolute; inset: 26%; border-radius: 50%; background: var(--card); display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(127,127,127,.18); }
.up-center b { font-size: 34px; font-weight: 800; line-height: 1; }
.up-center span { font-size: 17px; font-weight: 700; color: #30d158; margin-top: 4px; }
.up-res { font-size: 14px; font-weight: 800; margin-top: 6px; animation: up-pop .4s var(--spring); }
.up-res.win { color: #30d158; } .up-res.lose { color: #ff453a; }
@keyframes up-pop { from { transform: scale(.5); opacity: 0; } }
.up-wheel.win { filter: drop-shadow(0 0 26px rgba(48,209,88,.7)); }
.up-wheel.lose { filter: drop-shadow(0 0 26px rgba(255,69,58,.6)); }
.up-card { margin-bottom: 10px; }
.up-card input[type=range] { width: 100%; margin: 12px 0 6px; accent-color: #30d158; }
.up-card input[type=number] { width: 100%; font-size: 22px; font-weight: 700; padding: 10px 12px; margin-top: 8px; border-radius: 12px; border: 0;
  background: rgba(127,127,127,.14); color: var(--text); }
.up-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.up-chips .pill.on { background: #30d158; color: #fff; }
.up-win { margin-top: 12px; }
.up-win b { color: #30d158; font-size: 18px; }
.btn.up-go { background: linear-gradient(135deg, #30d158, var(--accent)); }
.up-log { display: flex; flex-wrap: wrap; gap: 6px; }
.up-log span { font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 999px; background: var(--card); }
.up-log .win { color: #30d158; } .up-log .lose { color: #ff453a; }

/* выбор машин в гараже */
.grid.picking .car-card { transition: transform .2s var(--spring), box-shadow .2s ease; }
.car-card.sel { transform: scale(.95); box-shadow: 0 0 0 3px #ff453a, 0 0 18px rgba(255, 69, 58, .45); }
.car-card.sel::after { content: '✓'; position: absolute; right: 8px; bottom: 8px; width: 22px; height: 22px; border-radius: 50%; background: #ff453a;
  color: #fff; font-size: 13px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.car-card.dim { opacity: .35; }
.g-sellbar { position: sticky; bottom: calc(env(safe-area-inset-bottom) + 84px); z-index: 5; margin-top: 12px; }
.g-sellbar .btn { background: #ff3b30; color: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.55); }
.g-sellbar .btn:disabled { background: #3a3a3c; color: rgba(255,255,255,.6); opacity: 1; }

/* кнопка «Продать» уезжает после продажи: в ряду — сжимается по ширине, одна — по высоте */
.btn-row > .btn.collapse { flex-grow: 0.0001; padding-left: 0; padding-right: 0; margin-left: -10px; opacity: 0; white-space: nowrap; overflow: hidden;
  transition: flex-grow .36s cubic-bezier(.3,.8,.3,1), margin .36s, padding .36s, opacity .2s; }
.btn.sell-all.collapse { max-height: 0; padding-top: 0; padding-bottom: 0; margin-top: 0; opacity: 0; overflow: hidden;
  transition: max-height .36s ease, padding .36s, margin .36s, opacity .2s; }
.btn.sell-all { max-height: 70px; }

/* ---------- временные кейсы ---------- */
.ev-banner { position: relative; display: block; overflow: hidden; width: 100%; padding: 0; margin-bottom: 8px; border-radius: 18px; text-align: left;
  background: linear-gradient(135deg, rgba(255, 69, 58, .22), rgba(255, 159, 10, .18)); border: 1px solid rgba(255, 159, 10, .45); }
.ev-banner.on { border-color: #ff9f0a; box-shadow: 0 0 18px rgba(255, 159, 10, .35); }
.ev-ic { flex: none; animation: gift-wobble 2.4s ease-in-out infinite; }
.ev-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ev-txt b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-txt span { font-size: 12px; color: var(--hint); }
.ev-go { flex: none; font-size: 13px; font-weight: 700; padding: 7px 12px; border-radius: 999px; background: #ff9f0a; color: #241400; }
.ev-tag { position: absolute; right: 14px; bottom: 6px; font-size: 11px; color: #ff9f0a; }
.list-row:has(.ev-tag) { position: relative; }
.btn.ev-stars { margin-top: 8px; }
.ev-icons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; align-items: center; }
.ev-icon { width: 40px; height: 40px; border-radius: 12px; background: rgba(127,127,127,.14); display: flex; align-items: center; justify-content: center; }
.ev-icon.on { box-shadow: 0 0 0 2px #ff9f0a; }
.ev-icon-in { width: 70px !important; margin: 0 !important; text-align: center; }
.ev-pick { margin-top: 8px; }
.ev-cls { margin: 10px 2px 6px; }
.ev-cars { display: flex; flex-wrap: wrap; gap: 6px; }
.ev-cars .chip { cursor: pointer; }
.ev-cars .chip.on { background: #ff9f0a; color: #241400; font-weight: 700; }
.ev-sum { margin-top: 12px; }
.ev-sum b { font-size: 18px; }

.ev-track { display: flex; transition: transform .55s cubic-bezier(.4, 0, .2, 1); }
.ev-slide { flex: 0 0 100%; display: flex; align-items: center; gap: 12px; padding: 10px 12px; min-width: 0; }
.ev-dots { position: absolute; left: 50%; bottom: 4px; transform: translateX(-50%); display: flex; gap: 4px; }
.ev-dots i { width: 5px; height: 5px; border-radius: 50%; background: rgba(255,255,255,.3); transition: background .3s, width .3s; }
.ev-dots i.on { width: 12px; border-radius: 3px; background: #ff9f0a; }

/* фильтры машин во временном кейсе */
.ev-filters { display: flex; flex-direction: column; gap: 8px; }
.ev-filters .admin-input { margin: 0; }
.pill.ev-fr.on { background: var(--rc); color: #fff; }
.ev-price { display: flex; align-items: center; gap: 8px; }
.ev-price input { flex: 1; min-width: 0; }

.hall-empty { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; font-size: 13px; color: var(--hint); border: 1px dashed rgba(212, 160, 23, .45); }

/* аукционы на площадке */
.mk-card.auc { border: 1px solid rgba(255, 159, 10, .5); }
.mk-auc-tag { position: absolute; left: 8px; top: 8px; z-index: 2; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: rgba(255, 159, 10, .9); color: #241400; }
.mk-auc-now { margin-top: 12px; }
.mk-auc-price { font-size: 30px; font-weight: 800; margin: 4px 0; }
.mk-auc-bids { margin-top: 10px; }
.mk-buyout { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.mk-buyout input { width: 90px; margin: 0; }
.mk-buyout b { margin-left: auto; }

/* эксклюзивная машина, которой ещё нет: одинаковый силуэт со знаком вопроса — не угадать, что это */
.excl-mystery { position: relative; }
.excl-mystery .q { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 800; color: rgba(155, 225, 93, .8); }

/* гонка с другом: соперник едет отдельно — его дорожка скрыта */
.tv-row.ghost { opacity: .45; }
.tv-row.ghost .fill { opacity: 0; }
.tv-row.ghost .tv-v { font-size: 11px; }

/* номер шрифтом настоящих номеров (RoadNumbers, ГОСТ; GPL) — с релизным обновлением (.plate.gost) */
@font-face { font-family: 'RoadNumbers'; src: url('../fonts/roadnumbers.ttf?v=2') format('truetype'); font-display: swap; }
.plate.gost .pc, .plate.gost .real, .plate.gost .drum b, .plate.gost:not(.rolling):not(.stamped):not(.blank) .pc { font-family: 'RoadNumbers', 'Roboto', Arial, sans-serif; font-weight: normal; }
.plate.gost .pl-rus { font-family: Arial, 'Roboto', sans-serif; font-weight: 600; font-size: .24em; letter-spacing: .06em; gap: .3em; }   /* «RUS» в RoadNumbers пустой */
/* пропорции как у настоящего номера: буквы ниже цифр (так нарисованы в шрифте), регион ~2/3 высоты цифр */
.plate.gost .pl-main { align-items: flex-end; padding: .1em .18em .1em; }
.plate.gost .pl-main .pc { font-size: 1.32em; width: .55em; height: .72em; line-height: .72em; }
.plate.gost .pl-main .pc.l { font-size: 1.32em; width: .56em; }
.plate.gost .pl-main .pc.l + .pc.d, .plate.gost .pl-main .pc.d + .pc.l { margin-left: .06em; }
.plate.gost .pl-reg { padding: .08em .14em .06em; justify-content: space-between; }
.plate.gost .pl-rn .pc { font-size: .92em; width: .52em; height: .72em; line-height: .72em; }
.plate.gost .drum b { height: .72em; line-height: .72em; }   /* барабан — на той же высоте, что и готовый символ */

/* пакет ₽ на перезарядке */
.st-pack.cd { opacity: .55; }
.st-price.st-cd { font-size: 12px; color: var(--muted, #8e8e93); }
.st-price.st-cd b { font-variant-numeric: tabular-nums; }

/* значок «Основатель» */
.prof-badge.founder { color: var(--fc); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--fc) 60%, transparent); background: color-mix(in srgb, var(--fc) 14%, transparent); font-weight: 700; }

/* баланс: раскрывается до точной суммы (с обновлением) */
#balance { cursor: pointer; overflow: hidden; }
#balance.resizing { transition: width .36s cubic-bezier(.2,.8,.2,1), transform .3s var(--spring); animation: bal-in .36s ease; }
@keyframes bal-in { from { color: transparent; } 40% { color: transparent; } to { color: inherit; } }

/* выбор региона номера: код в «табличке» */
.pl-reg-code { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 26px; padding: 0 5px; box-sizing: border-box;
  border: 2px solid var(--text); border-radius: 5px; font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }

/* ---------- подработка: мини-игра «Мойка» (job.js) ---------- */
.job-stage { position: relative; margin: 8px 0 12px; padding: 18px 8px; border-radius: 22px; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 100%, rgba(90, 200, 250, .22), transparent 60%), var(--card); }
.job-stage img { display: block; width: 100%; height: auto; filter: saturate(.7) brightness(.85); transition: filter .6s; }
.job-stage.clean img { filter: none; }
.dirt { position: absolute; width: var(--s); height: var(--s); margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2); border: 0; padding: 0;
  transform: rotate(var(--r)); opacity: .95; touch-action: manipulation; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .35));
  /* брызги грязи: пятно + капли вокруг */
  background:
    radial-gradient(circle at 50% 50%, rgba(158, 120, 78, .97) 0 30%, rgba(158, 120, 78, 0) 46%),
    radial-gradient(circle at 26% 34%, rgba(170, 130, 86, .95) 0 13%, transparent 15%),
    radial-gradient(circle at 74% 30%, rgba(170, 130, 86, .95) 0 10%, transparent 12%),
    radial-gradient(circle at 70% 72%, rgba(150, 112, 72, .9) 0 15%, transparent 17%),
    radial-gradient(circle at 30% 74%, rgba(150, 112, 72, .85) 0 9%, transparent 11%),
    radial-gradient(circle at 88% 52%, rgba(150, 112, 72, .8) 0 5%, transparent 6%),
    radial-gradient(circle at 10% 56%, rgba(150, 112, 72, .8) 0 4%, transparent 5%),
    radial-gradient(circle at 52% 8%, rgba(150, 112, 72, .8) 0 4%, transparent 5%); }
.dirt.gone { animation: dirt-wash .45s ease-out forwards; pointer-events: none; }
@keyframes dirt-wash { 0% { opacity: 1; } 40% { transform: rotate(var(--r)) scale(1.15); filter: brightness(1.6) blur(1px); }
  100% { opacity: 0; transform: rotate(var(--r)) scale(.3); filter: blur(4px); } }
.job-shine { position: absolute; inset: 0; background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, .35) 50%, transparent 65%);
  transform: translateX(-100%); animation: job-shine 2.4s ease-in-out infinite; pointer-events: none; }
@keyframes job-shine { 60%, 100% { transform: translateX(100%); } }
.job-card { display: flex; flex-direction: column; gap: 8px; }
.job-card .t { font-weight: 600; display: flex; align-items: center; gap: 6px; }
.job-bar { height: 8px; border-radius: 4px; background: var(--fill); overflow: hidden; }
.job-bar i { display: block; height: 100%; background: linear-gradient(90deg, #5ac8fa, #34c759); transition: width .3s; }
.job-paid { text-align: center; font-size: 17px; margin: 4px 0 8px; animation: enter .4s var(--spring); }
.job-paid b { color: var(--ok); }

/* правила и условия (terms.js) */
.menu-terms { display: block; margin: 14px auto 0; font-size: 13px; color: var(--hint); text-decoration: underline; text-underline-offset: 3px; background: none; }
.link-inline { display: inline; padding: 0; font: inherit; color: var(--accent); background: none; text-decoration: underline; text-underline-offset: 2px; }
.terms-card p { margin: 0; font-size: 14px; line-height: 1.45; }
.terms-card p + p { margin-top: 10px; }

/* ---------- новое Меню (релиз): баннер пропуска, разделы, компактные плитки, красные точки ---------- */
.tabbar button.mdot::after { content: ''; position: absolute; top: 7px; right: 6px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--bad); box-shadow: 0 0 0 2px var(--bg); }
.menu-h { margin-top: 18px; }
.menu-grid.compact { gap: 10px; padding-top: 0; }
.menu-tile.compact { min-height: 0; padding: 11px 12px; border-radius: 18px;
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; row-gap: 1px; align-items: center; }
.menu-tile.compact .mt-icon { grid-row: span 2; margin: 0; }
.menu-tile.compact .mt-name { font-size: 15px; line-height: 1.2; }
.menu-tile.compact .mt-sub { font-size: 12px; min-height: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-tile.compact > span { min-width: 0; }
.menu-tile.compact.full { grid-column: span 2; }
.menu-tile.mdot::after, .pass-banner.mdot::after { content: ''; position: absolute; top: 9px; right: 9px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--bad); box-shadow: 0 0 0 2px rgba(0,0,0,.15), 0 0 8px rgba(255,59,48,.8); }

.pass-banner { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 8px; width: 100%; text-align: left;
  padding: 14px 15px 13px; border-radius: 22px; color: #fff;
  background: radial-gradient(120% 120% at 100% 0%, rgba(255,255,255,.22), transparent 55%), linear-gradient(135deg, #5e5ce6, #bf5af2);
  box-shadow: 0 0 22px rgba(175, 82, 222, .45), inset 0 1px 0 rgba(255,255,255,.35);
  transition: transform .25s var(--spring); }
.pass-banner.prem { background: radial-gradient(120% 120% at 100% 0%, rgba(255,255,255,.28), transparent 55%), linear-gradient(135deg, #f5a400, #ff6a00);
  box-shadow: 0 0 22px rgba(255, 159, 10, .45), inset 0 1px 0 rgba(255,255,255,.4); }
.pass-banner:active { transform: scale(.97); }
.pass-banner .pb-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 16px; }
.pass-banner .pb-top b { display: flex; align-items: center; gap: 6px; }
.pass-banner .pb-lv { font-weight: 800; font-size: 15px; padding: 2px 9px; border-radius: 999px; background: rgba(255,255,255,.22); margin-right: 8px; }
.pass-banner .pb-bar { display: block; margin: 0; height: 7px; background: rgba(255,255,255,.25); }
.pass-banner .pb-bar i { background: #fff; }
.pass-banner .pb-sub { font-size: 13px; opacity: .92; display: flex; align-items: center; gap: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 76px; }
.pass-banner .pb-prem { position: absolute; right: 12px; bottom: 11px; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 999px;
  background: rgba(0,0,0,.22); display: flex; align-items: center; gap: 4px; }

/* наградные плашки (профиль, карточка игрока в рейтинге): основатель — цвет уровня, бета-тестер — неон */
.prof-badges.awards { gap: 8px; margin: 8px 0 4px; }
.award { position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px; border-radius: 10px;
  font-size: 12.5px; font-weight: 800; letter-spacing: .2px; }
.award::after { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.35) 50%, transparent 70%);
  transform: translateX(-120%); animation: award-shine 4s ease-in-out infinite; pointer-events: none; }
.award.founder { color: #fff; background: linear-gradient(135deg, var(--fc), color-mix(in srgb, var(--fc) 55%, #000));
  box-shadow: 0 0 14px color-mix(in srgb, var(--fc) 45%, transparent), inset 0 1px 0 rgba(255,255,255,.35); }
.award.beta { color: #fff; background: linear-gradient(135deg, var(--accent), #5e5ce6 55%, #bf5af2);
  box-shadow: 0 0 14px rgba(94, 92, 230, .45), inset 0 1px 0 rgba(255,255,255,.35); }
@keyframes award-shine { 0%, 60% { transform: translateX(-120%); } 85%, 100% { transform: translateX(120%); } }
@media (prefers-reduced-motion: reduce) { .award::after { animation: none; } }

/* ---------- сторис релизного обновления (js/stories_rel.js) ---------- */
.st-rel-cards { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; width: 100%; }
.st-rel-c { animation: st-tile-in .6s calc(var(--d) + var(--i) * .2s) var(--spring) backwards; }
.st-rel-big { display: flex; justify-content: center; animation: st-tile-in .7s .5s var(--spring) backwards; }
.st-rel-big .st-card { flex-basis: 200px; width: 200px; padding: 12px 10px 10px; }
.st-rel-big .st-cn { font-size: 14px; }
.st-rel-pass { width: 100%; display: flex; flex-direction: column; gap: 22px; }
.st-rel-pb { position: relative; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; padding: 14px 15px; border-radius: 20px;
  background: linear-gradient(135deg, #5e5ce6, #bf5af2); box-shadow: 0 0 24px rgba(175, 82, 222, .5); animation: st-tile-in .6s .3s var(--spring) backwards; }
.st-rel-pb b { display: flex; align-items: center; gap: 6px; }
.st-rel-pb span { font-weight: 800; padding: 1px 9px; border-radius: 999px; background: rgba(255,255,255,.22); }
.st-rel-pb i { flex-basis: 100%; height: 7px; border-radius: 4px; background: rgba(255,255,255,.25); overflow: hidden; }
.st-rel-pb u { display: block; height: 100%; width: 0; background: #fff; border-radius: 4px; animation: st-rel-fill 2.4s .8s var(--ios) forwards; }
@keyframes st-rel-fill { to { width: 100%; } }
.st-rel-cont { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.st-rel-box { width: 78% !important; animation: st-tile-in .7s .2s var(--spring) backwards; filter: drop-shadow(0 0 22px rgba(217, 130, 43, .5)); }
.st-rel-thanks { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.st-rel-aw { animation: st-tile-in .6s 1.2s var(--spring) backwards; }

.st-rel-q { display: flex; flex-direction: column; align-items: center; }
.st-rel-qm { height: 44px; margin-top: 10px; display: flex; align-items: center; font-size: 32px; font-weight: 900; color: #a6e22e; text-shadow: 0 0 14px rgba(166,226,46,.7); }
.st-rel-paint { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 22px; }
.st-rel-pcar { width: 100%; animation: st-tile-in .7s .2s var(--spring) backwards; }
.st-rel-pcar img { transition: opacity .2s; }
.st-rel-sw { display: flex; gap: 10px; }
.st-rel-sw i { width: 30px; height: 30px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 2px rgba(255,255,255,.25);
  transition: transform .25s var(--spring), box-shadow .25s; animation: st-tile-in .5s calc(.4s + var(--i) * .08s) var(--spring) backwards; }
.st-rel-sw i.on { transform: scale(1.25); box-shadow: 0 0 0 3px #fff, 0 0 14px var(--c); }

/* рейтинг закрыт до обновления (RATING_CLOSED) — серая плитка */
.menu-tile.closed { filter: grayscale(1); opacity: .55; }

/* коллекция: машина куплена на площадке, но не выбита */
.col-bought { font-size: 10.5px; line-height: 1.25; color: var(--hint); margin-top: 3px; }

/* закреплённые машины и наградные машины (гараж, Витрина славы, карточка игрока) */
.pin-badge { position: absolute; top: 6px; right: 7px; z-index: 2; filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); }
.car-card.pinned { box-shadow: inset 0 0 0 1.5px rgba(255, 196, 0, .7); }
.hall-grid .car-card[data-act] { cursor: pointer; }
.award-cars { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 8px; margin: 0 -2px 6px; scrollbar-width: none; }
.award-cars::-webkit-scrollbar { display: none; }
.award-cars .car-card { flex: 0 0 150px; }
.award-car { box-shadow: inset 0 0 0 1.5px rgba(245, 197, 66, .85), 0 0 14px rgba(245, 197, 66, .25);
  background: linear-gradient(160deg, rgba(245, 197, 66, .14), transparent 60%), var(--card); }


/* =====================================================================
   АДАПТИВ: iPhone (в т.ч. 13 Pro, 390×844), Android 320–430px, ПК / Telegram Desktop
   Всё в одном блоке в конце файла, чтобы перекрывать базовые стили.
   ===================================================================== */

/* безопасные зоны: системные (iOS/Chrome) + выдаваемые самим Telegram (Android, полноэкранный режим) */
:root {
  --sat: max(env(safe-area-inset-top, 0px), var(--tg-safe-area-inset-top, 0px));
  --sab: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px));
  --sal: max(env(safe-area-inset-left, 0px), var(--tg-safe-area-inset-left, 0px));
  --sar: max(env(safe-area-inset-right, 0px), var(--tg-safe-area-inset-right, 0px));
  --cst: var(--tg-content-safe-area-inset-top, 0px);   /* плашка Telegram поверх приложения в fullscreen */
}
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { min-height: 100vh; min-height: 100dvh; }
#app { min-height: 100vh; min-height: 100dvh; }

/* шапка и контент не заезжают под вырез / плашку Telegram и боковые вырезы в ландшафте */
.header { padding-top: calc(18px + var(--sat) + var(--cst)); padding-left: max(16px, var(--sal)); padding-right: max(16px, var(--sar)); gap: 8px; }
main { padding-left: max(16px, var(--sal)); padding-right: max(16px, var(--sar)); padding-bottom: calc(112px + var(--sab)); }

/* заголовок подстраивается под ширину экрана и не налезает на кнопки справа */
.large-title { font-size: clamp(26px, 8.4vw, 34px); }
.large-title .long { font-size: clamp(21px, 6.6vw, 28px); }
.head-r { flex: none; }

/* нижняя панель: не шире экрана, лежит над жестовой полосой Android и «домиком» iPhone */
.tabbar {
  bottom: calc(14px + var(--sab));
  max-width: calc(100vw - 16px);
}
.tabbar button { white-space: nowrap; }
.rt-me { bottom: calc(86px + var(--sab)); }
.g-sellbar { bottom: calc(var(--sab) + 84px); }

/* шторка: динамическая высота экрана (адресная строка/клавиатура) и отступ снизу */
.sheet { max-height: 90vh; max-height: calc(100dvh - 24px - var(--sat)); }
.sheet-body { padding-bottom: calc(20px + var(--sab)); -webkit-overflow-scrolling: touch; }
.case-screen { min-height: calc(100vh - 190px); min-height: calc(100dvh - 190px - var(--sab)); }
.case-screen.in-shop { min-height: calc(100vh - 250px); min-height: calc(100dvh - 250px - var(--sab)); }

/* уведомление: не сжимается в узкую «пилюлю» (left:50% съедал доступную ширину) */
.toast { top: calc(12px + var(--sat) + var(--cst)); width: max-content; max-width: calc(100vw - 32px); }

/* поля ввода ≥16px — иначе iOS приближает страницу при фокусе */
input, textarea, select { font-size: max(16px, 1em); }
.admin-input.area { font-size: max(16px, 12px); }

/* длинные подписи не ломают сетку, цены на плашках не переносятся */
.dlr-tile-arrow, .pill, .chip, .badge { white-space: nowrap; }
.btn { text-wrap: balance; overflow-wrap: anywhere; }
.plate3d { max-width: 100%; }

img { max-width: 100%; }

/* ---------- узкие телефоны (≤ 380px: Galaxy S/A, iPhone SE, mini) ---------- */
@media (max-width: 380px) {
  body { font-size: 16px; }
  .header { padding-top: calc(12px + var(--sat) + var(--cst)); }
  .balance { font-size: 14px; padding: 6px 10px; }
  .gift { width: 34px; height: 34px; }
  .head-l { gap: 8px; }
  .head-r { gap: 6px; }
  .tabbar { padding: 4px; }
  .tabbar button { padding: 10px 11px; font-size: 13px; }
  .tab-thumb { top: 4px; bottom: 4px; }
  .card { padding: 14px; }
  .grid, .museum-grid { gap: 10px; }
  .car-card { padding: 10px; }
  .btn { font-size: 16px; padding: 14px 12px; }
  .btn-row .btn { font-size: 14px; }
  .sheet-body { padding-left: 12px; padding-right: 12px; }
  .list-row { padding-left: 12px; padding-right: 12px; gap: 10px; }
  .stats { gap: 6px; }
}
@media (max-width: 340px) {
  .tabbar button { padding: 9px 8px; font-size: 12px; }
  .balance { font-size: 13px; padding: 6px 8px; }
  .large-title .long { font-size: 20px; }
}

/* ---------- низкие экраны (iPhone SE, клавиатура, ландшафт) ---------- */
@media (max-height: 640px) {
  .stage { min-height: 250px; }
  .case-screen { min-height: calc(100dvh - 170px); }
}

/* ---------- ПК, планшеты и Telegram Desktop ---------- */
@media (min-width: 700px) {
  .header, main { max-width: 640px; }
  .sheet { max-width: 640px; max-height: min(88vh, 860px); border-radius: 16px 16px 0 0; }
  .tabbar { bottom: 20px; }
  body.sheet-open #app { transform: scale(.97) translateY(6px); }
}
@media (min-width: 1100px) {
  html { font-size: 17px; }
  .header, main { max-width: 680px; }
  .sheet { max-width: 680px; }
}
/* мышь: наведение, курсор, обычные полосы прокрутки */
@media (hover: hover) and (pointer: fine) {
  button, [data-act], [data-tab] { cursor: pointer; }
  .btn:hover:not(:disabled), .pill:hover:not(:disabled) { opacity: .9; }
  .list-row:hover { background: var(--fill); }
  .car-card:hover, .menu-tile:hover, .rc-card:hover, .slot-tile:hover { transform: translateY(-2px); }
  .tabbar button:hover:not(.active) { color: var(--text); }
  .sheet-body { scrollbar-width: thin; scrollbar-color: var(--sep) transparent; }
  .filter, .race-cars, .award-cars { scrollbar-width: thin; }
  :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
}

/* ---------- экономим батарею: слабые Android без стеклянного размытия ---------- */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .tabbar, .toast { background: color-mix(in srgb, var(--card) 94%, transparent); }
}

/* номер и теги не вылезают на самых узких экранах */
.car-head .tags { flex-wrap: wrap; }
.plate-stage { overflow: visible; }
@media (max-width: 380px) { .plate.big { font-size: min(50px, 13.2vw); } .plate-stage.sheet .plate.big { font-size: min(42px, 11.2vw); } }
@media (max-width: 340px) { .st-plate .plate { font-size: 34px; } }
@media (max-width: 380px) { .st-hero-tag { position: static; display: inline-block; margin-bottom: 6px; } }
