:root {
  color-scheme: dark;
  /* Единая палитра с экраном профиля (HUD): глубокий фиолет, золото, акценты оранж/циан */
  --bg: #140a1c;
  --bg-mid: #1a0f28;
  --panel: rgba(24, 14, 36, 0.9);
  --panel-edge: rgba(255, 213, 127, 0.26);
  --bar-green: #66bb6a;
  --bar-green-dark: #2e7d32;
  --bar-green-bright: #c5e1a5;
  --buy-orange: #e65100;
  --buy-orange-light: #ffab40;
  --text: #fffef7;
  --muted: #b0a8c4;
  --timer-bg: rgba(20, 16, 28, 0.92);
  --rail-size: 44px;
  --card-bg: linear-gradient(165deg, rgba(38, 28, 52, 0.95) 0%, rgba(18, 10, 26, 0.98) 100%);
  --font-ui: "Fredoka", "Arial Black", "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
  height: -webkit-fill-available;
}

html, body {
  overflow: hidden;
  max-height: 100%;
  max-height: 100dvh;
}

body {
  min-height: 100%;
  min-height: 100dvh;
  height: 100%;
  margin: 0;
  font-family: var(--font-ui);
  color: var(--text);
  background: #0a0610;
  position: relative;
}

/* Фон: закат, звёзды, полоски как в idle-играх, горизонт, город */
.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background: #120818 url("assets/main-bg.jpg?v=2") center center / cover no-repeat;
}

.ambient__dusk {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 21px,
      rgba(255, 255, 255, 0.024) 21px,
      rgba(255, 255, 255, 0.024) 22px
    ),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 21px,
      rgba(255, 255, 255, 0.018) 21px,
      rgba(255, 255, 255, 0.018) 22px
    ),
    radial-gradient(ellipse 100% 72% at 50% -18%, rgba(171, 71, 188, 0.42) 0%, transparent 52%),
    radial-gradient(ellipse 95% 58% at 0% 100%, rgba(255, 152, 0, 0.17) 0%, transparent 48%),
    radial-gradient(ellipse 85% 52% at 100% 96%, rgba(79, 195, 247, 0.11) 0%, transparent 46%),
    linear-gradient(188deg, #150a24 0%, #070510 52%, #020108 100%);
}

.ambient__stars {
  position: absolute;
  inset: 0;
  opacity: 0;
  background-image:
    radial-gradient(1px 1px at 10% 15%, rgba(255, 255, 255, 0.9) 50%, transparent 50%),
    radial-gradient(1px 1px at 30% 8%, rgba(255, 255, 255, 0.75) 50%, transparent 50%),
    radial-gradient(1.5px 1.5px at 55% 22%, rgba(255, 255, 255, 0.85) 50%, transparent 50%),
    radial-gradient(1px 1px at 72% 12%, rgba(255, 255, 255, 0.6) 50%, transparent 50%),
    radial-gradient(1px 1px at 88% 28%, rgba(255, 255, 255, 0.7) 50%, transparent 50%),
    radial-gradient(1px 1px at 18% 35%, rgba(255, 255, 255, 0.5) 50%, transparent 50%),
    radial-gradient(1px 1px at 42% 6%, rgba(255, 255, 255, 0.65) 50%, transparent 50%),
    radial-gradient(1px 1px at 65% 38%, rgba(255, 255, 255, 0.55) 50%, transparent 50%);
  background-size: 100% 100%;
  animation: twinkle 7s ease-in-out infinite alternate;
}

@keyframes twinkle {
  from { opacity: 0.4; }
  to { opacity: 0.7; }
}

.ambient__pinstripe {
  position: absolute;
  inset: 0;
  opacity: 0;
  background-image: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0, 0, 0, 0.5) 3px,
    rgba(0, 0, 0, 0.5) 5px
  );
}

.ambient__horizon {
  position: absolute;
  left: -10%;
  right: -10%;
  /* Верх подсветки совпадает с верхом слоя небоскрёбов */
  bottom: min(62vh, 620px);
  height: 80px;
  opacity: 0;
  background: radial-gradient(ellipse 70% 40% at 50% 100%, rgba(255, 152, 100, 0.28) 0%, transparent 70%);
  filter: blur(4px);
}

/* Небоскрёбы: ~62vh, SVG тянем по высоте слоя (пропорции тайла из viewBox) */
.ambient__city {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: min(62vh, 620px);
  background: url("assets/skyline.svg?v=3") repeat-x center bottom;
  /* Высота слоя = 100% высоты фона; ширина тайла из пропорций SVG (~1.6:1), без растягивания по ширине */
  background-size: auto 100%;
  background-repeat: repeat-x;
  opacity: 0;
}

.ambient__vignette {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.shell {
  position: relative;
  z-index: 1;
  --brand-logo-h: clamp(44px, 12vw, 62px);
  --brand-top-pad: calc(2px + env(safe-area-inset-top, 0));
  --brand-bottom-gap: -8px;
  --header-overlay-h: 148px;
  --bottom-overlay-h: 112px;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  /* Ровно экран: иначе колонка растягивается, body с overflow:hidden обрезает низ и нет scroll в списке */
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  max-height: -webkit-fill-available;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.game-brand {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding: var(--brand-top-pad) 10px var(--brand-bottom-gap);
  margin: 0;
  pointer-events: none;
  user-select: none;
  position: fixed;
  left: 50%;
  top: 0;
  width: min(100%, 520px);
  transform: translate(-50%, 26px);
  z-index: 10020;
  overflow: hidden;
}

.game-brand__svg {
  width: min(100%, 360px);
  height: auto;
  max-height: var(--brand-logo-h);
  display: block;
  margin-top: -12px;
}

/* --- Header (игровой HUD) --- */
.game-header {
  position: absolute;
  top: calc(var(--brand-top-pad) + var(--brand-logo-h) + var(--brand-bottom-gap) + 6px);
  left: 8px;
  right: 8px;
  z-index: 10010;
  flex-shrink: 0;
  padding: 8px 10px 10px;
  padding-top: 8px;
  margin: 0;
  background: linear-gradient(180deg, rgba(48, 28, 72, 0.97) 0%, rgba(20, 12, 34, 0.94) 100%);
  border: 1px solid rgba(255, 213, 127, 0.32);
  border-radius: 16px;
  box-shadow:
    0 6px 22px rgba(0, 0, 0, 0.55),
    0 0 36px rgba(171, 71, 188, 0.14),
    0 0 1px rgba(255, 213, 79, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.game-header::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 213, 127, 0.45), transparent);
  pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
  .game-header {
    animation: game-header-hud-breathe 9s ease-in-out infinite alternate;
  }
}

@keyframes game-header-hud-breathe {
  from {
    box-shadow:
      0 6px 22px rgba(0, 0, 0, 0.55),
      0 0 32px rgba(171, 71, 188, 0.12),
      0 0 1px rgba(255, 213, 79, 0.3),
      inset 0 1px 0 rgba(255, 255, 255, 0.12);
  }
  to {
    box-shadow:
      0 8px 26px rgba(0, 0, 0, 0.58),
      0 0 44px rgba(171, 71, 188, 0.2),
      0 0 1px rgba(255, 213, 127, 0.42),
      inset 0 1px 0 rgba(255, 255, 255, 0.14);
  }
}

@media (prefers-reduced-motion: reduce) {
  .game-header {
    animation: none;
  }
}

.header-top {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.avatar-btn {
  flex-shrink: 0;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

a.avatar-btn {
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.avatar-ring {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(145deg, #ffe082, #ff8f00);
  display: grid;
  place-items: center;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.5),
    inset 0 2px 4px rgba(255, 255, 255, 0.35);
  border: 2px solid #fff8e1;
}

.avatar-face {
  font-size: 24px;
  line-height: 1;
}

.avatar-ring .avatar-tg-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.header-money-block {
  flex: 1;
  min-width: 0;
  text-align: center;
}

.money-main {
  font-size: clamp(1.05rem, 4.4vw, 1.42rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #fffef5;
  text-shadow:
    0 0 18px rgba(255, 213, 79, 0.55),
    0 0 32px rgba(255, 193, 7, 0.2),
    0 2px 0 #4e342e,
    0 4px 6px rgba(0, 0, 0, 0.65);
  line-height: 1.1;
  word-break: break-word;
}

/* $/с и ангелы — одна строка под балансом, без «коробки» */
.header-inline-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 8px;
  margin: 5px 0 0;
  padding: 0;
  border: none;
  background: none;
  font-size: clamp(0.78rem, 3.2vw, 0.92rem);
  line-height: 1.3;
}

.header-inline-pair {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  white-space: nowrap;
}

.header-inline-lbl {
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  font-size: clamp(0.68rem, 2.75vw, 0.8rem);
  color: rgba(200, 210, 222, 0.95);
}

.header-inline-val {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  font-size: clamp(0.88rem, 3.8vw, 1.06rem);
  color: #fff8e1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.header-inline-dot {
  font-size: clamp(0.85rem, 3.2vw, 1rem);
  opacity: 0.5;
  color: rgba(255, 224, 178, 0.7);
  user-select: none;
}

@keyframes header-progress-shine {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(120%);
  }
}

@keyframes header-progress-ready-pulse {
  0%,
  100% {
    box-shadow: 0 0 6px rgba(129, 199, 132, 0.35);
  }
  50% {
    box-shadow: 0 0 14px rgba(255, 213, 79, 0.55);
  }
}

.header-progress-wrap {
  margin-top: 5px;
  width: 100%;
}

.header-progress-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 3px;
}

.header-progress-title {
  font-size: 0.5rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 213, 120, 0.75);
}

.header-progress-hint {
  font-size: 0.56rem;
  font-weight: 700;
  color: rgba(187, 222, 251, 0.95);
  text-align: right;
  line-height: 1.2;
  max-width: 62%;
}

.header-progress-wrap--ready .header-progress-hint {
  color: #c8e6c9;
  text-shadow: 0 0 8px rgba(129, 199, 132, 0.45);
}

.header-progress-track {
  position: relative;
  height: 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 213, 120, 0.12);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.header-progress-wrap--ready .header-progress-track {
  animation: header-progress-ready-pulse 2.2s ease-in-out infinite;
  border-color: rgba(129, 199, 132, 0.35);
}

.header-progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff8f00 0%, #ffca28 40%, #fff59d 100%);
  box-shadow:
    0 0 10px rgba(255, 193, 7, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: width 0.45s cubic-bezier(0.33, 1, 0.68, 1);
  position: relative;
  overflow: hidden;
}

.header-progress-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 0%,
    rgba(255, 255, 255, 0.5) 45%,
    transparent 70%
  );
  animation: header-progress-shine 2.8s ease-in-out infinite;
  pointer-events: none;
}

.header-progress-fill--hot {
  background: linear-gradient(90deg, #ff6f00 0%, #ffd54f 55%, #fffde7 100%);
  box-shadow:
    0 0 14px rgba(255, 152, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.header-progress-fill--ready {
  background: linear-gradient(90deg, #43a047 0%, #ffca28 100%);
  box-shadow:
    0 0 12px rgba(67, 160, 71, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.header-progress-wrap--level {
  margin-top: 4px;
}

.header-progress-wrap--level .header-progress-title {
  color: rgba(206, 147, 255, 0.92);
}

.header-progress-wrap--level .header-progress-hint {
  color: rgba(225, 190, 255, 0.95);
}

.header-progress-wrap--level.header-progress-wrap--ready .header-progress-hint {
  color: #e1bee7;
  text-shadow: 0 0 8px rgba(186, 104, 200, 0.5);
}

.header-progress-track--level {
  border-color: rgba(186, 104, 200, 0.25);
}

.header-progress-fill--level {
  background: linear-gradient(90deg, #5e35b1 0%, #ab47bc 42%, #e1bee7 100%);
  box-shadow:
    0 0 10px rgba(171, 71, 188, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.header-progress-fill--level.header-progress-fill--hot {
  background: linear-gradient(90deg, #4527a0 0%, #ce93d8 50%, #faf5ff 100%);
  box-shadow:
    0 0 14px rgba(186, 104, 200, 0.58),
    inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.header-progress-fill--level.header-progress-fill--ready {
  background: linear-gradient(90deg, #43a047 0%, #ba68c8 100%);
  box-shadow:
    0 0 12px rgba(67, 160, 71, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

@media (prefers-reduced-motion: reduce) {
  .header-progress-fill::after {
    animation: none;
  }

  .header-progress-wrap--ready .header-progress-track {
    animation: none;
  }
}

.header-tagline {
  margin-top: 4px;
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 236, 179, 0.88);
  text-shadow:
    0 0 12px rgba(255, 193, 7, 0.35),
    0 1px 2px rgba(0, 0, 0, 0.55);
  line-height: 1.2;
}

.buy-mode-tag {
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 2px;
  padding: 6px 8px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffb74d 0%, var(--buy-orange) 55%, #bf360c 100%);
  color: #fffef5;
  font-weight: 800;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  cursor: pointer;
  box-shadow:
    0 3px 0 #5d2800,
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  max-width: 92px;
  line-height: 1.2;
}

.buy-mode-tag:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 #8d3800;
}

/* --- Main + list --- */
.main-stage {
  flex: 1 1 auto;
  display: flex;
  min-height: 0;
  min-width: 0;
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.scroll-area {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding: calc(var(--header-overlay-h) + 40px) 8px calc(var(--bottom-overlay-h) + 18px) 10px;
  padding-right: calc(var(--rail-size) + 12px);
  background:
    linear-gradient(180deg, rgba(255, 213, 79, 0.04) 0%, transparent 28%),
    linear-gradient(180deg, rgba(18, 10, 28, 0.5) 0%, rgba(6, 2, 12, 0.72) 100%);
  border-radius: 0;
  margin: 0;
  border: 1px solid rgba(255, 213, 127, 0.14);
  border-bottom: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    inset 0 -20px 40px rgba(171, 71, 188, 0.06),
    0 4px 24px rgba(0, 0, 0, 0.35);
}

.business-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.biz-row {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 8px;
  min-height: 82px;
  padding: 10px 10px 10px 8px;
  background: linear-gradient(165deg, rgba(58, 42, 80, 0.96) 0%, rgba(28, 16, 42, 0.98) 100%);
  border: 2px solid rgba(80, 58, 108, 0.9);
  border-radius: 14px;
  box-shadow:
    0 3px 0 rgba(0, 0, 0, 0.4),
    0 0 20px rgba(171, 71, 188, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.09);
  transition: box-shadow 0.2s ease;
  overflow: hidden;
}

.biz-row::before {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  top: 0;
  height: 2px;
  border-radius: 0 0 2px 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 213, 127, 0.5), transparent);
  opacity: 0.85;
  pointer-events: none;
}

.biz-row--cycle {
  box-shadow:
    0 0 0 2px rgba(129, 199, 132, 0.35),
    0 3px 0 rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.biz-row--afford {
  box-shadow:
    0 0 0 2px rgba(255, 152, 0, 0.45),
    0 3px 0 rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.biz-icon-col {
  flex-shrink: 0;
  width: 58px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.biz-run-hit {
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 100%;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  font: inherit;
  color: inherit;
}

.biz-run-hit:disabled {
  cursor: not-allowed;
}

.biz-run-hit:focus-visible {
  outline: 2px solid rgba(129, 199, 132, 0.8);
  outline-offset: 2px;
  border-radius: 8px;
}

.biz-icon-circle {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  transition: filter 0.2s ease;
}

.biz-icon-circle .biz-svg {
  width: 56px;
  height: 56px;
  display: block;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.5));
}

.biz-icon-circle--hot {
  filter: drop-shadow(0 0 10px rgba(255, 152, 0, 0.9));
}

.biz-fallback {
  font-size: 1.5rem;
  opacity: 0.6;
}

.biz-milestone-pill {
  position: relative;
  width: 100%;
  max-width: 56px;
  height: 14px;
  border-radius: 10px;
  background: #2a2a35;
  border: 2px solid #1e1e28;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

.biz-milestone-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background: linear-gradient(180deg, #9ccc65 0%, #66bb6a 50%, #2e7d32 100%);
  border-radius: 8px 0 0 8px;
  transition: width 0.15s ease-out;
}

.biz-milestone-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.58rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
  z-index: 1;
  pointer-events: none;
}

.biz-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  justify-content: center;
}

.biz-green-wrap {
  position: relative;
  height: 30px;
  filter: none;
}

.biz-green-bar {
  position: absolute;
  inset: 0;
  background: #3a3a42;
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 50%, calc(100% - 16px) 100%, 0 100%);
  border-radius: 4px 0 0 4px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid #25252a;
  padding: 0;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
}

.biz-green-bar--inactive {
  background: #35353d;
}

.biz-green-bar--inactive .biz-green-fill {
  opacity: 0.35;
}

.biz-green-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 100%;
  background: linear-gradient(180deg, #d4e157 0%, var(--bar-green) 40%, #1b5e20 100%);
  transform-origin: left center;
  transform: scaleX(0);
  will-change: transform;
  transition: transform 0.12s linear;
  z-index: 0;
  overflow: hidden;
  backface-visibility: hidden;
}

@keyframes biz-green-stripes-shift {
  0% { transform: translate3d(-24px, 0, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

.biz-green-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    rgba(255, 255, 255, 0.05) 0,
    rgba(255, 255, 255, 0.05) 9px,
    rgba(0, 0, 0, 0.1) 9px,
    rgba(0, 0, 0, 0.1) 18px
  );
  animation: none;
  pointer-events: none;
}

.biz-green-bar--striped .biz-green-fill::after {
  content: "";
}

.biz-green-bar--fastlane .biz-green-fill {
  transform: scaleX(1) !important;
  transition: none !important;
}

.biz-green-bar--fastlane .biz-green-fill::after {
  content: "";
  animation: biz-green-stripes-shift 4.2s linear infinite;
  will-change: transform;
  transform: translate3d(0, 0, 0);
}

.biz-green-content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px 3px 5px;
  min-height: 100%;
}

.note-ico {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.4));
}

.biz-rate-text {
  flex: 1;
  min-width: 0;
  font-size: 0.7rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.biz-buy-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  border: 2px solid #5d2800;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  min-height: 40px;
  padding: 5px 10px;
  width: 100%;
  background: linear-gradient(180deg, #ffcc80 0%, #ff9800 45%, #e65100 100%);
  box-shadow:
    0 3px 0 #5d2800,
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.biz-buy-btn:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #5d2800;
}

.biz-buy-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.buy-line1 {
  font-size: 0.68rem;
  font-weight: 800;
  color: #3e2723;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.1;
}

.buy-line2 {
  font-size: 0.78rem;
  font-weight: 800;
  color: #2d1b00;
  line-height: 1.1;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);
}

.biz-timer {
  flex-shrink: 0;
  min-width: 48px;
  max-width: 56px;
  align-self: center;
  background: linear-gradient(180deg, #424250 0%, #2e2e38 100%);
  border-radius: 8px;
  text-align: center;
  font-size: 0.6rem;
  font-weight: 800;
  color: #eceff1;
  padding: 8px 4px;
  line-height: 1.25;
  border: 2px solid #1a1a22;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.5);
}

/* Side rail */
.side-rail {
  position: absolute;
  right: 2px;
  top: 0;
  bottom: 0;
  width: var(--rail-size);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 8px 0 12px;
  pointer-events: auto;
  z-index: 2;
  filter: drop-shadow(-3px 0 12px rgba(0, 0, 0, 0.45)) drop-shadow(0 0 18px rgba(171, 71, 188, 0.12));
}

.rail-ico {
  display: grid;
  place-items: center;
  line-height: 0;
}

.rail-ico svg,
.rail-svg {
  display: block;
}

/* Единый HUD: крем/золото как в шапке, без «клипарта» */
.rail-svg--hud {
  filter:
    drop-shadow(0 0 4px rgba(255, 213, 127, 0.14))
    drop-shadow(0 1px 2px rgba(0, 0, 0, 0.55));
}

.rail-btn {
  position: relative;
  width: var(--rail-size);
  height: var(--rail-size);
  border-radius: 50%;
  border: 2px solid rgba(255, 248, 220, 0.55);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 0 14px rgba(255, 255, 255, 0.06);
  transition: transform 0.12s ease, box-shadow 0.15s ease;
}

.rail-btn:active {
  transform: scale(0.94);
}

/* Сезон: наклонная «кривая» плашка вместо круга */
.rail-btn.rail-btn--season {
  width: 72px;
  max-width: none;
  height: auto;
  min-height: 0;
  margin-left: -14px;
  padding: 2px 0 4px;
  border-radius: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  place-items: stretch;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.rail-btn.rail-btn--season:active {
  transform: scale(0.96);
}

.rail-season-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.rail-season-plate {
  display: block;
  width: 100%;
  transform: skewX(-11deg) rotate(-2.5deg);
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.42));
}

.rail-season-plate__inner {
  display: block;
  padding: 6px 8px 7px;
  background: linear-gradient(148deg, #8e6bc9 0%, #6a3faa 38%, #3d1f6e 100%);
  border-radius: 5px 14px 7px 11px;
  border: 2px solid rgba(255, 236, 200, 0.78);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -1px 0 rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(0, 0, 0, 0.35);
}

.rail-season-label {
  display: block;
  transform: skewX(11deg) rotate(2.5deg);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1.15;
  text-align: center;
  color: #fff8e8;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  white-space: nowrap;
}

.rail-season-timer {
  font-size: 0.42rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  color: #eceff1;
  text-shadow: 0 1px 2px #000;
  white-space: nowrap;
  line-height: 1.2;
  max-width: 76px;
}

.rail-event { background: linear-gradient(145deg, #7e57c2, #4527a0); }
.rail-btn.rail-btn--season.rail-event {
  background: transparent;
  box-shadow: none;
}
.rail-warp { background: linear-gradient(145deg, #9575cd, #5e35b1); }
.rail-boost { background: linear-gradient(145deg, #42a5f5, #1565c0); }
.rail-connect { background: linear-gradient(145deg, #29b6f6, #0277bd); }

.rail-timer {
  position: absolute;
  bottom: -14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.55rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 2px #000;
  white-space: nowrap;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Bottom bar — всегда у нижнего края экрана */
.bottom-bar {
  flex: 0 0 auto;
  flex-shrink: 0;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10015;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 6px;
  padding: 8px 12px calc(12px + env(safe-area-inset-bottom, 0));
  background: transparent;
  border-top: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.bottom-bar::before {
  display: none;
}

/* Пять пунктов: Магазин · Кошелёк · Плей · Меню · Профиль */
.bottom-bar--five {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: end;
  justify-items: center;
  gap: 2px;
  padding: 26px 10px 12px;
}

.bottom-bar--glass.bottom-bar--five {
  padding: 8px 14px 6px;
  gap: 0;
}

.bottom-bar--five .bottom-shop,
.bottom-bar--five .bottom-wallet,
.bottom-bar--five .bottom-nav-item--play,
.bottom-bar--five .bottom-menu--center,
.bottom-bar--five .bottom-profile {
  justify-self: center;
}

/* Glass: плавающая «капсула» — огранка как в референсе: толстый контур, градиент, блик + стекло */
.bottom-bar--glass {
  --bottom-glass-rim: #2b1810;
  --bottom-glass-float-margin: 14px;
  position: fixed;
  left: 50%;
  bottom: max(var(--bottom-glass-float-margin), calc(8px + env(safe-area-inset-bottom, 0px)));
  width: min(520px, calc(100vw - 28px));
  max-width: calc(100vw - 28px);
  margin: 0;
  transform: translateX(-50%);
  box-sizing: border-box;
  z-index: 10018;
  isolation: isolate;
  pointer-events: auto;
  border-radius: 999px;
}

.bottom-bar--glass::before {
  display: block;
  content: "";
  position: absolute;
  inset: 12px 0 0;
  z-index: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(180deg, #ff8f2a 0%, #ff6500 52%, #e14c00 100%);
  border: 4px solid var(--bottom-glass-rim);
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.24),
    0 4px 0 rgba(43, 24, 16, 0.62),
    inset 0 2px 0 rgba(255, 255, 255, 0.2),
    inset 0 -2px 0 rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
}

.bottom-bar--glass > * {
  position: relative;
  z-index: 2;
}

.bottom-bar--glass .bottom-nav-item--play {
  z-index: 3;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .bottom-bar--glass::before {
    background: linear-gradient(180deg, #ffcc80 0%, #ff9800 45%, #e65100 100%);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .bottom-bar--glass::before {
    background: linear-gradient(180deg, #ffcc80 0%, #fb8c00 50%, #d84315 100%);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

.bottom-bar--glass .bottom-nav-item {
  color: #ffe8b8;
}

.bottom-bar--glass .bottom-nav-tile--sq,
.bottom-bar--glass .bottom-nav-tile--round {
  background: transparent;
  border: none;
  box-shadow: none;
}

.bottom-bar--glass .bottom-nav-tile--sq {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: transparent;
  border: none;
  box-shadow: none;
}

.bottom-bar--glass .bottom-nav-tile--round {
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  box-shadow: none;
}

.bottom-bar--glass .bottom-nav-tile--menu {
  background: transparent;
}

.bottom-bar--glass .bottom-nav-tile--shop {
  border: none;
  background: transparent;
  box-shadow: none;
}

.bottom-bar--glass .bottom-nav-caption {
  color: #ffefcc;
  text-shadow:
    0 1px 0 rgba(0, 0, 0, 0.55),
    0 0 8px rgba(0, 0, 0, 0.25);
  font-size: 0.56rem;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0.015em;
  min-height: 0;
  margin-top: 2px;
}

.bottom-bar--glass .bottom-svg {
  width: 24px;
  height: 24px;
  filter: drop-shadow(0 1px 1px rgba(62, 39, 35, 0.35));
}

.bottom-bar--glass .bottom-svg--wallet,
.bottom-bar--glass .bottom-svg--shop {
  width: 30px;
  height: 30px;
}

.bottom-bar--glass .bottom-profile-avatar {
  color: #fff8e1;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.45));
  width: 26px;
  height: 26px;
  font-size: 17px;
}

.bottom-bar--glass .bottom-svg--menu rect {
  fill: #fff8e1;
}

.bottom-bar--glass .bottom-nav-item {
  gap: 1px;
}

.bottom-bar--glass .bottom-nav-item:not(.bottom-nav-item--play) {
  transform: translateY(-7px);
}

.bottom-bar--glass .bottom-nav-item--play .bottom-nav-fab {
  width: 62px;
  height: 62px;
  margin-bottom: 0;
  transform: translateY(-22px);
  border: 4px solid var(--bottom-glass-rim, #2b1810);
  background: linear-gradient(
    180deg,
    #ffe082 0%,
    #ffd54f 36%,
    #ffca28 62%,
    #ffb300 86%,
    #ff8f00 100%
  );
  box-shadow:
    0 3px 0 rgba(26, 15, 10, 0.72),
    0 6px 12px rgba(0, 0, 0, 0.16),
    inset 0 3px 0 rgba(255, 255, 255, 0.75),
    inset 0 -2px 0 rgba(183, 77, 0, 0.45);
}

.bottom-bar--glass .bottom-nav-item--play .bottom-svg--play-tri {
  width: 23px;
  height: 23px;
  margin-left: 4px;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.25));
}

.bottom-bar--glass .bottom-nav-item--play:active .bottom-nav-fab {
  transform: translateY(-20px) scale(0.97);
  box-shadow:
    0 2px 0 rgba(26, 15, 10, 0.66),
    0 4px 9px rgba(0, 0, 0, 0.14),
    inset 0 2px 0 rgba(255, 255, 255, 0.65),
    inset 0 -2px 0 rgba(183, 77, 0, 0.4);
}

.bottom-bar--glass .bottom-nav-item--play .bottom-nav-caption {
  display: none;
}

/* iOS/TMA: при открытой клавиатуре в кошельке скрываем нижний бар,
   чтобы он не "всплывал" над клавиатурой. */
body.tma-keyboard-open .bottom-bar--glass {
  display: none !important;
}

/* Центральная кнопка «Плей» */
.bottom-nav-item--play {
  min-width: 0;
  padding: 0;
}

.bottom-nav-item--play .bottom-nav-fab {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin-bottom: 2px;
  transform: translateY(-20px);
  background: linear-gradient(180deg, #ffe082 0%, #ffc107 42%, #f57c00 100%);
  border: 3px solid #3e2723;
  box-shadow:
    0 4px 0 rgba(62, 39, 35, 0.45),
    0 12px 22px rgba(0, 0, 0, 0.28),
    inset 0 2px 0 rgba(255, 255, 255, 0.55);
}

.bottom-nav-item--play .bottom-svg--play-tri {
  width: 22px;
  height: 22px;
  display: block;
  margin-left: 3px;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.2));
}

.bottom-nav-item--play:active .bottom-nav-fab {
  transform: translateY(-18px) scale(0.97);
  transition: transform 0.08s ease;
}

/* Единый стиль нижнего ряда: тёмные «плитки» + SVG (кроме жёлтого магазина) */
.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  color: #4e342e;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  min-width: 0;
}

a.bottom-nav-item {
  text-decoration: none;
}

.bottom-nav-tile {
  position: relative;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-sizing: border-box;
}

.bottom-nav-tile--sq {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(180deg, #fff7df 0%, #f5e6bd 56%, #e8d3a1 100%);
  border: 2px solid #4a2d1a;
  box-shadow:
    0 3px 0 rgba(74, 45, 26, 0.45),
    0 8px 14px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.68);
}

.bottom-nav-tile--round {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(180deg, #fff7df 0%, #f3e2b9 58%, #e6cf9c 100%);
  border: 2px solid #4a2d1a;
  box-shadow:
    0 3px 0 rgba(74, 45, 26, 0.45),
    0 8px 14px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.68);
}

.bottom-nav-tile--menu {
  padding: 0;
}

.bottom-svg {
  width: 28px;
  height: 28px;
  display: block;
  filter: drop-shadow(0 1px 1px rgba(74, 45, 26, 0.24));
}

.bottom-svg--wallet {
  width: 30px;
  height: 30px;
}

.bottom-svg--profile {
  width: 30px;
  height: 30px;
}

.bottom-profile-avatar {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  font-size: 20px;
  line-height: 1;
  color: #212121;
}

.bottom-profile-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.bottom-nav-caption {
  font-size: 0.52rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #5d4037;
  max-width: 76px;
  text-align: center;
  line-height: 1.1;
  min-height: 0.62rem;
}

.bottom-nav-caption--phantom {
  opacity: 0;
  pointer-events: none;
  user-select: none;
}

.bottom-shop {
  align-self: end;
}

.bottom-nav-tile--shop {
  border-color: #4a2d1a;
  background: linear-gradient(180deg, #fff7df 0%, #f5e6bd 56%, #e8d3a1 100%);
  box-shadow:
    0 3px 0 rgba(74, 45, 26, 0.45),
    0 8px 14px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.68);
}

.bottom-svg--shop {
  width: 30px;
  height: 30px;
  filter: drop-shadow(0 1px 1px rgba(74, 45, 26, 0.24));
}

.bottom-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid #fff;
  cursor: pointer;
  font-weight: 900;
  font-size: 1.1rem;
}

.bottom-gold {
  background: linear-gradient(145deg, #42a5f5, #1565c0);
  color: #fff;
}

.bottom-menu {
  position: relative;
}

.bottom-menu--center {
  min-width: 48px;
}

.bottom-nav-tile--sq:active,
.bottom-nav-tile--round:active {
  transform: translateY(1px) scale(0.98);
  transition: transform 0.08s ease;
}

.bottom-shop:active {
  transform: none;
}

.menu-dot {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 9px;
  height: 9px;
  background: linear-gradient(180deg, #ffd86b, #f39c12);
  border-radius: 50%;
  border: 2px solid #fff3da;
  box-shadow: 0 0 0 1px rgba(101, 67, 33, 0.45);
  pointer-events: none;
  z-index: 2;
}

.bottom-alert {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #78909c;
  background: #37474f;
  color: #fff;
  font-weight: 900;
  font-size: 1.1rem;
  cursor: pointer;
}

.bottom-ad {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
}

.bottom-ad--wide {
  flex-direction: row;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  background: linear-gradient(180deg, #546e7a, #37474f);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 2px 0 #263238;
  text-align: left;
  min-height: 44px;
}

.ad-lines {
  display: flex;
  flex-direction: column;
  gap: 0;
  line-height: 1.15;
}

.ad-line1 {
  font-size: 0.58rem;
  font-weight: 800;
  color: #eceff1;
}

.ad-line2 {
  font-size: 0.72rem;
  font-weight: 900;
  color: #ffee58;
}

.ad-ico {
  font-size: 1.2rem;
}

.toast-msg {
  display: none;
  position: fixed;
  left: 50%;
  bottom: calc(132px + env(safe-area-inset-bottom, 0));
  transform: translateX(-50%);
  max-width: min(92vw, 340px);
  padding: 0;
  margin: 0;
  pointer-events: none;
  z-index: 10060;
  text-align: left;
  box-sizing: border-box;
}

.toast-msg.toast-msg--active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-msg__row {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 100%;
  padding: 10px 14px;
  border-radius: 16px;
  border: 2px solid rgba(201, 161, 94, 0.72);
  background: linear-gradient(180deg, rgba(252, 243, 216, 0.98) 0%, rgba(244, 228, 190, 0.96) 100%);
  box-shadow:
    0 8px 22px rgba(0, 0, 0, 0.18),
    0 0 0 2px rgba(255, 244, 210, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.toast-msg:not(.toast-msg--with-icon) .toast-msg__txt {
  display: block;
  max-width: 100%;
  padding: 10px 14px;
  border-radius: 16px;
  border: 2px solid rgba(201, 161, 94, 0.72);
  background: linear-gradient(180deg, rgba(252, 243, 216, 0.98) 0%, rgba(244, 228, 190, 0.96) 100%);
  box-shadow:
    0 8px 22px rgba(0, 0, 0, 0.18),
    0 0 0 2px rgba(255, 244, 210, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.toast-msg__ico {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(199, 159, 90, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.toast-msg__ico-wrap {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
}

.toast-msg__ico-wrap .biz-svg {
  width: 44px;
  height: 44px;
  display: block;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.35));
}

.toast-msg__txt {
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.35;
  color: #4b341e;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Overlays — класс перебивает [hidden], без этого оба окна «висят» поверх игры */
.overlay[hidden] {
  display: none !important;
  pointer-events: none !important;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 10050;
  display: grid;
  place-items: center;
  padding: 16px;
  pointer-events: auto;
}

/* Порядок окон: магазин поверх остальных */
#hubOverlay:not([hidden]) {
  z-index: 10050;
}

#treasuryOverlay:not([hidden]) {
  z-index: 10052;
}

#upgradesOverlay:not([hidden]) {
  z-index: 10054;
}

#managersOverlay:not([hidden]) {
  z-index: 10056;
}

#profileOverlay:not([hidden]) {
  z-index: 10058;
}

#leaderboardOverlay:not([hidden]) {
  z-index: 10059;
}

#prestigeConfirmOverlay:not([hidden]) {
  z-index: 10060;
}

.overlay--prestige-modal {
  background: rgba(6, 4, 12, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: prestigeModalFade 0.28s ease-out;
}

#onboardingOverlay:not([hidden]) {
  z-index: 10070;
}

.overlay--onboarding {
  background: rgba(35, 20, 10, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.onboarding-card {
  position: relative;
  width: min(100%, 560px);
  max-height: min(86vh, 760px);
  overflow-y: auto;
  border-radius: 22px;
  padding: 20px 16px 16px;
  background: linear-gradient(180deg, rgba(252, 243, 216, 0.99) 0%, rgba(244, 228, 190, 0.98) 100%);
  border: 2px solid rgba(201, 161, 94, 0.76);
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.34),
    0 0 0 2px rgba(255, 244, 210, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.onboarding-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(140, 93, 45, 0.45);
  background: rgba(255, 252, 245, 0.92);
  color: #5d4037;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.onboarding-title {
  margin: 0;
  padding-right: 38px;
  font-size: 1.4rem;
  font-weight: 900;
  line-height: 1.15;
  color: #4b341e;
}

.onboarding-subtitle {
  margin: 6px 0 12px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #6d4c41;
}

.onboarding-list {
  display: grid;
  gap: 8px;
}

.onboarding-item {
  border: 1.5px solid rgba(201, 161, 94, 0.45);
  border-radius: 14px;
  background: rgba(255, 252, 245, 0.9);
  padding: 10px 11px;
}

.onboarding-item__title {
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 900;
  color: #4b341e;
  line-height: 1.25;
}

.onboarding-item__text {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.34;
  color: #5d4037;
}

.onboarding-item__num {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  font-size: 0.73rem;
  font-weight: 900;
  color: #4b341e;
  border: 1px solid rgba(201, 161, 94, 0.72);
  background: linear-gradient(180deg, rgba(255, 247, 224, 0.96), rgba(246, 226, 181, 0.96));
}

@keyframes prestigeModalFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.prestige-modal {
  position: relative;
  width: min(100%, 400px);
  max-height: min(88vh, 640px);
  overflow-y: auto;
  padding: 22px 20px 18px;
  border-radius: 22px;
  text-align: center;
  font-family: "Fredoka", system-ui, sans-serif;
  color: #eceff1;
  background:
    radial-gradient(90% 55% at 50% -12%, rgba(171, 71, 188, 0.35) 0%, transparent 52%),
    linear-gradient(168deg, rgba(32, 24, 52, 0.98) 0%, rgba(14, 10, 26, 0.99) 55%, rgba(8, 6, 16, 1) 100%);
  border: 1.5px solid rgba(255, 213, 127, 0.35);
  box-shadow:
    0 24px 56px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  animation: prestigeModalPop 0.38s cubic-bezier(0.34, 1.45, 0.64, 1);
}

@keyframes prestigeModalPop {
  from {
    transform: scale(0.88) translateY(16px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.prestige-modal__rim {
  position: absolute;
  inset: 0;
  border-radius: 22px;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 183, 77, 0.12);
  background: linear-gradient(
    145deg,
    rgba(255, 213, 127, 0.06) 0%,
    transparent 42%,
    rgba(171, 71, 188, 0.08) 100%
  );
}

.prestige-modal__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.25);
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  z-index: 2;
  -webkit-tap-highlight-color: transparent;
}

.prestige-modal__close:active {
  transform: scale(0.96);
}

.prestige-modal__eyebrow {
  margin: 0 0 6px;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(255, 213, 127, 0.75);
}

.prestige-modal__title {
  margin: 0 0 14px;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: linear-gradient(180deg, #fffef7 0%, #ffca28 45%, #f57f17 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.45));
}

.prestige-modal__lead {
  margin: 0 0 4px;
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(236, 239, 241, 0.88);
}

.prestige-modal__gain {
  margin: 0;
  font-size: clamp(2rem, 8vw, 2.65rem);
  font-weight: 800;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  color: #fff8e1;
  text-shadow:
    0 2px 0 rgba(0, 0, 0, 0.5),
    0 0 28px rgba(255, 193, 7, 0.25);
}

.prestige-modal__gain-label {
  margin: 2px 0 12px;
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(255, 224, 178, 0.9);
}

.prestige-modal__desc {
  margin: 0 0 12px;
  font-size: 0.78rem;
  line-height: 1.45;
  color: rgba(176, 190, 197, 0.95);
}

.prestige-modal__list {
  margin: 0 0 12px;
  padding: 12px 14px;
  text-align: left;
  font-size: 0.72rem;
  line-height: 1.5;
  color: rgba(236, 239, 241, 0.92);
  background: rgba(0, 0, 0, 0.28);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  list-style: none;
}

.prestige-modal__list li {
  position: relative;
  padding-left: 0.85em;
  margin-bottom: 8px;
}

.prestige-modal__list li:last-child {
  margin-bottom: 0;
}

.prestige-modal__list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: rgba(255, 213, 127, 0.65);
  font-weight: 800;
}

.prestige-modal__list strong {
  color: #ffe082;
  font-weight: 800;
}

.prestige-modal__fine {
  margin: 0 0 16px;
  font-size: 0.65rem;
  line-height: 1.45;
  color: rgba(144, 164, 174, 0.95);
}

.prestige-modal__actions {
  display: flex;
  gap: 10px;
  justify-content: stretch;
}

.prestige-modal__btn {
  flex: 1 1 auto;
  min-height: 48px;
  padding: 10px 12px;
  border-radius: 14px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  border: none;
  -webkit-tap-highlight-color: transparent;
}

.prestige-modal__btn--ghost {
  background: rgba(255, 255, 255, 0.06);
  color: #eceff1;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.prestige-modal__btn--ghost:active {
  transform: scale(0.98);
}

.prestige-modal__btn--gold {
  background: linear-gradient(180deg, #ffe082 0%, #ffca28 42%, #f57f17 100%);
  color: #3e2723;
  border: 1px solid rgba(255, 248, 225, 0.45);
  box-shadow:
    0 4px 0 rgba(183, 28, 28, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.prestige-modal__btn--gold:active {
  transform: scale(0.98);
}

.overlay-panel {
  width: min(100%, 400px);
  max-height: min(85vh, 640px);
  background: #2c2f38;
  border-radius: 12px;
  border: 2px solid #555;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.overlay-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: #1e2128;
  border-bottom: 1px solid #444;
}

.overlay-head h2 {
  font-size: 1rem;
}

.overlay-close {
  border: none;
  background: transparent;
  color: #fff;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  min-width: 44px;
  min-height: 44px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.overlay-body {
  padding: 12px;
  overflow-y: auto;
}

.menu-section {
  margin-bottom: 16px;
}

.menu-section h3 {
  font-size: 0.85rem;
  color: #9e9e9e;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.menu-line {
  font-size: 0.88rem;
  margin-bottom: 6px;
}

.menu-line .muted {
  color: #9e9e9e;
  font-size: 0.85rem;
}

.leaderboard-panel {
  max-height: min(88vh, 680px);
}

.leaderboard-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.lb-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
}

.lb-tab {
  padding: 8px 4px;
  border: 1px solid #555;
  border-radius: 8px;
  background: #1e2128;
  color: #b0bec5;
  font-size: 0.65rem;
  font-weight: 800;
  cursor: pointer;
  font-family: var(--font-ui);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.lb-tab--active {
  background: linear-gradient(180deg, #5c6bc0, #3949ab);
  color: #fff;
  border-color: #7986cb;
}

.lb-hint {
  font-size: 0.72rem;
  color: #90a4ae;
  margin: 0;
  line-height: 1.35;
}

.lb-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  flex: 1;
  min-height: 120px;
  max-height: 42vh;
  padding-right: 2px;
}

.lb-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #1e2128;
  border-radius: 8px;
  font-size: 0.78rem;
}

.lb-row--player {
  outline: 2px solid #7e57c2;
  background: linear-gradient(90deg, #2a1f3d, #1e2128);
}

.lb-rank {
  font-weight: 800;
  color: #78909c;
  font-variant-numeric: tabular-nums;
}

.lb-row--player .lb-rank {
  color: #ce93d8;
}

.lb-name {
  font-weight: 700;
  color: #eceff1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-val {
  font-weight: 800;
  color: #ffb74d;
  font-variant-numeric: tabular-nums;
  font-size: 0.72rem;
}

.lb-footnote {
  font-size: 0.65rem;
  color: #78909c;
  margin: 0;
  line-height: 1.35;
}

.profile-lb-btn {
  margin-top: 10px;
}

.wallet-panel {
  max-height: min(88vh, 640px);
}

.wallet-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 0 12px;
  margin-top: 4px;
  border-bottom: 1px solid #444;
  background: #1e2128;
}

.wallet-tab {
  padding: 10px 8px;
  border: none;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: #90a4ae;
  font-size: 0.78rem;
  font-weight: 800;
  font-family: var(--font-ui);
  cursor: pointer;
  margin-bottom: -1px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.wallet-tab--active {
  color: #ffe082;
  border-bottom-color: #ffb300;
}

.wallet-body {
  padding-top: 10px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.wallet-section {
  background: rgba(23, 20, 30, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
}

.wallet-section:last-child {
  margin-bottom: 0;
}

.wallet-section-title {
  margin: 0 0 8px;
  font-size: 0.92rem;
  color: #ffe082;
}

.wallet-pane[hidden] {
  display: none !important;
}

.wallet-pane--active {
  display: block;
}

.wallet-topup-balance {
  font-size: 0.88rem;
  margin: 0 0 10px;
  color: #eceff1;
}

.wallet-topup-balance strong {
  color: #ffd54f;
}

.wallet-topup-lead {
  font-size: 0.8rem;
  line-height: 1.4;
  color: #b0bec5;
  margin: 0 0 12px;
}

.wallet-crypto-placeholder {
  text-align: center;
  padding: 16px 12px;
  margin-bottom: 12px;
  border-radius: 10px;
  border: 2px dashed rgba(255, 213, 79, 0.35);
  background: rgba(30, 33, 40, 0.9);
}

.wallet-crypto-ico {
  font-size: 1.75rem;
  display: block;
  margin-bottom: 8px;
}

.wallet-crypto-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: #fff8e1;
  margin: 0 0 8px;
}

.wallet-crypto-hint {
  font-size: 0.72rem;
  line-height: 1.45;
  color: #90a4ae;
  margin: 0;
}

.wallet-axiome-card {
  border-color: rgba(255, 213, 79, 0.28);
  background:
    radial-gradient(120% 80% at 12% 0%, rgba(255, 213, 79, 0.09) 0%, transparent 46%),
    linear-gradient(165deg, rgba(38, 32, 58, 0.96) 0%, rgba(18, 14, 28, 0.98) 100%);
}

.wallet-axiome-btn {
  margin-top: 6px;
}

.wallet-axiome-status {
  margin: 10px 0 0;
  font-size: 0.76rem;
  font-weight: 700;
  color: #90a4ae;
}

.wallet-axiome-status--waiting {
  color: #ffe082;
}

.wallet-axiome-status--connected {
  color: #81c784;
}

.wallet-axiome-code {
  margin-top: 10px;
  padding: 10px 10px 11px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.22);
}

.wallet-axiome-code__label {
  margin: 0 0 6px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #b0bec5;
}

.wallet-axiome-code__token {
  display: block;
  margin: 0;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  color: #fff8e1;
  word-break: break-all;
  background: rgba(30, 22, 55, 0.88);
  border: 1px solid rgba(255, 213, 79, 0.35);
}

.wallet-axiome-code__copy {
  margin-top: 8px;
  width: 100%;
  min-height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 213, 79, 0.38);
  background: linear-gradient(180deg, rgba(255, 213, 79, 0.22), rgba(255, 179, 0, 0.14));
  color: #fff8e1;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  cursor: pointer;
}

.wallet-axiome-code__copy:active {
  transform: translateY(1px);
}

.wallet-axiome-code__hint {
  margin: 8px 0 0;
  font-size: 0.66rem;
  line-height: 1.35;
  color: #90a4ae;
}

.wallet-connected-ui {
  border-color: rgba(129, 199, 132, 0.24);
}

.wallet-connected-head {
  margin: -2px 0 10px;
  display: flex;
  justify-content: flex-start;
}

.wallet-connected-address {
  margin: 0;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: #c8e6c9;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(129, 199, 132, 0.22);
  word-break: break-all;
}

.wallet-topup-form {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.wallet-topup-input {
  width: 100%;
  min-height: 42px;
  box-sizing: border-box;
  border-radius: 12px;
  border: 1px solid rgba(255, 213, 79, 0.35);
  background: rgba(0, 0, 0, 0.2);
  color: #fff8e1;
  padding: 0 12px;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.2;
  font-weight: 700;
}

/* Кошелек: скрыть нативные стрелки у number input (пополнение/вывод). */
body.tma-subpage.wallet-page .wallet-topup-input[type="number"],
.tma-inline-screen.tma-subpage.wallet-page .wallet-topup-input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

body.tma-subpage.wallet-page .wallet-topup-input[type="number"]::-webkit-outer-spin-button,
body.tma-subpage.wallet-page .wallet-topup-input[type="number"]::-webkit-inner-spin-button,
.tma-inline-screen.tma-subpage.wallet-page .wallet-topup-input[type="number"]::-webkit-outer-spin-button,
.tma-inline-screen.tma-subpage.wallet-page .wallet-topup-input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.wallet-topup-input::placeholder {
  color: #90a4ae;
}

.wallet-topup-submit {
  width: 100%;
}

.wallet-crypto-btn {
  margin-bottom: 8px;
  background: linear-gradient(180deg, #7e57c2, #5e35b1) !important;
  box-shadow: 0 2px 0 #311b92 !important;
}

.wallet-topup-foot {
  margin-bottom: 0;
}

.wallet-history-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 8px;
}

.wallet-history-tab {
  border: 1px solid #4e5a66;
  border-radius: 8px;
  background: #1b1f27;
  color: #9fb0bf;
  padding: 8px 6px;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-ui);
}

.wallet-history-tab--active {
  color: #fff8e1;
  border-color: #ffb300;
  background: linear-gradient(180deg, #5b3a8f, #3f2b63);
}

.wallet-history-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 72px;
}

.wallet-history-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  background: #161a20;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 8px 10px;
}

.wallet-history-title,
.wallet-history-meta,
.wallet-history-amount,
.wallet-history-empty {
  margin: 0;
}

.wallet-history-title {
  color: #eceff1;
  font-size: 0.75rem;
  font-weight: 700;
}

.wallet-history-meta {
  color: #90a4ae;
  font-size: 0.66rem;
  margin-top: 2px;
}

.wallet-history-amount {
  font-size: 0.75rem;
  font-weight: 800;
  white-space: nowrap;
}

.wallet-history-amount--incoming {
  color: #81c784;
}

.wallet-history-amount--outgoing {
  color: #ef9a9a;
}

.wallet-history-empty {
  color: #90a4ae;
  font-size: 0.72rem;
  padding: 8px 2px;
}

.menu-action {
  display: block;
  width: 100%;
  margin-bottom: 8px;
  padding: 10px;
  border: none;
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
  background: #455a64;
  color: #fff;
}

.menu-action.warn {
  background: linear-gradient(180deg, #ffb74d, #e65100);
}

.menu-action.danger {
  background: linear-gradient(180deg, #ef5350, #b71c1c);
}

.upgrade-list:not(.upgrade-list--screen) {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.manager-row {
  background: #1e2128;
  border-radius: 8px;
  padding: 10px;
  border: 1px solid #444;
}

.manager-row button {
  margin-top: 8px;
  padding: 8px 12px;
  border: none;
  border-radius: 6px;
  font-weight: 800;
  cursor: pointer;
  background: #4caf50;
  color: #fff;
}

.manager-row button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.up-meta {
  font-size: 0.78rem;
  color: #9e9e9e;
  margin-top: 4px;
}

/* --- Hub main menu (skewed buttons) --- */
.overlay--hub {
  place-items: center;
  align-content: center;
  padding: 24px 16px 80px;
}

.hub-stack {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  width: min(100%, 320px);
}

.hub-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px 12px 12px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(180deg, #fffef8 0%, #f0ebe4 100%);
  color: #263238;
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: 0.82rem;
  text-align: left;
  cursor: pointer;
  box-shadow:
    0 3px 0 rgba(0, 0, 0, 0.2),
    0 6px 14px rgba(0, 0, 0, 0.35);
  transform: skewY(-2deg);
  transition: transform 0.12s ease, filter 0.12s ease;
}

.hub-btn:hover {
  filter: brightness(1.03);
}

.hub-btn:active {
  transform: skewY(-2deg) scale(0.98);
}

.hub-btn--accent .hub-label {
  color: #e65100;
}

.hub-btn--locked {
  opacity: 0.55;
  cursor: not-allowed;
}

a.hub-btn--external {
  text-decoration: none;
}

.hub-dot {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #90a4ae;
  border: 2px solid #cfd8dc;
}

.hub-dot--accent {
  background: #ff9800;
  border-color: #ffe0b2;
}

.hub-label {
  flex: 1;
}

.hub-lock {
  font-size: 0.85rem;
  opacity: 0.9;
}

.hub-close-x {
  margin-top: 16px;
  align-self: center;
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff 0%, #e0e0e0 100%);
  color: #424242;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.25);
}

.hub-close-x:active {
  transform: scale(0.96);
}

.real-life-shell {
  background:
    repeating-linear-gradient(
      90deg,
      rgba(0, 0, 0, 0.02) 0,
      rgba(0, 0, 0, 0.02) 1px,
      transparent 1px,
      transparent 14px
    ),
    linear-gradient(180deg, #f8f5ef 0%, #eee7db 100%);
}

.real-life-banner {
  background: linear-gradient(180deg, #ffcc80, #ffb74d);
  border-color: #ef6c00;
  box-shadow: 0 3px 0 #bf360c;
}

.real-life-intro .managers-intro-lead {
  color: #6d4c41;
}

.real-life-item {
  border-color: rgba(121, 85, 72, 0.24);
}

.real-life-item .manager-avatar {
  background: linear-gradient(180deg, #fff3e0, #ffe0b2);
  border-color: #ffb74d;
}

.real-life-item .manager-manages {
  color: #6d4c41;
}

.real-life-tag {
  display: inline-flex;
  align-items: center;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #3e2723;
  background: linear-gradient(180deg, #fff8e1, #ffe082);
  border: 1px solid rgba(141, 110, 99, 0.35);
}

.items-shell {
  background:
    repeating-linear-gradient(
      90deg,
      rgba(0, 0, 0, 0.02) 0,
      rgba(0, 0, 0, 0.02) 1px,
      transparent 1px,
      transparent 14px
    ),
    linear-gradient(180deg, #f2f5f8 0%, #e5ebf2 100%);
}

.items-banner {
  background: linear-gradient(180deg, #b3e5fc, #81d4fa);
  border-color: #0277bd;
  box-shadow: 0 3px 0 #01579b;
}

.real-life-shell,
.items-shell {
  background:
    radial-gradient(120% 80% at 50% -20%, rgba(171, 71, 188, 0.26) 0%, transparent 56%),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.015) 0,
      rgba(255, 255, 255, 0.015) 1px,
      transparent 1px,
      transparent 14px
    ),
    linear-gradient(186deg, #140a21 0%, #0a0616 58%, #05030d 100%);
}

.real-life-banner,
.items-banner {
  background: linear-gradient(180deg, rgba(255, 236, 179, 0.22), rgba(255, 193, 7, 0.12));
  border-color: rgba(255, 213, 79, 0.48);
  box-shadow:
    0 4px 0 rgba(0, 0, 0, 0.35),
    0 0 22px rgba(255, 193, 7, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.real-life-intro .managers-intro-lead {
  color: #ffe082;
}

.real-life-item {
  border-color: rgba(255, 213, 127, 0.24);
}

.real-life-item .manager-avatar {
  background: linear-gradient(145deg, rgba(255, 248, 225, 0.95), rgba(255, 213, 79, 0.65));
  border-color: rgba(255, 213, 79, 0.52);
}

.real-life-item .manager-manages {
  color: #90a4ae;
}

.real-life-tag {
  display: inline-flex;
  align-items: center;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #1b0e2e;
  background: linear-gradient(180deg, #ffe082, #ffb300);
  border: 1px solid rgba(62, 39, 35, 0.35);
}

/* --- Managers full screen --- */
.overlay--managers {
  place-items: stretch;
  padding: 0;
  background: rgba(8, 5, 15, 0.74);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.managers-shell {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  min-height: 100%;
  min-height: 100dvh;
  background:
    radial-gradient(120% 80% at 50% -20%, rgba(171, 71, 188, 0.26) 0%, transparent 56%),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.015) 0,
      rgba(255, 255, 255, 0.015) 1px,
      transparent 1px,
      transparent 14px
    ),
    linear-gradient(186deg, #140a21 0%, #0a0616 58%, #05030d 100%);
  color: #eceff1;
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.managers-top {
  position: relative;
  padding: calc(10px + env(safe-area-inset-top, 0)) 12px 8px;
}

.managers-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 40px 10px 16px;
  margin: 0 4px;
  background: linear-gradient(180deg, rgba(255, 236, 179, 0.22), rgba(255, 193, 7, 0.12));
  border-radius: 8px;
  border: 2px solid rgba(255, 213, 79, 0.48);
  box-shadow:
    0 4px 0 rgba(0, 0, 0, 0.35),
    0 0 22px rgba(255, 193, 7, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.managers-title {
  font-size: 1.35rem;
  font-weight: 800;
  background: linear-gradient(180deg, #fffef7 0%, #ffca28 48%, #f57f17 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
  letter-spacing: 0.02em;
}

.managers-spark {
  color: #ffb300;
  font-size: 0.9rem;
}

.managers-close-pill {
  position: absolute;
  top: calc(8px + env(safe-area-inset-top, 0));
  right: 10px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.06));
  color: #eceff1;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.34);
}

.managers-tabs {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 10px 12px 6px;
}

.mgr-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: #b0bec5;
  font-weight: 800;
  font-size: 0.78rem;
  cursor: pointer;
}

.mgr-tab--active {
  border-color: rgba(255, 213, 79, 0.52);
  background: linear-gradient(180deg, rgba(255, 213, 79, 0.26), rgba(255, 179, 0, 0.16));
  color: #fff8e1;
}

.mgr-tab:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.managers-balance-line {
  text-align: center;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff8e1;
  padding: 4px 12px 8px;
}

.managers-intro {
  padding: 0 16px 12px;
}

.managers-intro-lead {
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffe082;
  margin-bottom: 6px;
}

.managers-intro-lead--upgrades {
  color: #ffca28;
}

.managers-banner--upgrades {
  background: linear-gradient(180deg, rgba(255, 183, 77, 0.25), rgba(255, 152, 0, 0.16));
  border-color: rgba(255, 111, 0, 0.58);
  box-shadow:
    0 4px 0 rgba(0, 0, 0, 0.35),
    0 0 20px rgba(255, 152, 0, 0.15);
}

.managers-banner--upgrades .managers-spark {
  color: #ff8f00;
}

.managers-banner--profile {
  background: linear-gradient(180deg, #ba68c8, #7b1fa2);
  border-color: #4a148c;
  box-shadow: 0 3px 0 #311b92;
}

.managers-banner--profile .managers-spark {
  color: #4a148c;
}

.profile-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px 8px;
  margin: 0 12px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e1bee7;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.06);
}

.profile-avatar-big {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(145deg, #e1bee7, #ce93d8);
  display: grid;
  place-items: center;
  font-size: 2rem;
  flex-shrink: 0;
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(74, 20, 140, 0.25);
}

.profile-hero-text {
  min-width: 0;
}

.profile-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: #4a148c;
  margin-bottom: 4px;
}

.profile-level-badge {
  font-size: 0.85rem;
  font-weight: 700;
  color: #6a1b9a;
}

.profile-level-badge strong {
  font-size: 1.1rem;
  color: #311b92;
}

.profile-scroll {
  padding: 8px 12px 20px;
}

.profile-card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #cfd8dc;
  padding: 12px 14px;
  margin-bottom: 10px;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.05);
}

.profile-card-title {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #7b1fa2;
  margin-bottom: 10px;
}

.profile-stat-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.profile-stat-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: 0.8rem;
  color: #546e7a;
  padding: 6px 0;
  border-bottom: 1px solid #eceff1;
}

.profile-stat-list li:last-child {
  border-bottom: none;
}

.profile-stat-list strong {
  font-size: 0.82rem;
  color: #263238;
  text-align: right;
  word-break: break-word;
}

.profile-card--prestige .profile-prestige-line {
  font-size: 0.88rem;
  color: #37474f;
  margin-bottom: 6px;
}

.profile-card-hint {
  font-size: 0.72rem;
  color: #78909c;
  line-height: 1.35;
  margin-bottom: 10px;
}

.profile-muted {
  color: #90a4ae;
  font-size: 0.85rem;
}

.profile-btn {
  display: block;
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 8px;
  border: none;
  border-radius: 8px;
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: 0.82rem;
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.12);
}

.profile-btn:last-child {
  margin-bottom: 0;
}

.profile-btn--save {
  background: linear-gradient(180deg, #78909c, #546e7a);
  color: #fff;
}

.profile-btn--prestige {
  background: linear-gradient(180deg, #ffb74d, #ef6c00);
  color: #3e2723;
}

.profile-btn--prestige:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.25);
}

.profile-prestige-meta {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
}

.profile-prestige-meta li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.76rem;
  color: #546e7a;
  padding: 5px 0;
  border-bottom: 1px solid #eceff1;
}

.profile-prestige-meta li:last-child {
  border-bottom: none;
}

.profile-prestige-meta strong {
  color: #6a1b9a;
  font-size: 0.8rem;
}

.profile-btn--danger {
  background: linear-gradient(180deg, #ef5350, #c62828);
  color: #fff;
}

.profile-btn--ghost {
  background: #eceff1;
  color: #546e7a;
  box-shadow: none;
  border: 1px solid #cfd8dc;
}

.profile-card--referral .profile-ref-text {
  font-size: 0.78rem;
  line-height: 1.4;
  color: #455a64;
  margin-bottom: 10px;
}

.profile-ref-box {
  font-size: 0.72rem;
  color: #78909c;
  background: #f5f5f5;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
  word-break: break-all;
  border: 1px dashed #bdbdbd;
}

.menu-line--hint {
  font-size: 0.75rem;
  color: #9e9e9e;
  margin-top: 8px;
}

.upgrade-list--screen {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.upgrade-screen-card .manager-name {
  color: #e65100;
}

.managers-intro-text {
  font-size: 0.78rem;
  line-height: 1.35;
  color: #b0bec5;
}

.managers-list-wrap {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.managers-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.managers-angel-placeholder {
  padding: 24px 16px;
  text-align: center;
  font-size: 0.85rem;
  color: #90a4ae;
}

.manager-card {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  background: linear-gradient(168deg, rgba(35, 29, 52, 0.96) 0%, rgba(16, 12, 28, 0.98) 100%);
  border-radius: 10px;
  border: 1px solid rgba(255, 213, 127, 0.24);
  box-shadow:
    0 2px 0 rgba(0, 0, 0, 0.28),
    0 0 16px rgba(171, 71, 188, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.manager-card--hired {
  opacity: 0.95;
  border-color: rgba(129, 199, 132, 0.34);
}

.manager-avatar {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(255, 248, 225, 0.95), rgba(255, 213, 79, 0.65));
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  border: 2px solid rgba(255, 213, 79, 0.52);
}

.manager-avatar--img {
  padding: 0;
  overflow: hidden;
}

.manager-avatar--img .biz-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.real-life-avatar-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.manager-info {
  min-width: 0;
}

.manager-name {
  font-size: 0.88rem;
  font-weight: 800;
  color: #fff8e1;
  line-height: 1.2;
}

.manager-manages {
  font-size: 0.72rem;
  color: #90a4ae;
  margin-top: 2px;
}

.manager-cost {
  font-size: 0.78rem;
  font-weight: 800;
  color: #ffecb3;
  margin-top: 4px;
}

.manager-hire-btn {
  padding: 8px 12px;
  border: 1px solid rgba(255, 213, 79, 0.4);
  border-radius: 6px;
  font-weight: 800;
  font-size: 0.72rem;
  cursor: pointer;
  background: linear-gradient(180deg, rgba(255, 213, 79, 0.22), rgba(255, 179, 0, 0.12));
  color: #fff8e1;
  white-space: nowrap;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.42);
}

.manager-hire-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.manager-hire-btn--done {
  background: linear-gradient(180deg, rgba(129, 199, 132, 0.32), rgba(102, 187, 106, 0.2));
  border-color: rgba(129, 199, 132, 0.42);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.34);
}

/* Standalone wallet page */
.wallet-page {
  min-height: 100vh;
}

/* Кошелёк: два отдельных «окна» (рамка + фон), не только перекраска tma-card */
.tma-stack--wallet {
  gap: 18px;
}

.wallet-page .wallet-window.tma-card {
  padding: 16px 16px 18px;
  border-radius: 26px;
  border-width: 3px;
  border-style: solid;
  border-color: #1f140c;
  box-shadow:
    0 8px 0 rgba(15, 10, 6, 0.35),
    0 12px 28px rgba(0, 0, 0, 0.28),
    inset 0 2px 0 rgba(255, 255, 255, 0.35);
  overflow: hidden;
}

.wallet-page .wallet-window.tma-card::before {
  opacity: 0.55;
}

/* Подключённый кошелёк: вертикальная структура (адрес → заголовок → баланс → пополнить → вывод) */
.wallet-page .wallet-window--balance {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.wallet-connected-stack {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.wallet-address-pill-wrap {
  text-align: center;
}

.wallet-address-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.wallet-page .wallet-address-pill.wallet-connected-address {
  display: inline-block;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0 auto;
  padding: 10px 16px;
  border-radius: 999px;
  text-align: center;
  line-height: 1.4;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.wallet-disconnect-btn {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 2px solid rgba(143, 83, 18, 0.75);
  background: linear-gradient(180deg, #fff8dc 0%, #ffe082 100%);
  color: #4e342e;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(143, 83, 18, 0.45);
}

.wallet-disconnect-btn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 rgba(143, 83, 18, 0.45);
}

.wallet-balance-title {
  margin: 0;
  text-align: center;
  font-size: clamp(1rem, 4vw, 1.28rem);
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #3e2723;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
}

.wallet-balance-caption {
  margin: -4px 0 0;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 700;
  color: #4e342e;
  line-height: 1.35;
}

.wallet-balance-caption strong {
  color: #b45309;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.wallet-block {
  border-radius: 18px;
  padding: 14px 14px 16px;
  background: rgba(255, 252, 245, 0.93);
  border: 2px solid rgba(31, 20, 12, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    0 2px 0 rgba(31, 20, 12, 0.08);
}

.wallet-block__heading {
  margin: 0 0 8px;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #5d4037;
}

.wallet-block__hint {
  margin: 0 0 12px !important;
}

.wallet-block .wallet-topup-form {
  margin-top: 0;
}

.wallet-block--withdraw .wallet-withdraw-field {
  margin-bottom: 10px;
}

.wallet-withdraw-submit {
  width: 100%;
  margin-top: 2px;
}

body.tma-subpage.wallet-page .wallet-window--balance,
body.tma-subpage.wallet-page .wallet-window--connect,
.tma-inline-screen.tma-subpage.wallet-page .wallet-window--balance,
.tma-inline-screen.tma-subpage.wallet-page .wallet-window--connect {
  background:
    linear-gradient(180deg, rgba(120, 55, 18, 0.22) 0%, transparent 28%),
    linear-gradient(180deg, #fff3c8 0%, #ffc85c 42%, #e8892a 78%, #c96218 100%);
}

body.tma-subpage.wallet-page .wallet-window--balance::after,
body.tma-subpage.wallet-page .wallet-window--connect::after,
.tma-inline-screen.tma-subpage.wallet-page .wallet-window--balance::after,
.tma-inline-screen.tma-subpage.wallet-page .wallet-window--connect::after {
  content: "";
  position: absolute;
  z-index: 0;
  left: 0;
  right: 0;
  bottom: 0;
  height: 38%;
  pointer-events: none;
  background:
    radial-gradient(ellipse 120% 90% at 18% 100%, rgba(101, 48, 12, 0.55) 0%, transparent 55%),
    radial-gradient(ellipse 100% 80% at 72% 100%, rgba(80, 40, 10, 0.45) 0%, transparent 50%),
    linear-gradient(180deg, transparent 0%, rgba(120, 52, 14, 0.35) 100%);
  mix-blend-mode: multiply;
  opacity: 0.85;
}

body.tma-subpage.wallet-page .wallet-window--operations,
.tma-inline-screen.tma-subpage.wallet-page .wallet-window--operations {
  background: linear-gradient(180deg, #fff9ee 0%, #f2e4c4 55%, #e5d3a8 100%);
  min-height: 200px;
}

body.tma-subpage.wallet-page .wallet-window--operations.tma-card::before,
.tma-inline-screen.tma-subpage.wallet-page .wallet-window--operations.tma-card::before {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.5) 0%, transparent 42%);
  opacity: 1;
}

.wallet-window-eyebrow {
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #4e2f18;
}

.wallet-balance-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin: 0 0 12px;
}

.wallet-balance-oval {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  min-height: 52px;
  padding: 6px 18px;
  border-radius: 999px;
  background: #fffdf8;
  border: 2px solid #1f140c;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.85),
    0 3px 0 rgba(31, 20, 12, 0.35);
}

.wallet-balance-oval strong {
  font-size: clamp(1.35rem, 5vw, 1.75rem);
  font-weight: 900;
  color: #3a2412;
  font-variant-numeric: tabular-nums;
}

.wallet-balance-unit {
  font-size: clamp(1.1rem, 4vw, 1.45rem);
  font-weight: 900;
  letter-spacing: 0.06em;
  color: #3a2412;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}

.wallet-window-subtitle {
  margin: 0 0 10px;
  font-size: 0.88rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #3f2614;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

.wallet-window-title {
  margin: 0 0 14px;
  font-size: clamp(1.05rem, 4vw, 1.25rem);
  font-weight: 900;
  letter-spacing: 0.12em;
  text-align: center;
  color: #fff;
  text-shadow:
    -1.5px -1.5px 0 #1a1208,
    1.5px -1.5px 0 #1a1208,
    -1.5px 1.5px 0 #1a1208,
    1.5px 1.5px 0 #1a1208,
    0 3px 6px rgba(0, 0, 0, 0.35);
}

.wallet-actions-dual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 4px 0 14px;
}

.wallet-action-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 10px;
  border-radius: 999px;
  border: 2px solid #1f140c;
  background: linear-gradient(180deg, #fff8dc 0%, #ffe082 100%);
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: #3a2412;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(31, 20, 12, 0.35);
}

.wallet-action-pill:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 rgba(31, 20, 12, 0.35);
}

.wallet-action-pill__ico {
  font-size: 0.95rem;
  line-height: 1;
}

.wallet-page .wallet-window--operations .tma-pill-tabs {
  margin-bottom: 12px;
}

.wallet-page .wallet-window--operations .tma-lb-list {
  max-height: min(48vh, 380px);
}

.wallet-page .wallet-window--operations .tma-empty {
  padding: 28px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #5d4037;
}

.wallet-page .wallet-window--operations .tma-tx-row {
  background: rgba(255, 252, 245, 0.95);
  border: 2px solid rgba(180, 140, 70, 0.45);
  box-shadow: 0 2px 0 rgba(62, 39, 35, 0.08);
}

.wallet-page .wallet-window--operations .tma-tx-title {
  color: #3e2723;
}

.wallet-page .wallet-window--operations .tma-tx-meta {
  color: #6d4c41;
}

.wallet-page .wallet-window--operations .tma-tx-amt-in {
  color: #1b5e20;
  text-shadow: none;
}

.wallet-page .wallet-window--operations .tma-tx-amt-out {
  color: #bf360c;
  text-shadow: none;
}

/* Axiome: свой градиент поверх общего connect — выше специфичность, чем у .wallet-window--connect */
body.tma-subpage.wallet-page .wallet-window--connect.wallet-axiome-card,
.tma-inline-screen.tma-subpage.wallet-page .wallet-window--connect.wallet-axiome-card {
  background:
    linear-gradient(180deg, rgba(120, 55, 18, 0.18) 0%, transparent 26%),
    linear-gradient(180deg, #fff0c2 0%, #ffcc66 48%, #e07020 100%);
}

.wallet-page .wallet-window--connect .tma-hint {
  color: rgba(55, 35, 18, 0.92);
}

.wallet-page .wallet-window--connect .wallet-axiome-status {
  color: #4e342e;
}

.wallet-page .wallet-window--connect .wallet-axiome-status--waiting {
  color: #b45309;
}

.wallet-page .wallet-window--connect .wallet-axiome-status--connected {
  color: #1b5e20;
}

.wallet-page .wallet-window--connect .wallet-axiome-code {
  background: rgba(255, 252, 245, 0.92);
  border: 2px solid rgba(140, 100, 45, 0.45);
}

.wallet-page .wallet-window--connect .wallet-axiome-code__label {
  color: #5d4037;
}

.wallet-page .wallet-window--connect .wallet-axiome-code__token {
  color: #2d1b0e;
  background: #fffdf8;
  border-color: rgba(180, 140, 70, 0.5);
}

.wallet-page .wallet-window--connect .wallet-axiome-code__hint {
  color: #6d4c41;
}

.wallet-page .wallet-window--connect .wallet-axiome-code__copy {
  color: #3f2410;
  background: linear-gradient(180deg, #fff4bc 0%, #ffd66f 52%, #eab54c 100%);
  border: 2px solid #8f5312;
}

/* Wallet tx signing overlay (Axiome confirm) */
.wallet-tx-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(62, 39, 35, 0.36);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.wallet-tx-overlay[hidden] {
  display: none !important;
  pointer-events: none !important;
}

.wallet-tx-dialog {
  position: relative;
  width: min(100%, 340px);
  border-radius: 20px;
  border: 3px solid #2f1a0d;
  background: linear-gradient(180deg, rgba(249, 238, 210, 0.98) 0%, rgba(240, 224, 188, 0.96) 100%);
  box-shadow:
    0 8px 0 rgba(47, 26, 13, 0.35),
    0 16px 28px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.68);
  padding: 18px 16px 16px;
  text-align: center;
}

.wallet-tx-close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(143, 83, 18, 0.55);
  background: rgba(255, 255, 255, 0.75);
  color: #5d4037;
  font-size: 1.05rem;
  line-height: 1;
  font-weight: 800;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.wallet-tx-close:active {
  transform: translateY(1px);
}

.wallet-tx-spinner {
  width: 34px;
  height: 34px;
  margin: 0 auto 10px;
  border-radius: 50%;
  border: 4px solid rgba(143, 83, 18, 0.25);
  border-top-color: #d97706;
  animation: walletSpin 0.9s linear infinite;
}

.wallet-tx-text {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 800;
  color: #4e342e;
  line-height: 1.35;
}

@keyframes walletSpin {
  to { transform: rotate(360deg); }
}

.wallet-standalone {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px 12px calc(20px + env(safe-area-inset-bottom, 0));
  position: relative;
  z-index: 2;
}

.wallet-panel--standalone {
  width: min(100%, 440px);
  max-height: min(90vh, 700px);
}

.wallet-back-link {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 1.35rem;
  font-weight: 800;
  color: #eceff1;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.wallet-page-msg {
  position: fixed;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom, 0));
  transform: translateX(-50%);
  margin: 0;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(20, 18, 26, 0.92);
  color: #ffe082;
  border: 1px solid rgba(255, 202, 40, 0.35);
  font-size: 0.76rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 20;
}

.wallet-page-msg--show {
  opacity: 1;
}


/* === Подстраницы AGH (было pages.css; встроено для Telegram WebView — один CSS) === */
:root {
  /* Тот же HUD, что и у профиля / основного экрана */
  --tma-page-bg: radial-gradient(ellipse 100% 72% at 50% -18%, rgba(171, 71, 188, 0.44) 0%, transparent 52%),
    radial-gradient(ellipse 95% 58% at 0% 100%, rgba(255, 152, 0, 0.18) 0%, transparent 48%),
    radial-gradient(ellipse 85% 52% at 100% 96%, rgba(79, 195, 247, 0.12) 0%, transparent 46%),
    linear-gradient(188deg, #150a24 0%, #070510 52%, #020108 100%);
  --tma-gold: #ffe082;
  --tma-gold-hot: #ffca28;
  --tma-magenta: #e040fb;
  --tma-card-bg: linear-gradient(165deg, rgba(38, 32, 58, 0.96) 0%, rgba(18, 14, 28, 0.98) 100%);
  --tma-card-border: rgba(255, 213, 127, 0.28);
  --tma-card-shadow: 0 12px 40px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  --tma-text-muted: #90a4ae;
  --tma-font-display: "Fredoka", system-ui, sans-serif;
}

.tma-subpage {
  min-height: 100vh;
  background: var(--tma-page-bg);
  color: #eceff1;
  font-family: var(--tma-font-display);
}

.tma-subpage .ambient {
  opacity: 0.85;
}

.tma-shell {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(12px + env(safe-area-inset-top, 0)) 12px calc(20px + env(safe-area-inset-bottom, 0));
  box-sizing: border-box;
}

/* Нижняя навигация (как в index) на отдельных HTML-страницах */
body.tma-subpage.tma-subpage--bottom-nav {
  position: relative;
}

body.tma-subpage.tma-subpage--bottom-nav .tma-shell {
  padding-bottom: calc(102px + env(safe-area-inset-bottom, 0));
}

/* На магазине и профиле нужен доп. скролл-запас под плавающий навбар */
body.tma-subpage.shop-page.tma-subpage--bottom-nav .tma-shell,
body.tma-subpage.wallet-page.tma-subpage--bottom-nav .tma-shell,
body.tma-subpage.tma-page-profile.tma-subpage--bottom-nav .tma-shell,
body.tma-subpage.tma-ref-page.tma-subpage--bottom-nav .tma-shell {
  padding-bottom: calc(176px + env(safe-area-inset-bottom, 0));
}

body.tma-subpage.shop-page.tma-subpage--bottom-nav .tma-stack,
body.tma-subpage.wallet-page.tma-subpage--bottom-nav .tma-stack,
body.tma-subpage.tma-page-profile.tma-subpage--bottom-nav .tma-stack,
body.tma-subpage.tma-ref-page.tma-subpage--bottom-nav .tma-stack {
  padding-bottom: 26px;
}

/* Те же отступы для встроенных экранов внутри index.html */
.tma-inline-screen.tma-subpage.shop-page .tma-shell,
.tma-inline-screen.tma-subpage.wallet-page .tma-shell,
.tma-inline-screen.tma-subpage.tma-page-profile .tma-shell,
.tma-inline-screen.tma-subpage.tma-ref-page .tma-shell {
  padding-bottom: calc(176px + env(safe-area-inset-bottom, 0));
}

.tma-inline-screen.tma-subpage.shop-page .tma-stack,
.tma-inline-screen.tma-subpage.wallet-page .tma-stack,
.tma-inline-screen.tma-subpage.tma-page-profile .tma-stack,
.tma-inline-screen.tma-subpage.tma-ref-page .tma-stack {
  padding-bottom: 26px;
}

body.tma-subpage.tma-subpage--bottom-nav .bottom-bar--glass {
  z-index: 10018;
}

body.tma-subpage .bottom-nav-item[aria-current="page"] .bottom-nav-caption {
  color: #b45309;
}

body.tma-subpage .bottom-bar--glass .bottom-nav-item[aria-current="page"] .bottom-nav-caption {
  color: #fffde7;
  text-shadow:
    0 0 12px rgba(255, 213, 79, 0.85),
    0 1px 2px rgba(0, 0, 0, 0.5);
}

.tma-topbar {
  width: min(100%, 480px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.tma-back {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  text-decoration: none;
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff8e1;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(0, 0, 0, 0.25));
  border: 1px solid rgba(255, 213, 127, 0.35);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.tma-back:active {
  transform: scale(0.97);
}

.tma-title-block {
  flex: 1;
  text-align: center;
  min-width: 0;
}

.tma-eyebrow {
  margin: 0 0 4px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 224, 130, 0.75);
  text-shadow: 0 0 12px rgba(255, 193, 7, 0.35);
}

.tma-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: linear-gradient(180deg, #fffde7 0%, var(--tma-gold-hot) 55%, #ff6f00 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 8px rgba(255, 152, 0, 0.35));
}

.tma-spacer {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.tma-stack {
  width: min(100%, 480px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Пул наград — золото, жирно */
.tma-season-treasury {
  --treasury-gold-mid: #ffc107;
  position: relative;
  width: min(100%, 480px);
  margin: 0 auto 4px;
  padding: 18px 16px 14px;
  text-align: center;
  border-radius: 18px;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 50% -20%, rgba(255, 213, 79, 0.14) 0%, transparent 55%),
    linear-gradient(168deg, rgba(42, 32, 58, 0.97) 0%, rgba(18, 12, 28, 0.99) 48%, rgba(12, 8, 18, 1) 100%);
  border: 1px solid rgba(255, 213, 127, 0.35);
  box-shadow:
    0 10px 32px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 0 1px rgba(0, 0, 0, 0.35);
}

.tma-season-treasury::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 0%,
    rgba(255, 213, 127, 0.06) 42%,
    transparent 46%
  );
  pointer-events: none;
}

.tma-season-treasury__title {
  position: relative;
  margin: 0 0 14px;
  font-family: var(--tma-font-display, "Fredoka", system-ui, sans-serif);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  line-height: 1.3;
  color: rgba(255, 224, 178, 0.88);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}

.tma-season-treasury__code {
  position: relative;
  margin: 0 0 8px;
  font-family: var(--tma-font-display, "Fredoka", system-ui, sans-serif);
  font-size: clamp(1.28rem, 4.8vw, 1.72rem);
  font-weight: 800;
  letter-spacing: 0.22em;
  line-height: 1.1;
  text-indent: 0.22em;
  background: linear-gradient(185deg, #fffef7 0%, var(--treasury-gold-mid) 38%, #f57f17 88%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.65));
}

.tma-season-treasury__amount {
  position: relative;
  margin: 0;
  font-family: var(--tma-font-display, "Fredoka", system-ui, sans-serif);
  font-size: clamp(1.05rem, 3.8vw, 1.38rem);
  font-weight: 800;
  letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
  color: #fff8e1;
  text-shadow:
    0 1px 0 rgba(0, 0, 0, 0.85),
    0 0 20px rgba(255, 193, 7, 0.22);
}

.tma-season-treasury__currency {
  font-weight: 800;
  font-size: 0.92em;
  letter-spacing: 0.06em;
  color: rgba(255, 236, 179, 0.95);
  opacity: 0.95;
}

.tma-season-treasury__teaser-wrap {
  position: relative;
  margin: 4px auto 0;
  max-width: 100%;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.tma-season-treasury__teaser-wrap::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -5px;
  transform: translateX(-50%);
  width: min(72%, 12rem);
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 213, 127, 0.5) 50%,
    transparent 100%
  );
  pointer-events: none;
}

/* Вторая строка пула — те же начертания, что у суммы $GAME выше */
.tma-season-treasury__teaser-line {
  margin: 0;
}

/* Скрытый текст в стиле Telegram: золотой шум без «оконной» рамки */
.tma-season-treasury__spoiler {
  display: inline-block;
  vertical-align: middle;
  width: clamp(4.5rem, 19vw, 5.85rem);
  height: 1.22em;
  min-height: 1.22rem;
  position: relative;
  top: 0.04em;
  margin-right: 0.35em;
  border-radius: 999px;
  overflow: hidden;
  background: linear-gradient(180deg, #ffd67b 0%, #ffac2e 45%, #e86b00 100%);
  box-shadow: none;
}

.tma-season-treasury__spoiler::before,
.tma-season-treasury__spoiler::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-repeat: repeat;
  border-radius: inherit;
}

.tma-season-treasury__spoiler::before {
  z-index: 1;
  background-image: radial-gradient(
    circle at 50% 50%,
    rgba(255, 252, 242, 0.96) 0.55px,
    transparent 0.9px
  );
  background-size: 2px 2px;
  animation: tma-spoiler-tg-a 1.15s linear infinite;
  will-change: opacity, background-position;
}

.tma-season-treasury__spoiler::after {
  z-index: 3;
  background-image: radial-gradient(
    circle at 50% 50%,
    rgba(255, 245, 220, 0.92) 0.45px,
    transparent 0.8px
  );
  background-size: 2px 2px;
  background-position: 1px 1px;
  animation: tma-spoiler-tg-b 0.96s linear infinite;
  will-change: opacity, background-position;
}

.tma-season-treasury__spoiler-spark {
  z-index: 2;
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background-image: radial-gradient(
    circle at 50% 50%,
    rgba(255, 248, 232, 0.9) 0.4px,
    transparent 0.7px
  );
  background-size: 2px 2px;
  background-position: 0.5px 0.5px;
  animation: tma-spoiler-tg-c 1.32s linear infinite;
  will-change: opacity, background-position;
}

@keyframes tma-spoiler-tg-a {
  0% {
    opacity: 0.18;
    background-position: 0 0;
  }
  17% {
    opacity: 0.78;
    background-position: 0.8px 0.3px;
  }
  29% {
    opacity: 0.24;
    background-position: 1.4px 0.9px;
  }
  43% {
    opacity: 0.86;
    background-position: 0.5px 1.5px;
  }
  57% {
    opacity: 0.2;
    background-position: 1.2px 0.2px;
  }
  73% {
    opacity: 0.82;
    background-position: 0.1px 1px;
  }
  88% {
    opacity: 0.28;
    background-position: 1px 1.4px;
  }
  100% {
    opacity: 0.68;
    background-position: 0 0.6px;
  }
}

@keyframes tma-spoiler-tg-b {
  0% {
    opacity: 0.52;
    background-position: 1px 1px;
  }
  16% {
    opacity: 0.16;
    background-position: 0.2px 1.5px;
  }
  31% {
    opacity: 0.82;
    background-position: 1.5px 0.4px;
  }
  48% {
    opacity: 0.24;
    background-position: 0.7px 1.1px;
  }
  64% {
    opacity: 0.74;
    background-position: 1.4px 1.6px;
  }
  79% {
    opacity: 0.18;
    background-position: 0.1px 0.5px;
  }
  100% {
    opacity: 0.62;
    background-position: 1px 1px;
  }
}

@keyframes tma-spoiler-tg-c {
  0% {
    opacity: 0.22;
    background-position: 0.5px 0.5px;
  }
  13% {
    opacity: 0.74;
    background-position: 1.2px 0.6px;
  }
  27% {
    opacity: 0.18;
    background-position: 0.3px 1.4px;
  }
  43% {
    opacity: 0.82;
    background-position: 1.4px 1px;
  }
  61% {
    opacity: 0.2;
    background-position: 0.6px 0.2px;
  }
  78% {
    opacity: 0.72;
    background-position: 1.3px 1.5px;
  }
  100% {
    opacity: 0.26;
    background-position: 0.5px 0.5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tma-season-treasury__spoiler::before,
  .tma-season-treasury__spoiler::after,
  .tma-season-treasury__spoiler-spark {
    animation: none;
    opacity: 0.72;
  }
}

body.tma-subpage .tma-season-treasury__spoiler,
.tma-inline-screen.tma-subpage .tma-season-treasury__spoiler {
  box-shadow: none;
}

/* Страница сезона — таймер + крупный лидерборд */
.tma-season-page .tma-season-hero {
  text-align: center;
  padding-bottom: 16px;
}

.tma-season-hero__kicker {
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(255, 241, 200, 0.92);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.tma-season-hero__timer {
  margin: 0 0 12px;
  font-size: clamp(1.35rem, 4.5vw, 1.85rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  color: #fff8e1;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.55), 0 0 20px rgba(255, 213, 127, 0.2);
}

.tma-season-page__title {
  margin: 0;
}

.tma-season-page__head-timer {
  margin: 2px 0 0;
  font-size: clamp(1.9rem, 8.2vw, 2.6rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.015em;
  color: #6f4518;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.55),
    0 2px 5px rgba(120, 84, 35, 0.22);
}

.tma-season-hero__hint {
  margin: 2px 0 0;
  max-width: 36em;
  margin-left: auto;
  margin-right: auto;
}

.tma-season-lb-card {
  border-width: 2px;
  border-color: rgba(255, 213, 127, 0.4);
  box-shadow:
    var(--tma-card-shadow),
    0 0 28px rgba(171, 71, 188, 0.18);
}

.tma-season-lb-title {
  font-size: 1.12rem;
  margin-bottom: 6px;
}

.tma-season-lb-lead {
  margin-top: 0;
  margin-bottom: 12px;
  font-weight: 700;
  color: rgba(255, 224, 180, 0.95);
}

.tma-season-full-lb {
  margin: 4px 0 0;
  text-align: center;
}

.tma-season-full-lb__link {
  font-size: 0.78rem;
  font-weight: 800;
  color: #ffecb3;
  text-decoration: underline;
  text-decoration-color: rgba(255, 213, 127, 0.45);
  text-underline-offset: 3px;
}

.tma-season-full-lb__link:active {
  opacity: 0.88;
}

.tma-card {
  background: var(--tma-card-bg);
  border: 1px solid var(--tma-card-border);
  border-radius: 16px;
  box-shadow: var(--tma-card-shadow);
  padding: 14px 14px 16px;
  position: relative;
  overflow: hidden;
}

.tma-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(80% 120% at 10% 0%, rgba(224, 64, 251, 0.12) 0%, transparent 45%);
  pointer-events: none;
}

.tma-card > * {
  position: relative;
  z-index: 1;
}

.tma-card-title {
  margin: 0 0 10px;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--tma-gold);
  text-shadow: 0 0 18px rgba(255, 193, 7, 0.25);
}

.tma-pill-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}

.tma-pill-tabs--2 {
  grid-template-columns: 1fr 1fr;
}

.tma-pill {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 9px 6px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #b0bec5;
  background: rgba(0, 0, 0, 0.25);
  cursor: pointer;
  font-family: inherit;
}

.tma-pill--active {
  color: #1a1024;
  border-color: transparent;
  background: linear-gradient(180deg, #ffe082 0%, #ffb300 100%);
  box-shadow: 0 0 20px rgba(255, 193, 7, 0.45);
}

.tma-hint {
  margin: 0 0 10px;
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--tma-text-muted);
}

.tma-footnote {
  margin: 10px 0 0;
  font-size: 0.65rem;
  line-height: 1.35;
  color: #78909c;
}

.tma-card--referrals .tma-ref-invite {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin: 12px 0 14px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 213, 79, 0.08);
  border: 1px solid rgba(255, 213, 79, 0.22);
}

.tma-ref-quick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 10px 0 12px;
}

.tma-ref-kpi {
  padding: 9px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 213, 79, 0.18);
  background: linear-gradient(180deg, rgba(255, 213, 79, 0.08) 0%, rgba(21, 15, 35, 0.75) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.tma-ref-kpi-lbl {
  display: block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #90a4ae;
  margin-bottom: 3px;
}

.tma-ref-kpi-val {
  display: block;
  font-size: 0.96rem;
  font-weight: 900;
  color: #fff8e1;
}

.tma-ref-open-btn {
  margin-top: 4px;
  width: 100%;
  border: 1px solid rgba(255, 213, 79, 0.32);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(39, 31, 60, 0.95) 0%, rgba(17, 14, 30, 0.98) 100%);
  color: #fff8e1;
  font-weight: 800;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  box-shadow:
    0 6px 16px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.tma-ref-open-btn:active {
  transform: translateY(1px);
}

.tma-ref-open-left {
  display: inline-flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.tma-ref-open-icon {
  line-height: 0;
  margin-top: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tma-ref-open-icon svg {
  display: block;
}

.tma-ref-open-copy {
  display: inline-flex;
  flex-direction: column;
  min-width: 0;
}

.tma-ref-open-title {
  display: block;
  font-size: 0.8rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.tma-ref-open-sub {
  display: block;
  margin-top: 2px;
  font-size: 0.64rem;
  line-height: 1.25;
  color: #9fb3bf;
  overflow-wrap: anywhere;
}

.tma-ref-open-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 102px;
  justify-content: center;
  border: 1px solid rgba(255, 213, 79, 0.22);
  border-radius: 999px;
  padding: 6px 14px;
  color: #fff8e1;
  background: linear-gradient(180deg, #ffb74d 0%, #ff8f00 70%, #ef6c00 100%);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.tma-ref-page .tma-ref-row {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(12, 10, 22, 0.75);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.tma-ref-page .tma-ref-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(255, 224, 130, 0.45);
  background: linear-gradient(145deg, rgba(255, 224, 130, 0.35), rgba(255, 143, 0, 0.25));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #fff8e1;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.tma-ref-page .tma-ref-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tma-ref-page .tma-ref-meta {
  min-width: 0;
}

.tma-ref-page .tma-ref-name {
  margin: 0;
  font-size: 0.88rem;
  color: #eceff1;
  font-weight: 800;
}

.tma-ref-page .tma-ref-sub {
  margin: 2px 0 0;
  font-size: 0.7rem;
  color: var(--tma-text-muted);
}

.tma-ref-invite-label {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--tma-text-muted);
  width: 100%;
}

.tma-ref-invite-url {
  flex: 1 1 160px;
  min-width: 0;
  font-size: 0.65rem;
  line-height: 1.35;
  word-break: break-all;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
  color: #fff8e1;
}

.tma-ref-copy-btn {
  flex: 0 0 auto;
  width: auto !important;
  padding: 8px 14px !important;
}

.tma-ref-tables {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 8px;
}

.tma-ref-table-wrap {
  border-radius: 12px;
  border: 2px solid rgba(62, 39, 35, 0.55);
  background: linear-gradient(180deg, rgba(255, 248, 225, 0.12) 0%, rgba(255, 236, 179, 0.06) 100%);
  overflow: hidden;
}

.tma-ref-table-title {
  margin: 0;
  padding: 8px 12px;
  font-size: 0.72rem;
  font-weight: 800;
  text-align: center;
  color: #fff;
  background: linear-gradient(180deg, #ff8f00 0%, #e65100 100%);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}

.tma-ref-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px 10px;
  padding: 10px 12px 12px;
  font-size: 0.68rem;
  font-weight: 700;
  color: #4e342e;
}

@media (max-width: 360px) {
  .tma-ref-grid {
    grid-template-columns: repeat(2, 1fr);
    font-size: 0.64rem;
  }
}

/* Рефералы: экран «Мои друзья» (в стиле AGH: золото, фиолет, тёмные карточки) */
.ref-screen .tma-stack.ref-stack {
  gap: 14px;
}

.tma-card.ref-card--link {
  box-shadow: var(--tma-card-shadow), 0 0 32px rgba(255, 193, 7, 0.06);
}

.ref-link-box {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.38);
  border: 1px solid rgba(255, 213, 127, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.ref-link-text {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 4px 0;
  font-size: 0.62rem;
  line-height: 1.45;
  word-break: break-all;
  color: #fff8e1;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

.ref-link-actions {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ref-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255, 213, 127, 0.35);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14) 0%, rgba(0, 0, 0, 0.28) 100%);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  color: #fff8e1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.ref-icon-btn:active {
  transform: scale(0.96);
}

.ref-btn-share {
  margin-top: 2px;
}

.ref-earn-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

@media (max-width: 420px) {
  .ref-earn-grid {
    grid-template-columns: 1fr;
  }
}

.ref-earn-item {
  border-radius: 12px;
  padding: 10px 10px 11px;
  border: 1px solid rgba(255, 213, 127, 0.18);
  background: rgba(0, 0, 0, 0.28);
}

.ref-earn-item__label {
  margin: 0 0 6px;
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--tma-text-muted);
  font-weight: 700;
}

.ref-earn-item__value {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.2;
  font-weight: 900;
  color: #ffe082;
  text-shadow: 0 0 12px rgba(255, 193, 7, 0.24);
}

.ref-earn-note {
  margin: 9px 2px 0;
  font-size: 0.66rem;
  line-height: 1.35;
  color: var(--tma-text-muted);
}

.ref-friends-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.ref-friends-head .tma-card-title.ref-friends-head__title {
  margin: 0;
}

.ref-pill-count {
  flex: 0 0 auto;
  min-width: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  text-align: center;
  color: #1a1024;
  border: 1px solid transparent;
  background: linear-gradient(180deg, #ffe082 0%, #ffb300 100%);
  box-shadow: 0 0 18px rgba(255, 193, 7, 0.35);
}

.ref-friends-hint {
  margin: 0 0 10px;
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--tma-text-muted);
}

.ref-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 48px;
}

.tma-card.ref-details {
  padding-bottom: 14px;
}

.ref-details__summary {
  cursor: pointer;
  list-style: none;
  padding: 0;
  margin: 0;
}

.ref-details__summary::-webkit-details-marker {
  display: none;
}

.ref-details__summary-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.ref-details__summary-text {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.ref-details__summary-title {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--tma-gold);
  text-shadow: 0 0 14px rgba(255, 193, 7, 0.2);
  line-height: 1.25;
}

.ref-details__summary-hint {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  color: rgba(176, 190, 203, 0.95);
  line-height: 1.35;
}

.ref-details__hint-open {
  display: none;
}

.ref-details[open] .ref-details__hint-open {
  display: inline;
  color: var(--tma-gold-hot);
}

.ref-details[open] .ref-details__hint-closed {
  display: none;
}

.ref-details__chevron {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 213, 127, 0.45);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.14) 0%, rgba(0, 0, 0, 0.22) 100%);
  box-shadow:
    0 2px 10px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: transform 0.22s ease, box-shadow 0.2s ease;
}

.ref-details__chevron::before {
  content: "";
  display: block;
  width: 11px;
  height: 11px;
  margin-left: -3px;
  border-right: 3px solid var(--tma-gold-hot);
  border-bottom: 3px solid var(--tma-gold-hot);
  transform: rotate(-45deg);
}

.ref-details[open] .ref-details__chevron {
  transform: rotate(90deg);
  box-shadow:
    0 2px 14px rgba(255, 193, 7, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.ref-details__summary:active .ref-details__chevron {
  transform: scale(0.94);
}

.ref-details[open] .ref-details__summary:active .ref-details__chevron {
  transform: rotate(90deg) scale(0.94);
}

.ref-details__summary:focus-visible {
  outline: 2px solid rgba(255, 213, 127, 0.55);
  outline-offset: 3px;
  border-radius: 12px;
}

.ref-details__note {
  margin: 10px 0 12px;
  font-size: 0.68rem;
  line-height: 1.45;
  color: var(--tma-text-muted);
}

.ref-tables-compact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 400px) {
  .ref-tables-compact {
    grid-template-columns: 1fr;
  }
}

.ref-mini-table {
  border-radius: 12px;
  padding: 10px 10px 8px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.ref-mini-table__cap {
  margin: 0 0 8px;
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--tma-gold-hot);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.ref-mini-list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.7rem;
}

.ref-mini-list li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: #eceff1;
}

.ref-mini-list li:last-child {
  border-bottom: none;
}

.ref-mini-list span:first-child {
  color: var(--tma-text-muted);
  font-weight: 600;
}

.ref-mini-list span:last-child {
  color: #ffb74d;
  font-weight: 800;
}

.tma-btn-primary {
  display: block;
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 0.82rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  color: #1b0e2e;
  background: linear-gradient(180deg, #ffd54f 0%, #ff8f00 100%);
  box-shadow: 0 4px 0 #b45309, 0 10px 24px rgba(255, 152, 0, 0.35);
}

.tma-btn-primary:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #b45309, 0 6px 16px rgba(255, 152, 0, 0.3);
}

.tma-btn-ghost {
  display: block;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  color: #cfd8dc;
  background: rgba(255, 255, 255, 0.06);
}

/* Кошелёк: история */
.tma-tx-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(10, 8, 18, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.tma-tx-title {
  margin: 0;
  font-size: 0.76rem;
  font-weight: 800;
  color: #eceff1;
}

.tma-tx-meta {
  margin: 3px 0 0;
  font-size: 0.65rem;
  color: #78909c;
}

.tma-tx-amt-in {
  font-size: 0.78rem;
  font-weight: 900;
  color: #69f0ae;
  text-shadow: 0 0 12px rgba(105, 240, 174, 0.35);
}

.tma-tx-amt-out {
  font-size: 0.78rem;
  font-weight: 900;
  color: #ff8a80;
  text-shadow: 0 0 12px rgba(255, 138, 128, 0.3);
}

.tma-empty {
  margin: 0;
  padding: 12px 4px;
  font-size: 0.74rem;
  color: #90a4ae;
  text-align: center;
}

/* Лидерборд */
.tma-lb-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: min(52vh, 420px);
  overflow-y: auto;
  padding-right: 2px;
}

.tma-lb-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(12, 10, 22, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.tma-lb-row--me {
  border-color: rgba(224, 64, 251, 0.55);
  box-shadow: 0 0 22px rgba(224, 64, 251, 0.2);
  background: linear-gradient(90deg, rgba(74, 20, 140, 0.45) 0%, rgba(12, 10, 22, 0.85) 100%);
}

.tma-lb-rank {
  font-weight: 900;
  font-size: 0.85rem;
  color: #b0bec5;
  text-align: center;
}

.tma-lb-row:nth-child(1) .tma-lb-rank {
  color: #ffd54f;
  text-shadow: 0 0 10px rgba(255, 213, 79, 0.6);
}

.tma-lb-row:nth-child(2) .tma-lb-rank {
  color: #cfd8dc;
}

.tma-lb-row:nth-child(3) .tma-lb-rank {
  color: #ffab91;
}

.tma-lb-name {
  font-size: 0.78rem;
  font-weight: 800;
  color: #eceff1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tma-lb-val {
  font-size: 0.72rem;
  font-weight: 900;
  color: #ffb74d;
  white-space: nowrap;
}

/* Профиль */
.tma-card--profile-head {
  border-color: rgba(255, 213, 79, 0.18);
  box-shadow:
    0 8px 22px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.tma-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.tma-hero--profile {
  align-items: flex-start;
  margin-bottom: 14px;
}

.tma-hero-text {
  flex: 1 1 auto;
  min-width: 0;
}

.tma-hero--profile .tma-hero-avatar {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  font-size: 2.1rem;
}

.tma-hero-avatar {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 2rem;
  background: linear-gradient(145deg, #7e57c2, #311b92);
  border: 2px solid rgba(255, 236, 179, 0.45);
  box-shadow: 0 0 24px rgba(126, 87, 194, 0.45);
  overflow: hidden;
}

.tma-hero-avatar .tma-tg-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tma-hero-name {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
}

.tma-hero--profile .tma-hero-name {
  font-size: clamp(1.08rem, 4.2vw, 1.22rem);
  letter-spacing: 0.01em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.tma-hero-level {
  margin: 4px 0 0;
  font-size: 0.78rem;
  color: var(--tma-text-muted);
}

.tma-hero-level strong {
  color: var(--tma-gold);
}

.tma-hero-level-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.tma-hero-level-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #cfd8dc;
}

.tma-hero-level-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  padding: 5px 13px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffe082 0%, #ffb300 100%);
  border: 1px solid rgba(62, 39, 35, 0.35);
  box-shadow:
    0 2px 10px rgba(255, 193, 7, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.tma-hero-level-pill strong {
  font-size: 1.02rem;
  font-weight: 900;
  color: #3e2723;
}

.tma-profile-stats {
  margin-top: 2px;
}

.tma-card-title--profile-stats {
  margin: 0 0 8px;
}

.tma-profile-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.tma-profile-kpi {
  padding: 10px 10px 9px;
  border-radius: 12px;
  border: 1px solid rgba(255, 213, 79, 0.16);
  background: linear-gradient(180deg, rgba(255, 213, 79, 0.08) 0%, rgba(21, 15, 35, 0.78) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.tma-profile-kpi-lbl {
  display: block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #b0bec5;
  margin-bottom: 5px;
}

.tma-profile-kpi-val {
  display: block;
  font-size: clamp(0.92rem, 3.6vw, 1.06rem);
  font-weight: 900;
  color: #fff8e1;
  line-height: 1.2;
  word-break: break-word;
}

.tma-profile-kpi-sub {
  display: block;
  margin-top: 4px;
  font-size: 0.64rem;
  line-height: 1.35;
  color: #78909c;
}

.tma-profile-lb {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  margin-top: 12px;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  color: #eceff1;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07) 0%, rgba(12, 10, 22, 0.92) 100%);
  box-shadow:
    0 6px 14px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.tma-profile-lb:active {
  transform: translateY(1px);
}

.tma-profile-lb-ico {
  flex: 0 0 auto;
  line-height: 0;
  margin-top: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tma-profile-lb-ico svg {
  display: block;
}

.tma-profile-lb-copy {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tma-profile-lb-title {
  font-size: 0.84rem;
  font-weight: 900;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.tma-profile-lb-sub {
  font-size: 0.66rem;
  line-height: 1.35;
  color: #90a4ae;
  overflow-wrap: anywhere;
}

.tma-profile-lb-go {
  flex: 0 0 auto;
  align-self: center;
  font-size: 1.05rem;
  font-weight: 900;
  color: #ffb74d;
}

.tma-profile-lb--faq {
  margin-top: 8px;
}

.tma-profile-faq-badge {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  font-size: 1.1rem;
  font-weight: 900;
  color: #5d4037;
  background: linear-gradient(180deg, #ffe082 0%, #ffca28 55%, #ffa000 100%);
  border: 2px solid rgba(139, 87, 23, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.tma-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.tma-stat {
  padding: 10px 10px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.tma-stat-label {
  display: block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #78909c;
  margin-bottom: 4px;
}

.tma-stat-value {
  font-size: 0.88rem;
  font-weight: 900;
  color: #fff8e1;
}

.tma-card--prestige {
  border-color: rgba(186, 104, 200, 0.22);
  box-shadow:
    0 8px 22px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.tma-hint--prestige {
  font-size: 0.74rem;
  line-height: 1.45;
}

.tma-prestige-quick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 10px 0 8px;
}

.tma-prestige-kpi {
  padding: 10px 10px 9px;
  border-radius: 12px;
  border: 1px solid rgba(255, 213, 79, 0.16);
  background: linear-gradient(180deg, rgba(255, 213, 79, 0.07) 0%, rgba(21, 15, 35, 0.78) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.tma-prestige-kpi--accent {
  grid-column: 1 / -1;
  margin-bottom: 8px;
  border-color: rgba(186, 104, 200, 0.28);
  background: linear-gradient(
    135deg,
    rgba(94, 53, 177, 0.35) 0%,
    rgba(21, 15, 35, 0.85) 55%,
    rgba(21, 15, 35, 0.92) 100%
  );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 18px rgba(186, 104, 200, 0.12);
}

.tma-prestige-kpi-lbl {
  display: block;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #90a4ae;
  margin-bottom: 4px;
}

.tma-prestige-kpi-val {
  display: block;
  font-size: 1.02rem;
  font-weight: 900;
  color: #fff8e1;
  line-height: 1.15;
}

.tma-prestige-kpi-val--xl {
  font-size: 1.18rem;
  color: #ffe082;
  text-shadow: 0 0 14px rgba(255, 224, 130, 0.22);
}

.tma-prestige-kpi-sub {
  display: block;
  margin-top: 3px;
  font-size: 0.62rem;
  line-height: 1.25;
  color: #78909c;
}

.tma-prestige-kpi-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.tma-prestige-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  color: #1b0e2e;
  background: linear-gradient(180deg, #ffe082 0%, #ffb300 100%);
  border: 1px solid rgba(62, 39, 35, 0.35);
}

.tma-prestige-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 0 12px;
}

.tma-prestige-mini {
  padding: 9px 10px 8px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.22);
}

.tma-prestige-mini--hot {
  border-color: rgba(255, 213, 79, 0.35);
  box-shadow: 0 0 16px rgba(255, 213, 79, 0.12);
}

.tma-prestige-mini-lbl {
  display: block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #90a4ae;
  margin-bottom: 3px;
}

.tma-prestige-mini strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 900;
  color: #e1bee7;
}

.tma-prestige-mini-hint {
  display: block;
  margin-top: 2px;
  font-size: 0.58rem;
  color: #78909c;
}

.tma-prestige-cta {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  margin-top: 2px;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 213, 79, 0.35);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  color: #fff8e1;
  background: linear-gradient(180deg, rgba(255, 213, 79, 0.16) 0%, rgba(17, 14, 30, 0.95) 100%);
  box-shadow:
    0 8px 18px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.tma-prestige-cta:active {
  transform: translateY(1px);
}

.tma-prestige-cta-ico {
  flex: 0 0 auto;
  line-height: 0;
  margin-top: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tma-prestige-cta-ico svg {
  display: block;
}

.tma-prestige-cta-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.tma-prestige-cta-title {
  font-size: 0.84rem;
  font-weight: 900;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.tma-prestige-cta-sub {
  font-size: 0.66rem;
  line-height: 1.35;
  color: #b0bec5;
  overflow-wrap: anywhere;
}

.tma-toast {
  position: fixed;
  left: 50%;
  bottom: calc(132px + env(safe-area-inset-bottom, 0));
  transform: translateX(-50%);
  margin: 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(18, 12, 28, 0.95);
  border: 1px solid rgba(255, 213, 79, 0.35);
  color: #ffe082;
  font-size: 0.76rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 30;
}

.tma-toast--show {
  opacity: 1;
}

/* Подстраницы: в игре задано html,body{overflow:hidden} — для кошелька/профиля нужна прокрутка */
html:has(body.tma-subpage) {
  overflow: auto;
  max-height: none;
  height: auto;
}
body.tma-subpage {
  overflow-x: hidden;
  overflow-y: auto;
  max-height: none;
  height: auto;
  min-height: 100dvh;
}

/* Профиль: сетка и виньетка поверх общего HUD */
#tmaInlineProfile.tma-page-profile {
  isolation: isolate;
}

#tmaInlineProfile.tma-page-profile::before,
body.tma-page-profile .tma-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.42;
  background-image: repeating-linear-gradient(
      90deg,
      transparent,
      transparent 21px,
      rgba(255, 255, 255, 0.03) 21px,
      rgba(255, 255, 255, 0.03) 22px
    ),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 21px,
      rgba(255, 255, 255, 0.022) 21px,
      rgba(255, 255, 255, 0.022) 22px
    );
}

#tmaInlineProfile.tma-page-profile::after,
body.tma-page-profile .tma-shell::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(ellipse 75% 55% at 50% 115%, rgba(255, 193, 7, 0.11) 0%, transparent 58%);
}

.tma-page-profile .tma-shell {
  position: relative;
  z-index: 2;
}

.tma-page-profile .tma-shell > * {
  position: relative;
  z-index: 1;
}

body.tma-page-profile .tma-shell::before,
body.tma-page-profile .tma-shell::after {
  z-index: 0;
}

.tma-page-profile .tma-topbar {
  padding: 10px 4px 12px;
  border-radius: 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: none;
  margin-bottom: 10px;
}

.tma-page-profile .tma-eyebrow {
  letter-spacing: 0.26em;
  color: rgba(255, 236, 179, 0.88);
}

.tma-page-profile .tma-stack {
  gap: 22px;
}

.tma-page-profile .tma-card {
  border-radius: 0;
  padding: 4px 0 22px;
  border: none;
  background: transparent;
  box-shadow: none;
}

.tma-page-profile .tma-card:not(:last-child) {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 26px;
}

.tma-page-profile .tma-card::before {
  display: none;
}

.tma-page-profile .tma-card-title {
  position: relative;
  padding: 0 0 10px;
  margin: 0 0 12px;
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  border-bottom: 1px solid rgba(255, 213, 79, 0.14);
  text-shadow: 0 1px 12px rgba(255, 193, 7, 0.2);
}

.tma-page-profile .tma-card-title::before {
  display: none;
}

.tma-page-profile .tma-hint {
  font-size: 0.76rem;
  line-height: 1.45;
  color: #b0bec5;
}

.tma-page-profile .tma-section-lead {
  margin: 0 0 16px;
  font-size: 0.8rem;
  line-height: 1.55;
  color: #cfd8dc;
  font-weight: 500;
}

.tma-page-profile .tma-section-lead strong {
  color: #fff8e1;
  font-weight: 700;
}

.tma-page-profile .tma-section-lead--tight {
  margin-bottom: 12px;
}

.tma-page-profile .tma-hero--profile + .tma-section-lead {
  margin-top: 8px;
}

.tma-page-profile .tma-profile-microhead {
  margin: 14px 0 8px;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #90a4ae;
}

.tma-page-profile .tma-card-title + .tma-section-lead + .tma-profile-microhead {
  margin-top: 10px;
}

.tma-page-profile .tma-profile-tagline {
  margin: 0 0 14px;
  font-size: 0.74rem;
  line-height: 1.4;
  color: #90a4ae;
}

.tma-page-profile .tma-card-title + .tma-profile-tagline {
  margin-top: -4px;
}

.tma-page-profile .tma-profile-gain-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0 14px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.2);
}

.tma-page-profile .tma-profile-gain-lbl {
  font-size: 0.72rem;
  line-height: 1.35;
  color: #b0bec5;
  flex: 1 1 auto;
  min-width: 0;
}

.tma-page-profile .tma-profile-gain-val {
  font-size: 1.05rem;
  font-weight: 900;
  color: #e1bee7;
  flex: 0 0 auto;
}

.tma-page-profile .tma-profile-gain-line--hot {
  background: rgba(255, 213, 79, 0.08);
}

.tma-page-profile .tma-profile-gain-line--hot .tma-profile-gain-val {
  color: #ffe082;
}

.tma-page-profile .tma-ref-quick--compact {
  grid-template-columns: 1fr;
  width: 100%;
}

/* Полная ширина строки «По твоей ссылке» / KPI — не сужать до 220px */
.tma-page-profile .tma-ref-quick--compact .tma-ref-kpi {
  max-width: none;
  width: 100%;
  box-sizing: border-box;
}

.tma-page-profile .tma-ref-levels-details {
  margin-top: 14px;
}

.tma-page-profile .tma-ref-levels-summary {
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #b0bec5;
  list-style: none;
}

.tma-page-profile .tma-ref-levels-summary::-webkit-details-marker {
  display: none;
}

.tma-page-profile .tma-ref-levels-summary::after {
  content: " ▼";
  font-size: 0.65rem;
  opacity: 0.7;
}

.tma-page-profile .tma-ref-levels-details[open] .tma-ref-levels-summary::after {
  content: " ▲";
}

/* Профиль: без «окон» — сбрасываем наследуемые рамки у модификаторов и плиток */
.tma-page-profile .tma-card--profile-head,
.tma-page-profile .tma-card--prestige {
  border: none;
  box-shadow: none;
}

.tma-page-profile .tma-profile-kpi,
.tma-page-profile .tma-prestige-kpi,
.tma-page-profile .tma-ref-kpi {
  border: none;
  background: rgba(0, 0, 0, 0.18);
  box-shadow: none;
}

.tma-page-profile .tma-profile-lb {
  border: none;
  background: rgba(255, 255, 255, 0.045);
  box-shadow: none;
}

.tma-page-profile .tma-prestige-mini {
  border: none;
  background: rgba(0, 0, 0, 0.2);
}

.tma-page-profile .tma-prestige-mini--hot {
  border: none;
  box-shadow: none;
  background: rgba(255, 213, 79, 0.07);
}

.tma-page-profile .tma-prestige-cta {
  border: none;
  background: linear-gradient(180deg, rgba(255, 213, 79, 0.09) 0%, rgba(10, 8, 18, 0.92) 100%);
  box-shadow: none;
}

.tma-page-profile .tma-ref-open-btn {
  border: none;
  background: rgba(255, 255, 255, 0.055);
  box-shadow: none;
}

.tma-page-profile .tma-ref-open-right {
  border: none;
}

.tma-page-profile .tma-svg-ico--trophy {
  filter: drop-shadow(0 2px 8px rgba(255, 193, 7, 0.42));
}

.tma-page-profile .tma-svg-ico--chain {
  filter: drop-shadow(0 2px 7px rgba(144, 164, 174, 0.5));
}

.tma-page-profile .tma-svg-ico--spark {
  filter: drop-shadow(0 1px 6px rgba(255, 193, 7, 0.55));
}

@media (prefers-reduced-motion: no-preference) {
  #tmaInlineProfile.tma-page-profile::after,
  body.tma-page-profile .tma-shell::after {
    animation: tma-profile-vignette 10s ease-in-out infinite alternate;
  }
}

@keyframes tma-profile-vignette {
  0% {
    opacity: 1;
    filter: saturate(1);
  }
  100% {
    opacity: 0.92;
    filter: saturate(1.08);
  }
}

/* Экраны профиль / кошелёк / магазин / лидерборд внутри index.html (#profile, #wallet, #shop, #leaderboard) */
.tma-inline-screen {
  position: fixed;
  inset: 0;
  z-index: 60;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}

body.tma-inline-open {
  overflow: auto !important;
}

body.tma-inline-open .shell {
  display: none !important;
}

html:has(body.tma-inline-open) {
  overflow: auto !important;
  max-height: none !important;
  height: auto !important;
}

/* Магазин (shop.html и #shop в index) */
.tma-card--shop-hero .shop-balance-line {
  margin: 8px 0 0;
  font-size: 1rem;
}

.tma-card--shop-boosts .shop-boost-hint {
  margin-bottom: 14px;
}

.tma-card--shop-boosts {
  overflow: visible;
}

/* Без второй рамки/подложки: сетка сидит прямо в .tma-card (одно «окно»). */
.shop-boost-stage {
  margin-top: 2px;
  padding: 0 0 10px;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  position: relative;
}

.shop-boost-stage .shop-boost-grid {
  margin-top: 0;
  position: relative;
  z-index: 1;
}

.shop-boost-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  /* Большой зазор между рядами: кнопка свисает вниз, иконка — вверх, иначе «заплыв» на нижние карты */
  row-gap: 52px;
  column-gap: 12px;
  margin-top: 10px;
  /* Запас под круг, который смотрит вверх из карточки — иначе наезжает на .shop-boost-hint */
  padding-top: 46px;
  padding-bottom: 8px;
  width: 100%;
  box-sizing: border-box;
  min-height: 120px;
  position: relative;
  z-index: 2;
}

/* Карточка: кремовый билет, толстый «контур», иконка и кнопка вынесены за края */
.shop-boost-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  /* Запас под «висящую» иконку — иначе круг наезжает на заголовок */
  padding: 50px 10px 12px;
  margin: 0;
  border: 3px solid #3d2918;
  border-radius: 16px;
  overflow: visible;
  text-align: center;
  font: inherit;
  color: #3e2723;
  background: linear-gradient(175deg, #fdf6e8 0%, #f3e9d4 42%, #e8dcc6 100%);
  box-shadow:
    0 4px 0 rgba(45, 32, 18, 0.22),
    0 8px 22px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
  min-height: 0;
  width: 100%;
  max-width: 100%;
  transition: box-shadow 0.18s ease, transform 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}

.shop-boost-card:hover {
  box-shadow:
    0 4px 0 rgba(45, 32, 18, 0.28),
    0 10px 26px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.shop-boost-card__art {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 1;
  /* Половина круга выше края карточки — меньше пересечения с текстом */
  transform: translate(-50%, -52%);
  width: 40%;
  max-width: 72px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  line-height: 0;
  font-size: 0;
  user-select: none;
  border-radius: 50%;
  border: 3px solid #2d1f12;
  background: radial-gradient(circle at 50% 40%, #fffef9 0%, #f7ecd8 55%, #ead9bc 100%);
  box-shadow:
    0 3px 0 rgba(45, 32, 18, 0.35),
    0 0 0 2px rgba(255, 255, 255, 0.55),
    0 6px 14px rgba(0, 0, 0, 0.2);
}

.shop-boost-card__art .shop-boost-svg {
  width: 54%;
  max-width: 44px;
  height: auto;
  aspect-ratio: 1;
  display: block;
  overflow: visible;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.shop-boost-card__body {
  position: relative;
  z-index: 2;
  flex: 0 1 auto;
  /* Минимум под золотую кнопку (absolute у нижнего края карточки), без лишней «полки» */
  padding: 0 4px 28px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  gap: 2px;
  text-align: center;
  background: transparent;
}

.shop-boost-card__title {
  font-weight: 800;
  font-size: 0.82rem;
  line-height: 1.25;
  margin-top: 2px;
  color: #8d3d2e;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
}

.shop-boost-card__blurb {
  font-size: 0.62rem;
  line-height: 1.35;
  font-weight: 500;
  color: #5d5348;
  max-width: 100%;
  padding: 0 2px;
}

.shop-boost-card__yield {
  display: block;
  width: 100%;
  box-sizing: border-box;
  font-size: 0.78rem;
  line-height: 1.25;
  font-weight: 800;
  color: #1b5e20;
  margin: 2px 0 0;
  padding: 0 2px;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

/* Золотая кнопка с толстым контуром, частично за нижним краем карточки */
.shop-boost-card__buy {
  position: absolute;
  bottom: 0;
  left: 50%;
  z-index: 3;
  transform: translate(-50%, 38%);
  width: 66%;
  max-width: 132px;
  margin: 0;
  padding: 8px 10px;
  min-height: 36px;
  box-sizing: border-box;
  border: 3px solid #2d1f12;
  border-radius: 12px;
  font: inherit;
  font-weight: 800;
  font-size: 0.76rem;
  line-height: 1.15;
  letter-spacing: 0.02em;
  cursor: pointer;
  color: #3e2723;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
  background: linear-gradient(180deg, #ffe9a0 0%, #ffca28 38%, #f9a825 72%, #ef6c00 100%);
  box-shadow:
    0 3px 0 #2d1f12,
    inset 0 2px 0 rgba(255, 255, 255, 0.45);
  transition:
    transform 0.12s ease,
    filter 0.12s ease,
    opacity 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}

.shop-boost-card__buy:hover:not(:disabled) {
  filter: brightness(1.06);
  transform: translate(-50%, calc(38% - 2px));
}

.shop-boost-card__buy:active:not(:disabled) {
  transform: translate(-50%, 38%);
  filter: brightness(0.96);
}

.shop-boost-card__buy:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: translate(-50%, 38%);
  filter: saturate(0.65);
  box-shadow:
    0 2px 0 #4e342e,
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* ====== Welcome-back overlay ====== */
.wb-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(74, 50, 21, 0.34);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  padding: 20px;
  animation: wbFadeIn 0.35s ease-out;
}
.wb-overlay[hidden] { display: none; }

@keyframes wbFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.wb-card {
  position: relative;
  width: 100%;
  max-width: 340px;
  border-radius: 28px;
  padding: 28px 22px 24px;
  text-align: center;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(249, 238, 210, 0.98) 0%, rgba(240, 224, 188, 0.96) 100%);
  border: 3px solid #2f1a0d;
  box-shadow:
    0 8px 0 rgba(47, 26, 13, 0.4),
    0 18px 38px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  animation: wbCardPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes wbCardPop {
  from { transform: scale(0.85) translateY(30px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}

.wb-stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.24) 0%, transparent 42%),
    radial-gradient(1.5px 1.5px at 22% 24%, rgba(255, 255, 255, 0.45), transparent),
    radial-gradient(1.5px 1.5px at 76% 16%, rgba(255, 255, 255, 0.35), transparent),
    radial-gradient(1.8px 1.8px at 62% 76%, rgba(255, 214, 122, 0.4), transparent);
}

.wb-title {
  font-size: 1.65rem;
  font-weight: 900;
  line-height: 1.2;
  color: #3e2723;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
  margin-bottom: 6px;
}

.wb-away {
  font-size: 0.9rem;
  font-weight: 700;
  color: #5d4037;
  margin-bottom: 18px;
}

.wb-earned-box {
  background: rgba(255, 252, 245, 0.94);
  border: 2px solid rgba(201, 161, 94, 0.58);
  border-radius: 18px;
  padding: 16px 14px 14px;
  margin-bottom: 22px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.wb-earned-label {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6d4c41;
  margin-bottom: 4px;
}

.wb-earned-value {
  font-size: 1.85rem;
  font-weight: 900;
  line-height: 1.15;
  color: #1b5e20;
  text-shadow: none;
  margin-bottom: 4px;
}

.wb-earned-hint {
  font-size: 0.72rem;
  font-weight: 700;
  color: #6d4c41;
}

.wb-collect-btn {
  display: inline-block;
  min-width: 180px;
  padding: 14px 28px;
  border: 2px solid #8f5312;
  border-radius: 14px;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #3f2410;
  cursor: pointer;
  background: linear-gradient(180deg, #ffd67b 0%, #ffac2e 45%, #e86b00 100%);
  box-shadow:
    0 3px 0 #8f5312,
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
  transition: transform 0.12s, filter 0.12s;
  -webkit-tap-highlight-color: transparent;
}

.wb-collect-btn:hover {
  filter: brightness(1.05);
  transform: translateY(-2px);
}

.wb-collect-btn:active {
  transform: translateY(0);
  filter: brightness(0.96);
  box-shadow:
    0 2px 0 #8f5312,
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

/* ===== Главный экран: светлый кремовый стиль (восстановлено) ===== */
body:not(.tma-subpage) .game-header {
  background: linear-gradient(180deg, rgba(252, 243, 216, 0.96) 0%, rgba(244, 228, 190, 0.94) 100%);
  border: 2px solid rgba(201, 161, 94, 0.68);
  border-radius: 20px;
  box-shadow:
    0 7px 20px rgba(0, 0, 0, 0.28),
    0 0 0 2px rgba(255, 244, 209, 0.58),
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    inset 0 -8px 22px rgba(214, 186, 125, 0.25);
}

body:not(.tma-subpage) .money-main {
  color: #6f4518;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.45),
    0 2px 4px rgba(126, 89, 35, 0.22);
}

body:not(.tma-subpage) .header-inline-lbl { color: rgba(78, 78, 108, 0.9); }
body:not(.tma-subpage) .header-inline-val { color: #3c345e; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35); }
body:not(.tma-subpage) .header-inline-dot { color: rgba(99, 88, 122, 0.72); opacity: 0.7; }
body:not(.tma-subpage) .header-progress-title { color: rgba(147, 101, 40, 0.92); }
body:not(.tma-subpage) .header-progress-hint { color: rgba(79, 78, 112, 0.95); }

body:not(.tma-subpage) .header-progress-track {
  background: rgba(80, 70, 52, 0.38);
  border: 1px solid rgba(255, 241, 209, 0.62);
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.28),
    inset 0 -1px 2px rgba(49, 39, 26, 0.4);
}

body:not(.tma-subpage) .header-progress-fill {
  background: linear-gradient(90deg, #26c6da 0%, #4dd0e1 45%, #80deea 100%);
  box-shadow:
    0 0 8px rgba(38, 198, 218, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

body:not(.tma-subpage) .header-progress-fill--level {
  background: linear-gradient(90deg, #b15ad7 0%, #c984e8 46%, #e9c8fa 100%);
  box-shadow:
    0 0 10px rgba(177, 90, 215, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

body:not(.tma-subpage) .header-tagline {
  color: rgba(89, 67, 37, 0.9);
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.42),
    0 1px 3px rgba(171, 132, 67, 0.32);
}

body:not(.tma-subpage) .buy-mode-tag {
  border: 2px solid #c89d46;
  border-radius: 14px;
  background: linear-gradient(180deg, #fff4bc 0%, #ffd66f 52%, #eab54c 100%);
  color: #6d4a1b;
  box-shadow:
    0 2px 0 #9d6f2f,
    0 4px 10px rgba(152, 111, 45, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
}

body:not(.tma-subpage) .scroll-area {
  background: linear-gradient(180deg, rgba(251, 243, 219, 0.16) 0%, rgba(248, 236, 205, 0.08) 100%);
}

body:not(.tma-subpage) .biz-row {
  background: linear-gradient(180deg, rgba(249, 238, 210, 0.96) 0%, rgba(240, 224, 188, 0.93) 100%);
  border: 2px solid rgba(199, 159, 90, 0.72);
  border-radius: 20px;
  box-shadow:
    0 6px 18px rgba(0, 0, 0, 0.18),
    0 0 0 2px rgba(255, 244, 210, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

body:not(.tma-subpage) .biz-row::before {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.65), transparent);
  opacity: 0.75;
}

body:not(.tma-subpage) .biz-green-bar {
  background: linear-gradient(180deg, #5a5b63 0%, #45464e 100%);
  border: 2px solid #6b684f;
}

body:not(.tma-subpage) .biz-green-fill {
  background: linear-gradient(180deg, #92e66e 0%, #5fd45d 46%, #2f9f45 100%);
}

body:not(.tma-subpage) .biz-buy-btn {
  border: 2px solid #8f5312;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffd67b 0%, #ffac2e 45%, #e86b00 100%);
  box-shadow:
    0 3px 0 #8f5312,
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

body:not(.tma-subpage) .buy-line1,
body:not(.tma-subpage) .buy-line2 { color: #3f2410; }

body:not(.tma-subpage) .biz-timer {
  background: linear-gradient(180deg, #595d6c 0%, #3f4351 100%);
  border: 2px solid #2f2f3b;
  color: #eef2f8;
}

/* Правый блок Season + кнопки (светлая колонка, как в рефе) */
body:not(.tma-subpage) .side-rail {
  top: calc(var(--header-overlay-h) + 64px);
  right: -2px;
  width: 62px;
  padding: 4px 3px 0;
  gap: 6px;
  bottom: auto;
  filter: drop-shadow(-2px 0 8px rgba(120, 94, 44, 0.2));
}

body:not(.tma-subpage) .side-rail::before {
  display: none;
}

body:not(.tma-subpage) .rail-btn {
  width: 44px;
  height: 44px;
  border: 2px solid rgba(248, 233, 191, 0.95);
  box-shadow:
    0 4px 10px rgba(0, 0, 0, 0.22),
    inset 0 2px 0 rgba(255, 255, 255, 0.48),
    inset 0 -2px 6px rgba(0, 0, 0, 0.12);
}

body:not(.tma-subpage) .rail-btn.rail-btn--season {
  width: 68px;
  height: auto;
  min-height: 0;
  margin-left: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  place-items: stretch;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

body:not(.tma-subpage) .rail-season-stack {
  gap: 0;
  margin-bottom: -2px;
}

body:not(.tma-subpage) .rail-season-plate {
  width: 100%;
  transform: none;
  filter: drop-shadow(0 1px 3px rgba(66, 101, 156, 0.34));
}

body:not(.tma-subpage) .rail-season-plate__inner {
  position: relative;
  overflow: hidden;
  padding: 5px 8px 7px;
  background: linear-gradient(180deg, #b9ddff 0%, #82bdf9 48%, #548fdc 100%);
  clip-path: polygon(9% 3%, 91% 3%, 100% 24%, 100% 76%, 50% 97%, 0 76%, 0 24%);
  border-radius: 0;
  border: 2px solid rgba(218, 238, 255, 0.98);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    inset 0 -2px 0 rgba(43, 82, 144, 0.48),
    0 0 0 1px rgba(60, 104, 172, 0.48);
}

body:not(.tma-subpage) .rail-season-plate__inner::before {
  content: "";
  position: absolute;
  left: 9%;
  right: 9%;
  top: 8%;
  height: 34%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.58) 0%, rgba(255, 255, 255, 0.06) 100%);
  pointer-events: none;
}

body:not(.tma-subpage) .rail-season-plate__inner::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 8% 54%, rgba(255, 255, 255, 0.34) 0 1.8px, transparent 2.6px),
    radial-gradient(circle at 92% 54%, rgba(255, 255, 255, 0.34) 0 1.8px, transparent 2.6px);
  pointer-events: none;
}

body:not(.tma-subpage) .rail-season-label {
  transform: none;
  font-size: 0.43rem;
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: 0.035em;
  color: #f7fbff;
  text-shadow:
    0 1px 1px rgba(36, 67, 114, 0.6),
    0 0 3px rgba(230, 245, 255, 0.3);
}

body:not(.tma-subpage) .rail-season-timer {
  font-size: 0.32rem;
  font-weight: 800;
  color: #7b4d1e;
  text-shadow: none;
  line-height: 1;
  letter-spacing: 0.005em;
  padding: 4px 7px 5px;
  background: linear-gradient(180deg, #fff2ce 0%, #f3d393 100%);
  border: 2px solid rgba(203, 162, 83, 0.8);
  border-radius: 12px;
  box-shadow:
    0 1px 3px rgba(106, 80, 35, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.62);
  max-width: none;
  margin-top: -4px;
  margin-bottom: -3px;
}

body:not(.tma-subpage) .rail-svg--hud {
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.22));
}

body:not(.tma-subpage) .rail-warp {
  background: radial-gradient(circle at 35% 28%, #d5b5ff 0%, #a26ce8 46%, #7b4ecc 100%);
}

body:not(.tma-subpage) .rail-boost {
  background: radial-gradient(circle at 35% 28%, #bfe6ff 0%, #6bbcff 48%, #3a83d2 100%);
}

body:not(.tma-subpage) .rail-connect {
  background: radial-gradient(circle at 35% 28%, #b6efff 0%, #58c7ef 48%, #278fca 100%);
}

body:not(.tma-subpage) .rail-event {
  background: transparent;
}

/* ===== Единый светлый стиль для всех страниц/экранов ===== */
body.tma-subpage {
  background: #0a0610;
  color: #4b341e;
}

body.tma-subpage .ambient {
  background: #120818 url("assets/main-bg.jpg?v=2") center center / cover no-repeat;
}

body.tma-subpage .ambient__dusk,
body.tma-subpage .ambient__stars,
body.tma-subpage .ambient__pinstripe,
body.tma-subpage .ambient__horizon,
body.tma-subpage .ambient__city,
body.tma-subpage .ambient__vignette {
  opacity: 0;
}

body.tma-subpage .tma-topbar {
  background: linear-gradient(180deg, rgba(252, 243, 216, 0.98) 0%, rgba(244, 228, 190, 0.95) 100%);
  border: 2px solid rgba(201, 161, 94, 0.7);
  border-radius: 18px;
  box-shadow:
    0 7px 20px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.74),
    inset 0 -8px 22px rgba(214, 186, 125, 0.2);
  padding: 10px 10px 10px;
}

body.tma-subpage .tma-back {
  color: #6e4a1c;
  background: linear-gradient(180deg, #fff4bd 0%, #ffd66f 56%, #e8b34a 100%);
  border: 2px solid #c89d46;
  box-shadow:
    0 2px 0 #9d6f2f,
    0 5px 10px rgba(152, 111, 45, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.48);
}

body.tma-subpage .tma-eyebrow {
  color: rgba(136, 94, 36, 0.85);
  text-shadow: none;
}

body.tma-subpage .tma-title {
  background: none;
  color: #6f4518;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  filter: none;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.45),
    0 2px 4px rgba(126, 89, 35, 0.2);
}

body.tma-subpage .tma-card,
body.tma-subpage .tma-season-treasury {
  background: linear-gradient(180deg, rgba(249, 238, 210, 0.97) 0%, rgba(240, 224, 188, 0.94) 100%);
  border: 2px solid rgba(199, 159, 90, 0.72);
  border-radius: 20px;
  box-shadow:
    0 6px 18px rgba(0, 0, 0, 0.16),
    0 0 0 2px rgba(255, 244, 210, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  color: #4b341e;
}

body.tma-subpage .tma-card::before,
body.tma-subpage .tma-season-treasury::before {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.32) 0%, transparent 45%);
}

body.tma-subpage .tma-card-title,
body.tma-subpage .tma-season-treasury__amount,
body.tma-subpage .tma-season-hero__kicker,
body.tma-subpage .tma-season-hero__timer {
  color: #6f4518;
  text-shadow: none;
  filter: none;
}

/* Пул наград — приглушённый подзаголовок; TREASURY — янтарный акцент; ближе друг к другу */
body.tma-subpage .tma-season-treasury__title {
  margin-bottom: 3px;
  color: rgba(105, 82, 58, 0.88);
  text-shadow: none;
  filter: none;
}

body.tma-subpage .tma-season-treasury__code {
  margin-top: 0;
  margin-bottom: 8px;
  color: #c2610c;
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.42);
  filter: none;
}

/* $GAME / AXM: на кремовом фоне базовый класс оставлял почти невидимый крем — отдельный акцент */
body.tma-subpage .tma-season-treasury__currency {
  color: #9a580d;
  opacity: 1;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
}

body.tma-subpage .tma-hint,
body.tma-subpage .tma-footnote,
body.tma-subpage .tma-season-lb-lead,
body.tma-subpage .managers-intro-text {
  color: rgba(89, 67, 37, 0.9);
}

body.tma-subpage .tma-pill,
body.tma-subpage .mgr-tab,
body.tma-subpage .wallet-history-tab {
  border: 2px solid rgba(201, 161, 94, 0.65);
  background: linear-gradient(180deg, #fff6da 0%, #f5e4b8 100%);
  color: #6e4a1c;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58);
}

body.tma-subpage .tma-pill--active,
body.tma-subpage .mgr-tab--active,
body.tma-subpage .wallet-history-tab--active {
  background: linear-gradient(180deg, #fff4bc 0%, #ffd66f 52%, #eab54c 100%);
  border-color: #c89d46;
  color: #5c3c15;
  box-shadow:
    0 2px 0 #9d6f2f,
    0 4px 10px rgba(152, 111, 45, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.48);
}

body.tma-subpage .tma-btn-primary,
body.tma-subpage .shop-boost-card__buy,
body.tma-subpage .wallet-topup-submit,
body.tma-subpage .ref-btn-share,
body.tma-subpage .ref-icon-btn {
  border: 2px solid #8f5312;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffd67b 0%, #ffac2e 45%, #e86b00 100%);
  color: #3f2410;
  box-shadow:
    0 3px 0 #8f5312,
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

body.tma-subpage .ref-icon-btn:active {
  transform: translateY(2px) scale(0.97);
  box-shadow:
    0 1px 0 #8f5312,
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

/* Стрелка «Проценты по уровням» — те же цвета, что «Поделиться ссылкой» */
body.tma-subpage .ref-details__chevron,
.tma-inline-screen.tma-subpage .ref-details__chevron {
  border: 2px solid #8f5312;
  background: linear-gradient(180deg, #ffd67b 0%, #ffac2e 45%, #e86b00 100%);
  box-shadow:
    0 3px 0 #8f5312,
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

body.tma-subpage .ref-details__chevron::before,
.tma-inline-screen.tma-subpage .ref-details__chevron::before {
  border-right-color: #3f2410;
  border-bottom-color: #3f2410;
}

body.tma-subpage .ref-details[open] .ref-details__chevron,
.tma-inline-screen.tma-subpage .ref-details[open] .ref-details__chevron {
  box-shadow:
    0 3px 0 #8f5312,
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

body.tma-subpage .tma-lb-row,
body.tma-subpage .wallet-history-item,
body.tma-subpage .ref-earn-item,
body.tma-subpage .ref-link-box,
body.tma-subpage .ref-mini-table {
  background: linear-gradient(180deg, rgba(250, 240, 215, 0.95) 0%, rgba(241, 226, 192, 0.9) 100%);
  border: 1px solid rgba(198, 159, 90, 0.6);
  color: #4b341e;
}

body.tma-subpage .tma-lb-name,
body.tma-subpage .tma-lb-val,
body.tma-subpage .wallet-history-title,
body.tma-subpage .wallet-history-meta,
body.tma-subpage .wallet-history-amount,
body.tma-subpage .ref-earn-item__value,
body.tma-subpage .ref-link-text {
  color: #4b341e;
}

/* Лидерборд: имя игрока темнее, чтобы не сливалось с кремовым фоном */
body.tma-subpage .tma-lb-row .tma-lb-name,
.tma-inline-screen.tma-subpage .tma-lb-row .tma-lb-name,
body.tma-subpage .tma-lb-row--me .tma-lb-name,
.tma-inline-screen.tma-subpage .tma-lb-row--me .tma-lb-name {
  color: #2e1c0f !important;
  text-shadow: none;
}

/* Профиль тоже в «окнах», без тёмного минимализма */
body.tma-page-profile .tma-topbar {
  border: 2px solid rgba(201, 161, 94, 0.7);
  border-radius: 18px;
  margin-bottom: 12px;
}

body.tma-page-profile .tma-card,
body.tma-page-profile .tma-card--profile-head,
body.tma-page-profile .tma-card--prestige {
  border: 2px solid rgba(199, 159, 90, 0.72);
  border-radius: 20px;
  padding: 14px 14px 16px;
  background: linear-gradient(180deg, rgba(249, 238, 210, 0.97) 0%, rgba(240, 224, 188, 0.94) 100%);
  box-shadow:
    0 6px 18px rgba(0, 0, 0, 0.16),
    0 0 0 2px rgba(255, 244, 210, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

body.tma-page-profile .tma-card:not(:last-child) {
  border-bottom: 2px solid rgba(199, 159, 90, 0.72);
  padding-bottom: 16px;
}

body.tma-page-profile .tma-shell::before,
body.tma-page-profile .tma-shell::after,
#tmaInlineProfile.tma-page-profile::before,
#tmaInlineProfile.tma-page-profile::after {
  display: none;
}

/* Оверлеи меню/менеджеров тоже в светлой теме */
.overlay--hub,
.overlay--managers {
  background: rgba(244, 232, 203, 0.65);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.hub-btn,
.hub-close-x {
  border: 2px solid rgba(201, 161, 94, 0.68);
  background: linear-gradient(180deg, #fff4bc 0%, #ffd66f 52%, #eab54c 100%);
  color: #5c3c15;
  box-shadow:
    0 3px 0 #9d6f2f,
    0 5px 12px rgba(152, 111, 45, 0.24);
}

.hub-dot {
  background: #8cc8ff;
  border-color: #dff2ff;
}

.managers-shell,
.real-life-shell,
.items-shell {
  background: #f6ead2;
  color: #4b341e;
}

.managers-banner,
.managers-banner--upgrades,
.real-life-banner,
.items-banner {
  background: linear-gradient(180deg, #fff4bc 0%, #ffd66f 52%, #eab54c 100%);
  border: 2px solid #c89d46;
  box-shadow:
    0 3px 0 #9d6f2f,
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.managers-title,
.managers-intro-lead,
.managers-balance-line {
  color: #6f4518;
  text-shadow: none;
}

.overlay--managers .managers-intro-text {
  color: #4b341e;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.42);
}

.managers-close-pill {
  border: 2px solid #c89d46;
  background: linear-gradient(180deg, #fff4bc 0%, #ffd66f 52%, #eab54c 100%);
  color: #6d4a1b;
  box-shadow: 0 2px 0 #9d6f2f;
}

.managers-list-wrap {
  background: linear-gradient(180deg, rgba(251, 243, 219, 0.4) 0%, rgba(248, 236, 205, 0.22) 100%);
  border-color: rgba(199, 159, 90, 0.5);
}

/* Карточки и контролы в разделах Менеджеры/Улучшения/Предметы/Недвижимость — светлая палитра сайта */
.overlay--managers .mgr-tab {
  border: 2px solid rgba(201, 161, 94, 0.65);
  background: linear-gradient(180deg, #fff6da 0%, #f5e4b8 100%);
  color: #6e4a1c;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58);
}

.overlay--managers .mgr-tab--active {
  background: linear-gradient(180deg, #fff4bc 0%, #ffd66f 52%, #eab54c 100%);
  border-color: #c89d46;
  color: #5c3c15;
  box-shadow:
    0 2px 0 #9d6f2f,
    0 4px 10px rgba(152, 111, 45, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.48);
}

.overlay--managers .manager-card {
  background: linear-gradient(180deg, rgba(250, 240, 215, 0.95) 0%, rgba(241, 226, 192, 0.92) 100%);
  border: 1px solid rgba(198, 159, 90, 0.6);
  box-shadow:
    0 3px 10px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.overlay--managers .manager-card--hired {
  border-color: rgba(151, 122, 68, 0.62);
  opacity: 1;
}

.overlay--managers .manager-name {
  color: #4b341e;
}

.overlay--managers .manager-manages {
  color: #6a4d2a;
}

.overlay--managers .manager-cost {
  color: #5c3c15;
}

.overlay--managers .manager-hire-btn {
  border: 2px solid #8f5312;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffd67b 0%, #ffac2e 45%, #e86b00 100%);
  color: #3f2410;
  box-shadow:
    0 3px 0 #8f5312,
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.overlay--managers .manager-hire-btn:disabled,
.overlay--managers .manager-hire-btn--done {
  border-color: rgba(121, 92, 49, 0.8);
  background: linear-gradient(180deg, #d8c39a 0%, #b79f78 100%);
  color: rgba(63, 36, 16, 0.82);
  box-shadow:
    0 2px 0 rgba(121, 92, 49, 0.72),
    inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

.overlay--managers .managers-angel-placeholder {
  color: #6e4a1c;
}

/* Inline-подстраницы в index.html (когда body без .tma-subpage) */
.tma-inline-screen.tma-subpage {
  color: #4b341e;
}

.tma-inline-screen.tma-subpage .tma-topbar {
  background: linear-gradient(180deg, rgba(252, 243, 216, 0.98) 0%, rgba(244, 228, 190, 0.95) 100%);
  border: 2px solid rgba(201, 161, 94, 0.7);
  border-radius: 18px;
  box-shadow:
    0 7px 20px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.74),
    inset 0 -8px 22px rgba(214, 186, 125, 0.2);
  padding: 10px 10px 10px;
}

.tma-inline-screen.tma-subpage .tma-back {
  color: #6e4a1c;
  background: linear-gradient(180deg, #fff4bd 0%, #ffd66f 56%, #e8b34a 100%);
  border: 2px solid #c89d46;
  box-shadow:
    0 2px 0 #9d6f2f,
    0 5px 10px rgba(152, 111, 45, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.48);
}

.tma-inline-screen.tma-subpage .tma-eyebrow {
  color: rgba(136, 94, 36, 0.85);
  text-shadow: none;
}

.tma-inline-screen.tma-subpage .tma-title {
  background: none;
  color: #6f4518;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  filter: none;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.45),
    0 2px 4px rgba(126, 89, 35, 0.2);
}

.tma-inline-screen.tma-subpage .tma-card,
.tma-inline-screen.tma-subpage .tma-season-treasury {
  background: linear-gradient(180deg, rgba(249, 238, 210, 0.97) 0%, rgba(240, 224, 188, 0.94) 100%);
  border: 2px solid rgba(199, 159, 90, 0.72);
  border-radius: 20px;
  box-shadow:
    0 6px 18px rgba(0, 0, 0, 0.16),
    0 0 0 2px rgba(255, 244, 210, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  color: #4b341e;
}

.tma-inline-screen.tma-subpage .tma-card::before,
.tma-inline-screen.tma-subpage .tma-season-treasury::before {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.32) 0%, transparent 45%);
}

.tma-inline-screen.tma-subpage .tma-card-title,
.tma-inline-screen.tma-subpage .tma-season-treasury__amount,
.tma-inline-screen.tma-subpage .tma-season-hero__kicker,
.tma-inline-screen.tma-subpage .tma-season-hero__timer {
  color: #6f4518;
  text-shadow: none;
  filter: none;
}

.tma-inline-screen.tma-subpage .tma-season-treasury__title {
  margin-bottom: 3px;
  color: rgba(105, 82, 58, 0.88);
  text-shadow: none;
  filter: none;
}

.tma-inline-screen.tma-subpage .tma-season-treasury__code {
  margin-top: 0;
  margin-bottom: 8px;
  color: #c2610c;
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.42);
  filter: none;
}

.tma-inline-screen.tma-subpage .tma-season-treasury__currency {
  color: #9a580d;
  opacity: 1;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
}

.tma-inline-screen.tma-subpage .tma-hint,
.tma-inline-screen.tma-subpage .tma-footnote,
.tma-inline-screen.tma-subpage .tma-season-lb-lead {
  color: rgba(89, 67, 37, 0.9);
}

.tma-inline-screen.tma-subpage .tma-pill,
.tma-inline-screen.tma-subpage .wallet-history-tab {
  border: 2px solid rgba(201, 161, 94, 0.65);
  background: linear-gradient(180deg, #fff6da 0%, #f5e4b8 100%);
  color: #6e4a1c;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58);
}

.tma-inline-screen.tma-subpage .tma-pill--active,
.tma-inline-screen.tma-subpage .wallet-history-tab--active {
  background: linear-gradient(180deg, #fff4bc 0%, #ffd66f 52%, #eab54c 100%);
  border-color: #c89d46;
  color: #5c3c15;
  box-shadow:
    0 2px 0 #9d6f2f,
    0 4px 10px rgba(152, 111, 45, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.48);
}

.tma-inline-screen.tma-subpage .tma-btn-primary,
.tma-inline-screen.tma-subpage .shop-boost-card__buy,
.tma-inline-screen.tma-subpage .wallet-topup-submit,
.tma-inline-screen.tma-subpage .ref-btn-share,
.tma-inline-screen.tma-subpage .ref-icon-btn {
  border: 2px solid #8f5312;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffd67b 0%, #ffac2e 45%, #e86b00 100%);
  color: #3f2410;
  box-shadow:
    0 3px 0 #8f5312,
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.tma-inline-screen.tma-subpage .ref-icon-btn:active {
  transform: translateY(2px) scale(0.97);
  box-shadow:
    0 1px 0 #8f5312,
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.tma-inline-screen.tma-subpage .tma-lb-row,
.tma-inline-screen.tma-subpage .wallet-history-item,
.tma-inline-screen.tma-subpage .ref-earn-item,
.tma-inline-screen.tma-subpage .ref-link-box,
.tma-inline-screen.tma-subpage .ref-mini-table {
  background: linear-gradient(180deg, rgba(250, 240, 215, 0.95) 0%, rgba(241, 226, 192, 0.9) 100%);
  border: 1px solid rgba(198, 159, 90, 0.6);
  color: #4b341e;
}

.tma-inline-screen.tma-subpage.tma-page-profile .tma-shell::before,
.tma-inline-screen.tma-subpage.tma-page-profile .tma-shell::after,
#tmaInlineProfile.tma-page-profile::before,
#tmaInlineProfile.tma-page-profile::after {
  display: none;
}

/* Inline profile: restore inner paddings so content is not glued to card borders */
.tma-inline-screen.tma-subpage.tma-page-profile .tma-card,
.tma-inline-screen.tma-subpage.tma-page-profile .tma-card--profile-head,
.tma-inline-screen.tma-subpage.tma-page-profile .tma-card--prestige,
.tma-inline-screen.tma-subpage.tma-page-profile .tma-card--referrals {
  padding: 14px 14px 16px;
}

.tma-inline-screen.tma-subpage.tma-page-profile .tma-card-title {
  padding-left: 0;
  padding-right: 0;
}

.tma-inline-screen.tma-subpage.tma-page-profile .tma-profile-tagline,
.tma-inline-screen.tma-subpage.tma-page-profile .tma-hint {
  padding-left: 0;
  padding-right: 0;
}

/* Referrals CTA: stretch middle content for balanced proportion */
body.tma-subpage .tma-card--referrals .tma-ref-open-btn,
.tma-inline-screen.tma-subpage .tma-card--referrals .tma-ref-open-btn {
  justify-content: initial;
  column-gap: 10px;
}

body.tma-subpage .tma-card--referrals .tma-ref-open-left,
.tma-inline-screen.tma-subpage .tma-card--referrals .tma-ref-open-left {
  flex: 1 1 86%;
  min-width: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
}

body.tma-subpage .tma-card--referrals .tma-ref-open-copy,
.tma-inline-screen.tma-subpage .tma-card--referrals .tma-ref-open-copy {
  min-width: 0;
}

body.tma-subpage .tma-card--referrals .tma-ref-open-title,
.tma-inline-screen.tma-subpage .tma-card--referrals .tma-ref-open-title {
  line-height: 1.12;
}

/* «Далее» в блоке друзей — тот же оранжевый стиль, что «Купить» у карточек на главной (.shop-boost-card__buy) */
body.tma-subpage .tma-card--referrals .tma-ref-open-right,
.tma-inline-screen.tma-subpage .tma-card--referrals .tma-ref-open-right,
.tma-page-profile .tma-card--referrals .tma-ref-open-right {
  min-width: 100px;
  padding: 8px 16px;
  border-radius: 12px;
  border: 3px solid #2d1f12;
  color: #3e2723;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
  background: linear-gradient(180deg, #ffe9a0 0%, #ffca28 38%, #f9a825 72%, #ef6c00 100%);
  box-shadow:
    0 3px 0 #2d1f12,
    inset 0 2px 0 rgba(255, 255, 255, 0.45);
}

body.tma-subpage .tma-card--referrals .tma-ref-open-btn:active .tma-ref-open-right,
.tma-inline-screen.tma-subpage .tma-card--referrals .tma-ref-open-btn:active .tma-ref-open-right {
  filter: brightness(0.96);
  box-shadow:
    0 2px 0 #2d1f12,
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

/* ===== Везде фон как на главной ===== */
body.tma-subpage,
.tma-inline-screen.tma-subpage,
.overlay--hub,
.overlay--managers,
.overlay--prestige-modal,
.wb-overlay {
  background: #120818 url("assets/main-bg.jpg?v=2") center center / cover no-repeat !important;
}

body.tma-subpage .ambient,
.tma-inline-screen.tma-subpage .ambient {
  background: #120818 url("assets/main-bg.jpg?v=2") center center / cover no-repeat !important;
}

/* Убираем затемнение, чтобы везде был тот же чистый фон */
body.tma-subpage .ambient__dusk,
body.tma-subpage .ambient__stars,
body.tma-subpage .ambient__pinstripe,
body.tma-subpage .ambient__horizon,
body.tma-subpage .ambient__city,
body.tma-subpage .ambient__vignette {
  opacity: 0 !important;
}

/* Контейнеры полноэкранных модалок/экранов тоже без тёмного градиента */
.managers-shell,
.real-life-shell,
.items-shell,
.tma-shell {
  background: transparent !important;
}

/* Кошелёк: контраст текста на светлых карточках */
body.tma-subpage.wallet-page .wallet-balance-caption strong,
.tma-inline-screen.tma-subpage.wallet-page .wallet-balance-caption strong {
  color: #b45309;
}

body.tma-subpage.wallet-page .wallet-connected-address,
.tma-inline-screen.tma-subpage.wallet-page .wallet-connected-address {
  color: #2d1b0e;
  background: rgba(255, 252, 245, 0.96);
  border: 2px solid rgba(199, 159, 90, 0.65);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

body.tma-subpage.wallet-page .wallet-topup-input,
.tma-inline-screen.tma-subpage.wallet-page .wallet-topup-input {
  background: #fffdf8;
  color: #3e2723;
  border: 2px solid rgba(199, 159, 90, 0.7);
  box-shadow: inset 0 1px 2px rgba(62, 39, 35, 0.06);
  font-size: 16px;
  line-height: 1.2;
}

body.tma-subpage.wallet-page .wallet-topup-input::placeholder,
.tma-inline-screen.tma-subpage.wallet-page .wallet-topup-input::placeholder {
  color: #6d4c41;
  opacity: 1;
}

body.tma-subpage.wallet-page .wallet-history-empty,
.tma-inline-screen.tma-subpage.wallet-page .wallet-history-empty {
  color: #5d4037;
  font-weight: 700;
}

body.tma-subpage.wallet-page .wallet-axiome-status,
.tma-inline-screen.tma-subpage.wallet-page .wallet-axiome-status {
  color: #5d4037;
}

body.tma-subpage.wallet-page .wallet-axiome-status--waiting,
.tma-inline-screen.tma-subpage.wallet-page .wallet-axiome-status--waiting {
  color: #b45309;
}

body.tma-subpage.wallet-page .wallet-axiome-status--connected,
.tma-inline-screen.tma-subpage.wallet-page .wallet-axiome-status--connected {
  color: #1b5e20;
}

body.tma-subpage.wallet-page .wallet-axiome-code__label,
.tma-inline-screen.tma-subpage.wallet-page .wallet-axiome-code__label {
  color: #5d4037;
}

body.tma-subpage.wallet-page .wallet-axiome-code__hint,
.tma-inline-screen.tma-subpage.wallet-page .wallet-axiome-code__hint {
  color: #6d4c41;
}

body.tma-subpage.wallet-page .wallet-axiome-code,
.tma-inline-screen.tma-subpage.wallet-page .wallet-axiome-code {
  background: rgba(62, 39, 35, 0.06);
  border: 1px solid rgba(199, 159, 90, 0.45);
}

body.tma-subpage.wallet-page .wallet-axiome-code__token,
.tma-inline-screen.tma-subpage.wallet-page .wallet-axiome-code__token {
  color: #2d1b0e;
  background: #fffdf8;
  border: 1px solid rgba(199, 159, 90, 0.55);
}

body.tma-subpage.wallet-page .wallet-axiome-code__copy,
.tma-inline-screen.tma-subpage.wallet-page .wallet-axiome-code__copy {
  color: #3f2410;
  background: linear-gradient(180deg, #fff4bc 0%, #ffd66f 52%, #eab54c 100%);
  border: 2px solid #c89d46;
}

/* Все подстраницы (не главная): единая читаемость вторичного текста и ссылок */
body.tma-subpage,
.tma-inline-screen.tma-subpage {
  --tma-text-muted: #6d4c41;
  --tma-gold: #7a4e0f;
}

body.tma-subpage input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"])::placeholder,
body.tma-subpage textarea::placeholder,
.tma-inline-screen.tma-subpage input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"])::placeholder,
.tma-inline-screen.tma-subpage textarea::placeholder {
  color: #6d4c41;
  opacity: 1;
}

body.tma-subpage .menu-line .muted,
.tma-inline-screen.tma-subpage .menu-line .muted {
  color: #6d4c41;
}

/* Рефералы: блок ссылки после светлой темы — тёмный текст на светлой плашке */
body.tma-subpage .ref-link-box,
.tma-inline-screen.tma-subpage .ref-link-box {
  background: rgba(255, 252, 245, 0.96);
  border: 2px solid rgba(199, 159, 90, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

body.tma-subpage .ref-link-text,
.tma-inline-screen.tma-subpage .ref-link-text {
  color: #2d1b0e;
}

body.tma-subpage .tma-ref-invite-url,
.tma-inline-screen.tma-subpage .tma-ref-invite-url {
  background: rgba(255, 252, 245, 0.95);
  color: #2d1b0e;
  border: 1px solid rgba(199, 159, 90, 0.5);
}

body.tma-subpage .ref-earn-item__value,
.tma-inline-screen.tma-subpage .ref-earn-item__value {
  color: #b45309;
  text-shadow: none;
}

body.tma-subpage .tma-hero--profile .tma-hero-name,
.tma-inline-screen.tma-subpage .tma-hero--profile .tma-hero-name {
  color: #3e2723;
  text-shadow: none;
}

body.tma-subpage .tma-hero-level-label,
.tma-inline-screen.tma-subpage .tma-hero-level-label {
  color: #6d4c41;
}

body.tma-subpage .tma-profile-kpi-lbl,
body.tma-subpage .tma-prestige-kpi-lbl,
body.tma-subpage .tma-prestige-mini-lbl,
.tma-inline-screen.tma-subpage .tma-profile-kpi-lbl,
.tma-inline-screen.tma-subpage .tma-prestige-kpi-lbl,
.tma-inline-screen.tma-subpage .tma-prestige-mini-lbl {
  color: #6d4c41;
}

body.tma-subpage .tma-profile-kpi-val,
body.tma-subpage .tma-prestige-kpi-val,
.tma-inline-screen.tma-subpage .tma-profile-kpi-val,
.tma-inline-screen.tma-subpage .tma-prestige-kpi-val {
  color: #3e2723;
}

body.tma-subpage .tma-profile-kpi-sub,
body.tma-subpage .tma-prestige-kpi-sub,
.tma-inline-screen.tma-subpage .tma-profile-kpi-sub,
.tma-inline-screen.tma-subpage .tma-prestige-kpi-sub {
  color: #6d4c41;
}

body.tma-subpage .tma-profile-lb,
.tma-inline-screen.tma-subpage .tma-profile-lb {
  color: #3e2723;
  background: linear-gradient(180deg, #fff6da 0%, #f5e4b8 100%);
  border: 2px solid rgba(201, 161, 94, 0.65);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

body.tma-subpage .tma-profile-lb-sub,
.tma-inline-screen.tma-subpage .tma-profile-lb-sub {
  color: #6d4c41;
}

body.tma-subpage .tma-profile-tagline,
.tma-inline-screen.tma-subpage .tma-profile-tagline {
  color: #6d4c41;
}

body.tma-subpage .tma-profile-gain-lbl,
.tma-inline-screen.tma-subpage .tma-profile-gain-lbl {
  color: #6d4c41;
}

body.tma-subpage .tma-profile-gain-val,
.tma-inline-screen.tma-subpage .tma-profile-gain-val {
  color: #5d2e0f;
}

body.tma-subpage .tma-ref-open-btn,
.tma-inline-screen.tma-subpage .tma-ref-open-btn {
  color: #3e2723;
  background: linear-gradient(180deg, #fff6da 0%, #f5e4b8 100%);
  border: 2px solid rgba(201, 161, 94, 0.65);
}

body.tma-subpage .tma-ref-open-sub,
.tma-inline-screen.tma-subpage .tma-ref-open-sub {
  color: #6d4c41;
}

body.tma-subpage .tma-season-full-lb__link,
.tma-inline-screen.tma-subpage .tma-season-full-lb__link {
  color: #7a4e0f;
  text-decoration-color: rgba(122, 78, 15, 0.45);
}

body.tma-subpage .tma-toast,
.tma-inline-screen.tma-subpage .tma-toast {
  color: #3e2723;
}

/* На главной тост тоже выше плавающего навбара */
body:not(.tma-subpage) .tma-toast {
  bottom: calc(132px + env(safe-area-inset-bottom, 0));
}

/*
 * Профиль на подстранице: одна вертикаль — заголовки, hero, сетки и кнопки
 * делят общую ширину карточки (padding карточки), без дополнительных сдвигов.
 */
body.tma-subpage .tma-card--profile-head .tma-hero--profile,
body.tma-subpage .tma-card--profile-head .tma-profile-stats,
body.tma-subpage .tma-card--prestige .tma-profile-gain-line,
.tma-inline-screen.tma-subpage.tma-page-profile .tma-card--profile-head .tma-hero--profile,
.tma-inline-screen.tma-subpage.tma-page-profile .tma-card--profile-head .tma-profile-stats,
.tma-inline-screen.tma-subpage.tma-page-profile .tma-card--prestige .tma-profile-gain-line {
  width: 100%;
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
  box-sizing: border-box;
}

/* Keep inner profile/prestige blocks full width (aligned with titles & hero) */
body.tma-subpage .tma-card--profile-head .tma-profile-stat-grid,
body.tma-subpage .tma-card--prestige .tma-prestige-quick,
body.tma-subpage .tma-card--profile-head .tma-profile-lb,
body.tma-subpage .tma-card--prestige .tma-prestige-cta,
body.tma-subpage .tma-card--referrals .tma-ref-quick,
body.tma-subpage .tma-card--referrals .tma-ref-open-btn,
.tma-inline-screen.tma-subpage .tma-card--profile-head .tma-profile-stat-grid,
.tma-inline-screen.tma-subpage .tma-card--prestige .tma-prestige-quick,
.tma-inline-screen.tma-subpage .tma-card--profile-head .tma-profile-lb,
.tma-inline-screen.tma-subpage .tma-card--prestige .tma-prestige-cta,
.tma-inline-screen.tma-subpage .tma-card--referrals .tma-ref-quick,
.tma-inline-screen.tma-subpage .tma-card--referrals .tma-ref-open-btn {
  width: 100% !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  box-sizing: border-box !important;
}

/* Не двигаем сами блоки; добавляем воздух только внутри информационных зон */
body.tma-subpage .tma-profile-kpi,
body.tma-subpage .tma-prestige-kpi,
body.tma-subpage .tma-ref-kpi,
body.tma-subpage .tma-profile-lb,
body.tma-subpage .tma-prestige-cta,
body.tma-subpage .tma-ref-open-btn,
.tma-inline-screen.tma-subpage .tma-profile-kpi,
.tma-inline-screen.tma-subpage .tma-prestige-kpi,
.tma-inline-screen.tma-subpage .tma-ref-kpi,
.tma-inline-screen.tma-subpage .tma-profile-lb,
.tma-inline-screen.tma-subpage .tma-prestige-cta,
.tma-inline-screen.tma-subpage .tma-ref-open-btn {
  padding-left: 14px;
  padding-right: 14px;
}

/* Profile overflow hardening */
.tma-page-profile .tma-hero--profile,
.tma-page-profile .tma-profile-lb,
.tma-page-profile .tma-prestige-cta,
.tma-page-profile .tma-ref-open-btn,
.tma-page-profile .tma-profile-lb-copy,
.tma-page-profile .tma-prestige-cta-copy,
.tma-page-profile .tma-ref-open-copy,
.tma-page-profile .tma-ref-open-left {
  min-width: 0;
}

.tma-page-profile .tma-profile-kpi-val,
.tma-page-profile .tma-prestige-kpi-val,
.tma-page-profile .tma-profile-gain-val {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.tma-page-profile .tma-ref-open-right {
  min-width: 86px;
}

@media (max-width: 420px) {
  .tma-page-profile .tma-hero--profile {
    gap: 10px;
  }

  .tma-page-profile .tma-hero--profile .tma-hero-avatar {
    width: 64px;
    height: 64px;
    border-radius: 16px;
  }

  .tma-page-profile .tma-profile-stat-grid,
  .tma-page-profile .tma-prestige-quick {
    grid-template-columns: 1fr 1fr;
  }

  .tma-page-profile .tma-profile-lb,
  .tma-page-profile .tma-prestige-cta,
  .tma-page-profile .tma-ref-open-btn {
    gap: 8px;
    padding: 10px;
  }
}
