:root {
  --gold: #D4AF37;
  --gold-light: #F5E6C8;
  --gold-dark: #B8860B;
  --dark: #0B0C10;
  --card: #1A1C23;
  --card2: #22252F;
  --text: #F0F0F0;
  --muted: #9CA3AF;
  --success: #10B981;
  --danger: #EF4444;
  --radius: 20px;
}

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

html, body {
  font-family: 'Outfit', system-ui, sans-serif;
  background: var(--dark);
  color: var(--text);
  min-height: 100%;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  padding-bottom: 90px;
  background: linear-gradient(180deg, #0F1117 0%, #0B0C10 100%);
}

/* Header */
.header { text-align:center; padding:48px 24px 24px; }
.logo { font-size:30px; font-weight:700; color:var(--gold); letter-spacing:1px; }
.tagline { color:var(--muted); font-size:14px; margin-top:8px; }

/* Cards */
.card {
  background: var(--card);
  margin: 16px 20px;
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
  border: 1px solid rgba(212,175,55,0.08);
}

.tabs { display:flex; gap:8px; margin-bottom:24px; background:#12141A; border-radius:14px; padding:4px; }
.tab {
  flex:1; padding:12px; border:none; border-radius:12px;
  background:transparent; color:var(--muted); font-weight:600; font-size:15px; cursor:pointer;
  transition: all 0.25s;
}
.tab.active { background:var(--gold); color:#111; }

.form { display:none; flex-direction:column; gap:14px; }
.form.active { display:flex; }

input, select, textarea {
  width:100%; background:#2A2D36; border:1px solid #3A3D48;
  border-radius:14px; padding:16px; color:white; font-size:16px;
  outline:none; transition:border 0.2s;
}
input:focus, select:focus, textarea:focus { border-color:var(--gold); }
textarea { min-height:90px; resize:vertical; }

.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color:#111; border:none; border-radius:14px; padding:16px;
  font-weight:700; font-size:16px; cursor:pointer; width:100%;
  box-shadow: 0 6px 20px rgba(212,175,55,0.25);
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-primary:active { transform:scale(0.98); }
.btn-secondary {
  background:var(--card2); color:var(--gold); border:1px solid var(--gold);
  border-radius:14px; padding:14px; font-weight:600; width:100%; cursor:pointer;
}

/* Top bar */
.topbar {
  display:flex; justify-content:space-between; align-items:center;
  padding:20px 20px 8px;
}
.greeting { font-size:20px; font-weight:600; }
.tier-badge {
  display:inline-block; background:linear-gradient(135deg,var(--gold),#E8C872);
  color:#111; font-size:11px; font-weight:700; padding:4px 12px;
  border-radius:20px; margin-top:4px; letter-spacing:0.5px;
}
.icon-btn { background:none; border:none; color:var(--muted); font-size:22px; cursor:pointer; padding:8px; }

/* Points Hero */
.points-hero {
  text-align:center; padding:28px 20px 20px;
  background: radial-gradient(ellipse at center, rgba(212,175,55,0.12) 0%, transparent 70%);
}
.points-value { font-size:58px; font-weight:700; color:var(--gold); line-height:1; letter-spacing:-1px; }
.points-label { color:var(--muted); margin-top:4px; font-size:14px; }
.progress-bar {
  height:8px; background:#2A2D36; border-radius:10px;
  margin:22px 48px 8px; overflow:hidden;
}
.progress-fill {
  height:100%; background:linear-gradient(90deg, var(--gold), #F5E6C8);
  border-radius:10px; transition:width 0.7s cubic-bezier(0.22,1,0.36,1);
}
.next-tier { font-size:13px; color:var(--muted); }

/* QR Card */
.qr-card {
  background:var(--card); margin:0 20px; border-radius:24px;
  padding:24px; text-align:center; border:1px solid rgba(212,175,55,0.12);
}
.qr-card h3 { font-size:14px; color:var(--muted); margin-bottom:16px; font-weight:500; }
#qrcode { display:flex; justify-content:center; margin-bottom:14px; }
#qrcode img, #qrcode canvas { border-radius:12px; }
.member-code { font-size:18px; font-weight:600; letter-spacing:3px; color:var(--gold); }

/* Actions */
.actions { display:flex; gap:12px; padding:20px; }
.action-btn {
  flex:1; background:var(--card); border:1px solid #333; border-radius:16px;
  padding:16px 8px; color:white; font-weight:600; font-size:14px; cursor:pointer;
  transition: background 0.2s;
}
.action-btn:active { background:var(--card2); }

/* Bottom Nav */
.bottom-nav {
  position:fixed; bottom:0; left:0; right:0; max-width:480px; margin:0 auto;
  background:rgba(18,20,26,0.95); backdrop-filter:blur(12px);
  display:flex; justify-content:space-around;
  padding:10px 0 24px; border-top:1px solid #222; z-index:100;
}
.nav-item {
  background:none; border:none; font-size:22px; color:var(--muted);
  padding:8px 14px; cursor:pointer; display:flex; flex-direction:column; align-items:center; gap:2px;
}
.nav-item span { font-size:10px; font-weight:500; }
.nav-item.active { color:var(--gold); }

/* Lists */
.list-item {
  background:var(--card); border-radius:16px; padding:16px;
  margin-bottom:12px; display:flex; gap:14px; align-items:center;
  border:1px solid rgba(255,255,255,0.04);
}
.list-item .icon { width:44px; height:44px; border-radius:12px; background:var(--card2);
  display:flex; align-items:center; justify-content:center; font-size:20px; flex-shrink:0; }
.list-item .info { flex:1; min-width:0; }
.list-item .title { font-weight:600; font-size:15px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.list-item .sub { font-size:12px; color:var(--muted); margin-top:2px; }
.list-item .right { text-align:right; flex-shrink:0; }
.points-pos { color:var(--success); font-weight:700; }
.points-neg { color:var(--danger); font-weight:700; }

/* Badge */
.badge {
  display:inline-block; padding:3px 10px; border-radius:20px;
  font-size:11px; font-weight:600;
}
.badge-active { background:rgba(16,185,129,0.15); color:var(--success); }
.badge-used { background:rgba(156,163,175,0.15); color:var(--muted); }
.badge-gold { background:rgba(212,175,55,0.2); color:var(--gold); }

/* Page title */
.page-title {
  padding:20px 20px 8px; font-size:24px; font-weight:700;
}

/* Empty state */
.empty { text-align:center; padding:60px 30px; color:var(--muted); }
.empty .emoji { font-size:48px; margin-bottom:12px; }

/* Toast */
.toast {
  position:fixed; top:20px; left:50%; transform:translateX(-50%) translateY(-100px);
  background:var(--card); color:white; padding:14px 24px; border-radius:14px;
  box-shadow:0 10px 30px rgba(0,0,0,0.4); z-index:999; transition:transform 0.35s;
  border:1px solid rgba(212,175,55,0.3); font-weight:500; max-width:90%;
}
.toast.show { transform:translateX(-50%) translateY(0); }

/* Language switch */
.lang-switch {
  display:flex; gap:6px; justify-content:center; margin-top:16px;
}
.lang-btn {
  padding:6px 14px; border-radius:20px; border:1px solid #333;
  background:transparent; color:var(--muted); font-size:13px; cursor:pointer;
}
.lang-btn.active { border-color:var(--gold); color:var(--gold); }

/* RTL support */
[dir="rtl"] .list-item { flex-direction:row-reverse; }
[dir="rtl"] .list-item .right { text-align:left; }
