/* ── ESTILOS GENERALES Y CONFIGURACIÓN (TEMA CLARO MINIMALISTA) ── */
:root {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  
  --accent: #7c3aed;
  --accent-rgb: 124, 58, 237;
  --accent-light: #ddd6fe;
  --accent-dark: #6d28d9;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  --green: #10b981;
  --red: #ef4444;
  
  --shadow-sm: 0 4px 12px rgba(15, 23, 42, 0.03);
  --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 20px 48px rgba(15, 23, 42, 0.09);
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: #f1f5f9;
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
  /* Usar dvh (dynamic viewport height) para cubrir correctamente en móviles con barra de navegación */
  height: 100dvh;
  height: 100vh; /* fallback */
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ── CONTENEDOR PRINCIPAL (MODO PHONE REAL) ────────── */
#app, #splash, #login {
  width: 100%;
  max-width: 440px;
  height: 100%;
  max-height: 900px;
  background-color: var(--bg-primary);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(15, 23, 42, 0.05);
  /* Safe area insets para teléfonos con notch/isla dinámica */
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

/* En tablet/desktop: mostrar como tarjeta flotante centrada */
@media (min-width: 500px) {
  #app, #splash, #login {
    border-radius: var(--radius-xl);
    height: 92dvh;
    height: 92vh;
    padding-top: 0;
    padding-bottom: 0;
  }
}

/* En teléfonos reales: ocupar toda la pantalla */
@media (max-width: 499px) {
  body {
    background-color: var(--bg-primary);
    align-items: stretch;
  }
  #app, #splash, #login {
    max-width: 100%;
    max-height: 100%;
    height: 100dvh;
    height: 100vh;
    border-radius: 0;
    border: none;
    box-shadow: none;
  }
}

.hidden {
  display: none !important;
}

/* ── SPLASH SCREEN ──────────────────────────────────── */
#splash {
  justify-content: center;
  align-items: center;
  background: radial-gradient(circle at top, #f5f3ff 0%, var(--bg-primary) 70%);
  z-index: 100;
  padding: 20px;
  text-align: center;
}

.splash-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 4px 10px rgba(124, 58, 237, 0.25));
  animation: pulse-glow 2s infinite ease-in-out;
}

.logo-icon svg {
  stroke: var(--accent);
  fill: rgba(124, 58, 237, 0.12);
}

.logo-text {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -1px;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.splash-sub {
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 400;
  margin-bottom: 40px;
}

.splash-loader {
  width: 160px;
  height: 4px;
  background-color: var(--bg-tertiary);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.splash-bar {
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, #a78bfa 100%);
  border-radius: 2px;
  position: absolute;
  left: 0;
  animation: loading-bar 1.8s infinite ease-in-out;
}

@keyframes loading-bar {
  0% { left: -40%; }
  50% { left: 100%; }
  100% { left: 100%; }
}

@keyframes pulse-glow {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 4px 10px rgba(124, 58, 237, 0.15)); }
  50% { transform: scale(1.08); filter: drop-shadow(0 6px 18px rgba(124, 58, 237, 0.4)); }
}

/* ── LOGIN SCREEN ───────────────────────────────────── */
#login {
  justify-content: center;
  align-items: center;
  background: radial-gradient(circle at top, #f5f3ff 0%, var(--bg-primary) 70%);
  z-index: 90;
  padding: 32px 24px;
}

.login-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  animation: fade-in-up 0.5s ease-out;
}

.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 12px;
}

.login-sub {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

#login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.input-group label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  pointer-events: none;
  transition: var(--transition);
}

.input-wrapper input {
  width: 100%;
  height: 48px;
  padding: 0 16px 0 44px;
  background-color: var(--bg-secondary);
  border: 1px solid rgba(124, 58, 237, 0.15);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.input-wrapper input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.input-wrapper input:focus + .input-icon,
.input-wrapper input:not(:placeholder-shown) + .input-icon {
  color: var(--accent);
}

.login-btn {
  width: 100%;
  height: 48px;
  border-radius: var(--radius-md);
  border: none;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  transition: var(--transition);
}

.login-btn.primary-btn {
  background-color: var(--accent);
  color: #fff;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.3);
}

.login-btn.primary-btn:hover {
  background-color: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4);
}

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

.login-divider-text {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  position: relative;
  margin: 16px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.login-divider-text::before,
.login-divider-text::after {
  content: '';
  flex: 1;
  height: 1px;
  background-color: rgba(15, 23, 42, 0.08);
}

.login-btn.guest-btn {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid rgba(124, 58, 237, 0.2);
  box-shadow: var(--shadow-sm);
}

.login-btn.guest-btn:hover {
  background-color: rgba(124, 58, 237, 0.04);
  border-color: var(--accent);
  transform: translateY(-2px);
}

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

/* Auth Switch (Logearme / Registrarme) */
.auth-switch-container {
  display: flex;
  position: relative;
  background-color: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 24px;
  border: 1px solid rgba(124, 58, 237, 0.08);
}

.auth-switch-slider {
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(50% - 4px);
  height: calc(100% - 8px);
  background-color: var(--bg-secondary);
  border-radius: calc(var(--radius-md) - 2px);
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
}

.auth-switch-btn {
  flex: 1;
  background: none;
  border: none;
  height: 38px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  position: relative;
  z-index: 2;
  transition: color 0.3s ease;
}

.auth-switch-btn.active {
  color: var(--accent);
}

.auth-switch-container.register-active .auth-slider-offset {
  transform: translateX(100%);
}

.auth-switch-container.register-active .auth-switch-slider {
  transform: translateX(100%);
}

.login-footer {
  margin-top: 24px;
  text-align: center;
}

.login-footer p {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── PAGES & LAYOUT ────────────────────────────────── */
.page {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px;
  display: none;
  flex-direction: column;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.page.active {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

.page-bottom-space {
  height: 100px;
  flex-shrink: 0;
}

/* Custom Scrollbar for pages */
.page::-webkit-scrollbar {
  width: 4px;
}
.page::-webkit-scrollbar-thumb {
  background-color: var(--bg-tertiary);
  border-radius: 4px;
}

/* ── APP HEADERS ───────────────────────────────────── */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

/* PROFILE DROPDOWN MENU */
.profile-dropdown {
  position: absolute;
  top: 54px;
  left: 0;
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(124, 58, 237, 0.1);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  z-index: 40;
  width: 175px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transform-origin: top left;
  animation: pop-in 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dropdown-arrow {
  position: absolute;
  top: -6px;
  left: 16px;
  width: 10px;
  height: 10px;
  background-color: rgba(255, 255, 255, 0.9);
  border-top: 1px solid rgba(124, 58, 237, 0.1);
  border-left: 1px solid rgba(124, 58, 237, 0.1);
  transform: rotate(45deg);
  z-index: 1;
}

@keyframes pop-in {
  from { opacity: 0; transform: scale(0.9) translateY(-6px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.dropdown-item {
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 600;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  width: 100%;
  transition: var(--transition);
  z-index: 2;
}

.dropdown-item .dropdown-icon {
  color: var(--text-secondary);
  transition: var(--transition);
}

.dropdown-item:hover {
  background-color: var(--bg-tertiary);
}

.dropdown-item:hover .dropdown-icon {
  color: var(--accent);
  transform: scale(1.05);
}

.dropdown-item.danger {
  color: var(--red);
}

.dropdown-item.danger .dropdown-icon {
  color: var(--red);
}

.dropdown-item.danger:hover {
  background-color: rgba(239, 68, 68, 0.06);
}

.dropdown-divider {
  height: 1px;
  background-color: #f1f5f9;
  margin: 4px 6px;
  z-index: 2;
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
  border: 2px solid #fff;
  box-shadow: var(--shadow-sm);
}

.header-greeting {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.header-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

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

.vip-badge {
  background: linear-gradient(135deg, #ffd700 0%, #ffa500 100%);
  color: #fff;
  font-weight: 800;
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 30px;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 10px rgba(255, 165, 0, 0.2);
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.notif-btn {
  background: var(--bg-secondary);
  border: 1px solid rgba(15, 23, 42, 0.05);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--text-secondary);
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.notif-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.notif-dot {
  position: absolute;
  top: 11px;
  right: 11px;
  width: 6px;
  height: 6px;
  background-color: var(--red);
  border-radius: 50%;
}

.notif-container {
  position: relative;
  display: inline-block;
}

.notif-dropdown {
  position: absolute;
  top: 48px;
  right: 0;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(124, 58, 237, 0.15);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  z-index: 50;
  width: 280px;
  padding: 8px 0;
  display: flex;
  flex-direction: column;
  transform-origin: top right;
  animation: pop-in 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.notif-dropdown.hidden {
  display: none;
}

.notif-arrow {
  left: auto;
  right: 15px;
}

.notif-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px 12px 16px;
  border-bottom: 1px solid rgba(124, 58, 237, 0.08);
}

.notif-header h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.notif-clear-btn {
  background: none;
  border: none;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: var(--transition);
}

.notif-clear-btn:hover {
  background-color: rgba(124, 58, 237, 0.08);
}

.notif-list {
  max-height: 250px;
  overflow-y: auto;
  padding: 4px 0;
}

/* Barra de desplazamiento personalizada */
.notif-list::-webkit-scrollbar {
  width: 4px;
}

.notif-list::-webkit-scrollbar-track {
  background: transparent;
}

.notif-list::-webkit-scrollbar-thumb {
  background: rgba(124, 58, 237, 0.2);
  border-radius: 2px;
}

.notif-item {
  padding: 10px 16px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.03);
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: var(--transition);
  text-align: left;
}

.notif-item:last-child {
  border-bottom: none;
}

.notif-item:hover {
  background-color: rgba(124, 58, 237, 0.03);
}

.notif-item.unread {
  background-color: rgba(124, 58, 237, 0.05);
}

.notif-item-text {
  font-size: 0.8rem;
  line-height: 1.35;
  color: var(--text-primary);
  word-break: break-word;
}

.notif-item-time {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.notif-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  text-align: center;
  color: var(--text-secondary);
  gap: 8px;
}

.notif-empty-icon {
  font-size: 1.8rem;
  opacity: 0.7;
}

.notif-empty-text {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.page-title {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

/* ── WALLET CARD (DISEÑO CLARO PREMIUM - TOTALMENTE CENTRADO Y COMPATIBLE) ── */
.wallet-card {
  background: linear-gradient(145deg, var(--bg-secondary) 0%, #fcfbfe 100%);
  border: 1px solid rgba(124, 58, 237, 0.12);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  flex-shrink: 0; /* Evita que el contenedor padre flex reduzca el alto de la tarjeta */
}

.wallet-card::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -80px;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.05) 0%, transparent 70%);
  pointer-events: none;
}

/* Badge de recompensas - flujo natural centrado al inicio */
.wallet-multiplier-badge {
  display: inline-block;
  background-color: rgba(124, 58, 237, 0.08);
  border: 1px solid rgba(124, 58, 237, 0.15);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.75rem;
  padding: 5px 14px;
  border-radius: 20px;
  letter-spacing: 0.3px;
  margin-bottom: 12px;
  animation: pulse-badge 2s infinite ease-in-out;
  position: relative;
  z-index: 2;
}

@keyframes pulse-badge {
  0%, 100% { transform: scale(1); box-shadow: 0 2px 8px rgba(124, 58, 237, 0.04); }
  50% { transform: scale(1.03); box-shadow: 0 4px 14px rgba(124, 58, 237, 0.1); }
}

/* Label centrado */
.wallet-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 6px;
  width: 100%;
}

/* Saldo - Color de acento de marca para la combinación "Saldo: $X.XX" con legibilidad 100% garantizada */
.wallet-balance {
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.8px;
  color: var(--accent);
  margin-bottom: 18px;
  width: 100%;
}

.wallet-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  width: 100%;
}


.wallet-btn {
  flex: 1;
  height: 42px;
  border-radius: var(--radius-md);
  border: none;
  font-weight: 600;
  font-size: 0.85rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--transition);
}

.wallet-btn.primary {
  background-color: var(--accent);
  color: #fff;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.2);
}

.wallet-btn.primary:hover {
  background-color: var(--accent-dark);
  transform: translateY(-2px);
}

.wallet-btn.secondary {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid rgba(15, 23, 42, 0.05);
}

.wallet-btn.secondary:hover {
  background-color: #e2e8f0;
  transform: translateY(-2px);
}

.wallet-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid #f1f5f9;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.stat-val {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.stat-val.accent {
  color: var(--accent);
}

.stat-divider {
  width: 1px;
  height: 24px;
  background-color: #e2e8f0;
}

/* ── TICKER (MENSAJES CLAROS) ───────────────────────── */
.ticker-wrap {
  width: 100%;
  height: 36px;
  background-color: rgba(124, 58, 237, 0.05);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
  margin-bottom: 24px;
  padding: 0 12px;
  border: 1px solid rgba(124, 58, 237, 0.08);
}

.ticker-track {
  white-space: nowrap;
  will-change: transform;
  display: flex;
  gap: 40px;
  animation: ticker-slide 20s linear infinite;
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 600;
}

@keyframes ticker-slide {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

/* ── SECTIONS & HEADERS ────────────────────────────── */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.section-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text-primary);
}

.see-all {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.see-all:hover {
  color: var(--accent-dark);
}

/* ── TASK CARDS (ESTILO CLARO) ─────────────────────── */
.task-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.task-list.full {
  margin-top: 16px;
}

.task-card {
  background-color: var(--bg-secondary);
  border: 1px solid rgba(15, 23, 42, 0.04);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.task-card:hover {
  background-color: #fcfbfe;
  border-color: rgba(124, 58, 237, 0.2);
  transform: scale(1.01);
  box-shadow: var(--shadow-md);
}

.task-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.task-cat {
  font-size: 0.65rem;
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.task-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.task-reward {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--green);
}

.task-action {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: rgba(124, 58, 237, 0.08);
  color: var(--accent);
  display: flex;
  justify-content: center;
  align-items: center;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.task-card:hover .task-action {
  background-color: var(--accent);
  color: #fff;
  box-shadow: 0 4px 10px rgba(124, 58, 237, 0.3);
}

.task-card.completed {
  opacity: 0.65;
  box-shadow: none;
}

.task-card.completed .task-action {
  background-color: var(--bg-tertiary);
  color: var(--text-muted);
  cursor: default;
}

.task-card.completed:hover {
  transform: none;
  background-color: var(--bg-secondary);
  border-color: rgba(15, 23, 42, 0.04);
  box-shadow: none;
}

/* ── LEADERBOARD (TEMA CLARO) ──────────────────────── */
.leaderboard {
  background-color: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 8px 16px;
  border: 1px solid rgba(15, 23, 42, 0.04);
  box-shadow: var(--shadow-sm);
}

.leader-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #f1f5f9;
}

.leader-item:last-child {
  border-bottom: none;
}

.leader-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.leader-rank {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  width: 20px;
}

.leader-rank.gold { color: #d97706; }
.leader-rank.silver { color: #64748b; }
.leader-rank.bronze { color: #b45309; }

.leader-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.leader-action {
  font-size: 0.75rem;
  color: var(--text-secondary);
  background-color: var(--bg-tertiary);
  padding: 2px 8px;
  border-radius: 12px;
}

.leader-amount {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--green);
}

/* ── FILTER PILLS (TEMA CLARO) ────────────────────── */
.filter-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-top: 12px;
  scrollbar-width: none;
}

.filter-pills::-webkit-scrollbar {
  display: none;
}

.pill {
  padding: 6px 14px;
  background-color: var(--bg-secondary);
  border: 1px solid rgba(15, 23, 42, 0.05);
  color: var(--text-secondary);
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.pill.active, .pill:hover {
  background-color: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 4px 10px rgba(124, 58, 237, 0.2);
}

/* ── HISTORIAL PAGE (TEMA CLARO) ────────────────────── */
.history-summary {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.hist-card {
  flex: 1;
  background-color: var(--bg-secondary);
  border: 1px solid rgba(15, 23, 42, 0.04);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--shadow-sm);
}

.hist-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.hist-val {
  font-size: 1.15rem;
  font-weight: 700;
}

.hist-val.green { color: var(--green); }
.hist-val.red { color: var(--red); }

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

.hist-item {
  background-color: var(--bg-secondary);
  border: 1px solid rgba(15, 23, 42, 0.03);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.hist-item-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hist-item-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.hist-item-date {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.hist-item-amount {
  font-size: 0.9rem;
  font-weight: 700;
}

.hist-item-amount.plus { color: var(--green); }
.hist-item-amount.minus { color: var(--red); }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

/* ── PROFILE PAGE (TEMA CLARO) ──────────────────────── */
.profile-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 24px;
  text-align: center;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 800;
  font-size: 1.8rem;
  color: #fff;
  border: 3px solid #fff;
  box-shadow: var(--shadow-md);
  margin-bottom: 12px;
}

.profile-name {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.vip-badge.large {
  font-size: 0.8rem;
  padding: 4px 12px;
}

.vip-progress-wrap {
  width: 100%;
  max-width: 260px;
  margin-top: 16px;
}

.vip-progress-bar {
  width: 100%;
  height: 6px;
  background-color: var(--bg-tertiary);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}

.vip-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #ffd700, #ffa500);
  width: 0%;
  transition: width 0.5s ease;
}

.vip-hint {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
}

.profile-stats {
  display: flex;
  justify-content: space-around;
  background-color: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 24px;
  border: 1px solid rgba(15, 23, 42, 0.04);
  box-shadow: var(--shadow-sm);
}

.p-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.p-stat-val {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
}

.p-stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 2px;
}

.profile-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.menu-item {
  background-color: var(--bg-secondary);
  border: 1px solid rgba(15, 23, 42, 0.03);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  width: 100%;
  box-shadow: var(--shadow-sm);
}

.menu-item-icon {
  color: var(--accent);
  flex-shrink: 0;
  transition: var(--transition);
}

.menu-item:hover .menu-item-icon {
  color: var(--accent-dark);
  transform: scale(1.05);
}

.menu-item.danger .menu-item-icon {
  color: var(--red);
}

.menu-item:hover {
  background-color: var(--bg-tertiary);
  border-color: rgba(15, 23, 42, 0.08);
}

.menu-arrow {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 1.2rem;
}

.menu-item.danger {
  color: var(--red);
}

/* ── BOTTOM NAVIGATION (TEMA CLARO) ────────────────── */
.bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 72px;
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 10;
  padding: 0 12px;
}

.nav-item {
  background: none;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  transition: var(--transition);
  flex: 1;
  height: 100%;
}

.nav-icon {
  width: 20px;
  height: 20px;
  transition: var(--transition);
}

.nav-item span {
  font-size: 0.65rem;
  font-weight: 600;
  transition: var(--transition);
}

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

.nav-item.active .nav-icon {
  transform: translateY(-2px);
}

.nav-item:hover {
  color: var(--text-primary);
}

/* ── MODALS (TEMA CLARO GLASSMORPHISM) ─────────────── */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.3);
  backdrop-filter: blur(8px);
  z-index: 50;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
  display: none !important;
}

.modal-box {
  background-color: var(--bg-secondary);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 100%;
  max-width: 380px;
  position: relative;
  box-shadow: var(--shadow-lg);
  transform: scale(1);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  transition: var(--transition);
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: -0.3px;
  color: var(--text-primary);
}

.modal-sub {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.modal-input {
  width: 100%;
  height: 46px;
  background-color: var(--bg-tertiary);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: var(--radius-md);
  padding: 0 16px;
  color: var(--text-primary);
  font-size: 0.9rem;
  margin-bottom: 12px;
  outline: none;
  font-family: inherit;
  transition: var(--transition);
}

.modal-input:focus {
  border-color: var(--accent);
  background-color: #fff;
  box-shadow: 0 0 8px rgba(124, 58, 237, 0.15);
}

.modal-btn {
  width: 100%;
  height: 46px;
  background-color: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.2);
}

.modal-btn:hover {
  background-color: var(--accent-dark);
}

.modal-btn.disabled, .modal-btn:disabled {
  background-color: var(--bg-tertiary);
  color: var(--text-muted);
  cursor: not-allowed;
  box-shadow: none;
}

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

/* ── SIMULADOR DE ANUNCIOS ────────────────────────── */
.ad-modal {
  padding: 20px;
  max-width: 360px;
}

.ad-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

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

.ad-timer {
  background-color: var(--bg-tertiary);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  border: 1px solid rgba(124, 58, 237, 0.1);
}

.ad-screen {
  width: 100%;
  height: 180px;
  background: radial-gradient(circle at center, #ffffff 0%, #f1f5f9 100%);
  border-radius: var(--radius-md);
  border: 1px solid rgba(15, 23, 42, 0.06);
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
}

.ad-video-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px;
  text-align: center;
}

.ad-play-icon {
  font-size: 2.2rem;
  color: var(--accent);
  margin-bottom: 12px;
  animation: pulse-glow-light 1.5s infinite ease-in-out;
}

@keyframes pulse-glow-light {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 4px 6px rgba(124, 58, 237, 0.2)); }
  50% { transform: scale(1.08); filter: drop-shadow(0 6px 12px rgba(124, 58, 237, 0.4)); }
}

.ad-brand {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.ad-tagline {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.ad-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background-color: var(--bg-tertiary);
}

.ad-progress-fill {
  width: 0%;
  height: 100%;
  background-color: var(--accent);
  transition: width 0.1s linear;
}

.ad-reward-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.reward-chip {
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--green);
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 700;
}

/* ── FORMULARIO DE ENCUESTA ───────────────────────── */
.survey-questions {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 4px;
}

.survey-q {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.survey-q span {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.survey-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.survey-opt {
  background-color: var(--bg-tertiary);
  border: 1px solid rgba(15, 23, 42, 0.04);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  color: var(--text-secondary);
  font-weight: 500;
}

.survey-opt:hover {
  background-color: #e2e8f0;
}

.survey-opt.selected {
  background-color: rgba(124, 58, 237, 0.08);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
}

/* ── SOCIAL TASK MEDIA ────────────────────────────── */
.social-icon-wrap {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: rgba(124, 58, 237, 0.08);
  color: var(--accent);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.8rem;
  margin: 0 auto 16px auto;
}

/* ── TOAST (TEMA CLARO) ────────────────────────────── */
.toast {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background-color: var(--bg-secondary);
  border: 1px solid rgba(124, 58, 237, 0.2);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
  width: max-content;
  max-width: 90%;
}

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

.toast-icon {
  font-size: 1.1rem;
}

#toast-msg {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* ═══════════════════════════════════════════════════════
   ── RESPONSIVE: TODOS LOS TAMAÑOS DE TELÉFONO ─────────
   ═══════════════════════════════════════════════════════ */

/* ── iPhone SE / teléfonos muy pequeños (≤ 360px) ───── */
@media (max-width: 360px) {
  .page {
    padding: 16px 14px;
  }

  .app-header {
    margin-bottom: 16px;
  }

  .header-name {
    font-size: 0.95rem;
  }

  .header-greeting {
    font-size: 0.68rem;
  }

  .wallet-card {
    padding: 18px 16px;
    margin-bottom: 16px;
    border-radius: var(--radius-md);
  }

  .wallet-balance {
    font-size: 1.7rem;
  }

  .wallet-multiplier-badge {
    font-size: 0.65rem;
    padding: 3px 8px;
    margin-bottom: 8px;
  }

  .wallet-btn {
    font-size: 0.75rem;
    height: 38px;
  }

  .stat-label {
    font-size: 0.62rem;
  }

  .stat-val {
    font-size: 0.82rem;
  }

  .section-title {
    font-size: 0.9rem;
  }

  .task-card {
    padding: 12px;
    border-radius: var(--radius-sm);
  }

  .task-title {
    font-size: 0.82rem;
  }

  .task-reward {
    font-size: 0.78rem;
  }

  .task-action {
    width: 34px;
    height: 34px;
    font-size: 0.75rem;
  }

  .page-title {
    font-size: 1.3rem;
  }

  .ticker-wrap {
    margin-bottom: 16px;
  }

  .ticker-track {
    font-size: 0.68rem;
  }

  .bottom-nav {
    height: 62px;
  }

  .nav-item span {
    font-size: 0.58rem;
  }

  .nav-icon {
    width: 18px;
    height: 18px;
  }

  .profile-avatar {
    width: 64px;
    height: 64px;
    font-size: 1.4rem;
  }

  .profile-name {
    font-size: 1.1rem;
  }

  .vip-progress-wrap {
    max-width: 200px;
  }

  .profile-stats {
    padding: 12px;
    border-radius: var(--radius-md);
  }

  .p-stat-val {
    font-size: 0.95rem;
  }

  .menu-item {
    padding: 12px;
    font-size: 0.82rem;
  }

  .hist-card {
    padding: 12px;
  }

  .hist-val {
    font-size: 1rem;
  }

  .modal-box {
    padding: 18px 16px;
    border-radius: var(--radius-md);
  }

  .modal-title {
    font-size: 1rem;
  }

  .modal-input {
    height: 42px;
    font-size: 0.82rem;
  }

  .modal-btn {
    height: 42px;
    font-size: 0.82rem;
  }

  .ad-screen {
    height: 140px;
  }

  .ad-brand {
    font-size: 0.9rem;
  }

  .page-bottom-space {
    height: 80px;
  }

  .history-summary {
    gap: 8px;
  }

  .leader-name {
    font-size: 0.78rem;
  }

  .leader-amount {
    font-size: 0.78rem;
  }

  .filter-pills {
    gap: 6px;
  }

  .pill {
    padding: 5px 10px;
    font-size: 0.68rem;
  }

  .avatar {
    width: 36px;
    height: 36px;
    font-size: 0.82rem;
  }

  .profile-dropdown {
    width: 155px;
    top: 46px;
  }

  .dropdown-item {
    font-size: 0.72rem;
    padding: 7px 10px;
  }
}

/* ── Teléfonos pequeños medianos (361px – 390px) ─────── */
@media (min-width: 361px) and (max-width: 390px) {
  .page {
    padding: 20px 16px;
  }

  .wallet-balance {
    font-size: 1.9rem;
  }

  .wallet-card {
    padding: 20px 18px;
  }

  .task-title {
    font-size: 0.88rem;
  }

  .header-name {
    font-size: 1rem;
  }

  .modal-box {
    padding: 20px;
  }
}

/* ── Teléfonos estándar / iPhone 14 Pro (391px – 430px) ── */
@media (min-width: 391px) and (max-width: 430px) {
  .wallet-balance {
    font-size: 2.1rem;
  }

  .task-title {
    font-size: 0.92rem;
  }
}

/* ── Orientación horizontal en móvil (landscape) ─────── */
@media (max-width: 812px) and (orientation: landscape) {
  body {
    align-items: center;
  }

  #app, #splash {
    max-height: 100dvh;
    max-height: 100vh;
    height: 100dvh;
    height: 100vh;
  }

  .page {
    padding: 12px 20px;
  }

  .wallet-card {
    padding: 14px 20px;
    margin-bottom: 12px;
  }

  .wallet-balance {
    font-size: 1.6rem;
    margin-bottom: 12px;
  }

  .wallet-actions {
    margin-bottom: 10px;
  }

  .wallet-stats {
    padding-top: 10px;
  }

  .ticker-wrap {
    margin-bottom: 12px;
  }

  .section-header {
    margin-bottom: 10px;
  }

  .task-card {
    padding: 10px 14px;
  }

  .bottom-nav {
    height: 56px;
    /* safe area bottom para landscape */
    padding-bottom: env(safe-area-inset-bottom);
  }

  .nav-item span {
    font-size: 0.6rem;
  }

  .page-bottom-space {
    height: 68px;
  }
}

/* ── iOS Safe Area (iPhone X, 12, 13, 14, 15 con notch/isla) ── */
@supports (padding-top: env(safe-area-inset-top)) {
  @media (max-width: 499px) {
    .page {
      padding-top: calc(24px + env(safe-area-inset-top));
    }

    .bottom-nav {
      padding-bottom: env(safe-area-inset-bottom);
      height: calc(72px + env(safe-area-inset-bottom));
    }

    .page-bottom-space {
      height: calc(80px + env(safe-area-inset-bottom));
    }
  }
}

/* ── VIP MODAL STYLES ── */
.vip-modal-box {
  max-width: 400px;
  width: 90%;
  padding: 24px;
  text-align: center;
}

.vip-modal-header {
  margin-bottom: 20px;
}

.vip-modal-icon {
  font-size: 2.2rem;
  margin-bottom: 8px;
}

.vip-levels-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.vip-level-card {
  background-color: var(--bg-primary);
  border: 1px solid rgba(124, 58, 237, 0.08);
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: left;
  transition: var(--transition);
}

.vip-level-card.active {
  border: 2px solid var(--accent);
  background-color: rgba(124, 58, 237, 0.04);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.06);
}

.vip-level-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.vip-level-req {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  background-color: rgba(15, 23, 42, 0.05);
  padding: 2px 8px;
  border-radius: 20px;
}

.vip-level-card.active .vip-level-req {
  color: var(--accent);
  background-color: rgba(124, 58, 237, 0.12);
}

.vip-level-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.vip-modal-footer {
  font-size: 0.8rem;
  color: var(--text-secondary);
  border-top: 1px solid rgba(124, 58, 237, 0.08);
  padding-top: 14px;
}

.vip-modal-footer strong {
  color: var(--accent);
}

.badge-v1 {
  background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%) !important;
  box-shadow: 0 4px 10px rgba(100, 116, 139, 0.2) !important;
}

.badge-v2 {
  background: linear-gradient(135deg, #ffd700 0%, #ffa500 100%) !important;
  box-shadow: 0 4px 10px rgba(255, 165, 0, 0.2) !important;
}

.badge-v3 {
  background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%) !important;
  box-shadow: 0 4px 10px rgba(124, 58, 237, 0.2) !important;
}

/* ── LEADERBOARD INTERACTIVE HOVER ── */
.leader-item {
  cursor: pointer !important;
  transition: var(--transition) !important;
  border-radius: var(--radius-sm);
  padding: 12px 8px !important;
}

.leader-item:hover {
  background-color: var(--bg-tertiary);
  transform: translateX(4px);
}

/* ── LEADERBOARD USER PROFILE MODAL ── */
.leaderboard-user-modal {
  max-width: 380px;
  width: 90%;
  padding: 24px;
}

.user-profile-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 18px;
  gap: 8px;
}

.user-profile-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.2);
}

.user-profile-stats {
  margin-bottom: 20px;
}

.u-stat-card {
  background-color: var(--bg-primary);
  border: 1px solid rgba(124, 58, 237, 0.08);
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: center;
}

.u-stat-label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.u-stat-val {
  font-size: 1.4rem;
  font-weight: 800;
}

.u-stat-val.green-text {
  color: var(--green);
}

.modal-section-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
  text-align: left;
}

.user-recent-tasks {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
  padding-right: 4px;
}

.user-recent-tasks::-webkit-scrollbar {
  width: 4px;
}

.user-recent-tasks::-webkit-scrollbar-thumb {
  background: rgba(124, 58, 237, 0.15);
  border-radius: 2px;
}

.u-task-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background-color: var(--bg-primary);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0, 0, 0, 0.02);
}

.u-task-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}

.u-task-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
}

.u-task-time {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.u-task-reward {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--green);
}

/* ── PROFILE AVATAR WRAPPER ── */
.profile-avatar-wrapper {
  position: relative;
  display: inline-block;
  margin-bottom: 8px;
}

.avatar-edit-btn {
  position: absolute;
  bottom: 0;
  right: 0;
  background-color: var(--accent);
  border: 2px solid var(--bg-secondary);
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  padding: 0;
  outline: none;
}

.avatar-edit-btn:hover {
  background-color: var(--accent-dark);
  transform: scale(1.1);
}

/* ── AVATAR EDIT MODAL ── */
.avatar-modal-box {
  max-width: 380px;
  width: 90%;
  padding: 24px;
}

.avatar-options-menu {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.avatar-option-btn {
  background-color: var(--bg-primary);
  border: 1px solid rgba(124, 58, 237, 0.08);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
  width: 100%;
}

.avatar-option-btn:hover {
  background-color: rgba(124, 58, 237, 0.04);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.avatar-option-icon {
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-option-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.avatar-option-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.avatar-option-desc {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.text-danger-btn {
  border-color: rgba(239, 68, 68, 0.15);
}

.text-danger-btn:hover {
  background-color: rgba(239, 68, 68, 0.04);
  border-color: var(--red);
}

.avatar-presets-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 14px;
}

.back-to-avatar-menu {
  background: none;
  border: none;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  align-self: flex-start;
  padding: 4px 0;
  display: flex;
  align-items: center;
  transition: opacity 0.2s;
}

.back-to-avatar-menu:hover {
  opacity: 0.8;
}

.presets-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 8px 0;
}

.preset-item {
  background: none;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  border-radius: 50%;
  padding: 0;
  aspect-ratio: 1/1;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preset-item:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(124, 58, 237, 0.2);
}

.preset-item svg {
  width: 100%;
  height: 100%;
  display: block;
}
