.lesson-card {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  max-height: 100%;
  /* Fully opaque so the word backdrop never bleeds through the white card. */
  background: #fff;
  /* Trim the generous 40px card padding down vertically so the paginated
     content area gets more height — lets full sections fit one page without
     shrinking the buttons or cutting text. */
  padding-top: 24px;
  padding-bottom: 24px;
}

.lesson-card .game-title { margin-bottom: 14px; }

.lesson-eyebrow {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
  text-align: center;
  margin-bottom: 6px;
  font-family: "Nunito", sans-serif;
}

/* ── Section label ── */
.lesson-section-label {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px;
}

/* Subsection heading — sits under a section label (e.g. Polite / Friendly). */
.lesson-sublabel {
  font-family: "Nunito", sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 12px;
}

/* ── Intro block ── */
.lesson-intro {
  font-size: 1.06rem;
  font-weight: 600;
  color: #173b50;
  line-height: 1.7;
  margin-bottom: 28px;
  font-family: "Source Sans 3", sans-serif;
}

.word-audio-btn {
  display: inline;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  color: var(--primary);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  transition: opacity 0.15s;
}

.word-audio-btn:active,
.word-audio-btn--playing {
  opacity: 0.6;
}

.lesson-tip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(47, 159, 232, 0.07);
  border: 1px solid rgba(47, 159, 232, 0.18);
  border-radius: 12px;
  margin-top: -8px;
}

.lesson-tip p {
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: #173b50;
  margin: 0;
  line-height: 1.55;
}

.lesson-tip strong {
  color: var(--primary);
}

/* ── Divider ── */
.lesson-divider {
  height: 1px;
  background: rgba(47, 159, 232, 0.12);
  margin: 28px 0;
}

/* ── Phrase cards ── */
.lesson-phrases {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 28px;
}

.phrase-card {
  background: rgba(47, 159, 232, 0.06);
  border: 1px solid rgba(47, 159, 232, 0.15);
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.phrase-card--highlight {
  background: rgba(47, 159, 232, 0.1);
  border-color: rgba(47, 159, 232, 0.25);
}

button.phrase-audio-btn {
  width: 100%;
  text-align: left;
  cursor: pointer;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  /* Elevated & pressable — same language as the nav buttons: the slab edge is
     a box-shadow (not a border), so pressing it never changes the box height
     and so never reflows the cards below it. The press is transform-only. */
  border: 2px solid rgba(47, 159, 232, 0.22);
  box-shadow: 0 4px 0 rgba(47, 159, 232, 0.35);
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, border-color 0.15s,
              transform 0.1s ease, box-shadow 0.08s ease;
}

/* Hover lift only on real pointing devices — no sticky hover after a tap. */
@media (hover: hover) {
  button.phrase-audio-btn:hover {
    background: rgba(47, 159, 232, 0.12);
    border-color: rgba(47, 159, 232, 0.4);
    box-shadow: 0 6px 0 rgba(47, 159, 232, 0.42);
    transform: translateY(-2px);
  }
}

/* Press: the card drops onto its slab (4px shadow collapses). Purely visual —
   no layout change, so neighbouring cards stay put. */
button.phrase-audio-btn:active {
  transform: translateY(4px);
  box-shadow: 0 0 0 rgba(47, 159, 232, 0);
}

.phrase-audio-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.phrase-audio-icon {
  flex-shrink: 0;
  opacity: 0.6;
  transition: opacity 0.15s;
}

.phrase-audio-icon img { display: block; }

.phrase-audio-btn--playing .phrase-audio-icon,
.phrase-audio-btn:hover .phrase-audio-icon {
  opacity: 1;
}

.phrase-lt {
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--primary);
  font-family: "Nunito", sans-serif;
  letter-spacing: -0.01em;
}

.phrase-en {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  font-family: "Source Sans 3", sans-serif;
}


/* ── Pattern full-sentence display ── */
.pattern-full-sentence {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 18px 20px 16px;
  background: rgba(47, 159, 232, 0.07);
  border: 1.5px solid rgba(47, 159, 232, 0.18);
  border-radius: 14px 14px 0 0;
  border-bottom: none;
  text-align: center;
}

.pattern-full-lt {
  font-family: "Nunito", sans-serif;
  font-size: clamp(1.2rem, 4vw, 1.5rem);
  font-weight: 800;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.pattern-full-en {
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
}

/* Known word variant — muted, already learned */
.sentence-part--known {
  background: rgba(6, 38, 61, 0.05);
  border: 1.5px dashed rgba(6, 38, 61, 0.18);
}
.sentence-part--known .sentence-word { color: var(--muted); }
.sentence-part--known .sentence-role { color: var(--muted); opacity: 0.6; }

/* Attach builder flush to the full-sentence card */
.pattern-full-sentence + .sentence-builder {
  border-top: none;
  border-radius: 0 0 14px 14px;
  background: rgba(47, 159, 232, 0.04);
  margin-bottom: 4px;
}

/* Change note below the builder */
.pattern-change-note {
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  padding: 10px 16px;
  background: rgba(47, 159, 232, 0.05);
  border: 1px solid rgba(47, 159, 232, 0.14);
  border-radius: 10px;
  margin-bottom: 24px;
}

.pattern-change-note strong { color: var(--primary); font-weight: 800; }
.pattern-arrow { color: var(--muted); opacity: 0.5; margin: 0 4px; }

/* ── Sentence builder ── */
.sentence-builder {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px 20px;
  background: rgba(47, 159, 232, 0.06);
  border-radius: 14px;
  border: 1.5px solid rgba(47, 159, 232, 0.18);
  margin-bottom: 4px;
}

.sentence-part {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 18px;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.sentence-part--ar {
  background: var(--primary);
  border: 1.5px solid var(--primary);
}
.sentence-part--ar .sentence-word { color: white; }
.sentence-part--ar .sentence-role { color: rgba(255,255,255,0.75); }

.sentence-part--sentence {
  background: white;
  border: 1.5px dashed rgba(0,0,0,0.18);
}
.sentence-part--sentence .sentence-word { color: var(--text); }
.sentence-part--sentence .sentence-role { color: var(--muted); }

.sentence-word {
  font-family: "Nunito", sans-serif;
  font-weight: 800;
  font-size: 1.15rem;
  line-height: 1;
}

.sentence-role {
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1;
}

.sentence-plus {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--muted);
  opacity: 0.4;
}

/* ── Explanation block ── */
.lesson-explanation {
  margin-bottom: 28px;
}

.lesson-explanation p {
  font-size: 1.06rem;
  font-weight: 600;
  color: #173b50;
  line-height: 1.7;
  margin: 0 0 8px;
  font-family: "Source Sans 3", sans-serif;
}

.lesson-explanation p:last-child { margin-bottom: 0; }

.lesson-explanation strong {
  color: var(--primary);
  font-weight: 800;
}

/* ── Dialogue ── */
.lesson-dialogue {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 16px;
  background: rgba(47, 159, 232, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(47, 159, 232, 0.14);
  margin-bottom: 16px;
}

.dialogue-line { display: flex; flex-direction: column; gap: 2px; }

.dialogue-speaker {
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.dialogue-lt {
  font-family: "Nunito", sans-serif;
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
}

.dialogue-en {
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
}

/* ── Vocab grid ── */
.vocab-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 28px;
}

.vocab-item {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.vocab-lt {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
  font-family: "Nunito", sans-serif;
}

.vocab-en {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  font-family: "Source Sans 3", sans-serif;
}

/* ── Table ── */
.lesson-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-bottom: 20px;
  font-family: "Source Sans 3", sans-serif;
  border: 1px solid rgba(47, 159, 232, 0.22);
  border-radius: 14px;
  overflow: hidden;
  table-layout: fixed;
}

.lesson-table thead tr {
  background: rgba(47, 159, 232, 0.08);
}

.lesson-table th {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 14px;
  text-align: left;
  font-family: "Source Sans 3", sans-serif;
}

.lesson-table tbody tr {
  background: rgba(255, 255, 255, 0.55);
}

/* Row separators live on the cells (tr borders don't paint with
   border-collapse: separate). The outer frame is the table border above. */
.lesson-table tbody td {
  border-top: 1px solid rgba(47, 159, 232, 0.12);
}

.lesson-table td {
  padding: 12px 14px;
}

.cell-lt {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
  font-family: "Nunito", sans-serif;
}

.cell-primary {
  color: var(--primary);
}

.cell-stem {
  color: var(--muted);
  font-weight: 800;
  font-family: "Nunito", sans-serif;
}

.cell-plus {
  color: var(--muted);
  opacity: 0.45;
  font-weight: 700;
  margin: 0 3px;
}

.cell-ending {
  color: var(--primary);
  font-weight: 800;
  font-family: "Nunito", sans-serif;
}

.cell-en {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
}

/* ── Pronoun link grid ── */
.lesson-vocab-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.lesson-vocab-grid .vocab-item {
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
}

.lesson-vocab-grid .vocab-en {
  margin-left: auto;
  font-size: 0.88rem;
}

.vocab-arrow {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--muted);
  opacity: 0.5;
}

/* ── Dialogue ── */
.lesson-dialogue {
  background: rgba(47, 159, 232, 0.06);
  border: 1px solid rgba(47, 159, 232, 0.15);
  border-radius: 16px;
  padding: 18px 18px 14px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  max-height: 320px;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.dialogue-exchange {
  margin-bottom: 16px;
}
.dialogue-exchange:last-child { margin-bottom: 0; }

.dialogue-line {
  display: flex;
  flex-direction: column;
  margin-bottom: 8px;
  max-width: 82%;
}
.dialogue-line:last-child { margin-bottom: 0; }
.dialogue-line--a { align-items: flex-start; }
.dialogue-line--b { align-items: flex-end; margin-left: auto; }

.dialogue-name {
  font-size: 0.68rem;
  font-weight: 800;
  font-family: "Nunito", sans-serif;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 3px;
  padding: 0 4px;
}

.dialogue-bubble {
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 0.97rem;
  font-weight: 600;
  font-family: "Source Sans 3", sans-serif;
  color: var(--text);
  line-height: 1.5;
}

.dialogue-line--a .dialogue-bubble {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(47, 159, 232, 0.15);
  border-bottom-left-radius: 4px;
}

.dialogue-line--b .dialogue-bubble {
  background: rgba(47, 159, 232, 0.12);
  border: 1px solid rgba(47, 159, 232, 0.25);
  border-bottom-right-radius: 4px;
}

/* ── Dialogue question blocks ── */
.dialogue-q-divider {
  height: 1px;
  background: rgba(47, 159, 232, 0.12);
  margin: 14px 0;
}

.dialogue-exchange-divider {
  height: 1px;
  background: rgba(47, 159, 232, 0.18);
  margin: 18px 0;
}

.dialogue-q-label {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 6px;
  opacity: 0.7;
}

.dialogue-question {
  padding: 0 2px;
  animation: dialogue-reveal 0.25s cubic-bezier(0.22, 1, 0.36, 1) both;
}

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

.dialogue-line--new,
.dialogue-question--new {
  animation: dialogue-reveal 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ── Recap list ── */
.recap-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.recap-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 12px;
  padding: 12px 16px;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

button.recap-item {
  background: rgba(47, 159, 232, 0.1);
  border-color: rgba(47, 159, 232, 0.25);
}

button.recap-item .phrase-audio-text {
  flex: 1;
}

.recap-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(52, 201, 137, 0.15);
  border: 1.5px solid #34c989;
  color: #1a7a50;
  font-size: 0.78rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.recap-lt {
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--primary);
  font-family: "Nunito", sans-serif;
}

.recap-en {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  font-family: "Source Sans 3", sans-serif;
  margin-top: 1px;
}

/* ── Practice ── */
.lesson-practice-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.lesson-practice-progress .progress-track {
  flex: 1;
  height: 14px;
  background: rgba(47, 159, 232, 0.12);
  border-radius: 999px;
  overflow: hidden;
}

.lesson-practice-progress .progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  width: 0%;
  box-shadow: 0 2px 8px rgba(47, 159, 232, 0.35);
}

.lesson-practice-meta {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--primary);
  white-space: nowrap;
  font-family: "Nunito", sans-serif;
}

.practice-q-label {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 8px;
}

.practice-q-prompt {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  font-family: "Nunito", sans-serif;
  margin: 0 0 26px;
  line-height: 1.4;
}

.practice-options {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 18px;
}

/* Duolingo-style answer buttons — tappable cards with a press-down bottom edge. */
.practice-opt {
  padding: 18px 20px;
  border-radius: 16px;
  border: 2px solid rgba(6, 38, 61, 0.12);
  /* Slab edge is a box-shadow (not a border) so pressing never changes the
     box height and so never reflows the options around it. */
  box-shadow: 0 4px 0 rgba(6, 38, 61, 0.2);
  background: #fff;
  color: var(--text);
  font-size: 1rem;
  font-weight: 800;
  font-family: "Nunito", sans-serif;
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s,
              transform 0.1s ease, box-shadow 0.08s ease;
}

@media (hover: hover) {
  .practice-opt:hover:not(:disabled) {
    background: rgba(47, 159, 232, 0.08);
    border-color: rgba(47, 159, 232, 0.4);
    box-shadow: 0 4px 0 rgba(47, 159, 232, 0.55);
    color: var(--primary);
    transform: translateY(-2px);
  }
}

.practice-opt:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: none;
}

.practice-opt--correct  { background: rgba(52, 201, 137, 0.15); border-color: #34c989; box-shadow: 0 4px 0 #1fae72; color: #1a7a50; }
.practice-opt--wrong    { background: rgba(240, 92, 92, 0.12);  border-color: #f05c5c; box-shadow: 0 4px 0 #d83c3c; color: #b83232; }
.practice-opt--disabled { opacity: 0.42; }
/* Chosen but not yet checked — a calm highlight that reveals nothing. */
.practice-opt--selected { background: rgba(47, 159, 232, 0.1); border-color: var(--primary); box-shadow: 0 4px 0 var(--primary-dark); color: var(--primary); }

/* ── Tap-the-matching-pairs ── */
.practice-match {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}
.match-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.match-cell {
  padding: 16px 10px;
  border-radius: 14px;
  border: 2px solid rgba(6, 38, 61, 0.12);
  /* Slab edge is a box-shadow (not a border) so pressing never reflows the grid. */
  box-shadow: 0 4px 0 rgba(6, 38, 61, 0.2);
  background: #fff;
  color: var(--text);
  font-family: "Nunito", sans-serif;
  font-weight: 800;
  font-size: clamp(0.85rem, 2.4vw, 0.98rem);
  line-height: 1.3;
  cursor: pointer;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s,
              transform 0.1s ease, box-shadow 0.08s ease;
}
/* Hover lift only on real pointing devices — no sticky hover after a tap. */
@media (hover: hover) {
  .match-cell:hover:not(:disabled) {
    background: rgba(47, 159, 232, 0.08);
    border-color: rgba(47, 159, 232, 0.4);
    box-shadow: 0 6px 0 rgba(47, 159, 232, 0.5);
    color: var(--primary);
    transform: translateY(-2px);
  }
}
.match-cell:active:not(:disabled) { transform: translateY(2px); box-shadow: none; }
.match-cell--selected {
  background: rgba(47, 159, 232, 0.1);
  border-color: var(--primary);
  box-shadow: 0 4px 0 var(--primary-dark);
  color: var(--primary);
}
.match-cell--matched {
  background: rgba(52, 201, 137, 0.15);
  border-color: #34c989;
  box-shadow: 0 4px 0 #1fae72;
  color: #1a7a50;
  cursor: default;
  opacity: 0.9;
}
.match-cell--wrong {
  background: rgba(240, 92, 92, 0.12);
  border-color: #f05c5c;
  box-shadow: 0 4px 0 #d83c3c;
  color: #b83232;
  animation: matchShake 0.4s ease;
}
@keyframes matchShake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-5px); }
  75%      { transform: translateX(5px); }
}

.practice-feedback {
  font-size: 1.02rem;
  font-weight: 700;
  padding: 14px 16px;
  border-radius: 12px;
  margin-top: 10px;
  line-height: 1.5;
}
.practice-feedback--correct { background: rgba(52, 201, 137, 0.12); color: #1a7a50; }
.practice-feedback--wrong   { background: rgba(240, 92, 92, 0.1);  color: #b83232; }

/* ── Complete banner ── */
.lesson-complete {
  text-align: center;
  padding: 24px 0 8px;
}

.lesson-complete-icon {
  font-size: 2.8rem;
  margin-bottom: 12px;
}

.lesson-complete-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
  font-family: "Nunito", sans-serif;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

.lesson-complete-sub {
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 24px;
  line-height: 1.75;
  font-family: "Source Sans 3", sans-serif;
}

.lesson-complete-score {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(52, 201, 137, 0.12);
  border: 1px solid #34c989;
  border-radius: 999px;
  padding: 8px 20px;
  font-size: 0.95rem;
  font-weight: 800;
  color: #1a7a50;
  font-family: "Nunito", sans-serif;
  margin-bottom: 24px;
}

/* ── Pre-practice screen (Duolingo-style hand-off into the games) ── */
.practice-intro {
  /* Fill the content area (#lessonBody) and centre the text in the middle. */
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  max-width: 340px;
  margin: 0 auto;
  padding: 16px 8px;
  text-align: center;
}
.practice-intro-badge {
  width: 124px;
  height: 124px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 36%, rgba(47, 159, 232, 0.20), rgba(47, 159, 232, 0.07));
  border: 3px solid rgba(47, 159, 232, 0.3);
  box-shadow: 0 8px 0 rgba(47, 159, 232, 0.16);
  margin-bottom: 26px;
  animation: practiceIntroPop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
/* Inner span carries the float so it doesn't fight the pop on the wrapper. */
.practice-intro-badge span {
  font-size: 3.4rem;
  line-height: 1;
  display: block;
  animation: practiceIntroFloat 3s ease-in-out 0.6s infinite;
}
@keyframes practiceIntroPop {
  0%   { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes practiceIntroFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-7px); }
}
.practice-intro-title {
  font-size: 1.7rem;
  font-weight: 900;
  font-family: "Nunito", sans-serif;
  color: var(--text);
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}
.practice-intro-sub {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.75;
  margin: 0 0 16px;
  font-family: "Source Sans 3", sans-serif;
}
.practice-intro-sub:last-child { margin-bottom: 0; }
.practice-intro-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 340px;
}
/* List rows — each activity as a card with a circular icon badge, like a
   Duolingo "in this lesson" checklist. Staggered fade-in for a little life. */
.practice-intro-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 16px;
  background: #fff;
  border: 2px solid rgba(6, 38, 61, 0.1);
  box-shadow: 0 4px 0 rgba(6, 38, 61, 0.12);
  animation: practiceIntroRise 0.45s ease both;
}
.practice-intro-row:nth-child(1) { animation-delay: 0.35s; }
.practice-intro-row:nth-child(2) { animation-delay: 0.48s; }
@keyframes practiceIntroRise {
  0%   { transform: translateY(10px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}
.practice-intro-row-icon {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  background: rgba(47, 159, 232, 0.12);
}
.practice-intro-row-text {
  font-family: "Nunito", sans-serif;
  font-weight: 800;
  font-size: 1rem;
  color: var(--text);
  text-align: left;
}

@media (max-width: 640px) {
  /* Trim supplementary lead-in / summary prose on phones so the core content
     (e.g. a full phrase set) fits one page without paginating. */
  .lesson-hide-mobile { display: none; }

  .vocab-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
  .phrase-lt { font-size: 1rem; }
  .practice-q-prompt { font-size: 1rem; }
  .dialogue-line { max-width: 90%; }

  .lesson-table th,
  .lesson-table td { padding: 10px 10px; }
  .lesson-table th { font-size: 0.65rem; }
  .cell-lt { font-size: 0.92rem; }
  .cell-en { font-size: 0.78rem; }

  .sentence-builder {
    flex-wrap: wrap;
    gap: 8px;
    padding: 14px 14px;
    justify-content: center;
  }

  .sentence-part {
    padding: 8px 14px;
  }

  .sentence-word { font-size: 1rem; }
  .sentence-role { font-size: 0.68rem; }
  .sentence-plus { font-size: 1.1rem; }
}

@media (max-width: 400px) {
  .lesson-table th { font-size: 0.6rem; letter-spacing: 0.04em; padding: 8px 7px; }
  .lesson-table td { padding: 10px 7px; }
  .cell-lt { font-size: 0.88rem; }
  .cell-en { font-size: 0.72rem; }

  .sentence-part { padding: 7px 12px; }
  .sentence-word { font-size: 0.95rem; }
}

/* ── Fit-to-viewport ───────────────────────────────────────────────────────
   Contain the whole lesson within the viewport so each view fits with no page
   scroll. Content that doesn't fit is paginated into the next view by lesson.js
   (it measures #lessonBody's height, which this layout makes fixed). */
body:has(.lesson-card) { overflow: hidden; }

body:has(.lesson-card) .page-shell {
  /* Full-bleed: fill the entire frame below the header (no inset/rounded edge)
     so the word background reaches every edge. */
  width: 100%;
  max-width: none;
  margin: 0;
  border: none;
  border-radius: 0;
  height: calc(100vh - 86px);    /* header only */
  min-height: 0;
  display: flex;
}
body:has(.lesson-card) .game {
  flex: 1;
  min-height: 0;
  display: flex;
}
body:has(.lesson-card) .game-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  padding-top: 12px;
  padding-bottom: 12px;
}

/* The content region is fixed-height; lesson.js paginates to fit it. */
#lessonBody {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
#practiceSection {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;   /* practice is short; scroll only as a rare safety net */
}
#lessonNav {
  margin-top: auto;
  padding-top: 12px;
  border-top: 2px solid rgba(6, 38, 61, 0.08);
}

/* Duolingo-style nav buttons — bold, uppercase, sitting on a solid elevated
   slab (box-shadow), which presses down on tap. Both share one box model
   (same padding + 2px border all round) so Previous and Next are identical in
   width AND height; the shadow is purely visual so it never changes the box. */
#lessonNav .nav-btn {
  flex: 1 1 0;
  max-width: 210px;
  text-align: center;
  white-space: nowrap;
  padding: 14px 24px;
  border-radius: 16px;
  border: 2px solid rgba(6, 38, 61, 0.12);
  box-shadow: 0 4px 0 rgba(6, 38, 61, 0.16);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.92rem;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.15s;
}

#lessonNav .nav-btn--primary {
  border-color: var(--primary);
  box-shadow: 0 4px 0 var(--primary-dark);
}

/* During practice there is no going back — the primary (Check / Next) button
   takes the full width of the view. */
#lessonNav.nav--practice #prevBtn { display: none; }
#lessonNav.nav--practice .nav-btn--primary { max-width: none; }

/* Press: button drops onto its slab. */
#lessonNav .nav-btn:active:not(:disabled) {
  transform: translateY(4px);
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
}

@media (max-width: 480px) {
  #lessonNav .nav-btn { padding: 13px 20px; font-size: 0.85rem; }
}

@media (max-width: 840px) {
  body:has(.lesson-card) .page-shell { height: calc(100vh - 64px); }
}
@media (max-width: 640px) {
  body:has(.lesson-card) .page-shell { height: calc(100dvh - 64px); }
  body:has(.lesson-card) .game-wrap { padding: 14px 12px; }
}

/* ── Readability: lift translation text contrast (still secondary to the LT word) */
.phrase-en,
.vocab-en,
.cell-en,
.recap-en,
.dialogue-en { color: #355c73; }

/* The game/lesson backdrop (Lithuanian words over an aurora mesh) now lives in
   base.css under `body:has(.game)`, shared by every game and lesson view. */

/* ── Practice: fill-in subtitle (English hint under the prompt) ── */
.practice-q-sub {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
  margin: -12px 0 18px;
  font-family: "Source Sans 3", sans-serif;
}

/* ── Practice: tap-to-build sentence ── */
.build-answer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-height: 56px;
  padding: 12px 14px;
  border: 1.5px dashed rgba(47, 159, 232, 0.3);
  border-radius: 14px;
  background: rgba(47, 159, 232, 0.04);
  margin-bottom: 16px;
}
.build-answer-empty {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
  font-family: "Source Sans 3", sans-serif;
}
.build-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.build-tile {
  padding: 10px 16px;
  border-radius: 12px;
  border: 2px solid rgba(6, 38, 61, 0.12);
  box-shadow: 0 3px 0 rgba(6, 38, 61, 0.16);
  background: #fff;
  color: var(--text);
  font-family: "Nunito", sans-serif;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.15s, border-color 0.15s;
}
.build-tile:active:not(:disabled) { transform: translateY(3px); box-shadow: none; }
.build-tile--placed { visibility: hidden; }
.build-tile--correct { border-color: #34c989; box-shadow: 0 3px 0 #1fae72; background: rgba(52, 201, 137, 0.12); color: #1a7a50; }
.build-tile--wrong  { border-color: #f05c5c; box-shadow: 0 3px 0 #d83c3c; background: rgba(240, 92, 92, 0.1);  color: #b83232; }
.build-check {
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  border: none;
  background: var(--primary);
  color: #fff;
  font-family: "Nunito", sans-serif;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--primary-dark);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.build-check:active { transform: translateY(4px); box-shadow: none; }
