/**
 * Paril – Page Styles
 * Page-specific styles for all app views.
 */

/* ============================================================
   PAGE WRAPPER
   ============================================================ */

.page {
  min-height: calc(100vh - var(--nav-height));
  min-height: calc(100dvh - var(--nav-height));
  padding: var(--page-padding);
  padding-top: var(--space-6);
  padding-bottom: calc(var(--nav-height) + var(--space-6));
  animation: fadeIn var(--duration-base) var(--ease-decelerate) both;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
}

.page-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--weight-black);
  color: var(--text-primary);
  line-height: var(--line-tight);
}

.page-subtitle {
  font-size: var(--text-base);
  color: var(--text-secondary);
  margin-top: var(--space-1);
}

/* ============================================================
   ONBOARDING
   ============================================================ */

.onboarding-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: calc(var(--space-6) + env(safe-area-inset-top, 0px)) var(--page-padding) calc(var(--space-6) + env(safe-area-inset-bottom, 0px));
  background: var(--gradient-onboarding);
}

.page-onboarding {
  min-height: 100vh !important;
  min-height: 100dvh !important;
  padding-top: calc(2rem + env(safe-area-inset-top, 0px)) !important;
  padding-right: calc(1.5rem + env(safe-area-inset-right, 0px)) !important;
  padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0px)) !important;
  padding-left: calc(1.5rem + env(safe-area-inset-left, 0px)) !important;
}

.onboarding-hero {
  text-align: center;
  padding: var(--space-10) 0 var(--space-8);
}

.onboarding-emoji {
  font-size: 72px;
  line-height: 1;
  animation: bounceIn 0.6s var(--ease-bounce) both;
  filter: drop-shadow(0 8px 20px rgba(var(--color-shadow-rgb), 0.12));
}

.onboarding-title {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: var(--weight-black);
  color: var(--text-primary);
  line-height: var(--line-tight);
  margin-top: var(--space-6);
  animation: slideUp 0.5s var(--ease-decelerate) 0.2s both;
}

.onboarding-subtitle {
  font-size: var(--text-md);
  color: var(--text-secondary);
  margin-top: var(--space-3);
  line-height: var(--line-relaxed);
  animation: slideUp 0.5s var(--ease-decelerate) 0.35s both;
}

.onboarding-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.onboarding-step-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-black);
  color: var(--text-primary);
  text-align: center;
}

.goal-options, .motivation-options, .avatar-options {
  display: grid;
  gap: var(--space-3);
}

.goal-options { grid-template-columns: 1fr 1fr; }
.motivation-options { grid-template-columns: 1fr 1fr; }
.avatar-options { grid-template-columns: repeat(4, 1fr); }

.goal-option, .motivation-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-5) var(--space-3);
  background: var(--bg-card);
  border: 2.5px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-spring);
  text-align: center;
}

.goal-option.selected, .motivation-option.selected {
  border-color: var(--card-primary-border);
  background: var(--card-primary-background);
  color: var(--card-primary-text);
  box-shadow: var(--card-primary-shadow);
}

.goal-option .option-emoji { font-size: 32px; line-height: 1; }
.goal-option .option-label {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: var(--text-base);
  color: var(--text-primary);
}
.goal-option .option-sub {
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.motivation-option .option-emoji { font-size: 36px; }
.motivation-option .option-label {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: var(--text-sm);
  color: var(--text-primary);
}

.avatar-option {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--border-radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  cursor: pointer;
  border: 3px solid transparent;
  transition: all var(--duration-fast) var(--ease-spring);
}

.avatar-option.selected {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px var(--color-primary-xlight);
  transform: scale(1.1);
}

.onboarding-progress {
  display: flex;
  gap: var(--space-2);
  justify-content: center;
  margin-bottom: var(--space-6);
}

.onboarding-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--border-radius-full);
  background: var(--color-neutral-200);
  transition: all var(--duration-base) var(--ease-spring);
}

.onboarding-dot.active {
  width: 24px;
  background: var(--color-primary);
}

.onboarding-dot.done {
  background: var(--color-success);
}

/* ============================================================
   HOME / DASHBOARD
   ============================================================ */

.home-page {
  padding-bottom: calc(var(--nav-height) + var(--space-4));
}

.home-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--page-padding) var(--space-4);
}

.home-greeting {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--weight-black);
  color: var(--text-primary);
  line-height: var(--line-tight);
}

.home-date {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-top: 2px;
}

.home-stats-row {
  display: flex;
  gap: var(--space-3);
  padding: 0 var(--page-padding) var(--space-4);
}

.stat-mini {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-2);
  background: var(--bg-card);
  border-radius: var(--border-radius-lg);
  border: 1.5px solid var(--border-color);
  box-shadow: var(--shadow-xs);
}

.stat-mini-value {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-black);
  line-height: 1;
}

.stat-mini-label {
  font-size: 10px;
  font-weight: var(--weight-semibold);
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.2;
}

.daily-goal-card {
  margin: 0 var(--page-padding) var(--space-4);
  padding: var(--space-5);
  border: 2px solid var(--card-accent-border);
  background: var(--card-accent-background);
  border-radius: var(--border-radius-xl);
  color: var(--card-accent-text);
}

.daily-goal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.daily-goal-title {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
}

.daily-goal-xp {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  opacity: 0.85;
}

.daily-goal-bar {
  height: 10px;
  background: var(--surface-white-25);
  border-radius: var(--border-radius-full);
  overflow: hidden;
  margin-bottom: var(--space-2);
}

.daily-goal-fill {
  height: 100%;
  background: var(--surface-default);
  border-radius: var(--border-radius-full);
  transition: width 0.8s var(--ease-spring);
  min-width: 8px;
}

.daily-goal-status {
  font-size: var(--text-sm);
  opacity: 0.85;
}

/* Home continue lesson card */
.continue-card {
  margin: 0 var(--page-padding) var(--space-4);
  cursor: pointer;
}

.continue-card-inner {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-5);
  background: var(--bg-card);
  border-radius: var(--border-radius-xl);
  border: 1.5px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: all var(--duration-base) var(--ease-spring);
}

.continue-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--border-radius-lg);
  background: var(--color-primary-xlight);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
}

.continue-info { flex: 1; }
.continue-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.continue-title {
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  margin-top: 2px;
}
.continue-progress {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  margin-top: 2px;
}

.continue-arrow {
  width: 36px;
  height: 36px;
  border-radius: var(--border-radius-full);
  background: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.continue-arrow svg { width: 18px; height: 18px; stroke: var(--text-inverse); stroke-width: 2.5; }

/* ============================================================
   LEARN PAGE (Learning Path)
   ============================================================ */

.learn-page {}

.learn-header {
  padding: var(--space-5) var(--page-padding);
  background: var(--gradient-primary);
  color: var(--text-inverse);
}

.learn-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--weight-black);
  margin-bottom: var(--space-2);
}

.learn-subtitle {
  opacity: 0.85;
  font-size: var(--text-sm);
}

.course-section {
  padding: var(--space-6) var(--page-padding) var(--space-4);
}

.course-section-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.course-section-emoji { font-size: 28px; }

.course-section-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-black);
  color: var(--text-primary);
}

.course-section-progress {
  margin-left: auto;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-secondary);
}

.lessons-track {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  position: relative;
  padding: var(--space-4) 0;
}

.lessons-track-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--color-success);
  left: 50%;
  transform: translateX(-50%);
  z-index: 0;
}

.lesson-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  position: relative;
  z-index: 1;
}

.lesson-row:nth-child(even) { flex-direction: row-reverse; }

.lesson-meta {
  flex: 1;
  max-width: 120px;
}

.lesson-meta-title {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
}

.lesson-meta-info {
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

/* ============================================================
   LESSON PAGE
   ============================================================ */

.lesson-page {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: var(--z-modal);
  pointer-events: auto;
  background: var(--bg-base);
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  min-height: 0;
  padding: 0;
  overflow: hidden !important;
  box-sizing: border-box;
  animation: none;
}

.lesson-header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: clamp(10px, 1.8vh, 16px) var(--page-padding);
  padding-top: calc(clamp(10px, 1.8vh, 16px) + env(safe-area-inset-top, 0px));
  position: relative;
  z-index: var(--z-raised);
  background: var(--bg-base);
  border-bottom: 2px solid var(--border-color);
  flex-shrink: 0;
}

.lesson-exit-btn {
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--border-radius-full);
  color: var(--text-secondary);
  background: var(--surface-default);
  border: 2px solid var(--border-color);
  box-shadow: 0 5px 0 var(--border-color-strong);
  transition: transform var(--duration-fast) var(--ease-spring),
              box-shadow var(--duration-fast) var(--ease-spring),
              background-color var(--duration-fast) var(--ease-spring);
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  -webkit-tap-highlight-color: transparent;
}

.lesson-exit-btn i {
  pointer-events: none;
}

.lesson-exit-btn:active:not(:disabled),
.lesson-exit-btn.is-touch-pressed:not(:disabled) {
  transform: translateY(4px) !important;
  box-shadow: 0 1px 0 var(--border-color-strong) !important;
}

.lesson-quit-overlay {
  z-index: calc(var(--z-modal) + 20);
}

.lesson-quit-modal {
  padding: var(--space-8) var(--space-6) var(--space-6);
  text-align: center;
  border: 2px solid var(--border-color);
}

.lesson-quit-modal__close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
}

.lesson-quit-modal__icon {
  width: 72px;
  height: 72px;
  margin: 0 auto var(--space-5);
  border-radius: var(--border-radius-full);
  background: var(--color-warning-xlight);
  border: 2px solid var(--color-warning);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-card-warning);
}

.lesson-quit-modal__header {
  margin-bottom: var(--space-2);
}

.lesson-quit-modal__header .modal-title {
  margin-bottom: var(--space-3);
  font-size: var(--text-2xl);
  line-height: 1.2;
}

.lesson-quit-modal__header .modal-subtitle {
  font-size: var(--text-base);
  line-height: 1.5;
  max-width: 28ch;
  margin: 0 auto;
}

.lesson-quit-modal__actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

.lesson-quit-modal__actions .btn {
  width: 100%;
  min-height: 52px;
}

.lesson-progress-wrap { flex: 1; display: flex; flex-direction: column; gap: 4px; }

.lesson-combo-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--color-streak-xlight);
  border: 2px solid var(--color-streak);
  border-radius: var(--border-radius-full);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: var(--weight-black);
  color: var(--color-streak-dark);
  box-shadow: var(--shadow-streak-glow-sm);
  animation: bounceIn 0.4s var(--ease-bounce);
  flex-shrink: 0;
}

.lesson-combo-badge.pop {
  animation: pulse 0.4s var(--ease-spring);
}

.lesson-body {
  flex: 1;
  min-height: 0;
  padding: clamp(12px, 2.5vh, 24px) var(--page-padding);
  padding-bottom: clamp(16px, 3vh, 28px);
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 2vh, 24px);
  justify-content: space-around;
  overflow-y: auto !important;
  overflow-x: clip;
  scroll-padding-bottom: 12px;
}

.exercise-instruction {
  font-family: var(--font-display);
  font-size: clamp(0.75rem, 1.5vh, 0.875rem);
  font-weight: var(--weight-bold);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0;
}

.exercise-content {
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 2.5vh, 24px);
  flex-shrink: 0;
  width: 100%;
  min-width: 0;
}

.exercise-question {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(12px, 2vh, 20px);
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2.5vh, 1.5rem);
  font-weight: var(--weight-black);
  color: var(--text-primary);
  line-height: var(--line-snug);
  text-align: center;
}

.exercise-question.french {
  font-size: clamp(1.25rem, 3vh, 1.75rem);
  color: var(--color-primary);
}

.exercise-question:has(.audio-btn) {
  padding-bottom: 4px;
}

.exercise-options {
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.5vh, 16px);
  flex-shrink: 0;
  overflow-x: clip;
}

.exercise-word-bank {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  min-height: 60px;
  padding: var(--space-3);
  background: var(--color-neutral-100);
  border-radius: var(--border-radius-lg);
  border: 2px dashed var(--border-color);
  overflow-x: clip;
}

.exercise-answer-area {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  min-height: 56px;
  padding: var(--space-3);
  background: var(--bg-card);
  border-radius: var(--border-radius-lg);
  border: 2px solid var(--border-color);
  transition: border-color var(--duration-fast);
}

.exercise-answer-area:focus-within {
  border-color: var(--color-primary);
}

.lesson-footer {
  padding: var(--space-4) var(--page-padding);
  padding-bottom: calc(var(--space-4) + env(safe-area-inset-bottom, 0px));
  position: sticky;
  bottom: 0;
  background: var(--bg-base);
  border-top: 2px solid var(--border-color);
  transition: background-color 0.25s ease, border-color 0.25s ease;
  z-index: var(--z-overlay);
}

.lesson-footer.is-correct {
  background-color: var(--color-success-xlight);
  border-top-color: var(--color-success);
}

.lesson-footer.is-wrong {
  background-color: var(--color-error-xlight);
  border-top-color: var(--color-error);
}

.lesson-feedback {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  animation: slideUp 0.3s var(--ease-spring) both;
}

.feedback-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--border-radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.is-correct .feedback-icon {
  background: var(--color-success);
  color: var(--text-on-success);
  box-shadow: var(--shadow-success-glow);
  animation: bounceIn 0.4s var(--ease-bounce);
}

.is-wrong .feedback-icon {
  background: var(--color-error);
  color: var(--text-on-error);
  box-shadow: var(--shadow-error-glow);
  animation: shake 0.4s var(--ease-standard);
}

.feedback-text {
  flex: 1;
}

.feedback-text h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-black);
  margin: 0 0 4px 0;
}

.is-correct .feedback-text h3 { color: var(--color-success-dark); }
.is-wrong .feedback-text h3 { color: var(--color-error-dark); }

.feedback-solution-box {
  margin-top: 6px;
  padding: var(--space-2) var(--space-3);
  background: var(--surface-default);
  border-radius: var(--border-radius-md);
  border: 1.5px solid var(--color-error-light);
  font-size: var(--text-sm);
  color: var(--text-primary);
  font-weight: var(--weight-bold);
  box-shadow: var(--shadow-xs);
}

/* ============================================================
   SPEAKING PAGE
   ============================================================ */

.speaking-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  padding-bottom: var(--nav-height);
}

.speaking-header {
  padding: var(--space-4) var(--page-padding);
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.speaking-scenario-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: var(--color-speaking);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.speaking-scenario-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-black);
  color: var(--text-primary);
}

/* Scenario selector */
.scenario-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  padding: var(--space-4) var(--page-padding);
  overflow-y: auto;
}

.scenario-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-3);
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-xl);
  cursor: pointer;
  transition: all var(--duration-base) var(--ease-spring);
  text-align: center;
}

.scenario-emoji { font-size: 40px; line-height: 1; }
.scenario-name {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
}
.scenario-level {
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

/* Chat Interface */
.chat-area {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4) var(--page-padding);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  scroll-behavior: smooth;
}

.chat-bubble {
  max-width: 82%;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--border-radius-lg);
  font-size: var(--text-base);
  line-height: var(--line-relaxed);
  animation: slideUp var(--duration-base) var(--ease-decelerate) both;
}

.chat-bubble-ai {
  background: var(--color-neutral-100);
  color: var(--text-primary);
  border-bottom-left-radius: var(--border-radius-xs);
  align-self: flex-start;
}

.chat-bubble-ai .bubble-name {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: var(--color-speaking);
  margin-bottom: 4px;
}

.chat-bubble-user {
  background: var(--color-primary);
  color: var(--text-on-primary);
  border-bottom-right-radius: var(--border-radius-xs);
  align-self: flex-end;
}

.chat-bubble-user.correct {
  background: var(--color-success);
}

.chat-controls {
  padding: var(--space-4) var(--page-padding);
  padding-bottom: calc(var(--space-4) + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border-color);
  background: var(--bg-card);
}

.chat-hint {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
  text-align: center;
  font-style: italic;
}

.chat-mic-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-6);
}

.pronunciation-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4);
  background: var(--bg-card);
  border-radius: var(--border-radius-xl);
  border: 1.5px solid var(--border-color);
  animation: scaleSpring var(--duration-modal) var(--ease-spring) both;
}

.pron-score-title {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--text-secondary);
  text-align: center;
}

.pron-score-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  width: 100%;
}

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

.pron-metric-value {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-black);
  color: var(--color-success);
}

.pron-metric-label {
  font-size: 10px;
  color: var(--text-secondary);
  text-align: center;
}

/* ============================================================
   STATS PAGE
   ============================================================ */

.stats-page {}

.stats-hero {
  padding: var(--space-8) var(--page-padding) var(--space-6);
  background: var(--gradient-accent);
  color: var(--text-inverse);
  text-align: center;
}

.stats-hero-level {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.8;
  margin-bottom: var(--space-2);
}

.stats-hero-xp {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: var(--weight-black);
  line-height: 1;
}

.stats-hero-label {
  opacity: 0.8;
  font-size: var(--text-sm);
  margin-top: var(--space-1);
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  padding: var(--space-6) var(--page-padding) 0;
}

.stat-card {
  padding: var(--space-4);
  background: var(--bg-card);
  border-radius: var(--border-radius-lg);
  border: 1.5px solid var(--border-color);
  box-shadow: var(--shadow-xs);
}

.stat-card-icon { font-size: 24px; margin-bottom: var(--space-2); }

.stat-card-value {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--weight-black);
  color: var(--text-primary);
  line-height: 1;
}

.stat-card-label {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Weekly chart */
.weekly-chart {
  margin: var(--space-6) var(--page-padding) 0;
  padding: var(--space-5);
  background: var(--bg-card);
  border-radius: var(--border-radius-xl);
  border: 1.5px solid var(--border-color);
}

.weekly-chart-title {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-5);
}

.weekly-bars {
  display: flex;
  align-items: flex-end;
  gap: var(--space-2);
  height: 100px;
}

.weekly-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  height: 100%;
}

.weekly-bar {
  width: 100%;
  border-radius: var(--border-radius-sm) var(--border-radius-sm) 0 0;
  background: var(--color-primary-xlight);
  min-height: 4px;
  transition: height 0.8s var(--ease-spring);
  position: relative;
}

.weekly-bar.today { background: var(--color-primary); }

.weekly-day {
  font-size: 10px;
  font-weight: var(--weight-bold);
  color: var(--text-tertiary);
}

.weekly-day.today { color: var(--color-primary); }

/* Streak calendar heatmap */
.streak-calendar {
  margin: var(--space-4) var(--page-padding) 0;
  padding: var(--space-5);
  background: var(--bg-card);
  border-radius: var(--border-radius-xl);
  border: 1.5px solid var(--border-color);
}

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

.calendar-day {
  aspect-ratio: 1;
  border-radius: var(--border-radius-xs);
  background: var(--color-neutral-100);
}

.calendar-day.active-1 { background: var(--surface-success-calendar-1); }
.calendar-day.active-2 { background: var(--surface-success-calendar-2); }
.calendar-day.active-3 { background: var(--color-success); }
.calendar-day.today { outline: 2px solid var(--color-primary); outline-offset: 1px; }

/* ============================================================
   DICTIONARY PAGE
   ============================================================ */

.dictionary-page { padding: var(--space-4) var(--page-padding); }

/* Comfortable tap targets for the horizontally scrolling category filter chips. */
.dict-categories .chip {
  min-height: 44px;
  padding-inline: var(--space-4);
}

.dict-status {
  font-size: 0.7rem;
  padding: 2px 8px;
  flex-shrink: 0;
}

.dict-status-new {
  background: var(--surface-teach-muted);
  color: var(--color-teach-dark);
}

.dict-status-learning {
  background: var(--card-secondary-background);
  color: var(--card-secondary-text);
}

.dict-status-mastered {
  background: var(--card-success-background);
  color: var(--card-success-text);
}

.dict-word-card {
  box-shadow: var(--card-neutral-shadow);
}

.dictionary-search {
  position: relative;
  margin-bottom: var(--space-4);
}

.dictionary-search-icon {
  position: absolute;
  left: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  pointer-events: none;
}

.dictionary-search-input {
  padding-left: calc(var(--space-4) + 24px + var(--space-2));
}

.vocabulary-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.vocab-item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-card);
  border-radius: var(--border-radius-lg);
  border: 1.5px solid var(--border-color);
  cursor: pointer;
  transition: all var(--duration-fast);
}

.vocab-fr {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  color: var(--color-primary);
  flex: 1;
}

.vocab-de {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  flex: 1;
  text-align: right;
}

.vocab-ease {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

/* ============================================================
   PROFILE PAGE
   ============================================================ */

.profile-page { padding: var(--space-6) var(--page-padding); }

.profile-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--border-color);
  margin-bottom: var(--space-6);
}

.profile-level-ring {
  position: relative;
}

.profile-avatar-container {
  position: relative;
  width: 90px;
  height: 90px;
}

.profile-avatar {
  width: 90px;
  height: 90px;
  border-radius: var(--border-radius-full);
  border: 3px solid var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  background: var(--color-primary-xlight);
}

.profile-name {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--weight-black);
  color: var(--text-primary);
}

.profile-level-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--color-xp-xlight);
  border-radius: var(--border-radius-full);
  border: 1.5px solid var(--color-xp-light);
}

.profile-level-label {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--color-xp-dark);
}

.settings-section { margin-bottom: var(--space-6); }

.settings-title {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-3);
}

.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4);
  background: var(--bg-card);
  border-radius: var(--border-radius-lg);
  border: 1.5px solid var(--border-color);
  margin-bottom: var(--space-2);
  cursor: pointer;
  transition: all var(--duration-fast);
}

.settings-item-label {
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  font-size: var(--text-base);
  color: var(--text-primary);
}

.settings-item-value {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

/* Toggle switch */
.toggle {
  position: relative;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
}

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

.toggle-track {
  position: absolute;
  inset: 0;
  border-radius: var(--border-radius-full);
  background: var(--color-neutral-200);
  cursor: pointer;
  transition: background var(--duration-base) var(--ease-standard);
}

.toggle-track::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: var(--border-radius-full);
  background: var(--surface-default);
  box-shadow: var(--shadow-xs);
  transition: transform var(--duration-base) var(--ease-spring);
}

.toggle-input:checked + .toggle-track { background: var(--color-primary); }
.toggle-input:checked + .toggle-track::before { transform: translateX(20px); }

/* ============================================================
   ACHIEVEMENT POPUP (Level-Up / Achievement)
   ============================================================ */

.achievement-popup {
  text-align: center;
  padding: var(--space-8) var(--space-6);
}

.achievement-popup-icon {
  font-size: 80px;
  line-height: 1;
  animation: bounceIn 0.6s var(--ease-bounce) both;
  filter: var(--filter-drop-md);
}

.achievement-popup-title {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: var(--weight-black);
  color: var(--text-primary);
  margin-top: var(--space-6);
  animation: slideUp 0.5s var(--ease-decelerate) 0.3s both;
}

.achievement-popup-subtitle {
  font-size: var(--text-md);
  color: var(--text-secondary);
  margin-top: var(--space-3);
  animation: slideUp 0.5s var(--ease-decelerate) 0.45s both;
}

.achievement-popup-xp {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  background: var(--color-xp-xlight);
  border-radius: var(--border-radius-full);
  border: 1.5px solid var(--color-xp-light);
  margin-top: var(--space-5);
  animation: scaleSpring 0.5s var(--ease-spring) 0.6s both;
}

.achievement-popup-xp-value {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-black);
  color: var(--color-xp);
}

/* ============================================================
   PRACTICE PAGE
   ============================================================ */

.practice-page { padding: var(--space-4) var(--page-padding); }

.category-chips {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  padding-bottom: var(--space-2);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.category-chips::-webkit-scrollbar { display: none; }

.category-chip {
  flex-shrink: 0;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--border-radius-full);
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-fast);
  white-space: nowrap;
}

.category-chip.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--text-on-primary);
  box-shadow: var(--shadow-button-primary);
}

/* ============================================================
   LEVEL UP ANIMATION
   ============================================================ */

.levelup-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-beetle);
  animation: overlayFade var(--duration-base) var(--ease-standard) both;
}

.levelup-rings {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.levelup-ring {
  position: absolute;
  width: 200px;
  height: 200px;
  border: 3px solid var(--surface-white-30);
  border-radius: var(--border-radius-full);
  animation: levelUpRing 1.5s var(--ease-standard) infinite;
}

.levelup-ring:nth-child(2) { animation-delay: 0.3s; }
.levelup-ring:nth-child(3) { animation-delay: 0.6s; }

.levelup-content {
  position: relative;
  z-index: 1;
  text-align: center;
  color: var(--text-inverse);
  animation: scaleSpring 0.6s var(--ease-bounce) 0.2s both;
}

.levelup-label {
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.85;
  margin-bottom: var(--space-3);
}

.levelup-number {
  font-family: var(--font-display);
  font-size: 88px;
  font-weight: var(--weight-black);
  line-height: 1;
  text-shadow: 0 8px 32px rgba(var(--color-shadow-rgb), 0.2);
}

.levelup-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--weight-black);
  margin-top: var(--space-2);
}

.levelup-subtitle {
  opacity: 0.85;
  font-size: var(--text-md);
  margin-top: var(--space-2);
}


/* ============================================================
   TEACH CARD – New Word Introduction
   ============================================================ */

.teach-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-4) var(--space-4) var(--space-6);
  gap: var(--space-3);
}

.teach-card-label {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: var(--weight-extrabold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-primary);
  background: var(--surface-primary-muted);
  padding: 4px 14px;
  border-radius: 20px;
}

.teach-card .audio-btn {
  background: var(--color-xp-xlight);
  color: var(--color-teach-dark);
  box-shadow: 0 4px 0 var(--color-xp-shadow);
}

.teach-card .audio-btn:active:not(:disabled) {
  box-shadow: 0 1px 0 var(--color-xp-shadow);
}

/* ── CSS Graphic container ───────────────────────────────── */
.teach-graphic-wrap {
  --teach-accent: var(--color-teach);
  position: relative;
  width: 110px;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: var(--space-2) 0;
  overflow: visible;
}

.teach-shape-glow {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--teach-accent) 18%, transparent);
  opacity: 0.15;
  animation: teach-glow-pulse 2.4s ease-in-out infinite;
}

@keyframes teach-glow-pulse {
  0%, 100% { transform: scale(1);   opacity: 0.15; }
  50%       { transform: scale(1.2); opacity: 0.28; }
}

/* Base shape styling */
.teach-shape {
  width: 72px;
  height: 72px;
  background: var(--teach-accent);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--teach-accent) 40%, transparent);
  animation: teach-shape-float 3s ease-in-out infinite;
}

@keyframes teach-shape-float {
  0%, 100% { transform: translateY(0)   rotate(0deg); }
  50%       { transform: translateY(-6px) rotate(3deg); }
}

/* Circle */
.teach-shape-circle {
  border-radius: 50%;
}

/* Diamond */
.teach-shape-diamond {
  border-radius: 8px;
  transform: rotate(45deg);
  width: 56px;
  height: 56px;
}
.teach-shape-diamond.teach-shape { animation: teach-shape-float-diamond 3s ease-in-out infinite; }
@keyframes teach-shape-float-diamond {
  0%, 100% { transform: rotate(45deg) translateY(0); }
  50%       { transform: rotate(48deg) translateY(-6px); }
}

/* Triangle (CSS only) */
.teach-shape-triangle {
  width: 0;
  height: 0;
  background: none;
  box-shadow: none;
  border-left:  36px solid transparent;
  border-right: 36px solid transparent;
  border-bottom: 72px solid var(--teach-accent);
  border-radius: 0;
  filter: drop-shadow(0 8px 16px color-mix(in srgb, var(--teach-accent) 40%, transparent));
}

/* Hexagon */
.teach-shape-hexagon {
  border-radius: 14px;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

/* Ring (hollow circle) */
.teach-shape-ring {
  background: transparent;
  border-radius: 50%;
  border: 14px solid var(--teach-accent);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--teach-accent) 40%, transparent);
}

/* Cross/Plus */
.teach-shape-cross {
  width: 72px;
  height: 72px;
  background: none;
  box-shadow: none;
  position: relative;
}
.teach-shape-cross::before,
.teach-shape-cross::after {
  content: '';
  position: absolute;
  background: var(--teach-accent);
  border-radius: 6px;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--teach-accent) 40%, transparent);
}
.teach-shape-cross::before { width: 24px; height: 72px; left: 24px; top: 0; }
.teach-shape-cross::after  { width: 72px; height: 24px; left: 0;    top: 24px; }

/* ── Word text ────────────────────────────────────────────── */
.teach-word-fr {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 6vw, 2.6rem);
  font-weight: var(--weight-black);
  color: var(--text-primary);
  line-height: 1.1;
}

.teach-word-de {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--text-secondary);
}

/* ── Grammar tip ─────────────────────────────────────────── */
.teach-grammar-tip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: 20px;
  background: var(--surface-raised);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--text-secondary);
}

/* ── Example sentence ────────────────────────────────────── */
.teach-example-block {
  width: 100%;
  max-width: 340px;
  background: var(--surface-primary-subtle);
  border: 1.5px solid var(--border-primary-soft);
  border-radius: 16px;
  padding: var(--space-3) var(--space-4);
  text-align: left;
}

.teach-example-fr {
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  font-style: italic;
  line-height: 1.5;
}

.teach-example-de {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
  margin-top: 4px;
}


/* ============================================================
   LESSON COMPLETE – New premium screen with word summary
   ============================================================ */

.lesson-complete {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--surface-page);
  overflow-y: auto;
  padding: 24px;
  padding-top: calc(24px + env(safe-area-inset-top, 0px));
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
}

/* ── Trophy hero ─────────────────────────────────────────── */
.lc-hero {
  margin-top: env(safe-area-inset-top, 12px);
  margin-bottom: var(--space-4);
}

.lc-trophy-wrap {
  position: relative;
  width: 148px;
  height: 148px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lc-trophy-glow {
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--color-streak-rgb), 0.45) 0%, rgba(var(--color-warning-rgb), 0.15) 55%, transparent 72%);
  animation: lcTrophyGlow 2.4s ease-in-out infinite;
}

.lc-trophy-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(var(--color-streak-rgb), 0.35);
  animation: lcTrophyRing 2.2s var(--ease-standard) infinite;
  pointer-events: none;
}

.lc-trophy-ring--2 {
  animation-delay: 0.7s;
}

.lesson-complete-trophy {
  position: relative;
  z-index: 1;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--color-warning) 0%, var(--color-streak) 55%, var(--color-streak-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 14px 36px rgba(var(--color-streak-rgb), 0.42),
    0 0 0 5px rgba(var(--color-warning-rgb), 0.22),
    inset 0 2px 0 rgba(255, 255, 255, 0.35),
    inset 0 -6px 14px rgba(0, 0, 0, 0.12);
}

.lesson-complete-trophy i {
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.18));
}

.lc-trophy-spark {
  position: absolute;
  z-index: 2;
  display: flex;
  animation: lcSparkleFloat 2s ease-in-out infinite;
  pointer-events: none;
}

.lc-trophy-spark--1 {
  top: 6px;
  right: 10px;
  animation-delay: 0s;
}

.lc-trophy-spark--2 {
  bottom: 18px;
  left: 4px;
  animation-delay: 0.6s;
}

.lc-trophy-spark--3 {
  top: 28px;
  left: 0;
  animation-delay: 1.1s;
}

.lc-badge {
  display: inline-block;
  margin-bottom: var(--space-2);
  padding: 5px 14px;
  border-radius: var(--border-radius-full);
  background: var(--card-streak-background);
  border: 1.5px solid var(--card-streak-border);
  color: var(--card-streak-text);
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: var(--weight-black);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ── Title / Subtitle ────────────────────────────────────── */
.lc-title {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 5vw, 2.4rem);
  font-weight: var(--weight-black);
  color: var(--text-primary);
  margin: 0 0 8px 0;
  text-align: center;
  line-height: var(--line-tight);
  letter-spacing: var(--tracking-tight);
}

.lc-subtitle {
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  color: var(--text-secondary);
  margin: 0 0 var(--space-6) 0;
  text-align: center;
  max-width: 28ch;
  line-height: var(--line-snug);
}

/* ── Stat cards row ──────────────────────────────────────── */
.lc-stats-row {
  display: flex;
  gap: 12px;
  width: 100%;
  max-width: 400px;
  margin-bottom: var(--space-5);
}

.lc-stat-card {
  flex: 1;
  background: var(--surface-default);
  border-radius: 20px;
  border: 2px solid var(--border-light);
  padding: var(--space-3) var(--space-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow-card-soft);
}

.lc-stat-card--xp {
  background: var(--card-secondary-background);
  border-color: var(--card-secondary-border);
  box-shadow: var(--shadow-card-secondary);
}

.lc-stat-card--xp .lc-stat-value {
  color: var(--card-secondary-text);
}

.lc-stat-card--streak {
  background: var(--card-streak-background);
  border-color: var(--card-streak-border);
  box-shadow: var(--shadow-card-streak);
}

.lc-stat-card--streak .lc-stat-value {
  color: var(--card-streak-text);
}

.lc-stat-card--mistakes {
  background: var(--card-error-background);
  border-color: var(--card-error-border);
  box-shadow: var(--shadow-card-error);
}

.lc-stat-card--mistakes .lc-stat-value {
  color: var(--card-error-text);
}

.lc-stat-card--perfect {
  background: var(--card-success-background);
  border-color: var(--card-success-border);
  box-shadow: var(--shadow-card-success);
}

.lc-stat-card--perfect .lc-stat-value {
  color: var(--card-success-text);
}

.lc-stat-icon {
  width: 36px;
  height: 36px;
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.lc-stat-card--xp .lc-stat-icon {
  background: rgba(var(--color-secondary-rgb), 0.18);
}

.lc-stat-card--streak .lc-stat-icon {
  background: rgba(var(--color-streak-rgb), 0.18);
}

.lc-stat-card--mistakes .lc-stat-icon {
  background: rgba(var(--color-error-rgb), 0.15);
}

.lc-stat-card--perfect .lc-stat-icon {
  background: rgba(var(--color-success-rgb), 0.18);
}

/* Star icon (XP) */
.lc-icon-star {
  background: var(--color-warning);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

/* Flame icon (Streak) */
.lc-icon-flame {
  background: var(--color-streak);
  clip-path: polygon(
    50% 0%, 65% 15%, 80% 5%, 75% 30%,
    100% 40%, 85% 55%, 90% 75%, 75% 65%,
    70% 100%, 50% 80%, 30% 100%, 25% 65%,
    10% 75%, 15% 55%, 0% 40%, 25% 30%,
    20% 5%, 35% 15%
  );
  width: 26px;
  height: 32px;
  margin: 0 auto;
}

/* Target icon (Accuracy) */
.lc-icon-target {
  border-radius: 50%;
  border: 4px solid var(--color-heart);
  position: relative;
  width: 32px;
  height: 32px;
  box-sizing: border-box;
}
.lc-icon-target::before {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--color-heart);
}

.lc-stat-value {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: var(--weight-black);
  color: var(--text-primary);
  line-height: 1;
}

.lc-stat-label {
  font-size: 0.68rem;
  font-weight: var(--weight-extrabold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* ── Word summary section ────────────────────────────────── */
.lc-word-summary {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.lc-word-group {
  background: var(--surface-default);
  border-radius: 20px;
  border: 2px solid var(--border-light);
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(var(--color-shadow-rgb), 0.05);
}

.lc-word-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: var(--weight-extrabold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.lc-group-mastered {
  background: var(--surface-primary-muted);
  color: var(--color-primary-dark);
  border-bottom: 1px solid var(--border-primary-subtle);
}

.lc-group-new {
  background: var(--surface-teach-muted);
  color: var(--color-teach-dark);
  border-bottom: 1px solid var(--border-teach-subtle);
}

/* Group header icons (CSS shapes) */
.lc-group-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

/* Shield with check mark */
.lc-icon-check-shield {
  background: var(--color-primary-dark);
  clip-path: polygon(50% 0%, 100% 15%, 100% 55%, 50% 100%, 0% 55%, 0% 15%);
  position: relative;
}

/* Spark / star icon */
.lc-icon-spark {
  background: var(--color-teach);
  clip-path: polygon(50% 0%, 55% 45%, 100% 50%, 55% 55%, 50% 100%, 45% 55%, 0% 50%, 45% 45%);
}

.lc-word-cards {
  padding: var(--space-2) var(--space-3) var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* Individual word card */
.lc-word-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  animation: lc-card-in 0.35s var(--ease-spring) both;
}

@keyframes lc-card-in {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}

.lc-word-card-mastered {
  background: var(--surface-primary-subtle);
}

.lc-word-card-new {
  background: var(--surface-teach-subtle);
}

/* Tiny CSS shapes for each word card */
.lc-word-card-shape {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 6px;
}

.lc-word-card-mastered .lc-word-card-shape { background: var(--color-primary); }
.lc-word-card-new      .lc-word-card-shape { background: var(--color-teach); }

.lc-shape-circle   { border-radius: 50%; }
.lc-shape-diamond  { border-radius: 4px; transform: rotate(45deg); width: 20px; height: 20px; margin: 4px; }
.lc-shape-triangle { width: 0; height: 0; background: none !important;
  border-left: 14px solid transparent; border-right: 14px solid transparent;
  border-bottom: 28px solid currentColor; border-radius: 0; }
.lc-word-card-mastered .lc-shape-triangle { border-bottom-color: var(--color-primary); }
.lc-word-card-new      .lc-shape-triangle { border-bottom-color: var(--color-teach); }
.lc-shape-hexagon  { clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%); border-radius: 0; }
.lc-shape-ring     { background: transparent !important; border-radius: 50%; border: 5px solid; }
.lc-word-card-mastered .lc-shape-ring { border-color: var(--color-primary); }
.lc-word-card-new      .lc-shape-ring { border-color: var(--color-teach); }

.lc-word-card-text {
  flex: 1;
  text-align: left;
}

.lc-word-card-fr {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: var(--weight-black);
  color: var(--text-primary);
  line-height: 1.2;
}

.lc-word-card-de {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
}

/* ── Continue button ─────────────────────────────────────── */
.lc-continue-btn {
  width: 100%;
  max-width: 400px;
  min-height: 56px;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  box-shadow: var(--shadow-button-primary);
  margin-top: auto;
  flex-shrink: 0;
  border-radius: var(--border-radius-lg);
}

/* ============================================================
   PICTURE SELECT EXERCISE (picture-select.js)
   ============================================================ */

.ps-listen-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-6);
  padding: var(--space-4);
  background: var(--color-neutral-100);
  border-radius: var(--border-radius-lg);
  border: 2px dashed var(--color-neutral-200);
}

.ps-listen-area .audio-btn-wrap {
  padding: 0;
}

.ps-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

.ps-option-card {
  background: var(--surface-default);
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: var(--space-4) var(--space-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-card-neutral);
  outline: none;
}

.ps-option-card:active {
  transform: translateY(4px);
  box-shadow: var(--shadow-card-neutral-pressed);
}

.ps-icon-area {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 64px;
}

.ps-option-label {
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  text-align: center;
}

.ps-option-card.ps-selected {
  border-color: var(--card-secondary-border);
  background: var(--card-secondary-background);
  color: var(--card-secondary-text);
  box-shadow: var(--card-secondary-shadow);
}
.ps-option-card.ps-selected:active { box-shadow: var(--shadow-card-secondary-pressed); }
.ps-option-card.ps-selected .ps-option-label {
  color: var(--color-secondary);
}

.ps-option-card.ps-correct {
  border-color: var(--card-success-border);
  background: var(--card-success-background);
  color: var(--card-success-text);
  box-shadow: var(--card-success-shadow);
  animation: bounceCorrect 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.ps-option-card.ps-correct:active { box-shadow: var(--shadow-card-success-pressed); }
.ps-option-card.ps-correct .ps-option-label {
  color: var(--color-success-dark);
}

.ps-option-card.ps-wrong {
  border-color: var(--card-error-border);
  background: var(--card-error-background);
  color: var(--card-error-text);
  box-shadow: var(--card-error-shadow);
  animation: shakeWrong 0.4s ease-in-out;
}
.ps-option-card.ps-wrong:active { box-shadow: var(--shadow-card-error-pressed); }
.ps-option-card.ps-wrong .ps-option-label {
  color: var(--color-error-dark);
}

@keyframes bounceCorrect {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

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

/* ============================================================
   NEW WORD BADGE (engine.js)
   ============================================================ */
.new-word-badge-pill {
  display: inline-block;
  background: var(--color-success-light);
  color: var(--color-success-dark);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 6px 16px;
  border-radius: 20px;
  margin-bottom: 20px;
  border: 2px solid var(--color-success);
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  box-shadow: var(--shadow-primary-glow-sm);
}

.exercise-badge-wiederholung {
  display: flex;
  justify-content: center;
  margin-bottom: 4px;
}

.exercise-badge-wiederholung-inner {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #FFF3E0;
  color: #E65100;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 12px;
  border-radius: 20px;
  border: 2px solid #FF9600;
}

.exercise-viewport {
  flex: 0 0 auto;
  width: 100%;
  overflow-x: clip;
}

.exercise-viewport.is-sliding {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.exercise-slide-track {
  position: relative;
  width: 100%;
}

.exercise-slide-track.is-sliding {
  pointer-events: none;
  overflow: hidden;
}

.exercise-slide-track.is-sliding > .exercise-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.exercise-slide-track > .exercise-wrapper {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.exercise-wrapper {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

/*
 * Lesson answer cards: 3D depth via thicker bottom border instead of external
 * box-shadow, so nothing paints outside the element box and gets clipped.
 */
.lesson-page :is(.option-card, .ps-option-card, .mp-tile, .word-chip) {
  box-shadow: none !important;
}

.lesson-page .option-card {
  border-bottom-width: 6.5px;
}

.lesson-page .option-card:active:not(:disabled) {
  border-bottom-width: 3.5px;
}

.lesson-page :is(.ps-option-card, .mp-tile, .word-chip) {
  border-bottom-width: 6px;
}

.lesson-page :is(.ps-option-card, .mp-tile, .word-chip):active:not(:disabled):not(.mp-matched) {
  border-bottom-width: 3px;
}

.lesson-page .option-card.selected,
.lesson-page .option-card.correct,
.lesson-page .option-card.wrong,
.lesson-page .ps-option-card.ps-selected,
.lesson-page .ps-option-card.ps-correct,
.lesson-page .ps-option-card.ps-wrong,
.lesson-page .mp-tile.mp-selected,
.lesson-page .word-chip.selected,
.lesson-page .word-chip.correct,
.lesson-page .word-chip.wrong {
  box-shadow: none !important;
}

/* Milder feedback on full-width cards — avoids overflow past screen edge */
.lesson-page .option-card.correct {
  animation: bounceCorrect 0.35s var(--ease-spring);
}
.lesson-page .option-card.wrong {
  animation: shakeWrong 0.35s var(--ease-standard);
}
.lesson-page .word-chip.correct {
  animation: bounceCorrect 0.3s var(--ease-spring);
}
.lesson-page .word-chip.wrong {
  animation: shakeWrong 0.3s var(--ease-standard);
}
.lesson-page .is-wrong .feedback-icon {
  animation: shakeWrong 0.35s var(--ease-standard);
}
.lesson-page .mp-tile.mp-wrong-flash {
  animation: shakeWrong 0.35s var(--ease-standard);
}

.lesson-page button:focus,
.lesson-page button:focus-visible {
  outline: none !important;
}

/* Match-pairs exercise */
.mp-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  margin: var(--space-2) 0 var(--space-3);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
}

.mp-status-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.mp-status-mistakes {
  color: var(--color-warning-dark, #b45309);
}

.mp-matched-zone {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  min-height: 0;
}

.mp-matched-zone:not(:empty) {
  margin-bottom: var(--space-4);
}

.mp-matched-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3);
  border: 2px solid var(--color-success);
  border-radius: var(--border-radius-md);
  background: var(--color-success-xlight);
  font-weight: var(--weight-bold);
  line-height: var(--line-snug);
  animation: mpMatchIn 280ms var(--ease-standard);
}

.mp-matched-fr {
  color: var(--color-primary);
  text-align: right;
  overflow-wrap: anywhere;
}

.mp-matched-arrow {
  color: var(--color-success-dark);
  font-size: var(--text-sm);
}

.mp-matched-de {
  color: var(--text-primary);
  text-align: left;
  overflow-wrap: anywhere;
}

.mp-hint {
  margin-bottom: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--border-radius-md);
  background: var(--color-error-xlight);
  color: var(--color-error-dark);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  text-align: center;
}

.mp-col-label {
  margin-bottom: var(--space-1);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
}

.mp-board-empty .mp-col-label {
  display: none;
}

.mp-board-empty .mp-tile.mp-done {
  display: none;
}

.mp-feedback-note {
  margin: var(--space-2) 0 0;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

.mp-progress {
  margin: var(--space-2) 0 var(--space-4);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  text-align: center;
}

.mp-board {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.mp-col {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: var(--space-3);
}

.mp-tile {
  width: 100%;
  min-width: 0;
  min-height: 56px;
  padding: var(--space-3);
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-md);
  background: var(--surface-default);
  color: var(--text-primary);
  box-shadow: var(--shadow-card-neutral);
  font-size: clamp(0.9rem, 4vw, 1.05rem);
  font-weight: var(--weight-bold);
  line-height: var(--line-snug);
  overflow-wrap: anywhere;
  transition: transform var(--duration-fast), border-color var(--duration-fast),
              background-color var(--duration-fast), opacity var(--duration-base);
}

.mp-tile:active:not(.mp-matched) {
  transform: translateY(3px);
  box-shadow: var(--shadow-card-neutral-pressed);
}

.mp-tile.mp-selected {
  border-color: var(--color-secondary);
  background: var(--color-secondary-xlight);
  color: var(--color-secondary-dark);
  box-shadow: var(--shadow-card-secondary);
}

.mp-tile.mp-matched {
  border-color: var(--color-success);
  background: var(--color-success-xlight);
  color: var(--color-success-dark);
  transform: scale(0.96);
  pointer-events: none;
}

.mp-tile.mp-done {
  display: none;
}

.mp-tile.mp-wrong-flash {
  animation: mpWrong 450ms var(--ease-standard);
}

.mp-board-complete {
  display: block;
  grid-template-columns: 1fr;
}

.mp-summary {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: 100%;
}

.mp-summary-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3);
  border: 2px solid var(--color-success);
  border-radius: var(--border-radius-md);
  background: var(--color-success-xlight);
  font-weight: var(--weight-bold);
  line-height: var(--line-snug);
}

.mp-summary-fr {
  color: var(--color-primary);
  text-align: right;
  overflow-wrap: anywhere;
}

.mp-summary-arrow {
  color: var(--color-success-dark);
  font-size: var(--text-sm);
}

.mp-summary-de {
  color: var(--text-primary);
  text-align: left;
  overflow-wrap: anywhere;
}

.mp-feedback-intro {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: var(--space-2);
}

.mp-feedback-pairs {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.mp-feedback-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: var(--space-2);
  font-size: var(--text-sm);
  line-height: var(--line-snug);
}

.mp-feedback-pair span:first-child {
  text-align: right;
  color: var(--color-primary);
}

.mp-feedback-pair span:last-child {
  text-align: left;
}

@keyframes mpWrong {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); border-color: var(--color-error); background: var(--color-error-xlight); }
  75% { transform: translateX(5px); border-color: var(--color-error); background: var(--color-error-xlight); }
}

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

/* ============================================================
   PRONUNCIATION DRILL – sound badge
   ============================================================ */
.pd-sound-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  height: 56px;
  padding: 0 var(--space-3);
  border-radius: var(--border-radius-lg);
  background: var(--color-speaking);
  color: white;
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-black);
  box-shadow: var(--shadow-card-speaking);
}

/* ============================================================
   WORD MEMORY – "Wörter merken"
   ============================================================ */
.wm-memorize-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: var(--space-3);
  margin: var(--space-2) 0;
}

.wm-memo-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-3);
  border-radius: var(--border-radius-md);
  background: var(--surface-primary-subtle);
  border: 2px solid var(--border-primary-soft);
  text-align: center;
}

.wm-memo-fr {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: var(--text-sm);
  color: var(--color-primary-dark);
}

.wm-memo-de {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  font-weight: var(--weight-semibold);
}

.wm-countdown {
  text-align: center;
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: var(--weight-black);
  color: var(--color-streak);
  margin: var(--space-3) 0;
}

.wm-progress {
  text-align: center;
  font-weight: var(--weight-bold);
  color: var(--text-secondary);
  margin-bottom: var(--space-3);
}

.wm-tile-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
}

.wm-tile {
  padding: var(--space-3) var(--space-2);
  border-radius: var(--border-radius-md);
  border: 2px solid var(--border-color);
  background: var(--surface-default);
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: var(--text-sm);
  color: var(--text-primary);
  cursor: pointer;
  transition: transform var(--duration-fast) var(--ease-standard);
}

.wm-tile:active:not(:disabled) { transform: scale(0.94); }

.wm-tile-correct {
  border-color: var(--color-success);
  background: var(--color-success-xlight);
  color: var(--color-success-dark);
}

.wm-tile-wrong {
  border-color: var(--color-error);
  background: var(--color-error-xlight);
  color: var(--color-error-dark);
  opacity: 0.55;
}

/* ============================================================
   AUDIO MEMORY – "Hör-Memory"
   ============================================================ */
.am-progress {
  text-align: center;
  font-weight: var(--weight-bold);
  color: var(--text-secondary);
  margin-bottom: var(--space-3);
}

.am-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-2);
}

.am-tile {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--border-radius-md);
  border: 2px solid var(--border-color);
  background: var(--surface-secondary-subtle);
  color: var(--color-secondary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: var(--space-1);
  transition: transform var(--duration-fast) var(--ease-standard);
}

.am-tile:active:not(.am-matched) { transform: scale(0.92); }

.am-tile-front {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: var(--text-xs);
  color: var(--text-primary);
  text-align: center;
  word-break: break-word;
}

.am-tile.am-matched {
  border-color: var(--color-success);
  background: var(--color-success-xlight);
  opacity: 0.6;
  cursor: default;
}

/* ============================================================
   2026 FRIENDLY GAME UI REFINEMENT
   ============================================================ */
.home-page {
  padding: 0 0 calc(var(--nav-height) + var(--space-8));
  background: var(--bg-base);
}

.home-topbar {
  min-height: 70px;
  padding: 12px var(--page-padding);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 2px solid var(--border-color);
  background: var(--surface-white-94);
}

.home-brand {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--color-primary);
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: var(--weight-black);
  letter-spacing: -0.04em;
}

.home-brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: var(--text-on-primary);
  background: var(--color-primary);
  box-shadow: var(--shadow-button-primary);
  font-size: 1.2rem;
}

.home-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-pill {
  min-height: 42px;
  padding: 7px 11px;
  display: flex;
  align-items: center;
  gap: 5px;
  border: 2px solid var(--border-color);
  border-radius: 14px;
  background: var(--surface-default);
  font-family: var(--font-display);
  font-weight: var(--weight-black);
}

.status-pill-streak { color: var(--color-streak); }
.status-pill-xp { color: var(--color-secondary-dark); }

.home-profile-button {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  border: 2px solid var(--border-color);
  border-radius: 14px;
  background: var(--surface-default);
  box-shadow: var(--shadow-card-neutral);
}

.home-profile-button:active {
  transform: translateY(2px);
  box-shadow: var(--shadow-card-neutral-pressed);
}

.home-content {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: var(--space-6) var(--page-padding) 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.home-welcome .eyebrow,
.home-card-kicker {
  color: var(--color-primary-dark);
  font-size: var(--text-xs);
  font-weight: var(--weight-black);
  letter-spacing: 0.09em;
}

.home-welcome h1 {
  margin-top: 3px;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 8vw, 2.4rem);
  font-weight: var(--weight-black);
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.home-welcome p {
  margin-top: 7px;
  color: var(--text-secondary);
  font-weight: var(--weight-semibold);
}

.daily-quest-card {
  padding: 18px;
  border: 2px solid var(--color-secondary-dark);
  border-radius: var(--border-radius-xl);
  background: var(--color-secondary);
  color: var(--text-on-secondary);
  box-shadow: var(--shadow-button-secondary);
}

.daily-quest-copy,
.daily-quest-progress {
  display: flex;
  align-items: center;
  gap: 12px;
}

.daily-quest-icon {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  display: grid;
  place-items: center;
  border-radius: 17px;
  background: var(--surface-white-20);
}

.daily-quest-label {
  font-size: 0.7rem;
  font-weight: var(--weight-black);
  letter-spacing: 0.1em;
  opacity: 0.82;
}

.daily-quest-copy h2 {
  margin-top: 2px;
  font-size: var(--text-md);
  font-weight: var(--weight-black);
  line-height: 1.2;
}

.daily-quest-progress {
  margin-top: 15px;
}

.daily-quest-track {
  height: 13px;
  flex: 1;
  overflow: hidden;
  border-radius: var(--border-radius-full);
  background: var(--surface-dark-track);
  box-shadow: var(--shadow-inset-pressed);
}

.daily-quest-fill {
  min-width: 7px;
  height: 100%;
  border-radius: inherit;
  background: var(--surface-default);
  transition: width 700ms var(--ease-spring);
}

.daily-quest-progress strong {
  font-size: var(--text-xs);
  white-space: nowrap;
}

.home-primary-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 2px solid var(--border-color);
  border-radius: 28px;
  background: var(--surface-default);
  color: var(--text-primary);
  box-shadow: var(--shadow-card-neutral);
}

.home-primary-body {
  position: relative;
  z-index: 1;
  padding: 20px 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.home-primary-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.home-primary-copy {
  flex: 1;
  min-width: 0;
}

.home-primary-card .home-card-kicker {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--border-radius-full);
  background: var(--color-primary-xlight);
  color: var(--color-primary-dark);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-primary-copy h2 {
  margin-top: 10px;
  font-size: clamp(1.25rem, 5vw, 1.55rem);
  font-weight: var(--weight-black);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.home-primary-copy p {
  margin: 5px 0 0;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  line-height: 1.35;
}

.home-primary-icon {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  display: grid;
  place-items: center;
  border: 2px solid var(--color-primary-xlight);
  border-radius: 18px;
  background: var(--surface-default);
  box-shadow: var(--shadow-xs);
}

.home-primary-progress {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.home-primary-progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: var(--text-secondary);
}

.home-primary-progress-row strong {
  color: var(--color-primary-dark);
  font-weight: var(--weight-black);
  white-space: nowrap;
}

.home-primary-track {
  height: 10px;
  overflow: hidden;
  border-radius: var(--border-radius-full);
  background: var(--color-polar);
  box-shadow: var(--shadow-inset-pressed);
}

.home-primary-fill {
  min-width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  transition: width 700ms var(--ease-spring);
}

.home-primary-cta {
  position: relative;
  z-index: 1;
  margin: 0 22px 22px;
  width: calc(100% - 44px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.home-section .section-header { margin-bottom: 12px; }

.home-action-grid {
  display: grid;
  gap: 11px;
}

.home-action-card {
  min-height: 76px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 13px;
  text-align: left;
  border: 2px solid var(--border-color);
  border-radius: 20px;
  background: var(--surface-default);
  box-shadow: var(--shadow-card-neutral);
  transition: transform var(--duration-fast), box-shadow var(--duration-fast);
}

.home-action-card:active {
  transform: translateY(3px);
  box-shadow: var(--shadow-card-neutral-pressed);
}

.home-action-icon {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: grid;
  place-items: center;
  border-radius: 15px;
}

.home-action-blue .home-action-icon { background: var(--color-secondary-xlight); }
.home-action-purple .home-action-icon { background: var(--color-xp-xlight); }
.home-action-yellow .home-action-icon { background: var(--color-warning-xlight); }

.home-action-card strong,
.home-action-card small {
  display: block;
}

.home-action-card strong {
  color: var(--text-primary);
  font-size: var(--text-base);
  font-weight: var(--weight-black);
}

.home-action-card small {
  margin-top: 2px;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

/* Keep the learning path playful while removing heavy gradients. */
.page-learn {
  padding: 0 0 calc(var(--nav-height) + var(--space-8));
  overflow-x: clip;
  --learn-topbar-height: 70px;
  padding-top: calc(var(--learn-topbar-height) + env(safe-area-inset-top, 0px));
}

.page-learn .home-topbar {
  position: fixed;
  top: env(safe-area-inset-top, 0px);
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--content-max-width);
  z-index: var(--z-raised);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.page-learn .path-section--current .unit-card {
  outline: 3px solid rgba(255, 255, 255, 0.55);
  outline-offset: 2px;
}

.page-learn .learn-node-group {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.page-learn .learn-node-group--quiz {
  margin: 1rem 0;
}

.page-learn .node-wrapper {
  position: relative;
  width: 88px;
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-learn .learn-node-group--with-ring .node-wrapper {
  width: 104px;
  height: 104px;
}

.page-learn .node-wrapper--quiz {
  width: 96px;
  height: 96px;
}

.page-learn .learn-node-label {
  margin-top: 0.85rem;
  min-height: 1.2rem;
  width: min(190px, 78vw);
  overflow-wrap: anywhere;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.2;
}

.page-learn .learn-node-group--with-ring .learn-node-label {
  margin-top: 1.15rem;
}

.learning-path {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: var(--space-6) var(--page-padding) 0;
}

.page-learn .unit-card {
  border: 2px solid rgba(var(--color-shadow-rgb), 0.1);
  box-shadow: none !important;
}

.page-learn .node-btn:active:not(:disabled) {
  transform: translateY(5px);
  box-shadow: 0 1px 0 rgba(var(--color-shadow-rgb), 0.18) !important;
}

/* Lesson screens: one task, one obvious action. */
.lesson-header {
  border-bottom: 0;
  padding-inline: clamp(16px, 4vw, 28px);
}

.lesson-header .progress-bar {
  height: 15px;
  box-shadow: inset 0 2px 0 rgba(var(--color-shadow-rgb), 0.06);
}

.lesson-body {
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  justify-content: center;
}

.lesson-footer {
  padding-inline: max(var(--page-padding), calc((100vw - 620px) / 2));
}

/* Daily quests now have their own focused tab. */
.quests-page {
  padding: 0 0 calc(var(--nav-height) + var(--space-8));
}

.page-stats {
  padding: 0 0 calc(var(--nav-height) + var(--space-8));
}

.stats-content {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: var(--space-6) var(--page-padding) 0;
}

/* ── Achievement cards (stats page) – same theme vars as daily quests ── */

.ach-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ach-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px 12px 12px;
  border-radius: 18px;
  border: 2px solid var(--quest-soft);
  background: var(--surface-default, #fff);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.ach-card--locked {
  border-color: var(--quest-soft);
  background: var(--surface-default, #fff);
}

.ach-card--active {
  border-color: color-mix(in srgb, var(--quest-main) 45%, var(--quest-soft));
}

.ach-card--claimed {
  border-color: var(--quest-soft);
  background: var(--surface-default, #fff);
}

.ach-card--pending {
  border-color: var(--quest-main);
  background: var(--quest-soft);
  box-shadow: 0 0 14px color-mix(in srgb, var(--quest-main) 28%, transparent);
}

.ach-card--maxed {
  border-color: var(--quest-main);
  background: var(--quest-soft);
}

.ach-info-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  min-width: 28px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--quest-dark);
  opacity: 0.4;
  cursor: pointer;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.ach-info-btn:hover,
.ach-info-btn:focus-visible {
  opacity: 0.85;
  background: color-mix(in srgb, var(--quest-soft) 80%, transparent);
}

.ach-card__main {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 18px;
}

.ach-card__icon {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--quest-main);
  background: var(--quest-soft);
}

.ach-card--locked .ach-card__icon {
  color: color-mix(in srgb, var(--quest-main) 75%, var(--text-secondary));
}

.ach-card--pending .ach-card__icon,
.ach-card--active .ach-card__icon,
.ach-card--claimed .ach-card__icon,
.ach-card--maxed .ach-card__icon {
  color: var(--quest-main);
  background: var(--quest-soft);
}

.ach-card__body {
  flex: 1;
  min-width: 0;
}

.ach-card__title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.ach-card__name {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.ach-card__stage {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--quest-dark);
  background: var(--quest-soft);
  padding: 2px 8px;
  border-radius: 10px;
}

.ach-card__stage-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--quest-dark);
  margin-top: 2px;
}

.ach-card__desc {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 1px;
}

.ach-card__hint {
  font-size: 0.75rem;
  font-weight: 700;
  margin-top: 4px;
}

.ach-card__hint--claim { color: var(--quest-dark); }
.ach-card__hint--done  { color: var(--quest-dark); }

.ach-card__action {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.ach-card__action .ach-claim-btn {
  color: var(--color-fox);
}

.ach-card__check {
  display: flex;
  padding: 6px;
  border-radius: 50%;
  background: var(--quest-main);
  color: #fff;
  box-shadow: 0 3px 0 var(--quest-dark);
}

.ach-card__progress {
  margin-top: 2px;
}

.ach-card__progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--quest-dark);
  margin-bottom: 4px;
}

.ach-card__progress-bar {
  height: 6px;
  border-radius: 6px;
  background: var(--quest-soft);
}

.ach-card__progress-fill {
  background: var(--quest-main);
  border-radius: 6px;
}

.ach-card__req {
  margin-top: 2px;
  padding: 8px 12px;
  background: var(--quest-soft);
  border: 1px solid color-mix(in srgb, var(--quest-main) 18%, transparent);
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--quest-dark);
  line-height: 1.35;
}

.ach-card__req[hidden] {
  display: none !important;
}

.achievements-accordion {
  margin-top: 1rem;
  border-top: 1.5px dashed var(--color-neutral-200, #E5E5E5);
  padding-top: 1rem;
}

.achievements-accordion__summary {
  cursor: pointer;
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  padding: 4px 0;
  list-style: none;
}

.achievements-accordion__summary::-webkit-details-marker {
  display: none;
}

.achievements-accordion__list {
  margin-top: 12px;
}

.accordion-arrow {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--color-primary);
}

.accordion-arrow__icon {
  display: inline-block;
  line-height: 1;
  transform: rotate(-90deg);
  transition: transform 0.2s ease;
}

.achievements-accordion[open] .accordion-arrow__icon {
  transform: rotate(0deg);
}

.accordion-arrow__label--open {
  display: none;
}

.achievements-accordion[open] .accordion-arrow__label--closed {
  display: none;
}

.achievements-accordion[open] .accordion-arrow__label--open {
  display: inline;
}

.quests-content {
  width: 100%;
  max-width: 580px;
  margin: 0 auto;
  padding: var(--space-6) var(--page-padding);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.quest-card {
  min-height: 104px;
  padding: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-xl);
  background: var(--surface-default);
}

.quest-card-primary {
  border-color: var(--card-secondary-border);
  background: var(--card-secondary-background);
  color: var(--card-secondary-text);
}

.quest-icon {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  display: grid;
  place-items: center;
  border-radius: 17px;
  background: var(--surface-default);
}

.quest-icon-green { background: var(--color-primary-xlight); }
.quest-icon-speaking { background: var(--color-speaking-xlight); }

/* Einheitliches Farbschema pro Aufgabe via CSS-Variablen */
.quest-card-themed {
  border-color: var(--quest-soft);
  background: var(--surface-default);
}

.quest-card-themed .quest-icon {
  background: var(--quest-soft);
}

.quest-card-themed .quest-xp-reward {
  background: var(--quest-soft);
  color: var(--quest-dark);
}

.quest-card-themed .quest-progress {
  background: var(--quest-soft);
}

.quest-card-themed .quest-progress i {
  background: var(--quest-main);
}

.quest-card-themed .quest-progress-row strong {
  color: var(--quest-dark);
}

.quest-card-themed .quest-arrow {
  border: none;
  background: var(--quest-main);
  box-shadow: 0 4px 0 var(--quest-dark);
}

.quest-card-themed .quest-arrow:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--quest-dark);
}

.quest-card-themed.quest-card-done {
  border-color: var(--quest-main);
  background: var(--quest-soft);
}

.quest-card-themed.quest-card-done .quest-done {
  border: none;
  background: var(--quest-main);
  box-shadow: 0 3px 0 var(--quest-dark);
}

.quest-xp-reward {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: var(--weight-black);
}

.quest-card-done .quest-xp-reward {
  opacity: 0.85;
}

.quest-label {
  color: var(--text-secondary);
  font-size: 0.68rem;
  font-weight: var(--weight-black);
  letter-spacing: 0.08em;
}

.quest-copy h2 {
  color: var(--text-primary);
  font-size: var(--text-md);
  font-weight: var(--weight-black);
  line-height: 1.2;
}

.quest-copy p {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

.quest-progress-row {
  margin-top: 9px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.quest-progress {
  height: 11px;
  flex: 1;
  overflow: hidden;
  border-radius: var(--border-radius-full);
  background: var(--color-secondary-soft);
}

.quest-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--color-secondary);
}

.quest-progress-row strong {
  color: var(--color-secondary-dark);
  font-size: var(--text-xs);
}

.quest-copy { min-width: 0; flex: 1; }

.quest-arrow,
.quest-done {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border: 2px solid var(--card-secondary-border);
  border-radius: 14px;
  background: var(--surface-default);
  box-shadow: var(--shadow-card-secondary);
}

.quest-arrow:active { transform: translateY(2px); box-shadow: var(--shadow-card-secondary-pressed); }
.quest-arrow-green { border-color: var(--card-primary-border); box-shadow: var(--card-primary-shadow); }
.quest-arrow-speaking { border-color: var(--card-speaking-border); box-shadow: var(--card-speaking-shadow); }
.quest-arrow-green:active { box-shadow: var(--shadow-card-primary-pressed); }
.quest-arrow-speaking:active { box-shadow: var(--shadow-card-speaking-pressed); }

.quest-done {
  border-color: var(--color-primary-dark);
  background: var(--color-primary);
  box-shadow: none;
}

.quests-reset {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  text-align: center;
}

.quests-summary {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-xl);
  background: var(--surface-default);
}

.quests-summary-ring {
  position: relative;
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
}

.quests-summary-ring svg {
  width: 100%;
  height: 100%;
}

.quests-summary-ring strong {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: var(--text-md);
  font-weight: var(--weight-black);
  color: var(--color-primary);
}

.quests-summary-copy h2 {
  font-size: var(--text-md);
  font-weight: var(--weight-black);
  color: var(--text-primary);
}

.quests-summary-copy p {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

.quest-card-done {
  border-color: var(--color-primary-dark);
  background: rgba(88, 204, 2, 0.08);
}

.quest-card-ready {
  border-color: #FF9600;
  background: rgba(255, 150, 0, 0.1);
  animation: questReadyPulse 2s ease-in-out infinite;
}

.quest-card-themed.quest-card-ready {
  border-color: var(--quest-main);
  background: var(--quest-soft);
  animation: questReadyPulseThemed 2s ease-in-out infinite;
}

@keyframes questReadyPulseThemed {
  0%, 100% { box-shadow: 0 0 0 rgba(0, 0, 0, 0); }
  50% { box-shadow: 0 0 16px color-mix(in srgb, var(--quest-main) 40%, transparent); }
}

@keyframes questReadyPulse {
  0%, 100% { box-shadow: 0 0 0 rgba(255, 150, 0, 0); }
  50% { box-shadow: 0 0 18px rgba(255, 150, 0, 0.25); }
}

.quest-chest-btn {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  display: grid;
  place-items: center;
  border: 2px solid #FF9600;
  border-bottom-width: 4px;
  border-radius: 14px;
  background: #FFE08A;
  cursor: pointer;
}

.quest-chest-btn:active {
  transform: translateY(2px);
  border-bottom-width: 2px;
}

.quest-claim-hint {
  margin-top: 6px;
  color: #FF9600;
  font-size: var(--text-sm);
  font-weight: var(--weight-black);
}

.quest-icon-practice {
  background: rgba(206, 130, 255, 0.15);
}

.quest-xp-badge {
  margin-top: 4px;
  color: var(--color-primary);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
}

.quests-empty {
  text-align: center;
  color: var(--text-secondary);
  font-weight: var(--weight-semibold);
  padding: var(--space-6);
}

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

  .home-action-card {
    min-height: 140px;
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ============================================================
   DAILY SPEAKING – aligned with the friendly game UI
   ============================================================ */
.page-speaking {
  padding: 0 0 calc(var(--nav-height) + var(--space-8));
  background: var(--bg-base);
}

.page-topbar-title,
.speaking-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 5.5vw, 1.75rem);
  font-weight: var(--weight-black);
  line-height: var(--line-tight);
  color: var(--text-primary);
}

.daily-speaking-content {
  width: 100%;
  max-width: 580px;
  margin: 0 auto;
  padding: var(--space-6) var(--page-padding) 0;
}

.daily-speaking-progress-card {
  padding: var(--space-4);
  border: 2px solid var(--card-speaking-border);
  border-radius: var(--border-radius-xl);
  background: var(--card-speaking-background);
  color: var(--card-speaking-text);
}

.daily-speaking-progress-track {
  height: 14px;
  padding: 3px;
  overflow: hidden;
  border-radius: var(--border-radius-full);
  background: var(--card-speaking-border);
}

.daily-speaking-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--color-speaking);
  transition: width var(--duration-base) var(--ease-standard);
}

.daily-speaking-progress-card p {
  margin: 9px 0 0;
  color: var(--card-speaking-text);
  font-size: var(--text-sm);
  font-weight: var(--weight-black);
  text-align: center;
}

.daily-speaking-task-list {
  margin: var(--space-5) 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
}

.daily-speaking-task {
  min-width: 0;
  min-height: 48px;
  padding: 11px 5px;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-md);
  background: var(--surface-default);
  box-shadow: var(--shadow-card-neutral);
  color: var(--text-primary);
  font-family: var(--font-display);
  cursor: pointer;
  transition: transform var(--duration-fast), box-shadow var(--duration-fast), border-color var(--duration-fast);
}

.daily-speaking-task:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: var(--shadow-card-neutral-pressed);
}

.daily-speaking-task.is-selected {
  border-color: var(--card-speaking-border);
  background: var(--card-speaking-background);
  color: var(--card-speaking-text);
  box-shadow: var(--card-speaking-shadow);
}

.daily-speaking-task.is-selected:active:not(:disabled) {
  box-shadow: var(--shadow-card-speaking-pressed);
}

.daily-speaking-task.is-completed {
  border-color: var(--card-primary-border);
  background: var(--card-primary-background);
  color: var(--card-primary-text);
  box-shadow: none;
  cursor: default;
}

.daily-speaking-task-icon {
  min-height: 23px;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.daily-speaking-task-title {
  display: block;
  font-size: 0.74rem;
  font-weight: var(--weight-black);
}

.daily-speaking-task small {
  display: block;
  margin-top: 2px;
  color: var(--text-secondary);
  font-size: 0.65rem;
  font-weight: var(--weight-bold);
}

.daily-speaking-card {
  margin-top: var(--space-5);
  padding: clamp(20px, 5vw, 32px) clamp(16px, 4vw, 24px);
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-xl);
  background: var(--surface-default);
  text-align: center;
}

.daily-speaking-complete {
  margin-top: var(--space-5);
  padding: clamp(28px, 7vw, 40px) clamp(20px, 5vw, 32px);
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 2px solid var(--card-speaking-border);
  border-radius: var(--border-radius-xl);
  background: var(--card-speaking-background);
  box-shadow: var(--card-speaking-shadow);
  color: var(--card-speaking-text);
  text-align: center;
}

.daily-speaking-complete-hero {
  margin-bottom: var(--space-4);
}

.daily-speaking-complete-icon {
  width: 80px;
  height: 80px;
  display: grid;
  place-items: center;
  border-radius: var(--border-radius-full);
  background: var(--color-success);
  box-shadow: 0 8px 20px rgba(var(--color-success-rgb), 0.35);
}

.daily-speaking-complete-label {
  display: inline-block;
  margin-bottom: var(--space-2);
  padding: 4px 11px;
  border-radius: var(--border-radius-full);
  background: rgba(var(--color-speaking-rgb), 0.14);
  color: var(--color-speaking-dark);
  font-size: var(--text-xs);
  font-weight: var(--weight-black);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.daily-speaking-complete h2 {
  margin: 0;
  max-width: 18ch;
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 5vw, 1.65rem);
  font-weight: var(--weight-black);
  color: var(--color-speaking-dark);
  line-height: 1.2;
}

.daily-speaking-complete-lead {
  max-width: 320px;
  margin: var(--space-3) 0 0;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  line-height: var(--line-relaxed);
}

.daily-speaking-complete-lead strong {
  color: var(--color-secondary);
  font-weight: var(--weight-black);
}

.daily-speaking-complete-footer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: var(--space-5) 0 0;
  padding-top: var(--space-4);
  border-top: 2px solid var(--card-speaking-border);
  width: 100%;
  max-width: 320px;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  line-height: var(--line-relaxed);
}

.daily-speaking-graphic {
  width: 82px;
  height: 82px;
  margin: 0 auto var(--space-4);
  display: grid;
  place-items: center;
  border-radius: 24px;
  background: var(--color-speaking-xlight);
}

.daily-speaking-task-meta {
  margin-bottom: var(--space-4);
}

.daily-speaking-task-meta strong,
.daily-speaking-task-meta span {
  display: block;
}

.daily-speaking-task-meta strong {
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-black);
}

.daily-speaking-task-meta span {
  margin-top: 3px;
  color: var(--color-speaking-dark);
  font-size: var(--text-xs);
  font-weight: var(--weight-black);
}

.daily-speaking-task-meta p {
  margin: var(--space-2) 0 0;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

.daily-speaking-phrase {
  padding: var(--space-5);
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  background: var(--color-neutral-100);
}

#spk-target-fr {
  margin-bottom: 6px;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 5vw, 1.45rem);
  font-weight: var(--weight-black);
  line-height: var(--line-snug);
}

#spk-target-de {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

.daily-speaking-mic-wrap {
  margin-top: var(--space-6);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}

.daily-speaking-mic {
  width: 84px;
  height: 84px;
  min-height: 84px;
  padding: 0;
  border-radius: var(--border-radius-full);
}

.daily-speaking-mic:active:not(:disabled) {
  transform: none;
}

#spk-status-text {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
}

.daily-speaking-score {
  margin-top: var(--space-5);
  padding: var(--space-4);
  border: 2px solid var(--card-speaking-border);
  border-radius: var(--border-radius-lg);
  background: var(--card-speaking-background);
  color: var(--card-speaking-text);
}

#spk-score-val {
  color: var(--color-speaking-dark);
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: var(--weight-black);
}

#spk-score-msg {
  margin-top: 4px;
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
}

#spk-score-transcript {
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-style: italic;
}

@media (max-width: 390px) {
  .page-topbar-title { font-size: 1.25rem; }
  .home-topbar .status-pill { min-height: 40px; padding: 5px 8px; }
  .daily-speaking-content { padding-top: var(--space-4); }
}

/* Compact phones and narrow split-screen windows. */
@media (max-width: 400px) {
  .home-topbar {
    gap: 7px;
    padding-left: max(10px, env(safe-area-inset-left, 0px));
    padding-right: max(10px, env(safe-area-inset-right, 0px));
  }

  .home-brand {
    flex: 0 0 auto;
  }

  .home-brand > span:last-child {
    display: inline;
  }

  .home-status {
    min-width: 0;
    gap: 5px;
  }

  .status-pill {
    min-width: 0;
    padding-inline: 7px;
  }

  .daily-speaking-task-list {
    grid-template-columns: 1fr;
  }

  .daily-speaking-task {
    padding: 11px 12px;
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    column-gap: var(--space-2);
    text-align: left;
  }

  .daily-speaking-task-icon {
    grid-row: 1 / span 2;
    margin: 0;
  }

  .daily-speaking-task-title,
  .daily-speaking-task small {
    font-size: var(--text-xs);
  }

  .stats-level-meta {
    flex-direction: column;
    align-items: center;
    gap: 2px;
  }

  .ach-info-btn {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
  }
}

@media (max-width: 340px) {
  .ps-grid {
    grid-template-columns: 1fr;
  }

  .mp-board {
    gap: var(--space-2);
  }

  .mp-col {
    gap: var(--space-2);
  }

  .mp-tile {
    padding-inline: var(--space-2);
  }

  .wm-tile-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .am-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
