:root { --primary: #5f3d18; --accent: #f15e10; --bg: #F8F5F0; --white: #fff; --text-main: #2c2c2c; --card-bg: #fff; --red: #e74c3c; }
[data-theme="dark"] { --primary: #D4AF37; --accent: #6F4E37; --bg: #121212; --white: #1e1e1e; --text-main: #f0f0f0; --card-bg: #1e1e1e; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { margin: 0; background: var(--bg); font-family: 'Tajawal', sans-serif; direction: rtl; color: var(--text-main); user-select: none; }

/* Loader */
#global-loader { position: fixed; inset: 0; background: var(--bg); z-index: 10001; display: flex; align-items: center; justify-content: center; }
.spin { width: 40px; height: 40px; border: 4px solid #ddd; border-top-color: var(--primary); border-radius: 50%; animation: rot 1s linear infinite; }
@keyframes rot { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* Screens */
#gate-overlay, #onboarding-overlay, .modal-f { position: fixed; inset: 0; background: var(--bg); z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-f { background: rgba(0,0,0,0.9); color: #fff; }
.gate-card { background: var(--card-bg); width: 100%; max-width: 400px; padding: 30px; border-radius: 35px; text-align: center; box-shadow: 0 10px 40px rgba(0,0,0,0.1); }

/* Inputs & Buttons */
.phone-input-group { display: flex; gap: 10px; margin: 20px 0; }
.auth-select { width: 35%; padding: 12px; border: 1px solid #ddd; border-radius: 12px; background: var(--white); color: var(--text-main); font-size: 0.9rem; }
.auth-input-split { width: 65%; padding: 12px; border: 1px solid #ddd; border-radius: 12px; background: var(--white); color: var(--text-main); font-size: 1.1rem; text-align: center; }
.auth-input { width: 100%; padding: 14px; margin: 10px 0; border: 1px solid #ddd; border-radius: 12px; text-align: center; background: var(--white); color: var(--text-main); font-size: 1rem; }
.auth-btn { width: 100%; padding: 15px; border: none; border-radius: 15px; background: var(--primary); color: #fff; font-weight: bold; cursor: pointer; }
.success-btn { background: var(--accent); }

/* Avatar Upload */
.avatar-upload { display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer; margin-bottom: 15px; }
.avatar-upload img { width: 85px; height: 85px; border-radius: 50%; object-fit: cover; border: 2px dashed var(--accent); padding: 3px; }
.avatar-upload span { font-size: 0.75rem; color: var(--accent); font-weight: bold; }

/* Main App */
#main-app { display: none; padding-bottom: 100px; }
.app-header { padding: 15px 20px; display: flex; justify-content: space-between; align-items: center; background: var(--card-bg); position: sticky; top: 0; z-index: 1000; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.hero-card { margin: 15px; padding: 40px 25px; border-radius: 30px; color: #fff; background-image: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.8)), url('https://images.unsplash.com/photo-1509042239860-f550ce710b93?auto=format&fit=crop&w=800&q=80'); background-size: cover; text-align: center; }
.pts-val { font-size: 3.5rem; font-weight: 900; color: var(--accent); display: block; }
.badge-ui { display: flex; align-items: center; gap: 5px; background: rgba(255,255,255,0.2); padding: 6px 12px; border-radius: 15px; font-size: 0.8rem; font-weight: bold; }

.grid-menu { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 0 15px; }
.feat-box { background: var(--card-bg); padding: 22px; border-radius: 25px; text-align: center; box-shadow: 0 4px 15px rgba(0,0,0,0.02); cursor: pointer; }
.feat-box i { font-size: 1.8rem; margin-bottom: 8px; display: block; }

/* Navigation */
.bottom-nav { position: fixed; bottom: 0; left: 0; width: 100%; height: 75px; background: var(--card-bg); display: flex; justify-content: space-around; align-items: center; border-top: 1px solid #eee; z-index: 2000; }
.nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; color: #ccc; cursor: pointer; font-size: 0.65rem; }
.nav-item.active { color: var(--primary); font-weight: 900; }
.nav-item i { font-size: 1.3rem; margin-bottom: 3px; }
.fab-qr { position: fixed; bottom: 85px; left: 20px; width: 65px; height: 65px; background: var(--accent); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 2rem; box-shadow: 0 5px 15px rgba(241,94,16,0.3); z-index: 2100; cursor: pointer; }

/* Wheel */
#wheel-phys { width: 280px; height: 280px; border: 8px solid #fff; border-radius: 50%; background: conic-gradient(var(--primary) 0deg 90deg, var(--accent) 90deg 180deg, var(--primary) 180deg 270deg, var(--accent) 270deg 360deg); transition: transform 4s cubic-bezier(0.15, 0, 0.15, 1); }

/* Misc */
.vip-card { background: linear-gradient(135deg, var(--primary), #4a342e); padding: 25px; border-radius: 25px; color: #fff; position: relative; overflow: hidden; text-align: left; }
.vip-chip { width: 45px; height: 30px; background: linear-gradient(45deg, #e6c13d, #8f6e18); border-radius: 6px; margin-bottom: 15px; }
.vip-name { font-size: 1.4rem; font-weight: bold; margin-bottom: 5px; }
.vip-meta { font-size: 0.8rem; opacity: 0.9; font-family: monospace; display: flex; gap: 10px; }
.quote-card { margin: 15px; padding: 20px; background: var(--card-bg); border-radius: 20px; border-right: 4px solid var(--accent); display: flex; align-items: center; }
.story-header { background: var(--card-bg); padding: 25px; border-radius: 25px; text-align: center; border: 1px solid var(--accent); }