:root {
  --bg1: #6d5efc; --bg2: #4bc6ff; --card: #ffffff; --ink: #22223b; --muted: #6b6b83;
  --max: #ff7a59; --me: #3ec46d; --stop: #e64b4b; --gold: #ffd23f; --lock: #b9b9c9;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font-family: "Segoe UI", system-ui, -apple-system, sans-serif; color: var(--ink); background: linear-gradient(160deg, var(--bg1), var(--bg2)); }
.app { min-height: 100%; max-width: 720px; margin: 0 auto; padding: 24px 18px 40px; display: flex; flex-direction: column; }
.head { text-align: center; color: #fff; }
.head h1 { font-size: 1.9rem; margin: 6px 0 4px; }
.head .name { color: #ffe14d; }
.head .sub { margin: 0; opacity: 0.95; font-size: 1.02rem; }

/* progression */
.progress-card { background: var(--card); border-radius: 16px; padding: 14px 16px; margin: 18px 0 12px; box-shadow: 0 10px 26px rgba(0,0,0,.18); }
.progress-top { display: flex; justify-content: space-between; font-weight: 700; margin-bottom: 8px; }
.bar { height: 14px; background: #eee; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--me), #2fa85a); border-radius: 999px; transition: width .5s ease; }
.stats { margin: 8px 0 0; color: var(--muted); font-size: .9rem; }

/* liste de lecons */
.lessons { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.lesson { background: var(--card); border-radius: 14px; padding: 12px 14px; display: flex; align-items: center; gap: 12px; box-shadow: 0 6px 18px rgba(0,0,0,.14); }
.lesson.locked { opacity: .6; }
.lesson .emoji { font-size: 1.7rem; flex: 0 0 auto; }
.lesson .meta { flex: 1; min-width: 0; }
.lesson .t { font-weight: 800; display: flex; align-items: center; gap: 8px; }
.lesson .g { color: var(--muted); font-size: .85rem; }
.badge { font-size: .7rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; color: #fff; }
.badge.done { background: var(--me); } .badge.doing { background: var(--max); } .badge.grammar { background: #8b5cf6; }
.lesson .acts { display: flex; gap: 6px; flex: 0 0 auto; }
.mini { border: none; border-radius: 10px; padding: 8px 12px; font-weight: 700; color: #fff; cursor: pointer; font-size: .85rem; }
.mini.learn { background: var(--max); } .mini.test { background: #2f80ed; } .mini:disabled { background: var(--lock); cursor: not-allowed; }
.tick { color: var(--me); font-weight: 900; }
.score { color: var(--muted); font-size: .78rem; }

/* seance */
.back { align-self: flex-start; background: rgba(255,255,255,.25); color: #fff; border: none; padding: 8px 14px; border-radius: 999px; font-weight: 700; cursor: pointer; margin-bottom: 4px; }
.orb-wrap { text-align: center; margin: 18px 0 4px; }
.orb { width: 150px; height: 150px; border-radius: 50%; margin: 0 auto; display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, #fff, #ffd5c7 60%, var(--max)); box-shadow: 0 14px 40px rgba(0,0,0,.25); }
.orb-face { font-size: 2.2rem; font-weight: 800; color: var(--max); }
.orb.idle { animation: float 3s ease-in-out infinite; }
.orb.listening { background: radial-gradient(circle at 35% 30%, #fff, #cdeecd 60%, var(--me)); animation: pulse 1s ease-in-out infinite; }
.orb.listening .orb-face { color: var(--me); }
.orb.speaking { animation: pulse .55s ease-in-out infinite; }
.orb.connecting { animation: spin 1.1s linear infinite; }
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-9px)} }
@keyframes pulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.09)} }
@keyframes spin { to { transform: rotate(360deg); } }
.status { color: #fff; font-size: 1.05rem; margin: 14px 0 0; min-height: 1.4em; font-weight: 600; }

.ptt-row { text-align: center; margin: 10px 0 2px; }
.switch { color: #fff; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: .95rem; }
.switch input { width: 20px; height: 20px; }

.controls { display: flex; gap: 12px; justify-content: center; margin: 14px 0 8px; flex-wrap: wrap; }
.btn { border: none; border-radius: 999px; padding: 15px 30px; font-size: 1.1rem; font-weight: 700; color: #fff; cursor: pointer; box-shadow: 0 8px 22px rgba(0,0,0,.22); }
.btn:active { transform: scale(.96); }
.btn-hold { background: #2f80ed; touch-action: none; user-select: none; }
.btn-hold.active { background: var(--me); transform: scale(1.04); }
.btn-stop { background: var(--stop); }

.transcript { width: 100%; margin-top: 16px; background: var(--card); border-radius: 18px; box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: 14px; flex: 1; min-height: 140px; }
.log { display: flex; flex-direction: column; gap: 10px; }
.line { display: flex; gap: 10px; align-items: flex-start; }
.who { flex: 0 0 auto; font-weight: 800; font-size: .82rem; padding: 3px 9px; border-radius: 8px; color: #fff; }
.line.max .who { background: var(--max); } .line.me .who { background: var(--me); }
.line .txt { line-height: 1.45; padding-top: 1px; }
.line.me .txt { color: var(--muted); }
.toast { text-align: center; color: var(--gold); font-weight: 800; padding: 6px; }
.empty { color: var(--muted); text-align: center; padding: 18px; }
