/* Mini App — светлая тема (референс: чистые карточки, синий акцент) */
html {
  color-scheme: light;
}

:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --text: #1a1a1a;
  --muted: #6b7280;
  --accent: #00a3ff;
  --accent-hover: #0088d4;
  --accent-soft: rgba(0, 163, 255, 0.12);
  --radius: 14px;
  --shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 32px rgba(15, 23, 42, 0.08);
  --nav-h: 58px;
  --safe-bottom: env(safe-area-inset-bottom, 12px);
  --hairline: #e8eaed;
  --lottery-item-w: 92px;
  --lottery-gap: 8px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100%;
  padding-bottom: calc(var(--nav-h) + var(--safe-bottom));
}

.ico {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: inherit;
  display: block;
}

.ico--sm {
  width: 18px;
  height: 18px;
}

.ico--lg {
  width: 48px;
  height: 48px;
}

.ico--hero {
  width: 56px;
  height: 56px;
  color: var(--accent);
}

.modal-icon-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
  border-bottom: 1px solid var(--hairline);
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.user-pill img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--hairline);
}

.user-pill .name {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
  color: var(--text);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stars-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff8e6;
  color: var(--text);
  padding: 6px 12px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 14px;
}

.btn-withdraw {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}

.btn-withdraw:active {
  opacity: 0.92;
}

.status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: var(--bg);
}

/* Демо-лента «выигрышей» (клиентская имитация) */
.fake-wins-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 10px;
  margin-top: -4px;
  background: var(--bg);
  min-height: 28px;
}

.fake-wins-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
  animation: fake-pulse 2s ease-in-out infinite;
}

@keyframes fake-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

.fake-wins-text {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
  flex: 1;
  min-width: 0;
  transition: opacity 0.35s ease;
}

.fake-wins-text.is-fading {
  opacity: 0.35;
}

.online-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #e8f4fc;
  color: #0c4a6e;
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
}

.inventory-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  flex: 1;
  padding-bottom: 4px;
}

.inv-slot {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #e5e7eb;
  flex-shrink: 0;
}

.inv-slot--img {
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.page-title--hidden {
  display: none;
}

/* Герой Swiper (главная) — отступы по бокам как у остального контента */
.home-hero-wrap {
  margin: 4px 0 16px;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.home-hero-swiper {
  width: 100%;
  border-radius: 18px;
  overflow: hidden;
}

.home-hero-swiper .swiper-slide {
  height: auto;
}

.home-hero-slide {
  position: relative;
  min-height: 148px;
  background-image: var(--hero-bg);
  background-size: cover;
  background-position: center;
  border-radius: 18px;
  overflow: hidden;
}

.home-hero-slide__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    rgba(15, 23, 42, 0.72) 0%,
    rgba(15, 23, 42, 0.35) 45%,
    rgba(0, 80, 140, 0.25) 100%
  );
}

.home-hero-slide__text {
  position: relative;
  z-index: 1;
  padding: 18px 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 148px;
  justify-content: flex-end;
}

.home-hero-slide__line1 {
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.03em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

.home-hero-slide__line2 {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
  line-height: 1.35;
  max-width: 92%;
}

.home-hero-pagination.swiper-pagination-bullets {
  bottom: 10px !important;
}

.home-hero-pagination .swiper-pagination-bullet {
  width: 7px;
  height: 7px;
  background: rgba(255, 255, 255, 0.45);
  opacity: 1;
}

.home-hero-pagination .swiper-pagination-bullet-active {
  background: var(--accent);
  width: 18px;
  border-radius: 6px;
}

.home-tasks-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 0 2px;
}

.home-tasks-head__star {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.home-tasks-head__star .task-card-reward-star {
  width: 20px;
  height: 20px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.12));
}

.home-tasks-head__title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.25;
}

.task-filter-scroll-wrap {
  margin: 0 -14px 14px;
  padding: 0 14px;
}

.task-filter-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.task-filter-scroll::-webkit-scrollbar {
  display: none;
}

.task-filter-pill {
  flex-shrink: 0;
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.task-filter-pill.is-active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 4px 14px rgba(0, 163, 255, 0.35);
}

.home-task-list .task-item.home-filter-hidden {
  display: none;
}

.home-empty-card {
  margin-top: 8px;
}

.page-wrap {
  padding: 12px 14px 24px;
  max-width: 520px;
  margin: 0 auto;
}

.page-title {
  font-size: 20px;
  font-weight: 700;
  margin: 4px 0 14px;
  color: var(--text);
  letter-spacing: -0.02em;
}

.muted {
  color: var(--muted);
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  border: 1px solid var(--hairline);
  color: var(--text);
}

.card h2 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.card p.muted {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
}

/* Карточка задания (референс: аватар | контент | кнопка) */
.task-item {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  border-radius: 18px;
  background: var(--surface);
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  border: 1px solid var(--hairline);
  overflow: hidden;
}

.task-card-inner {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 12px;
  padding: 14px 14px 10px;
  min-height: 104px;
}

.task-card-avatar-wrap {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(145deg, #e0f2fe, #bae6fd);
  position: relative;
}

.task-card-avatar-wrap .task-card-avatar-letter {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 0;
}

.task-card-avatar-wrap--empty {
  display: flex;
  align-items: center;
  justify-content: center;
}

.task-card-avatar {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.task-card-avatar-letter {
  font-size: 20px;
  font-weight: 800;
  color: var(--accent);
}

.task-card-center {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-right: 4px;
}

.task-card-title {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.25;
  color: var(--text);
}

.task-card-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
  margin-top: 2px;
}

.task-card-reward-label {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}

.task-card-reward-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}

.task-card-reward-num {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

.task-card-reward-star {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.task-card-hint {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.task-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  align-items: center;
}

.task-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  max-width: 100%;
  white-space: nowrap;
}

.task-tag--tone-0 {
  background: #dcfce7;
  color: #166534;
}

.task-tag--tone-1 {
  background: #ffedd5;
  color: #c2410c;
}

.task-tag--tone-2 {
  background: #e0f2fe;
  color: #0369a1;
}

.task-tag--hit {
  background: #e0f2fe;
  color: #0369a1;
}

.task-tag--promo {
  background: #ffedd5;
  color: #c2410c;
}

.task-tag--exclusive {
  background: #fce7f3;
  color: #be185d;
}

.task-tag--new {
  background: #dcfce7;
  color: #166534;
}

.task-tag--more {
  background: #f3f4f6;
  color: var(--muted);
  font-weight: 600;
}

.task-card-actions {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  flex-shrink: 0;
  width: 112px;
}

.task-card-btn {
  border: none;
  border-radius: 12px;
  padding: 12px 10px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(36, 129, 204, 0.35);
  white-space: nowrap;
}

.task-card-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.task-card-btn-secondary {
  background: #f3f4f6;
  color: var(--text);
  box-shadow: none;
  border: 1px solid var(--hairline);
}

.task-item.task-done {
  opacity: 0.85;
}

.task-item.task-done .task-card-btn {
  background: #e5e7eb;
  color: var(--muted);
  box-shadow: none;
}

.task-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.task-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}

.task-reward {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #ca8a04;
  font-weight: 700;
  white-space: nowrap;
}

.task-reward .ico--sm {
  color: #ca8a04;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  width: 100%;
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-secondary {
  background: #f3f4f6;
  color: var(--text);
  border: 1px solid var(--hairline);
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
}

.nav-bottom {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--hairline);
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: space-between;
  align-items: stretch;
  gap: 2px;
  padding: 6px 6px calc(8px + var(--safe-bottom));
}

.nav-item {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-align: center;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  padding: 6px 2px;
  border-radius: 10px;
  border: none;
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
}

.nav-item .ico {
  color: var(--muted);
}

.nav-item.active {
  color: var(--accent);
  font-weight: 700;
  background: var(--accent-soft);
}

.nav-item.active .ico {
  color: var(--accent);
}

.nav-label {
  display: block;
  font-size: 9px;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

/* Блюр заднего плана только у модалки при первом входе (онбординг) */
#onboarding:not(.hidden) {
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.modal-box {
  background: var(--surface);
  border-radius: 20px;
  padding: 24px;
  max-width: 340px;
  width: 100%;
  position: relative;
  text-align: center;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--hairline);
  color: var(--text);
}

.withdraw-modal-box {
  max-width: 360px;
  text-align: left;
}

.withdraw-modal-title {
  text-align: center;
}

.withdraw-limits {
  margin: -4px 0 12px;
  font-size: 13px;
  text-align: center;
}

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

.withdraw-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--hairline);
  font-size: 16px;
  font-weight: 600;
  background: #fafbfc;
  color: var(--text);
}

.withdraw-input::placeholder {
  color: #9ca3af;
  font-weight: 500;
}

.withdraw-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.withdraw-chip {
  flex: 1 1 calc(33.33% - 8px);
  min-width: 72px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1.5px solid var(--accent);
  background: #fff;
  color: var(--accent);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}

.withdraw-chip:active {
  opacity: 0.9;
  background: var(--accent-soft);
}

.withdraw-section-label {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.withdraw-section-label--inv {
  margin-top: 4px;
}

.withdraw-method {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--hairline);
  background: #fafbfc;
  margin-bottom: 12px;
}

.withdraw-method__ico {
  font-size: 20px;
  line-height: 1;
}

.withdraw-method__name {
  flex: 1;
  font-weight: 600;
  font-size: 14px;
}

.withdraw-method__check {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
}

.withdraw-inv-placeholder {
  font-size: 13px;
  padding: 10px 0 16px;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 16px;
}

.withdraw-submit {
  width: 100%;
  padding: 14px;
  font-size: 15px;
}

.modal-prize {
  max-width: 320px;
}

/* Модалка «Поздравляем!» — звезда, сумма, «Доступ за 1₽», дисклеймер */
.modal-win {
  padding: 28px 22px 24px;
  max-width: 340px;
  background: #ffffff;
  text-align: center;
}

.modal-win__title {
  margin: 0 0 16px;
  font-size: 22px;
  font-weight: 800;
  color: #000000;
  letter-spacing: -0.02em;
}

.modal-win__star {
  display: flex;
  justify-content: center;
  margin: 0 0 12px;
}

.modal-win__star-svg {
  width: 88px;
  height: 88px;
  filter: drop-shadow(0 4px 12px rgba(251, 191, 36, 0.35));
}

.modal-win__value {
  margin: 0 0 8px;
  font-size: 40px;
  font-weight: 800;
  line-height: 1.1;
  color: #000000;
  letter-spacing: -0.03em;
}

.modal-win__claim {
  margin: 0 0 22px;
  font-size: 16px;
  font-weight: 600;
  color: #000000;
  line-height: 1.35;
}

.modal-win__cta {
  width: 100%;
  padding: 14px 18px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 14px;
  background: #3b99fc;
  border: none;
  margin-bottom: 16px;
}

.modal-win__cta:hover {
  filter: brightness(1.03);
}

.modal-win__disclaimer {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: #777777;
  text-align: center;
}

.modal-win__cta.hidden {
  display: none;
}

.modal-win__disclaimer.hidden {
  display: none;
}

.prize-modal-img {
  width: 112px;
  height: 112px;
  object-fit: cover;
  border-radius: 16px;
  margin: 0 auto 16px;
  display: block;
  box-shadow: var(--shadow);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  border: none;
  background: none;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}

.modal-title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.modal-sub {
  margin: 0 0 20px;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-actions .btn-primary,
.modal-actions .btn-secondary {
  width: 100%;
}

.modal-actions--onboard {
  margin-top: 4px;
}

.modal-actions--onboard.modal-actions--row {
  flex-direction: row;
  align-items: stretch;
  gap: 10px;
}

.modal-actions--onboard.modal-actions--row .btn-primary {
  flex: 1;
  min-width: 0;
  width: auto;
}

/* Кнопка копирования только иконкой (онбординг + друзья) */
.btn-copy-icon-only {
  flex-shrink: 0;
  width: 52px;
  min-height: 48px;
  border-radius: 12px;
  border: 1px solid var(--hairline);
  background: #f3f4f6;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  position: relative;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-copy-icon-only:active {
  background: #e5e7eb;
}

.btn-copy-icon-only--success {
  background: #dcfce7;
  border-color: #86efac;
  color: #15803d;
}

.btn-copy-icon-only .ico {
  width: 22px;
  height: 22px;
}

.btn-copy-icon-only__ok .ico {
  stroke: currentColor;
}

/* Блюр основного UI при копировании на вкладке «Друзья» */
/* Тост, если showAlert недоступен (например вне Telegram) */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 24px);
  transform: translateX(-50%);
  z-index: 400;
  max-width: min(90vw, 320px);
  padding: 12px 18px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  pointer-events: none;
  animation: toast-in 0.25s ease;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.invite-row--stack {
  flex-direction: column;
}

.invite-row--stack .btn-primary,
.invite-row--stack .btn-secondary {
  width: 100%;
}

.podium {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 8px;
  margin: 16px 0;
}

.podium-item {
  text-align: center;
  flex: 1;
  max-width: 100px;
}

.podium-item .av {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #e5e7eb;
  margin: 0 auto 6px;
  line-height: 56px;
  font-size: 24px;
  color: var(--text);
}

.podium-item.p1 .av {
  width: 72px;
  height: 72px;
  line-height: 72px;
  font-size: 28px;
}

.podium-item .nm {
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}

.podium-item .sc {
  font-size: 14px;
  color: var(--accent);
  font-weight: 700;
}

.me-rank-card {
  border-left: 4px solid var(--accent);
  padding: 12px;
  margin-top: 12px;
  border-radius: 12px;
  background: #f8fafc;
}

.me-rank-num {
  font-size: 22px;
  font-weight: 800;
  color: var(--accent);
}

/* Лидерборд (неделя UTC, топ за период) */
.lb-page {
  padding-bottom: 8px;
}

.lb-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.lb-header__left {
  display: flex;
  gap: 12px;
  min-width: 0;
}

.lb-header__ico {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(145deg, #38bdf8, #0ea5e9);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.35);
}

.lb-header__ico svg {
  width: 22px;
  height: 22px;
}

.lb-header__title {
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.02em;
  color: var(--text);
}

.lb-header__sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.35;
}

.lb-timer {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f1f5f9;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.lb-timer__ico {
  display: flex;
  width: 16px;
  height: 16px;
}

.lb-timer__ico svg {
  width: 16px;
  height: 16px;
}

.lb-podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  margin: 0 0 8px;
  padding: 0 2px;
}

.lb-podium__col {
  flex: 1;
  max-width: 112px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.lb-podium__col--1 {
  max-width: 120px;
  order: 2;
}

.lb-podium__col--2 {
  order: 1;
}

.lb-podium__col--3 {
  order: 3;
}

.lb-podium__prize-wrap {
  position: relative;
  width: 100%;
  max-width: 88px;
  margin: 0 auto 8px;
}

.lb-podium__col--1 .lb-podium__prize-wrap {
  max-width: 96px;
}

.lb-podium__prize {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15);
  border: 3px solid #fff;
  background-color: #1e293b;
}

.lb-podium__prize--ph {
  background: linear-gradient(145deg, #e2e8f0, #cbd5e1);
  border: 2px dashed #94a3b8;
}

.lb-podium__ava {
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(145deg, #34d399, #059669);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.lb-podium__col--1 .lb-podium__ava {
  width: 40px;
  height: 40px;
  font-size: 13px;
}

.lb-podium__nm {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: 2.5em;
}

.lb-podium__sc {
  font-size: 15px;
  font-weight: 800;
  color: var(--accent);
  margin-top: 2px;
}

.lb-podium__block {
  width: 100%;
  margin-top: 10px;
  border-radius: 12px 12px 0 0;
  background: var(--surface);
  box-shadow: var(--shadow);
  border: 1px solid var(--hairline);
  border-bottom: none;
  padding: 8px 0 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb-podium__col--1 .lb-podium__block {
  min-height: 88px;
  padding-top: 14px;
}

.lb-podium__col--2 .lb-podium__block {
  min-height: 64px;
}

.lb-podium__col--3 .lb-podium__block {
  min-height: 52px;
}

.lb-podium__block span {
  font-size: 28px;
  font-weight: 900;
  color: #cbd5e1;
}

.lb-podium__col--1 .lb-podium__block span {
  color: #eab308;
  font-size: 34px;
}

.lb-podium__col--2 .lb-podium__block span {
  color: #94a3b8;
}

.lb-podium__col--3 .lb-podium__block span {
  color: #ea580c;
}

.lb-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 10px;
  margin-top: 8px;
}

.lb-list-head__left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 15px;
  color: var(--text);
}

.lb-list-head__spark {
  width: 18px;
  height: 18px;
  color: var(--accent);
}

.lb-list-head__badge {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--muted);
  background: #f1f5f9;
  padding: 4px 10px;
  border-radius: 8px;
}

.lb-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.lb-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border-radius: 14px;
  padding: 10px 14px 10px 0;
  box-shadow: var(--shadow);
  border: 1px solid var(--hairline);
  position: relative;
  overflow: hidden;
}

.lb-row__strip {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 14px 0 0 14px;
  background: #e5e7eb;
}

.lb-row--gold .lb-row__strip {
  background: linear-gradient(180deg, #fbbf24, #d97706);
}

.lb-row--silver .lb-row__strip {
  background: linear-gradient(180deg, #e2e8f0, #94a3b8);
}

.lb-row--bronze .lb-row__strip {
  background: linear-gradient(180deg, #fdba74, #c2410c);
}

.lb-row__ava {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(145deg, #a7f3d0, #059669);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: 12px;
}

.lb-row__meta {
  flex: 1;
  min-width: 0;
}

.lb-row__name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}

.lb-name-ico {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.lb-row__sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.lb-row__gift {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid #f1f5f9;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.lb-row__gift img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lb-row__gift--empty {
  border: none;
  background: transparent;
  box-shadow: none;
}

.lb-row__rank {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 800;
  font-size: 14px;
  color: var(--muted);
}

.lb-empty {
  text-align: center;
  padding: 16px;
  margin-bottom: 12px;
}

.lb-me {
  margin-top: 4px;
}

.lb-me__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.lb-me__sub {
  font-size: 13px;
  margin-top: 4px;
}

.lb-me__num {
  font-size: 24px;
  font-weight: 900;
  color: var(--accent);
}

.lb-me__hint {
  margin: 10px 0 0;
  font-size: 13px;
}

/* Колесо фортуны — 8 секторов, красный/зелёный/фиолетовый, звезда + число */
.wheel-wrap {
  position: relative;
  width: min(92vw, 340px);
  height: min(92vw, 340px);
  margin: 16px auto;
  filter: drop-shadow(0 10px 28px rgba(15, 23, 42, 0.14));
}

.wheel-stack {
  position: relative;
  width: 100%;
  height: 100%;
}

.wheel-rot {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  position: relative;
  transition: transform 4.2s cubic-bezier(0.12, 0.72, 0.12, 1);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.wheel-svg {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  position: absolute;
  inset: 0;
  box-sizing: border-box;
  border: 6px solid #7dd3fc;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.wheel-labels {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
}

.wheel-seg-lbl {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 48px;
  max-width: 64px;
}

.wheel-seg-star-svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
}

.wheel-seg-num {
  font-size: 11px;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
  color: #ffffff;
  letter-spacing: -0.02em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45), 0 0 8px rgba(0, 0, 0, 0.2);
}

.wheel-pointer {
  position: absolute;
  right: -2px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 16px solid transparent;
  border-bottom: 16px solid transparent;
  border-right: 22px solid #2563eb;
  z-index: 4;
  filter: drop-shadow(0 3px 6px rgba(37, 99, 235, 0.45));
}

.wheel-center-badge {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  color: #fff;
  border: 3px solid #93c5fd;
}

.wheel-center-star {
  width: 26px;
  height: 26px;
  display: block;
}

/* Лотерея — горизонтальная рулетка */
.lottery-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.lottery-viewport {
  position: relative;
  width: 100%;
  height: 124px;
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(180deg, #eef1f5 0%, #e2e8f0 100%);
  border: 1px solid var(--hairline);
  margin-bottom: 14px;
}

.lottery-viewport::before,
.lottery-viewport::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 36px;
  z-index: 2;
  pointer-events: none;
}

.lottery-viewport::before {
  left: 0;
  background: linear-gradient(90deg, rgba(245, 246, 248, 1), transparent);
}

.lottery-viewport::after {
  right: 0;
  background: linear-gradient(270deg, rgba(245, 246, 248, 1), transparent);
}

.lottery-pointer {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 16px solid var(--accent);
  z-index: 5;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.12));
}

.lottery-track-wrap {
  position: absolute;
  left: 0;
  top: 18px;
  right: 0;
  height: 96px;
  overflow: hidden;
}

.lottery-track {
  display: flex;
  flex-direction: row;
  gap: var(--lottery-gap);
  height: 96px;
  width: max-content;
  will-change: transform;
  transition: transform 0s linear;
}

.lottery-track.is-spinning {
  transition: transform 5.2s cubic-bezier(0.08, 0.62, 0.12, 1);
}

.lottery-item {
  flex: 0 0 var(--lottery-item-w);
  width: var(--lottery-item-w);
  height: 96px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.lottery-item img {
  width: 100%;
  height: 64px;
  object-fit: cover;
  display: block;
  background: #f1f5f9;
}

.lottery-item-cap {
  flex: 1;
  padding: 4px 6px;
  font-size: 9px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lottery-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.lottery-chip {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 8px;
  background: #f1f5f9;
  color: var(--muted);
  font-weight: 600;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 12px 0;
  color: var(--text);
}

.switch {
  width: 48px;
  height: 28px;
  border-radius: 14px;
  background: #d1d5db;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
}

.switch.on {
  background: var(--accent);
}

.switch::after {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  top: 3px;
  left: 3px;
  transition: left 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.switch.on::after {
  left: 23px;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stat-card {
  border-radius: var(--radius);
  padding: 16px;
  color: #fff;
  font-weight: 700;
}

.stat-card.blue {
  background: linear-gradient(135deg, #00a3ff, #0066cc);
}

.stat-card.orange {
  background: linear-gradient(135deg, #f97316, #ea580c);
}

.promo-block {
  margin: 16px 0;
  padding: 12px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid var(--hairline);
}

.progress-track {
  height: 6px;
  background: #e5e7eb;
  border-radius: 3px;
  margin-top: 8px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.friends-list {
  font-size: 14px;
  color: var(--muted);
  text-align: center;
  padding: 24px;
}

/* Вкладка «Друзья» */
.friends-page {
  max-width: 520px;
  margin: 0 auto;
  padding-bottom: 4px;
}

.friends-hero {
  margin-bottom: 20px;
}

.friends-hero__title {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.friends-hero__sub {
  margin: 0 0 18px;
  font-size: 15px;
  color: var(--muted);
}

.friends-quest-card {
  display: flex;
  align-items: stretch;
  gap: 14px;
  background: #fff;
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
  border: 1px solid var(--hairline);
}

.friends-quest-card__icon {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(145deg, #0ea5e9, #2563eb);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.friends-quest-card__icon .ico {
  width: 28px;
  height: 28px;
}

.friends-quest-card__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}

.friends-quest-card__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.friends-quest-card__hint {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.friends-quest-card__badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
}

.friends-quest-card__badge-ico .ico {
  width: 18px;
  height: 18px;
  color: var(--accent);
}

.friends-progress-bar {
  height: 6px;
  border-radius: 4px;
  background: #e5e7eb;
  overflow: hidden;
}

.friends-progress-bar__fill {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #0ea5e9, #2563eb);
  transition: width 0.35s ease;
}

.friends-section-title {
  margin: 0 0 10px;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

.friends-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 22px;
}

.friends-stat {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  padding: 18px 16px;
  min-height: 108px;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.friends-stat__num {
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
}

.friends-stat__label {
  margin-top: 6px;
  font-size: 14px;
  font-weight: 600;
  opacity: 0.95;
}

.friends-stat--blue {
  background: linear-gradient(145deg, #38bdf8, #0369a1);
}

.friends-stat--amber {
  background: linear-gradient(145deg, #fbbf24, #ea580c);
}

.friends-stat__deco {
  position: absolute;
  right: -8px;
  bottom: -8px;
  opacity: 0.22;
  pointer-events: none;
}

.friends-stat__deco .ico {
  width: 96px;
  height: 96px;
  color: #fff;
}

.friends-stat__deco--star .ico {
  width: 88px;
  height: 88px;
}

.friends-list-empty {
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  background: #f3f4f6;
  border-radius: 14px;
  padding: 22px 16px;
  margin-bottom: 20px;
  line-height: 1.45;
}

.friends-list-card {
  background: #fff;
  border-radius: 14px;
  border: 1px solid var(--hairline);
  padding: 4px 14px;
  margin-bottom: 20px;
}

.friend-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--hairline);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  color: var(--text);
}

.friends-list-card .friend-row {
  padding: 12px 0;
}

.friend-row:last-child {
  border-bottom: none;
}

.friend-row__name {
  font-size: 14px;
  font-weight: 500;
}

.friend-row__date {
  font-size: 12px;
  white-space: nowrap;
}

.friends-actions {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin-top: 4px;
  padding-bottom: 8px;
}

.friends-actions__send {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 16px;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.22);
}

.invite-row {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.invite-row .btn-primary {
  flex: 1;
}

.btn-copy-icon {
  width: 52px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.btn-copy-icon .ico {
  margin: 0 auto;
}

.card-head {
  margin-top: 0;
}

.lottery-hist {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.lottery-hist-empty {
  font-size: 13px;
  color: var(--muted);
}

.lottery-hist-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.lottery-hist-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.lottery-hist-row--empty .lottery-hist-title {
  color: var(--muted);
}

.lottery-hist-ico {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  overflow: hidden;
  background: #f0f1f4;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.lottery-hist-ico img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.lottery-hist-body {
  flex: 1;
  min-width: 0;
}

.lottery-hist-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text, #111);
  line-height: 1.3;
}

.lottery-hist-date {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

.hidden {
  display: none !important;
}
