:root {
  --mauve: #9B6BFF;
  --mauve-deep: #6D3FE0;
  --mauve-soft: #F1EAFF;
  --lilac: #CDB8FF;
  --ink: #2A1B4D;
  --muted: #7B6E99;
  --rose: #FF6FB1;
  --vert: #3DD68C;
  --jaune: #FFC93C;
  --ciel: #5AB8FF;
  --orange: #FF9A3C;
  --bg: #FFFFFF;
  --card: #FFFFFF;
  --shadow: 0 10px 30px rgba(109, 63, 224, .14), 0 2px 6px rgba(109, 63, 224, .08);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --r: 28px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); font-family: Nunito, system-ui, sans-serif; overflow-x: hidden; }
h1, h2, h3, .logo, .btn, b { font-family: Fredoka, Nunito, sans-serif; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }

@keyframes drift { to { transform: translate(6vmax, 4vmax) scale(1.12); } }

.screen { position: relative; z-index: 1; display: none; min-height: 100dvh; }
.screen.on { display: block; animation: enter .5s var(--spring); }
@keyframes enter { from { opacity: 0; transform: translateY(18px) scale(.98); } }

/* Boutons : grossissent, rebondissent */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 58px; padding: 0 28px; border-radius: 999px; background: #fff; box-shadow: var(--shadow); font-weight: 600; font-size: 19px; transition: transform .25s var(--spring), box-shadow .25s; }
.btn:hover:not(:disabled) { transform: scale(1.04); }
.btn:active:not(:disabled) { transform: scale(.93); }
.btn:disabled { opacity: .4; cursor: default; }
.btn.primary { background: linear-gradient(135deg, var(--mauve), var(--mauve-deep)); color: #fff; box-shadow: 0 12px 28px rgba(109, 63, 224, .35); }
.btn.ghost { background: transparent; box-shadow: none; color: var(--muted); }
.btn.huge { font-size: 26px; min-height: 76px; padding: 0 44px; }

/* Mascotte */
.mascot { display: inline-block; position: relative; }
.mascot svg { width: 100%; height: 100%; overflow: visible; display: block; }
.mascot.big { width: 170px; height: 170px; }
.mascot.mid { width: 110px; height: 110px; }
.mascot.small { width: 54px; height: 54px; }
.mascot.tiny { width: 34px; height: 34px; }
.float svg { animation: float 3.2s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-9px) rotate(-3deg); } }
.mascot .m-open { transform-origin: 100px 118px; transform: scaleY(0); }
.mascot.talk .m-open { animation: talk .22s ease-in-out infinite alternate; }
.mascot.talk .m-smile { opacity: 0; }
@keyframes talk { from { transform: scaleY(.25); } to { transform: scaleY(1); } }
.mascot .eye { transform-box: fill-box; transform-origin: center; animation: blink 4.5s infinite; }
@keyframes blink { 0%, 94%, 100% { transform: scaleY(1); } 97% { transform: scaleY(.1); } }
.mascot.happy svg { animation: hop .7s var(--spring) 2; }
@keyframes hop { 40% { transform: translateY(-26px) rotate(14deg) scale(1.08); } 70% { transform: translateY(0) rotate(-6deg); } }
.mascot.oops svg { animation: oops .9s ease-in-out; }
@keyframes oops { 30% { transform: rotate(-14deg); } 60% { transform: rotate(9deg); } }
.mascot.sleep .eye { animation: none; transform: scaleY(.12); }
.mascot.sleep svg { animation: breathe 3s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.04); } }
.mascot.sleep::after { content: 'z z z'; position: absolute; top: -10px; right: -24px; font: 700 22px Fredoka; color: var(--mauve); animation: zz 2.4s ease-in-out infinite; }
@keyframes zz { from { opacity: 0; transform: translate(-6px, 10px); } 50% { opacity: 1; } to { opacity: 0; transform: translate(8px, -14px); } }

/* 1. Bienvenue */
.welcome { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 32px 16px; text-align: center; }
.logo { font-size: clamp(54px, 10vw, 84px); margin: 0; letter-spacing: -1px; color: var(--mauve-deep); }
.lead { font-size: 21px; max-width: 460px; margin: 0 0 18px; color: var(--muted); font-weight: 700; }
.welcome .btn { width: min(380px, 100%); }
.yt-ico { width: 30px; height: 21px; border-radius: 7px; background: #FF0033; position: relative; }
.yt-ico::after { content: ''; position: absolute; left: 12px; top: 5.5px; border-left: 9px solid #fff; border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
.yt-ico.kids { background: linear-gradient(135deg, #FF0033, #FF7A00); border-radius: 50% 50% 9px 9px; }
.fine { font-size: 13px; color: var(--muted); }

/* 2. Onboarding */
.onboard { min-height: 100dvh; max-width: 560px; margin: 0 auto; padding: 40px 16px; display: flex; flex-direction: column; justify-content: center; }
.steps { display: flex; gap: 8px; justify-content: center; margin-bottom: 28px; }
.steps i { width: 34px; height: 8px; border-radius: 9px; background: var(--mauve-soft); transition: .4s var(--spring); }
.steps i.on { background: var(--mauve); width: 54px; }
.step { display: none; flex-direction: column; align-items: center; gap: 18px; text-align: center; }
.step.on { display: flex; animation: enter .5s var(--spring); }
.step h2 { font-size: clamp(28px, 6vw, 38px); margin: 0; }
.hint { color: var(--muted); margin: -6px 0 0; font-weight: 700; }
.field { width: 100%; font: 700 26px Fredoka; text-align: center; padding: 18px; border-radius: 22px; border: 3px solid var(--mauve-soft); outline: none; color: var(--ink); transition: .25s; }
.field:focus { border-color: var(--mauve); box-shadow: 0 0 0 6px rgba(155, 107, 255, .15); }
.ages { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.age { width: 78px; height: 78px; border-radius: 50%; font: 700 32px Fredoka; color: #fff; box-shadow: var(--shadow); transition: transform .3s var(--spring); }
.age:hover { transform: scale(1.08); }
.age.on { transform: scale(1.22); outline: 5px solid #fff; box-shadow: 0 0 0 9px var(--mauve), var(--shadow); }
.minutes { font-family: Fredoka; color: var(--mauve-deep); }
.minutes b { font-size: 92px; line-height: 1; }
.minutes span { font-size: 28px; font-weight: 600; margin-left: 6px; }
.slider { -webkit-appearance: none; appearance: none; width: 100%; height: 18px; border-radius: 99px; background: linear-gradient(90deg, var(--vert), var(--ciel), var(--mauve), var(--rose)); outline: none; }
.slider::-webkit-slider-thumb { -webkit-appearance: none; width: 46px; height: 46px; border-radius: 50%; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%239B6BFF' d='M12 2l2.9 6.6 7.1.6-5.4 4.7 1.6 7L12 17.3 5.8 21l1.6-7L2 9.2l7.1-.6z'/%3E%3C/svg%3E") center/30px no-repeat; box-shadow: 0 6px 16px rgba(109, 63, 224, .35); cursor: grab; transition: transform .2s var(--spring); }
.slider::-webkit-slider-thumb:active { transform: scale(1.2); }
.slider::-moz-range-thumb { width: 46px; height: 46px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 6px 16px rgba(109, 63, 224, .35); }
.scale { width: 100%; display: flex; justify-content: space-between; color: var(--muted); font-weight: 700; font-size: 14px; margin-top: -8px; }

/* 3. Accueil */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 14px; padding: 12px 20px; background: rgba(255, 255, 255, .78); }
.brand { display: flex; align-items: center; gap: 8px; font-size: 26px; color: var(--mauve-deep); transition: transform .25s var(--spring); }
.brand:active { transform: scale(.92); }
.search { flex: 1; max-width: 640px; margin: 0 auto; display: flex; background: #fff; border-radius: 999px; box-shadow: var(--shadow); border: 2px solid transparent; transition: border-color .2s; }
.search:focus-within { border-color: var(--mauve); }
.search input { flex: 1; min-width: 0; border: 0; outline: none; background: none; padding: 14px 22px; font: 700 17px Nunito; color: var(--ink); }
.search button { width: 64px; border-radius: 999px; background: var(--mauve); margin: 4px; display: grid; place-items: center; transition: transform .25s var(--spring); }
.search button:active { transform: scale(.88); }
.search svg { width: 24px; fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; }
.kid-chip { display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 999px; background: var(--mauve-soft); font-weight: 800; transition: transform .25s var(--spring); }
.kid-chip:hover { transform: scale(1.05); }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #fff; font: 700 17px Fredoka; background: linear-gradient(135deg, var(--rose), var(--mauve)); }
.chips { display: flex; gap: 10px; padding: 6px 20px 14px; overflow-x: auto; scrollbar-width: none; }
.chip { flex: none; padding: 10px 18px; border-radius: 999px; font-weight: 800; color: #fff; box-shadow: 0 6px 14px rgba(42, 27, 77, .12); transition: transform .25s var(--spring); }
.chip:hover { transform: translateY(-3px) scale(1.05); }
.chip:active { transform: scale(.92); }
.home { padding: 0 20px 60px; max-width: 1400px; margin: 0 auto; }
.row-title { font-size: 24px; margin: 18px 0 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px; }
.card { text-align: left; border-radius: var(--r); transition: transform .3s var(--spring); }
.card:hover { transform: translateY(-6px) scale(1.02); }
.card:active { transform: scale(.96); }
.thumb { position: relative; aspect-ratio: 16/9; border-radius: 22px; overflow: hidden; background: var(--mauve-soft); box-shadow: var(--shadow); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dur { position: absolute; right: 10px; bottom: 10px; background: rgba(42, 27, 77, .82); color: #fff; font: 700 13px Nunito; padding: 3px 8px; border-radius: 8px; }
.badge { position: absolute; left: 10px; top: 10px; padding: 6px 12px; border-radius: 999px; font: 800 13px Nunito; color: #fff; background: linear-gradient(135deg, var(--mauve), var(--rose)); box-shadow: 0 4px 12px rgba(109, 63, 224, .4); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.07); } }
.card h4 { margin: 12px 4px 4px; font: 800 16px/1.3 Nunito; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card p { margin: 0 4px; color: var(--muted); font-size: 14px; font-weight: 700; }
.empty { color: var(--muted); font-weight: 700; }
.skeleton .thumb { animation: shimmer 1.2s ease-in-out infinite alternate; }
@keyframes shimmer { to { opacity: .5; } }

/* 4. Lecture */
#s-play { background: #fff; }
.hud { position: relative; z-index: 3; height: 76px; display: flex; align-items: center; gap: 14px; padding: 0 18px; }
.hud-bubble { flex: 1; font: 600 18px Fredoka; color: var(--mauve-deep); opacity: 0; transform: translateX(-8px); transition: .35s var(--spring); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-bubble.on { opacity: 1; transform: none; }
.stars-count { display: flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 999px; background: #FFF6D8; font-size: 22px; }
.star-ico { color: var(--jaune); font-size: 26px; text-shadow: 0 2px 0 #E9A800; }
.stars-count.bump { animation: bump .6s var(--spring); }
@keyframes bump { 40% { transform: scale(1.35); } }
.ring { position: relative; width: 48px; height: 48px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 4; stroke: var(--mauve-soft); }
#ring-fg { stroke: var(--vert); stroke-linecap: round; stroke-dasharray: 94.25; transition: stroke-dashoffset .5s; }
#ring-txt { position: absolute; inset: 0; display: grid; place-items: center; font: 700 12px Fredoka; color: var(--muted); }
.lock { width: 48px; height: 48px; border-radius: 50%; background: var(--mauve-soft); font-size: 20px; position: relative; }
.lock.hold::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 4px solid var(--mauve); clip-path: inset(0 0 0 0); animation: holdring 1.6s linear forwards; }
@keyframes holdring { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }
.stage { position: absolute; inset: 76px 0 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 0 18px 18px; }
.player-wrap { width: min(100%, calc((100dvh - 170px) * 16 / 9)); aspect-ratio: 16/9; border-radius: 26px; overflow: hidden; background: #000; box-shadow: 0 24px 60px rgba(42, 27, 77, .25); transition: transform .5s var(--spring), opacity .4s; }
.player-wrap iframe { width: 100%; height: 100%; display: block; }
#s-play.asking .player-wrap { transform: scale(.88); opacity: 0; }
.start { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; background: rgba(255, 255, 255, .92); }
.start.off { display: none; }

/* Question plein écran */
.quiz { position: fixed; inset: 0; z-index: 10; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(18px, 4vh, 40px); padding: 24px 16px; background: radial-gradient(circle at 50% 30%, #fff 0%, #F6F0FF 60%, #EFE5FF 100%); opacity: 0; pointer-events: none; transform: scale(1.04); transition: opacity .35s, transform .45s var(--spring); }
.quiz.on { opacity: 1; pointer-events: auto; transform: none; }
.quiz-head { display: flex; align-items: center; gap: 16px; max-width: 900px; }
.bubble { position: relative; background: #fff; padding: 18px 26px; border-radius: 28px; font: 600 clamp(22px, 3.6vw, 34px)/1.2 Fredoka; box-shadow: var(--shadow); }
.bubble::before { content: ''; position: absolute; left: -12px; top: 50%; margin-top: -12px; border-right: 16px solid #fff; border-top: 12px solid transparent; border-bottom: 12px solid transparent; }
.answers { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(14px, 3vw, 34px); }
.ans { width: clamp(132px, 24vw, 230px); aspect-ratio: 1; border-radius: 36px; background: #fff; box-shadow: var(--shadow); display: grid; place-items: center; position: relative; transition: transform .3s var(--spring), box-shadow .3s, opacity .3s; animation: popin .55s var(--spring) backwards; }
.ans:nth-child(2) { animation-delay: .08s; } .ans:nth-child(3) { animation-delay: .16s; }
@keyframes popin { from { transform: scale(.3) rotate(-8deg); opacity: 0; } }
.ans:hover { transform: scale(1.06); }
.ans:active { transform: scale(.9); }
.ans.lit { transform: scale(1.1); box-shadow: 0 0 0 7px var(--lilac), var(--shadow); }
.ans .emo { font-size: clamp(70px, 13vw, 128px); line-height: 1; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .12)); }
.ans .col { width: 70%; aspect-ratio: 1; border-radius: 50%; box-shadow: inset -10px -12px 0 rgba(0, 0, 0, .12), inset 10px 10px 0 rgba(255, 255, 255, .35); }
.ans .shp { width: 68%; }
.ans .num { font: 700 clamp(70px, 12vw, 120px) Fredoka; color: var(--mauve-deep); }
.ans .bul { font: 700 clamp(28px, 5vw, 44px) Fredoka; color: var(--mauve-deep); background: var(--mauve-soft); padding: 18px 22px; border-radius: 40px 40px 40px 8px; transform: rotate(-6deg); }
.ans.win { transform: scale(1.18); box-shadow: 0 0 0 8px var(--vert), 0 20px 40px rgba(61, 214, 140, .35); z-index: 2; }
.ans.win::after { content: '★'; position: absolute; top: -18px; right: -14px; font-size: 54px; color: var(--jaune); text-shadow: 0 3px 0 #E9A800; animation: popin .5s var(--spring); }
.ans.no { animation: shake .5s; opacity: .35; pointer-events: none; }
@keyframes shake { 20%, 60% { transform: translateX(-12px) rotate(-3deg); } 40%, 80% { transform: translateX(12px) rotate(3deg); } }
.ans.reveal { animation: glow 1s ease-in-out infinite alternate; }
@keyframes glow { to { box-shadow: 0 0 0 10px var(--jaune), 0 0 40px var(--jaune); transform: scale(1.12); } }
.quiz.done .ans:not(.win):not(.reveal) { opacity: .25; transform: scale(.9); }
.ear { position: absolute; right: 22px; bottom: 22px; width: 64px; height: 64px; border-radius: 50%; background: #fff; box-shadow: var(--shadow); font-size: 30px; transition: transform .25s var(--spring); }
.ear:active { transform: scale(.85); }
.flystar { position: fixed; z-index: 20; font-size: 64px; color: var(--jaune); text-shadow: 0 3px 0 #E9A800; pointer-events: none; transition: transform .9s cubic-bezier(.5, -0.3, .7, 1), opacity .9s; }

.parent-menu { position: fixed; inset: 0; z-index: 15; display: none; place-items: center; background: rgba(42, 27, 77, .35); }
.parent-menu.on { display: grid; }
.pm-card { background: #fff; border-radius: 30px; padding: 26px; display: grid; gap: 12px; width: min(400px, 92vw); box-shadow: var(--shadow); animation: enter .4s var(--spring); }
.pm-card h3 { margin: 0 0 6px; text-align: center; }

/* 5. Fin */
.end { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 32px 16px; text-align: center; }
.end h2 { font-size: clamp(30px, 6vw, 46px); margin: 0; }
.end-stars { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: 600px; }
.end-stars span { font-size: 46px; color: var(--jaune); text-shadow: 0 3px 0 #E9A800; animation: popin .5s var(--spring) backwards; }
.challenge { max-width: 560px; background: linear-gradient(135deg, #FFF0F7, #F1EAFF); border-radius: 28px; padding: 20px 24px; font: 600 22px/1.3 Fredoka; box-shadow: var(--shadow); }
.challenge .emo { font-size: 56px; display: block; }
.end-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 8px; }

/* 6. Résumé parent */
.parent { max-width: 760px; margin: 0 auto; padding: 28px 16px 60px; }
.back { font-weight: 800; color: var(--mauve-deep); padding: 8px 0; }
.parent h2 { font-size: 32px; margin: 10px 0 18px; }
.parent h3 { margin: 26px 0 10px; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.kpi { background: #fff; border-radius: 22px; padding: 16px; box-shadow: var(--shadow); text-align: center; }
.kpi b { display: block; font-size: 34px; color: var(--mauve-deep); }
.kpi span { color: var(--muted); font-weight: 700; font-size: 14px; }
.words { display: flex; flex-wrap: wrap; gap: 8px; }
.words span { padding: 8px 14px; border-radius: 999px; font-weight: 800; color: #fff; }
.dinner { font: 600 22px/1.3 Fredoka; background: var(--mauve-soft); padding: 18px 22px; border-radius: 22px; margin: 0; }
.qlist { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.qlist li { display: flex; gap: 12px; align-items: center; background: #fff; border-radius: 18px; padding: 12px 16px; box-shadow: 0 2px 10px rgba(109, 63, 224, .08); font-weight: 700; }
.qlist .st { font-size: 22px; }
.qlist small { color: var(--muted); display: block; font-weight: 700; }

.modal { position: fixed; inset: 0; z-index: 30; display: none; place-items: center; background: rgba(42, 27, 77, .3); padding: 16px; }
.modal.on { display: grid; }
.modal-card { background: #fff; border-radius: 32px; padding: 28px; max-width: 440px; text-align: center; box-shadow: var(--shadow); animation: enter .4s var(--spring); }
.modal-card p { font: 600 20px/1.35 Fredoka; }
.modal-actions { display: grid; gap: 10px; }
#confetti { position: fixed; inset: 0; z-index: 25; pointer-events: none; width: 100%; height: 100%; }

@media (max-width: 640px) {
  .top { flex-wrap: wrap; padding: 10px 16px; }
  .search { order: 3; flex-basis: 100%; }
  .kid-chip { margin-left: auto; }
  .home, .chips { padding-left: 16px; padding-right: 16px; }
  .grid { grid-template-columns: 1fr; }
  .hud { gap: 8px; padding: 0 12px; }
  .hud-bubble { display: none; }
  .quiz-head .mascot.mid { width: 76px; height: 76px; }
  .kpis { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }

/* ---------- v2 : n'importe quelle vidéo, jeux variés ---------- */
.hero { text-align: center; padding: 34px 16px 10px; max-width: 640px; margin: 0 auto; }
.hero h2 { font-size: clamp(28px, 5vw, 40px); margin: 10px 0 8px; }
.hero p { color: var(--muted); font-weight: 700; margin: 0 0 6px; font-size: 17px; }
.account { display: inline-block; margin-top: 8px !important; padding: 6px 14px; border-radius: 999px; background: var(--mauve-soft); color: var(--mauve-deep) !important; font-size: 14px !important; }
.prep { font: 600 20px Fredoka; color: var(--mauve-deep); margin: 0; min-height: 26px; text-align: center; padding: 0 16px; }
.prep .dots::after { content: ''; animation: dots 1.2s steps(4) infinite; }
@keyframes dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }

/* Défi en direct (la vidéo continue) */
.live { display: none; align-items: center; gap: 10px; padding: 8px 18px 8px 10px; border-radius: 999px; background: linear-gradient(135deg, var(--jaune), var(--orange)); color: #fff; font: 700 18px Fredoka; box-shadow: 0 8px 22px rgba(255, 154, 60, .45); animation: livepulse 1.1s ease-in-out infinite; transition: transform .25s var(--spring); }
.live.on { display: inline-flex; }
.live:active { transform: scale(.9); }
.live .big { font-size: 30px; }
@keyframes livepulse { 50% { transform: scale(1.08); box-shadow: 0 10px 30px rgba(255, 154, 60, .7); } }
.wordcard { position: absolute; right: 26px; top: 8px; z-index: 4; display: flex; align-items: center; gap: 10px; padding: 10px 18px 10px 12px; border-radius: 22px; background: #fff; box-shadow: var(--shadow); font: 600 20px Fredoka; transform: translateY(-20px) scale(.8); opacity: 0; pointer-events: none; transition: .5s var(--spring); }
.wordcard.on { transform: none; opacity: 1; }
.wordcard .emo { font-size: 38px; }
.wordcard small { display: block; font: 800 12px Nunito; color: var(--rose); text-transform: uppercase; letter-spacing: .06em; }

/* Zone de jeu générique */
.game { display: flex; flex-direction: column; align-items: center; gap: 22px; width: 100%; max-width: 1000px; }
.row { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(12px, 2.6vw, 30px); }
.ans.sm { width: clamp(104px, 17vw, 170px); border-radius: 30px; }
.ans.sm .emo { font-size: clamp(54px, 9vw, 92px); }
.ans.on { box-shadow: 0 0 0 7px var(--mauve), var(--shadow); transform: scale(1.05); }
.ans.on::before { content: '✓'; position: absolute; top: -12px; right: -12px; width: 40px; height: 40px; border-radius: 50%; background: var(--mauve); color: #fff; display: grid; place-items: center; font: 700 24px Fredoka; animation: popin .4s var(--spring); }
.validate { display: none; width: 92px; height: 92px; min-height: 0; padding: 0; border-radius: 50%; font-size: 44px; }
.validate.on { display: inline-flex; animation: popin .5s var(--spring); }
.ans.tf { width: clamp(140px, 26vw, 230px); }
.ans.tf.yes { background: linear-gradient(160deg, #E9FFF3, #C9F5DD); }
.ans.tf.no2 { background: linear-gradient(160deg, #FFF0F6, #FFD3E6); }
/* Glisser-déposer */
.piece { width: 130px; height: 130px; border-radius: 50%; background: #fff; box-shadow: var(--shadow); display: grid; place-items: center; font-size: 80px; touch-action: none; cursor: grab; animation: popin .5s var(--spring), wiggle 2.4s ease-in-out .6s infinite; user-select: none; -webkit-user-select: none; }
.piece.drag { animation: none; cursor: grabbing; position: fixed; z-index: 30; transform: scale(1.15); box-shadow: 0 24px 50px rgba(42, 27, 77, .3); }
@keyframes wiggle { 0%, 80%, 100% { transform: rotate(0); } 85% { transform: rotate(-10deg); } 90% { transform: rotate(10deg); } 95% { transform: rotate(-6deg); } }
.target { border: 4px dashed var(--lilac); background: rgba(255, 255, 255, .8); }
.target.hover { border-color: var(--mauve); transform: scale(1.1); background: var(--mauve-soft); }
.hand { font-size: 28px; color: var(--muted); font-weight: 800; }
/* Remettre dans l'ordre */
.slots { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.slot { width: clamp(76px, 12vw, 110px); aspect-ratio: 1; border-radius: 24px; border: 4px dashed var(--lilac); display: grid; place-items: center; font: 700 34px Fredoka; color: var(--lilac); background: rgba(255, 255, 255, .7); }
.slot.full { border-style: solid; border-color: var(--vert); background: #fff; color: inherit; font-size: clamp(44px, 7vw, 64px); animation: popin .45s var(--spring); }
.ans.used { opacity: .2; transform: scale(.85); pointer-events: none; }
/* Attrape */
.arena { position: relative; width: 100%; height: min(56vh, 520px); border-radius: 36px; background: linear-gradient(180deg, #F3ECFF, #E6F7FF); overflow: hidden; box-shadow: inset 0 0 0 3px #fff; touch-action: none; }
.fly { position: absolute; font-size: clamp(54px, 8vw, 78px); line-height: 1; user-select: none; -webkit-user-select: none; cursor: pointer; transition: transform .2s var(--spring); filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .12)); }
.fly.got { transform: scale(1.8); opacity: 0; transition: .35s; }
.fly.bad { animation: shake .4s; }
.catch-count { font: 700 28px Fredoka; color: var(--mauve-deep); }
.topic { color: var(--muted); font-weight: 800; margin: -8px 0 16px; }
@media (max-width: 640px) {
  .live { padding: 6px 12px 6px 8px; font-size: 15px; }
  .wordcard { right: 12px; top: 4px; font-size: 16px; }
  .piece { width: 104px; height: 104px; font-size: 62px; }
}

/* Frise des jeux sous la vidéo */
.timeline { position: relative; width: min(100%, calc((100dvh - 170px) * 16 / 9)); height: 34px; }
.tl-bar { position: absolute; left: 0; right: 0; top: 13px; height: 8px; border-radius: 9px; background: var(--mauve-soft); overflow: hidden; }
.tl-bar b { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--mauve), var(--rose)); border-radius: 9px; transition: width .25s linear; }
.mk { position: absolute; top: 0; transform: translateX(-50%); width: 34px; height: 34px; border-radius: 50%; background: #fff; box-shadow: 0 4px 12px rgba(109, 63, 224, .25); display: grid; place-items: center; font-size: 18px; transition: transform .3s var(--spring), opacity .3s; }
.mk.soon { animation: soon .8s ease-in-out infinite; box-shadow: 0 0 0 4px var(--jaune), 0 4px 12px rgba(109, 63, 224, .25); }
.mk.done { opacity: .45; transform: translateX(-50%) scale(.8); }
@keyframes soon { 50% { transform: translateX(-50%) translateY(-6px) scale(1.15); } }
#s-play.asking .timeline { opacity: 0; }

/* ---------- v3 : page vidéo façon YouTube, choix du nombre de jeux ---------- */
.acct { font: 800 13px Nunito; color: var(--mauve-deep); background: var(--mauve-soft); padding: 7px 12px; border-radius: 999px; white-space: nowrap; }
#s-play .hud { position: sticky; top: 0; background: rgba(255, 255, 255, .85); }
.back-btn { width: 44px; height: 44px; border-radius: 50%; background: var(--mauve-soft); font: 700 22px Fredoka; color: var(--mauve-deep); transition: transform .25s var(--spring); }
.back-btn:active { transform: scale(.88); }
.watch { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 26px; padding: 6px 24px 48px; max-width: 1600px; margin: 0 auto; }
.player-box { position: relative; }
.watch .player-wrap { width: 100%; }
.watch .timeline { width: 100%; height: 66px; margin-top: 14px; }
.watch .start { border-radius: 26px; gap: 12px; }
.ask-count { font: 600 22px Fredoka; margin: 6px 0 0; }
.counts { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.counts button { width: 74px; height: 74px; border-radius: 50%; background: #fff; box-shadow: var(--shadow); font: 700 30px Fredoka; color: var(--mauve-deep); transition: transform .3s var(--spring); }
.counts button:hover { transform: scale(1.08); }
.counts button.on { background: linear-gradient(135deg, var(--mauve), var(--mauve-deep)); color: #fff; transform: scale(1.15); }
.auto { color: var(--muted); font-weight: 800; margin: 0; }
.mk i { font-style: normal; }
.rj { position: absolute; top: 40px; left: 50%; transform: translateX(-50%); width: 26px; height: 26px; border-radius: 50%; background: var(--mauve-soft); color: var(--mauve-deep); font: 700 15px Fredoka; display: none; place-items: center; transition: transform .25s var(--spring); }
.rj:hover { transform: translateX(-50%) scale(1.2); }
.mk.done.can .rj { display: grid; }
.mk.done { opacity: 1; transform: translateX(-50%); }
.mk.done i { opacity: .55; }
.watch .wordcard { position: relative; right: auto; top: auto; width: fit-content; margin: 4px 0 8px; }
.watch .wordcard:not(.on) { display: none; }
.v-title { font: 700 22px/1.3 Fredoka; margin: 8px 0 4px; }
.v-channel { color: var(--muted); font-weight: 800; margin: 0; }
.side-col h3 { margin: 4px 0 12px; font-size: 20px; }
.rel { display: grid; grid-template-columns: 168px 1fr; gap: 10px; text-align: left; margin-bottom: 12px; border-radius: 16px; padding: 4px; transition: transform .25s var(--spring), background .2s; width: 100%; }
.rel:hover { background: var(--mauve-soft); transform: scale(1.02); }
.rel img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 12px; display: block; }
.rel b { font: 800 14px/1.3 Nunito; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rel span { display: block; color: var(--muted); font-size: 12px; font-weight: 700; margin-top: 4px; }
.skip { position: absolute; top: 20px; right: 22px; padding: 10px 16px; border-radius: 999px; background: rgba(255, 255, 255, .8); color: var(--muted); font: 800 15px Nunito; box-shadow: 0 2px 10px rgba(109, 63, 224, .1); }
@media (max-width: 1000px) {
  .watch { grid-template-columns: 1fr; padding: 4px 12px 40px; }
  .acct { display: none; }
}

.chip.on { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--mauve-deep); transform: scale(1.06); }

/* ---------- v4 : page d'accueil (structure klapo.io) ---------- */
#s-welcome { overflow-x: hidden; }
.lnav { position: sticky; top: 12px; z-index: 6; display: flex; align-items: center; gap: 18px; width: min(1100px, calc(100% - 32px)); margin: 12px auto 0; padding: 10px 12px 10px 18px; border-radius: 999px; background: rgba(255, 255, 255, .82); box-shadow: var(--shadow); }
.lnav .brand { text-decoration: none; }
.lnav-links { display: flex; gap: 22px; margin: 0 auto; }
.lnav-links a { color: var(--ink); text-decoration: none; font-weight: 800; font-size: 15px; }
.lnav-links a:hover { color: var(--mauve-deep); }
.lnav-cta { padding: 10px 18px; border-radius: 999px; background: linear-gradient(135deg, var(--mauve), var(--mauve-deep)); color: #fff; font: 600 16px Fredoka; transition: transform .25s var(--spring); }
.lnav-cta:hover { transform: scale(1.05); }
.lhero { position: relative; max-width: 1100px; margin: 0 auto; padding: 70px 16px 40px; text-align: center; }
.lhero h1 { font-size: clamp(46px, 8.5vw, 104px); line-height: .98; letter-spacing: -2px; margin: 0; }
mark { background: linear-gradient(120deg, var(--lilac), #E9DDFF); color: var(--mauve-deep); padding: 0 .14em; border-radius: .18em; }
.lsub { max-width: 600px; margin: 22px auto 0; font-size: 19px; font-weight: 700; color: var(--muted); }
.float-chip { position: absolute; display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 16px; background: #fff; box-shadow: var(--shadow); font: 800 14px Nunito; animation: float 5s ease-in-out infinite; }
.float-chip b { font-size: 20px; }
.c1 { left: 0; top: 90px; } .c2 { right: 0; top: 70px; animation-delay: -1.5s; } .c3 { left: 3%; top: 300px; animation-delay: -3s; } .c4 { right: 2%; top: 290px; animation-delay: -2s; }
.lmascot { display: flex; justify-content: center; align-items: flex-end; gap: 6px; margin: 26px 0 -14px; position: relative; z-index: 2; }
.speech { background: #fff; padding: 10px 16px; border-radius: 18px 18px 4px 18px; box-shadow: var(--shadow); font: 600 16px Fredoka; margin-bottom: 70px; }
.lcard { display: grid; gap: 12px; justify-items: center; width: min(520px, 100%); margin: 0 auto; padding: 30px 24px 22px; border-radius: 32px; background: #fff; box-shadow: 0 30px 70px rgba(109, 63, 224, .18); border: 2px solid var(--mauve-soft); }
.lcard .btn { width: 100%; }
.g-ico { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font: 700 16px Fredoka; color: #fff; background: conic-gradient(#EA4335 0 25%, #FBBC05 0 50%, #34A853 0 75%, #4285F4 0); }
.trust { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; margin-top: 18px; color: var(--muted); font-weight: 800; font-size: 14px; }
.lsec { max-width: 1100px; margin: 0 auto; padding: 80px 16px 20px; text-align: center; }
.kicker { display: inline-block; padding: 6px 14px; border-radius: 999px; background: var(--mauve-soft); color: var(--mauve-deep); font: 800 13px Nunito; text-transform: uppercase; letter-spacing: .08em; }
.lsec h2 { font-size: clamp(34px, 5.5vw, 62px); line-height: 1.02; letter-spacing: -1px; margin: 14px 0 10px; }
.lsec-sub { color: var(--muted); font-weight: 700; font-size: 17px; margin: 0 0 30px; }
.ba { display: grid; grid-template-columns: 1fr auto 1fr; gap: 18px; align-items: center; margin-top: 26px; }
.ba-card { position: relative; background: #fff; border-radius: 30px; padding: 22px; box-shadow: var(--shadow); text-align: left; }
.ba-card.glow { box-shadow: 0 0 0 3px var(--mauve), 0 30px 60px rgba(109, 63, 224, .25); }
.ba-card p { font-weight: 700; color: var(--muted); }
.tag { font: 800 12px Nunito; letter-spacing: .08em; color: var(--muted); }
.tag.on { color: var(--mauve-deep); }
.ba-screen { aspect-ratio: 16/9; border-radius: 20px; margin-top: 10px; display: grid; place-items: center; }
.ba-screen.dull { background: linear-gradient(135deg, #D9D3E6, #B9B1CC); color: #fff; font-size: 54px; }
.ba-screen.quizmock { background: radial-gradient(circle at 50% 20%, #fff, #EFE5FF); gap: 6px; padding: 10px; }
.ba-screen.quizmock p { margin: 0; color: var(--ink); font: 600 17px Fredoka; text-align: center; }
.ba-screen.quizmock div { display: flex; gap: 10px; }
.ba-screen.quizmock i { font-style: normal; font-size: 34px; background: #fff; width: 62px; height: 62px; border-radius: 18px; display: grid; place-items: center; box-shadow: var(--shadow); }
.ba-screen.quizmock i.ok { box-shadow: 0 0 0 4px var(--vert); }
.ba-arrow { font: 700 40px Fredoka; color: var(--mauve); }
.ba-stats { display: flex; flex-wrap: wrap; gap: 8px; }
.ba-stats span { padding: 6px 12px; border-radius: 999px; background: #F2F0F7; font-weight: 800; font-size: 13px; color: var(--muted); }
.ba-stats .hl { background: var(--mauve-soft); color: var(--mauve-deep); }
.games-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 30px; }
.games-grid div { background: #fff; border-radius: 26px; padding: 22px 16px; box-shadow: var(--shadow); transition: transform .3s var(--spring); }
.games-grid div:hover { transform: translateY(-6px) rotate(-1deg); }
.games-grid b { font-size: 46px; display: block; }
.games-grid h4 { margin: 8px 0 4px; font: 600 19px Fredoka; }
.games-grid p { margin: 0; color: var(--muted); font-weight: 700; font-size: 14px; }
.steps3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 30px; }
.steps3 div { background: #fff; border-radius: 26px; padding: 24px; box-shadow: var(--shadow); text-align: left; }
.steps3 .n { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: #fff; font: 700 20px Fredoka; background: linear-gradient(135deg, var(--mauve), var(--rose)); }
.steps3 h4 { font: 600 20px Fredoka; margin: 12px 0 6px; }
.steps3 p { color: var(--muted); font-weight: 700; margin: 0; }
.demo-tl { position: relative; height: 40px; margin: 40px auto 0; max-width: 760px; }
.demo-tl b { position: absolute; left: 0; right: 0; top: 16px; height: 8px; border-radius: 9px; background: linear-gradient(90deg, var(--mauve), var(--rose)); }
.demo-tl i { position: absolute; top: 0; transform: translateX(-50%); width: 40px; height: 40px; border-radius: 50%; background: #fff; box-shadow: var(--shadow); display: grid; place-items: center; font-style: normal; font-size: 20px; animation: soon 1.6s ease-in-out infinite; }
.demo-tl i:nth-child(3) { animation-delay: .4s; } .demo-tl i:nth-child(4) { animation-delay: .8s; } .demo-tl i:nth-child(5) { animation-delay: 1.2s; }
.pmock { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 760px; margin: 30px auto 0; }
.pmock .dinner { grid-column: 1 / -1; text-align: left; }
.lfinal .lcard { margin-top: 26px; }
.lfoot { text-align: center; color: var(--muted); font-weight: 700; font-size: 13px; padding: 50px 16px 30px; }
@media (max-width: 900px) {
  .float-chip, .lnav-links { display: none; }
  .ba { grid-template-columns: 1fr; } .ba-arrow { transform: rotate(90deg); justify-self: center; }
  .games-grid { grid-template-columns: repeat(2, 1fr); }
  .steps3, .pmock { grid-template-columns: 1fr; }
  .lhero { padding-top: 46px; }
}

/* ---------- v4 : analyse animée ---------- */
.scan { display: flex; align-items: flex-end; gap: 6px; }
.film { position: relative; display: flex; gap: 6px; padding: 10px; border-radius: 16px; background: #2A1B4D; overflow: hidden; }
.film span { width: 54px; height: 40px; border-radius: 8px; background: #3B2A66; display: grid; place-items: center; font-size: 22px; }
.film .beam { position: absolute; top: 0; bottom: 0; width: 34px; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent); animation: beam 1.6s ease-in-out infinite; }
@keyframes beam { from { left: -40px; } to { left: 100%; } }
.scan.done .film .beam { display: none; }
.pbar { width: 220px; height: 8px; border-radius: 9px; background: var(--mauve-soft); overflow: hidden; }
.pbar b { display: block; height: 100%; width: 4%; border-radius: 9px; background: linear-gradient(90deg, var(--mauve), var(--rose)); transition: width 16s cubic-bezier(.2, .8, .3, 1); }
.pbar.go b { width: 92%; }
.pbar.done b { width: 100%; transition: width .4s; }
.timeline.wait .tl-bar { background: linear-gradient(90deg, var(--mauve-soft), #fff, var(--mauve-soft)); background-size: 200% 100%; animation: shimmer2 1.2s linear infinite; }
@keyframes shimmer2 { to { background-position: -200% 0; } }

/* ---------- v4 : scène de question animée ---------- */
.decor { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.decor span { position: absolute; opacity: .13; filter: saturate(.8); animation: drift2 9s ease-in-out infinite alternate; }
@keyframes drift2 { to { transform: translate(18px, -22px) rotate(12deg); } }
.quiz-head, .game { position: relative; z-index: 1; }
.quiz.on #quiz-mascot { animation: mascotIn .8s var(--spring); }
@keyframes mascotIn { from { transform: translateX(-120px) rotate(-30deg); opacity: 0; } }
.quiz .mascot:not(.happy):not(.oops) svg { animation: idlehop 2.8s ease-in-out infinite; }
@keyframes idlehop { 0%, 60%, 100% { transform: translate(0, 0); } 70% { transform: translate(6px, -16px) rotate(8deg); } 80% { transform: translate(0, 0) scale(1.05, .95); } 90% { transform: translate(-4px, -6px) rotate(-5deg); } }

/* ---------- v4 : bande de jeux en haut de la vidéo (mobile et plein écran) ---------- */
.main-col { display: flex; flex-direction: column; }
.fs-btn { width: 44px; height: 44px; border-radius: 50%; background: var(--mauve-soft); font-size: 20px; color: var(--mauve-deep); }
#s-play.fs { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; background: #120C24; overflow: hidden; }
#s-play.fs .hud { position: relative; height: 54px; background: #1E1438; color: #fff; }
#s-play.fs .hud-bubble { color: #E5D9FF; display: block; }
#s-play.fs .back-btn, #s-play.fs .side-col, #s-play.fs .v-title, #s-play.fs .v-channel, #s-play.fs .wordcard { display: none; }
#s-play.fs .watch { display: flex; flex-direction: column; flex: 1; min-height: 0; padding: 0 10px 8px; max-width: none; width: 100%; }
#s-play.fs .main-col { flex: 1; min-height: 0; align-items: center; }
#s-play.fs .timeline { order: -1; width: min(100%, calc((100dvh - 140px) * 16 / 9)); height: 62px; margin: 6px 0 2px; }
#s-play.fs .player-box { flex: 1; min-height: 0; width: 100%; display: flex; align-items: center; justify-content: center; }
#s-play.fs .player-wrap { width: min(100%, calc((100dvh - 140px) * 16 / 9)); }
#s-play.fs .fs-btn { background: #fff; }
@media (max-width: 700px) {
  .watch .timeline { order: -1; margin: 4px 0 8px; }
  .hud-bubble { display: block !important; font-size: 14px; }
  .ring { display: none; }
}

/* ---------- v5 : accueil épuré, suggestions, historique, préparation dans la bande ---------- */
.home-hero { text-align: center; padding: 50px 16px 18px; transition: .4s var(--spring); }
.home-hero h2 { font-size: clamp(30px, 6vw, 46px); margin: 8px 0 6px; }
.home-hero p { color: var(--muted); font-weight: 700; margin: 0; }
.home-hero.small { padding: 4px 0 0; }
.home-hero.small .mascot, .home-hero.small h2, .home-hero.small p { display: none; }
.home .chips { justify-content: center; flex-wrap: wrap; padding: 10px 0 18px; overflow: visible; }
.search { position: relative; }
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 20; background: #fff; border-radius: 22px; box-shadow: 0 20px 50px rgba(42, 27, 77, .2); padding: 8px; display: none; }
.suggest.on { display: block; animation: enter .25s ease; }
.suggest button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 14px; border-radius: 14px; text-align: left; font: 700 16px Nunito; color: var(--ink); }
.suggest button span { opacity: .55; }
.suggest button:hover, .suggest button.on { background: var(--mauve-soft); }
.hist-btn { padding: 8px 14px; border-radius: 999px; background: #FFF6D8; font: 800 14px Nunito; white-space: nowrap; transition: transform .25s var(--spring); }
.hist-btn:hover { transform: scale(1.05); }
.kpis.four { grid-template-columns: repeat(4, 1fr); }
.qlist .h-day { background: none; box-shadow: none; padding: 14px 4px 2px; color: var(--mauve-deep); font: 600 17px Fredoka; text-transform: capitalize; }
.prep-pill { display: none; align-items: center; gap: 12px; margin: 10px 0 0; padding: 8px 14px 8px 8px; border-radius: 999px; background: #fff; box-shadow: var(--shadow); width: fit-content; max-width: 100%; }
.prep-pill.on { display: flex; animation: enter .4s var(--spring); }
.prep-pill #prep { font: 600 15px Fredoka; color: var(--mauve-deep); }
.prep-pill .pbar { width: 90px; }
.prep-pill.done .film .beam, .prep-pill.done .pbar { display: none; }
.film.mini { padding: 5px; gap: 4px; border-radius: 12px; }
.film.mini span { width: 30px; height: 22px; font-size: 13px; border-radius: 6px; }
#s-play.fs .prep-pill { order: -2; margin: 6px auto 0; background: #2A1F4A; }
#s-play.fs .prep-pill #prep { color: #E5D9FF; }
@media (max-width: 700px) {
  .watch .prep-pill { order: -2; }
  .hist-btn span { display: none; }
  .kpis.four { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- v5 : la mascotte vit pendant la question ---------- */
.quiz .mascot.mid { width: 130px; height: 130px; }
.quiz.on #quiz-mascot { animation: mascotIn .8s var(--spring), wander 5s ease-in-out .8s infinite; }
@keyframes wander { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-14px) rotate(-4deg); } 50% { transform: translateX(10px) rotate(3deg); } 75% { transform: translateX(-6px); } }
.quiz .mascot:not(.happy):not(.oops) svg { animation: bounce2 1.5s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes bounce2 { 0%, 100% { transform: translateY(0) scale(1, 1); } 30% { transform: translateY(-16px) scale(.96, 1.05) rotate(-4deg); } 55% { transform: translateY(0) scale(1.08, .92); } 70% { transform: translateY(-5px) rotate(3deg); } }
.quiz .mascot.talk:not(.happy):not(.oops) svg { animation-duration: .9s; }
.quiz .mascot.happy svg { animation: hop .7s var(--spring) 3, spin .9s ease-in-out; }
@keyframes spin { 50% { transform: rotate(180deg) scale(1.15); } to { transform: rotate(360deg); } }
@media (max-width: 640px) { .quiz .mascot.mid { width: 92px; height: 92px; } .quiz-head { gap: 10px; } }
.search .suggest button { background: none; margin: 0; width: 100%; height: auto; display: flex; place-items: initial; border-radius: 14px; transition: background .15s; }
.search .suggest button:hover, .search .suggest button.on { background: var(--mauve-soft); transform: none; }

/* ---------- v6 : interface calquée sur YouTube ---------- */
.burger { width: 42px; height: 42px; border-radius: 50%; font-size: 20px; color: var(--ink); flex: none; }
.burger:hover { background: var(--mauve-soft); }
.avatar-btn { flex: none; border-radius: 50%; transition: transform .25s var(--spring); }
.avatar-btn:hover { transform: scale(1.08); }
.avatar-btn .avatar { width: 40px; height: 40px; }
.yt-body { display: grid; grid-template-columns: 220px minmax(0, 1fr); }
.sidebar { position: sticky; top: 72px; align-self: start; display: grid; gap: 4px; padding: 8px 12px; }
.sidebar button, .bottom-nav button { display: flex; align-items: center; gap: 18px; padding: 11px 14px; border-radius: 14px; font: 800 15px Nunito; text-align: left; transition: background .15s; }
.sidebar button i, .bottom-nav button i { font-style: normal; font-size: 21px; width: 26px; text-align: center; }
.sidebar button:hover { background: #F4F0FB; }
.sidebar button.on { background: var(--mauve-soft); color: var(--mauve-deep); }
#s-home.mini .yt-body { grid-template-columns: 84px minmax(0, 1fr); }
#s-home.mini .sidebar button { flex-direction: column; gap: 4px; padding: 12px 4px; font-size: 11px; text-align: center; }
.yt-main { padding: 0 24px 90px; max-width: 1280px; width: 100%; }
.view { display: none; }
.view.on { display: block; animation: enter .35s ease; }
.v-h { font-size: 28px; margin: 18px 0 16px; }
.home .chips { gap: 12px; }
.home .chip { font-size: 16px; padding: 12px 20px; }
/* résultats en liste, comme une recherche YouTube */
.rlist { display: grid; gap: 16px; }
.card.row { display: grid; grid-template-columns: minmax(200px, 360px) 1fr; gap: 16px; align-items: start; }
.card.row:hover { transform: none; }
.card.row:hover .thumb { transform: scale(1.02); }
.card.row .thumb { transition: transform .3s var(--spring); }
.card.row .meta h4 { margin: 2px 0 6px; font-size: 18px; -webkit-line-clamp: 2; }
.card.row .meta p { margin: 0; }
.rlist .h-day { margin: 18px 0 2px; font: 600 20px Fredoka; text-transform: capitalize; }
/* Suivi : semaine après semaine */
.trend { color: var(--muted); font-weight: 800; margin: -4px 0 14px; }
.wchart { display: flex; align-items: flex-end; gap: 10px; height: 260px; padding: 14px; border-radius: 26px; background: #fff; box-shadow: var(--shadow); }
.wcol { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; min-width: 0; }
.wbar { width: min(46px, 100%); border-radius: 12px 12px 6px 6px; background: var(--mauve-soft); position: relative; overflow: hidden; display: flex; align-items: flex-end; transition: height .6s var(--spring); }
.wbar b { display: block; width: 100%; background: linear-gradient(180deg, var(--mauve), var(--mauve-deep)); border-radius: 12px 12px 6px 6px; }
.wpct { font: 700 13px Fredoka; color: var(--mauve-deep); min-height: 16px; }
.wn { font: 800 13px Nunito; }
.wl { font: 700 11px Nunito; color: var(--muted); white-space: nowrap; }
.wcol.now .wl { color: var(--mauve-deep); }
/* Réglages */
.set-card { background: #fff; border-radius: 26px; padding: 20px 22px; box-shadow: var(--shadow); margin-bottom: 16px; max-width: 720px; }
.set-card h3 { margin: 0 0 12px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; font-weight: 800; }
.set-row.col { flex-direction: column; align-items: stretch; }
.field.sm { width: min(280px, 60%); font-size: 18px; padding: 10px 14px; text-align: left; }
.ages.sm { gap: 8px; }
.ages.sm .age { width: 46px; height: 46px; font-size: 20px; }
.ages.sm .age.on { transform: scale(1.12); box-shadow: 0 0 0 4px var(--mauve), var(--shadow); }
.set-card .scale b { color: var(--mauve-deep); font: 600 16px Fredoka; }
.acct-line { color: var(--muted); font-weight: 700; margin: 0 0 12px; }
.set-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.bottom-nav { display: none; }
@media (max-width: 860px) {
  .yt-body { grid-template-columns: 1fr !important; }
  .sidebar, .burger { display: none; }
  .yt-main { padding: 0 14px 96px; }
  .bottom-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 8; justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .94); box-shadow: 0 -4px 20px rgba(109, 63, 224, .1); }
  .bottom-nav button { flex-direction: column; gap: 2px; padding: 6px 10px; font-size: 11px; }
  .bottom-nav button.on { color: var(--mauve-deep); background: var(--mauve-soft); }
  .card.row { grid-template-columns: 1fr; gap: 8px; }
  .top .brand b { display: none; }
  .wchart { gap: 4px; padding: 10px 8px; }
  .set-row { flex-direction: column; align-items: flex-start; }
  .field.sm { width: 100%; }
}

/* Correctif : les flous (bulles du fond, barre floutée) font afficher la vidéo YouTube
   en noir pendant la lecture. Aucun flou sur la page vidéo. */
#s-play .hud { background: #fff; }

/* Correctif (suite) : aucune animation continue près du lecteur pendant la lecture,
   sinon la vidéo s'affiche en noir. La progression avance par paliers (JS). */
#s-play .film .beam { display: none; }
#s-play .timeline.wait .tl-bar { animation: none; background: var(--mauve-soft); }
#s-play .pbar b { transition: none; }
#s-play .mk.soon { animation: none; transform: translateX(-50%) scale(1.15); }
#s-play .live { animation: none; }
#s-play .prep-pill.on { animation: none; }

.games-grid.five { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 900px) { .games-grid.five { grid-template-columns: repeat(2, 1fr); } }

/* ---------- v9 : puzzle, paires ---------- */
.puzzle { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 6px; width: min(330px, 78vw); aspect-ratio: 1; padding: 6px; border-radius: 26px; background: #fff; box-shadow: var(--shadow); }
.pc { border-radius: 14px; background-size: calc(var(--n) * 100%) calc(var(--n) * 100%); box-shadow: inset 0 0 0 2px rgba(155, 107, 255, .25); transition: transform .25s var(--spring); }
.pc:hover { transform: scale(1.04); }
.pc.sel { transform: scale(1.1); box-shadow: 0 0 0 5px var(--mauve); z-index: 2; }
.pc.swap { animation: popin .3s var(--spring); }
.puzzle.solved { gap: 0; box-shadow: 0 0 0 8px var(--vert), var(--shadow); transition: gap .4s; }
.puzzle.solved .pc { border-radius: 0; box-shadow: none; }
.pz-model { position: absolute; right: 24px; bottom: 96px; width: 84px; height: 84px; border-radius: 20px; overflow: hidden; background: #fff; box-shadow: var(--shadow); opacity: .9; }
.pz-model img { width: 100%; height: 100%; }
.pairs { display: flex; gap: clamp(40px, 14vw, 160px); }
.pcol { display: flex; flex-direction: column; gap: 16px; }
.ans.pa.on { transform: scale(1.1); box-shadow: 0 0 0 7px var(--mauve), var(--shadow); }
.ans.linked { opacity: .85; }
@media (max-width: 640px) { .pz-model { bottom: 20px; left: 20px; right: auto; width: 64px; height: 64px; } }
.pz-model { position: static !important; width: 70px !important; height: 70px !important; margin-top: -6px; }

/* ---------- v10 : l'ombre, range-le ---------- */
.shadow-big { font-size: clamp(110px, 22vw, 190px); line-height: 1; filter: brightness(0); opacity: .82; transition: filter .7s ease, opacity .7s, transform .7s var(--spring); }
.shadow-big.lit { filter: none; opacity: 1; transform: scale(1.12) rotate(-4deg); }
.bins { display: flex; gap: clamp(16px, 5vw, 48px); }
.bin { position: relative; width: clamp(150px, 28vw, 240px); min-height: clamp(130px, 22vw, 190px); border-radius: 30px 30px 44px 44px; border: 4px dashed var(--lilac); background: rgba(255, 255, 255, .85); display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 6px; padding: 10px; transition: transform .25s var(--spring); }
.bin:hover { transform: scale(1.04); border-color: var(--mauve); }
.bin.wiggle { animation: shake .4s; }
.bin-emo { font-size: clamp(42px, 7vw, 64px); }
.bin-in { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.bin-in i { font-style: normal; font-size: clamp(30px, 5vw, 44px); animation: popin .45s var(--spring); }
.ans.it.on { transform: scale(1.12); box-shadow: 0 0 0 7px var(--mauve), var(--shadow); }

/* ---------- v11 : zoom mystère, mini-démo ---------- */
.loupe { width: clamp(170px, 30vw, 240px); aspect-ratio: 1; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: #fff; box-shadow: 0 0 0 8px var(--lilac), var(--shadow); }
.loupe span { font-size: clamp(120px, 20vw, 170px); line-height: 1; transform: scale(5); transition: transform 7s cubic-bezier(.3, 0, .2, 1); }
.loupe span.out { transform: scale(1.7); }
.loupe span.full { transform: scale(1); transition: transform .8s var(--spring); }
.demo-hand { position: fixed; z-index: 30; font-size: 54px; pointer-events: none; transition: left .6s ease-in-out, top .6s ease-in-out, transform .2s; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .25)); }
.demo-hand.press { transform: scale(.8) translateY(6px); }
.demo-on { box-shadow: 0 0 0 7px var(--jaune), var(--shadow) !important; transform: scale(1.08); }

.games-grid.six { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .games-grid.six { grid-template-columns: repeat(2, 1fr); } }

.demo-used { opacity: .25; transform: scale(.85); }

/* ---------- v13 : range-le, une image à la fois ---------- */
.rg { display: flex; align-items: center; justify-content: center; gap: clamp(12px, 4vw, 40px); width: 100%; }
.rg-bin { width: clamp(130px, 26vw, 230px); min-height: clamp(170px, 30vw, 260px); justify-content: flex-start; padding-top: 16px; }
.rg-bin.lit { border-color: var(--mauve); border-style: solid; background: var(--mauve-soft); transform: scale(1.08); }
.rg-bin.no { animation: shake .45s; border-color: var(--rose); }
.bin-lab { font: 600 clamp(15px, 2.4vw, 20px) Fredoka; color: var(--mauve-deep); text-align: center; }
.rg-mid { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.rg-item { width: clamp(110px, 20vw, 170px); aspect-ratio: 1; border-radius: 34px; background: #fff; box-shadow: var(--shadow); display: grid; place-items: center; }
.rg-item span { font-size: clamp(70px, 13vw, 110px); line-height: 1; }
.rg-item.pop { animation: popin .5s var(--spring), bob 1.6s ease-in-out .5s infinite; }
@keyframes bob { 50% { transform: translateY(-8px); } }
.rg-item.fly { transition: transform .42s cubic-bezier(.5, -0.4, .6, 1), opacity .42s; transform: translate(-160%, -30%) scale(.35); opacity: 0; }
.rg-item.fly.right { transform: translate(160%, -30%) scale(.35); }
.rg-dots { display: flex; gap: 8px; }
.rg-dots i { width: 14px; height: 14px; border-radius: 50%; background: var(--mauve-soft); }
.rg-dots i.cur { background: var(--mauve); transform: scale(1.25); }
.rg-dots i.ok { background: var(--vert); }
@media (max-width: 640px) { .rg { gap: 8px; } .rg-bin { min-height: 150px; } }

/* ---------- v14 : le nom sous chaque réponse, récitée en s'allumant ---------- */
.ans.has-lab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 8px; }
.ans.has-lab .emo { font-size: clamp(54px, 10vw, 104px); }
.ans.sm.has-lab .emo { font-size: clamp(44px, 8vw, 76px); }
.ans.has-lab .col { width: 58%; }
.ans.has-lab .num { font-size: clamp(54px, 9vw, 96px); }
.lab { font: 700 clamp(13px, 1.8vw, 17px)/1.15 Nunito; color: var(--ink); text-align: center; max-width: 100%; }
.ans.lit { transform: scale(1.14) translateY(-6px); box-shadow: 0 0 0 7px var(--jaune), 0 16px 30px rgba(255, 201, 60, .35); transition: transform .3s var(--spring), box-shadow .3s; }
.ans.lit .lab { color: var(--mauve-deep); }
.ans.ready:not(.no):not(.win) { animation: tapme 1.6s ease-in-out infinite; }
.ans.ready:nth-child(2) { animation-delay: .25s; } .ans.ready:nth-child(3) { animation-delay: .5s; }
@keyframes tapme { 0%, 70%, 100% { transform: scale(1); } 80% { transform: scale(1.06); } }
.rg-item { flex-direction: column; gap: 2px; }
.rg-item .lab { font-size: 15px; }
.rg-item { display: flex; align-items: center; justify-content: center; }
.lab { font: 800 clamp(15px, 2.2vw, 20px)/1.15 Nunito; }

/* ---------- v15 : passage revu bien visible ---------- */
.rewind { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: rgba(255, 255, 255, .92); animation: enter .35s var(--spring); }
.rewind span { font-size: clamp(90px, 18vw, 150px); animation: rewind .7s ease-in-out 2; }
.rewind b { font: 700 clamp(30px, 6vw, 52px) Fredoka; color: var(--mauve-deep); }
@keyframes rewind { 50% { transform: translateX(-24px) scale(1.1); } }
.replay-banner { display: none; align-items: center; gap: 14px; margin: 0 0 10px; padding: 10px 16px; border-radius: 18px; background: #FFF6D8; border: 3px solid var(--jaune); font: 700 19px Fredoka; color: #7A5A00; }
.replay-banner.on { display: flex; }
.replay-banner i { flex: 1; height: 10px; border-radius: 9px; background: #FFE9A6; overflow: hidden; }
.replay-banner b { display: block; height: 100%; width: 0; background: var(--orange); border-radius: 9px; }
#s-play.fs .replay-banner { order: -1; margin: 6px 10px 4px; width: min(100%, calc((100dvh - 140px) * 16 / 9)); }

/* ---------- v16 : icônes 3D Fluent ---------- */
img.ico { width: 1em; height: 1em; object-fit: contain; display: inline-block; vertical-align: middle; user-select: none; -webkit-user-drag: none; }
.ans .ico.emo { filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .12)); }
.decor img.ico { width: 1em; height: 1em; }

/* Correctif (lenteurs) : l'écran de jeu fermé reste au-dessus de la vidéo.
   Une fois le fondu fini, il est masqué et plus rien n'y bouge. */
.quiz:not(.on) { visibility: hidden; transition: opacity .35s, transform .45s var(--spring), visibility 0s .45s; }
.quiz.on { visibility: visible; transition: opacity .35s, transform .45s var(--spring), visibility 0s; }
#s-play:not(.asking) .quiz * { animation-play-state: paused !important; }
body.playing #hud-mascot .eye { animation: none; }

/* ---------- v17 : memory (4 cartes, 2 images) ---------- */
.memo { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; width: min(320px, 74vw); }
.mc { aspect-ratio: 1; border: 0; padding: 0; background: none; cursor: pointer; perspective: 900px; }
.mc-in { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; transform: rotateY(180deg); transition: transform .45s var(--spring); }
.mc.up .mc-in { transform: none; }
.mc-face, .mc-back { position: absolute; inset: 0; border-radius: 26px; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; box-shadow: var(--shadow); }
.mc-face { background: #fff; transition: box-shadow .2s; }
.mc-face img.ico, .mc-face .emo { width: 56%; height: 56%; font-size: 64px; }
.mc-face .lab { font: 800 16px Nunito; color: var(--ink, #2b2140); }
.mc-back { transform: rotateY(180deg); background: linear-gradient(135deg, var(--mauve), #A77BFF); color: #fff; font: 700 64px Fredoka; }
.mc.lit .mc-face { box-shadow: 0 0 0 6px var(--jaune), var(--shadow); }
.mc.win .mc-face, .mc.reveal .mc-face { box-shadow: 0 0 0 6px var(--vert), var(--shadow); }
.mc.no .mc-face { box-shadow: 0 0 0 6px #FF5A5F, var(--shadow); }
.mc.no { animation: shake .5s; }

/* v18 : âges de 2 à 19 ans dans l'onboarding */
#ages { max-width: 580px; margin-inline: auto; gap: 12px; }
#ages .age { width: 60px; height: 60px; font-size: 26px; }
#ages .age.on { transform: scale(1.15); outline-width: 4px; box-shadow: 0 0 0 7px var(--mauve), var(--shadow); }

/* v19 : mascotte pièce de puzzle */
.mascot .m-open { transform-box: fill-box; transform-origin: center; }
.mascot .m-arm { transform-box: view-box; transform-origin: 150px 148px; }
.mascot.wave .m-arm, .mascot.happy .m-arm { animation: wave .5s ease-in-out 4 alternate; }
@keyframes wave { from { transform: rotate(-10deg); } to { transform: rotate(22deg); } }

/* Barre de recherche comme YouTube : croix pour effacer, suggestions et recherches récentes */
.search .q-clear { display: none; flex: none; width: 40px; height: 40px; margin: auto 2px; background: none; border-radius: 50%; place-items: center; }
.search.filled .q-clear { display: grid; }
.search .q-clear svg { width: 20px; stroke: #6B6680; stroke-width: 2.4; }
.search .q-clear:hover { background: rgba(23, 18, 43, .06); }
.suggest .sg-row { display: flex; align-items: center; gap: 4px; }
.search .suggest [data-s] { flex: 1; min-width: 0; }
.suggest [data-s] svg { flex: none; width: 20px; fill: none; stroke: #6B6680; stroke-width: 2.2; stroke-linecap: round; }
.suggest button span { opacity: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search .suggest .sg-del { flex: none; width: 36px; height: 36px; padding: 0; display: grid; place-items: center; border-radius: 50%; }
.search .suggest .sg-del svg { width: 16px; stroke: #6B6680; stroke-width: 2.4; stroke-linecap: round; }
.search .suggest .sg-del:hover { background: rgba(23, 18, 43, .06); }
.empty.offline { display: grid; justify-items: center; gap: 14px; padding: 40px 16px; text-align: center; }

/* Accueil et thèmes en grille, comme la page d'accueil de YouTube */
.rlist.grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 28px 18px; }
.card.tile .thumb { border-radius: 16px; }
.card.tile h4 { margin: 10px 2px 4px; font-size: 16px; }
.card.tile p { margin: 0 2px; font-size: 14px; }
.card.tile:hover { transform: none; }
.card.tile:hover .thumb { transform: scale(1.02); }
.card.tile .thumb { transition: transform .3s var(--spring); }
.home .chips { padding-top: 16px; }
@media (max-width: 860px) {
  /* Sur téléphone, les catégories tiennent sur une ligne qui défile, comme sur YouTube */
  .home .chips { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; margin: 0 -14px; padding: 14px 14px 16px; gap: 8px; }
  .home .chip { font-size: 14px; padding: 9px 15px; }
  .home .chip.on { transform: none; }
}
/* La ligne de catégories ne doit pas élargir la page (sinon la grille passe à 2 colonnes coupées) */
.yt-main, .yt-main > .view { min-width: 0; }

/* ---------- 27/10 (demandes de Bilal) : en-tête mobile, page vidéo au téléphone ---------- */
/* 1. En-tête mobile comme YouTube : « Yukiz » à gauche (retour à l'accueil), le rond du profil tout à droite */
@media (max-width: 860px) {
  .top .brand b { display: inline; font-size: 22px; }
  .top .avatar-btn { margin-left: auto; }
}
/* 2. Téléphone à la verticale : « Prochain jeu dans … » passe sur sa propre ligne, juste au-dessus de la barre de jeu */
@media (max-width: 700px) and (orientation: portrait) {
  #s-play.fs .hud { flex-wrap: wrap; height: auto; row-gap: 2px; padding: 6px 12px 4px; }
  #s-play.fs .hud-bubble { order: 10; flex-basis: 100%; text-align: center; font-size: 15px; white-space: normal; transform: none; }
  #s-play.fs .hud .mascot.small { margin-right: auto; }
}
/* 3. Téléphone à l'horizontale : plein écran comme YouTube ; la vidéo prend toute la hauteur
   et la barre de jeu reste lisible, posée en haut par-dessus la vidéo (les commandes YouTube restent en bas). */
@media (orientation: landscape) and (max-height: 500px) {
  #s-play.fs { background: #000; }
  #s-play.fs .hud { position: absolute; top: 0; left: 0; right: 0; z-index: 6; height: 44px; padding: 0 12px; gap: 10px; background: linear-gradient(rgba(18, 12, 36, .9), rgba(18, 12, 36, .55)); }
  #s-play.fs .hud .mascot.small { width: 34px; height: 34px; }
  #s-play.fs .hud-bubble { font-size: 15px; }
  #s-play.fs .stars-count { padding: 4px 10px; font-size: 16px; }
  #s-play.fs .fs-btn, #s-play.fs .lock { width: 34px; height: 34px; font-size: 16px; }
  #s-play.fs .watch { padding: 0; }
  #s-play.fs .main-col { position: relative; }
  #s-play.fs .timeline { position: absolute; z-index: 5; top: 44px; left: 50%; transform: translateX(-50%); width: min(92vw, 720px); height: 40px; margin: 0; border-radius: 0 0 14px 14px; background: rgba(18, 12, 36, .55); }
  #s-play.fs .player-box { height: 100dvh; }
  #s-play.fs .player-wrap { width: min(100vw, calc(100dvh * 16 / 9)); border-radius: 0; box-shadow: none; }
  #s-play.fs .prep-pill { display: none; }
  #s-play.fs .replay-banner { position: absolute; z-index: 5; top: 88px; left: 50%; transform: translateX(-50%); margin: 0; width: min(92vw, 520px); }
}
