/* ============ NebulaGift — мини-апп ============ */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --bg: #0b0b10;
  --bg2: #101016;
  --card: #17171e;
  --card2: #1d1d26;
  --stroke: #262630;
  --text: #f2f2f7;
  --dim: #8f8fa3;
  --purple: #8b5cf6;
  --purple2: #7c5cff;
  --purple-grad: linear-gradient(135deg, #8b5cf6, #6d4de0);
  --green: #2bd98a;
  --gold: #fbbf24;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overscroll-behavior: none;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(120% 40% at 50% -5%, rgba(124, 92, 255, .14), transparent 60%),
    var(--bg);
  position: relative;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* ============ Баланс ============ */
.balance-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
  background: var(--bg2);
  border-bottom: 1px solid #1a1a22;
  position: sticky;
  top: 0;
  z-index: 20;
}
.balance-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar {
  width: 46px; height: 46px; border-radius: 50%;
  position: relative; flex: 0 0 auto;
  border: 2px solid #6d5bd0;
  overflow: visible;
}
.avatar img { width: 100%; height: 100%; border-radius: 50%; display: block; object-fit: cover; }
.avatar-badge {
  position: absolute; right: -4px; bottom: -4px;
  width: 18px; height: 18px;
}
.avatar-badge svg { width: 100%; height: 100%; filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); }
.balance-label { font-size: 12.5px; color: var(--dim); }
.balance-value { display: flex; align-items: center; gap: 5px; font-size: 21px; font-weight: 800; letter-spacing: .3px; }
.gem { width: 20px; height: 20px; filter: drop-shadow(0 2px 5px rgba(79,195,247,.45)); }
.gem.sm { width: 15px; height: 15px; vertical-align: -2px; }

.btn-topup {
  display: flex; align-items: center; gap: 7px;
  background: var(--purple-grad);
  color: #fff; font-weight: 700; font-size: 15px;
  padding: 12px 18px; border-radius: 14px;
  box-shadow: 0 6px 18px rgba(124, 92, 255, .35);
  transition: transform .12s ease;
  flex: 0 0 auto;
}
.btn-topup:active { transform: scale(.95); }
.btn-topup svg { width: 19px; height: 19px; }

/* ============ Экраны ============ */
.screen {
  display: none;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
}
.screen.active { display: flex; }

/* ============ ГЛАВНАЯ ============ */
.home-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 12px 12px 20px;
  scrollbar-width: none;
}
.home-scroll::-webkit-scrollbar { display: none; }

/* Live лента */
.live-strip {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px;
}
.live-label {
  font-weight: 900; font-size: 15px; letter-spacing: .5px;
  display: flex; align-items: center; gap: 5px;
  writing-mode: horizontal-tb;
}
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 8px #4ade80; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.live-track {
  flex: 1; display: flex; gap: 8px; overflow-x: auto;
  scrollbar-width: none; padding: 2px;
}
.live-track::-webkit-scrollbar { display: none; }
.live-item {
  width: 46px; height: 46px; flex: 0 0 auto;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  background: linear-gradient(160deg, var(--c1, #3a3a4a), var(--c2, #23232e));
  border: 1px solid #ffffff14;
}

/* Баннеры */
.banners { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.banner {
  position: relative;
  border-radius: 18px;
  padding: 18px;
  min-height: 96px;
  overflow: hidden;
  transition: transform .12s ease;
}
.banner:active { transform: scale(.97); }
.banner-title {
  font-size: 26px; font-weight: 900; letter-spacing: 1px;
  display: flex; align-items: center; gap: 9px;
  text-shadow: 0 2px 8px rgba(0,0,0,.35);
  position: relative; z-index: 2;
}
.banner-title svg { width: 28px; height: 28px; }
.banner-art { position: absolute; right: 8px; top: 50%; transform: translateY(-50%) rotate(-8deg); font-size: 62px; z-index: 1; filter: drop-shadow(0 6px 14px rgba(0,0,0,.4)); }

.banner-raketka {
  background: linear-gradient(120deg, #4f8ef7 0%, #7db4ff 45%, #b9d6ff 100%);
  min-height: 120px;
}
.badge-hit {
  position: absolute; top: 12px; left: 14px; z-index: 3;
  background: #fff; color: #d97706;
  font-size: 12px; font-weight: 800;
  padding: 4px 10px 4px 6px; border-radius: 9px;
  display: flex; align-items: center; gap: 4px;
}
.badge-hit svg { width: 15px; height: 15px; }
.banner-raketka .banner-title { margin-top: 26px; color: #fff; }
.mult {
  position: absolute; z-index: 2;
  font-size: 11px; font-weight: 800; color: #fff;
  background: #22c55e; padding: 2px 6px; border-radius: 6px;
  transform: rotate(-6deg);
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
.m1 { right: 66px; top: 16px; font-size: 13px; }
.m2 { right: 20px; top: 42px; }
.m3 { right: 90px; top: 56px; }
.m4 { right: 14px; bottom: 14px; }

.banner-playhub { background: linear-gradient(120deg, #7c3aed, #a855f7 60%, #c084fc); min-height: 110px; }
.banner-playhub .banner-title { margin-top: 20px; }
.banner-cards { position: absolute; right: 10px; top: 12px; display: flex; gap: 6px; z-index: 1; }
.mini-card {
  width: 56px; height: 66px; border-radius: 10px;
  font-size: 10px; font-weight: 700; color: #fff;
  padding: 5px; line-height: 1.15;
  box-shadow: 0 4px 10px rgba(0,0,0,.3);
}
.mc1 { background: linear-gradient(160deg, #22c55e, #15803d); transform: rotate(-7deg); }
.mc2 { background: linear-gradient(160deg, #a855f7, #6d28d9); }
.mc3 { background: linear-gradient(160deg, #60a5fa, #1d4ed8); transform: rotate(7deg); }

.banner-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.banner-free24, .banner-free { min-height: 130px; background: linear-gradient(160deg, #1c1c24, #101015); border: 1px solid #2a2a36; }
.banner-title.gold {
  background: linear-gradient(180deg, #fde68a, #f59e0b);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-size: 24px; display: block;
  text-shadow: none;
  filter: drop-shadow(0 2px 6px rgba(245,158,11,.35));
}
.banner-title.grad {
  background: linear-gradient(90deg, #67e8f9, #a78bfa);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-size: 24px; display: block;
}
.banner-free24 .banner-art, .banner-free .banner-art { font-size: 54px; right: 12px; }
.banner-free24 { border-color: #6b5a2a; }
.banner-free { border-color: #3b3560; }

/* Сетка кейсов */
.cases-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.case-card {
  background: var(--card);
  border-radius: 18px;
  overflow: hidden;
  border: 1.5px solid transparent;
  transition: transform .12s ease;
}
.case-card:active { transform: scale(.96); }
.case-card.special { border-color: var(--green); }
.case-art {
  position: relative;
  aspect-ratio: 1 / .92;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(80% 70% at 50% 45%, var(--glow, #ffffff10), transparent 70%),
    linear-gradient(160deg, #20202a, #14141b);
  font-size: 64px;
  overflow: hidden;
}
.case-art .spark {
  position: absolute; font-size: 18px; opacity: .9;
  filter: drop-shadow(0 0 6px rgba(255,255,255,.5));
}
.case-badge {
  position: absolute; top: 10px; left: 10px; z-index: 3;
  font-size: 12px; font-weight: 800; letter-spacing: .5px;
  padding: 5px 12px; border-radius: 9px;
  display: flex; align-items: center; gap: 5px;
  box-shadow: 0 4px 10px rgba(0,0,0,.35);
}
.case-badge.limited { background: linear-gradient(135deg, #dc2626, #991b1b); color: #fff; }
.case-badge.new { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #fff; }
.case-badge svg { width: 13px; height: 13px; }
.case-logo {
  font-size: 30px; font-weight: 900; font-style: italic; letter-spacing: 1px;
  background: linear-gradient(180deg, #fff, #a5b4fc);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 3px 12px rgba(99,102,241,.4);
  transform: skew(-6deg);
}
.case-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  background: var(--card2);
}
.case-name { font-size: 16px; font-weight: 700; }
.case-price {
  display: flex; align-items: center; gap: 4px;
  background: var(--purple-grad);
  color: #fff; font-weight: 800; font-size: 14.5px;
  padding: 7px 12px; border-radius: 11px;
  box-shadow: 0 4px 12px rgba(124,92,255,.3);
}
.case-price.green { background: linear-gradient(135deg, #34d399, #059669); box-shadow: 0 4px 12px rgba(52,211,153,.3); }
.case-price svg { width: 14px; height: 14px; }
.home-end { height: 10px; }

/* ============ ИНВЕНТАРЬ ============ */
#screen-inventory { padding: 18px 16px; overflow-y: auto; }
.page-title { font-size: 24px; font-weight: 800; margin-bottom: 18px; }
.empty-card {
  background: var(--card);
  border-radius: 22px;
  padding: 34px 22px 26px;
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.empty-gem {
  width: 74px; height: 74px; border-radius: 50%;
  background: #1c1c26;
  display: flex; align-items: center; justify-content: center;
}
.empty-gem svg { width: 36px; height: 36px; }
.empty-title { font-size: 20px; font-weight: 800; }
.empty-text { font-size: 14.5px; color: #cfcfda; line-height: 1.5; }
.link { color: #a78bfa; font-weight: 600; }
.empty-note { font-size: 13px; color: var(--dim); line-height: 1.4; }
.divider { font-size: 13px; color: var(--dim); position: relative; width: 100%; margin: 6px 0; }
.divider::before, .divider::after {
  content: ""; position: absolute; top: 50%; width: 38%; height: 1px; background: #2a2a36;
}
.divider::before { left: 0; } .divider::after { right: 0; }

.btn-primary {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  background: var(--purple-grad);
  color: #fff; font-weight: 700; font-size: 16px;
  padding: 15px 22px; border-radius: 15px;
  box-shadow: 0 6px 18px rgba(124,92,255,.35);
  transition: transform .12s ease;
  width: 100%;
}
.btn-primary:active { transform: scale(.96); }
.btn-primary svg { width: 20px; height: 20px; }
.btn-primary.big { padding: 16px; font-size: 16.5px; }
.btn-primary.wide { width: 100%; }
.btn-secondary {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  background: #24242e; color: #fff; font-weight: 700; font-size: 16px;
  padding: 15px; border-radius: 15px;
  transition: transform .12s ease;
  width: 100%;
}
.btn-secondary:active { transform: scale(.96); }
.btn-secondary svg { width: 19px; height: 19px; }
.btn-ghost { color: var(--dim); font-weight: 600; font-size: 15px; padding: 10px; }

/* ============ ПРИГЛАСИТЬ ============ */
#screen-invite { padding: 16px 14px; gap: 14px; overflow-y: auto; }
.invite-card {
  background: var(--card);
  border-radius: 20px;
  padding: 20px;
  position: relative;
}
.help-btn { position: absolute; top: 14px; right: 14px; }
.help-btn svg { width: 30px; height: 30px; }
.invite-head { display: flex; gap: 14px; align-items: flex-start; }
.invite-icon {
  width: 56px; height: 56px; border-radius: 16px;
  background: var(--purple-grad);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px rgba(124,92,255,.4);
  flex: 0 0 auto; margin-top: 4px;
}
.invite-icon svg { width: 30px; height: 30px; }
.invite-text { font-size: 19px; font-weight: 800; line-height: 1.35; }
.purple { color: #a78bfa; }
.invite-sub { font-size: 15px; color: #d5d5e0; font-weight: 600; }
.invite-tickets { font-size: 15.5px; font-weight: 700; margin-top: 10px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ticket-chip {
  display: inline-flex; align-items: center; gap: 3px;
  background: #2a2440; padding: 3px 9px; border-radius: 8px;
  color: #cabffc; font-weight: 800;
}
.ticket-chip svg { width: 16px; height: 16px; }
.invite-limit { font-size: 13.5px; color: var(--dim); font-weight: 500; margin-top: 3px; }

.invite-actions {
  background: var(--card);
  border-radius: 20px; padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.invite-stats {
  background: var(--card);
  border-radius: 20px; padding: 6px 18px;
}
.stat-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 15px 0; font-size: 15.5px;
}
.stat-row + .stat-row { border-top: 1px solid #23232d; }
.stat-row b { color: #a78bfa; font-weight: 800; display: flex; align-items: center; gap: 5px; }
.ticket-sm { width: 17px; height: 17px; }

/* ============ РЕЙТИНГ ============ */
#screen-rating { padding: 14px; gap: 14px; overflow-y: auto; }
.rating-card {
  background: linear-gradient(160deg, #191926, #12121a);
  border: 1px solid #262636;
  border-radius: 20px;
  padding: 18px;
  position: relative;
}
.rating-head { display: flex; align-items: center; gap: 12px; font-size: 20px; margin-bottom: 14px; }
.rating-icon {
  width: 46px; height: 46px; border-radius: 13px;
  background: var(--purple-grad);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 5px 14px rgba(124,92,255,.4);
}
.rating-icon svg { width: 25px; height: 25px; }
.rating-meta { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; }
.dim { color: #9d9db0; font-size: 13.5px; display: block; }
.rating-timer-block { display: flex; flex-direction: column; gap: 6px; }
.timer {
  display: inline-flex; align-items: center; gap: 6px;
  background: #2a2318; border: 1px solid #4a3c1c;
  color: var(--gold); font-weight: 800; font-size: 16px;
  padding: 7px 14px; border-radius: 12px;
  width: fit-content;
}
.timer svg { width: 18px; height: 18px; }
.rating-winners { text-align: right; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.rating-winners b { font-size: 17px; display: flex; align-items: center; gap: 6px; }
.rating-winners svg { width: 19px; height: 19px; }
.rating-desc { margin-top: 14px; font-size: 15px; color: #d9d9e4; line-height: 1.45; }

.board-head {
  display: grid;
  grid-template-columns: 1.4fr 40px .8fr .6fr;
  align-items: center;
  padding: 0 12px 8px;
  font-size: 14px; font-weight: 700; color: #b9b9c8;
}
.col-top { display: flex; align-items: center; gap: 7px; color: #a78bfa; font-size: 15.5px; font-weight: 800; }
.col-top svg { width: 22px; height: 22px; }
.col-refresh { display: flex; justify-content: center; }
.col-refresh svg { width: 20px; height: 20px; }
.col-prize { text-align: center; }
.col-points { text-align: right; }

.board { display: flex; flex-direction: column; gap: 10px; padding-bottom: 20px; }
.board-row {
  display: grid;
  grid-template-columns: 40px 40px 1fr auto auto;
  align-items: center; gap: 8px;
  background: var(--card);
  border-radius: 14px;
  padding: 10px 10px;
  border: 1px solid transparent;
}
.board-row.first { background: linear-gradient(90deg, #3a3413, #2a2510); border-color: #6b5a1e; }
.rank {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px;
  background: #2c2c38; color: #c9c9d6;
}
.rank.r1 { background: linear-gradient(135deg, #fbbf24, #d97706); color: #3a2c05; }
.rank.r2 { background: linear-gradient(135deg, #e5e7eb, #9ca3af); color: #333; }
.rank.r3 { background: linear-gradient(135deg, #d8a26a, #92613a); color: #3a2410; }
.b-ava { width: 36px; height: 36px; border-radius: 50%; background: #26262f; border: 2px solid #3d3d4c; }
.board-row.first .b-ava { border-color: #fbbf24; }
.b-name { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-prize {
  min-width: 40px; height: 36px; border-radius: 9px;
  background: #23232d; display: flex; align-items: center; justify-content: center;
  font-size: 19px;
}
.b-pts {
  background: #3a3450; color: #b8a9f5; font-weight: 800;
  padding: 8px 12px; border-radius: 10px; font-size: 14.5px;
  min-width: 62px; text-align: center;
}
.board-row.first .b-pts { background: #4a3f6b; }
.board-row.me {
  background: #1c1c26; border: 1px solid #35354a;
  grid-template-columns: 40px 40px 1fr auto auto;
}
.me-tag {
  background: var(--purple-grad); color: #fff;
  font-size: 11px; font-weight: 800; letter-spacing: 1px;
  padding: 3px 8px; border-radius: 6px;
}
.me-name { display: flex; align-items: center; gap: 7px; }
.me-empty { color: #8f8fa3; font-size: 18px; }

/* ============ НАГРАДЫ ============ */
#screen-rewards { padding: 14px; gap: 14px; overflow-y: auto; }
.rewards-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rtab {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--card); color: #cfcfda;
  font-weight: 700; font-size: 16px;
  padding: 14px; border-radius: 14px;
  border: 1.5px solid transparent;
  transition: transform .12s ease;
}
.rtab:active { transform: scale(.96); }
.rtab.active { background: var(--purple-grad); color: #fff; box-shadow: 0 6px 16px rgba(124,92,255,.35); }
.rtab svg { width: 21px; height: 21px; }
.badge-count {
  background: #e11d48; color: #fff;
  font-size: 12px; font-weight: 800;
  min-width: 22px; height: 22px; border-radius: 11px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 6px;
}
.rtab.active .badge-count { background: #fff; color: #7c3aed; }

.rpanel { display: none; flex-direction: column; gap: 14px; }
.rpanel.active { display: flex; }

.tickets-banner {
  background: #171722;
  border: 1px solid #2b2b3c;
  border-radius: 18px;
  padding: 16px;
  display: flex; align-items: center; gap: 13px;
}
.ticket-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: #232338;
  display: flex; align-items: center; justify-content: center;
}
.ticket-icon svg { width: 25px; height: 25px; }
.tickets-text { font-size: 14.5px; color: #cfcfda; line-height: 1.35; }
.tickets-text b { color: #fff; font-size: 19px; }
.info-btn { margin-left: auto; }
.info-btn svg { width: 26px; height: 26px; }

.tasks-block {
  background: var(--card);
  border-radius: 18px;
  padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.tasks-title {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 800; letter-spacing: 1px; color: #b9b9c8;
  padding: 2px 4px 6px;
}
.tasks-title svg { width: 17px; height: 17px; }
.task-card {
  background: #101018;
  border: 1px solid #1e1e28;
  border-radius: 14px;
  padding: 14px;
  display: flex; flex-direction: column; gap: 12px;
}
.task-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.task-name { font-size: 16.5px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.task-dice {
  width: 40px; height: 40px; border-radius: 11px; flex: 0 0 auto;
  background: #232338;
  display: flex; align-items: center; justify-content: center;
  color: #cabffc; font-weight: 900; font-size: 18px;
}
.task-timer {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--gold); font-weight: 700; font-size: 13.5px;
  white-space: nowrap;
}
.task-timer svg { width: 15px; height: 15px; }
.task-mid { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.task-reward {
  display: flex; align-items: center; gap: 6px;
  background: #232338; color: #cabffc;
  font-weight: 800; font-size: 16px;
  padding: 9px 16px; border-radius: 11px;
}
.task-reward svg { width: 18px; height: 18px; }
.task-btn {
  display: flex; align-items: center; gap: 6px;
  background: var(--purple-grad); color: #fff;
  font-weight: 700; font-size: 14.5px;
  padding: 10px 18px; border-radius: 11px;
  box-shadow: 0 4px 12px rgba(124,92,255,.3);
}
.task-btn svg { width: 16px; height: 16px; }
.task-progress { display: flex; flex-direction: column; gap: 7px; }
.pbar { height: 5px; border-radius: 3px; background: #23232e; overflow: hidden; }
.pbar > div { height: 100%; width: 0%; border-radius: 3px; background: var(--purple-grad); }
.task-nums { display: flex; justify-content: space-between; font-size: 13px; color: #9d9db0; }

/* Розыгрыши */
.raffles-subtabs { display: flex; gap: 18px; padding: 2px 6px 0; border-bottom: 1.5px solid #23232d; }
.rstab {
  font-size: 15.5px; font-weight: 700; color: #8f8fa3;
  padding: 8px 2px 10px; position: relative;
  display: flex; align-items: center; gap: 7px;
}
.rstab .count { font-size: 12.5px; font-weight: 700; color: #8f8fa3; }
.rstab.active { color: #a78bfa; }
.rstab.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1.5px; height: 2.5px;
  background: #a78bfa; border-radius: 2px;
}
.raffle-filters { display: flex; gap: 10px; }
.seg { display: flex; background: var(--card); border-radius: 12px; padding: 4px; gap: 4px; flex: 1; }
.seg-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 14px; font-weight: 700; color: #a9a9ba;
  padding: 9px 8px; border-radius: 9px;
}
.seg-btn svg { width: 16px; height: 16px; }
.seg-btn.active { background: var(--purple-grad); color: #fff; }

.raffle-card {
  background: #101018;
  border: 1px solid #1e1e28;
  border-radius: 18px;
  padding: 16px;
  display: flex; flex-direction: column; gap: 14px;
}
.raffle-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 17px; font-weight: 700;
}
.raffle-head svg { width: 21px; height: 21px; }
.raffle-head .count { background: #232338; color: #cabffc; font-size: 13px; padding: 3px 9px; border-radius: 8px; font-weight: 800; }
.raffle-gifts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.rgift-img { aspect-ratio: 1; border-radius: 12px; }
.rgift-img.g1 { background: linear-gradient(160deg, #f87171, #b91c1c); }
.rgift-img.g2 { background: linear-gradient(160deg, #60a5fa, #1e40af); }
.rgift-img.g3 { background: linear-gradient(160deg, #d6c28a, #8a7648); }
.rgift-name { font-size: 13.5px; font-weight: 700; margin-top: 7px; }
.rgift-num { font-size: 12px; color: #8f8fa3; }
.raffle-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rm {
  background: #17171e; border-radius: 13px; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 6px;
}
.rm b { font-size: 17.5px; }
.rm-label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: #9d9db0; }
.rm-label svg { width: 16px; height: 16px; }

/* ============ Нижняя навигация ============ */
.bottom-nav {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: var(--bg2);
  border-top: 1px solid #1c1c26;
  padding: 8px 6px calc(8px + var(--safe-b));
  position: sticky;
  bottom: 0;
  z-index: 20;
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: #7d7d92; font-size: 11.5px; font-weight: 600;
  padding: 4px 0; position: relative;
  transition: color .15s ease;
}
.nav-item svg { width: 25px; height: 25px; }
.nav-item.active { color: #a78bfa; }
.nav-item.active::before {
  content: ""; position: absolute; top: -9px;
  width: 34px; height: 4px; border-radius: 0 0 4px 4px;
  background: var(--purple);
}
.badge-ico { position: absolute; top: 0; right: 12%; width: 19px !important; height: 19px !important; }

/* ============ Модалка ============ */
.modal { position: fixed; inset: 0; z-index: 50; display: none; align-items: flex-end; justify-content: center; }
.modal.show { display: flex; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.7); backdrop-filter: blur(3px); }
.modal-sheet {
  position: relative;
  width: 100%; max-width: 480px;
  background: #14141b;
  border-radius: 24px 24px 0 0;
  border-top: 1px solid #2a2a38;
  padding: 24px 20px calc(20px + var(--safe-b));
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  animation: sheet .25s ease;
}
@keyframes sheet { from { transform: translateY(40px); opacity: 0; } }
.modal-case-art {
  width: 160px; height: 160px; border-radius: 24px;
  display: flex; align-items: center; justify-content: center;
  font-size: 84px;
  background: radial-gradient(80% 70% at 50% 45%, var(--glow, #ffffff10), transparent 70%), linear-gradient(160deg, #20202a, #14141b);
}
.modal-case-name { font-size: 22px; font-weight: 800; }
.modal-case-price { display: flex; align-items: center; gap: 5px; font-size: 17px; font-weight: 800; color: #a78bfa; }
.modal-case-price svg { width: 18px; height: 18px; }

/* ============ Звёзды ============ */
.star-ico { width: 22px; height: 22px; filter: drop-shadow(0 2px 5px rgba(251,191,36,.45)); }
.star-ico.sm { width: 15px; height: 15px; vertical-align: -2px; }

/* ============ Free кейс ============ */
.free-wrap { display: flex; flex-direction: column; gap: 10px; }
.free-card { cursor: pointer; }
.free-card:active { transform: scale(.97); }
.gold-logo {
  background: linear-gradient(180deg, #fef3c7, #f59e0b);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 12px rgba(245,158,11,.45));
}
.free-spark { position: absolute; color: #fde68a; font-size: 16px; animation: twinkle 2s infinite; }
.free-spark.s1 { top: 16%; left: 18%; }
.free-spark.s2 { top: 30%; right: 16%; animation-delay: .7s; }
.free-spark.s3 { bottom: 20%; left: 30%; animation-delay: 1.3s; }
@keyframes twinkle { 50% { opacity: .25; transform: scale(.8); } }
.free-timer {
  display: none;
  text-align: center;
  font-size: 13.5px; font-weight: 700; color: var(--gold);
  padding: 0 14px 12px;
}
.free-timer.show { display: block; }
.free-card.cooldown .case-foot { opacity: .55; }
.free-hint { text-align: center; font-size: 13px; color: var(--dim); padding: 0 20px; }

/* ============ Инвентарь (список) ============ */
.inv-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.inv-item { background: var(--card); border-radius: 14px; padding: 10px; text-align: center; }
.inv-img { aspect-ratio: 1; border-radius: 10px; margin-bottom: 8px; }
.inv-name { font-size: 12.5px; font-weight: 700; line-height: 1.25; }
.inv-num { font-size: 11px; color: var(--dim); margin-top: 2px; }
.inv-val { font-size: 11.5px; font-weight: 800; color: var(--gold); margin-top: 4px; display: flex; align-items: center; justify-content: center; gap: 3px; }
.inv-val svg { width: 11px; height: 11px; }
.inv-empty-hidden { display: none !important; }

/* ============ Пополнение звёздами ============ */
.modal-case-sub { font-size: 14px; color: var(--dim); text-align: center; line-height: 1.4; }
.stars-amounts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; margin-top: 6px; }
.star-amt {
  background: #1d1d27; border: 1px solid #2c2c3a;
  border-radius: 14px; padding: 14px 6px;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  font-weight: 800; font-size: 16px;
  transition: transform .12s ease;
}
.star-amt:active { transform: scale(.94); border-color: var(--purple); }
.star-amt svg { width: 22px; height: 22px; }
.star-amt small { font-size: 11px; color: var(--dim); font-weight: 600; }

/* ============ Картинки и анимации ============ */
.free-art { overflow: hidden; }
.free-img {
  width: 88%;
  height: 88%;
  object-fit: contain;
  animation: floaty 3.4s ease-in-out infinite;
  filter: drop-shadow(0 10px 24px rgba(251,191,36,.35));
}
@keyframes floaty {
  0%, 100% { transform: translateY(-6px) rotate(-1.2deg); }
  50% { transform: translateY(7px) rotate(1.2deg); }
}
.free-card { animation: glowPulse 2.6s ease-in-out infinite; }
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 0 rgba(43,217,138,0); }
  50% { box-shadow: 0 0 34px rgba(43,217,138,.35); }
}
/* бегущий блик по арту кейса */
.free-art::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.22) 48%, transparent 62%);
  transform: translateX(-120%);
  animation: shine 3.8s ease-in-out infinite;
}
@keyframes shine { 55%, 100% { transform: translateX(120%); } }

/* встряска при открытии */
.free-card.opening { animation: shake .8s ease both; }
@keyframes shake {
  0%, 100% { transform: rotate(0); }
  15% { transform: rotate(-4deg) scale(1.03); }
  30% { transform: rotate(4deg) scale(1.05); }
  45% { transform: rotate(-4deg) scale(1.05); }
  60% { transform: rotate(3deg) scale(1.04); }
  75% { transform: rotate(-2deg) scale(1.02); }
}
.free-card.opening .free-img { animation: shakeImg .8s ease both; }
@keyframes shakeImg {
  0%, 100% { transform: scale(1); }
  40% { transform: scale(1.14) rotate(-4deg); }
  70% { transform: scale(1.08) rotate(3deg); }
}

/* баннеры */
.banner-img { position: absolute; z-index: 1; object-fit: contain; pointer-events: none; }
.rocket-img {
  right: 4px; top: 50%;
  width: 46%; max-height: 96%;
  transform: translateY(-50%) rotate(-18deg);
  animation: rocket 3.2s ease-in-out infinite;
  filter: drop-shadow(0 8px 18px rgba(0,0,0,.35));
}
@keyframes rocket {
  0%, 100% { margin-top: -6px; }
  50% { margin-top: 8px; }
}
.gamepad-img {
  right: 66px; top: 6px;
  width: 96px; opacity: .95;
  animation: floaty 4s ease-in-out infinite;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,.35));
}
.mult { animation: floaty 2.8s ease-in-out infinite; }
.m2 { animation-delay: .5s; } .m3 { animation-delay: 1s; } .m4 { animation-delay: 1.5s; }
.mini-card { transition: transform .2s ease; animation: sway 3.5s ease-in-out infinite; }
.mc2 { animation-delay: .6s; } .mc3 { animation-delay: 1.2s; }
@keyframes sway { 50% { transform: rotate(3deg) translateY(-3px); } }
.mc1 { animation-name: sway1; }
@keyframes sway1 { 50% { transform: rotate(-4deg) translateY(-3px); } }

/* live лента */
.live-item { overflow: hidden; }
.live-item img { width: 100%; height: 100%; object-fit: cover; }
.live-item.pop { animation: livePop .45s ease both; }
@keyframes livePop {
  0% { transform: scale(.3); opacity: 0; }
  70% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

/* результат: картинка и конфетти */
.modal-img { object-fit: contain; padding: 14px; }
.pop-in { animation: popIn .5s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes popIn {
  0% { transform: scale(.2) rotate(-10deg); opacity: 0; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
.modal-sheet { overflow: visible; }
.confetti { position: absolute; inset: -40px 0 0; pointer-events: none; overflow: visible; }
.confetti i {
  position: absolute; top: 30%; left: 50%;
  width: 8px; height: 12px; border-radius: 2px;
  animation: confetti 1.5s ease-out both;
}
@keyframes confetti {
  0% { transform: translate(0, 0) rotate(0); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); opacity: 0; }
}

/* баланс: импульс при изменении */
.balance-value.bump { animation: bump .45s ease; }
@keyframes bump { 40% { transform: scale(1.18); color: #fde68a; } }

/* инвентарь */
.inv-img { overflow: hidden; }
.inv-img img { width: 100%; height: 100%; object-fit: cover; }

/* ============ Тост ============ */
.toast {
  position: fixed; left: 50%; bottom: 110px;
  transform: translateX(-50%) translateY(20px);
  background: #24242f; color: #fff;
  padding: 11px 18px; border-radius: 12px;
  font-size: 14px; font-weight: 600;
  opacity: 0; pointer-events: none;
  transition: all .25s ease;
  z-index: 99;
  border: 1px solid #35354a;
  max-width: 86%; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
