:root {
  --bg: #f8fafc;
  --bg-subtle: #f1f5f9;
  --bg-card: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --primary: #4f46e5;
  --primary-dark: #3730a3;
  --primary-light: #eef2ff;
  --accent: #0ea5e9;
  --accent-soft: #e0f2fe;
  --kids: #f97316;
  --kids-soft: #fff7ed;
  --kids-pink: #ec4899;
  --kids-green: #22c55e;
  --pro: #7c3aed;
  --pro-soft: #f3e8ff;
  --vocab: #059669;
  --vocab-soft: #ecfdf5;
  --translator: #0284c7;
  --translator-soft: #e0f2fe;
  --practice: #d97706;
  --practice-soft: #fffbeb;
  --premium-gold: #ca8a04;
  --premium-soft: #fef9c3;
  --account: #6366f1;
  --quiz: #dc2626;
  --quiz-soft: #fef2f2;
  --music: #db2777;
  --music-soft: #fdf2f8;
  --success: #16a34a;
  --success-bg: #f0fdf4;
  --error: #ef4444;
  --error-bg: #fef2f2;
  --border: #e2e8f0;
  --shadow: 0 4px 20px rgba(79, 70, 229, 0.08);
  --shadow-lg: 0 12px 40px rgba(79, 70, 229, 0.12);
  --radius: 12px;
  --radius-lg: 20px;
  --font: "Plus Jakarta Sans", system-ui, sans-serif;
  --font-display: "Plus Jakarta Sans", system-ui, sans-serif;
  --font-kids: "Nunito", "Plus Jakarta Sans", system-ui, sans-serif;
  --gradient-hero: linear-gradient(135deg, #eef2ff 0%, #fce7f3 45%, #fff7ed 100%);
  --gradient-primary: linear-gradient(135deg, #4f46e5, #7c3aed);
  --gradient-kids: linear-gradient(135deg, #f97316, #ec4899);
  --section-accent: var(--primary);
  --section-soft: var(--primary-light);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

body.kids-active {
  background: linear-gradient(180deg, #fff7ed 0%, #fdf2f8 50%, #f0fdf4 100%);
}

/* Header */
.header {
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header__stripe {
  height: 4px;
  background: var(--section-accent, var(--gradient-primary));
  transition: background 0.35s ease;
}

body.theme-home .header__stripe { background: linear-gradient(90deg, #4f46e5, #ec4899, #f97316); }
body.theme-a1 .header__stripe { background: linear-gradient(90deg, #4f46e5, #0ea5e9); }
body.theme-kids .header__stripe,
body.kids-active .header__stripe { background: linear-gradient(90deg, #f97316, #ec4899, #22c55e); }
body.theme-pro .header__stripe { background: linear-gradient(90deg, #7c3aed, #db2777); }
body.theme-vocab .header__stripe { background: linear-gradient(90deg, #059669, #10b981); }
body.theme-translator .header__stripe { background: linear-gradient(90deg, #0284c7, #38bdf8); }
body.theme-practice .header__stripe { background: linear-gradient(90deg, #d97706, #fbbf24); }
body.theme-premium .header__stripe { background: linear-gradient(90deg, #ca8a04, #eab308, #f97316); }
body.theme-account .header__stripe { background: linear-gradient(90deg, #6366f1, #8b5cf6); }
body.theme-quiz .header__stripe { background: linear-gradient(90deg, #dc2626, #f97316); }
body.theme-music .header__stripe { background: linear-gradient(90deg, #db2777, #7c3aed, #4f46e5); }

.header__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: nowrap;
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.logo__img {
  height: 42px;
  width: auto;
  display: block;
}

.nav {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.nav::-webkit-scrollbar {
  display: none;
}

.nav__list {
  display: flex;
  gap: 0.2rem;
  list-style: none;
  flex-wrap: nowrap;
  width: max-content;
  min-width: 100%;
}

.nav__list a {
  text-decoration: none;
  color: var(--text-muted);
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.8125rem;
  line-height: 1.2;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}

.nav__list a:hover,
.nav__list a.active {
  color: var(--section-accent, var(--primary));
  background: var(--section-soft, var(--primary-light));
  font-weight: 600;
}

body.theme-a1 .nav__list a[data-nav="lessons"].active { background: #eef2ff; color: #4f46e5; }
body.theme-kids .nav__list a[data-nav="kids-course"].active { background: #fff7ed; color: #ea580c; }
body.theme-pro .nav__list a[data-nav="pro-course"].active { background: #f3e8ff; color: #7c3aed; }
body.theme-vocab .nav__list a[data-nav="vocabulary"].active { background: #ecfdf5; color: #059669; }
body.theme-translator .nav__list a[data-nav="translator"].active { background: #e0f2fe; color: #0284c7; }
body.theme-practice .nav__list a[data-nav="practice"].active { background: #fffbeb; color: #d97706; }
body.theme-premium .nav__list a[data-nav="premium"].active { background: #fef9c3; color: #ca8a04; }
body.theme-account .nav__list a[data-nav="account"].active { background: #eef2ff; color: #6366f1; }
body.theme-music .nav__list a[data-nav="music-course"].active { background: #fdf2f8; color: #db2777; }

.progress-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--gradient-primary);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius);
  min-width: 58px;
  color: white;
  flex-shrink: 0;
}

.progress-badge__label {
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 600;
}

.progress-badge__value {
  font-weight: 700;
  color: white;
  font-size: 0.875rem;
}

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav__toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* Main */
#app {
  flex: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  width: 100%;
}

.view {
  display: none;
  animation: fadeIn 0.3s ease;
}

.view--active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3rem;
  align-items: center;
  margin-bottom: 4rem;
}

.hero__tag {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.375rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.15;
  margin-bottom: 1rem;
  color: var(--text);
}

.hero__desc {
  color: var(--text-muted);
  font-size: 1.0625rem;
  max-width: 520px;
  margin-bottom: 1.75rem;
}

.hero__actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.hero__card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  box-shadow: var(--shadow);
  min-width: 180px;
}

.hero__stat {
  text-align: center;
}

.hero__stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--primary);
}

.hero__stat span {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Features */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
}

.feature {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
}

.feature__icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.feature h3 {
  font-size: 1.0625rem;
  margin-bottom: 0.5rem;
}

.feature p {
  color: var(--text-muted);
  font-size: 0.9375rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  font-family: var(--font);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.15s, transform 0.1s, opacity 0.15s;
}

.btn:active {
  transform: scale(0.98);
}

.btn--primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}

.btn--primary:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn--kids {
  background: var(--gradient-kids);
  color: white;
  box-shadow: 0 4px 14px rgba(249, 115, 22, 0.35);
}

.btn--kids:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn--music {
  background: linear-gradient(135deg, #db2777, #7c3aed);
  color: #fff;
  border: none;
}

.btn--music:hover:not(:disabled) {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.btn--primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}

.btn--ghost:hover {
  background: var(--bg-card);
  border-color: var(--text-muted);
}

.btn--success {
  background: var(--success);
  color: white;
}

.btn--sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* Page header */
.page-header {
  margin-bottom: 2rem;
}

.page-header h2 {
  font-family: var(--font-display);
  font-size: 1.875rem;
  margin-bottom: 0.5rem;
}

.page-header p {
  color: var(--text-muted);
}

.back-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-family: var(--font);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 1.5rem;
  padding: 0;
}

.back-btn:hover {
  text-decoration: underline;
}

/* Lesson grid */
.lesson-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.lesson-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  cursor: pointer;
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.15s;
  position: relative;
  overflow: hidden;
}

.lesson-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--primary-light);
  transform: translateY(-2px);
}

.lesson-card--completed {
  border-color: var(--success);
}

.lesson-card--completed::after {
  content: "✓";
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--success-bg);
  color: var(--success);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
}

.lesson-card--locked {
  opacity: 0.55;
  cursor: not-allowed;
}

.lesson-card__icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.lesson-card__num {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.lesson-card h3 {
  font-size: 1.0625rem;
  margin: 0.25rem 0 0.375rem;
}

.lesson-card__en {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-style: italic;
}

.lesson-card p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* Lesson detail */
.lesson-header {
  margin-bottom: 2rem;
}

.lesson-header__icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.lesson-header h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
}

.lesson-header__en {
  color: var(--text-muted);
  font-style: italic;
}

.lesson-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  margin-bottom: 1.25rem;
}

.lesson-section h3 {
  font-size: 1.125rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.vocab-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.625rem;
}

.vocab-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.625rem 0.875rem;
  background: var(--bg);
  border-radius: 8px;
  font-size: 0.9375rem;
}

.vocab-item__en {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.vocab-item strong {
  color: var(--primary-dark);
}

.vocab-card__en {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.dialog__text {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.lesson-audio-all {
  margin-left: auto;
  font-size: 0.8125rem !important;
}

.audio-btn {
  background: var(--primary-light);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 0.875rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.1s;
  line-height: 1;
}

.audio-btn:hover {
  background: #bfdbfe;
  transform: scale(1.08);
}

.audio-btn--playing {
  background: var(--accent);
  animation: pulse-audio 0.8s ease infinite;
}

@keyframes pulse-audio {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

/* Speak / pronunciation exercises */
.exercise--speak {
  border: 1.5px solid var(--primary-light);
  background: linear-gradient(135deg, #f0f7ff 0%, var(--bg) 100%);
}

.speak-phrase {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 1rem;
}

.speak-phrase__text {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--primary-dark);
  flex: 1;
}

.speak-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.speak-mic-btn {
  min-width: 130px;
}

.speak-mic-btn--active {
  background: var(--error) !important;
  animation: pulse-mic 1s ease infinite;
}

@keyframes pulse-mic {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); }
}

.speak-status {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.speak-status--listening {
  color: var(--error);
  font-weight: 600;
}

.speak-heard {
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border-radius: 8px;
  font-size: 0.9375rem;
  margin-bottom: 0.5rem;
  border-left: 3px solid var(--primary);
}

.speak-heard__label {
  font-weight: 600;
  color: var(--text-muted);
  margin-right: 0.5rem;
}

.speak-heard__text {
  color: var(--text);
  font-style: italic;
}

.speak-unsupported {
  font-size: 0.875rem;
  color: var(--text-muted);
  padding: 0.75rem;
  background: var(--error-bg);
  border-radius: 8px;
}

.grammar-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  margin: 1rem 0;
}

.grammar-table th,
.grammar-table td {
  padding: 0.625rem 0.875rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.grammar-table th {
  background: var(--bg);
  font-weight: 600;
}

.lesson-section ul {
  padding-left: 1.25rem;
  margin: 0.75rem 0;
}

.lesson-section li {
  margin-bottom: 0.375rem;
}

.dialog {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.dialog__line {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.9375rem;
}

.dialog__line:nth-child(odd) {
  background: var(--primary-light);
  margin-right: 2rem;
}

.dialog__line:nth-child(even) {
  background: var(--bg);
  margin-left: 2rem;
}

.dialog__speaker {
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--primary);
  margin-bottom: 0.125rem;
}

/* Exercises */
.exercise {
  padding: 1.25rem;
  background: var(--bg);
  border-radius: 10px;
  margin-bottom: 1rem;
}

.exercise__num {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.exercise__question {
  font-weight: 500;
  margin-bottom: 0.875rem;
}

.exercise__input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: var(--font);
  font-size: 0.9375rem;
  margin-bottom: 0.625rem;
}

.exercise__input:focus {
  outline: none;
  border-color: var(--primary);
}

.exercise__options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.exercise__option {
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.9375rem;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
}

.exercise__option:hover:not(:disabled) {
  border-color: var(--primary);
}

.exercise__option--selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

.exercise__option--correct {
  border-color: var(--success);
  background: var(--success-bg);
}

.exercise__option--wrong {
  border-color: var(--error);
  background: var(--error-bg);
}

.exercise__feedback {
  font-size: 0.875rem;
  font-weight: 500;
  margin-top: 0.5rem;
}

.exercise__feedback--ok {
  color: var(--success);
}

.exercise__feedback--fail {
  color: var(--error);
}

.lesson-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

/* Vocabulary page */
.vocab-filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.filter-btn {
  padding: 0.5rem 1rem;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  border-radius: 999px;
  font-family: var(--font);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.15s;
}

.filter-btn--active,
.filter-btn:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary-dark);
}

.vocab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.vocab-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.vocab-card__lesson {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.vocab-card__items {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.vocab-card__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  padding: 0.375rem 0;
  border-bottom: 1px solid var(--bg);
}

.vocab-card__row:last-child {
  border-bottom: none;
}

.vocab-card__row strong {
  color: var(--text);
}

.vocab-card__row span {
  color: var(--text-muted);
}

/* Quiz */
.quiz-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 640px;
}

.quiz-start p {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.quiz-progress {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.quiz-bar {
  flex: 1;
  height: 6px;
  background: var(--bg);
  border-radius: 999px;
  overflow: hidden;
}

.quiz-bar__fill {
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
  transition: width 0.3s;
  width: 0%;
}

.quiz-question {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin-bottom: 1rem;
}

.quiz-feedback {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-weight: 500;
  margin-bottom: 1rem;
}

.quiz-feedback--ok {
  background: var(--success-bg);
  color: var(--success);
}

.quiz-feedback--fail {
  background: var(--error-bg);
  color: var(--error);
}

.quiz-result {
  text-align: center;
}

.quiz-result__score {
  font-family: var(--font-display);
  font-size: 3rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.hidden {
  display: none !important;
}

/* Translator */
.translator {
  max-width: 900px;
}

.translator__toolbar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.translator__lang {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.translator__lang-label {
  font-weight: 600;
  font-size: 1.0625rem;
}

.translator__swap {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  font-size: 1.25rem;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}

.translator__swap:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  transform: rotate(180deg);
}

.translator__modes {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.translator__panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.translator__panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
}

.translator__panel-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.625rem;
}

.translator__textarea {
  flex: 1;
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 0.875rem;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  resize: vertical;
  min-height: 140px;
}

.translator__textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.translator__panel-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.625rem;
  gap: 0.5rem;
}

.translator__charcount {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.translator__result {
  flex: 1;
  min-height: 140px;
  padding: 0.875rem;
  background: var(--bg);
  border-radius: 8px;
  font-size: 1.0625rem;
  line-height: 1.6;
}

.translator__result-text {
  font-weight: 500;
  color: var(--primary-dark);
}

.translator__placeholder,
.translator__loading {
  color: var(--text-muted);
  font-style: italic;
}

.translator__error {
  color: var(--error);
}

.translator__source {
  font-size: 0.8125rem;
  color: var(--success);
  font-weight: 500;
}

.translator__actions {
  display: flex;
  gap: 0.375rem;
}

.translator__submit {
  width: 100%;
  margin-bottom: 1.25rem;
}

.translator__hints {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.translator__hints p + p {
  margin-top: 0.375rem;
}

.translator__history {
  margin-top: 1.5rem;
}

.translator__history h3 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.translator__history ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.translator__history-item {
  width: 100%;
  text-align: left;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  transition: border-color 0.15s, background 0.15s;
}

.translator__history-item:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.translator__history-dir {
  flex-shrink: 0;
}

.translator__history-input {
  color: var(--text-muted);
}

.translator__history-arrow {
  color: var(--text-muted);
}

.translator__history-output {
  font-weight: 600;
  color: var(--primary-dark);
}

@media (max-width: 768px) {
  .translator__panels {
    grid-template-columns: 1fr;
  }
}

/* Footer */
.footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
}

.footer__inner {
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.footer__logo {
  opacity: 0.9;
}

.footer__tagline {
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.footer__links {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  justify-content: center;
}

.footer__links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
}

.footer__links a:hover {
  color: var(--primary);
}

.footer__copy {
  color: var(--text-muted);
  font-size: 0.8125rem;
  margin-top: 0.5rem;
}

/* Ad slots */
.ad-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.ad-wrap--top {
  padding-top: 0.75rem;
  padding-bottom: 0.25rem;
}

.ad-wrap--content {
  margin: 2rem auto;
}

.ad-wrap--footer {
  padding-bottom: 1rem;
}

.ad-wrap--inline {
  padding: 0;
  margin-bottom: 1rem;
}

.ad-slot {
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  text-align: center;
  min-height: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
}

.ad-slot--custom.ad-slot--premium {
  border-style: solid;
  border-color: var(--primary-light);
  background: linear-gradient(135deg, #eff6ff, #fff);
  padding: 1.25rem 1.5rem;
  gap: 0.5rem;
}

.ad-slot--custom strong {
  font-size: 1.05rem;
  line-height: 1.3;
}

.ad-slot--custom p {
  margin: 0;
  line-height: 1.45;
  max-width: 520px;
}

.ad-slot--custom .btn {
  margin-top: 0.35rem;
}

.ad-slot--placeholder {
  background: var(--bg);
}

.ad-slot__label {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
}

.ad-slot__text {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.ad-slot__cta {
  font-size: 0.8125rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.ad-slot__cta:hover {
  text-decoration: underline;
}

/* Premium page */
.premium-page {
  max-width: 960px;
}

.premium-hero {
  text-align: center;
  margin-bottom: 2rem;
}

.premium-hero h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.premium-hero p {
  color: var(--text-muted);
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.plan-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  position: relative;
  display: flex;
  flex-direction: column;
}

.plan-card--featured {
  border-color: var(--primary);
  box-shadow: var(--shadow);
}

.plan-card__badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
}

.plan-card h3 {
  font-size: 1.125rem;
  margin-bottom: 0.75rem;
  margin-top: 0.5rem;
}

.plan-card__price {
  margin-bottom: 1.25rem;
}

.plan-card__price strong {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--primary);
}

.plan-card__price span {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.plan-card__features {
  list-style: none;
  flex: 1;
  margin-bottom: 1.5rem;
}

.plan-card__features li {
  font-size: 0.9375rem;
  color: var(--text-muted);
  padding: 0.375rem 0;
  border-bottom: 1px solid var(--bg);
}

.plan-card__cta {
  width: 100%;
}

.premium-donate,
.premium-monetize-info,
.newsletter-box,
.affiliates-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  margin-bottom: 1.25rem;
  text-align: center;
}

.premium-donate h3,
.premium-monetize-info h3,
.newsletter-box h3,
.affiliates-section h3 {
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}

.premium-donate p,
.premium-monetize-info p,
.newsletter-box p {
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-size: 0.9375rem;
}

.affiliates-disclaimer {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.affiliate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  text-align: left;
}

.affiliate-card {
  background: var(--bg);
  border-radius: 10px;
  padding: 1.25rem;
}

.affiliate-card__tag {
  font-size: 0.6875rem;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 0.05em;
}

.affiliate-card h4 {
  font-size: 1rem;
  margin: 0.375rem 0;
}

.affiliate-card p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.affiliate-card__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.affiliate-card__price {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--success);
}

.newsletter-form {
  display: flex;
  gap: 0.5rem;
  max-width: 420px;
  margin: 0 auto 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.newsletter-form input {
  flex: 1;
  min-width: 200px;
  padding: 0.625rem 0.875rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: var(--font);
}

.newsletter-form input:focus {
  outline: none;
  border-color: var(--primary);
}

.newsletter-note {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.newsletter-note--ok {
  color: var(--success);
  font-weight: 500;
}

/* Legal pages */
.legal-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.legal-page h1 {
  font-family: var(--font-display);
  font-size: 1.875rem;
  margin-bottom: 0.25rem;
}

.legal-page__updated {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

.legal-page h2 {
  font-size: 1.125rem;
  margin: 1.5rem 0 0.5rem;
}

.legal-page p,
.legal-page li {
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.legal-page ul {
  padding-left: 1.25rem;
  margin-bottom: 1rem;
}

.legal-page a {
  color: var(--primary);
}

/* Footer legacy override removed */
.footer p {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 768px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .hero__card {
    flex-direction: row;
    justify-content: space-around;
  }

  .features {
    grid-template-columns: 1fr;
  }

  .nav__toggle {
    display: flex;
  }

  .nav__list {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    flex-direction: column;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
  }

  .nav__list--open {
    display: flex;
  }

  .nav {
    position: relative;
  }

  .header__inner {
    flex-wrap: wrap;
  }

  .progress-badge {
    margin-left: auto;
  }
}

/* ——— Vivid UI + Kids ——— */
.hero--vivid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
  padding: 2.5rem 2rem;
  margin-bottom: 2.5rem;
  background: var(--gradient-hero);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.hero__content { max-width: 520px; }

.hero__eyebrow {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.hero--vivid h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.hero__highlight {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__desc {
  color: var(--text-muted);
  font-size: 1.0625rem;
  margin-bottom: 1.5rem;
}

.hero__visual {
  position: relative;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero__mascot {
  font-size: 6rem;
  animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.hero__bubble {
  position: absolute;
  background: white;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.875rem;
  box-shadow: var(--shadow);
  animation: float 3s ease-in-out infinite;
}

.hero__bubble--1 { top: 10%; left: 5%; animation-delay: 0s; }
.hero__bubble--2 { top: 55%; right: 0; animation-delay: 0.5s; }
.hero__bubble--3 { bottom: 5%; left: 15%; animation-delay: 1s; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.section-label {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-light);
  margin-bottom: 1rem;
}

.tracks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.tracks--3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.tracks--4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.track-card {
  border: 2px solid transparent;
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  background: white;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.track-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}

.track-card--a1::before { background: linear-gradient(90deg, #4f46e5, #0ea5e9); }
.track-card--kids::before { background: var(--gradient-kids); }
.track-card--pro::before { background: linear-gradient(90deg, #7c3aed, #ec4899); }

.track-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.track-card__icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.track-card__badge {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  margin-bottom: 0.75rem;
}

.track-card__badge--free { background: var(--primary-light); color: var(--primary); }
.track-card__badge--kids { background: #fce7f3; color: #db2777; }
.track-card__badge--pro { background: #f3e8ff; color: #7c3aed; }

.track-card h3 { font-size: 1.35rem; font-weight: 800; margin-bottom: 0.25rem; }
.track-card__level { font-size: 0.8125rem; color: var(--text-muted); margin-bottom: 1rem; }
.track-card__list { list-style: none; margin-bottom: 1.25rem; }
.track-card__list li {
  font-size: 0.875rem;
  color: var(--text-muted);
  padding: 0.3rem 0;
  padding-left: 1.25rem;
  position: relative;
}
.track-card__list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--success);
  font-weight: 700;
}
.track-card__cta { font-size: 0.9375rem; font-weight: 700; color: var(--primary); }

.features-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.feature-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: white;
  border: 1px solid var(--border);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: var(--shadow);
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
}

.stats-row--vivid .stat-item {
  background: white;
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
  box-shadow: var(--shadow);
}

.stat-item--blue strong { color: #4f46e5; }
.stat-item--pink strong { color: #ec4899; }
.stat-item--green strong { color: #16a34a; }
.stat-item--purple strong { color: #7c3aed; }

.stat-item strong { display: block; font-size: 1.75rem; font-weight: 800; }
.stat-item span { font-size: 0.8125rem; color: var(--text-muted); }

.page-header__badge {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 0.75rem;
  background: var(--primary-light);
  color: var(--primary);
}

.page-header__badge--pro {
  background: #f3e8ff;
  color: #7c3aed;
}

.page-header__badge--kids {
  background: #fce7f3;
  color: #db2777;
  font-family: var(--font-kids);
}

.page-header h2 {
  font-weight: 800;
}

.lesson-card {
  border: 2px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform 0.2s, border-color 0.2s;
}

.lesson-card:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
}

.lesson-card__num {
  display: inline-flex;
  width: 2.25rem;
  height: 2.25rem;
  align-items: center;
  justify-content: center;
  background: var(--gradient-primary);
  border-radius: 10px;
  font-size: 0.8125rem;
  font-weight: 800;
  color: white;
  margin-bottom: 0.75rem;
}

.lesson-card__lock {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 0.6875rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #7c3aed;
  background: #f3e8ff;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
}

.video-wrap {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  margin: 1rem 0 0;
  border-radius: var(--radius);
  overflow: hidden;
}

.video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.pro-lock, .kids-lock {
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

.pro-lock {
  background: #f3e8ff;
  border: 2px solid #e9d5ff;
}

.kids-lock {
  background: linear-gradient(135deg, #fff7ed, #fce7f3);
  border: 2px dashed #f97316;
}

.pro-lock__inner, .kids-lock__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Kids course */
.view--kids .page-header h2 {
  font-family: var(--font-kids);
  font-size: 2.25rem;
  color: #ea580c;
}

.lesson-grid--kids {
  gap: 1.25rem;
}

.lesson-card--kids {
  border-radius: 20px;
  border-width: 3px;
  font-family: var(--font-kids);
  text-align: center;
  padding: 1.5rem 1rem;
}

.lesson-card--kids .lesson-card__icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 0.5rem;
}

.lesson-card--kids .lesson-card__num {
  background: var(--gradient-kids);
  margin: 0 auto 0.75rem;
}

.lesson-card--kids h3 {
  font-family: var(--font-kids);
  font-weight: 800;
  font-size: 1.125rem;
}

.lesson-card--kids--premium {
  border-style: dashed;
  opacity: 0.95;
}

.lesson-card--kids .lesson-card__stars {
  font-size: 1.25rem;
  margin-top: 0.5rem;
}

.kids-progress-bar {
  background: white;
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}

.kids-progress-bar__label {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-kids);
  font-weight: 700;
  margin-bottom: 0.5rem;
  font-size: 0.9375rem;
}

.kids-progress-bar__track {
  height: 12px;
  background: #fce7f3;
  border-radius: 999px;
  overflow: hidden;
}

.kids-progress-bar__fill {
  height: 100%;
  background: var(--gradient-kids);
  border-radius: 999px;
  transition: width 0.4s ease;
}

.lesson-header--kids {
  text-align: center;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
  color: white;
}

.lesson-header--kids h2 {
  font-family: var(--font-kids);
  font-weight: 800;
  font-size: 1.75rem;
}

.lesson-header--kids .lesson-header__mascot {
  font-size: 4rem;
  margin-bottom: 0.5rem;
}

.vocab-list--kids {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 0.875rem;
}

.vocab-item.vocab-item--kids {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.35rem;
  background: white;
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 1rem 0.75rem;
  text-align: center;
  transition: transform 0.15s;
  min-width: 0;
  overflow: hidden;
}

.vocab-item--kids:hover { transform: scale(1.02); }

.vocab-item--kids .vocab-item__emoji {
  font-size: 2.25rem;
  display: block;
  line-height: 1;
  margin-bottom: 0.15rem;
}

.vocab-item--kids .vocab-item__en {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  width: 100%;
}

.vocab-item--kids strong {
  display: block;
  font-family: var(--font-kids);
  font-size: 0.9375rem;
  color: var(--primary);
  line-height: 1.25;
  word-break: break-word;
  max-width: 100%;
}

.vocab-item--kids > span:not(.vocab-item__emoji) {
  display: block;
  width: 100%;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.35;
  word-break: break-word;
  padding: 0 0.15rem;
}

.story-block {
  background: white;
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  border: 2px solid #fce7f3;
}

.story-block .dialog__line {
  background: var(--kids-soft);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
}

.story-block .dialog__speaker {
  font-size: 0.8125rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: #ea580c;
}

.story-block .dialog__text {
  display: block;
  line-height: 1.45;
  word-break: break-word;
}

.lesson-section__count {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .logo__img {
    height: 34px;
  }

  .header__inner {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .header-auth {
    order: 3;
    margin-left: 0;
  }

  .progress-badge {
    order: 4;
    margin-left: auto;
  }

  .vocab-list--kids {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.back-btn--kids {
  color: #ea580c;
  font-family: var(--font-kids);
  font-weight: 700;
}

.exercise--kids {
  border: 2px solid #fce7f3;
  border-radius: 16px;
  background: white;
}

.exercise--kids .exercise__num {
  background: var(--gradient-kids);
  color: white;
  border-radius: 999px;
  padding: 0.2rem 0.75rem;
  font-family: var(--font-kids);
}

.tap-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.tap-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 1rem;
  background: var(--bg-subtle);
  border: 3px solid var(--border);
  border-radius: 16px;
  font-family: var(--font-kids);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}

.tap-option:hover:not(:disabled) {
  transform: scale(1.04);
  border-color: var(--kids);
}

.tap-option--selected {
  border-color: var(--kids);
  background: var(--kids-soft);
}

.tap-option--correct {
  border-color: var(--success);
  background: var(--success-bg);
}

.tap-option--wrong {
  border-color: var(--error);
  background: var(--error-bg);
}

.tap-listen-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--gradient-kids);
  color: white;
  border: none;
  border-radius: 999px;
  font-family: var(--font-kids);
  font-weight: 700;
  cursor: pointer;
}

.order-built {
  min-height: 48px;
  padding: 0.75rem;
  background: var(--bg-subtle);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.order-bank { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.75rem; }

.order-word {
  padding: 0.5rem 1rem;
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-family: var(--font-kids);
  font-size: 0.9375rem;
  font-weight: 700;
  cursor: pointer;
}

.match-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.5rem; }
.match-select { flex: 1; max-width: 200px; padding: 0.5rem; border: 2px solid var(--border); border-radius: 10px; font-family: var(--font); }

.lesson-card__icon-inline {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.35rem;
}

.page-header__badge--practice {
  background: #ecfdf5;
  color: #059669;
}

.practice-stats { margin-bottom: 1.5rem; }

.practice-stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
}

.practice-stat-card {
  background: white;
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  box-shadow: var(--shadow);
  border: 2px solid var(--border);
}

.practice-stat-card--total {
  border-color: #86efac;
  background: linear-gradient(180deg, #ecfdf5, #fff);
}

.practice-stat-card strong {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
}

.practice-stat-card span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.practice-setup {
  background: white;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}

.practice-filters {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.practice-filter-group label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.practice-filter-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.practice-available {
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-size: 0.9375rem;
}

.btn--lg {
  padding: 1rem 2rem;
  font-size: 1rem;
  width: 100%;
  max-width: 360px;
}

.practice-active {
  background: white;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.practice-progress {
  margin-bottom: 1.5rem;
}

.practice-progress span {
  display: block;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.practice-result {
  text-align: center;
  padding: 2rem 1rem;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.practice-result__score {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.header-auth {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
  color: var(--text);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.4rem 0.65rem;
  border-radius: 999px;
  background: var(--primary-light);
  margin-left: auto;
  flex-shrink: 0;
  white-space: nowrap;
}

.header-auth:hover { background: #e0e7ff; }

.auth-tabs { display: flex; gap: 0.5rem; margin-bottom: 1.25rem; }

.auth-tab {
  flex: 1;
  padding: 0.75rem;
  border: 2px solid var(--border);
  background: white;
  border-radius: 10px;
  font-family: var(--font);
  font-weight: 600;
  cursor: pointer;
}

.auth-tab--active { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }

.auth-form {
  background: white;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
  max-width: 420px;
}

.auth-form label { display: block; font-size: 0.875rem; font-weight: 600; margin-bottom: 0.35rem; margin-top: 0.75rem; }

.auth-form input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-family: var(--font);
}

.auth-form .btn { width: 100%; margin-top: 1.25rem; }

.auth-panel { display: none; }
.auth-panel--active { display: block; }

.auth-form__error { color: var(--error); font-size: 0.875rem; margin-top: 0.75rem; }

.account-profile {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: white;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

.account-profile__avatar {
  font-size: 3rem;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  border-radius: 50%;
}

.account-badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.875rem;
  margin-right: 0.5rem;
}

.account-badge--pro { background: #f3e8ff; color: #7c3aed; }
.account-badge--kids { background: #fce7f3; color: #db2777; }

.account-pending {
  background: #fff7ed;
  border: 2px solid #fed7aa;
  padding: 1rem;
  border-radius: var(--radius);
}

.account-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.payment-box {
  background: linear-gradient(135deg, #ecfdf5, #eff6ff);
  border: 2px solid #86efac;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.payment-box--compact { max-width: 420px; }
.payment-box--highlight { animation: pulse-border 1s ease; }

@keyframes pulse-border {
  50% { border-color: #4f46e5; box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.2); }
}

.payment-bank { background: white; border-radius: var(--radius); padding: 1rem 1.25rem; margin: 1rem 0; }

.payment-bank__row {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
}

.payment-steps { margin: 1rem 0 1.25rem 1.25rem; color: var(--text-muted); }

.payment-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.payment-note { margin-top: 1rem; font-size: 0.875rem; }
.payment-note--ok { color: var(--success); font-weight: 600; }
.payment-note--warn { color: #b45309; font-weight: 600; }

.btn--whatsapp {
  background: #25d366;
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  font-family: var(--font);
}

/* ——— Temas por sección ——— */
body.theme-home {
  background: linear-gradient(180deg, #eef2ff 0%, #fdf2f8 40%, #fff7ed 100%);
  --section-accent: #4f46e5;
  --section-soft: #eef2ff;
}

body.theme-a1 {
  background: linear-gradient(180deg, #eef2ff 0%, #f8fafc 45%, #e0f2fe 100%);
  --section-accent: #4f46e5;
  --section-soft: #eef2ff;
}

body.theme-kids,
body.kids-active {
  background: linear-gradient(180deg, #fff7ed 0%, #fdf2f8 45%, #f0fdf4 100%);
  --section-accent: #f97316;
  --section-soft: #fff7ed;
}

body.theme-pro {
  background: linear-gradient(180deg, #f3e8ff 0%, #fdf2f8 50%, #eef2ff 100%);
  --section-accent: #7c3aed;
  --section-soft: #f3e8ff;
}

body.theme-vocab {
  background: linear-gradient(180deg, #ecfdf5 0%, #f0fdf4 50%, #f8fafc 100%);
  --section-accent: #059669;
  --section-soft: #ecfdf5;
}

body.theme-translator {
  background: linear-gradient(180deg, #e0f2fe 0%, #f0f9ff 50%, #eef2ff 100%);
  --section-accent: #0284c7;
  --section-soft: #e0f2fe;
}

body.theme-practice {
  background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 35%, #f8fafc 100%);
  --section-accent: #d97706;
  --section-soft: #fffbeb;
}

body.theme-premium {
  background: linear-gradient(180deg, #fef9c3 0%, #fce7f3 45%, #f3e8ff 100%);
  --section-accent: #ca8a04;
  --section-soft: #fef9c3;
}

body.theme-account {
  background: linear-gradient(180deg, #eef2ff 0%, #f5f3ff 50%, #ecfdf5 100%);
  --section-accent: #6366f1;
  --section-soft: #eef2ff;
}

body.theme-quiz {
  background: linear-gradient(180deg, #fef2f2 0%, #fff7ed 50%, #f8fafc 100%);
  --section-accent: #dc2626;
  --section-soft: #fef2f2;
}

.page-header--a1,
.page-header--kids,
.page-header--pro,
.page-header--vocab,
.page-header--translator,
.page-header--practice,
.page-header--premium,
.page-header--account,
.page-header--quiz {
  padding: 1.75rem 1.5rem;
  border-radius: var(--radius-lg);
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}

.page-header--a1 { background: linear-gradient(135deg, #eef2ff, #e0f2fe); border: 2px solid #c7d2fe; }
.page-header--kids { background: linear-gradient(135deg, #fff7ed, #fce7f3); border: 2px solid #fed7aa; }
.page-header--pro { background: linear-gradient(135deg, #f3e8ff, #fce7f3); border: 2px solid #e9d5ff; }
.page-header--vocab { background: linear-gradient(135deg, #ecfdf5, #d1fae5); border: 2px solid #a7f3d0; }
.page-header--translator { background: linear-gradient(135deg, #e0f2fe, #bae6fd); border: 2px solid #7dd3fc; }
.page-header--practice { background: linear-gradient(135deg, #fffbeb, #fef3c7); border: 2px solid #fcd34d; }
.page-header--premium { background: linear-gradient(135deg, #fef9c3, #fde68a, #fce7f3); border: 2px solid #facc15; }
.page-header--account { background: linear-gradient(135deg, #eef2ff, #e0e7ff); border: 2px solid #a5b4fc; }
.page-header--quiz { background: linear-gradient(135deg, #fef2f2, #fff7ed); border: 2px solid #fca5a5; }

.page-header__badge--a1 { background: #eef2ff; color: #4f46e5; }
.page-header__badge--vocab { background: #ecfdf5; color: #059669; }
.page-header__badge--translator { background: #e0f2fe; color: #0284c7; }
.page-header__badge--premium { background: #fef9c3; color: #a16207; }
.page-header__badge--account { background: #eef2ff; color: #6366f1; }
.page-header__badge--quiz { background: #fef2f2; color: #dc2626; }

.section-label {
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-label::before,
.section-label::after {
  content: "";
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, transparent, #c7d2fe, transparent);
}

.track-card--a1 { border: 2px solid #c7d2fe; background: linear-gradient(180deg, #fff, #eef2ff); }
.track-card--kids { border: 2px solid #fed7aa; background: linear-gradient(180deg, #fff, #fff7ed); }
.track-card--pro { border: 2px solid #e9d5ff; background: linear-gradient(180deg, #fff, #f3e8ff); }

.track-card--a1:hover { box-shadow: 0 12px 32px rgba(79, 70, 229, 0.2); }
.track-card--kids:hover { box-shadow: 0 12px 32px rgba(249, 115, 22, 0.25); }
.track-card--pro:hover { box-shadow: 0 12px 32px rgba(124, 58, 237, 0.25); }

.features-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 2rem 0;
  justify-content: center;
}

.feature-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.1rem;
  background: white;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.875rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  border: 2px solid #e2e8f0;
}

.feature-pill span { font-size: 1.1rem; }

.lesson-card {
  border-width: 2px;
  transition: transform 0.2s, box-shadow 0.2s;
}

body.theme-a1 .lesson-card:hover { border-color: #818cf8; transform: translateY(-3px); }
body.theme-kids .lesson-card--kids:hover { border-color: #fb923c; transform: translateY(-3px); }
body.theme-pro .lesson-card:hover { border-color: #a78bfa; transform: translateY(-3px); }

.translator {
  border: 2px solid #7dd3fc;
  box-shadow: 0 8px 32px rgba(2, 132, 199, 0.12);
}

#view-premium .payment-box {
  border-width: 3px;
  border-color: #facc15;
}

/* ——— Video propio Alex ——— */
.alex-video {
  max-width: 720px;
  margin: 0 auto;
  min-height: 280px;
}

.alex-video__frame {
  background: linear-gradient(145deg, #1e1b4b, #312e81);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(79, 70, 229, 0.25);
  border: 3px solid #818cf8;
}

.alex-video__frame--local {
  background: #000;
}

.alex-video__native {
  width: 100%;
  display: block;
  max-height: 420px;
  background: #000;
}

.alex-video__stage {
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  position: relative;
}

.alex-video__slide {
  text-align: center;
  color: #fff;
  animation: alexSlideIn 0.45s ease;
  width: 100%;
}

@keyframes alexSlideIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.alex-video__slide--intro,
.alex-video__slide--outro {
  padding: 1rem;
}

.alex-video__mascot {
  font-size: 4.5rem;
  margin-bottom: 0.75rem;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.3));
}

.alex-video__slide h4 {
  font-family: var(--font-kids);
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.alex-video__slide p {
  font-size: 1rem;
  opacity: 0.9;
  max-width: 420px;
  margin: 0 auto;
}

.alex-video__brand {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.75rem;
  opacity: 0.65;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.alex-video__emoji {
  font-size: 5rem;
  margin-bottom: 0.5rem;
}

.alex-video__word {
  font-family: var(--font-kids);
  font-size: 2.25rem;
  font-weight: 800;
  margin-bottom: 0.35rem;
}

.alex-video__translation {
  font-size: 1.25rem;
  opacity: 0.85;
}

.alex-video__speaker {
  font-size: 0.875rem;
  font-weight: 700;
  opacity: 0.8;
  margin-bottom: 0.75rem;
}

.alex-video__bubble {
  display: inline-block;
  background: rgba(255, 255, 255, 0.15);
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 20px;
  padding: 1.25rem 1.5rem;
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.45;
  max-width: 480px;
  margin: 0 auto;
}

.alex-video__bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.35);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.alex-video__counter {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  min-width: 3.5rem;
}

.alex-video__dots {
  flex: 1;
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: center;
}

.alex-video__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  transition: transform 0.2s, background 0.2s;
}

.alex-video__dot--active {
  background: #fbbf24;
  transform: scale(1.25);
}

.alex-video__dot--done {
  background: #4ade80;
}

.alex-video__controls {
  display: flex;
  gap: 0.35rem;
}

.alex-video__btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 0.875rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.alex-video__btn--play {
  background: linear-gradient(135deg, #f97316, #ec4899);
  width: 42px;
  height: 42px;
  font-size: 1rem;
}

.alex-video__btn:hover {
  background: rgba(255, 255, 255, 0.28);
}

.alex-video__btn--play:hover {
  filter: brightness(1.08);
}

.alex-video__note {
  text-align: center;
  margin-top: 0.5rem;
  font-size: 0.8125rem;
}

.video-fallback {
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

.video-fallback a {
  color: var(--primary);
  font-weight: 600;
}

@media (max-width: 768px) {
  .alex-video__stage { min-height: 220px; padding: 1.25rem 1rem; }
  .alex-video__emoji { font-size: 3.5rem; }
  .alex-video__word { font-size: 1.75rem; }
  .alex-video__bubble { font-size: 1.1rem; padding: 1rem; }
}

@media (max-width: 768px) {
  .header-auth__label { display: none; }
  .hero--vivid {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 2rem 1.25rem;
  }
  .hero__visual { min-height: 140px; }
  .hero__mascot { font-size: 4rem; }
  .hero__actions { justify-content: center; }
}

/* ——— Inglés con Música ——— */
body.theme-music {
  background: linear-gradient(180deg, #fdf2f8 0%, #faf5ff 40%, #eef2ff 100%);
}

.page-header--music .page-header__badge--music {
  background: var(--music-soft);
  color: var(--music);
}

.track-card--music {
  border: 2px solid #fbcfe8;
  background: linear-gradient(180deg, #fff, #fdf2f8);
}

.track-card--music::before {
  background: linear-gradient(90deg, #db2777, #7c3aed, #4f46e5);
}

.track-card--music:hover {
  box-shadow: 0 12px 32px rgba(219, 39, 119, 0.25);
}

.track-card__badge--music {
  background: linear-gradient(135deg, #db2777, #7c3aed);
  color: #fff;
}

.stat-item--music {
  background: linear-gradient(135deg, #fdf2f8, #f3e8ff);
  border-color: #f9a8d4;
}

.stat-item--music strong { color: #db2777; }

.music-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.music-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.music-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  position: relative;
  border-top: 4px solid var(--music-color, var(--music));
}

.music-card:hover:not(.music-card--locked) {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--music-color, var(--music));
}

.music-card--locked {
  opacity: 0.55;
  cursor: not-allowed;
}

.music-card--completed {
  border-color: #22c55e;
}

.music-card__icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.5rem;
}

.music-card__num {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--music);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.music-card h3 {
  font-size: 1.0625rem;
  margin: 0.35rem 0 0.25rem;
}

.music-card__artist {
  display: block;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.music-card__genre {
  display: block;
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 0.25rem;
}

.music-card__done {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #16a34a;
}

.music-card__lock {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  font-size: 0.6875rem;
  font-weight: 700;
  background: #fef9c3;
  color: #ca8a04;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
}

.music-lock {
  background: linear-gradient(135deg, #fdf2f8, #f3e8ff);
  border: 2px solid #f9a8d4;
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}

.music-lock__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.music-song-header {
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.5rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.music-song-header h2 {
  font-size: 1.75rem;
  margin: 0.5rem 0 0.25rem;
}

.music-song-header__artist {
  opacity: 0.92;
  font-weight: 600;
}

.music-song-header__desc {
  opacity: 0.85;
  margin-top: 0.5rem;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.lyrics-list {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.lyrics-line {
  padding: 0.75rem 1rem;
  background: var(--bg);
  border-radius: var(--radius);
  border-left: 3px solid var(--music);
}

.lyrics-line__en {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.25rem;
}

.lyrics-line__es {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.back-btn--music {
  color: var(--music);
}

.back-btn--music:hover {
  background: var(--music-soft);
}
