/* ══════════════════════════════════════════════
   Iraq Charity Lottery — Super Qi Mini App
   Design System (ported from Flutter AppColors)
   ══════════════════════════════════════════════ */

/* ── Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

@font-face {
  font-family: 'DGSahabah';
  src: url('../assets/fonts/DG-Sahabah-Reg.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}

/* ── CSS Custom Properties (from AppColors.dart) ── */
:root {
  /* Brand Primary */
  --primary-red: #CC1F40;
  --primary-red-light: #E84A67;
  --primary-red-dark: #9A1730;

  /* Brand Secondary */
  --dark-gray: #404040;
  --medium-gray: #6B6B6B;
  --light-gray: #B0B0B0;

  /* Accent & Highlights */
  --accent-gold: #F9C74F;
  --accent-gold-light: #FFDE7A;
  --accent-gold-dark: #D4A730;

  /* Semantic */
  --success: #2DC653;
  --warning: #FF9F1C;
  --error: #FF4757;
  --info: #4361EE;

  /* Dark Theme Surfaces (from AppColors.dart) */
  --surface-dark: #0F0F1A;
  --surface-card: #1A1A2E;
  --surface-card-light: #222240;
  --surface-elevated: #2A2A45;

  /* Text */
  --text-primary: #FFFFFF;
  --text-secondary: #B0B0C0;
  --text-muted: #6B6B80;
  --text-on-gold: #1A1A2E;

  /* Ball Colors */
  --ball-main: #CC1F40;
  --ball-extra: #4361EE;
  --ball-selected: #F9C74F;
  --ball-unselected: #2A2A45;
  --ball-matched: #2DC653;

  /* Gradients (from AppColors.dart) */
  --bg-gradient: linear-gradient(180deg, #0D0D18 0%, #121228 50%, #171535 100%);
  --jackpot-gradient: linear-gradient(135deg, #F9C74F, #D4A730, #F9C74F);
  --red-gradient: linear-gradient(135deg, #CC1F40, #E84A67);
  --card-gradient: linear-gradient(135deg, #1A1A2E, #222240);
  --splash-gradient: linear-gradient(180deg, #D92347, #CC1F40, #B01A35);

  /* Spacing */
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  /* Font */
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-arabic: 'DGSahabah', 'Plus Jakarta Sans', sans-serif;
}

/* ── Reset & Base ── */
*, *::before, *::after {
  margin: 0; padding: 0; box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%; height: 100%; overflow: hidden;
  font-family: var(--font-family);
  background: var(--surface-dark);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: none;
}

#app {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  background: var(--bg-gradient);
  position: relative; overflow: hidden;
}

/* ── Typography ── */
.text-display-lg { font-size: 48px; font-weight: 800; letter-spacing: -1.5px; line-height: 1.1; }
.text-display-md { font-size: 36px; font-weight: 700; letter-spacing: -0.5px; line-height: 1.2; }
.text-display-sm { font-size: 28px; font-weight: 700; line-height: 1.2; }
.text-headline-lg { font-size: 24px; font-weight: 700; line-height: 1.3; }
.text-headline-md { font-size: 20px; font-weight: 600; line-height: 1.3; }
.text-headline-sm { font-size: 18px; font-weight: 600; line-height: 1.4; }
.text-body-lg { font-size: 16px; font-weight: 500; line-height: 1.5; }
.text-body-md { font-size: 14px; font-weight: 400; line-height: 1.5; }
.text-body-sm { font-size: 12px; font-weight: 400; line-height: 1.4; color: var(--text-secondary); }
.text-label-lg { font-size: 14px; font-weight: 600; letter-spacing: 0.5px; }
.text-label-md { font-size: 12px; font-weight: 600; letter-spacing: 0.5px; }
.text-label-sm { font-size: 10px; font-weight: 500; letter-spacing: 0.5px; color: var(--text-muted); }

.text-jackpot { font-size: 42px; font-weight: 800; letter-spacing: -1px; color: var(--accent-gold); }
.text-mini-jackpot { font-size: 28px; font-weight: 700; color: var(--accent-gold-light); }
.text-ball-number { font-size: 18px; font-weight: 700; color: #fff; }
.text-ball-number-lg { font-size: 24px; font-weight: 800; color: #fff; }
.text-countdown { font-size: 32px; font-weight: 700; letter-spacing: 2px; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.text-prize { font-size: 16px; font-weight: 700; color: var(--accent-gold); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-gold { color: var(--accent-gold); }
.text-red { color: var(--primary-red-light); }
.text-success { color: var(--success); }

/* ── Page Container ── */
.page { display: none; flex-direction: column; flex: 1; overflow: hidden; width: 100%; }
.page.active { display: flex; }

.page-scroll {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch; padding-bottom: 24px;
}

.page-header { padding: 16px 20px 8px; }

/* ── Glass Card (premium glassmorphism) ── */
.glass-card {
  margin: 6px 16px; padding: 20px;
  background: linear-gradient(145deg, rgba(26,26,46,0.7), rgba(34,34,64,0.4));
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: relative; overflow: hidden;
}
.glass-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
}
.glass-card--glow-red { box-shadow: 0 8px 32px 0 rgba(204,31,64,0.25), inset 0 0 0 1px rgba(204,31,64,0.15); }
.glass-card--glow-gold { box-shadow: 0 8px 32px 0 rgba(249,199,79,0.25), inset 0 0 0 1px rgba(249,199,79,0.15); }
.glass-card--glow-green { box-shadow: 0 8px 32px 0 rgba(45,198,83,0.25), inset 0 0 0 1px rgba(45,198,83,0.15); }
.glass-card--clickable { cursor: pointer; transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease; }
.glass-card--clickable:hover { transform: translateY(-2px); box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.4); }
.glass-card--clickable:active { transform: scale(0.96) translateY(0); }

/* ── Lottery Ball (enhanced with 3D effect) ── */
.ball {
  width: 48px; height: 48px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; color: #fff; flex-shrink: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: default; position: relative;
}
.ball::after {
  content: ''; position: absolute; top: 4px; left: 25%; width: 50%; height: 30%;
  border-radius: 50%; background: rgba(255,255,255,0.15);
  pointer-events: none;
}
.ball--sm { width: 36px; height: 36px; font-size: 14px; }
.ball--sm::after { top: 3px; }
.ball--md { width: 42px; height: 42px; font-size: 16px; }
.ball--lg { width: 52px; height: 52px; font-size: 20px; font-weight: 800; }

.ball--main {
  background: linear-gradient(145deg, #E84A67, #CC1F40 50%, #A01830);
  box-shadow: 0 3px 10px rgba(204,31,64,0.35), inset 0 -2px 4px rgba(0,0,0,0.2);
}
.ball--extra {
  background: linear-gradient(145deg, #5575F5, #4361EE 50%, #3050D0);
  box-shadow: 0 3px 10px rgba(67,97,238,0.35), inset 0 -2px 4px rgba(0,0,0,0.2);
}
.ball--selected {
  background: linear-gradient(145deg, #FFDE7A, #F9C74F 50%, #D4A730);
  color: var(--text-on-gold); font-weight: 800;
  box-shadow: 0 3px 16px rgba(249,199,79,0.5), inset 0 -2px 4px rgba(0,0,0,0.15);
  transform: scale(1.08);
}
.ball--unselected {
  background: rgba(42,42,69,0.6);
  border: 1.5px solid rgba(255,255,255,0.06);
  color: var(--text-muted); cursor: pointer;
}
.ball--unselected::after { display: none; }
.ball--unselected:active { transform: scale(0.9); }
.ball--matched {
  background: linear-gradient(145deg, #3DD666, #2DC653 50%, #25A244);
  box-shadow: 0 3px 14px rgba(45,198,83,0.45), inset 0 -2px 4px rgba(0,0,0,0.15);
}

/* ── Grid Ball (Play Screen) ── */
.ball--grid {
  width: 44px; height: 44px; font-size: 15px; font-weight: 700;
  cursor: pointer; transition: all 0.15s ease;
}
.ball--grid:active { transform: scale(0.85); }

/* ── Bottom Navigation ── */
.bottom-nav {
  display: flex; align-items: center;
  padding: 8px 0;
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  background: rgba(15, 15, 26, 0.85);
  border-top: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 -8px 32px 0 rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  flex-shrink: 0;
}
.nav-tab {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  cursor: pointer; -webkit-tap-highlight-color: transparent; padding: 4px 0;
  transition: transform 0.2s ease;
}
.nav-tab:active { transform: scale(0.92); }
.nav-tab__indicator {
  width: 0; height: 3px; border-radius: 2px; margin-bottom: 6px;
  transition: width 0.28s cubic-bezier(0.33,1,0.68,1), background 0.28s ease;
}
.nav-tab.active .nav-tab__indicator {
  width: 24px; background: var(--red-gradient);
  box-shadow: 0 2px 8px rgba(204,31,64,0.6);
}
.nav-tab__icon {
  font-size: 24px; color: var(--text-muted);
  transition: color 0.28s ease, transform 0.28s ease;
}
.nav-tab.active .nav-tab__icon { color: var(--primary-red-light); transform: scale(1.15); }
.nav-tab__label {
  font-size: 10px; font-weight: 400; color: var(--text-muted);
  margin-top: 4px; transition: all 0.28s ease;
}
.nav-tab.active .nav-tab__label {
  font-weight: 700; color: var(--primary-red-light); letter-spacing: 0.3px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 28px; border: none; border-radius: var(--radius-md);
  font-family: var(--font-family); font-size: 16px; font-weight: 700;
  cursor: pointer; outline: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, filter 0.2s ease;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.btn:active { transform: scale(0.95) translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; filter: none; }

.btn--primary {
  background: var(--red-gradient); color: #fff;
  box-shadow: 0 4px 20px rgba(204,31,64,0.35);
}
.btn--primary:active { box-shadow: 0 2px 8px rgba(204,31,64,0.2); }
.btn--gold {
  background: var(--jackpot-gradient); color: var(--text-on-gold);
  box-shadow: 0 4px 20px rgba(249,199,79,0.35);
}
.btn--outline {
  background: rgba(255,255,255,0.04); color: var(--text-secondary);
  border: 1.5px solid rgba(255,255,255,0.1);
}
.btn--outline:active { background: rgba(255,255,255,0.08); }
.btn--sm { padding: 8px 16px; font-size: 13px; border-radius: var(--radius-sm); }
.btn--full { width: 100%; }
.btn--icon { width: 44px; height: 44px; padding: 0; border-radius: 12px; }

/* ── Tab Bar ── */
.tab-bar {
  display: flex; padding: 4px; margin: 4px 16px;
  background: rgba(26,26,46,0.6); border-radius: var(--radius-md);
  border: 1px solid rgba(255,255,255,0.05);
}
.tab-bar__item {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px; border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 500; color: var(--text-muted);
  cursor: pointer; transition: all 0.25s ease;
}
.tab-bar__item.active {
  background: var(--red-gradient); color: #fff; font-weight: 700;
  box-shadow: 0 2px 12px rgba(204,31,64,0.3);
}

/* ── Badge / Status ── */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 8px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.5px;
}
.badge--success { background: rgba(45,198,83,0.12); color: var(--success); }
.badge--gold { background: rgba(249,199,79,0.12); color: var(--accent-gold); }
.badge--muted { background: rgba(107,107,128,0.12); color: var(--text-secondary); }
.badge--info { background: rgba(67,97,238,0.12); color: var(--info); }
.badge--red { background: rgba(204,31,64,0.12); color: var(--primary-red-light); }

/* ── Icon Badge (stat counter) ── */
.icon-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; background: rgba(26,26,46,0.6);
  border-radius: 12px; border: 1px solid rgba(255,255,255,0.06);
}

/* ── Section Label ── */
.section-label {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 20px 6px; font-size: 13px; font-weight: 600;
  letter-spacing: 0.5px; color: var(--text-secondary);
}
.section-label__dot { width: 8px; height: 8px; border-radius: 50%; }

/* ── Horizontal Scroll ── */
.h-scroll {
  display: flex; gap: 12px; overflow-x: auto;
  padding: 0 16px 12px; scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.2) transparent;
  cursor: grab; scroll-behavior: smooth;
}
.h-scroll::-webkit-scrollbar { height: 4px; }
.h-scroll::-webkit-scrollbar-track { background: transparent; }
.h-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }
.h-scroll > * { scroll-snap-align: start; flex-shrink: 0; }

/* ── Empty State ── */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; flex: 1; padding: 40px 20px;
}
.empty-state__icon {
  width: 80px; height: 80px; border-radius: 50%;
  background: var(--surface-card); border: 1px solid rgba(255,255,255,0.06);
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; color: rgba(107,107,128,0.4); margin-bottom: 20px;
}

/* ── Splash Screen (branded) ── */
.splash {
  width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--splash-gradient);
  position: fixed; inset: 0; z-index: 1000;
  transition: opacity 0.5s ease, transform 0.4s ease;
}
.splash.hidden { opacity: 0; transform: scale(1.05); pointer-events: none; }
.splash__glow {
  position: absolute; width: 280px; height: 280px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.12) 0%, transparent 70%);
  pointer-events: none;
}
.splash__logo {
  width: 140px; height: 140px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  position: relative; z-index: 1;
}
.splash__logo img {
  width: 120px; height: 120px; object-fit: contain;
  filter: drop-shadow(0 4px 20px rgba(0,0,0,0.15));
}
.splash__title {
  font-size: 22px; font-weight: 800; letter-spacing: 1.2px;
  color: #fff; margin-top: 24px; text-shadow: 0 2px 12px rgba(0,0,0,0.2);
}
.splash__tagline {
  font-size: 12px; font-weight: 400; letter-spacing: 3px;
  color: rgba(255,255,255,0.75); margin-top: 6px;
}
.splash__dots { display: flex; gap: 8px; margin-top: 52px; }
.splash__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,0.5);
}

/* ── Countdown Blocks ── */
.countdown { display: flex; align-items: center; gap: 6px; }
.countdown__block {
  background: rgba(15,15,26,0.5); border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-sm); padding: 10px 12px; min-width: 52px; text-align: center;
}
.countdown__value {
  font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}
.countdown__label {
  font-size: 8px; font-weight: 600; letter-spacing: 1px;
  color: var(--text-muted); text-transform: uppercase; margin-top: 2px;
}
.countdown__sep { font-size: 20px; font-weight: 700; color: var(--text-muted); padding: 0 2px; }

/* ── App Header Bar ── */
.app-header {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px 8px;
}
.app-header__logo {
  width: 36px; height: 36px; border-radius: 10px; overflow: hidden;
  background: rgba(204,31,64,0.15); display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.app-header__logo img { width: 28px; height: 28px; object-fit: contain; }

/* ── Divider ── */
.divider {
  height: 1px; margin: 10px 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
}

/* ── Utility ── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-center { align-items: center; justify-content: center; }
.flex-between { justify-content: space-between; }
.items-center { align-items: center; }
.gap-4 { gap: 4px; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.flex-1 { flex: 1; }
.w-full { width: 100%; }
.px-16 { padding-left: 16px; padding-right: 16px; }
.px-20 { padding-left: 20px; padding-right: 20px; }
.py-8 { padding-top: 8px; padding-bottom: 8px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.text-center { text-align: center; }
.wrap { flex-wrap: wrap; }
.hidden { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Extra Ball Styles ── */
.ball--extra-selected {
  background: linear-gradient(145deg, #5575F5, #4361EE 50%, #3050D0);
  color: #fff; font-weight: 800;
  box-shadow: 0 3px 16px rgba(67,97,238,0.5), inset 0 -2px 4px rgba(0,0,0,0.15);
  transform: scale(1.08);
}
.ball--extra-unselected {
  background: rgba(42,42,69,0.6);
  border: 1.5px solid rgba(67,97,238,0.15);
  color: var(--text-muted); cursor: pointer;
}
.ball--extra-unselected::after { display: none; }
.ball--extra-unselected:active { transform: scale(0.9); }

/* ── Step Indicator Pills ── */
.step-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 20px;
  font-size: 12px; font-weight: 600;
  transition: all 0.3s ease;
}
.step-pill__num {
  width: 20px; height: 20px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800;
}
.step-pill__label { font-size: 12px; }
.step-pill__connector {
  width: 28px; height: 2px;
  background: rgba(255,255,255,0.1);
  border-radius: 1px;
}

.step-pill--active {
  background: rgba(204,31,64,0.15);
  color: var(--primary-red-light);
}
.step-pill--active .step-pill__num {
  background: var(--primary-red-light);
  color: #fff;
}
.step-pill--done {
  background: rgba(45,198,83,0.12);
  color: var(--success);
}
.step-pill--done .step-pill__num {
  background: var(--success);
  color: #fff;
}
.step-pill--pending {
  background: rgba(255,255,255,0.04);
  color: var(--text-muted);
}
.step-pill--pending .step-pill__num {
  background: rgba(255,255,255,0.08);
  color: var(--text-muted);
}

/* ── Ball Animations ── */
.anim-ball-pop {
  animation: ball-pop 0.25s ease forwards;
}
@keyframes ball-pop {
  0% { transform: scale(0.5); opacity: 0; }
  60% { transform: scale(1.15); }
  100% { transform: scale(1.08); opacity: 1; }
}
.anim-ball-bounce {
  animation: ball-bounce 0.3s ease;
}
@keyframes ball-bounce {
  0%, 100% { transform: scale(1.08); }
  50% { transform: scale(1.2); }
}

/* ── Modal Overlay ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-content {
  background: var(--surface);
  border-radius: 16px;
  width: 100%;
  max-width: 400px;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid rgba(255,255,255,0.08);
}

/* ── Light Theme ── */
body.light-theme {
  --surface-dark: #F5F5FA;
  --surface-card: #FFFFFF;
  --surface-card-light: #F0F0F5;
  --surface-elevated: #E8E8F0;
  --text-primary: #1A1A2E;
  --text-secondary: #4A4A60;
  --text-muted: #8888A0;
  --text-on-gold: #1A1A2E;
  --ball-unselected: #E0E0E8;
  --bg-gradient: linear-gradient(180deg, #F0F0F8 0%, #E8E8F2 50%, #F5F5FA 100%);
  --card-gradient: linear-gradient(135deg, #FFFFFF, #F5F5FA);
}
body.light-theme #app { background: var(--bg-gradient); }
body.light-theme .glass-card {
  background: rgba(255,255,255,0.85) !important;
  border-color: rgba(0,0,0,0.08) !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
body.light-theme .glass-card--glow-gold { box-shadow: 0 2px 12px rgba(249,199,79,0.15); }
body.light-theme .glass-card--glow-red { box-shadow: 0 2px 12px rgba(204,31,64,0.1); }
body.light-theme .bottom-nav { background: rgba(255,255,255,0.95); border-color: rgba(0,0,0,0.08); }
body.light-theme .nav-tab { color: var(--text-muted); }
body.light-theme .nav-tab.active { color: var(--primary-red); }
body.light-theme .splash { background: var(--splash-gradient); }
body.light-theme .btn--outline { border-color: rgba(0,0,0,0.15); color: var(--text-primary); }
body.light-theme .badge { border: 1px solid rgba(0,0,0,0.06); }
body.light-theme .divider { border-color: rgba(0,0,0,0.08) !important; }
body.light-theme .tab-bar { background: rgba(0,0,0,0.04); }
body.light-theme .countdown__block { background: rgba(0,0,0,0.05); }
body.light-theme .ball--unselected { background: var(--ball-unselected); color: var(--text-muted); }
body.light-theme .ball--main { color: #fff; }
body.light-theme .ball--extra { color: #fff; }
body.light-theme input, body.light-theme select, body.light-theme textarea {
  background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.12); color: var(--text-primary);
}
body.light-theme .text-label-sm { color: var(--text-muted); }
body.light-theme .section-label { color: var(--text-secondary); }
body.light-theme .toast { background: #fff; color: var(--text-primary); box-shadow: 0 4px 16px rgba(0,0,0,0.12); }
body.light-theme .toast--error { background: #FEF2F2; color: var(--error); }
body.light-theme .toast--success { background: #F0FDF4; color: var(--success); }
body.light-theme .modal-overlay { background: rgba(0,0,0,0.4); }
body.light-theme .modal-content { background: #fff; border-color: rgba(0,0,0,0.1); }
body.light-theme .anim-text-shimmer { color: var(--accent-gold-dark); }
body.light-theme .anim-pulse-glow { box-shadow: 0 0 30px rgba(249,199,79,0.1); }
body.light-theme .lang-toggle { background: rgba(0,0,0,0.05); border-color: rgba(0,0,0,0.12); color: var(--text-secondary); }
body.light-theme .icon-badge { background: rgba(0,0,0,0.04); }

/* Theme toggle button */
.theme-toggle {
  cursor: pointer;
  width: 32px; height: 32px;
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.3s;
}
body.light-theme .theme-toggle {
  background: rgba(0,0,0,0.05);
  border-color: rgba(0,0,0,0.12);
}
.theme-toggle:hover { opacity: 0.8; }

/* ── RTL Support ── */
body.rtl { direction: rtl; text-align: right; }
body.rtl .flex { direction: rtl; }
body.rtl .flex-between { flex-direction: row-reverse; }
body.rtl .app-header { direction: rtl; }
body.rtl .app-header .material-icons-round { margin-left: 0; margin-right: 0; }
body.rtl .nav-tab__label { font-family: 'Plus Jakarta Sans', 'Segoe UI', Tahoma, sans-serif; }
body.rtl .section-label { direction: rtl; }
body.rtl .section-label__dot { margin-left: 8px; margin-right: 0; }
body.rtl .h-scroll { direction: rtl; }
body.rtl .step-pill__connector { transform: scaleX(-1); }
body.rtl .badge { direction: rtl; }
body.rtl .countdown { direction: ltr; } /* Numbers stay LTR */
body.rtl .ball { direction: ltr; } /* Numbers stay LTR */
body.rtl .text-prize { direction: ltr; display: inline-block; } /* Currency amounts LTR */
body.rtl input, body.rtl select, body.rtl textarea { direction: rtl; text-align: right; }
body.rtl input[type="date"], body.rtl input[type="number"] { direction: ltr; text-align: left; }

/* Language toggle button */
.lang-toggle {
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s;
}
.lang-toggle:hover { background: rgba(255,255,255,0.1); }
