/* =========================================================================
   Road Exam — Interactive Flashcards & Community Solutions ("کد و راه")
   BluBank-inspired 3D Card Physics, Bottom Sheet Drawer, Gamification
   ========================================================================= */

.fc-wrap {
  max-width: 1000px;
  margin: 0 auto;
  padding: 1rem 1rem 3.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  overscroll-behavior-x: contain;
}

/* Gamification & Header Stats Bar */
.fc-stats-bar {
  width: 100%;
  max-width: 760px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.25rem 0.55rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.35rem;
  box-shadow: var(--shadow-1);
  margin-bottom: 0.75rem;
}

.fc-stats-group {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.fc-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--fg);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  user-select: none;
}

.fc-stat-pill svg {
  width: 12px;
  height: 12px;
}

.fc-stats-bar .btn {
  font-size: 0.7rem;
  padding: 0.18rem 0.5rem;
  height: auto;
  border-radius: 999px;
}

.fc-stat-pill:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}

.fc-stat-pill.xp {
  background: color-mix(in oklch, #f59e0b 12%, transparent);
  border-color: color-mix(in oklch, #f59e0b 35%, transparent);
  color: #b45309;
}
:root[data-theme="dark"] .fc-stat-pill.xp {
  color: #fbbf24;
}

.fc-stat-pill.coin {
  background: color-mix(in oklch, #10b981 12%, transparent);
  border-color: color-mix(in oklch, #10b981 35%, transparent);
  color: #047857;
}
:root[data-theme="dark"] .fc-stat-pill.coin {
  color: #34d399;
}

.fc-stat-pill.level {
  background: color-mix(in oklch, var(--accent) 12%, transparent);
  border-color: color-mix(in oklch, var(--accent) 30%, transparent);
  color: var(--accent);
}

/* Category Filter Bar */
.fc-cats {
  width: 100%;
  max-width: 760px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.75rem;
  margin-bottom: 1.5rem;
  scrollbar-width: thin;
}

.fc-cat-btn {
  padding: 0.4rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fc-cat-btn:hover {
  color: var(--fg);
  border-color: var(--accent);
}

.fc-cat-btn.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  box-shadow: 0 2px 8px color-mix(in oklch, var(--accent) 35%, transparent);
}

/* 3D Card Stage */
.fc-stage {
  perspective: 1200px;
  width: 100%;
  max-width: 440px;
  min-height: 540px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  touch-action: none !important;
  overscroll-behavior-x: none !important;
  overscroll-behavior: contain !important;
  user-select: none;
  margin-bottom: 1.5rem;
}

/* Stack backdrop shadows (gives 3D card stack appearance) */
.fc-stack-layer {
  position: absolute;
  width: 92%;
  height: 96%;
  border-radius: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  opacity: 0.6;
  transform: translateY(12px) scale(0.96);
  z-index: 1;
  pointer-events: none;
  transition: transform 0.3s ease, opacity 0.3s ease;
  box-shadow: var(--shadow-2);
}

.fc-stack-layer-2 {
  position: absolute;
  width: 84%;
  height: 92%;
  border-radius: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  opacity: 0.3;
  transform: translateY(22px) scale(0.92);
  z-index: 0;
  pointer-events: none;
}

/* BluBank-Style Card Container */
.fc-card {
  width: 100%;
  height: 520px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.65s cubic-bezier(0.34, 1.45, 0.64, 1);
  cursor: pointer;
  z-index: 2;
  touch-action: none !important;
  overscroll-behavior-x: none !important;
  overscroll-behavior: contain !important;
  user-select: none;
  -webkit-user-select: none;
}

.fc-card.flipped {
  transform: rotateY(180deg);
}

/* Card Faces */
.fc-card-face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 28px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  padding: 1.75rem 1.75rem 1.25rem;
  box-sizing: border-box;
  overflow: hidden;
  box-shadow: 0 16px 36px -10px rgba(15, 27, 51, 0.22), 0 0 0 1px rgba(255, 255, 255, 0.12) inset;
}

/* Front Face: BluBank Royal Gradient Style */
.fc-card-front {
  background: linear-gradient(138deg, #1e3a8a 0%, #2563eb 45%, #06b6d4 100%);
  color: #ffffff;
}

:root[data-theme="dark"] .fc-card-front {
  background: linear-gradient(138deg, #0f172a 0%, #1e3a8a 50%, #0284c7 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

/* Back Face: Sleek Dark / Contrast Flip Side */
.fc-card-back {
  background: linear-gradient(138deg, #0f172a 0%, #1e293b 60%, #334155 100%);
  color: #ffffff;
  transform: rotateY(180deg);
}

:root[data-theme="dark"] .fc-card-back {
  background: linear-gradient(138deg, #0a0f1d 0%, #111827 60%, #1f2937 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

/* BluBank Card Holographic & Texture Overlays */
.fc-card-shine {
  position: absolute;
  inset: 0;
  border-radius: 28px;
  background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.28) 0%, transparent 60%);
  pointer-events: none;
  mix-blend-mode: overlay;
}

.fc-card-pattern {
  position: absolute;
  inset: 0;
  border-radius: 28px;
  background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 16px 16px;
  pointer-events: none;
}

/* Card Header (Chip, Contactless & Branding) */
.fc-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  position: relative;
  z-index: 2;
}

.fc-chip-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Realistic Gold Chip (BluBank style) */
.fc-chip {
  width: 44px;
  height: 32px;
  background: linear-gradient(135deg, #fbbf24 0%, #d97706 60%, #b45309 100%);
  border-radius: 6px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}

.fc-chip::before {
  content: '';
  position: absolute;
  inset: 6px 8px;
  border: 1px solid rgba(0, 0, 0, 0.25);
  border-radius: 3px;
}

.fc-chip::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(0, 0, 0, 0.25);
}

/* Contactless Wave Icon */
.fc-contactless {
  display: inline-flex;
  opacity: 0.85;
}

.fc-card-brand {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  opacity: 0.9;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Card Metadata / Category Tag */
.fc-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  position: relative;
  z-index: 2;
}

.fc-cat-badge {
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.fc-seq-badge {
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0.85;
  font-family: var(--font-mono);
}

/* Card Body / Content Area */
.fc-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  z-index: 2;
  overflow-y: auto;
  padding: 0.5rem 0;
  scrollbar-width: thin;
}

.fc-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  line-height: 1.5;
  color: #ffffff;
}

.fc-card-text {
  font-size: 1rem;
  line-height: 1.8;
  opacity: 0.95;
  margin: 0;
  white-space: pre-line;
}

/* Back Answer Callout */
.fc-answer-callout {
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  margin-top: 0.75rem;
}

.fc-callout-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: #38bdf8;
  margin-bottom: 0.4rem;
}

/* Bottom Hint & Flip Action Prompt */
.fc-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 0.75rem;
  position: relative;
  z-index: 2;
}

.fc-flip-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.825rem;
  opacity: 0.85;
  transition: opacity 0.2s ease;
}

.fc-card:hover .fc-flip-hint {
  opacity: 1;
}

.fc-solutions-counter {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.15);
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  border: none;
  transition: transform 0.2s ease, background 0.2s ease;
}

.fc-solutions-counter:hover {
  transform: scale(1.04);
  background: rgba(255, 255, 255, 0.25);
}

/* Floating Pull-Up Drawer Button (Swipe Up Indicator) */
.fc-pullup-trigger {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--fg);
  border-radius: var(--radius-lg);
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-1);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  margin-bottom: 1.25rem;
}

.fc-pullup-trigger:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow-2);
}

.fc-pullup-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  animation: bounceUp 1.6s infinite;
}

@keyframes bounceUp {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* Card Controls Bar (Previous, Flip, Next, Randomize) */
.fc-controls {
  width: 100%;
  max-width: 440px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.fc-ctrl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--fg);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-1);
}

.fc-ctrl-btn:hover:not(:disabled) {
  background: var(--fg-soft);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.fc-ctrl-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.fc-ctrl-btn.primary {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}
.fc-ctrl-btn.primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

/* Progress Indicator */
.fc-progress-wrap {
  width: 100%;
  max-width: 440px;
  margin-bottom: 1rem;
}

.fc-progress-bar {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.fc-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, #06b6d4 100%);
  border-radius: 999px;
  transition: width 0.3s ease;
}

/* =========================================================================
   Bottom Sheet Drawer ("کد و راه" - Community Solutions)
   ========================================================================= */
.fc-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 27, 51, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.fc-drawer-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.fc-drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 720px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -12px 40px rgba(15, 27, 51, 0.25);
  z-index: 1001;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.fc-drawer.active {
  transform: translateY(0);
}

.fc-drawer-handle-bar {
  padding: 10px 0 6px;
  display: flex;
  justify-content: center;
  cursor: grab;
}

.fc-drawer-handle {
  width: 44px;
  height: 5px;
  background: var(--border);
  border-radius: 999px;
}

.fc-drawer-head {
  padding: 0.75rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fc-drawer-title-group h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.fc-drawer-title-group p {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0.25rem 0 0;
}

.fc-drawer-close {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fc-drawer-close:hover {
  color: var(--fg);
  border-color: var(--fg);
}

.fc-drawer-content {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  flex: 1;
}

/* Educational Concept Banner */
.fc-concept-banner {
  background: color-mix(in oklch, var(--accent) 8%, var(--surface));
  border: 1px solid color-mix(in oklch, var(--accent) 25%, transparent);
  border-radius: var(--radius);
  padding: 0.9rem 1.15rem;
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
  line-height: 1.6;
}

.fc-concept-banner strong {
  color: var(--accent);
  display: block;
  margin-bottom: 0.25rem;
}

/* Gamification Incentive Box */
.fc-xp-incentive {
  background: color-mix(in oklch, #f59e0b 10%, var(--surface));
  border: 1px solid color-mix(in oklch, #f59e0b 30%, transparent);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  color: var(--fg);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

/* Solution Card */
.fc-solution-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-1);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.fc-solution-card:hover {
  border-color: color-mix(in oklch, var(--accent) 40%, transparent);
  transform: translateY(-1px);
}

.fc-sol-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.fc-sol-author {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.fc-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.fc-author-info {
  display: flex;
  flex-direction: column;
}

.fc-author-name {
  font-size: 0.875rem;
  font-weight: 700;
}

.fc-sol-date {
  font-size: 0.75rem;
  color: var(--muted);
}

/* Like / Upvote Button */
.fc-like-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.fc-like-btn:hover {
  border-color: #ef4444;
  color: #ef4444;
}

.fc-like-btn.liked {
  background: color-mix(in oklch, #ef4444 14%, transparent);
  border-color: #ef4444;
  color: #ef4444;
}

.fc-like-btn.liked svg {
  fill: #ef4444;
  transform: scale(1.15);
}

/* Solution Code Pill */
.fc-sol-code {
  background: var(--bg);
  border-right: 4px solid var(--accent);
  padding: 0.65rem 1rem;
  border-radius: 4px var(--radius) var(--radius) 4px;
  font-weight: 700;
  font-size: 1rem;
  color: var(--accent);
  margin-bottom: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fc-sol-exp {
  font-size: 0.925rem;
  line-height: 1.7;
  color: var(--fg);
  margin: 0;
}

/* Submission Form */
.fc-form-section {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-top: 1.5rem;
}

.fc-form-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fc-form-group {
  margin-bottom: 1rem;
}

.fc-form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--fg);
}

.fc-input, .fc-textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--fg);
  font-family: inherit;
  font-size: 0.9rem;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.fc-input:focus, .fc-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.fc-textarea {
  resize: vertical;
  min-height: 80px;
}

/* Demo Approval Toggle */
.fc-demo-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 0.85rem;
  margin-bottom: 1rem;
  font-size: 0.825rem;
  color: var(--muted);
}

/* Rewards Modal */
.fc-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 27, 51, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

.fc-modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.fc-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  width: 100%;
  max-width: 480px;
  padding: 1.75rem;
  box-shadow: var(--shadow-modal);
  transform: scale(0.95);
  transition: transform 0.25s ease;
}

.fc-modal-backdrop.active .fc-modal {
  transform: scale(1);
}

/* Floating XP Toast */
.fc-xp-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  padding: 0.65rem 1.25rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.35);
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.fc-xp-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Empty State */
.fc-empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--muted);
}
.fc-empty-state svg {
  margin-bottom: 0.75rem;
  opacity: 0.5;
}

/* =========================================================================
   Mobile First & Responsive Layout Enhancements (Smartphones & Small Tablets)
   ========================================================================= */

@media (max-width: 640px) {
  .fc-wrap {
    padding: 0.5rem 0.5rem 2.5rem;
    width: 100%;
    box-sizing: border-box;
  }

  /* Stats Bar on Mobile */
  .fc-stats-bar {
    padding: 0.25rem 0.45rem;
    margin-bottom: 0.6rem;
    border-radius: 12px;
    gap: 0.35rem;
  }

  .fc-stats-group {
    gap: 0.25rem;
  }

  .fc-stat-pill {
    padding: 0.15rem 0.42rem;
    font-size: 0.7rem;
    gap: 0.22rem;
  }

  .fc-stat-pill svg {
    width: 11px;
    height: 11px;
  }

  .fc-stats-bar .btn {
    font-size: 0.68rem;
    padding: 0.15rem 0.42rem;
  }

  /* Horizontal Scrolling Category Pills Carousel */
  .fc-cats {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    gap: 0.45rem;
    padding-bottom: 0.4rem;
    margin-bottom: 0.85rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .fc-cats::-webkit-scrollbar {
    display: none;
  }

  .fc-cat-btn {
    flex: 0 0 auto;
    scroll-snap-align: start;
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
  }

  /* 3D Stage & Card on Mobile */
  .fc-stage {
    min-height: 400px;
    margin-bottom: 0.85rem;
  }

  .fc-card {
    height: clamp(380px, 56vh, 450px);
    border-radius: 22px;
  }

  .fc-stack-layer {
    border-radius: 22px;
    transform: translateY(8px) scale(0.97);
  }

  .fc-stack-layer-2 {
    border-radius: 22px;
    transform: translateY(16px) scale(0.94);
  }

  /* Card Face & Layout on Mobile */
  .fc-card-face {
    padding: 1.15rem 1.1rem 0.95rem;
    border-radius: 22px;
  }

  .fc-card-head {
    margin-bottom: 0.75rem;
  }

  .fc-chip {
    width: 36px;
    height: 25px;
    border-radius: 5px;
  }

  .fc-card-brand {
    font-size: 0.78rem;
  }

  .fc-meta-row {
    margin-bottom: 0.6rem;
  }

  .fc-cat-badge {
    padding: 0.2rem 0.6rem;
    font-size: 0.76rem;
  }

  .fc-seq-badge {
    font-size: 0.8rem;
  }

  .fc-card-body {
    padding: 0.25rem 0;
  }

  .fc-card-title {
    font-size: 1.05rem;
    line-height: 1.55;
    margin-bottom: 0.45rem;
  }

  .fc-card-text {
    font-size: 0.9rem;
    line-height: 1.7;
  }

  /* Back Answer Callout */
  .fc-answer-callout {
    padding: 0.75rem 0.85rem;
    margin-top: 0.5rem;
    border-radius: 12px;
  }

  .fc-callout-title {
    font-size: 0.8rem;
    margin-bottom: 0.3rem;
  }

  .fc-card-foot {
    padding-top: 0.5rem;
  }

  .fc-flip-hint {
    font-size: 0.76rem;
  }

  .fc-solutions-counter {
    font-size: 0.76rem;
    padding: 0.25rem 0.55rem;
  }

  /* "کد و راه" Action Trigger Bar on Mobile */
  .fc-pullup-trigger {
    padding: 0.75rem 1rem;
    border-radius: 16px;
    margin-bottom: 0.85rem;
    font-size: 0.88rem;
    background: var(--surface);
    border: 1.5px solid color-mix(in oklch, var(--accent) 35%, var(--border));
    box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.06);
  }

  .fc-pullup-icon {
    width: 28px;
    height: 28px;
    font-size: 0.9rem;
  }

  /* Navigation Controls on Mobile */
  .fc-controls {
    margin-bottom: 1rem;
    gap: 0.5rem;
  }

  .fc-ctrl-btn {
    padding: 0.6rem 0.85rem;
    font-size: 0.88rem;
    min-height: 44px;
    border-radius: 12px;
  }

  .fc-ctrl-btn.primary {
    flex: 1.2;
  }

  /* Bottom Sheet Drawer on Mobile */
  .fc-drawer {
    border-radius: 22px 22px 0 0;
    max-height: 88vh;
  }

  .fc-drawer-handle-bar {
    padding: 8px 0 4px;
  }

  .fc-drawer-handle {
    width: 40px;
    height: 4px;
  }

  .fc-drawer-head {
    padding: 0.65rem 1rem 0.75rem;
  }

  .fc-drawer-title-group h3 {
    font-size: 1.08rem;
  }

  .fc-drawer-content {
    padding: 1rem;
  }

  .fc-sol-code {
    font-size: 0.92rem;
    padding: 0.5rem 0.75rem;
  }

  .fc-sol-exp {
    font-size: 0.86rem;
    line-height: 1.6;
  }

  .fc-form-section {
    padding: 1rem;
    border-radius: 14px;
  }

  .fc-modal {
    padding: 1.25rem;
    border-radius: 18px;
  }
}

/* Leitner Box Spaced Repetition UI */
.fc-leitner-rating-box {
  margin-top: 0.75rem;
  padding: 0.65rem;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.fc-leitner-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #94a3b8;
  margin-bottom: 0.45rem;
  text-align: center;
}
.fc-leitner-btn-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
}
.fc-leitner-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.2rem;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
  user-select: none;
}
.fc-leitner-btn.again {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}
.fc-leitner-btn.again:hover {
  background: rgba(239, 68, 68, 0.35);
  transform: translateY(-1px);
}
.fc-leitner-btn.hard {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fde68a;
}
.fc-leitner-btn.hard:hover {
  background: rgba(245, 158, 11, 0.35);
  transform: translateY(-1px);
}
.fc-leitner-btn.good {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}
.fc-leitner-btn.good:hover {
  background: rgba(16, 185, 129, 0.35);
  transform: translateY(-1px);
}
.fc-leitner-btn .fc-leitner-ic {
  font-size: 1rem;
  line-height: 1;
  margin-bottom: 2px;
}
.fc-leitner-btn .fc-leitner-lbl {
  font-size: 0.78rem;
  font-weight: 700;
}
.fc-leitner-btn .fc-leitner-sub {
  font-size: 0.62rem;
  opacity: 0.85;
  margin-top: 1px;
}
.fc-box-pill {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #e2e8f0;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.fc-due-pill {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  animation: fcPulse 2s infinite;
}
@keyframes fcPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.65; }
}
