/* ============================================================
   ИНТЕРФЕЙС. Тёмное стекло без теней, свечений и обводок.
   Шрифт Inter: 10 / 11 / 13 / 15 / 18 px. Всё сильно скруглено.
   ============================================================ */
:root {
  --bg: #0B0C0E;
  --bg2: #17191D;
  --glass: rgba(24, 26, 30, 0.62);
  --glass-strong: rgba(20, 22, 26, 0.9);
  --fill: rgba(255, 255, 255, 0.06);
  --fill2: rgba(255, 255, 255, 0.11);
  --fill3: rgba(255, 255, 255, 0.16);
  --fg: #F3F5FB;
  --muted: rgba(243, 245, 251, 0.56);
  --faint: rgba(243, 245, 251, 0.36);
  --mint: #19E68C;
  --mint-ink: #04291A;
  --gold: #F2C14E;
  --red: #FF7A7A;
  --blur: blur(22px) saturate(160%);
  color-scheme: dark;
}

html, body { height: 100%; }
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; }   /* без зума двойным тапом */
#app { -webkit-touch-callout: none; }
.touch #app :not(input):not(textarea) { -webkit-user-select: none; user-select: none; }
.touch #landing p, .touch #landing h1, .touch #landing h2 { -webkit-user-select: text; user-select: text; }
/* поле на телефоне: настоящий размер 16 px (iOS не зумит), визуально — как в дизайне */
.field .in { flex: 1; min-width: 0; align-self: stretch; position: relative; overflow: hidden; }
.field .in input { position: absolute; left: 0; top: 50%; width: calc(100% / var(--k)); font-size: 16px !important;
  transform: translateY(-50%) scale(var(--k)); transform-origin: left center; }
[hidden] { display: none !important; }
#maint-bar { position: fixed; z-index: 70; top: calc(env(safe-area-inset-top, 0px) + 64px); left: 50%; transform: translateX(-50%); max-width: calc(100% - 32px);
  padding: 10px 16px; border-radius: 16px; text-align: center; color: #F2C14E; pointer-events: none; }
body {
  margin: 0; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 38%, var(--bg2), var(--bg) 72%);
  color: var(--fg);
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 13px; line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }

/* типографика */
.t10 { font-size: 10px; line-height: 1.3; }
.t11 { font-size: 11px; line-height: 1.35; }
.t13 { font-size: 13px; line-height: 1.35; }
.t15 { font-size: 15px; line-height: 1.3; }
.t18 { font-size: 18px; line-height: 1.2; letter-spacing: -0.01em; }
.b5 { font-weight: 500; } .b6 { font-weight: 600; } .b7 { font-weight: 700; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }

/* стекло */
.glass { background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.glass-strong { background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }

#app { position: fixed; inset: 0; }
#scene { position: absolute; inset: 0; opacity: 0; transition: opacity 0.7s ease; }
#scene canvas { display: block; width: 100%; height: 100%; }
#labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
/* загрузка: пока город не нарисован, на его месте полоска; main.js ставит класс ready — сцена проявляется */
.ready #scene { opacity: 1; }
#boot-loader { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); pointer-events: none; transition: opacity 0.4s ease, visibility 0s 0.4s; }
#boot-loader i { display: block; position: relative; width: 132px; height: 4px; border-radius: 999px; background: var(--fill2); overflow: hidden; }
#boot-loader i::after { content: ''; position: absolute; inset: 0; width: 40%; border-radius: inherit; background: var(--mint); animation: bootRun 1.2s ease-in-out infinite; }
@keyframes bootRun { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
.ready #boot-loader { opacity: 0; visibility: hidden; }

/* ---------- верх ---------- */
.top {
  position: absolute; z-index: 16;   /* выше панели: меню профиля открывается поверх неё */
  top: calc(12px + env(safe-area-inset-top, 0px)); left: 12px; right: 12px;
  display: flex; align-items: center; gap: 8px; pointer-events: none;
}
.top > * { pointer-events: auto; }
.pill { border-radius: 999px; height: 36px; display: flex; align-items: center; gap: 8px; padding: 0 12px; }
.chip { background: var(--fill2); color: var(--muted); padding: 2px 7px; border-radius: 999px; font-weight: 600; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); }
.wallet-bar { padding: 0 4px; gap: 4px; }
.bal { height: 28px; padding: 0 10px 0 5px; border: 0; border-radius: 999px; background: var(--fill); display: flex; align-items: center; gap: 6px; }
.bal:hover { background: var(--fill2); }
.ic-md { width: 20px; height: 20px; }   /* монета отдельно, перед суммой (сама иконка — ниже, «монета») */
.plus { width: 28px; height: 28px; border: 0; border-radius: 50%; background: var(--mint); color: var(--mint-ink); display: grid; place-items: center; }
.round-btn { width: 36px; height: 36px; border: 0; border-radius: 50%; display: grid; place-items: center; }
.ml-auto { margin-left: auto; }

/* ---------- левая колонка камеры ---------- */
.rail {
  position: absolute; z-index: 10; left: 12px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 4px; padding: 6px; border-radius: 24px;
}
.rail button { width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); display: grid; place-items: center; }
.rail button:hover { background: var(--fill2); color: var(--fg); }
.rail .sep { display: block; height: 4px; }

/* ---------- панель капитала ---------- */
.panel {
  position: absolute; z-index: 10;
  right: 12px; top: calc(60px + env(safe-area-inset-top, 0px)); bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  width: 292px; border-radius: 28px; padding: 14px 12px 12px;
  display: flex; flex-direction: column; gap: 10px;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px; }
.x { width: 28px; height: 28px; border: 0; border-radius: 50%; background: var(--fill); display: grid; place-items: center; color: var(--muted); }
.x:hover { background: var(--fill2); color: var(--fg); }
.scroll { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; scrollbar-width: none; }
.scroll::-webkit-scrollbar { display: none; }
.income { background: var(--fill); border-radius: 22px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.stats > div { background: var(--fill); border-radius: 16px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stats b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sec-title { padding: 0 4px 6px; }
.list { display: flex; flex-direction: column; gap: 2px; }
.item { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 16px; border: 0; background: transparent; text-align: left; width: 100%; }
.item:hover { background: var(--fill); }
.item.me { background: var(--fill); }
/* аватарка — картинка из js/avatar.js: всегда заполняет свой блок */
.ava, .owner i { background-size: cover; background-position: center; }
.item .ava { width: 30px; height: 30px; border-radius: 11px; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--mint-ink); flex: none; }
.item .bld { width: 30px; height: 30px; border-radius: 11px; background: var(--fill2); display: grid; place-items: center; flex: none; }
.item .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.item .grow span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .right { text-align: right; display: flex; flex-direction: column; gap: 1px; }
.empty { padding: 10px; border-radius: 16px; background: var(--fill); color: var(--muted); font-size: 11px; }
.feed { display: flex; flex-direction: column; gap: 6px; padding: 0 4px; }
.feed div { font-size: 11px; color: var(--muted); display: flex; gap: 6px; align-items: baseline; }
.feed i { width: 6px; height: 6px; border-radius: 50%; flex: none; transform: translateY(-1px); }

/* ---------- низ: кубики ---------- */
.dock {
  position: absolute; z-index: 10; left: 50%; transform: translateX(-50%);
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  border-radius: 28px; padding: 8px; display: flex; align-items: center; gap: 12px;
}
.dice-wrap { display: flex; gap: 6px; }
.die { width: 42px; height: 42px; border-radius: 13px; background: #F7FAFE; display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: 8px; gap: 1px; }
.die i { width: 7px; height: 7px; border-radius: 50%; background: #26292E; place-self: center; }
.die.spin { animation: shake 0.12s linear infinite; }
@keyframes shake { 0% { transform: rotate(-8deg) } 50% { transform: rotate(8deg) } 100% { transform: rotate(-8deg) } }
.rolls { display: flex; flex-direction: column; gap: 1px; min-width: 76px; }

.btn { height: 36px; padding: 0 16px; border: 0; border-radius: 999px; font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
.btn.mint { background: var(--mint); color: var(--mint-ink); }
.btn.mint:hover:not(:disabled) { background: #3BEFA1; }
.btn.glass-btn { background: var(--fill2); color: var(--fg); }
.btn.glass-btn:hover:not(:disabled) { background: var(--fill3); }
.btn:disabled { opacity: 0.45; }
.btn.roll { height: 44px; padding: 0 22px; font-size: 15px; }
.w-full { width: 100%; }

/* ---------- карточка участка ---------- */
.card {
  position: absolute; z-index: 12; left: 50%; transform: translateX(-50%);
  bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  width: min(340px, calc(100% - 24px)); border-radius: 26px; padding: 12px;
  display: flex; flex-direction: column; gap: 10px;
  animation: rise 0.22s ease-out;
}
@keyframes rise { from { opacity: 0; transform: translate(-50%, 10px) } to { opacity: 1; transform: translate(-50%, 0) } }
.card .head { display: flex; align-items: center; gap: 8px; }
.card .dchip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 999px; background: var(--fill); font-size: 11px; color: var(--muted); }
.card .dchip i { width: 7px; height: 7px; border-radius: 50%; }
.card .title { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 2px; }
.pips { display: flex; gap: 3px; }
.pips i { width: 14px; height: 5px; border-radius: 3px; background: var(--fill2); }
.pips i.on { background: var(--mint); }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.metrics > div { background: var(--fill); border-radius: 16px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.metrics b { font-size: 13px; font-weight: 600; white-space: nowrap; }
.card .note { font-size: 11px; color: var(--muted); padding: 0 2px; }
.card .note b { color: var(--fg); font-weight: 600; }
.card .note.warn { color: #FFC98A; }
/* суммы на кнопках — полными цифрами: если две кнопки не помещаются в ряд, вторая уходит на свою строку */
.card .actions { display: flex; flex-wrap: wrap; gap: 6px; }
.card .actions .btn { flex: 1 1 auto; }
.owner { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); padding: 0 2px; }
.owner i { width: 16px; height: 16px; border-radius: 6px; display: grid; place-items: center; font-size: 10px; font-weight: 700; font-style: normal; color: var(--mint-ink); }
.brand-tag { align-self: flex-start; height: 26px; padding: 0 12px; border-radius: 999px; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; letter-spacing: 0.03em; }
.brand-tag img { height: 16px; width: auto; display: block; }
.brand-tag span { font-size: 10px; font-weight: 500; letter-spacing: 0; opacity: 0.75; }
.bonus { align-self: flex-start; padding: 4px 9px; border-radius: 999px; background: rgba(25, 230, 140, 0.14); color: var(--mint); font-size: 11px; font-weight: 600; }
.link { background: none; border: 0; padding: 0; color: var(--mint); font-weight: 600; font-size: 11px; }

/* ---------- уведомления, подсказка ---------- */
#toasts { position: absolute; z-index: 30; top: calc(58px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; width: max-content; max-width: calc(100% - 24px); }
.toast { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); font-size: 13px; animation: drop 0.25s ease-out; transition: opacity 0.3s, transform 0.3s; }
.toast i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex: none; }
.toast.good i { background: var(--mint); } .toast.bad i { background: var(--red); } .toast.gold i { background: var(--gold); }
.toast.out { opacity: 0; transform: translateY(-6px); }
@keyframes drop { from { opacity: 0; transform: translateY(-8px) } to { opacity: 1; transform: none } }
.tip { position: absolute; z-index: 15; left: 0; top: 0; border-radius: 16px; padding: 8px 10px; font-size: 11px; pointer-events: none; max-width: 220px; display: flex; flex-direction: column; gap: 2px;
  background: rgba(20, 22, 26, 0.92); -webkit-backdrop-filter: none; backdrop-filter: none; opacity: 0; transition: opacity 0.14s; will-change: transform; }
.tip.on { opacity: 1; }

/* ---------- уход: обратная анимация появления ---------- */
.card.leaving { animation: sink 0.2s ease-in forwards; }
@keyframes sink { to { opacity: 0; transform: translate(-50%, 12px) scale(0.98); } }
.modal { animation: fadeIn 0.2s ease-out; }
.modal.leaving { animation: fadeOut 0.2s ease-in forwards; }
.modal.leaving .sheet { animation: popOut 0.2s ease-in forwards; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes popOut { to { opacity: 0; transform: scale(0.96) translateY(6px); } }
.dice-layer { position: absolute; inset: 0; z-index: 26; pointer-events: none; display: none; }
.dice-layer.on { display: block; animation: fadeIn 0.15s ease-out; }

/* ---------- 3D-подписи ---------- */
.district-tag, .pawn-tag, .float-text { position: absolute; left: 0; top: 0; will-change: transform; white-space: nowrap; }
.district-tag { display: flex; gap: 6px; align-items: center; padding: 4px 10px; border-radius: 999px; background: rgba(24, 26, 30, 0.78); font-size: 11px; font-weight: 600; transition: opacity 0.25s; }
.district-tag span { font-size: 10px; color: var(--muted); font-weight: 500; }
.district-tag.locked span { color: var(--gold); }
.pawn-tag { display: flex; align-items: center; gap: 5px; padding: 3px 8px 3px 4px; border-radius: 999px; background: rgba(24, 26, 30, 0.82); font-size: 10px; font-weight: 600; transition: opacity 0.2s; }
.pawn-tag i { width: 10px; height: 10px; border-radius: 50%; }
.pawn-tag.me { background: var(--mint); color: var(--mint-ink); }
.pawn-tag.me i { background: var(--mint-ink) !important; }
.float-text { padding: 3px 9px; border-radius: 999px; background: rgba(24, 26, 30, 0.75); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.float-text.good { color: var(--mint); } .float-text.bad { color: var(--red); } .float-text.gold { color: #FFD36B; }

/* ---------- кошелёк ---------- */
.modal { position: absolute; inset: 0; z-index: 40; background: rgba(0, 0, 0, 0.5); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal[hidden] { display: none; }
.sheet { width: min(360px, 100%); border-radius: 28px; padding: 14px 12px 12px; display: flex; flex-direction: column; gap: 12px; animation: pop 0.2s ease-out; }
@keyframes pop { from { opacity: 0; transform: scale(0.97) } to { opacity: 1; transform: none } }
.wallet-bals { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.wallet-bals > div { background: var(--fill); border-radius: 18px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.wallet-bals b { font-weight: 600; }
.tabs { display: flex; padding: 4px; border-radius: 999px; background: var(--fill); }
.tabs, .seg { position: relative; isolation: isolate; }
.thumb { position: absolute; z-index: 0; left: 0; top: 4px; bottom: 4px; width: 0; border-radius: 999px; background: var(--fill3); pointer-events: none;
  transition: transform 0.32s cubic-bezier(0.3, 0.8, 0.2, 1), width 0.32s cubic-bezier(0.3, 0.8, 0.2, 1); }
.ptab { flex: 1; height: 30px; border: 0; border-radius: 999px; background: transparent; font-size: 13px; font-weight: 500; color: var(--muted); z-index: 1; }
.ptab.active { color: var(--fg); }
.pane { display: flex; flex-direction: column; gap: 10px; }
.pane.hidden { display: none; }
.pane p { margin: 0; padding: 0 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn { height: 30px; padding: 0 12px; border: 0; border-radius: 999px; background: var(--fill); font-size: 13px; font-weight: 500; }
.chip-btn:hover { background: var(--fill2); }
.chip-btn.on { background: var(--fill3); color: var(--fg); }
.field { display: flex; align-items: center; gap: 8px; height: 44px; border-radius: 16px; background: var(--fill); padding: 0 14px; }
.field input { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; color: var(--fg); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.field input::-webkit-outer-spin-button, .field input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 2px; }
.seg { display: flex; padding: 4px; border-radius: 999px; background: var(--fill); }
.seg button { flex: 1; height: 30px; border: 0; border-radius: 999px; background: transparent; font-size: 13px; color: var(--muted); z-index: 1; }
.seg button.on { color: var(--fg); }
.pane { animation: paneIn 0.2s ease-out; }
/* смена состояния в окнах — только растворение: старое гаснет (.fading), новое проявляется (paneIn), без сдвигов */
@keyframes paneIn { from { opacity: 0; } }
.fading { opacity: 0 !important; transition: opacity 0.12s ease-in; animation: none !important; }
.sheet { will-change: height; }

/* ---------- нажатие на кнопки: сжатие + волна от пальца ---------- */
button { position: relative; overflow: hidden; touch-action: manipulation; -webkit-user-select: none; user-select: none;
  transition: transform 0.22s cubic-bezier(0.3, 0.7, 0.3, 1.5), background-color 0.2s, color 0.2s, opacity 0.2s; }
button.pressed:not(:disabled) { transform: scale(0.95); transition-duration: 0.09s; transition-timing-function: ease-out; }
.ripple { position: absolute; border-radius: 50%; background: currentColor; opacity: 0.2; transform: scale(0); pointer-events: none; animation: ripple 0.55s ease-out forwards; }
@keyframes ripple { to { transform: scale(1); opacity: 0; } }
.row b { display: inline-block; }
.num-tick { animation: tick 0.3s ease-out; }
@keyframes tick { 0% { opacity: 0.4; transform: translateY(3px); } }

/* ---------- адаптив ---------- */
.show-md { display: none; }
/* сворачивание панели на компьютере */
@media (min-width: 1024px) {
  .panel { transition: transform 0.38s cubic-bezier(0.3, 0.8, 0.2, 1), opacity 0.3s ease; }
  .panel.collapsed { transform: translateX(calc(100% + 24px)); opacity: 0; pointer-events: none; }
  #btn-panel[aria-pressed="true"] { background: var(--fill3); color: var(--fg); }
  #btn-panel[aria-pressed="false"] { color: var(--muted); }
}
@media (max-width: 1023px) {
  .show-md { display: grid; }
  .panel { display: none; }
  .panel.open { display: flex; z-index: 20; left: 12px; right: 12px; width: auto; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); background: var(--glass-strong); animation: panelIn 0.24s ease-out; }
  .panel.open.leaving { animation: panelOut 0.2s ease-in forwards; }
  @keyframes panelIn { from { opacity: 0; transform: translateY(14px) scale(0.98); } }
  @keyframes panelOut { to { opacity: 0; transform: translateY(14px) scale(0.98); } }
}
@media (max-width: 639px) {
  .hide-sm { display: none !important; }
  .brand .chip { display: none; }
  .brand .t13 { display: none; }
  .dock { gap: 8px; left: 12px; right: 12px; transform: none; justify-content: space-between; }
  .die { width: 38px; height: 38px; padding: 7px; }
}
@media (pointer: coarse) { :root { --blur: blur(14px); } }
@media (prefers-reduced-motion: reduce) {
  .pane, .ripple { animation: none !important; } .thumb { transition: none; }
  .card, .toast, .sheet, .modal, .panel.open { animation: none !important; }
}

/* ---------- подарок без денег: значок бесплатных бросков ---------- */
.ic-gift { width: 18px; height: 18px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #FFE79A, #F2B630 75%); color: #7A4A00; font-size: 11px; line-height: 1; display: grid; place-items: center; flex: none; }
.rolls-top { display: flex; align-items: center; gap: 6px; }
.mini-buy { height: 20px; padding: 0 7px; border: 0; border-radius: 999px; background: rgba(242, 193, 78, 0.18); color: #FFD36B; font-size: 10px; font-weight: 600; white-space: nowrap; }
.mini-buy:hover { background: rgba(242, 193, 78, 0.3); }
.mini-buy.dim { opacity: 0.45; }
.faint { color: var(--faint); }
.district-tag.lm { background: rgba(255, 255, 255, 0.86); color: #16181C; font-weight: 600; }
.district-tag.lm i { width: 7px; height: 7px; border-radius: 50%; background: #FFC94D; }

/* ---------- получение денег: летящие монетки и карточка события (reward.js) ---------- */
#fly-layer { position: fixed; inset: 0; z-index: 72; pointer-events: none; overflow: hidden; }
.fly { position: absolute; left: -11px; top: -11px; width: 22px; height: 22px; display: grid; place-items: center; will-change: transform, opacity; }
.fly .ic-md { width: 22px; height: 22px; }
.wallet-bar .bal { will-change: transform; }

.rw-banner {
  position: fixed; z-index: 71; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);   /* над кубиками: монетки летят вверх и её не закрывают */
  display: flex; align-items: center; gap: 12px; padding: 10px 18px 10px 10px; border-radius: 28px;
  pointer-events: none; max-width: calc(100% - 32px);
  animation: rwIn 0.42s cubic-bezier(0.3, 0.7, 0.3, 1.25) both;
}
.rw-banner.out { animation: rwOut 0.3s ease-in forwards; }
.rw-ic { width: 46px; height: 46px; border-radius: 18px; display: grid; place-items: center; flex: none; }
.rw-ic.k-md { background: rgba(25, 230, 140, 0.16); }
.rw-ic.k-gift { background: rgba(242, 193, 78, 0.16); }
.rw-ic .ic-md { width: 26px; height: 26px; }
.rw-ic .ic-gift { width: 26px; height: 26px; font-size: 14px; }
.rw-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.rw-text > span { white-space: nowrap; }
.rw-text b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rw-amount { margin-left: 8px; white-space: nowrap; }
.rw-amount.k-md { color: var(--mint); }
.rw-amount.k-gift { color: #FFD36B; }
@keyframes rwIn { from { opacity: 0; transform: translate(-50%, 16px) scale(0.9); } }
@keyframes rwOut { to { opacity: 0; transform: translate(-50%, 10px) scale(0.96); } }
@media (prefers-reduced-motion: reduce) { .rw-banner, .rw-banner.out { animation: none; } }

/* ---------- иконки из спрайта (icons/sprite.svg, набор Solar Bold) ---------- */
.ic { display: inline-block; flex: none; vertical-align: middle; fill: currentColor; overflow: visible; }
/* Монета — знак валюты M$ (i-coin, icons/custom.svg). В тексте стоит после суммы и берёт размер от шрифта: её ставит
   coinNodes() из icons.js на место «M$». На мятной кнопке цвета меняются местами, иначе монета сольётся с фоном. */
.ic.coin { width: 1.2em; height: 1.2em; margin-left: 0.25em; vertical-align: -0.25em; }
.btn .ic.coin { margin-left: 0; }
.btn.mint .coin, .btn.mint .ic-md { --c: var(--mint-ink); --r: var(--mint-ink); --k: var(--mint); }
/* Иконка рядом с текстом: опускаем на 1 px — центр строчных букв ниже середины строки,
   и без сдвига иконка кажется выше текста. Иконки без текста (круглые кнопки) остаются по центру. */
.cab-link .ic, .um-item .ic, .btn .ic, .contacts a .ic, .l-faq button .ic, .seg button .ic, .chip-btn .ic, .banner .ic { transform: translateY(1px); }

/* ---------- поздравление по центру: покупка, стройка, продажа (reward.celebrate) ---------- */
.cel { position: fixed; inset: 0; z-index: 71; display: grid; place-items: center; padding: 16px; background: rgba(8, 9, 11, 0.55); cursor: pointer; animation: fadeIn 0.18s ease-out; }
.cel.out { animation: fadeOut 0.24s ease-in forwards; }
.cel-card { width: min(300px, 100%); border-radius: 30px; padding: 22px 20px 20px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; animation: celPop 0.42s cubic-bezier(0.3, 0.7, 0.3, 1.35) both; }
.cel.out .cel-card { animation: celOut 0.24s ease-in forwards; }
.cel-card .t13 { line-height: 1.45; }
.cel-ic { width: 56px; height: 56px; border-radius: 20px; background: var(--mint); color: var(--mint-ink); display: grid; place-items: center; margin-bottom: 6px; animation: celIc 0.55s 0.08s cubic-bezier(0.3, 0.7, 0.3, 1.6) both; }
.cel-amount { margin-top: 6px; height: 32px; padding: 0 14px; border-radius: 999px; display: inline-flex; align-items: center; background: var(--fill); }
.cel-amount.k-md { background: rgba(25, 230, 140, 0.14); color: var(--mint); }
@keyframes celPop { from { opacity: 0; transform: scale(0.85); } }
@keyframes celOut { to { opacity: 0; transform: scale(0.94); } }
@keyframes celIc { from { transform: scale(0.4) rotate(-18deg); } }

/* ---------- сцена броска: затемнение, кубики по центру, итог (ui.rollDice) ---------- */
#roll-stage { position: fixed; inset: 0; z-index: 66; pointer-events: none; display: none; }
#roll-stage.on { display: block; }
#roll-stage.out { animation: fadeOut 0.28s ease-in forwards; }
.rs-dim { position: absolute; inset: 0; background: rgba(8, 9, 11, 0.58); animation: fadeIn 0.2s ease-out; }
#roll-stage .dice-layer { position: absolute; inset: 0; z-index: 1; display: block; animation: none; }
.rs-flat { position: absolute; z-index: 1; left: 50%; top: 50%; transform: translate(-50%, -50%); display: none; gap: 18px; }
#roll-stage.flat .rs-flat { display: flex; }
.rs-flat .die { width: 84px; height: 84px; border-radius: 24px; padding: 16px; gap: 2px; }
.rs-flat .die i { width: 13px; height: 13px; }
#roll-stage.flat:not(.done) .rs-flat .die { animation: shake 0.12s linear infinite; }
.rs-result { position: absolute; z-index: 2; left: 50%; top: 60%; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; padding: 8px 20px 8px 8px; border-radius: 999px; max-width: calc(100% - 32px); opacity: 0; }
#roll-stage.done .rs-result { opacity: 1; animation: rwIn 0.38s cubic-bezier(0.3, 0.7, 0.3, 1.25) both; }
.rs-sum { width: 44px; height: 44px; border-radius: 50%; background: var(--mint); color: var(--mint-ink); display: grid; place-items: center; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; flex: none; }
.rs-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rs-text > * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Карточки, которые появляются на секунду поверх города (итог броска, поздравление), — без размытия фона.
   Фон у них почти непрозрачный, размытие под ним не видно, а телефон в момент появления тратит на него время. */
.cel-card, .rs-result { -webkit-backdrop-filter: none; backdrop-filter: none; }
@media (prefers-reduced-motion: reduce) { .cel, .cel-card, .cel-ic, .cel.out, #roll-stage.out, .rs-dim, #roll-stage.done .rs-result { animation: none; } }
