/* ================================================================
   YalaBoBo — Premium Modern Dark Design System 2026+
   Professional • Mobile-First • iPhone Style • Dark Mode
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;600;700;800;900&display=swap');

/* ── Premium Design Tokens ── */
:root {
  /* Primary Colors */
  --primary:        #7C3AED;
  --primary-dark:   #6D28D9;
  --primary-light:  #A78BFA;
  
  /* Accent Colors */
  --accent:         #EC4899;
  --accent-pink:    #F472B6;
  --accent-orange:  #F97316;
  --accent-green:   #10B981;
  --accent-cyan:    #06B6D4;
  --accent-gold:    #FBBF24;
  --accent-red:     #EF4444;

  /* Background Colors */
  --bg-base:        #000000;
  --bg-primary:     #0F0F1E;
  --bg-secondary:   #1A1A2E;
  --bg-tertiary:    #27273F;
  --bg-card:        rgba(31, 41, 55, 0.5);
  --bg-card-solid:  #1F2937;
  --bg-hover:       rgba(255, 255, 255, 0.08);

  /* Glass Effect */
  --glass-bg:       rgba(15, 15, 30, 0.8);
  --glass-blur:     50px;

  /* Text Colors */
  --text-primary:   #FFFFFF;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted:     rgba(255, 255, 255, 0.4);
  --text-light:     rgba(255, 255, 255, 0.2);

  /* Borders */
  --border-color:   rgba(255, 255, 255, 0.08);
  --border-strong:  rgba(255, 255, 255, 0.15);
  --border-subtle:  rgba(255, 255, 255, 0.03);

  /* Shadows */
  --shadow-xs:   0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-sm:   0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-md:   0 10px 32px rgba(0, 0, 0, 0.5);
  --shadow-lg:   0 20px 60px rgba(0, 0, 0, 0.7);
  --shadow-xl:   0 30px 80px rgba(0, 0, 0, 0.8);
  --shadow-primary: 0 8px 30px rgba(124, 58, 237, 0.4);

  /* Border Radius */
  --r-xs:   8px;
  --r-sm:   12px;
  --r-md:   16px;
  --r-lg:   24px;
  --r-xl:   32px;
  --r-2xl:  40px;
  --r-3xl:  48px;
  --r-full: 9999px;

  /* Gradients */
  --grad-primary:  linear-gradient(135deg, #7C3AED 0%, #EC4899 100%);
  --grad-accent:   linear-gradient(135deg, #EC4899 0%, #F97316 100%);
  --grad-gold:     linear-gradient(135deg, #FBBF24 0%, #F97316 100%);
  --grad-green:    linear-gradient(135deg, #10B981 0%, #06B6D4 100%);
  --grad-card:     linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.01) 100%);
  --grad-dark:     linear-gradient(180deg, transparent 0%, #000 100%);
}

/* ── Universal Reset ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-box-sizing: border-box;
}

html, body {
  height: 100%;
  width: 100%;
  background: var(--bg-base);
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  font-family: 'Tajawal', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  height: 100dvh;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  direction: rtl;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  line-height: 1.5;
}

/* Input & Controls */
input, textarea, select, button {
  font-family: inherit;
  font-size: inherit;
  user-select: auto;
  -webkit-user-select: auto;
}

input, textarea, select {
  background: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
}

a {
  text-decoration: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

img, video, picture {
  max-width: 100%;
  display: block;
  height: auto;
}

/* Scrollbar Hide */
::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

/* Ambient Background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 25% 10%, rgba(124, 58, 237, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 75% 90%, rgba(236, 72, 153, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(249, 115, 22, 0.05) 0%, transparent 60%),
    var(--bg-base);
  background-attachment: fixed;
}

/* ── Top Header — Premium ── */
.top-header {
  height: calc(56px + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 18px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(15, 15, 30, 0.8);
  backdrop-filter: blur(50px) saturate(200%);
  -webkit-backdrop-filter: blur(50px) saturate(200%);
  border-bottom: 1px solid var(--border-color);
  position: fixed;
  top: 0;
  max-width: 480px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.top-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(124, 58, 237, 0.05) 0%, transparent 100%);
  pointer-events: none;
  z-index: -1;
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 44px;
  min-height: 44px;
}

.header-center {
  flex: 1;
  text-align: center;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* ── Main Content ── */
.main-content {
  position: absolute;
  top: calc(56px + env(safe-area-inset-top, 0px));
  bottom: calc(68px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  padding: 14px 14px 8px;
  max-width: 480px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  z-index: 1;
}

/* ── Header Stats ── */
.header-stats {
  display: flex;
  gap: 6px;
  align-items: center;
}

.stat-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.07);
  padding: 4px 8px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
}

.stat-badge .icon { font-size: 11px; }
.stat-badge .value { color: var(--accent-gold); font-size: 11px; }

.header-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--grad-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 2px 10px rgba(124, 58, 237, 0.4);
  position: relative;
  overflow: hidden;
}

/* ── Bottom Navigation — iPhone Tab Bar ── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: rgba(15, 15, 19, 0.85);
  backdrop-filter: blur(25px) saturate(180%);
  -webkit-backdrop-filter: blur(25px) saturate(180%);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-around;
  padding: 12px 10px calc(12px + env(safe-area-inset-bottom));
  z-index: 1000;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: rgba(255, 255, 255, 0.4);
  text-decoration: none;
  font-size: 10px;
  font-weight: 700;
  transition: 0.2s;
  flex: 1;
  -webkit-tap-highlight-color: transparent;
}

.nav-item i {
  font-size: 20px;
  width: 40px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  transition: 0.2s;
}

.nav-item.active {
  color: #fff;
}

.nav-item.active i {
  background: rgba(124, 58, 237, 0.15);
  color: var(--primary-light);
  transform: translateY(-2px);
}

.nav-item:active {
  transform: scale(0.9);
}

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--r-lg);
  padding: 20px;
  margin-bottom: 12px;
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  position: relative;
  overflow: hidden;
  transition: all 0.15s;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.card:active {
  transform: scale(0.98);
  transition: transform 0.1s;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.card-title {
  font-size: 16px;
  font-weight: 800;
}

.card-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background: rgba(255, 255, 255, 0.05);
}

/* ── Buttons — Modern Style ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 13px 24px;
  border-radius: var(--r-full);
  font-size: 15px;
  font-weight: 700;
  font-family: 'Tajawal', sans-serif;
  cursor: pointer;
  border: none;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.btn:active {
  transform: scale(0.94);
  filter: brightness(0.88);
  transition: transform 0.08s;
}

.btn-primary {
  background: var(--grad-primary);
  color: white;
  box-shadow: var(--shadow-primary);
}

.btn-primary:disabled {
  opacity: 0.35;
  pointer-events: none;
}

.btn-accent {
  background: var(--grad-accent);
  color: white;
}

.btn-success {
  background: var(--grad-green);
  color: white;
}

.btn-gold {
  background: var(--grad-gold);
  color: #1a1a0a;
  font-weight: 800;
}

.btn-full {
  width: 100%;
}

.btn-sm {
  padding: 9px 16px;
  font-size: 12px;
}

.btn-outline {
  background: transparent;
  border: 1.5px solid rgba(124, 58, 237, 0.4);
  color: var(--primary);
}

.btn-glass {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  backdrop-filter: blur(10px);
}

/* ── Form Inputs — iOS Style ── */
.form-group {
  margin-bottom: 14px;
  position: relative;
}

.form-group label {
  display: block;
  color: var(--text-secondary);
  font-size: 12px;
  margin-bottom: 7px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input {
  width: 100%;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  border-radius: var(--r-md);
  color: var(--text-primary);
  font-size: 15px;
  font-family: 'Tajawal', sans-serif;
  transition: all 0.2s;
  box-sizing: border-box;
  -webkit-appearance: none;
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-input:focus {
  outline: none;
  border-color: rgba(124, 58, 237, 0.5);
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

/* ── Page Title ── */
.page-title {
  font-size: 22px;
  font-weight: 900;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}

/* ── Wallet Card ── */
.wallet-card {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.12) 0%, rgba(236, 72, 153, 0.08) 100%);
  border-radius: var(--r-xl);
  padding: 26px 22px;
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid rgba(124, 58, 237, 0.18);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.5);
}

.wallet-card::before {
  content: '';
  position: absolute;
  top: -70px;
  right: -50px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.22) 0%, transparent 70%);
  pointer-events: none;
}

.wallet-card .card-type {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 18px;
  position: relative;
  z-index: 1;
}

.wallet-card .card-balance {
  font-size: 38px;
  font-weight: 900;
  position: relative;
  z-index: 1;
  margin-bottom: 4px;
  color: #fff;
}

.wallet-card .card-points {
  font-size: 13px;
  color: var(--text-secondary);
  position: relative;
  z-index: 1;
  margin-bottom: 18px;
}

.wallet-card .card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 1;
}

.wallet-card .card-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
}

.wallet-card .card-logo {
  font-size: 22px;
  font-weight: 900;
  background: var(--grad-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ── Modal — iOS Bottom Sheet ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: flex-end;
  z-index: 2000;
  padding: 0;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.modal-overlay.show {
  display: flex;
  animation: fadeIn 0.2s;
}

.modal-box {
  background: var(--bg-secondary);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 28px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  border-top: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  max-height: 88vh;
  overflow-y: auto;
  position: relative;
}

.modal-box::before {
  content: '';
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 38px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.14);
}

.modal-box h3 {
  font-size: 18px;
  margin-bottom: 10px;
  font-weight: 800;
}

.modal-box p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 18px;
  line-height: 1.6;
}

/* ── Toast ── */
.toast {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 14px);
  left: 50%;
  transform: translateX(-50%) translateY(-120px);
  background: rgba(28, 28, 38, 0.96);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid var(--border-color);
  padding: 12px 20px;
  border-radius: var(--r-full);
  z-index: 9999;
  font-size: 13px;
  font-weight: 700;
  box-shadow: var(--shadow-md);
  transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  max-width: calc(100vw - 32px);
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.toast.success {
  border-bottom: 2px solid var(--accent-green);
}

.toast.error {
  border-bottom: 2px solid var(--accent);
}

/* ── Menu List ── */
.menu-list {
  margin-top: 6px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 16px;
  background: var(--bg-card);
  border-radius: var(--r-md);
  margin-bottom: 8px;
  border: 1px solid var(--border-color);
  transition: all 0.15s;
  cursor: pointer;
  text-decoration: none;
  color: var(--text-primary);
  position: relative;
  overflow: hidden;
}

.menu-item:active {
  background: rgba(255, 255, 255, 0.06);
  transform: scale(0.97);
}

.menu-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.menu-info .title {
  font-weight: 700;
  font-size: 14px;
}

.menu-info .desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.menu-arrow {
  color: var(--text-muted);
  font-size: 12px;
  margin-right: auto;
}

/* ── Auth Pages ── */
.auth-bg, .bg-art {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 28% 20%, rgba(124, 58, 237, 0.16) 0%, transparent 52%),
    radial-gradient(circle at 82% 78%, rgba(236, 72, 153, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 50% 90%, rgba(251, 191, 36, 0.08) 0%, transparent 40%),
    #050508;
}

.auth-container, .login-container {
  min-height: 100dvh;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.auth-card, .login-sheet {
  width: 100%;
  max-width: 480px;
  background: rgba(14, 14, 22, 0.95);
  backdrop-filter: blur(60px) saturate(180%);
  -webkit-backdrop-filter: blur(60px) saturate(180%);
  border-radius: 44px 44px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 24px 28px calc(40px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -30px 80px rgba(0, 0, 0, 0.8);
  position: relative;
  z-index: 2;
}

.sheet-handle {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.15);
  margin: 0 auto 24px;
}

.app-hero {
  text-align: center;
  margin-bottom: 24px;
}

.app-icon, .logo-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 14px;
  border-radius: 24px;
  overflow: hidden;
  background: var(--grad-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  box-shadow: 0 14px 36px rgba(124, 58, 237, 0.45);
}

.app-name {
  font-size: 26px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.5px;
}

.app-sub, .auth-logo p {
  color: rgba(255, 255, 255, 0.48);
  margin-top: 6px;
  font-size: 14px;
  font-weight: 500;
}

.error-box, .error-msg {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #EF4444;
  padding: 14px 16px;
  border-radius: var(--r-md);
  margin-bottom: 18px;
  font-size: 14px;
  text-align: center;
  font-weight: 700;
}

.field, .form-group {
  margin-bottom: 14px;
  position: relative;
}

.field label, .form-group label {
  display: block;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.field-wrap {
  position: relative;
}

.field-icon {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.35);
  font-size: 15px;
  pointer-events: none;
}

.field input, .form-input, .auth-input {
  width: 100%;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  color: #fff;
  font-size: 15px;
  font-family: 'Tajawal', sans-serif;
  transition: all 0.2s;
  box-sizing: border-box;
  outline: none;
  -webkit-appearance: none;
}

.field input::placeholder, .form-input::placeholder, .auth-input::placeholder {
  color: rgba(255, 255, 255, 0.28);
}

.field input:focus, .form-input:focus, .auth-input:focus {
  border-color: rgba(124, 58, 237, 0.5);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

.btn-login, .btn-auth {
  width: 100%;
  padding: 14px 22px;
  background: var(--grad-primary);
  color: #fff;
  border: none;
  border-radius: var(--r-full);
  font-size: 15px;
  font-weight: 800;
  font-family: 'Tajawal', sans-serif;
  cursor: pointer;
  box-shadow: 0 10px 32px rgba(124, 58, 237, 0.35);
  transition: all 0.18s ease;
  position: relative;
  overflow: hidden;
}

.btn-login:active, .btn-auth:active {
  transform: scale(0.96);
  filter: brightness(0.9);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid rgba(124, 58, 237, 0.4);
  color: var(--primary);
}

.auth-footer {
  text-align: center;
  margin-top: 22px;
  color: var(--text-secondary);
  font-size: 14px;
}

.auth-footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
}

.register-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 14px 16px;
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 14px;
  font-weight: 600;
}

.register-link span {
  color: #7C3AED;
  font-weight: 800;
}

/* ── Utilities ── */
.text-center {
  text-align: center;
}

.text-muted {
  color: var(--text-secondary);
}

.mt-8 {
  margin-top: 8px;
}

.mt-16 {
  margin-top: 16px;
}

.mt-20 {
  margin-top: 20px;
}

.mb-8 {
  margin-bottom: 8px;
}

.mb-16 {
  margin-bottom: 16px;
}

.mb-20 {
  margin-bottom: 20px;
}

.mt-10 {
  margin-top: 10px;
}

.mb-10 {
  margin-bottom: 10px;
}

.gap-10 {
  gap: 10px;
}

.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hidden {
  display: none !important;
}

/* ── Animations ── */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeScaleIn {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulseGlow {
  0%, 100% {
    opacity: 0.5;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.06);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

@keyframes pointerBounce {
  0%, 100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(5px);
  }
}

/* ── Skeleton Loading ── */
.skeleton {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 25%, rgba(255, 255, 255, 0.08) 50%, rgba(255, 255, 255, 0.04) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--r-sm);
}

/* ── Divider ── */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.07), transparent);
  margin: 14px 0;
}

/* ── Avatar Frame System ── */
.avatar-frame-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.avatar-frame-wrap .av-inner {
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #fff;
  background: var(--grad-primary);
  aspect-ratio: 1/1;
}

.avatar-frame-wrap .av-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.avatar-frame-wrap .av-frame {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 142%;
  height: 142%;
  max-width: none;
  object-fit: contain;
  pointer-events: none;
  z-index: 3;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
}

.avatar-frame-wrap.frame-xs {
  width: 24px;
  height: 24px;
}

.avatar-frame-wrap.frame-xs .av-inner {
  width: 100%;
  height: 100%;
  font-size: 9px;
}

.avatar-frame-wrap.frame-sm {
  width: 36px;
  height: 36px;
}

.avatar-frame-wrap.frame-sm .av-inner {
  width: 100%;
  height: 100%;
  font-size: 13px;
}

.avatar-frame-wrap.frame-md {
  width: 40px;
  height: 40px;
}

.avatar-frame-wrap.frame-md .av-inner {
  width: 100%;
  height: 100%;
  font-size: 15px;
}

.avatar-frame-wrap.frame-list {
  width: 56px;
  height: 56px;
}

.avatar-frame-wrap.frame-list .av-inner {
  width: 100%;
  height: 100%;
  font-size: 20px;
}

.avatar-frame-wrap.frame-lg {
  width: 80px;
  height: 80px;
}

.avatar-frame-wrap.frame-lg .av-inner {
  width: 100%;
  height: 100%;
  font-size: 28px;
}

.avatar-frame-wrap.frame-xl {
  width: 96px;
  height: 96px;
}

.avatar-frame-wrap.frame-xl .av-inner {
  width: 100%;
  height: 100%;
  font-size: 34px;
}

/* ── Responsive ── */
@media (max-width: 380px) {
  .page-title {
    font-size: 20px;
  }
  
  .wallet-card .card-balance {
    font-size: 30px;
  }
}

@media (min-width: 430px) {
  .bottom-nav, .top-header {
    max-width: 430px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: 100%;
  }
  
  .main-content {
    max-width: 430px;
  }
}

@media (display-mode: standalone) {
  .top-header {
    height: calc(56px + env(safe-area-inset-top));
  }
  
  .bottom-nav {
    height: calc(68px + env(safe-area-inset-bottom));
  }
}
