:root {
  --navy: #0B1426;
  --navy-light: #132144;
  --navy-mid: #1A3158;
  --gold: #F0B90B;
  --gold-light: #FCD535;
  --gold-dark: #C99400;
  --white: #FFFFFF;
  --gray: #94A3B8;
  --green: #22C55E;
  --red: #EF4444;
  --blue: #3B82F6;
  --purple: #8B5CF6;
  --orange: #F59E0B;
  --card-bg: #0F1D32;
  --border: #1E3A5F;
  --glow-gold: rgba(240, 185, 11, 0.3);
  --gradient-start: #0B1426;
  --gradient-end: #162848;
}

html { scroll-behavior: smooth; }
* { margin: 0; padding: 0; box-sizing: border-box; }
::selection { background: rgba(240, 185, 11, 0.3); color: white; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--gradient-start);
  background-image: url('/static/img/bg-main.jpg');
  background-size: cover;
  background-attachment: fixed;
  background-position: center;
  color: var(--white);
  line-height: 1.6;
  min-height: 100vh;
}
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(135deg, rgba(11,20,38,0.92) 0%, rgba(22,40,72,0.88) 50%, rgba(11,20,38,0.95) 100%);
  background-size: 200% 200%;
  animation: gradientShift 15s ease infinite;
  z-index: -1;
}

a { color: var(--gold); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--gold-light); }

/* ── Topbar ── */
.topbar {
  background: rgba(15, 29, 50, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(240, 185, 11, 0.15);
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar .logo {
  color: var(--gold);
  font-weight: 700;
  font-size: 1.2em;
  letter-spacing: 3px;
  text-shadow: 0 0 20px rgba(240, 185, 11, 0.3);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
}
.nav-links a {
  color: var(--gray);
  font-size: 0.88em;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: all 0.3s;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}
.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 20px;
  padding-left: 20px;
  border-left: 1px solid rgba(240, 185, 11, 0.15);
}
.user-menu .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  box-shadow: 0 0 10px rgba(240, 185, 11, 0.2);
}
.user-menu span { font-size: 0.85em; color: var(--gray); }
.hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--gray);
  font-size: 1.4em;
  cursor: pointer;
  transition: color 0.2s;
}
.hamburger:hover { color: var(--gold); }

/* ── Main content ── */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px 24px 80px;
}

/* ── Cards ── */
.card {
  background: rgba(15, 29, 50, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(240, 185, 11, 0.1);
  border-radius: 16px;
  padding: 24px;
  transition: transform 0.2s, box-shadow 0.3s;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(240, 185, 11, 0.1);
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

/* ── Stat cards ── */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.stat-card {
  background: rgba(15, 29, 50, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(240, 185, 11, 0.1);
  border-radius: 14px;
  padding: 20px;
  text-align: center;
  transition: all 0.3s;
}
.stat-card:hover {
  border-color: rgba(240, 185, 11, 0.3);
  box-shadow: 0 4px 20px rgba(240, 185, 11, 0.1);
}
.stat-card .value {
  font-size: 1.6em;
  font-weight: 700;
  color: var(--gold);
  text-shadow: 0 0 20px rgba(240, 185, 11, 0.3);
}
.stat-card .label {
  font-size: 0.78em;
  color: var(--gray);
  margin-top: 4px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 12px;
  font-size: 0.9em;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}
.btn::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 0; height: 0;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  transform: translate(-50%,-50%);
  transition: width 0.6s, height 0.6s;
}
.btn:active::after {
  width: 300px; height: 300px;
}
.btn-gold {
  background: linear-gradient(135deg, #F0B90B, #FCD535);
  color: var(--navy);
  box-shadow: 0 4px 15px rgba(240, 185, 11, 0.3);
}
.btn-gold:hover {
  background: linear-gradient(135deg, #FCD535, #F0B90B);
  color: var(--navy);
  box-shadow: 0 6px 25px rgba(240, 185, 11, 0.5);
  transform: translateY(-2px);
}
.btn-outline {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(240, 185, 11, 0.3);
  color: var(--gold);
}
.btn-outline:hover {
  background: rgba(240, 185, 11, 0.1);
  border-color: var(--gold);
  color: var(--gold-light);
  box-shadow: 0 0 20px rgba(240, 185, 11, 0.15);
}
.btn-green {
  background: linear-gradient(135deg, #22C55E, #16A34A);
  color: white;
  box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
}
.btn-green:hover { transform: translateY(-2px); box-shadow: 0 6px 25px rgba(34, 197, 94, 0.4); }
.btn-red {
  background: linear-gradient(135deg, #EF4444, #DC2626);
  color: white;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}
.btn-red:hover { transform: translateY(-2px); box-shadow: 0 6px 25px rgba(239, 68, 68, 0.4); }
.btn-lg {
  padding: 16px 40px;
  font-size: 1.05em;
  border-radius: 14px;
}

/* ── Forms ── */
input, select, textarea {
  background: rgba(26, 49, 88, 0.5);
  border: 1px solid rgba(240, 185, 11, 0.15);
  border-radius: 12px;
  color: var(--white);
  padding: 12px 16px;
  font-size: 0.9em;
  width: 100%;
  outline: none;
  transition: all 0.3s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(240, 185, 11, 0.15);
}
label {
  display: block;
  font-size: 0.85em;
  color: var(--gray);
  margin-bottom: 6px;
}
.form-group { margin-bottom: 18px; }

/* ── Tables ── */
table { width: 100%; border-collapse: collapse; }
th {
  background: rgba(26, 49, 88, 0.6);
  color: var(--gold);
  padding: 12px 16px;
  text-align: left;
  font-size: 0.85em;
  font-weight: 600;
  border-bottom: 2px solid rgba(240, 185, 11, 0.3);
}
td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(30, 58, 95, 0.5);
  font-size: 0.88em;
}
tr:hover td { background: rgba(240, 185, 11, 0.05); }

/* ── Badges ── */
.badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 0.75em;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.badge-gold { background: linear-gradient(135deg, #F0B90B, #FCD535); color: var(--navy); }
.badge-green { background: linear-gradient(135deg, #22C55E, #16A34A); color: white; }
.badge-blue { background: linear-gradient(135deg, #3B82F6, #2563EB); color: white; }
.badge-red { background: linear-gradient(135deg, #EF4444, #DC2626); color: white; }
.badge-orange { background: linear-gradient(135deg, #F59E0B, #D97706); color: var(--navy); }

/* ── Flash messages ── */
.flash {
  padding: 14px 24px;
  border-radius: 12px;
  margin-bottom: 20px;
  font-size: 0.88em;
  backdrop-filter: blur(10px);
}
.flash-success { background: rgba(34, 197, 94, 0.15); border: 1px solid var(--green); color: var(--green); }
.flash-error { background: rgba(239, 68, 68, 0.15); border: 1px solid var(--red); color: var(--red); }
.flash-info { background: rgba(59, 130, 246, 0.15); border: 1px solid var(--blue); color: var(--blue); }

/* ── Hero section ── */
.hero {
  text-align: center;
  padding: 80px 20px;
  position: relative;
}
.hero h1 {
  font-size: 3.5em;
  background: linear-gradient(135deg, #F0B90B, #FCD535, #F0B90B);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 8px;
  margin-bottom: 16px;
  text-shadow: none;
  animation: fadeInUp 0.8s ease-out;
}
.hero .tagline {
  font-size: 1.2em;
  color: var(--gray);
  max-width: 600px;
  margin: 0 auto 32px;
  animation: fadeInUp 0.8s ease-out 0.2s both;
}
.hero .btn { animation: fadeInUp 0.8s ease-out 0.4s both; }

/* ── Section titles ── */
.section-title {
  font-size: 1.6em;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(240, 185, 11, 0.2);
}

/* ── How it works ── */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin: 40px 0;
}
.step {
  text-align: center;
  padding: 30px 20px;
  background: rgba(15, 29, 50, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(240, 185, 11, 0.1);
  border-radius: 16px;
  transition: all 0.3s;
}
.step:hover {
  transform: translateY(-5px);
  border-color: rgba(240, 185, 11, 0.3);
  box-shadow: 0 8px 30px rgba(240, 185, 11, 0.1);
}
.step .step-num {
  display: inline-flex;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #F0B90B, #FCD535);
  color: var(--navy);
  align-items: center;
  justify-content: center;
  font-weight: 700;
  margin-bottom: 14px;
  box-shadow: 0 4px 15px rgba(240, 185, 11, 0.3);
}
.step h3 { color: var(--white); margin-bottom: 8px; }
.step p { color: var(--gray); font-size: 0.88em; }

/* ── Tier cards ── */
.tier-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.tier-card {
  background: rgba(15, 29, 50, 0.6);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 24px 18px;
  text-align: center;
  border-top: 4px solid;
  transition: all 0.3s;
}
.tier-card:hover { transform: translateY(-4px); }
.tier-card.bronze { border-color: #CD7F32; box-shadow: 0 4px 20px rgba(205,127,50,0.15); }
.tier-card.silver { border-color: #C0C0C0; box-shadow: 0 4px 20px rgba(192,192,192,0.15); }
.tier-card.gold { border-color: var(--gold); box-shadow: 0 4px 20px rgba(240,185,11,0.15); }
.tier-card.platinum { border-color: #E5E4E2; box-shadow: 0 4px 20px rgba(229,228,226,0.15); }
.tier-card .tier-icon { font-size: 2em; margin-bottom: 8px; }
.tier-card .tier-name { font-weight: 700; margin-bottom: 4px; }
.tier-card .tier-bonus { color: var(--green); font-weight: 600; }
.tier-card .tier-req { font-size: 0.78em; color: var(--gray); margin-top: 6px; }

/* ── Footer ── */
.footer {
  text-align: center;
  padding: 30px 20px;
  border-top: 1px solid rgba(240, 185, 11, 0.1);
  color: var(--gray);
  font-size: 0.82em;
}

/* ── Chart container ── */
.chart-container {
  background: rgba(15, 29, 50, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(240, 185, 11, 0.1);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 24px;
}
.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.chart-header h3 { font-size: 0.95em; color: var(--gray); }
.chart-periods {
  display: flex;
  gap: 6px;
}
.chart-periods button {
  background: rgba(26, 49, 88, 0.5);
  border: 1px solid rgba(240, 185, 11, 0.15);
  color: var(--gray);
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 0.78em;
  cursor: pointer;
  transition: all 0.3s;
}
.chart-periods button:hover {
  border-color: var(--gold);
  color: var(--gold);
}
.chart-periods button.active {
  background: linear-gradient(135deg, #F0B90B, #FCD535);
  color: var(--navy);
  border-color: var(--gold);
}

/* ── Google login button ── */
.btn-google {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  color: #333;
  padding: 14px 32px;
  border-radius: 12px;
  font-size: 0.95em;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}
.btn-google:hover {
  box-shadow: 0 6px 25px rgba(0,0,0,0.3);
  transform: translateY(-2px);
  color: #333;
}
.btn-google svg { width: 20px; height: 20px; }

/* ── Login card ── */
.login-card {
  max-width: 440px;
  margin: 60px auto;
  text-align: center;
  background: rgba(15, 29, 50, 0.7);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(240, 185, 11, 0.15);
  border-radius: 20px;
  padding: 40px 32px;
}
.login-card h2 {
  color: var(--gold);
  margin-bottom: 10px;
  font-size: 1.6em;
}
.login-card .sub { color: var(--gray); margin-bottom: 30px; font-size: 0.9em; }

/* ── Mobile bottom nav ── */
.mobile-bottom-nav {
  display: none;
}

/* ── Animations ── */
@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Utility ── */
.text-gold { color: var(--gold); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-gray { color: var(--gray); }
.text-center { text-align: center; }
.mt-2 { margin-top: 16px; }
.mt-4 { margin-top: 32px; }
.mb-2 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 32px; }
.hidden { display: none; }
