/* ============================================
   WalkieTalk French Games — Game Styles
   ============================================ */

/* ---- Landing Page — Premium Hero ---- */
.landing-hero {
  position: relative;
  text-align: center;
  padding: 6rem 1.5rem 4rem;
  overflow: hidden;
  min-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-hero-gradient);
}

/* Ambient Glow Orbs */
.hero-glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.12;
  pointer-events: none;
  z-index: 0;
}

.hero-glow-orb.orb-1 {
  width: 500px;
  height: 500px;
  background: #3B82F6;
  top: -10%;
  left: -10%;
  animation: orbFloat 12s ease-in-out infinite;
}

.hero-glow-orb.orb-2 {
  width: 400px;
  height: 400px;
  background: #8B5CF6;
  bottom: -5%;
  right: -5%;
  animation: orbFloat 15s ease-in-out infinite reverse;
}

.hero-glow-orb.orb-3 {
  width: 300px;
  height: 300px;
  background: #E63946;
  top: 40%;
  right: 20%;
  animation: orbFloat 10s ease-in-out infinite 2s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -20px) scale(1.05); }
  66% { transform: translate(-20px, 15px) scale(0.95); }
}

/* Hero Badge */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-full);
  background: var(--bg-glass);
  backdrop-filter: var(--blur-md);
  -webkit-backdrop-filter: var(--blur-md);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  position: relative;
  z-index: 2;
  animation: fadeInUp 0.6s ease;
}

.hero-badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse-dot 2s ease infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

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

.landing-hero h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  position: relative;
  z-index: 2;
  line-height: 1.05;
  letter-spacing: -0.04em;
  animation: fadeInUp 0.6s ease 0.1s both;
}

.landing-hero h1 .accent {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.landing-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  max-width: 520px;
  position: relative;
  z-index: 2;
  line-height: 1.6;
  font-weight: 400;
  animation: fadeInUp 0.6s ease 0.2s both;
}

.landing-cta {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
  position: relative;
  z-index: 2;
  animation: fadeInUp 0.6s ease 0.3s both;
}

/* Social Proof Strip */
.hero-social-proof {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-top: 3rem;
  position: relative;
  z-index: 2;
  flex-wrap: wrap;
  justify-content: center;
  animation: fadeInUp 0.6s ease 0.4s both;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}

.hero-stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.hero-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hero-stat-divider {
  width: 1px;
  height: 32px;
  background: var(--border-strong);
}

/* Features Section */
.landing-section {
  padding: 5rem 1.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.landing-section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.landing-section-header .section-label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-primary);
  margin-bottom: 0.75rem;
  background: var(--bg-tertiary);
  padding: 0.35rem 1rem;
  border-radius: var(--radius-full);
}

.landing-section-header h2 {
  font-size: 2.25rem;
  margin-bottom: 0.75rem;
  letter-spacing: -0.03em;
}

.landing-section-header p {
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto;
  font-size: 1.05rem;
}

.landing-features {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.feature-card {
  text-align: left;
  padding: 1.75rem;
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  border-radius: var(--radius-lg);
  transition: all var(--transition);
}

.feature-card:hover {
  transform: translateY(-2px);
}

.feature-icon {
  font-size: 1.75rem;
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
}

.feature-card h3 {
  margin-bottom: 0.35rem;
  font-size: 1.05rem;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin: 0;
  line-height: 1.5;
}

/* Testimonial Section */
.landing-testimonial {
  padding: 4rem 1.5rem;
  background: var(--bg-secondary);
}

.landing-testimonial-inner {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}

.landing-quote {
  max-width: 640px;
  margin: 0 auto;
  padding: 2.5rem;
  text-align: center;
  font-size: 1.15rem;
  font-style: italic;
  color: var(--text-primary);
  line-height: 1.7;
  border: none;
  background: none;
  position: relative;
}

.landing-quote::before {
  content: '"';
  position: absolute;
  top: -0.25rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 4rem;
  font-style: normal;
  font-weight: 900;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  opacity: 0.3;
}

.landing-quote cite {
  display: block;
  margin-top: 1.25rem;
  font-style: normal;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.landing-quote cite strong {
  color: var(--text-primary);
  font-weight: 700;
}

/* Credentials Section */
.landing-credentials {
  text-align: center;
  padding: 1rem 1.5rem 3rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* CTA Banner */
.landing-cta-banner {
  padding: 4rem 1.5rem;
  text-align: center;
  background: var(--bg-tertiary);
  border-radius: var(--radius-xl);
  margin: 0 1.5rem 3rem;
  max-width: calc(var(--max-width) - 3rem);
  margin-left: auto;
  margin-right: auto;
}

.landing-cta-banner h2 {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  letter-spacing: -0.03em;
}

.landing-cta-banner p {
  color: var(--text-secondary);
  margin-bottom: 2rem;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
  font-size: 1.05rem;
}

.landing-cta-banner .landing-cta {
  animation: none;
}

/* ---- Level Select — Premium ---- */
.level-select {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem 0;
}

.level-select h2 {
  text-align: center;
  margin-bottom: 0.5rem;
  font-size: 2rem;
  letter-spacing: -0.03em;
}

.level-select-subtitle {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  font-size: 1.05rem;
}

.level-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.level-card {
  cursor: pointer;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.level-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--accent-gradient);
  border-radius: 2px;
  transition: width var(--transition);
}

.level-card:hover::before {
  width: 5px;
}

.level-card-icon {
  font-size: 2rem;
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
}

.level-card-info {
  flex: 1;
  min-width: 0;
}

.level-card-info h3 {
  font-size: 1.1rem;
  margin-bottom: 0.15rem;
  font-weight: 700;
}

.level-card-info .level-name-en {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.level-card-info .level-audience {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.72rem;
  padding: 0.2rem 0.6rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.level-card-progress {
  flex-shrink: 0;
}

/* ---- Game Select (within level) — Premium ---- */
.game-select {
  max-width: 700px;
  margin: 0 auto;
  padding: 2rem 1.5rem 0;
}

.game-select-header {
  text-align: center;
  margin-bottom: 2rem;
}

.game-select-header h2 {
  margin-bottom: 0.25rem;
  font-size: 1.75rem;
}

.game-select-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  cursor: pointer;
  margin-bottom: 1rem;
  background: none;
  border: none;
  font-family: inherit;
  font-weight: 500;
  transition: color var(--transition);
}

.game-select-back:hover {
  color: var(--text-primary);
}

.game-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.game-card {
  cursor: pointer;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  border-radius: var(--radius-lg);
}

.game-card-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
  transition: all var(--transition);
}

.game-card:hover .game-card-icon {
  transform: scale(1.08);
}

.game-card-info h3 {
  font-size: 1rem;
  margin-bottom: 0.15rem;
  font-weight: 700;
}

.game-card-info p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
}

/* Arrow indicator on game cards */
.game-card::after {
  content: '→';
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-left: auto;
  transition: all var(--transition);
}

.game-card:hover::after {
  color: var(--accent-primary);
  transform: translateX(3px);
}

/* ---- Game Shell — Premium ---- */
.game-shell {
  max-width: 600px;
  margin: 0 auto;
  padding: 2rem 1.5rem 0;
}

.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.game-back {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.9rem;
  font-family: inherit;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
}

.game-back:hover {
  background: var(--bg-tertiary);
  color: var(--accent-primary);
}

.game-stats {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.game-progress {
  margin-bottom: 1.5rem;
}

.game-progress-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
  text-align: right;
}

/* ---- Flashcard Game (Duolingo-style) ---- */

.fc-page {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 1rem;
  padding-bottom: 100px; /* space for fixed bottom bar */
}

.fc-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.fc-back {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.9rem;
  font-family: inherit;
  padding: 0.35rem 0;
}

.fc-back:hover { color: var(--text-primary); }

.fc-counter {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.fc-xp {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--xp-gold, #F4A261);
}

.fc-progress-track {
  width: 100%;
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  margin-bottom: 2rem;
  overflow: hidden;
}

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

/* Card area — centers the card vertically in available space */
.fc-card-area {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
}

/* Shared card face styles */
.fc-card-front,
.fc-card-back {
  width: 100%;
  max-width: 440px;
  min-height: 280px;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2.5rem 2rem;
  position: relative;
  cursor: pointer;
  user-select: none;
  animation: fcSlideIn 0.3s ease;
}

@keyframes fcSlideIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.fc-hidden { display: none !important; }

/* Front — bold navy gradient */
.fc-card-front {
  background: linear-gradient(145deg, #1E3A5F 0%, #2A4F8F 50%, #3B82F6 100%);
  color: white;
  box-shadow: 0 8px 32px rgba(30, 58, 95, 0.3);
}

.fc-french {
  font-size: 2.4rem;
  font-weight: 800;
  font-style: italic;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.fc-tap-hint {
  margin-top: 1.5rem;
  font-size: 0.85rem;
  opacity: 0.5;
  font-weight: 400;
}

/* Back — clean white with green accent */
.fc-card-back {
  background: var(--bg-card);
  border: 3px solid var(--success, #2D936C);
  box-shadow: 0 8px 32px rgba(45, 147, 108, 0.15);
}

.fc-english {
  font-size: 2rem;
  font-weight: 800;
  color: var(--success, #2D936C);
  line-height: 1.2;
}

.fc-ex {
  margin-top: 1.25rem;
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-style: italic;
  max-width: 340px;
  line-height: 1.5;
}

.fc-ex-en {
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Speak button on cards */
.fc-speak {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.15);
  color: white;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.fc-speak:hover { background: rgba(255,255,255,0.3); transform: scale(1.1); }

.fc-speak--back {
  background: var(--bg-tertiary);
  color: var(--accent-primary);
  border: 1px solid var(--border);
}

.fc-speak--back:hover { background: var(--border); }

/* Flip-back button */
.fc-flip-back {
  position: absolute;
  top: 1rem;
  left: 1rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.fc-flip-back:hover { background: var(--accent-primary); color: white; border-color: var(--accent-primary); }

/* ---- Fixed Bottom Action Bar ---- */
.fc-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  display: flex;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
  background: var(--bg-primary);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
  justify-content: center;
}

.fc-btn {
  flex: 1;
  max-width: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  border: none;
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}

.fc-btn-icon {
  font-size: 0.85rem;
  opacity: 0.7;
}

.fc-btn--learning {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 2px solid var(--border);
}

.fc-btn--learning:hover { background: var(--error, #E63946); color: white; border-color: var(--error, #E63946); }

.fc-btn--known {
  background: var(--success, #2D936C);
  color: white;
}

.fc-btn--known:hover { background: #247a59; }

/* Mobile: make buttons full-width */
@media (max-width: 480px) {
  .fc-btn { max-width: none; padding: 0.85rem 1rem; font-size: 0.95rem; }
  .fc-card-front, .fc-card-back { min-height: 240px; padding: 2rem 1.5rem; }
  .fc-french { font-size: 2rem; }
  .fc-english { font-size: 1.6rem; }
}

/* ---- Quiz Game ---- */
.quiz-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.quiz-question {
  text-align: center;
  padding: 2rem;
  width: 100%;
}

.quiz-prompt-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
}

.quiz-word {
  font-size: 2rem;
  font-weight: 600;
  font-style: italic;
  color: var(--accent-primary);
  margin-bottom: 0.5rem;
}

.quiz-example {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-style: italic;
}

.quiz-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  width: 100%;
}

.quiz-option {
  padding: 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  text-align: center;
  transition: all var(--transition);
  font-family: inherit;
  color: var(--text-primary);
}

.quiz-option:hover {
  border-color: var(--accent-primary);
  background: var(--bg-tertiary);
}

.quiz-option.correct {
  border-color: var(--success);
  background: var(--success-light);
  color: var(--success);
}

.quiz-option.wrong {
  border-color: var(--error);
  background: var(--error-light);
  color: var(--error);
}

.quiz-option.disabled {
  pointer-events: none;
  opacity: 0.6;
}

.quiz-option.show-correct {
  border-color: var(--success);
  background: var(--success-light);
}

.quiz-feedback {
  text-align: center;
  font-weight: 600;
  font-size: 1.1rem;
  min-height: 2rem;
}

.quiz-feedback.correct { color: var(--success); }
.quiz-feedback.wrong { color: var(--error); }

/* ---- Matching Game ---- */
.matching-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.matching-stats {
  display: flex;
  gap: 2rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.matching-stats span {
  font-weight: 600;
  color: var(--text-primary);
}

.matching-grid {
  display: grid;
  gap: 0.5rem;
  width: 100%;
}

.matching-grid.pairs-6 { grid-template-columns: repeat(3, 1fr); }
.matching-grid.pairs-8 { grid-template-columns: repeat(4, 1fr); }
.matching-grid.pairs-10 { grid-template-columns: repeat(4, 1fr); }
.matching-grid.pairs-12 { grid-template-columns: repeat(4, 1fr); }

.matching-card {
  aspect-ratio: 1;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 500;
  text-align: center;
  padding: 0.5rem;
  transition: all var(--transition);
  word-break: break-word;
  min-height: 70px;
}

.matching-card:hover {
  border-color: var(--accent-primary);
  transform: scale(1.02);
}

.matching-card.face-down {
  background: linear-gradient(135deg, var(--accent-primary), #3B82F6);
  color: white;
  font-size: 1.5rem;
}

.matching-card.selected {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
  background: var(--bg-tertiary);
}

.matching-card.matched {
  border-color: var(--success);
  background: var(--success-light);
  color: var(--success);
  pointer-events: none;
}

.matching-card.wrong-match {
  border-color: var(--error);
  background: var(--error-light);
}

.matching-card.french-card {
  font-style: italic;
}

/* ---- Fill in the Blank ---- */
.fillblank-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.fillblank-sentence {
  font-size: 1.3rem;
  text-align: center;
  line-height: 1.8;
  padding: 1.5rem;
  width: 100%;
}

.fillblank-blank {
  display: inline-block;
  min-width: 100px;
  border-bottom: 3px solid var(--accent-primary);
  margin: 0 0.25rem;
  padding: 0.15rem 0.5rem;
  font-weight: 600;
  color: var(--accent-primary);
}

.fillblank-blank.correct {
  border-color: var(--success);
  color: var(--success);
  background: var(--success-light);
  border-radius: var(--radius-sm);
}

.fillblank-blank.wrong {
  border-color: var(--error);
  color: var(--error);
  background: var(--error-light);
  border-radius: var(--radius-sm);
}

.fillblank-translation {
  font-size: 0.95rem;
  color: var(--text-secondary);
  text-align: center;
  font-style: italic;
}

.fillblank-input-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  max-width: 400px;
}

.fillblank-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 1.1rem;
  font-family: inherit;
  background: var(--bg-card);
  color: var(--text-primary);
  text-align: center;
  transition: border-color var(--transition);
}

.fillblank-input:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.accent-helper {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: center;
}

.accent-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 1rem;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.accent-btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent-primary);
}

/* ---- Listening Game ---- */
.listening-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.listening-play-btn {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--accent-primary), #3B82F6);
  color: white;
  font-size: 2.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  box-shadow: var(--shadow-lg);
}

.listening-play-btn:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-xl);
}

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

.listening-speed {
  display: flex;
  gap: 0.5rem;
}

.speed-btn {
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.8rem;
  font-family: inherit;
  transition: all var(--transition);
}

.speed-btn.active {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
}

/* ---- End of Round Summary ---- */
.round-summary {
  text-align: center;
  padding: 2rem;
}

.round-summary h2 {
  margin-bottom: 0.5rem;
}

.round-summary-score {
  font-size: 3rem;
  font-weight: 700;
  color: var(--accent-primary);
  margin: 1rem 0;
}

.round-summary-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1.5rem 0;
}

.round-stat {
  text-align: center;
}

.round-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-primary);
}

.round-stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

.round-summary-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

/* ---- Progress Dashboard ---- */
.progress-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.progress-page h2 {
  text-align: center;
  margin-bottom: 2rem;
}

.progress-overview {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.progress-stat-card {
  text-align: center;
  padding: 1.25rem;
}

.progress-stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-primary);
}

.progress-stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.progress-levels {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.progress-level-card {
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.progress-level-info {
  flex: 1;
}

.progress-level-info h3 {
  font-size: 1rem;
  margin-bottom: 0.35rem;
}

/* ---- Settings Page ---- */
.settings-page {
  max-width: 500px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.settings-page h2 {
  text-align: center;
  margin-bottom: 2rem;
}

.settings-group {
  margin-bottom: 1.5rem;
}

.settings-group h3 {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.75rem;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.setting-row:last-child {
  border-bottom: none;
}

.setting-label {
  font-weight: 500;
}

.setting-description {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

/* Toggle Switch */
.toggle {
  position: relative;
  width: 48px;
  height: 26px;
  border-radius: 13px;
  background: var(--border);
  cursor: pointer;
  transition: background var(--transition);
  flex-shrink: 0;
  border: none;
}

.toggle.active {
  background: var(--success);
}

.toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  transition: left var(--transition);
  box-shadow: var(--shadow-sm);
}

.toggle.active::after {
  left: 25px;
}

/* ---- About Page — Premium ---- */
.about-page {
  max-width: 740px;
  margin: 0 auto;
  padding: 2rem 1.5rem 0;
}

.about-page h2 {
  text-align: center;
  margin-bottom: 0.75rem;
  font-size: 2rem;
  letter-spacing: -0.03em;
}

.about-page-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: 2.5rem;
}

.about-content {
  line-height: 1.8;
}

.about-content p {
  margin-bottom: 1.25rem;
  color: var(--text-secondary);
}

.about-credentials {
  padding: 2rem;
  margin: 2rem 0;
  border-radius: var(--radius-lg);
}

.about-credentials h3 {
  margin-bottom: 1rem;
  font-size: 1.15rem;
}

.about-credentials ul {
  list-style: none;
  padding: 0;
}

.about-credentials li {
  padding: 0.5rem 0;
  padding-left: 2rem;
  position: relative;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.about-credentials li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--success);
  font-weight: 700;
  font-size: 1rem;
}

.about-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent-primary);
  font-weight: 600;
  transition: gap var(--transition);
}

.about-link:hover {
  gap: 0.75rem;
}

/* CTA section on About page */
.about-cta {
  text-align: center;
  padding: 2.5rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-xl);
  margin: 2.5rem 0;
}

.about-cta h3 {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}

.about-cta p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

/* ---- Responsive ---- */
@media (min-width: 640px) {
  .landing-hero h1 { font-size: 3.5rem; }
  .landing-features { grid-template-columns: repeat(3, 1fr); }
  .level-grid { grid-template-columns: repeat(2, 1fr); }
  .game-grid { grid-template-columns: repeat(2, 1fr); }
  .progress-overview { grid-template-columns: repeat(4, 1fr); }
  .quiz-options { gap: 1rem; }
  .hero-social-proof { gap: 2rem; }
}

@media (min-width: 1024px) {
  .landing-hero h1 { font-size: 4.5rem; }
  .landing-hero { padding: 8rem 1.5rem 5rem; min-height: 90vh; }
  .landing-section { padding: 6rem 1.5rem; }
  .landing-section-header h2 { font-size: 2.75rem; }
}

/* ============================================
   NEW GAME TYPE STYLES
   ============================================ */

/* ---- Conjugation Game ---- */
.conjugation-container {
  max-width: 560px;
  margin: 0 auto;
  padding: 1rem 0;
}

.conjugation-question {
  text-align: center;
  padding: 2rem 1.5rem;
  margin-bottom: 1.5rem;
}

.conjugation-verb-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.conjugation-infinitive {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent-primary);
  font-style: italic;
}

.conjugation-english {
  font-size: 1rem;
  color: var(--text-secondary);
}

.conjugation-group {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
}

.conjugation-tense {
  font-size: 0.95rem;
  color: var(--accent-secondary);
  font-weight: 600;
  margin-bottom: 1.5rem;
  padding: 0.4rem 1rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  display: inline-block;
}

.conjugation-prompt {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  font-size: 1.4rem;
}

.conjugation-pronoun {
  font-weight: 600;
  color: var(--text-primary);
}

.conjugation-blank {
  color: var(--accent-primary);
  font-weight: 300;
  letter-spacing: 0.15em;
}

/* ---- Sentence Builder Game ---- */
.sentence-builder-container {
  max-width: 640px;
  margin: 0 auto;
  padding: 1rem 0;
}

.sentence-builder-prompt {
  text-align: center;
  margin-bottom: 1.5rem;
}

.sentence-builder-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.sentence-builder-english {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  padding: 1rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-lg);
  line-height: 1.6;
}

.sentence-builder-answer {
  min-height: 72px;
  padding: 1rem;
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  transition: border-color var(--transition);
}

.sentence-builder-answer:has(.sentence-placed-word) {
  border-color: var(--accent-primary);
  border-style: solid;
}

.sentence-builder-placeholder {
  color: var(--text-tertiary);
  font-size: 0.9rem;
  width: 100%;
  text-align: center;
}

.sentence-placed-word {
  padding: 0.5rem 0.85rem;
  background: var(--accent-primary);
  color: #fff;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.15s;
  animation: scaleIn 0.2s ease;
}

.sentence-placed-word:hover {
  opacity: 0.8;
  transform: scale(0.95);
}

.sentence-builder-words {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.sentence-word-btn {
  padding: 0.5rem 0.85rem;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.sentence-word-btn:hover:not(:disabled) {
  border-color: var(--accent-primary);
  background: var(--bg-tertiary);
}

.sentence-word-btn.used {
  opacity: 0.25;
  cursor: default;
  transform: scale(0.92);
}

.sentence-builder-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

/* ---- Translation Game ---- */
.translation-container {
  max-width: 560px;
  margin: 0 auto;
  padding: 1rem 0;
}

.translation-question {
  text-align: center;
  padding: 2rem 1.5rem;
  margin-bottom: 1.5rem;
}

.translation-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.translation-english {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.translation-type {
  font-size: 0.75rem;
  display: inline-block;
}

/* ---- Reading Comprehension ---- */
.reading-container {
  max-width: 680px;
  margin: 0 auto;
  padding: 1rem 0;
}

.reading-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.reading-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
}

.reading-passage {
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.reading-text {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-primary);
}

.reading-hint {
  text-align: center;
  padding: 1rem;
}

.reading-hint p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.reading-passage-mini {
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
}

.reading-toggle-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.reading-toggle-header span {
  font-weight: 600;
  font-size: 0.9rem;
}

.reading-passage-content {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.reading-passage-content .reading-text {
  font-size: 0.95rem;
  line-height: 1.7;
}

.reading-question-text {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ---- Speaking Practice ---- */
.speaking-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 1rem 0;
}

.speaking-word-card {
  text-align: center;
  padding: 2rem 1.5rem;
  margin-bottom: 1.5rem;
}

.speaking-french {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-primary);
  font-style: italic;
  margin-bottom: 0.5rem;
}

.speaking-english {
  font-size: 1.15rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.speaking-example {
  font-size: 0.95rem;
  color: var(--text-primary);
  font-style: italic;
  margin-bottom: 0.25rem;
}

.speaking-example-en {
  font-size: 0.85rem;
  color: var(--text-tertiary);
}

.speaking-tips {
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  background: var(--bg-tertiary);
}

.speaking-tips-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-secondary);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.speaking-tips-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.speaking-tips-list li {
  padding: 0.25rem 0;
}

.speaking-tips-list li strong {
  color: var(--accent-primary);
  font-family: 'Courier New', monospace;
}

.speaking-audio-controls {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.speaking-step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.speaking-step-number {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.speaking-step-content {
  flex: 1;
}

.speaking-step-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.speaking-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-accent {
  background: var(--accent-secondary);
  color: #fff;
  border: none;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-accent:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.speaking-rating {
  text-align: center;
  padding: 1.5rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-xl);
  animation: fadeInUp 0.4s ease;
}

.speaking-rating-label {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.speaking-rating-buttons {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.speaking-rate-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  font-size: 0.95rem;
}

.speaking-rate-icon {
  font-size: 1.2rem;
}

/* ---- Skill Category Labels (game select) ---- */
.game-card-skill {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  margin-top: 0.25rem;
}

/* ---- Responsive for new games ---- */
@media (min-width: 640px) {
  .conjugation-question { padding: 2.5rem 2rem; }
  .conjugation-infinitive { font-size: 2.2rem; }
  .speaking-french { font-size: 2.5rem; }
  .translation-english { font-size: 1.5rem; }
  .sentence-builder-english { font-size: 1.3rem; }
  .game-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .game-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ============================================
   Motivational System — XP Badge, Toasts,
   Achievements, Level-Up
   ============================================ */

/* ---- Header XP Badge ---- */
.wt-xp-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 4px 10px 4px 7px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  line-height: 1;
  color: var(--text-primary);
}
.wt-xp-badge:hover { background: var(--bg-secondary); }
.wt-xp-badge:active { transform: scale(0.95); }
.wt-xp-icon { font-size: 1rem; }
.wt-xp-val { color: var(--xp-gold, #F59E0B); font-weight: 700; }
.wt-streak-pip {
  background: linear-gradient(135deg, #FF6B35, #FF9500);
  color: white;
  border-radius: 10px;
  padding: 1px 6px;
  font-size: 0.72rem;
  font-weight: 700;
  margin-left: 2px;
}

/* Pulse animation when XP updates */
@keyframes xpPulse {
  0%, 100% { transform: scale(1); }
  40% { transform: scale(1.12); }
}
.wt-xp-pulse { animation: xpPulse 0.35s ease-out; }

/* ---- Toast Container (bottom-right) ---- */
.wt-toast {
  position: fixed;
  bottom: 5.5rem;
  right: 1.2rem;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 14px;
  padding: 10px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: 0 8px 32px rgba(0,0,0,0.22);
  pointer-events: none;
  max-width: 280px;
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s;
}
.wt-toast.wt-toast-in { transform: translateX(0); opacity: 1; }
.wt-toast.wt-toast-out { transform: translateX(120%); opacity: 0; transition: transform 0.3s ease-in, opacity 0.3s; }

.wt-toast--xp {
  background: linear-gradient(135deg, #1B2A4A 0%, #2a3f6a 100%);
  color: #F59E0B;
  border: 1px solid rgba(245,158,11,0.3);
}
.wt-toast-xp-num { font-size: 1.15rem; font-weight: 800; }
.wt-toast-combo {
  font-size: 0.75rem;
  font-weight: 700;
  color: #FF9500;
  margin-left: 4px;
}

.wt-toast--ach {
  background: linear-gradient(135deg, #1a1040 0%, #2d1f6e 100%);
  color: white;
  border: 1px solid rgba(139,92,246,0.4);
  gap: 12px;
}
.wt-toast--level {
  background: linear-gradient(135deg, #0f2714 0%, #1a4a22 100%);
  color: white;
  border: 1px solid rgba(16,185,129,0.4);
  gap: 12px;
}
.wt-toast--streak {
  background: linear-gradient(135deg, #3d1a00 0%, #7c3600 100%);
  color: #FFD97D;
  border: 1px solid rgba(255,150,0,0.4);
}
.wt-toast-ach-icon { font-size: 1.6rem; flex-shrink: 0; }
.wt-toast-ach-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.3;
}
.wt-toast-ach-body strong { font-size: 0.75rem; opacity: 0.75; text-transform: uppercase; letter-spacing: 0.04em; }
.wt-toast-ach-body span { font-size: 0.9rem; font-weight: 700; }
.wt-toast-ach-bonus { font-size: 0.75rem; color: #F59E0B; margin-top: 1px; }

/* ---- Achievements on Progress Page ---- */
.ach-categories {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-top: 1rem;
}
.ach-category {}
.ach-cat-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.15rem;
  color: var(--text-primary);
}
.ach-cat-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0 0 0.65rem;
}
.ach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}
.ach-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  transition: border-color 0.2s, background 0.2s;
}
.ach-card.unlocked {
  border-color: var(--accent-primary, #6366f1);
  background: color-mix(in srgb, var(--accent-primary) 8%, var(--bg-secondary));
}
.ach-card.locked { opacity: 0.55; filter: grayscale(0.6); }
.ach-icon { font-size: 1.5rem; flex-shrink: 0; }
.ach-info { flex: 1; }
.ach-info strong { display: block; font-size: 0.9rem; }
.ach-info span { display: block; font-size: 0.78rem; color: var(--text-muted); line-height: 1.3; }
.ach-bonus { color: var(--xp-gold, #F59E0B); font-size: 0.75rem; margin-top: 2px; }
.ach-check { color: #10B981; font-weight: 700; font-size: 1rem; }
.ach-lock { font-size: 0.85rem; opacity: 0.5; }
.ach-download-btn {
  background: var(--accent-primary, #6366f1);
  color: white;
  border: none;
  border-radius: 8px;
  width: 34px;
  height: 34px;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.1s;
}
.ach-download-btn:hover { background: #4f46e5; transform: scale(1.08); }
.ach-download-btn:active { transform: scale(0.95); }

/* ---- XP Level Bar on Progress Page ---- */
.progress-xp-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.progress-xp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  gap: 1rem;
}
.progress-xp-level {
  display: flex;
  align-items: center;
  gap: 10px;
}
.progress-xp-level-icon { font-size: 2rem; }
.progress-xp-level strong { display: block; font-size: 1.1rem; }
.progress-xp-level span { font-size: 0.82rem; color: var(--text-muted); }
.progress-xp-streak {
  background: linear-gradient(135deg, #FF6B35, #FF9500);
  color: white;
  border-radius: 20px;
  padding: 4px 12px;
  font-weight: 700;
  font-size: 0.9rem;
}
.progress-xp-bar-wrap {
  background: var(--bg-tertiary);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
  margin-bottom: 6px;
}
.progress-xp-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-primary), #818cf8);
  transition: width 0.8s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.progress-xp-bar-label { font-size: 0.78rem; color: var(--text-muted); text-align: right; }

@media (max-width: 480px) {
  .wt-toast { bottom: 4.5rem; right: 0.75rem; max-width: calc(100vw - 1.5rem); }
  .ach-grid { grid-template-columns: 1fr; }

  /* Game shell — tighter padding on mobile */
  .game-shell { padding: 1.25rem 1rem 0; }
  .game-header { margin-bottom: 1rem; }

  /* Quiz — single column options on small screens for better touch targets */
  .quiz-options { grid-template-columns: 1fr; gap: 0.5rem; }
  .quiz-option { padding: 0.85rem 1rem; font-size: 0.95rem; min-height: 48px; }
  .quiz-word { font-size: 1.6rem; }

  /* Matching — reduce columns on mobile for readability */
  .matching-grid.pairs-8,
  .matching-grid.pairs-10,
  .matching-grid.pairs-12 { grid-template-columns: repeat(3, 1fr); }
  .matching-card { font-size: 0.75rem; min-height: 60px; padding: 0.35rem; }

  /* Fill in the Blank — smaller sentence, wider input */
  .fillblank-sentence { font-size: 1.1rem; padding: 1rem; }
  .fillblank-input-area { max-width: 100%; }
  .fillblank-input { font-size: 1rem; }
  .accent-btn { width: 34px; height: 34px; font-size: 0.9rem; }

  /* Listening — slightly smaller play button */
  .listening-play-btn { width: 80px; height: 80px; font-size: 2rem; }

  /* Round summary — 2 columns on mobile if 4+ stats */
  .round-summary-stats { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
  .round-summary-score { font-size: 2.25rem; }
  .round-summary { padding: 1.25rem; }
  .round-summary-actions { flex-direction: column; align-items: stretch; }
  .round-summary-actions .btn { text-align: center; }

  /* Landing hero — less padding, smaller hero text */
  .landing-hero { padding: 4rem 1rem 3rem; min-height: 70vh; }
  .landing-hero h1 { font-size: 2.2rem; }
  .landing-subtitle { font-size: 1rem; margin-bottom: 1.5rem; }
  .floating-word { display: none; } /* Hide floating words on small screens — they clutter the view */
  .hero-social-proof { gap: 1rem; margin-top: 2rem; }
  .hero-stat-value { font-size: 1.2rem; }
  .landing-section { padding: 3rem 1rem; }

  /* Speaking — tighter layout */
  .speaking-word-card { padding: 1.25rem 1rem; }
  .speaking-french { font-size: 1.6rem; }

  /* Sentence builder — ensure tiles wrap nicely */
  .sentence-word-btn { padding: 0.45rem 0.7rem; font-size: 0.9rem; }

  /* Conjugation input */
  .conjugation-input { font-size: 1rem; }
}

/* ============================================
   Onboarding — Tooltip Product Tour
   ============================================ */

/* Subtle backdrop with spotlight cutout */
.onboard-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0);
  transition: background 0.3s ease, opacity 0.3s ease;
  pointer-events: auto;
}
.onboard-backdrop.onboard-active { background: rgba(0, 0, 0, 0.4); }
.onboard-backdrop.onboard-exit { opacity: 0; pointer-events: none; }

/* Tooltip card */
.onboard-tooltip {
  position: fixed;
  z-index: 10001;
  background: var(--bg-primary, #fff);
  border-radius: 0.75rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.08);
  max-width: 320px;
  width: calc(100vw - 2rem);
  padding: 0;
  opacity: 0;
  transition: opacity 0.3s ease;
  border: 1px solid var(--border-color, rgba(0,0,0,0.08));
}
.onboard-tooltip.onboard-active { opacity: 1; }
.onboard-tooltip.onboard-exit { opacity: 0; pointer-events: none; }

/* Entry animation */
.onboard-tooltip-enter { animation: ttEnter 0.25s ease-out; }
@keyframes ttEnter {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Header row */
.onboard-tooltip-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem 0;
}
.onboard-tooltip-icon { font-size: 1.3rem; line-height: 1; }
.onboard-tooltip-step {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted, #999);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.onboard-tooltip-close {
  margin-left: auto;
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--text-muted, #999);
  cursor: pointer;
  padding: 0 0.25rem;
  line-height: 1;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}
.onboard-tooltip-close:hover {
  color: var(--text-primary, #333);
  background: var(--bg-secondary, #f0f0f0);
}

/* Title */
.onboard-tooltip-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0.5rem 1rem 0.35rem;
  color: var(--text-primary, #1a1a1a);
}

/* Body */
.onboard-tooltip-body {
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--text-secondary, #555);
  padding: 0 1rem;
  margin-bottom: 0.75rem;
}
.onboard-tooltip-body strong { color: var(--text-primary, #1a1a1a); }
.onboard-tooltip-body em { color: var(--accent-primary, #3B82F6); font-style: italic; }

/* Footer: dots + actions */
.onboard-tooltip-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem 0.75rem;
  border-top: 1px solid var(--border-color, rgba(0,0,0,0.06));
}

/* Progress Dots (compact) */
.onboard-dots {
  display: flex;
  gap: 5px;
}
.onboard-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--bg-tertiary, #ddd);
  transition: all 0.25s ease;
}
.onboard-dot.active {
  background: var(--accent-primary, #3B82F6);
  transform: scale(1.4);
}
.onboard-dot.done {
  background: var(--accent-primary, #3B82F6);
  opacity: 0.45;
}

/* Action buttons */
.onboard-tooltip-actions {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.onboard-tooltip-cta {
  background: var(--accent-primary, #3B82F6);
  color: #fff;
  border: none;
  padding: 0.4rem 1rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}
.onboard-tooltip-cta:hover { filter: brightness(1.1); transform: translateY(-1px); }
.onboard-tooltip-cta:active { transform: translateY(0); }
.onboard-tooltip-back {
  background: none;
  border: none;
  color: var(--text-muted, #999);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
  transition: color 0.15s;
}
.onboard-tooltip-back:hover { color: var(--text-primary, #333); }

/* Highlight ring on anchored elements */
.onboard-highlight {
  z-index: 10000;
  box-shadow: 0 0 0 3px var(--accent-primary, #3B82F6), 0 0 12px rgba(59, 130, 246, 0.25);
  border-radius: 6px;
  animation: onboardRing 1.8s ease-in-out infinite;
}
@keyframes onboardRing {
  0%, 100% { box-shadow: 0 0 0 3px var(--accent-primary, #3B82F6), 0 0 12px rgba(59, 130, 246, 0.25); }
  50%      { box-shadow: 0 0 0 5px var(--accent-primary, #3B82F6), 0 0 20px rgba(59, 130, 246, 0.4); }
}

/* Responsive */
@media (max-width: 480px) {
  .onboard-tooltip { max-width: calc(100vw - 1.5rem); }
}

/* ============================================================
   UX IMPROVEMENTS — feat/ux-improvements
   ============================================================ */

/* ---- 1. Focus Indicators (Keyboard Navigation) ---- */
:focus-visible {
  outline: 3px solid var(--accent-primary);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Remove outline for mouse users */
:focus:not(:focus-visible) {
  outline: none;
}

/* ---- 2. Reduced Motion — global kill-switch ---- */
[data-reduce-motion="true"] *,
[data-reduce-motion="true"] *::before,
[data-reduce-motion="true"] *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
  scroll-behavior: auto !important;
}

/* ---- 3. Skip-to-Content Link ---- */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--accent-primary);
  color: #fff;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.9rem;
  z-index: 99999;
  text-decoration: none;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 1rem;
  outline: 3px solid #fff;
  outline-offset: 2px;
}

/* ---- 4. Offline Banner ---- */
.offline-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--accent-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.65rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 9998;
  animation: slideUpBanner 0.3s ease;
}
.offline-banner[hidden] { display: none; }
.offline-banner-close {
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
.offline-banner-close:hover { background: rgba(255,255,255,0.35); }
@keyframes slideUpBanner {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ---- 5. Redesigned Level Cards ---- */
/* Override previous .level-grid to be 2-col on desktop */
.level-grid {
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .level-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Base new card */
.level-card-new {
  cursor: pointer;
  border-radius: var(--radius-lg);
  overflow: hidden;
  padding: 0;
  border: 1px solid transparent;
  background: var(--bg-card);
  box-shadow: var(--shadow-md);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  display: flex;
  flex-direction: column;
}

.level-card-new:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
}

/* Coloured header strip per level */
.level-card-header {
  height: 8px;
  width: 100%;
  flex-shrink: 0;
}

.level-card-new[data-level="decouverte"]    .level-card-header { background: linear-gradient(90deg, #059669, #34d399); }
.level-card-new[data-level="intermediaire"] .level-card-header { background: linear-gradient(90deg, #1d4ed8, #60a5fa); }
.level-card-new[data-level="avance"]        .level-card-header { background: linear-gradient(90deg, #6d28d9, #a78bfa); }
.level-card-new[data-level="expert"]        .level-card-header { background: linear-gradient(90deg, #b45309, #fbbf24); }

/* Hover border tint */
.level-card-new[data-level="decouverte"]:hover    { border-color: #34d399; }
.level-card-new[data-level="intermediaire"]:hover { border-color: #60a5fa; }
.level-card-new[data-level="avance"]:hover        { border-color: #a78bfa; }
.level-card-new[data-level="expert"]:hover        { border-color: #fbbf24; }

.level-card-body {
  padding: 1.35rem 1.5rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  flex: 1;
}

.level-card-top {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.level-card-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  flex-shrink: 0;
}

.level-card-new[data-level="decouverte"]    .level-card-icon-wrap { background: #d1fae5; }
.level-card-new[data-level="intermediaire"] .level-card-icon-wrap { background: #dbeafe; }
.level-card-new[data-level="avance"]        .level-card-icon-wrap { background: #ede9fe; }
.level-card-new[data-level="expert"]        .level-card-icon-wrap { background: #fef3c7; }

[data-theme="dark"] .level-card-new[data-level="decouverte"]    .level-card-icon-wrap { background: rgba(5, 150, 105, 0.2); }
[data-theme="dark"] .level-card-new[data-level="intermediaire"] .level-card-icon-wrap { background: rgba(29,  78, 216, 0.2); }
[data-theme="dark"] .level-card-new[data-level="avance"]        .level-card-icon-wrap { background: rgba(109, 40, 217, 0.2); }
[data-theme="dark"] .level-card-new[data-level="expert"]        .level-card-icon-wrap { background: rgba(180, 83,  9, 0.2); }

.level-card-meta { flex: 1; min-width: 0; }

.level-card-meta h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 0.15rem;
  color: var(--text-primary);
}

.level-card-meta .level-name-en {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 400;
  margin-bottom: 0.35rem;
}

.level-card-meta .level-audience {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
  color: var(--text-muted);
  background: var(--bg-tertiary);
}

.level-card-pct {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-secondary);
  flex-shrink: 0;
  align-self: center;
}

.level-card-new[data-level="decouverte"]    .level-card-pct { color: #059669; }
.level-card-new[data-level="intermediaire"] .level-card-pct { color: #1d4ed8; }
.level-card-new[data-level="avance"]        .level-card-pct { color: #6d28d9; }
.level-card-new[data-level="expert"]        .level-card-pct { color: #b45309; }

/* Progress bar */
.level-card-bar-wrap {
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  overflow: hidden;
}

.level-card-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.6s ease;
  min-width: 4px;
}

.level-card-new[data-level="decouverte"]    .level-card-bar-fill { background: linear-gradient(90deg, #059669, #34d399); }
.level-card-new[data-level="intermediaire"] .level-card-bar-fill { background: linear-gradient(90deg, #1d4ed8, #60a5fa); }
.level-card-new[data-level="avance"]        .level-card-bar-fill { background: linear-gradient(90deg, #6d28d9, #a78bfa); }
.level-card-new[data-level="expert"]        .level-card-bar-fill { background: linear-gradient(90deg, #b45309, #fbbf24); }

/* Footer row: XP + Play button */
.level-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.1rem;
}

.level-card-xp {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.level-card-play {
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  border: 2px solid currentColor;
  transition: background 0.18s, color 0.18s;
}

.level-card-new[data-level="decouverte"]    .level-card-play { color: #059669; }
.level-card-new[data-level="intermediaire"] .level-card-play { color: #1d4ed8; }
.level-card-new[data-level="avance"]        .level-card-play { color: #6d28d9; }
.level-card-new[data-level="expert"]        .level-card-play { color: #b45309; }

.level-card-new:hover .level-card-play {
  background: currentColor;
  color: #fff !important;
}

/* ---- 6. Level Complete Celebration Banner ---- */
.level-complete-banner {
  background: linear-gradient(135deg, #059669 0%, #10b981 50%, #34d399 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  animation: bounceIn 0.5s ease;
}

.level-complete-banner-icon {
  font-size: 2.5rem;
  flex-shrink: 0;
}

.level-complete-banner-text h3 {
  font-size: 1.05rem;
  font-weight: 800;
  margin: 0 0 0.2rem;
  color: #fff;
}

.level-complete-banner-text p {
  font-size: 0.85rem;
  margin: 0;
  opacity: 0.9;
}

/* ---- 7. Custom Confirmation Dialog ---- */
.wt-dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 99997;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.15s ease;
}

.wt-dialog-overlay[hidden] { display: none; }

.wt-dialog {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 2rem 1.75rem 1.5rem;
  max-width: 380px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  text-align: center;
  animation: scaleIn 0.2s ease;
}

.wt-dialog-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.wt-dialog h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: var(--text-primary);
}

.wt-dialog p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0 0 1.5rem;
  line-height: 1.5;
}

.wt-dialog-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.wt-dialog-actions .btn-cancel {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  padding: 0.55rem 1.4rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s;
  font-family: inherit;
}

.wt-dialog-actions .btn-cancel:hover { background: var(--border); }

.wt-dialog-actions .btn-danger {
  background: var(--error, #e63946);
  color: #fff;
  border: none;
  padding: 0.55rem 1.4rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: filter 0.15s;
  font-family: inherit;
}

.wt-dialog-actions .btn-danger:hover { filter: brightness(1.12); }

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

/* ============================================================
   PHASE 2 — PWA, Skeleton Loaders, Keyboard Hints
   ============================================================ */

/* ---- Shimmer skeleton loader ---- */
@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position:  600px 0; }
}

.shimmer {
  background: linear-gradient(
    90deg,
    var(--bg-tertiary) 25%,
    var(--bg-card)     50%,
    var(--bg-tertiary) 75%
  );
  background-size: 600px 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}

[data-reduce-motion="true"] .shimmer {
  animation: none;
  background: var(--bg-tertiary);
}

.skeleton-loader {
  max-width: 700px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.skeleton-game-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.skeleton-block {
  border-radius: var(--radius-md);
}

.skeleton-title {
  width: 260px;
  height: 32px;
}

.skeleton-subtitle {
  width: 180px;
  height: 18px;
  opacity: 0.6;
}

.skeleton-card-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}

.skeleton-card {
  height: 90px;
  border-radius: var(--radius-lg);
}

.skeleton-btn {
  width: 160px;
  height: 44px;
  margin: 0.5rem auto 0;
  border-radius: var(--radius-full);
}

/* ---- Keyboard Hints FAB ---- */
.kb-hints-fab {
  position: fixed;
  bottom: 5.5rem;   /* above chatbot FAB */
  right: 1.25rem;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--border);
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: background 0.15s, color 0.15s, transform 0.15s;
  z-index: 9000;
  font-family: inherit;
}

.kb-hints-fab:hover,
.kb-hints-fab.active {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-primary);
  transform: scale(1.08);
}

/* ---- Keyboard Hints Modal ---- */
.kb-hints-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 9001;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.15s ease;
}

.kb-hints-modal[hidden] { display: none; }

.kb-hints-inner {
  background: var(--bg-card);
  border-radius: var(--radius-lg) var(--radius-lg) var(--radius-md) var(--radius-md);
  width: 100%;
  max-width: 460px;
  padding: 1.25rem 1.5rem 1.5rem;
  box-shadow: var(--shadow-xl);
  animation: slideUp 0.22s ease;
}

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

.kb-hints-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.kb-hints-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
}

.kb-hints-close {
  background: var(--bg-tertiary);
  border: none;
  color: var(--text-secondary);
  font-size: 1.1rem;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  font-family: inherit;
}

.kb-hints-close:hover { background: var(--border); }

.kb-hints-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin: 0.75rem 0 0.4rem;
}

.kb-hints-table {
  width: 100%;
  border-collapse: collapse;
}

.kb-hints-table tr + tr td {
  border-top: 1px solid var(--border);
}

.kb-hints-table td {
  padding: 0.5rem 0.25rem;
  font-size: 0.88rem;
}

.kb-key {
  font-family: 'Courier New', monospace;
  font-weight: 700;
  color: var(--accent-primary);
  white-space: nowrap;
  padding-right: 1rem !important;
  width: 40%;
}

.kb-action {
  color: var(--text-secondary);
}

@media (min-width: 600px) {
  .kb-hints-modal {
    align-items: center;
  }
  .kb-hints-inner {
    border-radius: var(--radius-lg);
    animation: scaleIn 0.18s ease;
  }
}

/* ---- Mid-Game Resume Prompt ---- */
.resume-prompt {
  max-width: 420px;
  margin: 4rem auto 0;
  text-align: center;
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.resume-prompt-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.resume-prompt h2 {
  font-size: 1.4rem;
  margin: 0;
  letter-spacing: -0.02em;
}

.resume-prompt-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* ============================================
   Celebration Modal — Achievement Overlay
   ============================================ */

/* ---- Celebration Modal v3 — Enhanced ---- */

.celebrate-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.35s ease;
  padding: 0.75rem;
}

.celebrate-overlay.celebrate-active { opacity: 1; }
.celebrate-overlay.celebrate-exit   { opacity: 0; pointer-events: none; }

.celebrate-card {
  position: relative;
  background: var(--card-bg, #fff);
  border-radius: 1.5rem;
  padding: 1.75rem 1.5rem 1.5rem;
  max-width: 420px;
  width: 100%;
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
  overflow-x: hidden;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255,255,255,0.06);
  transform: translateY(24px) scale(0.92);
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.15) transparent;
}
.celebrate-card::-webkit-scrollbar       { width: 5px; }
.celebrate-card::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 99px; }

.celebrate-active .celebrate-card { transform: translateY(0) scale(1); }
.celebrate-exit .celebrate-card   { transform: translateY(20px) scale(0.9); }

.celebrate-close {
  position: sticky;
  top: 0;
  float: right;
  background: var(--bg-tertiary, rgba(0,0,0,0.04));
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--text-muted, #888);
  line-height: 1;
  padding: 0.3rem 0.55rem;
  border-radius: 50%;
  transition: background 0.15s, transform 0.15s;
  z-index: 2;
}
.celebrate-close:hover { background: var(--hover-bg, rgba(0,0,0,0.1)); transform: scale(1.1); }

/* Tier icon with pulse ring */
.celebrate-icon {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0.5rem auto 0.6rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}
.celebrate-icon-emoji { font-size: 1.75rem; position: relative; z-index: 1; }
.celebrate-icon-ring {
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px solid;
  opacity: 0;
}
.celebrate-icon-pop {
  animation: celebrate-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s both;
}
.celebrate-active .celebrate-icon-ring {
  animation: celebrate-ring-pulse 1.5s ease-out 0.3s both;
}

@keyframes celebrate-pop {
  0%   { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes celebrate-ring-pulse {
  0%   { transform: scale(0.8); opacity: 0.8; }
  50%  { opacity: 0.4; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* Staggered fade-up entries */
.celebrate-fade-up {
  opacity: 0;
  transform: translateY(12px);
}
.celebrate-active .celebrate-fade-up {
  animation: celebrate-fade-in 0.45s ease forwards;
  animation-delay: var(--delay, 0s);
}
@keyframes celebrate-fade-in {
  to { opacity: 1; transform: translateY(0); }
}

.celebrate-tier {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 0.15rem;
  letter-spacing: -0.02em;
}

.celebrate-message {
  color: var(--text-muted, #666);
  font-size: 0.88rem;
  margin: 0 0 1rem;
  line-height: 1.4;
}

/* Stats row */
.celebrate-stats {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.celebrate-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 55px;
}
.celebrate-stat-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--accent, #3B82F6);
  line-height: 1.2;
}
.celebrate-stat-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted, #888);
  margin-top: 0.1rem;
}

.celebrate-tip {
  background: var(--bg-subtle, rgba(59, 130, 246, 0.06));
  border-radius: 0.75rem;
  padding: 0.6rem 0.85rem;
  font-size: 0.8rem;
  color: var(--text-muted, #666);
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

/* Confetti particles */
.celebrate-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.celebrate-particle {
  position: absolute;
  opacity: 0;
  animation: celebrate-confetti 1.2s ease-out forwards;
}
@keyframes celebrate-confetti {
  0%   { opacity: 1; transform: translate(0, 0) rotate(0deg) scale(1); }
  100% { opacity: 0; transform: translate(var(--x), var(--y)) rotate(var(--r)) scale(0.3); }
}
[data-reduce-motion="true"] .celebrate-particle { animation: none; display: none; }

/* Mobile */
@media (max-width: 480px) {
  .celebrate-card { padding: 1.5rem 1.15rem 1.25rem; border-radius: 1.15rem; }
  .celebrate-icon { width: 56px; height: 56px; }
  .celebrate-icon-emoji { font-size: 1.75rem; }
  .celebrate-tier { font-size: 1.3rem; }
  .celebrate-stats { gap: 0.85rem; }
  .celebrate-stat-value { font-size: 1.15rem; }
}

/* ============================================
   Celebration Modal — Enhanced v2
   Total XP counter, level progress bar, next suggestion
   ============================================ */

/* Total XP display */
.celebrate-total-xp {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--bg-tertiary, rgba(0,0,0,0.04));
  border-radius: 0.75rem;
  padding: 0.5rem 1rem;
  margin: 0 0 0.75rem;
  font-weight: 600;
  font-size: 0.9rem;
}
.celebrate-total-xp-icon { font-size: 1rem; }
.celebrate-total-xp-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-gold, #F59E0B);
  min-width: 2.5ch;
  text-align: center;
}
.celebrate-total-xp-label {
  font-size: 0.75rem;
  color: var(--text-muted, #888);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Level progress bar */
.celebrate-level-progress { margin: 0 0 0.75rem; }
.celebrate-level-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted, #888);
  margin-bottom: 0.25rem;
  font-weight: 500;
}
.celebrate-level-bar {
  height: 6px;
  background: var(--bg-tertiary, rgba(0,0,0,0.08));
  border-radius: 99px;
  overflow: hidden;
}
.celebrate-level-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary, #3B82F6), var(--color-gold, #F59E0B));
  border-radius: 99px;
  transition: width 1.2s cubic-bezier(0.34, 1.2, 0.64, 1);
}
.celebrate-level-bar-label {
  font-size: 0.68rem;
  color: var(--text-muted, #888);
  margin-top: 0.2rem;
  text-align: center;
}

/* Next suggestion box */
.celebrate-next {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  background: linear-gradient(135deg, rgba(59,130,246,0.06), rgba(139,92,246,0.06));
  border: 1px solid rgba(59,130,246,0.15);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary, #444);
  margin-bottom: 1.25rem;
  line-height: 1.5;
  text-align: left;
}
.celebrate-next-icon { font-size: 1rem; flex-shrink: 0; margin-top: 0.05rem; }

/* Feedback icon styles in game questions */
.feedback-correct-icon,
.feedback-close-icon,
.feedback-wrong-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4em;
  height: 1.4em;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.85em;
  margin-right: 0.25em;
  vertical-align: middle;
}
.feedback-correct-icon {
  background: var(--color-green, #10B981);
  color: #fff;
}
.feedback-close-icon {
  background: var(--color-amber, #F59E0B);
  color: #fff;
}
.feedback-wrong-icon {
  background: var(--color-red, #EF4444);
  color: #fff;
}

/* "Close" feedback state */
.quiz-feedback.close {
  color: var(--color-amber, #d97706);
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.2);
}
.xp-small {
  font-size: 0.82em;
  color: var(--text-muted, #888);
}

/* ============================================
   Mobile QA — Improved touch targets & overflow
   ============================================ */

/* Ensure game option buttons are easy to tap on mobile */
@media (max-width: 600px) {
  .quiz-option {
    min-height: 52px;
    font-size: 0.95rem;
    padding: 0.9rem 1rem;
  }

  .accent-btn {
    min-width: 36px;
    min-height: 36px;
    font-size: 1rem;
  }

  /* Game headers — prevent overflow */
  .game-header {
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  .game-stats {
    font-size: 0.85rem;
    gap: 0.4rem;
  }

  /* Onboarding tooltip — full-width on very small screens */
  .onboard-tooltip {
    max-width: calc(100vw - 1.5rem) !important;
    left: 0.75rem !important;
  }

  /* Celebration card on mobile — scroll handled by main rule now */
  .celebrate-total-xp {
    padding: 0.4rem 0.85rem;
    font-size: 0.85rem;
  }

  /* Nav links — larger tap targets */
  .nav-link {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  /* Fillblank input area — better spacing */
  .fillblank-input-area {
    gap: 0.5rem;
  }

  /* Summary stats — wrap neatly */
  .round-summary-stats {
    gap: 0.75rem;
  }
  .round-stat-value {
    font-size: 1.2rem;
  }
}

/* ============================================
   Onboarding — Mobile nav showcase improvement
   ============================================ */

/* When onboarding highlights mobile nav items,
   keep the tooltip visible above the nav overlay */
.onboard-tooltip {
  z-index: 10002 !important; /* above onboard-backdrop (10001) and nav (9999) */
}

/* Ensure mobile nav is above onboard backdrop */
.nav-mobile.open {
  z-index: 10003 !important;
}

/* ============================================
   Daily Engagement Widget
   ============================================ */

.daily-widget {
  max-width: 900px;
  margin: 0 auto 3rem;
  padding: 0 1rem;
}

.dw-inner {
  background: linear-gradient(135deg,
    var(--bg-secondary) 0%,
    color-mix(in srgb, var(--accent-primary) 6%, var(--bg-secondary)) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1.75rem 2rem;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
  transition: box-shadow 0.25s;
}

.dw-inner:hover {
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

/* Header */
.dw-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.dw-greeting {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.dw-streak {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: linear-gradient(135deg, #ff6b35, #f7c59f);
  color: #fff;
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 2px 8px rgba(255,107,53,0.35);
}

.dw-streak-flame {
  font-size: 1.1rem;
  animation: flame-pulse 1.8s ease-in-out infinite;
}

@keyframes flame-pulse {
  0%, 100% { transform: scale(1) rotate(-3deg); }
  50%       { transform: scale(1.2) rotate(3deg); }
}

[data-reduce-motion="true"] .dw-streak-flame {
  animation: none;
}

.dw-streak-count { font-size: 1.1rem; }
.dw-streak-label { opacity: 0.85; font-size: 0.8rem; }

.dw-streak-placeholder {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Body */
.dw-body {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 520px) {
  .dw-body {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .dw-ring-wrap {
    margin: 0 auto;
  }
}

/* XP Ring */
.dw-ring-wrap {
  position: relative;
  width: 140px;
  height: 140px;
  flex-shrink: 0;
}

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

.dw-ring-bg {
  fill: none;
  stroke: var(--border-color);
  stroke-width: 8;
}

.dw-ring-fill {
  fill: none;
  stroke: var(--accent-primary);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dasharray 0.6s cubic-bezier(.4,0,.2,1);
}

.dw-ring-fill.dw-ring-done {
  stroke: #22c55e;
  filter: drop-shadow(0 0 6px rgba(34,197,94,0.5));
}

.dw-ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  pointer-events: none;
}

.dw-ring-xp {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.dw-ring-sep { display: none; }

.dw-ring-goal {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  line-height: 1.2;
}

.dw-ring-unit {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.dw-ring-check {
  position: absolute;
  bottom: 16px;
  right: 16px;
  width: 22px;
  height: 22px;
  background: #22c55e;
  color: #fff;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(34,197,94,0.4);
}

/* Challenges */
.dw-challenges { min-width: 0; }

.dw-ch-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.dw-ch-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.dw-ch-count {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 0.15rem 0.6rem;
  border-radius: var(--radius-full);
}

.dw-ch-count-done {
  background: #dcfce7;
  color: #16a34a;
}

[data-theme="dark"] .dw-ch-count-done {
  background: rgba(34,197,94,0.15);
  color: #4ade80;
}

.dw-ch-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.dw-ch-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: opacity 0.3s, background 0.2s;
}

.dw-ch-done {
  background: color-mix(in srgb, #22c55e 8%, var(--bg-primary));
  border-color: rgba(34,197,94,0.3);
  opacity: 0.85;
}

.dw-ch-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.dw-ch-info {
  flex: 1;
  min-width: 0;
}

.dw-ch-label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-primary);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dw-ch-done .dw-ch-label {
  text-decoration: line-through;
  opacity: 0.65;
}

.dw-ch-bar {
  height: 3px;
  background: var(--border-color);
  border-radius: 2px;
  margin-top: 0.3rem;
  overflow: hidden;
}

.dw-ch-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary, var(--accent-primary)));
  border-radius: 2px;
  transition: width 0.5s cubic-bezier(.4,0,.2,1);
}

.dw-ch-bonus {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-primary);
  background: color-mix(in srgb, var(--accent-primary) 10%, transparent);
  padding: 0.2rem 0.45rem;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  white-space: nowrap;
}

.dw-ch-check {
  width: 20px;
  height: 20px;
  background: #22c55e;
  color: #fff;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Footer */
.dw-footer {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
}

.dw-cta {
  align-self: stretch;
  text-align: center;
  justify-content: center;
  text-decoration: none;
}

.dw-all-done-msg {
  font-size: 0.82rem;
  color: #16a34a;
  font-weight: 600;
  text-align: center;
  width: 100%;
  margin: 0;
}

[data-theme="dark"] .dw-all-done-msg { color: #4ade80; }

/* ============================================
   Daily System Toasts
   ============================================ */

.toast {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1.1rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s, transform 0.3s;
  max-width: 340px;
  pointer-events: none;
}

.toast.toast-show {
  opacity: 1;
  transform: translateY(0);
}

.toast-icon { font-size: 1.2rem; flex-shrink: 0; }

.toast-bonus {
  display: inline-block;
  background: var(--accent-primary);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
  margin-left: 0.25rem;
}

.toast-success   { border-left: 4px solid #22c55e; }
.toast-challenge { border-left: 4px solid var(--accent-primary); }
.toast-milestone { border-left: 4px solid #f59e0b; background: color-mix(in srgb, #fef3c7 15%, var(--bg-secondary)); }

/* ============================================
   Settings — Daily Goal Picker
   ============================================ */

.setting-goal-picker {
  display: flex;
  gap: 0.5rem;
}

.goal-btn {
  flex: 1;
  padding: 0.6rem 0.5rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  line-height: 1.3;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.goal-btn span {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--accent-primary);
  margin-top: 0.1rem;
}

.goal-btn.active {
  border-color: var(--accent-primary);
  background: color-mix(in srgb, var(--accent-primary) 10%, var(--bg-primary));
  color: var(--accent-primary);
}

.goal-btn:hover:not(.active) {
  border-color: var(--accent-primary);
  background: color-mix(in srgb, var(--accent-primary) 5%, var(--bg-primary));
}

@media (max-width: 420px) {
  .setting-goal-picker { flex-direction: column; }
  .dw-inner { padding: 1.25rem 1rem; }
}

/* ============================================
   XP Pills (inline feedback labels)
   ============================================ */
.xp-pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
  background: color-mix(in srgb, var(--accent-primary) 12%, transparent);
  color: var(--accent-primary);
  margin-left: 0.4rem;
  vertical-align: middle;
}
.xp-pill-close {
  background: rgba(245,158,11,0.12);
  color: #d97706;
}
[data-theme="dark"] .xp-pill-close { color: #fbbf24; }

/* ============================================
   Skill Journey — Celebration Modal Additions
   ============================================ */

/* Skill tracker row */
/* ---- Skill Journey Tracker ---- */

.celebrate-skills {
  margin: 0.75rem 0 0.5rem;
  padding: 0.85rem;
  background: var(--bg-tertiary, #f8f9fa);
  border-radius: 1rem;
  border: 1px solid var(--border-color);
}
[data-theme="dark"] .celebrate-skills { background: rgba(255,255,255,0.04); }

.celebrate-skills-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.celebrate-skills-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

/* Mini SVG ring for skill count */
.celebrate-skills-ring-wrap {
  position: relative;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.celebrate-skills-ring { position: absolute; inset: 0; }
.celebrate-skills-ring-fill {
  transition: stroke-dashoffset 0s; /* animated via JS */
}
.celebrate-skills-ring-text {
  position: relative;
  z-index: 1;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--text-secondary);
  line-height: 1;
}
.celebrate-skills-ring-text small { font-size: 0.55rem; font-weight: 600; color: var(--text-muted); }
.celebrate-skills-done { color: #16a34a; }
[data-theme="dark"] .celebrate-skills-done { color: #4ade80; }

.celebrate-skills-row {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
}

.celebrate-skill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  position: relative;
  width: 58px;
  padding: 0.45rem 0.2rem 0.35rem;
  border-radius: 0.65rem;
  border: 2px solid var(--border-color);
  background: var(--bg-primary);
  opacity: 0.35;
  transform: scale(0.85);
  transition: all 0.35s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.celebrate-active .celebrate-skill {
  animation: skill-pop-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  animation-delay: calc(0.5s + var(--skill-i, 0) * 0.08s);
}
@keyframes skill-pop-in {
  0%   { opacity: 0.35; transform: scale(0.85); }
  100% { opacity: var(--final-opacity, 0.4); transform: scale(1); }
}

.celebrate-skill-covered {
  --final-opacity: 1;
  opacity: 1;
  border-color: #22c55e;
  background: color-mix(in srgb, #22c55e 8%, var(--bg-primary));
}
.celebrate-skill:not(.celebrate-skill-covered) { --final-opacity: 0.4; }

.celebrate-skill-icon { font-size: 1.2rem; line-height: 1; }

.celebrate-skill-label {
  font-size: 0.58rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.1;
}
.celebrate-skill-covered .celebrate-skill-label { color: #16a34a; }
[data-theme="dark"] .celebrate-skill-covered .celebrate-skill-label { color: #4ade80; }

/* Animated SVG checkmark */
.celebrate-skill-check-svg {
  position: absolute;
  top: -6px;
  right: -6px;
  filter: drop-shadow(0 1px 3px rgba(34,197,94,0.5));
}
.celebrate-check-path {
  stroke-dasharray: 20;
  stroke-dashoffset: 20;
}
.celebrate-active .celebrate-check-path {
  animation: check-draw 0.4s ease forwards;
  animation-delay: calc(0.7s + var(--skill-i, 0) * 0.08s);
}
@keyframes check-draw {
  to { stroke-dashoffset: 0; }
}
[data-reduce-motion="true"] .celebrate-check-path { stroke-dashoffset: 0; animation: none; }
[data-reduce-motion="true"] .celebrate-skill { opacity: 0.4; transform: scale(1); animation: none; }
[data-reduce-motion="true"] .celebrate-skill-covered { opacity: 1; }

/* ---- Smart "next" suggestion card ---- */

.celebrate-next-smart {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 0.85rem;
  margin: 0.6rem 0;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--accent-primary) 7%, transparent),
    color-mix(in srgb, #8B5CF6 5%, transparent));
  border: 1px solid color-mix(in srgb, var(--accent-primary) 18%, transparent);
  border-radius: 0.85rem;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  text-align: left;
}
.celebrate-next-smart:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.12);
  border-color: color-mix(in srgb, var(--accent-primary) 35%, transparent);
}

.celebrate-next-skill-icon { font-size: 1.5rem; flex-shrink: 0; }

.celebrate-next-text {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  flex: 1;
  min-width: 0;
}
.celebrate-next-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}
.celebrate-next-nudge {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.celebrate-next-arrow {
  flex-shrink: 0;
  color: var(--text-muted);
  opacity: 0.5;
  transition: transform 0.2s, opacity 0.2s;
}
.celebrate-next-smart:hover .celebrate-next-arrow {
  transform: translateX(3px);
  opacity: 1;
}

/* ---- CTA Buttons ---- */

.celebrate-actions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.5rem;
}

.celebrate-cta-primary {
  background: var(--accent-primary);
  color: #fff;
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 0.75rem;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 2px 12px color-mix(in srgb, var(--accent-primary) 30%, transparent);
}
.celebrate-cta-primary:hover {
  background: var(--accent-dark, #1a3a6e);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px color-mix(in srgb, var(--accent-primary) 40%, transparent);
}
.celebrate-cta-primary:active { transform: translateY(0); }

.celebrate-cta-secondary {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  padding: 0.55rem 1.5rem;
  border-radius: 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.celebrate-cta-secondary:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

/* ---- Full Circle celebration ---- */

.celebrate-full-circle {
  text-align: center;
  padding: 0.75rem 0;
}
.celebrate-fc-badge {
  font-size: 2.2rem;
  margin-bottom: 0.4rem;
  animation: fc-pulse 1.5s ease-in-out infinite;
}
@keyframes fc-pulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.15) rotate(5deg); }
}
[data-reduce-motion="true"] .celebrate-fc-badge { animation: none; }

.celebrate-fc-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
}
.celebrate-fc-msg {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.6rem;
}
.celebrate-fc-tomorrow {
  font-size: 0.78rem;
  color: var(--accent-primary);
  font-weight: 600;
  padding: 0.5rem 0.85rem;
  background: color-mix(in srgb, var(--accent-primary) 8%, transparent);
  border-radius: 0.65rem;
  display: inline-block;
}

/* ---- Mobile tweaks ---- */
@media (max-width: 420px) {
  .celebrate-skills-row { gap: 0.25rem; }
  .celebrate-skill { width: 50px; padding: 0.3rem 0.1rem 0.25rem; }
  .celebrate-skill-icon { font-size: 1.05rem; }
  .celebrate-skill-label { font-size: 0.52rem; }
  .celebrate-next-smart { flex-direction: column; text-align: center; gap: 0.35rem; }
  .celebrate-next-arrow { display: none; }
}

/* ============================================
   Travel French — Landing, Scenarios, Games
   ============================================ */

/* ---- Travel accent overrides ---- */
[data-section="travel"] {
  --accent-primary: #d97706;
  --accent-hover:   #b45309;
  --accent-gradient: linear-gradient(135deg, #d97706 0%, #dc4f00 50%, #9333ea 100%);
}

/* ---- Travel nav pill ---- */
.nav-link--travel { position: relative; }
.nav-link--travel::after {
  content: 'NEW';
  position: absolute;
  top: -6px; right: -8px;
  background: #d97706;
  color: #fff;
  font-size: 0.48rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 1px 4px;
  border-radius: 999px;
  pointer-events: none;
}

/* ---- Travel Hero ---- */
.travel-landing { min-height: 100vh; }

.travel-hero {
  background: linear-gradient(135deg, #1e3a5f 0%, #1a2744 40%, #2d1b4e 100%);
  padding: 5rem 1.5rem 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.travel-hero::before {
  content: '✈️ 🗼 🍷 🥐 🗺️ 🏰 🍽️ 🚆';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  font-size: 3rem;
  opacity: 0.05;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 1.5rem;
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
}
.travel-hero-inner { position: relative; max-width: 680px; margin: 0 auto; }
.travel-section-label {
  display: inline-block;
  background: rgba(217,119,6,0.2);
  border: 1px solid rgba(217,119,6,0.4);
  color: #fbbf24;
  padding: 0.3rem 1rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}
.travel-hero-title {
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 900;
  color: #fff;
  line-height: 1.1;
  margin-bottom: 1rem;
}
.travel-gradient-text {
  background: linear-gradient(135deg, #fbbf24, #f59e0b, #d97706);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.travel-hero-subtitle {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.75);
  max-width: 520px;
  margin: 0 auto 2rem;
  line-height: 1.6;
}
.travel-hero-cta { margin-bottom: 1.5rem; }
.travel-hero-cta .btn-lg { padding: 0.85rem 2rem; font-size: 1.05rem; }
.travel-exam-link {
  color: rgba(255,255,255,0.5);
  font-size: 0.85rem;
  text-decoration: none;
  transition: color 0.2s;
}
.travel-exam-link:hover { color: rgba(255,255,255,0.8); }

/* ---- Scenario Grid ---- */
.travel-scenarios-section {
  max-width: 900px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}
.travel-section-heading {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}
.travel-section-sub {
  color: var(--text-secondary);
  margin-bottom: 2rem;
}
.travel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.travel-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.travel-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  border-color: #d97706;
}
.travel-card-icon {
  font-size: 2.2rem;
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, rgba(217,119,6,0.12), rgba(217,119,6,0.04));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}
.travel-card-info { flex: 1; min-width: 0; }
.travel-card-info h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.15rem; }
.travel-card-french { font-size: 0.78rem; color: #d97706; font-weight: 600; margin-bottom: 0.25rem; font-style: italic; }
.travel-card-desc { font-size: 0.78rem; color: var(--text-secondary); line-height: 1.4; }
.travel-card-arrow { color: var(--text-muted); font-size: 1.1rem; flex-shrink: 0; }

/* ---- Why Travel French section ---- */
.travel-why-section {
  background: var(--bg-secondary);
  padding: 3rem 1.5rem;
}
.travel-why-inner { max-width: 900px; margin: 0 auto; }
.travel-why-inner h2 { font-size: 1.6rem; font-weight: 800; margin-bottom: 2rem; color: var(--text-primary); }
.travel-why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 1rem;
}
.travel-why-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.25rem;
}
.travel-why-icon { font-size: 1.8rem; margin-bottom: 0.75rem; }
.travel-why-card h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.35rem; }
.travel-why-card p { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.5; }

/* ---- Travel Game Select ---- */
.travel-game-select { max-width: 720px; margin: 0 auto; padding: 1.5rem; }
.travel-game-featured, .travel-game-core { margin-bottom: 2rem; }
.travel-game-featured-label, .travel-game-core-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}
.travel-game-featured-label { color: #d97706; }
.travel-game-card--featured {
  border: 1px solid rgba(217,119,6,0.35) !important;
  background: linear-gradient(135deg, rgba(217,119,6,0.06), rgba(217,119,6,0.02)) !important;
}
.travel-game-card--featured:hover {
  border-color: #d97706 !important;
  box-shadow: 0 4px 20px rgba(217,119,6,0.15) !important;
}

/* ---- Dialogue Game ---- */
.dlg-page { max-width: 640px; margin: 0 auto; padding-bottom: 2rem; }
.dlg-chat {
  padding: 1rem 1.25rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 46vh;
  overflow-y: auto;
}
.dlg-bubble {
  max-width: 80%;
  animation: dlgBubbleIn 0.25s ease;
}
@keyframes dlgBubbleIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.dlg-bubble--speaker { align-self: flex-start; }
.dlg-bubble--player  { align-self: flex-end; }
.dlg-bubble-name {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.25rem;
  opacity: 0.6;
}
.dlg-bubble--player .dlg-bubble-name { text-align: right; }
.dlg-bubble-text {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px 16px 16px 4px;
  padding: 0.7rem 1rem;
  font-size: 0.95rem;
  line-height: 1.45;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.dlg-bubble--player .dlg-bubble-text {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-primary);
  border-radius: 16px 16px 4px 16px;
}
.dlg-bubble--pending .dlg-bubble-text {
  background: transparent;
  border-style: dashed;
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.85rem;
}
.dlg-bubble-trans {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
  padding: 0 0.25rem;
  font-style: italic;
}
.dlg-bubble--player .dlg-bubble-trans { text-align: right; }
.dlg-speak {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-size: 0.9rem;
  opacity: 0.7;
  flex-shrink: 0;
}
.dlg-speak:hover { opacity: 1; }
.dlg-bubble--active .dlg-bubble-text {
  box-shadow: 0 0 0 2px var(--accent-primary);
}
.dlg-choices {
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.dlg-choice {
  width: 100%;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.8rem 1.1rem;
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.dlg-choice:hover:not(:disabled) { border-color: var(--accent-primary); background: var(--bg-hover); }
.dlg-choice--correct  { background: #dcfce7 !important; border-color: #16a34a !important; color: #15803d; }
.dlg-choice--wrong    { background: #fee2e2 !important; border-color: #dc2626 !important; color: #b91c1c; }
.dlg-choice--reveal   { background: #fef9c3 !important; border-color: #ca8a04 !important; color: #854d0e; }
.dlg-continue-wrap { padding: 1rem 1.25rem; }
.dlg-continue-wrap .btn { width: 100%; }
.dlg-speak-hint { font-size: 0.75rem; opacity: 0.7; margin-left: 0.5rem; }
.dlg-between {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 4rem 1.5rem;
  text-align: center;
}
.dlg-between-icon { font-size: 3.5rem; }

/* Dark mode dialogue adjustments */
[data-theme="dark"] .dlg-bubble-text {
  background: var(--bg-card);
  border-color: var(--border);
  color: var(--text-primary);
}
[data-theme="dark"] .dlg-bubble--player .dlg-bubble-text {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #fff;
}
[data-theme="dark"] .dlg-bubble--pending .dlg-bubble-text {
  background: transparent;
  color: var(--text-muted);
}
[data-theme="dark"] .dlg-choice--correct { background: rgba(22,163,74,0.2)  !important; border-color: #16a34a !important; color: #4ade80; }
[data-theme="dark"] .dlg-choice--wrong   { background: rgba(220,38,38,0.2)  !important; border-color: #dc2626 !important; color: #fca5a5; }
[data-theme="dark"] .dlg-choice--reveal  { background: rgba(202,138,4,0.2)  !important; border-color: #ca8a04 !important; color: #fde68a; }

/* ---- Situation Game ---- */
.sit-page { max-width: 640px; margin: 0 auto; padding-bottom: 2rem; }
.sit-card {
  margin: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}
.sit-scenario-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #d97706;
  margin-bottom: 0.75rem;
}
.sit-prompt {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}
.sit-input-wrap { display: flex; gap: 0.6rem; margin-bottom: 0.75rem; }
.sit-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-input, var(--bg-secondary));
  color: var(--text-primary);
  font-size: 1rem;
  transition: border-color 0.15s;
}
.sit-input:focus { outline: none; border-color: var(--accent-primary); }
.sit-input:disabled { opacity: 0.65; }
.sit-submit { flex-shrink: 0; }
.sit-hint-wrap { margin-bottom: 1rem; }
.sit-hint-btn {
  background: none;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.75rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
}
.sit-hint-btn:hover { border-color: var(--accent-primary); color: var(--accent-primary); }
.sit-hint-text {
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: rgba(217,119,6,0.08);
  border-left: 3px solid #d97706;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-style: italic;
}
.sit-feedback { border-radius: var(--radius-sm); padding: 0.75rem 1rem; font-size: 0.88rem; }
.sit-feedback--correct {
  background: #dcfce7; color: #15803d; border: 1px solid #86efac;
}
.sit-feedback--close {
  background: #fef9c3; color: #854d0e; border: 1px solid #fde047;
}
.sit-feedback--wrong {
  background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5;
}
.sit-feedback span { font-weight: 700; font-style: italic; }
[data-theme="dark"] .sit-feedback--correct { background: rgba(22,163,74,0.15); border-color: rgba(22,163,74,0.3); }
[data-theme="dark"] .sit-feedback--close   { background: rgba(202,138,4,0.15);  border-color: rgba(202,138,4,0.3); }
[data-theme="dark"] .sit-feedback--wrong   { background: rgba(220,38,38,0.15);  border-color: rgba(220,38,38,0.3); }

/* ---- Cultural Tip callout (shown in flashcard back) ---- */
.fc-cultural-tip {
  margin-top: 0.75rem;
  padding: 0.6rem 0.9rem;
  background: rgba(217,119,6,0.1);
  border-left: 3px solid #d97706;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.45;
}
.fc-cultural-tip::before {
  content: '🏛️ ';
  font-style: normal;
}

/* ---- Responsive ---- */
@media (max-width: 480px) {
  .travel-hero { padding: 3.5rem 1rem 3rem; }
  .travel-grid { grid-template-columns: 1fr; }
  .travel-why-grid { grid-template-columns: 1fr 1fr; }
  .dlg-bubble { max-width: 92%; }
  .sit-input-wrap { flex-direction: column; }
  .sit-submit { width: 100%; }
}

/* ============================================
   Mock Exam Styles
   ============================================ */

/* ---- Exam Cards (Landing) ---- */
.exam-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.exam-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.exam-card-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.75rem;
}
.exam-card-icon {
  font-size: 2.25rem;
  line-height: 1;
  flex-shrink: 0;
}
.exam-card-meta {
  flex: 1;
}
.exam-card-meta h3 {
  margin: 0 0 0.2rem;
  font-size: 1.15rem;
}
.exam-card-audience {
  font-size: 0.825rem;
  color: var(--text-muted);
}
.exam-card-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0 0 1rem;
  line-height: 1.5;
}
.exam-grade-badge {
  display: inline-block;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}
.exam-card-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.exam-section-chip {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 500;
}
.exam-card-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ---- Exam Intro ---- */
.exam-intro-header {
  text-align: center;
  margin: 1.5rem 0 2rem;
}
.exam-intro-icon {
  font-size: 3.5rem;
  margin-bottom: 0.75rem;
}
.exam-intro-header h2 {
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
}
.exam-intro-subtitle {
  color: var(--text-muted);
  max-width: 500px;
  margin: 0 auto;
  line-height: 1.5;
}
.exam-sections-overview {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 1.5rem;
}
.exam-section-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
}
.exam-section-row:last-child { border-bottom: none; }
.exam-section-row--total {
  background: var(--bg-tertiary);
  font-weight: 600;
}
.exam-section-row-icon { font-size: 1.25rem; }
.exam-section-row-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.exam-section-row-info strong { font-size: 0.95rem; }
.exam-section-row-info span { font-size: 0.825rem; color: var(--text-muted); }

.exam-resume-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

/* ---- Mode Choose Header ---- */
.exam-mode-choose-header {
  text-align: center;
  margin: 1.75rem 0 1rem;
}
.exam-mode-choose-header h3 {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
  font-weight: 700;
}
.exam-mode-choose-header p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0;
}

/* ---- Mode Cards ---- */
.exam-mode-cards {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.exam-mode-card {
  position: relative;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.25rem 1rem;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.1s;
  text-align: left;
  display: flex;
  flex-direction: column;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.exam-mode-card:hover {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb, 59, 130, 246), 0.1);
}
.exam-mode-card:active {
  transform: scale(0.985);
}
.exam-mode-card--selected {
  border-color: var(--accent-primary);
  background: rgba(var(--accent-rgb, 59, 130, 246), 0.05);
}
.exam-mode-card--recommended {
  border-color: var(--color-green, #16A34A);
}
.exam-mode-card--recommended:hover {
  border-color: var(--color-green, #16A34A);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12);
}
.exam-mode-recommended-badge {
  position: absolute;
  top: -0.6rem;
  left: 1.25rem;
  background: var(--color-green, #16A34A);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.75rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.exam-mode-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.exam-mode-icon { font-size: 1.75rem; flex-shrink: 0; }
.exam-mode-card-header > div { display: flex; flex-direction: column; gap: 0.2rem; }
.exam-mode-card h3 { margin: 0; font-size: 1.05rem; }
.exam-mode-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.1rem 0.55rem;
  border-radius: var(--radius-full);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.exam-mode-tag--practice {
  background: rgba(22, 163, 74, 0.12);
  color: #16A34A;
}
.exam-mode-tag--timed {
  background: rgba(234, 88, 12, 0.1);
  color: #EA580C;
}
.exam-mode-description { font-size: 0.85rem; color: var(--text-muted); margin: 0.5rem 0 0.75rem; line-height: 1.55; }
.exam-mode-card p { font-size: 0.85rem; color: var(--text-muted); margin: 0 0 0.75rem; line-height: 1.5; }
.exam-mode-features {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  font-size: 0.825rem;
  color: var(--text-secondary);
}
.exam-mode-features li { padding: 0.2rem 0; }
.exam-mode-start-btn {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: filter 0.15s, transform 0.1s;
  background: var(--accent-primary);
  color: white;
  letter-spacing: -0.01em;
  margin-top: auto;
}
.exam-mode-card--recommended .exam-mode-start-btn {
  background: var(--color-green, #16A34A);
}
.exam-mode-start-btn--timed {
  background: #EA580C;
}
.exam-mode-start-btn:hover {
  filter: brightness(1.1);
}
.exam-mode-start-btn:active {
  transform: scale(0.97);
}

/* ---- Timer Bar ---- */
.exam-timer-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 0.4rem 1.25rem;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  font-weight: 600;
}
.exam-timer-display { font-variant-numeric: tabular-nums; font-size: 1.1rem; }
.exam-timer-label { font-size: 0.8rem; color: var(--text-muted); }
.exam-timer-warning {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.4);
  color: #B45309;
}
.exam-timer-critical {
  background: rgba(220, 38, 38, 0.1);
  border-color: rgba(220, 38, 38, 0.4);
  color: #DC2626;
  animation: timerPulse 1s ease-in-out infinite;
}
@keyframes timerPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.6; }
}

/* ---- Progress Bar ---- */
.exam-progress-bar-wrap {
  position: relative;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  margin-bottom: 1.25rem;
  overflow: visible;
}
.exam-progress-bar-inner {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary, #8B5CF6));
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
  min-width: 2px;
}
.exam-progress-label {
  position: absolute;
  right: 0;
  top: -1.4rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ---- Section Intro ---- */
.exam-section-intro { text-align: center; padding: 1rem 0; }
.exam-section-intro-num {
  font-size: 0.825rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  font-weight: 600;
}
.exam-section-intro-icon { font-size: 3rem; margin-bottom: 0.5rem; }
.exam-section-intro h2 { margin: 0 0 0.75rem; }
.exam-section-stats {
  display: flex;
  gap: 1.25rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}
.exam-instructions-box {
  background: rgba(var(--accent-rgb, 59, 130, 246), 0.06);
  border: 1px solid rgba(var(--accent-rgb, 59, 130, 246), 0.2);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.55;
  text-align: left;
  max-width: 520px;
  margin: 0 auto;
}

/* ---- Question Card ---- */
.exam-question-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.exam-question-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.25rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  font-size: 0.825rem;
}
.exam-question-section { color: var(--text-muted); font-weight: 500; }
.exam-question-marks {
  background: var(--accent-primary);
  color: white;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.78rem;
}
.exam-question-body {
  padding: 1.5rem;
}
.exam-question-text {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.6;
  margin-bottom: 1.25rem;
  color: var(--text-primary);
}

/* ---- Passage Box ---- */
.exam-passage-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  line-height: 1.7;
  white-space: pre-line;
}
.exam-passage-title {
  font-weight: 700;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  color: var(--accent-primary);
}

/* Scene-setting line above a passage ("On Belgian radio, you hear…") */
.exam-passage-context {
  font-size: 0.9rem;
  font-style: italic;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  line-height: 1.5;
}
.exam-passage-context .exam-passage-title {
  font-style: normal;
  margin-bottom: 0.25rem;
}

/* ---- Audio Player ---- */
.exam-audio-player {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.875rem 1.125rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.exam-audio-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent-primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.5rem 1.125rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}
.exam-audio-btn:hover { opacity: 0.85; }
.exam-audio-icon { font-size: 1.1rem; }
.exam-audio-hint { font-size: 0.78rem; color: var(--text-muted); line-height: 1.4; }

/* ---- MCQ Options ---- */
.exam-mcq-options {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.exam-mcq-option {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.875rem 1rem;
  cursor: pointer;
  text-align: left;
  font-size: 0.9rem;
  transition: border-color 0.15s, background 0.15s;
  width: 100%;
}
.exam-mcq-option:hover:not([data-answered="true"]) {
  border-color: var(--accent-primary);
  background: rgba(var(--accent-rgb, 59, 130, 246), 0.05);
}
.exam-mcq-option.correct {
  border-color: #16A34A;
  background: rgba(22, 163, 74, 0.08);
  color: #15803D;
}
.exam-mcq-option.wrong {
  border-color: #DC2626;
  background: rgba(220, 38, 38, 0.06);
  color: #B91C1C;
}
.exam-mcq-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--bg-tertiary);
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
}
.exam-mcq-text { line-height: 1.45; }

/* ---- Gap Fill ---- */
.exam-gap-fill {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}
.exam-text-input {
  flex: 1;
  min-width: 160px;
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.7rem 1rem;
  font-size: 1rem;
  color: var(--text-primary);
  transition: border-color 0.2s;
}
.exam-text-input:focus {
  outline: none;
  border-color: var(--accent-primary);
}
.exam-feedback {
  margin-top: 0.75rem;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
}
.exam-feedback--correct {
  background: rgba(22, 163, 74, 0.1);
  color: #15803D;
  border: 1px solid rgba(22, 163, 74, 0.3);
}
.exam-feedback--wrong {
  background: rgba(220, 38, 38, 0.08);
  color: #B91C1C;
  border: 1px solid rgba(220, 38, 38, 0.25);
}
.exam-explanation {
  margin-top: 0.75rem;
  padding: 0.65rem 1rem;
  background: rgba(var(--accent-rgb, 59, 130, 246), 0.06);
  border: 1px solid rgba(var(--accent-rgb, 59, 130, 246), 0.2);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

/* ---- Translation / Self-mark ---- */
.exam-textarea {
  width: 100%;
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.875rem 1rem;
  font-size: 0.95rem;
  color: var(--text-primary);
  font-family: inherit;
  resize: vertical;
  min-height: 100px;
  margin-bottom: 0.875rem;
  box-sizing: border-box;
  line-height: 1.55;
  transition: border-color 0.2s;
}
.exam-textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
}
.exam-hints {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(245, 158, 11, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
}
.exam-hints ul { margin: 0.5rem 0 0; padding-left: 1.25rem; }
.exam-hints li { margin-bottom: 0.25rem; color: var(--text-secondary); }
.exam-model-answer {
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(22, 163, 74, 0.06);
  border: 1px solid rgba(22, 163, 74, 0.25);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
}
.exam-model-answer-text {
  margin-top: 0.5rem;
  line-height: 1.6;
  color: #15803D;
  font-style: italic;
}
.exam-mark-scheme {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(22, 163, 74, 0.2);
  font-size: 0.825rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
.exam-self-mark-controls {
  margin-top: 1rem;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}
.exam-self-mark-controls p {
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
}
.exam-self-mark-buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.btn-self-full {
  background: rgba(22, 163, 74, 0.12);
  color: #15803D;
  border: 1px solid rgba(22, 163, 74, 0.35);
}
.btn-self-full:hover { background: rgba(22, 163, 74, 0.22); }
.btn-self-half {
  background: rgba(245, 158, 11, 0.12);
  color: #B45309;
  border: 1px solid rgba(245, 158, 11, 0.35);
}
.btn-self-half:hover { background: rgba(245, 158, 11, 0.22); }
.btn-self-none {
  background: rgba(220, 38, 38, 0.08);
  color: #B91C1C;
  border: 1px solid rgba(220, 38, 38, 0.3);
}
.btn-self-none:hover { background: rgba(220, 38, 38, 0.16); }
.btn-sm { padding: 0.45rem 0.875rem; font-size: 0.85rem; border-radius: var(--radius-md); cursor: pointer; font-weight: 600; transition: background 0.15s; }

/* ---- Section Complete ---- */
.exam-section-complete { text-align: center; padding: 1.5rem 0; }
.exam-section-complete-icon { font-size: 3.5rem; margin-bottom: 0.5rem; }
.exam-section-complete h2 { margin: 0 0 0.35rem; }
.exam-section-complete-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0 0 1.25rem;
}
.exam-questions-correct {
  display: inline-block;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 0.3rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}
.exam-questions-correct--perfect {
  background: rgba(22, 163, 74, 0.1);
  border-color: rgba(22, 163, 74, 0.35);
  color: #16A34A;
}
.exam-section-partial-note {
  background: rgba(59, 130, 246, 0.07);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: var(--radius-md);
  padding: 0.65rem 1rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  max-width: 420px;
  margin: 0 auto 0.75rem;
  line-height: 1.5;
}
.exam-score-circle {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 5px solid var(--score-color, #16A34A);
  margin: 0 auto 1.25rem;
  background: color-mix(in srgb, var(--score-color, #16A34A) 8%, transparent);
}
.exam-score-circle-val { font-size: 1.35rem; font-weight: 700; line-height: 1.1; }
.exam-score-circle-pct { font-size: 0.825rem; color: var(--text-muted); }
.exam-section-coach {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.875rem 1rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.55;
  max-width: 480px;
  margin: 0 auto;
  text-align: left;
}

/* ---- Report ---- */
.exam-report { }
.exam-report-grade-card {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: var(--bg-card);
  border: 2px solid;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.exam-report-grade-num {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1;
  flex-shrink: 0;
}
.exam-report-grade-info { flex: 1; }
.exam-report-grade-label { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.25rem; }
.exam-report-grade-score { font-size: 0.95rem; color: var(--text-secondary); }
.exam-report-xp {
  background: rgba(245, 158, 11, 0.15);
  color: #B45309;
  border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 1rem;
  white-space: nowrap;
}
.exam-report-sections {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.exam-report-section-row { }
.exam-report-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
}
.exam-report-section-bar {
  height: 10px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.exam-report-section-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---- Coaching Plan ---- */
.exam-coaching-plan {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.exam-coaching-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
}
.exam-coaching-priority {
  flex-shrink: 0;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.15rem;
}
.exam-coaching-priority--high { background: rgba(220,38,38,0.12); color: #B91C1C; }
.exam-coaching-priority--mid  { background: rgba(245,158,11,0.12); color: #B45309; }
.exam-coaching-priority--low  { background: rgba(59,130,246,0.12); color: #1D4ED8; }
.exam-coaching-content { flex: 1; }
.exam-coaching-content strong { display: block; font-size: 0.9rem; margin-bottom: 0.35rem; }
.exam-coaching-content p { font-size: 0.85rem; color: var(--text-secondary); margin: 0 0 0.5rem; line-height: 1.5; }
.exam-coaching-action {
  font-size: 0.8rem;
  color: var(--accent-primary);
  font-weight: 600;
}

/* ---- Next Steps ---- */
.exam-next-steps {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 2rem;
}
.exam-next-list {
  margin: 0;
  padding-left: 1.25rem;
}
.exam-next-list li {
  margin-bottom: 0.6rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
.exam-next-list li:last-child { margin-bottom: 0; }

/* ---- Report Actions ---- */
.exam-report-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
  padding-top: 0.5rem;
}

/* ---- Mobile ---- */
@media (max-width: 580px) {
  .exam-mode-cards { grid-template-columns: 1fr; }
  .exam-card-header { flex-wrap: wrap; }
  .exam-report-grade-card { flex-wrap: wrap; gap: 0.75rem; }
  .exam-report-grade-num { font-size: 2.75rem; }
  .exam-coaching-item { flex-wrap: wrap; }
  .exam-self-mark-buttons { flex-direction: column; }
  .btn-sm { width: 100%; text-align: center; }
  .exam-report-actions { flex-direction: column; }
  .exam-report-actions .btn { width: 100%; text-align: center; }
  .exam-score-circle { width: 100px; height: 100px; }
  .exam-gap-fill { flex-direction: column; }
  .exam-text-input { width: 100%; }
}

/* ============================================
   Listening: one recording per screen, real exam conditions
   ============================================ */
.exam-real-listening-note {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  text-align: left;
  padding: 0.85rem 1rem;
  margin: 0 0 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid color-mix(in srgb, var(--accent-primary) 35%, transparent);
  background: color-mix(in srgb, var(--accent-primary) 7%, transparent);
  font-size: 0.9rem;
  line-height: 1.5;
}
.exam-real-listening-note > span { font-size: 1.4rem; line-height: 1; }

.lx-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 1.25rem;
  text-align: left;
}
.lx-choices-label { grid-column: 1 / -1; font-weight: 600; }
.lx-choice {
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  cursor: pointer;
  background: var(--bg-secondary);
  transition: border-color 0.15s, background 0.15s;
}
.lx-choice:hover, .lx-choice:focus-visible { border-color: var(--accent-primary); outline: none; }
.lx-choice--selected {
  border-color: var(--accent-primary);
  background: color-mix(in srgb, var(--accent-primary) 8%, transparent);
}
.lx-choice-title { font-weight: 700; margin-bottom: 0.3rem; }
.lx-choice--selected .lx-choice-title::after { content: ' ✓'; color: var(--accent-primary); }
.lx-choice-text { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.45; }
@media (max-width: 560px) { .lx-choices { grid-template-columns: 1fr; } }

.lx-shell { max-width: 1120px; margin: 0 auto; padding: 1rem 1rem 1.5rem; }
.lx-card { padding: 1rem 1.25rem; }
.lx-card .exam-passage-context { margin-bottom: 0.6rem; }

.lx-player {
  position: sticky;
  top: calc(var(--header-height, 64px) + 0.25rem);
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.9rem;
  margin-bottom: 0.85rem;
}
.lx-player--exam { flex-direction: column; align-items: stretch; gap: 0.35rem; }
.lx-stages { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem; font-size: 0.78rem; }
.lx-stage {
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}
.lx-stage.done { color: var(--text-secondary); opacity: 0.7; }
.lx-stage.active {
  color: #fff;
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  font-weight: 600;
}
.lx-stage-sep { color: var(--text-muted); }
.lx-status { font-weight: 600; display: flex; gap: 0.6rem; flex-wrap: wrap; }
.lx-countdown { font-variant-numeric: tabular-nums; color: var(--accent-primary); }

.lx-questions { display: grid; grid-template-columns: 1fr; gap: 0.75rem; }
@media (min-width: 900px) {
  .lx-questions { grid-template-columns: 1fr 1fr; }
}
.lx-questions--dictation { grid-template-columns: 1fr !important; }
.lx-q {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.75rem;
  background: var(--bg-primary, transparent);
}
.lx-q--current { border-color: var(--accent-primary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-primary) 25%, transparent); }
.lx-q-head { display: flex; gap: 0.5rem; align-items: baseline; margin-bottom: 0.45rem; flex-wrap: wrap; }
.lx-q-num { font-weight: 700; color: var(--accent-primary); min-width: 1rem; }
.lx-q-text { flex: 1 1 12rem; font-weight: 600; line-height: 1.4; font-size: 0.92rem; }
.lx-q-marks { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; margin-left: auto; }
.lx-options { display: flex; flex-direction: column; gap: 0.3rem; }
.lx-option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  text-align: left;
  padding: 0.4rem 0.6rem;
  font-size: 0.86rem;
  line-height: 1.35;
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm, 8px);
  cursor: pointer;
  color: inherit;
}
.lx-option .exam-mcq-letter { width: 22px; height: 22px; font-size: 0.72rem; }
.lx-option:hover { border-color: var(--accent-primary); }
.lx-option.selected {
  border-color: var(--accent-primary);
  background: color-mix(in srgb, var(--accent-primary) 10%, transparent);
  font-weight: 600;
}
.lx-option.selected .exam-mcq-letter { background: var(--accent-primary); color: #fff; }
/* After "Check answers": the right option in green with a tick, the
   student's wrong choice in red with a cross, whatever was selected. */
.lx-option.correct,
.lx-option.selected.correct { border-color: #16A34A; background: rgba(22, 163, 74, 0.14); font-weight: 600; }
.lx-option.wrong,
.lx-option.selected.wrong { border-color: #DC2626; background: rgba(220, 38, 38, 0.12); }
.lx-option.correct .exam-mcq-letter { background: #16A34A; color: #fff; }
.lx-option.wrong .exam-mcq-letter { background: #DC2626; color: #fff; }
.lx-option.correct::after,
.lx-option.wrong::after { margin-left: auto; font-weight: 800; font-size: 1rem; }
.lx-option.correct::after { content: "✓"; color: #16A34A; }
.lx-option.wrong::after { content: "✗"; color: #DC2626; }
.lx-q--right { box-shadow: inset 4px 0 0 #16A34A; }
.lx-q--part { box-shadow: inset 4px 0 0 #D97706; }
.lx-q--wrong { box-shadow: inset 4px 0 0 #DC2626; }
.lx-verdict { display: block; font-size: 0.9rem; font-weight: 600; }
.lx-verdict--right { color: #15803D; }
.lx-verdict--wrong { color: #B91C1C; }
.lx-verdict--part { color: #B45309; }
.lx-explanation { margin-top: 0.25rem; }
.lx-score {
  margin-top: 1rem;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 1rem;
  text-align: center;
  border: 2px solid;
}
.lx-score--right { border-color: #16A34A; background: rgba(22, 163, 74, 0.1); }
.lx-score--part { border-color: #D97706; background: rgba(217, 119, 6, 0.1); }
.lx-score--wrong { border-color: #DC2626; background: rgba(220, 38, 38, 0.08); }

/* Accent keyboard under every box where French is typed */
.exam-accent-keys {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0.6rem 0;
}
.exam-accent-key {
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.4rem;
  border: 1px solid color-mix(in srgb, var(--text-primary) 22%, transparent);
  border-radius: var(--radius-sm, 8px);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font: inherit;
  font-size: 1.05rem;
  cursor: pointer;
}
.exam-accent-key:hover { border-color: var(--accent-primary); }
.exam-accent-shift.active { background: var(--accent-primary); color: #fff; border-color: var(--accent-primary); }
.exam-accent-keys[hidden] { display: none; }
/* The dictation has several boxes: the keys sit just above sentence 1 and stay
   pinned under the site header while the candidate scrolls to the later ones. */
/* overflow: clip still rounds the corners but, unlike hidden, lets sticky work. */
.lx-card { overflow: clip; }
.lx-card .exam-accent-keys {
  position: sticky;
  top: var(--header-height, 64px);
  z-index: 2;
  justify-content: center;
  margin: 0 0 0.75rem;
  padding: 0.5rem;
  background: var(--bg-card, var(--bg-primary, #fff));
  border-bottom: 1px solid color-mix(in srgb, var(--text-primary) 12%, transparent);
}
/* Real exam conditions: the keys ride inside the pinned player, under the countdown. */
.lx-card .lx-player .exam-accent-keys {
  position: static;
  margin: 0.25rem 0 0;
  padding: 0.4rem 0 0;
  background: none;
}
.lx-dict-hint { margin: 0 0 0.6rem; }
.lx-feedback { margin-top: 0.45rem; font-size: 0.82rem; color: var(--text-secondary); line-height: 1.45; }
.lx-dict-play { display: inline-flex; gap: 0.4rem; margin-left: auto; }
.lx-dict-input { width: 100%; font-size: 1rem; }
.lx-dict-instructions { text-align: left; margin-bottom: 0.75rem; font-size: 0.88rem; }
.dict-expected { font-size: 0.95rem; line-height: 1.6; }
.dict-ok { color: #15803D; }
.dict-miss { color: #B91C1C; text-decoration: underline wavy; }
.dict-note { margin-top: 0.2rem; }
.lx-actions { display: flex; justify-content: flex-end; margin-top: 1rem; }
.lx-actions .btn:disabled { opacity: 0.45; cursor: not-allowed; }
.lx-shell [hidden] { display: none !important; }

/* End of the listening section: every answer, ticked or crossed */
.exam-breakdown { text-align: left; margin-top: 1.25rem; }
.exam-breakdown > summary { cursor: pointer; font-weight: 700; margin-bottom: 0.5rem; }
.exam-bd-passage { margin-top: 0.75rem; }
.exam-bd-head { font-weight: 700; font-size: 0.9rem; margin-bottom: 0.3rem; }
.exam-bd-passage ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.exam-bd-item {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm, 8px);
  border-left: 4px solid;
  background: var(--bg-secondary);
  font-size: 0.86rem;
  line-height: 1.45;
}
.exam-bd-item--right { border-color: #16A34A; }
.exam-bd-item--part { border-color: #D97706; }
.exam-bd-item--wrong { border-color: #DC2626; }
.exam-bd-mark { font-weight: 800; width: 1rem; }
.exam-bd-item--right .exam-bd-mark { color: #16A34A; }
.exam-bd-item--part .exam-bd-mark { color: #D97706; }
.exam-bd-item--wrong .exam-bd-mark { color: #DC2626; }
.exam-bd-num { font-weight: 700; color: var(--accent-primary); }
.exam-bd-body { flex: 1; }
.exam-bd-q { font-weight: 600; }
.exam-bd-score { font-weight: 700; white-space: nowrap; }
