/* ============================================================
   ألغاز عربية V5 — التصميم الخيالي الكوني
   ============================================================ */

:root {
  /* Colors - Cosmic Theme */
  --bg-primary: #0a0518;
  --bg-secondary: #15082e;
  --bg-tertiary: #1e0b3d;

  --bg-card: rgba(80, 40, 160, 0.15);
  --bg-card-hover: rgba(120, 60, 220, 0.25);

  --accent-primary: #7c3aed;
  --accent-secondary: #ec4899;
  --accent-gold: #fbbf24;
  --accent-gold-dark: #b45309;
  --accent-gold-light: #fcd34d;
  --accent-purple-light: #a855f7;
  --accent-purple-glow: #c084fc;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --accent-blue: #3b82f6;

  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.75);
  --text-muted: rgba(255, 255, 255, 0.4);

  --border-color: rgba(168, 85, 247, 0.3);
  --border-glow: rgba(168, 85, 247, 0.6);

  /* Spacing */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 40px rgba(124, 58, 237, 0.5);
  --shadow-gold: 0 0 40px rgba(251, 191, 36, 0.6);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg-primary);
  font-family: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text-primary);
  direction: rtl;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   الخلفية الكونية — شبكة + توهج
   ============================================================ */

#app {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: 
    radial-gradient(ellipse at 20% 0%, rgba(124, 58, 237, 0.25) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(236, 72, 153, 0.15) 0%, transparent 50%),
    linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 50%, var(--bg-primary) 100%);
}

/* شبكة خفيفة في الخلفية */
#app::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(124, 58, 237, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124, 58, 237, 0.06) 1px, transparent 1px);
  background-size: 44px 44px;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}

/* توهج متحرك */
#app::after {
  content: '';
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(circle at 30% 30%, rgba(168, 85, 247, 0.15), transparent 40%),
    radial-gradient(circle at 70% 70%, rgba(236, 72, 153, 0.1), transparent 40%);
  pointer-events: none;
  z-index: 0;
  animation: glowPulse 6s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

/* ============ Screens ============ */
.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  z-index: 1;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.screen.active {
  display: flex;
  opacity: 1;
}

/* Sheet Screens */
.screen.sheet {
  top: auto;
  height: 85%;
  max-height: 85vh;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  background: linear-gradient(180deg, var(--bg-secondary), var(--bg-primary));
  border-top: 2px solid var(--border-glow);
  box-shadow: 0 -10px 60px rgba(124, 58, 237, 0.4);
  transform: translateY(100%);
  transition: transform var(--transition-slow);
}

.screen.sheet.active {
  transform: translateY(0);
}

/* Modal Screens */
.screen.modal {
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

/* ============ Splash Screen ============ */
.splash {
  background: 
    radial-gradient(ellipse at center, rgba(124, 58, 237, 0.5) 0%, transparent 60%),
    linear-gradient(135deg, #1a0a3d, #0a0518);
  align-items: center;
  justify-content: center;
}

.splash-content {
  text-align: center;
  animation: fadeInUp 0.8s ease;
}

.splash-logo {
  font-size: 5rem;
  animation: bounce 2s ease-in-out infinite;
  filter: drop-shadow(0 0 30px rgba(168, 85, 247, 0.8));
}

.splash-title {
  font-size: 2.5rem;
  font-weight: 900;
  margin: 16px 0 8px;
  background: linear-gradient(90deg, #fbbf24, #ec4899, #a855f7);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.splash-sub {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 32px;
}

.loading-bar {
  width: 200px;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  margin: 0 auto;
  overflow: hidden;
  box-shadow: 0 0 20px rgba(124, 58, 237, 0.5);
}

.loading-fill {
  height: 100%;
  background: linear-gradient(90deg, #fbbf24, #ec4899, #a855f7);
  background-size: 200% 100%;
  border-radius: var(--radius-full);
  animation: loading 2s ease forwards, gradientShift 1.5s linear infinite;
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.8);
}

@keyframes loading {
  from { width: 0%; }
  to { width: 100%; }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============ Home Screen ============ */
#homeScreen {
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.home-container {
  min-height: 100%;
  padding: env(safe-area-inset-top, 16px) 16px calc(env(safe-area-inset-bottom, 16px) + 90px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 500px;
  margin: 0 auto;
  width: 100%;
  position: relative;
  z-index: 2;
}

/* Player Card */
.player-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, rgba(80, 40, 160, 0.4), rgba(40, 20, 90, 0.5));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1.5px solid var(--border-glow);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: 0 0 30px rgba(124, 58, 237, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.player-avatar {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-radius: var(--radius-md);
  flex-shrink: 0;
  box-shadow: 0 0 20px rgba(124, 58, 237, 0.6);
}

.player-info {
  flex: 1;
  min-width: 0;
}

.player-name {
  font-weight: 800;
  font-size: 1rem;
  margin-bottom: 2px;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.player-rank {
  font-size: 0.75rem;
  color: var(--accent-gold);
  font-weight: 700;
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

.player-coins {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(251, 191, 36, 0.15);
  border: 1.5px solid rgba(251, 191, 36, 0.5);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-weight: 800;
  color: var(--accent-gold);
  font-size: 0.9rem;
  box-shadow: 0 0 15px rgba(251, 191, 36, 0.3);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, rgba(80, 40, 160, 0.3), rgba(40, 20, 90, 0.4));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 6px;
  backdrop-filter: blur(10px);
}

.stat-icon {
  font-size: 1.1rem;
  filter: drop-shadow(0 0 6px currentColor);
}

.stat-value {
  font-size: 1rem;
  font-weight: 900;
  color: var(--accent-gold);
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

.stat-label {
  font-size: 0.6rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Quick Category */
.quick-category {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, rgba(80, 40, 160, 0.35), rgba(40, 20, 90, 0.45));
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  cursor: pointer;
  transition: all var(--transition-fast);
  backdrop-filter: blur(10px);
}

.quick-category:active {
  transform: scale(0.98);
  border-color: var(--border-glow);
  box-shadow: 0 0 25px rgba(124, 58, 237, 0.4);
}

.qc-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 700;
}

.qc-value {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 0.95rem;
}

.qc-arrow {
  color: var(--text-muted);
  font-size: 0.7rem;
}

/* Play Button — الذهبي */
.play-button {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(180deg, #fcd34d 0%, #fbbf24 40%, #f59e0b 70%, #d97706 100%);
  border: 3px solid #fcd34d;
  border-radius: var(--radius-full);
  padding: 18px 28px;
  color: #1a0f2e;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 
    0 0 40px rgba(251, 191, 36, 0.6),
    0 8px 0 var(--accent-gold-dark),
    inset 0 2px 0 rgba(255, 255, 255, 0.5);
  position: relative;
  overflow: hidden;
  font-family: inherit;
}

.play-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  transition: left 0.6s;
}

.play-button:active::before {
  left: 100%;
}

.play-button:active {
  transform: translateY(6px);
  box-shadow: 
    0 0 60px rgba(251, 191, 36, 0.9),
    0 2px 0 var(--accent-gold-dark),
    inset 0 2px 0 rgba(255, 255, 255, 0.5);
}

.play-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  background: rgba(26, 15, 46, 0.25);
  border-radius: var(--radius-full);
  flex-shrink: 0;
  color: #1a0f2e;
}

.play-text {
  flex: 1;
  text-align: right;
}

.play-text strong {
  display: block;
  font-size: 1.25rem;
  font-weight: 900;
  margin-bottom: 2px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
}

.play-text small {
  font-size: 0.8rem;
  opacity: 0.85;
  font-weight: 700;
}

/* Energy Section */
.energy-section {
  background: linear-gradient(135deg, rgba(80, 40, 160, 0.35), rgba(40, 20, 90, 0.45));
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  backdrop-filter: blur(10px);
}

.energy-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.85rem;
  font-weight: 800;
}

.energy-header strong {
  color: var(--accent-gold);
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

.energy-track {
  height: 10px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.energy-fill {
  height: 100%;
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
  border-radius: var(--radius-full);
  transition: width var(--transition-normal);
  box-shadow: 0 0 15px rgba(251, 191, 36, 0.7);
}

.energy-timer {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 6px;
  font-weight: 600;
}

/* Missions Card */
.missions-card {
  background: linear-gradient(135deg, rgba(80, 40, 160, 0.35), rgba(40, 20, 90, 0.45));
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  backdrop-filter: blur(10px);
}

.missions-header {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--accent-gold);
  margin-bottom: 12px;
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.4);
}

.missions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mission-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(168, 85, 247, 0.15);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  transition: all var(--transition-fast);
}

.mission-item.done {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
}

.mission-item.claimable {
  cursor: pointer;
  animation: pulse 1.5s infinite;
  border-color: var(--accent-gold);
}

.mission-icon {
  font-size: 1.1rem;
}

.mission-info {
  flex: 1;
}

.mission-name {
  font-weight: 700;
  margin-bottom: 2px;
}

.mission-progress {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.mission-reward {
  background: rgba(251, 191, 36, 0.2);
  color: var(--accent-gold);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-weight: 800;
  font-size: 0.7rem;
  border: 1px solid rgba(251, 191, 36, 0.4);
}

.mission-item.done .mission-reward {
  background: var(--accent-green);
  color: white;
  border-color: var(--accent-green);
}

/* Daily Box */
.daily-box {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  border: 2px solid #fbbf24;
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  color: white;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 
    0 0 30px rgba(245, 158, 11, 0.5),
    0 6px 0 rgba(0, 0, 0, 0.3);
  font-family: inherit;
}

.daily-box:active {
  transform: translateY(4px);
  box-shadow: 0 0 40px rgba(245, 158, 11, 0.7), 0 2px 0 rgba(0, 0, 0, 0.3);
}

.daily-box.disabled {
  filter: grayscale(0.7);
  opacity: 0.6;
  pointer-events: none;
}

.db-icon {
  font-size: 2rem;
  animation: wiggle 2s ease-in-out infinite;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
}

@keyframes wiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-10deg); }
  75% { transform: rotate(10deg); }
}

.db-info {
  flex: 1;
  text-align: right;
}

.db-info strong {
  display: block;
  font-size: 1rem;
  font-weight: 900;
  margin-bottom: 2px;
}

.db-info small {
  font-size: 0.75rem;
  opacity: 0.95;
}

.db-arrow {
  font-size: 1.2rem;
  opacity: 0.9;
}

/* Features Bar (الجديد) */
.features-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(80, 40, 160, 0.4), rgba(40, 20, 90, 0.5));
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(10px);
  box-shadow: 0 0 20px rgba(124, 58, 237, 0.2);
}

.feature-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 0.65rem;
  color: var(--text-secondary);
  font-weight: 700;
  text-align: center;
}

.feature-item span {
  font-size: 1.4rem;
  filter: drop-shadow(0 0 8px rgba(168, 85, 247, 0.7));
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  gap: 4px;
  padding: 8px 12px calc(env(safe-area-inset-bottom, 8px) + 8px);
  background: linear-gradient(0deg, rgba(10, 5, 24, 0.98), rgba(21, 8, 46, 0.95));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1.5px solid var(--border-glow);
  box-shadow: 0 -5px 30px rgba(124, 58, 237, 0.3);
  z-index: 10;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  padding: 8px 4px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  min-height: 56px;
  position: relative;
  font-family: inherit;
}

.nav-item span {
  font-size: 1.3rem;
  line-height: 1;
  filter: drop-shadow(0 0 5px currentColor);
}

.nav-item small {
  font-size: 0.6rem;
  font-weight: 700;
}

.nav-item:active,
.nav-item.active {
  background: rgba(124, 58, 237, 0.25);
  color: var(--accent-gold);
  box-shadow: inset 0 0 20px rgba(124, 58, 237, 0.3);
}

.nav-item:active {
  transform: scale(0.95);
}

/* ============ Game Screen ============ */
#gameScreen {
  padding: env(safe-area-inset-top, 12px) 14px calc(env(safe-area-inset-bottom, 12px) + 8px);
}

.game-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
  position: relative;
  z-index: 2;
}

/* Game Header */
.game-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: linear-gradient(135deg, rgba(80, 40, 160, 0.5), rgba(40, 20, 90, 0.6));
  border: 1.5px solid var(--border-glow);
  border-radius: var(--radius-lg);
  box-shadow: 0 0 25px rgba(124, 58, 237, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(15px);
}

.game-back,
.game-hint {
  width: 44px;
  height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.4), rgba(76, 29, 149, 0.5));
  border: 1.5px solid var(--border-glow);
  border-radius: var(--radius-md);
  color: white;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  font-family: inherit;
  box-shadow: 0 0 15px rgba(124, 58, 237, 0.3);
}

.game-back:active,
.game-hint:active {
  transform: scale(0.92);
  box-shadow: 0 0 25px rgba(124, 58, 237, 0.6);
}

.game-hint small {
  font-size: 0.6rem;
  color: var(--accent-gold);
  font-weight: 800;
  margin-top: -2px;
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.6);
}

.game-info {
  flex: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-around;
  gap: 12px;
  background: transparent;
  border: none;
  padding: 0;
}

.game-level {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 700;
}

.game-level strong {
  color: var(--accent-gold);
  font-size: 1.1rem;
  font-weight: 900;
  text-shadow: 0 0 12px rgba(251, 191, 36, 0.6);
}

.game-category {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--accent-purple-glow);
  text-shadow: 0 0 10px rgba(192, 132, 252, 0.6);
}

/* Progress Section */
.progress-section {
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-score {
  display: flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(245, 158, 11, 0.15));
  border: 1.5px solid rgba(251, 191, 36, 0.5);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 900;
  color: var(--accent-gold);
  box-shadow: 0 0 15px rgba(251, 191, 36, 0.3);
}

.progress-bar {
  flex: 1;
  height: 8px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
  border-radius: var(--radius-full);
  width: 100%;
  transition: width var(--transition-normal);
  box-shadow: 0 0 15px rgba(251, 191, 36, 0.7);
}

.lives-display {
  font-size: 0.95rem;
  letter-spacing: -2px;
  filter: drop-shadow(0 0 6px rgba(239, 68, 68, 0.5));
}

/* Question Area */
.question-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-top: 16px;
}

/* Question Card — البطاقة الكونية */
.question-card {
  position: relative;
  background: linear-gradient(145deg, rgba(76, 29, 149, 0.7), rgba(30, 11, 61, 0.9));
  border: 2px solid rgba(192, 132, 252, 0.6);
  border-radius: var(--radius-xl);
  padding: 32px 20px 24px;
  animation: slideDown 0.35s ease;
  box-shadow: 
    0 0 50px rgba(124, 58, 237, 0.5),
    inset 0 0 60px rgba(124, 58, 237, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  overflow: hidden;
  backdrop-filter: blur(20px);
}

/* حدود متوهجة متحركة */
.question-card::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: var(--radius-xl);
  padding: 2px;
  background: linear-gradient(135deg, 
    rgba(192, 132, 252, 0.9), 
    rgba(236, 72, 153, 0.6),
    rgba(251, 191, 36, 0.5),
    rgba(192, 132, 252, 0.9)
  );
  background-size: 300% 300%;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: borderRotate 6s linear infinite;
  pointer-events: none;
  opacity: 0.7;
}

@keyframes borderRotate {
  0% { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

/* رموز زخرفية داخل الكارت */
.question-card::after {
  content: '∑ ÷ × + − =';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 7rem;
  color: rgba(168, 85, 247, 0.06);
  font-weight: 900;
  letter-spacing: 1.5rem;
  pointer-events: none;
  white-space: nowrap;
  user-select: none;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-15px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Badge — التصنيف */
.q-badge {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #4c1d95, #7c3aed);
  border: 2px solid #a855f7;
  border-radius: var(--radius-full);
  padding: 8px 24px;
  font-size: 0.85rem;
  font-weight: 800;
  color: #fff;
  box-shadow: 
    0 0 25px rgba(168, 85, 247, 0.7),
    0 4px 15px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  z-index: 3;
  white-space: nowrap;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
}

/* نص السؤال */
.q-text {
  position: relative;
  z-index: 2;
  font-size: 1.45rem;
  font-weight: 900;
  line-height: 1.7;
  text-align: center;
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  text-shadow: 
    0 0 20px rgba(255, 255, 255, 0.3),
    0 2px 8px rgba(0, 0, 0, 0.8);
  color: #fff;
  letter-spacing: 0.5px;
}

/* Timer Bar */
.timer-bar {
  height: 10px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(168, 85, 247, 0.3);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5);
}

.timer-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #fbbf24, #ef4444);
  background-size: 300% 100%;
  border-radius: var(--radius-full);
  transition: width 0.1s linear, background 0.3s;
  width: 100%;
  box-shadow: 0 0 15px currentColor;
}

.timer-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.65rem;
  font-weight: 900;
  color: white;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  display: none;
}

/* ============================================================
   Answers Grid — الأزرار الكونية
   ============================================================ */

.answers-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  position: relative;
}

.answer-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 82px;
  padding: 14px 16px;
  background: linear-gradient(145deg, rgba(76, 29, 149, 0.85), rgba(30, 11, 61, 0.95));
  border: 2px solid rgba(124, 58, 237, 0.6);
  border-radius: 18px;
  color: #fff;
  font-size: 1.25rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 
    0 0 15px rgba(124, 58, 237, 0.35),
    inset 0 0 25px rgba(124, 58, 237, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  overflow: hidden;
  text-align: right;
}

/* توهج خفيف على الحافة العلوية */
.answer-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(180deg, rgba(168, 85, 247, 0.15), transparent);
  border-radius: 18px 18px 0 0;
  pointer-events: none;
}

/* الحرف A/B/C/D */
.answer-btn::before {
  content: attr(data-letter);
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #7c3aed, #4c1d95);
  border: 1.5px solid rgba(192, 132, 252, 0.6);
  border-radius: 50%;
  font-size: 1.05rem;
  font-weight: 900;
  color: #fff;
  box-shadow: 
    0 0 15px rgba(124, 58, 237, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  z-index: 2;
  position: relative;
}

.answer-btn span {
  flex: 1;
  position: relative;
  z-index: 2;
  line-height: 1.4;
}

.answer-btn:active {
  transform: scale(0.96);
  box-shadow: 
    0 0 30px rgba(124, 58, 237, 0.7),
    inset 0 0 30px rgba(124, 58, 237, 0.2);
}

/* الإجابة الصحيحة — ذهبية */
.answer-btn.correct {
  background: linear-gradient(145deg, rgba(120, 53, 15, 0.9), rgba(70, 30, 5, 0.95));
  border-color: #fbbf24;
  box-shadow: 
    0 0 50px rgba(251, 191, 36, 0.9),
    inset 0 0 40px rgba(251, 191, 36, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  animation: correctGlow 0.7s ease;
}

.answer-btn.correct::before {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #1a0f2e;
  border-color: #fcd34d;
  box-shadow: 0 0 25px rgba(251, 191, 36, 1);
  text-shadow: none;
}

.answer-btn.correct::after {
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.3), transparent);
}

@keyframes correctGlow {
  0% { transform: scale(1); }
  50% { transform: scale(1.04); box-shadow: 0 0 70px rgba(251, 191, 36, 1); }
  100% { transform: scale(1); }
}

/* الإجابة الخطأ */
.answer-btn.wrong {
  background: linear-gradient(145deg, rgba(120, 20, 20, 0.9), rgba(60, 10, 10, 0.95));
  border-color: #ef4444;
  box-shadow: 
    0 0 35px rgba(239, 68, 68, 0.7),
    inset 0 0 30px rgba(239, 68, 68, 0.2);
  animation: wrongShake 0.45s ease;
}

.answer-btn.wrong::before {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  border-color: #f87171;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.9);
}

@keyframes wrongShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-10px); }
  40% { transform: translateX(10px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}

/* إجابة ملغية (50:50 أو hint) */
.answer-btn.eliminated {
  opacity: 0.15;
  pointer-events: none;
  text-decoration: line-through;
  filter: grayscale(1);
}

.answer-btn.disabled {
  pointer-events: none;
  cursor: default;
}

/* Game Controls */
.game-controls {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.control-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, rgba(80, 40, 160, 0.4), rgba(40, 20, 90, 0.5));
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 8px;
  color: white;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-fast);
  backdrop-filter: blur(10px);
}

.control-btn span {
  font-size: 1.3rem;
  line-height: 1;
  filter: drop-shadow(0 0 6px rgba(168, 85, 247, 0.5));
}

.control-btn small {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.control-btn:active {
  transform: scale(0.95);
  border-color: var(--border-glow);
  box-shadow: 0 0 20px rgba(124, 58, 237, 0.4);
}

.control-btn:disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ============ Result Screen ============ */
.result-screen {
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.result-screen.fail {
  background: radial-gradient(ellipse at center, rgba(239, 68, 68, 0.15), transparent 70%);
}

.result-content {
  max-width: 380px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: center;
  animation: fadeInUp 0.4s ease;
}

.result-icon {
  font-size: 5rem;
  animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(0 0 30px rgba(251, 191, 36, 0.6));
}

@keyframes popIn {
  from { transform: scale(0); }
  to { transform: scale(1); }
}

.result-title {
  font-size: 1.9rem;
  font-weight: 900;
  background: linear-gradient(90deg, #fbbf24, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 30px rgba(251, 191, 36, 0.4);
}

.result-sub {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.result-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, rgba(80, 40, 160, 0.4), rgba(40, 20, 90, 0.5));
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 8px;
  backdrop-filter: blur(10px);
}

.rs-icon {
  font-size: 1.3rem;
  filter: drop-shadow(0 0 8px currentColor);
}

.result-stat strong {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--accent-gold);
  text-shadow: 0 0 15px rgba(251, 191, 36, 0.6);
}

.result-stat small {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 700;
}

.streak-bonus {
  background: rgba(251, 191, 36, 0.15);
  border: 2px solid var(--accent-gold);
  border-radius: var(--radius-md);
  padding: 12px;
  font-weight: 800;
  font-size: 0.9rem;
  box-shadow: 0 0 25px rgba(251, 191, 36, 0.4);
}

/* Fail Stats */
.fail-stats {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: linear-gradient(135deg, rgba(80, 40, 160, 0.35), rgba(40, 20, 90, 0.45));
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  backdrop-filter: blur(10px);
}

.fail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color);
}

.fail-row:last-child {
  border-bottom: none;
}

.fail-row strong {
  color: var(--accent-gold);
  font-weight: 900;
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

/* ============ Buttons ============ */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(180deg, #fcd34d 0%, #fbbf24 50%, #f59e0b 100%);
  border: 2px solid #fcd34d;
  border-radius: var(--radius-md);
  padding: 16px 24px;
  color: #1a0f2e;
  font-size: 1rem;
  font-weight: 900;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 
    0 0 30px rgba(251, 191, 36, 0.5),
    0 4px 0 var(--accent-gold-dark);
}

.btn-primary:active {
  transform: translateY(3px);
  box-shadow: 0 0 40px rgba(251, 191, 36, 0.8), 0 1px 0 var(--accent-gold-dark);
}

.btn-primary.revive {
  background: linear-gradient(180deg, #f87171, #ef4444, #dc2626);
  border-color: #fca5a5;
  color: white;
  box-shadow: 0 0 30px rgba(239, 68, 68, 0.6), 0 4px 0 #7f1d1d;
}

.btn-ghost {
  background: rgba(80, 40, 160, 0.3);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-fast);
  backdrop-filter: blur(10px);
}

.btn-ghost:active {
  background: rgba(124, 58, 237, 0.3);
  border-color: var(--border-glow);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  color: white;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
}

/* ============ Sheet Styles ============ */
.sheet-handle {
  width: 44px;
  height: 5px;
  background: linear-gradient(90deg, #a855f7, #ec4899);
  border-radius: var(--radius-full);
  margin: 10px auto 6px;
  flex-shrink: 0;
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.6);
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 20px 16px;
  border-bottom: 1.5px solid var(--border-color);
  flex-shrink: 0;
  background: linear-gradient(180deg, rgba(124, 58, 237, 0.1), transparent);
}

.sheet-header h2 {
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--accent-gold);
  text-shadow: 0 0 15px rgba(251, 191, 36, 0.5);
}

.sheet-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(124, 58, 237, 0.3);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-full);
  color: white;
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: inherit;
}

.sheet-close:active {
  background: rgba(239, 68, 68, 0.4);
  transform: scale(0.9);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
}

.sheet-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 20px calc(env(safe-area-inset-bottom, 20px) + 20px);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* Categories List */
.categories-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.category-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, rgba(80, 40, 160, 0.35), rgba(40, 20, 90, 0.45));
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  cursor: pointer;
  transition: all var(--transition-fast);
  backdrop-filter: blur(10px);
}

.category-item:active {
  transform: scale(0.98);
}

.category-item.active {
  border-color: var(--accent-gold);
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(245, 158, 11, 0.1));
  box-shadow: 0 0 25px rgba(251, 191, 36, 0.4);
}

.ci-icon {
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: rgba(124, 58, 237, 0.2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.ci-info {
  flex: 1;
  text-align: right;
}

.ci-name {
  font-size: 0.95rem;
  font-weight: 800;
  margin-bottom: 2px;
}

.ci-desc {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.ci-check {
  color: var(--accent-gold);
  font-size: 1.3rem;
  filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.7));
}

/* Achievements */
.achievements-progress {
  background: linear-gradient(135deg, rgba(80, 40, 160, 0.35), rgba(40, 20, 90, 0.45));
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 16px;
  backdrop-filter: blur(10px);
}

.ap-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.8rem;
  font-weight: 800;
}

.ap-header strong {
  color: var(--accent-gold);
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

.ap-track {
  height: 10px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.ap-fill {
  height: 100%;
  background: linear-gradient(90deg, #fbbf24, #ec4899);
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
  box-shadow: 0 0 15px rgba(251, 191, 36, 0.6);
}

.achievements-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.achievement-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, rgba(80, 40, 160, 0.3), rgba(40, 20, 90, 0.4));
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  backdrop-filter: blur(10px);
}

.achievement-item.unlocked {
  border-color: var(--accent-gold);
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), rgba(245, 158, 11, 0.08));
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.3);
}

.achievement-item.locked {
  opacity: 0.5;
}

.ai-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.ai-info {
  flex: 1;
  text-align: right;
}

.ai-name {
  font-size: 0.9rem;
  font-weight: 800;
  margin-bottom: 2px;
}

.ai-desc {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.ai-reward {
  background: rgba(251, 191, 36, 0.2);
  color: var(--accent-gold);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-weight: 900;
  font-size: 0.7rem;
  border: 1px solid rgba(251, 191, 36, 0.4);
}

.achievement-item.unlocked .ai-reward {
  background: var(--accent-green);
  color: white;
  border-color: var(--accent-green);
}

/* Shop */
.shop-balance {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 12px 20px;
}

.balance-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(245, 158, 11, 0.1));
  border: 1.5px solid rgba(251, 191, 36, 0.4);
  border-radius: var(--radius-md);
  padding: 10px;
  font-weight: 900;
  color: var(--accent-gold);
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.2);
}

.shop-tabs {
  display: flex;
  gap: 6px;
  padding: 0 20px 12px;
  overflow-x: auto;
  scrollbar-width: none;
}

.shop-tabs::-webkit-scrollbar {
  display: none;
}

.shop-tab {
  background: linear-gradient(135deg, rgba(80, 40, 160, 0.4), rgba(40, 20, 90, 0.5));
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 800;
  font-family: inherit;
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.shop-tab.active {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #1a0f2e;
  border-color: #fcd34d;
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.5);
}

/* Shop Grid */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.shop-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(80, 40, 160, 0.35), rgba(40, 20, 90, 0.45));
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 10px;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
  backdrop-filter: blur(10px);
}

.shop-card:active {
  transform: scale(0.97);
}

.shop-card.owned {
  border-color: rgba(16, 185, 129, 0.6);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(5, 150, 105, 0.05));
}

.shop-card.active {
  border-color: var(--accent-gold);
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.12), rgba(245, 158, 11, 0.08));
  box-shadow: 0 0 25px rgba(251, 191, 36, 0.3);
}

.shop-card.locked {
  opacity: 0.5;
}

.sc-icon {
  font-size: 2rem;
  line-height: 1;
  filter: drop-shadow(0 0 10px rgba(168, 85, 247, 0.5));
}

.sc-name {
  font-size: 0.8rem;
  font-weight: 800;
}

.sc-desc {
  font-size: 0.65rem;
  color: var(--text-muted);
  min-height: 28px;
  line-height: 1.3;
}

.sc-price {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #1a0f2e;
  padding: 5px 14px;
  border-radius: var(--radius-sm);
  font-weight: 900;
  font-size: 0.75rem;
  margin-top: auto;
  box-shadow: 0 0 15px rgba(251, 191, 36, 0.4);
}

.shop-card.owned .sc-price {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}

/* Stats */
.stats-overview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}

.so-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, rgba(80, 40, 160, 0.35), rgba(40, 20, 90, 0.45));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 8px;
  backdrop-filter: blur(10px);
}

.so-card.highlight {
  grid-column: span 3;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(236, 72, 153, 0.1));
  border-color: rgba(251, 191, 36, 0.4);
  box-shadow: 0 0 25px rgba(251, 191, 36, 0.2);
}

.so-value {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--accent-gold);
  text-shadow: 0 0 12px rgba(251, 191, 36, 0.5);
}

.so-card.highlight .so-value {
  font-size: 2.2rem;
}

.so-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 700;
}

.section-title {
  font-size: 0.95rem;
  font-weight: 900;
  color: var(--accent-gold);
  margin: 20px 0 12px;
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.4);
}

.category-stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.category-stat-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, rgba(80, 40, 160, 0.3), rgba(40, 20, 90, 0.4));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 12px;
}

.cs-icon {
  font-size: 1.1rem;
}

.cs-info {
  flex: 1;
}

.cs-name {
  font-size: 0.8rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.cs-bar {
  height: 6px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.cs-fill {
  height: 100%;
  background: linear-gradient(90deg, #a855f7, #ec4899);
  border-radius: var(--radius-full);
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.6);
}

.cs-pct {
  color: var(--accent-gold);
  font-weight: 900;
  font-size: 0.8rem;
  min-width: 40px;
  text-align: left;
}

.weekly-chart {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  height: 120px;
  align-items: end;
  padding: 12px;
  background: linear-gradient(135deg, rgba(80, 40, 160, 0.3), rgba(40, 20, 90, 0.4));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.chart-bar {
  background: linear-gradient(180deg, #fbbf24, #ec4899);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  min-height: 4px;
  position: relative;
  transition: height var(--transition-slow);
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.4);
}

.chart-bar-label {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.55rem;
  color: var(--text-muted);
  font-weight: 700;
  white-space: nowrap;
}

/* Settings */
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(135deg, rgba(80, 40, 160, 0.3), rgba(40, 20, 90, 0.4));
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 10px;
  backdrop-filter: blur(10px);
}

.setting-row.danger {
  border-color: rgba(239, 68, 68, 0.4);
}

.setting-info {
  flex: 1;
  text-align: right;
}

.setting-name {
  display: block;
  font-size: 0.9rem;
  font-weight: 800;
  margin-bottom: 2px;
}

.setting-desc {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Toggle Switch */
.toggle {
  position: relative;
  width: 50px;
  height: 30px;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: var(--radius-full);
  transition: transform var(--transition-fast);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.toggle input:checked + .toggle-slider {
  background: linear-gradient(135deg, #a855f7, #ec4899);
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.6);
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

.app-info {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-top: 24px;
  line-height: 1.8;
}

/* Modal */
.modal-content {
  background: linear-gradient(145deg, rgba(76, 29, 149, 0.95), rgba(30, 11, 61, 0.98));
  border: 2px solid var(--border-glow);
  border-radius: var(--radius-xl);
  padding: 28px 24px;
  max-width: 340px;
  width: 100%;
  text-align: center;
  animation: modalPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 
    0 0 60px rgba(124, 58, 237, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

@keyframes modalPop {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-icon {
  font-size: 4rem;
  margin-bottom: 16px;
  animation: wiggle 2s infinite;
  filter: drop-shadow(0 0 20px rgba(251, 191, 36, 0.6));
}

.modal-icon.opened {
  animation: popIn 0.5s ease;
}

.modal-content h2 {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--accent-gold);
  margin-bottom: 8px;
  text-shadow: 0 0 20px rgba(251, 191, 36, 0.5);
}

.modal-content p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.modal-reward {
  background: rgba(251, 191, 36, 0.12);
  border: 2px solid var(--accent-gold);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
  animation: popIn 0.4s ease;
  box-shadow: 0 0 30px rgba(251, 191, 36, 0.4);
}

.reward-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
  filter: drop-shadow(0 0 15px currentColor);
}

.reward-value {
  font-size: 2rem;
  font-weight: 900;
  color: var(--accent-gold);
  text-shadow: 0 0 20px rgba(251, 191, 36, 0.6);
}

.reward-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Level Up Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(15px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.level-up {
  border: 2px solid var(--accent-gold);
  box-shadow: 0 0 80px rgba(251, 191, 36, 0.6);
}

.lum-icon {
  font-size: 4rem;
  animation: rotate 2s linear infinite;
  filter: drop-shadow(0 0 25px rgba(251, 191, 36, 0.8));
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.lum-rank {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--accent-gold);
  margin: 12px 0;
  text-shadow: 0 0 20px rgba(251, 191, 36, 0.6);
}

.lum-text {
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.lum-reward {
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid var(--accent-gold);
  border-radius: var(--radius-md);
  padding: 10px;
  font-weight: 900;
  font-size: 1.1rem;
  color: var(--accent-gold);
  margin-bottom: 16px;
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.3);
}

/* Toast */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: linear-gradient(145deg, rgba(76, 29, 149, 0.95), rgba(30, 11, 61, 0.98));
  backdrop-filter: blur(20px);
  border: 2px solid var(--border-glow);
  border-radius: var(--radius-md);
  padding: 16px 28px;
  font-weight: 800;
  font-size: 0.9rem;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition-normal);
  max-width: 85vw;
  text-align: center;
  box-shadow: var(--shadow-lg), 0 0 40px rgba(124, 58, 237, 0.4);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.toast.success {
  border-color: var(--accent-green);
  box-shadow: 0 0 40px rgba(16, 185, 129, 0.5);
}

.toast.error {
  border-color: var(--accent-red);
  box-shadow: 0 0 40px rgba(239, 68, 68, 0.5);
}

.toast.info {
  border-color: var(--accent-gold);
  box-shadow: 0 0 40px rgba(251, 191, 36, 0.5);
}

/* FX Layer */
.fx-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  overflow: hidden;
}

.feedback-symbol {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  font-size: 6rem;
  font-weight: 900;
  z-index: 51;
  pointer-events: none;
  animation: feedbackAnim 0.8s ease forwards;
}

.feedback-symbol.correct {
  color: var(--accent-green);
  text-shadow: 0 0 40px var(--accent-green), 0 0 80px var(--accent-green);
}

.feedback-symbol.wrong {
  color: var(--accent-red);
  text-shadow: 0 0 40px var(--accent-red), 0 0 80px var(--accent-red);
}

@keyframes feedbackAnim {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
  40% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
  70% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(0.8); opacity: 0; }
}

.fx-particle {
  position: absolute;
  font-size: 1.5rem;
  pointer-events: none;
  animation: particleFall 1.5s ease-out forwards;
}

@keyframes particleFall {
  0% { transform: translate(0, 0) rotate(0); opacity: 1; }
  100% { transform: translate(var(--dx, 0), var(--dy, 100px)) rotate(720deg); opacity: 0; }
}

/* Pulse Animation */
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

/* ============ Responsive ============ */
@media (min-width: 768px) {
  .home-container {
    padding-top: 40px;
  }
  
  .answers-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  
  .answer-btn {
    min-height: 95px;
    font-size: 1.4rem;
  }
  
  .q-text {
    font-size: 1.7rem;
  }
  
  .shop-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-height: 700px) {
  .splash-logo {
    font-size: 4rem;
  }
  
  .splash-title {
    font-size: 2rem;
  }
  
  .play-button {
    padding: 16px 22px;
  }
  
  .play-icon {
    width: 44px;
    height: 44px;
  }
  
  .answer-btn {
    min-height: 70px;
    padding: 12px 14px;
    font-size: 1.15rem;
  }
  
  .q-text {
    font-size: 1.25rem;
    min-height: 55px;
  }
  
  .question-card {
    padding: 28px 18px 20px;
  }
}

@media (max-width: 360px) {
  .stats-grid {
    gap: 6px;
  }
  
  .stat-value {
    font-size: 0.9rem;
  }
  
  .nav-item span {
    font-size: 1.1rem;
  }
  
  .nav-item small {
    font-size: 0.55rem;
  }
  
  .answer-btn {
    font-size: 1.05rem;
    min-height: 70px;
  }
  
  .answer-btn::before {
    width: 36px;
    height: 36px;
    font-size: 0.95rem;
  }
}

/* Scrollbar */
.sheet-body::-webkit-scrollbar,
.home-container::-webkit-scrollbar {
  width: 5px;
}

.sheet-body::-webkit-scrollbar-track,
.home-container::-webkit-scrollbar-track {
  background: transparent;
}

.sheet-body::-webkit-scrollbar-thumb,
.home-container::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #a855f7, #ec4899);
  border-radius: var(--radius-full);
}

/* Prevent text selection */
* {
  -webkit-user-select: none;
  user-select: none;
}

input, textarea {
  -webkit-user-select: text;
  user-select: text;
}

/* دعم تقليل الحركة */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}