﻿/* ═══════════════════════════════════════════
   GAMIFICATION — Streaks, XP, Onboarding,
   Flashcards, Drills, Confetti
   ═══════════════════════════════════════════ */

/* ── Streak Widget ── */
.streak-widget {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px 5px 10px;
  background: var(--surface-card);
  border: 2px solid var(--gold-border);
  border-radius: var(--radius-full);
  font-family: 'Nunito', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: default;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
  box-shadow: var(--shadow-xs);
}

.streak-widget--active {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--gold-faint);
  box-shadow: 0 0 0 4px var(--gold-glow), var(--shadow-sm);
  animation: gentleFloat 3s ease-in-out infinite;
}

.streak-flame {
  font-size: 1.15rem;
  line-height: 1;
  transition: transform 0.2s;
}
.streak-widget--active .streak-flame {
  animation: heartbeat 1.5s ease-in-out infinite;
}

.streak-count {
  font-size: 0.95rem;
  font-weight: 900;
}

/* ── XP Bar ── */
.xp-bar-wrap {
  width: 100%;
  max-width: 480px;
  margin: 0 auto 2rem;
  animation: fadeUp 0.6s ease 0.5s both;
}

.xp-bar-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.xp-bar-meta strong {
  color: var(--brand);
  font-size: 0.85rem;
}

.xp-bar-track {
  height: 14px;
  background: rgba(14, 36, 32, 0.06);
  border: none;
  border-radius: var(--radius-full);
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--brand-light), var(--accent-mint));
  border-radius: var(--radius-full);
  transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  width: 0%;
  position: relative;
}
.xp-bar-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  border-radius: inherit;
  animation: progressShimmer 2s ease infinite;
}

.xp-float {
  position: fixed;
  left: 50%;
  top: 22px;
  z-index: 10060;
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  font-weight: 900;
  color: #7a4a00;
  background: linear-gradient(180deg, #fffdf5 0%, #fff4c7 100%);
  border: 2px solid rgba(245, 158, 11, 0.34);
  border-radius: var(--radius-full);
  padding: 9px 18px 10px;
  opacity: 0;
  transform: translate(-50%, 12px) scale(0.96);
  pointer-events: none;
  transition:
    opacity 0.22s ease,
    transform 0.48s cubic-bezier(0.2, 0.9, 0.25, 1.18);
  box-shadow: 0 12px 32px rgba(122, 74, 0, 0.18), 0 2px 0 rgba(255,255,255,0.8) inset;
}

.xp-float--go {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.xp-float--leaving {
  opacity: 0;
  transform: translate(-50%, -10px) scale(0.98);
  transition-duration: 0.24s;
}

.xp-float-amount {
  font-size: 1.1rem;
  letter-spacing: 0;
}

.xp-float-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: rgba(122, 74, 0, 0.7);
}

/* ── Quick Actions ── */
.quick-actions {
  display: flex;
  gap: 14px;
  width: 100%;
  max-width: 560px;
  margin-bottom: 2rem;
  animation: fadeUp 0.55s ease 0.35s both;
}

.quick-action-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 1.4rem 0.8rem 1.2rem;
  background: var(--surface-card);
  border: 2px solid rgba(124, 92, 252, 0.08);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--text-dark);
  font-family: 'Nunito', sans-serif;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 0 rgba(124, 92, 252, 0.08), var(--shadow-xs);
}

.quick-action-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--surface-tint), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s;
}

.quick-action-btn::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 20%;
  right: 20%;
  height: 3px;
  background: var(--brand);
  border-radius: 3px 3px 0 0;
  opacity: 0;
  transition: opacity 0.3s, left 0.3s, right 0.3s;
}

.quick-action-btn:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 0 rgba(124, 92, 252, 0.1), var(--shadow-md);
  border-color: var(--brand-light);
}
.quick-action-btn:hover::before { opacity: 1; }
.quick-action-btn:hover::after { opacity: 1; left: 10%; right: 10%; }

.quick-action-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 rgba(124, 92, 252, 0.08), var(--shadow-xs);
}

.quick-action-icon {
  font-size: 2rem;
  line-height: 1;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.quick-action-btn:hover .quick-action-icon {
  transform: scale(1.2) rotate(-5deg);
}

.quick-action-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand);
}

.quick-action-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.3;
}

.drill-btn--done {
  opacity: 0.5;
  pointer-events: none;
}
.drill-btn--done .quick-action-label {
  color: var(--text-muted);
}

/* ═══════════════════════════════════════
   ONBOARDING OVERLAY
   ═══════════════════════════════════════ */
.onboarding-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: linear-gradient(160deg, #F8F8FC 0%, #F0EFFE 40%, #FFF5F8 70%, #F8F8FC 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  opacity: 1;
  transition: opacity 0.5s ease;
}
.onboarding-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
}

.onboarding-step {
  display: none;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 520px;
  text-align: center;
  animation: springIn 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.onboarding-step.active { display: flex; }

.onboarding-arabic {
  font-family: 'Amiri', serif;
  font-size: 3.8rem;
  color: var(--brand);
  margin-bottom: 0.5rem;
  line-height: 1;
  animation: bounceIn 0.7s ease 0.1s both;
}

.onboarding-title {
  font-family: 'Nunito', sans-serif;
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 0.8rem;
  line-height: 1.2;
}

.onboarding-sub {
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  color: var(--text-mid);
  line-height: 1.65;
  margin-bottom: 2rem;
  max-width: 420px;
}

/* ── 3D Buttons ── */
.onboarding-btn {
  padding: 0.95rem 2.8rem;
  font-family: 'Nunito', sans-serif;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-light));
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-decoration: none;
  display: inline-block;
  box-shadow: 0 6px 0 var(--brand-dark), 0 10px 28px var(--brand-glow);
  position: relative;
  user-select: none;
  -webkit-user-select: none;
}
.onboarding-btn:hover {
  background: linear-gradient(135deg, var(--brand-dark), var(--brand));
  transform: translateY(-3px);
  box-shadow: 0 9px 0 var(--brand-dark), 0 14px 36px rgba(124, 92, 252, 0.35);
}
.onboarding-btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 var(--brand-dark), 0 4px 12px var(--brand-glow);
}

.onboarding-btn--ghost {
  background: transparent;
  color: var(--brand);
  border: 2px solid var(--brand-light);
  box-shadow: none;
}
.onboarding-btn--ghost:hover {
  background: var(--surface-tint);
  transform: translateY(-3px);
  box-shadow: 0 4px 16px var(--brand-glow);
}
.onboarding-btn--ghost:active {
  transform: translateY(2px);
}

.level-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 420px;
  margin-bottom: 2rem;
}

.level-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 1.1rem 1.2rem;
  background: var(--surface-card);
  border: 2px solid rgba(124, 92, 252, 0.08);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-align: left;
  box-shadow: var(--shadow-xs);
}
.level-card:hover {
  border-color: var(--brand-light);
  background: var(--surface-tint);
  transform: translateX(4px) translateY(-2px);
  box-shadow: var(--shadow-md);
}
.level-card.selected {
  border-color: var(--brand);
  background: var(--surface-tint);
  box-shadow: 0 0 0 4px var(--brand-glow);
}

.level-card-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.level-card-name {
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-dark);
}

.level-card-desc {
  font-family: 'Nunito', sans-serif;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.onboarding-dots {
  display: flex;
  gap: 10px;
  margin-bottom: 2rem;
}
.onboarding-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(14, 36, 32, 0.1);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.onboarding-dot.active {
  background: var(--brand);
  width: 28px;
  border-radius: var(--radius-full);
  box-shadow: 0 0 8px var(--brand-glow);
}

/* ═══════════════════════════════════════
   FLASHCARD REVIEW
   ═══════════════════════════════════════ */
.fc-page {
  min-height: 100vh;
  min-height: 100dvh;
  background: linear-gradient(160deg, #F8F8FC 0%, #F0EFFE 30%, #F8F8FC 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 1rem 4rem;
}

.fc-nav {
  width: 100%;
  max-width: 640px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 0 0;
  margin-bottom: 0.5rem;
}

.fc-back {
  font-family: 'Nunito', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
}
.fc-back:hover {
  color: var(--brand);
  background: var(--surface-tint);
  transform: translateX(-3px);
}

.fc-title {
  font-family: 'Nunito', sans-serif;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
}

.fc-streak-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fc-progress-track {
  width: 100%;
  max-width: 640px;
  height: 10px;
  background: rgba(14, 36, 32, 0.06);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 2rem;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.04);
}
.fc-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--brand-light), var(--accent-mint));
  border-radius: var(--radius-full);
  transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  width: 0%;
}

.fc-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.4rem;
  padding: 5rem 0;
  color: var(--text-muted);
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
}
.fc-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(124, 92, 252, 0.08);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.fc-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  max-width: 480px;
  padding: 2rem 0;
  animation: springIn 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.fc-screen-icon {
  font-size: 4.5rem;
  margin-bottom: 0.8rem;
  line-height: 1;
  animation: bounceIn 0.6s ease 0.15s both;
}
.fc-screen-title {
  font-family: 'Nunito', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 0.6rem;
}
.fc-screen-sub {
  font-family: 'Nunito', sans-serif;
  font-size: 0.95rem;
  color: var(--text-mid);
  line-height: 1.65;
  margin-bottom: 0.5rem;
  max-width: 360px;
}
.fc-screen-xp {
  font-family: 'Nunito', sans-serif;
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--success-dark);
  background: var(--success-bg);
  border: 2px solid var(--success-border);
  border-radius: var(--radius-full);
  padding: 10px 28px;
  margin: 1rem 0 1.8rem;
  letter-spacing: 0.04em;
  box-shadow: 0 4px 12px rgba(74, 222, 128, 0.15);
  animation: springIn 0.5s ease 0.3s both;
}

/* ── 3D Buttons ── */
.fc-btn {
  padding: 0.95rem 2.8rem;
  font-family: 'Nunito', sans-serif;
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-light));
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-decoration: none;
  display: inline-block;
  box-shadow: 0 6px 0 var(--brand-dark), 0 10px 28px var(--brand-glow);
  user-select: none;
  -webkit-user-select: none;
}
.fc-btn:hover {
  background: linear-gradient(135deg, var(--brand-dark), var(--brand));
  transform: translateY(-3px);
  box-shadow: 0 9px 0 var(--brand-dark), 0 14px 36px rgba(124, 92, 252, 0.35);
}
.fc-btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 var(--brand-dark);
}
.fc-btn--ghost {
  background: transparent;
  color: var(--brand);
  border: 2px solid var(--brand-light);
  box-shadow: none;
}
.fc-btn--ghost:hover {
  background: var(--surface-tint);
  transform: translateY(-3px);
  box-shadow: 0 4px 16px var(--brand-glow);
}
.fc-btn--ghost:active {
  transform: translateY(2px);
}
.fc-btn-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

/* ── Review Card (Flashcard) ── */
.review-card-wrap {
  perspective: 1000px;
  width: 100%;
  max-width: 480px;
  min-height: 290px;
  margin-bottom: 1.4rem;
  cursor: pointer;
}

.review-card {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  min-height: 290px;
}
.review-card.flipped { transform: rotateY(180deg); }

.review-card-face {
  position: absolute;
  inset: 0;
  background: var(--surface-card);
  border: 2px solid rgba(124, 92, 252, 0.08);
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow: var(--shadow-md);
  min-height: 290px;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}
.review-card-wrap:hover .review-card-face {
  border-color: var(--brand-light);
  box-shadow: var(--shadow-lg), 0 0 0 4px var(--brand-glow);
}
.review-card-back {
  transform: rotateY(180deg);
}

.review-card-arabic {
  font-family: 'Amiri', serif;
  font-size: clamp(2.8rem, 8vw, 4.2rem);
  font-weight: 700;
  color: var(--text-dark);
  direction: rtl;
  text-align: center;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}
.review-card-type {
  font-family: 'Nunito', sans-serif;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-coral);
  background: rgba(255, 107, 122, 0.08);
  border: 1px solid rgba(255, 107, 122, 0.15);
  border-radius: var(--radius-full);
  padding: 3px 12px;
  margin-bottom: 0.5rem;
}
.review-card-tap {
  font-family: 'Nunito', sans-serif;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 1rem;
  animation: gentleFloat 2.5s ease-in-out infinite;
}
.review-card-meaning {
  font-family: 'Nunito', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-dark);
  text-align: center;
  margin-bottom: 0.4rem;
}
.review-card-trans {
  font-family: 'Nunito', sans-serif;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  margin-bottom: 0.6rem;
}
.review-card-lesson {
  font-family: 'Nunito', sans-serif;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--brand);
  background: var(--surface-tint);
  border: 1.5px solid var(--brand-light);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  margin-top: 0.5rem;
}

.review-rate-btns {
  display: flex;
  gap: 14px;
  width: 100%;
  max-width: 480px;
  animation: fadeUp 0.35s ease both;
}
.review-rate-btn {
  flex: 1;
  padding: 0.95rem;
  font-family: 'Nunito', sans-serif;
  font-size: 0.88rem;
  font-weight: 800;
  border-radius: var(--radius-md);
  border: 2px solid;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
  letter-spacing: 0.03em;
  min-height: 54px;
}
.review-rate-btn:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.review-rate-btn:active { transform: translateY(2px); box-shadow: none; }

.review-rate-btn--know {
  color: var(--success-dark);
  border-color: var(--success-border);
  background: var(--success-bg);
  box-shadow: 0 4px 0 #86EFAC;
}
.review-rate-btn--know:hover {
  background: #bbf7d0;
  border-color: var(--success);
  box-shadow: 0 6px 0 #86EFAC, var(--shadow-md);
}
.review-rate-btn--know:active {
  box-shadow: 0 1px 0 #86EFAC;
}

.review-rate-btn--struggle {
  color: var(--amber-dark);
  border-color: var(--amber-border);
  background: var(--amber-bg);
  box-shadow: 0 4px 0 #FED7AA;
}
.review-rate-btn--struggle:hover {
  background: #fed7aa;
  border-color: var(--amber);
  box-shadow: 0 6px 0 #FED7AA, var(--shadow-md);
}
.review-rate-btn--struggle:active {
  box-shadow: 0 1px 0 #FED7AA;
}

.review-counter {
  font-family: 'Nunito', sans-serif;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  letter-spacing: 0.04em;
}

/* ═══════════════════════════════════════
   DAILY DRILL CARDS
   ═══════════════════════════════════════ */
.drill-card {
  width: 100%;
  max-width: 520px;
  background: var(--surface-card);
  border: 2px solid rgba(124, 92, 252, 0.08);
  border-radius: var(--radius-xl);
  padding: 2.2rem 2rem;
  margin-bottom: 1.4rem;
  animation: springIn 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}
.drill-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--brand), var(--brand-light), var(--accent-mint), var(--accent-coral));
  opacity: 0.85;
}

.drill-mode-pill,
.drill-lesson-tag {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  font-family: 'Nunito', sans-serif;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: var(--radius-full);
}

.drill-mode-pill {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-light));
  border: none;
  padding: 5px 12px;
  margin-bottom: 0.8rem;
  box-shadow: 0 2px 8px var(--brand-glow);
}

.drill-lesson-tag {
  color: var(--success-dark);
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  padding: 4px 10px;
  margin-top: 0.4rem;
}

.drill-prompt-label {
  font-family: 'Nunito', sans-serif;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.8rem;
}

.drill-prompt-arabic {
  font-family: 'Amiri', serif;
  font-size: clamp(2.4rem, 8vw, 3.6rem);
  font-weight: 700;
  color: var(--text-dark);
  direction: rtl;
  text-align: center;
  line-height: 1.3;
  margin-bottom: 0.3rem;
}

.drill-prompt-text {
  font-family: 'Nunito', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-dark);
  text-align: center;
  margin-bottom: 0.3rem;
}

.drill-prompt-sub {
  font-family: 'Nunito', sans-serif;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  font-style: italic;
  margin-bottom: 0.5rem;
}

.drill-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 1.5rem;
}
.drill-options--build {
  gap: 16px;
}

.drill-option {
  width: 100%;
  padding: 0.95rem 1.2rem;
  font-family: 'Nunito', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: left;
  background: var(--surface-bg);
  border: 2px solid rgba(124, 92, 252, 0.07);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 3px 0 rgba(124, 92, 252, 0.06), var(--shadow-xs);
  min-height: 52px;
}
.drill-option:disabled { cursor: default; }
.drill-option:hover:not(:disabled) {
  background: var(--surface-tint);
  border-color: var(--brand-light);
  transform: translateX(6px);
  box-shadow: 0 3px 0 rgba(124, 92, 252, 0.08), var(--shadow-md);
}
.drill-option:active:not(:disabled) {
  transform: translateX(2px) translateY(2px);
  box-shadow: 0 1px 0 rgba(124, 92, 252, 0.06);
}
.drill-option.correct {
  background: var(--success-bg);
  border-color: var(--success);
  color: var(--success-dark);
  font-weight: 700;
  transform: translateX(6px);
  box-shadow: 0 4px 12px rgba(74, 222, 128, 0.2);
}
.drill-option.wrong {
  background: var(--red-bg);
  border-color: var(--red);
  color: var(--red-dark);
  animation: wiggle 0.4s ease;
}
.drill-option-arabic {
  font-family: 'Amiri', serif;
  font-size: 1.4rem;
  direction: rtl;
  flex: 1;
  text-align: right;
}
.drill-option-letter {
  font-family: 'Nunito', sans-serif;
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--text-muted);
  width: 20px;
  flex-shrink: 0;
}

/* ── Tile Build ── */
.build-answer,
.build-tile-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.build-answer {
  min-height: 80px;
  align-items: center;
  justify-content: flex-end;
  direction: rtl;
  background: var(--surface-bg);
  border: 2px dashed rgba(124, 92, 252, 0.15);
  border-radius: var(--radius-md);
  padding: 0.9rem;
  transition: all 0.25s ease;
}
.build-answer.correct {
  border-style: solid;
  border-color: var(--success);
  background: var(--success-bg);
  box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.1);
}
.build-answer.wrong {
  border-style: solid;
  border-color: var(--red);
  background: var(--red-bg);
  animation: wiggle 0.4s ease;
}
.build-placeholder {
  width: 100%;
  text-align: center;
  direction: ltr;
  font-family: 'Nunito', sans-serif;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.build-tile-bank {
  justify-content: center;
  direction: rtl;
}
.build-tile {
  min-height: 52px;
  padding: 0.45rem 0.9rem 0.55rem;
  font-family: 'Amiri', serif;
  font-size: 1.4rem;
  line-height: 1.1;
  color: var(--text-dark);
  background: var(--surface-card);
  border: 2px solid rgba(124, 92, 252, 0.08);
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: 0 5px 0 rgba(124, 92, 252, 0.08);
  transition: all 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.build-tile:hover:not(:disabled) {
  border-color: var(--brand-light);
  transform: translateY(-4px);
  box-shadow: 0 8px 0 rgba(124, 92, 252, 0.1);
}
.build-tile:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 1px 0 rgba(124, 92, 252, 0.06);
}
.build-tile--selected {
  background: var(--surface-tint);
  border-color: var(--brand);
  box-shadow: 0 4px 0 rgba(124, 92, 252, 0.14);
}
.build-tile:disabled { cursor: default; }
.build-feedback {
  min-height: 24px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  text-align: center;
  color: var(--text-muted);
}
.build-feedback.correct { color: var(--success-dark); animation: springIn 0.35s ease; }
.build-feedback.wrong { color: var(--red-dark); animation: wiggle 0.3s ease; }
.build-feedback span {
  display: block;
  margin-top: 4px;
  font-family: 'Amiri', serif;
  font-size: 1.3rem;
  direction: rtl;
  color: var(--text-dark);
}

/* ── Score Pips ── */
.drill-score-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 0.5rem;
}
.drill-score-pip {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(124, 92, 252, 0.08);
  flex-shrink: 0;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.drill-score-pip.correct {
  background: var(--success);
  border-color: var(--success);
  animation: bounceIn 0.35s ease;
  box-shadow: 0 0 6px rgba(74, 222, 128, 0.4);
}
.drill-score-pip.wrong {
  background: var(--red);
  border-color: var(--red);
  animation: wiggle 0.35s ease;
}

/* ═══════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════ */
@media (max-width: 768px) {
  .fc-page { padding-bottom: 0; }
  .review-rate-btns {
    position: sticky;
    bottom: calc(70px + env(safe-area-inset-bottom, 0px));
    background: var(--surface-bg);
    padding: 0.85rem 0;
    z-index: 10;
  }
}

@media (max-width: 480px) {
  .quick-actions { gap: 8px; }
  .quick-action-btn { padding: 0.85rem 0.5rem; min-height: 72px; }
  .quick-action-icon { font-size: 1.6rem; }
  .quick-action-label { font-size: 0.65rem; letter-spacing: 0.04em; }
  .quick-action-sub { display: none; }
  .review-card-wrap { min-height: 240px; }
  .review-card-face { min-height: 240px; padding: 1.8rem; }
  .review-rate-btns { gap: 10px; }
  .review-rate-btn { min-height: 54px; font-size: 0.9rem; border-radius: var(--radius-sm); }
  .drill-card { padding: 1.5rem 1rem; border-radius: var(--radius-lg); }
  .drill-option { font-size: 0.9rem; padding: 0.85rem 1rem; min-height: 54px; border-radius: var(--radius-sm); }
  .level-card { padding: 0.9rem 1rem; min-height: 64px; border-radius: var(--radius-sm); }
  .onboarding-btn { min-height: 54px; font-size: 0.88rem; padding: 0.85rem 2rem; }
  .onboarding-arabic { font-size: 2.8rem; }
  .xp-float {
    top: calc(14px + env(safe-area-inset-top, 0px));
    bottom: auto;
    font-size: 0.92rem;
    padding: 8px 15px 9px;
  }
  .xp-float--go { transform: translate(-50%, 0) scale(1); }
  .xp-float--leaving { transform: translate(-50%, -10px) scale(0.98); }
}
