/* Écran apprenant (mobile d'abord) */
#app { max-width: 560px; margin: 0 auto; padding: 16px 16px calc(24px + env(safe-area-inset-bottom)); min-height: 100dvh; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.top .logo-img { height: 44px; width: auto; }
.icon-btn { background: var(--panel); border: 0; width: 42px; height: 42px; border-radius: 12px; font-size: 20px; cursor: pointer; display: grid; place-items: center; }

.screen { flex: 1; display: flex; flex-direction: column; animation: rise .35s ease-out both; }
.screen.centered { justify-content: center; }
h1.display { font-size: 34px; margin: 8px 0 4px; line-height: 1.1; }
h2.display { font-size: 26px; margin: 4px 0 12px; }

.tabs { display: flex; background: var(--panel); border-radius: 16px; padding: 5px; gap: 4px; margin-bottom: 16px; }
.tabs button { flex: 1; border: 0; background: transparent; padding: 11px 6px; border-radius: 12px; font-weight: 700; cursor: pointer; color: var(--muted); font-size: 15px; }
.tabs button.on { background: var(--lime); color: var(--on-lime); }

.saved { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--panel); border: 2px solid var(--line); border-radius: 16px; padding: 12px 14px; cursor: pointer; margin-bottom: 10px; }
.saved:hover { border-color: var(--lime); }
.saved .av { font-size: 30px; }
.saved small { display: block; color: var(--muted); }

.names { display: flex; flex-wrap: wrap; gap: 8px; max-height: 260px; overflow: auto; padding: 2px; }
.chip { border: 2px solid var(--line); background: var(--panel); border-radius: 99px; padding: 9px 14px; cursor: pointer; font-weight: 600; }
.chip.on { border-color: var(--lime); background: rgba(180, 240, 74, .14); }

.avatars { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.avatars button { font-size: 24px; aspect-ratio: 1; padding: 0; border-radius: 12px; border: 2px solid transparent; background: var(--panel-2); cursor: pointer; }
.avatars button.on { border-color: var(--lime); transform: scale(1.08); }

.pin-reveal { font-size: 56px; font-weight: 800; letter-spacing: 12px; background: var(--lime); color: var(--on-lime); border-radius: 18px; padding: 10px 0 10px 12px; margin: 14px 0; }

/* Profil */
.profile { display: flex; align-items: center; gap: 14px; }
.profile .av { font-size: 46px; width: 68px; height: 68px; border-radius: 20px; background: var(--panel-2); display: grid; place-items: center; cursor: pointer; flex: none; }
.profile .name { font-weight: 800; font-size: 21px; }
.xpbar { height: 12px; border-radius: 99px; background: var(--panel-2); overflow: hidden; margin-top: 6px; }
.xpbar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--lime), #e8ff8a); border-radius: 99px; transition: width .8s; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0; }
.stat { background: var(--panel); border-radius: 16px; padding: 12px; text-align: center; }
.stat b { display: block; font-size: 24px; }
.stat span { color: var(--muted); font-size: 13px; }

.chapter { background: var(--panel); border-radius: 18px; padding: 16px; margin-bottom: 12px; border: 1px solid rgba(255, 255, 255, .04); }
.chapter .t { font-weight: 800; font-size: 18px; }
.stars { font-size: 20px; letter-spacing: 2px; }
.stars .off { opacity: .2; filter: grayscale(1); }
.chapter .actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.chapter .actions .btn { flex: 1; }
.progress { height: 8px; border-radius: 99px; background: var(--panel-2); overflow: hidden; margin-top: 8px; }
.progress > i { display: block; height: 100%; background: var(--lime); }

.timer-choice { display: flex; gap: 8px; margin-bottom: 14px; }
.timer-choice button { flex: 1; border: 2px solid var(--line); background: var(--panel); border-radius: 14px; padding: 10px; font-weight: 700; cursor: pointer; }
.timer-choice button.on { border-color: var(--lime); background: rgba(180, 240, 74, .12); }

.lb-row { display: flex; align-items: center; gap: 12px; background: var(--panel); border-radius: 14px; padding: 10px 14px; margin-bottom: 8px; }
.lb-row.me { outline: 3px solid var(--lime); }
.lb-row .rk { width: 34px; font-weight: 800; font-size: 18px; text-align: center; }
.lb-row .av { font-size: 26px; }
.lb-row .xp { margin-left: auto; font-weight: 800; }
.podium-1 .rk { color: #ffd84d; } .podium-2 .rk { color: #d8dde6; } .podium-3 .rk { color: #e3a46a; }

.badges { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.badge { background: var(--panel); border-radius: 16px; padding: 14px; text-align: center; }
.badge .i { font-size: 38px; }
.badge.off { opacity: .35; filter: grayscale(1); }
.badge b { display: block; margin-top: 4px; }
.badge small { color: var(--muted); }

/* Partie */
.qhead { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.qhead .meta { flex: 1; }
.qhead .meta b { font-size: 15px; color: var(--muted); }
.score-pill { font-weight: 800; font-size: 18px; }
.streak { color: var(--orange); font-weight: 800; }
.question { background: #fff; color: #18181b; border-radius: 20px; padding: 22px 18px; font-size: 21px; font-weight: 800; text-align: center; margin-bottom: 14px; box-shadow: 0 6px 0 rgba(0, 0, 0, .35); line-height: 1.3; }
.question small { display: block; font-weight: 600; font-size: 14px; color: #666; margin-top: 6px; }
.answers { display: grid; gap: 10px; }
.answers.two { grid-template-columns: 1fr 1fr; }
.answer { display: flex; align-items: center; gap: 12px; text-align: left; padding: 14px; min-height: 66px; font-size: 17px; border-radius: 16px; }
.answer.sel { outline: 4px solid #fff; outline-offset: 2px; }
.answer.removed { opacity: .12; pointer-events: none; }
.answer.good { outline: 4px solid var(--green); outline-offset: 2px; }
.answer.bad { opacity: .35; }
.answer.vf { justify-content: center; font-size: 22px; min-height: 120px; flex-direction: column; }
.jokers { display: flex; gap: 8px; margin-top: 14px; }
.joker { flex: 1; border: 2px dashed var(--line); background: var(--panel); border-radius: 14px; padding: 8px 6px; cursor: pointer; font-weight: 700; font-size: 14px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.joker .i { font-size: 22px; }
.joker:disabled { opacity: .3; cursor: not-allowed; }
.joker .n { background: var(--lime); color: var(--on-lime); border-radius: 99px; padding: 0 8px; font-size: 12px; }

.feedback { position: fixed; inset: 0; z-index: 50; overflow-y: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; text-align: center; animation: pop .25s ease-out; }
.feedback.ok { background: radial-gradient(circle at 50% 35%, #4ce68f, #17a35a); }
.feedback.ko { background: radial-gradient(circle at 50% 35%, #ff7a6e, #c4352b); }
.feedback.neutral { background: radial-gradient(circle at 50% 35%, #4a4a58, #23232b); }
.feedback .emo { font-size: 90px; line-height: 1; animation: wiggle .6s; }
.feedback h2 { font-family: var(--display); font-size: 40px; margin: 10px 0; font-weight: 400; }
.feedback .expl { background: rgba(0, 0, 0, .25); border-radius: 16px; padding: 14px 16px; max-width: 460px; margin: 10px 0 18px; font-size: 16px; text-align: left; }
.feedback .pts { font-size: 26px; font-weight: 800; background: rgba(0, 0, 0, .2); padding: 6px 18px; border-radius: 99px; }

.result-hero { text-align: center; padding: 10px 0 6px; }
.result-hero .pct { font-size: 84px; font-weight: 800; line-height: 1; color: var(--lime); }
.levelup { background: linear-gradient(135deg, var(--violet), var(--pink)); border-radius: 18px; padding: 16px; text-align: center; font-weight: 800; font-size: 20px; margin: 12px 0; animation: pulse .8s infinite alternate; }
.corr { background: var(--panel); border-radius: 14px; padding: 12px 14px; margin-bottom: 8px; border-left: 6px solid var(--red); }
.corr.ok { border-left-color: var(--green); }
.corr ul { margin: 6px 0 0; padding-left: 18px; color: var(--muted); }
.corr li.c { color: var(--green); font-weight: 700; }
.corr li.w { color: var(--red); text-decoration: line-through; }

/* Direct */
.wait { text-align: center; }
.wait .av { font-size: 96px; animation: float 2.4s ease-in-out infinite; }
.big-num { font-size: 64px; font-weight: 800; }
.dots::after { content: '…'; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .2; } }

@media (min-width: 520px) { .answers.grid4 { grid-template-columns: 1fr 1fr; } }

/* Accès payant */
.access-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; justify-content: space-between; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; margin-bottom: 14px; font-size: 15px; }
.access-banner.ok { border-color: var(--lime); }
.access-banner.off { border-color: var(--orange); }

.legal-links { text-align: center; font-size: 12px; opacity: .75; margin: 22px 0 6px; }
.legal-links a { color: inherit; }
