@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  /* Core Colors */
  --bg: #0D0D14;
  --bg-card: #17171F;
  --bg-hover: #1E1E28;
  
  /* Accent Colors */
  --accent: #FFB800;
  --accent-gold: #FFB800;
  --accent-hover: #FFA000;
  --accent-orange: #FF6B35;
  --accent-blue: #00D4FF;
  --accent-purple: #A855F7;
  --accent-green: #10B981;
  --accent-red: #EF4444;
  
  /* Text */
  --text: #FFFFFF;
  --text-dim: #A1A1AA;
  --text-muted: #71717A;
  
  /* Effects */
  --border: rgba(255, 255, 255, 0.1);
  --glow: 0 0 20px rgba(255, 184, 0, 0.3);
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: fixed;
  overscroll-behavior: none;
}

body {
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  position: relative;
}

/* Animated gradient background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: 
    radial-gradient(circle at 30% 20%, rgba(168, 85, 247, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 70% 60%, rgba(255, 184, 0, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 50% 80%, rgba(0, 212, 255, 0.1) 0%, transparent 50%);
  animation: gradientShift 20s ease infinite;
  pointer-events: none;
}

@keyframes gradientShift {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.6; }
}

/* App Container */
.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: relative;
  z-index: 1;
}

/* ==================== NAVIGATION ==================== */
.nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: rgba(23, 23, 31, 0.8);
  backdrop-filter: blur(24px) saturate(180%);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 8px 12px 12px;
  z-index: 1000;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.5);
}

.nav__item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1;
  height: 60px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 20px;
  padding: 8px;
  font-family: 'Inter', sans-serif;
}

.nav__item:active {
  transform: scale(0.9);
}

.nav__icon {
  font-size: 26px;
  transition: all 0.3s ease;
  filter: grayscale(80%) brightness(0.8);
  line-height: 1;
}

.nav__label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: all 0.3s ease;
  opacity: 0.7;
}

/* Active Navigation Item */
.nav__item.active {
  color: var(--accent);
}

.nav__item.active .nav__icon {
  filter: grayscale(0%) brightness(1.2);
  transform: scale(1.15);
  text-shadow: var(--glow);
}

.nav__item.active .nav__label {
  opacity: 1;
  font-weight: 700;
  color: var(--accent);
}

.nav__item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 50%;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  border-radius: 0 0 4px 4px;
  box-shadow: var(--glow);
}

/* ==================== SCREENS ==================== */
.screen {
  display: none;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 16px 96px;
  -webkit-overflow-scrolling: touch;
}

.screen.active {
  display: block;
  animation: screenFadeIn 0.3s ease;
}

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

/* ==================== HERO HEADER ==================== */
.hero {
  text-align: center;
  padding: 16px 0 24px;
}

.hero__title {
  font-size: 48px;
  font-weight: 900;
  letter-spacing: -2px;
  background: linear-gradient(135deg, #FFD700 0%, #FF8C00 60%, #FF6B35 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
  filter: drop-shadow(0 0 30px rgba(255, 184, 0, 0.5));
  animation: titlePulse 4s ease-in-out infinite;
}

@keyframes titlePulse {
  0%, 100% { filter: drop-shadow(0 0 30px rgba(255, 184, 0, 0.5)) brightness(1); }
  50% { filter: drop-shadow(0 0 40px rgba(255, 184, 0, 0.7)) brightness(1.1); }
}

.hero__subtitle {
  color: var(--text-dim);
  font-size: 15px;
  font-weight: 500;
}

.screen-header {
  text-align: center;
  margin-bottom: 28px;
}

.screen-header h2 {
  font-size: 36px;
  font-weight: 900;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-orange) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -1px;
}

.screen-subtitle {
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 500;
}

/* ==================== STATS CARDS ==================== */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.stat-card {
  background: linear-gradient(135deg, rgba(255, 184, 0, 0.1), rgba(255, 107, 53, 0.05));
  border: 1px solid rgba(255, 184, 0, 0.2);
  border-radius: 20px;
  padding: 16px 10px;
  text-align: center;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.6s ease;
}

.stat-card:active {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 8px 24px rgba(255, 184, 0, 0.3);
}

.stat-card:active::before {
  left: 100%;
}

.stat-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
}

.stat-value {
  font-size: 24px;
  font-weight: 900;
  color: var(--accent);
  letter-spacing: -0.5px;
  text-shadow: 0 2px 10px rgba(255, 184, 0, 0.4);
}

/* ==================== CLICKER ARENA ==================== */
.arena {
  padding: 24px 16px;
  text-align: center;
}

.clicker-wrapper {
  position: relative;
  display: inline-block;
  margin-bottom: 20px;
}

.clicker {
  position: relative;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #FFD700 0%, #FF8C00 50%, #FF6B35 100%);
  cursor: pointer;
  box-shadow: 
    0 0 0 8px rgba(255, 184, 0, 0.1),
    0 0 0 16px rgba(255, 184, 0, 0.05),
    0 0 60px rgba(255, 184, 0, 0.5),
    0 20px 50px rgba(0, 0, 0, 0.4),
    inset 0 -10px 20px rgba(0, 0, 0, 0.3);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.clicker::before {
  content: '';
  position: absolute;
  inset: -50%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    rgba(255, 255, 255, 0.4) 60deg,
    transparent 120deg
  );
  animation: spin 3s linear infinite;
}

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

.clicker__inner {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.clicker__emoji {
  font-size: 80px;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.5));
  animation: coinFloat 3s ease-in-out infinite;
}

@keyframes coinFloat {
  0%, 100% { transform: translateY(0) rotate(-5deg); }
  50% { transform: translateY(-15px) rotate(5deg); }
}

.clicker:active {
  transform: scale(0.88);
  box-shadow: 
    0 0 0 8px rgba(255, 184, 0, 0.2),
    0 0 80px rgba(255, 184, 0, 0.7),
    0 10px 40px rgba(0, 0, 0, 0.5),
    inset 0 -6px 16px rgba(0, 0, 0, 0.4);
}

.clicker:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.clicker__particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

.particle {
  position: absolute;
  font-size: 32px;
  font-weight: 900;
  color: var(--accent);
  text-shadow: 0 0 16px rgba(255, 184, 0, 0.8);
  animation: particleUp 1.2s ease-out forwards;
}

@keyframes particleUp {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-140px) scale(0.4);
  }
}

.clicker__meta {
  color: var(--text-dim);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.clicker__meta span {
  color: var(--accent);
  font-weight: 900;
  font-size: 18px;
}

/* ==================== ACTION BUTTONS ==================== */
.actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 0 0 20px;
}

.action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-weight: 700;
  font-size: 15px;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.action::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.action:active {
  transform: scale(0.94);
}

.action:active::before {
  opacity: 1;
}

.action__icon {
  font-size: 24px;
  line-height: 1;
}

.action--boost {
  background: linear-gradient(135deg, rgba(255, 184, 0, 0.15), rgba(255, 107, 53, 0.1));
  border-color: rgba(255, 184, 0, 0.3);
  box-shadow: 0 4px 16px rgba(255, 184, 0, 0.15);
}

.action--boost:active {
  box-shadow: 0 2px 8px rgba(255, 184, 0, 0.25);
}

.action--energy {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(0, 212, 255, 0.1));
  border-color: rgba(16, 185, 129, 0.3);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.15);
}

.action--energy:active {
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.action:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

/* ==================== STATUS MESSAGES ==================== */
.status {
  min-height: 44px;
  text-align: center;
  font-weight: 700;
  font-size: 14px;
  padding: 12px 20px;
  margin: 0 0 16px;
  border-radius: 16px;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.status:not(:empty) {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  animation: statusSlide 0.3s ease;
}

@keyframes statusSlide {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.status--success {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.05));
  border-color: var(--accent-green);
  color: var(--accent-green);
}

.status--error {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.05));
  border-color: var(--accent-red);
  color: var(--accent-red);
}

.status--warning {
  background: linear-gradient(135deg, rgba(255, 184, 0, 0.2), rgba(255, 184, 0, 0.05));
  border-color: var(--accent);
  color: var(--accent);
}

.status--info {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(168, 85, 247, 0.05));
  border-color: var(--accent-purple);
  color: var(--accent-purple);
}

/* ==================== TASK & GENERAL CARDS ==================== */
.tasks__list,
.ads__list,
.leaderboard__list {
  display: grid;
  gap: 14px;
}

.task-card,
.ad-card,
.profile-card,
.referral-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 20px;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  animation: cardFadeIn 0.4s ease;
}

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

.task-card:active {
  transform: translateY(-6px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 184, 0, 0.3);
}

.task-card h4 {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--text);
  letter-spacing: -0.3px;
}

.task-card h4 span {
  color: var(--accent);
}

.task-card p {
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 16px;
  line-height: 1.6;
}

.task-card button,
.btn-copy {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(135deg, #FFD700 0%, #FF8C00 100%);
  color: #0D0D14;
  font-weight: 800;
  font-size: 15px;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(255, 184, 0, 0.3);
  letter-spacing: 0.3px;
}

.task-card button:active,
.btn-copy:active {
  transform: scale(0.96);
  box-shadow: 0 2px 12px rgba(255, 184, 0, 0.4);
}

.task-card button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

/* ==================== ADS SECTION ==================== */
.ads-section {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.ads-section h3 {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 20px;
  color: var(--text);
  letter-spacing: -0.5px;
}

.ad-card h4 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}

.ad-card a {
  color: var(--accent-blue);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: color 0.3s ease;
}

.ad-card a:hover {
  color: var(--accent);
}

/* ==================== PROFILE ==================== */
.profile-card__stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.profile-stat {
  text-align: center;
}

.profile-stat__label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 8px;
}

.profile-stat__value {
  font-size: 32px;
  font-weight: 900;
  color: var(--accent);
  letter-spacing: -1px;
}

/* ==================== REFERRAL CARD ==================== */
.referral-card {
  margin-top: 20px;
}

.referral-card h3 {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 20px;
  letter-spacing: -0.5px;
}

.referral-stats {
  text-align: center;
  margin-bottom: 24px;
}

.referral-stat__value {
  font-size: 56px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-orange) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -2px;
}

.referral-stat__label {
  font-size: 15px;
  color: var(--text-dim);
  font-weight: 600;
  margin-top: 4px;
}

.referral-link {
  display: flex;
  gap: 10px;
}

.referral-link input {
  flex: 1;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--bg-hover);
  color: var(--text);
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
}

.btn-copy {
  width: auto;
  padding: 16px 24px;
  white-space: nowrap;
}

/* ==================== LEADERBOARD ==================== */
.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  border-radius: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  animation: cardFadeIn 0.4s ease;
}

.leaderboard-item:active {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.leaderboard-item__rank {
  font-size: 36px;
  font-weight: 900;
  width: 56px;
  text-align: center;
  letter-spacing: -1px;
}

.leaderboard-item__info {
  flex: 1;
}

.leaderboard-item__name {
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 4px;
  letter-spacing: -0.3px;
}

.leaderboard-item__stats {
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 500;
}

.leaderboard-item__balance {
  color: var(--accent);
  font-weight: 800;
}

/* Top 3 Styles */
.leaderboard-item--1 {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.25), rgba(255, 184, 0, 0.1));
  border-color: rgba(255, 215, 0, 0.5);
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.2);
}

.leaderboard-item--1 .leaderboard-item__rank {
  background: linear-gradient(135deg, #FFD700 0%, #FF8C00 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.leaderboard-item--2 {
  background: linear-gradient(135deg, rgba(192, 192, 192, 0.2), rgba(169, 169, 169, 0.1));
  border-color: rgba(192, 192, 192, 0.4);
}

.leaderboard-item--3 {
  background: linear-gradient(135deg, rgba(205, 127, 50, 0.2), rgba(184, 115, 51, 0.1));
  border-color: rgba(205, 127, 50, 0.4);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 380px) {
  .hero__title {
    font-size: 38px;
  }
  
  .clicker {
    width: 200px;
    height: 200px;
  }
  
  .clicker__emoji {
    font-size: 68px;
  }
  
  .stats {
    gap: 8px;
  }
  
  .stat-value {
    font-size: 20px;
  }
  
  .actions {
    grid-template-columns: 1fr;
  }
  
  .nav {
    height: 72px;
  }
  
  .nav__item {
    height: 54px;
  }
}

/* ==================== SCROLLBAR ==================== */
.screen::-webkit-scrollbar {
  width: 4px;
}

.screen::-webkit-scrollbar-track {
  background: transparent;
}

.screen::-webkit-scrollbar-thumb {
  background: rgba(255, 184, 0, 0.4);
  border-radius: 2px;
}

.screen::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 184, 0, 0.6);
}

/* ==================== ACCESSIBILITY ==================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}