:root {
  --green: #009246;
  --white: #f5f5f5;
  --red: #ce2b37;
  --bg: #fafafa;
  --card-bg: #ffffff;
  --text: #2c2c2c;
  --text-light: #666;
  --shadow: 0 2px 8px rgba(0,0,0,0.1);
  --radius: 10px;
  --correct: #2e7d32;
  --incorrect: #c62828;
  --accent: #1565c0;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* Header */
.header {
  background: linear-gradient(135deg, var(--green), #00a854);
  color: white;
  padding: 1.5rem 2rem;
  text-align: center;
  box-shadow: var(--shadow);
}

.header h1 {
  font-size: 1.8rem;
  margin-bottom: 0.25rem;
}

.header p {
  opacity: 0.9;
  font-size: 0.95rem;
}

/* Flag stripe accent */
.flag-stripe {
  height: 4px;
  background: linear-gradient(to right, var(--green) 33%, var(--white) 33%, var(--white) 66%, var(--red) 66%);
}

/* Container */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* Lesson Cards */
.lesson-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  transition: transform 0.15s;
}

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

.lesson-card h2 {
  font-size: 1.3rem;
  margin-bottom: 0.4rem;
  color: var(--green);
}

.lesson-card .description {
  color: var(--text-light);
  margin-bottom: 1rem;
  font-size: 0.9rem;
  line-height: 1.4;
}

.lesson-card .best-score {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 1rem;
}

.difficulty-buttons {
  display: flex;
  gap: 0.75rem;
}

.difficulty-buttons button {
  flex: 1;
  padding: 0.65rem 1rem;
  border: 2px solid;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-easy {
  border-color: var(--correct);
  color: var(--correct);
  background: white;
}
.btn-easy:hover {
  background: var(--correct);
  color: white;
}

.btn-medium {
  border-color: #e67e22;
  color: #e67e22;
  background: white;
}
.btn-medium:hover {
  background: #e67e22;
  color: white;
}

.btn-hard {
  border-color: var(--incorrect);
  color: var(--incorrect);
  background: white;
}
.btn-hard:hover {
  background: var(--incorrect);
  color: white;
}

/* Lesson Page */
.lesson-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.lesson-header .back-link {
  color: white;
  text-decoration: none;
  font-size: 0.9rem;
  opacity: 0.9;
}

.lesson-header .back-link:hover {
  opacity: 1;
}

.stats-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--card-bg);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
}

.stats-bar .points {
  font-weight: 700;
  color: var(--green);
}

.stats-bar .difficulty-badge {
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  color: white;
}
.difficulty-badge.easy { background: var(--correct); }
.difficulty-badge.medium { background: #e67e22; }
.difficulty-badge.hard { background: var(--incorrect); }

/* Progress Bar */
.progress-container {
  background: #e0e0e0;
  border-radius: 10px;
  height: 8px;
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--green), #00c853);
  border-radius: 10px;
  transition: width 0.4s ease;
}

/* Question Card */
.question-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  text-align: center;
}

.question-number {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 1rem;
}

.english-hint {
  font-size: 1rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
  font-style: italic;
}

.hint-actions {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.hint-btn {
  background: none;
  border: 1px dashed #aaa;
  border-radius: 6px;
  padding: 0.3rem 0.8rem;
  color: #888;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
}

.hint-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.english-text {
  font-size: 1rem;
  color: var(--accent);
  margin-bottom: 1.5rem;
  font-style: italic;
}

.hint-text {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 1rem;
  font-style: italic;
}

.italian-sentence {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 2rem;
  line-height: 1.6;
}

.blank {
  display: inline-block;
  min-width: 120px;
  border-bottom: 3px solid var(--green);
  margin: 0 0.25rem;
  padding: 0.1rem 0.5rem;
  color: var(--green);
  font-weight: 700;
}

/* Options Grid */
.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.option-btn {
  padding: 0.85rem 1.25rem;
  border: 2px solid #ddd;
  border-radius: 8px;
  background: white;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.15s;
  font-weight: 500;
}

.option-btn:hover:not(:disabled) {
  border-color: var(--accent);
  background: #e3f2fd;
}

.option-btn:disabled {
  cursor: default;
}

.option-btn.correct {
  border-color: var(--correct);
  background: #e8f5e9;
  color: var(--correct);
}

.option-btn.incorrect {
  border-color: var(--incorrect);
  background: #ffebee;
  color: var(--incorrect);
}

/* Text Input (Hard mode) */
.answer-input-group {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.answer-input {
  padding: 0.75rem 1.25rem;
  font-size: 1.1rem;
  border: 2px solid #ddd;
  border-radius: 8px;
  outline: none;
  width: 220px;
  text-align: center;
  transition: border-color 0.15s;
}

.answer-input:focus {
  border-color: var(--accent);
}

.submit-btn {
  padding: 0.75rem 1.5rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.submit-btn:hover {
  background: #0d47a1;
}

.submit-btn:disabled {
  background: #bbb;
  cursor: default;
}

/* Feedback */
.feedback {
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 1rem;
  font-weight: 600;
  display: none;
}

.feedback.show { display: block; }

.feedback.correct {
  background: #e8f5e9;
  color: var(--correct);
  border: 1px solid #a5d6a7;
}

.feedback.incorrect {
  background: #ffebee;
  color: var(--incorrect);
  border: 1px solid #ef9a9a;
}

.feedback .accent-note {
  font-weight: 400;
  font-size: 0.9rem;
  margin-top: 0.3rem;
}

/* Next Button */
.next-btn {
  padding: 0.75rem 2rem;
  background: var(--green);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  display: none;
}

.next-btn.show { display: inline-block; }

.next-btn:hover {
  background: #007a3a;
}

/* Results Page */
.results-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2.5rem;
  text-align: center;
}

.results-card h2 {
  font-size: 1.6rem;
  color: var(--green);
  margin-bottom: 0.5rem;
}

.results-card .subtitle {
  color: var(--text-light);
  margin-bottom: 2rem;
}

.results-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-box {
  padding: 1rem;
  background: var(--bg);
  border-radius: 8px;
}

.stat-box .stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--green);
}

.stat-box .stat-label {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 0.25rem;
}

.results-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.results-actions a {
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-primary {
  background: var(--green);
  color: white;
}
.btn-primary:hover {
  background: #007a3a;
}

.btn-secondary {
  background: white;
  color: var(--green);
  border: 2px solid var(--green);
}
.btn-secondary:hover {
  background: #e8f5e9;
}

/* Post-answer actions (listen + next) */
.post-answer-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  align-items: center;
}

.listen-btn {
  padding: 0.65rem 1.25rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  display: none;
}

.listen-btn.show { display: inline-block; }

.listen-btn:hover:not(:disabled) {
  background: #0d47a1;
}

.listen-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

/* Admin Page */
.admin-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.admin-card h2 {
  font-size: 1.3rem;
  color: var(--green);
  margin-bottom: 0.4rem;
}

.admin-card .description {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-light);
}

.form-input {
  padding: 0.6rem 0.8rem;
  border: 2px solid #ddd;
  border-radius: 6px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.15s;
}

.form-input:focus {
  border-color: var(--accent);
}

.generate-btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  align-self: flex-start;
}

.generate-btn:disabled {
  background: #bbb;
  cursor: default;
}

.admin-status {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
}

.admin-status.info {
  background: #e3f2fd;
  color: var(--accent);
  border: 1px solid #90caf9;
}

.admin-status.success {
  background: #e8f5e9;
  color: var(--correct);
  border: 1px solid #a5d6a7;
}

.admin-status.error {
  background: #ffebee;
  color: var(--incorrect);
  border: 1px solid #ef9a9a;
}

.stats-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 0.6rem 0.8rem;
  background: var(--bg);
  border-radius: 6px;
}

.stat-lesson {
  font-weight: 600;
}

.stat-count {
  color: var(--text-light);
}

.admin-link {
  display: inline-block;
  margin-top: 1.5rem;
  color: var(--text-light);
  font-size: 0.85rem;
  text-decoration: none;
}

.admin-link:hover {
  color: var(--accent);
}

/* Question type label (Lesson 3 & 4) */
.question-label {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Arrow between prompt and answer (Lesson 3) */
.answer-arrow {
  font-size: 1.5rem;
  color: var(--text-light);
  margin: 0.25rem 0;
}

/* Answer display slot (Lesson 3: singular-to-plural) */
.answer-slot {
  display: inline-block;
  min-width: 200px;
  min-height: 2rem;
  border-bottom: 3px solid var(--green);
  margin: 0 auto 1.5rem;
  padding: 0.25rem 0.5rem;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--green);
}

/* Word-by-word results (Lesson 3 hard mode) */
.word-by-word-results {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.word-result {
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 500;
}

.word-result.word-correct {
  background: #e8f5e9;
  color: var(--correct);
  border: 1px solid #a5d6a7;
}

.word-result.word-incorrect {
  background: #ffebee;
  color: var(--incorrect);
  border: 1px solid #ef9a9a;
}

.word-result.extra {
  background: #fff3e0;
  color: #e65100;
  border: 1px solid #ffcc80;
  text-decoration: line-through;
}

/* English translation shown after answering */
.english-translation {
  font-size: 0.95rem;
  color: var(--accent);
  font-style: italic;
  margin: 0.75rem 0;
  padding: 0.5rem;
  background: #e3f2fd;
  border-radius: 6px;
}

/* Login Modal */
.login-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.login-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: 0 4px 24px rgba(0,0,0,0.2);
  padding: 2.5rem;
  text-align: center;
  width: 340px;
  max-width: 90vw;
}

.login-card h2 {
  font-size: 1.6rem;
  color: var(--green);
  margin-bottom: 0.3rem;
}

.login-card p {
  color: var(--text-light);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.login-form .form-input {
  text-align: center;
  font-size: 1.1rem;
  padding: 0.75rem;
}

.login-btn {
  padding: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.login-btn:disabled {
  background: #bbb;
  cursor: default;
}

/* User Bar (in header) */
.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 720px;
  margin: 0 auto;
}

.user-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.9);
}

.switch-user-btn {
  background: rgba(255,255,255,0.2);
  color: white;
  border: 1px solid rgba(255,255,255,0.4);
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s;
}

.switch-user-btn:hover {
  background: rgba(255,255,255,0.3);
}

/* Progress Info on lesson cards */
.progress-info {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 1rem;
}

/* Flashcards Link on Home Page */
.flashcards-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.15s;
}

.flashcards-link:hover {
  transform: translateY(-2px);
}

.flashcards-link .link-icon {
  font-size: 2rem;
}

.flashcards-link .link-text h3 {
  color: var(--green);
  font-size: 1.15rem;
  margin-bottom: 0.2rem;
}

.flashcards-link .link-text p {
  color: var(--text-light);
  font-size: 0.85rem;
}

/* Topic Grid */
.topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.topic-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.topic-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.topic-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 0.5rem;
}

.topic-card h3 {
  font-size: 1.05rem;
  color: var(--green);
  margin-bottom: 0.25rem;
}

.topic-count {
  font-size: 0.8rem;
  color: var(--text-light);
}

/* Flashcard Area */
.flashcard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.flashcard-header h2 {
  font-size: 1.3rem;
  color: var(--green);
}

.back-topic-btn {
  background: none;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.15s;
}

.back-topic-btn:hover {
  border-color: var(--green);
  color: var(--green);
}

.card-counter {
  font-size: 0.9rem;
  color: var(--text-light);
  font-weight: 600;
}

/* Flashcard nav arrows */
.flashcard-nav-arrows {
  display: flex;
  justify-content: space-between;
  max-width: 400px;
  margin: 0 auto 0.5rem;
}

.nav-arrow {
  background: none;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 0.3rem 0.8rem;
  font-size: 1.1rem;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.15s;
}

.nav-arrow:hover:not(:disabled) {
  border-color: var(--green);
  color: var(--green);
}

.nav-arrow:disabled {
  opacity: 0.3;
  cursor: default;
}

/* Flashcard with 3D Flip */
.flashcard-container {
  perspective: 1000px;
  margin: 0 auto 1rem;
  max-width: 400px;
}

.flashcard {
  position: relative;
  width: 100%;
  height: 250px;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 0.6s;
}

.flashcard.flipped {
  transform: rotateY(180deg);
}

.flashcard-face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  backface-visibility: hidden;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.3;
}

.flashcard-front {
  background: var(--card-bg);
  color: var(--green);
  border: 3px solid var(--green);
}

.flashcard-back {
  background: var(--green);
  color: white;
  transform: rotateY(180deg);
}

#flashcard-area {
  min-height: calc(100vh - 120px);
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.flip-hint {
  text-align: center;
  color: var(--text-light);
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
  font-style: italic;
}

/* Speak / Listen button */
.flashcard-speak-btn {
  display: block;
  margin: 0 auto 1rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--green);
  background: white;
  color: var(--green);
  font-size: 1.3rem;
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1;
}

.flashcard-speak-btn:hover {
  background: var(--green);
  color: white;
}

.flashcard-speak-btn:disabled {
  opacity: 0.5;
  cursor: wait;
}

.flashcard-speak-btn.speaking {
  animation: pulse-speak 0.6s ease infinite;
}

@keyframes pulse-speak {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* Swipe Indicators (overlay on card) */
.swipe-indicator {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 4rem;
  font-weight: 900;
  opacity: 0;
  transition: opacity 0.1s;
  z-index: 10;
  pointer-events: none;
}

.swipe-indicator.left {
  left: -3rem;
  color: var(--incorrect);
}

.swipe-indicator.right {
  right: -3rem;
  color: var(--correct);
}

/* Card Action Buttons (fallback for non-swipe) */
.card-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.5rem;
}

.action-btn {
  padding: 0.65rem 1.5rem;
  border: 2px solid;
  border-radius: 8px;
  background: white;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.action-btn.dont-know {
  border-color: var(--incorrect);
  color: var(--incorrect);
}

.action-btn.dont-know:hover {
  background: var(--incorrect);
  color: white;
}

.action-btn.know-it {
  border-color: var(--correct);
  color: var(--correct);
}

.action-btn.know-it:hover {
  background: var(--correct);
  color: white;
}

/* Fly-off animations */
.flashcard.fly-left {
  transform: translateX(-150%) rotate(-30deg) !important;
  opacity: 0 !important;
}

.flashcard.fly-right {
  transform: translateX(150%) rotate(30deg) !important;
  opacity: 0 !important;
}

/* Topic Badge */
.topic-badge {
  display: inline-block;
  margin-top: 0.4rem;
  padding: 0.15rem 0.6rem;
  background: #ffebee;
  color: var(--incorrect);
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Review Prompt */
.review-prompt {
  text-align: center;
  padding: 2rem 0;
}

.review-prompt h2 {
  font-size: 1.5rem;
  color: var(--green);
  margin-bottom: 1.5rem;
}

.review-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 300px;
  margin: 0 auto 1.5rem;
}

.review-btn {
  padding: 0.75rem 1.5rem;
  border: 2px solid var(--green);
  border-radius: 8px;
  background: white;
  color: var(--green);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.review-btn:hover {
  background: var(--green);
  color: white;
}

.review-btn.review-missed {
  border-color: #e67e22;
  color: #e67e22;
}

.review-btn.review-missed:hover {
  background: #e67e22;
  color: white;
}

.review-btn.clear-missed {
  border-color: var(--text-light);
  color: var(--text-light);
  font-size: 0.85rem;
}

.review-btn.clear-missed:hover {
  background: var(--text-light);
  color: white;
}

/* Deck Summary */
.deck-summary {
  text-align: center;
  padding: 2rem 0;
}

.deck-summary h2 {
  font-size: 1.6rem;
  color: var(--green);
  margin-bottom: 1.5rem;
}

.summary-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 2rem;
}

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

.summary-value {
  display: block;
  font-size: 2.5rem;
  font-weight: 700;
}

.summary-stat.knew .summary-value {
  color: var(--correct);
}

.summary-stat.missed .summary-value {
  color: var(--incorrect);
}

.summary-label {
  font-size: 0.9rem;
  color: var(--text-light);
}

/* Loading */
.loading {
  text-align: center;
  padding: 3rem;
  color: var(--text-light);
}

/* Responsive */
@media (max-width: 500px) {
  .container { padding: 1rem; }
  .header h1 { font-size: 1.4rem; }
  .italian-sentence { font-size: 1.2rem; }
  .options-grid { grid-template-columns: 1fr; }
  .results-stats { grid-template-columns: 1fr; }
  .difficulty-buttons { flex-direction: column; }
  .answer-input-group { flex-direction: column; align-items: center; }
  .results-actions { flex-direction: column; }
  .word-by-word-results { gap: 0.5rem; }
  .answer-slot { min-width: 150px; }
  .topics-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .flashcard-face { font-size: 1.5rem; }
  .flashcard { height: 200px; }
  .flashcard-header { flex-wrap: wrap; gap: 0.5rem; }
  .swipe-indicator { font-size: 2.5rem; }
  .swipe-indicator.left { left: -1.5rem; }
  .swipe-indicator.right { right: -1.5rem; }
  .card-actions { flex-direction: column; align-items: center; }
  #flashcard-area { min-height: calc(100vh - 100px); padding-bottom: 3rem; }
}
