:root {
  --bg-app: #080614;
  --bg-surface: #110d29;
  --bg-surface-subtle: #19143b;
  --bg-surface-active: #241b5c;
  
  --border-subtle: rgba(139, 92, 246, 0.16);
  --border-focus: rgba(139, 92, 246, 0.45);

  --text-main: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-purple: #8b5cf6;
  --accent-violet: #7c3aed;
  --accent-blue: #8b5cf6;
  --accent-gold: #fbbf24;
  --accent-green: #10b981;
  --accent-red: #ef4444;

  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Cabinet Grotesk', var(--font-family);

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 0 25px rgba(139, 92, 246, 0.3);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  font-family: var(--font-family);
  user-select: none;
}

body {
  background-color: #030712;
  color: var(--text-main);
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-x: hidden;
}

/* App Container - Mobile First Frame */
.app-container {
  width: 100%;
  max-width: 480px;
  min-height: 100dvh;
  background-color: var(--bg-app);
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.85);
  padding-bottom: 74px; /* Space for bottom nav */
}

/* ==================== APP HEADER ==================== */
.app-header {
  height: 60px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(8, 12, 21, 0.85);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border-subtle);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo-img {
  height: 28px;
  max-width: 140px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 8px rgba(139, 92, 246, 0.35));
}

.brand-logo-mark {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, #2563eb, #38bdf8);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: var(--text-main);
  line-height: 1;
}

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

.brand-tag {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: var(--accent-green);
  margin-top: 2px;
}

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

.wallet-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 5px 10px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.15s ease;
}

.wallet-badge:hover {
  background: var(--bg-surface-subtle);
  border-color: var(--accent-gold);
}

.wallet-currency-symbol {
  color: var(--accent-gold);
  font-weight: 800;
  font-size: 0.85rem;
}

.wallet-val {
  font-weight: 800;
  font-size: 0.9rem;
  color: #ffffff;
}

.wallet-plus-icon {
  background: var(--accent-green);
  color: #fff;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-login-pill {
  background: var(--accent-blue);
  color: #ffffff;
  border: none;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.user-profile-circle {
  width: 34px;
  height: 34px;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: var(--text-main);
  font-size: 0.85rem;
  cursor: pointer;
}

/* ==================== TICKER ==================== */
.payout-ticker {
  background: #0d121d;
  border-bottom: 1px solid var(--border-subtle);
  padding: 6px 14px;
  display: flex;
  align-items: center;
  overflow: hidden;
  font-size: 0.74rem;
}

.ticker-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-green);
  font-weight: 800;
  font-size: 0.65rem;
  letter-spacing: 0.5px;
  white-space: nowrap;
  padding-right: 10px;
  border-right: 1px solid var(--border-subtle);
}

.live-pulse {
  width: 6px;
  height: 6px;
  background: var(--accent-green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-green);
}

.ticker-slider {
  overflow: hidden;
  white-space: nowrap;
  margin-left: 10px;
}

.ticker-track {
  display: inline-block;
  animation: scrollTicker 30s linear infinite;
}

.ticker-item {
  margin-right: 24px;
  color: var(--text-secondary);
}

.ticker-item b {
  color: var(--accent-gold);
}

@keyframes scrollTicker {
  0% { transform: translateX(0%); }
  100% { transform: translateX(-50%); }
}

/* ==================== MAIN VIEWS ==================== */
.app-main {
  flex: 1;
  padding: 16px;
}

.tab-view {
  display: none;
  animation: viewFade 0.2s ease-out;
}

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

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

/* Single Direct Play & Earn Card */
.play-hero-card {
  background: linear-gradient(145deg, #131b2e 0%, #0f1728 100%);
  border-radius: var(--radius-xl);
  padding: 22px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.tag-status {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.12);
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.tag-guarantee {
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--accent-green);
}

.card-heading {
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 6px;
}

.gradient-text {
  background: linear-gradient(90deg, #38bdf8, #818cf8, #fbbf24);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.card-subtext {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 20px;
}

.game-stage-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 16px;
}

.stage-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.stage-label {
  display: block;
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main);
}

.stage-payout {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.stage-payout b {
  color: var(--accent-gold);
}

.stage-dots-preview {
  display: flex;
  gap: 6px;
}

.preview-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dot-red { background: #ef4444; box-shadow: 0 0 8px rgba(239, 68, 68, 0.5); }
.dot-blue { background: #3b82f6; box-shadow: 0 0 8px rgba(59, 130, 246, 0.5); }
.dot-green { background: #10b981; box-shadow: 0 0 8px rgba(16, 185, 129, 0.5); }

.btn-cta-primary {
  width: 100%;
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  color: #ffffff;
  border: none;
  font-weight: 800;
  font-size: 1rem;
  padding: 14px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(109, 40, 217, 0.35);
  transition: all 0.15s ease;
}

.btn-cta-primary:hover {
  background: linear-gradient(135deg, #9333ea, #7c3aed);
  box-shadow: 0 10px 28px rgba(109, 40, 217, 0.5);
}
}

.btn-cta-primary:active {
  transform: scale(0.98);
}

/* Stage Progress Bar */
.stage-progress-wrapper {
  margin-top: 6px;
}

.stage-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.progress-bar-bg {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #10b981);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

/* Surface Cards */
.surface-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 16px;
}

.card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.card-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
}

.card-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.btn-streak-claim {
  background: var(--accent-green);
  color: #ffffff;
  border: none;
  font-weight: 800;
  font-size: 0.8rem;
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-streak-claim.claimed {
  background: var(--bg-surface-subtle);
  color: var(--text-muted);
  cursor: default;
}

/* 7-Day Streak */
.streak-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}

.streak-cell {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 8px 3px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.streak-cell.claimed {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
}

.streak-cell.active {
  border-color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.15);
}

.streak-d {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-muted);
}

.streak-r {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--accent-gold);
}

/* Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.feature-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.feature-icon {
  width: 32px;
  height: 32px;
  background: var(--bg-surface-subtle);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-blue);
}

.feature-item h4 {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.feature-item p {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* ==================== ACTIVE GAME VIEW ==================== */
.game-screen-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.game-nav-bar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.btn-icon-nav {
  width: 38px;
  height: 38px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.game-level-indicator {
  text-align: center;
}

.game-level-indicator h3 {
  font-size: 1.05rem;
  font-weight: 800;
}

.game-reward-chip {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--accent-gold);
}

.game-metrics-bar {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.metric-block {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.metric-title {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.metric-value {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
}

.text-accent {
  color: var(--accent-gold);
}

/* Game Canvas & Board */
.game-canvas-wrapper {
  position: relative;
  width: 320px;
  height: 320px;
  max-width: 88vw;
  max-height: 88vw;
  background: #090e1a;
  border-radius: var(--radius-lg);
  border: 1.5px solid #23304a;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.75), inset 0 0 20px rgba(0, 0, 0, 0.6);
  margin-bottom: 16px;
  touch-action: none; /* Mandatory for mobile touch tracking */
}

.flow-grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: grid;
  z-index: 1;
}

.grid-cell {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
}

.endpoint-dot {
  width: 54%;
  height: 54%;
  border-radius: 50%;
  box-shadow: 0 0 14px currentColor;
  position: relative;
  z-index: 2;
  transition: transform 0.12s ease;
}

.endpoint-dot::after {
  content: "";
  position: absolute;
  top: 22%;
  left: 22%;
  width: 28%;
  height: 28%;
  background: rgba(255, 255, 255, 0.75);
  border-radius: 50%;
}

.flow-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  pointer-events: none;
}

.game-controls-foot {
  text-align: center;
}

.game-instruction-text {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* ==================== WALLET & PASSBOOK VIEW ==================== */
.passbook-hero {
  background: linear-gradient(145deg, #131b2e 0%, #064e3b 100%);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-card);
  margin-bottom: 14px;
}

.passbook-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.passbook-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #a7f3d0;
}

.passbook-status {
  font-size: 0.65rem;
  font-weight: 800;
  color: #34d399;
}

.balance-display {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 4px;
}

.curr-sign {
  font-size: 2rem;
  font-weight: 800;
  color: #34d399;
}

.balance-digits {
  font-size: 3.2rem;
  font-weight: 900;
  letter-spacing: -1px;
  font-family: var(--font-display);
}

.balance-note {
  font-size: 0.78rem;
  color: #a7f3d0;
  margin-bottom: 18px;
}

.metrics-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.metric-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px;
  text-align: center;
}

.m-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 2px;
}

.m-val {
  font-size: 0.95rem;
  font-weight: 800;
}

.text-green { color: #34d399; }

.tab-selector {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 10px;
  margin-bottom: 12px;
}

.selector-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 6px 14px;
  border-radius: var(--radius-xs);
  cursor: pointer;
}

.selector-tab.active {
  background: var(--bg-surface-subtle);
  color: var(--text-main);
}

.history-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-card {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.history-desc h4 {
  font-size: 0.82rem;
  font-weight: 700;
}

.history-desc small {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.history-cash {
  font-size: 0.92rem;
  font-weight: 800;
}

.history-cash.credit { color: #34d399; }
.history-cash.debit { color: #f87171; }

.badge-tag {
  font-size: 0.62rem;
  font-weight: 800;
  padding: 3px 6px;
  border-radius: 4px;
}

.badge-tag.COMPLETED { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.badge-tag.PENDING { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.badge-tag.REJECTED { background: rgba(239, 68, 68, 0.2); color: #f87171; }

/* ==================== TASKS VIEW ==================== */
.tasks-wrapper {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section-title-box h2 {
  font-size: 1.15rem;
  font-weight: 800;
}

.section-title-box p {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.task-card-premium {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.task-icon-wrap {
  width: 44px;
  height: 44px;
  background: #0284c7;
  color: #fff;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.task-icon-wrap.invite-wrap {
  background: #059669;
}

.task-tag {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.6px;
  color: #38bdf8;
  display: block;
  margin-bottom: 2px;
}

.task-tag.green-tag { color: #34d399; }

.task-content h3 {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.task-content p {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.35;
  margin-bottom: 8px;
}

.task-reward-line {
  font-size: 0.82rem;
}

.task-reward-line b {
  color: var(--accent-gold);
}

.btn-telegram-action {
  width: 100%;
  background: #0284c7;
  color: #fff;
  border: none;
  font-weight: 800;
  font-size: 0.9rem;
  padding: 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}

.btn-whatsapp-action {
  width: 100%;
  background: #059669;
  color: #fff;
  border: none;
  font-weight: 800;
  font-size: 0.9rem;
  padding: 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
}

.ref-copy-box {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.ref-copy-box input {
  flex: 1;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 6px 10px;
  color: var(--text-secondary);
  font-size: 0.75rem;
}

.btn-copy-small {
  background: var(--bg-surface-active);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 0 12px;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: var(--radius-xs);
  cursor: pointer;
}

/* ==================== BOTTOM NAV ==================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: 64px;
  background: rgba(8, 12, 21, 0.92);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 50;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.nav-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 12px;
  flex: 1;
  cursor: pointer;
  transition: all 0.15s ease;
}

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

.nav-tab span {
  font-size: 0.68rem;
  font-weight: 700;
}

/* ==================== MODALS ==================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100dvh;
  background: rgba(3, 7, 18, 0.78);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
  padding: 16px;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 400px;
  padding: 24px;
  position: relative;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
  transform: translateY(16px) scale(0.97);
  transition: all 0.22s ease;
}

/* Auth Modal Hero Artwork Card */
.auth-modal-card {
  padding: 0 !important;
  overflow: hidden;
  max-width: 380px;
  background: #0f0a26 !important;
  border: 1px solid rgba(139, 92, 246, 0.3) !important;
}

.auth-modal-card .modal-close-icon {
  z-index: 20;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
}

.auth-card-hero {
  position: relative;
  width: 100%;
  height: 145px;
  overflow: hidden;
  background: #090618;
}

.auth-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.auth-hero-gradient {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 65px;
  background: linear-gradient(to bottom, transparent, #0f0a26);
}

.auth-hero-badge {
  position: absolute;
  top: 14px;
  left: 16px;
  background: rgba(26, 16, 61, 0.75);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(251, 191, 36, 0.6);
  color: #fbbf24;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 5;
}

.auth-card-content {
  padding: 14px 20px 22px 20px;
}

.auth-heading-area {
  margin-bottom: 14px;
}

.auth-heading-area h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 4px;
}

.auth-heading-area p {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.auth-trust-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 14px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.auth-trust-badges span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.otp-hint-subtle {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 6px;
}

.otp-hint-subtle b {
  color: #a78bfa;
  cursor: pointer;
  text-decoration: underline;
}

.modal-backdrop.active .modal-card {
  transform: translateY(0) scale(1);
}

.modal-close-icon {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-brand-head {
  text-align: center;
  margin-bottom: 16px;
}

.modal-icon-badge {
  width: 48px;
  height: 48px;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: 50%;
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-blue);
}

.modal-icon-badge.telegram-badge {
  background: #0284c7;
  color: #fff;
}

.modal-brand-head h2 {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.modal-brand-head p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

/* Forms */
.form-field {
  margin-bottom: 12px;
  text-align: left;
}

.form-field label {
  display: block;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.form-input {
  width: 100%;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  color: var(--text-main);
  font-size: 0.9rem;
  outline: none;
}

.form-input:focus {
  border-color: var(--border-focus);
}

.phone-input-row {
  display: flex;
  align-items: center;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.phone-prefix {
  padding: 0 12px;
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-right: 1px solid var(--border-subtle);
}

.phone-box {
  border: none !important;
  background: transparent !important;
}

.otp-digits {
  text-align: center;
  letter-spacing: 12px;
  font-size: 1.4rem;
  font-weight: 800;
}

.otp-dest-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 10px;
}

.otp-quick-tap {
  background: rgba(59, 130, 246, 0.1);
  border: 1px dashed rgba(59, 130, 246, 0.35);
  color: #60a5fa;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 7px;
  border-radius: var(--radius-xs);
  text-align: center;
  cursor: pointer;
  margin-top: 6px;
}

/* Victory Modal */
.victory-card {
  text-align: center;
}

.victory-badge {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--accent-green);
  display: block;
  margin-bottom: 4px;
}

.victory-header h2 {
  font-size: 1.35rem;
  font-weight: 900;
}

.victory-header p {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.reward-token-box {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin: 14px 0 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.reward-sym {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent-gold);
}

.reward-val {
  font-size: 3.2rem;
  font-weight: 900;
  line-height: 1;
  color: #ffffff;
  font-family: var(--font-display);
}

.reward-type {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Telegram Gate Modal */
.bonus-unlock-panel {
  background: rgba(2, 132, 199, 0.12);
  border: 1px solid rgba(2, 132, 199, 0.3);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
}

.bonus-unlock-panel h4 {
  font-size: 0.88rem;
  font-weight: 800;
}

.bonus-unlock-panel p {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.bonus-amount-badge {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--accent-gold);
}

/* Payout Selector */
.payout-type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.payout-type-btn {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.payout-type-btn.active {
  background: rgba(59, 130, 246, 0.15);
  border-color: var(--accent-blue);
  color: var(--text-main);
}

.amount-presets {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.preset-pill {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: var(--radius-xs);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.security-caption {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 8px;
}

/* Buttons */
.btn {
  border: none;
  font-family: var(--font-family);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-full { width: 100%; }

.btn-subtle {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-weight: 700;
  padding: 12px;
}

.btn-link-subtle {
  background: transparent;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

/* Utilities */
.hide { display: none !important; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 14px; }
.text-danger { color: var(--accent-red); }

/* Toasts */
.toast-stack {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 200;
  pointer-events: none;
}

.toast-item {
  background: rgba(16, 23, 38, 0.95);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 700;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
  animation: toastIn 0.2s ease-out;
}

.toast-item.success { border-color: var(--accent-green); }
.toast-item.error { border-color: var(--accent-red); }

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

/* ==================== PROFILE VIEW STYLES ==================== */
.profile-hero-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
}

.profile-top-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.profile-avatar-wrap {
  position: relative;
}

.profile-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-orange), var(--accent-red));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
  border: 2px solid var(--border-medium);
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.2);
}

.profile-details {
  flex: 1;
  min-width: 0;
}

.profile-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.profile-name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
}

.task-bot-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.code-input-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  width: 100%;
}

.code-input-row .code-digit-input {
  flex: 1;
  min-width: 0;
  text-align: center;
}

.code-input-row .btn {
  white-space: nowrap;
  padding: 0 16px;
  flex-shrink: 0;
}

.badge-status-green {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--accent-green);
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
}

.profile-phone {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.profile-joined {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.btn-logout-header {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.btn-logout-header:hover {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
  border-color: rgba(239, 68, 68, 0.4);
}

/* 4-Metric Stats Grid */
.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.profile-stat-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  position: relative;
}

.profile-stat-box .stat-meta {
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.profile-stat-box .stat-value {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
}

.profile-stat-box .stat-sub {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.btn-mini-withdraw {
  margin-top: 6px;
  background: var(--accent-green);
  border: none;
  color: #052e16;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  width: fit-content;
  transition: opacity 0.15s ease;
}

.btn-mini-withdraw:hover {
  opacity: 0.9;
}

/* Refer & Earn 1-Line Banner */
.referral-banner-card {
  background: linear-gradient(135deg, #101726, #172033);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 16px;
  position: relative;
}

.ref-badge {
  display: inline-block;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: var(--accent-orange);
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.ref-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 3px;
}

.ref-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.35;
}

.ref-compact-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 4px 6px;
}

.ref-compact-row .ref-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 4px;
  outline: none;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.btn-copy-action {
  background: var(--accent-blue);
  color: #fff;
  border: none;
  padding: 7px 12px;
  border-radius: var(--radius-xs);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.15s ease;
}

.btn-copy-action:hover {
  opacity: 0.9;
}

.btn-wa-share {
  background: #25D366;
  color: #064e3b;
  border: none;
  padding: 7px 12px;
  border-radius: var(--radius-xs);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.15s ease;
}

.btn-wa-share:hover {
  opacity: 0.9;
}

/* History Segment Container */
.history-segment-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 24px;
}

.history-nav-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  background: var(--bg-surface-subtle);
  padding: 4px;
  border-radius: var(--radius-pill);
  margin-bottom: 14px;
}

.history-nav-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 8px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.history-nav-btn.active {
  background: var(--bg-surface-active);
  color: var(--text-main);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.history-feed {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-item {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: border-color 0.15s ease;
}

.history-item:hover {
  border-color: var(--border-medium);
}

.history-item-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.history-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.history-date {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.history-badge {
  font-size: 0.62rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
}

.history-badge.badge-success {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
}

.history-badge.badge-pending {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-orange);
}

.history-badge.badge-rejected {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
}

.history-item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}

.history-amount {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 800;
}

.history-amount.positive {
  color: var(--accent-green);
}

.history-amount.negative {
  color: var(--accent-red);
}

.history-utr {
  font-size: 0.64rem;
  color: var(--text-muted);
  font-family: monospace;
}

.history-empty {
  text-align: center;
  padding: 30px 16px;
  color: var(--text-muted);
  font-size: 0.8rem;
  background: var(--bg-surface-subtle);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-subtle);
}

/* Telegram 6-Digit Code Styles */
.code-digit-input {
  letter-spacing: 0.25em;
  font-family: monospace;
  font-size: 1.15rem !important;
  font-weight: 800 !important;
  text-transform: uppercase;
}

.code-digit-input::placeholder {
  letter-spacing: normal;
  text-transform: none;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.task-code-stack {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin-top: 4px;
}

.task-code-stack .code-digit-input {
  width: 100% !important;
  min-width: 100% !important;
  box-sizing: border-box !important;
  display: block;
}

.task-code-stack .btn {
  width: 100%;
  padding: 12px 14px;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.3;
}

.code-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.btn-telegram-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #229ED9;
  color: #fff;
  border: none;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.btn-telegram-pill:hover {
  opacity: 0.9;
}

