/* ============================================
   COINRUSH — Acid Neon Design System
   ============================================ */

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

:root {
  --neon-green: #CCFF00;
  --neon-pink: #FF3CAC;
  --neon-blue: #00D4FF;
  --neon-orange: #FF6B2B;
  --bg-dark: #0D0D0D;
  --bg-card: #1A1A2E;
  --bg-card2: #16213E;
  --text-primary: #F0F0F0;
  --text-muted: #888;
  --border: rgba(204, 255, 0, 0.15);
  --glow-green: 0 0 20px rgba(204, 255, 0, 0.4);
  --glow-pink: 0 0 20px rgba(255, 60, 172, 0.4);
  --font: 'Outfit', sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Particle Canvas */
#particles {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

/* ============================================
   HEADER
   ============================================ */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: rgba(13, 13, 13, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-icon { font-size: 22px; }

.logo-text {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--neon-green), var(--neon-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.wallet {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(204, 255, 0, 0.08);
  border: 1px solid rgba(204, 255, 0, 0.3);
  border-radius: 50px;
  padding: 6px 14px;
}

.wallet-icon { font-size: 16px; }

.wallet-amount {
  font-size: 18px;
  font-weight: 800;
  color: var(--neon-green);
  min-width: 40px;
  text-align: center;
  transition: all 0.3s;
}

.wallet-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 1px;
}

.streak-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--neon-orange);
}

.streak-label {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ============================================
   MAIN APP
   ============================================ */
.app {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 0 100px;
}

/* ============================================
   TAB NAVIGATION
   ============================================ */
.tab-nav {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  background: rgba(13, 13, 13, 0.8);
  position: sticky;
  top: 57px;
  z-index: 90;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.tab-btn {
  flex: 1;
  padding: 8px 4px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: all 0.25s;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.05);
}

.tab-btn.active {
  background: rgba(204, 255, 0, 0.12);
  border-color: rgba(204, 255, 0, 0.4);
  color: var(--neon-green);
  box-shadow: var(--glow-green);
}

/* ============================================
   TAB CONTENT
   ============================================ */
.tab-content {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-content.active { display: block; }

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

/* ============================================
   SPIN SECTION
   ============================================ */
.spin-section {
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.spin-header { text-align: center; }

.spin-title {
  font-size: 42px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -1px;
  text-transform: uppercase;
}

.neon-text {
  color: var(--neon-green);
  text-shadow: 0 0 30px rgba(204, 255, 0, 0.6);
}

.spin-subtitle {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.spin-subtitle strong { color: var(--neon-pink); }

/* Wheel */
.wheel-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wheel-glow {
  position: absolute;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(204,255,0,0.08) 0%, transparent 70%);
  animation: pulseGlow 2s ease-in-out infinite;
  pointer-events: none;
}

@keyframes pulseGlow {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.05); opacity: 1; }
}

.wheel-pointer {
  position: absolute;
  top: -14px;
  font-size: 28px;
  color: var(--neon-green);
  text-shadow: var(--glow-green);
  z-index: 10;
  filter: drop-shadow(0 0 8px var(--neon-green));
}

#wheelCanvas {
  border-radius: 50%;
  box-shadow: 0 0 40px rgba(204,255,0,0.2), 0 0 80px rgba(255,60,172,0.1);
  transition: box-shadow 0.3s;
}

#wheelCanvas.spinning {
  box-shadow: 0 0 60px rgba(204,255,0,0.5), 0 0 120px rgba(255,60,172,0.3);
}

/* Spin Info */
.spin-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.spin-counter {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.spin-counter-num {
  font-size: 36px;
  font-weight: 900;
  color: var(--neon-green);
  text-shadow: var(--glow-green);
}

.spin-counter-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}

.spin-timer {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.spin-timer-val {
  font-size: 16px;
  font-weight: 800;
  color: var(--neon-pink);
}

/* Spin Button */
.btn-spin {
  width: 100%;
  max-width: 320px;
  padding: 18px;
  background: linear-gradient(135deg, var(--neon-green), #88FF00);
  border: none;
  border-radius: 16px;
  cursor: pointer;
  font-family: var(--font);
  font-size: 20px;
  font-weight: 900;
  color: #0D0D0D;
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: all 0.2s;
  box-shadow: 0 8px 30px rgba(204,255,0,0.4);
  position: relative;
  overflow: hidden;
}

.btn-spin::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.5s;
}

.btn-spin:hover::before { left: 100%; }

.btn-spin:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(204,255,0,0.6);
}

.btn-spin:active { transform: translateY(0); }

.btn-spin:disabled {
  background: #333;
  color: #666;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.btn-spin:disabled::before { display: none; }

/* Win Popup */
.win-popup {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 200;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
}

.win-popup.show { display: flex; }

.win-popup-inner {
  background: var(--bg-card);
  border: 2px solid var(--neon-green);
  border-radius: 24px;
  padding: 40px 48px;
  text-align: center;
  box-shadow: 0 0 60px rgba(204,255,0,0.3);
  animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
  from { transform: scale(0.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.win-emoji { font-size: 56px; margin-bottom: 12px; }

.win-amount {
  font-size: 64px;
  font-weight: 900;
  color: var(--neon-green);
  text-shadow: 0 0 40px rgba(204,255,0,0.8);
  line-height: 1;
}

.win-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 3px;
  margin: 8px 0 24px;
}

.btn-collect {
  padding: 14px 40px;
  background: var(--neon-green);
  border: none;
  border-radius: 12px;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 900;
  color: #0D0D0D;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-collect:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 30px rgba(204,255,0,0.5);
}

/* ============================================
   TASKS SECTION
   ============================================ */
.tasks-section { padding: 24px 20px; }

.section-title {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.5px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.tasks-header { margin-bottom: 20px; }

.tasks-progress-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tasks-progress-bar {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  overflow: hidden;
}

.tasks-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--neon-green), var(--neon-blue));
  border-radius: 3px;
  width: 0%;
  transition: width 0.5s ease;
}

.tasks-progress-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

.tasks-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.task-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  transition: all 0.3s;
  cursor: pointer;
}

.task-item:hover {
  border-color: rgba(204,255,0,0.3);
  transform: translateX(4px);
}

.task-item.completed {
  opacity: 0.6;
  border-color: rgba(204,255,0,0.4);
  background: rgba(204,255,0,0.05);
}

.task-icon { font-size: 24px; flex-shrink: 0; }

.task-info { flex: 1; }

.task-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.task-item.completed .task-name {
  text-decoration: line-through;
  color: var(--text-muted);
}

.task-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.task-reward {
  font-size: 14px;
  font-weight: 800;
  color: var(--neon-green);
  white-space: nowrap;
}

.task-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
  transition: all 0.3s;
}

.task-item.completed .task-check {
  background: var(--neon-green);
  border-color: var(--neon-green);
  color: #0D0D0D;
}

.bonus-banner {
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, rgba(204,255,0,0.1), rgba(255,60,172,0.1));
  border: 1px solid var(--neon-green);
  border-radius: 16px;
  padding: 16px 20px;
  box-shadow: var(--glow-green);
  animation: popIn 0.4s ease;
}

.bonus-icon { font-size: 32px; }

.bonus-title {
  font-size: 14px;
  font-weight: 900;
  color: var(--neon-green);
  letter-spacing: 1px;
}

.bonus-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.btn-bonus {
  margin-left: auto;
  padding: 10px 20px;
  background: var(--neon-green);
  border: none;
  border-radius: 10px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 900;
  color: #0D0D0D;
  cursor: pointer;
  letter-spacing: 1px;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-bonus:hover { transform: scale(1.05); }

/* ============================================
   LEADERBOARD SECTION
   ============================================ */
.leaderboard-section { padding: 24px 20px; }

.podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  margin-bottom: 28px;
}

.podium-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 12px;
  border-radius: 16px;
  flex: 1;
  max-width: 130px;
  position: relative;
}

.podium-item.first {
  background: linear-gradient(180deg, rgba(204,255,0,0.15), rgba(204,255,0,0.05));
  border: 1px solid rgba(204,255,0,0.4);
  padding-top: 24px;
  box-shadow: var(--glow-green);
}

.podium-item.second {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
}

.podium-item.third {
  background: rgba(255,107,43,0.08);
  border: 1px solid rgba(255,107,43,0.2);
}

.podium-crown {
  font-size: 20px;
  position: absolute;
  top: -14px;
}

.podium-avatar { font-size: 32px; }

.podium-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
}

.podium-coins {
  font-size: 11px;
  font-weight: 600;
  color: var(--neon-green);
}

.podium-rank {
  font-size: 18px;
  font-weight: 900;
  color: var(--text-muted);
}

.podium-item.first .podium-rank { color: var(--neon-green); }

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.lb-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  transition: all 0.2s;
}

.lb-item:hover { border-color: rgba(204,255,0,0.2); }

.lb-rank {
  font-size: 14px;
  font-weight: 900;
  color: var(--text-muted);
  width: 28px;
  text-align: center;
}

.lb-avatar { font-size: 22px; }

.lb-name {
  flex: 1;
  font-size: 14px;
  font-weight: 700;
}

.lb-coins {
  font-size: 13px;
  font-weight: 700;
  color: var(--neon-green);
}

.lb-change {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
}

.lb-change.up { background: rgba(204,255,0,0.15); color: var(--neon-green); }
.lb-change.down { background: rgba(255,60,172,0.15); color: var(--neon-pink); }

.your-rank-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, rgba(255,60,172,0.1), rgba(0,212,255,0.1));
  border: 1px solid rgba(255,60,172,0.3);
  border-radius: 14px;
  padding: 16px 20px;
}

.your-rank-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 2px;
  flex: 1;
}

.your-rank-num {
  font-size: 24px;
  font-weight: 900;
  color: var(--neon-pink);
}

.your-rank-coins {
  font-size: 14px;
  font-weight: 700;
  color: var(--neon-green);
}

/* ============================================
   REDEEM SECTION
   ============================================ */
.redeem-section { padding: 24px 20px; }

.redeem-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: -10px;
  margin-bottom: 20px;
}

.redeem-balance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 24px;
}

.redeem-balance-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 1px;
}

.redeem-balance-amount {
  font-size: 24px;
  font-weight: 900;
  color: var(--neon-green);
}

.rewards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.reward-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px 16px;
  text-align: center;
  transition: all 0.3s;
  cursor: pointer;
}

.reward-card:hover {
  border-color: rgba(204,255,0,0.3);
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.3);
}

.reward-icon { font-size: 36px; margin-bottom: 10px; }

.reward-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.reward-cost {
  font-size: 14px;
  font-weight: 800;
  color: var(--neon-green);
  margin-bottom: 12px;
}

.btn-redeem {
  width: 100%;
  padding: 8px;
  background: rgba(204,255,0,0.1);
  border: 1px solid rgba(204,255,0,0.3);
  border-radius: 8px;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 800;
  color: var(--neon-green);
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-redeem:hover {
  background: var(--neon-green);
  color: #0D0D0D;
}

.btn-redeem:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-redeem:disabled:hover {
  background: rgba(204,255,0,0.1);
  color: var(--neon-green);
}

/* ============================================
   TOAST
   ============================================ */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-card);
  border: 1px solid var(--neon-green);
  border-radius: 50px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  z-index: 300;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
  box-shadow: var(--glow-green);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 400px) {
  .spin-title { font-size: 34px; }
  .rewards-grid { grid-template-columns: 1fr; }
  .podium-item { padding: 12px 8px; }
  .podium-avatar { font-size: 26px; }
}

/* Coin bounce animation */
@keyframes coinBounce {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); color: var(--neon-green); }
  100% { transform: scale(1); }
}

.wallet-amount.bounce {
  animation: coinBounce 0.4s ease;
}