* {
  box-sizing: border-box;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  margin: 0;
  padding: 0;
  background: #f5f7fa;
  direction: ltr;
  overflow-x: hidden;
}

/* Utility classes for CSP-compliant show/hide */
.hidden {
  display: none !important;
}

.flex-display {
  display: flex !important;
}

/* Utility class for preventing body scroll (mobile menu) */
body.body-no-scroll {
  overflow: hidden !important;
}

/* Utility class for spacing */
.step-spacing-top {
  margin-top: 2rem !important;
}

.header {
  background: linear-gradient(135deg, #2c7a7b 0%, #2d5f5d 100%);
  color: white;
  padding: 0.75rem 1rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 0.75rem;
}

.header-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.header-logo img {
  height: 28px;
  width: auto;
}

@media (min-width: 768px) {
  .header-logo img {
    height: 36px;
  }
}

.header h1 {
  margin: 0;
  font-size: 1rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (min-width: 768px) {
  .header {
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
  }

  .header h1 {
    font-size: 1.5rem;
    flex: 1;
    white-space: normal;
  }
}

.header-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.btn {
  padding: 0.4rem 0.75rem;
  background: rgba(255,255,255,0.2);
  color: white;
  text-decoration: none;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.3);
  cursor: pointer;
  transition: background 0.2s;
  font-size: 0.85rem;
  white-space: nowrap;
}

@media (min-width: 768px) {
  .header-actions {
    gap: 1rem;
  }

  .btn {
    padding: 0.5rem 1rem;
    font-size: 1rem;
  }
}

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

.btn-primary {
  background: white;
  color: #667eea;
  border: none;
}

.btn-primary:hover {
  background: #f0f0f0;
}

.btn-signup {
  background: #22c55e;
  color: white;
  border: none;
  font-weight: 600;
}

.btn-signup:hover {
  background: #16a34a;
}

.btn-admin {
  background: #f59e0b;
  color: white;
  border: none;
  font-weight: 600;
}

.btn-admin:hover {
  background: #d97706;
}

.lesson-container {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 60px); /* Mobile: allow natural expansion */
  position: relative;
}

@media (min-width: 768px) {
  .lesson-container {
    flex-direction: row;
    height: calc(100vh - 70px); /* Desktop: fixed height for sidebar layout */
    min-height: auto;
  }
}

/* Mobile overlay backdrop */
.mobile-overlay-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-overlay-backdrop.visible {
  display: block;
  opacity: 1;
}

/* Mobile sections toggle button */
.mobile-only {
  display: block;
}

@media (min-width: 768px) {
  .mobile-only {
    display: none;
  }
}

/* Sidebar with sections */
.sections-sidebar {
  position: fixed;
  left: -100%;
  top: 60px;
  bottom: 0;
  width: 85%;
  max-width: 320px;
  background: white;
  padding: 1rem;
  overflow-y: auto;
  z-index: 1000;
  transition: left 0.3s ease;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.sections-sidebar.mobile-open {
  left: 0;
}

@media (min-width: 768px) {
  .sections-sidebar {
    position: relative;
    left: 0;
    top: auto;
    bottom: auto;
    width: 300px;
    max-width: none;
    border-right: 1px solid #e0e0e0;
    padding: 1.5rem;
    box-shadow: none;
    transition: none;
  }
}

.lesson-info {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #e0e0e0;
}

.lesson-info h2 {
  margin: 0 0 0.5rem 0;
  font-size: 1.2rem;
  color: #333;
}

.sections-title {
  margin: 0 0 1.5rem 0;
  padding-bottom: 1rem;
  border-bottom: 2px solid #e0e0e0;
  font-size: 1.3rem;
  color: #333;
  font-weight: 600;
}

@media (min-width: 768px) {
  .sections-title {
    font-size: 1.4rem;
  }
}

.flashcard-display {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 1rem;
  border-radius: 12px;
  text-align: center;
  margin: 0.75rem 0;
}

@media (min-width: 768px) {
  .flashcard-display {
    padding: 1.5rem;
    margin: 1rem 0;
  }
}

.flashcard-hebrew {
  font-size: 2rem;
  color: white;
  margin-bottom: 0.25rem;
  font-weight: bold;
}

@media (min-width: 768px) {
  .flashcard-hebrew {
    font-size: 3rem;
    margin-bottom: 0.5rem;
  }
}

.flashcard-transliteration {
  font-size: 1rem;
  color: rgba(255,255,255,0.9);
  font-style: italic;
  margin-bottom: 0.25rem;
}

@media (min-width: 768px) {
  .flashcard-transliteration {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
  }
}

.flashcard-translation {
  font-size: 0.95rem;
  color: white;
  font-weight: 600;
}

@media (min-width: 768px) {
  .flashcard-translation {
    font-size: 1.1rem;
  }
}

.sections-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.section-item {
  padding: 1rem;
  margin-bottom: 0.5rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid #e0e0e0;
}

.section-item:hover {
  background: #f8f9fa;
}

.section-item.active {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

.section-item.completed {
  border-color: #4caf50;
  background: #f1f8f4;
}

.section-item.completed .section-icon {
  color: #4caf50;
}

.section-item.active.completed {
  background: #4caf50;
  border-color: #4caf50;
  color: white;
}

.section-item.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: #e8e8e8;
  border-color: #ccc;
  pointer-events: none;
  color: #999;
}

.section-item.disabled:hover {
  background: #e8e8e8;
  transform: none;
  box-shadow: none;
}

.section-item.disabled .section-icon {
  opacity: 0.5;
  filter: grayscale(100%);
}

.section-item.disabled .section-title {
  color: #999;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}

.section-icon {
  font-size: 1.5rem;
}

.section-title {
  font-weight: 600;
  font-size: 1rem;
}

.section-checkmark {
  margin-left: auto;
}

.section-lock {
  margin-left: auto;
  font-size: 1rem;
}

.section-description {
  font-size: 0.85rem;
  opacity: 0.8;
  margin-left: 2.25rem;
}

/* Main content area */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: white;
  width: 100%;
  /* Mobile: no fixed height, content expands naturally */
}

@media (min-width: 768px) {
  .main-content {
    width: auto;
    height: 100%; /* Desktop: fixed height for sidebar layout */
  }
}

.content-header {
  padding: 1rem;
  border-bottom: 1px solid #e0e0e0;
  background: #f8f9fa;
}

.content-header h2 {
  margin: 0 0 0.25rem 0;
  color: #333;
  font-size: 1.1rem;
}

.content-header p {
  margin: 0;
  color: #666;
  font-size: 0.9rem;
}

@media (min-width: 768px) {
  .content-header {
    padding: 1.5rem 2rem;
  }

  .content-header h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
  }

  .content-header p {
    font-size: 1rem;
  }
}

.glyph-image {
  max-width: 100%;
  margin: 0.75rem auto;
  display: block;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

@media (min-width: 768px) {
  .glyph-image {
    max-width: 300px;
    margin: 1rem auto;
  }
}

/* Chat area */
.chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: visible; /* Mobile: allow natural expansion, no nested scroll */
  min-height: auto;
}

@media (min-width: 768px) {
  .chat-container {
    overflow: hidden; /* Desktop: contained within fixed layout */
    min-height: 300px;
  }
}

.chat-messages {
  flex: 1;
  overflow-y: visible; /* Mobile: natural page scroll */
  padding: 0.25rem;
  background: #fafafa;
}

@media (min-width: 768px) {
  .chat-messages {
    overflow-y: auto; /* Desktop: scroll within container */
    padding: 0.5rem;
  }
}

.message {
  margin-bottom: 1.5rem;
  display: flex;
  gap: 1rem;
}

.message-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.message.user .message-avatar {
  background: #667eea;
  color: white;
}

.message.assistant .message-avatar {
  background: #4caf50;
  color: white;
}

.message-content {
  flex: 1;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  line-height: 1.6;
}

.message.user .message-content {
  background: #667eea;
  color: white;
}

.message.assistant .message-content {
  background: white;
  color: #333;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.chat-input-area {
  padding: 1rem;
  border-top: 1px solid #e0e0e0;
  background: white;
}

@media (min-width: 768px) {
  .chat-input-area {
    padding: 1.5rem 2rem;
  }
}

.input-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

@media (min-width: 768px) {
  .input-container {
    flex-direction: row;
    gap: 1rem;
  }
}

#message-input {
  flex: 1;
  padding: 0.75rem;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  resize: none;
  font-family: inherit;
  min-height: 80px;
}

@media (min-width: 768px) {
  #message-input {
    padding: 1rem;
    min-height: auto;
  }
}

#message-input:focus {
  outline: none;
  border-color: #667eea;
}

#send-button {
  padding: 0.75rem 1.5rem;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  width: 100%;
}

@media (min-width: 768px) {
  #send-button {
    padding: 1rem 2rem;
    width: auto;
  }
}

#send-button:hover {
  background: #5568d3;
}

#send-button:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.section-complete-btn {
  width: 100%;
  padding: 1rem;
  background: #4caf50;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 1rem;
  display: none;
}

.section-complete-btn.visible {
  display: block;
}

.section-complete-btn:hover {
  background: #45a049;
}

.loading {
  text-align: center;
  padding: 2rem;
  color: #666;
}

.error {
  background: #f44336;
  color: white;
  padding: 1rem;
  border-radius: 8px;
  margin: 1rem;
}

/* Vocabulary Learning Styles */
.vocab-learning-container {
  padding: 0.5rem;
  width: 100%;
  max-width: none;
  margin: 0;
}

@media (min-width: 768px) {
  .vocab-learning-container {
    padding: 1rem;
    max-width: none;
  }
}

.vocab-flashcard-large {
  background: #ffffff;
  border: none;
  padding: 1.25rem;
  border-radius: 16px;
  text-align: center;
  margin-bottom: 1rem;
  box-shadow: none;
}

.vocab-glyph-image {
  max-width: 100%;
  height: auto;
  max-height: 200px;
  border-radius: 12px;
  margin-bottom: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.glyph-fallback {
  font-size: 3rem;
  text-align: center;
  padding: 2rem;
}

.glyph-description {
  text-align: center;
  color: #4a5568;
  font-size: 1rem;
  margin: 0.5rem 0 1rem;
  padding: 0 1rem;
}

.sight-word-note {
  text-align: center;
  color: #4a5568;
  font-size: 1rem;
  margin: 1rem auto;
  padding: 0.75rem 1rem;
  background: #f7fafc;
  border-radius: 8px;
  max-width: 500px;
}

.vocab-hebrew {
  font-size: 2.5rem;
  color: #1a202c;
  font-weight: bold;
  margin: 1rem 0;
  text-align: center;
}

@media (min-width: 768px) {
  .vocab-hebrew {
    font-size: 3rem;
  }
}

.vocab-hebrew-large {
  font-size: 4rem;
  color: #1a202c;
  font-weight: bold;
  margin: 2rem 0;
  text-align: center;
  text-shadow: none;
}

@media (min-width: 768px) {
  .vocab-hebrew-large {
    font-size: 6rem;
  }
}

.vocab-transliteration {
  font-size: 1.3rem;
  color: #2d3748;
  font-style: italic;
  margin-bottom: 0.4rem;
}

.vocab-translation {
  font-size: 1.1rem;
  color: #2d3748;
  font-weight: 600;
  margin-bottom: 1rem;
}

.vocab-translation-spaced {
  margin-top: 1.5rem;
}

.vocab-audio-controls {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Audio play buttons in vocab sections */
.audio-play-btn {
  animation: pulse-glow 2s infinite;
}

.vocab-btn {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin: 0.5rem;
}

.vocab-btn-primary {
  background: #2c7a7b;
  color: white;
}

.vocab-btn-primary:hover {
  background: #234e52;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.vocab-btn-primary:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
}

.vocab-btn-secondary {
  background: #4caf50;
  color: white;
}

.vocab-btn-secondary:hover {
  background: #45a049;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.vocab-btn-secondary.listening {
  background: #ff9800;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* Introduction Section */
.vocab-introduction {
  background: #ffffff;
  border: none;
  color: #1a202c;
  padding: 0;
  border-radius: 0;
  margin-bottom: 0.5rem;
  box-shadow: none;
  text-align: center;
}

.vocab-introduction h2 {
  margin: 0 0 1rem 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a202c;
  text-shadow: none;
}

.intro-content {
  background: transparent;
  border-radius: 0;
  padding: 0.5rem 0;
  border: none;
}

/* Main Hebrew word display - the star of the page */
.intro-word {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 1.5rem 0;
  padding: 1.5rem;
  background: linear-gradient(135deg, #e6fffa 0%, #f0fff4 100%);
  border-radius: 16px;
}

.intro-hebrew {
  font-size: 5rem;
  font-weight: bold;
  color: #1a202c;
  text-shadow: none;
}

.intro-arrow {
  font-size: 2.5rem;
  color: #2c7a7b;
}

.intro-translation {
  font-size: 2.5rem;
  font-weight: 700;
  color: #2c7a7b;
  text-shadow: none;
}

@media (min-width: 768px) {
  .intro-hebrew {
    font-size: 7rem;
  }

  .intro-arrow {
    font-size: 3rem;
  }

  .intro-translation {
    font-size: 3.5rem;
  }
}

/* Memory tip card - "A silly story" */
.intro-memory-tip {
  background: #fffbeb;
  border: 2px solid #fbbf24;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  margin-top: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  text-align: left;
  box-shadow: 0 2px 8px rgba(251, 191, 36, 0.2);
}

.tip-icon {
  font-size: 2.5rem;
  flex-shrink: 0;
}

.tip-content {
  flex: 1;
}

.tip-label {
  display: block;
  font-size: 0.85rem;
  color: #92400e;
  font-weight: 600;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.intro-memory-tip p {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.5;
  color: #78350f;
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 3px 10px rgba(245, 158, 11, 0.4);
  }
  50% {
    box-shadow: 0 3px 18px rgba(245, 158, 11, 0.7);
  }
}

@media (max-width: 768px) {
  .vocab-introduction h2 {
    font-size: 1.2rem;
  }

  .intro-word {
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
  }

  .intro-hebrew {
    font-size: 4rem;
  }

  .intro-arrow {
    font-size: 2rem;
    transform: rotate(90deg);
  }

  .intro-translation {
    font-size: 2rem;
  }

  .intro-memory-tip p {
    font-size: 1rem;
  }
}

/* Simple play button - for audio instructions */
.play-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
  box-shadow: 0 3px 10px rgba(245, 158, 11, 0.4);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.play-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.5);
}

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

.play-btn.playing {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 3px 10px rgba(16, 185, 129, 0.4);
  animation: none;
}

/* Yogi Wolf play button styling */
.yogi-play-btn {
  animation: pulse-glow 2s infinite;
}

/* Inline play buttons for text content */
.inline-play-btn {
  width: 28px;
  height: 28px;
  font-size: 0.8rem;
  padding: 0;
  margin-left: 8px;
  vertical-align: middle;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
}

.inline-play-btn:hover {
  transform: scale(1.15);
  box-shadow: 0 3px 10px rgba(59, 130, 246, 0.4);
}

.inline-play-btn.small {
  width: 24px;
  height: 24px;
  font-size: 0.7rem;
  margin-left: 6px;
}

.inline-play-btn.playing {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

/* Audio text wrapper */
.audio-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

@media (min-width: 768px) {
  .play-btn {
    width: 60px;
    height: 60px;
    font-size: 1.8rem;
  }
}

/* Letter Learning Section (Part 3 of Curriculum) */
.letter-learning-container {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0.5rem;
}

.letter-step {
  padding: 0.5rem;
  text-align: center;
}

.letter-step h2 {
  color: #1a202c;
  font-size: 2rem;
  margin-bottom: 1rem;
}

.letter-step p {
  color: #2d3748;
  font-size: 1.2rem;
  margin: 1rem 0;
}

.letter-flashcard-large {
  background: #ffffff;
  border: none;
  padding: 2rem;
  border-radius: 16px;
  margin: 2rem auto;
  max-width: none;
  box-shadow: none;
}

.letter-display {
  font-size: 8rem;
  font-weight: bold;
  color: #1a202c;
  margin-bottom: 1rem;
}

.letter-sound {
  font-size: 1.8rem;
  color: #2c7a7b;
  font-weight: 600;
}

/* Clickable letter display */
.letter-display.clickable-letter {
  cursor: pointer;
  transition: transform 0.2s, color 0.2s;
  position: relative;
  user-select: none;
}

.letter-display.clickable-letter:hover {
  transform: scale(1.05);
  color: #2c7a7b;
}

.letter-display.clickable-letter:active,
.letter-display.clickable-letter.clicked {
  transform: scale(0.95);
  color: #38a169;
}

.letter-display.clickable-letter .click-hint {
  display: block;
  font-size: 1rem;
  color: #718096;
  margin-top: 0.5rem;
  font-weight: normal;
}

.letter-association-card {
  background: #e6fffa;
  border: none;
  padding: 1.5rem;
  border-radius: 12px;
  margin: 2rem auto;
  max-width: none;
}

.letter-association-card h3 {
  color: #1a202c;
  font-size: 1.4rem;
  margin-bottom: 1rem;
}

.association-text {
  font-size: 2rem;
  font-weight: bold;
  color: #2c7a7b;
  margin: 1rem 0;
}

.association-image {
  max-width: 200px;
  max-height: 200px;
  border-radius: 12px;
  margin: 1rem auto;
  display: block;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.silly-story-section {
  margin-top: 1.5rem;
  border-top: 2px dashed #b2dfdb;
  padding-top: 1.5rem;
}

.silly-story-section h4 {
  color: #2c7a7b;
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

.silly-story-card {
  background: #fff;
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1rem;
  text-align: center;
}

.silly-story-image {
  max-width: 100%;
  max-height: 250px;
  border-radius: 8px;
  margin-bottom: 0.75rem;
  object-fit: contain;
}

.silly-story-text {
  font-size: 1.1rem;
  color: #2d3748;
  font-weight: 500;
  margin: 0;
}

.invisible-form-intro {
  background: #f0e6ff;
  border-radius: 10px;
  padding: 1rem;
  margin-top: 1rem;
  text-align: center;
}

.invisible-intro-text {
  font-size: 1.1rem;
  color: #553c9a;
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.invisible-form-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.invisible-form-letter {
  font-size: 4rem;
  color: #553c9a;
  font-weight: bold;
  line-height: 1;
}

.invisible-form-label {
  font-size: 1rem;
  color: #6b46c1;
  font-style: italic;
}

.letter-practice-buttons {
  margin: 2rem 0;
}

.letter-answer {
  margin-top: 2rem;
}

.answer-card {
  background: #fff3cd;
  border: none;
  padding: 1.5rem;
  border-radius: 12px;
  margin: 1rem auto;
  max-width: none;
}

.answer-text {
  font-size: 1.8rem;
  font-weight: bold;
  color: #856404;
  margin-bottom: 1rem;
}

.answer-card p {
  color: #856404;
  font-size: 1.2rem;
  margin: 0.5rem 0;
}

.practice-count {
  margin-top: 2rem;
  font-size: 1.1rem;
  color: #2c7a7b;
  font-weight: 600;
}

.letter-practice-card {
  margin: 1rem 0;
}

.letter-progress {
  color: #2c7a7b;
  font-weight: 600;
}

.practice-navigation {
  margin: 2rem 0;
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.review-badge {
  background: #e6fffa;
  color: #2c7a7b;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  margin-top: 1rem;
}

.new-badge {
  background: #fff3cd;
  color: #856404;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  margin-top: 1rem;
}

/* Letter Grid Practice */
.letter-grid-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: none;
  width: 100%;
  margin: 2rem 0;
  padding: 1rem;
}

.letter-grid-card {
  position: relative;
  background: #f8fafa;
  border: 1px solid #e0e0e0;
  border-radius: 16px;
  padding: 2rem 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: none;
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.letter-grid-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  border-color: #38a169;
}

.letter-grid-card:active,
.letter-grid-card.clicked {
  transform: scale(0.95);
  background: #e6fffa;
}

.letter-grid-display {
  font-size: 5rem;
  font-weight: bold;
  color: #1a202c;
  text-align: center;
}

.letter-grid-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: bold;
}

.letter-grid-badge.review {
  background: #e6fffa;
  color: #2c7a7b;
}

.letter-grid-badge.new {
  background: #fff3cd;
  color: #856404;
}

@media (max-width: 768px) {
  .letter-grid-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  
  .letter-grid-card {
    min-height: 120px;
    padding: 1.5rem 0.5rem;
  }
  
  .letter-grid-display {
    font-size: 4rem;
  }
}

/* Lesson Completion Card */
.lesson-completion-card {
  background: #ffffff;
  border: none;
  padding: 2rem;
  border-radius: 16px;
  text-align: center;
  margin: 1rem 0;
  box-shadow: none;
}

.lesson-completion-card h2 {
  color: #1a202c;
  font-size: 2.5rem;
  margin: 0 0 1rem 0;
}

.lesson-completion-card p {
  color: #2d3748;
  font-size: 1.3rem;
  margin: 0 0 2rem 0;
}

.completion-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.completion-buttons .vocab-btn {
  min-width: 200px;
  padding: 1rem 1.5rem;
  font-size: 1.1rem;
  text-decoration: none;
  display: inline-block;
}

@media (max-width: 768px) {
  .lesson-completion-card h2 {
    font-size: 2rem;
  }
  
  .lesson-completion-card p {
    font-size: 1.1rem;
  }
  
  .completion-buttons {
    flex-direction: column;
  }
  
  .completion-buttons .vocab-btn {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .letter-display {
    font-size: 6rem;
  }
  
  .letter-sound {
    font-size: 1.4rem;
  }
  
  .association-text {
    font-size: 1.6rem;
  }
}

.letter-intro {
  background: #ffffff;
  border: none;
  padding: 1.5rem;
  border-radius: 16px;
  margin-bottom: 1.5rem;
  text-align: center;
}

.letter-intro h2 {
  color: #1a202c;
  margin: 0 0 1rem 0;
  font-size: 1.8rem;
}

.letter-intro p {
  color: #2d3748;
  font-size: 1.1rem;
  margin: 0;
}

.letter-recall-card {
  background: #f7fafc;
  border: none;
  padding: 1.5rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
}

.letter-recall-card h3 {
  color: #1a202c;
  margin: 0 0 1rem 0;
  text-align: center;
}

.recall-word {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 1rem;
}

.recall-hebrew {
  font-size: 3rem;
  font-weight: bold;
  color: #1a202c;
}

.recall-arrow {
  font-size: 2rem;
  color: #2c7a7b;
}

.recall-translation {
  font-size: 1.8rem;
  font-weight: 600;
  color: #2c7a7b;
}

.letter-explanation {
  background: #ffffff;
  border: none;
  padding: 1.5rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
}

.letter-explanation h3 {
  color: #1a202c;
  margin: 0 0 1rem 0;
}

.letter-explanation p {
  color: #2d3748;
  line-height: 1.6;
  margin: 0.5rem 0;
}

.letter-practice-card {
  background: #e6fffa;
  border: none;
  padding: 1.5rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
}

.letter-practice-card h3 {
  color: #1a202c;
  margin: 0 0 1rem 0;
}

.letter-practice-card p {
  color: #2d3748;
  margin: 0.5rem 0;
}

.letter-practice-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 1.5rem 0;
}

.letter-practice-list li {
  padding: 0.5rem 0 0.5rem 2rem;
  position: relative;
  color: #2d3748;
  line-height: 1.6;
}

.letter-practice-list li:before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #2c7a7b;
  font-weight: bold;
  font-size: 1.2rem;
}

#start-letter-practice-btn {
  width: 100%;
  padding: 1rem;
  font-size: 1.1rem;
}

.letter-context-note {
  background: #fff3cd;
  border: none;
  padding: 1rem;
  border-radius: 12px;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.letter-context-note .tip-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.letter-context-note strong {
  color: #856404;
  display: block;
  margin-bottom: 0.5rem;
}

.letter-context-note p {
  color: #856404;
  margin: 0;
  line-height: 1.6;
}

@media (max-width: 768px) {
  .letter-learning-container {
    padding: 0.25rem;
  }

  .letter-intro h2 {
    font-size: 1.4rem;
  }

  .recall-hebrew {
    font-size: 2.5rem;
  }

  .recall-arrow {
    font-size: 1.5rem;
  }

  .recall-translation {
    font-size: 1.4rem;
  }

  .recall-word {
    gap: 1rem;
  }
}

.vocab-instructions {
  background: #f8f9fa;
  padding: 1rem;
  border-radius: 12px;
  margin-bottom: 1rem;
}

.vocab-instructions h3 {
  margin: 0 0 0.75rem 0;
  color: #333;
  font-size: 1.1rem;
}

@media (min-width: 768px) {
  .vocab-instructions h3 {
    font-size: 1.3rem;
  }
}

.vocab-instructions p {
  margin: 0.5rem 0;
  color: #666;
  font-size: 0.95rem;
}

/* Two-column layout for pronunciation step */
.pronunciation-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 1rem;
}

@media (min-width: 768px) {
  .pronunciation-layout {
    flex-direction: row;
    gap: 2rem;
    align-items: flex-start;
  }
}

.vocab-instructions-left {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 12px;
  flex: 1;
}

.vocab-instructions-left h3 {
  margin: 0 0 1rem 0;
  color: #333;
  font-size: 1.1rem;
}

@media (min-width: 768px) {
  .vocab-instructions-left h3 {
    font-size: 1.3rem;
  }
}

.vocab-instructions-left p {
  margin: 0.75rem 0;
  color: #666;
  font-size: 0.95rem;
  line-height: 1.6;
}

.vocab-flashcard-right {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.vocab-practice-controls {
  text-align: center;
  padding: 1rem;
  background: white;
  border-radius: 12px;
  margin-bottom: 0.75rem;
}

.vocab-practice-controls h3 {
  margin: 0 0 1rem 0;
  color: #333;
  font-size: 1.3rem;
}

.recording-slot {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;
  padding: 0.75rem;
  background: #f8f9fa;
  border-radius: 8px;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.recording-slot button {
  min-width: 150px;
  padding: 0.625rem 1rem;
  font-size: 0.9rem;
}

.vocab-btn-warning {
  background: #ff9800;
  color: white;
}

.vocab-btn-warning:hover:not(:disabled) {
  background: #f57c00;
}

.recording-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: #ff5252;
  color: white;
  border-radius: 8px;
  font-weight: 600;
  animation: pulse 1s infinite;
}

.recording-pulse {
  width: 12px;
  height: 12px;
  background: white;
  border-radius: 50%;
  animation: pulse 1s infinite;
}

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

.recording-timer {
  font-size: 1.1rem;
  font-weight: 700;
  min-width: 40px;
}

.practice-progress {
  margin-top: 1.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: #667eea;
}

#practice-count {
  color: #4caf50;
  font-size: 1.3rem;
}

.vocab-feedback {
  display: none;
  padding: 1rem;
  border-radius: 8px;
  margin-top: 1rem;
  font-weight: 500;
  text-align: center;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.vocab-feedback-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.vocab-feedback-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.vocab-feedback-info {
  background: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

/* Video Recording Section */
.vocab-video-section {
  background: white;
  padding: 1rem;
  border-radius: 12px;
  margin-top: 0;
}

.vocab-video-section h3 {
  margin: 0 0 0.75rem 0;
  color: #333;
  font-size: 1.2rem;
  text-align: center;
}

@media (min-width: 768px) {
  .vocab-video-section h3 {
    font-size: 1.3rem;
  }
}

.gesture-description {
  background: #f8f9fa;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  color: #555;
  font-size: 1rem;
  text-align: center;
  border-left: 4px solid #667eea;
}

.demonstration-video-container {
  margin-bottom: 1rem;
}

.demonstration-video {
  width: 100%;
  max-width: 400px;
  max-height: 250px;
  display: block;
  margin: 0 auto;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.recording-controls {
  text-align: center;
  margin: 1rem 0;
}

.video-preview-container {
  margin: 1rem 0;
  text-align: center;
}

.mirror-hint {
  color: #2c7a7b;
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.mirror-controls {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin: 1rem 0;
}

/* Hide mirror mode on mobile - camera getUserMedia is unreliable on mobile browsers */
@media (max-width: 768px) {
  .mirror-controls {
    display: none;
  }
}

.camera-preview {
  width: 100%;
  max-width: 480px;
  max-height: 360px;
  display: block;
  margin: 0 auto;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  background: #000;
  transform: scaleX(-1); /* Mirror the video for a more natural look */
}

.recorded-video-container {
  margin: 1rem 0;
  text-align: center;
}

.recorded-video-container h4 {
  margin: 0 0 1rem 0;
  color: #333;
  font-size: 1.1rem;
}

.recorded-video {
  width: 100%;
  max-width: 400px;
  max-height: 250px;
  display: block;
  margin: 0 auto 0.75rem auto;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  background: #000;
}

.recording-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.saved-video-container {
  margin: 1rem 0;
  text-align: center;
  background: #f0f8ff;
  padding: 1rem;
  border-radius: 12px;
  border: 2px solid #4caf50;
  display: block;
}

.saved-video-container h4 {
  margin: 0 0 1rem 0;
  color: #2e7d32;
  font-size: 1.2rem;
}

.saved-video-container #saved-video {
  width: 100%;
  max-width: 500px;
  display: block;
  margin: 0 auto 1rem auto;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  background: #000;
}

.saved-video-container.hidden {
  display: none !important;
}

.intro-audio-btn,
.instructions-audio-btn {
  margin-bottom: 1rem;
}

/* Breadcrumb Navigation - now in content-header */
.breadcrumb-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.25rem 0;
  font-size: 0.85rem;
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.breadcrumb-item {
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #666;
  font-weight: 500;
}

.breadcrumb-item:hover {
  background: #e9ecef;
  color: #333;
}

.breadcrumb-item.active {
  background: #2c7a7b;
  color: white;
  font-weight: 600;
  cursor: default;
}

.breadcrumb-separator {
  color: #adb5bd;
  font-size: 1.2rem;
}

@media (max-width: 768px) {
  .breadcrumb-nav {
    font-size: 0.75rem;
    padding: 0.25rem 0;
    gap: 0.25rem;
    margin-top: 0;
    margin-bottom: 0.25rem;
  }

  .breadcrumb-item {
    padding: 0.35rem 0.5rem;
    font-size: 0.75rem;
  }

  .breadcrumb-separator {
    font-size: 0.9rem;
  }
}

/* Back Button */
.back-btn {
  background: #6c757d;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 1rem;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.back-btn:hover {
  background: #5a6268;
  transform: translateX(-2px);
}

/* Progressive Step Styling */
.vocab-step {
  max-height: none; /* Mobile: no max-height, content expands naturally */
  overflow-y: visible; /* Mobile: natural page scroll */
  padding: 0.5rem;
  background: white;
  border-radius: 0;
  box-shadow: none;
  margin-bottom: 0;
  transition: opacity 0.3s ease-in-out;
  display: flex;
  flex-direction: column;
}

@media (min-width: 768px) {
  .vocab-step {
    max-height: 85vh; /* Desktop: constrain within viewport */
    overflow-y: auto;
  }

  .vocab-step .next-step-btn,
  .vocab-step .vocab-btn-success[id$="-section-btn"],
  .letter-step .next-step-btn,
  .letter-step .vocab-btn-success[id$="-section-btn"] {
    position: sticky;
    bottom: 0;
    z-index: 10;
    background: #38a169;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
  }
}

.vocab-step.hidden {
  display: none;
}

.vocab-step h3 {
  margin: 0 0 1rem 0;
  font-size: 1.3rem;
  color: #333;
}

.next-step-btn {
  margin-top: 1.5rem;
  padding: 0.875rem 1.5rem;
  font-size: 1.1rem;
  font-weight: bold;
  min-width: 180px;
  flex-shrink: 0;
}

.vocab-btn-success {
  background: #38a169;
  color: white;
  border: none;
}

.vocab-btn-success:hover:not(:disabled) {
  background: #2f855a;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(56, 161, 105, 0.3);
}

.vocab-btn-success:disabled {
  background: #ccc;
  cursor: not-allowed;
  opacity: 0.6;
}

/* ===== Talk Time Voice Agent Styles ===== */
.talk-time-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem;
  max-width: none;
  width: 100%;
  margin: 0;
  min-height: 400px;
}

.talk-time-header {
  text-align: center;
  margin-bottom: 2rem;
}

.talk-time-header h3 {
  font-size: 1.5rem;
  color: #2c7a7b;
  margin: 0 0 0.5rem 0;
}

.talk-time-header p {
  color: #666;
  margin: 0;
  font-size: 1.1rem;
  font-weight: 500;
}

.talk-time-topic {
  background: #e6fffa;
  border: none;
  border-radius: 12px;
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.topic-prompt {
  color: #234e52;
  font-size: 1.1rem;
  line-height: 1.5;
}

/* ===== Guessing Game Styles ===== */
.guessing-game-section {
  margin: 1.5rem 0;
  text-align: center;
}

.mystery-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 16px;
  padding: 2rem;
  margin: 1rem auto;
  max-width: 300px;
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mystery-card-front {
  text-align: center;
  color: white;
}

.mystery-icon {
  font-size: 4rem;
  display: block;
  margin-bottom: 1rem;
  animation: bounce 1s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.mystery-card-front p {
  margin: 0.5rem 0;
  font-size: 1.1rem;
}

.mystery-hint {
  font-size: 1rem !important;
  opacity: 0.9;
  font-style: italic;
}

.mystery-card-back {
  text-align: center;
  color: white;
}

.mystery-card-back img {
  max-width: 150px;
  max-height: 120px;
  border-radius: 12px;
  margin-bottom: 1rem;
  background: white;
  padding: 0.5rem;
}

.correct-answer {
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.4;
}

.guess-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin: 1.5rem 0;
}

.guess-btn {
  min-width: 100px;
  padding: 0.75rem 1rem;
  font-size: 1.2rem;
  transition: all 0.2s ease;
}

.guess-btn small {
  font-size: 0.8rem;
  display: block;
  margin-top: 0.25rem;
}

.guess-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.guess-btn.correct {
  background: #38a169 !important;
  color: white !important;
  border-color: #38a169 !important;
  animation: celebrate 0.5s ease;
}

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

.guess-btn.wrong {
  background: #e53e3e !important;
  color: white !important;
  border-color: #e53e3e !important;
  animation: shake 0.3s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

#new-round-btn {
  margin-top: 1rem;
}

/* Status indicator */
.talk-time-status {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  background: #f0f4f8;
  border-radius: 25px;
  margin-bottom: 1.5rem;
}

.status-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ccc;
  transition: background 0.3s ease;
}

.status-indicator.idle {
  background: #ccc;
}

.status-indicator.connecting {
  background: #f6ad55;
  animation: pulse 1s infinite;
}

.status-indicator.listening {
  background: #38a169;
  animation: pulse 1.5s infinite;
}

.status-indicator.speaking {
  background: #3182ce;
  animation: pulse 0.8s infinite;
}

.status-indicator.error {
  background: #e53e3e;
}

.status-indicator.recording {
  background: #e53e3e;
  animation: pulse 0.5s infinite;
}

.status-indicator.processing {
  background: #805ad5;
  animation: pulse 0.8s infinite;
}

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

.status-text {
  font-size: 0.9rem;
  color: #555;
  font-weight: 500;
}

/* Controls */
.talk-time-controls {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
}

.talk-time-btn {
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.talk-time-btn.start-btn {
  background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(56, 161, 105, 0.3);
}

.talk-time-btn.start-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(56, 161, 105, 0.4);
}

.talk-time-btn.end-btn {
  background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(229, 62, 62, 0.3);
}

.talk-time-btn.end-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(229, 62, 62, 0.4);
}

.talk-time-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* Audio wave indicator */
.talk-time-audio-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 40px;
  margin-bottom: 1.5rem;
}

.audio-wave {
  width: 4px;
  height: 20px;
  background: #3182ce;
  border-radius: 2px;
  animation: wave 0.8s ease-in-out infinite;
}

.audio-wave:nth-child(1) { animation-delay: 0s; }
.audio-wave:nth-child(2) { animation-delay: 0.1s; }
.audio-wave:nth-child(3) { animation-delay: 0.2s; }
.audio-wave:nth-child(4) { animation-delay: 0.3s; }
.audio-wave:nth-child(5) { animation-delay: 0.4s; }

@keyframes wave {
  0%, 100% { height: 8px; }
  50% { height: 30px; }
}

.talk-time-audio-indicator.hidden .audio-wave {
  animation: none;
  height: 8px;
}

/* Transcript area */
.talk-time-transcript {
  width: 100%;
  max-height: none; /* Mobile: show full transcript */
  overflow-y: visible;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1rem;
  background: #fafafa;
}

@media (min-width: 768px) {
  .talk-time-transcript {
    max-height: 300px; /* Desktop: constrain height */
    overflow-y: auto;
  }
}

.transcript-message {
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  border-radius: 12px;
  max-width: 85%;
  line-height: 1.4;
}

.transcript-message.user {
  background: #e2e8f0;
  margin-left: auto;
  text-align: right;
}

.transcript-message.ai {
  background: linear-gradient(135deg, #ebf8ff 0%, #e6fffa 100%);
  border: 1px solid #b2f5ea;
}

.transcript-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #666;
  margin-bottom: 0.25rem;
}

.transcript-message.user .transcript-label {
  color: #2c7a7b;
}

.transcript-message.ai .transcript-label {
  color: #805ad5;
}

.transcript-message .transcript-text {
  color: #333;
  line-height: 1.4;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .talk-time-container {
    padding: 1rem;
  }

  .talk-time-btn {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
  }

  .talk-time-controls {
    flex-direction: column;
    width: 100%;
  }

  .talk-time-controls .talk-time-btn {
    width: 100%;
    justify-content: center;
  }
}

/* Talk Time Complete Section */
.talk-time-complete-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 2px dashed #e2e8f0;
  width: 100%;
  display: flex;
  justify-content: center;
}

.talk-time-complete-btn {
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
  color: white;
  border: none;
  box-shadow: 0 4px 15px rgba(56, 161, 105, 0.3);
}

.talk-time-complete-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(56, 161, 105, 0.4);
}

@media (max-width: 600px) {
  .talk-time-complete-btn {
    width: 100%;
    justify-content: center;
  }
}

/* ===== Skip Button and Recording Navigation ===== */
.recording-navigation {
  display: flex;
  gap: 1rem;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.vocab-btn-outline {
  background: transparent;
  color: #6c757d;
  border: 2px solid #6c757d;
}

.vocab-btn-outline:hover {
  background: #6c757d;
  color: white;
}

.skip-btn {
  font-size: 0.95rem;
}

/* ===== Activity Navigation ===== */
.activity-navigation {
  display: flex;
  gap: 1rem;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e0e0e0;
}

/* ===== Matching Exercise Styles ===== */
.matching-exercise-section {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
}

.matching-exercise-section h3 {
  margin: 0 0 1rem 0;
  color: #333;
  font-size: 1.3rem;
  text-align: center;
}

.activity-instructions {
  text-align: center;
  color: #666;
  font-size: 1rem;
  margin-bottom: 1.5rem;
}

.matching-game-container {
  margin: 1.5rem 0;
}

/* Hide mobile grid on desktop */
.matching-mobile-grid {
  display: none;
}

.matching-columns {
  display: flex;
  gap: 2rem;
  justify-content: center;
  flex-wrap: nowrap; /* Prevent wrapping - keep columns side by side */
}

.matching-column {
  flex: 1;
  min-width: 150px;
  max-width: 300px;
}

.matching-column h4 {
  text-align: center;
  color: #2c7a7b;
  margin: 0 0 1rem 0;
  font-size: 1.1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #2c7a7b;
}

.matching-items {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.matching-item {
  padding: 1rem;
  border: 3px solid #e0e0e0;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: white;
  text-align: center;
}

.matching-item:hover {
  border-color: #667eea;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.matching-item.selected {
  border-color: #667eea;
  background: #f0f4ff;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

.matching-item.matched {
  cursor: default;
  opacity: 0.9;
}

.matching-item.matched:hover {
  transform: none;
  box-shadow: none;
}

/* Color-coded matched pairs - each pair gets a unique color */
.matching-item.matched-color-1 {
  border-color: #38a169;
  background: #c6f6d5;
  border-width: 3px;
}

.matching-item.matched-color-2 {
  border-color: #3182ce;
  background: #bee3f8;
  border-width: 3px;
}

.matching-item.matched-color-3 {
  border-color: #d69e2e;
  background: #fefcbf;
  border-width: 3px;
}

.matching-item.matched-color-4 {
  border-color: #9f7aea;
  background: #e9d8fd;
  border-width: 3px;
}

.matching-item.matched-color-5 {
  border-color: #ed64a6;
  background: #fed7e2;
  border-width: 3px;
}

.glyph-item img {
  max-width: 100%;
  max-height: 80px;
  border-radius: 8px;
}

.glyph-placeholder {
  font-size: 1.2rem;
  color: #666;
  font-style: italic;
}

.word-item .hebrew-word {
  display: block;
  font-size: 2rem;
  font-weight: bold;
  color: #1a202c;
  margin-bottom: 0.25rem;
}

.word-item .transliteration {
  display: block;
  font-size: 0.9rem;
  color: #666;
  font-style: italic;
}

.matching-progress {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 600;
  color: #2c7a7b;
  margin-top: 1.5rem;
}

#matched-count {
  color: #38a169;
  font-size: 1.3rem;
}

.matching-feedback {
  text-align: center;
  padding: 1rem;
  border-radius: 8px;
  margin-top: 1rem;
  font-weight: 600;
  font-size: 1.1rem;
}

.matching-feedback-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.matching-feedback-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

@media (max-width: 600px) {
  /* Mobile matching game - use a 2-column grid for all items mixed together */
  .matching-columns {
    display: none !important; /* Hide the original column layout on mobile */
  }

  .matching-game-container {
    margin: 1rem 0;
  }

  /* Mobile grid layout - shows all items in a shuffled 2-column grid */
  .matching-mobile-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    padding: 0.5rem;
  }

  .matching-mobile-grid .matching-item {
    padding: 0.6rem 0.4rem;
    font-size: 0.85rem;
    border-width: 2px;
    border-radius: 10px;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .matching-mobile-grid .matching-item .hebrew-word {
    font-size: 1.3rem;
    font-weight: bold;
  }

  .matching-mobile-grid .matching-item .english-word {
    font-size: 0.85rem;
  }

  .matching-mobile-grid .matching-item .item-emoji {
    font-size: 1.4rem;
  }

  /* Fallback for original columns if mobile grid not generated */
  .matching-columns:not(.has-mobile-grid) {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    flex-wrap: nowrap;
  }

  .matching-columns:not(.has-mobile-grid) .matching-column {
    flex: 1;
    min-width: 0;
    max-width: 50%;
  }

  .matching-columns:not(.has-mobile-grid) .matching-column h4 {
    font-size: 0.85rem;
    padding-bottom: 0.3rem;
    margin-bottom: 0.5rem;
  }

  .matching-columns:not(.has-mobile-grid) .matching-items {
    gap: 0.35rem;
  }

  .matching-columns:not(.has-mobile-grid) .matching-item {
    padding: 0.4rem 0.3rem;
    font-size: 0.8rem;
    border-width: 2px;
    border-radius: 8px;
  }

  .matching-columns:not(.has-mobile-grid) .matching-item .hebrew-word {
    font-size: 1rem;
  }

  .matching-columns:not(.has-mobile-grid) .matching-item .english-word {
    font-size: 0.75rem;
  }

  .matching-columns:not(.has-mobile-grid) .matching-item .item-emoji {
    font-size: 1.1rem;
  }

  .word-item .hebrew-word {
    font-size: 1.4rem;
  }

  .glyph-item img {
    max-height: 40px;
  }

  .matching-progress {
    font-size: 0.9rem;
  }

  .matching-progress span {
    font-size: 1.1rem;
  }

  .recording-navigation {
    flex-direction: column;
  }

  .activity-navigation {
    flex-direction: column;
  }
}

/* ===== Sentence Pattern Learning Styles ===== */
.sentence-pattern-container {
  padding: 0.5rem;
  max-width: none;
  width: 100%;
  margin: 0;
}

.pattern-header {
  text-align: center;
  margin-bottom: 1rem;
}

.pattern-header h2 {
  color: #2c7a7b;
  margin: 0 0 0.5rem 0;
  font-size: 1.8rem;
}

.pattern-header p {
  color: #666;
  margin: 0;
  font-size: 1rem;
}

.pattern-steps {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.pattern-card {
  background: white;
  border: 3px solid #2c7a7b;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.pattern-number {
  background: #2c7a7b;
  color: white;
  display: inline-block;
  padding: 0.25rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.pattern-step {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e0e0e0;
}

.pattern-step:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.step-label {
  font-weight: 600;
  color: #333;
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
}

.sentence-display {
  background: #f8f9fa;
  padding: 1.25rem;
  border-radius: 12px;
  text-align: center;
  margin-bottom: 1rem;
}

.english-sentence {
  font-size: 1.4rem;
  color: #333;
  font-style: italic;
}

.hebrew-sentence .hebrew-text {
  display: block;
  font-size: 2.5rem;
  font-weight: bold;
  color: #1a202c;
  margin-bottom: 0.5rem;
}

.hebrew-sentence .transliteration {
  display: block;
  font-size: 1.1rem;
  color: #666;
  font-style: italic;
}

.substitute-sentence .hebrew-text {
  font-size: 2rem;
  color: #1a202c;
}

.substitute-sentence .hebrew-text u {
  color: #667eea;
  text-decoration-color: #667eea;
  text-decoration-thickness: 3px;
}

.substitute-options {
  margin-top: 1rem;
}

.substitute-options p {
  color: #666;
  margin: 0 0 0.75rem 0;
  text-align: center;
}

.word-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.word-chip {
  background: #e6fffa;
  border: 2px solid #2c7a7b;
  padding: 0.5rem 1rem;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1.1rem;
}

.word-chip:hover {
  background: #b2f5ea;
  transform: translateY(-2px);
}

.word-chip.selected {
  background: #2c7a7b;
  color: white;
  box-shadow: 0 0 0 3px rgba(44, 122, 123, 0.3);
}

.word-chip:active {
  transform: scale(0.95);
}

.word-chip small {
  font-size: 0.85rem;
  opacity: 0.8;
}

.play-btn.loading {
  opacity: 0.5;
  pointer-events: none;
}

.pattern-navigation {
  margin-top: 2rem;
  text-align: center;
}

.completion-message {
  text-align: center;
  padding: 3rem 2rem;
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.completion-message h2 {
  color: #38a169;
  margin: 0 0 1rem 0;
  font-size: 2rem;
}

.completion-message p {
  color: #666;
  margin: 0 0 1.5rem 0;
  font-size: 1.1rem;
}

@media (max-width: 600px) {
  .sentence-pattern-container {
    padding: 1rem;
  }

  .pattern-header h2 {
    font-size: 1.4rem;
  }

  .hebrew-sentence .hebrew-text {
    font-size: 2rem;
  }

  .substitute-sentence .hebrew-text {
    font-size: 1.6rem;
  }

  .english-sentence {
    font-size: 1.2rem;
  }

  .word-chip {
    font-size: 1rem;
    padding: 0.4rem 0.8rem;
  }
}

/* ========== ACTIVITIES SECTION STYLES ========== */

.activities-section {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.activities-section h3 {
  margin: 0 0 1rem 0;
  color: #2c7a7b;
  font-size: 1.4rem;
  text-align: center;
}

/* Activity Tabs */
.activity-tabs {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.activity-tab {
  padding: 0.75rem 1.25rem;
  border: 2px solid #2c7a7b;
  background: white;
  color: #2c7a7b;
  border-radius: 20px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.2s;
}

.activity-tab:hover {
  background: #e6f7f7;
}

.activity-tab.active {
  background: #2c7a7b;
  color: white;
}

/* Activity Panels */
.activity-panel {
  display: none;
}

.activity-panel.active {
  display: block;
}

/* Hebrew Grid Styles (Word Finding & Letter Recognition) */
.hebrew-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin: 1rem 0;
  direction: rtl;
}

.grid-row {
  display: flex;
  gap: 0.5rem;
}

.grid-cell {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-family: Arial, Helvetica, sans-serif;
  background: #f0f4f8;
  border: 2px solid #d1d5db;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.grid-cell:hover {
  background: #e0e7ee;
  transform: scale(1.05);
}

.grid-cell.found {
  background: #c6f6d5;
  border-color: #38a169;
  color: #22543d;
}

.grid-cell.wrong {
  background: #fed7d7;
  border-color: #e53e3e;
}

.grid-cell.shake {
  animation: shake 0.3s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* Word Finding & Letter Recognition Progress */
.word-finding-progress,
.letter-recognition-progress {
  text-align: center;
  font-size: 1.1rem;
  color: #4a5568;
  margin: 1rem 0;
}

.word-finding-progress span,
.letter-recognition-progress span {
  font-weight: bold;
  color: #2c7a7b;
}

/* Activity Feedback */
.activity-feedback {
  text-align: center;
  padding: 0.75rem;
  border-radius: 8px;
  margin: 1rem 0;
  font-weight: 600;
}

.activity-feedback-success {
  background: #c6f6d5;
  color: #22543d;
}

.activity-feedback-error {
  background: #fed7d7;
  color: #9b2c2c;
}

/* Word Finding Container */
.word-finding-container,
.letter-recognition-container {
  text-align: center;
}

.word-finding-container h4,
.letter-recognition-container h4 {
  color: #2c7a7b;
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

/* Matching Exercise Panel */
.matching-exercise-section h4 {
  color: #2c7a7b;
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  text-align: center;
}

/* Gesture Navigation */
.gesture-navigation {
  margin-top: 1rem;
  text-align: center;
}

/* Activity Section Styling */
.activity-section {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.activity-section h3 {
  margin: 0 0 1rem 0;
  color: #2c7a7b;
  font-size: 1.4rem;
  text-align: center;
}

/* Matching Game Container */
.matching-game-container {
  position: relative;
}

/* Mobile Responsive for Activities */
@media (max-width: 600px) {
  .activity-tabs {
    flex-direction: column;
    align-items: stretch;
  }

  .activity-tab {
    text-align: center;
  }

  .grid-cell {
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
  }

  .activities-section {
    padding: 1rem;
  }

  .activities-section h3 {
    font-size: 1.2rem;
  }
}

/* ========== NEW LETTER ACTIVITIES STYLES ========== */

/* Activity Tabs */
.letter-activity-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  justify-content: center;
}

.letter-activity-tab {
  padding: 0.75rem 1.25rem;
  border: 2px solid #6c5ce7;
  background: white;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 600;
  color: #6c5ce7;
  transition: all 0.3s ease;
}

.letter-activity-tab:hover {
  background: #f0eeff;
}

.letter-activity-tab.active {
  background: #6c5ce7;
  color: white;
}

/* Activity Panels */
.letter-activity-panel {
  animation: fadeIn 0.3s ease;
}

.letter-activity-panel.hidden {
  display: none;
}

/* Sound Quiz Styles */
.sound-quiz-container {
  max-width: 500px;
  margin: 0 auto;
}

.quiz-question {
  background: white;
  border-radius: 15px;
  padding: 2rem;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.quiz-prompt {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  color: white;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.quiz-prompt:active {
  transform: scale(0.95);
}

.quiz-prompt.playing {
  box-shadow: 0 0 0 3px rgba(255,255,255,0.6), 0 0 15px rgba(102,126,234,0.5);
  animation: prompt-pulse 0.6s ease;
}

@keyframes prompt-pulse {
  0% { transform: scale(1); }
  30% { transform: scale(0.96); }
  100% { transform: scale(1); }
}

.quiz-sound-icon {
  font-size: 2.5rem;
}

.quiz-sound-text {
  font-size: 1.5rem;
  font-weight: 600;
}

.quiz-ask {
  font-size: 1.2rem;
  text-align: center;
  margin-bottom: 1.5rem;
  color: #333;
}

.quiz-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.quiz-option-btn {
  padding: 1.5rem;
  font-size: 2.5rem;
  border: 3px solid #e0e0e0;
  background: white;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.quiz-option-btn:hover:not(:disabled) {
  border-color: #6c5ce7;
  background: #f5f3ff;
}

.quiz-option-btn.correct {
  background: #d4edda;
  border-color: #28a745;
}

.quiz-option-btn.incorrect {
  background: #f8d7da;
  border-color: #dc3545;
}

.quiz-option-btn:disabled {
  cursor: not-allowed;
}

.quiz-option-btn:focus {
  outline: none;
}

.quiz-option-btn:not(.correct):not(.incorrect) {
  outline: none;
}

@media (hover: none) {
  .quiz-option-btn:hover:not(:disabled) {
    border-color: #e0e0e0;
    background: white;
  }
}

.quiz-feedback {
  margin-top: 1.5rem;
  padding: 1rem;
  border-radius: 10px;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 600;
}

.quiz-feedback.correct {
  background: #d4edda;
  color: #155724;
}

.quiz-feedback.incorrect {
  background: #f8d7da;
  color: #721c24;
}

.quiz-progress {
  display: flex;
  justify-content: space-between;
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: #f8f9fa;
  border-radius: 8px;
  font-weight: 500;
}

.quiz-complete {
  text-align: center;
  padding: 2rem;
}

.quiz-complete h3 {
  color: #28a745;
  margin-bottom: 1rem;
}

/* Memory Game Styles */
.memory-game-container {
  max-width: 100%;
  margin: 0 auto;
  padding: 0 1rem;
}

.memory-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}


.memory-card {
  aspect-ratio: 1;
  perspective: 1000px;
  cursor: pointer;
}

.memory-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.memory-card.flipped .memory-card-inner,
.memory-card.matched .memory-card-inner {
  transform: rotateY(180deg);
}

.memory-card-front,
.memory-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
}

.memory-card-front {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.memory-card-back {
  background: white;
  border: 3px solid #6c5ce7;
  color: #333;
  transform: rotateY(180deg);
}

.memory-card.matched .memory-card-back {
  background: #d4edda;
  border-color: #28a745;
}

.memory-game-stats {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: #f8f9fa;
  border-radius: 8px;
  font-weight: 500;
}

/* Say Sound Styles */
.say-sound-container {
  max-width: 400px;
  margin: 0 auto;
}

.say-sound-cards {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.say-sound-card {
  background: white;
  border-radius: 15px;
  padding: 2rem;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  text-align: center;
}

.say-sound-letter {
  font-size: 5rem;
  font-weight: 700;
  color: #6c5ce7;
  margin-bottom: 1rem;
}

.say-sound-hint {
  background: #fff3cd;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.say-sound-answer {
  background: #d4edda;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 1.1rem;
  text-align: left;
}

.say-sound-card .vocab-btn {
  margin: 0.25rem;
}

/* Sounding Out Activity */
.sounding-out-container {
  max-width: 500px;
  margin: 1.5rem auto;
}

.sounding-out-word-card {
  background: white;
  border-radius: 15px;
  padding: 2rem;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  text-align: center;
}

.sounding-out-hebrew {
  font-size: 4rem;
  font-weight: 700;
  color: #2c7a7b;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.sounding-out-word-display {
  font-family: Arial, Helvetica, sans-serif;
}

.sounding-out-meaning {
  font-size: 1.2rem;
  color: #666;
  margin-bottom: 1.5rem;
}

.sounding-out-letters-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 1rem 0;
  direction: rtl;
}

.sounding-out-letter {
  background: #f0f4f8;
  border: 3px solid #d1d5db;
  border-radius: 12px;
  padding: 1rem 1.2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  direction: ltr;
  min-width: 70px;
}

.sounding-out-letter:hover {
  border-color: #6c5ce7;
  background: #f5f3ff;
  transform: scale(1.05);
}

.sounding-out-letter-char {
  display: block;
  font-size: 2.5rem;
  font-weight: 700;
  color: #6c5ce7;
  font-family: Arial, Helvetica, sans-serif;
}

.sounding-out-letter-sound {
  display: block;
  font-size: 1rem;
  color: #888;
  margin-top: 0.25rem;
}

.sounding-out-plus {
  font-size: 1.5rem;
  color: #aaa;
  font-weight: 700;
  direction: ltr;
}

.sounding-out-equals {
  font-size: 1.5rem;
  color: #aaa;
  font-weight: 700;
  direction: ltr;
}

.sounding-out-result {
  font-size: 2rem;
  font-weight: 700;
  color: #2c7a7b;
  font-family: Arial, Helvetica, sans-serif;
}

.sounding-out-letter.letter-active {
  border-color: #f59e0b;
  background: #fef3c7;
  transform: scale(1.15);
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
}

.sounding-out-nav {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

.rtl-reminder {
  text-align: center;
  font-size: 1.1rem;
  color: #553c9a;
  font-weight: 600;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: #f0e6ff;
  border-radius: 10px;
}

.rtl-arrow {
  font-size: 1.5rem;
  margin-right: 0.5rem;
}

.sounding-out-step {
  margin: 1.25rem 0;
  padding: 1rem;
  background: #f7fafc;
  border-radius: 10px;
}

.sounding-out-step-label {
  font-size: 0.95rem;
  color: #553c9a;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.sounding-out-letters-row.rtl-row {
  direction: ltr;
}

.sounding-out-association-item {
  text-align: center;
  direction: ltr;
  min-width: 70px;
}

.sounding-out-association-text {
  display: block;
  font-size: 0.85rem;
  color: #666;
  margin-top: 0.25rem;
  max-width: 120px;
}

.sounding-out-arrow {
  font-size: 1.2rem;
  color: #aaa;
  font-weight: 700;
  direction: ltr;
}

.sounding-out-blend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.sounding-out-transliteration {
  font-size: 1.3rem;
  color: #666;
  font-weight: 500;
}

@keyframes letter-glow {
  0% { box-shadow: 0 0 5px rgba(245, 158, 11, 0.3); }
  50% { box-shadow: 0 0 20px rgba(245, 158, 11, 0.6); }
  100% { box-shadow: 0 0 5px rgba(245, 158, 11, 0.3); }
}

/* Write Letters & Words Activity */
.write-letters-container {
  max-width: 600px;
  margin: 1.5rem auto;
}

.write-letters-container h3 {
  font-size: 1.3rem;
  color: #2c7a7b;
  margin: 1.5rem 0 1rem;
  text-align: center;
}

.write-letters-grid,
.write-words-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.write-letter-card,
.write-word-card {
  background: white;
  border-radius: 15px;
  padding: 1.5rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  text-align: center;
  min-width: 160px;
  flex: 1;
  max-width: 250px;
}

.write-letter-display {
  font-size: 4rem;
  font-weight: 700;
  color: #2c7a7b;
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.2;
  direction: rtl;
}

.write-word-display {
  font-size: 3rem;
  font-weight: 700;
  color: #2c7a7b;
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.2;
  direction: rtl;
}

.write-letter-name {
  font-size: 1rem;
  color: #666;
  margin: 0.5rem 0 0.25rem;
  font-weight: 600;
}

.write-letter-hint,
.write-word-info {
  font-size: 0.9rem;
  color: #888;
  margin-bottom: 1rem;
}

.write-canvas-area {
  position: relative;
  margin-top: 0.5rem;
  border: 2px dashed #d1d5db;
  border-radius: 10px;
  background: #fafafa;
  padding: 0.5rem;
  text-align: center;
}

.write-canvas-guide {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 5rem;
  color: rgba(0, 0, 0, 0.08);
  pointer-events: none;
  z-index: 0;
  font-family: 'David Libre', 'Frank Ruhl Libre', serif;
  direction: rtl;
}

.write-canvas-guide.word-guide {
  font-size: 3.5rem;
}

.write-canvas {
  display: block;
  margin: 0 auto;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: white;
  cursor: crosshair;
  touch-action: none;
  position: relative;
  z-index: 1;
  max-width: 100%;
}

.write-canvas-wide {
  width: 100%;
  max-width: 400px;
}

.write-clear-btn {
  margin-top: 0.4rem;
  padding: 0.3rem 0.8rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: white;
  cursor: pointer;
  font-size: 0.85rem;
  color: #6b7280;
  transition: background 0.2s;
}

.write-clear-btn:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
}

/* Mobile Responsive for Letter Activities */
@media (max-width: 600px) {
  .letter-activity-tabs {
    flex-direction: column;
  }

  .letter-activity-tab {
    text-align: center;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
  }

  .quiz-options {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .quiz-option-btn {
    padding: 1rem;
    font-size: 2rem;
  }

  .quiz-sound-text {
    font-size: 1.2rem;
  }

  .memory-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
  }

  .memory-card-front,
  .memory-card-back {
    font-size: 1.5rem;
  }

  .say-sound-letter {
    font-size: 4rem;
  }
}

/* ===== Lesson Completion Popup ===== */
.lesson-complete-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lesson-complete-popup {
  background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
  border-radius: 24px;
  padding: 3rem;
  max-width: 500px;
  width: 90%;
  text-align: center;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
  animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.popup-confetti {
  font-size: 4rem;
  margin-bottom: 1rem;
  animation: bounce 1s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.lesson-complete-popup h2 {
  font-size: 2rem;
  color: #166534;
  margin: 0 0 1rem 0;
}

.lesson-complete-popup p {
  font-size: 1.2rem;
  color: #374151;
  margin: 0.5rem 0;
}

.popup-subtitle {
  color: #6b7280 !important;
  font-size: 1rem !important;
  margin-bottom: 1.5rem !important;
}

.popup-subtitle .hebrew-word {
  font-size: 1.5rem;
  color: #2c7a7b;
  font-weight: 600;
}

.popup-buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2rem;
}

.popup-btn-primary {
  padding: 1rem 2rem;
  font-size: 1.2rem;
  font-weight: 600;
  border-radius: 12px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: white;
  border: none;
  box-shadow: 0 4px 15px rgba(34, 197, 94, 0.4);
  transition: all 0.3s ease;
}

.popup-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(34, 197, 94, 0.5);
}

.popup-btn-secondary {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  border-radius: 8px;
  text-decoration: none;
  color: #6b7280;
  border: 2px solid #d1d5db;
  background: transparent;
  transition: all 0.3s ease;
}

.popup-btn-secondary:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

.all-lessons-complete {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  padding: 1.5rem;
  border-radius: 12px;
  margin-bottom: 1rem;
}

.all-lessons-complete p {
  font-size: 1.3rem;
  font-weight: 600;
  color: #92400e;
  margin: 0;
}

@media (max-width: 600px) {
  .lesson-complete-popup {
    padding: 2rem;
    margin: 1rem;
  }

  .popup-confetti {
    font-size: 3rem;
  }

  .lesson-complete-popup h2 {
    font-size: 1.5rem;
  }

  .popup-btn-primary {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
  }
}

/* ===== Magic Link Auth Modal ===== */
.auth-modal-overlay {
  display: none !important;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10000;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(4px);
}

.auth-modal-overlay.flex-display {
  display: flex !important;
}

.auth-modal {
  background: white;
  border-radius: 16px;
  padding: 32px;
  max-width: 420px;
  width: 90%;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.auth-modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 28px;
  color: #666;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}

.auth-modal-close:hover {
  color: #333;
}

.auth-step {
  display: block;
}

.auth-step.hidden {
  display: none !important;
}

.auth-celebration {
  font-size: 48px;
  text-align: center;
  margin-bottom: 8px;
}

.auth-modal h2 {
  text-align: center;
  margin: 0 0 8px 0;
  font-size: 24px;
  color: #1a1a2e;
}

.auth-subtitle {
  text-align: center;
  color: #666;
  margin: 0 0 24px 0;
  font-size: 15px;
  line-height: 1.5;
}

.auth-form-group {
  margin-bottom: 16px;
}

.auth-form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: #333;
  font-size: 14px;
}

.auth-form-group input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.auth-form-group input:focus {
  outline: none;
  border-color: #4CAF50;
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.auth-code-input {
  text-align: center;
  font-size: 24px !important;
  letter-spacing: 8px;
  font-family: monospace;
}

.auth-button {
  width: 100%;
  padding: 14px 24px;
  background: linear-gradient(135deg, #4CAF50, #45a049);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.auth-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.auth-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.auth-hint {
  text-align: center;
  color: #888;
  font-size: 13px;
  margin-top: 16px;
}

.auth-back-link {
  text-align: center;
  margin-top: 16px;
}

.auth-back-link a {
  color: #4CAF50;
  text-decoration: none;
  font-size: 14px;
}

.auth-back-link a:hover {
  text-decoration: underline;
}

.auth-error,
.auth-success {
  display: none;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
  text-align: center;
}

.auth-error {
  background: #ffebee;
  color: #c62828;
  border: 1px solid #ffcdd2;
}

.auth-success {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #c8e6c9;
}

.auth-error.show,
.auth-success.show {
  display: block;
}

.signup-prompt {
  background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
  padding: 16px 20px;
  border-radius: 12px;
  margin: 20px 0;
}

.signup-prompt p {
  margin: 0;
  color: #2e7d32;
  font-size: 15px;
}

/* ===== Yogi Wolf Character Styles ===== */
.yogi-wolf-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.yogi-wolf-character {
  flex-shrink: 0;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 768px) {
  .yogi-wolf-character {
    width: 150px;
    height: 150px;
  }
}

.yogi-wolf-character img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.yogi-wolf-message-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.yogi-wolf-message {
  flex: 1;
  background: #f0f9ff;
  border-radius: 16px;
  padding: 0.75rem 1rem;
  position: relative;
  font-size: 1rem;
  line-height: 1.5;
  color: #1a202c;
}

.yogi-wolf-message::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-right: 10px solid #f0f9ff;
}

@media (min-width: 768px) {
  .yogi-wolf-message {
    padding: 1rem 1.25rem;
    font-size: 1.1rem;
  }
}

/* Yogi Wolf celebration state */
.yogi-wolf-character.celebrating {
  animation: yogi-bounce 0.6s ease infinite;
}

@keyframes yogi-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* Yogi Wolf thinking state */
.yogi-wolf-character.thinking {
  animation: yogi-think 2s ease-in-out infinite;
}

@keyframes yogi-think {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-5deg); }
  75% { transform: rotate(5deg); }
}

/* Full-width activity area - for activities to use full screen */
.activity-full-width {
  width: 100%;
  padding: 1rem;
}

@media (min-width: 768px) {
  .activity-full-width {
    padding: 2rem;
  }
}

/* ===== By Myself Matching (p.84-85) ===== */
.bymyself-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin: 1rem 0;
}

.bymyself-group {
  background: #f8fafc;
  border-radius: 12px;
  padding: 1.25rem;
  border: 1px solid #e2e8f0;
}

.bymyself-group h3 {
  margin: 0 0 0.25rem 0;
  color: #1e293b;
  font-size: 1.1rem;
}

.bymyself-desc {
  color: #64748b;
  font-size: 0.85rem;
  margin: 0 0 0.75rem 0;
}

.bymyself-words {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.bymyself-word-card {
  background: white;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  border: 2px solid #e2e8f0;
  text-align: center;
  min-width: 80px;
  transition: transform 0.2s, border-color 0.2s;
  cursor: pointer;
}

.bymyself-word-card:hover {
  transform: translateY(-2px);
  border-color: #667eea;
}

.bymyself-hebrew {
  display: block;
  font-size: 1.6rem;
  font-weight: bold;
  color: #1e293b;
  direction: rtl;
}

.bymyself-meaning {
  display: block;
  font-size: 0.8rem;
  color: #64748b;
  margin-top: 0.25rem;
}

/* ===== Word Search (p.87) ===== */
.wordsearch-container {
  margin: 1rem 0;
}

.wordsearch-targets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: #f0f4ff;
  border-radius: 8px;
}

.wordsearch-target {
  font-size: 1.4rem;
  font-weight: bold;
  color: #1e293b;
  direction: rtl;
  background: white;
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  border: 1px solid #c7d2fe;
}

.wordsearch-grid {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: #e2e8f0;
  border-radius: 8px;
  padding: 4px;
  direction: rtl;
}

.wordsearch-row {
  display: flex;
  gap: 2px;
}

.wordsearch-cell {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  font-size: 1.3rem;
  font-weight: bold;
  color: #1e293b;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
  user-select: none;
}

.wordsearch-cell:hover {
  background: #dbeafe;
}

.wordsearch-cell.selected {
  background: #667eea;
  color: white;
}

/* ===== I Say You Obey (p.87) ===== */
.isay-container {
  margin: 1rem 0;
}

.isay-tip {
  background: #fef3c7;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.95rem;
  color: #92400e;
}

.isay-examples {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.isay-example {
  border-radius: 10px;
  padding: 1rem 1.25rem;
  border: 2px solid #e2e8f0;
}

.isay-obey {
  background: #f0fdf4;
  border-color: #86efac;
}

.isay-ignore {
  background: #fef2f2;
  border-color: #fca5a5;
}

.isay-command {
  font-size: 1.5rem;
  font-weight: bold;
  color: #1e293b;
  direction: rtl;
  text-align: right;
  margin-bottom: 0.25rem;
}

.isay-translation {
  font-size: 0.9rem;
  color: #64748b;
  margin-bottom: 0.5rem;
}

.isay-verdict {
  font-size: 0.85rem;
  font-weight: 600;
}

/* ===== Sentence Patterns (p.89) ===== */
.patterns-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1rem 0;
}

.pattern-card {
  background: #f8fafc;
  border-radius: 12px;
  padding: 1.25rem;
  border: 1px solid #e2e8f0;
}

.pattern-structure {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #667eea;
  margin-bottom: 0.5rem;
}

.pattern-example {
  font-size: 1.5rem;
  font-weight: bold;
  color: #1e293b;
  direction: rtl;
  text-align: right;
  margin-bottom: 0.25rem;
}

.pattern-translation {
  font-size: 0.9rem;
  color: #64748b;
  margin-bottom: 0.5rem;
}

.pattern-variations {
  font-size: 0.9rem;
  color: #475569;
  direction: rtl;
  text-align: right;
}

/* ===== Complete Vocabulary (p.89) ===== */
.vocab-list-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 1rem 0;
}

.vocab-list-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #f8fafc;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  border: 1px solid #e2e8f0;
}

.vocab-list-num {
  font-size: 0.85rem;
  color: #94a3b8;
  font-weight: 600;
  min-width: 24px;
}

.vocab-list-hebrew {
  font-size: 1.4rem;
  font-weight: bold;
  color: #1e293b;
  direction: rtl;
  min-width: 80px;
}

.vocab-list-translit {
  font-size: 0.9rem;
  color: #667eea;
  font-style: italic;
  min-width: 70px;
}

.vocab-list-meaning {
  font-size: 0.9rem;
  color: #475569;
}

/* ===== Finishing the Year (p.88) ===== */
.finish-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1rem 0;
}

.finish-question {
  display: flex;
  gap: 0.75rem;
  background: #f8fafc;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  border: 1px solid #e2e8f0;
}

.finish-num {
  font-size: 1.1rem;
  font-weight: 700;
  color: #667eea;
  min-width: 24px;
}

.finish-text {
  font-size: 1rem;
  color: #334155;
  line-height: 1.5;
}

.finish-celebration {
  text-align: center;
  font-size: 1.3rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, #f0f4ff 0%, #faf5ff 100%);
  border-radius: 12px;
  border: 2px solid #c7d2fe;
  margin-top: 0.5rem;
}
