/* academy.css — CheblAI Academy
   Réutilise uniquement les tokens de style.css (--bg, --card, --line, --text, --blue, --yellow, --sh…).
   Aucune nouvelle couleur, aucun dégradé, aucun flou. Mobile-first (390px), puis desktop. */

.aca-hidden { display: none !important; }

/* ── Topbar (sticky, parcours + lecteur) ───────────────────────────── */
.aca-topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: .75rem;
  padding: .7rem 1rem;
  background: var(--bg-2);
  border-bottom: 1.5px solid var(--line);
}
.aca-topbar-stat {
  display: flex; align-items: center; gap: .3rem;
  font-weight: 700; font-size: .82rem; color: var(--text);
  white-space: nowrap;
}
.aca-topbar-stat .ic { width: 16px; height: 16px; flex: none; }
.aca-topbar-stat.aca-xp .ic { color: var(--yellow); }
.aca-topbar-stat.aca-streak .ic { color: var(--blue); }
.aca-topbar-stat.aca-streak.is-today .ic { color: #FB923C; }
.aca-topbar-goal {
  flex: 1; min-width: 60px; max-width: 160px;
  height: 6px; border-radius: 4px; background: var(--line); overflow: hidden;
}
.aca-topbar-goal-fill { height: 100%; background: var(--blue); border-radius: 4px; transition: width .4s; }
.aca-topbar-continue {
  margin-left: auto; flex: none;
}
.aca-topbar-close { flex: none; display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 10px; background: transparent; border: none; color: var(--text-2); cursor: pointer; }
.aca-topbar-close:hover { color: var(--text); background: var(--bg); }
.aca-topbar-close .ic { width: 20px; height: 20px; }
.aca-topbar-profile-link { flex: none; margin-left: auto; display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; color: var(--text-2); }
.aca-topbar-profile-link:hover { color: var(--text); background: var(--bg); }
.aca-topbar-profile-link .ic { width: 18px; height: 18px; }

/* ── Hub : page parcours ────────────────────────────────────────────── */
.aca-hub { max-width: 720px; margin: 0 auto; padding: 1.5rem 1rem 4rem; }
.aca-hub-head { text-align: center; margin-bottom: 1.5rem; }
.aca-hub-head h1 { font-family: var(--font-display, 'Bricolage Grotesque', sans-serif); font-size: 1.7rem; margin: 0 0 .3rem; color: var(--text); }
.aca-hub-head p { color: var(--text-2); font-size: .95rem; margin: 0; }

.aca-daily-card, .aca-placement-card {
  background: var(--card); border: 2px solid var(--text); box-shadow: var(--sh);
  border-radius: 16px; padding: 1.1rem 1.25rem; margin-bottom: 1.25rem;
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.aca-daily-card .ic { width: 30px; height: 30px; color: var(--yellow); flex: none; }
.aca-daily-card-body { flex: 1; min-width: 160px; }
.aca-daily-card-body strong { display: block; font-size: 1rem; color: var(--text); margin-bottom: .15rem; }
.aca-daily-card-body span { font-size: .82rem; color: var(--text-2); }
.aca-daily-card.is-done { opacity: .7; }

.aca-path { position: relative; display: flex; flex-direction: column; align-items: center; gap: 0; padding-top: .5rem; }
.aca-path-rail { position: absolute; top: 28px; bottom: 28px; left: 50%; width: 3px; background: var(--line); transform: translateX(-50%); z-index: 0; }
.aca-module { position: relative; z-index: 1; width: 100%; max-width: 420px; margin-bottom: 1.5rem; }
.aca-module-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .6rem; justify-content: center; text-align: center; }
.aca-module-icon { width: 34px; height: 34px; border-radius: 10px; background: var(--card); border: 2px solid var(--text); display: flex; align-items: center; justify-content: center; flex: none; }
.aca-module-icon .ic { width: 18px; height: 18px; color: var(--blue); }
.aca-module-title { font-weight: 800; font-size: 1.02rem; color: var(--text); }
.aca-module-meta { font-size: .76rem; color: var(--text-2); }

.aca-nodes { display: flex; flex-direction: column; align-items: center; gap: .9rem; }
.aca-node {
  position: relative;
  width: 66px; height: 66px; border-radius: 50%;
  background: var(--card); border: 2px solid var(--text);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex: none;
  box-shadow: 3px 3px 0 var(--blue);
  transition: transform .12s;
}
.aca-node:hover:not(.is-locked) { transform: translate(-2px,-2px); box-shadow: 5px 5px 0 var(--blue); }
.aca-node .ic { width: 24px; height: 24px; color: var(--text); }
.aca-node.is-locked { opacity: .45; cursor: not-allowed; box-shadow: none; border-color: var(--line); }
.aca-node.is-locked .ic { color: var(--text-2); }
.aca-node.is-done { border-color: var(--yellow); background: var(--bg-2); }
.aca-node.is-done .ic { color: var(--yellow); }
.aca-node.is-current::after {
  content: ''; position: absolute; inset: -6px; border-radius: 50%;
  border: 2px dashed var(--yellow); animation: aca-pulse 2s infinite;
}
@keyframes aca-pulse { 0%,100% { opacity: .5; } 50% { opacity: 1; } }
.aca-node-stars { position: absolute; bottom: -8px; display: flex; gap: 1px; }
.aca-node-stars .ic { width: 12px; height: 12px; color: var(--line); }
.aca-node-stars .ic.is-lit { color: var(--yellow); }
.aca-node-label { margin-top: .35rem; font-size: .72rem; color: var(--text-2); text-align: center; max-width: 110px; }
.aca-mascot-row { display: flex; flex-direction: column; align-items: center; margin: .3rem 0 .6rem; }
.aca-mascot-row img { width: 56px; height: 56px; object-fit: contain; }
.aca-mascot-row p { font-size: .78rem; color: var(--text-2); margin: .3rem 0 0; text-align: center; max-width: 220px; }

.aca-readguide { display: block; text-align: center; margin-top: .4rem; font-size: .82rem; color: var(--blue); text-decoration: none; font-weight: 600; }
.aca-readguide:hover { text-decoration: underline; }

@media (min-width: 760px) {
  .aca-hub { padding-top: 2.5rem; }
  .aca-hub-head h1 { font-size: 2.1rem; }
}

/* ── Lecteur de leçon (plein écran) ────────────────────────────────── */
.aca-player { position: fixed; inset: 0; z-index: 500; background: var(--bg); display: flex; flex-direction: column; }
.aca-player-progress { height: 5px; background: var(--line); flex: none; }
.aca-player-progress-fill { height: 100%; background: var(--yellow); transition: width .3s; }
.aca-player-body { flex: 1; overflow-y: auto; display: flex; flex-direction: column; align-items: center; padding: 1.25rem 1rem 6rem; }
.aca-card { width: 100%; max-width: 560px; background: var(--card); border: 2px solid var(--text); box-shadow: var(--sh); border-radius: 18px; padding: 1.5rem 1.4rem; margin: auto; }
.aca-card-title { font-family: var(--font-display, 'Bricolage Grotesque', sans-serif); font-size: 1.15rem; color: var(--text); margin: 0 0 .7rem; }
.aca-card-body { font-size: .95rem; line-height: 1.55; color: var(--text-2); }
.aca-card-body strong, .aca-card-body b { color: var(--text); }
.aca-card-body + .aca-card-cta { margin-top: 1.1rem; }

.aca-steps-list { display: flex; flex-direction: column; gap: .7rem; margin-top: .5rem; }
.aca-step { background: var(--bg-2); border: 1.5px solid var(--line); border-radius: 12px; padding: .7rem .9rem; }
.aca-step-title { font-weight: 700; font-size: .88rem; color: var(--text); margin-bottom: .2rem; }
.aca-step-text { font-size: .85rem; color: var(--text-2); }

.aca-table-wrap { overflow-x: auto; margin-top: .6rem; }
.aca-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.aca-table th, .aca-table td { border: 1px solid var(--line); padding: .5rem .6rem; text-align: left; color: var(--text-2); }
.aca-table th { background: var(--bg-2); color: var(--text); font-weight: 700; }
.aca-table td:first-child { color: var(--text); font-weight: 600; }

.aca-callout { margin-top: .9rem; border-radius: 12px; padding: .8rem 1rem; border: 1.5px solid var(--yellow); background: var(--bg-2); }
.aca-callout-title { font-weight: 800; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--yellow); margin-bottom: .3rem; }
.aca-callout-text { font-size: .85rem; color: var(--text-2); }

/* Exercices */
.aca-ex-q { font-family: var(--font-display, 'Bricolage Grotesque', sans-serif); font-size: 1.05rem; color: var(--text); margin: 0 0 1rem; line-height: 1.4; }
.aca-options { display: flex; flex-direction: column; gap: .6rem; }
.aca-option {
  display: flex; align-items: center; gap: .6rem;
  background: var(--bg-2); border: 2px solid var(--line); border-radius: 12px;
  padding: .8rem .9rem; font-size: .92rem; color: var(--text); text-align: left;
  cursor: pointer; min-height: 48px; width: 100%;
  font-family: inherit;
}
.aca-option:hover:not(:disabled) { border-color: var(--blue); }
.aca-option.is-selected { border-color: var(--blue); background: var(--bg); box-shadow: 3px 3px 0 var(--blue); }
.aca-option.is-correct { border-color: var(--green); background: #10321F; color: #4BE08A; }
.aca-option.is-wrong { border-color: var(--red); background: #3A1A22; color: #FF8A94; }
.aca-option:disabled { cursor: default; }
.aca-option-letter { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--bg); border: 1.5px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 700; color: var(--text-2); }

.aca-tf-row { display: flex; gap: .7rem; margin-top: .3rem; }
.aca-tf-btn { flex: 1; min-height: 56px; border-radius: 12px; border: 2px solid var(--line); background: var(--bg-2); color: var(--text); font-weight: 700; font-size: .95rem; cursor: pointer; }
.aca-tf-btn:hover:not(:disabled) { border-color: var(--blue); }
.aca-tf-btn.is-correct { border-color: var(--green); background: #10321F; color: #4BE08A; }
.aca-tf-btn.is-wrong { border-color: var(--red); background: #3A1A22; color: #FF8A94; }

.aca-order-list { display: flex; flex-direction: column; gap: .5rem; list-style: none; margin: 0; padding: 0; }
.aca-order-item {
  display: flex; align-items: center; gap: .6rem;
  background: var(--bg-2); border: 2px solid var(--line); border-radius: 12px;
  padding: .65rem .8rem; font-size: .85rem; color: var(--text);
}
.aca-order-item.is-correct-pos { border-color: var(--green); }
.aca-order-item.is-wrong-pos { border-color: var(--red); }
.aca-order-handle { flex: none; color: var(--text-2); cursor: grab; display: flex; align-items: center; }
.aca-order-handle .ic { width: 16px; height: 16px; }
.aca-order-num { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--bg); border: 1.5px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: .72rem; font-weight: 700; color: var(--text-2); }
.aca-order-moves { flex: none; display: flex; flex-direction: column; gap: 2px; margin-left: auto; }
.aca-order-moves button { width: 26px; height: 22px; border-radius: 6px; border: 1.5px solid var(--line); background: var(--bg); color: var(--text-2); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.aca-order-moves button:disabled { opacity: .3; cursor: default; }
.aca-order-moves .ic { width: 12px; height: 12px; }
.aca-order-moves .aca-rot-up { transform: rotate(180deg); }

.aca-sort-wrap { display: flex; flex-direction: column; gap: 1rem; }
.aca-sort-cats { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.aca-sort-cat { min-height: 90px; border: 2px dashed var(--line); border-radius: 12px; padding: .5rem; display: flex; flex-direction: column; gap: .4rem; }
.aca-sort-cat-title { font-size: .78rem; font-weight: 800; color: var(--text-2); text-align: center; text-transform: uppercase; letter-spacing: .02em; }
.aca-sort-cat.is-dragover { border-color: var(--blue); }
.aca-sort-pool { display: flex; flex-wrap: wrap; gap: .5rem; min-height: 40px; }
.aca-sort-chip {
  background: var(--card); border: 2px solid var(--text); border-radius: 10px;
  padding: .5rem .7rem; font-size: .8rem; color: var(--text); cursor: grab;
  box-shadow: 2px 2px 0 var(--blue);
}
.aca-sort-chip.is-placed-correct { border-color: var(--green); box-shadow: none; }
.aca-sort-chip.is-placed-wrong { border-color: var(--red); box-shadow: none; }
.aca-sort-chip-actions { display: flex; gap: 2px; margin-top: .3rem; }
.aca-sort-chip-actions button { font-size: .68rem; padding: .15rem .4rem; border-radius: 6px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text-2); cursor: pointer; }

.aca-fill-wrap { font-size: .95rem; color: var(--text); line-height: 1.6; margin-bottom: .9rem; }
.aca-fill-blank { display: inline-block; min-width: 90px; border-bottom: 2px solid var(--blue); font-weight: 700; color: var(--blue); text-align: center; padding: 0 .2rem; }

/* Bandeau de feedback */
.aca-feedback {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: var(--bg-2); border-top: 2px solid var(--line);
  padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom, 0));
  transform: translateY(100%); transition: transform .25s ease-out;
}
.aca-feedback.is-shown { transform: translateY(0); }
.aca-feedback.is-correct { border-top-color: var(--green); background: #0E1F16; }
.aca-feedback.is-wrong { border-top-color: var(--red); background: #241217; }
.aca-feedback-head { display: flex; align-items: center; gap: .5rem; font-weight: 800; font-size: 1rem; margin-bottom: .3rem; }
.aca-feedback.is-correct .aca-feedback-head { color: #4BE08A; }
.aca-feedback.is-wrong .aca-feedback-head { color: #FF8A94; }
.aca-feedback-head .ic { width: 20px; height: 20px; }
.aca-feedback-text { font-size: .85rem; color: var(--text-2); margin-bottom: .2rem; }
.aca-feedback-source { font-size: .74rem; color: var(--text-2); }
.aca-feedback-source a { color: var(--blue); text-decoration: none; }
.aca-feedback-actions { margin-top: .7rem; display: flex; justify-content: flex-end; }

.aca-player-bottom { position: fixed; left: 0; right: 0; bottom: 0; z-index: 55; padding: 1rem; background: var(--bg); border-top: 1.5px solid var(--line); display: flex; justify-content: center; }
.aca-player-bottom .btn { width: 100%; max-width: 400px; }

@media (min-width: 760px) {
  .aca-card { padding: 2rem 2.2rem; }
  .aca-sort-cats { grid-template-columns: 1fr 1fr; }
}

/* ── Récap de fin de leçon ──────────────────────────────────────────── */
.aca-recap { max-width: 480px; margin: auto; text-align: center; padding: 1rem; }
.aca-recap-icon { width: 72px; height: 72px; margin: 0 auto 1rem; border-radius: 50%; background: var(--card); border: 2px solid var(--yellow); box-shadow: var(--sh); display: flex; align-items: center; justify-content: center; }
.aca-recap-icon .ic { width: 38px; height: 38px; color: var(--yellow); }
.aca-recap h2 { font-family: var(--font-display, 'Bricolage Grotesque', sans-serif); font-size: 1.5rem; color: var(--text); margin: 0 0 .6rem; }
.aca-recap-stars { display: flex; justify-content: center; gap: .3rem; margin-bottom: 1rem; }
.aca-recap-stars .ic { width: 34px; height: 34px; color: var(--line); }
.aca-recap-stars .ic.is-lit { color: var(--yellow); }
.aca-recap-stats { display: flex; justify-content: center; gap: 1.2rem; margin-bottom: 1rem; flex-wrap: wrap; }
.aca-recap-stat { font-size: .85rem; color: var(--text-2); }
.aca-recap-stat strong { display: block; font-size: 1.3rem; color: var(--text); }
.aca-recap-bonuses { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1rem; font-size: .82rem; color: var(--text-2); }
.aca-recap-actions { display: flex; flex-direction: column; gap: .6rem; margin-top: 1.2rem; }

/* ── Boss challenge ─────────────────────────────────────────────────── */
.aca-boss-head { text-align: center; margin-bottom: 1rem; }
.aca-boss-head .ic { width: 40px; height: 40px; color: var(--yellow); margin-bottom: .4rem; }
.aca-boss-timer { font-family: var(--font-display, 'Bricolage Grotesque', sans-serif); font-size: 2.2rem; color: var(--text); text-align: center; margin-bottom: .6rem; }
.aca-boss-timer.is-low { color: var(--red); }
.aca-boss-score { text-align: center; font-size: .85rem; color: var(--text-2); margin-bottom: .8rem; }

/* ── Profil / badges ────────────────────────────────────────────────── */
.aca-profile { max-width: 640px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
.aca-profile-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.aca-profile-avatar { width: 64px; height: 64px; border-radius: 50%; background: var(--card); border: 2px solid var(--text); box-shadow: var(--sh); display: flex; align-items: center; justify-content: center; flex: none; }
.aca-profile-avatar .ic { width: 32px; height: 32px; color: var(--yellow); }
.aca-profile-head h1 { font-size: 1.3rem; color: var(--text); margin: 0 0 .2rem; }
.aca-profile-head p { font-size: .85rem; color: var(--text-2); margin: 0; }

.aca-badges-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: .8rem; margin-bottom: 1.5rem; }
.aca-badge { display: flex; flex-direction: column; align-items: center; gap: .3rem; text-align: center; }
.aca-badge-icon { width: 54px; height: 54px; border-radius: 14px; background: var(--card); border: 2px solid var(--text); box-shadow: 3px 3px 0 var(--blue); display: flex; align-items: center; justify-content: center; }
.aca-badge-icon .ic { width: 26px; height: 26px; color: var(--yellow); }
.aca-badge.is-locked .aca-badge-icon { opacity: .35; box-shadow: none; border-color: var(--line); }
.aca-badge.is-locked .aca-badge-icon .ic { color: var(--text-2); }
.aca-badge-name { font-size: .7rem; color: var(--text-2); }

.aca-section-title { font-size: .95rem; font-weight: 800; color: var(--text); margin: 1.4rem 0 .7rem; }
.aca-stat-row { display: flex; justify-content: space-between; align-items: center; padding: .55rem 0; border-bottom: 1px solid var(--line); font-size: .85rem; color: var(--text-2); }
.aca-stat-row strong { color: var(--text); }

.aca-savecode { display: flex; gap: .5rem; margin-top: .5rem; }
.aca-savecode textarea { flex: 1; min-height: 60px; background: var(--bg-2); border: 1.5px solid var(--line); border-radius: 10px; padding: .5rem .7rem; color: var(--text); font-size: .78rem; font-family: monospace; resize: vertical; }

.aca-settings-row { display: flex; justify-content: space-between; align-items: center; padding: .5rem 0; }
.aca-switch { position: relative; width: 42px; height: 24px; border-radius: 12px; background: var(--line); border: none; cursor: pointer; flex: none; }
.aca-switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--text-2); transition: transform .15s; }
.aca-switch.is-on { background: var(--blue); }
.aca-switch.is-on::after { transform: translateX(18px); background: #fff; }

/* ── Bandeau de repli ZH ────────────────────────────────────────────── */
.aca-fallback-banner {
  background: var(--bg-2); border: 1.5px dashed var(--line); border-radius: 12px;
  padding: .6rem .9rem; font-size: .78rem; color: var(--text-2); margin-bottom: 1rem; text-align: center;
}
.aca-fallback-banner a { color: var(--blue); text-decoration: none; font-weight: 600; }

/* ── Blocs statiques SSR (SEO / repli sans JS) ─────────────────────── */
.aca-hub-static { max-width: 720px; margin: 0 auto 2rem; }
.aca-static-fallback { max-width: 720px; margin: 1.5rem auto; border: 1.5px solid var(--line); border-radius: 12px; padding: .3rem 1rem; }
.aca-static-fallback summary { cursor: pointer; padding: .6rem 0; font-weight: 700; color: var(--text); }
.aca-static-lesson { padding: 1rem 0; border-top: 1px solid var(--line); }
.aca-static-lesson h2 { font-size: 1.05rem; color: var(--text); }
.aca-card-block { margin-bottom: .8rem; }
.aca-card-block h3 { font-size: .92rem; color: var(--text); margin: 0 0 .3rem; }
.aca-card-block p { font-size: .85rem; color: var(--text-2); line-height: 1.5; }
.aca-static-exercises { padding-left: 1.2rem; font-size: .82rem; color: var(--text-2); }

@media (prefers-reduced-motion: reduce) {
  .aca-node.is-current::after { animation: none; }
  .aca-feedback { transition: none; }
}
