/* ===== CSS Variables & Reset ===== */
:root {
  --primary: #6c5ce7;
  --primary-light: #a29bfe;
  --primary-dark: #4834d4;
  --secondary: #00cec9;
  --accent: #fd79a8;
  --success: #00b894;
  --danger: #d63031;
  --warning: #fdcb6e;
  --bg-primary: #0a0a1a;
  --bg-secondary: #141428;
  --bg-card: #1e1e3a;
  --bg-card-hover: #2a2a4a;
  --bg-input: #252545;
  --text-primary: #ffffff;
  --text-secondary: #b2b2d0;
  --text-muted: #6c6c8a;
  --border: #2a2a4a;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  --nav-height: 70px;
  --header-height: 60px;
  --font-ar: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
  --font-de: 'Poppins', 'Segoe UI', sans-serif;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
  --bg-primary: #f5f5ff;
  --bg-secondary: #eeeef8;
  --bg-card: #ffffff;
  --bg-card-hover: #f0f0fa;
  --bg-input: #eeeef8;
  --text-primary: #1a1a2e;
  --text-secondary: #4a4a6a;
  --text-muted: #8a8aaa;
  --border: #d5d5e5;
  --shadow: 0 4px 20px rgba(100, 100, 150, 0.15);
  --shadow-lg: 0 8px 40px rgba(100, 100, 150, 0.2);
}

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

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-ar);
  background: var(--bg-primary);
  color: var(--text-primary);
  direction: rtl;
  user-select: none;
  -webkit-user-select: none;
}

.hidden { display: none !important; }

/* ===== Splash Screen ===== */
.splash-screen {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #0a0a1a 0%, #1a1a3e 50%, #2d1b69 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.splash-screen.fade-out {
  opacity: 0;
  transform: scale(1.1);
}

.splash-content {
  text-align: center;
}

.splash-icon {
  font-size: 80px;
  animation: bounce 1s ease infinite;
}

.splash-title {
  font-family: var(--font-de);
  font-size: 36px;
  font-weight: 800;
  background: linear-gradient(135deg, #6c5ce7, #a29bfe, #fd79a8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 16px 0 8px;
}

.splash-subtitle {
  color: var(--text-secondary);
  font-size: 16px;
  margin-bottom: 32px;
}

.splash-loader {
  width: 200px;
  height: 4px;
  background: var(--bg-card);
  border-radius: 2px;
  margin: 0 auto;
  overflow: hidden;
}

.loader-bar {
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 2px;
  animation: loading 1.2s ease-in-out infinite;
}

@keyframes loading {
  0% { transform: translateX(250%); }
  100% { transform: translateX(-100%); }
}

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

/* ===== App Container ===== */
.app {
  height: 100%;
  display: flex;
  flex-direction: column;
  max-width: 500px;
  margin: 0 auto;
  position: relative;
}

.screen {
  display: none;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: var(--nav-height);
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.screen.active {
  display: flex;
}

/* Hide scrollbar */
.screen::-webkit-scrollbar { width: 0; }
.screen { scrollbar-width: none; }

/* ===== Home Header ===== */
.home-header {
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-card));
  padding: 16px 20px;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--border);
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.app-title {
  font-family: var(--font-de);
  font-size: 22px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.streak-badge, .xp-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-card);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 700;
}

.streak-icon, .xp-icon { font-size: 16px; }

.daily-goal-bar {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}

.goal-info {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.goal-track {
  height: 8px;
  background: var(--bg-input);
  border-radius: 4px;
  overflow: hidden;
}

.goal-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 4px;
  transition: width 0.5s ease;
  width: 0%;
}

/* ===== Review Banner ===== */
.review-banner {
  margin: 12px 16px;
  background: linear-gradient(135deg, #2d1b69, #4834d4);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  animation: slideDown 0.4s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

.review-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.review-banner-icon { font-size: 28px; }

.review-banner-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.review-banner-text strong { font-size: 14px; }
.review-banner-text span { font-size: 12px; color: var(--text-secondary); }

.review-banner-btn {
  background: white;
  color: var(--primary-dark);
  border: none;
  padding: 8px 20px;
  border-radius: 20px;
  font-family: var(--font-ar);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}

/* ===== Quick Actions ===== */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 12px 16px;
}

.quick-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 8px;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-primary);
  font-family: var(--font-ar);
}

.quick-action-btn:active {
  transform: scale(0.95);
  background: var(--bg-card-hover);
}

.qa-icon { font-size: 24px; }
.qa-text { font-size: 11px; font-weight: 600; }

/* ===== Courses Section ===== */
.courses-section {
  padding: 8px 16px 20px;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.courses-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.course-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.course-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--primary), var(--accent));
  border-radius: 0 var(--radius) var(--radius) 0;
}

.course-card:active {
  transform: scale(0.98);
  background: var(--bg-card-hover);
}

.course-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.course-icon {
  font-size: 36px;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-input);
  border-radius: 14px;
}

.course-info {
  flex: 1;
}

.course-name {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 2px;
}

.course-name-de {
  font-family: var(--font-de);
  font-size: 13px;
  color: var(--text-muted);
}

.course-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.course-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.course-level-tag {
  background: var(--primary);
  color: white;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-de);
}

.course-progress-info {
  font-size: 12px;
  color: var(--text-muted);
}

.course-card-progress {
  height: 4px;
  background: var(--bg-input);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 10px;
}

.course-card-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 2px;
  transition: width 0.5s ease;
}

/* ===== Course Detail Screen ===== */
.screen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.back-btn {
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.back-btn:active { background: var(--bg-card); }

.screen-title {
  font-size: 18px;
  font-weight: 700;
}

.course-level-badge {
  background: var(--primary);
  color: white;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-de);
}

.course-progress-bar {
  height: 4px;
  background: var(--bg-input);
}

.course-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width 0.5s ease;
}

.levels-list {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.level-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 14px;
}

.level-card:active {
  transform: scale(0.98);
  background: var(--bg-card-hover);
}

.level-card.locked {
  opacity: 0.5;
  pointer-events: none;
}

.level-card.completed {
  border-color: var(--success);
}

.level-icon-wrap {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: var(--bg-input);
  position: relative;
  flex-shrink: 0;
}

.level-icon-wrap.completed {
  background: var(--success);
}

.level-icon-wrap .level-check {
  position: absolute;
  bottom: -2px;
  left: -2px;
  width: 20px;
  height: 20px;
  background: var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  border: 2px solid var(--bg-card);
}

.level-info {
  flex: 1;
}

.level-name {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 2px;
}

.level-name-de {
  font-family: var(--font-de);
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.level-progress-mini {
  display: flex;
  align-items: center;
  gap: 8px;
}

.level-progress-bar {
  flex: 1;
  height: 6px;
  background: var(--bg-input);
  border-radius: 3px;
  overflow: hidden;
}

.level-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 3px;
  transition: width 0.5s ease;
}

.level-progress-text {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.level-word-count {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.level-actions {
  display: flex;
  gap: 6px;
}

.level-action-btn {
  background: var(--bg-input);
  border: none;
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  font-size: 11px;
  font-family: var(--font-ar);
  cursor: pointer;
  transition: var(--transition);
}

.level-action-btn:active {
  background: var(--primary);
  color: white;
}

/* ===== Learn Screen ===== */
.learn-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.learn-progress {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.learn-progress-bar {
  flex: 1;
  height: 8px;
  background: var(--bg-input);
  border-radius: 4px;
  overflow: hidden;
}

.learn-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 4px;
  transition: width 0.4s ease;
}

.learn-progress-text {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  font-family: var(--font-de);
}

.learn-hearts {
  display: flex;
  gap: 2px;
  font-size: 16px;
}

.learn-hearts span.lost { filter: grayscale(1); opacity: 0.3; }

.learn-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Present Card */
.present-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
}

.present-emoji { font-size: 60px; }

.present-word-de {
  font-family: var(--font-de);
  font-size: 36px;
  font-weight: 700;
  color: var(--primary-light);
}

.present-word-ar {
  font-size: 26px;
  font-weight: 600;
  color: var(--text-primary);
}

.present-gender {
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
  padding: 4px 14px;
  background: rgba(253, 121, 168, 0.15);
  border-radius: 12px;
}

.present-gender:empty { display: none; }

.present-example {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-top: 8px;
  width: 100%;
  max-width: 350px;
}

.example-de {
  font-family: var(--font-de);
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  direction: ltr;
  text-align: center;
}

.example-ar {
  font-size: 14px;
  color: var(--text-muted);
}

.speak-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 10px 24px;
  border-radius: 25px;
  font-family: var(--font-ar);
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 8px;
}

.speak-btn:active {
  background: var(--primary);
  border-color: var(--primary);
}

.speak-btn-small {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  padding: 4px;
  transition: var(--transition);
}

.speak-btn-small:active { transform: scale(1.2); }

/* MCQ */
.mcq-prompt {
  text-align: center;
  padding: 20px 0 30px;
}

.mcq-instruction {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.mcq-word {
  font-family: var(--font-de);
  font-size: 32px;
  font-weight: 700;
  color: var(--primary-light);
  direction: ltr;
}

.mcq-word.mcq-word-ar {
  font-family: var(--font-ar);
  direction: rtl;
  color: var(--text-primary);
}

.mcq-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  justify-content: center;
  max-height: 350px;
}

.mcq-option {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  font-family: var(--font-ar);
  font-size: 16px;
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
  text-align: right;
  position: relative;
}

.mcq-option:active { transform: scale(0.98); }

.mcq-option.correct {
  border-color: var(--success);
  background: rgba(0, 184, 148, 0.15);
  animation: correctPop 0.4s ease;
}

.mcq-option.incorrect {
  border-color: var(--danger);
  background: rgba(214, 48, 49, 0.15);
  animation: shake 0.4s ease;
}

.mcq-option.show-correct {
  border-color: var(--success);
  background: rgba(0, 184, 148, 0.1);
}

.mcq-option.disabled { pointer-events: none; }

@keyframes correctPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

/* Typing */
.typing-prompt {
  text-align: center;
  padding: 24px 0;
}

.typing-instruction {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.typing-word-ar {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
}

.typing-input-container {
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.typing-input {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  font-family: var(--font-de);
  font-size: 22px;
  color: var(--text-primary);
  text-align: center;
  direction: ltr;
  outline: none;
  transition: var(--transition);
  width: 100%;
}

.typing-input:focus { border-color: var(--primary); }

.typing-input.correct { border-color: var(--success); background: rgba(0, 184, 148, 0.1); }
.typing-input.incorrect { border-color: var(--danger); background: rgba(214, 48, 49, 0.1); }

.typing-special-chars {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.char-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  width: 42px;
  height: 42px;
  border-radius: var(--radius-xs);
  font-family: var(--font-de);
  font-size: 18px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.char-btn:active {
  background: var(--primary);
  border-color: var(--primary);
}

.typing-feedback {
  text-align: center;
  padding: 12px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  margin-top: 8px;
}

.typing-feedback.correct {
  background: rgba(0, 184, 148, 0.15);
  color: var(--success);
}

.typing-feedback.incorrect {
  background: rgba(214, 48, 49, 0.15);
  color: var(--danger);
}

/* Listening */
.listening-prompt {
  text-align: center;
  padding: 30px 0;
}

.listening-instruction {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.listen-play-btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border: none;
  color: white;
  padding: 20px 40px;
  border-radius: 30px;
  font-family: var(--font-ar);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 auto 12px;
  transition: var(--transition);
}

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

.listen-icon { font-size: 28px; }

.listen-slow-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 8px 20px;
  border-radius: 20px;
  font-family: var(--font-ar);
  font-size: 13px;
  cursor: pointer;
  margin: 0 auto;
  display: block;
}

/* Match Pairs */
.match-instruction {
  text-align: center;
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.match-container {
  display: flex;
  gap: 12px;
  flex: 1;
  max-height: 450px;
}

.match-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.match-item {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 12px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: 15px;
  font-weight: 600;
}

.match-item.de-item {
  font-family: var(--font-de);
  direction: ltr;
}

.match-item.selected {
  border-color: var(--primary);
  background: rgba(108, 92, 231, 0.15);
}

.match-item.matched {
  border-color: var(--success);
  background: rgba(0, 184, 148, 0.15);
  pointer-events: none;
  opacity: 0.7;
}

.match-item.wrong {
  border-color: var(--danger);
  background: rgba(214, 48, 49, 0.15);
  animation: shake 0.4s ease;
}

/* ===== Speed Review ===== */
.speed-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.speed-timer {
  flex: 1;
  height: 8px;
  background: var(--bg-input);
  border-radius: 4px;
  overflow: hidden;
}

.speed-timer-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--success), var(--warning), var(--danger));
  border-radius: 4px;
  transition: width 0.1s linear;
  width: 100%;
}

.speed-score {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 18px;
  font-weight: 800;
  font-family: var(--font-de);
  color: var(--warning);
}

.speed-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.speed-word {
  font-family: var(--font-de);
  font-size: 34px;
  font-weight: 700;
  color: var(--primary-light);
  margin-bottom: 40px;
  text-align: center;
  direction: ltr;
}

.speed-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
  max-width: 400px;
}

.speed-option {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 14px;
  font-family: var(--font-ar);
  font-size: 16px;
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  font-weight: 600;
}

.speed-option:active { transform: scale(0.95); }
.speed-option.correct { border-color: var(--success); background: rgba(0, 184, 148, 0.2); }
.speed-option.incorrect { border-color: var(--danger); background: rgba(214, 48, 49, 0.2); }

/* ===== Results Screen ===== */
.results-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px 20px;
  text-align: center;
  overflow-y: auto;
}

.results-icon {
  font-size: 64px;
  animation: bounce 1s ease 2;
}

.results-title {
  font-size: 28px;
  font-weight: 800;
  margin: 12px 0 4px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.results-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 24px;
}

.results-stats {
  display: flex;
  gap: 20px;
  margin-bottom: 24px;
}

.result-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.result-stat-value {
  font-size: 28px;
  font-weight: 800;
  font-family: var(--font-de);
}

.result-stat-label {
  font-size: 12px;
  color: var(--text-muted);
}

.results-accuracy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
}

.accuracy-ring {
  position: relative;
  width: 100px;
  height: 100px;
}

.accuracy-ring svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.accuracy-bg {
  fill: none;
  stroke: var(--bg-input);
  stroke-width: 8;
}

.accuracy-fill {
  fill: none;
  stroke: var(--success);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 327;
  stroke-dashoffset: 327;
  transition: stroke-dashoffset 1s ease;
}

.accuracy-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 22px;
  font-weight: 800;
  font-family: var(--font-de);
}

.accuracy-label {
  font-size: 13px;
  color: var(--text-muted);
}

.results-words-list {
  width: 100%;
  max-width: 400px;
  margin-bottom: 24px;
}

.result-word-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-card);
  border-radius: var(--radius-xs);
  margin-bottom: 6px;
}

.result-word-de {
  font-family: var(--font-de);
  font-size: 14px;
  font-weight: 600;
  direction: ltr;
}

.result-word-ar {
  font-size: 14px;
  color: var(--text-secondary);
}

.result-word-status {
  font-size: 16px;
}

.results-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 300px;
}

/* ===== Stats Screen ===== */
.stats-container {
  padding: 16px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.stat-icon { font-size: 28px; }

.stat-value {
  font-size: 26px;
  font-weight: 800;
  font-family: var(--font-de);
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
}

.stats-section {
  margin-bottom: 24px;
}

.stats-section h3 {
  font-size: 16px;
  margin-bottom: 12px;
}

.heatmap {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.heatmap-cell {
  aspect-ratio: 1;
  border-radius: 4px;
  background: var(--bg-card);
}

.heatmap-cell.level-1 { background: rgba(108, 92, 231, 0.2); }
.heatmap-cell.level-2 { background: rgba(108, 92, 231, 0.4); }
.heatmap-cell.level-3 { background: rgba(108, 92, 231, 0.6); }
.heatmap-cell.level-4 { background: rgba(108, 92, 231, 0.8); }

.stats-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ===== Settings Screen ===== */
.settings-container {
  padding: 16px;
}

.setting-group {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

.setting-group h3 {
  font-size: 15px;
  margin-bottom: 12px;
  color: var(--text-secondary);
}

.setting-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.setting-opt {
  background: var(--bg-input);
  border: 2px solid transparent;
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: 20px;
  font-family: var(--font-ar);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
}

.setting-opt.active {
  border-color: var(--primary);
  color: var(--primary-light);
  background: rgba(108, 92, 231, 0.15);
}

.setting-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 14px;
}

.toggle {
  position: relative;
  width: 50px;
  height: 28px;
}

.toggle input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bg-input);
  border-radius: 14px;
  cursor: pointer;
  transition: var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: white;
  top: 3px;
  right: 3px;
  transition: var(--transition);
}

.toggle input:checked + .toggle-slider {
  background: var(--primary);
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(-22px);
}

input[type="range"] {
  width: 120px;
  accent-color: var(--primary);
}

/* ===== Buttons ===== */
.primary-btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border: none;
  padding: 16px 32px;
  border-radius: 14px;
  font-family: var(--font-ar);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
}

.primary-btn:active { transform: scale(0.97); opacity: 0.9; }

.secondary-btn {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
  padding: 14px 32px;
  border-radius: 14px;
  font-family: var(--font-ar);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
}

.secondary-btn:active { background: var(--bg-card-hover); }

.danger-btn {
  background: rgba(214, 48, 49, 0.15);
  color: var(--danger);
  border: 1px solid var(--danger);
  padding: 14px 32px;
  border-radius: 14px;
  font-family: var(--font-ar);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
}

.danger-btn:active { opacity: 0.8; }

/* ===== Bottom Navigation ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 500px;
  height: var(--nav-height);
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-ar);
  cursor: pointer;
  padding: 8px 16px;
  transition: var(--transition);
}

.nav-item.active { color: var(--primary-light); }
.nav-icon { font-size: 22px; }
.nav-label { font-size: 11px; font-weight: 600; }

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: calc(var(--nav-height) + 20px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 12px 24px;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  animation: toastIn 0.3s ease;
  border: 1px solid var(--border);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ===== Confetti ===== */
#confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 300;
}

/* ===== Responsive ===== */
@media (min-width: 501px) {
  .app {
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
  }
}

@media (max-width: 360px) {
  .quick-actions { grid-template-columns: repeat(2, 1fr); }
  .present-word-de { font-size: 28px; }
  .mcq-word { font-size: 26px; }
  .speed-word { font-size: 28px; }
}

/* ===== Animation Utilities ===== */
.animate-pop {
  animation: pop 0.3s ease;
}

@keyframes pop {
  0% { transform: scale(0.8); opacity: 0; }
  70% { transform: scale(1.05); }
  100% { transform: scale(1); opacity: 1; }
}

.animate-slide-up {
  animation: slideUp 0.4s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
