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

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  -webkit-overflow-scrolling: touch;
}

:root {
  --font-family: 'Poppins', -apple-system, 'Helvetica Neue', sans-serif;
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 0.75rem;
  --space-base: 1rem;
  --space-lg: 1.25rem;
  --space-xl: 1.5rem;
  --space-2xl: 2rem;
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.25rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;
  --font-size-xs: 0.6875rem;
  --font-size-sm: 0.75rem;
  --font-size-base: 0.875rem;
  --font-size-md: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 2rem;
  --tabbar-height: 5rem;
  --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.18);
  --shadow-glow: 0 0 20px rgba(7, 133, 253, 0.15);
  --bg-primary: #111113;
  --bg-secondary: #0a0a0c;
  --text-primary: #ffffff;
  --text-secondary: #8e8e93;
  --accent: #0785FD;
  --accent-glow: rgba(7, 133, 253, 0.3);
  --accent-text: #ffffff;
  --divider: #2a2a2e;
  --card-bg: #18181b;
  --card-border-color: rgba(255, 255, 255, 0.07);
  --tabbar-bg: rgba(10, 10, 12, 0.85);
  --gold: #ffb347;
  --gold-glow: rgba(255, 179, 71, 0.25);
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  color: var(--text-primary);
  background-color: var(--bg-secondary);
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  color: inherit;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  box-shadow: none;
}

button:focus {
  outline: none;
  box-shadow: none;
}

ul, ol {
  list-style: none;
}

img {
  display: block;
  max-width: 100%;
}

::-webkit-scrollbar {
  display: none;
}

.page-container {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-base) var(--space-base) calc(var(--space-base) * 2);
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.page {
  display: none;
  flex-direction: column;
  gap: var(--space-lg);
  animation: fadeIn 0.28s ease-out;
}

.page.active-page {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.bottom-nav {
  position: relative;
  height: var(--tabbar-height);
  background: var(--tabbar-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 var(--space-base) max(env(safe-area-inset-bottom, 0px), var(--space-sm));
  border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  z-index: 100;
  flex-shrink: 0;
  transform: translateZ(0);
  backface-visibility: hidden;
  box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.4);
}

.bottom-nav .nav-pill {
  position: absolute;
  top: 50%;
  left: 0;
  height: 68%;
  background: var(--accent);
  border-radius: var(--radius-full);
  transition: transform 0.32s cubic-bezier(0.2, 0.9, 0.4, 1.1), width 0.22s ease;
  z-index: 0;
  pointer-events: none;
  opacity: 0.18;
  will-change: transform, width;
  backface-visibility: hidden;
  transform: translateY(-50%) translateX(0);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  color: var(--text-secondary);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  transition: color 0.2s ease, transform 0.2s ease;
  padding: 0.5rem 0;
  flex: 1;
  text-align: center;
  z-index: 1;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  background: transparent;
  border: none;
  position: relative;
  transform: translateZ(0);
}

.nav-item i {
  font-size: 1.4rem;
  transition: transform 0.2s ease;
}

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

.nav-item.active-nav i {
  transform: scale(1.1);
}

.profile-card {
  background: var(--card-bg);
  border-radius: var(--radius-2xl);
  padding: var(--space-xl);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--card-border-color);
  position: relative;
  overflow: hidden;
}

.profile-card::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(7, 133, 253, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.avatar-container {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-md);
  position: relative;
}

.avatar-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ton-orbit {
  position: absolute;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  pointer-events: none;
}

.ton-icon {
  position: absolute;
  width: 22px;
  height: 22px;
  opacity: 0.7;
}

.ton-icon-1 {
  animation: orbit1 6s linear infinite;
}

.ton-icon-2 {
  animation: orbit2 6s linear infinite;
}

.ton-icon-3 {
  animation: orbit3 6s linear infinite;
}

@keyframes orbit1 {
  0%   { transform: rotate(0deg)   translateX(70px) rotate(0deg); }
  100% { transform: rotate(360deg) translateX(70px) rotate(-360deg); }
}

@keyframes orbit2 {
  0%   { transform: rotate(120deg)   translateX(70px) rotate(-120deg); }
  100% { transform: rotate(480deg)   translateX(70px) rotate(-480deg); }
}

@keyframes orbit3 {
  0%   { transform: rotate(240deg)   translateX(70px) rotate(-240deg); }
  100% { transform: rotate(600deg)   translateX(70px) rotate(-600deg); }
}

.user-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 2.5px solid var(--accent);
  background: var(--bg-secondary);
  box-shadow: 0 0 0 4px rgba(7, 133, 253, 0.15), 0 8px 20px rgba(0,0,0,0.3);
  position: relative;
  z-index: 2;
  transition: box-shadow 0.3s ease;
}

.user-avatar:hover {
  box-shadow: 0 0 0 6px rgba(7, 133, 253, 0.22), 0 10px 24px rgba(0,0,0,0.35);
}

.user-name-large {
  text-align: center;
  font-size: var(--font-size-2xl);
  font-weight: 700;
  margin-bottom: var(--space-lg);
  letter-spacing: -0.3px;
}

.stats-row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}

.stat-block {
  flex: 1;
  text-align: center;
  background: var(--bg-secondary);
  padding: var(--space-md) var(--space-xs);
  border-radius: var(--radius-lg);
  border: 1px solid var(--card-border-color);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.stat-block:hover {
  transform: translateY(-2px);
  border-color: rgba(7, 133, 253, 0.25);
}

.stat-number {
  font-size: var(--font-size-xl);
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.5px;
}

.stat-label {
  font-size: 0.6rem;
  color: var(--text-secondary);
  margin-top: 2px;
  font-weight: 500;
  letter-spacing: 0.3px;
}

.progress-item {
  margin: var(--space-md) 0;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-xs);
  color: var(--text-secondary);
  font-weight: 500;
}

.progress-track {
  background: var(--divider);
  border-radius: var(--radius-full);
  height: 5px;
  overflow: hidden;
}

.progress-fill {
  background: linear-gradient(90deg, var(--accent), #4dabff);
  width: 0%;
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
  box-shadow: 0 0 8px rgba(7, 133, 253, 0.4);
}

.section-header {
  font-size: var(--font-size-lg);
  font-weight: 700;
  margin-bottom: var(--space-md);
  padding-left: var(--space-xs);
  letter-spacing: -0.3px;
  color: var(--text-primary);
}

.task-card {
  background: var(--card-bg);
  border-radius: var(--radius-xl);
  padding: var(--space-base);
  margin-bottom: var(--space-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--card-border-color);
  transition: transform 0.15s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.task-card:last-child {
  margin-bottom: var(--space-lg);
}

.task-card:active {
  transform: scale(0.985);
}

.task-card:hover {
  border-color: rgba(255,255,255,0.1);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.task-card.task-completed {
  opacity: 0.6;
  pointer-events: auto;
  background: rgba(24, 24, 27, 0.5);
}

.task-info {
  display: flex;
  gap: var(--space-base);
  align-items: center;
}

.task-icon {
  font-size: 2rem;
  color: var(--accent);
}

.task-desc {
  font-weight: 600;
  font-size: var(--font-size-base);
}

.task-progress {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin-top: 2px;
}

.task-available-hint {
  font-size: 0.62rem;
  color: var(--gold);
  margin-top: 0.15rem;
  display: block;
  opacity: 0.8;
}

.task-reward {
  text-align: right;
  flex-shrink: 0;
}

.gold-text {
  color: var(--gold);
  font-weight: 700;
}

.claim-btn {
  background: var(--accent);
  color: var(--accent-text);
  padding: 0.45rem 1.2rem;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: var(--font-size-sm);
  margin-top: 0.4rem;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  border: none;
  outline: none;
  box-shadow: 0 2px 8px rgba(7, 133, 253, 0.3);
}

.claim-btn:active {
  transform: scale(0.94);
  box-shadow: none;
}

.join-task {
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-sm);
}

.task-action {
  display: flex;
  gap: var(--space-sm);
}

.join-link-btn, .verify-btn {
  flex: 1;
  padding: 0.65rem;
  border-radius: var(--radius-full);
  font-weight: 700;
  transition: all 0.2s ease;
  text-align: center;
  border: 1px solid transparent;
  font-size: var(--font-size-sm);
  outline: none;
  box-shadow: none;
}

.join-link-btn {
  background: var(--accent);
  color: var(--accent-text);
  box-shadow: 0 2px 10px rgba(7, 133, 253, 0.25);
}

.verify-btn {
  background: var(--gold);
  color: #1a1200;
  font-weight: 800;
}

.verify-btn:disabled {
  opacity: 0.4;
  transform: none;
  cursor: not-allowed;
  box-shadow: none;
}

.verification-status {
  font-size: var(--font-size-xs);
  color: var(--gold);
  text-align: center;
  font-weight: 500;
}

.task-reward-hint {
  font-size: var(--font-size-sm);
  color: var(--gold);
}

.ads-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.ad-card {
  position: relative;
  background: var(--card-bg);
  border-radius: var(--radius-2xl);
  padding: var(--space-2xl) var(--space-xl);
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  border: 1px solid var(--card-border-color);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  overflow: hidden;
  min-height: 110px;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.ad-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-2xl);
  background: linear-gradient(135deg, rgba(7,133,253,0.04) 0%, transparent 60%);
  pointer-events: none;
}

.ad-card.enhanced-ad {
  background: #17171a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  padding: 1.5rem 1.25rem;
}

.ad-card:active {
  transform: scale(0.97);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.ad-card:hover {
  border-color: rgba(7, 133, 253, 0.2);
  box-shadow: 0 8px 28px rgba(0,0,0,0.2), var(--shadow-glow);
}

.flame-lottie-container {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.flame2-lottie-container {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-icon {
  font-size: 3rem;
  color: var(--accent);
  flex-shrink: 0;
}

.ad-content {
  flex: 1;
  min-width: 0;
}

.ad-title {
  font-weight: 800;
  font-size: var(--font-size-xl);
  letter-spacing: -0.3px;
}

.ad-price {
  font-size: var(--font-size-2xl);
  font-weight: 800;
  color: var(--gold);
  letter-spacing: -0.5px;
}

.ad-counter {
  font-size: var(--font-size-md);
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 2px;
}

.ad-blur {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: var(--radius-2xl);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--font-size-md);
  color: white;
  display: none;
  z-index: 5;
  letter-spacing: 1px;
}

.ad-verify-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--radius-2xl);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  display: none;
}

.ad-verify-spinner {
  width: 30px;
  height: 30px;
  border: 3px solid rgba(255,255,255,0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  margin-bottom: 8px;
}

.ad-verify-text {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: rgba(255,255,255,0.8);
  letter-spacing: 0.3px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.leaderboard-table-container {
  background: rgba(24, 24, 27, 0.9);
  border-radius: 1.5rem;
  padding: 1.25rem;
  margin-top: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(10px);
}

.earn-leaderboard {
  margin-top: 0.5rem;
}

.leaderboard-header {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0.75rem 0.75rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-secondary);
}

.leaderboard-list {
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.leaderboard-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  transition: background 0.15s ease;
  border-radius: var(--radius-md);
}

.leaderboard-row:hover {
  background: rgba(255, 255, 255, 0.025);
}

.leaderboard-rank {
  width: 2.5rem;
  font-weight: 700;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.leaderboard-row:nth-child(1) .leaderboard-rank { color: #FFD700; }
.leaderboard-row:nth-child(2) .leaderboard-rank { color: #C0C0C0; }
.leaderboard-row:nth-child(3) .leaderboard-rank { color: #CD7F32; }

.leaderboard-user {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1;
}

.leaderboard-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid rgba(7, 133, 253, 0.25);
  background: var(--bg-secondary);
}

.leaderboard-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: #ffffff;
}

.leaderboard-score {
  font-weight: 800;
  color: var(--gold);
  font-size: 0.9rem;
  padding: 0.2rem 0.65rem;
  background: rgba(255, 179, 71, 0.1);
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 179, 71, 0.15);
}

.empty-leaderboard {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9rem;
}

.wallet-page-card {
  background: var(--card-bg);
  border-radius: var(--radius-2xl);
  padding: var(--space-xl);
  border: 1px solid var(--card-border-color);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.wallet-page-card::before {
  content: '';
  position: absolute;
  bottom: -40px;
  left: -40px;
  width: 160px;
  height: 160px;
  background: radial-gradient(circle, rgba(255, 179, 71, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.wallet-ton-orbit {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: var(--radius-2xl);
  z-index: 0;
}

.wallet-ton-icon {
  position: absolute;
  width: 20px;
  height: 20px;
  opacity: 0.18;
  top: 50%;
  left: 50%;
  margin-top: -10px;
  margin-left: -10px;
}

.wallet-ton-icon-1 {
  animation: walletOrbit1 9s linear infinite;
}

.wallet-ton-icon-2 {
  animation: walletOrbit2 9s linear infinite;
}

.wallet-ton-icon-3 {
  animation: walletOrbit3 12s linear infinite;
}

@keyframes walletOrbit1 {
  0%   { transform: rotate(0deg)   translateX(110px) rotate(0deg); }
  100% { transform: rotate(360deg) translateX(110px) rotate(-360deg); }
}

@keyframes walletOrbit2 {
  0%   { transform: rotate(120deg)   translateX(85px) rotate(-120deg); }
  100% { transform: rotate(480deg)   translateX(85px) rotate(-480deg); }
}

@keyframes walletOrbit3 {
  0%   { transform: rotate(240deg)   translateX(130px) rotate(-240deg); }
  100% { transform: rotate(600deg)   translateX(130px) rotate(-600deg); }
}

.balance-large {
  text-align: center;
  margin: var(--space-md) 0;
  position: relative;
  z-index: 1;
}

.balance-value {
  font-size: 3.2rem;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: -1px;
  text-shadow: 0 0 30px rgba(255, 179, 71, 0.25);
}

.balance-currency {
  font-size: 1.1rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.ton-equivalent {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
  font-size: var(--font-size-sm);
  position: relative;
  z-index: 1;
}

.withdraw-btn-account {
  width: 100%;
  background: linear-gradient(135deg, var(--accent), #0066cc);
  border: none;
  padding: 0.9rem var(--space-base);
  border-radius: var(--radius-full);
  font-weight: 800;
  font-size: var(--font-size-md);
  color: var(--accent-text);
  margin-top: var(--space-lg);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-sm);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
  outline: none;
  box-shadow: 0 4px 16px rgba(7, 133, 253, 0.35);
  letter-spacing: 0.2px;
  position: relative;
  z-index: 1;
}

.withdraw-btn-account:active {
  transform: scale(0.97);
  box-shadow: 0 2px 8px rgba(7, 133, 253, 0.2);
}

.history-btn {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--card-border-color);
  padding: 0.8rem var(--space-base);
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: var(--font-size-base);
  color: var(--text-secondary);
  margin-top: var(--space-sm);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-sm);
  transition: all 0.2s ease;
  outline: none;
  box-shadow: none;
  letter-spacing: 0.2px;
  cursor: pointer;
  position: relative;
  z-index: 1;
}

.history-btn:active {
  transform: scale(0.97);
}

.history-btn:hover {
  border-color: rgba(255,255,255,0.12);
  color: var(--text-primary);
}

.wallet-bull-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 0 var(--space-lg);
  padding: var(--space-sm) 0;
}

.bull-lottie-inner {
  width: 200px;
  height: 200px;
  filter: drop-shadow(0 0 24px rgba(255, 60, 60, 0.18));
}

.duck-lottie-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: var(--space-sm) 0 var(--space-lg);
  padding: var(--space-sm) 0;
}

.duck-lottie-inner {
  width: 180px;
  height: 180px;
  background: radial-gradient(ellipse at center, rgba(220, 30, 30, 0.13) 0%, transparent 70%);
  border-radius: 50%;
  filter: drop-shadow(0 0 28px rgba(180, 20, 20, 0.22));
}

.history-page-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1050;
  display: none;
  align-items: flex-end;
}

.history-page-overlay.show {
  display: flex;
}

.history-page-sheet {
  background: var(--bg-primary);
  border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
  width: 100%;
  max-height: 80vh;
  padding: var(--space-lg) var(--space-base) var(--space-2xl);
  overflow-y: auto;
  border-top: 1px solid rgba(255,255,255,0.08);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.4, 1);
}

.history-page-overlay.show .history-page-sheet {
  transform: translateY(0);
}

.history-sheet-handle {
  width: 40px;
  height: 4px;
  background: rgba(255,255,255,0.2);
  border-radius: var(--radius-full);
  margin: 0 auto var(--space-lg);
}

.history-sheet-title {
  font-size: var(--font-size-lg);
  font-weight: 700;
  margin-bottom: var(--space-lg);
  text-align: center;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.history-item {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: var(--space-sm) var(--space-base);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--font-size-sm);
  border: 1px solid var(--card-border-color);
}

.history-amount {
  font-weight: 700;
  color: var(--gold);
}

.history-status {
  font-weight: 600;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
  background: var(--card-bg);
  font-size: var(--font-size-xs);
}

.history-status.pending { color: var(--gold); }
.history-status.approved { color: #4caf50; }
.history-status.rejected { color: #f44336; }

.history-date {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  margin-top: 2px;
}

.empty-history {
  text-align: center;
  padding: var(--space-2xl);
  color: var(--text-secondary);
  font-size: var(--font-size-base);
}

.refer-card {
  background: var(--card-bg);
  border-radius: var(--radius-2xl);
  padding: var(--space-xl);
  border: 1px solid var(--card-border-color);
  box-shadow: var(--shadow-card);
}

.refer-card .refer-stats {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
  gap: var(--space-sm);
}

.refer-stat {
  text-align: center;
  flex: 1;
  background: var(--bg-secondary);
  padding: var(--space-sm);
  border-radius: var(--radius-lg);
  border: 1px solid var(--card-border-color);
}

.refer-stat-label {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  font-weight: 500;
  letter-spacing: 0.3px;
}

.ref-count-large, .ref-earn-large {
  font-size: var(--font-size-xl);
  font-weight: 800;
  display: block;
  margin-top: var(--space-xs);
  color: var(--gold);
}

.ref-link-container {
  background: var(--bg-secondary);
  border-radius: var(--radius-xl);
  padding: var(--space-sm) var(--space-base);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: var(--space-md) 0;
  border: 1px solid var(--card-border-color);
}

.ref-link-text {
  font-size: var(--font-size-xs);
  overflow: auto;
  white-space: nowrap;
  color: var(--text-secondary);
}

.copy-btn {
  background: var(--accent);
  border: none;
  padding: 0.35rem 1rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-size: var(--font-size-xs);
  font-weight: 700;
  color: white;
  transition: all 0.2s ease;
  outline: none;
  box-shadow: 0 2px 8px rgba(7, 133, 253, 0.3);
  flex-shrink: 0;
}

.copy-btn:active {
  transform: scale(0.93);
}

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: var(--space-lg);
  z-index: 2000;
  transition: opacity 0.22s ease, visibility 0.22s ease;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-overlay.show {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

.loading-overlay.hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-spinner {
  width: 56px;
  height: 56px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent);
  border-right-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  box-shadow: 0 0 20px rgba(7, 133, 253, 0.25);
}

.loading-text {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.5px;
}

.ban-screen, .maintenance-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-primary);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  padding: var(--space-2xl);
  z-index: 9999;
  box-sizing: border-box;
}

.ban-screen.show, .maintenance-screen.show {
  display: flex;
}

.ban-icon, .maintenance-icon {
  font-size: 4rem;
  margin-bottom: var(--space-lg);
  color: var(--accent);
}

.ban-title, .maintenance-title {
  font-size: var(--font-size-2xl);
  font-weight: 800;
  margin-bottom: var(--space-sm);
}

.ban-sub, .maintenance-sub {
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
  font-size: var(--font-size-base);
  line-height: 1.6;
}

.ban-btn, .maintenance-btn {
  background: var(--accent);
  color: var(--accent-text);
  padding: var(--space-sm) var(--space-xl);
  border-radius: var(--radius-full);
  font-weight: 700;
  outline: none;
  box-shadow: 0 4px 14px rgba(7, 133, 253, 0.35);
  border: none;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1100;
}

.modal-overlay.show {
  display: flex;
}

.modal-card {
  background: var(--card-bg);
  border-radius: var(--radius-2xl);
  width: 90%;
  max-width: 360px;
  padding: var(--space-xl);
  border: 1px solid var(--card-border-color);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.modal-header {
  font-size: var(--font-size-lg);
  font-weight: 700;
  margin-bottom: var(--space-lg);
  text-align: center;
  letter-spacing: -0.2px;
}

.wallet-options {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.wallet-option {
  flex: 1;
  background: var(--bg-secondary);
  padding: var(--space-sm);
  border-radius: var(--radius-lg);
  text-align: center;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all 0.2s;
  outline: none;
  box-shadow: none;
  -webkit-tap-highlight-color: transparent;
  font-weight: 600;
  font-size: var(--font-size-sm);
}

.wallet-option.selected {
  border-color: var(--accent);
  background: rgba(7, 133, 253, 0.12);
  color: var(--accent);
}

.amount-wrapper {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
  align-items: center;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: var(--space-xs);
  overflow: hidden;
  flex-wrap: nowrap;
  width: 100%;
  border: 1px solid var(--card-border-color);
}

.amount-input {
  flex: 1;
  background: transparent;
  border: none;
  padding: var(--space-sm);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-family: inherit;
  outline: none;
  font-size: var(--font-size-md);
  min-width: 0;
}

.all-btn {
  background: var(--accent);
  color: var(--accent-text);
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-full);
  font-weight: 700;
  border: none;
  outline: none;
  white-space: nowrap;
  margin: 0;
  box-shadow: none;
  flex-shrink: 0;
  line-height: 1;
  font-size: var(--font-size-sm);
}

.tax-note {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

.link-input, .memo-input {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--card-border-color);
  padding: var(--space-sm);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
  outline: none;
  font-family: inherit;
  font-size: var(--font-size-base);
}

.modal-actions {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

.modal-btn {
  flex: 1;
  background: var(--bg-secondary);
  padding: 0.75rem;
  border-radius: var(--radius-lg);
  font-weight: 700;
  transition: all 0.2s ease;
  border: 1px solid var(--card-border-color);
  outline: none;
  box-shadow: none;
  font-size: var(--font-size-base);
}

.modal-btn.confirm {
  background: linear-gradient(135deg, var(--accent), #0066cc);
  color: var(--accent-text);
  border: none;
  box-shadow: 0 4px 14px rgba(7, 133, 253, 0.3);
}

.modal-btn.confirm:active {
  transform: scale(0.97);
}

.custom-toast, .reward-toast {
  position: fixed;
  bottom: calc(var(--tabbar-height) + var(--space-base));
  left: 50%;
  transform: translateX(-50%);
  background: rgba(28, 28, 31, 0.95);
  color: var(--text-primary);
  padding: var(--space-sm) var(--space-xl);
  border-radius: var(--radius-full);
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.08);
  font-weight: 600;
  font-size: var(--font-size-sm);
  z-index: 1200;
  opacity: 0;
  visibility: hidden;
  transition: all 0.22s ease;
  white-space: nowrap;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.custom-toast.show, .reward-toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-10px);
}

.reward-toast {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  box-shadow: none;
  font-size: 4.5rem;
  font-weight: 900;
  color: var(--gold);
  text-shadow: 0 0 40px rgba(255, 180, 71, 0.8), 0 0 80px rgba(255, 180, 71, 0.4);
  white-space: nowrap;
  bottom: 30%;
  pointer-events: none;
  border-radius: 0;
  padding: 0;
  letter-spacing: 4px;
}

.reward-toast.show {
  transform: translateX(-50%) scale(1);
}

@keyframes rewardPulse {
  0% { transform: translateX(-50%) scale(0.4); opacity: 0; }
  75% { transform: translateX(-50%) scale(1.08); }
  100% { transform: translateX(-50%) scale(1); opacity: 1; }
}

.warning-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1300;
}

.warning-modal.show {
  display: flex;
}

.warning-content {
  background: var(--card-bg);
  border-radius: var(--radius-2xl);
  padding: var(--space-2xl);
  text-align: center;
  max-width: 280px;
  border: 1px solid var(--card-border-color);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.warning-exclamation {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: var(--space-md);
}

.warning-message {
  font-weight: 700;
  margin-bottom: var(--space-sm);
  font-size: var(--font-size-md);
}

.highlight {
  color: var(--gold);
}

.warning-sub {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
  line-height: 1.55;
}

.warning-gotit {
  background: var(--accent);
  color: var(--accent-text);
  padding: var(--space-sm) var(--space-xl);
  border-radius: var(--radius-full);
  font-weight: 700;
  width: 100%;
  border: none;
  outline: none;
  box-shadow: 0 4px 14px rgba(7, 133, 253, 0.3);
}

.turnstile-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  background: rgba(20, 20, 24, 0.97);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6);
  padding: 20px 20px 34px;
  text-align: center;
  font-family: var(--font-family);
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.2, 0.9, 0.4, 1.1);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  will-change: transform;
}

.turnstile-sheet.show {
  transform: translateY(0);
}

.turnstile-sheet .handle {
  width: 36px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  margin: 0 auto 20px auto;
}

.turnstile-sheet .title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.turnstile-sheet .widget-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 120px;
  margin: 8px 0;
}

.turnstile-sheet .widget-container > div {
  margin: 0 auto;
}
