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

:root {
  --bg: #0C0A1E;
  --card: #1A1535;
  --card2: #231D42;
  --purple: #7B5CF8;
  --purple-light: #9B7FFF;
  --gold: #F59E0B;
  --gold-light: #FBBF24;
  --text: #F8FAFC;
  --text-muted: #94A3B8;
  --border: rgba(123,92,248,0.2);
  --nav-h: 72px;
  --radius: 16px;
  --radius-sm: 10px;
}

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

body {
  font-family: 'Exo 2', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

#app { position: relative; height: 100vh; height: 100dvh; overflow: hidden; }

.screen {
  position: absolute;
  inset: 0;
  bottom: var(--nav-h);
  display: none;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}
.screen.active { display: flex; }

.screen-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 16px 24px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.screen-scroll::-webkit-scrollbar { display: none; }

/* HOME HEADER */
.home-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0 12px;
}
.logo-wrap { display: flex; align-items: center; gap: 8px; }
.logo-icon {
  width: 32px; height: 32px;
  background: rgba(245,158,11,0.15);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.logo-icon svg { width: 20px; height: 20px; }
.logo-text {
  font-size: 18px;
  font-weight: 700;
  background: linear-gradient(135deg, #F59E0B, #FBBF24);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.3px;
}
.icon-btn {
  width: 40px; height: 40px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
}
.icon-btn svg { width: 18px; height: 18px; }

/* BALANCE CARD */
.balance-card {
  background: linear-gradient(135deg, #231D42 0%, #1A1535 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.balance-label {
  font-size: 12px;
  color: var(--text-muted);
  display: block;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.balance-amount {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 28px;
  font-weight: 700;
  color: var(--gold);
}
.star-icon { width: 22px; height: 22px; flex-shrink: 0; }
.add-btn {
  width: 44px; height: 44px;
  background: var(--purple);
  border: none;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(123,92,248,0.4);
}
.add-btn svg { width: 22px; height: 22px; }

/* HERO CARD */
.hero-card {
  background: linear-gradient(135deg, #2D1B69 0%, #1A1535 60%, #231D42 100%);
  border: 1px solid rgba(123,92,248,0.3);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 14px;
  cursor: pointer;
  overflow: hidden;
  position: relative;
}
.hero-card::before {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 120px; height: 120px;
  background: radial-gradient(circle, rgba(123,92,248,0.2), transparent 70%);
  pointer-events: none;
}
.hero-content { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 16px; }

/* MASCOT */
.hero-mascot { position: relative; flex-shrink: 0; width: 80px; height: 80px; }
.mascot-body {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation: float 3s ease-in-out infinite;
}
.mascot-head {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, #8B5CF6, #6D28D9);
  border-radius: 50% 50% 40% 40%;
  position: relative;
  margin: 0 auto 4px;
  box-shadow: 0 0 16px rgba(123,92,248,0.5);
}
.mascot-visor {
  position: absolute;
  top: 12px; left: 8px;
  width: 28px; height: 16px;
  background: linear-gradient(135deg, #0EA5E9, #0284C7);
  border-radius: 8px;
  box-shadow: 0 0 8px rgba(14,165,233,0.6);
}
.mascot-suit {
  width: 36px; height: 28px;
  background: linear-gradient(135deg, #7B5CF8, #5B21B6);
  border-radius: 10px 10px 14px 14px;
  margin: 0 auto;
}
.mascot-badge {
  position: absolute;
  bottom: -2px; right: -4px;
  background: var(--gold);
  color: #000;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}
.star-orbit { position: absolute; font-size: 12px; animation: orbit 4s linear infinite; }
.s1 { top: 4px; right: 8px; animation-delay: 0s; }
.s2 { bottom: 8px; left: 4px; animation-delay: -1.3s; }
.s3 { top: 50%; right: 2px; animation-delay: -2.6s; }

@keyframes float {
  0%, 100% { transform: translate(-50%, -50%) translateY(0); }
  50% { transform: translate(-50%, -50%) translateY(-5px); }
}
@keyframes orbit {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.7); }
  100% { opacity: 1; transform: scale(1); }
}

.hero-text h2 { font-size: 17px; font-weight: 700; line-height: 1.4; color: var(--text); }

.buy-stars-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  border: none;
  border-radius: 12px;
  padding: 13px 20px;
  color: #1A1A2E;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  box-shadow: 0 4px 20px rgba(245,158,11,0.3);
}
.buy-stars-btn svg { width: 18px; height: 18px; }
.delivery-badge {
  position: absolute;
  right: 14px;
  font-size: 10px;
  font-weight: 600;
  background: rgba(26,26,46,0.3);
  padding: 2px 7px;
  border-radius: 20px;
}

/* HOME CARDS */
.home-cards { display: flex; flex-direction: column; gap: 10px; }
.home-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
}
.home-card-icon { font-size: 24px; flex-shrink: 0; }
.home-card-title { font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.home-card-sub { font-size: 12px; color: var(--text-muted); }
.chevron { width: 18px; height: 18px; color: var(--text-muted); margin-left: auto; flex-shrink: 0; }
.gifts-card { border-color: rgba(245,158,11,0.2); }
.bonus-card { border-color: rgba(123,92,248,0.2); background: linear-gradient(135deg, #231D42, var(--card)); }

/* SUBSCREEN HEADER */
.subscreen-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0 14px;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
}
.subscreen-title { font-size: 18px; font-weight: 700; flex: 1; }
.back-btn {
  width: 36px; height: 36px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text);
  flex-shrink: 0;
}
.back-btn svg { width: 18px; height: 18px; }
.title-star { width: 20px; height: 20px; flex-shrink: 0; }

/* BUY SCREEN */
.buy-balance {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}
#buy-balance-amount { font-size: 16px; font-weight: 700; color: var(--gold); }

.section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

/* PACKAGES GRID */
.packages-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.pkg-card {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 12px;
  cursor: pointer;
  position: relative;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}
.pkg-card.selected { border-color: var(--purple); background: rgba(123,92,248,0.1); }
.pkg-card.popular { border-color: rgba(245,158,11,0.4); }
.pkg-discount {
  position: absolute;
  top: -10px; right: -6px;
  background: var(--purple);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
}
.pkg-popular-badge {
  position: absolute;
  top: -10px; left: 50%;
  transform: translateX(-50%);
  background: var(--gold);
  color: #1A1A2E;
  font-size: 9px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.pkg-stars { font-size: 26px; font-weight: 800; color: var(--gold); line-height: 1; margin-bottom: 2px; }
.pkg-stars-label { font-size: 11px; color: var(--text-muted); margin-bottom: 10px; }
.pkg-price { font-size: 17px; font-weight: 700; color: var(--text); }
.pkg-old-price { font-size: 12px; color: var(--text-muted); text-decoration: line-through; }

/* SELECTED SUMMARY */
.selected-summary {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.summary-row { display: flex; justify-content: space-between; align-items: center; }
.summary-row.secondary { margin-top: 4px; }
.summary-price { font-size: 18px; font-weight: 700; color: var(--gold); }
.price-old { font-size: 13px; color: var(--text-muted); text-decoration: line-through; }

/* BOTTOM ACTION */
.bottom-action {
  position: sticky;
  bottom: 0;
  background: linear-gradient(to top, var(--bg) 80%, transparent);
  padding: 12px 16px 16px;
}
.pay-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--purple), #9B7FFF);
  border: none;
  border-radius: 14px;
  padding: 16px 20px;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 20px rgba(123,92,248,0.4);
}
.pay-btn svg { width: 20px; height: 20px; }

/* GIFTS SCREEN */
.gifts-banner {
  background: linear-gradient(135deg, #2D1B69, #1A1535);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  border: 1px solid rgba(123,92,248,0.3);
}
.gifts-banner h2 { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.gifts-banner p { font-size: 13px; color: var(--text-muted); }
.gifts-banner-img { font-size: 48px; }
.filter-tabs { display: flex; gap: 8px; margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.filter-tabs::-webkit-scrollbar { display: none; }
.filter-tab {
  flex-shrink: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.filter-tab.active { background: var(--purple); border-color: var(--purple); color: #fff; }
.gifts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.gift-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 8px;
  text-align: center;
  cursor: pointer;
}
.gift-emoji { font-size: 36px; display: block; margin-bottom: 6px; }
.gift-name { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; line-height: 1.3; }
.gift-price { font-size: 12px; font-weight: 700; color: var(--gold); display: flex; align-items: center; justify-content: center; gap: 3px; }

/* HISTORY */
.history-group { margin-bottom: 20px; }
.history-date { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px; padding-top: 4px; }
.history-empty {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 32px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}
.history-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.history-icon { width: 40px; height: 40px; background: rgba(245,158,11,0.1); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.history-stars { font-size: 14px; font-weight: 600; }
.history-time { font-size: 12px; color: var(--text-muted); }
.history-amount { font-size: 15px; font-weight: 700; color: var(--gold); margin-left: auto; }

/* PROFILE */
.profile-card {
  background: linear-gradient(135deg, #2D1B69, #1A1535);
  border-radius: var(--radius);
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
  border: 1px solid rgba(123,92,248,0.3);
}
.profile-avatar {
  width: 60px; height: 60px;
  background: rgba(245,158,11,0.1);
  border: 2px solid rgba(245,158,11,0.3);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.profile-avatar svg { width: 32px; height: 32px; }
.profile-name { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.profile-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: #1A1A2E;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.profile-balance {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.pb-label { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.pb-amount { font-size: 22px; font-weight: 700; color: var(--gold); }
.refill-btn {
  background: var(--purple);
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.menu-list { display: flex; flex-direction: column; gap: 6px; }
.menu-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
}
.menu-item svg:first-child { width: 20px; height: 20px; color: var(--purple-light); flex-shrink: 0; }
.menu-item span { flex: 1; font-size: 14px; }
.new-badge { background: var(--purple); color: #fff; font-size: 9px; font-weight: 800; padding: 2px 7px; border-radius: 20px; flex-shrink: 0; }

/* SUPPORT */
.support-banner {
  background: linear-gradient(135deg, #2D1B69, #1A1535);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  border: 1px solid rgba(123,92,248,0.3);
}
.support-banner h2 { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.support-banner p { font-size: 13px; color: var(--text-muted); }
.support-mascot { font-size: 48px; }
.faq-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 20px; }
.faq-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-size: 14px;
  gap: 12px;
}
.faq-item svg { width: 18px; height: 18px; color: var(--text-muted); flex-shrink: 0; }
.contact-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
}
.contact-icon {
  width: 44px; height: 44px;
  background: rgba(34,158,217,0.1);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.contact-icon svg { width: 24px; height: 24px; }
.contact-name { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.contact-handle { font-size: 12px; color: var(--text-muted); }
.contact-card > svg:last-child { width: 18px; height: 18px; color: var(--text-muted); margin-left: auto; }

/* BOTTOM NAV */
.bottom-nav {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(26,21,53,0.95);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  z-index: 100;
  padding: 0 4px;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  color: #5B5480;
  padding: 8px 4px;
  border-radius: 10px;
  transition: color 0.15s;
  font-family: inherit;
}
.nav-btn svg { width: 22px; height: 22px; }
.nav-btn span { font-size: 10px; font-weight: 500; }
.nav-btn.active { color: var(--gold); }

/* MODAL */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  backdrop-filter: blur(4px);
}
.modal-sheet {
  background: #1A1535;
  border-radius: 20px 20px 0 0;
  padding: 20px 20px 32px;
  width: 100%;
  border-top: 1px solid var(--border);
}
.modal-handle { width: 40px; height: 4px; background: rgba(255,255,255,0.2); border-radius: 2px; margin: 0 auto 20px; }
.modal-sheet h3 { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.modal-sheet p { font-size: 14px; color: var(--text-muted); margin-bottom: 20px; }
.pay-methods { display: flex; flex-direction: column; gap: 10px; }
.pay-method-btn {
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 15px 20px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.pay-method-btn svg { width: 20px; height: 20px; }
.pay-method-btn.primary { background: linear-gradient(135deg, var(--purple), #9B7FFF); color: #fff; box-shadow: 0 4px 16px rgba(123,92,248,0.4); }
.pay-method-btn.secondary { background: linear-gradient(135deg, #1A1535, #231D42); border: 1px solid rgba(245,158,11,0.3); color: var(--gold); }
.cancel-btn { width: 100%; background: none; border: none; color: var(--text-muted); font-size: 14px; font-family: inherit; cursor: pointer; padding: 16px; margin-top: 4px; }
