:root {
  --bg: #0c0814;
  --bg2: #140d22;
  --panel: rgba(167, 85, 247, 0.06);
  --panel-border: rgba(167, 85, 247, 0.18);
  --accent: #a755f7;
  --accent-2: #c98bff;
  --accent-soft: #7c3aed;
  --text: #f4f0fb;
  --muted: #9a8fb5;
  --green: #34d399;
  --red: #ff6b6b;
  --gold: #ffd166;
  --silver: #cfd8e3;
  --bronze: #e0a071;
}

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

html,
body {
  width: 1920px;
  height: 1080px;
  overflow: hidden;
  background: radial-gradient(circle at 20% -10%, #1d1033 0%, var(--bg) 55%) fixed;
  color: var(--text);
  font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.stage {
  width: 1920px;
  height: 1080px;
  padding: 38px 56px 44px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

/* ---------- Верхняя полоса ---------- */
.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.topbar-left {
  justify-self: start;
}

.topbar-center {
  justify-self: center;
}

.topbar-right {
  justify-self: end;
}

.logo {
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  font-weight: 800;
  font-size: 52px;
  letter-spacing: 4px;
  background: linear-gradient(120deg, #fff 10%, var(--accent-2) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.logo-img {
  height: 78px;
  width: auto;
  max-width: 460px;
  object-fit: contain;
  display: block;
}

.month-name {
  font-size: 34px;
  font-weight: 700;
  color: var(--muted);
}

.clock-wrap {
  text-align: right;
}

.clock {
  font-family: 'Bricolage Grotesque', ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
  font-weight: 700;
  font-size: 76px;
  line-height: 0.95;
  letter-spacing: 2px;
}

.date {
  font-size: 28px;
  color: var(--muted);
  font-weight: 600;
  margin-top: 4px;
}

/* ---------- Главный блок ---------- */
.hero {
  background: linear-gradient(160deg, rgba(167, 85, 247, 0.14), rgba(167, 85, 247, 0.03));
  border: 1px solid var(--panel-border);
  border-radius: 32px;
  padding: 34px 48px 40px;
  box-shadow: 0 24px 60px rgba(124, 58, 237, 0.18);
}

.hero-numbers {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}

.hero-cash {
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  font-weight: 800;
  font-size: 110px;
  line-height: 1;
  letter-spacing: -1px;
  display: flex;
  align-items: baseline;
  gap: 18px;
}

.hero-cash #totalCash {
  background: linear-gradient(120deg, #fff, var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-slash {
  color: var(--muted);
  font-weight: 600;
}

.hero-plan {
  color: var(--muted);
  font-size: 76px;
}

.hero-percent {
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  font-weight: 800;
  font-size: 120px;
  line-height: 1;
  color: var(--accent);
  text-shadow: 0 0 40px rgba(167, 85, 247, 0.45);
  white-space: nowrap;
}

.pct-sign {
  font-size: 64px;
  color: var(--accent-2);
}

/* ---------- Прогресс-бар ---------- */
.progress {
  margin-top: 34px;
}

.progress-track {
  position: relative;
  height: 46px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.06);
  overflow: visible;
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.progress-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  border-radius: 24px;
  background: linear-gradient(90deg, var(--accent-soft), var(--accent), var(--accent-2));
  box-shadow: 0 0 28px rgba(167, 85, 247, 0.6);
  transition: width 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Карусель планов: строка приза + точки */
.gift-line {
  margin-top: 26px;
  font-size: 34px;
  font-weight: 700;
  text-align: center;
  color: var(--text);
  transition: opacity 0.4s ease;
  min-height: 42px;
}

.gift-line.fade {
  opacity: 0;
}

.gift-line .gift-name {
  color: var(--gold);
}

.gift-line.reached .gift-name {
  color: var(--green);
}

.gift-line .remain {
  color: var(--muted);
  font-weight: 600;
}

/* Подсветка остатка «осталось N» — чтобы было видно с 5 метров */
.gift-line .remain-amt {
  display: inline-block;
  color: #fff;
  font-weight: 800;
  padding: 2px 16px;
  margin: 0 4px;
  border-radius: 12px;
  background: linear-gradient(120deg, var(--accent-soft), var(--accent));
  box-shadow: 0 0 22px rgba(167, 85, 247, 0.55);
}

.slide-dots {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}

.slide-dots .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transition: background 0.3s, transform 0.3s;
}

.slide-dots .dot.active {
  background: var(--accent);
  transform: scale(1.25);
  box-shadow: 0 0 12px var(--accent);
}

.slide-dots .dot.reached {
  background: var(--green);
}

/* ---------- Низ ---------- */
.bottom {
  flex: 1;
  display: grid;
  grid-template-columns: 460px 1fr;
  gap: 28px;
  min-height: 0;
}

.today-card {
  background: linear-gradient(160deg, rgba(52, 211, 153, 0.12), rgba(52, 211, 153, 0.02));
  border: 1px solid rgba(52, 211, 153, 0.22);
  border-radius: 28px;
  padding: 36px 38px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.today-label {
  font-size: 32px;
  font-weight: 700;
  color: var(--muted);
}

.today-value {
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  font-weight: 800;
  font-size: 96px;
  line-height: 1.05;
  margin-top: 10px;
  color: #fff;
}

.today-sub {
  font-size: 24px;
  color: var(--muted);
  margin-top: 8px;
}

.table-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 28px;
  padding: 18px 30px 22px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.table-head,
.row {
  display: grid;
  grid-template-columns: 90px 1fr 360px 280px;
  align-items: center;
  gap: 16px;
}

.table-head {
  font-size: 22px;
  font-weight: 700;
  color: var(--muted);
  padding: 6px 16px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.th-month,
.th-today {
  text-align: right;
}

.table-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  min-height: 0;
  transition: opacity 0.35s ease;
}

.table-body.fade {
  opacity: 0;
}

.mgr-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 8px 0 2px;
  min-height: 18px;
}

.mgr-dots .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  transition: background 0.3s, transform 0.3s;
}

.mgr-dots .dot.active {
  background: var(--accent);
  transform: scale(1.3);
}

.row {
  padding: 10px 16px;
  border-radius: 18px;
  transition: background 0.3s;
}

.row .rank {
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  font-weight: 800;
  font-size: 40px;
  color: var(--muted);
}

.row .name {
  font-size: 38px;
  font-weight: 700;
}

.row .month-cash {
  text-align: right;
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  font-weight: 700;
  font-size: 44px;
}

.row .today-cash {
  text-align: right;
  font-size: 32px;
  font-weight: 600;
  color: var(--muted);
}

.row .today-cash.pos {
  color: var(--green);
}

.row .today-cash.neg {
  color: var(--red);
}

.row .month-cash.neg {
  color: var(--red);
}

/* Топ-3 */
.row.top1 {
  background: linear-gradient(90deg, rgba(255, 209, 102, 0.16), transparent 70%);
}
.row.top2 {
  background: linear-gradient(90deg, rgba(207, 216, 227, 0.12), transparent 70%);
}
.row.top3 {
  background: linear-gradient(90deg, rgba(224, 160, 113, 0.12), transparent 70%);
}
.row.top1 .rank,
.row.top2 .rank,
.row.top3 .rank {
  font-size: 44px;
}

/* Анимация перещёлкивания цифр */
.num-flip {
  display: inline-block;
  transition: transform 0.25s ease;
}
.num-flip.bump {
  animation: bump 0.5s ease;
}
@keyframes bump {
  0% { transform: scale(1); }
  35% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

/* ---------- Тост ---------- */
.toast-layer {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 50;
}

.toast {
  background: linear-gradient(150deg, rgba(167, 85, 247, 0.96), rgba(124, 58, 237, 0.96));
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 36px;
  padding: 54px 90px;
  text-align: center;
  box-shadow: 0 30px 90px rgba(124, 58, 237, 0.55);
  animation: toastIn 0.45s cubic-bezier(0.18, 1.4, 0.4, 1) forwards;
}

.toast.out {
  animation: toastOut 0.5s ease forwards;
}

.toast .emoji {
  font-size: 70px;
}

.toast .who {
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  font-weight: 700;
  font-size: 64px;
  margin-top: 8px;
}

.toast .amount {
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  font-weight: 800;
  font-size: 92px;
  margin-top: 6px;
  color: #fff;
  text-shadow: 0 0 30px rgba(255, 255, 255, 0.5);
}

@keyframes toastIn {
  from { transform: scale(0.4); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
@keyframes toastOut {
  from { transform: scale(1); opacity: 1; }
  to { transform: scale(1.15); opacity: 0; }
}

/* Конфетти */
.confetti {
  position: fixed;
  top: -20px;
  width: 14px;
  height: 22px;
  z-index: 49;
  opacity: 0.95;
  border-radius: 3px;
  animation: fall linear forwards;
}
@keyframes fall {
  to {
    transform: translateY(1120px) rotate(720deg);
    opacity: 0.8;
  }
}

/* ---------- Кнопка разблокировки звука ---------- */
.hidden {
  display: none !important;
}

.sound-prompt {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 70;
  padding: 16px 26px;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  font-family: 'Manrope', system-ui, sans-serif;
  background: linear-gradient(120deg, var(--accent-soft), var(--accent));
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 16px;
  cursor: pointer;
  box-shadow: 0 12px 40px rgba(124, 58, 237, 0.5);
  animation: bump 1.4s ease infinite;
}

/* ---------- Индикатор соединения ---------- */
.conn-dot {
  position: fixed;
  top: 14px;
  left: 14px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
  z-index: 60;
  opacity: 0.5;
  transition: background 0.3s, box-shadow 0.3s;
}
.conn-dot.off {
  background: var(--red);
  box-shadow: 0 0 10px var(--red);
}
