/* FX CONNECT CSS v4 - 2026 */
/* fxconnect.css - FX CONNECT
   Namespace: .fxc-root (zero bleed)
   Visual DNA: mirrors LingoSync exactly, purple instead of blue
*/

/* BASE */
.fxc-root {
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  color: #0f172a;
  padding: 24px;
  background: #f8fafc;
  min-height: 100%;
  box-sizing: border-box;
}

.fxc-root * {
  box-sizing: border-box;
}

/* ANIMATIONS - mirrors lsSlideUp / lsPulsePlay */
@keyframes fxcSlideUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fxcShake {

  0%,
  100% {
    transform: translateX(0);
  }

  20%,
  60% {
    transform: translateX(-5px);
  }

  40%,
  80% {
    transform: translateX(5px);
  }
}

@keyframes fxcPulsePurple {
  0% {
    box-shadow: 0 0 0 0 rgba(124, 58, 237, 0.6);
  }

  70% {
    box-shadow: 0 0 0 16px rgba(124, 58, 237, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(124, 58, 237, 0);
  }
}

@keyframes fxcFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fxc-root .fxc-animate-slide {
  animation: fxcSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.fxc-root .fxc-animate-in {
  animation: fxcSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Stagger items - mirrors ls-stagger-item */
.fxc-root .fxc-stagger-item {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.fxc-root .fxc-stagger-item.fxc-visible {
  opacity: 1;
  transform: translateY(0);
}

/* HERO - mirrors ls-hero exactly, purple instead of blue */
.fxc-root .fxc-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  padding: 32px 40px;
  background: linear-gradient(135deg, #f5f3ff 0%, #ffffff 100%);
  border: 1px solid #ede9fe;
  border-radius: 16px;
  box-shadow: 0 20px 40px -12px rgba(124, 58, 237, 0.08);
}

.fxc-root .fxc-eyebrow {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #7c3aed;
  font-weight: 800;
  margin-bottom: 8px;
}

.fxc-root .fxc-title {
  margin: 0;
  font-size: 38px;
  font-weight: 900;
  letter-spacing: -0.03em;
  background: linear-gradient(to right, #4c1d95, #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.fxc-root .fxc-subtitle {
  margin-top: 8px;
  color: #64748b;
  font-size: 16px;
  font-weight: 500;
}

/* LAYOUT - mirrors ls-layout */
.fxc-root .fxc-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 32px;
}

.fxc-root .fxc-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.fxc-root .fxc-main {
  min-width: 0;
}

/* BLOCK - mirrors ls-block */
.fxc-root .fxc-block {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px);
  border: 1px solid #e2e8f0;
  border-radius: 24px;
  padding: 24px;
}

.fxc-root .fxc-block-title {
  font-weight: 800;
  font-size: 13px;
  color: #475569;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* GROUP LIST - mirrors ls-unit-list / ls-verb-list */
.fxc-root .fxc-group-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fxc-root .fxc-group-btn {
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: #ffffff;
  border-radius: 16px;
  padding: 14px 18px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-weight: 700;
  color: #1e293b;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.02);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.fxc-root .fxc-group-btn small {
  color: #94a3b8;
  font-weight: 500;
  font-size: 11px;
}

.fxc-root .fxc-group-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  border-color: #cbd5e1;
}

.fxc-root .fxc-group-btn.is-active {
  background: linear-gradient(135deg, #6d28d9, #7c3aed);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 10px 24px rgba(124, 58, 237, 0.25);
}

.fxc-root .fxc-group-btn.is-active small {
  color: #ddd6fe;
}

/* PACK LIST - mirrors ls-verb-list */
.fxc-root .fxc-pack-heading {
  font-weight: 800;
  font-size: 13px;
  color: #475569;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.fxc-root .fxc-pack-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fxc-root .fxc-pack-btn {
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: #ffffff;
  border-radius: 16px;
  padding: 14px 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.02);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.fxc-root .fxc-pack-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  border-color: #cbd5e1;
}

.fxc-root .fxc-pack-btn.is-done {
  background: linear-gradient(135deg, #6d28d9, #7c3aed);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 10px 24px rgba(124, 58, 237, 0.2);
}

.fxc-root .fxc-pack-btn-num {
  font-size: 12px;
  font-weight: 900;
  color: #a78bfa;
  min-width: 28px;
}

.fxc-root .fxc-pack-btn.is-done .fxc-pack-btn-num {
  color: #ddd6fe;
}

.fxc-root .fxc-pack-btn-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.fxc-root .fxc-pack-btn-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}

.fxc-root .fxc-pack-btn.is-done .fxc-pack-btn-title {
  color: #ffffff;
}

.fxc-root .fxc-pack-btn-body small {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 500;
}

.fxc-root .fxc-pack-btn.is-done .fxc-pack-btn-body small {
  color: #ddd6fe;
}

.fxc-root .fxc-pack-btn-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.fxc-root .fxc-done-check {
  font-size: 11px;
  font-weight: 800;
  color: #ffffff;
}

.fxc-root .fxc-diff {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 6px;
}

.fxc-root .fxc-diff-easy {
  background: #dcfce7;
  color: #15803d;
}

.fxc-root .fxc-diff-medium {
  background: #fef9c3;
  color: #92400e;
}

.fxc-root .fxc-diff-hard {
  background: #fee2e2;
  color: #b91c1c;
}

/* WELCOME PANEL */
.fxc-root .fxc-welcome-panel {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 24px;
  padding: 64px 32px;
  text-align: center;
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.03);
}

.fxc-root .fxc-welcome-fx {
  font-size: 48px;
  font-weight: 900;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, #c4b5fd, #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 16px;
}

.fxc-root .fxc-welcome-title {
  font-size: 18px;
  font-weight: 700;
  color: #475569;
  margin-bottom: 6px;
}

.fxc-root .fxc-welcome-sub {
  font-size: 14px;
  color: #94a3b8;
}

/* PACK TOPBAR - mirrors ls-controls-wrapper pill */
.fxc-root .fxc-pack-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 10px 12px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 999px;
  margin-bottom: 24px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  position: sticky;
  top: 8px;
  z-index: 100;
}

/* Right-side controls group: play + eye */
.fxc-root .fxc-topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

/* Spacer so stage-nav and content don't hide under fixed bar on mobile */
.fxc-root .fxc-topbar-spacer {
  display: none;
}

/* BIG PLAY/PAUSE BUTTON  purple idle, dark when playing, pulse ONLY when playing */
.fxc-root .fxc-player-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #7c3aed, #5b21b6);
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(124, 58, 237, 0.28);
  transition: background 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
  flex-shrink: 0;
  animation: none;
  padding: 0 0 0 3px;
}

.fxc-root .fxc-player-btn.is-playing {
  background: #0f172a;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.3);
  animation: fxcPulsePurple 1.5s infinite;
  padding: 0;
}

.fxc-root .fxc-player-btn:not(.is-playing):hover {
  transform: scale(1.08);
  background: linear-gradient(135deg, #6d28d9, #4c1d95);
  box-shadow: 0 10px 22px rgba(124, 58, 237, 0.4);
}

.fxc-root .fxc-back-btn-inline {
  border: none;
  background: #f1f5f9;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.fxc-root .fxc-back-btn-inline:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.fxc-root .fxc-pack-topbar-title {
  font-size: 15px;
  font-weight: 800;
  color: #1e293b;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Eye / Show-Hide PL button - mirrors ls-eye-toggle */
.fxc-root .fxc-eye-btn {
  border: none;
  background: #ffffff;
  padding: 10px 16px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.3s ease;
  color: #7c3aed;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.1);
  white-space: nowrap;
  flex-shrink: 0;
}

.fxc-root .fxc-eye-btn:hover {
  background: #f5f3ff;
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.2);
  transform: translateY(-2px);
}

/* PL blur state - mirrors ls-blur-target */
.fxc-root.fxc-pl-hidden .fxc-blur-target {
  filter: blur(6px);
  opacity: 0.3;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.fxc-root.fxc-pl-hidden .fxc-phrase-row:hover .fxc-blur-target {
  filter: blur(0);
  opacity: 1;
}

/* STAGE PROGRESS PIPS */
.fxc-root .fxc-stage-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 24px;
  padding: 0 4px;
}

.fxc-root .fxc-stage-pip {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: #e2e8f0;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.fxc-root .fxc-stage-pip.is-done {
  background: #c4b5fd;
}

.fxc-root .fxc-stage-pip.is-active {
  background: #7c3aed;
  box-shadow: 0 0 10px rgba(124, 58, 237, 0.5);
  animation: fxcPulsePurple 2s infinite;
}

/* STAGE PANEL - mirrors ls-panel / ls-dialogue-card */
.fxc-root .fxc-stage {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 24px;
  padding: 32px 40px;
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.03);
  margin-bottom: 24px;
}

.fxc-root .fxc-stage-header {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f1f5f9;
}

.fxc-root .fxc-stage-label {
  font-size: 13px;
  font-weight: 900;
  color: #7c3aed;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 4px;
}

.fxc-root .fxc-stage-hint {
  font-size: 15px;
  font-weight: 500;
  color: #64748b;
}

.fxc-root .fxc-stage-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid #f1f5f9;
}

.fxc-root .fxc-complete-msg {
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  color: #7c3aed;
  padding: 32px 0;
}

/* INTRO */
.fxc-root .fxc-stage-intro {
  text-align: center;
}

.fxc-root .fxc-intro-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #7c3aed;
  background: #f5f3ff;
  border-radius: 99px;
  padding: 6px 16px;
  margin-bottom: 20px;
}

.fxc-root .fxc-intro-title {
  font-size: 32px;
  font-weight: 900;
  color: #0f172a;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.fxc-root .fxc-intro-sub {
  font-size: 16px;
  color: #64748b;
  margin-bottom: 16px;
}

.fxc-root .fxc-intro-meta {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.fxc-root .fxc-meta-pill {
  background: #f5f3ff;
  color: #6d28d9;
  border-radius: 99px;
  padding: 4px 14px;
  font-size: 12px;
  font-weight: 700;
}

.fxc-root .fxc-intro-desc {
  font-size: 15px;
  color: #64748b;
  line-height: 1.7;
  max-width: 480px;
  margin: 0 auto 32px;
}

/* PHRASE ROWS - mirrors ls-phrase-row exactly */
.fxc-root .fxc-preview-list {
  display: flex;
  flex-direction: column;
}

.fxc-root .fxc-phrase-row {
  display: grid;
  grid-template-columns: 48px 1fr 1fr;
  gap: 16px;
  align-items: center;
  padding: 16px 24px;
  border: 1px solid transparent;
  border-radius: 24px;
  background: #ffffff;
  margin-bottom: 10px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.02);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  position: relative;
}

.fxc-root .fxc-phrase-row:hover {
  transform: scale(1.015) translateY(-2px);
  box-shadow: 0 12px 28px rgba(124, 58, 237, 0.08);
  border-color: #ede9fe;
  background: #faf5ff;
}

/* Active/playing strip - subtle lift with left purple accent border */
.fxc-root .fxc-phrase-row.is-active-sync {
  transform: translateX(6px) translateY(-2px) !important;
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.10) !important;
  border-color: #a78bfa !important;
  border-left: 4px solid #7c3aed !important;
  background: #faf5ff !important;
  z-index: 5;
  position: relative;
}

.fxc-root .fxc-phrase-row.is-active-sync .fxc-phrase-index {
  background: #7c3aed !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.25) !important;
}

.fxc-root .fxc-phrase-row.is-active-sync .fxc-phrase-en {
  color: #5b21b6 !important;
  font-weight: 800 !important;
}

.fxc-root .fxc-phrase-index {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f5f3ff;
  color: #7c3aed;
  font-weight: 900;
  font-size: 14px;
}

.fxc-root .fxc-phrase-en {
  font-weight: 800;
  font-size: 17px;
  color: #0f172a;
}

.fxc-root .fxc-phrase-pl {
  color: #64748b;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* fxc-preview-play removed - strips use tap-to-play via JS */
.fxc-root .fxc-preview-play {
  display: none;
}

/* AUDIO PLAY BUTTON - big pulsing pill, mirrors ls-play-btn */
.fxc-root .fxc-audio-play-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 18px 36px;
  background: linear-gradient(135deg, #7c3aed, #5b21b6);
  color: #ffffff;
  border: none;
  border-radius: 999px;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.28);
  animation: none;
  line-height: 1;
}

.fxc-root .fxc-audio-play-btn svg {
  flex-shrink: 0;
  display: block;
}

.fxc-root .fxc-audio-play-btn:hover {
  transform: scale(1.04) translateY(-2px);
  box-shadow: 0 14px 28px rgba(124, 58, 237, 0.38);
}

.fxc-root .fxc-audio-play-btn.is-playing {
  background: #1e293b;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.25);
  animation: fxcPulsePurple 1.5s infinite;
  transform: none;
  cursor: wait;
}

.fxc-root .fxc-audio-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.fxc-root .fxc-audio-cue {
  font-size: 17px;
  color: #64748b;
  text-align: center;
  font-style: italic;
  line-height: 1.5;
}

/* QUESTION CARDS - mirrors ls-q-card */
.fxc-root .fxc-q-card {
  border: 1px solid #e2e8f0;
  border-radius: 24px;
  padding: 32px;
  background: #ffffff;
  margin-bottom: 20px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.02);
  animation: fxcFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.fxc-root .fxc-q-card:focus-within {
  border-color: #7c3aed;
  box-shadow: 0 14px 32px rgba(124, 58, 237, 0.1);
}

.fxc-root .fxc-q-prompt {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 24px;
  color: #0f172a;
  line-height: 1.4;
}

.fxc-root .fxc-q-options {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* OPTIONS - mirrors ls-option exactly */
.fxc-root .fxc-option {
  border: 2px solid #e2e8f0;
  background: #ffffff;
  border-radius: 16px;
  padding: 14px 24px;
  cursor: pointer;
  font-weight: 700;
  font-size: 16px;
  color: #475569;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  flex: 1 1 auto;
  text-align: center;
  min-width: 120px;
}

.fxc-root .fxc-option:hover:not(:disabled) {
  border-color: #a78bfa;
  color: #0f172a;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(124, 58, 237, 0.08);
}

.fxc-root .fxc-option.is-correct {
  background: #10b981;
  border-color: #10b981;
  color: #ffffff;
  transform: scale(1.03);
}

.fxc-root .fxc-option.is-wrong {
  background: #ef4444;
  border-color: #ef4444;
  color: #ffffff;
  animation: fxcShake 0.4s ease;
}

.fxc-root .fxc-option.is-locked {
  cursor: default;
  pointer-events: none;
}

.fxc-root .fxc-q-feedback {
  margin-top: 20px;
  padding: 14px 20px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  animation: fxcSlideUp 0.3s ease;
}

.fxc-root .fxc-q-feedback.is-correct {
  background: #ecfdf5;
  color: #166534;
  border: 1px solid #a7f3d0;
}

.fxc-root .fxc-q-feedback.is-wrong {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.fxc-root .fxc-q-explain {
  margin-top: 6px;
  font-weight: 500;
  opacity: 0.85;
  font-size: 14px;
}

/* BLANK */
.fxc-root .fxc-completion-template,
.fxc-root .fxc-context-sentence {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 28px;
  line-height: 1.7;
  text-align: center;
}

.fxc-root .fxc-blank {
  display: inline-block;
  min-width: 90px;
  padding: 3px 16px;
  margin: 0 6px;
  border-bottom: 4px solid #8b5cf6;
  border-radius: 8px;
  background: #f5f3ff;
  color: #5b21b6;
  transition: all 0.25s;
}

.fxc-root .fxc-blank.is-correct {
  border-color: #10b981;
  background: #ecfdf5;
  color: #065f46;
}

.fxc-root .fxc-blank.is-wrong {
  border-color: #ef4444;
  background: #fef2f2;
  color: #991b1b;
}

.fxc-root .fxc-context-note {
  font-size: 14px;
  color: #94a3b8;
  text-align: center;
  margin-bottom: 16px;
  font-style: italic;
}

/* PRODUCTION */
.fxc-root .fxc-prod-prompt {
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
  text-align: center;
  margin-bottom: 32px;
  padding: 32px;
  background: #f5f3ff;
  border-radius: 20px;
  border: 1px dashed #c4b5fd;
  line-height: 1.4;
}

.fxc-root .fxc-prod-reveal {
  margin-top: 24px;
  text-align: center;
  animation: fxcFadeIn 0.35s ease;
}

.fxc-root .fxc-prod-answer {
  font-size: 26px;
  font-weight: 900;
  color: #7c3aed;
  margin-bottom: 16px;
  padding: 24px 28px;
  background: #faf5ff;
  border-radius: 16px;
  border: 2px solid #a78bfa;
  line-height: 1.3;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fxc-root .fxc-prod-note {
  font-size: 14px;
  color: #64748b;
  font-style: italic;
  margin-bottom: 24px;
  line-height: 1.6;
  padding: 12px 16px;
  background: #f8fafc;
  border-radius: 10px;
  border-left: 3px solid #c4b5fd;
  text-align: left;
}

.fxc-root .fxc-prod-self-grade {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 20px;
  font-size: 15px;
  color: #64748b;
  flex-wrap: wrap;
}

/* RESULT */
.fxc-root .fxc-stage-result {
  text-align: center;
}

.fxc-root .fxc-result-badge {
  font-size: 64px;
  margin-bottom: 12px;
}

.fxc-root .fxc-result-score {
  font-size: 64px;
  font-weight: 900;
  color: #7c3aed;
  margin-bottom: 8px;
  letter-spacing: -0.03em;
}

.fxc-root .fxc-result-label {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 6px;
}

.fxc-root .fxc-result-meta {
  font-size: 14px;
  color: #94a3b8;
  margin-bottom: 32px;
}

.fxc-root .fxc-result-section {
  text-align: left;
  margin-bottom: 28px;
}

.fxc-root .fxc-mistake-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fxc-root .fxc-mistake-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 14px;
  font-size: 15px;
}

.fxc-root .fxc-mistake-prompt {
  color: #64748b;
}

.fxc-root .fxc-mistake-answer {
  font-weight: 700;
  color: #7c3aed;
}

.fxc-root .fxc-result-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* BUTTONS */
.fxc-root .fxc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.fxc-root .fxc-btn:active {
  transform: scale(0.97);
}

.fxc-root .fxc-btn-primary {
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.25);
}

.fxc-root .fxc-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(124, 58, 237, 0.35);
}

.fxc-root .fxc-btn-ghost {
  background: #ffffff;
  color: #7c3aed;
  border-color: #e9d5ff;
}

.fxc-root .fxc-btn-ghost:hover {
  background: #faf5ff;
  border-color: #c4b5fd;
  transform: translateY(-1px);
}

.fxc-root .fxc-btn-success {
  background: #10b981;
  color: #ffffff;
  border-color: #10b981;
}

.fxc-root .fxc-btn-success:hover {
  background: #059669;
  transform: translateY(-1px);
}

.fxc-root .fxc-btn-error {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
}

.fxc-root .fxc-btn-error:hover {
  background: #dc2626;
  transform: translateY(-1px);
}

.fxc-root .fxc-btn-sm {
  padding: 10px 20px;
  font-size: 14px;
  border-radius: 12px;
}

.fxc-root .fxc-btn-reveal {
  width: 100%;
  margin-top: 12px;
  background: #faf5ff;
  color: #7c3aed;
  border: 2px dashed #c4b5fd;
  border-radius: 16px;
  font-size: 15px;
}

.fxc-root .fxc-btn-reveal:hover {
  background: #f5f3ff;
  border-color: #a78bfa;
}

.fxc-root .fxc-pack-stage-area {
  min-height: 200px;
}

/* RESPONSIVE - mirrors LingoSync mobile breakpoints */
/* DONE / COMPLETED PACKS SECTION */
.fxc-root .fxc-pack-empty {
  text-align: center;
  color: #94a3b8;
  font-size: 15px;
  font-weight: 600;
  padding: 32px 0;
}

.fxc-root .fxc-done-section {
  margin-top: 24px;
  border-top: 1px solid #f1f5f9;
  padding-top: 16px;
}

.fxc-root .fxc-done-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: #94a3b8;
  padding: 6px 4px;
  border-radius: 8px;
  transition: color 0.15s;
  margin-bottom: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.fxc-root .fxc-done-toggle:hover {
  color: #64748b;
}

.fxc-root .fxc-done-toggle-icon {
  font-size: 10px;
  transition: transform 0.2s;
}

.fxc-root .fxc-done-pack-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: fxcSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.fxc-root .fxc-done-pack-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Restore checkbox  appears left of each done pack row */
.fxc-root .fxc-restore-label {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  width: 28px;
  height: 28px;
  position: relative;
}

.fxc-root .fxc-restore-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.fxc-root .fxc-restore-icon {
  width: 20px;
  height: 20px;
  border: 2px solid #cbd5e1;
  border-radius: 50%;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.fxc-root .fxc-restore-label:hover .fxc-restore-icon {
  border-color: #7c3aed;
  background: #f5f3ff;
}

.fxc-root .fxc-restore-label:hover .fxc-restore-icon::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #7c3aed;
  display: block;
}

/* Done pack rows are greyed out */
.fxc-root .fxc-done-pack-row .fxc-pack-btn.is-done {
  opacity: 0.55;
  flex: 1;
  background: #f8fafc;
  border-color: #e2e8f0;
  box-shadow: none;
  cursor: default;
  pointer-events: none;
}

.fxc-root .fxc-done-pack-row .fxc-pack-btn.is-done:hover {
  transform: none;
  box-shadow: none;
}

.fxc-root .fxc-done-pack-row .fxc-pack-btn-title {
  color: #94a3b8;
}

.fxc-root .fxc-done-pack-row .fxc-pack-btn-body small {
  color: #cbd5e1;
}

.fxc-root .fxc-done-pack-row .fxc-pack-btn-num {
  color: #cbd5e1;
}

@media (max-width: 1024px) {
  .fxc-root .fxc-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .fxc-root {
    padding: 16px 12px;
  }

  .fxc-root .fxc-hero {
    flex-direction: column;
    align-items: stretch;
    padding: 24px;
    gap: 16px;
    border-radius: 24px;
  }

  .fxc-root .fxc-title {
    font-size: 32px;
  }

  .fxc-root .fxc-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .fxc-root .fxc-group-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
  }

  .fxc-root .fxc-group-btn {
    flex-direction: row;
    align-items: center;
    padding: 16px 32px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    flex: 1 1 auto;
    font-size: 16px;
    min-height: 52px;
    min-width: 120px;
    justify-content: center;
  }

  .fxc-root .fxc-group-btn small {
    display: none;
  }

  .fxc-root .fxc-group-btn.is-active {
    border-color: transparent;
  }

  /* Mobile: topbar becomes a fixed bar pinned to top of viewport */
  .fxc-root .fxc-pack-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    padding: 10px 14px;
    margin-bottom: 0;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 16px rgba(15, 23, 42, 0.10);
    z-index: 200;
  }

  /* Spacer pushes content below the fixed bar */
  .fxc-root .fxc-topbar-spacer {
    display: block;
    height: 72px;
  }

  .fxc-root .fxc-pack-topbar-title {
    font-size: 13px;
  }

  .fxc-root .fxc-player-btn {
    width: 46px;
    height: 46px;
  }

  .fxc-root .fxc-stage {
    padding: 24px 20px;
    border-radius: 20px;
  }

  .fxc-root .fxc-phrase-row {
    grid-template-columns: 40px 1fr 1fr;
    padding: 14px 16px;
    gap: 10px;
  }

  .fxc-root .fxc-phrase-pl {
    grid-column: 2;
    margin-top: -4px;
    font-size: 14px;
  }

  .fxc-root .fxc-phrase-en {
    font-size: 16px;
  }

  .fxc-root .fxc-q-prompt,
  .fxc-root .fxc-completion-template,
  .fxc-root .fxc-context-sentence {
    font-size: 18px;
  }

  .fxc-root .fxc-option {
    padding: 14px 16px;
    font-size: 15px;
  }

  .fxc-root .fxc-stage-footer {
    flex-direction: column-reverse;
    gap: 12px;
  }

  .fxc-root .fxc-btn {
    width: 100%;
    justify-content: center;
  }

  .fxc-root .fxc-btn-sm {
    width: auto;
  }

  .fxc-root .fxc-result-score {
    font-size: 48px;
  }

  .fxc-root .fxc-prod-self-grade {
    flex-wrap: wrap;
  }

  .fxc-root .fxc-result-actions {
    flex-direction: column;
  }
}

/* =========================================================
   FX CONNECT PUBLIC DEMO PATCH
   Fixes public /fx/ demo class names used by module.fx-connect-demo.js:
   group-grid/card, pack-grid/card, preview-row, back button, section labels.
   ========================================================= */

.fxc-root .fxc-section-label {
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #7c3aed;
  margin: 0 0 18px;
}

.fxc-root .fxc-group-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.fxc-root .fxc-group-card {
  appearance: none;
  border: 1px solid #ede9fe;
  background: linear-gradient(135deg, #ffffff 0%, #f5f3ff 100%);
  border-radius: 24px;
  padding: 24px 22px;
  min-height: 160px;
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 10px;
  box-shadow: 0 12px 32px rgba(124, 58, 237, 0.07);
  transition: transform .25s cubic-bezier(.16,1,.3,1), box-shadow .25s cubic-bezier(.16,1,.3,1), border-color .25s;
}

.fxc-root .fxc-group-card:hover {
  transform: translateY(-6px);
  border-color: #c4b5fd;
  box-shadow: 0 24px 48px rgba(124, 58, 237, 0.14);
}

.fxc-root .fxc-group-icon {
  width: 42px;
  height: 42px;
  border-radius: 16px;
  background: #ede9fe;
  display: grid;
  place-items: center;
  color: #6d28d9;
  font-weight: 900;
}

.fxc-root .fxc-group-icon:empty::before {
  content: "FX";
  font-size: 12px;
  letter-spacing: .08em;
}

.fxc-root .fxc-group-label {
  font-size: 20px;
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: -.03em;
  color: #1e1b4b;
}

.fxc-root .fxc-group-desc {
  font-size: 14px;
  line-height: 1.55;
  color: #64748b;
  font-weight: 600;
}

.fxc-root .fxc-hero--compact {
  padding: 28px 32px;
  margin-bottom: 26px;
}

.fxc-root .fxc-back-btn {
  appearance: none;
  border: 1px solid #ddd6fe;
  background: #ffffff;
  color: #6d28d9;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  margin-bottom: 16px;
  box-shadow: 0 6px 16px rgba(124, 58, 237, 0.08);
  transition: all .2s ease;
}

.fxc-root .fxc-back-btn:hover {
  background: #f5f3ff;
  transform: translateY(-2px);
}

.fxc-root .fxc-pack-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.fxc-root .fxc-pack-card {
  appearance: none;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  border-radius: 22px;
  padding: 22px;
  min-height: 168px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 9px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
  transition: transform .25s cubic-bezier(.16,1,.3,1), box-shadow .25s cubic-bezier(.16,1,.3,1), border-color .25s, background .25s;
}

.fxc-root .fxc-pack-card:hover {
  transform: translateY(-5px);
  border-color: #c4b5fd;
  background: #faf5ff;
  box-shadow: 0 20px 42px rgba(124, 58, 237, 0.12);
}

.fxc-root .fxc-pack-card.is-done {
  background: linear-gradient(135deg, #6d28d9, #7c3aed);
  color: #ffffff;
  border-color: transparent;
}

.fxc-root .fxc-pack-num {
  color: #7c3aed;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .1em;
}

.fxc-root .fxc-pack-card.is-done .fxc-pack-num,
.fxc-root .fxc-pack-card.is-done .fxc-pack-sub,
.fxc-root .fxc-pack-card.is-done .fxc-pack-meta {
  color: #ede9fe;
}

.fxc-root .fxc-pack-title {
  font-size: 21px;
  line-height: 1.08;
  letter-spacing: -.03em;
  font-weight: 900;
  color: #0f172a;
}

.fxc-root .fxc-pack-card.is-done .fxc-pack-title {
  color: #ffffff;
}

.fxc-root .fxc-pack-sub {
  font-size: 14px;
  line-height: 1.55;
  color: #64748b;
  font-weight: 600;
}

.fxc-root .fxc-pack-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: auto;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 800;
}

.fxc-root .fxc-pack-diff {
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.fxc-root .fxc-pack-diff.fxc-diff-easy,
.fxc-root .fxc-diff-easy {
  background: #dcfce7;
  color: #15803d;
}

.fxc-root .fxc-pack-diff.fxc-diff-medium,
.fxc-root .fxc-diff-medium {
  background: #fef9c3;
  color: #92400e;
}

.fxc-root .fxc-pack-diff.fxc-diff-hard,
.fxc-root .fxc-diff-hard {
  background: #fee2e2;
  color: #b91c1c;
}

/* Preview stage rendered by the public demo JS */
.fxc-root .fxc-preview-row {
  display: grid;
  grid-template-columns: 46px 1fr 44px;
  gap: 16px;
  align-items: center;
  padding: 17px 20px;
  border: 1px solid #e2e8f0;
  border-radius: 22px;
  background: #ffffff;
  margin-bottom: 12px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.035);
  transition: all .3s cubic-bezier(.16,1,.3,1);
}

.fxc-root .fxc-preview-row:hover {
  transform: translateY(-3px);
  border-color: #c4b5fd;
  background: #faf5ff;
  box-shadow: 0 14px 32px rgba(124, 58, 237, 0.10);
}

.fxc-root .fxc-preview-num {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f5f3ff;
  color: #7c3aed;
  font-weight: 900;
  font-size: 14px;
}

.fxc-root .fxc-preview-body {
  min-width: 0;
}

.fxc-root .fxc-preview-en {
  font-size: 18px;
  font-weight: 900;
  color: #0f172a;
  letter-spacing: -.01em;
}

.fxc-root .fxc-preview-pl {
  margin-top: 4px;
  color: #64748b;
  font-size: 15px;
  font-weight: 650;
  transition: filter .25s ease, opacity .25s ease;
}

.fxc-root .fxc-preview-pl.is-blurred {
  filter: blur(5px);
  opacity: .42;
  cursor: pointer;
  user-select: none;
}

.fxc-root .fxc-preview-pl.is-blurred:hover {
  filter: blur(0);
  opacity: 1;
}

.fxc-root .fxc-preview-example {
  margin-top: 7px;
  color: #475569;
  font-size: 14px;
  line-height: 1.55;
}

.fxc-root .fxc-preview-play {
  display: grid !important;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #5b21b6);
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(124, 58, 237, .22);
  transition: transform .2s ease, box-shadow .2s ease;
}

.fxc-root .fxc-preview-play:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 24px rgba(124, 58, 237, .32);
}

@media (max-width: 1020px) {
  .fxc-root .fxc-group-grid,
  .fxc-root .fxc-pack-grid {
    grid-template-columns: repeat(2, minmax(0,1fr));
  }
}

@media (max-width: 680px) {
  .fxc-root {
    padding: 16px;
  }

  .fxc-root .fxc-group-grid,
  .fxc-root .fxc-pack-grid {
    grid-template-columns: 1fr;
  }

  .fxc-root .fxc-preview-row {
    grid-template-columns: 38px 1fr;
  }

  .fxc-root .fxc-preview-play {
    grid-column: 2;
    justify-self: start;
  }

  .fxc-root .fxc-hero,
  .fxc-root .fxc-hero--compact {
    padding: 24px 20px;
  }
}
