:root {
  --primary: #6C3CE1;
  --primary-dark: #5228B5;
  --secondary: #00B4D8;
  --gold: #FFD700;
  --gold-dark: #E6C200;
  --green: #00C853;
  --red: #FF1744;
  --bg-dark: #0D1B2A;
  --bg-card-dark: #1B2838;
  --text-dark: #E0E0E0;
}

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

body {
  font-family: 'Cairo', sans-serif;
  background: linear-gradient(135deg, #0F0C29 0%, #302B63 50%, #24243E 100%);
  min-height: 100vh;
  color: #fff;
  overflow-x: hidden;
  direction: rtl;
}

body.light-mode {
  background: linear-gradient(135deg, #E8E0FF 0%, #D0E8FF 50%, #E0F0FF 100%);
  color: #1a1a2e;
}

#root {
  min-height: 100vh;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(108, 60, 225, 0.4); }
  50% { box-shadow: 0 0 40px rgba(108, 60, 225, 0.8), 0 0 60px rgba(0, 180, 216, 0.3); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
  20%, 40%, 60%, 80% { transform: translateX(4px); }
}

@keyframes confetti-fall {
  0% { transform: translateY(-10px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100px) rotate(720deg); opacity: 0; }
}

@keyframes count-up {
  0% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(-40px); opacity: 0; }
}

@keyframes spin-wheel {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(var(--spin-deg, 1800deg)); }
}

@keyframes slide-in-right {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slide-in-left {
  from { transform: translateX(-100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes fade-in {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes bounce-in {
  0% { transform: scale(0.3); opacity: 0; }
  50% { transform: scale(1.05); }
  70% { transform: scale(0.9); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes firework {
  0% { transform: scale(0); opacity: 1; }
  50% { opacity: 1; }
  100% { transform: scale(1.5); opacity: 0; }
}

@keyframes bubble-float {
  0% { transform: translateY(100vh) scale(0); opacity: 0; }
  10% { opacity: 0.6; }
  90% { opacity: 0.6; }
  100% { transform: translateY(-10vh) scale(1); opacity: 0; }
}

.animate-slide-in { animation: slide-in-right 0.4s ease-out; }
.animate-fade-in { animation: fade-in 0.3s ease-out; }
.animate-bounce-in { animation: bounce-in 0.5s ease-out; }
.animate-shake { animation: shake 0.5s ease-in-out; }

.card-3d {
  transform-style: preserve-3d;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-3d:hover {
  transform: translateY(-4px) rotateX(2deg);
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.card-3d:active {
  transform: scale(0.97);
}

.glass {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.light-mode .glass {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.8);
  color: #1a1a2e;
}

.glass-strong {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-press {
  transition: transform 0.15s ease;
}

.btn-press:active {
  transform: scale(0.95);
}

.gradient-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
}

.gradient-gold {
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
}

.timer-bar {
  transition: width 0.1s linear;
}

.confetti-piece {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  animation: confetti-fall 1.5s ease-out forwards;
}

.floating-points {
  animation: count-up 1s ease-out forwards;
  position: absolute;
  pointer-events: none;
  font-weight: 800;
  color: var(--gold);
  font-size: 1.2rem;
}

.wheel-container {
  transition: transform 4s cubic-bezier(0.17, 0.67, 0.12, 0.99);
}

.bubble {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.2), transparent);
  animation: bubble-float linear infinite;
}

.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.05) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

::-webkit-scrollbar {
  width: 4px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(108, 60, 225, 0.4);
  border-radius: 4px;
}

input, select {
  font-family: 'Cairo', sans-serif;
}

.bottom-nav-safe {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}