/* ── Shared modal (🏆 Trophées, 📊 Stats) ─────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 4, 18, 0.72);
  padding: 24px;
}
.modal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: min(560px, 100%);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.6);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 16px; font-weight: 800; letter-spacing: 0.4px; }
.modal-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 8px;
}
.modal-close:hover { color: var(--text); background: var(--card); }
.modal-body { overflow-y: auto; padding: 12px 18px 18px; }

/* ── Cloud-save account control (topbar) + login modal ──────────────────────── */
#tb-auth { display: flex; align-items: center; gap: 6px; margin-left: 8px; }
.tb-auth-btn {
  background: var(--card); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 6px 10px; font-size: 13px; font-weight: 700; cursor: pointer;
}
.tb-auth-btn:hover { background: var(--panel); }
.tb-account { font-size: 13px; font-weight: 700; opacity: 0.9; max-width: 140px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.auth-sub { margin: 0 0 14px; opacity: 0.8; font-size: 14px; }
.auth-provider {
  width: 100%; padding: 10px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  font-weight: 700; font-size: 14px;
}
.auth-provider:hover { background: var(--panel); }
.auth-or { text-align: center; opacity: 0.5; margin: 12px 0; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }
#auth-form, #auth-reset-form { display: flex; flex-direction: column; gap: 10px; }
#auth-reset-form.hidden { display: none; }
.auth-link { align-self: flex-start; background: none; border: 0; padding: 2px 0; color: var(--muted); font-size: 13px; cursor: pointer; text-decoration: underline; }
.auth-link:hover { color: var(--text); }
#auth-form input, #auth-reset-form input {
  padding: 10px 12px; border-radius: 10px; font-size: 14px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
}
.auth-actions { display: flex; gap: 10px; margin-top: 4px; }
.auth-primary, .auth-secondary {
  flex: 1; padding: 10px; border-radius: 10px; cursor: pointer; font-weight: 700; font-size: 14px;
  border: 1px solid var(--border);
}
.auth-primary { background: var(--accent, #6c8cff); color: #fff; border-color: transparent; }
.auth-secondary { background: var(--card); color: var(--text); }
.auth-msg { margin-top: 12px; font-size: 13px; min-height: 18px; opacity: 0.9; }
.auth-msg.error { color: #ff6b6b; }

/* Login note + "which save to keep?" choice (ui-auth.js) */
.auth-note { margin: -6px 0 14px; padding: 8px 10px; border-radius: 10px; font-size: 13px; line-height: 1.4;
  background: rgba(124, 58, 237, 0.12); border: 1px solid var(--border); color: var(--text); }
.sync-choice-text { margin: 0 0 16px; line-height: 1.5; }
.sync-choice-actions { display: flex; flex-direction: column; gap: 10px; }
.sync-choice-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 12px; border-radius: 10px; cursor: pointer; font: inherit; font-weight: 600; }
.sync-choice-btn small { font-weight: 400; font-size: 12px; opacity: 0.85; }

/* ── ✨ Mon vocabulaire (ui-custom-vocab.js) ─────────────────────────────── */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.modal.modal-wide { width: min(94vw, 640px); }
.vocab-intro { margin: 0 0 14px; font-size: 13px; color: var(--muted); }
#vocab-lists h3, .vocab-add h3 { font-size: 14px; margin: 0; }
.vocab-lists-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.vocab-empty { font-size: 13px; color: var(--muted); margin: 0 0 16px; }
.vocab-list { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.vocab-list-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); }
.vocab-list-name { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vocab-count { font-size: 12px; color: var(--muted); white-space: nowrap; }
.vocab-play { padding: 5px 12px; border-radius: 16px; border: 1px solid var(--accent); background: transparent; color: var(--text); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.vocab-play:hover { background: var(--accent); color: #fff; }
.vocab-icon { background: none; border: 0; cursor: pointer; font-size: 14px; padding: 4px; border-radius: 6px; color: var(--text); }
.vocab-icon:hover { background: var(--panel); }
.vocab-rename { flex: 1; padding: 4px 8px; border-radius: 8px; border: 1px solid var(--accent); background: var(--bg); color: var(--text); font: inherit; }
.vocab-add { border-top: 1px solid var(--border); padding-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.vocab-name-label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.vocab-name-label input, .vocab-grid input { padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font: inherit; font-size: 14px; }
.vocab-tabs { display: flex; gap: 6px; }
.vocab-tabs [role="tab"] { flex: 1; padding: 8px; border-radius: 10px; border: 1px solid var(--border); background: transparent; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; }
.vocab-tabs [role="tab"][aria-selected="true"] { border-color: var(--accent); color: var(--text); background: rgba(124, 58, 237, 0.15); }
.vocab-help { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.vocab-help a { color: var(--accent2); }
.vocab-grid { width: 100%; border-collapse: separate; border-spacing: 0 6px; }
.vocab-grid th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; }
.vocab-grid td { padding-right: 6px; }
.vocab-grid td:last-child { width: 28px; padding-right: 0; }
.vocab-grid input { width: 100%; box-sizing: border-box; }
.vocab-link { align-self: flex-start; background: none; border: 0; color: var(--accent2); font: inherit; font-size: 13px; cursor: pointer; padding: 2px 0; }
#vocab-preview p { margin: 0; font-size: 13px; }
.vocab-ok { color: var(--green); font-weight: 600; }
.vocab-warn { color: var(--orange); margin-top: 6px !important; }
.vocab-error { color: #ff8080; }
.vocab-sample { margin: 6px 0 0; padding-left: 18px; font-size: 13px; color: var(--text); }
.vocab-more { color: var(--muted); list-style: none; }
#vocab-create { align-self: stretch; flex: none; }
#vocab-create:disabled { opacity: 0.45; cursor: not-allowed; }
