@import url('glass-ui.css');

:root {
  --bg: #0f0f12;
  --panel: rgba(35, 35, 45, 0.7);
  --panel-2: rgba(50, 50, 60, 0.6);
  --panel-3: rgba(60, 60, 70, 0.5);
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.5);
  --primary: #1689ff;
  --primary-light: #4da6ff;
  --accent: #49df64;
  --gold: #f5a623;
  --gold-light: #ffc66b;
  --border: rgba(255, 255, 255, 0.08);
  --border-light: rgba(255, 255, 255, 0.12);
  --background: #0f0f12;
  --header-height: 56px;
  
  /* Glass */
  --blur-sm: 8px;
  --blur-md: 16px;
  --blur-lg: 24px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --transition-normal: 0.25s ease;
}

* { box-sizing: border-box; }

html, body { 
  height: 100%; 
  margin: 0;
  overflow-x: hidden;
}

body {
  background: #0d0d14;
  color: var(--text);
  font-family: 'SFProText', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  position: relative;
}

/* Animated gradient background - VISIBLE colored orbs */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle 400px at 10% 20%, rgba(99, 102, 241, 0.35) 0%, transparent 60%),
    radial-gradient(circle 350px at 90% 15%, rgba(236, 72, 153, 0.3) 0%, transparent 60%),
    radial-gradient(circle 300px at 50% 90%, rgba(34, 211, 238, 0.25) 0%, transparent 60%),
    radial-gradient(circle 250px at 5% 70%, rgba(168, 85, 247, 0.25) 0%, transparent 60%),
    radial-gradient(circle 280px at 85% 80%, rgba(34, 197, 94, 0.2) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
  animation: bgFloat 20s ease-in-out infinite;
}

body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 50% 50%, transparent 0%, rgba(13, 13, 20, 0.5) 100%);
  pointer-events: none;
  z-index: 0;
}

@keyframes bgFloat {
  0%, 100% { transform: scale(1) translate(0, 0); }
  25% { transform: scale(1.1) translate(-2%, 3%); }
  50% { transform: scale(1.05) translate(2%, -2%); }
  75% { transform: scale(1.15) translate(-1%, -3%); }
}

.app { 
  min-height: 100%; 
  display: flex; 
  flex-direction: column;
  padding-bottom: 80px;
  position: relative;
  z-index: 1;
}

/* Glass Balance Bar */
.balance-bar {
  display: flex;
  justify-content: space-between;
  padding: 10px 16px;
  gap: 12px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(15, 15, 20, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  height: var(--header-height);
  align-items: center;
}

.balance-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all var(--transition-normal);
}

.balance-item.stars {
  background: rgba(247, 181, 0, 0.1);
  border: 1px solid rgba(247, 181, 0, 0.2);
  padding: 8px 14px;
}

.balance-item.ton {
  background: rgba(22, 137, 255, 0.1);
  border: 1px solid rgba(22, 137, 255, 0.2);
  padding: 8px 8px 8px 12px;
}

.balance-item:hover {
  transform: scale(1.02);
}

.balance-icon-star {
  font-size: 16px;
  color: #f7b500;
}

.balance-icon-img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.balance-amount {
  color: var(--text);
}

.balance-add {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 4px;
  line-height: 1;
  transition: all var(--transition-normal);
}

.balance-add:hover {
  background: var(--primary);
  transform: scale(1.1);
  box-shadow: 0 0 10px rgba(22, 137, 255, 0.4);
}

/* Hide Snowflakes */
.snowflakes {
  display: none !important;
}

/* Season Header */
.season-header {
  text-align: center;
  padding: 65px 20px 10px;
  position: relative;
}

.rocket-container {
  position: relative;
  width: 200px;
  height: 140px;
  margin: 0 auto 5px;
}

.rocket-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 5px 20px rgba(245, 166, 35, 0.5));
}

/* Stars around rocket */
.star {
  position: absolute;
  color: var(--gold);
  animation: twinkle 2s ease-in-out infinite;
}

.star-1 { top: 5%; left: -20px; font-size: 12px; animation-delay: 0s; }
.star-2 { top: 10%; right: -15px; font-size: 8px; animation-delay: 0.3s; }
.star-3 { bottom: 35%; left: -30px; font-size: 6px; animation-delay: 0.6s; }
.star-4 { top: 35%; right: -25px; font-size: 10px; animation-delay: 0.9s; }
.star-5 { bottom: 10%; right: -20px; font-size: 14px; animation-delay: 1.2s; }
.star-6 { top: -5px; left: 25%; font-size: 5px; animation-delay: 0.2s; color: #fff; }
.star-7 { top: 20%; left: -35px; font-size: 8px; animation-delay: 0.5s; }
.star-8 { top: 55%; right: -35px; font-size: 6px; animation-delay: 0.8s; color: #fff; }
.star-9 { bottom: 5%; left: -18px; font-size: 10px; animation-delay: 1.1s; }
.star-10 { top: 8%; right: -40px; font-size: 5px; animation-delay: 1.4s; color: #fff; }
.star-11 { top: -2px; right: 20%; font-size: 8px; animation-delay: 0.15s; }
.star-12 { bottom: 45%; right: -40px; font-size: 6px; animation-delay: 0.45s; color: #fff; }
.star-13 { top: 65%; left: -40px; font-size: 10px; animation-delay: 0.75s; }
.star-14 { bottom: 30%; left: 8%; font-size: 4px; animation-delay: 1.05s; color: #fff; }
.star-15 { top: 30%; left: -10px; font-size: 6px; animation-delay: 1.35s; }

@keyframes twinkle {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.season-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 6px 0;
}

.season-subtitle {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  line-height: 1.4;
}

/* Season Content */
.season-content {
  padding: 0 16px;
  flex: 1;
}

/* Glass Season Tabs */
.season-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 4px;
  margin-bottom: 20px;
}

.season-tab {
  flex: 1;
  padding: 10px 12px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-normal);
}

.season-tab:hover:not(.active) {
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.03);
}

.season-tab.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

/* Glass Stats Card */
.stats-card {
  background: linear-gradient(
    135deg,
    rgba(25, 20, 10, 0.85) 0%,
    rgba(50, 40, 15, 0.7) 50%,
    rgba(25, 20, 10, 0.85) 100%
  );
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(245, 166, 35, 0.3);
  border-radius: var(--radius-xl);
  padding: 16px;
  position: relative;
  overflow: hidden;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 0 30px rgba(245, 166, 35, 0.1);
}

.stats-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(245, 166, 35, 0.4) 50%,
    transparent 100%
  );
}

.stats-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    ellipse at center,
    rgba(245, 166, 35, 0.15) 0%,
    transparent 50%
  );
  animation: shimmer 4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes shimmer {
  0%, 100% {
    transform: translate(-30%, -30%);
    opacity: 0.5;
  }
  50% {
    transform: translate(30%, 30%);
    opacity: 1;
  }
}

.stats-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.stats-header-text {
  font-size: 14px;
  color: var(--muted);
}

.stats-header-icon {
  font-size: 8px;
  color: var(--muted);
}

.stats-total {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.stats-total-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
}

.stats-total-icon {
  font-size: 24px;
  color: var(--gold);
}

.stats-arrow {
  margin-left: auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--panel-2);
  border: none;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stats-divider {
  height: 1px;
  background: var(--border);
  margin-bottom: 16px;
}

.stats-rows {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.stats-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stats-row-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stats-row-icon-svg {
  width: 18px;
  height: 18px;
  color: var(--muted);
}

.stats-row-label {
  font-size: 14px;
  color: var(--muted);
}

.stats-row-values {
  display: flex;
  align-items: center;
  gap: 4px;
}

.stats-row-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.stats-row-icon-star {
  font-size: 14px;
  color: var(--gold);
}

.stats-row-separator {
  color: var(--muted);
  margin: 0 4px;
}

/* Tasks Section */
.tasks-section {
  margin-top: 16px;
}

.tasks-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.tasks-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.tasks-rating {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
}

.rating-indicator {
  width: 8px;
  height: 8px;
  background: #49df64;
  border-radius: 50%;
}

.tasks-group {
  background: var(--panel);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
}

.tasks-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.tasks-group-title {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

.tasks-timer {
  font-size: 13px;
  color: var(--muted);
  font-family: monospace;
}

.task-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.task-item:last-child {
  border-bottom: none;
}

.task-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.task-icon svg {
  width: 22px;
  height: 22px;
}

.task-icon.telegram {
  background: linear-gradient(135deg, #2AABEE 0%, #229ED9 100%);
  color: white;
}

.task-icon.friends {
  background: linear-gradient(135deg, #7B68EE 0%, #9370DB 100%);
  color: white;
}

.task-icon.cart {
  background: linear-gradient(135deg, #4169E1 0%, #6495ED 100%);
  color: white;
}

.task-icon.cart.purple {
  background: linear-gradient(135deg, #8B5CF6 0%, #A78BFA 100%);
}

.task-icon.offer {
  background: linear-gradient(135deg, #6366F1 0%, #818CF8 100%);
  color: white;
}

.task-icon.download {
  background: linear-gradient(135deg, #10B981 0%, #34D399 100%);
  color: white;
}

.task-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.task-name {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}

.task-reward {
  font-size: 13px;
  color: var(--gold);
  font-weight: 600;
}

.task-star {
  color: var(--gold);
}

.task-btn {
  padding: 8px 16px;
  background: white;
  border: none;
  border-radius: 20px;
  color: #000;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.task-btn:hover {
  background: #e0e0e0;
}

/* Error Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--panel);
  border-radius: 16px;
  padding: 24px;
  width: 90%;
  max-width: 320px;
  text-align: center;
  transform: scale(0.9);
  transition: transform 0.3s;
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.error-modal .error-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
}

.error-modal .error-icon svg {
  width: 100%;
  height: 100%;
}

.error-modal .error-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 12px 0;
}

.error-modal .error-text {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 20px 0;
  line-height: 1.4;
}

.modal-btn {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  margin-bottom: 8px;
}

.modal-btn:last-child {
  margin-bottom: 0;
}

.modal-btn.primary {
  background: var(--primary);
  color: white;
}

.modal-btn.primary:hover {
  background: #1a7ae0;
}

.modal-btn.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.modal-btn.secondary:hover {
  background: var(--panel-2);
}

/* ===== FLOATING GLASS TABBAR ===== */
.tabbar {
  position: fixed;
  bottom: 10px;
  left: 16px;
  right: 16px;
  display: flex;
  gap: 6px;
  z-index: 100;
  align-items: center;
  justify-content: center;
}

.tabbar-main {
  flex: 0 1 auto;
  display: flex;
  justify-content: center;
  gap: 2px;
  background: rgba(120, 120, 140, 0.18);
  backdrop-filter: blur(80px) saturate(180%);
  -webkit-backdrop-filter: blur(80px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  padding: 4px 6px;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 6px 12px;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 9px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  border-radius: 16px;
  background: transparent;
}

.tab:hover {
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.08);
}

.tab.active {
  color: white;
  background: linear-gradient(135deg, rgba(22, 137, 255, 0.95) 0%, rgba(13, 95, 184, 0.95) 100%);
  box-shadow: 
    0 4px 16px rgba(22, 137, 255, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.tab-icon-wrap {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tab-icon {
  width: 16px;
  height: 16px;
  transition: all 0.3s ease;
  color: rgba(255, 255, 255, 0.5);
  stroke: rgba(255, 255, 255, 0.5);
  fill: none;
}

.tab:hover .tab-icon {
  color: rgba(255, 255, 255, 0.8);
  stroke: rgba(255, 255, 255, 0.8);
}

.tab.active .tab-icon {
  color: white;
  stroke: white;
  fill: white;
}

.tab-label {
  font-size: 9px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.tab.active .tab-label {
  color: white;
}

/* Tab Avatar - Separate Circle */
.tab-avatar {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  backdrop-filter: blur(80px) saturate(180%);
  -webkit-backdrop-filter: blur(80px) saturate(180%);
  border: 2px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  text-decoration: none;
}

.tab-avatar:hover {
  transform: scale(1.05);
  border-color: rgba(255, 255, 255, 0.3);
}

.tab-avatar.active {
  border: 2px solid var(--primary);
  box-shadow: 
    0 0 20px rgba(22, 137, 255, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.tab-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: none;
}

.tab-avatar-img.loaded,
.tab-avatar-img[src]:not([src=""]) {
  display: block;
}

.tab-avatar-img.loaded + .tab-avatar-letter,
.tab-avatar-img[src]:not([src=""]) + .tab-avatar-letter {
  display: none;
}

.tab-avatar-letter {
  font-size: 14px;
  font-weight: 600;
  color: white;
  text-transform: uppercase;
}
