/* Hustle City — стили. Цвета берутся из темы Telegram (светлая/тёмная). */
:root {
  --bg: var(--tg-theme-bg-color, #111318);
  --bg2: var(--tg-theme-secondary-bg-color, #1b1e25);
  --card: var(--tg-theme-section-bg-color, var(--bg2));
  --text: var(--tg-theme-text-color, #f2f3f5);
  --hint: var(--tg-theme-hint-color, #8b93a1);
  --link: var(--tg-theme-link-color, #5aa9ff);
  --btn: var(--tg-theme-button-color, #ff7a1a);
  --btn-text: var(--tg-theme-button-text-color, #ffffff);
  --accent: #ff7a1a;
  --accent2: #ffcc33;
  --good: #2ecc71;
  --bad: #ff4d5e;
  --red: #e5383b;
  --white: #f1f1f1;
  --green: #18b36b;
  --gold: #ffc531;
  --line: color-mix(in srgb, var(--hint) 25%, transparent);
  --soft: color-mix(in srgb, var(--hint) 12%, transparent);
  --radius: 14px;
  --nav-h: 62px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 15px/1.35 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overscroll-behavior: none; user-select: none; -webkit-user-select: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
input { font: inherit; color: var(--text); }
#app { display: flex; flex-direction: column; height: 100%; max-width: 560px; margin: 0 auto; }

/* верхняя панель */
#topbar { display: flex; align-items: baseline; justify-content: space-between; padding: 10px 16px 8px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 22%, var(--bg)), var(--bg)); border-bottom: 1px solid var(--line); }
.tb-money { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; }
.tb-cur { color: var(--accent2); margin-right: 2px; }
.tb-income { color: var(--good); font-weight: 600; font-size: 14px; }

#screen { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 12px 14px calc(var(--nav-h) + var(--safe-b) + 16px); -webkit-overflow-scrolling: touch; }

/* нижняя навигация */
#tabs { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; height: calc(var(--nav-h) + var(--safe-b));
  padding-bottom: var(--safe-b); background: color-mix(in srgb, var(--bg2) 92%, transparent); backdrop-filter: blur(10px); border-top: 1px solid var(--line); z-index: 10; }
#tabs button { flex: 1; max-width: 112px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--hint); position: relative; }
#tabs button span { font-size: 22px; filter: grayscale(0.7); transition: transform .15s; }
#tabs button b { font-size: 11px; font-weight: 600; }
#tabs button.active { color: var(--accent); }
#tabs button.active span { filter: none; transform: translateY(-2px) scale(1.08); }
#tabs button .dot { position: absolute; top: 8px; right: calc(50% - 20px); width: 9px; height: 9px; border-radius: 50%; background: var(--bad); }

/* общие элементы */
h2 { font-size: 20px; margin: 4px 0 12px; }
h3 { font-size: 16px; margin: 18px 0 8px; }
.hint { color: var(--hint); font-size: 13px; }
.small { font-size: 12px; }
.good { color: var(--good); }
.bad { color: var(--bad); }
.gold { color: var(--gold); }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }
.mt { margin-top: 12px; }
.mb { margin-bottom: 12px; }
.card { background: var(--card); border-radius: var(--radius); padding: 12px; margin-bottom: 10px; border: 1px solid var(--line); }
.card.glow { border-color: color-mix(in srgb, var(--accent) 60%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent) inset; }
.card.locked { opacity: .55; }
.emoji { font-size: 30px; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: var(--soft); flex: none; }
.title { font-weight: 700; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 14px; border-radius: 12px;
  background: var(--btn); color: var(--btn-text); font-weight: 700; min-height: 42px; transition: transform .08s, opacity .15s; white-space: nowrap; }
.btn:active { transform: scale(.96); }
.btn.sec { background: var(--soft); color: var(--text); }
.btn.good { background: var(--good); color: #fff; }
.btn.bad { background: var(--bad); color: #fff; }
.btn.gold { background: linear-gradient(135deg, #ffd34d, #ff9f1a); color: #3a2400; }
.btn.block { display: flex; width: 100%; }
.btn.sm { padding: 6px 10px; min-height: 34px; font-size: 13px; border-radius: 10px; }
.btn[disabled], .btn.off { opacity: .4; pointer-events: none; }
.btn .sub { font-weight: 500; font-size: 12px; opacity: .85; }

.seg { display: flex; background: var(--soft); border-radius: 12px; padding: 3px; gap: 3px; margin-bottom: 12px; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: 1; padding: 8px 8px; border-radius: 9px; font-weight: 600; font-size: 13px; color: var(--hint); white-space: nowrap; }
.seg button.active { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.2); }

.bar { height: 8px; background: var(--soft); border-radius: 6px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2)); border-radius: 6px; transition: width .3s; }
.bar.green > i { background: linear-gradient(90deg, #17a65b, #4be08e); }

.pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 20px; background: var(--soft); font-size: 12px; font-weight: 600; }
.pill.hot { background: color-mix(in srgb, var(--accent) 25%, transparent); color: var(--accent2); }

/* главная */
.hero { text-align: center; padding: 18px 12px; background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 70%), var(--card); }
.hero .avatar { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 6px; display: grid; place-items: center; font-size: 34px; background: var(--soft); overflow: hidden; }
.hero .avatar img { width: 100%; height: 100%; object-fit: cover; }
.hero .big { font-size: 34px; font-weight: 800; letter-spacing: -1px; }
.boosts { display: flex; flex-wrap: wrap; gap: 6px; }

/* бизнесы */
.biz { display: grid; grid-template-columns: 44px 1fr; gap: 10px; }
.biz-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.biz-actions .btn { flex: 1; min-width: 120px; }
.stage-title { display: flex; align-items: center; gap: 8px; margin: 18px 0 8px; font-weight: 800; font-size: 15px; }
.stage-title:first-child { margin-top: 4px; }

/* оверлей / модалки */
#overlay { position: fixed; inset: 0; z-index: 50; display: none; }
#overlay.show { display: block; }
.modal-bg { position: absolute; inset: 0; background: rgba(0,0,0,.55); animation: fade .2s; }
.modal { position: absolute; left: 0; right: 0; bottom: 0; max-width: 560px; margin: 0 auto; max-height: 92%; overflow-y: auto; background: var(--bg);
  border-radius: 20px 20px 0 0; padding: 18px 16px calc(18px + var(--safe-b)); animation: up .25s ease-out; }
.modal.full { top: 0; max-height: none; border-radius: 0; padding-top: 10px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.modal-head h2 { margin: 0; }
.close { width: 36px; height: 36px; border-radius: 50%; background: var(--soft); font-size: 18px; }
@keyframes fade { from { opacity: 0 } }
@keyframes up { from { transform: translateY(40px); opacity: 0 } }

#toasts { position: fixed; top: 10px; left: 0; right: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.toast { background: rgba(20,22,28,.95); color: #fff; padding: 10px 14px; border-radius: 12px; font-weight: 600; font-size: 14px; max-width: 90%; animation: up .2s; box-shadow: 0 6px 20px rgba(0,0,0,.3); }
.toast.err { background: #b3261e; }
.toast.ok { background: #13824b; }

#boot { position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--bg); transition: opacity .3s; }
#boot.hide { opacity: 0; pointer-events: none; }
.boot-logo { font-size: 72px; animation: bob 1.2s ease-in-out infinite; }
.boot-title { font-weight: 900; font-size: 28px; letter-spacing: 3px; margin-top: 8px; background: linear-gradient(90deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.boot-sub { color: var(--hint); margin-top: 10px; padding: 0 24px; text-align: center; }
@keyframes bob { 50% { transform: translateY(-8px) } }

/* поля ввода */
.field { display: flex; align-items: center; gap: 6px; background: var(--soft); border-radius: 12px; padding: 4px 4px 4px 12px; }
.field input { flex: 1; min-width: 0; background: none; border: 0; outline: none; font-size: 17px; font-weight: 700; padding: 8px 0; }
.quick { display: flex; gap: 6px; margin-top: 6px; }
.quick button { flex: 1; padding: 6px 0; border-radius: 9px; background: var(--soft); font-size: 13px; font-weight: 600; }
input[type=range] { width: 100%; accent-color: var(--accent); }
.switch { position: relative; width: 48px; height: 28px; flex: none; }
.switch input { display: none; }
.switch i { position: absolute; inset: 0; background: var(--soft); border-radius: 20px; transition: .2s; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: .2s; }
.switch input:checked + i { background: var(--good); }
.switch input:checked + i::after { left: 23px; }

/* город — меню */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 12px; text-align: left; display: flex; flex-direction: column; gap: 4px; min-height: 96px; }
.tile .e { font-size: 30px; }
.tile.casino { background: linear-gradient(135deg, #4a1d6b, #1d1033); color: #fff; border: 0; }
.tile.pvp { background: linear-gradient(135deg, #7a1d1d, #2a0f0f); color: #fff; border: 0; }
.tile .hint { color: inherit; opacity: .7; }

/* краш */
.crash-stage { position: relative; height: 240px; border-radius: 16px; overflow: hidden; background: radial-gradient(circle at 20% 110%, #2c1a4d, #0c0e19 70%); color: #fff; }
.crash-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.crash-mult { position: absolute; top: 50%; left: 0; right: 0; transform: translateY(-50%); text-align: center; font-size: 52px; font-weight: 900; text-shadow: 0 4px 20px rgba(0,0,0,.5); pointer-events: none; }
.crash-mult.boom { color: var(--bad); }
.crash-mult.win { color: var(--good); }
.crash-sub { position: absolute; top: calc(50% + 34px); left: 0; right: 0; text-align: center; font-size: 14px; opacity: .85; }
.history { display: flex; gap: 6px; overflow-x: auto; margin: 8px 0; scrollbar-width: none; }
.history span { flex: none; padding: 3px 8px; border-radius: 8px; font-weight: 700; font-size: 12px; background: var(--soft); }
.history .hi { color: var(--good); }
.history .lo { color: var(--bad); }
.fair { font-size: 11px; color: var(--hint); word-break: break-all; margin-top: 8px; }

/* рулетка */
.rl-wrap { position: relative; height: 84px; overflow: hidden; border-radius: 14px; background: #0c0e19; margin: 6px 0 12px; }
.rl-strip { position: absolute; top: 10px; left: 0; display: flex; gap: 6px; will-change: transform; }
.rl-cell { width: 64px; height: 64px; border-radius: 12px; flex: none; display: grid; place-items: center; font-weight: 900; font-size: 20px; }
.rl-cell.red { background: linear-gradient(160deg, #ff5a5f, #b81d24); color: #fff; }
.rl-cell.white { background: linear-gradient(160deg, #ffffff, #cfd3da); color: #333; }
.rl-cell.green { background: linear-gradient(160deg, #3be58e, #0f8a4e); color: #fff; }
.rl-pointer { position: absolute; top: 0; bottom: 0; left: 50%; width: 3px; margin-left: -1.5px; background: var(--gold); box-shadow: 0 0 10px var(--gold); z-index: 2; }
.rl-pointer::before { content: ''; position: absolute; top: 0; left: -7px; border: 8px solid transparent; border-top-color: var(--gold); }
.color-btns { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.color-btns .btn.red { background: linear-gradient(160deg, #ff5a5f, #b81d24); color: #fff; }
.color-btns .btn.white { background: linear-gradient(160deg, #ffffff, #cfd3da); color: #222; }
.color-btns .btn.green { background: linear-gradient(160deg, #3be58e, #0f8a4e); color: #fff; }

/* апгрейд */
.wheel { position: relative; width: 220px; height: 220px; margin: 6px auto 10px; }
.wheel svg { width: 100%; height: 100%; }
.wheel .arrow { position: absolute; inset: 0; transition: none; }
.wheel .center-item { position: absolute; inset: 0; display: grid; place-items: center; font-size: 46px; pointer-events: none; }
.items { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.item { background: var(--card); border: 2px solid var(--line); border-radius: 12px; padding: 6px 2px; text-align: center; font-size: 11px; }
.item .ie { font-size: 26px; }
.item.sel { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 15%, var(--card)); }
.up-target { display: flex; align-items: center; justify-content: space-around; gap: 6px; text-align: center; }
.up-target .ie { font-size: 34px; }

/* гонка */
.race-stage { position: relative; border-radius: 16px; background: linear-gradient(#2a2f3a, #15181f); color: #fff; padding: 14px; text-align: center; min-height: 330px; }
.lights { display: flex; justify-content: center; gap: 10px; margin: 6px 0 12px; }
.lights i { width: 34px; height: 34px; border-radius: 50%; background: #333; box-shadow: inset 0 -3px 6px rgba(0,0,0,.6); }
.lights i.r { background: #ff3b3b; box-shadow: 0 0 16px #ff3b3b; }
.lights i.g { background: #2bff88; box-shadow: 0 0 16px #2bff88; }
.tach { width: 240px; height: 140px; margin: 0 auto; }
.track { position: relative; height: 70px; background: repeating-linear-gradient(90deg, #444 0 20px, #3a3a3a 20px 40px); border-radius: 10px; margin: 10px 0; overflow: hidden; }
.track .lane { position: absolute; left: 0; right: 0; height: 35px; border-bottom: 1px dashed #666; }
.track .car { position: absolute; left: 0; font-size: 26px; transform: scaleX(-1); transition: none; }
.track .fin { position: absolute; right: 8px; top: 0; bottom: 0; width: 6px; background: repeating-linear-gradient(#fff 0 6px, #000 6px 12px); }
.big-btn { width: 100%; min-height: 64px; font-size: 20px; border-radius: 16px; }

/* дуэль */
.moves { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.move { background: var(--card); border: 2px solid var(--line); border-radius: 12px; padding: 8px 2px; text-align: center; }
.move .me { font-size: 26px; }
.move b { display: block; font-size: 11px; }
.move small { display: block; font-size: 10px; color: var(--hint); margin-top: 2px; }
.move.sel { border-color: var(--accent); }
.rounds { display: flex; gap: 6px; justify-content: center; margin: 8px 0; }
.rounds div { width: 52px; text-align: center; padding: 6px 0; border-radius: 10px; background: var(--soft); font-size: 18px; }
.rounds div.w { background: color-mix(in srgb, var(--good) 30%, transparent); }
.rounds div.l { background: color-mix(in srgb, var(--bad) 30%, transparent); }
.rounds div.cur { outline: 2px solid var(--accent); }
.rounds small { display: block; font-size: 10px; color: var(--hint); }

/* топ */
.lb-row { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--line); }
.lb-row.me { background: color-mix(in srgb, var(--accent) 14%, transparent); border-radius: 10px; }
.lb-place { width: 30px; text-align: center; font-weight: 800; color: var(--hint); }
.lb-ava { width: 34px; height: 34px; border-radius: 50%; background: var(--soft); display: grid; place-items: center; overflow: hidden; flex: none; font-weight: 800; }
.lb-ava img { width: 100%; height: 100%; object-fit: cover; }
.lb-val { font-weight: 800; }
.vipname { color: var(--gold); font-weight: 800; text-shadow: 0 0 8px rgba(255,197,49,.35); }
.mybar { position: sticky; bottom: -16px; background: var(--card); border: 1px solid var(--accent); border-radius: 12px; padding: 10px; margin-top: 10px; }

/* профиль / магазин */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat { background: var(--soft); border-radius: 12px; padding: 8px 10px; }
.stat b { display: block; font-size: 16px; }
.stat span { font-size: 12px; color: var(--hint); }
.shop-item { display: flex; align-items: center; gap: 10px; }
.star-btn { background: linear-gradient(135deg, #ffd34d, #ff9f1a); color: #3a2400; }

.empty { text-align: center; color: var(--hint); padding: 24px 10px; }
.spin { display: inline-block; animation: rot 1s linear infinite; }
@keyframes rot { to { transform: rotate(360deg) } }
.shake { animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-6px) } 75% { transform: translateX(6px) } }
.pop { animation: pop .35s; }
@keyframes pop { 50% { transform: scale(1.15) } }

/* ---------- эффекты ---------- */
.float-text { position: fixed; z-index: 160; transform: translate(-50%, 0); font-weight: 900; font-size: 18px; pointer-events: none;
  text-shadow: 0 2px 6px rgba(0,0,0,.5); animation: floatUp 1.2s ease-out forwards; white-space: nowrap; }
@keyframes floatUp { to { transform: translate(-50%, -60px); opacity: 0 } }
.celebrate .cel-emoji { font-size: 80px; animation: pop .6s, bob 1.6s ease-in-out .6s infinite; }

/* ---------- живой город на главной ---------- */
.scene { position: relative; height: 230px; border-radius: 18px; overflow: hidden; margin-bottom: 10px; border: 1px solid var(--line); }
.scene svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.scene .road-car { position: absolute; font-size: 22px; bottom: 6px; animation: drive linear infinite; will-change: transform; }
.scene .road-car.back { bottom: 22px; font-size: 18px; animation-name: driveBack; }
@keyframes drive { from { transform: translateX(-60px) scaleX(-1) } to { transform: translateX(calc(100vw)) scaleX(-1) } }
@keyframes driveBack { from { transform: translateX(calc(100vw)) } to { transform: translateX(-60px) } }
.scene .coin { position: absolute; font-size: 16px; pointer-events: none; animation: coinUp 1.6s ease-out forwards; }
@keyframes coinUp { 0% { transform: translateY(0) scale(.6); opacity: 0 } 20% { opacity: 1; transform: translateY(-10px) scale(1) } 100% { transform: translateY(-60px) scale(.8); opacity: 0 } }
.scene .hud { position: absolute; left: 12px; right: 12px; top: 10px; display: flex; justify-content: space-between; align-items: flex-start; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,.6); }
.scene .hud .big { font-size: 30px; font-weight: 900; letter-spacing: -1px; line-height: 1; }
.scene .hud .inc { font-weight: 800; color: #6dffa8; font-size: 14px; }
.scene .hero-char { position: absolute; bottom: 30px; left: 10px; font-size: 30px; animation: bob 2s ease-in-out infinite; }
.scene .cloud { position: absolute; font-size: 26px; opacity: .85; animation: cloud linear infinite; }
@keyframes cloud { from { transform: translateX(-80px) } to { transform: translateX(calc(100vw)) } }

/* курьер */
.courier { display: flex; align-items: center; gap: 10px; }
.courier .box { font-size: 34px; }
.courier.ready .box { animation: wiggle 1s ease-in-out infinite; }
@keyframes wiggle { 0%,100% { transform: rotate(0) } 25% { transform: rotate(-12deg) scale(1.1) } 75% { transform: rotate(12deg) scale(1.1) } }

/* задания */
.quest { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.quest:last-child { border-bottom: 0; }
.quest .qi { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--soft); font-size: 18px; flex: none; }
.quest.done .qi { background: color-mix(in srgb, var(--good) 30%, transparent); }
.quest .bar { height: 6px; margin-top: 4px; }

/* бизнесы: цвет этапа */
.card.s1 { border-left: 4px solid #9aa4b2; }
.card.s2 { border-left: 4px solid #ff9f1a; }
.card.s3 { border-left: 4px solid #2ecc71; }
.card.s4 { border-left: 4px solid #4f9dff; }
.card.s5 { border-left: 4px solid #b26bff; }
.biz .emoji { font-size: 32px; background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--accent) 25%, transparent), var(--soft)); }
.pop-now { animation: pop .35s; }

/* событие */
.event-card .ev-emoji { font-size: 64px; text-align: center; animation: pop .5s; }
.event-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.event-opts.three { grid-template-columns: 1fr 1fr 1fr; }
.event-opts .btn { white-space: normal; min-height: 52px; }

.tb-shop { width: 38px; height: 38px; border-radius: 12px; font-size: 20px; background: linear-gradient(135deg, #ffd34d, #ff9f1a);
  box-shadow: 0 2px 10px rgba(255,170,30,.45); animation: shine 2.4s ease-in-out infinite; }
@keyframes shine { 50% { transform: scale(1.08); box-shadow: 0 2px 18px rgba(255,170,30,.8) } }
#topbar { align-items: center; }

.offer .offer-emoji { font-size: 76px; animation: pop .5s, bob 1.8s ease-in-out .5s infinite; filter: drop-shadow(0 6px 18px rgba(255,170,30,.5)); }
.offer h2 { margin-top: 4px; }
.offer p { line-height: 1.6; }

/* машины */
.car-photo { width: 100%; aspect-ratio: 2 / 1; border-radius: 12px; overflow: hidden; background: var(--soft); display: grid; place-items: center; }
.car-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.car-photo.noimg { font-size: 64px; }
.car-photo.small { aspect-ratio: 5 / 2; }
.car-photo.race { aspect-ratio: 21 / 9; margin-bottom: 8px; }
.credit { font-size: 10px; color: var(--hint); margin-top: 6px; line-height: 1.3; word-break: break-word; }
.credit a { color: var(--hint); text-decoration: underline; }

/* сетка машин как в автосалоне */
.car-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.car-tile { position: relative; display: flex; flex-direction: column; text-align: left; background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; padding: 8px 8px 10px; min-height: 170px; overflow: hidden; }
.car-tile:active { transform: scale(.97); }
.car-tile .car-photo.tile { aspect-ratio: 16 / 10; border-radius: 12px; }
.car-tile .ct-name { font-weight: 800; font-size: 14px; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.car-tile .ct-sub { font-size: 12px; color: var(--hint); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cls { position: absolute; top: 12px; left: 12px; z-index: 2; width: 24px; height: 24px; border-radius: 7px; color: #fff; font-weight: 900;
  font-size: 14px; display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.cls.inline { position: static; display: inline-grid; vertical-align: middle; margin-right: 4px; }
.empty-slot { align-items: center; justify-content: center; border: 2px dashed var(--line); background: transparent; color: var(--hint); font-weight: 700; }
/* номерной знак */
.plate { display: inline-flex; align-self: center; margin: 6px auto 0; border: 2px solid #222; border-radius: 5px; background: #fff; color: #111;
  font-family: "Arial Narrow", Arial, sans-serif; font-weight: 700; font-size: 13px; line-height: 1; overflow: hidden; }
.plate .pl-num { padding: 3px 5px; letter-spacing: 1px; }
.plate .pl-num b { font-size: 15px; }
.plate .pl-reg { border-left: 2px solid #222; padding: 1px 4px; font-size: 11px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.plate .pl-reg i { font-style: normal; font-size: 6px; }
.modal .plate { display: flex; width: max-content; margin: 8px auto 0; font-size: 18px; }
.modal .plate .pl-num b { font-size: 21px; }

/* баннеры этапов */
.stage-banner { display: flex; align-items: center; gap: 12px; margin: 20px 0 10px; padding: 12px 14px; border-radius: 18px; color: #fff;
  box-shadow: 0 6px 18px rgba(0,0,0,.25); position: relative; overflow: hidden; }
.stage-banner::after { content: ''; position: absolute; right: -30px; top: -30px; width: 120px; height: 120px; border-radius: 50%; background: rgba(255,255,255,.08); }
.stage-banner.s1 { background: linear-gradient(135deg, #5b6573, #2c323c); }
.stage-banner.s2 { background: linear-gradient(135deg, #ff9f1a, #b8520f); }
.stage-banner.s3 { background: linear-gradient(135deg, #22b26a, #0f6b3c); }
.stage-banner.s4 { background: linear-gradient(135deg, #3b8bff, #1d4fb3); }
.stage-banner.s5 { background: linear-gradient(135deg, #b26bff, #5e23b3); }
.stage-banner.closed { filter: grayscale(.85) brightness(.75); }
.sb-emoji { font-size: 34px; filter: drop-shadow(0 3px 6px rgba(0,0,0,.35)); }
.sb-title { font-weight: 900; font-size: 16px; }
.sb-bar { height: 6px; background: rgba(255,255,255,.25); border-radius: 4px; margin-top: 6px; overflow: hidden; }
.sb-bar i { display: block; height: 100%; background: #fff; border-radius: 4px; }
.sb-count { font-weight: 900; font-size: 18px; }
/* бизнесы: иконка в цвете этапа */
.card.s1 .biz .emoji { background: linear-gradient(135deg, #5b657355, #2c323c55); }
.card.s2 .biz .emoji { background: linear-gradient(135deg, #ff9f1a44, #b8520f33); }
.card.s3 .biz .emoji { background: linear-gradient(135deg, #22b26a44, #0f6b3c33); }
.card.s4 .biz .emoji { background: linear-gradient(135deg, #3b8bff44, #1d4fb333); }
.card.s5 .biz .emoji { background: linear-gradient(135deg, #b26bff44, #5e23b333); }
.biz .emoji { width: 52px; height: 52px; font-size: 34px; border-radius: 16px; }
.biz { grid-template-columns: 52px 1fr; }
.btn:not(.sec):not(.good):not(.bad):not(.gold):not(.star-btn) { background: linear-gradient(135deg, #ff8a2b, #f0600f); box-shadow: 0 4px 12px rgba(240,96,15,.3); }
.card { box-shadow: 0 2px 10px rgba(0,0,0,.12); }

/* колесо удачи */
.wheel-wrap { position: relative; width: min(320px, 86vw); margin: 4px auto 8px; }
.wheel-svg { width: 100%; display: block; filter: drop-shadow(0 10px 24px rgba(255,197,49,.25)); }
.wheel-pointer { position: absolute; top: -6px; left: 50%; transform: translateX(-50%); z-index: 2; font-size: 30px; color: #ffc531; text-shadow: 0 2px 6px rgba(0,0,0,.6); }
.bulb { animation: blink 1s steps(2) infinite; }
.bulb.b2 { animation-delay: .5s; }
@keyframes blink { 50% { opacity: .35 } }
.wheel-card { background: linear-gradient(135deg, #3a1d6b55, #ffc53122); }
.wc-wheel { font-size: 36px; }
.wc-wheel.spinning { animation: rot 4s linear infinite; }

/* кейсы */
.case-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.case-tile { background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--cc) 45%, transparent), var(--card) 75%); border: 1px solid color-mix(in srgb, var(--cc) 50%, transparent);
  border-radius: 18px; padding: 14px 10px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.case-tile:active { transform: scale(.97); }
.case-box { font-size: 52px; filter: drop-shadow(0 6px 14px color-mix(in srgb, var(--cc) 70%, transparent)); animation: bob 2.4s ease-in-out infinite; }
.case-tile .ct-name { font-weight: 900; }
.case-price { font-weight: 800; color: var(--accent2); }
.case-price.off { opacity: .45; }
.cs-wrap { position: relative; height: 118px; overflow: hidden; border-radius: 14px; background: #0c0e19; margin-bottom: 10px; }
.cs-strip { position: absolute; top: 10px; left: 0; display: flex; gap: 6px; will-change: transform; padding-left: 6px; }
.cs-cell { width: 90px; height: 98px; flex: none; border-radius: 12px; background: linear-gradient(180deg, #1d2130, #151826); border-bottom: 4px solid var(--rc);
  display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; padding: 4px; }
.cs-cell .cs-e { font-size: 38px; }
.cs-cell .cs-n { font-size: 10px; text-align: center; line-height: 1.15; max-height: 24px; overflow: hidden; opacity: .85; }
.cs-pointer { position: absolute; top: 0; bottom: 0; left: 50%; width: 3px; margin-left: -1.5px; background: var(--gold); box-shadow: 0 0 12px var(--gold); z-index: 2; }
.cs-list { display: flex; flex-direction: column; gap: 6px; }
.cs-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--card); border-left: 4px solid var(--rc); }
.cs-row .cs-e { font-size: 26px; }
.cs-drop { font-size: 84px; margin: 6px auto; width: 130px; height: 130px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle, color-mix(in srgb, var(--rc) 45%, transparent), transparent 70%); animation: pop .5s; }

.plate-cell { width: 130px; justify-content: center; gap: 8px; }
.plate-cell .plate { margin: 0; }
.plate.big { font-size: 26px; border-width: 3px; }
.plate.big .pl-num b { font-size: 30px; }
.plate.big .pl-reg { font-size: 15px; }
.plate.big .pl-reg i { font-size: 8px; }
.cs-row .plate { margin: 0; flex: none; }

/* персонаж */
.char-stage { position: relative; height: 290px; border-radius: 20px; overflow: hidden; margin-bottom: 10px; color: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.char-stage::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 46px; background: linear-gradient(180deg, #0000, #0007); }
.cs-house { position: absolute; left: 6px; bottom: 54px; font-size: 92px; opacity: .9; filter: drop-shadow(0 6px 12px rgba(0,0,0,.4)); }
.cs-label { position: absolute; left: 12px; top: 10px; font-weight: 800; font-size: 13px; background: rgba(0,0,0,.35); padding: 3px 8px; border-radius: 10px; }
.cs-char { position: absolute; left: 38%; bottom: 16px; transform: translateX(-50%); z-index: 2; animation: bob 2.6s ease-in-out infinite; }
.cs-car { position: absolute; right: 10px; bottom: 54px; width: 40%; z-index: 3; }
.cs-car .car-photo.mini { aspect-ratio: 16 / 10; border-radius: 10px; border: 2px solid rgba(255,255,255,.7); box-shadow: 0 4px 12px rgba(0,0,0,.4); }
.cs-car .car-photo.mini.noimg { font-size: 40px; background: rgba(0,0,0,.25); }
.cs-carname { font-size: 11px; font-weight: 800; text-align: center; margin-top: 3px; text-shadow: 0 1px 4px #000; }
.cs-car.empty { font-size: 12px; text-align: center; opacity: .8; }
.cs-style { position: absolute; right: 10px; top: 10px; font-weight: 800; font-size: 12px; background: rgba(0,0,0,.4); padding: 3px 8px; border-radius: 10px; color: #ffd76a; }
.cs-btn { position: absolute; left: 10px; bottom: 10px; z-index: 3; }
.wr-top { display: flex; gap: 10px; align-items: flex-end; margin-bottom: 10px; }
.wr-char { flex: none; background: radial-gradient(circle at 50% 60%, color-mix(in srgb, var(--accent) 25%, transparent), transparent 70%); border-radius: 16px; padding: 4px; }
.wr-slots { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.wr-slot { background: var(--card); border: 2px solid var(--line); border-radius: 12px; padding: 6px 4px; display: flex; flex-direction: column; align-items: center; min-height: 54px; }
.wr-slot.sel { outline: 2px solid var(--accent); }
.wr-slot .wr-e { font-size: 20px; }
.wr-slot .wr-n { font-size: 9px; text-align: center; line-height: 1.1; max-height: 20px; overflow: hidden; }
.scene .hero-char svg { height: 70px !important; }

/* номерной салон */
.plate-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.plate-card { background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--rc); border-radius: 14px; padding: 8px 6px 10px;
  display: flex; flex-direction: column; align-items: center; gap: 6px; }
.plate-card .plate { margin: 0; }
.pc-r { font-size: 11px; font-weight: 800; }
