/* NURAXIA LANGUAGE — Design System
   Mobile-first, Telegram-first, coerente con dark+oro di Nuraxia.
   Font Cinzel per titoli, system-serif per contenuto didattico.
   Cirillico supportato via system fonts.
*/

/* ── VARIABILI (riusa quelle di games.css) ─────────────────────────────────── */
:root {
  --lx-gold:        #c9a25c;
  --lx-gold-bright: #f5d48a;
  --lx-gold-dark:   #8a6e3a;
  --lx-stone:       #1a232b;
  --lx-stone-light: #2a3540;
  --lx-bg:          #0d1117;
  --lx-green:       #7fc780;
  --lx-red:         #e07070;
  --lx-blue:        #7fc7ff;
  --lx-text:        #ece5d8;
  --lx-text-dim:    rgba(236,229,216,.5);
  --lx-radius:      14px;
  --lx-radius-sm:   8px;
}

/* ── SCHERMATA BASE ─────────────────────────────────────────────────────────── */
.lx-screen {
  min-height: 100vh;
  background: radial-gradient(ellipse at 50% 0%, #162030 0%, #090e18 45%, #020408 100%);
  color: var(--lx-text);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

.lx-center {
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 20px;
}

/* ── TOPBAR ─────────────────────────────────────────────────────────────────── */
.lx-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 0;
  position: relative;
  z-index: 10;
}

.lx-topbar-title {
  font-family: 'Cinzel', 'Palatino Linotype', Palatino, serif;
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: 2px;
  background: linear-gradient(180deg, #f5d48a 0%, #c9a25c 60%, #8a6e3a 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
}

/* ── BOTTONI ────────────────────────────────────────────────────────────────── */
.lx-btn-primary {
  padding: 15px 20px;
  border-radius: var(--lx-radius);
  border: 1px solid rgba(245,212,138,.3);
  cursor: pointer;
  background: linear-gradient(135deg, #7a5c28 0%, #b8903a 30%, #f5d48a 50%, #b8903a 70%, #7a5c28 100%);
  background-size: 200% auto;
  color: #0d0a04;
  font-size: .9rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  font-family: 'Cinzel', 'Palatino Linotype', Palatino, serif;
  box-shadow: 0 4px 20px rgba(201,162,92,.3);
  transition: transform .15s, box-shadow .15s;
  -webkit-tap-highlight-color: transparent;
}
.lx-btn-primary:hover, .lx-btn-primary:active {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(201,162,92,.45);
}
.lx-btn-full { width: 100%; box-sizing: border-box; }

.lx-btn-ghost {
  padding: 10px 16px;
  border-radius: var(--lx-radius-sm);
  border: 1px solid rgba(201,162,92,.15);
  background: transparent;
  color: rgba(201,162,92,.55);
  font-size: .8rem;
  cursor: pointer;
  transition: border-color .2s, color .2s;
}
.lx-btn-ghost:hover { border-color: rgba(201,162,92,.35); color: var(--lx-gold); }

.lx-btn-sm { padding: 7px 12px; font-size: .78rem; }

.lx-btn-continue {
  margin: 16px 0 8px;
  animation: lx-shimmer 4s linear infinite;
}
@keyframes lx-shimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}

/* ── LOADING / ERRORE ───────────────────────────────────────────────────────── */
.lx-loading {
  text-align: center;
  padding: 48px 24px;
  color: var(--lx-text-dim);
  font-size: .85rem;
  font-style: italic;
}

.lx-error {
  color: var(--lx-red);
  text-align: center;
  padding: 16px;
  font-size: .85rem;
}

.lx-hint {
  color: var(--lx-text-dim);
  font-size: .78rem;
  font-style: italic;
  margin: 6px 0;
}

.lx-empty {
  text-align: center;
  color: var(--lx-text-dim);
  padding: 32px;
  font-style: italic;
}

/* ── HOME ───────────────────────────────────────────────────────────────────── */
.lx-home-body { flex: 1; overflow-y: auto; padding: 0 16px 40px; }
.lx-home-inner { max-width: 400px; margin: 0 auto; padding-top: 20px; }

.lx-lang-badge {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--lx-radius);
  background: linear-gradient(145deg, rgba(201,162,92,.1), rgba(26,35,43,.5));
  border: 1px solid rgba(201,162,92,.18);
  margin-bottom: 16px;
}
.lx-lang-flag { font-size: 2rem; }
.lx-lang-label { font-size: .6rem; color: var(--lx-text-dim); letter-spacing: 1px; }
.lx-lang-name  { font-family: 'Cinzel', serif; font-size: .95rem; font-weight: 700; color: var(--lx-gold-bright); }

.lx-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.lx-stat-card {
  text-align: center;
  padding: 12px 6px;
  border-radius: var(--lx-radius-sm);
  background: rgba(255,255,255,.025);
  border: 1px solid rgba(201,162,92,.08);
}
.lx-stat-val  { font-family: 'Cinzel', serif; font-size: 1.4rem; font-weight: 700; color: var(--lx-gold); }
.lx-stat-lbl  { font-size: .55rem; color: var(--lx-text-dim); letter-spacing: 1px; text-transform: uppercase; margin-top: 4px; }

.lx-goal-bar  { height: 5px; border-radius: 3px; background: rgba(128,128,128,.12); overflow: hidden; margin-bottom: 4px; }
.lx-goal-fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg, #5a3c10, #c9a25c, #f5d48a); transition: width .5s ease; }
.lx-goal-done { background: linear-gradient(90deg, #2a5a2a, var(--lx-green)); }
.lx-goal-label { font-size: .65rem; color: var(--lx-text-dim); text-align: right; margin-bottom: 20px; }

/* setup no-profile */
.lx-setup-icon  { font-size: 3rem; margin-bottom: 12px; }
.lx-setup-title { font-family: 'Cinzel', serif; font-size: 1.3rem; font-weight: 700; color: var(--lx-gold-bright); margin: 0 0 6px; }
.lx-setup-sub   { font-size: .85rem; color: var(--lx-text-dim); font-style: italic; margin-bottom: 20px; }

/* ── PATH ───────────────────────────────────────────────────────────────────── */
.lx-path-body { flex: 1; overflow-y: auto; padding: 16px 16px 48px; }

.lx-unit {
  margin-bottom: 24px;
  animation: lx-fade-up .35s ease both;
}
@keyframes lx-fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.lx-unit-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.lx-unit-badge {
  font-family: 'Cinzel', serif;
  font-size: .58rem;
  letter-spacing: 2px;
  color: rgba(201,162,92,.45);
  text-transform: uppercase;
}
.lx-unit-cefr {
  font-size: .6rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(201,162,92,.12);
  color: var(--lx-gold);
  font-weight: 700;
}
.lx-unit-title {
  font-family: 'Cinzel', serif;
  font-size: .9rem;
  font-weight: 600;
  color: var(--lx-text);
  margin: 0 0 10px;
}

.lx-lessons { display: flex; flex-direction: column; gap: 6px; }

.lx-lesson-row {
  border-radius: var(--lx-radius-sm);
  overflow: hidden;
  animation: lx-fade-up .3s ease both;
}

.lx-lesson-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid rgba(201,162,92,.1);
  background: linear-gradient(145deg, rgba(26,36,48,.9), rgba(14,20,30,.95));
  color: var(--lx-text);
  cursor: pointer;
  border-radius: var(--lx-radius-sm);
  text-align: left;
  transition: all .2s;
}
.lx-lesson-btn:hover { border-color: rgba(201,162,92,.3); background: linear-gradient(145deg, rgba(36,48,62,.9), rgba(24,32,44,.95)); }

.lx-les-available .lx-lesson-btn { border-color: rgba(201,162,92,.25); }
.lx-les-completed .lx-lesson-btn { border-color: rgba(127,199,128,.3); background: linear-gradient(145deg, rgba(20,40,20,.9), rgba(12,28,12,.95)); }
.lx-les-locked    .lx-lesson-btn { opacity: .5; cursor: default; }

.lx-les-icon  { font-size: 1rem; width: 20px; text-align: center; flex-shrink: 0; }
.lx-les-title { flex: 1; font-size: .82rem; font-weight: 500; }
.lx-les-xp    { font-size: .65rem; color: var(--lx-gold); font-weight: 600; white-space: nowrap; }

.lx-lock-msg {
  padding: 8px 14px;
  font-size: .72rem;
  color: var(--lx-text-dim);
  font-style: italic;
  background: rgba(0,0,0,.2);
  border-top: 1px solid rgba(255,255,255,.04);
}
.lx-hidden { display: none !important; }

/* ── LEZIONE ────────────────────────────────────────────────────────────────── */
.lx-lesson-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px 8px;
  position: sticky;
  top: 0;
  background: rgba(9,14,24,.95);
  backdrop-filter: blur(8px);
  z-index: 10;
}

.lx-progress-bar {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: rgba(128,128,128,.15);
  overflow: hidden;
}
.lx-progress-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #5a3c10, #c9a25c, #f5d48a);
  transition: width .4s ease;
}
.lx-lesson-counter {
  font-size: .65rem;
  color: var(--lx-text-dim);
  white-space: nowrap;
  font-family: 'Cinzel', serif;
}

.lx-ex-area {
  flex: 1;
  padding: 24px 16px 16px;
  max-width: 420px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.lx-lesson-footer {
  padding: 12px 16px 24px;
  background: rgba(9,14,24,.95);
  backdrop-filter: blur(8px);
}

/* ── ESERCIZI ───────────────────────────────────────────────────────────────── */
.lx-ex-wrap { display: flex; flex-direction: column; gap: 14px; }

.lx-question {
  font-size: 1rem;
  line-height: 1.55;
  color: var(--lx-text);
  margin: 0;
  font-family: Georgia, 'Times New Roman', serif; /* leggibile per cirillico */
}

/* choice */
.lx-options { display: flex; flex-direction: column; gap: 8px; }
.lx-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--lx-radius-sm);
  border: 1px solid rgba(201,162,92,.15);
  background: linear-gradient(145deg, rgba(26,36,48,.9), rgba(14,20,30,.95));
  color: var(--lx-text);
  cursor: pointer;
  font-size: .9rem;
  text-align: left;
  transition: all .18s;
  font-family: Georgia, 'Times New Roman', serif;
}
.lx-opt:hover  { border-color: rgba(201,162,92,.35); background: rgba(36,48,62,.9); }
.lx-opt:active { transform: scale(.98); }
.lx-opt:disabled { cursor: default; }
.lx-opt-letter {
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(201,162,92,.12); border: 1px solid rgba(201,162,92,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 700; color: var(--lx-gold); flex-shrink: 0;
}
.lx-opt-text  { flex: 1; }
.lx-opt-selected { border-color: var(--lx-gold); background: rgba(201,162,92,.12); }

/* translate / cloze input */
.lx-input-row, .lx-cloze-sentence { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }

.lx-text-input, .lx-cloze-input {
  flex: 1; min-width: 0;
  padding: 14px 16px;
  border-radius: var(--lx-radius-sm);
  border: 1px solid rgba(201,162,92,.25);
  background: linear-gradient(145deg, rgba(26,36,48,.9), rgba(14,20,30,.95));
  color: var(--lx-text);
  font-size: 1rem;
  outline: none;
  font-family: Georgia, 'Times New Roman', serif;
  transition: border-color .2s, box-shadow .2s;
}
.lx-text-input:focus, .lx-cloze-input:focus {
  border-color: rgba(245,212,138,.5);
  box-shadow: 0 0 0 3px rgba(201,162,92,.08);
}
.lx-cloze-text { font-size: 1rem; font-family: Georgia, serif; line-height: 1.8; }
.lx-cloze-input { min-width: 120px; width: auto; flex: 0 1 180px; text-align: center; }

/* match */
.lx-match-instruction { font-size: .8rem; color: var(--lx-text-dim); font-style: italic; margin: 0 0 12px; }
.lx-match-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lx-match-col  { display: flex; flex-direction: column; gap: 6px; }
.lx-match-item {
  padding: 12px 10px;
  border-radius: var(--lx-radius-sm);
  border: 1px solid rgba(201,162,92,.15);
  background: linear-gradient(145deg, rgba(26,36,48,.9), rgba(14,20,30,.95));
  color: var(--lx-text);
  cursor: pointer;
  font-size: .82rem;
  text-align: center;
  transition: all .18s;
  font-family: Georgia, 'Times New Roman', serif;
  min-height: 44px;
}
.lx-match-item:hover  { border-color: rgba(201,162,92,.35); }
.lx-match-item.lx-selected { border-color: var(--lx-gold); background: rgba(201,162,92,.12); }
.lx-match-item.lx-matched  { border-color: rgba(127,199,128,.4); background: rgba(20,50,20,.8); color: var(--lx-green); cursor: default; }
.lx-match-item.lx-wrong-flash { border-color: var(--lx-red); background: rgba(50,10,10,.8); }
.lx-match-item:disabled { cursor: default; }

/* feedback */
.lx-feedback {
  padding: 12px 16px;
  margin: 0 16px;
  border-radius: var(--lx-radius-sm);
  font-size: .88rem;
  font-weight: 600;
  text-align: center;
  transition: all .2s;
}
.lx-fb-correct { background: rgba(127,199,128,.12); border: 1px solid rgba(127,199,128,.3); color: var(--lx-green); }
.lx-fb-wrong   { background: rgba(224,112,112,.08); border: 1px solid rgba(224,112,112,.25); color: var(--lx-red); }
.lx-fb-neutral { background: rgba(201,162,92,.08);  border: 1px solid rgba(201,162,92,.2);  color: var(--lx-gold); }

/* done */
.lx-done { padding: 40px 20px; }
.lx-done-icon  { font-size: 3.5rem; margin-bottom: 16px; }
.lx-done-title { font-family: 'Cinzel', serif; font-size: 1.3rem; font-weight: 700; color: var(--lx-gold-bright); margin: 0 0 8px; }
.lx-done-sub   { font-size: .82rem; color: var(--lx-text-dim); font-style: italic; margin-bottom: 24px; }
.lx-done-stats { display: flex; gap: 16px; justify-content: center; margin-bottom: 28px; }
.lx-stat-box   { text-align: center; }
.lx-stat-n     { font-family: 'Cinzel', serif; font-size: 2rem; font-weight: 700; color: var(--lx-gold); }
.lx-stat-label { font-size: .65rem; color: var(--lx-text-dim); letter-spacing: 1px; text-transform: uppercase; }
