/* ==========================================================================
  
   ========================================================================== */

:root {
  /* Цвета */
  --c-white: #ffffff;
  --c-text: #343448;
  --c-text-60: rgba(52, 52, 72, 0.6);
  --c-text-30: rgba(52, 52, 72, 0.3);
  --c-text-15: rgba(52, 52, 72, 0.15);
  --c-text-10: rgba(52, 52, 72, 0.1);

  --c-surface: rgba(180, 184, 204, 0.1);
  --c-surface-2: rgba(180, 184, 204, 0.2);
  --c-border: rgba(180, 184, 204, 0.14);

  --c-orange: #fd5809;
  --c-yellow: #ffd634;
  --c-green: #55c776;
  --c-red: #f8604a;
  --c-live: #ff6f42;

  --c-menu-bg: #f4f5f8;
  --c-footer-text: #858591;

  --c-tile-violet: rgba(78, 0, 255, 0.14);
  --c-tile-violet-soft: rgba(78, 0, 255, 0.1);
  --c-tile-blue: rgba(0, 151, 255, 0.14);
  --c-tile-green: rgba(0, 255, 143, 0.1);
  --c-tile-amber: rgba(255, 182, 0, 0.14);
  --c-tile-red: rgba(255, 0, 16, 0.14);

  --grad-plus: linear-gradient(90deg, #ff5c4d 0%, #eb469f 30%, #8341ef 75%, #3f68f9 100%);

  /* Тени */
  --sh-btn: 0 8px 16px rgba(0, 0, 0, 0.08);
  --sh-low: 0 2px 5px rgba(33, 34, 36, 0.17);

  /* Радиусы */
  --r-card: 20px;
  --r-field: 14px;
  --r-chip: 12px;
  --r-btn: 10px;
  --r-tabs: 16px;
  --r-sheet: 60px;

  --app-w: 394px;
  --nav-h: 72px;
  --pad: 16px;

  --font: "Inter", "YS Text", "Yandex Sans Text", -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: #e9eaee;
  color: var(--c-text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.3;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, p { margin: 0; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; border: 0; padding: 0; background: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }

:focus-visible { outline: 2px solid var(--c-orange); outline-offset: 2px; }

[hidden] { display: none !important; }
.is-hidden { display: none !important; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Каркас приложения ---------- */

.app {
  position: relative;
  width: 100%;
  max-width: var(--app-w);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--c-white);
  overflow: hidden;
}

.app__scroll {
  min-height: 100vh;
  padding-bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom, 0px));
}

/* ---------- Шапка ---------- */

.topbar {
  position: relative;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 32px 12px;
  background: var(--c-white);
}

.topbar__logo { width: 190px; height: 32px; object-fit: contain; }

.topbar.is-scrolled {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--app-w);
  padding: 16px;
  background: transparent;
}

.topbar.is-scrolled .topbar__inner {
  background: rgba(255, 242, 209, 0.6);
  backdrop-filter: blur(11px);
  -webkit-backdrop-filter: blur(11px);
  border-radius: var(--r-card);
  padding: 16px;
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  transition: background 0.2s ease, padding 0.2s ease;
}

/* Аватар с Плюс-обводкой (градиентное кольцо + белый зазор) */
.avatar {
  position: relative;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  padding: 1.4px;
  background: var(--grad-plus);
}
.avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 1.4px solid var(--c-white);
  background: var(--c-white);
}
.avatar--40 { width: 40px; height: 40px; padding: 1.6px; }
.avatar--40 img { border-width: 1.6px; }

/* ---------- Экраны ---------- */

.screen { display: none; padding-bottom: 24px; }
.screen.is-active { display: block; }
/* Экраны с подвалом: подвал прижат к нижнему меню, без лишнего пробела */
.screen:has([data-footer]) { padding-bottom: 0; }

.screen__title {
  margin: 8px var(--pad) 0;
  font-size: 24px;
  line-height: 28px;
  font-weight: 500;
}

.screen__title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px var(--pad) 0;
}
.screen__title-row .screen__title { margin: 0; }

.subhead {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px var(--pad) 0;
}
.subhead .screen__title { margin: 0; }
.back-btn {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-left: -6px;
  border-radius: 10px;
}
.back-btn:active { background: var(--c-surface); }
.back-btn img { width: 9px; height: 16px; }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 24px var(--pad) 10px;
}

.section-title { font-size: 16px; line-height: 16px; font-weight: 500; }

.section-head--baseline { align-items: flex-end; }

.link-more {
  font-size: 12px;
  line-height: 14px;
  color: var(--c-text-60);
}

.center-link {
  display: block;
  width: 100%;
  margin-top: 16px;
  text-align: center;
  font-size: 12px;
  line-height: 14px;
  color: var(--c-text-60);
}

.row { display: flex; gap: 10px; padding: 0 var(--pad); }
.row--16 { gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 5px; padding: 0 var(--pad); }

/* ---------- Типовые элементы ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: var(--r-btn);
  font-size: 14px;
  line-height: 18px;
  font-weight: 500;
  transition: transform 0.12s ease, opacity 0.12s ease;
}
.btn:active { transform: scale(0.985); }
.btn--dark { background: var(--c-text); color: var(--c-white); box-shadow: var(--sh-btn); }
.btn--orange { background: var(--c-orange); color: var(--c-white); box-shadow: var(--sh-btn); }
.btn--ghost { color: var(--c-text-60); }
.btn--block { display: flex; width: 100%; }
.btn--h40 { height: 40px; padding: 7px 16px; }
.btn--sm { padding: 7px 16px; font-size: 12px; line-height: 16px; }

.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 0 var(--pad); }
.chip {
  padding: 7px 16px;
  border-radius: var(--r-chip);
  background: var(--c-surface);
  font-size: 12px;
  line-height: 16px;
}
.chip.is-active { background: var(--c-yellow); }

.tabs {
  display: flex;
  gap: 4px;
  height: 32px;
  margin: 0 var(--pad);
  padding: 4px;
  border-radius: var(--r-tabs);
  background: var(--c-surface);
}
.tabs__btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-chip);
  font-size: 14px;
  line-height: 16px;
  font-weight: 500;
  color: var(--c-text-30);
  transition: background 0.15s ease, color 0.15s ease;
}
.tabs__btn.is-active {
  background: var(--c-white);
  color: var(--c-text);
  box-shadow: var(--sh-low);
}

.note {
  display: flex;
  gap: 12px;
  margin: 0 var(--pad);
  padding: 12px;
  border-radius: var(--r-chip);
  font-size: 10px;
  line-height: 12px;
}
.note__icon { flex: none; width: 16px; height: 16px; }
.note--warn { background: #fcf1c5; border: 1px solid #faeaa2; color: #524a39; }
.note--danger {
  background: rgba(255, 0, 16, 0.1);
  border: 1px solid rgba(255, 0, 16, 0.08);
  color: #523939;
}

.info-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 var(--pad);
  padding: 8px 12px;
  border-radius: var(--r-btn);
  background: transparent;
  font-size: 14px;
  line-height: 18px;
  font-weight: 500;
}

.id-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
  line-height: 18px;
  color: var(--c-text-30);
}
.id-tag img { width: 14px; height: 14px; }

.money-green { color: var(--c-green); font-weight: 700; }
.money-red { color: var(--c-red); font-weight: 700; }

/* ==========================================================================
   Главная
   ========================================================================== */

.balance {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 var(--pad);
  padding: 16px;
  height: 128px;
  border-radius: var(--r-card);
  background: var(--c-surface);
  overflow: hidden;
}
.balance__col { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 7px; width: 130px; }
.balance__label { font-size: 14px; line-height: 16px; font-weight: 500; color: var(--c-text-60); }
.balance__value { font-size: 32px; line-height: 36px; font-weight: 500; white-space: nowrap; }
.balance__img {
  position: absolute;
  top: 10px;
  left: 148px;
  width: 256px;
  height: 144px;
  object-fit: contain;
  pointer-events: none;
}

.promo { display: flex; gap: 10px; padding: 0 var(--pad); margin-top: 10px; }
.promo__card {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 96px;
  padding: 12px;
  border-radius: var(--r-card);
  overflow: hidden;
}
.promo__card--amber { background: var(--c-tile-amber); }
.promo__card--violet { background: var(--c-tile-violet-soft); }
.promo__text { width: 100%; display: flex; flex-direction: column; gap: 5px; }
.promo__title { font-size: 12px; line-height: 14px; font-weight: 500; }
.promo__sub { font-size: 10px; line-height: 12px; color: var(--c-text-60); padding-right: 30px; }
.promo__icon {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 32px;
  height: 32px;
  object-fit: contain;
  object-position: right bottom;
  pointer-events: none;
}

.live-badge { display: inline-flex; align-items: center; gap: 4px; }
.live-badge::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 100px;
  background: var(--c-live);
}
.live-badge span { font-size: 12px; line-height: 13px; font-weight: 500; color: var(--c-text-60); }

/* Бегущая лента выплат */
.ticker {
  position: relative;
  overflow: hidden;
  padding: 0 var(--pad) 4px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 24px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 24px), transparent);
}
.ticker__track {
  display: flex;
  gap: 8px;
  width: max-content;
  will-change: transform;
}
.ticker.is-paused .ticker__track { animation-play-state: paused; }

.live-card {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 112px;
  height: 56px;
  padding: 10px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-card);
  background: var(--c-white);
}
.live-card__body { display: flex; flex-direction: column; min-width: 0; }
.live-card__name { font-size: 12px; line-height: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-card__sum { font-size: 12px; line-height: 14px; font-weight: 700; color: var(--c-green); white-space: nowrap; }

.tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 var(--pad);
}
.tile {
  position: relative;
  display: flex;
  gap: 8px;
  height: 96px;
  padding: 12px;
  border-radius: var(--r-card);
  overflow: hidden;
  text-align: left;
}
.tile__body { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 8px; }
.tile__head { display: flex; flex-direction: column; gap: 6px; }
.tile__title { font-size: 12px; line-height: 14px; font-weight: 500; max-width: 96px; }
.tile__sum { font-size: 16px; line-height: 18px; font-weight: 700; }
.tile__meta { display: flex; align-items: center; gap: 4px; font-size: 10px; line-height: 12px; color: var(--c-text-60); }
.tile__meta img { width: 10px; height: 10px; }
.tile__img {
  position: absolute;
  right: -8px;
  bottom: -4px;
  width: 76px;
  height: 76px;
  object-fit: contain;
  pointer-events: none;
}
.tile--violet { background: var(--c-tile-violet); }
.tile--blue { background: var(--c-tile-blue); }
.tile--green { background: var(--c-tile-green); }
.tile--amber { background: var(--c-tile-amber); }
.tile--red { background: var(--c-tile-red); }
.tile--muted { background: var(--c-surface); }

/* ==========================================================================
   Задания
   ========================================================================== */

.task-list { display: flex; flex-direction: column; gap: 10px; padding: 0 var(--pad); }

.task-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 16px;
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--r-card);
  box-shadow: var(--sh-low);
  text-align: left;
  width: 100%;
}
.task-card__top { display: flex; justify-content: space-between; gap: 12px; }
.task-card__info { display: flex; flex-direction: column; gap: 10px; max-width: 250px; }
.task-card__title { font-size: 16px; font-weight: 500; }
.task-card__desc { font-size: 14px; line-height: 18px; color: var(--c-text-60); }
.task-card__sum { flex: none; font-size: 16px; font-weight: 700; color: var(--c-green); }

/* Карточка задания (детально) */

.task-desc {
  margin: 12px var(--pad) 0;
  font-size: 14px;
  line-height: 18px;
  color: var(--c-text-60);
}

.like-btn { flex: none; padding: 4px; opacity: 0.35; transition: opacity 0.15s ease, transform 0.15s ease; }
.like-btn.is-active { opacity: 1; transform: scale(1.05); }
.like-btn img { width: 20px; height: auto; }

.steps {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 0 var(--pad);
}
.step { display: flex; align-items: center; gap: 8px; }
.step img { flex: none; width: 24px; height: 24px; }
.step span { font-size: 13px; line-height: 1.25; }

.facts {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 3px;
  margin: 0 var(--pad);
  height: 148px;
  padding: 12px 16px;
  border-radius: var(--r-card);
  background: var(--c-surface);
}
.facts__row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.facts__value { font-size: 24px; line-height: 28px; font-weight: 500; }
.facts__value--green { color: var(--c-green); }
.facts__label { margin-top: 3px; font-size: 12px; line-height: 14px; color: var(--c-text-60); }
.facts__divider { height: 1px; background: var(--c-text-10); }

/* ==========================================================================
   Приглашения
   ========================================================================== */

.invite-hero {
  position: relative;
  margin: 0 var(--pad);
  height: 234px;
  padding: 16px;
  border-radius: var(--r-card);
  background: var(--c-surface);
  overflow: hidden;
}
.invite-hero__title { position: relative; z-index: 1; width: 160px; font-size: 24px; line-height: 28px; font-weight: 500; }
.invite-hero__sub {
  position: relative;
  z-index: 1;
  width: 130px;
  margin-top: 24px;
  font-size: 14px;
  line-height: 16px;
  font-weight: 500;
  color: var(--c-text-60);
}
.invite-hero__img {
  position: absolute;
  top: 12px;
  right: -14px;
  width: 210px;
  height: 168px;
  object-fit: contain;
  pointer-events: none;
}
.invite-hero__actions {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.ref-field {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--r-field);
  background: var(--c-white);
  font-size: 13px;
  line-height: 18px;
}
.ref-field img { width: 16px; height: 16px; }
.invite-hero__actions .btn { flex: none; border-radius: var(--r-field); font-size: 12px; line-height: 16px; }

.stats { display: flex; gap: 10px; padding: 0 var(--pad); height: 148px; }
.stats__main {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  width: 176px;
  padding: 12px 16px;
  border-radius: var(--r-card);
  background: var(--c-tile-amber);
}
.stats__col { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.stats__cell {
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px;
  border-radius: var(--r-card);
  background: var(--c-surface);
}
.stats__value { font-size: 24px; line-height: 28px; font-weight: 500; }
.stats__label { margin-top: 3px; font-size: 12px; line-height: 14px; color: var(--c-text-60); }
.stats__divider { height: 1px; background: var(--c-text-10); }
.stats__icon { width: auto; height: 20px; }
.stats__main .stats__icon { position: absolute; right: 16px; bottom: 12px; }

.friend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-card);
}
.friend__left { display: flex; align-items: center; gap: 10px; }
.friend__name { font-size: 14px; line-height: 18px; }
.friend__sum { font-size: 14px; line-height: 18px; }

/* ==========================================================================
   Профиль
   ========================================================================== */

.user-item {
  margin: 0 var(--pad);
  padding: 12px;
  border-radius: var(--r-card);
  background: var(--c-surface);
}
.user-item__row { display: flex; align-items: center; gap: 12px; padding: 2px 4px; }
.user-item__text { display: flex; flex-direction: column; gap: 2px; padding: 2px 0; }
.user-item__name { font-size: 16px; line-height: 20px; }
.user-item__id { display: flex; align-items: center; gap: 5px; font-size: 14px; line-height: 16px; color: var(--c-text-60); }
.user-item__id img { width: 14px; height: 14px; }
.user-item__badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 6px;
  border-radius: 8px;
  background: var(--c-white);
  font-size: 14px;
  line-height: 16px;
}
.badge img { width: 14px; height: 14px; }

/* Профиль: карточки статистики (2×2 при активной серии) */
.pstats { display: flex; flex-direction: column; gap: 10px; padding: 0 var(--pad); margin-top: 10px; }
.pstats__row { display: flex; gap: 10px; align-items: stretch; }

.p-card {
  position: relative;
  border-radius: var(--r-card);
  background: var(--c-surface);
  overflow: hidden;
}
.p-card--sq { flex: none; width: 128px; padding: 16px; }
.p-card--fill { flex: 1; min-width: 0; padding: 16px; }
.p-card--h128 { min-height: 128px; }
.p-card--h96 { min-height: 96px; }

.p-card__value {
  position: relative;
  z-index: 1;
  font-size: 24px;
  line-height: 28px;
  font-weight: 500;
  white-space: nowrap;
}
.p-card__value--md { font-size: 16px; line-height: 18px; }
.p-card__label {
  position: relative;
  z-index: 1;
  margin-top: 3px;
  font-size: 12px;
  line-height: 14px;
  color: var(--c-text-60);
}
.p-card__img {
  position: absolute;
  right: -22px;
  top: -18px;
  width: 120px;
  height: 120px;
  object-fit: contain;
  pointer-events: none;
}
.p-card__img--total { right: -30px; top: auto; bottom: -22px; width: 104px; height: 104px; }
.p-card__img--streak { right: -10px; bottom: -8px; top: auto; width: 84px; height: 84px; }

/* Баланс внутри профиля (компактный) */
.p-balance {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 128px;
  padding: 12px 16px;
  border-radius: var(--r-card);
  background: var(--c-surface);
  overflow: hidden;
}
.p-balance__col { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 6px; }
.p-balance__label { font-size: 14px; line-height: 16px; font-weight: 500; color: var(--c-text-60); }
.p-balance__value { font-size: 32px; line-height: 36px; font-weight: 500; white-space: nowrap; }
.p-balance__img {
  position: absolute;
  right: -18px;
  bottom: -6px;
  top: auto;
  width: 132px;
  height: 96px;
  object-fit: contain;
  pointer-events: none;
}
.p-balance .btn { position: relative; z-index: 1; align-self: flex-start; }

.progress {
  position: relative;
  z-index: 1;
  width: 96px;
  height: 8px;
  margin-top: 11px;
  border-radius: 100px;
  background: var(--c-border);
  overflow: hidden;
}
.progress__bar { height: 100%; border-radius: 100px; background: var(--c-yellow); }

.counters { display: flex; gap: 10px; padding: 0 var(--pad); margin-top: 10px; }
.counter {
  flex: 1;
  display: flex;
  align-items: flex-end;
  height: 69px;
  padding: 12px 16px;
  border-radius: var(--r-card);
  background: var(--c-surface);
}
.counter__value { font-size: 20px; line-height: 28px; font-weight: 500; }
.counter__label { margin-top: 3px; font-size: 12px; line-height: 14px; color: var(--c-text-60); }

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-card);
}
.history-item__name { font-size: 14px; line-height: 18px; }
.history-item__time { margin-top: 3px; font-size: 12px; line-height: 14px; color: var(--c-text-60); }
.history-item__sum { font-size: 14px; line-height: 18px; }

/* ---------- Блок FAQ + подвал ---------- */

.faq {
  margin-top: 32px;
  padding: 32px 0 24px;
  border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  background: var(--c-text);
  color: var(--c-white);
}
.faq__title { text-align: center; font-size: 24px; line-height: 28px; font-weight: 700; }
.faq__list { margin-top: 24px; }
.faq__item { padding: 0 var(--pad); border-top: 1px solid rgba(195, 188, 255, 0.2); }
.faq__item:first-child { border-top: 0; }
.faq__btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 16px 0;
  text-align: left;
  font-size: 16px;
  line-height: 18px;
  font-weight: 500;
  color: var(--c-footer-text);
}
.faq__ic { position: relative; flex: none; width: 28px; height: 28px; }
.faq__ic::before,
.faq__ic::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 2px;
  background: var(--c-footer-text);
  transition: transform 0.22s ease, background 0.2s ease;
}
.faq__ic::before { width: 24px; height: 3px; transform: translate(-50%, -50%); }
.faq__ic::after { width: 3px; height: 24px; transform: translate(-50%, -50%); }
.faq__item.is-open .faq__btn { color: var(--c-white); }
/* активный (открытый) пункт: значок становится сиреневым, вертикальная палочка
   схлопывается → плюс превращается в минус; неактивные закрытые — серые */
.faq__item.is-open .faq__ic::before,
.faq__item.is-open .faq__ic::after { background: #c3bcff; }
.faq__item.is-open .faq__ic::after { transform: translate(-50%, -50%) scaleY(0); }
.faq__answer { display: none; padding-bottom: 16px; font-size: 14px; line-height: 18px; }
.faq__item.is-open .faq__answer { display: block; }

.footer { padding: 32px var(--pad) 24px; background: var(--c-text); border-radius: 24px 24px 0 0; }
.footer--gap { margin-top: 32px; }
.footer--rounded { border-radius: var(--r-sheet) var(--r-sheet) 0 0; }
.footer__logo { width: 185px; height: 32px; }
.footer__links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
  font-size: 14px;
  line-height: 25px;
  color: var(--c-footer-text);
}

/* ==========================================================================
   Испытай удачу
   ========================================================================== */

.luck-hero {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0 var(--pad);
  padding: 16px;
  border-radius: var(--r-card);
  background: var(--c-tile-amber);
}
.luck-hero__top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.luck-hero__title { font-size: 16px; line-height: 18px; font-weight: 700; }
.luck-hero__text { margin-top: 6px; max-width: 258px; font-size: 14px; line-height: 18px; }
.luck-hero__img { flex: none; width: 72px; height: 72px; object-fit: contain; }

.prizes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 10px; padding: 0 var(--pad); }
.prize {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-card);
  min-width: 0;
}
.prize img { flex: none; width: 48px; height: 48px; object-fit: contain; }
.prize__img--round { border-radius: 100px; overflow: hidden; }
.prize__text { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.prize__title { font-size: 12px; font-weight: 500; }
.prize__sub { font-size: 10px; line-height: 1.2; color: var(--c-text-60); }
.prize--jackpot { background: var(--grad-plus); border-color: var(--c-border); }
.prize--jackpot .prize__title,
.prize--jackpot .prize__sub { color: var(--c-white); }

/* ==========================================================================
   Бонус (карточки)
   ========================================================================== */

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, var(--cw, 100px));
  justify-content: center;
  align-content: start;
  gap: var(--rgap, 14px) var(--cgap, 20px);
  padding: 0 24px;
}
.lucky-card {
  position: relative;
  width: var(--cw, 100px);
  height: calc(var(--cw, 100px) * 1.777);
  border-radius: calc(var(--cw, 100px) * 0.125);
  box-shadow: var(--sh-low);
  background: center / 100% 100% no-repeat url("../assets/img/card-back.png");
  transition: transform 0.18s ease;
}
.lucky-card:active { transform: scale(0.97); }
.lucky-card.is-open {
  background-image: url("../assets/img/card-jackpot.png");
  border: calc(var(--cw, 100px) * 0.025) solid var(--c-orange);
}
.lucky-card.is-empty {
  background-image: none;
  background: var(--c-white);
  border: 2px solid rgba(52, 52, 72, 0.06);
  box-shadow: var(--sh-low);
}
.lucky-card__face {
  display: none;
  position: absolute;
  inset: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px;
  text-align: center;
}
.lucky-card.is-open .lucky-card__face,
.lucky-card.is-empty .lucky-card__face { display: flex; }
.lucky-card__face span {
  font-size: calc(var(--cw, 100px) * 0.13);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.2px;
  white-space: nowrap;
}
.lucky-card__face img { width: calc(var(--cw, 100px) * 0.28); height: auto; }
.lucky-card.is-empty .lucky-card__face { color: var(--c-text-30); }
.lucky-card.is-empty .lucky-card__face span { font-weight: 700; letter-spacing: 0; }
.lucky-card.is-empty .lucky-card__face img { display: none; }

/* Счётчик попыток */
.attempts {
  margin: 10px auto 0;
  max-width: 280px;
  text-align: center;
}
.attempts__title { font-size: 14px; line-height: 18px; font-weight: 500; }
.attempts__used { margin-top: 4px; font-size: 12px; line-height: 14px; color: var(--c-text-60); }

.cards-note {
  margin: 24px auto 0;
  max-width: 240px;
  text-align: center;
  font-size: 12px;
  line-height: 14px;
  color: var(--c-text-60);
}

/* ==========================================================================
   Нижнее меню
   ========================================================================== */

.nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--app-w);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--nav-h);
  padding: 8px 24px calc(8px + env(safe-area-inset-bottom, 0px));
  background: var(--c-menu-bg);
}
.nav__btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  min-width: 48px;
  padding: 8px 0;
  opacity: 0.5;
  transition: opacity 0.15s ease;
}
.nav__btn img { height: 24px; width: auto; }
.nav__btn span { font-size: 12px; line-height: 16px; font-weight: 500; white-space: nowrap; }
.nav__btn.is-active { opacity: 1; }
.nav__btn.is-active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 48px;
  height: 3px;
  border-radius: 2px;
  background: var(--c-yellow);
}

/* ==========================================================================
   Шторки и модальные окна
   ========================================================================== */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  background: rgba(52, 52, 72, 0.6);
}
.overlay.is-open { display: block; }

.sheet {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--app-w);
  bottom: 0;
  max-height: 92%;
  padding: 32px 0 24px;
  border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  background: var(--c-white);
  overflow-y: auto;
  animation: sheet-up 0.28s ease;
}
@keyframes sheet-up {
  from { transform: translateX(-50%) translateY(18px); opacity: 0.6; }
  to { transform: translateX(-50%); opacity: 1; }
}

.sheet__title { text-align: center; font-size: 24px; line-height: 28px; font-weight: 500; }
.sheet__subtitle { margin-top: 24px; text-align: center; font-size: 14px; line-height: 18px; }
.sheet__text { margin: 24px var(--pad) 0; font-size: 13px; line-height: 1.45; }
.sheet__actions { margin: 24px var(--pad) 0; display: flex; flex-direction: column; gap: 8px; }

.sum-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 24px var(--pad) 0;
  padding: 12px 16px;
  border-radius: var(--r-field);
  background: var(--c-surface);
}
.sum-row__label { font-size: 14px; line-height: 16px; font-weight: 500; color: var(--c-text-60); }
.sum-row__value { font-size: 24px; line-height: 28px; font-weight: 500; }
.sum-row--light { background: #f7f7f9; }

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 10px var(--pad) 0;
  padding: 12px;
  border-radius: var(--r-field);
  background: var(--c-surface-2);
}
.field__label { font-size: 10px; line-height: 12px; color: var(--c-text-60); }
.field__row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.field__value { flex: 1; min-width: 0; font-size: 13px; line-height: 18px; font-weight: 500; }
.field__value input::placeholder { color: var(--c-text-30); font-weight: 500; opacity: 1; }
.field__value input:focus,
.field__value input:focus-visible { outline: none; }
.field__value input {
  width: 100%;
  border: 0;
  padding: 0;
  background: none;
  font: 500 16px/18px var(--font);
  color: var(--c-text);
}
.field__icon { flex: none; height: 16px; width: auto; }
.field__bank { flex: none; width: 22px; height: 22px; object-fit: contain; }
.field__chevron { flex: none; width: 14px; height: auto; transition: transform 0.2s ease; }

/* Выпадающий список банка */
.field--select { position: relative; }
.bank-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  margin-top: 5px;
  padding: 0;
  background: none;
}
.bank-cur { display: flex; align-items: center; gap: 8px; }
.bank-cur__icon { width: 20px; height: 20px; border-radius: 50%; flex: none; }
.bank-toggle[aria-expanded="true"] .field__chevron { transform: rotate(180deg); }
.bank-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 6;
  display: flex;
  flex-direction: column;
  padding: 6px;
  border-radius: var(--r-field);
  background: var(--c-white);
  box-shadow: 0 8px 24px rgba(20, 22, 40, 0.16), 0 0 0 1px var(--c-border);
}
.bank-opt {
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 18px;
}
.bank-opt:hover, .bank-opt.is-active { background: var(--c-surface); }

.pay-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin: 24px var(--pad);
}
.pay-logos img { height: 20px; width: auto; }
.pay-logos img:last-child { height: 24px; }

.code-box {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 24px var(--pad) 0;
  padding: 12px 16px;
  border-radius: var(--r-field);
  background: var(--c-surface);
  font-size: 24px;
  line-height: 28px;
  font-weight: 500;
}
.code-box span { color: var(--c-text-60); margin-right: 6px; }

/* Модалка выигрыша */

.win {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  overflow: hidden;
  background: rgba(52, 52, 72, 0.6);
}
.win.is-open { display: block; }
.win__sheet {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--app-w);
  bottom: 0;
  max-height: 94dvh;
  padding: 24px 0;
  border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  background: var(--c-white);
  overflow: hidden;
  animation: sheet-up 0.3s ease;
}
/* Анимированное конфетти */
.confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 3;
}
.confetti i {
  position: absolute;
  top: -12%;
  border-radius: 2px;
  opacity: 0.95;
  animation-name: confFall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
@keyframes confFall {
  0% { transform: translateY(-20px) rotate(0deg); opacity: 0; }
  8% { opacity: 1; }
  100% { transform: translateY(105dvh) rotate(720deg); opacity: 0.9; }
}
.win__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  max-height: calc(94dvh - 48px);
  overflow-y: auto;
}
.win__title { text-align: center; font-size: 24px; line-height: 28px; font-weight: 500; }
.win__sub { margin: 12px auto 0; max-width: 240px; text-align: center; font-size: 14px; line-height: 18px; }
.win__sub b { font-weight: 500; }
.win__hero { width: 118px; height: auto; margin: 12px auto 0; object-fit: contain; }
.win__prize {
  margin: 16px var(--pad) 0;
  padding: 14px 16px;
  border-radius: var(--r-field);
  background: #f7f7f9;
  text-align: center;
}
.win__prize-label { font-size: 14px; line-height: 12px; font-weight: 500; color: var(--c-text-60); }
.win__prize-card {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 176px;
  margin: 12px auto 0;
  padding: 12px 16px;
  border-radius: var(--r-card);
  border: 1px solid var(--c-border);
  background: var(--grad-plus);
  color: var(--c-white);
  text-align: left;
}
.win__prize-card img { flex: none; width: 48px; height: 48px; }
.win__prize-sum { font-size: 12px; font-weight: 700; }
.win__prize-desc { margin-top: 5px; font-size: 10px; line-height: 1.2; }

/* ==========================================================================
   Адаптив
   ========================================================================== */

@media (max-width: 393px) {
  .balance__col { width: 120px; }
  .prize { padding: 12px; }
}

@media (min-width: 420px) {
  body { padding: 24px 0; background: #dfe1e7; }
  .app { min-height: calc(100vh - 48px); border-radius: 28px; box-shadow: 0 24px 60px rgba(20, 22, 40, 0.18); }
  .app__scroll { min-height: calc(100vh - 48px); }
}
